Plugin Directory

Changeset 3179828


Ignore:
Timestamp:
11/01/2024 09:09:37 AM (17 months ago)
Author:
conzent
Message:

Updated 1.0.9 - removed outbound call

Location:
conzent/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • conzent/trunk/README.md

    r3172582 r3179828  
    66Tested up to: 6.6
    77Requires PHP: 5.6
    8 Stable tag: 1.0.7
     8Stable tag: 1.0.9
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    177177
    178178== Changelog ==
     179= 1.0.9 =
     180* Removed Outbound calling
     181
     182= 1.0.8 =
     183* Fixed WP security
     184
    179185= 1.0.7 =
    180186* Fixed WP escaping
  • conzent/trunk/conzent.php

    r3172582 r3179828  
    77* Plugin URI: https://conzent.net/download/
    88* 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.7
     9* Version: 1.0.9
    1010* Requires at least: 5.8
    1111* Requires PHP: 7.3
     
    2929add_action('plugins_loaded', 'cnz_update_check');
    3030add_action('activated_plugin', 'cnz_save_activation_error');
    31 add_action('wp_body_open','add_cnz_gtm_after_body');
     31add_action('wp_body_open','cnz_add_gtm_after_body');
     32 
    3233/** Conzent web app URL */
    3334if ( ! defined( 'CNZ_APP_URL' ) ) {
     
    102103    }
    103104}
    104 
    105105function cnz_callback($action)
    106106{
     
    121121function cnz_banner_register_hooks(){
    122122    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}
     127function cnz_js(){
    128128    $is_verified = get_option( 'conzent_verified');
    129129    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
    131133    }
    132134}
     
    146148}
    147149function 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';
    148153    ?>
    149     <div class="opt_welcome"><h2><img src="<?php echo esc_attr(plugin_dir_url(__FILE__) . 'conzent-logo.png');?>" height="35px" />&nbsp;<?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" />&nbsp;<?php echo esc_html__('Welcome to Conzent Banner','conzent');?></h2></div>
    150155    <div class="opt_box_welcome">
    151156    <div class="opt_item">
     
    156161        <div class="opt_key"><?php echo esc_html__('Website Id :','conzent');?></div>
    157162        <div class="opt_val"> <?php echo esc_attr(get_option( 'conzent_site_id'));?></div>
    158     </div>-->
     163    </div>
    159164    <div class="opt_item">
    160165        <div class="opt_key"><?php echo esc_html__('Site Name:','conzent');?></div>
     
    168173        <div class="opt_key"><?php echo esc_html__('Status:','conzent');?></div>
    169174        <div class="opt_val"> <?php echo esc_attr(get_option( 'conzent_site_status') == 1 ? 'Active':'Inactive');?></div>
    170     </div>
     175    </div>-->
    171176    <div class="opt_item">
    172177        <div class="opt_key"><?php echo esc_html__('Verified:','conzent');?></div>
    173178        <div class="opt_val"> <?php echo esc_attr(get_option( 'conzent_verified'));?></div>
    174179    </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>
    177182    </div>
    178183   
     
    188193    if(!$is_admin){
    189194        $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));
    191196        exit;
    192197    }
    193 $msg ='';   
    194 if(isset($_POST['action']) && $_POST['action']=='savesetting'){
    195     $site_info = cnz_verifyWebsite(wp_unslash($_POST['conzent_website_key']));
     198$msg ='';
     199if ( isset( $_POST['savesetting_nonce'] ) && wp_verify_nonce( $_POST['savesetting_nonce'], 'savesetting' ) ) { 
     200   
     201    $site_info = cnz_verifyWebsite(sanitize_text_field($_POST['conzent_website_key']));
    196202    $error_found = 0;
    197203      if(!empty($site_info) && array_key_exists("domain",$site_info)){
     
    205211    }
    206212    else{
     213        update_option( 'conzent_website_key',$_POST['conzent_website_key'] );
    207214        update_option( 'conzent_site_name', '');
    208215        update_option( 'conzent_site_domain', '');
    209         update_option( 'conzent_site_status', '' );
     216        update_option( 'conzent_site_status', '1' );
    210217        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']));
    217224    if($error_found){
    218225        $msg = esc_html__('Website Key not found','conzent');
     
    236243    <div class="opt_welcome"><h2><img src="<?php echo plugin_dir_url(__FILE__) . 'conzent-logo.png';?>" height="35px" />&nbsp;<?php echo esc_html__('Conzent Banner Setting','conzent');?></h2></div>
    237244    <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>
    239246        <form method="post" action="" name="frmsetting">
    240247        <!--<div class="opt_item">
     
    271278          <div class="action_box">
    272279            <input type="hidden" name="action" value="savesetting" />
     280            <?php wp_nonce_field( 'savesetting', 'savesetting_nonce' ); ?>
    273281            <input type="submit" name="savesett" value="Save" class="cnz-btn"/>
    274282          </div>
     
    277285    </div>
    278286<?php
    279 }
    280 function cnz_get_siteinfo(){
    281    
    282287}
    283288function cnz_banner_add_shortcode(){
     
    293298    <div class="cnz-tracking-box">
    294299        <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>
    296301            <div class="cnz-val"><span id="conzentId"></span></div>
    297302        </div>
     
    303308    $api_url = esc_url(CNZ_APP_API_URL."/verify?website_id=".$website_id);
    304309    $response_obj = wp_remote_get($api_url);
    305    
     310   
    306311    $http_code = wp_remote_retrieve_response_code( $response_obj );
    307    
     312
    308313    if($http_code == 200){
    309314        $items = json_decode(wp_remote_retrieve_body( $response_obj ),true);
     
    311316    return $items;
    312317}
    313 function add_cnz_gtm_after_body() {
     318function cnz_add_gtm_after_body() {
    314319  if(get_option( 'conzent-gtm-id') && get_option( 'conzent_verified') == 'yes'){
    315320  ?>
     
    321326  }
    322327}
    323 function add_cnz_gtm_js(){
     328function cnz_gtm_js(){
    324329
    325330    if ( empty( get_option( 'conzent-data-layer' ) ) ) {
  • conzent/trunk/readme.txt

    r3172582 r3179828  
    66Tested up to: 6.6
    77Requires PHP: 5.6
    8 Stable tag: 1.0.7
     8Stable tag: 1.0.9
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    177177
    178178== Changelog ==
     179= 1.0.9 =
     180* Removed Outbound calling
     181
     182= 1.0.8 =
     183* Fixed WP security
     184
    179185= 1.0.7 =
    180186* Fixed WP escaping
Note: See TracChangeset for help on using the changeset viewer.