78% food-online-for-woocommerce

Code Review | Food Online for WooCommerce

WordPress plugin Food Online for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: food-online-for-w...
  • Plugin version: 5.4.6.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 29, 2018
  • Latest release: Jun 15, 2023
  • Number of updates: 195
  • Update frequency: every 9.3 days
  • Top authors: arosoft (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

700+ active /58,488 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.01MB] [CPU: ▼4.65ms] 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 /3.47 ▲0.0140.19 ▼0.30
Dashboard /wp-admin3.31 ▲0.0148.41 ▼0.32
Posts /wp-admin/edit.php3.36 ▲0.0145.46 ▼0.61
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.48 ▼17.37
Media Library /wp-admin/upload.php3.23 ▲0.0034.94 ▲2.12

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 86 new files
Database: no new tables, 15 new options
New WordPress options
widget_theysaidso_widget
fdoe_left_menu
widget_recent-comments
fdoe_item_icon
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
fdoe_override_shop
fdoe_hide_minicart
fdoe_layout
...

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 /2,789 ▲2814.35 ▼0.071.66 ▼0.0044.19 ▲7.86
Dashboard /wp-admin2,198 ▲175.59 ▼0.0894.46 ▼4.3942.06 ▲1.03
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0235.58 ▼0.7029.41 ▼5.92
Add New Post /wp-admin/post-new.php1,526 ▲8123.28 ▲6.74674.72 ▲217.5855.37 ▲4.95
Media Library /wp-admin/upload.php1,400 ▲64.22 ▲0.04104.88 ▲9.4046.44 ▲3.13

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 15 options in the database
    • widget_theysaidso_widget
    • fdoe_layout
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • fdoe_override_shop
    • fdoe_hide_minicart
    • fdoe_menu_titles_icon
    • fdoe_is_prem
    • fdoe_item_icon
    • ...

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/search.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/product.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/top_menu.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/product-modal-fallback.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/product-modal.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/categories.php
    • > /wp-content/plugins/food-online-for-woocommerce/templates/side_menu.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 96% 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: online, order, woocommerce, restaurant, menu...

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

The primary PHP file in "Food Online for WooCommerce" version 5.4.6.1 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")

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 plugin34,575 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
CSS255947216,424
PHP311,6762897,166
SVG3005,603
JavaScript123102655,382

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.52
Average class complexity94.60
▷ Minimum class complexity1.00
▷ Maximum class complexity313.00
Average method complexity6.48
▷ Minimum method complexity1.00
▷ Maximum method complexity131.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods155
▷ Static methods5535.48%
▷ Public methods15096.77%
▷ Protected methods31.94%
▷ Private methods21.29%
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