84% lws-tools

Code Review | LWS Tools

WordPress plugin LWS Tools scored 84% from 54 tests.

About plugin

  • Plugin page: lws-tools
  • Plugin version: 2.4.5
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 16, 2022
  • Latest release: Aug 10, 2023
  • Number of updates: 23
  • Update frequency: every 14.3 days
  • Top authors: aurelienlws (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10,000+ active / 36,026 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▲2.83ms] Passed 4 tests

This is a short check of server-side resources used by LWS Tools
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3143.64 ▲0.37
Dashboard /wp-admin3.59 ▲0.2950.87 ▲0.83
Posts /wp-admin/edit.php3.64 ▲0.2852.82 ▲8.18
Add New Post /wp-admin/post-new.php6.11 ▲0.22100.73 ▲3.65
Media Library /wp-admin/upload.php3.45 ▲0.2241.25 ▲6.45

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 226 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for LWS Tools
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲14813.62 ▼0.761.80 ▼0.0336.73 ▼9.68
Dashboard /wp-admin2,267 ▲795.88 ▲1.02105.22 ▼1.3474.54 ▲33.71
Posts /wp-admin/edit.php2,147 ▲581.99 ▼0.1037.52 ▼1.8433.42 ▼1.70
Add New Post /wp-admin/post-new.php1,584 ▲5123.17 ▼0.09696.76 ▲102.5949.85 ▼7.02
Media Library /wp-admin/upload.php1,440 ▲494.18 ▲0.0198.47 ▲0.0670.61 ▲26.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/lws-tools/view/notifications.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/lws-tools/view/mysql.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/lws-tools/view/optimisation.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/lws-tools/view/security.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/lws-tools/view/update_htaccess.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/lws-tools/view/change_htaccess.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lws-tools/view/tabs.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lws-tools/view/server.php:3
    • > PHP Notice
      Undefined variable: opts in wp-content/plugins/lws-tools/view/update_htaccess.php on line 3
    • > PHP Notice
      Undefined variable: up_to_date in wp-content/plugins/lws-tools/view/notifications.php on line 6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #8, #9 in lws-tools/assets to your readme.txt
Please take inspiration from this readme.txt

lws-tools/lws-tools.php Passed 13 tests

The main file in "LWS Tools" v. 2.4.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
45 characters long description:
Optimize and modify your website's parameters

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
Good job! No executable or dangerous file extensions detected30,701 lines of code in 186 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript565,29815,91018,696
CSS442732277,029
PHP122892613,075
SVG734681,413
PO File1238247488

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions59
▷ Named functions3966.10%
▷ Anonymous functions2033.90%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
DataTables/DataTables-1.12.1/images/sort_both.png0.20KB0.29KB0.00%
DataTables/DataTables-1.12.1/images/sort_asc_disabled.png0.14KB0.25KB0.00%
images/icon-256x256.png36.35KB9.15KB▼ 74.82%
DataTables/DataTables-1.12.1/images/sort_desc_disabled.png0.14KB0.25KB0.00%
DataTables/DataTables-1.12.1/images/sort_asc.png0.16KB0.25KB0.00%