| @@ -257,11 +257,19 @@ | ||
| 257 | 257 | 'key' => 'WP_FS__DIR', |
| 258 | 258 | 'val' => WP_FS__DIR, |
| 259 | 259 | ), |
| 260 | 260 | array( |
| 261 | + 'key' => 'DISABLE_WP_CRON', | |
| 262 | + 'val' => defined( 'DISABLE_WP_CRON' ) ? ( DISABLE_WP_CRON ? 'true' : 'false' ) : 'Not defined', | |
| 263 | + ), | |
| 264 | + array( | |
| 261 | 265 | 'key' => 'wp_using_ext_object_cache()', |
| 262 | 266 | 'val' => wp_using_ext_object_cache() ? 'true' : 'false', |
| 263 | 267 | ), |
| 268 | + array( | |
| 269 | + 'key' => 'Freemius::get_unfiltered_site_url()', | |
| 270 | + 'val' => Freemius::get_unfiltered_site_url(), | |
| 271 | + ), | |
| 264 | 272 | ) |
| 265 | 273 | ?> |
| 266 | 274 | <br> |
| 267 | 275 | <table class="widefat"> |
| @@ -277,16 +285,25 @@ | ||
| 277 | 285 | <tr<?php if ( $alternate ) { |
| 278 | 286 | echo ' class="alternate"'; |
| 279 | 287 | } ?>> |
| 280 | 288 | <td><?php echo $p['key'] ?></td> |
| 281 | - <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> | |
| 282 | 294 | </tr> |
| 283 | 295 | <?php $alternate = ! $alternate ?> |
| 284 | 296 | <?php endforeach ?> |
| 285 | 297 | </tbody> |
| 286 | 298 | </table> |
| 287 | -<h2><?php fs_esc_html_echo_x_inline( 'SDK Versions', 'as software development kit versions', 'sdk-versions' ) ?></h2> | |
| 288 | -<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"> | |
| 289 | 306 | <thead> |
| 290 | 307 | <tr> |
| 291 | 308 | <th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th> |
| 292 | 309 | <th><?php fs_esc_html_echo_inline( 'SDK Path' ) ?></th> |
| @@ -318,10 +335,15 @@ | ||
| 318 | 335 | <?php $active_modules_by_id = array() ?> |
| 319 | 336 | <?php foreach ( $module_types as $module_type ) : ?> |
| 320 | 337 | <?php $modules = fs_get_entities( $fs_options->get_option( $module_type . 's' ), FS_Plugin::get_class_name() ) ?> |
| 321 | 338 | <?php if ( is_array( $modules ) && count( $modules ) > 0 ) : ?> |
| 322 | - <h2><?php echo esc_html( ( WP_FS__MODULE_TYPE_PLUGIN == $module_type ) ? fs_text_inline( 'Plugins', 'plugins' ) : fs_text_inline( 'Themes', 'themes' ) ) ?></h2> | |
| 323 | - <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"> | |
| 324 | 346 | <thead> |
| 325 | 347 | <tr> |
| 326 | 348 | <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th> |
| 327 | 349 | <th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th> |
| @@ -338,8 +360,9 @@ | ||
| 338 | 360 | <th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th> |
| 339 | 361 | </tr> |
| 340 | 362 | </thead> |
| 341 | 363 | <tbody> |
| 364 | + <?php $alternate = false; ?> | |
| 342 | 365 | <?php foreach ( $modules as $slug => $data ) : ?> |
| 343 | 366 | <?php |
| 344 | 367 | if ( WP_FS__MODULE_TYPE_THEME !== $module_type ) { |
| 345 | 368 | $is_active = is_plugin_active( $data->file ); |
| @@ -361,14 +384,14 @@ | ||
| 361 | 384 | |
| 362 | 385 | $active_modules_by_id[ $data->id ] = true; |
| 363 | 386 | } |
| 364 | 387 | ?> |
| 365 | - <tr<?php if ( $is_active ) { | |
| 388 | + <tr<?php if ( $alternate ) { echo ' class="alternate" '; } ?><?php if ( $is_active ) { | |
| 366 | 389 | $has_api_connectivity = $fs->has_api_connectivity(); |
| 367 | 390 | |
| 368 | 391 | if ( true === $has_api_connectivity && $fs->is_on() ) { |
| 369 | 392 | echo ' style="background: #E6FFE6; font-weight: bold"'; |
| 370 | - } else { | |
| 393 | + } else if ( false === $has_api_connectivity || ! $fs->is_on() ) { | |
| 371 | 394 | echo ' style="background: #ffd0d0; font-weight: bold"'; |
| 372 | 395 | } |
| 373 | 396 | } ?>> |
| 374 | 397 | <td><?php echo $data->id ?></td> |
| @@ -374,9 +397,9 @@ | ||
| 374 | 397 | <td><?php echo $data->id ?></td> |
| 375 | 398 | <td><?php echo $slug ?></td> |
| 376 | 399 | <td><?php echo $data->version ?></td> |
| 377 | 400 | <td><?php echo $data->title ?></td> |
| 378 | - <td<?php if ( $is_active && true !== $has_api_connectivity ) { | |
| 401 | + <td<?php if ( $is_active && false === $has_api_connectivity ) { | |
| 379 | 402 | echo ' style="color: red; text-transform: uppercase;"'; |
| 380 | 403 | } ?>><?php if ( $is_active ) { |
| 381 | 404 | echo esc_html( true === $has_api_connectivity ? |
| 382 | 405 | fs_text_x_inline( 'Connected', 'as connection was successful' ) : |
| @@ -381,9 +404,9 @@ | ||
| 381 | 404 | echo esc_html( true === $has_api_connectivity ? |
| 382 | 405 | fs_text_x_inline( 'Connected', 'as connection was successful' ) : |
| 383 | 406 | ( false === $has_api_connectivity ? |
| 384 | 407 | fs_text_x_inline( 'Blocked', 'as connection blocked' ) : |
| 385 | - fs_text_x_inline( 'Unknown', 'API connectivity state is unknown' ) ) | |
| 408 | + fs_text_x_inline( 'No requests yet', 'API connectivity state is unknown' ) ) | |
| 386 | 409 | ); |
| 387 | 410 | } ?></td> |
| 388 | 411 | <td<?php if ( $is_active && ! $fs->is_on() ) { |
| 389 | 412 | echo ' style="color: red; text-transform: uppercase;"'; |
| @@ -435,8 +458,9 @@ | ||
| 435 | 458 | <?php endif ?> |
| 436 | 459 | <?php endif ?> |
| 437 | 460 | </td> |
| 438 | 461 | </tr> |
| 462 | + <?php $alternate = ! $alternate ?> | |
| 439 | 463 | <?php endforeach ?> |
| 440 | 464 | </tbody> |
| 441 | 465 | </table> |
| 442 | 466 | <?php endif ?> |
| @@ -451,14 +475,19 @@ | ||
| 451 | 475 | |
| 452 | 476 | $all_plans = false; |
| 453 | 477 | ?> |
| 454 | 478 | <?php if ( is_array( $sites_map ) && count( $sites_map ) > 0 ) : ?> |
| 455 | - <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( | |
| 456 | 484 | /* translators: %s: 'plugin' or 'theme' */ |
| 457 | 485 | fs_text_inline( '%s Installs', 'module-installs' ), |
| 458 | 486 | ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) ) |
| 459 | - ) ) ?> / <?php fs_esc_html_echo_x_inline( 'Sites', 'like websites', 'sites' ) ?></h2> | |
| 460 | - <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"> | |
| 461 | 490 | <thead> |
| 462 | 491 | <tr> |
| 463 | 492 | <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th> |
| 464 | 493 | <?php if ( $is_multisite ) : ?> |
| @@ -566,10 +595,15 @@ | ||
| 566 | 595 | <?php |
| 567 | 596 | $addons = $VARS['addons']; |
| 568 | 597 | ?> |
| 569 | 598 | <?php foreach ( $addons as $plugin_id => $plugin_addons ) : ?> |
| 570 | - <h2><?php echo esc_html( sprintf( fs_text_inline( 'Add Ons of module %s', 'addons-of-x' ), $plugin_id ) ) ?></h2> | |
| 571 | - <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"> | |
| 572 | 606 | <thead> |
| 573 | 607 | <tr> |
| 574 | 608 | <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th> |
| 575 | 609 | <th><?php fs_esc_html_echo_inline( 'Title' ) ?></th> |
| @@ -625,10 +659,15 @@ | ||
| 625 | 659 | } |
| 626 | 660 | |
| 627 | 661 | ?> |
| 628 | 662 | <?php if ( is_array( $users ) && 0 < count( $users ) ) : ?> |
| 629 | - <h2><?php fs_esc_html_echo_inline( 'Users' ) ?></h2> | |
| 630 | - <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"> | |
| 631 | 670 | <thead> |
| 632 | 671 | <tr> |
| 633 | 672 | <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th> |
| 634 | 673 | <th><?php fs_esc_html_echo_inline( 'Name' ) ?></th> |
| @@ -674,10 +713,15 @@ | ||
| 674 | 713 | * @var FS_Plugin_License[] $licenses |
| 675 | 714 | */ |
| 676 | 715 | $licenses = $VARS[ $module_type . '_licenses' ] ?> |
| 677 | 716 | <?php if ( is_array( $licenses ) && count( $licenses ) > 0 ) : ?> |
| 678 | - <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> | |
| 679 | - <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"> | |
| 680 | 724 | <thead> |
| 681 | 725 | <tr> |
| 682 | 726 | <th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th> |
| 683 | 727 | <th><?php fs_esc_html_echo_inline( 'Plugin ID' ) ?></th> |
| @@ -713,8 +757,12 @@ | ||
| 713 | 757 | </tbody> |
| 714 | 758 | </table> |
| 715 | 759 | <?php endif ?> |
| 716 | 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 | +?> | |
| 717 | 765 | <?php if ( FS_Logger::is_storage_logging_on() ) : ?> |
| 718 | 766 | |
| 719 | 767 | <h2><?php fs_esc_html_echo_inline( 'Debug Log', 'debug-log' ) ?></h2> |
| 720 | 768 | |
| @@ -887,4 +935,25 @@ | ||
| 887 | 935 | loadLogs(); |
| 888 | 936 | }); |
| 889 | 937 | </script> |
| 890 | 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> | |