84% razorpay-subscription-button-elementor

Code Review | Razorpay Subscription Button Elementor Plugin

WordPress plugin Razorpay Subscription Button Elementor Plugin scored84%from 54 tests.

About plugin

  • Plugin page: razorpay-subscrip...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 28, 2021
  • Latest release: Jun 28, 2022
  • Number of updates: 10
  • Update frequency: every 37.2 days
  • Top authors: razorpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /977 total downloads


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.13MB] [CPU: ▼1.49ms] Passed 4 tests

Analyzing server-side resources used by Razorpay Subscription Button Elementor Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1341.70 ▼1.91
Dashboard /wp-admin3.44 ▲0.1351.82 ▼1.22
Posts /wp-admin/edit.php3.55 ▲0.1946.44 ▲1.45
Add New Post /wp-admin/post-new.php6.02 ▲0.1384.52 ▼4.26
Media Library /wp-admin/upload.php3.36 ▲0.1337.50 ▲4.38
Settings /wp-admin/admin.php?page=razorpay_sub_elementor_settings3.3331.36
Razorpay Subscription Buttons Elementor /wp-admin/admin.php?page=rzp_button_view_sub_elementor3.3032.22
Razorpay Subscription Buttons Elementor /wp-admin/admin.php?page=razorpay_subs_button_elementor3.3032.32

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 254 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Razorpay Subscription Button Elementor Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.10 ▼0.251.75 ▼0.0944.10 ▼0.28
Dashboard /wp-admin2,218 ▲385.65 ▲0.0593.34 ▲2.0243.25 ▼0.79
Posts /wp-admin/edit.php2,123 ▲231.95 ▼0.0433.15 ▼1.7333.35 ▼2.79
Add New Post /wp-admin/post-new.php1,545 ▲1423.16 ▲0.00633.25 ▲21.7752.35 ▼5.68
Media Library /wp-admin/upload.php1,423 ▲264.19 ▼0.0393.92 ▼3.7239.44 ▼1.52
Settings /wp-admin/admin.php?page=razorpay_sub_elementor_settings9032.0023.8927.12
Razorpay Subscription Buttons Elementor /wp-admin/admin.php?page=rzp_button_view_sub_elementor6961.516.3328.16
Razorpay Subscription Buttons Elementor /wp-admin/admin.php?page=razorpay_subs_button_elementor6981.516.5018.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 163× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/razorpay-subscription-button-elementor/razorpay-sdk/src/Subscription.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-subscription-button-elementor/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status505.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-subscription-button-elementor/razorpay-sdk/libs/Requests-1.8.0/library/Requests/Exception/HTTP/412.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/razorpay-subscription-button-elementor/widget/Widget.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-subscription-button-elementor/razorpay-sdk/libs/Requests-1.8.0/library/Requests/Exception/HTTP/429.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-subscription-button-elementor/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status410.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/razorpay-subscription-button-elementor/razorpay-sdk/src/Order.php:5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/razorpay-subscription-button-elementor/includes/rzp-subscription-buttons.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Errors\\Error' not found in wp-content/plugins/razorpay-subscription-button-elementor/razorpay-sdk/src/Errors/ServerError.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-subscription-button-elementor/razorpay-sdk/libs/Requests-1.8.0/library/Requests/Exception/HTTP/408.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: subscription, india, payments, razorpay, ecommerce

razorpay-subscription-button-elementor/razorpay-subscription-buttons.php 92% from 13 tests

"Razorpay Subscription Button Elementor Plugin" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("razorpay-subscription-button-elementor.php" instead of "razorpay-subscription-buttons.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin13,910 lines of code in 241 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity10.18
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes209100.00%
▷ Final classes4521.53%
▷ Static methods17823.30%
▷ Public methods62381.54%
▷ Protected methods13017.02%
▷ Private methods111.44%
▷ Named functions266.67%
▷ Anonymous functions133.33%
▷ Global constants77.37%
▷ Class constants8892.63%
▷ Public constants88100.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
PNG images were not found in this plugin