83% wp-image-shrinker

Code Review | WordPress Image shrinker

WordPress plugin WordPress Image shrinker scored 83% from 54 tests.

About plugin

  • Plugin page: wp-image-shrinker
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Feb 16, 2015
  • Latest release: Feb 25, 2015
  • Number of updates: 16
  • Update frequency: every 1.4 days
  • Top authors: HetWorks (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 2,799 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼141.69ms] Passed 4 tests

Analyzing server-side resources used by WordPress Image shrinker
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1735.15 ▲12.75
Dashboard /wp-admin3.11 ▲0.0651.44 ▼5.03
Posts /wp-admin/edit.php3.17 ▲0.0651.72 ▲4.12
Add New Post /wp-admin/post-new.php5.47 ▲0.0498.87 ▼567.95
Media Library /wp-admin/upload.php3.06 ▲0.0636.74 ▲2.10

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 1 new option
New WordPress options
hetworkstinypng_sizes

Browser metrics Passed 4 tests

WordPress Image shrinker: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,707 ▲13515.84 ▼0.1711.96 ▲0.6245.36 ▼2.82
Dashboard /wp-admin2,998 ▲676.09 ▲0.00151.79 ▼2.07111.65 ▼3.04
Posts /wp-admin/edit.php2,767 ▲282.85 ▲0.1566.61 ▼0.6583.02 ▼6.58
Add New Post /wp-admin/post-new.php1,634 ▲1921.32 ▼0.06320.39 ▲23.69110.66 ▲6.00
Media Library /wp-admin/upload.php1,764 ▼435.01 ▼0.02163.02 ▲16.90117.47 ▼0.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • hetworkstinypng_sizes

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-image-shrinker/hetworkstinypng.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 27 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-image-shrinker/hetworkstinypng.php 85% from 13 tests

"WordPress Image shrinker" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 154 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-image-shrinker.php" instead of "hetworkstinypng.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
No dangerous file extensions were detected326 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12622326

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions11
▷ Named functions11100.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
There are no PNG files in this plugin