78% delivery-drivers-for-vendors

Code Review | Delivery Drivers for Vendors

WordPress plugin Delivery Drivers for Vendors scored 78% from 54 tests.

About plugin

  • Plugin page: delivery-drivers-...
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8
  • WordPress version: 5.8.1
  • First release: Jun 25, 2021
  • Latest release: Aug 25, 2021
  • Number of updates: 10
  • Update frequency: every 6.9 days
  • Top authors: powerfulwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 559 total downloads

Benchmarks

Plugin footprint 83% 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.07MB] [CPU: ▼139.10ms] Passed 4 tests

This is a short check of server-side resources used by Delivery Drivers for Vendors
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.0840.85 ▲2.62
Dashboard /wp-admin3.13 ▲0.0851.16 ▲1.58
Posts /wp-admin/edit.php3.19 ▲0.0850.80 ▲0.45
Add New Post /wp-admin/post-new.php5.49 ▲0.06100.59 ▼556.81
Media Library /wp-admin/upload.php3.08 ▲0.0737.33 ▼1.60

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 203 new files
Database: no new tables, 1 new option
New WordPress options
ddfwm_vendors_page

Browser metrics Passed 4 tests

This is an overview of browser requirements for Delivery Drivers for Vendors
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.98 ▲0.3112.45 ▼2.5751.93 ▼2.42
Dashboard /wp-admin2,989 ▲585.95 ▼0.01160.44 ▼21.26112.91 ▼2.97
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0272.30 ▼4.0096.56 ▲4.94
Add New Post /wp-admin/post-new.php1,615 ▼6821.28 ▲4.94321.42 ▼132.46113.41 ▼7.39
Media Library /wp-admin/upload.php1,807 ▲595.03 ▲0.03186.18 ▲13.77124.72 ▼8.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 1 option
    • ddfwm_vendors_page

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/delivery-drivers-for-vendors/admin/partials/ddfwm-admin-display.php
    • > /wp-content/plugins/delivery-drivers-for-vendors/public/partials/ddfwm-public-display.php
    • > /wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/ajax-loader.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/delivery-drivers-for-vendors/freemius/templates/account/partials/addon.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
These attributes need to be fixed: You can look at the official readme.txt

delivery-drivers-for-vendors/delivery-drivers-for-vendors.php 92% from 13 tests

The principal PHP file in "Delivery Drivers for Vendors" v. 1.0.7 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected49,272 lines of code in 153 files:
LanguageFilesBlank linesComment linesLines of code
PHP1297,74117,67434,905
CSS161,5145812,082
JavaScript8161802,285

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity75.28
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods1,242
▷ Static methods17914.41%
▷ Public methods89672.14%
▷ Protected methods151.21%
▷ Private methods33126.65%
Functions114
▷ Named functions114100.00%
▷ Anonymous functions00.00%
Constants127
▷ Global constants10280.31%
▷ Class constants2519.69%
▷ Public constants25100.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
7 PNG files occupy 0.40MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/routes-preview.png321.40KB325.87KB0.00%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
public/images/favicon-32x32.png3.25KB1.58KB▼ 51.32%
public/images/drivers_app.png8.22KB2.99KB▼ 63.68%