64% redi-restaurant-reservation

Code Review | ReDi Restaurant Reservation

WordPress plugin ReDi Restaurant Reservation scored64%from 54 tests.

About plugin

  • Plugin page: redi-restaurant-r...
  • Plugin version: 23.1124
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 17, 2013
  • Latest release: Nov 24, 2023
  • Number of updates: 1,204
  • Update frequency: every 3.3 days
  • Top authors: thecatkin (58.22%)robby.roboter (41.86%)

Code review

54 tests

User reviews

27 reviews

Install metrics

1,000+ active /68,521 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.58MB] [CPU: ▲1.06ms] Passed 4 tests

An overview of server-side resources used by ReDi Restaurant Reservation
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7640.37 ▲0.10
Dashboard /wp-admin3.92 ▲0.5752.32 ▼6.32
Posts /wp-admin/edit.php3.97 ▲0.6154.27 ▲7.13
Add New Post /wp-admin/post-new.php6.46 ▲0.5797.66 ▲3.33
Media Library /wp-admin/upload.php3.78 ▲0.5541.40 ▲8.57

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 194 new files
Database: 2 new tables, 7 new options
New tables
wp_redi_restaurant_reservation_v6_custom_fields
wp_redi_restaurant_reservation_v6
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
wp_redi_restaurant_options

Browser metrics Passed 4 tests

Checking browser requirements for ReDi Restaurant Reservation
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲16414.31 ▼0.042.15 ▲0.5437.05 ▼7.34
Dashboard /wp-admin2,279 ▲995.59 ▼0.1394.62 ▲5.6369.17 ▲25.15
Posts /wp-admin/edit.php2,199 ▲992.11 ▼0.0440.48 ▲4.6334.62 ▲0.21
Add New Post /wp-admin/post-new.php1,616 ▲9023.29 ▼0.36702.65 ▲65.8353.93 ▼1.75
Media Library /wp-admin/upload.php1,493 ▲994.22 ▼0.03104.97 ▲5.8573.91 ▲31.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'uninstall' not found or invalid function name
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_redi_restaurant_reservation_v6
    • wp_redi_restaurant_reservation_v6_custom_fields
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • wp_redi_restaurant_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 21× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant REDI_RESTAURANT_TEMPLATE - assumed 'REDI_RESTAURANT_TEMPLATE' (this will throw an Error in a future version of PHP) in wp-content/plugins/redi-restaurant-reservation/templates/admin_welcome_no_page.php on line 1
    • > PHP Warning
      Use of undefined constant REDI_RESTAURANT_TEMPLATE - assumed 'REDI_RESTAURANT_TEMPLATE' (this will throw an Error in a future version of PHP) in wp-content/plugins/redi-restaurant-reservation/templates/admin_welcome.php on line 1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/redi-restaurant-reservation/templates/frontend.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/redi-restaurant-reservation/redi-restaurant-reservation.php:13
    • > PHP Warning
      Use of undefined constant REDI_RESTAURANT_TEMPLATE - assumed 'REDI_RESTAURANT_TEMPLATE' (this will throw an Error in a future version of PHP) in wp-content/plugins/redi-restaurant-reservation/templates/admin.php on line 40
    • > PHP Fatal error
      require_once(): Failed opening required 'REDI_RESTAURANT_TEMPLATE../js/hotjar.js' (include_path='.:/usr/share/php') in wp-content/plugins/redi-restaurant-reservation/templates/admin_welcome_no_page.php on line 1
    • > PHP Fatal error
      require_once(): Failed opening required 'REDI_RESTAURANT_TEMPLATE../js/hotjar.js' (include_path='.:/usr/share/php') in wp-content/plugins/redi-restaurant-reservation/templates/admin_welcome_no_key.php on line 1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/redi-restaurant-reservation/templates/frontend_v2.php:1
    • > PHP Fatal error
      require_once(): Failed opening required 'REDI_RESTAURANT_TEMPLATE../js/hotjar.js' (include_path='.:/usr/share/php') in wp-content/plugins/redi-restaurant-reservation/templates/admin_welcome.php on line 1
    • > PHP Warning
      Use of undefined constant REDI_RESTAURANT_TEMPLATE - assumed 'REDI_RESTAURANT_TEMPLATE' (this will throw an Error in a future version of PHP) in wp-content/plugins/redi-restaurant-reservation/templates/admin_welcome_no_key.php on line 1

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 93% 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:
  • Tags: Please reduce the number of tags, currently 61 tag instead of maximum 10
The official readme.txt might help

redi-restaurant-reservation/redi-restaurant-reservation.php 92% from 13 tests

The entry point to "ReDi Restaurant Reservation" version 23.1124 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 510 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin27,977 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
PO File224,8925,59515,454
PHP236851335,598
JavaScript112884203,853
CSS208413342,941
SVG61120129
JSON1002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity31.07
▷ Minimum class complexity1.00
▷ Maximum class complexity321.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity100.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods114
▷ Static methods2118.42%
▷ Public methods9986.84%
▷ Protected methods00.00%
▷ Private methods1513.16%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants34
▷ Global constants2058.82%
▷ Class constants1441.18%
▷ Public constants14100.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
63 compressed PNG files occupy 0.47MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/calendar/img/cool-bg.png0.23KB0.28KB0.00%
img/168810.png3.76KB3.78KB0.00%
css/calendar/img/cool-bg-hard-inv.png0.25KB0.35KB0.00%
img/calender.png4.06KB2.34KB▼ 42.49%
css/calendar/shadow-b.png0.20KB0.15KB▼ 25.96%