84% ticket-restaurant-mobile-for-woocommerce

Code Review | Ticket Restaurant for WooCommerce

WordPress plugin Ticket Restaurant for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: ticket-restaurant...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.4.2
  • WordPress version: 6.3.1
  • First release: Aug 7, 2020
  • Latest release: Dec 6, 2021
  • Number of updates: 7
  • Update frequency: every 69.6 days
  • Top authors: paycritical (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /502 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.14ms] Passed 4 tests

A check of server-side resources used by Ticket Restaurant for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.75 ▼10.82
Dashboard /wp-admin3.34 ▲0.0346.55 ▼5.72
Posts /wp-admin/edit.php3.39 ▲0.0349.14 ▲3.82
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.07 ▼11.55
Media Library /wp-admin/upload.php3.26 ▲0.0337.22 ▲3.55

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
ticketrestaurant_mobile_auth_code
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Ticket Restaurant for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲7213.31 ▼1.311.57 ▼0.6039.98 ▼4.26
Dashboard /wp-admin2,213 ▲225.85 ▼0.03111.13 ▼5.0943.18 ▼0.07
Posts /wp-admin/edit.php2,095 ▲61.99 ▼0.0242.31 ▲5.1037.82 ▲1.00
Add New Post /wp-admin/post-new.php1,541 ▲623.06 ▼0.09600.64 ▼94.7853.00 ▼9.85
Media Library /wp-admin/upload.php1,389 ▲14.24 ▲0.0295.65 ▼1.6342.81 ▼1.64

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • ticketrestaurant_mobile_auth_code
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order' not found in wp-content/plugins/ticket-restaurant-mobile-for-woocommerce/includes/views/order-meta-box.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ticket-restaurant-mobile-for-woocommerce/includes/views/html-admin-page.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: gateway, ticketrestaurant, woocommerce, e-commerce, payment...

ticket-restaurant-mobile-for-woocommerce/ticket-restaurant-for-woocommerce.php 85% from 13 tests

The primary PHP file in "Ticket Restaurant for WooCommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ticket-restaurant-mobile-for-woocommerce.php" instead of "ticket-restaurant-for-woocommerce.php")
  • Domain Path: The domain path points to a folder that does not exist ("/lang")

Code Analysis Passed 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 detected960 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP9148108783
PO File1120240177

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.41
Average class complexity24.75
▷ Minimum class complexity6.00
▷ Maximum class complexity60.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods41
▷ Static methods24.88%
▷ Public methods3892.68%
▷ Protected methods12.44%
▷ Private methods24.88%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/ticket-restaurant-mobile-icon.png2.58KB1.95KB▼ 24.44%