78% campt-indian-payment-gateway

Code Review | Camptix Indian Payments

WordPress plugin Camptix Indian Payments scored 78% from 54 tests.

About plugin

  • Plugin page: campt-indian-paym...
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.6
  • WordPress version: 6.3.1
  • First release: Jul 25, 2017
  • Latest release: Jul 22, 2018
  • Number of updates: 21
  • Update frequency: every 17.3 days
  • Top authors: codexdemon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,717 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.53ms] Passed 4 tests

An overview of server-side resources used by Camptix Indian Payments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.30 ▲1.39
Dashboard /wp-admin3.31 ▲0.0049.03 ▲0.06
Posts /wp-admin/edit.php3.36 ▲0.0045.21 ▼6.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.65 ▼1.84
Media Library /wp-admin/upload.php3.23 ▲0.0035.16 ▼1.80

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

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

Browser metrics Passed 4 tests

Camptix Indian Payments: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1113.22 ▼0.031.92 ▲0.2242.99 ▼0.50
Dashboard /wp-admin2,206 ▼04.87 ▼0.91114.17 ▲17.7343.05 ▲3.40
Posts /wp-admin/edit.php2,086 ▲181.97 ▼0.0134.94 ▼2.2833.55 ▼2.02
Add New Post /wp-admin/post-new.php1,543 ▲2423.50 ▲0.05624.73 ▼50.4457.83 ▲2.81
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.01102.50 ▼3.2745.01 ▼2.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/basic-auth.php
    • > /wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/post.php
    • > /wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/session.php
    • > /wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/get.php
    • > /wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/multiple.php
    • > /wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/bin/create_pear_package.php
  • 65× 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/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/library/Requests/Transport/fsockopen.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/src/Order.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/src/Refund.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/library/Requests/Exception/HTTP/403.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/library/Requests/Exception/HTTP/412.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/tests/IRI.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'Requests_Hooker' not found in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/library/Requests/Hooks.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/library/Requests/Exception/HTTP/404.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/library/Requests/Exception/HTTP/411.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/campt-indian-payment-gateway/inc/razorpay/lib/razorpay-php/libs/Requests-1.6.1/bin/create_pear_package.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Instamojo Enable), #2 (Razorpay Enable)
The official readme.txt might help

campt-indian-payment-gateway/campt-indian-payment-gateway.php Passed 13 tests

Analyzing the main PHP file in "Camptix Indian Payments" version 1.8
80 characters long description:
Simple and Flexible payment ticketing for Camptix using Indian Payment Platforms

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 plugin6,978 lines of code in 123 files:
LanguageFilesBlank linesComment linesLines of code
PHP991,2513,5175,815
Markdown153220809
JavaScript359121216
JSON30082
XML12033
YAML20023

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.28
▷ Minimum class complexity1.00
▷ Maximum class complexity193.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces2
Interfaces5
Traits0
Classes87
▷ Abstract classes11.15%
▷ Concrete classes8698.85%
▷ Final classes00.00%
Methods432
▷ Static methods7918.29%
▷ Public methods36384.03%
▷ Protected methods5713.19%
▷ Private methods122.78%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants23
▷ Global constants313.04%
▷ Class constants2086.96%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.05MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png32.76KB36.66KB0.00%
screenshot-1.png23.42KB27.32KB0.00%