10% osmaps

Code Review | OSMaps

WordPress plugin OSMaps scored10%from 54 tests.

About plugin

  • Plugin page: osmaps
  • Plugin version: 2.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 13, 2019
  • Latest release: Oct 28, 2023
  • Number of updates: 170
  • Update frequency: every 9.8 days
  • Top authors: alessandro12 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,448 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/osmaps/icd/class.updateversion.php+17
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.56ms] Passed 4 tests

Analyzing server-side resources used by OSMaps
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.46 ▼1.04
Dashboard /wp-admin3.32 ▲0.0244.59 ▲0.98
Posts /wp-admin/edit.php3.37 ▲0.0146.07 ▼1.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.62 ▼1.10
Media Library /wp-admin/upload.php3.24 ▲0.0136.35 ▲2.83
OSMaps /wp-admin/options-general.php?page=osmaps/icd/class.admin.php3.2230.29

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 46 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
osmapsWP
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for OSMaps
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲5313.86 ▼0.7318.15 ▲16.3242.49 ▲2.94
Dashboard /wp-admin2,204 ▲275.62 ▲0.0180.91 ▼2.8037.60 ▼5.21
Posts /wp-admin/edit.php2,106 ▲61.99 ▲0.0338.64 ▲0.9036.92 ▼0.84
Add New Post /wp-admin/post-new.php1,531 ▲323.33 ▲0.13632.29 ▲40.1253.09 ▲4.38
Media Library /wp-admin/upload.php1,406 ▲94.15 ▼0.0496.97 ▼5.6341.07 ▼0.95
OSMaps /wp-admin/options-general.php?page=osmaps/icd/class.admin.php1,4322.1626.2430.75

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/osmaps/public/expanded/MapMapbox193.php
    • > /wp-content/plugins/osmaps/public/expanded/OSMaps_setting.php
    • > /wp-content/plugins/osmaps/public/expanded/MapMapbox.php
    • > /wp-content/plugins/osmaps/public/expanded/MapLeaflet.php
    • > /wp-content/plugins/osmaps/public/expanded/ButtonMap2.php
    • > /wp-content/plugins/osmaps/public/expanded/MapLeaflet193.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Requires php: Version format is invalid
The official readme.txt is a good inspiration

osmaps/osmaps.php 92% from 13 tests

The main PHP file in "OSMaps" ver. 2.3.8 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin5,355 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP124883542,415
CSS7163501,440
JavaScript32171,066
HTML5490222
PO File17274212

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity33.00
▷ Minimum class complexity16.00
▷ Maximum class complexity60.00
Average method complexity3.91
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces1
Interfaces0
Traits1
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes2100.00%
Methods33
▷ Static methods721.21%
▷ Public methods1133.33%
▷ Protected methods00.00%
▷ Private methods2266.67%
Functions4
▷ Named functions4100.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
9 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/marker-icon.png1.43KB1.55KB0.00%
public/leaflet193/images/marker-icon-2x.png2.41KB2.52KB0.00%
public/leaflet193/images/marker-icon.png1.43KB1.55KB0.00%
public/images/marker-shadow.png0.60KB1.16KB0.00%
public/leaflet193/images/marker-shadow.png0.60KB1.16KB0.00%