56% local-delivery-drivers-for-woocommerce

Code Review | Local Delivery Drivers for WooCommerce

WordPress plugin Local Delivery Drivers for WooCommerce scored56%from 54 tests.

About plugin

  • Plugin page: local-delivery-dr...
  • Plugin version: 1.9.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 10, 2020
  • Latest release: Jul 7, 2023
  • Number of updates: 85
  • Update frequency: every 11.8 days
  • Top authors: powerfulwp (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

900+ active /39,353 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲5.66MB] [CPU: ▲27.61ms] 75% from 4 tests

A check of server-side resources used by Local Delivery Drivers for WooCommerce
Please fix the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.66MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.25 ▲5.7982.17 ▲38.15
Dashboard /wp-admin9.27 ▲5.9776.49 ▲22.04
Posts /wp-admin/edit.php9.28 ▲5.9290.69 ▲38.92
Add New Post /wp-admin/post-new.php10.86 ▲4.97112.29 ▲11.34
Media Library /wp-admin/upload.php9.27 ▲6.0585.26 ▲47.30
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2774.31

Server storage [IO: ▲5.38MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 232 new files
Database: 1 new table, 30 new options
New tables
wp_lddfw_orders
New WordPress options
fs_debug_mode
theysaidso_admin_options
db_upgraded
lddfw_delivery_drivers_page
lddfw_whatsapp_start_delivery_template
lddfw_sms_start_delivery_template
lddfw_delivery_dropoff_1
lddfw_driver_assigned_status
widget_theysaidso_widget
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by Local Delivery Drivers for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲7814.36 ▲0.011.83 ▼0.0227.61 ▼17.37
Dashboard /wp-admin2,245 ▲685.61 ▼0.0599.31 ▲4.8447.92 ▲6.59
Posts /wp-admin/edit.php2,150 ▲502.16 ▲0.1742.77 ▲4.5539.29 ▲1.16
Add New Post /wp-admin/post-new.php1,556 ▲2822.94 ▼0.25681.40 ▲30.7854.85 ▲7.47
Media Library /wp-admin/upload.php1,450 ▲534.40 ▲0.15117.49 ▲12.4753.92 ▲7.16
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1041.7031.3231.91

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/local-delivery-drivers-for-woocommerce/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_lddfw_orders
  • This plugin does not fully uninstall, leaving 30 options in the database
    • lddfw_sms_start_delivery_template
    • lddfw_whatsapp_assign_to_driver_template
    • lddfw_out_for_delivery_status
    • lddfw_sms_out_for_delivery_template
    • lddfw_whatsapp_start_delivery_template
    • fs_accounts
    • lddfw_delivery_dropoff_3
    • fs_debug_mode
    • lddfw_delivered_status
    • can_compress_scripts
    • ...

Smoke tests 50% 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 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/local-delivery-drivers-for-woocommerce/public/partials/lddfw-public-display.php
    • > /wp-content/plugins/local-delivery-drivers-for-woocommerce/admin/partials/lddfw-admin-display.php
  • 1× 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/local-delivery-drivers-for-woocommerce/includes/lddfw-metaboxes.php:35

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)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes: The official readme.txt might help

local-delivery-drivers-for-woocommerce/local-delivery-drivers-for-woocommerce.php 77% from 13 tests

The main PHP file in "Local Delivery Drivers for WooCommerce" ver. 1.9.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.5" instead of "3.0")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 176 characters long)

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected65,050 lines of code in 173 files:
LanguageFilesBlank linesComment linesLines of code
PHP1408,60819,36038,866
CSS181,7136212,847
PO File85,1446,32412,117
JavaScript7216761,220

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity78.33
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes63
▷ Abstract classes23.17%
▷ Concrete classes6196.83%
▷ Final classes00.00%
Methods1,426
▷ Static methods20514.38%
▷ Public methods1,02571.88%
▷ Protected methods171.19%
▷ Private methods38426.93%
Functions144
▷ Named functions14298.61%
▷ Anonymous functions21.39%
Constants151
▷ Global constants10468.87%
▷ Class constants4731.13%
▷ Public constants47100.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
7 PNG files occupy 0.37MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) public/images/user.png1.49KB0.00KB▼ 100.00%
public/images/drivers_app.png8.22KB2.99KB▼ 63.68%
public/images/lddfw.png21.41KB19.43KB▼ 9.23%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%