: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/* global wpforms_admin */
var WPFormsConnect = window.WPFormsConnect || ( function( document, window, $ ) {
$connectBtn: $( '#wpforms-settings-connect-btn' ),
$connectKey: $( '#wpforms-settings-upgrade-license-key' ),
* Public functions and properties.
* Register connect button event.
connectBtnClick: function() {
el.$connectBtn.on( 'click', function( event ) {
* Get the alert arguments in case of Pro already installed.
* @param {object} res Ajax query result object.
* @returns {object} Alert arguments.
proAlreadyInstalled: function( res ) {
text: wpforms_admin.plugin_activate_btn,
window.location.reload();
title: wpforms_admin.almost_done,
content: res.data.message,
icon: 'fa fa-check-circle',
gotoUpgradeUrl: function() {
action: 'wpforms_connect_url',
key: el.$connectKey.val(),
nonce: wpforms_admin.nonce,
$.post( wpforms_admin.ajax_url, data )
$.alert( app.proAlreadyInstalled( res ) );
window.location.href = res.data.url;
title: wpforms_admin.oops,
content: res.data.message,
icon: 'fa fa-exclamation-circle',
* Alert in case of server error.
* @param {object} xhr XHR object.
failAlert: function( xhr ) {
title: wpforms_admin.oops,
content: wpforms_admin.server_error + '<br>' + xhr.status + ' ' + xhr.statusText + ' ' + xhr.responseText,
icon: 'fa fa-exclamation-circle',
// Provide access to public functions/properties.
}( document, window, jQuery ) );