10% send-booking-invites-to-friends

Code Review | Send to a Friend Addon

WordPress plugin Send to a Friend Addon scored10%from 54 tests.

About plugin

  • Plugin page: send-booking-invi...
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Nov 25, 2015
  • Latest release: Jul 14, 2020
  • Number of updates: 17
  • Update frequency: every 99.6 days
  • Top authors: pinal.shah (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /929 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/send-booking-invites-to-friends/bkap-send-to-friend.php+21
    include_once(wp-content/plugins/woocommerce-booking/bkap-common.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼1.55MB] [CPU: ▼53.92ms] Passed 4 tests

Server-side resources used by Send to a Friend Addon
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.45 ▼1.027.22 ▼31.07
Dashboard /wp-admin2.47 ▼0.887.88 ▼60.51
Posts /wp-admin/edit.php2.47 ▼0.897.99 ▼41.33
Add New Post /wp-admin/post-new.php2.47 ▼3.428.55 ▼82.78
Media Library /wp-admin/upload.php2.47 ▼0.768.31 ▼25.39

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 16 new options
New WordPress options
widget_recent-posts
bkap_friend_availability_msg_multiple_days
db_upgraded
bkap_friend_availability_msg_single_days
can_compress_scripts
bkap_friend_availability_msg_date_time
widget_theysaidso_widget
bkap_friend_enable_send_a_friend
bkap_friend_button_css
bkap_friend_email_button_text
...

Browser metrics Passed 4 tests

Checking browser requirements for Send to a Friend Addon
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.47 ▲0.191.69 ▲0.0640.57 ▲2.90
Dashboard /wp-admin2,210 ▲224.85 ▼1.04110.30 ▼8.8142.53 ▼3.67
Posts /wp-admin/edit.php2,095 ▲62.03 ▲0.0640.09 ▼1.0736.60 ▼1.80
Add New Post /wp-admin/post-new.php1,524 ▼923.03 ▼0.04676.56 ▲24.6063.57 ▲7.50
Media Library /wp-admin/upload.php1,392 ▲44.21 ▲0.0596.92 ▼3.5946.17 ▲1.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/send-booking-invites-to-friends/bkap-send-to-friend.php+21
    include_once(wp-content/plugins/woocommerce-booking/bkap-common.php): failed to open stream: No such file or directory
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/send-booking-invites-to-friends/bkap-send-to-friend.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Session_Handler' not found in wp-content/plugins/send-booking-invites-to-friends/request-friend.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Send to a Friend Addon Settings.), #2 (Order Received Page.), #3 (Tell a Friend page.), #4 (Email sent to a friend.)
You can look at the official readme.txt

send-booking-invites-to-friends/bkap-send-to-friend.php 77% from 13 tests

The primary PHP file in "Send to a Friend Addon" version 1.4.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("1.4" instead of "3.0.0")
  • Description: Please don't use more than 140 characters for the plugin description (currently 305 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("send-booking-invites-to-friends.php" instead of "bkap-send-to-friend.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,302 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP42103981,300
Markdown1002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity87.00
▷ Minimum class complexity15.00
▷ Maximum class complexity159.00
Average method complexity7.37
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods27
▷ Static methods13.70%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.16MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png33.23KB11.16KB▼ 66.42%
screenshot-3.png32.78KB10.68KB▼ 67.41%
screenshot-2.png26.84KB8.30KB▼ 69.08%
screenshot-1.png76.01KB27.25KB▼ 64.16%