From d62acec4bcc182c248a7848e2da725db4aa2c29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Gime=CC=81nez?= Date: Fri, 25 May 2018 17:47:36 +0200 Subject: [PATCH] Added GDPR tab with new features --- .gitignore | 33 +++++++++ assets/css/style.css | 69 ++++++++++++++++-- assets/css/style.min.css | 3 +- .../classes/wp-maintenance-mode-admin.php | 48 +++++++++++- includes/classes/wp-maintenance-mode.php | 22 +++++- readme.md | 3 +- readme.txt | 11 ++- views/maintenance.php | 26 ++++++- views/settings.php | 73 ++++++++++++++++--- wp-maintenance-mode.php | 2 +- 10 files changed, 259 insertions(+), 31 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..139ad4a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +### General CodeKit files to ignore +*.codekit3 + +### VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### MacOS +# General +.DS_Store +.AppleDouble +.LSOverride +# Icon must end with two \r +Icon +# Thumbnails +._* +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk \ No newline at end of file diff --git a/assets/css/style.css b/assets/css/style.css index abf63bd7..15fe3655 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -29,7 +29,7 @@ blockquote:before, blockquote:after, q:before, q:after { content: none; } input, button { - -webkit-appearance: none; + /* -webkit-appearance: none; */ border-radius: 0; } table { @@ -116,16 +116,43 @@ body { /** * SUBSCRIBE FORM **/ - -.wrap form.subscribe_form { +.wrap div.subscribe_border { + border: 3px solid #e0e0e0; box-sizing: border-box; width: 450px; - margin: 0 0 75px; display: inline-block; - border: 3px solid #e0e0e0; +} +.wrap form.subscribe_form { + /* box-sizing: border-box; + width: 450px; */ + margin: 0 0 75px; + /* display: inline-block; */ + /* border: 3px solid #e0e0e0; */ overflow: hidden; text-align: center; } +.wrap .subscribe_form .privacy_checkbox { + color: #909090; + max-width: 450px; + margin: 15px auto; + position: relative; +} +.wrap form.subscribe_form .privacy_checkbox label.error { + display: block !important; + position: absolute; + font-size: 11px; + left: 39%; +} +.wrap .subscribe_form .privacy_checkbox input { + float: none; + margin: 3px 4.7px; +} +.wrap .subscribe_form .privacy_tail { + font-size: 11px; + color: #909090; + max-width: 450px; + margin: 0 auto; +} .wrap form.subscribe_form input { margin: 0; outline: 0; @@ -291,7 +318,9 @@ body { margin: 100px auto; transition: 0.2s transform ease-in-out; } -.contact .form input, .contact .form textarea { +.contact .form input[type=text], +.contact .form input[type=submit], +.contact .form textarea { padding: 15px 20px; margin: 0; outline: 0; @@ -303,6 +332,28 @@ body { box-sizing: border-box; resize: none; } +.contact .form label#content-error { margin-bottom: 10px; } +.contact .form .privacy_checkbox { + margin-top: 20px; + clear: both; + color: #909090; + font-size: 15px; + position: relative; +} +.contact .form .privacy_checkbox label#acceptance-error { + position: absolute; + top: 10px; + left: 39%; +} +.contact .form .privacy_checkbox input { + transform: translatey(-2px); +} +.contact .form .privacy_tail { + font-size: 11px; + color: #c7c7c7; + margin-top: 16px; + line-height: 14px; +} .contact .form textarea { height: 175px; padding: 20px; @@ -477,3 +528,9 @@ body { width: 70%; } } +@media only screen and (max-width: 465px) { + .contact .form .privacy_checkbox label#acceptance-error { + top: 28px; + left: 32%; + } +} \ No newline at end of file diff --git a/assets/css/style.min.css b/assets/css/style.min.css index 2f4af044..a35f86c8 100644 --- a/assets/css/style.min.css +++ b/assets/css/style.min.css @@ -1,2 +1 @@ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;text-decoration:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{display:block;width:500px;margin:0 auto;text-align:left;position:relative;font-style:italic}blockquote:before,blockquote:after,q:before,q:after{content:'"';content:none}input,button{-webkit-appearance:none;border-radius:0}table{border-collapse:collapse;border-spacing:0}em,i{font-style:italic}del{text-decoration:line-through}strong,b{font-weight:bold}ol{width:600px;margin:0 auto;text-align:left}ol li{list-style-type:decimal}ul{width:600px;margin:0 auto;text-align:left}ul li{list-style:disc}a{color:inherit;text-decoration:underline}body,html{min-height:100%}body{background-color:#fff;color:#1b1f23;font-family:Helvetica Neue, Arial, sans-serif}.wrap{width:605px;margin:100px auto 0;text-align:center}.wrap h1{font-size:30px;font-weight:700;margin:0 0 90px}.wrap h2{font-size:24px;font-weight:400;line-height:45px;margin:0 0 80px}.wrap h3{font-size:24px;font-weight:400;margin:0 0 45px}.wrap .author_link{margin-top:15px;color:#616161;margin:0 0 50px}.wrap .author_link a{color:#000}.wrap .countdown{margin:0 0 85px}.wrap .countdown span{font-size:30px}.wrap form.subscribe_form{-webkit-box-sizing:border-box;box-sizing:border-box;width:450px;margin:0 0 75px;display:inline-block;border:3px solid #e0e0e0;overflow:hidden;text-align:center}.wrap form.subscribe_form input{margin:0;outline:0;border:0;float:left;font-size:18px;padding:20px 25px;-webkit-box-sizing:content-box;box-sizing:content-box}.wrap form.subscribe_form input[type="text"]{width:245px}.wrap form.subscribe_form input[type="submit"]{background:#000;color:#fff;float:right;cursor:pointer;padding:20px 30px;border-left:3px solid #e0e0e0;-webkit-transition:all .3s;transition:all .3s}.wrap form.subscribe_form input[type="submit"]:hover{background:#fff;color:#000;border-left:3px solid #e0e0e0}.wrap form.subscribe_form input[type="submit"]:active{background:#1e1e1e;color:#fff}.wrap form.subscribe_form .error{color:red}.wrap form.subscribe_form label.error{display:none !important}.wrap form.login_form{width:100%;margin:15px 0 0}.wrap form.login_form input{display:inline-block;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:3px solid #E2E2E2;font-family:Helvetica Neue, Arial, sans-serif;font-size:16px;margin:0 10px 0 0;outline:0;padding:15px}.wrap form.login_form input[type="submit"]{background:#000;color:#fff;margin:0;border-color:#000;font-weight:bold;padding:15px 30px;cursor:pointer}.wrap form.login_form input[type="submit"]:active{position:relative;top:1px}.wrap .social{margin:0 0 70px}.wrap .social a{width:22px;height:22px;margin:0 0 20px 55px;background-image:url("../images/icn_sprite.png");background-repeat:no-repeat;display:inline-block;text-indent:-999em}.wrap .social a:first-of-type{margin:0 0 20px 0}.wrap .social .git{background-position:0 0}.wrap .social .fb{background-position:-240px 0}.wrap .social .tw{background-position:-162px 0px}.wrap .social .rss{background-position:-402px 0}.wrap .social .mail{background-position:-560px 0}.wrap .social .pin{background-position:-322px 0}.wrap .social .dribbble{background-position:-82px 0}.wrap .social .gplus{background-position:-486px 0}.wrap .social .linkedin{background-position:-633px 0}.wrap .contact_us{color:#000;border:3px solid #000;font-size:18px;padding:15px 40px;display:inline-block;margin:0 0 70px}.wrap .contact_us:hover{background:#000;color:#fff}.contact_us{text-decoration:none}.contact_us,input[type=submit]{-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.contact{position:fixed;display:none;overflow:auto;top:0;bottom:0;left:0;right:0;background:rgba(27,31,35,0.95)}.contact label.error{color:red;float:left;font-size:11px;padding-top:10px}.close-contact_form{position:absolute;left:46%;top:-60px;cursor:pointer}.close-contact_form img{width:40px;height:40px}.contact .form{width:520px;text-align:center;padding:40px;background:#f9f9f9;-webkit-box-sizing:border-box;box-sizing:border-box;margin:100px auto;-webkit-transition:0.2s -webkit-transform ease-in-out;transition:0.2s -webkit-transform ease-in-out;transition:0.2s transform ease-in-out;transition:0.2s transform ease-in-out, 0.2s -webkit-transform ease-in-out}.contact .form input,.contact .form textarea{padding:15px 20px;margin:0;outline:0;width:100%;background:#f9f9f9;border:3px solid #e0e0e0;font-size:18px;font-family:Helvetica Neue, Arial, sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none}.contact .form textarea{height:175px;padding:20px}.contact .form input[type="text"]::-webkit-input-placeholder,.contact .form textarea::-webkit-input-placeholder{color:#dadada}.contact .form input[type="text"]::-moz-input-placeholder,.contact .form textarea::-moz-input-placeholder{color:#dadada}.contact .form input[type="text"]::-ms-input-placeholder,.contact .form textarea::-ms-input-placeholder{color:#dadada}.contact .form .col{width:205px;margin:0 0 30px;display:inline-block;float:left}.contact .form .col.last{float:right}.contact .form .submit{margin:30px 0 0;text-align:center;clear:left}.contact .form .submit input{cursor:pointer;display:inline-block;background:#1b1f24;color:#fff;border:0;padding:20px 45px;width:auto}.contact .move_top{-webkit-transform:perspective(1000px) translateY(-200px);transform:perspective(1000px) translateY(-200px)}.contact .move_bottom{-webkit-transform:perspective(1000px) translateY(0);transform:perspective(1000px) translateY(0)}.contact .zoom{-webkit-transform:perspective(1000px) scale(0.5);transform:perspective(1000px) scale(0.5);-webkit-transition:0.3s -webkit-transform ease-in-out;transition:0.3s -webkit-transform ease-in-out;transition:0.3s transform ease-in-out;transition:0.3s transform ease-in-out, 0.3s -webkit-transform ease-in-out}.contact .zoomed{-webkit-transform:perspective(1000px) scale(1);transform:perspective(1000px) scale(1)}.contact .fold{-webkit-transform:perspective(1000px) rotateY(90deg);transform:perspective(1000px) rotateY(90deg)}.contact .unfold{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0)}.background{background:url("../images/backgrounds/bg1.jpg") no-repeat center top fixed;background-size:cover}.background .countdown span{color:#fff}.background form.subscribe_form input[type="submit"]{color:#000;background:#fff}.background form.subscribe_form input[type="text"]{background:transparent;color:#fff}.background form.subscribe_form input.error[type="text"]{color:red}.background form.subscribe_form input[type="text"]::-webkit-input-placeholder{color:#fff}.background form.subscribe_form input[type="text"]::-moz-input-placeholder{color:#fff}.background form.subscribe_form input[type="text"]::-ms-input-placeholder{color:#fff}.background .contact_us{color:#fff;border-color:#fff}@media only screen and (max-width: 700px){.wrap form.login_form{width:80%;margin:15px auto 0}.wrap form.login_form input{width:49%;margin:0 2% 0 0}.wrap form.login_form input[type="password"]{margin:0}.wrap form.login_form input[type="submit"]{width:100%;margin:15px 0 0}}@media only screen and (max-width: 550px){.wrap{width:90%;margin:50px auto 0}.wrap h1{margin:0 0 50px}.wrap h2,.wrap h3{font-size:18px}.wrap form.subscribe_form{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}.wrap form.subscribe_form input{-webkit-box-sizing:border-box;box-sizing:border-box}.wrap form input[type="text"],.wrap form input[type="submit"]{width:100% !important}.wrap form.subscribe_form input[type="submit"]{padding-left:0;padding-right:0;border-left:none}.wrap .contact_us{margin:0 0 50px}.contact .form{width:90%}.contact .form p.col{width:100%}.contact .form input[type="submit"]{width:100%}.wrap form.login_form{width:90%}.wrap form.login_form input{width:100%;margin:0 0 10px 0}.wrap form.login_form input[type="submit"]{margin:10px 0 0}ul,ol{width:80%}blockquote,q{width:70%}} -/*# sourceMappingURL=style.min.css.map */ \ No newline at end of file +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;text-decoration:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{display:block;width:500px;margin:0 auto;text-align:left;position:relative;font-style:italic}blockquote:before,blockquote:after,q:before,q:after{content:'"';content:none}input,button{border-radius:0}table{border-collapse:collapse;border-spacing:0}em,i{font-style:italic}del{text-decoration:line-through}strong,b{font-weight:bold}ol{width:600px;margin:0 auto;text-align:left}ol li{list-style-type:decimal}ul{width:600px;margin:0 auto;text-align:left}ul li{list-style:disc}a{color:inherit;text-decoration:underline}body,html{min-height:100%}body{background-color:#fff;color:#1b1f23;font-family:Helvetica Neue, Arial, sans-serif}.wrap{width:605px;margin:100px auto 0;text-align:center}.wrap h1{font-size:30px;font-weight:700;margin:0 0 90px}.wrap h2{font-size:24px;font-weight:400;line-height:45px;margin:0 0 80px}.wrap h3{font-size:24px;font-weight:400;margin:0 0 45px}.wrap .author_link{margin-top:15px;color:#616161;margin:0 0 50px}.wrap .author_link a{color:#000}.wrap .countdown{margin:0 0 85px}.wrap .countdown span{font-size:30px}.wrap div.subscribe_border{border:3px solid #e0e0e0;-webkit-box-sizing:border-box;box-sizing:border-box;width:450px;display:inline-block}.wrap form.subscribe_form{margin:0 0 75px;overflow:hidden;text-align:center}.wrap .subscribe_form .privacy_checkbox{color:#909090;max-width:450px;margin:15px auto;position:relative}.wrap form.subscribe_form .privacy_checkbox label.error{display:block !important;position:absolute;font-size:11px;left:39%}.wrap .subscribe_form .privacy_checkbox input{float:none;margin:3px 4.7px}.wrap .subscribe_form .privacy_tail{font-size:11px;color:#909090;max-width:450px;margin:0 auto}.wrap form.subscribe_form input{margin:0;outline:0;border:0;float:left;font-size:18px;padding:20px 25px;-webkit-box-sizing:content-box;box-sizing:content-box}.wrap form.subscribe_form input[type="text"]{width:245px}.wrap form.subscribe_form input[type="submit"]{background:#000;color:#fff;float:right;cursor:pointer;padding:20px 30px;border-left:3px solid #e0e0e0;-webkit-transition:all .3s;transition:all .3s}.wrap form.subscribe_form input[type="submit"]:hover{background:#fff;color:#000;border-left:3px solid #e0e0e0}.wrap form.subscribe_form input[type="submit"]:active{background:#1e1e1e;color:#fff}.wrap form.subscribe_form .error{color:red}.wrap form.subscribe_form label.error{display:none !important}.wrap form.login_form{width:100%;margin:15px 0 0}.wrap form.login_form input{display:inline-block;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:3px solid #E2E2E2;font-family:Helvetica Neue, Arial, sans-serif;font-size:16px;margin:0 10px 0 0;outline:0;padding:15px}.wrap form.login_form input[type="submit"]{background:#000;color:#fff;margin:0;border-color:#000;font-weight:bold;padding:15px 30px;cursor:pointer}.wrap form.login_form input[type="submit"]:active{position:relative;top:1px}.wrap .social{margin:0 0 70px}.wrap .social a{width:22px;height:22px;margin:0 0 20px 55px;background-image:url("../images/icn_sprite.png");background-repeat:no-repeat;display:inline-block;text-indent:-999em}.wrap .social a:first-of-type{margin:0 0 20px 0}.wrap .social .git{background-position:0 0}.wrap .social .fb{background-position:-240px 0}.wrap .social .tw{background-position:-162px 0px}.wrap .social .rss{background-position:-402px 0}.wrap .social .mail{background-position:-560px 0}.wrap .social .pin{background-position:-322px 0}.wrap .social .dribbble{background-position:-82px 0}.wrap .social .gplus{background-position:-486px 0}.wrap .social .linkedin{background-position:-633px 0}.wrap .contact_us{color:#000;border:3px solid #000;font-size:18px;padding:15px 40px;display:inline-block;margin:0 0 70px}.wrap .contact_us:hover{background:#000;color:#fff}.contact_us{text-decoration:none}.contact_us,input[type=submit]{-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.contact{position:fixed;display:none;overflow:auto;top:0;bottom:0;left:0;right:0;background:rgba(27,31,35,0.95)}.contact label.error{color:red;float:left;font-size:11px;padding-top:10px}.close-contact_form{position:absolute;left:46%;top:-60px;cursor:pointer}.close-contact_form img{width:40px;height:40px}.contact .form{width:520px;text-align:center;padding:40px;background:#f9f9f9;-webkit-box-sizing:border-box;box-sizing:border-box;margin:100px auto;-webkit-transition:0.2s -webkit-transform ease-in-out;transition:0.2s -webkit-transform ease-in-out;transition:0.2s transform ease-in-out;transition:0.2s transform ease-in-out, 0.2s -webkit-transform ease-in-out}.contact .form input[type=text],.contact .form input[type=submit],.contact .form textarea{padding:15px 20px;margin:0;outline:0;width:100%;background:#f9f9f9;border:3px solid #e0e0e0;font-size:18px;font-family:Helvetica Neue, Arial, sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none}.contact .form label#content-error{margin-bottom:10px}.contact .form .privacy_checkbox{margin-top:20px;clear:both;color:#909090;font-size:15px;position:relative}.contact .form .privacy_checkbox label#acceptance-error{position:absolute;top:10px;left:39%}.contact .form .privacy_checkbox input{-webkit-transform:translatey(-2px);transform:translatey(-2px)}.contact .form .privacy_tail{font-size:11px;color:#c7c7c7;margin-top:16px;line-height:14px}.contact .form textarea{height:175px;padding:20px}.contact .form input[type="text"]::-webkit-input-placeholder,.contact .form textarea::-webkit-input-placeholder{color:#dadada}.contact .form input[type="text"]::-moz-input-placeholder,.contact .form textarea::-moz-input-placeholder{color:#dadada}.contact .form input[type="text"]::-ms-input-placeholder,.contact .form textarea::-ms-input-placeholder{color:#dadada}.contact .form .col{width:205px;margin:0 0 30px;display:inline-block;float:left}.contact .form .col.last{float:right}.contact .form .submit{margin:30px 0 0;text-align:center;clear:left}.contact .form .submit input{cursor:pointer;display:inline-block;background:#1b1f24;color:#fff;border:0;padding:20px 45px;width:auto}.contact .move_top{-webkit-transform:perspective(1000px) translateY(-200px);transform:perspective(1000px) translateY(-200px)}.contact .move_bottom{-webkit-transform:perspective(1000px) translateY(0);transform:perspective(1000px) translateY(0)}.contact .zoom{-webkit-transform:perspective(1000px) scale(0.5);transform:perspective(1000px) scale(0.5);-webkit-transition:0.3s -webkit-transform ease-in-out;transition:0.3s -webkit-transform ease-in-out;transition:0.3s transform ease-in-out;transition:0.3s transform ease-in-out, 0.3s -webkit-transform ease-in-out}.contact .zoomed{-webkit-transform:perspective(1000px) scale(1);transform:perspective(1000px) scale(1)}.contact .fold{-webkit-transform:perspective(1000px) rotateY(90deg);transform:perspective(1000px) rotateY(90deg)}.contact .unfold{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0)}.background{background:url("../images/backgrounds/bg1.jpg") no-repeat center top fixed;background-size:cover}.background .countdown span{color:#fff}.background form.subscribe_form input[type="submit"]{color:#000;background:#fff}.background form.subscribe_form input[type="text"]{background:transparent;color:#fff}.background form.subscribe_form input.error[type="text"]{color:red}.background form.subscribe_form input[type="text"]::-webkit-input-placeholder{color:#fff}.background form.subscribe_form input[type="text"]::-moz-input-placeholder{color:#fff}.background form.subscribe_form input[type="text"]::-ms-input-placeholder{color:#fff}.background .contact_us{color:#fff;border-color:#fff}@media only screen and (max-width: 700px){.wrap form.login_form{width:80%;margin:15px auto 0}.wrap form.login_form input{width:49%;margin:0 2% 0 0}.wrap form.login_form input[type="password"]{margin:0}.wrap form.login_form input[type="submit"]{width:100%;margin:15px 0 0}}@media only screen and (max-width: 550px){.wrap{width:90%;margin:50px auto 0}.wrap h1{margin:0 0 50px}.wrap h2,.wrap h3{font-size:18px}.wrap form.subscribe_form{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}.wrap form.subscribe_form input{-webkit-box-sizing:border-box;box-sizing:border-box}.wrap form input[type="text"],.wrap form input[type="submit"]{width:100% !important}.wrap form.subscribe_form input[type="submit"]{padding-left:0;padding-right:0;border-left:none}.wrap .contact_us{margin:0 0 50px}.contact .form{width:90%}.contact .form p.col{width:100%}.contact .form input[type="submit"]{width:100%}.wrap form.login_form{width:90%}.wrap form.login_form input{width:100%;margin:0 0 10px 0}.wrap form.login_form input[type="submit"]{margin:10px 0 0}ul,ol{width:80%}blockquote,q{width:70%}}@media only screen and (max-width: 465px){.contact .form .privacy_checkbox label#acceptance-error{top:28px;left:32%}} diff --git a/includes/classes/wp-maintenance-mode-admin.php b/includes/classes/wp-maintenance-mode-admin.php index ac33ba82..1c855f78 100644 --- a/includes/classes/wp-maintenance-mode-admin.php +++ b/includes/classes/wp-maintenance-mode-admin.php @@ -419,6 +419,14 @@ public function save_plugin_settings() { $this->delete_cache(); } break; + case 'gdpr': + //$custom_css = array(); + + $_POST['options']['gdpr']['status'] = (int)$_POST['options']['gdpr']['status']; + $_POST['options']['gdpr']['policy_page_label'] = sanitize_text_field($_POST['options']['gdpr']['policy_page_label']); + $_POST['options']['gdpr']['policy_page_link'] = sanitize_text_field($_POST['options']['gdpr']['policy_page_link']); + $_POST['options']['gdpr']['contact_form_tail'] = sanitize_text_field($_POST['options']['gdpr']['contact_form_tail']); + $_POST['options']['gdpr']['subscribe_form_tail'] = sanitize_text_field($_POST['options']['gdpr']['subscribe_form_tail']); } $this->plugin_settings[$tab] = $_POST['options'][$tab]; @@ -446,7 +454,7 @@ public function add_safe_style_css($properties) { } /** - * Builds the data.js file and writes it into assets/js/ + * Builds the data.js file and writes it into uploads * This file is mandatory for the bot to work correctly. * * @param array $messages @@ -482,7 +490,6 @@ public function set_datajs_file($messages = array()) { // Try to write data.js file try { $upload_dir = wp_upload_dir(); - // if ( file_put_contents( WPMM_PATH . 'assets/js/data.js', $data) === false ){ if ( file_put_contents( trailingslashit($upload_dir['basedir']) . 'data.js', $data) === false ){ throw new Exception(__("WPMM: The file data.js could not be written, the bot will not work correctly.", $this->plugin_slug)); } @@ -628,6 +635,43 @@ public function admin_footer_text($text) { return $text; } + public function get_is_policy_available() { + if (function_exists('get_privacy_policy_url')) { + return true; + } + return false; + } + + public function get_policy_link() { + //Check feature is available + if($this->get_is_policy_available()) { + return get_privacy_policy_url(); + } + } + + public function get_policy_link_message() { + $url = $this->get_policy_link(); + if($this->get_is_policy_available() && $this->plugin_settings['gdpr']['policy_page_link'] === '') { + if($url === '') { // No value and feature available + return __("Your WordPress version supports Privacy settings but you haven't set any privacy policy page yet. Go to Settings ➡ Privacy to set one.", $this->plugin_slug); + } + else { // Value and feature available + return sprintf(__('The plugin detected this Privacy page: %1$s – %2$sUse this url%3$s', $this->plugin_slug), $url, ''); + } + } + elseif($this->get_is_policy_available() && $this->plugin_settings['gdpr']['policy_page_link'] != '') { // Feature available and value set + if($url != $this->plugin_settings['gdpr']['policy_page_link']) { // Current wp privacy page differs from set value + return sprintf(__("Your Privacy page is pointing to a different URL in WordPress settings. If that's correct ignore this message, otherwise %s", $this->plugin_slug), 'UPDATE VALUE TO NEW URL'); + } + } + elseif(!$this->get_is_policy_available()) { // No privacy feature available + return __("No privacy features detected for your WordPress version. Update WordPress to get this field automatically filled in or type in the URL that points to your privacy policy page.", $this->plugin_slug); + } + } + + + + } } \ No newline at end of file diff --git a/includes/classes/wp-maintenance-mode.php b/includes/classes/wp-maintenance-mode.php index 77f4e1a0..ab5f8321 100644 --- a/includes/classes/wp-maintenance-mode.php +++ b/includes/classes/wp-maintenance-mode.php @@ -4,7 +4,7 @@ class WP_Maintenance_Mode { - const VERSION = '2.1.2'; + const VERSION = '2.2'; protected $plugin_slug = 'wp-maintenance-mode'; protected $plugin_settings; @@ -159,9 +159,16 @@ public function default_settings() { '02_1' => __("Tell me more", $this->plugin_slug), '02_2' => __("Boring", $this->plugin_slug), '03' => __("Type your email here…", $this->plugin_slug) - ), + ), 'custom_css' => array() - ) + ), + 'gdpr' => array( + 'status' => 0, + 'policy_page_label' => __('Privacy Policy', $this->plugin_slug), + 'policy_page_link' => '', + 'contact_form_tail' => __('This form collects your name and email so that we can reach you back. Check out our Privacy Policy page to fully understand how we protect and manage your submitted data.', $this->plugin_slug), + 'subscribe_form_tail' => __('This form collects your email so that we can add you to our newsletter list. Check out our Privacy Policy page to fully understand how we protect and manage your submitted data.', $this->plugin_slug), + ), ); } @@ -422,6 +429,15 @@ public static function single_activate($network_wide = false) { update_option('wpmm_settings', $v2_options); } + /** + * Update from =< v2.1.2 to 2.1.5 + */ + if(empty($v2_options['gdpr'])) { + $v2_options['gdpr'] = $default_options['gdpr']; + // update options + update_option('wpmm_settings', $v2_options); + } + // set current version update_option('wpmm_version', WP_Maintenance_Mode::VERSION); } diff --git a/readme.md b/readme.md index 8f15fc3c..b7c60b7a 100755 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Version 2.1.2 +# Version 2.2 # WP Maintenance Mode @@ -19,6 +19,7 @@ Adds a splash page to your site that lets visitors know your site is down for ma * SEO options; * Exclude URLs from maintenance. * Bot functionality to collect the emails in a friendly and efficient way. +* GDPR Ready **Credits** diff --git a/readme.txt b/readme.txt index aa913fc0..4418af5c 100644 --- a/readme.txt +++ b/readme.txt @@ -1,13 +1,14 @@ === WP Maintenance Mode === -Contributors: Designmodo +Contributors: Designmodo, impresshq Plugin Name: WP Maintenance Mode Plugin URI: https://designmodo.com/ Author: Designmodo Author URI: https://designmodo.com/ Tags: maintenance mode, admin, administration, unavailable, coming soon, multisite, landing page, under construction, contact form, subscribe, countdown Requires at least: 3.5 -Tested up to: 4.9.4 -Stable tag: 2.1.2 +Tested up to: 4.9.6 +Stable tag: 2.2 +Requires PHP: 5.6 License: GPL-2.0+ Adds a splash page to your site that lets visitors know your site is down for maintenance. It's perfect for a coming soon page. The new Bot functionality is here! @@ -35,6 +36,7 @@ Also works with WordPress Multisite installs (each blog from the network has it' * SEO options; * Exclude URLs from maintenance; * Bot functionality to collect the emails in a friendly and efficient way. +* GDPR Ready = Bugs, technical hints or contribute = @@ -75,6 +77,9 @@ If you change your login url, please add the new slug (url: http://domain.com/ne == Changelog == += 2.2 (25/05/2018) = +* added GDPR feature + = 2.1.2 (04/03/2018) = * fixed a bug that was breaking the plugin after updating from 2.0.9 to 2.1.1 diff --git a/views/maintenance.php b/views/maintenance.php index 465cc104..70dd51de 100644 --- a/views/maintenance.php +++ b/views/maintenance.php @@ -69,8 +69,15 @@ plugin_settings['modules']['subscribe_text'])) { ?>

plugin_settings['modules']['subscribe_text']); ?>

@@ -127,6 +134,11 @@ + plugin_settings['gdpr']['status']) && $this->plugin_settings['gdpr']['status'] == 1) { ?> +
+ plugin_settings['gdpr']['contact_form_tail'])) { ?> +

plugin_settings['gdpr']['contact_form_tail']; ?>

+

@@ -137,9 +149,15 @@ plugin_slug); ?> - plugin_settings['general']['admin_link']) && $this->plugin_settings['general']['admin_link'] == 1) { ?> + plugin_settings['general']['admin_link']) && $this->plugin_settings['general']['admin_link'] == 1) || + (!empty($this->plugin_settings['gdpr']['status']) && $this->plugin_settings['gdpr']['status'] == 1)) { ?> diff --git a/views/settings.php b/views/settings.php index 63985eb9..1a9d4d76 100644 --- a/views/settings.php +++ b/views/settings.php @@ -14,6 +14,7 @@ plugin_slug); ?> plugin_slug); ?> plugin_slug); ?> + plugin_slug); ?>
@@ -441,9 +442,6 @@ - -plugin_settings['general']['redirection'])); ?>" name="options[general][redirection]" /> -

plugin_slug); ?>

-*/ -?>

plugin_slug) ?>

plugin_slug) ?>

@@ -599,12 +597,6 @@ ?>
@@ -614,6 +606,69 @@
+ diff --git a/wp-maintenance-mode.php b/wp-maintenance-mode.php index 8794b75a..3d2d19f2 100755 --- a/wp-maintenance-mode.php +++ b/wp-maintenance-mode.php @@ -6,7 +6,7 @@ * Plugin Name: WP Maintenance Mode * Plugin URI: https://designmodo.com/ * Description: Adds a splash page to your site that lets visitors know your site is down for maintenance. It's perfect for a coming soon page. - * Version: 2.1.2 + * Version: 2.2 * Author: Designmodo * Author URI: https://designmodo.com/ * Twitter: designmodo