First of all, I would like to express my gratitude for the good work you are doing!
Could you please consider the possibility of adding add-ons functionality to the plugin? This will allow sites developers to use your plugin as a basis and gives the ability to flexibly configure the caching system for each specific site.
As one of the implementation options, I suggest you the scheme that I use on my sites.
- In the
wp-config.php file, add an array with absolute paths to add-ons bootstrap files as a constant or a global variable, for example:
define(
'CACHE_ENABLER_ADD_ONS',
array(
'/absolute/path/to/add-on1.php',
'/absolute/path/to/add-on2.php',
)
);
- In the
advanced-cache.php file, before other require_once add the following code:
if ( defined( 'CACHE_ENABLER_ADD_ONS' ) && is_array( CACHE_ENABLER_ADD_ONS ) ) {
foreach ( CACHE_ENABLER_ADD_ONS as $add_on ) {
if ( is_readable( $add_on ) ) {
require_once $add_on;
}
}
}
- Return values from all functions must be passed through filters, for example:
public static function get_cache_file() {
$cache_file = sprintf(
'%s/%s',
self::get_cache_file_dir(),
self::get_cache_file_name()
);
return apply_filters( 'cache_enabler_get_cache_file', $cache_file );
}
- Maybe, add additional actions and filters inside functions.
First of all, I would like to express my gratitude for the good work you are doing!
Could you please consider the possibility of adding add-ons functionality to the plugin? This will allow sites developers to use your plugin as a basis and gives the ability to flexibly configure the caching system for each specific site.
As one of the implementation options, I suggest you the scheme that I use on my sites.
wp-config.phpfile, add an array with absolute paths to add-ons bootstrap files as a constant or a global variable, for example:advanced-cache.phpfile, before otherrequire_onceadd the following code: