73% reservit-hotel

Code Review | Reservit Hotel

WordPress plugin Reservit Hotel scored 73% from 53 tests.

About plugin

  • Plugin page: reservit-hotel
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Nov 8, 2017
  • Latest release: Dec 23, 2020
  • Number of updates: 30
  • Update frequency: every 38.1 days
  • Top authors: reservit (100%)

Code review

53 tests

User reviews

1 review

Install metrics

300+ active / 2,959 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.39MB] [CPU: ▼276.98ms] Passed 4 tests

A check of server-side resources used by Reservit Hotel
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.08 ▲0.3642.01 ▲19.42
Dashboard /wp-admin3.50 ▲0.4545.22 ▲6.83
Posts /wp-admin/edit.php3.55 ▲0.4549.02 ▲4.48
Add New Post /wp-admin/post-new.php5.80 ▲0.37100.28 ▼1,116.85
Media Library /wp-admin/upload.php3.38 ▲0.3734.51 ▼2.36
Home /wp-admin/admin.php?page=reservitHotel3.3526.99
CSS /wp-admin/admin.php?page=RsvitHotelBestprice_style3.3232.20
Reservit ID /wp-admin/admin.php?page=ReservitHotelBestprice_id3.3531.65
Content /wp-admin/admin.php?page=RsvitHotelBestprice_content3.3532.41

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 1 new option
New WordPress options
widget_reservit_hotel_bestprice

Browser metrics Passed 4 tests

This is an overview of browser requirements for Reservit Hotel
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,885 ▲27916.45 ▲0.7913.40 ▲4.1251.80 ▲1.69
Dashboard /wp-admin3,014 ▲1616.58 ▲0.72172.69 ▲11.49129.65 ▲15.41
Posts /wp-admin/edit.php2,796 ▲902.76 ▲0.0871.62 ▲1.31122.34 ▲25.97
Add New Post /wp-admin/post-new.php1,717 ▲6418.76 ▼0.32406.47 ▲17.89149.72 ▲36.25
Media Library /wp-admin/upload.php1,859 ▲875.17 ▲0.18130.99 ▼26.99134.90 ▲8.23
Home /wp-admin/admin.php?page=reservitHotel1,4692.5761.22100.92
CSS /wp-admin/admin.php?page=RsvitHotelBestprice_style4,9434.13213.67118.93
Reservit ID /wp-admin/admin.php?page=ReservitHotelBestprice_id1,1462.5763.0989.81
Content /wp-admin/admin.php?page=RsvitHotelBestprice_content1,4992.5865.79110.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_reservit_hotel_bestprice

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=RsvitHotelBestprice_style
    • > Warning in wp-content/plugins/reservit-hotel/reservit-hotel-best-price.php+740
    Use of undefined constant selected - assumed 'selected' (this will throw an Error in a future version of PHP)

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/reservit-hotel/reservit-hotel-bestprice-widget.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/reservit-hotel/reservit-hotel.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/reservit-hotel/reservit-hotel-best-price.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=RsvitHotelBestprice_style
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=5.8.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=RsvitHotelBestprice_style
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=5.8.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=RsvitHotelBestprice_style
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=5.8.1+1:283
    wpColorPickerL10n.clear is deprecated since version 5.5.0! Use wp.i18n instead.
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=RsvitHotelBestprice_style
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=5.8.1+1:283
    wpColorPickerL10n.clearAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration Passed 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
8 plugin tags: price, rate, call to action, room, booking...

reservit-hotel/reservit-hotel.php Passed 13 tests

Analyzing the main PHP file in "Reservit Hotel" version 2.0
69 characters long description:
A plugin for live display of your hotel's room best price by Reservit

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,807 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP61381331,136
PO File1146172396
CSS22933209
JavaScript2164366

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity22.33
▷ Minimum class complexity2.00
▷ Maximum class complexity59.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods62
▷ Static methods00.00%
▷ Public methods62100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
reservit.png3.81KB3.62KB▼ 5.05%