Changeset 9524 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php
- Timestamp:
- 02/21/2020 01:37:06 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php
r9364 r9524 450 450 $cache_key = sanitize_key( __METHOD__ . ':' . get_locale() . ':' . md5( serialize( $this->request ) . serialize( $this->fields ) ) ); 451 451 if ( false !== ( $this->response = wp_cache_get( $cache_key, $this->cache_group ) ) && empty( $this->request->cache_buster ) ) { 452 return; 452 453 // DEBUG - Attempt to skip the cache when it only contains one theme when it should contain many. 454 if ( 455 isset( $this->request->browse ) && 456 'popular' === $this->request->browse && 457 $this->response->info['results'] <= 1 458 ) { 459 // The cache is bad. Don't use it. 460 $this->response = false; 461 } else { 462 // The cache is good, use it. 463 return; 464 } 453 465 } 454 466 … … 461 473 if ( empty( $this->request->fields ) ) { 462 474 $this->request->fields = array(); 463 }464 465 // DEBUG466 if ( function_exists( 'slack_dm' ) && isset( $wp_query->query_vars['browse'] ) && 'featured' === $wp_query->query_vars['browse'] && 1 === $this->result->found_posts ) {467 slack_dm( print_r( $this->request, 1 ), 'obenland' );468 slack_dm( print_r( $wp_query, 1 ), 'obenland' );469 475 } 470 476 … … 485 491 foreach ( (array) $this->result->posts as $theme ) { 486 492 $this->response->themes[] = $this->fill_theme( $theme ); 493 } 494 495 // DEBUG - Try to find out why the cache for the popular/featured views occasionally only include 1 theme. 496 if ( 497 function_exists( 'slack_dm' ) && 498 ( 1 === $this->response->info['results'] || 0 === $this->response->info['results'] ) && 499 isset( $this->request->browse ) && 500 'popular' === $this->request->browse 501 ) { 502 slack_dm( $_SERVER['REQUEST_URI'], 'dd32' ); 503 slack_dm( print_r( $this->request, 1 ), 'dd32' ); 504 slack_dm( print_r( $wp_query, 1 ), 'dd32' ); 487 505 } 488 506
Note: See TracChangeset
for help on using the changeset viewer.