Standard WordPress Plugin Autoloader

Overview

Standard WordPress Plugin Autoloader

The autoloader standard and maintain code quality, You can use your WordPress plugins project. Basically, the autoloader I made for Envato and all premium WordPress plugin marketplace.

Envato marketplace recommend unique namespace if you use namespace. Built in Object-Oriented Programming paradigm is the best security pattern, that best for future.

Getting Started

This particular section is for those who want to use the autoloader. If you're looking to contribute to the codebase, please see the section below.

  1. Clone or download this repository.
  2. Copy the includes directory into the root of your project.
  3. Add require_once plugin_dir_path(__FILE__) . '/includes/autoloader.php to your main plugin file.

An Example

This autoloader expects several things:

  1. You're following the WordPress Coding Standards as it relates to naming your classes.
  2. The structure of your namespaces follows the structure of your directory structure

I've provided an example below for how both your code and your directory should be organized to take advantage of the autoloader.

The Directory Structure

And that all of the rest of the files are located in a directory structure like this:

+ plugin-name
|
|   includes
|       Admin
|         Admin.php
|
|       API
|         API.php
|
|       Helper
|         Helper.php
|
|       autoloader.php
|
|   plugin-name.php

Adding The Autoloader

Then, at the top of your plugin file add the following:

require_once plugin_dir_path(__FILE__) . '/includes/autoloader.php';

Then, register your namespace add the following:

\MizanExpert\Autoloader::get_instance()->register();
\MizanExpert\Autoloader::get_instance()->add_namespace(
    'MizanExpert',
    realpath(plugin_dir_path(__FILE__) . '/includes')
);

Other Information

If you're interested in contributing, reading more, and or following changes (all of which is welcome), please read below.

  • The project is licensed GPL.
  • If you're interested in contributing, please read this document.
  • See the CHANGELOG for a complete list of changes.
You might also like...
Pattern Lab Standard Edition for Twig

Pattern Lab Standard Edition for Twig The Standard Edition for Twig gives developers and designers a clean and stable base from which to develop a Twi

Automate aggregation tools to standard alerts from SAP PI/PO (CBMA) for internal support team
Automate aggregation tools to standard alerts from SAP PI/PO (CBMA) for internal support team

✅ PiAlert PiAlert is system for automating the work of SAP PI/PO support team via aggregation of alerts (CBMA messages). Language support: English Рус

Check modules in app/code and vendor for PHP 8 compatibility status - PHP_CodeSniffer & php-compatibility standard
Check modules in app/code and vendor for PHP 8 compatibility status - PHP_CodeSniffer & php-compatibility standard

M2 PHP version compatibility check How To use Requires PHP 7.3+ | PHP 8 This app will run PHP_CodeSniffer with phpcompatibility/php-compatibility on t

A wrapper around symplify/config-transformer used to update recipes and using easy coding standard for generating readable config files.

Symfony Recipes Yaml to PHP Converter This is a wrapper around the symplify/config-transformer used to convert Symfony core recipes which uses .yaml c

Psl is a standard library for PHP, inspired by hhvm/hsl
Psl is a standard library for PHP, inspired by hhvm/hsl

📚 PHP Standard Library - a modern, consistent, centralized, well-typed, non-blocking set of APIs for PHP programmers

⚙️ A WordPress plugin to set WordPress options from a .env file.

dotenv A WordPress plugin to set WordPress options from a .env file. Any WPENV_ prefixed variables in the .env will be used to override the WordPress

Thirdweb-wp - A community WordPress plugin for thirdweb. Turn your WordPress website into Web3 instantly and easily with thirdweb. 💻🌏

Thirdweb WP 📢 Nominate (@WarenGonzaga) as GitHub Star. If you appreciate his hardwork and dedication to open source. A community WordPress plugin for

A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress.
A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress.

GitScrum Plugin for Wordpress A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress. GitS

A plugin manager for PocketMine-MP downloads plugin from PocketMine-MP official plugin repository

oh-my-pmmp A plugin manager for PocketMine-MP Getting Started Prerequisites Your server MUST RUN the latest version of PocketMine. Installation From P

Owner
Md Mizanur Ali
Dedicated and efficient web software engineer with 4+ years experience in web application layers, presentation layers, and databases.
Md Mizanur Ali
Api.video-wordpress-plugin - The official api.video plugin for WordPress

api.video WordPress Plugin api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managin

api.video 5 Oct 19, 2022
This shell script and PHP file create a browseable HTML site from the Zig standard library source.

Browseable Zig standard library This shell script and PHP file create a browseable HTML site from the Zig standard library source. The idea is to inve

Dave Gauer 3 Mar 20, 2022
Magento 1.x Coding Standard

Magento Extension Quality Program Coding Standard ⚠️ Versions 3.0.0 and above of the MEQP Coding Standard are for Magento 1.x code only. To check Mage

Magento 224 Nov 29, 2022
Magento Coding Standard

Magento Coding Standard A set of Magento rules for PHP_CodeSniffer tool. Installation within a Magento 2 site To use within your Magento 2 project you

Magento 290 Dec 31, 2022
Igbinary is a drop in replacement for the standard php serializer.

igbinary Igbinary is a drop in replacement for the standard php serializer. Instead of the time and space consuming textual representation used by PHP

Igbinary development 727 Dec 21, 2022
A Symfony2 bundle that integrates Select2 as a drop-in replacement for a standard entity field on a Symfony form.

select2entity-bundle Introduction This is a Symfony bundle which enables the popular Select2 component to be used as a drop-in replacement for a stand

Ross Keatinge 214 Nov 21, 2022
This package provides a set of factories to be used with containers using the PSR-11 standard for an easy Doctrine integration in a project

psr-container-doctrine: Doctrine Factories for PSR-11 Containers Doctrine factories for PSR-11 containers. This package provides a set of factories to

Roave, LLC 84 Dec 14, 2022
This tool can write the monolog standard log directly to clickhouse in real time via the tcp protocol

log2ck This tool can write the monolog standard log directly to clickhouse in real time via the tcp protocol. If you can write regular rules, other st

Hisune 9 Aug 15, 2022
Easy Coding Standard configurations for Craft CMS projects.

Easy Coding Standard config for Craft CMs This package provides Easy Coding Standard configurations for Craft CMS plugins and projects. In general, we

Craft CMS 10 Dec 18, 2022