10% imagus

Code Review | Imagus image optimizer

WordPress plugin Imagus image optimizer scored 10% from 54 tests.

About plugin

  • Plugin page: imagus
  • Plugin version: 0.8.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 13, 2021
  • Latest release: Feb 28, 2022
  • Number of updates: 7
  • Update frequency: every 19.7 days
  • Top authors: rdelblanco (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 448 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/imagus/vendor/composer/autoload_real.php+71
    require(wp-content/plugins/imagus/vendor/composer/../symfony/deprecation-contracts/function.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.00MB] [CPU: ▼10.24ms] Passed 4 tests

This is a short check of server-side resources used by Imagus image optimizer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.22 ▼9.16
Dashboard /wp-admin3.31 ▲0.0042.98 ▼6.16
Posts /wp-admin/edit.php3.36 ▲0.0046.25 ▼8.80
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.54 ▼16.85
Media Library /wp-admin/upload.php3.23 ▲0.0035.35 ▲0.69

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 206 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Imagus image optimizer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.131.80 ▲0.0145.02 ▲6.51
Dashboard /wp-admin2,209 ▲214.86 ▼1.02103.87 ▼15.3639.47 ▼3.56
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0039.66 ▼4.3635.98 ▼2.70
Add New Post /wp-admin/post-new.php1,514 ▼617.59 ▼5.79696.52 ▲14.2954.79 ▼0.35
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.0897.07 ▼4.5543.85 ▼0.88

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% 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 everything seems fine, this is not 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
Please fix the following items
  • 50× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/imagus/vendor/guzzlehttp/psr7/src/UploadedFile.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/imagus/vendor/guzzlehttp/psr7/src/FnStream.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/imagus/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/imagus/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/imagus/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/imagus/vendor/guzzlehttp/promises/src/FulfilledPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/imagus/vendor/guzzlehttp/promises/src/Coroutine.php:45
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/imagus/vendor/guzzlehttp/promises/src/EachPromise.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/imagus/vendor/guzzlehttp/psr7/src/DroppingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/imagus/vendor/psr/http-message/src/RequestInterface.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2 in imagus/assets to your readme.txt
The official readme.txt is a good inspiration

imagus/imagus.php 92% from 13 tests

The main file in "Imagus image optimizer" v. 0.8.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin32,758 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
PHP1452,5456,43827,692
Markdown131,20803,558
JSON10001,044
JavaScript2250258
YAML522391
PO File1161753
CSS28942
Dockerfile18010
make1409
SVG1001

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity16.96
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces14
Interfaces14
Traits2
Classes95
▷ Abstract classes00.00%
▷ Concrete classes95100.00%
▷ Final classes3536.84%
Methods791
▷ Static methods17121.62%
▷ Public methods64982.05%
▷ Protected methods40.51%
▷ Private methods13817.45%
Functions161
▷ Named functions7244.72%
▷ Anonymous functions8955.28%
Constants175
▷ Global constants4726.86%
▷ Class constants12873.14%
▷ Public constants11791.41%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_glass_75_e6e6e6_1x400.png0.32KB0.15KB▼ 53.40%
admin/css/images/ui-icons_888888_256x240.png6.94KB4.18KB▼ 39.78%
admin/css/images/ui-bg_glass_75_dadada_1x400.png0.32KB0.16KB▼ 50.46%
admin/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%
admin/css/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%