57% knit-pay

Code Review | Knit Pay - Instamojo, Razorpay, Cashfree, Stripe, Easebuzz, UPI QR, CCAvenue, GoUrl

WordPress plugin Knit Pay - Instamojo, Razorpay, Cashfree, Stripe, Easebuzz, UPI QR, CCAvenue, GoUrl scored57%from 54 tests.

About plugin

  • Plugin page: knit-pay
  • Plugin version: 8.85.3.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.4
  • WordPress version: 6.3.1
  • First release: May 30, 2020
  • Latest release: Nov 28, 2023
  • Number of updates: 702
  • Update frequency: every 1.8 days
  • Top authors: knitpay (100%)

Code review

54 tests

User reviews

78 reviews

Install metrics

2,000+ active /159,761 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲5.59MB] [CPU: ▲62.67ms] 25% from 4 tests

This is a short check of server-side resources used by Knit Pay - Instamojo, Razorpay, Cashfree, Stripe, Easebuzz, UPI QR, CCAvenue, GoUrl
The following require your attention
  • RAM: You should keep total memory usage under 10MB (currently 10.13MB on /wp-admin/admin.php?page=pronamic_ideal)
  • CPU: The total CPU usage must kept under 500.00ms (currently 4,528.58ms on /wp-admin/admin.php?page=pronamic_ideal)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.59MB on /wp-admin/admin.php?page=pronamic_ideal)
PageMemory (MB)CPU Time (ms)
Home /8.49 ▲5.0389.91 ▲53.58
Dashboard /wp-admin9.07 ▲5.77110.31 ▲59.98
Posts /wp-admin/edit.php9.13 ▲5.77119.25 ▲70.18
Add New Post /wp-admin/post-new.php11.76 ▲5.87168.29 ▲74.80
Media Library /wp-admin/upload.php9.01 ▲5.78103.18 ▲66.92
Settings /wp-admin/admin.php?page=pronamic_pay_settings8.9497.75
Configurations /wp-admin/edit.php?post_type=pronamic_gateway9.0688.89
Scheduled Actions /wp-admin/tools.php?page=action-scheduler9.21109.29
Dashboard /wp-admin/admin.php?page=pronamic_ideal10.134,528.58

Server storage [IO: ▲19.19MB] [DB: ▲0.04MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3,099 new files
Database: 4 new tables, 12 new options
New tables
wp_actionscheduler_claims
wp_actionscheduler_groups
wp_actionscheduler_logs
wp_actionscheduler_actions
New WordPress options
pronamic_pay_home_url
action_scheduler_hybrid_store_demarkation
widget_theysaidso_widget
widget_recent-posts
knit_pay_version
schema-ActionScheduler_StoreSchema
widget_recent-comments
theysaidso_admin_options
pronamic_pay_active_payment_methods
schema-ActionScheduler_LoggerSchema
...

Browser metrics Passed 4 tests

An overview of browser requirements for Knit Pay - Instamojo, Razorpay, Cashfree, Stripe, Easebuzz, UPI QR, CCAvenue, GoUrl
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,061 ▲31414.72 ▲0.371.70 ▲0.0534.82 ▼9.01
Dashboard /wp-admin2,436 ▲2555.88 ▲0.16107.70 ▼13.8248.18 ▲0.92
Posts /wp-admin/edit.php2,248 ▲1482.51 ▲0.5051.11 ▲10.7037.71 ▼8.75
Add New Post /wp-admin/post-new.php1,753 ▲22621.75 ▼1.40722.51 ▲30.4739.91 ▼3.77
Media Library /wp-admin/upload.php1,542 ▲1424.36 ▲0.17102.47 ▼7.4842.15 ▼5.32
Settings /wp-admin/admin.php?page=pronamic_pay_settings1,1602.3641.9030.64
Configurations /wp-admin/edit.php?post_type=pronamic_gateway1,2472.4747.1133.48
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,4982.0039.4135.89
Dashboard /wp-admin/admin.php?page=pronamic_ideal1,1092.3837.0937.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
    • wp_actionscheduler_claims
  • Zombie WordPress options detected upon uninstall: 13 options
    • schema-ActionScheduler_LoggerSchema
    • action_scheduler_hybrid_store_demarkation
    • action_scheduler_migration_status
    • widget_theysaidso_widget
    • widget_recent-comments
    • schema-ActionScheduler_StoreSchema
    • knit_pay_version
    • pronamic_pay_home_url
    • widget_recent-posts
    • db_upgraded
    • ...

Smoke tests 50% 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 0% 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 items
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/knit-pay/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/knit-pay/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/knit-pay/extensions/team-booking/src/Gateway.php
    • > /wp-content/plugins/knit-pay/gateways/razorpay/src/views/checkout.php
    • > /wp-content/plugins/knit-pay/extensions/vik-wp/src/AbstractKnitPayPayment.php
    • > /wp-content/plugins/knit-pay/extensions/latepoint/src/index.php
    • > /wp-content/plugins/knit-pay/gateways/instamojo/src/views/checkout.php
  • 1225× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Pronamic\\WordPress\\Pay\\Core\\Gateway' not found in wp-content/plugins/knit-pay/gateways/flutterwave/src/Gateway.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Pronamic\\WordPress\\Pay\\Extensions\\MemberPress\\Gateways\\Gateway' not found in wp-content/plugins/knit-pay/vendor/wp-pay-extensions/memberpress/src/Gateways/KlarnaPayLaterGateway.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/knit-pay/vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Pronamic\\WordPress\\Pay\\Extensions\\Charitable\\Gateway' not found in wp-content/plugins/knit-pay/vendor/wp-pay-extensions/charitable/src/CreditCardGateway.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\OAuth\\OAuthErrorException' not found in wp-content/plugins/knit-pay/vendor/stripe/stripe-php/lib/Exception/OAuth/UnsupportedResponseTypeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Iyzipay\\Request' not found in wp-content/plugins/knit-pay/vendor/iyzico/iyzipay-php/src/Iyzipay/Request/CreateApmInitializeRequest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/knit-pay/vendor/razorpay/razorpay/src/Refund.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/knit-pay/vendor/stripe/stripe-php/lib/BitcoinTransaction.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Iyzipay\\Model\\Mapper\\Subscription\\SubscriptionCreateCheckoutFormResourceMapper' not found in wp-content/plugins/knit-pay/vendor/iyzico/iyzipay-php/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateCheckoutFormMapper.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Iyzipay\\Model\\Mapper\\IyzipayResourceMapper' not found in wp-content/plugins/knit-pay/vendor/iyzico/iyzipay-php/src/Iyzipay/Model/Mapper/ApmResourceMapper.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
The official readme.txt is a good inspiration

knit-pay/knit-pay.php 85% from 13 tests

The primary PHP file in "Knit Pay - Instamojo, Razorpay, Cashfree, Stripe, Easebuzz, UPI QR, CCAvenue, GoUrl" version 8.85.3.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/knit-pay/vendor/stripe/stripe-php/data/ca-certificates.crt
151,880 lines of code in 2,119 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,91434,20077,561131,827
JavaScript412,4322,3348,433
JSON41005,087
Markdown101,03602,080
XML5062,037
CSS20171421,301
SVG76011710
HTML1550150
PO File32935114
YAML361054
Sass15046
make110029
reStructuredText312412

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.72
▷ Minimum class complexity1.00
▷ Maximum class complexity245.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity90.00
Code structure
Namespaces246
Interfaces94
Traits28
Classes1,632
▷ Abstract classes482.94%
▷ Concrete classes1,58497.06%
▷ Final classes17010.73%
Methods10,002
▷ Static methods1,59515.95%
▷ Public methods8,94589.43%
▷ Protected methods3803.80%
▷ Private methods6776.77%
Functions516
▷ Named functions24146.71%
▷ Anonymous functions27553.29%
Constants1,708
▷ Global constants271.58%
▷ Class constants1,68198.42%
▷ Public constants1,64797.98%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
886 compressed PNG files occupy 6.72MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/wp-pay/core/images/dist/cards/knab/card-knab-logo-_x80@2x.png4.02KB3.97KB▼ 1.38%
images/credit-card/icon-125x60@4x.png21.19KB20.04KB▼ 5.40%
images/mollie/mollie-logo-style-x-small.png1.92KB1.81KB▼ 5.56%
images/abn-amro/icon-64x64@4x.png3.78KB2.46KB▼ 34.92%
vendor/wp-pay/core/images/dist/cards/handelsbanken/card-handelsbanken-logo-_x80@2x.png4.69KB4.64KB▼ 1.19%