83% interactive-map-of-the-us-regions

Code Review | Interactive US Map - Create Сlickable & Customizable U.S. Maps

WordPress plugin Interactive US Map - Create Сlickable & Customizable U.S. Maps scored83%from 54 tests.

About plugin

  • Plugin page: interactive-map-o...
  • Plugin version: 3.2.0
  • PHP compatiblity: 5.3.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 30, 2013
  • Latest release: Sep 25, 2023
  • Number of updates: 121
  • Update frequency: every 31.4 days
  • Top authors: html5maps (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /24,384 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▲2.58ms] Passed 4 tests

This is a short check of server-side resources used by Interactive US Map - Create Сlickable & Customizable U.S. Maps
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.80 ▲1.94
Dashboard /wp-admin3.33 ▲0.0349.39 ▼0.80
Posts /wp-admin/edit.php3.38 ▲0.0354.16 ▲9.48
Add New Post /wp-admin/post-new.php5.91 ▲0.03105.18 ▲12.08
Media Library /wp-admin/upload.php3.25 ▲0.0334.54 ▼0.29
Detailed settings /wp-admin/admin.php?page=freeusregions-html5-map-states3.4838.81
Map Preview /wp-admin/admin.php?page=freeusregions-html5-map-view3.3035.75
Maps /wp-admin/admin.php?page=freeusregions-html5-map-maps3.3233.38
General Settings /wp-admin/admin.php?page=freeusregions-html5-map-options3.5238.19
Tools /wp-admin/admin.php?page=freeusregions-html5-map-tools3.3935.10

Server storage [IO: ▲0.38MB] [DB: ▲0.01MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Interactive US Map - Create Сlickable & Customizable U.S. Maps: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲21113.64 ▼0.655.71 ▲4.0843.53 ▲3.39
Dashboard /wp-admin2,255 ▲644.92 ▼0.98109.53 ▲3.1643.16 ▼3.62
Posts /wp-admin/edit.php2,138 ▲492.04 ▲0.0339.44 ▲3.9835.26 ▼1.26
Add New Post /wp-admin/post-new.php1,564 ▲3018.22 ▼5.11617.19 ▼65.1449.66 ▼0.19
Media Library /wp-admin/upload.php1,437 ▲494.22 ▲0.0296.42 ▼1.8441.86 ▼0.12
Detailed settings /wp-admin/admin.php?page=freeusregions-html5-map-states9772.6632.4027.87
Map Preview /wp-admin/admin.php?page=freeusregions-html5-map-view1,0634.7778.7848.69
Maps /wp-admin/admin.php?page=freeusregions-html5-map-maps1,0961.7924.6325.29
General Settings /wp-admin/admin.php?page=freeusregions-html5-map-options2,2917.09158.61120.15
Tools /wp-admin/admin.php?page=freeusregions-html5-map-tools1,1011.8126.3831.76

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freeusregions_html5map_plugin_get_options() in wp-content/plugins/interactive-map-of-the-us-regions/editstatesconfig.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freeusregions_html5map_plugin_get_options() in wp-content/plugins/interactive-map-of-the-us-regions/maptools.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freeusregions_html5map_plugin_get_options() in wp-content/plugins/interactive-map-of-the-us-regions/mapslist.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freeusregions_html5map_plugin_get_options() in wp-content/plugins/interactive-map-of-the-us-regions/editmainconfig.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/interactive-map-of-the-us-regions/bulkconfig.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/interactive-map-of-the-us-regions/usahtmlmap.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

interactive-map-of-the-us-regions/usahtmlmap.php 77% from 13 tests

Analyzing the main PHP file in "Interactive US Map - Create Сlickable & Customizable U.S. Maps" version 3.2.0
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 143 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("interactive-map-of-the-us-regions.php" instead of "usahtmlmap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin5,986 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript35941312,724
PHP6587362,691
CSS37111478
JSON20093

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.03MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
static/html5maps_img.png27.05KB25.61KB▼ 5.31%