79% razorpay-quick-payments

Code Review | Razorpay Quick Payments

WordPress plugin Razorpay Quick Payments scored79%from 54 tests.

About plugin

  • Plugin page: razorpay-quick-pa...
  • Plugin version: 1.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: May 3, 2017
  • Latest release: Oct 23, 2023
  • Number of updates: 31
  • Update frequency: every 76.5 days
  • Top authors: razorpay (64.52%)mayankamencherla (22.58%)ramprak (12.9%)chetangn (9.68%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active /52,022 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.73ms] Passed 4 tests

A check of server-side resources used by Razorpay Quick Payments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0442.74 ▲4.14
Dashboard /wp-admin3.33 ▼0.0145.64 ▼16.55
Posts /wp-admin/edit.php3.45 ▲0.0948.58 ▲1.29
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.17 ▼18.13
Media Library /wp-admin/upload.php3.26 ▲0.0338.86 ▲2.48

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 278 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Razorpay Quick Payments
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲12313.39 ▼0.978.56 ▲6.9343.31 ▲2.40
Dashboard /wp-admin2,211 ▲305.50 ▼0.2180.77 ▼19.5837.83 ▼11.19
Posts /wp-admin/edit.php2,116 ▲161.98 ▼0.0038.13 ▲3.0237.28 ▲1.53
Add New Post /wp-admin/post-new.php1,539 ▲423.27 ▲0.16682.85 ▼15.2446.75 ▼11.60
Media Library /wp-admin/upload.php1,419 ▲224.20 ▲0.0197.12 ▼11.3845.71 ▼1.84

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/examples/basic-auth.php
    • > /wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/examples/get.php
    • > /wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/examples/post.php
    • > /wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/examples/session.php
    • > /wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/examples/multiple.php
    • > /wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/bin/create_pear_package.php
  • 163× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/library/Requests/Exception/HTTP/414.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-2.0.4/src/Exception/Http/Status502.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/library/Requests/Exception/HTTP/404.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/src/Collection.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Errors\\Error' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/src/Errors/GatewayError.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.7.0/library/Requests/Exception/HTTP/504.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Utility_CaseInsensitiveDictionary' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/library/Requests/Response/Headers.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-1.6.1/tests/Requests.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-2.0.4/src/Exception/ArgumentCount.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-quick-payments/razorpay-php/libs/Requests-2.0.4/src/Exception/Http/Status504.php:17

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 important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: razorpay, india, quick, simple, payments

razorpay-quick-payments/razorpay-quick-payments.php Passed 13 tests

The primary PHP file in "Razorpay Quick Payments" version 1.2.9 is used by WordPress to initiate all plugin functionality
42 characters long description:
Quick Payments for Wordpress, by Razorpay.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected14,663 lines of code in 232 files:
LanguageFilesBlank linesComment linesLines of code
PHP2062,9829,40312,490
Markdown1876001,898
JSON400175
YAML39567
XML12033

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity9.65
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces12
Interfaces14
Traits0
Classes212
▷ Abstract classes10.47%
▷ Concrete classes21199.53%
▷ Final classes4521.33%
Methods874
▷ Static methods19121.85%
▷ Public methods73383.87%
▷ Protected methods13014.87%
▷ Private methods111.26%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants84
▷ Global constants78.33%
▷ Class constants7791.67%
▷ Public constants77100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and 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.png3.85KB2.76KB▼ 28.31%
images/payment.png5.47KB2.74KB▼ 49.83%