• I am seeing this error in my logs:

    PHP Warning: Illegal string offset ‘terms’ in //wp-content/plugins/reorder-post-within-categories/public/class-reorder-post-within-categories-public.php on line 130

    Running PHP 7.4, WP 5.7, Plugin 2.9.2

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    warnings are not errors. are you posts not being ordered on the front-end?

    Thread Starter Abigailm

    (@abigailm)

    The plugin seems to be functioning ok, but there are hundreds of log entries like this, just over the past month. I am reporting this because I would assume that you would want to write clean code. It seems to be tied to this section of code:

    if (isset($queriedObj->taxonomy) && isset($queriedObj->term_id)) {
    			/** @since 2.9.1 fix multi-term queries bug */
    			$validate = true;
    			switch(true){
    				case $wp_query->is_category and ($wp_query->is_tag || $wp_query->is_tax):
    				case $wp_query->is_tag and ($wp_query->is_category || $wp_query->is_tax):
    				case $wp_query->is_tax and ($wp_query->is_category || $wp_query->is_tag):
    					$validate = false; //multiple taxonomy queried.
    					break;
    				case isset($wp_query->tax_query):
    					foreach($wp_query->tax_query->queries as $t){
    						if(is_array($t['terms']) && count($t['terms'])>1) $validate = false; //multiple terms queried.
    					}
    					break;
    			}
    			if(!$validate) return 0;
          $term_id = $queriedObj->term_id;
    			$taxonomy = $queriedObj->taxonomy;
    			 // debug_msg($wp_query->tax_query->queries, "$taxonomy is ranked $term_id ");
        } else {
          return 0;
        }
    • This reply was modified 3 years, 8 months ago by Abigailm.
    Plugin Author Aurovrata Venet

    (@aurovrata)

    I would assume that you would want to write clean code.

    thanks @abigailm I have already placed a validation in the code. Since it is not critical it will get released in the next version.

    hundreds of log entries like this,

    from this plugin?

    Thread Starter Abigailm

    (@abigailm)

    If you look at the log entry I posted, it specifically references this plugin as the source of the error:

    PHP Warning: Illegal string offset ‘terms’ in //wp-content/plugins/reorder-post-within-categories/public/class-reorder-post-within-categories-public.php on line 130

    If it helps, this error first showed up in the logs about a month ago.

    • This reply was modified 3 years, 8 months ago by Abigailm.
    • This reply was modified 3 years, 8 months ago by Abigailm.
    Plugin Author Aurovrata Venet

    (@aurovrata)

    Indeed, and if you read my answer…

    I have already placed a validation in the code. Since it is not critical it will get released in the next version.

    You can see this has been corrected

    Thread Starter Abigailm

    (@abigailm)

    Thank you!

    Me too, thanks for fix. Log growing fast.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    released in v2.9.3

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PHP Error’ is closed to new replies.