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™

Excluding S2Member from Homepage

s2Member Plugin. A Membership plugin for WordPress®.

Excluding S2Member from Homepage

Postby finky » January 26th, 2012, 8:37 am

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
User avatar
finky
Registered User
Registered User
 
Posts: 3
Joined: December 31, 2011

Re: Excluding S2Member from Homepage

Postby Eduan » January 26th, 2012, 11:09 am

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. :)
Last edited by Eduan on January 27th, 2012, 9:40 am, edited 1 time in total.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Excluding S2Member from Homepage

Postby Cristián Lávaque » January 26th, 2012, 10:47 pm

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.
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: Excluding S2Member from Homepage

Postby finky » January 27th, 2012, 9:19 pm

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?
User avatar
finky
Registered User
Registered User
 
Posts: 3
Joined: December 31, 2011

Re: Excluding S2Member from Homepage

Postby finky » January 28th, 2012, 11:28 am

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 :) !
User avatar
finky
Registered User
Registered User
 
Posts: 3
Joined: December 31, 2011


Return to s2Member Plugin

Who is online

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

cron