68% advanced-online-ordering-and-delivery-platform

Code Review | Advanced Online Ordering and Delivery Platform

WordPress plugin Advanced Online Ordering and Delivery Platform scored 68% from 54 tests.

About plugin

  • Plugin page: advanced-online-o...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 5.9.2
  • First release: May 6, 2021
  • Latest release: Mar 5, 2022
  • Number of updates: 34
  • Update frequency: every 8.9 days
  • Top authors: wdesco (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 396 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: ▲1.60MB] [CPU: ▼280.54ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Online Ordering and Delivery Platform
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.18 ▲1.6768.57 ▲18.94
Dashboard /wp-admin5.00 ▲1.5945.12 ▲13.04
Posts /wp-admin/edit.php5.22 ▲1.5851.11 ▲12.10
Add New Post /wp-admin/post-new.php8.97 ▲2.00113.78 ▼1,157.03
Media Library /wp-admin/upload.php4.85 ▲1.5634.02 ▲9.73

Server storage [IO: ▲12.95MB] [DB: ▲0.05MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 434 new files
Database: 31 new tables, 2 new options
New tables
wp_bnd_attribute
wp_bnd_item_group
wp_bnd_notification
wp_bnd_tag
wp_bnd_discount_coupon
wp_bnd_modifier_group_item
wp_bnd_category
wp_bnd_modifier
wp_bnd_data_sync
wp_bnd_item
...
New WordPress options
bnd_settings
bnd_use_php_sessions

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Online Ordering and Delivery Platform
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,363 ▲62023.32 ▲7.3522.66 ▲16.163.41 ▲1.21
Dashboard /wp-admin3,197 ▲3439.90 ▲3.69191.24 ▲57.78111.24 ▼51.35
Posts /wp-admin/edit.php3,034 ▲3466.96 ▲3.72110.07 ▲47.04106.53 ▼37.48
Add New Post /wp-admin/post-new.php1,712 ▲5117.38 ▲0.41378.10 ▼56.51137.87 ▼10.96
Media Library /wp-admin/upload.php1,816 ▲1188.01 ▲2.49136.14 ▼6.80170.50 ▼12.38

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/advanced-online-ordering-and-delivery-platform/uninstall.php+112
    Trying to get property 'ID' of non-object
  • This plugin does not fully uninstall, leaving 1 option in the database
    • bnd_use_php_sessions

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 24× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/discount-coupon/read-paging.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/templates/flexmenu/add_to_order.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/category/read-paging.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/order-payment/read-paging.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/option/read-paging.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/item/read-paging.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/order-type/read.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/modifier-group/read-modal.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/modal.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/message-template/read-paging.php
  • 235× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/read-categories.php on line 112
    • > PHP Notice
      Undefined variable: response in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/read-categories.php on line 63
    • > PHP Warning
      Use of undefined constant BUYNOWDEPOT_PLUGIN_DIR - assumed 'BUYNOWDEPOT_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/category/read-paging.php on line 114
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/category/read-modal.php on line 35
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/modifier-group/read-paging.php on line 79
    • > PHP Warning
      include_once(): Failed opening 'BUYNOWDEPOT_PLUGIN_DIR/admin/templates/paging.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/category/read-paging.php on line 114
    • > PHP Warning
      include_once(BUYNOWDEPOT_PLUGIN_DIR/admin/templates/paging.php): failed to open stream: No such file or directory in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/order/read-paging.php on line 100
    • > PHP Fatal error
      Uncaught Error: Call to undefined function buynowdepot_get_theme_url() in wp-content/plugins/advanced-online-ordering-and-delivery-platform/templates/flexmenu/forgot_password.php:11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-online-ordering-and-delivery-platform/templates/flexmenu/cart_section.php on line 55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function buynowdepot_get_theme_url() in wp-content/plugins/advanced-online-ordering-and-delivery-platform/templates/flexmenu/coming_soon.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: spam, comments

advanced-online-ordering-and-delivery-platform/bnd-flex-order-delivery.php 85% from 13 tests

The entry point to "Advanced Online Ordering and Delivery Platform" version 1.0.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-online-ordering-and-delivery-platform.php" instead of "bnd-flex-order-delivery.php")

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin83,078 lines of code in 322 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1594,9115,33833,627
CSS273,87580719,341
PHP1221,2263,11914,983
SVG811214,686
Sass2275262
LESS1115152
Markdown211019
Ruby1208

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity17.57
▷ Minimum class complexity1.00
▷ Maximum class complexity169.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes12.86%
Methods403
▷ Static methods153.72%
▷ Public methods38595.53%
▷ Protected methods00.00%
▷ Private methods184.47%
Functions65
▷ Named functions6498.46%
▷ Anonymous functions11.54%
Constants9
▷ Global constants666.67%
▷ Class constants333.33%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
35 PNG files occupy 0.40MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/flexmenu/img/no-image.png20.37KB7.14KB▼ 64.97%
admin/assets/img/connection.png24.74KB10.14KB▼ 59.00%
templates/flexmenu/img/payment-methods.png61.86KB26.92KB▼ 56.48%
admin/assets/img/discount.png17.92KB7.57KB▼ 57.77%
templates/flexmenu/img/reviewer2.png1.84KB0.08KB▼ 95.53%