67% cab-fare-calculator

Code Review | Cab fare calculator

WordPress plugin Cab fare calculator scored 67% from 54 tests.

About plugin

  • Plugin page: cab-fare-calculator
  • Plugin version: 1.1.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: May 27, 2020
  • Latest release: Aug 9, 2023
  • Number of updates: 23
  • Update frequency: every 51.1 days
  • Top authors: kanev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active / 6,314 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼6.82ms] Passed 4 tests

A check of server-side resources used by Cab fare calculator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3842.66 ▲3.31
Dashboard /wp-admin3.81 ▲0.5050.71 ▼4.89
Posts /wp-admin/edit.php3.82 ▲0.4749.63 ▼3.14
Add New Post /wp-admin/post-new.php6.38 ▲0.4985.63 ▼22.55
Media Library /wp-admin/upload.php3.60 ▲0.3842.88 ▲9.77
Settings /wp-admin/admin.php?page=configs3.5934.93
Payment Methods /wp-admin/admin.php?page=paymentmethods3.5934.82
Orders /wp-admin/admin.php?page=orders3.6633.41
Taxi Booking /wp-admin/admin.php?page=dashboard3.6134.76
Vehicles /wp-admin/admin.php?page=cars3.6036.59

Server storage [IO: ▲2.82MB] [DB: ▲0.03MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 190 new files
Database: 9 new tables, 9 new options
New tables
wp_tblight_orders
wp_tblight_order_car_rel
wp_tblight_countries
wp_tblight_payment_plg_cash
wp_tblight_configs
wp_tblight_payment_plg_paypal
wp_tblight_cars
wp_tblight_paymentmethods
wp_tblight_currencies
New WordPress options
tblight_installed_at
can_compress_scripts
theysaidso_admin_options
tblight_plugin_version
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
tblight_db_version

Browser metrics Passed 4 tests

Checking browser requirements for Cab fare calculator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,994 ▲25915.32 ▲0.761.82 ▼0.3542.48 ▲0.00
Dashboard /wp-admin2,400 ▲2126.93 ▲1.99138.10 ▲37.3643.74 ▼5.24
Posts /wp-admin/edit.php2,309 ▲2203.85 ▲1.8255.62 ▲14.6731.62 ▼4.91
Add New Post /wp-admin/post-new.php1,593 ▲6024.62 ▲1.58672.84 ▼18.7335.80 ▼18.05
Media Library /wp-admin/upload.php1,443 ▲554.70 ▲0.5486.61 ▼21.8347.11 ▼0.58
Settings /wp-admin/admin.php?page=configs1,1983.6154.7231.97
Payment Methods /wp-admin/admin.php?page=paymentmethods1,2353.6246.5825.05
Orders /wp-admin/admin.php?page=orders1,4693.7844.9627.27
Taxi Booking /wp-admin/admin.php?page=dashboard1,89211.0569.0441.97
Vehicles /wp-admin/admin.php?page=cars1,3453.5954.5426.84

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cars
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cab-fare-calculator/admin/views/paymentmethods/plugins/paypal.php
    • > /wp-content/plugins/cab-fare-calculator/admin/views/paymentmethods/plugins/stripe.php
  • 80× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/cab-fare-calculator/admin/views/dashboard.php:1
    • > PHP Warning
      Use of undefined constant TBLIGHT_PLUGIN_PATH - assumed 'TBLIGHT_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cab-fare-calculator/admin/views/orders/edit.php on line 2
    • > PHP Warning
      require_once(TBLIGHT_PLUGIN_PATHadmin/models/paymentmethod.php): failed to open stream: No such file or directory in wp-content/plugins/cab-fare-calculator/admin/controllers/paymentmethod.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/cab-fare-calculator/admin/views/configs/edit_terms.php:1
    • > PHP Warning
      Use of undefined constant TBLIGHT_PLUGIN_PATH - assumed 'TBLIGHT_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cab-fare-calculator/Shortcode.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/cab-fare-calculator/Admin.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'BookingHelper' not found in wp-content/plugins/cab-fare-calculator/admin/views/cars/details.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'TBLIGHT_PLUGIN_PATHclasses/company.helper.php' (include_path='.:/usr/share/php') in wp-content/plugins/cab-fare-calculator/admin/views/orders/edit.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/cab-fare-calculator/admin/views/configs/edit_general.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_time() in wp-content/plugins/cab-fare-calculator/views/tblight/default_step1.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=dashboard
    • > Javascript (severe) in unknown
    /wp-content/plugins/cab-fare-calculator/admin/js/lord-icon.js?ver=1691415088 1:262319 Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegist…rd-icon" has already been used with this registry

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: shuttle booking, taxi booking, limo booking form, airport transfers, transfers booking...

cab-fare-calculator/tblight.php 92% from 13 tests

The main file in "Cab fare calculator" v. 1.1.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cab-fare-calculator.php" instead of "tblight.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
Good job! No executable or dangerous file extensions detected17,188 lines of code in 114 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,2867287,461
CSS121,086354,484
JavaScript233782413,895
SVG100655
SQL1200599
PO File1313477
HTML1109
JSON6006
Markdown1002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity24.62
▷ Minimum class complexity4.00
▷ Maximum class complexity143.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods191
▷ Static methods5830.37%
▷ Public methods18094.24%
▷ Protected methods105.24%
▷ Private methods10.52%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants981.82%
▷ Class constants218.18%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
32 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
admin/images/disabled.png0.18KB0.21KB0.00%
admin/images/drivenot-logo.png5.09KB2.58KB▼ 49.19%
admin/css/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
admin/images/publish_x.png0.41KB0.53KB0.00%