Version Description
- Aug 31 2018 =
- [NEW] CLI CLI can now support image optimization. (@Shon)
- [IMPROVEMENT] GUI Cron/CLI will not create admin message anymore.
- [UPDATE] Media Fixed a PHP notice that appeared when pulling optimized images.
- [UPDATE] Fixed a PHP notice when detecting origin of ajax call. (@iosoft)
- [DEBUG] Debug log can now log referer URL.
- [DEBUG] Changes to options will now be logged.
Download this release
Release Info
Developer | LiteSpeedTech |
Plugin | LiteSpeed Cache |
Version | 2.4.4 |
Comparing to | |
See all releases |
Code changes from version 2.4 to 2.4.4
- admin/admin-api.class.php +49 -4
- admin/litespeed-cache-admin-display.class.php +21 -5
- admin/litespeed-cache-admin-error.class.php +5 -3
- admin/litespeed-cache-admin-optimize.class.php +5 -0
- admin/litespeed-cache-admin-report.class.php +7 -20
- admin/litespeed-cache-admin-rules.class.php +7 -1
- admin/litespeed-cache-admin-settings.class.php +26 -7
- admin/litespeed-cache-admin.class.php +13 -6
- admin/tpl/api/quic.login.php +37 -0
- admin/tpl/api/quic.register.php +41 -0
- admin/tpl/api/quic.user_welcome.php +21 -0
- admin/tpl/image_optimization.php +6 -316
- admin/tpl/inc/api_key.php +5 -6
- admin/tpl/inc/check_cache_disabled.php +7 -7
- admin/tpl/inc/img_optm.communicate_notify.php +10 -0
- admin/tpl/inc/img_optm.initialize.php +38 -0
- admin/tpl/inc/img_optm.level_info.php +46 -0
- admin/tpl/inc/img_optm.percentage_summary.php +33 -0
- admin/tpl/inc/img_optm.summary.php +313 -0
- admin/tpl/inc/modal.footer.php +3 -0
- admin/tpl/inc/modal.header.php +17 -0
- admin/tpl/setting/settings_cdn.php +18 -39
- admin/tpl/setting/settings_inc.cache_browser.php +1 -1
- admin/tpl/setting/settings_inc.check_adv_file.php +4 -3
- admin/tpl/setting/settings_inc.media_webp.php +1 -2
- admin/tpl/setting/settings_media.php +40 -11
- admin/tpl/setting/settings_optimize.php +4 -4
- cli/litespeed-cache-cli-admin.class.php +15 -21
- cli/litespeed-cache-cli-iapi.class.php +183 -0
- css/litespeed.css +425 -4
- inc/activation.class.php +5 -0
- inc/api.class.php +7 -7
- inc/cdn.class.php +9 -1
- inc/cdn/quic.class.php +257 -0
- inc/config.class.php +15 -6
- inc/const.cls.php +50 -10
- inc/control.class.php +7 -1
- inc/crawler-sitemap.class.php +4 -0
- inc/crawler.class.php +5 -1
- inc/css.cls.php +12 -1
- inc/data.class.php +62 -32
- inc/data_structure/img_optm.sql +1 -1
- inc/doc.cls.php +16 -1
- inc/esi.class.php +5 -1
- inc/gui.class.php +75 -5
- inc/img_optm.class.php +520 -214
- inc/import.class.php +68 -21
- inc/litespeed-cache.class.php +10 -4
- inc/litespeed.autoload.php +2 -1
- inc/log.class.php +11 -0
- inc/media.class.php +122 -54
- inc/object.class.php +4 -1
- inc/optimize.class.php +10 -2
- inc/optimizer.class.php +4 -1
- inc/purge.class.php +7 -3
- inc/router.class.php +27 -7
- inc/tag.class.php +5 -3
- inc/task.class.php +31 -8
- inc/utility.class.php +12 -6
- inc/vary.class.php +5 -3
- includes/litespeed-cache-activation.class.php +5 -0
- includes/litespeed-cache-api.class.php +7 -7
- includes/litespeed-cache-cdn.class.php +9 -1
- includes/litespeed-cache-config.class.php +15 -6
- includes/litespeed-cache-control.class.php +7 -1
- includes/litespeed-cache-crawler.class.php +5 -1
- includes/litespeed-cache-esi.class.php +5 -1
- includes/litespeed-cache-gui.class.php +75 -5
- includes/litespeed-cache-log.class.php +11 -0
- includes/litespeed-cache-optimize.class.php +10 -2
- includes/litespeed-cache-purge.class.php +7 -3
- includes/litespeed-cache-router.class.php +27 -7
- includes/litespeed-cache-tag.class.php +5 -3
- includes/litespeed-cache-task.class.php +31 -8
- includes/litespeed-cache-utility.class.php +12 -6
- includes/litespeed-cache-vary.class.php +5 -3
- includes/litespeed-cache.class.php +10 -4
- includes/litespeed.autoload.php +2 -1
- languages/litespeed-cache.pot +673 -560
- litespeed-cache.php +3 -2
- readme.txt +65 -13
admin/admin-api.class.php
CHANGED
@@ -7,6 +7,11 @@
|
|
7 |
* @subpackage LiteSpeed_Cache/admin
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
|
|
|
|
|
|
|
|
|
|
10 |
class LiteSpeed_Cache_Admin_API
|
11 |
{
|
12 |
private static $_instance ;
|
@@ -26,7 +31,8 @@ class LiteSpeed_Cache_Admin_API
|
|
26 |
const IAPI_ACTION_REQUEST_KEY = 'request_key' ;
|
27 |
const IAPI_ACTION_MEDIA_SYNC_DATA = 'media_sync_data' ;
|
28 |
const IAPI_ACTION_REQUEST_OPTIMIZE = 'request_optimize' ;
|
29 |
-
const IAPI_ACTION_PULL_IMG = 'client_pull' ;
|
|
|
30 |
const IAPI_ACTION_PULL_IMG_FAILED = 'client_pull_failed' ;
|
31 |
const IAPI_ACTION_REQUEST_DESTROY = 'imgoptm_destroy' ;
|
32 |
const IAPI_ACTION_REQUEST_DESTROY_UNFINISHED = 'imgoptm_destroy_unfinished' ;
|
@@ -236,8 +242,11 @@ class LiteSpeed_Cache_Admin_API
|
|
236 |
// Check if get key&server correctly
|
237 |
if ( empty( $json[ 'auth_key' ] ) ) {
|
238 |
LiteSpeed_Cache_Log::debug( '[IAPI] request key failed: ', $json ) ;
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
241 |
return ;
|
242 |
}
|
243 |
|
@@ -269,6 +278,7 @@ class LiteSpeed_Cache_Admin_API
|
|
269 |
* @since 1.6
|
270 |
* @access private
|
271 |
* @param array $data
|
|
|
272 |
*/
|
273 |
private function _post( $action, $data = false, $server = false, $no_hash = false )
|
274 |
{
|
@@ -310,6 +320,10 @@ class LiteSpeed_Cache_Admin_API
|
|
310 |
|
311 |
if ( ! is_array( $json ) ) {
|
312 |
LiteSpeed_Cache_Log::debug( '[IAPI] failed to decode post json: ' . $response[ 'body' ] ) ;
|
|
|
|
|
|
|
|
|
313 |
return $response[ 'body' ] ;
|
314 |
}
|
315 |
|
@@ -318,7 +332,17 @@ class LiteSpeed_Cache_Admin_API
|
|
318 |
$msg = __( 'Failed to communicate with LiteSpeed image server', 'litespeed-cache' ) . ': ' . $json[ '_err' ] ;
|
319 |
$msg .= $this->_parse_link( $json ) ;
|
320 |
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
321 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
}
|
323 |
|
324 |
if ( ! empty( $json[ '_info' ] ) ) {
|
@@ -337,6 +361,27 @@ class LiteSpeed_Cache_Admin_API
|
|
337 |
unset( $json[ '_note' ] ) ;
|
338 |
}
|
339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
return $json ;
|
341 |
}
|
342 |
|
7 |
* @subpackage LiteSpeed_Cache/admin
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
class LiteSpeed_Cache_Admin_API
|
16 |
{
|
17 |
private static $_instance ;
|
31 |
const IAPI_ACTION_REQUEST_KEY = 'request_key' ;
|
32 |
const IAPI_ACTION_MEDIA_SYNC_DATA = 'media_sync_data' ;
|
33 |
const IAPI_ACTION_REQUEST_OPTIMIZE = 'request_optimize' ;
|
34 |
+
const IAPI_ACTION_PULL_IMG = 'client_pull' ; // Deprecated
|
35 |
+
const IAPI_ACTION_IMG_TAKEN = 'client_img_taken' ;
|
36 |
const IAPI_ACTION_PULL_IMG_FAILED = 'client_pull_failed' ;
|
37 |
const IAPI_ACTION_REQUEST_DESTROY = 'imgoptm_destroy' ;
|
38 |
const IAPI_ACTION_REQUEST_DESTROY_UNFINISHED = 'imgoptm_destroy_unfinished' ;
|
242 |
// Check if get key&server correctly
|
243 |
if ( empty( $json[ 'auth_key' ] ) ) {
|
244 |
LiteSpeed_Cache_Log::debug( '[IAPI] request key failed: ', $json ) ;
|
245 |
+
|
246 |
+
if ( $json ) {
|
247 |
+
$msg = sprintf( __( 'IAPI Error %s', 'litespeed-cache' ), $json ) ;
|
248 |
+
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
249 |
+
}
|
250 |
return ;
|
251 |
}
|
252 |
|
278 |
* @since 1.6
|
279 |
* @access private
|
280 |
* @param array $data
|
281 |
+
* @return string | array Must return an error msg string or json array
|
282 |
*/
|
283 |
private function _post( $action, $data = false, $server = false, $no_hash = false )
|
284 |
{
|
320 |
|
321 |
if ( ! is_array( $json ) ) {
|
322 |
LiteSpeed_Cache_Log::debug( '[IAPI] failed to decode post json: ' . $response[ 'body' ] ) ;
|
323 |
+
|
324 |
+
$msg = __( 'Failed to post via WordPress', 'litespeed-cache' ) . ': ' . $response[ 'body' ] ;
|
325 |
+
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
326 |
+
|
327 |
return $response[ 'body' ] ;
|
328 |
}
|
329 |
|
332 |
$msg = __( 'Failed to communicate with LiteSpeed image server', 'litespeed-cache' ) . ': ' . $json[ '_err' ] ;
|
333 |
$msg .= $this->_parse_link( $json ) ;
|
334 |
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
335 |
+
return $json[ '_err' ] ;
|
336 |
+
}
|
337 |
+
|
338 |
+
if ( ! empty( $json[ '_503' ] ) ) {
|
339 |
+
LiteSpeed_Cache_Log::debug( '[IAPI] service 503 unavailable temporarily. ' . $json[ '_503' ] ) ;
|
340 |
+
|
341 |
+
$msg = __( 'We are working hard to improve your Image Optimization experience. The service will be unavailable while we work. We apologize for any inconvenience.', 'litespeed-cache' ) ;
|
342 |
+
$msg .= ' ' . $json[ '_503' ] ;
|
343 |
+
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
344 |
+
|
345 |
+
return $json[ '_503' ] ;
|
346 |
}
|
347 |
|
348 |
if ( ! empty( $json[ '_info' ] ) ) {
|
361 |
unset( $json[ '_note' ] ) ;
|
362 |
}
|
363 |
|
364 |
+
if ( ! empty( $json[ '_success' ] ) ) {
|
365 |
+
LiteSpeed_Cache_Log::debug( '[IAPI] _success: ' . $json[ '_success' ] ) ;
|
366 |
+
$msg = __( 'Good news from LiteSpeed image server', 'litespeed-cache' ) . ': ' . $json[ '_success' ] ;
|
367 |
+
$msg .= $this->_parse_link( $json ) ;
|
368 |
+
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
369 |
+
unset( $json[ '_success' ] ) ;
|
370 |
+
}
|
371 |
+
|
372 |
+
// Upgrade is required
|
373 |
+
if ( ! empty( $json[ '_err_req_v' ] ) ) {
|
374 |
+
LiteSpeed_Cache_Log::debug( '[IAPI] _err_req_v: ' . $json[ '_err_req_v' ] ) ;
|
375 |
+
$msg = sprintf( __( '%s plugin version %s required for this action.', 'litespeed-cache' ), LiteSpeed_Cache::NAME, 'v' . $json[ '_err_req_v' ] . '+' ) ;
|
376 |
+
|
377 |
+
// Append upgrade link
|
378 |
+
$msg2 = ' ' . LiteSpeed_Cache_GUI::plugin_upgrade_link( LiteSpeed_Cache::NAME, LiteSpeed_Cache::PLUGIN_NAME, $json[ '_err_req_v' ] ) ;
|
379 |
+
|
380 |
+
$msg2 .= $this->_parse_link( $json ) ;
|
381 |
+
LiteSpeed_Cache_Admin_Display::error( $msg . $msg2 ) ;
|
382 |
+
return $msg ;
|
383 |
+
}
|
384 |
+
|
385 |
return $json ;
|
386 |
}
|
387 |
|
admin/litespeed-cache-admin-display.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The admin-panel specific functionality of the plugin.
|
5 |
*
|
@@ -9,6 +8,11 @@
|
|
9 |
* @subpackage LiteSpeed_Cache/admin
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
|
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Admin_Display
|
13 |
{
|
14 |
private static $_instance ;
|
@@ -145,13 +149,13 @@ class LiteSpeed_Cache_Admin_Display
|
|
145 |
$capability = is_network_admin() ? 'manage_network_options' : 'manage_options' ;
|
146 |
if ( current_user_can($capability) ) {
|
147 |
// root menu
|
148 |
-
add_menu_page('LiteSpeed Cache', 'LiteSpeed Cache', 'manage_options', 'lscache-
|
149 |
|
150 |
// sub menus
|
151 |
-
$this->add_submenu(__('Manage', 'litespeed-cache'), 'lscache-dash', 'show_menu_manage') ;
|
152 |
-
|
153 |
$this->add_submenu(__('Settings', 'litespeed-cache'), 'lscache-settings', 'show_menu_settings') ;
|
154 |
|
|
|
|
|
155 |
if ( ! is_multisite() || is_network_admin() ) {
|
156 |
$this->add_submenu(__('Edit .htaccess', 'litespeed-cache'), LiteSpeed_Cache::PAGE_EDIT_HTACCESS, 'show_menu_edit_htaccess') ;
|
157 |
}
|
@@ -181,7 +185,7 @@ class LiteSpeed_Cache_Admin_Display
|
|
181 |
*/
|
182 |
private function add_submenu($menu_title, $menu_slug, $callback)
|
183 |
{
|
184 |
-
add_submenu_page('lscache-
|
185 |
}
|
186 |
|
187 |
/**
|
@@ -463,6 +467,11 @@ class LiteSpeed_Cache_Admin_Display
|
|
463 |
*/
|
464 |
public static function add_notice($color, $msg)
|
465 |
{
|
|
|
|
|
|
|
|
|
|
|
466 |
$messages = (array)get_transient(self::TRANSIENT_LITESPEED_MESSAGE) ;
|
467 |
if( ! $messages ) {
|
468 |
$messages = array() ;
|
@@ -489,7 +498,14 @@ class LiteSpeed_Cache_Admin_Display
|
|
489 |
$messages = get_transient(self::TRANSIENT_LITESPEED_MESSAGE) ;
|
490 |
if( is_array($messages) ) {
|
491 |
$messages = array_unique($messages) ;
|
|
|
|
|
492 |
foreach ($messages as $msg) {
|
|
|
|
|
|
|
|
|
|
|
493 |
echo $msg ;
|
494 |
}
|
495 |
}
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The admin-panel specific functionality of the plugin.
|
4 |
*
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Admin_Display
|
17 |
{
|
18 |
private static $_instance ;
|
149 |
$capability = is_network_admin() ? 'manage_network_options' : 'manage_options' ;
|
150 |
if ( current_user_can($capability) ) {
|
151 |
// root menu
|
152 |
+
add_menu_page('LiteSpeed Cache', 'LiteSpeed Cache', 'manage_options', 'lscache-settings') ;
|
153 |
|
154 |
// sub menus
|
|
|
|
|
155 |
$this->add_submenu(__('Settings', 'litespeed-cache'), 'lscache-settings', 'show_menu_settings') ;
|
156 |
|
157 |
+
$this->add_submenu(__('Manage', 'litespeed-cache'), 'lscache-dash', 'show_menu_manage') ;
|
158 |
+
|
159 |
if ( ! is_multisite() || is_network_admin() ) {
|
160 |
$this->add_submenu(__('Edit .htaccess', 'litespeed-cache'), LiteSpeed_Cache::PAGE_EDIT_HTACCESS, 'show_menu_edit_htaccess') ;
|
161 |
}
|
185 |
*/
|
186 |
private function add_submenu($menu_title, $menu_slug, $callback)
|
187 |
{
|
188 |
+
add_submenu_page('lscache-settings', $menu_title, $menu_title, 'manage_options', $menu_slug, array($this, $callback)) ;
|
189 |
}
|
190 |
|
191 |
/**
|
467 |
*/
|
468 |
public static function add_notice($color, $msg)
|
469 |
{
|
470 |
+
// Bypass adding for CLI or cron
|
471 |
+
if ( defined( 'LITESPEED_CLI' ) || defined( 'DOING_CRON' ) ) {
|
472 |
+
return ;
|
473 |
+
}
|
474 |
+
|
475 |
$messages = (array)get_transient(self::TRANSIENT_LITESPEED_MESSAGE) ;
|
476 |
if( ! $messages ) {
|
477 |
$messages = array() ;
|
498 |
$messages = get_transient(self::TRANSIENT_LITESPEED_MESSAGE) ;
|
499 |
if( is_array($messages) ) {
|
500 |
$messages = array_unique($messages) ;
|
501 |
+
|
502 |
+
$added_thickbox = false ;
|
503 |
foreach ($messages as $msg) {
|
504 |
+
// Added for popup links
|
505 |
+
if ( strpos( $msg, 'TB_iframe' ) && ! $added_thickbox ) {
|
506 |
+
add_thickbox();
|
507 |
+
$added_thickbox = true ;
|
508 |
+
}
|
509 |
echo $msg ;
|
510 |
}
|
511 |
}
|
admin/litespeed-cache-admin-error.class.php
CHANGED
@@ -1,7 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
/**
|
6 |
* The admin errors
|
7 |
*
|
@@ -11,6 +8,11 @@
|
|
11 |
* @subpackage LiteSpeed_Cache/admin
|
12 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
13 |
*/
|
|
|
|
|
|
|
|
|
|
|
14 |
class LiteSpeed_Cache_Admin_Error
|
15 |
{
|
16 |
private static $_instance ;
|
1 |
<?php
|
|
|
|
|
|
|
2 |
/**
|
3 |
* The admin errors
|
4 |
*
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Admin_Error
|
17 |
{
|
18 |
private static $_instance ;
|
admin/litespeed-cache-admin-optimize.class.php
CHANGED
@@ -8,6 +8,11 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Admin_Optimize
|
12 |
{
|
13 |
private static $_types = array( 'revision', 'auto_draft', 'trash_post', 'spam_comment', 'trash_comment', 'trackback-pingback', 'expired_transient', 'all_transients' ) ;
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Admin_Optimize
|
17 |
{
|
18 |
private static $_types = array( 'revision', 'auto_draft', 'trash_post', 'spam_comment', 'trash_comment', 'trackback-pingback', 'expired_transient', 'all_transients' ) ;
|
admin/litespeed-cache-admin-report.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The report class
|
5 |
*
|
@@ -9,6 +8,11 @@
|
|
9 |
* @subpackage LiteSpeed_Cache/admin
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
|
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Admin_Report
|
13 |
{
|
14 |
private static $_instance ;
|
@@ -161,7 +165,7 @@ class LiteSpeed_Cache_Admin_Report
|
|
161 |
|
162 |
// Security: Remove cf key in report
|
163 |
$secure_fields = array(
|
164 |
-
LiteSpeed_Cache_Config::
|
165 |
LiteSpeed_Cache_Config::OPID_CDN_CLOUDFLARE_KEY,
|
166 |
LiteSpeed_Cache_Config::OPID_CACHE_OBJECT_PSWD,
|
167 |
) ;
|
@@ -206,24 +210,7 @@ class LiteSpeed_Cache_Admin_Report
|
|
206 |
$server_vars = array_intersect_key($server, $server_keys) ;
|
207 |
$server_vars[] = "LSWCP_TAG_PREFIX = " . LSWCP_TAG_PREFIX ;
|
208 |
|
209 |
-
$
|
210 |
-
'WP_SITEURL',
|
211 |
-
'WP_HOME',
|
212 |
-
'WP_CONTENT_DIR',
|
213 |
-
'SHORTINIT',
|
214 |
-
'LSCWP_CONTENT_DIR',
|
215 |
-
'LSCWP_DIR',
|
216 |
-
'LITESPEED_TIME_OFFSET',
|
217 |
-
'LITESPEED_SERVER_TYPE',
|
218 |
-
'LITESPEED_CLI',
|
219 |
-
'LITESPEED_ALLOWED',
|
220 |
-
'LITESPEED_ON',
|
221 |
-
'LITESPEED_ON_IN_SETTING',
|
222 |
-
'LSCACHE_ADV_CACHE',
|
223 |
-
) ;
|
224 |
-
foreach ( $consts as $v ) {
|
225 |
-
$server_vars[ $v ] = defined( $v ) ? constant( $v ) : NULL ;
|
226 |
-
}
|
227 |
|
228 |
$buf = $this->format_report_section('Server Variables', $server_vars) ;
|
229 |
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The report class
|
4 |
*
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Admin_Report
|
17 |
{
|
18 |
private static $_instance ;
|
165 |
|
166 |
// Security: Remove cf key in report
|
167 |
$secure_fields = array(
|
168 |
+
LiteSpeed_Cache_Config::OPT_CDN_QUIC_KEY,
|
169 |
LiteSpeed_Cache_Config::OPID_CDN_CLOUDFLARE_KEY,
|
170 |
LiteSpeed_Cache_Config::OPID_CACHE_OBJECT_PSWD,
|
171 |
) ;
|
210 |
$server_vars = array_intersect_key($server, $server_keys) ;
|
211 |
$server_vars[] = "LSWCP_TAG_PREFIX = " . LSWCP_TAG_PREFIX ;
|
212 |
|
213 |
+
$server_vars = array_merge( $server_vars, LiteSpeed_Cache_Config::get_instance()->server_vars() ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
|
215 |
$buf = $this->format_report_section('Server Variables', $server_vars) ;
|
216 |
|
admin/litespeed-cache-admin-rules.class.php
CHANGED
@@ -8,6 +8,11 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Admin_Rules
|
12 |
{
|
13 |
private static $_instance ;
|
@@ -666,7 +671,8 @@ class LiteSpeed_Cache_Admin_Rules
|
|
666 |
$id = LiteSpeed_Cache_Config::OPT_MEDIA_WEBP_REPLACE ;
|
667 |
if ( ! empty( $cfg[ $id ] ) ) {
|
668 |
$new_rules[] = self::MARKER_WEBP . self::MARKER_START ;
|
669 |
-
$new_rules[] = 'RewriteCond %{HTTP_ACCEPT} "image/webp"' ;
|
|
|
670 |
$new_rules[] = 'RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]' ;
|
671 |
$new_rules[] = self::MARKER_WEBP . self::MARKER_END ;
|
672 |
$new_rules[] = '' ;
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Admin_Rules
|
17 |
{
|
18 |
private static $_instance ;
|
671 |
$id = LiteSpeed_Cache_Config::OPT_MEDIA_WEBP_REPLACE ;
|
672 |
if ( ! empty( $cfg[ $id ] ) ) {
|
673 |
$new_rules[] = self::MARKER_WEBP . self::MARKER_START ;
|
674 |
+
$new_rules[] = 'RewriteCond %{HTTP_ACCEPT} "image/webp" [or]' ;
|
675 |
+
$new_rules[] = 'RewriteCond %{HTTP_USER_AGENT} "Page Speed"' ;
|
676 |
$new_rules[] = 'RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]' ;
|
677 |
$new_rules[] = self::MARKER_WEBP . self::MARKER_END ;
|
678 |
$new_rules[] = '' ;
|
admin/litespeed-cache-admin-settings.class.php
CHANGED
@@ -8,13 +8,18 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Admin_Settings
|
12 |
{
|
13 |
private static $_instance ;
|
14 |
|
15 |
private $_input ;
|
16 |
private $_options ;
|
17 |
-
private $_err ;
|
18 |
|
19 |
private $_max_int = 2147483647 ;
|
20 |
|
@@ -120,7 +125,17 @@ class LiteSpeed_Cache_Admin_Settings
|
|
120 |
}
|
121 |
}
|
122 |
|
123 |
-
$this->_validate_thirdparty(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
return $this->_options ;
|
126 |
}
|
@@ -533,7 +548,7 @@ class LiteSpeed_Cache_Admin_Settings
|
|
533 |
$cdn_cloudflare_changed = false ;
|
534 |
$ids = array(
|
535 |
LiteSpeed_Cache_Config::OPID_CDN,
|
536 |
-
LiteSpeed_Cache_Config::
|
537 |
LiteSpeed_Cache_Config::OPID_CDN_CLOUDFLARE,
|
538 |
) ;
|
539 |
foreach ( $ids as $id ) {
|
@@ -613,12 +628,11 @@ class LiteSpeed_Cache_Admin_Settings
|
|
613 |
|
614 |
/**
|
615 |
* Quic API
|
616 |
-
* @since
|
617 |
*/
|
618 |
$ids = array(
|
619 |
-
LiteSpeed_Cache_Config::
|
620 |
-
LiteSpeed_Cache_Config::
|
621 |
-
LiteSpeed_Cache_Config::OPID_CDN_QUIC_SITE,
|
622 |
) ;
|
623 |
foreach ( $ids as $id ) {
|
624 |
if ( $this->_options[ $id ] === $this->_input[ $id ] ) {
|
@@ -671,9 +685,11 @@ class LiteSpeed_Cache_Admin_Settings
|
|
671 |
$ids = array(
|
672 |
LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZY,
|
673 |
LiteSpeed_Cache_Config::OPID_MEDIA_IFRAME_LAZY,
|
|
|
674 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_AUTO,
|
675 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_CRON,
|
676 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_ORI,
|
|
|
677 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_WEBP,
|
678 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_LOSSLESS,
|
679 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_EXIF,
|
@@ -884,6 +900,9 @@ class LiteSpeed_Cache_Admin_Settings
|
|
884 |
|
885 |
// Remove Object Cache
|
886 |
if ( $this->_options[ LiteSpeed_Cache_Config::OPID_DEBUG_DISABLE_ALL ] ) {
|
|
|
|
|
|
|
887 |
LiteSpeed_Cache_Log::debug( '[Settings] Remove .object_cache.ini due to debug_disable_all' ) ;
|
888 |
LiteSpeed_Cache_Object::get_instance()->del_file() ;
|
889 |
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Admin_Settings
|
17 |
{
|
18 |
private static $_instance ;
|
19 |
|
20 |
private $_input ;
|
21 |
private $_options ;
|
22 |
+
private $_err = array() ;
|
23 |
|
24 |
private $_max_int = 2147483647 ;
|
25 |
|
125 |
}
|
126 |
}
|
127 |
|
128 |
+
$this->_validate_thirdparty() ;
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Check if need to send cfg to CDN or not
|
132 |
+
* @since 2.3
|
133 |
+
*/
|
134 |
+
$id = LiteSpeed_Cache_Config::OPT_CDN_QUIC ;
|
135 |
+
if ( $this->_options[ $id ] ) {
|
136 |
+
// Send to Quic CDN
|
137 |
+
LiteSpeed_Cache_CDN_Quic::sync_config( $this->_options ) ;
|
138 |
+
}
|
139 |
|
140 |
return $this->_options ;
|
141 |
}
|
548 |
$cdn_cloudflare_changed = false ;
|
549 |
$ids = array(
|
550 |
LiteSpeed_Cache_Config::OPID_CDN,
|
551 |
+
LiteSpeed_Cache_Config::OPT_CDN_QUIC,
|
552 |
LiteSpeed_Cache_Config::OPID_CDN_CLOUDFLARE,
|
553 |
) ;
|
554 |
foreach ( $ids as $id ) {
|
628 |
|
629 |
/**
|
630 |
* Quic API
|
631 |
+
* @since 2.4.1
|
632 |
*/
|
633 |
$ids = array(
|
634 |
+
LiteSpeed_Cache_Config::OPT_CDN_QUIC_EMAIL,
|
635 |
+
LiteSpeed_Cache_Config::OPT_CDN_QUIC_KEY,
|
|
|
636 |
) ;
|
637 |
foreach ( $ids as $id ) {
|
638 |
if ( $this->_options[ $id ] === $this->_input[ $id ] ) {
|
685 |
$ids = array(
|
686 |
LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZY,
|
687 |
LiteSpeed_Cache_Config::OPID_MEDIA_IFRAME_LAZY,
|
688 |
+
LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZYJS_INLINE,
|
689 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_AUTO,
|
690 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_CRON,
|
691 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_ORI,
|
692 |
+
LiteSpeed_Cache_Config::OPT_MEDIA_RM_ORI_BKUP,
|
693 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_WEBP,
|
694 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_LOSSLESS,
|
695 |
LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_EXIF,
|
900 |
|
901 |
// Remove Object Cache
|
902 |
if ( $this->_options[ LiteSpeed_Cache_Config::OPID_DEBUG_DISABLE_ALL ] ) {
|
903 |
+
// Do a purge all (This is before oc file removal, can purge oc too)
|
904 |
+
LiteSpeed_Cache_Purge::purge_all( '[Settings] Debug Disabled ALL' ) ;
|
905 |
+
|
906 |
LiteSpeed_Cache_Log::debug( '[Settings] Remove .object_cache.ini due to debug_disable_all' ) ;
|
907 |
LiteSpeed_Cache_Object::get_instance()->del_file() ;
|
908 |
|
admin/litespeed-cache-admin.class.php
CHANGED
@@ -8,12 +8,16 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Admin
|
12 |
{
|
13 |
private static $_instance ;
|
14 |
private $config ;
|
15 |
private $display ;
|
16 |
-
private $main ;
|
17 |
|
18 |
/**
|
19 |
* Initialize the class and set its properties.
|
@@ -214,13 +218,16 @@ class LiteSpeed_Cache_Admin
|
|
214 |
}
|
215 |
|
216 |
if ( is_multisite() && ( ! is_network_admin() || ! current_user_can('manage_network_options')) ) {
|
217 |
-
$third = __('
|
218 |
}else {
|
219 |
-
$third = __('
|
220 |
}
|
221 |
-
$msg = __('
|
222 |
-
. __('LiteSpeed Cache does work with other
|
223 |
-
. $third
|
|
|
|
|
|
|
224 |
|
225 |
$this->display->add_notice(LiteSpeed_Cache_Admin_Display::NOTICE_YELLOW, $msg) ;
|
226 |
}
|
8 |
* @subpackage LiteSpeed_Cache/admin
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Admin
|
17 |
{
|
18 |
private static $_instance ;
|
19 |
private $config ;
|
20 |
private $display ;
|
|
|
21 |
|
22 |
/**
|
23 |
* Initialize the class and set its properties.
|
218 |
}
|
219 |
|
220 |
if ( is_multisite() && ( ! is_network_admin() || ! current_user_can('manage_network_options')) ) {
|
221 |
+
$third = __('If this is the case, the network admin may uncheck "Check Advanced Cache" in LiteSpeed Cache Advanced settings.', 'litespeed-cache') ;
|
222 |
}else {
|
223 |
+
$third = __('If this is the case, please uncheck "Check Advanced Cache" in LiteSpeed Cache Advanced settings.', 'litespeed-cache') ;
|
224 |
}
|
225 |
+
$msg = __('LiteSpeed has detected another plugin using the "Advanced Cache" file.', 'litespeed-cache') . ' '
|
226 |
+
. __('LiteSpeed Cache does work with other optimization plugins, but only if functionality is not duplicated. Only one full-page cache may be activated.', 'litespeed-cache') . ' '
|
227 |
+
. $third
|
228 |
+
. ' <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:customizations:multi-cache-plugins" target="_blank">'
|
229 |
+
. __( 'Learn More', 'litespeed-cache' )
|
230 |
+
. '</a>' ;
|
231 |
|
232 |
$this->display->add_notice(LiteSpeed_Cache_Admin_Display::NOTICE_YELLOW, $msg) ;
|
233 |
}
|
admin/tpl/api/quic.login.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
|
7 |
+
<h1 class="litespeed-title"><?php echo __('Quic Cloud User Panel', 'litespeed-cache') ; ?></h1>
|
8 |
+
|
9 |
+
<form method="post" action="admin.php" id="litespeed_form_quic" class="litespeed-relative">
|
10 |
+
<input type="hidden" name="<?php echo LiteSpeed_Cache::ACTION_KEY ; ?>" value="<?php echo LiteSpeed_Cache::ACTION_CDN_QUIC ; ?>" />
|
11 |
+
<input type="hidden" name="step" value="login" />
|
12 |
+
<input type="hidden" name="email" value="<?php echo $data[ 'email' ] ; ?>" />
|
13 |
+
<?php wp_nonce_field( LiteSpeed_Cache::ACTION_CDN_QUIC, LiteSpeed_Cache::NONCE_NAME ) ; ?>
|
14 |
+
|
15 |
+
<?php if ( ! empty( $data[ '_err' ] ) ) : ?>
|
16 |
+
<div class="litespeed-callout-danger">
|
17 |
+
<h4><?php echo __( 'ERROR', 'litespeed-cache' ) ; ?>:</h4>
|
18 |
+
<ol>
|
19 |
+
<li><?php echo $data[ '_err' ] ; ?></li>
|
20 |
+
</ol>
|
21 |
+
</div>
|
22 |
+
<?php endif ; ?>
|
23 |
+
|
24 |
+
<div class="litespeed-row">
|
25 |
+
<h4><?php echo __( 'Email', 'litespeed-cache' ) ; ?>:</h4>
|
26 |
+
<?php echo $data[ 'email' ] ; ?>
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<div class="litespeed-row">
|
30 |
+
<h4><?php echo __( 'Password', 'litespeed-cache' ) ; ?> <?php echo __( 'Or', 'litespeed-cache' ) ; ?> <?php echo __( 'User API Key', 'litespeed-cache' ) ; ?> :</h4>
|
31 |
+
<input type="password" name="pswd_or_key" class="litespeed-regular-text" value="<?php echo LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_CDN_QUIC_KEY ) ; ?>" />
|
32 |
+
</div>
|
33 |
+
|
34 |
+
<input type="submit" class="button litespeed-btn-success" value="<?php echo __( 'Login', 'litespeed-cache' ) ; ?>" />
|
35 |
+
|
36 |
+
<a href="javascript:;" onclick="window.history.back();" class="button litespeed-btn-primary litespeed-right"><?php echo __( 'Back', 'litespeed-cache' ) ; ?></a>
|
37 |
+
</form>
|
admin/tpl/api/quic.register.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
|
7 |
+
<h1 class="litespeed-title"><?php echo __('Quic Cloud User Panel', 'litespeed-cache') ; ?></h1>
|
8 |
+
|
9 |
+
<form method="post" action="admin.php" id="litespeed_form_quic" class="litespeed-relative">
|
10 |
+
<input type="hidden" name="<?php echo LiteSpeed_Cache::ACTION_KEY ; ?>" value="<?php echo LiteSpeed_Cache::ACTION_CDN_QUIC ; ?>" />
|
11 |
+
<input type="hidden" name="step" value="register" />
|
12 |
+
<input type="hidden" name="email" value="<?php echo $data[ 'email' ] ; ?>" />
|
13 |
+
<?php wp_nonce_field( LiteSpeed_Cache::ACTION_CDN_QUIC, LiteSpeed_Cache::NONCE_NAME ) ; ?>
|
14 |
+
|
15 |
+
<?php if ( ! empty( $data[ '_err' ] ) ) : ?>
|
16 |
+
<div class="litespeed-callout-danger">
|
17 |
+
<h4><?php echo __( 'ERROR', 'litespeed-cache' ) ; ?>:</h4>
|
18 |
+
<ol>
|
19 |
+
<li><?php echo $data[ '_err' ] ; ?></li>
|
20 |
+
</ol>
|
21 |
+
</div>
|
22 |
+
<?php endif ; ?>
|
23 |
+
|
24 |
+
<div class="litespeed-row">
|
25 |
+
<h4><?php echo __( 'Email', 'litespeed-cache' ) ; ?>:</h4>
|
26 |
+
<?php echo $data[ 'email' ] ; ?>
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<div class="litespeed-row">
|
30 |
+
<h4><?php echo __( 'Password', 'litespeed-cache' ) ; ?>:</h4>
|
31 |
+
<input type="password" name="pswd" class="litespeed-regular-text" required />
|
32 |
+
</div>
|
33 |
+
|
34 |
+
<input type="checkbox" class="form-check-input" id="exampleCheck1" required />
|
35 |
+
<label class="form-check-label" for="exampleCheck1">I agree to <a href="https://quic.cloud/agreement" target="_blank">QuicCloud's terms and conditions</a></label><br />
|
36 |
+
|
37 |
+
<input type="submit" class="button litespeed-btn-success" value="<?php echo __( 'Register', 'litespeed-cache' ) ; ?>" />
|
38 |
+
|
39 |
+
<a href="javascript:;" onclick="window.history.back();" class="button litespeed-btn-primary litespeed-right"><?php echo __( 'Back', 'litespeed-cache' ) ; ?></a>
|
40 |
+
|
41 |
+
</form>
|
admin/tpl/api/quic.user_welcome.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
|
7 |
+
<h1 class="litespeed-title"><?php echo __('Quic Cloud User Panel', 'litespeed-cache') ; ?></h1>
|
8 |
+
|
9 |
+
<form method="post" action="admin.php" id="litespeed_form_quic" class="litespeed-relative">
|
10 |
+
<input type="hidden" name="<?php echo LiteSpeed_Cache::ACTION_KEY ; ?>" value="<?php echo LiteSpeed_Cache::ACTION_CDN_QUIC ; ?>" />
|
11 |
+
<input type="hidden" name="step" value="check_email" />
|
12 |
+
<?php wp_nonce_field( LiteSpeed_Cache::ACTION_CDN_QUIC, LiteSpeed_Cache::NONCE_NAME ) ; ?>
|
13 |
+
|
14 |
+
<div class="litespeed-row">
|
15 |
+
<h4><?php echo __( 'Email', 'litespeed-cache' ) ; ?>:</h4>
|
16 |
+
<input type="text" name="email" value="<?php echo LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_CDN_QUIC_EMAIL ) ; ?>" class="litespeed-regular-text litespeed-input-large" required placeholder="<?php echo __( 'Email', 'litespeed-cache' ) ; ?>" />
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<input type="submit" class="button litespeed-btn-success" value="<?php echo __( 'Next', 'litespeed-cache' ) ; ?>" />
|
20 |
+
|
21 |
+
</form>
|
admin/tpl/image_optimization.php
CHANGED
@@ -12,50 +12,6 @@ list( $storage_data, $rm_log ) = $img_optm->storage_data() ;
|
|
12 |
|
13 |
list( $last_run, $is_running ) = $img_optm->cron_running( false ) ;
|
14 |
|
15 |
-
$_optm_summary_list = array(
|
16 |
-
'level' => array(
|
17 |
-
'title' => __( 'Level', 'litespeed-cache' ),
|
18 |
-
'must' => true,
|
19 |
-
),
|
20 |
-
'credit' => array(
|
21 |
-
'title' => __( 'Credit', 'litespeed-cache' ),
|
22 |
-
'desc' => __( 'Credit recovers with each successful pull.', 'litespeed-cache' ),
|
23 |
-
'must' => true,
|
24 |
-
),
|
25 |
-
'reduced' => array(
|
26 |
-
'title' => __( 'Total Reduction', 'litespeed-cache' ),
|
27 |
-
'type' => 'file_size',
|
28 |
-
),
|
29 |
-
'img_taken' => array(
|
30 |
-
'title' => __( 'Images pulled', 'litespeed-cache' ),
|
31 |
-
),
|
32 |
-
'fetch_failed' => array(
|
33 |
-
'title' => __( 'Images failed to fetch', 'litespeed-cache' ),
|
34 |
-
),
|
35 |
-
'notify_failed' => array(
|
36 |
-
'title' => __( 'Images failed to notify', 'litespeed-cache' ),
|
37 |
-
),
|
38 |
-
'pull_failed' => array(
|
39 |
-
'title' => __( 'Images failed to pull', 'litespeed-cache' ),
|
40 |
-
),
|
41 |
-
'last_requested' => array(
|
42 |
-
'title' => __( 'Last Request', 'litespeed-cache' ),
|
43 |
-
'type' => 'date',
|
44 |
-
),
|
45 |
-
) ;
|
46 |
-
|
47 |
-
// Guidance check
|
48 |
-
$current_step = false ;
|
49 |
-
if ( empty( $optm_summary[ 'level' ] ) || $optm_summary[ 'level' ] < 2 ) {
|
50 |
-
$current_step = $img_optm->get_guidance_pos() ;
|
51 |
-
}
|
52 |
-
$guidance_steps = array(
|
53 |
-
sprintf( __( 'Click the %s button.', 'litespeed-cache' ), '<font class="litespeed-success">' . __( 'Update Status', 'litespeed-cache' ) . '</font>' ),
|
54 |
-
sprintf( __( 'Click the %s button.', 'litespeed-cache' ), '<font class="litespeed-success">' . __( 'Send Optimization Request', 'litespeed-cache' ) . '</font>' ),
|
55 |
-
sprintf( __( 'Click the %s button or wait for the cron job to finish the pull action.', 'litespeed-cache' ), '<font class="litespeed-success">' . __( 'Pull Images', 'litespeed-cache' ) . '</font>' ),
|
56 |
-
__( 'Repeat the above steps until you have leveled up.', 'litespeed-cache' )
|
57 |
-
) ;
|
58 |
-
|
59 |
if ( ! empty( $img_count[ 'total_img' ] ) ) {
|
60 |
$finished_percentage = 100 - floor( $img_count[ 'total_not_requested' ] * 100 / $img_count[ 'total_img' ] ) ;
|
61 |
}
|
@@ -78,279 +34,13 @@ LiteSpeed_Cache_GUI::show_promo() ;
|
|
78 |
|
79 |
<div class="litespeed-wrap">
|
80 |
<div class="litespeed-body">
|
81 |
-
|
82 |
-
<?php
|
83 |
-
|
84 |
-
|
85 |
-
<h3 class="litespeed-title"><?php echo __('Optimization Summary', 'litespeed-cache') ; ?></h3>
|
86 |
-
|
87 |
-
<?php foreach ( $_optm_summary_list as $k => $v ) : ?>
|
88 |
-
<?php if ( isset( $optm_summary[ $k ] ) && ( $optm_summary[ $k ] || ! empty( $v[ 'must' ] ) ) ) : ?>
|
89 |
-
<p>
|
90 |
-
<?php echo $v[ 'title' ] ; ?>:
|
91 |
-
<b>
|
92 |
-
<?php
|
93 |
-
if ( ! empty( $v[ 'type' ] ) ) {
|
94 |
-
if ( $v[ 'type' ] == 'file_size' ) {
|
95 |
-
echo LiteSpeed_Cache_Utility::real_size( $optm_summary[ $k ] ) ;
|
96 |
-
}
|
97 |
-
if ( $v[ 'type' ] == 'date' ) {
|
98 |
-
echo LiteSpeed_Cache_Utility::readable_time( $optm_summary[ $k ] ) ;
|
99 |
-
}
|
100 |
-
}
|
101 |
-
else {
|
102 |
-
echo $optm_summary[ $k ] ;
|
103 |
-
}
|
104 |
-
|
105 |
-
if ( ! empty( $v[ 'desc' ] ) ) {
|
106 |
-
echo '<span class="litespeed-desc">' . $v[ 'desc' ] . '</span>' ;
|
107 |
-
}
|
108 |
-
?>
|
109 |
-
</b>
|
110 |
-
</p>
|
111 |
-
<?php endif ; ?>
|
112 |
-
<?php endforeach ; ?>
|
113 |
-
|
114 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_SYNC_DATA ) ; ?>" class="litespeed-btn-success">
|
115 |
-
<?php echo __( 'Update Status', 'litespeed-cache' ) ; ?>
|
116 |
-
</a>
|
117 |
-
<span class="litespeed-desc">
|
118 |
-
<?php echo __( 'This will communicate with LiteSpeed\'s Image Optimization Server and retrieve the most recent status.', 'litespeed-cache' ) ; ?>
|
119 |
-
</span>
|
120 |
-
|
121 |
-
<?php include_once LSCWP_DIR . "admin/tpl/inc/api_key.php" ; ?>
|
122 |
-
|
123 |
-
<h3 class="litespeed-title"><?php echo __('Image Information', 'litespeed-cache') ; ?></h3>
|
124 |
-
|
125 |
-
<div class="litespeed-block-tiny">
|
126 |
-
<div class="litespeed-col-auto">
|
127 |
-
<?php echo LiteSpeed_Cache_GUI::pie( $finished_percentage, 100, true ) ; ?>
|
128 |
-
</div>
|
129 |
-
|
130 |
-
<div class="litespeed-col-auto">
|
131 |
-
<p>
|
132 |
-
<?php echo __( 'Images total', 'litespeed-cache') ; ?>:
|
133 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'total_img' ] ) ; ?></b>
|
134 |
-
<a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:image-optimization:image-groups" target="_blank" class="litespeed-desc litespeed-left20"><?php echo __( 'What is a group?', 'litespeed-cache') ; ?></a>
|
135 |
-
</p>
|
136 |
-
<p>
|
137 |
-
<?php echo __('Images not yet requested', 'litespeed-cache') ; ?>:
|
138 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'total_not_requested' ] ) ; ?></b>
|
139 |
-
</p>
|
140 |
-
</div>
|
141 |
-
</div>
|
142 |
-
|
143 |
-
<?php if ( $img_count[ 'total_not_requested' ] ) : ?>
|
144 |
-
<?php if ( empty( $optm_summary[ 'level' ] ) ) : ?>
|
145 |
-
<a href="#" class="litespeed-btn-default disabled">
|
146 |
-
<?php echo __( 'Send Optimization Request', 'litespeed-cache' ) ; ?>
|
147 |
-
</a>
|
148 |
-
<span class="litespeed-desc">
|
149 |
-
<?php echo sprintf( __( 'Please press the %s button before sending a new request.', 'litespeed-cache' ), __( 'Update Status', 'litespeed-cache' ) ) ; ?>
|
150 |
-
</span>
|
151 |
-
<a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:image-optimization#image_optimization_in_litespeed_cache_for_wordpress" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
|
152 |
-
<?php else : ?>
|
153 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTIMIZE ) ; ?>" class="litespeed-btn-success">
|
154 |
-
<?php echo __( 'Send Optimization Request', 'litespeed-cache' ) ; ?>
|
155 |
-
</a>
|
156 |
-
<span class="litespeed-desc">
|
157 |
-
<?php echo __( 'This will send the optimization request and the images to LiteSpeed\'s Image Optimization Server.', 'litespeed-cache' ) ; ?>
|
158 |
-
<?php echo sprintf( __( 'You can send at most %s images at once.', 'litespeed-cache' ), '<code>' . $optm_summary[ 'credit' ] . '</code>' ) ; ?>
|
159 |
-
</span>
|
160 |
-
<?php endif ; ?>
|
161 |
-
<?php endif ; ?>
|
162 |
-
|
163 |
-
<hr />
|
164 |
-
|
165 |
-
<p>
|
166 |
-
<?php echo __('Images requested', 'litespeed-cache') ; ?>:
|
167 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_REQUESTED ] ) ; ?></b>
|
168 |
-
(<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_REQUESTED ], 'image' ) ; ?></b>)
|
169 |
-
</p>
|
170 |
-
<p class="litespeed-desc">
|
171 |
-
<?php echo __( 'After LiteSpeed\'s Image Optimization Server finishes optimization, it will notify your site to pull the optimized images.', 'litespeed-cache' ) ; ?>
|
172 |
-
<?php echo __( 'This process is automatic.', 'litespeed-cache' ) ; ?>
|
173 |
-
</p>
|
174 |
-
<p>
|
175 |
-
<?php echo __('Images notified to pull', 'litespeed-cache') ; ?>:
|
176 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ] ) ; ?></b>
|
177 |
-
(<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ], 'image' ) ; ?></b>)
|
178 |
-
|
179 |
-
<?php if ( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ] && ! $is_running ) : ?>
|
180 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_PULL ) ; ?>" class="litespeed-btn-success">
|
181 |
-
<?php echo __( 'Pull Images', 'litespeed-cache' ) ; ?>
|
182 |
-
</a>
|
183 |
-
<span class="litespeed-desc">
|
184 |
-
<?php echo __( 'Only press the button if the pull cron job is disabled.', 'litespeed-cache' ) ; ?>
|
185 |
-
<?php echo __( 'Images will be pulled automatically if the cron job is running.', 'litespeed-cache' ) ; ?>
|
186 |
-
</span>
|
187 |
-
<?php elseif ( $last_run ) : ?>
|
188 |
-
<span class="litespeed-desc">
|
189 |
-
<?php echo sprintf( __( 'Last pull initiated by cron at %s.', 'litespeed-cache' ), '<code>' . LiteSpeed_Cache_Utility::readable_time( $last_run ) . '</code>' ) ; ?>
|
190 |
-
</span>
|
191 |
-
<?php endif ; ?>
|
192 |
-
</p>
|
193 |
-
<p>
|
194 |
-
<?php echo __('Images optimized and pulled', 'litespeed-cache') ; ?>:
|
195 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_PULLED ] ) ; ?></b>
|
196 |
-
(<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_PULLED ], 'image' ) ; ?></b>)
|
197 |
-
</p>
|
198 |
-
|
199 |
-
<div class="litespeed-desc litespeed-left20">
|
200 |
-
<p>
|
201 |
-
<?php echo __('Images failed to fetch', 'litespeed-cache') ; ?>:
|
202 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_FETCH ] ) ; ?></b>
|
203 |
-
(<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_FETCH ], 'image' ) ; ?></b>)
|
204 |
-
</p>
|
205 |
-
<p>
|
206 |
-
<?php echo __('Images failed to optimize', 'litespeed-cache') ; ?>:
|
207 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_OPTM ] ) ; ?></b>
|
208 |
-
(<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_OPTM ], 'image' ) ; ?></b>)
|
209 |
-
</p>
|
210 |
-
<p>
|
211 |
-
<?php echo __('Images failed with other errors', 'litespeed-cache') ; ?>:
|
212 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR ] ) ; ?></b>
|
213 |
-
(<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR ], 'image' ) ; ?></b>)
|
214 |
-
</p>
|
215 |
-
<p>
|
216 |
-
<?php echo __('Image files missing', 'litespeed-cache') ; ?>:
|
217 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_MISS ] ) ; ?></b>
|
218 |
-
(<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_MISS ], 'image' ) ; ?></b>)
|
219 |
-
</p>
|
220 |
-
<p>
|
221 |
-
<?php echo __('Images with wrong meta', 'litespeed-cache') ; ?>:
|
222 |
-
<b><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_XMETA ] ) ; ?></b>
|
223 |
-
</p>
|
224 |
-
</div>
|
225 |
-
|
226 |
-
<p><a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:image-optimization#image_optimization_in_litespeed_cache_for_wordpress" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a></p>
|
227 |
-
|
228 |
-
<hr />
|
229 |
-
|
230 |
-
<?php if ( ! empty( $optm_summary[ 'level' ] ) ) : ?>
|
231 |
-
<h3 class="litespeed-title"><?php echo __('Revert Optimization', 'litespeed-cache') ; ?></h3>
|
232 |
-
|
233 |
-
<span class="litespeed-desc">
|
234 |
-
<?php echo __( 'Switch all images in the media library back to their original unoptimized versions.', 'litespeed-cache' ) ; ?>
|
235 |
-
</span>
|
236 |
-
|
237 |
-
<br />
|
238 |
-
|
239 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_BATCH_SWITCH_ORI ) ; ?>" class="litespeed-btn-warning">
|
240 |
-
<?php echo __( 'Undo Optimization', 'litespeed-cache' ) ; ?>
|
241 |
-
</a>
|
242 |
-
<span class="litespeed-desc">
|
243 |
-
<?php echo __( 'Revert all optimized images back to their original versions.', 'litespeed-cache' ) ; ?>
|
244 |
-
</span>
|
245 |
-
|
246 |
-
<br />
|
247 |
-
|
248 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_BATCH_SWITCH_OPTM ) ; ?>" class="litespeed-btn-success">
|
249 |
-
<?php echo __( 'Re-do Optimization', 'litespeed-cache' ) ; ?>
|
250 |
-
</a>
|
251 |
-
<span class="litespeed-desc">
|
252 |
-
<?php echo __( 'Switch back to using optimized images.', 'litespeed-cache' ) ; ?>
|
253 |
-
</span>
|
254 |
-
|
255 |
-
<br />
|
256 |
-
<p>
|
257 |
-
<?php echo sprintf( __( 'Results can be checked in <a %s>Media Library</a>.', 'litespeed-cache' ), 'href="upload.php?mode=list"' ) ; ?>
|
258 |
-
</p>
|
259 |
-
|
260 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTIMIZE_RESCAN ) ; ?>" class="litespeed-btn-success litespeed-hide">
|
261 |
-
<?php echo __( 'Send New Thumbnail Requests', 'litespeed-cache' ) ; ?>
|
262 |
-
</a>
|
263 |
-
<span class="litespeed-desc litespeed-hide">
|
264 |
-
<?php echo __( 'Scan for any new unoptimized image thumbnail sizes and resend necessary image optimization requests.', 'litespeed-cache' ) ; ?>
|
265 |
-
</span>
|
266 |
-
|
267 |
-
<br />
|
268 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IAPI, LiteSpeed_Cache_Admin_API::TYPE_RESET_KEY ) ; ?>" class="litespeed-btn-warning">
|
269 |
-
<?php echo __( 'Reset IAPI Key', 'litespeed-cache' ) ; ?>
|
270 |
-
</a>
|
271 |
-
<span class="litespeed-desc">
|
272 |
-
<?php echo __( 'The current IAPI key must be reset after changing home URL or domain before making any further optimization requests.', 'litespeed-cache' ) ; ?>
|
273 |
-
</span>
|
274 |
-
|
275 |
-
<br />
|
276 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTM_DESTROY_UNFINISHED ) ; ?>" class="litespeed-btn-warning">
|
277 |
-
<?php echo __( 'Clean Up Unfinished Data', 'litespeed-cache' ) ; ?>
|
278 |
-
</a>
|
279 |
-
<span class="litespeed-desc">
|
280 |
-
<?php echo __( 'Remove all previous unfinished image optimization requests.', 'litespeed-cache' ) ; ?>
|
281 |
-
</span>
|
282 |
-
|
283 |
-
<br />
|
284 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTM_DESTROY ) ; ?>" class="litespeed-btn-danger">
|
285 |
-
<?php echo __( 'Destroy All Optimization Data!', 'litespeed-cache' ) ; ?>
|
286 |
-
</a>
|
287 |
-
<span class="litespeed-desc">
|
288 |
-
<?php echo __( 'Remove all previous image optimization requests/results, revert completed optimizations, and delete all optimization files.', 'litespeed-cache' ) ; ?>
|
289 |
-
<font class="litespeed-warning">
|
290 |
-
<?php echo __('NOTE', 'litespeed-cache'); ?>:
|
291 |
-
<?php echo __( 'This will also reset the credit level.', 'litespeed-cache' ) ; ?>
|
292 |
-
</font>
|
293 |
-
</span>
|
294 |
-
|
295 |
-
<hr />
|
296 |
-
|
297 |
-
<h3 class="litespeed-title"><?php echo __('Storage Optimization', 'litespeed-cache') ; ?></h3>
|
298 |
-
|
299 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_CALC_BKUP ) ; ?>" class="litespeed-btn-success">
|
300 |
-
<?php echo __( 'Calculate Original Image Storage', 'litespeed-cache' ) ; ?>
|
301 |
-
</a>
|
302 |
-
<span class="litespeed-desc">
|
303 |
-
<?php echo __( 'A backup of each image is saved before it is optimized. This button will calculate the total amount of disk space used by these backups.', 'litespeed-cache' ) ; ?>
|
304 |
-
</span>
|
305 |
-
<?php if ( $storage_data ) : ?>
|
306 |
-
<div class="litespeed-desc litespeed-left20">
|
307 |
-
<p>
|
308 |
-
<?php echo __( 'Last calculated', 'litespeed-cache' ) . ': <code>' . LiteSpeed_Cache_Utility::readable_time( $storage_data[ 'date' ] ) . '</code>' ; ?>
|
309 |
-
</p>
|
310 |
-
<?php if ( $storage_data[ 'count' ] ) : ?>
|
311 |
-
<p>
|
312 |
-
<?php echo __( 'Files', 'litespeed-cache' ) . ': <code>' . $storage_data[ 'count' ] . '</code>' ; ?>
|
313 |
-
</p>
|
314 |
-
<p>
|
315 |
-
<?php echo __( 'Total', 'litespeed-cache' ) . ': <code>' . LiteSpeed_Cache_Utility::real_size( $storage_data[ 'sum' ] ) . '</code>' ; ?>
|
316 |
-
</p>
|
317 |
<?php else : ?>
|
318 |
-
|
319 |
-
<?php echo LiteSpeed_Cache_GUI::pie( 100, 30, true ) ; ?>
|
320 |
-
</p>
|
321 |
<?php endif ; ?>
|
322 |
-
|
323 |
-
<?php endif ; ?>
|
324 |
-
|
325 |
-
<br />
|
326 |
-
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_RM_BKUP ) ; ?>" data-litespeed-cfm="<?php echo __( 'Are you sure to remove all image backups?', 'litespeed-cache' ) ; ?>" class="litespeed-btn-danger">
|
327 |
-
<?php echo __( 'Remove Original Image Backups', 'litespeed-cache' ) ; ?>
|
328 |
-
</a>
|
329 |
-
<span class="litespeed-desc">
|
330 |
-
<?php echo __( 'This will delete all of the backups of the original images.', 'litespeed-cache' ) ; ?>
|
331 |
-
<font class="litespeed-danger">
|
332 |
-
<?php echo __('WARNING', 'litespeed-cache'); ?>:
|
333 |
-
<?php echo __( 'This is irreversible.', 'litespeed-cache' ) ; ?>
|
334 |
-
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ) ; ?>
|
335 |
-
</font>
|
336 |
-
</span>
|
337 |
-
<?php if ( $rm_log ) : ?>
|
338 |
-
<div class="litespeed-desc litespeed-left20">
|
339 |
-
<p>
|
340 |
-
<?php echo __( 'Last ran', 'litespeed-cache' ) . ': <code>' . LiteSpeed_Cache_Utility::readable_time( $rm_log[ 'date' ] ) . '</code>' ; ?>
|
341 |
-
</p>
|
342 |
-
<p>
|
343 |
-
<?php echo __( 'Files', 'litespeed-cache' ) . ': <code>' . $rm_log[ 'count' ] . '</code>' ; ?>
|
344 |
-
</p>
|
345 |
-
<p>
|
346 |
-
<?php echo __( 'Saved', 'litespeed-cache' ) . ': <code>' . LiteSpeed_Cache_Utility::real_size( $rm_log[ 'sum' ] ) . '</code>' ; ?>
|
347 |
-
</p>
|
348 |
-
</div>
|
349 |
-
<?php endif ; ?>
|
350 |
-
|
351 |
-
|
352 |
-
<?php endif ; ?>
|
353 |
-
|
354 |
-
|
355 |
</div>
|
|
|
356 |
</div>
|
12 |
|
13 |
list( $last_run, $is_running ) = $img_optm->cron_running( false ) ;
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
if ( ! empty( $img_count[ 'total_img' ] ) ) {
|
16 |
$finished_percentage = 100 - floor( $img_count[ 'total_not_requested' ] * 100 / $img_count[ 'total_img' ] ) ;
|
17 |
}
|
34 |
|
35 |
<div class="litespeed-wrap">
|
36 |
<div class="litespeed-body">
|
37 |
+
<div class="litespeed-flex-container">
|
38 |
+
<?php if ( ! $optm_summary ) : ?>
|
39 |
+
<?php include_once LSCWP_DIR . "admin/tpl/inc/img_optm.initialize.php" ; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php else : ?>
|
41 |
+
<?php include_once LSCWP_DIR . "admin/tpl/inc/img_optm.summary.php" ; ?>
|
|
|
|
|
42 |
<?php endif ; ?>
|
43 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
</div>
|
45 |
+
|
46 |
</div>
|
admin/tpl/inc/api_key.php
CHANGED
@@ -5,10 +5,9 @@ $api_key = get_option( LiteSpeed_Cache_Admin_API::DB_API_KEY ) ;
|
|
5 |
|
6 |
?>
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
<?php endif ; ?>
|
14 |
|
5 |
|
6 |
?>
|
7 |
|
8 |
+
<?php if ( ! $api_key ) : ?>
|
9 |
+
<p class="litespeed-desc">
|
10 |
+
<?php echo __( 'This will also generate an API key from LiteSpeed\'s Server.', 'litespeed-cache' ) ; ?>
|
11 |
+
</p>
|
12 |
+
<?php endif ; ?>
|
|
|
13 |
|
admin/tpl/inc/check_cache_disabled.php
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
-
<?php
|
2 |
if ( ! defined( 'WPINC' ) ) die ;
|
3 |
|
4 |
$reasons = array() ;
|
5 |
|
6 |
if ( ! defined( 'LITESPEED_ALLOWED' ) ) {
|
7 |
$reasons[] = array(
|
8 |
-
'title' => __( 'LSCache Module is disabled.', 'litespeed-cache' ),
|
9 |
'link' => 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:installation',
|
10 |
) ;
|
11 |
}
|
12 |
|
13 |
if ( ! defined( 'LITESPEED_ON_IN_SETTING' ) ) {
|
14 |
$reasons[] = array(
|
15 |
-
'title' => __( 'LiteSpeed
|
16 |
'link' => 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:general#enable_litespeed_cache',
|
17 |
) ;
|
18 |
}
|
19 |
|
20 |
if ( ! $reasons && ! defined( 'LITESPEED_ON' ) ) {
|
21 |
$reasons[] = array(
|
22 |
-
'title' => __( 'LiteSpeed
|
23 |
-
'link' => 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:
|
24 |
) ;
|
25 |
}
|
26 |
|
@@ -31,7 +31,7 @@ if ( $reasons ) :
|
|
31 |
<h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
|
32 |
|
33 |
<p>
|
34 |
-
<?php echo __( '
|
35 |
</p>
|
36 |
|
37 |
<ul class="litespeed-list">
|
@@ -39,7 +39,7 @@ if ( $reasons ) :
|
|
39 |
<li>
|
40 |
<?php echo $v[ 'title' ] ; ?>
|
41 |
|
42 |
-
<a href="<?php echo $v[ 'link' ] ; ?>" target="_blank" class="litespeed-learn-more"><?php echo __( 'How to
|
43 |
</li>
|
44 |
<?php endforeach ; ?>
|
45 |
</ul>
|
1 |
+
<?php
|
2 |
if ( ! defined( 'WPINC' ) ) die ;
|
3 |
|
4 |
$reasons = array() ;
|
5 |
|
6 |
if ( ! defined( 'LITESPEED_ALLOWED' ) ) {
|
7 |
$reasons[] = array(
|
8 |
+
'title' => __( 'The LSCache Module is disabled at the server level.', 'litespeed-cache' ),
|
9 |
'link' => 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:installation',
|
10 |
) ;
|
11 |
}
|
12 |
|
13 |
if ( ! defined( 'LITESPEED_ON_IN_SETTING' ) ) {
|
14 |
$reasons[] = array(
|
15 |
+
'title' => __( 'LiteSpeed Cache is disabled in the plugin settings.', 'litespeed-cache' ) ,
|
16 |
'link' => 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:general#enable_litespeed_cache',
|
17 |
) ;
|
18 |
}
|
19 |
|
20 |
if ( ! $reasons && ! defined( 'LITESPEED_ON' ) ) {
|
21 |
$reasons[] = array(
|
22 |
+
'title' => __( 'LiteSpeed Cache is disabled.', 'litespeed-cache' ) ,
|
23 |
+
'link' => 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:troubleshooting:lscache-is-disabled',
|
24 |
) ;
|
25 |
}
|
26 |
|
31 |
<h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
|
32 |
|
33 |
<p>
|
34 |
+
<?php echo __( 'Caching functions on this page are currently unavailable!', 'litespeed-cache' ) ; ?>
|
35 |
</p>
|
36 |
|
37 |
<ul class="litespeed-list">
|
39 |
<li>
|
40 |
<?php echo $v[ 'title' ] ; ?>
|
41 |
|
42 |
+
<a href="<?php echo $v[ 'link' ] ; ?>" target="_blank" class="litespeed-learn-more"><?php echo __( 'Learn How to Fix It', 'litespeed-cache' ) ; ?></a>
|
43 |
</li>
|
44 |
<?php endforeach ; ?>
|
45 |
</ul>
|
admin/tpl/inc/img_optm.communicate_notify.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
|
6 |
+
?>
|
7 |
+
|
8 |
+
<span class="litespeed-desc">
|
9 |
+
<?php echo __( 'This will communicate with LiteSpeed\'s Image Optimization Server and retrieve the most recent status.', 'litespeed-cache' ) ; ?>
|
10 |
+
</span>
|
admin/tpl/inc/img_optm.initialize.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
|
6 |
+
?>
|
7 |
+
|
8 |
+
<div class="litespeed-width-7-10">
|
9 |
+
<div class="litespeed-empty-space-large"></div>
|
10 |
+
<div class="litespeed-text-center">
|
11 |
+
<div>
|
12 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_SYNC_DATA ) ; ?>" class="litespeed-text-malibu litespeed-btn-success litespeed-btn-large">
|
13 |
+
<span class="dashicons dashicons-performance">
|
14 |
+
</span>
|
15 |
+
<?php echo __( 'Initialize Optimization', 'litespeed-cache' ) ; ?>
|
16 |
+
</a>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
<div class="litespeed-empty-space-medium"></div>
|
20 |
+
<div>
|
21 |
+
<h2 Class="litespeed-title">
|
22 |
+
<?php echo __( 'Notes', 'litespeed-cache' ) ; ?>:
|
23 |
+
</h2>
|
24 |
+
|
25 |
+
<?php include_once LSCWP_DIR . "admin/tpl/inc/img_optm.communicate_notify.php" ; ?>
|
26 |
+
|
27 |
+
<?php include_once LSCWP_DIR . "admin/tpl/inc/api_key.php" ; ?>
|
28 |
+
|
29 |
+
<a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:image-optimization#image_optimization_in_litespeed_cache_for_wordpress" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
|
30 |
+
|
31 |
+
<hr class="litespeed-hr-dotted">
|
32 |
+
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<div class="litespeed-width-3-10 litespeed-column-java">
|
37 |
+
<?php include_once LSCWP_DIR . "admin/tpl/inc/img_optm.percentage_summary.php" ; ?>
|
38 |
+
</div>
|
admin/tpl/inc/img_optm.level_info.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
|
6 |
+
if ( empty( $optm_summary[ 'level' ] ) ) {
|
7 |
+
return ;
|
8 |
+
}
|
9 |
+
?>
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
<?php
|
16 |
+
if ( $optm_summary[ 'level' ] >= 5 || empty( $optm_summary[ '_level_data' ] ) ) {
|
17 |
+
return ;
|
18 |
+
}
|
19 |
+
|
20 |
+
$next_level = $optm_summary[ 'level' ] + 1 ;
|
21 |
+
$next_level_data = $optm_summary[ '_level_data' ][ $next_level ] ;
|
22 |
+
|
23 |
+
$_progress = floor( $optm_summary[ 'credit_recovered' ] * 100 / $next_level_data[ 0 ] ) ;
|
24 |
+
?>
|
25 |
+
|
26 |
+
<div class="litespeed-progress">
|
27 |
+
<div class="litespeed-progress-bar litespeed-progress-bar-blue" role="progressbar" style="width: <?php echo $_progress ; ?>%" aria-valuenow="<?php echo $_progress ; ?>" aria-valuemin="0" aria-valuemax="100"></div>
|
28 |
+
</div>
|
29 |
+
<div class="litespeed-flex-container" style="margin-top:none;">
|
30 |
+
<div class="litespeed-width-1-2">
|
31 |
+
<span class="litespeed-text-malibu" style="font-weight: 600;">
|
32 |
+
<?php echo __( 'Level', 'litespeed-cache' ) ; ?>: <font><?php echo $optm_summary[ 'level' ] ; ?></font>
|
33 |
+
<span class="litespeed-left20"></span>
|
34 |
+
<?php echo __( 'Credit', 'litespeed-cache' ) ; ?>: <font><?php echo $optm_summary[ 'credit' ] ; ?></font>
|
35 |
+
<span class="litespeed-left20"></span>
|
36 |
+
</span>
|
37 |
+
<span class="litespeed-desc"><?php echo __( 'Credit recovers with each successful pull.', 'litespeed-cache' ) ; ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="litespeed-width-1-2">
|
40 |
+
<span class="litespeed-silence">
|
41 |
+
<?php echo __( 'Next Level', 'litespeed-cache' ) ; ?>: <?php echo $next_level ; ?>
|
42 |
+
<span class="litespeed-left20 litespeed-empty-space-small"></span>
|
43 |
+
<?php echo __( 'Next Level Credit', 'litespeed-cache' ) ; ?>: <?php echo $next_level_data[ 1 ] ; ?>
|
44 |
+
</span>
|
45 |
+
</div>
|
46 |
+
</div>
|
admin/tpl/inc/img_optm.percentage_summary.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
|
6 |
+
?>
|
7 |
+
|
8 |
+
<h3 class="litespeed-title">
|
9 |
+
<?php echo __( 'Image Information', 'litespeed-cache' ) ; ?>
|
10 |
+
</h3>
|
11 |
+
|
12 |
+
<div class="litespeed-flex-container">
|
13 |
+
<div class="litespeed-icon-vertical-middle">
|
14 |
+
<?php echo LiteSpeed_Cache_GUI::pie( $finished_percentage, 100, true ) ; ?>
|
15 |
+
</div>
|
16 |
+
<div>
|
17 |
+
<p>
|
18 |
+
<?php echo __( 'Images total', 'litespeed-cache') ; ?>:
|
19 |
+
|
20 |
+
<code><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'total_img' ] ) ; ?></code>
|
21 |
+
|
22 |
+
<a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:image-optimization:image-groups" target="_blank" class="litespeed-desc litespeed-left20" title="<?php echo __( 'What is a group?', 'litespeed-cache') ; ?>">?</a>
|
23 |
+
</p>
|
24 |
+
<p>
|
25 |
+
<?php if ( ! empty( $img_count[ 'total_not_requested' ] ) ) : ?>
|
26 |
+
<?php echo __('Images not yet requested', 'litespeed-cache') ; ?>:
|
27 |
+
<code><?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'total_not_requested' ] ) ; ?></code>
|
28 |
+
<?php else : ?>
|
29 |
+
<font class="litespeed-congratulate"><?php echo __('Congratulations, all done!', 'litespeed-cache') ; ?></font>
|
30 |
+
<?php endif ; ?>
|
31 |
+
</p>
|
32 |
+
</div>
|
33 |
+
</div>
|
admin/tpl/inc/img_optm.summary.php
ADDED
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
|
6 |
+
?>
|
7 |
+
|
8 |
+
<div class="litespeed-width-7-10">
|
9 |
+
<div class="litespeed-empty-space-small"></div>
|
10 |
+
|
11 |
+
<?php if ( $img_count[ 'total_not_requested' ] ) : ?>
|
12 |
+
<div class="litespeed-text-center">
|
13 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTIMIZE ) ; ?>" class="litespeed-btn-success litespeed-btn-large">
|
14 |
+
<span class="dashicons dashicons-images-alt2"></span> <?php echo __( 'Send Optimization Request', 'litespeed-cache' ) ; ?>
|
15 |
+
</a>
|
16 |
+
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<div class="litespeed-empty-space-small"></div>
|
20 |
+
|
21 |
+
<div class="litespeed-desc">
|
22 |
+
<?php echo __( 'This will send the optimization request and the images to LiteSpeed\'s Image Optimization Server.', 'litespeed-cache' ) ; ?>
|
23 |
+
<?php echo sprintf( __( 'You can send at most %s images at once.', 'litespeed-cache' ), '<code>' . $optm_summary[ 'credit' ] . '</code>' ) ; ?>
|
24 |
+
</div>
|
25 |
+
<?php endif ; ?>
|
26 |
+
|
27 |
+
<?php if ( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ] && ! $is_running ) : ?>
|
28 |
+
<div>
|
29 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_PULL ) ; ?>" class="litespeed-btn-success" title="<?php echo __( 'Only press the button if the pull cron job is disabled.', 'litespeed-cache' ) ; ?> <?php echo __( 'Images will be pulled automatically if the cron job is running.', 'litespeed-cache' ) ; ?>">
|
30 |
+
<?php echo __( 'Pull Images', 'litespeed-cache' ) ; ?>
|
31 |
+
</a>
|
32 |
+
</div>
|
33 |
+
<?php endif ; ?>
|
34 |
+
|
35 |
+
<div class="litespeed-empty-space-medium"></div>
|
36 |
+
|
37 |
+
<div>
|
38 |
+
<h2 Class="litespeed-title">
|
39 |
+
<?php echo __( 'Current Stage Status', 'litespeed-cache' ) ; ?>
|
40 |
+
</h2>
|
41 |
+
<div class="litespeed-empty-space-medium"></div>
|
42 |
+
<?php include_once LSCWP_DIR . "admin/tpl/inc/img_optm.level_info.php" ; ?>
|
43 |
+
|
44 |
+
<hr class="litespeed-hr-dotted">
|
45 |
+
|
46 |
+
<div class="litespeed-empty-space-small"></div>
|
47 |
+
|
48 |
+
<div class="litespeed-light-code">
|
49 |
+
|
50 |
+
<?php if ( ! empty( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_REQUESTED ] ) ) : ?>
|
51 |
+
<p class="litespeed-success">
|
52 |
+
<?php echo __('Images requested', 'litespeed-cache') ; ?>:
|
53 |
+
<code>
|
54 |
+
<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_REQUESTED ] ) ; ?>
|
55 |
+
(<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_REQUESTED ], 'image' ) ; ?>)
|
56 |
+
</code>
|
57 |
+
</p>
|
58 |
+
<p class="litespeed-desc">
|
59 |
+
<?php echo __( 'After LiteSpeed\'s Image Optimization Server finishes optimization, it will notify your site to pull the optimized images.', 'litespeed-cache' ) ; ?>
|
60 |
+
<?php echo __( 'This process is automatic.', 'litespeed-cache' ) ; ?>
|
61 |
+
</p>
|
62 |
+
<?php endif ; ?>
|
63 |
+
|
64 |
+
<?php if ( ! empty( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ] ) ) : ?>
|
65 |
+
<p class="litespeed-success">
|
66 |
+
<?php echo __('Images notified to pull', 'litespeed-cache') ; ?>:
|
67 |
+
<code>
|
68 |
+
<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ] ) ; ?>
|
69 |
+
(<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ], 'image' ) ; ?>)
|
70 |
+
</code>
|
71 |
+
|
72 |
+
</p>
|
73 |
+
<?php if ( $last_run ) : ?>
|
74 |
+
<p class="litespeed-desc">
|
75 |
+
<?php echo sprintf( __( 'Last pull initiated by cron at %s.', 'litespeed-cache' ), '<code>' . LiteSpeed_Cache_Utility::readable_time( $last_run ) . '</code>' ) ; ?>
|
76 |
+
</p>
|
77 |
+
<?php endif ; ?>
|
78 |
+
<?php endif ; ?>
|
79 |
+
|
80 |
+
<div class="litespeed-empty-space-small"></div>
|
81 |
+
|
82 |
+
<div class="litespeed-flex-container">
|
83 |
+
|
84 |
+
<div class="litespeed-width-1-2">
|
85 |
+
|
86 |
+
<?php if ( ! empty( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_PULLED ] ) ) : ?>
|
87 |
+
<p class="litespeed-success">
|
88 |
+
<?php echo __('Images optimized and pulled', 'litespeed-cache') ; ?>:
|
89 |
+
<code>
|
90 |
+
<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_PULLED ] ) ; ?>
|
91 |
+
(<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_PULLED ], 'image' ) ; ?>)
|
92 |
+
</code>
|
93 |
+
</p>
|
94 |
+
<?php endif ; ?>
|
95 |
+
|
96 |
+
<div class="litespeed-silence">
|
97 |
+
<?php if ( ! empty( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_FETCH ] ) ) : ?>
|
98 |
+
<p>
|
99 |
+
<?php echo __('Images failed to fetch', 'litespeed-cache') ; ?>:
|
100 |
+
<code>
|
101 |
+
<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_FETCH ] ) ; ?>
|
102 |
+
(<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_FETCH ], 'image' ) ; ?>)
|
103 |
+
</code>
|
104 |
+
</p>
|
105 |
+
<?php endif ; ?>
|
106 |
+
|
107 |
+
<?php if ( ! empty( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_OPTM ] ) ) : ?>
|
108 |
+
<p>
|
109 |
+
<?php echo __('Images previously optimized', 'litespeed-cache') ; ?>:
|
110 |
+
<code>
|
111 |
+
<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_OPTM ] ) ; ?>
|
112 |
+
(<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR_OPTM ], 'image' ) ; ?>)
|
113 |
+
</code>
|
114 |
+
</p>
|
115 |
+
<?php endif ; ?>
|
116 |
+
|
117 |
+
<?php if ( ! empty( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR ] ) ) : ?>
|
118 |
+
<p>
|
119 |
+
<?php echo __('Images failed with other errors', 'litespeed-cache') ; ?>:
|
120 |
+
<code>
|
121 |
+
<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR ] ) ; ?>
|
122 |
+
(<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_ERR ], 'image' ) ; ?>)
|
123 |
+
</code>
|
124 |
+
</p>
|
125 |
+
<?php endif ; ?>
|
126 |
+
|
127 |
+
<?php if ( ! empty( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_MISS ] ) ) : ?>
|
128 |
+
<p>
|
129 |
+
<?php echo __('Image files missing', 'litespeed-cache') ; ?>:
|
130 |
+
<code>
|
131 |
+
<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_MISS ] ) ; ?>
|
132 |
+
(<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_MISS ], 'image' ) ; ?>)
|
133 |
+
</code>
|
134 |
+
</p>
|
135 |
+
<?php endif ; ?>
|
136 |
+
|
137 |
+
<?php if ( ! empty( $img_count[ 'group.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_XMETA ] ) ) : ?>
|
138 |
+
<p>
|
139 |
+
<?php echo __('Images with wrong meta', 'litespeed-cache') ; ?>:
|
140 |
+
<code>
|
141 |
+
<?php echo LiteSpeed_Cache_Admin_Display::print_plural( $img_count[ 'img.' . LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS_XMETA ] ) ; ?>
|
142 |
+
</code>
|
143 |
+
</p>
|
144 |
+
<?php endif ; ?>
|
145 |
+
|
146 |
+
<?php if ( ! empty( $optm_summary[ 'fetch_failed' ] ) ) : ?>
|
147 |
+
<p>
|
148 |
+
<?php echo __( 'Images failed to fetch', 'litespeed-cache' ) ; ?>: <code><?php echo $optm_summary[ 'fetch_failed' ] ; ?></code>
|
149 |
+
</p>
|
150 |
+
<?php endif ; ?>
|
151 |
+
|
152 |
+
<?php if ( ! empty( $optm_summary[ 'notify_failed' ] ) ) : ?>
|
153 |
+
<p>
|
154 |
+
<?php echo __( 'Images failed to notify', 'litespeed-cache' ) ; ?>: <code><?php echo $optm_summary[ 'notify_failed' ] ; ?></code>
|
155 |
+
</p>
|
156 |
+
<?php endif ; ?>
|
157 |
+
|
158 |
+
<?php if ( ! empty( $optm_summary[ 'pull_failed' ] ) ) : ?>
|
159 |
+
<p>
|
160 |
+
<?php echo __( 'Images failed to pull', 'litespeed-cache' ) ; ?>: <code><?php echo $optm_summary[ 'pull_failed' ] ; ?></code>
|
161 |
+
</p>
|
162 |
+
<?php endif ; ?>
|
163 |
+
</div>
|
164 |
+
|
165 |
+
<p><a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:image-optimization#image_optimization_in_litespeed_cache_for_wordpress" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a></p>
|
166 |
+
|
167 |
+
</div>
|
168 |
+
|
169 |
+
<div class="litespeed-width-1-2">
|
170 |
+
<?php echo LiteSpeed_Cache_GUI::img_optm_clean_up_unfinished() ; ?>
|
171 |
+
</div>
|
172 |
+
|
173 |
+
</div>
|
174 |
+
|
175 |
+
<hr />
|
176 |
+
|
177 |
+
<div class="litespeed-empty-space-small"></div>
|
178 |
+
|
179 |
+
<h3 class="litespeed-title">
|
180 |
+
<?php echo __( 'Storage Optimization', 'litespeed-cache' ) ; ?>
|
181 |
+
|
182 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_CALC_BKUP ) ; ?>" class="dashicons dashicons-update litepseed-dash-icon-success" title="<?php echo __( 'Calculate Original Image Storage', 'litespeed-cache' ) ; ?>">
|
183 |
+
</a>
|
184 |
+
|
185 |
+
</h3>
|
186 |
+
|
187 |
+
<?php if ( $storage_data ) : ?>
|
188 |
+
<div class="">
|
189 |
+
<p>
|
190 |
+
<?php echo __( 'Last calculated', 'litespeed-cache' ) . ': <code>' . LiteSpeed_Cache_Utility::readable_time( $storage_data[ 'date' ] ) . '</code>' ; ?>
|
191 |
+
</p>
|
192 |
+
<?php if ( $storage_data[ 'count' ] ) : ?>
|
193 |
+
<p>
|
194 |
+
<?php echo __( 'Files', 'litespeed-cache' ) . ': <code>' . $storage_data[ 'count' ] . '</code>' ; ?>
|
195 |
+
</p>
|
196 |
+
<p>
|
197 |
+
<?php echo __( 'Total', 'litespeed-cache' ) . ': <code>' . LiteSpeed_Cache_Utility::real_size( $storage_data[ 'sum' ] ) . '</code>' ; ?>
|
198 |
+
</p>
|
199 |
+
<?php endif ; ?>
|
200 |
+
</div>
|
201 |
+
<?php endif ; ?>
|
202 |
+
|
203 |
+
<br />
|
204 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_RM_BKUP ) ; ?>" data-litespeed-cfm="<?php echo __( 'Are you sure to remove all image backups?', 'litespeed-cache' ) ; ?>" class="litespeed-btn-danger">
|
205 |
+
<span class="dashicons dashicons-trash"></span> <?php echo __( 'Remove Original Image Backups', 'litespeed-cache' ) ; ?>
|
206 |
+
</a>
|
207 |
+
<div class="litespeed-desc">
|
208 |
+
<?php echo __( 'This will delete all of the backups of the original images.', 'litespeed-cache' ) ; ?>
|
209 |
+
<div class="litespeed-danger">
|
210 |
+
<?php echo __('WARNING', 'litespeed-cache'); ?>:
|
211 |
+
<?php echo __( 'This is irreversible.', 'litespeed-cache' ) ; ?>
|
212 |
+
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ) ; ?>
|
213 |
+
</div>
|
214 |
+
</div>
|
215 |
+
<?php if ( $rm_log ) : ?>
|
216 |
+
<div class="">
|
217 |
+
<p>
|
218 |
+
<?php echo __( 'Last ran', 'litespeed-cache' ) . ': <code>' . LiteSpeed_Cache_Utility::readable_time( $rm_log[ 'date' ] ) . '</code>' ; ?>
|
219 |
+
</p>
|
220 |
+
<p>
|
221 |
+
<?php echo __( 'Files', 'litespeed-cache' ) . ': <code>' . $rm_log[ 'count' ] . '</code>' ; ?>
|
222 |
+
</p>
|
223 |
+
<p>
|
224 |
+
<?php echo __( 'Saved', 'litespeed-cache' ) . ': <code>' . LiteSpeed_Cache_Utility::real_size( $rm_log[ 'sum' ] ) . '</code>' ; ?>
|
225 |
+
</p>
|
226 |
+
</div>
|
227 |
+
<?php endif ; ?>
|
228 |
+
|
229 |
+
<div class="litespeed-desc">
|
230 |
+
<?php echo __( 'A backup of each image is saved before it is optimized.', 'litespeed-cache' ) ; ?>
|
231 |
+
<?php echo __( 'The refresh button will calculate the total amount of disk space used by these backups.', 'litespeed-cache' ) ; ?>
|
232 |
+
</div>
|
233 |
+
|
234 |
+
|
235 |
+
</div>
|
236 |
+
</div>
|
237 |
+
</div>
|
238 |
+
|
239 |
+
<div class="litespeed-width-3-10 litespeed-column-java litespeed-contrast" style="display: flex; flex-direction: column;">
|
240 |
+
<div class="litespeed-hr">
|
241 |
+
<?php include_once LSCWP_DIR . "admin/tpl/inc/img_optm.percentage_summary.php" ; ?>
|
242 |
+
</div>
|
243 |
+
|
244 |
+
<div class="litespeed-hr">
|
245 |
+
<h3 class="litespeed-title">
|
246 |
+
<?php echo __( 'Optimization Summary', 'litespeed-cache' ) ; ?>
|
247 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_SYNC_DATA ) ; ?>" class="dashicons dashicons-update litepseed-dash-icon-success" title="<?php echo __( 'Update Status', 'litespeed-cache' ) ; ?>">
|
248 |
+
</a>
|
249 |
+
</h3>
|
250 |
+
<p>
|
251 |
+
<?php echo __( 'Total Reduction', 'litespeed-cache' ) ; ?>: <code><?php echo LiteSpeed_Cache_Utility::real_size( $optm_summary[ 'reduced' ] ) ; ?></code>
|
252 |
+
</p>
|
253 |
+
<p>
|
254 |
+
<?php echo __( 'Images Pulled', 'litespeed-cache' ) ; ?>: <code><?php echo $optm_summary[ 'img_taken' ] ; ?></code>
|
255 |
+
</p>
|
256 |
+
<p>
|
257 |
+
<?php echo __( 'Last Request', 'litespeed-cache' ) ; ?>: <code><?php echo LiteSpeed_Cache_Utility::readable_time( $optm_summary[ 'last_requested' ] ) ; ?></code>
|
258 |
+
</p>
|
259 |
+
</div>
|
260 |
+
|
261 |
+
<div class="litespeed-hr">
|
262 |
+
<h3 class="litespeed-title"><?php echo __('Revert Optimization', 'litespeed-cache') ; ?></h3>
|
263 |
+
|
264 |
+
<div class="litespeed-desc">
|
265 |
+
<?php echo __( 'Switch all images in the media library back to their original unoptimized versions.', 'litespeed-cache' ) ; ?>
|
266 |
+
</div>
|
267 |
+
|
268 |
+
<div>
|
269 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IAPI, LiteSpeed_Cache_Admin_API::TYPE_RESET_KEY ) ; ?>" class="litespeed-btn-warning" title="<?php echo __( 'The current IAPI key must be reset after changing home URL or domain before making any further optimization requests.', 'litespeed-cache' ) ; ?>">
|
270 |
+
<span class="dashicons dashicons-image-rotate"></span> <?php echo __( 'Reset IAPI Key', 'litespeed-cache' ) ; ?>
|
271 |
+
</a>
|
272 |
+
<br />
|
273 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_BATCH_SWITCH_ORI ) ; ?>" class="litespeed-btn-success" title="<?php echo __( 'Revert all optimized images back to their original versions.', 'litespeed-cache' ) ; ?>">
|
274 |
+
<span class="dashicons dashicons-undo"></span> <?php echo __( 'Undo Optimization', 'litespeed-cache' ) ; ?>
|
275 |
+
</a>
|
276 |
+
|
277 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_BATCH_SWITCH_OPTM ) ; ?>" class="litespeed-btn-success" title="<?php echo __( 'Switch back to using optimized images.', 'litespeed-cache' ) ; ?>">
|
278 |
+
<span class="dashicons dashicons-redo"></span> <?php echo __( 'Re-do Optimization', 'litespeed-cache' ) ; ?>
|
279 |
+
</a>
|
280 |
+
|
281 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTIMIZE_RESCAN ) ; ?>" class="litespeed-btn-success litespeed-hide" title="<?php echo __( 'Scan for any new unoptimized image thumbnail sizes and resend necessary image optimization requests.', 'litespeed-cache' ) ; ?>">
|
282 |
+
<?php echo __( 'Send New Thumbnail Requests', 'litespeed-cache' ) ; ?>
|
283 |
+
</a>
|
284 |
+
|
285 |
+
<p>
|
286 |
+
<?php echo sprintf( __( 'Results can be checked in <a %s>Media Library</a>.', 'litespeed-cache' ), 'href="upload.php?mode=list"' ) ; ?>
|
287 |
+
</p>
|
288 |
+
|
289 |
+
</div>
|
290 |
+
|
291 |
+
</div>
|
292 |
+
|
293 |
+
<div style="flex-grow: 1;"></div>
|
294 |
+
|
295 |
+
<!-- <div class="litespeed-empty-space-xlarge">
|
296 |
+
</div>-->
|
297 |
+
<div class="">
|
298 |
+
|
299 |
+
<a href="<?php echo LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTM_DESTROY ) ; ?>" class="litespeed-btn-danger">
|
300 |
+
<span class="dashicons dashicons-dismiss"></span> <?php echo __( 'Destroy All Optimization Data!', 'litespeed-cache' ) ; ?>
|
301 |
+
</a>
|
302 |
+
|
303 |
+
<div class="litespeed-desc">
|
304 |
+
<?php echo __( 'Remove all previous image optimization requests/results, revert completed optimizations, and delete all optimization files.', 'litespeed-cache' ) ; ?>
|
305 |
+
<div class="litespeed-warning">
|
306 |
+
<?php echo __('NOTE', 'litespeed-cache'); ?>:
|
307 |
+
<?php echo __( 'This will also reset the credit level.', 'litespeed-cache' ) ; ?>
|
308 |
+
</div>
|
309 |
+
</div>
|
310 |
+
|
311 |
+
|
312 |
+
|
313 |
+
</div>
|
admin/tpl/inc/modal.footer.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
|
2 |
+
</div>
|
3 |
+
|
admin/tpl/inc/modal.header.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die ;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
|
7 |
+
<link rel="stylesheet" href="<?php echo LSWCP_PLUGIN_URL ; ?>css/litespeed.css" />
|
8 |
+
|
9 |
+
<div class="litespeed litespeed-modal">
|
10 |
+
|
11 |
+
<?php if ( $_progress ) : ?>
|
12 |
+
<div class="litespeed-progress">
|
13 |
+
<div class="litespeed-progress-bar" role="progressbar" style="width: <?php echo $_progress ; ?>%" aria-valuenow="<?php echo $_progress ; ?>" aria-valuemin="0" aria-valuemax="100"></div>
|
14 |
+
</div>
|
15 |
+
<?php endif ; ?>
|
16 |
+
|
17 |
+
<div class="litespeed-wrap">
|
admin/tpl/setting/settings_cdn.php
CHANGED
@@ -38,7 +38,7 @@ if ( ! $cdn_mapping ) {
|
|
38 |
</tr>
|
39 |
|
40 |
<tr>
|
41 |
-
<th><?php echo __( 'CDN Mapping', 'litespeed-cache' ) ; ?></th>
|
42 |
<td>
|
43 |
<?php foreach ( $cdn_mapping as $v ) : ?>
|
44 |
|
@@ -123,7 +123,7 @@ if ( ! $cdn_mapping ) {
|
|
123 |
</tr>
|
124 |
|
125 |
<tr>
|
126 |
-
<th><?php echo __( 'Original URLs', 'litespeed-cache' ) ; ?></th>
|
127 |
<td>
|
128 |
<?php $this->build_input( LiteSpeed_Cache_Config::OPID_CDN_ORI, 'litespeed-input-long' ) ; ?>
|
129 |
<div class="litespeed-desc">
|
@@ -135,7 +135,7 @@ if ( ! $cdn_mapping ) {
|
|
135 |
</tr>
|
136 |
|
137 |
<tr>
|
138 |
-
<th><?php echo __( 'Included Directories', 'litespeed-cache' ) ; ?></th>
|
139 |
<td>
|
140 |
<?php $id = LiteSpeed_Cache_Config::ITEM_CDN_ORI_DIR ; ?>
|
141 |
<?php $this->build_textarea2( $id, 40 ) ; ?>
|
@@ -148,7 +148,7 @@ if ( ! $cdn_mapping ) {
|
|
148 |
</tr>
|
149 |
|
150 |
<tr>
|
151 |
-
<th><?php echo __( 'Exclude Path', 'litespeed-cache' ) ; ?></th>
|
152 |
<td>
|
153 |
<?php $id = LiteSpeed_Cache_Config::OPID_CDN_EXCLUDE ; ?>
|
154 |
<?php $this->build_textarea( $id ) ; ?>
|
@@ -187,41 +187,31 @@ if ( ! $cdn_mapping ) {
|
|
187 |
</td>
|
188 |
</tr>
|
189 |
|
190 |
-
<tr class="litespeed-hide"
|
191 |
<th><?php echo __( 'Quic Cloud API', 'litespeed-cache' ) ; ?></th>
|
192 |
<td>
|
193 |
-
<?php $this->build_switch( LiteSpeed_Cache_Config::
|
194 |
<div class="litespeed-desc">
|
195 |
<?php echo sprintf( __( 'Use %s API functionality.', 'litespeed-cache' ), 'Quic Cloud' ) ; ?>
|
196 |
|
197 |
-
<a id='litespeed_modal_href' href="
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
<?php endif ; ?>
|
203 |
-
</a>
|
204 |
-
|
205 |
-
<link rel="stylesheet" href="<?php echo LSWCP_PLUGIN_URL ; ?>css/iziModal.min.css">
|
206 |
-
<script type="text/javascript" src="<?php echo LSWCP_PLUGIN_URL ; ?>js/iziModal.min.js"></script>
|
207 |
-
<div id="litespeed_modal"></div>
|
208 |
<script type="text/javascript">
|
209 |
-
var litespeed_modal = jQuery("#litespeed_modal").iziModal({iframe: true});
|
210 |
-
jQuery("#litespeed_modal_href").click(function(event) {
|
211 |
-
|
212 |
-
|
213 |
-
});;
|
214 |
</script>
|
215 |
-
<?php
|
216 |
-
|
217 |
-
?>
|
218 |
-
<?php echo sprintf( __( 'This can be managed from <a %2$s>%1$s</a>.', 'litespeed-cache' ), '<b>' . __( 'Manage', 'litespeed-cache' ) . '</b> -> <b>' . __( 'CDN', 'litespeed-cache' ) . '</b>', 'href="admin.php?page=lscache-dash#cdn"' ) ; ?>
|
219 |
</div>
|
220 |
<div class="litespeed-block">
|
221 |
<div class='litespeed-col'>
|
222 |
<h4><?php echo __( 'Email Address', 'litespeed-cache' ) ; ?></h4>
|
223 |
|
224 |
-
<?php $this->build_input( LiteSpeed_Cache_Config::
|
225 |
<div class="litespeed-desc">
|
226 |
<?php echo sprintf( __( 'Your Email address on %s.', 'litespeed-cache' ), 'Quic Cloud' ) ; ?>
|
227 |
</div>
|
@@ -230,24 +220,13 @@ if ( ! $cdn_mapping ) {
|
|
230 |
<div class='litespeed-col'>
|
231 |
<h4><?php echo __( 'User API Key', 'litespeed-cache' ) ; ?></h4>
|
232 |
|
233 |
-
<?php $this->build_input( LiteSpeed_Cache_Config::
|
234 |
<div class="litespeed-desc">
|
235 |
<?php echo sprintf( __( 'Your API key is used to access %s APIs.', 'litespeed-cache' ), 'Quic Cloud' ) ; ?>
|
236 |
<?php echo sprintf( __( 'Get it from <a %1$s>%2$s</a>.', 'litespeed-cache' ), 'href="https://quic.cloud/dashboard" target="_blank"', 'Quic Cloud' ) ; ?>
|
237 |
</div>
|
238 |
</div>
|
239 |
|
240 |
-
<div class='litespeed-col'>
|
241 |
-
<h4><?php echo __( 'Site Domain', 'litespeed-cache' ) ; ?></h4>
|
242 |
-
|
243 |
-
<?php
|
244 |
-
$this->build_input( LiteSpeed_Cache_Config::OPID_CDN_QUIC_SITE ) ;
|
245 |
-
?>
|
246 |
-
<div class="litespeed-desc">
|
247 |
-
<?php echo __( 'You can just type part of the domain.', 'litespeed-cache' ) ; ?>
|
248 |
-
<?php echo __( 'Once saved, it will be matched with the current list and completed automatically.', 'litespeed-cache' ) ; ?>
|
249 |
-
</div>
|
250 |
-
</div>
|
251 |
</div>
|
252 |
</td>
|
253 |
</tr>
|
38 |
</tr>
|
39 |
|
40 |
<tr>
|
41 |
+
<th class="litespeed-padding-left"><?php echo __( 'CDN Mapping', 'litespeed-cache' ) ; ?></th>
|
42 |
<td>
|
43 |
<?php foreach ( $cdn_mapping as $v ) : ?>
|
44 |
|
123 |
</tr>
|
124 |
|
125 |
<tr>
|
126 |
+
<th class="litespeed-padding-left"><?php echo __( 'Original URLs', 'litespeed-cache' ) ; ?></th>
|
127 |
<td>
|
128 |
<?php $this->build_input( LiteSpeed_Cache_Config::OPID_CDN_ORI, 'litespeed-input-long' ) ; ?>
|
129 |
<div class="litespeed-desc">
|
135 |
</tr>
|
136 |
|
137 |
<tr>
|
138 |
+
<th class="litespeed-padding-left"><?php echo __( 'Included Directories', 'litespeed-cache' ) ; ?></th>
|
139 |
<td>
|
140 |
<?php $id = LiteSpeed_Cache_Config::ITEM_CDN_ORI_DIR ; ?>
|
141 |
<?php $this->build_textarea2( $id, 40 ) ; ?>
|
148 |
</tr>
|
149 |
|
150 |
<tr>
|
151 |
+
<th class="litespeed-padding-left"><?php echo __( 'Exclude Path', 'litespeed-cache' ) ; ?></th>
|
152 |
<td>
|
153 |
<?php $id = LiteSpeed_Cache_Config::OPID_CDN_EXCLUDE ; ?>
|
154 |
<?php $this->build_textarea( $id ) ; ?>
|
187 |
</td>
|
188 |
</tr>
|
189 |
|
190 |
+
<tr <?php if ( ! defined( 'LITESPEED_QUIC_CLOUD' ) ) echo 'class="litespeed-hide"' ; ?>>
|
191 |
<th><?php echo __( 'Quic Cloud API', 'litespeed-cache' ) ; ?></th>
|
192 |
<td>
|
193 |
+
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_CDN_QUIC ) ; ?>
|
194 |
<div class="litespeed-desc">
|
195 |
<?php echo sprintf( __( 'Use %s API functionality.', 'litespeed-cache' ), 'Quic Cloud' ) ; ?>
|
196 |
|
197 |
+
<a id='litespeed_modal_href' href="https://quic.cloud" target="_blank">Quic.cloud</a>
|
198 |
+
|
199 |
+
<!-- <link rel="stylesheet" href="<?php echo LSWCP_PLUGIN_URL ; ?>css/iziModal.min.css"> -->
|
200 |
+
<!-- <script type="text/javascript" src="<?php echo LSWCP_PLUGIN_URL ; ?>js/iziModal.min.js"></script> -->
|
201 |
+
<!-- <div id="litespeed_modal"></div> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
<script type="text/javascript">
|
203 |
+
// var litespeed_modal = jQuery("#litespeed_modal").iziModal({iframe: true});
|
204 |
+
// jQuery("#litespeed_modal_href").click(function(event) {
|
205 |
+
// event.preventDefault();
|
206 |
+
// litespeed_modal.iziModal('open', event);
|
207 |
+
// });;
|
208 |
</script>
|
|
|
|
|
|
|
|
|
209 |
</div>
|
210 |
<div class="litespeed-block">
|
211 |
<div class='litespeed-col'>
|
212 |
<h4><?php echo __( 'Email Address', 'litespeed-cache' ) ; ?></h4>
|
213 |
|
214 |
+
<?php $this->build_input( LiteSpeed_Cache_Config::OPT_CDN_QUIC_EMAIL ) ; ?>
|
215 |
<div class="litespeed-desc">
|
216 |
<?php echo sprintf( __( 'Your Email address on %s.', 'litespeed-cache' ), 'Quic Cloud' ) ; ?>
|
217 |
</div>
|
220 |
<div class='litespeed-col'>
|
221 |
<h4><?php echo __( 'User API Key', 'litespeed-cache' ) ; ?></h4>
|
222 |
|
223 |
+
<?php $this->build_input( LiteSpeed_Cache_Config::OPT_CDN_QUIC_KEY ) ; ?>
|
224 |
<div class="litespeed-desc">
|
225 |
<?php echo sprintf( __( 'Your API key is used to access %s APIs.', 'litespeed-cache' ), 'Quic Cloud' ) ; ?>
|
226 |
<?php echo sprintf( __( 'Get it from <a %1$s>%2$s</a>.', 'litespeed-cache' ), 'href="https://quic.cloud/dashboard" target="_blank"', 'Quic Cloud' ) ; ?>
|
227 |
</div>
|
228 |
</div>
|
229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
</div>
|
231 |
</td>
|
232 |
</tr>
|
admin/tpl/setting/settings_inc.cache_browser.php
CHANGED
@@ -18,7 +18,7 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
18 |
</tr>
|
19 |
|
20 |
<tr <?php echo $_hide_in_basic_mode ; ?>>
|
21 |
-
<th><?php echo __( 'Browser Cache TTL', 'litespeed-cache' ) ; ?></th>
|
22 |
<td>
|
23 |
<?php $id = LiteSpeed_Cache_Config::OPID_CACHE_BROWSER_TTL ; ?>
|
24 |
<?php $this->build_input( $id ) ; ?> <?php echo __( 'seconds', 'litespeed-cache' ) ; ?>
|
18 |
</tr>
|
19 |
|
20 |
<tr <?php echo $_hide_in_basic_mode ; ?>>
|
21 |
+
<th class="litespeed-padding-left"><?php echo __( 'Browser Cache TTL', 'litespeed-cache' ) ; ?></th>
|
22 |
<td>
|
23 |
<?php $id = LiteSpeed_Cache_Config::OPID_CACHE_BROWSER_TTL ; ?>
|
24 |
<?php $this->build_input( $id ) ; ?> <?php echo __( 'seconds', 'litespeed-cache' ) ; ?>
|
admin/tpl/setting/settings_inc.check_adv_file.php
CHANGED
@@ -10,11 +10,12 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
10 |
$this->build_checkbox($id, __('Include advanced-cache.php', 'litespeed-cache'), $_options[$id]);
|
11 |
?>
|
12 |
<div class="litespeed-desc">
|
13 |
-
<?php echo __('The advanced-cache.php file is used by many caching plugins to signal that a cache is active.', 'litespeed-cache'); ?>
|
14 |
-
<?php echo __('When this option is checked and this file is detected as belonging to another plugin, LiteSpeed
|
15 |
</div>
|
16 |
<p>
|
17 |
-
<i><?php echo __('
|
|
|
18 |
</p>
|
19 |
|
20 |
</td>
|
10 |
$this->build_checkbox($id, __('Include advanced-cache.php', 'litespeed-cache'), $_options[$id]);
|
11 |
?>
|
12 |
<div class="litespeed-desc">
|
13 |
+
<?php echo __( 'The advanced-cache.php file is used by many caching plugins to signal that a cache is active.', 'litespeed-cache' ) ; ?>
|
14 |
+
<?php echo __( 'When this option is checked and this file is detected as belonging to another plugin, LiteSpeed\'s caching functionality will not work.', 'litespeed-cache' ) ; ?>
|
15 |
</div>
|
16 |
<p>
|
17 |
+
<i><?php echo __( 'You may need to uncheck this option if you are using multiple optimization plugins.', 'litespeed-cache' ) ; ?></i>
|
18 |
+
<a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:customizations:multi-cache-plugins" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
|
19 |
</p>
|
20 |
|
21 |
</td>
|
admin/tpl/setting/settings_inc.media_webp.php
CHANGED
@@ -3,7 +3,7 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
3 |
|
4 |
?>
|
5 |
<tr>
|
6 |
-
<th><?php echo __( 'Image WebP Replacement', 'litespeed-cache' ) ; ?></th>
|
7 |
<td>
|
8 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_WEBP_REPLACE ) ; ?>
|
9 |
<div class="litespeed-desc">
|
@@ -15,4 +15,3 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
15 |
</div>
|
16 |
</td>
|
17 |
</tr>
|
18 |
-
|
3 |
|
4 |
?>
|
5 |
<tr>
|
6 |
+
<th class="litespeed-padding-left"><?php echo __( 'Image WebP Replacement', 'litespeed-cache' ) ; ?></th>
|
7 |
<td>
|
8 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_WEBP_REPLACE ) ; ?>
|
9 |
<div class="litespeed-desc">
|
15 |
</div>
|
16 |
</td>
|
17 |
</tr>
|
|
admin/tpl/setting/settings_media.php
CHANGED
@@ -65,18 +65,31 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
65 |
</td>
|
66 |
</tr>
|
67 |
|
68 |
-
<tr
|
69 |
-
<th><?php echo __( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
<td>
|
71 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_AUTO ) ; ?>
|
72 |
<div class="litespeed-desc">
|
73 |
-
<?php echo __( 'Automatically request optimization
|
|
|
74 |
</div>
|
75 |
</td>
|
76 |
</tr>
|
77 |
|
78 |
<tr>
|
79 |
-
<th><?php echo __( 'Optimization Cron', 'litespeed-cache' ) ; ?></th>
|
80 |
<td>
|
81 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_CRON ) ; ?>
|
82 |
<div class="litespeed-desc">
|
@@ -86,7 +99,7 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
86 |
</tr>
|
87 |
|
88 |
<tr>
|
89 |
-
<th><?php echo __( 'Optimize Original Images', 'litespeed-cache' ) ; ?></th>
|
90 |
<td>
|
91 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_ORI ) ; ?>
|
92 |
<div class="litespeed-desc">
|
@@ -96,7 +109,23 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
96 |
</tr>
|
97 |
|
98 |
<tr>
|
99 |
-
<th><?php echo __( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
<td>
|
101 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_WEBP ) ; ?>
|
102 |
<div class="litespeed-desc">
|
@@ -106,7 +135,7 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
106 |
</tr>
|
107 |
|
108 |
<tr>
|
109 |
-
<th><?php echo __( 'Optimize Losslessly', 'litespeed-cache' ) ; ?></th>
|
110 |
<td>
|
111 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_LOSSLESS ) ; ?>
|
112 |
<div class="litespeed-desc">
|
@@ -117,7 +146,7 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
117 |
</tr>
|
118 |
|
119 |
<tr>
|
120 |
-
<th><?php echo __( 'Preserve EXIF data', 'litespeed-cache' ) ; ?></th>
|
121 |
<td>
|
122 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_EXIF ) ; ?>
|
123 |
<div class="litespeed-desc">
|
@@ -136,7 +165,7 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
136 |
?>
|
137 |
|
138 |
<tr>
|
139 |
-
<th><?php echo __( 'WebP Attribute To Replace', 'litespeed-cache' ) ; ?></th>
|
140 |
<td>
|
141 |
<?php $id = LiteSpeed_Cache_Config::ITEM_MEDIA_WEBP_ATTRIBUTE ; ?>
|
142 |
<?php $this->build_textarea2( $id, 40 ) ; ?>
|
@@ -151,7 +180,7 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
151 |
</tr>
|
152 |
|
153 |
<tr>
|
154 |
-
<th><?php echo __( 'WebP For Extra srcset', 'litespeed-cache' ) ; ?></th>
|
155 |
<td>
|
156 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_WEBP_REPLACE_SRCSET ) ; ?>
|
157 |
<div class="litespeed-desc">
|
@@ -162,4 +191,4 @@ if ( ! defined( 'WPINC' ) ) die ;
|
|
162 |
</tr>
|
163 |
|
164 |
|
165 |
-
</tbody></table>
|
65 |
</td>
|
66 |
</tr>
|
67 |
|
68 |
+
<tr>
|
69 |
+
<th><?php echo __( 'Inline Lazy Load Images Library', 'litespeed-cache' ) ; ?></th>
|
70 |
+
<td>
|
71 |
+
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZYJS_INLINE ) ; ?>
|
72 |
+
<div class="litespeed-desc">
|
73 |
+
<?php echo __( 'Include the lazy load image Javascript library inline.', 'litespeed-cache' ) ; ?>
|
74 |
+
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ) ; ?>
|
75 |
+
<a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media#inline_lazy_load_images_library" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
|
76 |
+
</div>
|
77 |
+
</td>
|
78 |
+
</tr>
|
79 |
+
|
80 |
+
<tr>
|
81 |
+
<th><?php echo __( 'Optimize Automatically', 'litespeed-cache' ) ; ?></th>
|
82 |
<td>
|
83 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_AUTO ) ; ?>
|
84 |
<div class="litespeed-desc">
|
85 |
+
<?php echo __( 'Automatically request optimization via cron job.', 'litespeed-cache' ) ; ?>
|
86 |
+
<?php echo sprintf( __( 'Requests can only be sent when recovered credits is %s or more.', 'litespeed-cache' ), '<code>' . LiteSpeed_Cache_Img_Optm::NUM_THRESHOLD_AUTO_REQUEST . '</code>' ) ; ?>
|
87 |
</div>
|
88 |
</td>
|
89 |
</tr>
|
90 |
|
91 |
<tr>
|
92 |
+
<th class="litespeed-padding-left"><?php echo __( 'Optimization Cron', 'litespeed-cache' ) ; ?></th>
|
93 |
<td>
|
94 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_CRON ) ; ?>
|
95 |
<div class="litespeed-desc">
|
99 |
</tr>
|
100 |
|
101 |
<tr>
|
102 |
+
<th class="litespeed-padding-left"><?php echo __( 'Optimize Original Images', 'litespeed-cache' ) ; ?></th>
|
103 |
<td>
|
104 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_ORI ) ; ?>
|
105 |
<div class="litespeed-desc">
|
109 |
</tr>
|
110 |
|
111 |
<tr>
|
112 |
+
<th class="litespeed-padding-left"><?php echo __( 'Remove Original Backups', 'litespeed-cache' ) ; ?></th>
|
113 |
+
<td>
|
114 |
+
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_RM_ORI_BKUP ) ; ?>
|
115 |
+
<div class="litespeed-desc">
|
116 |
+
<?php echo __( 'Automatically remove the original image backups after fetching optimized images.', 'litespeed-cache' ) ; ?>
|
117 |
+
|
118 |
+
<br /><font class="litespeed-danger">
|
119 |
+
<?php echo __('WARNING', 'litespeed-cache'); ?>:
|
120 |
+
<?php echo __( 'This is irreversible.', 'litespeed-cache' ) ; ?>
|
121 |
+
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ) ; ?>
|
122 |
+
</font>
|
123 |
+
</div>
|
124 |
+
</td>
|
125 |
+
</tr>
|
126 |
+
|
127 |
+
<tr>
|
128 |
+
<th class="litespeed-padding-left"><?php echo __( 'Optimize WebP Versions', 'litespeed-cache' ) ; ?></th>
|
129 |
<td>
|
130 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_WEBP ) ; ?>
|
131 |
<div class="litespeed-desc">
|
135 |
</tr>
|
136 |
|
137 |
<tr>
|
138 |
+
<th class="litespeed-padding-left"><?php echo __( 'Optimize Losslessly', 'litespeed-cache' ) ; ?></th>
|
139 |
<td>
|
140 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_LOSSLESS ) ; ?>
|
141 |
<div class="litespeed-desc">
|
146 |
</tr>
|
147 |
|
148 |
<tr>
|
149 |
+
<th class="litespeed-padding-left"><?php echo __( 'Preserve EXIF data', 'litespeed-cache' ) ; ?></th>
|
150 |
<td>
|
151 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_EXIF ) ; ?>
|
152 |
<div class="litespeed-desc">
|
165 |
?>
|
166 |
|
167 |
<tr>
|
168 |
+
<th class="litespeed-padding-left"><?php echo __( 'WebP Attribute To Replace', 'litespeed-cache' ) ; ?></th>
|
169 |
<td>
|
170 |
<?php $id = LiteSpeed_Cache_Config::ITEM_MEDIA_WEBP_ATTRIBUTE ; ?>
|
171 |
<?php $this->build_textarea2( $id, 40 ) ; ?>
|
180 |
</tr>
|
181 |
|
182 |
<tr>
|
183 |
+
<th class="litespeed-padding-left"><?php echo __( 'WebP For Extra srcset', 'litespeed-cache' ) ; ?></th>
|
184 |
<td>
|
185 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_WEBP_REPLACE_SRCSET ) ; ?>
|
186 |
<div class="litespeed-desc">
|
191 |
</tr>
|
192 |
|
193 |
|
194 |
+
</tbody></table>
|
admin/tpl/setting/settings_optimize.php
CHANGED
@@ -145,7 +145,7 @@ $last_critical_css_generated = LiteSpeed_Cache_CSS::get_summary() ;
|
|
145 |
</tr>
|
146 |
|
147 |
<tr>
|
148 |
-
<th><?php echo __( 'Generate Critical CSS', 'litespeed-cache' ) ; ?></th>
|
149 |
<td>
|
150 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_OPTM_CCSS_GEN ) ; ?>
|
151 |
<div class="litespeed-desc">
|
@@ -156,7 +156,7 @@ $last_critical_css_generated = LiteSpeed_Cache_CSS::get_summary() ;
|
|
156 |
</tr>
|
157 |
|
158 |
<tr>
|
159 |
-
<th><?php echo __( 'Generate Critical CSS In Background', 'litespeed-cache' ) ; ?></th>
|
160 |
<td>
|
161 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_OPTM_CCSS_ASYNC ) ; ?>
|
162 |
<div class="litespeed-desc">
|
@@ -192,7 +192,7 @@ $last_critical_css_generated = LiteSpeed_Cache_CSS::get_summary() ;
|
|
192 |
</tr>
|
193 |
|
194 |
<tr>
|
195 |
-
<th><?php echo __( 'Inline CSS Async Lib', 'litespeed-cache' ) ; ?></th>
|
196 |
<td>
|
197 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_OPTM_CSS_ASYNC_INLINE ) ; ?>
|
198 |
<div class="litespeed-desc">
|
@@ -220,7 +220,7 @@ $last_critical_css_generated = LiteSpeed_Cache_CSS::get_summary() ;
|
|
220 |
<?php echo sprintf( __( 'Improve compatibility with inline JS by preventing jQuery optimization. (Recommended Setting: %s)', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ) ) ; ?>
|
221 |
<br /><font class="litespeed-warning">
|
222 |
<?php echo __('NOTE', 'litespeed-cache'); ?>:
|
223 |
-
<?php echo sprintf( __( 'If there is any JS error related to %1$s when enabled %2$s, please
|
224 |
</font>
|
225 |
</div>
|
226 |
</td>
|
145 |
</tr>
|
146 |
|
147 |
<tr>
|
148 |
+
<th class="litespeed-padding-left"><?php echo __( 'Generate Critical CSS', 'litespeed-cache' ) ; ?></th>
|
149 |
<td>
|
150 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_OPTM_CCSS_GEN ) ; ?>
|
151 |
<div class="litespeed-desc">
|
156 |
</tr>
|
157 |
|
158 |
<tr>
|
159 |
+
<th class="litespeed-padding-left"><?php echo __( 'Generate Critical CSS In Background', 'litespeed-cache' ) ; ?></th>
|
160 |
<td>
|
161 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_OPTM_CCSS_ASYNC ) ; ?>
|
162 |
<div class="litespeed-desc">
|
192 |
</tr>
|
193 |
|
194 |
<tr>
|
195 |
+
<th class="litespeed-padding-left"><?php echo __( 'Inline CSS Async Lib', 'litespeed-cache' ) ; ?></th>
|
196 |
<td>
|
197 |
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_OPTM_CSS_ASYNC_INLINE ) ; ?>
|
198 |
<div class="litespeed-desc">
|
220 |
<?php echo sprintf( __( 'Improve compatibility with inline JS by preventing jQuery optimization. (Recommended Setting: %s)', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ) ) ; ?>
|
221 |
<br /><font class="litespeed-warning">
|
222 |
<?php echo __('NOTE', 'litespeed-cache'); ?>:
|
223 |
+
<?php echo sprintf( __( 'If there is any JS error related to %1$s when enabled %2$s, please turn on this option.', 'litespeed-cache' ), 'jQuery', __( 'JS Combine', 'litespeed-cache' ) ) ; ?>
|
224 |
</font>
|
225 |
</div>
|
226 |
</td>
|
cli/litespeed-cache-cli-admin.class.php
CHANGED
@@ -55,6 +55,12 @@ class LiteSpeed_Cache_Cli_Admin
|
|
55 |
$val = $args[1] ;
|
56 |
|
57 |
$options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
if ( ! isset($options) || ( ! isset($options[$key]) && ! isset(self::$purges[$key])) ) {
|
60 |
WP_CLI::error('The options array is empty or the key is not valid.') ;
|
@@ -191,13 +197,11 @@ class LiteSpeed_Cache_Cli_Admin
|
|
191 |
*/
|
192 |
public function export_options($args, $assoc_args)
|
193 |
{
|
194 |
-
$options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
|
195 |
-
$output = '' ;
|
196 |
if ( isset($assoc_args['filename']) ) {
|
197 |
$file = $assoc_args['filename'] ;
|
198 |
}
|
199 |
else {
|
200 |
-
$file = getcwd() . '/lscache_wp_options_' . date('d_m_Y-His') . '.
|
201 |
}
|
202 |
|
203 |
if ( ! is_writable(dirname($file)) ) {
|
@@ -205,13 +209,10 @@ class LiteSpeed_Cache_Cli_Admin
|
|
205 |
return ;
|
206 |
}
|
207 |
|
208 |
-
|
209 |
-
$output .= sprintf("%s=%s\n", $key, $val) ;
|
210 |
-
}
|
211 |
-
$output .= "\n" ;
|
212 |
|
213 |
-
if ( file_put_contents($file, $
|
214 |
-
WP_CLI::error('Failed to create file.') ;
|
215 |
}
|
216 |
else {
|
217 |
WP_CLI::success('Created file ' . $file) ;
|
@@ -243,21 +244,14 @@ class LiteSpeed_Cache_Cli_Admin
|
|
243 |
if ( ! file_exists($file) || ! is_readable($file) ) {
|
244 |
WP_CLI::error('File does not exist or is not readable.') ;
|
245 |
}
|
246 |
-
$content = file_get_contents($file) ;
|
247 |
-
preg_match_all("/^[^;][^=]+=[^=\n\r]*$/m", $content, $input) ;
|
248 |
-
$options = array() ;
|
249 |
-
$default = LiteSpeed_Cache_Config::get_instance()->get_options() ;
|
250 |
-
|
251 |
-
foreach ($input[0] as $opt) {
|
252 |
-
$kv = explode('=', $opt) ;
|
253 |
-
$options[$kv[0]] = $kv[1] ;
|
254 |
-
}
|
255 |
|
256 |
-
$
|
257 |
|
258 |
-
|
|
|
|
|
259 |
|
260 |
-
|
261 |
}
|
262 |
|
263 |
/**
|
55 |
$val = $args[1] ;
|
56 |
|
57 |
$options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
|
58 |
+
// Get items
|
59 |
+
$cfg_items = LiteSpeed_Cache_Config::get_instance()->stored_items() ;
|
60 |
+
foreach ( $cfg_items as $v ) {
|
61 |
+
$options[ $v ] = get_option( $v ) ;
|
62 |
+
}
|
63 |
+
|
64 |
|
65 |
if ( ! isset($options) || ( ! isset($options[$key]) && ! isset(self::$purges[$key])) ) {
|
66 |
WP_CLI::error('The options array is empty or the key is not valid.') ;
|
197 |
*/
|
198 |
public function export_options($args, $assoc_args)
|
199 |
{
|
|
|
|
|
200 |
if ( isset($assoc_args['filename']) ) {
|
201 |
$file = $assoc_args['filename'] ;
|
202 |
}
|
203 |
else {
|
204 |
+
$file = getcwd() . '/lscache_wp_options_' . date('d_m_Y-His') . '.data' ;
|
205 |
}
|
206 |
|
207 |
if ( ! is_writable(dirname($file)) ) {
|
209 |
return ;
|
210 |
}
|
211 |
|
212 |
+
$data = LiteSpeed_Cache_Import::get_instance()->export() ;
|
|
|
|
|
|
|
213 |
|
214 |
+
if ( file_put_contents( $file, $data ) === false ) {
|
215 |
+
WP_CLI::error( 'Failed to create file.' ) ;
|
216 |
}
|
217 |
else {
|
218 |
WP_CLI::success('Created file ' . $file) ;
|
244 |
if ( ! file_exists($file) || ! is_readable($file) ) {
|
245 |
WP_CLI::error('File does not exist or is not readable.') ;
|
246 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
+
$res = LiteSpeed_Cache_Import::get_instance()->import( $file ) ;
|
249 |
|
250 |
+
if ( ! $res ) {
|
251 |
+
WP_CLI::error( 'Failed to parse serialized data from file.' ) ;
|
252 |
+
}
|
253 |
|
254 |
+
WP_CLI::success( 'Options imported. [File] ' . $file ) ;
|
255 |
}
|
256 |
|
257 |
/**
|
cli/litespeed-cache-cli-iapi.class.php
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* LiteSpeed Cache Image Optm Interface
|
5 |
+
*/
|
6 |
+
class LiteSpeed_Cache_CLI_IAPI
|
7 |
+
{
|
8 |
+
private $_img_optm_instance ;
|
9 |
+
|
10 |
+
public function __construct()
|
11 |
+
{
|
12 |
+
LiteSpeed_Cache_Log::debug( 'CLI_IAPI init' ) ;
|
13 |
+
|
14 |
+
$this->_img_optm_instance = LiteSpeed_Cache_Img_Optm::get_instance() ;
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Sync data from IAPI server
|
19 |
+
*
|
20 |
+
* ## OPTIONS
|
21 |
+
*
|
22 |
+
* ## EXAMPLES
|
23 |
+
*
|
24 |
+
* # Sync or initialize image optimization service
|
25 |
+
* $ wp lscache-iapi sync
|
26 |
+
*
|
27 |
+
*/
|
28 |
+
public function sync()
|
29 |
+
{
|
30 |
+
$optm_summary = $this->_img_optm_instance->summary_info() ;
|
31 |
+
|
32 |
+
$json = $this->_img_optm_instance->sync_data() ;
|
33 |
+
|
34 |
+
if ( ! $json || empty( $json[ 'level' ] ) ) {
|
35 |
+
return ;
|
36 |
+
}
|
37 |
+
|
38 |
+
WP_CLI::success('[Level] ' . $json[ 'level' ] . ' [Credit] ' . $json[ 'credit' ] ) ;
|
39 |
+
|
40 |
+
if ( empty( $optm_summary[ 'level' ] ) || empty( $optm_summary[ 'credit_recovered' ] ) || empty( $optm_summary[ '_level_data' ] ) ) {
|
41 |
+
return ;
|
42 |
+
}
|
43 |
+
|
44 |
+
if ( $json[ 'level' ] > $optm_summary[ 'level' ] ) {
|
45 |
+
|
46 |
+
LiteSpeed_Cache_Log::debug( "[Img_Optm] Upgraded to level $json[level] !" ) ;
|
47 |
+
|
48 |
+
WP_CLI::success('Upgraded to level ' . $json[ 'level' ] ) ;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Send image optimization request to IAPI server
|
54 |
+
*
|
55 |
+
* ## OPTIONS
|
56 |
+
*
|
57 |
+
* ## EXAMPLES
|
58 |
+
*
|
59 |
+
* # Send image optimization request
|
60 |
+
* $ wp lscache-iapi push
|
61 |
+
*
|
62 |
+
*/
|
63 |
+
public function push()
|
64 |
+
{
|
65 |
+
$msg = $this->_img_optm_instance->request_optm() ;
|
66 |
+
|
67 |
+
if ( ! is_array( $msg ) ) {
|
68 |
+
WP_CLI::error( $msg ) ;
|
69 |
+
}
|
70 |
+
else {
|
71 |
+
WP_CLI::success( $msg[ 'ok' ] ) ;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Pull optimized images from IAPI server
|
77 |
+
*
|
78 |
+
* ## OPTIONS
|
79 |
+
*
|
80 |
+
* ## EXAMPLES
|
81 |
+
*
|
82 |
+
* # Pull images back from IAPI
|
83 |
+
* $ wp lscache-iapi pull
|
84 |
+
*
|
85 |
+
*/
|
86 |
+
public function pull()
|
87 |
+
{
|
88 |
+
$msg = $this->_img_optm_instance->pull_img() ;
|
89 |
+
|
90 |
+
if ( ! is_array( $msg ) ) {
|
91 |
+
WP_CLI::error( $msg ) ;
|
92 |
+
}
|
93 |
+
else {
|
94 |
+
WP_CLI::success( $msg[ 'ok' ] ) ;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Show optimization status based on local data
|
100 |
+
*
|
101 |
+
* ## OPTIONS
|
102 |
+
*
|
103 |
+
* ## EXAMPLES
|
104 |
+
*
|
105 |
+
* # Show optimization status
|
106 |
+
* $ wp lscache-iapi status
|
107 |
+
*
|
108 |
+
*/
|
109 |
+
public function status()
|
110 |
+
{
|
111 |
+
$summary = $this->_img_optm_instance->summary_info() ;
|
112 |
+
$img_count = $this->_img_optm_instance->img_count() ;
|
113 |
+
|
114 |
+
if ( ! empty( $summary[ '_level_data' ] ) ) {
|
115 |
+
unset( $summary[ '_level_data' ] ) ;
|
116 |
+
}
|
117 |
+
|
118 |
+
foreach ( array( 'reduced', 'reduced_webp' ) as $v ) {
|
119 |
+
if ( ! empty( $summary[ $v ] ) ) {
|
120 |
+
$summary[ $v ] = LiteSpeed_Cache_Utility::real_size( $summary[ $v ] ) ;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
if ( ! empty( $summary[ 'last_requested' ] ) ) {
|
125 |
+
$summary[ 'last_requested' ] = date( 'm/d/y H:i:s', $summary[ 'last_requested' ] ) ;
|
126 |
+
}
|
127 |
+
|
128 |
+
$list = array() ;
|
129 |
+
foreach ( $summary as $k => $v ) {
|
130 |
+
$list[] = array( 'key' => $k, 'value' => $v ) ;
|
131 |
+
}
|
132 |
+
|
133 |
+
$list2 = array() ;
|
134 |
+
foreach ( $img_count as $k => $v ) {
|
135 |
+
$list2[] = array( 'key' => $k, 'value' => $v ) ;
|
136 |
+
}
|
137 |
+
|
138 |
+
WP_CLI\Utils\format_items( 'table', $list, array( 'key', 'value' ) ) ;
|
139 |
+
|
140 |
+
WP_CLI::line( WP_CLI::colorize( "%CImages in database summary:%n" ) ) ;
|
141 |
+
WP_CLI\Utils\format_items( 'table', $list2, array( 'key', 'value' ) ) ;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Show optimization status based on local data
|
146 |
+
*
|
147 |
+
* ## OPTIONS
|
148 |
+
*
|
149 |
+
* ## EXAMPLES
|
150 |
+
*
|
151 |
+
* # Show optimization status
|
152 |
+
* $ wp lscache-iapi s
|
153 |
+
*
|
154 |
+
*/
|
155 |
+
public function s()
|
156 |
+
{
|
157 |
+
$this->status() ;
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Clean up unfinished image data from IAPI server
|
163 |
+
*
|
164 |
+
* ## OPTIONS
|
165 |
+
*
|
166 |
+
* ## EXAMPLES
|
167 |
+
*
|
168 |
+
* # Clean up unfinished requests
|
169 |
+
* $ wp lscache-iapi clean
|
170 |
+
*
|
171 |
+
*/
|
172 |
+
public function clean()
|
173 |
+
{
|
174 |
+
$msg = $this->_img_optm_instance->destroy_unfinished() ;
|
175 |
+
WP_CLI::success( $msg ) ;
|
176 |
+
|
177 |
+
WP_CLI::line( WP_CLI::colorize( "%CLatest status:%n" ) ) ;
|
178 |
+
|
179 |
+
$this->status() ;
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
}
|
css/litespeed.css
CHANGED
@@ -35,7 +35,7 @@
|
|
35 |
}
|
36 |
|
37 |
.litespeed-warning {
|
38 |
-
color: #
|
39 |
}
|
40 |
|
41 |
.litespeed-danger {
|
@@ -46,6 +46,16 @@
|
|
46 |
margin-left: 10px;
|
47 |
}
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
.litespeed-top10 {
|
50 |
margin-top: 10px;
|
51 |
}
|
@@ -63,6 +73,10 @@
|
|
63 |
margin-left: 20px;
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
66 |
.litespeed-desc {
|
67 |
font-size: 12px;
|
68 |
font-weight: normal;
|
@@ -76,6 +90,10 @@
|
|
76 |
display: none !important;
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
79 |
.litespeed-relative {
|
80 |
position: relative ;
|
81 |
}
|
@@ -180,7 +198,7 @@ h3 .litespeed-learn-more {
|
|
180 |
font-style: normal;
|
181 |
}
|
182 |
|
183 |
-
#adminmenu #toplevel_page_lscache-
|
184 |
.litespeed-top-toolbar .ab-icon::before{
|
185 |
content: "\e900";
|
186 |
font-family: 'litespeedfont' !important;
|
@@ -1383,6 +1401,10 @@ g.litespeed-pie_info text{
|
|
1383 |
font-size: 11px ;
|
1384 |
}
|
1385 |
|
|
|
|
|
|
|
|
|
1386 |
|
1387 |
/********************************* block and columns *******************************/
|
1388 |
.litespeed-block,
|
@@ -1650,7 +1672,11 @@ g.litespeed-pie_info text{
|
|
1650 |
transition: width .6s ease;
|
1651 |
}
|
1652 |
|
1653 |
-
.litespeed-progress {
|
|
|
|
|
|
|
|
|
1654 |
display: -webkit-box;
|
1655 |
display: -ms-flexbox;
|
1656 |
display: flex;
|
@@ -1658,6 +1684,19 @@ g.litespeed-pie_info text{
|
|
1658 |
overflow: hidden;
|
1659 |
font-size: .75rem;
|
1660 |
background-color: #e9ecef;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1661 |
}
|
1662 |
|
1663 |
/********************************* form input *******************************/
|
@@ -1754,7 +1793,7 @@ input.litespeed-input[type="file"]{
|
|
1754 |
.litespeed-wrap .litespeed-float-submit {
|
1755 |
position: absolute;
|
1756 |
right: 10px;
|
1757 |
-
top:
|
1758 |
margin-top: 0;
|
1759 |
}
|
1760 |
|
@@ -1829,3 +1868,385 @@ input.litespeed-input-warning {
|
|
1829 |
}
|
1830 |
|
1831 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
.litespeed-warning {
|
38 |
+
color: #FF8C00!important;
|
39 |
}
|
40 |
|
41 |
.litespeed-danger {
|
46 |
margin-left: 10px;
|
47 |
}
|
48 |
|
49 |
+
.litespeed-right10 {
|
50 |
+
margin-right: 10px;
|
51 |
+
}
|
52 |
+
.litespeed-right20 {
|
53 |
+
margin-right: 20px;
|
54 |
+
}
|
55 |
+
.litespeed-right30 {
|
56 |
+
margin-right: 30px;
|
57 |
+
}
|
58 |
+
|
59 |
.litespeed-top10 {
|
60 |
margin-top: 10px;
|
61 |
}
|
73 |
margin-left: 20px;
|
74 |
}
|
75 |
|
76 |
+
.litespeed-left50 {
|
77 |
+
margin-left: 50px;
|
78 |
+
}
|
79 |
+
|
80 |
.litespeed-desc {
|
81 |
font-size: 12px;
|
82 |
font-weight: normal;
|
90 |
display: none !important;
|
91 |
}
|
92 |
|
93 |
+
.litespeed-right{
|
94 |
+
float:right!important;
|
95 |
+
}
|
96 |
+
|
97 |
.litespeed-relative {
|
98 |
position: relative ;
|
99 |
}
|
198 |
font-style: normal;
|
199 |
}
|
200 |
|
201 |
+
#adminmenu #toplevel_page_lscache-settings .menu-icon-generic div.wp-menu-image:before,
|
202 |
.litespeed-top-toolbar .ab-icon::before{
|
203 |
content: "\e900";
|
204 |
font-family: 'litespeedfont' !important;
|
1401 |
font-size: 11px ;
|
1402 |
}
|
1403 |
|
1404 |
+
g.litespeed-pie_info .litespeed-pie-done {
|
1405 |
+
fill: #73b38d ;
|
1406 |
+
}
|
1407 |
+
|
1408 |
|
1409 |
/********************************* block and columns *******************************/
|
1410 |
.litespeed-block,
|
1672 |
transition: width .6s ease;
|
1673 |
}
|
1674 |
|
1675 |
+
.litespeed-progress-bar-yellow {
|
1676 |
+
background-color: #fbe100;
|
1677 |
+
}
|
1678 |
+
|
1679 |
+
/*.litespeed-progress {
|
1680 |
display: -webkit-box;
|
1681 |
display: -ms-flexbox;
|
1682 |
display: flex;
|
1684 |
overflow: hidden;
|
1685 |
font-size: .75rem;
|
1686 |
background-color: #e9ecef;
|
1687 |
+
}*/
|
1688 |
+
.litespeed-progress {
|
1689 |
+
display: -webkit-box;
|
1690 |
+
display: -ms-flexbox;
|
1691 |
+
display: flex;
|
1692 |
+
height: 12px;
|
1693 |
+
overflow: hidden;
|
1694 |
+
font-size: .75rem;
|
1695 |
+
background-color: #e9ecef;
|
1696 |
+
border: 1px solid #dddddd;
|
1697 |
+
border-radius: 8px;
|
1698 |
+
width: 75%;
|
1699 |
+
margin: 5em 1em 1.5em 1em !important;
|
1700 |
}
|
1701 |
|
1702 |
/********************************* form input *******************************/
|
1793 |
.litespeed-wrap .litespeed-float-submit {
|
1794 |
position: absolute;
|
1795 |
right: 10px;
|
1796 |
+
top: -20px;
|
1797 |
margin-top: 0;
|
1798 |
}
|
1799 |
|
1868 |
}
|
1869 |
|
1870 |
|
1871 |
+
/* image optimize page */
|
1872 |
+
.litespeed-width-1-2 {
|
1873 |
+
width: 45%;
|
1874 |
+
padding: 20px;
|
1875 |
+
|
1876 |
+
}
|
1877 |
+
.litespeed-width-7-10 {
|
1878 |
+
width: 65%;
|
1879 |
+
padding: 20px;
|
1880 |
+
}
|
1881 |
+
.litespeed-width-3-10 {
|
1882 |
+
width: 25%;
|
1883 |
+
padding: 20px;
|
1884 |
+
}
|
1885 |
+
|
1886 |
+
.litespeed-column-java {
|
1887 |
+
background: #5CADAD;
|
1888 |
+
}
|
1889 |
+
|
1890 |
+
.litespeed-text-shipgrey {
|
1891 |
+
color: #535342;
|
1892 |
+
}
|
1893 |
+
|
1894 |
+
.litespeed-text-dimgray {
|
1895 |
+
color: #666666;
|
1896 |
+
}
|
1897 |
+
|
1898 |
+
.litespeed-text-whisper {
|
1899 |
+
color: #E6E6E6;
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
.litespeed-text-malibu {
|
1903 |
+
color: #5CBDDE;
|
1904 |
+
}
|
1905 |
+
|
1906 |
+
.litespeed-text-morningglory {
|
1907 |
+
color: #99CCCC;
|
1908 |
+
}
|
1909 |
+
|
1910 |
+
.litespeed-text-fern {
|
1911 |
+
color: #66CC66;
|
1912 |
+
}
|
1913 |
+
|
1914 |
+
.litespeed-text-persiangreen {
|
1915 |
+
color: #009999;
|
1916 |
+
}
|
1917 |
+
|
1918 |
+
.litespeed-text-right {
|
1919 |
+
text-align: right;
|
1920 |
+
}
|
1921 |
+
|
1922 |
+
.litespeed-text-center {
|
1923 |
+
text-align: center;
|
1924 |
+
}
|
1925 |
+
|
1926 |
+
.litespeed-align-center {
|
1927 |
+
margin-left: auto;
|
1928 |
+
margin-right: auto;
|
1929 |
+
}
|
1930 |
+
|
1931 |
+
.litespeed-contrast {
|
1932 |
+
color: white;
|
1933 |
+
}
|
1934 |
+
|
1935 |
+
.litespeed-wrap .litespeed-btn-large {
|
1936 |
+
min-height: 1em !important;
|
1937 |
+
font-size: 1.5em !important;
|
1938 |
+
padding: .5em 1em .5em 1em !important;
|
1939 |
+
}
|
1940 |
+
|
1941 |
+
.litespeed-wrap .litespeed-btn-xlarge {
|
1942 |
+
line-height: 2.3em;
|
1943 |
+
font-size: 2.3em !important;
|
1944 |
+
padding: .25em .75em .25em .75em;
|
1945 |
+
border-radius: 52px;
|
1946 |
+
|
1947 |
+
}
|
1948 |
+
|
1949 |
+
.litespeed-wrap .litespeed-btn-success, .litespeed-btn-success {
|
1950 |
+
color: #36b0b0;
|
1951 |
+
border: 1px solid #36b0b0;
|
1952 |
+
-moz-box-shadow: 0 0 0 1px rgba(54, 176, 176, 0.25);
|
1953 |
+
-webkit-box-shadow: 0 0 0 1px rgba(54, 176, 176, 0.25);
|
1954 |
+
box-shadow: 0 0 0 1px rgba(54, 176, 176, 0.25);
|
1955 |
+
}
|
1956 |
+
|
1957 |
+
.litespeed [class*="litespeed-btn-"], .litespeed-wrap [class*="litespeed-btn-"], [class*="litespeed-btn-"] {
|
1958 |
+
padding: 5px 10px;
|
1959 |
+
font-size: 14px;
|
1960 |
+
font-weight: 400;
|
1961 |
+
border-radius: 3px;
|
1962 |
+
margin: 15px 5px;
|
1963 |
+
text-align: center;
|
1964 |
+
background: #fff;
|
1965 |
+
min-width: 155px;
|
1966 |
+
cursor: pointer;
|
1967 |
+
text-decoration: none;
|
1968 |
+
display: inline-block;
|
1969 |
+
height: initial;
|
1970 |
+
}
|
1971 |
+
|
1972 |
+
.litespeed-empty-space-xlarge {
|
1973 |
+
margin-top: 8em;
|
1974 |
+
}
|
1975 |
+
|
1976 |
+
.litespeed-empty-space-large {
|
1977 |
+
margin-top: 6em;
|
1978 |
+
}
|
1979 |
+
|
1980 |
+
.litespeed-empty-space-medium {
|
1981 |
+
margin-top: 3em;
|
1982 |
+
}
|
1983 |
+
|
1984 |
+
.litespeed-empty-space-small {
|
1985 |
+
margin-top: 2em;
|
1986 |
+
}
|
1987 |
+
|
1988 |
+
.litespeed-empty-space-tiny {
|
1989 |
+
margin-top: 1em;
|
1990 |
+
}
|
1991 |
+
|
1992 |
+
.litespeed-hr-dotted {
|
1993 |
+
border: 1px dotted #eeeeee;
|
1994 |
+
}
|
1995 |
+
|
1996 |
+
.litespeed-flex-container {
|
1997 |
+
display: flex;
|
1998 |
+
flex-wrap: wrap;
|
1999 |
+
width: 100%;
|
2000 |
+
height: auto;
|
2001 |
+
}
|
2002 |
+
|
2003 |
+
.litespeed-hr {
|
2004 |
+
padding-bottom: 1.5em;
|
2005 |
+
border-bottom: .5px solid #97CACA;
|
2006 |
+
}
|
2007 |
+
|
2008 |
+
.litespeed-icon-vertical-middle {
|
2009 |
+
vertical-align: middle;
|
2010 |
+
display: inline-block;
|
2011 |
+
margin:0px 10px 0px 10px;
|
2012 |
+
}
|
2013 |
+
|
2014 |
+
@media screen and (max-width: 814px) {
|
2015 |
+
.litespeed-width-7-10 {
|
2016 |
+
width:100%;
|
2017 |
+
}
|
2018 |
+
.litespeed-width-3-10 {
|
2019 |
+
width:100%;
|
2020 |
+
}
|
2021 |
+
}
|
2022 |
+
|
2023 |
+
.litespeed-column-java .litespeed-danger {
|
2024 |
+
color: #c1c53a!important ;
|
2025 |
+
}
|
2026 |
+
|
2027 |
+
.litespeed-column-java .litespeed-desc {
|
2028 |
+
color: #bfbfbf;
|
2029 |
+
}
|
2030 |
+
|
2031 |
+
.litespeed-column-java code {
|
2032 |
+
color: #c2f5bf;
|
2033 |
+
background-color: #238888 ;
|
2034 |
+
}
|
2035 |
+
.litespeed-column-java .litespeed-title {
|
2036 |
+
color: white;
|
2037 |
+
}
|
2038 |
+
|
2039 |
+
.litespeed-width-7-10 .litespeed-progress {
|
2040 |
+
margin: 1em;
|
2041 |
+
}
|
2042 |
+
|
2043 |
+
.litespeed-refresh:after {
|
2044 |
+
content: "⟳";
|
2045 |
+
width: 20px;
|
2046 |
+
height: 20px;
|
2047 |
+
color: #40ad3a ;
|
2048 |
+
}
|
2049 |
+
|
2050 |
+
.litespeed-column-java .litespeed-refresh:after{
|
2051 |
+
color: #23ec17 ;
|
2052 |
+
}
|
2053 |
+
|
2054 |
+
.litespeed-refresh:hover:after,
|
2055 |
+
.litespeed-refresh:focus:after,
|
2056 |
+
.litespeed-refresh:focus:active:after {
|
2057 |
+
color: #7ffbfb ;
|
2058 |
+
}
|
2059 |
+
|
2060 |
+
.litespeed-width-3-10 .litespeed-title {
|
2061 |
+
margin: 18px 0;
|
2062 |
+
}
|
2063 |
+
|
2064 |
+
.litespeed-silence {
|
2065 |
+
color: #B1B1B1;
|
2066 |
+
}
|
2067 |
+
|
2068 |
+
.litespeed-column-java .litespeed-congratulate {
|
2069 |
+
color: #c2f5bf;
|
2070 |
+
font-size: 20px;
|
2071 |
+
}
|
2072 |
+
|
2073 |
+
.litespeed-light-code .litespeed-silence code {
|
2074 |
+
background-color: #f0f5fb ;
|
2075 |
+
}
|
2076 |
+
|
2077 |
+
.litespeed-column-java .litespeed-btn-danger {
|
2078 |
+
color: #f194a8;
|
2079 |
+
border-color: #f194a8 ;
|
2080 |
+
}
|
2081 |
+
|
2082 |
+
.litespeed-column-java .litespeed-btn-danger:hover {
|
2083 |
+
background: #f194a8 ;
|
2084 |
+
}
|
2085 |
+
|
2086 |
+
.litespeed-column-java svg.litespeed-pie circle.litespeed-pie_bg {
|
2087 |
+
stroke: #e8efe7;
|
2088 |
+
}
|
2089 |
+
|
2090 |
+
.litespeed-column-java svg.litespeed-pie circle.litespeed-pie_circle {
|
2091 |
+
stroke: #97CACA;
|
2092 |
+
}
|
2093 |
+
|
2094 |
+
.litespeed-column-java svg .litespeed-pie_info text {
|
2095 |
+
fill: #F5FFEB;
|
2096 |
+
}
|
2097 |
+
|
2098 |
+
.litespeed-column-java svg g.litespeed-pie_info .litespeed-pie-done {
|
2099 |
+
fill: #a5ffa0;
|
2100 |
+
}
|
2101 |
+
|
2102 |
+
.litespeed-column-java a {
|
2103 |
+
color: #eaf8ff;
|
2104 |
+
}
|
2105 |
+
|
2106 |
+
.litespeed-column-java a:hover {
|
2107 |
+
color: #ffffff;
|
2108 |
+
}
|
2109 |
+
|
2110 |
+
.litespeed-progress-bar-blue {
|
2111 |
+
background-color: #33ADFF;
|
2112 |
+
}
|
2113 |
+
|
2114 |
+
.litespeed-status-current {
|
2115 |
+
font-size: 3.5em;
|
2116 |
+
margin: 1.25em 0em .75em 0em;
|
2117 |
+
}
|
2118 |
+
|
2119 |
+
.litespeed-title, .litespeed-title-short {
|
2120 |
+
margin: 18px 0;
|
2121 |
+
border-bottom: 1px solid #C1D5EA;
|
2122 |
+
margin: 2.5em 0px 1.5em 0 !important;
|
2123 |
+
}
|
2124 |
+
|
2125 |
+
.litespeed-column-java .litespeed-desc {
|
2126 |
+
color: #CAE4E4;
|
2127 |
+
}
|
2128 |
+
|
2129 |
+
.litespeed-column-java .litespeed-warning {
|
2130 |
+
color: #FFD597 !important;
|
2131 |
+
}
|
2132 |
+
|
2133 |
+
.litespeed-column-java .litespeed-btn-success {
|
2134 |
+
color: #DDF1E4;
|
2135 |
+
border: 1px solid #33AD5C;
|
2136 |
+
background: #33AD5C;
|
2137 |
+
}
|
2138 |
+
|
2139 |
+
.litespeed-column-java .litespeed-btn-success:hover {
|
2140 |
+
color: #FFFFFF;
|
2141 |
+
border: 1px solid #7DCA97;
|
2142 |
+
background: #009933;
|
2143 |
+
}
|
2144 |
+
|
2145 |
+
.litespeed-column-java .litespeed-btn-warning {
|
2146 |
+
color: #FFF1DD;
|
2147 |
+
border: 1px solid #FF9933;
|
2148 |
+
background-color: #FF9933;
|
2149 |
+
}
|
2150 |
+
|
2151 |
+
.litespeed-column-java .litespeed-btn-warning:hover {
|
2152 |
+
color: #FFFFFF;
|
2153 |
+
border-color: #FFCA7D;
|
2154 |
+
background: #FF9900;
|
2155 |
+
}
|
2156 |
+
|
2157 |
+
.litespeed-column-java .litespeed-btn-danger {
|
2158 |
+
color: #FFEADD !important;
|
2159 |
+
border: 1px solid #FF6600 !important;
|
2160 |
+
background: #FF5C5C;
|
2161 |
+
}
|
2162 |
+
|
2163 |
+
.litespeed-column-java .litespeed-btn-danger:hover {
|
2164 |
+
color: #FFFFFF;
|
2165 |
+
border: 1px solid #FF9797 !important;
|
2166 |
+
background: #FF0000;
|
2167 |
+
}
|
2168 |
+
|
2169 |
+
.litespeed .litespeed-btn-danger, .litespeed-wrap .litespeed-btn-danger, .litespeed-btn-danger {
|
2170 |
+
color: #cc3d6a;
|
2171 |
+
border: 1px solid #cc3d6a;
|
2172 |
+
-moz-box-shadow: 0 0 0 1px rgba(204, 61, 106, 0.25);
|
2173 |
+
-webkit-box-shadow: 0 0 0 1px rgba(204, 61, 106, 0.25);
|
2174 |
+
box-shadow: 0 0 0 1px rgba(204, 61, 106, 0.25);
|
2175 |
+
}
|
2176 |
+
|
2177 |
+
.litespeed-column-java .litepseed-dash-icon-success, .litepseed-dash-icon-success {
|
2178 |
+
color: #5CDEDE;
|
2179 |
+
font-size: 2em;
|
2180 |
+
margin-top: -.25em;
|
2181 |
+
}
|
2182 |
+
|
2183 |
+
.litespeed-column-java .litepseed-dash-icon-success:hover, .litepseed-dash-icon-success:hover {
|
2184 |
+
color: #7DE5E5;
|
2185 |
+
}
|
2186 |
+
|
2187 |
+
.litespeed-dashicons-large {
|
2188 |
+
font-size: 2em;
|
2189 |
+
}
|
2190 |
+
|
2191 |
+
|
2192 |
+
.litespeed-column-java p {
|
2193 |
+
color: #FFFFFF;
|
2194 |
+
}
|
2195 |
+
|
2196 |
+
.litespeed-body tbody > tr > th.litespeed-padding-left {
|
2197 |
+
padding-left: 3em;
|
2198 |
+
}
|
2199 |
+
|
2200 |
+
.litespeed-txt-small {
|
2201 |
+
font-size: 12px;
|
2202 |
+
}
|
2203 |
+
|
2204 |
+
.litespeed-txt-disabled .litespeed-text-dimgray{
|
2205 |
+
color: #aaaaaa;
|
2206 |
+
}
|
2207 |
+
|
2208 |
+
.litespeed-txt-disabled svg {
|
2209 |
+
fill: #aaaaaa;
|
2210 |
+
}
|
2211 |
+
|
2212 |
+
.litespeed-txt-disabled circle.litespeed-pie_circle {
|
2213 |
+
stroke: #cccccc;
|
2214 |
+
}
|
2215 |
+
.litespeed-txt-disabled g.litespeed-pie_info text {
|
2216 |
+
color: #cccccc;
|
2217 |
+
}
|
2218 |
+
|
2219 |
+
a.litespeed-media-href svg:hover {
|
2220 |
+
border-radius: 50%;
|
2221 |
+
background: #F1FCFF;
|
2222 |
+
fill:#5CCAD7;
|
2223 |
+
box-shadow: 0 0 5px 1px #7DD5DF;
|
2224 |
+
transition: all 0.2s ease-out;
|
2225 |
+
transform: scale(1.05);
|
2226 |
+
}
|
2227 |
+
|
2228 |
+
.litespeed-media-p a .dashicons-trash {
|
2229 |
+
font-size: 2.25em;
|
2230 |
+
vertical-align: middle;
|
2231 |
+
display: inline;
|
2232 |
+
border-radius: 50%;
|
2233 |
+
line-height: 1.5em;
|
2234 |
+
}
|
2235 |
+
|
2236 |
+
.litespeed-media-p a .dashicons-trash:hover {
|
2237 |
+
transition: all .2s ease-out;
|
2238 |
+
color: #FFA500 !important;
|
2239 |
+
background: #FFF5E6;
|
2240 |
+
box-shadow: 0 0 10px 1px #FF8C00;
|
2241 |
+
}
|
2242 |
+
.litespeed-media-p div>svg circle.litespeed-pie_bg {
|
2243 |
+
stroke: #ecf2f9;
|
2244 |
+
}
|
2245 |
+
.litespeed-media-p div>svg circle.litespeed-pie_circle {
|
2246 |
+
stroke: #9fbfdf;
|
2247 |
+
}
|
2248 |
+
.litespeed-media-p div>svg {
|
2249 |
+
fill: #538cc6;
|
2250 |
+
background: rgba(236,242,249,0.1);
|
2251 |
+
border-radius: 50%;
|
2252 |
+
}
|
inc/activation.class.php
CHANGED
@@ -8,6 +8,11 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Activation
|
12 |
{
|
13 |
const NETWORK_TRANSIENT_COUNT = 'lscwp_network_count' ;
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Activation
|
17 |
{
|
18 |
const NETWORK_TRANSIENT_COUNT = 'lscwp_network_count' ;
|
inc/api.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The plugin API class.
|
5 |
*
|
@@ -9,7 +8,12 @@
|
|
9 |
* @subpackage LiteSpeed_Cache/inc
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
{
|
14 |
const VERSION = LiteSpeed_Cache::PLUGIN_VERSION ;
|
15 |
|
@@ -33,10 +37,6 @@ class LiteSpeed_Cache_API
|
|
33 |
const WIDGET_OPID_ESIENABLE = LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ;
|
34 |
const WIDGET_OPID_TTL = LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ;
|
35 |
|
36 |
-
const VAL_OFF = LiteSpeed_Cache_Config::VAL_OFF ;
|
37 |
-
const VAL_ON = LiteSpeed_Cache_Config::VAL_ON ;
|
38 |
-
const VAL_ON2 = LiteSpeed_Cache_Config::VAL_ON2 ;
|
39 |
-
|
40 |
/**
|
41 |
* Start a to-be-removed html wrapper
|
42 |
*
|
@@ -155,7 +155,7 @@ class LiteSpeed_Cache_API
|
|
155 |
*/
|
156 |
public static function set_use_frontpage_ttl()
|
157 |
{
|
158 |
-
LiteSpeed_Cache_Control::set_custom_ttl(self::config(
|
159 |
}
|
160 |
|
161 |
/**
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The plugin API class.
|
4 |
*
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
+
class LiteSpeed_Cache_API extends LiteSpeed_Cache_Const
|
17 |
{
|
18 |
const VERSION = LiteSpeed_Cache::PLUGIN_VERSION ;
|
19 |
|
37 |
const WIDGET_OPID_ESIENABLE = LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ;
|
38 |
const WIDGET_OPID_TTL = LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ;
|
39 |
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* Start a to-be-removed html wrapper
|
42 |
*
|
155 |
*/
|
156 |
public static function set_use_frontpage_ttl()
|
157 |
{
|
158 |
+
LiteSpeed_Cache_Control::set_custom_ttl( self::config( self::OPID_FRONT_PAGE_TTL ) ) ;
|
159 |
}
|
160 |
|
161 |
/**
|
inc/cdn.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The CDN class.
|
5 |
*
|
@@ -10,6 +9,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_CDN
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -441,6 +444,11 @@ class LiteSpeed_Cache_CDN
|
|
441 |
LiteSpeed_Cache_Log::debug2( '[CDN] rewrite ' . $url ) ;
|
442 |
$url_parsed = parse_url( $url ) ;
|
443 |
|
|
|
|
|
|
|
|
|
|
|
444 |
// Only images under wp-cotnent/wp-includes can be replaced
|
445 |
$is_internal_folder = LiteSpeed_Cache_Utility::str_hit_array( $url_parsed[ 'path' ], $this->_cfg_ori_dir ) ;
|
446 |
if ( ! $is_internal_folder ) {
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The CDN class.
|
4 |
*
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_CDN
|
17 |
{
|
18 |
private static $_instance ;
|
444 |
LiteSpeed_Cache_Log::debug2( '[CDN] rewrite ' . $url ) ;
|
445 |
$url_parsed = parse_url( $url ) ;
|
446 |
|
447 |
+
if ( empty( $url_parsed[ 'path' ] ) ) {
|
448 |
+
LiteSpeed_Cache_Log::debug2( '[CDN] -rewrite bypassed: no path' ) ;
|
449 |
+
return false ;
|
450 |
+
}
|
451 |
+
|
452 |
// Only images under wp-cotnent/wp-includes can be replaced
|
453 |
$is_internal_folder = LiteSpeed_Cache_Utility::str_hit_array( $url_parsed[ 'path' ], $this->_cfg_ori_dir ) ;
|
454 |
if ( ! $is_internal_folder ) {
|
inc/cdn/quic.class.php
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The quic.cloud class.
|
4 |
+
*
|
5 |
+
* @since 2.4.1
|
6 |
+
* @package LiteSpeed_Cache
|
7 |
+
* @subpackage LiteSpeed_Cache/inc
|
8 |
+
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
+
*/
|
10 |
+
class LiteSpeed_Cache_CDN_Quic
|
11 |
+
{
|
12 |
+
private static $_instance ;
|
13 |
+
|
14 |
+
private $_api_key ;
|
15 |
+
|
16 |
+
const TYPE_REG = 'reg' ;
|
17 |
+
|
18 |
+
const DB_API_HASH = 'litespeed_cdn_quic_hash' ;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Notify CDN new config updated
|
22 |
+
*
|
23 |
+
* @access public
|
24 |
+
*/
|
25 |
+
public static function sync_config( $options )
|
26 |
+
{
|
27 |
+
if ( empty( $options[ LiteSpeed_Cache_Config::OPT_CDN_QUIC_EMAIL ] ) || empty( $options[ LiteSpeed_Cache_Config::OPT_CDN_QUIC_KEY ] ) ) {
|
28 |
+
return false ;
|
29 |
+
}
|
30 |
+
|
31 |
+
// Security: Remove cf key in report
|
32 |
+
$secure_fields = array(
|
33 |
+
LiteSpeed_Cache_Config::OPID_CDN_CLOUDFLARE_KEY,
|
34 |
+
LiteSpeed_Cache_Config::OPID_CACHE_OBJECT_PSWD,
|
35 |
+
) ;
|
36 |
+
foreach ( $secure_fields as $v ) {
|
37 |
+
if ( ! empty( $options[ $v ] ) ) {
|
38 |
+
$options[ $v ] = str_repeat( '*', strlen( $options[ $v ] ) ) ;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
// Also read data from items
|
43 |
+
$item_options = LiteSpeed_Cache_Config::get_instance()->stored_items() ;
|
44 |
+
foreach ( $item_options as $v ) {
|
45 |
+
// bypass main conf
|
46 |
+
if ( $v == LiteSpeed_Cache_Config::OPTION_NAME ) {
|
47 |
+
continue ;
|
48 |
+
}
|
49 |
+
$options[ $v ] = get_option( $v ) ;
|
50 |
+
}
|
51 |
+
|
52 |
+
$instance = self::get_instance() ;
|
53 |
+
|
54 |
+
// Get site domain
|
55 |
+
$options[ '_domain' ] = home_url() ;
|
56 |
+
|
57 |
+
// Add server env vars
|
58 |
+
$options[ '_server' ] = LiteSpeed_Cache_Config::get_instance()->server_vars() ;
|
59 |
+
|
60 |
+
// Append hooks
|
61 |
+
$options[ '_tp_cookies' ] = apply_filters( 'litespeed_cache_api_vary', array() ) ;
|
62 |
+
|
63 |
+
$res = $instance->_api( '/sync_config', $options ) ;
|
64 |
+
if ( $res != 'ok' ) {
|
65 |
+
LiteSpeed_Cache_Log::debug( '[QUIC] sync config failed [err] ' . $res ) ;
|
66 |
+
}
|
67 |
+
return $res ;
|
68 |
+
}
|
69 |
+
|
70 |
+
private function _show_user_guide()
|
71 |
+
{
|
72 |
+
if ( ! empty( $_POST[ 'step' ] ) ) {
|
73 |
+
if ( empty( $_POST[ 'email' ] ) ) {
|
74 |
+
exit( 'No email' ) ;
|
75 |
+
}
|
76 |
+
|
77 |
+
if ( $_POST[ 'step' ] == 'register' ) {
|
78 |
+
$this->_register() ;
|
79 |
+
}
|
80 |
+
|
81 |
+
if ( $_POST[ 'step' ] == 'login' ) {
|
82 |
+
$this->_login() ;
|
83 |
+
}
|
84 |
+
|
85 |
+
if ( $_POST[ 'step' ] == 'check_email' ) {
|
86 |
+
$this->_check_email() ;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
// Show user panel welcome page
|
91 |
+
$this->_tpl( 'quic.user_welcome', 25 ) ;
|
92 |
+
exit;
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
private function _check_email()
|
97 |
+
{
|
98 |
+
$_email = $_POST[ 'email' ] ;
|
99 |
+
|
100 |
+
// Get email status
|
101 |
+
$response = $this->_api( '/u/email_status', array( 'email' => $_email ) ) ;
|
102 |
+
if ( empty( $response[ 'result' ] ) ) {
|
103 |
+
|
104 |
+
LiteSpeed_Cache_Log::debug( '[QUIC] Query email failed' ) ;
|
105 |
+
|
106 |
+
exit( "QUIC: Query email failed" ) ;
|
107 |
+
}
|
108 |
+
|
109 |
+
$data = array( 'email' => $_email ) ;
|
110 |
+
|
111 |
+
if ( $response[ 'result' ] == 'existing' ) {
|
112 |
+
$this->_tpl( 'quic.login', 50, $data ) ;
|
113 |
+
}
|
114 |
+
elseif ( $response[ 'result' ] == 'none' ) {
|
115 |
+
$this->_tpl( 'quic.register', 50, $data ) ;
|
116 |
+
}
|
117 |
+
else {
|
118 |
+
exit( 'Unkown result' ) ;
|
119 |
+
}
|
120 |
+
|
121 |
+
exit ;
|
122 |
+
}
|
123 |
+
|
124 |
+
private function _register()
|
125 |
+
{
|
126 |
+
$_email = $_POST[ 'email' ] ;
|
127 |
+
|
128 |
+
if ( empty( $_POST[ 'pswd' ] ) ) {
|
129 |
+
exit( 'No password' ) ;
|
130 |
+
}
|
131 |
+
|
132 |
+
// Register
|
133 |
+
$response = $this->_api( '/u/register', array( 'email' => $_email, 'pswd' => $_POST[ 'pswd' ] ) ) ;
|
134 |
+
if ( empty( $response[ 'result' ] ) || $response[ 'result' ] !== 'success' ) {
|
135 |
+
|
136 |
+
LiteSpeed_Cache_Log::debug( '[QUIC] Register failed' ) ;
|
137 |
+
|
138 |
+
exit( "QUIC: Register failed" ) ;
|
139 |
+
}
|
140 |
+
|
141 |
+
// todo: add domain?
|
142 |
+
|
143 |
+
exit ;
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
private function _login()
|
148 |
+
{
|
149 |
+
$_email = $_POST[ 'email' ] ;
|
150 |
+
|
151 |
+
if ( empty( $_POST[ 'pswd' ] ) ) {
|
152 |
+
exit( 'No password' ) ;
|
153 |
+
}
|
154 |
+
|
155 |
+
// Login
|
156 |
+
$response = $this->_api( '/u/login', array( 'email' => $_email, 'pswd' => $_POST[ 'pswd' ] ) ) ;
|
157 |
+
|
158 |
+
$data = array( 'email' => $_email ) ;
|
159 |
+
|
160 |
+
// for login failed, redirect back to login page
|
161 |
+
if ( empty( $response[ 'result' ] ) || $response[ 'result' ] !== 'success' ) {
|
162 |
+
|
163 |
+
LiteSpeed_Cache_Log::debug( '[QUIC] Login failed' ) ;
|
164 |
+
|
165 |
+
$data[ '_err' ] = $response[ 'result' ] ;
|
166 |
+
|
167 |
+
$this->_tpl( 'quic.login', 50, $data ) ;
|
168 |
+
exit ;
|
169 |
+
}
|
170 |
+
|
171 |
+
// Show domains list
|
172 |
+
$this->_show_domains() ;
|
173 |
+
|
174 |
+
exit ;
|
175 |
+
}
|
176 |
+
|
177 |
+
private function _tpl( $tpl, $_progress = false, $data = false )
|
178 |
+
{
|
179 |
+
require LSCWP_DIR . "admin/tpl/inc/modal.header.php" ;
|
180 |
+
require LSCWP_DIR . "admin/tpl/api/$tpl.php" ;
|
181 |
+
require LSCWP_DIR . "admin/tpl/inc/modal.footer.php" ;
|
182 |
+
}
|
183 |
+
|
184 |
+
private function _api( $uri, $data = false, $method = 'POST', $no_hash = false )
|
185 |
+
{
|
186 |
+
LiteSpeed_Cache_Log::debug( '[QUIC] _api call' ) ;
|
187 |
+
|
188 |
+
$hash = 'no_hash' ;
|
189 |
+
if ( ! $no_hash ) {
|
190 |
+
$hash = Litespeed_String::rrand( 16 ) ;
|
191 |
+
// store hash
|
192 |
+
update_option( self::DB_API_HASH, $hash ) ;
|
193 |
+
}
|
194 |
+
|
195 |
+
$url = 'https://api.quic.cloud' . $uri ;
|
196 |
+
|
197 |
+
$param = array(
|
198 |
+
'_v' => LiteSpeed_Cache::PLUGIN_VERSION,
|
199 |
+
'_hash' => $hash,
|
200 |
+
'_data' => $data,
|
201 |
+
) ;
|
202 |
+
|
203 |
+
$response = wp_remote_post( $url, array( 'body' => $param, 'timeout' => 15 ) ) ;
|
204 |
+
|
205 |
+
|
206 |
+
if ( is_wp_error( $response ) ) {
|
207 |
+
$error_message = $response->get_error_message() ;
|
208 |
+
LiteSpeed_Cache_Log::debug( '[QUIC] failed to post: ' . $error_message ) ;
|
209 |
+
return $error_message ;
|
210 |
+
}
|
211 |
+
LiteSpeed_Cache_Log::debug( '[QUIC] _api call response: ' . $response[ 'body' ] ) ;
|
212 |
+
|
213 |
+
$json = json_decode( $response[ 'body' ], true ) ;
|
214 |
+
|
215 |
+
return $json ;
|
216 |
+
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Handle all request actions from main cls
|
221 |
+
*
|
222 |
+
* @since 2.0
|
223 |
+
* @access public
|
224 |
+
*/
|
225 |
+
public static function handler()
|
226 |
+
{
|
227 |
+
LiteSpeed_Cache_Log::debug( '[QUIC] init' ) ;
|
228 |
+
$instance = self::get_instance() ;
|
229 |
+
|
230 |
+
$type = LiteSpeed_Cache_Router::verify_type() ;
|
231 |
+
|
232 |
+
switch ( $type ) {
|
233 |
+
|
234 |
+
default:
|
235 |
+
$instance->_show_user_guide() ;
|
236 |
+
break ;
|
237 |
+
}
|
238 |
+
|
239 |
+
LiteSpeed_Cache_Admin::redirect() ;
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Get the current instance object.
|
244 |
+
*
|
245 |
+
* @since 1.8
|
246 |
+
* @access public
|
247 |
+
* @return Current class instance.
|
248 |
+
*/
|
249 |
+
public static function get_instance()
|
250 |
+
{
|
251 |
+
if ( ! isset( self::$_instance ) ) {
|
252 |
+
self::$_instance = new self() ;
|
253 |
+
}
|
254 |
+
|
255 |
+
return self::$_instance ;
|
256 |
+
}
|
257 |
+
}
|
inc/config.class.php
CHANGED
@@ -10,6 +10,11 @@
|
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
|
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -244,7 +249,7 @@ class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
|
244 |
$instance = self::get_instance() ;
|
245 |
$list = $instance->get_item( $id ) ;
|
246 |
|
247 |
-
$list[] = $_SERVER[ 'HTTP_REFERER' ] ;
|
248 |
$list = LiteSpeed_Cache_Utility::sanitize_lines( $list, 'relative' ) ;
|
249 |
|
250 |
update_option( $id, $list ) ;
|
@@ -440,18 +445,21 @@ class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
|
440 |
$dkeys = array_keys($default_options) ;
|
441 |
$keys = array_keys($options) ;
|
442 |
$newkeys = array_diff($dkeys, $keys) ;
|
443 |
-
$log = '' ;//todo: useless
|
444 |
if ( ! empty($newkeys) ) {
|
445 |
foreach ( $newkeys as $newkey ) {
|
446 |
$options[$newkey] = $default_options[$newkey] ;
|
447 |
-
|
|
|
|
|
448 |
}
|
449 |
}
|
450 |
$retiredkeys = array_diff($keys, $dkeys) ;
|
451 |
if ( ! empty($retiredkeys) ) {
|
452 |
foreach ( $retiredkeys as $retired ) {
|
453 |
unset($options[$retired]) ;
|
454 |
-
|
|
|
|
|
455 |
}
|
456 |
}
|
457 |
$options[self::OPID_VERSION] = LiteSpeed_Cache::PLUGIN_VERSION ;
|
@@ -510,10 +518,11 @@ class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
|
510 |
|
511 |
$this->options = self::option_diff( $default_options, $this->options ) ;
|
512 |
|
513 |
-
$
|
514 |
define( 'LSWCP_EMPTYCACHE', true ) ;// clear all sites caches
|
515 |
LiteSpeed_Cache_Purge::purge_all() ;
|
516 |
-
|
|
|
517 |
|
518 |
// Update img_optm table data for upgrading
|
519 |
LiteSpeed_Cache_Data::get_instance() ;
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
13 |
+
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die ;
|
16 |
+
}
|
17 |
+
|
18 |
class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
19 |
{
|
20 |
private static $_instance ;
|
249 |
$instance = self::get_instance() ;
|
250 |
$list = $instance->get_item( $id ) ;
|
251 |
|
252 |
+
$list[] = $_SERVER[ 'HTTP_REFERER' ] . '$' ;
|
253 |
$list = LiteSpeed_Cache_Utility::sanitize_lines( $list, 'relative' ) ;
|
254 |
|
255 |
update_option( $id, $list ) ;
|
445 |
$dkeys = array_keys($default_options) ;
|
446 |
$keys = array_keys($options) ;
|
447 |
$newkeys = array_diff($dkeys, $keys) ;
|
|
|
448 |
if ( ! empty($newkeys) ) {
|
449 |
foreach ( $newkeys as $newkey ) {
|
450 |
$options[$newkey] = $default_options[$newkey] ;
|
451 |
+
|
452 |
+
$log = '[Added] ' . $newkey . ' = ' . $default_options[$newkey] ;
|
453 |
+
LiteSpeed_Cache_Log::debug( "[Cfg] option_diff $log" ) ;
|
454 |
}
|
455 |
}
|
456 |
$retiredkeys = array_diff($keys, $dkeys) ;
|
457 |
if ( ! empty($retiredkeys) ) {
|
458 |
foreach ( $retiredkeys as $retired ) {
|
459 |
unset($options[$retired]) ;
|
460 |
+
|
461 |
+
$log = '[Removed] ' . $retired ;
|
462 |
+
LiteSpeed_Cache_Log::debug( "[Cfg] option_diff $log" ) ;
|
463 |
}
|
464 |
}
|
465 |
$options[self::OPID_VERSION] = LiteSpeed_Cache::PLUGIN_VERSION ;
|
518 |
|
519 |
$this->options = self::option_diff( $default_options, $this->options ) ;
|
520 |
|
521 |
+
$this->update_options() ;
|
522 |
define( 'LSWCP_EMPTYCACHE', true ) ;// clear all sites caches
|
523 |
LiteSpeed_Cache_Purge::purge_all() ;
|
524 |
+
|
525 |
+
LiteSpeed_Cache_Log::debug( "[Cfg] plugin_upgrade option changed" ) ;
|
526 |
|
527 |
// Update img_optm table data for upgrading
|
528 |
LiteSpeed_Cache_Data::get_instance() ;
|
inc/const.cls.php
CHANGED
@@ -38,6 +38,7 @@ class LiteSpeed_Cache_Const
|
|
38 |
const ITEM_SETTING_MODE = 'litespeed-setting-mode' ;
|
39 |
const ITEM_CRAWLER_HASH = 'litespeed-crawler-hash' ;
|
40 |
const ITEM_GUIDE = 'litespeed-guide' ; // Array of each guidance tag as key, step as val
|
|
|
41 |
|
42 |
// Server variables
|
43 |
const ENV_CRAWLER_USLEEP = 'CRAWLER_USLEEP' ;
|
@@ -167,10 +168,9 @@ class LiteSpeed_Cache_Const
|
|
167 |
const OPID_CDN_ORI = 'cdn_ori' ;
|
168 |
const OPID_CDN_EXCLUDE = 'cdn_exclude' ;
|
169 |
const OPID_CDN_REMOTE_JQUERY = 'cdn_remote_jquery' ;
|
170 |
-
const
|
171 |
-
const
|
172 |
-
const
|
173 |
-
const OPID_CDN_QUIC_SITE = 'cdn_quic_site' ;
|
174 |
const OPID_CDN_CLOUDFLARE = 'cdn_cloudflare' ;
|
175 |
const OPID_CDN_CLOUDFLARE_EMAIL = 'cdn_cloudflare_email' ;
|
176 |
const OPID_CDN_CLOUDFLARE_KEY = 'cdn_cloudflare_key' ;
|
@@ -180,9 +180,11 @@ class LiteSpeed_Cache_Const
|
|
180 |
const OPID_MEDIA_IMG_LAZY = 'media_img_lazy' ;
|
181 |
const OPID_MEDIA_IMG_LAZY_PLACEHOLDER = 'media_img_lazy_placeholder' ;
|
182 |
const OPID_MEDIA_IFRAME_LAZY = 'media_iframe_lazy' ;
|
|
|
183 |
const OPT_MEDIA_OPTM_AUTO = 'media_optm_auto' ;
|
184 |
const OPT_MEDIA_OPTM_CRON = 'media_optm_cron' ;
|
185 |
const OPT_MEDIA_OPTM_ORI = 'media_optm_ori' ;
|
|
|
186 |
const OPT_MEDIA_OPTM_WEBP = 'media_optm_webp' ;
|
187 |
const OPT_MEDIA_OPTM_LOSSLESS = 'media_optm_lossless' ;
|
188 |
const OPT_MEDIA_OPTM_EXIF = 'media_optm_exif' ;
|
@@ -216,6 +218,11 @@ class LiteSpeed_Cache_Const
|
|
216 |
const CRWL_ALPHA_DESC = 'alpha_desc' ;
|
217 |
const CRWL_ALPHA_ASC = 'alpha_asc' ;
|
218 |
|
|
|
|
|
|
|
|
|
|
|
219 |
/**
|
220 |
* Get the items in wp_options that need for backup
|
221 |
*
|
@@ -236,6 +243,7 @@ class LiteSpeed_Cache_Const
|
|
236 |
self::ITEM_ENV_REF,
|
237 |
self::ITEM_CACHE_DROP_QS,
|
238 |
self::ITEM_CDN_MAPPING,
|
|
|
239 |
self::ITEM_DNS_PREFETCH,
|
240 |
self::ITEM_CLOUDFLARE_STATUS,
|
241 |
self::ITEM_LOG_IGNORE_FILTERS,
|
@@ -248,6 +256,7 @@ class LiteSpeed_Cache_Const
|
|
248 |
self::ITEM_CACHE_URI_PRIV,
|
249 |
self::ITEM_OPTM_EXCLUDES,
|
250 |
self::ITEM_EXCLUDES_URI,
|
|
|
251 |
) ;
|
252 |
}
|
253 |
|
@@ -442,22 +451,23 @@ class LiteSpeed_Cache_Const
|
|
442 |
self::OPID_CDN_ORI => '',
|
443 |
self::OPID_CDN_EXCLUDE => '',
|
444 |
self::OPID_CDN_REMOTE_JQUERY => false,
|
445 |
-
self::
|
446 |
-
self::
|
447 |
-
self::
|
448 |
-
self::OPID_CDN_QUIC_SITE => '',
|
449 |
self::OPID_CDN_CLOUDFLARE => false,
|
450 |
self::OPID_CDN_CLOUDFLARE_EMAIL => '',
|
451 |
self::OPID_CDN_CLOUDFLARE_KEY => '',
|
452 |
self::OPID_CDN_CLOUDFLARE_NAME => '',
|
453 |
self::OPID_CDN_CLOUDFLARE_ZONE => '',
|
454 |
|
455 |
-
self::OPID_MEDIA_IMG_LAZY
|
456 |
self::OPID_MEDIA_IMG_LAZY_PLACEHOLDER => '',
|
457 |
-
self::OPID_MEDIA_IFRAME_LAZY
|
|
|
458 |
self::OPT_MEDIA_OPTM_AUTO => false,
|
459 |
self::OPT_MEDIA_OPTM_CRON => true,
|
460 |
self::OPT_MEDIA_OPTM_ORI => true,
|
|
|
461 |
self::OPT_MEDIA_OPTM_WEBP => false,
|
462 |
self::OPT_MEDIA_OPTM_LOSSLESS => false,
|
463 |
self::OPT_MEDIA_OPTM_EXIF => false,
|
@@ -502,6 +512,36 @@ class LiteSpeed_Cache_Const
|
|
502 |
return array_merge($default_options, $tp_options) ;
|
503 |
}
|
504 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
|
506 |
/**
|
507 |
* Gets the third party options.
|
38 |
const ITEM_SETTING_MODE = 'litespeed-setting-mode' ;
|
39 |
const ITEM_CRAWLER_HASH = 'litespeed-crawler-hash' ;
|
40 |
const ITEM_GUIDE = 'litespeed-guide' ; // Array of each guidance tag as key, step as val
|
41 |
+
const ITEM_TIMESTAMP_PURGE_CSS = 'litespeed-timestamp-purge-css' ;
|
42 |
|
43 |
// Server variables
|
44 |
const ENV_CRAWLER_USLEEP = 'CRAWLER_USLEEP' ;
|
168 |
const OPID_CDN_ORI = 'cdn_ori' ;
|
169 |
const OPID_CDN_EXCLUDE = 'cdn_exclude' ;
|
170 |
const OPID_CDN_REMOTE_JQUERY = 'cdn_remote_jquery' ;
|
171 |
+
const OPT_CDN_QUIC = 'cdn_quic' ;
|
172 |
+
const OPT_CDN_QUIC_EMAIL = 'cdn_quic_email' ;
|
173 |
+
const OPT_CDN_QUIC_KEY = 'cdn_quic_key' ;
|
|
|
174 |
const OPID_CDN_CLOUDFLARE = 'cdn_cloudflare' ;
|
175 |
const OPID_CDN_CLOUDFLARE_EMAIL = 'cdn_cloudflare_email' ;
|
176 |
const OPID_CDN_CLOUDFLARE_KEY = 'cdn_cloudflare_key' ;
|
180 |
const OPID_MEDIA_IMG_LAZY = 'media_img_lazy' ;
|
181 |
const OPID_MEDIA_IMG_LAZY_PLACEHOLDER = 'media_img_lazy_placeholder' ;
|
182 |
const OPID_MEDIA_IFRAME_LAZY = 'media_iframe_lazy' ;
|
183 |
+
const OPID_MEDIA_IMG_LAZYJS_INLINE = 'media_img_lazyjs_inline' ;
|
184 |
const OPT_MEDIA_OPTM_AUTO = 'media_optm_auto' ;
|
185 |
const OPT_MEDIA_OPTM_CRON = 'media_optm_cron' ;
|
186 |
const OPT_MEDIA_OPTM_ORI = 'media_optm_ori' ;
|
187 |
+
const OPT_MEDIA_RM_ORI_BKUP = 'media_rm_ori_bkup' ;
|
188 |
const OPT_MEDIA_OPTM_WEBP = 'media_optm_webp' ;
|
189 |
const OPT_MEDIA_OPTM_LOSSLESS = 'media_optm_lossless' ;
|
190 |
const OPT_MEDIA_OPTM_EXIF = 'media_optm_exif' ;
|
218 |
const CRWL_ALPHA_DESC = 'alpha_desc' ;
|
219 |
const CRWL_ALPHA_ASC = 'alpha_asc' ;
|
220 |
|
221 |
+
const IMG_OPTM_BM_ORI = 1 ;
|
222 |
+
const IMG_OPTM_BM_WEBP = 2 ;
|
223 |
+
const IMG_OPTM_BM_LOSSLESS = 4 ;
|
224 |
+
const IMG_OPTM_BM_EXIF = 8 ;
|
225 |
+
|
226 |
/**
|
227 |
* Get the items in wp_options that need for backup
|
228 |
*
|
243 |
self::ITEM_ENV_REF,
|
244 |
self::ITEM_CACHE_DROP_QS,
|
245 |
self::ITEM_CDN_MAPPING,
|
246 |
+
self::ITEM_CDN_ORI_DIR,
|
247 |
self::ITEM_DNS_PREFETCH,
|
248 |
self::ITEM_CLOUDFLARE_STATUS,
|
249 |
self::ITEM_LOG_IGNORE_FILTERS,
|
256 |
self::ITEM_CACHE_URI_PRIV,
|
257 |
self::ITEM_OPTM_EXCLUDES,
|
258 |
self::ITEM_EXCLUDES_URI,
|
259 |
+
self::ITEM_MEDIA_WEBP_ATTRIBUTE,
|
260 |
) ;
|
261 |
}
|
262 |
|
451 |
self::OPID_CDN_ORI => '',
|
452 |
self::OPID_CDN_EXCLUDE => '',
|
453 |
self::OPID_CDN_REMOTE_JQUERY => false,
|
454 |
+
self::OPT_CDN_QUIC => false,
|
455 |
+
self::OPT_CDN_QUIC_EMAIL => '',
|
456 |
+
self::OPT_CDN_QUIC_KEY => '',
|
|
|
457 |
self::OPID_CDN_CLOUDFLARE => false,
|
458 |
self::OPID_CDN_CLOUDFLARE_EMAIL => '',
|
459 |
self::OPID_CDN_CLOUDFLARE_KEY => '',
|
460 |
self::OPID_CDN_CLOUDFLARE_NAME => '',
|
461 |
self::OPID_CDN_CLOUDFLARE_ZONE => '',
|
462 |
|
463 |
+
self::OPID_MEDIA_IMG_LAZY => false,
|
464 |
self::OPID_MEDIA_IMG_LAZY_PLACEHOLDER => '',
|
465 |
+
self::OPID_MEDIA_IFRAME_LAZY => false,
|
466 |
+
self::OPID_MEDIA_IMG_LAZYJS_INLINE => false,
|
467 |
self::OPT_MEDIA_OPTM_AUTO => false,
|
468 |
self::OPT_MEDIA_OPTM_CRON => true,
|
469 |
self::OPT_MEDIA_OPTM_ORI => true,
|
470 |
+
self::OPT_MEDIA_RM_ORI_BKUP => false,
|
471 |
self::OPT_MEDIA_OPTM_WEBP => false,
|
472 |
self::OPT_MEDIA_OPTM_LOSSLESS => false,
|
473 |
self::OPT_MEDIA_OPTM_EXIF => false,
|
512 |
return array_merge($default_options, $tp_options) ;
|
513 |
}
|
514 |
|
515 |
+
/**
|
516 |
+
* Generate server vars
|
517 |
+
*
|
518 |
+
* @since 2.4.1
|
519 |
+
*/
|
520 |
+
public function server_vars()
|
521 |
+
{
|
522 |
+
$consts = array(
|
523 |
+
'WP_SITEURL',
|
524 |
+
'WP_HOME',
|
525 |
+
'WP_CONTENT_DIR',
|
526 |
+
'SHORTINIT',
|
527 |
+
'LSCWP_CONTENT_DIR',
|
528 |
+
'LSCWP_CONTENT_FOLDER',
|
529 |
+
'LSCWP_DIR',
|
530 |
+
'LITESPEED_TIME_OFFSET',
|
531 |
+
'LITESPEED_SERVER_TYPE',
|
532 |
+
'LITESPEED_CLI',
|
533 |
+
'LITESPEED_ALLOWED',
|
534 |
+
'LITESPEED_ON',
|
535 |
+
'LITESPEED_ON_IN_SETTING',
|
536 |
+
'LSCACHE_ADV_CACHE',
|
537 |
+
) ;
|
538 |
+
$server_vars = array() ;
|
539 |
+
foreach ( $consts as $v ) {
|
540 |
+
$server_vars[ $v ] = defined( $v ) ? constant( $v ) : NULL ;
|
541 |
+
}
|
542 |
+
|
543 |
+
return $server_vars ;
|
544 |
+
}
|
545 |
|
546 |
/**
|
547 |
* Gets the third party options.
|
inc/control.class.php
CHANGED
@@ -8,6 +8,11 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Control
|
12 |
{
|
13 |
private static $_instance ;
|
@@ -476,7 +481,8 @@ class LiteSpeed_Cache_Control
|
|
476 |
public static function output()
|
477 |
{
|
478 |
$esi_hdr = '' ;
|
479 |
-
|
|
|
480 |
$esi_hdr = ',esi=on' ;
|
481 |
}
|
482 |
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Control
|
17 |
{
|
18 |
private static $_instance ;
|
481 |
public static function output()
|
482 |
{
|
483 |
$esi_hdr = '' ;
|
484 |
+
// Fix cli `uninstall --deactivate` fatal err
|
485 |
+
if ( LSWCP_ESI_SUPPORT && class_exists( 'LiteSpeed_Cache_ESI' ) && LiteSpeed_Cache_ESI::has_esi() ) {
|
486 |
$esi_hdr = ',esi=on' ;
|
487 |
}
|
488 |
|
inc/crawler-sitemap.class.php
CHANGED
@@ -10,6 +10,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Crawler_Sitemap
|
14 |
{
|
15 |
private static $_instance ;
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
13 |
+
if ( ! defined( 'WPINC' ) ) {
|
14 |
+
die ;
|
15 |
+
}
|
16 |
+
|
17 |
class LiteSpeed_Cache_Crawler_Sitemap
|
18 |
{
|
19 |
private static $_instance ;
|
inc/crawler.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The crawler class
|
5 |
*
|
@@ -10,6 +9,11 @@
|
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
|
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Crawler
|
14 |
{
|
15 |
private static $_instance;
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The crawler class
|
4 |
*
|
9 |
* @subpackage LiteSpeed_Cache/inc
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
+
|
13 |
+
if ( ! defined( 'WPINC' ) ) {
|
14 |
+
die ;
|
15 |
+
}
|
16 |
+
|
17 |
class LiteSpeed_Cache_Crawler
|
18 |
{
|
19 |
private static $_instance;
|
inc/css.cls.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The optimize css class.
|
5 |
*
|
@@ -9,6 +8,10 @@
|
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_CSS
|
13 |
{
|
14 |
private static $_instance ;
|
@@ -109,6 +112,14 @@ class LiteSpeed_Cache_CSS
|
|
109 |
if ( file_exists( LSCWP_CONTENT_DIR . '/cache/ccss' ) ) {
|
110 |
Litespeed_File::rrmdir( LSCWP_CONTENT_DIR . '/cache/ccss' ) ;
|
111 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
113 |
|
114 |
/**
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The optimize css class.
|
4 |
*
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
10 |
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
class LiteSpeed_Cache_CSS
|
16 |
{
|
17 |
private static $_instance ;
|
112 |
if ( file_exists( LSCWP_CONTENT_DIR . '/cache/ccss' ) ) {
|
113 |
Litespeed_File::rrmdir( LSCWP_CONTENT_DIR . '/cache/ccss' ) ;
|
114 |
}
|
115 |
+
|
116 |
+
// Clear CCSS in queue too
|
117 |
+
$req_summary = self::get_summary() ;
|
118 |
+
$req_summary[ 'queue' ] = array() ;
|
119 |
+
$req_summary[ 'curr_request' ] = 0 ;
|
120 |
+
$this->_save_summary( $req_summary ) ;
|
121 |
+
|
122 |
+
LiteSpeed_Cache_Log::debug2( '[CSS] Cleared ccss queue' ) ;
|
123 |
}
|
124 |
|
125 |
/**
|
inc/data.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The class to store and manage litespeed db data.
|
5 |
*
|
@@ -10,6 +9,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Data
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -153,47 +156,74 @@ class LiteSpeed_Cache_Data
|
|
153 |
}
|
154 |
|
155 |
// Table version only exists after all old data migrated
|
|
|
156 |
$ver = get_option( $this->_tb_img_optm ) ;
|
157 |
-
if ( $ver &&
|
158 |
return ;
|
159 |
}
|
160 |
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
if ( $
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
}
|
180 |
-
$mids_to_del[] = $v->meta_id ;
|
181 |
|
182 |
-
|
183 |
-
if ( count( $mids_to_del ) > 100 || $k == $max_k ) {
|
184 |
-
$q = "DELETE FROM $wpdb->postmeta WHERE meta_id IN ( " . implode( ',', array_fill( 0, count( $mids_to_del ), '%s' ) ) . " ) " ;
|
185 |
-
$wpdb->query( $wpdb->prepare( $q, $mids_to_del ) ) ;
|
186 |
-
|
187 |
-
$mids_to_del = array() ;
|
188 |
-
}
|
189 |
}
|
190 |
|
191 |
-
|
|
|
|
|
192 |
}
|
193 |
|
194 |
-
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
// Record tb version
|
199 |
update_option( $this->_tb_img_optm, LiteSpeed_Cache::PLUGIN_VERSION ) ;
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The class to store and manage litespeed db data.
|
4 |
*
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Data
|
17 |
{
|
18 |
private static $_instance ;
|
156 |
}
|
157 |
|
158 |
// Table version only exists after all old data migrated
|
159 |
+
// Last modified is v2.4.2
|
160 |
$ver = get_option( $this->_tb_img_optm ) ;
|
161 |
+
if ( $ver && version_compare( $ver, '2.4.2', '>=' ) ) {
|
162 |
return ;
|
163 |
}
|
164 |
|
165 |
+
/**
|
166 |
+
* Convert old data from postmeta to img_optm table
|
167 |
+
* @since 2.0
|
168 |
+
*/
|
169 |
+
if ( ! $ver || version_compare( $ver, '2.0', '<' ) ) {
|
170 |
+
// Migrate data from `wp_postmeta` to `wp_litespeed_img_optm`
|
171 |
+
$mids_to_del = array() ;
|
172 |
+
$q = "SELECT * FROM $wpdb->postmeta WHERE meta_key = %s ORDER BY meta_id" ;
|
173 |
+
$meta_value_list = $wpdb->get_results( $wpdb->prepare( $q, array( LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_DATA ) ) ) ;
|
174 |
+
if ( $meta_value_list ) {
|
175 |
+
$max_k = count( $meta_value_list ) - 1 ;
|
176 |
+
foreach ( $meta_value_list as $k => $v ) {
|
177 |
+
$md52src_list = unserialize( $v->meta_value ) ;
|
178 |
+
foreach ( $md52src_list as $md5 => $v2 ) {
|
179 |
+
$f = array(
|
180 |
+
'post_id' => $v->post_id,
|
181 |
+
'optm_status' => $v2[ 1 ],
|
182 |
+
'src' => $v2[ 0 ],
|
183 |
+
'srcpath_md5' => md5( $v2[ 0 ] ),
|
184 |
+
'src_md5' => $md5,
|
185 |
+
'server' => $v2[ 2 ],
|
186 |
+
) ;
|
187 |
+
$wpdb->replace( $this->_tb_img_optm, $f ) ;
|
188 |
+
}
|
189 |
+
$mids_to_del[] = $v->meta_id ;
|
190 |
+
|
191 |
+
// Delete from postmeta
|
192 |
+
if ( count( $mids_to_del ) > 100 || $k == $max_k ) {
|
193 |
+
$q = "DELETE FROM $wpdb->postmeta WHERE meta_id IN ( " . implode( ',', array_fill( 0, count( $mids_to_del ), '%s' ) ) . " ) " ;
|
194 |
+
$wpdb->query( $wpdb->prepare( $q, $mids_to_del ) ) ;
|
195 |
+
|
196 |
+
$mids_to_del = array() ;
|
197 |
+
}
|
198 |
}
|
|
|
199 |
|
200 |
+
LiteSpeed_Cache_Log::debug( '[Data] img_optm inserted records: ' . $k ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
}
|
202 |
|
203 |
+
$q = "DELETE FROM $wpdb->postmeta WHERE meta_key = %s" ;
|
204 |
+
$rows = $wpdb->query( $wpdb->prepare( $q, LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_STATUS ) ) ;
|
205 |
+
LiteSpeed_Cache_Log::debug( '[Data] img_optm delete optm_status records: ' . $rows ) ;
|
206 |
}
|
207 |
|
208 |
+
/**
|
209 |
+
* Add target_md5 field to table
|
210 |
+
* @since 2.4.2
|
211 |
+
*/
|
212 |
+
if ( $ver && version_compare( $ver, '2.4.2', '<' ) && version_compare( $ver, '2.0', '>=' ) ) {// NOTE: For new users, need to bypass this section, thats why used the first cond
|
213 |
+
$sql = sprintf(
|
214 |
+
'ALTER TABLE `%1$s` ADD `server_info` text NOT NULL, DROP COLUMN `server`',
|
215 |
+
$this->_tb_img_optm
|
216 |
+
) ;
|
217 |
+
|
218 |
+
$res = $wpdb->query( $sql ) ;
|
219 |
+
if ( $res !== true ) {
|
220 |
+
LiteSpeed_Cache_Log::debug( '[Data] Warning: Alter table img_optm failed!', $sql ) ;
|
221 |
+
}
|
222 |
+
else {
|
223 |
+
LiteSpeed_Cache_Log::debug( '[Data] Successfully upgraded table img_optm.' ) ;
|
224 |
+
}
|
225 |
+
|
226 |
+
}
|
227 |
|
228 |
// Record tb version
|
229 |
update_option( $this->_tb_img_optm, LiteSpeed_Cache::PLUGIN_VERSION ) ;
|
inc/data_structure/img_optm.sql
CHANGED
@@ -4,13 +4,13 @@
|
|
4 |
`src` varchar(1000) NOT NULL DEFAULT '',
|
5 |
`srcpath_md5` varchar(128) NOT NULL DEFAULT '',
|
6 |
`src_md5` varchar(128) NOT NULL DEFAULT '',
|
7 |
-
`server` varchar(255) NOT NULL DEFAULT '',
|
8 |
`root_id` int(11) NOT NULL DEFAULT '0',
|
9 |
`src_filesize` int(11) NOT NULL DEFAULT '0',
|
10 |
`target_filesize` int(11) NOT NULL DEFAULT '0',
|
11 |
`target_saved` int(11) NOT NULL DEFAULT '0',
|
12 |
`webp_filesize` int(11) NOT NULL DEFAULT '0',
|
13 |
`webp_saved` int(11) NOT NULL DEFAULT '0',
|
|
|
14 |
PRIMARY KEY (`id`),
|
15 |
UNIQUE KEY `post_id_2` (`post_id`,`srcpath_md5`),
|
16 |
KEY `post_id` (`post_id`),
|
4 |
`src` varchar(1000) NOT NULL DEFAULT '',
|
5 |
`srcpath_md5` varchar(128) NOT NULL DEFAULT '',
|
6 |
`src_md5` varchar(128) NOT NULL DEFAULT '',
|
|
|
7 |
`root_id` int(11) NOT NULL DEFAULT '0',
|
8 |
`src_filesize` int(11) NOT NULL DEFAULT '0',
|
9 |
`target_filesize` int(11) NOT NULL DEFAULT '0',
|
10 |
`target_saved` int(11) NOT NULL DEFAULT '0',
|
11 |
`webp_filesize` int(11) NOT NULL DEFAULT '0',
|
12 |
`webp_saved` int(11) NOT NULL DEFAULT '0',
|
13 |
+
`server_info` text NOT NULL,
|
14 |
PRIMARY KEY (`id`),
|
15 |
UNIQUE KEY `post_id_2` (`post_id`,`srcpath_md5`),
|
16 |
KEY `post_id` (`post_id`),
|
inc/doc.cls.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The Doc class.
|
5 |
*
|
@@ -9,6 +8,10 @@
|
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Doc
|
13 |
{
|
14 |
// private static $_instance ;
|
@@ -24,4 +27,16 @@ class LiteSpeed_Cache_Doc
|
|
24 |
return __( 'This site utilizes caching in order to facilitate a faster response time and better user experience. Caching potentially stores a duplicate copy of every web page that is on display on this site. All cache files are temporary, and are never accessed by any third party, except as necessary to obtain technical support from the cache plugin vendor. Cache files expire on a schedule set by the site administrator, but may easily be purged by the admin before their natural expiration, if necessary.', 'litespeed-cache' ) ;
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The Doc class.
|
4 |
*
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
10 |
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
class LiteSpeed_Cache_Doc
|
16 |
{
|
17 |
// private static $_instance ;
|
27 |
return __( 'This site utilizes caching in order to facilitate a faster response time and better user experience. Caching potentially stores a duplicate copy of every web page that is on display on this site. All cache files are temporary, and are never accessed by any third party, except as necessary to obtain technical support from the cache plugin vendor. Cache files expire on a schedule set by the site administrator, but may easily be purged by the admin before their natural expiration, if necessary.', 'litespeed-cache' ) ;
|
28 |
}
|
29 |
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Learn more link
|
33 |
+
*
|
34 |
+
* @since 2.4.2
|
35 |
+
* @access public
|
36 |
+
*/
|
37 |
+
public static function learn_more( $url )
|
38 |
+
{
|
39 |
+
return ' <a href="' . $url . '" target="_blank" class="litespeed-learn-more">' . __( 'Learn More', 'litespeed-cache' ) . '</a>' ;
|
40 |
+
}
|
41 |
+
|
42 |
}
|
inc/esi.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The esi class.
|
5 |
*
|
@@ -11,6 +10,11 @@
|
|
11 |
* @subpackage LiteSpeed_Cache/inc
|
12 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
13 |
*/
|
|
|
|
|
|
|
|
|
|
|
14 |
class LiteSpeed_Cache_ESI
|
15 |
{
|
16 |
private static $_instance ;
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The esi class.
|
4 |
*
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
13 |
+
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die ;
|
16 |
+
}
|
17 |
+
|
18 |
class LiteSpeed_Cache_ESI
|
19 |
{
|
20 |
private static $_instance ;
|
inc/gui.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The frontend GUI class.
|
5 |
*
|
@@ -10,6 +9,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_GUI
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -83,7 +86,7 @@ class LiteSpeed_Cache_GUI
|
|
83 |
{
|
84 |
$percentage = '<text x="16.91549431" y="15.5">' . $percent . '%</text>' ;
|
85 |
if ( $percent == 100 && $finished_tick ) {
|
86 |
-
$percentage = '<text x="16.91549431" y="15.5"
|
87 |
}
|
88 |
return "
|
89 |
<svg class='litespeed-pie' viewbox='0 0 33.83098862 33.83098862' width='$width' height='$width' xmlns='http://www.w3.org/2000/svg'>
|
@@ -339,15 +342,15 @@ class LiteSpeed_Cache_GUI
|
|
339 |
if ( defined( 'LITESPEED_ON' ) ) {
|
340 |
$wp_admin_bar->add_menu( array(
|
341 |
'id' => 'litespeed-menu',
|
342 |
-
'title' => '<span class="ab-icon" title="' . __( 'LiteSpeed Cache Purge All', 'litespeed-cache' ) . '"
|
343 |
-
'href' => LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_PURGE, LiteSpeed_Cache_Purge::
|
344 |
'meta' => array( 'tabindex' => 0, 'class' => 'litespeed-top-toolbar' ),
|
345 |
) ) ;
|
346 |
}
|
347 |
else {
|
348 |
$wp_admin_bar->add_menu( array(
|
349 |
'id' => 'litespeed-menu',
|
350 |
-
'title' => '<span class="ab-icon" title="' . __( 'LiteSpeed Cache', 'litespeed-cache' ) . '"
|
351 |
'meta' => array( 'tabindex' => 0, 'class' => 'litespeed-top-toolbar' ),
|
352 |
) ) ;
|
353 |
}
|
@@ -443,6 +446,73 @@ class LiteSpeed_Cache_GUI
|
|
443 |
}
|
444 |
}
|
445 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
/**
|
447 |
* Finalize buffer by GUI class
|
448 |
*
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The frontend GUI class.
|
4 |
*
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_GUI
|
17 |
{
|
18 |
private static $_instance ;
|
86 |
{
|
87 |
$percentage = '<text x="16.91549431" y="15.5">' . $percent . '%</text>' ;
|
88 |
if ( $percent == 100 && $finished_tick ) {
|
89 |
+
$percentage = '<text x="16.91549431" y="15.5" class="litespeed-pie-done">✓</text>' ;
|
90 |
}
|
91 |
return "
|
92 |
<svg class='litespeed-pie' viewbox='0 0 33.83098862 33.83098862' width='$width' height='$width' xmlns='http://www.w3.org/2000/svg'>
|
342 |
if ( defined( 'LITESPEED_ON' ) ) {
|
343 |
$wp_admin_bar->add_menu( array(
|
344 |
'id' => 'litespeed-menu',
|
345 |
+
'title' => '<span class="ab-icon" title="' . __( 'LiteSpeed Cache Purge All', 'litespeed-cache' ) . ' - ' . __( 'LSCache', 'litespeed-cache' ) . '"></span>',
|
346 |
+
'href' => LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_PURGE, LiteSpeed_Cache_Purge::TYPE_PURGE_ALL_LSCACHE ),
|
347 |
'meta' => array( 'tabindex' => 0, 'class' => 'litespeed-top-toolbar' ),
|
348 |
) ) ;
|
349 |
}
|
350 |
else {
|
351 |
$wp_admin_bar->add_menu( array(
|
352 |
'id' => 'litespeed-menu',
|
353 |
+
'title' => '<span class="ab-icon" title="' . __( 'LiteSpeed Cache', 'litespeed-cache' ) . '"></span>',
|
354 |
'meta' => array( 'tabindex' => 0, 'class' => 'litespeed-top-toolbar' ),
|
355 |
) ) ;
|
356 |
}
|
446 |
}
|
447 |
}
|
448 |
|
449 |
+
/**
|
450 |
+
* Clear unfinished data
|
451 |
+
*
|
452 |
+
* @since 2.4.2
|
453 |
+
* @access public
|
454 |
+
*/
|
455 |
+
public static function img_optm_clean_up_unfinished()
|
456 |
+
{
|
457 |
+
return sprintf(
|
458 |
+
'<a href="%1$s" class="litespeed-btn-warning" title="%2$s"><span class="dashicons dashicons-editor-removeformatting"></span> %3$s</a>',
|
459 |
+
LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTM_DESTROY_UNFINISHED ),
|
460 |
+
__( 'Remove all previous unfinished image optimization requests.', 'litespeed-cache' ),
|
461 |
+
__( 'Clean Up Unfinished Data', 'litespeed-cache' )
|
462 |
+
) ;
|
463 |
+
}
|
464 |
+
|
465 |
+
/**
|
466 |
+
* Generate install link
|
467 |
+
*
|
468 |
+
* @since 2.4.2
|
469 |
+
* @access public
|
470 |
+
*/
|
471 |
+
public static function plugin_install_link( $title, $name, $v )
|
472 |
+
{
|
473 |
+
$url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $name ), 'install-plugin_' . $name ) ;
|
474 |
+
|
475 |
+
$action = sprintf(
|
476 |
+
'<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%3$s" aria-label="%4$s">%5$s</a>',
|
477 |
+
esc_url( $url ),
|
478 |
+
esc_attr( $name ),
|
479 |
+
esc_attr( $title ),
|
480 |
+
esc_attr( sprintf( __( 'Install %s' ), $title ) ),
|
481 |
+
__( 'Install Now' )
|
482 |
+
);
|
483 |
+
|
484 |
+
return $action ;
|
485 |
+
|
486 |
+
// $msg .= " <a href='$upgrade_link' class='litespeed-btn-success' target='_blank'>" . __( 'Click here to upgrade', 'litespeed-cache' ) . '</a>' ;
|
487 |
+
|
488 |
+
}
|
489 |
+
|
490 |
+
/**
|
491 |
+
* Generate upgrade link
|
492 |
+
*
|
493 |
+
* @since 2.4.2
|
494 |
+
* @access public
|
495 |
+
*/
|
496 |
+
public static function plugin_upgrade_link( $title, $name, $v )
|
497 |
+
{
|
498 |
+
$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $name . '§ion=changelog&TB_iframe=true&width=600&height=800' );
|
499 |
+
$file = $name . '/' . $name . '.php' ;
|
500 |
+
|
501 |
+
$msg = sprintf( __( '<a href="%1$s" %2$s>View version %3$s details</a> or <a href="%4$s" %5$s target="_blank">update now</a>.' ),
|
502 |
+
esc_url( $details_url ),
|
503 |
+
sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
|
504 |
+
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $title, $v ) )
|
505 |
+
),
|
506 |
+
$v,
|
507 |
+
wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
|
508 |
+
sprintf( 'class="update-link" aria-label="%s"',
|
509 |
+
esc_attr( sprintf( __( 'Update %s now' ), $title ) )
|
510 |
+
)
|
511 |
+
);
|
512 |
+
|
513 |
+
return $msg ;
|
514 |
+
}
|
515 |
+
|
516 |
/**
|
517 |
* Finalize buffer by GUI class
|
518 |
*
|
inc/img_optm.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The class to optimize image.
|
5 |
*
|
@@ -9,6 +8,10 @@
|
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Img_Optm
|
13 |
{
|
14 |
private static $_instance ;
|
@@ -22,6 +25,7 @@ class LiteSpeed_Cache_Img_Optm
|
|
22 |
const TYPE_IMG_BATCH_SWITCH_ORI = 'img_optm_batch_switch_ori' ;
|
23 |
const TYPE_IMG_BATCH_SWITCH_OPTM = 'img_optm_batch_switch_optm' ;
|
24 |
const TYPE_CALC_BKUP = 'calc_bkup' ;
|
|
|
25 |
const TYPE_RM_BKUP = 'rm_bkup' ;
|
26 |
|
27 |
const ITEM_IMG_OPTM_CRON_RUN = 'litespeed-img_optm_cron_run' ; // last cron running time
|
@@ -44,6 +48,8 @@ class LiteSpeed_Cache_Img_Optm
|
|
44 |
const DB_IMG_OPTM_BK_SUMMARY = 'litespeed_img_optm_bk_summary' ;
|
45 |
const DB_IMG_OPTM_RMBK_SUMMARY = 'litespeed_img_optm_rmbk_summary' ;
|
46 |
|
|
|
|
|
47 |
private $wp_upload_dir ;
|
48 |
private $tmp_pid ;
|
49 |
private $tmp_path ;
|
@@ -69,20 +75,28 @@ class LiteSpeed_Cache_Img_Optm
|
|
69 |
$this->_table_img_optm = LiteSpeed_Cache_Data::get_tb_img_optm() ;
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
/**
|
73 |
* Sync data from litespeed IAPI server
|
74 |
*
|
75 |
* @since 1.6.5
|
76 |
* @access private
|
77 |
*/
|
78 |
-
private function _sync_data()
|
79 |
{
|
80 |
$json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_MEDIA_SYNC_DATA ) ;
|
81 |
|
82 |
if ( ! is_array( $json ) ) {
|
83 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to post to LiteSpeed IAPI server ', $json ) ;
|
84 |
-
$msg = __( 'Failed to communicate with LiteSpeed IAPI server', 'litespeed-cache' ) . ': ' . $json ;
|
85 |
-
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
86 |
return ;
|
87 |
}
|
88 |
|
@@ -90,19 +104,29 @@ class LiteSpeed_Cache_Img_Optm
|
|
90 |
update_option( self::DB_IMG_OPTM_SUMMARY, $json ) ;
|
91 |
}
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
$msg = __( 'Communicated with LiteSpeed Image Optimization Server successfully.', 'litespeed-cache' ) ;
|
94 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
$this->_update_guidance_pos( 'done' ) ;
|
99 |
}
|
100 |
-
|
101 |
-
$this->_update_guidance_pos( 2 ) ;
|
102 |
-
}
|
103 |
-
|
104 |
-
LiteSpeed_Cache_Admin::redirect() ;
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
|
108 |
/**
|
@@ -143,7 +167,7 @@ class LiteSpeed_Cache_Img_Optm
|
|
143 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
144 |
|
145 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] optimize bypass: no image found' ) ;
|
146 |
-
return ;
|
147 |
}
|
148 |
|
149 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] found images: ' . count( $list ) ) ;
|
@@ -199,7 +223,7 @@ class LiteSpeed_Cache_Img_Optm
|
|
199 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
200 |
|
201 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] optimize bypass: empty _img_in_queue' ) ;
|
202 |
-
return ;
|
203 |
}
|
204 |
|
205 |
// Filtered from existing data
|
@@ -217,7 +241,7 @@ class LiteSpeed_Cache_Img_Optm
|
|
217 |
if ( empty( $this->_img_in_queue ) ) {
|
218 |
$msg = __( 'Optimized successfully.', 'litespeed-cache' ) ;
|
219 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
220 |
-
return ;
|
221 |
}
|
222 |
|
223 |
$total_groups = count( $this->_img_in_queue ) ;
|
@@ -225,8 +249,8 @@ class LiteSpeed_Cache_Img_Optm
|
|
225 |
|
226 |
// Push to LiteSpeed IAPI server
|
227 |
$json = $this->_push_img_in_queue_to_iapi() ;
|
228 |
-
if ( $json
|
229 |
-
return ;
|
230 |
}
|
231 |
$pids = $json[ 'pids' ] ;
|
232 |
|
@@ -280,10 +304,7 @@ class LiteSpeed_Cache_Img_Optm
|
|
280 |
$this->_update_credit( $json[ 'credit' ] ) ;
|
281 |
}
|
282 |
|
283 |
-
|
284 |
-
if ( $this->get_guidance_pos() == 2 ) {
|
285 |
-
$this->_update_guidance_pos( 3 ) ;
|
286 |
-
}
|
287 |
|
288 |
}
|
289 |
|
@@ -295,6 +316,10 @@ class LiteSpeed_Cache_Img_Optm
|
|
295 |
*/
|
296 |
private function _insert_img_optm( $data, $fields = 'post_id, optm_status, src, srcpath_md5, src_md5, src_filesize' )
|
297 |
{
|
|
|
|
|
|
|
|
|
298 |
global $wpdb ;
|
299 |
|
300 |
$division = substr_count( $fields, ',' ) + 1 ;
|
@@ -567,7 +592,8 @@ class LiteSpeed_Cache_Img_Optm
|
|
567 |
|
568 |
// check file exists or not
|
569 |
$real_file = $this->wp_upload_dir[ 'basedir' ] . '/' . $meta_value[ 'file' ] ;
|
570 |
-
|
|
|
571 |
$this->_missed_img_in_queue[] = array(
|
572 |
'pid' => $this->tmp_pid,
|
573 |
'src' => $meta_value[ 'file' ],
|
@@ -587,6 +613,36 @@ class LiteSpeed_Cache_Img_Optm
|
|
587 |
'mime_type' => ! empty( $meta_value[ 'mime-type' ] ) ? $meta_value[ 'mime-type' ] : '' ,
|
588 |
'srcpath_md5' => md5( $meta_value[ 'file' ] ),
|
589 |
'src_filesize' => filesize( $real_file ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
) ;
|
591 |
$md5 = md5_file( $real_file ) ;
|
592 |
|
@@ -617,25 +673,19 @@ class LiteSpeed_Cache_Img_Optm
|
|
617 |
) ;
|
618 |
|
619 |
// Push to LiteSpeed IAPI server
|
620 |
-
$json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_REQUEST_OPTIMIZE, LiteSpeed_Cache_Utility::arr2str( $data ) ) ;
|
621 |
-
|
622 |
-
if ( $json === null ) {// admin_api will handle common err
|
623 |
-
return null ;
|
624 |
-
}
|
625 |
|
|
|
626 |
if ( ! is_array( $json ) ) {
|
627 |
-
|
628 |
-
$msg = sprintf( __( 'Failed to push to LiteSpeed IAPI server: %s', 'litespeed-cache' ), $json ) ;
|
629 |
-
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
630 |
-
return null ;
|
631 |
}
|
632 |
|
633 |
// Check data format
|
634 |
if ( empty( $json[ 'pids' ] ) || ! is_array( $json[ 'pids' ] ) ) {
|
635 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to parse data from LiteSpeed IAPI server ', $json[ 'pids' ] ) ;
|
636 |
-
$msg = sprintf( __( 'Failed to parse data from LiteSpeed IAPI server: %s', 'litespeed-cache' ), $json[ 'pids' ] ) ;
|
637 |
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
638 |
-
return
|
639 |
}
|
640 |
|
641 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Returned data from LiteSpeed IAPI server count: ' . count( $json[ 'pids' ] ) ) ;
|
@@ -659,31 +709,177 @@ class LiteSpeed_Cache_Img_Optm
|
|
659 |
|
660 |
$pids = array_keys( $notified_data ) ;
|
661 |
|
662 |
-
$q = "SELECT
|
663 |
-
|
|
|
|
|
|
|
664 |
|
665 |
$need_pull = false ;
|
666 |
$last_log_pid = 0 ;
|
|
|
|
|
667 |
|
668 |
foreach ( $list as $v ) {
|
669 |
-
if ( !
|
670 |
// This image is not in notifcation
|
671 |
continue ;
|
672 |
}
|
673 |
|
674 |
-
|
675 |
-
|
676 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
$pid_log = $last_log_pid == $v->post_id ? '.' : $v->post_id ;
|
679 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] notify_img [status] ' . $status . " \t\t[pid] " . $pid_log . " \t\t[id] " . $v->id ) ;
|
680 |
$last_log_pid = $v->post_id ;
|
681 |
|
|
|
682 |
if ( $status == self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) {
|
683 |
$need_pull = true ;
|
684 |
}
|
|
|
685 |
}
|
686 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
687 |
if ( $need_pull ) {
|
688 |
update_option( LiteSpeed_Cache_Config::ITEM_IMG_OPTM_NEED_PULL, self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) ;
|
689 |
}
|
@@ -692,6 +888,7 @@ class LiteSpeed_Cache_Img_Optm
|
|
692 |
|
693 |
echo json_encode( array( 'count' => count( $notified_data ) ) ) ;
|
694 |
exit() ;
|
|
|
695 |
}
|
696 |
|
697 |
/**
|
@@ -715,13 +912,10 @@ class LiteSpeed_Cache_Img_Optm
|
|
715 |
|
716 |
$_allowed_status = array(
|
717 |
self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED,
|
718 |
-
self::DB_IMG_OPTIMIZE_STATUS_ERR,
|
719 |
-
self::DB_IMG_OPTIMIZE_STATUS_ERR_FETCH,
|
720 |
-
self::DB_IMG_OPTIMIZE_STATUS_ERR_OPTM,
|
721 |
self::DB_IMG_OPTIMIZE_STATUS_REQUESTED,
|
722 |
) ;
|
723 |
|
724 |
-
if ( empty( $_POST[ 'status' ] ) || ! in_array( $_POST[ 'status' ], $_allowed_status ) ) {
|
725 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] notify exit: no/wrong status' ) ;
|
726 |
exit( json_encode( 'no/wrong status' ) ) ;
|
727 |
}
|
@@ -730,16 +924,41 @@ class LiteSpeed_Cache_Img_Optm
|
|
730 |
}
|
731 |
|
732 |
/**
|
733 |
-
*
|
734 |
*
|
735 |
* @since 1.6
|
736 |
* @access public
|
737 |
*/
|
738 |
-
public static function
|
739 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
740 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Cron pull_optimized_img started' ) ;
|
741 |
-
|
742 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
743 |
}
|
744 |
|
745 |
/**
|
@@ -751,8 +970,9 @@ class LiteSpeed_Cache_Img_Optm
|
|
751 |
private function _pull_optimized_img( $manual = false )
|
752 |
{
|
753 |
if ( $this->cron_running() ) {
|
754 |
-
|
755 |
-
|
|
|
756 |
}
|
757 |
|
758 |
global $wpdb ;
|
@@ -764,11 +984,19 @@ class LiteSpeed_Cache_Img_Optm
|
|
764 |
$_q = $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_SIZE, self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) ) ;
|
765 |
|
766 |
$optm_ori = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_ORI ) ;
|
|
|
767 |
$optm_webp = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_WEBP ) ;
|
768 |
|
769 |
-
// pull
|
770 |
$end_time = time() + ( $manual ? 120 : 60 ) ;
|
771 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
772 |
while ( time() < $end_time ) {
|
773 |
$row_img = $wpdb->get_row( $_q ) ;
|
774 |
if ( ! $row_img ) {
|
@@ -782,44 +1010,57 @@ class LiteSpeed_Cache_Img_Optm
|
|
782 |
*/
|
783 |
$this->_update_cron_running() ;
|
784 |
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
}
|
795 |
|
|
|
796 |
// send fetch request
|
797 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] Connecting IAPI server for [pid] ' . $row_img->post_id . ' [src_md5]' . $row_img->src_md5 ) ;
|
798 |
-
$
|
799 |
-
$data = array(
|
800 |
-
'pid' => $row_img->post_id,
|
801 |
-
'src_md5' => $row_img->src_md5,
|
802 |
-
) ;
|
803 |
-
$json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_PULL_IMG, $data, $server, true ) ;
|
804 |
|
805 |
// Check if data interrupt or not
|
806 |
-
if ( empty( $json[ 'ok' ] ) ) {
|
807 |
-
|
808 |
-
|
809 |
-
}
|
810 |
|
811 |
$local_file = $this->wp_upload_dir[ 'basedir' ] . '/' . $row_img->src ;
|
812 |
|
813 |
// Save ori optm image
|
814 |
$target_size = 0 ;
|
815 |
-
|
816 |
-
if ( ! empty( $
|
817 |
/**
|
818 |
* Use wp orignal get func to avoid allow_url_open off issue
|
819 |
* @since 1.6.5
|
820 |
*/
|
821 |
-
|
822 |
-
$response = wp_remote_get( $json[ 'ori' ], array( 'timeout' => 15 ) ) ;
|
823 |
if ( is_wp_error( $response ) ) {
|
824 |
$error_message = $response->get_error_message() ;
|
825 |
LiteSpeed_Cache_Log::debug( 'IAPI failed to pull image: ' . $error_message ) ;
|
@@ -828,8 +1069,8 @@ class LiteSpeed_Cache_Img_Optm
|
|
828 |
|
829 |
file_put_contents( $local_file . '.tmp', $response[ 'body' ] ) ;
|
830 |
|
831 |
-
if ( ! file_exists( $local_file . '.tmp' ) || md5_file( $local_file . '.tmp' ) !== $
|
832 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized img: file md5 dismatch, server md5: ' . $
|
833 |
|
834 |
// update status to failed
|
835 |
$q = "UPDATE $this->_table_img_optm SET optm_status = %s WHERE id = %d " ;
|
@@ -839,33 +1080,36 @@ class LiteSpeed_Cache_Img_Optm
|
|
839 |
$wpdb->query( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_STATUS_FAILED, $row_img->id ) ) ) ;
|
840 |
|
841 |
// Notify server to update status
|
842 |
-
LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_PULL_IMG_FAILED, $
|
843 |
|
844 |
-
return ; // exit from running pull process
|
845 |
}
|
846 |
|
847 |
// Backup ori img
|
848 |
$extension = pathinfo( $local_file, PATHINFO_EXTENSION ) ;
|
849 |
$bk_file = substr( $local_file, 0, -strlen( $extension ) ) . 'bk.' . $extension ;
|
850 |
-
|
|
|
|
|
|
|
851 |
|
852 |
// Replace ori img
|
853 |
rename( $local_file . '.tmp', $local_file ) ;
|
854 |
|
855 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Pulled optimized img: ' . $local_file ) ;
|
856 |
|
857 |
-
$optm_info[ 'ori_total' ] += $json[ 'src_size' ] ;
|
858 |
-
$optm_info[ 'ori_saved' ] += $json[ 'ori_reduced' ] ;
|
859 |
$target_size = filesize( $local_file ) ;
|
860 |
-
|
|
|
861 |
}
|
862 |
|
863 |
// Save webp image
|
864 |
$webp_size = 0 ;
|
865 |
-
|
866 |
-
if ( ! empty( $
|
|
|
867 |
// Fetch
|
868 |
-
$response = wp_remote_get( $
|
869 |
if ( is_wp_error( $response ) ) {
|
870 |
$error_message = $response->get_error_message() ;
|
871 |
LiteSpeed_Cache_Log::debug( 'IAPI failed to pull webp image: ' . $error_message ) ;
|
@@ -874,8 +1118,8 @@ class LiteSpeed_Cache_Img_Optm
|
|
874 |
|
875 |
file_put_contents( $local_file . '.webp', $response[ 'body' ] ) ;
|
876 |
|
877 |
-
if ( ! file_exists( $local_file . '.webp' ) || md5_file( $local_file . '.webp' ) !== $
|
878 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized webp img: file md5 dismatch, server md5: ' . $
|
879 |
|
880 |
// update status to failed
|
881 |
$q = "UPDATE $this->_table_img_optm SET optm_status = %s WHERE id = %d " ;
|
@@ -885,119 +1129,92 @@ class LiteSpeed_Cache_Img_Optm
|
|
885 |
$wpdb->query( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_STATUS_FAILED, $row_img->id ) ) ) ;
|
886 |
|
887 |
// Notify server to update status
|
888 |
-
LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_PULL_IMG_FAILED, $
|
889 |
|
890 |
-
return ; // exit from running pull process
|
891 |
}
|
892 |
|
893 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Pulled optimized img WebP: ' . $local_file . '.webp' ) ;
|
894 |
|
895 |
-
$optm_info[ 'webp_total' ] += $json[ 'src_size' ] ;
|
896 |
-
$optm_info[ 'webp_saved' ] += $json[ 'webp_reduced' ] ;
|
897 |
$webp_size = filesize( $local_file . '.webp' ) ;
|
898 |
-
|
|
|
899 |
}
|
900 |
|
901 |
LiteSpeed_Cache_Log::debug2( '[Img_Optm] Update _table_img_optm record [id] ' . $row_img->id ) ;
|
902 |
|
903 |
// Update pulled status
|
904 |
-
$q = "UPDATE $this->_table_img_optm SET optm_status = %s, target_filesize = %d,
|
905 |
-
$wpdb->query( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_STATUS_PULLED, $target_size, $
|
906 |
|
907 |
// Update child images ( same md5 files )
|
908 |
-
$q = "UPDATE $this->_table_img_optm SET optm_status = %s, target_filesize = %d,
|
909 |
-
$child_count = $wpdb->query( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_STATUS_PULLED, $target_size, $
|
910 |
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
*/
|
915 |
-
$optm_info = serialize( $optm_info ) ;
|
916 |
-
if ( ! empty( $row_img->b_meta_id ) ) {
|
917 |
-
$q = "UPDATE $wpdb->postmeta SET meta_value = %s WHERE meta_id = %d " ;
|
918 |
-
$wpdb->query( $wpdb->prepare( $q, array( $optm_info, $row_img->b_meta_id ) ) ) ;
|
919 |
}
|
920 |
-
|
921 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] New size info [pid] ' . $row_img->post_id ) ;
|
922 |
-
$q = "INSERT INTO $wpdb->postmeta ( post_id, meta_key, meta_value ) VALUES ( %d, %s, %s )" ;
|
923 |
-
$wpdb->query( $wpdb->prepare( $q, array( $row_img->post_id, self::DB_IMG_OPTIMIZE_SIZE, $optm_info ) ) ) ;
|
924 |
-
}
|
925 |
-
|
926 |
-
// Update size saved info of child images
|
927 |
-
if ( $child_count ) {
|
928 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] Proceed child images [total] ' . $child_count ) ;
|
929 |
-
|
930 |
-
$q = "SELECT a.*, b.meta_id as b_meta_id
|
931 |
-
FROM $this->_table_img_optm a
|
932 |
-
LEFT JOIN $wpdb->postmeta b ON b.post_id = a.post_id AND b.meta_key = %s
|
933 |
-
WHERE a.root_id = %d GROUP BY a.post_id" ;
|
934 |
-
$pids = array() ;
|
935 |
-
$tmp = $wpdb->get_results( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_SIZE, $row_img->id ) ) ) ;
|
936 |
-
$pids_to_update = array() ;
|
937 |
-
$pids_data_to_insert = array() ;
|
938 |
-
foreach ( $tmp as $v ) {
|
939 |
-
if ( $v->b_meta_id ) {
|
940 |
-
$pids_to_update[] = $v->post_id ;
|
941 |
-
}
|
942 |
-
else {
|
943 |
-
$pids_data_to_insert[] = $v->post_id ;
|
944 |
-
$pids_data_to_insert[] = self::DB_IMG_OPTIMIZE_SIZE ;
|
945 |
-
$pids_data_to_insert[] = $optm_info ;
|
946 |
-
}
|
947 |
-
}
|
948 |
-
|
949 |
-
// Update these size_info
|
950 |
-
if ( $pids_to_update ) {
|
951 |
-
$pids_to_update = array_unique( $pids_to_update ) ;
|
952 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] Update child group size_info [total] ' . count( $pids_to_update ) ) ;
|
953 |
-
|
954 |
-
$q = "UPDATE $wpdb->postmeta SET meta_value = %s WHERE meta_key = %s AND post_id IN ( " . implode( ',', array_fill( 0, count( $pids_to_update ), '%d' ) ) . " )" ;
|
955 |
-
$wpdb->query( $wpdb->prepare( $q, array_merge( array( $optm_info, self::DB_IMG_OPTIMIZE_SIZE ), $pids_to_update ) ) ) ;
|
956 |
-
}
|
957 |
-
|
958 |
-
// Insert these size_info
|
959 |
-
if ( $pids_data_to_insert ) {
|
960 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] Insert child group size_info [total] ' . ( count( $pids_data_to_insert ) / 3 ) ) ;
|
961 |
|
962 |
-
|
963 |
-
// Add placeholder
|
964 |
-
$q .= $this->_chunk_placeholder( $pids_data_to_insert, 3 ) ;
|
965 |
-
$wpdb->query( $wpdb->prepare( $q, $pids_data_to_insert ) ) ;
|
966 |
-
}
|
967 |
-
}
|
968 |
|
969 |
-
|
970 |
-
|
|
|
971 |
}
|
972 |
|
973 |
-
//
|
974 |
-
|
975 |
-
|
|
|
976 |
}
|
977 |
|
|
|
|
|
|
|
978 |
// Check if there is still task in queue
|
979 |
$q = "SELECT * FROM $this->_table_img_optm WHERE root_id = 0 AND optm_status = %s LIMIT 1" ;
|
980 |
$tmp = $wpdb->get_row( $wpdb->prepare( $q, self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) ) ;
|
981 |
if ( $tmp ) {
|
982 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Task in queue, to be continued...' ) ;
|
983 |
-
return 'to_be_continued' ;
|
984 |
}
|
985 |
|
986 |
// If all pulled, update tag to done
|
987 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Marked pull status to all pulled' ) ;
|
988 |
update_option( LiteSpeed_Cache_Config::ITEM_IMG_OPTM_NEED_PULL, self::DB_IMG_OPTIMIZE_STATUS_PULLED ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
989 |
}
|
990 |
|
991 |
/**
|
992 |
-
*
|
993 |
*
|
994 |
-
* @since 1
|
995 |
* @access public
|
996 |
*/
|
997 |
-
public static function
|
998 |
{
|
999 |
-
|
1000 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1001 |
}
|
1002 |
|
1003 |
/**
|
@@ -1077,6 +1294,19 @@ class LiteSpeed_Cache_Img_Optm
|
|
1077 |
return $meta_value ;
|
1078 |
}
|
1079 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1080 |
/**
|
1081 |
* Destroy all unfinished queue locally and to LiteSpeed IAPI server
|
1082 |
*
|
@@ -1093,7 +1323,7 @@ class LiteSpeed_Cache_Img_Optm
|
|
1093 |
$json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_REQUEST_DESTROY_UNFINISHED ) ;
|
1094 |
|
1095 |
// confirm link will be displayed by Admin_API automatically
|
1096 |
-
if ( is_array( $json )
|
1097 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] cmd result', $json ) ;
|
1098 |
}
|
1099 |
|
@@ -1101,11 +1331,14 @@ class LiteSpeed_Cache_Img_Optm
|
|
1101 |
if ( ! is_array( $json ) || empty( $json[ 'success' ] ) ) {
|
1102 |
|
1103 |
// For other errors that Admin_API didn't take
|
1104 |
-
if ( ! is_array( $json )
|
1105 |
LiteSpeed_Cache_Admin_Display::error( $json ) ;
|
1106 |
|
1107 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] err ', $json ) ;
|
|
|
|
|
1108 |
}
|
|
|
1109 |
return ;
|
1110 |
}
|
1111 |
|
@@ -1118,10 +1351,14 @@ class LiteSpeed_Cache_Img_Optm
|
|
1118 |
$q = "DELETE FROM $this->_table_img_optm WHERE optm_status IN ( " . implode( ',', array_fill( 0, count( $_status_to_clear ), '%s' ) ) . " )" ;
|
1119 |
$wpdb->query( $wpdb->prepare( $q, $_status_to_clear ) ) ;
|
1120 |
|
|
|
|
|
1121 |
|
1122 |
$msg = __( 'Destroy unfinished data successfully.', 'litespeed-cache' ) ;
|
1123 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
1124 |
|
|
|
|
|
1125 |
}
|
1126 |
|
1127 |
/**
|
@@ -1197,8 +1434,6 @@ class LiteSpeed_Cache_Img_Optm
|
|
1197 |
// Clear credit info
|
1198 |
delete_option( self::DB_IMG_OPTM_SUMMARY ) ;
|
1199 |
|
1200 |
-
$this->_update_guidance_pos( 1 ) ;
|
1201 |
-
|
1202 |
exit( 'ok' ) ;
|
1203 |
}
|
1204 |
|
@@ -1304,8 +1539,8 @@ class LiteSpeed_Cache_Img_Optm
|
|
1304 |
|
1305 |
// Push to LiteSpeed IAPI server
|
1306 |
$json = $this->_push_img_in_queue_to_iapi() ;
|
1307 |
-
if ( $json
|
1308 |
-
return ;
|
1309 |
}
|
1310 |
// Returned data is the requested and notifed images
|
1311 |
$pids = $json[ 'pids' ] ;
|
@@ -1342,6 +1577,44 @@ class LiteSpeed_Cache_Img_Optm
|
|
1342 |
|
1343 |
}
|
1344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1345 |
/**
|
1346 |
* Update client credit info
|
1347 |
*
|
@@ -1351,9 +1624,26 @@ class LiteSpeed_Cache_Img_Optm
|
|
1351 |
private function _update_credit( $credit )
|
1352 |
{
|
1353 |
$summary = get_option( self::DB_IMG_OPTM_SUMMARY, array() ) ;
|
|
|
|
|
|
|
|
|
|
|
1354 |
if ( $credit === '++' ) {
|
1355 |
$credit = $summary[ 'credit' ] + 1 ;
|
1356 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1357 |
$summary[ 'credit' ] = $credit ;
|
1358 |
|
1359 |
update_option( self::DB_IMG_OPTM_SUMMARY, $summary ) ;
|
@@ -1705,6 +1995,62 @@ class LiteSpeed_Cache_Img_Optm
|
|
1705 |
LiteSpeed_Cache_Admin_Display::add_notice( LiteSpeed_Cache_Admin_Display::NOTICE_GREEN, $msg ) ;
|
1706 |
}
|
1707 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1708 |
/**
|
1709 |
* Handle all request actions from main cls
|
1710 |
*
|
@@ -1718,6 +2064,10 @@ class LiteSpeed_Cache_Img_Optm
|
|
1718 |
$type = LiteSpeed_Cache_Router::verify_type() ;
|
1719 |
|
1720 |
switch ( $type ) {
|
|
|
|
|
|
|
|
|
1721 |
case self::TYPE_CALC_BKUP :
|
1722 |
$instance->_calc_bkup() ;
|
1723 |
break ;
|
@@ -1753,7 +2103,7 @@ class LiteSpeed_Cache_Img_Optm
|
|
1753 |
$instance->_update_cron_running( true ) ;
|
1754 |
|
1755 |
// Check if need to self redirect
|
1756 |
-
if ( $result === 'to_be_continued' ) {
|
1757 |
$link = LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_PULL ) ;
|
1758 |
// Add i to avoid browser too many redirected warning
|
1759 |
$i = ! empty( $_GET[ 'i' ] ) ? $_GET[ 'i' ] : 0 ;
|
@@ -1785,50 +2135,6 @@ class LiteSpeed_Cache_Img_Optm
|
|
1785 |
LiteSpeed_Cache_Admin::redirect() ;
|
1786 |
}
|
1787 |
|
1788 |
-
/**
|
1789 |
-
* Get the current guidance step
|
1790 |
-
*
|
1791 |
-
* @since 2.0
|
1792 |
-
* @access public
|
1793 |
-
*/
|
1794 |
-
public function get_guidance_pos()
|
1795 |
-
{
|
1796 |
-
$guide_status = get_option( LiteSpeed_Cache_Config::ITEM_GUIDE ) ;
|
1797 |
-
|
1798 |
-
$current_step = 'done' ;
|
1799 |
-
if ( ! $guide_status || empty( $guide_status[ 'img_optm' ] ) || $guide_status[ 'img_optm' ] !== 'done' ) {
|
1800 |
-
$current_step = empty( $guide_status[ 'img_optm' ] ) ? 1 : $guide_status[ 'img_optm' ] ;
|
1801 |
-
}
|
1802 |
-
|
1803 |
-
return $current_step ;
|
1804 |
-
}
|
1805 |
-
|
1806 |
-
/**
|
1807 |
-
* Update current guidance step
|
1808 |
-
*
|
1809 |
-
* @since 2.0
|
1810 |
-
* @access private
|
1811 |
-
*/
|
1812 |
-
private function _update_guidance_pos( $pos )
|
1813 |
-
{
|
1814 |
-
$guide_status = get_option( LiteSpeed_Cache_Config::ITEM_GUIDE ) ;
|
1815 |
-
|
1816 |
-
if ( ! $guide_status ) {
|
1817 |
-
$guide_status = array() ;
|
1818 |
-
}
|
1819 |
-
|
1820 |
-
if ( ! empty( $guide_status[ 'img_optm' ] ) && $guide_status[ 'img_optm' ] == $pos ) {
|
1821 |
-
LiteSpeed_Cache_Log::debug2( '[Img_Optm] _update_guidance_pos: bypassed due to same pos [step] ' . $pos ) ;
|
1822 |
-
return ;
|
1823 |
-
}
|
1824 |
-
|
1825 |
-
$guide_status[ 'img_optm' ] = $pos ;
|
1826 |
-
|
1827 |
-
LiteSpeed_Cache_Log::debug( '[Img_Optm] _update_guidance_pos [step] ' . $pos ) ;
|
1828 |
-
|
1829 |
-
update_option( LiteSpeed_Cache_Config::ITEM_GUIDE, $guide_status ) ;
|
1830 |
-
}
|
1831 |
-
|
1832 |
/**
|
1833 |
* Get the current instance object.
|
1834 |
*
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The class to optimize image.
|
4 |
*
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
10 |
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
class LiteSpeed_Cache_Img_Optm
|
16 |
{
|
17 |
private static $_instance ;
|
25 |
const TYPE_IMG_BATCH_SWITCH_ORI = 'img_optm_batch_switch_ori' ;
|
26 |
const TYPE_IMG_BATCH_SWITCH_OPTM = 'img_optm_batch_switch_optm' ;
|
27 |
const TYPE_CALC_BKUP = 'calc_bkup' ;
|
28 |
+
const TYPE_RESET_ROW = 'reset_row' ;
|
29 |
const TYPE_RM_BKUP = 'rm_bkup' ;
|
30 |
|
31 |
const ITEM_IMG_OPTM_CRON_RUN = 'litespeed-img_optm_cron_run' ; // last cron running time
|
48 |
const DB_IMG_OPTM_BK_SUMMARY = 'litespeed_img_optm_bk_summary' ;
|
49 |
const DB_IMG_OPTM_RMBK_SUMMARY = 'litespeed_img_optm_rmbk_summary' ;
|
50 |
|
51 |
+
const NUM_THRESHOLD_AUTO_REQUEST = 1200 ;
|
52 |
+
|
53 |
private $wp_upload_dir ;
|
54 |
private $tmp_pid ;
|
55 |
private $tmp_path ;
|
75 |
$this->_table_img_optm = LiteSpeed_Cache_Data::get_tb_img_optm() ;
|
76 |
}
|
77 |
|
78 |
+
/**
|
79 |
+
* Sync data from litespeed IAPI server for CLI usage
|
80 |
+
*
|
81 |
+
* @since 2.4.4
|
82 |
+
* @access public
|
83 |
+
*/
|
84 |
+
public function sync_data()
|
85 |
+
{
|
86 |
+
return $this->_sync_data( true ) ;
|
87 |
+
}
|
88 |
+
|
89 |
/**
|
90 |
* Sync data from litespeed IAPI server
|
91 |
*
|
92 |
* @since 1.6.5
|
93 |
* @access private
|
94 |
*/
|
95 |
+
private function _sync_data( $try_level_up = false )
|
96 |
{
|
97 |
$json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_MEDIA_SYNC_DATA ) ;
|
98 |
|
99 |
if ( ! is_array( $json ) ) {
|
|
|
|
|
|
|
100 |
return ;
|
101 |
}
|
102 |
|
104 |
update_option( self::DB_IMG_OPTM_SUMMARY, $json ) ;
|
105 |
}
|
106 |
|
107 |
+
// If this is for level up try, return data directly
|
108 |
+
if ( $try_level_up ) {
|
109 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] Try Level Up ~ !' ) ;
|
110 |
+
return $json ;
|
111 |
+
}
|
112 |
+
|
113 |
$msg = __( 'Communicated with LiteSpeed Image Optimization Server successfully.', 'litespeed-cache' ) ;
|
114 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
115 |
|
116 |
+
if ( ! defined( 'LITESPEED_CLI' ) ) {
|
117 |
+
LiteSpeed_Cache_Admin::redirect() ;
|
|
|
118 |
}
|
119 |
+
}
|
|
|
|
|
|
|
|
|
120 |
|
121 |
+
/**
|
122 |
+
* Request optm to litespeed IAPI server for CLI usage
|
123 |
+
*
|
124 |
+
* @since 2.4.4
|
125 |
+
* @access public
|
126 |
+
*/
|
127 |
+
public function request_optm()
|
128 |
+
{
|
129 |
+
return $this->_request_optm() ;
|
130 |
}
|
131 |
|
132 |
/**
|
167 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
168 |
|
169 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] optimize bypass: no image found' ) ;
|
170 |
+
return $msg ;
|
171 |
}
|
172 |
|
173 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] found images: ' . count( $list ) ) ;
|
223 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
224 |
|
225 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] optimize bypass: empty _img_in_queue' ) ;
|
226 |
+
return [ 'ok' => $msg ] ;
|
227 |
}
|
228 |
|
229 |
// Filtered from existing data
|
241 |
if ( empty( $this->_img_in_queue ) ) {
|
242 |
$msg = __( 'Optimized successfully.', 'litespeed-cache' ) ;
|
243 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
244 |
+
return [ 'ok' => $msg ] ;
|
245 |
}
|
246 |
|
247 |
$total_groups = count( $this->_img_in_queue ) ;
|
249 |
|
250 |
// Push to LiteSpeed IAPI server
|
251 |
$json = $this->_push_img_in_queue_to_iapi() ;
|
252 |
+
if ( ! is_array( $json ) ) {
|
253 |
+
return $json ;
|
254 |
}
|
255 |
$pids = $json[ 'pids' ] ;
|
256 |
|
304 |
$this->_update_credit( $json[ 'credit' ] ) ;
|
305 |
}
|
306 |
|
307 |
+
return [ 'ok' => $msg ] ;
|
|
|
|
|
|
|
308 |
|
309 |
}
|
310 |
|
316 |
*/
|
317 |
private function _insert_img_optm( $data, $fields = 'post_id, optm_status, src, srcpath_md5, src_md5, src_filesize' )
|
318 |
{
|
319 |
+
if ( empty( $data ) ) {
|
320 |
+
return ;
|
321 |
+
}
|
322 |
+
|
323 |
global $wpdb ;
|
324 |
|
325 |
$division = substr_count( $fields, ',' ) + 1 ;
|
592 |
|
593 |
// check file exists or not
|
594 |
$real_file = $this->wp_upload_dir[ 'basedir' ] . '/' . $meta_value[ 'file' ] ;
|
595 |
+
$ext = pathinfo( $real_file, PATHINFO_EXTENSION ) ;
|
596 |
+
if ( ! file_exists( $real_file ) || ! in_array( $ext, array( 'jpg', 'jpeg', 'png' ) ) ) {
|
597 |
$this->_missed_img_in_queue[] = array(
|
598 |
'pid' => $this->tmp_pid,
|
599 |
'src' => $meta_value[ 'file' ],
|
613 |
'mime_type' => ! empty( $meta_value[ 'mime-type' ] ) ? $meta_value[ 'mime-type' ] : '' ,
|
614 |
'srcpath_md5' => md5( $meta_value[ 'file' ] ),
|
615 |
'src_filesize' => filesize( $real_file ),
|
616 |
+
/**
|
617 |
+
* To use the filter `litespeed_img_optm_options_per_image`, do below:
|
618 |
+
*
|
619 |
+
* add_filter( 'litespeed_img_optm_options_per_image', function( $opt_val, $file ){
|
620 |
+
* // To add optimize original image
|
621 |
+
* if ( Your conditions ) {
|
622 |
+
* $opt_val |= LiteSpeed_Cache_API::IMG_OPTM_BM_ORI ;
|
623 |
+
* }
|
624 |
+
*
|
625 |
+
* // To add optimize webp image
|
626 |
+
* if ( Your conditions ) {
|
627 |
+
* $opt_val |= LiteSpeed_Cache_API::IMG_OPTM_BM_WEBP ;
|
628 |
+
* }
|
629 |
+
*
|
630 |
+
* // To turn on lossless optimize for this image e.g. if filename contains `magzine`
|
631 |
+
* if ( strpos( $file, 'magzine' ) !== false ) {
|
632 |
+
* $opt_val |= LiteSpeed_Cache_API::IMG_OPTM_BM_LOSSLESS ;
|
633 |
+
* }
|
634 |
+
*
|
635 |
+
* // To set keep exif info for this image
|
636 |
+
* if ( Your conditions ) {
|
637 |
+
* $opt_val |= LiteSpeed_Cache_API::IMG_OPTM_BM_EXIF ;
|
638 |
+
* }
|
639 |
+
*
|
640 |
+
* return $opt_val ;
|
641 |
+
* } ) ;
|
642 |
+
*
|
643 |
+
* @since 2.4.2
|
644 |
+
*/
|
645 |
+
'optm_options' => apply_filters( 'litespeed_img_optm_options_per_image', 0, $meta_value[ 'file' ] ),
|
646 |
) ;
|
647 |
$md5 = md5_file( $real_file ) ;
|
648 |
|
673 |
) ;
|
674 |
|
675 |
// Push to LiteSpeed IAPI server
|
676 |
+
$json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_REQUEST_OPTIMIZE, LiteSpeed_Cache_Utility::arr2str( $data ), false, false ) ;
|
|
|
|
|
|
|
|
|
677 |
|
678 |
+
// admin_api will handle common err
|
679 |
if ( ! is_array( $json ) ) {
|
680 |
+
return $json ;
|
|
|
|
|
|
|
681 |
}
|
682 |
|
683 |
// Check data format
|
684 |
if ( empty( $json[ 'pids' ] ) || ! is_array( $json[ 'pids' ] ) ) {
|
685 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to parse data from LiteSpeed IAPI server ', $json[ 'pids' ] ) ;
|
686 |
+
$msg = sprintf( __( 'Failed to parse data from LiteSpeed IAPI server: %s', 'litespeed-cache' ), var_export( $json[ 'pids' ], true ) ) ;
|
687 |
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
688 |
+
return $json ;
|
689 |
}
|
690 |
|
691 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Returned data from LiteSpeed IAPI server count: ' . count( $json[ 'pids' ] ) ) ;
|
709 |
|
710 |
$pids = array_keys( $notified_data ) ;
|
711 |
|
712 |
+
$q = "SELECT a.*, b.meta_id as b_meta_id, b.meta_value AS b_optm_info
|
713 |
+
FROM $this->_table_img_optm a
|
714 |
+
LEFT JOIN $wpdb->postmeta b ON b.post_id = a.post_id AND b.meta_key = %s
|
715 |
+
WHERE a.optm_status != %s AND a.post_id IN ( " . implode( ',', array_fill( 0, count( $pids ), '%d' ) ) . " )" ;
|
716 |
+
$list = $wpdb->get_results( $wpdb->prepare( $q, array_merge( array( self::DB_IMG_OPTIMIZE_SIZE, self::DB_IMG_OPTIMIZE_STATUS_PULLED ), $pids ) ) ) ;
|
717 |
|
718 |
$need_pull = false ;
|
719 |
$last_log_pid = 0 ;
|
720 |
+
$postmeta_info = array() ;
|
721 |
+
$child_postmeta_info = array() ;
|
722 |
|
723 |
foreach ( $list as $v ) {
|
724 |
+
if ( ! array_key_exists( $v->src_md5, $notified_data[ $v->post_id ] ) ) {
|
725 |
// This image is not in notifcation
|
726 |
continue ;
|
727 |
}
|
728 |
|
729 |
+
$json = $notified_data[ $v->post_id ][ $v->src_md5 ] ;
|
730 |
+
|
731 |
+
$server_info = array(
|
732 |
+
'server' => $server,
|
733 |
+
) ;
|
734 |
+
|
735 |
+
// Only need to update meta_info for pull notification, for other notifications, no need to modify meta_info
|
736 |
+
if ( ! empty( $json[ 'ori' ] ) || ! empty( $json[ 'webp' ] ) ) {
|
737 |
+
// Save server side ID to send taken notification after pulled
|
738 |
+
$server_info[ 'id' ] = $json[ 'id' ] ;
|
739 |
+
|
740 |
+
// Default optm info array
|
741 |
+
if ( empty( $postmeta_info[ $v->post_id ] ) ) {
|
742 |
+
$postmeta_info[ $v->post_id ] = array(
|
743 |
+
'meta_id' => $v->b_meta_id,
|
744 |
+
'meta_info' => array(
|
745 |
+
'ori_total' => 0,
|
746 |
+
'ori_saved' => 0,
|
747 |
+
'webp_total' => 0,
|
748 |
+
'webp_saved' => 0,
|
749 |
+
),
|
750 |
+
) ;
|
751 |
+
// Init optm_info for the first one
|
752 |
+
if ( ! empty( $v->b_meta_id ) ) {
|
753 |
+
foreach ( unserialize( $v->b_optm_info ) as $k2 => $v2 ) {
|
754 |
+
$postmeta_info[ $v->post_id ][ 'meta_info' ][ $k2 ] += $v2 ;
|
755 |
+
}
|
756 |
+
}
|
757 |
+
}
|
758 |
+
|
759 |
+
}
|
760 |
|
761 |
+
$target_saved = 0 ;
|
762 |
+
if ( ! empty( $json[ 'ori' ] ) ) {
|
763 |
+
$server_info[ 'ori_md5' ] = $json[ 'ori_md5' ] ;
|
764 |
+
$server_info[ 'ori' ] = $json[ 'ori' ] ;
|
765 |
+
|
766 |
+
$target_saved = $json[ 'ori_reduced' ] ;
|
767 |
+
|
768 |
+
// Append meta info
|
769 |
+
$postmeta_info[ $v->post_id ][ 'meta_info' ][ 'ori_total' ] += $json[ 'src_size' ] ;
|
770 |
+
$postmeta_info[ $v->post_id ][ 'meta_info' ][ 'ori_saved' ] += $json[ 'ori_reduced' ] ;
|
771 |
+
|
772 |
+
}
|
773 |
+
|
774 |
+
$webp_saved = 0 ;
|
775 |
+
if ( ! empty( $json[ 'webp' ] ) ) {
|
776 |
+
$server_info[ 'webp_md5' ] = $json[ 'webp_md5' ] ;
|
777 |
+
$server_info[ 'webp' ] = $json[ 'webp' ] ;
|
778 |
+
|
779 |
+
$webp_saved = $json[ 'webp_reduced' ] ;
|
780 |
+
|
781 |
+
// Append meta info
|
782 |
+
$postmeta_info[ $v->post_id ][ 'meta_info' ][ 'webp_total' ] += $json[ 'src_size' ] ;
|
783 |
+
$postmeta_info[ $v->post_id ][ 'meta_info' ][ 'webp_saved' ] += $json[ 'webp_reduced' ] ;
|
784 |
+
}
|
785 |
+
|
786 |
+
// Update status and data
|
787 |
+
$q = "UPDATE $this->_table_img_optm SET optm_status = %s, target_saved = %d, webp_saved = %d, server_info = %s WHERE id = %d " ;
|
788 |
+
$wpdb->query( $wpdb->prepare( $q, array( $status, $target_saved, $webp_saved, serialize( $server_info ), $v->id ) ) ) ;
|
789 |
+
|
790 |
+
// Update child images ( same md5 files )
|
791 |
+
$q = "UPDATE $this->_table_img_optm SET optm_status = %s, target_saved = %d, webp_saved = %d WHERE root_id = %d " ;
|
792 |
+
$child_count = $wpdb->query( $wpdb->prepare( $q, array( $status, $target_saved, $webp_saved, $v->id ) ) ) ;
|
793 |
+
|
794 |
+
// Group child meta_info for later update
|
795 |
+
if ( ! empty( $json[ 'ori' ] ) || ! empty( $json[ 'webp' ] ) ) {
|
796 |
+
if ( $child_count ) {
|
797 |
+
$child_postmeta_info[ $v->id ] = $postmeta_info[ $v->post_id ][ 'meta_info' ] ;
|
798 |
+
}
|
799 |
+
}
|
800 |
+
|
801 |
+
// write log
|
802 |
$pid_log = $last_log_pid == $v->post_id ? '.' : $v->post_id ;
|
803 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] notify_img [status] ' . $status . " \t\t[pid] " . $pid_log . " \t\t[id] " . $v->id ) ;
|
804 |
$last_log_pid = $v->post_id ;
|
805 |
|
806 |
+
// set need_pull tag
|
807 |
if ( $status == self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) {
|
808 |
$need_pull = true ;
|
809 |
}
|
810 |
+
|
811 |
}
|
812 |
|
813 |
+
/**
|
814 |
+
* Update size saved info
|
815 |
+
* @since 1.6.5
|
816 |
+
*/
|
817 |
+
if ( $postmeta_info ) {
|
818 |
+
foreach ( $postmeta_info as $post_id => $optm_arr ) {
|
819 |
+
$optm_info = serialize( $optm_arr[ 'meta_info' ] ) ;
|
820 |
+
|
821 |
+
if ( ! empty( $optm_arr[ 'meta_id' ] ) ) {
|
822 |
+
$q = "UPDATE $wpdb->postmeta SET meta_value = %s WHERE meta_id = %d " ;
|
823 |
+
$wpdb->query( $wpdb->prepare( $q, array( $optm_info, $optm_arr[ 'meta_id' ] ) ) ) ;
|
824 |
+
}
|
825 |
+
else {
|
826 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] New size info [pid] ' . $post_id ) ;
|
827 |
+
$q = "INSERT INTO $wpdb->postmeta ( post_id, meta_key, meta_value ) VALUES ( %d, %s, %s )" ;
|
828 |
+
$wpdb->query( $wpdb->prepare( $q, array( $post_id, self::DB_IMG_OPTIMIZE_SIZE, $optm_info ) ) ) ;
|
829 |
+
}
|
830 |
+
}
|
831 |
+
}
|
832 |
+
|
833 |
+
// Update child postmeta data based on root_id
|
834 |
+
if ( $child_postmeta_info ) {
|
835 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] Proceed child images [total] ' . count( $child_postmeta_info ) ) ;
|
836 |
+
|
837 |
+
$root_id_list = array_keys( $child_postmeta_info ) ;
|
838 |
+
|
839 |
+
$q = "SELECT a.*, b.meta_id as b_meta_id
|
840 |
+
FROM $this->_table_img_optm a
|
841 |
+
LEFT JOIN $wpdb->postmeta b ON b.post_id = a.post_id AND b.meta_key = %s
|
842 |
+
WHERE a.root_id IN ( " . implode( ',', array_fill( 0, count( $root_id_list ), '%d' ) ) . " ) GROUP BY a.post_id" ;
|
843 |
+
|
844 |
+
$tmp = $wpdb->get_results( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_SIZE, $root_id_list ) ) ) ;
|
845 |
+
|
846 |
+
$pids_to_update = array() ;
|
847 |
+
$pids_data_to_insert = array() ;
|
848 |
+
foreach ( $tmp as $v ) {
|
849 |
+
$optm_info = $child_postmeta_info[ $v->root_id ] ;
|
850 |
+
|
851 |
+
if ( $v->b_meta_id ) {
|
852 |
+
$pids_to_update[] = $v->post_id ;
|
853 |
+
}
|
854 |
+
else {
|
855 |
+
$pids_data_to_insert[] = $v->post_id ;
|
856 |
+
$pids_data_to_insert[] = self::DB_IMG_OPTIMIZE_SIZE ;
|
857 |
+
$pids_data_to_insert[] = $optm_info ;
|
858 |
+
}
|
859 |
+
}
|
860 |
+
|
861 |
+
// Update these size_info
|
862 |
+
if ( $pids_to_update ) {
|
863 |
+
$pids_to_update = array_unique( $pids_to_update ) ;
|
864 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] Update child group size_info [total] ' . count( $pids_to_update ) ) ;
|
865 |
+
|
866 |
+
$q = "UPDATE $wpdb->postmeta SET meta_value = %s WHERE meta_key = %s AND post_id IN ( " . implode( ',', array_fill( 0, count( $pids_to_update ), '%d' ) ) . " )" ;
|
867 |
+
$wpdb->query( $wpdb->prepare( $q, array_merge( array( $optm_info, self::DB_IMG_OPTIMIZE_SIZE ), $pids_to_update ) ) ) ;
|
868 |
+
}
|
869 |
+
|
870 |
+
// Insert these size_info
|
871 |
+
if ( $pids_data_to_insert ) {
|
872 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] Insert child group size_info [total] ' . ( count( $pids_data_to_insert ) / 3 ) ) ;
|
873 |
+
|
874 |
+
$q = "INSERT INTO $wpdb->postmeta ( post_id, meta_key, meta_value ) VALUES " ;
|
875 |
+
// Add placeholder
|
876 |
+
$q .= $this->_chunk_placeholder( $pids_data_to_insert, 3 ) ;
|
877 |
+
$wpdb->query( $wpdb->prepare( $q, $pids_data_to_insert ) ) ;
|
878 |
+
}
|
879 |
+
|
880 |
+
}
|
881 |
+
|
882 |
+
// Mark need_pull tag for cron
|
883 |
if ( $need_pull ) {
|
884 |
update_option( LiteSpeed_Cache_Config::ITEM_IMG_OPTM_NEED_PULL, self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) ;
|
885 |
}
|
888 |
|
889 |
echo json_encode( array( 'count' => count( $notified_data ) ) ) ;
|
890 |
exit() ;
|
891 |
+
|
892 |
}
|
893 |
|
894 |
/**
|
912 |
|
913 |
$_allowed_status = array(
|
914 |
self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED,
|
|
|
|
|
|
|
915 |
self::DB_IMG_OPTIMIZE_STATUS_REQUESTED,
|
916 |
) ;
|
917 |
|
918 |
+
if ( empty( $_POST[ 'status' ] ) || ( ! in_array( $_POST[ 'status' ], $_allowed_status ) && substr( $_POST[ 'status' ], 0, 3 ) != self::DB_IMG_OPTIMIZE_STATUS_ERR ) ) {
|
919 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] notify exit: no/wrong status' ) ;
|
920 |
exit( json_encode( 'no/wrong status' ) ) ;
|
921 |
}
|
924 |
}
|
925 |
|
926 |
/**
|
927 |
+
* Cron pull optimized img
|
928 |
*
|
929 |
* @since 1.6
|
930 |
* @access public
|
931 |
*/
|
932 |
+
public static function cron_pull_optimized_img()
|
933 |
{
|
934 |
+
if ( ! defined( 'DOING_CRON' ) ) {
|
935 |
+
return ;
|
936 |
+
}
|
937 |
+
|
938 |
+
$tag = get_option( LiteSpeed_Cache_Config::ITEM_IMG_OPTM_NEED_PULL ) ;
|
939 |
+
|
940 |
+
if ( ! $tag || $tag !== self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) {
|
941 |
+
return ;
|
942 |
+
}
|
943 |
+
|
944 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Cron pull_optimized_img started' ) ;
|
945 |
+
|
946 |
+
self::get_instance()->_pull_optimized_img() ;
|
947 |
+
}
|
948 |
+
|
949 |
+
/**
|
950 |
+
* Pull optm data from litespeed IAPI server for CLI usage
|
951 |
+
*
|
952 |
+
* @since 2.4.4
|
953 |
+
* @access public
|
954 |
+
*/
|
955 |
+
public function pull_img()
|
956 |
+
{
|
957 |
+
$res = $this->_pull_optimized_img() ;
|
958 |
+
|
959 |
+
$this->_update_cron_running( true ) ;
|
960 |
+
|
961 |
+
return $res ;
|
962 |
}
|
963 |
|
964 |
/**
|
970 |
private function _pull_optimized_img( $manual = false )
|
971 |
{
|
972 |
if ( $this->cron_running() ) {
|
973 |
+
$msg = '[Img_Optm] fetch cron is running' ;
|
974 |
+
LiteSpeed_Cache_Log::debug( $msg ) ;
|
975 |
+
return $msg ;
|
976 |
}
|
977 |
|
978 |
global $wpdb ;
|
984 |
$_q = $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_SIZE, self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) ) ;
|
985 |
|
986 |
$optm_ori = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_ORI ) ;
|
987 |
+
$rm_ori_bkup = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_RM_ORI_BKUP ) ;
|
988 |
$optm_webp = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_WEBP ) ;
|
989 |
|
990 |
+
// pull 1 min images each time
|
991 |
$end_time = time() + ( $manual ? 120 : 60 ) ;
|
992 |
|
993 |
+
$server_list = array() ;
|
994 |
+
|
995 |
+
$total_pulled_ori = 0 ;
|
996 |
+
$total_pulled_webp = 0 ;
|
997 |
+
$beginning = time() ;
|
998 |
+
|
999 |
+
set_time_limit( $end_time + 20 ) ;
|
1000 |
while ( time() < $end_time ) {
|
1001 |
$row_img = $wpdb->get_row( $_q ) ;
|
1002 |
if ( ! $row_img ) {
|
1010 |
*/
|
1011 |
$this->_update_cron_running() ;
|
1012 |
|
1013 |
+
/**
|
1014 |
+
* If no server_info, will fail to pull
|
1015 |
+
* This is only for v2.4.2- data
|
1016 |
+
* @see https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:image-optimization:2-4-2-upgrade
|
1017 |
+
*/
|
1018 |
+
try{
|
1019 |
+
if ( ! $row_img->server_info ) {
|
1020 |
+
throw new Exception( 'No server info in this notification' ) ;
|
1021 |
+
}
|
1022 |
+
|
1023 |
+
$server_info = unserialize( $row_img->server_info ) ;
|
1024 |
+
$server = $server_info[ 'server' ] ;
|
1025 |
+
|
1026 |
+
} catch( \Exception $ex ) {
|
1027 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to unserialize server_info.' ) ;
|
1028 |
+
|
1029 |
+
$msg = sprintf(
|
1030 |
+
__( 'LSCWP %1$s has simplified the image pulling process. Please %2$s, or resend the pull notification this one time only. After that, the process will be automated.', 'litespeed-cache' ),
|
1031 |
+
'v2.4.2',
|
1032 |
+
LiteSpeed_Cache_GUI::img_optm_clean_up_unfinished()
|
1033 |
+
) ;
|
1034 |
+
|
1035 |
+
$msg .= LiteSpeed_Cache_Doc::learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:image-optimization:2-4-2-upgrade' ) ;
|
1036 |
+
|
1037 |
+
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
1038 |
+
|
1039 |
+
return ;
|
1040 |
}
|
1041 |
|
1042 |
+
|
1043 |
// send fetch request
|
1044 |
+
// LiteSpeed_Cache_Log::debug( '[Img_Optm] Connecting IAPI server for [pid] ' . $row_img->post_id . ' [src_md5]' . $row_img->src_md5 ) ;
|
1045 |
+
// $json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_PULL_IMG, $data, $server, true ) ;
|
|
|
|
|
|
|
|
|
|
|
1046 |
|
1047 |
// Check if data interrupt or not
|
1048 |
+
// if ( empty( $json[ 'ok' ] ) ) {
|
1049 |
+
// LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized img: ', $json ) ;
|
1050 |
+
// return ;
|
1051 |
+
// }
|
1052 |
|
1053 |
$local_file = $this->wp_upload_dir[ 'basedir' ] . '/' . $row_img->src ;
|
1054 |
|
1055 |
// Save ori optm image
|
1056 |
$target_size = 0 ;
|
1057 |
+
|
1058 |
+
if ( ! empty( $server_info[ 'ori' ] ) ) {
|
1059 |
/**
|
1060 |
* Use wp orignal get func to avoid allow_url_open off issue
|
1061 |
* @since 1.6.5
|
1062 |
*/
|
1063 |
+
$response = wp_remote_get( $server_info[ 'ori' ], array( 'timeout' => 15 ) ) ;
|
|
|
1064 |
if ( is_wp_error( $response ) ) {
|
1065 |
$error_message = $response->get_error_message() ;
|
1066 |
LiteSpeed_Cache_Log::debug( 'IAPI failed to pull image: ' . $error_message ) ;
|
1069 |
|
1070 |
file_put_contents( $local_file . '.tmp', $response[ 'body' ] ) ;
|
1071 |
|
1072 |
+
if ( ! file_exists( $local_file . '.tmp' ) || md5_file( $local_file . '.tmp' ) !== $server_info[ 'ori_md5' ] ) {
|
1073 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized img: file md5 dismatch, server md5: ' . $server_info[ 'ori_md5' ] ) ;
|
1074 |
|
1075 |
// update status to failed
|
1076 |
$q = "UPDATE $this->_table_img_optm SET optm_status = %s WHERE id = %d " ;
|
1080 |
$wpdb->query( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_STATUS_FAILED, $row_img->id ) ) ) ;
|
1081 |
|
1082 |
// Notify server to update status
|
1083 |
+
$res = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_PULL_IMG_FAILED, $server_info, $server, true ) ;
|
1084 |
|
1085 |
+
return 'Md5 dismatch' ; // exit from running pull process
|
1086 |
}
|
1087 |
|
1088 |
// Backup ori img
|
1089 |
$extension = pathinfo( $local_file, PATHINFO_EXTENSION ) ;
|
1090 |
$bk_file = substr( $local_file, 0, -strlen( $extension ) ) . 'bk.' . $extension ;
|
1091 |
+
|
1092 |
+
if ( ! $rm_ori_bkup ) {
|
1093 |
+
rename( $local_file, $bk_file ) ;
|
1094 |
+
}
|
1095 |
|
1096 |
// Replace ori img
|
1097 |
rename( $local_file . '.tmp', $local_file ) ;
|
1098 |
|
1099 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Pulled optimized img: ' . $local_file ) ;
|
1100 |
|
|
|
|
|
1101 |
$target_size = filesize( $local_file ) ;
|
1102 |
+
|
1103 |
+
$total_pulled_ori ++ ;
|
1104 |
}
|
1105 |
|
1106 |
// Save webp image
|
1107 |
$webp_size = 0 ;
|
1108 |
+
|
1109 |
+
if ( ! empty( $server_info[ 'webp' ] ) ) {
|
1110 |
+
|
1111 |
// Fetch
|
1112 |
+
$response = wp_remote_get( $server_info[ 'webp' ], array( 'timeout' => 15 ) ) ;
|
1113 |
if ( is_wp_error( $response ) ) {
|
1114 |
$error_message = $response->get_error_message() ;
|
1115 |
LiteSpeed_Cache_Log::debug( 'IAPI failed to pull webp image: ' . $error_message ) ;
|
1118 |
|
1119 |
file_put_contents( $local_file . '.webp', $response[ 'body' ] ) ;
|
1120 |
|
1121 |
+
if ( ! file_exists( $local_file . '.webp' ) || md5_file( $local_file . '.webp' ) !== $server_info[ 'webp_md5' ] ) {
|
1122 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized webp img: file md5 dismatch, server md5: ' . $server_info[ 'webp_md5' ] ) ;
|
1123 |
|
1124 |
// update status to failed
|
1125 |
$q = "UPDATE $this->_table_img_optm SET optm_status = %s WHERE id = %d " ;
|
1129 |
$wpdb->query( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_STATUS_FAILED, $row_img->id ) ) ) ;
|
1130 |
|
1131 |
// Notify server to update status
|
1132 |
+
LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_PULL_IMG_FAILED, $server_info, $server, true ) ;
|
1133 |
|
1134 |
+
return 'WebP md5 dismatch' ; // exit from running pull process
|
1135 |
}
|
1136 |
|
1137 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Pulled optimized img WebP: ' . $local_file . '.webp' ) ;
|
1138 |
|
|
|
|
|
1139 |
$webp_size = filesize( $local_file . '.webp' ) ;
|
1140 |
+
|
1141 |
+
$total_pulled_webp ++ ;
|
1142 |
}
|
1143 |
|
1144 |
LiteSpeed_Cache_Log::debug2( '[Img_Optm] Update _table_img_optm record [id] ' . $row_img->id ) ;
|
1145 |
|
1146 |
// Update pulled status
|
1147 |
+
$q = "UPDATE $this->_table_img_optm SET optm_status = %s, target_filesize = %d, webp_filesize = %d WHERE id = %d " ;
|
1148 |
+
$wpdb->query( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_STATUS_PULLED, $target_size, $webp_size, $row_img->id ) ) ) ;
|
1149 |
|
1150 |
// Update child images ( same md5 files )
|
1151 |
+
$q = "UPDATE $this->_table_img_optm SET optm_status = %s, target_filesize = %d, webp_filesize = %d WHERE root_id = %d " ;
|
1152 |
+
$child_count = $wpdb->query( $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_STATUS_PULLED, $target_size, $webp_size, $row_img->id ) ) ) ;
|
1153 |
|
1154 |
+
// Save server_list to notify taken
|
1155 |
+
if ( empty( $server_list[ $server ] ) ) {
|
1156 |
+
$server_list[ $server ] = array() ;
|
|
|
|
|
|
|
|
|
|
|
1157 |
}
|
1158 |
+
$server_list[ $server ][] = $server_info[ 'id' ] ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1159 |
|
1160 |
+
}
|
|
|
|
|
|
|
|
|
|
|
1161 |
|
1162 |
+
// Notify IAPI images taken
|
1163 |
+
foreach ( $server_list as $server => $img_list ) {
|
1164 |
+
$json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_IMG_TAKEN, $img_list, $server, true ) ;
|
1165 |
}
|
1166 |
|
1167 |
+
// use latest credit from last server response
|
1168 |
+
// Recover credit
|
1169 |
+
if ( is_array( $json ) && isset( $json[ 'credit' ] ) ) {
|
1170 |
+
$this->_update_credit( $json[ 'credit' ] ) ;
|
1171 |
}
|
1172 |
|
1173 |
+
// Try level up
|
1174 |
+
$tried_level_up = $this->_try_level_up() ;
|
1175 |
+
|
1176 |
// Check if there is still task in queue
|
1177 |
$q = "SELECT * FROM $this->_table_img_optm WHERE root_id = 0 AND optm_status = %s LIMIT 1" ;
|
1178 |
$tmp = $wpdb->get_row( $wpdb->prepare( $q, self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) ) ;
|
1179 |
if ( $tmp ) {
|
1180 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Task in queue, to be continued...' ) ;
|
1181 |
+
return [ 'ok' => 'to_be_continued' ] ;
|
1182 |
}
|
1183 |
|
1184 |
// If all pulled, update tag to done
|
1185 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Marked pull status to all pulled' ) ;
|
1186 |
update_option( LiteSpeed_Cache_Config::ITEM_IMG_OPTM_NEED_PULL, self::DB_IMG_OPTIMIZE_STATUS_PULLED ) ;
|
1187 |
+
|
1188 |
+
$time_cost = time() - $beginning ;
|
1189 |
+
if ( $tried_level_up ) {
|
1190 |
+
$tried_level_up = "[Msg] $tried_level_up" ;
|
1191 |
+
}
|
1192 |
+
|
1193 |
+
return [ 'ok' => "Pulled [ori] $total_pulled_ori [WebP] $total_pulled_webp [cost] {$time_cost}s $tried_level_up" ] ;
|
1194 |
}
|
1195 |
|
1196 |
/**
|
1197 |
+
* Auto send optm request
|
1198 |
*
|
1199 |
+
* @since 2.4.1
|
1200 |
* @access public
|
1201 |
*/
|
1202 |
+
public static function cron_auto_request()
|
1203 |
{
|
1204 |
+
if ( ! defined( 'DOING_CRON' ) ) {
|
1205 |
+
return false ;
|
1206 |
+
}
|
1207 |
+
|
1208 |
+
$instance = self::get_instance() ;
|
1209 |
+
|
1210 |
+
$credit = (int) $instance->summary_info( 'credit' ) ;
|
1211 |
+
if ( $credit < self::NUM_THRESHOLD_AUTO_REQUEST ) {
|
1212 |
+
return false ;
|
1213 |
+
}
|
1214 |
+
|
1215 |
+
// No need to check last time request interval for now
|
1216 |
+
|
1217 |
+
$instance->_request_optm( 'from cron' ) ;
|
1218 |
}
|
1219 |
|
1220 |
/**
|
1294 |
return $meta_value ;
|
1295 |
}
|
1296 |
|
1297 |
+
/**
|
1298 |
+
* Clean up unfinished data for CLI usage
|
1299 |
+
*
|
1300 |
+
* @since 2.4.4
|
1301 |
+
* @access public
|
1302 |
+
*/
|
1303 |
+
public function destroy_unfinished()
|
1304 |
+
{
|
1305 |
+
$res = $this->_img_optimize_destroy_unfinished() ;
|
1306 |
+
|
1307 |
+
return $res ;
|
1308 |
+
}
|
1309 |
+
|
1310 |
/**
|
1311 |
* Destroy all unfinished queue locally and to LiteSpeed IAPI server
|
1312 |
*
|
1323 |
$json = LiteSpeed_Cache_Admin_API::post( LiteSpeed_Cache_Admin_API::IAPI_ACTION_REQUEST_DESTROY_UNFINISHED ) ;
|
1324 |
|
1325 |
// confirm link will be displayed by Admin_API automatically
|
1326 |
+
if ( is_array( $json ) ) {
|
1327 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] cmd result', $json ) ;
|
1328 |
}
|
1329 |
|
1331 |
if ( ! is_array( $json ) || empty( $json[ 'success' ] ) ) {
|
1332 |
|
1333 |
// For other errors that Admin_API didn't take
|
1334 |
+
if ( ! is_array( $json ) ) {
|
1335 |
LiteSpeed_Cache_Admin_Display::error( $json ) ;
|
1336 |
|
1337 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] err ', $json ) ;
|
1338 |
+
|
1339 |
+
return $json ;
|
1340 |
}
|
1341 |
+
|
1342 |
return ;
|
1343 |
}
|
1344 |
|
1351 |
$q = "DELETE FROM $this->_table_img_optm WHERE optm_status IN ( " . implode( ',', array_fill( 0, count( $_status_to_clear ), '%s' ) ) . " )" ;
|
1352 |
$wpdb->query( $wpdb->prepare( $q, $_status_to_clear ) ) ;
|
1353 |
|
1354 |
+
// Recover credit
|
1355 |
+
$this->_sync_data( true ) ;
|
1356 |
|
1357 |
$msg = __( 'Destroy unfinished data successfully.', 'litespeed-cache' ) ;
|
1358 |
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
1359 |
|
1360 |
+
return $msg ;
|
1361 |
+
|
1362 |
}
|
1363 |
|
1364 |
/**
|
1434 |
// Clear credit info
|
1435 |
delete_option( self::DB_IMG_OPTM_SUMMARY ) ;
|
1436 |
|
|
|
|
|
1437 |
exit( 'ok' ) ;
|
1438 |
}
|
1439 |
|
1539 |
|
1540 |
// Push to LiteSpeed IAPI server
|
1541 |
$json = $this->_push_img_in_queue_to_iapi() ;
|
1542 |
+
if ( ! is_array( $json ) ) {
|
1543 |
+
return $json ;
|
1544 |
}
|
1545 |
// Returned data is the requested and notifed images
|
1546 |
$pids = $json[ 'pids' ] ;
|
1577 |
|
1578 |
}
|
1579 |
|
1580 |
+
/**
|
1581 |
+
* Try to level up
|
1582 |
+
*
|
1583 |
+
* @since 2.4.1
|
1584 |
+
* @access private
|
1585 |
+
*/
|
1586 |
+
private function _try_level_up()
|
1587 |
+
{
|
1588 |
+
$optm_summary = $this->summary_info() ;
|
1589 |
+
if ( empty( $optm_summary[ 'level' ] ) || empty( $optm_summary[ 'credit_recovered' ] ) || empty( $optm_summary[ '_level_data' ] ) ) {
|
1590 |
+
return ;
|
1591 |
+
}
|
1592 |
+
|
1593 |
+
// level beyond 5 should be triggered manually
|
1594 |
+
if ( $optm_summary[ 'level' ] >= 5 ) {
|
1595 |
+
return ;
|
1596 |
+
}
|
1597 |
+
|
1598 |
+
$next_level = $optm_summary[ 'level' ] + 1 ;
|
1599 |
+
$next_level_data = $optm_summary[ '_level_data' ][ $next_level ] ;
|
1600 |
+
|
1601 |
+
if ( $optm_summary[ 'credit_recovered' ] <= $next_level_data[ 0 ] ) {
|
1602 |
+
return ;
|
1603 |
+
}
|
1604 |
+
|
1605 |
+
// Now do level up magic
|
1606 |
+
// Bless we can get more reviews to encourage me ~
|
1607 |
+
$json = $this->_sync_data( true ) ;
|
1608 |
+
if ( $json[ 'level' ] > $optm_summary[ 'level' ] ) {
|
1609 |
+
$msg = "Upgraded to level $json[level] !" ;
|
1610 |
+
LiteSpeed_Cache_Log::debug( "[Img_Optm] $msg" ) ;
|
1611 |
+
return $msg ;
|
1612 |
+
}
|
1613 |
+
else {
|
1614 |
+
LiteSpeed_Cache_Log::debug( "[Img_Optm] Upgrade failed [old level data] " . var_export( $optm_summary, true ), $json ) ;
|
1615 |
+
}
|
1616 |
+
}
|
1617 |
+
|
1618 |
/**
|
1619 |
* Update client credit info
|
1620 |
*
|
1624 |
private function _update_credit( $credit )
|
1625 |
{
|
1626 |
$summary = get_option( self::DB_IMG_OPTM_SUMMARY, array() ) ;
|
1627 |
+
|
1628 |
+
if ( empty( $summary[ 'credit' ] ) ) {
|
1629 |
+
$summary[ 'credit' ] = 0 ;
|
1630 |
+
}
|
1631 |
+
|
1632 |
if ( $credit === '++' ) {
|
1633 |
$credit = $summary[ 'credit' ] + 1 ;
|
1634 |
}
|
1635 |
+
|
1636 |
+
$old = $summary[ 'credit' ] ?: '-' ;
|
1637 |
+
LiteSpeed_Cache_Log::debug( "[Img_Optm] Credit updated \t\t[Old] $old \t\t[New] $credit" ) ;
|
1638 |
+
|
1639 |
+
// Mark credit recovered
|
1640 |
+
if ( $credit > $summary[ 'credit' ] ) {
|
1641 |
+
if ( empty( $summary[ 'credit_recovered' ] ) ) {
|
1642 |
+
$summary[ 'credit_recovered' ] = 0 ;
|
1643 |
+
}
|
1644 |
+
$summary[ 'credit_recovered' ] += $credit - $summary[ 'credit' ] ;
|
1645 |
+
}
|
1646 |
+
|
1647 |
$summary[ 'credit' ] = $credit ;
|
1648 |
|
1649 |
update_option( self::DB_IMG_OPTM_SUMMARY, $summary ) ;
|
1995 |
LiteSpeed_Cache_Admin_Display::add_notice( LiteSpeed_Cache_Admin_Display::NOTICE_GREEN, $msg ) ;
|
1996 |
}
|
1997 |
|
1998 |
+
/**
|
1999 |
+
* Delete one optm data and recover original file
|
2000 |
+
*
|
2001 |
+
* @since 2.4.2
|
2002 |
+
* @access public
|
2003 |
+
*/
|
2004 |
+
public function reset_row( $post_id )
|
2005 |
+
{
|
2006 |
+
if ( ! $post_id ) {
|
2007 |
+
return ;
|
2008 |
+
}
|
2009 |
+
|
2010 |
+
$size_meta = get_post_meta( $post_id, self::DB_IMG_OPTIMIZE_SIZE, true ) ;
|
2011 |
+
|
2012 |
+
if ( ! $size_meta ) {
|
2013 |
+
return ;
|
2014 |
+
}
|
2015 |
+
|
2016 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] _reset_row [pid] ' . $post_id ) ;
|
2017 |
+
|
2018 |
+
global $wpdb ;
|
2019 |
+
$q = "SELECT * FROM $this->_table_img_optm WHERE post_id = %d" ;
|
2020 |
+
$list = $wpdb->get_results( $wpdb->prepare( $q, array( $post_id ) ) ) ;
|
2021 |
+
|
2022 |
+
foreach ( $list as $v ) {
|
2023 |
+
$local_file = $this->wp_upload_dir[ 'basedir' ] . '/' . $v->src ;
|
2024 |
+
|
2025 |
+
file_exists( $local_file . '.webp' ) && unlink( $local_file . '.webp' ) ;
|
2026 |
+
file_exists( $local_file . '.optm.webp' ) && unlink( $local_file . '.optm.webp' ) ;
|
2027 |
+
|
2028 |
+
$extension = pathinfo( $local_file, PATHINFO_EXTENSION ) ;
|
2029 |
+
$local_filename = substr( $local_file, 0, - strlen( $extension ) - 1 ) ;
|
2030 |
+
$bk_file = $local_filename . '.bk.' . $extension ;
|
2031 |
+
$bk_optm_file = $local_filename . '.bk.optm.' . $extension ;
|
2032 |
+
|
2033 |
+
if ( file_exists( $bk_file ) ) {
|
2034 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] _reset_row Revert ori file' . $bk_file ) ;
|
2035 |
+
unlink( $local_file ) ;
|
2036 |
+
rename( $bk_file, $local_file ) ;
|
2037 |
+
}
|
2038 |
+
elseif ( file_exists( $bk_optm_file ) ) {
|
2039 |
+
LiteSpeed_Cache_Log::debug( '[Img_Optm] _reset_row Del ori bk file' . $bk_optm_file ) ;
|
2040 |
+
unlink( $bk_optm_file ) ;
|
2041 |
+
}
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
$q = "DELETE FROM $this->_table_img_optm WHERE post_id = %d" ;
|
2045 |
+
$wpdb->query( $wpdb->prepare( $q, $post_id ) ) ;
|
2046 |
+
|
2047 |
+
delete_post_meta( $post_id, self::DB_IMG_OPTIMIZE_SIZE ) ;
|
2048 |
+
|
2049 |
+
$msg = __( 'Reset the optimized data successfully.', 'litespeed-cache' ) ;
|
2050 |
+
|
2051 |
+
LiteSpeed_Cache_Admin_Display::add_notice( LiteSpeed_Cache_Admin_Display::NOTICE_GREEN, $msg ) ;
|
2052 |
+
}
|
2053 |
+
|
2054 |
/**
|
2055 |
* Handle all request actions from main cls
|
2056 |
*
|
2064 |
$type = LiteSpeed_Cache_Router::verify_type() ;
|
2065 |
|
2066 |
switch ( $type ) {
|
2067 |
+
case self::TYPE_RESET_ROW :
|
2068 |
+
$instance->reset_row( ! empty( $_GET[ 'id' ] ) ? $_GET[ 'id' ] : false ) ;
|
2069 |
+
break ;
|
2070 |
+
|
2071 |
case self::TYPE_CALC_BKUP :
|
2072 |
$instance->_calc_bkup() ;
|
2073 |
break ;
|
2103 |
$instance->_update_cron_running( true ) ;
|
2104 |
|
2105 |
// Check if need to self redirect
|
2106 |
+
if ( is_array( $result ) && $result[ 'ok' ] === 'to_be_continued' ) {
|
2107 |
$link = LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_PULL ) ;
|
2108 |
// Add i to avoid browser too many redirected warning
|
2109 |
$i = ! empty( $_GET[ 'i' ] ) ? $_GET[ 'i' ] : 0 ;
|
2135 |
LiteSpeed_Cache_Admin::redirect() ;
|
2136 |
}
|
2137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2138 |
/**
|
2139 |
* Get the current instance object.
|
2140 |
*
|
inc/import.class.php
CHANGED
@@ -7,6 +7,11 @@
|
|
7 |
* @subpackage LiteSpeed_Cache/inc
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
|
|
|
|
|
|
|
|
|
|
10 |
class LiteSpeed_Cache_Import
|
11 |
{
|
12 |
private static $_instance ;
|
@@ -59,13 +64,24 @@ class LiteSpeed_Cache_Import
|
|
59 |
LiteSpeed_Cache_Admin::redirect() ;
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
/**
|
63 |
* Export settings to file
|
64 |
*
|
65 |
* @since 1.8.2
|
66 |
* @access private
|
67 |
*/
|
68 |
-
private function _export()
|
69 |
{
|
70 |
|
71 |
$data = array() ;
|
@@ -75,6 +91,10 @@ class LiteSpeed_Cache_Import
|
|
75 |
|
76 |
$data = base64_encode( serialize( $data ) ) ;
|
77 |
|
|
|
|
|
|
|
|
|
78 |
$filename = $this->_generate_filename() ;
|
79 |
|
80 |
// Update log
|
@@ -95,35 +115,56 @@ class LiteSpeed_Cache_Import
|
|
95 |
exit ;
|
96 |
}
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
/**
|
99 |
* Import settings from file
|
100 |
*
|
101 |
* @since 1.8.2
|
102 |
* @access private
|
103 |
*/
|
104 |
-
private function _import()
|
105 |
{
|
106 |
-
if (
|
107 |
-
|
|
|
108 |
|
109 |
-
|
110 |
-
|
111 |
|
112 |
-
|
113 |
-
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
|
123 |
-
|
124 |
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
if ( ! $data ) {
|
129 |
LiteSpeed_Cache_Log::debug( 'Import: Failed to import, no data' ) ;
|
@@ -136,10 +177,16 @@ class LiteSpeed_Cache_Import
|
|
136 |
}
|
137 |
}
|
138 |
|
139 |
-
LiteSpeed_Cache_Log::debug( 'Import: Imported ' . $_FILES[ 'ls_file' ][ 'name' ] ) ;
|
140 |
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
return true ;
|
145 |
|
7 |
* @subpackage LiteSpeed_Cache/inc
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
class LiteSpeed_Cache_Import
|
16 |
{
|
17 |
private static $_instance ;
|
64 |
LiteSpeed_Cache_Admin::redirect() ;
|
65 |
}
|
66 |
|
67 |
+
/**
|
68 |
+
* Export settings
|
69 |
+
*
|
70 |
+
* @since 2.4.1
|
71 |
+
* @return string All settings data
|
72 |
+
*/
|
73 |
+
public function export()
|
74 |
+
{
|
75 |
+
return $this->_export( true ) ;
|
76 |
+
}
|
77 |
+
|
78 |
/**
|
79 |
* Export settings to file
|
80 |
*
|
81 |
* @since 1.8.2
|
82 |
* @access private
|
83 |
*/
|
84 |
+
private function _export( $only_data_return = false )
|
85 |
{
|
86 |
|
87 |
$data = array() ;
|
91 |
|
92 |
$data = base64_encode( serialize( $data ) ) ;
|
93 |
|
94 |
+
if ( $only_data_return ) {
|
95 |
+
return $data ;
|
96 |
+
}
|
97 |
+
|
98 |
$filename = $this->_generate_filename() ;
|
99 |
|
100 |
// Update log
|
115 |
exit ;
|
116 |
}
|
117 |
|
118 |
+
/**
|
119 |
+
* Import settings
|
120 |
+
*
|
121 |
+
* @since 2.4.1
|
122 |
+
*/
|
123 |
+
public function import( $file )
|
124 |
+
{
|
125 |
+
return $this->_import( $file ) ;
|
126 |
+
}
|
127 |
+
|
128 |
/**
|
129 |
* Import settings from file
|
130 |
*
|
131 |
* @since 1.8.2
|
132 |
* @access private
|
133 |
*/
|
134 |
+
private function _import( $file = false )
|
135 |
{
|
136 |
+
if ( ! $file ) {
|
137 |
+
if ( empty( $_FILES[ 'ls_file' ][ 'name' ] ) || substr( $_FILES[ 'ls_file' ][ 'name' ], -5 ) != '.data' || empty( $_FILES[ 'ls_file' ][ 'tmp_name' ] ) ) {
|
138 |
+
LiteSpeed_Cache_Log::debug( 'Import: Failed to import, wront ls_file' ) ;
|
139 |
|
140 |
+
$msg = __( 'Import failed due to file error.', 'litespeed-cache' ) ;
|
141 |
+
LiteSpeed_Cache_Admin_Display::error( $msg ) ;
|
142 |
|
143 |
+
return false ;
|
144 |
+
}
|
145 |
|
146 |
+
// Update log
|
147 |
+
$log = get_option( self::DB_IMPORT_LOG, array() ) ;
|
148 |
+
if ( empty( $log[ 'import' ] ) ) {
|
149 |
+
$log[ 'import' ] = array() ;
|
150 |
+
}
|
151 |
+
$log[ 'import' ][ 'file' ] = $_FILES[ 'ls_file' ][ 'name' ] ;
|
152 |
+
$log[ 'import' ][ 'time' ] = time() ;
|
153 |
|
154 |
+
update_option( self::DB_IMPORT_LOG, $log ) ;
|
155 |
|
156 |
+
$data = file_get_contents( $_FILES[ 'ls_file' ][ 'tmp_name' ] ) ;
|
157 |
+
}
|
158 |
+
else {
|
159 |
+
$data = file_get_contents( $file ) ;
|
160 |
+
}
|
161 |
+
|
162 |
+
try {
|
163 |
+
$data = unserialize( base64_decode( $data ) ) ;
|
164 |
+
} catch ( Exception $ex ) {
|
165 |
+
LiteSpeed_Cache_Log::debug( 'Import: Failed to parse serialized data' ) ;
|
166 |
+
return false ;
|
167 |
+
}
|
168 |
|
169 |
if ( ! $data ) {
|
170 |
LiteSpeed_Cache_Log::debug( 'Import: Failed to import, no data' ) ;
|
177 |
}
|
178 |
}
|
179 |
|
|
|
180 |
|
181 |
+
if ( ! $file ) {
|
182 |
+
LiteSpeed_Cache_Log::debug( 'Import: Imported ' . $_FILES[ 'ls_file' ][ 'name' ] ) ;
|
183 |
+
|
184 |
+
$msg = sprintf( __( 'Imported setting file %s successfully.', 'litespeed-cache' ), $_FILES[ 'ls_file' ][ 'name' ] ) ;
|
185 |
+
LiteSpeed_Cache_Admin_Display::succeed( $msg ) ;
|
186 |
+
}
|
187 |
+
else {
|
188 |
+
LiteSpeed_Cache_Log::debug( 'Import: Imported ' . $file ) ;
|
189 |
+
}
|
190 |
|
191 |
return true ;
|
192 |
|
inc/litespeed-cache.class.php
CHANGED
@@ -14,12 +14,18 @@
|
|
14 |
* @subpackage LiteSpeed_Cache/inc
|
15 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
16 |
*/
|
|
|
|
|
|
|
|
|
|
|
17 |
class LiteSpeed_Cache
|
18 |
{
|
19 |
private static $_instance ;
|
20 |
|
|
|
21 |
const PLUGIN_NAME = 'litespeed-cache' ;
|
22 |
-
const PLUGIN_VERSION = '2.4' ;
|
23 |
|
24 |
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
|
25 |
|
@@ -43,7 +49,7 @@ class LiteSpeed_Cache
|
|
43 |
const ACTION_DO_CRAWL = 'do-crawl' ;
|
44 |
const ACTION_BLACKLIST_SAVE = 'blacklist-save' ;
|
45 |
const ACTION_CDN_CLOUDFLARE = 'cdn_cloudflare' ;
|
46 |
-
const
|
47 |
|
48 |
const ACTION_FRONT_EXCLUDE = 'front-exclude' ;
|
49 |
|
@@ -336,8 +342,8 @@ class LiteSpeed_Cache
|
|
336 |
$msg = LiteSpeed_Cache_CDN_Cloudflare::handler() ;
|
337 |
break ;
|
338 |
|
339 |
-
case LiteSpeed_Cache::
|
340 |
-
$msg =
|
341 |
break ;
|
342 |
|
343 |
default:
|
14 |
* @subpackage LiteSpeed_Cache/inc
|
15 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
16 |
*/
|
17 |
+
|
18 |
+
if ( ! defined( 'WPINC' ) ) {
|
19 |
+
die ;
|
20 |
+
}
|
21 |
+
|
22 |
class LiteSpeed_Cache
|
23 |
{
|
24 |
private static $_instance ;
|
25 |
|
26 |
+
const NAME = 'LiteSpeed Cache' ;
|
27 |
const PLUGIN_NAME = 'litespeed-cache' ;
|
28 |
+
const PLUGIN_VERSION = '2.4.4' ;
|
29 |
|
30 |
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
|
31 |
|
49 |
const ACTION_DO_CRAWL = 'do-crawl' ;
|
50 |
const ACTION_BLACKLIST_SAVE = 'blacklist-save' ;
|
51 |
const ACTION_CDN_CLOUDFLARE = 'cdn_cloudflare' ;
|
52 |
+
const ACTION_CDN_QUIC = 'cdn_quic' ;
|
53 |
|
54 |
const ACTION_FRONT_EXCLUDE = 'front-exclude' ;
|
55 |
|
342 |
$msg = LiteSpeed_Cache_CDN_Cloudflare::handler() ;
|
343 |
break ;
|
344 |
|
345 |
+
case LiteSpeed_Cache::ACTION_CDN_QUIC:
|
346 |
+
$msg = LiteSpeed_Cache_CDN_Quic::handler() ;
|
347 |
break ;
|
348 |
|
349 |
default:
|
inc/litespeed.autoload.php
CHANGED
@@ -27,7 +27,7 @@ if ( !function_exists('_litespeed_autoload') ) {
|
|
27 |
'LiteSpeed_Cache_API' => 'inc/api.class.php',
|
28 |
'LiteSpeed_Cache_CDN' => 'inc/cdn.class.php',
|
29 |
'LiteSpeed_Cache_CDN_Cloudflare' => 'inc/cdn/cloudflare.class.php',
|
30 |
-
'
|
31 |
'LiteSpeed_Cache_Config' => 'inc/config.class.php',
|
32 |
'LiteSpeed_Cache_Control' => 'inc/control.class.php',
|
33 |
'LiteSpeed_Cache_Const' => 'inc/const.cls.php',
|
@@ -62,6 +62,7 @@ if ( !function_exists('_litespeed_autoload') ) {
|
|
62 |
'LiteSpeed_Cache_Admin_Settings' => 'admin/litespeed-cache-admin-settings.class.php',
|
63 |
|
64 |
'LiteSpeed_Cache_Cli_Admin' => 'cli/litespeed-cache-cli-admin.class.php',
|
|
|
65 |
'LiteSpeed_Cache_Cli_Purge' => 'cli/litespeed-cache-cli-purge.class.php',
|
66 |
|
67 |
'LiteSpeed_Cache_Tags' => 'includes/deprecated-litespeed-cache-tags.class.php',
|
27 |
'LiteSpeed_Cache_API' => 'inc/api.class.php',
|
28 |
'LiteSpeed_Cache_CDN' => 'inc/cdn.class.php',
|
29 |
'LiteSpeed_Cache_CDN_Cloudflare' => 'inc/cdn/cloudflare.class.php',
|
30 |
+
'LiteSpeed_Cache_CDN_Quic' => 'inc/cdn/quic.class.php',
|
31 |
'LiteSpeed_Cache_Config' => 'inc/config.class.php',
|
32 |
'LiteSpeed_Cache_Control' => 'inc/control.class.php',
|
33 |
'LiteSpeed_Cache_Const' => 'inc/const.cls.php',
|
62 |
'LiteSpeed_Cache_Admin_Settings' => 'admin/litespeed-cache-admin-settings.class.php',
|
63 |
|
64 |
'LiteSpeed_Cache_Cli_Admin' => 'cli/litespeed-cache-cli-admin.class.php',
|
65 |
+
'LiteSpeed_Cache_CLI_IAPI' => 'cli/litespeed-cache-cli-iapi.class.php',
|
66 |
'LiteSpeed_Cache_Cli_Purge' => 'cli/litespeed-cache-cli-purge.class.php',
|
67 |
|
68 |
'LiteSpeed_Cache_Tags' => 'includes/deprecated-litespeed-cache-tags.class.php',
|
inc/log.class.php
CHANGED
@@ -10,6 +10,11 @@
|
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
|
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Log
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -284,6 +289,7 @@ class LiteSpeed_Cache_Log
|
|
284 |
|
285 |
$servervars = array(
|
286 |
'Query String' => '',
|
|
|
287 |
'HTTP_USER_AGENT' => '',
|
288 |
'HTTP_ACCEPT_ENCODING' => '',
|
289 |
'HTTP_COOKIE' => '',
|
@@ -315,8 +321,13 @@ class LiteSpeed_Cache_Log
|
|
315 |
$params[] = 'Query String: ' . $qs ;
|
316 |
}
|
317 |
|
|
|
|
|
|
|
|
|
318 |
if ( defined( 'LSCWP_LOG_MORE' ) ) {
|
319 |
$params[] = 'User Agent: ' . $server[ 'HTTP_USER_AGENT' ] ;
|
|
|
320 |
$params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING'] ;
|
321 |
}
|
322 |
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_DEBUG_COOKIE ) ) {
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
13 |
+
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die ;
|
16 |
+
}
|
17 |
+
|
18 |
class LiteSpeed_Cache_Log
|
19 |
{
|
20 |
private static $_instance ;
|
289 |
|
290 |
$servervars = array(
|
291 |
'Query String' => '',
|
292 |
+
'HTTP_ACCEPT' => '',
|
293 |
'HTTP_USER_AGENT' => '',
|
294 |
'HTTP_ACCEPT_ENCODING' => '',
|
295 |
'HTTP_COOKIE' => '',
|
321 |
$params[] = 'Query String: ' . $qs ;
|
322 |
}
|
323 |
|
324 |
+
if ( ! empty( $_SERVER[ 'HTTP_REFERER' ] ) ) {
|
325 |
+
$params[] = 'HTTP_REFERER: ' . $server[ 'HTTP_REFERER' ] ;
|
326 |
+
}
|
327 |
+
|
328 |
if ( defined( 'LSCWP_LOG_MORE' ) ) {
|
329 |
$params[] = 'User Agent: ' . $server[ 'HTTP_USER_AGENT' ] ;
|
330 |
+
$params[] = 'Accept: ' . $server['HTTP_ACCEPT'] ;
|
331 |
$params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING'] ;
|
332 |
}
|
333 |
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_DEBUG_COOKIE ) ) {
|
inc/media.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The class to operate media data.
|
5 |
*
|
@@ -10,6 +9,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Media
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -100,9 +103,24 @@ class LiteSpeed_Cache_Media
|
|
100 |
if ( get_option( LiteSpeed_Cache_Config::ITEM_IMG_OPTM_NEED_PULL ) ) {
|
101 |
add_filter( 'manage_media_columns', array( $this, 'media_row_title' ) ) ;
|
102 |
add_filter( 'manage_media_custom_column', array( $this, 'media_row_actions' ), 10, 2 ) ;
|
|
|
|
|
|
|
103 |
}
|
104 |
}
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
/**
|
107 |
* Media Admin Menu -> Image Optimization Column Title
|
108 |
*
|
@@ -130,68 +148,97 @@ class LiteSpeed_Cache_Media
|
|
130 |
|
131 |
$local_file = get_attached_file( $post_id ) ;
|
132 |
|
133 |
-
$
|
134 |
-
$desc = false ;
|
135 |
-
$cls = 'litespeed-icon-media-webp' ;
|
136 |
-
$cls_webp = '' ;
|
137 |
-
if ( file_exists( $local_file . '.webp' ) ) {
|
138 |
-
$desc = __( 'Disable WebP', 'litespeed-cache' ) ;
|
139 |
-
$cls_webp = 'litespeed-txt-webp' ;
|
140 |
-
}
|
141 |
-
elseif ( file_exists( $local_file . '.optm.webp' ) ) {
|
142 |
-
$cls .= '-disabled' ;
|
143 |
-
$desc = __( 'Enable WebP', 'litespeed-cache' ) ;
|
144 |
-
$cls_webp = 'litespeed-txt-disabled' ;
|
145 |
-
}
|
146 |
-
|
147 |
-
$link_webp = '' ;
|
148 |
-
if ( $desc ) {
|
149 |
-
$link_webp = sprintf( '<a href="%1$s" class="litespeed-media-href" title="%3$s"><span class="%2$s"></span></a>', $link, $cls, $desc ) ;
|
150 |
-
}
|
151 |
-
|
152 |
-
$extension = pathinfo( $local_file, PATHINFO_EXTENSION ) ;
|
153 |
-
$bk_file = substr( $local_file, 0, -strlen( $extension ) ) . 'bk.' . $extension ;
|
154 |
-
$bk_optm_file = substr( $local_file, 0, -strlen( $extension ) ) . 'bk.optm.' . $extension ;
|
155 |
-
|
156 |
-
$link = LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, 'orig' . $post_id ) ;
|
157 |
-
$desc = false ;
|
158 |
-
$cls = 'litespeed-icon-media-optm' ;
|
159 |
-
$cls_ori = '' ;
|
160 |
-
if ( file_exists( $bk_file ) ) {
|
161 |
-
$desc = __( 'Restore Original File', 'litespeed-cache' ) ;
|
162 |
-
$cls_ori = 'litespeed-txt-ori' ;
|
163 |
-
}
|
164 |
-
elseif ( file_exists( $bk_optm_file ) ) {
|
165 |
-
$cls .= '-disabled' ;
|
166 |
-
$desc = __( 'Switch To Optimized File', 'litespeed-cache' ) ;
|
167 |
-
$cls_ori = 'litespeed-txt-disabled' ;
|
168 |
-
}
|
169 |
-
|
170 |
-
$link_ori = '' ;
|
171 |
-
if ( $desc ) {
|
172 |
-
$link_ori = sprintf( '<a href="%1$s" class="litespeed-media-href" title="%3$s"><span class="%2$s"></span></a>', $link, $cls, $desc ) ;
|
173 |
-
}
|
174 |
|
|
|
175 |
$info_webp = '' ;
|
176 |
-
$size_meta = get_post_meta( $post_id, LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_SIZE, true ) ;
|
177 |
if ( $size_meta && ! empty ( $size_meta[ 'webp_saved' ] ) ) {
|
178 |
$percent = ceil( $size_meta[ 'webp_saved' ] * 100 / $size_meta[ 'webp_total' ] ) ;
|
179 |
$pie_webp = LiteSpeed_Cache_GUI::pie( $percent, 30 ) ;
|
180 |
$txt_webp = sprintf( __( 'WebP saved %s', 'litespeed-cache' ), LiteSpeed_Cache_Utility::real_size( $size_meta[ 'webp_saved' ] ) ) ;
|
181 |
|
182 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
}
|
184 |
|
|
|
185 |
$info_ori = '' ;
|
186 |
if ( $size_meta && ! empty ( $size_meta[ 'ori_saved' ] ) ) {
|
187 |
$percent = ceil( $size_meta[ 'ori_saved' ] * 100 / $size_meta[ 'ori_total' ] ) ;
|
188 |
$pie_ori = LiteSpeed_Cache_GUI::pie( $percent, 30 ) ;
|
189 |
$txt_ori = sprintf( __( 'Original saved %s', 'litespeed-cache' ), LiteSpeed_Cache_Utility::real_size( $size_meta[ 'ori_saved' ] ) ) ;
|
190 |
|
191 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
|
197 |
/**
|
@@ -233,11 +280,15 @@ class LiteSpeed_Cache_Media
|
|
233 |
*/
|
234 |
private function webp_support()
|
235 |
{
|
236 |
-
if ( empty( $_SERVER[ 'HTTP_ACCEPT' ] )
|
237 |
-
return
|
238 |
}
|
239 |
|
240 |
-
|
|
|
|
|
|
|
|
|
241 |
}
|
242 |
|
243 |
/**
|
@@ -253,9 +304,7 @@ class LiteSpeed_Cache_Media
|
|
253 |
if ( strpos( $_SERVER[ 'REQUEST_URI' ], self::LAZY_LIB ) !== false ) {
|
254 |
LiteSpeed_Cache_Log::debug( '[Media] run lazyload lib' ) ;
|
255 |
|
256 |
-
$
|
257 |
-
|
258 |
-
$content = Litespeed_File::read( $file ) ;
|
259 |
|
260 |
$static_file = LSCWP_CONTENT_DIR . '/cache/js/lazyload.js' ;
|
261 |
|
@@ -279,6 +328,19 @@ class LiteSpeed_Cache_Media
|
|
279 |
}
|
280 |
}
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
/**
|
283 |
* Handle all request actions from main cls
|
284 |
*
|
@@ -392,8 +454,14 @@ class LiteSpeed_Cache_Media
|
|
392 |
|
393 |
// Include lazyload lib js and init lazyload
|
394 |
if ( $cfg_img_lazy || $cfg_iframe_lazy ) {
|
395 |
-
|
396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
}
|
398 |
}
|
399 |
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The class to operate media data.
|
4 |
*
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Media
|
17 |
{
|
18 |
private static $_instance ;
|
103 |
if ( get_option( LiteSpeed_Cache_Config::ITEM_IMG_OPTM_NEED_PULL ) ) {
|
104 |
add_filter( 'manage_media_columns', array( $this, 'media_row_title' ) ) ;
|
105 |
add_filter( 'manage_media_custom_column', array( $this, 'media_row_actions' ), 10, 2 ) ;
|
106 |
+
|
107 |
+
// Hook to attachment delete action
|
108 |
+
add_action( 'delete_attachment', array( $this, 'delete_attachment' ) ) ;
|
109 |
}
|
110 |
}
|
111 |
|
112 |
+
/**
|
113 |
+
* Media delete action hook
|
114 |
+
*
|
115 |
+
* @since 2.4.3
|
116 |
+
* @access public
|
117 |
+
*/
|
118 |
+
public function delete_attachment( $post_id )
|
119 |
+
{
|
120 |
+
LiteSpeed_Cache_Log::debug( '[Media] delete_attachment [pid] ' . $post_id ) ;
|
121 |
+
LiteSpeed_Cache_Img_Optm::get_instance()->reset_row( $post_id ) ;
|
122 |
+
}
|
123 |
+
|
124 |
/**
|
125 |
* Media Admin Menu -> Image Optimization Column Title
|
126 |
*
|
148 |
|
149 |
$local_file = get_attached_file( $post_id ) ;
|
150 |
|
151 |
+
$size_meta = get_post_meta( $post_id, LiteSpeed_Cache_Img_Optm::DB_IMG_OPTIMIZE_SIZE, true ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
+
// WebP info
|
154 |
$info_webp = '' ;
|
|
|
155 |
if ( $size_meta && ! empty ( $size_meta[ 'webp_saved' ] ) ) {
|
156 |
$percent = ceil( $size_meta[ 'webp_saved' ] * 100 / $size_meta[ 'webp_total' ] ) ;
|
157 |
$pie_webp = LiteSpeed_Cache_GUI::pie( $percent, 30 ) ;
|
158 |
$txt_webp = sprintf( __( 'WebP saved %s', 'litespeed-cache' ), LiteSpeed_Cache_Utility::real_size( $size_meta[ 'webp_saved' ] ) ) ;
|
159 |
|
160 |
+
$link = LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, 'webp' . $post_id ) ;
|
161 |
+
$desc = false ;
|
162 |
+
$cls = 'litespeed-icon-media-webp' ;
|
163 |
+
$cls_webp = '' ;
|
164 |
+
if ( file_exists( $local_file . '.webp' ) ) {
|
165 |
+
$desc = __( 'Click to Disable WebP', 'litespeed-cache' ) ;
|
166 |
+
$cls_webp = 'litespeed-txt-webp' ;
|
167 |
+
}
|
168 |
+
elseif ( file_exists( $local_file . '.optm.webp' ) ) {
|
169 |
+
$cls .= '-disabled' ;
|
170 |
+
$desc = __( 'Click to Enable WebP', 'litespeed-cache' ) ;
|
171 |
+
$cls_webp = 'litespeed-txt-disabled' ;
|
172 |
+
}
|
173 |
+
|
174 |
+
$info_webp = "<div class='litespeed-media-p $cls_webp litespeed-right20'><div class='litespeed-text-dimgray litespeed-text-center'>WebP</div>" ;
|
175 |
+
|
176 |
+
if ( $desc ) {
|
177 |
+
$info_webp .= sprintf( '<div><a href="%1$s" class="litespeed-media-href" title="%2$s' . "\n\n" . '%3$s">%4$s</a></div>', $link, $txt_webp, $desc, $pie_webp ) ;
|
178 |
+
}
|
179 |
+
else {
|
180 |
+
$info_webp .= sprintf( '<div title="%1$s">%2$s</div>', $txt_webp, $pie_webp ) ;
|
181 |
+
}
|
182 |
+
|
183 |
+
$info_webp .= '</div>' ;
|
184 |
}
|
185 |
|
186 |
+
// Original image info
|
187 |
$info_ori = '' ;
|
188 |
if ( $size_meta && ! empty ( $size_meta[ 'ori_saved' ] ) ) {
|
189 |
$percent = ceil( $size_meta[ 'ori_saved' ] * 100 / $size_meta[ 'ori_total' ] ) ;
|
190 |
$pie_ori = LiteSpeed_Cache_GUI::pie( $percent, 30 ) ;
|
191 |
$txt_ori = sprintf( __( 'Original saved %s', 'litespeed-cache' ), LiteSpeed_Cache_Utility::real_size( $size_meta[ 'ori_saved' ] ) ) ;
|
192 |
|
193 |
+
$extension = pathinfo( $local_file, PATHINFO_EXTENSION ) ;
|
194 |
+
$bk_file = substr( $local_file, 0, -strlen( $extension ) ) . 'bk.' . $extension ;
|
195 |
+
$bk_optm_file = substr( $local_file, 0, -strlen( $extension ) ) . 'bk.optm.' . $extension ;
|
196 |
+
|
197 |
+
$link = LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, 'orig' . $post_id ) ;
|
198 |
+
$desc = false ;
|
199 |
+
$cls = 'litespeed-icon-media-optm' ;
|
200 |
+
$cls_ori = '' ;
|
201 |
+
if ( file_exists( $bk_file ) ) {
|
202 |
+
$desc = __( 'Click to Restore Original File', 'litespeed-cache' ) ;
|
203 |
+
$cls_ori = 'litespeed-txt-ori' ;
|
204 |
+
}
|
205 |
+
elseif ( file_exists( $bk_optm_file ) ) {
|
206 |
+
$cls .= '-disabled' ;
|
207 |
+
$desc = __( 'Click to Switch To Optimized File', 'litespeed-cache' ) ;
|
208 |
+
$cls_ori = 'litespeed-txt-disabled' ;
|
209 |
+
}
|
210 |
+
|
211 |
+
$info_ori = "<div class='litespeed-media-p $cls_ori litespeed-right30'><div class='litespeed-text-dimgray litespeed-text-center'>Orig.</div>" ;
|
212 |
+
|
213 |
+
if ( $desc ) {
|
214 |
+
$info_ori .= sprintf( '<div><a href="%1$s" class="litespeed-media-href" title="%2$s' . "\n\n" . '%3$s">%4$s</a></div>', $link, $txt_ori, $desc, $pie_ori ) ;
|
215 |
+
}
|
216 |
+
else {
|
217 |
+
$info_ori .= sprintf( '<div title="%1$s">%2$s</div>', $txt_ori, $pie_ori ) ;
|
218 |
+
}
|
219 |
+
|
220 |
+
$info_ori .= '</div>' ;
|
221 |
}
|
222 |
|
223 |
+
// Delete row btn
|
224 |
+
$del_row = '' ;
|
225 |
+
if ( $size_meta ) {
|
226 |
+
$del_row = '<div><div class="litespeed-text-dimgray litespeed-text-center">' . __( 'Reset', 'litespeed-cache' ) . '</div>' ;
|
227 |
+
$del_row .= sprintf( '<div class="litespeed-media-p"><a href="%1$s" class="">%2$s</a></div>',
|
228 |
+
LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_RESET_ROW, false, null, array( 'id' => $post_id ) ),
|
229 |
+
'<span class="dashicons dashicons-trash dashicons-large litespeed-warning litespeed-dashicons-large"></span>'
|
230 |
+
) ;
|
231 |
+
$del_row .= '</div>' ;
|
232 |
+
}
|
233 |
+
|
234 |
+
echo <<<eot
|
235 |
+
<div class="litespeed-flex-container">
|
236 |
+
$info_webp
|
237 |
+
$info_ori
|
238 |
+
$del_row
|
239 |
+
</div>
|
240 |
+
eot;
|
241 |
+
|
242 |
}
|
243 |
|
244 |
/**
|
280 |
*/
|
281 |
private function webp_support()
|
282 |
{
|
283 |
+
if ( ! empty( $_SERVER[ 'HTTP_ACCEPT' ] ) && strpos( $_SERVER[ 'HTTP_ACCEPT' ], 'image/webp' ) !== false ) {
|
284 |
+
return true ;
|
285 |
}
|
286 |
|
287 |
+
if ( ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) && strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'Page Speed' ) !== false ) {
|
288 |
+
return true ;
|
289 |
+
}
|
290 |
+
|
291 |
+
return false ;
|
292 |
}
|
293 |
|
294 |
/**
|
304 |
if ( strpos( $_SERVER[ 'REQUEST_URI' ], self::LAZY_LIB ) !== false ) {
|
305 |
LiteSpeed_Cache_Log::debug( '[Media] run lazyload lib' ) ;
|
306 |
|
307 |
+
$content = $this->_get_lazyload_lib_content() ;
|
|
|
|
|
308 |
|
309 |
$static_file = LSCWP_CONTENT_DIR . '/cache/js/lazyload.js' ;
|
310 |
|
328 |
}
|
329 |
}
|
330 |
|
331 |
+
/**
|
332 |
+
* Read lazyload js lib content
|
333 |
+
*
|
334 |
+
* @since 2.4.3
|
335 |
+
* @access private
|
336 |
+
*/
|
337 |
+
private function _get_lazyload_lib_content()
|
338 |
+
{
|
339 |
+
$file = LSCWP_DIR . 'js/lazyload.min.js' ;
|
340 |
+
|
341 |
+
return Litespeed_File::read( $file ) ;
|
342 |
+
}
|
343 |
+
|
344 |
/**
|
345 |
* Handle all request actions from main cls
|
346 |
*
|
454 |
|
455 |
// Include lazyload lib js and init lazyload
|
456 |
if ( $cfg_img_lazy || $cfg_iframe_lazy ) {
|
457 |
+
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZYJS_INLINE ) ) {
|
458 |
+
$lazy_lib = '<script type="text/javascript">' . $this->_get_lazyload_lib_content() . '</script>' ;
|
459 |
+
} else {
|
460 |
+
$lazy_lib_url = LiteSpeed_Cache_Utility::get_permalink_url( self::LAZY_LIB ) ;
|
461 |
+
$lazy_lib = '<script src="' . $lazy_lib_url . '"></script>' ;
|
462 |
+
}
|
463 |
+
|
464 |
+
$this->content = str_replace( '</body>', $lazy_lib . '</body>', $this->content ) ;
|
465 |
}
|
466 |
}
|
467 |
|
inc/object.class.php
CHANGED
@@ -2,13 +2,16 @@
|
|
2 |
/**
|
3 |
* The object cache class
|
4 |
*
|
5 |
-
*
|
6 |
* @since 1.8
|
7 |
* @package LiteSpeed_Cache
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
/**
|
13 |
* Handle exception
|
14 |
*/
|
2 |
/**
|
3 |
* The object cache class
|
4 |
*
|
|
|
5 |
* @since 1.8
|
6 |
* @package LiteSpeed_Cache
|
7 |
* @subpackage LiteSpeed_Cache/inc
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
10 |
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
/**
|
16 |
* Handle exception
|
17 |
*/
|
inc/optimize.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The optimize class.
|
5 |
*
|
@@ -10,6 +9,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Optimize
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -856,7 +859,12 @@ class LiteSpeed_Cache_Optimize
|
|
856 |
|
857 |
$src = array_values( $src ) ;
|
858 |
|
859 |
-
|
|
|
|
|
|
|
|
|
|
|
860 |
|
861 |
$short = substr( $hash, -5 ) ;
|
862 |
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The optimize class.
|
4 |
*
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Optimize
|
17 |
{
|
18 |
private static $_instance ;
|
859 |
|
860 |
$src = array_values( $src ) ;
|
861 |
|
862 |
+
// Drop query strings
|
863 |
+
$src = array_map( array( $this, 'remove_query_strings' ), $src ) ;
|
864 |
+
|
865 |
+
$purge_timestamp = get_option( LiteSpeed_Cache_Config::ITEM_TIMESTAMP_PURGE_CSS ) ?: '' ;
|
866 |
+
|
867 |
+
$hash = md5( serialize( $src ) . $purge_timestamp ) ;
|
868 |
|
869 |
$short = substr( $hash, -5 ) ;
|
870 |
|
inc/optimizer.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The optimize4 class.
|
5 |
*
|
@@ -9,6 +8,10 @@
|
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Optimizer
|
13 |
{
|
14 |
private static $_instance ;
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The optimize4 class.
|
4 |
*
|
8 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
9 |
*/
|
10 |
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
class LiteSpeed_Cache_Optimizer
|
16 |
{
|
17 |
private static $_instance ;
|
inc/purge.class.php
CHANGED
@@ -5,10 +5,12 @@
|
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
7 |
* @since 2.2 Refactored. Changed access from public to private for most func and class variables.
|
8 |
-
* @package LiteSpeed_Cache
|
9 |
-
* @subpackage LiteSpeed_Cache/inc
|
10 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
|
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Purge
|
13 |
{
|
14 |
private static $_instance ;
|
@@ -204,6 +206,8 @@ class LiteSpeed_Cache_Purge
|
|
204 |
*/
|
205 |
private function _purge_all_cssjs( $silence = false )
|
206 |
{
|
|
|
|
|
207 |
$this->_add( LiteSpeed_Cache_Tag::TYPE_MIN ) ;
|
208 |
|
209 |
// For non-ls users
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
7 |
* @since 2.2 Refactored. Changed access from public to private for most func and class variables.
|
|
|
|
|
|
|
8 |
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'WPINC' ) ) {
|
11 |
+
die ;
|
12 |
+
}
|
13 |
+
|
14 |
class LiteSpeed_Cache_Purge
|
15 |
{
|
16 |
private static $_instance ;
|
206 |
*/
|
207 |
private function _purge_all_cssjs( $silence = false )
|
208 |
{
|
209 |
+
update_option( LiteSpeed_Cache_Config::ITEM_TIMESTAMP_PURGE_CSS, time() ) ;
|
210 |
+
|
211 |
$this->_add( LiteSpeed_Cache_Tag::TYPE_MIN ) ;
|
212 |
|
213 |
// For non-ls users
|
inc/router.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The core plugin router class.
|
5 |
*
|
@@ -7,10 +6,12 @@
|
|
7 |
*
|
8 |
* @since 1.1.0
|
9 |
* @since 1.5 Moved into /inc
|
10 |
-
* @package LiteSpeed_Cache
|
11 |
-
* @subpackage LiteSpeed_Cache/inc
|
12 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
13 |
*/
|
|
|
|
|
|
|
|
|
|
|
14 |
class LiteSpeed_Cache_Router
|
15 |
{
|
16 |
private static $_instance ;
|
@@ -65,6 +66,17 @@ class LiteSpeed_Cache_Router
|
|
65 |
return $can_final ;
|
66 |
}
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
/**
|
69 |
* Check if it can use CDN replacement
|
70 |
*
|
@@ -76,8 +88,16 @@ class LiteSpeed_Cache_Router
|
|
76 |
{
|
77 |
$can = true ;
|
78 |
|
79 |
-
if ( is_admin()
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
if ( is_feed() ) {
|
@@ -481,7 +501,7 @@ class LiteSpeed_Cache_Router
|
|
481 |
case LiteSpeed_Cache::ACTION_IMG_OPTM:
|
482 |
case LiteSpeed_Cache::ACTION_IAPI:
|
483 |
case LiteSpeed_Cache::ACTION_CDN_CLOUDFLARE:
|
484 |
-
case LiteSpeed_Cache::
|
485 |
case LiteSpeed_Cache::ACTION_IMPORT:
|
486 |
case LiteSpeed_Cache::ACTION_REPORT:
|
487 |
case LiteSpeed_Cache::ACTION_CSS:
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The core plugin router class.
|
4 |
*
|
6 |
*
|
7 |
* @since 1.1.0
|
8 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
9 |
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
class LiteSpeed_Cache_Router
|
16 |
{
|
17 |
private static $_instance ;
|
66 |
return $can_final ;
|
67 |
}
|
68 |
|
69 |
+
/**
|
70 |
+
* Check referer page to see if its from admin
|
71 |
+
*
|
72 |
+
* @since 2.4.2.1
|
73 |
+
* @access public
|
74 |
+
*/
|
75 |
+
public static function from_admin()
|
76 |
+
{
|
77 |
+
return ! empty( $_SERVER[ 'HTTP_REFERER' ] ) && strpos( $_SERVER[ 'HTTP_REFERER' ], get_admin_url() ) === 0 ;
|
78 |
+
}
|
79 |
+
|
80 |
/**
|
81 |
* Check if it can use CDN replacement
|
82 |
*
|
88 |
{
|
89 |
$can = true ;
|
90 |
|
91 |
+
if ( is_admin() ) {
|
92 |
+
if ( ! self::is_ajax() ) {
|
93 |
+
LiteSpeed_Cache_Log::debug2( '[Router] CDN bypassed: is not ajax call' ) ;
|
94 |
+
$can = false ;
|
95 |
+
}
|
96 |
+
|
97 |
+
if ( self::from_admin() ) {
|
98 |
+
LiteSpeed_Cache_Log::debug2( '[Router] CDN bypassed: ajax call from admin' ) ;
|
99 |
+
$can = false ;
|
100 |
+
}
|
101 |
}
|
102 |
|
103 |
if ( is_feed() ) {
|
501 |
case LiteSpeed_Cache::ACTION_IMG_OPTM:
|
502 |
case LiteSpeed_Cache::ACTION_IAPI:
|
503 |
case LiteSpeed_Cache::ACTION_CDN_CLOUDFLARE:
|
504 |
+
case LiteSpeed_Cache::ACTION_CDN_QUIC:
|
505 |
case LiteSpeed_Cache::ACTION_IMPORT:
|
506 |
case LiteSpeed_Cache::ACTION_REPORT:
|
507 |
case LiteSpeed_Cache::ACTION_CSS:
|
inc/tag.class.php
CHANGED
@@ -4,10 +4,12 @@
|
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
7 |
-
* @package LiteSpeed_Cache
|
8 |
-
* @subpackage LiteSpeed_Cache/inc
|
9 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Tag
|
12 |
{
|
13 |
private static $_instance ;
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
7 |
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WPINC' ) ) {
|
10 |
+
die ;
|
11 |
+
}
|
12 |
+
|
13 |
class LiteSpeed_Cache_Tag
|
14 |
{
|
15 |
private static $_instance ;
|
inc/task.class.php
CHANGED
@@ -1,20 +1,22 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The cron task class.
|
5 |
*
|
6 |
* @since 1.1.3
|
7 |
* @since 1.5 Moved into /inc
|
8 |
-
* @package LiteSpeed_Cache
|
9 |
-
* @subpackage LiteSpeed_Cache/inc
|
10 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
|
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Task
|
13 |
{
|
14 |
private static $_instance ;
|
15 |
|
16 |
const CRON_ACTION_HOOK_CRAWLER = 'litespeed_crawl_trigger' ;
|
17 |
const CRON_ACTION_HOOK_IMGOPTM = 'litespeed_imgoptm_trigger' ;
|
|
|
18 |
const CRON_ACTION_HOOK_CCSS = 'litespeed_ccss_trigger' ;
|
19 |
const CRON_FITLER_CRAWLER = 'litespeed_crawl_filter' ;
|
20 |
const CRON_FITLER = 'litespeed_filter' ;
|
@@ -39,13 +41,17 @@ class LiteSpeed_Cache_Task
|
|
39 |
}
|
40 |
|
41 |
// Register img optimization fetch ( always fetch immediately )
|
42 |
-
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_CRON )
|
43 |
self::schedule_filter_imgoptm() ;
|
44 |
|
45 |
-
add_action( self::CRON_ACTION_HOOK_IMGOPTM, 'LiteSpeed_Cache_Img_Optm::
|
46 |
}
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
// Register ccss generation
|
@@ -104,6 +110,23 @@ class LiteSpeed_Cache_Task
|
|
104 |
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
/**
|
108 |
* Schedule cron img optimization
|
109 |
*
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The cron task class.
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
7 |
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WPINC' ) ) {
|
10 |
+
die ;
|
11 |
+
}
|
12 |
+
|
13 |
class LiteSpeed_Cache_Task
|
14 |
{
|
15 |
private static $_instance ;
|
16 |
|
17 |
const CRON_ACTION_HOOK_CRAWLER = 'litespeed_crawl_trigger' ;
|
18 |
const CRON_ACTION_HOOK_IMGOPTM = 'litespeed_imgoptm_trigger' ;
|
19 |
+
const CRON_ACTION_HOOK_IMGOPTM_AUTO_REQUEST = 'litespeed_imgoptm_auto_request_trigger' ;
|
20 |
const CRON_ACTION_HOOK_CCSS = 'litespeed_ccss_trigger' ;
|
21 |
const CRON_FITLER_CRAWLER = 'litespeed_crawl_filter' ;
|
22 |
const CRON_FITLER = 'litespeed_filter' ;
|
41 |
}
|
42 |
|
43 |
// Register img optimization fetch ( always fetch immediately )
|
44 |
+
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_CRON ) ) {
|
45 |
self::schedule_filter_imgoptm() ;
|
46 |
|
47 |
+
add_action( self::CRON_ACTION_HOOK_IMGOPTM, 'LiteSpeed_Cache_Img_Optm::cron_pull_optimized_img' ) ;
|
48 |
}
|
49 |
+
|
50 |
+
// Image optm auto request
|
51 |
+
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_AUTO ) ) {
|
52 |
+
self::schedule_filter_imgoptm_auto_request() ;
|
53 |
+
|
54 |
+
add_action( self::CRON_ACTION_HOOK_IMGOPTM_AUTO_REQUEST, 'LiteSpeed_Cache_Img_Optm::cron_auto_request' ) ;
|
55 |
}
|
56 |
|
57 |
// Register ccss generation
|
110 |
|
111 |
}
|
112 |
|
113 |
+
/**
|
114 |
+
* Schedule cron img optm auto request
|
115 |
+
*
|
116 |
+
* @since 2.4.1
|
117 |
+
* @access public
|
118 |
+
*/
|
119 |
+
public static function schedule_filter_imgoptm_auto_request()
|
120 |
+
{
|
121 |
+
add_filter( 'cron_schedules', 'LiteSpeed_Cache_Task::lscache_cron_filter' ) ;
|
122 |
+
|
123 |
+
// Schedule event here to see if it can lost again or not
|
124 |
+
if( ! wp_next_scheduled( self::CRON_ACTION_HOOK_IMGOPTM_AUTO_REQUEST ) ) {
|
125 |
+
LiteSpeed_Cache_Log::debug( 'Cron log: ......img optm auto request cron hook register......' ) ;
|
126 |
+
wp_schedule_event( time(), self::CRON_FITLER, self::CRON_ACTION_HOOK_IMGOPTM_AUTO_REQUEST ) ;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
/**
|
131 |
* Schedule cron img optimization
|
132 |
*
|
inc/utility.class.php
CHANGED
@@ -1,14 +1,15 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The utility class.
|
5 |
*
|
6 |
* @since 1.1.5
|
7 |
* @since 1.5 Moved into /inc
|
8 |
-
* @package LiteSpeed_Cache
|
9 |
-
* @subpackage LiteSpeed_Cache/inc
|
10 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
|
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Utility
|
13 |
{
|
14 |
|
@@ -347,7 +348,7 @@ class LiteSpeed_Cache_Utility
|
|
347 |
* @param string $type The appending type to url
|
348 |
* @return string The built url.
|
349 |
*/
|
350 |
-
public static function build_url( $action, $type = false, $is_ajax = false, $page = null )
|
351 |
{
|
352 |
$prefix = '?' ;
|
353 |
|
@@ -399,7 +400,12 @@ class LiteSpeed_Cache_Utility
|
|
399 |
// Remove potential param `type` from url
|
400 |
$url = parse_url( htmlspecialchars_decode( $url ) ) ;
|
401 |
parse_str( $url[ 'query' ], $query ) ;
|
402 |
-
|
|
|
|
|
|
|
|
|
|
|
403 |
self::compatibility() ;
|
404 |
$url = http_build_url( $url ) ;
|
405 |
$url = htmlspecialchars( $url ) ;
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The utility class.
|
4 |
*
|
5 |
* @since 1.1.5
|
6 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
7 |
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WPINC' ) ) {
|
10 |
+
die ;
|
11 |
+
}
|
12 |
+
|
13 |
class LiteSpeed_Cache_Utility
|
14 |
{
|
15 |
|
348 |
* @param string $type The appending type to url
|
349 |
* @return string The built url.
|
350 |
*/
|
351 |
+
public static function build_url( $action, $type = false, $is_ajax = false, $page = null, $append_arr = null )
|
352 |
{
|
353 |
$prefix = '?' ;
|
354 |
|
400 |
// Remove potential param `type` from url
|
401 |
$url = parse_url( htmlspecialchars_decode( $url ) ) ;
|
402 |
parse_str( $url[ 'query' ], $query ) ;
|
403 |
+
|
404 |
+
$built_arr = array_merge( $query, LiteSpeed_Cache_Router::build_type( $type ) ) ;
|
405 |
+
if ( $append_arr ) {
|
406 |
+
$built_arr = array_merge( $built_arr, $append_arr ) ;
|
407 |
+
}
|
408 |
+
$url[ 'query' ] = http_build_query( $built_arr ) ;
|
409 |
self::compatibility() ;
|
410 |
$url = http_build_url( $url ) ;
|
411 |
$url = htmlspecialchars( $url ) ;
|
inc/vary.class.php
CHANGED
@@ -4,10 +4,12 @@
|
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
7 |
-
* @package LiteSpeed_Cache
|
8 |
-
* @subpackage LiteSpeed_Cache/inc
|
9 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Vary
|
12 |
{
|
13 |
private static $_instance ;
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
7 |
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WPINC' ) ) {
|
10 |
+
die ;
|
11 |
+
}
|
12 |
+
|
13 |
class LiteSpeed_Cache_Vary
|
14 |
{
|
15 |
private static $_instance ;
|
includes/litespeed-cache-activation.class.php
CHANGED
@@ -8,6 +8,11 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Activation
|
12 |
{
|
13 |
const NETWORK_TRANSIENT_COUNT = 'lscwp_network_count' ;
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Activation
|
17 |
{
|
18 |
const NETWORK_TRANSIENT_COUNT = 'lscwp_network_count' ;
|
includes/litespeed-cache-api.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The plugin API class.
|
5 |
*
|
@@ -9,7 +8,12 @@
|
|
9 |
* @subpackage LiteSpeed_Cache/inc
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
{
|
14 |
const VERSION = LiteSpeed_Cache::PLUGIN_VERSION ;
|
15 |
|
@@ -33,10 +37,6 @@ class LiteSpeed_Cache_API
|
|
33 |
const WIDGET_OPID_ESIENABLE = LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ;
|
34 |
const WIDGET_OPID_TTL = LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ;
|
35 |
|
36 |
-
const VAL_OFF = LiteSpeed_Cache_Config::VAL_OFF ;
|
37 |
-
const VAL_ON = LiteSpeed_Cache_Config::VAL_ON ;
|
38 |
-
const VAL_ON2 = LiteSpeed_Cache_Config::VAL_ON2 ;
|
39 |
-
|
40 |
/**
|
41 |
* Start a to-be-removed html wrapper
|
42 |
*
|
@@ -155,7 +155,7 @@ class LiteSpeed_Cache_API
|
|
155 |
*/
|
156 |
public static function set_use_frontpage_ttl()
|
157 |
{
|
158 |
-
LiteSpeed_Cache_Control::set_custom_ttl(self::config(
|
159 |
}
|
160 |
|
161 |
/**
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The plugin API class.
|
4 |
*
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
+
class LiteSpeed_Cache_API extends LiteSpeed_Cache_Const
|
17 |
{
|
18 |
const VERSION = LiteSpeed_Cache::PLUGIN_VERSION ;
|
19 |
|
37 |
const WIDGET_OPID_ESIENABLE = LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ;
|
38 |
const WIDGET_OPID_TTL = LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ;
|
39 |
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* Start a to-be-removed html wrapper
|
42 |
*
|
155 |
*/
|
156 |
public static function set_use_frontpage_ttl()
|
157 |
{
|
158 |
+
LiteSpeed_Cache_Control::set_custom_ttl( self::config( self::OPID_FRONT_PAGE_TTL ) ) ;
|
159 |
}
|
160 |
|
161 |
/**
|
includes/litespeed-cache-cdn.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The CDN class.
|
5 |
*
|
@@ -10,6 +9,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_CDN
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -441,6 +444,11 @@ class LiteSpeed_Cache_CDN
|
|
441 |
LiteSpeed_Cache_Log::debug2( '[CDN] rewrite ' . $url ) ;
|
442 |
$url_parsed = parse_url( $url ) ;
|
443 |
|
|
|
|
|
|
|
|
|
|
|
444 |
// Only images under wp-cotnent/wp-includes can be replaced
|
445 |
$is_internal_folder = LiteSpeed_Cache_Utility::str_hit_array( $url_parsed[ 'path' ], $this->_cfg_ori_dir ) ;
|
446 |
if ( ! $is_internal_folder ) {
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The CDN class.
|
4 |
*
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_CDN
|
17 |
{
|
18 |
private static $_instance ;
|
444 |
LiteSpeed_Cache_Log::debug2( '[CDN] rewrite ' . $url ) ;
|
445 |
$url_parsed = parse_url( $url ) ;
|
446 |
|
447 |
+
if ( empty( $url_parsed[ 'path' ] ) ) {
|
448 |
+
LiteSpeed_Cache_Log::debug2( '[CDN] -rewrite bypassed: no path' ) ;
|
449 |
+
return false ;
|
450 |
+
}
|
451 |
+
|
452 |
// Only images under wp-cotnent/wp-includes can be replaced
|
453 |
$is_internal_folder = LiteSpeed_Cache_Utility::str_hit_array( $url_parsed[ 'path' ], $this->_cfg_ori_dir ) ;
|
454 |
if ( ! $is_internal_folder ) {
|
includes/litespeed-cache-config.class.php
CHANGED
@@ -10,6 +10,11 @@
|
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
|
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -244,7 +249,7 @@ class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
|
244 |
$instance = self::get_instance() ;
|
245 |
$list = $instance->get_item( $id ) ;
|
246 |
|
247 |
-
$list[] = $_SERVER[ 'HTTP_REFERER' ] ;
|
248 |
$list = LiteSpeed_Cache_Utility::sanitize_lines( $list, 'relative' ) ;
|
249 |
|
250 |
update_option( $id, $list ) ;
|
@@ -440,18 +445,21 @@ class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
|
440 |
$dkeys = array_keys($default_options) ;
|
441 |
$keys = array_keys($options) ;
|
442 |
$newkeys = array_diff($dkeys, $keys) ;
|
443 |
-
$log = '' ;//todo: useless
|
444 |
if ( ! empty($newkeys) ) {
|
445 |
foreach ( $newkeys as $newkey ) {
|
446 |
$options[$newkey] = $default_options[$newkey] ;
|
447 |
-
|
|
|
|
|
448 |
}
|
449 |
}
|
450 |
$retiredkeys = array_diff($keys, $dkeys) ;
|
451 |
if ( ! empty($retiredkeys) ) {
|
452 |
foreach ( $retiredkeys as $retired ) {
|
453 |
unset($options[$retired]) ;
|
454 |
-
|
|
|
|
|
455 |
}
|
456 |
}
|
457 |
$options[self::OPID_VERSION] = LiteSpeed_Cache::PLUGIN_VERSION ;
|
@@ -510,10 +518,11 @@ class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
|
510 |
|
511 |
$this->options = self::option_diff( $default_options, $this->options ) ;
|
512 |
|
513 |
-
$
|
514 |
define( 'LSWCP_EMPTYCACHE', true ) ;// clear all sites caches
|
515 |
LiteSpeed_Cache_Purge::purge_all() ;
|
516 |
-
|
|
|
517 |
|
518 |
// Update img_optm table data for upgrading
|
519 |
LiteSpeed_Cache_Data::get_instance() ;
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
13 |
+
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die ;
|
16 |
+
}
|
17 |
+
|
18 |
class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
|
19 |
{
|
20 |
private static $_instance ;
|
249 |
$instance = self::get_instance() ;
|
250 |
$list = $instance->get_item( $id ) ;
|
251 |
|
252 |
+
$list[] = $_SERVER[ 'HTTP_REFERER' ] . '$' ;
|
253 |
$list = LiteSpeed_Cache_Utility::sanitize_lines( $list, 'relative' ) ;
|
254 |
|
255 |
update_option( $id, $list ) ;
|
445 |
$dkeys = array_keys($default_options) ;
|
446 |
$keys = array_keys($options) ;
|
447 |
$newkeys = array_diff($dkeys, $keys) ;
|
|
|
448 |
if ( ! empty($newkeys) ) {
|
449 |
foreach ( $newkeys as $newkey ) {
|
450 |
$options[$newkey] = $default_options[$newkey] ;
|
451 |
+
|
452 |
+
$log = '[Added] ' . $newkey . ' = ' . $default_options[$newkey] ;
|
453 |
+
LiteSpeed_Cache_Log::debug( "[Cfg] option_diff $log" ) ;
|
454 |
}
|
455 |
}
|
456 |
$retiredkeys = array_diff($keys, $dkeys) ;
|
457 |
if ( ! empty($retiredkeys) ) {
|
458 |
foreach ( $retiredkeys as $retired ) {
|
459 |
unset($options[$retired]) ;
|
460 |
+
|
461 |
+
$log = '[Removed] ' . $retired ;
|
462 |
+
LiteSpeed_Cache_Log::debug( "[Cfg] option_diff $log" ) ;
|
463 |
}
|
464 |
}
|
465 |
$options[self::OPID_VERSION] = LiteSpeed_Cache::PLUGIN_VERSION ;
|
518 |
|
519 |
$this->options = self::option_diff( $default_options, $this->options ) ;
|
520 |
|
521 |
+
$this->update_options() ;
|
522 |
define( 'LSWCP_EMPTYCACHE', true ) ;// clear all sites caches
|
523 |
LiteSpeed_Cache_Purge::purge_all() ;
|
524 |
+
|
525 |
+
LiteSpeed_Cache_Log::debug( "[Cfg] plugin_upgrade option changed" ) ;
|
526 |
|
527 |
// Update img_optm table data for upgrading
|
528 |
LiteSpeed_Cache_Data::get_instance() ;
|
includes/litespeed-cache-control.class.php
CHANGED
@@ -8,6 +8,11 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Control
|
12 |
{
|
13 |
private static $_instance ;
|
@@ -476,7 +481,8 @@ class LiteSpeed_Cache_Control
|
|
476 |
public static function output()
|
477 |
{
|
478 |
$esi_hdr = '' ;
|
479 |
-
|
|
|
480 |
$esi_hdr = ',esi=on' ;
|
481 |
}
|
482 |
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Control
|
17 |
{
|
18 |
private static $_instance ;
|
481 |
public static function output()
|
482 |
{
|
483 |
$esi_hdr = '' ;
|
484 |
+
// Fix cli `uninstall --deactivate` fatal err
|
485 |
+
if ( LSWCP_ESI_SUPPORT && class_exists( 'LiteSpeed_Cache_ESI' ) && LiteSpeed_Cache_ESI::has_esi() ) {
|
486 |
$esi_hdr = ',esi=on' ;
|
487 |
}
|
488 |
|
includes/litespeed-cache-crawler.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The crawler class
|
5 |
*
|
@@ -10,6 +9,11 @@
|
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
|
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Crawler
|
14 |
{
|
15 |
private static $_instance;
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The crawler class
|
4 |
*
|
9 |
* @subpackage LiteSpeed_Cache/inc
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
+
|
13 |
+
if ( ! defined( 'WPINC' ) ) {
|
14 |
+
die ;
|
15 |
+
}
|
16 |
+
|
17 |
class LiteSpeed_Cache_Crawler
|
18 |
{
|
19 |
private static $_instance;
|
includes/litespeed-cache-esi.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The esi class.
|
5 |
*
|
@@ -11,6 +10,11 @@
|
|
11 |
* @subpackage LiteSpeed_Cache/inc
|
12 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
13 |
*/
|
|
|
|
|
|
|
|
|
|
|
14 |
class LiteSpeed_Cache_ESI
|
15 |
{
|
16 |
private static $_instance ;
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The esi class.
|
4 |
*
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
13 |
+
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die ;
|
16 |
+
}
|
17 |
+
|
18 |
class LiteSpeed_Cache_ESI
|
19 |
{
|
20 |
private static $_instance ;
|
includes/litespeed-cache-gui.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The frontend GUI class.
|
5 |
*
|
@@ -10,6 +9,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_GUI
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -83,7 +86,7 @@ class LiteSpeed_Cache_GUI
|
|
83 |
{
|
84 |
$percentage = '<text x="16.91549431" y="15.5">' . $percent . '%</text>' ;
|
85 |
if ( $percent == 100 && $finished_tick ) {
|
86 |
-
$percentage = '<text x="16.91549431" y="15.5"
|
87 |
}
|
88 |
return "
|
89 |
<svg class='litespeed-pie' viewbox='0 0 33.83098862 33.83098862' width='$width' height='$width' xmlns='http://www.w3.org/2000/svg'>
|
@@ -339,15 +342,15 @@ class LiteSpeed_Cache_GUI
|
|
339 |
if ( defined( 'LITESPEED_ON' ) ) {
|
340 |
$wp_admin_bar->add_menu( array(
|
341 |
'id' => 'litespeed-menu',
|
342 |
-
'title' => '<span class="ab-icon" title="' . __( 'LiteSpeed Cache Purge All', 'litespeed-cache' ) . '"
|
343 |
-
'href' => LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_PURGE, LiteSpeed_Cache_Purge::
|
344 |
'meta' => array( 'tabindex' => 0, 'class' => 'litespeed-top-toolbar' ),
|
345 |
) ) ;
|
346 |
}
|
347 |
else {
|
348 |
$wp_admin_bar->add_menu( array(
|
349 |
'id' => 'litespeed-menu',
|
350 |
-
'title' => '<span class="ab-icon" title="' . __( 'LiteSpeed Cache', 'litespeed-cache' ) . '"
|
351 |
'meta' => array( 'tabindex' => 0, 'class' => 'litespeed-top-toolbar' ),
|
352 |
) ) ;
|
353 |
}
|
@@ -443,6 +446,73 @@ class LiteSpeed_Cache_GUI
|
|
443 |
}
|
444 |
}
|
445 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
/**
|
447 |
* Finalize buffer by GUI class
|
448 |
*
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The frontend GUI class.
|
4 |
*
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_GUI
|
17 |
{
|
18 |
private static $_instance ;
|
86 |
{
|
87 |
$percentage = '<text x="16.91549431" y="15.5">' . $percent . '%</text>' ;
|
88 |
if ( $percent == 100 && $finished_tick ) {
|
89 |
+
$percentage = '<text x="16.91549431" y="15.5" class="litespeed-pie-done">✓</text>' ;
|
90 |
}
|
91 |
return "
|
92 |
<svg class='litespeed-pie' viewbox='0 0 33.83098862 33.83098862' width='$width' height='$width' xmlns='http://www.w3.org/2000/svg'>
|
342 |
if ( defined( 'LITESPEED_ON' ) ) {
|
343 |
$wp_admin_bar->add_menu( array(
|
344 |
'id' => 'litespeed-menu',
|
345 |
+
'title' => '<span class="ab-icon" title="' . __( 'LiteSpeed Cache Purge All', 'litespeed-cache' ) . ' - ' . __( 'LSCache', 'litespeed-cache' ) . '"></span>',
|
346 |
+
'href' => LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_PURGE, LiteSpeed_Cache_Purge::TYPE_PURGE_ALL_LSCACHE ),
|
347 |
'meta' => array( 'tabindex' => 0, 'class' => 'litespeed-top-toolbar' ),
|
348 |
) ) ;
|
349 |
}
|
350 |
else {
|
351 |
$wp_admin_bar->add_menu( array(
|
352 |
'id' => 'litespeed-menu',
|
353 |
+
'title' => '<span class="ab-icon" title="' . __( 'LiteSpeed Cache', 'litespeed-cache' ) . '"></span>',
|
354 |
'meta' => array( 'tabindex' => 0, 'class' => 'litespeed-top-toolbar' ),
|
355 |
) ) ;
|
356 |
}
|
446 |
}
|
447 |
}
|
448 |
|
449 |
+
/**
|
450 |
+
* Clear unfinished data
|
451 |
+
*
|
452 |
+
* @since 2.4.2
|
453 |
+
* @access public
|
454 |
+
*/
|
455 |
+
public static function img_optm_clean_up_unfinished()
|
456 |
+
{
|
457 |
+
return sprintf(
|
458 |
+
'<a href="%1$s" class="litespeed-btn-warning" title="%2$s"><span class="dashicons dashicons-editor-removeformatting"></span> %3$s</a>',
|
459 |
+
LiteSpeed_Cache_Utility::build_url( LiteSpeed_Cache::ACTION_IMG_OPTM, LiteSpeed_Cache_Img_Optm::TYPE_IMG_OPTM_DESTROY_UNFINISHED ),
|
460 |
+
__( 'Remove all previous unfinished image optimization requests.', 'litespeed-cache' ),
|
461 |
+
__( 'Clean Up Unfinished Data', 'litespeed-cache' )
|
462 |
+
) ;
|
463 |
+
}
|
464 |
+
|
465 |
+
/**
|
466 |
+
* Generate install link
|
467 |
+
*
|
468 |
+
* @since 2.4.2
|
469 |
+
* @access public
|
470 |
+
*/
|
471 |
+
public static function plugin_install_link( $title, $name, $v )
|
472 |
+
{
|
473 |
+
$url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $name ), 'install-plugin_' . $name ) ;
|
474 |
+
|
475 |
+
$action = sprintf(
|
476 |
+
'<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%3$s" aria-label="%4$s">%5$s</a>',
|
477 |
+
esc_url( $url ),
|
478 |
+
esc_attr( $name ),
|
479 |
+
esc_attr( $title ),
|
480 |
+
esc_attr( sprintf( __( 'Install %s' ), $title ) ),
|
481 |
+
__( 'Install Now' )
|
482 |
+
);
|
483 |
+
|
484 |
+
return $action ;
|
485 |
+
|
486 |
+
// $msg .= " <a href='$upgrade_link' class='litespeed-btn-success' target='_blank'>" . __( 'Click here to upgrade', 'litespeed-cache' ) . '</a>' ;
|
487 |
+
|
488 |
+
}
|
489 |
+
|
490 |
+
/**
|
491 |
+
* Generate upgrade link
|
492 |
+
*
|
493 |
+
* @since 2.4.2
|
494 |
+
* @access public
|
495 |
+
*/
|
496 |
+
public static function plugin_upgrade_link( $title, $name, $v )
|
497 |
+
{
|
498 |
+
$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $name . '§ion=changelog&TB_iframe=true&width=600&height=800' );
|
499 |
+
$file = $name . '/' . $name . '.php' ;
|
500 |
+
|
501 |
+
$msg = sprintf( __( '<a href="%1$s" %2$s>View version %3$s details</a> or <a href="%4$s" %5$s target="_blank">update now</a>.' ),
|
502 |
+
esc_url( $details_url ),
|
503 |
+
sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
|
504 |
+
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $title, $v ) )
|
505 |
+
),
|
506 |
+
$v,
|
507 |
+
wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
|
508 |
+
sprintf( 'class="update-link" aria-label="%s"',
|
509 |
+
esc_attr( sprintf( __( 'Update %s now' ), $title ) )
|
510 |
+
)
|
511 |
+
);
|
512 |
+
|
513 |
+
return $msg ;
|
514 |
+
}
|
515 |
+
|
516 |
/**
|
517 |
* Finalize buffer by GUI class
|
518 |
*
|
includes/litespeed-cache-log.class.php
CHANGED
@@ -10,6 +10,11 @@
|
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
|
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Log
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -284,6 +289,7 @@ class LiteSpeed_Cache_Log
|
|
284 |
|
285 |
$servervars = array(
|
286 |
'Query String' => '',
|
|
|
287 |
'HTTP_USER_AGENT' => '',
|
288 |
'HTTP_ACCEPT_ENCODING' => '',
|
289 |
'HTTP_COOKIE' => '',
|
@@ -315,8 +321,13 @@ class LiteSpeed_Cache_Log
|
|
315 |
$params[] = 'Query String: ' . $qs ;
|
316 |
}
|
317 |
|
|
|
|
|
|
|
|
|
318 |
if ( defined( 'LSCWP_LOG_MORE' ) ) {
|
319 |
$params[] = 'User Agent: ' . $server[ 'HTTP_USER_AGENT' ] ;
|
|
|
320 |
$params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING'] ;
|
321 |
}
|
322 |
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_DEBUG_COOKIE ) ) {
|
10 |
* @subpackage LiteSpeed_Cache/inc
|
11 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
12 |
*/
|
13 |
+
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die ;
|
16 |
+
}
|
17 |
+
|
18 |
class LiteSpeed_Cache_Log
|
19 |
{
|
20 |
private static $_instance ;
|
289 |
|
290 |
$servervars = array(
|
291 |
'Query String' => '',
|
292 |
+
'HTTP_ACCEPT' => '',
|
293 |
'HTTP_USER_AGENT' => '',
|
294 |
'HTTP_ACCEPT_ENCODING' => '',
|
295 |
'HTTP_COOKIE' => '',
|
321 |
$params[] = 'Query String: ' . $qs ;
|
322 |
}
|
323 |
|
324 |
+
if ( ! empty( $_SERVER[ 'HTTP_REFERER' ] ) ) {
|
325 |
+
$params[] = 'HTTP_REFERER: ' . $server[ 'HTTP_REFERER' ] ;
|
326 |
+
}
|
327 |
+
|
328 |
if ( defined( 'LSCWP_LOG_MORE' ) ) {
|
329 |
$params[] = 'User Agent: ' . $server[ 'HTTP_USER_AGENT' ] ;
|
330 |
+
$params[] = 'Accept: ' . $server['HTTP_ACCEPT'] ;
|
331 |
$params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING'] ;
|
332 |
}
|
333 |
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_DEBUG_COOKIE ) ) {
|
includes/litespeed-cache-optimize.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The optimize class.
|
5 |
*
|
@@ -10,6 +9,10 @@
|
|
10 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
13 |
class LiteSpeed_Cache_Optimize
|
14 |
{
|
15 |
private static $_instance ;
|
@@ -856,7 +859,12 @@ class LiteSpeed_Cache_Optimize
|
|
856 |
|
857 |
$src = array_values( $src ) ;
|
858 |
|
859 |
-
|
|
|
|
|
|
|
|
|
|
|
860 |
|
861 |
$short = substr( $hash, -5 ) ;
|
862 |
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The optimize class.
|
4 |
*
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
|
12 |
+
if ( ! defined( 'WPINC' ) ) {
|
13 |
+
die ;
|
14 |
+
}
|
15 |
+
|
16 |
class LiteSpeed_Cache_Optimize
|
17 |
{
|
18 |
private static $_instance ;
|
859 |
|
860 |
$src = array_values( $src ) ;
|
861 |
|
862 |
+
// Drop query strings
|
863 |
+
$src = array_map( array( $this, 'remove_query_strings' ), $src ) ;
|
864 |
+
|
865 |
+
$purge_timestamp = get_option( LiteSpeed_Cache_Config::ITEM_TIMESTAMP_PURGE_CSS ) ?: '' ;
|
866 |
+
|
867 |
+
$hash = md5( serialize( $src ) . $purge_timestamp ) ;
|
868 |
|
869 |
$short = substr( $hash, -5 ) ;
|
870 |
|
includes/litespeed-cache-purge.class.php
CHANGED
@@ -5,10 +5,12 @@
|
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
7 |
* @since 2.2 Refactored. Changed access from public to private for most func and class variables.
|
8 |
-
* @package LiteSpeed_Cache
|
9 |
-
* @subpackage LiteSpeed_Cache/inc
|
10 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
|
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Purge
|
13 |
{
|
14 |
private static $_instance ;
|
@@ -204,6 +206,8 @@ class LiteSpeed_Cache_Purge
|
|
204 |
*/
|
205 |
private function _purge_all_cssjs( $silence = false )
|
206 |
{
|
|
|
|
|
207 |
$this->_add( LiteSpeed_Cache_Tag::TYPE_MIN ) ;
|
208 |
|
209 |
// For non-ls users
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
7 |
* @since 2.2 Refactored. Changed access from public to private for most func and class variables.
|
|
|
|
|
|
|
8 |
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'WPINC' ) ) {
|
11 |
+
die ;
|
12 |
+
}
|
13 |
+
|
14 |
class LiteSpeed_Cache_Purge
|
15 |
{
|
16 |
private static $_instance ;
|
206 |
*/
|
207 |
private function _purge_all_cssjs( $silence = false )
|
208 |
{
|
209 |
+
update_option( LiteSpeed_Cache_Config::ITEM_TIMESTAMP_PURGE_CSS, time() ) ;
|
210 |
+
|
211 |
$this->_add( LiteSpeed_Cache_Tag::TYPE_MIN ) ;
|
212 |
|
213 |
// For non-ls users
|
includes/litespeed-cache-router.class.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The core plugin router class.
|
5 |
*
|
@@ -7,10 +6,12 @@
|
|
7 |
*
|
8 |
* @since 1.1.0
|
9 |
* @since 1.5 Moved into /inc
|
10 |
-
* @package LiteSpeed_Cache
|
11 |
-
* @subpackage LiteSpeed_Cache/inc
|
12 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
13 |
*/
|
|
|
|
|
|
|
|
|
|
|
14 |
class LiteSpeed_Cache_Router
|
15 |
{
|
16 |
private static $_instance ;
|
@@ -65,6 +66,17 @@ class LiteSpeed_Cache_Router
|
|
65 |
return $can_final ;
|
66 |
}
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
/**
|
69 |
* Check if it can use CDN replacement
|
70 |
*
|
@@ -76,8 +88,16 @@ class LiteSpeed_Cache_Router
|
|
76 |
{
|
77 |
$can = true ;
|
78 |
|
79 |
-
if ( is_admin()
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
if ( is_feed() ) {
|
@@ -481,7 +501,7 @@ class LiteSpeed_Cache_Router
|
|
481 |
case LiteSpeed_Cache::ACTION_IMG_OPTM:
|
482 |
case LiteSpeed_Cache::ACTION_IAPI:
|
483 |
case LiteSpeed_Cache::ACTION_CDN_CLOUDFLARE:
|
484 |
-
case LiteSpeed_Cache::
|
485 |
case LiteSpeed_Cache::ACTION_IMPORT:
|
486 |
case LiteSpeed_Cache::ACTION_REPORT:
|
487 |
case LiteSpeed_Cache::ACTION_CSS:
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The core plugin router class.
|
4 |
*
|
6 |
*
|
7 |
* @since 1.1.0
|
8 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
9 |
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'WPINC' ) ) {
|
12 |
+
die ;
|
13 |
+
}
|
14 |
+
|
15 |
class LiteSpeed_Cache_Router
|
16 |
{
|
17 |
private static $_instance ;
|
66 |
return $can_final ;
|
67 |
}
|
68 |
|
69 |
+
/**
|
70 |
+
* Check referer page to see if its from admin
|
71 |
+
*
|
72 |
+
* @since 2.4.2.1
|
73 |
+
* @access public
|
74 |
+
*/
|
75 |
+
public static function from_admin()
|
76 |
+
{
|
77 |
+
return ! empty( $_SERVER[ 'HTTP_REFERER' ] ) && strpos( $_SERVER[ 'HTTP_REFERER' ], get_admin_url() ) === 0 ;
|
78 |
+
}
|
79 |
+
|
80 |
/**
|
81 |
* Check if it can use CDN replacement
|
82 |
*
|
88 |
{
|
89 |
$can = true ;
|
90 |
|
91 |
+
if ( is_admin() ) {
|
92 |
+
if ( ! self::is_ajax() ) {
|
93 |
+
LiteSpeed_Cache_Log::debug2( '[Router] CDN bypassed: is not ajax call' ) ;
|
94 |
+
$can = false ;
|
95 |
+
}
|
96 |
+
|
97 |
+
if ( self::from_admin() ) {
|
98 |
+
LiteSpeed_Cache_Log::debug2( '[Router] CDN bypassed: ajax call from admin' ) ;
|
99 |
+
$can = false ;
|
100 |
+
}
|
101 |
}
|
102 |
|
103 |
if ( is_feed() ) {
|
501 |
case LiteSpeed_Cache::ACTION_IMG_OPTM:
|
502 |
case LiteSpeed_Cache::ACTION_IAPI:
|
503 |
case LiteSpeed_Cache::ACTION_CDN_CLOUDFLARE:
|
504 |
+
case LiteSpeed_Cache::ACTION_CDN_QUIC:
|
505 |
case LiteSpeed_Cache::ACTION_IMPORT:
|
506 |
case LiteSpeed_Cache::ACTION_REPORT:
|
507 |
case LiteSpeed_Cache::ACTION_CSS:
|
includes/litespeed-cache-tag.class.php
CHANGED
@@ -4,10 +4,12 @@
|
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
7 |
-
* @package LiteSpeed_Cache
|
8 |
-
* @subpackage LiteSpeed_Cache/inc
|
9 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Tag
|
12 |
{
|
13 |
private static $_instance ;
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
7 |
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WPINC' ) ) {
|
10 |
+
die ;
|
11 |
+
}
|
12 |
+
|
13 |
class LiteSpeed_Cache_Tag
|
14 |
{
|
15 |
private static $_instance ;
|
includes/litespeed-cache-task.class.php
CHANGED
@@ -1,20 +1,22 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The cron task class.
|
5 |
*
|
6 |
* @since 1.1.3
|
7 |
* @since 1.5 Moved into /inc
|
8 |
-
* @package LiteSpeed_Cache
|
9 |
-
* @subpackage LiteSpeed_Cache/inc
|
10 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
|
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Task
|
13 |
{
|
14 |
private static $_instance ;
|
15 |
|
16 |
const CRON_ACTION_HOOK_CRAWLER = 'litespeed_crawl_trigger' ;
|
17 |
const CRON_ACTION_HOOK_IMGOPTM = 'litespeed_imgoptm_trigger' ;
|
|
|
18 |
const CRON_ACTION_HOOK_CCSS = 'litespeed_ccss_trigger' ;
|
19 |
const CRON_FITLER_CRAWLER = 'litespeed_crawl_filter' ;
|
20 |
const CRON_FITLER = 'litespeed_filter' ;
|
@@ -39,13 +41,17 @@ class LiteSpeed_Cache_Task
|
|
39 |
}
|
40 |
|
41 |
// Register img optimization fetch ( always fetch immediately )
|
42 |
-
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_CRON )
|
43 |
self::schedule_filter_imgoptm() ;
|
44 |
|
45 |
-
add_action( self::CRON_ACTION_HOOK_IMGOPTM, 'LiteSpeed_Cache_Img_Optm::
|
46 |
}
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
// Register ccss generation
|
@@ -104,6 +110,23 @@ class LiteSpeed_Cache_Task
|
|
104 |
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
/**
|
108 |
* Schedule cron img optimization
|
109 |
*
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The cron task class.
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
7 |
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WPINC' ) ) {
|
10 |
+
die ;
|
11 |
+
}
|
12 |
+
|
13 |
class LiteSpeed_Cache_Task
|
14 |
{
|
15 |
private static $_instance ;
|
16 |
|
17 |
const CRON_ACTION_HOOK_CRAWLER = 'litespeed_crawl_trigger' ;
|
18 |
const CRON_ACTION_HOOK_IMGOPTM = 'litespeed_imgoptm_trigger' ;
|
19 |
+
const CRON_ACTION_HOOK_IMGOPTM_AUTO_REQUEST = 'litespeed_imgoptm_auto_request_trigger' ;
|
20 |
const CRON_ACTION_HOOK_CCSS = 'litespeed_ccss_trigger' ;
|
21 |
const CRON_FITLER_CRAWLER = 'litespeed_crawl_filter' ;
|
22 |
const CRON_FITLER = 'litespeed_filter' ;
|
41 |
}
|
42 |
|
43 |
// Register img optimization fetch ( always fetch immediately )
|
44 |
+
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_CRON ) ) {
|
45 |
self::schedule_filter_imgoptm() ;
|
46 |
|
47 |
+
add_action( self::CRON_ACTION_HOOK_IMGOPTM, 'LiteSpeed_Cache_Img_Optm::cron_pull_optimized_img' ) ;
|
48 |
}
|
49 |
+
|
50 |
+
// Image optm auto request
|
51 |
+
if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_AUTO ) ) {
|
52 |
+
self::schedule_filter_imgoptm_auto_request() ;
|
53 |
+
|
54 |
+
add_action( self::CRON_ACTION_HOOK_IMGOPTM_AUTO_REQUEST, 'LiteSpeed_Cache_Img_Optm::cron_auto_request' ) ;
|
55 |
}
|
56 |
|
57 |
// Register ccss generation
|
110 |
|
111 |
}
|
112 |
|
113 |
+
/**
|
114 |
+
* Schedule cron img optm auto request
|
115 |
+
*
|
116 |
+
* @since 2.4.1
|
117 |
+
* @access public
|
118 |
+
*/
|
119 |
+
public static function schedule_filter_imgoptm_auto_request()
|
120 |
+
{
|
121 |
+
add_filter( 'cron_schedules', 'LiteSpeed_Cache_Task::lscache_cron_filter' ) ;
|
122 |
+
|
123 |
+
// Schedule event here to see if it can lost again or not
|
124 |
+
if( ! wp_next_scheduled( self::CRON_ACTION_HOOK_IMGOPTM_AUTO_REQUEST ) ) {
|
125 |
+
LiteSpeed_Cache_Log::debug( 'Cron log: ......img optm auto request cron hook register......' ) ;
|
126 |
+
wp_schedule_event( time(), self::CRON_FITLER, self::CRON_ACTION_HOOK_IMGOPTM_AUTO_REQUEST ) ;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
/**
|
131 |
* Schedule cron img optimization
|
132 |
*
|
includes/litespeed-cache-utility.class.php
CHANGED
@@ -1,14 +1,15 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* The utility class.
|
5 |
*
|
6 |
* @since 1.1.5
|
7 |
* @since 1.5 Moved into /inc
|
8 |
-
* @package LiteSpeed_Cache
|
9 |
-
* @subpackage LiteSpeed_Cache/inc
|
10 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
*/
|
|
|
|
|
|
|
|
|
|
|
12 |
class LiteSpeed_Cache_Utility
|
13 |
{
|
14 |
|
@@ -347,7 +348,7 @@ class LiteSpeed_Cache_Utility
|
|
347 |
* @param string $type The appending type to url
|
348 |
* @return string The built url.
|
349 |
*/
|
350 |
-
public static function build_url( $action, $type = false, $is_ajax = false, $page = null )
|
351 |
{
|
352 |
$prefix = '?' ;
|
353 |
|
@@ -399,7 +400,12 @@ class LiteSpeed_Cache_Utility
|
|
399 |
// Remove potential param `type` from url
|
400 |
$url = parse_url( htmlspecialchars_decode( $url ) ) ;
|
401 |
parse_str( $url[ 'query' ], $query ) ;
|
402 |
-
|
|
|
|
|
|
|
|
|
|
|
403 |
self::compatibility() ;
|
404 |
$url = http_build_url( $url ) ;
|
405 |
$url = htmlspecialchars( $url ) ;
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* The utility class.
|
4 |
*
|
5 |
* @since 1.1.5
|
6 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
7 |
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WPINC' ) ) {
|
10 |
+
die ;
|
11 |
+
}
|
12 |
+
|
13 |
class LiteSpeed_Cache_Utility
|
14 |
{
|
15 |
|
348 |
* @param string $type The appending type to url
|
349 |
* @return string The built url.
|
350 |
*/
|
351 |
+
public static function build_url( $action, $type = false, $is_ajax = false, $page = null, $append_arr = null )
|
352 |
{
|
353 |
$prefix = '?' ;
|
354 |
|
400 |
// Remove potential param `type` from url
|
401 |
$url = parse_url( htmlspecialchars_decode( $url ) ) ;
|
402 |
parse_str( $url[ 'query' ], $query ) ;
|
403 |
+
|
404 |
+
$built_arr = array_merge( $query, LiteSpeed_Cache_Router::build_type( $type ) ) ;
|
405 |
+
if ( $append_arr ) {
|
406 |
+
$built_arr = array_merge( $built_arr, $append_arr ) ;
|
407 |
+
}
|
408 |
+
$url[ 'query' ] = http_build_query( $built_arr ) ;
|
409 |
self::compatibility() ;
|
410 |
$url = http_build_url( $url ) ;
|
411 |
$url = htmlspecialchars( $url ) ;
|
includes/litespeed-cache-vary.class.php
CHANGED
@@ -4,10 +4,12 @@
|
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
7 |
-
* @package LiteSpeed_Cache
|
8 |
-
* @subpackage LiteSpeed_Cache/inc
|
9 |
-
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
11 |
class LiteSpeed_Cache_Vary
|
12 |
{
|
13 |
private static $_instance ;
|
4 |
*
|
5 |
* @since 1.1.3
|
6 |
* @since 1.5 Moved into /inc
|
|
|
|
|
|
|
7 |
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WPINC' ) ) {
|
10 |
+
die ;
|
11 |
+
}
|
12 |
+
|
13 |
class LiteSpeed_Cache_Vary
|
14 |
{
|
15 |
private static $_instance ;
|
includes/litespeed-cache.class.php
CHANGED
@@ -14,12 +14,18 @@
|
|
14 |
* @subpackage LiteSpeed_Cache/inc
|
15 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
16 |
*/
|
|
|
|
|
|
|
|
|
|
|
17 |
class LiteSpeed_Cache
|
18 |
{
|
19 |
private static $_instance ;
|
20 |
|
|
|
21 |
const PLUGIN_NAME = 'litespeed-cache' ;
|
22 |
-
const PLUGIN_VERSION = '2.4' ;
|
23 |
|
24 |
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
|
25 |
|
@@ -43,7 +49,7 @@ class LiteSpeed_Cache
|
|
43 |
const ACTION_DO_CRAWL = 'do-crawl' ;
|
44 |
const ACTION_BLACKLIST_SAVE = 'blacklist-save' ;
|
45 |
const ACTION_CDN_CLOUDFLARE = 'cdn_cloudflare' ;
|
46 |
-
const
|
47 |
|
48 |
const ACTION_FRONT_EXCLUDE = 'front-exclude' ;
|
49 |
|
@@ -336,8 +342,8 @@ class LiteSpeed_Cache
|
|
336 |
$msg = LiteSpeed_Cache_CDN_Cloudflare::handler() ;
|
337 |
break ;
|
338 |
|
339 |
-
case LiteSpeed_Cache::
|
340 |
-
$msg =
|
341 |
break ;
|
342 |
|
343 |
default:
|
14 |
* @subpackage LiteSpeed_Cache/inc
|
15 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
16 |
*/
|
17 |
+
|
18 |
+
if ( ! defined( 'WPINC' ) ) {
|
19 |
+
die ;
|
20 |
+
}
|
21 |
+
|
22 |
class LiteSpeed_Cache
|
23 |
{
|
24 |
private static $_instance ;
|
25 |
|
26 |
+
const NAME = 'LiteSpeed Cache' ;
|
27 |
const PLUGIN_NAME = 'litespeed-cache' ;
|
28 |
+
const PLUGIN_VERSION = '2.4.4' ;
|
29 |
|
30 |
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
|
31 |
|
49 |
const ACTION_DO_CRAWL = 'do-crawl' ;
|
50 |
const ACTION_BLACKLIST_SAVE = 'blacklist-save' ;
|
51 |
const ACTION_CDN_CLOUDFLARE = 'cdn_cloudflare' ;
|
52 |
+
const ACTION_CDN_QUIC = 'cdn_quic' ;
|
53 |
|
54 |
const ACTION_FRONT_EXCLUDE = 'front-exclude' ;
|
55 |
|
342 |
$msg = LiteSpeed_Cache_CDN_Cloudflare::handler() ;
|
343 |
break ;
|
344 |
|
345 |
+
case LiteSpeed_Cache::ACTION_CDN_QUIC:
|
346 |
+
$msg = LiteSpeed_Cache_CDN_Quic::handler() ;
|
347 |
break ;
|
348 |
|
349 |
default:
|
includes/litespeed.autoload.php
CHANGED
@@ -27,7 +27,7 @@ if ( !function_exists('_litespeed_autoload') ) {
|
|
27 |
'LiteSpeed_Cache_API' => 'inc/api.class.php',
|
28 |
'LiteSpeed_Cache_CDN' => 'inc/cdn.class.php',
|
29 |
'LiteSpeed_Cache_CDN_Cloudflare' => 'inc/cdn/cloudflare.class.php',
|
30 |
-
'
|
31 |
'LiteSpeed_Cache_Config' => 'inc/config.class.php',
|
32 |
'LiteSpeed_Cache_Control' => 'inc/control.class.php',
|
33 |
'LiteSpeed_Cache_Const' => 'inc/const.cls.php',
|
@@ -62,6 +62,7 @@ if ( !function_exists('_litespeed_autoload') ) {
|
|
62 |
'LiteSpeed_Cache_Admin_Settings' => 'admin/litespeed-cache-admin-settings.class.php',
|
63 |
|
64 |
'LiteSpeed_Cache_Cli_Admin' => 'cli/litespeed-cache-cli-admin.class.php',
|
|
|
65 |
'LiteSpeed_Cache_Cli_Purge' => 'cli/litespeed-cache-cli-purge.class.php',
|
66 |
|
67 |
'LiteSpeed_Cache_Tags' => 'includes/deprecated-litespeed-cache-tags.class.php',
|
27 |
'LiteSpeed_Cache_API' => 'inc/api.class.php',
|
28 |
'LiteSpeed_Cache_CDN' => 'inc/cdn.class.php',
|
29 |
'LiteSpeed_Cache_CDN_Cloudflare' => 'inc/cdn/cloudflare.class.php',
|
30 |
+
'LiteSpeed_Cache_CDN_Quic' => 'inc/cdn/quic.class.php',
|
31 |
'LiteSpeed_Cache_Config' => 'inc/config.class.php',
|
32 |
'LiteSpeed_Cache_Control' => 'inc/control.class.php',
|
33 |
'LiteSpeed_Cache_Const' => 'inc/const.cls.php',
|
62 |
'LiteSpeed_Cache_Admin_Settings' => 'admin/litespeed-cache-admin-settings.class.php',
|
63 |
|
64 |
'LiteSpeed_Cache_Cli_Admin' => 'cli/litespeed-cache-cli-admin.class.php',
|
65 |
+
'LiteSpeed_Cache_CLI_IAPI' => 'cli/litespeed-cache-cli-iapi.class.php',
|
66 |
'LiteSpeed_Cache_Cli_Purge' => 'cli/litespeed-cache-cli-purge.class.php',
|
67 |
|
68 |
'LiteSpeed_Cache_Tags' => 'includes/deprecated-litespeed-cache-tags.class.php',
|
languages/litespeed-cache.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the LiteSpeed Cache package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: LiteSpeed Cache 2.4\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
|
7 |
-
"POT-Creation-Date: 2018-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -12,68 +12,86 @@ msgstr ""
|
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
-
#: admin/admin-api.class.php:
|
16 |
msgid "IAPI Error %s"
|
17 |
msgstr ""
|
18 |
|
19 |
-
#: admin/admin-api.class.php:
|
20 |
msgid "Reset IAPI key successfully."
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: admin/admin-api.class.php:
|
|
|
|
|
|
|
|
|
24 |
msgid "Failed to communicate with LiteSpeed image server"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: admin/admin-api.class.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
msgid "Message from LiteSpeed image server"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: admin/
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
39 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
40 |
-
#: includes/litespeed-cache-gui.class.php:
|
41 |
msgid "Settings"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
msgid "Edit .htaccess"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
49 |
-
#: includes/litespeed-cache-gui.class.php:
|
50 |
msgid "Image Optimization"
|
51 |
msgstr ""
|
52 |
|
53 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
54 |
msgid "Crawler"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
58 |
msgid "Report"
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
62 |
msgid "Import / Export"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
66 |
#: admin/tpl/setting/settings_debug.php:23
|
67 |
msgid "Debug Log"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
71 |
msgid ""
|
72 |
"It is recommended that LiteSpeed Cache be purged after updating a plugin."
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
76 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
77 |
#: admin/tpl/setting/settings_debug.php:35
|
78 |
#: admin/tpl/setting/settings_inc.cache_mobile.php:67
|
79 |
#: admin/tpl/setting/settings_optimize.php:138
|
@@ -85,8 +103,8 @@ msgstr ""
|
|
85 |
msgid "ON"
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
89 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
90 |
#: admin/tpl/setting/settings_cdn.php:35 admin/tpl/setting/settings_cdn.php:169
|
91 |
#: admin/tpl/setting/settings_debug.php:29
|
92 |
#: admin/tpl/setting/settings_inc.cache_object.php:149
|
@@ -97,11 +115,11 @@ msgstr ""
|
|
97 |
msgid "OFF"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
101 |
msgid "Recommended value: %s"
|
102 |
msgstr ""
|
103 |
|
104 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
105 |
#: admin/tpl/setting/settings_media.php:36
|
106 |
#: admin/tpl/setting/settings_optimize.php:140
|
107 |
#: admin/tpl/setting/settings_tuning.php:24
|
@@ -112,13 +130,14 @@ msgstr ""
|
|
112 |
msgid "API"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
116 |
msgid "Server variable(s) %s available to override this setting."
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
120 |
-
#: admin/
|
121 |
-
#: admin/tpl/
|
|
|
122 |
#: admin/tpl/setting/settings_advanced.php:10
|
123 |
#: admin/tpl/setting/settings_advanced.php:39
|
124 |
#: admin/tpl/setting/settings_advanced.php:51
|
@@ -133,369 +152,414 @@ msgstr ""
|
|
133 |
#: admin/tpl/setting/settings_inc.cache_object.php:33
|
134 |
#: admin/tpl/setting/settings_inc.cache_object.php:75
|
135 |
#: admin/tpl/setting/settings_inc.cache_object.php:150
|
|
|
136 |
#: admin/tpl/setting/settings_media.php:8
|
137 |
-
#: admin/tpl/setting/settings_media.php:
|
|
|
138 |
#: admin/tpl/setting/settings_optimize.php:10
|
139 |
#: admin/tpl/setting/settings_optimize.php:165
|
140 |
#: admin/tpl/setting/settings_optimize.php:237
|
141 |
#: admin/tpl/setting/settings_purge.php:8
|
142 |
-
#: admin/tpl/setting/settings_tuning.php:8
|
143 |
msgid "Learn More"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
147 |
msgid "%s groups"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
151 |
msgid "%s images"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
155 |
msgid "%s group"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: admin/litespeed-cache-admin-display.class.php:
|
159 |
msgid "%s image"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
163 |
msgid "The installed PHP version is too old for the LiteSpeed Cache Plugin."
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
167 |
msgid "The LiteSpeed Cache Plugin requires at least PHP %s."
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
171 |
msgid ""
|
172 |
"The currently installed version is PHP %s, which is out-dated and insecure."
|
173 |
msgstr ""
|
174 |
|
175 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
176 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
177 |
msgid ""
|
178 |
"Please upgrade or go to <a href=\"%s\">active plugins</a> and deactivate the "
|
179 |
"LiteSpeed Cache plugin to hide this message."
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
183 |
msgid ""
|
184 |
"The installed WordPress version is too old for the LiteSpeed Cache Plugin."
|
185 |
msgstr ""
|
186 |
|
187 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
188 |
msgid "The LiteSpeed Cache Plugin requires at least WordPress %s."
|
189 |
msgstr ""
|
190 |
|
191 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
192 |
msgid "Something went wrong with the form! Please try again."
|
193 |
msgstr ""
|
194 |
|
195 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
196 |
msgid "Tried to purge list with empty list."
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
200 |
msgid "Bad Purge By selected value."
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
204 |
msgid "Failed to purge by category, invalid category slug."
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
208 |
msgid "Failed to purge by tag, invalid tag slug."
|
209 |
msgstr ""
|
210 |
|
211 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
212 |
msgid "Failed to purge by url, contained \"<\"."
|
213 |
msgstr ""
|
214 |
|
215 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
216 |
msgid "Failed to purge by Post ID, given ID is not numeric: %s"
|
217 |
msgstr ""
|
218 |
|
219 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
220 |
msgid ""
|
221 |
"Failed to purge by Post ID, given ID does not exist or is not published: %s"
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
225 |
msgid "Failed to purge by url, invalid input: %s."
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
229 |
msgid "Failed to purge by category, does not exist: %s"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
233 |
msgid "Failed to purge by tag, does not exist: %s"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
237 |
msgid "Invalid data in Admin IPs."
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
241 |
msgid "Invalid data in Test IPs."
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
245 |
msgid "Invalid Site IP: %s"
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
249 |
msgid "Can not fetch Custom Sitemap: %s"
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
253 |
msgid "Can not parse custom sitemap xml file: %s."
|
254 |
msgstr ""
|
255 |
|
256 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
257 |
msgid ""
|
258 |
"Please make sure the file is xml format and the %s extension is installed on "
|
259 |
"the server."
|
260 |
msgstr ""
|
261 |
|
262 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
263 |
msgid "Removed category \"%s\" from list, ID does not exist."
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
267 |
msgid "Removed tag \"%s\" from list, ID does not exist."
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
271 |
msgid "Invalid login cookie. Invalid characters found: %s"
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
275 |
msgid "Invalid Rewrite List."
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
279 |
msgid "Empty or invalid rule."
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
283 |
msgid "Rule: %1$s, list: %2$s"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
287 |
msgid "Tried to parse for existing login cookie."
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
291 |
msgid "%s file not valid. Please verify contents."
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
295 |
msgid "Could not find %s."
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
299 |
msgid "This site is a subdirectory install."
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
303 |
msgid "Login cookies do not match."
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
307 |
msgid ""
|
308 |
"Please remove both and set the login cookie in LiteSpeed Cache advanced "
|
309 |
"settings."
|
310 |
msgstr ""
|
311 |
|
312 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
313 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
314 |
msgid "LiteSpeed Cache was unable to write to the wp-config.php file."
|
315 |
msgstr ""
|
316 |
|
317 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
318 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
319 |
msgid "Please add the following to the wp-config.php file: %s"
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
323 |
msgid "Failed to back up file, aborted changes."
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
327 |
msgid "Failed to put contents into %s"
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
331 |
msgid "Failed to get %s file contents."
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
335 |
msgid "%s file not readable or not writable."
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
339 |
msgid "%s file not readable."
|
340 |
msgstr ""
|
341 |
|
342 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
343 |
msgid "%s file not writable."
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
347 |
msgid "Failed to overwrite %s."
|
348 |
msgstr ""
|
349 |
|
350 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
351 |
msgid "The %1$s file not writable for %2$s"
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: admin/litespeed-cache-admin-error.class.php:
|
355 |
msgid "%s file did not find a place to insert define."
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
359 |
msgid "Clean all successfully."
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
363 |
msgid "Clean post revisions successfully."
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
367 |
msgid "Clean auto drafts successfully."
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
371 |
msgid "Clean trashed posts and pages successfully."
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
375 |
msgid "Clean spam comments successfully."
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
379 |
msgid "Clean trashed comments successfully."
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
383 |
msgid "Clean trackbacks and pingbacks successfully."
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
387 |
msgid "Clean expired transients successfully."
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
391 |
msgid "Clean all transients successfully."
|
392 |
msgstr ""
|
393 |
|
394 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
395 |
msgid "Optimized all tables."
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: admin/litespeed-cache-admin-optimize.class.php:
|
399 |
msgid "Clean all CSS/JS optimizer data successfully."
|
400 |
msgstr ""
|
401 |
|
402 |
-
#: admin/litespeed-cache-admin-report.class.php:
|
403 |
msgid "Failed to push to LiteSpeed server: %s"
|
404 |
msgstr ""
|
405 |
|
406 |
-
#: admin/litespeed-cache-admin-rules.class.php:
|
407 |
msgid ""
|
408 |
"<p>Please add/replace the following codes into the beginning of %1$s:</p> "
|
409 |
"%2$s"
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: admin/litespeed-cache-admin-rules.class.php:
|
413 |
msgid "File Saved."
|
414 |
msgstr ""
|
415 |
|
416 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
417 |
msgid "%1$s must be an integer larger than %2$d"
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
421 |
msgid "%1$s must be an integer between %2$d and %3$d"
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
425 |
msgid "'Use primary site settings' set by Network Administrator."
|
426 |
msgstr ""
|
427 |
|
428 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
429 |
msgid "Site options saved."
|
430 |
msgstr ""
|
431 |
|
432 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
433 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
434 |
msgid "Default Public Cache"
|
435 |
msgstr ""
|
436 |
|
437 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
438 |
msgid "Default Private Cache"
|
439 |
msgstr ""
|
440 |
|
441 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
442 |
msgid "Default Front Page"
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
446 |
msgid "Feed"
|
447 |
msgstr ""
|
448 |
|
449 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
450 |
#: admin/tpl/setting/settings_debug.php:88
|
451 |
msgid "Log File Size Limit"
|
452 |
msgstr ""
|
453 |
|
454 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
455 |
#: admin/tpl/setting/settings_crawler.php:13
|
456 |
msgid "Delay"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
460 |
#: admin/tpl/setting/settings_crawler.php:37
|
461 |
msgid "Run Duration"
|
462 |
msgstr ""
|
463 |
|
464 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
465 |
msgid "Cron Interval"
|
466 |
msgstr ""
|
467 |
|
468 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
469 |
msgid "Whole Interval"
|
470 |
msgstr ""
|
471 |
|
472 |
-
#: admin/litespeed-cache-admin-settings.class.php:
|
473 |
#: admin/tpl/setting/settings_crawler.php:73
|
474 |
msgid "Threads"
|
475 |
msgstr ""
|
476 |
|
477 |
-
#: admin/litespeed-cache-admin.class.php:
|
478 |
msgid ""
|
479 |
-
"
|
480 |
-
"
|
481 |
msgstr ""
|
482 |
|
483 |
-
#: admin/litespeed-cache-admin.class.php:
|
484 |
msgid ""
|
485 |
-
"
|
486 |
-
"Cache settings."
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: admin/litespeed-cache-admin.class.php:
|
490 |
msgid ""
|
491 |
-
"
|
492 |
-
"currently being used."
|
493 |
msgstr ""
|
494 |
|
495 |
-
#: admin/litespeed-cache-admin.class.php:
|
496 |
msgid ""
|
497 |
-
"LiteSpeed Cache does work with other
|
498 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
msgstr ""
|
500 |
|
501 |
#: admin/tpl/crawler.php:26
|
@@ -548,10 +612,11 @@ msgstr ""
|
|
548 |
msgid "Disable"
|
549 |
msgstr ""
|
550 |
|
551 |
-
#: admin/tpl/crawler.php:92 admin/tpl/
|
552 |
-
#: admin/tpl/inc/
|
553 |
#: admin/tpl/setting/settings_debug.php:105
|
554 |
#: admin/tpl/setting/settings_debug.php:138
|
|
|
555 |
#: admin/tpl/setting/settings_optimize.php:15 admin/tpl/settings.php:161
|
556 |
msgid "WARNING"
|
557 |
msgstr ""
|
@@ -757,474 +822,475 @@ msgstr ""
|
|
757 |
msgid "A TTL of 0 indicates do not cache."
|
758 |
msgstr ""
|
759 |
|
760 |
-
#: admin/tpl/image_optimization.php:
|
761 |
-
msgid "
|
762 |
msgstr ""
|
763 |
|
764 |
-
#: admin/tpl/
|
765 |
-
msgid "
|
766 |
msgstr ""
|
767 |
|
768 |
-
#: admin/tpl/
|
769 |
-
msgid "
|
770 |
msgstr ""
|
771 |
|
772 |
-
#: admin/tpl/
|
773 |
-
msgid "
|
774 |
msgstr ""
|
775 |
|
776 |
-
#: admin/tpl/
|
777 |
-
msgid "
|
778 |
msgstr ""
|
779 |
|
780 |
-
#: admin/tpl/
|
781 |
-
msgid "
|
|
|
782 |
msgstr ""
|
783 |
|
784 |
-
#: admin/tpl/
|
785 |
-
msgid "
|
786 |
msgstr ""
|
787 |
|
788 |
-
#: admin/tpl/
|
789 |
-
msgid "
|
790 |
msgstr ""
|
791 |
|
792 |
-
#: admin/tpl/
|
793 |
-
msgid "Last
|
794 |
msgstr ""
|
795 |
|
796 |
-
#: admin/tpl/
|
797 |
-
msgid "
|
|
|
|
|
798 |
msgstr ""
|
799 |
|
800 |
-
#: admin/tpl/
|
801 |
-
|
802 |
-
msgid "Update Status"
|
803 |
msgstr ""
|
804 |
|
805 |
-
|
806 |
-
|
807 |
-
|
|
|
|
|
808 |
msgstr ""
|
809 |
|
810 |
-
#: admin/tpl/
|
811 |
-
msgid "
|
812 |
msgstr ""
|
813 |
|
814 |
-
#: admin/tpl/
|
815 |
-
msgid "
|
816 |
msgstr ""
|
817 |
|
818 |
-
#: admin/tpl/
|
819 |
-
msgid "
|
820 |
msgstr ""
|
821 |
|
822 |
-
#: admin/tpl/
|
823 |
-
msgid "
|
824 |
msgstr ""
|
825 |
|
826 |
-
#: admin/tpl/
|
827 |
-
msgid "
|
828 |
msgstr ""
|
829 |
|
830 |
-
#: admin/tpl/
|
831 |
-
msgid "
|
832 |
msgstr ""
|
833 |
|
834 |
-
#: admin/tpl/
|
835 |
msgid ""
|
836 |
-
"
|
837 |
-
"
|
838 |
msgstr ""
|
839 |
|
840 |
-
#: admin/tpl/
|
841 |
-
msgid "
|
|
|
|
|
842 |
msgstr ""
|
843 |
|
844 |
-
#: admin/tpl/
|
845 |
-
msgid "
|
846 |
msgstr ""
|
847 |
|
848 |
-
#: admin/tpl/
|
849 |
-
msgid "
|
850 |
msgstr ""
|
851 |
|
852 |
-
#: admin/tpl/
|
853 |
-
msgid "
|
854 |
msgstr ""
|
855 |
|
856 |
-
#: admin/tpl/
|
857 |
-
msgid "
|
858 |
msgstr ""
|
859 |
|
860 |
-
#: admin/tpl/
|
861 |
-
msgid ""
|
862 |
-
"This will send the optimization request and the images to LiteSpeed's Image "
|
863 |
-
"Optimization Server."
|
864 |
msgstr ""
|
865 |
|
866 |
-
#: admin/tpl/
|
867 |
-
msgid "
|
868 |
msgstr ""
|
869 |
|
870 |
-
#: admin/tpl/
|
871 |
-
msgid "
|
872 |
msgstr ""
|
873 |
|
874 |
-
#: admin/tpl/
|
875 |
-
msgid ""
|
876 |
-
"After LiteSpeed's Image Optimization Server finishes optimization, it will "
|
877 |
-
"notify your site to pull the optimized images."
|
878 |
msgstr ""
|
879 |
|
880 |
-
#: admin/tpl/
|
881 |
-
msgid "
|
882 |
msgstr ""
|
883 |
|
884 |
-
#: admin/tpl/
|
885 |
-
msgid "
|
886 |
msgstr ""
|
887 |
|
888 |
-
#: admin/tpl/
|
889 |
-
msgid "
|
890 |
msgstr ""
|
891 |
|
892 |
-
#: admin/tpl/
|
893 |
-
msgid "
|
894 |
msgstr ""
|
895 |
|
896 |
-
#: admin/tpl/
|
897 |
-
msgid "
|
898 |
msgstr ""
|
899 |
|
900 |
-
#: admin/tpl/
|
901 |
-
msgid "
|
902 |
msgstr ""
|
903 |
|
904 |
-
#: admin/tpl/
|
905 |
-
msgid "
|
|
|
|
|
906 |
msgstr ""
|
907 |
|
908 |
-
#: admin/tpl/
|
909 |
-
msgid "
|
|
|
|
|
910 |
msgstr ""
|
911 |
|
912 |
-
#: admin/tpl/
|
913 |
-
msgid "
|
914 |
msgstr ""
|
915 |
|
916 |
-
#: admin/tpl/
|
917 |
-
msgid "
|
918 |
msgstr ""
|
919 |
|
920 |
-
#: admin/tpl/
|
921 |
-
msgid "
|
|
|
|
|
922 |
msgstr ""
|
923 |
|
924 |
-
#: admin/tpl/
|
925 |
-
msgid ""
|
926 |
-
"Switch all images in the media library back to their original unoptimized "
|
927 |
-
"versions."
|
928 |
msgstr ""
|
929 |
|
930 |
-
#: admin/tpl/
|
931 |
-
msgid "
|
932 |
msgstr ""
|
933 |
|
934 |
-
#: admin/tpl/
|
935 |
-
msgid "
|
936 |
msgstr ""
|
937 |
|
938 |
-
#: admin/tpl/
|
939 |
-
msgid "
|
940 |
msgstr ""
|
941 |
|
942 |
-
#: admin/tpl/
|
943 |
-
msgid "
|
944 |
msgstr ""
|
945 |
|
946 |
-
#: admin/tpl/
|
947 |
-
msgid "
|
948 |
msgstr ""
|
949 |
|
950 |
-
#: admin/tpl/
|
951 |
-
msgid "
|
952 |
msgstr ""
|
953 |
|
954 |
-
#: admin/tpl/
|
955 |
-
msgid ""
|
956 |
-
"Scan for any new unoptimized image thumbnail sizes and resend necessary "
|
957 |
-
"image optimization requests."
|
958 |
msgstr ""
|
959 |
|
960 |
-
#: admin/tpl/
|
961 |
-
msgid "
|
962 |
msgstr ""
|
963 |
|
964 |
-
#: admin/tpl/
|
965 |
-
msgid ""
|
966 |
-
"The current IAPI key must be reset after changing home URL or domain before "
|
967 |
-
"making any further optimization requests."
|
968 |
msgstr ""
|
969 |
|
970 |
-
#: admin/tpl/
|
971 |
-
msgid "
|
972 |
msgstr ""
|
973 |
|
974 |
-
#: admin/tpl/
|
975 |
-
msgid "
|
976 |
msgstr ""
|
977 |
|
978 |
-
#: admin/tpl/
|
979 |
-
msgid "
|
980 |
msgstr ""
|
981 |
|
982 |
-
#: admin/tpl/
|
983 |
msgid ""
|
984 |
-
"
|
985 |
-
"
|
986 |
msgstr ""
|
987 |
|
988 |
-
#: admin/tpl/
|
989 |
-
|
990 |
-
#: admin/tpl/setting/settings_cdn.php:98
|
991 |
-
#: admin/tpl/setting/settings_crawler.php:22
|
992 |
-
#: admin/tpl/setting/settings_crawler.php:95
|
993 |
-
#: admin/tpl/setting/settings_crawler.php:100
|
994 |
-
#: admin/tpl/setting/settings_excludes.php:84
|
995 |
-
#: admin/tpl/setting/settings_excludes.php:122
|
996 |
-
#: admin/tpl/setting/settings_inc.cache_browser.php:12
|
997 |
-
#: admin/tpl/setting/settings_inc.cache_favicon.php:13
|
998 |
-
#: admin/tpl/setting/settings_inc.cache_mobile.php:17
|
999 |
-
#: admin/tpl/setting/settings_inc.cache_mobile.php:66
|
1000 |
-
#: admin/tpl/setting/settings_inc.cache_resources.php:14
|
1001 |
-
#: admin/tpl/setting/settings_inc.exclude_cookies.php:22
|
1002 |
-
#: admin/tpl/setting/settings_inc.exclude_useragent.php:21
|
1003 |
-
#: admin/tpl/setting/settings_inc.media_webp.php:12
|
1004 |
-
#: admin/tpl/setting/settings_optimize.php:222
|
1005 |
-
#: admin/tpl/setting/settings_tuning.php:20
|
1006 |
-
#: admin/tpl/setting/settings_tuning.php:56
|
1007 |
-
msgid "NOTE"
|
1008 |
msgstr ""
|
1009 |
|
1010 |
-
#: admin/tpl/
|
1011 |
-
msgid "
|
1012 |
msgstr ""
|
1013 |
|
1014 |
-
#: admin/tpl/
|
1015 |
-
msgid "
|
1016 |
msgstr ""
|
1017 |
|
1018 |
-
#: admin/tpl/
|
1019 |
-
msgid "
|
1020 |
msgstr ""
|
1021 |
|
1022 |
-
#: admin/tpl/
|
1023 |
-
msgid ""
|
1024 |
-
"A backup of each image is saved before it is optimized. This button will "
|
1025 |
-
"calculate the total amount of disk space used by these backups."
|
1026 |
msgstr ""
|
1027 |
|
1028 |
-
#: admin/tpl/
|
1029 |
-
msgid "
|
1030 |
msgstr ""
|
1031 |
|
1032 |
-
#: admin/tpl/
|
1033 |
-
msgid "
|
|
|
|
|
1034 |
msgstr ""
|
1035 |
|
1036 |
-
#: admin/tpl/
|
1037 |
-
msgid "
|
1038 |
msgstr ""
|
1039 |
|
1040 |
-
#: admin/tpl/
|
1041 |
-
msgid "
|
1042 |
msgstr ""
|
1043 |
|
1044 |
-
#: admin/tpl/
|
1045 |
-
msgid "
|
1046 |
msgstr ""
|
1047 |
|
1048 |
-
#: admin/tpl/
|
1049 |
-
msgid "
|
1050 |
msgstr ""
|
1051 |
|
1052 |
-
#: admin/tpl/
|
1053 |
-
msgid "
|
1054 |
msgstr ""
|
1055 |
|
1056 |
-
#: admin/tpl/
|
1057 |
-
msgid "
|
1058 |
msgstr ""
|
1059 |
|
1060 |
-
#: admin/tpl/
|
1061 |
-
msgid "
|
1062 |
msgstr ""
|
1063 |
|
1064 |
-
#: admin/tpl/
|
1065 |
-
msgid "
|
1066 |
msgstr ""
|
1067 |
|
1068 |
-
#: admin/tpl/
|
1069 |
-
msgid "
|
1070 |
msgstr ""
|
1071 |
|
1072 |
-
#: admin/tpl/
|
1073 |
-
msgid "
|
1074 |
msgstr ""
|
1075 |
|
1076 |
-
#: admin/tpl/
|
1077 |
-
msgid "
|
1078 |
msgstr ""
|
1079 |
|
1080 |
-
#: admin/tpl/
|
1081 |
-
msgid "
|
1082 |
msgstr ""
|
1083 |
|
1084 |
-
#: admin/tpl/
|
1085 |
-
msgid ""
|
1086 |
-
"This will export all current LiteSpeed Cache settings and save as a file."
|
1087 |
msgstr ""
|
1088 |
|
1089 |
-
#: admin/tpl/
|
1090 |
-
msgid "
|
1091 |
msgstr ""
|
1092 |
|
1093 |
-
#: admin/tpl/
|
1094 |
-
|
|
|
1095 |
msgstr ""
|
1096 |
|
1097 |
-
#: admin/tpl/
|
1098 |
-
msgid "
|
1099 |
msgstr ""
|
1100 |
|
1101 |
-
#: admin/tpl/
|
1102 |
-
msgid ""
|
1103 |
-
"This will import settings from a file and override all current LiteSpeed "
|
1104 |
-
"Cache settings."
|
1105 |
msgstr ""
|
1106 |
|
1107 |
-
#: admin/tpl/inc/
|
1108 |
-
msgid "
|
1109 |
msgstr ""
|
1110 |
|
1111 |
-
|
1112 |
-
|
1113 |
-
#: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:350
|
1114 |
-
#: includes/litespeed-cache-gui.class.php:350
|
1115 |
-
msgid "LiteSpeed Cache"
|
1116 |
msgstr ""
|
1117 |
|
1118 |
-
#: admin/tpl/inc/
|
1119 |
-
|
|
|
1120 |
msgstr ""
|
1121 |
|
1122 |
-
#: admin/tpl/inc/
|
1123 |
-
|
|
|
1124 |
msgstr ""
|
1125 |
|
1126 |
-
#: admin/tpl/inc/
|
1127 |
-
msgid "
|
1128 |
msgstr ""
|
1129 |
|
1130 |
-
#: admin/tpl/inc/
|
1131 |
-
msgid "
|
1132 |
msgstr ""
|
1133 |
|
1134 |
-
#: admin/tpl/inc/
|
1135 |
-
msgid "
|
1136 |
msgstr ""
|
1137 |
|
1138 |
-
#: admin/tpl/inc/
|
1139 |
-
msgid "
|
|
|
|
|
1140 |
msgstr ""
|
1141 |
|
1142 |
-
#: admin/tpl/inc/
|
1143 |
-
msgid ""
|
1144 |
-
"If you have any questions, please do not hesitate to let us know in <a "
|
1145 |
-
"%s>our support forum</a> or by <a %s>submitting a ticket with us</a>."
|
1146 |
msgstr ""
|
1147 |
|
1148 |
-
#: admin/tpl/inc/
|
1149 |
-
msgid ""
|
1150 |
-
"This plugin is created with love by LiteSpeed. Your rating is the simplest "
|
1151 |
-
"way to support us. We really appreciate it!"
|
1152 |
msgstr ""
|
1153 |
|
1154 |
-
#: admin/tpl/inc/
|
1155 |
-
msgid "
|
1156 |
msgstr ""
|
1157 |
|
1158 |
-
#: admin/tpl/inc/
|
1159 |
-
msgid "
|
1160 |
msgstr ""
|
1161 |
|
1162 |
-
#: admin/tpl/inc/
|
1163 |
-
msgid "
|
1164 |
msgstr ""
|
1165 |
|
1166 |
-
#: admin/tpl/inc/
|
1167 |
-
msgid "
|
1168 |
msgstr ""
|
1169 |
|
1170 |
-
#: admin/tpl/inc/
|
1171 |
-
msgid "
|
|
|
|
|
1172 |
msgstr ""
|
1173 |
|
1174 |
-
#: admin/tpl/inc/
|
1175 |
-
msgid "
|
|
|
|
|
1176 |
msgstr ""
|
1177 |
|
1178 |
-
#: admin/tpl/inc/
|
1179 |
-
msgid "
|
1180 |
msgstr ""
|
1181 |
|
1182 |
-
#: admin/tpl/inc/
|
1183 |
-
msgid "
|
1184 |
msgstr ""
|
1185 |
|
1186 |
-
#: admin/tpl/inc/
|
1187 |
-
msgid "
|
1188 |
msgstr ""
|
1189 |
|
1190 |
-
#: admin/tpl/inc/
|
1191 |
-
msgid "
|
1192 |
msgstr ""
|
1193 |
|
1194 |
-
#: admin/tpl/inc/
|
1195 |
-
msgid "
|
1196 |
msgstr ""
|
1197 |
|
1198 |
-
#: admin/tpl/inc/
|
1199 |
-
msgid "
|
|
|
|
|
1200 |
msgstr ""
|
1201 |
|
1202 |
-
#: admin/tpl/inc/
|
1203 |
-
msgid "
|
1204 |
msgstr ""
|
1205 |
|
1206 |
-
#: admin/tpl/inc/
|
1207 |
-
msgid "
|
1208 |
msgstr ""
|
1209 |
|
1210 |
-
#: admin/tpl/inc/
|
1211 |
-
msgid ""
|
1212 |
-
"This plugin communicates with LiteSpeed Web Server to let it know which "
|
1213 |
-
"pages are cacheable and when to purge them."
|
1214 |
msgstr ""
|
1215 |
|
1216 |
-
#: admin/tpl/inc/
|
1217 |
msgid ""
|
1218 |
-
"
|
1219 |
-
"
|
1220 |
msgstr ""
|
1221 |
|
1222 |
-
#: admin/tpl/inc/
|
1223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1224 |
msgstr ""
|
1225 |
|
1226 |
-
#: admin/tpl/inc/
|
1227 |
-
msgid "
|
1228 |
msgstr ""
|
1229 |
|
1230 |
#: admin/tpl/inc/show_display_installed.php:5
|
@@ -1306,8 +1372,8 @@ msgid ""
|
|
1306 |
"dismissed. (<a %3$s>Learn More</a>)"
|
1307 |
msgstr ""
|
1308 |
|
1309 |
-
#: admin/tpl/manage/manage_cdn.php:11 inc/gui.class.php:
|
1310 |
-
#: includes/litespeed-cache-gui.class.php:
|
1311 |
msgid "Cloudflare"
|
1312 |
msgstr ""
|
1313 |
|
@@ -1496,15 +1562,15 @@ msgstr ""
|
|
1496 |
#: admin/tpl/manage/manage_purge.php:39 admin/tpl/manage/manage_purge.php:45
|
1497 |
#: admin/tpl/manage/manage_purge.php:54 admin/tpl/manage/manage_purge.php:63
|
1498 |
#: admin/tpl/manage/manage_purge.php:72 admin/tpl/manage/manage_purge.php:81
|
1499 |
-
#: inc/gui.class.php:
|
1500 |
-
#: inc/gui.class.php:
|
1501 |
-
#: inc/gui.class.php:
|
1502 |
-
#: includes/litespeed-cache-gui.class.php:
|
1503 |
-
#: includes/litespeed-cache-gui.class.php:
|
1504 |
-
#: includes/litespeed-cache-gui.class.php:
|
1505 |
-
#: includes/litespeed-cache-gui.class.php:
|
1506 |
-
#: includes/litespeed-cache-gui.class.php:
|
1507 |
-
#: includes/litespeed-cache-gui.class.php:
|
1508 |
msgid "Purge All"
|
1509 |
msgstr ""
|
1510 |
|
@@ -1512,8 +1578,8 @@ msgstr ""
|
|
1512 |
msgid "Purge the litespeed cache entries created by this plugin"
|
1513 |
msgstr ""
|
1514 |
|
1515 |
-
#: admin/tpl/manage/manage_purge.php:45 inc/gui.class.php:
|
1516 |
-
#: includes/litespeed-cache-gui.class.php:
|
1517 |
msgid "CSS/JS Cache"
|
1518 |
msgstr ""
|
1519 |
|
@@ -1522,8 +1588,8 @@ msgid "This will purge all minified/combined CSS/JS entries only"
|
|
1522 |
msgstr ""
|
1523 |
|
1524 |
#: admin/tpl/manage/manage_purge.php:54
|
1525 |
-
#: admin/tpl/setting/settings_inc.cache_object.php:28 inc/gui.class.php:
|
1526 |
-
#: includes/litespeed-cache-gui.class.php:
|
1527 |
msgid "Object Cache"
|
1528 |
msgstr ""
|
1529 |
|
@@ -1531,8 +1597,8 @@ msgstr ""
|
|
1531 |
msgid "Purge all the object caches"
|
1532 |
msgstr ""
|
1533 |
|
1534 |
-
#: admin/tpl/manage/manage_purge.php:63 inc/gui.class.php:
|
1535 |
-
#: includes/litespeed-cache-gui.class.php:
|
1536 |
msgid "Opcode Cache"
|
1537 |
msgstr ""
|
1538 |
|
@@ -1540,8 +1606,8 @@ msgstr ""
|
|
1540 |
msgid "Reset the entire opcode cache"
|
1541 |
msgstr ""
|
1542 |
|
1543 |
-
#: admin/tpl/manage/manage_purge.php:72 inc/gui.class.php:
|
1544 |
-
#: includes/litespeed-cache-gui.class.php:
|
1545 |
msgid "Critical CSS"
|
1546 |
msgstr ""
|
1547 |
|
@@ -1608,7 +1674,7 @@ msgstr ""
|
|
1608 |
#: admin/tpl/setting/settings_inc.cache_object.php:122
|
1609 |
#: admin/tpl/setting/settings_inc.exclude_cookies.php:19
|
1610 |
#: admin/tpl/setting/settings_media.php:34
|
1611 |
-
#: admin/tpl/setting/settings_media.php:
|
1612 |
#: admin/tpl/setting/settings_optimize.php:236
|
1613 |
#: admin/tpl/setting/settings_purge.php:85
|
1614 |
#: admin/tpl/setting/settings_tuning.php:38
|
@@ -1663,8 +1729,8 @@ msgstr ""
|
|
1663 |
msgid "DB Optimizer"
|
1664 |
msgstr ""
|
1665 |
|
1666 |
-
#: admin/tpl/manage.php:10 admin/tpl/setting/settings_cdn.php:
|
1667 |
-
#: admin/tpl/
|
1668 |
msgid "CDN"
|
1669 |
msgstr ""
|
1670 |
|
@@ -2077,65 +2143,54 @@ msgid "Quic Cloud API"
|
|
2077 |
msgstr ""
|
2078 |
|
2079 |
#: admin/tpl/setting/settings_cdn.php:195
|
2080 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2081 |
msgid "Use %s API functionality."
|
2082 |
msgstr ""
|
2083 |
|
2084 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2085 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2086 |
-
msgid "This can be managed from <a %2$s>%1$s</a>."
|
2087 |
-
msgstr ""
|
2088 |
-
|
2089 |
-
#: admin/tpl/setting/settings_cdn.php:222
|
2090 |
-
#: admin/tpl/setting/settings_cdn.php:265
|
2091 |
msgid "Email Address"
|
2092 |
msgstr ""
|
2093 |
|
2094 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2095 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2096 |
msgid "Your Email address on %s."
|
2097 |
msgstr ""
|
2098 |
|
2099 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2100 |
-
|
2101 |
-
msgstr ""
|
2102 |
-
|
2103 |
-
#: admin/tpl/setting/settings_cdn.php:235
|
2104 |
-
#: admin/tpl/setting/settings_cdn.php:278
|
2105 |
msgid "Your API key is used to access %s APIs."
|
2106 |
msgstr ""
|
2107 |
|
2108 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2109 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2110 |
msgid "Get it from <a %1$s>%2$s</a>."
|
2111 |
msgstr ""
|
2112 |
|
2113 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2114 |
-
msgid "
|
2115 |
msgstr ""
|
2116 |
|
2117 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2118 |
-
|
2119 |
-
msgid "You can just type part of the domain."
|
2120 |
msgstr ""
|
2121 |
|
2122 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2123 |
-
|
2124 |
-
msgid ""
|
2125 |
-
"Once saved, it will be matched with the current list and completed "
|
2126 |
-
"automatically."
|
2127 |
msgstr ""
|
2128 |
|
2129 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2130 |
-
msgid "
|
2131 |
msgstr ""
|
2132 |
|
2133 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2134 |
-
msgid "
|
2135 |
msgstr ""
|
2136 |
|
2137 |
-
#: admin/tpl/setting/settings_cdn.php:
|
2138 |
-
msgid "
|
|
|
|
|
2139 |
msgstr ""
|
2140 |
|
2141 |
#: admin/tpl/setting/settings_compatibilities.php:7
|
@@ -2876,10 +2931,6 @@ msgstr ""
|
|
2876 |
msgid "Only available when %s is installed."
|
2877 |
msgstr ""
|
2878 |
|
2879 |
-
#: admin/tpl/setting/settings_inc.cache_object.php:90
|
2880 |
-
msgid "Password"
|
2881 |
-
msgstr ""
|
2882 |
-
|
2883 |
#: admin/tpl/setting/settings_inc.cache_object.php:94
|
2884 |
msgid "Specify the password used when connecting."
|
2885 |
msgstr ""
|
@@ -2960,13 +3011,13 @@ msgstr ""
|
|
2960 |
#: admin/tpl/setting/settings_inc.check_adv_file.php:14
|
2961 |
msgid ""
|
2962 |
"When this option is checked and this file is detected as belonging to "
|
2963 |
-
"another plugin, LiteSpeed
|
2964 |
msgstr ""
|
2965 |
|
2966 |
#: admin/tpl/setting/settings_inc.check_adv_file.php:17
|
2967 |
msgid ""
|
2968 |
-
"
|
2969 |
-
"
|
2970 |
msgstr ""
|
2971 |
|
2972 |
#: admin/tpl/setting/settings_inc.exclude_cookies.php:6
|
@@ -3176,87 +3227,120 @@ msgid "Load iframes only when they enter the viewport."
|
|
3176 |
msgstr ""
|
3177 |
|
3178 |
#: admin/tpl/setting/settings_media.php:69
|
3179 |
-
msgid "
|
3180 |
msgstr ""
|
3181 |
|
3182 |
#: admin/tpl/setting/settings_media.php:73
|
3183 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3184 |
msgstr ""
|
3185 |
|
3186 |
-
#: admin/tpl/setting/settings_media.php:
|
3187 |
msgid "Optimization Cron"
|
3188 |
msgstr ""
|
3189 |
|
3190 |
-
#: admin/tpl/setting/settings_media.php:
|
3191 |
msgid ""
|
3192 |
"Disabling this will stop the cron job responsible for fetching optimized "
|
3193 |
"images from LiteSpeed's Image Server."
|
3194 |
msgstr ""
|
3195 |
|
3196 |
-
#: admin/tpl/setting/settings_media.php:
|
3197 |
msgid "Optimize Original Images"
|
3198 |
msgstr ""
|
3199 |
|
3200 |
-
#: admin/tpl/setting/settings_media.php:
|
3201 |
msgid "Optimize images and save backups of the originals in the same folder."
|
3202 |
msgstr ""
|
3203 |
|
3204 |
-
#: admin/tpl/setting/settings_media.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3205 |
msgid "Optimize WebP Versions"
|
3206 |
msgstr ""
|
3207 |
|
3208 |
-
#: admin/tpl/setting/settings_media.php:
|
3209 |
msgid "Request WebP versions of original images when doing optimization."
|
3210 |
msgstr ""
|
3211 |
|
3212 |
-
#: admin/tpl/setting/settings_media.php:
|
3213 |
msgid "Optimize Losslessly"
|
3214 |
msgstr ""
|
3215 |
|
3216 |
-
#: admin/tpl/setting/settings_media.php:
|
3217 |
msgid "Optimize images using lossless compression."
|
3218 |
msgstr ""
|
3219 |
|
3220 |
-
#: admin/tpl/setting/settings_media.php:
|
3221 |
msgid ""
|
3222 |
"This can improve quality but may result in larger images than lossy "
|
3223 |
"compression will."
|
3224 |
msgstr ""
|
3225 |
|
3226 |
-
#: admin/tpl/setting/settings_media.php:
|
3227 |
msgid "Preserve EXIF data"
|
3228 |
msgstr ""
|
3229 |
|
3230 |
-
#: admin/tpl/setting/settings_media.php:
|
3231 |
msgid ""
|
3232 |
"Preserve EXIF data (copyright, GPS, comments, keywords, etc) when optimizing."
|
3233 |
msgstr ""
|
3234 |
|
3235 |
-
#: admin/tpl/setting/settings_media.php:
|
3236 |
msgid "This will increase the size of optimized files."
|
3237 |
msgstr ""
|
3238 |
|
3239 |
-
#: admin/tpl/setting/settings_media.php:
|
3240 |
msgid "WebP Attribute To Replace"
|
3241 |
msgstr ""
|
3242 |
|
3243 |
-
#: admin/tpl/setting/settings_media.php:
|
3244 |
msgid "Specify which element attributes will be replaced with WebP."
|
3245 |
msgstr ""
|
3246 |
|
3247 |
-
#: admin/tpl/setting/settings_media.php:
|
3248 |
msgid "Only attributes listed here will be replaced."
|
3249 |
msgstr ""
|
3250 |
|
3251 |
-
#: admin/tpl/setting/settings_media.php:
|
3252 |
msgid "Use the format %1$s or %2$s (element is optional)."
|
3253 |
msgstr ""
|
3254 |
|
3255 |
-
#: admin/tpl/setting/settings_media.php:
|
3256 |
msgid "WebP For Extra srcset"
|
3257 |
msgstr ""
|
3258 |
|
3259 |
-
#: admin/tpl/setting/settings_media.php:
|
3260 |
msgid ""
|
3261 |
"Enable replacement of WebP in %s elements that were generated outside of "
|
3262 |
"WordPress logic."
|
@@ -3380,16 +3464,6 @@ msgstr ""
|
|
3380 |
msgid "Optimize CSS delivery."
|
3381 |
msgstr ""
|
3382 |
|
3383 |
-
#: admin/tpl/setting/settings_optimize.php:137
|
3384 |
-
#: admin/tpl/setting/settings_optimize.php:210
|
3385 |
-
#: admin/tpl/setting/settings_optimize.php:248
|
3386 |
-
#: admin/tpl/setting/settings_tuning.php:103
|
3387 |
-
#: admin/tpl/setting/settings_tuning.php:162
|
3388 |
-
msgid ""
|
3389 |
-
"This can improve your speed score in services like Pingdom, GTmetrix and "
|
3390 |
-
"PageSpeed."
|
3391 |
-
msgstr ""
|
3392 |
-
|
3393 |
#: admin/tpl/setting/settings_optimize.php:138
|
3394 |
msgid ""
|
3395 |
"When this option is turned %s, it will also load Google Fonts asynchronously."
|
@@ -3467,8 +3541,8 @@ msgstr ""
|
|
3467 |
|
3468 |
#: admin/tpl/setting/settings_optimize.php:223
|
3469 |
msgid ""
|
3470 |
-
"If there is any JS error related to %1$s when enabled %2$s, please
|
3471 |
-
"option."
|
3472 |
msgstr ""
|
3473 |
|
3474 |
#: admin/tpl/setting/settings_optimize.php:230
|
@@ -3836,38 +3910,38 @@ msgstr ""
|
|
3836 |
msgid "Failed to communicate with Cloudflare"
|
3837 |
msgstr ""
|
3838 |
|
3839 |
-
#: inc/crawler.class.php:
|
3840 |
msgid "Can not find any form data for blacklist"
|
3841 |
msgstr ""
|
3842 |
|
3843 |
-
#: inc/crawler.class.php:
|
3844 |
msgid "File saved successfully: %s"
|
3845 |
msgstr ""
|
3846 |
|
3847 |
-
#: inc/crawler.class.php:
|
3848 |
msgid "File created successfully: %s"
|
3849 |
msgstr ""
|
3850 |
|
3851 |
-
#: inc/crawler.class.php:
|
3852 |
msgid "Failed to send position reset notification: %s"
|
3853 |
msgstr ""
|
3854 |
|
3855 |
-
#: inc/crawler.class.php:
|
3856 |
msgid "Position reset notification sent successfully"
|
3857 |
msgstr ""
|
3858 |
|
3859 |
-
#: inc/crawler.class.php:
|
3860 |
#: lib/litespeed/litespeed-crawler.class.php:402
|
3861 |
msgid "Crawler %s reached end of sitemap file."
|
3862 |
msgstr ""
|
3863 |
|
3864 |
-
#: inc/crawler.class.php:
|
3865 |
-
#: includes/litespeed-cache-crawler.class.php:502
|
3866 |
#: includes/litespeed-cache-crawler.class.php:506
|
|
|
3867 |
msgid "Guest"
|
3868 |
msgstr ""
|
3869 |
|
3870 |
-
#: inc/doc.cls.php:
|
3871 |
msgid ""
|
3872 |
"This site utilizes caching in order to facilitate a faster response time and "
|
3873 |
"better user experience. Caching potentially stores a duplicate copy of every "
|
@@ -3878,238 +3952,277 @@ msgid ""
|
|
3878 |
"admin before their natural expiration, if necessary."
|
3879 |
msgstr ""
|
3880 |
|
3881 |
-
#: inc/gui.class.php:
|
3882 |
msgid "Purge this page"
|
3883 |
msgstr ""
|
3884 |
|
3885 |
-
#: inc/gui.class.php:
|
3886 |
msgid "Mark this page as "
|
3887 |
msgstr ""
|
3888 |
|
3889 |
-
#: inc/gui.class.php:
|
3890 |
msgid "Forced cacheable"
|
3891 |
msgstr ""
|
3892 |
|
3893 |
-
#: inc/gui.class.php:
|
3894 |
msgid "Non cacheable"
|
3895 |
msgstr ""
|
3896 |
|
3897 |
-
#: inc/gui.class.php:
|
3898 |
msgid "Private cache"
|
3899 |
msgstr ""
|
3900 |
|
3901 |
-
#: inc/gui.class.php:
|
3902 |
msgid "No optimization"
|
3903 |
msgstr ""
|
3904 |
|
3905 |
-
#: inc/gui.class.php:
|
3906 |
msgid "More settings"
|
3907 |
msgstr ""
|
3908 |
|
3909 |
-
#: inc/gui.class.php:
|
3910 |
msgid "LiteSpeed Cache Purge All"
|
3911 |
msgstr ""
|
3912 |
|
3913 |
-
#: inc/gui.class.php:
|
|
|
|
|
3914 |
msgid "LSCache"
|
3915 |
msgstr ""
|
3916 |
|
3917 |
-
#: inc/
|
3918 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3919 |
msgstr ""
|
3920 |
|
3921 |
-
#: inc/img_optm.class.php:
|
3922 |
msgid "Communicated with LiteSpeed Image Optimization Server successfully."
|
3923 |
msgstr ""
|
3924 |
|
3925 |
-
#: inc/img_optm.class.php:
|
3926 |
-
#: inc/img_optm.class.php:
|
3927 |
msgid "No image found."
|
3928 |
msgstr ""
|
3929 |
|
3930 |
-
#: inc/img_optm.class.php:
|
3931 |
msgid "Number of images in one image group (%s) exceeds the credit (%s)"
|
3932 |
msgstr ""
|
3933 |
|
3934 |
-
#: inc/img_optm.class.php:
|
3935 |
msgid "Requested successfully."
|
3936 |
msgstr ""
|
3937 |
|
3938 |
-
#: inc/img_optm.class.php:
|
3939 |
msgid "Optimized successfully."
|
3940 |
msgstr ""
|
3941 |
|
3942 |
-
#: inc/img_optm.class.php:
|
3943 |
msgid "Pushed %1$s to LiteSpeed optimization server, accepted %2$s."
|
3944 |
msgstr ""
|
3945 |
|
3946 |
-
#: inc/img_optm.class.php:
|
3947 |
-
msgid "Failed to
|
3948 |
msgstr ""
|
3949 |
|
3950 |
-
#: inc/img_optm.class.php:
|
3951 |
-
msgid "
|
|
|
|
|
|
|
3952 |
msgstr ""
|
3953 |
|
3954 |
-
#: inc/img_optm.class.php:
|
3955 |
msgid "Destroy unfinished data successfully."
|
3956 |
msgstr ""
|
3957 |
|
3958 |
-
#: inc/img_optm.class.php:
|
3959 |
msgid ""
|
3960 |
"Pushed %1$s groups with %2$s images to LiteSpeed optimization server, "
|
3961 |
"accepted %3$s groups with %4$s images."
|
3962 |
msgstr ""
|
3963 |
|
3964 |
-
#: inc/img_optm.class.php:
|
3965 |
msgid "Removed %1$s images and saved %2$s successfully."
|
3966 |
msgstr ""
|
3967 |
|
3968 |
-
#: inc/img_optm.class.php:
|
3969 |
msgid "Switched images successfully."
|
3970 |
msgstr ""
|
3971 |
|
3972 |
-
#: inc/img_optm.class.php:
|
3973 |
msgid "Disabled WebP file successfully."
|
3974 |
msgstr ""
|
3975 |
|
3976 |
-
#: inc/img_optm.class.php:
|
3977 |
msgid "Enabled WebP file successfully."
|
3978 |
msgstr ""
|
3979 |
|
3980 |
-
#: inc/img_optm.class.php:
|
3981 |
msgid "Restored original file successfully."
|
3982 |
msgstr ""
|
3983 |
|
3984 |
-
#: inc/img_optm.class.php:
|
3985 |
msgid "Switched to optimized file successfully."
|
3986 |
msgstr ""
|
3987 |
|
3988 |
-
#: inc/
|
|
|
|
|
|
|
|
|
3989 |
msgid "Import failed due to file error."
|
3990 |
msgstr ""
|
3991 |
|
3992 |
-
#: inc/import.class.php:
|
3993 |
msgid "Imported setting file %s successfully."
|
3994 |
msgstr ""
|
3995 |
|
3996 |
-
#: inc/litespeed-cache.class.php:
|
3997 |
msgid "Crawler blacklist is saved."
|
3998 |
msgstr ""
|
3999 |
|
4000 |
-
#: inc/litespeed-cache.class.php:
|
4001 |
msgid "Notified LiteSpeed Web Server to purge everything."
|
4002 |
msgstr ""
|
4003 |
|
4004 |
-
#: inc/litespeed-cache.class.php:
|
4005 |
msgid "Notified LiteSpeed Web Server to purge the list."
|
4006 |
msgstr ""
|
4007 |
|
4008 |
-
#: inc/media.class.php:
|
4009 |
msgid "LiteSpeed Optimization"
|
4010 |
msgstr ""
|
4011 |
|
4012 |
-
#: inc/media.class.php:
|
4013 |
-
msgid "
|
4014 |
msgstr ""
|
4015 |
|
4016 |
-
#: inc/media.class.php:
|
4017 |
-
msgid "
|
4018 |
msgstr ""
|
4019 |
|
4020 |
-
#: inc/media.class.php:
|
4021 |
-
msgid "
|
4022 |
msgstr ""
|
4023 |
|
4024 |
-
#: inc/media.class.php:
|
4025 |
-
msgid "
|
4026 |
msgstr ""
|
4027 |
|
4028 |
-
#: inc/media.class.php:
|
4029 |
-
msgid "
|
4030 |
msgstr ""
|
4031 |
|
4032 |
-
#: inc/media.class.php:
|
4033 |
-
msgid "
|
|
|
|
|
|
|
|
|
4034 |
msgstr ""
|
4035 |
|
4036 |
-
#: inc/purge.class.php:
|
4037 |
msgid "Purged all caches successfully."
|
4038 |
msgstr ""
|
4039 |
|
4040 |
-
#: inc/purge.class.php:
|
4041 |
msgid "Notified LiteSpeed Web Server to purge all LSCache entries."
|
4042 |
msgstr ""
|
4043 |
|
4044 |
-
#: inc/purge.class.php:
|
4045 |
msgid "Cleaned all critical CSS files."
|
4046 |
msgstr ""
|
4047 |
|
4048 |
-
#: inc/purge.class.php:
|
4049 |
msgid "Notified LiteSpeed Web Server to purge CSS/JS entries."
|
4050 |
msgstr ""
|
4051 |
|
4052 |
-
#: inc/purge.class.php:
|
4053 |
msgid "Opcode cache is not enabled."
|
4054 |
msgstr ""
|
4055 |
|
4056 |
-
#: inc/purge.class.php:
|
4057 |
msgid "Reset the entire opcode cache successfully."
|
4058 |
msgstr ""
|
4059 |
|
4060 |
-
#: inc/purge.class.php:
|
4061 |
msgid "Object cache is not enabled."
|
4062 |
msgstr ""
|
4063 |
|
4064 |
-
#: inc/purge.class.php:
|
4065 |
msgid "Purge all object caches successfully."
|
4066 |
msgstr ""
|
4067 |
|
4068 |
-
#: inc/purge.class.php:
|
4069 |
msgid "Notified LiteSpeed Web Server to purge the front page."
|
4070 |
msgstr ""
|
4071 |
|
4072 |
-
#: inc/purge.class.php:
|
4073 |
msgid "Notified LiteSpeed Web Server to purge pages."
|
4074 |
msgstr ""
|
4075 |
|
4076 |
-
#: inc/purge.class.php:
|
4077 |
msgid "Notified LiteSpeed Web Server to purge error pages."
|
4078 |
msgstr ""
|
4079 |
|
4080 |
-
#: inc/purge.class.php:
|
4081 |
msgid "Purge category %s"
|
4082 |
msgstr ""
|
4083 |
|
4084 |
-
#: inc/purge.class.php:
|
4085 |
msgid "Purge Post ID %s"
|
4086 |
msgstr ""
|
4087 |
|
4088 |
-
#: inc/purge.class.php:
|
4089 |
msgid "Purge tag %s"
|
4090 |
msgstr ""
|
4091 |
|
4092 |
-
#: inc/purge.class.php:
|
4093 |
msgid "Purge url %s"
|
4094 |
msgstr ""
|
4095 |
|
4096 |
-
#: inc/task.class.php:
|
4097 |
msgid "LiteSpeed Cache Custom Cron Common"
|
4098 |
msgstr ""
|
4099 |
|
4100 |
-
#: inc/task.class.php:
|
4101 |
msgid "LiteSpeed Cache Custom Cron Crawler"
|
4102 |
msgstr ""
|
4103 |
|
4104 |
-
#: inc/utility.class.php:
|
4105 |
msgid "just now"
|
4106 |
msgstr ""
|
4107 |
|
4108 |
-
#: inc/utility.class.php:
|
4109 |
msgid "right now"
|
4110 |
msgstr ""
|
4111 |
|
4112 |
-
#: inc/utility.class.php:
|
4113 |
msgid " %s ago"
|
4114 |
msgstr ""
|
4115 |
|
@@ -4244,7 +4357,7 @@ msgid ""
|
|
4244 |
msgstr ""
|
4245 |
|
4246 |
#. Description of the plugin/theme
|
4247 |
-
msgid "
|
4248 |
msgstr ""
|
4249 |
|
4250 |
#. Author of the plugin/theme
|
2 |
# This file is distributed under the same license as the LiteSpeed Cache package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: LiteSpeed Cache 2.4.4\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
|
7 |
+
"POT-Creation-Date: 2018-08-31 15:56:59+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
+
#: admin/admin-api.class.php:247
|
16 |
msgid "IAPI Error %s"
|
17 |
msgstr ""
|
18 |
|
19 |
+
#: admin/admin-api.class.php:271
|
20 |
msgid "Reset IAPI key successfully."
|
21 |
msgstr ""
|
22 |
|
23 |
+
#: admin/admin-api.class.php:324
|
24 |
+
msgid "Failed to post via WordPress"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: admin/admin-api.class.php:332
|
28 |
msgid "Failed to communicate with LiteSpeed image server"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: admin/admin-api.class.php:341
|
32 |
+
msgid ""
|
33 |
+
"We are working hard to improve your Image Optimization experience. The "
|
34 |
+
"service will be unavailable while we work. We apologize for any "
|
35 |
+
"inconvenience."
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: admin/admin-api.class.php:350 admin/admin-api.class.php:358
|
39 |
msgid "Message from LiteSpeed image server"
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: admin/admin-api.class.php:366
|
43 |
+
msgid "Good news from LiteSpeed image server"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: admin/admin-api.class.php:375
|
47 |
+
msgid "%s plugin version %s required for this action."
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: admin/litespeed-cache-admin-display.class.php:155
|
51 |
+
#: admin/litespeed-cache-admin-display.class.php:246 inc/gui.class.php:369
|
52 |
+
#: includes/litespeed-cache-gui.class.php:369
|
53 |
msgid "Settings"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: admin/litespeed-cache-admin-display.class.php:157
|
57 |
+
#: admin/tpl/setting/settings_cdn.php:240 inc/gui.class.php:361
|
58 |
+
#: includes/litespeed-cache-gui.class.php:361
|
59 |
+
msgid "Manage"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: admin/litespeed-cache-admin-display.class.php:160
|
63 |
msgid "Edit .htaccess"
|
64 |
msgstr ""
|
65 |
|
66 |
+
#: admin/litespeed-cache-admin-display.class.php:164 inc/gui.class.php:378
|
67 |
+
#: includes/litespeed-cache-gui.class.php:378
|
68 |
msgid "Image Optimization"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: admin/litespeed-cache-admin-display.class.php:165 admin/tpl/settings.php:22
|
72 |
msgid "Crawler"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: admin/litespeed-cache-admin-display.class.php:166
|
76 |
msgid "Report"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: admin/litespeed-cache-admin-display.class.php:167
|
80 |
msgid "Import / Export"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: admin/litespeed-cache-admin-display.class.php:170
|
84 |
#: admin/tpl/setting/settings_debug.php:23
|
85 |
msgid "Debug Log"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: admin/litespeed-cache-admin-display.class.php:266
|
89 |
msgid ""
|
90 |
"It is recommended that LiteSpeed Cache be purged after updating a plugin."
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: admin/litespeed-cache-admin-display.class.php:814
|
94 |
+
#: admin/litespeed-cache-admin-display.class.php:899
|
95 |
#: admin/tpl/setting/settings_debug.php:35
|
96 |
#: admin/tpl/setting/settings_inc.cache_mobile.php:67
|
97 |
#: admin/tpl/setting/settings_optimize.php:138
|
103 |
msgid "ON"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: admin/litespeed-cache-admin-display.class.php:815
|
107 |
+
#: admin/litespeed-cache-admin-display.class.php:903
|
108 |
#: admin/tpl/setting/settings_cdn.php:35 admin/tpl/setting/settings_cdn.php:169
|
109 |
#: admin/tpl/setting/settings_debug.php:29
|
110 |
#: admin/tpl/setting/settings_inc.cache_object.php:149
|
115 |
msgid "OFF"
|
116 |
msgstr ""
|
117 |
|
118 |
+
#: admin/litespeed-cache-admin-display.class.php:938
|
119 |
msgid "Recommended value: %s"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: admin/litespeed-cache-admin-display.class.php:954
|
123 |
#: admin/tpl/setting/settings_media.php:36
|
124 |
#: admin/tpl/setting/settings_optimize.php:140
|
125 |
#: admin/tpl/setting/settings_tuning.php:24
|
130 |
msgid "API"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: admin/litespeed-cache-admin-display.class.php:955
|
134 |
msgid "Server variable(s) %s available to override this setting."
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: admin/litespeed-cache-admin-display.class.php:957
|
138 |
+
#: admin/litespeed-cache-admin.class.php:229
|
139 |
+
#: admin/tpl/inc/img_optm.initialize.php:29
|
140 |
+
#: admin/tpl/inc/img_optm.summary.php:165 admin/tpl/manage/manage_cdn.php:60
|
141 |
#: admin/tpl/setting/settings_advanced.php:10
|
142 |
#: admin/tpl/setting/settings_advanced.php:39
|
143 |
#: admin/tpl/setting/settings_advanced.php:51
|
152 |
#: admin/tpl/setting/settings_inc.cache_object.php:33
|
153 |
#: admin/tpl/setting/settings_inc.cache_object.php:75
|
154 |
#: admin/tpl/setting/settings_inc.cache_object.php:150
|
155 |
+
#: admin/tpl/setting/settings_inc.check_adv_file.php:18
|
156 |
#: admin/tpl/setting/settings_media.php:8
|
157 |
+
#: admin/tpl/setting/settings_media.php:75
|
158 |
+
#: admin/tpl/setting/settings_media.php:188
|
159 |
#: admin/tpl/setting/settings_optimize.php:10
|
160 |
#: admin/tpl/setting/settings_optimize.php:165
|
161 |
#: admin/tpl/setting/settings_optimize.php:237
|
162 |
#: admin/tpl/setting/settings_purge.php:8
|
163 |
+
#: admin/tpl/setting/settings_tuning.php:8 inc/doc.cls.php:39
|
164 |
msgid "Learn More"
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: admin/litespeed-cache-admin-display.class.php:972
|
168 |
msgid "%s groups"
|
169 |
msgstr ""
|
170 |
|
171 |
+
#: admin/litespeed-cache-admin-display.class.php:975
|
172 |
msgid "%s images"
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: admin/litespeed-cache-admin-display.class.php:985
|
176 |
msgid "%s group"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: admin/litespeed-cache-admin-display.class.php:988
|
180 |
msgid "%s image"
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: admin/litespeed-cache-admin-error.class.php:86
|
184 |
msgid "The installed PHP version is too old for the LiteSpeed Cache Plugin."
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: admin/litespeed-cache-admin-error.class.php:88
|
188 |
msgid "The LiteSpeed Cache Plugin requires at least PHP %s."
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: admin/litespeed-cache-admin-error.class.php:90
|
192 |
msgid ""
|
193 |
"The currently installed version is PHP %s, which is out-dated and insecure."
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: admin/litespeed-cache-admin-error.class.php:92
|
197 |
+
#: admin/litespeed-cache-admin-error.class.php:101
|
198 |
msgid ""
|
199 |
"Please upgrade or go to <a href=\"%s\">active plugins</a> and deactivate the "
|
200 |
"LiteSpeed Cache plugin to hide this message."
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: admin/litespeed-cache-admin-error.class.php:97
|
204 |
msgid ""
|
205 |
"The installed WordPress version is too old for the LiteSpeed Cache Plugin."
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: admin/litespeed-cache-admin-error.class.php:99
|
209 |
msgid "The LiteSpeed Cache Plugin requires at least WordPress %s."
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: admin/litespeed-cache-admin-error.class.php:106
|
213 |
msgid "Something went wrong with the form! Please try again."
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: admin/litespeed-cache-admin-error.class.php:109
|
217 |
msgid "Tried to purge list with empty list."
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: admin/litespeed-cache-admin-error.class.php:112
|
221 |
msgid "Bad Purge By selected value."
|
222 |
msgstr ""
|
223 |
|
224 |
+
#: admin/litespeed-cache-admin-error.class.php:115
|
225 |
msgid "Failed to purge by category, invalid category slug."
|
226 |
msgstr ""
|
227 |
|
228 |
+
#: admin/litespeed-cache-admin-error.class.php:118
|
229 |
msgid "Failed to purge by tag, invalid tag slug."
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: admin/litespeed-cache-admin-error.class.php:121
|
233 |
msgid "Failed to purge by url, contained \"<\"."
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: admin/litespeed-cache-admin-error.class.php:125
|
237 |
msgid "Failed to purge by Post ID, given ID is not numeric: %s"
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: admin/litespeed-cache-admin-error.class.php:128
|
241 |
msgid ""
|
242 |
"Failed to purge by Post ID, given ID does not exist or is not published: %s"
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: admin/litespeed-cache-admin-error.class.php:132
|
246 |
msgid "Failed to purge by url, invalid input: %s."
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: admin/litespeed-cache-admin-error.class.php:135
|
250 |
msgid "Failed to purge by category, does not exist: %s"
|
251 |
msgstr ""
|
252 |
|
253 |
+
#: admin/litespeed-cache-admin-error.class.php:138
|
254 |
msgid "Failed to purge by tag, does not exist: %s"
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: admin/litespeed-cache-admin-error.class.php:142
|
258 |
msgid "Invalid data in Admin IPs."
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: admin/litespeed-cache-admin-error.class.php:145
|
262 |
msgid "Invalid data in Test IPs."
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: admin/litespeed-cache-admin-error.class.php:148
|
266 |
msgid "Invalid Site IP: %s"
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: admin/litespeed-cache-admin-error.class.php:151
|
270 |
msgid "Can not fetch Custom Sitemap: %s"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: admin/litespeed-cache-admin-error.class.php:154
|
274 |
msgid "Can not parse custom sitemap xml file: %s."
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: admin/litespeed-cache-admin-error.class.php:155
|
278 |
msgid ""
|
279 |
"Please make sure the file is xml format and the %s extension is installed on "
|
280 |
"the server."
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: admin/litespeed-cache-admin-error.class.php:159
|
284 |
msgid "Removed category \"%s\" from list, ID does not exist."
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: admin/litespeed-cache-admin-error.class.php:164
|
288 |
msgid "Removed tag \"%s\" from list, ID does not exist."
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: admin/litespeed-cache-admin-error.class.php:168
|
292 |
msgid "Invalid login cookie. Invalid characters found: %s"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: admin/litespeed-cache-admin-error.class.php:172
|
296 |
msgid "Invalid Rewrite List."
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: admin/litespeed-cache-admin-error.class.php:173
|
300 |
msgid "Empty or invalid rule."
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: admin/litespeed-cache-admin-error.class.php:174
|
304 |
msgid "Rule: %1$s, list: %2$s"
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: admin/litespeed-cache-admin-error.class.php:178
|
308 |
msgid "Tried to parse for existing login cookie."
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: admin/litespeed-cache-admin-error.class.php:179
|
312 |
msgid "%s file not valid. Please verify contents."
|
313 |
msgstr ""
|
314 |
|
315 |
+
#: admin/litespeed-cache-admin-error.class.php:183
|
316 |
msgid "Could not find %s."
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: admin/litespeed-cache-admin-error.class.php:187
|
320 |
msgid "This site is a subdirectory install."
|
321 |
msgstr ""
|
322 |
|
323 |
+
#: admin/litespeed-cache-admin-error.class.php:188
|
324 |
msgid "Login cookies do not match."
|
325 |
msgstr ""
|
326 |
|
327 |
+
#: admin/litespeed-cache-admin-error.class.php:189
|
328 |
msgid ""
|
329 |
"Please remove both and set the login cookie in LiteSpeed Cache advanced "
|
330 |
"settings."
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: admin/litespeed-cache-admin-error.class.php:192
|
334 |
+
#: admin/litespeed-cache-admin-error.class.php:230
|
335 |
msgid "LiteSpeed Cache was unable to write to the wp-config.php file."
|
336 |
msgstr ""
|
337 |
|
338 |
+
#: admin/litespeed-cache-admin-error.class.php:193
|
339 |
+
#: admin/litespeed-cache-admin-error.class.php:231
|
340 |
msgid "Please add the following to the wp-config.php file: %s"
|
341 |
msgstr ""
|
342 |
|
343 |
+
#: admin/litespeed-cache-admin-error.class.php:197
|
344 |
msgid "Failed to back up file, aborted changes."
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: admin/litespeed-cache-admin-error.class.php:200
|
348 |
msgid "Failed to put contents into %s"
|
349 |
msgstr ""
|
350 |
|
351 |
+
#: admin/litespeed-cache-admin-error.class.php:203
|
352 |
msgid "Failed to get %s file contents."
|
353 |
msgstr ""
|
354 |
|
355 |
+
#: admin/litespeed-cache-admin-error.class.php:206
|
356 |
msgid "%s file not readable or not writable."
|
357 |
msgstr ""
|
358 |
|
359 |
+
#: admin/litespeed-cache-admin-error.class.php:209
|
360 |
msgid "%s file not readable."
|
361 |
msgstr ""
|
362 |
|
363 |
+
#: admin/litespeed-cache-admin-error.class.php:212
|
364 |
msgid "%s file not writable."
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: admin/litespeed-cache-admin-error.class.php:215
|
368 |
msgid "Failed to overwrite %s."
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: admin/litespeed-cache-admin-error.class.php:219
|
372 |
msgid "The %1$s file not writable for %2$s"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: admin/litespeed-cache-admin-error.class.php:223
|
376 |
msgid "%s file did not find a place to insert define."
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: admin/litespeed-cache-admin-optimize.class.php:146
|
380 |
msgid "Clean all successfully."
|
381 |
msgstr ""
|
382 |
|
383 |
+
#: admin/litespeed-cache-admin-optimize.class.php:153
|
384 |
msgid "Clean post revisions successfully."
|
385 |
msgstr ""
|
386 |
|
387 |
+
#: admin/litespeed-cache-admin-optimize.class.php:157
|
388 |
msgid "Clean auto drafts successfully."
|
389 |
msgstr ""
|
390 |
|
391 |
+
#: admin/litespeed-cache-admin-optimize.class.php:161
|
392 |
msgid "Clean trashed posts and pages successfully."
|
393 |
msgstr ""
|
394 |
|
395 |
+
#: admin/litespeed-cache-admin-optimize.class.php:165
|
396 |
msgid "Clean spam comments successfully."
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: admin/litespeed-cache-admin-optimize.class.php:169
|
400 |
msgid "Clean trashed comments successfully."
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: admin/litespeed-cache-admin-optimize.class.php:173
|
404 |
msgid "Clean trackbacks and pingbacks successfully."
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: admin/litespeed-cache-admin-optimize.class.php:177
|
408 |
msgid "Clean expired transients successfully."
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: admin/litespeed-cache-admin-optimize.class.php:181
|
412 |
msgid "Clean all transients successfully."
|
413 |
msgstr ""
|
414 |
|
415 |
+
#: admin/litespeed-cache-admin-optimize.class.php:191
|
416 |
msgid "Optimized all tables."
|
417 |
msgstr ""
|
418 |
|
419 |
+
#: admin/litespeed-cache-admin-optimize.class.php:196
|
420 |
msgid "Clean all CSS/JS optimizer data successfully."
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: admin/litespeed-cache-admin-report.class.php:64
|
424 |
msgid "Failed to push to LiteSpeed server: %s"
|
425 |
msgstr ""
|
426 |
|
427 |
+
#: admin/litespeed-cache-admin-rules.class.php:908
|
428 |
msgid ""
|
429 |
"<p>Please add/replace the following codes into the beginning of %1$s:</p> "
|
430 |
"%2$s"
|
431 |
msgstr ""
|
432 |
|
433 |
+
#: admin/litespeed-cache-admin-rules.class.php:1010
|
434 |
msgid "File Saved."
|
435 |
msgstr ""
|
436 |
|
437 |
+
#: admin/litespeed-cache-admin-settings.class.php:45
|
438 |
msgid "%1$s must be an integer larger than %2$d"
|
439 |
msgstr ""
|
440 |
|
441 |
+
#: admin/litespeed-cache-admin-settings.class.php:48
|
442 |
msgid "%1$s must be an integer between %2$d and %3$d"
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: admin/litespeed-cache-admin-settings.class.php:67
|
446 |
msgid "'Use primary site settings' set by Network Administrator."
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: admin/litespeed-cache-admin-settings.class.php:257
|
450 |
msgid "Site options saved."
|
451 |
msgstr ""
|
452 |
|
453 |
+
#: admin/litespeed-cache-admin-settings.class.php:357
|
454 |
+
#: admin/litespeed-cache-admin-settings.class.php:1045
|
455 |
msgid "Default Public Cache"
|
456 |
msgstr ""
|
457 |
|
458 |
+
#: admin/litespeed-cache-admin-settings.class.php:358
|
459 |
msgid "Default Private Cache"
|
460 |
msgstr ""
|
461 |
|
462 |
+
#: admin/litespeed-cache-admin-settings.class.php:359
|
463 |
msgid "Default Front Page"
|
464 |
msgstr ""
|
465 |
|
466 |
+
#: admin/litespeed-cache-admin-settings.class.php:360
|
467 |
msgid "Feed"
|
468 |
msgstr ""
|
469 |
|
470 |
+
#: admin/litespeed-cache-admin-settings.class.php:883
|
471 |
#: admin/tpl/setting/settings_debug.php:88
|
472 |
msgid "Log File Size Limit"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: admin/litespeed-cache-admin-settings.class.php:968
|
476 |
#: admin/tpl/setting/settings_crawler.php:13
|
477 |
msgid "Delay"
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: admin/litespeed-cache-admin-settings.class.php:969
|
481 |
#: admin/tpl/setting/settings_crawler.php:37
|
482 |
msgid "Run Duration"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: admin/litespeed-cache-admin-settings.class.php:970
|
486 |
msgid "Cron Interval"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: admin/litespeed-cache-admin-settings.class.php:971
|
490 |
msgid "Whole Interval"
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: admin/litespeed-cache-admin-settings.class.php:972
|
494 |
#: admin/tpl/setting/settings_crawler.php:73
|
495 |
msgid "Threads"
|
496 |
msgstr ""
|
497 |
|
498 |
+
#: admin/litespeed-cache-admin.class.php:221
|
499 |
msgid ""
|
500 |
+
"If this is the case, the network admin may uncheck \"Check Advanced Cache\" "
|
501 |
+
"in LiteSpeed Cache Advanced settings."
|
502 |
msgstr ""
|
503 |
|
504 |
+
#: admin/litespeed-cache-admin.class.php:223
|
505 |
msgid ""
|
506 |
+
"If this is the case, please uncheck \"Check Advanced Cache\" in LiteSpeed "
|
507 |
+
"Cache Advanced settings."
|
508 |
msgstr ""
|
509 |
|
510 |
+
#: admin/litespeed-cache-admin.class.php:225
|
511 |
msgid ""
|
512 |
+
"LiteSpeed has detected another plugin using the \"Advanced Cache\" file."
|
|
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: admin/litespeed-cache-admin.class.php:226
|
516 |
msgid ""
|
517 |
+
"LiteSpeed Cache does work with other optimization plugins, but only if "
|
518 |
+
"functionality is not duplicated. Only one full-page cache may be activated."
|
519 |
+
msgstr ""
|
520 |
+
|
521 |
+
#: admin/tpl/api/quic.login.php:7 admin/tpl/api/quic.register.php:7
|
522 |
+
#: admin/tpl/api/quic.user_welcome.php:7
|
523 |
+
msgid "Quic Cloud User Panel"
|
524 |
+
msgstr ""
|
525 |
+
|
526 |
+
#: admin/tpl/api/quic.login.php:17 admin/tpl/api/quic.register.php:17
|
527 |
+
msgid "ERROR"
|
528 |
+
msgstr ""
|
529 |
+
|
530 |
+
#: admin/tpl/api/quic.login.php:25 admin/tpl/api/quic.register.php:25
|
531 |
+
#: admin/tpl/api/quic.user_welcome.php:15
|
532 |
+
#: admin/tpl/api/quic.user_welcome.php:16
|
533 |
+
msgid "Email"
|
534 |
+
msgstr ""
|
535 |
+
|
536 |
+
#: admin/tpl/api/quic.login.php:30 admin/tpl/api/quic.register.php:30
|
537 |
+
#: admin/tpl/setting/settings_inc.cache_object.php:90
|
538 |
+
msgid "Password"
|
539 |
+
msgstr ""
|
540 |
+
|
541 |
+
#: admin/tpl/api/quic.login.php:30
|
542 |
+
msgid "Or"
|
543 |
+
msgstr ""
|
544 |
+
|
545 |
+
#: admin/tpl/api/quic.login.php:30 admin/tpl/setting/settings_cdn.php:221
|
546 |
+
msgid "User API Key"
|
547 |
+
msgstr ""
|
548 |
+
|
549 |
+
#: admin/tpl/api/quic.login.php:34
|
550 |
+
msgid "Login"
|
551 |
+
msgstr ""
|
552 |
+
|
553 |
+
#: admin/tpl/api/quic.login.php:36 admin/tpl/api/quic.register.php:39
|
554 |
+
msgid "Back"
|
555 |
+
msgstr ""
|
556 |
+
|
557 |
+
#: admin/tpl/api/quic.register.php:37
|
558 |
+
msgid "Register"
|
559 |
+
msgstr ""
|
560 |
+
|
561 |
+
#: admin/tpl/api/quic.user_welcome.php:19
|
562 |
+
msgid "Next"
|
563 |
msgstr ""
|
564 |
|
565 |
#: admin/tpl/crawler.php:26
|
612 |
msgid "Disable"
|
613 |
msgstr ""
|
614 |
|
615 |
+
#: admin/tpl/crawler.php:92 admin/tpl/inc/check_cache_disabled.php:31
|
616 |
+
#: admin/tpl/inc/img_optm.summary.php:210 admin/tpl/manage/manage_cdn.php:15
|
617 |
#: admin/tpl/setting/settings_debug.php:105
|
618 |
#: admin/tpl/setting/settings_debug.php:138
|
619 |
+
#: admin/tpl/setting/settings_media.php:119
|
620 |
#: admin/tpl/setting/settings_optimize.php:15 admin/tpl/settings.php:161
|
621 |
msgid "WARNING"
|
622 |
msgstr ""
|
822 |
msgid "A TTL of 0 indicates do not cache."
|
823 |
msgstr ""
|
824 |
|
825 |
+
#: admin/tpl/image_optimization.php:27
|
826 |
+
msgid "LiteSpeed Cache Image Optimization"
|
827 |
msgstr ""
|
828 |
|
829 |
+
#: admin/tpl/import_export.php:9
|
830 |
+
msgid "LiteSpeed Cache Import / Export"
|
831 |
msgstr ""
|
832 |
|
833 |
+
#: admin/tpl/import_export.php:19
|
834 |
+
msgid "Export Settings"
|
835 |
msgstr ""
|
836 |
|
837 |
+
#: admin/tpl/import_export.php:22
|
838 |
+
msgid "Export"
|
839 |
msgstr ""
|
840 |
|
841 |
+
#: admin/tpl/import_export.php:27
|
842 |
+
msgid "Last exported"
|
843 |
msgstr ""
|
844 |
|
845 |
+
#: admin/tpl/import_export.php:32
|
846 |
+
msgid ""
|
847 |
+
"This will export all current LiteSpeed Cache settings and save as a file."
|
848 |
msgstr ""
|
849 |
|
850 |
+
#: admin/tpl/import_export.php:35
|
851 |
+
msgid "Import Settings"
|
852 |
msgstr ""
|
853 |
|
854 |
+
#: admin/tpl/import_export.php:44
|
855 |
+
msgid "Import"
|
856 |
msgstr ""
|
857 |
|
858 |
+
#: admin/tpl/import_export.php:50
|
859 |
+
msgid "Last imported"
|
860 |
msgstr ""
|
861 |
|
862 |
+
#: admin/tpl/import_export.php:55
|
863 |
+
msgid ""
|
864 |
+
"This will import settings from a file and override all current LiteSpeed "
|
865 |
+
"Cache settings."
|
866 |
msgstr ""
|
867 |
|
868 |
+
#: admin/tpl/inc/admin_footer.php:6
|
869 |
+
msgid "Rate %s on %s"
|
|
|
870 |
msgstr ""
|
871 |
|
872 |
+
#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.4.4) #-#-#-#-#
|
873 |
+
#. Plugin Name of the plugin/theme
|
874 |
+
#: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:353
|
875 |
+
#: includes/litespeed-cache-gui.class.php:353
|
876 |
+
msgid "LiteSpeed Cache"
|
877 |
msgstr ""
|
878 |
|
879 |
+
#: admin/tpl/inc/admin_footer.php:9
|
880 |
+
msgid "Read LiteSpeed Wiki"
|
881 |
msgstr ""
|
882 |
|
883 |
+
#: admin/tpl/inc/admin_footer.php:11
|
884 |
+
msgid "Visit LSCWP support forum"
|
885 |
msgstr ""
|
886 |
|
887 |
+
#: admin/tpl/inc/admin_footer.php:13
|
888 |
+
msgid "Join LiteSpeed Slack community"
|
889 |
msgstr ""
|
890 |
|
891 |
+
#: admin/tpl/inc/api_key.php:10
|
892 |
+
msgid "This will also generate an API key from LiteSpeed's Server."
|
893 |
msgstr ""
|
894 |
|
895 |
+
#: admin/tpl/inc/banner_promo.php:14 admin/tpl/inc/banner_promo.slack.php:13
|
896 |
+
msgid "Welcome to LiteSpeed"
|
897 |
msgstr ""
|
898 |
|
899 |
+
#: admin/tpl/inc/banner_promo.php:17
|
900 |
+
msgid "Thank you for using LiteSpeed."
|
901 |
msgstr ""
|
902 |
|
903 |
+
#: admin/tpl/inc/banner_promo.php:19
|
904 |
msgid ""
|
905 |
+
"If you have any questions, please do not hesitate to let us know in <a "
|
906 |
+
"%s>our support forum</a> or by <a %s>submitting a ticket with us</a>."
|
907 |
msgstr ""
|
908 |
|
909 |
+
#: admin/tpl/inc/banner_promo.php:26
|
910 |
+
msgid ""
|
911 |
+
"This plugin is created with love by LiteSpeed. Your rating is the simplest "
|
912 |
+
"way to support us. We really appreciate it!"
|
913 |
msgstr ""
|
914 |
|
915 |
+
#: admin/tpl/inc/banner_promo.php:29
|
916 |
+
msgid "Sure I'd love to!"
|
917 |
msgstr ""
|
918 |
|
919 |
+
#: admin/tpl/inc/banner_promo.php:30
|
920 |
+
msgid "I've already left a review"
|
921 |
msgstr ""
|
922 |
|
923 |
+
#: admin/tpl/inc/banner_promo.php:31
|
924 |
+
msgid "Maybe later"
|
925 |
msgstr ""
|
926 |
|
927 |
+
#: admin/tpl/inc/banner_promo.slack.php:21
|
928 |
+
msgid "Want to connect with other LiteSpeed users?"
|
929 |
msgstr ""
|
930 |
|
931 |
+
#: admin/tpl/inc/banner_promo.slack.php:22
|
932 |
+
msgid "Join the %s community."
|
|
|
|
|
933 |
msgstr ""
|
934 |
|
935 |
+
#: admin/tpl/inc/banner_promo.slack.php:27
|
936 |
+
msgid "Join Us on Slack"
|
937 |
msgstr ""
|
938 |
|
939 |
+
#: admin/tpl/inc/check_cache_disabled.php:8
|
940 |
+
msgid "The LSCache Module is disabled at the server level."
|
941 |
msgstr ""
|
942 |
|
943 |
+
#: admin/tpl/inc/check_cache_disabled.php:15
|
944 |
+
msgid "LiteSpeed Cache is disabled in the plugin settings."
|
|
|
|
|
945 |
msgstr ""
|
946 |
|
947 |
+
#: admin/tpl/inc/check_cache_disabled.php:22
|
948 |
+
msgid "LiteSpeed Cache is disabled."
|
949 |
msgstr ""
|
950 |
|
951 |
+
#: admin/tpl/inc/check_cache_disabled.php:34
|
952 |
+
msgid "Caching functions on this page are currently unavailable!"
|
953 |
msgstr ""
|
954 |
|
955 |
+
#: admin/tpl/inc/check_cache_disabled.php:42
|
956 |
+
msgid "Learn How to Fix It"
|
957 |
msgstr ""
|
958 |
|
959 |
+
#: admin/tpl/inc/disabled_all.php:8 admin/tpl/setting/settings_debug.php:13
|
960 |
+
msgid "Disable All Features"
|
961 |
msgstr ""
|
962 |
|
963 |
+
#: admin/tpl/inc/help_tabs.php:7
|
964 |
+
msgid "Overview"
|
965 |
msgstr ""
|
966 |
|
967 |
+
#: admin/tpl/inc/help_tabs.php:9
|
968 |
+
msgid "LiteSpeed Cache is a page cache built into LiteSpeed Web Server."
|
969 |
msgstr ""
|
970 |
|
971 |
+
#: admin/tpl/inc/help_tabs.php:10
|
972 |
+
msgid ""
|
973 |
+
"This plugin communicates with LiteSpeed Web Server to let it know which "
|
974 |
+
"pages are cacheable and when to purge them."
|
975 |
msgstr ""
|
976 |
|
977 |
+
#: admin/tpl/inc/help_tabs.php:11
|
978 |
+
msgid ""
|
979 |
+
"A LiteSpeed server (OLS, LSWS, WebADC) and its LSCache module must be "
|
980 |
+
"installed and enabled."
|
981 |
msgstr ""
|
982 |
|
983 |
+
#: admin/tpl/inc/help_tabs.php:22
|
984 |
+
msgid "For more information:"
|
985 |
msgstr ""
|
986 |
|
987 |
+
#: admin/tpl/inc/help_tabs.php:24
|
988 |
+
msgid "Support Forum"
|
989 |
msgstr ""
|
990 |
|
991 |
+
#: admin/tpl/inc/img_optm.communicate_notify.php:9
|
992 |
+
msgid ""
|
993 |
+
"This will communicate with LiteSpeed's Image Optimization Server and "
|
994 |
+
"retrieve the most recent status."
|
995 |
msgstr ""
|
996 |
|
997 |
+
#: admin/tpl/inc/img_optm.initialize.php:15
|
998 |
+
msgid "Initialize Optimization"
|
|
|
|
|
999 |
msgstr ""
|
1000 |
|
1001 |
+
#: admin/tpl/inc/img_optm.initialize.php:22
|
1002 |
+
msgid "Notes"
|
1003 |
msgstr ""
|
1004 |
|
1005 |
+
#: admin/tpl/inc/img_optm.level_info.php:32
|
1006 |
+
msgid "Level"
|
1007 |
msgstr ""
|
1008 |
|
1009 |
+
#: admin/tpl/inc/img_optm.level_info.php:34
|
1010 |
+
msgid "Credit"
|
1011 |
msgstr ""
|
1012 |
|
1013 |
+
#: admin/tpl/inc/img_optm.level_info.php:37
|
1014 |
+
msgid "Credit recovers with each successful pull."
|
1015 |
msgstr ""
|
1016 |
|
1017 |
+
#: admin/tpl/inc/img_optm.level_info.php:41
|
1018 |
+
msgid "Next Level"
|
1019 |
msgstr ""
|
1020 |
|
1021 |
+
#: admin/tpl/inc/img_optm.level_info.php:43
|
1022 |
+
msgid "Next Level Credit"
|
1023 |
msgstr ""
|
1024 |
|
1025 |
+
#: admin/tpl/inc/img_optm.percentage_summary.php:9
|
1026 |
+
msgid "Image Information"
|
|
|
|
|
1027 |
msgstr ""
|
1028 |
|
1029 |
+
#: admin/tpl/inc/img_optm.percentage_summary.php:18
|
1030 |
+
msgid "Images total"
|
1031 |
msgstr ""
|
1032 |
|
1033 |
+
#: admin/tpl/inc/img_optm.percentage_summary.php:22
|
1034 |
+
msgid "What is a group?"
|
|
|
|
|
1035 |
msgstr ""
|
1036 |
|
1037 |
+
#: admin/tpl/inc/img_optm.percentage_summary.php:26
|
1038 |
+
msgid "Images not yet requested"
|
1039 |
msgstr ""
|
1040 |
|
1041 |
+
#: admin/tpl/inc/img_optm.percentage_summary.php:29
|
1042 |
+
msgid "Congratulations, all done!"
|
1043 |
msgstr ""
|
1044 |
|
1045 |
+
#: admin/tpl/inc/img_optm.summary.php:14
|
1046 |
+
msgid "Send Optimization Request"
|
1047 |
msgstr ""
|
1048 |
|
1049 |
+
#: admin/tpl/inc/img_optm.summary.php:22
|
1050 |
msgid ""
|
1051 |
+
"This will send the optimization request and the images to LiteSpeed's Image "
|
1052 |
+
"Optimization Server."
|
1053 |
msgstr ""
|
1054 |
|
1055 |
+
#: admin/tpl/inc/img_optm.summary.php:23
|
1056 |
+
msgid "You can send at most %s images at once."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1057 |
msgstr ""
|
1058 |
|
1059 |
+
#: admin/tpl/inc/img_optm.summary.php:29
|
1060 |
+
msgid "Only press the button if the pull cron job is disabled."
|
1061 |
msgstr ""
|
1062 |
|
1063 |
+
#: admin/tpl/inc/img_optm.summary.php:29
|
1064 |
+
msgid "Images will be pulled automatically if the cron job is running."
|
1065 |
msgstr ""
|
1066 |
|
1067 |
+
#: admin/tpl/inc/img_optm.summary.php:30
|
1068 |
+
msgid "Pull Images"
|
1069 |
msgstr ""
|
1070 |
|
1071 |
+
#: admin/tpl/inc/img_optm.summary.php:39
|
1072 |
+
msgid "Current Stage Status"
|
|
|
|
|
1073 |
msgstr ""
|
1074 |
|
1075 |
+
#: admin/tpl/inc/img_optm.summary.php:52
|
1076 |
+
msgid "Images requested"
|
1077 |
msgstr ""
|
1078 |
|
1079 |
+
#: admin/tpl/inc/img_optm.summary.php:59
|
1080 |
+
msgid ""
|
1081 |
+
"After LiteSpeed's Image Optimization Server finishes optimization, it will "
|
1082 |
+
"notify your site to pull the optimized images."
|
1083 |
msgstr ""
|
1084 |
|
1085 |
+
#: admin/tpl/inc/img_optm.summary.php:60
|
1086 |
+
msgid "This process is automatic."
|
1087 |
msgstr ""
|
1088 |
|
1089 |
+
#: admin/tpl/inc/img_optm.summary.php:66
|
1090 |
+
msgid "Images notified to pull"
|
1091 |
msgstr ""
|
1092 |
|
1093 |
+
#: admin/tpl/inc/img_optm.summary.php:75
|
1094 |
+
msgid "Last pull initiated by cron at %s."
|
1095 |
msgstr ""
|
1096 |
|
1097 |
+
#: admin/tpl/inc/img_optm.summary.php:88
|
1098 |
+
msgid "Images optimized and pulled"
|
1099 |
msgstr ""
|
1100 |
|
1101 |
+
#: admin/tpl/inc/img_optm.summary.php:99 admin/tpl/inc/img_optm.summary.php:148
|
1102 |
+
msgid "Images failed to fetch"
|
1103 |
msgstr ""
|
1104 |
|
1105 |
+
#: admin/tpl/inc/img_optm.summary.php:109
|
1106 |
+
msgid "Images previously optimized"
|
1107 |
msgstr ""
|
1108 |
|
1109 |
+
#: admin/tpl/inc/img_optm.summary.php:119
|
1110 |
+
msgid "Images failed with other errors"
|
1111 |
msgstr ""
|
1112 |
|
1113 |
+
#: admin/tpl/inc/img_optm.summary.php:129
|
1114 |
+
msgid "Image files missing"
|
1115 |
msgstr ""
|
1116 |
|
1117 |
+
#: admin/tpl/inc/img_optm.summary.php:139
|
1118 |
+
msgid "Images with wrong meta"
|
1119 |
msgstr ""
|
1120 |
|
1121 |
+
#: admin/tpl/inc/img_optm.summary.php:154
|
1122 |
+
msgid "Images failed to notify"
|
1123 |
msgstr ""
|
1124 |
|
1125 |
+
#: admin/tpl/inc/img_optm.summary.php:160
|
1126 |
+
msgid "Images failed to pull"
|
1127 |
msgstr ""
|
1128 |
|
1129 |
+
#: admin/tpl/inc/img_optm.summary.php:180
|
1130 |
+
msgid "Storage Optimization"
|
1131 |
msgstr ""
|
1132 |
|
1133 |
+
#: admin/tpl/inc/img_optm.summary.php:182
|
1134 |
+
msgid "Calculate Original Image Storage"
|
|
|
1135 |
msgstr ""
|
1136 |
|
1137 |
+
#: admin/tpl/inc/img_optm.summary.php:190
|
1138 |
+
msgid "Last calculated"
|
1139 |
msgstr ""
|
1140 |
|
1141 |
+
#: admin/tpl/inc/img_optm.summary.php:194
|
1142 |
+
#: admin/tpl/inc/img_optm.summary.php:221
|
1143 |
+
msgid "Files"
|
1144 |
msgstr ""
|
1145 |
|
1146 |
+
#: admin/tpl/inc/img_optm.summary.php:197
|
1147 |
+
msgid "Total"
|
1148 |
msgstr ""
|
1149 |
|
1150 |
+
#: admin/tpl/inc/img_optm.summary.php:204
|
1151 |
+
msgid "Are you sure to remove all image backups?"
|
|
|
|
|
1152 |
msgstr ""
|
1153 |
|
1154 |
+
#: admin/tpl/inc/img_optm.summary.php:205
|
1155 |
+
msgid "Remove Original Image Backups"
|
1156 |
msgstr ""
|
1157 |
|
1158 |
+
#: admin/tpl/inc/img_optm.summary.php:208
|
1159 |
+
msgid "This will delete all of the backups of the original images."
|
|
|
|
|
|
|
1160 |
msgstr ""
|
1161 |
|
1162 |
+
#: admin/tpl/inc/img_optm.summary.php:211
|
1163 |
+
#: admin/tpl/setting/settings_media.php:120
|
1164 |
+
msgid "This is irreversible."
|
1165 |
msgstr ""
|
1166 |
|
1167 |
+
#: admin/tpl/inc/img_optm.summary.php:212
|
1168 |
+
#: admin/tpl/setting/settings_media.php:121
|
1169 |
+
msgid "You will be unable to Revert Optimization once the backups are deleted!"
|
1170 |
msgstr ""
|
1171 |
|
1172 |
+
#: admin/tpl/inc/img_optm.summary.php:218
|
1173 |
+
msgid "Last ran"
|
1174 |
msgstr ""
|
1175 |
|
1176 |
+
#: admin/tpl/inc/img_optm.summary.php:224
|
1177 |
+
msgid "Saved"
|
1178 |
msgstr ""
|
1179 |
|
1180 |
+
#: admin/tpl/inc/img_optm.summary.php:230
|
1181 |
+
msgid "A backup of each image is saved before it is optimized."
|
1182 |
msgstr ""
|
1183 |
|
1184 |
+
#: admin/tpl/inc/img_optm.summary.php:231
|
1185 |
+
msgid ""
|
1186 |
+
"The refresh button will calculate the total amount of disk space used by "
|
1187 |
+
"these backups."
|
1188 |
msgstr ""
|
1189 |
|
1190 |
+
#: admin/tpl/inc/img_optm.summary.php:246
|
1191 |
+
msgid "Optimization Summary"
|
|
|
|
|
1192 |
msgstr ""
|
1193 |
|
1194 |
+
#: admin/tpl/inc/img_optm.summary.php:247
|
1195 |
+
msgid "Update Status"
|
|
|
|
|
1196 |
msgstr ""
|
1197 |
|
1198 |
+
#: admin/tpl/inc/img_optm.summary.php:251
|
1199 |
+
msgid "Total Reduction"
|
1200 |
msgstr ""
|
1201 |
|
1202 |
+
#: admin/tpl/inc/img_optm.summary.php:254
|
1203 |
+
msgid "Images Pulled"
|
1204 |
msgstr ""
|
1205 |
|
1206 |
+
#: admin/tpl/inc/img_optm.summary.php:257
|
1207 |
+
msgid "Last Request"
|
1208 |
msgstr ""
|
1209 |
|
1210 |
+
#: admin/tpl/inc/img_optm.summary.php:262
|
1211 |
+
msgid "Revert Optimization"
|
1212 |
msgstr ""
|
1213 |
|
1214 |
+
#: admin/tpl/inc/img_optm.summary.php:265
|
1215 |
+
msgid ""
|
1216 |
+
"Switch all images in the media library back to their original unoptimized "
|
1217 |
+
"versions."
|
1218 |
msgstr ""
|
1219 |
|
1220 |
+
#: admin/tpl/inc/img_optm.summary.php:269
|
1221 |
+
msgid ""
|
1222 |
+
"The current IAPI key must be reset after changing home URL or domain before "
|
1223 |
+
"making any further optimization requests."
|
1224 |
msgstr ""
|
1225 |
|
1226 |
+
#: admin/tpl/inc/img_optm.summary.php:270
|
1227 |
+
msgid "Reset IAPI Key"
|
1228 |
msgstr ""
|
1229 |
|
1230 |
+
#: admin/tpl/inc/img_optm.summary.php:273
|
1231 |
+
msgid "Revert all optimized images back to their original versions."
|
1232 |
msgstr ""
|
1233 |
|
1234 |
+
#: admin/tpl/inc/img_optm.summary.php:274
|
1235 |
+
msgid "Undo Optimization"
|
1236 |
msgstr ""
|
1237 |
|
1238 |
+
#: admin/tpl/inc/img_optm.summary.php:277
|
1239 |
+
msgid "Switch back to using optimized images."
|
1240 |
msgstr ""
|
1241 |
|
1242 |
+
#: admin/tpl/inc/img_optm.summary.php:278
|
1243 |
+
msgid "Re-do Optimization"
|
1244 |
msgstr ""
|
1245 |
|
1246 |
+
#: admin/tpl/inc/img_optm.summary.php:281
|
1247 |
+
msgid ""
|
1248 |
+
"Scan for any new unoptimized image thumbnail sizes and resend necessary "
|
1249 |
+
"image optimization requests."
|
1250 |
msgstr ""
|
1251 |
|
1252 |
+
#: admin/tpl/inc/img_optm.summary.php:282
|
1253 |
+
msgid "Send New Thumbnail Requests"
|
1254 |
msgstr ""
|
1255 |
|
1256 |
+
#: admin/tpl/inc/img_optm.summary.php:286
|
1257 |
+
msgid "Results can be checked in <a %s>Media Library</a>."
|
1258 |
msgstr ""
|
1259 |
|
1260 |
+
#: admin/tpl/inc/img_optm.summary.php:300
|
1261 |
+
msgid "Destroy All Optimization Data!"
|
|
|
|
|
1262 |
msgstr ""
|
1263 |
|
1264 |
+
#: admin/tpl/inc/img_optm.summary.php:304
|
1265 |
msgid ""
|
1266 |
+
"Remove all previous image optimization requests/results, revert completed "
|
1267 |
+
"optimizations, and delete all optimization files."
|
1268 |
msgstr ""
|
1269 |
|
1270 |
+
#: admin/tpl/inc/img_optm.summary.php:306
|
1271 |
+
#: admin/tpl/setting/settings_advanced.php:65
|
1272 |
+
#: admin/tpl/setting/settings_cdn.php:98
|
1273 |
+
#: admin/tpl/setting/settings_crawler.php:22
|
1274 |
+
#: admin/tpl/setting/settings_crawler.php:95
|
1275 |
+
#: admin/tpl/setting/settings_crawler.php:100
|
1276 |
+
#: admin/tpl/setting/settings_excludes.php:84
|
1277 |
+
#: admin/tpl/setting/settings_excludes.php:122
|
1278 |
+
#: admin/tpl/setting/settings_inc.cache_browser.php:12
|
1279 |
+
#: admin/tpl/setting/settings_inc.cache_favicon.php:13
|
1280 |
+
#: admin/tpl/setting/settings_inc.cache_mobile.php:17
|
1281 |
+
#: admin/tpl/setting/settings_inc.cache_mobile.php:66
|
1282 |
+
#: admin/tpl/setting/settings_inc.cache_resources.php:14
|
1283 |
+
#: admin/tpl/setting/settings_inc.exclude_cookies.php:22
|
1284 |
+
#: admin/tpl/setting/settings_inc.exclude_useragent.php:21
|
1285 |
+
#: admin/tpl/setting/settings_inc.media_webp.php:12
|
1286 |
+
#: admin/tpl/setting/settings_optimize.php:222
|
1287 |
+
#: admin/tpl/setting/settings_tuning.php:20
|
1288 |
+
#: admin/tpl/setting/settings_tuning.php:56
|
1289 |
+
msgid "NOTE"
|
1290 |
msgstr ""
|
1291 |
|
1292 |
+
#: admin/tpl/inc/img_optm.summary.php:307
|
1293 |
+
msgid "This will also reset the credit level."
|
1294 |
msgstr ""
|
1295 |
|
1296 |
#: admin/tpl/inc/show_display_installed.php:5
|
1372 |
"dismissed. (<a %3$s>Learn More</a>)"
|
1373 |
msgstr ""
|
1374 |
|
1375 |
+
#: admin/tpl/manage/manage_cdn.php:11 inc/gui.class.php:412
|
1376 |
+
#: includes/litespeed-cache-gui.class.php:412
|
1377 |
msgid "Cloudflare"
|
1378 |
msgstr ""
|
1379 |
|
1562 |
#: admin/tpl/manage/manage_purge.php:39 admin/tpl/manage/manage_purge.php:45
|
1563 |
#: admin/tpl/manage/manage_purge.php:54 admin/tpl/manage/manage_purge.php:63
|
1564 |
#: admin/tpl/manage/manage_purge.php:72 admin/tpl/manage/manage_purge.php:81
|
1565 |
+
#: inc/gui.class.php:387 inc/gui.class.php:395 inc/gui.class.php:403
|
1566 |
+
#: inc/gui.class.php:412 inc/gui.class.php:422 inc/gui.class.php:432
|
1567 |
+
#: inc/gui.class.php:442 includes/litespeed-cache-gui.class.php:387
|
1568 |
+
#: includes/litespeed-cache-gui.class.php:395
|
1569 |
+
#: includes/litespeed-cache-gui.class.php:403
|
1570 |
+
#: includes/litespeed-cache-gui.class.php:412
|
1571 |
+
#: includes/litespeed-cache-gui.class.php:422
|
1572 |
+
#: includes/litespeed-cache-gui.class.php:432
|
1573 |
+
#: includes/litespeed-cache-gui.class.php:442
|
1574 |
msgid "Purge All"
|
1575 |
msgstr ""
|
1576 |
|
1578 |
msgid "Purge the litespeed cache entries created by this plugin"
|
1579 |
msgstr ""
|
1580 |
|
1581 |
+
#: admin/tpl/manage/manage_purge.php:45 inc/gui.class.php:403
|
1582 |
+
#: includes/litespeed-cache-gui.class.php:403
|
1583 |
msgid "CSS/JS Cache"
|
1584 |
msgstr ""
|
1585 |
|
1588 |
msgstr ""
|
1589 |
|
1590 |
#: admin/tpl/manage/manage_purge.php:54
|
1591 |
+
#: admin/tpl/setting/settings_inc.cache_object.php:28 inc/gui.class.php:422
|
1592 |
+
#: includes/litespeed-cache-gui.class.php:422
|
1593 |
msgid "Object Cache"
|
1594 |
msgstr ""
|
1595 |
|
1597 |
msgid "Purge all the object caches"
|
1598 |
msgstr ""
|
1599 |
|
1600 |
+
#: admin/tpl/manage/manage_purge.php:63 inc/gui.class.php:432
|
1601 |
+
#: includes/litespeed-cache-gui.class.php:432
|
1602 |
msgid "Opcode Cache"
|
1603 |
msgstr ""
|
1604 |
|
1606 |
msgid "Reset the entire opcode cache"
|
1607 |
msgstr ""
|
1608 |
|
1609 |
+
#: admin/tpl/manage/manage_purge.php:72 inc/gui.class.php:442
|
1610 |
+
#: includes/litespeed-cache-gui.class.php:442
|
1611 |
msgid "Critical CSS"
|
1612 |
msgstr ""
|
1613 |
|
1674 |
#: admin/tpl/setting/settings_inc.cache_object.php:122
|
1675 |
#: admin/tpl/setting/settings_inc.exclude_cookies.php:19
|
1676 |
#: admin/tpl/setting/settings_media.php:34
|
1677 |
+
#: admin/tpl/setting/settings_media.php:177
|
1678 |
#: admin/tpl/setting/settings_optimize.php:236
|
1679 |
#: admin/tpl/setting/settings_purge.php:85
|
1680 |
#: admin/tpl/setting/settings_tuning.php:38
|
1729 |
msgid "DB Optimizer"
|
1730 |
msgstr ""
|
1731 |
|
1732 |
+
#: admin/tpl/manage.php:10 admin/tpl/setting/settings_cdn.php:240
|
1733 |
+
#: admin/tpl/settings.php:12
|
1734 |
msgid "CDN"
|
1735 |
msgstr ""
|
1736 |
|
2143 |
msgstr ""
|
2144 |
|
2145 |
#: admin/tpl/setting/settings_cdn.php:195
|
2146 |
+
#: admin/tpl/setting/settings_cdn.php:239
|
2147 |
msgid "Use %s API functionality."
|
2148 |
msgstr ""
|
2149 |
|
2150 |
+
#: admin/tpl/setting/settings_cdn.php:212
|
2151 |
+
#: admin/tpl/setting/settings_cdn.php:244
|
|
|
|
|
|
|
|
|
|
|
2152 |
msgid "Email Address"
|
2153 |
msgstr ""
|
2154 |
|
2155 |
+
#: admin/tpl/setting/settings_cdn.php:216
|
2156 |
+
#: admin/tpl/setting/settings_cdn.php:248
|
2157 |
msgid "Your Email address on %s."
|
2158 |
msgstr ""
|
2159 |
|
2160 |
+
#: admin/tpl/setting/settings_cdn.php:225
|
2161 |
+
#: admin/tpl/setting/settings_cdn.php:257
|
|
|
|
|
|
|
|
|
2162 |
msgid "Your API key is used to access %s APIs."
|
2163 |
msgstr ""
|
2164 |
|
2165 |
+
#: admin/tpl/setting/settings_cdn.php:226
|
2166 |
+
#: admin/tpl/setting/settings_cdn.php:258
|
2167 |
msgid "Get it from <a %1$s>%2$s</a>."
|
2168 |
msgstr ""
|
2169 |
|
2170 |
+
#: admin/tpl/setting/settings_cdn.php:235
|
2171 |
+
msgid "Cloudflare API"
|
2172 |
msgstr ""
|
2173 |
|
2174 |
+
#: admin/tpl/setting/settings_cdn.php:240
|
2175 |
+
msgid "This can be managed from <a %2$s>%1$s</a>."
|
|
|
2176 |
msgstr ""
|
2177 |
|
2178 |
+
#: admin/tpl/setting/settings_cdn.php:253
|
2179 |
+
msgid "Global API Key"
|
|
|
|
|
|
|
2180 |
msgstr ""
|
2181 |
|
2182 |
+
#: admin/tpl/setting/settings_cdn.php:263
|
2183 |
+
msgid "Domain"
|
2184 |
msgstr ""
|
2185 |
|
2186 |
+
#: admin/tpl/setting/settings_cdn.php:271
|
2187 |
+
msgid "You can just type part of the domain."
|
2188 |
msgstr ""
|
2189 |
|
2190 |
+
#: admin/tpl/setting/settings_cdn.php:272
|
2191 |
+
msgid ""
|
2192 |
+
"Once saved, it will be matched with the current list and completed "
|
2193 |
+
"automatically."
|
2194 |
msgstr ""
|
2195 |
|
2196 |
#: admin/tpl/setting/settings_compatibilities.php:7
|
2931 |
msgid "Only available when %s is installed."
|
2932 |
msgstr ""
|
2933 |
|
|
|
|
|
|
|
|
|
2934 |
#: admin/tpl/setting/settings_inc.cache_object.php:94
|
2935 |
msgid "Specify the password used when connecting."
|
2936 |
msgstr ""
|
3011 |
#: admin/tpl/setting/settings_inc.check_adv_file.php:14
|
3012 |
msgid ""
|
3013 |
"When this option is checked and this file is detected as belonging to "
|
3014 |
+
"another plugin, LiteSpeed's caching functionality will not work."
|
3015 |
msgstr ""
|
3016 |
|
3017 |
#: admin/tpl/setting/settings_inc.check_adv_file.php:17
|
3018 |
msgid ""
|
3019 |
+
"You may need to uncheck this option if you are using multiple optimization "
|
3020 |
+
"plugins."
|
3021 |
msgstr ""
|
3022 |
|
3023 |
#: admin/tpl/setting/settings_inc.exclude_cookies.php:6
|
3227 |
msgstr ""
|
3228 |
|
3229 |
#: admin/tpl/setting/settings_media.php:69
|
3230 |
+
msgid "Inline Lazy Load Images Library"
|
3231 |
msgstr ""
|
3232 |
|
3233 |
#: admin/tpl/setting/settings_media.php:73
|
3234 |
+
msgid "Include the lazy load image Javascript library inline."
|
3235 |
+
msgstr ""
|
3236 |
+
|
3237 |
+
#: admin/tpl/setting/settings_media.php:74
|
3238 |
+
#: admin/tpl/setting/settings_optimize.php:137
|
3239 |
+
#: admin/tpl/setting/settings_optimize.php:210
|
3240 |
+
#: admin/tpl/setting/settings_optimize.php:248
|
3241 |
+
#: admin/tpl/setting/settings_tuning.php:103
|
3242 |
+
#: admin/tpl/setting/settings_tuning.php:162
|
3243 |
+
msgid ""
|
3244 |
+
"This can improve your speed score in services like Pingdom, GTmetrix and "
|
3245 |
+
"PageSpeed."
|
3246 |
+
msgstr ""
|
3247 |
+
|
3248 |
+
#: admin/tpl/setting/settings_media.php:81
|
3249 |
+
msgid "Optimize Automatically"
|
3250 |
+
msgstr ""
|
3251 |
+
|
3252 |
+
#: admin/tpl/setting/settings_media.php:85
|
3253 |
+
msgid "Automatically request optimization via cron job."
|
3254 |
+
msgstr ""
|
3255 |
+
|
3256 |
+
#: admin/tpl/setting/settings_media.php:86
|
3257 |
+
msgid "Requests can only be sent when recovered credits is %s or more."
|
3258 |
msgstr ""
|
3259 |
|
3260 |
+
#: admin/tpl/setting/settings_media.php:92
|
3261 |
msgid "Optimization Cron"
|
3262 |
msgstr ""
|
3263 |
|
3264 |
+
#: admin/tpl/setting/settings_media.php:96
|
3265 |
msgid ""
|
3266 |
"Disabling this will stop the cron job responsible for fetching optimized "
|
3267 |
"images from LiteSpeed's Image Server."
|
3268 |
msgstr ""
|
3269 |
|
3270 |
+
#: admin/tpl/setting/settings_media.php:102
|
3271 |
msgid "Optimize Original Images"
|
3272 |
msgstr ""
|
3273 |
|
3274 |
+
#: admin/tpl/setting/settings_media.php:106
|
3275 |
msgid "Optimize images and save backups of the originals in the same folder."
|
3276 |
msgstr ""
|
3277 |
|
3278 |
+
#: admin/tpl/setting/settings_media.php:112
|
3279 |
+
msgid "Remove Original Backups"
|
3280 |
+
msgstr ""
|
3281 |
+
|
3282 |
+
#: admin/tpl/setting/settings_media.php:116
|
3283 |
+
msgid ""
|
3284 |
+
"Automatically remove the original image backups after fetching optimized "
|
3285 |
+
"images."
|
3286 |
+
msgstr ""
|
3287 |
+
|
3288 |
+
#: admin/tpl/setting/settings_media.php:128
|
3289 |
msgid "Optimize WebP Versions"
|
3290 |
msgstr ""
|
3291 |
|
3292 |
+
#: admin/tpl/setting/settings_media.php:132
|
3293 |
msgid "Request WebP versions of original images when doing optimization."
|
3294 |
msgstr ""
|
3295 |
|
3296 |
+
#: admin/tpl/setting/settings_media.php:138
|
3297 |
msgid "Optimize Losslessly"
|
3298 |
msgstr ""
|
3299 |
|
3300 |
+
#: admin/tpl/setting/settings_media.php:142
|
3301 |
msgid "Optimize images using lossless compression."
|
3302 |
msgstr ""
|
3303 |
|
3304 |
+
#: admin/tpl/setting/settings_media.php:143
|
3305 |
msgid ""
|
3306 |
"This can improve quality but may result in larger images than lossy "
|
3307 |
"compression will."
|
3308 |
msgstr ""
|
3309 |
|
3310 |
+
#: admin/tpl/setting/settings_media.php:149
|
3311 |
msgid "Preserve EXIF data"
|
3312 |
msgstr ""
|
3313 |
|
3314 |
+
#: admin/tpl/setting/settings_media.php:153
|
3315 |
msgid ""
|
3316 |
"Preserve EXIF data (copyright, GPS, comments, keywords, etc) when optimizing."
|
3317 |
msgstr ""
|
3318 |
|
3319 |
+
#: admin/tpl/setting/settings_media.php:154
|
3320 |
msgid "This will increase the size of optimized files."
|
3321 |
msgstr ""
|
3322 |
|
3323 |
+
#: admin/tpl/setting/settings_media.php:168
|
3324 |
msgid "WebP Attribute To Replace"
|
3325 |
msgstr ""
|
3326 |
|
3327 |
+
#: admin/tpl/setting/settings_media.php:174
|
3328 |
msgid "Specify which element attributes will be replaced with WebP."
|
3329 |
msgstr ""
|
3330 |
|
3331 |
+
#: admin/tpl/setting/settings_media.php:175
|
3332 |
msgid "Only attributes listed here will be replaced."
|
3333 |
msgstr ""
|
3334 |
|
3335 |
+
#: admin/tpl/setting/settings_media.php:176
|
3336 |
msgid "Use the format %1$s or %2$s (element is optional)."
|
3337 |
msgstr ""
|
3338 |
|
3339 |
+
#: admin/tpl/setting/settings_media.php:183
|
3340 |
msgid "WebP For Extra srcset"
|
3341 |
msgstr ""
|
3342 |
|
3343 |
+
#: admin/tpl/setting/settings_media.php:187
|
3344 |
msgid ""
|
3345 |
"Enable replacement of WebP in %s elements that were generated outside of "
|
3346 |
"WordPress logic."
|
3464 |
msgid "Optimize CSS delivery."
|
3465 |
msgstr ""
|
3466 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3467 |
#: admin/tpl/setting/settings_optimize.php:138
|
3468 |
msgid ""
|
3469 |
"When this option is turned %s, it will also load Google Fonts asynchronously."
|
3541 |
|
3542 |
#: admin/tpl/setting/settings_optimize.php:223
|
3543 |
msgid ""
|
3544 |
+
"If there is any JS error related to %1$s when enabled %2$s, please turn on "
|
3545 |
+
"this option."
|
3546 |
msgstr ""
|
3547 |
|
3548 |
#: admin/tpl/setting/settings_optimize.php:230
|
3910 |
msgid "Failed to communicate with Cloudflare"
|
3911 |
msgstr ""
|
3912 |
|
3913 |
+
#: inc/crawler.class.php:98 includes/litespeed-cache-crawler.class.php:98
|
3914 |
msgid "Can not find any form data for blacklist"
|
3915 |
msgstr ""
|
3916 |
|
3917 |
+
#: inc/crawler.class.php:113 includes/litespeed-cache-crawler.class.php:113
|
3918 |
msgid "File saved successfully: %s"
|
3919 |
msgstr ""
|
3920 |
|
3921 |
+
#: inc/crawler.class.php:164 includes/litespeed-cache-crawler.class.php:164
|
3922 |
msgid "File created successfully: %s"
|
3923 |
msgstr ""
|
3924 |
|
3925 |
+
#: inc/crawler.class.php:322 includes/litespeed-cache-crawler.class.php:322
|
3926 |
msgid "Failed to send position reset notification: %s"
|
3927 |
msgstr ""
|
3928 |
|
3929 |
+
#: inc/crawler.class.php:326 includes/litespeed-cache-crawler.class.php:326
|
3930 |
msgid "Position reset notification sent successfully"
|
3931 |
msgstr ""
|
3932 |
|
3933 |
+
#: inc/crawler.class.php:476 includes/litespeed-cache-crawler.class.php:476
|
3934 |
#: lib/litespeed/litespeed-crawler.class.php:402
|
3935 |
msgid "Crawler %s reached end of sitemap file."
|
3936 |
msgstr ""
|
3937 |
|
3938 |
+
#: inc/crawler.class.php:506 inc/crawler.class.php:510
|
|
|
3939 |
#: includes/litespeed-cache-crawler.class.php:506
|
3940 |
+
#: includes/litespeed-cache-crawler.class.php:510
|
3941 |
msgid "Guest"
|
3942 |
msgstr ""
|
3943 |
|
3944 |
+
#: inc/doc.cls.php:27
|
3945 |
msgid ""
|
3946 |
"This site utilizes caching in order to facilitate a faster response time and "
|
3947 |
"better user experience. Caching potentially stores a duplicate copy of every "
|
3952 |
"admin before their natural expiration, if necessary."
|
3953 |
msgstr ""
|
3954 |
|
3955 |
+
#: inc/gui.class.php:282 includes/litespeed-cache-gui.class.php:282
|
3956 |
msgid "Purge this page"
|
3957 |
msgstr ""
|
3958 |
|
3959 |
+
#: inc/gui.class.php:290 includes/litespeed-cache-gui.class.php:290
|
3960 |
msgid "Mark this page as "
|
3961 |
msgstr ""
|
3962 |
|
3963 |
+
#: inc/gui.class.php:297 includes/litespeed-cache-gui.class.php:297
|
3964 |
msgid "Forced cacheable"
|
3965 |
msgstr ""
|
3966 |
|
3967 |
+
#: inc/gui.class.php:304 includes/litespeed-cache-gui.class.php:304
|
3968 |
msgid "Non cacheable"
|
3969 |
msgstr ""
|
3970 |
|
3971 |
+
#: inc/gui.class.php:311 includes/litespeed-cache-gui.class.php:311
|
3972 |
msgid "Private cache"
|
3973 |
msgstr ""
|
3974 |
|
3975 |
+
#: inc/gui.class.php:318 includes/litespeed-cache-gui.class.php:318
|
3976 |
msgid "No optimization"
|
3977 |
msgstr ""
|
3978 |
|
3979 |
+
#: inc/gui.class.php:325 includes/litespeed-cache-gui.class.php:325
|
3980 |
msgid "More settings"
|
3981 |
msgstr ""
|
3982 |
|
3983 |
+
#: inc/gui.class.php:345 includes/litespeed-cache-gui.class.php:345
|
3984 |
msgid "LiteSpeed Cache Purge All"
|
3985 |
msgstr ""
|
3986 |
|
3987 |
+
#: inc/gui.class.php:345 inc/gui.class.php:395
|
3988 |
+
#: includes/litespeed-cache-gui.class.php:345
|
3989 |
+
#: includes/litespeed-cache-gui.class.php:395
|
3990 |
msgid "LSCache"
|
3991 |
msgstr ""
|
3992 |
|
3993 |
+
#: inc/gui.class.php:460 includes/litespeed-cache-gui.class.php:460
|
3994 |
+
msgid "Remove all previous unfinished image optimization requests."
|
3995 |
+
msgstr ""
|
3996 |
+
|
3997 |
+
#: inc/gui.class.php:461 includes/litespeed-cache-gui.class.php:461
|
3998 |
+
msgid "Clean Up Unfinished Data"
|
3999 |
+
msgstr ""
|
4000 |
+
|
4001 |
+
#: inc/gui.class.php:480 includes/litespeed-cache-gui.class.php:480
|
4002 |
+
msgid "Install %s"
|
4003 |
+
msgstr ""
|
4004 |
+
|
4005 |
+
#: inc/gui.class.php:481 includes/litespeed-cache-gui.class.php:481
|
4006 |
+
msgid "Install Now"
|
4007 |
+
msgstr ""
|
4008 |
+
|
4009 |
+
#: inc/gui.class.php:501 includes/litespeed-cache-gui.class.php:501
|
4010 |
+
msgid ""
|
4011 |
+
"<a href=\"%1$s\" %2$s>View version %3$s details</a> or <a href=\"%4$s\" %5$s "
|
4012 |
+
"target=\"_blank\">update now</a>."
|
4013 |
+
msgstr ""
|
4014 |
+
|
4015 |
+
#: inc/gui.class.php:504 includes/litespeed-cache-gui.class.php:504
|
4016 |
+
msgid "View %1$s version %2$s details"
|
4017 |
+
msgstr ""
|
4018 |
+
|
4019 |
+
#: inc/gui.class.php:509 includes/litespeed-cache-gui.class.php:509
|
4020 |
+
msgid "Update %s now"
|
4021 |
msgstr ""
|
4022 |
|
4023 |
+
#: inc/img_optm.class.php:113
|
4024 |
msgid "Communicated with LiteSpeed Image Optimization Server successfully."
|
4025 |
msgstr ""
|
4026 |
|
4027 |
+
#: inc/img_optm.class.php:166 inc/img_optm.class.php:1467
|
4028 |
+
#: inc/img_optm.class.php:1532
|
4029 |
msgid "No image found."
|
4030 |
msgstr ""
|
4031 |
|
4032 |
+
#: inc/img_optm.class.php:194
|
4033 |
msgid "Number of images in one image group (%s) exceeds the credit (%s)"
|
4034 |
msgstr ""
|
4035 |
|
4036 |
+
#: inc/img_optm.class.php:222
|
4037 |
msgid "Requested successfully."
|
4038 |
msgstr ""
|
4039 |
|
4040 |
+
#: inc/img_optm.class.php:242
|
4041 |
msgid "Optimized successfully."
|
4042 |
msgstr ""
|
4043 |
|
4044 |
+
#: inc/img_optm.class.php:299
|
4045 |
msgid "Pushed %1$s to LiteSpeed optimization server, accepted %2$s."
|
4046 |
msgstr ""
|
4047 |
|
4048 |
+
#: inc/img_optm.class.php:686
|
4049 |
+
msgid "Failed to parse data from LiteSpeed IAPI server: %s"
|
4050 |
msgstr ""
|
4051 |
|
4052 |
+
#: inc/img_optm.class.php:1030
|
4053 |
+
msgid ""
|
4054 |
+
"LSCWP %1$s has simplified the image pulling process. Please %2$s, or resend "
|
4055 |
+
"the pull notification this one time only. After that, the process will be "
|
4056 |
+
"automated."
|
4057 |
msgstr ""
|
4058 |
|
4059 |
+
#: inc/img_optm.class.php:1357
|
4060 |
msgid "Destroy unfinished data successfully."
|
4061 |
msgstr ""
|
4062 |
|
4063 |
+
#: inc/img_optm.class.php:1570
|
4064 |
msgid ""
|
4065 |
"Pushed %1$s groups with %2$s images to LiteSpeed optimization server, "
|
4066 |
"accepted %3$s groups with %4$s images."
|
4067 |
msgstr ""
|
4068 |
|
4069 |
+
#: inc/img_optm.class.php:1735
|
4070 |
msgid "Removed %1$s images and saved %2$s successfully."
|
4071 |
msgstr ""
|
4072 |
|
4073 |
+
#: inc/img_optm.class.php:1929
|
4074 |
msgid "Switched images successfully."
|
4075 |
msgstr ""
|
4076 |
|
4077 |
+
#: inc/img_optm.class.php:1960
|
4078 |
msgid "Disabled WebP file successfully."
|
4079 |
msgstr ""
|
4080 |
|
4081 |
+
#: inc/img_optm.class.php:1966
|
4082 |
msgid "Enabled WebP file successfully."
|
4083 |
msgstr ""
|
4084 |
|
4085 |
+
#: inc/img_optm.class.php:1982
|
4086 |
msgid "Restored original file successfully."
|
4087 |
msgstr ""
|
4088 |
|
4089 |
+
#: inc/img_optm.class.php:1989
|
4090 |
msgid "Switched to optimized file successfully."
|
4091 |
msgstr ""
|
4092 |
|
4093 |
+
#: inc/img_optm.class.php:2049
|
4094 |
+
msgid "Reset the optimized data successfully."
|
4095 |
+
msgstr ""
|
4096 |
+
|
4097 |
+
#: inc/import.class.php:140
|
4098 |
msgid "Import failed due to file error."
|
4099 |
msgstr ""
|
4100 |
|
4101 |
+
#: inc/import.class.php:184
|
4102 |
msgid "Imported setting file %s successfully."
|
4103 |
msgstr ""
|
4104 |
|
4105 |
+
#: inc/litespeed-cache.class.php:269 includes/litespeed-cache.class.php:269
|
4106 |
msgid "Crawler blacklist is saved."
|
4107 |
msgstr ""
|
4108 |
|
4109 |
+
#: inc/litespeed-cache.class.php:280 includes/litespeed-cache.class.php:280
|
4110 |
msgid "Notified LiteSpeed Web Server to purge everything."
|
4111 |
msgstr ""
|
4112 |
|
4113 |
+
#: inc/litespeed-cache.class.php:290 includes/litespeed-cache.class.php:290
|
4114 |
msgid "Notified LiteSpeed Web Server to purge the list."
|
4115 |
msgstr ""
|
4116 |
|
4117 |
+
#: inc/media.class.php:132
|
4118 |
msgid "LiteSpeed Optimization"
|
4119 |
msgstr ""
|
4120 |
|
4121 |
+
#: inc/media.class.php:158
|
4122 |
+
msgid "WebP saved %s"
|
4123 |
msgstr ""
|
4124 |
|
4125 |
+
#: inc/media.class.php:165
|
4126 |
+
msgid "Click to Disable WebP"
|
4127 |
msgstr ""
|
4128 |
|
4129 |
+
#: inc/media.class.php:170
|
4130 |
+
msgid "Click to Enable WebP"
|
4131 |
msgstr ""
|
4132 |
|
4133 |
+
#: inc/media.class.php:191
|
4134 |
+
msgid "Original saved %s"
|
4135 |
msgstr ""
|
4136 |
|
4137 |
+
#: inc/media.class.php:202
|
4138 |
+
msgid "Click to Restore Original File"
|
4139 |
msgstr ""
|
4140 |
|
4141 |
+
#: inc/media.class.php:207
|
4142 |
+
msgid "Click to Switch To Optimized File"
|
4143 |
+
msgstr ""
|
4144 |
+
|
4145 |
+
#: inc/media.class.php:226
|
4146 |
+
msgid "Reset"
|
4147 |
msgstr ""
|
4148 |
|
4149 |
+
#: inc/purge.class.php:157 includes/litespeed-cache-purge.class.php:157
|
4150 |
msgid "Purged all caches successfully."
|
4151 |
msgstr ""
|
4152 |
|
4153 |
+
#: inc/purge.class.php:180 includes/litespeed-cache-purge.class.php:180
|
4154 |
msgid "Notified LiteSpeed Web Server to purge all LSCache entries."
|
4155 |
msgstr ""
|
4156 |
|
4157 |
+
#: inc/purge.class.php:196 includes/litespeed-cache-purge.class.php:196
|
4158 |
msgid "Cleaned all critical CSS files."
|
4159 |
msgstr ""
|
4160 |
|
4161 |
+
#: inc/purge.class.php:217 includes/litespeed-cache-purge.class.php:217
|
4162 |
msgid "Notified LiteSpeed Web Server to purge CSS/JS entries."
|
4163 |
msgstr ""
|
4164 |
|
4165 |
+
#: inc/purge.class.php:234 includes/litespeed-cache-purge.class.php:234
|
4166 |
msgid "Opcode cache is not enabled."
|
4167 |
msgstr ""
|
4168 |
|
4169 |
+
#: inc/purge.class.php:246 includes/litespeed-cache-purge.class.php:246
|
4170 |
msgid "Reset the entire opcode cache successfully."
|
4171 |
msgstr ""
|
4172 |
|
4173 |
+
#: inc/purge.class.php:265 includes/litespeed-cache-purge.class.php:265
|
4174 |
msgid "Object cache is not enabled."
|
4175 |
msgstr ""
|
4176 |
|
4177 |
+
#: inc/purge.class.php:275 includes/litespeed-cache-purge.class.php:275
|
4178 |
msgid "Purge all object caches successfully."
|
4179 |
msgstr ""
|
4180 |
|
4181 |
+
#: inc/purge.class.php:427 includes/litespeed-cache-purge.class.php:427
|
4182 |
msgid "Notified LiteSpeed Web Server to purge the front page."
|
4183 |
msgstr ""
|
4184 |
|
4185 |
+
#: inc/purge.class.php:441 includes/litespeed-cache-purge.class.php:441
|
4186 |
msgid "Notified LiteSpeed Web Server to purge pages."
|
4187 |
msgstr ""
|
4188 |
|
4189 |
+
#: inc/purge.class.php:461 includes/litespeed-cache-purge.class.php:461
|
4190 |
msgid "Notified LiteSpeed Web Server to purge error pages."
|
4191 |
msgstr ""
|
4192 |
|
4193 |
+
#: inc/purge.class.php:489 includes/litespeed-cache-purge.class.php:489
|
4194 |
msgid "Purge category %s"
|
4195 |
msgstr ""
|
4196 |
|
4197 |
+
#: inc/purge.class.php:516 includes/litespeed-cache-purge.class.php:516
|
4198 |
msgid "Purge Post ID %s"
|
4199 |
msgstr ""
|
4200 |
|
4201 |
+
#: inc/purge.class.php:545 includes/litespeed-cache-purge.class.php:545
|
4202 |
msgid "Purge tag %s"
|
4203 |
msgstr ""
|
4204 |
|
4205 |
+
#: inc/purge.class.php:579 includes/litespeed-cache-purge.class.php:579
|
4206 |
msgid "Purge url %s"
|
4207 |
msgstr ""
|
4208 |
|
4209 |
+
#: inc/task.class.php:193 includes/litespeed-cache-task.class.php:193
|
4210 |
msgid "LiteSpeed Cache Custom Cron Common"
|
4211 |
msgstr ""
|
4212 |
|
4213 |
+
#: inc/task.class.php:214 includes/litespeed-cache-task.class.php:214
|
4214 |
msgid "LiteSpeed Cache Custom Cron Crawler"
|
4215 |
msgstr ""
|
4216 |
|
4217 |
+
#: inc/utility.class.php:68 includes/litespeed-cache-utility.class.php:68
|
4218 |
msgid "just now"
|
4219 |
msgstr ""
|
4220 |
|
4221 |
+
#: inc/utility.class.php:68 includes/litespeed-cache-utility.class.php:68
|
4222 |
msgid "right now"
|
4223 |
msgstr ""
|
4224 |
|
4225 |
+
#: inc/utility.class.php:71 includes/litespeed-cache-utility.class.php:71
|
4226 |
msgid " %s ago"
|
4227 |
msgstr ""
|
4228 |
|
4357 |
msgstr ""
|
4358 |
|
4359 |
#. Description of the plugin/theme
|
4360 |
+
msgid "High-performance page caching and site optimization from LiteSpeed"
|
4361 |
msgstr ""
|
4362 |
|
4363 |
#. Author of the plugin/theme
|
litespeed-cache.php
CHANGED
@@ -14,8 +14,8 @@
|
|
14 |
* @wordpress-plugin
|
15 |
* Plugin Name: LiteSpeed Cache
|
16 |
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
|
17 |
-
* Description:
|
18 |
-
* Version: 2.4
|
19 |
* Author: LiteSpeed Technologies
|
20 |
* Author URI: https://www.litespeedtech.com
|
21 |
* License: GPLv3
|
@@ -77,6 +77,7 @@ if ( ( defined( 'WP_CLI' ) && WP_CLI ) || PHP_SAPI == 'cli' ) {
|
|
77 |
if ( method_exists( 'WP_CLI', 'add_command' ) ) {
|
78 |
WP_CLI::add_command( 'lscache-admin', 'LiteSpeed_Cache_Cli_Admin' ) ;
|
79 |
WP_CLI::add_command( 'lscache-purge', 'LiteSpeed_Cache_Cli_Purge' ) ;
|
|
|
80 |
}
|
81 |
}
|
82 |
|
14 |
* @wordpress-plugin
|
15 |
* Plugin Name: LiteSpeed Cache
|
16 |
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
|
17 |
+
* Description: High-performance page caching and site optimization from LiteSpeed
|
18 |
+
* Version: 2.4.4
|
19 |
* Author: LiteSpeed Technologies
|
20 |
* Author URI: https://www.litespeedtech.com
|
21 |
* License: GPLv3
|
77 |
if ( method_exists( 'WP_CLI', 'add_command' ) ) {
|
78 |
WP_CLI::add_command( 'lscache-admin', 'LiteSpeed_Cache_Cli_Admin' ) ;
|
79 |
WP_CLI::add_command( 'lscache-purge', 'LiteSpeed_Cache_Cli_Purge' ) ;
|
80 |
+
WP_CLI::add_command( 'lscache-iapi', 'LiteSpeed_Cache_CLI_IAPI' ) ;
|
81 |
}
|
82 |
}
|
83 |
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== LiteSpeed Cache ===
|
2 |
Contributors: LiteSpeedTech
|
3 |
-
Tags:
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 4.9.
|
6 |
-
Stable tag: 2.4
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl.html
|
9 |
|
@@ -267,13 +267,65 @@ Click on the `Advanced View` link at the top of the page, and several more tabs
|
|
267 |
|
268 |
== Changelog ==
|
269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
= 2.4 - Jul 2 2018 =
|
271 |
-
* [NEW FEATURE] <strong>
|
272 |
-
* [NEW FEATURE] <strong>
|
273 |
-
* [NEW FEATURE] <strong>
|
274 |
-
* [IMPROVEMENT] <strong>
|
275 |
-
* [IMPROVEMENT] <strong>
|
276 |
-
* [IMPROVEMENT] <strong>
|
277 |
* [REFACTOR] <strong>Config</strong> Separated configure const class.
|
278 |
* [BUGFIX] <strong>Report</strong> Report can be sent successfully with emoji now. (@music47ell)
|
279 |
* [IAPI] New Europe Image Optimization server (EU3/EU4).
|
@@ -286,10 +338,10 @@ Click on the `Advanced View` link at the top of the page, and several more tabs
|
|
286 |
* <strong>We strongly recommended that you re-optimize your image library to get a better compression result</strong>.
|
287 |
|
288 |
= 2.3.1 - Jun 18 2018 =
|
289 |
-
* [
|
290 |
-
* [
|
291 |
-
* [
|
292 |
-
* [
|
293 |
* [GUI] Show Disable All Features warning if it is on in Debug tab.
|
294 |
|
295 |
= 2.3 - Jun 13 2018 =
|
1 |
=== LiteSpeed Cache ===
|
2 |
Contributors: LiteSpeedTech
|
3 |
+
Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 4.9.8
|
6 |
+
Stable tag: 2.4.4
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl.html
|
9 |
|
267 |
|
268 |
== Changelog ==
|
269 |
|
270 |
+
= 2.4.4 - Aug 31 2018 =
|
271 |
+
* [NEW] <strong>CLI</strong> CLI can now support image optimization. (@Shon)
|
272 |
+
* [IMPROVEMENT] <strong>GUI</strong> Cron/CLI will not create admin message anymore.
|
273 |
+
* [UPDATE] <strong>Media</strong> Fixed a PHP notice that appeared when pulling optimized images.
|
274 |
+
* [UPDATE] Fixed a PHP notice when detecting origin of ajax call. (@iosoft)
|
275 |
+
* [DEBUG] Debug log can now log referer URL.
|
276 |
+
* [DEBUG] Changes to options will now be logged.
|
277 |
+
|
278 |
+
= 2.4.3 - Aug 27 2018 =
|
279 |
+
* [NEW] <strong>Media</strong> Ability to inline image lazyload JS library. (@Music47ell)
|
280 |
+
* [IMPROVEMENT] <strong>Media</strong> Deleting images will now clear related optimization file & info too.
|
281 |
+
* [IMPROVEMENT] <strong>Media</strong> Non-image postfix data will now be bypassed before sending image optimization request.
|
282 |
+
* [BUGFIX] <strong>CDN</strong> CDN URL will no longer be replaced during admin ajax call. (@pankaj)
|
283 |
+
* [BUGFIX] <strong>CLI</strong> WPCLI can now save options without incorrectly clearing textarea items. (@Shon)
|
284 |
+
* [GUI] Moved Settings above Manage on the main menu.
|
285 |
+
|
286 |
+
= 2.4.2 - Aug 21 2018 =
|
287 |
+
* [IMPROVEMENT] <strong>Media</strong> Sped up Image Optimization process by replacing IAPI server pull communication.
|
288 |
+
* [IMPROVEMENT] <strong>Media</strong> Ability to delete optimized WebP/original image by item in Media Library. (@redgoodapple)
|
289 |
+
* [IMPROVEMENT] <strong>CSS Optimize</strong> Generate new optimized CSS name based on purge timestamp. Allows CSS cache to be cleared for visitors. (@bradbrownmagic)
|
290 |
+
* [IMPROVEMENT] <strong>API</strong> added litespeed_img_optm_options_per_image. (@gintsg)
|
291 |
+
* [UPDATE] Stopped showing "No Image Found" message when all images have finished optimization. (@knutsp)
|
292 |
+
* [UPDATE] Improved a PHP warning when saving settings. (@sergialarconrecio)
|
293 |
+
* [UPDATE] Changed backend adminbar icon default behavior from Purge All to Purge LSCache.
|
294 |
+
* [UPDATE] Clearing CCSS cache will clear unfinished queue too.
|
295 |
+
* [UPDATE] Added "$" exact match when adding URL by frontend adminbar dropdown menu, to avoid affecting any sub-URLs.
|
296 |
+
* [UPDATE] Fixed IAPI error message showing array bug. (@thiomas)
|
297 |
+
* [UPDATE] Debug Disable All will do a Purge All.
|
298 |
+
* [UPDATE] <strong>Critical CSS server IP changed to 142.93.3.57</strong>.
|
299 |
+
* [GUI] Showed plugin update link for IAPI version message.
|
300 |
+
* [GUI] Bypassed null IAPI response message.
|
301 |
+
* [GUI] Grouped related settings with indent.
|
302 |
+
* [IAPI] Added 503 handler for IAPI response.
|
303 |
+
* [IAPI] IAPI v2.4.2.
|
304 |
+
* [IAPI] <strong>Center Server IP Changed from 34.198.229.186 to 142.93.112.87</strong>.
|
305 |
+
|
306 |
+
= 2.4.1 - Jul 19 2018 =
|
307 |
+
* [NEW FEATURE] <strong>Media</strong> Auto Level Up. Auto refill credit.
|
308 |
+
* [NEW FEATURE] <strong>Media</strong> Auto delete original backups after pulled. (@borisov87 @JMCA2)
|
309 |
+
* [NEW FEATURE] <strong>Media</strong> Auto request image optimization. (@ericsondr)
|
310 |
+
* [IMPROVEMENT] <strong>Media</strong> Fetch 404 error will notify client as other errors.
|
311 |
+
* [IMPROVEMENT] <strong>Media</strong> Support WebP for PageSpeed Insights. (@LucasRolff)
|
312 |
+
* [BUGFIX] <strong>CLI</strong> Fixed the issue where CLI import/export caused certain textarea settings to be lost. (#767519)
|
313 |
+
* [BUGFIX] <strong>CSS Optimize</strong> Fixed the issue that duplicated optimized CSS and caused rapid expansion of CSS cache folder.
|
314 |
+
* [GUI] <strong>Media</strong> Refactored operation workflow and interface.
|
315 |
+
* [UPDATE] <strong>Media</strong> Set timeout seconds to avoid pulling timeout. (@Jose)
|
316 |
+
* [UPDATE] <strong>CDN</strong>Fixed the notice when no path is in URL. (@sabitkamera)
|
317 |
+
* [UPDATE] <strong>Media</strong> Auto correct credits when pulling.
|
318 |
+
* [UPDATE] <strong>GUI</strong> Removed redundant double quote in gui.cls. (@DaveyJake)
|
319 |
+
* [IAPI] IAPI v2.4.1.
|
320 |
+
* [IAPI] Allow new error status notification and success message from IAPI.
|
321 |
+
|
322 |
= 2.4 - Jul 2 2018 =
|
323 |
+
* [NEW FEATURE] <strong>Media</strong> Added lossless optimization.
|
324 |
+
* [NEW FEATURE] <strong>Media</strong> Added Request Orignal Images ON/OFF.
|
325 |
+
* [NEW FEATURE] <strong>Media</strong> Added Request WebP ON/OFF. (@JMCA2)
|
326 |
+
* [IMPROVEMENT] <strong>Media</strong> Improved optimization tools to archive maximum compression and score.
|
327 |
+
* [IMPROVEMENT] <strong>Media</strong> Improved speed of image pull.
|
328 |
+
* [IMPROVEMENT] <strong>Media</strong> Automatically recover credit after pulled.
|
329 |
* [REFACTOR] <strong>Config</strong> Separated configure const class.
|
330 |
* [BUGFIX] <strong>Report</strong> Report can be sent successfully with emoji now. (@music47ell)
|
331 |
* [IAPI] New Europe Image Optimization server (EU3/EU4).
|
338 |
* <strong>We strongly recommended that you re-optimize your image library to get a better compression result</strong>.
|
339 |
|
340 |
= 2.3.1 - Jun 18 2018 =
|
341 |
+
* [IMPROVEMENT] New setting to disable Generate Critical CSS. (@cybmeta)
|
342 |
+
* [IMPROVEMENT] Added filter to can_cdn/can_optm check. (@Jacob)
|
343 |
+
* [UPDATE] *Critical CSS* Added 404 css. Limit cron interval.
|
344 |
+
* [UPDATE] AJAX will not bypass CDN anymore by default. (@Jacob)
|
345 |
* [GUI] Show Disable All Features warning if it is on in Debug tab.
|
346 |
|
347 |
= 2.3 - Jun 13 2018 =
|