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

Code Review | Advanced Online Ordering and Delivery Platform

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

About plugin

  • Plugin page: advanced-online-o...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.1
  • WordPress version: 6.3.1
  • First release: May 6, 2021
  • Latest release: Feb 12, 2023
  • Number of updates: 48
  • Update frequency: every 13.5 days
  • Top authors: wdesco (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,263 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/advanced-online-ordering-and-delivery-platform/includes/client/class-bnd-flex-order-delivery-clover-client.php+118
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence

Server metrics [RAM: ▼1.38MB] [CPU: ▼47.90ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Online Ordering and Delivery Platform
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.61 ▼0.859.79 ▼31.36
Dashboard /wp-admin2.63 ▼0.679.82 ▼40.70
Posts /wp-admin/edit.php2.63 ▼0.738.79 ▼40.29
Add New Post /wp-admin/post-new.php2.63 ▼3.268.99 ▼79.24
Media Library /wp-admin/upload.php2.63 ▼0.607.46 ▼24.87

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 448 new files
Database: 31 new tables, 8 new options
New tables
wp_bnd_customer_profile
wp_bnd_tax_rate
wp_bnd_item
wp_bnd_item_category
wp_bnd_order_line_item
wp_bnd_category
wp_bnd_tag_item
wp_bnd_sequence
wp_bnd_tag
wp_bnd_attribute
...
New WordPress options
bnd_settings
can_compress_scripts
bnd_use_php_sessions
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Online Ordering and Delivery Platform
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,191 ▲43019.91 ▲5.7523.35 ▲21.3142.56 ▲1.08
Dashboard /wp-admin2,421 ▲2447.74 ▲2.06154.98 ▲69.18108.18 ▲69.67
Posts /wp-admin/edit.php2,354 ▲2515.37 ▲3.4171.41 ▲35.1072.00 ▲29.46
Add New Post /wp-admin/post-new.php1,619 ▲9319.61 ▼3.59678.81 ▼48.13189.44 ▲130.44
Media Library /wp-admin/upload.php1,488 ▲886.46 ▲2.32104.75 ▼2.3789.60 ▲46.14

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
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/advanced-online-ordering-and-delivery-platform/includes/client/class-bnd-flex-order-delivery-clover-client.php+118
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • bnd_use_php_sessions
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 26× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/faq.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/templates/flexmenu/edit_modifier.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/paging.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/training.php
    • > /wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/login/admin-login-license.php
    • > /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/admin/templates/order-type/read.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/discount-coupon/create.php
  • 237× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > 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/category/read-paging.php on line 113
    • > 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/discount-coupon/read-paging.php on line 104
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/read-categories.php on line 63
    • > PHP Notice
      Undefined variable: response in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/order-payment/read-paging.php on line 65
    • > PHP Notice
      Undefined variable: keywords in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/paging.php on line 11
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/modifier-group/read-paging.php on line 79
    • > 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/discount-coupon/read-paging.php on line 104
    • > PHP Fatal error
      Uncaught Error: Class 'Bnd_Flex_Order_Delivery_API_Base' not found in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/api/class-bnd-flex-order-delivery-api-discount-coupon.php:12
    • > PHP Notice
      Undefined variable: response in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/modifier-group/read-modal.php on line 34
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-online-ordering-and-delivery-platform/admin/templates/category/read-modal.php on line 35

User-side errors Passed 1 test

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

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: comments, spam

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

The primary PHP file in "Advanced Online Ordering and Delivery Platform" version 2.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same 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 review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin85,496 lines of code in 335 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1624,9645,38634,246
CSS273,87880719,351
PHP1321,4343,74216,772
SVG811214,686
Sass2275262
LESS1115152
Markdown211019
Ruby1208

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity13.55
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes58
▷ Abstract classes00.00%
▷ Concrete classes58100.00%
▷ Final classes11.72%
Methods483
▷ Static methods173.52%
▷ Public methods45594.20%
▷ Protected methods71.45%
▷ Private methods214.35%
Functions66
▷ Named functions6598.48%
▷ Anonymous functions11.52%
Constants10
▷ Global constants660.00%
▷ Class constants440.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
35 PNG files occupy 0.40MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/flexmenu/img/p6.png1.82KB0.08KB▼ 95.49%
admin/templates/car1.png1.10KB1.05KB▼ 4.09%
templates/flexmenu/img/fav.png0.86KB0.82KB▼ 5.44%
templates/flexmenu/img/halal.png3.53KB2.29KB▼ 35.12%
admin/assets/img/launcher.png0.86KB0.82KB▼ 5.44%