77% foodbook-light-online-food-ordering-system

Code Review | FoodBook Lite - Online Food Ordering System

WordPress plugin FoodBook Lite - Online Food Ordering System scored77%from 54 tests.

About plugin

  • Plugin page: foodbook-light-on...
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 2, 2020
  • Latest release: Sep 11, 2023
  • Number of updates: 18
  • Update frequency: every 63.2 days
  • Top authors: themelooks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,153 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼10.96ms] Passed 4 tests

A check of server-side resources used by FoodBook Lite - Online Food Ordering System
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0239.84 ▼0.73
Dashboard /wp-admin3.33 ▼0.0245.28 ▼14.97
Posts /wp-admin/edit.php3.38 ▲0.0248.79 ▲0.42
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.66 ▼28.55
Media Library /wp-admin/upload.php3.25 ▲0.0233.32 ▲1.65

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 175 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
foodbooklite_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by FoodBook Lite - Online Food Ordering System
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲7113.28 ▼1.391.97 ▼0.1442.87 ▲1.00
Dashboard /wp-admin2,217 ▲295.83 ▼0.05106.21 ▲4.3939.85 ▼3.85
Posts /wp-admin/edit.php2,106 ▲202.05 ▼0.0239.86 ▲0.5938.35 ▲1.39
Add New Post /wp-admin/post-new.php1,545 ▲323.25 ▲4.83674.31 ▲61.9753.87 ▲1.07
Media Library /wp-admin/upload.php1,399 ▲174.21 ▼0.1394.37 ▼1.4940.35 ▼1.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/foodbook-light-online-food-ordering-system/view/template-modal-alert.php
    • > /wp-content/plugins/foodbook-light-online-food-ordering-system/view/template-modal-checkout-hold.php
  • 27× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FoodBookLite\\add_action() in wp-content/plugins/foodbook-light-online-food-ordering-system/admin/admin.php:20
    • > PHP Warning
      require_once(FOODBOOKLITE_DIR_INChelper-functions.php): failed to open stream: No such file or directory in wp-content/plugins/foodbook-light-online-food-ordering-system/foodbook-init.php on line 14
    • > PHP Warning
      Use of undefined constant FOODBOOKLITE_DIR_INC - assumed 'FOODBOOKLITE_DIR_INC' (this will throw an Error in a future version of PHP) in wp-content/plugins/foodbook-light-online-food-ordering-system/foodbooklite-init.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'FOODBOOKLITE_DIR_INChelper-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/foodbook-light-online-food-ordering-system/foodbook-init.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/foodbook-light-online-food-ordering-system/view/template-modal-billing-summary.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FoodBookLite\\add_action() in wp-content/plugins/foodbook-light-online-food-ordering-system/admin/inc/class-admin-menu.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/foodbook-light-online-food-ordering-system/view/template-modal-steps.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FoodBookLite\\add_shortcode() in wp-content/plugins/foodbook-light-online-food-ordering-system/inc/class-hooks.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FoodBookLite\\add_action() in wp-content/plugins/foodbook-light-online-food-ordering-system/inc/class-products.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FoodBookLite\\add_action() in wp-content/plugins/foodbook-light-online-food-ordering-system/inc/class-woo-hooks.php:18

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 79% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

foodbook-light-online-food-ordering-system/foodbook-lite.php 77% from 13 tests

"FoodBook Lite - Online Food Ordering System" version 1.4.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("foodbook-light-online-food-ordering-system.php" instead of "foodbook-lite.php")
  • Description: The description should be shorter than 140 characters (currently 288 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected33,369 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
SVG1901212,054
JavaScript73,0247,2608,568
CSS96341745,297
PHP361,3728545,165
Sass30176272,285

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity21.36
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes17.14%
Methods121
▷ Static methods4940.50%
▷ Public methods11695.87%
▷ Protected methods00.00%
▷ Private methods54.13%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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
24 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon/cart.png1.29KB1.29KB0.00%
assets/img/smile.png1.99KB1.99KB0.05%
assets/img/mapmarkar@2x.png0.34KB0.34KB0.00%
assets/img/pngfuel.com.png1.19KB1.19KB0.33%
assets/img/card.png2.75KB2.73KB▼ 0.64%