72% imagemapper

Code Review | ImageMapper

WordPress plugin ImageMapper scored72%from 54 tests.

About plugin

  • Plugin page: imagemapper
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-4.3
  • WordPress version: 6.3.1
  • First release: Dec 10, 2012
  • Latest release: Apr 20, 2016
  • Number of updates: 36
  • Update frequency: every 34.2 days
  • Top authors: Spikefinned (58.33%)tatti (44.44%)

Code review

54 tests

User reviews

41 reviews

Install metrics

3,000+ active /53,039 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.24MB] [CPU: ▲0.17ms] Passed 4 tests

An overview of server-side resources used by ImageMapper
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2642.37 ▼0.09
Dashboard /wp-admin3.54 ▲0.2448.57 ▼3.50
Posts /wp-admin/edit.php3.66 ▲0.3053.65 ▲1.75
Add New Post /wp-admin/post-new.php6.12 ▲0.24104.43 ▲9.87
Media Library /wp-admin/upload.php3.47 ▲0.2440.26 ▲2.53
Image map settings /wp-admin/edit.php?post_type=imagemap&page=imagemap-settings3.4337.96
All Image maps /wp-admin/edit.php?post_type=imagemap3.5245.56
Add new Image map /wp-admin/post-new.php?post_type=imagemap3.5147.81
All Image map areas /wp-admin/edit.php?post_type=imagemap_area3.5237.88
Add new Image map area /wp-admin/post-new.php?post_type=imagemap_area3.3931.76
Highlight styles /wp-admin/edit.php?post_type=imagemap_area&page=imagemap-area-styles3.4445.42

Server storage [IO: ▲0.12MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/imagemapper/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 13 new files
Database: no new tables, 12 new options
New WordPress options
imgmap-include-jquery-ui-dialog
theysaidso_admin_options
widget_recent-posts
imgmap-include-jquery-ui
imgmap-pulse
imgmap-alternative-link-positions
imgmap-include-jquery
db_upgraded
widget_recent-comments
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by ImageMapper
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,117 ▲35614.56 ▲0.148.88 ▲7.2541.61 ▼3.39
Dashboard /wp-admin2,299 ▲935.41 ▲0.57107.09 ▼4.0096.37 ▲52.61
Posts /wp-admin/edit.php2,195 ▲952.51 ▲0.4942.34 ▲4.5455.32 ▲19.58
Add New Post /wp-admin/post-new.php1,609 ▲8018.91 ▲1.29644.79 ▼26.8840.29 ▼17.25
Media Library /wp-admin/upload.php1,484 ▲814.75 ▲0.52104.54 ▼1.4678.93 ▲33.24
Image map settings /wp-admin/edit.php?post_type=imagemap&page=imagemap-settings9542.2031.8326.40
All Image maps /wp-admin/edit.php?post_type=imagemap1,1922.5538.3155.16
Add new Image map /wp-admin/post-new.php?post_type=imagemap1,6543.1768.4778.15
All Image map areas /wp-admin/edit.php?post_type=imagemap_area1,2122.4335.9447.78
Add new Image map area /wp-admin/post-new.php?post_type=imagemap_area2,4797.77170.50150.12
Highlight styles /wp-admin/edit.php?post_type=imagemap_area&page=imagemap-area-styles1,2832.5550.8135.07

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
  • This plugin does not fully uninstall, leaving 12 options in the database
    • widget_recent-comments
    • imgmap_colors
    • imgmap-include-jquery
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • imgmap-pulse
    • imgmap-include-jquery-ui-dialog
    • imgmap-include-jquery-ui
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=imagemap_area
    • > Notice in wp-content/plugins/imagemapper/imagemapper.php+270
    Undefined index: area-type
    • > GET request to /wp-admin/post-new.php?post_type=imagemap_area
    • > Notice in wp-content/plugins/imagemapper/imagemapper.php+271
    Undefined index: area-tooltip-text
    • > GET request to /wp-admin/post-new.php?post_type=imagemap_area
    • > Notice in wp-content/plugins/imagemapper/imagemapper.php+272
    Undefined index: area-title-attribute
    • > GET request to /wp-admin/post-new.php?post_type=imagemap_area
    • > Notice in wp-content/plugins/imagemapper/imagemapper.php+273
    Undefined index: area-link-url
    • > GET request to /wp-admin/post-new.php?post_type=imagemap_area
    • > Notice in wp-content/plugins/imagemapper/imagemapper.php+274
    Undefined index: area-link-type
    • > GET request to /wp-admin/post-new.php?post_type=imagemap_area
    • > Notice in wp-content/plugins/imagemapper/imagemapper.php+275
    Undefined index: area-link-post
    • > GET request to /wp-admin/post-new.php?post_type=imagemap_area
    • > Notice in wp-content/plugins/imagemapper/imagemapper.php+276
    Undefined index: area-link-page
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=imagemap_area
    • > Notice in wp-content/plugins/imagemapper/imagemapper.php+482
    Undefined property: stdClass::$color

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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/imagemapper/single-imgmap.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/imagemapper/single-imgmap-dialog.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/imagemapper/imagemapper.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=imagemap_area&page=imagemap-area-styles
    • > Javascript (severe) in unknown
    /wp-content/plugins/imagemapper/script/jquery.imagemapster.min.js?ver=6.3.1 11:13117 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')

Optimizations

Plugin configuration Passed 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
4 plugin tags: imagemap, image map, images, interactive images

imagemapper/imagemapper.php Passed 13 tests

The main PHP script in "ImageMapper" version 1.2.6 is automatically included on every request by WordPress
62 characters long description:
Create interactive and visual image maps with a visual editor!

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 plugin1,413 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP3118101790
JavaScript39224449
CSS1228173
Sass1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions44
▷ Named functions44100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
transparency.png2.75KB0.09KB▼ 96.77%
imagemap_area_icon.png3.21KB0.48KB▼ 85.15%
imagemap_icon.png3.16KB0.40KB▼ 87.48%
imagemap_icons.png4.59KB1.52KB▼ 66.89%