requirements_met() ) { add_action( 'admin_notices', [ plugin_requirements_checker(), 'show_requirements_errors' ] ); // Deactivate plugin immediately if requirements are not met. require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); deactivate_plugins( plugin_basename( __FILE__ ) ); return; } /** * The core plugin class that is used to define internationalization, * admin-specific hooks, and frontend-facing site hooks. */ require_once plugin_dir_path( __FILE__ ) . 'includes/class-a2-optimized.php'; /** * Begins execution of the plugin. * * Since everything within the plugin is registered via hooks, * then kicking off the plugin from this point in the file does * not affect the page life cycle. * * @since 3.0.0 */ $router_class_name = apply_filters( 'a2_optimized_router_class_name', '\A2_Optimized\Core\Router' ); $routes = apply_filters( 'a2_optimized_routes_file', plugin_dir_path( __FILE__ ) . 'routes.php' ); $GLOBALS['a2_optimized'] = new A2_Optimized( $router_class_name, $routes ); register_activation_hook( __FILE__, [ new A2_Optimized\App\Activator(), 'activate' ] ); register_deactivation_hook( __FILE__, [ new A2_Optimized\App\Deactivator(), 'deactivate' ] ); if (get_option('a2_cache_enabled') == 1) { if(in_array('litespeed-cache/litespeed-cache.php', apply_filters('active_plugins', get_option('active_plugins')))){ A2_Optimized_Cache_Disk::clean(); update_option('a2_cache_enabled', 0); } else { add_action('plugins_loaded', [ 'A2_Optimized_Cache', 'init' ]); } } if(is_admin()){ new A2_Optimized_SiteHealth; if (defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT) { add_action('admin_menu', ['A2_Optimized_Optimizations', 'addLockedEditor'], 100, 100); } } if (get_option('A2_Optimized_Plugin_recaptcha', 0) == 1 && !is_admin()) { add_action('woocommerce_login_form', ['A2_Optimized_Optimizations', 'login_captcha']); add_action('login_form', ['A2_Optimized_Optimizations', 'login_captcha']); add_filter('authenticate', ['A2_Optimized_Optimizations', 'captcha_authenticate'], 1, 3); add_action('comment_form_after_fields', ['A2_Optimized_Optimizations', 'comment_captcha']); add_filter('preprocess_comment', ['A2_Optimized_Optimizations', 'captcha_comment_authenticate'], 1, 3); } new A2_Optimized_SiteData; $optimizations = new A2_Optimized_Optimizations; $litespeed_lock = get_option('a2_litespeed_lock'); $current_page = isset($_GET['page']) ? $_GET['page'] : ''; if (is_array($litespeed_lock) && isset($litespeed_lock['locked']) && $litespeed_lock['locked'] == 1 && substr($current_page, 0, 9) == 'litespeed'){ add_action( 'admin_notices', function() { //todo: if we end up needing more notices, we should make them into their own class ?>
Access to LiteSpeed settings has been restricted to protect the optimization work done by A2 Hosting Support. Visit A2 Optimized to turn restrictions off and allow custom changes. Changes made may require additional optimization work at an additional cost.