: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace WPForms\Admin\Payments\Views\Overview;
use WPForms\Db\Payments\ValueValidator;
* Helper methods for the Overview page.
* Get subscription description.
* @param string $payment_id Payment id.
* @param string $amount Payment amount.
public static function get_subscription_description( $payment_id, $amount ) {
// Get the subscription period for the payment.
$period = wpforms()->get( 'payment_meta' )->get_single( $payment_id, 'subscription_period' );
$intervals = ValueValidator::get_allowed_subscription_intervals();
// If the subscription period is not set or not allowed, return the amount only.
if ( ! isset( $intervals[ $period ] ) ) {
// Use "/" as a separator between the amount and the subscription period.
return $amount . ' / ' . $intervals[ $period ];
* Return a placeholder text "N/A" when there is no actual data to display.
* @param string $with_wrapper Wrap the text within a span tag for styling purposes. Default: true.
public static function get_placeholder_na_text( $with_wrapper = true ) {
$text = __( 'N/A', 'wpforms-lite' );
// Check if the text should be wrapped within a span tag.
return sprintf( '<span class="payment-placeholder-text-none">%s</span>', $text );
* Get the default heading for the Payments pages.
* @param string $help_link Help link.
public static function get_default_heading( $help_link = '' ) {
$help_link = 'https://wpforms.com/docs/viewing-and-managing-payments/';
echo '<span class="wpforms-payments-overview-help">';
'<a href="%s" target="_blank"><i class="fa fa-question-circle-o"></i>%s</a>',
'Manage Payments Documentation'
esc_html__( 'Help', 'wpforms-lite' )