• Resolved iamjanco

    (@iamjanco)


    This has been happening for a while now and may be related to the following issue on Github, which was opened by tacoverdo on Mar 2, 2017; if so, would like to know why the issue is still open and what, if anything, can be done as a workaround:

    Query in class-taxonomy-sitemap-provider.php too long #6761

    Truncated example of error follows:

    [Sat Sep 01 18:20:02.179004 2018] [:error] [pid 7099] [client — (censored)] KILLED QUERY (16387 characters long generated in /nas/content/live/— (censored)/wp-content/plugins/wordpress-seo/inc/sitemaps/class-taxonomy-sitemap-provider.php:163): SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (9079,9080,5896,7415,7398,7416,7401,7421,7424,7431,372,7332,4025 …

    Excerpted code from the impacted function follows:

    	public function get_sitemap_links( $type, $max_entries, $current_page ) {
    
    		global $wpdb;
    
    		$links    = array();
    		$taxonomy = get_taxonomy( $type );
    
    		if ( $taxonomy === false || ! $this->is_valid_taxonomy( $taxonomy->name ) || ! $taxonomy->public ) {
    			return $links;
    		}
    
    		$steps  = $max_entries;
    		$offset = ( $current_page > 1 ) ? ( ( $current_page - 1 ) * $max_entries ) : 0;
    
    		/** This filter is documented in inc/sitemaps/class-taxonomy-sitemap-provider.php */
    		$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true, $taxonomy );
    		$terms      = get_terms( $taxonomy->name, array( 'hide_empty' => $hide_empty ) );
    		$terms      = array_splice( $terms, $offset, $steps );
    
    		if ( empty( $terms ) ) {
    			$terms = array();
    		}

    Hosted on wpengine, using PHP 7.0.x, clearing cache doesn’t help, everything is up to date. Details about addons on follow:

    Adwords Website Call Conversion Tracking Version 1.0.0 (deactivated)
    Akismet Anti-Spam Version 4.0.8 (deactivated)
    Check Email Version 0.5.5 (deactivated)
    Cookie Notice Version 1.2.44 (deactivated)
    Elegant Themes Updater Version 1.2
    ET Anticipate Maintenance Plugin Version 1.7.1 (deactivated)
    Gravity Forms Version 2.3.3
    Gravity Forms Logging Add-On Version 1.3 (deactivated)
    HubSpot Tracking Code for WordPress Version 1.2.1
    Members Version 2.1.0
    PHP Compatibility Checker Version 1.4.6 (deactivated)
    Popup Maker Version 1.7.29
    Redirect Role Wise Version 1.2 (deactivated)
    Scripts n Styles Version 3.4.4
    SOGO Add Script Header Footer Version 3.0
    WooCommerce Version 3.4.5
    Woocommerce CSV Import Version 3.3.6 (deactivated)
    WooSidebars Version 1.4.5
    WP All Export Version 1.2.1
    WP All Import Version 3.4.9
    WP All Import – WooCommerce Add-On Version 1.3.9 (deactivated)
    Yoast SEO Version 8.1

    Thanks, –iamjanco

    • This topic was modified 6 years, 2 months ago by iamjanco.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter iamjanco

    (@iamjanco)

    Additional pertinent info follows:

    PHP version: 7.0.30-0ubuntu0.16.04.1
    MySQL version: 5.7.22-22-log
    WordPress memory limit: 512 MB

    Thread Starter iamjanco

    (@iamjanco)

    Sorry about this, it’s not Yoast SEO causing the issue; while not the optimal solution for the site, the workaround is:

    define( 'WPE_GOVERNOR', false );

    in the wp-config file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘class-taxonomy-sitemap-provider dot php killing queries’ is closed to new replies.