88% s2-subscription-for-woocommerce

Code Review | S2 Subscription for WooCommerce

WordPress plugin S2 Subscription for WooCommerce scored88%from 54 tests.

About plugin

  • Plugin page: s2-subscription-f...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Jun 11, 2021
  • Latest release: Jul 29, 2023
  • Number of updates: 10
  • Update frequency: every 77.9 days
  • Top authors: shubanstudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /485 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
This plugin's installer ran successfully

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

An overview of server-side resources used by S2 Subscription for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.31 ▲0.57
Dashboard /wp-admin3.32 ▲0.0254.61 ▲10.06
Posts /wp-admin/edit.php3.37 ▲0.0144.46 ▼6.81
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.72 ▼15.68
Media Library /wp-admin/upload.php3.24 ▲0.0133.70 ▲0.48

Server storage [IO: ▲0.39MB] [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: 76 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for S2 Subscription for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.59 ▼0.744.86 ▲2.9942.62 ▼0.98
Dashboard /wp-admin2,212 ▲215.90 ▲1.03111.20 ▲7.2042.59 ▲1.27
Posts /wp-admin/edit.php2,095 ▲62.00 ▼0.0033.50 ▼7.6535.59 ▼1.02
Add New Post /wp-admin/post-new.php1,520 ▼2117.65 ▼5.50646.56 ▲53.4647.25 ▼5.52
Media Library /wp-admin/upload.php1,397 ▲64.23 ▼0.0094.79 ▼4.2142.70 ▼1.16

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed: You can take inspiration from this readme.txt

s2-subscription-for-woocommerce/init.php 69% from 13 tests

The primary PHP file in "S2 Subscription for WooCommerce" version 1.0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("s2-subscription-for-woocommerce.php" instead of "init.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 174 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("5.3" instead of "4.7.0")

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
No dangerous file extensions were detected6,935 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP702,4203,3956,819
JavaScript25133116

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity19.70
▷ Minimum class complexity1.00
▷ Maximum class complexity123.00
Average method complexity3.51
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes00.00%
▷ Concrete classes46100.00%
▷ Final classes00.00%
Methods321
▷ Static methods237.17%
▷ Public methods30093.46%
▷ Protected methods175.30%
▷ Private methods41.25%
Functions28
▷ Named functions2796.43%
▷ Anonymous functions13.57%
Constants10
▷ Global constants990.00%
▷ Class constants110.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
No PNG files were detected