73% less-compiler

Code Review | LESS Compiler

WordPress plugin LESS Compiler scored 73% from 54 tests.

About plugin

  • Plugin page: less-compiler
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.0
  • WordPress version: 6.3.1
  • First release: May 11, 2014
  • Latest release: Oct 10, 2014
  • Number of updates: 27
  • Update frequency: every 5.6 days
  • Top authors: WebMaestro.Fr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 1,647 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.23MB] [CPU: ▼41.00ms] Passed 4 tests

Server-side resources used by LESS Compiler
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7220.58 ▼22.82
Dashboard /wp-admin2.79 ▼0.5219.08 ▼34.62
Posts /wp-admin/edit.php2.79 ▼0.5717.99 ▼36.00
Add New Post /wp-admin/post-new.php2.79 ▼3.1022.76 ▼70.55
Media Library /wp-admin/upload.php2.79 ▼0.4420.06 ▼17.90

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

A short overview of filesystem and database impact
Just a few items left to fix
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/less-compiler/" and "wp-content/uploads/"
    • (new file) wp-content/cache/.empty
Filesystem: 16 new files
Database: no new tables, 8 new options
New WordPress options
less_compiler
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
less_variables_defaults

Browser metrics Passed 4 tests

This is an overview of browser requirements for LESS Compiler
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2613.24 ▲0.021.83 ▲0.1639.83 ▼8.84
Dashboard /wp-admin2,209 ▼05.85 ▲0.85106.80 ▲4.2475.59 ▲29.03
Posts /wp-admin/edit.php2,110 ▲212.00 ▼0.0339.80 ▲1.5934.10 ▼0.79
Add New Post /wp-admin/post-new.php1,559 ▲1623.96 ▲5.87712.47 ▲79.6052.80 ▼3.14
Media Library /wp-admin/upload.php1,400 ▲184.19 ▼0.0396.29 ▼0.7584.40 ▲40.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/less-compiler/plugin.php+131
    array_filter() expects parameter 1 to be array, bool given
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • widget_recent-comments
    • less_variables_defaults
    • widget_recent-posts
    • less_compiler
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/less-compiler/libs/less.php/Less.php on line 9495
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/less-compiler/libs/less.php/Less.php on line 9474
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/less-compiler/libs/less.php/Less.php on line 9544
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/less-compiler/libs/less.php/Less.php on line 9518
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_setting() in wp-content/plugins/less-compiler/compatibility.php:32
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/less-compiler/libs/less.php/Less.php on line 9498
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/less-compiler/libs/less.php/Less.php on line 9523
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/less-compiler/libs/wm-settings/wm-settings.php:395
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/less-compiler/libs/less.php/Less.php on line 9485
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/less-compiler/libs/less.php/Less.php on line 9479

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === less-compiler === )
The official readme.txt is a good inspiration

less-compiler/plugin.php 85% from 13 tests

"LESS Compiler" version 1.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("less-compiler.php" instead of "plugin.php")

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 plugin14,394 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript57729437,058
PHP62,2421,9677,017
CSS33924319

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity25.60
▷ Minimum class complexity1.00
▷ Maximum class complexity386.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes60
▷ Abstract classes11.67%
▷ Concrete classes5998.33%
▷ Final classes00.00%
Methods558
▷ Static methods529.32%
▷ Public methods44279.21%
▷ Protected methods173.05%
▷ Private methods9917.74%
Functions13
▷ Named functions753.85%
▷ Anonymous functions646.15%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/menu-icon.png15.34KB0.52KB▼ 96.61%