78% assetsminify

Code Review | AssetsMinify

WordPress plugin AssetsMinify scored78%from 54 tests.

About plugin

  • Plugin page: assetsminify
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2013
  • Latest release: Apr 21, 2015
  • Number of updates: 51
  • Update frequency: every 15.0 days
  • Top authors: ale.carbo (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

100+ active /18,725 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▲3.17ms] Passed 4 tests

A check of server-side resources used by AssetsMinify
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.91 ▲2.41478.36 ▲437.44
Dashboard /wp-admin3.62 ▲0.2753.84 ▲4.06
Posts /wp-admin/edit.php3.67 ▲0.2752.75 ▲2.98
Add New Post /wp-admin/post-new.php6.13 ▲0.2188.98 ▼0.78
Media Library /wp-admin/upload.php3.48 ▲0.2139.50 ▲6.40
AssetsMinify /wp-admin/options-general.php?page=assets-minify3.4543.71

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 979 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
am_last_gc
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for AssetsMinify
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,767 ▲614.28 ▼0.342.22 ▲0.5442.73 ▲0.95
Dashboard /wp-admin2,196 ▲225.61 ▲0.0587.89 ▼0.5641.14 ▼2.50
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0135.74 ▼7.0833.11 ▼5.26
Add New Post /wp-admin/post-new.php1,531 ▲523.11 ▼0.60640.70 ▼33.8854.03 ▼0.55
Media Library /wp-admin/upload.php1,407 ▲104.18 ▲0.0195.22 ▼9.9940.96 ▼5.99
AssetsMinify /wp-admin/options-general.php?page=assets-minify9871.9923.0229.96

Uninstaller [IO: ▲1.11MB] [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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • am_last_gc
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

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
Please fix the following items
  • 33× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_unit_tests/test_Minify_Cache_File.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_unit_tests/test_Minify_CSS.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_unit_tests/test_Minify_Cache_Memcache.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_unit_tests/test_Minify_JS_ClosureCompiler.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_extras/tools/minifyUrl.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_unit_tests/test_Minify_ImportProcessor.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_extras/tools/testRewriteUri.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_unit_tests/HTTP_ConditionalGet/2.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min_unit_tests/test_JSMinPlus.php
    • > /wp-content/plugins/assetsminify/vendor/mrclay/minify/min/builder/index.php
  • 307× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Assetic\\Filter\\BaseNodeFilter' not found in wp-content/plugins/assetsminify/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Assetic\\Asset\\AssetCollection' not found in wp-content/plugins/assetsminify/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Assetic\\Filter\\FilterInterface' not found in wp-content/plugins/assetsminify/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/assetsminify/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php:24
    • > PHP Fatal error
      require(): Failed opening required '/Minify/Loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/assetsminify/vendor/mrclay/minify/min_extras/cli/rewrite-uris.php on line 6
    • > PHP Warning
      stream_set_blocking() expects parameter 1 to be resource, string given in wp-content/plugins/assetsminify/vendor/symfony/process/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/assetsminify/vendor/monolog/monolog/tests/Monolog/Handler/SamplingHandlerTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Process\\Pipes\\AbstractPipes' not found in wp-content/plugins/assetsminify/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' not found in wp-content/plugins/assetsminify/vendor/symfony/process/Symfony/Component/Process/Exception/RuntimeException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/assetsminify/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php:19

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: js, compass, assets, sass, coffeescript...

assetsminify/plugin.php 92% from 13 tests

This is the main PHP file of "AssetsMinify" version 2.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("assetsminify.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin62,298 lines of code in 930 files:
LanguageFilesBlank linesComment linesLines of code
PHP4569,33016,17239,048
CSS1019783545,255
Sass1151,3611,2084,736
Markdown261,11803,334
YAML25137903,152
JavaScript1357448893,074
LESS36479561,550
JSON14101,396
HTML71662280
Java17477231
XML7131132
Bourne Shell5387104
make2306

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.13
▷ Minimum class complexity1.00
▷ Maximum class complexity474.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces49
Interfaces21
Traits2
Classes408
▷ Abstract classes245.88%
▷ Concrete classes38494.12%
▷ Final classes00.00%
Methods2,750
▷ Static methods1495.42%
▷ Public methods1,98472.15%
▷ Protected methods59421.60%
▷ Private methods1726.25%
Functions128
▷ Named functions6046.88%
▷ Anonymous functions6853.12%
Constants246
▷ Global constants10743.50%
▷ Class constants13956.50%
▷ Public constants139100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and 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
vendor/mrclay/minify/min_unit_tests/HTTP_Encoder/green.png0.20KB0.08KB▼ 57.43%
vendor/leafo/scssphp/site/www/img/tile.png0.24KB0.16KB▼ 31.97%