Articles of composer

Wp-CLI not working with WordPress installed with composer

I’ve installed a version of WordPress using composer, and modified the default folders for the content (/wp-content) and the core (/wp). My wp-config.php gets its DB_NAME, DB_USERNAME, DB_PASSWORD from environment variables defined in the .htaccess file. I am able to connect to my wordpress instance using my browser, so the connection information in there is […]

Ran into a problem installing plugins with Composer

I’m using Composer to install plugins with the wpackagist repository. I’ve added all the relevant lines to my composer.json file in my main wp/ directory. The plugin installed as expected (it’s this one if it makes any difference) to its own folder within wp/plugins/. The issue that I see now is that it doesn’t show […]

Composer setup-config.php not found

I’m trying to install WordPress on my localhost with composer. When I go to localhost I get redirected to localhost/wp-admin/setup-config.php. Instead of getting the install I’m getting the error The requested URL /wp-admin/setup-config.php was not found on this server. When i go to localhost/wordpress/wp-admin/setup-config.php it works? What am I doing wrong? This is my directory […]

Install wordpress using composer in a specific language

I’m using composer to automatically deploy wordpress on a ubuntu-server. Additionally, I need to install the german language pack. I learned that there are some guys who create composer-packages from the wordpress.org files. Using the following composer.json I get wordpress with german language pack: { “repositories”: [{ “type”: “composer”, “url”: “https://wp-languages.github.io” }], “require”: { “johnpbloch/wordpress”: […]

Using WordPress gettext functions in a library outside plugin or theme scope

If I have a library available through packagist that could be used in WordPress plugin or theme development, how should I address multilanguage support if I have a few strings that could be localized? I know that there has been some debate on composer usage in the WordPress world with very different views on it. […]

How to add in my plugin a third vendor Git project with composer.json

I need to use this Git project in my plugin. First I drop source code in a folder, and load it with require_once dirname(__FILE__) . ‘/vendor/Frozensheep/RightmoveADF/RightmoveADF.php’; But there is a problem, because although apparently one Class (for instance GetBranchPropertyList) is loaded by the namespace use: // use Frozensheep\RightmoveADF\Request\GetBranchPropertyList; // I get an error when invoke […]

Deploying WordPress with Bedrock/Capistrano on Siteground – Composer returns “text/html” message

I’ve been using Bedrock (https://roots.io/bedrock/) for a while to deploy WordPress websites, but have encountered some issues when deploying to a Siteground.com shared server. The issue is with composer. I can run composer globaly with no problem, but when I run it using Capistrano, it executes the command, but nothing actually happens. If I run […]

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 […]