diff --git a/EUCookieLaw-admin.js b/EUCookieLaw-admin.js old mode 100644 new mode 100755 index 2959c5f..db7cee0 --- a/EUCookieLaw-admin.js +++ b/EUCookieLaw-admin.js @@ -1,7 +1,7 @@ /** * EUCookieLaw: simple object to accomplish european law requirements about cookie transmission to clients * @class EUCookieLaw - * @version 2.4.0 + * @version 2.5.0 * @link https://github.com/diegolamonica/EUCookieLaw/ * @author Diego La Monica (diegolamonica) * @copyright 2015 Diego La Monica @@ -102,7 +102,8 @@ '.add', /* The add action selector */ '.remove', /* The remove action selector */ function(action) { - console.log(action, $('input[name="blocked_domains[]"]:first').blur() ); + console.log(action); + $('input[name="blocked_domains[]"]:first').blur(); } ); diff --git a/EUCookieLaw-tinymce.js b/EUCookieLaw-tinymce.js old mode 100644 new mode 100755 diff --git a/EUCookieLaw.js b/EUCookieLaw.js old mode 100644 new mode 100755 index 566060a..3e3ea2d --- a/EUCookieLaw.js +++ b/EUCookieLaw.js @@ -1,7 +1,7 @@ /** * EUCookieLaw: simple object to accomplish european law requirements about cookie transmission to clients * @class EUCookieLaw - * @version 2.4.0 + * @version 2.5.0 * @link https://github.com/diegolamonica/EUCookieLaw/ * @author Diego La Monica (diegolamonica) * @copyright 2015 Diego La Monica @@ -116,6 +116,7 @@ var EUCookieLaw = (function (doc) { minScroll: 100, remember: false, path: '/', + domain: window.location.host, cookieList: [], blacklist: [], showAgreement: function () { @@ -210,7 +211,7 @@ var EUCookieLaw = (function (doc) { var writeInternalCookie = function( value, expires ){ expires = (expires === undefined) ? '' : (';expires=' + expires); doc.cookie = "__eucookielaw=" + value - + ";domain=" + window.location.host + + (settings.domain?(";domain=" + settings.domain):'') + ";path=" + settings.path + expires; } @@ -248,7 +249,7 @@ var EUCookieLaw = (function (doc) { } } - if(settings.reload) window.location.reload(); + if(settings.reload) window.location.reload(true); }; this.reject = function () { diff --git a/EUCookieLawCustom/EUCookieLawCustom-it_IT.mo b/EUCookieLawCustom/EUCookieLawCustom-it_IT.mo old mode 100644 new mode 100755 diff --git a/EUCookieLawCustom/EUCookieLawCustom-it_IT.po b/EUCookieLawCustom/EUCookieLawCustom-it_IT.po old mode 100644 new mode 100755 diff --git a/EUCookieLawCustom/blocked/default.html b/EUCookieLawCustom/blocked/default.html old mode 100644 new mode 100755 diff --git a/EUCookieLawCustom/blocked/default.js b/EUCookieLawCustom/blocked/default.js old mode 100644 new mode 100755 diff --git a/EUCookieLawCustom/blocked/empty.js b/EUCookieLawCustom/blocked/empty.js old mode 100644 new mode 100755 diff --git a/EUCookieLawCustom/default.po b/EUCookieLawCustom/default.po old mode 100644 new mode 100755 diff --git a/EUCookieLawCustom/eucookielaw.css b/EUCookieLawCustom/eucookielaw.css old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/blocked/default.html b/blocked/default.html old mode 100644 new mode 100755 diff --git a/blocked/default.js b/blocked/default.js old mode 100644 new mode 100755 diff --git a/blocked/empty.js b/blocked/empty.js old mode 100644 new mode 100755 diff --git a/cookie.png b/cookie.png old mode 100644 new mode 100755 diff --git a/editor.php b/editor.php old mode 100644 new mode 100755 diff --git a/eucookielaw-cache.php b/eucookielaw-cache.php old mode 100644 new mode 100755 index 21a9bac..59683ca --- a/eucookielaw-cache.php +++ b/eucookielaw-cache.php @@ -1,7 +1,7 @@ * @copyright 2015 Diego La Monica @@ -17,7 +17,7 @@ global $euc_iniFile; - if ( ! defined( 'EUCL_CONTENT_DIR' ) ) define('WP_CONTENT_DIR', ABSPATH . '/wp-content'); + if ( ! defined( 'EUCL_CONTENT_DIR' ) ) define('EUCL_CONTENT_DIR', ABSPATH . '/wp-content'); if ( is_dir( EUCL_CONTENT_DIR . '/plugins/nextgen-gallery' ) && ( strpos( strtolower( $_SERVER['REQUEST_URI'] ), 'nextgen-attach_to_post' ) !== false ) @@ -104,7 +104,7 @@ function EUCgetOption( $key, $defaultValue = false ) { ! defined( 'EUCOOKIELAW_BANNER_AGREE_LINK' ) && define( 'EUCOOKIELAW_BANNER_AGREE_LINK', $agreeLink ); ! defined( 'EUCOOKIELAW_BANNER_DISAGREE_LINK' ) && define( 'EUCOOKIELAW_BANNER_DISAGREE_LINK', $disagreeLink ); - ! defined( 'EUCOOKIELAW_DEBUG' ) && define( 'EUCOOKIELAW_DEBUG', ( $debug == 'y' ) ); + ! defined( 'EUCOOKIELAW_DEBUG' ) && define( 'EUCOOKIELAW_DEBUG', ( $debug !== 'n' ) ); ! defined( 'EUCOOKIELAW_DISABLED' ) && define( 'EUCOOKIELAW_DISABLED', $enabled !== 'y' ); ! defined( 'EUCOOKIELAW_ALLOWED_COOKIES' ) && define( 'EUCOOKIELAW_ALLOWED_COOKIES', $whitelstCookies ); diff --git a/eucookielaw-header.php b/eucookielaw-header.php old mode 100644 new mode 100755 index 4d688c0..536f5f7 --- a/eucookielaw-header.php +++ b/eucookielaw-header.php @@ -298,7 +298,8 @@ private function hasDisallowedURL($url){ $domainToScan = preg_quote( $disallowedDomain, "#" ); } - if ( preg_match( '#\/\/' . $domainToScan . '#', $url ) ) { + $pregString ='#\/\/' . $domainToScan . '#'; + if ( preg_match( $pregString, $url ) ) { return true; } @@ -320,13 +321,14 @@ private function useDOM( $buffer, $tags, $specialAttriutes, $inScripts ){ $this->log( "Buffer size is: " . strlen($buffer)); foreach($tags as $tag) { + $attribute = isset($specialAttriutes[$tag]) ? $specialAttriutes[$tag] : $specialAttriutes['*']; $elements = $doc->getElementsByTagName($tag); - $this->log("Found " . $elements->length . ' as ' . $tag); + $this->log("Found " . $elements->length . ' with query selector ' . $tag.'[' . $attribute . ']'); foreach($elements as $element){ - $attribute = isset($specialAttriutes[$tag]) ? $specialAttriutes[$tag] : $specialAttriutes['*']; - $url = $element->getAttribute($attribute); - $this->log("Checking $url"); + # $attribute = isset($specialAttriutes[$tag]) ? $specialAttriutes[$tag] : $specialAttriutes['*']; + $url = $element->hasAttribute($attribute) ? $element->getAttribute($attribute) : null; + if(!is_null($url) ) $this->log("Checking $url"); if(!empty($url) && $this->hasDisallowedURL($url)){ $this->log(">>> Found $url <<<"); $newURL = $this->getDefaultSourceByType($tag); diff --git a/eucookielaw-tinymce.css b/eucookielaw-tinymce.css old mode 100644 new mode 100755 diff --git a/eucookielaw-wp.php b/eucookielaw-wp.php old mode 100644 new mode 100755 index e3f6425..b1bba20 --- a/eucookielaw-wp.php +++ b/eucookielaw-wp.php @@ -1,7 +1,7 @@ * @copyright 2015 Diego La Monica @@ -18,7 +18,7 @@ const TEXTDOMAIN = 'EUCookieLaw'; const CUSTOMDOMAIN = 'EUCookieLawCustom'; const MENU_SLUG = 'EUCookieLaw'; - const VERSION = '2.4.0'; + const VERSION = '2.5.0'; const CSS = 'EUCookieLaw_css'; const CUSTOMCSS = 'EUCookieLaw_css_custom'; const JS = 'EUCookieLaw_js'; diff --git a/eucookielaw.css b/eucookielaw.css old mode 100644 new mode 100755 diff --git a/eucookielaw.php b/eucookielaw.php old mode 100644 new mode 100755 index 874994f..58e8538 --- a/eucookielaw.php +++ b/eucookielaw.php @@ -4,7 +4,7 @@ * Plugin URI: https://github.com/diegolamonica/EUCookieLaw * Description: A simple WP solution to the European Cookie Law Issue * Author: Diego La Monica - * Version: 2.4.0 + * Version: 2.5.0 * Author URI: http://diegolamonica.info * Text Domain: EUCookieLaw * Domain Path: /languages @@ -12,7 +12,7 @@ /** * EUCookieLaw: EUCookieLaw a complete solution to accomplish european law requirements about cookie consent - * @version 2.4.0 + * @version 2.5.0 * @link https://github.com/diegolamonica/EUCookieLaw/ * @author Diego La Monica (diegolamonica) * @copyright 2015 Diego La Monica diff --git a/gzcompat.php b/gzcompat.php old mode 100644 new mode 100755 diff --git a/index.html b/index.html old mode 100644 new mode 100755 diff --git a/index.php b/index.php old mode 100644 new mode 100755 diff --git a/languages/EUCookieLaw-it_IT.mo b/languages/EUCookieLaw-it_IT.mo old mode 100644 new mode 100755 diff --git a/languages/EUCookieLaw-it_IT.po b/languages/EUCookieLaw-it_IT.po old mode 100644 new mode 100755 diff --git a/languages/default.mo b/languages/default.mo old mode 100644 new mode 100755 diff --git a/languages/default.po b/languages/default.po old mode 100644 new mode 100755 diff --git a/readme.md b/readme.md old mode 100644 new mode 100755 index 4b8c652..e0db990 --- a/readme.md +++ b/readme.md @@ -65,6 +65,9 @@ the `EUCookieLaw` initialization expect an Object with the following properties: * `path` (`string` defualt `/`) defines the path where the consent cookie will be valid. +* `domain` (`string` default setted to `window.location.host` value) defines the domain which to apply the cookie. + **Note:** Define to `false` if the URL is defined by IP instead of domain. + * `cookieList` (`array` default `[]`) the list of techincal cookies the user cannot choose to reject. If some script try to write one of the listed cookie it will be accepted. **TIP:** You can use the `*` wildchar as suffix to intend all the cookies that starts with a specific value (eg. `__umt*` will mean `__umta`, `__umtc` and so on). @@ -349,6 +352,14 @@ If you want to get involved in this plugin development, then fork the repository # Changelog +## 2.5.0 +* **NEW**: Now you can define the domain where the cookie will be applied +* **IMPROVEMENTS**: Javascript page reload forces contents from server (ignoring browser cache) +* **BUGFIX**: `WP_CONTENT_DIR` defined instead of `EUCL_CONTENT_DIR` causes some problems if site is without cache. +* Minor bugfixes and general improvements +* updated documentation +* updated the version number + ## 2.4.0 * **NEW**: Now you can set the number of pixels for consent on scroll * **NEW**: If not configured (as constants) the agree and disagree links will be auto-generated by the server. diff --git a/readme.txt b/readme.txt old mode 100644 new mode 100755 index f97bed7..f6200db --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,10 @@ === Plugin Name === -Contributors: diego-la-monica +Contributors: Diego La Monica Tags: Cookie, Cookie Law, Law Compliance, EU Cookie Law, blocco preventivo, cookie block, cookie consent, cookie policy, cookie banner Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=me%40diegolamonica%2einfo&lc=IT&item_name=EU%20Cookie%20Law&no_note=0¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest Requires at least: 4.0 -Tested up to: 4.2.2 -Stable tag: 2.4.0 +Tested up to: 4.2.4 +Stable tag: 2.5.0 License: LGPLv3 License URI: http://www.gnu.org/licenses/lgpl-3.0-standalone.html @@ -48,6 +48,15 @@ For manual installation via FTP == Changelog == += 2.5.0 = +* **NEW**: Now you can define the domain where the cookie will be applied +* **IMPROVEMENTS**: Javascript page reload forces contents from server (ignoring browser cache) +* **IMPROVEMENTS**: Better readability of the header file +* **BUGFIX**: `WP_CONTENT_DIR` defined instead of `EUCL_CONTENT_DIR` causes some problems if site is without cache. +* Minor bugfixes and general improvements +* updated documentation +* updated the version number + = 2.4.0 = * **NEW**: Now you can set the number of pixels for consent on scroll * **NEW**: If not configured (as constants) the agree and disagree links will be auto-generated by the server. diff --git a/templates/EUCookieCache.php b/templates/EUCookieCache.php old mode 100644 new mode 100755 diff --git a/templates/htaccess.fragment.txt b/templates/htaccess.fragment.txt old mode 100644 new mode 100755 diff --git a/templates/index.php b/templates/index.php old mode 100644 new mode 100755 diff --git a/templates/wp-config.fragment.php b/templates/wp-config.fragment.php old mode 100644 new mode 100755 diff --git a/wpEUCookieLaw.js b/wpEUCookieLaw.js old mode 100644 new mode 100755 diff --git a/wpml-config.xml b/wpml-config.xml old mode 100644 new mode 100755