78% wp-open-street-map

Code Review | WP Open Street Map

WordPress plugin WP Open Street Map scored78%from 54 tests.

About plugin

  • Plugin page: wp-open-street-map
  • Plugin version: 1.30
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Sep 19, 2017
  • Latest release: Sep 27, 2023
  • Number of updates: 42
  • Update frequency: every 52.4 days
  • Top authors: manu225 (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /23,304 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.04MB] [CPU: ▼8.19ms] Passed 4 tests

A check of server-side resources used by WP Open Street Map
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.91 ▼9.26
Dashboard /wp-admin3.37 ▲0.0255.55 ▼10.58
Posts /wp-admin/edit.php3.48 ▲0.1353.82 ▲1.47
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.96 ▼14.37
Media Library /wp-admin/upload.php3.27 ▲0.0443.01 ▲5.54

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 37 new files
Database: 2 new tables, 6 new options
New tables
wp_wp_openstreetmap_markers
wp_wp_openstreetmap
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WP Open Street Map
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲17814.67 ▲0.311.79 ▲0.1941.92 ▼1.54
Dashboard /wp-admin2,330 ▲1536.12 ▲0.45111.66 ▲16.9489.57 ▲45.15
Posts /wp-admin/edit.php2,276 ▲1793.37 ▲1.3454.33 ▲16.4063.01 ▲29.25
Add New Post /wp-admin/post-new.php1,539 ▲1323.23 ▼0.07666.93 ▲33.41146.70 ▲87.53
Media Library /wp-admin/upload.php1,413 ▲134.16 ▼0.0093.86 ▼14.2980.53 ▲34.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon 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 short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-open-street-map/views/map.tpl.php
    • > /wp-content/plugins/wp-open-street-map/views/icons_list.php
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: map in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-open-street-map/views/icons_list.php on line 4
    • > PHP Notice
      Trying to get property 'id' of non-object in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 1
    • > PHP Notice
      Trying to get property 'width' of non-object in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 1
    • > PHP Notice
      Trying to get property 'longitude' of non-object in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 1
    • > PHP Notice
      Undefined variable: map in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 1
    • > PHP Notice
      Trying to get property 'markers' of non-object in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 8
    • > PHP Notice
      Undefined variable: map in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 8
    • > PHP Notice
      Trying to get property 'latitude' of non-object in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 1
    • > PHP Notice
      Undefined variable: map in wp-content/plugins/wp-open-street-map/views/map.tpl.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

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
9 plugin tags: open street map, marker, maps, openstreet map, travel...

wp-open-street-map/wp_openstreetmap.php 92% from 13 tests

The principal PHP file in "WP Open Street Map" v. 1.30 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-open-street-map.php" instead of "wp_openstreetmap.php")

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
Everything looks great! No dangerous files found in this plugin898 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP623352614
CSS3291186
JavaScript2448198

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions8
▷ Named functions8100.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
21 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/fb.png1.59KB1.00KB▼ 37.42%
images/markers/market.png1.12KB0.94KB▼ 16.08%
images/markers/restaurant.png1.28KB1.03KB▼ 19.66%
images/markers/bus.png1.05KB0.90KB▼ 13.70%
images/edit.png0.87KB0.87KB0.00%