66% wp-google-maps-integration

Code Review | WP Google Maps Integration

WordPress plugin WP Google Maps Integration scored66%from 54 tests.

About plugin

  • Plugin page: wp-google-maps-in...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.7
  • WordPress version: 6.3.1
  • First release: Jun 27, 2017
  • Latest release: Jun 27, 2017
  • Number of updates: 15
  • Update frequency: every 0.3 days
  • Top authors: trapesium (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /915 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.61MB] [CPU: ▼15.50ms] Passed 4 tests

Server-side resources used by WP Google Maps Integration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.31 ▼3.46
Dashboard /wp-admin3.38 ▲0.0843.99 ▼7.49
Posts /wp-admin/edit.php3.43 ▲0.0845.05 ▼1.39
Add New Post /wp-admin/post-new.php3.23 ▼2.6638.69 ▼49.64
Media Library /wp-admin/upload.php3.30 ▲0.0734.50 ▲1.44
Route /wp-admin/admin.php?page=twgm-route-table3.3136.14
Add Marker /wp-admin/admin.php?page=twgm-marker-add3.4338.61
Marker /wp-admin/admin.php?page=twgm-marker-table3.3231.92
Add Map /wp-admin/admin.php?page=twgm-map-add3.3333.27
Category /wp-admin/admin.php?page=twgm-category-table3.3231.48
Add Route /wp-admin/admin.php?page=twgm-route-add3.4133.08
Map /wp-admin/admin.php?page=twgm-map-table3.3131.48
Add Category /wp-admin/admin.php?page=twgm-category-add3.3031.49
Settings /wp-admin/admin.php?page=twgm-setting3.3128.72

Server storage [IO: ▲1.98MB] [DB: ▲0.34MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 205 new files
Database: 4 new tables, 9 new options
New tables
wp_twgm_marker
wp_twgm_map
wp_twgm_category
wp_twgm_route
New WordPress options
twgm_db_ver
plugin_error
widget_twgm_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WP Google Maps Integration
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲12013.18 ▼1.501.76 ▲0.0243.47 ▼0.35
Dashboard /wp-admin2,261 ▲694.86 ▼0.06106.00 ▼5.1938.22 ▼8.02
Posts /wp-admin/edit.php2,141 ▲492.02 ▼0.0240.11 ▲2.7236.34 ▲3.25
Add New Post /wp-admin/post-new.php7,071 ▲5,53825.71 ▲2.57935.34 ▲276.1555.91 ▲5.62
Media Library /wp-admin/upload.php1,446 ▲614.27 ▲0.0699.04 ▲2.4742.41 ▲0.93
Route /wp-admin/admin.php?page=twgm-route-table1,0821.7724.5438.31
Add Marker /wp-admin/admin.php?page=twgm-marker-add2,4417.36177.52151.10
Marker /wp-admin/admin.php?page=twgm-marker-table1,0701.8524.0431.87
Add Map /wp-admin/admin.php?page=twgm-map-add4,3447.30143.4494.25
Category /wp-admin/admin.php?page=twgm-category-table1,0691.8526.6931.53
Add Route /wp-admin/admin.php?page=twgm-route-add1,4173.4157.5941.45
Map /wp-admin/admin.php?page=twgm-map-table1,0781.7224.3434.97
Add Category /wp-admin/admin.php?page=twgm-category-add1,0241.9228.0035.39
Settings /wp-admin/admin.php?page=twgm-setting1,0142.2225.4233.72

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • widget_theysaidso_widget
    • plugin_error
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_twgm_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=twgm-map-add
    • > Notice in wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-mapdata.php+104
    Undefined variable: ct_active
    • > GET request to /wp-admin/admin.php?page=twgm-map-add
    • > Notice in wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-mapdata.php+113
    Undefined variable: ct_name
    • > GET request to /wp-admin/admin.php?page=twgm-map-add
    • > Notice in wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-mapdata.php+117
    Undefined variable: ct_style
    • > GET request to /wp-admin/admin.php?page=twgm-route-add
    • > Deprecated in wp-content/plugins/wp-google-maps-integration/admin/partials/route/route-add-display.php+229
    The each() function is deprecated. This message will be suppressed on further calls
    • > GET request to /wp-admin/admin.php?page=twgm-setting
    • > Notice in wp-content/plugins/wp-google-maps-integration/admin/partials/setting/setting-display.php+24
    Undefined variable: twgm_nonce

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
Almost there! Just fix the following items
  • 8× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-google-maps-integration/admin/partials/map/map-form-gridlist.php
    • > /wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-mapdata.php
    • > /wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-control.php
    • > /wp-content/plugins/wp-google-maps-integration/admin/partials/setting/setting-display.php
    • > /wp-content/plugins/wp-google-maps-integration/admin/partials/map/map-form-radiusfilter.php
    • > /wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-infowindow.php
    • > /wp-content/plugins/wp-google-maps-integration/public/partials/shortcode-display.php
    • > /wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-sidepanel.php
  • 175× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-google-maps-integration/admin/partials/map/class-map-table.php on line 4
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-additional.php on line 23
    • > PHP Notice
      Undefined variable: twgm_nonce in wp-content/plugins/wp-google-maps-integration/admin/partials/setting/setting-display.php on line 24
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-sidepanel.php on line 273
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-google-maps-integration/admin/partials/map/map-form-radiusfilter.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-sidepanel.php on line 262
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-sidepanel.php on line 81
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-google-maps-integration/includes/class-twgm-widget.php:7
    • > PHP Notice
      Undefined variable: result_category in wp-content/plugins/wp-google-maps-integration/public/partials/shortcode-display.php on line 278
    • > PHP Notice
      Undefined variable: map_types in wp-content/plugins/wp-google-maps-integration/admin/partials/map/subform/map-form-mapdata.php on line 72

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=twgm-route-add
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places,drawing 235: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"
    • > GET request to /wp-admin/admin.php?page=twgm-marker-add
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places,drawing 155:245 "Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account"

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (WP Google Maps Integration Front End.), #2 (WP Google Maps Integration Widget Settings.), #3 (WP Google Maps Integration Post Marker Form.), #4 (WP Google Maps Integration Map List.), #5 (WP Google Maps Integration Map Add/Edit Form.), #6 (WP Google Maps Integration Route List.), #7 (WP Google Maps Integration Routes Add/Edit Form.), #8 (WP Google Maps Integration Category List.), #9 (WP Google Maps Integration Category Add/Edit Form.), #10 (WP Google Maps Integration Setting.)
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-google-maps-integration/twgm.php 85% from 13 tests

The entry point to "WP Google Maps Integration" version 1.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-google-maps-integration.php" instead of "twgm.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin39,091 lines of code in 92 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript262,4002,31720,003
CSS2258042912,149
PHP429123156,590
SVG201349

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.53
▷ Minimum class complexity1.00
▷ Maximum class complexity108.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods182
▷ Static methods126.59%
▷ Public methods15182.97%
▷ Protected methods2312.64%
▷ Private methods84.40%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
102 compressed PNG files occupy 0.14MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/marker-icons/musical.png1.45KB1.45KB0.27%
assets/marker-icons/accountancy.png1.45KB1.45KB0.00%
assets/marker-icons/restaurants.png1.40KB1.41KB0.00%
assets/marker-icons/matrimonial.png1.49KB1.49KB0.00%
assets/marker-icons/marker-new1_12.png1.34KB1.34KB0.00%