Plugin Directory

Changeset 3031822


Ignore:
Timestamp:
02/05/2024 06:57:35 PM (23 months ago)
Author:
LiteSpeedTech
Message:

Release v6.1

Location:
litespeed-cache
Files:
337 added
21 edited

Legend:

Unmodified
Added
Removed
  • litespeed-cache/trunk/assets/css/litespeed.css

    r3009052 r3031822  
    822822
    823823.litespeed-panel-icon-revision {
     824    background-image: url('../img/icons/revision.svg');
     825}
     826
     827.litespeed-panel-icon-orphaned_post_meta {
    824828    background-image: url('../img/icons/revision.svg');
    825829}
  • litespeed-cache/trunk/cli/crawler.cls.php

    r3009052 r3031822  
    200200    public function run()
    201201    {
     202        self::debug('⚠️⚠️⚠️ Forced take over lane (CLI)');
     203        $this->__crawler->Release_lane();
     204
    202205        Task::async_call('crawler');
    203206
  • litespeed-cache/trunk/data/esi.nonces.txt

    r2600165 r3031822  
    5858blog_feed_nonce
    5959
    60 # WS Form 
     60# WS Form
    6161wsf_post
    6262
     
    6767# WP Menu Cart
    6868wpmenucart private
     69
     70# Woo nonce
     71woocommerce-login
  • litespeed-cache/trunk/lang/litespeed-cache.pot

    r3009052 r3031822  
    1 # Copyright (C) 2023 LiteSpeed Cache
     1# Copyright (C) 2024 LiteSpeed Cache
    22# This file is distributed under the same license as the LiteSpeed Cache package.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: LiteSpeed Cache 6.0\n"
     5"Project-Id-Version: LiteSpeed Cache 6.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
    7 "POT-Creation-Date: 2023-12-12 15:41:15+00:00\n"
     7"POT-Creation-Date: 2024-02-05 14:52:07+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=UTF-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <[email protected]>\n"
     
    507507msgstr ""
    508508
    509 #: src/crawler.cls.php:991
     509#: src/crawler.cls.php:1094
    510510msgid "Guest"
    511511msgstr ""
    512512
    513 #: src/crawler.cls.php:1143
     513#: src/crawler.cls.php:1261
    514514msgid "Manually added to blocklist"
    515515msgstr ""
    516516
    517 #: src/crawler.cls.php:1146
     517#: src/crawler.cls.php:1264
    518518msgid "Previously existed in blocklist"
    519519msgstr ""
     
    545545msgstr ""
    546546
    547 #: src/db-optm.cls.php:141
     547#: src/db-optm.cls.php:147
    548548msgid "Clean all successfully."
    549549msgstr ""
    550550
    551 #: src/db-optm.cls.php:198
     551#: src/db-optm.cls.php:204
    552552msgid "Clean post revisions successfully."
    553553msgstr ""
    554554
    555 #: src/db-optm.cls.php:202
     555#: src/db-optm.cls.php:208
     556msgid "Clean orphaned post meta successfully."
     557msgstr ""
     558
     559#: src/db-optm.cls.php:212
    556560msgid "Clean auto drafts successfully."
    557561msgstr ""
    558562
    559 #: src/db-optm.cls.php:206
     563#: src/db-optm.cls.php:216
    560564msgid "Clean trashed posts and pages successfully."
    561565msgstr ""
    562566
    563 #: src/db-optm.cls.php:210
     567#: src/db-optm.cls.php:220
    564568msgid "Clean spam comments successfully."
    565569msgstr ""
    566570
    567 #: src/db-optm.cls.php:214
     571#: src/db-optm.cls.php:224
    568572msgid "Clean trashed comments successfully."
    569573msgstr ""
    570574
    571 #: src/db-optm.cls.php:218
     575#: src/db-optm.cls.php:228
    572576msgid "Clean trackbacks and pingbacks successfully."
    573577msgstr ""
    574578
    575 #: src/db-optm.cls.php:222
     579#: src/db-optm.cls.php:232
    576580msgid "Clean expired transients successfully."
    577581msgstr ""
    578582
    579 #: src/db-optm.cls.php:226
     583#: src/db-optm.cls.php:236
    580584msgid "Clean all transients successfully."
    581585msgstr ""
    582586
    583 #: src/db-optm.cls.php:236
     587#: src/db-optm.cls.php:246
    584588msgid "Optimized all tables."
    585589msgstr ""
    586590
    587 #: src/db-optm.cls.php:288
     591#: src/db-optm.cls.php:298
    588592msgid "Converted to InnoDB successfully."
    589593msgstr ""
     
    614618
    615619#: src/doc.cls.php:92 src/doc.cls.php:147 tpl/cdn/manage.tpl.php:67
    616 #: tpl/dash/dashboard.tpl.php:46 tpl/img_optm/summary.tpl.php:48
    617 #: tpl/inc/check_cache_disabled.php:42
     620#: tpl/dash/dashboard.tpl.php:46 tpl/dash/dashboard.tpl.php:613
     621#: tpl/img_optm/summary.tpl.php:48 tpl/inc/check_cache_disabled.php:42
    618622msgid "Learn More"
    619623msgstr ""
     
    942946msgstr ""
    943947
    944 #: src/htaccess.cls.php:340
     948#: src/htaccess.cls.php:341
    945949msgid "Mobile Agent Rules"
    946950msgstr ""
    947951
    948 #: src/htaccess.cls.php:818
     952#: src/htaccess.cls.php:819
    949953msgid ""
    950954"<p>Please add/replace the following codes into the beginning of %1$s:</p> "
     
    972976msgstr ""
    973977
    974 #: src/img-optm.cls.php:945
     978#: src/img-optm.cls.php:947
    975979msgid "Pull Cron is running"
    976980msgstr ""
    977981
    978 #: src/img-optm.cls.php:1027
     982#: src/img-optm.cls.php:1040 src/img-optm.cls.php:1066
    979983msgid "Some optimized image file(s) has expired and was cleared."
    980984msgstr ""
    981985
    982 #: src/img-optm.cls.php:1048
     986#: src/img-optm.cls.php:1083
    983987msgid "Pulled WebP image md5 does not match the notified WebP image md5."
    984988msgstr ""
    985989
    986 #: src/img-optm.cls.php:1084
     990#: src/img-optm.cls.php:1119
    987991msgid "One or more pulled images does not match with the notified image md5"
    988992msgstr ""
    989993
    990 #: src/img-optm.cls.php:1270
     994#: src/img-optm.cls.php:1312
    991995msgid "Cleaned up unfinished data successfully."
    992996msgstr ""
    993997
    994 #: src/img-optm.cls.php:1354
     998#: src/img-optm.cls.php:1396
    995999msgid "Destroy all optimization data successfully."
    9961000msgstr ""
    9971001
    998 #: src/img-optm.cls.php:1417 src/img-optm.cls.php:1479
     1002#: src/img-optm.cls.php:1459 src/img-optm.cls.php:1521
    9991003msgid "Rescanned successfully."
    10001004msgstr ""
    10011005
    1002 #: src/img-optm.cls.php:1479
     1006#: src/img-optm.cls.php:1521
    10031007msgid "Rescanned %d images successfully."
    10041008msgstr ""
    10051009
    1006 #: src/img-optm.cls.php:1546
     1010#: src/img-optm.cls.php:1588
    10071011msgid "Calculated backups successfully."
    10081012msgstr ""
    10091013
    1010 #: src/img-optm.cls.php:1640
     1014#: src/img-optm.cls.php:1682
    10111015msgid "Removed backups successfully."
    10121016msgstr ""
    10131017
    1014 #: src/img-optm.cls.php:1822
     1018#: src/img-optm.cls.php:1864
    10151019msgid "Switched images successfully."
    10161020msgstr ""
    10171021
    1018 #: src/img-optm.cls.php:1867 src/img-optm.cls.php:1913
     1022#: src/img-optm.cls.php:1909 src/img-optm.cls.php:1955
    10191023msgid "Switched to optimized file successfully."
    10201024msgstr ""
    10211025
    1022 #: src/img-optm.cls.php:1886
     1026#: src/img-optm.cls.php:1928
    10231027msgid "Disabled WebP file successfully."
    10241028msgstr ""
    10251029
    1026 #: src/img-optm.cls.php:1891
     1030#: src/img-optm.cls.php:1933
    10271031msgid "Enabled WebP file successfully."
    10281032msgstr ""
    10291033
    1030 #: src/img-optm.cls.php:1907
     1034#: src/img-optm.cls.php:1949
    10311035msgid "Restored original file successfully."
    10321036msgstr ""
    10331037
    1034 #: src/img-optm.cls.php:1964
     1038#: src/img-optm.cls.php:2006
    10351039msgid "Reset the optimized data successfully."
    10361040msgstr ""
     
    18951899msgstr ""
    18961900
    1897 #: src/object-cache.cls.php:472
     1901#: src/object-cache.cls.php:473
    18981902msgid "Redis encountered a fatal error: %s (code: %d)"
    18991903msgstr ""
     
    19921996msgstr ""
    19931997
    1994 #: src/task.cls.php:176
     1998#: src/task.cls.php:177
    19951999msgid "Every Minute"
    19962000msgstr ""
    19972001
    1998 #: src/task.cls.php:196
     2002#: src/task.cls.php:197
    19992003msgid "LiteSpeed Crawler Cron"
    20002004msgstr ""
    20012005
    2002 #: src/utility.cls.php:233
     2006#: src/utility.cls.php:235
    20032007msgid "right now"
    20042008msgstr ""
    20052009
    2006 #: src/utility.cls.php:233
     2010#: src/utility.cls.php:235
    20072011msgid "just now"
    20082012msgstr ""
    20092013
    2010 #: src/utility.cls.php:236
     2014#: src/utility.cls.php:238
    20112015msgid " %s ago"
    20122016msgstr ""
     
    21242128msgstr ""
    21252129
    2126 #. #-#-#-#-#  litespeed-cache.pot (LiteSpeed Cache 6.0)  #-#-#-#-#
     2130#. #-#-#-#-#  litespeed-cache.pot (LiteSpeed Cache 6.1)  #-#-#-#-#
    21272131#. Plugin Name of the plugin/theme
    21282132#: tpl/banner/new_version.php:57 tpl/banner/new_version_dev.tpl.php:12
     
    21402144
    21412145#: tpl/banner/new_version.php:69 tpl/banner/new_version_dev.tpl.php:24
    2142 #: tpl/toolbox/beta_test.tpl.php:63
     2146#: tpl/toolbox/beta_test.tpl.php:64
    21432147msgid "Upgrade"
    21442148msgstr ""
     
    40334037msgstr ""
    40344038
     4039#: tpl/dash/dashboard.tpl.php:616
     4040msgid "Try QUIC.cloud CDN!"
     4041msgstr ""
     4042
     4043#: tpl/dash/dashboard.tpl.php:619
     4044msgid "Best available WordPress performance"
     4045msgstr ""
     4046
     4047#: tpl/dash/dashboard.tpl.php:622
     4048msgid "Globally fast TTFB, easy setup, and <a %s>more</a>!"
     4049msgstr ""
     4050
    40354051#: tpl/dash/entry.tpl.php:11
    40364052msgid "Network Dashboard"
     
    40654081msgstr ""
    40664082
    4067 #: tpl/db_optm/manage.tpl.php:7
     4083#: tpl/db_optm/manage.tpl.php:9
    40684084msgid "Clean All"
    40694085msgstr ""
    40704086
    4071 #: tpl/db_optm/manage.tpl.php:11
     4087#: tpl/db_optm/manage.tpl.php:13
    40724088msgid "Post Revisions"
    40734089msgstr ""
    40744090
    4075 #: tpl/db_optm/manage.tpl.php:12
     4091#: tpl/db_optm/manage.tpl.php:14
    40764092msgid "Clean all post revisions"
    40774093msgstr ""
    40784094
    4079 #: tpl/db_optm/manage.tpl.php:15
     4095#: tpl/db_optm/manage.tpl.php:17
     4096msgid "Orphaned Post Meta"
     4097msgstr ""
     4098
     4099#: tpl/db_optm/manage.tpl.php:18
     4100msgid "Clean all orphaned post meta records"
     4101msgstr ""
     4102
     4103#: tpl/db_optm/manage.tpl.php:21
    40804104msgid "Auto Drafts"
    40814105msgstr ""
    40824106
    4083 #: tpl/db_optm/manage.tpl.php:16
     4107#: tpl/db_optm/manage.tpl.php:22
    40844108msgid "Clean all auto saved drafts"
    40854109msgstr ""
    40864110
    4087 #: tpl/db_optm/manage.tpl.php:19
     4111#: tpl/db_optm/manage.tpl.php:25
    40884112msgid "Trashed Posts"
    40894113msgstr ""
    40904114
    4091 #: tpl/db_optm/manage.tpl.php:20
     4115#: tpl/db_optm/manage.tpl.php:26
    40924116msgid "Clean all trashed posts and pages"
    40934117msgstr ""
    40944118
    4095 #: tpl/db_optm/manage.tpl.php:23
     4119#: tpl/db_optm/manage.tpl.php:29
    40964120msgid "Spam Comments"
    40974121msgstr ""
    40984122
    4099 #: tpl/db_optm/manage.tpl.php:24
     4123#: tpl/db_optm/manage.tpl.php:30
    41004124msgid "Clean all spam comments"
    41014125msgstr ""
    41024126
    4103 #: tpl/db_optm/manage.tpl.php:27
     4127#: tpl/db_optm/manage.tpl.php:33
    41044128msgid "Trashed Comments"
    41054129msgstr ""
    41064130
    4107 #: tpl/db_optm/manage.tpl.php:28
     4131#: tpl/db_optm/manage.tpl.php:34
    41084132msgid "Clean all trashed comments"
    41094133msgstr ""
    41104134
    4111 #: tpl/db_optm/manage.tpl.php:31
     4135#: tpl/db_optm/manage.tpl.php:37
    41124136msgid "Trackbacks/Pingbacks"
    41134137msgstr ""
    41144138
    4115 #: tpl/db_optm/manage.tpl.php:32
     4139#: tpl/db_optm/manage.tpl.php:38
    41164140msgid "Clean all trackbacks and pingbacks"
    41174141msgstr ""
    41184142
    4119 #: tpl/db_optm/manage.tpl.php:35
     4143#: tpl/db_optm/manage.tpl.php:41
    41204144msgid "Expired Transients"
    41214145msgstr ""
    41224146
    4123 #: tpl/db_optm/manage.tpl.php:36
     4147#: tpl/db_optm/manage.tpl.php:42
    41244148msgid "Clean expired transient options"
    41254149msgstr ""
    41264150
    4127 #: tpl/db_optm/manage.tpl.php:39
     4151#: tpl/db_optm/manage.tpl.php:45
    41284152msgid "All Transients"
    41294153msgstr ""
    41304154
    4131 #: tpl/db_optm/manage.tpl.php:40
     4155#: tpl/db_optm/manage.tpl.php:46
    41324156msgid "Clean all transient options"
    41334157msgstr ""
    41344158
    4135 #: tpl/db_optm/manage.tpl.php:43
     4159#: tpl/db_optm/manage.tpl.php:49
    41364160msgid "Optimize Tables"
    41374161msgstr ""
    41384162
    4139 #: tpl/db_optm/manage.tpl.php:44
     4163#: tpl/db_optm/manage.tpl.php:50
    41404164msgid "Optimize all tables in your database"
    41414165msgstr ""
    41424166
    4143 #: tpl/db_optm/manage.tpl.php:51
     4167#: tpl/db_optm/manage.tpl.php:57
    41444168msgid "Clean revisions older than %1$s day(s), excluding %2$s latest revisions"
    41454169msgstr ""
    41464170
    4147 #: tpl/db_optm/manage.tpl.php:72
     4171#: tpl/db_optm/manage.tpl.php:78
    41484172msgid "Database Optimizer"
    41494173msgstr ""
    41504174
    4151 #: tpl/db_optm/manage.tpl.php:99
     4175#: tpl/db_optm/manage.tpl.php:105
    41524176msgid "Database Table Engine Converter"
    41534177msgstr ""
    41544178
    4155 #: tpl/db_optm/manage.tpl.php:106
     4179#: tpl/db_optm/manage.tpl.php:113
    41564180msgid "Table"
    41574181msgstr ""
    41584182
    4159 #: tpl/db_optm/manage.tpl.php:107
     4183#: tpl/db_optm/manage.tpl.php:114
    41604184msgid "Engine"
    41614185msgstr ""
    41624186
    4163 #: tpl/db_optm/manage.tpl.php:108
     4187#: tpl/db_optm/manage.tpl.php:115
    41644188msgid "Tool"
    41654189msgstr ""
    41664190
    4167 #: tpl/db_optm/manage.tpl.php:122
     4191#: tpl/db_optm/manage.tpl.php:130
    41684192msgid "Convert to InnoDB"
    41694193msgstr ""
    41704194
    4171 #: tpl/db_optm/manage.tpl.php:130
     4195#: tpl/db_optm/manage.tpl.php:138
    41724196msgid "We are good. No table uses MyISAM engine."
    41734197msgstr ""
    41744198
    4175 #: tpl/db_optm/manage.tpl.php:151
     4199#: tpl/db_optm/manage.tpl.php:160
    41764200msgid "Database Summary"
    41774201msgstr ""
    41784202
    4179 #: tpl/db_optm/manage.tpl.php:166
     4203#: tpl/db_optm/manage.tpl.php:176
    41804204msgid "Option Name"
    41814205msgstr ""
    41824206
    4183 #: tpl/db_optm/manage.tpl.php:167
     4207#: tpl/db_optm/manage.tpl.php:177
    41844208msgid "Size"
    41854209msgstr ""
     
    52195243
    52205244#: tpl/page_optm/settings_localization.tpl.php:127
    5221 #: tpl/toolbox/beta_test.tpl.php:31
     5245#: tpl/toolbox/beta_test.tpl.php:32
    52225246msgid "Example"
    52235247msgstr ""
     
    57645788msgstr ""
    57655789
    5766 #: tpl/toolbox/beta_test.tpl.php:26
     5790#: tpl/toolbox/beta_test.tpl.php:27
    57675791msgid "Try GitHub Version"
    57685792msgstr ""
    57695793
    5770 #: tpl/toolbox/beta_test.tpl.php:30
     5794#: tpl/toolbox/beta_test.tpl.php:31
    57715795msgid ""
    57725796"Use this section to switch plugin versions. To beta test a GitHub commit, "
     
    57745798msgstr ""
    57755799
    5776 #: tpl/toolbox/beta_test.tpl.php:35
     5800#: tpl/toolbox/beta_test.tpl.php:36
    57775801msgid "Use latest GitHub Dev commit"
    57785802msgstr ""
    57795803
    5780 #: tpl/toolbox/beta_test.tpl.php:37
     5804#: tpl/toolbox/beta_test.tpl.php:38
    57815805msgid "Use latest GitHub Master commit"
    57825806msgstr ""
    57835807
    5784 #: tpl/toolbox/beta_test.tpl.php:39 tpl/toolbox/beta_test.tpl.php:55
     5808#: tpl/toolbox/beta_test.tpl.php:40 tpl/toolbox/beta_test.tpl.php:56
    57855809msgid "Use latest WordPress release version"
    57865810msgstr ""
    57875811
    5788 #: tpl/toolbox/beta_test.tpl.php:39
     5812#: tpl/toolbox/beta_test.tpl.php:40
    57895813msgid "OR"
    57905814msgstr ""
    57915815
    5792 #: tpl/toolbox/beta_test.tpl.php:50
     5816#: tpl/toolbox/beta_test.tpl.php:51
    57935817msgid ""
    57945818"Downgrade not recommended. May cause fatal error due to refactored code."
    57955819msgstr ""
    57965820
    5797 #: tpl/toolbox/beta_test.tpl.php:54
     5821#: tpl/toolbox/beta_test.tpl.php:55
    57985822msgid ""
    57995823"Press the %s button to use the most recent GitHub commit. Master is for "
     
    58015825msgstr ""
    58025826
    5803 #: tpl/toolbox/beta_test.tpl.php:54
     5827#: tpl/toolbox/beta_test.tpl.php:55
    58045828msgid "Use latest GitHub Dev/Master commit"
    58055829msgstr ""
    58065830
    5807 #: tpl/toolbox/beta_test.tpl.php:55
     5831#: tpl/toolbox/beta_test.tpl.php:56
    58085832msgid ""
    58095833"Press the %s button to stop beta testing and go back to the current release "
     
    58115835msgstr ""
    58125836
    5813 #: tpl/toolbox/beta_test.tpl.php:60
     5837#: tpl/toolbox/beta_test.tpl.php:61
    58145838msgid ""
    58155839"In order to avoid an upgrade error, you must be using %1$s or later before "
  • litespeed-cache/trunk/lib/html-min.cls.php

    r2292926 r3031822  
    1919{
    2020    /**
     21     * @var string
     22     */
     23    protected $_html = '';
     24
     25    /**
    2126     * @var boolean
    2227     */
  • litespeed-cache/trunk/litespeed-cache.php

    r3010716 r3031822  
    55 * Plugin URI:        https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
    66 * Description:       High-performance page caching and site optimization from LiteSpeed
    7  * Version:           6.0.0.1
     7 * Version:           6.1
    88 * Author:            LiteSpeed Technologies
    99 * Author URI:        https://www.litespeedtech.com
     
    3535}
    3636
    37 !defined('LSCWP_V') && define('LSCWP_V', '6.0.0.1');
     37!defined('LSCWP_V') && define('LSCWP_V', '6.1');
    3838
    3939!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
  • litespeed-cache/trunk/readme.txt

    r3010716 r3031822  
    33Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
    44Requires at least: 4.0
    5 Tested up to: 6.4.2
    6 Stable tag: 6.0.0.1
     5Tested up to: 6.4.3
     6Stable tag: 6.1
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl.html
     
    251251== Changelog ==
    252252
     253= 6.1 - Feb 5 2024 =
     254* 🌱**Database** New Clear Orphaned Post Meta optimizer function.
     255* **Image Optimize** Fixed possible PHP warning for WP requests library response.
     256* **Image Optimize** Unlocked `noabort` to all async tasks to avoid image optimization timeout. (Peter Wells)
     257* **Image Optimize** Fixed an issue where images weren't being pulled with older versions of WordPress. (PR#608)
     258* **Image Optimize** Improved exception handling when node server cert expire.
     259* 🐞**Image Optimize** The failed to pull images due to 404 expiry will now be able to send the request again.
     260* **Crawler** CLI will now be able to force crawling even if a crawl was recently initiated within the plugin GUI.
     261* **Page Optimize** Fixed a dynamic property creation warning in PHP8. (PR#606)
     262* **Page Optimize** Fixed an issue where getimagesize could cause page optimization to fail. (PR#607)
     263* **Tag** Fixed an array to string conversion warning. (PR#604)
     264* **Object Cache** Return false to prevent PHP warning when Redis fails to set a value. (PR#612)
     265* **Cache Tag** Fixed an issue where $wp_query is null when getting cache tags. (PR#589)
     266
    253267= 6.0.0.1 - Dec 15 2023 =
    254268* 🐞**Image Optimize** Grouped the taken notification to regional center servers to reduce the load after image pulled.
  • litespeed-cache/trunk/src/core.cls.php

    r3009052 r3031822  
    486486        $this->send_headers(true);
    487487
     488        // Log ESI nonce buffer empty issue
     489        if (defined('LSCACHE_IS_ESI') && strlen($buffer) == 0) {
     490            // TODO: log ref somewhere
     491        }
     492
    488493        // Init comment info
    489494        $running_info_showing = defined('LITESPEED_IS_HTML') || defined('LSCACHE_IS_ESI');
     
    520525            }
    521526            Debug2::debug('[Core] ESI End 👆');
    522             Debug2::debug($buffer);
    523527        }
    524528
  • litespeed-cache/trunk/src/crawler.cls.php

    r3009052 r3031822  
    236236     * @since 5.5
    237237     */
    238     public static function async_handler($force = false)
     238    public static function async_handler($manually_run = false)
    239239    {
    240240        self::debug('------------async-------------start_async_handler');
     
    245245        // check_ajax_referer('async_crawler', 'nonce');
    246246        // self::debug('--------------async----------- start async crawling');
    247         self::start($force);
     247        self::start($manually_run);
    248248    }
    249249
     
    254254     * @access public
    255255     */
    256     public static function start($force = false)
     256    public static function start($manually_run = false)
    257257    {
    258258        if (!Router::can_crawl()) {
     
    261261        }
    262262
    263         if ($force) {
     263        if ($manually_run) {
    264264            self::debug('......crawler manually ran......');
    265265        }
     
    271271        // return;
    272272
    273         self::cls()->_crawl_data($force);
     273        self::cls()->_crawl_data($manually_run);
    274274    }
    275275
     
    280280     * @access   private
    281281     */
    282     private function _crawl_data($force)
    283     {
     282    private function _crawl_data($manually_run)
     283    {
     284        if (!defined('LITESPEED_LANE_HASH')) {
     285            define('LITESPEED_LANE_HASH', Str::rrand(8));
     286        }
     287        if ($this->_check_valid_lane()) {
     288            $this->_take_over_lane();
     289        } else {
     290            self::debug('⚠️ lane in use');
     291            return;
     292            // if ($manually_run) {
     293            //  self::debug('......crawler started (manually_rund)......');
     294            //  // Log pid to prevent from multi running
     295            //  if (defined('LITESPEED_CLI')) {
     296            //      // Take over lane
     297            //      self::debug('⚠️⚠️⚠️ Forced take over lane (CLI)');
     298            //      $this->_take_over_lane();
     299            //  }
     300            // }
     301        }
    284302        self::debug('......crawler started......');
     303
    285304        // for the first time running
    286305        if (!$this->_summary || !Data::cls()->tb_exist('crawler') || !Data::cls()->tb_exist('crawler_blacklist')) {
     
    292311            // check whole crawling interval
    293312            $last_fnished_at = $this->_summary['last_full_time_cost'] + $this->_summary['this_full_beginning_time'];
    294             if (!$force && time() - $last_fnished_at < $this->conf(Base::O_CRAWLER_CRAWL_INTERVAL)) {
     313            if (!$manually_run && time() - $last_fnished_at < $this->conf(Base::O_CRAWLER_CRAWL_INTERVAL)) {
    295314                self::debug('Cron abort: cache warmed already.');
    296315                // if not reach whole crawling interval, exit
     316                $this->Release_lane();
    297317                return;
    298318            }
     
    311331            $this->_end_reason = 'end';
    312332            $this->_terminate_running();
     333            $this->Release_lane();
    313334            return;
    314335        }
     
    322343        $this->load_conf();
    323344
    324         $this->_engine_start();
     345        try {
     346            $this->_engine_start();
     347            $this->Release_lane();
     348        } catch (\Exception $e) {
     349            self::debug('🛑 ' . $e->getMessage());
     350        }
    325351    }
    326352
     
    409435    {
    410436        // check if is running
    411         if ($this->_summary['is_running'] && time() - $this->_summary['is_running'] < $this->_crawler_conf['run_duration']) {
    412             $this->_end_reason = 'stopped';
    413             self::debug('The crawler is running.');
    414             return;
    415         }
     437        // if ($this->_summary['is_running'] && time() - $this->_summary['is_running'] < $this->_crawler_conf['run_duration']) {
     438        // $this->_end_reason = 'stopped';
     439        // self::debug('The crawler is running.');
     440        // return;
     441        // }
    416442
    417443        // check current load
     
    559585
    560586    /**
     587     * Take over lane
     588     * @since 6.1
     589     */
     590    private function _take_over_lane()
     591    {
     592        self::debug('Take over lane as lane is free: ' . $this->json_local_path() . '.pid');
     593        file::save($this->json_local_path() . '.pid', LITESPEED_LANE_HASH);
     594    }
     595
     596    /**
     597     * Update lane file
     598     * @since 6.1
     599     */
     600    private function _touch_lane()
     601    {
     602        touch($this->json_local_path() . '.pid');
     603    }
     604
     605    /**
     606     * Release lane file
     607     * @since 6.1
     608     */
     609    public function Release_lane()
     610    {
     611        $lane_file = $this->json_local_path() . '.pid';
     612        if (!file_exists($lane_file)) {
     613            return;
     614        }
     615
     616        self::debug('Release lane');
     617        unlink($lane_file);
     618    }
     619
     620    /**
     621     * Check if lane is used by other crawlers
     622     * @since 6.1
     623     */
     624    private function _check_valid_lane($strict_mode = false)
     625    {
     626        // Check lane hash
     627        $lane_file = $this->json_local_path() . '.pid';
     628        if ($strict_mode) {
     629            if (!file_exists($lane_file)) {
     630                self::debug("lane file not existed, strict mode is false [file] $lane_file");
     631                return false;
     632            }
     633        }
     634        $pid = file::read($lane_file);
     635        if ($pid && LITESPEED_LANE_HASH != $pid) {
     636            // If lane file is older than 1h, ignore
     637            if (time() - filemtime($lane_file) > 3600) {
     638                self::debug('Lane file is older than 1h, releasing lane');
     639                $this->Release_lane();
     640                return true;
     641            }
     642            return false;
     643        }
     644        return true;
     645    }
     646
     647    /**
    561648     * Run crawler
    562649     *
     
    574661            // self::debug('$urlChunks after array_chunk: ' . count($urlChunks));
    575662            foreach ($urlChunks as $rows) {
     663                if (!$this->_check_valid_lane(true)) {
     664                    $this->_end_reason = 'lane_invalid';
     665                    self::debug('🛑 The crawler lane is used by newer crawler.');
     666                    throw new \Exception('invalid crawler lane');
     667                }
     668                // Update time
     669                $this->_touch_lane();
     670
    576671                // self::debug('chunk fetching count($rows)= ' . count($rows));
    577672                // multi curl
     
    651746                    if ($this->_cur_threads == 0) {
    652747                        $this->_end_reason = 'stopped_highload';
    653                         self::debug('Terminated due to highload');
     748                        self::debug('🛑 Terminated due to highload');
    654749                        return;
    655750                        // return __('Stopped due to load over limit', 'litespeed-cache');
     
    758853    private function _status2title($status)
    759854    {
    760         if ($status == 'H') return '✅ Hit';
    761         if ($status == 'M') return '😊 Miss';
    762         if ($status == 'B') return '😅 Blacklisted';
    763         if ($status == 'N') return '😅 Blacklisted';
     855        if ($status == 'H') {
     856            return '✅ Hit';
     857        }
     858        if ($status == 'M') {
     859            return '😊 Miss';
     860        }
     861        if ($status == 'B') {
     862            return '😅 Blacklisted';
     863        }
     864        if ($status == 'N') {
     865            return '😅 Blacklisted';
     866        }
    764867        return '🛸 Unknown';
    765868    }
     
    10881191
    10891192    /**
     1193     * Return crawler meta file local path
     1194     *
     1195     * @since    6.1
     1196     * @access public
     1197     */
     1198    public function json_local_path()
     1199    {
     1200        if (!file_exists(LITESPEED_STATIC_DIR . '/crawler/' . $this->_sitemeta)) {
     1201            return false;
     1202        }
     1203
     1204        return LITESPEED_STATIC_DIR . '/crawler/' . $this->_sitemeta;
     1205    }
     1206
     1207    /**
    10901208     * Return crawler meta file
    10911209     *
     
    12081326                break;
    12091327
    1210                 // Handle the ajax request to proceed crawler manually by admin
     1328            // Handle the ajax request to proceed crawler manually by admin
    12111329            case self::TYPE_START:
    12121330                self::start_async();
  • litespeed-cache/trunk/src/css.cls.php

    r3009052 r3031822  
    2020    protected $_summary;
    2121    private $_queue;
     22    private $_endts;
    2223
    2324    /**
     
    206207
    207208        $i = 0;
     209        $timeoutLimit = ini_get('max_execution_time');
     210        $this->_endts = time() + $timeoutLimit;
    208211        foreach ($this->_queue as $k => $v) {
    209212            if (!empty($v['_status'])) {
    210213                continue;
     214            }
     215
     216            if (function_exists('set_time_limit')) {
     217                $this->_endts += 120;
     218                set_time_limit(120);
     219            }
     220            if ($this->_endts - time() < 10) {
     221                // self::debug("🚨 End loop due to timeout limit reached " . $timeoutLimit . "s");
     222                // return;
    211223            }
    212224
     
    279291            return 'out_of_quota';
    280292        }
    281 
    282         set_time_limit(120);
    283293
    284294        // Update css request status
  • litespeed-cache/trunk/src/db-optm.cls.php

    r3009052 r3031822  
    11<?php
     2
    23/**
    34 * The admin optimize tool
     
    910 * @author     LiteSpeed Technologies <[email protected]>
    1011 */
     12
    1113namespace LiteSpeed;
    1214
     
    1921    private static $TYPES = array(
    2022        'revision',
     23        'orphaned_post_meta',
    2124        'auto_draft',
    2225        'trash_post',
     
    97100                Utility::compatibility();
    98101                return array_sum(array_column($res, 0));
     102
     103            case 'orphaned_post_meta':
     104                return $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->postmeta` a LEFT JOIN `$wpdb->posts` b ON b.ID=a.post_id WHERE b.ID IS NULL");
    99105
    100106            case 'auto_draft':
     
    198204                return __('Clean post revisions successfully.', 'litespeed-cache');
    199205
     206            case 'orphaned_post_meta':
     207                $wpdb->query("DELETE a FROM `$wpdb->postmeta` a LEFT JOIN `$wpdb->posts` b ON b.ID=a.post_id WHERE b.ID IS NULL");
     208                return __('Clean orphaned post meta successfully.', 'litespeed-cache');
     209
    200210            case 'auto_draft':
    201211                $wpdb->query("DELETE FROM `$wpdb->posts` WHERE post_status = 'auto-draft'");
  • litespeed-cache/trunk/src/esi.cls.php

    r3009052 r3031822  
    826826            }
    827827        }
     828        // Needed when permalink structure is "Plain"
     829        wp();
    828830
    829831        wp_admin_bar_render();
  • litespeed-cache/trunk/src/htaccess.cls.php

    r3009052 r3031822  
    3939    const MARKER_NONLS = 'NON_LSCACHE';
    4040    const MARKER_LOGIN_COOKIE = '### marker LOGIN COOKIE';
     41    const MARKER_ASYNC = '### marker ASYNC';
    4142    const MARKER_CRAWLER = '### marker CRAWLER';
    4243    const MARKER_MOBILE = '### marker MOBILE';
     
    503504
    504505        # continual crawler
    505         $id = Base::O_CRAWLER;
    506         if (!empty($cfg[$id])) {
    507             $new_rules[] = self::MARKER_CRAWLER . self::MARKER_START;
    508             $new_rules[] = 'RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php';
    509             $new_rules[] = 'RewriteCond %{QUERY_STRING} action=async_litespeed';
    510             $new_rules[] = 'RewriteRule .* - [E=noabort:1]';
    511             $new_rules[] = self::MARKER_CRAWLER . self::MARKER_END;
    512             $new_rules[] = '';
    513         }
     506        // $id = Base::O_CRAWLER;
     507        // if (!empty($cfg[$id])) {
     508        $new_rules[] = self::MARKER_ASYNC . self::MARKER_START;
     509        $new_rules[] = 'RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php';
     510        $new_rules[] = 'RewriteCond %{QUERY_STRING} action=async_litespeed';
     511        $new_rules[] = 'RewriteRule .* - [E=noabort:1]';
     512        $new_rules[] = self::MARKER_ASYNC . self::MARKER_END;
     513        $new_rules[] = '';
     514        // }
    514515
    515516        // mobile agents
  • litespeed-cache/trunk/src/img-optm.cls.php

    r3010716 r3031822  
    728728        }
    729729
    730         if (empty($post_data['server']) || substr($post_data['server'], -11) !== '.quic.cloud') {
     730        if (empty($post_data['server']) || (substr($post_data['server'], -11) !== '.quic.cloud' && substr($post_data['server'], -15) !== '.quicserver.com')) {
    731731            self::debug('notify exit: no/wrong server');
    732732            return Cloud::err('no/wrong server');
     
    937937    {
    938938        global $wpdb;
    939 
    940         self::debug('' . ($manual ? 'Manually' : 'Cron') . ' pull started');
     939        $timeoutLimit = ini_get('max_execution_time');
     940        $endts = time() + $timeoutLimit;
     941
     942        self::debug('' . ($manual ? 'Manually' : 'Cron') . ' pull started [timeout: ' . $timeoutLimit . 's]');
    941943
    942944        if ($this->cron_running()) {
     
    963965        $server_list = array();
    964966
    965         while ($img_rows = $wpdb->get_results($_q)) {
    966             set_time_limit(600);
    967 
    968             /**
    969              * Update cron timestamp to avoid duplicated running
    970              * @since  1.6.2
    971              */
    972             $this->_update_cron_running();
    973 
    974             // Run requests in parallel
    975             $requests = array(); // store each request URL for Requests::request_multiple()
    976             $imgs_by_req = array(); // store original request data so that we can reference it in the response
    977             $req_counter = 0;
    978             foreach ($img_rows as $row_img) {
    979                 // request original image
    980                 $server_info = json_decode($row_img->server_info, true);
    981                 if (!empty($server_info['ori'])) {
    982                     $image_url = $server_info['server'] . '/' . $server_info['ori'];
    983                     self::debug('Queueing pull: ' . $image_url);
    984                     $requests[$req_counter] = array(
    985                         'url' => $image_url,
    986                         'type' => 'GET',
    987                     );
    988                     $imgs_by_req[$req_counter++] = array(
    989                         'type' => 'ori',
    990                         'data' => $row_img,
    991                     );
     967        try {
     968            while ($img_rows = $wpdb->get_results($_q)) {
     969                self::debug('timeout left: ' . ($endts - time()) . 's');
     970                if (function_exists('set_time_limit')) {
     971                    $endts += 600;
     972                    self::debug('Endtime extended to ' . date('Ymd H:i:s', $endts));
     973                    set_time_limit(600); // This will be no more important as we use noabort now
    992974                }
    993 
    994                 // request webp image
    995                 $webp_size = 0;
    996                 if (!empty($server_info['webp'])) {
    997                     $image_url = $server_info['server'] . '/' . $server_info['webp'];
    998                     self::debug('Queueing pull WebP: ' . $image_url);
    999                     $requests[$req_counter] = array(
    1000                         'url' => $image_url,
    1001                         'type' => 'GET',
    1002                     );
    1003                     $imgs_by_req[$req_counter++] = array(
    1004                         'type' => 'webp',
    1005                         'data' => $row_img,
    1006                     );
     975                // Disabled as we use noabort
     976                // if ($endts - time() < 10) {
     977                //  self::debug("🚨 End loop due to timeout limit reached " . $timeoutLimit . "s");
     978                //  break;
     979                // }
     980
     981                /**
     982                 * Update cron timestamp to avoid duplicated running
     983                 * @since  1.6.2
     984                 */
     985                $this->_update_cron_running();
     986
     987                // Run requests in parallel
     988                $requests = array(); // store each request URL for Requests::request_multiple()
     989                $imgs_by_req = array(); // store original request data so that we can reference it in the response
     990                $req_counter = 0;
     991                foreach ($img_rows as $row_img) {
     992                    // request original image
     993                    $server_info = json_decode($row_img->server_info, true);
     994                    if (!empty($server_info['ori'])) {
     995                        $image_url = $server_info['server'] . '/' . $server_info['ori'];
     996                        self::debug('Queueing pull: ' . $image_url);
     997                        $requests[$req_counter] = array(
     998                            'url' => $image_url,
     999                            'type' => 'GET',
     1000                        );
     1001                        $imgs_by_req[$req_counter++] = array(
     1002                            'type' => 'ori',
     1003                            'data' => $row_img,
     1004                        );
     1005                    }
     1006
     1007                    // request webp image
     1008                    $webp_size = 0;
     1009                    if (!empty($server_info['webp'])) {
     1010                        $image_url = $server_info['server'] . '/' . $server_info['webp'];
     1011                        self::debug('Queueing pull WebP: ' . $image_url);
     1012                        $requests[$req_counter] = array(
     1013                            'url' => $image_url,
     1014                            'type' => 'GET',
     1015                        );
     1016                        $imgs_by_req[$req_counter++] = array(
     1017                            'type' => 'webp',
     1018                            'data' => $row_img,
     1019                        );
     1020                    }
    10071021                }
    1008             }
    1009             self::debug('Loaded images count: ' . $req_counter);
    1010 
    1011             $complete_action = function ($response, $req_count) use ($imgs_by_req, $rm_ori_bkup, &$total_pulled_ori, &$total_pulled_webp, &$server_list) {
    1012                 global $wpdb;
    1013                 $row_data = isset($imgs_by_req[$req_count]) ? $imgs_by_req[$req_count] : false;
    1014                 if (false === $row_data) {
    1015                     self::debug('❌ failed to pull image: Request not found in lookup variable.');
    1016                     return;
    1017                 }
    1018                 $row_type = isset($row_data['type']) ? $row_data['type'] : 'ori';
    1019                 $row_img = $row_data['data'];
    1020                 $local_file = $this->wp_upload_dir['basedir'] . '/' . $row_img->src;
    1021                 $server_info = json_decode($row_img->server_info, true);
    1022 
    1023                 if (!$response->success) {
    1024                     if (404 == $response->status_code) {
    1025                         $this->_step_back_image($row_img->id);
    1026 
    1027                         $msg = __('Some optimized image file(s) has expired and was cleared.', 'litespeed-cache');
    1028                         Admin_Display::error($msg);
    1029                         return;
    1030                     } else {
    1031                         // handle error
    1032                         $image_url = $server_info['server'] . '/' . $server_info[$row_type];
    1033                         self::debug('❌ failed to pull image (' . $row_type . '): ' . $response->status_code . ' [Local: ' . $row_img->src . '] / [remote: ' . $image_url . ']');
     1022                self::debug('Loaded images count: ' . $req_counter);
     1023
     1024                $complete_action = function ($response, $req_count) use ($imgs_by_req, $rm_ori_bkup, &$total_pulled_ori, &$total_pulled_webp, &$server_list) {
     1025                    global $wpdb;
     1026                    $row_data = isset($imgs_by_req[$req_count]) ? $imgs_by_req[$req_count] : false;
     1027                    if (false === $row_data) {
     1028                        self::debug('❌ failed to pull image: Request not found in lookup variable.');
    10341029                        return;
    10351030                    }
     1031                    $row_type = isset($row_data['type']) ? $row_data['type'] : 'ori';
     1032                    $row_img = $row_data['data'];
     1033                    $local_file = $this->wp_upload_dir['basedir'] . '/' . $row_img->src;
     1034                    $server_info = json_decode($row_img->server_info, true);
     1035
     1036                    if (empty($response->success)) {
     1037                        if (!empty($response->status_code) && 404 == $response->status_code) {
     1038                            $this->_step_back_image($row_img->id);
     1039
     1040                            $msg = __('Some optimized image file(s) has expired and was cleared.', 'litespeed-cache');
     1041                            Admin_Display::error($msg);
     1042                            return;
     1043                        } else {
     1044                            // handle error
     1045                            $image_url = $server_info['server'] . '/' . $server_info[$row_type];
     1046                            self::debug(
     1047                                '❌ failed to pull image (' .
     1048                                    $row_type .
     1049                                    '): ' .
     1050                                    (!empty($response->status_code) ? $response->status_code : '') .
     1051                                    ' [Local: ' .
     1052                                    $row_img->src .
     1053                                    '] / [remote: ' .
     1054                                    $image_url .
     1055                                    ']'
     1056                            );
     1057                            throw new \Exception('Failed to pull image ' . (!empty($response->status_code) ? $response->status_code : '') . ' [url] ' . $image_url);
     1058                            return;
     1059                        }
     1060                    }
     1061                    // Handle wp_remote_get 404 as its success=true
     1062                    if (!empty($response->status_code)) {
     1063                        if ($response->status_code == 404) {
     1064                            $this->_step_back_image($row_img->id);
     1065
     1066                            $msg = __('Some optimized image file(s) has expired and was cleared.', 'litespeed-cache');
     1067                            Admin_Display::error($msg);
     1068                            return;
     1069                        }
     1070                        // Note: if there is other error status code found in future, handle here
     1071                    }
     1072
     1073                    if ('webp' === $row_type) {
     1074                        file_put_contents($local_file . '.webp', $response->body);
     1075
     1076                        if (!file_exists($local_file . '.webp') || !filesize($local_file . '.webp') || md5_file($local_file . '.webp') !== $server_info['webp_md5']) {
     1077                            self::debug('❌ Failed to pull optimized webp img: file md5 mismatch, server md5: ' . $server_info['webp_md5']);
     1078
     1079                            // Delete working table
     1080                            $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d ";
     1081                            $wpdb->query($wpdb->prepare($q, $row_img->id));
     1082
     1083                            $msg = __('Pulled WebP image md5 does not match the notified WebP image md5.', 'litespeed-cache');
     1084                            Admin_Display::error($msg);
     1085                            return;
     1086                        }
     1087
     1088                        self::debug('Pulled optimized img WebP: ' . $local_file . '.webp');
     1089
     1090                        $webp_size = filesize($local_file . '.webp');
     1091
     1092                        /**
     1093                         * API for WebP
     1094                         * @since 2.9.5
     1095                         * @since  3.0 $row_img less elements (see above one)
     1096                         * @see #751737  - API docs for WEBP generation
     1097                         */
     1098                        do_action('litespeed_img_pull_webp', $row_img, $local_file . '.webp');
     1099
     1100                        $total_pulled_webp++;
     1101                    } else {
     1102                        // "ori" image type
     1103                        file_put_contents($local_file . '.tmp', $response->body);
     1104
     1105                        if (!file_exists($local_file . '.tmp') || !filesize($local_file . '.tmp') || md5_file($local_file . '.tmp') !== $server_info['ori_md5']) {
     1106                            self::debug(
     1107                                '❌ Failed to pull optimized img: file md5 mismatch [url] ' .
     1108                                    $server_info['server'] .
     1109                                    '/' .
     1110                                    $server_info['ori'] .
     1111                                    ' [server_md5] ' .
     1112                                    $server_info['ori_md5']
     1113                            );
     1114
     1115                            // Delete working table
     1116                            $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d ";
     1117                            $wpdb->query($wpdb->prepare($q, $row_img->id));
     1118
     1119                            $msg = __('One or more pulled images does not match with the notified image md5', 'litespeed-cache');
     1120                            Admin_Display::error($msg);
     1121                            return;
     1122                        }
     1123
     1124                        // Backup ori img
     1125                        if (!$rm_ori_bkup) {
     1126                            $extension = pathinfo($local_file, PATHINFO_EXTENSION);
     1127                            $bk_file = substr($local_file, 0, -strlen($extension)) . 'bk.' . $extension;
     1128                            file_exists($local_file) && rename($local_file, $bk_file);
     1129                        }
     1130
     1131                        // Replace ori img
     1132                        rename($local_file . '.tmp', $local_file);
     1133
     1134                        self::debug('Pulled optimized img: ' . $local_file);
     1135
     1136                        /**
     1137                         * API Hook
     1138                         * @since  2.9.5
     1139                         * @since  3.0 $row_img has less elements now. Most useful ones are `post_id`/`src`
     1140                         */
     1141                        do_action('litespeed_img_pull_ori', $row_img, $local_file);
     1142
     1143                        self::debug2('Remove _table_img_optming record [id] ' . $row_img->id);
     1144                    }
     1145
     1146                    // Delete working table
     1147                    $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d ";
     1148                    $wpdb->query($wpdb->prepare($q, $row_img->id));
     1149
     1150                    // Save server_list to notify taken
     1151                    if (empty($server_list[$server_info['server']])) {
     1152                        $server_list[$server_info['server']] = array();
     1153                    }
     1154
     1155                    $server_info_id = !empty($server_info['file_id']) ? $server_info['file_id'] : $server_info['id'];
     1156                    $server_list[$server_info['server']][] = $server_info_id;
     1157
     1158                    $total_pulled_ori++;
     1159                };
     1160
     1161                if (class_exists('\WpOrg\Requests\Requests') && class_exists('\WpOrg\Requests\Autoload') && version_compare(PHP_VERSION, '5.6.0', '>=')) {
     1162                    // Make sure Requests can load internal classes.
     1163                    Autoload::register();
     1164
     1165                    // Run pull requests in parallel
     1166                    Requests::request_multiple($requests, array(
     1167                        'timeout' => 60,
     1168                        'connect_timeout' => 60,
     1169                        'complete' => $complete_action,
     1170                    ));
     1171                } else {
     1172                    foreach ($requests as $cnt => $req) {
     1173                        $wp_response = wp_remote_get($req['url'], array('timeout' => 60));
     1174                        $request_response = array(
     1175                            'success' => false,
     1176                            'status_code' => 0,
     1177                            'body' => null,
     1178                        );
     1179                        if (is_wp_error($wp_response)) {
     1180                            $error_message = $wp_response->get_error_message();
     1181                            self::debug('❌ failed to pull image: ' . $error_message);
     1182                        } else {
     1183                            $request_response['success'] = true;
     1184                            $request_response['status_code'] = $wp_response['response']['code'];
     1185                            $request_response['body'] = $wp_response['body'];
     1186                        }
     1187                        self::debug('response code [code] ' . $wp_response['response']['code'] . ' [url] ' . $req['url']);
     1188
     1189                        $request_response = (object) $request_response;
     1190
     1191                        $complete_action($request_response, $cnt);
     1192                    }
    10361193                }
    1037 
    1038                 if ('webp' === $row_type) {
    1039                     file_put_contents($local_file . '.webp', $response->body);
    1040 
    1041                     if (!file_exists($local_file . '.webp') || !filesize($local_file . '.webp') || md5_file($local_file . '.webp') !== $server_info['webp_md5']) {
    1042                         self::debug('❌ Failed to pull optimized webp img: file md5 mismatch, server md5: ' . $server_info['webp_md5']);
    1043 
    1044                         // Delete working table
    1045                         $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d ";
    1046                         $wpdb->query($wpdb->prepare($q, $row_img->id));
    1047 
    1048                         $msg = __('Pulled WebP image md5 does not match the notified WebP image md5.', 'litespeed-cache');
    1049                         Admin_Display::error($msg);
    1050                         return;
    1051                     }
    1052 
    1053                     self::debug('Pulled optimized img WebP: ' . $local_file . '.webp');
    1054 
    1055                     $webp_size = filesize($local_file . '.webp');
    1056 
    1057                     /**
    1058                      * API for WebP
    1059                      * @since 2.9.5
    1060                      * @since  3.0 $row_img less elements (see above one)
    1061                      * @see #751737  - API docs for WEBP generation
    1062                      */
    1063                     do_action('litespeed_img_pull_webp', $row_img, $local_file . '.webp');
    1064 
    1065                     $total_pulled_webp++;
    1066                 } else {
    1067                     // "ori" image type
    1068                     file_put_contents($local_file . '.tmp', $response->body);
    1069 
    1070                     if (!file_exists($local_file . '.tmp') || !filesize($local_file . '.tmp') || md5_file($local_file . '.tmp') !== $server_info['ori_md5']) {
    1071                         self::debug(
    1072                             '❌ Failed to pull optimized img: file md5 mismatch [url] ' .
    1073                                 $server_info['server'] .
    1074                                 '/' .
    1075                                 $server_info['ori'] .
    1076                                 ' [server_md5] ' .
    1077                                 $server_info['ori_md5']
    1078                         );
    1079 
    1080                         // Delete working table
    1081                         $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d ";
    1082                         $wpdb->query($wpdb->prepare($q, $row_img->id));
    1083 
    1084                         $msg = __('One or more pulled images does not match with the notified image md5', 'litespeed-cache');
    1085                         Admin_Display::error($msg);
    1086                         return;
    1087                     }
    1088 
    1089                     // Backup ori img
    1090                     if (!$rm_ori_bkup) {
    1091                         $extension = pathinfo($local_file, PATHINFO_EXTENSION);
    1092                         $bk_file = substr($local_file, 0, -strlen($extension)) . 'bk.' . $extension;
    1093                         file_exists($local_file) && rename($local_file, $bk_file);
    1094                     }
    1095 
    1096                     // Replace ori img
    1097                     rename($local_file . '.tmp', $local_file);
    1098 
    1099                     self::debug('Pulled optimized img: ' . $local_file);
    1100 
    1101                     /**
    1102                      * API Hook
    1103                      * @since  2.9.5
    1104                      * @since  3.0 $row_img has less elements now. Most useful ones are `post_id`/`src`
    1105                      */
    1106                     do_action('litespeed_img_pull_ori', $row_img, $local_file);
    1107 
    1108                     self::debug2('Remove _table_img_optming record [id] ' . $row_img->id);
    1109                 }
    1110 
    1111                 // Delete working table
    1112                 $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d ";
    1113                 $wpdb->query($wpdb->prepare($q, $row_img->id));
    1114 
    1115                 // Save server_list to notify taken
    1116                 if (empty($server_list[$server_info['server']])) {
    1117                     $server_list[$server_info['server']] = array();
    1118                 }
    1119 
    1120                 $server_info_id = !empty($server_info['file_id']) ? $server_info['file_id'] : $server_info['id'];
    1121                 $server_list[$server_info['server']][] = $server_info_id;
    1122 
    1123                 $total_pulled_ori++;
    1124             };
    1125 
    1126             if (class_exists('Requests')) {
    1127                 // Make sure Requests can load internal classes.
    1128                 Autoload::register();
    1129 
    1130                 // Run pull requests in parallel
    1131                 Requests::request_multiple($requests, array(
    1132                     'timeout' => 60,
    1133                     'connect_timeout' => 60,
    1134                     'complete' => $complete_action,
    1135                 ));
    1136             } else {
    1137                 foreach ($requests as $cnt => $req) {
    1138                     $wp_response = wp_remote_get($req['url'], array('timeout' => 60));
    1139                     $request_response = array(
    1140                         'success' => false,
    1141                         'status_code' => 0,
    1142                         'body' => null,
    1143                     );
    1144                     if (is_wp_error($wp_response)) {
    1145                         $error_message = $wp_response->get_error_message();
    1146                         self::debug('❌ failed to pull image: ' . $error_message);
    1147                     } else {
    1148                         $request_response['success'] = true;
    1149                         $request_response['status_code'] = $wp_response['response']['code'];
    1150                         $request_response['body'] = $wp_response['body'];
    1151                     }
    1152 
    1153                     $request_response = (object) $request_response;
    1154 
    1155                     $complete_action($request_response, $cnt);
    1156                 }
    1157             }
     1194                self::debug('Current batch pull finished');
     1195            }
     1196        } catch (\Exception $e) {
     1197            Admin_Display::error('Image pull process failure: ' . $e->getMessage());
    11581198        }
    11591199
     
    11611201        foreach ($server_list as $server => $img_list) {
    11621202            $data = array(
    1163                 'action'    => self::CLOUD_ACTION_TAKEN,
    1164                 'list'      => $img_list,
    1165                 'server'    => $server,
     1203                'action' => self::CLOUD_ACTION_TAKEN,
     1204                'list' => $img_list,
     1205                'server' => $server,
    11661206            );
    11671207            // TODO: improve this so we do not call once per server, but just once and then filter on the server side
     
    12061246    {
    12071247        global $wpdb;
     1248
     1249        self::debug('Push image back to new status [id] ' . $id);
    12081250
    12091251        // Reset the image to gathered status
  • litespeed-cache/trunk/src/media.cls.php

    r3009052 r3031822  
    9292                    $featured_image_url = $this->replace_webp($featured_image_url) ?: $featured_image_url;
    9393                }
    94                 $content .= '<link rel="preload" as="image" href="' . $featured_image_url . '">';
     94                $content .= '<link rel="preload" as="image" href="' . $featured_image_url . '">'; // TODO: use imagesrcset
    9595            }
    9696        }
     
    732732        }
    733733
    734         $sizes = getimagesize($src);
     734        try {
     735            $sizes = getimagesize($src);
     736        } catch (\Exception $e) {
     737            return false;
     738        }
    735739
    736740        if (!empty($sizes[0]) && !empty($sizes[1])) {
  • litespeed-cache/trunk/src/object-cache.cls.php

    r3009052 r3031822  
    470470                $res = $this->_conn->setEx($key, $ttl, $data);
    471471            } catch (\RedisException $ex) {
     472                $res = false;
    472473                $msg = sprintf(__('Redis encountered a fatal error: %s (code: %d)', 'litespeed-cache'), $ex->getMessage(), $ex->getCode());
    473474                Debug2::debug('[Object] ' . $msg);
  • litespeed-cache/trunk/src/tag.cls.php

    r3009052 r3031822  
    251251        }
    252252
    253         $queried_obj_id = get_queried_object_id();
    254         if (is_archive()) {
    255             //An Archive is a Category, Tag, Author, Date, Custom Post Type or Custom Taxonomy based pages.
    256             if (is_category() || is_tag() || is_tax()) {
    257                 $tags[] = self::TYPE_ARCHIVE_TERM . $queried_obj_id;
    258             } elseif (is_post_type_archive()) {
    259                 global $wp_query;
    260                 $post_type = (string) $wp_query->get('post_type');
    261                 $tags[] = self::TYPE_ARCHIVE_POSTTYPE . $post_type;
    262             } elseif (is_author()) {
    263                 $tags[] = self::TYPE_AUTHOR . $queried_obj_id;
    264             } elseif (is_date()) {
    265                 global $post;
    266                 $date = $post->post_date;
    267                 $date = strtotime($date);
    268                 if (is_day()) {
    269                     $tags[] = self::TYPE_ARCHIVE_DATE . date('Ymd', $date);
    270                 } elseif (is_month()) {
    271                     $tags[] = self::TYPE_ARCHIVE_DATE . date('Ym', $date);
    272                 } elseif (is_year()) {
    273                     $tags[] = self::TYPE_ARCHIVE_DATE . date('Y', $date);
    274                 }
     253        global $wp_query;
     254        if (isset($wp_query)) {
     255            $queried_obj_id = get_queried_object_id();
     256            if (is_archive()) {
     257                //An Archive is a Category, Tag, Author, Date, Custom Post Type or Custom Taxonomy based pages.
     258                if (is_category() || is_tag() || is_tax()) {
     259                    $tags[] = self::TYPE_ARCHIVE_TERM . $queried_obj_id;
     260                } elseif (is_post_type_archive() && ($post_type = get_post_type())) {
     261                    $tags[] = self::TYPE_ARCHIVE_POSTTYPE . $post_type;
     262                } elseif (is_author()) {
     263                    $tags[] = self::TYPE_AUTHOR . $queried_obj_id;
     264                } elseif (is_date()) {
     265                    global $post;
     266                    $date = $post->post_date;
     267                    $date = strtotime($date);
     268                    if (is_day()) {
     269                        $tags[] = self::TYPE_ARCHIVE_DATE . date('Ymd', $date);
     270                    } elseif (is_month()) {
     271                        $tags[] = self::TYPE_ARCHIVE_DATE . date('Ym', $date);
     272                    } elseif (is_year()) {
     273                        $tags[] = self::TYPE_ARCHIVE_DATE . date('Y', $date);
     274                    }
     275                }
     276            } elseif (is_singular()) {
     277                //$this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;
     278                $tags[] = self::TYPE_POST . $queried_obj_id;
     279
     280                if (is_page()) {
     281                    $tags[] = self::TYPE_PAGES;
     282                }
     283            } elseif (is_feed()) {
     284                $tags[] = self::TYPE_FEED;
    275285            }
    276         } elseif (is_singular()) {
    277             //$this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;
    278             $tags[] = self::TYPE_POST . $queried_obj_id;
    279 
    280             if (is_page()) {
    281                 $tags[] = self::TYPE_PAGES;
    282             }
    283         } elseif (is_feed()) {
    284             $tags[] = self::TYPE_FEED;
    285286        }
    286287
  • litespeed-cache/trunk/src/task.cls.php

    r3009052 r3031822  
    119119        );
    120120        $url = add_query_arg($qs, admin_url('admin-ajax.php'));
     121        self::debug('async call to ' . $url);
    121122        wp_remote_post(esc_url_raw($url), $args);
    122123    }
  • litespeed-cache/trunk/src/utility.cls.php

    r3009052 r3031822  
    11<?php
     2
    23/**
    34 * The utility class.
     
    67 * @since       1.5 Moved into /inc
    78 */
     9
    810namespace LiteSpeed;
    911
  • litespeed-cache/trunk/tpl/dash/dashboard.tpl.php

    r2977143 r3031822  
    611611                    <h3 class="litespeed-title">
    612612                        QUIC.cloud
    613                         <a href="https://www.quic.cloud/quic-cloud-services-and-features/litespeed-cache-service/" class="litespeed-title-right-icon">Learn More</a>
     613                        <a href="https://www.quic.cloud/quic-cloud-services-and-features/litespeed-cache-service/" class="litespeed-title-right-icon" target="_blank"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
    614614                    </h3>
    615615                    <p class="litespeed-top20 litespeed-text-bold litespeed-margin-bottom20">
    616                         <a href="https://www.quic.cloud/docs/onboarding/" class="">Try QUIC.cloud CDN!</a>
     616                        <a href="https://www.quic.cloud/docs/onboarding/" class="" target="_blank"><?php echo __('Try QUIC.cloud CDN!', 'litespeed-cache'); ?></a>
    617617                    </p>
    618618                    <p class="litespeed-margin-y5">
    619                         Best available WordPress performance
     619                        <?php echo __('Best available WordPress performance', 'litespeed-cache'); ?>
    620620                    </p>
    621621                    <p class="litespeed-margin-y5">
    622                         Globally fast TTFB, easy setup, and <a href="https://www.quic.cloud/quic-cloud-services-and-features/litespeed-cache-service/">more</a>!
     622                        <?php echo sprintf(__('Globally fast TTFB, easy setup, and <a %s>more</a>!', 'litespeed-cache'), ' href="https://www.quic.cloud/quic-cloud-services-and-features/litespeed-cache-service/" target="_blank"'); ?>
    623623                    </p>
    624624                    <div class="litespeed-top10">
  • litespeed-cache/trunk/tpl/db_optm/manage.tpl.php

    r2524344 r3031822  
    11<?php
     2
    23namespace LiteSpeed;
    3 defined( 'WPINC' ) || exit;
     4
     5defined('WPINC') || exit;
    46
    57$_panels = array(
    68    'all' => array(
    7         'title' => __( 'Clean All', 'litespeed-cache' ),
     9        'title' => __('Clean All', 'litespeed-cache'),
    810        'desc'  => '',
    911    ),
    1012    'revision' => array(
    11         'title' => __( 'Post Revisions', 'litespeed-cache' ),
    12         'desc'  => __( 'Clean all post revisions', 'litespeed-cache' ),
     13        'title' => __('Post Revisions', 'litespeed-cache'),
     14        'desc'  => __('Clean all post revisions', 'litespeed-cache'),
     15    ),
     16    'orphaned_post_meta' => array(
     17        'title' => __('Orphaned Post Meta', 'litespeed-cache'),
     18        'desc'  => __('Clean all orphaned post meta records', 'litespeed-cache'),
    1319    ),
    1420    'auto_draft' => array(
    15         'title' => __( 'Auto Drafts', 'litespeed-cache' ),
    16         'desc'  => __( 'Clean all auto saved drafts', 'litespeed-cache' ),
     21        'title' => __('Auto Drafts', 'litespeed-cache'),
     22        'desc'  => __('Clean all auto saved drafts', 'litespeed-cache'),
    1723    ),
    1824    'trash_post' => array(
    19         'title' => __( 'Trashed Posts', 'litespeed-cache' ),
    20         'desc'  => __( 'Clean all trashed posts and pages', 'litespeed-cache' ),
     25        'title' => __('Trashed Posts', 'litespeed-cache'),
     26        'desc'  => __('Clean all trashed posts and pages', 'litespeed-cache'),
    2127    ),
    2228    'spam_comment' => array(
    23         'title' => __( 'Spam Comments', 'litespeed-cache' ),
    24         'desc'  => __( 'Clean all spam comments', 'litespeed-cache' ),
     29        'title' => __('Spam Comments', 'litespeed-cache'),
     30        'desc'  => __('Clean all spam comments', 'litespeed-cache'),
    2531    ),
    2632    'trash_comment' => array(
    27         'title' => __( 'Trashed Comments', 'litespeed-cache' ),
    28         'desc'  => __( 'Clean all trashed comments', 'litespeed-cache' ),
     33        'title' => __('Trashed Comments', 'litespeed-cache'),
     34        'desc'  => __('Clean all trashed comments', 'litespeed-cache'),
    2935    ),
    3036    'trackback-pingback' => array(
    31         'title' => __( 'Trackbacks/Pingbacks', 'litespeed-cache' ),
    32         'desc'  => __( 'Clean all trackbacks and pingbacks', 'litespeed-cache' ),
     37        'title' => __('Trackbacks/Pingbacks', 'litespeed-cache'),
     38        'desc'  => __('Clean all trackbacks and pingbacks', 'litespeed-cache'),
    3339    ),
    3440    'expired_transient' => array(
    35         'title' => __( 'Expired Transients', 'litespeed-cache' ),
    36         'desc'  => __( 'Clean expired transient options', 'litespeed-cache' ),
     41        'title' => __('Expired Transients', 'litespeed-cache'),
     42        'desc'  => __('Clean expired transient options', 'litespeed-cache'),
    3743    ),
    3844    'all_transients' => array(
    39         'title' => __( 'All Transients', 'litespeed-cache' ),
    40         'desc'  => __( 'Clean all transient options', 'litespeed-cache' ),
     45        'title' => __('All Transients', 'litespeed-cache'),
     46        'desc'  => __('Clean all transient options', 'litespeed-cache'),
    4147    ),
    4248    'optimize_tables' => array(
    43         'title' => __( 'Optimize Tables', 'litespeed-cache' ),
    44         'desc'  => __( 'Optimize all tables in your database', 'litespeed-cache' ),
     49        'title' => __('Optimize Tables', 'litespeed-cache'),
     50        'desc'  => __('Optimize all tables in your database', 'litespeed-cache'),
    4551    ),
    4652);
    4753
    48 $rev_max = $this->conf( Base::O_DB_OPTM_REVISIONS_MAX );
    49 $rev_age = $this->conf( Base::O_DB_OPTM_REVISIONS_AGE );
    50 if ( $rev_max || $rev_age ) {
    51     $_panels[ 'revision' ][ 'desc' ] = sprintf( __( 'Clean revisions older than %1$s day(s), excluding %2$s latest revisions', 'litespeed-cache' ), '<strong>' . $rev_age . '</strong>' , '<strong>' . $rev_max . '</strong>' );
     54$rev_max = $this->conf(Base::O_DB_OPTM_REVISIONS_MAX);
     55$rev_age = $this->conf(Base::O_DB_OPTM_REVISIONS_AGE);
     56if ($rev_max || $rev_age) {
     57    $_panels['revision']['desc'] = sprintf(__('Clean revisions older than %1$s day(s), excluding %2$s latest revisions', 'litespeed-cache'), '<strong>' . $rev_age . '</strong>', '<strong>' . $rev_max . '</strong>');
    5258}
    5359
    5460$total = 0;
    55 foreach ( $_panels as $tag => $v ) {
    56     if ( $tag != 'all' ) {
    57         $_panels[ $tag ][ 'count' ] = $this->cls( 'DB_Optm' )->db_count( $tag );
    58         if ( ! in_array( $tag, array( 'optimize_tables' ) ) ) {
    59             $total += $_panels[ $tag ][ 'count' ];
     61foreach ($_panels as $tag => $v) {
     62    if ($tag != 'all') {
     63        $_panels[$tag]['count'] = $this->cls('DB_Optm')->db_count($tag);
     64        if (!in_array($tag, array('optimize_tables'))) {
     65            $total += $_panels[$tag]['count'];
    6066        }
    6167    }
    62     $_panels[ $tag ][ 'link' ] = Utility::build_url( Router::ACTION_DB_OPTM, $tag );
     68    $_panels[$tag]['link'] = Utility::build_url(Router::ACTION_DB_OPTM, $tag);
    6369}
    6470
    65 $_panels[ 'all' ][ 'count' ] = $total;
     71$_panels['all']['count'] = $total;
    6672
    6773$autoload_summary = DB_Optm::cls()->autoload_summary();
     
    7177<h3 class="litespeed-title">
    7278    <?php echo __('Database Optimizer', 'litespeed-cache'); ?>
    73     <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/database/' ); ?>
     79    <?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/database/'); ?>
    7480</h3>
    7581
    7682<div class="litespeed-panel-wrapper litespeed-cards-wrapper">
    7783
    78 <?php foreach ( $_panels as $tag => $v ): ?>
     84    <?php foreach ($_panels as $tag => $v) : ?>
    7985
    80     <a href="<?php echo $v[ 'link' ]; ?>" class="litespeed-panel postbox">
    81         <section class="litespeed-panel-wrapper-icon">
    82             <span class="litespeed-panel-icon-<?php echo $tag; ?>"></span>
    83         </section>
    84         <section class="litespeed-panel-content">
    85             <div class="litespeed-h3">
    86                 <?php echo $v[ 'title' ]; ?>
    87                 <span class="litespeed-panel-counter<?php if ( $v[ 'count' ] > 0 ) echo '-red'; ?>">(<?php echo $v[ 'count' ]; ?><?php echo DB_Optm::hide_more() ? '+' : ''; ?>)</span>
    88             </div>
    89             <span class="litespeed-panel-para"><?php echo $v[ 'desc' ]; ?></span>
    90         </section>
    91         <section class="litespeed-panel-wrapper-top-right">
    92             <span class="litespeed-panel-top-right-icon<?php echo $v[ 'count' ] > 0 ? '-cross' : '-tick'; ?>"></span>
    93         </section>
    94     </a>
    95 <?php endforeach; ?>
     86        <a href="<?php echo $v['link']; ?>" class="litespeed-panel postbox">
     87            <section class="litespeed-panel-wrapper-icon">
     88                <span class="litespeed-panel-icon-<?php echo $tag; ?>"></span>
     89            </section>
     90            <section class="litespeed-panel-content">
     91                <div class="litespeed-h3">
     92                    <?php echo $v['title']; ?>
     93                    <span class="litespeed-panel-counter<?php if ($v['count'] > 0) echo '-red'; ?>">(<?php echo $v['count']; ?><?php echo DB_Optm::hide_more() ? '+' : ''; ?>)</span>
     94                </div>
     95                <span class="litespeed-panel-para"><?php echo $v['desc']; ?></span>
     96            </section>
     97            <section class="litespeed-panel-wrapper-top-right">
     98                <span class="litespeed-panel-top-right-icon<?php echo $v['count'] > 0 ? '-cross' : '-tick'; ?>"></span>
     99            </section>
     100        </a>
     101    <?php endforeach; ?>
    96102
    97103</div>
    98104
    99 <h3 class="litespeed-title"><?php echo __( 'Database Table Engine Converter', 'litespeed-cache' ); ?></h3>
     105<h3 class="litespeed-title"><?php echo __('Database Table Engine Converter', 'litespeed-cache'); ?></h3>
    100106
    101107<div class="litespeed-panel-wrapper">
    102108
    103109    <table class="wp-list-table widefat striped">
    104         <thead><tr >
    105             <th scope="col">#</th>
    106             <th scope="col"><?php echo __( 'Table', 'litespeed-cache' ); ?></th>
    107             <th scope="col"><?php echo __( 'Engine', 'litespeed-cache' ); ?></th>
    108             <th scope="col"><?php echo __( 'Tool', 'litespeed-cache' ); ?></th>
    109         </tr></thead>
     110        <thead>
     111            <tr>
     112                <th scope="col">#</th>
     113                <th scope="col"><?php echo __('Table', 'litespeed-cache'); ?></th>
     114                <th scope="col"><?php echo __('Engine', 'litespeed-cache'); ?></th>
     115                <th scope="col"><?php echo __('Tool', 'litespeed-cache'); ?></th>
     116            </tr>
     117        </thead>
    110118        <tbody>
    111         <?php
     119            <?php
    112120            $list = DB_Optm::cls()->list_myisam();
    113             if ( $list ) :
    114                 foreach ( $list as $k => $v ) :
    115         ?>
     121            if ($list) :
     122                foreach ($list as $k => $v) :
     123            ?>
     124                    <tr>
     125                        <td><?php echo $k + 1; ?></td>
     126                        <td><?php echo $v->TABLE_NAME; ?></td>
     127                        <td><?php echo $v->ENGINE; ?></td>
     128                        <td>
     129                            <a href="<?php echo Utility::build_url(Router::ACTION_DB_OPTM, DB_Optm::TYPE_CONV_TB, false, false, array('tb' => $v->TABLE_NAME)); ?>">
     130                                <?php echo __('Convert to InnoDB', 'litespeed-cache'); ?>
     131                            </a>
     132                        </td>
     133                    </tr>
     134                <?php endforeach; ?>
     135            <?php else : ?>
    116136                <tr>
    117                     <td><?php echo $k + 1; ?></td>
    118                     <td><?php echo $v->TABLE_NAME; ?></td>
    119                     <td><?php echo $v->ENGINE; ?></td>
    120                     <td>
    121                         <a href="<?php echo Utility::build_url( Router::ACTION_DB_OPTM, DB_Optm::TYPE_CONV_TB, false, false, array( 'tb' => $v->TABLE_NAME ) ); ?>">
    122                             <?php echo __( 'Convert to InnoDB', 'litespeed-cache' ); ?>
    123                         </a>
     137                    <td colspan="4" class="litespeed-success litespeed-text-center">
     138                        <?php echo __('We are good. No table uses MyISAM engine.', 'litespeed-cache'); ?>
    124139                    </td>
    125140                </tr>
    126         <?php endforeach; ?>
    127         <?php else : ?>
    128             <tr>
    129                 <td colspan="4" class="litespeed-success litespeed-text-center">
    130                     <?php echo __( 'We are good. No table uses MyISAM engine.', 'litespeed-cache' ); ?>
    131                 </td>
    132             </tr>
    133         <?php endif; ?>
     141            <?php endif; ?>
    134142        </tbody>
    135143    </table>
     
    144152        margin-right: 20px;
    145153    }
    146     .litespeed-body .field-col:first-child{
    147         margin-left:0;
     154
     155    .litespeed-body .field-col:first-child {
     156        margin-left: 0;
    148157    }
    149158</style>
    150159
    151 <h3 class="litespeed-title"><?php echo __( 'Database Summary', 'litespeed-cache' ); ?></h3>
     160<h3 class="litespeed-title"><?php echo __('Database Summary', 'litespeed-cache'); ?></h3>
    152161<div>
    153162    <div class="field-col">
    154163        <p>
    155         Autoload size: <strong><?php echo Utility::real_size( $autoload_summary->autoload_size ); ?></strong></p>
     164            Autoload size: <strong><?php echo Utility::real_size($autoload_summary->autoload_size); ?></strong></p>
    156165        <p>Autoload entries: <strong><?php echo $autoload_summary->autload_entries; ?></strong></p>
    157166
     
    160169
    161170    <div class="field-col">
    162     <p>Autoload top list:</p>
     171        <p>Autoload top list:</p>
    163172        <table class="wp-list-table widefat striped litespeed-width-auto litespeed-table-compact">
    164             <thead><tr >
    165                 <th scope="col">#</th>
    166                 <th scope="col"><?php echo __('Option Name', 'litespeed-cache'); ?></th>
    167                 <th scope="col"><?php echo __('Size', 'litespeed-cache'); ?></th>
    168             </tr></thead>
     173            <thead>
     174                <tr>
     175                    <th scope="col">#</th>
     176                    <th scope="col"><?php echo __('Option Name', 'litespeed-cache'); ?></th>
     177                    <th scope="col"><?php echo __('Size', 'litespeed-cache'); ?></th>
     178                </tr>
     179            </thead>
    169180            <tbody>
    170                 <?php foreach ( $autoload_summary->autoload_toplist as $k => $v ) : ?>
    171                 <tr>
    172                     <td><?php echo $k + 1; ?></td>
    173                     <td><?php echo $v->option_name; ?></td>
    174                     <td><?php echo $v->option_value_length; ?></td>
    175                 </tr>
     181                <?php foreach ($autoload_summary->autoload_toplist as $k => $v) : ?>
     182                    <tr>
     183                        <td><?php echo $k + 1; ?></td>
     184                        <td><?php echo $v->option_name; ?></td>
     185                        <td><?php echo $v->option_value_length; ?></td>
     186                    </tr>
    176187                <?php endforeach; ?>
    177188            </tbody>
     
    180191    </div>
    181192</div>
    182 
    183 
    184 
    185 
    186 
    187 
Note: See TracChangeset for help on using the changeset viewer.