Version Description
Download this release
Release Info
Developer | raptor235 |
Plugin | Sidekick |
Version | 1.6.18 |
Comparing to | |
See all releases |
Code changes from version 1.6.19 to 1.6.18
- libs/admin_page.php +0 -355
- libs/sk_config_data.php +0 -175
- readme.txt +0 -266
- sidekick.php +0 -433
libs/admin_page.php
DELETED
@@ -1,355 +0,0 @@
|
|
1 |
-
<?php global $SK_PAID_LIBRARY_FILE, $SK_FREE_LIBRARY_FILE ?>
|
2 |
-
|
3 |
-
<style type="text/css">
|
4 |
-
|
5 |
-
.wrapper_main{
|
6 |
-
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
|
7 |
-
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
|
8 |
-
display: -ms-flexbox; /* TWEENER - IE 10 */
|
9 |
-
display: -webkit-flex; /* NEW - Chrome */
|
10 |
-
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
|
11 |
-
-webkit-flex-wrap: wrap;
|
12 |
-
-moz-flex-wrap: wrap;
|
13 |
-
-ms-flex-wrap: wrap;
|
14 |
-
flex-wrap: wrap;
|
15 |
-
-webkit-flex-direction: row;
|
16 |
-
-moz-flex-direction: row;
|
17 |
-
-ms-flex-direction: row;
|
18 |
-
flex-direction: row;
|
19 |
-
}
|
20 |
-
|
21 |
-
.wrapper_main h3{
|
22 |
-
margin: 0;
|
23 |
-
}
|
24 |
-
|
25 |
-
.wrapper_main .box{
|
26 |
-
-webkit-box-flex: 1; /* OLD - iOS 6-, Safari 3.1-6 */
|
27 |
-
-moz-box-flex: 1; /* OLD - Firefox 19- */
|
28 |
-
-webkit-flex: 1; /* Chrome */
|
29 |
-
-ms-flex: 1; /* IE 10 */
|
30 |
-
flex: 1; /* NEW, Spec - Opera 12.1, Firefox 20+ */
|
31 |
-
max-width: 50%;
|
32 |
-
}
|
33 |
-
|
34 |
-
.wrapper_left{
|
35 |
-
-webkit-flex-direction: column;
|
36 |
-
-moz-flex-direction: column;
|
37 |
-
-ms-flex-direction: column;
|
38 |
-
flex-direction: column;
|
39 |
-
}
|
40 |
-
|
41 |
-
.wrapper_left .box{
|
42 |
-
max-width: 100%;
|
43 |
-
}
|
44 |
-
|
45 |
-
.wrapper_right{
|
46 |
-
-webkit-flex-direction: column;
|
47 |
-
-moz-flex-direction: column;
|
48 |
-
-ms-flex-direction: column;
|
49 |
-
flex-direction: column;
|
50 |
-
}
|
51 |
-
|
52 |
-
.wrapper_right .box{
|
53 |
-
max-width: 100%;
|
54 |
-
}
|
55 |
-
|
56 |
-
.wrapper_wts{
|
57 |
-
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
|
58 |
-
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
|
59 |
-
display: -ms-flexbox; /* TWEENER - IE 10 */
|
60 |
-
display: -webkit-flex; /* NEW - Chrome */
|
61 |
-
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
|
62 |
-
-webkit-flex-direction: row;
|
63 |
-
-moz-flex-direction: row;
|
64 |
-
-ms-flex-direction: row;
|
65 |
-
flex-direction: row;
|
66 |
-
-webkit-flex-wrap: wrap;
|
67 |
-
-moz-flex-wrap: wrap;
|
68 |
-
-ms-flex-wrap: wrap;
|
69 |
-
flex-wrap: wrap;
|
70 |
-
}
|
71 |
-
|
72 |
-
.wrapper_wts .box{
|
73 |
-
-webkit-flex-grow: 1;
|
74 |
-
-moz-flex-grow: 1;
|
75 |
-
-ms-flex-grow: 1;
|
76 |
-
flex-grow: 1;
|
77 |
-
min-width: 50%;
|
78 |
-
}
|
79 |
-
|
80 |
-
.wrapper_wts .box span{
|
81 |
-
padding: 3px;
|
82 |
-
display: block;
|
83 |
-
}
|
84 |
-
|
85 |
-
.well{
|
86 |
-
background-color: #fbfbfb;
|
87 |
-
margin-right: 10px;
|
88 |
-
margin-bottom: 10px;
|
89 |
-
padding: 20px;
|
90 |
-
border: 1px solid #e3e3e3;
|
91 |
-
border-radius: 4px;
|
92 |
-
min-height: 150px;
|
93 |
-
overflow: hidden;
|
94 |
-
}
|
95 |
-
|
96 |
-
.sidekick_admin a{
|
97 |
-
color: #F2641E;
|
98 |
-
}
|
99 |
-
|
100 |
-
.sidekick_admin ul{
|
101 |
-
margin-left: 20px;
|
102 |
-
}
|
103 |
-
|
104 |
-
.sidekick_admin ul li{
|
105 |
-
list-style-type: disc;
|
106 |
-
list-style-position: outside;
|
107 |
-
margin-left: 20px;
|
108 |
-
}
|
109 |
-
|
110 |
-
#sk_dashboard_message{
|
111 |
-
padding:15px;
|
112 |
-
position:relative;
|
113 |
-
}
|
114 |
-
|
115 |
-
a.sk_upgrade{
|
116 |
-
background-color: green;
|
117 |
-
color: white;
|
118 |
-
border-radius: 3px;
|
119 |
-
text-decoration: none;
|
120 |
-
padding: 3px;
|
121 |
-
margin-left: 10px;
|
122 |
-
}
|
123 |
-
|
124 |
-
.composer_beta_button{
|
125 |
-
background: #ff712b;
|
126 |
-
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJod…EiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
|
127 |
-
background: -moz-linear-gradient(top, #ff712b 0%, #ed5f19 100%);
|
128 |
-
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ff712b), color-stop(100%, #ed5f19));
|
129 |
-
background: -webkit-linear-gradient(top, #ff712b 0%, #ed5f19 100%);
|
130 |
-
background: -o-linear-gradient(top, #ff712b 0%, #ed5f19 100%);
|
131 |
-
background: -ms-linear-gradient(top, #ff712b 0%, #ed5f19 100%);
|
132 |
-
background: linear-gradient(to bottom, #ff712b 0%, #ed5f19 100%);
|
133 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff712b', endColorstr='#ed5f19', GradientType=0);
|
134 |
-
border-radius: 2px;
|
135 |
-
text-align: center;
|
136 |
-
float: right;
|
137 |
-
color: white;
|
138 |
-
padding: 10px;
|
139 |
-
font-size: 24px;
|
140 |
-
line-height: 29px;
|
141 |
-
border: solid 4px #9C3D0E;
|
142 |
-
margin-top: 20px;
|
143 |
-
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
|
144 |
-
}
|
145 |
-
|
146 |
-
.composer_beta_button:hover{
|
147 |
-
background: #e05c1b;
|
148 |
-
}
|
149 |
-
|
150 |
-
input.regular-text{
|
151 |
-
width: 100%;
|
152 |
-
}
|
153 |
-
|
154 |
-
</style>
|
155 |
-
|
156 |
-
|
157 |
-
<script type="text/javascript">
|
158 |
-
|
159 |
-
function sk_populate(data){
|
160 |
-
var passed_walkthroughs = window.sidekick.compatibilityModel.get('passed_walkthroughs');
|
161 |
-
var already_done = [];
|
162 |
-
|
163 |
-
_.each(passed_walkthroughs,function(item,key){
|
164 |
-
var checked = false;
|
165 |
-
var selected = false;
|
166 |
-
|
167 |
-
if (!already_done[item.id]) {
|
168 |
-
already_done[item.id] = true;
|
169 |
-
if (jQuery.inArray(item.id,sk_config.disable_wts) > -1) {
|
170 |
-
checked = 'CHECKED'
|
171 |
-
};
|
172 |
-
if (sk_config.autostart_walkthrough_id !== 'undefined' && sk_config.autostart_walkthrough_id == item.id) {
|
173 |
-
selected = 'SELECTED';
|
174 |
-
};
|
175 |
-
|
176 |
-
jQuery('.sk_walkthrough_list').append('<div class="box"><span><input type="checkbox" ' + checked + ' value="' + item.id + '" name="disable_wts[]">' + item.title + '<span></div>');
|
177 |
-
jQuery('[name="sk_autostart_walkthrough_id"]').append('<option ' + selected + ' value="' + item.id + '">' + item.title + '</option>');
|
178 |
-
};
|
179 |
-
})
|
180 |
-
|
181 |
-
}
|
182 |
-
|
183 |
-
jQuery(document).ready(function($) {
|
184 |
-
sk_populate();
|
185 |
-
if (sk_config.library_paid_file) {
|
186 |
-
jQuery.ajax({
|
187 |
-
url:'<?php echo $SK_PAID_LIBRARY_FILE ?>',
|
188 |
-
type:'HEAD',
|
189 |
-
error: function(data){
|
190 |
-
jQuery('.sk_license_status span').html('Invalid Key').css({color: 'red'});
|
191 |
-
jQuery('.sk_upgrade').show();
|
192 |
-
},
|
193 |
-
success: function(data){
|
194 |
-
if (typeof sk_paid_library !== 'undefined') {
|
195 |
-
if (_.size(sk_paid_library.buckets) > 0) {
|
196 |
-
jQuery('.sk_license_status').html('Valid').css({color: 'green'});
|
197 |
-
} else {
|
198 |
-
jQuery('.sk_license_status span').html('Expired').css({color: 'orange'});
|
199 |
-
jQuery('.sk_upgrade').show();
|
200 |
-
}
|
201 |
-
};
|
202 |
-
}
|
203 |
-
});
|
204 |
-
} else {
|
205 |
-
jQuery('.sk_upgrade').show();
|
206 |
-
}
|
207 |
-
});
|
208 |
-
|
209 |
-
</script>
|
210 |
-
|
211 |
-
|
212 |
-
<div class="page-header"><h2><a id="pluginlogo_32" class="header-icon32" href="http://www.sidekick.pro/modules/wordpress-core-module-premium/?utm_source=plugin&utm_medium=settings&utm_campaign=header" target="_blank"></a>Sidekick Dashboard</h2></div>
|
213 |
-
|
214 |
-
<h3>Welcome to the fastest and easiest way to learn WordPress</h3>
|
215 |
-
|
216 |
-
<?php if (isset($error_message)): ?>
|
217 |
-
<div class="error" id="sk_dashboard_message">
|
218 |
-
There was a problem activating your license. The following error occured <?php echo $error_message ?>
|
219 |
-
</div>
|
220 |
-
<?php elseif (isset($error)): ?>
|
221 |
-
<div class="error" id="sk_dashboard_message">
|
222 |
-
<?php echo $error ?>
|
223 |
-
</div>
|
224 |
-
<?php elseif (isset($warn)): ?>
|
225 |
-
<div class="updated" id="sk_dashboard_message">
|
226 |
-
<?php echo $warn ?>
|
227 |
-
</div>
|
228 |
-
<?php elseif (isset($success)): ?>
|
229 |
-
<div class="updated" id="sk_dashboard_message">
|
230 |
-
<?php echo $success ?>
|
231 |
-
</div>
|
232 |
-
<?php endif ?>
|
233 |
-
|
234 |
-
<div class="sidekick_admin wrapper_main">
|
235 |
-
|
236 |
-
<div class="box left">
|
237 |
-
<div class="wrapper_left">
|
238 |
-
<div class="box license">
|
239 |
-
<div class="well">
|
240 |
-
<?php if (!$error): ?>
|
241 |
-
<h3>My Sidekick Account</h3>
|
242 |
-
<form method="post">
|
243 |
-
<?php settings_fields('sk_license'); ?>
|
244 |
-
<table class="form-table">
|
245 |
-
<tbody>
|
246 |
-
<tr valign="top">
|
247 |
-
<th scope="row" valign="top">Activation ID</th>
|
248 |
-
<td><input class='regular-text' type='text' name='activation_id' value='<?php echo $activation_id ?>'></input></td>
|
249 |
-
</tr>
|
250 |
-
|
251 |
-
<tr valign="top">
|
252 |
-
<th scope="row" valign="top">Status</th>
|
253 |
-
<td><span style='color: blue' class='sk_license_status'><span><?php echo ucfirst($status) ?></span> <a style='display: none' class='sk_upgrade' href='http://www.sidekick.pro/modules/wordpress-core-module-premium/?utm_source=plugin&utm_medium=settings&utm_campaign=upgrade' target="_blank"> Upgrade Now!</a> </span></td>
|
254 |
-
</tr>
|
255 |
-
|
256 |
-
<tr valign="top">
|
257 |
-
<th scope="row" valign="top">
|
258 |
-
Data Tracking
|
259 |
-
</th>
|
260 |
-
<td>
|
261 |
-
<input name="sk_track_data" type="checkbox" <?php if ($sk_track_data): ?>CHECKED<?php endif ?> />
|
262 |
-
<input type='hidden' name='status' value='<?php echo $status ?>'/>
|
263 |
-
<label class="description" for="track_data">Help Sidekick by providing tracking data which will help us build better help tools.</label>
|
264 |
-
</td>
|
265 |
-
</tr>
|
266 |
-
|
267 |
-
<tr valign="top" style='display: none'>
|
268 |
-
<th scope="row" valign="top">
|
269 |
-
Enable Composer Mode
|
270 |
-
</th>
|
271 |
-
<td>
|
272 |
-
<input name="sk_composer_button" type="checkbox" <?php if (get_option('sk_composer_button')): ?>CHECKED<?php endif ?> />
|
273 |
-
<label class="description" for="track_data">Enable Walkthrough creation.</label>
|
274 |
-
</td>
|
275 |
-
</tr>
|
276 |
-
</tbody>
|
277 |
-
</table>
|
278 |
-
<?php submit_button('Update'); ?>
|
279 |
-
<?php wp_nonce_field( 'update_sk_settings' ); ?>
|
280 |
-
</form>
|
281 |
-
<?php endif ?>
|
282 |
-
</div>
|
283 |
-
</div>
|
284 |
-
|
285 |
-
<div class="box composer">
|
286 |
-
<div class="well">
|
287 |
-
<h3>Build Your Own Walkthroughs - Get Composer</h3>
|
288 |
-
<a href='http://www.sidekick.pro/plans/?utm_source=plugin&utm_medium=settings&utm_campaign=composerbeta' target='_blank'><div class='composer_beta_button'>Join the<br/>Composer Beta</div></a>
|
289 |
-
<ul>
|
290 |
-
<li>Join the <a href='http://www.sidekick.pro/plans/' target='_blank'>Composer Beta</a> now!</li>
|
291 |
-
<li><a href="http://www.sidekick.pro/plans/" target="_blank">Check out our Composer Plans</a></li>
|
292 |
-
</ul>
|
293 |
-
</div>
|
294 |
-
</div>
|
295 |
-
|
296 |
-
<div class="box you_should_know">
|
297 |
-
<div class="well">
|
298 |
-
<h3>Few Things you should know:</h3>
|
299 |
-
<div class="">
|
300 |
-
<ul>
|
301 |
-
<li>Clicking the check-box above will allow us to link your email address to the stats we collect so we can contact you if we have a question or notice an issue. It’s not mandatory, but it would help us out.</li>
|
302 |
-
<li>Your Activation ID is unique and limited to your production, staging, and development urls.</li>
|
303 |
-
<li>The Sidekick team adheres strictly to CANSPAM. From time to time we may send critical updates (such as security notices) to the email address setup as the Administrator on this site.</li>
|
304 |
-
<li>If you have any questions, bug reports or feedback, please send them to <a target="_blank" href="mailto:support@sidekick.pro">us</a> </li>
|
305 |
-
<li>You can find our terms of use <a target="_blank" href="http://www.sidekick.pro/terms-of-use/">here</a></li>
|
306 |
-
</ul>
|
307 |
-
</div>
|
308 |
-
</div>
|
309 |
-
</div>
|
310 |
-
</div>
|
311 |
-
</div>
|
312 |
-
|
313 |
-
<div class="box right">
|
314 |
-
<div class="wrapper_right">
|
315 |
-
<div class="box">
|
316 |
-
<div class="well">
|
317 |
-
<h3>Configure</h3>
|
318 |
-
|
319 |
-
<form method='post'>
|
320 |
-
|
321 |
-
<h4>Auto Start Walkthrough</h4>
|
322 |
-
|
323 |
-
<p>This Walkthrough will be played once for every user that logs into the backend of WordPress.</p>
|
324 |
-
<select name='sk_autostart_walkthrough_id'>
|
325 |
-
<option value='0'>No Auto Start</option>
|
326 |
-
</select>
|
327 |
-
<input class='button button-primary' type='submit' value='Save'/>
|
328 |
-
|
329 |
-
<h4>Turn Off Walkthroughs</h4>
|
330 |
-
|
331 |
-
<p>Below you can turn off specific Walkthroughs for this website.</p>
|
332 |
-
<div class='sk_walkthrough_list wrapper_wts'></div>
|
333 |
-
<input class='button button-primary' type='submit' value='Save'/>
|
334 |
-
<?php wp_nonce_field( 'update_sk_settings' ); ?>
|
335 |
-
</form>
|
336 |
-
</div>
|
337 |
-
</div>
|
338 |
-
|
339 |
-
<div class="box love">
|
340 |
-
<div class="well">
|
341 |
-
<h3>Love the Sidekick plugin?</h3>
|
342 |
-
<ul>
|
343 |
-
<li>Please help spread the word!</li>
|
344 |
-
<li><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://sidekick.pro" data-text="I use @sidekickhelps for the fastest and easiest way to learn WordPress." data-via="sidekickhelps" data-size="large">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></li>
|
345 |
-
<li>Like SIDEKICK? Please leave us a 5 star rating on <a href='http://WordPress.org' target='_blank'>WordPress.org</a></li>
|
346 |
-
<li><a href="http://www.sidekick.pro/wordpress/modules/wordpress-core-module-premium/">Check out the full WordPress Core Premium (150+ Walkthroughs)</a></li>
|
347 |
-
<li><a href="http://wordpress.org/support/plugin/sidekick" target="_blank"><strong>Visit the plugin Help & Support page</strong></a>.</li>
|
348 |
-
</ul>
|
349 |
-
</div>
|
350 |
-
</div>
|
351 |
-
</div>
|
352 |
-
</div>
|
353 |
-
|
354 |
-
|
355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libs/sk_config_data.php
DELETED
@@ -1,175 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class sk_config_data{
|
4 |
-
function get_domain(){
|
5 |
-
$site_url = get_site_url();
|
6 |
-
if(substr($site_url, -1) == '/') {
|
7 |
-
$site_url = substr($site_url, 0, -1);
|
8 |
-
}
|
9 |
-
$site_url = str_replace(array("http://","https://"),array(""),$site_url);
|
10 |
-
return $site_url;
|
11 |
-
}
|
12 |
-
|
13 |
-
function get_post_types(){
|
14 |
-
global $wpdb;
|
15 |
-
$query = "SELECT post_type, count(distinct ID) as count from {$wpdb->prefix}posts group by post_type";
|
16 |
-
$counts = $wpdb->get_results($query);
|
17 |
-
$output = '';
|
18 |
-
|
19 |
-
foreach ($counts as $key => $type) {
|
20 |
-
$type->post_type = str_replace('-', '_', $type->post_type);
|
21 |
-
$output .= "\n post_type_{$type->post_type} : $type->count,";
|
22 |
-
}
|
23 |
-
return $output;
|
24 |
-
}
|
25 |
-
|
26 |
-
function get_themes(){
|
27 |
-
$themes = wp_get_themes( array( 'allowed' => true ) );
|
28 |
-
return count($themes);
|
29 |
-
}
|
30 |
-
|
31 |
-
function get_post_types_and_statuses(){
|
32 |
-
global $wpdb;
|
33 |
-
$query = "SELECT post_type, post_status, count(distinct ID) as count from {$wpdb->prefix}posts group by post_type, post_status";
|
34 |
-
$counts = $wpdb->get_results($query);
|
35 |
-
$output = '';
|
36 |
-
|
37 |
-
foreach ($counts as $key => $type) {
|
38 |
-
$type->post_type = str_replace('-', '_', $type->post_type);
|
39 |
-
$type->post_status = str_replace('-', '_', $type->post_status);
|
40 |
-
|
41 |
-
$output .= "\n post_type_{$type->post_type}_{$type->post_status} : $type->count,";
|
42 |
-
}
|
43 |
-
return $output;
|
44 |
-
}
|
45 |
-
|
46 |
-
function get_taxonomies(){
|
47 |
-
global $wpdb;
|
48 |
-
$query = "SELECT count(distinct term_taxonomy_id) as count, taxonomy from {$wpdb->prefix}term_taxonomy group by taxonomy";
|
49 |
-
$counts = $wpdb->get_results($query);
|
50 |
-
$output = '';
|
51 |
-
|
52 |
-
foreach ($counts as $key => $taxonomy) {
|
53 |
-
$taxonomy->taxonomy = str_replace('-', '_', $taxonomy->taxonomy);
|
54 |
-
$output .= "\n taxonomy_{$taxonomy->taxonomy} : $taxonomy->count,";
|
55 |
-
}
|
56 |
-
return $output;
|
57 |
-
}
|
58 |
-
|
59 |
-
function get_comments(){
|
60 |
-
global $wpdb;
|
61 |
-
$query = "SELECT count(distinct comment_ID) as count from {$wpdb->prefix}comments";
|
62 |
-
$counts = $wpdb->get_var($query);
|
63 |
-
if (!$counts) $counts = 0;
|
64 |
-
return "\n comment_count : $counts,";
|
65 |
-
}
|
66 |
-
|
67 |
-
function get_post_statuses(){
|
68 |
-
global $wpdb;
|
69 |
-
$query = "SELECT post_status, count(ID) as count from {$wpdb->prefix}posts group by post_status";
|
70 |
-
$counts = $wpdb->get_results($query);
|
71 |
-
$output = '';
|
72 |
-
|
73 |
-
foreach ($counts as $key => $type) {
|
74 |
-
$type->post_status = str_replace('-', '_', $type->post_status);
|
75 |
-
$output .= "\n post_status_{$type->post_status} : $type->count,";
|
76 |
-
}
|
77 |
-
return $output;
|
78 |
-
}
|
79 |
-
|
80 |
-
function get_user_data(){
|
81 |
-
global $current_user;
|
82 |
-
|
83 |
-
$data = get_userdata($current_user->ID);
|
84 |
-
$output = "\n user_id : $current_user->ID,";
|
85 |
-
|
86 |
-
foreach ($data->allcaps as $cap => $val) {
|
87 |
-
$cap = sanitize_title($cap);
|
88 |
-
$cap = str_replace('-', '_', $cap);
|
89 |
-
if (!$val) $val = 0;
|
90 |
-
$output .= "\n cap_{$cap} : $val,";
|
91 |
-
}
|
92 |
-
return $output;
|
93 |
-
}
|
94 |
-
|
95 |
-
function get_current_url() {
|
96 |
-
if (isset($_SERVER['REQUEST_URI'])) {
|
97 |
-
return 'http'.(empty($_SERVER['HTTPS'])?'':'s').'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
|
98 |
-
} else if (isset($_SERVER['PATH_INFO'])) {
|
99 |
-
return $_SERVER['PATH_INFO'];
|
100 |
-
} else {
|
101 |
-
$host = $_SERVER['HTTP_HOST'];
|
102 |
-
$port = $_SERVER['SERVER_PORT'];
|
103 |
-
$request = $_SERVER['PHP_SELF'];
|
104 |
-
$query = isset($_SERVER['argv']) ? substr($_SERVER['argv'][0], strpos($_SERVER['argv'][0], ';') + 1) : '';
|
105 |
-
$toret = $protocol . '://' . $host . ($port == $protocol_port ? '' : ':' . $port) . $request . (empty($query) ? '' : '?' . $query);
|
106 |
-
return $toret;
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
function get_disabled_wts(){
|
111 |
-
$wts = str_replace('"', '', get_option('sk_disabled_wts'));
|
112 |
-
if ($wts) {
|
113 |
-
return $wts;
|
114 |
-
}
|
115 |
-
return 'false';
|
116 |
-
}
|
117 |
-
|
118 |
-
function get_plugins(){
|
119 |
-
$active_plugins = wp_get_active_and_valid_plugins();
|
120 |
-
$mu_plugins = get_mu_plugins();
|
121 |
-
|
122 |
-
$printed = false;
|
123 |
-
|
124 |
-
$output = '[';
|
125 |
-
$count = 0;
|
126 |
-
|
127 |
-
if (is_array($active_plugins)) {
|
128 |
-
foreach ($active_plugins as $plugins_key => $plugin) {
|
129 |
-
$data = get_plugin_data( $plugin, false, false );
|
130 |
-
|
131 |
-
$plugins[addslashes($data['Name'])] = $data['Version'];
|
132 |
-
if ($plugins_key > 0) $output .= ',';
|
133 |
-
$data['Name'] = addslashes($data['Name']);
|
134 |
-
$output .= "{'{$data['Name']}' : '{$data['Version']}'}";
|
135 |
-
$printed = true;
|
136 |
-
$count++;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
if (is_array($mu_plugins)) {
|
141 |
-
foreach ($mu_plugins as $plugins_key => $plugin) {
|
142 |
-
$plugins[addslashes($data['Name'])] = $plugin['Version'];
|
143 |
-
if ($printed) $output .= ',';
|
144 |
-
$plugin['Name'] = addslashes($plugin['Name']);
|
145 |
-
$output .= "{'{$plugin['Name']}' : '{$plugin['Version']}'}";
|
146 |
-
$printed = true;
|
147 |
-
$count++;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
$output .= ']';
|
151 |
-
return array('plugins' => $output, 'count' => $count);
|
152 |
-
}
|
153 |
-
|
154 |
-
function get_user_role(){
|
155 |
-
global $current_user, $wp_roles;
|
156 |
-
|
157 |
-
if (is_super_admin($current_user->ID)) {
|
158 |
-
return 'administrator';
|
159 |
-
}
|
160 |
-
|
161 |
-
if(!isset($current_user->caps) || count($current_user->caps) < 1){
|
162 |
-
// In MS in some specific pages current user is returning empty caps so this is a work around for that case.
|
163 |
-
if (current_user_can('activate_plugins')){
|
164 |
-
return 'administrator';
|
165 |
-
}
|
166 |
-
}
|
167 |
-
foreach($wp_roles->role_names as $role => $Role) {
|
168 |
-
if (array_key_exists($role, $current_user->caps)){
|
169 |
-
$user_role = $role;
|
170 |
-
break;
|
171 |
-
}
|
172 |
-
}
|
173 |
-
return $user_role;
|
174 |
-
}
|
175 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
DELETED
@@ -1,266 +0,0 @@
|
|
1 |
-
=== Sidekick ===
|
2 |
-
Contributors: raptor235,benfox,andymci
|
3 |
-
Donate link: http://www.sidekick.pro
|
4 |
-
Tags: help, tutorial, training, learn, learning, sidekick, guide, teach, video, manual, videos, wphelp, support, instructions, question, questions, answers, answer, clippy, q&a, wpuniversity, helper, walkthrough
|
5 |
-
Requires at least: 3.7
|
6 |
-
Tested up to: 4.0
|
7 |
-
Stable tag: 1.6.19
|
8 |
-
License: GNU Version 2 or Any Later Version
|
9 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
-
|
11 |
-
Real-time, voice-guided WordPress training and support straight from your dashboard.
|
12 |
-
|
13 |
-
== Description ==
|
14 |
-
|
15 |
-
[youtube https://www.youtube.com/watch?v=5BHSqdU1Ssk]
|
16 |
-
|
17 |
-
**SIDEKICK is the fastest and easiest way to learn WordPress, Themes & Plugins!**
|
18 |
-
|
19 |
-
Sidekick provides interactive, real-time, narrated guides through the WordPress administration area. These guides (called Walkthroughs) come in three flavours:
|
20 |
-
|
21 |
-
- **Overviews**: Guided tours through admin screens and their features.
|
22 |
-
- **How-Tos**: Step-by-step instructions to help you complete a task.
|
23 |
-
- **Hotspots**: Useful reminders for on-screen elements, features and functions.
|
24 |
-
|
25 |
-
**Walkthroughs for other plugins and themes? You bet!**
|
26 |
-
|
27 |
-
If you're running a plugin or theme that’s supported by Sidekick, we’ll automatically serve up those Walkthroughs, as long as the Walkthroughs are active for your Sidekick account.
|
28 |
-
|
29 |
-
**A modern browser is all you need.**
|
30 |
-
|
31 |
-
Sidekick is built with JavaScript, so you don’t need to download any additional browser extensions or add-ons. Just install the SIDEKICK plugin for WordPress.
|
32 |
-
|
33 |
-
**SIDEKICK is perfect for you, if...**
|
34 |
-
|
35 |
-
*You're new to WordPress.* Instead of jumping back-and-forth between documentation, videos, and your own WordPress site, just follow the step-by-step SIDEKICK walkthroughs. Simple!
|
36 |
-
|
37 |
-
*You're helping someone learn WordPress.* Instead of repeatedly showing them the basics, let SIDEKICK do it for you - just install the plugin and tell them which walkthroughs to follow.
|
38 |
-
|
39 |
-
*You build WordPress sites for a living.* Reduce your training and support costs by installing Sidekick on client websites.
|
40 |
-
|
41 |
-
**Powered by the SIDEKICK platform.**
|
42 |
-
|
43 |
-
WordPress is just the tip of the iceberg! Sidekick can work with any web application, requiring no app or browser extension downloads for the user.
|
44 |
-
|
45 |
-
Walkthroughs are served directly from our servers, so you don't need to download or install additional files as new or updated walkthroughs are released.
|
46 |
-
|
47 |
-
With the user’s permission, Sidekick will collect anonymous data to track walkthrough and platform performance. This helps us improve the product and provide more useful support.
|
48 |
-
|
49 |
-
== Installation ==
|
50 |
-
|
51 |
-
**Plugin Search (Recommended)**
|
52 |
-
|
53 |
-
1. In /wp-admin/, go to Plugins > Add New.
|
54 |
-
2. Search for "Sidekick".
|
55 |
-
3. Look for "Sidekick” (should be the only result).
|
56 |
-
4. Click Install Now.
|
57 |
-
5. After installation has completed, click Activate Plugin.
|
58 |
-
|
59 |
-
**Manual Upload**
|
60 |
-
|
61 |
-
1. Download the plugin .zip file from wordpress.org/plugins/sidekick/
|
62 |
-
2. In /wp-admin/, go to Plugins > Add New. Click Upload.
|
63 |
-
3. Locate the .zip file on your computer. Click Install Now.
|
64 |
-
4. After installation has completed, click Activate Plugin.
|
65 |
-
|
66 |
-
**Manual FTP**
|
67 |
-
|
68 |
-
1. Download the plugin .zip file from wordpress.org/plugins/sidekick/
|
69 |
-
2. Extract the plugin folder contained in the .zip file.
|
70 |
-
3. Upload the plugin folder, via FTP, to your /wp-content/plugins/ directory.
|
71 |
-
4. On your Plugins screen, under Sidekick, click Activate.
|
72 |
-
|
73 |
-
== Upgrade Notice ==
|
74 |
-
|
75 |
-
Upgrade Notice
|
76 |
-
|
77 |
-
== Activation ==
|
78 |
-
|
79 |
-
After installation you’ll have access to at least 5 Core WordPress Walkthroughs. Activating Sidekick will unlock 30+ free WordPress Core Walkthroughs.
|
80 |
-
|
81 |
-
**Why Upgrade?**
|
82 |
-
|
83 |
-
Purchase a Premium WordPress Core subscription to unlock access to
|
84 |
-
|
85 |
-
== Frequently Asked Questions ==
|
86 |
-
|
87 |
-
= What is Sidekick for WordPress? =
|
88 |
-
|
89 |
-
The Sidekick platform provides real-time, guided support and learning from within any html or PHP based web application or CMS. Support is provided through modules called “Walkthroughs” that guide users through everything from understanding simple aspects of an application to completing complicated tasks.
|
90 |
-
|
91 |
-
The Sidekick plugin for WordPress connects the Sidekick platform with any WordPress Dashboard allowing real-time guided walkthroughs of core and 3rd party WordPress features and functions.
|
92 |
-
|
93 |
-
If you’d like to learn more about Sidekick, go to [Sidekick.pro](http://Sidekick.pro/ "Sidekick")
|
94 |
-
|
95 |
-
= What is a Sidekick Walkthrough? =
|
96 |
-
|
97 |
-
A Sidekick for WordPress Walkthrough is a real-time, guided tutorial that walks you step by step through completing a task inside your WordPress Dashboard. It’s as if your site-builder or theme developer were standing right there with you, helping you get it done.
|
98 |
-
|
99 |
-
= What are Core and 3rd Party WordPress Walkthroughs? =
|
100 |
-
|
101 |
-
When we say “Core Walkthroughs” for WordPress, we are referring to any support and learning that has to do with features and functions provided by a fresh, default install of WordPress, downloaded from WordPress.org. Basically, if a walkthrough is helpng you complete a standard WordPress function like creating a post, it’s a Core Walkthrough and SIDEKICK created it.
|
102 |
-
|
103 |
-
Plugin and theme specific Walkthroughs are called Third Party Walkthroughs and are created and maintained by the plugin or theme creator, unless otherwise mentioned.
|
104 |
-
|
105 |
-
= How do I create Walkthroughs for my Plugin(s) or Theme(s)? =
|
106 |
-
|
107 |
-
At the moment Sidekick Composer, the tool we use to create Walkthroughs, is for in-house use only but we plan for that to change by the end of July 2014. If you’re interested in getting a head start, fill out the form [on this page](http://www.sidekick.pro/developer-program/) and we will send you details on how to join us a little earlier.
|
108 |
-
|
109 |
-
= What does Sidekick for WordPress cost? =
|
110 |
-
|
111 |
-
The Sidekick plugin for WordPress is and always will be free to download and use. Installing the plugin gives you instant and unlimited access to 30 Core WordPress How-To and Overview Walkthroughs.
|
112 |
-
|
113 |
-
If you would like access to the full library of [Core WordPress Walkthroughs (Over 150)](http://www.sidekick.pro/wordpress/modules/wordpress-core-module-premium/) including Hotspots, the cost is $10 a month per URL.
|
114 |
-
|
115 |
-
= Ok, the plugin is installed and activated. How do I use it? =
|
116 |
-
|
117 |
-
Click on the “Help Me” bottom left of your screen to open the Walkthrough menu.
|
118 |
-
You will be presented with the Walkthrough menu. Select your bucket then your walkthrough and away you go.
|
119 |
-
|
120 |
-
= Can I suggest a Walkthrough that I’d like to see or give you feedback on the Sidekick WordPress Plugin? =
|
121 |
-
|
122 |
-
Absolutely. In fact, we rely on users like you to tell us about things that need to be improved or that you’d like to see added to the plugin. Send your email to info@wpuniversity.com. We read and respond to every piece of feedback we get.
|
123 |
-
|
124 |
-
== Screenshots ==
|
125 |
-
|
126 |
-
1. Sidekick in action, shows of the typical screen you will see while a Sidekick walkthrough is playing.
|
127 |
-
2. This widget shows the library of walkthroughs currently available.
|
128 |
-
3. User interaction demonstrated while a user is prompted to perform an action.
|
129 |
-
4. Yet another action requirement by the user is previewed here.
|
130 |
-
|
131 |
-
== Changelog ==
|
132 |
-
|
133 |
-
= 1.6.19 =
|
134 |
-
* Fixed PHP null vlaue capability
|
135 |
-
|
136 |
-
= 1.6.17 =
|
137 |
-
* Fixed PHP warning on plugin version
|
138 |
-
|
139 |
-
= 1.6.16 =
|
140 |
-
* Changed deactivation flow so user gets to keep their activation id
|
141 |
-
|
142 |
-
= 1.6.15 =
|
143 |
-
* Fixes hotspots not showing up in certain cases
|
144 |
-
* Fixes harcoded issue with db table prefix
|
145 |
-
* Style fixes on audio only mode
|
146 |
-
* Fixes issue with returning back to regular playback mode from audio only mode
|
147 |
-
* Fixes issue with audio player being muted in certain situations
|
148 |
-
|
149 |
-
= 1.6.5 =
|
150 |
-
* Fixed issue with Hotspot playback
|
151 |
-
|
152 |
-
= 1.6.4 =
|
153 |
-
* Fixed Composer Preview Bug
|
154 |
-
* Prefixed All Class Names
|
155 |
-
|
156 |
-
= 1.6.2 =
|
157 |
-
* Made the move target step optional
|
158 |
-
|
159 |
-
= 1.6.1 =
|
160 |
-
* Audio Fallback Mode added
|
161 |
-
* Sidekick won't show when no compatible walkthroughs are found
|
162 |
-
* Console messages turned off while not in debug mode
|
163 |
-
* Much improved cache invalidation
|
164 |
-
* Fixed a bug that on certain pages Sidekick wouldn't properly stop
|
165 |
-
* Fixed a bug with Sidekick blocking clicks after it's been stopped
|
166 |
-
|
167 |
-
= 1.5.5 =
|
168 |
-
* 4.0 Readiness
|
169 |
-
* Fixed conflict with caused by jquery-show
|
170 |
-
|
171 |
-
= 1.5.4 =
|
172 |
-
* Fixed incompatibility with iThemes Builder and For Loop JS Loops
|
173 |
-
* Added security nonces
|
174 |
-
* Added banner to let users know of Sidekick's existence
|
175 |
-
|
176 |
-
= 1.5.3 =
|
177 |
-
* Super Admin detection added
|
178 |
-
|
179 |
-
= 1.5.2 =
|
180 |
-
* Fixed Multisite issue with role detection on certain pages
|
181 |
-
|
182 |
-
= 1.5.1 =
|
183 |
-
* Added more parameters to tag Walkthroughs againts
|
184 |
-
|
185 |
-
= 1.5.0 =
|
186 |
-
* Paid vs Free Walkthrough Seperation
|
187 |
-
* Clean Up of Logs
|
188 |
-
|
189 |
-
= 1.4.2 =
|
190 |
-
* New Administration Screen
|
191 |
-
* Auto Start of a Walkthrough for each user
|
192 |
-
* Disable Specific Walkthroughs
|
193 |
-
|
194 |
-
= 1.4.1 =
|
195 |
-
* Fixed issue with hotspot button not showing
|
196 |
-
* Added ability to auto start a Walkthrough
|
197 |
-
* Added ability to disable specific Walkthroughs
|
198 |
-
|
199 |
-
= 1.4 =
|
200 |
-
* Switch over to new platform version
|
201 |
-
* Sidekick Activation Bug Fixed
|
202 |
-
* CSS Fixes
|
203 |
-
* Autostart on specific pages
|
204 |
-
* Added Wait_For Event
|
205 |
-
* Changed error messaging
|
206 |
-
* Fixed underscore template conflict with other backbone themes / apps
|
207 |
-
* Added LABjs file loading
|
208 |
-
* Added library load doublecheck
|
209 |
-
* Optimized Tracking
|
210 |
-
* Fixes to display rules boolean operations
|
211 |
-
* Added handlers for open a specific bucket
|
212 |
-
* Added handlers to auto open a specific bucket
|
213 |
-
* Fixed a bug when there were no comments in the blog
|
214 |
-
|
215 |
-
= 1.3.4 =
|
216 |
-
* Updated Modal UI
|
217 |
-
* Dropped www. from domain checking
|
218 |
-
* Walkthroughs now pause when user double clicks on another element
|
219 |
-
* Paid Walkthroughs now show in the free library
|
220 |
-
* Fixed a bug where capabilities have spaces
|
221 |
-
|
222 |
-
= 1.3.3 =
|
223 |
-
* Fixed an issue with custom prefixed databases
|
224 |
-
|
225 |
-
= 1.3.2 =
|
226 |
-
* HTTPs Protocol Adjustments
|
227 |
-
|
228 |
-
= 1.3.1 =
|
229 |
-
* Library loading bug fixed
|
230 |
-
|
231 |
-
= 1.2.2 =
|
232 |
-
* Activation Bug Fix
|
233 |
-
* UI Enchancements
|
234 |
-
|
235 |
-
= 1.2 =
|
236 |
-
* 3.9 Support Added
|
237 |
-
* Suppport for Module Marketplace
|
238 |
-
* HTTPs Support Added
|
239 |
-
* Fixes to "safety layer"
|
240 |
-
* Fix issue with hotspots showing while playing a walkthrough
|
241 |
-
|
242 |
-
= 1.10 =
|
243 |
-
* Brand New User Interface
|
244 |
-
* Hotspot Support Added
|
245 |
-
* 3.8 Support Added
|
246 |
-
* Deeper sub-category support
|
247 |
-
* Sidekick Platform Upgraded
|
248 |
-
* Known bug exists with HTTPs protocols
|
249 |
-
|
250 |
-
= 1.00 =
|
251 |
-
* Added support for buckets
|
252 |
-
|
253 |
-
= 0.78 =
|
254 |
-
* plugin Compatibility issues resolved
|
255 |
-
|
256 |
-
= 0.76 =
|
257 |
-
* Fixed sizing issues when more walkthroughs were added
|
258 |
-
|
259 |
-
= 0.74 =
|
260 |
-
* Fixed loop function bug
|
261 |
-
|
262 |
-
= 0.73 =
|
263 |
-
* Fixed Activation Bug
|
264 |
-
|
265 |
-
= 0.70 =
|
266 |
-
* Initial Beta Release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sidekick.php
DELETED
@@ -1,433 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
Plugin Name: Sidekick
|
5 |
-
Plugin URL: http://wordpress.org/plugins/sidekick/
|
6 |
-
Description: Adds a real-time WordPress training walkthroughs right in your Dashboard
|
7 |
-
Requires at least: 3.8
|
8 |
-
Tested up to: 4.0
|
9 |
-
Version: 1.6.19
|
10 |
-
Author: Sidekick.pro
|
11 |
-
Author URI: http://www.sidekick.pro
|
12 |
-
*/
|
13 |
-
|
14 |
-
define('SK_LIBRARY_VERSION',6);
|
15 |
-
define('DEFAULT_ACTIVATION_ID','xxxxxxxx-xxxx-xxxx-xxxx-xxxxfree');
|
16 |
-
define('SK_PATH','sidekick/latest/wordpress');
|
17 |
-
define('COMPOSER_PATH','cdn/composer');
|
18 |
-
if (!defined('SK_USE_CDN')) define('SK_USE_CDN',true);
|
19 |
-
|
20 |
-
if ( ! defined( 'SK_SL_PLUGIN_DIR' ) ) define( 'SK_SL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
21 |
-
if ( ! defined( 'SK_SL_PLUGIN_URL' ) ) define( 'SK_SL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
22 |
-
if ( ! defined( 'SK_SL_PLUGIN_FILE' ) ) define( 'SK_SL_PLUGIN_FILE', __FILE__ );
|
23 |
-
if ( ! function_exists('mlog')) {
|
24 |
-
function mlog(){}
|
25 |
-
}
|
26 |
-
|
27 |
-
class Sidekick{
|
28 |
-
|
29 |
-
function __construct(){
|
30 |
-
global $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE, $SK_GLOBAL_VERSION;
|
31 |
-
|
32 |
-
if ($this->is_https()) {
|
33 |
-
if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','https://api.sidekick.pro/');
|
34 |
-
if (!defined('SK_COMPOSER_API')) define('SK_COMPOSER_API','https://library.sidekick.pro/api');
|
35 |
-
if (defined('SK_USE_CDN') && SK_USE_CDN) {
|
36 |
-
if (!defined('SK_DOMAIN')) define('SK_DOMAIN','https://pullvod-flowpress.netdna-ssl.com/');
|
37 |
-
} else {
|
38 |
-
if (!defined('SK_DOMAIN')) define('SK_DOMAIN','https://library.sidekick.pro/');
|
39 |
-
}
|
40 |
-
} else {
|
41 |
-
if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','http://api.sidekick.pro/');
|
42 |
-
if (!defined('SK_COMPOSER_API')) define('SK_COMPOSER_API','http://library.sidekick.pro/api');
|
43 |
-
if (defined('SK_USE_CDN') && SK_USE_CDN) {
|
44 |
-
if (!defined('SK_DOMAIN')) define('SK_DOMAIN','http://pullvod.flowpress.netdna-cdn.com/');
|
45 |
-
} else {
|
46 |
-
if (!defined('SK_DOMAIN')) define('SK_DOMAIN','http://library.sidekick.pro/');
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
$SK_GLOBAL_VERSION = (strpos($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], '.sidekick')) ? intval($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],36) . '&d=' . date('m-d-y-G'): date('m-d-y-G');
|
51 |
-
$SK_FREE_LIBRARY_FILE = SK_DOMAIN . "library/v" . SK_LIBRARY_VERSION . "/releases/" . DEFAULT_ACTIVATION_ID . "/library.js";
|
52 |
-
|
53 |
-
if ($activation_id = get_option("sk_activation_id")) {
|
54 |
-
$SK_PAID_LIBRARY_FILE = SK_DOMAIN . "library/v" . SK_LIBRARY_VERSION . "/releases/{$activation_id}/library.js";
|
55 |
-
}
|
56 |
-
}
|
57 |
-
|
58 |
-
function enqueue_required(){
|
59 |
-
wp_enqueue_script('jquery' , null );
|
60 |
-
wp_enqueue_script('underscore' , null, array('underscore'));
|
61 |
-
wp_enqueue_script('backbone' , null, array('jquery','underscore'));
|
62 |
-
wp_enqueue_script('jquery-ui-core' , null, array('jquery') );
|
63 |
-
wp_enqueue_script('jquery-ui-position' , null, array('jquery-ui-core') );
|
64 |
-
wp_enqueue_script('jquery-ui-draggable' , null, array('jquery-ui-core') );
|
65 |
-
wp_enqueue_script('jquery-ui-droppable' , null, array('jquery-ui-core') );
|
66 |
-
wp_enqueue_script('jquery-effects-scale' , null, array('jquery-ui-core') );
|
67 |
-
wp_enqueue_script('jquery-effects-highlight' , null, array('jquery-ui-core') );
|
68 |
-
}
|
69 |
-
|
70 |
-
function is_https() {
|
71 |
-
if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443 || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) {
|
72 |
-
return true;
|
73 |
-
} else {
|
74 |
-
return false;
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
function enqueue(){
|
79 |
-
global $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE, $SK_GLOBAL_VERSION;
|
80 |
-
|
81 |
-
$activation_id = get_option("sk_activation_id");
|
82 |
-
|
83 |
-
if ($activation_id) {
|
84 |
-
wp_enqueue_script("sk_paid_library" , $SK_PAID_LIBRARY_FILE,null,$SK_GLOBAL_VERSION);
|
85 |
-
wp_enqueue_script("sk_free_library" , $SK_FREE_LIBRARY_FILE,array('sk_paid_library'),$SK_GLOBAL_VERSION);
|
86 |
-
} else {
|
87 |
-
wp_enqueue_script("sk_free_library" , $SK_FREE_LIBRARY_FILE,array(),$SK_GLOBAL_VERSION);
|
88 |
-
}
|
89 |
-
|
90 |
-
wp_enqueue_script('sidekick' ,SK_DOMAIN . "cdn/" . SK_PATH . "/sidekick.min.js", array('sk_free_library','backbone','jquery','underscore','jquery-effects-highlight'), $SK_GLOBAL_VERSION);
|
91 |
-
wp_enqueue_style('wp-pointer');
|
92 |
-
wp_enqueue_script('wp-pointer');
|
93 |
-
}
|
94 |
-
|
95 |
-
function setup_menu(){
|
96 |
-
add_submenu_page( 'options-general.php', 'Sidekick', 'Sidekick', 'activate_plugins','sidekick', array(&$this,'admin_page'));
|
97 |
-
}
|
98 |
-
|
99 |
-
function ajax_save(){
|
100 |
-
if (isset($_POST['sk_composer_button']) && $_POST['sk_composer_button'] == "true") {
|
101 |
-
update_option( 'sk_composer_button', true );
|
102 |
-
} elseif (isset($_POST['sk_composer_button']) && $_POST['sk_composer_button'] == "false") {
|
103 |
-
delete_option('sk_composer_button');
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
function admin_page(){
|
108 |
-
global $SK_PAID_LIBRARY_FILE, $SK_FREE_LIBRARY_FILE ;
|
109 |
-
|
110 |
-
if ( empty( $_POST ) || check_admin_referer( 'update_sk_settings' ) ) {
|
111 |
-
|
112 |
-
if (isset($_POST['option_page']) && $_POST['option_page'] == 'sk_license') {
|
113 |
-
|
114 |
-
if (isset($_POST['activation_id']) && $_POST['activation_id']){
|
115 |
-
$result = $this->activate(true);
|
116 |
-
} else {
|
117 |
-
delete_option('sk_activation_id');
|
118 |
-
}
|
119 |
-
|
120 |
-
if (isset($_POST['sk_composer_button'])) {
|
121 |
-
update_option( 'sk_composer_button', true );
|
122 |
-
} else {
|
123 |
-
delete_option('sk_composer_button');
|
124 |
-
}
|
125 |
-
|
126 |
-
if (isset($_POST['sk_track_data'])) {
|
127 |
-
update_option( 'sk_track_data', true );
|
128 |
-
} else {
|
129 |
-
delete_option('sk_track_data');
|
130 |
-
}
|
131 |
-
|
132 |
-
update_option( 'sk_activated', true );
|
133 |
-
die('<script>window.open("' . get_site_url() . '/wp-admin/options-general.php?page=sidekick","_self")</script>');
|
134 |
-
}
|
135 |
-
|
136 |
-
if (isset($_POST['sk_autostart_walkthrough_id'])){
|
137 |
-
update_option('sk_autostart_walkthrough_id',$_POST['sk_autostart_walkthrough_id']);
|
138 |
-
}
|
139 |
-
}
|
140 |
-
|
141 |
-
$activation_id = get_option( 'sk_activation_id' );
|
142 |
-
$sk_track_data = get_option( 'sk_track_data' );
|
143 |
-
$current_user = wp_get_current_user();
|
144 |
-
$status = 'Free';
|
145 |
-
$error = null;
|
146 |
-
|
147 |
-
if (isset($SK_PAID_LIBRARY_FILE) && $activation_id) {
|
148 |
-
$_POST['activation_id'] = $activation_id;
|
149 |
-
$check_activation = $this->activate(true);
|
150 |
-
$status = 'Checking...';
|
151 |
-
}
|
152 |
-
|
153 |
-
global $wp_version;
|
154 |
-
if (version_compare($wp_version, '3.7', '<=')) {
|
155 |
-
$error = "Sorry, Sidekick requires WordPress 3.7 or higher to function.";
|
156 |
-
}
|
157 |
-
|
158 |
-
if (!$activation_id) {
|
159 |
-
$warn = "You're using the <b>free</b> version of Sidekick, to gain full access to the walkthrough library please <a target='_blank' href='http://www.sidekick.pro/wordpress/modules/wordpress-core-module-premium/?utm_source=plugin&utm_medium=settings&utm_campaign=upgrade_nag'>upgrade</a> to the full module.";
|
160 |
-
}
|
161 |
-
|
162 |
-
if(preg_match('/(?i)msie [6-8]/',$_SERVER['HTTP_USER_AGENT'])){
|
163 |
-
$error = "Sorry, Sidekick requires Internet Explorer 9 or higher to function.";
|
164 |
-
}
|
165 |
-
|
166 |
-
?>
|
167 |
-
|
168 |
-
<?php if (get_option('sk_firstuse') == true): ?>
|
169 |
-
<?php delete_option('sk_firstuse') ?>
|
170 |
-
<script type="text/javascript">
|
171 |
-
jQuery(document).ready(function($) {
|
172 |
-
jQuery('#sidekick #logo').trigger('click');
|
173 |
-
});
|
174 |
-
</script>
|
175 |
-
<?php endif ?>
|
176 |
-
|
177 |
-
<div class="wrap">
|
178 |
-
<?php include('libs/admin_page.php') ?>
|
179 |
-
</div>
|
180 |
-
<?php
|
181 |
-
}
|
182 |
-
|
183 |
-
function set_disabled_wts(){
|
184 |
-
update_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
|
185 |
-
}
|
186 |
-
|
187 |
-
function footer(){
|
188 |
-
global $current_user, $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE, $SK_GLOBAL_VERSION;
|
189 |
-
|
190 |
-
require_once('libs/sk_config_data.php');
|
191 |
-
|
192 |
-
$plugin_data = get_plugin_data(plugin_dir_path( dirname( __FILE__ ) ) . 'sidekick/sidekick.php');
|
193 |
-
$sk_config_data = new sk_config_data;
|
194 |
-
$current_user = wp_get_current_user();
|
195 |
-
$sk_just_activated = get_option( 'sk_just_activated' );
|
196 |
-
$sk_track_data = get_option( 'sk_track_data' );
|
197 |
-
$sk_composer_button = get_option( 'sk_composer_button' );
|
198 |
-
$activation_id = (get_option( "sk_activation_id" ) ? get_option( "sk_activation_id" ) : DEFAULT_ACTIVATION_ID);
|
199 |
-
$autostart_walkthrough_id = (get_option('sk_autostart_walkthrough_id') ? get_option('sk_autostart_walkthrough_id') : 'null' );
|
200 |
-
$theme = wp_get_theme();
|
201 |
-
$not_supported_ie = false;
|
202 |
-
$user_email = '';
|
203 |
-
if ($sk_track_data) {
|
204 |
-
$user_email = $current_user->user_email;
|
205 |
-
}
|
206 |
-
|
207 |
-
$user_role = $sk_config_data->get_user_role();
|
208 |
-
$site_url = $sk_config_data->get_domain();
|
209 |
-
$plugin_data = $sk_config_data->get_plugins();
|
210 |
-
$disabled_wts = $sk_config_data->get_disabled_wts();
|
211 |
-
$current_url = $sk_config_data->get_current_url();
|
212 |
-
$post_types = $sk_config_data->get_post_types();
|
213 |
-
$taxonomies = $sk_config_data->get_taxonomies();
|
214 |
-
$user_data = $sk_config_data->get_user_data();
|
215 |
-
$comments = $sk_config_data->get_comments();
|
216 |
-
$post_statuses = $sk_config_data->get_post_statuses();
|
217 |
-
$post_types_and_statuses = $sk_config_data->get_post_types_and_statuses();
|
218 |
-
$number_of_themes = $sk_config_data->get_themes();
|
219 |
-
|
220 |
-
$installed_plugins = $plugin_data['plugins'];
|
221 |
-
$plugin_count = $plugin_data['count'];
|
222 |
-
|
223 |
-
// $sk_composer_button = true; // BETA
|
224 |
-
|
225 |
-
delete_option( 'sk_just_activated' );
|
226 |
-
if(preg_match('/(?i)msie [6-8]/',$_SERVER['HTTP_USER_AGENT'])) $not_supported_ie = true;
|
227 |
-
|
228 |
-
?>
|
229 |
-
|
230 |
-
<?php if (!$not_supported_ie): ?>
|
231 |
-
|
232 |
-
<script type="text/javascript">
|
233 |
-
|
234 |
-
var sk_config = {
|
235 |
-
// Compatibility
|
236 |
-
<?php echo $post_types ?>
|
237 |
-
<?php echo $taxonomies ?>
|
238 |
-
<?php echo $user_data ?>
|
239 |
-
<?php echo $comments ?>
|
240 |
-
<?php echo $post_statuses ?>
|
241 |
-
<?php echo $post_types_and_statuses ?>
|
242 |
-
plugin_count: <?php echo $plugin_count ?>,
|
243 |
-
disable_wts: <?php echo $disabled_wts ?>,
|
244 |
-
installed_plugins: <?php echo $installed_plugins ?>,
|
245 |
-
is_multisite: <?php echo (is_multisite()) ? "true" : "false" ?>,
|
246 |
-
number_of_themes: <?php echo $number_of_themes ?>,
|
247 |
-
installed_theme: '<?php echo $theme->Name ?>',
|
248 |
-
main_soft_name: 'WordPress',
|
249 |
-
main_soft_version: '<?php echo get_bloginfo("version") ?>',
|
250 |
-
theme_version: '<?php echo $theme->Version ?>',
|
251 |
-
user_level: '<?php echo $user_role ?>',
|
252 |
-
|
253 |
-
// User Settings
|
254 |
-
activation_id: '<?php echo $activation_id ?>',
|
255 |
-
auto_open_root_bucket_id: 79,
|
256 |
-
autostart_walkthrough_id: <?php echo $autostart_walkthrough_id ?>,
|
257 |
-
sk_composer_button: <?php echo ($sk_composer_button ? "true" : "false") ?>,
|
258 |
-
track_data: '<?php echo $sk_track_data ?>',
|
259 |
-
user_email: '<?php echo $user_email ?>',
|
260 |
-
|
261 |
-
// Toggles
|
262 |
-
path_not_found_continue: true,
|
263 |
-
show_powered_by: true,
|
264 |
-
show_powered_by_link: true,
|
265 |
-
sk_autostart_only_once: true,
|
266 |
-
use_native_controls: false,
|
267 |
-
|
268 |
-
// Platform Info
|
269 |
-
library_version: '<?php echo (defined("SK_LIBRARY_VERSION") ? SK_LIBRARY_VERSION : '') ?>',
|
270 |
-
|
271 |
-
// Generic Info
|
272 |
-
just_activated: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
|
273 |
-
platform_version: null,
|
274 |
-
plugin_version: '1.6.19',
|
275 |
-
show_login: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
|
276 |
-
|
277 |
-
// URLS
|
278 |
-
site_url: '<?php echo $site_url ?>',
|
279 |
-
domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
|
280 |
-
domain_used: '<?php echo SK_DOMAIN ?>',
|
281 |
-
plugin_url: '<?php echo admin_url("admin.php?page=sidekick") ?>',
|
282 |
-
base_url: '<?php echo site_url() ?>',
|
283 |
-
current_url: '<?php echo $current_url ?>',
|
284 |
-
tracking_api: '<?php echo SK_TRACKING_API ?>',
|
285 |
-
sk_path: '<?php echo SK_PATH ?>',
|
286 |
-
library_free_file: '<?php echo (isset($SK_FREE_LIBRARY_FILE) ? $SK_FREE_LIBRARY_FILE : '') ?>',
|
287 |
-
library_paid_file: '<?php echo (isset($SK_PAID_LIBRARY_FILE) ? $SK_PAID_LIBRARY_FILE : '') ?>',
|
288 |
-
rand_file_version: '<?php echo $SK_GLOBAL_VERSION ?>'
|
289 |
-
}
|
290 |
-
|
291 |
-
var skc_config = {
|
292 |
-
js: '<?php echo SK_DOMAIN . COMPOSER_PATH ?>/composer.source.js?<?php echo $SK_GLOBAL_VERSION ?>',
|
293 |
-
css: '<?php echo SK_DOMAIN . COMPOSER_PATH ?>/style.css?<?php echo $SK_GLOBAL_VERSION ?>',
|
294 |
-
apiUrl: '<?php echo SK_COMPOSER_API ?>',
|
295 |
-
baseSiteUrl: sk_config.base_url
|
296 |
-
}
|
297 |
-
|
298 |
-
</script>
|
299 |
-
<?php endif ?>
|
300 |
-
<?php
|
301 |
-
}
|
302 |
-
|
303 |
-
function track($data){
|
304 |
-
$response = wp_remote_post( SK_TRACKING_API . "v3/events/", array(
|
305 |
-
'method' => 'POST',
|
306 |
-
'timeout' => 45,
|
307 |
-
'redirection' => 5,
|
308 |
-
'httpversion' => '1.0',
|
309 |
-
'blocking' => true,
|
310 |
-
'headers' => array(),
|
311 |
-
'body' => $data,
|
312 |
-
'cookies' => array()
|
313 |
-
)
|
314 |
-
);
|
315 |
-
}
|
316 |
-
|
317 |
-
function activate($return = false){
|
318 |
-
if ($_POST['activation_id']) {
|
319 |
-
|
320 |
-
$library_file = SK_DOMAIN . "library/v" . SK_LIBRARY_VERSION . "/releases/{$_POST['activation_id']}/library.js";
|
321 |
-
$ch = curl_init($library_file);
|
322 |
-
curl_setopt($ch, CURLOPT_NOBODY, true);
|
323 |
-
curl_exec($ch);
|
324 |
-
$retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
325 |
-
curl_close($ch);
|
326 |
-
update_option('sk_activation_id',$_POST['activation_id']);
|
327 |
-
if ($retcode == 200) {
|
328 |
-
if ($return)
|
329 |
-
return 1;
|
330 |
-
die(json_encode(array('success' => 1)));
|
331 |
-
} else {
|
332 |
-
if ($return)
|
333 |
-
return $retcode;
|
334 |
-
die(json_encode(array('error' => $retcode)));
|
335 |
-
}
|
336 |
-
} else {
|
337 |
-
die(json_encode(array('error' => 'No Activation ID')));
|
338 |
-
}
|
339 |
-
}
|
340 |
-
|
341 |
-
function activate_plugin(){
|
342 |
-
update_option( 'sk_firstuse', true );
|
343 |
-
update_option( 'sk_do_activation_redirect', true );
|
344 |
-
$data = array(
|
345 |
-
'source' => 'plugin',
|
346 |
-
'action' => 'track',
|
347 |
-
'type' => 'activate'
|
348 |
-
);
|
349 |
-
$this->track($data);
|
350 |
-
}
|
351 |
-
|
352 |
-
function curl_get_data($url){
|
353 |
-
$ch = curl_init();
|
354 |
-
$timeout = 5;
|
355 |
-
curl_setopt($ch, CURLOPT_URL, $url);
|
356 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
357 |
-
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
|
358 |
-
$data = curl_exec($ch);
|
359 |
-
curl_close($ch);
|
360 |
-
return $data;
|
361 |
-
}
|
362 |
-
|
363 |
-
function redirect(){
|
364 |
-
if (get_option('sk_do_activation_redirect', false)) {
|
365 |
-
delete_option('sk_do_activation_redirect');
|
366 |
-
$siteurl = get_site_url();
|
367 |
-
wp_redirect($siteurl . "/wp-admin/options-general.php?page=sidekick");
|
368 |
-
die();
|
369 |
-
}
|
370 |
-
}
|
371 |
-
|
372 |
-
function admin_notice() {
|
373 |
-
global $current_user ;
|
374 |
-
|
375 |
-
if ( ! get_user_meta($current_user->ID, 'sk_ignore_notice') ) {
|
376 |
-
printf ('<div class="updated"><p>Need help with WordPress? Click HELP ME in the bottom left corner to get started! <a href="%1$s">Hide</a></p></div>','?sk_ignore_notice=1');
|
377 |
-
}
|
378 |
-
}
|
379 |
-
|
380 |
-
function admin_notice_ignore() {
|
381 |
-
global $current_user;
|
382 |
-
if ( isset($_GET['sk_ignore_notice'])) {
|
383 |
-
add_user_meta($current_user->ID, 'sk_ignore_notice', true);
|
384 |
-
}
|
385 |
-
}
|
386 |
-
|
387 |
-
function deactivate_plugin(){
|
388 |
-
$data = array(
|
389 |
-
'source' => 'plugin',
|
390 |
-
'action' => 'track',
|
391 |
-
'type' => 'deactivate',
|
392 |
-
'user' => get_option( "activation_id" )
|
393 |
-
);
|
394 |
-
$this->track($data);
|
395 |
-
?>
|
396 |
-
<script type="text/javascript">
|
397 |
-
window._gaq = window._gaq || [];
|
398 |
-
window._gaq.push(['sk._setAccount', 'UA-39283622-1']);
|
399 |
-
|
400 |
-
(function() {
|
401 |
-
var ga_wpu = document.createElement('script'); ga_sk.type = 'text/javascript'; ga_sk.async = true;
|
402 |
-
ga_sk.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
403 |
-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga_wpu, s);
|
404 |
-
})();
|
405 |
-
window._gaq.push(['sk._trackEvent', 'Plugin - Deactivate', '', <?php echo plugin_version ?>, 0,true]);
|
406 |
-
</script>
|
407 |
-
<?php
|
408 |
-
delete_option( 'sk_activated' );
|
409 |
-
}
|
410 |
-
}
|
411 |
-
|
412 |
-
$sidekick = new Sidekick;
|
413 |
-
register_activation_hook( __FILE__, array($sidekick,'activate_plugin') );
|
414 |
-
register_deactivation_hook( __FILE__, array($sidekick,'deactivate_plugin') );
|
415 |
-
|
416 |
-
add_action('admin_menu', array($sidekick,'setup_menu'));
|
417 |
-
add_action('admin_init', array($sidekick,'redirect'));
|
418 |
-
add_action('wp_ajax_sk_activate', array($sidekick,'activate'));
|
419 |
-
add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
|
420 |
-
add_action('admin_notices', array($sidekick,'admin_notice'));
|
421 |
-
add_action('admin_init', array($sidekick,'admin_notice_ignore'));
|
422 |
-
|
423 |
-
if (isset($_POST['disable_wts'])) {
|
424 |
-
$sidekick->set_disabled_wts();
|
425 |
-
}
|
426 |
-
|
427 |
-
if (!defined('SK_PLUGIN_DEGBUG'))
|
428 |
-
require_once('sk_init.php');
|
429 |
-
|
430 |
-
if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information') && !defined('IFRAME_REQUEST')) {
|
431 |
-
add_action('admin_footer', array($sidekick,'footer'));
|
432 |
-
add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
|
433 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|