84% image-hotspot-block

Code Review | Image Hotspot Block

WordPress plugin Image Hotspot Block scored84%from 54 tests.

About plugin

  • Plugin page: image-hotspot-block
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Nov 25, 2022
  • Latest release: Apr 3, 2023
  • Number of updates: 10
  • Update frequency: every 12.9 days
  • Top authors: kywyz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,040 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
Install script ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▲4.22ms] Passed 4 tests

An overview of server-side resources used by Image Hotspot Block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4753.04 ▲16.63
Dashboard /wp-admin3.77 ▲0.4647.07 ▼3.22
Posts /wp-admin/edit.php3.82 ▲0.4648.37 ▲4.28
Add New Post /wp-admin/post-new.php6.29 ▲0.4095.95 ▲5.97
Media Library /wp-admin/upload.php3.63 ▲0.4044.97 ▲9.84
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins3.7033.08

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Image Hotspot Block
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.18 ▼0.381.72 ▲0.1843.93 ▲5.46
Dashboard /wp-admin2,228 ▲535.64 ▼0.0194.96 ▼10.1446.08 ▲6.81
Posts /wp-admin/edit.php2,139 ▲392.03 ▲0.0941.17 ▲6.2641.30 ▲5.31
Add New Post /wp-admin/post-new.php6,394 ▲4,86628.25 ▲5.17892.34 ▲200.1857.39 ▲1.62
Media Library /wp-admin/upload.php1,438 ▲384.26 ▼0.0795.80 ▼4.8445.62 ▼0.76
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins9712.0525.4429.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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 no errors were found, this is by no means 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/image-hotspot-block/inc/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/image-hotspot-block/inc/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 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
6 plugin tags: hotspot, woocommerce, products, shoppable, image...

image-hotspot-block/image-hotspot-block.php Passed 13 tests

"Image Hotspot Block" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
79 characters long description:
Image Hotspot Block lets you create dynamic images with links to your products.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin2,120 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP65031,6241,855
PO File15657168
JavaScript22075
JSON10021
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity38.67
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.20
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods106
▷ Static methods54.72%
▷ Public methods8378.30%
▷ Protected methods2321.70%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin