62% hostel

Code Review | Hostel

WordPress plugin Hostel scored62%from 54 tests.

About plugin

  • Plugin page: hostel
  • Plugin version: 1.1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 8, 2013
  • Latest release: Aug 10, 2023
  • Number of updates: 82
  • Update frequency: every 43.5 days
  • Top authors: prasunsen (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

60+ active /18,137 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

A check of server-side resources used by Hostel
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.24 ▼18.44
Dashboard /wp-admin3.33 ▲0.0345.77 ▲0.11
Posts /wp-admin/edit.php3.38 ▲0.0352.08 ▲1.60
Add New Post /wp-admin/post-new.php5.93 ▲0.0598.40 ▲7.15
Media Library /wp-admin/upload.php3.25 ▲0.0340.18 ▲6.64
Unavailable Dates /wp-admin/admin.php?page=wphostel_unavailable3.2736.07
Manage Bookings /wp-admin/admin.php?page=wphostel_bookings3.1933.87
Manage Rooms /wp-admin/admin.php?page=wphostel_rooms3.2733.96
Email Log /wp-admin/admin.php?page=wphostel_emaillog3.2734.34
Help /wp-admin/admin.php?page=wphostel_help3.2732.70
Settings /wp-admin/admin.php?page=wphostel_options3.3235.12

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 35 new files
Database: 4 new tables, 10 new options
New tables
wp_wphostel_payments
wp_wphostel_emaillog
wp_wphostel_bookings
wp_wphostel_rooms
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
wphostel_datepicker_css
wphostel_max_date
can_compress_scripts
wphostel_version
wphostel_currency
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Hostel
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲18713.74 ▼0.868.96 ▲6.1142.07 ▼14.01
Dashboard /wp-admin2,260 ▲724.92 ▲0.06100.09 ▼9.8341.09 ▼1.35
Posts /wp-admin/edit.php2,143 ▲542.06 ▲0.0138.36 ▲2.3437.16 ▲2.31
Add New Post /wp-admin/post-new.php1,568 ▲4818.68 ▼4.49646.81 ▼60.6059.74 ▼13.02
Media Library /wp-admin/upload.php1,442 ▲574.24 ▲0.11100.36 ▲1.7641.73 ▲0.66
Unavailable Dates /wp-admin/admin.php?page=wphostel_unavailable1,4102.2840.5626.48
Manage Bookings /wp-admin/admin.php?page=wphostel_bookings8611.8727.4725.71
Manage Rooms /wp-admin/admin.php?page=wphostel_rooms8141.8624.0824.81
Email Log /wp-admin/admin.php?page=wphostel_emaillog1,0052.0727.8427.42
Help /wp-admin/admin.php?page=wphostel_help1,0491.8923.4331.26
Settings /wp-admin/admin.php?page=wphostel_options2,3867.97157.3549.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_wphostel_rooms
    • wp_wphostel_emaillog
    • wp_wphostel_payments
    • wp_wphostel_bookings
  • Zombie WordPress options detected upon uninstall: 10 options
    • theysaidso_admin_options
    • widget_recent-comments
    • wphostel_currency
    • wphostel_max_date
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • wphostel_version
    • wphostel_datepicker_css
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=wphostel_bookings
    • > Notice in wp-content/plugins/hostel/controllers/bookings.php+7
    Undefined index: do
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphostel_options
    • > Notice in wp-content/plugins/hostel/views/options.php+77
    Trying to access array offset on value of type bool

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/hostel/views/ical.html.php
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: shortcode_id in wp-content/plugins/hostel/views/booking-form.html.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hostel/views/sidebar.html.php:21
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/hostel/views/ical.html.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hostel/views/help.html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hostel/views/pay-paypal.html.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hostel/views/options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hostel/views/room.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hostel/views/booking-form.html.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wphostel_resp_table_css() in wp-content/plugins/hostel/views/bookings.html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hostel/views/list-rooms.html.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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
8 plugin tags: booking, hostel, hotel, touch, bnb...

hostel/hostel.php 92% from 13 tests

"Hostel" version 1.1.5.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,898 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP284352352,083
PO File1231234712
JavaScript113974
CSS18029

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity27.78
▷ Minimum class complexity6.00
▷ Maximum class complexity60.00
Average method complexity6.24
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods46
▷ Static methods3065.22%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin