WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Meta descriptions broken since 1.2.7 (13 posts)

  1. Andrey Ovcharov
    Member
    Posted 1 year ago #

    I have blog in Russian (UTF-8) and after update the plugin to version 1.2.7 meta description and og:description fields shown in question marks.

    Rolled back to 1.2.5 and everything is working fine now.

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Andrey,

    that's weird as those versions didn't change much in that area. Where do you see the question marks and where don't you see those? Are they ok in the backend?

  3. Andrey Ovcharov
    Member
    Posted 1 year ago #

    Hello!

    In the backend I have the following template for Meta Description fileld: %%excerpt%%

    With WordPress SEO plugin version 1.2.5 I have the following meta value:
    <meta name="description" content="Не знаю, для кого как, а для меня культура - когда соседи мусор в окна не выкидывают."/>

    With upgrade to version 1.2.7 I got the following:
    <meta name="description" content="?? ????, ??? ???? ???, ? ??? ???? ???????? - ????? ?????? ????? ? ???? ?? ??????????. ?????? ???????? ?????????? ?? ?????? ????."/>

    I have some other plugins installed, but in this case the only difference is WordPress SEO version. I've checked the problem several times and it persists.

  4. Tanjim Shaikat
    Member
    Posted 1 year ago #

    I have faced the same problem with version 1.2.7

  5. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    That's weird, are you using UTF-8 everywhere? Including for your database?

  6. Andrey Ovcharov
    Member
    Posted 1 year ago #

    Please...

    wordpress-seo/inc/wpseo-functions.php, line 156

    v 1.2.5:

    '%%excerpt%%' => ( !empty( $r->post_excerpt ) ) ? strip_tags( $r->post_excerpt ) : substr( strip_shortcodes( strip_tags( $r->post_content ) ), 0, 155 ),

    v 1.2.7:

    '%%excerpt%%' => ( !empty( $r->post_excerpt ) ) ? strip_tags( $r->post_excerpt ) : utf8_encode( substr( strip_shortcodes( strip_tags( utf8_decode( $r->post_content ) ) ), 0, 155 ) ),

    I don't think it's database issue

  7. Andrey Ovcharov
    Member
    Posted 1 year ago #

    Why don't you use wp_trim_excerpt() function or something similar?

  8. vest24
    Member
    Posted 1 year ago #

    Use this:

    '%%excerpt%%' => ( !empty($r->post_excerpt) ) ? strip_tags( $r->post_excerpt ) : mb_substr( strip_shortcodes( strip_tags( $r->post_content ) ), 0, 155,'utf-8' ),

    I know Joost doesn't like it, but still you can give it a try...

  9. Bielousov
    Member
    Posted 1 year ago #

    Have the same issue for 1.2.8.2 but only for some posts (in Russian).
    Will use the fix from 1.2.5 above for now (reverting line 156 in wordpress-seo/inc/wpseo-functions.php fixed it) but I hope it won't be broken again after next plugin update.

    The page that was broken example

  10. Andrey Ovcharov
    Member
    Posted 1 year ago #

    The problem is still persist in 1.2.8.3

  11. waitxd
    Member
    Posted 1 year ago #

  12. Andrey Ovcharov
    Member
    Posted 1 year ago #

    Should I fix plugin code after each upgrade?

  13. anoriell
    Member
    Posted 1 year ago #

    Hey guys, can you fix that bug already?

    I've found three solutions for this problem:

    '%%excerpt%%' => ( !empty($r->post_excerpt) ) ? strip_tags( $r->post_excerpt ) : mb_substr( strip_shortcodes( strip_tags( $r->post_content ) ), 0, 155,'utf-8' ),

    '%%excerpt%%' => (!emptyempty($r->post_excerpt)) ? strip_tags($r->post_excerpt) : wp_html_excerpt(strip_shortcodes($r->post_content),155),

    and simply (this certainly works for Polish language I don't know what about the rest of them):

    '%%excerpt%%' => ( !empty( $r->post_excerpt ) ) ? strip_tags( $r->post_excerpt ) : substr( strip_shortcodes( strip_tags( $r->post_content ) ), 0, 155 ) ,

    These solutions work for Chinese, Polish, Russian and Romanian national characters. This is a genuine proof that they are good enough to be incorporated to your plugin, isn't it?..

    The plugin was updated about billion times this week and each time I (among many others) had to edit wpseo-functions.php manually (and I have 10 or so WordPress sites so it became a huge problem!)...

    Please, please, please fix this soon.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic