Changeset 3736319
- Timestamp:
- 10/09/2026 09:37:32 AM (2 weeks ago)
- Location:
- finsbury-media-cookie-consent
- Files:
-
- 2 added
- 1 deleted
- 3 edited
- 8 copied
-
tags/1.4.0 (copied) (copied from finsbury-media-cookie-consent/trunk )
-
tags/1.4.0/admin-settings.php (copied) (copied from finsbury-media-cookie-consent/trunk/admin-settings.php )
-
tags/1.4.0/assets (copied) (copied from finsbury-media-cookie-consent/trunk/assets )
-
tags/1.4.0/assets/js/cc-setup.js (copied) (copied from finsbury-media-cookie-consent/trunk/assets/js/cc-setup.js )
-
tags/1.4.0/assets/json/cc-setup.json (copied) (copied from finsbury-media-cookie-consent/trunk/assets/json/cc-setup.json )
-
tags/1.4.0/configuration-loader.php (added)
-
tags/1.4.0/finsbury-media-cookie-consent.php (copied) (copied from finsbury-media-cookie-consent/trunk/finsbury-media-cookie-consent.php ) (9 diffs)
-
tags/1.4.0/readme.txt (copied) (copied from finsbury-media-cookie-consent/trunk/readme.txt ) (3 diffs)
-
tags/1.4.0/uninstall.php (copied) (copied from finsbury-media-cookie-consent/trunk/uninstall.php ) (1 diff)
-
trunk/asset.php (deleted)
-
trunk/configuration-loader.php (added)
-
trunk/finsbury-media-cookie-consent.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
finsbury-media-cookie-consent/tags/1.4.0/finsbury-media-cookie-consent.php
r3734696 r3736319 3 3 * Plugin Name: Finsbury Media Cookie Consent 4 4 * Description: Adds Google Consent Mode v2, Meta pixel consent mode, Microsoft UET & Clarity Consent Mode support to your site. 5 * Version: 1. 3.55 * Version: 1.4.0 6 6 * Author: Finsbury Media 7 7 * Author URI: https://finsburymedia.com … … 18 18 define( 'FINSMECO_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 19 19 define( 'FINSMECO_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 20 define( 'FINSMECO_VERSION', '1.3.5' ); 20 define( 'FINSMECO_VERSION', '1.4.0' ); 21 22 require_once FINSMECO_PLUGIN_DIR . 'configuration-loader.php'; 21 23 22 24 if (is_admin()) { … … 24 26 } 25 27 26 require_once FINSMECO_PLUGIN_DIR . 'asset.php';27 28 28 function finsmeco_add_preload_tags() { 29 $core_css_url = admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-core.css&ver=' . FINSMECO_VERSION);30 $setup_css_url = admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-setup.css&ver=' . FINSMECO_VERSION);29 $core_css_url = FINSMECO_PLUGIN_URL . 'assets/css/cc-core.css?ver=' . FINSMECO_VERSION; 30 $setup_css_url = FINSMECO_PLUGIN_URL . 'assets/css/cc-setup.css?ver=' . FINSMECO_VERSION; 31 31 32 32 echo '<link rel="preload" as="style" href="' . esc_url($core_css_url) . '" />' . "\n"; … … 70 70 w.__updateMetaConsent=function(g){ 71 71 w.__metaConsentDefault=g?"grant":"revoke"; 72 if(w.__metaPixelConsentMode &&w.fbq&&w.fbq.callMethod) w.fbq("consent",w.__metaConsentDefault);72 if(w.__metaPixelConsentMode && typeof w.fbq==="function") w.fbq("consent",w.__metaConsentDefault); 73 73 }; 74 74 }(window); … … 76 76 77 77 wp_add_inline_script('finsmeco-consent-defaults', $consent_defaults_js); 78 79 // Print this registered handle before later head callbacks add tracking scripts. 80 wp_scripts()->do_items(['finsmeco-consent-defaults']); 78 81 } 79 82 80 83 function finsmeco_enqueue_scripts() { 84 $config = finsmeco_get_config(); 85 if ($config === []) { 86 return; 87 } 88 81 89 wp_enqueue_style( 82 90 'finsbury-media-cookie-consent-core-css', 83 admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-core.css'),91 FINSMECO_PLUGIN_URL . 'assets/css/cc-core.css', 84 92 [], 85 93 FINSMECO_VERSION, … … 89 97 wp_enqueue_script( 90 98 'finsbury-media-cookie-consent-core-js', 91 admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-core.js'),99 FINSMECO_PLUGIN_URL . 'assets/js/cc-core.js', 92 100 [], 93 101 FINSMECO_VERSION, … … 97 105 wp_enqueue_style( 98 106 'finsbury-media-cookie-consent-setup-css', 99 admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-setup.css'),107 FINSMECO_PLUGIN_URL . 'assets/css/cc-setup.css', 100 108 ['finsbury-media-cookie-consent-core-css'], 101 109 FINSMECO_VERSION, … … 105 113 wp_enqueue_script( 106 114 'finsbury-media-cookie-consent-setup-js', 107 admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-setup.js'),115 FINSMECO_PLUGIN_URL . 'assets/js/cc-setup.js', 108 116 ['finsbury-media-cookie-consent-core-js'], 109 117 FINSMECO_VERSION, … … 111 119 ); 112 120 113 // load default config114 $config = file_get_contents(FINSMECO_PLUGIN_DIR . 'assets/json/cc-setup.json');115 116 $license_key = get_option('finsmeco_license_key', '');117 if ($license_key !== '') {118 $url = sprintf('https://tracking.finsburymedia.co.uk/cookie-consent/%s/cc-setup.json', $license_key);119 $response = wp_remote_get($url);120 121 if (!is_wp_error($response) && wp_remote_retrieve_response_code($response) === 200) {122 // valid licence key, use customer specific config123 $config = wp_remote_retrieve_body($response);124 }125 }126 127 121 wp_localize_script('finsbury-media-cookie-consent-setup-js', 'FINSMECO', [ 128 'config' => json_decode($config, true),122 'config' => $config, 129 123 ]); 130 124 131 // Add consent defaults in header132 finsmeco_early_consent_defaults();133 125 } 134 126 add_action('wp_enqueue_scripts', 'finsmeco_enqueue_scripts', 1); 127 add_action('wp_head', 'finsmeco_early_consent_defaults', -100); 135 128 add_action('wp_head', 'finsmeco_add_preload_tags', 1); -
finsbury-media-cookie-consent/tags/1.4.0/readme.txt
r3734696 r3736319 5 5 Tested up to: 7.1 6 6 Requires PHP: 8.0 7 Stable tag: 1. 3.57 Stable tag: 1.4.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 105 105 - A customer ID (used in premium version only) 106 106 107 Custom banner settings are saved on your website for up to 30 minutes to help pages load faster. Changing or removing your license key clears the saved settings automatically. If custom settings cannot be loaded, the banner uses its standard settings and tries again on a later visit after one minute. Changes may take longer to appear if your website also saves copies of its pages. 108 107 109 In the premium version, and only if explicitly enabled, the plugin may also log anonymous consent events to the following endpoint: 108 110 … … 172 174 = 1.3.5 = 173 175 * **WordPress 7.1 Compatibility**: Tested and confirmed full compatibility with WordPress 7.1 176 177 = 1.4.0 = 178 * Improved reliability of cookie consent settings before tracking starts. 179 * Improved loading speed for the cookie consent banner. -
finsbury-media-cookie-consent/tags/1.4.0/uninstall.php
r3339497 r3736319 7 7 8 8 // Delete plugin options 9 delete_transient('finsmeco_remote_config'); 9 10 delete_option('finsmeco_license_key'); -
finsbury-media-cookie-consent/trunk/finsbury-media-cookie-consent.php
r3734696 r3736319 3 3 * Plugin Name: Finsbury Media Cookie Consent 4 4 * Description: Adds Google Consent Mode v2, Meta pixel consent mode, Microsoft UET & Clarity Consent Mode support to your site. 5 * Version: 1. 3.55 * Version: 1.4.0 6 6 * Author: Finsbury Media 7 7 * Author URI: https://finsburymedia.com … … 18 18 define( 'FINSMECO_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 19 19 define( 'FINSMECO_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 20 define( 'FINSMECO_VERSION', '1.3.5' ); 20 define( 'FINSMECO_VERSION', '1.4.0' ); 21 22 require_once FINSMECO_PLUGIN_DIR . 'configuration-loader.php'; 21 23 22 24 if (is_admin()) { … … 24 26 } 25 27 26 require_once FINSMECO_PLUGIN_DIR . 'asset.php';27 28 28 function finsmeco_add_preload_tags() { 29 $core_css_url = admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-core.css&ver=' . FINSMECO_VERSION);30 $setup_css_url = admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-setup.css&ver=' . FINSMECO_VERSION);29 $core_css_url = FINSMECO_PLUGIN_URL . 'assets/css/cc-core.css?ver=' . FINSMECO_VERSION; 30 $setup_css_url = FINSMECO_PLUGIN_URL . 'assets/css/cc-setup.css?ver=' . FINSMECO_VERSION; 31 31 32 32 echo '<link rel="preload" as="style" href="' . esc_url($core_css_url) . '" />' . "\n"; … … 70 70 w.__updateMetaConsent=function(g){ 71 71 w.__metaConsentDefault=g?"grant":"revoke"; 72 if(w.__metaPixelConsentMode &&w.fbq&&w.fbq.callMethod) w.fbq("consent",w.__metaConsentDefault);72 if(w.__metaPixelConsentMode && typeof w.fbq==="function") w.fbq("consent",w.__metaConsentDefault); 73 73 }; 74 74 }(window); … … 76 76 77 77 wp_add_inline_script('finsmeco-consent-defaults', $consent_defaults_js); 78 79 // Print this registered handle before later head callbacks add tracking scripts. 80 wp_scripts()->do_items(['finsmeco-consent-defaults']); 78 81 } 79 82 80 83 function finsmeco_enqueue_scripts() { 84 $config = finsmeco_get_config(); 85 if ($config === []) { 86 return; 87 } 88 81 89 wp_enqueue_style( 82 90 'finsbury-media-cookie-consent-core-css', 83 admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-core.css'),91 FINSMECO_PLUGIN_URL . 'assets/css/cc-core.css', 84 92 [], 85 93 FINSMECO_VERSION, … … 89 97 wp_enqueue_script( 90 98 'finsbury-media-cookie-consent-core-js', 91 admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-core.js'),99 FINSMECO_PLUGIN_URL . 'assets/js/cc-core.js', 92 100 [], 93 101 FINSMECO_VERSION, … … 97 105 wp_enqueue_style( 98 106 'finsbury-media-cookie-consent-setup-css', 99 admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-setup.css'),107 FINSMECO_PLUGIN_URL . 'assets/css/cc-setup.css', 100 108 ['finsbury-media-cookie-consent-core-css'], 101 109 FINSMECO_VERSION, … … 105 113 wp_enqueue_script( 106 114 'finsbury-media-cookie-consent-setup-js', 107 admin_url('admin-ajax.php?action=finsmeco_serve_asset&f=cc-setup.js'),115 FINSMECO_PLUGIN_URL . 'assets/js/cc-setup.js', 108 116 ['finsbury-media-cookie-consent-core-js'], 109 117 FINSMECO_VERSION, … … 111 119 ); 112 120 113 // load default config114 $config = file_get_contents(FINSMECO_PLUGIN_DIR . 'assets/json/cc-setup.json');115 116 $license_key = get_option('finsmeco_license_key', '');117 if ($license_key !== '') {118 $url = sprintf('https://tracking.finsburymedia.co.uk/cookie-consent/%s/cc-setup.json', $license_key);119 $response = wp_remote_get($url);120 121 if (!is_wp_error($response) && wp_remote_retrieve_response_code($response) === 200) {122 // valid licence key, use customer specific config123 $config = wp_remote_retrieve_body($response);124 }125 }126 127 121 wp_localize_script('finsbury-media-cookie-consent-setup-js', 'FINSMECO', [ 128 'config' => json_decode($config, true),122 'config' => $config, 129 123 ]); 130 124 131 // Add consent defaults in header132 finsmeco_early_consent_defaults();133 125 } 134 126 add_action('wp_enqueue_scripts', 'finsmeco_enqueue_scripts', 1); 127 add_action('wp_head', 'finsmeco_early_consent_defaults', -100); 135 128 add_action('wp_head', 'finsmeco_add_preload_tags', 1); -
finsbury-media-cookie-consent/trunk/readme.txt
r3734696 r3736319 5 5 Tested up to: 7.1 6 6 Requires PHP: 8.0 7 Stable tag: 1. 3.57 Stable tag: 1.4.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 105 105 - A customer ID (used in premium version only) 106 106 107 Custom banner settings are saved on your website for up to 30 minutes to help pages load faster. Changing or removing your license key clears the saved settings automatically. If custom settings cannot be loaded, the banner uses its standard settings and tries again on a later visit after one minute. Changes may take longer to appear if your website also saves copies of its pages. 108 107 109 In the premium version, and only if explicitly enabled, the plugin may also log anonymous consent events to the following endpoint: 108 110 … … 172 174 = 1.3.5 = 173 175 * **WordPress 7.1 Compatibility**: Tested and confirmed full compatibility with WordPress 7.1 176 177 = 1.4.0 = 178 * Improved reliability of cookie consent settings before tracking starts. 179 * Improved loading speed for the cookie consent banner. -
finsbury-media-cookie-consent/trunk/uninstall.php
r3339497 r3736319 7 7 8 8 // Delete plugin options 9 delete_transient('finsmeco_remote_config'); 9 10 delete_option('finsmeco_license_key');
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)