: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'field_type' => 'address',
/*************************************************************************
* Output methods - these methods generally return HTML for the builder. *
*************************************************************************/
* Provider account authorize fields HTML.
public function output_auth() {
$providers = wpforms_get_providers_options();
$class = ! empty( $providers[ $this->slug ] ) ? 'hidden' : '';
<div class="wpforms-provider-account-add <?php echo sanitize_html_class( $class ); ?> wpforms-connection-block">
<h4><?php esc_html_e( 'Add New Account', 'wpforms-lite' ); ?></h4>
<?php esc_html_e( 'Please fill out all of the fields below to register your new Constant Contact account.', 'wpforms-lite' ); ?>
<a href="<?php echo esc_url( wpforms_utm_link( 'https://wpforms.com/docs/how-to-connect-constant-contact-with-wpforms/', 'Marketing Integrations', 'Constant Contact Documentation' ) ); ?>" target="_blank" rel="noopener noreferrer">
<?php esc_html_e( 'Click here for documentation on connecting WPForms with Constant Contact.', 'wpforms-lite' ); ?>
<p class="wpforms-alert wpforms-alert-warning">
<?php esc_html_e( 'Because Constant Contact requires external authentication, you will need to register WPForms with Constant Contact before you can proceed.', 'wpforms-lite' ); ?>
<a onclick="window.open(this.href,'','resizable=yes,location=no,width=750,height=500,status'); return false" href="https://oauth2.constantcontact.com/oauth2/oauth/siteowner/authorize?response_type=code&client_id=c58xq3r27udz59h9rrq7qnvf&redirect_uri=https://wpforms.com/oauth/constant-contact/" class="btn">
<?php esc_html_e( 'Click here to register with Constant Contact', 'wpforms-lite' ); ?>
'<input type="text" data-name="authcode" placeholder="%s %s *" class="wpforms-required">',
esc_attr__( 'Authorization Code', 'wpforms-lite' )
'<input type="text" data-name="label" placeholder="%s %s *" class="wpforms-required">',
esc_attr__( 'Account Nickname', 'wpforms-lite' )
'<button data-provider="%s">%s</button>',
esc_html__( 'Connect', 'wpforms-lite' )
* Provider account list groups HTML.
* @param string $connection_id Connection Id.
* @param array $connection Connection data.
public function output_groups( $connection_id = '', $connection = [] ) {
// No groups or segments for this provider.
* Default content for the provider settings panel in the form builder.
* @param string $content Default content.
public function builder_settings_default_content( $content ) {
<a href="<?php echo esc_url( $this->sign_up ); ?>" class="wpforms-btn wpforms-btn-md wpforms-btn-orange" target="_blank" rel="noopener noreferrer">
<?php esc_html_e( 'Try Constant Contact for Free', 'wpforms-lite' ); ?>
'<a href="%s" target="_blank" rel="noopener noreferrer" class="secondary-text">%s</a>',
esc_url( admin_url( 'admin.php?page=wpforms-page&view=constant-contact' ) ),
esc_html__( 'Learn more about the power of email marketing.', 'wpforms-lite' )
return $content . ob_get_clean();
/*************************************************************************
* Integrations tab methods - these methods relate to the settings page. *
*************************************************************************/
* AJAX to add a provider from the settings integrations tab.
public function integrations_tab_add() {
// phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput
if ( $_POST['provider'] !== $this->slug ) {
// phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput
$data = ! empty( $_POST['data'] ) ? wp_parse_args( wp_unslash( $_POST['data'] ), [] ) : [];
if ( empty( $data['authcode'] ) ) {
'error_msg' => esc_html__( 'The "Authorization Code" is required.', 'wpforms-lite' ),
if ( empty( $data['label'] ) ) {
'error_msg' => esc_html__( 'The "Account Nickname" is required.', 'wpforms-lite' ),
parent::integrations_tab_add();
* Form fields to add a new provider account.
public function integrations_tab_new_form() {
<a href="<?php echo esc_url( wpforms_utm_link( 'https://wpforms.com/docs/how-to-connect-constant-contact-with-wpforms/', 'Settings - Integration', 'Constant Contact Documentation' ) ); ?>" target="_blank" rel="noopener noreferrer">
<?php esc_html_e( 'Click here for documentation on connecting WPForms with Constant Contact.', 'wpforms-lite' ); ?>
<p class="wpforms-alert wpforms-alert-warning">
<?php esc_html_e( 'Because Constant Contact requires external authentication, you will need to register WPForms with Constant Contact before you can proceed.', 'wpforms-lite' ); ?>
<a onclick="window.open(this.href,'','resizable=yes,location=no,width=800,height=600,status'); return false" href="https://oauth2.constantcontact.com/oauth2/oauth/siteowner/authorize?response_type=code&client_id=c58xq3r27udz59h9rrq7qnvf&redirect_uri=https://wpforms.com/oauth/constant-contact/" class="btn">
<?php esc_html_e( 'Click here to register with Constant Contact', 'wpforms-lite' ); ?>
'<input type="text" name="authcode" placeholder="%s %s *" class="wpforms-required">',
esc_attr__( 'Authorization Code', 'wpforms-lite' )
'<input type="text" name="label" placeholder="%s %s *" class="wpforms-required">',
esc_attr__( 'Account Nickname', 'wpforms-lite' )
/************************
************************/
* Add admin notices to connect to Constant Contact.
public function connect_request() {
// Only consider showing the review request to admin users.
if ( ! is_super_admin() ) {
// Don't display on WPForms admin content pages.
// phpcs:disable WordPress.Security.NonceVerification.Recommended
if ( ! empty( $_GET['wpforms-page'] ) ) {
// Don't display if user is about to connect via Settings page.
if ( ! empty( $_GET['wpforms-integration'] ) && $this->slug === $_GET['wpforms-integration'] ) {
// phpcs:enable WordPress.Security.NonceVerification.Recommended
// Only display the notice if the Constant Contact option is set and
// there are previous Constant Contact connections created.
// Please do not delete 'wpforms_constant_contact' option check from the code.
$cc_notice = get_option( 'wpforms_constant_contact', false );
$providers = wpforms_get_providers_options();
if ( ! $cc_notice || ! empty( $providers[ $this->slug ] ) ) {
// Output the notice message.
$connect = admin_url( 'admin.php?page=wpforms-settings&view=integrations&wpforms-integration=constant-contact#!wpforms-tab-providers' );
$learn_more = admin_url( 'admin.php?page=wpforms-page&view=constant-contact' );
__( 'Get the most out of the <strong>WPForms</strong> plugin — use it with an active Constant Contact account.', 'wpforms-lite' ),
<a href="<?php echo esc_url( $this->sign_up ); ?>" class="button-primary" target="_blank" rel="noopener noreferrer">
<?php esc_html_e( 'Try Constant Contact for Free', 'wpforms-lite' ); ?>
<a href="<?php echo esc_url( $connect ); ?>" class="button-secondary">
<?php esc_html_e( 'Connect your existing account', 'wpforms-lite' ); ?>
sprintf( /* translators: %s - WPForms Constant Contact internal URL. */
__( 'Learn More about the <a href="%s">power of email marketing</a>', 'wpforms-lite' ),
.wpforms-constant-contact-notice p:first-of-type {
.wpforms-constant-contact-notice p:last-of-type {
.wpforms-constant-contact-notice .button-primary,
.wpforms-constant-contact-notice .button-secondary {
$notice = ob_get_clean();
\WPForms\Admin\Notice::info(
'dismiss' => \WPForms\Admin\Notice::DISMISS_GLOBAL,
'slug' => 'constant_contact_connect',
'class' => 'wpforms-constant-contact-notice',
* Dismiss the Constant Contact admin notice.
* @since 1.6.7.1 Added parameter $notice_id.
* @param string $notice_id Notice ID (slug).
public function connect_dismiss( $notice_id = '' ) {
if ( $notice_id !== 'global-constant_contact_connect' ) {
delete_option( 'wpforms_constant_contact' );
new WPForms_Constant_Contact();