84% razorpay-payment-button

Code Review | Razorpay Payment Button Plugin

WordPress plugin Razorpay Payment Button Plugin scored84%from 54 tests.

About plugin

  • Plugin page: razorpay-payment-...
  • Plugin version: 2.4.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 30, 2020
  • Latest release: Jun 17, 2022
  • Number of updates: 35
  • Update frequency: every 16.3 days
  • Top authors: razorpay (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /20,810 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

A check of server-side resources used by Razorpay Payment Button Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1640.66 ▲0.43
Dashboard /wp-admin3.48 ▲0.1753.22 ▲4.50
Posts /wp-admin/edit.php3.59 ▲0.2348.33 ▼1.46
Add New Post /wp-admin/post-new.php5.37 ▼0.5269.57 ▼21.93
Media Library /wp-admin/upload.php3.40 ▲0.1738.25 ▲2.74
Razorpay Subscription Buttons /wp-admin/admin.php?page=rzp_subscription_button3.3431.69
Settings /wp-admin/admin.php?page=razorpay_settings3.3733.46
Razorpay Subscription Button /wp-admin/admin.php?page=rzp_button_view3.3428.69
Razorpay Buttons /wp-admin/admin.php?page=razorpay_button3.3430.64

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 217 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Razorpay Payment Button Plugin: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7613.59 ▼0.781.76 ▼0.2342.08 ▼1.33
Dashboard /wp-admin2,236 ▲534.83 ▼0.23109.57 ▼30.4640.42 ▼6.21
Posts /wp-admin/edit.php2,122 ▲331.99 ▼0.0238.83 ▼3.3541.11 ▲3.96
Add New Post /wp-admin/post-new.php32 ▼1,5100.44 ▼17.890.08 ▼658.893.79 ▼48.10
Media Library /wp-admin/upload.php1,415 ▲334.20 ▼0.0896.76 ▼3.2870.41 ▲25.05
Razorpay Subscription Buttons /wp-admin/admin.php?page=rzp_subscription_button7011.149.2827.38
Settings /wp-admin/admin.php?page=razorpay_settings8962.0423.4632.68
Razorpay Subscription Button /wp-admin/admin.php?page=rzp_button_view6951.536.0317.98
Razorpay Buttons /wp-admin/admin.php?page=razorpay_button7011.146.5118.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please fix the following
  • 128× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/libs/Requests-1.7.0/library/Requests/Exception/HTTP/406.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/StatusUnknown.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status413.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/libs/Requests-1.7.0/library/Requests/Exception/HTTP/505.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/libs/Requests-1.7.0/library/Requests/Exception/HTTP/414.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status503.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/libs/Requests-1.7.0/library/Requests/Exception/HTTP/306.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/libs/Requests-1.7.0/library/Requests/Exception/HTTP/429.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/razorpay-payment-button/razorpay-sdk/src/PaymentLink.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/razorpay-payment-button/includes/rzp-subscription-buttons.php on line 11

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 issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: e-commerce, upicreditdebit card, education, payment gateway, donate button...

razorpay-payment-button/razorpay-payment-buttons.php 85% from 13 tests

Analyzing the main PHP file in "Razorpay Payment Button Plugin" version 2.4.5
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-payment-button.php" instead of "razorpay-payment-buttons.php")
  • Description: The description should be shorter than 140 characters (currently 195 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin18,948 lines of code in 207 files:
LanguageFilesBlank linesComment linesLines of code
Markdown311,54108,730
PHP1662,2087,1098,706
SVG100793
JavaScript27784347
CSS269178
JSON300146
YAML29548

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity9.83
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces13
Interfaces10
Traits0
Classes154
▷ Abstract classes00.00%
▷ Concrete classes154100.00%
▷ Final classes4529.22%
Methods587
▷ Static methods12521.29%
▷ Public methods48782.96%
▷ Protected methods9115.50%
▷ Private methods91.53%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants71
▷ Global constants79.86%
▷ Class constants6490.14%
▷ Public constants64100.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
No PNG images were found in this plugin