74% restaurantpress

Code Review | RestaurantPress

WordPress plugin RestaurantPress scored 74% from 54 tests.

About plugin

  • Plugin page: restaurantpress
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4
  • WordPress version: 5.8.1
  • First release: Nov 4, 2015
  • Latest release: May 27, 2020
  • Number of updates: 19
  • Update frequency: every 87.8 days
  • Top authors: wpeverest (52.63%)ThemeGrill (47.37%)wpeverestdev (10.53%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active / 47,091 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.60MB] [CPU: ▼136.61ms] 75% from 4 tests

Server-side resources used by RestaurantPress
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 4,678.22ms on /wp-admin/admin.php?page=rp-extensions)
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲1.3948.86 ▲13.20
Dashboard /wp-admin4.71 ▲1.6547.48 ▼0.18
Posts /wp-admin/edit.php4.82 ▲1.7156.89 ▲11.90
Add New Post /wp-admin/post-new.php7.47 ▲2.0494.29 ▼566.67
Media Library /wp-admin/upload.php4.66 ▲1.6641.83 ▲8.53
Extensions /wp-admin/admin.php?page=rp-extensions4.634,678.22
Add Menu Item /wp-admin/post-new.php?post_type=food_menu4.9966.69
Categories /wp-admin/edit-tags.php?taxonomy=food_menu_cat&post_type=food_menu4.7246.17
Settings /wp-admin/admin.php?page=rp-settings4.7651.30
RestaurantPress /wp-admin/admin.php?page=restaurantpress4.4735.61
Tags /wp-admin/edit-tags.php?taxonomy=food_menu_tag&post_type=food_menu4.6441.59
All Menu Items /wp-admin/edit.php?post_type=food_menu4.8846.22
Groups /wp-admin/edit.php?post_type=food_group4.7362.43

Server storage [IO: ▲2.21MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 217 new files
Database: 1 new table, 13 new options
New tables
wp_rp_sessions
New WordPress options
restaurantpress_currency_pos
restaurantpress_version
restaurantpress_db_version
restaurantpress_enable_gallery_zoom
widget_restaurantpress_widget_menu
restaurantpress_meta_box_errors
restaurantpress_admin_notices
restaurantpress_price_decimal_sep
restaurantpress_price_num_decimals
current_theme_supports_restaurantpress
...

Browser metrics Passed 4 tests

A check of browser resources used by RestaurantPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,942 ▲34616.43 ▲0.4412.80 ▲2.4944.10 ▼3.91
Dashboard /wp-admin3,059 ▲1286.08 ▲0.15143.96 ▼51.11106.77 ▼5.19
Posts /wp-admin/edit.php2,831 ▲922.72 ▲0.0165.76 ▼1.2691.53 ▼4.25
Add New Post /wp-admin/post-new.php1,741 ▲5819.00 ▲0.46441.95 ▲42.46104.80 ▼0.04
Media Library /wp-admin/upload.php1,899 ▲925.01 ▼0.02159.86 ▼14.07114.07 ▲5.92
Extensions /wp-admin/admin.php?page=rp-extensions1,2823.0081.6679.53
Add Menu Item /wp-admin/post-new.php?post_type=food_menu4,30111.70305.00158.58
Categories /wp-admin/edit-tags.php?taxonomy=food_menu_cat&post_type=food_menu2,2084.3895.1495.03
Settings /wp-admin/admin.php?page=rp-settings2,4183.2094.0080.77
RestaurantPress /wp-admin/admin.php?page=restaurantpress280.900.109.83
Tags /wp-admin/edit-tags.php?taxonomy=food_menu_tag&post_type=food_menu1,8032.3963.4184.65
All Menu Items /wp-admin/edit.php?post_type=food_menu1,8144.66111.5084.06
Groups /wp-admin/edit.php?post_type=food_group1,5633.0384.14112.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_rp_sessions
  • This plugin does not fully uninstall, leaving 13 options in the database
    • restaurantpress_price_thousand_sep
    • restaurantpress_queue_flush_rewrite_rules
    • current_theme_supports_restaurantpress
    • restaurantpress_enable_gallery_zoom
    • restaurantpress_price_decimal_sep
    • restaurantpress_admin_notices
    • restaurantpress_price_num_decimals
    • widget_restaurantpress_widget_menu
    • restaurantpress_version
    • restaurantpress_currency
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=restaurantpress
    • > Network (severe)
    wp-admin/admin.php?page=restaurantpress - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
7 plugin tags: drink, cafe, food, menu, restaurant...

restaurantpress/restaurantpress.php Passed 13 tests

The principal PHP file in "RestaurantPress" v. 1.8.1 is loaded by WordPress automatically on each request
101 characters long description:
Allows you to create awesome restaurant menus for restaurants, bars, and cafes in no time. Smartly :)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected33,950 lines of code in 201 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript453,9921,78616,464
PHP1233,1066,43313,228
Sass1363923,714
CSS179487497
SVG30147

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity24.85
▷ Minimum class complexity1.00
▷ Maximum class complexity474.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes71
▷ Abstract classes1014.08%
▷ Concrete classes6185.92%
▷ Final classes11.64%
Methods725
▷ Static methods15921.93%
▷ Public methods42258.21%
▷ Protected methods25034.48%
▷ Private methods537.31%
Functions166
▷ Named functions166100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants1083.33%
▷ Class constants216.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.03MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/select2x2.png0.83KB0.77KB▼ 6.15%
assets/images/placeholder.png24.75KB10.16KB▼ 58.94%
assets/css/photoswipe/default-skin/default-skin.png0.53KB0.72KB0.00%
assets/images/select2.png0.60KB0.99KB0.00%