Changeset 2511096
- Timestamp:
- 04/07/2021 08:34:20 PM (5 years ago)
- Location:
- cookie-accept
- Files:
-
- 35 added
- 2 edited
-
assets/banner-1544x500.png (added)
-
assets/banner-772x250.png (added)
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.png (added)
-
assets/icon.svg (added)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (added)
-
tags/2.0.0 (added)
-
tags/2.0.0/assets (added)
-
tags/2.0.0/assets/css (added)
-
tags/2.0.0/assets/css/options.css (added)
-
tags/2.0.0/assets/js (added)
-
tags/2.0.0/assets/js/admin.js (added)
-
tags/2.0.0/assets/js/admin.min.js (added)
-
tags/2.0.0/assets/scss (added)
-
tags/2.0.0/assets/scss/options.scss (added)
-
tags/2.0.0/cookie-accept.php (added)
-
tags/2.0.0/inc (added)
-
tags/2.0.0/inc/core.php (added)
-
tags/2.0.0/inc/frontend.php (added)
-
tags/2.0.0/inc/options.php (added)
-
tags/2.0.0/readme.txt (added)
-
trunk/assets (added)
-
trunk/assets/css (added)
-
trunk/assets/css/options.css (added)
-
trunk/assets/js (added)
-
trunk/assets/js/admin.js (added)
-
trunk/assets/js/admin.min.js (added)
-
trunk/assets/scss (added)
-
trunk/assets/scss/options.scss (added)
-
trunk/cookie-accept.php (modified) (6 diffs)
-
trunk/inc (added)
-
trunk/inc/core.php (added)
-
trunk/inc/frontend.php (added)
-
trunk/inc/options.php (added)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cookie-accept/trunk/cookie-accept.php
r2506380 r2511096 1 1 <?php 2 2 /** 3 * Plugin Name: Cookie Accept 3 * Plugin Name: Cookie Accept 4 4 * Plugin URI: https://niceaddons.com/plugin/cookie-accept 5 * Description: A clean and useful cookie consent and accept for your site.6 * Version: 1.0.07 * Author: Nice Add ons5 * Description: Cookie Accept is a simple cookie consent, concern and compliance. Get your site ready for GDPR, CCPA or the others. 6 * Version: 2.0.0 7 * Author: Nice AddOns 8 8 * Author URI: https://niceaddons.com 9 9 * License: GPLv2 or later … … 26 26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 27 27 * 28 * Copyright 2021 Nice Add ons (email : support@niceaddons.com)28 * Copyright 2021 Nice AddOns (email : support@niceaddons.com) 29 29 */ 30 30 … … 34 34 35 35 36 class Cookie_Accept 36 /** 37 * Cookie Accept Class 38 */ 39 class Cookie_Accept 37 40 { 38 41 … … 55 58 function __construct() { 56 59 57 add_action( 'init', array( $this, 'check') ); 60 $this->_definite(); 61 $this->_loader(); 58 62 59 63 } … … 61 65 62 66 /** 63 * Load Cookie if not accepted67 * Cookie Accept Definite 64 68 */ 65 function check() { 66 $cookieName = "wp_cookie_accept"; 69 public function _definite() { 67 70 68 if ( !isset($_COOKIE[$cookieName]) ){ 69 add_action( 'wp_head', array( $this, 'css') ); 70 add_action( 'wp_footer', array( $this, 'notice') ); 71 } 72 } 73 74 75 /** 76 * Load Cookie Consent and script 77 */ 78 function notice() { 79 80 ?> 81 <div id="cookie-consent-notice" class="cookie-consent-notice"> 82 <div class="consent-container"> 83 <p><strong>This website use cookies</strong> to personalize content and provide website features. You have the right to disable cookies at the browser level, though this may impact your experience.</p> 84 <p><button id="accept-cookies">Accept Cookies</button></p> 85 </div> 86 </div> 87 <script>n=document.getElementById("cookie-consent-notice");b=document.getElementById("accept-cookies");b.addEventListener("click",function(){var d=new Date();d.setTime(d.getTime()+10*365*24*60*60*1000);var e="expires="+d.toUTCString();n.classList.add("accepted");document.cookie="wp_cookie_accept=accepted;"+e+";path=<?php echo COOKIEPATH; ?>"});</script> 88 <?php 71 define( 'COOKIE_ACCEPT_VER', '2.0.0' ); 72 define( 'COOKIE_ACCEPT_URI', plugin_dir_url( __FILE__ ) ); 73 define( 'COOKIE_ACCEPT_PATH', plugin_dir_path( __FILE__ ) ); 74 define( 'COOKIE_ACCEPT_INC', COOKIE_ACCEPT_PATH . 'inc' ); 89 75 90 76 } … … 92 78 93 79 /** 94 * Load Cookie CSS80 * Load file packs. 95 81 */ 96 function css() { ?> 97 <style>body{overflow-x:hidden;width:100%}.cookie-consent-notice{width:100%;position:fixed;background-color:#fff;box-shadow:0 -3px 10px rgba(0, 0, 0, 0.2);bottom:0;left:0;z-index:10;opacity:1;transition:left 0.5s;padding:1.5rem 0;border-radius:0.5rem}.cookie-consent-notice.accepted{bottom:100%;opacity:0;transition:opacity 1s, bottom 4s linear}.cookie-consent-notice .consent-container{display:grid;grid-template-columns:auto;width:calc(100% - 2.5rem);margin:0 auto;text-align:center;grid-gap:0.5rem}.cookie-consent-notice .consent-container p{margin:0}.cookie-consent-notice .consent-container button{background-color:#00b358;justify-self:center;color:#fff;border:none;border-radius:2rem;width:auto;padding:0.5rem 1.5rem;margin:0.5rem;cursor:pointer;opacity:0.8}.cookie-consent-notice .consent-container button:focus,.cookie-consent-notice .consent-container button:hover{opacity:1}@media (min-width: 816px){.cookie-consent-notice{width:33%;left:3rem;bottom:3rem;box-shadow:0 -1px 50px rgba(0, 0, 0, 0.2)}.cookie-consent-notice.accepted{left:100%;bottom:3rem;transition:opacity 2s, left 5s linear}}</style> 98 <?php } 82 public function _loader() { 83 84 require( COOKIE_ACCEPT_INC . '/core.php' ); 85 86 } 87 88 99 89 100 90 -
cookie-accept/trunk/readme.txt
r2506380 r2511096 1 === Cookie Accept ===1 === Cookie Accept - GDPR & CCPA Cookie Consent === 2 2 Contributors: niceaddons 3 Tags: gutenberg, blocks, new editor, page builder, gutenberg blocks, editor, block pack, wordpress 5,4 Requires at least: 5. 63 Tags: cookie, notice, consent, concern, GDPR, compliance, live, preview, CCPA, editor, block, options, wordpress 5, multisite, popup 4 Requires at least: 5.5 5 5 Tested up to: 5.7 6 Stable tag: 1.0.06 Stable tag: 2.0.0 7 7 Requires PHP: 5.6.20 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Cookie Accept is a simple cookie consent, concern and compliance. 11 12 Cookie Accept is a simple cookie consent, concern and compliance. Get your site ready for GDPR, CCPA or the others. 12 13 13 14 14 15 == Description == 15 16 16 <strong>Cookie Accept</strong> is a simple cookie consent, concern and compliance. And thats it. 17 Simple and elegant cookie consent is all you need. <strong>Cookie Accept</strong> is a simple cookie consent, concern and compliance. Get your site ready for GDPR, CCPA or the others. Control your cookie consent via options with live preview. 18 19 ## Easy to Customize! 20 21 Here some key features you will get: 22 23 * <strong>Live Preview.</strong> See your cookie consent while editing it. 24 * <strong>Dark Mode Ready.</strong> Match your site color mode. 25 * <strong>Custom Cookie Consent Message</strong> Yes, you can customize the message. 26 * <strong>Clean CSS and Javascript Frontend.</strong> If your visitor look at your site source code, they possibly don't realize you use this plugin. 27 * <strong>Single Line Database.</strong> Yep! this plugin save all your custom settings of this plugin into only one row of data inside <code>wp_options</code> table. 28 * <strong>Responsive.</strong> Well it is a must for website nowadays. 29 30 31 == Screenshots == 32 33 1. Cookie Accept in Action - Light Mode. 34 2. Cookie Accept in Action - Dark mode with fullscreen style layout. 35 3. Live preview in admin. Get full control. 36 37 38 == Upgrade Notice == 39 40 = 2.0.0 = 41 Add setting page, make more customizable with Live preview. 17 42 18 43 19 44 == Changelog == 20 45 46 = 2.0.0 = 47 * Now customizable. with Live preview. Multisite supported. 48 21 49 = 1.0.0 = 22 50 * Initial release.
Note: See TracChangeset
for help on using the changeset viewer.