90% wp-map-block

Code Review | WP Map Block - Gutenberg Map Block for Google Map and OpenStreet Map

WordPress plugin WP Map Block - Gutenberg Map Block for Google Map and OpenStreet Map scored90%from 54 tests.

About plugin

  • Plugin page: wp-map-block
  • Plugin version: 1.4.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Aug 28, 2020
  • Latest release: Jun 22, 2023
  • Number of updates: 34
  • Update frequency: every 30.2 days
  • Top authors: tusharimran (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

20,000+ active /129,396 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼7.80ms] Passed 4 tests

An overview of server-side resources used by WP Map Block - Gutenberg Map Block for Google Map and OpenStreet Map
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.69 ▲1.97
Dashboard /wp-admin3.42 ▲0.0849.88 ▼16.87
Posts /wp-admin/edit.php3.54 ▲0.1849.93 ▼5.89
Add New Post /wp-admin/post-new.php6.01 ▲0.1295.77 ▼10.41
Media Library /wp-admin/upload.php3.35 ▲0.1238.04 ▲4.27

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 34 new files
Database: no new tables, 8 new options
New WordPress options
wp_map_block_version
can_compress_scripts
widget_recent-posts
wp_map_block_first_install_time
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WP Map Block - Gutenberg Map Block for Google Map and OpenStreet Map
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.28 ▲0.311.87 ▼0.5645.28 ▲0.33
Dashboard /wp-admin2,198 ▲215.61 ▲0.0784.87 ▼7.4342.68 ▲3.01
Posts /wp-admin/edit.php2,103 ▲62.03 ▲0.0144.70 ▲6.8137.52 ▲1.44
Add New Post /wp-admin/post-new.php6,199 ▲4,66819.40 ▼3.68979.09 ▲301.9756.15 ▼3.03
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.1898.29 ▼7.4848.07 ▲2.98

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • wp_map_block_first_install_time
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • wp_map_block_version
    • can_compress_scripts

Smoke tests Passed 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 Passed 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
The SRP test was a success

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 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-map-block/wp-map-block.php Passed 13 tests

The principal PHP file in "WP Map Block - Gutenberg Map Block for Google Map and OpenStreet Map" v. 1.4.8 is loaded by WordPress automatically on each request
74 characters long description:
Gutenberg Map Block for Google Map and OpenStreet Map build with LeafletJS

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
There were no executable files found in this plugin878 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP17255189848
SVG10017
CSS2006
JSON1005
JavaScript2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity11.60
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes110.00%
Methods61
▷ Static methods2337.70%
▷ Public methods5793.44%
▷ Protected methods23.28%
▷ Private methods23.28%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dist/images/fullscreen.f2c17d21.png0.29KB0.14KB▼ 52.51%
assets/images/marker-icon.png1.43KB1.55KB0.00%
assets/dist/images/layers-2x.8f2c4d11.png1.23KB1.67KB0.00%
assets/dist/images/marker-icon.2b3e1faf.png1.43KB1.55KB0.00%
assets/images/map.png3.93KB3.62KB▼ 7.76%