77% search-boxes-integration-for-booking-affiliates

Code Review | Search boxes integration for Booking affiliates

WordPress plugin Search boxes integration for Booking affiliates scored77%from 54 tests.

About plugin

  • Plugin page: search-boxes-inte...
  • Plugin version: 0.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 10, 2016
  • Latest release: Apr 10, 2016
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: jcmoscardo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,179 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.19MB] [CPU: ▼4.92ms] Passed 4 tests

A check of server-side resources used by Search boxes integration for Booking affiliates
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1745.95 ▲2.39
Dashboard /wp-admin3.50 ▲0.2056.43 ▲3.16
Posts /wp-admin/edit.php3.61 ▲0.2554.29 ▼2.70
Add New Post /wp-admin/post-new.php6.08 ▲0.1990.57 ▼21.72
Media Library /wp-admin/upload.php3.43 ▲0.2039.99 ▲2.35
Search boxes integration for Booking /wp-admin/options-general.php?page=basb-settings-page3.3937.32

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_booking_affiliate_box_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Search boxes integration for Booking affiliates
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,001 ▲24013.81 ▼0.928.42 ▲6.8342.41 ▲2.08
Dashboard /wp-admin2,331 ▲1575.72 ▲0.0583.26 ▼12.9137.65 ▼1.53
Posts /wp-admin/edit.php2,233 ▲1332.04 ▲0.0536.58 ▼4.4533.58 ▼4.51
Add New Post /wp-admin/post-new.php6,410 ▲4,88425.92 ▲2.79911.19 ▲259.3563.35 ▲10.80
Media Library /wp-admin/upload.php1,536 ▲1394.17 ▼0.0097.19 ▼6.4241.85 ▼4.31
Search boxes integration for Booking /wp-admin/options-general.php?page=basb-settings-page1,1481.6729.5340.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_booking_affiliate_box_widget
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/search-boxes-integration-for-booking-affiliates/search-boxes-integration-for-booking-affiliates.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require_once(BASB_PLUGIN_DIR_PATHclasses/class-basb-utils.php): failed to open stream: No such file or directory in wp-content/plugins/search-boxes-integration-for-booking-affiliates/load-all-classes.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/search-boxes-integration-for-booking-affiliates/classes/class-basb-widget.php:3
    • > PHP Warning
      Use of undefined constant BASB_PLUGIN_DIR_PATH - assumed 'BASB_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/search-boxes-integration-for-booking-affiliates/load-all-classes.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'BASB_PLUGIN_DIR_PATHclasses/class-basb-utils.php' (include_path='.:/usr/share/php') in wp-content/plugins/search-boxes-integration-for-booking-affiliates/load-all-classes.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (First of all you need to login "Booking.com Affiliate Partner Center" and create your search boxes.), #2 (Copy and paste the code in the plugin setting page.), #3 (Use the this tool to add your shortcodes easily.), #4 (This plugin is also integrated with Visual Composer plugin.), #5 (Demo page with shortcode samples and widget.)
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt might help

search-boxes-integration-for-booking-affiliates/search-boxes-integration-for-booking-affiliates.php 85% from 13 tests

The main PHP file in "Search boxes integration for Booking affiliates" ver. 0.5.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 175 characters long)
  • 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 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin775 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP910661756
CSS13019

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity14.29
▷ Minimum class complexity2.00
▷ Maximum class complexity25.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods54
▷ Static methods2342.59%
▷ Public methods5398.15%
▷ Protected methods00.00%
▷ Private methods11.85%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants15
▷ Global constants15100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.84MB with 0.56MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png51.14KB17.93KB▼ 64.94%
screenshot-2.png372.14KB111.96KB▼ 69.91%
screenshot-4.png29.12KB10.69KB▼ 63.30%
screenshot-5.png232.12KB72.42KB▼ 68.80%
screenshot-1.png170.96KB53.03KB▼ 68.98%