Cliff Wp Plugin Boilerplate

screenshot of Cliff Wp Plugin Boilerplate
react
tailwind

Cliff's WordPress plugin boilerplate

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.

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.

react
React

React is a widely used JavaScript library for building user interfaces and single-page applications. It follows a component-based architecture and uses a virtual DOM to efficiently update and render UI components

tailwind
Tailwind

Tailwind CSS is a utility-first CSS framework that provides pre-defined classes for building responsive and customizable user interfaces.

postcss
Postcss

PostCSS is a popular open-source tool that enables web developers to transform CSS styles with JavaScript plugins. It allows for efficient processing of CSS styles, from applying vendor prefixes to improving browser compatibility, ultimately resulting in cleaner, faster, and more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.