Changeset 9650
- Timestamp:
- 03/31/2020 04:06:55 AM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r9647 r9650 3 3 4 4 use WordPressdotorg\Plugin_Directory\Admin\Customizations; 5 use WordPressdotorg\Plugin_Directory\Tools; 5 6 use WordPressdotorg\Plugin_Directory\Admin\Tools\Author_Cards; 6 7 use WordPressdotorg\Plugin_Directory\Admin\Tools\Stats_Report; … … 1384 1385 */ 1385 1386 public function jetpack_sitemap_skip_post( $skip, $plugin_db_row ) { 1387 static $calls = 0; 1388 if ( $calls++ >= 50 ) { 1389 // Clear some memory caches. 1390 $calls = 0; 1391 Tools::clear_memory_heavy_variables(); 1392 } 1393 1386 1394 if ( Template::is_plugin_outdated( $plugin_db_row->ID ) ) { 1387 1395 $skip = true; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php
r9008 r9650 538 538 return $users; 539 539 } 540 541 /** 542 * Clear caches for memory management. 543 * 544 * @static 545 * @global \wpdb $wpdb 546 * @global \WP_Object_Cache $wp_object_cache 547 */ 548 public static function clear_memory_heavy_variables() { 549 global $wpdb, $wp_object_cache; 550 551 $wpdb->queries = []; 552 553 if ( is_object( $wp_object_cache ) ) { 554 $wp_object_cache->cache = []; 555 $wp_object_cache->group_ops = []; 556 $wp_object_cache->memcache_debug = []; 557 } 558 } 540 559 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-manager.php
r9284 r9650 1 1 <?php 2 2 namespace WordPressdotorg\Plugin_Directory\Jobs; 3 use WordPressdotorg\Plugin_Directory\Tools; 3 4 4 5 /** … … 314 315 * 315 316 * @static 316 * @global \wpdb $wpdb 317 * @global \WP_Object_Cache $wp_object_cache 317 * @see Tools::clear_memory_heavy_variables(); 318 318 */ 319 319 public static function clear_memory_heavy_variables() { 320 global $wpdb, $wp_object_cache; 321 322 $wpdb->queries = []; 323 324 if ( is_object( $wp_object_cache ) ) { 325 $wp_object_cache->cache = []; 326 $wp_object_cache->group_ops = []; 327 $wp_object_cache->memcache_debug = []; 328 } 320 Tools::clear_memory_heavy_variables(); 329 321 } 330 322
Note: See TracChangeset
for help on using the changeset viewer.