84% image-comparison-block

Code Review | Image Comparison Block

WordPress plugin Image Comparison Block scored84%from 54 tests.

About plugin

  • Plugin page: image-comparison-...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 21, 2020
  • Latest release: Oct 12, 2021
  • Number of updates: 7
  • Update frequency: every 51.0 days
  • Top authors: ibachal (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /5,101 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼11.89ms] Passed 4 tests

An overview of server-side resources used by Image Comparison Block
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.02 ▼7.88
Dashboard /wp-admin3.33 ▲0.0247.85 ▼7.41
Posts /wp-admin/edit.php3.38 ▲0.0244.82 ▼6.92
Add New Post /wp-admin/post-new.php5.91 ▲0.0281.59 ▼25.36
Media Library /wp-admin/upload.php3.25 ▲0.0236.37 ▲3.04

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Image Comparison Block
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲18113.61 ▼0.709.47 ▲7.7242.87 ▼1.10
Dashboard /wp-admin2,203 ▲155.83 ▼0.0398.30 ▼13.9139.48 ▼5.77
Posts /wp-admin/edit.php2,092 ▲31.98 ▼0.0338.64 ▼1.2533.39 ▼1.41
Add New Post /wp-admin/post-new.php6,364 ▲4,83527.95 ▲9.52907.63 ▲233.5440.07 ▼22.09
Media Library /wp-admin/upload.php1,388 ▲34.23 ▲0.0396.14 ▼6.2141.96 ▼1.55

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

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)
Even though everything seems fine, this is not an exhaustive test

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 have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-comparison-block/image-comparison.php:93

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 Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: block, comparison, slider, before, after

image-comparison-block/image-comparison.php 85% from 13 tests

The main PHP script in "Image Comparison Block" version 1.0.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("image-comparison-block.php" instead of "image-comparison.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin894 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript414087636
CSS3280175
PHP291669
JSON10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.06
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
PNG images were not found in this plugin