84% razorpay-payment-button-for-siteorigin

Code Review | Razorpay Payment Button SiteOrigin Plugin

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

About plugin

  • Plugin page: razorpay-payment-...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 14, 2022
  • Latest release: Jun 17, 2022
  • Number of updates: 12
  • Update frequency: every 10.5 days
  • Top authors: razorpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /496 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▲3.43ms] Passed 4 tests

Analyzing server-side resources used by Razorpay Payment Button SiteOrigin Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2150.30 ▲9.07
Dashboard /wp-admin3.58 ▲0.2752.61 ▼0.35
Posts /wp-admin/edit.php3.63 ▲0.2757.58 ▲4.14
Add New Post /wp-admin/post-new.php6.09 ▲0.21106.33 ▲5.96
Media Library /wp-admin/upload.php3.44 ▲0.2141.25 ▲3.98
Subscription Buttons /wp-admin/admin.php?page=rzp_button_view_siteorigin3.3832.18
Subscription Buttons /wp-admin/admin.php?page=razorpay_subscription_button_siteorigin3.3847.41
Payment Buttons /wp-admin/admin.php?page=razorpay_button_siteorigin3.3835.44
Settings /wp-admin/admin.php?page=razorpay_siteorigin_settings3.4038.95

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 185 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_rzp_subscription_button_widget
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_rzp_payment_button_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Razorpay Payment Button SiteOrigin Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲8113.34 ▼1.165.05 ▲3.2549.60 ▲3.34
Dashboard /wp-admin2,245 ▲394.84 ▼0.04125.92 ▲16.8246.00 ▲1.60
Posts /wp-admin/edit.php2,127 ▲272.01 ▲0.0140.41 ▲2.6235.31 ▲1.89
Add New Post /wp-admin/post-new.php1,577 ▲2723.40 ▲0.20605.58 ▼36.8755.88 ▼6.96
Media Library /wp-admin/upload.php1,430 ▲274.21 ▼0.02103.19 ▲1.0344.51 ▼5.45
Subscription Buttons /wp-admin/admin.php?page=rzp_button_view_siteorigin7001.356.5032.35
Subscription Buttons /wp-admin/admin.php?page=razorpay_subscription_button_siteorigin7021.357.9619.85
Payment Buttons /wp-admin/admin.php?page=razorpay_button_siteorigin7021.357.8521.29
Settings /wp-admin/admin.php?page=razorpay_siteorigin_settings9182.0328.3332.33

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
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_rzp_payment_button_widget
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_rzp_subscription_button_widget

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 121× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status411.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status413.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/src/Transfer.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/widgets/payment_button/payment_button.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/src/Payment.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/libs/Requests-1.8.0/library/Requests/Exception/HTTP/411.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/libs/Requests-1.8.0/library/Requests/Exception/HTTP/403.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/src/Customer.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Requests_Auth' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/libs/Requests-1.8.0/library/Requests/Auth/Basic.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button-for-siteorigin/razorpay-sdk/libs/Requests-1.8.0/library/Requests/Exception/HTTP/417.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: india, donate button, payment plugin, payment gateway, upicreditdebit card

razorpay-payment-button-for-siteorigin/razorpay-payment-buttons.php 92% from 13 tests

The entry point to "Razorpay Payment Button SiteOrigin Plugin" version 1.0.3 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("razorpay-payment-button-for-siteorigin.php" instead of "razorpay-payment-buttons.php")

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
There were no executable files found in this plugin10,631 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
PHP1682,2417,2338,925
Markdown552201,358
CSS248159
JSON200130
XML12041
YAML12118

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.44
Average class complexity9.84
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces13
Interfaces10
Traits0
Classes156
▷ Abstract classes00.00%
▷ Concrete classes156100.00%
▷ Final classes4528.85%
Methods596
▷ Static methods12520.97%
▷ Public methods49583.05%
▷ Protected methods9215.44%
▷ Private methods91.51%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants71
▷ Global constants79.86%
▷ Class constants6490.14%
▷ Public constants64100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin