84% improved-gd-image-editor

Code Review | Improved GD Image Editor

WordPress plugin Improved GD Image Editor scored84%from 54 tests.

About plugin

  • Plugin page: improved-gd-image...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.0
  • WordPress version: 6.3.1
  • First release: Jul 10, 2013
  • Latest release: Sep 4, 2014
  • Number of updates: 6
  • Update frequency: every 132.7 days
  • Top authors: markoheijnen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,685 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼8.97ms] Passed 4 tests

Analyzing server-side resources used by Improved GD Image Editor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.0040.88 ▼7.98
Dashboard /wp-admin3.57 ▼0.0650.14 ▼22.48
Posts /wp-admin/edit.php3.68 ▲0.0052.56 ▲1.75
Add New Post /wp-admin/post-new.php6.16 ▲0.01101.24 ▼5.19
Media Library /wp-admin/upload.php3.50 ▲0.0140.16 ▼0.23

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Improved GD Image Editor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.37 ▲0.062.06 ▲0.0444.00 ▼2.68
Dashboard /wp-admin2,195 ▲215.58 ▼0.0393.67 ▼11.0439.54 ▼2.61
Posts /wp-admin/edit.php2,100 ▼02.05 ▲0.0336.33 ▲0.4933.54 ▼0.57
Add New Post /wp-admin/post-new.php1,526 ▼517.61 ▼5.34649.23 ▼55.2947.79 ▼11.85
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.06102.67 ▼16.1342.79 ▼7.87

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

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)
Everything seems fine, however this is by no means 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× 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/improved-gd-image-editor/improved-gd-editor.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor_GD' not found in wp-content/plugins/improved-gd-image-editor/editor.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
2 plugin tags: image, manipulation

improved-gd-image-editor/improved-gd-editor.php 92% from 13 tests

The main file in "Improved GD Image Editor" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("improved-gd-image-editor.php" instead of "improved-gd-editor.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin71 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP224971

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity2.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods125.00%
▷ Private methods375.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin