10% google-maps-gpx-viewer

Code Review | Google Maps GPX Viewer

WordPress plugin Google Maps GPX Viewer scored 10% from 54 tests.

About plugin

  • Plugin page: google-maps-gpx-v...
  • Plugin version: 3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.5
  • WordPress version: 6.3.1
  • First release: Aug 29, 2011
  • Latest release: Nov 24, 2014
  • Number of updates: 112
  • Update frequency: every 10.6 days
  • Top authors: Bernd Altmeier (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

700+ active / 65,459 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Error in wp-content/plugins/google-maps-gpx-viewer/php/gpx_database.php+191
    Uncaught Error: Call to undefined function mysql_get_server_info() in wp-content/plugins/google-maps-gpx-viewer/php/gpx_database.php:191
    Stack trace:
    #0 wp-content/plugins/google-maps-gpx-viewer/php/gpx_database.php(12): poi_db_install()
    #1 wp-content/plugins/google-maps-gpx-viewer/php/map_functions.php(17): require_once('/var/www/wordpr...')
    #2 wp-content/plugins/google-maps-gpx-viewer/google-maps-gpx-viewer.php(17): require('/var/www/wordpr...')
    #3 wp-admin/includes/plugin.php(2318): include_once('/var/www/wordpr...')
    #4 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.44ms] Passed 4 tests

An overview of server-side resources used by Google Maps GPX Viewer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.19 ▼4.55
Dashboard /wp-admin3.31 ▲0.0045.03 ▼8.45
Posts /wp-admin/edit.php3.36 ▲0.0047.18 ▼1.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.50 ▼3.32
Media Library /wp-admin/upload.php3.23 ▲0.0034.48 ▲2.00

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Google Maps GPX Viewer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.74 ▲0.371.66 ▼0.1539.60 ▼4.34
Dashboard /wp-admin2,203 ▲185.90 ▲1.00106.51 ▲6.2741.39 ▲0.88
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0239.53 ▲5.1134.05 ▼1.65
Add New Post /wp-admin/post-new.php1,519 ▲523.26 ▲5.89611.71 ▼73.8148.26 ▼3.57
Media Library /wp-admin/upload.php1,388 ▼04.22 ▼0.0394.72 ▼14.8344.05 ▼1.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/google-maps-gpx-viewer/tinymce/mce_win.php
    • > /wp-content/plugins/google-maps-gpx-viewer/php/load_jsapi.php
    • > /wp-content/plugins/google-maps-gpx-viewer/editor/editor.php
    • > /wp-content/plugins/google-maps-gpx-viewer/tinymce/uploader.php
    • > /wp-content/plugins/google-maps-gpx-viewer/php/gpx_restful.php
    • > /wp-content/plugins/google-maps-gpx-viewer/widgets/upload/gMap_gpxload.php
  • 109× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: map_id in wp-content/plugins/google-maps-gpx-viewer/php/adr_layer.php on line 12
    • > PHP Notice
      Undefined variable: map_id in wp-content/plugins/google-maps-gpx-viewer/php/fusion_layer.php on line 28
    • > PHP Notice
      Undefined variable: map_id in wp-content/plugins/google-maps-gpx-viewer/php/fusion_layer.php on line 25
    • > PHP Notice
      Undefined variable: attr in wp-content/plugins/google-maps-gpx-viewer/php/fusion_layer.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/google-maps-gpx-viewer/php/load_jsapi.php on line 34
    • > PHP Notice
      Undefined variable: map_id in wp-content/plugins/google-maps-gpx-viewer/php/kml_layer.php on line 19
    • > PHP Notice
      Undefined variable: attr in wp-content/plugins/google-maps-gpx-viewer/php/marker_layer.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/google-maps-gpx-viewer/php/load_jsapi.php on line 28
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/google-maps-gpx-viewer/php/marker_layer.php on line 23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/google-maps-gpx-viewer/php/set_offset.php on line 8

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 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (GPX file with track, waypoints, elevation profile and download link in your post), #2 (Map manager to style and configure your map), #3 (Option setting page), #4 (Track and waypoint editor)
  • Tags: There are too many tags (64 tag instead of maximum 10)
You can take inspiration from this readme.txt

google-maps-gpx-viewer/google-maps-gpx-viewer.php 92% from 13 tests

Analyzing the main PHP file in "Google Maps GPX Viewer" version 3.6
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 199 characters long)

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
Success! There were no dangerous files found in this plugin8,389 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript193465853,645
PHP233553823,419
PO File3383538775
CSS35636550

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity18.00
▷ Minimum class complexity4.00
▷ Maximum class complexity25.00
Average method complexity4.24
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions53
▷ Named functions53100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
244 PNG files occupy 0.37MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/sym_10.png2.67KB0.54KB▼ 79.57%
img/gmapIcons/entertain/Restaurant.png1.26KB0.82KB▼ 34.78%
img/gmapIcons/all-mixed/Plane.png1.10KB1.29KB0.00%
img/gmapIcons/pushpins/Pushpin 3.png1.29KB1.05KB▼ 18.73%
img/gmapIcons/tourist/World.png1.58KB0.84KB▼ 46.81%