���� JFIF �� �
"" $(4,$&1'-=-157:::#+?D?8C49:7
7%%77777777777777777777777777777777777777777777777777�� { �" �� �� 5 !1AQa"q�2��BR��#b������� �� �� ? ��D@DDD@DDD@DDkK��6 �UG�4V�1��
�����릟�@�#���RY�dqp�
����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Æ��ܯsO"B�c>;
�e�4��5�k��/CB��.
�J?��;�҈�������������������~�<�VZ�ê¼2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ
B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r�����
Ď0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�?
�0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA׾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC
klaviyo_options = get_option( 'klaviyo_settings' );
add_action( 'init', array( $this, 'includes' ) );
add_action( 'plugins_loaded', array( $this, 'setup_admin' ) );
}
/**
* Include dependent files.
*
* @return void
*/
public function includes() {
include_once KLAVIYO_PATH . 'includes/admin/class-kl-plugins-screen-updates.php';
}
/**
* Runs before admin_notices action and adds a wrapper div so we can hide the notices.
*/
public function inject_before_notices() {
if ( $this->is_klaviyo_settings_page() ) {
echo '
';
}
}
/**
* Runs after admin_notices action and closes a wrapper div.
*/
public function inject_after_notices() {
if ( $this->is_klaviyo_settings_page() ) {
echo '
';
}
}
/**
* Add the Klaviyo plugin style sheets for the admin area.
*
* @param string $hook The action slug so we can only enqueue for Klaviyo's settings page.
*/
public function enqueue_styles( $hook ) {
if ( strpos( $hook, 'page_klaviyo_settings' ) !== false ) {
wp_enqueue_style( 'wck-admin-settings', KLAVIYO_URL . 'includes/admin/css/wck-admin.css', null, WCK_API::VERSION );
}
}
/**
* Handle settings page dependencies and add appropriate menu page. Also hide notices for new auth process.
*/
public function setup_admin() {
if (! function_exists('add_menu_page') || ! current_user_can('manage_options')) {
return;
}
// Continue supporting non-WooCommerce sites. Display old settings page if WC is not activated.
if (is_plugin_active('woocommerce/woocommerce.php')) {
// The last arg (int) ensures the submenu item is added at the end.
add_action('admin_menu', array( $this, 'add_klaviyo_settings_oauth' ), 1000);
// Hook into action as early as possible so it's the first to execute.
add_action('admin_notices', array( $this, 'inject_before_notices' ), -9999);
// Hook into action as late as possible so it's the last to execute.
add_action('admin_notices', array( $this, 'inject_after_notices' ), PHP_INT_MAX);
} else {
add_action('admin_menu', array( $this, 'add_klaviyo_settings_original' ));
}
// This adds the "Settings" link to the Klaviyo plugin entry on the Installed Plugins page.
add_filter('plugin_action_links_' . KLAVIYO_BASENAME, array( $this, 'plugin_settings_link' ));
}
/**
* Check if we are on the Klaviyo specific admin page nested under Marketing. The legacy settings page does not
* use this method. We cannot use get_post() here because this fires before the post data is setup. Instead, this
* uses the WP_Screen object which is globally available under the 'current_screen' key. The WP_Screen object
* base attribute corresponds to the $parent_slug and $menu_slug arguments in the add_submenu_page call.
*
* @return bool Whether the page is for Klaviyo's plugin settings nested under WooCommerce's Marketing tab.
*/
private function is_klaviyo_settings_page() {
return 'marketing_page_klaviyo_settings' === $GLOBALS['current_screen']->base;
}
/**
* Add Klaviyo menu tab nested under WooCommerce's Marketing tab for oauth authentication process.
*/
public function add_klaviyo_settings_oauth() {
add_submenu_page('woocommerce-marketing', 'Klaviyo settings', 'Klaviyo', 'manage_woocommerce', 'klaviyo_settings', array( $this, 'settings_oauth' ));
}
/**
* Checks active plugins against known conflicts list and returns an array of plugin names.
*
* @return array
*/
private function get_conflicting_plugins() {
$installed_plugins = get_plugins();
$active_plugins = array_flip(get_option('active_plugins'));
$active_conflicts = array_intersect_key($installed_plugins, $active_plugins, array_flip(self::CONFLICTING_PLUGINS));
$conflicts = array_values(array_map(function ( $plugin_details ) {
return $plugin_details['Name'];
}, $active_conflicts));
return $conflicts;
}
/**
* Formats conflicting plugin names for display in warning.
*
* @param $plugins array
* @return mixed|string
*/
private function format_conflicting_plugins( $plugins ) {
switch (count($plugins)) {
case 0:
return '';
case 1:
return $plugins[0];
case 2:
return $plugins[0] . ' and ' . $plugins[1];
default:
$last = array_pop($plugins);
return implode(', ', $plugins) . ', and ' . $last;
}
}
private function is_integrated() {
return isset($this->klaviyo_options['klaviyo_public_api_key']);
}
private function display_ssl_error_notification() {
return ! $this->is_integrated() && ! is_ssl();
}
/**
* Add Klaviyo menu tab for old authentication process.
*/
public function add_klaviyo_settings_original() {
global $submenu;
add_menu_page('Klaviyo', 'Klaviyo', 'manage_options', 'klaviyo_settings', array( $this, 'settings' ), KLAVIYO_URL . 'img/klaviyo-logo.png');
add_submenu_page('klaviyo_settings', 'Help', 'Help', 'manage_options', 'klaviyo_help', array( $this, 'help' ));
// Rename the slide-out menu option from Klaviyo to Settings.
$submenu['klaviyo_settings'][0][0] = 'Settings'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
}
/**
* Settings page content for new authentication process.
*/
public function settings_oauth() {
include_once KLAVIYO_PATH . '/includes/admin/partials/wc-v1-auth-settings.php';
}
/**
* Help section content.
*
* @return void
*/
public function help() {
$content = '';
$content = '
- Where do I find my Klaviyo API keys?
- How do I add a Klaviyo email sign up into my sidebar?
1) Where do I find my Klaviyo API keys?
You can find your Klaviyo API keys by going to the
account page in Klaviyo.
Your public API key will be 6-7 characters long.
Your private API key will be 7 characters, a hyphen and then 16 more.
Once you have connected your Klaviyo account, tracking will be enabled for visitors.
2) How do I add a Klaviyo email sign up into my sidebar?
Make sure you have connected your Klaviyo account on the Klaviyo settings page.
Then you can find the widget under Appearance » Widgets titled "Klaviyo: Email Sign Up".
';
$content = $this->postbox( 'klaviyo-help', 'FAQ', $content );
$this->admin_wrap( 'Klaviyo Plugin Help', $content );
}
/**
* Legacy settings page form content.
*
* @return void
*/
public function settings() {
$klaviyo_settings = $this->process_settings();
$content = '';
if ( function_exists( 'wp_nonce_field' ) ) {
$content .= wp_nonce_field( 'klaviyo-update-settings', '_wpnonce', true, false );
}
$content .= '';
$wrapped_content = $this->postbox( 'klaviyo-settings', 'Connect to Klaviyo', $content );
$this->admin_wrap( 'Klaviyo Settings', $wrapped_content );
}
/**
* Legacy settings page form processing logic.
*
* @return mixed
*/
public function process_settings() {
$klaviyo_notification = new WPKlaviyoNotification( 'settings_update' );
if ( ! empty( $_POST['klaviyo_option_submitted'] ) ) {
$klaviyo_settings = get_option( 'klaviyo_settings' );
if ( isset( $_GET['page'] ) && 'klaviyo_settings' == $_GET['page'] && check_admin_referer( 'klaviyo-update-settings' ) ) {
if ( isset( $_POST['klaviyo_public_api_key'] ) && strlen( sanitize_text_field( wp_unslash( $_POST['klaviyo_public_api_key'] ) ) ) < 8 ) {
$klaviyo_settings['klaviyo_public_api_key'] = sanitize_text_field( wp_unslash( $_POST['klaviyo_public_api_key'] ) );
}
$klaviyo_setting_keys = array(
'klaviyo_public_api_key',
'klaviyo_subscribe_checkbox',
'klaviyo_newsletter_list_id',
'klaviyo_newsletter_text',
'klaviyo_sms_subscribe_checkbox',
'klaviyo_sms_list_id',
'klaviyo_sms_consent_text',
'klaviyo_sms_consent_disclosure_text',
);
$klaviyo_updated_settings = array_fill_keys( $klaviyo_setting_keys, '' );
// Only iterate through relevant keys in $_POST.
foreach ( array_intersect_key( $_POST, array_flip( $klaviyo_setting_keys ) ) as $key => $value ) {
if ( in_array( $key, array( 'klaviyo_newsletter_text', 'klaviyo_sms_consent_text', 'klaviyo_sms_consent_disclosure_text' ) ) ) {
$value = trim( stripslashes( $value ) );
}
$klaviyo_updated_settings[ $key ] = $value;
}
$klaviyo_settings = array_merge( $klaviyo_settings, $klaviyo_updated_settings );
if ( empty( $klaviyo_settings['klaviyo_sms_consent_disclosure_text'] ) ) {
$klaviyo_settings['klaviyo_sms_consent_disclosure_text'] = self::SMS_DISCLOSURE_TEXT;
}
if ( $klaviyo_settings['klaviyo_subscribe_checkbox'] && ! $klaviyo_settings['klaviyo_newsletter_list_id'] ) {
$klaviyo_notification->admin_message( 'add_email_list_id', 10 );
}
if ( $klaviyo_settings['klaviyo_sms_subscribe_checkbox'] && ! $klaviyo_settings['klaviyo_sms_list_id'] ) {
$klaviyo_notification->admin_message( 'add_sms_list_id', 10 );
}
if (
$klaviyo_settings['klaviyo_sms_list_id'] == $klaviyo_settings['klaviyo_newsletter_list_id']
&& ! empty( $klaviyo_settings['klaviyo_sms_list_id'] )
&& ! empty( $klaviyo_settings['klaviyo_newsletter_list_id'] )
) {
$klaviyo_notification->admin_message( 'same_list_ids', 10 );
}
$klaviyo_notification->display_message( 3 );
update_option( 'klaviyo_settings', $klaviyo_settings );
}
}
return get_option( 'klaviyo_settings' );
}
/**
* Callback method for "plugin_action_links_{$plugin_file}" hook. By default, this does not include
* a "settings" link in the Klaviyo entry of the Installed Plugins tab. This adds the Settings link.
*
* @param $links
* @return mixed
*/
public function plugin_settings_link( $links ) {
$settings_link = 'Settings';
array_unshift($links, $settings_link);
return $links;
}
/**
* Plugin support panel content.
*
* @return string
*/
private function show_plugin_support() {
$content = 'First, check the Help Section. If you still have questions or want to give feedback, send an email to Klaviyo support.
';
return $this->postbox( 'klaviyo-support', 'Help / Feedback', $content );
}
/**
* Return a collection of elements.
*
* @param string $id Element id attribute.
* @param string $title Content title.
* @param string $content Content.
* @return string
*/
private function postbox( $id, $title, $content ) {
$wrapper = '';
$wrapper .= '';
$wrapper .= '
';
$wrapper .= '
' . $title . '
';
$wrapper .= '
' . $content . '
';
$wrapper .= '
';
return $wrapper;
}
/**
* Wraps some content in other elements.
*
* @param string $title Header title.
* @param string $content Content.
* @return void
*/
private function admin_wrap( $title, $content ) {
$showpluginsupport = $this->show_plugin_support();
// phpcs:disable
echo <<
EOT;
// phpcs:enable
}
}