10% browser-resize-images

Code Review | Browser Resize Images

WordPress plugin Browser Resize Images scored10%from 54 tests.

About plugin

  • Plugin page: browser-resize-im...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 6.3.1
  • First release: Dec 18, 2012
  • Latest release: Dec 18, 2012
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: maniu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,075 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
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method WP_GB_Browser_Resize::activate_plugin() should not be called statically

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.37ms] Passed 4 tests

Analyzing server-side resources used by Browser Resize Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.04 ▼7.58
Dashboard /wp-admin3.34 ▲0.0445.31 ▼2.14
Posts /wp-admin/edit.php3.39 ▲0.0448.86 ▲2.58
Add New Post /wp-admin/post-new.php5.92 ▲0.0493.18 ▼0.70
Media Library /wp-admin/upload.php3.26 ▲0.0435.46 ▲0.93

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
gb_browser_resize_quality
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Browser Resize Images
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.29 ▼1.091.82 ▼0.2844.72 ▼0.05
Dashboard /wp-admin2,206 ▲275.90 ▲0.04109.06 ▲6.5343.02 ▲5.00
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0741.20 ▲5.6735.33 ▼2.73
Add New Post /wp-admin/post-new.php1,542 ▲2318.29 ▼5.08614.74 ▼34.5853.20 ▲2.90
Media Library /wp-admin/upload.php1,385 ▼04.22 ▼0.01103.18 ▼1.7043.74 ▼0.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • gb_browser_resize_quality
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

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)
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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/browser-resize-images/resize-images-before-upload.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === browser-resize-images === )
  • Screenshots: Screenshot #1 (Configuration window.) image required
The official readme.txt is a good inspiration

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

This is the main PHP file of "Browser Resize Images" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("browser-resize-images.php" instead of "resize-images-before-upload.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin100 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1509100

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

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
1 compressed PNG file occupies 0.02MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png25.48KB24.48KB▼ 3.92%