78% simple-restaurant-menu

Code Review | Simple Restaurant Menu

WordPress plugin Simple Restaurant Menu scored78%from 54 tests.

About plugin

  • Plugin page: simple-restaurant...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Oct 31, 2016
  • Latest release: Jan 19, 2018
  • Number of updates: 9
  • Update frequency: every 49.4 days
  • Top authors: Will-007 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,248 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼13.19ms] Passed 4 tests

An overview of server-side resources used by Simple Restaurant Menu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0525.07 ▼13.70
Dashboard /wp-admin3.43 ▲0.0945.28 ▼16.63
Posts /wp-admin/edit.php3.55 ▲0.1950.67 ▲2.97
Add New Post /wp-admin/post-new.php6.04 ▲0.1587.13 ▼23.98
Media Library /wp-admin/upload.php3.36 ▲0.1334.24 ▲1.54
Menu Items /wp-admin/edit.php?post_type=srm_menu_item3.4037.40
Menus /wp-admin/edit.php?post_type=srm_menu3.4036.38

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Simple Restaurant Menu
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,051 ▲30513.60 ▼0.7910.74 ▲8.9445.33 ▼0.76
Dashboard /wp-admin2,241 ▲554.86 ▼1.04109.43 ▲2.0141.88 ▼0.52
Posts /wp-admin/edit.php2,124 ▲382.06 ▲0.0539.93 ▲4.3737.35 ▲5.13
Add New Post /wp-admin/post-new.php1,564 ▲4518.60 ▼4.56624.50 ▲3.8670.12 ▲14.02
Media Library /wp-admin/upload.php1,420 ▲294.21 ▲0.02100.38 ▼1.4541.27 ▼2.92
Menu Items /wp-admin/edit.php?post_type=srm_menu_item1,1231.9732.5332.42
Menus /wp-admin/edit.php?post_type=srm_menu1,0681.9931.7330.15
Settings /wp-admin/srm_setting.php260.440.1212.26

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/simple-restaurant-menu/includes/srm-shortcode.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-restaurant-menu/includes/srm-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-restaurant-menu/includes/srm-menu-item-meta.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-restaurant-menu/includes/srm-cpts.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-restaurant-menu/includes/srm-menu-meta.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-restaurant-menu/includes/srm-scripts.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-restaurant-menu/includes/srm-cpts-columns.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/srm_setting.php
    • > Network (severe)
    wp-admin/srm_setting.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (The menu screen. screenshot-1.png), #2 (The menu item screen. screenshot-2.png)
You can look at the official readme.txt

simple-restaurant-menu/simple-restaurant-menu.php 92% from 13 tests

Analyzing the main PHP file in "Simple Restaurant Menu" version 1.2
Please make the necessary changes and 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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,149 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP8385103555
JavaScript27553352
CSS3537242

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/close.png0.27KB0.29KB0.00%
assets/images/prev.png1.33KB1.59KB0.00%
assets/images/next.png1.32KB1.58KB0.00%