Skip to content

PayPal Commerce#2678

Draft
Crabcyborg wants to merge 355 commits intomasterfrom
paypal
Draft

PayPal Commerce#2678
Crabcyborg wants to merge 355 commits intomasterfrom
paypal

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg commented Dec 22, 2025

@Crabcyborg Crabcyborg marked this pull request as draft December 22, 2025 14:33
@Crabcyborg Crabcyborg changed the title Paypal PayPal Commerce Dec 22, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 68.75000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.69%. Comparing base (94f2ce4) to head (4dc9125).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
formidable.php 71.42% 4 Missing ⚠️
classes/controllers/FrmHooksController.php 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #2678   +/-   ##
=========================================
  Coverage     26.68%   26.69%           
  Complexity     8870     8870           
=========================================
  Files           145      145           
  Lines         29798    29785   -13     
=========================================
- Hits           7951     7950    -1     
+ Misses        21847    21835   -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6c773436-44d2-4aae-9cf2-d08220ccc75c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch paypal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Jan 30, 2026

DeepSource Code Review

We reviewed changes in 1d27050...e5beaaf on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP May 7, 2026 12:21p.m. Review ↗
JavaScript May 7, 2026 12:21p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

}

foreach ( $action_classes as $action_class ) {
self::$registered_actions->register( $action_class );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot call method register() on array


The method you are trying to call is not defined, which can result in a fatal error.

* @param string $type
* @param array $field
*/
if ( apply_filters( 'frm_show_normal_field_type', $this->normal_field, $this->type, $this->field ) ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function apply_filters invoked with 4 parameters, 2 required


The function call is not valid, which will result in a fatal runtime error.

@@ -35,7 +35,7 @@
}

if ( $field['type'] === 'credit_card' && ! FrmAppHelper::pro_is_installed() ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $field might not be defined


A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.

if ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmSquareLiteConnectHelper::at_least_one_mode_is_setup() ) {
if ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmSquareLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmPayPalLiteConnectHelper::at_least_one_mode_is_setup() ) {
FrmStrpLiteAppHelper::not_connected_warning();
} elseif ( ! FrmTransLiteActionsController::get_actions_for_form( $field['form_id'] ) ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $field might not be defined


A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.

<?php
/* translators: %1$s: Link HTML, %2$s: End link */
printf( esc_html__( 'Credit Cards will not work without %1$sadding a Collect Payment action%2$s.', 'formidable' ), '<a href="?page=formidable&frm_action=settings&id=' . absint( $field['form_id'] ) . '&t=email_settings" target="_blank">', '</a>' );
printf( esc_html__( 'Credit Cards will not work without %1$sadding a Stripe, Square, or PayPal action%2$s.', 'formidable' ), '<a href="?page=formidable&frm_action=settings&id=' . absint( $field['form_id'] ) . '&t=email_settings" target="_blank">', '</a>' );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $field might not be defined


A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.

$product = self::check_for_product( $status->products, 'PPCP_CUSTOM' );
$only_supports_checkout_button = false;

if ( ! $product || empty( $product->capabilities ) ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property object|true::$capabilities


The property you are trying to access is not defined and will cause unexpected behavior when used.

return false;
}

if ( 'ACTIVE' !== $product->status ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot access property $status on object|true


The property you are trying to access is not defined and will cause unexpected behavior when used.


echo '<li>' . esc_html__( 'PayPal Checkout', 'formidable' ) . '</li>';

$can_process_card_fields = ! $only_supports_checkout_button && in_array( 'CUSTOM_CARD_PROCESSING', $product->capabilities, true );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot access property $capabilities on object|true


The property you are trying to access is not defined and will cause unexpected behavior when used.

* @return void
*/
private static function render_acdc_vetting_status( $product ) {
$vetting_status = $product && ! empty( $product->vetting_status ) ? $product->vetting_status : 'NOT_SET';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property object|true::$vetting_status


The property you are trying to access is not defined and will cause unexpected behavior when used.

/**
* @var array $data->event_ids
*/
return $data->event_ids;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot access property $event_ids on array


The property you are trying to access is not defined and will cause unexpected behavior when used.

*
* @return array<int,mixed> Field ID => value pairs.
*/
private static function get_order_data_field_updates( $payer, $response, $settings ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`get_order_data_field_updates` has a cyclomatic complexity of 17 with "High" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

*
* @return array<int,mixed> Field ID => new value pairs that differ from the current entry data.
*/
private static function get_payer_field_updates( $payer, $response, $action, $entry ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`get_payer_field_updates` has a cyclomatic complexity of 29 with "Very high" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

*
* @return void
*/
public static function load_scripts( $form_id ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`load_scripts` has a cyclomatic complexity of 28 with "Very high" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

*
* @return string
*/
private static function get_paypal_locale() { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded, SlevomatCodingStandard.Functions.FunctionLength.FunctionLength
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`get_paypal_locale` has a cyclomatic complexity of 40 with "Very high" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

*
* @return array
*/
public static function trigger_gateway( $action, $entry, $form ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`trigger_gateway` has a cyclomatic complexity of 20 with "High" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant