68% wp-leaflet-mapper

Code Review | WP Leaflet Mapper

WordPress plugin WP Leaflet Mapper scored68%from 54 tests.

About plugin

  • Plugin page: wp-leaflet-mapper
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.1
  • WordPress version: 6.3.1
  • First release: Apr 30, 2019
  • Latest release: May 1, 2019
  • Number of updates: 32
  • Update frequency: every 0.0 days
  • Top authors: iisys (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /733 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.92MB] [CPU: ▼32.32ms] Passed 4 tests

This is a short check of server-side resources used by WP Leaflet Mapper
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0440.26 ▲1.66
Dashboard /wp-admin3.02 ▼0.2822.71 ▼24.06
Posts /wp-admin/edit.php3.02 ▼0.3323.62 ▼22.70
Add New Post /wp-admin/post-new.php3.02 ▼2.8623.56 ▼74.49
Media Library /wp-admin/upload.php3.02 ▼0.2024.74 ▼8.04
Leaflet-Mapper /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php3.0323.36

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WP Leaflet Mapper
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7914.67 ▲0.304.83 ▲2.9142.39 ▼3.07
Dashboard /wp-admin2,209 ▲205.95 ▲0.0399.39 ▼5.6041.91 ▼1.70
Posts /wp-admin/edit.php2,101 ▲122.77 ▲0.7137.31 ▲2.4931.54 ▼1.28
Add New Post /wp-admin/post-new.php6,463 ▲4,93423.87 ▲5.48836.73 ▲242.4338.98 ▼27.65
Media Library /wp-admin/upload.php1,394 ▲65.14 ▲0.93100.23 ▲1.5043.03 ▼0.61
Leaflet-Mapper /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php9602.6844.1643.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • Leaflet_Mapper_Option
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > Notice in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php+124
    Undefined index: action
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > Notice in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php+134
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > Notice in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php+137
    Undefined index: ilm_admin_map_height
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > Notice in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php+140
    Undefined index: ilm_min_zoom
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > Notice in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php+143
    Undefined index: ilm_max_zoom
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > Notice in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php+146
    Undefined index: ilm_post_type
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > Notice in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php+149
    Undefined index: ilm_select_maptile
    • > GET request to /wp-admin/options-general.php?page=wp-leaflet-mapper/wp-leaflet-mapper.php
    • > Notice in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php+43
    Undefined index: post

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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/wp-leaflet-mapper/wp-leaflet-mapper.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: map, gmap, leaflet

wp-leaflet-mapper/wp-leaflet-mapper.php Passed 13 tests

"WP Leaflet Mapper" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
109 characters long description:
Supports switching from GMap to Leaflet. Display map on post screen and save LatLng as a custom field at GUI.

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
Good job! No executable or dangerous file extensions detected252 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP11722205
PO File1171947

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/center_icon.png3.79KB1.48KB▼ 61.03%
img/location_icon.png1.41KB1.46KB0.00%