Download the PHP package wp-plus/wp-oop-base without Composer

On this page you can find all versions of the php package wp-plus/wp-oop-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-oop-base

WP OOP Base

An opinionated object-oriented base library for WordPress plugin and theme development, providing a structured foundation for building maintainable WordPress extensions.

Overview

WP OOP Base offers a collection of abstract classes and interfaces that promote clean, object-oriented architecture in WordPress development. It provides standardized patterns for common WordPress functionality including plugins, hooks, shortcodes, custom post types, and taxonomies.

Features

Requirements

Installation

Via Composer

When installed via Composer, the library is automatically loaded through Composer's autoloader and doesn't need to be placed in the WordPress plugins directory. Simply include Composer's autoloader in your project and the classes will be available.

Note: this will work only if Composer's autoloader is included - either manually or using a tool like composer-autoload for WordPress.

Manual Installation

  1. Download the library
  2. Place it in your wp-content/plugins/wp-oop-base/ directory
  3. Activate the plugin through the WordPress admin

Must-Use Plugin Installation

For must-use plugin functionality (automatically loaded, before regular plugins):

  1. Follow the manual installation steps above
  2. Move wp-oop-base.php to wp-content/mu-plugins/
  3. Keep all other files in wp-content/plugins/wp-oop-base/

The bootstrap file will automatically detect the correct paths whether it's running as a regular plugin or must-use plugin.

Quick Start

Creating a Plugin

Creating a Hook

Creating a Shortcode

Creating a Custom Post Type

Architecture

Core Components

Plugin System

Hook System

Registration System

Content Types

Other

Design Patterns

Singleton Pattern

All plugin classes use the singleton pattern to ensure single instances:

Convenient Static Methods

The library provides convenient static methods for common operations:

Registration Pattern

Components implement a consistent registration/unregistration pattern:

Helper Classes

DateTime Helper

Utilities for WordPress-aware date/time formatting:

Post Helper

Utilities for post operations:

Database Access Trait

Convenient access to the WordPress database object:

Advanced Usage

Extensible Plugins

Create plugins that can contain other plugins:

Multi-Hooks

Register multiple related hooks together:

Best Practices

  1. Use Dependency Injection: Set dependencies via setters in plugin constructors
  2. Follow WordPress Coding Standards: Maintain consistency with WordPress conventions
  3. Implement Proper Error Handling: Use exceptions for configuration errors
  4. Validate Input: Always validate and sanitize user input in shortcodes and hooks
  5. Use Static Methods Judiciously: Static convenience methods create new instances each time they're called

Contributing

Contributions are welcome! Please ensure your code follows PSR-4 autoloading standards and includes appropriate documentation.

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of wp-oop-base with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wp-plus/wp-oop-base contains the following files

Loading the files please wait ...