Page 1 of 1

Excluding S2Member from Homepage

PostPosted: January 26th, 2012, 8:37 am
by finky
First of all, S2Member is great! I was struggling with the easiest membership plugins out there, because they wouldn't want to work the way I needed them or were lacking important features. I am quite happy with free s2member and all the video tutorials. This is great!

However (now here is the sad part), s2member slows my site down very much. I could save some loading by using w3totalcache and jQuery lazy load. You can see it for yourself on http://dazugelernt.de

Here's my question / idea:
Since the Homepage is the most important page for any user to see, it should load very quickly. Also, since the user does not yet have to be logged in, the loading of any s2member scripts is obsolete then. When I am not yet linking to any protected content on my site, this should not be a problem.

How can I exclude s2member from being loaded into the <head> when a user is not logged in? I know it should work like this (probably I've made some mistakes there):
Code: Select all
<?php
if ( array (is_front_page(), is_user_logged_in() ) ) {
    insert s2member in the header
} else {
    do nothing
}
?>


Can you help me put this to work?

Cheers,
Alex from Germany

Re: Excluding S2Member from Homepage

PostPosted: January 26th, 2012, 11:09 am
by Eduan
Could you please try using Quick Cache instead of W3 Total Cache?

Quick Cache is a cache plugin by Jason Caldwell (s2Member's Lead Developer), it has been tested and it's designed to work correctly with s2Member.

You must deactivate W3 Total Cache for Quick Cache to work correctly.

Hope this helps. :)

Re: Excluding S2Member from Homepage

PostPosted: January 26th, 2012, 10:47 pm
by Cristián Lávaque
Thanks for the kudos, Alex! :)

To disable s2Member in the homepage, you could try Plugin Organizer. http://wordpress.org/extend/plugins/plugin-organizer/

I agree that Quick Cache would be a good choice for caching. https://wordpress.org/extend/plugins/quick-cache/

Now, the slowness may be caused by another plugin, or the conflict between to of the plugins you have, or maybe you have too many plugins installed/active. I suggest that you test deactivating the other plugins one by one and test the speed after each, see if you find the problem that way.

I hope that helps.

Re: Excluding S2Member from Homepage

PostPosted: January 27th, 2012, 9:19 pm
by finky
Thanks for the tip with plugin-organizer. However, I will need to know the right file to put the if_logged_in parts in. That would be the file putting all the s2member stuff into wp_head(). Can you point me to it?

Re: Excluding S2Member from Homepage

PostPosted: January 28th, 2012, 11:28 am
by finky
Sorry, me again :P

Basically, what I want to have is:

If is_frontpage and user is logged in, insert/load s2member into wp_head,
if user is not logged in, do NOT use/load any s2member into wp_head().

Can somebody do that for me? I am willing to share credit links for it! You guys are the bestest :) !