<?php
	$list_support_plugins_class = array(
		'B2bwhs'                            => array(
			'plugin_name'  => 'B2BWholesaleSuite',
			'plugin_title' => 'B2B & Wholesale Suite',
		),
		'THWCFD'                            => array(
			'plugin_name'  => 'B2BWholesaleSuite',
			'plugin_title' => 'Checkout Field Editor',
		),
		'Woocommerce_German_Market'         => array(
			'plugin_name'  => 'woocommerce_german_market',
			'plugin_title' => 'WooCommerce German Market',
		),
		'WooCommerce_Germanized'            => array(
			'plugin_name'  => 'WooCommerce_Germanized',
			'plugin_title' => 'Germanized',
		),
		'LMFWC_PLUGIN_FILE'                 => array(
			'plugin_name'  => 'LMFWC',
			'plugin_title' => 'License Manager for WooCommerce',
		),
		'WC_Subscription'                   => array(
			'plugin_name'  => 'WC_Subscription',
			'plugin_title' => 'WooCommerce Subscriptions',
		),
		'WC_Email_Cancelled_Customer_Order' => array(
			'plugin_name'  => 'WC_Email_Cancelled_Customer_Order',
			'plugin_title' => 'Order Cancellation Email to Customer',
		),
		'order_delivery_date'               => array(
			'plugin_name'  => 'Order_Delivery_Date',
			'plugin_title' => 'Order Delivery Date Pro WooCommerce',
		),
		'WC_Smart_Coupons'                  => array(
			'plugin_name'  => 'WC_Smart_Coupons',
			'plugin_title' => 'WooCommerce Smart Coupons',
		),
		'Sg_Order_Approval_Woocommerce_Pro' => array(
			'plugin_name'  => 'Sg_Order_Approval',
			'plugin_title' => 'SG Order Approval',
		),
		'WCV_PRO_VERSION'                   => array(
			'plugin_name'  => 'WC_Vendors',
			'plugin_title' => 'WooCommerce Vendors Marketplace',
		),
		'Split_Orders'                      => array(
			'plugin_name'  => 'Split_Orders',
			'plugin_title' => 'WooCommerce Split Orders',
		),
		'SUMOSubscriptions'                 => array(
			'plugin_name'  => 'Sumo_Subscription',
			'plugin_title' => 'SUMO Subscriptions',
		),
		'WC_PIP_Loader'                     => array(
			'plugin_name'  => 'WC_PIP_Loader',
			'plugin_title' => 'WooCommerce Print Invoices/Packing Lists',
		),
		'WC_Account_Funds'                  => array(
			'plugin_name'  => 'Account_Funds',
			'plugin_title' => 'WooCommerce Account Funds',
		),
		'WC_Appointments'                   => array(
			'plugin_name'  => 'Woo_appointments',
			'plugin_title' => 'WooCommerce Appointments',
		),
		'WooCommerceB2B'                    => array(
			'plugin_name'  => 'WooCommerceB2B',
			'plugin_title' => 'WooCommerce B2B',
		),
		'WC_Bookings'                       => array(
			'plugin_name'  => 'WC_Bookings',
			'plugin_title' => 'WooCommerce Bookings',
		),
		'wc_deposits_woocommerce_is_active' => array(
			'plugin_name'  => 'Woo_Deposits',
			'plugin_title' => 'WooCommerce Deposits',
		),
		'Follow_Up_Emails'                  => array(
			'plugin_name'  => 'Follow_Up_Emails',
			'plugin_title' => 'WooCommerce Follow-Ups',
		),
		'WC_Gift_Cards'                     => array(
			'plugin_name'  => 'Woo_Gift_Cards',
			'plugin_title' => 'WooCommerce Gift Cards',
		),
		'WC_Order_Delivery'                 => array(
			'plugin_name'  => 'Woo_Order_Delivery',
			'plugin_title' => 'WooCommerce Order Delivery',
		),
		'WC_Pre_Orders'                     => array(
			'plugin_name'  => 'Woo_PreOrders',
			'plugin_title' => 'WooCommerce Pre-Orders',
		),
		'Quotes_WC'                         => array(
			'plugin_name'  => 'Quotes_WC',
			'plugin_title' => 'Quotes for WooCommerce',
		),
		'WooCommerce_simple_auction'        => array(
			'plugin_name'  => 'Woo_Simple_Auction',
			'plugin_title' => 'WooCommerce Simple Auction',
		),
		'WooCommerce_Waitlist_Plugin'       => array(
			'plugin_name'  => 'WooCommerce_Waitlist',
			'plugin_title' => 'WooCommerce Waitlist',
		),
		'WPCF_PRO_VERSION'                  => array(
			'plugin_name'  => 'WP_Crowdfunding',
			'plugin_title' => 'WP Crowdfunding',
		),
		'YITH_Pre_Order_Premium'            => array(
			'plugin_name'  => 'YITH_Pre_Order',
			'plugin_title' => 'YITH Pre-Order for WooCommerce Premium',
		),
		'YWSBS_Subscription'                => array(
			'plugin_name'  => 'YITH_Subscription',
			'plugin_title' => 'YITH WooCommerce Subscription',
		),
		'YITH_Vendors'                      => array(
			'plugin_name'  => 'YITH_Vendors',
			'plugin_title' => 'YITH WooCommerce Multi Vendor Premium',
		),
		'YITH_WC_Coupon_Email_System'       => array(
			'plugin_name'  => 'YITH_WooCommerce_Coupon_Email_System_Premium',
			'plugin_title' => 'YITH WooCommerce Coupon Email System Premium',
		),
		'ParcelPanel\ParcelPanel'           => array(
			'plugin_name'  => 'parcel_panel_order_tracking',
			'plugin_title' => 'Parcel Panel Order Tracking for WooCommerce',
		),
		'LpcInit'                           => array(
			'plugin_name'  => 'colissimo_shipping_woo',
			'plugin_title' => 'Colissimo shipping methods for WooCommerce',
		),
		'WeDevs_Dokan'                      => array(
			'plugin_name'  => 'dokan',
			'plugin_title' => 'Dokan',
		),
		'CARTFLOWS_CA_Loader'               => array(
			'plugin_name'  => 'wc_cart_abandonment_recovery',
			'plugin_title' => 'WooCommerce Cart Abandonment Recovery',
		),
		'AutomateWoo_Loader'                => array(
			'plugin_name'  => 'automatewoo',
			'plugin_title' => 'AutomateWoo',
		),
		'BM'                                => array(
			'plugin_name'  => 'b2b_market',
			'plugin_title' => 'B2B Market',
		),
		'YITH_Request_Quote_Premium'        => array(
			'plugin_name'  => 'YITH_Request_Quote',
			'plugin_title' => 'YITH WooCommerce Request A Quote Premium',
		),
		'phive_booking_initialze_premium'   => array(
			'plugin_name'  => 'phive_booking_initialze_premium',
			'plugin_title' => 'Bookings and Appointments For WooCommerce Premium',
		),
		'WPDesk\\ShopMagic\\Plugin'         => array(
			'plugin_name'  => 'Shop_Magic_For_Wc',
			'plugin_title' => 'ShopMagic for Woocommerce',
		),
		'Points_Rewards_For_Woocommerce'    => array(
			'plugin_name'  => 'Point_Reward',
			'plugin_title' => 'Points and Rewards for WooCommerce',
		),
		'Marketkingcore'                    => array(
			'plugin_name'  => 'Marketkingcore',
			'plugin_title' => 'MarketKing Core',
		),
		'AFWC_Affiliate'                    => array(
			'plugin_name'  => 'Affiliate_Woo',
			'plugin_title' => 'Affiliate For WooCommerce',
		),
	);

	$list_support_plugins_function = array(
		'pimwick_define'              => array(
			'plugin_name'  => 'Woo_Gift_Cards',
			'plugin_title' => 'PW WooCommerce Gift Cards',
		),
		'yith_wishlist_constructor'   => array(
			'plugin_name'  => 'yith_wishlist_constructor',
			'plugin_title' => 'YITH WooCommerce Wishlist Premium',
		),
		'yith_ywgc_premium_init'      => array(
			'plugin_name'  => 'YITH_Gift_Cards',
			'plugin_title' => 'YITH WooCommerce Gift Cards Premium',
		),
		'yith_wcmbs_pr_init'          => array(
			'plugin_name'  => 'YITH_Membership',
			'plugin_title' => 'YITH WooCommerce Membership Premium',
		),
		'yith_wcbk_init'              => array(
			'plugin_name'  => 'yith_booking',
			'plugin_title' => 'YITH Booking and Appointment for WooCommerce Premium',
		),
		'yith_affiliates_constructor' => array(
			'plugin_name'  => 'yith_woo_affilates',
			'plugin_title' => 'YITH WooCommerce Affiliates Premium',
		),
		'b2bking_activate'            => array(
			'plugin_name'  => 'B2BKing',
			'plugin_title' => 'B2BKing',
		),
		'wholesalex_run'              => array(
			'plugin_name'  => 'wholesalex',
			'plugin_title' => 'WholesaleX',
		),
		'wccfsq_activation_notice'      => array(
			'plugin_name'  => 'WooCommerce_Contact_For_Shipping_Quote',
			'plugin_title' => 'WooCommerce Contact for Shipping Quote',
		),
		'AWCDP'                       => array(
			'plugin_name'  => 'AWCDP',
			'plugin_title' => 'Deposits & Partial Payments for WooCommerce',
		),
	);

	$list_active_plugins = array();
	foreach ( $list_support_plugins_class as $key => $value ) {
		if ( class_exists( $key ) ) {
			$list_active_plugins[] = $value;
		}
		if ( 'LMFWC_PLUGIN_FILE' === $key || 'WCV_PRO_VERSION' === $key || 'WPCF_PRO_VERSION' === $key ) {
			if ( defined( $key ) ) {
				$list_active_plugins[] = $value;
			}
		}
	}
	foreach ( $list_support_plugins_function as $key => $value ) {
		if ( function_exists( $key ) ) {
			$list_active_plugins[] = $value;
		}
	}
	$list_active_addons = apply_filters( 'yaymail_plugins', array() );

	$list_active_addons_name = array();

	foreach ( $list_active_addons as $key => $value ) {
		$list_active_addons_name[] = $value['plugin_name'];
	}

	$final_name_list = array();

	foreach ( $list_active_plugins as $key => $value ) {
		if ( ! in_array( $value['plugin_name'], $list_active_addons_name ) ) {
			$final_name_list[] = $value['plugin_title'];
		}
	}
	if ( count( $final_name_list ) ) :
		?>

	<div id="yaymail-notice" class="notice-info notice is-dismissible">
		<h4 style="color: #000"><?php esc_html_e( 'Recommended: You can use YayMail Addons to customize all email templates of:', 'yaymail' ); ?></h4>
		<ul style="list-style: inside;">
			<?php
			foreach ( $final_name_list as $key => $value ) {
				?>
				<li><?php esc_html_e( $value, 'yaymail' ); ?></li>
				<?php
			}
			?>
		</ul>
		<p style="padding-left:0">
			<a href="https://yaycommerce.com/yaymail-addons/" target="_blank" data="upgradenow" class="button button-primary yaymail-see-addons" style="margin-right: 5px"><?php esc_html_e( 'See Addons', 'yaymail' ); ?></a>
			<a href="javascript:;" data="later" class="yaymail-nothank" style="margin-right: 5px"><?php esc_html_e( 'No, thanks', 'yaymail' ); ?></a>
		</p>
		</div>
		<?php
		endif;?>
