84% leaflet-map-widget

Code Review | Leaflet Map Widget

WordPress plugin Leaflet Map Widget scored84%from 54 tests.

About plugin

  • Plugin page: leaflet-map-widget
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7
  • WordPress version: 6.3.1
  • First release: Aug 22, 2016
  • Latest release: Jan 28, 2021
  • Number of updates: 9
  • Update frequency: every 180.0 days
  • Top authors: theode (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,465 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
Install script ran successfully

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

This is a short check of server-side resources used by Leaflet Map Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.50 ▼7.65
Dashboard /wp-admin3.32 ▲0.0152.98 ▲5.03
Posts /wp-admin/edit.php3.37 ▲0.0151.85 ▲1.24
Add New Post /wp-admin/post-new.php5.90 ▲0.0199.91 ▲0.43
Media Library /wp-admin/upload.php3.24 ▲0.0139.66 ▲5.89

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_leafletmapwidget
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Leaflet Map Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.23 ▼1.311.64 ▼0.2139.71 ▼8.58
Dashboard /wp-admin2,221 ▲185.83 ▼0.1297.97 ▼5.5340.01 ▲0.73
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0439.06 ▼1.4334.67 ▼1.37
Add New Post /wp-admin/post-new.php1,545 ▼123.36 ▲0.32680.80 ▲67.3062.02 ▲6.94
Media Library /wp-admin/upload.php1,400 ▼04.27 ▲0.07113.02 ▲10.1648.25 ▼0.05

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 did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_leafletmapwidget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/leaflet-map-widget/leaflet-map-widget.php:39

User-side errors Passed 1 test

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

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
3 plugin tags: widget, leaflet, map

leaflet-map-widget/leaflet-map-widget.php 92% from 13 tests

The main file in "Leaflet Map Widget" v. 0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin99 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1253469
PO File191830

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin