update
This commit is contained in:
@@ -15,8 +15,7 @@ function isConsentMagicPluginActivated() {
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
}
|
||||
|
||||
return is_plugin_active( 'consent-magic-pro/consent-magic-pro.php' );
|
||||
|
||||
return (is_plugin_active( 'consent-magic-pro/consent-magic-pro.php' ) || is_plugin_active( 'consent-magic/consent-magic.php' )) ;
|
||||
}
|
||||
function isConsentMagicPluginInstalled() {
|
||||
|
||||
@@ -24,14 +23,20 @@ function isConsentMagicPluginInstalled() {
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
}
|
||||
$installed_plugins = get_plugins();
|
||||
$plugin_slug = "consent-magic-pro/consent-magic-pro.php";
|
||||
return array_key_exists( $plugin_slug, $installed_plugins ) || in_array( $plugin_slug, $installed_plugins, true );
|
||||
$plugin_slug = 'consent-magic/consent-magic.php';
|
||||
$plugin_slug_pro = "consent-magic-pro/consent-magic-pro.php";
|
||||
|
||||
return
|
||||
array_key_exists( $plugin_slug, $installed_plugins ) ||
|
||||
in_array( $plugin_slug, $installed_plugins, true ) ||
|
||||
array_key_exists( $plugin_slug_pro, $installed_plugins ) ||
|
||||
in_array( $plugin_slug_pro, $installed_plugins, true );
|
||||
|
||||
}
|
||||
|
||||
function isConsentMagicPluginLicenceActivated() {
|
||||
$id = get_option('cs_product_id');
|
||||
if($id && get_option('wc_am_client_'.$id.'_activated') == 'Activated') {
|
||||
if($id && get_option('wc_am_client_'.$id.'_activated') == 'Activated' || is_plugin_active( 'consent-magic/consent-magic.php')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -109,24 +114,44 @@ function isRealCookieBannerPluginActivated() {
|
||||
}
|
||||
|
||||
function adminGdprAjaxNotEnabledNotice() {
|
||||
|
||||
$user_id = get_current_user_id();
|
||||
$url = buildAdminUrl( 'pixelyoursite', 'gdpr', false, array(
|
||||
'_wpnonce' => wp_create_nonce( 'pys_enable_gdpr_ajax' ),
|
||||
'pys' => array(
|
||||
'enable_gdpr_ajax' => true,
|
||||
),
|
||||
) );
|
||||
|
||||
?>
|
||||
|
||||
<div class="notice notice-error pys_core_gdpr_ajax_notice">
|
||||
|
||||
$meta_key = 'pys_core_gdpr_ajax_notice_dismissed_at';
|
||||
$dismissed_at = get_user_meta( $user_id, $meta_key );
|
||||
if(!$dismissed_at){
|
||||
?>
|
||||
|
||||
<div class="notice notice-error is-dismissible pys_core_gdpr_ajax_notice">
|
||||
<p>You use the <strong>GDPR Cookie Consent</strong> and <strong>PixelYourSite</strong> plugins. You
|
||||
must turn on "Enable AJAX filter values update" option to avoid problems with cache plugins.
|
||||
<a href="<?php echo esc_url( $url ); ?>"><strong>CLICK HERE TO
|
||||
ENABLE</strong></a>.</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
<script type="application/javascript">
|
||||
jQuery(document).on('click', '.pys_core_gdpr_ajax_notice .notice-dismiss', function () {
|
||||
|
||||
jQuery.ajax({
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'pys_notice_dismiss',
|
||||
nonce: '<?php esc_attr_e( wp_create_nonce( 'pys_notice_dismiss' ) ); ?>',
|
||||
user_id: '<?php esc_attr_e( $user_id ); ?>',
|
||||
addon_slug: 'core',
|
||||
meta_key: 'gdpr_ajax_notice'
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function adminGdprAjaxEnabledNotice() {
|
||||
|
||||
Reference in New Issue
Block a user