Problem with Twitter link and Twitter Cards
-
Hi
I’m having a problem with WP Biographia and Twitter Cards. To be able to properly show my author Twitter link, I need to input the complete link as in https://twitter.com/THEUSERDISPLAYED. However, doing this creates a problem with Twitter Cards, as it detects that to be the user itself, instead of @THEUSERDISPLAYED.
Is there a way to simply input the @ into the profile field instead of the whole URL so WP Biographia doesnt mess with Twitter Cards?
Thank you
-
Hi … how are you supporting Twitter Cards on your site? Via a plugin or coded into your theme’s templates? Is there a publicly accessible site where I can see the problem? What version of WordPress and WP Biographia are you using? What exactly is happening?
In other words, I need a bit more information to work with; which is why I wrote https://www.ads-software.com/support/topic/wp-biographia-problem-or-question-please-read-this-first to try and get that information when people post.
-Gary
Hey!
Sorry about that, I thought it would be a easy thing to fix so I didn’t provide those details. My bad.
I’m using wordpress 3.5.1 with Buddypress and wp biographia 3.3.1. I’m supporting Twitter Cards via Yoast WordPress SEO plugin. You can check the code at https://www.frecuenciamedica.org
Since WP Biographia asks that you put your full twitter URL, when my users register they are asked to provide their whole URL to twitter so it is diplayed. When I use Twitter Cards, that info is displayed incorrectly as a URL instead of a @, like this
<meta name=”twitter:card” content=”summary”>
<meta name=”twitter:site” content=”@frec_medica”>
<meta name=”twitter:creator” content=”@https://twitter.com/fjbengoat”>Instead of that full URL, I need to WP Biographia to use twitter usernames so it doesn’t mess with Twitter Cards.
Thank you
Oh dear. I’ve taken a look at this and there’s a fundamental clash between how WP Biographia and Yoast’s WordPress SEO plugins treat the Twitter account.
Both plugins add support for Twitter to a user’s profile via the WordPress
user_contactmethods
filter hook. This is as it should be; this hook is a standard part of the WordPress API.WP Biographia’s implementation of a user’s Twitter profile is via a fully qualified path to the user’s profile, so my Twitter profile would be specified as
https://twitter.com/vicchi
.WordPress SEO’s implementation of a user’s Twitter profile is via just the profile name, such as
vicchi
.This is the clash. In WP Biographia, any contact URL, including Twitter, in a user’s profile is just that, a fully qualified domain name and path to a specific URL on the internet. In WordPress SEO, the Twitter contact is just the profile name and the plugin assumes that this user profile field is only going to be used for Twitter cards via the WordPress SEO plugin.
Depending on which order you install (or update settings) WP Biographia and WordPress SEO in, one of the plugins is going to overwrite the Twitter settings of the other and effectively break it.
Now to be completely fair, the WordPress API documentation is ambiguous on what should actually be in a user’s profile contact methods. It’s assumed that the user’s email address will be used as part of a
mailto
URL and it’s also assumed that the user’s website will be an FQDN. But beyond that, the default set of contact methods (AIM, Yahoo IM and Jabber/Google Talk) have no proscriptions on what needs to be in these fields, so there’s a matter of personal interpretation as to whether this should be a profile identifier, or a FQDN to that contact method’s profile.I’ve made the assumption that they should be FQDNs as this will support interoperability with other parts of WordPress and other plugins. Yoast has made the assumption that the Twitter contact link will just be the profile name.
Both valid assumptions, but both mutually incompatible with the other.
I’m not sure where to go with this; if I change my plugin, it may break other plugins, but if Yoast changes his, the same may happen.
I think I’ll post in the WordPress SEO support forum and try and see what Yoast thinks. There’s no quick and easy fix on this though I’m afraid.
-Gary
Just posted on the WordPress SEO forum; see https://www.ads-software.com/support/topic/plugin-clash-on-user-profile-twitter-contact-method?replies=1
-Gary
Still no reply from Yoast after almost 4 weeks; I’ve pinged him on Twitter to try and get his attention.
-Gary
So 2 months have passed and there’s been no reply from Yoast either on Twitter or on the WordPress SEO forum. If there was a forum setting for can’t fix due to another plugin or theme it would be very tempting to mark this thread as just that. But there isn’t and besides which, this is bugging me.
As a result, the next version of WP Biographia, which is slowly coming together, will have a workaround for this.
As I mentioned in an earlier post ..
Now to be completely fair, the WordPress API documentation is ambiguous on what should actually be in a user’s profile contact methods. It’s assumed that the user’s email address will be used as part of a mailto URL and it’s also assumed that the user’s website will be an FQDN. But beyond that, the default set of contact methods (AIM, Yahoo IM and Jabber/Google Talk) have no proscriptions on what needs to be in these fields, so there’s a matter of personal interpretation as to whether this should be a profile identifier, or a FQDN to that contact method’s profile.
In the current version of the plugin Twitter is supported by adding a field called
twitter
into a user’s profile via theuser_contactmethods
filter hook. It’s the name of this field that’s causing the clash between WP Biographia and WordPress SEO. WP Biographia assumes that this is a fully qualified URI (https://twitter.com/user), WordPress SEO assumes that this is just the Twitter profile name, without the leading@
.The next version of WP Biographia will prevent this clash (and other clashes on user profile contact fields) by name-spacing the fields the plugin adds. So rather than adding a field called
twitter
, it’ll add a field calledwpb_twitter
. For new plugin installs, this will happen at installation/activation time. For existing installs, the plugin will automagically detect the existing fields in the user’s profile and upgrade the field names.It’s not an ideal situation, as you’ve been waiting for over 2 months for a fix for this, but I don’t see the other author being at all responsive and this will fix the problem for a user’s Twitter id as well as preventing any such clashes with other contact fields and with other plugins. Unless of course, another plugin decides to use the
wpb_
namespace but that’s circumstances that are way beyond my control.I’ve got no firm timescales for the next release of WP Biographia; I’m plugging away at the code as and when I have the time. But this is progress, of a sorts and at least it only relies on me to do the work and not someone else.
-Gary
The next version of WP Biographia will prevent this clash (and other clashes on user profile contact fields) by name-spacing the fields the plugin adds. So rather than adding a field called twitter, it’ll add a field called wpb_twitter. For new plugin installs, this will happen at installation/activation time. For existing installs, the plugin will automagically detect the existing fields in the user’s profile and upgrade the field names.
So I’ve gone ahead and implemented this change and, as far as I can tell, this now works without clashing with Yoast’s Twitter Cards implementation.
The next version of WP Biographia, which will become v4.0, isn’t quite ready yet. There’s a few more new features I need to add. If you want to live on the bleeding edge, you’ll find the beta version here: https://github.com/vicchi/wp-biographia/tree/v3.3-changes but I’d recommend testing on a separate WordPress install and not your live install.
For now, I’ll flag this as resolved.
- The topic ‘Problem with Twitter link and Twitter Cards’ is closed to new replies.