94% image-resize-for-chrome-and-safari

Code Review | Image Resize for Chrome and Safari

WordPress plugin Image Resize for Chrome and Safari scored 94% from 54 tests.

About plugin

  • Plugin page: image-resize-for-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 5.8.1
  • First release: May 11, 2013
  • Latest release: Sep 28, 2013
  • Number of updates: 5
  • Update frequency: every 28.0 days
  • Top authors: jamesdbruner (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active / 2,195 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Image Resize for Chrome and Safari
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0054.42 ▲13.13
Dashboard /wp-admin3.06 ▲0.0143.27 ▼13.97
Posts /wp-admin/edit.php3.11 ▲0.0049.31 ▼2.04
Add New Post /wp-admin/post-new.php5.42 ▼0.0297.92 ▼590.95
Media Library /wp-admin/upload.php3.00 ▲0.0036.93 ▼4.41

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Image Resize for Chrome and Safari: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.10 ▲0.4013.51 ▲3.8152.95 ▼3.04
Dashboard /wp-admin2,970 ▲335.97 ▲0.04151.43 ▼7.24114.85 ▼11.34
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0069.69 ▼1.2196.72 ▼5.05
Add New Post /wp-admin/post-new.php1,683 ▼018.68 ▼0.08404.89 ▼14.01113.05 ▼5.10
Media Library /wp-admin/upload.php1,807 ▼05.00 ▼0.05172.25 ▲21.21130.33 ▲4.78

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/image-resize-for-chrome-and-safari/index.php:31

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Screenshot #1 (Action shot.) image missing
You can take inspiration from this readme.txt

image-resize-for-chrome-and-safari/index.php 92% from 13 tests

"Image Resize for Chrome and Safari" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("image-resize-for-chrome-and-safari.php" instead of "index.php")

Code Analysis Passed 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 plugin6 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15206

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.18MB with 0.12MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png184.01KB58.44KB▼ 68.24%