WordPress Custom Repo Lite - WP plugin to update custom plugins/themes with custom repository.
- Create custom repo (e.g.
https://example.com/myrepo/
, see below) - Add
WPCRL_URL
constant to project:define ('WPCRL_URL', 'https://example.com/myrepo/');
- Add correspondent code to your custom components (plugin/theme) (see below).
- Custom repository can be static web-site.
- It should contain folders:
plugins/
themes/
- Both of folders should contain files like
mycomponent.json
with at least 2 keys:"version"
,"url"
(of new package). "url"
meta-key points to new zipball, that can be placed anywhere.
Custom component must have at least Version: ...
.
Add code below to your plugin's main file or theme's fuctions.php
:
add_filter('plugins_loaded', function() {
// theme: 'after_setup_theme' or 'init'
if ( class_exists( 'WPCRL\Core' ) )
WPCRL\Core::get_instance()->register_component( __FILE__ );
});
WPCRL_URL
- mandatory string to define custom repo base.WPCRL_LOG
- optional int (0..7) for logging (RTFMLOG_...
PHP constants).