Popup-Maker
Popup-Maker copied to clipboard
Change option to disable asset caching to select field.
This change allows us to offer additional options / modes:
- Auto
- Enabled
- Disabled
- Debug / Test (might run through several tests to find issues).
In the mean time, here is a method to force it on:
add_action( 'wp_enqueue_scripts', 'custom_force_pm_asset_caching', 11 );
function custom_force_pm_asset_caching() {
wp_deregister_script( 'popup-maker-site' );
$cached = get_option( 'pum-has-cached-js' );
if ( ! $cached ) {
PUM_AssetCache::cache_js();
$cached = get_option( 'pum-has-cached-js' );
}
wp_register_script( 'popup-maker-site', PUM_Site_Assets::$cache_url . '/' . PUM_AssetCache::generate_cache_filename( 'pum-site-scripts' ) . '.js?generated=' . $cached, array( 'jquery', 'jquery-ui-core', 'jquery-ui-position' ), Popup_Maker::$VER, true );
}
@danieliser What would each of these options do? I'm assuming enabled/disabled is like the checkbox we have now but how would "Auto" differ from what we have currently?
Would the "Debug" be just a button to push to do the tests or would it be an option in the drop-down? If an option, how would the caching behave while that setting is enabled?
@fpcorso Auto/Disabled would match what we have now. Enabled would force it on. Debug Test would make the admin notice show up every page load for logged in admins to work out why its not working correctly.
The last one is more of an after thought. But I could see it showing a green bar when its working correctly, and maybe recommending things like using Health Check etc for those that don't.