72% solidres

Code Review | Solidres - Hotel booking plugin for WordPress

WordPress plugin Solidres - Hotel booking plugin for WordPress scored72%from 54 tests.

About plugin

  • Plugin page: solidres
  • Plugin version: 0.9.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 6.3.1
  • First release: Mar 23, 2015
  • Latest release: Nov 21, 2020
  • Number of updates: 76
  • Update frequency: every 27.3 days
  • Top authors: solidres (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

80+ active /25,808 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.76MB] [CPU: ▲1,040.47ms] 50% from 4 tests

This is a short check of server-side resources used by Solidres - Hotel booking plugin for WordPress
Please fix the following
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,396.30ms on /wp-admin/admin.php?page=sr-countries)
  • Extra CPU: Try to keep extra CPU usage under 200.00ms (currently 1,040.47ms on /wp-admin/admin.php?page=sr-countries)
PageMemory (MB)CPU Time (ms)
Home /5.45 ▲1.9962.31 ▲22.22
Dashboard /wp-admin6.34 ▲3.041,464.92 ▲1,409.84
Posts /wp-admin/edit.php6.38 ▲3.021,448.63 ▲1,397.12
Add New Post /wp-admin/post-new.php8.98 ▲3.091,426.70 ▲1,332.70
Media Library /wp-admin/upload.php6.23 ▲3.001,447.66 ▲1,411.58
Limit bookings /wp-admin/admin.php?page=sr-limit-bookings6.141,399.21
Categories /wp-admin/admin.php?page=sr-categories6.121,400.23
Assets /wp-admin/admin.php?page=sr-assets6.121,464.01
Employees /wp-admin/admin.php?page=sr-employees6.141,454.96
Add new country /wp-admin/admin.php?page=sr-add-new-country6.151,364.79
System Info /wp-admin/admin.php?page=sr-systems6.151,655.97
Add new asset /wp-admin/admin.php?page=sr-add-new-asset6.491,429.78
Add new state /wp-admin/admin.php?page=sr-add-new-state6.471,492.49
Room types /wp-admin/admin.php?page=sr-room-types6.121,354.00
Countries /wp-admin/admin.php?page=sr-countries6.411,396.30

Server storage [IO: ▲2.94MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 378 new files
Database: 27 new tables, 9 new options
New tables
wp_sr_extras
wp_sr_reservations
wp_sr_reservation_assets
wp_sr_geo_states
wp_sr_tariffs
wp_sr_config_data
wp_sr_room_type_extra_xref
wp_sr_tariff_details
wp_sr_reservation_room_extra_xref
wp_sr_media_reservation_assets_xref
...
New WordPress options
widget_sr_widget_check_availability
widget_sr_widget_currency
theysaidso_admin_options
solidres_db_version
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Solidres - Hotel booking plugin for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,295 ▲50916.44 ▲1.8117.26 ▲14.7144.07 ▲0.21
Dashboard /wp-admin2,399 ▲2226.15 ▲0.55100.45 ▼1.7143.24 ▲1.31
Posts /wp-admin/edit.php2,323 ▲2203.52 ▲1.4848.08 ▲12.3633.32 ▼4.75
Add New Post /wp-admin/post-new.php1,869 ▲34323.91 ▲0.87690.27 ▲5.0037.67 ▼27.58
Media Library /wp-admin/upload.php1,619 ▲2225.59 ▲1.37109.68 ▼13.2049.85 ▲1.68
Limit bookings /wp-admin/admin.php?page=sr-limit-bookings1,0103.0435.7028.65
Categories /wp-admin/admin.php?page=sr-categories1,2693.5345.8930.29
Assets /wp-admin/admin.php?page=sr-assets2,4003.4157.8834.01
Employees /wp-admin/admin.php?page=sr-employees1,0133.0635.6124.08
Add new country /wp-admin/admin.php?page=sr-add-new-country1,1143.1139.7928.46
System Info /wp-admin/admin.php?page=sr-systems1,4803.2043.0874.64
Add new asset /wp-admin/admin.php?page=sr-add-new-asset4,31610.42224.6670.34
Add new state /wp-admin/admin.php?page=sr-add-new-state2,1183.2140.9929.06
Room types /wp-admin/admin.php?page=sr-room-types1,3703.0749.4927.83
Countries /wp-admin/admin.php?page=sr-countries1,4263.4444.1532.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_sr_widget_check_availability
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_sr_widget_currency

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
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sr-room-types
    • > Warning in wp-content/plugins/solidres/includes/class-sr-list-table.php+86
    count(): Parameter must be an array or an object that implements Countable

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/solidres/templates/emails/reservation_note_notification_customer_html_inliner.php
    • > /wp-content/plugins/solidres/templates/emails/reservation_complete_owner_html_inliner.php
    • > /wp-content/plugins/solidres/templates/emails/reservation_complete_customer_html_inliner.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sr-countries
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?libraries=places&ver=6.3.1 235:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

solidres/solidres.php Passed 13 tests

The principal PHP file in "Solidres - Hotel booking plugin for WordPress" v. 0.9.4 is loaded by WordPress automatically on each request
45 characters long description:
Solidres - Hotel booking plugin for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin45,067 lines of code in 339 files:
LanguageFilesBlank linesComment linesLines of code
PHP1673,5193,58529,767
JavaScript1581,4603,07610,692
CSS135251374,598
SVG11010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity39.12
▷ Minimum class complexity1.00
▷ Maximum class complexity243.00
Average method complexity5.31
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes11.82%
Methods513
▷ Static methods9418.32%
▷ Public methods47893.18%
▷ Protected methods112.14%
▷ Private methods244.68%
Functions79
▷ Named functions7493.67%
▷ Anonymous functions56.33%
Constants64
▷ Global constants5585.94%
▷ Class constants914.06%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
15 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lib/colorbox/images/controls.png1.59KB1.67KB0.00%
assets/images/close_btn.png1.61KB0.76KB▼ 53.06%
assets/images/icon-hotel-4.png0.98KB0.68KB▼ 30.23%
assets/lib/bootstrap/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
assets/images/icon-hotel-5.png1.00KB0.68KB▼ 31.64%