Version Description
- 2020/09/09 =
- Fix: Fix settings error on multi-sites with WordPress 5.5
- Fix: Write the correct conf file for use with webp rewrites on nginx
- Improvement: Namespace composer dependencies to avoid possible naming collisions.
- Security: Add blank index.php to imagify-created backup folders to disable public access.
Download this release
Release Info
Developer | wp_media |
Plugin | Imagify Image Optimizer |
Version | 1.9.11 |
Comparing to | |
See all releases |
Code changes from version 1.9.10 to 1.9.11
- classes/Webp/RewriteRules/Nginx.php +1 -1
- imagify.php +4 -3
- inc/admin/upgrader.php +25 -0
- inc/classes/Dependencies/.gitkeep +0 -0
- inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php +181 -0
- inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php +505 -0
- inc/classes/class-imagify-abstract-background-process.php +1 -1
- inc/classes/class-imagify-custom-folders.php +43 -0
- inc/classes/class-imagify-filesystem.php +3 -0
- inc/classes/class-imagify-settings.php +199 -91
- inc/functions/admin.php +6 -0
- readme.txt +11 -5
- vendor/a5hleyrich/wp-background-processing/.gitignore +0 -1
- vendor/a5hleyrich/wp-background-processing/README.md +0 -158
- vendor/a5hleyrich/wp-background-processing/classes/wp-async-request.php +0 -163
- vendor/a5hleyrich/wp-background-processing/classes/wp-background-process.php +0 -506
- vendor/a5hleyrich/wp-background-processing/composer.json +0 -18
- vendor/a5hleyrich/wp-background-processing/license.txt +0 -280
- vendor/a5hleyrich/wp-background-processing/wp-background-processing.php +0 -20
- vendor/autoload.php +1 -1
- vendor/composer/autoload_classmap.php +8 -2
- vendor/composer/autoload_psr4.php +1 -0
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +17 -6
- vendor/composer/installed.json +26 -47
- vendor/composer/installers/composer.json +10 -3
- vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +1 -0
- vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +9 -19
- vendor/composer/installers/src/Composer/Installers/DframeInstaller.php +10 -0
- vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +14 -8
- vendor/composer/installers/src/Composer/Installers/Installer.php +6 -0
- vendor/composer/installers/src/Composer/Installers/KnownInstaller.php +11 -0
- vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php +23 -0
- vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +54 -46
- vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +1 -0
- vendor/composer/installers/src/Composer/Installers/Plugin.php +12 -2
- vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php +10 -0
- vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php +9 -0
- vendor/composer/installers/src/Composer/Installers/TaoInstaller.php +12 -0
- vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +12 -1
classes/Webp/RewriteRules/Nginx.php
CHANGED
@@ -45,7 +45,7 @@ location ~* ^(' . $home_root . '.+)\.(' . $extensions . ')$ {
|
|
45 |
set $imwebp "${imwebp}B";
|
46 |
}
|
47 |
if ($imwebp = AB) {
|
48 |
-
rewrite ^(.*) $1.webp
|
49 |
}
|
50 |
}' );
|
51 |
}
|
45 |
set $imwebp "${imwebp}B";
|
46 |
}
|
47 |
if ($imwebp = AB) {
|
48 |
+
rewrite ^(.*) $1.webp;
|
49 |
}
|
50 |
}' );
|
51 |
}
|
imagify.php
CHANGED
@@ -2,8 +2,9 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Imagify
|
4 |
* Plugin URI: https://wordpress.org/plugins/imagify/
|
5 |
-
* Description:
|
6 |
-
* Version: 1.9.
|
|
|
7 |
* Requires PHP: 5.4
|
8 |
* Author: WP Media
|
9 |
* Author URI: https://wp-media.me/
|
@@ -20,7 +21,7 @@
|
|
20 |
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
21 |
|
22 |
// Imagify defines.
|
23 |
-
define( 'IMAGIFY_VERSION', '1.9.
|
24 |
define( 'IMAGIFY_SLUG', 'imagify' );
|
25 |
define( 'IMAGIFY_FILE', __FILE__ );
|
26 |
define( 'IMAGIFY_PATH', realpath( plugin_dir_path( IMAGIFY_FILE ) ) . '/' );
|
2 |
/**
|
3 |
* Plugin Name: Imagify
|
4 |
* Plugin URI: https://wordpress.org/plugins/imagify/
|
5 |
+
* Description: Dramatically reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth using Imagify, the new most advanced image optimization tool.
|
6 |
+
* Version: 1.9.11
|
7 |
+
* Requires at least: 4.0.0
|
8 |
* Requires PHP: 5.4
|
9 |
* Author: WP Media
|
10 |
* Author URI: https://wp-media.me/
|
21 |
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
22 |
|
23 |
// Imagify defines.
|
24 |
+
define( 'IMAGIFY_VERSION', '1.9.11' );
|
25 |
define( 'IMAGIFY_SLUG', 'imagify' );
|
26 |
define( 'IMAGIFY_FILE', __FILE__ );
|
27 |
define( 'IMAGIFY_PATH', realpath( plugin_dir_path( IMAGIFY_FILE ) ) . '/' );
|
inc/admin/upgrader.php
CHANGED
@@ -299,6 +299,11 @@ function _imagify_new_upgrade( $network_version, $site_version ) {
|
|
299 |
if ( version_compare( $site_version, '1.9.6' ) < 0 ) {
|
300 |
\Imagify\Stats\OptimizedMediaWithoutWebp::get_instance()->clear_cache();
|
301 |
}
|
|
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
|
304 |
add_action( 'upgrader_process_complete', 'imagify_maybe_reset_opcache', 20, 2 );
|
@@ -384,3 +389,23 @@ function imagify_reset_opcache( $reset_function_cache = false ) {
|
|
384 |
|
385 |
return opcache_reset(); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.opcache_resetFound
|
386 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
if ( version_compare( $site_version, '1.9.6' ) < 0 ) {
|
300 |
\Imagify\Stats\OptimizedMediaWithoutWebp::get_instance()->clear_cache();
|
301 |
}
|
302 |
+
|
303 |
+
// 1.9.11
|
304 |
+
if ( version_compare( $site_version, '1.9.11' ) < 0 ) {
|
305 |
+
imagify_secure_custom_directories();
|
306 |
+
}
|
307 |
}
|
308 |
|
309 |
add_action( 'upgrader_process_complete', 'imagify_maybe_reset_opcache', 20, 2 );
|
389 |
|
390 |
return opcache_reset(); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.opcache_resetFound
|
391 |
}
|
392 |
+
|
393 |
+
add_action( 'imagify_activation', 'imagify_secure_custom_directories' );
|
394 |
+
/**
|
395 |
+
* Scan imagify directories and add `index.php` files where missing.
|
396 |
+
*
|
397 |
+
* @since 1.9.11
|
398 |
+
*
|
399 |
+
* @return void
|
400 |
+
*/
|
401 |
+
function imagify_secure_custom_directories() {
|
402 |
+
$filesystem = imagify_get_filesystem();
|
403 |
+
|
404 |
+
Imagify_Custom_Folders::add_indexes();
|
405 |
+
|
406 |
+
$conf_dir = $filesystem->get_site_root() . 'conf';
|
407 |
+
Imagify_Custom_Folders::add_indexes( $conf_dir );
|
408 |
+
|
409 |
+
$backup_dir = get_imagify_backup_dir_path();
|
410 |
+
Imagify_Custom_Folders::add_indexes( $backup_dir );
|
411 |
+
}
|
inc/classes/Dependencies/.gitkeep
ADDED
File without changes
|
inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WP Async Request
|
4 |
+
*
|
5 |
+
* @package WP-Background-Processing
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Abstract Imagify_WP_Async_Request class.
|
10 |
+
*
|
11 |
+
* @abstract
|
12 |
+
*/
|
13 |
+
abstract class Imagify_WP_Async_Request {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Prefix
|
17 |
+
*
|
18 |
+
* (default value: 'wp')
|
19 |
+
*
|
20 |
+
* @var string
|
21 |
+
* @access protected
|
22 |
+
*/
|
23 |
+
protected $prefix = 'wp';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Action
|
27 |
+
*
|
28 |
+
* (default value: 'async_request')
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
+
* @access protected
|
32 |
+
*/
|
33 |
+
protected $action = 'async_request';
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Identifier
|
37 |
+
*
|
38 |
+
* @var mixed
|
39 |
+
* @access protected
|
40 |
+
*/
|
41 |
+
protected $identifier;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Data
|
45 |
+
*
|
46 |
+
* (default value: array())
|
47 |
+
*
|
48 |
+
* @var array
|
49 |
+
* @access protected
|
50 |
+
*/
|
51 |
+
protected $data = array();
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Initiate new async request
|
55 |
+
*/
|
56 |
+
public function __construct() {
|
57 |
+
$this->identifier = $this->prefix . '_' . $this->action;
|
58 |
+
|
59 |
+
add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) );
|
60 |
+
add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Set data used during the request
|
65 |
+
*
|
66 |
+
* @param array $data Data.
|
67 |
+
*
|
68 |
+
* @return $this
|
69 |
+
*/
|
70 |
+
public function data( $data ) {
|
71 |
+
$this->data = $data;
|
72 |
+
|
73 |
+
return $this;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Dispatch the async request
|
78 |
+
*
|
79 |
+
* @return array|WP_Error
|
80 |
+
*/
|
81 |
+
public function dispatch() {
|
82 |
+
$url = add_query_arg( $this->get_query_args(), $this->get_query_url() );
|
83 |
+
$args = $this->get_post_args();
|
84 |
+
|
85 |
+
return wp_remote_post( esc_url_raw( $url ), $args );
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Get query args
|
90 |
+
*
|
91 |
+
* @return array
|
92 |
+
*/
|
93 |
+
protected function get_query_args() {
|
94 |
+
if ( property_exists( $this, 'query_args' ) ) {
|
95 |
+
return $this->query_args;
|
96 |
+
}
|
97 |
+
|
98 |
+
$args = array(
|
99 |
+
'action' => $this->identifier,
|
100 |
+
'nonce' => wp_create_nonce( $this->identifier ),
|
101 |
+
);
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Filters the post arguments used during an async request.
|
105 |
+
*
|
106 |
+
* @param array $url
|
107 |
+
*/
|
108 |
+
return apply_filters( $this->identifier . '_query_args', $args );
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Get query URL
|
113 |
+
*
|
114 |
+
* @return string
|
115 |
+
*/
|
116 |
+
protected function get_query_url() {
|
117 |
+
if ( property_exists( $this, 'query_url' ) ) {
|
118 |
+
return $this->query_url;
|
119 |
+
}
|
120 |
+
|
121 |
+
$url = admin_url( 'admin-ajax.php' );
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Filters the post arguments used during an async request.
|
125 |
+
*
|
126 |
+
* @param string $url
|
127 |
+
*/
|
128 |
+
return apply_filters( $this->identifier . '_query_url', $url );
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Get post args
|
133 |
+
*
|
134 |
+
* @return array
|
135 |
+
*/
|
136 |
+
protected function get_post_args() {
|
137 |
+
if ( property_exists( $this, 'post_args' ) ) {
|
138 |
+
return $this->post_args;
|
139 |
+
}
|
140 |
+
|
141 |
+
$args = array(
|
142 |
+
'timeout' => 0.01,
|
143 |
+
'blocking' => false,
|
144 |
+
'body' => $this->data,
|
145 |
+
'cookies' => $_COOKIE,
|
146 |
+
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
|
147 |
+
);
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Filters the post arguments used during an async request.
|
151 |
+
*
|
152 |
+
* @param array $args
|
153 |
+
*/
|
154 |
+
return apply_filters( $this->identifier . '_post_args', $args );
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Maybe handle
|
159 |
+
*
|
160 |
+
* Check for correct nonce and pass to handler.
|
161 |
+
*/
|
162 |
+
public function maybe_handle() {
|
163 |
+
// Don't lock up other requests while processing
|
164 |
+
session_write_close();
|
165 |
+
|
166 |
+
check_ajax_referer( $this->identifier, 'nonce' );
|
167 |
+
|
168 |
+
$this->handle();
|
169 |
+
|
170 |
+
wp_die();
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Handle
|
175 |
+
*
|
176 |
+
* Override this method to perform any actions required
|
177 |
+
* during the async request.
|
178 |
+
*/
|
179 |
+
abstract protected function handle();
|
180 |
+
|
181 |
+
}
|
inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php
ADDED
@@ -0,0 +1,505 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WP Background Process
|
4 |
+
*
|
5 |
+
* @package WP-Background-Processing
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Abstract Imagify_WP_Background_Process class.
|
10 |
+
*
|
11 |
+
* @abstract
|
12 |
+
* @extends Imagify_WP_Async_Request
|
13 |
+
*/
|
14 |
+
abstract class Imagify_WP_Background_Process extends Imagify_WP_Async_Request {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Action
|
18 |
+
*
|
19 |
+
* (default value: 'background_process')
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
* @access protected
|
23 |
+
*/
|
24 |
+
protected $action = 'background_process';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Start time of current process.
|
28 |
+
*
|
29 |
+
* (default value: 0)
|
30 |
+
*
|
31 |
+
* @var int
|
32 |
+
* @access protected
|
33 |
+
*/
|
34 |
+
protected $start_time = 0;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Cron_hook_identifier
|
38 |
+
*
|
39 |
+
* @var mixed
|
40 |
+
* @access protected
|
41 |
+
*/
|
42 |
+
protected $cron_hook_identifier;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Cron_interval_identifier
|
46 |
+
*
|
47 |
+
* @var mixed
|
48 |
+
* @access protected
|
49 |
+
*/
|
50 |
+
protected $cron_interval_identifier;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Initiate new background process
|
54 |
+
*/
|
55 |
+
public function __construct() {
|
56 |
+
parent::__construct();
|
57 |
+
|
58 |
+
$this->cron_hook_identifier = $this->identifier . '_cron';
|
59 |
+
$this->cron_interval_identifier = $this->identifier . '_cron_interval';
|
60 |
+
|
61 |
+
add_action( $this->cron_hook_identifier, array( $this, 'handle_cron_healthcheck' ) );
|
62 |
+
add_filter( 'cron_schedules', array( $this, 'schedule_cron_healthcheck' ) );
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Dispatch
|
67 |
+
*
|
68 |
+
* @access public
|
69 |
+
* @return void
|
70 |
+
*/
|
71 |
+
public function dispatch() {
|
72 |
+
// Schedule the cron healthcheck.
|
73 |
+
$this->schedule_event();
|
74 |
+
|
75 |
+
// Perform remote post.
|
76 |
+
return parent::dispatch();
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Push to queue
|
81 |
+
*
|
82 |
+
* @param mixed $data Data.
|
83 |
+
*
|
84 |
+
* @return $this
|
85 |
+
*/
|
86 |
+
public function push_to_queue( $data ) {
|
87 |
+
$this->data[] = $data;
|
88 |
+
|
89 |
+
return $this;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Save queue
|
94 |
+
*
|
95 |
+
* @return $this
|
96 |
+
*/
|
97 |
+
public function save() {
|
98 |
+
$key = $this->generate_key();
|
99 |
+
|
100 |
+
if ( ! empty( $this->data ) ) {
|
101 |
+
update_site_option( $key, $this->data );
|
102 |
+
}
|
103 |
+
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Update queue
|
109 |
+
*
|
110 |
+
* @param string $key Key.
|
111 |
+
* @param array $data Data.
|
112 |
+
*
|
113 |
+
* @return $this
|
114 |
+
*/
|
115 |
+
public function update( $key, $data ) {
|
116 |
+
if ( ! empty( $data ) ) {
|
117 |
+
update_site_option( $key, $data );
|
118 |
+
}
|
119 |
+
|
120 |
+
return $this;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Delete queue
|
125 |
+
*
|
126 |
+
* @param string $key Key.
|
127 |
+
*
|
128 |
+
* @return $this
|
129 |
+
*/
|
130 |
+
public function delete( $key ) {
|
131 |
+
delete_site_option( $key );
|
132 |
+
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Generate key
|
138 |
+
*
|
139 |
+
* Generates a unique key based on microtime. Queue items are
|
140 |
+
* given a unique key so that they can be merged upon save.
|
141 |
+
*
|
142 |
+
* @param int $length Length.
|
143 |
+
*
|
144 |
+
* @return string
|
145 |
+
*/
|
146 |
+
protected function generate_key( $length = 64 ) {
|
147 |
+
$unique = md5( microtime() . rand() );
|
148 |
+
$prepend = $this->identifier . '_batch_';
|
149 |
+
|
150 |
+
return substr( $prepend . $unique, 0, $length );
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Maybe process queue
|
155 |
+
*
|
156 |
+
* Checks whether data exists within the queue and that
|
157 |
+
* the process is not already running.
|
158 |
+
*/
|
159 |
+
public function maybe_handle() {
|
160 |
+
// Don't lock up other requests while processing
|
161 |
+
session_write_close();
|
162 |
+
|
163 |
+
if ( $this->is_process_running() ) {
|
164 |
+
// Background process already running.
|
165 |
+
wp_die();
|
166 |
+
}
|
167 |
+
|
168 |
+
if ( $this->is_queue_empty() ) {
|
169 |
+
// No data to process.
|
170 |
+
wp_die();
|
171 |
+
}
|
172 |
+
|
173 |
+
check_ajax_referer( $this->identifier, 'nonce' );
|
174 |
+
|
175 |
+
$this->handle();
|
176 |
+
|
177 |
+
wp_die();
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Is queue empty
|
182 |
+
*
|
183 |
+
* @return bool
|
184 |
+
*/
|
185 |
+
protected function is_queue_empty() {
|
186 |
+
global $wpdb;
|
187 |
+
|
188 |
+
$table = $wpdb->options;
|
189 |
+
$column = 'option_name';
|
190 |
+
|
191 |
+
if ( is_multisite() ) {
|
192 |
+
$table = $wpdb->sitemeta;
|
193 |
+
$column = 'meta_key';
|
194 |
+
}
|
195 |
+
|
196 |
+
$key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
|
197 |
+
|
198 |
+
$count = $wpdb->get_var( $wpdb->prepare( "
|
199 |
+
SELECT COUNT(*)
|
200 |
+
FROM {$table}
|
201 |
+
WHERE {$column} LIKE %s
|
202 |
+
", $key ) );
|
203 |
+
|
204 |
+
return ( $count > 0 ) ? false : true;
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Is process running
|
209 |
+
*
|
210 |
+
* Check whether the current process is already running
|
211 |
+
* in a background process.
|
212 |
+
*/
|
213 |
+
protected function is_process_running() {
|
214 |
+
if ( get_site_transient( $this->identifier . '_process_lock' ) ) {
|
215 |
+
// Process already running.
|
216 |
+
return true;
|
217 |
+
}
|
218 |
+
|
219 |
+
return false;
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Lock process
|
224 |
+
*
|
225 |
+
* Lock the process so that multiple instances can't run simultaneously.
|
226 |
+
* Override if applicable, but the duration should be greater than that
|
227 |
+
* defined in the time_exceeded() method.
|
228 |
+
*/
|
229 |
+
protected function lock_process() {
|
230 |
+
$this->start_time = time(); // Set start time of current process.
|
231 |
+
|
232 |
+
$lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute
|
233 |
+
$lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration );
|
234 |
+
|
235 |
+
set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration );
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Unlock process
|
240 |
+
*
|
241 |
+
* Unlock the process so that other instances can spawn.
|
242 |
+
*
|
243 |
+
* @return $this
|
244 |
+
*/
|
245 |
+
protected function unlock_process() {
|
246 |
+
delete_site_transient( $this->identifier . '_process_lock' );
|
247 |
+
|
248 |
+
return $this;
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Get batch
|
253 |
+
*
|
254 |
+
* @return stdClass Return the first batch from the queue
|
255 |
+
*/
|
256 |
+
protected function get_batch() {
|
257 |
+
global $wpdb;
|
258 |
+
|
259 |
+
$table = $wpdb->options;
|
260 |
+
$column = 'option_name';
|
261 |
+
$key_column = 'option_id';
|
262 |
+
$value_column = 'option_value';
|
263 |
+
|
264 |
+
if ( is_multisite() ) {
|
265 |
+
$table = $wpdb->sitemeta;
|
266 |
+
$column = 'meta_key';
|
267 |
+
$key_column = 'meta_id';
|
268 |
+
$value_column = 'meta_value';
|
269 |
+
}
|
270 |
+
|
271 |
+
$key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
|
272 |
+
|
273 |
+
$query = $wpdb->get_row( $wpdb->prepare( "
|
274 |
+
SELECT *
|
275 |
+
FROM {$table}
|
276 |
+
WHERE {$column} LIKE %s
|
277 |
+
ORDER BY {$key_column} ASC
|
278 |
+
LIMIT 1
|
279 |
+
", $key ) );
|
280 |
+
|
281 |
+
$batch = new stdClass();
|
282 |
+
$batch->key = $query->$column;
|
283 |
+
$batch->data = maybe_unserialize( $query->$value_column );
|
284 |
+
|
285 |
+
return $batch;
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Handle
|
290 |
+
*
|
291 |
+
* Pass each queue item to the task handler, while remaining
|
292 |
+
* within server memory and time limit constraints.
|
293 |
+
*/
|
294 |
+
protected function handle() {
|
295 |
+
$this->lock_process();
|
296 |
+
|
297 |
+
do {
|
298 |
+
$batch = $this->get_batch();
|
299 |
+
|
300 |
+
foreach ( $batch->data as $key => $value ) {
|
301 |
+
$task = $this->task( $value );
|
302 |
+
|
303 |
+
if ( false !== $task ) {
|
304 |
+
$batch->data[ $key ] = $task;
|
305 |
+
} else {
|
306 |
+
unset( $batch->data[ $key ] );
|
307 |
+
}
|
308 |
+
|
309 |
+
if ( $this->time_exceeded() || $this->memory_exceeded() ) {
|
310 |
+
// Batch limits reached.
|
311 |
+
break;
|
312 |
+
}
|
313 |
+
}
|
314 |
+
|
315 |
+
// Update or delete current batch.
|
316 |
+
if ( ! empty( $batch->data ) ) {
|
317 |
+
$this->update( $batch->key, $batch->data );
|
318 |
+
} else {
|
319 |
+
$this->delete( $batch->key );
|
320 |
+
}
|
321 |
+
} while ( ! $this->time_exceeded() && ! $this->memory_exceeded() && ! $this->is_queue_empty() );
|
322 |
+
|
323 |
+
$this->unlock_process();
|
324 |
+
|
325 |
+
// Start next batch or complete process.
|
326 |
+
if ( ! $this->is_queue_empty() ) {
|
327 |
+
$this->dispatch();
|
328 |
+
} else {
|
329 |
+
$this->complete();
|
330 |
+
}
|
331 |
+
|
332 |
+
wp_die();
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Memory exceeded
|
337 |
+
*
|
338 |
+
* Ensures the batch process never exceeds 90%
|
339 |
+
* of the maximum WordPress memory.
|
340 |
+
*
|
341 |
+
* @return bool
|
342 |
+
*/
|
343 |
+
protected function memory_exceeded() {
|
344 |
+
$memory_limit = $this->get_memory_limit() * 0.9; // 90% of max memory
|
345 |
+
$current_memory = memory_get_usage( true );
|
346 |
+
$return = false;
|
347 |
+
|
348 |
+
if ( $current_memory >= $memory_limit ) {
|
349 |
+
$return = true;
|
350 |
+
}
|
351 |
+
|
352 |
+
return apply_filters( $this->identifier . '_memory_exceeded', $return );
|
353 |
+
}
|
354 |
+
|
355 |
+
/**
|
356 |
+
* Get memory limit
|
357 |
+
*
|
358 |
+
* @return int
|
359 |
+
*/
|
360 |
+
protected function get_memory_limit() {
|
361 |
+
if ( function_exists( 'ini_get' ) ) {
|
362 |
+
$memory_limit = ini_get( 'memory_limit' );
|
363 |
+
} else {
|
364 |
+
// Sensible default.
|
365 |
+
$memory_limit = '128M';
|
366 |
+
}
|
367 |
+
|
368 |
+
if ( ! $memory_limit || - 1 === intval( $memory_limit ) ) {
|
369 |
+
// Unlimited, set to 32GB.
|
370 |
+
$memory_limit = '32000M';
|
371 |
+
}
|
372 |
+
|
373 |
+
return wp_convert_hr_to_bytes( $memory_limit );
|
374 |
+
}
|
375 |
+
|
376 |
+
/**
|
377 |
+
* Time exceeded.
|
378 |
+
*
|
379 |
+
* Ensures the batch never exceeds a sensible time limit.
|
380 |
+
* A timeout limit of 30s is common on shared hosting.
|
381 |
+
*
|
382 |
+
* @return bool
|
383 |
+
*/
|
384 |
+
protected function time_exceeded() {
|
385 |
+
$finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', 20 ); // 20 seconds
|
386 |
+
$return = false;
|
387 |
+
|
388 |
+
if ( time() >= $finish ) {
|
389 |
+
$return = true;
|
390 |
+
}
|
391 |
+
|
392 |
+
return apply_filters( $this->identifier . '_time_exceeded', $return );
|
393 |
+
}
|
394 |
+
|
395 |
+
/**
|
396 |
+
* Complete.
|
397 |
+
*
|
398 |
+
* Override if applicable, but ensure that the below actions are
|
399 |
+
* performed, or, call parent::complete().
|
400 |
+
*/
|
401 |
+
protected function complete() {
|
402 |
+
// Unschedule the cron healthcheck.
|
403 |
+
$this->clear_scheduled_event();
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Schedule cron healthcheck
|
408 |
+
*
|
409 |
+
* @access public
|
410 |
+
*
|
411 |
+
* @param mixed $schedules Schedules.
|
412 |
+
*
|
413 |
+
* @return mixed
|
414 |
+
*/
|
415 |
+
public function schedule_cron_healthcheck( $schedules ) {
|
416 |
+
$interval = apply_filters( $this->identifier . '_cron_interval', 5 );
|
417 |
+
|
418 |
+
if ( property_exists( $this, 'cron_interval' ) ) {
|
419 |
+
$interval = apply_filters( $this->identifier . '_cron_interval', $this->cron_interval );
|
420 |
+
}
|
421 |
+
|
422 |
+
// Adds every 5 minutes to the existing schedules.
|
423 |
+
$schedules[ $this->identifier . '_cron_interval' ] = array(
|
424 |
+
'interval' => MINUTE_IN_SECONDS * $interval,
|
425 |
+
'display' => sprintf( __( 'Every %d Minutes' ), $interval ),
|
426 |
+
);
|
427 |
+
|
428 |
+
return $schedules;
|
429 |
+
}
|
430 |
+
|
431 |
+
/**
|
432 |
+
* Handle cron healthcheck
|
433 |
+
*
|
434 |
+
* Restart the background process if not already running
|
435 |
+
* and data exists in the queue.
|
436 |
+
*/
|
437 |
+
public function handle_cron_healthcheck() {
|
438 |
+
if ( $this->is_process_running() ) {
|
439 |
+
// Background process already running.
|
440 |
+
exit;
|
441 |
+
}
|
442 |
+
|
443 |
+
if ( $this->is_queue_empty() ) {
|
444 |
+
// No data to process.
|
445 |
+
$this->clear_scheduled_event();
|
446 |
+
exit;
|
447 |
+
}
|
448 |
+
|
449 |
+
$this->handle();
|
450 |
+
|
451 |
+
exit;
|
452 |
+
}
|
453 |
+
|
454 |
+
/**
|
455 |
+
* Schedule event
|
456 |
+
*/
|
457 |
+
protected function schedule_event() {
|
458 |
+
if ( ! wp_next_scheduled( $this->cron_hook_identifier ) ) {
|
459 |
+
wp_schedule_event( time(), $this->cron_interval_identifier, $this->cron_hook_identifier );
|
460 |
+
}
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* Clear scheduled event
|
465 |
+
*/
|
466 |
+
protected function clear_scheduled_event() {
|
467 |
+
$timestamp = wp_next_scheduled( $this->cron_hook_identifier );
|
468 |
+
|
469 |
+
if ( $timestamp ) {
|
470 |
+
wp_unschedule_event( $timestamp, $this->cron_hook_identifier );
|
471 |
+
}
|
472 |
+
}
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Cancel Process
|
476 |
+
*
|
477 |
+
* Stop processing queue items, clear cronjob and delete batch.
|
478 |
+
*
|
479 |
+
*/
|
480 |
+
public function cancel_process() {
|
481 |
+
if ( ! $this->is_queue_empty() ) {
|
482 |
+
$batch = $this->get_batch();
|
483 |
+
|
484 |
+
$this->delete( $batch->key );
|
485 |
+
|
486 |
+
wp_clear_scheduled_hook( $this->cron_hook_identifier );
|
487 |
+
}
|
488 |
+
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Task
|
493 |
+
*
|
494 |
+
* Override this method to perform any actions required on each
|
495 |
+
* queue item. Return the modified item for further processing
|
496 |
+
* in the next pass through. Or, return false to remove the
|
497 |
+
* item from the queue.
|
498 |
+
*
|
499 |
+
* @param mixed $item Queue item to iterate over.
|
500 |
+
*
|
501 |
+
* @return mixed
|
502 |
+
*/
|
503 |
+
abstract protected function task( $item );
|
504 |
+
|
505 |
+
}
|
inc/classes/class-imagify-abstract-background-process.php
CHANGED
@@ -7,7 +7,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
|
7 |
* @since 1.8.1
|
8 |
* @author Grégory Viguier
|
9 |
*/
|
10 |
-
abstract class Imagify_Abstract_Background_Process extends
|
11 |
|
12 |
/**
|
13 |
* Class version.
|
7 |
* @since 1.8.1
|
8 |
* @author Grégory Viguier
|
9 |
*/
|
10 |
+
abstract class Imagify_Abstract_Background_Process extends Imagify_WP_Background_Process {
|
11 |
|
12 |
/**
|
13 |
* Class version.
|
inc/classes/class-imagify-custom-folders.php
CHANGED
@@ -89,6 +89,49 @@ class Imagify_Custom_Folders {
|
|
89 |
return preg_replace( '@^' . preg_quote( $site_root, '@' ) . '@', $backup_dir, $file_path );
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
/** ----------------------------------------------------------------------------------------- */
|
94 |
/** SINGLE FILE ============================================================================= */
|
89 |
return preg_replace( '@^' . preg_quote( $site_root, '@' ) . '@', $backup_dir, $file_path );
|
90 |
}
|
91 |
|
92 |
+
/**
|
93 |
+
* Add index.php files recursively to a given directory and all its subdirectories.
|
94 |
+
*
|
95 |
+
* @since 1.9.11
|
96 |
+
*
|
97 |
+
* @param string $backup_dir (optional) Path to the directory where we will start adding indexes.
|
98 |
+
* Defaults to custom-folders backup dir.
|
99 |
+
*
|
100 |
+
* @return void
|
101 |
+
*/
|
102 |
+
public static function add_indexes( $backup_dir = '' ) {
|
103 |
+
$filesystem = Imagify_Filesystem::get_instance();
|
104 |
+
|
105 |
+
if ( empty( $backup_dir ) ) {
|
106 |
+
$backup_dir = self::get_backup_dir_path();
|
107 |
+
}
|
108 |
+
|
109 |
+
if ( ! $filesystem->is_writable( $backup_dir ) ) {
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
|
113 |
+
try {
|
114 |
+
$directory = new RecursiveDirectoryIterator( $backup_dir );
|
115 |
+
$iterator = new RecursiveIteratorIterator( $directory );
|
116 |
+
|
117 |
+
foreach ( $iterator as $fileinfo ) {
|
118 |
+
|
119 |
+
if ( '.' !== $fileinfo->getFilename() ) {
|
120 |
+
continue;
|
121 |
+
}
|
122 |
+
|
123 |
+
$path = trailingslashit( $fileinfo->getRealPath() );
|
124 |
+
|
125 |
+
if ( ! $filesystem->is_file( $path . 'index.html' )
|
126 |
+
&& ! $filesystem->is_file( $path . 'index.php' )
|
127 |
+
) {
|
128 |
+
$filesystem->touch( $path . 'index.php' );
|
129 |
+
}
|
130 |
+
}
|
131 |
+
} catch ( Exception $e ) {
|
132 |
+
return;
|
133 |
+
}
|
134 |
+
}
|
135 |
|
136 |
/** ----------------------------------------------------------------------------------------- */
|
137 |
/** SINGLE FILE ============================================================================= */
|
inc/classes/class-imagify-filesystem.php
CHANGED
@@ -227,6 +227,7 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
|
|
227 |
if ( ! $this->is_dir( $path ) ) {
|
228 |
return false;
|
229 |
}
|
|
|
230 |
continue;
|
231 |
}
|
232 |
|
@@ -243,6 +244,8 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
|
|
243 |
if ( ! $this->exists( $path ) ) {
|
244 |
return false;
|
245 |
}
|
|
|
|
|
246 |
}
|
247 |
|
248 |
return true;
|
227 |
if ( ! $this->is_dir( $path ) ) {
|
228 |
return false;
|
229 |
}
|
230 |
+
|
231 |
continue;
|
232 |
}
|
233 |
|
244 |
if ( ! $this->exists( $path ) ) {
|
245 |
return false;
|
246 |
}
|
247 |
+
|
248 |
+
$this->touch( trailingslashit( $path ) . 'index.php' );
|
249 |
}
|
250 |
|
251 |
return true;
|
inc/classes/class-imagify-settings.php
CHANGED
@@ -11,41 +11,41 @@ class Imagify_Settings {
|
|
11 |
/**
|
12 |
* Class version.
|
13 |
*
|
14 |
-
* @var string
|
15 |
* @since 1.7
|
|
|
16 |
*/
|
17 |
const VERSION = '1.0.1';
|
18 |
|
19 |
/**
|
20 |
* The settings group.
|
21 |
*
|
22 |
-
* @var string
|
23 |
* @since 1.7
|
|
|
24 |
*/
|
25 |
protected $settings_group;
|
26 |
|
27 |
/**
|
28 |
* The option name.
|
29 |
*
|
30 |
-
* @var string
|
31 |
* @since 1.7
|
|
|
32 |
*/
|
33 |
protected $option_name;
|
34 |
|
35 |
/**
|
36 |
* The options instance.
|
37 |
*
|
38 |
-
* @var object
|
39 |
* @since 1.7
|
|
|
40 |
*/
|
41 |
protected $options;
|
42 |
|
43 |
/**
|
44 |
* The single instance of the class.
|
45 |
*
|
46 |
-
* @var object
|
47 |
* @since 1.7
|
48 |
* @access protected
|
|
|
49 |
*/
|
50 |
protected static $_instance;
|
51 |
|
@@ -66,10 +66,9 @@ class Imagify_Settings {
|
|
66 |
* Get the main Instance.
|
67 |
*
|
68 |
* @since 1.7
|
|
|
69 |
* @author Grégory Viguier
|
70 |
* @access public
|
71 |
-
*
|
72 |
-
* @return object Main instance.
|
73 |
*/
|
74 |
public static function get_instance() {
|
75 |
if ( ! isset( self::$_instance ) ) {
|
@@ -87,17 +86,23 @@ class Imagify_Settings {
|
|
87 |
* @access public
|
88 |
*/
|
89 |
public function init() {
|
90 |
-
add_filter( 'sanitize_option_' . $this->option_name,
|
91 |
-
add_action( 'admin_init',
|
92 |
add_filter( 'option_page_capability_' . $this->settings_group, array( $this, 'get_capability' ) );
|
93 |
|
94 |
if ( imagify_is_active_for_network() ) {
|
95 |
-
add_filter( 'pre_update_site_option_' . $this->option_name, array(
|
96 |
-
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
} else {
|
99 |
-
add_filter( 'pre_update_option_' . $this->option_name,
|
100 |
-
add_action( 'update_option_' . $this->option_name,
|
101 |
}
|
102 |
}
|
103 |
|
@@ -110,10 +115,9 @@ class Imagify_Settings {
|
|
110 |
* Get the name of the settings group.
|
111 |
*
|
112 |
* @since 1.7
|
|
|
113 |
* @author Grégory Viguier
|
114 |
* @access public
|
115 |
-
*
|
116 |
-
* @return string
|
117 |
*/
|
118 |
public function get_settings_group() {
|
119 |
return $this->settings_group;
|
@@ -123,10 +127,9 @@ class Imagify_Settings {
|
|
123 |
* Get the URL to use as form action.
|
124 |
*
|
125 |
* @since 1.7
|
|
|
126 |
* @author Grégory Viguier
|
127 |
* @access public
|
128 |
-
*
|
129 |
-
* @return string
|
130 |
*/
|
131 |
public function get_form_action() {
|
132 |
return imagify_is_active_for_network() ? admin_url( 'admin-post.php' ) : admin_url( 'options.php' );
|
@@ -136,10 +139,9 @@ class Imagify_Settings {
|
|
136 |
* Tell if we're submitting the settings form.
|
137 |
*
|
138 |
* @since 1.7
|
|
|
139 |
* @author Grégory Viguier
|
140 |
* @access public
|
141 |
-
*
|
142 |
-
* @return bool
|
143 |
*/
|
144 |
public function is_form_submit() {
|
145 |
return filter_input( INPUT_POST, 'option_page', FILTER_SANITIZE_STRING ) === $this->settings_group && filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING ) === 'update';
|
@@ -155,11 +157,12 @@ class Imagify_Settings {
|
|
155 |
* This must be hooked before Imagify_Options::sanitize_and_validate_on_update().
|
156 |
*
|
157 |
* @since 1.7
|
158 |
-
* @author Grégory Viguier
|
159 |
-
* @access public
|
160 |
*
|
161 |
-
* @param
|
|
|
162 |
* @return array
|
|
|
|
|
163 |
*/
|
164 |
public function populate_values_on_save( $values ) {
|
165 |
if ( ! $this->is_form_submit() ) {
|
@@ -182,9 +185,10 @@ class Imagify_Settings {
|
|
182 |
* Filter settings when saved via the settings page.
|
183 |
*
|
184 |
* @since 1.9
|
185 |
-
* @author Grégory Viguier
|
186 |
*
|
187 |
* @param array $values The option values.
|
|
|
|
|
188 |
*/
|
189 |
$values = apply_filters( 'imagify_settings_on_save', $values );
|
190 |
|
@@ -196,10 +200,11 @@ class Imagify_Settings {
|
|
196 |
*
|
197 |
* @since 1.7
|
198 |
* @access protected
|
199 |
-
* @author Grégory Viguier
|
200 |
*
|
201 |
-
* @param
|
|
|
202 |
* @return array
|
|
|
203 |
*/
|
204 |
protected function populate_disallowed_sizes( $values ) {
|
205 |
$values['disallowed-sizes'] = array();
|
@@ -227,15 +232,17 @@ class Imagify_Settings {
|
|
227 |
*
|
228 |
* @since 1.7
|
229 |
* @access protected
|
230 |
-
* @author Grégory Viguier
|
231 |
*
|
232 |
-
* @param
|
|
|
233 |
* @return array
|
|
|
234 |
*/
|
235 |
protected function populate_custom_folders( $values ) {
|
236 |
if ( ! imagify_can_optimize_custom_folders() ) {
|
237 |
// The databases are not ready or the user has not the permission.
|
238 |
unset( $values['custom_folders'] );
|
|
|
239 |
return $values;
|
240 |
}
|
241 |
|
@@ -253,6 +260,7 @@ class Imagify_Settings {
|
|
253 |
if ( ! is_array( $values['custom_folders'] ) ) {
|
254 |
// Invalid value.
|
255 |
unset( $values['custom_folders'] );
|
|
|
256 |
return $values;
|
257 |
}
|
258 |
|
@@ -330,12 +338,13 @@ class Imagify_Settings {
|
|
330 |
* We use this hook because it can be triggered even if the option value hasn't changed.
|
331 |
*
|
332 |
* @since 1.7
|
333 |
-
* @author Grégory Viguier
|
334 |
-
* @access public
|
335 |
*
|
336 |
-
* @param
|
337 |
-
* @param
|
|
|
338 |
* @return mixed The option value.
|
|
|
|
|
339 |
*/
|
340 |
public function maybe_set_redirection( $value, $old_value ) {
|
341 |
if ( isset( $_POST['submit-goto-bulk'] ) ) { // WPCS: CSRF ok.
|
@@ -349,12 +358,13 @@ class Imagify_Settings {
|
|
349 |
* Used to launch some actions after saving the network options.
|
350 |
*
|
351 |
* @since 1.7
|
|
|
|
|
|
|
|
|
|
|
352 |
* @author Grégory Viguier
|
353 |
* @access public
|
354 |
-
*
|
355 |
-
* @param string $option Name of the network option.
|
356 |
-
* @param mixed $value Current value of the network option.
|
357 |
-
* @param mixed $old_value Old value of the network option.
|
358 |
*/
|
359 |
public function after_save_network_options( $option, $value, $old_value ) {
|
360 |
$this->after_save_options( $old_value, $value );
|
@@ -364,15 +374,16 @@ class Imagify_Settings {
|
|
364 |
* Used to launch some actions after saving the options.
|
365 |
*
|
366 |
* @since 1.7
|
367 |
-
* @author Grégory Viguier
|
368 |
-
* @access public
|
369 |
*
|
370 |
* @param mixed $old_value The old option value.
|
371 |
* @param mixed $value The new option value.
|
|
|
|
|
|
|
372 |
*/
|
373 |
public function after_save_options( $old_value, $value ) {
|
374 |
$old_key = isset( $old_value['api_key'] ) ? $old_value['api_key'] : '';
|
375 |
-
$new_key = isset( $value['api_key'] )
|
376 |
|
377 |
if ( $old_key === $new_key ) {
|
378 |
return;
|
@@ -389,11 +400,14 @@ class Imagify_Settings {
|
|
389 |
/**
|
390 |
* `options.php` does not handle network options. Let's use `admin-post.php` for multisite installations.
|
391 |
*
|
|
|
392 |
* @since 1.7
|
393 |
-
*
|
394 |
-
* @
|
395 |
*/
|
396 |
public function update_site_option_on_network() {
|
|
|
|
|
397 |
if ( empty( $_POST['option_page'] ) || $_POST['option_page'] !== $this->settings_group ) { // WPCS: CSRF ok.
|
398 |
return;
|
399 |
}
|
@@ -403,17 +417,35 @@ class Imagify_Settings {
|
|
403 |
|
404 |
if ( ! current_user_can( $capability ) ) {
|
405 |
imagify_die();
|
|
|
|
|
406 |
}
|
407 |
|
408 |
-
imagify_check_nonce( $this->settings_group . '-options' )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
|
410 |
-
$
|
411 |
|
412 |
-
if ( ! isset( $
|
413 |
imagify_die( __( '<strong>ERROR</strong>: options page not found.' ) );
|
|
|
|
|
414 |
}
|
415 |
|
416 |
-
$options = $
|
417 |
|
418 |
if ( $options ) {
|
419 |
foreach ( $options as $option ) {
|
@@ -447,8 +479,6 @@ class Imagify_Settings {
|
|
447 |
* Display a single checkbox.
|
448 |
*
|
449 |
* @since 1.7
|
450 |
-
* @author Grégory Viguier
|
451 |
-
* @access public
|
452 |
*
|
453 |
* @param array $args Arguments:
|
454 |
* {option_name} string The option name. E.g. 'disallowed-sizes'. Mandatory.
|
@@ -456,6 +486,9 @@ class Imagify_Settings {
|
|
456 |
* {info} string Text to display in an "Info box" after the field. A 'aria-describedby' attribute will automatically be created.
|
457 |
* {attributes} array A list of HTML attributes, as 'attribute' => 'value'.
|
458 |
* {current_value} int|bool USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
|
|
|
|
|
|
459 |
*/
|
460 |
public function field_checkbox( $args ) {
|
461 |
$args = array_merge( [
|
@@ -492,17 +525,29 @@ class Imagify_Settings {
|
|
492 |
$attributes = array_merge( $attributes, $args['attributes'] );
|
493 |
$args['attributes'] = self::build_attributes( $attributes );
|
494 |
?>
|
495 |
-
<input type="checkbox" value="1" <?php
|
|
|
|
|
|
|
|
|
496 |
<!-- Empty onclick attribute to make clickable labels on iTruc & Mac -->
|
497 |
-
<label for="<?php
|
|
|
|
|
|
|
|
|
498 |
<?php
|
499 |
if ( ! $args['info'] ) {
|
500 |
return;
|
501 |
}
|
502 |
?>
|
503 |
-
<span id="<?php
|
|
|
|
|
504 |
<span class="dashicons dashicons-info"></span>
|
505 |
-
<?php
|
|
|
|
|
506 |
</span>
|
507 |
<?php
|
508 |
}
|
@@ -511,8 +556,6 @@ class Imagify_Settings {
|
|
511 |
* Display a checkbox group.
|
512 |
*
|
513 |
* @since 1.7
|
514 |
-
* @author Grégory Viguier
|
515 |
-
* @access public
|
516 |
*
|
517 |
* @param array $args Arguments:
|
518 |
* {option_name} string The option name. E.g. 'disallowed-sizes'. Mandatory.
|
@@ -522,6 +565,9 @@ class Imagify_Settings {
|
|
522 |
* {reverse_check} bool If true, the values that will be stored in the option are the ones that are unchecked. It requires special treatment when saving (detect what values are unchecked).
|
523 |
* {attributes} array A list of HTML attributes, as 'attribute' => 'value'.
|
524 |
* {current_values} array USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
|
|
|
|
|
|
525 |
*/
|
526 |
public function field_checkbox_list( $args ) {
|
527 |
$args = array_merge( [
|
@@ -563,11 +609,15 @@ class Imagify_Settings {
|
|
563 |
$display_check_all = $nb_of_values > 3;
|
564 |
$nb_of_checked = 0;
|
565 |
?>
|
566 |
-
<fieldset class="imagify-check-group<?php
|
|
|
|
|
567 |
<?php
|
568 |
if ( $args['legend'] ) {
|
569 |
?>
|
570 |
-
<legend class="screen-reader-text"><?php
|
|
|
|
|
571 |
<?php
|
572 |
}
|
573 |
|
@@ -588,8 +638,22 @@ class Imagify_Settings {
|
|
588 |
}
|
589 |
?>
|
590 |
<p>
|
591 |
-
<input type="checkbox" value="<?php
|
592 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
</p>
|
594 |
<?php
|
595 |
}
|
@@ -604,11 +668,19 @@ class Imagify_Settings {
|
|
604 |
}
|
605 |
?>
|
606 |
<p class="hide-if-no-js imagify-select-all-buttons">
|
607 |
-
<button type="button" class="imagify-link-like imagify-select-all<?php
|
|
|
|
|
|
|
|
|
608 |
|
609 |
<span class="imagify-pipe"></span>
|
610 |
|
611 |
-
<button type="button" class="imagify-link-like imagify-select-all<?php
|
|
|
|
|
|
|
|
|
612 |
</p>
|
613 |
<?php
|
614 |
}
|
@@ -619,28 +691,28 @@ class Imagify_Settings {
|
|
619 |
*
|
620 |
* @since 1.9
|
621 |
* @access public
|
622 |
-
* @author Grégory Viguier
|
623 |
*
|
624 |
-
* @param array $args
|
625 |
-
*
|
626 |
*
|
627 |
-
*
|
628 |
-
*
|
629 |
-
*
|
630 |
-
*
|
631 |
-
*
|
632 |
-
*
|
633 |
* }
|
|
|
634 |
*/
|
635 |
public function field_radio_list( $args ) {
|
636 |
$args = array_merge( [
|
637 |
-
'option_name'
|
638 |
-
'legend'
|
639 |
-
'info'
|
640 |
-
'values'
|
641 |
-
'attributes'
|
642 |
// To not use the plugin settings: use an array.
|
643 |
-
'current_value'
|
644 |
], $args );
|
645 |
|
646 |
if ( ! $args['option_name'] || ! $args['values'] ) {
|
@@ -670,15 +742,29 @@ class Imagify_Settings {
|
|
670 |
<?php
|
671 |
if ( $args['legend'] ) {
|
672 |
?>
|
673 |
-
<legend class="screen-reader-text"><?php
|
|
|
|
|
674 |
<?php
|
675 |
}
|
676 |
|
677 |
foreach ( $args['values'] as $value => $label ) {
|
678 |
$input_id = sprintf( $id_attribute, sanitize_html_class( $value ) );
|
679 |
?>
|
680 |
-
<input type="radio" value="<?php
|
681 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
<br/>
|
683 |
<?php
|
684 |
}
|
@@ -689,9 +775,13 @@ class Imagify_Settings {
|
|
689 |
return;
|
690 |
}
|
691 |
?>
|
692 |
-
<span id="<?php
|
|
|
|
|
693 |
<span class="dashicons dashicons-info"></span>
|
694 |
-
<?php
|
|
|
|
|
695 |
</span>
|
696 |
<?php
|
697 |
}
|
@@ -701,7 +791,6 @@ class Imagify_Settings {
|
|
701 |
*
|
702 |
* @since 1.9.3
|
703 |
* @access public
|
704 |
-
* @author Grégory Viguier
|
705 |
*
|
706 |
* @param array $args Arguments:
|
707 |
* {option_name} string The option name. E.g. 'disallowed-sizes'. Mandatory.
|
@@ -709,6 +798,8 @@ class Imagify_Settings {
|
|
709 |
* {info} string Text to display in an "Info box" after the field. A 'aria-describedby' attribute will automatically be created.
|
710 |
* {attributes} array A list of HTML attributes, as 'attribute' => 'value'.
|
711 |
* {current_value} int|bool USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
|
|
|
|
712 |
*/
|
713 |
public function field_text_box( $args ) {
|
714 |
$args = array_merge( [
|
@@ -746,16 +837,28 @@ class Imagify_Settings {
|
|
746 |
$args['attributes'] = self::build_attributes( $attributes );
|
747 |
?>
|
748 |
<!-- Empty onclick attribute to make clickable labels on iTruc & Mac -->
|
749 |
-
<label for="<?php
|
750 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
751 |
<?php
|
752 |
if ( ! $args['info'] ) {
|
753 |
return;
|
754 |
}
|
755 |
?>
|
756 |
-
<span id="<?php
|
|
|
|
|
757 |
<span class="dashicons dashicons-info"></span>
|
758 |
-
<?php
|
|
|
|
|
759 |
</span>
|
760 |
<?php
|
761 |
}
|
@@ -765,12 +868,13 @@ class Imagify_Settings {
|
|
765 |
*
|
766 |
* @since 1.9.3
|
767 |
* @access public
|
768 |
-
* @author Grégory Viguier
|
769 |
*
|
770 |
* @param array $args Arguments:
|
771 |
* {option_name} string The option name. E.g. 'disallowed-sizes'. Mandatory.
|
772 |
* {attributes} array A list of HTML attributes, as 'attribute' => 'value'.
|
773 |
* {current_value} int|bool USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
|
|
|
|
774 |
*/
|
775 |
public function field_hidden( $args ) {
|
776 |
$args = array_merge( [
|
@@ -801,7 +905,11 @@ class Imagify_Settings {
|
|
801 |
$attributes = array_merge( $attributes, $args['attributes'] );
|
802 |
$args['attributes'] = self::build_attributes( $attributes );
|
803 |
?>
|
804 |
-
<input type="hidden" value="<?php
|
|
|
|
|
|
|
|
|
805 |
<?php
|
806 |
}
|
807 |
|
@@ -814,10 +922,9 @@ class Imagify_Settings {
|
|
814 |
* Get the thumbnail sizes.
|
815 |
*
|
816 |
* @since 1.7
|
|
|
817 |
* @author Grégory Viguier
|
818 |
* @access public
|
819 |
-
*
|
820 |
-
* @return array A list of thumbnail sizes in the form of 'medium' => 'medium - 300 × 300'.
|
821 |
*/
|
822 |
public static function get_thumbnail_sizes() {
|
823 |
static $sizes;
|
@@ -829,7 +936,7 @@ class Imagify_Settings {
|
|
829 |
$sizes = get_imagify_thumbnail_sizes();
|
830 |
|
831 |
foreach ( $sizes as $size_key => $size_data ) {
|
832 |
-
$sizes[ $size_key ] = sprintf( '%s - %d × %d',
|
833 |
}
|
834 |
|
835 |
return $sizes;
|
@@ -845,10 +952,11 @@ class Imagify_Settings {
|
|
845 |
*
|
846 |
* @since 1.7
|
847 |
* @access public
|
848 |
-
* @author Grégory Viguier
|
849 |
*
|
850 |
-
* @param
|
|
|
851 |
* @return string HTML attributes.
|
|
|
852 |
*/
|
853 |
public static function build_attributes( $attributes ) {
|
854 |
if ( ! $attributes || ! is_array( $attributes ) ) {
|
11 |
/**
|
12 |
* Class version.
|
13 |
*
|
|
|
14 |
* @since 1.7
|
15 |
+
* @var string
|
16 |
*/
|
17 |
const VERSION = '1.0.1';
|
18 |
|
19 |
/**
|
20 |
* The settings group.
|
21 |
*
|
|
|
22 |
* @since 1.7
|
23 |
+
* @var string
|
24 |
*/
|
25 |
protected $settings_group;
|
26 |
|
27 |
/**
|
28 |
* The option name.
|
29 |
*
|
|
|
30 |
* @since 1.7
|
31 |
+
* @var string
|
32 |
*/
|
33 |
protected $option_name;
|
34 |
|
35 |
/**
|
36 |
* The options instance.
|
37 |
*
|
|
|
38 |
* @since 1.7
|
39 |
+
* @var object
|
40 |
*/
|
41 |
protected $options;
|
42 |
|
43 |
/**
|
44 |
* The single instance of the class.
|
45 |
*
|
|
|
46 |
* @since 1.7
|
47 |
* @access protected
|
48 |
+
* @var object
|
49 |
*/
|
50 |
protected static $_instance;
|
51 |
|
66 |
* Get the main Instance.
|
67 |
*
|
68 |
* @since 1.7
|
69 |
+
* @return object Main instance.
|
70 |
* @author Grégory Viguier
|
71 |
* @access public
|
|
|
|
|
72 |
*/
|
73 |
public static function get_instance() {
|
74 |
if ( ! isset( self::$_instance ) ) {
|
86 |
* @access public
|
87 |
*/
|
88 |
public function init() {
|
89 |
+
add_filter( 'sanitize_option_' . $this->option_name, array( $this, 'populate_values_on_save' ), 5 );
|
90 |
+
add_action( 'admin_init', array( $this, 'register' ) );
|
91 |
add_filter( 'option_page_capability_' . $this->settings_group, array( $this, 'get_capability' ) );
|
92 |
|
93 |
if ( imagify_is_active_for_network() ) {
|
94 |
+
add_filter( 'pre_update_site_option_' . $this->option_name, array(
|
95 |
+
$this,
|
96 |
+
'maybe_set_redirection',
|
97 |
+
), 10, 2 );
|
98 |
+
add_action( 'update_site_option_' . $this->option_name, array(
|
99 |
+
$this,
|
100 |
+
'after_save_network_options',
|
101 |
+
), 10, 3 );
|
102 |
+
add_action( 'admin_post_update', array( $this, 'update_site_option_on_network' ) );
|
103 |
} else {
|
104 |
+
add_filter( 'pre_update_option_' . $this->option_name, array( $this, 'maybe_set_redirection' ), 10, 2 );
|
105 |
+
add_action( 'update_option_' . $this->option_name, array( $this, 'after_save_options' ), 10, 2 );
|
106 |
}
|
107 |
}
|
108 |
|
115 |
* Get the name of the settings group.
|
116 |
*
|
117 |
* @since 1.7
|
118 |
+
* @return string
|
119 |
* @author Grégory Viguier
|
120 |
* @access public
|
|
|
|
|
121 |
*/
|
122 |
public function get_settings_group() {
|
123 |
return $this->settings_group;
|
127 |
* Get the URL to use as form action.
|
128 |
*
|
129 |
* @since 1.7
|
130 |
+
* @return string
|
131 |
* @author Grégory Viguier
|
132 |
* @access public
|
|
|
|
|
133 |
*/
|
134 |
public function get_form_action() {
|
135 |
return imagify_is_active_for_network() ? admin_url( 'admin-post.php' ) : admin_url( 'options.php' );
|
139 |
* Tell if we're submitting the settings form.
|
140 |
*
|
141 |
* @since 1.7
|
142 |
+
* @return bool
|
143 |
* @author Grégory Viguier
|
144 |
* @access public
|
|
|
|
|
145 |
*/
|
146 |
public function is_form_submit() {
|
147 |
return filter_input( INPUT_POST, 'option_page', FILTER_SANITIZE_STRING ) === $this->settings_group && filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING ) === 'update';
|
157 |
* This must be hooked before Imagify_Options::sanitize_and_validate_on_update().
|
158 |
*
|
159 |
* @since 1.7
|
|
|
|
|
160 |
*
|
161 |
+
* @param array $values The option values.
|
162 |
+
*
|
163 |
* @return array
|
164 |
+
* @author Grégory Viguier
|
165 |
+
* @access public
|
166 |
*/
|
167 |
public function populate_values_on_save( $values ) {
|
168 |
if ( ! $this->is_form_submit() ) {
|
185 |
* Filter settings when saved via the settings page.
|
186 |
*
|
187 |
* @since 1.9
|
|
|
188 |
*
|
189 |
* @param array $values The option values.
|
190 |
+
*
|
191 |
+
* @author Grégory Viguier
|
192 |
*/
|
193 |
$values = apply_filters( 'imagify_settings_on_save', $values );
|
194 |
|
200 |
*
|
201 |
* @since 1.7
|
202 |
* @access protected
|
|
|
203 |
*
|
204 |
+
* @param array $values The option values.
|
205 |
+
*
|
206 |
* @return array
|
207 |
+
* @author Grégory Viguier
|
208 |
*/
|
209 |
protected function populate_disallowed_sizes( $values ) {
|
210 |
$values['disallowed-sizes'] = array();
|
232 |
*
|
233 |
* @since 1.7
|
234 |
* @access protected
|
|
|
235 |
*
|
236 |
+
* @param array $values The option values.
|
237 |
+
*
|
238 |
* @return array
|
239 |
+
* @author Grégory Viguier
|
240 |
*/
|
241 |
protected function populate_custom_folders( $values ) {
|
242 |
if ( ! imagify_can_optimize_custom_folders() ) {
|
243 |
// The databases are not ready or the user has not the permission.
|
244 |
unset( $values['custom_folders'] );
|
245 |
+
|
246 |
return $values;
|
247 |
}
|
248 |
|
260 |
if ( ! is_array( $values['custom_folders'] ) ) {
|
261 |
// Invalid value.
|
262 |
unset( $values['custom_folders'] );
|
263 |
+
|
264 |
return $values;
|
265 |
}
|
266 |
|
338 |
* We use this hook because it can be triggered even if the option value hasn't changed.
|
339 |
*
|
340 |
* @since 1.7
|
|
|
|
|
341 |
*
|
342 |
+
* @param mixed $value The new, unserialized option value.
|
343 |
+
* @param mixed $old_value The old option value.
|
344 |
+
*
|
345 |
* @return mixed The option value.
|
346 |
+
* @author Grégory Viguier
|
347 |
+
* @access public
|
348 |
*/
|
349 |
public function maybe_set_redirection( $value, $old_value ) {
|
350 |
if ( isset( $_POST['submit-goto-bulk'] ) ) { // WPCS: CSRF ok.
|
358 |
* Used to launch some actions after saving the network options.
|
359 |
*
|
360 |
* @since 1.7
|
361 |
+
*
|
362 |
+
* @param string $option Name of the network option.
|
363 |
+
* @param mixed $value Current value of the network option.
|
364 |
+
* @param mixed $old_value Old value of the network option.
|
365 |
+
*
|
366 |
* @author Grégory Viguier
|
367 |
* @access public
|
|
|
|
|
|
|
|
|
368 |
*/
|
369 |
public function after_save_network_options( $option, $value, $old_value ) {
|
370 |
$this->after_save_options( $old_value, $value );
|
374 |
* Used to launch some actions after saving the options.
|
375 |
*
|
376 |
* @since 1.7
|
|
|
|
|
377 |
*
|
378 |
* @param mixed $old_value The old option value.
|
379 |
* @param mixed $value The new option value.
|
380 |
+
*
|
381 |
+
* @author Grégory Viguier
|
382 |
+
* @access public
|
383 |
*/
|
384 |
public function after_save_options( $old_value, $value ) {
|
385 |
$old_key = isset( $old_value['api_key'] ) ? $old_value['api_key'] : '';
|
386 |
+
$new_key = isset( $value['api_key'] ) ? $value['api_key'] : '';
|
387 |
|
388 |
if ( $old_key === $new_key ) {
|
389 |
return;
|
400 |
/**
|
401 |
* `options.php` does not handle network options. Let's use `admin-post.php` for multisite installations.
|
402 |
*
|
403 |
+
* @since 1.9.11 deprecate 'whitelist_options' filter.
|
404 |
* @since 1.7
|
405 |
+
*
|
406 |
+
* @return void
|
407 |
*/
|
408 |
public function update_site_option_on_network() {
|
409 |
+
global $wp_version;
|
410 |
+
|
411 |
if ( empty( $_POST['option_page'] ) || $_POST['option_page'] !== $this->settings_group ) { // WPCS: CSRF ok.
|
412 |
return;
|
413 |
}
|
417 |
|
418 |
if ( ! current_user_can( $capability ) ) {
|
419 |
imagify_die();
|
420 |
+
|
421 |
+
return;
|
422 |
}
|
423 |
|
424 |
+
if ( ! imagify_check_nonce( $this->settings_group . '-options' ) ) {
|
425 |
+
return;
|
426 |
+
}
|
427 |
+
|
428 |
+
if ( version_compare( $wp_version, '5.5', '>=' ) ) {
|
429 |
+
$allowed_options = apply_filters_deprecated(
|
430 |
+
'whitelist_options',
|
431 |
+
[ [] ],
|
432 |
+
'5.5.0',
|
433 |
+
'allowed_options',
|
434 |
+
__( 'Please consider writing more inclusive code.' )
|
435 |
+
);
|
436 |
+
} else {
|
437 |
+
$allowed_options = apply_filters( 'whitelist_options', [] );
|
438 |
+
}
|
439 |
|
440 |
+
$allowed_options = apply_filters( 'allowed_options', $allowed_options );
|
441 |
|
442 |
+
if ( ! isset( $allowed_options[ $this->settings_group ] ) ) {
|
443 |
imagify_die( __( '<strong>ERROR</strong>: options page not found.' ) );
|
444 |
+
|
445 |
+
return;
|
446 |
}
|
447 |
|
448 |
+
$options = $allowed_options[ $this->settings_group ];
|
449 |
|
450 |
if ( $options ) {
|
451 |
foreach ( $options as $option ) {
|
479 |
* Display a single checkbox.
|
480 |
*
|
481 |
* @since 1.7
|
|
|
|
|
482 |
*
|
483 |
* @param array $args Arguments:
|
484 |
* {option_name} string The option name. E.g. 'disallowed-sizes'. Mandatory.
|
486 |
* {info} string Text to display in an "Info box" after the field. A 'aria-describedby' attribute will automatically be created.
|
487 |
* {attributes} array A list of HTML attributes, as 'attribute' => 'value'.
|
488 |
* {current_value} int|bool USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
489 |
+
*
|
490 |
+
* @author Grégory Viguier
|
491 |
+
* @access public
|
492 |
*/
|
493 |
public function field_checkbox( $args ) {
|
494 |
$args = array_merge( [
|
525 |
$attributes = array_merge( $attributes, $args['attributes'] );
|
526 |
$args['attributes'] = self::build_attributes( $attributes );
|
527 |
?>
|
528 |
+
<input type="checkbox" value="1" <?php
|
529 |
+
checked( $current_value, 1 );
|
530 |
+
?><?php
|
531 |
+
echo $args['attributes'];
|
532 |
+
?> />
|
533 |
<!-- Empty onclick attribute to make clickable labels on iTruc & Mac -->
|
534 |
+
<label for="<?php
|
535 |
+
echo $attributes['id'];
|
536 |
+
?>" onclick=""><?php
|
537 |
+
echo $args['label'];
|
538 |
+
?></label>
|
539 |
<?php
|
540 |
if ( ! $args['info'] ) {
|
541 |
return;
|
542 |
}
|
543 |
?>
|
544 |
+
<span id="<?php
|
545 |
+
echo $attributes['aria-describedby'];
|
546 |
+
?>" class="imagify-info">
|
547 |
<span class="dashicons dashicons-info"></span>
|
548 |
+
<?php
|
549 |
+
echo $args['info'];
|
550 |
+
?>
|
551 |
</span>
|
552 |
<?php
|
553 |
}
|
556 |
* Display a checkbox group.
|
557 |
*
|
558 |
* @since 1.7
|
|
|
|
|
559 |
*
|
560 |
* @param array $args Arguments:
|
561 |
* {option_name} string The option name. E.g. 'disallowed-sizes'. Mandatory.
|
565 |
* {reverse_check} bool If true, the values that will be stored in the option are the ones that are unchecked. It requires special treatment when saving (detect what values are unchecked).
|
566 |
* {attributes} array A list of HTML attributes, as 'attribute' => 'value'.
|
567 |
* {current_values} array USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
568 |
+
*
|
569 |
+
* @author Grégory Viguier
|
570 |
+
* @access public
|
571 |
*/
|
572 |
public function field_checkbox_list( $args ) {
|
573 |
$args = array_merge( [
|
609 |
$display_check_all = $nb_of_values > 3;
|
610 |
$nb_of_checked = 0;
|
611 |
?>
|
612 |
+
<fieldset class="imagify-check-group<?php
|
613 |
+
echo $nb_of_values > 5 ? ' imagify-is-scrollable' : '';
|
614 |
+
?>">
|
615 |
<?php
|
616 |
if ( $args['legend'] ) {
|
617 |
?>
|
618 |
+
<legend class="screen-reader-text"><?php
|
619 |
+
echo $args['legend'];
|
620 |
+
?></legend>
|
621 |
<?php
|
622 |
}
|
623 |
|
638 |
}
|
639 |
?>
|
640 |
<p>
|
641 |
+
<input type="checkbox" value="<?php
|
642 |
+
echo esc_attr( $value );
|
643 |
+
?>" id="<?php
|
644 |
+
echo $input_id;
|
645 |
+
?>"<?php
|
646 |
+
echo $args['attributes'];
|
647 |
+
?> <?php
|
648 |
+
checked( $checked );
|
649 |
+
?> <?php
|
650 |
+
disabled( $disabled );
|
651 |
+
?>/>
|
652 |
+
<label for="<?php
|
653 |
+
echo $input_id;
|
654 |
+
?>" onclick=""><?php
|
655 |
+
echo $label;
|
656 |
+
?></label>
|
657 |
</p>
|
658 |
<?php
|
659 |
}
|
668 |
}
|
669 |
?>
|
670 |
<p class="hide-if-no-js imagify-select-all-buttons">
|
671 |
+
<button type="button" class="imagify-link-like imagify-select-all<?php
|
672 |
+
echo $all_checked ? ' imagify-is-inactive" aria-disabled="true' : '';
|
673 |
+
?>" data-action="select"><?php
|
674 |
+
_e( 'Select All', 'imagify' );
|
675 |
+
?></button>
|
676 |
|
677 |
<span class="imagify-pipe"></span>
|
678 |
|
679 |
+
<button type="button" class="imagify-link-like imagify-select-all<?php
|
680 |
+
echo $nb_of_checked ? '' : ' imagify-is-inactive" aria-disabled="true';
|
681 |
+
?>" data-action="unselect"><?php
|
682 |
+
_e( 'Unselect All', 'imagify' );
|
683 |
+
?></button>
|
684 |
</p>
|
685 |
<?php
|
686 |
}
|
691 |
*
|
692 |
* @since 1.9
|
693 |
* @access public
|
|
|
694 |
*
|
695 |
+
* @param array $args {
|
696 |
+
* Arguments.
|
697 |
*
|
698 |
+
* @type string $option_name The option name. E.g. 'disallowed-sizes'. Mandatory.
|
699 |
+
* @type string $legend Label to use for the <legend> tag.
|
700 |
+
* @type string $info Text to display in an "Info box" after the field. A 'aria-describedby' attribute will automatically be created.
|
701 |
+
* @type array $values List of values to display, in the form of 'value' => 'Label'. Mandatory.
|
702 |
+
* @type array $attributes A list of HTML attributes, as 'attribute' => 'value'.
|
703 |
+
* @type array $current_value USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
704 |
* }
|
705 |
+
* @author Grégory Viguier
|
706 |
*/
|
707 |
public function field_radio_list( $args ) {
|
708 |
$args = array_merge( [
|
709 |
+
'option_name' => '',
|
710 |
+
'legend' => '',
|
711 |
+
'info' => '',
|
712 |
+
'values' => [],
|
713 |
+
'attributes' => [],
|
714 |
// To not use the plugin settings: use an array.
|
715 |
+
'current_value' => false,
|
716 |
], $args );
|
717 |
|
718 |
if ( ! $args['option_name'] || ! $args['values'] ) {
|
742 |
<?php
|
743 |
if ( $args['legend'] ) {
|
744 |
?>
|
745 |
+
<legend class="screen-reader-text"><?php
|
746 |
+
echo $args['legend'];
|
747 |
+
?></legend>
|
748 |
<?php
|
749 |
}
|
750 |
|
751 |
foreach ( $args['values'] as $value => $label ) {
|
752 |
$input_id = sprintf( $id_attribute, sanitize_html_class( $value ) );
|
753 |
?>
|
754 |
+
<input type="radio" value="<?php
|
755 |
+
echo esc_attr( $value );
|
756 |
+
?>" id="<?php
|
757 |
+
echo $input_id;
|
758 |
+
?>"<?php
|
759 |
+
echo $args['attributes'];
|
760 |
+
?> <?php
|
761 |
+
checked( $current_value, $value );
|
762 |
+
?>/>
|
763 |
+
<label for="<?php
|
764 |
+
echo $input_id;
|
765 |
+
?>" onclick=""><?php
|
766 |
+
echo $label;
|
767 |
+
?></label>
|
768 |
<br/>
|
769 |
<?php
|
770 |
}
|
775 |
return;
|
776 |
}
|
777 |
?>
|
778 |
+
<span id="<?php
|
779 |
+
echo $attributes['aria-describedby'];
|
780 |
+
?>" class="imagify-info">
|
781 |
<span class="dashicons dashicons-info"></span>
|
782 |
+
<?php
|
783 |
+
echo $args['info'];
|
784 |
+
?>
|
785 |
</span>
|
786 |
<?php
|
787 |
}
|
791 |
*
|
792 |
* @since 1.9.3
|
793 |
* @access public
|
|
|
794 |
*
|
795 |
* @param array $args Arguments:
|
796 |
* {option_name} string The option name. E.g. 'disallowed-sizes'. Mandatory.
|
798 |
* {info} string Text to display in an "Info box" after the field. A 'aria-describedby' attribute will automatically be created.
|
799 |
* {attributes} array A list of HTML attributes, as 'attribute' => 'value'.
|
800 |
* {current_value} int|bool USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
801 |
+
*
|
802 |
+
* @author Grégory Viguier
|
803 |
*/
|
804 |
public function field_text_box( $args ) {
|
805 |
$args = array_merge( [
|
837 |
$args['attributes'] = self::build_attributes( $attributes );
|
838 |
?>
|
839 |
<!-- Empty onclick attribute to make clickable labels on iTruc & Mac -->
|
840 |
+
<label for="<?php
|
841 |
+
echo $attributes['id'];
|
842 |
+
?>" onclick=""><?php
|
843 |
+
echo $args['label'];
|
844 |
+
?></label>
|
845 |
+
<input type="text" value="<?php
|
846 |
+
echo esc_attr( $current_value );
|
847 |
+
?>"<?php
|
848 |
+
echo $args['attributes'];
|
849 |
+
?> />
|
850 |
<?php
|
851 |
if ( ! $args['info'] ) {
|
852 |
return;
|
853 |
}
|
854 |
?>
|
855 |
+
<span id="<?php
|
856 |
+
echo $attributes['aria-describedby'];
|
857 |
+
?>" class="imagify-info">
|
858 |
<span class="dashicons dashicons-info"></span>
|
859 |
+
<?php
|
860 |
+
echo $args['info'];
|
861 |
+
?>
|
862 |
</span>
|
863 |
<?php
|
864 |
}
|
868 |
*
|
869 |
* @since 1.9.3
|
870 |
* @access public
|
|
|
871 |
*
|
872 |
* @param array $args Arguments:
|
873 |
* {option_name} string The option name. E.g. 'disallowed-sizes'. Mandatory.
|
874 |
* {attributes} array A list of HTML attributes, as 'attribute' => 'value'.
|
875 |
* {current_value} int|bool USE ONLY WHEN DEALING WITH DATA THAT IS NOT SAVED IN THE PLUGIN OPTIONS. If not provided, the field will automatically get the value from the options.
|
876 |
+
*
|
877 |
+
* @author Grégory Viguier
|
878 |
*/
|
879 |
public function field_hidden( $args ) {
|
880 |
$args = array_merge( [
|
905 |
$attributes = array_merge( $attributes, $args['attributes'] );
|
906 |
$args['attributes'] = self::build_attributes( $attributes );
|
907 |
?>
|
908 |
+
<input type="hidden" value="<?php
|
909 |
+
echo esc_attr( $current_value );
|
910 |
+
?>"<?php
|
911 |
+
echo $args['attributes'];
|
912 |
+
?> />
|
913 |
<?php
|
914 |
}
|
915 |
|
922 |
* Get the thumbnail sizes.
|
923 |
*
|
924 |
* @since 1.7
|
925 |
+
* @return array A list of thumbnail sizes in the form of 'medium' => 'medium - 300 × 300'.
|
926 |
* @author Grégory Viguier
|
927 |
* @access public
|
|
|
|
|
928 |
*/
|
929 |
public static function get_thumbnail_sizes() {
|
930 |
static $sizes;
|
936 |
$sizes = get_imagify_thumbnail_sizes();
|
937 |
|
938 |
foreach ( $sizes as $size_key => $size_data ) {
|
939 |
+
$sizes[ $size_key ] = sprintf( '%s - %d × %d', esc_html( stripslashes( $size_data['name'] ) ), $size_data['width'], $size_data['height'] );
|
940 |
}
|
941 |
|
942 |
return $sizes;
|
952 |
*
|
953 |
* @since 1.7
|
954 |
* @access public
|
|
|
955 |
*
|
956 |
+
* @param array $attributes A list of attribute pairs.
|
957 |
+
*
|
958 |
* @return string HTML attributes.
|
959 |
+
* @author Grégory Viguier
|
960 |
*/
|
961 |
public static function build_attributes( $attributes ) {
|
962 |
if ( ! $attributes || ! is_array( $attributes ) ) {
|
inc/functions/admin.php
CHANGED
@@ -257,16 +257,22 @@ function imagify_get_wp_rocket_url( $path = false, $query = array() ) {
|
|
257 |
/**
|
258 |
* Check for nonce.
|
259 |
*
|
|
|
260 |
* @since 1.6.10
|
261 |
* @author Grégory Viguier
|
262 |
*
|
263 |
* @param string $action Action nonce.
|
264 |
* @param string|bool $query_arg Optional. Key to check for the nonce in `$_REQUEST`. If false, `$_REQUEST` values will be evaluated for '_ajax_nonce', and '_wpnonce' (in that order). Default false.
|
|
|
|
|
265 |
*/
|
266 |
function imagify_check_nonce( $action, $query_arg = false ) {
|
267 |
if ( ! check_ajax_referer( $action, $query_arg, false ) ) {
|
268 |
imagify_die();
|
|
|
269 |
}
|
|
|
|
|
270 |
}
|
271 |
|
272 |
/**
|
257 |
/**
|
258 |
* Check for nonce.
|
259 |
*
|
260 |
+
* @since 1.9.11 Return true when nonce is good.
|
261 |
* @since 1.6.10
|
262 |
* @author Grégory Viguier
|
263 |
*
|
264 |
* @param string $action Action nonce.
|
265 |
* @param string|bool $query_arg Optional. Key to check for the nonce in `$_REQUEST`. If false, `$_REQUEST` values will be evaluated for '_ajax_nonce', and '_wpnonce' (in that order). Default false.
|
266 |
+
*
|
267 |
+
* @return bool True if the nonce is good; otherwise terminates.
|
268 |
*/
|
269 |
function imagify_check_nonce( $action, $query_arg = false ) {
|
270 |
if ( ! check_ajax_referer( $action, $query_arg, false ) ) {
|
271 |
imagify_die();
|
272 |
+
return false;
|
273 |
}
|
274 |
+
|
275 |
+
return true;
|
276 |
}
|
277 |
|
278 |
/**
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
=== Imagify –
|
2 |
-
Contributors: wp_media
|
3 |
-
Tags: convert webp, optimize images,
|
4 |
Requires at least: 4.0.0
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.9.
|
7 |
|
8 |
Optimize images in one click: reduce image file sizes, convert WebP, keep your images beautiful… and boost your loading time and your SEO!
|
9 |
|
@@ -153,6 +153,12 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
|
|
153 |
4. Other Media Page
|
154 |
|
155 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
= 1.9.10 - 2020/05/26 =
|
157 |
* Fix: Correctly optimize thumbnails during auto-optimization of image upload
|
158 |
* Fix: Fix broken compatibility with Enable Media Replace plugin after WordPress 5.3
|
1 |
+
=== Imagify – Image Optimization & Convert WebP ===
|
2 |
+
Contributors: wp_media
|
3 |
+
Tags: convert webp, webp, optimize images, optimize, images
|
4 |
Requires at least: 4.0.0
|
5 |
+
Tested up to: 5.5.1
|
6 |
+
Stable tag: 1.9.11
|
7 |
|
8 |
Optimize images in one click: reduce image file sizes, convert WebP, keep your images beautiful… and boost your loading time and your SEO!
|
9 |
|
153 |
4. Other Media Page
|
154 |
|
155 |
== Changelog ==
|
156 |
+
= 1.9.11 - 2020/09/09 =
|
157 |
+
* Fix: Fix settings error on multi-sites with WordPress 5.5
|
158 |
+
* Fix: Write the correct conf file for use with webp rewrites on nginx
|
159 |
+
* Improvement: Namespace composer dependencies to avoid possible naming collisions.
|
160 |
+
* Security: Add blank index.php to imagify-created backup folders to disable public access.
|
161 |
+
|
162 |
= 1.9.10 - 2020/05/26 =
|
163 |
* Fix: Correctly optimize thumbnails during auto-optimization of image upload
|
164 |
* Fix: Fix broken compatibility with Enable Media Replace plugin after WordPress 5.3
|
vendor/a5hleyrich/wp-background-processing/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/vendor/
|
|
vendor/a5hleyrich/wp-background-processing/README.md
DELETED
@@ -1,158 +0,0 @@
|
|
1 |
-
# WP Background Processing
|
2 |
-
|
3 |
-
WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks. Check out the [example plugin](https://github.com/A5hleyRich/wp-background-processing-example) or read the [accompanying article](https://deliciousbrains.com/background-processing-wordpress/).
|
4 |
-
|
5 |
-
Inspired by [TechCrunch WP Asynchronous Tasks](https://github.com/techcrunch/wp-async-task).
|
6 |
-
|
7 |
-
__Requires PHP 5.2+__
|
8 |
-
|
9 |
-
### Async Request
|
10 |
-
|
11 |
-
Async requests are useful for pushing slow one-off tasks such as sending emails to a background process. Once the request has been dispatched it will process in the background instantly.
|
12 |
-
|
13 |
-
Extend the `WP_Async_Request` class:
|
14 |
-
|
15 |
-
```php
|
16 |
-
class WP_Example_Request extends WP_Async_Request {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @var string
|
20 |
-
*/
|
21 |
-
protected $action = 'example_request';
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Handle
|
25 |
-
*
|
26 |
-
* Override this method to perform any actions required
|
27 |
-
* during the async request.
|
28 |
-
*/
|
29 |
-
protected function handle() {
|
30 |
-
// Actions to perform
|
31 |
-
}
|
32 |
-
|
33 |
-
}
|
34 |
-
```
|
35 |
-
|
36 |
-
##### `protected $action`
|
37 |
-
|
38 |
-
Should be set to a unique name.
|
39 |
-
|
40 |
-
##### `protected function handle()`
|
41 |
-
|
42 |
-
Should contain any logic to perform during the non-blocking request. The data passed to the request will be accessible via `$_POST`.
|
43 |
-
|
44 |
-
##### Dispatching Requests
|
45 |
-
|
46 |
-
Instantiate your request:
|
47 |
-
|
48 |
-
`$this->example_request = new WP_Example_Request();`
|
49 |
-
|
50 |
-
Add data to the request if required:
|
51 |
-
|
52 |
-
`$this->example_request->data( array( 'value1' => $value1, 'value2' => $value2 ) );`
|
53 |
-
|
54 |
-
Fire off the request:
|
55 |
-
|
56 |
-
`$this->example_request->dispatch();`
|
57 |
-
|
58 |
-
Chaining is also supported:
|
59 |
-
|
60 |
-
`$this->example_request->data( array( 'data' => $data ) )->dispatch();`
|
61 |
-
|
62 |
-
### Background Process
|
63 |
-
|
64 |
-
Background processes work in a similar fashion to async requests but they allow you to queue tasks. Items pushed onto the queue will be processed in the background once the queue has been dispatched. Queues will also scale based on available server resources, so higher end servers will process more items per batch. Once a batch has completed the next batch will start instantly.
|
65 |
-
|
66 |
-
Health checks run by default every 5 minutes to ensure the queue is running when queued items exist. If the queue has failed it will be restarted.
|
67 |
-
|
68 |
-
Queues work on a first in first out basis, which allows additional items to be pushed to the queue even if it’s already processing.
|
69 |
-
|
70 |
-
Extend the `WP_Background_Process` class:
|
71 |
-
|
72 |
-
```php
|
73 |
-
class WP_Example_Process extends WP_Background_Process {
|
74 |
-
|
75 |
-
/**
|
76 |
-
* @var string
|
77 |
-
*/
|
78 |
-
protected $action = 'example_process';
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Task
|
82 |
-
*
|
83 |
-
* Override this method to perform any actions required on each
|
84 |
-
* queue item. Return the modified item for further processing
|
85 |
-
* in the next pass through. Or, return false to remove the
|
86 |
-
* item from the queue.
|
87 |
-
*
|
88 |
-
* @param mixed $item Queue item to iterate over
|
89 |
-
*
|
90 |
-
* @return mixed
|
91 |
-
*/
|
92 |
-
protected function task( $item ) {
|
93 |
-
// Actions to perform
|
94 |
-
|
95 |
-
return false;
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Complete
|
100 |
-
*
|
101 |
-
* Override if applicable, but ensure that the below actions are
|
102 |
-
* performed, or, call parent::complete().
|
103 |
-
*/
|
104 |
-
protected function complete() {
|
105 |
-
parent::complete();
|
106 |
-
|
107 |
-
// Show notice to user or perform some other arbitrary task...
|
108 |
-
}
|
109 |
-
|
110 |
-
}
|
111 |
-
```
|
112 |
-
|
113 |
-
##### `protected $action`
|
114 |
-
|
115 |
-
Should be set to a unique name.
|
116 |
-
|
117 |
-
##### `protected function task( $item )`
|
118 |
-
|
119 |
-
Should contain any logic to perform on the queued item. Return `false` to remove the item from the queue or return `$item` to push it back onto the queue for further processing. If the item has been modified and is pushed back onto the queue the current state will be saved before the batch is exited.
|
120 |
-
|
121 |
-
##### `protected function complete()`
|
122 |
-
|
123 |
-
Optionally contain any logic to perform once the queue has completed.
|
124 |
-
|
125 |
-
##### Dispatching Processes
|
126 |
-
|
127 |
-
Instantiate your process:
|
128 |
-
|
129 |
-
`$this->example_process = new WP_Example_Process();`
|
130 |
-
|
131 |
-
Push items to the queue:
|
132 |
-
|
133 |
-
```php
|
134 |
-
foreach ( $items as $item ) {
|
135 |
-
$this->example_process->push_to_queue( $item );
|
136 |
-
}
|
137 |
-
```
|
138 |
-
|
139 |
-
Save and dispatch the queue:
|
140 |
-
|
141 |
-
`$this->example_process->save()->dispatch();`
|
142 |
-
|
143 |
-
### BasicAuth
|
144 |
-
|
145 |
-
If your site is behind BasicAuth, both async requests and background processes will fail to complete. This is because WP Background Processing relies on the [WordPress HTTP API](http://codex.wordpress.org/HTTP_API), which requires you to attach your BasicAuth credentials to requests. The easiest way to do this is using the following filter:
|
146 |
-
|
147 |
-
```php
|
148 |
-
function wpbp_http_request_args( $r, $url ) {
|
149 |
-
$r['headers']['Authorization'] = 'Basic ' . base64_encode( USERNAME . ':' . PASSWORD );
|
150 |
-
|
151 |
-
return $r;
|
152 |
-
}
|
153 |
-
add_filter( 'http_request_args', 'wpbp_http_request_args', 10, 2);
|
154 |
-
```
|
155 |
-
|
156 |
-
## License
|
157 |
-
|
158 |
-
[GPLv2+](http://www.gnu.org/licenses/gpl-2.0.html)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/a5hleyrich/wp-background-processing/classes/wp-async-request.php
DELETED
@@ -1,163 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WP Async Request
|
4 |
-
*
|
5 |
-
* @package WP-Background-Processing
|
6 |
-
*/
|
7 |
-
|
8 |
-
if ( ! class_exists( 'WP_Async_Request' ) ) {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Abstract WP_Async_Request class.
|
12 |
-
*
|
13 |
-
* @abstract
|
14 |
-
*/
|
15 |
-
abstract class WP_Async_Request {
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Prefix
|
19 |
-
*
|
20 |
-
* (default value: 'wp')
|
21 |
-
*
|
22 |
-
* @var string
|
23 |
-
* @access protected
|
24 |
-
*/
|
25 |
-
protected $prefix = 'wp';
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Action
|
29 |
-
*
|
30 |
-
* (default value: 'async_request')
|
31 |
-
*
|
32 |
-
* @var string
|
33 |
-
* @access protected
|
34 |
-
*/
|
35 |
-
protected $action = 'async_request';
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Identifier
|
39 |
-
*
|
40 |
-
* @var mixed
|
41 |
-
* @access protected
|
42 |
-
*/
|
43 |
-
protected $identifier;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Data
|
47 |
-
*
|
48 |
-
* (default value: array())
|
49 |
-
*
|
50 |
-
* @var array
|
51 |
-
* @access protected
|
52 |
-
*/
|
53 |
-
protected $data = array();
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Initiate new async request
|
57 |
-
*/
|
58 |
-
public function __construct() {
|
59 |
-
$this->identifier = $this->prefix . '_' . $this->action;
|
60 |
-
|
61 |
-
add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) );
|
62 |
-
add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) );
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Set data used during the request
|
67 |
-
*
|
68 |
-
* @param array $data Data.
|
69 |
-
*
|
70 |
-
* @return $this
|
71 |
-
*/
|
72 |
-
public function data( $data ) {
|
73 |
-
$this->data = $data;
|
74 |
-
|
75 |
-
return $this;
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Dispatch the async request
|
80 |
-
*
|
81 |
-
* @return array|WP_Error
|
82 |
-
*/
|
83 |
-
public function dispatch() {
|
84 |
-
$url = add_query_arg( $this->get_query_args(), $this->get_query_url() );
|
85 |
-
$args = $this->get_post_args();
|
86 |
-
|
87 |
-
return wp_remote_post( esc_url_raw( $url ), $args );
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Get query args
|
92 |
-
*
|
93 |
-
* @return array
|
94 |
-
*/
|
95 |
-
protected function get_query_args() {
|
96 |
-
if ( property_exists( $this, 'query_args' ) ) {
|
97 |
-
return $this->query_args;
|
98 |
-
}
|
99 |
-
|
100 |
-
return array(
|
101 |
-
'action' => $this->identifier,
|
102 |
-
'nonce' => wp_create_nonce( $this->identifier ),
|
103 |
-
);
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Get query URL
|
108 |
-
*
|
109 |
-
* @return string
|
110 |
-
*/
|
111 |
-
protected function get_query_url() {
|
112 |
-
if ( property_exists( $this, 'query_url' ) ) {
|
113 |
-
return $this->query_url;
|
114 |
-
}
|
115 |
-
|
116 |
-
return admin_url( 'admin-ajax.php' );
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Get post args
|
121 |
-
*
|
122 |
-
* @return array
|
123 |
-
*/
|
124 |
-
protected function get_post_args() {
|
125 |
-
if ( property_exists( $this, 'post_args' ) ) {
|
126 |
-
return $this->post_args;
|
127 |
-
}
|
128 |
-
|
129 |
-
return array(
|
130 |
-
'timeout' => 0.01,
|
131 |
-
'blocking' => false,
|
132 |
-
'body' => $this->data,
|
133 |
-
'cookies' => $_COOKIE,
|
134 |
-
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
|
135 |
-
);
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Maybe handle
|
140 |
-
*
|
141 |
-
* Check for correct nonce and pass to handler.
|
142 |
-
*/
|
143 |
-
public function maybe_handle() {
|
144 |
-
// Don't lock up other requests while processing
|
145 |
-
session_write_close();
|
146 |
-
|
147 |
-
check_ajax_referer( $this->identifier, 'nonce' );
|
148 |
-
|
149 |
-
$this->handle();
|
150 |
-
|
151 |
-
wp_die();
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Handle
|
156 |
-
*
|
157 |
-
* Override this method to perform any actions required
|
158 |
-
* during the async request.
|
159 |
-
*/
|
160 |
-
abstract protected function handle();
|
161 |
-
|
162 |
-
}
|
163 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/a5hleyrich/wp-background-processing/classes/wp-background-process.php
DELETED
@@ -1,506 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WP Background Process
|
4 |
-
*
|
5 |
-
* @package WP-Background-Processing
|
6 |
-
*/
|
7 |
-
|
8 |
-
if ( ! class_exists( 'WP_Background_Process' ) ) {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Abstract WP_Background_Process class.
|
12 |
-
*
|
13 |
-
* @abstract
|
14 |
-
* @extends WP_Async_Request
|
15 |
-
*/
|
16 |
-
abstract class WP_Background_Process extends WP_Async_Request {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Action
|
20 |
-
*
|
21 |
-
* (default value: 'background_process')
|
22 |
-
*
|
23 |
-
* @var string
|
24 |
-
* @access protected
|
25 |
-
*/
|
26 |
-
protected $action = 'background_process';
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Start time of current process.
|
30 |
-
*
|
31 |
-
* (default value: 0)
|
32 |
-
*
|
33 |
-
* @var int
|
34 |
-
* @access protected
|
35 |
-
*/
|
36 |
-
protected $start_time = 0;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Cron_hook_identifier
|
40 |
-
*
|
41 |
-
* @var mixed
|
42 |
-
* @access protected
|
43 |
-
*/
|
44 |
-
protected $cron_hook_identifier;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Cron_interval_identifier
|
48 |
-
*
|
49 |
-
* @var mixed
|
50 |
-
* @access protected
|
51 |
-
*/
|
52 |
-
protected $cron_interval_identifier;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Initiate new background process
|
56 |
-
*/
|
57 |
-
public function __construct() {
|
58 |
-
parent::__construct();
|
59 |
-
|
60 |
-
$this->cron_hook_identifier = $this->identifier . '_cron';
|
61 |
-
$this->cron_interval_identifier = $this->identifier . '_cron_interval';
|
62 |
-
|
63 |
-
add_action( $this->cron_hook_identifier, array( $this, 'handle_cron_healthcheck' ) );
|
64 |
-
add_filter( 'cron_schedules', array( $this, 'schedule_cron_healthcheck' ) );
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Dispatch
|
69 |
-
*
|
70 |
-
* @access public
|
71 |
-
* @return void
|
72 |
-
*/
|
73 |
-
public function dispatch() {
|
74 |
-
// Schedule the cron healthcheck.
|
75 |
-
$this->schedule_event();
|
76 |
-
|
77 |
-
// Perform remote post.
|
78 |
-
return parent::dispatch();
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Push to queue
|
83 |
-
*
|
84 |
-
* @param mixed $data Data.
|
85 |
-
*
|
86 |
-
* @return $this
|
87 |
-
*/
|
88 |
-
public function push_to_queue( $data ) {
|
89 |
-
$this->data[] = $data;
|
90 |
-
|
91 |
-
return $this;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Save queue
|
96 |
-
*
|
97 |
-
* @return $this
|
98 |
-
*/
|
99 |
-
public function save() {
|
100 |
-
$key = $this->generate_key();
|
101 |
-
|
102 |
-
if ( ! empty( $this->data ) ) {
|
103 |
-
update_site_option( $key, $this->data );
|
104 |
-
}
|
105 |
-
|
106 |
-
return $this;
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Update queue
|
111 |
-
*
|
112 |
-
* @param string $key Key.
|
113 |
-
* @param array $data Data.
|
114 |
-
*
|
115 |
-
* @return $this
|
116 |
-
*/
|
117 |
-
public function update( $key, $data ) {
|
118 |
-
if ( ! empty( $data ) ) {
|
119 |
-
update_site_option( $key, $data );
|
120 |
-
}
|
121 |
-
|
122 |
-
return $this;
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Delete queue
|
127 |
-
*
|
128 |
-
* @param string $key Key.
|
129 |
-
*
|
130 |
-
* @return $this
|
131 |
-
*/
|
132 |
-
public function delete( $key ) {
|
133 |
-
delete_site_option( $key );
|
134 |
-
|
135 |
-
return $this;
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Generate key
|
140 |
-
*
|
141 |
-
* Generates a unique key based on microtime. Queue items are
|
142 |
-
* given a unique key so that they can be merged upon save.
|
143 |
-
*
|
144 |
-
* @param int $length Length.
|
145 |
-
*
|
146 |
-
* @return string
|
147 |
-
*/
|
148 |
-
protected function generate_key( $length = 64 ) {
|
149 |
-
$unique = md5( microtime() . rand() );
|
150 |
-
$prepend = $this->identifier . '_batch_';
|
151 |
-
|
152 |
-
return substr( $prepend . $unique, 0, $length );
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* Maybe process queue
|
157 |
-
*
|
158 |
-
* Checks whether data exists within the queue and that
|
159 |
-
* the process is not already running.
|
160 |
-
*/
|
161 |
-
public function maybe_handle() {
|
162 |
-
// Don't lock up other requests while processing
|
163 |
-
session_write_close();
|
164 |
-
|
165 |
-
if ( $this->is_process_running() ) {
|
166 |
-
// Background process already running.
|
167 |
-
wp_die();
|
168 |
-
}
|
169 |
-
|
170 |
-
if ( $this->is_queue_empty() ) {
|
171 |
-
// No data to process.
|
172 |
-
wp_die();
|
173 |
-
}
|
174 |
-
|
175 |
-
check_ajax_referer( $this->identifier, 'nonce' );
|
176 |
-
|
177 |
-
$this->handle();
|
178 |
-
|
179 |
-
wp_die();
|
180 |
-
}
|
181 |
-
|
182 |
-
/**
|
183 |
-
* Is queue empty
|
184 |
-
*
|
185 |
-
* @return bool
|
186 |
-
*/
|
187 |
-
protected function is_queue_empty() {
|
188 |
-
global $wpdb;
|
189 |
-
|
190 |
-
$table = $wpdb->options;
|
191 |
-
$column = 'option_name';
|
192 |
-
|
193 |
-
if ( is_multisite() ) {
|
194 |
-
$table = $wpdb->sitemeta;
|
195 |
-
$column = 'meta_key';
|
196 |
-
}
|
197 |
-
|
198 |
-
$key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
|
199 |
-
|
200 |
-
$count = $wpdb->get_var( $wpdb->prepare( "
|
201 |
-
SELECT COUNT(*)
|
202 |
-
FROM {$table}
|
203 |
-
WHERE {$column} LIKE %s
|
204 |
-
", $key ) );
|
205 |
-
|
206 |
-
return ( $count > 0 ) ? false : true;
|
207 |
-
}
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Is process running
|
211 |
-
*
|
212 |
-
* Check whether the current process is already running
|
213 |
-
* in a background process.
|
214 |
-
*/
|
215 |
-
protected function is_process_running() {
|
216 |
-
if ( get_site_transient( $this->identifier . '_process_lock' ) ) {
|
217 |
-
// Process already running.
|
218 |
-
return true;
|
219 |
-
}
|
220 |
-
|
221 |
-
return false;
|
222 |
-
}
|
223 |
-
|
224 |
-
/**
|
225 |
-
* Lock process
|
226 |
-
*
|
227 |
-
* Lock the process so that multiple instances can't run simultaneously.
|
228 |
-
* Override if applicable, but the duration should be greater than that
|
229 |
-
* defined in the time_exceeded() method.
|
230 |
-
*/
|
231 |
-
protected function lock_process() {
|
232 |
-
$this->start_time = time(); // Set start time of current process.
|
233 |
-
|
234 |
-
$lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute
|
235 |
-
$lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration );
|
236 |
-
|
237 |
-
set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration );
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Unlock process
|
242 |
-
*
|
243 |
-
* Unlock the process so that other instances can spawn.
|
244 |
-
*
|
245 |
-
* @return $this
|
246 |
-
*/
|
247 |
-
protected function unlock_process() {
|
248 |
-
delete_site_transient( $this->identifier . '_process_lock' );
|
249 |
-
|
250 |
-
return $this;
|
251 |
-
}
|
252 |
-
|
253 |
-
/**
|
254 |
-
* Get batch
|
255 |
-
*
|
256 |
-
* @return stdClass Return the first batch from the queue
|
257 |
-
*/
|
258 |
-
protected function get_batch() {
|
259 |
-
global $wpdb;
|
260 |
-
|
261 |
-
$table = $wpdb->options;
|
262 |
-
$column = 'option_name';
|
263 |
-
$key_column = 'option_id';
|
264 |
-
$value_column = 'option_value';
|
265 |
-
|
266 |
-
if ( is_multisite() ) {
|
267 |
-
$table = $wpdb->sitemeta;
|
268 |
-
$column = 'meta_key';
|
269 |
-
$key_column = 'meta_id';
|
270 |
-
$value_column = 'meta_value';
|
271 |
-
}
|
272 |
-
|
273 |
-
$key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
|
274 |
-
|
275 |
-
$query = $wpdb->get_row( $wpdb->prepare( "
|
276 |
-
SELECT *
|
277 |
-
FROM {$table}
|
278 |
-
WHERE {$column} LIKE %s
|
279 |
-
ORDER BY {$key_column} ASC
|
280 |
-
LIMIT 1
|
281 |
-
", $key ) );
|
282 |
-
|
283 |
-
$batch = new stdClass();
|
284 |
-
$batch->key = $query->$column;
|
285 |
-
$batch->data = maybe_unserialize( $query->$value_column );
|
286 |
-
|
287 |
-
return $batch;
|
288 |
-
}
|
289 |
-
|
290 |
-
/**
|
291 |
-
* Handle
|
292 |
-
*
|
293 |
-
* Pass each queue item to the task handler, while remaining
|
294 |
-
* within server memory and time limit constraints.
|
295 |
-
*/
|
296 |
-
protected function handle() {
|
297 |
-
$this->lock_process();
|
298 |
-
|
299 |
-
do {
|
300 |
-
$batch = $this->get_batch();
|
301 |
-
|
302 |
-
foreach ( $batch->data as $key => $value ) {
|
303 |
-
$task = $this->task( $value );
|
304 |
-
|
305 |
-
if ( false !== $task ) {
|
306 |
-
$batch->data[ $key ] = $task;
|
307 |
-
} else {
|
308 |
-
unset( $batch->data[ $key ] );
|
309 |
-
}
|
310 |
-
|
311 |
-
if ( $this->time_exceeded() || $this->memory_exceeded() ) {
|
312 |
-
// Batch limits reached.
|
313 |
-
break;
|
314 |
-
}
|
315 |
-
}
|
316 |
-
|
317 |
-
// Update or delete current batch.
|
318 |
-
if ( ! empty( $batch->data ) ) {
|
319 |
-
$this->update( $batch->key, $batch->data );
|
320 |
-
} else {
|
321 |
-
$this->delete( $batch->key );
|
322 |
-
}
|
323 |
-
} while ( ! $this->time_exceeded() && ! $this->memory_exceeded() && ! $this->is_queue_empty() );
|
324 |
-
|
325 |
-
$this->unlock_process();
|
326 |
-
|
327 |
-
// Start next batch or complete process.
|
328 |
-
if ( ! $this->is_queue_empty() ) {
|
329 |
-
$this->dispatch();
|
330 |
-
} else {
|
331 |
-
$this->complete();
|
332 |
-
}
|
333 |
-
|
334 |
-
wp_die();
|
335 |
-
}
|
336 |
-
|
337 |
-
/**
|
338 |
-
* Memory exceeded
|
339 |
-
*
|
340 |
-
* Ensures the batch process never exceeds 90%
|
341 |
-
* of the maximum WordPress memory.
|
342 |
-
*
|
343 |
-
* @return bool
|
344 |
-
*/
|
345 |
-
protected function memory_exceeded() {
|
346 |
-
$memory_limit = $this->get_memory_limit() * 0.9; // 90% of max memory
|
347 |
-
$current_memory = memory_get_usage( true );
|
348 |
-
$return = false;
|
349 |
-
|
350 |
-
if ( $current_memory >= $memory_limit ) {
|
351 |
-
$return = true;
|
352 |
-
}
|
353 |
-
|
354 |
-
return apply_filters( $this->identifier . '_memory_exceeded', $return );
|
355 |
-
}
|
356 |
-
|
357 |
-
/**
|
358 |
-
* Get memory limit
|
359 |
-
*
|
360 |
-
* @return int
|
361 |
-
*/
|
362 |
-
protected function get_memory_limit() {
|
363 |
-
if ( function_exists( 'ini_get' ) ) {
|
364 |
-
$memory_limit = ini_get( 'memory_limit' );
|
365 |
-
} else {
|
366 |
-
// Sensible default.
|
367 |
-
$memory_limit = '128M';
|
368 |
-
}
|
369 |
-
|
370 |
-
if ( ! $memory_limit || -1 === intval( $memory_limit ) ) {
|
371 |
-
// Unlimited, set to 32GB.
|
372 |
-
$memory_limit = '32000M';
|
373 |
-
}
|
374 |
-
|
375 |
-
return intval( $memory_limit ) * 1024 * 1024;
|
376 |
-
}
|
377 |
-
|
378 |
-
/**
|
379 |
-
* Time exceeded.
|
380 |
-
*
|
381 |
-
* Ensures the batch never exceeds a sensible time limit.
|
382 |
-
* A timeout limit of 30s is common on shared hosting.
|
383 |
-
*
|
384 |
-
* @return bool
|
385 |
-
*/
|
386 |
-
protected function time_exceeded() {
|
387 |
-
$finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', 20 ); // 20 seconds
|
388 |
-
$return = false;
|
389 |
-
|
390 |
-
if ( time() >= $finish ) {
|
391 |
-
$return = true;
|
392 |
-
}
|
393 |
-
|
394 |
-
return apply_filters( $this->identifier . '_time_exceeded', $return );
|
395 |
-
}
|
396 |
-
|
397 |
-
/**
|
398 |
-
* Complete.
|
399 |
-
*
|
400 |
-
* Override if applicable, but ensure that the below actions are
|
401 |
-
* performed, or, call parent::complete().
|
402 |
-
*/
|
403 |
-
protected function complete() {
|
404 |
-
// Unschedule the cron healthcheck.
|
405 |
-
$this->clear_scheduled_event();
|
406 |
-
}
|
407 |
-
|
408 |
-
/**
|
409 |
-
* Schedule cron healthcheck
|
410 |
-
*
|
411 |
-
* @access public
|
412 |
-
* @param mixed $schedules Schedules.
|
413 |
-
* @return mixed
|
414 |
-
*/
|
415 |
-
public function schedule_cron_healthcheck( $schedules ) {
|
416 |
-
$interval = apply_filters( $this->identifier . '_cron_interval', 5 );
|
417 |
-
|
418 |
-
if ( property_exists( $this, 'cron_interval' ) ) {
|
419 |
-
$interval = apply_filters( $this->identifier . '_cron_interval', $this->cron_interval );
|
420 |
-
}
|
421 |
-
|
422 |
-
// Adds every 5 minutes to the existing schedules.
|
423 |
-
$schedules[ $this->identifier . '_cron_interval' ] = array(
|
424 |
-
'interval' => MINUTE_IN_SECONDS * $interval,
|
425 |
-
'display' => sprintf( __( 'Every %d Minutes' ), $interval ),
|
426 |
-
);
|
427 |
-
|
428 |
-
return $schedules;
|
429 |
-
}
|
430 |
-
|
431 |
-
/**
|
432 |
-
* Handle cron healthcheck
|
433 |
-
*
|
434 |
-
* Restart the background process if not already running
|
435 |
-
* and data exists in the queue.
|
436 |
-
*/
|
437 |
-
public function handle_cron_healthcheck() {
|
438 |
-
if ( $this->is_process_running() ) {
|
439 |
-
// Background process already running.
|
440 |
-
exit;
|
441 |
-
}
|
442 |
-
|
443 |
-
if ( $this->is_queue_empty() ) {
|
444 |
-
// No data to process.
|
445 |
-
$this->clear_scheduled_event();
|
446 |
-
exit;
|
447 |
-
}
|
448 |
-
|
449 |
-
$this->handle();
|
450 |
-
|
451 |
-
exit;
|
452 |
-
}
|
453 |
-
|
454 |
-
/**
|
455 |
-
* Schedule event
|
456 |
-
*/
|
457 |
-
protected function schedule_event() {
|
458 |
-
if ( ! wp_next_scheduled( $this->cron_hook_identifier ) ) {
|
459 |
-
wp_schedule_event( time(), $this->cron_interval_identifier, $this->cron_hook_identifier );
|
460 |
-
}
|
461 |
-
}
|
462 |
-
|
463 |
-
/**
|
464 |
-
* Clear scheduled event
|
465 |
-
*/
|
466 |
-
protected function clear_scheduled_event() {
|
467 |
-
$timestamp = wp_next_scheduled( $this->cron_hook_identifier );
|
468 |
-
|
469 |
-
if ( $timestamp ) {
|
470 |
-
wp_unschedule_event( $timestamp, $this->cron_hook_identifier );
|
471 |
-
}
|
472 |
-
}
|
473 |
-
|
474 |
-
/**
|
475 |
-
* Cancel Process
|
476 |
-
*
|
477 |
-
* Stop processing queue items, clear cronjob and delete batch.
|
478 |
-
*
|
479 |
-
*/
|
480 |
-
public function cancel_process() {
|
481 |
-
if ( ! $this->is_queue_empty() ) {
|
482 |
-
$batch = $this->get_batch();
|
483 |
-
|
484 |
-
$this->delete( $batch->key );
|
485 |
-
|
486 |
-
wp_clear_scheduled_hook( $this->cron_hook_identifier );
|
487 |
-
}
|
488 |
-
|
489 |
-
}
|
490 |
-
|
491 |
-
/**
|
492 |
-
* Task
|
493 |
-
*
|
494 |
-
* Override this method to perform any actions required on each
|
495 |
-
* queue item. Return the modified item for further processing
|
496 |
-
* in the next pass through. Or, return false to remove the
|
497 |
-
* item from the queue.
|
498 |
-
*
|
499 |
-
* @param mixed $item Queue item to iterate over.
|
500 |
-
*
|
501 |
-
* @return mixed
|
502 |
-
*/
|
503 |
-
abstract protected function task( $item );
|
504 |
-
|
505 |
-
}
|
506 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/a5hleyrich/wp-background-processing/composer.json
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "a5hleyrich/wp-background-processing",
|
3 |
-
"description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.",
|
4 |
-
"type": "library",
|
5 |
-
"require": {
|
6 |
-
"php": ">=5.2"
|
7 |
-
},
|
8 |
-
"license": "GPL-2.0-only",
|
9 |
-
"authors": [
|
10 |
-
{
|
11 |
-
"name": "Ashley Rich",
|
12 |
-
"email": "hello@ashleyrich.com"
|
13 |
-
}
|
14 |
-
],
|
15 |
-
"autoload": {
|
16 |
-
"classmap": [ "classes/" ]
|
17 |
-
}
|
18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/a5hleyrich/wp-background-processing/license.txt
DELETED
@@ -1,280 +0,0 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
5 |
-
51 Franklin St, Fifth Floor, Boston, MA 02110, USA
|
6 |
-
|
7 |
-
Everyone is permitted to copy and distribute verbatim copies
|
8 |
-
of this license document, but changing it is not allowed.
|
9 |
-
|
10 |
-
Preamble
|
11 |
-
|
12 |
-
The licenses for most software are designed to take away your
|
13 |
-
freedom to share and change it. By contrast, the GNU General Public
|
14 |
-
License is intended to guarantee your freedom to share and change free
|
15 |
-
software--to make sure the software is free for all its users. This
|
16 |
-
General Public License applies to most of the Free Software
|
17 |
-
Foundation's software and to any other program whose authors commit to
|
18 |
-
using it. (Some other Free Software Foundation software is covered by
|
19 |
-
the GNU Library General Public License instead.) You can apply it to
|
20 |
-
your programs, too.
|
21 |
-
|
22 |
-
When we speak of free software, we are referring to freedom, not
|
23 |
-
price. Our General Public Licenses are designed to make sure that you
|
24 |
-
have the freedom to distribute copies of free software (and charge for
|
25 |
-
this service if you wish), that you receive source code or can get it
|
26 |
-
if you want it, that you can change the software or use pieces of it
|
27 |
-
in new free programs; and that you know you can do these things.
|
28 |
-
|
29 |
-
To protect your rights, we need to make restrictions that forbid
|
30 |
-
anyone to deny you these rights or to ask you to surrender the rights.
|
31 |
-
These restrictions translate to certain responsibilities for you if you
|
32 |
-
distribute copies of the software, or if you modify it.
|
33 |
-
|
34 |
-
For example, if you distribute copies of such a program, whether
|
35 |
-
gratis or for a fee, you must give the recipients all the rights that
|
36 |
-
you have. You must make sure that they, too, receive or can get the
|
37 |
-
source code. And you must show them these terms so they know their
|
38 |
-
rights.
|
39 |
-
|
40 |
-
We protect your rights with two steps: (1) copyright the software, and
|
41 |
-
(2) offer you this license which gives you legal permission to copy,
|
42 |
-
distribute and/or modify the software.
|
43 |
-
|
44 |
-
Also, for each author's protection and ours, we want to make certain
|
45 |
-
that everyone understands that there is no warranty for this free
|
46 |
-
software. If the software is modified by someone else and passed on, we
|
47 |
-
want its recipients to know that what they have is not the original, so
|
48 |
-
that any problems introduced by others will not reflect on the original
|
49 |
-
authors' reputations.
|
50 |
-
|
51 |
-
Finally, any free program is threatened constantly by software
|
52 |
-
patents. We wish to avoid the danger that redistributors of a free
|
53 |
-
program will individually obtain patent licenses, in effect making the
|
54 |
-
program proprietary. To prevent this, we have made it clear that any
|
55 |
-
patent must be licensed for everyone's free use or not licensed at all.
|
56 |
-
|
57 |
-
The precise terms and conditions for copying, distribution and
|
58 |
-
modification follow.
|
59 |
-
|
60 |
-
GNU GENERAL PUBLIC LICENSE
|
61 |
-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
62 |
-
|
63 |
-
0. This License applies to any program or other work which contains
|
64 |
-
a notice placed by the copyright holder saying it may be distributed
|
65 |
-
under the terms of this General Public License. The "Program", below,
|
66 |
-
refers to any such program or work, and a "work based on the Program"
|
67 |
-
means either the Program or any derivative work under copyright law:
|
68 |
-
that is to say, a work containing the Program or a portion of it,
|
69 |
-
either verbatim or with modifications and/or translated into another
|
70 |
-
language. (Hereinafter, translation is included without limitation in
|
71 |
-
the term "modification".) Each licensee is addressed as "you".
|
72 |
-
|
73 |
-
Activities other than copying, distribution and modification are not
|
74 |
-
covered by this License; they are outside its scope. The act of
|
75 |
-
running the Program is not restricted, and the output from the Program
|
76 |
-
is covered only if its contents constitute a work based on the
|
77 |
-
Program (independent of having been made by running the Program).
|
78 |
-
Whether that is true depends on what the Program does.
|
79 |
-
|
80 |
-
1. You may copy and distribute verbatim copies of the Program's
|
81 |
-
source code as you receive it, in any medium, provided that you
|
82 |
-
conspicuously and appropriately publish on each copy an appropriate
|
83 |
-
copyright notice and disclaimer of warranty; keep intact all the
|
84 |
-
notices that refer to this License and to the absence of any warranty;
|
85 |
-
and give any other recipients of the Program a copy of this License
|
86 |
-
along with the Program.
|
87 |
-
|
88 |
-
You may charge a fee for the physical act of transferring a copy, and
|
89 |
-
you may at your option offer warranty protection in exchange for a fee.
|
90 |
-
|
91 |
-
2. You may modify your copy or copies of the Program or any portion
|
92 |
-
of it, thus forming a work based on the Program, and copy and
|
93 |
-
distribute such modifications or work under the terms of Section 1
|
94 |
-
above, provided that you also meet all of these conditions:
|
95 |
-
|
96 |
-
a) You must cause the modified files to carry prominent notices
|
97 |
-
stating that you changed the files and the date of any change.
|
98 |
-
|
99 |
-
b) You must cause any work that you distribute or publish, that in
|
100 |
-
whole or in part contains or is derived from the Program or any
|
101 |
-
part thereof, to be licensed as a whole at no charge to all third
|
102 |
-
parties under the terms of this License.
|
103 |
-
|
104 |
-
c) If the modified program normally reads commands interactively
|
105 |
-
when run, you must cause it, when started running for such
|
106 |
-
interactive use in the most ordinary way, to print or display an
|
107 |
-
announcement including an appropriate copyright notice and a
|
108 |
-
notice that there is no warranty (or else, saying that you provide
|
109 |
-
a warranty) and that users may redistribute the program under
|
110 |
-
these conditions, and telling the user how to view a copy of this
|
111 |
-
License. (Exception: if the Program itself is interactive but
|
112 |
-
does not normally print such an announcement, your work based on
|
113 |
-
the Program is not required to print an announcement.)
|
114 |
-
|
115 |
-
These requirements apply to the modified work as a whole. If
|
116 |
-
identifiable sections of that work are not derived from the Program,
|
117 |
-
and can be reasonably considered independent and separate works in
|
118 |
-
themselves, then this License, and its terms, do not apply to those
|
119 |
-
sections when you distribute them as separate works. But when you
|
120 |
-
distribute the same sections as part of a whole which is a work based
|
121 |
-
on the Program, the distribution of the whole must be on the terms of
|
122 |
-
this License, whose permissions for other licensees extend to the
|
123 |
-
entire whole, and thus to each and every part regardless of who wrote it.
|
124 |
-
Thus, it is not the intent of this section to claim rights or contest
|
125 |
-
your rights to work written entirely by you; rather, the intent is to
|
126 |
-
exercise the right to control the distribution of derivative or
|
127 |
-
collective works based on the Program.
|
128 |
-
|
129 |
-
In addition, mere aggregation of another work not based on the Program
|
130 |
-
with the Program (or with a work based on the Program) on a volume of
|
131 |
-
a storage or distribution medium does not bring the other work under
|
132 |
-
the scope of this License.
|
133 |
-
|
134 |
-
3. You may copy and distribute the Program (or a work based on it,
|
135 |
-
under Section 2) in object code or executable form under the terms of
|
136 |
-
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
-
|
138 |
-
a) Accompany it with the complete corresponding machine-readable
|
139 |
-
source code, which must be distributed under the terms of Sections
|
140 |
-
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
-
|
142 |
-
b) Accompany it with a written offer, valid for at least three
|
143 |
-
years, to give any third party, for a charge no more than your
|
144 |
-
cost of physically performing source distribution, a complete
|
145 |
-
machine-readable copy of the corresponding source code, to be
|
146 |
-
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
-
customarily used for software interchange; or,
|
148 |
-
|
149 |
-
c) Accompany it with the information you received as to the offer
|
150 |
-
to distribute corresponding source code. (This alternative is
|
151 |
-
allowed only for noncommercial distribution and only if you
|
152 |
-
received the program in object code or executable form with such
|
153 |
-
an offer, in accord with Subsection b above.)
|
154 |
-
|
155 |
-
The source code for a work means the preferred form of the work for
|
156 |
-
making modifications to it. For an executable work, complete source
|
157 |
-
code means all the source code for all modules it contains, plus any
|
158 |
-
associated interface definition files, plus the scripts used to
|
159 |
-
control compilation and installation of the executable. However, as a
|
160 |
-
special exception, the source code distributed need not include
|
161 |
-
anything that is normally distributed (in either source or binary
|
162 |
-
form) with the major components (compiler, kernel, and so on) of the
|
163 |
-
operating system on which the executable runs, unless that component
|
164 |
-
itself accompanies the executable.
|
165 |
-
|
166 |
-
If distribution of executable or object code is made by offering
|
167 |
-
access to copy from a designated place, then offering equivalent
|
168 |
-
access to copy the source code from the same place counts as
|
169 |
-
distribution of the source code, even though third parties are not
|
170 |
-
compelled to copy the source along with the object code.
|
171 |
-
|
172 |
-
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
-
except as expressly provided under this License. Any attempt
|
174 |
-
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
-
void, and will automatically terminate your rights under this License.
|
176 |
-
However, parties who have received copies, or rights, from you under
|
177 |
-
this License will not have their licenses terminated so long as such
|
178 |
-
parties remain in full compliance.
|
179 |
-
|
180 |
-
5. You are not required to accept this License, since you have not
|
181 |
-
signed it. However, nothing else grants you permission to modify or
|
182 |
-
distribute the Program or its derivative works. These actions are
|
183 |
-
prohibited by law if you do not accept this License. Therefore, by
|
184 |
-
modifying or distributing the Program (or any work based on the
|
185 |
-
Program), you indicate your acceptance of this License to do so, and
|
186 |
-
all its terms and conditions for copying, distributing or modifying
|
187 |
-
the Program or works based on it.
|
188 |
-
|
189 |
-
6. Each time you redistribute the Program (or any work based on the
|
190 |
-
Program), the recipient automatically receives a license from the
|
191 |
-
original licensor to copy, distribute or modify the Program subject to
|
192 |
-
these terms and conditions. You may not impose any further
|
193 |
-
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
-
You are not responsible for enforcing compliance by third parties to
|
195 |
-
this License.
|
196 |
-
|
197 |
-
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
-
infringement or for any other reason (not limited to patent issues),
|
199 |
-
conditions are imposed on you (whether by court order, agreement or
|
200 |
-
otherwise) that contradict the conditions of this License, they do not
|
201 |
-
excuse you from the conditions of this License. If you cannot
|
202 |
-
distribute so as to satisfy simultaneously your obligations under this
|
203 |
-
License and any other pertinent obligations, then as a consequence you
|
204 |
-
may not distribute the Program at all. For example, if a patent
|
205 |
-
license would not permit royalty-free redistribution of the Program by
|
206 |
-
all those who receive copies directly or indirectly through you, then
|
207 |
-
the only way you could satisfy both it and this License would be to
|
208 |
-
refrain entirely from distribution of the Program.
|
209 |
-
|
210 |
-
If any portion of this section is held invalid or unenforceable under
|
211 |
-
any particular circumstance, the balance of the section is intended to
|
212 |
-
apply and the section as a whole is intended to apply in other
|
213 |
-
circumstances.
|
214 |
-
|
215 |
-
It is not the purpose of this section to induce you to infringe any
|
216 |
-
patents or other property right claims or to contest validity of any
|
217 |
-
such claims; this section has the sole purpose of protecting the
|
218 |
-
integrity of the free software distribution system, which is
|
219 |
-
implemented by public license practices. Many people have made
|
220 |
-
generous contributions to the wide range of software distributed
|
221 |
-
through that system in reliance on consistent application of that
|
222 |
-
system; it is up to the author/donor to decide if he or she is willing
|
223 |
-
to distribute software through any other system and a licensee cannot
|
224 |
-
impose that choice.
|
225 |
-
|
226 |
-
This section is intended to make thoroughly clear what is believed to
|
227 |
-
be a consequence of the rest of this License.
|
228 |
-
|
229 |
-
8. If the distribution and/or use of the Program is restricted in
|
230 |
-
certain countries either by patents or by copyrighted interfaces, the
|
231 |
-
original copyright holder who places the Program under this License
|
232 |
-
may add an explicit geographical distribution limitation excluding
|
233 |
-
those countries, so that distribution is permitted only in or among
|
234 |
-
countries not thus excluded. In such case, this License incorporates
|
235 |
-
the limitation as if written in the body of this License.
|
236 |
-
|
237 |
-
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
-
of the General Public License from time to time. Such new versions will
|
239 |
-
be similar in spirit to the present version, but may differ in detail to
|
240 |
-
address new problems or concerns.
|
241 |
-
|
242 |
-
Each version is given a distinguishing version number. If the Program
|
243 |
-
specifies a version number of this License which applies to it and "any
|
244 |
-
later version", you have the option of following the terms and conditions
|
245 |
-
either of that version or of any later version published by the Free
|
246 |
-
Software Foundation. If the Program does not specify a version number of
|
247 |
-
this License, you may choose any version ever published by the Free Software
|
248 |
-
Foundation.
|
249 |
-
|
250 |
-
10. If you wish to incorporate parts of the Program into other free
|
251 |
-
programs whose distribution conditions are different, write to the author
|
252 |
-
to ask for permission. For software which is copyrighted by the Free
|
253 |
-
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
-
make exceptions for this. Our decision will be guided by the two goals
|
255 |
-
of preserving the free status of all derivatives of our free software and
|
256 |
-
of promoting the sharing and reuse of software generally.
|
257 |
-
|
258 |
-
NO WARRANTY
|
259 |
-
|
260 |
-
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
-
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
-
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
-
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
-
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
-
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
-
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
-
REPAIR OR CORRECTION.
|
269 |
-
|
270 |
-
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
-
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
-
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
-
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
-
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
-
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
-
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
-
POSSIBILITY OF SUCH DAMAGES.
|
279 |
-
|
280 |
-
END OF TERMS AND CONDITIONS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/a5hleyrich/wp-background-processing/wp-background-processing.php
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WP-Background Processing
|
4 |
-
*
|
5 |
-
* @package WP-Background-Processing
|
6 |
-
*/
|
7 |
-
|
8 |
-
/*
|
9 |
-
Plugin Name: WP Background Processing
|
10 |
-
Plugin URI: https://github.com/A5hleyRich/wp-background-processing
|
11 |
-
Description: Asynchronous requests and background processing in WordPress.
|
12 |
-
Author: Delicious Brains Inc.
|
13 |
-
Version: 1.0
|
14 |
-
Author URI: https://deliciousbrains.com/
|
15 |
-
GitHub Plugin URI: https://github.com/A5hleyRich/wp-background-processing
|
16 |
-
GitHub Branch: master
|
17 |
-
*/
|
18 |
-
|
19 |
-
require_once plugin_dir_path( __FILE__ ) . 'classes/wp-async-request.php';
|
20 |
-
require_once plugin_dir_path( __FILE__ ) . 'classes/wp-background-process.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit26ef86a51fcdbebd9f35ad5112d1cdfe::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -24,6 +24,7 @@ return array(
|
|
24 |
'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
25 |
'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
26 |
'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
|
|
27 |
'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
28 |
'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
29 |
'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
@@ -41,6 +42,7 @@ return array(
|
|
41 |
'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
42 |
'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
43 |
'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
|
|
44 |
'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
45 |
'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
46 |
'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
@@ -52,6 +54,7 @@ return array(
|
|
52 |
'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
|
53 |
'Composer\\Installers\\MajimaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
|
54 |
'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
|
|
|
55 |
'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
|
56 |
'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
|
57 |
'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
|
@@ -75,6 +78,7 @@ return array(
|
|
75 |
'Composer\\Installers\\PxcmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
76 |
'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
77 |
'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
|
|
78 |
'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
79 |
'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
80 |
'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
@@ -82,9 +86,11 @@ return array(
|
|
82 |
'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
|
83 |
'Composer\\Installers\\SiteDirectInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
|
84 |
'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
|
|
|
85 |
'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
86 |
'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
87 |
'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
|
|
88 |
'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
89 |
'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
90 |
'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
@@ -208,6 +214,6 @@ return array(
|
|
208 |
'Imagify_Settings' => $baseDir . '/inc/classes/class-imagify-settings.php',
|
209 |
'Imagify_User' => $baseDir . '/inc/classes/class-imagify-user.php',
|
210 |
'Imagify_Views' => $baseDir . '/inc/classes/class-imagify-views.php',
|
211 |
-
'
|
212 |
-
'
|
213 |
);
|
24 |
'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
25 |
'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
26 |
'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
27 |
+
'Composer\\Installers\\DframeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
|
28 |
'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
29 |
'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
30 |
'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
42 |
'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
43 |
'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
44 |
'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
45 |
+
'Composer\\Installers\\KnownInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
|
46 |
'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
47 |
'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
48 |
'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
54 |
'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
|
55 |
'Composer\\Installers\\MajimaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
|
56 |
'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
|
57 |
+
'Composer\\Installers\\MantisBTInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MantisBTInstaller.php',
|
58 |
'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
|
59 |
'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
|
60 |
'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
|
78 |
'Composer\\Installers\\PxcmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
79 |
'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
80 |
'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
81 |
+
'Composer\\Installers\\Redaxo5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
|
82 |
'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
83 |
'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
84 |
'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
86 |
'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
|
87 |
'Composer\\Installers\\SiteDirectInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
|
88 |
'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
|
89 |
+
'Composer\\Installers\\SyliusInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyliusInstaller.php',
|
90 |
'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
91 |
'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
92 |
'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
93 |
+
'Composer\\Installers\\TaoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
|
94 |
'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
95 |
'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
96 |
'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
214 |
'Imagify_Settings' => $baseDir . '/inc/classes/class-imagify-settings.php',
|
215 |
'Imagify_User' => $baseDir . '/inc/classes/class-imagify-user.php',
|
216 |
'Imagify_Views' => $baseDir . '/inc/classes/class-imagify-views.php',
|
217 |
+
'Imagify_WP_Async_Request' => $baseDir . '/inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
|
218 |
+
'Imagify_WP_Background_Process' => $baseDir . '/inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
|
219 |
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -12,6 +12,7 @@ return array(
|
|
12 |
'Imagify\\ThirdParty\\FormidablePro\\' => array($baseDir . '/inc/3rd-party/formidable-pro/classes'),
|
13 |
'Imagify\\ThirdParty\\EnableMediaReplace\\' => array($baseDir . '/inc/3rd-party/enable-media-replace/classes'),
|
14 |
'Imagify\\ThirdParty\\AS3CF\\' => array($baseDir . '/inc/3rd-party/amazon-s3-and-cloudfront/classes'),
|
|
|
15 |
'Imagify\\Deprecated\\Traits\\' => array($baseDir . '/inc/deprecated/Traits'),
|
16 |
'Imagify\\' => array($baseDir . '/classes'),
|
17 |
'Dangoodman\\ComposerForWordpress\\' => array($vendorDir . '/dangoodman/composer-for-wordpress'),
|
12 |
'Imagify\\ThirdParty\\FormidablePro\\' => array($baseDir . '/inc/3rd-party/formidable-pro/classes'),
|
13 |
'Imagify\\ThirdParty\\EnableMediaReplace\\' => array($baseDir . '/inc/3rd-party/enable-media-replace/classes'),
|
14 |
'Imagify\\ThirdParty\\AS3CF\\' => array($baseDir . '/inc/3rd-party/amazon-s3-and-cloudfront/classes'),
|
15 |
+
'Imagify\\Tests\\' => array($baseDir . '/Tests'),
|
16 |
'Imagify\\Deprecated\\Traits\\' => array($baseDir . '/inc/deprecated/Traits'),
|
17 |
'Imagify\\' => array($baseDir . '/classes'),
|
18 |
'Dangoodman\\ComposerForWordpress\\' => array($vendorDir . '/dangoodman/composer-for-wordpress'),
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInita19538743745730476abc209df8266cb
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\AutoloadWPMediaImagifyWordPressPlugin\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$classMap = require __DIR__ . '/autoload_classmap.php';
|
36 |
if ($classMap) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit26ef86a51fcdbebd9f35ad5112d1cdfe
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit26ef86a51fcdbebd9f35ad5112d1cdfe', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\AutoloadWPMediaImagifyWordPressPlugin\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit26ef86a51fcdbebd9f35ad5112d1cdfe', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit26ef86a51fcdbebd9f35ad5112d1cdfe::getInitializer($loader));
|
34 |
} else {
|
35 |
$classMap = require __DIR__ . '/autoload_classmap.php';
|
36 |
if ($classMap) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -7,7 +7,7 @@ namespace Composer\Autoload;
|
|
7 |
use Composer\AutoloadWPMediaImagifyWordPressPlugin\ClassLoader as ClassLoaderWPMediaImagifyWordPressPlugin;
|
8 |
|
9 |
|
10 |
-
class
|
11 |
{
|
12 |
public static $prefixLengthsPsr4 = array (
|
13 |
'I' =>
|
@@ -18,6 +18,7 @@ class ComposerStaticInita19538743745730476abc209df8266cb
|
|
18 |
'Imagify\\ThirdParty\\FormidablePro\\' => 33,
|
19 |
'Imagify\\ThirdParty\\EnableMediaReplace\\' => 38,
|
20 |
'Imagify\\ThirdParty\\AS3CF\\' => 25,
|
|
|
21 |
'Imagify\\Deprecated\\Traits\\' => 26,
|
22 |
'Imagify\\' => 8,
|
23 |
),
|
@@ -56,6 +57,10 @@ class ComposerStaticInita19538743745730476abc209df8266cb
|
|
56 |
array (
|
57 |
0 => __DIR__ . '/../..' . '/inc/3rd-party/amazon-s3-and-cloudfront/classes',
|
58 |
),
|
|
|
|
|
|
|
|
|
59 |
'Imagify\\Deprecated\\Traits\\' =>
|
60 |
array (
|
61 |
0 => __DIR__ . '/../..' . '/inc/deprecated/Traits',
|
@@ -93,6 +98,7 @@ class ComposerStaticInita19538743745730476abc209df8266cb
|
|
93 |
'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
94 |
'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
95 |
'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
|
|
96 |
'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
97 |
'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
98 |
'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
@@ -110,6 +116,7 @@ class ComposerStaticInita19538743745730476abc209df8266cb
|
|
110 |
'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
111 |
'Composer\\Installers\\KanboardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
112 |
'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
|
|
113 |
'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
114 |
'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
115 |
'Composer\\Installers\\LanManagementSystemInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
@@ -121,6 +128,7 @@ class ComposerStaticInita19538743745730476abc209df8266cb
|
|
121 |
'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
|
122 |
'Composer\\Installers\\MajimaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
|
123 |
'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
|
|
|
124 |
'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
|
125 |
'Composer\\Installers\\MayaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
|
126 |
'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
|
@@ -144,6 +152,7 @@ class ComposerStaticInita19538743745730476abc209df8266cb
|
|
144 |
'Composer\\Installers\\PxcmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
145 |
'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
146 |
'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
|
|
147 |
'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
148 |
'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
149 |
'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
@@ -151,9 +160,11 @@ class ComposerStaticInita19538743745730476abc209df8266cb
|
|
151 |
'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
|
152 |
'Composer\\Installers\\SiteDirectInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
|
153 |
'Composer\\Installers\\SyDESInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
|
|
|
154 |
'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
155 |
'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
156 |
'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
|
|
157 |
'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
158 |
'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
159 |
'Composer\\Installers\\UserFrostingInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
@@ -277,16 +288,16 @@ class ComposerStaticInita19538743745730476abc209df8266cb
|
|
277 |
'Imagify_Settings' => __DIR__ . '/../..' . '/inc/classes/class-imagify-settings.php',
|
278 |
'Imagify_User' => __DIR__ . '/../..' . '/inc/classes/class-imagify-user.php',
|
279 |
'Imagify_Views' => __DIR__ . '/../..' . '/inc/classes/class-imagify-views.php',
|
280 |
-
'
|
281 |
-
'
|
282 |
);
|
283 |
|
284 |
public static function getInitializer(ClassLoaderWPMediaImagifyWordPressPlugin $loader)
|
285 |
{
|
286 |
return \Closure::bind(function () use ($loader) {
|
287 |
-
$loader->prefixLengthsPsr4 =
|
288 |
-
$loader->prefixDirsPsr4 =
|
289 |
-
$loader->classMap =
|
290 |
|
291 |
}, null, ClassLoaderWPMediaImagifyWordPressPlugin::class);
|
292 |
}
|
7 |
use Composer\AutoloadWPMediaImagifyWordPressPlugin\ClassLoader as ClassLoaderWPMediaImagifyWordPressPlugin;
|
8 |
|
9 |
|
10 |
+
class ComposerStaticInit26ef86a51fcdbebd9f35ad5112d1cdfe
|
11 |
{
|
12 |
public static $prefixLengthsPsr4 = array (
|
13 |
'I' =>
|
18 |
'Imagify\\ThirdParty\\FormidablePro\\' => 33,
|
19 |
'Imagify\\ThirdParty\\EnableMediaReplace\\' => 38,
|
20 |
'Imagify\\ThirdParty\\AS3CF\\' => 25,
|
21 |
+
'Imagify\\Tests\\' => 14,
|
22 |
'Imagify\\Deprecated\\Traits\\' => 26,
|
23 |
'Imagify\\' => 8,
|
24 |
),
|
57 |
array (
|
58 |
0 => __DIR__ . '/../..' . '/inc/3rd-party/amazon-s3-and-cloudfront/classes',
|
59 |
),
|
60 |
+
'Imagify\\Tests\\' =>
|
61 |
+
array (
|
62 |
+
0 => __DIR__ . '/../..' . '/Tests',
|
63 |
+
),
|
64 |
'Imagify\\Deprecated\\Traits\\' =>
|
65 |
array (
|
66 |
0 => __DIR__ . '/../..' . '/inc/deprecated/Traits',
|
98 |
'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
99 |
'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
100 |
'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
101 |
+
'Composer\\Installers\\DframeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
|
102 |
'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
103 |
'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
104 |
'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
116 |
'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
117 |
'Composer\\Installers\\KanboardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
118 |
'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
119 |
+
'Composer\\Installers\\KnownInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
|
120 |
'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
121 |
'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
122 |
'Composer\\Installers\\LanManagementSystemInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
128 |
'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
|
129 |
'Composer\\Installers\\MajimaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
|
130 |
'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
|
131 |
+
'Composer\\Installers\\MantisBTInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MantisBTInstaller.php',
|
132 |
'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
|
133 |
'Composer\\Installers\\MayaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
|
134 |
'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
|
152 |
'Composer\\Installers\\PxcmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
153 |
'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
154 |
'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
155 |
+
'Composer\\Installers\\Redaxo5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
|
156 |
'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
157 |
'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
158 |
'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
160 |
'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
|
161 |
'Composer\\Installers\\SiteDirectInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
|
162 |
'Composer\\Installers\\SyDESInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
|
163 |
+
'Composer\\Installers\\SyliusInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyliusInstaller.php',
|
164 |
'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
165 |
'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
166 |
'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
167 |
+
'Composer\\Installers\\TaoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
|
168 |
'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
169 |
'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
170 |
'Composer\\Installers\\UserFrostingInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
288 |
'Imagify_Settings' => __DIR__ . '/../..' . '/inc/classes/class-imagify-settings.php',
|
289 |
'Imagify_User' => __DIR__ . '/../..' . '/inc/classes/class-imagify-user.php',
|
290 |
'Imagify_Views' => __DIR__ . '/../..' . '/inc/classes/class-imagify-views.php',
|
291 |
+
'Imagify_WP_Async_Request' => __DIR__ . '/../..' . '/inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
|
292 |
+
'Imagify_WP_Background_Process' => __DIR__ . '/../..' . '/inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
|
293 |
);
|
294 |
|
295 |
public static function getInitializer(ClassLoaderWPMediaImagifyWordPressPlugin $loader)
|
296 |
{
|
297 |
return \Closure::bind(function () use ($loader) {
|
298 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit26ef86a51fcdbebd9f35ad5112d1cdfe::$prefixLengthsPsr4;
|
299 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit26ef86a51fcdbebd9f35ad5112d1cdfe::$prefixDirsPsr4;
|
300 |
+
$loader->classMap = ComposerStaticInit26ef86a51fcdbebd9f35ad5112d1cdfe::$classMap;
|
301 |
|
302 |
}, null, ClassLoaderWPMediaImagifyWordPressPlugin::class);
|
303 |
}
|
vendor/composer/installed.json
CHANGED
@@ -1,69 +1,34 @@
|
|
1 |
[
|
2 |
-
{
|
3 |
-
"name": "a5hleyrich/wp-background-processing",
|
4 |
-
"version": "1.0.1",
|
5 |
-
"version_normalized": "1.0.1.0",
|
6 |
-
"source": {
|
7 |
-
"type": "git",
|
8 |
-
"url": "https://github.com/A5hleyRich/wp-background-processing.git",
|
9 |
-
"reference": "1f070aab5058dbaf45d5435a343033ddd8a641b1"
|
10 |
-
},
|
11 |
-
"dist": {
|
12 |
-
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/A5hleyRich/wp-background-processing/zipball/1f070aab5058dbaf45d5435a343033ddd8a641b1",
|
14 |
-
"reference": "1f070aab5058dbaf45d5435a343033ddd8a641b1",
|
15 |
-
"shasum": ""
|
16 |
-
},
|
17 |
-
"require": {
|
18 |
-
"php": ">=5.2"
|
19 |
-
},
|
20 |
-
"time": "2018-02-12T09:24:05+00:00",
|
21 |
-
"type": "library",
|
22 |
-
"installation-source": "dist",
|
23 |
-
"autoload": {
|
24 |
-
"classmap": [
|
25 |
-
"classes/"
|
26 |
-
]
|
27 |
-
},
|
28 |
-
"notification-url": "https://packagist.org/downloads/",
|
29 |
-
"license": [
|
30 |
-
"GPL-2.0-only"
|
31 |
-
],
|
32 |
-
"authors": [
|
33 |
-
{
|
34 |
-
"name": "Ashley Rich",
|
35 |
-
"email": "hello@ashleyrich.com"
|
36 |
-
}
|
37 |
-
],
|
38 |
-
"description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks."
|
39 |
-
},
|
40 |
{
|
41 |
"name": "composer/installers",
|
42 |
-
"version": "v1.
|
43 |
-
"version_normalized": "1.
|
44 |
"source": {
|
45 |
"type": "git",
|
46 |
"url": "https://github.com/composer/installers.git",
|
47 |
-
"reference": "
|
48 |
},
|
49 |
"dist": {
|
50 |
"type": "zip",
|
51 |
-
"url": "https://api.github.com/repos/composer/installers/zipball/
|
52 |
-
"reference": "
|
53 |
"shasum": ""
|
54 |
},
|
55 |
"require": {
|
56 |
-
"composer-plugin-api": "^1.0"
|
57 |
},
|
58 |
"replace": {
|
59 |
"roundcube/plugin-installer": "*",
|
60 |
"shama/baton": "*"
|
61 |
},
|
62 |
"require-dev": {
|
63 |
-
"composer/composer": "1.0.*@dev",
|
64 |
-
"
|
|
|
|
|
|
|
65 |
},
|
66 |
-
"time": "
|
67 |
"type": "composer-plugin",
|
68 |
"extra": {
|
69 |
"class": "Composer\\Installers\\Plugin",
|
@@ -99,6 +64,7 @@
|
|
99 |
"Kanboard",
|
100 |
"Lan Management System",
|
101 |
"MODX Evo",
|
|
|
102 |
"Mautic",
|
103 |
"Maya",
|
104 |
"OXID",
|
@@ -107,6 +73,7 @@
|
|
107 |
"RadPHP",
|
108 |
"SMF",
|
109 |
"Thelia",
|
|
|
110 |
"WolfCMS",
|
111 |
"agl",
|
112 |
"aimeos",
|
@@ -129,6 +96,7 @@
|
|
129 |
"installer",
|
130 |
"itop",
|
131 |
"joomla",
|
|
|
132 |
"kohana",
|
133 |
"laravel",
|
134 |
"lavalite",
|
@@ -151,12 +119,23 @@
|
|
151 |
"shopware",
|
152 |
"silverstripe",
|
153 |
"sydes",
|
|
|
154 |
"symfony",
|
155 |
"typo3",
|
156 |
"wordpress",
|
157 |
"yawik",
|
158 |
"zend",
|
159 |
"zikula"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
]
|
161 |
},
|
162 |
{
|
1 |
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
{
|
3 |
"name": "composer/installers",
|
4 |
+
"version": "v1.9.0",
|
5 |
+
"version_normalized": "1.9.0.0",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/composer/installers.git",
|
9 |
+
"reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca",
|
14 |
+
"reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
18 |
+
"composer-plugin-api": "^1.0 || ^2.0"
|
19 |
},
|
20 |
"replace": {
|
21 |
"roundcube/plugin-installer": "*",
|
22 |
"shama/baton": "*"
|
23 |
},
|
24 |
"require-dev": {
|
25 |
+
"composer/composer": "1.6.* || 2.0.*@dev",
|
26 |
+
"composer/semver": "1.0.* || 2.0.*@dev",
|
27 |
+
"phpunit/phpunit": "^4.8.36",
|
28 |
+
"sebastian/comparator": "^1.2.4",
|
29 |
+
"symfony/process": "^2.3"
|
30 |
},
|
31 |
+
"time": "2020-04-07T06:57:05+00:00",
|
32 |
"type": "composer-plugin",
|
33 |
"extra": {
|
34 |
"class": "Composer\\Installers\\Plugin",
|
64 |
"Kanboard",
|
65 |
"Lan Management System",
|
66 |
"MODX Evo",
|
67 |
+
"MantisBT",
|
68 |
"Mautic",
|
69 |
"Maya",
|
70 |
"OXID",
|
73 |
"RadPHP",
|
74 |
"SMF",
|
75 |
"Thelia",
|
76 |
+
"Whmcs",
|
77 |
"WolfCMS",
|
78 |
"agl",
|
79 |
"aimeos",
|
96 |
"installer",
|
97 |
"itop",
|
98 |
"joomla",
|
99 |
+
"known",
|
100 |
"kohana",
|
101 |
"laravel",
|
102 |
"lavalite",
|
119 |
"shopware",
|
120 |
"silverstripe",
|
121 |
"sydes",
|
122 |
+
"sylius",
|
123 |
"symfony",
|
124 |
"typo3",
|
125 |
"wordpress",
|
126 |
"yawik",
|
127 |
"zend",
|
128 |
"zikula"
|
129 |
+
],
|
130 |
+
"funding": [
|
131 |
+
{
|
132 |
+
"url": "https://packagist.com",
|
133 |
+
"type": "custom"
|
134 |
+
},
|
135 |
+
{
|
136 |
+
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
|
137 |
+
"type": "tidelift"
|
138 |
+
}
|
139 |
]
|
140 |
},
|
141 |
{
|
vendor/composer/installers/composer.json
CHANGED
@@ -31,6 +31,7 @@
|
|
31 |
"iTop",
|
32 |
"Joomla",
|
33 |
"Kanboard",
|
|
|
34 |
"Kohana",
|
35 |
"Lan Management System",
|
36 |
"Laravel",
|
@@ -39,6 +40,7 @@
|
|
39 |
"Magento",
|
40 |
"majima",
|
41 |
"Mako",
|
|
|
42 |
"Mautic",
|
43 |
"Maya",
|
44 |
"MODX",
|
@@ -62,9 +64,11 @@
|
|
62 |
"SilverStripe",
|
63 |
"SMF",
|
64 |
"SyDES",
|
|
|
65 |
"symfony",
|
66 |
"Thelia",
|
67 |
"TYPO3",
|
|
|
68 |
"WolfCMS",
|
69 |
"WordPress",
|
70 |
"YAWIK",
|
@@ -93,11 +97,14 @@
|
|
93 |
"roundcube/plugin-installer": "*"
|
94 |
},
|
95 |
"require": {
|
96 |
-
"composer-plugin-api": "^1.0"
|
97 |
},
|
98 |
"require-dev": {
|
99 |
-
"composer/composer": "1.0.*@dev",
|
100 |
-
"
|
|
|
|
|
|
|
101 |
},
|
102 |
"scripts": {
|
103 |
"test": "phpunit"
|
31 |
"iTop",
|
32 |
"Joomla",
|
33 |
"Kanboard",
|
34 |
+
"Known",
|
35 |
"Kohana",
|
36 |
"Lan Management System",
|
37 |
"Laravel",
|
40 |
"Magento",
|
41 |
"majima",
|
42 |
"Mako",
|
43 |
+
"MantisBT",
|
44 |
"Mautic",
|
45 |
"Maya",
|
46 |
"MODX",
|
64 |
"SilverStripe",
|
65 |
"SMF",
|
66 |
"SyDES",
|
67 |
+
"Sylius",
|
68 |
"symfony",
|
69 |
"Thelia",
|
70 |
"TYPO3",
|
71 |
+
"WHMCS",
|
72 |
"WolfCMS",
|
73 |
"WordPress",
|
74 |
"YAWIK",
|
97 |
"roundcube/plugin-installer": "*"
|
98 |
},
|
99 |
"require": {
|
100 |
+
"composer-plugin-api": "^1.0 || ^2.0"
|
101 |
},
|
102 |
"require-dev": {
|
103 |
+
"composer/composer": "1.6.* || 2.0.*@dev",
|
104 |
+
"composer/semver": "1.0.* || 2.0.*@dev",
|
105 |
+
"phpunit/phpunit": "^4.8.36",
|
106 |
+
"sebastian/comparator": "^1.2.4",
|
107 |
+
"symfony/process": "^2.3"
|
108 |
},
|
109 |
"scripts": {
|
110 |
"test": "phpunit"
|
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php
CHANGED
@@ -126,6 +126,7 @@ abstract class BaseInstaller
|
|
126 |
protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
|
127 |
{
|
128 |
foreach ($paths as $path => $names) {
|
|
|
129 |
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
|
130 |
return $path;
|
131 |
}
|
126 |
protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
|
127 |
{
|
128 |
foreach ($paths as $path => $names) {
|
129 |
+
$names = (array) $names;
|
130 |
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
|
131 |
return $path;
|
132 |
}
|
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php
CHANGED
@@ -58,25 +58,15 @@ class CakePHPInstaller extends BaseInstaller
|
|
58 |
}
|
59 |
|
60 |
$repositoryManager = $this->composer->getRepositoryManager();
|
61 |
-
if ($repositoryManager) {
|
62 |
-
|
63 |
-
if (!$repos) {
|
64 |
-
return false;
|
65 |
-
}
|
66 |
-
$cake3 = new $multiClass(array(
|
67 |
-
new $constraintClass($matcher, $version),
|
68 |
-
new $constraintClass('!=', '9999999-dev'),
|
69 |
-
));
|
70 |
-
$pool = new Pool('dev');
|
71 |
-
$pool->addRepository($repos);
|
72 |
-
$packages = $pool->whatProvides('cakephp/cakephp');
|
73 |
-
foreach ($packages as $package) {
|
74 |
-
$installed = new $constraintClass('=', $package->getVersion());
|
75 |
-
if ($cake3->matches($installed)) {
|
76 |
-
return true;
|
77 |
-
}
|
78 |
-
}
|
79 |
}
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
}
|
58 |
}
|
59 |
|
60 |
$repositoryManager = $this->composer->getRepositoryManager();
|
61 |
+
if (! $repositoryManager) {
|
62 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
+
|
65 |
+
$repos = $repositoryManager->getLocalRepository();
|
66 |
+
if (!$repos) {
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
|
70 |
+
return $repos->findPackage('cakephp/cakephp', new $constraintClass($matcher, $version)) !== null;
|
71 |
}
|
72 |
}
|
vendor/composer/installers/src/Composer/Installers/DframeInstaller.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Composer\Installers;
|
4 |
+
|
5 |
+
class DframeInstaller extends BaseInstaller
|
6 |
+
{
|
7 |
+
protected $locations = array(
|
8 |
+
'module' => 'modules/{$vendor}/{$name}/',
|
9 |
+
);
|
10 |
+
}
|
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php
CHANGED
@@ -4,13 +4,19 @@ namespace Composer\Installers;
|
|
4 |
class DrupalInstaller extends BaseInstaller
|
5 |
{
|
6 |
protected $locations = array(
|
7 |
-
'core'
|
8 |
-
'module'
|
9 |
-
'theme'
|
10 |
-
'library'
|
11 |
-
'profile'
|
12 |
-
'
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
);
|
16 |
}
|
4 |
class DrupalInstaller extends BaseInstaller
|
5 |
{
|
6 |
protected $locations = array(
|
7 |
+
'core' => 'core/',
|
8 |
+
'module' => 'modules/{$name}/',
|
9 |
+
'theme' => 'themes/{$name}/',
|
10 |
+
'library' => 'libraries/{$name}/',
|
11 |
+
'profile' => 'profiles/{$name}/',
|
12 |
+
'database-driver' => 'drivers/lib/Drupal/Driver/Database/{$name}/',
|
13 |
+
'drush' => 'drush/{$name}/',
|
14 |
+
'custom-theme' => 'themes/custom/{$name}/',
|
15 |
+
'custom-module' => 'modules/custom/{$name}/',
|
16 |
+
'custom-profile' => 'profiles/custom/{$name}/',
|
17 |
+
'drupal-multisite' => 'sites/{$name}/',
|
18 |
+
'console' => 'console/{$name}/',
|
19 |
+
'console-language' => 'console/language/{$name}/',
|
20 |
+
'config' => 'config/sync/',
|
21 |
);
|
22 |
}
|
vendor/composer/installers/src/Composer/Installers/Installer.php
CHANGED
@@ -35,6 +35,7 @@ class Installer extends LibraryInstaller
|
|
35 |
'concrete5' => 'Concrete5Installer',
|
36 |
'craft' => 'CraftInstaller',
|
37 |
'croogo' => 'CroogoInstaller',
|
|
|
38 |
'dokuwiki' => 'DokuWikiInstaller',
|
39 |
'dolibarr' => 'DolibarrInstaller',
|
40 |
'decibel' => 'DecibelInstaller',
|
@@ -53,6 +54,7 @@ class Installer extends LibraryInstaller
|
|
53 |
'joomla' => 'JoomlaInstaller',
|
54 |
'kanboard' => 'KanboardInstaller',
|
55 |
'kirby' => 'KirbyInstaller',
|
|
|
56 |
'kodicms' => 'KodiCMSInstaller',
|
57 |
'kohana' => 'KohanaInstaller',
|
58 |
'lms' => 'LanManagementSystemInstaller',
|
@@ -61,6 +63,7 @@ class Installer extends LibraryInstaller
|
|
61 |
'lithium' => 'LithiumInstaller',
|
62 |
'magento' => 'MagentoInstaller',
|
63 |
'majima' => 'MajimaInstaller',
|
|
|
64 |
'mako' => 'MakoInstaller',
|
65 |
'maya' => 'MayaInstaller',
|
66 |
'mautic' => 'MauticInstaller',
|
@@ -85,6 +88,7 @@ class Installer extends LibraryInstaller
|
|
85 |
'phifty' => 'PhiftyInstaller',
|
86 |
'porto' => 'PortoInstaller',
|
87 |
'redaxo' => 'RedaxoInstaller',
|
|
|
88 |
'reindex' => 'ReIndexInstaller',
|
89 |
'roundcube' => 'RoundcubeInstaller',
|
90 |
'shopware' => 'ShopwareInstaller',
|
@@ -92,7 +96,9 @@ class Installer extends LibraryInstaller
|
|
92 |
'silverstripe' => 'SilverStripeInstaller',
|
93 |
'smf' => 'SMFInstaller',
|
94 |
'sydes' => 'SyDESInstaller',
|
|
|
95 |
'symfony1' => 'Symfony1Installer',
|
|
|
96 |
'thelia' => 'TheliaInstaller',
|
97 |
'tusk' => 'TuskInstaller',
|
98 |
'typo3-cms' => 'TYPO3CmsInstaller',
|
35 |
'concrete5' => 'Concrete5Installer',
|
36 |
'craft' => 'CraftInstaller',
|
37 |
'croogo' => 'CroogoInstaller',
|
38 |
+
'dframe' => 'DframeInstaller',
|
39 |
'dokuwiki' => 'DokuWikiInstaller',
|
40 |
'dolibarr' => 'DolibarrInstaller',
|
41 |
'decibel' => 'DecibelInstaller',
|
54 |
'joomla' => 'JoomlaInstaller',
|
55 |
'kanboard' => 'KanboardInstaller',
|
56 |
'kirby' => 'KirbyInstaller',
|
57 |
+
'known' => 'KnownInstaller',
|
58 |
'kodicms' => 'KodiCMSInstaller',
|
59 |
'kohana' => 'KohanaInstaller',
|
60 |
'lms' => 'LanManagementSystemInstaller',
|
63 |
'lithium' => 'LithiumInstaller',
|
64 |
'magento' => 'MagentoInstaller',
|
65 |
'majima' => 'MajimaInstaller',
|
66 |
+
'mantisbt' => 'MantisBTInstaller',
|
67 |
'mako' => 'MakoInstaller',
|
68 |
'maya' => 'MayaInstaller',
|
69 |
'mautic' => 'MauticInstaller',
|
88 |
'phifty' => 'PhiftyInstaller',
|
89 |
'porto' => 'PortoInstaller',
|
90 |
'redaxo' => 'RedaxoInstaller',
|
91 |
+
'redaxo5' => 'Redaxo5Installer',
|
92 |
'reindex' => 'ReIndexInstaller',
|
93 |
'roundcube' => 'RoundcubeInstaller',
|
94 |
'shopware' => 'ShopwareInstaller',
|
96 |
'silverstripe' => 'SilverStripeInstaller',
|
97 |
'smf' => 'SMFInstaller',
|
98 |
'sydes' => 'SyDESInstaller',
|
99 |
+
'sylius' => 'SyliusInstaller',
|
100 |
'symfony1' => 'Symfony1Installer',
|
101 |
+
'tao' => 'TaoInstaller',
|
102 |
'thelia' => 'TheliaInstaller',
|
103 |
'tusk' => 'TuskInstaller',
|
104 |
'typo3-cms' => 'TYPO3CmsInstaller',
|
vendor/composer/installers/src/Composer/Installers/KnownInstaller.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class KnownInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'plugin' => 'IdnoPlugins/{$name}/',
|
8 |
+
'theme' => 'Themes/{$name}/',
|
9 |
+
'console' => 'ConsolePlugins/{$name}/',
|
10 |
+
);
|
11 |
+
}
|
vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
use Composer\DependencyResolver\Pool;
|
5 |
+
|
6 |
+
class MantisBTInstaller extends BaseInstaller
|
7 |
+
{
|
8 |
+
protected $locations = array(
|
9 |
+
'plugin' => 'plugins/{$name}/',
|
10 |
+
);
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Format package name to CamelCase
|
14 |
+
*/
|
15 |
+
public function inflectPackageVars($vars)
|
16 |
+
{
|
17 |
+
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
18 |
+
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
19 |
+
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
20 |
+
|
21 |
+
return $vars;
|
22 |
+
}
|
23 |
+
}
|
vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php
CHANGED
@@ -4,12 +4,12 @@ namespace Composer\Installers;
|
|
4 |
class MicroweberInstaller extends BaseInstaller
|
5 |
{
|
6 |
protected $locations = array(
|
7 |
-
'module'
|
8 |
-
'module-skin' => 'userfiles/modules/{$
|
9 |
-
'template'
|
10 |
-
'element'
|
11 |
-
'vendor'
|
12 |
-
'components'
|
13 |
);
|
14 |
|
15 |
/**
|
@@ -22,89 +22,97 @@ class MicroweberInstaller extends BaseInstaller
|
|
22 |
*/
|
23 |
public function inflectPackageVars($vars)
|
24 |
{
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
|
|
50 |
return $vars;
|
51 |
}
|
52 |
|
53 |
protected function inflectTemplateVars($vars)
|
54 |
{
|
55 |
-
$vars['
|
56 |
-
$vars['
|
57 |
|
58 |
return $vars;
|
59 |
}
|
60 |
|
61 |
protected function inflectTemplatesVars($vars)
|
62 |
{
|
63 |
-
$vars['
|
64 |
-
$vars['
|
65 |
|
66 |
return $vars;
|
67 |
}
|
68 |
|
69 |
protected function inflectCoreVars($vars)
|
70 |
{
|
71 |
-
$vars['
|
72 |
-
$vars['
|
73 |
-
$vars['
|
74 |
|
75 |
return $vars;
|
76 |
}
|
77 |
|
78 |
protected function inflectModuleVars($vars)
|
79 |
{
|
80 |
-
$vars['
|
81 |
-
$vars['
|
82 |
|
83 |
return $vars;
|
84 |
}
|
85 |
|
86 |
protected function inflectModulesVars($vars)
|
87 |
{
|
88 |
-
$vars['
|
89 |
-
$vars['
|
90 |
|
91 |
return $vars;
|
92 |
}
|
93 |
|
94 |
protected function inflectSkinVars($vars)
|
95 |
{
|
96 |
-
$vars['
|
97 |
-
$vars['
|
98 |
|
99 |
return $vars;
|
100 |
}
|
101 |
|
102 |
protected function inflectElementVars($vars)
|
103 |
{
|
104 |
-
$vars['
|
105 |
-
$vars['
|
106 |
-
$vars['
|
107 |
-
$vars['
|
108 |
|
109 |
return $vars;
|
110 |
}
|
4 |
class MicroweberInstaller extends BaseInstaller
|
5 |
{
|
6 |
protected $locations = array(
|
7 |
+
'module' => 'userfiles/modules/{$install_item_dir}/',
|
8 |
+
'module-skin' => 'userfiles/modules/{$install_item_dir}/templates/',
|
9 |
+
'template' => 'userfiles/templates/{$install_item_dir}/',
|
10 |
+
'element' => 'userfiles/elements/{$install_item_dir}/',
|
11 |
+
'vendor' => 'vendor/{$install_item_dir}/',
|
12 |
+
'components' => 'components/{$install_item_dir}/'
|
13 |
);
|
14 |
|
15 |
/**
|
22 |
*/
|
23 |
public function inflectPackageVars($vars)
|
24 |
{
|
25 |
+
|
26 |
+
|
27 |
+
if ($this->package->getTargetDir()) {
|
28 |
+
$vars['install_item_dir'] = $this->package->getTargetDir();
|
29 |
+
} else {
|
30 |
+
$vars['install_item_dir'] = $vars['name'];
|
31 |
+
if ($vars['type'] === 'microweber-template') {
|
32 |
+
return $this->inflectTemplateVars($vars);
|
33 |
+
}
|
34 |
+
if ($vars['type'] === 'microweber-templates') {
|
35 |
+
return $this->inflectTemplatesVars($vars);
|
36 |
+
}
|
37 |
+
if ($vars['type'] === 'microweber-core') {
|
38 |
+
return $this->inflectCoreVars($vars);
|
39 |
+
}
|
40 |
+
if ($vars['type'] === 'microweber-adapter') {
|
41 |
+
return $this->inflectCoreVars($vars);
|
42 |
+
}
|
43 |
+
if ($vars['type'] === 'microweber-module') {
|
44 |
+
return $this->inflectModuleVars($vars);
|
45 |
+
}
|
46 |
+
if ($vars['type'] === 'microweber-modules') {
|
47 |
+
return $this->inflectModulesVars($vars);
|
48 |
+
}
|
49 |
+
if ($vars['type'] === 'microweber-skin') {
|
50 |
+
return $this->inflectSkinVars($vars);
|
51 |
+
}
|
52 |
+
if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
|
53 |
+
return $this->inflectElementVars($vars);
|
54 |
+
}
|
55 |
}
|
56 |
|
57 |
+
|
58 |
return $vars;
|
59 |
}
|
60 |
|
61 |
protected function inflectTemplateVars($vars)
|
62 |
{
|
63 |
+
$vars['install_item_dir'] = preg_replace('/-template$/', '', $vars['install_item_dir']);
|
64 |
+
$vars['install_item_dir'] = preg_replace('/template-$/', '', $vars['install_item_dir']);
|
65 |
|
66 |
return $vars;
|
67 |
}
|
68 |
|
69 |
protected function inflectTemplatesVars($vars)
|
70 |
{
|
71 |
+
$vars['install_item_dir'] = preg_replace('/-templates$/', '', $vars['install_item_dir']);
|
72 |
+
$vars['install_item_dir'] = preg_replace('/templates-$/', '', $vars['install_item_dir']);
|
73 |
|
74 |
return $vars;
|
75 |
}
|
76 |
|
77 |
protected function inflectCoreVars($vars)
|
78 |
{
|
79 |
+
$vars['install_item_dir'] = preg_replace('/-providers$/', '', $vars['install_item_dir']);
|
80 |
+
$vars['install_item_dir'] = preg_replace('/-provider$/', '', $vars['install_item_dir']);
|
81 |
+
$vars['install_item_dir'] = preg_replace('/-adapter$/', '', $vars['install_item_dir']);
|
82 |
|
83 |
return $vars;
|
84 |
}
|
85 |
|
86 |
protected function inflectModuleVars($vars)
|
87 |
{
|
88 |
+
$vars['install_item_dir'] = preg_replace('/-module$/', '', $vars['install_item_dir']);
|
89 |
+
$vars['install_item_dir'] = preg_replace('/module-$/', '', $vars['install_item_dir']);
|
90 |
|
91 |
return $vars;
|
92 |
}
|
93 |
|
94 |
protected function inflectModulesVars($vars)
|
95 |
{
|
96 |
+
$vars['install_item_dir'] = preg_replace('/-modules$/', '', $vars['install_item_dir']);
|
97 |
+
$vars['install_item_dir'] = preg_replace('/modules-$/', '', $vars['install_item_dir']);
|
98 |
|
99 |
return $vars;
|
100 |
}
|
101 |
|
102 |
protected function inflectSkinVars($vars)
|
103 |
{
|
104 |
+
$vars['install_item_dir'] = preg_replace('/-skin$/', '', $vars['install_item_dir']);
|
105 |
+
$vars['install_item_dir'] = preg_replace('/skin-$/', '', $vars['install_item_dir']);
|
106 |
|
107 |
return $vars;
|
108 |
}
|
109 |
|
110 |
protected function inflectElementVars($vars)
|
111 |
{
|
112 |
+
$vars['install_item_dir'] = preg_replace('/-elements$/', '', $vars['install_item_dir']);
|
113 |
+
$vars['install_item_dir'] = preg_replace('/elements-$/', '', $vars['install_item_dir']);
|
114 |
+
$vars['install_item_dir'] = preg_replace('/-element$/', '', $vars['install_item_dir']);
|
115 |
+
$vars['install_item_dir'] = preg_replace('/element-$/', '', $vars['install_item_dir']);
|
116 |
|
117 |
return $vars;
|
118 |
}
|
vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php
CHANGED
@@ -20,6 +20,7 @@ class MoodleInstaller extends BaseInstaller
|
|
20 |
'calendartype' => 'calendar/type/{$name}/',
|
21 |
'format' => 'course/format/{$name}/',
|
22 |
'coursereport' => 'course/report/{$name}/',
|
|
|
23 |
'datafield' => 'mod/data/field/{$name}/',
|
24 |
'datapreset' => 'mod/data/preset/{$name}/',
|
25 |
'editor' => 'lib/editor/{$name}/',
|
20 |
'calendartype' => 'calendar/type/{$name}/',
|
21 |
'format' => 'course/format/{$name}/',
|
22 |
'coursereport' => 'course/report/{$name}/',
|
23 |
+
'customcertelement' => 'mod/customcert/element/{$name}/',
|
24 |
'datafield' => 'mod/data/field/{$name}/',
|
25 |
'datapreset' => 'mod/data/preset/{$name}/',
|
26 |
'editor' => 'lib/editor/{$name}/',
|
vendor/composer/installers/src/Composer/Installers/Plugin.php
CHANGED
@@ -8,10 +8,20 @@ use Composer\Plugin\PluginInterface;
|
|
8 |
|
9 |
class Plugin implements PluginInterface
|
10 |
{
|
|
|
11 |
|
12 |
public function activate(Composer $composer, IOInterface $io)
|
13 |
{
|
14 |
-
$installer = new Installer($io, $composer);
|
15 |
-
$composer->getInstallationManager()->addInstaller($installer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
}
|
8 |
|
9 |
class Plugin implements PluginInterface
|
10 |
{
|
11 |
+
private $installer;
|
12 |
|
13 |
public function activate(Composer $composer, IOInterface $io)
|
14 |
{
|
15 |
+
$this->installer = new Installer($io, $composer);
|
16 |
+
$composer->getInstallationManager()->addInstaller($this->installer);
|
17 |
+
}
|
18 |
+
|
19 |
+
public function deactivate(Composer $composer, IOInterface $io)
|
20 |
+
{
|
21 |
+
$composer->getInstallationManager()->removeInstaller($this->installer);
|
22 |
+
}
|
23 |
+
|
24 |
+
public function uninstall(Composer $composer, IOInterface $io)
|
25 |
+
{
|
26 |
}
|
27 |
}
|
vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class Redaxo5Installer extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'addon' => 'redaxo/src/addons/{$name}/',
|
8 |
+
'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
|
9 |
+
);
|
10 |
+
}
|
vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class SyliusInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'theme' => 'themes/{$name}/',
|
8 |
+
);
|
9 |
+
}
|
vendor/composer/installers/src/Composer/Installers/TaoInstaller.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* An installer to handle TAO extensions.
|
6 |
+
*/
|
7 |
+
class TaoInstaller extends BaseInstaller
|
8 |
+
{
|
9 |
+
protected $locations = array(
|
10 |
+
'extension' => '{$name}'
|
11 |
+
);
|
12 |
+
}
|
vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php
CHANGED
@@ -5,6 +5,17 @@ namespace Composer\Installers;
|
|
5 |
class WHMCSInstaller extends BaseInstaller
|
6 |
{
|
7 |
protected $locations = array(
|
8 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
);
|
10 |
}
|
5 |
class WHMCSInstaller extends BaseInstaller
|
6 |
{
|
7 |
protected $locations = array(
|
8 |
+
'addons' => 'modules/addons/{$vendor}_{$name}/',
|
9 |
+
'fraud' => 'modules/fraud/{$vendor}_{$name}/',
|
10 |
+
'gateways' => 'modules/gateways/{$vendor}_{$name}/',
|
11 |
+
'notifications' => 'modules/notifications/{$vendor}_{$name}/',
|
12 |
+
'registrars' => 'modules/registrars/{$vendor}_{$name}/',
|
13 |
+
'reports' => 'modules/reports/{$vendor}_{$name}/',
|
14 |
+
'security' => 'modules/security/{$vendor}_{$name}/',
|
15 |
+
'servers' => 'modules/servers/{$vendor}_{$name}/',
|
16 |
+
'social' => 'modules/social/{$vendor}_{$name}/',
|
17 |
+
'support' => 'modules/support/{$vendor}_{$name}/',
|
18 |
+
'templates' => 'templates/{$vendor}_{$name}/',
|
19 |
+
'includes' => 'includes/{$vendor}_{$name}/'
|
20 |
);
|
21 |
}
|