78% vikrestaurants

Code Review | VikRestaurants Table Reservations and Take-Away

WordPress plugin VikRestaurants Table Reservations and Take-Away scored78%from 54 tests.

About plugin

  • Plugin page: vikrestaurants
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Nov 26, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 76
  • Update frequency: every 14.5 days
  • Top authors: e4jvikwp (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /5,999 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲4.89MB] [CPU: ▲35.91ms] Passed 4 tests

Server-side resources used by VikRestaurants Table Reservations and Take-Away
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /7.28 ▲3.8177.55 ▲42.12
Dashboard /wp-admin8.78 ▲5.44106.05 ▲42.80
Posts /wp-admin/edit.php8.78 ▲5.4381.97 ▲34.08
Add New Post /wp-admin/post-new.php10.76 ▲4.87125.24 ▲24.62
Media Library /wp-admin/upload.php8.78 ▲5.55121.75 ▲87.97

Server storage [IO: ▲17.67MB] [DB: ▲0.10MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 3,016 new files
Database: 80 new tables, 14 new options
New tables
wp_vikrestaurants_reservation
wp_vikrestaurants_res_code
wp_vikrestaurants_lang_takeaway_menus_attribute
wp_vikrestaurants_api_login_event_options
wp_vikrestaurants_sd_menus
wp_vikrestaurants_operator
wp_vikrestaurants_table
wp_vikrestaurants_mail_text
wp_vikrestaurants_specialdays
wp_vikrestaurants_lang_section_product
...
New WordPress options
widget_mod_vikrestaurants_takeaway_cart
vikrestaurants_software_version
theysaidso_admin_options
db_upgraded
vikrestaurants_license_hash
widget_recent-comments
widget_mod_vikrestaurants_worktimes
vikrestaurants_license_key
widget_recent-posts
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by VikRestaurants Table Reservations and Take-Away
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,035 ▲26313.99 ▼0.777.37 ▲5.6640.64 ▼3.93
Dashboard /wp-admin2,340 ▲1654.87 ▼0.74112.54 ▼0.7550.99 ▲8.54
Posts /wp-admin/edit.php2,136 ▲332.23 ▲0.2535.42 ▼9.2730.98 ▼4.74
Add New Post /wp-admin/post-new.php1,695 ▲15023.25 ▼1.83599.14 ▼17.3560.11 ▼7.90
Media Library /wp-admin/upload.php1,439 ▲364.25 ▲0.09117.45 ▲22.0350.89 ▲9.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • theysaidso_admin_options
    • widget_mod_vikrestaurants_takeaway_cart
    • widget_mod_vikrestaurants_search
    • widget_recent-comments
    • widget_mod_vikrestaurants_worktimes
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1764× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/vikrestaurants/admin/models/tkdealday.php
    • > /wp-content/plugins/vikrestaurants/site/helpers/src/libraries/Backup/Import/Rules/FolderImportRule.php
    • > /wp-content/plugins/vikrestaurants/site/helpers/src/libraries/Update/Adapters/Update1_9/TakeAwayDeliveryAreasFixer.php
    • > /wp-content/plugins/vikrestaurants/site/helpers/src/libraries/Deals/Rules/DiscountItemDealRule.php
    • > /wp-content/plugins/vikrestaurants/modules/mod_vikrestaurants_takeaway_map/languages/handler.php
    • > /wp-content/plugins/vikrestaurants/site/helpers/tk_mail_tmpls/takeaway_review_email_tmpl.php
    • > /wp-content/plugins/vikrestaurants/site/views/orderdishes/tmpl/default_overlay.php
    • > /wp-content/plugins/vikrestaurants/site/helpers/library/mail/factory.php
    • > /wp-content/plugins/vikrestaurants/libraries/html/feedback/thickbox.php
    • > /wp-content/plugins/vikrestaurants/site/helpers/library/banking/brands/amex.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Trait 'IvoPetkov\\HTML5DOMDocument\\Internal\\QuerySelectors' not found in wp-content/plugins/vikrestaurants/site/helpers/src/vendor/ivopetkov/html5-dom-document-php/src/HTML5DOMDocument.php on line 21
    • > PHP Fatal error
      Trait 'IvoPetkov\\HTML5DOMDocument\\Internal\\QuerySelectors' not found in wp-content/plugins/vikrestaurants/site/helpers/src/vendor/ivopetkov/html5-dom-document-php/src/HTML5DOMElement.php on line 21

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 97% 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
Please fix the following attributes:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

vikrestaurants/vikrestaurants.php Passed 13 tests

The main PHP script in "VikRestaurants Table Reservations and Take-Away" version 1.3.1 is automatically included on every request by WordPress
83 characters long description:
A professional tool for managing your restaurant reservations and take-away orders.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected259,231 lines of code in 2,004 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,80253,112110,842217,168
CSS461,14064518,160
JavaScript923,0896,54810,348
SVG3009,552
SQL72884481,764
Markdown763201,236
XML35203128707
JSON700237
Bourne Shell124055
HTML4104

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 4,412)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 2,293)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity20.63
▷ Minimum class complexity1.00
▷ Maximum class complexity4,412.00
Average method complexity4.89
▷ Minimum method complexity1.00
▷ Maximum method complexity2,293.00
Code structure
Namespaces104
Interfaces33
Traits16
Classes1,068
▷ Abstract classes12311.52%
▷ Concrete classes94588.48%
▷ Final classes232.43%
Methods5,713
▷ Static methods91716.05%
▷ Public methods4,80584.11%
▷ Protected methods77013.48%
▷ Private methods1382.42%
Functions282
▷ Named functions93.19%
▷ Anonymous functions27396.81%
Constants247
▷ Global constants17370.04%
▷ Class constants7429.96%
▷ Public constants74100.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
497 compressed PNG files occupy 2.40MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
site/assets/css/flags/mm.png0.43KB0.42KB▼ 0.91%
site/assets/css/flags/kh.png0.37KB0.35KB▼ 4.23%
site/assets/css/flags/mg.png0.16KB0.14KB▼ 10.69%
site/assets/media/main_courses.png2.91KB1.93KB▼ 33.60%
site/assets/css/flags/bj.png0.16KB0.14KB▼ 11.80%