72% wp-restaurant-price-list

Code Review | WP Restaurant Price List

WordPress plugin WP Restaurant Price List scored72%from 54 tests.

About plugin

  • Plugin page: wp-restaurant-pri...
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.1.1
  • WordPress version: 6.3.1
  • First release: Aug 27, 2019
  • Latest release: Nov 26, 2022
  • Number of updates: 36
  • Update frequency: every 33.0 days
  • Top authors: marcodedo (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

700+ active /7,126 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲1.34MB] [CPU: ▲9.03ms] Passed 4 tests

An overview of server-side resources used by WP Restaurant Price List
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.78 ▲1.3253.80 ▲12.95
Dashboard /wp-admin4.63 ▲1.3357.38 ▲2.20
Posts /wp-admin/edit.php4.75 ▲1.3960.27 ▲11.56
Add New Post /wp-admin/post-new.php7.29 ▲1.41112.34 ▲9.41
Media Library /wp-admin/upload.php4.56 ▲1.3351.00 ▲16.37
Price Lists /wp-admin/edit.php?post_type=wprpl4.6046.00
Settings /wp-admin/edit.php?post_type=wprpl&page=wprpl-options4.7356.46
Dashboard /wp-admin/plugins.php?page=meta-box4.5547.50
Add New /wp-admin/post-new.php?post_type=wprpl4.7465.45

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 367 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WP Restaurant Price List
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,990 ▲22913.78 ▼0.428.44 ▲6.7642.78 ▲1.92
Dashboard /wp-admin2,288 ▲1085.65 ▼0.0388.16 ▼3.7640.89 ▼6.36
Posts /wp-admin/edit.php2,190 ▲902.03 ▲0.0640.09 ▼0.3435.32 ▼4.19
Add New Post /wp-admin/post-new.php1,568 ▲4023.32 ▲0.32602.36 ▼7.6158.09 ▲6.78
Media Library /wp-admin/upload.php1,505 ▲1084.22 ▲0.0598.17 ▼7.2741.47 ▼4.23
Price Lists /wp-admin/edit.php?post_type=wprpl1,1542.1031.3328.66
Settings /wp-admin/edit.php?post_type=wprpl&page=wprpl-options2,3765.00123.70117.73
Dashboard /wp-admin/plugins.php?page=meta-box1,4142.0523.8345.85
Add New /wp-admin/post-new.php?post_type=wprpl2,0234.9493.7383.85

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/wp-restaurant-price-list/public/partials/wp-restaurant-price-list-public-display.php
    • > /wp-content/plugins/wp-restaurant-price-list/templates/list-multi.php
    • > /wp-content/plugins/wp-restaurant-price-list/admin/partials/wp-restaurant-price-list-admin-display.php
    • > /wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/templates/audio.php
    • > /wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/templates/upload.php
    • > /wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/templates/media.php
    • > /wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/templates/video.php
  • 95× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: price in wp-content/plugins/wp-restaurant-price-list/templates/list.php on line 12
    • > PHP Notice
      Undefined variable: output in wp-content/plugins/wp-restaurant-price-list/templates/list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_File_Field' not found in wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/fields/image.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/fields/multiple-values.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/about/sections/products.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/fields/choice.php:11
    • > PHP Notice
      Undefined variable: price in wp-content/plugins/wp-restaurant-price-list/templates/list-multi.php on line 63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/about/sections/upgrade.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Multiple_Values_Field' not found in wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/fields/autocomplete.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/wp-restaurant-price-list/assets/meta-box/inc/about/sections/welcome.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/edit.php?post_type=wprpl&page=wprpl-options
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clear is deprecated since version 5.5.0! Use wp.i18n instead.

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
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Create your price list in the dashboard), #2 (Display of the price list on Twenty Nineteen), #3 (Settings)
You can look at the official readme.txt

wp-restaurant-price-list/wp-restaurant-price-list.php 92% from 13 tests

The entry point to "WP Restaurant Price List" version 1.4.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Git Repository: There should be no Git repositories present in your plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected16,889 lines of code in 322 files:
LanguageFilesBlank linesComment linesLines of code
PHP1492,0485,7028,672
JavaScript1098437813,367
CSS462931853,199
PO File145346001,471
Sass1159141
Markdown215034
SVG1005

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity8.70
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes114
▷ Abstract classes65.26%
▷ Concrete classes10894.74%
▷ Final classes00.00%
Methods626
▷ Static methods33052.72%
▷ Public methods53385.14%
▷ Protected methods548.63%
▷ Private methods396.23%
Functions35
▷ Named functions2571.43%
▷ Anonymous functions1028.57%
Constants8
▷ Global constants8100.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
20 PNG files occupy 0.42MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/meta-box/img/jqueryui/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
assets/meta-box/img/jqueryui/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
public/img/List.png21.16KB2.19KB▼ 89.64%
assets/meta-box/img/jqueryui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
assets/meta-box/img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%