Skip to content

BetterEmbed integration for WordPress – Include the essential content of any website or service such as Facebook posts, Twitter tweets, Instagram posts, YouTube videos, WordPress Blogposts etc. into your own page without any extra effort.

Notifications You must be signed in to change notification settings

betterembed/wordpress-betterembed

Repository files navigation

BetterEmbed for WordPress

Free yourself from third party crap.

Installation

Composer

Since the plugin is currently still under development you can only install it with Composer.

If you're managing your whole stack with Composer you'll need to add the Github repository with something like this:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/betterembed/wordpress-betterembed"
        }
    ],
    "require": {
        "betterembed/wordpress-betterembed": "*"
    }
}

Please consult the Composer documentation on how to require from github.

If you're not managing your whole stack with Composer download or git clone from Github and run composer install --no-dev.

Later this plugin will probably be published as a package on Packagist as well as a regular plugin on wordpress.org.

If you just want to quickly try the plugin have a look at the "Development/Quick Start" section.

Development

For development and quick testing it is recommended to use the included Docker Compose setup.

It offers a quick and easy way to launch a complete development environment.

Quick start

To get yourself up and running quick just run the following commands:

docker-compose run --rm composer install
docker-compose run --rm wp bash docker/bootstrap.sh

If everything worked well you should see this line:

-------------------------------------------------------------------------------
 All ready! ${NC}"
 You can now open the demo page at http://localhost:8080/better-embed-demo/
 Or you can log in with user/password wp/wp http://localhost:8080/wp-login.php
-------------------------------------------------------------------------------

To stop the development environment run this command:

docker-compose stop

To restart the development environment run this command:

docker-compose up -d

To completely wipe the development environment including the database and uploads run this command:

docker-compose down -v

Installing dependencies

For local development you'll need to install dependencies:

 docker-compose run --rm composer install
 docker-compose run --rm scripts npm install

Building assets (JS, CSS)

This plugin uses the @wordpress/scripts package for development.

You can watch changes and automatically rebuild using the start script:

 docker-compose run --rm scripts npm run start

To run some checks on the codebase (e.g. linting) and build everything in a production ready way:

 docker-compose run --rm scripts npm run build

You should never commit anything created by the start script, always run the above build script before commiting.

Coding standards

This plugins coding standards are based on the WordPress Coding Standards for PHP_CodeSniffer with some adaptions as can be seen in the phpunit.xml.dist file.

You can automatically check your code style:

 docker-compose run --rm composer run-script phpcs

A lot of errors can even be fixed automatically:

 docker-compose run --rm composer run-script phpcbf

Running Tests with PHPUnit

To run the tests you need to initialize the testing instance environment once:

docker-compose run --rm tests bash docker/bootstrap-tests.sh

After that you can run tests for the PHP code using PHPUnit:

docker-compose run --rm tests

License

GPL 2.0 or later

About

BetterEmbed integration for WordPress – Include the essential content of any website or service such as Facebook posts, Twitter tweets, Instagram posts, YouTube videos, WordPress Blogposts etc. into your own page without any extra effort.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published