Wp Autoload with Namespaces WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
Wp Autoload with Namespaces (For better and clean plugin code using OOP)
★ 0stars
99composer installs
1.1.2latest · 8 years ago
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/mrimran/wpal-autoload/archive/refs/heads/master.zipOn Packagist as wpackagist-plugin/wpal-autoload:
composer require wpackagist-plugin/wpal-autoloadNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
A plugin to write better plugin code (Written for Developers by a Developer)
A Plugin that is going facilitate use of Namespaces and making it easier to load files using Namespaces in other plugins.
It makes possible to get rid of includeonce, requireonce, include and require as all of these methods make your code
look uglier and it becomes difficult to maintain that code. As to include other classes or functions properly you need
to append some paths and then have to mention the file name with the exact path.
This plugin needs you freedom of writing your code and organizing it based on your needed directory structure.
Guidlines
The only guidelines you need to follow are below:
- Namespace your classes and functions which you are separating so anything placed in
wp-content/plugins/TestPlugin/inc should be namespaced as TestPlugin\inc.
Whereas anything placed in wp-content/plugins/TestPlugin/Inc would be namespaced as TestPlugin\Inc.
- Filename should be same as of class name, but case doesn't matter because if Class name is
Test and the file name is test.php, the autoloader would still be able to load the correct file.
Usage
Now it's time to see how it'll help you to
Releases
5 releases.
Tag
Published
1.1.2
latest
Feb 13, 2018 8 years ago
Feb 13, 2018 8 years ago
Feb 13, 2018 8 years ago
Jul 26, 2017 9 years ago
May 23, 2017 9 years ago
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.