83% subscription-for-woocommerce

Code Review | Subscription for Woocommerce

WordPress plugin Subscription for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: subscription-for-...
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.3
  • WordPress version: 6.3.1
  • First release: Nov 29, 2016
  • Latest release: Feb 3, 2020
  • Number of updates: 49
  • Update frequency: every 23.7 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /6,047 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Server-side resources used by Subscription for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.10 ▼2.63
Dashboard /wp-admin3.32 ▼0.0247.75 ▼13.55
Posts /wp-admin/edit.php3.37 ▲0.0248.62 ▼2.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.16 ▼20.99
Media Library /wp-admin/upload.php3.24 ▲0.0236.81 ▼2.34

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Subscription for Woocommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲4814.34 ▼0.222.12 ▲0.3142.64 ▼2.67
Dashboard /wp-admin2,197 ▲175.54 ▲0.0089.95 ▼5.5244.16 ▲1.58
Posts /wp-admin/edit.php2,105 ▲22.02 ▲0.0537.20 ▼4.8431.45 ▼3.52
Add New Post /wp-admin/post-new.php1,531 ▲523.40 ▼0.22680.30 ▲6.8653.26 ▼2.60
Media Library /wp-admin/upload.php1,402 ▲24.19 ▼0.0199.05 ▼21.8846.36 ▼3.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/subscription-for-woocommerce/includes/phoeniixx_prosub_admin_panel.php on line 193
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/subscription-for-woocommerce/includes/phoeniixx_prosub_admin_panel.php on line 185
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/subscription-for-woocommerce/includes/phoeniixx_prosub_admin_panel.php on line 189
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/subscription-for-woocommerce/includes/phoeniixx_prosub_admin_panel.php on line 181
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/subscription-for-woocommerce/includes/phoeniixx_prosub_admin_panel.php on line 191
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/subscription-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/subscription-for-woocommerce/includes/phoeniixx_prosub_admin_panel.php on line 187
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/subscription-for-woocommerce/includes/phoeniixx_prosub_admin_panel.php on line 183
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/subscription-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/subscription-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
Please take inspiration from this readme.txt

subscription-for-woocommerce/phoen_prosub_main.php 77% from 13 tests

The main PHP file in "Subscription for Woocommerce" ver. 2.4 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("subscription-for-woocommerce.php" instead of "phoen_prosub_main.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "2.6.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,708 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP111,0951,6792,635
CSS19070
JavaScript1103

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity48.14
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods101
▷ Static methods54.95%
▷ Public methods7877.23%
▷ Protected methods2322.77%
▷ Private methods00.00%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ 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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/aa2.png1.34KB1.26KB▼ 5.77%