' . esc_html__( 'AngelForce Cache: please deactivate the earlier version of this plugin (folder velox-cache). AngelForce Cache replaces it and keeps its settings.', 'angelforce-cache' ) . '

'; } } ); return; } define( 'VELOX_VERSION', '2.2.0' ); define( 'VELOX_FILE', __FILE__ ); define( 'VELOX_DIR', plugin_dir_path( __FILE__ ) ); define( 'VELOX_URL', plugin_dir_url( __FILE__ ) ); define( 'VELOX_SITE', 'https://angelforce.eu' ); require_once VELOX_DIR . 'includes/velox-api.php'; /** * Classes are loaded only when first used: a front-end request loads the cache core and the * optimizer, while the admin screens, WebP converter, CSS engine, .htaccess writer etc. stay * unloaded until something actually needs them. */ spl_autoload_register( function ( $class ) { static $map = array( 'Velox_Settings' => 'class-velox-settings.php', 'Velox_Cache' => 'class-velox-cache.php', 'Velox_Htaccess' => 'class-velox-htaccess.php', 'Velox_Optimizer' => 'class-velox-optimizer.php', 'Velox_Preload' => 'class-velox-preload.php', 'Velox_Database' => 'class-velox-database.php', 'Velox_Vitals' => 'class-velox-vitals.php', 'Velox_CSS' => 'class-velox-css.php', 'Velox_Images' => 'class-velox-images.php', 'Velox_Admin' => 'class-velox-admin.php', 'Velox_AI' => 'class-velox-ai.php', 'Velox_Compat' => 'class-velox-compat.php', 'Velox_Cloudflare' => 'class-velox-cloudflare.php', 'Velox_Server' => 'class-velox-server.php', 'Velox_Woo' => 'class-velox-woo.php', ); if ( isset( $map[ $class ] ) ) { require_once VELOX_DIR . 'includes/' . $map[ $class ]; } } ); register_activation_hook( __FILE__, array( 'Velox_Cache', 'activate' ) ); register_deactivation_hook( __FILE__, array( 'Velox_Cache', 'deactivate' ) ); add_action( 'admin_init', array( 'Velox_Cache', 'maybe_finish_setup' ) ); add_action( 'plugins_loaded', function () { // Interface language: WordPress loads this plugin's translations (translate.wordpress.org) for the // site language. When a different language is chosen under Advanced, load that language pack instead. add_action( 'init', function () { $lang = Velox_Settings::get( 'ui_lang' ); if ( $lang && 'auto' !== $lang && preg_match( '/^[a-z]{2,3}(_[A-Z]{2})?$/', $lang ) ) { global $wp_textdomain_registry; $dir = $wp_textdomain_registry instanceof WP_Textdomain_Registry ? $wp_textdomain_registry->get( 'angelforce-cache', $lang ) : false; $mo = $dir ? trailingslashit( $dir ) . 'angelforce-cache-' . $lang . '.mo' : ''; if ( '' !== $mo && is_readable( $mo ) ) { unload_textdomain( 'angelforce-cache' ); load_textdomain( 'angelforce-cache', $mo ); } } }, 1 ); Velox_Cache::init(); Velox_Woo::init(); // Cron callbacks: the class file is only read when the event actually fires. add_action( 'velox_db_cleanup', array( 'Velox_Database', 'run_scheduled' ) ); add_action( 'velox_preload_run', array( 'Velox_Preload', 'run' ) ); add_action( 'velox_clean_expired', array( 'Velox_Vitals', 'rollup' ) ); add_action( 'velox_clean_expired', array( 'Velox_Vitals', 'prune_rate_limits' ) ); add_action( 'velox_clean_expired', array( 'Velox_Server', 'snapshot' ) ); add_filter( 'cron_schedules', function ( $s ) { $s['velox_monthly'] = array( 'interval' => 30 * DAY_IN_SECONDS, 'display' => __( 'Once a month', 'angelforce-cache' ), ); return $s; } ); if ( is_admin() ) { Velox_Admin::init(); Velox_Images::init(); Velox_Vitals::init_admin(); Velox_AI::init(); return; } Velox_Optimizer::init(); // Admin bar entries for logged-in users: the admin class loads only when the bar renders. add_action( 'admin_bar_menu', array( 'Velox_Admin', 'admin_bar' ), 90 ); } );