10% google-maps-travel-route

Code Review | Google Maps Travel Route

WordPress plugin Google Maps Travel Route scored10%from 54 tests.

About plugin

  • Plugin page: google-maps-trave...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Aug 20, 2013
  • Latest release: Dec 15, 2013
  • Number of updates: 28
  • Update frequency: every 4.3 days
  • Top authors: traveller11 (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

100+ active /13,901 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/google-maps-travel-route/php/gmtr-widget.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_GMTR_Widget has a deprecated constructor

Server metrics [RAM: ▼1.86MB] [CPU: ▼57.73ms] Passed 4 tests

A check of server-side resources used by Google Maps Travel Route
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.13 ▼1.334.60 ▼38.11
Dashboard /wp-admin2.15 ▼1.156.08 ▼47.22
Posts /wp-admin/edit.php2.15 ▼1.206.47 ▼49.87
Add New Post /wp-admin/post-new.php2.15 ▼3.736.10 ▼95.72
Media Library /wp-admin/upload.php2.15 ▼1.088.11 ▼25.78

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: 1 new table, 8 new options
New tables
wp_gmtr_data
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_gmtr_widget
gmtr_default_marker_icon
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Google Maps Travel Route
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1414.24 ▼0.141.67 ▼0.6042.73 ▼2.16
Dashboard /wp-admin2,209 ▲295.54 ▼0.1388.73 ▼9.8876.74 ▲32.64
Posts /wp-admin/edit.php2,117 ▲171.99 ▼0.0236.27 ▼5.5534.44 ▼2.60
Add New Post /wp-admin/post-new.php1,689 ▲16021.89 ▼0.98719.90 ▲45.7144.97 ▼5.95
Media Library /wp-admin/upload.php1,414 ▲144.12 ▼0.05111.97 ▲5.2767.00 ▲19.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/google-maps-travel-route/php/gmtr-widget.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_GMTR_Widget has a deprecated constructor
  • Zombie tables detected upon uninstall: 1 table
    • wp_gmtr_data
  • Zombie WordPress options detected upon uninstall: 8 options
    • gmtr_default_marker_icon
    • theysaidso_admin_options
    • widget_gmtr_widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/google-maps-travel-route/views/dashboard.php
    • > /wp-content/plugins/google-maps-travel-route/views/add-location.php
    • > /wp-content/plugins/google-maps-travel-route/views/shortcode-generator.php
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/google-maps-travel-route/views/dashboard.php on line 8
    • > PHP Notice
      Undefined variable: current in wp-content/plugins/google-maps-travel-route/views/dashboard.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/google-maps-travel-route/php/gmtr-shortcode.php:3
    • > PHP Notice
      Undefined variable: current in wp-content/plugins/google-maps-travel-route/views/dashboard.php on line 26
    • > PHP Notice
      Undefined variable: current in wp-content/plugins/google-maps-travel-route/views/dashboard.php on line 23
    • > PHP Notice
      Undefined variable: current in wp-content/plugins/google-maps-travel-route/views/dashboard.php on line 29
    • > PHP Notice
      Trying to get property 'base_prefix' of non-object in wp-content/plugins/google-maps-travel-route/views/show-locations.php on line 6
    • > PHP Notice
      Undefined variable: tabs in wp-content/plugins/google-maps-travel-route/views/dashboard.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-maps-travel-route/php/gmtr-widget.php:7
    • > PHP Notice
      Undefined variable: current in wp-content/plugins/google-maps-travel-route/views/dashboard.php on line 32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === google-maps-travel-route === )
You can look at the official readme.txt

google-maps-travel-route/google-maps-travel-route.php Passed 13 tests

"Google Maps Travel Route" version 1.3.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
91 characters long description:
With the Google Maps Travel Route plugin you can easily show a static route on Google Maps.

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
No dangerous file extensions were detected1,453 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP101971121,383
CSS311042
JavaScript16028

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/google-marker-gray.png3.02KB0.31KB▼ 89.67%
images/link.png1.67KB0.83KB▼ 50.12%
images/icons/default.png0.79KB0.84KB0.00%