58% fast-courier-shipping-freight

Code Review | Fast Courier - Shipping & Freight

WordPress plugin Fast Courier - Shipping & Freight scored58%from 54 tests.

About plugin

  • Plugin page: fast-courier-ship...
  • Plugin version: 3.1.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 8, 2022
  • Latest release: Nov 29, 2023
  • Number of updates: 60
  • Update frequency: every 9.0 days
  • Top authors: fastcourieraustralia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,254 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Fast Courier - Shipping & Freight
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6527.96 ▼11.82
Dashboard /wp-admin4.05 ▲0.7450.89 ▲1.68
Posts /wp-admin/edit.php4.10 ▲0.7454.18 ▲1.96
Add New Post /wp-admin/post-new.php6.59 ▲0.7099.64 ▲15.36
Media Library /wp-admin/upload.php3.97 ▲0.7439.59 ▲5.34

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 306 new files
Database: 3 new tables, 6 new options
New tables
wp_product_fc_packages
wp_fc_cron_logs
wp_fc_packages
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fast Courier - Shipping & Freight
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,488 ▼27414.37 ▼0.340.59 ▼0.9917.00 ▼22.11
Dashboard /wp-admin2,214 ▲374.96 ▼0.69100.09 ▼2.0987.79 ▲39.10
Posts /wp-admin/edit.php2,134 ▲342.57 ▲0.6040.57 ▼0.1630.82 ▼9.41
Add New Post /wp-admin/post-new.php1,712 ▲18622.94 ▲0.08612.35 ▲24.3949.01 ▼2.58
Media Library /wp-admin/upload.php1,498 ▲954.65 ▲0.45104.20 ▲2.5866.71 ▲23.58

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
These items require your attention
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_product_fc_packages
    • wp_fc_cron_logs
    • wp_fc_packages
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means 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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/fast-courier-shipping-freight/views/views/common/loader.php
    • > /wp-content/plugins/fast-courier-shipping-freight/views/views/location-add.php
  • 102× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FastCourier\\FastCourierLocation' not found in wp-content/plugins/fast-courier-shipping-freight/views/views/merchant.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fast-courier-shipping-freight/functions.php:79
    • > PHP Fatal error
      Uncaught Error: Class 'DVDoug\\BoxPacker\\Test\\TestItem' not found in wp-content/plugins/fast-courier-shipping-freight/vendor/dvdoug/boxpacker/tests/Test/ConstrainedPlacementByCountTestItem.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function fc_format_order_filters() in wp-content/plugins/fast-courier-shipping-freight/views/views/unprocessed-orders.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fast-courier-shipping-freight/vendor/dvdoug/boxpacker/tests/OrientatedItemTest.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function fc_format_order_filters() in wp-content/plugins/fast-courier-shipping-freight/views/views/fallback-orders.php:4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/fast-courier-shipping-freight/views/views/single-order.php on line 7
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/fast-courier-shipping-freight/views/woocommerce/order/order-details.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'DVDoug\\BoxPacker\\Test\\TestItem' not found in wp-content/plugins/fast-courier-shipping-freight/vendor/dvdoug/boxpacker/tests/Test/ConstrainedTestItem.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/fast-courier-shipping-freight/configs.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid url: "#"
The official readme.txt might help

fast-courier-shipping-freight/settings.php 85% from 13 tests

"Fast Courier - Shipping & Freight" version 3.1.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 271 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fast-courier-shipping-freight.php" instead of "settings.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .ps1 - Windows PowerShell Cmdlet in Windows
      • wp-content/plugins/fast-courier-shipping-freight/vendor/dvdoug/boxpacker/docs/build.ps1
45,670 lines of code in 247 files:
LanguageFilesBlank linesComment linesLines of code
CSS245,96513915,328
JavaScript743,5501,15214,746
PHP1182,3732,85413,852
Markdown41590609
YAML5483243
HTML1310234
JSON400212
reStructuredText9151287201
Cucumber3220165
Python1399240
XML15126
make14610
Dockerfile1102
PowerShell1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.15
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces7
Interfaces7
Traits2
Classes66
▷ Abstract classes23.03%
▷ Concrete classes6496.97%
▷ Final classes00.00%
Methods475
▷ Static methods10922.95%
▷ Public methods44493.47%
▷ Protected methods71.47%
▷ Private methods245.05%
Functions67
▷ Named functions4770.15%
▷ Anonymous functions2029.85%
Constants17
▷ Global constants423.53%
▷ Class constants1376.47%
▷ Public constants13100.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
12 PNG files occupy 0.32MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
views/images/favicon-16x16.png0.63KB0.71KB0.00%
views/images/fast-courier-login-page.png29.31KB11.45KB▼ 60.93%
views/images/icon-master.png1.98KB1.77KB▼ 10.36%
views/images/fast-courier-configuration.png46.76KB14.82KB▼ 68.31%
views/images/fast-courier-dark.png4.67KB4.07KB▼ 12.76%