94% wp-hotel-booking-stripe-payment

Code Review | WP Hotel Booking Stripe Payment

WordPress plugin WP Hotel Booking Stripe Payment scored 94% from 54 tests.

About plugin

  • Plugin page: wp-hotel-booking-...
  • Plugin version: 1.7.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.7
  • WordPress version: 5.8.1
  • First release: Nov 10, 2017
  • Latest release: Jul 1, 2021
  • Number of updates: 17
  • Update frequency: every 78.3 days
  • Top authors: leehld (58.82%)ThimPress (41.18%)phamtungpth (11.76%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active / 10,315 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼150.12ms] Passed 4 tests

This is a short check of server-side resources used by WP Hotel Booking Stripe Payment
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1230.21 ▲10.09
Dashboard /wp-admin3.06 ▲0.0145.20 ▼1.84
Posts /wp-admin/edit.php3.11 ▲0.0143.68 ▼4.41
Add New Post /wp-admin/post-new.php5.42 ▼0.0187.68 ▼578.44
Media Library /wp-admin/upload.php3.01 ▲0.0037.77 ▼15.78

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Hotel Booking Stripe Payment
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12715.86 ▲0.058.49 ▲0.2051.21 ▲2.32
Dashboard /wp-admin2,993 ▲625.91 ▼0.09138.82 ▼8.44110.46 ▼12.39
Posts /wp-admin/edit.php2,761 ▲222.69 ▲0.0170.76 ▲3.4198.05 ▲6.33
Add New Post /wp-admin/post-new.php1,684 ▲10318.80 ▼1.56375.00 ▼0.99111.68 ▼0.59
Media Library /wp-admin/upload.php1,830 ▲235.01 ▼0.00166.13 ▼6.25126.54 ▼2.67

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

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 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
Please fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WPHB_Settings' not found in wp-content/plugins/wp-hotel-booking-stripe-payment/inc/views/strip-settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-hotel-booking-stripe-payment/wp-hotel-booking-stripe.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: booking, stripe, hotel booking, reservation, reservations...

wp-hotel-booking-stripe-payment/wp-hotel-booking-stripe.php 92% from 13 tests

The main PHP file in "WP Hotel Booking Stripe Payment" ver. 1.7.7 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-hotel-booking-stripe-payment.php" instead of "wp-hotel-booking-stripe.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin454 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3103149371
JavaScript322983

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity28.00
▷ Minimum class complexity15.00
▷ Maximum class complexity41.00
Average method complexity4.18
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin