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: 6.3.1
  • 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,535 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • 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: ▼1.96MB] [CPU: ▼47.31ms] Passed 4 tests

This is a short 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.03 ▼1.434.69 ▼34.25
Dashboard /wp-admin2.05 ▼1.266.49 ▼38.39
Posts /wp-admin/edit.php2.05 ▼1.317.04 ▼37.94
Add New Post /wp-admin/post-new.php2.05 ▼3.846.54 ▼78.65
Media Library /wp-admin/upload.php2.05 ▼1.186.90 ▼24.45
Add Image Maps /wp-admin/options-general.php?page=add-img-maps2.056.76

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Add Image Maps
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1514.48 ▲1.221.75 ▼0.0144.61 ▲3.34
Dashboard /wp-admin2,207 ▲15.80 ▲0.95105.43 ▲3.7539.51 ▲2.33
Posts /wp-admin/edit.php2,096 ▲72.00 ▼0.1341.82 ▲1.4740.45 ▲5.46
Add New Post /wp-admin/post-new.php1,522 ▲823.47 ▲5.92674.77 ▲13.9659.00 ▲0.73
Media Library /wp-admin/upload.php1,389 ▲44.20 ▲0.0296.02 ▼4.8145.28 ▼0.08
Add Image Maps /wp-admin/options-general.php?page=add-img-maps8922.0329.4629.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > 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
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/add-image-maps/tests/class-add-img-maps-test.php:10
    • > 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
      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 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: display, links, images, imagemaps

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

This is the main PHP file of "Add Image Maps" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-image-maps.php" instead of "add-img-maps.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin2,044 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP163791,0061,154
JavaScript3206483745
Markdown2500101
CSS1141834
XML10010

PHP code Passed 2 tests

Analyzing 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.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin