10% leo-travel-distance-time-manager

Code Review | Leo Travel Distance Time Manager

WordPress plugin Leo Travel Distance Time Manager scored10%from 54 tests.

About plugin

  • Plugin page: leo-travel-distan...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 12, 2015
  • Latest release: Dec 14, 2015
  • Number of updates: 13
  • Update frequency: every 2.5 days
  • Top authors: Qasim Jan (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,785 total downloads

Benchmarks

Plugin footprint 40% 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
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/leo-travel-distance-time-manager/leo_dist_settings.php+11
    Constant ABSPATH already defined

Server metrics [RAM: ▼1.94MB] [CPU: ▼56.94ms] Passed 4 tests

An overview of server-side resources used by Leo Travel Distance Time Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.424.55 ▼38.64
Dashboard /wp-admin2.06 ▼1.245.97 ▼49.54
Posts /wp-admin/edit.php2.07 ▼1.295.82 ▼45.79
Add New Post /wp-admin/post-new.php2.06 ▼3.826.44 ▼93.77
Media Library /wp-admin/upload.php2.07 ▼1.164.95 ▼28.12

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Leo Travel Distance Time Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲17115.53 ▲1.2846.47 ▲44.2650.78 ▲6.60
Dashboard /wp-admin2,195 ▲215.56 ▼0.1185.15 ▼4.8439.91 ▲0.24
Posts /wp-admin/edit.php2,097 ▼31.96 ▼0.0039.25 ▼0.2034.97 ▲3.84
Add New Post /wp-admin/post-new.php1,526 ▼223.24 ▲0.38685.40 ▲33.9455.72 ▼4.22
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0698.57 ▼4.8248.32 ▲3.65

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/leo-travel-distance-time-manager/leo_dist_settings.php+11
    Constant ABSPATH already defined
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% 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 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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/leo-travel-distance-time-manager/leo_dist_settings.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/leo-travel-distance-time-manager/leo_dist_main.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: travel, google map, calculator, distance calculator, time calculator...

leo-travel-distance-time-manager/leo_dist_settings.php 92% from 13 tests

The main file in "Leo Travel Distance Time Manager" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("leo-travel-distance-time-manager.php" instead of "leo_dist_settings.php")

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 plugin660 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1116418
PHP209146
CSS20496

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.07
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
5 PNG files occupy 0.12MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/dest.png11.76KB3.06KB▼ 73.95%
img/asiimg.png0.56KB0.27KB▼ 51.91%
img/stop.png11.22KB3.05KB▼ 72.85%
img/pick.png10.73KB2.66KB▼ 75.20%
img/world-map-icon.png89.18KB28.81KB▼ 67.70%