84% ootb-openstreetmap

Code Review | Out of the Block: OpenStreetMap

WordPress plugin Out of the Block: OpenStreetMap scored84%from 54 tests.

About plugin

  • Plugin page: ootb-openstreetmap
  • Plugin version: 2.4.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.6-6.4
  • WordPress version: 6.3.1
  • First release: Sep 15, 2020
  • Latest release: Nov 4, 2023
  • Number of updates: 23
  • Update frequency: every 49.8 days
  • Top authors: gsarig (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active /7,513 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.40ms] Passed 4 tests

A check of server-side resources used by Out of the Block: OpenStreetMap
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1842.39 ▲2.07
Dashboard /wp-admin3.49 ▲0.1454.37 ▼5.87
Posts /wp-admin/edit.php3.60 ▲0.2547.21 ▲0.78
Add New Post /wp-admin/post-new.php6.08 ▲0.1996.32 ▲1.42
Media Library /wp-admin/upload.php3.41 ▲0.1839.32 ▲6.47
OOTB OpenStreetMap /wp-admin/options-general.php?page=ootb-openstreetmap3.3833.25

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 105 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Out of the Block: OpenStreetMap
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7214.31 ▼0.332.14 ▲0.4943.80 ▼1.18
Dashboard /wp-admin2,196 ▲295.50 ▼0.1697.29 ▼11.8642.99 ▼0.21
Posts /wp-admin/edit.php2,104 ▲71.94 ▼0.0836.51 ▼1.7737.14 ▲0.54
Add New Post /wp-admin/post-new.php6,376 ▲4,85029.37 ▲5.601,009.24 ▲391.6362.88 ▲10.32
Media Library /wp-admin/upload.php1,401 ▲14.16 ▼0.0396.18 ▼0.1141.14 ▲1.43
OOTB OpenStreetMap /wp-admin/options-general.php?page=ootb-openstreetmap8892.0022.7432.94

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'OOTB\\Options' not found in wp-content/plugins/ootb-openstreetmap/includes/core.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ootb-openstreetmap/ootb-openstreetmap.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: google maps, openstreetmap, map, block, leaflet

ootb-openstreetmap/ootb-openstreetmap.php 92% from 13 tests

The primary PHP file in "Out of the Block: OpenStreetMap" version 2.4.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin62,489 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
HTML27,2301842,879
JavaScript605,2907,23717,152
CSS5127541,242
PHP172085631,074
JSON400142

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity20.29
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods63
▷ Static methods2641.27%
▷ Public methods6095.24%
▷ Protected methods00.00%
▷ Private methods34.76%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/vendor/leaflet/images/layers.png0.68KB1.05KB0.00%
assets/vendor/leaflet/images/marker-icon-2x.png2.41KB2.52KB0.00%
assets/vendor/leaflet/images/marker-icon.png1.43KB1.55KB0.00%
build/images/layers.416d9136.png0.68KB1.05KB0.00%
assets/vendor/leaflet/images/marker-shadow.png0.60KB1.16KB0.00%