PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 2.3.2
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v2.3.2
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
← All changes | freemius/templates/debug.php +86 -20 2.0.02.3.2 View file →
@@ -15,8 +15,12 @@
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 + $has_any_active_clone = false;
21 +
22 + $is_multisite = is_multisite();
19 23 ?>
20 24 <h1><?php echo fs_text_inline( 'Freemius Debug' ) . ' - ' . fs_text_inline( 'SDK' ) . ' v.' . $fs_active_plugins->newest->version ?></h1>
21 25 <div>
22 26 <!-- Debugging Switch -->
@@ -34,9 +38,9 @@
34 38 $( this )
35 39 .toggleClass( 'fs-on' )
36 40 .toggleClass( 'fs-off' );
37 41
38 - $.post( ajaxurl, {
42 + $.post( <?php echo Freemius::ajax_url() ?>, {
39 43 action: 'fs_toggle_debug_mode',
40 44 // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
41 45 _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_toggle_debug_mode' ) ); ?>,
42 46 is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
@@ -78,9 +82,19 @@
78 82 <?php wp_nonce_field( 'clear_updates_data' ) ?>
79 83 <button class="button"><?php fs_esc_html_echo_inline( 'Clear Updates Transients' ) ?></button>
80 84 </form>
81 85 </td>
86 + <?php if ( Freemius::is_deactivation_snoozed() ) : ?>
82 87 <td>
88 + <!-- Reset Deactivation Snoozing -->
89 + <form action="" method="POST">
90 + <input type="hidden" name="fs_action" value="reset_deactivation_snoozing">
91 + <?php wp_nonce_field( 'reset_deactivation_snoozing' ) ?>
92 + <button class="button"><?php fs_esc_html_echo_inline( 'Reset Deactivation Snoozing' ) ?> (Expires in <?php echo ( Freemius::deactivation_snooze_expires_at() - time() ) ?> sec)</button>
93 + </form>
94 + </td>
95 + <?php endif ?>
96 + <td>
83 97 <!-- Sync Data with Server -->
84 98 <form action="" method="POST">
85 99 <input type="hidden" name="background_sync" value="true">
86 100 <button class="button button-primary"><?php fs_esc_html_echo_inline( 'Sync Data From Server' ) ?></button>
@@ -101,8 +115,17 @@
101 115 </td>
102 116 <td>
103 117 <button id="fs_set_db_option" class="button"><?php fs_esc_html_echo_inline( 'Set DB Option' ) ?></button>
104 118 </td>
119 + <td>
120 + <?php
121 + $fs_debug_page_url = 'admin.php?page=freemius&fs_action=allow_clone_resolution_notice';
122 + $fs_debug_page_url = fs_is_network_admin() ?
123 + network_admin_url( $fs_debug_page_url ) :
124 + admin_url( $fs_debug_page_url );
125 + ?>
126 + <a href="<?php echo wp_nonce_url( $fs_debug_page_url, 'fs_allow_clone_resolution_notice' ) ?>" class="button button-primary">Resolve Clone(s)</a>
127 + </td>
105 128 </tr>
106 129 </tbody>
107 130 </table>
108 131 <script type="text/javascript">
@@ -110,9 +133,9 @@
110 133 $('#fs_load_db_option').click(function () {
111 134 var optionName = prompt('Please enter the option name:');
112 135
113 136 if (optionName) {
114 - $.post(ajaxurl, {
137 + $.post(<?php echo Freemius::ajax_url() ?>, {
115 138 action : 'fs_get_db_option',
116 139 // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
117 140 _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_db_option' ) ); ?>,
118 141 option_name: optionName
@@ -131,9 +154,9 @@
131 154 if (optionName) {
132 155 var optionValue = prompt('Please enter the option value:');
133 156
134 157 if (optionValue) {
135 - $.post(ajaxurl, {
158 + $.post(<?php echo Freemius::ajax_url() ?>, {
136 159 action : 'fs_set_db_option',
137 160 // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
138 161 _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_set_db_option' ) ); ?>,
139 162 option_name : optionName,
@@ -174,8 +197,12 @@
174 197 array(
175 198 'key' => 'WP_FS__DIR',
176 199 'val' => WP_FS__DIR,
177 200 ),
201 + array(
202 + 'key' => 'wp_using_ext_object_cache()',
203 + 'val' => wp_using_ext_object_cache() ? 'true' : 'false',
204 + ),
178 205 )
179 206 ?>
180 207 <br>
181 208 <table class="widefat">
@@ -228,9 +255,9 @@
228 255 WP_FS__MODULE_TYPE_PLUGIN,
229 256 WP_FS__MODULE_TYPE_THEME
230 257 );
231 258 ?>
232 -
259 +<?php $active_modules_by_id = array() ?>
233 260 <?php foreach ( $module_types as $module_type ) : ?>
234 261 <?php $modules = fs_get_entities( $fs_options->get_option( $module_type . 's' ), FS_Plugin::get_class_name() ) ?>
235 262 <?php if ( is_array( $modules ) && count( $modules ) > 0 ) : ?>
236 263 <h2><?php echo esc_html( ( WP_FS__MODULE_TYPE_PLUGIN == $module_type ) ? fs_text_inline( 'Plugins', 'plugins' ) : fs_text_inline( 'Themes', 'themes' ) ) ?></h2>
@@ -244,9 +271,9 @@
244 271 <th><?php fs_esc_html_echo_x_inline( 'API', 'as application program interface' ) ?></th>
245 272 <th><?php fs_esc_html_echo_inline( 'Freemius State' ) ?></th>
246 273 <th><?php fs_esc_html_echo_inline( 'Module Path' ) ?></th>
247 274 <th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
248 - <?php if ( is_multisite() ) : ?>
275 + <?php if ( $is_multisite ) : ?>
249 276 <th><?php fs_esc_html_echo_inline( 'Network Blog' ) ?></th>
250 277 <th><?php fs_esc_html_echo_inline( 'Network User' ) ?></th>
251 278 <?php endif ?>
252 279 <th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
@@ -267,11 +294,20 @@
267 294 $is_active = ( ( $parent_theme instanceof WP_Theme ) && $parent_theme->stylesheet === $data->file );
268 295 }
269 296 }
270 297 ?>
271 - <?php $fs = $is_active ? freemius( $data->id ) : null ?>
298 + <?php
299 + $fs = null;
300 + if ( $is_active ) {
301 + $fs = freemius( $data->id );
302 +
303 + $active_modules_by_id[ $data->id ] = true;
304 + }
305 + ?>
272 306 <tr<?php if ( $is_active ) {
273 - if ( $fs->has_api_connectivity() && $fs->is_on() ) {
307 + $has_api_connectivity = $fs->has_api_connectivity();
308 +
309 + if ( true === $has_api_connectivity && $fs->is_on() ) {
274 310 echo ' style="background: #E6FFE6; font-weight: bold"';
275 311 } else {
276 312 echo ' style="background: #ffd0d0; font-weight: bold"';
277 313 }
@@ -279,14 +315,16 @@
279 315 <td><?php echo $data->id ?></td>
280 316 <td><?php echo $slug ?></td>
281 317 <td><?php echo $data->version ?></td>
282 318 <td><?php echo $data->title ?></td>
283 - <td<?php if ( $is_active && ! $fs->has_api_connectivity() ) {
319 + <td<?php if ( $is_active && true !== $has_api_connectivity ) {
284 320 echo ' style="color: red; text-transform: uppercase;"';
285 321 } ?>><?php if ( $is_active ) {
286 - echo esc_html( $fs->has_api_connectivity() ?
322 + echo esc_html( true === $has_api_connectivity ?
287 323 fs_text_x_inline( 'Connected', 'as connection was successful' ) :
288 - fs_text_x_inline( 'Blocked', 'as connection blocked' )
324 + ( false === $has_api_connectivity ?
325 + fs_text_x_inline( 'Blocked', 'as connection blocked' ) :
326 + fs_text_x_inline( 'Unknown', 'API connectivity state is unknown' ) )
289 327 );
290 328 } ?></td>
291 329 <td<?php if ( $is_active && ! $fs->is_on() ) {
292 330 echo ' style="color: red; text-transform: uppercase;"';
@@ -297,9 +335,9 @@
297 335 );
298 336 } ?></td>
299 337 <td><?php echo $data->file ?></td>
300 338 <td><?php echo $data->public_key ?></td>
301 - <?php if ( is_multisite() ) : ?>
339 + <?php if ( $is_multisite ) : ?>
302 340 <?php
303 341 $network_blog_id = null;
304 342 $network_user = null;
305 343
@@ -351,10 +389,9 @@
351 389 * @var array[string]FS_Site|array[string]FS_Site[] $sites_map
352 390 */
353 391 $sites_map = $VARS[ $module_type . '_sites' ];
354 392
355 - $is_multisite = is_multisite();
356 - $all_plans = false;
393 + $all_plans = false;
357 394 ?>
358 395 <?php if ( is_array( $sites_map ) && count( $sites_map ) > 0 ) : ?>
359 396 <h2><?php echo esc_html( sprintf(
360 397 /* translators: %s: 'plugin' or 'theme' */
@@ -378,17 +415,39 @@
378 415 <th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
379 416 </tr>
380 417 </thead>
381 418 <tbody>
419 + <?php $site_url = null ?>
382 420 <?php foreach ( $sites_map as $slug => $sites ) : ?>
383 - <?php if ( ! is_array( $sites ) ) {
384 - $sites = array( $sites );
385 - } ?>
386 421 <?php foreach ( $sites as $site ) : ?>
422 + <?php
423 + $blog_id = $is_multisite ?
424 + $site->blog_id :
425 + null;
426 +
427 + if ( is_null( $site_url ) || $is_multisite ) {
428 + $site_url = Freemius::get_unfiltered_site_url(
429 + $blog_id,
430 + true,
431 + true
432 + );
433 + }
434 +
435 + $is_active_clone = ( $site->is_clone( $site_url ) && isset( $active_modules_by_id[ $site->plugin_id ] ) );
436 +
437 + if ( $is_active_clone ) {
438 + $has_any_active_clone = true;
439 + }
440 + ?>
387 441 <tr>
388 - <td><?php echo $site->id ?></td>
442 + <td>
443 + <?php echo $site->id ?>
444 + <?php if ( $is_active_clone ) : ?>
445 + <label class="fs-tag fs-warn">Clone</label>
446 + <?php endif ?>
447 + </td>
389 448 <?php if ( $is_multisite ) : ?>
390 - <td><?php echo $site->blog_id ?></td>
449 + <td><?php echo $blog_id ?></td>
391 450 <td><?php echo fs_strip_url_protocol( $site->url ) ?></td>
392 451 <?php endif ?>
393 452 <td><?php echo $slug ?></td>
394 453 <td><?php echo $site->user_id ?></td>
@@ -483,10 +542,17 @@
483 542 /**
484 543 * @var FS_User[] $users
485 544 */
486 545 $users = $VARS['users'];
546 + $user_ids_map = array();
487 547 $users_with_developer_license_by_id = array();
488 548
549 + if ( is_array( $users ) && ! empty( $users ) ) {
550 + foreach ( $users as $user ) {
551 + $user_ids_map[ $user->id ] = true;
552 + }
553 + }
554 +
489 555 foreach ( $module_types as $module_type ) {
490 556 /**
491 557 * @var FS_Plugin_License[] $licenses
492 558 */
@@ -577,9 +643,9 @@
577 643 <td><?php echo $license->activated ?></td>
578 644 <td><?php echo $license->is_block_features ? 'Blocking' : 'Flexible' ?></td>
579 645 <td><?php echo $license->is_whitelabeled ? 'Whitelabeled' : 'Normal' ?></td>
580 646 <td><?php
581 - echo $license->is_whitelabeled ?
647 + echo ( $license->is_whitelabeled || ! isset( $user_ids_map[ $license->user_id ] ) ) ?
582 648 $license->get_html_escaped_masked_secret_key() :
583 649 esc_html( $license->secret_key );
584 650 ?></td>
585 651 <td><?php echo $license->expiration ?></td>
@@ -725,9 +791,9 @@
725 791
726 792 offset = 0;
727 793 }
728 794
729 - $.post(ajaxurl, {
795 + $.post(<?php echo Freemius::ajax_url() ?>, {
730 796 action : 'fs_get_debug_log',
731 797 // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
732 798 _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_debug_log' ) ); ?>,
733 799 filters: filters,