| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: UniConsent Cookie Consent CMP |
| 4 |
* Plugin URI: https://www.uniconsent.com/?utm_source=wp-plugins |
| 5 |
* Description: Leading Consent Management Platform for IAB TCF, GPP, GDPR, POPIA, CCPA, COPPA, and LGPD Compliance. |
| 6 |
* Version: 1.7.1 |
| 7 |
* Author: UniConsent |
| 8 |
* Author URI: https://www.uniconsent.com/?utm_source=wp-plugins |
| 9 |
* License: GPLv3 |
| 10 |
*/ |
| 11 |
|
| 12 |
if ( ! defined( 'WPINC' ) ) { |
| 13 |
die; |
| 14 |
} |
| 15 |
|
| 16 |
define( 'UNIC_CMP_VERSION', '1.7.1' ); |
| 17 |
|
| 18 |
function activate_unic_cmp() { |
| 19 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-unic-activator.php'; |
| 20 |
UNIC_Activator::activate(); |
| 21 |
} |
| 22 |
|
| 23 |
function deactivate_unic_cmp() { |
| 24 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-unic-deactivator.php'; |
| 25 |
UNIC_Deactivator::deactivate(); |
| 26 |
} |
| 27 |
|
| 28 |
register_activation_hook( __FILE__, 'activate_unic_cmp' ); |
| 29 |
register_deactivation_hook( __FILE__, 'deactivate_unic_cmp' ); |
| 30 |
|
| 31 |
require plugin_dir_path( __FILE__ ) . 'includes/class-unic-cmp.php'; |
| 32 |
|
| 33 |
//declare compliance with consent level API |
| 34 |
$plugin_name = plugin_basename( __FILE__ ); |
| 35 |
add_filter( "wp_consent_api_registered_{$plugin_name}", '__return_true' ); |
| 36 |
|
| 37 |
function unic_cmp_enqueue_scripts() { |
| 38 |
wp_enqueue_script( |
| 39 |
'unic-cmp-script', // Handle |
| 40 |
plugin_dir_url(__FILE__) . 'public/js/unic.min.js', |
| 41 |
array(), |
| 42 |
'1.7.1', |
| 43 |
true |
| 44 |
); |
| 45 |
} |
| 46 |
add_action('wp_enqueue_scripts', 'unic_cmp_enqueue_scripts'); |
| 47 |
|
| 48 |
function run_unic_cmp() { |
| 49 |
|
| 50 |
$plugin = new UNIC_CMP(); |
| 51 |
$plugin->run(); |
| 52 |
|
| 53 |
} |
| 54 |
run_unic_cmp(); |
| 55 |
|