79% map-block-leaflet

Code Review | Map Block Leaflet

WordPress plugin Map Block Leaflet scored79%from 54 tests.

About plugin

  • Plugin page: map-block-leaflet
  • Plugin version: 3.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 16, 2018
  • Latest release: Mar 20, 2023
  • Number of updates: 30
  • Update frequency: every 52.0 days
  • Top authors: goiblas (63.33%)deployer (40%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active /10,015 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.44ms] Passed 4 tests

This is a short check of server-side resources used by Map Block Leaflet
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.41 ▼1.85
Dashboard /wp-admin3.33 ▲0.0348.78 ▲0.01
Posts /wp-admin/edit.php3.38 ▲0.0247.53 ▲1.56
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.96 ▼1.47
Media Library /wp-admin/upload.php3.25 ▲0.0235.08 ▲2.59

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Map Block Leaflet: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5614.48 ▲0.101.85 ▲0.2238.75 ▼2.58
Dashboard /wp-admin2,206 ▲515.79 ▲0.0894.21 ▼5.4738.46 ▼4.42
Posts /wp-admin/edit.php2,089 ▼32.00 ▲0.0139.36 ▼1.7335.67 ▼4.03
Add New Post /wp-admin/post-new.php6,370 ▲4,83729.21 ▲5.85841.37 ▲193.6536.27 ▼22.42
Media Library /wp-admin/upload.php1,382 ▼64.17 ▼0.0797.22 ▼14.1442.86 ▼3.14

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/map-block-leaflet/build/multi-marker/render.php
    • > /wp-content/plugins/map-block-leaflet/build/leaflet-map-block/render.php
  • 32× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/map-block-leaflet/build/multi-marker/render.php on line 27
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/map-block-leaflet/build/multi-marker/render.php on line 32
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/map-block-leaflet/build/leaflet-map-block/render.php on line 3
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/map-block-leaflet/build/multi-marker/render.php on line 32
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/map-block-leaflet/build/leaflet-map-block/render.php on line 18
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/map-block-leaflet/build/multi-marker/render.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/map-block-leaflet/build/leaflet-map-block/render.php on line 18
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/map-block-leaflet/build/leaflet-map-block/render.php on line 29
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/map-block-leaflet/build/leaflet-map-block/render.php on line 26
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/map-block-leaflet/build/leaflet-map-block/render.php on line 32

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: leaflet, editor, map, gutenberg, blocks

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

The primary PHP file in "Map Block Leaflet" version 3.1.1 is used by WordPress to initiate all plugin functionality
117 characters long description:
Map Block Leaflet -- Allows embed maps in your contents, good alternative to Google Maps without the need for api key

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected819 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
CSS55726579
PHP52819122
JSON200115
JavaScript3053

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 compressed PNG files occupy 0.72MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/images/marker-icon-2x.png2.41KB2.52KB0.00%
build/images/stadia.b4151071.png34.65KB34.94KB0.00%
build/images/watercolor.7c1973aa.png326.47KB331.94KB0.00%
build/images/voyager.1f2bd421.png34.87KB35.15KB0.00%
build/images/dark-matter.d6ff2fd3.png22.26KB22.24KB0.06%