Bugs in Global site search and global site tags plugins

Hi!

I’m running a WPMU blog in a subdir, "domain.tld/wpmuinstall"

Both mentioned plugins doesn’t work in such an environment. The reason for this is the variables $global_site_tags_base and $global_site_search_base which refers both to post SLUG/"post name" _and_ subdir.

I’ve fixed it quick & dirty in global site search by editing line 189 like this:

if ( $post->post_name == "site-search" ) {

But global site tags is referring to $global_site_tags_base everywhere, and I’m guessing there would be more than me having this problem. It should get fixed centrally.

  • Ovidiu
    • Code Wrangler

    downloaded the last version right now, and have some other problems: http://screencast.com/t/CDo9Pv7IZ

    Please note the weird >> symbol after the page, see screen shot

    Besides, the page was renamed to Etichete, the Romanian word for Tags but it keeps being displayed as TAGS on the edit page :slight_frown:

    besides, check it out here: http://zice.ro/tags/ this is the global tags page.

    2 problems I see:

    – the title html looks broken

    – there are certain tags in the cloud, which yield no resutls when I click o nthem, how come?

  • Andrew
    • Champion of Loops

    Hiya,

    Besides, the page was renamed to Etichete, the Romanian word for Tags but it keeps being displayed as TAGS on the edit page :slight_frown:

    Try deleting the page and the recreating it. Note that the slug *must* be "tags" unless you change the option at the top of the plugin file.

    the title html looks broken

    I’m not sure what’s causing that one yet. I can’t seem to reproduce the problem even with the same theme.

    Do you have any SEO plugins installed?

    there are certain tags in the cloud, which yield no resutls when I click o nthem, how come?

    When did you install the post indexer plugin? Older versions had a bug that resulted in the tag count being off by a good bit. This was recently fixed but the only way to get rid of the problem is to clear the post indexer data.

    The alternative is to add the tags displaying zero posts to the banned tags list on Site Admin > Options.

    Thanks,

    Andrew

  • Ovidiu
    • Code Wrangler

    ok, did the following:

    recreated the page: the title is ETICHETE and the slug is tags but in the back end it still shows up funny as seen in the last screenshot… nevermind. some weird translation part of wpmu or a plugin seems to be kicking in here.

    – regarding the broken H1 title. here is the sourcecode of that part:

    <div class="post-title">
    <h1><a href="http://zice.ro/tags/" rel="bookmark" title="<a href="http://zice.ro/tags/">Tags</a> » <a href="http://zice.ro/tags/instructiuni/">Instructiuni</a>"><a href="http://zice.ro/tags/">Tags</a> » <a href="http://zice.ro/tags/instructiuni/">Instructiuni</a></a></h1>

    </div>

    the template should obviously be ok, as its the default page template and all other pages look ok !?

    regarding the 0-count tags, I had updated the post indexer a couple of days ago, will delete the old indexer data or can I jsut outwait it until the stale data grows old and is automatically "discarded"?

  • Andrew
    • Champion of Loops

    Hiya,

    the template should obviously be ok, as its the default page template and all other pages look ok !?

    I just did a fresh install of WPMU 2.8.4 with nothing but the Edublogs theme and post indexer/tags plugins and I still can’t reproduce this issue.

    Can you please (temporarily) remove all plugins except this one and the post indexer to see if another plugin is trying to alter the post or page titles as well? Other than that I really can’t think of anything else that could be causing this problem.

    regarding the 0-count tags, I had updated the post indexer a couple of days ago, will delete the old indexer data or can I jsut outwait it until the stale data grows old and is automatically "discarded"?

    The bad data will eventually work out of the system but I have no idea how long that could take. What I would do is just temporarily block the tags having the 0 count issue for a week or two and then unblock them. Basically just hide those tags while the issues are resolved.

    Thanks,

    Andrew

  • Ovidiu
    • Code Wrangler

    Unfortunately I can’t turn off all plugins for testing right now, but I had a look at the plugin code, I think the error comes from this part of the plugin:

    if ( $post->post_name == $global_site_tags_base && $post_ID == $post->ID) {
    $global_site_tags = global_site_tags_url_parse();
    if ( $global_site_tags == 'landing' ) {
    $title = '<a href="http://' . $current_site->domain . $current_site->path . $global_site_tags_base . '/">' . __('Tags') . '</a>';
    } else {
    $tag_name = $wpdb->get_var("SELECT cat_name FROM " . $wpdb->base_prefix . "sitecategories WHERE category_nicename = '" . $global_site_tags . "'");
    if ( $global_site_tags > 1 ) {
    $title = '<a href="http://' . $current_site->domain . $current_site->path . $global_site_tags_base . '/">' . __('Tags') . '</a> ? ' . '<a href="http://' . $current_site->domain . $current_site->path . $global_site_tags_base . '/' . $global_site_tags . '/">' . $tag_name . '</a> ? ' . '<a href="http://' . $current_site->domain . $current_site->path . $global_site_tags_base . '/' . $global_site_tags . '/' . $global_site_tags . '/">' . $global_site_tags . '</a>';
    } else {
    $title = '<a href="http://' . $current_site->domain . $current_site->path . $global_site_tags_base . '/">' . __('Tags') . '</a> ? ' . '<a href="http://' . $current_site->domain . $current_site->path . $global_site_tags_base . '/' . $global_site_tags . '/">' . $tag_name . '</a>';

    particularly these parts: $global_site_tags_base . '/">' . __('Tags') – looks to me like that part is generating this title: Tags">Tags as you cna see on this example page: http://zice.ro/tags/

    as to why I can only speculate. I am not sure which line exactly generates the title for the default tag page, if you help me out, we can change that code a little and see what it outputs…

    this is the generated sourcecode of the title on the page: `<h1><a href="http://zice.ro/tags/&quot; rel="bookmark" title="<a href="http://zice.ro/tags/">Tags</a>"><a href="http://zice.ro/tags/">Tags</a></a></h1&gt;

    `

  • Ovidiu
    • Code Wrangler

    partially solved the mistery:

    I was/am using the old edu-clean theme.

    The page.php template had a part that looked like this for displaying hte title of a pge:

    <div class="post-title">

    <!--<h1>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></h1>-->

    <h1>" rel="bookmark"><?php the_title(); ?></h1>

    </div>

    All I had to do to fix the problem was comment out the title part, see code above. No idea why but no all is good :slight_smile:

    The remaining mistery is though why are there >> after my tag page in the page view??? see here: http://www.screencast.com/users/ovizii/folders/Jing/media/7ed3076d-0840-49f6-9872-c73e67300407