PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Facebook "Like" button defaults to Member Option Page

s2Member Plugin. A Membership plugin for WordPress®.

Facebook "Like" button defaults to Member Option Page

Postby johnsamwallace » June 7th, 2011, 6:24 am

Is it simply not possible for a logged-in user to "Like" a protected page. Whenever a logged-in user "Likes" a protected page, Facebook grabs the meta for the Member Option Page and posts this to her Facebook timeline. When examining the source code for my page, all of the og meta data is displaying correctly, including the URL to the protected page, yet Facebook posts the Member Option page. Anyone found a solution for this?
User avatar
johnsamwallace
Registered User
Registered User
 
Posts: 5
Joined: June 7, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby Cristián Lávaque » June 7th, 2011, 12:32 pm

Apparently Facebook doesn't just post the data you give it, it wants to actually view the page you're liking. The problem is that to s2Member, Facebook is a visitor without the access required to view the page.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Facebook "Like" button defaults to Member Option Page

Postby johnsamwallace » June 7th, 2011, 1:19 pm

OK, thank you for answering my question! In that case I need to create an alternate "single" template showing an excerpt that is served up to users who are not logged in. I could us the s2member API to put conditionals into each post but that would be a high-maintenance solution. I could add the conditionals to the single page loop but that would not allow me to control the level of access for each post from the admin panel dialog box. Also considering adding some kind of loop to the member option page template but I'm not quite sure how I'd parse the information to get the desired result. Any suggestions on the best approach to accomplish this. Surely I'm not the only one who is facing this.
User avatar
johnsamwallace
Registered User
Registered User
 
Posts: 5
Joined: June 7, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby Cristián Lávaque » June 7th, 2011, 2:11 pm

Conditionals may be an elegant solution, then those who aren't logged in get the snippet, enough for the Facebook share/like.

Either you edit your posts to use this, or modify each post/page with a WordPress hook based on the user's access permissions. Hmm...
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Facebook "Like" button defaults to Member Option Page

Postby johnsamwallace » June 7th, 2011, 3:01 pm

You're thinking down the same path as I am.
User avatar
johnsamwallace
Registered User
Registered User
 
Posts: 5
Joined: June 7, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby mannclann » June 7th, 2011, 4:55 pm

Being as you guys are talking above my head maybe if you come up with an "elegant" solution and you were willing to share, you would have my undying gratitude.

Thanks

Rick
User avatar
mannclann
Registered User
Registered User
 
Posts: 6
Joined: August 19, 2010

Re: Facebook "Like" button defaults to Member Option Page

Postby Jason Caldwell » June 13th, 2011, 10:53 pm

Hmm.. Yea, this is a tough one to deal with.

I have some experience with the Facebook APIs, and I can tell you that Facebook needs to make a full request to the actual page, where it pulls several details. Since the page is protected from public view, it's locked down whenever Facebook attempts to collect those details. I suppose we might be able to allow Facebook to access these pages, perhaps with a configuration area that excludes certain User Agents, as configured by the site owner ( optionally )? Open to feedback on this please. @TODO?

For now, you could do something like this.
Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter 
("ws_plugin__s2member_is_systematic_use_page", "my_filter");
function my_filter ($is_systematic = FALSE)
    {
        if (stripos ($_SERVER["HTTP_USER_AGENT"], "facebookexternalhit") !== false)
            return true;
        else
            return $is_systematic
;
    }
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Facebook "Like" button defaults to Member Option Page

Postby johnsamwallace » June 14th, 2011, 5:53 am

Thanks for putting this one in your pipe! I'll try the hack.
User avatar
johnsamwallace
Registered User
Registered User
 
Posts: 5
Joined: June 7, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby Jwrbloom » August 12th, 2011, 1:52 pm

Did that work?
User avatar
Jwrbloom
Registered User
Registered User
 
Posts: 55
Joined: May 23, 2010

Re: Facebook "Like" button defaults to Member Option Page

Postby johnsamwallace » August 12th, 2011, 4:13 pm

I ended up creating a page template, using the s2member API, that showed excerpts of posts for non-logged-in users. I'm not completely happy with the solution but it's working for now.
User avatar
johnsamwallace
Registered User
Registered User
 
Posts: 5
Joined: June 7, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby sijo55 » October 18th, 2011, 5:38 pm

Do we get a fix for this or is there a solution available?

Regards
sijo
----------
Regards
sijo
(WP 3.3.1 - ANP 2.1.6 - S2M Pro 111220)
My site
User avatar
sijo55
Registered User
Registered User
 
Posts: 37
Joined: September 4, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby Jason Caldwell » October 20th, 2011, 5:55 pm

Thanks for your inquiry.
No, nothing formally added to s2Member's source code in this regard yet. Mainly because this would create a potential security hole in s2Member, since the HTTP_USER_AGENT could be forged by an attacker. Until we find a better way to allow Facebook in, under special circumstances, you'll need to implement something along the lines of what I posted here: viewtopic.php?f=4&t=10070&p=48310#p20646
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Facebook "Like" button defaults to Member Option Page

Postby sijo55 » October 21st, 2011, 7:01 am

I have tried this with no luck.
If a user click on the 'Like' button on an article for members, then my Membership Options Page is shown on Facebook as 'Liked', not the actual article page.
I need a fix for this.. please!
----------
Regards
sijo
(WP 3.3.1 - ANP 2.1.6 - S2M Pro 111220)
My site
User avatar
sijo55
Registered User
Registered User
 
Posts: 37
Joined: September 4, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby sijo55 » October 21st, 2011, 8:00 am

I have finally got it to work with some changes to Jason Caldwell code:

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter ("ws_plugin__s2member_is_systematic_use_page", "my_filter");
function my_filter ($is_systematic = FALSE)   
{       
//if (stripos ($_SERVER["HTTP_USER_AGENT"], "facebookexternalhit") !== false)           
if (stripos ($_SERVER["HTTP_USER_AGENT"], "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)") !== false)
return true;       
else           
return $is_systematic;   
}
?>
----------
Regards
sijo
(WP 3.3.1 - ANP 2.1.6 - S2M Pro 111220)
My site
User avatar
sijo55
Registered User
Registered User
 
Posts: 37
Joined: September 4, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby XHIBIT » November 25th, 2011, 7:37 am

This code is not working for me, theres got to be another way because half of my subscribers I get directly from facebook "like" posts...the rest are from twitter. With this option to reach out to new potential subscribers taken away it defeats the purpose of using this plugin altogether.
User avatar
XHIBIT
Registered User
Registered User
 
Posts: 1
Joined: November 25, 2011

Re: Facebook "Like" button defaults to Member Option Page

Postby pettedemon » January 11th, 2012, 3:29 pm

It doesn't work for me... can we create a user for the plugin ?
User avatar
pettedemon
Registered User
Registered User
 
Posts: 2
Joined: January 11, 2012

Re: Facebook "Like" button defaults to Member Option Page

Postby Jason Caldwell » January 14th, 2012, 9:36 pm

Thanks for the follow-ups here.
Content protected by s2Member is not available for anyone without proper access to that content, and this includes bots and silent HTTP requests made by 3rd party services such as Facebook. This is not a bug, it's the intended behavior. If your site survives on traffic from Facebook, I would suggest making sure that key areas of your site that need to be indexed by search engines or shared through social networks remain publicly available (i.e. not protected by s2Member). Anything protected by s2Member, is by definition, NOT available publicly.

There have been some attempts made by myself and others in this forum to circumvent this under special circumstances (you'll find code samples for that above). However, please let it be known that none of these would be considered "safe" ways to deal with the issue. The proper way to deal with this (in my opinion) is to make some of your content available publicly, so that it CAN be shared through social networks. Anything else that you make off limits to the public, is not going to work with social network APIs like the Facebook "Like" feature, because that content is available only to "Members" of your site with a Username/Password that authenticates them for access.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Facebook "Like" button defaults to Member Option Page

Postby pettedemon » January 16th, 2012, 1:38 am

But there isn't not way to create an user to associate to s2Memebers? Facebook is now the best share instrument, the right way is enable it...
Thanks
User avatar
pettedemon
Registered User
Registered User
 
Posts: 2
Joined: January 11, 2012


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron