78% interactive-us-map

Code Review | Interactive US Map

WordPress plugin Interactive US Map scored 78% from 54 tests.

About plugin

  • Plugin page: interactive-us-map
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.2
  • WordPress version: 6.3.1
  • First release: Nov 5, 2016
  • Latest release: Apr 3, 2023
  • Number of updates: 57
  • Update frequency: every 41.1 days
  • Top authors: clickmaps (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active / 14,528 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.84ms] Passed 4 tests

Server-side resources used by Interactive US Map
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.48 ▲1.51
Dashboard /wp-admin3.33 ▲0.0245.93 ▼3.36
Posts /wp-admin/edit.php3.38 ▲0.0246.44 ▲8.32
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.16 ▼23.10
Media Library /wp-admin/upload.php3.25 ▲0.0235.27 ▲1.59

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Interactive US Map
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8613.16 ▼1.151.74 ▼0.0943.09 ▼8.96
Dashboard /wp-admin2,223 ▲324.93 ▼0.8894.68 ▼26.7774.71 ▲31.90
Posts /wp-admin/edit.php2,109 ▲172.01 ▲0.0136.06 ▼6.6432.07 ▼4.51
Add New Post /wp-admin/post-new.php1,541 ▼123.16 ▲4.91708.64 ▲83.4958.42 ▲2.12
Media Library /wp-admin/upload.php1,402 ▲204.19 ▼0.05100.49 ▲6.0581.07 ▲41.73

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/interactive-us-map/includes/map.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/interactive-us-map/usr-map.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr__() in wp-content/plugins/interactive-us-map/includes/js-config-footer.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr__() in wp-content/plugins/interactive-us-map/includes/js-config-footer.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/interactive-us-map/includes/admin.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can take inspiration from this readme.txt

interactive-us-map/usr-map.php 92% from 13 tests

The primary PHP file in "Interactive US Map" version 2.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("interactive-us-map.php" instead of "usr-map.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
Good job! No executable or dangerous file extensions detected2,017 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript372211832
PHP67611597
CSS8343463
SVG200125

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods857.14%
▷ Protected methods00.00%
▷ Private methods642.86%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/map-icons.png3.93KB2.40KB▼ 38.85%
public/images/icons.png15.88KB5.44KB▼ 65.72%
public/images/map-icon.png1.60KB0.78KB▼ 51.37%