10% add-image-maps

Code Review | Add Image Maps

WordPress plugin Add Image Maps scored 10% from 54 tests.

About plugin

  • Plugin page: add-image-maps
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 5.9.2
  • First release: Feb 14, 2018
  • Latest release: Feb 14, 2018
  • Number of updates: 16
  • Update frequency: N/A
  • Top authors: drianmcdonald (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,038 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/add-image-maps/includes/class-add-img-maps-activator.php+24
    Non-static method Add_Img_Maps::get_plugin_name() should not be called statically

Server metrics [RAM: ▼2.25MB] [CPU: ▼345.45ms] Passed 4 tests

A check of server-side resources used by Add Image Maps
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.405.76 ▼43.08
Dashboard /wp-admin2.13 ▼1.275.18 ▼29.52
Posts /wp-admin/edit.php2.13 ▼1.505.08 ▼36.40
Add New Post /wp-admin/post-new.php2.13 ▼4.846.24 ▼1,272.80
Media Library /wp-admin/upload.php2.13 ▼1.165.00 ▼19.20
Add Image Maps /wp-admin/options-general.php?page=add-img-maps2.135.72

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add Image Maps
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,769 ▲2715.94 ▲0.285.83 ▼0.693.02 ▲1.07
Dashboard /wp-admin2,893 ▲326.08 ▼0.03117.83 ▼15.58154.96 ▼4.68
Posts /wp-admin/edit.php2,693 ▲23.24 ▲0.0062.19 ▼1.72141.52 ▼3.00
Add New Post /wp-admin/post-new.php1,664 ▼3215.75 ▼5.29391.39 ▼19.08166.87 ▲16.05
Media Library /wp-admin/upload.php1,700 ▲25.54 ▲0.01154.27 ▲15.36189.71 ▲0.78
Add Image Maps /wp-admin/options-general.php?page=add-img-maps1,1542.3754.37100.78

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
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/add-image-maps/includes/class-add-img-maps-i18n.php+25
    Non-static method Add_Img_Maps::name() should not be called statically

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=add-img-maps
    • > Deprecated in wp-content/plugins/add-image-maps/includes/class-add-img-maps-i18n.php+25
    Non-static method Add_Img_Maps::name() should not be called statically
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=add-img-maps
    • > Notice in wp-content/plugins/add-image-maps/admin/partials/add-img-maps-admin-display.php+29
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/add-image-maps/admin/partials/add-img-maps-admin-display.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/add-image-maps/tests/class-add-img-maps-test.php:10
    • > PHP Warning
      require_once(/home/ian/wordpress-dev/trunk/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/add-image-maps/tests/bootstrap.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/add-image-maps/tests/class-add-img-maps-map-test.php:10
    • > PHP Fatal error
      require_once(): Failed opening required '/home/ian/wordpress-dev/trunk/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/add-image-maps/tests/bootstrap.php on line 18

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

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: images, display, imagemaps, links

add-image-maps/add-img-maps.php 85% from 13 tests

Analyzing the main PHP file in "Add Image Maps" version 1.0.0
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("add-image-maps.php" instead of "add-img-maps.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected2,044 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP163791,0061,154
JavaScript3206483745
Markdown2500101
CSS1141834
XML10010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.36
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods53
▷ Static methods611.32%
▷ Public methods4686.79%
▷ Protected methods23.77%
▷ Private methods59.43%
Functions8
▷ Named functions450.00%
▷ Anonymous functions450.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected