10% vacation-rentals

Code Review | Vacation Rentals

WordPress plugin Vacation Rentals scored 10% from 54 tests.

About plugin

  • Plugin page: vacation-rentals
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.4.0
  • WordPress version: 6.3.1
  • First release: May 27, 2016
  • Latest release: Mar 7, 2020
  • Number of updates: 10
  • Update frequency: every 138.4 days
  • Top authors: mrahmadawais (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,794 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/vacation-rentals/assets/booking/class-submit-booking.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; VR_Submit_Booking has a deprecated constructor

Server metrics [RAM: ▼1.51MB] [CPU: ▼47.74ms] Passed 4 tests

An overview of server-side resources used by Vacation Rentals
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.45 ▼1.017.07 ▼35.36
Dashboard /wp-admin2.50 ▼0.8013.43 ▼39.28
Posts /wp-admin/edit.php2.51 ▼0.8410.46 ▼34.38
Add New Post /wp-admin/post-new.php2.50 ▼3.388.66 ▼81.92
Media Library /wp-admin/upload.php2.51 ▼0.729.20 ▼24.68
→ Add New /wp-admin/post-new.php?post_type=vr_rental2.509.78
♆ Types /wp-admin/edit-tags.php?taxonomy=vr_rental-type&post_type=vr_rental2.5111.53
⦿ Features /wp-admin/edit-tags.php?taxonomy=vr_rental-feature&post_type=vr_rental2.519.87
Rentals /wp-admin/edit.php?post_type=vr_rental2.5110.85
⑆ Agents /wp-admin/edit.php?post_type=vr_agent2.519.23
⇲ Destinations /wp-admin/edit-tags.php?taxonomy=vr_rental-destination&post_type=vr_rental2.5110.79
Categories Images /wp-admin/options-general.php?page=zci-options2.5110.07
⎃ Bookings /wp-admin/edit.php?post_type=vr_booking2.519.11
⏣ Settings /wp-admin/admin.php?page=vacation_rentals_settings2.508.88

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 376 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
vr_general_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for Vacation Rentals
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,164 ▲42915.68 ▲1.3218.07 ▲15.9539.17 ▼17.05
Dashboard /wp-admin2,418 ▲2306.39 ▲1.31137.16 ▲30.7649.36 ▲1.51
Posts /wp-admin/edit.php2,324 ▲2323.33 ▲1.3354.98 ▲18.5543.68 ▲10.40
Add New Post /wp-admin/post-new.php1,587 ▲7323.15 ▲5.51638.94 ▲22.8336.34 ▼12.70
Media Library /wp-admin/upload.php1,463 ▲754.12 ▼0.0680.78 ▼20.8846.72 ▲2.10
→ Add New /wp-admin/post-new.php?post_type=vr_rental3,40711.25340.19112.97
♆ Types /wp-admin/edit-tags.php?taxonomy=vr_rental-type&post_type=vr_rental1,6143.3841.0848.20
⦿ Features /wp-admin/edit-tags.php?taxonomy=vr_rental-feature&post_type=vr_rental1,6133.4041.2343.87
Rentals /wp-admin/edit.php?post_type=vr_rental1,4113.4042.7734.04
⑆ Agents /wp-admin/edit.php?post_type=vr_agent1,3213.3746.6137.39
⇲ Destinations /wp-admin/edit-tags.php?taxonomy=vr_rental-destination&post_type=vr_rental1,6183.3441.6041.83
Categories Images /wp-admin/options-general.php?page=zci-options1,0713.1737.9533.05
⎃ Bookings /wp-admin/edit.php?post_type=vr_booking1,3283.4442.8138.51
⏣ Settings /wp-admin/admin.php?page=vacation_rentals_settings1,1603.3844.5634.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/vacation-rentals/assets/booking/class-submit-booking.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; VR_Submit_Booking has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • vr_general_settings
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vacation_rentals_settings
    • > Deprecated in wp-content/plugins/vacation-rentals/assets/booking/class-submit-booking.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; VR_Submit_Booking has a deprecated constructor
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vacation_rentals_settings
    • > Deprecated in wp-content/plugins/vacation-rentals/assets/member/class-submit-post.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; VR_Submit_Post has a deprecated constructor
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vacation_rentals_settings
    • > Deprecated in wp-content/plugins/vacation-rentals/assets/settings/class-vr-settings.php+203
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=zci-options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=zci-options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/vacation-rentals/assets/admin/ocdi/ocdi-init.php
    • > /wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/templates/media.php
    • > /wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/templates/upload.php
    • > /wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/templates/video.php
  • 56× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/walkers/base.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Choice_Field' not found in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/fields/input-list.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Text_Field' not found in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/fields/password.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_List_Field' not found in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/fields/radio.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Media_Field' not found in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/fields/image-advanced.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Object_Choice_Field' not found in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/fields/taxonomy.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/functions.php:137
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Multiple_Values_Field' not found in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/fields/autocomplete.php:11
    • > PHP Warning
      Use of undefined constant VRC_DIR - assumed 'VRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/vacation-rentals/assets/plugin/category-images/category-images.php on line 22
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/vacation-rentals/assets/meta-boxes/meta-box/inc/fields/file.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=vr_rental
    • > Console-api (warning) in unknown
    https://maps.google.com/maps/api/js?key=AIzaSyC6-3I3Kkns3Qjav-Ph2TdXQT-jrQxYe3s&ver=6.3.1 208: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"
    • > GET request to /wp-admin/post-new.php?post_type=vr_rental
    • > Console-api (severe) in unknown
    https://maps.google.com/maps/api/js?key=AIzaSyC6-3I3Kkns3Qjav-Ph2TdXQT-jrQxYe3s&ver=6.3.1 128:245 "Google Maps JavaScript API error: InvalidKeyMapError\nhttps://developers.google.com/maps/documentation/javascript/error-messages#invalid-key-map-error"
    • > GET request to /wp-admin/post-new.php?post_type=vr_rental
    • > Javascript (severe) in unknown
    https://maps.google.com/maps-api-v3/api/js/54/7a/map.js 1:188 Uncaught TypeError: Cannot read properties of undefined (reading 'hasAttribute')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

vacation-rentals/vacation-rentals.php 92% from 13 tests

"Vacation Rentals" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin32,263 lines of code in 330 files:
LanguageFilesBlank linesComment linesLines of code
XML1891611,314
PHP1703,4358,06310,895
JavaScript941,3271,7155,728
CSS361451131,798
PO File146326981,697
Sass81427745
Markdown317046
JSON40040

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity7.85
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes122
▷ Abstract classes64.92%
▷ Concrete classes11695.08%
▷ Final classes00.00%
Methods516
▷ Static methods26250.78%
▷ Public methods49896.51%
▷ Protected methods183.49%
▷ Private methods00.00%
Functions60
▷ Named functions4981.67%
▷ Anonymous functions1118.33%
Constants10
▷ Global constants10100.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
17 PNG files occupy 0.13MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/meta-boxes/meta-box/img/jqueryui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
assets/admin/welcome/assets/img/design.png49.43KB19.14KB▼ 61.28%
assets/admin/welcome/assets/img/options.png51.66KB20.04KB▼ 61.21%
assets/admin/welcome/assets/img/logo.png9.19KB4.09KB▼ 55.51%
assets/meta-boxes/meta-box/img/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%