79% woo-razorpay

Code Review | Razorpay for WooCommerce

WordPress plugin Razorpay for WooCommerce scored79%from 54 tests.

About plugin

  • Plugin page: woo-razorpay
  • Plugin version: 4.5.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 26, 2015
  • Latest release: Nov 27, 2023
  • Number of updates: 197
  • Update frequency: every 15.0 days
  • Top authors: razorpay (84.26%)ramprak (8.63%)mayankamencherla (6.09%)chetangn (1.52%)premtechchefs (1.52%)

Code review

54 tests

User reviews

19 reviews

Install metrics

60,000+ active /1,384,759 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.38MB] [CPU: ▲6.54ms] Passed 4 tests

A check of server-side resources used by Razorpay for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.85 ▲1.3846.16 ▲2.75
Dashboard /wp-admin4.68 ▲1.3854.45 ▲3.46
Posts /wp-admin/edit.php4.79 ▲1.4455.58 ▲10.15
Add New Post /wp-admin/post-new.php7.29 ▲1.4099.22 ▲10.34
Media Library /wp-admin/upload.php4.60 ▲1.3743.53 ▲9.81

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 432 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Razorpay for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.27 ▼0.061.74 ▲0.1937.21 ▼9.96
Dashboard /wp-admin2,198 ▲185.57 ▲0.0391.62 ▼8.9840.51 ▼1.21
Posts /wp-admin/edit.php2,100 ▲31.95 ▼0.0339.79 ▲3.5134.59 ▲1.71
Add New Post /wp-admin/post-new.php1,526 ▼023.13 ▼0.00634.38 ▲7.3555.63 ▲9.40
Media Library /wp-admin/upload.php1,400 ▲34.23 ▲0.0493.48 ▼7.3742.10 ▲0.83

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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 items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-razorpay/tests/phpunit/bootstrap.php
    • > /wp-content/plugins/woo-razorpay/templates/rzp-cart-checkout-btn.php
    • > /wp-content/plugins/woo-razorpay/tests/phpunit/includes/bootstrap.php
    • > /wp-content/plugins/woo-razorpay/templates/rzp-mini-checkout-btn.php
  • 257× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/woo-razorpay/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status412.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/woo-razorpay/tests/phpunit/tests/test-constants.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/woo-razorpay/razorpay-sdk/libs/Requests-1.8.0/library/Requests/Exception/HTTP/403.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/woo-razorpay/tests/phpunit/tests/test-magic-api.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_json_encode() in wp-content/plugins/woo-razorpay/templates/rzp-pdp-checkout-btn.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Requests_Proxy' not found in wp-content/plugins/woo-razorpay/razorpay-sdk/libs/Requests-1.6.1/library/Requests/Proxy/HTTP.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/woo-razorpay/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status511.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/woo-razorpay/razorpay-sdk/libs/Requests-1.6.1/library/Requests/Exception/HTTP/400.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/woo-razorpay/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status407.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/woo-razorpay/razorpay-sdk/libs/Requests-2.0.4/src/Exception/Http/Status511.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: india, cross border, ecommerce, payments, curlec...

woo-razorpay/woo-razorpay.php Passed 13 tests

The main file in "Razorpay for WooCommerce" v. 4.5.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
52 characters long description:
Razorpay Payment Gateway Integration for WooCommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin32,405 lines of code in 358 files:
LanguageFilesBlank linesComment linesLines of code
PHP3327,13316,13029,082
Markdown781002,130
JavaScript611826558
JSON500268
CSS3107262
XML22050
XSLT1113332
YAML12118
SVG1005

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity11.04
▷ Minimum class complexity1.00
▷ Maximum class complexity256.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces14
Interfaces19
Traits0
Classes342
▷ Abstract classes113.22%
▷ Concrete classes33196.78%
▷ Final classes9027.19%
Methods1,555
▷ Static methods26116.78%
▷ Public methods1,30483.86%
▷ Protected methods20913.44%
▷ Private methods422.70%
Functions322
▷ Named functions25880.12%
▷ Anonymous functions6419.88%
Constants258
▷ Global constants5119.77%
▷ Class constants20780.23%
▷ Public constants20599.03%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/payment.png7.40KB7.69KB0.00%
public/images/payment.png7.40KB7.69KB0.00%
images/logo.png6.57KB3.03KB▼ 53.81%