83% wp-compiler

Code Review | WP Compiler

WordPress plugin WP Compiler scored83%from 54 tests.

About plugin

  • Plugin page: wp-compiler
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.0
  • WordPress version: 6.3.1
  • First release: Oct 21, 2018
  • Latest release: Oct 22, 2018
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: burlingtonbytes (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /3,086 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼0.38ms] Passed 4 tests

Analyzing server-side resources used by WP Compiler
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1846.25 ▲1.60
Dashboard /wp-admin3.48 ▲0.1856.49 ▲3.08
Posts /wp-admin/edit.php3.59 ▲0.2452.73 ▲2.21
Add New Post /wp-admin/post-new.php6.08 ▲0.1991.54 ▼4.62
Media Library /wp-admin/upload.php3.40 ▲0.1737.54 ▼0.72
WP Compiler /wp-admin/options-general.php?page=wp-compiler3.3835.13

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 159 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

WP Compiler: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲12613.39 ▼1.364.84 ▲2.8645.55 ▲2.04
Dashboard /wp-admin2,238 ▲534.83 ▼0.96101.52 ▼8.7741.87 ▲0.27
Posts /wp-admin/edit.php2,118 ▲322.03 ▲0.0036.30 ▼1.6732.80 ▼3.12
Add New Post /wp-admin/post-new.php1,535 ▲223.12 ▼0.05651.23 ▼46.0958.53 ▲2.47
Media Library /wp-admin/upload.php1,411 ▲264.26 ▲0.0297.61 ▼19.6844.76 ▼2.57
WP Compiler /wp-admin/options-general.php?page=wp-compiler9782.2126.8932.19

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
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • 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 | 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
  • 67× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/wp-compiler/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Leafo\\ScssPhp\\Formatter' not found in wp-content/plugins/wp-compiler/vendor/leafo/scssphp/src/Formatter/Compact.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/wp-compiler/vendor/oyejorge/less.php/lib/Less/Tree/DetachedRuleset.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Leafo\\ScssPhp\\Formatter' not found in wp-content/plugins/wp-compiler/vendor/leafo/scssphp/src/Formatter/Debug.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Configurable' not found in wp-content/plugins/wp-compiler/vendor/oyejorge/less.php/lib/Less/SourceMap/Generator.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exception' not found in wp-content/plugins/wp-compiler/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Visitor' not found in wp-content/plugins/wp-compiler/vendor/oyejorge/less.php/lib/Less/Visitor/extendFinder.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/wp-compiler/vendor/oyejorge/less.php/lib/Less/Tree/Variable.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/wp-compiler/vendor/oyejorge/less.php/lib/Less/Tree/Call.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/wp-compiler/vendor/oyejorge/less.php/lib/Less/Tree/Javascript.php:9

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 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
The official readme.txt might help

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

The main file in "WP Compiler" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
39 characters long description:
Compiles and minifies SCSS, LESS and JS

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected16,333 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
PHP1154,6866,31115,305
JSON600386
Markdown51430350
JavaScript130160
CSS12090
YAML10031
Dockerfile12011

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 130)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity32.21
▷ Minimum class complexity1.00
▷ Maximum class complexity709.00
Average method complexity4.03
▷ Minimum method complexity1.00
▷ Maximum method complexity130.00
Code structure
Namespaces11
Interfaces1
Traits0
Classes99
▷ Abstract classes66.06%
▷ Concrete classes9393.94%
▷ Final classes00.00%
Methods1,030
▷ Static methods545.24%
▷ Public methods59557.77%
▷ Protected methods32131.17%
▷ Private methods11411.07%
Functions22
▷ Named functions29.09%
▷ Anonymous functions2090.91%
Constants67
▷ Global constants00.00%
▷ Class constants67100.00%
▷ Public constants67100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.67MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png16.42KB7.59KB▼ 53.79%
assets/icon-128x128.png9.76KB4.39KB▼ 54.99%
assets/banner-772x250.png143.29KB68.60KB▼ 52.13%
assets/screenshot-3.png58.83KB34.57KB▼ 41.23%
assets/banner-1544x500.png449.83KB237.19KB▼ 47.27%