Skip to content

query terms and SEO plugin error #306

Closed
sqzi opened this Issue Oct 14, 2013 · 11 comments

3 participants

@sqzi
sqzi commented Oct 14, 2013

Hi,

I have multible taxonomies, with multible terms. All working well when viewing the archive, but when i activate SEO Yoast plugin, it shows me a warning message like this:

Warning: rtrim() expects parameter 1 to be string, object given in /home/verschoor/domains/verschoor-reizen.nl/public_html/wp-includes/formatting.php on line 1408

The warning message only show up, when viewing the archive of a term. The Posttype archive is working well, as the rest of the website. Someone have experienced with this kind of problem?

Thank you very much,

Wouter

@jrfnl
jrfnl commented Oct 18, 2013

Can you do a backtrace on the error ? It is kind of difficult to determine where it is coming from now.

More information on how to get a backtrace can be found here: https://gist.github.com/jrfnl/5925642

@Pierinux

there's really a number of people having this issue, if you search on google.
in my case, wordpress version 3.8, the issue "Warning: rtrim() expects parameter 1 to be string, object given..." is in wp-includes/formatting.php on line 1497. I see it's quite a while this issue has been around. I have no other option than to disable the plugin until it gets fixed.

@jrfnl
jrfnl commented Dec 26, 2013

@Pierinux I repeat:

Can you do a backtrace on the error ? It is kind of difficult to determine where it is coming from now.
More information on how to get a backtrace can be found here: https://gist.github.com/jrfnl/5925642

Without a backtrace there is nothing we can do as the error does not point to a place in wp seo.

Also: What is the effect of the error ? So far nobody has indicated the error causes something to no longer work, so nothing serious really. You shouldn't have WP_DEBUG enabled on a live website anyhow.
In other words, disabling the plugin because of one error, while the plugin is working fine is a bit silly.

@Pierinux

there seems to be an error object being parsed by the plugin when the .
I have no clue why the term should be invalid, but shouldn't the plugin be treating the case of an "invalid term" (whatever it means) appropriately?

could it be that the meta title contains quotes?

here's the backtrace:

0 error_backtrace(2, rtrim() expects parameter 1 to be string, object given, /html/wp-includes/formatting.php, 1497, Array ([string] => WP_Error Object ([errors] => Array ([invalid_term] => Array ([0] => Empty Term)),[error_data] => Array ())))
1 rtrim(WP_Error Object ([errors] => Array ([invalid_term] => Array ([0] => Empty Term)),[error_data] => Array ()), /) called at [/html/wp-includes/formatting.php:1497]
2 untrailingslashit(WP_Error Object ([errors] => Array ([invalid_term] => Array ([0] => Empty Term)),[error_data] => Array ())) called at [/html/wp-includes/formatting.php:1482]
3 trailingslashit(WP_Error Object ([errors] => Array ([invalid_term] => Array ([0] => Empty Term)),[error_data] => Array ())) called at [/html/wp-content/plugins/wordpress-seo/frontend/class-frontend.php:818]
4 WPSEO_Frontend->adjacent_rel_link(next, WP_Error Object ([errors] => Array ([invalid_term] => Array ([0] => Empty Term)),[error_data] => Array ()), 2, 1) called at [/html/wp-content/plugins/wordpress-seo/frontend/class-frontend.php:766]
5 WPSEO_Frontend->adjacent_rel_links()
6 call_user_func_array(Array ([0] => WPSEO_Frontend Object ([options] => Array ([disableadvanced_meta] => on,[version] => 1.4.22,[theme_check] => Array ([description] => 1),[tracking_popup] => done,[yoast_tracking] => on,[ignore_tour] => ignore,[cleanslugs] => on,[title-home] => %%sitename%% %%page%% %%sep%% %%sitedesc%%,[metadesc-home] => Our Mission: "To promote the understanding, appreciation, and conservation of the chimpanzees, their habitats in particular, and wildlife in general".,[title-post] => %%title%% %%page%% %%sep%% %%sitename%%,[metadesc-post] => ,[title-page] => %%title%% %%page%% %%sep%% %%sitename%%,[metadesc-page] => ,[title-attachment] => %%title%% %%page%% %%sep%% %%sitename%%,[metadesc-attachment] => ,[title-category] => %%term_title%% Archives %%page%% %%sep%% %%sitename%%,[metadesc-category] => ,[title-post_tag] => %%term_title%% Archives %%page%% %%sep%% %%sitename%%,[metadesc-post_tag] => ,[title-post_format] => %%term_title%% Archives %%page%% %%sep%% %%sitename%%,[metadesc-post_format] => ,[noindex-post_format] => on,[title-author] => %%name%%, Author at %%sitename%% %%page%% ,[metadesc-author] => ,[title-archive] => %%date%% %%page%% %%sep%% %%sitename%%,[metadesc-archive] => ,[noindex-archive] => on,[title-search] => You searched for %%searchphrase%% %%page%% %%sep%% %%sitename%%,[title-404] => Page Not Found %%sep%% %%sitename%%,[rssafter] => The post %%POSTLINK%% appeared first on %%BLOGLINK%%.,[0] => ,[xml_ping_yahoo] => on,[xml_ping_ask] => on,[post_types-attachment-not_in_sitemap] => on,[entries-per-page] => ,[opengraph] => on,[facebook_site] => https:/www.facebook.com/xxxxxx,[og_frontpage_image] => ,[og_frontpage_desc] => ,[og_default_image] => http://xxxxxxx,[twitter] => on,[twitter_site] => xxxxxxx,[plus-author] => -1,[plus-publisher] => ,[fbconnectkey] => xxxxxxxxxxxx)),[1] => adjacent_rel_links), Array ([0] => )) called at [/html/wp-includes/plugin.php:429]
7 do_action(wpseo_head) called at [/html/wp-content/plugins/wordpress-seo/frontend/class-frontend.php:527]
8 WPSEO_Frontend->head()
9 call_user_func_array(Array ([0] => WPSEO_Frontend Object ([options] => Array ([disableadvanced_meta] => on,[version] => 1.4.22,[theme_check] => Array ([description] => 1),[tracking_popup] => done,[yoast_tracking] => on,[ignore_tour] => ignore,[cleanslugs] => on,[title-home] => %%sitename%% %%page%% %%sep%% %%sitedesc%%,[metadesc-home] => Our Mission: "To promote the understanding, appreciation, and conservation of the chimpanzees, their habitats in particular, and wildlife in general".,[title-post] => %%title%% %%page%% %%sep%% %%sitename%%,[metadesc-post] => ,[title-page] => %%title%% %%page%% %%sep%% %%sitename%%,[metadesc-page] => ,[title-attachment] => %%title%% %%page%% %%sep%% %%sitename%%,[metadesc-attachment] => ,[title-category] => %%term_title%% Archives %%page%% %%sep%% %%sitename%%,[metadesc-category] => ,[title-post_tag] => %%term_title%% Archives %%page%% %%sep%% %%sitename%%,[metadesc-post_tag] => ,[title-post_format] => %%term_title%% Archives %%page%% %%sep%% %%sitename%%,[metadesc-post_format] => ,[noindex-post_format] => on,[title-author] => %%name%%, Author at %%sitename%% %%page%% ,[metadesc-author] => ,[title-archive] => %%date%% %%page%% %%sep%% %%sitename%%,[metadesc-archive] => ,[noindex-archive] => on,[title-search] => You searched for %%searchphrase%% %%page%% %%sep%% %%sitename%%,[title-404] => Page Not Found %%sep%% %%sitename%%,[rssafter] => The post %%POSTLINK%% appeared first on %%BLOGLINK%%.,[0] => ,[xml_ping_yahoo] => on,[xml_ping_ask] => on,[post_types-attachment-not_in_sitemap] => on,[entries-per-page] => ,[opengraph] => on,[facebook_site] => https:/www.facebook.com/xxxxxx,[og_frontpage_image] => ,[og_frontpage_desc] => ,[og_default_image] => http://xxxxxxxx,[twitter] => on,[twitter_site] => xxxxxxxx,[plus-author] => -1,[plus-publisher] => ,[fbconnectkey] => xxxxxxxxxxxxxx)),[1] => head), Array ([0] => )) called at [/html/wp-includes/plugin.php:429]
10 do_action(wp_head) called at [/html/wp-includes/general-template.php:1634]
11 wp_head() called at [/html/wp-content/themes/u-design/header.php:40]
12 require_once(/html/wp-content/themes/u-design/header.php) called at [/html/wp-includes/template.php:441]
13 load_template(/html/wp-content/themes/u-design/header.php, 1) called at [/html/wp-includes/template.php:417]
14 locate_template(Array ([0] => header.php), 1) called at [/html/wp-includes/general-template.php:35]
15 get_header() called at [/html/wp-content/themes/u-design/archive.php:6]
16 include(/html/wp-content/themes/u-design/archive.php) called at [/html/wp-includes/template-loader.php:74]
17 require_once(/html/wp-includes/template-loader.php) called at [/html/wp-blog-header.php:16]
18 require(/html/wp-blog-header.php) called at [/html/index.php:17]

@jrfnl jrfnl added a commit to jrfnl/wordpress-seo that referenced this issue Dec 27, 2013
@jrfnl jrfnl Fix for issue #306 37b8cf2
@jrfnl
jrfnl commented Dec 27, 2013

@Pierinux Thank you for the back-trace. I've now been able to figure out what was happening.
A check for the wp error object was being done already in canonical(), but the returned variable wasn't always checked properly when received back. I've changed that now and send in a pull request.

Closing this issue in favour of pull request #501

@jrfnl jrfnl closed this Dec 27, 2013
@Pierinux

thanks to you for the very quick response and action 👍

@jrfnl
jrfnl commented Dec 27, 2013

You're welcome & let's hope this fix does the trick - as I can't seem to reproduce the error, I haven't been able to test it.

@Pierinux

if you get me a hint on how to get the fix I'll try it. it doesn't appear to be deployed in github tree yet.

@jrfnl
jrfnl commented Dec 27, 2013

If you look at the changed files in the pull request #501, you can see the changes I made, there are only a few and the one you really want is the change in the class-frontend.php file (the rest are redundancy).

Alternatively, you can go to the branch in my fork of this repo and download the complete plugin including the change.

@Pierinux

I preferred reinstalling the whole plugin from your branch, it works well, the problem is solved, thank you very much!

@jrfnl
jrfnl commented Dec 27, 2013

Thank you for confirming ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.