Skip to content

Commit

Permalink
update 1.0.4 fix conflict with woo-line-notify
Browse files Browse the repository at this point in the history
  • Loading branch information
Apinan Woratrakun authored and Apinan Woratrakun committed May 15, 2020
1 parent 293d0bc commit e4a6bf1
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 33 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -53,7 +53,7 @@ You can edit the term page and publish on your website with elegant and powerful
* เพิ่มเรื่อง การส่งข้อมูลไปต่างประเทศ หรือไม่
* เพิ่ม Wizard การตั้งค่า
* ให้ผู้ใช้ต้องติ๊กถูกก่อนคลิกยินยอม โดยค่าเริ่มต้นคือไม่ติ๊ก
* บันทึกประวัติการ ยินยอม/ไม่ยินยอม ย้อนหลัง
* บันทึกประวัติการ ยินยอม/ไม่ยินยอม ใหม่ได้
* API สำหรับขอความยินยอมเป็นครั้งคราว
* Server อยู่ในต่างประเทศหรือไม่

Expand All @@ -69,6 +69,9 @@ You can edit the term page and publish on your website with elegant and powerful

### Changelogs

#### 1.0.4
* Fix conflict with woo-line-notify plugin

#### 1.0.3
* First store release
* Fixed security issue
Expand Down
1 change: 0 additions & 1 deletion assets/pdpa-consent.js
Expand Up @@ -2,7 +2,6 @@
* Package: pdpa-consent
* (c) Apinan Woratrakun <iamapinan@gmail.com>
*/
console.log(pdpa_ajax.consent_enable)
if (pdpa_ajax.consent_enable == 'yes') {
document.addEventListener("DOMContentLoaded", function () {
var allow_button = document.getElementById("PDPAAllow")
Expand Down
2 changes: 1 addition & 1 deletion assets/pdpa-consent.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions includes/admin.php
Expand Up @@ -44,7 +44,7 @@ private function serialize_html($html, $settings = [ 'website_name' => '', 'site

public function generate_post_from_template()
{
$this->options = get_option('_option_name');
$this->options = get_option('pdpa_option');
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 {
Expand Down Expand Up @@ -117,7 +117,7 @@ public function admin_option_setup()
{
register_setting(
'_pdpa_setting_group', // option_group
'_option_name' // option_name
'pdpa_option' // option_name
);

add_settings_section(
Expand All @@ -130,7 +130,7 @@ public function admin_option_setup()

public function _section_fields()
{
$this->options = get_option('_option_name');
$this->options = get_option('pdpa_option');

if ($this->page_id !== 0) {
add_settings_field(
Expand Down Expand Up @@ -274,56 +274,56 @@ public function url_callback()
public function is_enable_callback()
{
printf(
'<input type="checkbox" name="_option_name[is_enable]" id="is_enable" value="1" %s>',
'<input type="checkbox" name="pdpa_option[is_enable]" id="is_enable" value="1" %s>',
$this->options['is_enable'] == true ? 'checked' : ''
);
}
public function allow_user_reset_callback()
{
printf(
'<input type="checkbox" name="_option_name[allow_user_reset]" id="allow_user_reset" value="1" %s>',
'<input type="checkbox" name="pdpa_option[allow_user_reset]" id="allow_user_reset" value="1" %s>',
$this->options['allow_user_reset'] == true ? 'checked' : ''
);
}
public function allow_user_delete_callback()
{
printf(
'<input type="checkbox" name="_option_name[allow_user_delete]" id="allow_user_delete" value="1" %s>',
'<input type="checkbox" name="pdpa_option[allow_user_delete]" id="allow_user_delete" value="1" %s>',
$this->options['allow_user_delete'] == true ? 'checked' : ''
);
}
public function allow_user_download_callback()
{
printf(
'<input type="checkbox" name="_option_name[allow_user_download]" id="allow_user_download" value="1" %s>',
'<input type="checkbox" name="pdpa_option[allow_user_download]" id="allow_user_download" value="1" %s>',
$this->options['allow_user_download'] == true ? 'checked' : ''
);
}
public function is_darkmode_callback()
{
printf(
'<input type="checkbox" name="_option_name[is_darkmode]" id="is_enable" value="1" %s>',
'<input type="checkbox" name="pdpa_option[is_darkmode]" id="is_enable" value="1" %s>',
$this->options['is_darkmode'] == true ? 'checked' : ''
);
}
public function allow_button_color_callback()
{
printf(
'<input type="text" name="_option_name[allow_button_color]" id="allow_button_color" value="%s" class="pdpa-color-picker">',
'<input type="text" name="pdpa_option[allow_button_color]" id="allow_button_color" value="%s" class="pdpa-color-picker">',
$this->options['allow_button_color']
);
}
public function not_allow_button_color_callback()
{
printf(
'<input type="text" name="_option_name[not_allow_button_color]" id="not_allow_button_color" value="%s" class="pdpa-color-picker">',
'<input type="text" name="pdpa_option[not_allow_button_color]" id="not_allow_button_color" value="%s" class="pdpa-color-picker">',
$this->options['not_allow_button_color']
);
}
public function popup_type_callback()
{
?>
<select name="_option_name[popup_type]">
<select name="pdpa_option[popup_type]">
<option value="top" <?php echo $this->options['popup_type'] == 'top' ? 'selected' : ''; ?>><?php _e('Top bar', 'pdpa-consent'); ?></option>
<option value="center" <?php echo $this->options['popup_type'] == 'center' ? 'selected' : ''; ?>><?php _e('Center popup', 'pdpa-consent'); ?></option>
<option value="bottom" <?php echo $this->options['popup_type'] == 'bottom' ? 'selected' : ''; ?>><?php _e('Bottom bar', 'pdpa-consent'); ?></option>
Expand All @@ -334,15 +334,15 @@ public function popup_type_callback()
public function popup_message_callback()
{
printf(
'<textarea class="regular-text" rows=4 name="_option_name[popup_message]" id="popup_message" required>%s</textarea>',
'<textarea class="regular-text" rows=4 name="pdpa_option[popup_message]" id="popup_message" required>%s</textarea>',
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')
);
}

public function website_name_callback()
{
printf(
'<input class="regular-text" type="text" name="_option_name[website_name]" id="website_name" value="%s" placeholder="%s" required>',
'<input class="regular-text" type="text" name="pdpa_option[website_name]" id="website_name" value="%s" placeholder="%s" required>',
isset($this->options['website_name']) ? esc_html($this->options['website_name']) : '',
__('Your website name or Company name', 'pdpa-consent')
);
Expand All @@ -351,15 +351,15 @@ public function website_name_callback()
public function description_callback()
{
printf(
'<input class="regular-text" type="text" name="_option_name[site_description]" id="site_description" value="%s">',
'<input class="regular-text" type="text" name="pdpa_option[site_description]" id="site_description" value="%s">',
isset($this->options['site_description']) ? esc_html($this->options['site_description']) : ''
);
}

public function list_data_callback()
{
printf(
'<textarea class="regular-text" rows=5 name="_option_name[list_data]" id="list_data" placeholder="%s" required>%s</textarea>',
'<textarea class="regular-text" rows=5 name="pdpa_option[list_data]" id="list_data" placeholder="%s" required>%s</textarea>',
__("Fullname\nBirthday\nEtc."),
isset($this->options['list_data']) ? esc_html($this->options['list_data']) : ''
);
Expand All @@ -368,15 +368,15 @@ public function list_data_callback()
public function address_callback()
{
printf(
'<input class="regular-text" type="text" name="_option_name[site_address]" id="site_address" value="%s" required>',
'<input class="regular-text" type="text" name="pdpa_option[site_address]" id="site_address" value="%s" required>',
isset($this->options['site_address']) ? esc_html($this->options['site_address']) : ''
);
}

public function contact_callback()
{
printf(
'<input class="regular-text" type="text" name="_option_name[site_contact]" id="site_contact" value="%s" placeholder="%s">',
'<input class="regular-text" type="text" name="pdpa_option[site_contact]" id="site_contact" value="%s" placeholder="%s">',
isset($this->options['site_contact']) ? esc_html($this->options['site_contact']) : '',
__("Such as John Doe (081-111-1111)", 'pdpa-consent')
);
Expand All @@ -385,7 +385,7 @@ public function contact_callback()
public function email_callback()
{
printf(
'<input class="regular-text" type="text" name="_option_name[site_email]" id="site_description" value="%s" required>',
'<input class="regular-text" type="text" name="pdpa_option[site_email]" id="site_description" value="%s" required>',
isset($this->options['site_email']) ? sanitize_email($this->options['site_email']) : ''
);
}
Expand Down
4 changes: 2 additions & 2 deletions pdpa-consent.php
Expand Up @@ -5,7 +5,7 @@
/*
Plugin Name: PDPA Consent
Description: PDPA Consent allows you to notify to the user to accept privacy terms. Comply with Thailand PDPA law.
Version: 1.0.3
Version: 1.0.4
Author: Apinan Woratrakun, Aeknarin Sirisub
Author URI: https://www.ioblog.me
Plugin URI: https://github.com/iamapinan/PDPA-Consent
Expand Down Expand Up @@ -50,7 +50,7 @@ public function __construct()
$this->locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
$this->cookie_domain = $_SERVER['SERVER_NAME'];
$this->cookie_expire = strtotime("next Month");
$this->options = get_option('_option_name');
$this->options = get_option('pdpa_option');

$this->initial();
new pdpa_consent_admin_option;
Expand Down
17 changes: 11 additions & 6 deletions readme.txt
Expand Up @@ -5,7 +5,7 @@ Tags: pdpa, gdpr, pdpa-consent, cookie, notice, notification, notify, cookie, co
Requires at least: 4.3
Requires PHP: 5.4.6
Tested up to: 5.4.1
Stable tag: 1.0.3
Stable tag: 1.0.4
License: GNU 3.0
License URI: https://opensource.org/licenses/lgpl-3.0.html

Expand Down Expand Up @@ -52,17 +52,19 @@ It was adopted into law on May 28, 2019, after being published in the Royal Thai

* หน้าจัดการข้อมูลของผู้ใช้
* ผู้ใช้สามารถขอถ่ายโอนข้อมูลได้
* ผู้ใช้สามารถลบหรือขอให้ลบข้อมูลได้ ขึ้นกับนโยบาย
* ผู้ใช้สามารถ ลบหรือขอให้ลบข้อมูลได้ ขึ้นกับนโยบาย
* ผู้ใช้สามารถเลือกการยินยอมใหม่ได้
* ผู้ใช้สามารถแก้ไข/ขอให้แก้ไข ข้อมูลที่ยินยอมได้
* ผู้ใช้สามารถ แก้ไข/ขอให้แก้ไข ข้อมูลที่ยินยอมได้
* ผู้ใช้สามารถเลือกประเภทข้อมูลที่ยินยอมและไม่ยินยอมได้
* แบ่งประเภทข้อมูล พืื้นฐาน, ละเอียดอ่อน, ท้างอ้อม
* แบ่งประเภทข้อมูลพื้นฐาน, ข้อมูลละเอียดอ่อน, ข้อมูลทางอ้อม
* เพิ่มเรื่อง การจัดเก็บข้อมูลแต่ละประเภท
* เพิ่มเรื่อง การเผยแพร่ข้อมูลผ่าน API หรือไม่
* เพิ่มเรื่อง การส่งข้อมูลไปต่างประเทศ หรือไม่
* Wizard การตั้งค่า
* เพิ่ม Wizard การตั้งค่า
* ให้ผู้ใช้ต้องติ๊กถูกก่อนคลิกยินยอม โดยค่าเริ่มต้นคือไม่ติ๊ก
* บันทึกประวัติการ ยินยอม/ไม่ยินยอม ย้อนหลัง
* บันทึกประวัติการ ยินยอม/ไม่ยินยอม ใหม่ได้
* API สำหรับขอความยินยอมเป็นครั้งคราว
* Server อยู่ในต่างประเทศหรือไม่

== Special Thank ==

Expand Down Expand Up @@ -91,6 +93,9 @@ No questions yet.

== Changelog ==

= 1.0.4 =
* Fix conflict with woo-line-notify plugin

= 1.0.3 =
* First store release
* Fixed security issue
Expand Down
Binary file removed screenshot-1.png
Binary file not shown.
Binary file removed screenshot-2.png
Binary file not shown.
Binary file removed screenshot-3.png
Binary file not shown.
9 changes: 7 additions & 2 deletions templates/en_US.html
Expand Up @@ -3,7 +3,12 @@ <h3>นิยามข้อมูลส่วนบุคคล</h3>
<h3>ข้อมูลส่วนบุคคลที่เก็บรวบรวม</h3>
<p>[service] จะใช้วิธีการที่ชอบด้วยกฏหมายและเป็นธรรมในการเก็บรวบรวมข้อมูลส่วนบุคคลอย่างจำกัดเพียงเท่าที่จำเป็น
ภายใต้วัตถุประสงค์การทำงานของ [service] ที่เป็น [description] โดยจะเก็บรวบรวมข้อมูลส่วนบุคคลของท่าน ดังนี้</p>
<p>ข้อมูลพื้นฐาน</p>

<ul>
<li>[list_data]</li>
</ul>

<!-- <p>ข้อมูลพื้นฐาน</p>
<ul>
<li>[list_data]</li>
</ul>
Expand All @@ -14,7 +19,7 @@ <h3>ข้อมูลส่วนบุคคลที่เก็บรวบ
<p>ข้อมูลละเอียดอ่อน</p>
<ul>
<li>[list_data]</li>
</ul>
</ul> -->
<p>ทั้งนี้ข้อมูลส่วนบุคคลดังกล่าวเป็นข้อมูลที่จำเป็นสำหรับการทำงานของ [service] นี้ หากไม่มีข้อมูลดังกล่าว
ระบบจะไม่สามารถทำงานโดยสมบูรณ์ ผู้ใช้เป็นผู้เลือกได้ว่าจะบันทึกข้อมูลส่วนบุคคลอื่นใด
และยินดีจะเปิดเผยข้อมูลดังกล่าวกับบุคคลหรือหน่วยงานอื่นหรือไม่</p>
Expand Down
9 changes: 7 additions & 2 deletions templates/th_TH.html
Expand Up @@ -3,7 +3,12 @@ <h3>นิยามข้อมูลส่วนบุคคล</h3>
<h3>ข้อมูลส่วนบุคคลที่เก็บรวบรวม</h3>
<p>[service] จะใช้วิธีการที่ชอบด้วยกฏหมายและเป็นธรรมในการเก็บรวบรวมข้อมูลส่วนบุคคลอย่างจำกัดเพียงเท่าที่จำเป็น
ภายใต้วัตถุประสงค์การทำงานของ [service] ที่เป็น [description] โดยจะเก็บรวบรวมข้อมูลส่วนบุคคลของท่าน ดังนี้</p>
<p>ข้อมูลพื้นฐาน</p>

<ul>
<li>[list_data]</li>
</ul>

<!-- <p>ข้อมูลพื้นฐาน</p>
<ul>
<li>[list_data]</li>
</ul>
Expand All @@ -14,7 +19,7 @@ <h3>ข้อมูลส่วนบุคคลที่เก็บรวบ
<p>ข้อมูลละเอียดอ่อน</p>
<ul>
<li>[list_data]</li>
</ul>
</ul> -->
<p>ทั้งนี้ข้อมูลส่วนบุคคลดังกล่าวเป็นข้อมูลที่จำเป็นสำหรับการทำงานของ [service] นี้ หากไม่มีข้อมูลดังกล่าว
ระบบจะไม่สามารถทำงานโดยสมบูรณ์ ผู้ใช้เป็นผู้เลือกได้ว่าจะบันทึกข้อมูลส่วนบุคคลอื่นใด
และยินดีจะเปิดเผยข้อมูลดังกล่าวกับบุคคลหรือหน่วยงานอื่นหรือไม่</p>
Expand Down

0 comments on commit e4a6bf1

Please sign in to comment.