Changeset 3436765
- Timestamp:
- 01/10/2026 05:58:03 PM (3 months ago)
- Location:
- simple-cookie-notice
- Files:
-
- 10 edited
- 1 copied
-
tags/2.1 (copied) (copied from simple-cookie-notice/trunk)
-
tags/2.1/public/js/jlplg_lovecoding_script.js (modified) (1 diff)
-
tags/2.1/readme.txt (modified) (2 diffs)
-
tags/2.1/simple-cookie-notice.php (modified) (8 diffs)
-
tags/2.1/styles.css (modified) (2 diffs)
-
tags/2.1/uninstall.php (modified) (2 diffs)
-
trunk/public/js/jlplg_lovecoding_script.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/simple-cookie-notice.php (modified) (8 diffs)
-
trunk/styles.css (modified) (2 diffs)
-
trunk/uninstall.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-cookie-notice/tags/2.1/public/js/jlplg_lovecoding_script.js
r3144342 r3436765 64 64 const jlplgCookie = jlplgGetCookie("jlplg-cookies-accepted"); 65 65 66 if (jlplgCookie != 'yes') {66 if (jlplgCookie !== 'yes') { 67 67 document.querySelector('.jlplg-lovecoding-cookie-info-container').classList.remove('jlplg-hidden'); 68 68 } -
simple-cookie-notice/tags/2.1/readme.txt
r3144342 r3436765 1 1 === Simple Cookie Notice === 2 2 Contributors: lovecoding 3 Tags: cookie, cookie notice, cookie consent, cookie law, privacy policy, cookies, 3 Tags: cookie, cookie notice, cookie consent, cookie law, privacy policy, cookies, simple cookies 4 4 Requires at least: 5.0 5 Tested up to: 6. 65 Tested up to: 6.9 6 6 Requires PHP: 7.0 7 Stable tag: 2. 07 Stable tag: 2.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl.html … … 42 42 43 43 == Upgrade Notice == 44 45 = 2.1 = 46 * Fixed critical bug with cookie name inconsistency 47 * Improved uninstall process 48 * Changed Privacy Policy button to link for better performance and SEO 49 * Added validation for cookie expiration time 50 * Fixed typos in variable names 51 * Code refactoring and improvements 44 52 45 53 = 2.0 = -
simple-cookie-notice/tags/2.1/simple-cookie-notice.php
r3144342 r3436765 3 3 * Plugin Name: Simple Cookie Notice 4 4 * Description: In simple way add personalized cookie info and link to wordpress privacy policy page. 5 * Version: 2. 05 * Version: 2.1 6 6 * Requires at least: 5.0 7 7 * Requires PHP: 7.0 … … 28 28 defined( 'ABSPATH' ) or die( 'hey, you don\'t have an access to read this site' ); 29 29 30 31 30 // adding 'Settings' link to plugin links 32 31 function jlplg_lovecoding_add_plugin_settings_link( $links ) { … … 41 40 // adding styles and scripts 42 41 function jlplg_lovecoding_enqueue_scripts() { 43 // load styles and script for plugin only if cookies are not accepted44 if ( !isset( $_COOKIE['cookie-accepted'] ) ) {45 wp_enqueue_style( 'styles', plugins_url( 'styles.css', __FILE__ ) ); 46 wp_enqueue_script( 'jlplg_lovecoding_script', plugins_url( 'public/js/jlplg_lovecoding_script.js', __FILE__ ), array(), time(), true);47 }42 $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/simple-cookie-notice/simple-cookie-notice.php' ); 43 $plugin_version = isset( $plugin_data['Version'] ) ? $plugin_data['Version'] : '2.0'; 44 45 wp_enqueue_style( 'jlplg_lovecoding_styles', plugins_url( 'styles.css', __FILE__ ), [], $plugin_version ); 46 wp_enqueue_script( 'jlplg_lovecoding_script', plugins_url( 'public/js/jlplg_lovecoding_script.js', __FILE__ ), array(), $plugin_version, true ); 48 47 } 49 48 add_action( 'wp_enqueue_scripts', 'jlplg_lovecoding_enqueue_scripts' ); … … 88 87 <span class="button-text" style="<?php echo 'color: '.esc_attr( $button_text_color ) ?>"><?php echo esc_html( $cookie_info_button ); ?></span> 89 88 </button> 90 <?php if ( $show_policy_privacy ) { ?> 91 <button type="submit" name="jlplg-cookie-privacy-policy" class="jlplg-lovecoding-cookie-privacy-policy" id="cookie-privacy-policy" style="<?php echo 'background-color: '.esc_attr( $button_background_color ) ?>"> 89 <?php if ( $show_policy_privacy ) { 90 $privacy_url = get_privacy_policy_url(); 91 if ( empty( $privacy_url ) ) { 92 $privacy_url = get_home_url() . '/privacy-policy'; 93 } 94 ?> 95 <a href="<?php echo esc_url( $privacy_url ); ?>" class="jlplg-lovecoding-cookie-privacy-policy" id="cookie-privacy-policy" style="<?php echo 'background-color: '.esc_attr( $button_background_color ) ?>"> 92 96 <span class="button-text" style="<?php echo 'color: '.esc_attr( $button_text_color ) ?>"><?php esc_html_e( 'Privacy Policy', 'jlplg_lovecoding' ) ?></span> 93 </ button>97 </a> 94 98 <?php } ?> 95 99 </div> … … 101 105 // display cookie notice if cookie info is not set 102 106 function jlplg_lovecoding_display_cookie_notice() { 103 // always display cookies info104 107 add_action('wp_footer', 'jlplg_lovecoding_display_cookie_info'); 105 106 // make action when privacy policy button was clicked107 if ( isset( $_POST['jlplg-cookie-privacy-policy'] ) ) {108 $privacy_policy = get_privacy_policy_url();109 if ( empty($privacy_policy) ) {110 $privacy_policy = get_home_url().'/privacy-policy';111 }112 wp_safe_redirect( $privacy_policy );113 exit;114 }115 108 } 116 109 add_action( 'init', 'jlplg_lovecoding_display_cookie_notice'); … … 133 126 function jlplg_lovecoding_add_new_settings() { 134 127 // register settings 135 $configuration_settin s_field1_arg = array(128 $configuration_settings_field1_arg = array( 136 129 'type' => 'string', 137 130 'sanitize_callback' => 'jlplg_lovecoding_sanitize_textarea_field', 138 131 'default' => 'We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies' 139 132 ); 140 $configuration_settin s_field2_arg = array(133 $configuration_settings_field2_arg = array( 141 134 'type' => 'boolean', 142 135 'sanitize_callback' => 'jlplg_lovecoding_sanitize_checkbox', 143 136 'default' => false 144 137 ); 145 $configuration_settin s_field3_arg = array(138 $configuration_settings_field3_arg = array( 146 139 'type' => 'string', 147 140 'sanitize_callback' => 'jlplg_lovecoding_sanitize_input_field', 148 141 'default' => 'Accept Cookies' 149 142 ); 150 $configuration_settin s_field4_arg = array(143 $configuration_settings_field4_arg = array( 151 144 'type' => 'string', 152 145 'sanitize_callback' => 'jlplg_lovecoding_sanitize_input_field', 153 146 'default' => 'bottom' 154 147 ); 155 $configuration_settin s_field5_arg = array(156 'type' => ' string',157 'sanitize_callback' => 'jlplg_lovecoding_sanitize_in put_field',158 'default' => 'bottom'159 ); 160 $layout_settin s_field1_arg = array(148 $configuration_settings_field5_arg = array( 149 'type' => 'integer', 150 'sanitize_callback' => 'jlplg_lovecoding_sanitize_integer', 151 'default' => 30 152 ); 153 $layout_settings_field1_arg = array( 161 154 'type' => 'string', 162 155 'sanitize_callback' => 'jlplg_lovecoding_sanitize_color_input', 163 156 'default' => '#444546' 164 157 ); 165 $layout_settin s_field2_arg = array(158 $layout_settings_field2_arg = array( 166 159 'type' => 'string', 167 160 'sanitize_callback' => 'jlplg_lovecoding_sanitize_color_input', 168 161 'default' => '#ffffff' 169 162 ); 170 $layout_settin s_field3_arg = array(163 $layout_settings_field3_arg = array( 171 164 'type' => 'string', 172 165 'sanitize_callback' => 'jlplg_lovecoding_sanitize_color_input', 173 166 'default' => '#dcf1ff' 174 167 ); 175 $layout_settin s_field4_arg = array(168 $layout_settings_field4_arg = array( 176 169 'type' => 'string', 177 170 'sanitize_callback' => 'jlplg_lovecoding_sanitize_color_input', 178 171 'default' => '#000000' 179 172 ); 180 register_setting( 'jl_options', 'jlplg_lovecoding-field1-cookie-message', $configuration_settin s_field1_arg); // option group, option name, args181 register_setting( 'jl_options', 'jlplg_lovecoding-field2-checkbox-privacy-policy', $configuration_settin s_field2_arg);182 register_setting( 'jl_options', 'jlplg_lovecoding-field3-cookie-button-text', $configuration_settin s_field3_arg);183 register_setting( 'jl_options', 'jlplg_lovecoding-field4-cookie-plugin-placement', $configuration_settin s_field4_arg);184 register_setting( 'jl_options', 'jlplg_lovecoding-field5-background-color', $layout_settin s_field1_arg);185 register_setting( 'jl_options', 'jlplg_lovecoding-field6-text-color', $layout_settin s_field2_arg);186 register_setting( 'jl_options', 'jlplg_lovecoding-field7-button-background-color', $layout_settin s_field3_arg);187 register_setting( 'jl_options', 'jlplg_lovecoding-field8-button-text-color', $layout_settin s_field4_arg);188 register_setting( 'jl_options', 'jlplg_lovecoding-field9-cookie-expire-time', $configuration_settin s_field5_arg);173 register_setting( 'jl_options', 'jlplg_lovecoding-field1-cookie-message', $configuration_settings_field1_arg); // option group, option name, args 174 register_setting( 'jl_options', 'jlplg_lovecoding-field2-checkbox-privacy-policy', $configuration_settings_field2_arg); 175 register_setting( 'jl_options', 'jlplg_lovecoding-field3-cookie-button-text', $configuration_settings_field3_arg); 176 register_setting( 'jl_options', 'jlplg_lovecoding-field4-cookie-plugin-placement', $configuration_settings_field4_arg); 177 register_setting( 'jl_options', 'jlplg_lovecoding-field5-background-color', $layout_settings_field1_arg); 178 register_setting( 'jl_options', 'jlplg_lovecoding-field6-text-color', $layout_settings_field2_arg); 179 register_setting( 'jl_options', 'jlplg_lovecoding-field7-button-background-color', $layout_settings_field3_arg); 180 register_setting( 'jl_options', 'jlplg_lovecoding-field8-button-text-color', $layout_settings_field4_arg); 181 register_setting( 'jl_options', 'jlplg_lovecoding-field9-cookie-expire-time', $configuration_settings_field5_arg); 189 182 190 183 // adding sections … … 256 249 } 257 250 258 // field 8- cookie expire time251 // field 9 - cookie expire time 259 252 function jlplg_lovecoding_field_9_callback() { 260 253 echo '<input type="text" name="jlplg_lovecoding-field9-cookie-expire-time" value="'.esc_html( get_option( "jlplg_lovecoding-field9-cookie-expire-time", '30' ) ).'" />'; … … 268 261 } 269 262 return $input; 263 } 264 265 // sanitize integer 266 function jlplg_lovecoding_sanitize_integer( $input ) { 267 return ( isset( $input ) ) ? absint( $input ) : 30; 270 268 } 271 269 -
simple-cookie-notice/tags/2.1/styles.css
r3144342 r3436765 1 1 .jlplg-lovecoding-cookie-info-container { 2 2 position: fixed; 3 z-index: 50;3 z-index: 9999; 4 4 width: 100%; 5 5 text-align: center; … … 23 23 24 24 .jlplg-lovecoding-buttons { 25 display: inline-block; 26 margin-bottom: 10px; 25 display: flex; 26 flex-wrap: wrap; 27 justify-content: center; 28 align-items: center; 29 gap: 10px; 30 margin-bottom: 16px; 27 31 } 28 32 29 button.jlplg-lovecoding-cookie-accept-button, button.jlplg-lovecoding-cookie-privacy-policy { 30 padding: 5px 15px; 33 .jlplg-lovecoding-cookie-accept-button, .jlplg-lovecoding-cookie-privacy-policy { 34 display: inline-block; 35 padding: 7px 15px; 31 36 border-radius: 4px; 32 37 border: 2px solid transparent; 33 margin: 5px 0; 38 margin: 0; 39 text-decoration: none; 40 line-height: 1; 41 font-family: inherit; 42 font-size: 16px; 34 43 } 35 44 36 button.jlplg-lovecoding-cookie-accept-button:hover, button.jlplg-lovecoding-cookie-privacy-policy:hover,37 button.jlplg-lovecoding-cookie-accept-button:focus, button.jlplg-lovecoding-cookie-privacy-policy:focus {45 .jlplg-lovecoding-cookie-accept-button:hover, .jlplg-lovecoding-cookie-privacy-policy:hover, 46 .jlplg-lovecoding-cookie-accept-button:focus, .jlplg-lovecoding-cookie-privacy-policy:focus { 38 47 cursor: pointer; 39 48 border: 2px solid transparent; 40 49 } 41 50 42 button.jlplg-lovecoding-cookie-accept-button:focus-visible, button.jlplg-lovecoding-cookie-privacy-policy:focus-visible {51 .jlplg-lovecoding-cookie-accept-button:focus-visible, .jlplg-lovecoding-cookie-privacy-policy:focus-visible { 43 52 border: 2px solid transparent; 44 53 outline: 2px solid var(--jlplg-buton-bg-color); -
simple-cookie-notice/tags/2.1/uninstall.php
r2856380 r3436765 13 13 14 14 function jlplg_lovecoding_delete_settings() { 15 delete_option( 'jlplg_prvpol-field1-cookie-message' ); 16 delete_option( 'jlplg_prvpol-field2-checkbox-privacy-policy' ); 17 delete_option( 'jlplg_prvpol-field3-cookie-button-text' ); 18 delete_option( 'jlplg_prvpol-field4-background-color' ); 19 delete_option( 'jlplg_prvpol-field5-text-color' ); 20 delete_option( 'jlplg_prvpol-field6-button-background-color' ); 21 delete_option( 'jlplg_prvpol-field7-button-text-color' ); 15 delete_option( 'jlplg_lovecoding-field1-cookie-message' ); 16 delete_option( 'jlplg_lovecoding-field2-checkbox-privacy-policy' ); 17 delete_option( 'jlplg_lovecoding-field3-cookie-button-text' ); 18 delete_option( 'jlplg_lovecoding-field4-cookie-plugin-placement' ); 19 delete_option( 'jlplg_lovecoding-field5-background-color' ); 20 delete_option( 'jlplg_lovecoding-field6-text-color' ); 21 delete_option( 'jlplg_lovecoding-field7-button-background-color' ); 22 delete_option( 'jlplg_lovecoding-field8-button-text-color' ); 23 delete_option( 'jlplg_lovecoding-field9-cookie-expire-time' ); 22 24 } 23 25 … … 25 27 26 28 function jlplg_lovecoding_delete_cookies() { 27 unset( $_COOKIE[' cookie-accepted'] );28 setcookie( sanitize_key( ' cookie-accepted' ), '', 1);29 unset( $_COOKIE['jlplg-cookies-accepted'] ); 30 setcookie( sanitize_key( 'jlplg-cookies-accepted' ), '', 1); 29 31 } 30 32 -
simple-cookie-notice/trunk/public/js/jlplg_lovecoding_script.js
r3144342 r3436765 64 64 const jlplgCookie = jlplgGetCookie("jlplg-cookies-accepted"); 65 65 66 if (jlplgCookie != 'yes') {66 if (jlplgCookie !== 'yes') { 67 67 document.querySelector('.jlplg-lovecoding-cookie-info-container').classList.remove('jlplg-hidden'); 68 68 } -
simple-cookie-notice/trunk/readme.txt
r3144342 r3436765 1 1 === Simple Cookie Notice === 2 2 Contributors: lovecoding 3 Tags: cookie, cookie notice, cookie consent, cookie law, privacy policy, cookies, 3 Tags: cookie, cookie notice, cookie consent, cookie law, privacy policy, cookies, simple cookies 4 4 Requires at least: 5.0 5 Tested up to: 6. 65 Tested up to: 6.9 6 6 Requires PHP: 7.0 7 Stable tag: 2. 07 Stable tag: 2.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl.html … … 42 42 43 43 == Upgrade Notice == 44 45 = 2.1 = 46 * Fixed critical bug with cookie name inconsistency 47 * Improved uninstall process 48 * Changed Privacy Policy button to link for better performance and SEO 49 * Added validation for cookie expiration time 50 * Fixed typos in variable names 51 * Code refactoring and improvements 44 52 45 53 = 2.0 = -
simple-cookie-notice/trunk/simple-cookie-notice.php
r3144342 r3436765 3 3 * Plugin Name: Simple Cookie Notice 4 4 * Description: In simple way add personalized cookie info and link to wordpress privacy policy page. 5 * Version: 2. 05 * Version: 2.1 6 6 * Requires at least: 5.0 7 7 * Requires PHP: 7.0 … … 28 28 defined( 'ABSPATH' ) or die( 'hey, you don\'t have an access to read this site' ); 29 29 30 31 30 // adding 'Settings' link to plugin links 32 31 function jlplg_lovecoding_add_plugin_settings_link( $links ) { … … 41 40 // adding styles and scripts 42 41 function jlplg_lovecoding_enqueue_scripts() { 43 // load styles and script for plugin only if cookies are not accepted44 if ( !isset( $_COOKIE['cookie-accepted'] ) ) {45 wp_enqueue_style( 'styles', plugins_url( 'styles.css', __FILE__ ) ); 46 wp_enqueue_script( 'jlplg_lovecoding_script', plugins_url( 'public/js/jlplg_lovecoding_script.js', __FILE__ ), array(), time(), true);47 }42 $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/simple-cookie-notice/simple-cookie-notice.php' ); 43 $plugin_version = isset( $plugin_data['Version'] ) ? $plugin_data['Version'] : '2.0'; 44 45 wp_enqueue_style( 'jlplg_lovecoding_styles', plugins_url( 'styles.css', __FILE__ ), [], $plugin_version ); 46 wp_enqueue_script( 'jlplg_lovecoding_script', plugins_url( 'public/js/jlplg_lovecoding_script.js', __FILE__ ), array(), $plugin_version, true ); 48 47 } 49 48 add_action( 'wp_enqueue_scripts', 'jlplg_lovecoding_enqueue_scripts' ); … … 88 87 <span class="button-text" style="<?php echo 'color: '.esc_attr( $button_text_color ) ?>"><?php echo esc_html( $cookie_info_button ); ?></span> 89 88 </button> 90 <?php if ( $show_policy_privacy ) { ?> 91 <button type="submit" name="jlplg-cookie-privacy-policy" class="jlplg-lovecoding-cookie-privacy-policy" id="cookie-privacy-policy" style="<?php echo 'background-color: '.esc_attr( $button_background_color ) ?>"> 89 <?php if ( $show_policy_privacy ) { 90 $privacy_url = get_privacy_policy_url(); 91 if ( empty( $privacy_url ) ) { 92 $privacy_url = get_home_url() . '/privacy-policy'; 93 } 94 ?> 95 <a href="<?php echo esc_url( $privacy_url ); ?>" class="jlplg-lovecoding-cookie-privacy-policy" id="cookie-privacy-policy" style="<?php echo 'background-color: '.esc_attr( $button_background_color ) ?>"> 92 96 <span class="button-text" style="<?php echo 'color: '.esc_attr( $button_text_color ) ?>"><?php esc_html_e( 'Privacy Policy', 'jlplg_lovecoding' ) ?></span> 93 </ button>97 </a> 94 98 <?php } ?> 95 99 </div> … … 101 105 // display cookie notice if cookie info is not set 102 106 function jlplg_lovecoding_display_cookie_notice() { 103 // always display cookies info104 107 add_action('wp_footer', 'jlplg_lovecoding_display_cookie_info'); 105 106 // make action when privacy policy button was clicked107 if ( isset( $_POST['jlplg-cookie-privacy-policy'] ) ) {108 $privacy_policy = get_privacy_policy_url();109 if ( empty($privacy_policy) ) {110 $privacy_policy = get_home_url().'/privacy-policy';111 }112 wp_safe_redirect( $privacy_policy );113 exit;114 }115 108 } 116 109 add_action( 'init', 'jlplg_lovecoding_display_cookie_notice'); … … 133 126 function jlplg_lovecoding_add_new_settings() { 134 127 // register settings 135 $configuration_settin s_field1_arg = array(128 $configuration_settings_field1_arg = array( 136 129 'type' => 'string', 137 130 'sanitize_callback' => 'jlplg_lovecoding_sanitize_textarea_field', 138 131 'default' => 'We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies' 139 132 ); 140 $configuration_settin s_field2_arg = array(133 $configuration_settings_field2_arg = array( 141 134 'type' => 'boolean', 142 135 'sanitize_callback' => 'jlplg_lovecoding_sanitize_checkbox', 143 136 'default' => false 144 137 ); 145 $configuration_settin s_field3_arg = array(138 $configuration_settings_field3_arg = array( 146 139 'type' => 'string', 147 140 'sanitize_callback' => 'jlplg_lovecoding_sanitize_input_field', 148 141 'default' => 'Accept Cookies' 149 142 ); 150 $configuration_settin s_field4_arg = array(143 $configuration_settings_field4_arg = array( 151 144 'type' => 'string', 152 145 'sanitize_callback' => 'jlplg_lovecoding_sanitize_input_field', 153 146 'default' => 'bottom' 154 147 ); 155 $configuration_settin s_field5_arg = array(156 'type' => ' string',157 'sanitize_callback' => 'jlplg_lovecoding_sanitize_in put_field',158 'default' => 'bottom'159 ); 160 $layout_settin s_field1_arg = array(148 $configuration_settings_field5_arg = array( 149 'type' => 'integer', 150 'sanitize_callback' => 'jlplg_lovecoding_sanitize_integer', 151 'default' => 30 152 ); 153 $layout_settings_field1_arg = array( 161 154 'type' => 'string', 162 155 'sanitize_callback' => 'jlplg_lovecoding_sanitize_color_input', 163 156 'default' => '#444546' 164 157 ); 165 $layout_settin s_field2_arg = array(158 $layout_settings_field2_arg = array( 166 159 'type' => 'string', 167 160 'sanitize_callback' => 'jlplg_lovecoding_sanitize_color_input', 168 161 'default' => '#ffffff' 169 162 ); 170 $layout_settin s_field3_arg = array(163 $layout_settings_field3_arg = array( 171 164 'type' => 'string', 172 165 'sanitize_callback' => 'jlplg_lovecoding_sanitize_color_input', 173 166 'default' => '#dcf1ff' 174 167 ); 175 $layout_settin s_field4_arg = array(168 $layout_settings_field4_arg = array( 176 169 'type' => 'string', 177 170 'sanitize_callback' => 'jlplg_lovecoding_sanitize_color_input', 178 171 'default' => '#000000' 179 172 ); 180 register_setting( 'jl_options', 'jlplg_lovecoding-field1-cookie-message', $configuration_settin s_field1_arg); // option group, option name, args181 register_setting( 'jl_options', 'jlplg_lovecoding-field2-checkbox-privacy-policy', $configuration_settin s_field2_arg);182 register_setting( 'jl_options', 'jlplg_lovecoding-field3-cookie-button-text', $configuration_settin s_field3_arg);183 register_setting( 'jl_options', 'jlplg_lovecoding-field4-cookie-plugin-placement', $configuration_settin s_field4_arg);184 register_setting( 'jl_options', 'jlplg_lovecoding-field5-background-color', $layout_settin s_field1_arg);185 register_setting( 'jl_options', 'jlplg_lovecoding-field6-text-color', $layout_settin s_field2_arg);186 register_setting( 'jl_options', 'jlplg_lovecoding-field7-button-background-color', $layout_settin s_field3_arg);187 register_setting( 'jl_options', 'jlplg_lovecoding-field8-button-text-color', $layout_settin s_field4_arg);188 register_setting( 'jl_options', 'jlplg_lovecoding-field9-cookie-expire-time', $configuration_settin s_field5_arg);173 register_setting( 'jl_options', 'jlplg_lovecoding-field1-cookie-message', $configuration_settings_field1_arg); // option group, option name, args 174 register_setting( 'jl_options', 'jlplg_lovecoding-field2-checkbox-privacy-policy', $configuration_settings_field2_arg); 175 register_setting( 'jl_options', 'jlplg_lovecoding-field3-cookie-button-text', $configuration_settings_field3_arg); 176 register_setting( 'jl_options', 'jlplg_lovecoding-field4-cookie-plugin-placement', $configuration_settings_field4_arg); 177 register_setting( 'jl_options', 'jlplg_lovecoding-field5-background-color', $layout_settings_field1_arg); 178 register_setting( 'jl_options', 'jlplg_lovecoding-field6-text-color', $layout_settings_field2_arg); 179 register_setting( 'jl_options', 'jlplg_lovecoding-field7-button-background-color', $layout_settings_field3_arg); 180 register_setting( 'jl_options', 'jlplg_lovecoding-field8-button-text-color', $layout_settings_field4_arg); 181 register_setting( 'jl_options', 'jlplg_lovecoding-field9-cookie-expire-time', $configuration_settings_field5_arg); 189 182 190 183 // adding sections … … 256 249 } 257 250 258 // field 8- cookie expire time251 // field 9 - cookie expire time 259 252 function jlplg_lovecoding_field_9_callback() { 260 253 echo '<input type="text" name="jlplg_lovecoding-field9-cookie-expire-time" value="'.esc_html( get_option( "jlplg_lovecoding-field9-cookie-expire-time", '30' ) ).'" />'; … … 268 261 } 269 262 return $input; 263 } 264 265 // sanitize integer 266 function jlplg_lovecoding_sanitize_integer( $input ) { 267 return ( isset( $input ) ) ? absint( $input ) : 30; 270 268 } 271 269 -
simple-cookie-notice/trunk/styles.css
r3144342 r3436765 1 1 .jlplg-lovecoding-cookie-info-container { 2 2 position: fixed; 3 z-index: 50;3 z-index: 9999; 4 4 width: 100%; 5 5 text-align: center; … … 23 23 24 24 .jlplg-lovecoding-buttons { 25 display: inline-block; 26 margin-bottom: 10px; 25 display: flex; 26 flex-wrap: wrap; 27 justify-content: center; 28 align-items: center; 29 gap: 10px; 30 margin-bottom: 16px; 27 31 } 28 32 29 button.jlplg-lovecoding-cookie-accept-button, button.jlplg-lovecoding-cookie-privacy-policy { 30 padding: 5px 15px; 33 .jlplg-lovecoding-cookie-accept-button, .jlplg-lovecoding-cookie-privacy-policy { 34 display: inline-block; 35 padding: 7px 15px; 31 36 border-radius: 4px; 32 37 border: 2px solid transparent; 33 margin: 5px 0; 38 margin: 0; 39 text-decoration: none; 40 line-height: 1; 41 font-family: inherit; 42 font-size: 16px; 34 43 } 35 44 36 button.jlplg-lovecoding-cookie-accept-button:hover, button.jlplg-lovecoding-cookie-privacy-policy:hover,37 button.jlplg-lovecoding-cookie-accept-button:focus, button.jlplg-lovecoding-cookie-privacy-policy:focus {45 .jlplg-lovecoding-cookie-accept-button:hover, .jlplg-lovecoding-cookie-privacy-policy:hover, 46 .jlplg-lovecoding-cookie-accept-button:focus, .jlplg-lovecoding-cookie-privacy-policy:focus { 38 47 cursor: pointer; 39 48 border: 2px solid transparent; 40 49 } 41 50 42 button.jlplg-lovecoding-cookie-accept-button:focus-visible, button.jlplg-lovecoding-cookie-privacy-policy:focus-visible {51 .jlplg-lovecoding-cookie-accept-button:focus-visible, .jlplg-lovecoding-cookie-privacy-policy:focus-visible { 43 52 border: 2px solid transparent; 44 53 outline: 2px solid var(--jlplg-buton-bg-color); -
simple-cookie-notice/trunk/uninstall.php
r2856380 r3436765 13 13 14 14 function jlplg_lovecoding_delete_settings() { 15 delete_option( 'jlplg_prvpol-field1-cookie-message' ); 16 delete_option( 'jlplg_prvpol-field2-checkbox-privacy-policy' ); 17 delete_option( 'jlplg_prvpol-field3-cookie-button-text' ); 18 delete_option( 'jlplg_prvpol-field4-background-color' ); 19 delete_option( 'jlplg_prvpol-field5-text-color' ); 20 delete_option( 'jlplg_prvpol-field6-button-background-color' ); 21 delete_option( 'jlplg_prvpol-field7-button-text-color' ); 15 delete_option( 'jlplg_lovecoding-field1-cookie-message' ); 16 delete_option( 'jlplg_lovecoding-field2-checkbox-privacy-policy' ); 17 delete_option( 'jlplg_lovecoding-field3-cookie-button-text' ); 18 delete_option( 'jlplg_lovecoding-field4-cookie-plugin-placement' ); 19 delete_option( 'jlplg_lovecoding-field5-background-color' ); 20 delete_option( 'jlplg_lovecoding-field6-text-color' ); 21 delete_option( 'jlplg_lovecoding-field7-button-background-color' ); 22 delete_option( 'jlplg_lovecoding-field8-button-text-color' ); 23 delete_option( 'jlplg_lovecoding-field9-cookie-expire-time' ); 22 24 } 23 25 … … 25 27 26 28 function jlplg_lovecoding_delete_cookies() { 27 unset( $_COOKIE[' cookie-accepted'] );28 setcookie( sanitize_key( ' cookie-accepted' ), '', 1);29 unset( $_COOKIE['jlplg-cookies-accepted'] ); 30 setcookie( sanitize_key( 'jlplg-cookies-accepted' ), '', 1); 29 31 } 30 32
Note: See TracChangeset
for help on using the changeset viewer.