74% resize-image-before-upload

Code Review | Resize Image Before Upload

WordPress plugin Resize Image Before Upload scored74%from 54 tests.

About plugin

  • Plugin page: resize-image-befo...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 15, 2023
  • Latest release: Sep 10, 2023
  • Number of updates: 12
  • Update frequency: every 18.4 days
  • Top authors: tmmtechnology (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /313 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.29MB] [CPU: ▲8.13ms] Passed 4 tests

Server-side resources used by Resize Image Before Upload
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2845.51 ▲6.06
Dashboard /wp-admin3.64 ▲0.3454.37 ▲4.30
Posts /wp-admin/edit.php3.68 ▲0.3356.00 ▲9.92
Add New Post /wp-admin/post-new.php6.17 ▲0.28117.43 ▲25.81
Media Library /wp-admin/upload.php3.49 ▲0.2644.97 ▲12.22
Scheduled Actions /wp-admin/tools.php?page=action-scheduler3.6658.09
Resize Before Upload /wp-admin/upload.php?page=ribu3.5240.16

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 575 new files
Database: 4 new tables, 10 new options
New tables
wp_actionscheduler_actions
wp_actionscheduler_logs
wp_actionscheduler_claims
wp_actionscheduler_groups
New WordPress options
can_compress_scripts
wp-plugins-core-notifications-resize-image-before-upload
schema-ActionScheduler_StoreSchema
db_upgraded
widget_theysaidso_widget
widget_recent-posts
schema-ActionScheduler_LoggerSchema
widget_recent-comments
theysaidso_admin_options
action_scheduler_hybrid_store_demarkation

Browser metrics Passed 4 tests

An overview of browser requirements for Resize Image Before Upload
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,045 ▲31014.46 ▲0.223.72 ▲1.8441.27 ▼3.78
Dashboard /wp-admin2,460 ▲2726.03 ▲0.93133.05 ▲23.9445.65 ▲5.20
Posts /wp-admin/edit.php2,175 ▲832.99 ▲0.9846.19 ▲6.1933.94 ▼1.43
Add New Post /wp-admin/post-new.php1,537 ▲1823.48 ▲0.36716.97 ▲50.8236.44 ▼28.75
Media Library /wp-admin/upload.php1,487 ▲1054.90 ▲0.7090.76 ▼9.4442.11 ▼1.92
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,4162.5233.9831.14
Resize Before Upload /wp-admin/upload.php?page=ribu1,0192.7442.7929.68

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
    • wp_actionscheduler_claims
  • Zombie WordPress options were found after uninstall: 10 options
    • wp-plugins-core-notifications-resize-image-before-upload
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • schema-ActionScheduler_StoreSchema
    • schema-ActionScheduler_LoggerSchema
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • action_scheduler_hybrid_store_demarkation

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 53× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Action' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_FinishedAction.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Action_Scheduler\\Migration\\LogMigrator' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/classes/migration/DryRun_LogMigrator.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/resize-image-before-upload/src/templates/admin/screens/main.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_QueueRunner' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueRunner.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'CronExpression_FieldInterface' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_AbstractField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_MinutesField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Logger' not found in wp-content/plugins/resize-image-before-upload/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_DBLogger.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: optimization, resize, images, image-resize

resize-image-before-upload/resize-image-before-upload.php 85% from 13 tests

"Resize Image Before Upload" version 1.0.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 146 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin57,247 lines of code in 470 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1635,9261,10033,882
PHP1673,3178,51516,174
CSS491121172,501
TypeScript445833,4382,012
Sass20461845
JSON700617
Markdown102430551
LESS71325415
Svelte2310244
XML1216

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity13.74
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces12
Interfaces3
Traits0
Classes135
▷ Abstract classes1511.11%
▷ Concrete classes12088.89%
▷ Final classes2016.67%
Methods950
▷ Static methods15416.21%
▷ Public methods66870.32%
▷ Protected methods19120.11%
▷ Private methods919.58%
Functions129
▷ Named functions9674.42%
▷ Anonymous functions3325.58%
Constants60
▷ Global constants1728.33%
▷ Class constants4371.67%
▷ Public constants4297.67%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin