72% osm

Code Review | OSM - OpenStreetMap

WordPress plugin OSM - OpenStreetMap scored72%from 54 tests.

About plugin

  • Plugin page: osm
  • Plugin version: 6.0.2
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Apr 8, 2009
  • Latest release: Nov 1, 2023
  • Number of updates: 238
  • Update frequency: every 22.4 days
  • Top authors: photoweblog (100%)

Code review

54 tests

User reviews

128 reviews

Install metrics

10,000+ active /484,668 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▼3.45ms] Passed 4 tests

A check of server-side resources used by OSM - OpenStreetMap
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.6745.40 ▼4.52
Dashboard /wp-admin3.95 ▲0.6148.82 ▼13.69
Posts /wp-admin/edit.php4.01 ▲0.6554.31 ▲2.14
Add New Post /wp-admin/post-new.php6.54 ▲0.65109.50 ▲11.01
Media Library /wp-admin/upload.php3.82 ▲0.5938.43 ▲2.27

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 474 new files
Database: no new tables, 7 new options
New WordPress options
widget_osm_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

OSM - OpenStreetMap: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲11713.41 ▼0.868.37 ▲6.2236.70 ▼5.98
Dashboard /wp-admin2,204 ▲305.57 ▼0.0791.72 ▼7.4739.63 ▼3.81
Posts /wp-admin/edit.php2,106 ▲32.02 ▲0.0241.14 ▲5.2037.71 ▲4.34
Add New Post /wp-admin/post-new.php10,566 ▲9,02527.99 ▲4.96962.16 ▲290.3643.41 ▼5.78
Media Library /wp-admin/upload.php1,408 ▲114.18 ▼0.0298.13 ▼2.3544.71 ▲0.41
OSM /wp-admin/osm.php260.420.0714.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_osm_widget
    • widget_recent-comments

Smoke tests 25% 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 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 take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/osm/osm-maptype-select.php
    • > /wp-content/plugins/osm/osm-import.php
    • > /wp-content/plugins/osm/osm-marker-tagged-select.php
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/osm/osm-theme-select.php:1
    • > PHP Notice
      Undefined variable: sc_args in wp-content/plugins/osm/osm_map_v3/osm-sc-osm_map_v3_backend.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function shortcode_atts() in wp-content/plugins/osm/osm_map_v3/osm-sc-osm_map_v3.php:18
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/osm/osm-error-msg.php:11
    • > PHP Warning
      Use of undefined constant OSM_PLUGIN_URL - assumed 'OSM_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/osm/osm-options.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/osm/osm-widget.php:5
    • > PHP Warning
      Use of undefined constant OSM_PLUGIN_URL - assumed 'OSM_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/osm/osm-sc-info.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/osm/osm-color-select.php:1
    • > PHP Notice
      Undefined variable: a_import in wp-content/plugins/osm/osm-import.php on line 50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/osm/osm-marker-geotag-select.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/osm.php
    • > Network (severe)
    wp-admin/osm.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (19 tag instead of maximum 10)
The official readme.txt might help

osm/osm.php 92% from 13 tests

The primary PHP file in "OSM - OpenStreetMap" version 6.0.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 155 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected15,561 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,0045767,653
JavaScript134413963,164
PO File61,4242,1822,790
CSS12220481,417
XML540482
Markdown124055

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 289)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity106.88
▷ Minimum class complexity12.00
▷ Maximum class complexity328.00
Average method complexity8.50
▷ Minimum method complexity1.00
▷ Maximum method complexity289.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods113
▷ Static methods4741.59%
▷ Public methods9987.61%
▷ Protected methods00.00%
▷ Private methods1412.39%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants93
▷ Global constants93100.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
382 compressed PNG files occupy 0.69MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/OL/2.13.1/theme/default/img/view_next_on.png1.65KB1.53KB▼ 7.35%
js/OL/2.13.1/theme/default/img/view_next_off.png1.46KB1.54KB0.00%
js/OL/2.13.1/img/drag-rectangle-on.png1.02KB1.09KB0.00%
icons/mic_black_olymphouse_10.png2.49KB1.61KB▼ 35.33%
js/OL/2.13.1/img/zoom-minus-mini.png0.28KB0.25KB▼ 13.75%