84% razorpay-payment-button-elementor

Code Review | Razorpay Payment Button Elementor Plugin

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

About plugin

  • Plugin page: razorpay-payment-...
  • Plugin version: 1.2.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 3, 2021
  • Latest release: Jun 28, 2022
  • Number of updates: 20
  • Update frequency: every 25.7 days
  • Top authors: razorpay (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /11,522 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.17ms] Passed 4 tests

This is a short check of server-side resources used by Razorpay Payment Button Elementor Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.98 ▼0.39
Dashboard /wp-admin3.34 ▲0.0450.46 ▼1.14
Posts /wp-admin/edit.php3.45 ▲0.1048.27 ▼3.04
Add New Post /wp-admin/post-new.php5.92 ▲0.0391.92 ▼11.60
Media Library /wp-admin/upload.php3.26 ▲0.0336.94 ▼0.91
Settings /wp-admin/admin.php?page=razorpay_elementor_settings3.2332.45
Razorpay Buttons Elementor /wp-admin/admin.php?page=rzp_button_view_elementor3.2132.40
Razorpay Buttons Elementor /wp-admin/admin.php?page=razorpay_button_elementor3.2129.73

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 216 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Razorpay Payment Button Elementor Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.21 ▼0.041.64 ▲0.0844.28 ▲3.49
Dashboard /wp-admin2,218 ▲415.59 ▼0.0681.75 ▼6.6337.96 ▼4.40
Posts /wp-admin/edit.php2,102 ▲22.02 ▼0.1235.60 ▼5.6433.91 ▼1.67
Add New Post /wp-admin/post-new.php1,553 ▲2718.23 ▼5.29597.04 ▼86.3562.69 ▲6.92
Media Library /wp-admin/upload.php1,423 ▲324.21 ▼0.0192.97 ▼13.2941.42 ▼14.55
Settings /wp-admin/admin.php?page=razorpay_elementor_settings9142.0021.3728.33
Razorpay Buttons Elementor /wp-admin/admin.php?page=rzp_button_view_elementor6961.516.3330.12
Razorpay Buttons Elementor /wp-admin/admin.php?page=razorpay_button_elementor6981.127.1417.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 121× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Requests_Transport' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/libs/Requests-1.7.0/library/Requests/Transport/fsockopen.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status411.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Errors\\Error' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/src/Errors/GatewayError.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/razorpay-payment-button-elementor/widget/Widget.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Utility\\CaseInsensitiveDictionary' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/libs/Requests-2.0.0/src/Response/Headers.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status502.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/libs/Requests-1.7.0/library/Requests/Exception/HTTP/403.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/libs/Requests-2.0.0/src/Exception/Http/Status500.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/libs/Requests-1.7.0/library/Requests/Exception/HTTP/502.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Errors\\Error' not found in wp-content/plugins/razorpay-payment-button-elementor/razorpay-sdk/src/Errors/ServerError.php:5

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: india, donate button, payment gateway, upicreditdebit card, payment plugin

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

Analyzing the main PHP file in "Razorpay Payment Button Elementor Plugin" version 1.2.5
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("razorpay-payment-button-elementor.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 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 plugin17,949 lines of code in 208 files:
LanguageFilesBlank linesComment linesLines of code
Markdown311,54108,730
PHP1672,1807,2088,534
SVG100233
CSS248159
JSON300146
JavaScript2151299
YAML29548

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity9.60
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces13
Interfaces10
Traits0
Classes155
▷ Abstract classes00.00%
▷ Concrete classes155100.00%
▷ Final classes4529.03%
Methods585
▷ Static methods12621.54%
▷ Public methods48282.39%
▷ Protected methods9315.90%
▷ Private methods101.71%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin