78% image-mapper

Code Review | Image Mapper

WordPress plugin Image Mapper scored78%from 54 tests.

About plugin

  • Plugin page: image-mapper
  • Plugin version: 0.2.5.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 19, 2014
  • Latest release: Jun 23, 2014
  • Number of updates: 64
  • Update frequency: every 52.0 days
  • Top authors: maartenhemmes (95.31%)kizinko (6.25%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /12,360 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.54MB] [CPU: ▼12.97ms] Passed 4 tests

An overview of server-side resources used by Image Mapper
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1445.93 ▲1.19
Dashboard /wp-admin3.51 ▲0.1655.55 ▲7.36
Posts /wp-admin/edit.php3.63 ▲0.2359.99 ▲4.86
Add New Post /wp-admin/post-new.php3.33 ▼2.6036.75 ▼62.45
Media Library /wp-admin/upload.php3.41 ▲0.1444.83 ▲4.51
Add New /wp-admin/post-new.php?post_type=image_maps3.3336.08
View All /wp-admin/edit.php?post_type=image_maps3.4842.48

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 51 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Image Mapper
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,169 ▲40815.73 ▲1.576.87 ▲5.2443.90 ▲0.10
Dashboard /wp-admin2,439 ▲2686.53 ▲0.92120.35 ▲30.9137.96 ▼1.36
Posts /wp-admin/edit.php2,377 ▲2803.61 ▲1.6260.12 ▲19.8637.89 ▲1.68
Add New Post /wp-admin/post-new.php1,779 ▲24222.22 ▲3.81627.35 ▼12.4236.71 ▼29.20
Media Library /wp-admin/upload.php1,501 ▲1014.34 ▲0.1783.36 ▼25.2845.73 ▲1.00
Add New /wp-admin/post-new.php?post_type=image_maps2,8818.09188.66106.69
View All /wp-admin/edit.php?post_type=image_maps1,3873.5447.7330.96

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=image_maps
    • > Notice in wp-content/plugins/image-mapper/includes/settings.class.php+8
    Undefined index: post_ID
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=image_maps
    • > Notice in wp-content/plugins/image-mapper/includes/settings.class.php+11
    Trying to get property 'post_type' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=image_maps
    • > Notice in wp-content/plugins/image-mapper/includes/admin.class.php+132
    Undefined index: post

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-mapper/includes/functions.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-mapper/includes/functions.php:61

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
Please take inspiration from this readme.txt

image-mapper/image-mapper-plugin.php 92% from 13 tests

This is the main PHP file of "Image Mapper" version 0.2.5.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("image-mapper.php" instead of "image-mapper-plugin.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
There were no executable files found in this plugin8,341 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS4998465,555
JavaScript106931972,144
PHP614368642

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.33
▷ Minimum class complexity4.00
▷ Maximum class complexity9.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
22 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
fancybox/fancybox-y.png0.17KB0.24KB0.00%
images/edit.png0.33KB0.29KB▼ 11.94%
fancybox/fancybox-x.png0.20KB0.31KB0.00%
fancybox/fancy_nav_right.png1.42KB1.66KB0.00%
fancybox/fancy_title_left.png0.49KB0.82KB0.00%