Changeset 2207108
- Timestamp:
- 12/06/2019 09:38:00 AM (6 years ago)
- Location:
- cookiepro/trunk
- Files:
-
- 1 added
- 5 edited
-
class-cookiepro.php (modified) (8 diffs)
-
readme.txt (modified) (1 diff)
-
views/dashboard-notices.php (modified) (1 diff)
-
views/gaoptout.php (added)
-
views/settings.php (modified) (2 diffs)
-
views/sidebar.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cookiepro/trunk/class-cookiepro.php
r2164181 r2207108 3 3 * Plugin Name: CookiePro 4 4 * Plugin URI: http://www.onetrust.com/ 5 * Version: 1.0. 15 * Version: 1.0.2 6 6 * Author: OneTrust, Llc 7 7 * Author URI: https://www.onetrust.com/products/cookies/ … … 32 32 * CookiePro 33 33 */ 34 35 36 34 37 class Cookiepro { 35 38 /** … … 41 44 $this->plugin->name = 'cookiepro'; 42 45 $this->plugin->displayName = 'CookiePro'; 43 $this->plugin->version = '1.0. 0';46 $this->plugin->version = '1.0.2'; 44 47 $this->plugin->folder = plugin_dir_path( __FILE__ ); 45 48 $this->plugin->url = plugin_dir_url( __FILE__ ); … … 55 58 add_action( 'wp_ajax_' . $this->plugin->name . '_dismiss_dashboard_notices', array( &$this, 'dismissdashboardnotices' ) ); 56 59 add_action( 'wp_head', array( &$this, 'frontendheader' ) ); 57 } 60 add_action( 'wp_footer', array( &$this, 'cookiepro_code' ) ); 61 } 62 58 63 /** Frontendheader functions. */ 59 64 public function frontendheader() { 60 65 $this->output( 'cookiepro_header' ); 66 //$this->output1('cookiepro_analyticsID'); 61 67 } 62 68 … … 83 89 public function registersettings() { 84 90 register_setting( $this->plugin->name, 'cookiepro_header', 'trim' ); 85 } 91 register_setting( $this->plugin->name, 'cookiepro_analyticsID', 'trim' ); 92 } 93 94 95 /** google analytics disable code **/ 96 public function cookiepro_code() { 97 98 include_once WP_PLUGIN_DIR . '/' . $this->plugin->name . '/views/gaoptout.php'; 99 } 100 86 101 87 102 … … 105 120 $this->message = __( 'Changes Saved.' ); 106 121 } 122 123 if ( isset( $_REQUEST['cookiepro_analyticsID'] ) ) { 124 update_option( 'cookiepro_analyticsID', sanitize_option( '', wp_unslash( $_REQUEST['cookiepro_analyticsID'] ) ) ); 125 126 } 107 127 } 108 128 } … … 110 130 'cookiepro_header' => esc_html( wp_unslash( get_option( 'cookiepro_header' ) ) ), 111 131 ); 132 133 $this->settings1 = array( 134 'cookiepro_analyticsID' => esc_html( wp_unslash( get_option( 'cookiepro_analyticsID' ) ) ), 135 ); 136 112 137 include_once WP_PLUGIN_DIR . '/' . $this->plugin->name . '/views/settings.php'; 113 138 } … … 154 179 echo wp_unslash( $myopt ); 155 180 } 181 182 public function output1($setting1){ 183 if ( is_admin() || is_feed() || is_robots() || is_trackback() ) { 184 return; 185 } 186 if ( apply_filters( 'disable_cookiepro', false ) ) { 187 return; 188 } 189 if ( 'cookiepro_analyticsID' === $setting1 && apply_filters( 'cookiepro_analyticsID', false ) ) { 190 return; 191 } 192 $myopt = get_option( $setting1 ); 193 if ( empty( $myopt ) ) { 194 return; 195 } 196 if ( trim( $myopt ) === '' ) { 197 return; 198 } 199 $allowed_html = array( 200 'a' => array( 201 'href' => array(), 202 'title' => array(), 203 ), 204 'br' => array(), 205 'em' => array(), 206 'strong' => array(), 207 'script' => array( 208 'src' => array(), 209 'type' => array(), 210 'charset' => array(), 211 ), 212 ); 213 echo wp_unslash( $myopt ); 214 215 } 156 216 /** Frontendheader functions. */ 157 217 public function loadlanguagefiles() { 158 218 load_plugin_textdomain( $this->plugin->name, false, $this->plugin->name . '/languages/' ); 159 } 219 220 } 221 160 222 } 161 223 162 224 $cookiepro = new Cookiepro(); 225 -
cookiepro/trunk/readme.txt
r2206331 r2207108 3 3 Tags: Cookie consent, Cookie compliance, GDPR, Cookie law, EU privacy directive, cookie notice, code, content, css, facebook pixel, footer, footer code, footer scripts, footers, google analytics, head, header, header code, header scripts, headers, insert, insert code, insert scripts, js, meta, meta tags, scripts, wpmu, cookies, cookie consent, cookie banner, preference center, privacy, cookie compliance, cookie notice, privacy policy, cookie policy, cookie script, google tag manager 4 4 Requires at least: 3.6 5 Tested up to: 5. 2.36 Stable tag: 1.0. 15 Tested up to: 5.3 6 Stable tag: 1.0.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
cookiepro/trunk/views/dashboard-notices.php
r2100481 r2207108 8 8 * @license GPL2 9 9 * @link https://cookiepro.com 10 * @since 1.0. 010 * @since 1.0.2 11 11 */ 12 12 -
cookiepro/trunk/views/settings.php
r2100481 r2207108 8 8 * @license GPL2 9 9 * @link https://cookiepro.com 10 * @since 1.0. 010 * @since 1.0.2 11 11 */ 12 12 … … 158 158 </div> 159 159 160 <!--Enable automatic blocking of google analytics start --> 161 162 <div id="poststuff"> 163 <div id="post-body" class="metabox-holder columns-2"> 164 <div id="post-body-content"> 165 <div id="normal-sortables" class="meta-box-sortables ui-sortable"> 166 <div class="postbox"> 167 <h3 class="hndle"> 168 <span><?php esc_html_e( 'Enable automatic blocking of google analytics by entering your ID below' ); ?></span> 169 </h3> 170 <div class="inside"> 171 <span>Enter Your Analytics Id:</span> 172 <form action="options-general.php?page=cookiepro" method="post"> 173 <input type="text" name="cookiepro_analyticsID" placeholder="UA-XXXXXXXXX-X" value="<?php echo get_option('cookiepro_analyticsID'); ?>" /> 174 <?php wp_nonce_field( $this->plugin->name, $this->plugin->name . '_nonce' ); ?> 175 <p> 176 <input name="submit" type="submit" name="Submit" class="button button-primary" value="<?php esc_html_e( 'Save' ); ?>" /> 177 </p> 178 </form> 179 </div> 180 </div> 181 </div> 182 </div> 183 </div> 184 </div> 185 186 <!--Enable automatic blocking of google analytics end --> 160 187 161 188 <div id="poststuff" > -
cookiepro/trunk/views/sidebar.php
r2100481 r2207108 8 8 * @license GPL2 9 9 * @link https://cookiepro.com 10 * @since 1.0. 010 * @since 1.0.2 11 11 */ 12 12
Note: See TracChangeset
for help on using the changeset viewer.