78% interactive-map-of-africa

Code Review | Interactive Regional Map of Africa

WordPress plugin Interactive Regional Map of Africa scored78%from 54 tests.

About plugin

  • Plugin page: interactive-map-o...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.2
  • WordPress version: 6.3.1
  • First release: Oct 11, 2017
  • Latest release: Apr 3, 2023
  • Number of updates: 20
  • Update frequency: every 100.0 days
  • Top authors: clickmaps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,888 total downloads

Benchmarks

Plugin footprint 83% from 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.01MB] [CPU: ▼5.69ms] Passed 4 tests

A check of server-side resources used by Interactive Regional Map of Africa
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.63 ▼5.76
Dashboard /wp-admin3.32 ▲0.0147.81 ▲0.29
Posts /wp-admin/edit.php3.37 ▲0.0148.74 ▲0.50
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.84 ▼17.80
Media Library /wp-admin/upload.php3.24 ▲0.0138.76 ▲2.10

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 99 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Interactive Regional Map of Africa
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲8413.17 ▼1.211.92 ▼0.0042.18 ▼5.59
Dashboard /wp-admin2,223 ▲355.83 ▲0.93104.03 ▲2.7583.29 ▲40.13
Posts /wp-admin/edit.php2,109 ▲201.98 ▼0.0535.51 ▼6.8234.66 ▼0.55
Add New Post /wp-admin/post-new.php1,682 ▲13822.63 ▲4.22686.30 ▲54.6072.59 ▲16.69
Media Library /wp-admin/upload.php1,405 ▲234.12 ▼0.02100.47 ▲3.6445.11 ▲2.19

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
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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 text when accessed directly:
    • > /wp-content/plugins/interactive-map-of-africa/design/map.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/interactive-map-of-africa/design/admin.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/interactive-map-of-africa/config.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/interactive-map-of-africa/afr-map.php:81

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt is a good inspiration

interactive-map-of-africa/afr-map.php 92% from 13 tests

"Interactive Regional Map of Africa" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("interactive-map-of-africa.php" instead of "afr-map.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,647 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript50713761
CSS8203401
PHP4248352
SVG200125
HTML1008

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/map-icon.png1.30KB0.50KB▼ 61.79%
images/icons.png15.88KB5.44KB▼ 65.72%
images/map-icons.png3.93KB2.40KB▼ 38.85%
images/africa-premium.png14.97KB13.96KB▼ 6.75%