88% interactive-uk-regional-map

Code Review | Interactive UK Regional Map

WordPress plugin Interactive UK Regional Map scored 88% from 54 tests.

About plugin

  • Plugin page: interactive-uk-re...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.8
  • WordPress version: 5.8.1
  • First release: Jan 2, 2017
  • Latest release: Aug 8, 2021
  • Number of updates: 45
  • Update frequency: every 37.3 days
  • Top authors: clickmaps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,514 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼145.29ms] Passed 4 tests

Analyzing server-side resources used by Interactive UK Regional Map
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0430.96 ▼2.65
Dashboard /wp-admin3.10 ▲0.0452.89 ▲6.16
Posts /wp-admin/edit.php3.15 ▲0.0444.70 ▼2.59
Add New Post /wp-admin/post-new.php5.46 ▲0.0285.58 ▼578.41
Media Library /wp-admin/upload.php3.04 ▲0.0434.58 ▲2.48

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 99 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Interactive UK Regional Map
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,728 ▲13315.86 ▲0.368.05 ▼1.4646.18 ▲0.30
Dashboard /wp-admin2,985 ▲486.04 ▼0.05139.52 ▼3.33128.87 ▲14.36
Posts /wp-admin/edit.php2,776 ▲372.68 ▼0.0161.35 ▼5.1586.56 ▲3.25
Add New Post /wp-admin/post-new.php1,687 ▲418.80 ▲0.50379.06 ▼5.97109.26 ▼4.64
Media Library /wp-admin/upload.php1,776 ▼344.95 ▼0.09129.58 ▼23.10141.77 ▲28.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/interactive-uk-regional-map/design/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/interactive-uk-regional-map/design/admin.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/interactive-uk-regional-map/config.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/interactive-uk-regional-map/ukr-map.php:81

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)
No browser errors were detected

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: Please delete some tags, you are using 12 tag instead of maximum 10
You can take inspiration from this readme.txt

interactive-uk-regional-map/ukr-map.php 92% from 13 tests

"Interactive UK Regional Map" version 2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("interactive-uk-regional-map.php" instead of "ukr-map.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,646 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript50713761
CSS8203400
PHP4248352
SVG200125
HTML1008

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.32
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods990.00%
▷ Protected methods110.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/map-icons.png3.93KB2.40KB▼ 38.85%
images/uk-premium.png14.40KB13.05KB▼ 9.32%
images/map-icon.png1.32KB0.73KB▼ 44.83%
images/icons.png15.88KB5.44KB▼ 65.72%