72% litespeed-cache

Code Review | LiteSpeed Cache

WordPress plugin LiteSpeed Cache scored 72% from 54 tests.

About plugin

  • Plugin page: litespeed-cache
  • Plugin version: 4.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.2
  • WordPress version: 5.9.2
  • First release: Jan 29, 2016
  • Latest release: Mar 29, 2022
  • Number of updates: 295
  • Update frequency: every 7.6 days
  • Top authors: LiteSpeedTech (89.15%)hailite (11.19%)

Code review

54 tests

User reviews

1937 reviews

Install metrics

3,000,000+ active / 28,853,730 total downloads


Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.80MB] [CPU: ▼279.53ms] 75% from 4 tests

A check of server-side resources used by LiteSpeed Cache
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 624.24ms on /wp-admin/admin.php?page=litespeed-toolbox)
PageMemory (MB)CPU Time (ms)
Home /5.94 ▲2.4390.77 ▲26.56
Dashboard /wp-admin6.31 ▲2.9050.82 ▲6.81
Posts /wp-admin/edit.php6.51 ▲2.8662.41 ▲9.77
Add New Post /wp-admin/post-new.php10.11 ▲3.14110.89 ▼1,152.66
Media Library /wp-admin/upload.php6.32 ▲3.0250.28 ▲17.97
Toolbox /wp-admin/admin.php?page=litespeed-toolbox6.91624.24
CDN /wp-admin/admin.php?page=litespeed-cdn6.4144.65
Dashboard /wp-admin/admin.php?page=litespeed7.0551.51
Cache /wp-admin/admin.php?page=litespeed-cache6.5351.93
LiteSpeed Cache /wp-admin/options-general.php?page=litespeed-cache-options6.5250.77
Page Optimization /wp-admin/admin.php?page=litespeed-page_optm6.6153.87
Database /wp-admin/admin.php?page=litespeed-db_optm6.4558.42
Image Optimization /wp-admin/admin.php?page=litespeed-img_optm6.7961.77
Crawler /wp-admin/admin.php?page=litespeed-crawler6.6368.36
General /wp-admin/admin.php?page=litespeed-general6.4344.97

Server storage [IO: ▲2.81MB] [DB: ▲0.02MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • There were 3 files (6.18KB) illegally modified outside of "wp-content/plugins/litespeed-cache/" and "wp-content/uploads/"
    • (modified) .htaccess
    • (new file) .htaccess.bk
    • (modified) wp-config.php
Filesystem: 271 new files
Database: 2 new tables, 196 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for LiteSpeed Cache
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,035 ▲28115.83 ▲0.328.10 ▲0.052.83 ▼0.92
Dashboard /wp-admin3,073 ▲1546.48 ▲0.10194.11 ▼10.02202.38 ▼12.70
Posts /wp-admin/edit.php2,844 ▲1233.45 ▲0.03106.98 ▲13.46172.79 ▼8.66
Add New Post /wp-admin/post-new.php1,746 ▲8517.04 ▲1.31788.78 ▲147.33203.39 ▲6.35
Media Library /wp-admin/upload.php1,919 ▲1895.76 ▲0.03182.41 ▼7.89278.12 ▲13.94
Toolbox /wp-admin/admin.php?page=litespeed-toolbox3,3713.1379.62276.91
CDN /wp-admin/admin.php?page=litespeed-cdn1,9328.93449.26185.50
Dashboard /wp-admin/admin.php?page=litespeed1,9832.9180.00303.68
Cache /wp-admin/admin.php?page=litespeed-cache4,3193.1382.51223.83
LiteSpeed Cache /wp-admin/options-general.php?page=litespeed-cache-options4,3233.1477.53238.05
Page Optimization /wp-admin/admin.php?page=litespeed-page_optm4,0463.12101.47248.37
Database /wp-admin/admin.php?page=litespeed-db_optm2,5912.9681.18178.63
Image Optimization /wp-admin/admin.php?page=litespeed-img_optm2,1833.0977.23257.48
Crawler /wp-admin/admin.php?page=litespeed-crawler2,31110.85374.95204.74
General /wp-admin/admin.php?page=litespeed-general1,7103.0591.43206.07

Uninstaller [IO: ▲0.01MB] [DB: ▲0.01MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 197 options in the database
    • litespeed.conf.purge-timed_urls_time
    • litespeed.conf.cache-page_login
    • litespeed.conf.guest_uas
    • litespeed.conf.object
    • litespeed.conf.optm-noscript_rm
    • litespeed.conf.cdn-attr
    • litespeed.conf.optm-ucss_whitelist
    • litespeed.conf.media-lazy_cls_exc
    • litespeed.conf.optm-js_exc
    • litespeed.conf.purge-post_m
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/litespeed-cache/guest.vary.php
    • > /wp-content/plugins/litespeed-cache/tpl/inc/modal.footer.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      file_get_contents(wp-content/.litespeed_conf.dat): failed to open stream: No such file or directory in /var/www/wordpress/wp-content/plugins/litespeed-cache/lib/guest.cls.php on line 31

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=litespeed-crawler
    • > Console-api (warning) in wp-content/plugins/litespeed-cache/assets/js/babel.min.js?ver=4.6+23:30829
    You are using the in-browser Babel transformer. Be sure to precompile your scripts for production - https://babeljs.io/docs/setup/


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
Please take inspiration from this readme.txt

litespeed-cache/litespeed-cache.php Passed 13 tests

The main file in "LiteSpeed Cache" v. 4.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
66 characters long description:
High-performance page caching and site optimization from LiteSpeed

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected32,898 lines of code in 248 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity45.22
▷ Minimum class complexity1.00
▷ Maximum class complexity209.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
▷ Abstract classes22.33%
▷ Concrete classes8497.67%
▷ Final classes00.00%
▷ Static methods29128.64%
▷ Public methods73572.34%
▷ Protected methods424.13%
▷ Private methods23923.52%
▷ Named functions3061.22%
▷ Anonymous functions1938.78%
▷ Global constants8012.97%
▷ Class constants53787.03%
▷ Public constants537100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings