78% gps-tracker

Code Review | Gps Tracker

WordPress plugin Gps Tracker scored78%from 54 tests.

About plugin

  • Plugin page: gps-tracker
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5.3
  • WordPress version: 6.3.1
  • First release: Nov 16, 2014
  • Latest release: Jul 14, 2016
  • Number of updates: 16
  • Update frequency: every 39.0 days
  • Top authors: nicolasfox (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

60+ active /11,320 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.39ms] Passed 4 tests

An overview of server-side resources used by Gps Tracker
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.36 ▲4.35
Dashboard /wp-admin3.31 ▼0.0445.16 ▼10.73
Posts /wp-admin/edit.php3.36 ▲0.0043.12 ▼0.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.32 ▼12.91
Media Library /wp-admin/upload.php3.23 ▲0.0035.33 ▲2.54

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

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

Browser metrics Passed 4 tests

Gps Tracker: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.24 ▼0.381.64 ▲0.0138.68 ▼0.86
Dashboard /wp-admin2,195 ▲145.59 ▼0.0182.56 ▼18.8739.92 ▲0.55
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0435.09 ▼6.0832.06 ▼3.34
Add New Post /wp-admin/post-new.php1,533 ▲723.08 ▼0.48684.44 ▲17.7560.94 ▼1.20
Media Library /wp-admin/upload.php1,397 ▼34.17 ▼0.0295.40 ▲0.1241.53 ▼3.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gps-tracker/templates/shortcode-gpstracker-map.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/gps-tracker/admin/views/admin.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
10 plugin tags: track, gps, cell, websmithing, openstreetview...

gps-tracker/gpstracker.php 85% from 13 tests

The primary PHP file in "Gps Tracker" version 1.0.4 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("gps-tracker.php" instead of "gpstracker.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; 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 file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin8,502 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript62,3075837,106
CSS56718764
PHP12183530632

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.57
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods412.50%
▷ Public methods2578.12%
▷ Protected methods412.50%
▷ Private methods39.38%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 PNG files occupy 0.74MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/js/leaflet-0.7.5/images/layers-2x.png2.83KB1.67KB▼ 41.10%
public/assets/js/leaflet-0.7.5/images/marker-icon-2x.png3.94KB2.53KB▼ 35.71%
public/assets/images/coolred_small.png0.46KB0.50KB0.00%
public/assets/images/coolgreen_small.png0.57KB0.58KB0.00%
public/assets/images/coolgreen2_small.png3.59KB0.50KB▼ 86.13%