PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 1.7.3
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v1.7.3
4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / freemius / templates / debug.php
embedpress / freemius / templates Last commit date
debug 9 years ago forms 9 years ago plugin-info 9 years ago account.php 9 years ago add-ons.php 9 years ago add-trial-to-pricing.php 9 years ago admin-notice.php 9 years ago all-admin-notice.php 9 years ago billing.php 9 years ago checkout-legacy.php 9 years ago checkout.php 9 years ago connect.php 9 years ago contact.php 9 years ago debug.php 9 years ago email.php 9 years ago firewall-issues-js.php 9 years ago index.php 9 years ago plugin-icon.php 9 years ago powered-by.php 9 years ago pricing.php 9 years ago sticky-admin-notice-js.php 9 years ago
debug.php
544 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6 * @since 1.1.1
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 global $fs_active_plugins;
14
15 $fs_options = FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
16 ?>
17 <h1><?php echo __fs( 'Freemius Debug' ) . ' - ' . __fs( 'SDK' ) . ' v.' . $fs_active_plugins->newest->version ?></h1>
18 <div>
19 <!-- Debugging Switch -->
20 <?php //$debug_mode = get_option( 'fs_debug_mode', null ) ?>
21 <span class="switch-label"><?php _efs( 'debugging' ) ?></span>
22
23 <div class="switch <?php echo WP_FS__DEBUG_SDK ? 'off' : 'on' ?>">
24 <div class="toggle"></div>
25 <span class="on"><?php _efs( 'on' ) ?></span>
26 <span class="off"><?php _efs( 'off' ) ?></span>
27 </div>
28 <script type="text/javascript">
29 (function ($) {
30 $(document).ready(function () {
31 // Switch toggle
32 $('.switch').click(function () {
33 $(this)
34 .toggleClass('on')
35 .toggleClass('off');
36
37 $.post(ajaxurl, {
38 action: 'fs_toggle_debug_mode',
39 is_on : ($(this).hasClass('off') ? 1 : 0)
40 }, function (response) {
41 if (1 == response) {
42 // Refresh page on success.
43 location.reload();
44 }
45 });
46 });
47 });
48 }(jQuery));
49 </script>
50 </div>
51 <h2><?php _efs( 'actions' ) ?></h2>
52 <table>
53 <tbody>
54 <tr>
55 <td>
56 <!-- Delete All Accounts -->
57 <form action="" method="POST">
58 <input type="hidden" name="fs_action" value="restart_freemius">
59 <?php wp_nonce_field( 'restart_freemius' ) ?>
60 <button class="button button-primary"
61 onclick="if (confirm('<?php _efs( 'delete-all-confirm' ) ?>')) this.parentNode.submit(); return false;"><?php _efs( 'delete-all-accounts' ) ?></button>
62 </form>
63 </td>
64 <td>
65 <!-- Clear API Cache -->
66 <form action="" method="POST">
67 <input type="hidden" name="fs_clear_api_cache" value="true">
68 <button class="button button-primary"><?php _efs( 'clear-api-cache' ) ?></button>
69 </form>
70 </td>
71 <td>
72 <!-- Sync Data with Server -->
73 <form action="" method="POST">
74 <input type="hidden" name="background_sync" value="true">
75 <button class="button button-primary"><?php _efs( 'sync-data-from-server' ) ?></button>
76 </form>
77 </td>
78 </tr>
79 </tbody>
80 </table>
81 <?php
82 if ( ! defined( 'FS_API__ADDRESS' ) ) {
83 define( 'FS_API__ADDRESS', '://api.freemius.com' );
84 }
85 if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
86 define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
87 }
88
89 $defines = array(
90 array(
91 'key' => 'WP_FS__REMOTE_ADDR',
92 'val' => WP_FS__REMOTE_ADDR,
93 ),
94 array(
95 'key' => 'WP_FS__ADDRESS_PRODUCTION',
96 'val' => WP_FS__ADDRESS_PRODUCTION,
97 ),
98 array(
99 'key' => 'FS_API__ADDRESS',
100 'val' => FS_API__ADDRESS,
101 ),
102 array(
103 'key' => 'FS_API__SANDBOX_ADDRESS',
104 'val' => FS_API__SANDBOX_ADDRESS,
105 ),
106 array(
107 'key' => 'WP_FS__DIR',
108 'val' => WP_FS__DIR,
109 ),
110 )
111 ?>
112 <br>
113 <table class="widefat">
114 <thead>
115 <tr>
116 <th><?php _efs( 'key' ) ?></th>
117 <th><?php _efs( 'value' ) ?></th>
118 </tr>
119 </thead>
120 <tbody>
121 <?php $alternate = false;
122 foreach ( $defines as $p ) : ?>
123 <tr<?php if ( $alternate ) {
124 echo ' class="alternate"';
125 } ?>>
126 <td><?php echo $p['key'] ?></td>
127 <td><?php echo $p['val'] ?></td>
128 </tr>
129 <?php $alternate = ! $alternate ?>
130 <?php endforeach ?>
131 </tbody>
132 </table>
133 <h2><?php _efs( 'sdk-versions' ) ?></h2>
134 <table id="fs_sdks" class="widefat">
135 <thead>
136 <tr>
137 <th><?php _efs( 'version' ) ?></th>
138 <th><?php _efs( 'sdk-path' ) ?></th>
139 <th><?php _efs( 'plugin-path' ) ?></th>
140 <th><?php _efs( 'is-active' ) ?></th>
141 </tr>
142 </thead>
143 <tbody>
144 <?php foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) : ?>
145 <?php $is_active = ( WP_FS__SDK_VERSION == $data->version ) ?>
146 <tr<?php if ( $is_active ) {
147 echo ' style="background: #E6FFE6; font-weight: bold"';
148 } ?>>
149 <td><?php echo $data->version ?></td>
150 <td><?php echo $sdk_path ?></td>
151 <td><?php echo $data->plugin_path ?></td>
152 <td><?php echo ( $is_active ) ? 'Active' : 'Inactive' ?></td>
153 </tr>
154 <?php endforeach ?>
155 </tbody>
156 </table>
157 <?php $plugins = $fs_options->get_option( 'plugins' ) ?>
158 <?php if ( is_array( $plugins ) && 0 < count( $plugins ) ) : ?>
159 <h2><?php _efs( 'plugins' ) ?></h2>
160 <table id="fs_plugins" class="widefat">
161 <thead>
162 <tr>
163 <th><?php _efs( 'id' ) ?></th>
164 <th><?php _efs( 'slug' ) ?></th>
165 <th><?php _efs( 'version' ) ?></th>
166 <th><?php _efs( 'title' ) ?></th>
167 <th><?php _efs( 'api' ) ?></th>
168 <th><?php _efs( 'freemius-state' ) ?></th>
169 <th><?php _efs( 'plugin-path' ) ?></th>
170 <th><?php _efs( 'public-key' ) ?></th>
171 <th><?php _efs( 'actions' ) ?></th>
172 </tr>
173 </thead>
174 <tbody>
175 <?php foreach ( $plugins as $slug => $data ) : ?>
176 <?php $is_active = is_plugin_active( $data->file ) ?>
177 <?php $fs = $is_active ? freemius( $slug ) : null ?>
178 <tr<?php if ( $is_active ) {
179 if ( $fs->has_api_connectivity() && $fs->is_on() ) {
180 echo ' style="background: #E6FFE6; font-weight: bold"';
181 } else {
182 echo ' style="background: #ffd0d0; font-weight: bold"';
183 }
184 } ?>>
185 <td><?php echo $data->id ?></td>
186 <td><?php echo $slug ?></td>
187 <td><?php echo $data->version ?></td>
188 <td><?php echo $data->title ?></td>
189 <td<?php if ( $is_active && ! $fs->has_api_connectivity() ) {
190 echo ' style="color: red; text-transform: uppercase;"';
191 } ?>><?php if ( $is_active ) {
192 echo $fs->has_api_connectivity() ?
193 __fs( 'connected' ) :
194 __fs( 'blocked' );
195 } ?></td>
196 <td<?php if ( $is_active && ! $fs->is_on() ) {
197 echo ' style="color: red; text-transform: uppercase;"';
198 } ?>><?php if ( $is_active ) {
199 echo $fs->is_on() ?
200 __fs( 'on' ) :
201 __fs( 'off' );
202 } ?></td>
203 <td><?php echo $data->file ?></td>
204 <td><?php echo $data->public_key ?></td>
205 <td>
206 <?php if ( $is_active && $fs->has_trial_plan() ) : ?>
207 <form action="" method="POST">
208 <input type="hidden" name="fs_action" value="simulate_trial">
209 <input type="hidden" name="slug" value="<?php echo $slug ?>">
210 <?php wp_nonce_field( 'simulate_trial' ) ?>
211
212 <button type="submit"
213 class="button button-primary simulate-trial"><?php _efs( 'Simulate Trial' ) ?></button>
214 </form>
215 <?php endif ?>
216 </td>
217 </tr>
218 <?php endforeach ?>
219 </tbody>
220 </table>
221 <?php endif ?>
222 <?php
223 /**
224 * @var array $VARS
225 * @var FS_Site[] $sites
226 */
227 $sites = $VARS['sites'];
228 ?>
229 <?php if ( is_array( $sites ) && 0 < count( $sites ) ) : ?>
230 <h2><?php _efs( 'plugin-installs' ) ?> / <?php _efs( 'sites' ) ?></h2>
231 <table id="fs_installs" class="widefat">
232 <thead>
233 <tr>
234 <th><?php _efs( 'id' ) ?></th>
235 <th><?php _efs( 'slug' ) ?></th>
236 <th><?php _efs( 'plan' ) ?></th>
237 <th><?php _efs( 'public-key' ) ?></th>
238 <th><?php _efs( 'secret-key' ) ?></th>
239 </tr>
240 </thead>
241 <tbody>
242 <?php foreach ( $sites as $slug => $site ) : ?>
243 <tr>
244 <td><?php echo $site->id ?></td>
245 <td><?php echo $slug ?></td>
246 <td><?php
247 echo is_object( $site->plan ) ?
248 base64_decode( $site->plan->name ) :
249 ''
250 ?></td>
251 <td><?php echo $site->public_key ?></td>
252 <td><?php echo $site->secret_key ?></td>
253 </tr>
254 <?php endforeach ?>
255 </tbody>
256 </table>
257 <?php endif ?>
258 <?php
259 $addons = $VARS['addons'];
260 ?>
261 <?php foreach ( $addons as $plugin_id => $plugin_addons ) : ?>
262 <h2><?php printf( __fs( 'addons-of-x' ), $plugin_id ) ?></h2>
263 <table id="fs_addons" class="widefat">
264 <thead>
265 <tr>
266 <th><?php _efs( 'id' ) ?></th>
267 <th><?php _efs( 'title' ) ?></th>
268 <th><?php _efs( 'slug' ) ?></th>
269 <th><?php _efs( 'version' ) ?></th>
270 <th><?php _efs( 'public-key' ) ?></th>
271 <th><?php _efs( 'secret-key' ) ?></th>
272 </tr>
273 </thead>
274 <tbody>
275 <?php
276 /**
277 * @var FS_Plugin[] $plugin_addons
278 */
279 foreach ( $plugin_addons as $addon ) : ?>
280 <tr>
281 <td><?php echo $addon->id ?></td>
282 <td><?php echo $addon->title ?></td>
283 <td><?php echo $addon->slug ?></td>
284 <td><?php echo $addon->version ?></td>
285 <td><?php echo $addon->public_key ?></td>
286 <td><?php echo $addon->secret_key ?></td>
287 </tr>
288 <?php endforeach ?>
289 </tbody>
290 </table>
291 <?php endforeach ?>
292 <?php
293 /**
294 * @var FS_User[] $users
295 */
296 $users = $VARS['users'];
297 ?>
298 <?php if ( is_array( $users ) && 0 < count( $users ) ) : ?>
299 <h2><?php _efs( 'users' ) ?></h2>
300 <table id="fs_users" class="widefat">
301 <thead>
302 <tr>
303 <th><?php _efs( 'id' ) ?></th>
304 <th><?php _efs( 'name' ) ?></th>
305 <th><?php _efs( 'email' ) ?></th>
306 <th><?php _efs( 'verified' ) ?></th>
307 <th><?php _efs( 'public-key' ) ?></th>
308 <th><?php _efs( 'secret-key' ) ?></th>
309 </tr>
310 </thead>
311 <tbody>
312 <?php foreach ( $users as $user_id => $user ) : ?>
313 <tr>
314 <td><?php echo $user->id ?></td>
315 <td><?php echo $user->get_name() ?></td>
316 <td><a href="mailto:<?php echo esc_attr( $user->email ) ?>"><?php echo $user->email ?></a></td>
317 <td><?php echo json_encode( $user->is_verified ) ?></td>
318 <td><?php echo $user->public_key ?></td>
319 <td><?php echo $user->secret_key ?></td>
320 </tr>
321 <?php endforeach ?>
322 </tbody>
323 </table>
324 <?php endif ?>
325
326 <?php
327 /**
328 * @var FS_Plugin_License[] $licenses
329 */
330 $licenses = $VARS['licenses'];
331 ?>
332 <?php if ( is_array( $licenses ) && 0 < count( $licenses ) ) : ?>
333 <h2><?php _efs( 'licenses' ) ?></h2>
334 <table id="fs_users" class="widefat">
335 <thead>
336 <tr>
337 <th><?php _efs( 'id' ) ?></th>
338 <th><?php _efs( 'plugin-id' ) ?></th>
339 <th><?php _efs( 'user-id' ) ?></th>
340 <th><?php _efs( 'plan-id' ) ?></th>
341 <th><?php _efs( 'quota' ) ?></th>
342 <th><?php _efs( 'activated' ) ?></th>
343 <th><?php _efs( 'blocking' ) ?></th>
344 <th><?php _efs( 'license-key' ) ?></th>
345 <th><?php _efs( 'expiration' ) ?></th>
346 </tr>
347 </thead>
348 <tbody>
349 <?php foreach ( $licenses as $slug => $module_licenses ) : ?>
350 <?php foreach ( $module_licenses as $id => $licenses ) : ?>
351 <?php if ( is_array( $licenses ) && 0 < count( $licenses ) ) : ?>
352 <?php foreach ( $licenses as $license ) : ?>
353 <tr>
354 <td><?php echo $license->id ?></td>
355 <td><?php echo $license->plugin_id ?></td>
356 <td><?php echo $license->user_id ?></td>
357 <td><?php echo $license->plan_id ?></td>
358 <td><?php echo $license->is_unlimited() ? 'Unlimited' : ( $license->is_single_site() ? 'Single Site' : $license->quota ) ?></td>
359 <td><?php echo $license->activated ?></td>
360 <td><?php echo $license->is_block_features ? 'Blocking' : 'Flexible' ?></td>
361 <td><?php echo htmlentities( $license->secret_key ) ?></td>
362 <td><?php echo $license->expiration ?></td>
363 </tr>
364 <?php endforeach ?>
365 <?php endif ?>
366 <?php endforeach ?>
367 <?php endforeach ?>
368 </tbody>
369 </table>
370 <?php endif ?>
371
372 <?php if ( FS_Logger::is_storage_logging_on() ) : ?>
373
374 <h2><?php _efs( 'debug-log' ) ?></h2>
375
376 <div id="fs_debug_filters">
377 <select name="type">
378 <option value="" selected="selected"><?php _efs( 'all-types' ) ?></option>
379 <option value="warn_error">Warnings & Errors</option>
380 <option value="error">Errors</option>
381 <option value="warn">Warnings</option>
382 <option value="info">Info</option>
383 </select>
384 <select name="request_type">
385 <option value="" selected="selected"><?php _efs( 'all-requests' ) ?></option>
386 <option value="call">Sync</option>
387 <option value="ajax">AJAX</option>
388 <option value="cron">WP Cron</option>
389 </select>
390 <input name="file" type="text" placeholder="<?php _efs( 'file' ) ?>"/>
391 <input name="function" type="text" placeholder="<?php _efs( 'function' ) ?>"/>
392 <input name="process_id" type="text" placeholder="<?php _efs( 'process-id' ) ?>"/>
393 <input name="logger" type="text" placeholder="<?php _efs( 'logger' ) ?>"/>
394 <input name="message" type="text" placeholder="<?php _efs( 'message' ) ?>"/>
395 <div style="margin: 10px 0">
396 <button id="fs_filter" class="button" style="float: left"><i class="dashicons dashicons-filter"></i> <?php _efs( 'filter' ) ?>
397 </button>
398
399 <form action="" method="POST" style="float: left; margin-left: 10px;">
400 <input type="hidden" name="fs_action" value="download_logs">
401 <?php wp_nonce_field( 'download_logs' ) ?>
402 <div class="fs-filters"></div>
403 <button id="fs_download" class="button" type="submit"><i
404 class="dashicons dashicons-download"></i> <?php _efs( 'download' ) ?></button>
405 </form>
406 <div style="clear: both"></div>
407 </div>
408 </div>
409
410 <div id="fs_log_book" style="height: 300px; overflow: auto;">
411 <table class="widefat">
412 <thead>
413 <tr>
414 <th>#</th>
415 <th><?php _efs( 'type' ) ?></th>
416 <th><?php _efs( 'id' ) ?></th>
417 <th><?php _efs( 'function' ) ?></th>
418 <th><?php _efs( 'message' ) ?></th>
419 <th><?php _efs( 'file' ) ?></th>
420 <th><?php _efs( 'timestamp' ) ?></th>
421 </tr>
422 </thead>
423 <tbody>
424 <tr style="display: none">
425 <td>{$log.log_order}.</td>
426 <td class="fs-col--type">{$log.type}</td>
427 <td class="fs-col--logger">{$log.logger}</td>
428 <td class="fs-col--function">{$log.function}</td>
429 <td class="fs-col--message">
430 <a href="#" onclick="jQuery(this).parent().find('div').toggle(); return false;">
431 <nobr>{$log.message_short}</nobr>
432 </a>
433 <div style="display: none;">{$log.message}</div>
434 </td>
435 <td class="fs-col--file">{$log.file}:{$log.line}</td>
436 <td class="fs-col--timestamp">{$log.created}</td>
437 </tr>
438
439 </tbody>
440 </table>
441 </div>
442 <script type="text/javascript">
443 jQuery(document).ready(function ($) {
444 var filtersChanged = false,
445 offset = 0,
446 limit = 200,
447 prevFiltersSignature = null;
448
449 var getFilters = function () {
450 var filters = {},
451 signature = '';
452
453 $('#fs_debug_filters').find('select, input').each(function (i, e) {
454 var $element = $(e);
455
456 if ('hidden' === $element.attr('type'))
457 return;
458
459 var val = $element.val();
460 if ('' !== val.trim()) {
461 var name = $(e).attr('name');
462 filters[name] = val;
463 signature += name + '=' + val + '~';
464 }
465 });
466
467 if (signature != prevFiltersSignature) {
468 filtersChanged = true;
469 prevFiltersSignature = signature;
470 } else {
471 filtersChanged = false;
472 }
473
474 return filters;
475 };
476
477 $('#fs_download').parent().submit(function () {
478 var filters = getFilters(),
479 hiddenFields = '';
480
481 for (var f in filters) {
482 if (filters.hasOwnProperty(f)) {
483 hiddenFields += '<input type="hidden" name="filters[' + f + ']" value="' + filters[f] + '" />';
484 }
485 }
486
487 $(this).find('.fs-filters').html(hiddenFields);
488 });
489
490 var loadLogs = function () {
491 var $tbody = $('#fs_log_book tbody'),
492 template = $tbody.find('tr:first-child').html(),
493 filters = getFilters();
494
495 if (!filtersChanged) {
496 offset += limit;
497 } else {
498 // Cleanup table for new filter (only keep template row).
499 $tbody.find('tr').each(function(i, e){
500 if (0 == i)
501 return;
502
503 $(e).remove();
504 });
505
506 offset = 0;
507 }
508
509 $.post(ajaxurl, {
510 action : 'fs_get_debug_log',
511 filters: filters,
512 offset: offset,
513 limit: limit
514 }, function (response) {
515
516 for (var i = 0; i < response.data.length; i++) {
517 var templateCopy = template;
518
519 response.data[i].message_short = (response.data[i].message.length > 32) ?
520 response.data[i].message.substr(0, 32) + '...' :
521 response.data[i].message;
522
523 for (var p in response.data[i]) {
524 if (response.data[i].hasOwnProperty(p)) {
525 templateCopy = templateCopy.replace('{$log.' + p + '}', response.data[i][p]);
526 }
527 }
528
529 $tbody.append('<tr' + (i % 2 ? ' class="alternate"' : '') + '>' + templateCopy + '</tr>');
530 }
531 });
532 };
533
534 $('#fs_filter').click(function () {
535 loadLogs();
536
537 return false;
538 });
539
540 loadLogs();
541 });
542 </script>
543 <?php endif ?>
544