72% litespeed-cache

Code Review | LiteSpeed Cache

WordPress plugin LiteSpeed Cache scored72%from 54 tests.

About plugin

  • Plugin page: litespeed-cache
  • Plugin version:
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Jan 29, 2016
  • Latest release: Oct 25, 2023
  • Number of updates: 313
  • Update frequency: every 9.0 days
  • Top authors: LiteSpeedTech (89.78%)hailite (10.54%)

Code review

54 tests

User reviews

2297 reviews

Install metrics

4,000,000+ active /53,215,423 total downloads


Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲3.08MB] [CPU: ▲14.60ms] 75% from 4 tests

Server-side resources used by LiteSpeed Cache
Please fix the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 525.89ms on /wp-admin/admin.php?page=litespeed-general)
PageMemory (MB)CPU Time (ms)
Home /5.98 ▲2.5261.88 ▲22.51
Dashboard /wp-admin6.55 ▲3.2458.41 ▲10.54
Posts /wp-admin/edit.php6.62 ▲3.2666.55 ▲20.01
Add New Post /wp-admin/post-new.php9.20 ▲3.3294.65 ▲6.80
Media Library /wp-admin/upload.php6.55 ▲3.3256.14 ▲21.06
General /wp-admin/admin.php?page=litespeed-general6.92525.89
Image Optimization /wp-admin/admin.php?page=litespeed-img_optm6.9960.54
Dashboard /wp-admin/admin.php?page=litespeed7.4062.31
Page Optimization /wp-admin/admin.php?page=litespeed-page_optm6.9465.95
Toolbox /wp-admin/admin.php?page=litespeed-toolbox6.7456.36
Crawler /wp-admin/admin.php?page=litespeed-crawler7.0471.15
Presets /wp-admin/admin.php?page=litespeed-presets6.5355.46
CDN /wp-admin/admin.php?page=litespeed-cdn6.6956.17
LiteSpeed Cache /wp-admin/options-general.php?page=litespeed-cache-options6.7457.47
Database /wp-admin/admin.php?page=litespeed-db_optm6.6356.90

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

Input-output and database impact of this plugin
These are issues you should consider
  • Illegal file modification detected: 3 files (6.18KB) outside of "wp-content/plugins/litespeed-cache/" and "wp-content/uploads/"
    • (modified) wp-config.php
    • (new file) .htaccess.bk
    • (modified) .htaccess
Filesystem: 300 new files
Database: 2 new tables, 208 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for LiteSpeed Cache
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲17614.28 ▼0.141.87 ▲0.3038.31 ▼6.99
Dashboard /wp-admin2,298 ▲1215.68 ▲0.1295.00 ▼7.3441.86 ▼0.04
Posts /wp-admin/edit.php2,203 ▲1032.01 ▼0.0341.43 ▲5.9934.45 ▼2.84
Add New Post /wp-admin/post-new.php6,341 ▲4,81520.80 ▼2.96874.65 ▲167.5583.08 ▲21.75
Media Library /wp-admin/upload.php1,577 ▲1774.17 ▼0.0593.07 ▼10.6840.12 ▼1.90
General /wp-admin/admin.php?page=litespeed-general1,3171.9127.4857.93
Image Optimization /wp-admin/admin.php?page=litespeed-img_optm1,5262.0327.6053.82
Dashboard /wp-admin/admin.php?page=litespeed1,5392.0726.0751.94
Page Optimization /wp-admin/admin.php?page=litespeed-page_optm2,9731.9331.2551.10
Toolbox /wp-admin/admin.php?page=litespeed-toolbox2,4911.9229.8357.05
Crawler /wp-admin/admin.php?page=litespeed-crawler1,72410.16222.5038.93
Presets /wp-admin/admin.php?page=litespeed-presets1,3232.2225.3745.54
CDN /wp-admin/admin.php?page=litespeed-cdn1,52410.93251.9937.95
LiteSpeed Cache /wp-admin/options-general.php?page=litespeed-cache-options2,9761.9233.5849.42
Database /wp-admin/admin.php?page=litespeed-db_optm1,9442.2226.2133.80

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 209 options in the database
    • litespeed.conf.guest_optm
    • litespeed.conf.purge-post_p
    • litespeed.conf.media-placeholder_resp
    • litespeed.conf.purge-post_a
    • litespeed.conf.hash
    • litespeed.data.upgrading
    • litespeed.conf.optm-ccss_sep_uri
    • litespeed.conf.cache-mobile_rules
    • litespeed.conf.debug-inc
    • litespeed.conf.object-transients
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/litespeed-cache/tpl/inc/modal.footer.php
    • > /wp-content/plugins/litespeed-cache/guest.vary.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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 34

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=litespeed-cdn
    • > Console-api (warning) in wp-content/plugins/litespeed-cache/assets/js/babel.min.js?ver=
    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

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt is a good inspiration

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

The primary PHP file in "LiteSpeed Cache" version is used by WordPress to initiate all plugin functionality
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 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin36,758 lines of code in 269 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity46.14
▷ Minimum class complexity1.00
▷ Maximum class complexity228.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
▷ Abstract classes22.13%
▷ Concrete classes9297.87%
▷ Final classes00.00%
▷ Static methods32728.71%
▷ Public methods83273.05%
▷ Protected methods433.78%
▷ Private methods26423.18%
▷ Named functions4057.14%
▷ Anonymous functions3042.86%
▷ Global constants8412.56%
▷ Class constants58587.44%
▷ Public constants585100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings