78% retainful-next-order-coupon-for-woocommerce

Code Review | Retainful - WooCommerce Abandoned Cart Recovery, Order Follow Up Emails, Email Marketing Automation, Next Order Coupons & Referrals

WordPress plugin Retainful - WooCommerce Abandoned Cart Recovery, Order Follow Up Emails, Email Marketing Automation, Next Order Coupons & Referrals scored78%from 54 tests.

About plugin

  • Plugin page: retainful-next-or...
  • Plugin version: 2.6.25
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 10, 2019
  • Latest release: Sep 27, 2023
  • Number of updates: 241
  • Update frequency: every 7.1 days
  • Top authors: retainful (100%)

Code review

54 tests

User reviews

31 reviews

Install metrics

3,000+ active /123,480 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.00MB] [CPU: ▼7.45ms] Passed 4 tests

This is a short check of server-side resources used by Retainful - WooCommerce Abandoned Cart Recovery, Order Follow Up Emails, Email Marketing Automation, Next Order Coupons & Referrals
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.07 ▼5.82
Dashboard /wp-admin3.31 ▲0.0048.32 ▲0.38
Posts /wp-admin/edit.php3.36 ▲0.0052.17 ▲0.56
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.20 ▼21.99
Media Library /wp-admin/upload.php3.23 ▲0.0036.69 ▼2.35

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 123 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Retainful - WooCommerce Abandoned Cart Recovery, Order Follow Up Emails, Email Marketing Automation, Next Order Coupons & Referrals: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.18 ▼0.191.71 ▼0.1440.88 ▼3.52
Dashboard /wp-admin2,195 ▲245.66 ▼0.0984.14 ▼4.4940.44 ▼2.19
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0040.20 ▲3.0435.98 ▼4.41
Add New Post /wp-admin/post-new.php1,532 ▼323.21 ▲0.05627.34 ▼4.7155.40 ▲1.19
Media Library /wp-admin/upload.php1,403 ▲34.27 ▲0.1297.99 ▼5.8945.75 ▲2.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 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
Please fix the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/admin/templates/applied_coupon_popup.php
    • > /wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/exit-intent-popups/default.php
    • > /wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/exit-intent-popups/default_email_collection.php
  • 90× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: is_timer_started in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/timer/above_cart.php on line 11
    • > PHP Notice
      Undefined variable: rnoc_coupon_timer_message in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/timer/top.php on line 2
    • > PHP Notice
      Undefined variable: rnoc_exit_intent_modal_heading_color in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/exit_intent_popup.php on line 4
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/templates/referral.php on line 23
    • > PHP Notice
      Undefined variable: coupon_timer_position in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/timer/top.php on line 1
    • > PHP Notice
      Undefined variable: add_on_slug in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/popup_display.php on line 1
    • > PHP Notice
      Undefined variable: expired_in_min in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/timer/below_discount.php on line 21
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/templates/referral.php on line 15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/templates/referral.php on line 11
    • > PHP Notice
      Undefined variable: coupon_timer_position in wp-content/plugins/retainful-next-order-coupon-for-woocommerce/src/premium/templates/timer/below_discount.php on line 34

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: Please take inspiration from this readme.txt

retainful-next-order-coupon-for-woocommerce/retainful-next-order-coupon-for-woocommerce.php 92% from 13 tests

The entry point to "Retainful - WooCommerce Abandoned Cart Recovery, Order Follow Up Emails, Email Marketing Automation, Next Order Coupons & Referrals" version 2.6.25 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.6.1" instead of "4.7.0")

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 plugin22,156 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
PHP941,1004,34217,854
JavaScript7712001,332
Markdown221101,219
CSS3113311,165
Sass1121423
JSON500163

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity59.27
▷ Minimum class complexity1.00
▷ Maximum class complexity254.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces16
Interfaces0
Traits0
Classes37
▷ Abstract classes38.11%
▷ Concrete classes3491.89%
▷ Final classes00.00%
Methods755
▷ Static methods374.90%
▷ Public methods68390.46%
▷ Protected methods648.48%
▷ Private methods81.06%
Functions14
▷ Named functions750.00%
▷ Anonymous functions750.00%
Constants18
▷ Global constants1583.33%
▷ Class constants316.67%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/premium/assets/images/exit-intent-popup/default.png21.55KB11.12KB▼ 48.41%
src/premium/assets/images/exit-intent-popup/default_email_collection.png30.24KB16.25KB▼ 46.27%