94% image-shrink

Code Review | Image Shrink

WordPress plugin Image Shrink scored 94% from 54 tests.

About plugin

  • Plugin page: image-shrink
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.8
  • WordPress version: 5.8.1
  • First release: Dec 17, 2013
  • Latest release: Dec 17, 2013
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: tadayuki kusakabe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 955 total downloads

Benchmarks

Plugin footprint Passed 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.02MB] [CPU: ▼152.48ms] Passed 4 tests

Server-side resources used by Image Shrink
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1337.22 ▲14.63
Dashboard /wp-admin3.08 ▲0.0257.38 ▼5.53
Posts /wp-admin/edit.php3.13 ▲0.0250.20 ▼0.32
Add New Post /wp-admin/post-new.php5.43 ▲0.0089.73 ▼604.74
Media Library /wp-admin/upload.php3.02 ▲0.0236.18 ▲0.66
Image Shrink /wp-admin/options-general.php?page=imageshrink2.9927.18

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 1 new option
New WordPress options
image_size_max_shrink

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image Shrink
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,694 ▲9815.96 ▲0.296.38 ▼2.2149.17 ▲4.15
Dashboard /wp-admin2,975 ▲385.91 ▼0.01138.76 ▼23.49125.04 ▼9.79
Posts /wp-admin/edit.php2,744 ▲52.68 ▼0.0068.98 ▼6.7690.52 ▼4.60
Add New Post /wp-admin/post-new.php1,503 ▼10118.60 ▼0.27404.75 ▲16.44123.32 ▲11.56
Media Library /wp-admin/upload.php1,812 ▲25.02 ▲0.00159.86 ▲25.60126.78 ▼0.92
Image Shrink /wp-admin/options-general.php?page=imageshrink1,0512.0956.0677.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
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 | 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/image-shrink/options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/image-shrink/imageshrink.php:89

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (I don't have at this time.) image required
The official readme.txt might help

image-shrink/imageshrink.php 92% from 13 tests

The main PHP script in "Image Shrink" version 1.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("image-shrink.php" instead of "imageshrink.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin83 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2291183

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions7
▷ Named functions7100.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 were not PNG files found in your plugin