78% osmapper

Code Review | OSMapper

WordPress plugin OSMapper scored 78% from 54 tests.

About plugin

  • Plugin page: osmapper
  • Plugin version: 2.1.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5.1
  • WordPress version: 5.8.1
  • First release: Oct 19, 2018
  • Latest release: Oct 15, 2020
  • Number of updates: 82
  • Update frequency: every 8.9 days
  • Top authors: b4after (100%)

Code review

54 tests

User reviews

61 reviews

Install metrics

3,000+ active / 17,155 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.30MB] [CPU: ▼134.36ms] Passed 4 tests

Server-side resources used by OSMapper
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.13 ▲0.2938.31 ▲7.08
Dashboard /wp-admin3.41 ▲0.3547.83 ▲8.21
Posts /wp-admin/edit.php3.46 ▲0.3550.20 ▲5.06
Add New Post /wp-admin/post-new.php5.71 ▲0.2895.90 ▼553.62
Media Library /wp-admin/upload.php3.29 ▲0.2936.39 ▲4.04
All Maps /wp-admin/edit.php?post_type=ba_map3.4136.67
New Map /wp-admin/post-new.php?post_type=ba_map3.5349.55

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 97 new files
Database: no new tables, 1 new option
New WordPress options
show_review

Browser metrics Passed 4 tests

Checking browser requirements for OSMapper
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,924 ▲32817.58 ▲1.5518.73 ▲2.8944.55 ▼2.49
Dashboard /wp-admin3,087 ▲1565.94 ▼0.03145.91 ▼21.35107.03 ▼0.13
Posts /wp-admin/edit.php2,859 ▲1202.73 ▲0.0270.86 ▲5.0082.75 ▼6.10
Add New Post /wp-admin/post-new.php1,738 ▲13418.50 ▼0.04382.60 ▼10.59117.13 ▲13.80
Media Library /wp-admin/upload.php1,928 ▲1215.04 ▼0.00162.65 ▲9.43128.74 ▲9.83
All Maps /wp-admin/edit.php?post_type=ba_map1,5753.3273.3291.09
New Map /wp-admin/post-new.php?post_type=ba_map3,4578.96203.76188.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • show_review

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=ba_map
    • > Notice in wp-content/plugins/osmapper/classes/FormBuilder.php+67
    Trying to access array offset on value of type null

SRP 50% 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
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/osmapper/includes/functions.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/osmapper/includes/functions.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #1 (Map display on website.) image required
Please take inspiration from this readme.txt

osmapper/osmapper.php Passed 13 tests

"OSMapper" version 2.1.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
36 characters long description:
Plugins help with adding map on page

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin5,019 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript175185321,680
PHP245836691,641
LESS316944626
CSS55629598
SVG707289
PO File16466163
JSON20022

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity11.56
▷ Minimum class complexity1.00
▷ Maximum class complexity82.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods90
▷ Static methods33.33%
▷ Public methods7077.78%
▷ Protected methods1213.33%
▷ Private methods88.89%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
24 PNG files occupy 0.85MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/schemes/default_hot.png116.56KB41.66KB▼ 64.26%
assets/images/schemes/light_all.png18.10KB6.44KB▼ 64.41%
assets/images/fullscreen@2x.png0.41KB0.15KB▼ 63.10%
assets/images/banner-772-250.png77.58KB28.03KB▼ 63.88%
assets/images/icon-128-128.png17.13KB7.00KB▼ 59.15%