WP2

[!CAUTION] This project is currently under development and is not yet ready for production use. Information is subject to change.

🗂️ Overview

WP2 is an innovative and opinionated framework designed to simplify the creation and management of advanced WordPress websites. Built on top of WordPress core and leveraging powerful tools like Blockstudio, WP2 provides a streamlined environment for developing custom, scalable, and maintainable solutions, particularly focusing on PHP-based block creation.

WP2 aims to offer a robust boilerplate, serving as an excellent starting point for complex projects, enabling developers to build high-quality client experiences efficiently.

WP2 is NOT

  • A fork of the WordPress software.
  • Affiliated with or intended to replace the WordPress Foundation.
  • Restricted to conventional WordPress approaches.

✨ Features

  • Modular Architecture:Build sites using self-contained, reusable WP2 Modules that can span across mu-plugins, plugins, themes, or uploads directories for enhanced scalability and maintainability.
  • PHP-Only Block Creation:Develop custom Gutenberg blocks primarily using PHP and the standard block.json format, powered by Blockstudio.
  • Core Focused:Utilizes WordPress core and Gutenberg components effectively.
  • Server-Side Rendering:Employs PHP (or Twig) templates for dynamic block output, with enhanced editor interactivity.
  • File System-Based Registration:Automatically registers blocks and their assets (CSS, JS, templates) based on their location within a structured file system.
  • Zero-Setup Workflow:Simplifies asset enqueuing and supports various template engines (like Twig) by renaming file extensions.
  • Customizable Boilerplate:Provides a solid foundation that can be tailored to specific organizational or project needs.
  • Automatic Initialization:Core functionalities load automatically via Must-Use (MU) plugins, ensuring stability.
  • Dynamic Namespace Configuration:Allows customization of the core workspace for each installation using WP2_NAMESPACE and WP2_PREFIX constants, enabling multi-tenant configurations.
  • Integrated Build System Support:Designed to work with advanced build processes for compiling assets and code.
  • Modern PHP Standards:Adheres to current PHP and WordPress coding practices, including namespacing and Composer dependency management.
  • Enhanced Developer Experience:Offers a foundation for both front-end and back-end development, including custom blocks and advanced custom fields.
  • Version Control Friendly:Easily manage and track module changes using Git.
  • Admin Documentation:Access documentation directly from the WordPress admin interface.

🏗️ Architecture & Structure

WP2 mirrors the structure of WordPress core, combining the wp2 repository with a standard wp-content folder. Solutions are built as modules spanning across WordPress directories.

Key Components

WP2 Daemons

  • wp2-core/:Registers foundational elements (custom post types, taxonomies, statuses, patterns, etc.).
  • wp2-new/:Supports site cloning and automated installation processes.
  • wp2-studio/:Manages asset loading, templating engine integration (e.g., Twig), Tailwind CSS integration, and block rendering logic. Acts as the controller.

WP2 Plugins

WP2 Themes

🧩 Core Dependencies

WP2 builds upon and requires the following core dependencies:

  • WordPress: The underlying Content Management System.
  • Blockstudio: Essential for PHP-based block creation and build processes.
  • Meta Box: Used for creating custom fields, models, and settings panels.

🚀 Usage

WP2 is optimized for streamlined setup experiences, such as one-click installations and site cloning. WP2 Modules can be initialized and configured to meet specific needs, providing a robust boilerplate as a starting point for projects.

🛠️ Development Conventions

To ensure consistency and maintainability, WP2 promotes the following conventions:

  • File Splitting: Organize PHP logic into designated files (e.g., init-helpers.php, init-meta.php).
  • Use Blockstudio: Define blocks using block.json and register logic in index.php.
  • Use Meta Box: Leverage Meta Box for relationships, custom field groups, and settings panels outside of blocks.
  • Clear Structure: Maintain distinct namespaces and directories for types, blocks, and patterns.

📦 Extending WP2

The modular structure of WP2 is designed for extension. You can easily add custom blocks, post types, taxonomies, and other functionalities as needed.

📚 Documentation

Comprehensive documentation is intended to be accessible directly from the WordPress admin interface once WP2 is installed.

📞 Contact & Support

For bug reports, feature requests, or support, please contact the development team.

❤️ Sponsor & Contribute

WP2 is an open-source project. You can support its development or learn more about contributing via:

📜 License

This project is distributed under the terms of the MIT License and the GNU General Public License (GPL), alongside any vendor-included licenses (e.g., for dependencies like Blockstudio) that may apply.

Usage Permission

This license permits usage by all individuals and entities, excluding Matt Mullenweg and his alter egos, to the fullest extent permitted by law. By utilizing this project, users acknowledge these stipulations and the broader licensing framework, ensuring both compliance and the integrity of the collaborative environment fostered by this initiative. Users are encouraged to engage with the resources offered by this project, provided they adhere to these specified terms. For additional clarification concerning the ramifications of these licenses, users are invited to seek further information.

Preserving and protecting the freedom to use, study, copy, modify, and distribute WordPress.