68% image-map-hotspots

Code Review | Image Hotspot - Map Image Annotation

WordPress plugin Image Hotspot - Map Image Annotation scored68%from 54 tests.

About plugin

  • Plugin page: image-map-hotspots
  • Plugin version: 1.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.3
  • WordPress version: 6.3.1
  • First release: Dec 9, 2021
  • Latest release: Aug 25, 2023
  • Number of updates: 64
  • Update frequency: every 9.8 days
  • Top authors: wpmart (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /10,862 total downloads

Benchmarks

Plugin footprint 65% 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.88MB] [CPU: ▼5.74ms] Passed 4 tests

Server-side resources used by Image Hotspot - Map Image Annotation
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.35 ▲0.8941.78 ▲1.12
Dashboard /wp-admin4.21 ▲0.8651.45 ▼15.73
Posts /wp-admin/edit.php4.32 ▲0.9647.66 ▼2.92
Add New Post /wp-admin/post-new.php6.79 ▲0.9094.31 ▼5.42
Media Library /wp-admin/upload.php4.13 ▲0.9040.21 ▲2.41
All Image Map Hotspot /wp-admin/admin.php?page=imh-6310-image-map-hotspot4.1342.84
Settings /wp-admin/admin.php?page=imh-6310-image-map-hotspot-setting4.1345.85
License /wp-admin/admin.php?page=imh-6310-image-map-hotspot-license4.1035.12
WpMart Plugins /wp-admin/admin.php?page=imh-6310-wpmart-plugins4.1034.95
Import/Export Plugin /wp-admin/admin.php?page=imh-6310-image-map-hotspot-import-export4.1348.66
Help /wp-admin/admin.php?page=imh-6310-image-map-hotspot-use4.1039.20

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 39 new files
Database: 1 new table, 8 new options
New tables
wp_imh_6310_style
New WordPress options
can_compress_scripts
db_upgraded
imh_6310_version_info
widget_recent-posts
imh_6310_selected_server
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Image Hotspot - Map Image Annotation
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6714.39 ▼0.191.90 ▼0.3242.83 ▼3.85
Dashboard /wp-admin2,237 ▲575.71 ▲0.0386.70 ▼2.9640.91 ▲2.54
Posts /wp-admin/edit.php2,142 ▲452.06 ▲0.0336.26 ▼0.0735.48 ▼3.04
Add New Post /wp-admin/post-new.php1,565 ▲2023.32 ▲0.07677.35 ▲28.9244.15 ▼5.50
Media Library /wp-admin/upload.php1,442 ▲394.28 ▲0.0796.13 ▼12.6442.96 ▼4.67
All Image Map Hotspot /wp-admin/admin.php?page=imh-6310-image-map-hotspot1,1223.9664.2958.38
Settings /wp-admin/admin.php?page=imh-6310-image-map-hotspot-setting1,1283.1340.7837.47
License /wp-admin/admin.php?page=imh-6310-image-map-hotspot-license9492.7839.0133.56
WpMart Plugins /wp-admin/admin.php?page=imh-6310-wpmart-plugins1,0062.7437.2140.03
Import/Export Plugin /wp-admin/admin.php?page=imh-6310-image-map-hotspot-import-export1,1104.0951.0932.64
Help /wp-admin/admin.php?page=imh-6310-image-map-hotspot-use1,0272.8835.9034.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_imh_6310_style
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • imh_6310_selected_server
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • imh_6310_version_info
    • widget_recent-comments

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/image-map-hotspots/settings/template-settings.php
    • > /wp-content/plugins/image-map-hotspots/settings/add-point-html.php
    • > /wp-content/plugins/image-map-hotspots/settings/css/template-css.php
    • > /wp-content/plugins/image-map-hotspots/settings/edit-point-html.php
    • > /wp-content/plugins/image-map-hotspots/settings/annotation.php
  • 32× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/image-map-hotspots/settings/form.php:3
    • > PHP Warning
      include(imh_6310_plugin_urlsettings/template-settings.php): failed to open stream: No such file or directory in wp-content/plugins/image-map-hotspots/settings/edit-point-html.php on line 221
    • > PHP Warning
      include(): Failed opening 'imh_6310_plugin_urlsettings/save.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/image-map-hotspots/settings/annotation.php on line 4
    • > PHP Notice
      Undefined variable: ids in wp-content/plugins/image-map-hotspots/shortcode.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/image-map-hotspots/output-css.php:11
    • > PHP Warning
      Use of undefined constant imh_6310_plugin_dir_url - assumed 'imh_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-map-hotspots/settings/edit-point-html.php on line 164
    • > PHP Warning
      Use of undefined constant imh_6310_plugin_dir_url - assumed 'imh_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-map-hotspots/settings/edit-point-html.php on line 170
    • > PHP Warning
      Use of undefined constant imh_6310_plugin_dir_url - assumed 'imh_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-map-hotspots/settings/add-point-html.php on line 162
    • > PHP Warning
      Use of undefined constant imh_6310_plugin_dir_url - assumed 'imh_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-map-hotspots/settings/edit-point-html.php on line 167
    • > PHP Warning
      Use of undefined constant imh_6310_plugin_dir_url - assumed 'imh_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-map-hotspots/settings/add-point-html.php on line 168

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: image hotspots, wordpress image hotspot plugin, hotspot image wordpress, hotspot picture, hotspot image...

image-map-hotspots/index.php 85% from 13 tests

The main PHP script in "Image Hotspot - Map Image Annotation" version 1.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 207 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("image-map-hotspots.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin7,232 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP19223163,852
CSS497221,921
JavaScript7120381,459

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
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%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.25MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/fs-sprite.png1.07KB0.18KB▼ 82.82%
assets/images/4.png23.22KB21.33KB▼ 8.15%
assets/css/hover.png1.27KB0.66KB▼ 48.23%
assets/css/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
assets/images/1.png59.47KB51.29KB▼ 13.76%