PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
← All changes | freemius/templates/debug.php +233 -39 3.13.5.9 View file →
@@ -15,18 +15,29 @@
15 15 $fs_options = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
16 16
17 17 $off_text = fs_text_x_inline( 'Off', 'as turned off' );
18 18 $on_text = fs_text_x_inline( 'On', 'as turned on' );
19 +
20 + // For some reason css was missing
21 + fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
22 +
23 + $has_any_active_clone = false;
24 +
25 + $is_multisite = is_multisite();
26 +
27 + $auto_off_timestamp = wp_next_scheduled( 'fs_debug_turn_off_logging_hook' ) * 1000;
19 28 ?>
20 29 <h1><?php echo fs_text_inline( 'Freemius Debug' ) . ' - ' . fs_text_inline( 'SDK' ) . ' v.' . $fs_active_plugins->newest->version ?></h1>
21 30 <div>
22 31 <!-- Debugging Switch -->
23 - <?php //$debug_mode = get_option( 'fs_debug_mode', null ) ?>
24 32 <span class="fs-switch-label"><?php fs_esc_html_echo_x_inline( 'Debugging', 'as code debugging' ) ?></span>
25 33
26 34 <div class="fs-switch fs-round <?php echo WP_FS__DEBUG_SDK ? 'fs-on' : 'fs-off' ?>">
27 35 <div class="fs-toggle"></div>
28 36 </div>
37 +
38 + <span class="auto-off-debug-countdown hidden"><?php echo fs_esc_html_echo_x_inline( 'Auto off in:', 'timer for auto-disabling debug' ); ?> <span class="time">23:59:59</span>
39 +
29 40 <script type="text/javascript">
30 41 (function ($) {
31 42 $(document).ready(function () {
32 43 // Switch toggle
@@ -34,14 +45,22 @@
34 45 $( this )
35 46 .toggleClass( 'fs-on' )
36 47 .toggleClass( 'fs-off' );
37 48
38 - $.post( ajaxurl, {
49 + var is_on = ($(this).hasClass( 'fs-on' ) ? 1 : 0);
50 +
51 + $.post( <?php echo Freemius::ajax_url() ?>, {
39 52 action: 'fs_toggle_debug_mode',
40 53 // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
41 54 _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_toggle_debug_mode' ) ); ?>,
42 - is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
43 - }, function ( response ) {
55 + is_on
56 + }, function (response) {
57 + if (is_on) {
58 + startCountdownManually();
59 + } else {
60 + stopCountdownManually();
61 + }
62 +
44 63 if ( 1 == response ) {
45 64 // Refresh page on success.
46 65 location.reload();
47 66 }
@@ -46,8 +65,52 @@
46 65 location.reload();
47 66 }
48 67 });
49 68 });
69 +
70 + // Countdown
71 + var countdownElement = document.querySelector('.auto-off-debug-countdown');
72 + var timeElement = countdownElement.querySelector('.time');
73 + var targetTime = <?php echo wp_json_encode( $auto_off_timestamp ); ?>;
74 + var countdownTimeout;
75 +
76 + function updateCountdown() {
77 + var currentTime = new Date().getTime();
78 + var remainingTimeInMs = targetTime - currentTime;
79 + var hours = Math.floor((remainingTimeInMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
80 + var minutes = Math.floor((remainingTimeInMs % (1000 * 60 * 60)) / (1000 * 60));
81 + var seconds = Math.floor((remainingTimeInMs % (1000 * 60)) / 1000);
82 +
83 +
84 + if (remainingTimeInMs < 1000) {
85 + countdownElement.classList.add('hidden');
86 + countdownTimeout = null;
87 + } else {
88 + timeElement.innerHTML = hours + ":"
89 + + minutes.toString().padStart(2, '0') + ":"
90 + + seconds.toString().padStart(2, '0');
91 + countdownElement.classList.remove('hidden');
92 +
93 + if (countdownTimeout) {
94 + clearTimeout(countdownTimeout);
95 + }
96 + countdownTimeout = setTimeout(updateCountdown, 1000);
97 + }
98 + }
99 +
100 + function startCountdownManually() {
101 + targetTime = ( new Date().getTime() ) + (24 * 60 * 60 * 1000) - 1;
102 + updateCountdown();
103 + }
104 +
105 + function stopCountdownManually() {
106 + targetTime = new Date().getTime();
107 + updateCountdown();
108 + }
109 +
110 + updateCountdown();
111 + // End countdown
112 +
50 113 });
51 114 }(jQuery));
52 115 </script>
53 116 </div>
@@ -78,9 +141,19 @@
78 141 <?php wp_nonce_field( 'clear_updates_data' ) ?>
79 142 <button class="button"><?php fs_esc_html_echo_inline( 'Clear Updates Transients' ) ?></button>
80 143 </form>
81 144 </td>
145 + <?php if ( Freemius::is_deactivation_snoozed() ) : ?>
82 146 <td>
147 + <!-- Reset Deactivation Snoozing -->
148 + <form action="" method="POST">
149 + <input type="hidden" name="fs_action" value="reset_deactivation_snoozing">
150 + <?php wp_nonce_field( 'reset_deactivation_snoozing' ) ?>
151 + <button class="button"><?php fs_esc_html_echo_inline( 'Reset Deactivation Snoozing' ) ?> (Expires in <?php echo ( Freemius::deactivation_snooze_expires_at() - time() ) ?> sec)</button>
152 + </form>
153 + </td>
154 + <?php endif ?>
155 + <td>
83 156 <!-- Sync Data with Server -->
84 157 <form action="" method="POST">
85 158 <input type="hidden" name="background_sync" value="true">
86 159 <button class="button button-primary"><?php fs_esc_html_echo_inline( 'Sync Data From Server' ) ?></button>
@@ -101,8 +174,17 @@
101 174 </td>
102 175 <td>
103 176 <button id="fs_set_db_option" class="button"><?php fs_esc_html_echo_inline( 'Set DB Option' ) ?></button>
104 177 </td>
178 + <td>
179 + <?php
180 + $fs_debug_page_url = 'admin.php?page=freemius&fs_action=allow_clone_resolution_notice';
181 + $fs_debug_page_url = fs_is_network_admin() ?
182 + network_admin_url( $fs_debug_page_url ) :
183 + admin_url( $fs_debug_page_url );
184 + ?>
185 + <a href="<?php echo wp_nonce_url( $fs_debug_page_url, 'fs_allow_clone_resolution_notice' ) ?>" class="button button-primary">Resolve Clone(s)</a>
186 + </td>
105 187 </tr>
106 188 </tbody>
107 189 </table>
108 190 <script type="text/javascript">
@@ -110,9 +192,9 @@
110 192 $('#fs_load_db_option').click(function () {
111 193 var optionName = prompt('Please enter the option name:');
112 194
113 195 if (optionName) {
114 - $.post(ajaxurl, {
196 + $.post(<?php echo Freemius::ajax_url() ?>, {
115 197 action : 'fs_get_db_option',
116 198 // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
117 199 _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_db_option' ) ); ?>,
118 200 option_name: optionName
@@ -131,9 +213,9 @@
131 213 if (optionName) {
132 214 var optionValue = prompt('Please enter the option value:');
133 215
134 216 if (optionValue) {
135 - $.post(ajaxurl, {
217 + $.post(<?php echo Freemius::ajax_url() ?>, {
136 218 action : 'fs_set_db_option',
137 219 // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
138 220 _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_set_db_option' ) ); ?>,
139 221 option_name : optionName,
@@ -174,8 +256,20 @@
174 256 array(
175 257 'key' => 'WP_FS__DIR',
176 258 'val' => WP_FS__DIR,
177 259 ),
260 + array(
261 + 'key' => 'DISABLE_WP_CRON',
262 + 'val' => defined( 'DISABLE_WP_CRON' ) ? ( DISABLE_WP_CRON ? 'true' : 'false' ) : 'Not defined',
263 + ),
264 + array(
265 + 'key' => 'wp_using_ext_object_cache()',
266 + 'val' => wp_using_ext_object_cache() ? 'true' : 'false',
267 + ),
268 + array(
269 + 'key' => 'Freemius::get_unfiltered_site_url()',
270 + 'val' => Freemius::get_unfiltered_site_url(),
271 + ),
178 272 )
179 273 ?>
180 274 <br>
181 275 <table class="widefat">
@@ -191,16 +285,25 @@
191 285 <tr<?php if ( $alternate ) {
192 286 echo ' class="alternate"';
193 287 } ?>>
194 288 <td><?php echo $p['key'] ?></td>
195 - <td><?php echo $p['val'] ?></td>
289 + <td><?php echo $p['val'] ?><?php
290 + if ( 'DISABLE_WP_CRON' === $p['key'] && 'true' === $p['val'] ) {
291 + echo '<p><small><strong>Freemius SDK’s sync cron jobs will not run unless an alternative server-side cron is set up.</strong></small></p>';
292 + }
293 + ?></td>
196 294 </tr>
197 295 <?php $alternate = ! $alternate ?>
198 296 <?php endforeach ?>
199 297 </tbody>
200 298 </table>
201 -<h2><?php fs_esc_html_echo_x_inline( 'SDK Versions', 'as software development kit versions', 'sdk-versions' ) ?></h2>
202 -<table id="fs_sdks" class="widefat">
299 +<h2>
300 + <button class="fs-debug-table-toggle-button" aria-expanded="true">
301 + <span class="fs-debug-table-toggle-icon">▼</span>
302 + </button>
303 + <?php fs_esc_html_echo_x_inline( 'SDK Versions', 'as software development kit versions', 'sdk-versions' ) ?>
304 +</h2>
305 +<table id="fs_sdks" class="widefat fs-debug-table">
203 306 <thead>
204 307 <tr>
205 308 <th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
206 309 <th><?php fs_esc_html_echo_inline( 'SDK Path' ) ?></th>
@@ -228,14 +331,19 @@
228 331 WP_FS__MODULE_TYPE_PLUGIN,
229 332 WP_FS__MODULE_TYPE_THEME
230 333 );
231 334 ?>
232 -
335 +<?php $active_modules_by_id = array() ?>
233 336 <?php foreach ( $module_types as $module_type ) : ?>
234 337 <?php $modules = fs_get_entities( $fs_options->get_option( $module_type . 's' ), FS_Plugin::get_class_name() ) ?>
235 338 <?php if ( is_array( $modules ) && count( $modules ) > 0 ) : ?>
236 - <h2><?php echo esc_html( ( WP_FS__MODULE_TYPE_PLUGIN == $module_type ) ? fs_text_inline( 'Plugins', 'plugins' ) : fs_text_inline( 'Themes', 'themes' ) ) ?></h2>
237 - <table id="fs_<?php echo $module_type ?>" class="widefat">
339 + <h2>
340 + <button class="fs-debug-table-toggle-button" aria-expanded="true">
341 + <span class="fs-debug-table-toggle-icon">▼</span>
342 + </button>
343 + <?php echo esc_html( ( WP_FS__MODULE_TYPE_PLUGIN == $module_type ) ? fs_text_inline( 'Plugins', 'plugins' ) : fs_text_inline( 'Themes', 'themes' ) ) ?>
344 + </h2>
345 + <table id="fs_<?php echo $module_type ?>" class="widefat fs-debug-table">
238 346 <thead>
239 347 <tr>
240 348 <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
241 349 <th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
@@ -244,9 +352,9 @@
244 352 <th><?php fs_esc_html_echo_x_inline( 'API', 'as application program interface' ) ?></th>
245 353 <th><?php fs_esc_html_echo_inline( 'Freemius State' ) ?></th>
246 354 <th><?php fs_esc_html_echo_inline( 'Module Path' ) ?></th>
247 355 <th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
248 - <?php if ( is_multisite() ) : ?>
356 + <?php if ( $is_multisite ) : ?>
249 357 <th><?php fs_esc_html_echo_inline( 'Network Blog' ) ?></th>
250 358 <th><?php fs_esc_html_echo_inline( 'Network User' ) ?></th>
251 359 <?php endif ?>
252 360 <th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
@@ -252,8 +360,9 @@
252 360 <th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
253 361 </tr>
254 362 </thead>
255 363 <tbody>
364 + <?php $alternate = false; ?>
256 365 <?php foreach ( $modules as $slug => $data ) : ?>
257 366 <?php
258 367 if ( WP_FS__MODULE_TYPE_THEME !== $module_type ) {
259 368 $is_active = is_plugin_active( $data->file );
@@ -267,13 +376,22 @@
267 376 $is_active = ( ( $parent_theme instanceof WP_Theme ) && $parent_theme->stylesheet === $data->file );
268 377 }
269 378 }
270 379 ?>
271 - <?php $fs = $is_active ? freemius( $data->id ) : null ?>
272 - <tr<?php if ( $is_active ) {
273 - if ( $fs->has_api_connectivity() && $fs->is_on() ) {
380 + <?php
381 + $fs = null;
382 + if ( $is_active ) {
383 + $fs = freemius( $data->id );
384 +
385 + $active_modules_by_id[ $data->id ] = true;
386 + }
387 + ?>
388 + <tr<?php if ( $alternate ) { echo ' class="alternate" '; } ?><?php if ( $is_active ) {
389 + $has_api_connectivity = $fs->has_api_connectivity();
390 +
391 + if ( true === $has_api_connectivity && $fs->is_on() ) {
274 392 echo ' style="background: #E6FFE6; font-weight: bold"';
275 - } else {
393 + } else if ( false === $has_api_connectivity || ! $fs->is_on() ) {
276 394 echo ' style="background: #ffd0d0; font-weight: bold"';
277 395 }
278 396 } ?>>
279 397 <td><?php echo $data->id ?></td>
@@ -279,14 +397,16 @@
279 397 <td><?php echo $data->id ?></td>
280 398 <td><?php echo $slug ?></td>
281 399 <td><?php echo $data->version ?></td>
282 400 <td><?php echo $data->title ?></td>
283 - <td<?php if ( $is_active && ! $fs->has_api_connectivity() ) {
401 + <td<?php if ( $is_active && false === $has_api_connectivity ) {
284 402 echo ' style="color: red; text-transform: uppercase;"';
285 403 } ?>><?php if ( $is_active ) {
286 - echo esc_html( $fs->has_api_connectivity() ?
404 + echo esc_html( true === $has_api_connectivity ?
287 405 fs_text_x_inline( 'Connected', 'as connection was successful' ) :
288 - fs_text_x_inline( 'Blocked', 'as connection blocked' )
406 + ( false === $has_api_connectivity ?
407 + fs_text_x_inline( 'Blocked', 'as connection blocked' ) :
408 + fs_text_x_inline( 'No requests yet', 'API connectivity state is unknown' ) )
289 409 );
290 410 } ?></td>
291 411 <td<?php if ( $is_active && ! $fs->is_on() ) {
292 412 echo ' style="color: red; text-transform: uppercase;"';
@@ -297,9 +417,9 @@
297 417 );
298 418 } ?></td>
299 419 <td><?php echo $data->file ?></td>
300 420 <td><?php echo $data->public_key ?></td>
301 - <?php if ( is_multisite() ) : ?>
421 + <?php if ( $is_multisite ) : ?>
302 422 <?php
303 423 $network_blog_id = null;
304 424 $network_user = null;
305 425
@@ -338,8 +458,9 @@
338 458 <?php endif ?>
339 459 <?php endif ?>
340 460 </td>
341 461 </tr>
462 + <?php $alternate = ! $alternate ?>
342 463 <?php endforeach ?>
343 464 </tbody>
344 465 </table>
345 466 <?php endif ?>
@@ -351,18 +472,22 @@
351 472 * @var array[string]FS_Site|array[string]FS_Site[] $sites_map
352 473 */
353 474 $sites_map = $VARS[ $module_type . '_sites' ];
354 475
355 - $is_multisite = is_multisite();
356 - $all_plans = false;
476 + $all_plans = false;
357 477 ?>
358 478 <?php if ( is_array( $sites_map ) && count( $sites_map ) > 0 ) : ?>
359 - <h2><?php echo esc_html( sprintf(
479 + <h2>
480 + <button class="fs-debug-table-toggle-button" aria-expanded="true">
481 + <span class="fs-debug-table-toggle-icon">▼</span>
482 + </button>
483 + <?php echo esc_html( sprintf(
360 484 /* translators: %s: 'plugin' or 'theme' */
361 485 fs_text_inline( '%s Installs', 'module-installs' ),
362 486 ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) )
363 - ) ) ?> / <?php fs_esc_html_echo_x_inline( 'Sites', 'like websites', 'sites' ) ?></h2>
364 - <table id="fs_<?php echo $module_type ?>_installs" class="widefat">
487 + ) ) ?> / <?php fs_esc_html_echo_x_inline( 'Sites', 'like websites', 'sites' ) ?>
488 + </h2>
489 + <table id="fs_<?php echo $module_type ?>_installs" class="widefat fs-debug-table">
365 490 <thead>
366 491 <tr>
367 492 <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
368 493 <?php if ( $is_multisite ) : ?>
@@ -378,17 +503,39 @@
378 503 <th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
379 504 </tr>
380 505 </thead>
381 506 <tbody>
507 + <?php $site_url = null ?>
382 508 <?php foreach ( $sites_map as $slug => $sites ) : ?>
383 - <?php if ( ! is_array( $sites ) ) {
384 - $sites = array( $sites );
385 - } ?>
386 509 <?php foreach ( $sites as $site ) : ?>
510 + <?php
511 + $blog_id = $is_multisite ?
512 + $site->blog_id :
513 + null;
514 +
515 + if ( is_null( $site_url ) || $is_multisite ) {
516 + $site_url = Freemius::get_unfiltered_site_url(
517 + $blog_id,
518 + true,
519 + true
520 + );
521 + }
522 +
523 + $is_active_clone = ( $site->is_clone( $site_url ) && isset( $active_modules_by_id[ $site->plugin_id ] ) );
524 +
525 + if ( $is_active_clone ) {
526 + $has_any_active_clone = true;
527 + }
528 + ?>
387 529 <tr>
388 - <td><?php echo $site->id ?></td>
530 + <td>
531 + <?php echo $site->id ?>
532 + <?php if ( $is_active_clone ) : ?>
533 + <label class="fs-tag fs-warn">Clone</label>
534 + <?php endif ?>
535 + </td>
389 536 <?php if ( $is_multisite ) : ?>
390 - <td><?php echo $site->blog_id ?></td>
537 + <td><?php echo $blog_id ?></td>
391 538 <td><?php echo fs_strip_url_protocol( $site->url ) ?></td>
392 539 <?php endif ?>
393 540 <td><?php echo $slug ?></td>
394 541 <td><?php echo $site->user_id ?></td>
@@ -448,10 +595,15 @@
448 595 <?php
449 596 $addons = $VARS['addons'];
450 597 ?>
451 598 <?php foreach ( $addons as $plugin_id => $plugin_addons ) : ?>
452 - <h2><?php echo esc_html( sprintf( fs_text_inline( 'Add Ons of module %s', 'addons-of-x' ), $plugin_id ) ) ?></h2>
453 - <table id="fs_addons" class="widefat">
599 + <h2>
600 + <button class="fs-debug-table-toggle-button" aria-expanded="true">
601 + <span class="fs-debug-table-toggle-icon">▼</span>
602 + </button>
603 + <?php echo esc_html( sprintf( fs_text_inline( 'Add Ons of module %s', 'addons-of-x' ), $plugin_id ) ) ?>
604 + </h2>
605 + <table id="fs_addons" class="widefat fs-debug-table">
454 606 <thead>
455 607 <tr>
456 608 <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
457 609 <th><?php fs_esc_html_echo_inline( 'Title' ) ?></th>
@@ -483,10 +635,17 @@
483 635 /**
484 636 * @var FS_User[] $users
485 637 */
486 638 $users = $VARS['users'];
639 + $user_ids_map = array();
487 640 $users_with_developer_license_by_id = array();
488 641
642 + if ( is_array( $users ) && ! empty( $users ) ) {
643 + foreach ( $users as $user ) {
644 + $user_ids_map[ $user->id ] = true;
645 + }
646 + }
647 +
489 648 foreach ( $module_types as $module_type ) {
490 649 /**
491 650 * @var FS_Plugin_License[] $licenses
492 651 */
@@ -500,10 +659,15 @@
500 659 }
501 660
502 661 ?>
503 662 <?php if ( is_array( $users ) && 0 < count( $users ) ) : ?>
504 - <h2><?php fs_esc_html_echo_inline( 'Users' ) ?></h2>
505 - <table id="fs_users" class="widefat">
663 + <h2>
664 + <button class="fs-debug-table-toggle-button" aria-expanded="true">
665 + <span class="fs-debug-table-toggle-icon">▼</span>
666 + </button>
667 + <?php fs_esc_html_echo_inline( 'Users' ) ?>
668 + </h2>
669 + <table id="fs_users" class="widefat fs-debug-table">
506 670 <thead>
507 671 <tr>
508 672 <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
509 673 <th><?php fs_esc_html_echo_inline( 'Name' ) ?></th>
@@ -549,10 +713,15 @@
549 713 * @var FS_Plugin_License[] $licenses
550 714 */
551 715 $licenses = $VARS[ $module_type . '_licenses' ] ?>
552 716 <?php if ( is_array( $licenses ) && count( $licenses ) > 0 ) : ?>
553 - <h2><?php echo esc_html( sprintf( fs_text_inline( '%s Licenses', 'module-licenses' ), ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) ) ) ) ?></h2>
554 - <table id="fs_<?php echo $module_type ?>_licenses" class="widefat">
717 + <h2>
718 + <button class="fs-debug-table-toggle-button" aria-expanded="true">
719 + <span class="fs-debug-table-toggle-icon">▼</span>
720 + </button>
721 + <?php echo esc_html( sprintf( fs_text_inline( '%s Licenses', 'module-licenses' ), ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) ) ) ) ?>
722 + </h2>
723 + <table id="fs_<?php echo $module_type ?>_licenses" class="widefat fs-debug-table">
555 724 <thead>
556 725 <tr>
557 726 <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
558 727 <th><?php fs_esc_html_echo_inline( 'Plugin ID' ) ?></th>
@@ -577,9 +746,9 @@
577 746 <td><?php echo $license->activated ?></td>
578 747 <td><?php echo $license->is_block_features ? 'Blocking' : 'Flexible' ?></td>
579 748 <td><?php echo $license->is_whitelabeled ? 'Whitelabeled' : 'Normal' ?></td>
580 749 <td><?php
581 - echo $license->is_whitelabeled ?
750 + echo ( $license->is_whitelabeled || ! isset( $user_ids_map[ $license->user_id ] ) ) ?
582 751 $license->get_html_escaped_masked_secret_key() :
583 752 esc_html( $license->secret_key );
584 753 ?></td>
585 754 <td><?php echo $license->expiration ?></td>
@@ -588,8 +757,12 @@
588 757 </tbody>
589 758 </table>
590 759 <?php endif ?>
591 760 <?php endforeach ?>
761 +<?php
762 + $page_params = array( 'is_fs_debug_page' => true );
763 + fs_require_template( 'debug/scheduled-crons.php', $page_params );
764 +?>
592 765 <?php if ( FS_Logger::is_storage_logging_on() ) : ?>
593 766
594 767 <h2><?php fs_esc_html_echo_inline( 'Debug Log', 'debug-log' ) ?></h2>
595 768
@@ -725,9 +898,9 @@
725 898
726 899 offset = 0;
727 900 }
728 901
729 - $.post(ajaxurl, {
902 + $.post(<?php echo Freemius::ajax_url() ?>, {
730 903 action : 'fs_get_debug_log',
731 904 // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
732 905 _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_debug_log' ) ); ?>,
733 906 filters: filters,
@@ -762,4 +935,25 @@
762 935 loadLogs();
763 936 });
764 937 </script>
765 938 <?php endif ?>
939 +<script type="text/javascript">
940 + // JavaScript to toggle the visibility of the table body and change the caret icon
941 + jQuery( document ).ready( function ( $ ) {
942 + $( '.fs-debug-table-toggle-button' ).on( 'click', function () {
943 + const button = $( this );
944 + const table = button.closest( 'h2' ).next( 'table' );
945 + const isExpanded = ( 'false' === button.attr( 'aria-expanded' ) );
946 +
947 + button.attr( 'aria-expanded', isExpanded );
948 + button.find( '.fs-debug-table-toggle-icon' ).text( isExpanded ? '▼' : '▶' );
949 +
950 + table.css( {
951 + display : isExpanded ? 'table' : 'block',
952 + borderBottomWidth: isExpanded ? '1px' : '0',
953 + maxHeight : isExpanded ? 'auto' : '0',
954 + } );
955 + } );
956 +
957 + $( '.fs-debug-table-toggle-button:last' ).click();
958 + } );
959 +</script>