PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.9.0
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.9.0
5.9.0 5.8.0 5.8.1 5.7.0 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 All 42 releases
← All changes | src/FormSettings/FormSettingsService.php +31 -0 5.3.2 → 5.9.0 View file →
@@ -8,9 +8,11 @@
8 8
9 9 namespace Forge12\DoubleOptIn\FormSettings;
10 10
11 11 use Forge12\DoubleOptIn\EmailTemplates\EmailTemplateRepository;
12 +use Forge12\DoubleOptIn\Health\StaleConsentFieldCheck;
12 13 use Forge12\DoubleOptIn\Integration\FormIntegrationRegistry;
14 +use Forge12\DoubleOptIn\Integration\FieldTextProviderInterface;
13 15 use Forge12\DoubleOptIn\Integration\SubmittedContent;
14 16 use Forge12\Shared\LoggerInterface;
15 17
16 18 if ( ! defined( 'ABSPATH' ) ) {
@@ -144,8 +146,14 @@
144 146 'enabled' => $settings->enabled,
145 147 )
146 148 );
147 149
150 + // The acceptance-field health check caches its scan for hours.
151 + // Someone who just saved these settings very likely did so to fix
152 + // what that check reported, and a stale "still broken" would be a
153 + // bad answer.
154 + StaleConsentFieldCheck::flush();
155 +
148 156 return true;
149 157 }
150 158
151 159 /**
@@ -331,8 +339,31 @@
331 339 $fieldsList[] = array(
332 340 'name' => (string) $name,
333 341 'label' => $label,
334 342 );
343 + }
344 +
345 + // The wording next to each field, where the integration knows it,
346 + // so the consent tab can compare it with the stored consent text.
347 + $texts = $integrationInstance instanceof FieldTextProviderInterface ? $integrationInstance->getFieldTexts( $formId ) : array();
348 + /**
349 + * Visible text per field name (e.g. the label of a consent checkbox).
350 + *
351 + * @since 5.9.0
352 + *
353 + * @param array<string, string> $texts Field name => plain text.
354 + * @param int|string $formId The form ID.
355 + * @param string $integration The integration identifier.
356 + */
357 + $texts = apply_filters( 'f12_doi_form_field_texts', $texts, $formId, $integrationInstance->getIdentifier() );
358 + if ( is_array( $texts ) ) {
359 + foreach ( $fieldsList as &$entry ) {
360 + $text = $texts[ $entry['name'] ] ?? '';
361 + if ( is_string( $text ) && trim( $text ) !== '' ) {
362 + $entry['text'] = trim( $text );
363 + }
364 + }
365 + unset( $entry );
335 366 }
336 367
337 368 // Reconcile the stored consent field with the form's real field
338 369 // names. Settings written before 5.3.2 went through