latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

503 (Invalid Key) after a few days

Home Forums Community Forum 503 (Invalid Key) after a few days

Tagged: , ,

This topic contains 14 replies, has 3 voices. Last updated by  Jason (Lead Developer) 4 years, 10 months ago.

Topic Author Topic
Posted: Friday Mar 2nd, 2012 at 8:06 pm #7125

Hello,

I have a page that autoloads and plays a media file. I am protecting the media file using an inline s2Member link so people cannot pass the link around and leech the file. I am using the following block of code in a PHP Code widget.

<div style="float: right;">
<?php
	$audiofile = "";
	if (is_page( 'classes-curriculum' )) {
		$audiofile = "LGJ-GSrimathi-UKS-1970-Thillana.mp3";
	}
	if (is_page( 'school' )) {
		$audiofile = "LGJ-GSrimathi-PMI-1964-Anuraagamule.mp3";
	}

	if ($audiofile != "") {
		$rkey = s2member_file_download_key($audiofile);
		$rfile = "http://www.rasika.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/s2member-file-download-key-".$rkey."/".$audiofile;
		echo jwplayer_tag_callback('[jwplayer config="AudioLoop" file='.$rfile.']');
	} 

?>
</div>

This worked for the first few days. I am not sure when it stopped working, but, it has been over a month since I last observed. Now, the embedded player does not play the file. Looking at the source code, the url being generated looks correct. However, if I try to browse to just that url, I get a “503 (Invalid Key)” error.

Here is the link to the page – http://www.rasika.org/school/ and the widget is in the area right above the footer. It is set to auto-play.

I have other pages with similar s2member links – except that those are for specific member levels. Those were created just a couple of weeks back and they still work fine.

I use WP-SuperCache plugin. I cleared the cache, cleared my browser cache and cookies and tried again. I also use CloudFlare on this site. I purged the cache there as well. I viewed the source of the page before and after clearing all caches. The inline s2Member key did not change. I am not sure if this is an indicator of a problem.

Please help.

Thanks,
MediocreFred.

List Of Topic Replies

Viewing 14 replies - 1 through 14 (of 14 total)
Author Replies
Author Replies
Posted: Saturday Mar 3rd, 2012 at 2:46 am #7153
Staff Member

Hi there. Thanks for reporting this important issue.
What version of s2Member are you running please?

Posted: Saturday Mar 3rd, 2012 at 10:21 am #7171

The version is 11120.

Posted: Saturday Mar 3rd, 2012 at 1:29 pm #7176
Eduan
Username: Eduan
Moderator

Hello Ravi, thanks for the follow-up.

Could you please try upgrading to the latest version?

The current version is v120301. Here are instructions on how to upgrade correctly:
s2Member® » Pro » Install/Upgrade Instructions

Hope this helps. :)

Posted: Saturday Mar 3rd, 2012 at 1:37 pm #7178

Updated S2Member and Pro to v120301. Flushed WP-SUperCache, browser cache and CloudFlare cache.

Same error. However, the inline key is different today from what it was yesterday.

Testing using the page in my link above, the generated url for jwplayer is:

http://www.rasika.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/s2member-file-download-key-0a90d7c50c3ddc717158813eb943c2a6/LGJ-GSrimathi-PMI-1964-Anuraagamule.mp3

I have verified that the files are still there in the s2-member-files folder.

Also tested the “restricted by member levels” files and they are still working ok. Here’s a sample link that works:

http://www.rasika.org/?s2member_file_download=access-s2member-level3/Varisas/01%20Introduction.mp3

Please let me know if you’d like access to either WP Admin or to the page with links that work.

Thanks,
MediocreFred.

Posted: Tuesday Mar 6th, 2012 at 12:51 am #7371
Staff Member

Thanks for the follow-up.

However, the inline key is different today from what it was yesterday.

Yes, that’s normal. A Key is a site-specific hash of the following.
So it will change once per day, for each user, for each file.

date("Y-m-d").$_SERVER["REMOTE_ADDR"].$_SERVER["HTTP_USER_AGENT"].$file

I don’t see anything wrong with the code sample you posted. It looks good. I’ve also been unable to reproduce this in our lab. If you can provide us with a Dashboard login, I’ll be happy to take a quick look for you.

Please submit those details here:
s2Member® » Private Contact Form

Posted: Tuesday Mar 6th, 2012 at 8:18 am #7443

Hi Jason,

I’ve submitted the Login details form. Please let me know if I can help navigate the site.

Thanks.

Posted: Wednesday Mar 7th, 2012 at 5:10 pm #7590

Hi Jason,

Just wondering – have you had a chance to look at this issue yet?

Thanks.

Posted: Thursday Mar 8th, 2012 at 3:42 pm #7647
Staff Member

Investigating this now. Thanks for your patience.

Posted: Friday Mar 9th, 2012 at 5:31 am #7707
Staff Member

Initial investigation completed, thanks for your patience.

So far I’ve been unable to determine the underlying cause of this on your installation. While I’m not aware of any bugs in this regard, I WAS able to reproduce the issue that you reported, on your installation.

Next Steps

In your recent form submission, you did not include FTP access. I’ll need you to provide us with FTP access so that we can run diagnostics, to determine the underlying cause.

s2Member® » Private Contact Form

Posted: Friday Mar 9th, 2012 at 8:40 am #7724

Hi Jason,

I’ve created an FTP account and submitted the form again. Since this is a live site, I hope your diagnostics don’t visually alter the pages (say, by writing debug messages to the page). If they need to do so, can you please create a new, unreferenced/unlinked page for your troubleshooting. Appreciate your help!

Thanks.

Posted: Friday Mar 9th, 2012 at 8:52 am #7726
Staff Member

Gotchya. Will do. Thanks.

Posted: Friday Mar 9th, 2012 at 3:26 pm #7743
Staff Member

Investigation completed. Thanks for your patience.

Upon further review, I find that your WordPress installation is running the CloudFlare plugin. This plugin creates a conflict with other plugins that attempt to read the value of $_SERVER["REMOTE_ADDR"] before its routine is processed (which can sometimes happen in early init action Hook routines).

I’ve corrected this on your site by modifying this file:
/wp-content/plugins/cloudflare/cloudflare.php at line #63

Find: add_action('init', 'cloudflare_init');
Change to: add_action('init', 'cloudflare_init', 1);

I’ve also notified the CloudFlare team about this issue.

Email To CloudFlare
Hi there. I’m a WordPress plugin developer for s2Member®. We have several clients reporting conflicts with CloudFlare for WordPress. Upon investigation of these issues, we find that your plugin rewrites the $_SERVER[“REMOTE_ADDR”] value, and understandably so. However, this rewrite needs to occur MUCH earlier in the Hook priorities list, so that other plugins attempting to read the value of $_SERVER[“REMOTE_ADDR”] on the init action Hook, get the *right* value.

Suggested modification:
cloudflare.php at line #63
Find: add_action(‘init’, ‘cloudflare_init’);
Change to: add_action(‘init’, ‘cloudflare_init’, 1);

Posted: Friday Mar 9th, 2012 at 3:48 pm #7749

Wow! Thanks very much for finding and fixing the issue! I really appreciate your help. I’ve verified that the link (and embedded JWPlayer) works fine now.

And thanks so much for being proactive and notifying CloudFlare to fix their code. Really nice to see WordPress plugin developers help improve other plugins as well. Definitely helps grow the WordPress ecosystem.

Thanks!

Posted: Friday Mar 9th, 2012 at 5:36 pm #7799
Staff Member

You’re VERY welcome.
FYI: CloudFlare wrote back. They’ll release an update shortly.

Viewing 14 replies - 1 through 14 (of 14 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.