83% campt-razorpay-payment-gateway

Code Review | CampTix RazorPay Payment Gateway

WordPress plugin CampTix RazorPay Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: campt-razorpay-pa...
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.7.3
  • WordPress version: 6.3.1
  • First release: Jul 4, 2017
  • Latest release: Dec 22, 2017
  • Number of updates: 24
  • Update frequency: every 7.2 days
  • Top authors: arvindsinghu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,589 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by CampTix RazorPay Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0142.35 ▼3.24
Dashboard /wp-admin3.32 ▲0.0251.00 ▲0.14
Posts /wp-admin/edit.php3.37 ▲0.0152.13 ▼10.04
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.82 ▼13.03
Media Library /wp-admin/upload.php3.25 ▲0.0140.58 ▲3.82

Server storage [IO: ▲0.06MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • You have illegally modified 1 file (4.00KB) outside of "wp-content/plugins/campt-razorpay-payment-gateway/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for CampTix RazorPay Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.75 ▲0.531.83 ▲0.0446.46 ▲4.50
Dashboard /wp-admin2,221 ▲244.86 ▼1.00102.43 ▼11.0137.82 ▼4.34
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0134.18 ▼9.8535.26 ▼0.93
Add New Post /wp-admin/post-new.php1,545 ▲1923.36 ▲5.90698.21 ▲77.7954.27 ▲3.05
Media Library /wp-admin/upload.php1,397 ▼04.23 ▼0.0194.93 ▼7.6142.81 ▲0.08

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require(wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/tests/bootstrap.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/src/Customer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/src/Card.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/libs/Requests-1.6.1/library/Requests.php' (include_path='.:/usr/share/php') in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/Razorpay.php on line 6
    • > PHP Warning
      include(Razorpay.php): failed to open stream: No such file or directory in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/non_composer_tests/RazorpayTest.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/non_composer_tests/RazorpayTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/tests/RazorpayTest.php:9
    • > PHP Warning
      include(): Failed opening 'Razorpay.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/non_composer_tests/RazorpayTest.php on line 5
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/tests/bootstrap.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/campt-razorpay-payment-gateway/inc/lib/razorpay-php/src/Token.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: gateway, razorpay, camptix

campt-razorpay-payment-gateway/camptix-razorpay.php 85% from 13 tests

"CampTix RazorPay Payment Gateway" version 0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("campt-razorpay-payment-gateway.php" instead of "camptix-razorpay.php")

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
Good job! No executable or dangerous file extensions detected1,636 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP263684591,187
Markdown4670185
JavaScript23785146
JSON20057
YAML11931
XML13630

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity4.92
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods114
▷ Static methods1210.53%
▷ Public methods8776.32%
▷ Protected methods1714.91%
▷ Private methods108.77%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants8
▷ Global constants337.50%
▷ Class constants562.50%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin