78% advance-food-menu

Code Review | Advance Food Menu

WordPress plugin Advance Food Menu scored 78% from 54 tests.

About plugin

  • Plugin page: advance-food-menu
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 5.9.2
  • First release: Jul 26, 2018
  • Latest release: Jul 27, 2018
  • Number of updates: 5
  • Update frequency: every 2.6 days
  • Top authors: joyelkhan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 629 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
This plugin's installer ran successfully

Server metrics [RAM: ▼1.20MB] [CPU: ▼329.08ms] Passed 4 tests

An overview of server-side resources used by Advance Food Menu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0455.02 ▲5.01
Dashboard /wp-admin3.13 ▼0.2816.73 ▼15.49
Posts /wp-admin/edit.php3.13 ▼0.5216.98 ▼21.20
Add New Post /wp-admin/post-new.php3.13 ▼3.8517.64 ▼1,271.78
Media Library /wp-admin/upload.php3.13 ▼0.1717.35 ▼7.86
Menu Item Types /wp-admin/edit-tags.php?taxonomy=menu-item-type&post_type=menu-item3.1317.78
Add New /wp-admin/post-new.php?post_type=menu-item3.1318.78
Settings /wp-admin/edit.php?post_type=menu-item&page=settings3.1317.30
Advance Food Menu /wp-admin/edit.php?post_type=menu-item3.1318.76

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 17 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Advance Food Menu
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,079 ▲35716.97 ▲1.3422.72 ▲17.0114.93 ▲12.46
Dashboard /wp-admin2,938 ▲776.17 ▲0.01119.29 ▼14.15171.55 ▲11.64
Posts /wp-admin/edit.php2,738 ▲473.14 ▼0.1066.89 ▲2.83142.04 ▼2.89
Add New Post /wp-admin/post-new.php1,781 ▲8120.88 ▼0.47435.51 ▼13.95165.49 ▲5.93
Media Library /wp-admin/upload.php1,747 ▲525.71 ▲0.18133.64 ▼4.14218.37 ▲28.93
Menu Item Types /wp-admin/edit-tags.php?taxonomy=menu-item-type&post_type=menu-item1,6692.7155.08115.00
Add New /wp-admin/post-new.php?post_type=menu-item3,04710.12191.18216.21
Settings /wp-admin/edit.php?post_type=menu-item&page=settings1,0672.3753.69153.56
Advance Food Menu /wp-admin/edit.php?post_type=menu-item1,4103.0962.83116.21

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
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=menu-item
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/post-new.php?post_type=menu-item
    • > Notice in wp-content/plugins/advance-food-menu/includes/advance-food-menu-meta.php+35
    Undefined index: afm-price

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
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advance-food-menu/includes/advance-food-menu-meta.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/advance-food-menu/includes/advance-food-menu-shortcode.php:106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advance-food-menu/includes/advance-food-menu-settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advance-food-menu/includes/advance-food-menu-cpts.php:37

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Contributors: Plugin contributors not specified
The official readme.txt might help

advance-food-menu/advance-food-menu.php Passed 13 tests

"Advance Food Menu" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
73 characters long description:
The simplest solution to display beautiful restaurant menus in WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected372 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP56426257
CSS321772
JavaScript584843

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/food-icon.png0.47KB0.53KB0.00%