78% accommodation-system

Code Review | Accommodation System

WordPress plugin Accommodation System scored 78% from 54 tests.

About plugin

  • Plugin page: accommodation-system
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 5.9.2
  • First release: Feb 29, 2020
  • Latest release: Jan 5, 2021
  • Number of updates: 7
  • Update frequency: every 45.6 days
  • Top authors: idplusplus (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 776 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲2.11MB] [CPU: ▼276.64ms] Passed 4 tests

An overview of server-side resources used by Accommodation System
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.68 ▲2.1669.58 ▲18.65
Dashboard /wp-admin5.50 ▲2.09110.94 ▲24.47
Posts /wp-admin/edit.php5.79 ▲2.1548.52 ▲10.40
Add New Post /wp-admin/post-new.php9.02 ▲2.05108.06 ▼1,149.68
Media Library /wp-admin/upload.php5.44 ▲2.1539.65 ▲14.06

Server storage [IO: ▲3.81MB] [DB: ▲0.05MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 397 new files
Database: 14 new tables, no new options
New tables
wp_hotel_has_booking_service
wp_hotel_has_pricing
wp_hotel_has_country
wp_hotel_has_booking_room
wp_hotel_has_booking
wp_hotel_has_sync
wp_hotel_has_service
wp_hotel_has_settings
wp_hotel_has_amenity
wp_hotel_has_room
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Accommodation System
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,013 ▲26820.76 ▲5.08312.21 ▲305.776.10 ▲3.65
Dashboard /wp-admin2,907 ▲465.98 ▼0.16120.27 ▼15.93185.83 ▲21.92
Posts /wp-admin/edit.php2,708 ▲173.11 ▼0.1261.44 ▼3.50210.51 ▲65.34
Add New Post /wp-admin/post-new.php1,687 ▲2617.07 ▲1.08481.76 ▲50.78197.98 ▲4.79
Media Library /wp-admin/upload.php1,719 ▲215.68 ▲0.18124.11 ▼32.82208.50 ▲12.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/accommodation-system/includes/models/tables.php
    • > /wp-content/plugins/accommodation-system/accommodation-system.php
    • > /wp-content/plugins/accommodation-system/layouts/frontend/module-payment-success.php
  • 198× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\SingletonApiResource' not found in wp-content/plugins/accommodation-system/includes/libraries/stripe/lib/Balance.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accommodation-system/includes/libraries/stripe/lib/Issuing/Cardholder.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Reception' not found in wp-content/plugins/accommodation-system/layouts/backend/reception/room-availability.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accommodation-system/includes/libraries/stripe/lib/CountrySpec.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accommodation-system/includes/libraries/stripe/lib/Plan.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\OAuth\\OAuthErrorException' not found in wp-content/plugins/accommodation-system/includes/libraries/stripe/lib/Exception/OAuth/InvalidScopeException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accommodation-system/includes/libraries/stripe/lib/BitcoinReceiver.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accommodation-system/includes/libraries/stripe/lib/FileUpload.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accommodation-system/includes/libraries/stripe/lib/Source.php:49
    • > PHP Fatal error
      Uncaught Error: Class 'Reception' not found in wp-content/plugins/accommodation-system/layouts/backend/rooms/room-floor-delete.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Donate link: Invalid URI found ("")
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6 in accommodation-system/assets to your readme.txt
You can take inspiration from this readme.txt

accommodation-system/accommodation-system.php 92% from 13 tests

The primary PHP file in "Accommodation System" version 1.0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 204 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Please fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/accommodation-system/includes/libraries/stripe/data/ca-certificates.crt
55,920 lines of code in 296 files:
LanguageFilesBlank linesComment linesLines of code
CSS391,67839026,337
PHP2353,2556,60717,499
JavaScript181,2659649,972
SVG2031,921
HTML230191

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.21
Average class complexity5.10
▷ Minimum class complexity1.00
▷ Maximum class complexity141.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces13
Interfaces5
Traits7
Classes221
▷ Abstract classes104.52%
▷ Concrete classes21195.48%
▷ Final classes10.47%
Methods655
▷ Static methods29645.19%
▷ Public methods59590.84%
▷ Protected methods203.05%
▷ Private methods406.11%
Functions8
▷ Named functions337.50%
▷ Anonymous functions562.50%
Constants614
▷ Global constants20.33%
▷ Class constants61299.67%
▷ Public constants612100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
84 compressed PNG files occupy 0.14MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/backend/icheck/square/orange@2x.png4.37KB3.04KB▼ 30.35%
assets/css/frontend/icons/no-pets.png0.90KB1.23KB0.00%
assets/css/backend/icons/has-g-32.png0.92KB0.85KB▼ 7.15%
assets/css/frontend/icons/checkout_cash.png2.28KB1.68KB▼ 26.31%
assets/css/backend/icons/translate/translate.png0.86KB0.92KB0.00%