Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wpforms-.../src/Admin/Payments/Views/Overview
File: Helpers.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace WPForms\Admin\Payments\Views\Overview;
[2] Fix | Delete
[3] Fix | Delete
use WPForms\Db\Payments\ValueValidator;
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Helper methods for the Overview page.
[7] Fix | Delete
*
[8] Fix | Delete
* @since 1.8.2
[9] Fix | Delete
*/
[10] Fix | Delete
class Helpers {
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Get subscription description.
[14] Fix | Delete
*
[15] Fix | Delete
* @since 1.8.2
[16] Fix | Delete
*
[17] Fix | Delete
* @param string $payment_id Payment id.
[18] Fix | Delete
* @param string $amount Payment amount.
[19] Fix | Delete
*
[20] Fix | Delete
* @return string
[21] Fix | Delete
*/
[22] Fix | Delete
public static function get_subscription_description( $payment_id, $amount ) {
[23] Fix | Delete
[24] Fix | Delete
// Get the subscription period for the payment.
[25] Fix | Delete
$period = wpforms()->get( 'payment_meta' )->get_single( $payment_id, 'subscription_period' );
[26] Fix | Delete
$intervals = ValueValidator::get_allowed_subscription_intervals();
[27] Fix | Delete
[28] Fix | Delete
// If the subscription period is not set or not allowed, return the amount only.
[29] Fix | Delete
if ( ! isset( $intervals[ $period ] ) ) {
[30] Fix | Delete
return $amount;
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
// Use "/" as a separator between the amount and the subscription period.
[34] Fix | Delete
return $amount . ' / ' . $intervals[ $period ];
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Return a placeholder text "N/A" when there is no actual data to display.
[39] Fix | Delete
*
[40] Fix | Delete
* @since 1.8.2
[41] Fix | Delete
*
[42] Fix | Delete
* @param string $with_wrapper Wrap the text within a span tag for styling purposes. Default: true.
[43] Fix | Delete
*
[44] Fix | Delete
* @return string
[45] Fix | Delete
*/
[46] Fix | Delete
public static function get_placeholder_na_text( $with_wrapper = true ) {
[47] Fix | Delete
[48] Fix | Delete
$text = __( 'N/A', 'wpforms-lite' );
[49] Fix | Delete
[50] Fix | Delete
// Check if the text should be wrapped within a span tag.
[51] Fix | Delete
if ( $with_wrapper ) {
[52] Fix | Delete
return sprintf( '<span class="payment-placeholder-text-none">%s</span>', $text );
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
return $text;
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
/**
[59] Fix | Delete
* Get the default heading for the Payments pages.
[60] Fix | Delete
*
[61] Fix | Delete
* @since 1.8.2.2
[62] Fix | Delete
*
[63] Fix | Delete
* @param string $help_link Help link.
[64] Fix | Delete
*/
[65] Fix | Delete
public static function get_default_heading( $help_link = '' ) {
[66] Fix | Delete
[67] Fix | Delete
if ( ! $help_link ) {
[68] Fix | Delete
$help_link = 'https://wpforms.com/docs/viewing-and-managing-payments/';
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
echo '<span class="wpforms-payments-overview-help">';
[72] Fix | Delete
printf(
[73] Fix | Delete
'<a href="%s" target="_blank"><i class="fa fa-question-circle-o"></i>%s</a>',
[74] Fix | Delete
esc_url(
[75] Fix | Delete
wpforms_utm_link(
[76] Fix | Delete
$help_link,
[77] Fix | Delete
'Payments Dashboard',
[78] Fix | Delete
'Manage Payments Documentation'
[79] Fix | Delete
)
[80] Fix | Delete
),
[81] Fix | Delete
esc_html__( 'Help', 'wpforms-lite' )
[82] Fix | Delete
);
[83] Fix | Delete
echo '</span>';
[84] Fix | Delete
}
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function