• Resolved Joelthecold

    (@joelthecold)


    Hello! Thank you for this fantastic plugin.

    We’re having problem with the meta title and description when we have a taxonomy term with the same term id as the start page id.

    $is_front_page = $this->is_front_page() || $args[‘page_on_front’] || $this->is_static_frontpage( $args[‘term_id’] );

    The method is_static_frontpage() returns true when the term_id is the same as the startpage id. This results in that the meta description and title for the category term get the startpage title and description and cannot be changed manually.

    Plugin version: 2.8.2
    Class: Generate_Title
    Method: build_title()
    Row: 445
    Problem line : $is_front_page = $this->is_front_page() || $args[‘page_on_front’] || $this->is_static_frontpage( $args[‘term_id’] );

    We dont want to change the core files of the plugin files, do you have any ideas on what to do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi @joelthecold,

    It’s uncommon that terms and post IDs collide.
    Are you using a plugin that maintains terms in its own own database table?

    Nevertheless, it’s very difficult to determine conflicting queries within WordPress.
    I can’t act on impulse with these issues, because they can then in return break other sites.

    Backstory
    The big problem is that this plugin has code debt that takes a lot of time to clean up.
    Luckily, 99% of the users won’t notice this. It’s an unfortunate combination of plugins that can cause issues.

    These issues can only happen when Post/Page/Term IDs collide.

    This is caused because many methods are “god methods”, that can be used anywhere at any time. They simply do too much, and they’ve become god-like because this plugin has grown too fast in functionality.

    In the past 3 versions I’ve slowly and pragmatically cleaned up a whole lot (i.e. 2.6 regarding query god classes and methods within, 2.7 regarding term meta, 2.8 regarding cache and sanitation, etc.). Most of these changes are unnoticed by most users.

    In the upcoming version a great part has been cleaned up regarding URL and Image generation. In the versions thereafter Title and Description generation will be cleaned up.

    Please try this
    I’d suggest changing that line to the following; if that works I’ll implement it in 2.9:

    $is_front_page = $this->is_front_page() || $args[‘page_on_front’] || ( $this->is_static_frontpage( $args[‘term_id’] ) && ! $this->is_archive() );
    

    Cheers!

    Thread Starter Joelthecold

    (@joelthecold)

    This fix appears to work perfectly actually. Will report if problems arise.

    Thread Starter Joelthecold

    (@joelthecold)

    One thing we also had to modify is the function for fetching the description aswell.

    method: get_custom_homepage_description()
    class: Generate_Description

    change on line 218:

    if ( $args['is_home'] || $this->is_front_page() || ( empty( $args['taxonomy'] ) && ($this->is_static_frontpage( $args['id'] ) && ! $this->is_archive() ) ) ) {

    Plugin Author Sybre Waaijer

    (@cybr)

    That’s good to hear! I’ll implement those for 2.9 ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Term gets the start page metatitle & description. Shares the same ID:s.’ is closed to new replies.