| @@ -14,9 +14,9 @@ | ||
| 14 | 14 | * Plugin URI: https://www.forge12.com/blog/so-verwendest-du-das-double-opt-in-fuer-contact-form-7/ |
| 15 | 15 | * Description: This plugin allows you to add a double OptIn System to your Contact Form 7 & Avada Forms. |
| 16 | 16 | * Text Domain: double-opt-in |
| 17 | 17 | * Domain Path: /languages |
| 18 | - * Version: 5.1.6 | |
| 18 | + * Version: 5.8.0 | |
| 19 | 19 | * Requires at least: 6.0 |
| 20 | 20 | * Requires PHP: 7.4 |
| 21 | 21 | * Author: Forge12 Interactive GmbH |
| 22 | 22 | * Author URI: https://www.forge12.com |
| @@ -56,9 +56,9 @@ | ||
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | if ( ! defined( 'FORGE12_OPTIN_VERSION' ) ) { |
| 60 | - define( 'FORGE12_OPTIN_VERSION', '5.1.6' ); | |
| 60 | + define( 'FORGE12_OPTIN_VERSION', '5.8.0' ); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // Addon API version — semver-independent from the plugin's marketing |
| 64 | 64 | // version. Bumped only on breaking changes to the Addon API surface |
| @@ -64,10 +64,28 @@ | ||
| 64 | 64 | // version. Bumped only on breaking changes to the Addon API surface |
| 65 | 65 | // (AddonInterface, AddonRegistry, AddonLicenseRegistry, FormIntegrationInterface, |
| 66 | 66 | // event payloads). Addons declare their requirement against this constant, |
| 67 | 67 | // not FORGE12_OPTIN_VERSION. |
| 68 | + // | |
| 69 | + // 4.4.0 (additive): FollowUp\FollowUpAdapterInterface, FollowUpCoordinator, | |
| 70 | + // FollowUpAdapterRegistry. Addons that implement follow-up adapters | |
| 71 | + // require ^4.4; everything else keeps working against 4.3. | |
| 72 | + // | |
| 73 | + // 4.5.0 (additive): AbstractFormIntegration::refusedConsentBeforeSubmit(), | |
| 74 | + // OptInError::isAlwaysShown()/shouldShowToVisitor(), | |
| 75 | + // OptInFrontend::getLastCreationError(), ErrorNotification::forget(). | |
| 76 | + // The Elementor, WPForms and Gravity Forms add-ons call them only when they | |
| 77 | + // exist (method_exists), so their requirement stays ^4.4. | |
| 78 | + // | |
| 79 | + // 4.6.0 (additive): Service\ConfirmationMailResender, Service\DoiMailHeaders | |
| 80 | + // (filter f12_doi_mail_headers), filter f12_doi_submit_notice_data, | |
| 81 | + // Events\Lifecycle\OptInOptedOutEvent / OptInReOptedInEvent, | |
| 82 | + // FollowUp\GlobalFollowUpAdapterInterface, OptInStatsRepository::activity(), | |
| 83 | + // OptInMailStatusRepository::countFailedBetween(). Opt-Out and Reminder use them | |
| 84 | + // only when they exist (class_exists), so their requirement does not change; | |
| 85 | + // the Welle-2 add-ons that build on them require ^4.6. | |
| 68 | 86 | if ( ! defined( 'F12_DOI_CORE_API_VERSION' ) ) { |
| 69 | - define( 'F12_DOI_CORE_API_VERSION', '4.3.0' ); | |
| 87 | + define( 'F12_DOI_CORE_API_VERSION', '4.6.0' ); | |
| 70 | 88 | } |
| 71 | 89 | if ( ! defined( 'FORGE12_OPTIN_SLUG' ) ) { |
| 72 | 90 | define( 'FORGE12_OPTIN_SLUG', 'f12-cf7-doubleoptin' ); |
| 73 | 91 | } |
| @@ -84,14 +102,25 @@ | ||
| 84 | 102 | */ |
| 85 | 103 | require_once 'logger/logger.php'; |
| 86 | 104 | require_once 'core/helpers/uuid.php'; |
| 87 | 105 | require_once 'core/telemetry.php'; |
| 106 | + // feedback.php first: review.php, credit_nudge.php and the deactivation | |
| 107 | + // survey all build their links with it. | |
| 108 | + require_once 'core/feedback.php'; | |
| 88 | 109 | require_once 'core/review.php'; |
| 110 | + require_once 'core/confirmation_output.php'; | |
| 111 | + require_once 'core/credit_link.php'; | |
| 112 | + require_once 'core/credit_nudge.php'; | |
| 113 | + require_once 'core/deactivation_survey.php'; | |
| 114 | + require_once 'core/admin_links.php'; | |
| 89 | 115 | require_once 'core/cron.php'; |
| 90 | 116 | require_once 'core/BaseController.class.php'; |
| 91 | 117 | |
| 92 | 118 | require_once 'OnActivation.php'; |
| 93 | 119 | require_once 'OnDeactivation.php'; |
| 120 | + // OnUpdate runs at include time, before autoload.php is registered | |
| 121 | + // further down — load the one PSR-4 class it needs explicitly. | |
| 122 | + require_once 'src/Repository/FollowUpSchema.php'; | |
| 94 | 123 | require_once 'OnUpdate.php'; |
| 95 | 124 | require_once 'compatibility/OptInFrontend.class.php'; |
| 96 | 125 | require_once 'core/SpamMechanics.class.php'; |
| 97 | 126 | |
| @@ -428,8 +457,14 @@ | ||
| 428 | 457 | |
| 429 | 458 | // Register admin REST API and audit services (v4.2.0+) |
| 430 | 459 | $container->addProvider( new \Forge12\DoubleOptIn\Providers\AdminServiceProvider() ); |
| 431 | 460 | |
| 461 | + // Setup wizard (v5.7.0+) | |
| 462 | + $container->addProvider( new \Forge12\DoubleOptIn\Providers\SetupServiceProvider() ); | |
| 463 | + | |
| 464 | + // Confirmation mail delivery status (v5.8.0+) | |
| 465 | + $container->addProvider( new \Forge12\DoubleOptIn\Providers\MailStatusServiceProvider() ); | |
| 466 | + | |
| 432 | 467 | // Register licensing registry (v4.3.0+ — entitlement state for paid addons) |
| 433 | 468 | $container->addProvider( new \Forge12\DoubleOptIn\Providers\LicensingServiceProvider() ); |
| 434 | 469 | |
| 435 | 470 | // Register migration registry (v4.3.0+ — runs pending DB migrations on admin_init) |
| @@ -434,11 +469,22 @@ | ||
| 434 | 469 | |
| 435 | 470 | // Register migration registry (v4.3.0+ — runs pending DB migrations on admin_init) |
| 436 | 471 | $container->addProvider( new \Forge12\DoubleOptIn\Providers\MigrationServiceProvider() ); |
| 437 | 472 | |
| 473 | + // Register follow-up coordinator (v5.6.0+ — status + retry of | |
| 474 | + // post-confirmation actions). Before AddonServiceProvider so | |
| 475 | + // the adapter registry exists when the form addons boot. | |
| 476 | + $container->addProvider( new \Forge12\DoubleOptIn\Providers\FollowUpServiceProvider() ); | |
| 477 | + | |
| 438 | 478 | // Register addon system (v4.3.0+ — public Addon API) |
| 439 | 479 | $container->addProvider( new \Forge12\DoubleOptIn\Providers\AddonServiceProvider() ); |
| 440 | 480 | |
| 481 | + // Register health checks (v5.3.0+ — Site Health surfaces for | |
| 482 | + // broken runtime preconditions such as a missing DB table). | |
| 483 | + // After AddonServiceProvider so addon-contributed checks are | |
| 484 | + // picked up by the registry's filter pass. | |
| 485 | + $container->addProvider( new \Forge12\DoubleOptIn\Providers\HealthServiceProvider() ); | |
| 486 | + | |
| 441 | 487 | // Register RateLimiter as singleton |
| 442 | 488 | $container->singleton( |
| 443 | 489 | \Forge12\DoubleOptIn\Service\RateLimiter::class, |
| 444 | 490 | function () { |
| @@ -548,8 +594,17 @@ | ||
| 548 | 594 | 'delete_unconfirmed' => 7, |
| 549 | 595 | 'delete_period' => 'months', |
| 550 | 596 | 'delete_unconfirmed_period' => 'months', |
| 551 | 597 | 'privacy_policy_page' => 0, |
| 598 | + // Must be listed even though the opt-out addon owns the | |
| 599 | + // feature: getSettings() rebuilds its return value from | |
| 600 | + // THIS array and silently drops any stored key that is | |
| 601 | + // missing here. Without the entry, every consumer of | |
| 602 | + // getSettings()['optout_page'] — OptInLinkGenerator and | |
| 603 | + // OptIn::get_link_optout(), i.e. the `[doubleoptoutlink]` | |
| 604 | + // placeholder — fell back to home_url() no matter what | |
| 605 | + // the admin had configured. | |
| 606 | + 'optout_page' => 0, | |
| 552 | 607 | 'token_expiry_hours' => 48, |
| 553 | 608 | 'rate_limit_ip' => 5, |
| 554 | 609 | 'rate_limit_email' => 3, |
| 555 | 610 | 'rate_limit_window' => 60, |
| @@ -683,9 +738,9 @@ | ||
| 683 | 738 | // Show warning for major/minor version changes |
| 684 | 739 | if ( version_compare( $new_minor, $current_minor, '>' ) ) { |
| 685 | 740 | $upgrade_notice = sprintf( |
| 686 | 741 | '</p><div class="notice inline notice-warning notice-alt" style="margin: 10px 0; padding: 10px; border-left-color: #ffb900;"><p><strong>%s</strong></p><p>%s</p></div><p style="display:none;">', |
| 687 | - esc_html__( '⚠️ Important: Major Update – Please backup before updating!', 'double-opt-in' ), | |
| 742 | + esc_html__( 'Important: Major Update – Please backup before updating!', 'double-opt-in' ), | |
| 688 | 743 | esc_html__( 'This version includes significant changes to the form management system, email templates, and database structure. We strongly recommend creating a full site backup before updating.', 'double-opt-in' ) |
| 689 | 744 | ); |
| 690 | 745 | |
| 691 | 746 | echo wp_kses_post( $upgrade_notice ); |