83% lc-scripts-optimizer

Code Review | LC Scripts Optimizer

WordPress plugin LC Scripts Optimizer scored83%from 54 tests.

About plugin

  • Plugin page: lc-scripts-optimizer
  • Plugin version: 1.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Oct 22, 2016
  • Latest release: Oct 26, 2023
  • Number of updates: 25
  • Update frequency: every 102.4 days
  • Top authors: LCweb Projects (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /3,144 total downloads

Benchmarks

Plugin footprint 82% 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.17MB] [CPU: ▼4.73ms] Passed 4 tests

Server-side resources used by LC Scripts Optimizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1737.24 ▼7.52
Dashboard /wp-admin3.47 ▲0.1646.38 ▼0.54
Posts /wp-admin/edit.php3.58 ▲0.2249.88 ▲1.55
Add New Post /wp-admin/post-new.php6.07 ▲0.1884.29 ▼12.41
Media Library /wp-admin/upload.php3.39 ▲0.1636.73 ▲4.55
LC Scripts Optimizer /wp-admin/tools.php?page=lcso_settings3.4734.57

Server storage [IO: ▲0.48MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/lc-scripts-optimizer/" and "wp-content/uploads/"
    • (new file) wp-content/lcso-cache/.empty
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by LC Scripts Optimizer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲3614.36 ▲0.072.49 ▲0.6140.05 ▼4.66
Dashboard /wp-admin2,206 ▲295.58 ▼0.0781.70 ▼18.9436.64 ▼7.46
Posts /wp-admin/edit.php2,108 ▲82.00 ▼0.0235.91 ▼0.6033.53 ▲3.01
Add New Post /wp-admin/post-new.php1,533 ▲723.07 ▼0.11679.58 ▲72.2857.91 ▼4.46
Media Library /wp-admin/upload.php1,402 ▼14.20 ▼0.0093.68 ▼5.1042.52 ▼1.07
LC Scripts Optimizer /wp-admin/tools.php?page=lcso_settings1,1771.9333.2148.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lc-scripts-optimizer/ajax.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lc-scripts-optimizer/classes/frontend.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'lcso_engine' not found in wp-content/plugins/lc-scripts-optimizer/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lc-scripts-optimizer/lc_scripts_optimizer.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lc-scripts-optimizer/frontend.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 27 tag instead of maximum 10
Please take inspiration from this readme.txt

lc-scripts-optimizer/lc_scripts_optimizer.php 92% from 13 tests

Analyzing the main PHP file in "LC Scripts Optimizer" version 1.4.0
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("lc-scripts-optimizer.php" instead of "lc_scripts_optimizer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin8,258 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
HTML48803,267
JavaScript7229532,342
PHP97513901,697
CSS68139874
PO File116735978

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity60.00
▷ Minimum class complexity7.00
▷ Maximum class complexity108.00
Average method complexity6.27
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods3358.93%
▷ Protected methods1119.64%
▷ Private methods1221.43%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/chosen/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%
js/chosen/chosen-sprite.png0.63KB0.88KB0.00%
js/chosen/docsupport/oss-credit.png6.55KB3.26KB▼ 50.17%
js/chosen/docsupport/chosen.png3.39KB2.08KB▼ 38.62%