Quantcast
Channel: WordPress.org Forums » [Forminator Forms – Contact Form, Payment Form & Custom Form Builder] Support
Viewing all articles
Browse latest Browse all 1455

creditcard.php found in mu-plugins directory: Is it still needed?

$
0
0

Replies: 2

Hello, I found a Forminator creditcard.php file in my site’s mu-plugins directory. Is this plugin still required or can I remove it? I’ll paste the code below. Thank you.

<?php
/**
* Plugin Name: [Forminator Pro] Replace statement_descriptor
* Description: Quick fix to replace statement_descriptor with
* Author URI: https://wpmudev.com
* License: GPLv2 or later
*
* @package WordPress
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

add_action( 'plugins_loaded', 'replace_statement_descriptor_in_stripe_library' );

function replace_statement_descriptor_in_stripe_library() {

// File containing the async request class.
$file = WP_PLUGIN_DIR . '/forminator/library/fields/stripe.php';

// Check if async request file exists.
if ( ! file_exists( $file ) ) {
return;
}

// Get the file contents.
$content = file_get_contents( $file );

// Check if we have content.
if ( ! $content ) {
return;
}

// Change statement_descriptor to statement_descriptor_suffix.
$new_content = str_replace( "['statement_descriptor']", "['statement_descriptor_suffix']", $content );

// Update only if content changed.
if ( $new_content !== $content ) {
file_put_contents( $file, $new_content );
}

}

Viewing all articles
Browse latest Browse all 1455

Trending Articles