78% delivery-woo

Code Review | Delivery for WooCommerce

WordPress plugin Delivery for WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: delivery-woo
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 5.9.2
  • First release: Nov 22, 2020
  • Latest release: Jan 24, 2021
  • Number of updates: 12
  • Update frequency: every 5.4 days
  • Top authors: popeating (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 406 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼295.23ms] Passed 4 tests

Server-side resources used by Delivery for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0152.29 ▲3.77
Dashboard /wp-admin3.42 ▲0.0133.30 ▲0.63
Posts /wp-admin/edit.php3.65 ▲0.0136.93 ▲0.69
Add New Post /wp-admin/post-new.php6.89 ▼0.0989.81 ▼1,181.52
Media Library /wp-admin/upload.php3.30 ▲0.0025.05 ▼0.72

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 200 new files
Database: no new tables, 4 new options
New WordPress options
fs_active_plugins
fs_debug_mode
fs_gdpr
fs_accounts

Browser metrics Passed 4 tests

A check of browser resources used by Delivery for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,781 ▲2715.66 ▼0.016.66 ▼0.152.68 ▲0.03
Dashboard /wp-admin2,881 ▲266.13 ▼0.05118.43 ▼18.75157.81 ▼6.14
Posts /wp-admin/edit.php2,694 ▲63.36 ▲0.0066.14 ▲0.29143.03 ▼3.82
Add New Post /wp-admin/post-new.php1,773 ▲6321.00 ▲0.35443.12 ▼14.07159.59 ▲1.50
Media Library /wp-admin/upload.php1,698 ▼05.53 ▼0.00158.44 ▲20.37190.81 ▲1.32

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
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • fs_active_plugins
    • fs_gdpr
    • fs_debug_mode
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/delivery-woo/freemius/templates/ajax-loader.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/delivery-woo/admin/display_free.php:3
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/delivery-woo/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/delivery-woo/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/delivery-woo/admin/requirements-error.php:1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/delivery-woo/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/delivery-woo/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/delivery-woo/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/delivery-woo/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/delivery-woo/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/delivery-woo/admin/display.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: delivery, timeslots, local delivery, woocommerce, date and time for delivery

delivery-woo/delivery.php 92% from 13 tests

This is the main PHP file of "Delivery for WooCommerce" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("delivery-woo.php" instead of "delivery.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected34,090 lines of code in 148 files:
LanguageFilesBlank linesComment linesLines of code
PHP1267,39516,24431,522
PO File2687831,972
JavaScript66671513
CSS144583

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,895)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity70.97
▷ Minimum class complexity1.00
▷ Maximum class complexity2,895.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes23.57%
Methods1,171
▷ Static methods19716.82%
▷ Public methods82770.62%
▷ Protected methods151.28%
▷ Private methods32928.10%
Functions95
▷ Named functions9498.95%
▷ Anonymous functions11.05%
Constants132
▷ Global constants10378.03%
▷ Class constants2921.97%
▷ Public constants29100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/woo-delivery-pop.png9.16KB5.26KB▼ 42.58%
public/assets/css/images/ui-icons_555555_256x240.png6.91KB4.18KB▼ 39.47%
public/assets/css/images/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
freemius/assets/img/woo-delivery.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%