84% wp-hotel-booking-authorize-payment

Code Review | WP Hotel Booking Authorize Payment

WordPress plugin WP Hotel Booking Authorize Payment scored 84% from 54 tests.

About plugin

  • Plugin page: wp-hotel-booking-...
  • Plugin version: 1.7.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.0
  • WordPress version: 6.3.1
  • First release: Nov 11, 2017
  • Latest release: May 26, 2022
  • Number of updates: 13
  • Update frequency: every 127.5 days
  • Top authors: leehld (69.23%)ThimPress (38.46%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active / 9,575 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.58ms] Passed 4 tests

Analyzing server-side resources used by WP Hotel Booking Authorize Payment
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.93 ▼11.23
Dashboard /wp-admin3.32 ▲0.0148.57 ▼1.88
Posts /wp-admin/edit.php3.37 ▲0.0145.79 ▼1.26
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.21 ▼7.95
Media Library /wp-admin/upload.php3.24 ▲0.0134.66 ▼0.22

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WP Hotel Booking Authorize Payment
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10213.26 ▼1.121.77 ▲0.0439.87 ▼3.62
Dashboard /wp-admin2,218 ▲335.86 ▲0.98108.80 ▼8.9143.74 ▼2.81
Posts /wp-admin/edit.php2,101 ▲152.00 ▼0.0336.23 ▲1.8835.79 ▲0.29
Add New Post /wp-admin/post-new.php1,545 ▲2823.29 ▲5.71607.00 ▼24.2056.52 ▼0.66
Media Library /wp-admin/upload.php1,397 ▲124.17 ▼0.0495.99 ▲0.7045.11 ▲1.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-hotel-booking-authorize-payment/wp-hotel-booking-authorize-sim.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WPHB_Settings' not found in wp-content/plugins/wp-hotel-booking-authorize-payment/inc/views/authorize-sim-settings.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: booking, authorizenet, hotel, hotel booking, reservations...

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

The primary PHP file in "WP Hotel Booking Authorize Payment" version 1.7.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-hotel-booking-authorize-payment.php" instead of "wp-hotel-booking-authorize-sim.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
Success! There were no dangerous files found in this plugin301 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP368137301

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity19.00
▷ Minimum class complexity11.00
▷ Maximum class complexity27.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods1694.12%
▷ Protected methods15.88%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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