File: /home/kbdhpghp/public_html/perfumaris/wp-content/plugins/omnisend-connect/omnisend-woocommerce.php
<?php
/**
* Plugin Name: Omnisend for WooCommerce
* Plugin URI: https://www.omnisend.com
* Description: 100,000+ ecommerce stores use Omnisend to sell more stuff to more people. Send newsletters & SMS and build email lists with popups.
* Version: 1.15.19
* Author: Omnisend
* Author URI: https://www.omnisend.com
* Developer: Omnisend
* Developer URI: https://developers.omnisend.com
*
* WC requires at least: 6.0
* WC tested up to: 9.1
*
* Copyright: © 2018 Omnisend
* License: GPLv3 or later License
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package OmnisendPlugin
*/
defined( 'ABSPATH' ) || exit;
if ( ! defined( 'OMNISEND_WOO_PLUGIN_FILE' ) ) {
define( 'OMNISEND_WOO_PLUGIN_FILE', __FILE__ );
}
define( 'OMNISEND_APP_URL', 'https://app.omnisend.com' );
define( 'OMNISEND_API_URL', 'https://api.omnisend.com' );
define( 'OMNISEND_SNIPPET_URL', 'https://omnisnippet1.com/inshop/launcher-v2.js' );
define( 'OMNISEND_DISCOUNTS_KB_ARTICLE_URL', 'https://support.omnisend.com/en/articles/5846981-discount-content-block-for-woocommerce' );
define( 'OMNISEND_CALLBACK_URL', OMNISEND_APP_URL . '/REST/woocommerce/keys' );
define( 'OMNISEND_LOGS_KEY', 'qhyXzQsK7hnynKH0C6qVyVqCJWvWt8atAHB' );
define( 'OMNISEND_LOGS_URL', OMNISEND_APP_URL . '/woocommerce/plugin/logs' );
define( 'OMNISEND_ACTIVATION_URL', OMNISEND_APP_URL . '/woocommerce/plugin/activation' );
define( 'OMNISEND_UPDATE_URL', OMNISEND_APP_URL . '/woocommerce/plugin/update' );
define( 'OMNISEND_SETTINGS_PAGE', 'omnisend-woocommerce' );
define( 'OMNISEND_LOGS_PAGE', 'omnisend-logs' );
define( 'OMNISEND_SYNC_PAGE', 'omnisend-sync' );
define( 'OMNISEND_WC_API_APP_NAME', 'Omnisend App' );
define( 'OMNISEND_API_KEY_HEADER_NAME', 'X-API-KEY' );
define( 'OMNISEND_ORIGIN_HEADER_NAME', 'X-Omnisend-Origin' );
define( 'OMNISEND_ORIGIN_HEADER_VALUE', 'woocommerce' );
define( 'OMNISEND_LOGIN_URL', OMNISEND_APP_URL . '/login' );
define( 'OMNISEND_REGISTRATION_URL', OMNISEND_APP_URL . '/ecom/registration/start' );
define( 'OMNISEND_PLUGIN_INSTALL_URL', 'REST/woocommerce/install' );
define( 'OMNISEND_ONBOARDING_URL', OMNISEND_APP_URL . '/dashboard' );
define( 'OMNISEND_SWITCH_BRANDS_URL', OMNISEND_APP_URL . '/accounts/switch-store' );
define( 'OMNISEND_EVENTS_TRACKING_URL', OMNISEND_APP_URL . '/woocommerce/events/track' );
define( 'OMNISEND_LANDING_PAGE_CONTENT_URL', OMNISEND_APP_URL . '/REST/woocommerce/plugin/content' );
require_once 'manager/class-omnisend-logger.php';
require_once 'manager/class-omnisend-manager-assistant.php';
require_once 'manager/class-omnisend-helper.php';
require_once 'manager/class-omnisend-empty-required-fields-exception.php';
require_once 'manager/class-omnisend-manager.php';
require_once 'manager/class-omnisend-sync-manager.php';
require_once 'manager/class-omnisend-server-session.php';
require_once 'manager/class-omnisend-user-storage.php';
require_once 'manager/class-omnisend-contact-resolver.php';
require_once 'manager/class-omnisend-event-tracker.php';
require_once 'manager/class-omnisend-logs-sender.php';
require_once 'manager/class-omnisend-settings.php';
require_once 'manager/class-omnisend-notifications.php';
require_once 'manager/class-omnisend-content.php';
require_once 'manager/class-omnisend-contact-cache.php';
/*Include Model classes*/
require_once 'model/class-omnisend-product.php';
require_once 'model/class-omnisend-contact.php';
require_once 'model/class-omnisend-cart.php';
require_once 'model/class-omnisend-cart-event.php';
require_once 'model/class-omnisend-order.php';
require_once 'model/class-omnisend-category.php';
require_once 'model/class-omnisend-sync.php';
require_once 'model/class-omnisend-connection-error.php';
/*Include Ajax classes & functions*/
require_once 'class-omnisend-operation-status.php';
require_once 'class-omnisend-ajax.php';
/*Include settings page display function*/
require_once 'omnisend-settings-page.php';
/*Include logs page display function*/
require_once 'omnisend-logs.php';
/*Include WooCommerce hooks*/
require_once 'omnisend-woocommerce-hooks.php';
/*Include WooCommerce hooks*/
require_once 'omnisend-rebuild-cart.php';
/* Include repository classes */
require_once 'class-omnisend-sync-stats.php';
require_once 'class-omnisend-all-sync-stats.php';
require_once 'class-omnisend-sync-stats-repository.php';
/* Include views */
require_once 'view/settings/api-access-notice.php';
require_once 'view/settings/navigation-tabs.php';
require_once 'view/settings/account-information.php';
require_once 'view/settings/connected.php';
require_once 'view/settings/connection.php';
require_once 'view/settings/permalink-notice.php';
require_once 'view/settings/connection-error-notice.php';
require_once 'view/settings/tag.php';
require_once 'view/settings/sync.php';
require_once 'view/settings/checkout-opt-in-checkbox.php';
require_once 'includes/omnisend-api.php';
require_once 'includes/omnisend-cart-event-filter.php';
require_once 'includes/class-omnisend-install.php';
require_once 'includes/class-omnisend-logs.php';
/*Declare plugin's settings page*/
add_action( 'admin_menu', 'omnisend_woocommerce_menu' );
function omnisend_woocommerce_menu() {
$omnisend_icon = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyIiBoZWlnaHQ9IjE5MiIgdmlld0JveD0iMCAwIDE5MiAxOTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xNzAuNiA2OC41OTk5SDE2MC44QzE1OS41IDc3LjI5OTkgMTUyIDgzLjk5OTkgMTQyLjkgODMuOTk5OUgxMDJMMTA2LjQgOTQuNjk5OUwxMTAuMSAxMDMuN0wxMDEuNiA5OC45OTk5TDc0LjYgODMuOTk5OUg2OS40QzY4LjkgODUuODk5OSA2OC41IDg3Ljg5OTkgNjguNSA4OS44OTk5VjE3MC41QzY4LjUgMTgyLjMgNzguMSAxOTEuOSA4OS45IDE5MS45SDk4LjlIMTI2LjZWMTc0LjJDMTI2LjYgMTU3LjIgMTI0LjUgMTQ0LjEgMTExL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zUgMTguMjk5OSAxMzYuMSAxOC40OTk5QzE0MC43IDE5LjM5OTkgMTQ0LjEgMjEuODk5OSAxNDYuNCAyNS44OTk5QzE0OC41IDI5LjM5OTkgMTQ5LjUgMzMuNDk5OSAxNDkuNSAzOC40OTk5QzE0OS41IDQ1LjE5OTkgMTQ3LjggNTEuMTk5OSAxNDQuNSA1Ni42OTk5WiIgZmlsbD0iIzlBQTFBNyIvPgo8L3N2Zz4K';
$page_title = 'Omnisend for WooCommerce';
$menu_title = get_menu_title( 'Omnisend for WooCommerce' );
$capability = 'manage_options';
$menu_slug = OMNISEND_SETTINGS_PAGE;
$function = 'omnisend_show_settings_page';
// Nonce verification is not required here.
// phpcs:disable WordPress.Security.NonceVerification
if ( isset( $_GET['tab'] ) && $_GET['tab'] === OMNISEND_LOGS_PAGE ) {
$function = 'omnisend_show_logs';
}
// phpcs:enable
// Nonce verification is not required here.
// phpcs:disable WordPress.Security.NonceVerification
if ( isset( $_GET['tab'] ) && $_GET['tab'] === OMNISEND_SYNC_PAGE ) {
$function = 'omnisend_show_sync';
}
// phpcs:enable
add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $omnisend_icon, 2 );
}
/**
* Constructs plugin menu title.
*
* @return string
*/
function get_menu_title( $title ) {
$omnisend_notification_count = Omnisend_Notifications::get_count();
return $omnisend_notification_count ? sprintf( $title . ' <span class="awaiting-mod">%d</span>', $omnisend_notification_count ) : $title;
}
/*Include scripts and styles for settings page and get started notice*/
add_action( 'admin_enqueue_scripts', 'omnisend_admin_scripts_and_styles' );
function omnisend_admin_scripts_and_styles() {
// Nonce verification is not required here.
// phpcs:disable WordPress.Security.NonceVerification
if ( isset( $_GET['page'] ) && $_GET['page'] === OMNISEND_SETTINGS_PAGE ) {
omnisend_register_localize_enqueue_script(
'omnisend-settings-script',
'assets/js/omnisend-settings-script.js',
'omnisend_settings_script_var',
'omnisend-settings-script-nonce'
);
wp_enqueue_style(
'omnisend-admin-style.css',
plugin_dir_url( __FILE__ ) . 'assets/css/omnisend-admin-style.css?' . time(),
array(),
'1.0.0'
);
wp_enqueue_style(
'roboto.css',
plugin_dir_url( __FILE__ ) . 'assets/fonts/roboto/roboto.css?' . time(),
array(),
'1.0.0'
);
}
// phpcs:enable
}
function omnisend_register_localize_enqueue_script( $handle, $file, $object_name, $nonce_action ) {
$src = plugin_dir_url( __FILE__ ) . $file . '?' . time();
wp_register_script( $handle, $src, array(), '1.0.0', true );
wp_localize_script(
$handle,
$object_name,
array(
'nonce' => wp_create_nonce( $nonce_action ),
)
);
wp_enqueue_script(
$handle,
$src,
array(),
'1.0.0',
true
);
}
/*Include front scripts */
add_action( 'wp_enqueue_scripts', 'omnisend_front_scripts_and_styles' );
function omnisend_front_scripts_and_styles() {
$handle = 'omnisend-front-script.js';
$file = plugin_dir_url( __FILE__ ) . 'assets/js/omnisend-front-script.js?' . time();
wp_register_script( $handle, $file, array(), '1.0.0', true );
wp_localize_script(
$handle,
'omnisend_woo_data',
array(
'ajax_url' => admin_url( 'admin-ajax.php' ),
'contact_id' => Omnisend_User_Storage::get_contact_id(),
'nonce' => wp_create_nonce( 'omnisend-front-script-nonce' ),
)
);
wp_enqueue_script( $handle, $file, array(), '1.0.0', true );
}
/*After plugin activation - go to settings page*/
add_action( 'activated_plugin', 'omnisend_activation' );
function omnisend_activation( $plugin ) {
Omnisend_Logger::hook();
if ( $plugin == plugin_basename( __FILE__ ) ) {
omnisend_activated();
}
}
/**
* Define Omnisend cron schedules.
*
* @param array $schedules List of WP scheduled cron jobs.
*
* @return array
*/
function omnisend_cron_schedules( $schedules ) {
$schedules['omnisend_every_two_minutes'] = array(
'interval' => 60 * 2,
'display' => __( 'Every 2 minutes', 'omnisend-woocommerce' ),
);
$schedules['omnisend_every_five_minutes'] = array(
'interval' => 60 * 5,
'display' => __( 'Every 5 minutes', 'omnisend-woocommerce' ),
);
return $schedules;
}
/**
* Init Omnisend crons.
*
* @return void
*/
function omnisend_init_crons() {
// phpcs:ignore WordPress.WP.CronInterval.CronSchedulesInterval
add_filter( 'cron_schedules', 'omnisend_cron_schedules' );
Omnisend_Logs::init();
}
add_action( 'init', 'omnisend_init_crons' );
function omnisend_activated() {
Omnisend_Logger::enable_logging();
$first_activation = ! get_option( 'omnisend_account_id', null );
if ( $first_activation ) {
$default_checkout_opt_in_text = 'Email me with news and offers';
Omnisend_Settings::add_checkout_opt_in_status( Omnisend_Settings::STATUS_ENABLED, 'default' );
Omnisend_Settings::add_checkout_opt_in_text( $default_checkout_opt_in_text, 'default' );
}
}
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'omnisend_add_plugin_settings_link' );
function omnisend_add_plugin_settings_link( $links ) {
$link = '<a href="' . admin_url( 'admin.php?page=' . OMNISEND_SETTINGS_PAGE ) . '">' . __( 'Settings' ) . '</a>';
array_unshift( $links, $link );
return $links;
}
add_action( 'admin_notices', 'omnisend_show_connection_notice' );
function omnisend_show_connection_notice() {
if ( Omnisend_Helper::is_omnisend_connected() ) {
return;
}
?>
<div class="notice notice-warning is-dismissible">
<p><strong>Connect your WooCommerce store to Omnisend</strong></p>
<p>Collect, convert, and keep new customers with automated email & SMS. Connect your store and grow your audience with forms, recover sales with Abandoned cards, and Checkout automation.</p>
<p>
<a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=' . OMNISEND_SETTINGS_PAGE ) ); ?>">
Connect your store to Omnisend
</a>
</p>
</div>
<?php
}
add_action( 'admin_notices', 'omnisend_show_api_access_notice' );
function omnisend_show_api_access_notice() {
if ( Omnisend_Manager::is_setup() && ! Omnisend_Helper::is_woocommerce_api_access_granted() ) {
$omnisend_account_id = get_option( 'omnisend_account_id', null );
$full_url = Omnisend_Helper::get_wc_auth_url( $omnisend_account_id );
?>
<div class="notice notice-error is-dismissible">
<p>
Add missing permissions to keep Omnisend working with WooCommerce.
<a id="wp-admin-auth-notice-link" href="<?php echo esc_url( $full_url ); ?>">Add permissions
</a>
</p>
</div>
<?php
}
}
add_action( 'before_woocommerce_init', 'omnisend_declare_wc_hpos_compatibility' );
function omnisend_declare_wc_hpos_compatibility() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
}
register_activation_hook( __FILE__, 'omnisend_activate' );
function omnisend_activate() {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
Omnisend_Install::notify_about_plugin_activation();
}
register_deactivation_hook( __FILE__, 'omnisend_deactivate' );
function omnisend_deactivate() {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
Omnisend_install::deactivate();
}
register_uninstall_hook( __FILE__, 'omnisend_uninstall' );
function omnisend_uninstall() {
Omnisend_Install::uninstall();
}