Automattic\WooCommerce\Admin\Marketing

InstalledExtensions::get_mailpoet_extension_data()protected staticWC 1.0

Get MailPoet extension data.

Method of the class: InstalledExtensions{}

No Hooks.

Return

Array|true|false.

Usage

$result = InstalledExtensions::get_mailpoet_extension_data();

InstalledExtensions::get_mailpoet_extension_data() code WC 7.1.1

protected static function get_mailpoet_extension_data() {
	$slug = 'mailpoet';

	if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
		return false;
	}

	$data         = self::get_extension_base_data( $slug );
	$data['icon'] = WC_ADMIN_IMAGES_FOLDER_URL . '/marketing/mailpoet.svg';

	if ( 'activated' === $data['status'] && class_exists( '\MailPoet\API\API' ) ) {
		$mailpoet_api = \MailPoet\API\API::MP( 'v1' );

		if ( ! method_exists( $mailpoet_api, 'isSetupComplete' ) || $mailpoet_api->isSetupComplete() ) {
			$data['status']      = 'configured';
			$data['settingsUrl'] = admin_url( 'admin.php?page=mailpoet-settings' );
		} else {
			$data['settingsUrl'] = admin_url( 'admin.php?page=mailpoet-newsletters' );
		}

		$data['docsUrl']    = 'https://kb.mailpoet.com/';
		$data['supportUrl'] = 'https://www.mailpoet.com/support/';
	}

	return $data;
}