My Private Site - Version 3.0.1

Version Description

  • Minor bug fixes
  • Added uninstall telemetry
Download this release

Release Info

Developer dgewirtz
Plugin Icon 128x128 My Private Site
Version 3.0.1
Comparing to
See all releases

Code changes from version 3.0.0 to 3.0.1

jonradio-private-site-admin.php CHANGED
@@ -21,6 +21,10 @@ require_once 'util/utilities5.php';
21
  require_once 'legacy/legacy.php';
22
 
23
  function my_private_site_admin_loader() {
 
 
 
 
24
  // bring in the admin page tabs
25
  require_once 'admin/main.php';
26
  require_once 'admin/site-privacy.php';
@@ -43,6 +47,11 @@ function my_private_site_queue_admin_stylesheet() {
43
  wp_register_style('my_private_site_admin_css', $style_url);
44
  wp_enqueue_style('my_private_site_admin_css');
45
 
 
 
 
 
 
46
  do_action('my_private_site_add_styles_after');
47
  }
48
 
@@ -58,6 +67,12 @@ function my_private_site_init() {
58
  unset($internal_settings['warning_privacy']);
59
  update_option('jr_ps_internal_settings', $internal_settings);
60
  }
 
 
 
 
 
 
61
  }
62
 
63
  add_shortcode('privacy', 'my_private_site_shortcode');
21
  require_once 'legacy/legacy.php';
22
 
23
  function my_private_site_admin_loader() {
24
+
25
+ // bring in telemetry
26
+ require_once 'telemetry/deactivate.php';
27
+
28
  // bring in the admin page tabs
29
  require_once 'admin/main.php';
30
  require_once 'admin/site-privacy.php';
47
  wp_register_style('my_private_site_admin_css', $style_url);
48
  wp_enqueue_style('my_private_site_admin_css');
49
 
50
+ // remodal library used by telemetry
51
+ wp_enqueue_script('remodal', plugins_url('/library/remodal/remodal.min.js', __FILE__));
52
+ wp_enqueue_style('remodal', plugins_url('/library/remodal/remodal.css', __FILE__));
53
+ wp_enqueue_style('remodal-default-theme', plugins_url('/library/remodal/remodal-default-theme.css', __FILE__));
54
+
55
  do_action('my_private_site_add_styles_after');
56
  }
57
 
67
  unset($internal_settings['warning_privacy']);
68
  update_option('jr_ps_internal_settings', $internal_settings);
69
  }
70
+
71
+ // check to see if first run time has been recorded
72
+ $first_run = get_option('jr_ps_first_run_time');
73
+ if($first_run == false) {
74
+ update_option('jr_ps_first_run_time', time());
75
+ }
76
  }
77
 
78
  add_shortcode('privacy', 'my_private_site_shortcode');
jonradio-private-site.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: My Private Site
4
  Plugin URI: http://zatzlabs.com/plugins/
5
  Description: Easily secure posts, pages, or your entire WordPress site by requiring visitors to login.
6
- Version: 3.0.0
7
  Author: David Gewirtz
8
  Author URI: http://zatzlabs.com/plugins/
9
  License: GPLv2
3
  Plugin Name: My Private Site
4
  Plugin URI: http://zatzlabs.com/plugins/
5
  Description: Easily secure posts, pages, or your entire WordPress site by requiring visitors to login.
6
+ Version: 3.0.1
7
  Author: David Gewirtz
8
  Author URI: http://zatzlabs.com/plugins/
9
  License: GPLv2
library/remodal/remodal-default-theme.css ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Remodal - v1.1.1
3
+ * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
4
+ * http://vodkabears.github.io/remodal/
5
+ *
6
+ * Made by Ilya Makarov
7
+ * Under MIT License
8
+ */
9
+
10
+ /* ==========================================================================
11
+ Remodal's default mobile first theme
12
+ ========================================================================== */
13
+
14
+ /* Default theme styles for the background */
15
+
16
+ .remodal-bg.remodal-is-opening,
17
+ .remodal-bg.remodal-is-opened {
18
+ -webkit-filter: blur(3px);
19
+ filter: blur(3px);
20
+ }
21
+
22
+ /* Default theme styles of the overlay */
23
+
24
+ .remodal-overlay {
25
+ background: rgba(43, 46, 56, 0.9);
26
+ }
27
+
28
+ .remodal-overlay.remodal-is-opening,
29
+ .remodal-overlay.remodal-is-closing {
30
+ -webkit-animation-duration: 0.3s;
31
+ animation-duration: 0.3s;
32
+ -webkit-animation-fill-mode: forwards;
33
+ animation-fill-mode: forwards;
34
+ }
35
+
36
+ .remodal-overlay.remodal-is-opening {
37
+ -webkit-animation-name: remodal-overlay-opening-keyframes;
38
+ animation-name: remodal-overlay-opening-keyframes;
39
+ }
40
+
41
+ .remodal-overlay.remodal-is-closing {
42
+ -webkit-animation-name: remodal-overlay-closing-keyframes;
43
+ animation-name: remodal-overlay-closing-keyframes;
44
+ }
45
+
46
+ /* Default theme styles of the wrapper */
47
+
48
+ .remodal-wrapper {
49
+ padding: 10px 10px 0;
50
+ }
51
+
52
+ /* Default theme styles of the modal dialog */
53
+
54
+ .remodal {
55
+ box-sizing: border-box;
56
+ width: 100%;
57
+ margin-bottom: 10px;
58
+ padding: 35px;
59
+
60
+ -webkit-transform: translate3d(0, 0, 0);
61
+ transform: translate3d(0, 0, 0);
62
+
63
+ color: #2b2e38;
64
+ background: #fff;
65
+ }
66
+
67
+ .remodal.remodal-is-opening,
68
+ .remodal.remodal-is-closing {
69
+ -webkit-animation-duration: 0.3s;
70
+ animation-duration: 0.3s;
71
+ -webkit-animation-fill-mode: forwards;
72
+ animation-fill-mode: forwards;
73
+ }
74
+
75
+ .remodal.remodal-is-opening {
76
+ -webkit-animation-name: remodal-opening-keyframes;
77
+ animation-name: remodal-opening-keyframes;
78
+ }
79
+
80
+ .remodal.remodal-is-closing {
81
+ -webkit-animation-name: remodal-closing-keyframes;
82
+ animation-name: remodal-closing-keyframes;
83
+ }
84
+
85
+ /* Vertical align of the modal dialog */
86
+
87
+ .remodal,
88
+ .remodal-wrapper:after {
89
+ vertical-align: middle;
90
+ }
91
+
92
+ /* Close button */
93
+
94
+ .remodal-close {
95
+ position: absolute;
96
+ top: 0;
97
+ left: 0;
98
+
99
+ display: block;
100
+ overflow: visible;
101
+
102
+ width: 35px;
103
+ height: 35px;
104
+ margin: 0;
105
+ padding: 0;
106
+
107
+ cursor: pointer;
108
+ -webkit-transition: color 0.2s;
109
+ transition: color 0.2s;
110
+ text-decoration: none;
111
+
112
+ color: #95979c;
113
+ border: 0;
114
+ outline: 0;
115
+ background: transparent;
116
+ }
117
+
118
+ .remodal-close:hover,
119
+ .remodal-close:focus {
120
+ color: #2b2e38;
121
+ }
122
+
123
+ .remodal-close:before {
124
+ font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
125
+ font-size: 25px;
126
+ line-height: 35px;
127
+
128
+ position: absolute;
129
+ top: 0;
130
+ left: 0;
131
+
132
+ display: block;
133
+
134
+ width: 35px;
135
+
136
+ content: "\00d7";
137
+ text-align: center;
138
+ }
139
+
140
+ /* Dialog buttons */
141
+
142
+ .remodal-confirm,
143
+ .remodal-cancel {
144
+ font: inherit;
145
+
146
+ display: inline-block;
147
+ overflow: visible;
148
+
149
+ min-width: 110px;
150
+ margin: 0;
151
+ padding: 12px 0;
152
+
153
+ cursor: pointer;
154
+ -webkit-transition: background 0.2s;
155
+ transition: background 0.2s;
156
+ text-align: center;
157
+ vertical-align: middle;
158
+ text-decoration: none;
159
+
160
+ border: 0;
161
+ outline: 0;
162
+ }
163
+
164
+ .remodal-confirm {
165
+ color: #fff;
166
+ background: #81c784;
167
+ }
168
+
169
+ .remodal-confirm:hover,
170
+ .remodal-confirm:focus {
171
+ background: #66bb6a;
172
+ }
173
+
174
+ .remodal-cancel {
175
+ color: #fff;
176
+ background: #e57373;
177
+ }
178
+
179
+ .remodal-cancel:hover,
180
+ .remodal-cancel:focus {
181
+ background: #ef5350;
182
+ }
183
+
184
+ /* Remove inner padding and border in Firefox 4+ for the button tag. */
185
+
186
+ .remodal-confirm::-moz-focus-inner,
187
+ .remodal-cancel::-moz-focus-inner,
188
+ .remodal-close::-moz-focus-inner {
189
+ padding: 0;
190
+
191
+ border: 0;
192
+ }
193
+
194
+ /* Keyframes
195
+ ========================================================================== */
196
+
197
+ @-webkit-keyframes remodal-opening-keyframes {
198
+ from {
199
+ -webkit-transform: scale(1.05);
200
+ transform: scale(1.05);
201
+
202
+ opacity: 0;
203
+ }
204
+ to {
205
+ -webkit-transform: none;
206
+ transform: none;
207
+
208
+ opacity: 1;
209
+
210
+ -webkit-filter: blur(0);
211
+ filter: blur(0);
212
+ }
213
+ }
214
+
215
+ @keyframes remodal-opening-keyframes {
216
+ from {
217
+ -webkit-transform: scale(1.05);
218
+ transform: scale(1.05);
219
+
220
+ opacity: 0;
221
+ }
222
+ to {
223
+ -webkit-transform: none;
224
+ transform: none;
225
+
226
+ opacity: 1;
227
+
228
+ -webkit-filter: blur(0);
229
+ filter: blur(0);
230
+ }
231
+ }
232
+
233
+ @-webkit-keyframes remodal-closing-keyframes {
234
+ from {
235
+ -webkit-transform: scale(1);
236
+ transform: scale(1);
237
+
238
+ opacity: 1;
239
+ }
240
+ to {
241
+ -webkit-transform: scale(0.95);
242
+ transform: scale(0.95);
243
+
244
+ opacity: 0;
245
+
246
+ -webkit-filter: blur(0);
247
+ filter: blur(0);
248
+ }
249
+ }
250
+
251
+ @keyframes remodal-closing-keyframes {
252
+ from {
253
+ -webkit-transform: scale(1);
254
+ transform: scale(1);
255
+
256
+ opacity: 1;
257
+ }
258
+ to {
259
+ -webkit-transform: scale(0.95);
260
+ transform: scale(0.95);
261
+
262
+ opacity: 0;
263
+
264
+ -webkit-filter: blur(0);
265
+ filter: blur(0);
266
+ }
267
+ }
268
+
269
+ @-webkit-keyframes remodal-overlay-opening-keyframes {
270
+ from {
271
+ opacity: 0;
272
+ }
273
+ to {
274
+ opacity: 1;
275
+ }
276
+ }
277
+
278
+ @keyframes remodal-overlay-opening-keyframes {
279
+ from {
280
+ opacity: 0;
281
+ }
282
+ to {
283
+ opacity: 1;
284
+ }
285
+ }
286
+
287
+ @-webkit-keyframes remodal-overlay-closing-keyframes {
288
+ from {
289
+ opacity: 1;
290
+ }
291
+ to {
292
+ opacity: 0;
293
+ }
294
+ }
295
+
296
+ @keyframes remodal-overlay-closing-keyframes {
297
+ from {
298
+ opacity: 1;
299
+ }
300
+ to {
301
+ opacity: 0;
302
+ }
303
+ }
304
+
305
+ /* Media queries
306
+ ========================================================================== */
307
+
308
+ @media only screen and (min-width: 641px) {
309
+ .remodal {
310
+ max-width: 700px;
311
+ }
312
+ }
313
+
314
+ /* IE8
315
+ ========================================================================== */
316
+
317
+ .lt-ie9 .remodal-overlay {
318
+ background: #2b2e38;
319
+ }
320
+
321
+ .lt-ie9 .remodal {
322
+ width: 700px;
323
+ }
library/remodal/remodal.css ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Remodal - v1.1.1
3
+ * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
4
+ * http://vodkabears.github.io/remodal/
5
+ *
6
+ * Made by Ilya Makarov
7
+ * Under MIT License
8
+ */
9
+
10
+ /* ==========================================================================
11
+ Remodal's necessary styles
12
+ ========================================================================== */
13
+
14
+ /* Hide scroll bar */
15
+
16
+ html.remodal-is-locked {
17
+ overflow: hidden;
18
+
19
+ -ms-touch-action: none;
20
+ touch-action: none;
21
+ }
22
+
23
+ /* Anti FOUC */
24
+
25
+ .remodal,
26
+ [data-remodal-id] {
27
+ display: none;
28
+ }
29
+
30
+ /* Necessary styles of the overlay */
31
+
32
+ .remodal-overlay {
33
+ position: fixed;
34
+ z-index: 9999;
35
+ top: -5000px;
36
+ right: -5000px;
37
+ bottom: -5000px;
38
+ left: -5000px;
39
+
40
+ display: none;
41
+ }
42
+
43
+ /* Necessary styles of the wrapper */
44
+
45
+ .remodal-wrapper {
46
+ position: fixed;
47
+ z-index: 10000;
48
+ top: 0;
49
+ right: 0;
50
+ bottom: 0;
51
+ left: 0;
52
+
53
+ display: none;
54
+ overflow: auto;
55
+
56
+ text-align: center;
57
+
58
+ -webkit-overflow-scrolling: touch;
59
+ }
60
+
61
+ .remodal-wrapper:after {
62
+ display: inline-block;
63
+
64
+ height: 100%;
65
+ margin-left: -0.05em;
66
+
67
+ content: "";
68
+ }
69
+
70
+ /* Fix iPad, iPhone glitches */
71
+
72
+ .remodal-overlay,
73
+ .remodal-wrapper {
74
+ -webkit-backface-visibility: hidden;
75
+ backface-visibility: hidden;
76
+ }
77
+
78
+ /* Necessary styles of the modal dialog */
79
+
80
+ .remodal {
81
+ position: relative;
82
+
83
+ outline: none;
84
+
85
+ -webkit-text-size-adjust: 100%;
86
+ -ms-text-size-adjust: 100%;
87
+ text-size-adjust: 100%;
88
+ }
89
+
90
+ .remodal-is-initialized {
91
+ /* Disable Anti-FOUC */
92
+ display: inline-block;
93
+ }
library/remodal/remodal.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Remodal - v1.1.1
3
+ * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
4
+ * http://vodkabears.github.io/remodal/
5
+ *
6
+ * Made by Ilya Makarov
7
+ * Under MIT License
8
+ */
9
+
10
+ !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof exports?b(a,require("jquery")):b(a,a.jQuery||a.Zepto)}(this,function(a,b){"use strict";function c(a){if(w&&"none"===a.css("animation-name")&&"none"===a.css("-webkit-animation-name")&&"none"===a.css("-moz-animation-name")&&"none"===a.css("-o-animation-name")&&"none"===a.css("-ms-animation-name"))return 0;var b,c,d,e,f=a.css("animation-duration")||a.css("-webkit-animation-duration")||a.css("-moz-animation-duration")||a.css("-o-animation-duration")||a.css("-ms-animation-duration")||"0s",g=a.css("animation-delay")||a.css("-webkit-animation-delay")||a.css("-moz-animation-delay")||a.css("-o-animation-delay")||a.css("-ms-animation-delay")||"0s",h=a.css("animation-iteration-count")||a.css("-webkit-animation-iteration-count")||a.css("-moz-animation-iteration-count")||a.css("-o-animation-iteration-count")||a.css("-ms-animation-iteration-count")||"1";for(f=f.split(", "),g=g.split(", "),h=h.split(", "),e=0,c=f.length,b=Number.NEGATIVE_INFINITY;e<c;e++)d=parseFloat(f[e])*parseInt(h[e],10)+parseFloat(g[e]),d>b&&(b=d);return b}function d(){if(b(document).height()<=b(window).height())return 0;var a,c,d=document.createElement("div"),e=document.createElement("div");return d.style.visibility="hidden",d.style.width="100px",document.body.appendChild(d),a=d.offsetWidth,d.style.overflow="scroll",e.style.width="100%",d.appendChild(e),c=e.offsetWidth,d.parentNode.removeChild(d),a-c}function e(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)||(c=b(document.body),a=parseInt(c.css("padding-right"),10)+d(),c.css("padding-right",a+"px"),e.addClass(f))}}function f(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)&&(c=b(document.body),a=parseInt(c.css("padding-right"),10)-d(),c.css("padding-right",a+"px"),e.removeClass(f))}}function g(a,b,c,d){var e=k("is",b),f=[k("is",u.CLOSING),k("is",u.OPENING),k("is",u.CLOSED),k("is",u.OPENED)].join(" ");a.$bg.removeClass(f).addClass(e),a.$overlay.removeClass(f).addClass(e),a.$wrapper.removeClass(f).addClass(e),a.$modal.removeClass(f).addClass(e),a.state=b,!c&&a.$modal.trigger({type:b,reason:d},[{reason:d}])}function h(a,d,e){var f=0,g=function(a){a.target===this&&f++},h=function(a){a.target===this&&0===--f&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())};b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].on(r,g).on(s,h)}),a(),0===c(e.$bg)&&0===c(e.$overlay)&&0===c(e.$wrapper)&&0===c(e.$modal)&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())}function i(a){a.state!==u.CLOSED&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(b,c){a[c].off(r+" "+s)}),a.$bg.removeClass(a.settings.modifier),a.$overlay.removeClass(a.settings.modifier).hide(),a.$wrapper.hide(),f(),g(a,u.CLOSED,!0))}function j(a){var b,c,d,e,f={};for(a=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,","),b=a.split(","),e=0,c=b.length;e<c;e++)b[e]=b[e].split(":"),d=b[e][1],("string"==typeof d||d instanceof String)&&(d="true"===d||"false"!==d&&d),("string"==typeof d||d instanceof String)&&(d=isNaN(d)?d:+d),f[b[e][0]]=d;return f}function k(){for(var a=q,b=0;b<arguments.length;++b)a+="-"+arguments[b];return a}function l(){var a,c,d=location.hash.replace("#","");if(d){try{c=b('[data-remodal-id="'+d+'"]')}catch(e){}c&&c.length&&(a=b[p].lookup[c.data(p)],a&&a.settings.hashTracking&&a.open())}else n&&n.state===u.OPENED&&n.settings.hashTracking&&n.close()}function m(a,c){var d=b(document.body),e=d,f=this;f.settings=b.extend({},t,c),f.index=b[p].lookup.push(f)-1,f.state=u.CLOSED,f.$overlay=b("."+k("overlay")),null!==f.settings.appendTo&&f.settings.appendTo.length&&(e=b(f.settings.appendTo)),f.$overlay.length||(f.$overlay=b("<div>").addClass(k("overlay")+" "+k("is",u.CLOSED)).hide(),e.append(f.$overlay)),f.$bg=b("."+k("bg")).addClass(k("is",u.CLOSED)),f.$modal=a.addClass(q+" "+k("is-initialized")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).attr("tabindex","-1"),f.$wrapper=b("<div>").addClass(k("wrapper")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).hide().append(f.$modal),e.append(f.$wrapper),f.$wrapper.on("click."+q,'[data-remodal-action="close"]',function(a){a.preventDefault(),f.close()}),f.$wrapper.on("click."+q,'[data-remodal-action="cancel"]',function(a){a.preventDefault(),f.$modal.trigger(v.CANCELLATION),f.settings.closeOnCancel&&f.close(v.CANCELLATION)}),f.$wrapper.on("click."+q,'[data-remodal-action="confirm"]',function(a){a.preventDefault(),f.$modal.trigger(v.CONFIRMATION),f.settings.closeOnConfirm&&f.close(v.CONFIRMATION)}),f.$wrapper.on("click."+q,function(a){var c=b(a.target);c.hasClass(k("wrapper"))&&f.settings.closeOnOutsideClick&&f.close()})}var n,o,p="remodal",q=a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.NAMESPACE||p,r=b.map(["animationstart","webkitAnimationStart","MSAnimationStart","oAnimationStart"],function(a){return a+"."+q}).join(" "),s=b.map(["animationend","webkitAnimationEnd","MSAnimationEnd","oAnimationEnd"],function(a){return a+"."+q}).join(" "),t=b.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnOutsideClick:!0,modifier:"",appendTo:null},a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.DEFAULTS),u={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened"},v={CONFIRMATION:"confirmation",CANCELLATION:"cancellation"},w=function(){var a=document.createElement("div").style;return void 0!==a.animationName||void 0!==a.WebkitAnimationName||void 0!==a.MozAnimationName||void 0!==a.msAnimationName||void 0!==a.OAnimationName}(),x=/iPad|iPhone|iPod/.test(navigator.platform);m.prototype.open=function(){var a,c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&(a=c.$modal.attr("data-remodal-id"),a&&c.settings.hashTracking&&(o=b(window).scrollTop(),location.hash=a),n&&n!==c&&i(n),n=c,e(),c.$bg.addClass(c.settings.modifier),c.$overlay.addClass(c.settings.modifier).show(),c.$wrapper.show().scrollTop(0),c.$modal.focus(),h(function(){g(c,u.OPENING)},function(){g(c,u.OPENED)},c))},m.prototype.close=function(a){var c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&c.state!==u.CLOSED&&(c.settings.hashTracking&&c.$modal.attr("data-remodal-id")===location.hash.substr(1)&&(location.hash="",b(window).scrollTop(o)),h(function(){g(c,u.CLOSING,!1,a)},function(){c.$bg.removeClass(c.settings.modifier),c.$overlay.removeClass(c.settings.modifier).hide(),c.$wrapper.hide(),f(),g(c,u.CLOSED,!1,a)},c))},m.prototype.getState=function(){return this.state},m.prototype.destroy=function(){var a,c=b[p].lookup;i(this),this.$wrapper.remove(),delete c[this.index],a=b.grep(c,function(a){return!!a}).length,0===a&&(this.$overlay.remove(),this.$bg.removeClass(k("is",u.CLOSING)+" "+k("is",u.OPENING)+" "+k("is",u.CLOSED)+" "+k("is",u.OPENED)))},b[p]={lookup:[]},b.fn[p]=function(a){var c,d;return this.each(function(e,f){d=b(f),null==d.data(p)?(c=new m(d,a),d.data(p,c.index),c.settings.hashTracking&&d.attr("data-remodal-id")===location.hash.substr(1)&&c.open()):c=b[p].lookup[d.data(p)]}),c},b(document).ready(function(){b(document).on("click","[data-remodal-target]",function(a){a.preventDefault();var c=a.currentTarget,d=c.getAttribute("data-remodal-target"),e=b('[data-remodal-id="'+d+'"]');b[p].lookup[e.data(p)].open()}),b(document).find("."+q).each(function(a,c){var d=b(c),e=d.data("remodal-options");e?("string"==typeof e||e instanceof String)&&(e=j(e)):e={},d[p](e)}),b(document).on("keydown."+q,function(a){n&&n.settings.closeOnEscape&&n.state===u.OPENED&&27===a.keyCode&&n.close()}),b(window).on("hashchange."+q,l)})});
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dgewirtz
3
  Donate link: http://zatzlabs.com/lab-notes/
4
  Tags: login, visibility, private, security, plugin, pages, page, posts, post
5
  Requires at least: 3.0
6
- Tested up to: 5.4.1
7
- Stable tag: 3.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -90,6 +90,10 @@ Whenever you change your WordPress Permalinks (Settings-Permalinks in Admin pane
90
 
91
  == Changelog ==
92
 
 
 
 
 
93
  = 3.0.0 =
94
  * Complete rewrite with an entirely new, streamlined UI
95
  * Added the selective content subsystem
3
  Donate link: http://zatzlabs.com/lab-notes/
4
  Tags: login, visibility, private, security, plugin, pages, page, posts, post
5
  Requires at least: 3.0
6
+ Tested up to: 5.4.2
7
+ Stable tag: 3.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
90
 
91
  == Changelog ==
92
 
93
+ = 3.0.1 =
94
+ * Minor bug fixes
95
+ * Added uninstall telemetry
96
+
97
  = 3.0.0 =
98
  * Complete rewrite with an entirely new, streamlined UI
99
  * Added the selective content subsystem
telemetry/css/deactivate.css ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * My Private Site by David Gewirtz, adopted from Jon ‘jonradio’ Pearkins
3
+ *
4
+ * Lab Notes: http://zatzlabs.com/lab-notes/
5
+ * Plugin Page: https://zatzlabs.com/project/my-private-site/
6
+ * Contact: http://zatzlabs.com/contact-us/
7
+ *
8
+ * Copyright (c) 2015-2020 by David Gewirtz
9
+ */
10
+
11
+ /* // Based on code from https://github.com/CodeCabin/plugin-deactivation-survey */
12
+
13
+ .my-private-site-deactivate-dialog
14
+ {
15
+ text-align: left;
16
+ width: auto;
17
+ border-radius: 10px;
18
+ }
19
+
20
+ .my-private-site-deactivate-dialog-buttons
21
+ {
22
+ text-align: right;
23
+ }
24
+
25
+ .my-private-site-deactivate-dialog
26
+ {
27
+ width: auto !important;
28
+ }
29
+
30
+ .my-private-site-deactivate-dialog h2
31
+ {
32
+ color: gray;
33
+ font-variant: small-caps;
34
+ font-size: 1.2em;
35
+ padding-bottom: 0.2em;
36
+ border-bottom: 1px solid lightgray;
37
+
38
+ }
39
+
40
+ .my-private-site-deactivate-dialog textarea[name="comments"]
41
+ {
42
+ width: 100%;
43
+ }
44
+
45
+
telemetry/deactivate.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * My Private Site by David Gewirtz, adopted from Jon ‘jonradio’ Pearkins
4
+ *
5
+ * Lab Notes: http://zatzlabs.com/lab-notes/
6
+ * Plugin Page: https://zatzlabs.com/project/my-private-site/
7
+ * Contact: http://zatzlabs.com/contact-us/
8
+ *
9
+ * Copyright (c) 2015-2020 by David Gewirtz
10
+ */
11
+
12
+
13
+ // based on code from https://github.com/CodeCabin/plugin-deactivation-survey
14
+
15
+
16
+
17
+ add_filter('my_private_site_deactivate_feedback_form_plugins', function ($plugins) {
18
+ $time_now = time();
19
+ $time_then = get_option('jr_ps_first_run_time');
20
+ $internal_settings = get_option('jr_ps_internal_settings');
21
+
22
+ $plugins[] = (object)array(
23
+ 'slug' => 'jonradio-private-site',
24
+ 'version' => $internal_settings['version'],
25
+ 'timeNow' => $time_now,
26
+ 'installTime' => $time_then,
27
+ 'useDuration' => $time_now - $time_then,
28
+ 'telemetryUrl' => my_private_site_telemetry_url(),
29
+ );
30
+ return $plugins;
31
+ });
32
+
33
+ if (!is_admin())
34
+ return;
35
+
36
+ global $pagenow;
37
+
38
+ if ($pagenow != "plugins.php")
39
+ return;
40
+
41
+ if (defined('MY_PRIVATE_SITE_DEACTIVATE_FEEDBACK_FORM_INCLUDED'))
42
+ return;
43
+ define('MY_PRIVATE_SITE_DEACTIVATE_FEEDBACK_FORM_INCLUDED', true);
44
+
45
+ add_action('admin_enqueue_scripts', function () {
46
+ // Enqueue scripts
47
+ wp_enqueue_script('my-private-site-deactivate-feedback-form', plugin_dir_url(__FILE__) . 'js/deactivate.js');
48
+ wp_enqueue_style('my-private-site-deactivate-feedback-form', plugin_dir_url(__FILE__) . 'css/deactivate.css');
49
+
50
+ // Localized strings
51
+ wp_localize_script('my-private-site-deactivate-feedback-form', 'my_private_site_deactivate_feedback_form_strings', array(
52
+ 'quick_feedback' => __('Help us improve. Why are you deactivating?', 'my-private-site'),
53
+ 'foreword' => __('Your feedback is fully anonymous and will be read directly by the lead developer', 'my-private-site'),
54
+ 'better_plugins_name' => __('Please tell us which plugin?', 'my-private-site'),
55
+ 'please_tell_us' => __('Please tell us the reason so we can improve the plugin', 'my-private-site'),
56
+ 'do_not_attach_email' => __('Do not send my e-mail address with this feedback', 'my-private-site'),
57
+
58
+ 'brief_description' => __('Please share any feedback you wish', 'my-private-site'),
59
+
60
+ 'cancel' => __('Cancel', 'my-private-site'),
61
+ 'skip_and_deactivate' => __('Skip &amp; Deactivate', 'my-private-site'),
62
+ 'submit_and_deactivate' => __('Submit &amp; Deactivate', 'my-private-site'),
63
+ 'please_wait' => __('Please wait', 'my-private-site'),
64
+ 'thank_you' => __('Thank you!', 'my-private-site'),
65
+ ));
66
+
67
+ // Plugins
68
+ $plugins = apply_filters('my_private_site_deactivate_feedback_form_plugins', array());
69
+
70
+ // Reasons
71
+ $defaultReasons = array(
72
+ 'no-longer-needed' => __('I don\'t need My Private Site any more', 'my-private-site'),
73
+ 'missing-feature' => __('My Private Site is missing a feature I need', 'my-private-site'),
74
+ 'not-get-to-work' => __('I couldn\'t get it to work right', 'my-private-site'),
75
+ 'found-better-plugin' => __('I found a plugin I like better', 'my-private-site'),
76
+ 'plugin-broke-site' => __('My Private Site broke my site', 'my-private-site'),
77
+ 'short-period' => __('I only needed My Private Site for a short period', 'my-private-site'),
78
+ 'temporary-deactivation' => __('It\'s a temporary deactivation. I\'m troubleshooting', 'my-private-site'),
79
+ 'other' => __('Other', 'my-private-site'),
80
+ );
81
+
82
+ foreach ($plugins as $plugin) {
83
+ $plugin->reasons = apply_filters('my_private_site_deactivate_feedback_form_reasons', $defaultReasons, $plugin);
84
+ }
85
+
86
+ // Send plugin data
87
+ wp_localize_script('my-private-site-deactivate-feedback-form', 'my_private_site_deactivate_feedback_form_plugins', $plugins);
88
+ });
89
+
90
+ /**
91
+ * Hook for adding plugins, pass an array of objects in the following format:
92
+ * 'slug' => 'plugin-slug'
93
+ * 'version' => 'plugin-version'
94
+ * @return array The plugins in the format described above
95
+ */
96
+ add_filter('my_private_site_deactivate_feedback_form_plugins', function ($plugins) {
97
+ return $plugins;
98
+ });
99
+
telemetry/js/deactivate.js ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * My Private Site by David Gewirtz, adopted from Jon ‘jonradio’ Pearkins
3
+ *
4
+ * Lab Notes: http://zatzlabs.com/lab-notes/
5
+ * Plugin Page: https://zatzlabs.com/project/my-private-site/
6
+ * Contact: http://zatzlabs.com/contact-us/
7
+ *
8
+ * Copyright (c) 2015-2020 by David Gewirtz
9
+ */
10
+
11
+
12
+ // Based on code from https://github.com/CodeCabin/plugin-deactivation-survey
13
+
14
+ (function ($) {
15
+ if (!window.myPrivateSite)
16
+ window.myPrivateSite = {};
17
+
18
+ if (myPrivateSite.DeactivateFeedbackForm)
19
+ return;
20
+
21
+ myPrivateSite.DeactivateFeedbackForm = function (plugin) {
22
+ var self = this;
23
+ var strings = my_private_site_deactivate_feedback_form_strings;
24
+
25
+ this.plugin = plugin;
26
+
27
+ // Dialog HTML
28
+ //<input name="comments" placeholder="' + strings.brief_description + '"/>\
29
+ var element = $('\
30
+ <div class="my-private-site-deactivate-dialog" data-remodal-id="' + plugin.slug + '">\
31
+ <form>\
32
+ <input type="hidden" name="plugin"/>\
33
+ <h2>' + strings.quick_feedback + '</h2>\
34
+ <p>\
35
+ ' + strings.foreword + '\
36
+ </p>\
37
+ <ul class="my-private-site-deactivate-reasons"></ul>\
38
+ <textarea rows="3" name="comments" placeholder="' + strings.brief_description + '"></textarea>\
39
+ <br>\
40
+ <p class="my-private-site-deactivate-dialog-buttons">\
41
+ <input type="submit" class="button confirm" value="' + strings.skip_and_deactivate + '"/>\
42
+ <button data-remodal-action="cancel" class="button button-primary">' + strings.cancel + '</button>\
43
+ </p>\
44
+ </form>\
45
+ </div>\
46
+ ')[0];
47
+ this.element = element;
48
+
49
+ $(element).find("input[name='plugin']").val(JSON.stringify(plugin));
50
+
51
+ $(element).on("click", "input[name='reason']", function (event) {
52
+ $(element).find("input[type='submit']").val(
53
+ strings.submit_and_deactivate
54
+ );
55
+ });
56
+
57
+ $(element).find("form").on("submit", function (event) {
58
+ self.onSubmit(event);
59
+ });
60
+
61
+ // Reasons list
62
+ var ul = $(element).find("ul.my-private-site-deactivate-reasons");
63
+ for (var key in plugin.reasons) {
64
+ var li = $("<li><input type='radio' name='reason'/> <span></span></li>");
65
+
66
+ $(li).find("input").val(key);
67
+ $(li).find("span").html(plugin.reasons[key]);
68
+
69
+ $(ul).append(li);
70
+ }
71
+
72
+ // Listen for deactivate
73
+ $("#the-list [data-slug='" + plugin.slug + "'] .deactivate>a").on("click", function (event) {
74
+ self.onDeactivateClicked(event);
75
+ });
76
+ }
77
+
78
+ myPrivateSite.DeactivateFeedbackForm.prototype.onDeactivateClicked = function (event) {
79
+ this.deactivateURL = event.target.href;
80
+
81
+ event.preventDefault();
82
+
83
+ if (!this.dialog)
84
+ this.dialog = $(this.element).remodal();
85
+ this.dialog.open();
86
+ }
87
+
88
+ myPrivateSite.DeactivateFeedbackForm.prototype.onSubmit = function (event) {
89
+ var element = this.element;
90
+ var strings = my_private_site_deactivate_feedback_form_strings;
91
+ var preData = $(element).find("form");
92
+ var i;
93
+ var chosenOption; // the option that's been checked
94
+ var comment; // a comment, if provided
95
+
96
+ // build data summary
97
+ // process 8 radio button fields
98
+ for (i = 1; i <= 8; i++) {
99
+ if (preData[0][i].checked === true) {
100
+ if (i < 8) {
101
+ chosenOption = preData[0][i].value;
102
+ } else {
103
+ chosenOption = 'other';
104
+ }
105
+ comment = preData[0][9].value;
106
+ }
107
+ }
108
+ // quickly sanitize the comments string
109
+ // https://gomakethings.com/how-to-automatically-sanitize-reactive-data-with-vanilla-js/
110
+ var temp = document.createElement('div');
111
+ temp.textContent = comment;
112
+ comment = temp.innerHTML;
113
+ // prepare the telemetry variables
114
+ var timeNow = this.plugin.timeNow;
115
+ var installTime = this.plugin.installTime; // this will be the get_option install time value
116
+ var useDuration = this.plugin.useDuration; // this is the difference between the two in seconds -- TEMP VALUE
117
+ var packedData = {
118
+ slug: this.plugin.slug,
119
+ option: chosenOption,
120
+ version: this.plugin.version,
121
+ comment: comment,
122
+ install_time: installTime,
123
+ uninstall_time: timeNow,
124
+ duration: useDuration,
125
+ };
126
+
127
+ var self = this;
128
+ var data = JSON.stringify(packedData);
129
+
130
+ $(element).find("button, input[type='submit']").prop("disabled", true);
131
+
132
+ if ($(element).find("input[name='reason']:checked").length) {
133
+ $(element).find("input[type='submit']").val(strings.thank_you);
134
+
135
+ $.ajax({
136
+ type: "POST",
137
+ url: this.plugin.telemetryUrl + "/wp-json/zatz/v1/telemetry_uninstalls",
138
+ data: data,
139
+ complete: function () {
140
+ window.location.href = self.deactivateURL;
141
+ }
142
+ });
143
+ } else {
144
+ $(element).find("input[type='submit']").val(strings.please_wait);
145
+ window.location.href = self.deactivateURL;
146
+ }
147
+
148
+ event.preventDefault();
149
+ return false;
150
+ }
151
+
152
+ $(document).ready(function () {
153
+
154
+ for (var i = 0; i < my_private_site_deactivate_feedback_form_plugins.length; i++) {
155
+ var plugin = my_private_site_deactivate_feedback_form_plugins[i];
156
+ new myPrivateSite.DeactivateFeedbackForm(plugin);
157
+ }
158
+
159
+ });
160
+
161
+ })(jQuery);
util/utilities.php CHANGED
@@ -95,6 +95,10 @@ function my_private_site_store_url() {
95
  return "https://zatzlabs.com";
96
  }
97
 
 
 
 
 
98
  /******************************************************************************************************/
99
  function my_private_site_debug_log($message) {
100
  $max_log_line_count = 200;
95
  return "https://zatzlabs.com";
96
  }
97
 
98
+ function my_private_site_telemetry_url() {
99
+ return "https://zatzlabs.com";
100
+ }
101
+
102
  /******************************************************************************************************/
103
  function my_private_site_debug_log($message) {
104
  $max_log_line_count = 200;