84% subre-product-subscription-for-woo

Code Review | SUBRE – Product Subscription for WooCommerce - Recurring Payments

WordPress plugin SUBRE – Product Subscription for WooCommerce - Recurring Payments scored84%from 54 tests.

About plugin

  • Plugin page: subre-product-sub...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 8, 2023
  • Latest release: Nov 8, 2023
  • Number of updates: 7
  • Update frequency: every 40.0 days
  • Top authors: thanhtd (85.71%)villatheme (28.57%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /791 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.55ms] Passed 4 tests

This is a short check of server-side resources used by SUBRE – Product Subscription for WooCommerce - Recurring Payments
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1835.53 ▲0.12
Dashboard /wp-admin3.48 ▲0.1349.59 ▼12.64
Posts /wp-admin/edit.php3.59 ▲0.2349.08 ▼2.68
Add New Post /wp-admin/post-new.php6.06 ▲0.1793.90 ▲2.30
Media Library /wp-admin/upload.php3.40 ▲0.1736.13 ▲1.02

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 117 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
woocommerce_queue_flush_rewrite_rules

Browser metrics Passed 4 tests

An overview of browser requirements for SUBRE – Product Subscription for WooCommerce - Recurring Payments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6214.31 ▲0.161.85 ▲0.1141.81 ▼2.17
Dashboard /wp-admin2,204 ▲245.59 ▼0.0291.18 ▲4.0042.28 ▲2.60
Posts /wp-admin/edit.php2,113 ▲131.97 ▼0.0340.56 ▼0.2836.05 ▲0.83
Add New Post /wp-admin/post-new.php1,535 ▲923.04 ▼0.50596.66 ▼48.2252.38 ▲7.50
Media Library /wp-admin/upload.php1,412 ▲94.27 ▲0.05100.09 ▲2.5444.40 ▲2.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • woocommerce_queue_flush_rewrite_rules
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function subre_get_subscription_view_link() in wp-content/plugins/subre-product-subscription-for-woo/templates/emails/subscription-renewal-info.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_rtl() in wp-content/plugins/subre-product-subscription-for-woo/templates/emails/subscriptions-list.php:11
    • > PHP Notice
      Undefined variable: sent_to_admin in wp-content/plugins/subre-product-subscription-for-woo/templates/emails/subscription-renewal-info.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: recurring, woocommerce, subscribe, expire, sign-up...

subre-product-subscription-for-woo/subre-product-subscription-for-woo.php Passed 13 tests

"SUBRE – Product Subscription for WooCommerce - Recurring Payments" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
123 characters long description:
Convert WooCommerce simple products(physical or downloadable/virtual) to subscription products and allow recurring payments

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected14,807 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript121,3623757,417
PHP527911,6536,259
SVG100565
CSS3060133397
Sass7290169

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity24.27
▷ Minimum class complexity1.00
▷ Maximum class complexity108.00
Average method complexity3.80
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods274
▷ Static methods7326.64%
▷ Public methods25894.16%
▷ Protected methods20.73%
▷ Private methods145.11%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16100.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
No PNG files were detected