63% fare-calculator

Code Review | Fare Calculator

WordPress plugin Fare Calculator scored 63% from 54 tests.

About plugin

  • Plugin page: fare-calculator
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Sep 9, 2014
  • Latest release: Apr 6, 2015
  • Number of updates: 40
  • Update frequency: every 18.4 days
  • Top authors: krish4mauro (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active / 4,398 total downloads

Benchmarks

Plugin footprint 48% 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.06MB] [CPU: ▼3.04ms] Passed 4 tests

A check of server-side resources used by Fare Calculator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1842.37 ▼3.19
Dashboard /wp-admin3.37 ▲0.0646.48 ▼0.43
Posts /wp-admin/edit.php3.42 ▲0.0647.38 ▲2.62
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.98 ▼11.14
Media Library /wp-admin/upload.php3.29 ▲0.0641.53 ▲3.67
Bookings /wp-admin/admin.php?page=fare-calculator/send.php3.2529.19
Settings /wp-admin/admin.php?page=fare-calculator/senddd.php3.2529.53
Fare Settings /wp-admin/admin.php?page=fare-calculator/farecalculator.php3.2531.97
ConfirmedBookings /wp-admin/admin.php?page=fare-calculator/sendd.php3.2530.86

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: 2 new tables, 6 new options
New tables
wp_taxibooked
wp_fare
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fare Calculator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9914.74 ▲0.362.22 ▲0.2243.40 ▼10.25
Dashboard /wp-admin2,243 ▲554.87 ▼0.2495.60 ▼6.2476.01 ▲29.30
Posts /wp-admin/edit.php2,126 ▲371.99 ▼0.0238.31 ▲2.2634.48 ▼2.46
Add New Post /wp-admin/post-new.php1,696 ▲17622.65 ▼0.46652.51 ▼36.6352.84 ▲1.89
Media Library /wp-admin/upload.php1,425 ▲374.10 ▼0.1391.75 ▼20.7087.73 ▲40.01
Bookings /wp-admin/admin.php?page=fare-calculator/send.php8422.0123.6029.36
Settings /wp-admin/admin.php?page=fare-calculator/senddd.php8132.0223.6824.12
Fare Settings /wp-admin/admin.php?page=fare-calculator/farecalculator.php9192.0224.4730.54
ConfirmedBookings /wp-admin/admin.php?page=fare-calculator/sendd.php8332.0124.8026.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/fare-calculator/farecalculator.php+79
    Undefined variable: table_name
  • Zombie tables detected upon uninstall: 1 table
    • wp_fare
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/fare-calculator/farecalculator.php on line 26
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/fare-calculator/farecalculator.php on line 26
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/fare-calculator/farecalculator.php on line 26

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #0, #0 in fare-calculator/assets to your readme.txt
  • Screenshots: Screenshot #1 (Here's a screenshot of it in action) image missing
You can look at the official readme.txt

fare-calculator/farecalculator.php 85% from 13 tests

"Fare Calculator" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 146 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fare-calculator.php" instead of "farecalculator.php")

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 plugin359 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP215433359

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.13
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.82MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/screenshot.png202.56KB82.37KB▼ 59.33%
images/fare.png3.90KB1.29KB▼ 67.00%
screenshot.png202.56KB82.37KB▼ 59.33%
images/preview.png213.47KB103.07KB▼ 51.72%
fare.png213.47KB103.07KB▼ 51.72%