94% wp-hotel-booking-coupon

Code Review | WP Hotel Booking Coupon

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

About plugin

  • Plugin page: wp-hotel-booking-...
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.7.2
  • WordPress version: 5.8.1
  • First release: Nov 8, 2017
  • Latest release: Jul 20, 2021
  • Number of updates: 10
  • Update frequency: every 135.0 days
  • Top authors: leehld (70%)ThimPress (30%)phamtungpth (20%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active / 9,554 total downloads

Benchmarks

Plugin footprint Passed 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 successfully, without throwing any errors or notices

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

An overview of server-side resources used by WP Hotel Booking Coupon
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1238.28 ▲18.73
Dashboard /wp-admin3.06 ▲0.0146.55 ▲2.89
Posts /wp-admin/edit.php3.11 ▲0.0144.23 ▼0.60
Add New Post /wp-admin/post-new.php5.43 ▼0.01104.78 ▼661.35
Media Library /wp-admin/upload.php3.01 ▼0.0034.67 ▼14.61

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WP Hotel Booking Coupon
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,699 ▲10315.89 ▲0.406.60 ▼2.8649.06 ▼1.48
Dashboard /wp-admin2,989 ▲556.00 ▼0.13156.37 ▲2.00113.63 ▼0.57
Posts /wp-admin/edit.php2,761 ▲222.83 ▲0.0272.60 ▲6.7196.86 ▲4.57
Add New Post /wp-admin/post-new.php1,627 ▼5620.92 ▲4.84287.64 ▼95.40109.83 ▼8.19
Media Library /wp-admin/upload.php1,827 ▲175.00 ▼0.02159.53 ▼20.80125.92 ▼5.42

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 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-hotel-booking-coupon/wp-hotel-booking-coupon.php:12

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: discount, hotel booking, reservations, booking, coupon...

wp-hotel-booking-coupon/wp-hotel-booking-coupon.php Passed 13 tests

The main file in "WP Hotel Booking Coupon" v. 1.7.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
23 characters long description:
WP Hotel Booking Coupon

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected251 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24090251

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity24.00
▷ Minimum class complexity16.00
▷ Maximum class complexity32.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin