72% litespeed-cache

Code Review | LiteSpeed Cache

WordPress plugin LiteSpeed Cache scored72%from 54 tests.

About plugin

  • Plugin page: litespeed-cache
  • Plugin version: 5.7.0.1
  • 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

Benchmarks

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)
Page Memory (MB) CPU Time (ms)
Home / 5.98 ▲2.52 61.88 ▲22.51
Dashboard /wp-admin 6.55 ▲3.24 58.41 ▲10.54
Posts /wp-admin/edit.php 6.62 ▲3.26 66.55 ▲20.01
Add New Post /wp-admin/post-new.php 9.20 ▲3.32 94.65 ▲6.80
Media Library /wp-admin/upload.php 6.55 ▲3.32 56.14 ▲21.06
General /wp-admin/admin.php?page=litespeed-general 6.92 525.89
Image Optimization /wp-admin/admin.php?page=litespeed-img_optm 6.99 60.54
Dashboard /wp-admin/admin.php?page=litespeed 7.40 62.31
Page Optimization /wp-admin/admin.php?page=litespeed-page_optm 6.94 65.95
Toolbox /wp-admin/admin.php?page=litespeed-toolbox 6.74 56.36
Crawler /wp-admin/admin.php?page=litespeed-crawler 7.04 71.15
Presets /wp-admin/admin.php?page=litespeed-presets 6.53 55.46
CDN /wp-admin/admin.php?page=litespeed-cdn 6.69 56.17
LiteSpeed Cache /wp-admin/options-general.php?page=litespeed-cache-options 6.74 57.47
Database /wp-admin/admin.php?page=litespeed-db_optm 6.63 56.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
wp_litespeed_url
wp_litespeed_url_file
New WordPress options
widget_recent-comments
litespeed.conf.optm-ucss_inline
litespeed.purge.queue
litespeed.conf.cache-favicon
litespeed.conf.crawler-crawl_interval
litespeed.conf.debug-exc_strings
litespeed.conf.media-lqip_exc
litespeed.conf.api_key
litespeed.conf.cache-resources
litespeed.conf.news
...

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
Page Nodes Memory (MB) Script (ms) Layout (ms)
Home / 2,937 ▲176 14.28 ▼0.14 1.87 ▲0.30 38.31 ▼6.99
Dashboard /wp-admin 2,298 ▲121 5.68 ▲0.12 95.00 ▼7.34 41.86 ▼0.04
Posts /wp-admin/edit.php 2,203 ▲103 2.01 ▼0.03 41.43 ▲5.99 34.45 ▼2.84
Add New Post /wp-admin/post-new.php 6,341 ▲4,815 20.80 ▼2.96 874.65 ▲167.55 83.08 ▲21.75
Media Library /wp-admin/upload.php 1,577 ▲177 4.17 ▼0.05 93.07 ▼10.68 40.12 ▼1.90
General /wp-admin/admin.php?page=litespeed-general 1,317 1.91 27.48 57.93
Image Optimization /wp-admin/admin.php?page=litespeed-img_optm 1,526 2.03 27.60 53.82
Dashboard /wp-admin/admin.php?page=litespeed 1,539 2.07 26.07 51.94
Page Optimization /wp-admin/admin.php?page=litespeed-page_optm 2,973 1.93 31.25 51.10
Toolbox /wp-admin/admin.php?page=litespeed-toolbox 2,491 1.92 29.83 57.05
Crawler /wp-admin/admin.php?page=litespeed-crawler 1,724 10.16 222.50 38.93
Presets /wp-admin/admin.php?page=litespeed-presets 1,323 2.22 25.37 45.54
CDN /wp-admin/admin.php?page=litespeed-cdn 1,524 10.93 251.99 37.95
LiteSpeed Cache /wp-admin/options-general.php?page=litespeed-cache-options 2,976 1.92 33.58 49.42
Database /wp-admin/admin.php?page=litespeed-db_optm 1,944 2.22 26.21 33.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=5.7.0.1+23:30829
    You are using the in-browser Babel transformer. Be sure to precompile your scripts for production - https://babeljs.io/docs/setup/

Optimizations

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 5.7.0.1 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:
Language Files Blank lines Comment lines Lines of code
PHP 199 6,762 10,910 29,856
CSS 3 744 139 3,058
JavaScript 21 257 202 1,908
SVG 37 14 35 1,472
INI 2 280 195 402
SQL 7 0 0 62

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 code 0.39
Average class complexity 46.14
▷ Minimum class complexity 1.00
▷ Maximum class complexity 228.00
Average method complexity 4.67
▷ Minimum method complexity 1.00
▷ Maximum method complexity 66.00
Code structure
Namespaces 6
Interfaces 0
Traits 0
Classes 94
▷ Abstract classes 2 2.13%
▷ Concrete classes 92 97.87%
▷ Final classes 0 0.00%
Methods 1,139
▷ Static methods 327 28.71%
▷ Public methods 832 73.05%
▷ Protected methods 43 3.78%
▷ Private methods 264 23.18%
Functions 70
▷ Named functions 40 57.14%
▷ Anonymous functions 30 42.86%
Constants 669
▷ Global constants 84 12.56%
▷ Class constants 585 87.44%
▷ Public constants 585 100.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
File Size - original Size - compressed Savings
assets/img/slack-logo.png 1.18KB 1.21KB 0.00%
assets/img/lscwp-logo_90x90.png 1.64KB 1.70KB 0.00%
assets/img/quic-cloud-logo-light_stack_300px.png 3.59KB 3.64KB 0.00%