Version Description
- Se aade botn Configuracin en la pgina de plugins para acceder directamente a la configuracin del Asesor de Cookies.
- Se elimina una peticin ajax al servidor por generar problemas en algunas instalaciones WP.
- Se combinan los 3 archivos JS en uno slo para mejorar el rendimiento.
- Se arregla la previsualizacin que no funcionaba correctamente.
- Se resuelve problema cuando hay dos instalaciones WP en el mismo dominio y anidadas. Gracias Mikel!
- Detalles CSS
Download this release
Release Info
Developer | cdoral |
Plugin | Asesor de Cookies para normativa española |
Version | 0.19 |
Comparing to | |
See all releases |
Code changes from version 0.18 to 0.19
- config.php +0 -1
- external-wp.php +0 -22
- html/admin/estilos.css +7 -1
- html/admin/principal.html +1 -1
- html/admin/principal.js +2 -3
- html/front/_jquery.kookie.js +0 -107
- html/front/estilos.css +3 -2
- html/front/lib.js +0 -119
- html/front/principal.js +186 -1
- lib/plugin.php +63 -54
- plugin.php +2 -2
- readme.txt +9 -1
- traer_aviso.php +0 -39
config.php
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
|
3 |
define( "CDP_COOKIES_DIR_RAIZ", dirname( __FILE__ ) . '/' );
|
4 |
define( "CDP_COOKIES_URL_RAIZ", plugins_url( '/', __FILE__ ) );
|
5 |
-
define( "CDP_COOKIES_TRAER_AVISO_PHP_URL", CDP_COOKIES_URL_RAIZ . 'traer_aviso.php' );
|
6 |
define( "CDP_COOKIES_DIR_HTML", CDP_COOKIES_DIR_RAIZ . 'html/' );
|
7 |
define( 'CDP_COOKIES_URL_HTML', CDP_COOKIES_URL_RAIZ . 'html/' );
|
8 |
define( "CDP_COOKIES_LOG_ACTIVO", 0 );
|
2 |
|
3 |
define( "CDP_COOKIES_DIR_RAIZ", dirname( __FILE__ ) . '/' );
|
4 |
define( "CDP_COOKIES_URL_RAIZ", plugins_url( '/', __FILE__ ) );
|
|
|
5 |
define( "CDP_COOKIES_DIR_HTML", CDP_COOKIES_DIR_RAIZ . 'html/' );
|
6 |
define( 'CDP_COOKIES_URL_HTML', CDP_COOKIES_URL_RAIZ . 'html/' );
|
7 |
define( "CDP_COOKIES_LOG_ACTIVO", 0 );
|
external-wp.php
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Cargo el acceso a bd de Wordpress
|
4 |
-
$wp_path = $_SERVER["DOCUMENT_ROOT"];
|
5 |
-
if( file_exists($wp_path . '/wp-config.php') )
|
6 |
-
{
|
7 |
-
include_once( $wp_path.'/wp-config.php' );
|
8 |
-
include_once( $wp_path.'/wp-includes/wp-db.php' );
|
9 |
-
}
|
10 |
-
else
|
11 |
-
{
|
12 |
-
$wp_plugin_path_modified = explode( DIRECTORY_SEPARATOR, dirname( __FILE__ ), -3 );
|
13 |
-
$wp_path = implode( DIRECTORY_SEPARATOR, $wp_plugin_path_modified );
|
14 |
-
include_once( $wp_path . '/wp-config.php' );
|
15 |
-
include_once( $wp_path . '/wp-includes/wp-db.php' );
|
16 |
-
}
|
17 |
-
if( !file_exists( $wp_path . '/wp-config.php' ) )
|
18 |
-
exit;
|
19 |
-
if( !$wpdb )
|
20 |
-
$wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST ); ;
|
21 |
-
|
22 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
html/admin/estilos.css
CHANGED
@@ -50,10 +50,16 @@
|
|
50 |
.cdp-cookies-publi {
|
51 |
margin: 20px 0;
|
52 |
}
|
|
|
|
|
|
|
|
|
|
|
53 |
.cdp-cookies-publi a {
|
|
|
54 |
background-color: #76abdc;
|
55 |
padding: 10px;
|
56 |
-
margin: 0 10px
|
57 |
border-radius: 5px;
|
58 |
-moz-border-radius: 5px;
|
59 |
-webkit-border-radius: 5px;
|
50 |
.cdp-cookies-publi {
|
51 |
margin: 20px 0;
|
52 |
}
|
53 |
+
.cdp-cookies-publi:after {
|
54 |
+
display: table;
|
55 |
+
content: "";
|
56 |
+
clear:both;
|
57 |
+
}
|
58 |
.cdp-cookies-publi a {
|
59 |
+
float:left;
|
60 |
background-color: #76abdc;
|
61 |
padding: 10px;
|
62 |
+
margin: 0 10px 5px 0;
|
63 |
border-radius: 5px;
|
64 |
-moz-border-radius: 5px;
|
65 |
-webkit-border-radius: 5px;
|
html/admin/principal.html
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
</p>
|
9 |
|
10 |
<div class="cdp-cookies-publi">
|
11 |
-
<a href="http://webartesanal.com/
|
12 |
<a href="http://webartesanal.com/blog/desarrollador-wordpress-ventajas-de-contratar-a-un-profesional-wordpress/" target="_blank">¿Necesitas un desarrollador WordPress?</a>
|
13 |
</div>
|
14 |
|
8 |
</p>
|
9 |
|
10 |
<div class="cdp-cookies-publi">
|
11 |
+
<a href="http://webartesanal.com/alojamiento-y-mantenimiento-wordpress/" target="_blank"><strong>Mantenemos tu WordPress:</strong> Actualizaciones, copias de seguridad, antihacking, soporte telefónico</a>
|
12 |
<a href="http://webartesanal.com/blog/desarrollador-wordpress-ventajas-de-contratar-a-un-profesional-wordpress/" target="_blank">¿Necesitas un desarrollador WordPress?</a>
|
13 |
</div>
|
14 |
|
html/admin/principal.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
|
2 |
/* ======================================================================================
|
3 |
@author Carlos Doral Pérez (http://webartesanal.com)
|
4 |
-
@version 0.
|
5 |
@copyright Copyright © 2013 Carlos Doral Pérez, All Rights Reserved
|
6 |
License: GPLv2 or later
|
7 |
====================================================================================== */
|
@@ -113,8 +113,7 @@ jQuery( document ).ready( function( $ ) {
|
|
113 |
'&posicion=' + $( '#posicion' ).val() +
|
114 |
'&alineacion=' + $( '#alineacion' ).val() +
|
115 |
'&tema=' + $( '#tema:checked' ).val() +
|
116 |
-
'&tam_fuente=' + $( '#tam_fuente' ).val()
|
117 |
-
'&texto_aviso=' + encodeURI( $( '#texto_aviso' ).val() )
|
118 |
);
|
119 |
} );
|
120 |
|
1 |
|
2 |
/* ======================================================================================
|
3 |
@author Carlos Doral Pérez (http://webartesanal.com)
|
4 |
+
@version 0.19
|
5 |
@copyright Copyright © 2013 Carlos Doral Pérez, All Rights Reserved
|
6 |
License: GPLv2 or later
|
7 |
====================================================================================== */
|
113 |
'&posicion=' + $( '#posicion' ).val() +
|
114 |
'&alineacion=' + $( '#alineacion' ).val() +
|
115 |
'&tema=' + $( '#tema:checked' ).val() +
|
116 |
+
'&tam_fuente=' + $( '#tam_fuente' ).val()
|
|
|
117 |
);
|
118 |
} );
|
119 |
|
html/front/_jquery.kookie.js
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* jQuery Cookie Plugin v1.3.1
|
3 |
-
* https://github.com/carhartl/jquery-cookie
|
4 |
-
*
|
5 |
-
* Copyright 2013 Klaus Hartl
|
6 |
-
* Released under the MIT license
|
7 |
-
*/
|
8 |
-
(function (factory) {
|
9 |
-
if (typeof define === 'function' && define.amd) {
|
10 |
-
// AMD. Register as anonymous module.
|
11 |
-
define(['jquery'], factory);
|
12 |
-
} else {
|
13 |
-
// Browser globals.
|
14 |
-
factory(jQuery);
|
15 |
-
}
|
16 |
-
}(function ($) {
|
17 |
-
|
18 |
-
var pluses = /\+/g;
|
19 |
-
|
20 |
-
function decode(s) {
|
21 |
-
if (config.raw) {
|
22 |
-
return s;
|
23 |
-
}
|
24 |
-
try {
|
25 |
-
// If we can't decode the cookie, ignore it, it's unusable.
|
26 |
-
return decodeURIComponent(s.replace(pluses, ' '));
|
27 |
-
} catch(e) {}
|
28 |
-
}
|
29 |
-
|
30 |
-
function decodeAndParse(s) {
|
31 |
-
if (s.indexOf('"') === 0) {
|
32 |
-
// This is a quoted cookie as according to RFC2068, unescape...
|
33 |
-
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
34 |
-
}
|
35 |
-
|
36 |
-
s = decode(s);
|
37 |
-
|
38 |
-
try {
|
39 |
-
// If we can't parse the cookie, ignore it, it's unusable.
|
40 |
-
return config.json ? JSON.parse(s) : s;
|
41 |
-
} catch(e) {}
|
42 |
-
}
|
43 |
-
|
44 |
-
var config = $.cookie = function (key, value, options) {
|
45 |
-
|
46 |
-
// Write
|
47 |
-
if (value !== undefined) {
|
48 |
-
options = $.extend({}, config.defaults, options);
|
49 |
-
|
50 |
-
if (typeof options.expires === 'number') {
|
51 |
-
var days = options.expires, t = options.expires = new Date();
|
52 |
-
t.setDate(t.getDate() + days);
|
53 |
-
}
|
54 |
-
|
55 |
-
value = config.json ? JSON.stringify(value) : String(value);
|
56 |
-
|
57 |
-
return (document.cookie = [
|
58 |
-
config.raw ? key : encodeURIComponent(key),
|
59 |
-
'=',
|
60 |
-
config.raw ? value : encodeURIComponent(value),
|
61 |
-
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
62 |
-
options.path ? '; path=' + options.path : '',
|
63 |
-
options.domain ? '; domain=' + options.domain : '',
|
64 |
-
options.secure ? '; secure' : ''
|
65 |
-
].join(''));
|
66 |
-
}
|
67 |
-
|
68 |
-
// Read
|
69 |
-
|
70 |
-
var result = key ? undefined : {};
|
71 |
-
|
72 |
-
// To prevent the for loop in the first place assign an empty array
|
73 |
-
// in case there are no cookies at all. Also prevents odd result when
|
74 |
-
// calling $.cookie().
|
75 |
-
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
76 |
-
|
77 |
-
for (var i = 0, l = cookies.length; i < l; i++) {
|
78 |
-
var parts = cookies[i].split('=');
|
79 |
-
var name = decode(parts.shift());
|
80 |
-
var cookie = parts.join('=');
|
81 |
-
|
82 |
-
if (key && key === name) {
|
83 |
-
result = decodeAndParse(cookie);
|
84 |
-
break;
|
85 |
-
}
|
86 |
-
|
87 |
-
// Prevent storing a cookie that we couldn't decode.
|
88 |
-
if (!key && (cookie = decodeAndParse(cookie)) !== undefined) {
|
89 |
-
result[name] = cookie;
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
return result;
|
94 |
-
};
|
95 |
-
|
96 |
-
config.defaults = {};
|
97 |
-
|
98 |
-
$.removeCookie = function (key, options) {
|
99 |
-
if ($.cookie(key) !== undefined) {
|
100 |
-
// Must not alter options, thus extending a fresh object...
|
101 |
-
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
102 |
-
return true;
|
103 |
-
}
|
104 |
-
return false;
|
105 |
-
};
|
106 |
-
|
107 |
-
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
html/front/estilos.css
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
General
|
3 |
============================================*/
|
4 |
.cdp-cookies-alerta {
|
|
|
5 |
width: 100%;
|
6 |
color:#bbbbbb;
|
7 |
background-color: #444444;
|
@@ -10,7 +11,7 @@
|
|
10 |
.cdp-cookies-alerta .cdp-cookies-texto {
|
11 |
max-width: 960px;
|
12 |
margin: 0 auto;
|
13 |
-
padding:
|
14 |
}
|
15 |
.cdp-cookies-alerta .cdp-cookies-texto h4 {
|
16 |
text-align: center;
|
@@ -210,7 +211,7 @@
|
|
210 |
line-height: 14px;
|
211 |
display: block;
|
212 |
width: 75px;
|
213 |
-
margin: 5px auto;
|
214 |
text-decoration: none;
|
215 |
border: none;
|
216 |
text-shadow: 1px 1px 2px #000;
|
2 |
General
|
3 |
============================================*/
|
4 |
.cdp-cookies-alerta {
|
5 |
+
display:none;
|
6 |
width: 100%;
|
7 |
color:#bbbbbb;
|
8 |
background-color: #444444;
|
11 |
.cdp-cookies-alerta .cdp-cookies-texto {
|
12 |
max-width: 960px;
|
13 |
margin: 0 auto;
|
14 |
+
padding: 20px 10px 20px 10px;
|
15 |
}
|
16 |
.cdp-cookies-alerta .cdp-cookies-texto h4 {
|
17 |
text-align: center;
|
211 |
line-height: 14px;
|
212 |
display: block;
|
213 |
width: 75px;
|
214 |
+
margin: 5px auto 0 auto;
|
215 |
text-decoration: none;
|
216 |
border: none;
|
217 |
text-shadow: 1px 1px 2px #000;
|
html/front/lib.js
DELETED
@@ -1,119 +0,0 @@
|
|
1 |
-
|
2 |
-
/* ======================================================================================
|
3 |
-
@author Carlos Doral Pérez (http://webartesanal.com)
|
4 |
-
@version 0.14
|
5 |
-
@copyright Copyright © 2013-2014 Carlos Doral Pérez, All Rights Reserved
|
6 |
-
License: GPLv2 or later
|
7 |
-
====================================================================================== */
|
8 |
-
|
9 |
-
//
|
10 |
-
//
|
11 |
-
//
|
12 |
-
var cdp_cookie = {
|
13 |
-
|
14 |
-
// vars
|
15 |
-
_id_cookie: 'cdp-cookies-plugin-wp',
|
16 |
-
|
17 |
-
//
|
18 |
-
// Compruebo si ya existe la cookie si es visitante nuevo.
|
19 |
-
//
|
20 |
-
// Modif: 08-ene-2014. Compruebo primero si existe la cookie antes del contenido de la misma
|
21 |
-
//
|
22 |
-
ya_existe_cookie: function _ya_existe_cookie() {
|
23 |
-
if( jQuery.cookie( cdp_cookie._id_cookie ) != null )
|
24 |
-
return jQuery.cookie( cdp_cookie._id_cookie ) == 'cdp';
|
25 |
-
return false;
|
26 |
-
},
|
27 |
-
|
28 |
-
// Guardo cookie
|
29 |
-
poner_cookie: function _poner_cookie() {
|
30 |
-
return jQuery.cookie( cdp_cookie._id_cookie, 'cdp', { expires: 365, path: '/' } );
|
31 |
-
},
|
32 |
-
|
33 |
-
// Elimino cookie
|
34 |
-
eliminar: function _eliminar() {
|
35 |
-
return jQuery.removeCookie( cdp_cookie._id_cookie );
|
36 |
-
},
|
37 |
-
|
38 |
-
// Traigo aviso y lo inserto en el DOM
|
39 |
-
// Actualizado: ya no pasa por el admin
|
40 |
-
mostrar_aviso: function _mostrar_aviso() {
|
41 |
-
jQuery.post(
|
42 |
-
cdp_cookies_info.url_traer_aviso_php,
|
43 |
-
{
|
44 |
-
action: 'traer_aviso'
|
45 |
-
},
|
46 |
-
function( resul ) {
|
47 |
-
if( resul.layout == 'pagina' && resul.posicion == 'inferior' )
|
48 |
-
jQuery( 'body' ).append( resul.html );
|
49 |
-
else
|
50 |
-
jQuery( 'body' ).prepend( resul.html );
|
51 |
-
if( resul.layout == 'ventana' )
|
52 |
-
jQuery( '.cdp-cookies-alerta' ).fadeIn( 500 );
|
53 |
-
if( jQuery( '.cdp-cookies-boton-cerrar' ).length > 0 )
|
54 |
-
jQuery( '.cdp-cookies-boton-cerrar' ).click( function() {
|
55 |
-
cdp_cookie.poner_cookie();
|
56 |
-
cdp_cookie.ocultar_aviso();
|
57 |
-
} );
|
58 |
-
},
|
59 |
-
'json'
|
60 |
-
);
|
61 |
-
},
|
62 |
-
|
63 |
-
//
|
64 |
-
comportamiento: function _comportamiento() {
|
65 |
-
return cdp_cookies_info.comportamiento;
|
66 |
-
},
|
67 |
-
|
68 |
-
//
|
69 |
-
ocultar_aviso: function _ocultar_aviso() {
|
70 |
-
if( jQuery( '.cdp-cookies-alerta' ).length > 0 )
|
71 |
-
jQuery( '.cdp-cookies-alerta' ).fadeOut( 500 );
|
72 |
-
},
|
73 |
-
|
74 |
-
// Preparo la query string
|
75 |
-
variables_get: function _variables_get() {
|
76 |
-
var url = window.location.href;
|
77 |
-
var pares = url.slice( url.indexOf( '?' ) + 1 ).split( '&' );
|
78 |
-
var query = {};
|
79 |
-
for ( var i = 0 ; i < pares.length ; i++ ) {
|
80 |
-
var par = pares[i].split( '=' );
|
81 |
-
if( par.length == 1 )
|
82 |
-
query[par[0]] = null;
|
83 |
-
else
|
84 |
-
if( par.length == 2 )
|
85 |
-
query[par[0]] = par[1];
|
86 |
-
}
|
87 |
-
return query;
|
88 |
-
},
|
89 |
-
|
90 |
-
// Indica si hay vista previa
|
91 |
-
hay_vista_previa: function _hay_vista_previa() {
|
92 |
-
return window.location.href.indexOf( '?cdp_cookies_vista_previa=1' ) >= 0;
|
93 |
-
},
|
94 |
-
|
95 |
-
// Traigo aviso en vista previa
|
96 |
-
// Ya no pasa por el admin
|
97 |
-
mostrar_aviso_vista_previa: function _mostrar_aviso_vista_previa() {
|
98 |
-
//
|
99 |
-
var datos = cdp_cookie.variables_get();
|
100 |
-
datos.action = 'traer_aviso';
|
101 |
-
|
102 |
-
//
|
103 |
-
jQuery.post(
|
104 |
-
cdp_cookies_info.url_traer_aviso_php,
|
105 |
-
datos,
|
106 |
-
function( resul ) {
|
107 |
-
if( !resul || !resul.html || resul.html == 0 )
|
108 |
-
return;
|
109 |
-
if( resul.layout == 'pagina' && resul.posicion == 'inferior' )
|
110 |
-
jQuery( 'body' ).append( resul.html );
|
111 |
-
else
|
112 |
-
jQuery( 'body' ).prepend( resul.html );
|
113 |
-
if( resul.layout == 'ventana' )
|
114 |
-
jQuery( '.cdp-cookies-alerta' ).fadeIn( 1000 );
|
115 |
-
},
|
116 |
-
'json'
|
117 |
-
);
|
118 |
-
},
|
119 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
html/front/principal.js
CHANGED
@@ -1,10 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/* ======================================================================================
|
2 |
@author Carlos Doral Pérez (http://webartesanal.com)
|
3 |
-
@version 0.
|
4 |
@copyright Copyright © 2013-2014 Carlos Doral Pérez, All Rights Reserved
|
5 |
License: GPLv2 or later
|
6 |
====================================================================================== */
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
//
|
9 |
//
|
10 |
//
|
1 |
+
/*!
|
2 |
+
* jQuery Cookie Plugin v1.3.1
|
3 |
+
* https://github.com/carhartl/jquery-cookie
|
4 |
+
*
|
5 |
+
* Copyright 2013 Klaus Hartl
|
6 |
+
* Released under the MIT license
|
7 |
+
*/
|
8 |
+
(function (factory) {
|
9 |
+
if (typeof define === 'function' && define.amd) {
|
10 |
+
// AMD. Register as anonymous module.
|
11 |
+
define(['jquery'], factory);
|
12 |
+
} else {
|
13 |
+
// Browser globals.
|
14 |
+
factory(jQuery);
|
15 |
+
}
|
16 |
+
}(function ($) {
|
17 |
+
|
18 |
+
var pluses = /\+/g;
|
19 |
+
|
20 |
+
function decode(s) {
|
21 |
+
if (config.raw) {
|
22 |
+
return s;
|
23 |
+
}
|
24 |
+
try {
|
25 |
+
// If we can't decode the cookie, ignore it, it's unusable.
|
26 |
+
return decodeURIComponent(s.replace(pluses, ' '));
|
27 |
+
} catch(e) {}
|
28 |
+
}
|
29 |
+
|
30 |
+
function decodeAndParse(s) {
|
31 |
+
if (s.indexOf('"') === 0) {
|
32 |
+
// This is a quoted cookie as according to RFC2068, unescape...
|
33 |
+
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
34 |
+
}
|
35 |
+
|
36 |
+
s = decode(s);
|
37 |
+
|
38 |
+
try {
|
39 |
+
// If we can't parse the cookie, ignore it, it's unusable.
|
40 |
+
return config.json ? JSON.parse(s) : s;
|
41 |
+
} catch(e) {}
|
42 |
+
}
|
43 |
+
|
44 |
+
var config = $.cookie = function (key, value, options) {
|
45 |
+
|
46 |
+
// Write
|
47 |
+
if (value !== undefined) {
|
48 |
+
options = $.extend({}, config.defaults, options);
|
49 |
+
|
50 |
+
if (typeof options.expires === 'number') {
|
51 |
+
var days = options.expires, t = options.expires = new Date();
|
52 |
+
t.setDate(t.getDate() + days);
|
53 |
+
}
|
54 |
+
|
55 |
+
value = config.json ? JSON.stringify(value) : String(value);
|
56 |
+
|
57 |
+
return (document.cookie = [
|
58 |
+
config.raw ? key : encodeURIComponent(key),
|
59 |
+
'=',
|
60 |
+
config.raw ? value : encodeURIComponent(value),
|
61 |
+
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
62 |
+
options.path ? '; path=' + options.path : '',
|
63 |
+
options.domain ? '; domain=' + options.domain : '',
|
64 |
+
options.secure ? '; secure' : ''
|
65 |
+
].join(''));
|
66 |
+
}
|
67 |
+
|
68 |
+
// Read
|
69 |
+
|
70 |
+
var result = key ? undefined : {};
|
71 |
+
|
72 |
+
// To prevent the for loop in the first place assign an empty array
|
73 |
+
// in case there are no cookies at all. Also prevents odd result when
|
74 |
+
// calling $.cookie().
|
75 |
+
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
76 |
+
|
77 |
+
for (var i = 0, l = cookies.length; i < l; i++) {
|
78 |
+
var parts = cookies[i].split('=');
|
79 |
+
var name = decode(parts.shift());
|
80 |
+
var cookie = parts.join('=');
|
81 |
+
|
82 |
+
if (key && key === name) {
|
83 |
+
result = decodeAndParse(cookie);
|
84 |
+
break;
|
85 |
+
}
|
86 |
+
|
87 |
+
// Prevent storing a cookie that we couldn't decode.
|
88 |
+
if (!key && (cookie = decodeAndParse(cookie)) !== undefined) {
|
89 |
+
result[name] = cookie;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
return result;
|
94 |
+
};
|
95 |
+
|
96 |
+
config.defaults = {};
|
97 |
+
|
98 |
+
$.removeCookie = function (key, options) {
|
99 |
+
if ($.cookie(key) !== undefined) {
|
100 |
+
// Must not alter options, thus extending a fresh object...
|
101 |
+
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
102 |
+
return true;
|
103 |
+
}
|
104 |
+
return false;
|
105 |
+
};
|
106 |
+
|
107 |
+
}));
|
108 |
+
|
109 |
/* ======================================================================================
|
110 |
@author Carlos Doral Pérez (http://webartesanal.com)
|
111 |
+
@version 0.19
|
112 |
@copyright Copyright © 2013-2014 Carlos Doral Pérez, All Rights Reserved
|
113 |
License: GPLv2 or later
|
114 |
====================================================================================== */
|
115 |
|
116 |
+
//
|
117 |
+
//
|
118 |
+
//
|
119 |
+
var cdp_cookie = {
|
120 |
+
|
121 |
+
// vars
|
122 |
+
_id_cookie: 'cdp-cookies-plugin-wp',
|
123 |
+
|
124 |
+
//
|
125 |
+
// Compruebo si ya existe la cookie si es visitante nuevo.
|
126 |
+
//
|
127 |
+
// Modif: 08-ene-2014. Compruebo primero si existe la cookie antes del contenido de la misma
|
128 |
+
//
|
129 |
+
ya_existe_cookie: function _ya_existe_cookie() {
|
130 |
+
if( jQuery.cookie( cdp_cookie._id_cookie ) != null )
|
131 |
+
return jQuery.cookie( cdp_cookie._id_cookie ) == 'cdp';
|
132 |
+
return false;
|
133 |
+
},
|
134 |
+
|
135 |
+
// Guardo cookie
|
136 |
+
poner_cookie: function _poner_cookie() {
|
137 |
+
return jQuery.cookie( cdp_cookie._id_cookie, 'cdp', { expires: 365, path: '/' } );
|
138 |
+
},
|
139 |
+
|
140 |
+
// Eliminar cookie
|
141 |
+
eliminar: function _eliminar() {
|
142 |
+
return jQuery.removeCookie( cdp_cookie._id_cookie );
|
143 |
+
},
|
144 |
+
|
145 |
+
// Muestra aviso
|
146 |
+
mostrar_aviso: function _mostrar_aviso() {
|
147 |
+
if( cdp_cookies_info.layout == 'pagina' && cdp_cookies_info.posicion == 'superior' )
|
148 |
+
{
|
149 |
+
var aviso = jQuery( '.cdp-cookies-alerta' ).wrap( '<div>' ).parent().html();
|
150 |
+
jQuery( '.cdp-cookies-alerta' ).parent().detach();
|
151 |
+
jQuery( 'body' ).prepend( aviso );
|
152 |
+
}
|
153 |
+
if( jQuery( '.cdp-cookies-boton-cerrar' ).length > 0 )
|
154 |
+
jQuery( '.cdp-cookies-boton-cerrar' ).click( function() {
|
155 |
+
cdp_cookie.poner_cookie();
|
156 |
+
jQuery( '.cdp-cookies-alerta' ).hide();
|
157 |
+
} );
|
158 |
+
jQuery( '.cdp-cookies-alerta' ).show();
|
159 |
+
},
|
160 |
+
|
161 |
+
//
|
162 |
+
comportamiento: function _comportamiento() {
|
163 |
+
return cdp_cookies_info.comportamiento;
|
164 |
+
},
|
165 |
+
|
166 |
+
// Preparo la query string
|
167 |
+
variables_get: function _variables_get() {
|
168 |
+
var url = window.location.href;
|
169 |
+
var pares = url.slice( url.indexOf( '?' ) + 1 ).split( '&' );
|
170 |
+
var query = {};
|
171 |
+
for ( var i = 0 ; i < pares.length ; i++ ) {
|
172 |
+
var par = pares[i].split( '=' );
|
173 |
+
if( par.length == 1 )
|
174 |
+
query[par[0]] = null;
|
175 |
+
else
|
176 |
+
if( par.length == 2 )
|
177 |
+
query[par[0]] = par[1];
|
178 |
+
}
|
179 |
+
return query;
|
180 |
+
},
|
181 |
+
|
182 |
+
// Indica si hay vista previa
|
183 |
+
hay_vista_previa: function _hay_vista_previa() {
|
184 |
+
return window.location.href.indexOf( '?cdp_cookies_vista_previa=1' ) >= 0;
|
185 |
+
},
|
186 |
+
|
187 |
+
// Traigo aviso en vista previa
|
188 |
+
mostrar_aviso_vista_previa: function _mostrar_aviso_vista_previa() {
|
189 |
+
cdp_cookie.mostrar_aviso();
|
190 |
+
},
|
191 |
+
};
|
192 |
+
|
193 |
//
|
194 |
//
|
195 |
//
|
lib/plugin.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/* ======================================================================================
|
4 |
@author Carlos Doral Pérez (http://webartesanal.com)
|
5 |
-
@version 0.
|
6 |
@copyright Copyright © 2013-2014 Carlos Doral Pérez, All Rights Reserved
|
7 |
License: GPLv2 or later
|
8 |
====================================================================================== */
|
@@ -12,6 +12,11 @@
|
|
12 |
*/
|
13 |
class cdp_cookies
|
14 |
{
|
|
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
*
|
17 |
*/
|
@@ -23,19 +28,12 @@ class cdp_cookies
|
|
23 |
if( !( function_exists( 'add_action' ) && defined( 'ABSPATH' ) ) )
|
24 |
throw new cdp_cookies_error( 'Este plugin no puede ser llamado directamente' );
|
25 |
|
26 |
-
//
|
27 |
-
// Registro eventos front y comunes
|
28 |
-
//
|
29 |
-
add_action( 'wp_ajax_traer_aviso', array( __CLASS__, 'ajax_traer_aviso' ) );
|
30 |
-
add_action( 'wp_ajax_nopriv_traer_aviso', array( __CLASS__, 'ajax_traer_aviso' ) );
|
31 |
-
add_action( 'wp_ajax_traer_aviso_get', array( __CLASS__, 'ajax_traer_aviso_get' ) );
|
32 |
-
add_action( 'wp_ajax_nopriv_traer_aviso_get', array( __CLASS__, 'ajax_traer_aviso_get' ) );
|
33 |
-
|
34 |
//
|
35 |
// Ejecutando Admin
|
36 |
//
|
37 |
if( is_admin() )
|
38 |
{
|
|
|
39 |
add_action( 'admin_menu', array( __CLASS__, 'crear_menu_admin' ) );
|
40 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'cargar_archivos_admin' ) );
|
41 |
add_action( 'wp_ajax_guardar_config', array( __CLASS__, 'ajax_guardar_config' ) );
|
@@ -47,35 +45,13 @@ class cdp_cookies
|
|
47 |
// Ejecutando front
|
48 |
//
|
49 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'cargar_archivos_front' ) );
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
*
|
54 |
-
*/
|
55 |
-
static function cargar_archivos_front()
|
56 |
-
{
|
57 |
-
wp_enqueue_style( 'front-estilos', CDP_COOKIES_URL_HTML . 'front/estilos.css', false );
|
58 |
-
wp_enqueue_script( 'front-cookie', CDP_COOKIES_URL_HTML . 'front/_jquery.kookie.js', array( 'jquery' ) );
|
59 |
-
wp_enqueue_script( 'front-lib', CDP_COOKIES_URL_HTML . 'front/lib.js', array( 'jquery' ) );
|
60 |
-
wp_enqueue_script( 'front-principal', CDP_COOKIES_URL_HTML . 'front/principal.js', array( 'jquery' ) );
|
61 |
-
wp_localize_script
|
62 |
-
(
|
63 |
-
'front-principal',
|
64 |
-
'cdp_cookies_info',
|
65 |
-
array
|
66 |
-
(
|
67 |
-
'url_plugin' => CDP_COOKIES_URL_RAIZ . 'plugin.php',
|
68 |
-
'url_admin_ajax' => admin_url() . 'admin-ajax.php',
|
69 |
-
'url_traer_aviso_php' => CDP_COOKIES_TRAER_AVISO_PHP_URL,
|
70 |
-
'comportamiento' => self::parametro( 'comportamiento' )
|
71 |
-
)
|
72 |
-
);
|
73 |
}
|
74 |
|
75 |
/**
|
76 |
*
|
77 |
*/
|
78 |
-
static function
|
79 |
{
|
80 |
//
|
81 |
// Posicionamiento en ventana o página
|
@@ -98,7 +74,7 @@ class cdp_cookies
|
|
98 |
$class .= ' cdp-cookies-textos-izq';
|
99 |
|
100 |
//
|
101 |
-
//
|
102 |
//
|
103 |
$class .= ' cdp-cookies-tema-' . self::parametro( 'tema' );
|
104 |
|
@@ -126,25 +102,62 @@ class cdp_cookies
|
|
126 |
//
|
127 |
$boton = '';
|
128 |
if( self::parametro( 'comportamiento' ) == 'cerrar' )
|
129 |
-
$boton = '<a href="
|
130 |
if( self::parametro( 'comportamiento' ) == 'aceptar' )
|
131 |
-
$boton = '<a href="
|
132 |
$html = str_replace( '{boton_cerrar}', $boton, $html );
|
133 |
|
134 |
//
|
135 |
-
echo
|
136 |
-
json_encode
|
137 |
-
(
|
138 |
-
array
|
139 |
-
(
|
140 |
-
'html' => $html,
|
141 |
-
'posicion' => self::parametro( 'posicion' ),
|
142 |
-
'layout' => self::parametro( 'layout' )
|
143 |
-
)
|
144 |
-
);
|
145 |
-
exit;
|
146 |
}
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
/**
|
149 |
*
|
150 |
*/
|
@@ -275,8 +288,8 @@ class cdp_cookies
|
|
275 |
if( $valor === null )
|
276 |
{
|
277 |
// Hago una excepción si estoy mostrando el aviso en vista previa
|
278 |
-
if( cdp_cookies_input::
|
279 |
-
if( ( $v = cdp_cookies_input::
|
280 |
{
|
281 |
// Antes de devolver el valor me aseguro que soy el usuario administrador
|
282 |
try
|
@@ -360,10 +373,6 @@ class cdp_cookies
|
|
360 |
}
|
361 |
}
|
362 |
|
363 |
-
/**
|
364 |
-
*
|
365 |
-
*/
|
366 |
-
|
367 |
/**
|
368 |
*
|
369 |
*/
|
2 |
|
3 |
/* ======================================================================================
|
4 |
@author Carlos Doral Pérez (http://webartesanal.com)
|
5 |
+
@version 0.19
|
6 |
@copyright Copyright © 2013-2014 Carlos Doral Pérez, All Rights Reserved
|
7 |
License: GPLv2 or later
|
8 |
====================================================================================== */
|
12 |
*/
|
13 |
class cdp_cookies
|
14 |
{
|
15 |
+
//
|
16 |
+
// Para añadir una sóla vez los enlaces en la página de plugins
|
17 |
+
//
|
18 |
+
static private $nombre_plugin;
|
19 |
+
|
20 |
/**
|
21 |
*
|
22 |
*/
|
28 |
if( !( function_exists( 'add_action' ) && defined( 'ABSPATH' ) ) )
|
29 |
throw new cdp_cookies_error( 'Este plugin no puede ser llamado directamente' );
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
//
|
32 |
// Ejecutando Admin
|
33 |
//
|
34 |
if( is_admin() )
|
35 |
{
|
36 |
+
add_filter( 'plugin_action_links', array( __CLASS__, 'enlaces_pagina_plugins' ), 10, 2 );
|
37 |
add_action( 'admin_menu', array( __CLASS__, 'crear_menu_admin' ) );
|
38 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'cargar_archivos_admin' ) );
|
39 |
add_action( 'wp_ajax_guardar_config', array( __CLASS__, 'ajax_guardar_config' ) );
|
45 |
// Ejecutando front
|
46 |
//
|
47 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'cargar_archivos_front' ) );
|
48 |
+
add_action( 'wp_footer', array( __CLASS__, 'renderizar_aviso' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
*
|
53 |
*/
|
54 |
+
static function renderizar_aviso()
|
55 |
{
|
56 |
//
|
57 |
// Posicionamiento en ventana o página
|
74 |
$class .= ' cdp-cookies-textos-izq';
|
75 |
|
76 |
//
|
77 |
+
// Esquema de color
|
78 |
//
|
79 |
$class .= ' cdp-cookies-tema-' . self::parametro( 'tema' );
|
80 |
|
102 |
//
|
103 |
$boton = '';
|
104 |
if( self::parametro( 'comportamiento' ) == 'cerrar' )
|
105 |
+
$boton = '<a href="javascript:;" class="cdp-cookies-boton-cerrar">CERRAR</a>';
|
106 |
if( self::parametro( 'comportamiento' ) == 'aceptar' )
|
107 |
+
$boton = '<a href="javascript:;" class="cdp-cookies-boton-cerrar">ACEPTAR</a>';
|
108 |
$html = str_replace( '{boton_cerrar}', $boton, $html );
|
109 |
|
110 |
//
|
111 |
+
echo $html;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
*
|
116 |
+
*/
|
117 |
+
static function enlaces_pagina_plugins( $enlaces, $archivo )
|
118 |
+
{
|
119 |
+
//
|
120 |
+
// Sólo añado enlaces a mi plugin
|
121 |
+
//
|
122 |
+
if( !self::$nombre_plugin )
|
123 |
+
self::$nombre_plugin = plugin_basename( CDP_COOKIES_DIR_RAIZ . '/plugin.php' );
|
124 |
+
if( $archivo != self::$nombre_plugin )
|
125 |
+
return;
|
126 |
+
|
127 |
+
//
|
128 |
+
// Procedo
|
129 |
+
//
|
130 |
+
$enlace = array(
|
131 |
+
sprintf(
|
132 |
+
"<a href=\"%s\">%s</a>",
|
133 |
+
admin_url( 'tools.php?page=cdp_cookies' ),
|
134 |
+
__( 'Configuración' )
|
135 |
+
) );
|
136 |
+
return array_merge( $enlace, $enlaces );
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
*
|
141 |
+
*/
|
142 |
+
static function cargar_archivos_front()
|
143 |
+
{
|
144 |
+
wp_enqueue_style( 'front-estilos', CDP_COOKIES_URL_HTML . 'front/estilos.css', false );
|
145 |
+
wp_enqueue_script( 'front-principal', CDP_COOKIES_URL_HTML . 'front/principal.js', array( 'jquery' ) );
|
146 |
+
wp_localize_script
|
147 |
+
(
|
148 |
+
'front-principal',
|
149 |
+
'cdp_cookies_info',
|
150 |
+
array
|
151 |
+
(
|
152 |
+
'url_plugin' => CDP_COOKIES_URL_RAIZ . 'plugin.php',
|
153 |
+
'url_admin_ajax' => admin_url() . 'admin-ajax.php',
|
154 |
+
'comportamiento' => self::parametro( 'comportamiento' ),
|
155 |
+
'posicion' => self::parametro( 'posicion' ),
|
156 |
+
'layout' => self::parametro( 'layout' )
|
157 |
+
)
|
158 |
+
);
|
159 |
+
}
|
160 |
+
|
161 |
/**
|
162 |
*
|
163 |
*/
|
288 |
if( $valor === null )
|
289 |
{
|
290 |
// Hago una excepción si estoy mostrando el aviso en vista previa
|
291 |
+
if( cdp_cookies_input::get( 'cdp_cookies_vista_previa' ) )
|
292 |
+
if( ( $v = cdp_cookies_input::get( $nombre ) ) )
|
293 |
{
|
294 |
// Antes de devolver el valor me aseguro que soy el usuario administrador
|
295 |
try
|
373 |
}
|
374 |
}
|
375 |
|
|
|
|
|
|
|
|
|
376 |
/**
|
377 |
*
|
378 |
*/
|
plugin.php
CHANGED
@@ -4,13 +4,13 @@
|
|
4 |
Plugin Name: Asesor de Cookies
|
5 |
Plugin URI: http://webartesanal.com
|
6 |
Description: Este plugin avisa a los nuevos visitantes de su web sobre la utilización de cookies en su página y le proporciona los textos iniciales para que pueda crear una política de cookies correcta.
|
7 |
-
Version: 0.
|
8 |
Author: Carlos Doral Pérez
|
9 |
Author URI: http://webartesanal.com
|
10 |
License: GPLv2 or later
|
11 |
*/
|
12 |
|
13 |
-
/* Copyright 2013-
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
4 |
Plugin Name: Asesor de Cookies
|
5 |
Plugin URI: http://webartesanal.com
|
6 |
Description: Este plugin avisa a los nuevos visitantes de su web sobre la utilización de cookies en su página y le proporciona los textos iniciales para que pueda crear una política de cookies correcta.
|
7 |
+
Version: 0.19
|
8 |
Author: Carlos Doral Pérez
|
9 |
Author URI: http://webartesanal.com
|
10 |
License: GPLv2 or later
|
11 |
*/
|
12 |
|
13 |
+
/* Copyright 2013-2015 Carlos Doral Pérez
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Carlos Doral Pérez (<a href="http:://webartesanal.com">webartesan
|
|
3 |
Tags: cookie, cookies, spain, ley, law, politica, policy, españa, normativa
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 3.8.1
|
6 |
-
Stable tag: 0.
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Este plugin le va a facilitar la confección de la política de cookies para su sitio web proporcionándole los textos legales y técnicos iniciales.
|
@@ -43,6 +43,14 @@ Si lo desea, como método alternativo de instalación puede ir a la sección Plu
|
|
43 |
|
44 |
== Changelog ==
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
= 0.18 =
|
47 |
* En algunas instalaciones se producian definiciones duplicadas en traer_aviso.php. Gracias a Mikel Gutierrez por su soporte.
|
48 |
* Se renuevan banners.
|
3 |
Tags: cookie, cookies, spain, ley, law, politica, policy, españa, normativa
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 3.8.1
|
6 |
+
Stable tag: 0.19
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Este plugin le va a facilitar la confección de la política de cookies para su sitio web proporcionándole los textos legales y técnicos iniciales.
|
43 |
|
44 |
== Changelog ==
|
45 |
|
46 |
+
= 0.19 =
|
47 |
+
* Se añade botón Configuración en la página de plugins para acceder directamente a la configuración del Asesor de Cookies.
|
48 |
+
* Se elimina una petición ajax al servidor por generar problemas en algunas instalaciones WP.
|
49 |
+
* Se combinan los 3 archivos JS en uno sólo para mejorar el rendimiento.
|
50 |
+
* Se arregla la previsualización que no funcionaba correctamente.
|
51 |
+
* Se resuelve problema cuando hay dos instalaciones WP en el mismo dominio y anidadas. Gracias Mikel!
|
52 |
+
* Detalles CSS
|
53 |
+
|
54 |
= 0.18 =
|
55 |
* En algunas instalaciones se producian definiciones duplicadas en traer_aviso.php. Gracias a Mikel Gutierrez por su soporte.
|
56 |
* Se renuevan banners.
|
traer_aviso.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
Copyright 2013-2014 Carlos Doral Pérez
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License
|
17 |
-
along with this program; if not, write to the Free Software
|
18 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 |
-
|
20 |
-
version 0.18
|
21 |
-
|
22 |
-
He eliminado la inclusión de los archivos lib/*.php porque ya están presentes
|
23 |
-
en el include WP.
|
24 |
-
*/
|
25 |
-
|
26 |
-
// Configuración y definiciones
|
27 |
-
require_once dirname( __FILE__ ) . '/external-wp.php';
|
28 |
-
|
29 |
-
// Lógica del plugin
|
30 |
-
try
|
31 |
-
{
|
32 |
-
cdp_cookies::ajax_traer_aviso(); ;
|
33 |
-
}
|
34 |
-
catch( cdp_cookies_error $e )
|
35 |
-
{
|
36 |
-
}
|
37 |
-
exit;
|
38 |
-
|
39 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|