79% gpx-viewer

Code Review | GPX Viewer

WordPress plugin GPX Viewer scored79%from 54 tests.

About plugin

  • Plugin page: gpx-viewer
  • Plugin version: 2.2.3
  • PHP compatiblity: 7.0.7+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Sep 7, 2018
  • Latest release: May 26, 2023
  • Number of updates: 200
  • Update frequency: every 8.6 days
  • Top authors: axelkeller (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active /11,449 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼2.45ms] Passed 4 tests

This is a short check of server-side resources used by GPX Viewer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.95 ▲0.36
Dashboard /wp-admin3.46 ▲0.1549.74 ▼2.19
Posts /wp-admin/edit.php3.57 ▲0.2154.32 ▲7.11
Add New Post /wp-admin/post-new.php6.06 ▲0.1786.92 ▼8.94
Media Library /wp-admin/upload.php3.38 ▲0.1537.49 ▲0.97
GPX Viewer /wp-admin/options-general.php?page=gpxviewer3.3229.66

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by GPX Viewer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲19215.17 ▲0.785.97 ▲4.2043.04 ▼5.39
Dashboard /wp-admin2,255 ▲645.86 ▲0.96102.63 ▼7.2780.09 ▲38.14
Posts /wp-admin/edit.php2,138 ▲492.82 ▲0.7737.98 ▲0.3935.98 ▼1.41
Add New Post /wp-admin/post-new.php1,712 ▲17023.70 ▲5.02788.12 ▲163.2738.47 ▼10.69
Media Library /wp-admin/upload.php1,431 ▲405.25 ▲1.04106.41 ▲9.6087.54 ▲44.77
GPX Viewer /wp-admin/options-general.php?page=gpxviewer1,2222.5029.9226.81

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% 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)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gpxviewer
    • > Notice in wp-content/plugins/gpx-viewer/gpx-viewer-admin.php+272
    Trying to access array offset on value of type bool

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gpx-viewer/gpx-viewer.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: leaflet, track, map, profile, path...

gpx-viewer/gpx-viewer.php Passed 13 tests

The main file in "GPX Viewer" v. 2.2.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
71 characters long description:
A plugin to display GPX tracks with their elevation profile on OSM maps

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin4,289 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript72945132,280
PHP5103971,038
CSS37734971

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.64
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/marker.png0.48KB0.33KB▼ 31.84%
images/move.png0.70KB0.62KB▼ 11.70%
images/marker-icon-wpt.png1.64KB1.14KB▼ 30.33%
images/marker-icon-end.png1.46KB0.81KB▼ 44.24%
images/marker-icon-start.png1.60KB1.14KB▼ 28.91%