My WordPress Plugin
Sample WordPress plugin with GitHub Actions CI.
by MD Siddiqur Rahman · github.com/siddik-web/my-wordpress-plugin
★ 0stars
0forks
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/siddik-web/my-wordpress-plugin/archive/refs/heads/main.zipA sample WordPress plugin demonstrating modern development practices, including PSR-4 autoloading, WordPress Coding Standards (WPCS), and automated CI with GitHub Actions.
Features
- PSR-4 Autoloading: Uses Composer for efficient class loading.
- WordPress Coding Standards: Configured with PHPCS and WPCS for high-quality, consistent code.
- Automated Testing: Includes PHPUnit for unit testing.
- GitHub Actions CI: Continuous Integration workflow that runs linting and tests on every push.
Requirements
- PHP: 7.0 or higher
- Composer
- WordPress: 5.0 or higher (recommended)
Installation
- Clone the repository into your WordPress plugins directory:
git clone https://github.com/siddik-web/my-wordpress-plugin.git - Navigate to the plugin directory:
cd my-wordpress-plugin - Install dependencies:
composer install - Activate the plugin through the WordPress Admin dashboard.
Development
Coding Standards
This project follows the WordPress Coding Standards.
- Check for issues:
composer phpcs - Automatically fix issues:
composer phpcbf
Running Tests
Unit tests are written with PHPUnit.
composer test
Project Structure
src/: Contains the plugin's core PHP classes (PSR-4).tests/: Unit tests for the plugin.my-wordpress-plugin.php: Main plugin entry file.phpcs.xml: Configuration for PHP_CodeSniffer.phpunit.xml.dist: Configuration for PHPUnit..github/workflows/: GitHub Actions CI configuration.
License
This project is licensed under the GPL-2.0-or-later License.
Author
- MD Siddiqur Rahman - siddikcoder@gmail.com