cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
280 stars 83 forks source link

"Popular Posts" widget - current post link doesn't work #231

Closed justanotheranonymoususer closed 4 years ago

justanotheranonymoususer commented 4 years ago

Look at the screenshot below. I'm currently on the "Post2" page, and it has no "href" attribute in the "Popular Posts" widget and so is not clickable. I don't know whether it's on purpose, but it looks like a link, so it's counter intuitive, and it wasn't that way before.

image

justanotheranonymoususer commented 4 years ago

I see it's on purpose: https://github.com/cabrerahector/wordpress-popular-posts/blob/918ed643e910d6b526e9c5e9b3a2cf6ece10f078/changelog.md#320

Removes href attribute from link when popular post is viewed.

It doesn't make much sense and is not consistent with the native wordpress widget of recent posts.

justanotheranonymoususer commented 4 years ago

OK, I see that it's "fixed" here: https://github.com/cabrerahector/wordpress-popular-posts/commit/102f2e8e98342744c47513696ac6dc296730c464#diff-2e0956589ec8b870210a20b0a004c7cc

I don't know why the rel="nofollow", but it's good enough for me. Any estimation for a new version release date?

cabrerahector commented 4 years ago

Hi there,

I don't know why the rel="nofollow" (...)

For SEO purposes: when an indexing bot (eg. googlebot) checks the page it will find that there's a link that points to itself, creating a circular reference. By adding rel="nofollow" we ask it to ignore that link.

Any estimation for a new version release date?

Been meaning to release 5.0 for some time now but work & life in general have gotten in the way. There are also some recent PRs I want to review as well before pushing 5.0 into the official repo. So -as you can probably imagine by now- 5.0 won't be officially launched anytime soon. I do plan to release it before the year ends though, just don't have a fixed date yet.

justanotheranonymoususer commented 4 years ago

Hi :)

For SEO purposes: when an indexing bot (eg. googlebot) checks the page it will find that there's a link that points to itself, creating a circular reference. By adding rel="nofollow" we ask it to ignore that link.

Why would you think it will create a circular reference? Besides, the "recent posts" widget of wordpress doesn't add this, so why would you?

5.0 won't be officially launched anytime soon

I'll fix it locally. Thanks for the reply.

cabrerahector commented 4 years ago

Why would you think it will create a circular reference?

Because it does. As I explained earlier it's a link that points to itself, hence a circular reference.

After some thought though, it's pretty normal to find these kind of self-referencing links on basically every website out there. I don't think Google nor other search engines will necessarily penalize us for that so I might just remove that rel="nofollow" attribute from the link tag so thank you for bringing that up to my attention.

Besides, the "recent posts" widget of wordpress doesn't add this, so why would you?

Following this kind of logic, maybe WPP shouldn't have the ability to display posts thumbnails because the stock Recent Posts widget doesn't? :P

justanotheranonymoususer commented 4 years ago

hence a circular reference.

Well yeah, but the web is full of cycles. At the very least, you can go to the index page and then back, creating an A -> B -> A cycle, or as you name it, "circular reference".

Following this kind of logic, maybe WPP shouldn't have the ability to display posts thumbnails because the stock Recent Posts widget doesn't? :P

Maybe. Depending on the use case, I guess, I never used them. I like your plugin since it looks like a natural addition to the default wordpress look and feel, as if it's part of the original setup.

Speaking of which, I also removed the title="{$post_title_attr}" attribute locally, since the Recent Posts widget doesn't have it (inconsistency), and it's silly anyway, since you show a tooltip with the exact same text as is already there.

cabrerahector commented 4 years ago

I like your plugin since it looks like a natural addition to the default wordpress look and feel, as if it's part of the original setup.

That's the intention so thanks for the kind words. I'm glad you found my plugin useful! Then you'll probably like version 5.0 even more once you try it out (assuming you're not using the Github version already, that is.)

Speaking of which, I also removed the title="{$post_title_attr}" attribute locally, since the Recent Posts widget doesn't have it (inconsistency), and it's silly anyway, since you show a tooltip with the exact same text as is already there.

There's a good reason why the title attribute is there: usability.

As you may have already noticed, the plugin offers the ability to shorten the title to n characters. Say, for example, that the resulting HTML output would be something like this:

<ul class="wpp-list>
    <li>
        <a href="https://www.example.com" title="My very long post title">My very long...</a>
    </li>
</ul>

Without the title attribute, hovering on the link would display a tooltip with the text "My very long..." which isn't quite useful for the reader. With the title present, the user can read the entire title.

The Recent Posts widget, on the other hand, always displays the full post title so in that case it makes sense to not include the title attribute to avoid being redundant.

Now, with all this I realize that I could have the plugin exclude it if the title attribute is exactly the same as the title being displayed on screen to avoid being redundant so again thanks for your comments.

justanotheranonymoususer commented 4 years ago

I'm glad you found my plugin useful!

Thanks for creating it!

the plugin offers the ability to shorten the title to n characters

Then I'd say you should add a tooltip only if the title is truncated. Or at the very least only when the truncation is enabled.

cabrerahector commented 4 years ago

Yep, I was about to say that as well but hit the Comment button by mistake and even reopened the issue too :P I'll add that change to my already very long To-Do list.