├── index.php ├── _config.yml ├── .gitignore ├── assets ├── pdpa-consent-sm.jpg ├── pdpa-consent-banner.png ├── pdpa-consent-logo.jpg ├── pdpa-admin-script.js ├── pdpa-consent-user.min.js ├── pdpa-consent-user.js ├── pdpa-consent-user.min.css ├── pdpa-consent.min.css ├── pdpa-consent-user.css ├── pdpa-consent.min.js ├── pdpa-admin-style.css ├── pdpa-consent.css ├── pdpa-consent.js └── axios.min.js ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── languages ├── pdpa-consent-th.mo ├── pdpa-consent-en_US.mo ├── pdpa-consent.pot ├── pdpa-consent-th.po └── pdpa-consent-en_US.po ├── includes ├── template.php ├── frontends │ ├── consent_template.php │ └── user_template.php ├── user.php └── admin.php ├── SECURITY.md ├── templates ├── en_US.html └── th_TH.html ├── CODE_OF_CONDUCT.md ├── README.md ├── readme.txt ├── pdpa-consent.php └── LICENSE /index.php: -------------------------------------------------------------------------------- 1 | { 2 | jQuery('.pdpa-color-picker').wpColorPicker(); 3 | }); -------------------------------------------------------------------------------- /languages/pdpa-consent-en_US.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamapinan/PDPA-Consent/HEAD/languages/pdpa-consent-en_US.mo -------------------------------------------------------------------------------- /assets/pdpa-consent-user.min.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded",(function(){document.getElementById("pdpa-status-reset").addEventListener("click",e=>{pdpa_consent_call("pdpa-reset")})})); -------------------------------------------------------------------------------- /assets/pdpa-consent-user.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded", function () { 2 | document.getElementById('pdpa-status-reset').addEventListener("click", (e) => { 3 | pdpa_consent_call('pdpa-reset'); 4 | }) 5 | }); -------------------------------------------------------------------------------- /includes/template.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Version with security improved. 6 | 7 | | Version | Supported | 8 | | ------- | ------------------ | 9 | | 1.0.2 | :white_check_mark: | 10 | | 1.0.1 | :x: | 11 | | 1.0.0 | :x: | 12 | 13 | ## Reporting a Vulnerability 14 | 15 | To report a vulnerable please create issue in this repository or send valnerable info to iamapinan@gmail.com 16 | I will fix and update to prod release in 3 days for security reasons. 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: iamapinan 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /assets/pdpa-consent-user.min.css: -------------------------------------------------------------------------------- 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} -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: iamapinan 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Your website URL** 38 | Provide your website with plugin install and activated. 39 | -------------------------------------------------------------------------------- /includes/frontends/consent_template.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/pdpa-consent.min.css: -------------------------------------------------------------------------------- 1 | .pdpa-consent-wrap{padding:15px;background-color:#fff;width:100%;text-align:center;display:flex;justify-content:center;flex-direction:column}.pdpa-place-top{position:fixed;z-index:99999;top:0;left:0;width:100%}.pdpa-place-bottom{position:fixed;z-index:9999;bottom:0;left:0;width:100%}.pdpa-place-center{position:fixed;z-index:999;left:50%;top:50%;transform:translate(-50%,-50%);max-width:100vh;box-shadow:3px 3px 50px rgba(3,3,3,.25);border-radius:6px}.pdpa-darkmode{background-color:#272727!important}.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{padding:8px 15px;font-size:10pt;border-radius:18pt;border:none;line-height:1}.pdpa-consent-allow-button:hover,.pdpa-consent-not-allow-button:hover{opacity:.8}.pdpa-consent-allow-button{background-color:#355eb8;color:#fff}.pdpa-consent-not-allow-button{background-color:#d4304c;color:#fff}@media (max-width:1023px){.pdpa-place-center{position:fixed;z-index:99999;left:50%;top:50%;transform:translate(-50%,-50%);width:100%;box-shadow:3px 3px 50px rgba(3,3,3,.25);border-radius:6px}}@media (max-width:575px){.pdpa-place-center{position:fixed;z-index:99999;left:50%;top:50%;transform:translate(-50%,-50%);width:100%;box-shadow:3px 3px 50px rgba(3,3,3,.25);border-radius:6px}} -------------------------------------------------------------------------------- /includes/user.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | Class PDPA_User { 10 | function __construct() { 11 | $this->load(); 12 | } 13 | 14 | function load() { 15 | add_shortcode('pdpa_user_page', [$this, 'user_page_shortcode']); 16 | } 17 | 18 | function load_script() 19 | { 20 | $plugin_info = get_plugin_data(PDPA_PATH . 'pdpa-consent.php'); 21 | 22 | wp_enqueue_style('pdpa-consent-user', plugins_url('pdpa-consent/assets/pdpa-consent-user.css'), array(), $plugin_info['Version']); 23 | wp_enqueue_script('pdpa-consent-user', plugins_url('pdpa-consent/assets/pdpa-consent-user.js'), array(), $plugin_info['Version'], true); 24 | } 25 | 26 | function user_page_shortcode($atts) 27 | { 28 | $user_id = get_current_user_id(); 29 | $isLogin = is_user_logged_in(); 30 | $user_info = get_userdata($user_id); 31 | $this->load_script(); 32 | 33 | $users = get_users( array( 'fields' => array( 'ID' ) ) ); 34 | foreach($users as $user){ 35 | $user_info->meta = get_user_meta( $user->ID ); 36 | } 37 | 38 | render_template('user_template', [ 39 | 'user_id' => $user_id, 40 | 'user_info' => $user_info, 41 | 'is_login' => $isLogin 42 | ]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /includes/frontends/user_template.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |

display_name;?>

7 |
8 | 9 |
10 |

11 | 12 |

13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 | 21 | data as $user_key => $user_data):?> 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 |
32 | 33 |
-------------------------------------------------------------------------------- /assets/pdpa-consent-user.css: -------------------------------------------------------------------------------- 1 | /** 2 | * User privacy page style 3 | */ 4 | .pdpa_user_warp { 5 | display: flex; 6 | flex-direction: column; 7 | } 8 | .pdpa_user_warp .user_toolbar { 9 | justify-content: center; 10 | flex-direction: row; 11 | display: flex; 12 | } 13 | .pdpa_user_warp button { 14 | padding: 10px 25px; 15 | border-radius: 30px; 16 | line-height: 20px; 17 | font-size: 16px; 18 | margin: 3px; 19 | } 20 | .pdpa_user_warp .profile-header-top { 21 | display: flex; 22 | justify-content: flex-start; 23 | flex-direction: row; 24 | background: rgb(170,34,195); 25 | background: linear-gradient(0deg, rgba(170,34,195,1) 0%, rgba(253,45,121,1) 100%); 26 | padding: 20px 10px; 27 | margin-bottom: 25px; 28 | margin-top: 25px; 29 | border-radius: 8px; 30 | } 31 | 32 | .pdpa_user_warp .profile-header-top img { 33 | border-radius: 50%; 34 | width: 96px; 35 | height: 96px; 36 | margin-left: 20px; 37 | } 38 | 39 | .pdpa_user_warp .profile-header-top .user_title { 40 | display: flex; 41 | flex-direction: column; 42 | justify-content: flex-start; 43 | padding-left: 25px; 44 | } 45 | .profile-header-top .user_title h3 { 46 | margin-bottom: 10px; 47 | margin-top: 0px; 48 | color: #fff; 49 | } 50 | .profile-header-top .user_title p { 51 | color: rgb(255, 236, 221); 52 | font-size: 0.8em; 53 | } 54 | .profile-header-top .user_title span { 55 | vertical-align: middle; 56 | } 57 | .profile-header-top .user_title .status_bage { 58 | color: #fff; 59 | } 60 | .pdpa_user_warp .user_data td, .pdpa_user_warp .user_data th { 61 | border: 1px solid #ccc; 62 | padding: 5px; 63 | } -------------------------------------------------------------------------------- /assets/pdpa-consent.min.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded",(function(){"yes"===pdpa_ajax.consent_enable&&null==pdpa_get_cookie()&&(document.getElementById("PDPANotAllow").addEventListener("click",(function(){pdpa_consent_call("pdpa-not-allow"),document.getElementById("pdpa_screen").style.display="none"})),document.getElementById("PDPAAllow").addEventListener("click",(function(){pdpa_consent_call("pdpa-allow"),document.getElementById("pdpa_screen").style.display="none"})))}));const pdpa_consent_call=action_require=>{var pdpa_request_data=new FormData;pdpa_request_data.append("action","pdpa_action"),pdpa_request_data.append("set_status",action_require),pdpa_request_data.append("security",pdpa_ajax.pdpa_nonce),axios({method:"POST",url:pdpa_ajax.ajax_url,data:pdpa_request_data}).then((function(response){pdpa_cookie_process(response.data)})).catch((function(response){console.log(response)}))},pdpa_cookie_process=d=>{var cookie_string="";"user_allow"==d.type?cookie_string=d.cookie_name+"=1; expires="+d.cookie_expire+"; domain="+d.cookie_domain+"; path=/":"user_not_allow"==d.type?cookie_string=d.cookie_name+"=0; expires="+d.cookie_expire+"; domain="+d.cookie_domain+"; path=/":"reset"==d.type?(cookie_string=d.cookie_name+"=0; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain="+d.cookie_domain+"; path=/",window.location.reload()):console.log("error.",d),document.cookie=cookie_string},pdpa_delete_all_cookie=()=>{for(var cookies=document.cookie.split(";"),i=0;i-1?cookie.substr(0,eqPos):cookie;document.cookie=name+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}};function pdpa_get_cookie(){for(var cookieArr=document.cookie.split(";"),i=0;i 4 | */ 5 | 6 | document.addEventListener("DOMContentLoaded", function () { 7 | if (pdpa_ajax.consent_enable === "yes" && pdpa_get_cookie() == null) { 8 | document.getElementById("PDPANotAllow").addEventListener("click", function() { 9 | pdpa_consent_call('pdpa-not-allow'); 10 | document.getElementById("pdpa_screen").style.display = 'none' 11 | }); 12 | document.getElementById("PDPAAllow").addEventListener("click", function() { 13 | pdpa_consent_call('pdpa-allow'); 14 | document.getElementById("pdpa_screen").style.display = 'none' 15 | }); 16 | } 17 | }) 18 | 19 | const pdpa_consent_call = (action_require) => { 20 | var pdpa_request_data = new FormData(); 21 | pdpa_request_data.append("action", "pdpa_action"); 22 | pdpa_request_data.append("set_status", action_require); 23 | pdpa_request_data.append("security", pdpa_ajax.pdpa_nonce); 24 | 25 | axios({ 26 | method: 'POST', 27 | url: pdpa_ajax.ajax_url, 28 | data: pdpa_request_data 29 | }) 30 | .then(function (response) { 31 | //handle success 32 | pdpa_cookie_process(response.data); 33 | }) 34 | .catch(function (response) { 35 | //handle error 36 | console.log(response); 37 | }); 38 | } 39 | 40 | const pdpa_cookie_process = (d) => { 41 | var cookie_string = ''; 42 | if (d.type == 'user_allow') { 43 | cookie_string = d.cookie_name + "=1; expires=" + d.cookie_expire + "; domain=" + d.cookie_domain + "; path=/"; 44 | } else if (d.type == 'user_not_allow') { 45 | cookie_string = d.cookie_name + "=0; expires=" + d.cookie_expire + "; domain=" + d.cookie_domain + "; path=/"; 46 | } else if(d.type == 'reset') { 47 | cookie_string = d.cookie_name + "=0; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=" + d.cookie_domain + "; path=/"; 48 | window.location.reload() 49 | } else { 50 | console.log("error.", d) 51 | } 52 | console.log(cookie_string) 53 | document.cookie = cookie_string; 54 | } 55 | 56 | const pdpa_delete_all_cookie = () => { 57 | var cookies = document.cookie.split(";"); 58 | 59 | for (var i = 0; i < cookies.length; i++) { 60 | var cookie = cookies[i]; 61 | var eqPos = cookie.indexOf("="); 62 | var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; 63 | document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; 64 | } 65 | } 66 | 67 | function pdpa_get_cookie() { 68 | var cookieArr = document.cookie.split(";"); 69 | 70 | for(var i = 0; i < cookieArr.length; i++) { 71 | var cookiePair = cookieArr[i].split("="); 72 | if('pdpa_accepted' == cookiePair[0].trim()) { 73 | return decodeURIComponent(cookiePair[1]); 74 | } 75 | } 76 | 77 | return null; 78 | } -------------------------------------------------------------------------------- /templates/en_US.html: -------------------------------------------------------------------------------- 1 |

นิยามข้อมูลส่วนบุคคล

2 |

ข้อมูลส่วนบุคคล หมายถึง ข้อมูลเกี่ยวกับบุคคลซึ่งทำให้สามารถระบุตัวบุคคลนั้นได้ ไม่ว่าทางตรงหรือทางอ้อม

3 |

ข้อมูลส่วนบุคคลที่เก็บรวบรวม

4 |

[service] จะใช้วิธีการที่ชอบด้วยกฏหมายและเป็นธรรมในการเก็บรวบรวมข้อมูลส่วนบุคคลอย่างจำกัดเพียงเท่าที่จำเป็น 5 | ภายใต้วัตถุประสงค์การทำงานของ [service] ที่เป็น [description] โดยจะเก็บรวบรวมข้อมูลส่วนบุคคลของท่าน ดังนี้

6 | 7 | 10 | 11 | 23 |

ทั้งนี้ข้อมูลส่วนบุคคลดังกล่าวเป็นข้อมูลที่จำเป็นสำหรับการทำงานของ [service] นี้ หากไม่มีข้อมูลดังกล่าว 24 | ระบบจะไม่สามารถทำงานโดยสมบูรณ์ ผู้ใช้เป็นผู้เลือกได้ว่าจะบันทึกข้อมูลส่วนบุคคลอื่นใด 25 | และยินดีจะเปิดเผยข้อมูลดังกล่าวกับบุคคลหรือหน่วยงานอื่นหรือไม่

26 |

แหล่งที่มาของข้อมูลส่วนบุคคล

27 |

[service] ได้รับข้อมูลส่วนบุคคล ด้วยความสมัครใจของผู้ใช้เท่านั้น โดยการลงทะเบียนใช้ [service] 28 | จะถือเป็นการยอมรับเงื่อนไขการใช้งานและอนุญาติให้ระบบจัดเก็บ ใช้ และเปิดเผยข้อมูลเหล่านั้นได้ตามวัตถุประสงค์

29 |

วัตถุประสงค์ในการเก็บรวบรวมข้อมูลส่วนบุคคล

30 |

[service] จะเก็บรวบรวมข้อมูลส่วนบุคคลของท่านเพื่อนำไปใช้หรือเปิดเผยเท่าที่จำเป็น ภายใต้วัตถุประสงค์ในการใช้บริการ

31 |

[service] จะไม่ดำเนินการอื่นใดแตกต่างจากที่ระบุในวัตถุประสงค์ เว้นแต่ มีกฏหมายบัญญัติให้กระทำ 32 | หรือมีหนังสือร้องขอที่สามารถปฏิบัติได้ตามกฏหมาย เช่น เพื่อความจำเป็นในการป้องกันด้านสุขภาพและโรคติดต่ออันตราย

33 |

การเก็บรวบรวม ใช้ หรือเปิดเผยข้อมูลส่วนบุคคล

34 |

[service] จะดำเนินการกับข้อมูลส่วนบุคคลของท่าน ในการเก็บรวบรวม ใช้ และ เปิดเผยข้อมูลส่วนบุคคล 35 | เมื่อได้รับความยินยอมจากท่านตามวัตถุประสงค์ที่ระบุไว้เท่านั้น นอกจากนี้ [service] 36 | อาจจำเป็นต้องเปิดเผยข้อมูลส่วนบุคคลของท่านให้กับเจ้าหน้าที่หรือหน่วยงานที่มีอำนาจหน้าที่ตามกฏหมาย เช่น 37 | การพิจารณาคดีของศาลและการดำเนินงานของเจ้าหน้าที่ในกระบวนการพิจารณาคดี

38 |

การเก็บรักษาและระยะเวลาในการเก็บรักษาข้อมูลส่วนบุคคล

39 |

[service] ตระหนักถึงความสำคัญของการรักษาความปลอดภัยของข้อมูลส่วนบุคคลของท่าน [service] 40 | จึงกำหนดให้มีมาตรการในการรักษาความมั่นคงปลอดภัยของข้อมูลส่วนบุคคลอย่างเหมาะสมและสอดคล้องกับการรักษาความลับ 41 | และป้องกันการเข้าถึง ทำลาย ใช้ แปลง แก้ไข หรือเปิดเผยข้อมูลส่วนบุคคล โดยไม่มีสิทธิหรือโดยไม่ชอบด้วยกฏหมาย

42 | โดยมีระยะเวลาการจัดเก็บข้อมูลส่วนบุคคลตลอดระยะเวลาการใช้งาน [service] เพื่อให้ระบบทำงานได้โดยสมบูรณ์ 43 | ทั้งนี้เมื่อพ้นระยะเวลาการเก็บรักษา และไม่มีเหตุให้ต้องเก็บรักษาข้อมูลส่วนบุคคลนั้นต่อไป บริษัทฯ 44 | จะลบหรือทำลายข้อมูลส่วนบุคคลของท่าน 45 |

สิทธิของเจ้าของข้อมูล

46 |

ท่านมีสิทธิในการดำเนินการ ได้แก่ สิทธิในการเพิกถอนความยินยอม, สิทธิในการเข้าถึงข้อมูลส่วนบุคคล, 47 | สิทธิในการคัดค้านการเก็บรวบรวม ใช้ หรือเปิดเผยข้อมูลส่วนบุคคล, สิทธิในการลบและแก้ไขข้อมูลส่วนบุคคล 48 | เว้นแต่มีข้อจำกัดสิทธิโดยกฏหมาย

49 |

ท่านสามารถติดต่อ [service] เพื่อให้ดำเนินการตามสิทธิข้างต้นได้ โดยไม่มีค่าใช้จ่ายใดๆ และจะแจ้งผลตามคำร้อง ภายใน 30 50 | วัน

51 |

หากพบการรั่วไหมของข้อมูล ทาง [service] จะดำเนินการแจ้งให้ท่านทราบภายใน 72 ชั่วโมง

52 |

ช่องทางติดต่อ

53 |

ผู้ควบคุมข้อมูลส่วนบุคคล

54 |
55 | [service]
56 | [address]
57 | [contact]
58 | [email] 59 |
60 |
61 |

Generated by PDPA Consent

-------------------------------------------------------------------------------- /templates/th_TH.html: -------------------------------------------------------------------------------- 1 |

นิยามข้อมูลส่วนบุคคล

2 |

ข้อมูลส่วนบุคคล หมายถึง ข้อมูลเกี่ยวกับบุคคลซึ่งทำให้สามารถระบุตัวบุคคลนั้นได้ ไม่ว่าทางตรงหรือทางอ้อม

3 |

ข้อมูลส่วนบุคคลที่เก็บรวบรวม

4 |

[service] จะใช้วิธีการที่ชอบด้วยกฏหมายและเป็นธรรมในการเก็บรวบรวมข้อมูลส่วนบุคคลอย่างจำกัดเพียงเท่าที่จำเป็น 5 | ภายใต้วัตถุประสงค์การทำงานของ [service] ที่เป็น [description] โดยจะเก็บรวบรวมข้อมูลส่วนบุคคลของท่าน ดังนี้

6 | 7 | 10 | 11 | 23 |

ทั้งนี้ข้อมูลส่วนบุคคลดังกล่าวเป็นข้อมูลที่จำเป็นสำหรับการทำงานของ [service] นี้ หากไม่มีข้อมูลดังกล่าว 24 | ระบบจะไม่สามารถทำงานโดยสมบูรณ์ ผู้ใช้เป็นผู้เลือกได้ว่าจะบันทึกข้อมูลส่วนบุคคลอื่นใด 25 | และยินดีจะเปิดเผยข้อมูลดังกล่าวกับบุคคลหรือหน่วยงานอื่นหรือไม่

26 |

แหล่งที่มาของข้อมูลส่วนบุคคล

27 |

[service] ได้รับข้อมูลส่วนบุคคล ด้วยความสมัครใจของผู้ใช้เท่านั้น โดยการลงทะเบียนใช้ [service] 28 | จะถือเป็นการยอมรับเงื่อนไขการใช้งานและอนุญาติให้ระบบจัดเก็บ ใช้ และเปิดเผยข้อมูลเหล่านั้นได้ตามวัตถุประสงค์

29 |

วัตถุประสงค์ในการเก็บรวบรวมข้อมูลส่วนบุคคล

30 |

[service] จะเก็บรวบรวมข้อมูลส่วนบุคคลของท่านเพื่อนำไปใช้หรือเปิดเผยเท่าที่จำเป็น ภายใต้วัตถุประสงค์ในการใช้บริการ

31 |

[service] จะไม่ดำเนินการอื่นใดแตกต่างจากที่ระบุในวัตถุประสงค์ เว้นแต่ มีกฏหมายบัญญัติให้กระทำ 32 | หรือมีหนังสือร้องขอที่สามารถปฏิบัติได้ตามกฏหมาย เช่น เพื่อความจำเป็นในการป้องกันด้านสุขภาพและโรคติดต่ออันตราย

33 |

การเก็บรวบรวม ใช้ หรือเปิดเผยข้อมูลส่วนบุคคล

34 |

[service] จะดำเนินการกับข้อมูลส่วนบุคคลของท่าน ในการเก็บรวบรวม ใช้ และ เปิดเผยข้อมูลส่วนบุคคล 35 | เมื่อได้รับความยินยอมจากท่านตามวัตถุประสงค์ที่ระบุไว้เท่านั้น นอกจากนี้ [service] 36 | อาจจำเป็นต้องเปิดเผยข้อมูลส่วนบุคคลของท่านให้กับเจ้าหน้าที่หรือหน่วยงานที่มีอำนาจหน้าที่ตามกฏหมาย เช่น 37 | การพิจารณาคดีของศาลและการดำเนินงานของเจ้าหน้าที่ในกระบวนการพิจารณาคดี

38 |

การเก็บรักษาและระยะเวลาในการเก็บรักษาข้อมูลส่วนบุคคล

39 |

[service] ตระหนักถึงความสำคัญของการรักษาความปลอดภัยของข้อมูลส่วนบุคคลของท่าน [service] 40 | จึงกำหนดให้มีมาตรการในการรักษาความมั่นคงปลอดภัยของข้อมูลส่วนบุคคลอย่างเหมาะสมและสอดคล้องกับการรักษาความลับ 41 | และป้องกันการเข้าถึง ทำลาย ใช้ แปลง แก้ไข หรือเปิดเผยข้อมูลส่วนบุคคล โดยไม่มีสิทธิหรือโดยไม่ชอบด้วยกฏหมาย

42 | โดยมีระยะเวลาการจัดเก็บข้อมูลส่วนบุคคลตลอดระยะเวลาการใช้งาน [service] เพื่อให้ระบบทำงานได้โดยสมบูรณ์ 43 | ทั้งนี้เมื่อพ้นระยะเวลาการเก็บรักษา และไม่มีเหตุให้ต้องเก็บรักษาข้อมูลส่วนบุคคลนั้นต่อไป บริษัทฯ 44 | จะลบหรือทำลายข้อมูลส่วนบุคคลของท่าน 45 |

สิทธิของเจ้าของข้อมูล

46 |

ท่านมีสิทธิในการดำเนินการ ได้แก่ สิทธิในการเพิกถอนความยินยอม, สิทธิในการเข้าถึงข้อมูลส่วนบุคคล, 47 | สิทธิในการคัดค้านการเก็บรวบรวม ใช้ หรือเปิดเผยข้อมูลส่วนบุคคล, สิทธิในการลบและแก้ไขข้อมูลส่วนบุคคล 48 | เว้นแต่มีข้อจำกัดสิทธิโดยกฏหมาย

49 |

ท่านสามารถติดต่อ [service] เพื่อให้ดำเนินการตามสิทธิข้างต้นได้ โดยไม่มีค่าใช้จ่ายใดๆ และจะแจ้งผลตามคำร้อง ภายใน 30 50 | วัน

51 |

หากพบการรั่วไหมของข้อมูล ทาง [service] จะดำเนินการแจ้งให้ท่านทราบภายใน 72 ชั่วโมง

52 |

ช่องทางติดต่อ

53 |

ผู้ควบคุมข้อมูลส่วนบุคคล

54 |
55 | [service]
56 | [address]
57 | [contact]
58 | [email] 59 |
60 |
61 |

Generated by PDPA Consent

-------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct (Draft) 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at iamapinan@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CodeFactor](https://www.codefactor.io/repository/github/iamapinan/pdpa-consent/badge)](https://www.codefactor.io/repository/github/iamapinan/pdpa-consent) 2 | 3 | This WordPress plugin help you to generate Thailand PDPA consent terms page and consent notification popup. 4 | You can edit the term page and publish on your website with elegant and powerful solution. !!! No jquery need at all. 5 | 6 | ### Code of conduct 7 | 8 | - ปลั๊กอินนี้จัดทำขึ้นเพื่อตอบสนองต่อการปฏิบัติตาม พ.ร.บ.คุ้มครองข้อมูลส่วนบุคคล 2562 (PDPA) ของประเทศไทย 9 | - ปลั๊กอินนี้จัดทำขึ้นเพื่อแจกฟรี 10 | - ปลั๊กอินไม่มีความประสงค์ที่จะจัดเก็บค่าใช้งานแต่อย่างใด 11 | - ปลั๊กอินไม่ได้รับประกันในด้านความปลอดภัยต่อข้อมูล 12 | - ปลั๊กอินไม่ได้ป้องกันการฟ้องร้องที่อาจเกิดขึ้นโดยคู่กรณีได้ 13 | - ผู้ใช้งานปลั๊กอินเป็นผู้รับผิดชอบและตัดสินใจต่อการใช้และรักษาความปลอดภัยของข้อมูล 14 | - ปลั๊กอินไม่ได้เป็นผู้ประมวลผลข้อมูลหรือใช้ข้อมูลส่วนบุคคล 15 | - ปลั๊กอินไม่ได้เป็นผู้บล็อคการทำงานส่วนหนึ่งส่วนใดของเว็บไซต์ 16 | - ปลั๊กอินจะมีการปรับปรุงเงื่อนไข PDPA ให้รัดกุมมากขึ้นเสมอ 17 | - การบริจาคมิใช่เพื่อเป็นสิ่งแลกเปลี่ยนในการใช้งานปลั๊กอิน PDPA Consent 18 | 19 | 20 | ### Download new release 21 | [Release page is here.](https://github.com/iamapinan/PDPA-Consent/releases) 22 | 23 | ### To install. 24 | 1. Install PDPA Consent via the WordPress.org plugin directory, or by uploading the files to your server 25 | 2. Activate the plugin through the 'Plugins' menu in WordPress 26 | 3. Go to the PDPA Consent settings and set your options. 27 | 28 | ### Features 29 | * Customizable message 30 | * Identity setup 31 | * Popup placement 32 | * Consent page generate 33 | * CSS Class for developer 34 | * Dark mode 35 | * Button color config 36 | * Support WP Super Cache (idea from Cookie Notice plugin) 37 | * Save user action to database 38 | * Display user PDPA Status on user list 39 | * Responsive 40 | * Multi language support (Thai, English) more translate is accept 41 | 42 | ### Roadmap 43 | 44 | * หน้าจัดการข้อมูลของผู้ใช้ 45 | * ผู้ใช้สามารถขอถ่ายโอนข้อมูลได้ 46 | * ผู้ใช้สามารถ ลบหรือขอให้ลบข้อมูลได้ ขึ้นกับนโยบาย 47 | * ผู้ใช้สามารถเลือกการยินยอมใหม่ได้ 48 | * ผู้ใช้สามารถ แก้ไข/ขอให้แก้ไข ข้อมูลที่ยินยอมได้ 49 | * ผู้ใช้สามารถเลือกประเภทข้อมูลที่ยินยอมและไม่ยินยอมได้ 50 | * แบ่งประเภทข้อมูลพื้นฐาน, ข้อมูลละเอียดอ่อน, ข้อมูลทางอ้อม 51 | * เพิ่มเรื่อง การจัดเก็บข้อมูลแต่ละประเภท 52 | * เพิ่มเรื่อง การเผยแพร่ข้อมูลผ่าน API หรือไม่ 53 | * เพิ่มเรื่อง การส่งข้อมูลไปต่างประเทศ หรือไม่ 54 | * เพิ่ม Wizard การตั้งค่า 55 | * ให้ผู้ใช้ต้องติ๊กถูกก่อนคลิกยินยอม โดยค่าเริ่มต้นคือไม่ติ๊ก 56 | * บันทึกประวัติการ ยินยอม/ไม่ยินยอม ใหม่ได้ 57 | * API สำหรับขอความยินยอมเป็นครั้งคราว 58 | * Server อยู่ในต่างประเทศหรือไม่ 59 | 60 | ### Contributors. 61 | - **Apinan Woratrakun** *as developer* , , 62 | - **Aeknarin Sirisub** *as technical privacy system desgin* 63 | 64 | [GNU 3.0 License](https://opensource.org/licenses/lgpl-3.0.html0) 65 | 66 | ### Special Thank 67 | * Thai Programmer Association 68 | * WordPress Bangkok friends 69 | 70 | ### Changelogs 71 | 72 | ### 1.1.1 73 | * Improved performance 74 | 75 | ### 1.1.0 76 | * Fix error missing class 77 | 78 | ### 1.0.9 79 | * Add wp_footer hook support 80 | 81 | ### 1.0.8 82 | * Fixed WP Super Cache issue. 83 | * Fixed consent does not correctly display on some websites. 84 | * Add a template for user privacy & consent screen. 85 | * Improve performance issues. 86 | 87 | #### 1.0.7 88 | * Fixed guest cookie 89 | 90 | #### 1.0.6 91 | * on-demand regenrate term page. 92 | 93 | #### 1.0.5 94 | * Add support for version wp early than 5.2. 95 | 96 | #### 1.0.4 97 | * Fix conflict with woo-line-notify plugin 98 | 99 | #### 1.0.3 100 | * First store release 101 | * Fixed security issue 102 | 103 | #### 1.0.2 104 | * Add dark mode 105 | * Button color 106 | * Use page id as privacy page url link 107 | * List of css class for developer 108 | * Remove custom css for security reason 109 | * Fix security and code style 110 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === PDPA Consent for Thailand === 2 | Contributors: iamapinan 3 | Donate link: https://paypal.me/apinu 4 | Tags: pdpa, gdpr, pdpa-consent, cookie, notice, notification, notify, cookie, cookie law, privacy, policy, consent, law, Thailand, compliance, consent 5 | Requires at least: 5.2 6 | Requires PHP: 5.4.6 7 | Tested up to: 5.4.1 8 | Stable tag: 1.1.1 9 | License: GNU 3.0 10 | License URI: https://opensource.org/licenses/lgpl-3.0.html 11 | 12 | PDPA Consent allows you to notify to the user to accept privacy terms. Comply with Thailand PDPA law. 13 | 14 | == Description == 15 | 16 | This WordPress plugin help you to generate Thailand PDPA consent terms page and consent notification popup. 17 | You can edit the term page and publish on your website with elegant and powerful solution. !!! No jquery need at all. 18 | 19 | == PDPA Consent == 20 | 21 | Personal Data Protection Act B.E. 2562 (2019) or PDPA is the law to protect user privacy informations of Thailand. 22 | It was adopted into law on May 28, 2019, after being published in the Royal Thai Government 23 | 24 | == Code of conduct == 25 | - ปลั๊กอิน PDPA Consent นี้จัดทำขึ้นเพื่อตอบสนองต่อการปฏิบัติตาม พ.ร.บ.คุ้มครองข้อมูลส่วนบุคคล 2562 (PDPA) ของประเทศไทย 26 | - ปลั๊กอิน PDPA Consent นี้จัดทำขึ้นเพื่อแจกฟรี 27 | - ปลั๊กอิน PDPA Consent ไม่มีความประสงค์ที่จะจัดเก็บค่าใช้งานแต่อย่างใด 28 | - ไม่ได้รับประกันในด้านความปลอดภัย 29 | - ปลั๊กอิน PDPA Consent ไม่ได้ป้องกันการฟ้องร้องที่อาจเกิดขึ้นโดยคู่กรณีได้ 30 | - ผู้ใช้งานปลั๊กอิน PDPA Consent เป็นผู้รับผิดชอบและตัดสินใจต่อการใช้และรักษาความปลอดภัยของข้อมูล 31 | - ปลั๊กอิน PDPA Consent ไม่ได้เป็นผู้ประมวลผลข้อมูลหรือใช้ข้อมูลส่วนบุคคล 32 | - ปลั๊กอิน PDPA Consent ไม่ได้เป็นผู้บล็อคการทำงานส่วนใดของเว็บไซต์ 33 | - ปลั๊กอิน PDPA Consent จะมีการปรับปรุงเงื่อนไข PDPA ให้รัดกุมมากขึ้นเสมอ 34 | - การบริจาคมิใช่เพื่อเป็นสิ่งแลกเปลี่ยนในการใช้งานปลั๊กอิน PDPA Consent 35 | 36 | = Features include: = 37 | 38 | * Customizable message 39 | * Identity setup 40 | * Popup placement 41 | * Consent page generate 42 | * CSS Class for developer 43 | * Dark mode 44 | * Button color config 45 | * Support WP Super Cache (idea from Cookie Notice plugin) 46 | * Save user action to database 47 | * Display user PDPA Status on user list 48 | * Responsive 49 | * Multi language support (Thai, English) more translate is accept 50 | 51 | == Roadmap == 52 | 53 | * หน้าจัดการข้อมูลของผู้ใช้ 54 | * ผู้ใช้สามารถขอถ่ายโอนข้อมูลได้ 55 | * ผู้ใช้สามารถ ลบหรือขอให้ลบข้อมูลได้ ขึ้นกับนโยบาย 56 | * ผู้ใช้สามารถเลือกการยินยอมใหม่ได้ 57 | * ผู้ใช้สามารถ แก้ไข/ขอให้แก้ไข ข้อมูลที่ยินยอมได้ 58 | * ผู้ใช้สามารถเลือกประเภทข้อมูลที่ยินยอมและไม่ยินยอมได้ 59 | * แบ่งประเภทข้อมูลพื้นฐาน, ข้อมูลละเอียดอ่อน, ข้อมูลทางอ้อม 60 | * เพิ่มเรื่อง การจัดเก็บข้อมูลแต่ละประเภท 61 | * เพิ่มเรื่อง การเผยแพร่ข้อมูลผ่าน API หรือไม่ 62 | * เพิ่มเรื่อง การส่งข้อมูลไปต่างประเทศ หรือไม่ 63 | * เพิ่ม Wizard การตั้งค่า 64 | * ให้ผู้ใช้ต้องติ๊กถูกก่อนคลิกยินยอม โดยค่าเริ่มต้นคือไม่ติ๊ก 65 | * บันทึกประวัติการ ยินยอม/ไม่ยินยอม ใหม่ได้ 66 | * API สำหรับขอความยินยอมเป็นครั้งคราว 67 | * Server อยู่ในต่างประเทศหรือไม่ 68 | 69 | == Special Thank == 70 | 71 | * Thai Programmer Association 72 | * WordPress Bangkok friends 73 | 74 | = Get involved = 75 | 76 | Feel free to contribute to the source code on the [PDPA Consent](https://github.com/iamapinan/PDPA-Consent). 77 | 78 | == Installation == 79 | 80 | 1. Install PDPA Consent via the WordPress.org plugin directory, or by uploading the files to your server 81 | 2. Activate the plugin through the 'Plugins' menu in WordPress 82 | 3. Go to the PDPA Consent settings and set your options. 83 | 84 | == Frequently Asked Questions == 85 | 86 | No questions yet. 87 | 88 | == Screenshots == 89 | 90 | 1. screenshot-1.png 91 | 2. screenshot-2.png 92 | 3. screenshot-3.png 93 | 94 | == Changelog == 95 | 96 | = 1.1.1 = 97 | * Improved performance 98 | 99 | = 1.1.0 = 100 | * Fix error missing class 101 | 102 | = 1.0.9 = 103 | * Add wp_footer hook support 104 | 105 | = 1.0.8 = 106 | * Fixed WP Super Cache issue. 107 | * Fixed consent does not correctly display on some websites. 108 | * Add a template for user privacy & consent screen. 109 | * Improve performance issues. 110 | 111 | = 1.0.7 = 112 | * Fixed guest cookie 113 | 114 | = 1.0.6 = 115 | * Regenrate term page option. 116 | * fix cookie domain. 117 | 118 | = 1.0.5 = 119 | * Add support for version wp early than 5.2. 120 | 121 | = 1.0.4 = 122 | * Fix conflict with woo-line-notify plugin 123 | 124 | = 1.0.3 = 125 | * First store release 126 | * Fixed security issue 127 | 128 | = 1.0.2 = 129 | * Add dark mode 130 | * Button color 131 | * Use page id as privacy page url link 132 | * List of css class for developer 133 | * Remove custom css for security reason 134 | * Fix security and code style 135 | 136 | = 1.0.1 = 137 | * Fix mini issue. 138 | 139 | = 1.0.0 = 140 | * Customizable message 141 | * Identity setup 142 | * User data list 143 | * Popup placement 144 | * Consent page generate 145 | * Custom CSS 146 | * Support WP Super Cache (idea from Cookie Notice plugin) 147 | * Save user action to database 148 | * Display user PDPA Status on user list 149 | * Multi language support (Thai, English) more translate is accept 150 | 151 | == Upgrade Notice == 152 | 153 | Always keep plugin up to date. 154 | -------------------------------------------------------------------------------- /languages/pdpa-consent.pot: -------------------------------------------------------------------------------- 1 | #, fuzzy 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: PDPA Consent\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2020-05-15 07:23+0000\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: \n" 10 | "Language: \n" 11 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "X-Generator: Loco https://localise.biz/\n" 16 | "X-Loco-Version: 2.3.3; wp-5.4.1" 17 | 18 | #: pdpa-consent.php:94 19 | msgid "" 20 | "Please setup PDPA Consent setting in plugin page." 22 | msgstr "" 23 | 24 | #: pdpa-consent.php:102 25 | msgid "User Privacy" 26 | msgstr "" 27 | 28 | #: pdpa-consent.php:114 29 | msgid "User privacy page is created" 30 | msgstr "" 31 | 32 | #: pdpa-consent.php:115 33 | msgid "View page" 34 | msgstr "" 35 | 36 | #: pdpa-consent.php:263 37 | msgid "Read term and privacy policy" 38 | msgstr "" 39 | 40 | #: pdpa-consent.php:273 pdpa-consent.php:303 includes/user_template.php:7 41 | msgid "Allow" 42 | msgstr "" 43 | 44 | #: pdpa-consent.php:281 45 | msgid "Not Allow" 46 | msgstr "" 47 | 48 | #: pdpa-consent.php:291 49 | msgid "PDPA Allow" 50 | msgstr "" 51 | 52 | #: pdpa-consent.php:301 53 | msgid "Waiting for consent." 54 | msgstr "" 55 | 56 | #: pdpa-consent.php:301 57 | msgid "Waiting." 58 | msgstr "" 59 | 60 | #: pdpa-consent.php:303 includes/user_template.php:7 61 | #: includes/user_template.php:7 62 | msgid "Not allow." 63 | msgstr "" 64 | 65 | #: pdpa-consent.php:303 includes/user_template.php:7 66 | msgid "Allow." 67 | msgstr "" 68 | 69 | #: includes/user_template.php:10 70 | msgid "Timestamp" 71 | msgstr "" 72 | 73 | #: includes/user_template.php:15 74 | msgid "Download profile data" 75 | msgstr "" 76 | 77 | #: includes/user_template.php:16 78 | msgid "Reset consent" 79 | msgstr "" 80 | 81 | #: includes/user_template.php:17 82 | msgid "Delete account" 83 | msgstr "" 84 | 85 | #: includes/admin.php:27 86 | msgid "pdpa-term" 87 | msgstr "" 88 | 89 | #: includes/admin.php:60 90 | msgid "Thailand’s Personal Data Protection Act (PDPA)" 91 | msgstr "" 92 | 93 | #: includes/admin.php:78 94 | msgid "PDPA Consent term page is regenerated." 95 | msgstr "" 96 | 97 | #. Name of the plugin 98 | #: includes/admin.php:84 99 | msgid "PDPA Consent" 100 | msgstr "" 101 | 102 | #. id 103 | #: includes/admin.php:139 104 | msgid "PDPA Consent setup" 105 | msgstr "" 106 | 107 | #. id 108 | #: includes/admin.php:152 109 | msgid "Privacy page" 110 | msgstr "" 111 | 112 | #. id 113 | #: includes/admin.php:161 114 | msgid "Regenerate the privacy page." 115 | msgstr "" 116 | 117 | #. id 118 | #: includes/admin.php:169 119 | msgid "Enable consent noti" 120 | msgstr "" 121 | 122 | #. id 123 | #: includes/admin.php:206 124 | msgid "Use dark theme" 125 | msgstr "" 126 | 127 | #. id 128 | #: includes/admin.php:213 129 | msgid "Allow button color" 130 | msgstr "" 131 | 132 | #. id 133 | #: includes/admin.php:220 134 | msgid "Not allow button color" 135 | msgstr "" 136 | 137 | #. id 138 | #: includes/admin.php:227 139 | msgid "Notification popup type" 140 | msgstr "" 141 | 142 | #. id 143 | #: includes/admin.php:234 144 | msgid "Popup message" 145 | msgstr "" 146 | 147 | #. id 148 | #: includes/admin.php:241 149 | msgid "Website name (*)" 150 | msgstr "" 151 | 152 | #. id 153 | #: includes/admin.php:248 154 | msgid "Web description" 155 | msgstr "" 156 | 157 | #. id 158 | #: includes/admin.php:255 159 | msgid "List of user data (*)
(one data set per line)" 160 | msgstr "" 161 | 162 | #. id 163 | #: includes/admin.php:262 164 | msgid "Address (*)" 165 | msgstr "" 166 | 167 | #. id 168 | #: includes/admin.php:269 169 | msgid "Contact" 170 | msgstr "" 171 | 172 | #. id 173 | #: includes/admin.php:276 174 | msgid "Email (*)" 175 | msgstr "" 176 | 177 | #. id 178 | #: includes/admin.php:283 179 | msgid "CSS Class" 180 | msgstr "" 181 | 182 | #: includes/admin.php:359 183 | msgid "Top bar" 184 | msgstr "" 185 | 186 | #: includes/admin.php:360 187 | msgid "Center popup" 188 | msgstr "" 189 | 190 | #: includes/admin.php:361 191 | msgid "Bottom bar" 192 | msgstr "" 193 | 194 | #: includes/admin.php:370 195 | msgid "" 196 | "Your privacy is important to us. We need your data just for the important " 197 | "process of services. Please allow if you accept the term of privacy comply " 198 | "with PDPA." 199 | msgstr "" 200 | 201 | #: includes/admin.php:379 202 | msgid "Your website name or Company name" 203 | msgstr "" 204 | 205 | #: includes/admin.php:413 206 | msgid "Such as John Doe (081-111-1111)" 207 | msgstr "" 208 | 209 | #: includes/admin.php:445 210 | msgid "For wrapper div element" 211 | msgstr "" 212 | 213 | #: includes/admin.php:449 214 | msgid "Make the box place to top bar" 215 | msgstr "" 216 | 217 | #: includes/admin.php:453 218 | msgid "Make the box place center the screen" 219 | msgstr "" 220 | 221 | #: includes/admin.php:465 222 | msgid "Style for not allow button" 223 | msgstr "" 224 | 225 | #: includes/admin.php:469 226 | msgid "Style for allow button" 227 | msgstr "" 228 | 229 | #. Description of the plugin 230 | msgid "" 231 | "PDPA Consent allows you to notify to the user to accept privacy terms. " 232 | "Comply with Thailand PDPA law." 233 | msgstr "" 234 | 235 | #. URI of the plugin 236 | msgid "https://github.com/iamapinan/PDPA-Consent" 237 | msgstr "" 238 | 239 | #. Author of the plugin 240 | msgid "Apinan Woratrakun, Aeknarin Sirisub" 241 | msgstr "" 242 | 243 | #. Author URI of the plugin 244 | msgid "https://www.ioblog.me" 245 | msgstr "" 246 | -------------------------------------------------------------------------------- /languages/pdpa-consent-th.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: PDPA Consent\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2020-05-15 07:23+0000\n" 6 | "PO-Revision-Date: 2020-05-15 07:27+0000\n" 7 | "Last-Translator: \n" 8 | "Language-Team: ไทย\n" 9 | "Language: th\n" 10 | "Plural-Forms: nplurals=1; plural=0;\n" 11 | "MIME-Version: 1.0\n" 12 | "Content-Type: text/plain; charset=UTF-8\n" 13 | "Content-Transfer-Encoding: 8bit\n" 14 | "X-Generator: Loco https://localise.biz/\n" 15 | "X-Loco-Version: 2.3.4; wp-5.4.1" 16 | 17 | #: pdpa-consent.php:94 18 | msgid "" 19 | "Please setup PDPA Consent setting in plugin page." 21 | msgstr "" 22 | "กรุณาตั้งค่า PDPA Consent ใน plugin page." 24 | 25 | #: pdpa-consent.php:102 26 | msgid "User Privacy" 27 | msgstr "ข้อมูลส่วนบุคคล" 28 | 29 | #: pdpa-consent.php:114 30 | msgid "User privacy page is created" 31 | msgstr "หน้าข้อมูลส่วนบุคคลถูกสร้างแล้ว" 32 | 33 | #: pdpa-consent.php:115 34 | msgid "View page" 35 | msgstr "ดูหน้า" 36 | 37 | #: pdpa-consent.php:263 38 | msgid "Read term and privacy policy" 39 | msgstr "อ่านเงื่อนไขการรักษาข้อมูลส่วนบุคคล" 40 | 41 | #: pdpa-consent.php:273 pdpa-consent.php:303 includes/user_template.php:7 42 | msgid "Allow" 43 | msgstr "ยอมรับ" 44 | 45 | #: pdpa-consent.php:281 46 | msgid "Not Allow" 47 | msgstr "ไม่ยอมรับ" 48 | 49 | #: pdpa-consent.php:291 50 | msgid "PDPA Allow" 51 | msgstr "ยอมรับ PDPA" 52 | 53 | #: pdpa-consent.php:301 54 | msgid "Waiting for consent." 55 | msgstr "รออนุมัติ" 56 | 57 | #: pdpa-consent.php:301 58 | msgid "Waiting." 59 | msgstr "รอ" 60 | 61 | #: pdpa-consent.php:303 includes/user_template.php:7 62 | #: includes/user_template.php:7 63 | msgid "Not allow." 64 | msgstr "ไม่อนุมัติ" 65 | 66 | #: pdpa-consent.php:303 includes/user_template.php:7 67 | msgid "Allow." 68 | msgstr "อนุมัติ" 69 | 70 | #: includes/user_template.php:10 71 | msgid "Timestamp" 72 | msgstr "เมื่อ" 73 | 74 | #: includes/user_template.php:15 75 | msgid "Download profile data" 76 | msgstr "ดาวน์โหลดสำเนาข้อมูล" 77 | 78 | #: includes/user_template.php:16 79 | msgid "Reset consent" 80 | msgstr "แก้ไขการยินยอม" 81 | 82 | #: includes/user_template.php:17 83 | msgid "Delete account" 84 | msgstr "ลบข้อมูลบัญชีผู้ใช้ทั้งหมด" 85 | 86 | #: includes/admin.php:27 87 | msgid "pdpa-term" 88 | msgstr "pdpa-term" 89 | 90 | #: includes/admin.php:60 91 | msgid "Thailand’s Personal Data Protection Act (PDPA)" 92 | msgstr "เงื่อนไขและนโยบายข้อมูลส่วนบุคลล (PDPA)" 93 | 94 | #: includes/admin.php:78 95 | msgid "PDPA Consent term page is regenerated." 96 | msgstr "หน้า PDPA Term ถูกสร้างใหม่แล้ว" 97 | 98 | #. Name of the plugin 99 | #: includes/admin.php:84 100 | msgid "PDPA Consent" 101 | msgstr "PDPA Consent" 102 | 103 | #. id 104 | #: includes/admin.php:139 105 | msgid "PDPA Consent setup" 106 | msgstr "ตั้งค่า PDPA Consent" 107 | 108 | #. id 109 | #: includes/admin.php:152 110 | msgid "Privacy page" 111 | msgstr "หน้า Privacy Policy ที่ถูกสร้าง" 112 | 113 | #. id 114 | #: includes/admin.php:161 115 | msgid "Regenerate the privacy page." 116 | msgstr "สร้างหน้า PDPA Term ใหม่อีกครั้ง" 117 | 118 | #. id 119 | #: includes/admin.php:169 120 | msgid "Enable consent noti" 121 | msgstr "เปิดใช้งาน Popup แจ้งเตือน" 122 | 123 | #. id 124 | #: includes/admin.php:206 125 | msgid "Use dark theme" 126 | msgstr "ใช้ธีมมืด" 127 | 128 | #. id 129 | #: includes/admin.php:213 130 | msgid "Allow button color" 131 | msgstr "สีปุ่มอนุญาต" 132 | 133 | #. id 134 | #: includes/admin.php:220 135 | msgid "Not allow button color" 136 | msgstr "สีปุ่มไม่อนุญาต" 137 | 138 | #. id 139 | #: includes/admin.php:227 140 | msgid "Notification popup type" 141 | msgstr "รูปแบบการแจ้งเตือน" 142 | 143 | #. id 144 | #: includes/admin.php:234 145 | msgid "Popup message" 146 | msgstr "ข้อความแจ้ง" 147 | 148 | #. id 149 | #: includes/admin.php:241 150 | msgid "Website name (*)" 151 | msgstr "ชื่อเว็บไซต์ (*)" 152 | 153 | #. id 154 | #: includes/admin.php:248 155 | msgid "Web description" 156 | msgstr "คำอธิบายเกี่ยวกับบริการ" 157 | 158 | #. id 159 | #: includes/admin.php:255 160 | msgid "List of user data (*)
(one data set per line)" 161 | msgstr "รายการข้อมูลที่ขอสิทธิ (*)
(1 แถวต่อ 1 ข้อมูลที่ขอ)" 162 | 163 | #. id 164 | #: includes/admin.php:262 165 | msgid "Address (*)" 166 | msgstr "ที่อยู่ (*)" 167 | 168 | #. id 169 | #: includes/admin.php:269 170 | msgid "Contact" 171 | msgstr "การติดต่อ" 172 | 173 | #. id 174 | #: includes/admin.php:276 175 | msgid "Email (*)" 176 | msgstr "อีเมล์ (*)" 177 | 178 | #. id 179 | #: includes/admin.php:283 180 | msgid "CSS Class" 181 | msgstr "CSS Class" 182 | 183 | #: includes/admin.php:359 184 | msgid "Top bar" 185 | msgstr "ด้านบน" 186 | 187 | #: includes/admin.php:360 188 | msgid "Center popup" 189 | msgstr "ตรงกลาง" 190 | 191 | #: includes/admin.php:361 192 | msgid "Bottom bar" 193 | msgstr "ด้านล่าง" 194 | 195 | #: includes/admin.php:370 196 | msgid "" 197 | "Your privacy is important to us. We need your data just for the important " 198 | "process of services. Please allow if you accept the term of privacy comply " 199 | "with PDPA." 200 | msgstr "" 201 | "ความเป็นส่วนตัวของคุณคือสิ่งสำคัญสำหรับเรา " 202 | "เราต้องการข้อมูลของคุณเพียงเพื่อการประมวลผลที่จำเป็นต่อการให้บริการ โปรด " 203 | "ยินยอม ถ้าคุณยอมรับเงื่อนไขการข้อตกลงในการใช้งานที่รวมถึง PDPA ของไทย" 204 | 205 | #: includes/admin.php:379 206 | msgid "Your website name or Company name" 207 | msgstr "ชื่อเว็บไซต์หรือชื่อบริการของคุณ" 208 | 209 | #: includes/admin.php:413 210 | msgid "Such as John Doe (081-111-1111)" 211 | msgstr "เช่น มะลิ (081-111-1111)" 212 | 213 | #: includes/admin.php:445 214 | msgid "For wrapper div element" 215 | msgstr "For wrapper div element" 216 | 217 | #: includes/admin.php:449 218 | msgid "Make the box place to top bar" 219 | msgstr "Make the box place to top bar" 220 | 221 | #: includes/admin.php:453 222 | msgid "Make the box place center the screen" 223 | msgstr "Make the box place center the screen" 224 | 225 | #: includes/admin.php:465 226 | msgid "Style for not allow button" 227 | msgstr "Style for not allow button" 228 | 229 | #: includes/admin.php:469 230 | msgid "Style for allow button" 231 | msgstr "Style for allow button" 232 | 233 | #. Description of the plugin 234 | msgid "" 235 | "PDPA Consent allows you to notify to the user to accept privacy terms. " 236 | "Comply with Thailand PDPA law." 237 | msgstr "" 238 | "กำหนดเงื่อนไขและนโยบาลเกี่ยวกับข้อมูลส่วนบุคคล " 239 | "ตามกฎหมายคุ้มคลองข้อมูลส่วนบุคคล PDAP สำหรับประเทศไทย" 240 | 241 | #. URI of the plugin 242 | msgid "https://github.com/iamapinan/PDPA-Consent" 243 | msgstr "https://github.com/iamapinan/PDPA-Consent" 244 | 245 | #. Author of the plugin 246 | msgid "Apinan Woratrakun, Aeknarin Sirisub" 247 | msgstr "Apinan Woratrakun, Aeknarin Sirisub" 248 | 249 | #. Author URI of the plugin 250 | msgid "https://www.ioblog.me" 251 | msgstr "https://www.ioblog.me" 252 | -------------------------------------------------------------------------------- /languages/pdpa-consent-en_US.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: PDPA Consent\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2020-05-15 07:23+0000\n" 6 | "PO-Revision-Date: 2020-05-15 07:24+0000\n" 7 | "Last-Translator: \n" 8 | "Language-Team: English (United States)\n" 9 | "Language: en_US\n" 10 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 11 | "MIME-Version: 1.0\n" 12 | "Content-Type: text/plain; charset=UTF-8\n" 13 | "Content-Transfer-Encoding: 8bit\n" 14 | "X-Generator: Loco https://localise.biz/\n" 15 | "X-Loco-Version: 2.3.4; wp-5.4.1" 16 | 17 | #: pdpa-consent.php:94 18 | msgid "" 19 | "Please setup PDPA Consent setting in plugin page." 21 | msgstr "" 22 | "Please setup PDPA Consent setting in plugin page." 24 | 25 | #: pdpa-consent.php:102 26 | msgid "User Privacy" 27 | msgstr "User Privacy" 28 | 29 | #: pdpa-consent.php:114 30 | msgid "User privacy page is created" 31 | msgstr "User privacy page is created" 32 | 33 | #: pdpa-consent.php:115 34 | msgid "View page" 35 | msgstr "View page" 36 | 37 | #: pdpa-consent.php:263 38 | msgid "Read term and privacy policy" 39 | msgstr "Read term and privacy policy" 40 | 41 | #: pdpa-consent.php:273 pdpa-consent.php:303 includes/user_template.php:7 42 | msgid "Allow" 43 | msgstr "Allow" 44 | 45 | #: pdpa-consent.php:281 46 | msgid "Not Allow" 47 | msgstr "Not Allow" 48 | 49 | #: pdpa-consent.php:291 50 | msgid "PDPA Allow" 51 | msgstr "PDPA Allow" 52 | 53 | #: pdpa-consent.php:301 54 | msgid "Waiting for consent." 55 | msgstr "Waiting for consent." 56 | 57 | #: pdpa-consent.php:301 58 | msgid "Waiting." 59 | msgstr "Waiting." 60 | 61 | #: pdpa-consent.php:303 includes/user_template.php:7 62 | #: includes/user_template.php:7 63 | msgid "Not allow." 64 | msgstr "Not allow." 65 | 66 | #: pdpa-consent.php:303 includes/user_template.php:7 67 | msgid "Allow." 68 | msgstr "Allow." 69 | 70 | #: includes/user_template.php:10 71 | msgid "Timestamp" 72 | msgstr "Timestamp" 73 | 74 | #: includes/user_template.php:15 75 | msgid "Download profile data" 76 | msgstr "Download profile data" 77 | 78 | #: includes/user_template.php:16 79 | msgid "Reset consent" 80 | msgstr "Reset consent" 81 | 82 | #: includes/user_template.php:17 83 | msgid "Delete account" 84 | msgstr "Delete account" 85 | 86 | #: includes/admin.php:27 87 | msgid "pdpa-term" 88 | msgstr "pdpa-term" 89 | 90 | #: includes/admin.php:60 91 | msgid "Thailand’s Personal Data Protection Act (PDPA)" 92 | msgstr "Thailand’s Personal Data Protection Act (PDPA)" 93 | 94 | #: includes/admin.php:78 95 | msgid "PDPA Consent term page is regenerated." 96 | msgstr "PDPA Consent term page is regenerated." 97 | 98 | #. Name of the plugin 99 | #: includes/admin.php:84 100 | msgid "PDPA Consent" 101 | msgstr "PDPA Consent" 102 | 103 | #. id 104 | #: includes/admin.php:139 105 | msgid "PDPA Consent setup" 106 | msgstr "PDPA Consent setup" 107 | 108 | #. id 109 | #: includes/admin.php:152 110 | msgid "Privacy page" 111 | msgstr "Privacy page" 112 | 113 | #. id 114 | #: includes/admin.php:161 115 | msgid "Regenerate the privacy page." 116 | msgstr "Regenerate the privacy page." 117 | 118 | #. id 119 | #: includes/admin.php:169 120 | msgid "Enable consent noti" 121 | msgstr "Enable consent noti" 122 | 123 | #. id 124 | #: includes/admin.php:206 125 | msgid "Use dark theme" 126 | msgstr "Use dark theme" 127 | 128 | #. id 129 | #: includes/admin.php:213 130 | msgid "Allow button color" 131 | msgstr "Allow button color" 132 | 133 | #. id 134 | #: includes/admin.php:220 135 | msgid "Not allow button color" 136 | msgstr "Not allow button color" 137 | 138 | #. id 139 | #: includes/admin.php:227 140 | msgid "Notification popup type" 141 | msgstr "Notification popup type" 142 | 143 | #. id 144 | #: includes/admin.php:234 145 | msgid "Popup message" 146 | msgstr "Popup message" 147 | 148 | #. id 149 | #: includes/admin.php:241 150 | msgid "Website name (*)" 151 | msgstr "Website name (*)" 152 | 153 | #. id 154 | #: includes/admin.php:248 155 | msgid "Web description" 156 | msgstr "Web description" 157 | 158 | #. id 159 | #: includes/admin.php:255 160 | msgid "List of user data (*)
(one data set per line)" 161 | msgstr "List of user data (*)
(one data set per line)" 162 | 163 | #. id 164 | #: includes/admin.php:262 165 | msgid "Address (*)" 166 | msgstr "Address (*)" 167 | 168 | #. id 169 | #: includes/admin.php:269 170 | msgid "Contact" 171 | msgstr "Contact" 172 | 173 | #. id 174 | #: includes/admin.php:276 175 | msgid "Email (*)" 176 | msgstr "Email (*)" 177 | 178 | #. id 179 | #: includes/admin.php:283 180 | msgid "CSS Class" 181 | msgstr "CSS Class" 182 | 183 | #: includes/admin.php:359 184 | msgid "Top bar" 185 | msgstr "Top bar" 186 | 187 | #: includes/admin.php:360 188 | msgid "Center popup" 189 | msgstr "Center popup" 190 | 191 | #: includes/admin.php:361 192 | msgid "Bottom bar" 193 | msgstr "Bottom bar" 194 | 195 | #: includes/admin.php:370 196 | msgid "" 197 | "Your privacy is important to us. We need your data just for the important " 198 | "process of services. Please allow if you accept the term of privacy comply " 199 | "with PDPA." 200 | msgstr "" 201 | "Your privacy is important to us. We need your data just for the important " 202 | "process of services. Please allow if you accept the term of privacy comply " 203 | "with PDPA." 204 | 205 | #: includes/admin.php:379 206 | msgid "Your website name or Company name" 207 | msgstr "Your website name or Company name" 208 | 209 | #: includes/admin.php:413 210 | msgid "Such as John Doe (081-111-1111)" 211 | msgstr "Such as John Doe (081-111-1111)" 212 | 213 | #: includes/admin.php:445 214 | msgid "For wrapper div element" 215 | msgstr "For wrapper div element" 216 | 217 | #: includes/admin.php:449 218 | msgid "Make the box place to top bar" 219 | msgstr "Make the box place to top bar" 220 | 221 | #: includes/admin.php:453 222 | msgid "Make the box place center the screen" 223 | msgstr "Make the box place center the screen" 224 | 225 | #: includes/admin.php:465 226 | msgid "Style for not allow button" 227 | msgstr "Style for not allow button" 228 | 229 | #: includes/admin.php:469 230 | msgid "Style for allow button" 231 | msgstr "Style for allow button" 232 | 233 | #. Description of the plugin 234 | msgid "" 235 | "PDPA Consent allows you to notify to the user to accept privacy terms. " 236 | "Comply with Thailand PDPA law." 237 | msgstr "" 238 | "PDPA Consent allows you to notify to the user to accept privacy terms. " 239 | "Comply with Thailand PDPA law." 240 | 241 | #. URI of the plugin 242 | msgid "https://github.com/iamapinan/PDPA-Consent" 243 | msgstr "https://github.com/iamapinan/PDPA-Consent" 244 | 245 | #. Author of the plugin 246 | msgid "Apinan Woratrakun, Aeknarin Sirisub" 247 | msgstr "Apinan Woratrakun, Aeknarin Sirisub" 248 | 249 | #. Author URI of the plugin 250 | msgid "https://www.ioblog.me" 251 | msgstr "https://www.ioblog.me" 252 | -------------------------------------------------------------------------------- /assets/axios.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new s(e),n=i(s.prototype.request,t);return o.extend(n,s.prototype,t),o.extend(n,t),n}var o=n(2),i=n(3),s=n(4),a=n(22),u=n(10),c=r(u);c.Axios=s,c.create=function(e){return r(a(c.defaults,e))},c.Cancel=n(23),c.CancelToken=n(24),c.isCancel=n(9),c.all=function(e){return Promise.all(e)},c.spread=n(25),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===j.call(e)}function o(e){return"undefined"==typeof e}function i(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function s(e){return"[object ArrayBuffer]"===j.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function u(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function c(e){return"string"==typeof e}function f(e){return"number"==typeof e}function p(e){return null!==e&&"object"==typeof e}function d(e){return"[object Date]"===j.call(e)}function l(e){return"[object File]"===j.call(e)}function h(e){return"[object Blob]"===j.call(e)}function m(e){return"[object Function]"===j.call(e)}function y(e){return p(e)&&m(e.pipe)}function g(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function v(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function x(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function w(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){u.headers[e]={}}),i.forEach(["post","put","patch"],function(e){u.headers[e]=i.merge(a)}),e.exports=u},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(13),i=n(5),s=n(16),a=n(19),u=n(20),c=n(14);e.exports=function(e){return new Promise(function(t,f){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password||"";d.Authorization="Basic "+btoa(h+":"+m)}var y=s(e.baseURL,e.url);if(l.open(e.method.toUpperCase(),i(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?a(l.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?l.response:l.responseText,i={data:r,status:l.status,statusText:l.statusText,headers:n,config:e,request:l};o(t,f,i),l=null}},l.onabort=function(){l&&(f(c("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){f(c("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),f(c(t,e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var g=n(21),v=(e.withCredentials||u(y))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;v&&(d[e.xsrfHeaderName]=v)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),f(e),l=null)}),void 0===p&&(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e,t,n){var o=n.config.validateStatus;!o||o(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(17),o=n(18);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?s[t]=(s[t]?s[t]:[]).concat([n]):s[t]=s[t]?s[t]+", "+n:n}}),s):s}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){t=t||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],s=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,function(e){"undefined"!=typeof t[e]&&(n[e]=t[e])}),r.forEach(i,function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):"undefined"!=typeof t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):"undefined"!=typeof e[o]&&(n[o]=e[o])}),r.forEach(s,function(r){"undefined"!=typeof t[r]?n[r]=t[r]:"undefined"!=typeof e[r]&&(n[r]=e[r])});var a=o.concat(i).concat(s),u=Object.keys(t).filter(function(e){return a.indexOf(e)===-1});return r.forEach(u,function(r){"undefined"!=typeof t[r]?n[r]=t[r]:"undefined"!=typeof e[r]&&(n[r]=e[r])}),n}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); 2 | //# sourceMappingURL=axios.min.map -------------------------------------------------------------------------------- /pdpa-consent.php: -------------------------------------------------------------------------------- 1 | plugin_info = get_plugin_data(PDPA_PATH . 'pdpa-consent.php'); 48 | $this->locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale(); 49 | $this->cookie_domain = parse_url(site_url())['host']; 50 | $this->cookie_expire = strtotime("next Month"); 51 | $this->options = get_option('pdpa_option'); 52 | 53 | $this->includes(); 54 | $this->init(); 55 | } 56 | 57 | private function includes () { 58 | // Includes 59 | if (is_admin()) { 60 | require_once(PDPA_PATH . 'includes/admin.php'); 61 | new PDPA_Admin; 62 | } 63 | 64 | require_once(PDPA_PATH . 'includes/template.php'); 65 | // require_once(PDPA_PATH . 'includes/user.php'); 66 | // new PDPA_User; 67 | } 68 | 69 | public function init() 70 | { 71 | register_activation_hook(__FILE__, array( $this, 'plugin_activate' )); 72 | add_action('admin_init', array( $this, 'load_plugin' )); 73 | add_filter('body_class', array( $this, 'change_body_class' )); 74 | // Add consent html to frontend 75 | if (function_exists('wp_body_open')) { 76 | add_action('wp_body_open', array( $this, 'add_consent')); 77 | } else { 78 | add_action('wp_footer', array( $this, 'add_consent')); 79 | } 80 | // Ajax request for logged in user 81 | add_action('wp_ajax_pdpa_action', array( $this, 'pdpa_ajax_do' )); 82 | // Ajax request for guest user 83 | add_action('wp_ajax_nopriv_pdpa_action', array( $this, 'pdpa_ajax_do' )); 84 | 85 | // Add scripts 86 | add_action('wp_enqueue_scripts', array( $this, 'pdpa_enqueue_scripts' )); 87 | // Add functions to users 88 | add_filter('manage_users_columns', array( $this, 'pdpa_add_user_columns' )); 89 | add_filter('manage_users_custom_column', array( $this, 'pdpa_add_user_column_data' ), 99, 3); 90 | } 91 | 92 | public function plugin_activate() 93 | { 94 | add_option('Activated_Plugin', $this->plugin_info['TextDomain']); 95 | } 96 | 97 | public function load_plugin() 98 | { 99 | if (!function_exists('wp_body_open')) { 100 | add_action('admin_notices', array( $this, 'version_not_support_notice' )); 101 | } 102 | 103 | if (is_admin() && get_option('Activated_Plugin') == $this->plugin_info['TextDomain']) { 104 | $this->generate_pdpa_user_page(); 105 | add_action('admin_notices', array( $this, 'setup_admin_notice' )); 106 | } 107 | } 108 | 109 | public function setup_admin_notice() 110 | { 111 | if (!get_option('pdpa-consent-page-id')) { 112 | echo '
113 |

'.__('Please setup PDPA Consent setting in plugin page.', 'pdpa-consent').'

114 |
'; 115 | } 116 | } 117 | 118 | public function version_not_support_notice() 119 | { 120 | if (!get_option('pdpa-consent-page-id')) { 121 | echo '
122 |

'.__('PDPA not support WordPress version older than 5.2. Please update your website.', 'pdpa-consent').'

123 |
'; 124 | } 125 | } 126 | 127 | public function generate_pdpa_user_page() 128 | { 129 | if (!get_option('pdpa-consent-user_privacy-page')) { 130 | $page_details = array( 131 | 'post_title' => __('User Privacy', 'pdpa-consent'), 132 | 'post_name' => 'pdpa-user-privacy', 133 | 'post_content' => '[pdpa_user_page]', 134 | 'post_status' => 'publish', 135 | 'post_author' => 1, 136 | 'post_type' => 'page' 137 | ); 138 | 139 | $page_id = wp_insert_post($page_details); 140 | add_option('pdpa-consent-user_privacy-page', $page_id); 141 | 142 | printf( 143 | '

%s %s

', 144 | __('User privacy page is created', 'pdpa-consent'), 145 | __('View page', 'pdpa-consent') 146 | ); 147 | } 148 | } 149 | 150 | public function pdpa_enqueue_scripts() 151 | { 152 | wp_enqueue_style($this->plugin_info['TextDomain'], plugins_url('assets/pdpa-consent.css', __FILE__), array(), $this->plugin_info['Version'], 'all' ); 153 | 154 | // Register the script 155 | wp_enqueue_script($this->plugin_info['TextDomain'], plugins_url('assets/axios.min.js', __FILE__), array(), $this->plugin_info['Version'], true ); 156 | wp_register_script('pdpa-script-base', plugins_url('assets/pdpa-consent.js', __FILE__), array(), $this->plugin_info['Version'], true ); 157 | 158 | // Localize the script with new data 159 | $ajax_array = array( 160 | 'ajax_url' => admin_url('admin-ajax.php'), 161 | 'pdpa_nonce' => wp_create_nonce('pdpa-security'), 162 | 'consent_enable'=> ($this->options['is_enable'] && !$this->pdpa_cookies_set()) ? 'yes' : 'no', 163 | 'current_user' => is_user_logged_in() ? get_current_user_id() : 'guest', 164 | 'pdpa_version' => $this->plugin_info['Version'] 165 | ); 166 | 167 | wp_localize_script('pdpa-script-base', 'pdpa_ajax', $ajax_array); 168 | 169 | // Enqueued script with localized data. 170 | wp_enqueue_script('pdpa-script-base'); 171 | } 172 | 173 | 174 | /** 175 | * Check is cookie set 176 | */ 177 | public function pdpa_cookies_set() 178 | { 179 | return isset($_COOKIE['pdpa_accepted']) ? true : false; 180 | } 181 | /** 182 | * Check is accept 183 | */ 184 | public function pdpa_cookies_accepted() 185 | { 186 | return (isset($_COOKIE['pdpa_accepted']) && $_COOKIE['pdpa_accepted'] === 1) ? true : false; 187 | } 188 | 189 | /** 190 | * Add WP Super Cache cookie. 191 | */ 192 | public function wpsc_set_cookie() 193 | { 194 | do_action('wpsc_add_cookie', 'pdpa_accepted'); 195 | } 196 | 197 | /** 198 | * Delete WP Super Cache cookie. 199 | */ 200 | public function wpsc_delete_cookie() 201 | { 202 | do_action('wpsc_delete_cookie', 'pdpa_accepted'); 203 | } 204 | 205 | public function clear_cache() 206 | { 207 | //Clean WP Super Cache's cache files? 208 | if (function_exists('wp_cache_clear_cache')) { 209 | //Newer WP-Super-Cache 210 | wp_cache_clear_cache(); 211 | } elseif (file_exists(WP_CONTENT_DIR . '/wp-cache-config.php') && function_exists('prune_super_cache')) { 212 | //Old WP-Super-Cache 213 | global $cache_path; 214 | prune_super_cache($cache_path . 'supercache/', true); 215 | prune_super_cache($cache_path, true); 216 | } 217 | } 218 | 219 | /*** 220 | * Ajax processing 221 | */ 222 | public function pdpa_ajax_do() 223 | { 224 | $response = []; 225 | $consent_set = sanitize_text_field($_POST['set_status']); 226 | 227 | if (! check_ajax_referer('pdpa-security', 'security', false)) { 228 | wp_send_json_error('Invalid security token sent.'); 229 | wp_die(); 230 | } 231 | 232 | if (is_user_logged_in()) { 233 | $current_user = get_current_user_id(); 234 | $pdpa_meta = get_user_meta($current_user, 'pdpa_status', true); 235 | 236 | if ($pdpa_meta == '') { 237 | add_user_meta($current_user, 'pdpa_status', $consent_set); 238 | add_user_meta($current_user, 'pdpa_status_time', time()); 239 | } else { 240 | update_user_meta($current_user, 'pdpa_status', $consent_set); 241 | update_user_meta($current_user, 'pdpa_status_time', time()); 242 | } 243 | } 244 | 245 | switch ($consent_set) { 246 | case 'pdpa-allow': 247 | if (!$this->pdpa_cookies_accepted()) { 248 | $this->wpsc_set_cookie(); 249 | } 250 | $response = [ 251 | 'status' => 'success', 252 | 'type' => 'user_allow', 253 | 'cookie_domain' => $this->cookie_domain, 254 | 'cookie_expire' => gmdate("Y-m-d\TH:i:s\Z", $this->cookie_expire), 255 | 'cookie_name' => $this->cookie_name 256 | ]; 257 | break; 258 | case 'pdpa-not-allow': 259 | if ($this->pdpa_cookies_accepted()) { 260 | $this->wpsc_delete_cookie(); 261 | } 262 | $response = [ 263 | 'status' => 'success', 264 | 'type' => 'user_not_allow', 265 | 'cookie_domain' => $this->cookie_domain, 266 | 'cookie_expire' => gmdate("Y-m-d\TH:i:s\Z", $this->cookie_expire), 267 | 'cookie_name' => $this->cookie_name 268 | ]; 269 | break; 270 | case 'pdpa-reset': 271 | if ($this->pdpa_cookies_accepted()) { 272 | $this->wpsc_delete_cookie(); 273 | } 274 | $response = [ 275 | 'status' => 'success', 276 | 'type' => 'reset', 277 | 'cookie_domain' => $this->cookie_domain, 278 | 'cookie_expire' => gmdate("Y-m-d\TH:i:s\Z", 0), 279 | 'cookie_name' => $this->cookie_name 280 | ]; 281 | break; 282 | } 283 | // clear wordpress cache. 284 | $this->clear_cache(); 285 | 286 | wp_send_json($response, 200); 287 | wp_die(); 288 | } 289 | 290 | public function change_body_class($classes) 291 | { 292 | if (is_admin()) { 293 | return $classes; 294 | } 295 | 296 | if ($this->pdpa_cookies_set()) { 297 | $classes[] = 'pdpa-set'; 298 | 299 | if ($this->pdpa_cookies_accepted()) { 300 | $classes[] = 'pdpa-accepted'; 301 | } else { 302 | $classes[] = 'pdpa-refused'; 303 | } 304 | } else { 305 | $classes[] = 'pdpa-not-set'; 306 | } 307 | 308 | return $classes; 309 | } 310 | 311 | public function add_consent() 312 | { 313 | $page_id = get_option('pdpa-consent-page-id'); 314 | if ($this->options['is_enable'] && !$this->pdpa_cookies_set()) { 315 | render_template('consent_template', [ 316 | 'options' => $this->options, 317 | 'page_id' => $page_id 318 | ]); 319 | } 320 | } 321 | 322 | //add columns to User panel list page 323 | public function pdpa_add_user_columns($column) 324 | { 325 | $column['pdpa_status'] = __('Consent Allow', 'pdpa-consent'); 326 | return $column; 327 | } 328 | 329 | //add the data 330 | public function pdpa_add_user_column_data($val, $column_name, $user_id) 331 | { 332 | $status = get_user_meta($user_id, 'pdpa_status', true); 333 | if ($status == '' || $status == 'pdpa-reset') { 334 | return ' '.__('Waiting.', 'pdpa-consent'); 335 | } else { 336 | return ($status == 'pdpa-not-allow') ? ' '.__('Not allow.', 'pdpa-consent') : ' '.__('Allow.', 'pdpa-consent'); 337 | } 338 | } 339 | } 340 | 341 | /** 342 | * Initialize PDPA Consent. 343 | */ 344 | function pdpa_load () { 345 | new PDPA_Consent; 346 | } 347 | 348 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { 349 | add_action('plugins_loaded', 'pdpa_load' ); 350 | } else { 351 | pdpa_load(); 352 | } -------------------------------------------------------------------------------- /includes/admin.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | if (! defined('ABSPATH')) { 10 | exit; 11 | } 12 | 13 | class PDPA_Admin 14 | { 15 | private $plugin_info = array(); 16 | private $capability = 'manage_options'; 17 | private $options; 18 | private $locale; 19 | private $page_id; 20 | private $page_name; 21 | 22 | public function __construct() 23 | { 24 | $this->plugin_info = get_plugin_data(PDPA_PATH . 'pdpa-consent.php'); 25 | $this->locale = get_locale(); 26 | $this->page_id = get_option('pdpa-consent-page-id') ? get_option('pdpa-consent-page-id') : 0; 27 | $this->page_name = __('pdpa-term', 'pdpa-consent'); 28 | add_action('admin_menu', array($this, 'pdpa_admin_menu')); 29 | add_action('admin_init', array($this, 'admin_option_setup')); 30 | add_action('admin_enqueue_scripts', array( $this, 'pdpa_enqueue_color_picker' )); 31 | add_action('admin_enqueue_scripts', array( $this, 'pdpa_enqueue_style' )); 32 | } 33 | 34 | private function serialize_html($html, $settings = [ 'website_name' => '', 'site_description' => '', 'list_data' => '', 'site_address' => '', 'site_contact' => '', 'site_email' => '' ]) 35 | { 36 | $settings['list_data'] = str_replace("\n", "
  • ", esc_html($settings['list_data'])); 37 | $html = str_replace('[service]', esc_html($settings['website_name']), $html); 38 | $html = str_replace('[description]', esc_attr($settings['site_description']), $html); 39 | $html = str_replace('[list_data]', $settings['list_data'], $html); 40 | $html = str_replace('[address]', esc_html($settings['site_address']), $html); 41 | $html = str_replace('[contact]', esc_html($settings['site_contact']), $html); 42 | $html = str_replace('[email]', esc_html($settings['site_email']), $html); 43 | return $html; 44 | } 45 | 46 | public function generate_post_from_template() 47 | { 48 | $this->options = get_option('pdpa_option'); 49 | 50 | if (!isset($this->options['regenerate'])) { 51 | return false; 52 | } 53 | 54 | if (file_exists(PDPA_PATH . 'templates/' . $this->locale . '.html')) { 55 | $content = $this->serialize_html(file_get_contents(PDPA_PATH . 'templates/'. $this->locale .'.html'), $this->options); 56 | } else { 57 | $content = $this->serialize_html(file_get_contents(PDPA_PATH . 'templates/th_TH.html'), $this->options); 58 | } 59 | 60 | $page_details = array( 61 | 'ID' => $this->page_id, 62 | 'post_title' => __('Thailand’s Personal Data Protection Act (PDPA)', 'pdpa-consent'), 63 | 'post_name' => $this->page_name, 64 | 'post_content' => $content, 65 | 'post_status' => 'publish', 66 | 'post_author' => 1, 67 | 'post_type' => 'page' 68 | ); 69 | 70 | $page_id = wp_insert_post($page_details); 71 | $this->options['regenerate'] = 0; 72 | update_option('pdpa_option', $this->options); 73 | add_option('pdpa-consent-page-id', $page_id); 74 | add_action('admin_notices', array( $this, 'page_generate_notice' )); 75 | } 76 | 77 | public function page_generate_notice() 78 | { 79 | echo '
    80 |

    '.__('PDPA Consent term page is regenerated.', 'pdpa-consent').'

    81 |
    '; 82 | } 83 | 84 | public function pdpa_admin_menu() 85 | { 86 | 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); 87 | } 88 | 89 | public function pdpa_enqueue_color_picker($hook_suffix) 90 | { 91 | wp_enqueue_style('wp-color-picker'); 92 | wp_enqueue_script('pdpa-script', plugins_url('pdpa-consent/assets/pdpa-admin-script.js'), array( 'wp-color-picker' ), $this->plugin_info['Version'], true ); 93 | } 94 | 95 | public function pdpa_enqueue_style() 96 | { 97 | wp_enqueue_style('pdpa-style', plugins_url('pdpa-consent/assets/pdpa-admin-style.css'), array(), $this->plugin_info['Version'], 'all' ); 98 | } 99 | 100 | public function pdpa_admin_option() 101 | { 102 | if (isset($_POST)) { 103 | $this->generate_post_from_template(); 104 | } ?> 105 | 106 |
    107 |

    108 |
    109 | 113 | 114 | 115 | 116 | 117 | 118 |
    119 |
    120 |

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

    121 |
    122 | options = get_option('pdpa_option'); 143 | 144 | if ($this->page_id !== 0) { 145 | add_settings_field( 146 | '_url_', // id 147 | __('Privacy page', 'pdpa-consent'), // title 148 | array( $this, 'url_callback' ), // callback 149 | 'settings', // page 150 | '_pdpa_setting_section' // section 151 | ); 152 | } 153 | 154 | add_settings_field( 155 | 'regenerate', // id 156 | __('Regenerate the privacy page.', 'pdpa-consent'), // title 157 | array( $this, 'regenerate_callback' ), // callback 158 | 'settings', // page 159 | '_pdpa_setting_section' // section 160 | ); 161 | 162 | add_settings_field( 163 | 'is_enable', // id 164 | __('Enable consent noti', 'pdpa-consent'), // title 165 | array( $this, 'is_enable_callback' ), // callback 166 | 'settings', // page 167 | '_pdpa_setting_section' // section 168 | ); 169 | 170 | 171 | 172 | /*** 173 | * Future functions 174 | * 175 | */ 176 | // add_settings_field( 177 | // 'allow_user_reset', // id 178 | // __( 'Allow user to reset consent','pdpa-consent' ), // title 179 | // array( $this, 'allow_user_reset_callback' ), // callback 180 | // 'settings', // page 181 | // '_pdpa_setting_section' // section 182 | // ); 183 | // add_settings_field( 184 | // 'allow_user_delete', // id 185 | // __( 'Allow user to delete account','pdpa-consent' ), // title 186 | // array( $this, 'allow_user_delete_callback' ), // callback 187 | // 'settings', // page 188 | // '_pdpa_setting_section' // section 189 | // ); 190 | // add_settings_field( 191 | // 'allow_user_download', // id 192 | // __( 'Allow user to download profile','pdpa-consent' ), // title 193 | // array( $this, 'allow_user_download_callback' ), // callback 194 | // 'settings', // page 195 | // '_pdpa_setting_section' // section 196 | // ); 197 | add_settings_field( 198 | 'is_darkmode', // id 199 | __('Use dark theme', 'pdpa-consent'), // title 200 | array( $this, 'is_darkmode_callback' ), // callback 201 | 'settings', // page 202 | '_pdpa_setting_section' // section 203 | ); 204 | add_settings_field( 205 | 'allow_button_color', // id 206 | __('Allow button color', 'pdpa-consent'), // title 207 | array( $this, 'allow_button_color_callback' ), // callback 208 | 'settings', // page 209 | '_pdpa_setting_section' // section 210 | ); 211 | add_settings_field( 212 | 'not_allow_button_color', // id 213 | __('Not allow button color', 'pdpa-consent'), // title 214 | array( $this, 'not_allow_button_color_callback' ), // callback 215 | 'settings', // page 216 | '_pdpa_setting_section' // section 217 | ); 218 | add_settings_field( 219 | 'popup_type', // id 220 | __('Notification popup type', 'pdpa-consent'), // title 221 | array( $this, 'popup_type_callback' ), // callback 222 | 'settings', // page 223 | '_pdpa_setting_section' // section 224 | ); 225 | add_settings_field( 226 | 'popup_message', // id 227 | __('Popup message', 'pdpa-consent'), // title 228 | array( $this, 'popup_message_callback' ), // callback 229 | 'settings', // page 230 | '_pdpa_setting_section' // section 231 | ); 232 | add_settings_field( 233 | 'website_name', // id 234 | __('Website name (*)', 'pdpa-consent'), // title 235 | array( $this, 'website_name_callback' ), // callback 236 | 'settings', // page 237 | '_pdpa_setting_section' // section 238 | ); 239 | add_settings_field( 240 | 'site_description', // id 241 | __('Web description', 'pdpa-consent'), // title 242 | array( $this, 'description_callback' ), // callback 243 | 'settings', // page 244 | '_pdpa_setting_section' // section 245 | ); 246 | add_settings_field( 247 | 'list_data', // id 248 | __('List of user data (*)
    (one data set per line)', 'pdpa-consent'), // title 249 | array( $this, 'list_data_callback' ), // callback 250 | 'settings', // page 251 | '_pdpa_setting_section' // section 252 | ); 253 | add_settings_field( 254 | 'site_address', // id 255 | __('Address (*)', 'pdpa-consent'), // title 256 | array( $this, 'address_callback' ), // callback 257 | 'settings', // page 258 | '_pdpa_setting_section' // section 259 | ); 260 | add_settings_field( 261 | 'site_contact', // id 262 | __('Contact', 'pdpa-consent'), // title 263 | array( $this, 'contact_callback' ), // callback 264 | 'settings', // page 265 | '_pdpa_setting_section' // section 266 | ); 267 | add_settings_field( 268 | 'site_email', // id 269 | __('Email (*)', 'pdpa-consent'), // title 270 | array( $this, 'email_callback' ), // callback 271 | 'settings', // page 272 | '_pdpa_setting_section' // section 273 | ); 274 | add_settings_field( 275 | 'custom_css', // id 276 | __('CSS Class', 'pdpa-consent'), // title 277 | array( $this, 'custom_css_callback' ), // callback 278 | 'settings', // page 279 | '_pdpa_setting_section' // section 280 | ); 281 | } 282 | public function url_callback() 283 | { 284 | printf( 285 | ' ', 286 | $this->page_id, 287 | esc_url(get_admin_url().'post.php?post='.get_option('pdpa-consent-page-id').'&action=edit') 288 | ); 289 | } 290 | public function is_enable_callback() 291 | { 292 | printf( 293 | '', 297 | isset($this->options['is_enable']) ? 'checked' : '' 298 | ); 299 | } 300 | public function regenerate_callback() 301 | { 302 | printf( 303 | '' 307 | ); 308 | } 309 | public function allow_user_reset_callback() 310 | { 311 | printf( 312 | '', 316 | isset($this->options['allow_user_reset']) ? 'checked' : '' 317 | ); 318 | } 319 | public function allow_user_delete_callback() 320 | { 321 | printf( 322 | '', 326 | isset($this->options['allow_user_delete']) ? 'checked' : '' 327 | ); 328 | } 329 | public function allow_user_download_callback() 330 | { 331 | printf( 332 | '', 336 | isset($this->options['allow_user_download']) ? 'checked' : '' 337 | ); 338 | } 339 | public function is_darkmode_callback() 340 | { 341 | printf( 342 | '', 346 | isset($this->options['is_darkmode']) ? 'checked' : '' 347 | ); 348 | } 349 | public function allow_button_color_callback() 350 | { 351 | printf( 352 | '', 353 | $this->options['allow_button_color'] 354 | ); 355 | } 356 | public function not_allow_button_color_callback() 357 | { 358 | printf( 359 | '', 360 | $this->options['not_allow_button_color'] 361 | ); 362 | } 363 | public function popup_type_callback() 364 | { 365 | ?> 366 | 371 | %s', 378 | 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') 379 | ); 380 | } 381 | 382 | public function website_name_callback() 383 | { 384 | printf( 385 | '', 386 | isset($this->options['website_name']) ? esc_html($this->options['website_name']) : '', 387 | __('Your website name or Company name', 'pdpa-consent') 388 | ); 389 | } 390 | 391 | public function description_callback() 392 | { 393 | printf( 394 | '', 395 | isset($this->options['site_description']) ? esc_html($this->options['site_description']) : '' 396 | ); 397 | } 398 | 399 | public function list_data_callback() 400 | { 401 | printf( 402 | '', 403 | __("Fullname\nBirthday\nEtc."), 404 | isset($this->options['list_data']) ? esc_html($this->options['list_data']) : '' 405 | ); 406 | } 407 | 408 | public function address_callback() 409 | { 410 | printf( 411 | '', 412 | isset($this->options['site_address']) ? esc_html($this->options['site_address']) : '' 413 | ); 414 | } 415 | 416 | public function contact_callback() 417 | { 418 | printf( 419 | '', 420 | isset($this->options['site_contact']) ? esc_html($this->options['site_contact']) : '', 421 | __("Such as John Doe (081-111-1111)", 'pdpa-consent') 422 | ); 423 | } 424 | 425 | public function email_callback() 426 | { 427 | printf( 428 | '', 429 | isset($this->options['site_email']) ? sanitize_email($this->options['site_email']) : '' 430 | ); 431 | } 432 | 433 | public function custom_css_callback() 434 | { 435 | ?> 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 |
    .pdpa-consent-wrap {}
    .pdpa-place-top {}
    .pdpa-place-center {}
    .pdpa-place-bottom {}
    .pdpa-consent-text {}
    .pdpa-consent-not-allow-button {}
    .pdpa-consent-allow-button {}
    466 | 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------