Plugin Directory

Changeset 2511096


Ignore:
Timestamp:
04/07/2021 08:34:20 PM (5 years ago)
Author:
niceaddons
Message:

Cookie Accept Plugin - Update 2.0.0

Location:
cookie-accept
Files:
35 added
2 edited

Legend:

Unmodified
Added
Removed
  • cookie-accept/trunk/cookie-accept.php

    r2506380 r2511096  
    11<?php
    22/**
    3  * Plugin Name: Cookie Accept
     3 * Plugin Name: Cookie Accept 
    44 * 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.0
    7  * Author: Nice Addons
     5 * 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
    88 * Author URI: https://niceaddons.com
    99 * License: GPLv2 or later
     
    2626 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    2727 *
    28  * Copyright 2021  Nice Addons (email : support@niceaddons.com)
     28 * Copyright 2021  Nice AddOns (email : support@niceaddons.com)
    2929 */
    3030
     
    3434
    3535
    36 class Cookie_Accept
     36/**
     37 * Cookie Accept Class
     38 */
     39class Cookie_Accept
    3740{
    3841
     
    5558    function __construct() {
    5659
    57         add_action( 'init', array( $this, 'check') );
     60        $this->_definite();
     61        $this->_loader();
    5862
    5963    }
     
    6165
    6266    /**
    63      * Load Cookie if not accepted
     67     * Cookie Accept Definite
    6468     */
    65     function check() {
    66         $cookieName = "wp_cookie_accept";
     69    public function _definite() {
    6770
    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' );
    8975
    9076    }
     
    9278
    9379    /**
    94      * Load Cookie CSS
     80     * Load file packs.
    9581     */
    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
    9989
    10090
  • cookie-accept/trunk/readme.txt

    r2506380 r2511096  
    1 === Cookie Accept ===
     1=== Cookie Accept - GDPR & CCPA Cookie Consent ===
    22Contributors: niceaddons
    3 Tags: gutenberg, blocks, new editor, page builder, gutenberg blocks, editor, block pack, wordpress 5,
    4 Requires at least: 5.6
     3Tags: cookie, notice, consent, concern, GDPR, compliance, live, preview, CCPA, editor, block, options, wordpress 5, multisite, popup
     4Requires at least: 5.5
    55Tested up to: 5.7
    6 Stable tag: 1.0.0
     6Stable tag: 2.0.0
    77Requires PHP: 5.6.20
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Cookie Accept is a simple cookie consent, concern and compliance.
     11
     12Cookie Accept is a simple cookie consent, concern and compliance. Get your site ready for GDPR, CCPA or the others.
    1213
    1314
    1415== Description ==
    1516
    16 <strong>Cookie Accept</strong> is a simple cookie consent, concern and compliance. And thats it.
     17Simple 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
     21Here 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
     331. Cookie Accept in Action - Light Mode.
     342. Cookie Accept in Action - Dark mode with fullscreen style layout.
     353. Live preview in admin. Get full control.
     36
     37
     38== Upgrade Notice ==
     39
     40= 2.0.0 =
     41Add setting page, make more customizable with Live preview.
    1742
    1843
    1944== Changelog ==
    2045
     46= 2.0.0 =
     47* Now customizable. with Live preview. Multisite supported.
     48
    2149= 1.0.0 =
    2250* Initial release.
Note: See TracChangeset for help on using the changeset viewer.