-
I’m surprised I haven’t seen this particular question here much more frequently (or at at all, really), so I have to think I’m assuming the wrong things or am otherwise implementing this part of UserPro incorrectly.
WIth that said, the issue: Using a simple 301 htaccess redirect, I have author.php going to the UP profile page. Not the best practice, but for lack of another reliable way, it works. The problem occurs when a username has a dot in it–as many Facebook usernames do: e.g., james.joyce. By default, WordPress themes take the dot and converts it to a dash, so james.joyce is generated as james-joyce at author.php and therefore results in an “not found” error in the UP profile.
It’s such a basic thing that I know I’m missing something obvious. What is it?
Thanks!
Hi foreigner,
UserPro does not convert the dot to dash. You can use the ID permalink as a workaround for now.
Hi. Thanks for the reply. I’d already tried using the ID permalink, but author.php grabs the username as recorded in the WordPress installation–it does that in every theme I’ve tried so far, including the basic Twenty Fourteen. I’m nevertheless very much enjoying working with UserPro and hope there’s a fix in the near future for this issue.
Thanks again.
Hi Ahmed. Just a follow-up: Your code in the bbpress integration tutorial works perfectly with all usernames, whether originally dotted or not. Maybe something like this can be done with author.php. I realize it’s not the same, since bbpress uses a uniform code, while author.php pages will differ somewhat among themes (with the exception that they all seem to convert dots to dashes), so maybe a sample code? I know you’re very busy with continuous improvements and enhancements for UP, and I write this as just one possible solution at some point. Thanks.
Which bbpress code you refer to? for bbpress I simply change their profile link to userpro profile links. In this case it’s the opposite you want author pages to redirect to userpro profiles.. well you know what!! You can benefit from this hook, which has example to convert all author archives to userpro profile links:
http://userproplugin.com/userpro/docs/api.html#userpro_user_profile_url
Right–that was exactly the bbpress integration I was referring to. And I had looked–but not seen–that author code you refer to. Will give it a try. Thanks!
Hi again. The code is very handy but unfortunately does not address the main issue. I’ll try to do a better job of explaining by using the example of a WP Facebook Login plugin located here: http://wordpress.org/plugins/wp-fb-autoconnect/
I used this plugin last year before the introduction of UserPro. The author notes: “Legacy Format (i.e. John.Smith) is Not Recommended. Although the original ‘BuddyPress-friendly’ username format included a period, I later learned that this creates issues with author links in WordPress. I’ve left the option here for legacy support, but advise against using it (unless you have only one author on your blog, in which case Facebook-connected users won’t have author links and so it doesn’t matter).” The issues with the author links he mentions are what I’m referring to, as UserPro imports the period as-is when a user connects, and it is this period that is breaking the author links in the blogs (I use UserPro primarily for multi-author blogs). The plugin I reference converts the period in the username to an underscore for author links.
I use the example of the plugin only to illustrate the issue, as it has only one main function and UserPro has many capabilities, and the two cannot be compared otherwise. Using the user ID doesn’t work, as the issue occurs at the moment the username is imported into WordPress by UserPro’s Facebook connect.
Thanks!
So what are you trying to accomplish? What code do you want me to add in UserPro?
Hi. What I’m trying to accomplish: To have blog profiles whose facebook names have a dot in them connect to the UserPro profile (currently not possible because of the ‘ . ‘, as explained above).
I would think the most straightforward way of accomplishing this is to change any instance of a (Facebook) dot to an underscore, i.e., ‘ . ‘ to ‘_’ . I tested this manually in the wp_users dbt. This change would have to occur the moment a user on a UP-powered site logs in/registers via Facebook so that Facebook user steve.jobs is registered as WordPress user steve_jobs.
I hope I’ve made the “why” clear; if not, I’ll gladly send you my admin login credentials so that you can see what I’m referring to. For those who prefer the dot, maybe add an option to use it (although I can’t imagine why anyone would prefer the dot unless they have some special setup). I raise this as “my problem,” but I sincerely think it would make UserPro even better, since WordPress by default doesn’t like dots in author names when linking to a profile page.
Thanks.
Another way to look at it: The dot works with BBPress (which I use) and BuddyPress (from what I’ve seen–I don’t use BuddyPress)–but not with author links. The underscore (in place of the dot) works with everything in WP.
Added:
I’m actually surprised that no one else has brought this up (in fact, I thought it was just me until I remembered that Facebook plugin). Maybe because most don’t use multi-author blogs or don’t care if some author names (the ones with the dots) link directly to the UserPro profile page–I don’t know. But because the UP profiles are so much nicer than what you can find on any theme, I do think it’d be a big plus if every blog author name linked directly to the UP profile.
Just to update: I looked more closely at the demo site and then changed the permalink for users to “First and Last Name” which replaces the period or dot with a hyphen, and the author links now work. The downside, of course, is that stevenjobs and steven.jobs (different users on Facebook) would each have the same author link–so presumably, one would replace the other. Anyway, for now it’s a workaround, and I know you have a lot of work as you continue to develop UserPro–which, by the way, I very much appreciate, as I’m sure most of your customers do.
In sum, I found a solution for the moment and will let you work in peace 😉 Thank you!
Hi Foreigner,
Does this problem only happens when you need author links to work?
Hi Ahmed. Thanks. Yes. Author links automatically default to using a hyphen when a period/dot is in the username. I’ve tried this with at least 7 themes, including Twenty Ten, Twenty Fourteen, etc, which is why I’m assuming it’s default WordPress behavior for author links.
You must be logged in to reply to this topic.