Questions tagged [composer]
Composer is a dependency manager for PHP.
42 questions
0
votes
1
answer
57
views
Using Composer in Plugin
I am learning WordPress Plugin development. I am going to submit the plugin in wordpress.org.
In this regard how can I use Composer in my plugin ?
When should I run composer install ? Should I run ...
0
votes
1
answer
3k
views
Debugging deprecated/renamed PSR-0 classes being requested
After upgrading to 6.2 via WP-CLI I get an error regarding deprecated/renamed PSR-0 classes being requested.
The source comment from WP core says:
/*
* Integrators who cannot yet ...
1
vote
1
answer
79
views
Is there any performance difference between duplicating composer packages among multiple plugins and not doing it? How can I avoid it?
The whole point of PHP Composer is to handle dependencies in a clean way, so that developers don't need to care about duplication, updates, and instantiating the necessary classes when needed.
But ...
0
votes
0
answers
120
views
How do I package and distribute my WordPress plugin via git?
I wrote a custom plugin for saving an uploaded .xlsx file to a .csv file. The code required an outside library and I used composer to install the code into my plugin's directory. So now I have this ...
2
votes
1
answer
335
views
How to install WordPress with Composer?
I want to install WordPress and WP CLI both with Composer.
This is how I install Drupal and Drush (Drupal's CLI tool) with Composer:
cd WEB_APPLICATION_ROOT
composer create-project drupal/recommended-...
0
votes
1
answer
334
views
Include Carbon Fields via Composer with Mozart [closed]
Coen Jacobs' Mozart is a tool to prevent namespace conflicts in Wordpress themes/plugins which utilize Composer for dependency management. It's similar to PHP Scoper but is described as simpler and ...
1
vote
0
answers
338
views
Wordpress composer issues
I'm using composer to install wordpress but I have a situation when I run composer install I end up with a nested wp-content directory as follows. (Wordpress is the root install directory)
wordpress/...
0
votes
0
answers
94
views
Wordpress Bedrock breaking plugin links
I recently switched to using WP-Bedrock and I currently like the workflow but there's a huge drawback for me.
There are 2 URLs which previously were identical, due to Bedrock's file structure, are ...
0
votes
1
answer
140
views
Use Composer Package inside class - Namespacing error
I have my theme, with a folder called classes, with a single class:
wp-content
|- themes
|- mycustomtheme
|- classes
|- FooBar.php
In FooBar, I would like to use this package here: ...
0
votes
1
answer
1k
views
composer not working on my plugin when i upload it to my website
im working in a plugin in localhost, it works fine in my localhost website
im using composer in it but then when i upload it to my website then it trows a fatal error because composer autoload is not ...
2
votes
1
answer
318
views
How can I have case-sensitive theme directory names when installed with Composer?
I'm using SatisPress (https://github.com/cedaro/satispress) to expose some premium plugins and themes as composer packages, because I would like to use the roots/bedrock boilerplate.
Now I have the ...
0
votes
0
answers
32
views
How to handle theme activation errors?
I am trying to implement the hook for activating a theme, that will install composer dependencies upon activation. In trying to figure out how to handle whether or not the vendor directory exists, I ...
1
vote
2
answers
681
views
Deploying WordPress with Composer
I have been looking into setting up WordPress and its plugins and themes using composer. I notice alot of the tutorials around have composer installing wordpress into its own sub directory for example ...
0
votes
1
answer
411
views
Plugin development and composer
I'm developing a plugin and I'm quite new in that, so I trying to find the best solution for how to integrate composer with my plugin.
The problem is that the SDK which I need is quite big, and when ...
1
vote
1
answer
3k
views
Use composer to load custom classes [closed]
I want to use composer to load my custom classes inside my plugin. I've tried to use it but without success. Is possible to use compose for the plugin develop to manage custom classes used inside it? ...
0
votes
1
answer
289
views
local wordpress multisite not working on AWS development server "error establishing database connection"
I have a composer WP starter installation on my local mac using mamp. It works as expected. I'm using phpdotenv to hide my wp-config.php settings and I have the wordpress directory moved into a sub-...
-1
votes
1
answer
187
views
Composer fails to download PHP Codesniffer to plugin
I am getting an error when trying to install the squizlabs/php_codesniffer package via composer into my WordPress plugin.
I am using Flywheel for the local server, with composer 1.8.6 installed ...
1
vote
1
answer
313
views
How to provide a plugin which requires CMB2 (plugin dependencies)?
Every serious plugin developer probably has to deal with this problem: WordPress is not supporting composer or any dependency management by default. I have written a great plugin which I would like to ...
0
votes
0
answers
906
views
Wordpress visual composer backend editor not showing
I have a problem with my WordPress visual composer.
It's working in woo commerce during uploading of pictures and content but not showing in page edit. Whenever I try to edit page, it's just showing ...
0
votes
0
answers
1k
views
How to properly use composer packages in wordpress?
I need to implement in a wordpress instance a feature that allows me to search for the most recent file with extension .xlsx in the wp-content/upload directory, once the file has been identified, it ...
2
votes
1
answer
143
views
In a continuous integration environment how do you implement the database entries for plugins and themes
I'm setting up a wordpress continuous integration environment - git->composer->bitbucket-AWS codepipeline, etc.
I have yet to figure out how I automate, for the development team, the setup of the ...
1
vote
0
answers
235
views
How do I configure wordpress structure for development using git and composer
I've been developing in other languages and web frameworks and I'm now starting with a Wordpress project.
I'm used to using git and a package manager, but Wordpress development poses some unique ...
0
votes
0
answers
79
views
HowTo: Properly Use a Classname in register_activation/deactivation_hook [duplicate]
I'm using Composer PSR-4 to autoload classes, but when I try to call register_activation_hook using a classname if get the following error (same for register_deactivation_hook):
call_user_func_array()...
1
vote
2
answers
2k
views
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 ...
0
votes
1
answer
2k
views
How can I search all plugins for composer's vendor/autoload.php?
I've got projects (both themes and plugins) set up as composer projects. These projects can be dev-dependencies of each other. Right now I'm working on a theme which requires the vendor/autoload.php ...
1
vote
1
answer
547
views
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 ...
0
votes
1
answer
4k
views
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 ...
0
votes
0
answers
176
views
NGINX: Remove WordPress subdirectory from url [duplicate]
I have installed WordPress core in a subdirectory as I am using composer.
The root is /www/example.com/ and WordPress is placed in /www/example.com/wp/
In the root is index.php and wp-config.php.
...
0
votes
2
answers
1k
views
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 ...
2
votes
1
answer
947
views
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 ...
6
votes
1
answer
2k
views
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() . '/...
1
vote
3
answers
2k
views
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 ...
7
votes
2
answers
2k
views
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?
0
votes
2
answers
527
views
How to update WP-CLI on Windows via Composer?
I installed wp-cli back in April on my Windows box using composer. I believe with the following command: composer create-project wp-cli/wp-cli --no-dev as outlined in the alternate install methods on ...
1
vote
1
answer
188
views
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?
...
2
votes
0
answers
171
views
Wordpress with Composer and different plugins for dev/live.
I'm using a Bedrock-like setup where I handle Wordpress core & plugins with Composer. I have my usual plugins in my composer.json within the "require" block, and some dev related plugins in "...
1
vote
0
answers
339
views
How to use Wordpress methods (themes, plugins, context) with Behat?
My Wordpress project is running with a composer inside my plugin folder, just to test Behat a little bit, i'm not using Bedrock Wordpress yet.
I can run Behat to do some behavior tests using the ...
14
votes
3
answers
4k
views
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 ...
3
votes
1
answer
1k
views
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 ...
0
votes
2
answers
118
views
How to install WPMU with composer?
I am looking for a way to install WPMU and a premium ACF plugin with composer, but have not found any functional way of installing them. The best alternativ I found is to upload them to a private ...
4
votes
1
answer
166
views
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, ...
6
votes
1
answer
2k
views
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 ...