WordPress.org

Forums

[resolved] [Plugin: Yet Another Related Posts Plugin] post_body_keywords and strip_tags (2 posts)

  1. DamonCandoEnt
    Member
    Posted 6 years ago #

    A client of ours is using this plugin on a WP site that has a good deal of embeds (youtube). The post_body_keywords function in keywords.php doesn't strip_tags and was causing queries like this...

    SELECT ID, post_title, post_date, post_content, (MATCH (post_content) AGAINST ('param hl 0xcfcfcf 0xb1b1b1 color1 color2 en embed true center fs v allowfullscreen height 0 1 width object com value'))

    Changing

    return yarpp_extract_keywords($post->post_content);

    to

    return yarpp_extract_keywords(strip_tags($post->post_content));

    helped reduce mysql usage quite a bit.

    thanks!

  2. @DamonCandoEnt - I kept procrastinating from properly fixing this, but you caught me. ;p

    You are right, for most blogs, the strip_tags solution you give will work fine... but for some blogs, especially those that use some special typesetting language (like Markdown). These keywords were handled correctly pre-2.1... I just made a mistake, it seems. The fix will be in 2.1.4. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic