10% mapfig-premium-leaflet-map-maker

Code Review | AcuGIS Leaflet Maps

WordPress plugin AcuGIS Leaflet Maps scored10%from 54 tests.

About plugin

  • Plugin page: mapfig-premium-le...
  • Plugin version: 5.1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-5.1.1
  • WordPress version: 6.3.1
  • First release: Jun 29, 2015
  • Latest release: May 21, 2019
  • Number of updates: 93
  • Update frequency: every 15.3 days
  • Top authors: MapFig (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /9,169 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/mapfig-premium-leaflet-map-maker/widget/mf-widget.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; MAP_Widget has a deprecated constructor

Server metrics [RAM: ▼1.59MB] [CPU: ▼49.03ms] Passed 4 tests

Server-side resources used by AcuGIS Leaflet Maps
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.40 ▼1.076.89 ▼31.20
Dashboard /wp-admin2.42 ▼0.898.84 ▼40.75
Posts /wp-admin/edit.php2.42 ▼0.948.08 ▼41.61
Add New Post /wp-admin/post-new.php2.42 ▼3.478.70 ▼82.57
Media Library /wp-admin/upload.php2.42 ▼0.817.33 ▼24.85
My Base Maps /wp-admin/admin.php?page=layers2.428.17
Add New Map /wp-admin/admin.php?page=add-new-map2.428.36
Add New Base Map /wp-admin/admin.php?page=layers-add2.427.07
Social Share /wp-admin/admin.php?page=social-share2.428.88
Widget /wp-admin/admin.php?page=get_started_widget2.428.43
Add New Group /wp-admin/admin.php?page=groups-add2.4215.76
Social Settings /wp-admin/admin.php?page=social-share-settings2.428.01
Documentation /wp-admin/admin.php?page=get-started2.428.51
My Maps /wp-admin/admin.php?page=my-maps2.427.15
Base Map Groups /wp-admin/admin.php?page=groups2.427.80

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 359 new files
Database: 4 new tables, 8 new options
New tables
wp_mapfig_premium_groups_has_layers
wp_mapfig_premium_map
wp_mapfig_premium_layers
wp_mapfig_premium_groups
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_mf-widget
can_compress_scripts
db_upgraded
mapfig_premium_db_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for AcuGIS Leaflet Maps
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,053 ▲30714.75 ▲0.378.87 ▲7.2142.61 ▲1.79
Dashboard /wp-admin2,350 ▲1595.78 ▲0.73105.99 ▲1.0741.89 ▼2.37
Posts /wp-admin/edit.php2,241 ▲1522.71 ▲0.7441.55 ▲1.8334.39 ▼1.55
Add New Post /wp-admin/post-new.php1,642 ▲12118.77 ▼4.48617.88 ▼13.9535.14 ▼28.05
Media Library /wp-admin/upload.php1,545 ▲1605.07 ▲0.84106.56 ▲8.0243.40 ▼1.06
My Base Maps /wp-admin/admin.php?page=layers1,9313.5866.0971.03
Add New Map /wp-admin/admin.php?page=add-new-map2,5657.25197.67103.78
Add New Base Map /wp-admin/admin.php?page=layers-add1,3183.2936.9448.19
Social Share /wp-admin/admin.php?page=social-share1,9524.2071.7050.53
Widget /wp-admin/admin.php?page=get_started_widget1,5403.3237.2775.62
Add New Group /wp-admin/admin.php?page=groups-add1,2603.2937.3647.91
Social Settings /wp-admin/admin.php?page=social-share-settings1,4003.2836.9167.43
Documentation /wp-admin/admin.php?page=get-started1,8613.3937.9969.06
My Maps /wp-admin/admin.php?page=my-maps1,3123.2939.7348.91
Base Map Groups /wp-admin/admin.php?page=groups1,6193.7949.2757.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/mapfig-premium-leaflet-map-maker/widget/mf-widget.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; MAP_Widget has a deprecated constructor
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_mapfig_premium_groups
    • wp_mapfig_premium_map
    • wp_mapfig_premium_groups_has_layers
    • wp_mapfig_premium_layers
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • mapfig_premium_db_version
    • widget_theysaidso_widget
    • db_upgraded
    • widget_mf-widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=groups
    • > Deprecated in wp-content/plugins/mapfig-premium-leaflet-map-maker/widget/mf-widget.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; MAP_Widget has a deprecated constructor

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 44× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/application/config/profiler.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/application/config/uploader_settings.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/application/controllers/uploader.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Router.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Exceptions.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/views/include/footer-small.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/application/config/doctypes.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Hooks.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Security.php
    • > /wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Input.php
  • 87× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant MF_HELP_URL - assumed 'MF_HELP_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapfig-premium-leaflet-map-maker/views/social_share.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mapfig-premium-leaflet-map-maker/views/groups_edit.php:7
    • > PHP Warning
      include(../is_allowed.php): failed to open stream: No such file or directory in wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/application/helpers/jbimages_helper.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mapfig-premium-leaflet-map-maker/views/groups_has_layers.php:7
    • > PHP Warning
      Use of undefined constant MF_COPYRIGHT_TEXT - assumed 'MF_COPYRIGHT_TEXT' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapfig-premium-leaflet-map-maker/views/include/footer-small.php on line 80
    • > PHP Warning
      Use of undefined constant MF_FACEBOOK_URL - assumed 'MF_FACEBOOK_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapfig-premium-leaflet-map-maker/views/include/footer-small.php on line 83
    • > PHP Warning
      Use of undefined constant MF_HELP_URL - assumed 'MF_HELP_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapfig-premium-leaflet-map-maker/views/get_started.php on line 45
    • > PHP Notice
      Undefined variable: line in wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_php.php on line 8
    • > PHP Warning
      Use of undefined constant MF_HELP_URL - assumed 'MF_HELP_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapfig-premium-leaflet-map-maker/views/mf.php on line 45
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mapfig-premium-leaflet-map-maker/tinymce/js/tinymce/plugins/jbimages/config.php on line 44

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=add-new-map
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places&ver=6.3.1 234:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: maps, openstreetmap, mapbox maps, leaflet, google maps...

mapfig-premium-leaflet-map-maker/mf_plugin.php 92% from 13 tests

"AcuGIS Leaflet Maps" version 5.1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mapfig-premium-leaflet-map-maker.php" instead of "mf_plugin.php")

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
Everything looks great! No dangerous files found in this plugin38,912 lines of code in 224 files:
LanguageFilesBlank linesComment linesLines of code
CSS3627537822,166
PHP812,4744,7158,949
JavaScript911,3628845,950
SVG8111,626
LESS196123
HTML525495
Markdown2103

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity43.26
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods232
▷ Static methods208.62%
▷ Public methods20688.79%
▷ Protected methods229.48%
▷ Private methods41.72%
Functions59
▷ Named functions59100.00%
▷ Anonymous functions00.00%
Constants44
▷ Global constants44100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
59 PNG files occupy 2.42MB with 1.65MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sort_desc_disabled.png1.02KB0.25KB▼ 75.98%
external/images/spritesheet.png1.03KB0.67KB▼ 34.94%
external/images/markers-soft.png40.26KB7.77KB▼ 80.70%
images/sort_asc_disabled.png1.03KB0.25KB▼ 76.00%
images/share/facebook.png94.73KB26.67KB▼ 71.85%