71% fantastic-restaurant-menu

Code Review | Plugin Name: Fantastic Restaurant Menu

WordPress plugin Plugin Name: Fantastic Restaurant Menuscored71%from 54 tests.

About plugin

  • Plugin page: fantastic-restaur...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 9, 2017
  • Latest release: May 9, 2017
  • Number of updates: 7
  • Update frequency: every 2.9 days
  • Top authors: fwlab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /846 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.24MB] [CPU: ▼0.21ms] Passed 4 tests

A check of server-side resources used by Plugin Name: Fantastic Restaurant Menu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2445.21 ▲4.24
Dashboard /wp-admin3.54 ▲0.2348.27 ▼2.62
Posts /wp-admin/edit.php3.65 ▲0.2945.38 ▼1.29
Add New Post /wp-admin/post-new.php6.12 ▲0.2486.64 ▼1.15
Media Library /wp-admin/upload.php3.46 ▲0.2338.08 ▲4.57
All Restaurant Menus /wp-admin/edit.php?post_type=fantasticmenu_menu3.5037.13
Add New /wp-admin/post-new.php?post_type=fantasticmenu_menu3.4941.79

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 43 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
fwl-restaurant-menu-plugin-mode
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Plugin Name: Fantastic Restaurant Menu: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲12013.32 ▼1.061.91 ▲0.0745.14 ▲0.14
Dashboard /wp-admin2,233 ▲485.90 ▼0.01109.84 ▼6.4444.86 ▲2.24
Posts /wp-admin/edit.php2,116 ▲272.03 ▼0.0236.23 ▲2.2032.81 ▼1.56
Add New Post /wp-admin/post-new.php1,537 ▲117.49 ▼5.76673.70 ▼6.1658.48 ▲6.90
Media Library /wp-admin/upload.php1,412 ▲274.22 ▲0.01106.01 ▼7.9746.52 ▼2.44
All Restaurant Menus /wp-admin/edit.php?post_type=fantasticmenu_menu1,0801.9335.2232.18
Add New /wp-admin/post-new.php?post_type=fantasticmenu_menu3,3645.1597.51153.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=fantasticmenu_menu
    • > Warning in wp-content/plugins/fantastic-restaurant-menu/include/class_restaurantmenu.php+207
    count(): Parameter must be an array or an object that implements Countable

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 fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/fantastic-restaurant-menu/menu-plus-plugin.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fantastic-restaurant-menu/include/add_posttype.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fantastic-restaurant-menu/include/metabox.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fantastic-restaurant-menu/include/admin.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Plugin Name: Fantastic Restaurant Menu=== )
  • Contributors: Plugin contributors not specified
The official readme.txt might help

fantastic-restaurant-menu/menu-plus-plugin.php 77% from 13 tests

"Plugin Name: Fantastic Restaurant Menu" version 1.0.0'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:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("fantastic-restaurant-menu.php" instead of "menu-plus-plugin.php")

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
No dangerous file extensions were detected5,629 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript34312872,069
CSS8149551,620
PHP103791341,248
SVG100685
JSON1007

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity37.67
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity5.40
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods25
▷ Static methods2184.00%
▷ Public methods1872.00%
▷ Protected methods00.00%
▷ Private methods728.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
14 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png0.41KB0.15KB▼ 62.44%
resources/css/images/ui-bg_diagonals-thick_20_666666_40x40.png0.30KB0.15KB▼ 49.68%
resources/css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
resources/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
resources/css/images/ui-icons_228ef1_256x240.png4.44KB4.17KB▼ 6.02%