89% bookingcom-official-searchbox

Code Review | Booking.com Official Search Box

WordPress plugin Booking.com Official Search Box scored89%from 54 tests.

About plugin

  • Plugin page: bookingcom-offici...
  • Plugin version: 2.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9
  • WordPress version: 6.3.1
  • First release: May 13, 2014
  • Latest release: May 2, 2022
  • Number of updates: 115
  • Update frequency: every 25.4 days
  • Top authors: SP - Booking.com (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

4,000+ active /101,521 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.21ms] Passed 4 tests

A check of server-side resources used by Booking.com Official Search Box
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.12 ▲4.27
Dashboard /wp-admin3.38 ▲0.0344.62 ▼11.97
Posts /wp-admin/edit.php3.43 ▲0.0746.39 ▼0.04
Add New Post /wp-admin/post-new.php5.98 ▲0.0998.08 ▼4.07
Media Library /wp-admin/upload.php3.30 ▲0.0733.74 ▼0.75
Booking.com Search Box /wp-admin/options-general.php?page=bos_searchbox3.2733.33

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 71 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_bos_searchbox_widget_class
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Booking.com Official Search Box
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,003 ▲23215.96 ▲1.7017.14 ▲15.3938.13 ▲0.48
Dashboard /wp-admin2,250 ▲586.35 ▲1.42108.03 ▼2.9441.22 ▼2.87
Posts /wp-admin/edit.php2,141 ▲523.27 ▲1.2851.96 ▲10.0547.97 ▲13.26
Add New Post /wp-admin/post-new.php6,312 ▲4,77020.21 ▲1.88959.02 ▲359.1539.73 ▼19.22
Media Library /wp-admin/upload.php1,438 ▲505.76 ▲1.49108.29 ▲5.3141.58 ▼4.92
Booking.com Search Box /wp-admin/options-general.php?page=bos_searchbox2,9354.11112.8982.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_bos_searchbox_widget_class
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Searchbox widget in the Widget section.), #2 (Choose the sidebar which you would like the searchbox to be displayed on ( please choose only one sidebar in order to evoid javascript issues ).), #3 (Here we go! Searchbox installed in your site ( in Content sidebar in this case ). The default searchbox will fit the widget area width.), #4 (If you like, you can customise the searchbox for your needs. A preview feature will help you to check the searchbox layout before going live on the website.), #5 (Meta Boxes in post/page sections.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

bookingcom-official-searchbox/booking-official-searchbox.php 85% from 13 tests

Analyzing the main PHP file in "Booking.com Official Search Box" version 2.3.1
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bookingcom-official-searchbox.php" instead of "booking-official-searchbox.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 390 characters long)

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
No dangerous file extensions were detected8,335 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PO File141,8662,5114,595
CSS396551,633
PHP121602041,521
JavaScript47834586

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants37
▷ Global constants37100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
12 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/booking_logotype_blue_200x33.png8.77KB3.48KB▼ 60.31%
assets/images/Calendar-2x.png0.45KB0.26KB▼ 43.17%
assets/images/bos_info_icon.png1.31KB0.45KB▼ 65.94%
assets/images/Bed-2x.png0.58KB0.38KB▼ 35.89%
assets/images/bos_lock_closed_icon.png1.17KB0.41KB▼ 65.08%