84% lwscache

Code Review | LWSCache

WordPress plugin LWSCache scored84%from 54 tests.

About plugin

  • Plugin page: lwscache
  • Plugin version: 2.7.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 17, 2022
  • Latest release: Nov 10, 2023
  • Number of updates: 31
  • Update frequency: every 19.5 days
  • Top authors: aurelienlws (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10,000+ active /53,276 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.64ms] Passed 4 tests

Analyzing server-side resources used by LWSCache
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.52 ▲1.66
Dashboard /wp-admin3.37 ▲0.0346.70 ▼17.98
Posts /wp-admin/edit.php3.43 ▲0.0745.33 ▼5.07
Add New Post /wp-admin/post-new.php5.96 ▲0.0780.08 ▼5.16
Media Library /wp-admin/upload.php3.30 ▲0.0734.82 ▲1.71

Server storage [IO: ▲0.74MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 65 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for LWSCache
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲20714.37 ▲0.021.75 ▲0.0539.09 ▼4.29
Dashboard /wp-admin2,333 ▲1595.56 ▼0.0489.00 ▲0.4877.76 ▲31.94
Posts /wp-admin/edit.php2,247 ▲1471.99 ▼0.0134.03 ▼6.9932.19 ▼4.97
Add New Post /wp-admin/post-new.php1,827 ▲30121.97 ▼1.09710.87 ▲39.5951.88 ▲2.71
Media Library /wp-admin/upload.php1,553 ▲1564.12 ▼0.0899.06 ▼0.3472.33 ▲30.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lwscache/admin/partials/lws-cache-admin-display.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Purger' not found in wp-content/plugins/lwscache/admin/class-phpredis-purger.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/lwscache/admin/partials/lws-cache-our-plugins.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Purger' not found in wp-content/plugins/lwscache/admin/class-varnish-purger.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function lws_cache_settings() on null in wp-content/plugins/lwscache/admin/partials/lws-cache-general-options.php:124
    • > PHP Fatal error
      Uncaught Error: Class 'Purger' not found in wp-content/plugins/lwscache/admin/class-predis-purger.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Purger' not found in wp-content/plugins/lwscache/admin/class-fastcgi-purger.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: lws, cache, nginx

lwscache/lwscache.php Passed 13 tests

"LWSCache" version 2.7.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
63 characters long description:
Cleans nginx's proxy cache whenever a post is edited/published.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin12,950 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
PHP202,6886,94910,613
CSS311891859
SVG29326701
PO File2322357693
JavaScript1214650
JSON10034

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity4.53
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces22
Interfaces25
Traits0
Classes244
▷ Abstract classes114.51%
▷ Concrete classes23395.49%
▷ Final classes10.43%
Methods940
▷ Static methods252.66%
▷ Public methods72477.02%
▷ Protected methods17018.09%
▷ Private methods464.89%
Functions26
▷ Named functions1869.23%
▷ Anonymous functions830.77%
Constants29
▷ Global constants931.03%
▷ Class constants2068.97%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/icons/logo_lws.png7.05KB3.16KB▼ 55.23%
admin/icons/nginx-icon-32x32.png3.85KB1.26KB▼ 67.29%