72% trendy-restaurant-menu

Code Review | Trendy Restaurant Menu - Best Restaurant Plugin for WordPress

WordPress plugin Trendy Restaurant Menu - Best Restaurant Plugin for WordPress scored 72% from 54 tests.

About plugin

  • Plugin page: trendy-restaurant...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9.6
  • WordPress version: 5.8.1
  • First release: May 31, 2018
  • Latest release: May 31, 2018
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: techjewel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,823 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
Installer ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼134.51ms] Passed 4 tests

Server-side resources used by Trendy Restaurant Menu - Best Restaurant Plugin for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.09 ▲0.3637.30 ▲9.92
Dashboard /wp-admin3.39 ▲0.3353.95 ▲10.73
Posts /wp-admin/edit.php3.44 ▲0.3346.84 ▲1.65
Add New Post /wp-admin/post-new.php5.68 ▲0.2491.95 ▼554.57
Media Library /wp-admin/upload.php3.27 ▲0.2736.95 ▲4.95
All Restaurant Menus /wp-admin/edit.php?post_type=tr_menu3.3134.06
Dish Type /wp-admin/edit-tags.php?taxonomy=tr_dish_type&post_type=tr_menu3.2733.10
Add New /wp-admin/post-new.php?post_type=tr_menu3.4650.38
Location /wp-admin/edit-tags.php?taxonomy=tr_location_type&post_type=tr_menu3.2735.02
Meal Type /wp-admin/edit-tags.php?taxonomy=tr_meal_type&post_type=tr_menu3.2730.03
Settings /wp-admin/edit.php?post_type=tr_menu&page=trendy_restaurant_settings3.2531.71

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 46 new files
Database: no new tables, 1 new option
New WordPress options
widget_tr_menu_widget

Browser metrics Passed 4 tests

Checking browser requirements for Trendy Restaurant Menu - Best Restaurant Plugin for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,781 ▲18515.91 ▲0.199.26 ▼0.0746.19 ▼1.96
Dashboard /wp-admin3,065 ▲1315.96 ▼0.07139.77 ▼11.97114.10 ▲0.35
Posts /wp-admin/edit.php2,841 ▲1022.76 ▲0.0468.94 ▲3.9590.83 ▲2.72
Add New Post /wp-admin/post-new.php1,718 ▲22018.80 ▲0.02357.95 ▼14.90110.12 ▲4.26
Media Library /wp-admin/upload.php1,909 ▲1025.08 ▲0.06146.91 ▼9.25114.39 ▼1.71
All Restaurant Menus /wp-admin/edit.php?post_type=tr_menu1,5442.6865.3469.67
Dish Type /wp-admin/edit-tags.php?taxonomy=tr_dish_type&post_type=tr_menu1,8382.4561.6081.19
Add New /wp-admin/post-new.php?post_type=tr_menu4,24910.69265.08159.26
Location /wp-admin/edit-tags.php?taxonomy=tr_location_type&post_type=tr_menu1,8522.4156.4280.24
Meal Type /wp-admin/edit-tags.php?taxonomy=tr_meal_type&post_type=tr_menu1,8382.4461.3284.70
Settings /wp-admin/edit.php?post_type=tr_menu&page=trendy_restaurant_settings1,2092.1553.2996.52

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
Please fix the following items
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_tr_menu_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=tr_menu
    • > Warning in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php+9
    Illegal string offset 'calories'
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=tr_menu
    • > Notice in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php+9
    Uninitialized string offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=tr_menu
    • > Warning in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php+9
    Illegal string offset 'cholesterol'
    • > GET request to /wp-admin/post-new.php?post_type=tr_menu
    • > Warning in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php+9
    Illegal string offset 'fiber'
    • > GET request to /wp-admin/post-new.php?post_type=tr_menu
    • > Warning in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php+9
    Illegal string offset 'sodium'
    • > GET request to /wp-admin/post-new.php?post_type=tr_menu
    • > Warning in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php+9
    Illegal string offset 'carbohydrates'
    • > GET request to /wp-admin/post-new.php?post_type=tr_menu
    • > Warning in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php+9
    Illegal string offset 'fat'
    • > GET request to /wp-admin/post-new.php?post_type=tr_menu
    • > Warning in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php+9
    Illegal string offset 'protein'

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/trendy-restaurant-menu/include/templates/grid_items.php
    • > /wp-content/plugins/trendy-restaurant-menu/include/templates/center_aligned_menu.php
    • > /wp-content/plugins/trendy-restaurant-menu/include/templates/simple_food_menu.php
    • > /wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/main_items.php
    • > /wp-content/plugins/trendy-restaurant-menu/include/templates/default.php
    • > /wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php
  • 36× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_post_terms() in wp-content/plugins/trendy-restaurant-menu/include/templates/single_menu_content.php:30
    • > PHP Notice
      Undefined variable: _ninja_restaurant_spicy_level in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/main_items.php on line 32
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/trendy-restaurant-menu/include/templates/center_aligned_menu.php on line 2
    • > PHP Notice
      Undefined variable: boxes in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/nutrition_info.php on line 2
    • > PHP Notice
      Undefined variable: ingredients in wp-content/plugins/trendy-restaurant-menu/include/templates/single_menu_content.php on line 19
    • > PHP Notice
      Undefined variable: _ninja_restaurant_spicy_level in wp-content/plugins/trendy-restaurant-menu/include/templates/metaboxes/main_items.php on line 32
    • > PHP Notice
      Undefined variable: items in wp-content/plugins/trendy-restaurant-menu/include/templates/default.php on line 2
    • > PHP Notice
      Undefined variable: nutrition in wp-content/plugins/trendy-restaurant-menu/include/templates/single_menu_content.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/trendy-restaurant-menu/include/templates/settings/settings.php:7
    • > PHP Notice
      Undefined variable: items in wp-content/plugins/trendy-restaurant-menu/include/templates/center_aligned_menu.php on line 2

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

readme.txt 88% 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:
  • Requires php: The plugin version is formatted incorrectly
  • Screenshots: Add an image for screenshot #5 (Simple Styled Menu Items)
Please take inspiration from this readme.txt

trendy-restaurant-menu/trendy_restaurant_menu.php 85% from 13 tests

"Trendy Restaurant Menu - Best Restaurant Plugin for WordPress" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("trendy-restaurant-menu.php" instead of "trendy_restaurant_menu.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin2,618 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43925341,482
PHP24157381,089
CSS411040
JSON1007

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.11
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods42
▷ Static methods3173.81%
▷ Public methods3685.71%
▷ Protected methods00.00%
▷ Private methods614.29%
Functions8
▷ Named functions337.50%
▷ Anonymous functions562.50%
Constants3
▷ Global constants3100.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
2 compressed PNG files occupy 0.06MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/download-fluent-form.png55.29KB60.35KB0.00%
assets/images/mce_icon.png2.45KB2.12KB▼ 13.81%