PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.4
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.4
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / vendor / elementor / wp-one-package / runner.php

runner.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.7.4, at vendor/elementor/wp-one-package/runner.php

55 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 global $__composer_autoload_files, $wp_one_package_versions;
4
5 /**
6 * Allow this file to be executed multiple times across different plugin instances.
7 *
8 * This package may be bundled with multiple plugins, and each plugin needs to register
9 * its version. By default, Composer's autoloader prevents the same file from being loaded
10 * more than once. To enable re-execution, we remove this file from Composer's global
11 * registry of loaded files ($__composer_autoload_files).
12 *
13 * Process:
14 * 1. Locate the vendor directory (2 levels up when installed as a Composer package)
15 * 2. Load Composer's autoload files map (hash => file path mappings)
16 * 3. Find this file's unique hash ID in the map
17 * 4. Remove the hash from the loaded files registry to allow subsequent executions
18 */
19 $vendor_dir = dirname( __DIR__, 2 );
20 $autoload_files_path = $vendor_dir . '/composer/autoload_files.php';
21
22 if ( file_exists( $autoload_files_path ) ) {
23 $autoload_files_map = require $autoload_files_path;
24 $autoload_files_id = array_search( __FILE__, $autoload_files_map, true );
25
26 if ( false !== $autoload_files_id && isset( $__composer_autoload_files[ $autoload_files_id ] ) ) {
27 unset( $__composer_autoload_files[ $autoload_files_id ] );
28 }
29 }
30
31 $pattern = '#/([^/]+)/vendor/elementor/#';
32 if ( preg_match( $pattern, __DIR__, $matches ) ) {
33 $wp_one_package_versions[ $matches[1] ] = '1.0.59';
34 }
35
36 if ( ! function_exists( 'elementor_one_register_1_dot_0_dot_59' ) && function_exists( 'add_action' ) ) {
37
38 if ( ! class_exists( '\ElementorOne\Versions', false ) ) {
39 require_once __DIR__ . '/src/Versions.php';
40 add_action( 'plugins_loaded', [ \ElementorOne\Versions::class, 'initialize_latest_version' ], -15, 0 );
41 }
42
43 add_action( 'plugins_loaded', 'elementor_one_register_1_dot_0_dot_59', -20, 0 );
44
45 function elementor_one_register_1_dot_0_dot_59() {
46 $versions = \ElementorOne\Versions::instance();
47 $versions->register( '1.0.59', 'elementor_one_initialize_1_dot_0_dot_59' );
48 }
49
50 function elementor_one_initialize_1_dot_0_dot_59() {
51 // The Loader class will be autoloaded from the highest version source
52 \ElementorOne\Loader::init();
53 }
54 }
55