72% layer-maps

Code Review | Layer Maps

WordPress plugin Layer Maps scored72%from 54 tests.

About plugin

  • Plugin page: layer-maps
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Dec 9, 2015
  • Latest release: Dec 17, 2015
  • Number of updates: 10
  • Update frequency: every 1.6 days
  • Top authors: scottsalisbury (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,072 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.53MB] [CPU: ▼22.21ms] Passed 4 tests

Server-side resources used by Layer Maps
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1638.89 ▼0.89
Dashboard /wp-admin3.46 ▲0.1535.77 ▼13.87
Posts /wp-admin/edit.php3.39 ▲0.0332.73 ▼13.92
Add New Post /wp-admin/post-new.php3.41 ▼2.4838.79 ▼60.14
Media Library /wp-admin/upload.php3.49 ▲0.2639.23 ▲4.57
Maps /wp-admin/edit.php?post_type=layermaps_map3.3932.26
Settings /wp-admin/edit.php?post_type=layermaps_map&page=layermaps_settings3.4628.59
Pins /wp-admin/edit.php?post_type=layermaps_pin3.3929.02
Import /wp-admin/edit.php?post_type=layermaps_map&page=layermaps_import3.4331.94
Layers /wp-admin/edit-tags.php?taxonomy=layermaps_layer&post_type=layermaps_map3.4531.94

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 677 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Layer Maps
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲23814.81 ▲0.5630.15 ▲28.3141.00 ▲0.91
Dashboard /wp-admin2,252 ▲645.82 ▲0.92114.63 ▼2.0643.84 ▲3.65
Posts /wp-admin/edit.php2,135 ▲462.06 ▲0.0240.88 ▲1.3735.26 ▼0.31
Add New Post /wp-admin/post-new.php1,553 ▲1123.39 ▲5.14610.90 ▲1.8850.32 ▼3.11
Media Library /wp-admin/upload.php1,437 ▲554.18 ▼0.04104.79 ▲1.3643.57 ▼1.55
Maps /wp-admin/edit.php?post_type=layermaps_map1,1131.9331.6229.37
Settings /wp-admin/edit.php?post_type=layermaps_map&page=layermaps_settings8532.0427.7128.20
Pins /wp-admin/edit.php?post_type=layermaps_pin1,1211.9531.0532.89
Import /wp-admin/edit.php?post_type=layermaps_map&page=layermaps_import8402.0324.6929.55
Layers /wp-admin/edit-tags.php?taxonomy=layermaps_layer&post_type=layermaps_map1,3582.1328.2926.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=layermaps_map&page=layermaps_import
    • > Notice in wp-content/plugins/layer-maps/includes/admin/class-lm-admin.php+515
    Undefined index: lm_map
    • > GET request to /wp-admin/edit-tags.php?taxonomy=layermaps_layer&post_type=layermaps_map
    • > Notice in wp-content/plugins/layer-maps/includes/admin/class-lm-admin.php+300
    Trying to get property 'term_id' of non-object

SRP 0% 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 take a closer look at the following
  • 94× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/02types.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/10autofilter-selection-2.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/18extendedcalculation.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/09pagebreaks.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/OOCalcReader.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/13calculation.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/GnumericReader.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/03formulas.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/42richText.php
    • > /wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Examples/06largescale-with-cellcaching.php
  • 4095× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Worksheet.php on line 1118
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/layer-maps/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php on line 90

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: marker maps, kml layer, quick maps, mapping, geocode...

layer-maps/layer-maps.php Passed 13 tests

"Layer Maps" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
78 characters long description:
Simple Google Maps plugin to create layers, add pins and display mapping data.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin70,427 lines of code in 378 files:
LanguageFilesBlank linesComment linesLines of code
PHP35115,24441,29065,137
JSON6102,345
JavaScript43275231,155
HTML51710752
XML610534
Markdown3740334
CSS2144154
YAML14016

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,177)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 387)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity42.68
▷ Minimum class complexity1.00
▷ Maximum class complexity1,177.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity387.00
Code structure
Namespaces1
Interfaces7
Traits0
Classes253
▷ Abstract classes93.56%
▷ Concrete classes24496.44%
▷ Final classes00.00%
Methods3,552
▷ Static methods63617.91%
▷ Public methods2,98784.09%
▷ Protected methods762.14%
▷ Private methods48913.77%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants928
▷ Global constants23124.89%
▷ Class constants69775.11%
▷ Public constants697100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
37 PNG files occupy 0.35MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/green_marker.png3.13KB0.39KB▼ 87.60%
assets/images/icons/blue_marker.png1.32KB0.39KB▼ 70.57%
assets/images/icons/red_marker.png3.13KB0.39KB▼ 87.62%
assets/js/vendor/js-marker-clusterer/images/heart30.png1.41KB1.46KB0.00%
assets/images/filter-checked.png1.11KB0.21KB▼ 80.86%