78% beds24-online-booking

Code Review | Beds24 Online Booking

WordPress plugin Beds24 Online Booking scored78%from 54 tests.

About plugin

  • Plugin page: beds24-online-boo...
  • Plugin version: 2.0.23
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 29, 2012
  • Latest release: Sep 1, 2022
  • Number of updates: 102
  • Update frequency: every 35.3 days
  • Top authors: markkinchin (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /50,900 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.25MB] [CPU: ▼1.69ms] Passed 4 tests

An overview of server-side resources used by Beds24 Online Booking
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2547.76 ▲8.10
Dashboard /wp-admin3.55 ▲0.2552.01 ▼3.16
Posts /wp-admin/edit.php3.67 ▲0.3151.56 ▼1.56
Add New Post /wp-admin/post-new.php6.15 ▲0.2788.54 ▼7.27
Media Library /wp-admin/upload.php3.48 ▲0.2539.34 ▲5.22
Beds24 /wp-admin/options-general.php?page=beds24-admin-menu3.4737.91

Server storage [IO: ▲0.14MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/beds24-online-booking/" and "wp-content/uploads/"
    • (new file) wp-content/plugins/activation_output_buffer.html
Filesystem: 43 new files
Database: no new tables, 28 new options
New WordPress options
beds24_target
widget_beds24_widget
beds24_color
beds24_advancedays
beds24_referer
beds24_numnight
beds24_hidecalendar
beds24_custom
beds24_layout
beds24_ownerid
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Beds24 Online Booking
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲18013.66 ▼0.7111.16 ▲9.3541.81 ▼4.00
Dashboard /wp-admin2,220 ▲434.85 ▼0.7887.68 ▼4.2936.91 ▼8.47
Posts /wp-admin/edit.php2,124 ▲242.31 ▲0.3235.77 ▲0.4630.65 ▼8.57
Add New Post /wp-admin/post-new.php1,554 ▲2818.46 ▼4.55621.57 ▼76.0534.44 ▼21.12
Media Library /wp-admin/upload.php1,425 ▲224.45 ▲0.27100.54 ▼5.9442.91 ▼2.55
Beds24 /wp-admin/options-general.php?page=beds24-admin-menu5,7152.3362.8744.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • widget_beds24_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 9× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/beds24-online-booking/inc/plugin-options/plugin-languages.php
    • > /wp-content/plugins/beds24-online-booking/inc/plugin-options/plugin-documentation.php
    • > /wp-content/plugins/beds24-online-booking/theme-files/beds24-searchbox.php
    • > /wp-content/plugins/beds24-online-booking/theme-files/beds24-box.php
    • > /wp-content/plugins/beds24-online-booking/theme-files/beds24-strip.php
    • > /wp-content/plugins/beds24-online-booking/theme-files/beds24-prop-xml.php
    • > /wp-content/plugins/beds24-online-booking/inc/plugin-options/plugin-adminfooter.php
    • > /wp-content/plugins/beds24-online-booking/inc/plugin-options/plugin-agency.php
    • > /wp-content/plugins/beds24-online-booking/inc/plugin-options/plugin-about.php
  • 252× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: translate in wp-content/plugins/beds24-online-booking/theme-files/beds24-strip.php on line 44
    • > PHP Notice
      Undefined variable: translate in wp-content/plugins/beds24-online-booking/theme-files/beds24-box.php on line 34
    • > PHP Notice
      Undefined index: category4 in wp-content/plugins/beds24-online-booking/theme-files/beds24-searchbox.php on line 183
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/beds24-online-booking/theme-files/beds24-prop-post.php on line 5
    • > PHP Notice
      Undefined variable: translate in wp-content/plugins/beds24-online-booking/theme-files/beds24-strip.php on line 33
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/beds24-online-booking/theme-files/beds24-box.php on line 24
    • > PHP Notice
      Undefined variable: translate in wp-content/plugins/beds24-online-booking/theme-files/beds24-strip.php on line 33
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/beds24-online-booking/theme-files/beds24-box.php on line 34
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/beds24-online-booking/theme-files/beds24-box.php on line 34
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/beds24-online-booking/theme-files/beds24-strip.php on line 44

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 20 tag instead of maximum 10
The official readme.txt is a good inspiration

beds24-online-booking/beds24-online-booking.php 92% from 13 tests

Analyzing the main PHP file in "Beds24 Online Booking" version 2.0.23
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 580 characters long)

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
No dangerous file extensions were detected3,879 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP17289612,879
JavaScript2110578732
CSS2380268

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
theme-files/include/ic_calendar.png1.67KB0.90KB▼ 46.44%
theme-files/include/ic_calendar2.png0.68KB0.76KB0.00%