84% razorpay-subscriptions-for-woocommerce

Code Review | Razorpay Subscriptions for WooCommerce

WordPress plugin Razorpay Subscriptions for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: razorpay-subscrip...
  • Plugin version: 2.3.7
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 15, 2017
  • Latest release: Sep 14, 2023
  • Number of updates: 37
  • Update frequency: every 58.1 days
  • Top authors: razorpay (75.68%)premtechchefs (18.92%)mayankamencherla (10.81%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /11,886 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.91ms] Passed 4 tests

Server-side resources used by Razorpay Subscriptions for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0137.40 ▼4.85
Dashboard /wp-admin3.31 ▲0.0044.53 ▼4.86
Posts /wp-admin/edit.php3.36 ▲0.0048.93 ▼0.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.98 ▼9.43
Media Library /wp-admin/upload.php3.23 ▲0.0038.05 ▲0.22

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Razorpay Subscriptions for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.63 ▼0.671.81 ▼0.0840.16 ▼3.18
Dashboard /wp-admin2,206 ▲215.90 ▲0.10105.64 ▼3.8037.33 ▼7.02
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0440.73 ▼0.7335.46 ▼0.98
Add New Post /wp-admin/post-new.php1,542 ▲618.04 ▼5.08602.27 ▼53.0453.04 ▼6.66
Media Library /wp-admin/upload.php1,388 ▲64.15 ▼0.0494.86 ▼9.2540.42 ▼7.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'RZP_Webhook' not found in wp-content/plugins/razorpay-subscriptions-for-woocommerce/includes/razorpay-subscription-webhook.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Errors\\ErrorCode' not found in wp-content/plugins/razorpay-subscriptions-for-woocommerce/includes/Errors/SubscriptionErrorCode.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
7 plugin tags: india, payments, ecommerce, razorpay, recurring...

razorpay-subscriptions-for-woocommerce/razorpay-subscriptions.php 92% from 13 tests

The entry point to "Razorpay Subscriptions for WooCommerce" version 2.3.7 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("razorpay-subscriptions-for-woocommerce.php" instead of "razorpay-subscriptions.php")

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
No dangerous file extensions were detected976 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5312335976

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity23.25
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods52
▷ Static methods11.92%
▷ Public methods1528.85%
▷ Protected methods3363.46%
▷ Private methods47.69%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants318.75%
▷ Class constants1381.25%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/logo.png5.62KB3.25KB▼ 42.17%
images/payment.png2.21KB1.64KB▼ 25.45%