77% restrofood-lite

Code Review | Restrofood Lite - Online Food Ordering System

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

About plugin

  • Plugin page: restrofood-lite
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.2-6.3
  • WordPress version: 6.3.1
  • First release: Jun 11, 2022
  • Latest release: Aug 13, 2023
  • Number of updates: 7
  • Update frequency: every 61.3 days
  • Top authors: themelooks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /864 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.67ms] Passed 4 tests

An overview of server-side resources used by Restrofood Lite - Online Food Ordering System
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.84 ▼1.96
Dashboard /wp-admin3.33 ▲0.0249.18 ▼8.15
Posts /wp-admin/edit.php3.38 ▲0.0252.03 ▼0.09
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.12 ▼12.49
Media Library /wp-admin/upload.php3.25 ▲0.0238.85 ▲2.17

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 181 new files
Database: no new tables, 7 new options
New WordPress options
restrofoodlite_options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Restrofood Lite - Online Food Ordering System: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.74 ▼0.554.05 ▲1.9639.82 ▼3.68
Dashboard /wp-admin2,220 ▲295.91 ▲1.00108.48 ▲2.3342.46 ▲0.13
Posts /wp-admin/edit.php2,106 ▲172.02 ▼0.0340.46 ▲3.4636.12 ▲1.61
Add New Post /wp-admin/post-new.php1,545 ▲323.00 ▲4.74624.07 ▼62.3549.27 ▼5.94
Media Library /wp-admin/upload.php1,408 ▲234.30 ▲0.10101.65 ▲0.8243.57 ▼1.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/restrofood-lite/view/template-modal-alert.php
  • 41× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/restrofood-lite/view/modal-canvas-cart.php:7
    • > PHP Warning
      Use of undefined constant RESTROFOODLITE_DIR_URL - assumed 'RESTROFOODLITE_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/restrofood-lite/view/modal-canvas-cart.php on line 7
    • > PHP Warning
      Use of undefined constant RESTROFOODLITE_DIR_ADMIN - assumed 'RESTROFOODLITE_DIR_ADMIN' (this will throw an Error in a future version of PHP) in wp-content/plugins/restrofood-lite/admin/inc/settings-fields/class-settings-fields.php on line 17
    • > PHP Fatal error
      require_once(): Failed opening required 'RESTROFOODLITE_DIR_ADMINinc/settings-fields/checkbox.php' (include_path='.:/usr/share/php') in wp-content/plugins/restrofood-lite/admin/inc/settings-fields/class-settings-fields.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'RestroFoodLite\\Admin\\Settings_Fields_Base' not found in wp-content/plugins/restrofood-lite/admin/inc/tabs-content/color-settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function RestroFoodLite\\add_action() in wp-content/plugins/restrofood-lite/admin/admin.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'RestroFoodLite\\Admin\\Settings_Fields_Base' not found in wp-content/plugins/restrofood-lite/admin/inc/tabs-content/shortcode.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'RestroFoodLite\\Admin\\Settings_Fields_Base' not found in wp-content/plugins/restrofood-lite/admin/inc/tabs-content/page-settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/restrofood-lite/restrofood-lite.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/restrofood-lite/view/template-modal-product-content.php:60

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7 in restrofood-lite/assets to your readme.txt
  • Requires php: Invalid version format
The official readme.txt might help

restrofood-lite/restrofood-lite.php 85% from 13 tests

The primary PHP file in "Restrofood Lite - Online Food Ordering System" version 1.0.2 is used by WordPress to initiate all plugin functionality
Please take the time 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
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 237 characters long)

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
There were no executable files found in this plugin34,354 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
SVG2801212,122
JavaScript92,6217,2768,204
CSS117822428,072
PHP641,5181,2175,956

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.23
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces6
Interfaces0
Traits17
Classes30
▷ Abstract classes13.33%
▷ Concrete classes2996.67%
▷ Final classes26.90%
Methods184
▷ Static methods8345.11%
▷ Public methods16086.96%
▷ Protected methods1910.33%
▷ Private methods52.72%
Functions48
▷ Named functions4593.75%
▷ Anonymous functions36.25%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
23 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/sort_asc.png0.16KB0.25KB0.00%
assets/img/sort_desc.png0.15KB0.25KB0.00%
assets/img/mapmarkar@2x.png0.34KB0.34KB0.00%
assets/img/mapmarkar.png0.25KB0.25KB0.00%
assets/img/icon/item1.png18.09KB5.94KB▼ 67.19%