'. sprintf( esc_html__('%1$s requires %2$s PHP version installed. You have %3$s.', 'wp-asset-clean-up'), ''.WPACU_PLUGIN_TITLE.'', '5.6+', ''.PHP_VERSION.'' ) . ' '. esc_html__('If your website is compatible with PHP 7+ (e.g. you can check with your developers or contact the hosting company), it\'s strongly recommended to upgrade to a newer PHP version for a better performance.', 'wp-asset-clean-up').' '. esc_html__('Thus, the plugin will not trigger on the front-end view to avoid any possible errors.', 'wp-asset-clean-up'). '

'; if (isset($_GET['active'])) { unset($_GET['activate']); } }); } elseif ($wpacuWrongPhp) { // Front return; } define('WPACU_PLUGIN_DIR', __DIR__); define('WPACU_PLUGIN_CLASSES_PATH', WPACU_PLUGIN_DIR.'/classes/'); define('WPACU_PLUGIN_URL', plugins_url('', WPACU_PLUGIN_FILE)); // Upgrade to Pro Sales Page define('WPACU_PLUGIN_GO_PRO_URL', 'https://www.gabelivan.com/items/wp-asset-cleanup-pro/'); // no query strings to be added // Global Values define('WPACU_LOAD_ASSETS_REQ_KEY', WPACU_PLUGIN_ID . '_load'); define('WPACU_FORM_ASSETS_POST_KEY', WPACU_PLUGIN_ID.'_form_assets'); // starting from Pro version 1.1.9.9 & Lite version 1.3.8.1 $wpacuGetLoadedAssetsAction = ((isset($_REQUEST[WPACU_LOAD_ASSETS_REQ_KEY]) && $_REQUEST[WPACU_LOAD_ASSETS_REQ_KEY]) || (isset($_REQUEST['action']) && $_REQUEST['action'] === WPACU_PLUGIN_ID.'_get_loaded_assets')); define('WPACU_GET_LOADED_ASSETS_ACTION', $wpacuGetLoadedAssetsAction); require_once WPACU_PLUGIN_DIR.'/wpacu-load.php'; if (WPACU_GET_LOADED_ASSETS_ACTION === true || ! is_admin()) { add_action('init', static function() { // "Smart Slider 3" & "WP Rocket" compatibility fix | triggered ONLY when the assets are fetched if ( ! function_exists('get_rocket_option') && class_exists( 'NextendSmartSliderWPRocket' ) ) { function get_rocket_option($option) { return ''; } } }); add_action('parse_query', static function() { // very early triggering to set WPACU_ALL_ACTIVE_PLUGINS_LOADED if (defined('WPACU_ALL_ACTIVE_PLUGINS_LOADED')) { return; } // only trigger it once in this action define('WPACU_ALL_ACTIVE_PLUGINS_LOADED', true); \WpAssetCleanUp\Plugin::preventAnyFrontendOptimization('parse_query'); }, 1); require_once WPACU_PLUGIN_DIR . '/vendor/autoload.php'; } // No plugin changes are needed when a feed is loaded add_action('setup_theme', static function() { // Only in the front-end view and when a request URI is there (e.g. not triggering the WP environment via an SSH terminal) if ( ! isset($_SERVER['REQUEST_URI']) || is_admin() ) { return; } global $wp_rewrite; if (isset($wp_rewrite->feed_base) && $wp_rewrite->feed_base && strpos($_SERVER['REQUEST_URI'], '/'.$wp_rewrite->feed_base) !== false) { $currentPageUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . parse_url(site_url(), PHP_URL_HOST) . $_SERVER['REQUEST_URI']; $cleanCurrentPageUrl = $currentPageUrl; if (strpos($currentPageUrl, '?') !== false) { list($cleanCurrentPageUrl) = explode('?', $currentPageUrl); } // /{feed_slug_here}/ or /{feed_slug_here}/atom/ if ($cleanCurrentPageUrl === site_url().'/'.$wp_rewrite->feed_base.'/' || $cleanCurrentPageUrl === site_url().'/'.$wp_rewrite->feed_base.'/atom/') { \WpAssetCleanUp\Plugin::preventAnyFrontendOptimization(); } } }); // "Transliterator - WordPress Transliteration" breaks the HTML content in Asset CleanUp's admin pages // by converting characters such as < (that should stay as they are) to < thus, a fix is attempted to be made here if (isset($_GET['page']) && (strpos($_GET['page'], WPACU_PLUGIN_ID.'_') !== false) && is_admin() && method_exists('Serbian_Transliteration_Cache', 'set')) { Serbian_Transliteration_Cache::set('is_editor', true); }