10% woocommerce-sendinblue-newsletter-subscription

Code Review | Brevo (formely Sendinblue) for WooCommerce

WordPress plugin Brevo (formely Sendinblue) for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: woocommerce-sendi...
  • Plugin version: 4.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3
  • WordPress version: 6.3.1
  • First release: May 22, 2014
  • Latest release: Nov 17, 2023
  • Number of updates: 132
  • Update frequency: every 26.3 days
  • Top authors: neeraj_slit (53.79%)amarsib (24.24%)prikuma (7.58%)ksendinblue (7.58%)gouravgupta24 (5.3%)

Code review

54 tests

User reviews

33 reviews

Install metrics

20,000+ active /578,910 total downloads

Benchmarks

Plugin footprint 58% 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
  • Install procedure validation failed for this plugin
    • > User error in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/woocommerce-sendinblue.php+192
    Please install and activate WooCommerce 3.1 or newer before this.

Server metrics [RAM: ▲0.67MB] [CPU: ▲2.83ms] Passed 4 tests

Server-side resources used by Brevo (formely Sendinblue) for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.18 ▲0.7143.57 ▲1.35
Dashboard /wp-admin4.00 ▲0.7049.53 ▼0.24
Posts /wp-admin/edit.php4.05 ▲0.6952.22 ▲2.61
Add New Post /wp-admin/post-new.php6.56 ▲0.6887.62 ▲8.78
Media Library /wp-admin/upload.php3.86 ▲0.6339.72 ▲7.58

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Brevo (formely Sendinblue) for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3014.24 ▼0.132.00 ▲0.1944.15 ▼1.62
Dashboard /wp-admin2,195 ▲155.63 ▼0.2388.43 ▼3.2338.77 ▼8.34
Posts /wp-admin/edit.php2,100 ▼31.98 ▼0.0339.49 ▼0.8135.24 ▲1.04
Add New Post /wp-admin/post-new.php1,526 ▼023.55 ▲0.37697.29 ▲12.5967.06 ▲13.96
Media Library /wp-admin/upload.php1,403 ▲34.17 ▼0.0195.11 ▼1.4141.27 ▼1.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/views/admin_view.php
    • > /wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/views/admin_menus.php
  • 25× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'SENDINBLUE_WC_ROOT_PATH/src/managers/cart-events-manager.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/api-manager.php on line 16
    • > PHP Warning
      Use of undefined constant SENDINBLUE_WC_ROOT_PATH - assumed 'SENDINBLUE_WC_ROOT_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/orders-manager.php on line 9
    • > PHP Warning
      Use of undefined constant SENDINBLUE_WC_ROOT_PATH - assumed 'SENDINBLUE_WC_ROOT_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/admin-manager.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'SENDINBLUE_WC_ROOT_PATH/src/managers/api-manager.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/admin-manager.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'SENDINBLUE_WC_ROOT_PATH/src/managers/api-manager.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/orders-manager.php on line 9
    • > PHP Warning
      require_once(SENDINBLUE_WC_ROOT_PATH/src/managers/api-manager.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/update-plugin-manager.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/views/admin_view.php:721
    • > PHP Fatal error
      require_once(): Failed opening required 'SENDINBLUE_WC_ROOT_PATH/src/managers/api-manager.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/products-manager.php on line 9
    • > PHP Warning
      Use of undefined constant SENDINBLUE_WC_ROOT_PATH - assumed 'SENDINBLUE_WC_ROOT_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/products-manager.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'SENDINBLUE_WC_ROOT_PATH/src/clients/automation-client.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-sendinblue-newsletter-subscription/src/managers/cart-events-manager.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

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
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Click on “Connect your account” to link WooCommerce and your Brevo account.), #2 (Once it’s done, you can click on “Go to dashboard” to directly land on your Brevo account.), #3 (Click on the relevant button to see your campaigns, your workflows, and your conversations.), #4 (You can access your settings by clicking on “Settings” at the top right of the screen.)
  • Tags: Too many tags (22 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

woocommerce-sendinblue-newsletter-subscription/woocommerce-sendinblue.php 85% from 13 tests

The main PHP file in "Brevo (formely Sendinblue) for WooCommerce" ver. 4.0.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woocommerce-sendinblue-newsletter-subscription.php" instead of "woocommerce-sendinblue.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.3.1" instead of "4.3")

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 detected5,058 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP144561134,986
PO File1252872

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity47.20
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity5.19
▷ Minimum method complexity1.00
▷ Maximum method complexity95.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods111
▷ Static methods00.00%
▷ Public methods6054.05%
▷ Protected methods00.00%
▷ Private methods5145.95%
Functions29
▷ Named functions931.03%
▷ Anonymous functions2068.97%
Constants117
▷ Global constants1210.26%
▷ Class constants10589.74%
▷ Public constants8278.10%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 4.28MB with 3.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png570.13KB150.60KB▼ 73.58%
screenshot-1.png2,681.80KB867.86KB▼ 67.64%
screenshot-2.png562.76KB149.63KB▼ 73.41%
screenshot-3.png573.04KB153.18KB▼ 73.27%