73% subscription

Code Review | Subscription for WooCommerce

WordPress plugin Subscription for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: subscription
  • Plugin version: 1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2022
  • Latest release: Jun 18, 2023
  • Number of updates: 17
  • Update frequency: every 28.1 days
  • Top authors: ok9xnirab (76.47%)istiaqnirab (23.53%)springdevs (11.76%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /789 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.04MB] [CPU: ▼6.91ms] Passed 4 tests

Analyzing server-side resources used by Subscription for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1747.34 ▲3.22
Dashboard /wp-admin3.42 ▲0.1153.10 ▲3.43
Posts /wp-admin/edit.php3.48 ▲0.1247.82 ▼7.24
Add New Post /wp-admin/post-new.php5.38 ▼0.5166.52 ▼24.86
Media Library /wp-admin/upload.php3.34 ▲0.1136.98 ▲1.25
Settings /wp-admin/edit.php?post_type=subscrpt_order&page=subscrpt_settings3.3533.47
Subscriptions /wp-admin/edit.php?post_type=subscrpt_order3.3935.38

Server storage [IO: ▲0.40MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 63 new files
Database: 1 new table, 10 new options
New tables
wp_subscrpt_order_relation
New WordPress options
widget_theysaidso_widget
subscrpt_manual_renew_cart_notice
db_upgraded
subscrpt_version
widget_recent-comments
theysaidso_admin_options
recovery_mode_email_last_sent
subscrpt_installed
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Subscription for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲12313.22 ▼1.372.02 ▲0.1543.21 ▼1.22
Dashboard /wp-admin2,276 ▲885.94 ▲0.8796.47 ▼17.2275.85 ▲31.38
Posts /wp-admin/edit.php2,156 ▲672.23 ▲0.2437.95 ▼0.8234.03 ▲1.18
Add New Post /wp-admin/post-new.php45 ▼1,4690.44 ▼22.930.06 ▼693.659.89 ▼45.37
Media Library /wp-admin/upload.php1,458 ▲704.35 ▲0.16101.90 ▼10.9885.13 ▲38.10
Settings /wp-admin/edit.php?post_type=subscrpt_order&page=subscrpt_settings1,0302.2429.3029.86
Subscriptions /wp-admin/edit.php?post_type=subscrpt_order1,1142.0533.9231.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_subscrpt_order_relation
  • Zombie WordPress options detected upon uninstall: 10 options
    • subscrpt_version
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • subscrpt_manual_renew_cart_notice
    • subscrpt_installed
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/subscription/includes/Admin/views/order-history.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/subscription/includes/Admin/views/subscription-customer.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/subscription/templates/myaccount/subscriptions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/subscription/includes/Admin/views/product-form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/subscription/includes/Admin/views/subscription-save-meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/subscription/includes/Admin/views/related-subscriptions.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/subscription/includes/Admin/views/settings.php:2
    • > PHP Notice
      Undefined variable: order_item in wp-content/plugins/subscription/includes/Admin/views/subscription-order-info.php on line 8
    • > PHP Warning
      Use of undefined constant SUBSCRPT_ASSETS - assumed 'SUBSCRPT_ASSETS' (this will throw an Error in a future version of PHP) in wp-content/plugins/subscription/includes/Admin/views/required-notice.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/subscription/includes/Admin/views/required-notice.php:6

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

subscription/subscription.php 85% from 13 tests

The main file in "Subscription for WooCommerce" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
There were no executable files found in this plugin3,517 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP525481,1133,328
JavaScript290108
CSS213076
JSON1005

PHP code Passed 2 tests

An short overview of 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.35
Average class complexity11.29
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits1
Classes33
▷ Abstract classes00.00%
▷ Concrete classes33100.00%
▷ Final classes13.03%
Methods184
▷ Static methods3820.65%
▷ Public methods17293.48%
▷ Protected methods00.00%
▷ Private methods126.52%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.24MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/subscrpt-ads.png239.59KB250.28KB0.00%
assets/images/woocommerce.png7.05KB3.41KB▼ 51.68%