• Resolved kopka

    (@kopka)


    Hi, I have a problem. I want to create a new product. I will see a white page. I turned on the debug. it told me:

    Notice:Trying to get property “count” on no object in /wp-includes/class-wp-term-query.php on line 758

    I watched the code:

    	// Make sure we show empty categories that have children.
    		if ( $hierarchical && $args['hide_empty'] && is_array( $terms ) ) {
    			foreach ( $terms as $k => $term ) {
    				if ( ! $term->count ) {
    					$children = get_term_children( $term->term_id, $term->taxonomy );
    					if ( is_array( $children ) ) {
    						foreach ( $children as $child_id ) {
    							$child = get_term( $child_id, $term->taxonomy );
    							if ( $child->count ) {
    								continue 2;
    							}
    						}
    					}
    
    					// It really is empty.
    					unset( $terms[ $k ] );
    				}
    			}
    		}

    Finally I found out that yoast plugin does it. If it is turned on then adding the product does not work but when it is turned off everything works.

Viewing 6 replies - 1 through 6 (of 6 total)
  • It’s the code from WP core. Please provide debug backtrace of the error encountered. You could try to install Query Monitor. The following page will explain how to enable the backtrace on your website: https://gist.github.com/jrfnl/5925642

    Thread Starter kopka

    (@kopka)

    hi, I did it according to the instructions.
    I have created a product. Showing errors

    warning 1 :

    
    wp-config.php 206 calling trigger_error()
    wp-load.php 37 calling require_once()
    wp-admin/admin.php 34 calling require_once()
    wp-admin/post-new.php 10 calling require_once()
    

    warning 2:

    
    wp-includes/functions.php 6029 calling header()
    wp-includes/class-wp-hook.php 286 calling send_frame_options_header()
    wp-includes/class-wp-hook.php 312 calling apply_filters()
    wp-includes/plugin.php 478 calling do_action()
    wp-admin/admin.php 170 calling do_action()
    wp-admin/post-new.php 10 calling require_once()
     

    Please remove trigger_error from wp-config.php (Line 206). This line is commented in original gist. The purpose of this line is to test script.

    Both warnings are related to trigger_error from wp-config.php. Please try again when you remove it from wp-config.php…

    Thread Starter kopka

    (@kopka)

    hi,
    30 x warring:

    Backtrace from warning 'Trying to get property 'count' of non-object' at /wp-includes/class-wp-term-query.php 758:
    
    wp-includes/class-wp-term-query.php 288 calling get_terms()
    wp-includes/taxonomy.php 1179 calling query()
    wp-content/plugins/wordpress-seo/admin/class-primary-term-admin.php 268 calling get_terms()
    calling map_taxonomies_for_js()
    wp-content/plugins/wordpress-seo/admin/class-primary-term-admin.php 251 calling array_map()
    wp-content/plugins/wordpress-seo/admin/class-primary-term-admin.php 132 calling get_mapped_taxonomies_for_js()
    wp-includes/class-wp-hook.php 288 calling enqueue_assets()
    wp-includes/class-wp-hook.php 312 calling apply_filters()
    wp-includes/plugin.php 478 calling do_action()
    wp-admin/admin-header.php 104 calling do_action()
    wp-admin/edit-form-advanced.php 419 calling require_once()
    wp-admin/post-new.php 75 calling include()

    1x

    Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /wp-includes/functions.php on line 0
    
    Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0

    It’s possible that’s broken databases for some taxonomy. There are options {$taxonomy}_children which should contain children terms. You should try to purge object caching if you have it, delete all transients and try to delete these options (eg. product_cat_children for product categories). Maybe it’s related to importing?

    Fatal error is probably white screen which you’ve seen. Memory limit 512MB should be enough… Maybe it’s related to my previous concern.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    This thread has been marked as resolved due to a lack of activity. You’re always welcome to re-open this topic.

    Thanks for understanding!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Seo yoast’ is closed to new replies.