77% subscriptions-for-woocommerce

Code Review | Subscriptions for WooCommerce - Subscription Plugin for Collecting Recurring Revenue, Sell Membership Subscription Services & Products

WordPress plugin Subscriptions for WooCommerce - Subscription Plugin for Collecting Recurring Revenue, Sell Membership Subscription Services & Products scored77%from 54 tests.

About plugin

  • Plugin page: subscriptions-for...
  • Plugin version: 1.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 9, 2021
  • Latest release: Nov 16, 2023
  • Number of updates: 44
  • Update frequency: every 21.6 days
  • Top authors: wpswings (61.36%)makewebbetter (40.91%)

Code review

54 tests

User reviews

68 reviews

Install metrics

8,000+ active /132,278 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.72ms] Passed 4 tests

This is a short check of server-side resources used by Subscriptions for WooCommerce - Subscription Plugin for Collecting Recurring Revenue, Sell Membership Subscription Services & Products
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.31 ▼4.40
Dashboard /wp-admin3.31 ▲0.0144.05 ▼5.51
Posts /wp-admin/edit.php3.36 ▲0.0146.11 ▼2.88
Add New Post /wp-admin/post-new.php5.89 ▲0.0178.10 ▼18.10
Media Library /wp-admin/upload.php3.23 ▲0.0031.98 ▲1.76

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 151 new files
Database: no new tables, 15 new options
New WordPress options
db_upgraded
wps_sfw_onboarding_data_sent
wps_upgrade_sfw_wp_migration_option_check
wps_sfw_multistep_product_create_done
theysaidso_admin_options
wps_sfw_multistep_done
can_compress_scripts
wps_sfw_place_order_button_text
wps_sfw_onboarding_data_skipped
widget_recent-posts
...

Browser metrics Passed 4 tests

Subscriptions for WooCommerce - Subscription Plugin for Collecting Recurring Revenue, Sell Membership Subscription Services & Products: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.21 ▼0.551.71 ▼0.1337.24 ▼8.32
Dashboard /wp-admin2,198 ▲175.60 ▼0.1490.33 ▼15.7538.29 ▼9.11
Posts /wp-admin/edit.php2,103 ▼02.03 ▲0.0740.99 ▲4.0836.97 ▲2.40
Add New Post /wp-admin/post-new.php1,526 ▼022.84 ▼0.41591.10 ▼72.7451.63 ▲5.05
Media Library /wp-admin/upload.php1,397 ▼64.21 ▼0.00101.57 ▲3.6845.16 ▲3.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 15 options
    • wps_sfw_onboarding_data_skipped
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • wps_sfw_onboarding_data_sent
    • widget_recent-posts
    • wps_sfw_enable_tracking
    • can_compress_scripts
    • widget_theysaidso_widget
    • wps_sfw_place_order_button_text
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/subscriptions-for-woocommerce/public/partials/subscriptions-for-woocommerce-public-display.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/subscriptions-for-woocommerce/onboarding/templates/subscriptions-for-woocommerce-onboarding-template.php:15
    • > PHP Warning
      Use of undefined constant SUBSCRIPTIONS_FOR_WOOCOMMERCE_DIR_URL - assumed 'SUBSCRIPTIONS_FOR_WOOCOMMERCE_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/subscriptions-for-woocommerce/admin/partials/subscriptions-for-woocommerce-subscriptions-free-vs-pro.php on line 11
    • > PHP Warning
      Use of undefined constant SUBSCRIPTIONS_FOR_WOOCOMMERCE_DIR_URL - assumed 'SUBSCRIPTIONS_FOR_WOOCOMMERCE_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/subscriptions-for-woocommerce/admin/partials/subscriptions-for-woocommerce-subscriptions-free-vs-pro.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/subscriptions-for-woocommerce/admin/partials/subscriptions-for-woocommerce-subscriptions-free-vs-pro.php:54

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed: You can look at the official readme.txt

subscriptions-for-woocommerce/subscriptions-for-woocommerce.php 85% from 13 tests

The primary PHP file in "Subscriptions for WooCommerce - Subscription Plugin for Collecting Recurring Revenue, Sell Membership Subscription Services & Products" version 1.5.7 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "5.1.0")
  • Description: The description should be shorter than 140 characters (currently 386 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin80,806 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
SVG151035,248
JavaScript1010,26312,89733,806
PHP481,8333,6688,964
CSS12321651,866
PO File1379459906
XML10016

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity46.75
▷ Minimum class complexity1.00
▷ Maximum class complexity234.00
Average method complexity5.09
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods267
▷ Static methods145.24%
▷ Public methods24792.51%
▷ Protected methods31.12%
▷ Private methods176.37%
Functions68
▷ Named functions6494.12%
▷ Anonymous functions45.88%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
25 PNG files occupy 0.34MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/feature-3.png12.53KB5.53KB▼ 55.83%
admin/images/cross.png16.01KB7.31KB▼ 54.32%
admin/images/timer.png1.22KB0.97KB▼ 20.93%
admin/images/connected.png1.32KB1.07KB▼ 18.77%
admin/images/logo.png64.10KB23.89KB▼ 62.74%