Open centminmod opened 6 years ago
As this is my first Wordpress plugin not sure if it's correct to just use code like
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly add_filter('autoptimize_filter_cache_create_static_gzip','__return_true');
or should I be checking if Autoptimize plugin exists first ?
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if ( is_plugin_active('autoptimize/autoptimize.php') ) { add_filter('autoptimize_filter_cache_create_static_gzip','__return_true'); }
If any folks have suggestions, I am all ears and eyes :)
if AO is not active, the filter will just sit there silently without causing any problems whatsoever, so I would not bother with the overhead of is_plugin_active :)
As this is my first Wordpress plugin not sure if it's correct to just use code like
or should I be checking if Autoptimize plugin exists first ?
If any folks have suggestions, I am all ears and eyes :)