Changeset 3179828
- Timestamp:
- 11/01/2024 09:09:37 AM (17 months ago)
- Location:
- conzent/trunk
- Files:
-
- 3 edited
-
README.md (modified) (2 diffs)
-
conzent.php (modified) (16 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
conzent/trunk/README.md
r3172582 r3179828 6 6 Tested up to: 6.6 7 7 Requires PHP: 5.6 8 Stable tag: 1.0. 78 Stable tag: 1.0.9 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 177 177 178 178 == Changelog == 179 = 1.0.9 = 180 * Removed Outbound calling 181 182 = 1.0.8 = 183 * Fixed WP security 184 179 185 = 1.0.7 = 180 186 * Fixed WP escaping -
conzent/trunk/conzent.php
r3172582 r3179828 7 7 * Plugin URI: https://conzent.net/download/ 8 8 * Description: Conzent CMP WordPress Cookie Banner and Cookie Policy generator. IAB/TCF and Google CMP Certified - Comply with the major data protection laws (GDPR, ePrivacy, CCPA, LGPD, etc.) 9 * Version: 1.0. 79 * Version: 1.0.9 10 10 * Requires at least: 5.8 11 11 * Requires PHP: 7.3 … … 29 29 add_action('plugins_loaded', 'cnz_update_check'); 30 30 add_action('activated_plugin', 'cnz_save_activation_error'); 31 add_action('wp_body_open','add_cnz_gtm_after_body'); 31 add_action('wp_body_open','cnz_add_gtm_after_body'); 32 32 33 /** Conzent web app URL */ 33 34 if ( ! defined( 'CNZ_APP_URL' ) ) { … … 102 103 } 103 104 } 104 105 105 function cnz_callback($action) 106 106 { … … 121 121 function cnz_banner_register_hooks(){ 122 122 if (!is_admin()) { 123 add_action( 'wp_head',' add_cnz_js', - 9998 );124 add_action( 'wp_head',' add_cnz_gtm_js', - 9996 );125 } 126 } 127 function add_cnz_js(){123 add_action( 'wp_head','cnz_js', - 9998 ); 124 add_action( 'wp_head','cnz_gtm_js', - 9996 ); 125 } 126 } 127 function cnz_js(){ 128 128 $is_verified = get_option( 'conzent_verified'); 129 129 if($is_verified == 'yes'){ 130 echo __('<script id=\'conzentbanner\' data-consent=\'necessary\' type=\'text/javascript\' src=\''.CNZ_APP_URL.'/sites_data/'.get_option( 'conzent_website_key' ).'/script.js\'></script>','conzent'); 130 ?> 131 <script id='conzentbanner' data-consent='necessary' type='text/javascript' src='<?php echo esc_url(CNZ_APP_URL."/sites_data/".get_option( 'conzent_website_key' ));?>/script.js'></script> 132 <?php 131 133 } 132 134 } … … 146 148 } 147 149 function cnz_banner_setting() { 150 $setting_url= esc_url(admin_url('admin.php?page=cnz_banner_setting')); 151 $web_url = esc_url(CNZ_APP_URL); 152 $logo_url = plugin_dir_url(__FILE__).'conzent-logo.png'; 148 153 ?> 149 <div class="opt_welcome"><h2><img src="<?php echo esc_attr( plugin_dir_url(__FILE__) . 'conzent-logo.png');?>" height="35px" /> <?php echo esc_html__('Welcome to Conzent Banner','conzent');?></h2></div>154 <div class="opt_welcome"><h2><img src="<?php echo esc_attr($logo_url);?>" height="35px" /> <?php echo esc_html__('Welcome to Conzent Banner','conzent');?></h2></div> 150 155 <div class="opt_box_welcome"> 151 156 <div class="opt_item"> … … 156 161 <div class="opt_key"><?php echo esc_html__('Website Id :','conzent');?></div> 157 162 <div class="opt_val"> <?php echo esc_attr(get_option( 'conzent_site_id'));?></div> 158 </div> -->163 </div> 159 164 <div class="opt_item"> 160 165 <div class="opt_key"><?php echo esc_html__('Site Name:','conzent');?></div> … … 168 173 <div class="opt_key"><?php echo esc_html__('Status:','conzent');?></div> 169 174 <div class="opt_val"> <?php echo esc_attr(get_option( 'conzent_site_status') == 1 ? 'Active':'Inactive');?></div> 170 </div> 175 </div>--> 171 176 <div class="opt_item"> 172 177 <div class="opt_key"><?php echo esc_html__('Verified:','conzent');?></div> 173 178 <div class="opt_val"> <?php echo esc_attr(get_option( 'conzent_verified'));?></div> 174 179 </div> 175 <div style="margin:10px 0px;"><a href="<?php echo admin_url('admin.php?page=cnz_banner_setting')?>" class="cnz-btn"><?php echo esc_html__('Change Setting','conzent');?></a></div>176 <div style="margin-top:20px;margin-bottom:20x;"><a href="<?php echo esc_url(CNZ_APP_URL);?>" class="cnz-btn-normal"><?php echo esc_html__('All settings is done in the conzent.net/app','conzent');?></a></div>180 <div style="margin:10px 0px;"><a href="<?php echo $setting_url;?>" class="cnz-btn"><?php echo esc_html__('Change Setting','conzent');?></a></div> 181 <div style="margin-top:20px;margin-bottom:20x;"><a href="<?php echo $web_url;?>" class="cnz-btn-normal"><?php echo esc_html__('All settings is done in the conzent.net/app','conzent');?></a></div> 177 182 </div> 178 183 … … 188 193 if(!$is_admin){ 189 194 $redirect_url = admin_url('admin.php?page=conzent'); 190 echo __('<script>window.location = \''.esc_url($redirect_url).'\'</script>','conzent');195 wp_redirect(esc_url($redirect_url)); 191 196 exit; 192 197 } 193 $msg =''; 194 if(isset($_POST['action']) && $_POST['action']=='savesetting'){ 195 $site_info = cnz_verifyWebsite(wp_unslash($_POST['conzent_website_key'])); 198 $msg =''; 199 if ( isset( $_POST['savesetting_nonce'] ) && wp_verify_nonce( $_POST['savesetting_nonce'], 'savesetting' ) ) { 200 201 $site_info = cnz_verifyWebsite(sanitize_text_field($_POST['conzent_website_key'])); 196 202 $error_found = 0; 197 203 if(!empty($site_info) && array_key_exists("domain",$site_info)){ … … 205 211 } 206 212 else{ 213 update_option( 'conzent_website_key',$_POST['conzent_website_key'] ); 207 214 update_option( 'conzent_site_name', ''); 208 215 update_option( 'conzent_site_domain', ''); 209 update_option( 'conzent_site_status', ' ' );216 update_option( 'conzent_site_status', '1' ); 210 217 update_option( 'conzent_site_id', ''); 211 update_option( 'conzent_verified', ' no');212 update_option( 'conzent_error', ' Website Key not found');213 $error_found = 1;214 } 215 update_option('conzent-gtm-id', wp_unslash($_POST['conzent_gtm_id']));216 update_option('conzent-data-layer', wp_unslash($_POST['conzent_data_layer']));218 update_option( 'conzent_verified', 'yes'); 219 update_option( 'conzent_error', ''); 220 $error_found = 0; 221 } 222 update_option('conzent-gtm-id',sanitize_text_field($_POST['conzent_gtm_id'])); 223 update_option('conzent-data-layer',sanitize_text_field($_POST['conzent_data_layer'])); 217 224 if($error_found){ 218 225 $msg = esc_html__('Website Key not found','conzent'); … … 236 243 <div class="opt_welcome"><h2><img src="<?php echo plugin_dir_url(__FILE__) . 'conzent-logo.png';?>" height="35px" /> <?php echo esc_html__('Conzent Banner Setting','conzent');?></h2></div> 237 244 <div class="opt_box_setting"> 238 <div><?php if($msg){ echo __('<div class=\'cnz-'.$cnz_css_class.'\'>'.$msg.'</div>','conzent');}?></div>245 <div><?php if($msg){ echo '<div class=\'cnz-'.$cnz_css_class.'\'>'.$msg.'</div>';}?></div> 239 246 <form method="post" action="" name="frmsetting"> 240 247 <!--<div class="opt_item"> … … 271 278 <div class="action_box"> 272 279 <input type="hidden" name="action" value="savesetting" /> 280 <?php wp_nonce_field( 'savesetting', 'savesetting_nonce' ); ?> 273 281 <input type="submit" name="savesett" value="Save" class="cnz-btn"/> 274 282 </div> … … 277 285 </div> 278 286 <?php 279 }280 function cnz_get_siteinfo(){281 282 287 } 283 288 function cnz_banner_add_shortcode(){ … … 293 298 <div class="cnz-tracking-box"> 294 299 <div class="tracking-inner"> 295 <div class="cnz-label"> Conzent Consent ID</div>300 <div class="cnz-label">'.esc_html__('Conzent Consent ID','conzent').'</div> 296 301 <div class="cnz-val"><span id="conzentId"></span></div> 297 302 </div> … … 303 308 $api_url = esc_url(CNZ_APP_API_URL."/verify?website_id=".$website_id); 304 309 $response_obj = wp_remote_get($api_url); 305 310 306 311 $http_code = wp_remote_retrieve_response_code( $response_obj ); 307 312 308 313 if($http_code == 200){ 309 314 $items = json_decode(wp_remote_retrieve_body( $response_obj ),true); … … 311 316 return $items; 312 317 } 313 function add_cnz_gtm_after_body() {318 function cnz_add_gtm_after_body() { 314 319 if(get_option( 'conzent-gtm-id') && get_option( 'conzent_verified') == 'yes'){ 315 320 ?> … … 321 326 } 322 327 } 323 function add_cnz_gtm_js(){328 function cnz_gtm_js(){ 324 329 325 330 if ( empty( get_option( 'conzent-data-layer' ) ) ) { -
conzent/trunk/readme.txt
r3172582 r3179828 6 6 Tested up to: 6.6 7 7 Requires PHP: 5.6 8 Stable tag: 1.0. 78 Stable tag: 1.0.9 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 177 177 178 178 == Changelog == 179 = 1.0.9 = 180 * Removed Outbound calling 181 182 = 1.0.8 = 183 * Fixed WP security 184 179 185 = 1.0.7 = 180 186 * Fixed WP escaping
Note: See TracChangeset
for help on using the changeset viewer.