diff --git a/README.md b/README.md index 98e155a..3ed2ceb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,21 @@ ![assets/pdpa-consent-banner.png](assets/pdpa-consent-banner.png) This WordPress plugin help you to generate Thailand PDPA consent terms page and consent notification popup. -You can edit the term page and publish on your website with elegant and powerful solution. !!! No jquery need at all. +You can edit the term page and publish on your website with elegant and powerful solution. !!! No jquery need at all. + +### Code of conduct + +- ปลั๊กอินนี้จัดทำขึ้นเพื่อตอบสนองต่อการปฏิบัติตาม พ.ร.บ.คุ้มครองข้อมูลส่วนบุคคล 2562 (PDPA) ของประเทศไทย +- ปลั๊กอินนี้จัดทำขึ้นเพื่อแจกฟรี +- ปลั๊กอินไม่มีความประสงค์ที่จะจัดเก็บค่าใช้งานแต่อย่างใด +- ปลั๊กอินไม่ได้รับประกันในด้านความปลอดภัยต่อข้อมูล +- ปลั๊กอินไม่ได้ป้องกันการฟ้องร้องที่อาจเกิดขึ้นโดยคู่กรณีได้ +- ผู้ใช้งานปลั๊กอินเป็นผู้รับผิดชอบและตัดสินใจต่อการใช้และรักษาความปลอดภัยของข้อมูล +- ปลั๊กอินไม่ได้เป็นผู้ประมวลผลข้อมูลหรือใช้ข้อมูลส่วนบุคคล +- ปลั๊กอินไม่ได้เป็นผู้บล็อคการทำงานส่วนหนึ่งส่วนใดของเว็บไซต์ +- ปลั๊กอินจะมีการปรับปรุงเงื่อนไข PDPA ให้รัดกุมมากขึ้นเสมอ +- การบริจาคมิใช่เพื่อเป็นสิ่งแลกเปลี่ยนในการใช้งานปลั๊กอิน PDPA Consent + ### Download new release -> [Release page is here.](https://github.com/iamapinan/PDPA-Consent/releases) @@ -14,21 +28,34 @@ You can edit the term page and publish on your website with elegant and powerful ### Features * Customizable message * Identity setup -* User data list * Popup placement * Consent page generate -* Custom CSS +* CSS Class for developer +* Dark mode +* Button color config * Support WP Super Cache (idea from Cookie Notice plugin) * Save user action to database * Display user PDPA Status on user list +* Responsive * Multi language support (Thai, English) more translate is accept ### Roadmap -* Allow user to request profile data. -* Allow user to request to delete account. -* Allow user to allow consent again. -* User page. +* หน้าจัดการข้อมูลของผู้ใช้ +* ผู้ใช้สามารถขอถ่ายโอนข้อมูลได้ +* ผู้ใช้สามารถ ลบหรือขอให้ลบข้อมูลได้ ขึ้นกับนโยบาย +* ผู้ใช้สามารถเลือกการยินยอมใหม่ได้ +* ผู้ใช้สามารถ แก้ไข/ขอให้แก้ไข ข้อมูลที่ยินยอมได้ +* ผู้ใช้สามารถเลือกประเภทข้อมูลที่ยินยอมและไม่ยินยอมได้ +* แบ่งประเภทข้อมูลพื้นฐาน, ข้อมูลละเอียดอ่อน, ข้อมูลทางอ้อม +* เพิ่มเรื่อง การจัดเก็บข้อมูลแต่ละประเภท +* เพิ่มเรื่อง การเผยแพร่ข้อมูลผ่าน API หรือไม่ +* เพิ่มเรื่อง การส่งข้อมูลไปต่างประเทศ หรือไม่ +* เพิ่ม Wizard การตั้งค่า +* ให้ผู้ใช้ต้องติ๊กถูกก่อนคลิกยินยอม โดยค่าเริ่มต้นคือไม่ติ๊ก +* บันทึกประวัติการ ยินยอม/ไม่ยินยอม ย้อนหลัง +* API สำหรับขอความยินยอมเป็นครั้งคราว +* Server อยู่ในต่างประเทศหรือไม่ ### Contributors. - **Apinan Woratrakun** *as developer* , , @@ -37,4 +64,15 @@ You can edit the term page and publish on your website with elegant and powerful [GNU 3.0 License](https://opensource.org/licenses/lgpl-3.0.html0) ### Special Thank -* Thai Programmer Association \ No newline at end of file +* Thai Programmer Association +* WordPress Bangkok friends + +### Changelogs + +#### 1.0.2 +* Add dark mode +* Button color +* Use page id as privacy page url link +* List of css class for developer +* Remove custom css for security reason +* Fix security and code style diff --git a/assets/pdpa-consent-user.css b/assets/pdpa-consent-user.css new file mode 100644 index 0000000..a49df95 --- /dev/null +++ b/assets/pdpa-consent-user.css @@ -0,0 +1,59 @@ +/** +* User privacy page style +*/ +.pdpa_user_warp { + display: flex; + flex-direction: column; +} +.pdpa_user_warp .user_toolbar { + justify-content: center; + flex-direction: row; + display: flex; +} +.pdpa_user_warp button { + padding: 10px 25px; + border-radius: 30px; + font-size: 16px; + margin: 3px; +} +.pdpa_user_warp .profile-header-top { + display: flex; + justify-content: flex-start; + flex-direction: row; + background: rgb(170,34,195); + background: linear-gradient(0deg, rgba(170,34,195,1) 0%, rgba(253,45,121,1) 100%); + height: 150px; + padding: 10px; + margin-bottom: 25px; + margin-top: 25px; + border-radius: 8px; +} + +.pdpa_user_warp .profile-header-top img { + border-radius: 50%; + width: 96px; + height: 96px; + margin-top: 20px; + margin-left: 20px; +} + +.pdpa_user_warp .profile-header-top .user_title { + display: flex; + flex-direction: column; + justify-content: flex-start; + padding-left: 25px; +} +.profile-header-top .user_title h3{ + margin-bottom: 10px; + color: #fff; +} +.profile-header-top .user_title p { + color: rgb(255, 236, 221); + font-size: 0.8em; +} +.profile-header-top .user_title span { + vertical-align: middle; +} +.profile-header-top .user_title .status_bage { + color: #fff; +} diff --git a/assets/pdpa-consent-user.js b/assets/pdpa-consent-user.js new file mode 100644 index 0000000..c53e62b --- /dev/null +++ b/assets/pdpa-consent-user.js @@ -0,0 +1,3 @@ +(()=>{ + +}) \ No newline at end of file diff --git a/assets/pdpa-consent-user.min.css b/assets/pdpa-consent-user.min.css new file mode 100644 index 0000000..80a35cb --- /dev/null +++ b/assets/pdpa-consent-user.min.css @@ -0,0 +1 @@ +.pdpa_user_warp{display:flex;flex-direction:column}.pdpa_user_warp button{padding:10px 25px;border-radius:30px;font-size:16px}.pdpa_user_warp .profile-header-top{display:flex;justify-content:flex-start;flex-direction:row;background:#aa22c3;background:linear-gradient(0deg,rgba(170,34,195,1) 0,rgba(253,45,121,1) 100%);height:150px;padding:10px;margin-bottom:25px;margin-top:25px;border-radius:8px}.pdpa_user_warp .profile-header-top img{border-radius:50%;width:96px;height:96px;margin-top:20px;margin-left:20px}.pdpa_user_warp .profile-header-top .user_title{display:flex;flex-direction:column;justify-content:flex-start;padding-left:25px}.pdpa_user_warp .profile-header-top .user_title h3{margin-bottom:10px;color:#fff}.pdpa_user_warp .profile-header-top .user_title p{color:#fff} \ No newline at end of file diff --git a/assets/pdpa-consent-user.min.js b/assets/pdpa-consent-user.min.js new file mode 100644 index 0000000..c53e62b --- /dev/null +++ b/assets/pdpa-consent-user.min.js @@ -0,0 +1,3 @@ +(()=>{ + +}) \ No newline at end of file diff --git a/assets/pdpa-consent.css b/assets/pdpa-consent.css index 7f7d93e..12ad166 100644 --- a/assets/pdpa-consent.css +++ b/assets/pdpa-consent.css @@ -1,4 +1,3 @@ - .pdpa-consent-wrap { padding: 15px; background-color: #ffffff; @@ -8,6 +7,7 @@ justify-content: center; flex-direction: column; } + .pdpa-place-top { position: fixed; z-index: 99999; @@ -15,6 +15,7 @@ left: 0; width: 100%; } + .pdpa-place-bottom { position: fixed; z-index: 9999; @@ -22,6 +23,7 @@ left: 0; width: 100%; } + .pdpa-place-center { position: fixed; z-index: 999; @@ -29,36 +31,47 @@ top: 50%; transform: translate(-50%, -50%); max-width: 100vh; - box-shadow: 3px 3px 50px rgba(3,3,3,0.25); + box-shadow: 3px 3px 50px rgba(3, 3, 3, 0.25); border-radius: 6px; } + .pdpa-darkmode { background-color: #272727 !important; } -.pdpa-darkmode .pdpa-consent-text, .pdpa-darkmode a { + +.pdpa-darkmode .pdpa-consent-text, +.pdpa-darkmode a { color: #fff !important; } + .pdpa-consent-text { margin-bottom: 10px; font-size: 14px; } -.pdpa-consent-allow-button, .pdpa-consent-not-allow-button { + +.pdpa-consent-allow-button, +.pdpa-consent-not-allow-button { padding: 8px 15px; font-size: 14px; border-radius: 15px; margin-inline: 5px; } -.pdpa-consent-allow-button:hover, .pdpa-consent-not-allow-button:hover { + +.pdpa-consent-allow-button:hover, +.pdpa-consent-not-allow-button:hover { opacity: 0.8; } + .pdpa-consent-allow-button { background-color: #355eb8; color: #fff; } + .pdpa-consent-not-allow-button { background-color: #d4304c; color: #fff; } + /** Tablet **/ @media (max-width: 1023px) { .pdpa-place-center { @@ -68,7 +81,7 @@ top: 50%; transform: translate(-50%, -50%); width: 100%; - box-shadow: 3px 3px 50px rgba(3,3,3,0.25); + box-shadow: 3px 3px 50px rgba(3, 3, 3, 0.25); border-radius: 6px; } } @@ -82,7 +95,7 @@ top: 50%; transform: translate(-50%, -50%); width: 100%; - box-shadow: 3px 3px 50px rgba(3,3,3,0.25); + box-shadow: 3px 3px 50px rgba(3, 3, 3, 0.25); border-radius: 6px; } -} +} \ No newline at end of file diff --git a/assets/pdpa-consent.js b/assets/pdpa-consent.js index 29e09ca..08db43c 100644 --- a/assets/pdpa-consent.js +++ b/assets/pdpa-consent.js @@ -3,17 +3,17 @@ * (c) Apinan Woratrakun */ console.log(pdpa_ajax.consent_enable) -if(pdpa_ajax.consent_enable == 'yes') { -document.addEventListener("DOMContentLoaded", function() { +if (pdpa_ajax.consent_enable == 'yes') { + document.addEventListener("DOMContentLoaded", function () { var allow_button = document.getElementById("PDPAAllow") var not_allow_button = document.getElementById("PDPANotAllow") var consent_win = document.getElementById("pdpa_screen") - + not_allow_button.addEventListener("click", () => { pdpa_ajax_call('pdpa-not-allow'); consent_win.style.display = 'none' }); - + allow_button.addEventListener("click", () => { pdpa_ajax_call('pdpa-allow'); consent_win.style.display = 'none' @@ -23,7 +23,7 @@ document.addEventListener("DOMContentLoaded", function() { const pdpa_ajax_call = (action_require) => { var xhr = new XMLHttpRequest(); - var fd = new FormData(); + var fd = new FormData(); xhr.open("POST", pdpa_ajax.ajax_url, true); xhr.onreadystatechange = function () { @@ -33,18 +33,18 @@ const pdpa_ajax_call = (action_require) => { } }; - fd.append( "action", "pdpa_action" ); - fd.append( "set_status", action_require ); - fd.append( "security", pdpa_ajax.pdpa_nonce ); + fd.append("action", "pdpa_action"); + fd.append("set_status", action_require); + fd.append("security", pdpa_ajax.pdpa_nonce); xhr.send(fd); } -const cookie_process = ( $d ) => { +const cookie_process = ($d) => { var cookie_string = ''; - if($d.type == 'user_allow') { - cookie_string = $d.cookie_name+"=1; expires="+$d.cookie_expire+"; domain="+$d.cookie_domain+"; path=/"; - }else if($d.type == 'user_not_allow') { - cookie_string = $d.cookie_name+"=0; expires="+$d.cookie_expire+"; domain="+$d.cookie_domain+"; path=/"; + if ($d.type == 'user_allow') { + cookie_string = $d.cookie_name + "=1; expires=" + $d.cookie_expire + "; domain=" + $d.cookie_domain + "; path=/"; + } else if ($d.type == 'user_not_allow') { + cookie_string = $d.cookie_name + "=0; expires=" + $d.cookie_expire + "; domain=" + $d.cookie_domain + "; path=/"; } else { console.log("error.") } diff --git a/admin.php b/includes/admin.php similarity index 63% rename from admin.php rename to includes/admin.php index 75b5302..8dd3aa1 100644 --- a/admin.php +++ b/includes/admin.php @@ -1,14 +1,17 @@ */ -if ( ! defined( 'ABSPATH' ) ) exit; +if (! defined('ABSPATH')) { + exit; +} -Class pdpa_consent_admin_option { +class pdpa_consent_admin_option +{ private $plugin_info = array(); private $capability = 'manage_options'; private $options; @@ -16,18 +19,20 @@ private $page_id; private $page_name; - public function __construct() { - $this->plugin_info = get_plugin_data( PDPA_PATH . 'pdpa-consent.php' ); + public function __construct() + { + $this->plugin_info = get_plugin_data(PDPA_PATH . 'pdpa-consent.php'); $this->locale = get_locale(); $this->page_id = get_option('pdpa-consent-page-id') ? get_option('pdpa-consent-page-id') : 0; $this->page_name = __('pdpa-term', 'pdpa-consent'); - add_action( 'admin_menu', array($this, 'pdpa_admin_menu') ); - add_action( 'admin_init', array($this, 'admin_option_setup') ); - add_action( 'admin_enqueue_scripts', array( $this, 'pdpa_enqueue_color_picker' ) ); + add_action('admin_menu', array($this, 'pdpa_admin_menu')); + add_action('admin_init', array($this, 'admin_option_setup')); + add_action('admin_enqueue_scripts', array( $this, 'pdpa_enqueue_color_picker' )); } - private function serialize_html($html, $settings = [ 'website_name' => '', 'site_description' => '', 'list_data' => '', 'site_address' => '', 'site_contact' => '', 'site_email' => '' ]) { - $settings['list_data'] = str_replace("\n", "
  • ", esc_html($settings['list_data']) ); + private function serialize_html($html, $settings = [ 'website_name' => '', 'site_description' => '', 'list_data' => '', 'site_address' => '', 'site_contact' => '', 'site_email' => '' ]) + { + $settings['list_data'] = str_replace("\n", "
  • ", esc_html($settings['list_data'])); $html = str_replace('[service]', esc_html($settings['website_name']), $html); $html = str_replace('[description]', esc_attr($settings['site_description']), $html); $html = str_replace('[list_data]', $settings['list_data'], $html); @@ -37,12 +42,13 @@ private function serialize_html($html, $settings = [ 'website_name' => '', 'site return $html; } - public function generate_post_from_template() { - $this->options = get_option( '_option_name' ); - if(file_exists(PDPA_PATH . 'template/'.$this->locale.'.html')) { - $content = $this->serialize_html( file_get_contents( PDPA_PATH . 'template/'.$this->locale.'.html'), $this->options ); + public function generate_post_from_template() + { + $this->options = get_option('_option_name'); + if (file_exists(PDPA_PATH . 'templates/' . $this->locale . '.html')) { + $content = $this->serialize_html(file_get_contents(PDPA_PATH . 'templates/'. $this->locale .'.html'), $this->options); } else { - $content = $this->serialize_html( file_get_contents( PDPA_PATH . 'template/th_TH.html'), $this->options ); + $content = $this->serialize_html(file_get_contents(PDPA_PATH . 'templates/th_TH.html'), $this->options); } $page_details = array( @@ -55,47 +61,60 @@ public function generate_post_from_template() { 'post_type' => 'page' ); - $page_id = wp_insert_post( $page_details ); - add_option( 'pdpa-consent-page-id', $page_id ); + $page_id = wp_insert_post($page_details); + add_option('pdpa-consent-page-id', $page_id); } - function pdpa_admin_menu() { - add_menu_page( $this->plugin_info['Name'], __('PDPA Consent', 'pdpa-consent'), $this->capability, $this->plugin_info['TextDomain'], array($this, 'pdpa_admin_option'), 'dashicons-shield-alt', 81 ); + public function pdpa_admin_menu() + { + add_menu_page($this->plugin_info['Name'], __('PDPA Consent', 'pdpa-consent'), $this->capability, $this->plugin_info['TextDomain'], array($this, 'pdpa_admin_option'), 'dashicons-shield-alt', 81); } - function pdpa_enqueue_color_picker( $hook_suffix ) { - wp_enqueue_style( 'wp-color-picker' ); - wp_enqueue_script( 'pdpa-script', plugins_url('assets/pdpa-admin-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); + public function pdpa_enqueue_color_picker($hook_suffix) + { + wp_enqueue_style('wp-color-picker'); + wp_enqueue_script('pdpa-script', plugins_url('pdpa-consent/assets/pdpa-admin-script.js'), array( 'wp-color-picker' ), false, true); } - function pdpa_admin_option() { - - if(isset($_POST)) { + public function pdpa_admin_option() + { + if (isset($_POST)) { $this->generate_post_from_template(); - } - ?> - + } ?> + +
    - - +
    -

    Development by plugin_info['Author'];?>

    +

    Version: plugin_info['Version']; ?>, Development by plugin_info['Author']; ?>

    options = get_option( '_option_name' ); + public function _section_fields() + { + $this->options = get_option('_option_name'); - if($this->page_id !== 0) { + if ($this->page_id !== 0) { add_settings_field( '_url_', // id - __( 'Privacy page','pdpa-consent' ), // title + __('Privacy page', 'pdpa-consent'), // title array( $this, 'url_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section @@ -125,7 +144,7 @@ public function _section_fields() { add_settings_field( 'is_enable', // id - __( 'Enable consent noti','pdpa-consent' ), // title + __('Enable consent noti', 'pdpa-consent'), // title array( $this, 'is_enable_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section @@ -159,208 +178,226 @@ public function _section_fields() { add_settings_field( 'is_darkmode', // id - __( 'Use dark theme','pdpa-consent' ), // title + __('Use dark theme', 'pdpa-consent'), // title array( $this, 'is_darkmode_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'allow_button_color', // id - __( 'Allow button color','pdpa-consent' ), // title + __('Allow button color', 'pdpa-consent'), // title array( $this, 'allow_button_color_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'not_allow_button_color', // id - __( 'Not allow button color','pdpa-consent' ), // title + __('Not allow button color', 'pdpa-consent'), // title array( $this, 'not_allow_button_color_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'popup_type', // id - __( 'Notification popup type','pdpa-consent' ), // title + __('Notification popup type', 'pdpa-consent'), // title array( $this, 'popup_type_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'popup_message', // id - __( 'Popup message','pdpa-consent' ), // title + __('Popup message', 'pdpa-consent'), // title array( $this, 'popup_message_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'website_name', // id - __( 'Website name (*)','pdpa-consent' ), // title + __('Website name (*)', 'pdpa-consent'), // title array( $this, 'website_name_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'site_description', // id - __( 'Web description','pdpa-consent' ), // title + __('Web description', 'pdpa-consent'), // title array( $this, 'description_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'list_data', // id - __( 'List of user data (*)
    (one data set per line)','pdpa-consent' ), // title + __('List of user data (*)
    (one data set per line)', 'pdpa-consent'), // title array( $this, 'list_data_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'site_address', // id - __( 'Address (*)','pdpa-consent' ), // title + __('Address (*)', 'pdpa-consent'), // title array( $this, 'address_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'site_contact', // id - __( 'Contact','pdpa-consent' ), // title + __('Contact', 'pdpa-consent'), // title array( $this, 'contact_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'site_email', // id - __( 'Email (*)','pdpa-consent' ), // title + __('Email (*)', 'pdpa-consent'), // title array( $this, 'email_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); add_settings_field( 'custom_css', // id - __( 'CSS Class','pdpa-consent' ), // title + __('CSS Class', 'pdpa-consent'), // title array( $this, 'custom_css_callback' ), // callback 'settings', // page '_pdpa_setting_section' // section ); } - function url_callback() { + public function url_callback() + { printf( - '%s ' , + '%s ', $this->page_id, esc_url(get_site_url().'/?p='.$this->page_id), esc_url(get_admin_url().'post.php?post='.get_option('pdpa-consent-page-id').'&action=edit') ); } - function is_enable_callback() { + public function is_enable_callback() + { printf( - '' , + '', $this->options['is_enable'] == true ? 'checked' : '' ); } - function allow_user_reset_callback() { + public function allow_user_reset_callback() + { printf( - '' , + '', $this->options['allow_user_reset'] == true ? 'checked' : '' ); } - function allow_user_delete_callback() { + public function allow_user_delete_callback() + { printf( - '' , + '', $this->options['allow_user_delete'] == true ? 'checked' : '' ); } - function allow_user_download_callback() { + public function allow_user_download_callback() + { printf( - '' , + '', $this->options['allow_user_download'] == true ? 'checked' : '' ); } - function is_darkmode_callback() { + public function is_darkmode_callback() + { printf( - '' , + '', $this->options['is_darkmode'] == true ? 'checked' : '' ); } - function allow_button_color_callback() { + public function allow_button_color_callback() + { printf( - '' , + '', $this->options['allow_button_color'] ); } - function not_allow_button_color_callback() { + public function not_allow_button_color_callback() + { printf( - '' , + '', $this->options['not_allow_button_color'] ); } - function popup_type_callback() { + public function popup_type_callback() + { ?> %s' , - isset( $this->options['popup_message'] ) ? esc_html( $this->options['popup_message']) : __('Your privacy is important to us. We need your data just for the important process of services. Please allow if you accept the term of privacy comply with PDPA.', 'pdpa-consent') + '', + isset($this->options['popup_message']) ? esc_html($this->options['popup_message']) : __('Your privacy is important to us. We need your data just for the important process of services. Please allow if you accept the term of privacy comply with PDPA.', 'pdpa-consent') ); } - function website_name_callback() { + public function website_name_callback() + { printf( - '' , - isset( $this->options['website_name'] ) ? esc_html( $this->options['website_name']) : '', + '', + isset($this->options['website_name']) ? esc_html($this->options['website_name']) : '', __('Your website name or Company name', 'pdpa-consent') ); } - function description_callback() { + public function description_callback() + { printf( - '' , - isset( $this->options['site_description'] ) ? esc_html( $this->options['site_description']) : '' + '', + isset($this->options['site_description']) ? esc_html($this->options['site_description']) : '' ); } - function list_data_callback() { + public function list_data_callback() + { printf( - '' , + '', __("Fullname\nBirthday\nEtc."), - isset( $this->options['list_data'] ) ? esc_html( $this->options['list_data']) : '' + isset($this->options['list_data']) ? esc_html($this->options['list_data']) : '' ); } - function address_callback() { + public function address_callback() + { printf( - '' , - isset( $this->options['site_address'] ) ? esc_html( $this->options['site_address']) : '' + '', + isset($this->options['site_address']) ? esc_html($this->options['site_address']) : '' ); } - function contact_callback() { + public function contact_callback() + { printf( - '' , - isset( $this->options['site_contact'] ) ? esc_html( $this->options['site_contact']) : '', + '', + isset($this->options['site_contact']) ? esc_html($this->options['site_contact']) : '', __("Such as John Doe (081-111-1111)", 'pdpa-consent') ); } - function email_callback() { + public function email_callback() + { printf( - '' , - isset( $this->options['site_email'] ) ? esc_html( $this->options['site_email']) : '' + '', + isset($this->options['site_email']) ? sanitize_email($this->options['site_email']) : '' ); } - function custom_css_callback() { + public function custom_css_callback() + { ?>