88% compare

Code Review | Compare Images for Gutenberg

WordPress plugin Compare Images for Gutenberg scored 88% from 54 tests.

About plugin

  • Plugin page: compare
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.1.1
  • WordPress version: 5.8.1
  • First release: Apr 7, 2019
  • Latest release: Apr 16, 2019
  • Number of updates: 5
  • Update frequency: every 1.8 days
  • Top authors: RapidDev (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 866 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.10MB] [CPU: ▼144.88ms] Passed 4 tests

Server-side resources used by Compare Images for Gutenberg
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1433.18 ▲5.75
Dashboard /wp-admin3.08 ▲0.0245.29 ▲7.53
Posts /wp-admin/edit.php3.13 ▲0.0245.71 ▼0.50
Add New Post /wp-admin/post-new.php4.99 ▼0.4557.54 ▼584.68
Media Library /wp-admin/upload.php3.02 ▲0.0234.31 ▼0.08

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Compare Images for Gutenberg
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,828 ▲23216.35 ▲0.7715.03 ▲4.9446.93 ▼5.27
Dashboard /wp-admin2,967 ▲365.92 ▼0.18150.19 ▲4.04114.54 ▲1.33
Posts /wp-admin/edit.php2,741 ▲22.70 ▼0.0262.81 ▼4.2989.58 ▼0.36
Add New Post /wp-admin/post-new.php1,683 ▲1118.84 ▼0.11364.31 ▼15.38129.88 ▲7.74
Media Library /wp-admin/upload.php1,807 ▼35.03 ▼0.01149.13 ▲12.14116.12 ▼13.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/compare/assets/class.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/compare/compare.php:27

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 96% from 29 tests

readme.txt Passed 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
5 plugin tags: responsive, gutenberg, images, wp5, compare

compare/compare.php 92% from 13 tests

This is the main PHP file of "Compare Images for Gutenberg" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains

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
There were no executable files found in this plugin242 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2712136
PHP2144264
PO File18841
CSS1061

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods112.50%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG files were detected