52% restaurant-solutions-checklist

Code Review | Restaurant Solutions – Checklist

WordPress plugin Restaurant Solutions – Checklist scored52%from 54 tests.

About plugin

  • Plugin page: restaurant-soluti...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.1.1
  • WordPress version: 6.3.1
  • First release: Mar 30, 2019
  • Latest release: Mar 30, 2019
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: foucciano (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /511 total downloads

Benchmarks

Plugin footprint 48% 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.91MB] [CPU: ▼34.18ms] Passed 4 tests

An overview of server-side resources used by Restaurant Solutions – Checklist
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.96 ▼2.82
Dashboard /wp-admin3.05 ▼0.3022.11 ▼37.20
Posts /wp-admin/edit.php3.05 ▼0.3122.51 ▼21.88
Add New Post /wp-admin/post-new.php3.05 ▼2.8423.86 ▼69.63
Media Library /wp-admin/upload.php3.05 ▼0.1824.16 ▼8.02
Add New /wp-admin/post-new.php?post_type=stp_checklist3.0523.95
Checklists /wp-admin/edit.php?post_type=stp_checklist3.0524.17
Home /wp-admin/edit.php?post_type=stp_checklist&page=stp_checklist_option3.0524.27

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: 2 new tables, 6 new options
New tables
wp_employee
wp_checklist
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Restaurant Solutions – Checklist
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.30 ▼1.001.72 ▼0.1043.63 ▼12.95
Dashboard /wp-admin2,251 ▲664.95 ▲0.07105.13 ▼11.7639.59 ▼3.52
Posts /wp-admin/edit.php2,131 ▲422.23 ▲0.1835.05 ▼1.7633.95 ▼0.05
Add New Post /wp-admin/post-new.php1,549 ▲3517.46 ▼0.19667.34 ▲25.4661.54 ▲3.65
Media Library /wp-admin/upload.php1,424 ▲364.49 ▲0.2295.70 ▲0.4245.55 ▲1.10
Add New /wp-admin/post-new.php?post_type=stp_checklist1,5072.7562.0832.60
Checklists /wp-admin/edit.php?post_type=stp_checklist1,1112.0533.5928.77
Home /wp-admin/edit.php?post_type=stp_checklist&page=stp_checklist_option9592.0033.9665.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie tables detected upon uninstall: 2 tables
    • wp_employee
    • wp_checklist
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_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
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=stp_checklist&page=stp_checklist_option
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric 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/edit.php?post_type=stp_checklist&page=stp_checklist_option
    • > Notice in wp-content/plugins/restaurant-solutions-checklist/admin/class-stp-srtc-menu.php+50
    Undefined index: tab

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 items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/restaurant-solutions-checklist/admin/partials/report.php
    • > /wp-content/plugins/restaurant-solutions-checklist/public/partials/checklist_template.php
    • > /wp-content/plugins/restaurant-solutions-checklist/includes/pisol.class.form.php
    • > /wp-content/plugins/restaurant-solutions-checklist/public/partials/stp-srtc-public-display.php
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/restaurant-solutions-checklist/public/partials/checklist_template.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/restaurant-solutions-checklist/admin/class-stp-srtc-report.php:90
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/restaurant-solutions-checklist/includes/includes.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/restaurant-solutions-checklist/admin/class-stp-srtc-staff.php:213
    • > PHP Notice
      Undefined variable: checklists in wp-content/plugins/restaurant-solutions-checklist/admin/partials/report.php on line 3
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/restaurant-solutions-checklist/public/partials/checklist_template.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/restaurant-solutions-checklist/admin/partials/report.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/restaurant-solutions-checklist/admin/class-stp-srtc-checklist.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/restaurant-solutions-checklist/public/partials/checklist_form.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: "stpetedesign.com"
Please take inspiration from this readme.txt

restaurant-solutions-checklist/stp-srtc.php 77% from 13 tests

The main PHP file in "Restaurant Solutions – Checklist" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 165 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("restaurant-solutions-checklist.php" instead of "stp-srtc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,951 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP202875751,079
SVG222411
JavaScript42668292
CSS33314169

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity11.92
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods76
▷ Static methods56.58%
▷ Public methods7193.42%
▷ Protected methods00.00%
▷ Private methods56.58%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/pi-web-solution.png21.25KB9.42KB▼ 55.67%