78% basic-interactive-world-map

Code Review | Basic Interactive World Map

WordPress plugin Basic Interactive World Map scored78%from 54 tests.

About plugin

  • Plugin page: basic-interactive...
  • Plugin version: 2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 10, 2017
  • Latest release: Sep 10, 2023
  • Number of updates: 50
  • Update frequency: every 48.6 days
  • Top authors: clickmaps (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

900+ active /17,842 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼9.20ms] Passed 4 tests

An overview of server-side resources used by Basic Interactive World Map
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.50 ▲0.88
Dashboard /wp-admin3.37 ▲0.0249.32 ▼13.89
Posts /wp-admin/edit.php3.48 ▲0.1248.75 ▼1.23
Add New Post /wp-admin/post-new.php5.94 ▲0.0680.30 ▼20.84
Media Library /wp-admin/upload.php3.29 ▲0.0634.97 ▼0.85

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 86 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Basic Interactive World Map
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7413.33 ▼1.051.74 ▼0.0444.10 ▲0.63
Dashboard /wp-admin2,228 ▲405.88 ▲1.0299.48 ▼12.6673.11 ▲27.63
Posts /wp-admin/edit.php2,108 ▲192.01 ▼0.0237.45 ▼0.9135.18 ▲4.25
Add New Post /wp-admin/post-new.php1,540 ▼623.13 ▲4.87739.19 ▲127.4654.12 ▼3.30
Media Library /wp-admin/upload.php1,398 ▲134.22 ▼0.10102.60 ▲3.6276.86 ▲31.52

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/basic-interactive-world-map/includes/map.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/basic-interactive-world-map/includes/admin.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_hex_color() in wp-content/plugins/basic-interactive-world-map/includes/js-config.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WORLDMap\\plugin_dir_path() in wp-content/plugins/basic-interactive-world-map/world-map.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
Please take inspiration from this readme.txt

basic-interactive-world-map/world-map.php 85% from 13 tests

"Basic Interactive World Map" version 2.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("basic-interactive-world-map.php" instead of "world-map.php")

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
There were no executable files found in this plugin1,883 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript372511839
CSS8343480
PHP57014439
SVG200125

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.50
▷ 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-icon.png1.65KB1.01KB▼ 38.59%
public/images/map-icons.png3.93KB2.40KB▼ 38.85%
public/images/icons.png15.88KB5.44KB▼ 65.72%