84% interactive-bangladesh-map

Code Review | Interactive Bangladesh Map

WordPress plugin Interactive Bangladesh Map scored84%from 54 tests.

About plugin

  • Plugin page: interactive-bangl...
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.4
  • WordPress version: 6.3.1
  • First release: Apr 3, 2020
  • Latest release: May 9, 2020
  • Number of updates: 5
  • Update frequency: every 7.2 days
  • Top authors: emran.net (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,006 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.87ms] Passed 4 tests

Server-side resources used by Interactive Bangladesh Map
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.11 ▼7.79
Dashboard /wp-admin3.38 ▲0.0748.31 ▼1.54
Posts /wp-admin/edit.php3.43 ▲0.0750.64 ▲3.60
Add New Post /wp-admin/post-new.php5.96 ▲0.0798.67 ▼4.05
Media Library /wp-admin/upload.php3.30 ▲0.0735.79 ▲1.92

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 18 new options
New WordPress options
widget_free_bangladesh_map_widget
freefreebangladeshhtml5map_nameFontSize
freefreebangladeshhtml5map_state_info_8
widget_theysaidso_widget
widget_recent-comments
db_upgraded
freefreebangladeshhtml5map_state_info_2
theysaidso_admin_options
freefreebangladeshhtml5map_state_info_3
freefreebangladeshhtml5map_state_info_6
...

Browser metrics Passed 4 tests

Checking browser requirements for Interactive Bangladesh Map
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,900 ▲15413.62 ▼0.688.14 ▲6.3845.80 ▲4.76
Dashboard /wp-admin2,230 ▲424.88 ▼1.02108.29 ▼1.1177.25 ▲35.95
Posts /wp-admin/edit.php2,121 ▲352.06 ▲0.0438.12 ▲2.8735.25 ▼0.12
Add New Post /wp-admin/post-new.php1,689 ▲16022.11 ▲3.65647.98 ▲26.5155.67 ▼6.94
Media Library /wp-admin/upload.php1,408 ▲234.31 ▲0.14101.13 ▲1.4684.36 ▲37.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_free_bangladesh_map_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/interactive-bangladesh-map/bangladeshmap.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: javascript, map, maps, interactive map, svg map...

interactive-bangladesh-map/bangladeshmap.php 92% from 13 tests

"Interactive Bangladesh Map" version 2.0.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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("interactive-bangladesh-map.php" instead of "bangladeshmap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin634 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP19523324
JavaScript13723198
JSON10066
CSS214446

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
files/img/bangladesh.png64.87KB21.79KB▼ 66.41%
files/img/icon.png0.87KB0.87KB▼ 0.67%