Changeset 2814352
- Timestamp:
- 11/08/2022 02:00:27 PM (3 years ago)
- Location:
- vine-ma/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
vine_ma_plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vine-ma/trunk/readme.txt
r2813472 r2814352 21 21 22 22 == Changelog == 23 24 = 1.1.7 = 25 * Allow automatic script blocking for cookie consent. 23 26 24 27 = 1.1.6 = -
vine-ma/trunk/vine_ma_plugin.php
r2765186 r2814352 3 3 /** 4 4 * Plugin Name: Vine MA - Email Marketing, Forms, Interactive Bot Forms, Chatbot, Analytics 5 * Version: 1.1. 65 * Version: 1.1.7 6 6 * Description: Vine is a Marketing automation tool to generate more leads from your web site. Vine includes web forms, interactive bot forms, landing pages, AI chatbot, visitor tracking, and other functionality to help you to make your site more interesting and to know better what your visitors do there. 7 7 * Author: Vine Oy … … 92 92 $orgid = vine_ma_get_option('organization_id'); 93 93 $src = VINEHOST."/track/t.js?sg={$orgid}"; 94 wp_enqueue_script('vinematrack', $src, array(), null);95 wp_script_add_data('vinematrack', 'main-track-script', true );96 94 $srcac = VINEHOST."/track/allowCookies.js"; 97 wp_enqueue_script('vinematrackac', $srcac, array(), null); 98 wp_script_add_data('vinematrackac', 'ac-track-script', true ); 99 } 100 function vine_track_scripts_attributes( $tag, $handle ) { 101 if ( is_user_logged_in() && isset($_GET['et_fb']) && isset($_GET['PageSpeed'])) return $tag; 102 if ( wp_scripts()->get_data( $handle, 'main-track-script' ) ) { 103 $tag = str_replace( '></', ' data-cookieconsent="ignore"></', $tag ); 104 $tag = str_replace( '<script', '<script type="text/javascript"', $tag ); 105 } 106 if ( wp_scripts()->get_data( $handle, 'ac-track-script' ) ) { 107 $tag = str_replace( '></', ' data-cookieconsent="marketing" async></', $tag ); 108 $tag = str_replace( '<script', '<script type="text/plain"', $tag ); 109 } 110 return $tag; 111 } 112 add_action( 'wp_enqueue_scripts', 'vine_ma_wpes_hook_add_script'); 113 add_filter( 'script_loader_tag', 'vine_track_scripts_attributes', 10, 2 ); 95 ?> 96 <script type="text/javascript" src="<?php echo $src ?>" data-cookieconsent="ignore"></script> 97 <script type="text/plain" src="<?php echo $srcac ?>" data-cookieconsent="marketing" async></script> 98 <?php 99 } 100 101 add_action( 'wp_head', 'vine_ma_wpes_hook_add_script', -99999); 114 102 115 103 add_action( 'wp_ajax_vine_ma_save_option', 'vine_ma_hook_save_option' );
Note: See TracChangeset
for help on using the changeset viewer.