10% resize-images-before-upload

Code Review | Resize images before upload

WordPress plugin Resize images before upload scored10%from 54 tests.

About plugin

  • Plugin page: resize-images-bef...
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6
  • WordPress version: 6.3.1
  • First release: Mar 13, 2012
  • Latest release: Jul 29, 2013
  • Number of updates: 36
  • Update frequency: every 18.0 days
  • Top authors: WPsites (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

3,000+ active /57,509 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/resize-images-before-upload/resize-images-before-upload.php+304
    Function create_function() is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼59.33ms] Passed 4 tests

Server-side resources used by Resize images before upload
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.70 ▼36.29
Dashboard /wp-admin2.11 ▼1.245.59 ▼63.41
Posts /wp-admin/edit.php2.11 ▼1.255.24 ▼45.07
Add New Post /wp-admin/post-new.php2.11 ▼3.785.56 ▼92.55
Media Library /wp-admin/upload.php2.11 ▼1.126.02 ▼28.66

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Resize images before upload
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲4713.55 ▼0.731.90 ▼0.2542.00 ▼4.77
Dashboard /wp-admin2,224 ▲244.85 ▼1.03115.33 ▲3.2344.68 ▼0.69
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0439.85 ▲3.3738.12 ▲3.19
Add New Post /wp-admin/post-new.php1,557 ▲2618.86 ▼4.36611.70 ▼46.2753.12 ▼21.63
Media Library /wp-admin/upload.php1,400 ▼34.25 ▼0.03100.01 ▼3.3241.97 ▼3.04

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/resize-images-before-upload/resize-images-before-upload.php+304
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/resize-images-before-upload/resize-images-before-upload.php:304

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: images, plupload, resize

resize-images-before-upload/resize-images-before-upload.php 92% from 13 tests

"Resize images before upload" version 1.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 177 characters long)

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 plugin238 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP18241185
Bourne Shell1191653

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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