Articles of composer

WordPress with composer, how to handle updates?

I’m trying to step up my workflow a bit and I’m now trying out Composer to handle WordPress & WordPress plugins. I have never used Composer before and I’m getting quite confused as to how I’m suppose to update WordPress with this. I know I can just type Composer update after I change the WordPress […]

How to prevent Composer dependency conflicts amongst WP plugins?

In our plugin development we use Composer to install e.g. Symfony\Process that we later use in the code. The big question is how do we make sure that this dependency is not in a conflict with some other plugin also using Symfony\Process in another version. Now I know this is mostly an inherent PHP issue […]

Namespacing WordPress project according to FIG standards

I am trying to wrap my head around the namespaces, autoloaders and FIG standards and most importantly how to achieve their integration to WordPress as close as possible. Here is my file structure, created with help of awesome roots/bedrock WordPress stack. |– /web | |– /app | | |– /mu-plugins | | | |– autoload.php […]

Using composer for dependency management in plugindevelopment

I’m new to wordpress plugin development. Normally I would use composer to add thirdparty libs to my code, but I couldn’t find any wordpress plugin on github that uses composer for that. I read about wpackagist.org and the way composer can be used to manage dependencies between wordpress plugins. In this case there would be […]

Autoloading in Child Theme

I’m trying to autoload the vendor/autoload.php from my parent theme into my child theme. heres what i have tried but to no avail: function beast_theme_setup() { $var1 = get_theme_root_uri() . ‘/beast/vendor/autoload.php’; $var2 = get_theme_root_uri() . ‘/beast/functions.php’; $var = locate_template( array( $var1, $var2), true, false ); var_dump($var); } add_action( ‘after_setup_theme’, ‘beast_theme_setup’, 11 ); and include get_theme_root_uri() […]

Why include a composer.json file with my plugin?

What is the advantage of explicitly including a composer.json file in my plugin if potential users of my plugin can already get it as a package through WPackagist?