Changeset 2023805
- Timestamp:
- 02/02/2019 02:58:11 PM (7 years ago)
- Location:
- easy-cookie-law/trunk
- Files:
-
- 2 added
- 6 edited
-
class/easy-cookie-law.php (modified) (17 diffs)
-
css/ecl-style.css (modified) (1 diff)
-
easy-cookie-law.php (modified) (3 diffs)
-
functions (added)
-
functions/functions.php (added)
-
languages/easy-cookie-law-es_ES.mo (modified) (previous)
-
languages/easy-cookie-law-es_ES.po (modified) (11 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-cookie-law/trunk/class/easy-cookie-law.php
r2019905 r2023805 1 1 <?php 2 3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 2 4 3 5 class EasyCookieLaw { … … 5 7 const ECL_COOKIE_NAME = "easy-cookie-law"; 6 8 const ECL_OPTIONS_DB = "ecl_options"; 7 const ECL_OPTIONS = array( 8 "ecl_text" => "Cookies help us deliver our services. By using our services, you agree to our use of cookies.", 9 "ecl_link" => "http://www.aboutcookies.org/", 10 "ecl_link_text" => "More Info", 11 "ecl_link_target" => "_blank", 12 "ecl_close" => "Close", 13 "ecl_position" => "bottom", 14 "ecl_custom" => 0, 15 "ecl_noticecolor" => "#ffffff", 16 "ecl_textcolor" => "#000000", 17 "ecl_linkscolor" => "#b30000", 18 "ecl_gtm_header" => "", 19 "ecl_gtm_body" => "", 20 "ecl_custom_func" => 0 21 ); 9 const ECL_SETTINGS = [ 10 "ecl_text" => [ 11 "default" => "Cookies help us deliver our services. By using our services, you agree to our use of cookies.", 12 "sanitize" => "sanitize_text_field", 13 "escape" => "esc_textarea" 14 ], 15 "ecl_link" => [ 16 "default" => "http://www.aboutcookies.org/", 17 "sanitize" => "esc_url", 18 "escape" => "esc_url" 19 ], 20 "ecl_link_text" => [ 21 "default" => "More Info", 22 "sanitize" => "sanitize_text_field", 23 "escape" => "esc_textarea" 24 ], 25 "ecl_link_target" => [ 26 "default" => "_blank", 27 "sanitize" => "esc_attr", 28 "escape" => "esc_attr" 29 ], 30 "ecl_close" => [ 31 "default" => "Close", 32 "sanitize" => "sanitize_text_field", 33 "escape" => "esc_textarea" 34 ], 35 "ecl_position" => [ 36 "default" => "bottom", 37 "sanitize" => "esc_attr", 38 "escape" => "esc_attr" 39 ], 40 "ecl_custom" => [ 41 "default" => 0, 42 "sanitize" => "ecl_to_int", 43 "escape" => "ecl_to_int" 44 ], 45 "ecl_noticecolor" => [ 46 "default" => "#ffffff", 47 "sanitize" => "esc_attr", 48 "escape" => "esc_attr" 49 ], 50 "ecl_textcolor" => [ 51 "default" => "#000000", 52 "sanitize" => "esc_attr", 53 "escape" => "esc_attr" 54 ], 55 "ecl_linkscolor" => [ 56 "default" => "#b30000", 57 "sanitize" => "esc_attr", 58 "escape" => "esc_attr" 59 ], 60 "ecl_gtm_header" => [ 61 "default" => "", 62 "sanitize" => 'ecl_sanitize_js', 63 "escape" => 'ecl_escape_js' 64 ], 65 "ecl_gtm_body" => [ 66 "default" => "", 67 "sanitize" => 'ecl_sanitize_js', 68 "escape" => 'ecl_sanitize_js' 69 ], 70 "ecl_custom_func" => [ 71 "default" => 0, 72 "sanitize" => "ecl_to_int", 73 "escape" => "ecl_to_int" 74 ], 75 "ecl_hide_admin" => [ 76 "default" => 1, 77 "sanitize" => "ecl_to_int", 78 "escape" => "ecl_to_int" 79 ], 80 "ecl_hide_editor" => [ 81 "default" => 1, 82 "sanitize" => "ecl_to_int", 83 "escape" => "ecl_to_int" 84 ], 85 "ecl_hide_author" => [ 86 "default" => 1, 87 "sanitize" => "ecl_to_int", 88 "escape" => "ecl_to_int" 89 ], 90 ]; 22 91 const ECL_GTM_HP = "<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 23 92 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], … … 29 98 private $options; 30 99 100 /** 101 * Load the options variable 102 */ 31 103 function __construct() 32 104 { … … 34 106 } 35 107 36 private function allowedTags() 37 { 38 return array_merge( 39 wp_kses_allowed_html( 'post' ), 40 array( 41 'iframe' => array( 42 'allowfullscreen' => array(), 43 'frameborder' => array(), 44 'height' => array(), 45 'src' => array(), 46 'width' => array(), 47 ), 48 'noscript' => array(), 49 "script" => array( 50 'async' => array(), 51 'charset' => array(), 52 'src' => array(), 53 'type' => array() 54 ), 55 'style' => array( 56 'type' => array() 57 ) 58 ) 59 ); 60 } 61 62 /** 63 * Get and format data from DB 108 /** 109 * Returns an array extracting the values from the indicated keys 110 * from the subarrays 111 * 112 * @var array $array Array to be used 113 * @var string $field_name Name of the field to be extracted 114 * @return array 115 */ 116 private function extractFromArray($array, $field_name) 117 { 118 $options = []; 119 foreach($array as $key => $value) 120 { 121 $options[$key] = $value[$field_name]; 122 } 123 return $options; 124 } 125 126 /** 127 * Get the default options and values 128 * 129 * @return array 130 */ 131 private function defaultOptions() 132 { 133 return self::extractFromArray(self::ECL_SETTINGS, 'default'); 134 } 135 136 /** 137 * Get the default options and and sanitize functions names 138 * 139 * @return array 140 */ 141 private function formSanitizeFields() 142 { 143 return self::extractFromArray(self::ECL_SETTINGS, 'sanitize'); 144 } 145 146 /** 147 * Get the default options and and escape functions names 148 * 149 * @return array 150 */ 151 private function formEscapeFields() 152 { 153 return self::extractFromArray(self::ECL_SETTINGS, 'escape'); 154 } 155 156 /** 157 * Get options from DB 158 * If a option is not saved, use the default values 64 159 */ 65 160 private function getOptions() 66 161 { 67 $ecl_options = get_option(self::ECL_OPTIONS_DB, self::ECL_OPTIONS); 68 69 $this->options['text'] = esc_textarea($ecl_options['ecl_text']); 70 $this->options['link'] = esc_url($ecl_options['ecl_link']); 71 $this->options['link_text'] = esc_textarea($ecl_options['ecl_link_text']); 72 $this->options['link_target'] = esc_attr($ecl_options['ecl_link_target']); 73 $this->options['close'] = esc_textarea($ecl_options['ecl_close']); 74 $this->options['position'] = esc_textarea($ecl_options['ecl_position']); 75 $this->options['custom'] = esc_attr($ecl_options['ecl_custom']); 76 $this->options['noticecolor'] = esc_attr($ecl_options['ecl_noticecolor']); 77 $this->options['textcolor'] = esc_attr($ecl_options['ecl_textcolor']); 78 $this->options['linkscolor'] = esc_attr($ecl_options['ecl_linkscolor']); 79 $this->options['gtm_header'] = self::escapeJS($ecl_options['ecl_gtm_header']); 80 $this->options['gtm_body'] = self::escapeJS($ecl_options['ecl_gtm_body']); 81 $this->options['custom_func'] = esc_attr($ecl_options['ecl_custom_func']); 82 } 83 84 /** 85 * Print the cookie notice and all needed JS and CSS for the visitor 162 $default_options = $this->defaultOptions(); 163 $ecl_options = get_option(self::ECL_OPTIONS_DB, $default_options); 164 165 // In case any options is missing 166 foreach($default_options as $key => $value) 167 { 168 if(!isset($ecl_options[$key])) 169 { 170 $ecl_options[$key] = $value; 171 } 172 } 173 174 // Escape the options 175 $escape_fields = $this->formEscapeFields(); 176 foreach($escape_fields as $key => $value) 177 { 178 $name = str_replace('ecl_', '', $key); 179 $this->options[$name] = $value($ecl_options[$key]); 180 } 181 } 182 183 /** 184 * Print the JS and CSS needed for the notice 86 185 */ 87 186 public function printNotice() … … 114 213 } 115 214 215 /** 216 * Print the notice on the footer 217 */ 116 218 public function printFooterNotice() 117 219 { 220 if(self::hideForUser()){ 221 return; 222 } 223 118 224 $ecl_style_otuput = ""; 119 225 if( $this->options['custom'] == 0 ) { … … 144 250 } 145 251 146 // Sanitize JS before saving it to DB 147 private function sanitizeJS($input) 148 { 149 return wp_kses($input, self::allowedTags()); 150 } 151 152 // Escape JS before echoing it 153 private function escapeJS($input) 154 { 155 return stripslashes_deep( html_entity_decode( trim( self::sanitizeJS($input) ) ) ); 156 } 157 252 /** 253 * Print the GTM header script 254 */ 158 255 public function printGtmHeader() 159 256 { 160 257 if(!empty($this->options['gtm_header']) ) 161 258 { 162 echo self::escapeJS($this->options['gtm_header']);259 echo $this->options['gtm_header']; 163 260 } 164 261 } … … 166 263 /** 167 264 * Collects the POST options and saves it to DB 265 * Echoes a success message 168 266 */ 169 267 public function saveOptions() … … 171 269 172 270 // Save options if form was sended 173 if( isset($_POST['ecl_save_data']) ) { 174 175 $ecl_options = self::ECL_OPTIONS; 176 177 if(isset($_POST['ecltext'])){ 178 $ecl_options['ecl_text'] = sanitize_text_field($_POST['ecltext']); 179 } 180 if(isset($_POST['ecllink'])){ 181 $ecl_options['ecl_link'] = esc_url($_POST['ecllink']); 182 } 183 if(isset($_POST['ecllinktext'])){ 184 $ecl_options['ecl_link_text'] = sanitize_text_field($_POST['ecllinktext']); 185 } 186 if(isset($_POST['eclclose'])){ 187 $ecl_options['ecl_close'] = sanitize_text_field($_POST['eclclose']); 188 } 189 if(isset($_POST['eclposition'])){ 190 $ecl_options['ecl_position'] = esc_attr($_POST['eclposition']); 191 } 192 if(isset($_POST['eclcustom'])){ 193 $ecl_options['ecl_custom'] = esc_attr($_POST['eclcustom']); 194 } 195 if(isset($_POST['eclnoticecolor'])){ 196 $ecl_options['ecl_noticecolor'] = esc_attr($_POST['eclnoticecolor']); 197 } 198 if(isset($_POST['ecltextcolor'])){ 199 $ecl_options['ecl_textcolor'] = esc_attr($_POST['ecltextcolor']); 200 } 201 if(isset($_POST['ecllinkscolor'])){ 202 $ecl_options['ecl_linkscolor'] = esc_attr($_POST['ecllinkscolor']); 203 } 204 if(isset($_POST['ecl_link_target'])){ 205 $ecl_options['ecl_link_target'] = esc_attr($_POST['ecl_link_target']); 206 } 207 if(isset($_POST['ecl_gtm_header'])){ 208 $ecl_gtm_header = str_replace("<script>", "", $_POST['ecl_gtm_header']); 209 $ecl_gtm_header = str_replace("</script>", "", $ecl_gtm_header); 210 $ecl_options['ecl_gtm_header'] = self::sanitizeJS($ecl_gtm_header); 211 } 212 if(isset($_POST['ecl_gtm_body'])){ 213 $ecl_options['ecl_gtm_body'] = self::sanitizeJS($_POST['ecl_gtm_body']); 214 } 215 if(isset($_POST['ecl_custom_func'])){ 216 $ecl_options['ecl_custom_func'] = esc_attr($_POST['ecl_custom_func']); 217 } 218 219 echo "<div class='wrap' id='saved'>" . __('Saved!', 'easy-cookie-law') . "</div>"; 271 if( isset($_POST['ecl_save_data']) ) 272 { 273 $ecl_options = self::getOptions(); 274 $fields = self::formSanitizeFields(); 275 foreach($fields as $key => $value) 276 { 277 if(isset($_POST[$key])) 278 { 279 $ecl_options[$key] = $value($_POST[$key]); 280 } 281 else 282 { 283 $ecl_options[$key] = false; 284 } 285 } 286 287 // Remove script tags from gtm_header 288 $ecl_options['ecl_gtm_header'] = str_replace("<script>", "", $ecl_options['ecl_gtm_header']); 289 $ecl_options['ecl_gtm_header'] = str_replace("<script type=\"text/javascript\">", "", $ecl_options['ecl_gtm_header']); 290 $ecl_options['ecl_gtm_header'] = str_replace("</script>", "", $ecl_options['ecl_gtm_header']); 220 291 221 292 update_option("ecl_options", $ecl_options); 293 echo "<div class='wrap' id='ecl_saved'>" . __('Saved!', 'easy-cookie-law') . "</div>"; 222 294 } 223 295 } … … 243 315 <div class="caja"> 244 316 <div class="form-box"> 245 <label for="ecl text"><?php echo __('Message', 'easy-cookie-law'); ?></label>246 <textarea rows="5" name="ecl text" id="ecltext"><?php echo $this->options["text"]; ?></textarea>317 <label for="ecl_text"><?php echo __('Message', 'easy-cookie-law'); ?></label> 318 <textarea rows="5" name="ecl_text" id="ecl_text"><?php echo $this->options["text"]; ?></textarea> 247 319 <em><?php echo __("People will see this notice only if the use of cookies has not been accepted yet", "easy-cookie-law"); ?></em><br> 248 320 </div> … … 252 324 <div class="caja"> 253 325 <div class="form-box"> 254 <label for="ecl link"><?php echo __('More Info URL', 'easy-cookie-law'); ?></label>255 <input type="url" name="ecl link" id="ecllink" value="<?php echo $this->options["link"]; ?>" />256 </div> 257 <div class="form-box"> 258 <label for="ecl linktext"><?php echo __('More Info text (text showed in the link)', 'easy-cookie-law'); ?></label>259 <input type="text" name="ecl linktext" id="ecllinktext" value="<?php echo $this->options["link_text"]; ?>" />260 </div> 261 <div class="form-box"> 262 <label for="ecl linktarget"><?php echo __('Target of the link', 'easy-cookie-law'); ?></label>263 <select name="ecl linktarget">326 <label for="ecl_link"><?php echo __('More Info URL', 'easy-cookie-law'); ?></label> 327 <input type="url" name="ecl_link" id="ecl_link" value="<?php echo $this->options["link"]; ?>" /> 328 </div> 329 <div class="form-box"> 330 <label for="ecl_link_text"><?php echo __('More Info text (text showed in the link)', 'easy-cookie-law'); ?></label> 331 <input type="text" name="ecl_link_text" id="ecl_link_text" value="<?php echo $this->options["link_text"]; ?>" /> 332 </div> 333 <div class="form-box"> 334 <label for="ecl_link_target"><?php echo __('Target of the link', 'easy-cookie-law'); ?></label> 335 <select name="ecl_link_target"> 264 336 <option value="_blank" <?php if($this->options["link_target"] == "_blank") : ?> selected <?php endif; ?>><?php echo __("New tab or windows", 'easy-cookie-law'); ?></option> 265 337 <option value="_self" <?php if($this->options["link_target"] == "_self") : ?> selected <?php endif; ?>><?php echo __("Same window", 'easy-cookie-law'); ?></option> … … 267 339 </div> 268 340 <div class="form-box"> 269 <label for="ecl close"><?php echo __('Text for the link to close the message', 'easy-cookie-law'); ?></label>270 <input type="text" name="ecl close" id="eclclose" value="<?php echo $this->options["close"]; ?>" />341 <label for="ecl_close"><?php echo __('Text for the link to close the message', 'easy-cookie-law'); ?></label> 342 <input type="text" name="ecl_close" id="ecl_close" value="<?php echo $this->options["close"]; ?>" /> 271 343 </div> 272 344 </div> … … 275 347 <div class="caja"> 276 348 <div class="form-box"> 277 <label for="ecl position"><?php echo __('Position of the notice', 'easy-cookie-law'); ?></label>349 <label for="ecl_position"><?php echo __('Position of the notice', 'easy-cookie-law'); ?></label> 278 350 <?php $top = $this->options['position'] == "top" ? 1 : 2 ; ?> 279 <input type="radio" name="ecl position" value="top" <?php if($top == "1"): ?>checked<?php endif; ?>><?php echo __('Top', 'easy-cookie-law'); ?></input>280 <input type="radio" name="ecl position" value="bottom" <?php if($top == "2"): ?>checked<?php endif; ?>><?php echo __('Bottom', 'easy-cookie-law'); ?></input>281 </div> 282 <div class="form-box"> 283 <label for="ecl noticecolor"><?php echo __('Background color of the notice', 'easy-cookie-law'); ?></label>284 <input type="color" name="ecl noticecolor" id="eclnoticecolor" value="<?php echo $this->options["noticecolor"]; ?>" />285 </div> 286 <div class="form-box"> 287 <label for="ecl textcolor"><?php echo __('Text color of the notice', 'easy-cookie-law'); ?></label>288 <input type="color" name="ecl textcolor" id="ecltextcolor" value="<?php echo $this->options["textcolor"]; ?>" />289 </div> 290 <div class="form-box"> 291 <label for="ecl linkscolor"><?php echo __('Links color of the notice', 'easy-cookie-law'); ?></label>292 <input type="color" name="ecl linkscolor" id="ecllinkscolor" value="<?php echo $this->options["linkscolor"]; ?>" />351 <input type="radio" name="ecl_position" value="top" <?php if($top == "1"): ?>checked<?php endif; ?>><?php echo __('Top', 'easy-cookie-law'); ?></input> 352 <input type="radio" name="ecl_position" value="bottom" <?php if($top == "2"): ?>checked<?php endif; ?>><?php echo __('Bottom', 'easy-cookie-law'); ?></input> 353 </div> 354 <div class="form-box"> 355 <label for="ecl_noticecolor"><?php echo __('Background color of the notice', 'easy-cookie-law'); ?></label> 356 <input type="color" name="ecl_noticecolor" id="ecl_noticecolor" value="<?php echo $this->options["noticecolor"]; ?>" /> 357 </div> 358 <div class="form-box"> 359 <label for="ecl_textcolor"><?php echo __('Text color of the notice', 'easy-cookie-law'); ?></label> 360 <input type="color" name="ecl_textcolor" id="ecl_textcolor" value="<?php echo $this->options["textcolor"]; ?>" /> 361 </div> 362 <div class="form-box"> 363 <label for="ecl_linkscolor"><?php echo __('Links color of the notice', 'easy-cookie-law'); ?></label> 364 <input type="color" name="ecl_linkscolor" id="ecl_linkscolor" value="<?php echo $this->options["linkscolor"]; ?>" /> 293 365 </div> 294 366 </div> … … 297 369 <div class="caja"> 298 370 <div class="form-box-check"> 299 <label for="ecl custom"><?php echo __('Let me use my own CSS', 'easy-cookie-law'); ?></label>300 <input type="checkbox" name="ecl custom" id="eclcustom" value='1' <?php if($this->options['custom']== 1){ echo "checked";} ?> />371 <label for="ecl_custom"><?php echo __('Let me use my own CSS', 'easy-cookie-law'); ?></label> 372 <input type="checkbox" name="ecl_custom" id="ecl_custom" value='1' <?php if($this->options['custom'] === 1){ echo "checked";} ?> /> 301 373 <?php echo __('The plugin will not print any styles. Check this if you want to use your custom CSS written in any other stylesheet or inline.<br>All your stlyes should be using the CSS id #ecl_notice, since it is the only css ID that this plugin uses for the notice.', 'easy-cookie-law'); ?> 374 </div> 375 </div> 376 377 <!-- Roles --> 378 <div class="caja"> 379 <div class="form-box-check"> 380 <label for="ecl_hide_admin"> 381 <input type="checkbox" name="ecl_hide_admin" id="ecl_hide_admin" value='1' <?php if($this->options['hide_admin'] == 1){ echo "checked";} ?> /> 382 <?php echo __('Remove notice and tracking code for admins', 'easy-cookie-law'); ?> 383 </label> 384 </div> 385 <div class="form-box-check"> 386 <label for="ecl_hide_editor"> 387 <input type="checkbox" name="ecl_hide_editor" id="ecl_hide_editor" value='1' <?php if($this->options['hide_editor'] == 1){ echo "checked";} ?> /> 388 <?php echo __('Remove notice and tracking code for editors', 'easy-cookie-law'); ?> 389 </label> 390 </div> 391 <div class="form-box-check"> 392 <label for="ecl_hide_author"> 393 <input type="checkbox" name="ecl_hide_author" id="ecl_hide_author" value='1' <?php if($this->options['hide_author'] == 1){ echo "checked";} ?> /> 394 <?php echo __('Remove notice and tracking code for registered users', 'easy-cookie-law'); ?> 395 </label> 302 396 </div> 303 397 </div> … … 331 425 <div class="form-box-check"> 332 426 <label for="ecl_custom_func"><?php echo __('Let me manually print the GMT code for the header where I want', 'easy-cookie-law'); ?></label> 333 <input type="checkbox" name="ecl_custom_func" id="ecl_custom_func" value='1' <?php if($this->options['custom_func'] == 1){ echo "checked";} ?> />427 <input type="checkbox" name="ecl_custom_func" id="ecl_custom_func" value='1' <?php if($this->options['custom_func'] === 1){ echo "checked";} ?> /> 334 428 <em> 335 429 <?php echo __('Check this if you want to modify your theme to print the GMT header code where you want. For this, you have to put this function where you want to print the code:', 'easy-cookie-law'); ?><br> 336 <pre><code><?php if(function_exists('ecl_print_all')) ecl_print_all(); ?> ;</code></pre>430 <pre><code><?php if(function_exists('ecl_print_all')) ecl_print_all(); ?></code></pre> 337 431 <?php echo __('This function will print he GMT code for the header in the position you want, instead of using the wp_head action hook. Normally you should use this if you want to print the code on the top of your <head>; tag, as Google recommends.', 'easy-cookie-law'); ?> 338 432 </em> … … 352 446 } 353 447 448 /** 449 * Returns false if the visitor should be able to see the notice based on its role 450 * 451 * @return boolean 452 */ 453 private function hideForUser() 454 { 455 $current_user = wp_get_current_user(); 456 457 if($this->options['hide_admin'] == 1 && in_array('administrator', $current_user->roles)) 458 { 459 return true; 460 } 461 462 if($this->options['hide_editor'] == 1 && in_array('editor', $current_user->roles)) 463 { 464 return true; 465 } 466 467 if($this->options['hide_author'] == 1 && in_array('author', $current_user->roles)) 468 { 469 return true; 470 } 471 472 return false; 473 } 474 475 /** 476 * Get the GTM body script 477 * 478 * @return string 479 */ 354 480 public function returnBodyScripts() 355 481 { 356 return $this->options['gtm_body']; 357 } 358 359 // Using same format for function name as in JS 482 if( !self::hideForUser() ){ 483 return $this->options['gtm_body']; 484 } 485 } 486 487 /** 488 * Check if cookies are accepted 489 * This function use same format for the name as in JS for usability reasons 490 * 491 * @return boolean 492 */ 360 493 public function is_cookie_accepted() 361 494 { … … 363 496 } 364 497 498 /** 499 * Check if the wp_head action hook should be used 500 * 501 * @return boolean 502 */ 365 503 public function useWPHeadHook() 366 504 { … … 369 507 return true; 370 508 } 371 else 372 { 373 return false; 374 } 509 510 return false; 375 511 } 376 512 } -
easy-cookie-law/trunk/css/ecl-style.css
r2019898 r2023805 22 22 } 23 23 24 .ecl_options #saved{24 #ecl_saved{ 25 25 background-color: #449d44; 26 26 color: #fff; -
easy-cookie-law/trunk/easy-cookie-law.php
r2019905 r2023805 4 4 * Description: Minimal code to help your website respect the cookie law 5 5 * Plugin URI: https://antsanchez.com 6 * Version: 2. 36 * Version: 2.4 7 7 * Author: antsanchez 8 8 * Author URI: https://antsanchez.com … … 27 27 */ 28 28 29 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 30 29 31 // Include Class 32 include_once( plugin_dir_path( __FILE__ ) . 'functions/functions.php'); 30 33 include_once( plugin_dir_path( __FILE__ ) . 'class/easy-cookie-law.php'); 31 34 … … 75 78 $ecl_plugin->printForm(); 76 79 } 77 78 80 79 81 /** -
easy-cookie-law/trunk/languages/easy-cookie-law-es_ES.po
r2019898 r2023805 2 2 msgstr "" 3 3 "Project-Id-Version: Easy Cookie Law\n" 4 "POT-Creation-Date: 2019-0 1-27 13:56+0100\n"5 "PO-Revision-Date: 2019-0 1-27 13:57+0100\n"4 "POT-Creation-Date: 2019-02-02 15:25+0100\n" 5 "PO-Revision-Date: 2019-02-02 15:25+0100\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 22 22 "X-Poedit-SearchPathExcluded-0: *.js\n" 23 23 24 #: class/easy-cookie-law.php:2 2324 #: class/easy-cookie-law.php:291 25 25 msgid "Saved!" 26 26 msgstr "¡Guardado!" 27 27 28 #: class/easy-cookie-law.php: 24328 #: class/easy-cookie-law.php:309 29 29 msgid "Easy Cookie Law Menu Options" 30 30 msgstr "Menú de opciones de Easy Cookie Law" 31 31 32 #: class/easy-cookie-law.php: 24932 #: class/easy-cookie-law.php:315 33 33 msgid "Message" 34 34 msgstr "Mensaje" 35 35 36 #: class/easy-cookie-law.php: 25136 #: class/easy-cookie-law.php:317 37 37 msgid "" 38 38 "People will see this notice only if the use of cookies has not been accepted " … … 42 42 "todavía" 43 43 44 #: class/easy-cookie-law.php: 25844 #: class/easy-cookie-law.php:324 45 45 msgid "More Info URL" 46 46 msgstr "Más Info URL" 47 47 48 #: class/easy-cookie-law.php: 26248 #: class/easy-cookie-law.php:328 49 49 msgid "More Info text (text showed in the link)" 50 50 msgstr "Más información texto (texto mostrado en el enlace)" 51 51 52 #: class/easy-cookie-law.php: 26652 #: class/easy-cookie-law.php:332 53 53 msgid "Target of the link" 54 54 msgstr "Objetivo del enlace" 55 55 56 #: class/easy-cookie-law.php: 26856 #: class/easy-cookie-law.php:334 57 57 msgid "New tab or windows" 58 58 msgstr "Nueva pestaña o ventanas" 59 59 60 #: class/easy-cookie-law.php: 26960 #: class/easy-cookie-law.php:335 61 61 msgid "Same window" 62 62 msgstr "Misma ventana" 63 63 64 #: class/easy-cookie-law.php: 27364 #: class/easy-cookie-law.php:339 65 65 msgid "Text for the link to close the message" 66 66 msgstr "Texto del vínculo para cerrar el mensaje" 67 67 68 #: class/easy-cookie-law.php: 28168 #: class/easy-cookie-law.php:347 69 69 msgid "Position of the notice" 70 70 msgstr "Posición del aviso" 71 71 72 #: class/easy-cookie-law.php: 28372 #: class/easy-cookie-law.php:349 73 73 msgid "Top" 74 74 msgstr "Arriba" 75 75 76 #: class/easy-cookie-law.php: 28476 #: class/easy-cookie-law.php:350 77 77 msgid "Bottom" 78 78 msgstr "Abajo" 79 79 80 #: class/easy-cookie-law.php: 28780 #: class/easy-cookie-law.php:353 81 81 msgid "Background color of the notice" 82 82 msgstr "Color de fondo del aviso" 83 83 84 #: class/easy-cookie-law.php: 29184 #: class/easy-cookie-law.php:357 85 85 msgid "Text color of the notice" 86 86 msgstr "Color del texto del aviso" 87 87 88 #: class/easy-cookie-law.php: 29588 #: class/easy-cookie-law.php:361 89 89 msgid "Links color of the notice" 90 90 msgstr "Color de los links del aviso" 91 91 92 #: class/easy-cookie-law.php:3 0392 #: class/easy-cookie-law.php:369 93 93 msgid "Let me use my own CSS" 94 94 msgstr "Permítanme usar mi propio CSS" 95 95 96 #: class/easy-cookie-law.php:3 0596 #: class/easy-cookie-law.php:371 97 97 msgid "" 98 98 "The plugin will not print any styles. Check this if you want to use your " … … 106 106 "único ID CSS que este plugin utiliza para el aviso." 107 107 108 #: class/easy-cookie-law.php:311 108 #: class/easy-cookie-law.php:380 109 msgid "Remove notice and tracking code for admins" 110 msgstr "Eliminar el aviso y el código de seguimiento para los administradores" 111 112 #: class/easy-cookie-law.php:386 113 msgid "Remove notice and tracking code for editors" 114 msgstr "Eliminar el aviso y el código de seguimiento para los editores" 115 116 #: class/easy-cookie-law.php:392 117 msgid "Remove notice and tracking code for registered users" 118 msgstr "" 119 "Eliminar el aviso y el código de seguimiento para los usuarios registrados" 120 121 #: class/easy-cookie-law.php:399 109 122 msgid "Optional: Google Tag Manager" 110 123 msgstr "Opcional: Google Tag Manager" 111 124 112 #: class/easy-cookie-law.php: 313125 #: class/easy-cookie-law.php:401 113 126 msgid "" 114 127 "If you use Google Tag Manager, you can put the code here below and this " … … 120 133 "uso de cookies." 121 134 122 #: class/easy-cookie-law.php: 318135 #: class/easy-cookie-law.php:406 123 136 msgid "Code after the opening of the <head> tag:" 124 137 msgstr "Código después de la apertura de la etiqueta <head> :" 125 138 126 #: class/easy-cookie-law.php: 320139 #: class/easy-cookie-law.php:408 127 140 msgid "" 128 141 "Introduce the code withouth <script></script> tags. The plugin " … … 132 145 "plugin bloqueará la ejecución del código hasta que se acepten las cookies" 133 146 134 #: class/easy-cookie-law.php: 323147 #: class/easy-cookie-law.php:411 135 148 msgid "Code after the opening of the <body> tag:" 136 149 msgstr "Código después de la apertura de la etiqueta <body> :" 137 150 138 #: class/easy-cookie-law.php: 326151 #: class/easy-cookie-law.php:414 139 152 msgid "" 140 153 "This requires a tiny manual action from your side: you need to put the " … … 144 157 "siguientes líneas de PHP en su tema:" 145 158 146 #: class/easy-cookie-law.php: 328159 #: class/easy-cookie-law.php:416 147 160 msgid "" 148 161 "Normally, you must put this only in your 'header.php' file, directly after " … … 154 167 "dependiendo de su tema." 155 168 156 #: class/easy-cookie-law.php: 330169 #: class/easy-cookie-law.php:418 157 170 #, php-format 158 171 msgid "" … … 165 178 "target=„_blank“>support forum</a>." 166 179 167 #: class/easy-cookie-law.php: 336180 #: class/easy-cookie-law.php:424 168 181 msgid "Let me manually print the GMT code for the header where I want" 169 182 msgstr "Permíteme imprimir manualmente el código GMT del hacer donde quiera" 170 183 171 #: class/easy-cookie-law.php: 339184 #: class/easy-cookie-law.php:427 172 185 msgid "" 173 186 "Check this if you want to modify your theme to print the GMT header code " … … 179 192 "quieras imprimir el código:" 180 193 181 #: class/easy-cookie-law.php: 341194 #: class/easy-cookie-law.php:429 182 195 msgid "" 183 196 "This function will print he GMT code for the header in the position you " … … 191 204 "etiqueta <head> como recomienda Google." 192 205 193 #: class/easy-cookie-law.php: 349206 #: class/easy-cookie-law.php:437 194 207 msgid "Update" 195 208 msgstr "Actualizar" 196 209 197 #: easy-cookie-law.php:7 0210 #: easy-cookie-law.php:71 198 211 msgid "You do not have sufficient permissions to access this page." 199 212 msgstr "No tienes suficientes permisos para acceder a esta página." -
easy-cookie-law/trunk/readme.txt
r2019905 r2023805 5 5 Requires PHP: 5.2 6 6 Tested up to: 5.0.3 7 Stable tag: 2. 37 Stable tag: 2.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 70 70 == Changelog == 71 71 72 = 2.4 = 73 * Added check of user roles 74 * Fixed some PHP Warnings (Thanks to [Łukasz Muchlado](https://bapro.pl)) 75 72 76 = 2.3 = 73 77 * Fixed some small JavaScript bugs … … 92 96 93 97 = 1.7 = 94 * Bugfix in output string submitted by Giomba (www.ilgiomba.it)98 * Bugfix in output string (Thanks to [Giomba](www.ilgiomba.it)) 95 99 96 100 = 1.6 = … … 108 112 = 1.0 = 109 113 * First published version. 110 111 == Upgrade Notice ==112 = 2.2 =113 * Added support for Google Tag Manager
Note: See TracChangeset
for help on using the changeset viewer.