72% responsive-food-and-drink-menu

Code Review | Responsive Food and Drink Menu

WordPress plugin Responsive Food and Drink Menu scored72%from 54 tests.

About plugin

  • Plugin page: responsive-food-a...
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.2
  • WordPress version: 6.3.1
  • First release: May 26, 2017
  • Latest release: Dec 20, 2018
  • Number of updates: 26
  • Update frequency: every 22.1 days
  • Top authors: corporatezen222 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,818 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.54MB] [CPU: ▼24.83ms] Passed 4 tests

This is a short check of server-side resources used by Responsive Food and Drink Menu
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1942.47 ▼2.76
Dashboard /wp-admin3.39 ▲0.0436.57 ▼29.02
Posts /wp-admin/edit.php3.61 ▲0.2656.41 ▼3.32
Add New Post /wp-admin/post-new.php3.34 ▼2.5441.03 ▼64.23
Media Library /wp-admin/upload.php3.39 ▲0.1634.62 ▼0.50
RFADM Display Options /wp-admin/options-general.php?page=responsive_food_and_drink_menu3.3632.77
All PDF Menus /wp-admin/edit.php?post_type=pdf_menu_page_cpt3.4436.46
Add New /wp-admin/post-new.php?post_type=pdf_menu_page_cpt3.3435.70
Add New /wp-admin/post-new.php?post_type=menu_page_cpt3.3437.54
All Menus /wp-admin/edit.php?post_type=menu_page_cpt3.4435.63

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

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

Browser metrics Passed 4 tests

Responsive Food and Drink Menu: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,961 ▲20013.81 ▼0.548.45 ▲6.0644.25 ▼3.41
Dashboard /wp-admin2,253 ▲765.65 ▼0.0395.66 ▼4.7038.23 ▼4.39
Posts /wp-admin/edit.php2,158 ▲582.16 ▲0.1739.44 ▲0.9035.73 ▼2.66
Add New Post /wp-admin/post-new.php1,575 ▲4923.47 ▼0.35687.84 ▼23.4648.64 ▼17.82
Media Library /wp-admin/upload.php1,455 ▲524.18 ▼0.01102.93 ▲2.6543.68 ▼1.76
RFADM Display Options /wp-admin/options-general.php?page=responsive_food_and_drink_menu1,1961.9723.0928.04
All PDF Menus /wp-admin/edit.php?post_type=pdf_menu_page_cpt1,1191.9831.5631.05
Add New /wp-admin/post-new.php?post_type=pdf_menu_page_cpt1,7183.6169.0336.11
Add New /wp-admin/post-new.php?post_type=menu_page_cpt2,4067.84176.4262.44
All Menus /wp-admin/edit.php?post_type=menu_page_cpt1,1121.9134.6327.27

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • rfadm__settings
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=menu_page_cpt
    • > Notice in wp-content/plugins/responsive-food-and-drink-menu/responsive-food-and-drink-menu.php+189
    Trying to get property 'post_type' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=menu_page_cpt
    • > Notice in wp-content/plugins/responsive-food-and-drink-menu/inc/pdf_menu_pdf.php+59
    Undefined variable: post_id
    • > GET request to /wp-admin/post-new.php?post_type=menu_page_cpt
    • > Notice in wp-content/plugins/responsive-food-and-drink-menu/responsive-food-and-drink-menu.php+193
    Trying to get property 'base' of non-object

SRP 50% 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 fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/responsive-food-and-drink-menu/responsive-food-and-drink-menu.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=menu_page_cpt
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/post-new.php?post_type=menu_page_cpt:461:21)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=menu_page_cpt
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed: The official readme.txt is a good inspiration

responsive-food-and-drink-menu/responsive-food-and-drink-menu.php 92% from 13 tests

This is the main PHP file of "Responsive Food and Drink Menu" version 2.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 165 characters long)

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
No dangerous file extensions were detected1,032 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP7263220749
CSS2392212
JavaScript5192071

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions3397.06%
▷ Anonymous functions12.94%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected