73% wp-less-compiler

Code Review | WP Less Compiler

WordPress plugin WP Less Compiler scored73%from 54 tests.

About plugin

  • Plugin page: wp-less-compiler
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-3.9.2
  • WordPress version: 6.3.1
  • First release: May 28, 2014
  • Latest release: Sep 10, 2014
  • Number of updates: 7
  • Update frequency: every 15.1 days
  • Top authors: The Jake Group (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /3,523 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.81ms] Passed 4 tests

This is a short check of server-side resources used by WP Less Compiler
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0135.69 ▼1.91
Dashboard /wp-admin3.32 ▲0.0244.31 ▼4.86
Posts /wp-admin/edit.php3.43 ▲0.0844.69 ▲1.47
Add New Post /wp-admin/post-new.php5.90 ▲0.0279.02 ▼17.43
Media Library /wp-admin/upload.php3.24 ▲0.0132.42 ▼3.03
Less Compiler /wp-admin/options-general.php?page=less-compiler-menu3.1929.05

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WP Less Compiler
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.25 ▼0.131.54 ▼0.1041.06 ▼2.52
Dashboard /wp-admin2,199 ▲225.56 ▼0.0281.46 ▼7.6037.73 ▼4.44
Posts /wp-admin/edit.php2,104 ▲41.97 ▼0.0537.70 ▲1.2033.56 ▼6.74
Add New Post /wp-admin/post-new.php1,536 ▲823.29 ▲0.02691.29 ▲0.5458.74 ▲2.18
Media Library /wp-admin/upload.php1,407 ▲74.16 ▼0.0692.72 ▼8.8544.79 ▼0.89
Less Compiler /wp-admin/options-general.php?page=less-compiler-menu9312.0525.1753.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=less-compiler-menu
    • > Notice in wp-content/plugins/wp-less-compiler/Asset.php+38
    hash_file(): read of 8192 bytes failed with errno=21 Is a directory

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-less-compiler/lib/ajax-file-browser/browser.class.php
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'PluginObject' not found in wp-content/plugins/wp-less-compiler/SettingsStyle.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PluginObject' not found in wp-content/plugins/wp-less-compiler/Processor.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-less-compiler/Controller.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PluginObject' not found in wp-content/plugins/wp-less-compiler/Compiler.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PluginObject' not found in wp-content/plugins/wp-less-compiler/CssStyle.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PluginObject' not found in wp-content/plugins/wp-less-compiler/Controller.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PluginObject' not found in wp-content/plugins/wp-less-compiler/Asset.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PluginObject' not found in wp-content/plugins/wp-less-compiler/SettingsHtml.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PluginObject' not found in wp-content/plugins/wp-less-compiler/LessStyle.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: less, less compiler, css, css preprocessor

wp-less-compiler/wp-less-compiler.php Passed 13 tests

The main file in "WP Less Compiler" v. 1.3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
106 characters long description:
Compiles LESS into CSS. Allows the administrator to output LESS to Admin users, and CSS to everyone else.

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
No dangerous file extensions were detected1,401 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP12337235978
JavaScript45410173
Markdown21010163
CSS210087

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.50
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods88
▷ Static methods00.00%
▷ Public methods3640.91%
▷ Protected methods22.27%
▷ Private methods5056.82%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants110.00%
▷ Class constants990.00%
▷ Public constants9100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/ajax-file-browser/directory.png1.23KB0.40KB▼ 67.38%
lib/ajax-file-browser/file.png1.31KB0.42KB▼ 67.56%