73% smart-image-resize

Code Review | Smart Image Resize - Make WooCommerce Images the Same Size

WordPress plugin Smart Image Resize - Make WooCommerce Images the Same Size scored73%from 54 tests.

About plugin

  • Plugin page: smart-image-resize
  • Plugin version: 1.8.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 14, 2018
  • Latest release: Sep 12, 2023
  • Number of updates: 152
  • Update frequency: every 11.6 days
  • Top authors: nlemsieh (100%)

Code review

54 tests

User reviews

72 reviews

Install metrics

10,000+ active /174,804 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲2.02MB] [CPU: ▲13.83ms] Passed 4 tests

An overview of server-side resources used by Smart Image Resize - Make WooCommerce Images the Same Size
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.50 ▲2.0460.42 ▲19.32
Dashboard /wp-admin5.36 ▲2.0169.37 ▲5.20
Posts /wp-admin/edit.php5.41 ▲2.0570.57 ▲22.93
Add New Post /wp-admin/post-new.php7.88 ▲1.99107.78 ▲7.86
Media Library /wp-admin/upload.php5.28 ▲2.0662.18 ▲24.41
Scheduled Actions /wp-admin/tools.php?page=action-scheduler5.4362.81
Smart Image Resize /wp-admin/options-general.php?page=wp-smart-image-resize5.2861.30

Server storage [IO: ▲2.10MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 340 new files
Database: 4 new tables, 12 new options
New tables
wp_actionscheduler_claims
wp_actionscheduler_groups
wp_actionscheduler_logs
wp_actionscheduler_actions
New WordPress options
widget_theysaidso_widget
widget_recent-posts
schema-ActionScheduler_LoggerSchema
widget_recent-comments
schema-ActionScheduler_StoreSchema
action_scheduler_lock_async-request-runner
theysaidso_admin_options
wp_sir_prev_plugin_version
can_compress_scripts
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for Smart Image Resize - Make WooCommerce Images the Same Size
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.28 ▲0.132.38 ▲0.6140.05 ▼0.32
Dashboard /wp-admin2,200 ▲295.60 ▲0.0184.91 ▼6.7237.68 ▼6.90
Posts /wp-admin/edit.php2,102 ▲22.06 ▲0.0934.16 ▼2.8631.24 ▼6.70
Add New Post /wp-admin/post-new.php1,554 ▲2318.10 ▼5.25650.87 ▼5.8653.26 ▲3.32
Media Library /wp-admin/upload.php1,471 ▲684.49 ▲0.29102.63 ▲4.5242.90 ▼4.49
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2231.8125.0028.37
Smart Image Resize /wp-admin/options-general.php?page=wp-smart-image-resize1,5143.8662.8334.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_actionscheduler_claims
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
  • The uninstall procedure has failed, leaving 12 options in the database
    • wp_sir_plugin_version
    • action_scheduler_lock_async-request-runner
    • can_compress_scripts
    • action_scheduler_hybrid_store_demarkation
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • schema-ActionScheduler_StoreSchema
    • wp_sir_prev_plugin_version
    • schema-ActionScheduler_LoggerSchema
    • widget_recent-posts
    • ...

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 206× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/smart-image-resize/src/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BlurCommand.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/smart-image-resize/src/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PickColorCommand.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/smart-image-resize/src/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BackupCommand.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/smart-image-resize/libraries/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Exception\\ImageException' not found in wp-content/plugins/smart-image-resize/src/vendor/intervention/image/src/Intervention/Image/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\AbstractEncoder' not found in wp-content/plugins/smart-image-resize/src/vendor/intervention/image/src/Intervention/Image/Imagick/Encoder.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/smart-image-resize/src/vendor/intervention/image/src/Intervention/Image/Gd/Commands/OpacityCommand.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/smart-image-resize/src/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InsertCommand.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/smart-image-resize/libraries/action-scheduler/lib/cron-expression/CronExpression_MinutesField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Gd\\Commands\\ResizeCommand' not found in wp-content/plugins/smart-image-resize/src/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FlipCommand.php:5

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 86% 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 need to be fixed:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
You can take inspiration from this readme.txt

smart-image-resize/plugpix-smart-image-resize.php 77% from 13 tests

The main PHP script in "Smart Image Resize - Make WooCommerce Images the Same Size" version 1.8.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("smart-image-resize.php" instead of "plugpix-smart-image-resize.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "3.0.0")

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin22,416 lines of code in 324 files:
LanguageFilesBlank linesComment linesLines of code
PHP3055,12310,57020,310
Markdown84290749
JavaScript210426491
JSON700482
CSS1525366
XML14018

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity9.01
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces25
Interfaces11
Traits5
Classes258
▷ Abstract classes249.30%
▷ Concrete classes23490.70%
▷ Final classes72.99%
Methods1,499
▷ Static methods17811.87%
▷ Public methods1,23582.39%
▷ Protected methods17011.34%
▷ Private methods946.27%
Functions168
▷ Named functions12172.02%
▷ Anonymous functions4727.98%
Constants65
▷ Global constants913.85%
▷ Class constants5686.15%
▷ Public constants56100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin