78% food-online-for-woocommerce

Code Review | Food Online for WooCommerce

WordPress plugin Food Online for WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: food-online-for-w...
  • Plugin version: 5.2.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 5.8.1
  • First release: Jun 29, 2018
  • Latest release: Nov 1, 2021
  • Number of updates: 173
  • Update frequency: every 7.1 days
  • Top authors: arosoft (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

1,000+ active / 44,391 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼140.15ms] Passed 4 tests

Server-side resources used by Food Online for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0035.30 ▲6.20
Dashboard /wp-admin3.06 ▲0.0043.34 ▼1.98
Posts /wp-admin/edit.php3.11 ▲0.0041.72 ▼3.26
Add New Post /wp-admin/post-new.php5.42 ▼0.0287.87 ▼555.56
Media Library /wp-admin/upload.php3.00 ▲0.0034.05 ▲0.21

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 81 new files
Database: no new tables, 9 new options
New WordPress options
fdoe_item_icon
fdoe_override_shop
fdoe_menu_titles_icon
fdoe_hide_minicart
fdoe_layout
fdoe_is_prem
fdoe_color
fdoe_show_images
fdoe_left_menu

Browser metrics Passed 4 tests

An overview of browser requirements for Food Online for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,712 ▲11615.81 ▲0.338.48 ▲0.2145.21 ▼1.44
Dashboard /wp-admin2,970 ▲365.86 ▼0.07133.78 ▼17.36102.07 ▼15.57
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0065.30 ▲2.8099.84 ▲17.53
Add New Post /wp-admin/post-new.php1,500 ▼17218.57 ▼0.65357.66 ▼4.24112.04 ▼2.53
Media Library /wp-admin/upload.php1,810 ▲35.01 ▼0.01157.87 ▲1.58124.30 ▲2.01

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • fdoe_color
    • fdoe_left_menu
    • fdoe_menu_titles_icon
    • fdoe_hide_minicart
    • fdoe_is_prem
    • fdoe_item_icon
    • fdoe_show_images
    • fdoe_layout
    • fdoe_override_shop

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/food-online-for-woocommerce/templates/product-modal-fallback.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/top_menu.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/side_menu.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/product.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/categories.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/search.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/product-modal.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Food_Online' not found in wp-content/plugins/food-online-for-woocommerce/templates/woocommerce/content-product.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/food-online-for-woocommerce/fdoe-order.php:29

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

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: menu, food, order, take away, online...

food-online-for-woocommerce/fdoe-order.php 85% from 13 tests

The primary PHP file in "Food Online for WooCommerce" version 5.2.0.3 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("food-online-for-woocommerce.php" instead of "fdoe-order.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "4.0")

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
There were no executable files found in this plugin25,657 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
CSS236001448,762
PHP301,7402896,289
SVG3005,603
JavaScript103002525,003

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 131)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity82.80
▷ Minimum class complexity1.00
▷ Maximum class complexity278.00
Average method complexity6.10
▷ Minimum method complexity1.00
▷ Maximum method complexity131.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods149
▷ Static methods5335.57%
▷ Public methods14496.64%
▷ Protected methods32.01%
▷ Private methods21.34%
Functions15
▷ Named functions960.00%
▷ Anonymous functions640.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected