HEX
Server: Apache
System: Linux webd001.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: mciraet (192513)
PHP: 8.2.31
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/mciraet/www/wp-content/plugins/mailchimp-for-woocommerce/blocks/newsletter.php
<?php

define( 'MAILCHIMP_WOOCOMMERCE_NEWSLETTER_VERSION', '1.0.0' );

add_action( 'woocommerce_blocks_loaded', function() {

    if (!function_exists('mailchimp_is_configured') || !mailchimp_is_configured()) {
        return;
    }

	if (class_exists( '\Automattic\WooCommerce\Blocks\Package' ) &&
        class_exists('\Automattic\WooCommerce\StoreApi\StoreApi') &&
	    interface_exists('\Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface')) {

        add_action( 'woocommerce_store_api_checkout_update_order_from_request', array( 'Mailchimp_Woocommerce_Newsletter_Blocks_Integration', 'order_processed' ), 10, 2 );
        add_action( 'woocommerce_store_api_checkout_order_processed', array( 'Mailchimp_Woocommerce_Newsletter_Blocks_Integration', 'order_customer_processed' ) );


		require_once dirname( __FILE__ ) . '/woocommerce-blocks-integration.php';
        require_once dirname( __FILE__ ) . '/woocommerce-blocks-extend-store-endpoint.php';

		add_action(
			'woocommerce_blocks_checkout_block_registration',
			function( $integration_registry ) {
				$integration_registry->register( new Mailchimp_Woocommerce_Newsletter_Blocks_Integration() );
			}
		);

		Mailchimp_Woocommerce_Newsletter_Blocks_Extend_Store_Endpoint::init();

        if (mailchimp_sms_consent_active()) {
            add_action( 'woocommerce_store_api_checkout_update_order_from_request', array( 'Mailchimp_Woocommerce_Sms_Blocks_Integration', 'order_processed' ), 10, 2 );
            add_action( 'woocommerce_store_api_checkout_order_processed', array( 'Mailchimp_Woocommerce_Sms_Blocks_Integration', 'order_customer_processed' ) );

            require_once dirname( __FILE__ ) . '/woocommerce-sms-blocks-integration.php';
            require_once dirname( __FILE__ ) . '/woocommerce-blocks-extend-store-endpoint-sms.php';

            add_action(
                'woocommerce_blocks_checkout_block_registration',
                function( $integration_registry ) {
                    $integration_registry->register( new Mailchimp_Woocommerce_Sms_Blocks_Integration() );
                }
            );

            Mailchimp_Woocommerce_Sms_Blocks_Extend_Store_Endpoint::init();
        }
	}
} );