PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.6.2
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.6.2
5.6.2 5.6.3 5.6.1 5.6.0 5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 All 38 releases
← All changes | core/assets/doi-error-notification.js +11 -3 5.3.1 → 5.6.2 View file →
@@ -59,9 +59,12 @@
59 59 window.location.href = response.data.redirect_url;
60 60 return;
61 61 }
62 62
63 - showNotification( response.data.error.message, 'error' );
63 + // A toast that stands in for a hidden success message stays until
64 + // the visitor closes it — otherwise the form is left saying
65 + // nothing at all after ten seconds.
66 + showNotification( response.data.error.message, 'error', !! response.data.error.hide_confirmation );
64 67
65 68 // Prevent duplicate checks for 5 seconds
66 69 cooldown = true;
67 70 setTimeout( function () {
@@ -125,11 +128,12 @@
125 128 /**
126 129 * Show a toast notification.
127 130 *
128 131 * @param {string} message The message to display.
129 - * @param {string} [type] 'error' (default) or 'success' — controls colour + icon.
132 + * @param {string} [type] 'error' (default) or 'success' — controls colour + icon.
133 + * @param {boolean} [sticky] Keep it until the visitor closes it.
130 134 */
131 - function showNotification( message, type ) {
135 + function showNotification( message, type, sticky ) {
132 136 type = type === 'success' ? 'success' : 'error';
133 137
134 138 var existing = document.querySelector( '.doi-error-notification' );
135 139 if ( existing ) {
@@ -172,8 +176,12 @@
172 176 // Trigger enter animation
173 177 requestAnimationFrame( function () {
174 178 notification.classList.add( 'doi-error-notification--visible' );
175 179 } );
180 +
181 + if ( sticky ) {
182 + return;
183 + }
176 184
177 185 // Auto-dismiss after 10 seconds
178 186 setTimeout( function () {
179 187 dismiss( notification );