Cliff Wp Plugin Boilerplate screenshot

Cliff Wp Plugin Boilerplate

Author Avatar Theme by Cliffordp
Updated: 20 Dec 2020
74 Stars

Cliff's WordPress plugin boilerplate

Categories

Overview

The WordPress Plugin Boilerplate is a robust and comprehensive boilerplate that provides a foundation for developing WordPress plugins. It incorporates a range of features including automated tests, React, Composer, PHP Namespaces, and the WordPress Customizer. The boilerplate follows best practices and coding standards, making it easy to develop plugins while ensuring compatibility and maintainability. With thorough code documentation and regular updates, the plugin boilerplate offers a reliable and efficient starting point for building WordPress plugins.

Features

  • Automated tests: The boilerplate includes automated tests using the WPBrowser (Codeception) framework. These tests are set up to run on GitHub Actions and provide an easy way to ensure the functionality of your plugin.
  • React integration: The plugin boilerplate includes support for React, allowing you to build interactive and dynamic user interfaces for your plugin.
  • Composer integration: Composer is used to manage dependencies and facilitate easy installation and updates of the plugin.
  • PHP Namespaces: The boilerplate utilizes PHP namespaces, providing a clean and organized structure for your plugin’s code.
  • WordPress Customizer integration: The boilerplate includes a wp-admin Settings page with React components and the WordPress Customizer integration. This allows you to easily create and manage plugin settings and options.
  • Strict file organization: The plugin follows a strict file organization scheme, aligning with the structure of the WordPress Plugin Repository. This makes it easy to organize and manage the files that make up your plugin.
  • Internationalization support: The boilerplate includes a .pot file as a starting point for internationalization, allowing you to easily translate your plugin into different languages.
  • Tailwind CSS framework: The boilerplate allows you to use the Tailwind CSS framework, providing a wide range of pre-built classes for styling your plugin. The CSS is optimized to only include the classes that are used, reducing the final file size.
  • Error handling: The plugin displays wp-admin error notices to administrators if the required version of PHP or a third-party plugin is not met, preventing fatal errors.
  • Utility functions: The plugin includes a set of utility functions that can be helpful in various scenarios, such as retrieving public post types or flattening arrays.

Installation

To install the WordPress Plugin Boilerplate, follow these steps:

  1. Download the boilerplate by cloning the repository or downloading the ZIP file.
  2. Rename the downloaded folder to reflect the name of your plugin.
  3. Copy the renamed folder to the “plugins” directory of your WordPress installation.
  4. Open the renamed folder and proceed with customizing the classes and files to fit your plugin’s needs.

Summary

The WordPress Plugin Boilerplate is a feature-rich foundation for developing WordPress plugins. With its support for automated tests, React, Composer, PHP Namespaces, and the WordPress Customizer, it offers a comprehensive set of tools and features to simplify and streamline plugin development. The strict file organization, thorough code documentation, and error handling capabilities further contribute to the efficiency and reliability of the boilerplate. By providing a complete starting point, the boilerplate allows developers to focus on adding their own functionality to create fully-functioning and customizable WordPress plugins.