Composer Generator
Create composer.json file from current plugins available on WPackagist.org.
by Ross Mulcahy · github.com/ross-mulcahy/wp_composer_generator
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ross-mulcahy/wp_composer_generator/archive/refs/heads/main.zipComposer Generator for WordPress
Generate composer.json files for your WordPress plugins automatically. This plugin helps you manage your WordPress plugins using Composer by creating a properly formatted composer.json file based on your currently installed plugins.
Features
- Automatically detects installed plugins
- Generates a properly formatted composer.json file
- Verifies plugin availability on WPackagist
- Easy one-click copy to clipboard
- Clear installation instructions
- Compatible with WordPress Multisite
Installation
- Download the plugin
- Upload to your
/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Access the tool via Tools > Composer in your WordPress admin
Usage
- Navigate to Tools > Composer in your WordPress admin panel
- Click "Generate composer.json" to create your composer configuration
- Copy the generated JSON to a file named
composer.jsonin your wp-content directory - Run
composer updatein your terminal - If any packages are flagged as missing, remove them using:
composer remove wpackagist-plugin/plugin-name - Run
composer updateagain
Requirements
- WordPress 5.0 or higher
- PHP 7.2 or higher
- Composer installed on your server
- Write access to your wp-content directory
How It Works
The plugin:
- Scans your WordPress installation for active plugins
- Checks each plugin against the WPackagist repository
- Generates a composer.json file with proper version constraints
- Includes necessary repository configurations for WPackagist
- Sets up proper installer paths for WordPress plugins
Common Issues
Missing Plugins
Some plugins might not be available on WPackagist. These will need to be managed manually or through alternative means.
Version Conflicts
If you encounter version conflicts:
- Check the specific version requirements
- Update your plugins to compatible versions
- Remove problematic plugins from composer.json if necessary
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the GPL v3 or later.
Credits
- Composer - Dependency Manager for PHP
- WPackagist - WordPress Plugin Directory as a Composer Repository
Author
Ross Mulcahy
Changelog
1.1.1
- Added comprehensive documentation
- Improved code organization
- Enhanced UI with wider cards
- Added better code comments
1.1.0
- Added copy to clipboard functionality
- Improved error handling
- Enhanced UI styling
1.0.0
- Initial release
- Basic composer.json generation
- Plugin detection functionality