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.

Jason (Lead Developer)

Staff Member

My Latest Replies (From Various Topics)

Viewing 9 replies - 1,901 through 1,909 (of 1,909 total)
Author Replies
Author Replies
Posted: Wednesday Feb 8th, 2012 at 6:35 am #4443
Staff Member

I don’t know why user metadata isn’t just added on as fields in the users table. As such, perhaps I should just use S2M on our smaller communities and clean out all those extra entries.

I think if each of us designed our own software application we would NOT do it this way (i.e. with the wp_usermeta table being used for so many things). However, as a “framework”, WordPress uses the wp_usermeta table to allow plugins/themes to extend WordPress in creative ways without damaging or modifying the underlying table structure that powers a site (e.g. which might lead to even worse situations and/or mass confusion).

So while the wp_usermeta table is not ideal for every application, it’s a middle ground between usability, performance, extensibility. I would stick with WordPress a bit longer and see if you can iron out some of these optimization issues. Any time you’re running a site with that many users, there are bound to be some issues like this that need to be tweaked, and WordPress is no different.

Please take my previous post as one example. Anything that relies heavily upon get_user_meta(), update_user_meta(), get_user_option(), update_user_option() in looping routines, should be avoided if at all possible; in favor of direct database calls.

If you’re seeing memory limits on functions inside /wp-includes/meta.php, they are most likely related to the internal cache associated with User meta entries, as a result of calling one of these functions.

I’m not aware of any other issues like this within s2Member, but if you run into any other problems, please let us know and we’ll help you work through them.

Posted: Wednesday Feb 8th, 2012 at 6:24 am #4441
Staff Member

Thanks for the follow-up.

Ah, Multisite. With that many accounts, there might be a problem here in the s2Member activation routine, which is specific to Multisite installs. s2Member will try to update the Originating Blog ID for any existing accounts upon activation, which is not desirable with that many accounts (i.e. this needs to be further optimized by s2Member).

If you open this file:

At line #121 look for this section please:

if (is_multisite () && is_main_site ())
foreach ((array)($users = $wpdb->get_results ("SELECT `ID` FROM `" . $wpdb->users . "`")) as $user)
	if (!($originating_blog = get_user_meta ($user->ID, "s2member_originating_blog", true)))
		update_user_meta ($user->ID, "s2member_originating_blog", $current_site->blog_id);

Replace with the following for optimization:

if (is_multisite() && is_main_site())
	$wpdb->query("INSERT INTO `".$wpdb->usermeta."` (`user_id`, `meta_key`, `meta_value`) SELECT `ID`, 's2member_originating_blog', '".esc_sql($current_site->blog_id)."' FROM `".$wpdb->users."` WHERE `ID` NOT IN (SELECT `user_id` FROM `".$wpdb->usermeta."` WHERE `meta_key` = 's2member_originating_blog')");

I’ll have this updated in next maintenance release.

Posted: Tuesday Feb 7th, 2012 at 2:08 pm #4384
Staff Member

Is it also possible to pass the ‘Company Name’ through to Paypal (Express Checkout) so that the company name will be visible on the Paypal receipt received by the customer (and the automatically generated emails by s2member?

The PayPal Pro API does not allow for any custom data like this to be tied directly to a transaction itself (i.e. processed by PayPal and sent via email by PayPal… not possible in the current release). However, here are some things you can do, which might be alternatives to consider.

1. Put whatever you want to see in the email from PayPal in the desc="" Attribute of your Pro Form Shortcode. This will be processed and sent via email by PayPal.

2. You can also pipe in additional custom data, into the custom="" Attribute of your Pro Form Shortcode, making it possible to collect this custom information and re-use it inside email templates that you configure with s2Member, or even in API Notifications processed by s2Member.

For further details on #2, please check your Dashboard under:
s2Member -> PayPal Pro Forms -> Shortcode Attributes (Explained)
See the section that documents the custom="" Shortcode Attribute please.

Posted: Tuesday Feb 7th, 2012 at 2:01 pm #4382
Staff Member

Further, I have not been able to carry over additional fields, actually one specific addtional field, to the ‘create profile’ section. I would love to have ‘Company Name’ displayed right above ‘First Name’ in the same ‘create profile’ section?

The “Create Profile” section establishes the default profile fields which are required to complete a transaction. Anything custom that you add with Custom Registration/Profile Fields will appear below this section in the “Additional Fields” area. Of course, you can modify this a bit further if you’re customizing your own Pro Form templates, as I mentioned above.

Posted: Tuesday Feb 7th, 2012 at 1:59 pm #4381
Staff Member

Hi there. Thanks for your inquiry.

However, I would like to have the additional fields to be displayed in the pro form both when users are logged-in and logged-out. Im using the additional fields to record productinformation for customizing the product that Im selling, and I want (logged-in) members to be able to order the same product again with different customizations. I hope this did not add to the confusion.. Is there a way to achieve this?

This will require some custom tweaks because it’s not something s2Member does by default.

You can open this file in your installation:

At line #623 find this line:

}) ();

Replace with:


Now save paypal.js as paypal-min.js in the same directory, overriding the existing copy.

That will prevent s2Member Pro from hiding the fields to logged-in users upon checkout for a second or third time. However, this does NOT change anything in the way s2Member processes the form submission. Any data that is collected from an existing customer for Custom Registration/Profile Fields will be ignored by s2Member. So, if you need to use this information again, you would need to hack that in with Hooks/Filters of your own perhaps.

Please note that s2Member stores Profile Fields for each User/Member, and those cannot be duplicated in storage across multiple purchases. In other words, the Custom Registration/Profile Fields that you create, are filled once for each User/Member, during the initial checkout experience.

Of course, a User/Member can update their Profile Fields in the future, but they can’t add new Profile Fields, or have multiple values for the same Profile Fields (e.g. they only have one Profile).

Suggestion: I would recommend that you customize the Pro Form templates and perhaps add some of your own form processing routines to handle anything that goes above & beyond what Custom Registration/Profile fields can handle.

Please see this FAQ article for instructions on how to customize Pro Form templates:

Posted: Tuesday Feb 7th, 2012 at 1:16 pm #4380
Staff Member

Hi there. Thanks for the follow-up.

The slow query that you referenced is no longer a part of the WordPress core, and it’s also not something that current versions of s2Member need to call upon any longer.

So, I suspect that you have another plugin or theme which is making a call that depends upon the old WP_User_Search class, which is now deprecated in WordPress v3.1+.

I would try searching your plugin/theme files for references to:

or ...1=1 

Does that return any results?

Posted: Tuesday Feb 7th, 2012 at 12:47 pm #4377
Staff Member

Hi Brad. Thanks for your patience.

I just went back through our lengthy email conversion and debugging of this issue as it exists on your installation. I don’t have any new information on the issue yet, very sorry.

As I said before, s2Member is not yet integrated with Pitch Plus Upsells. Thus, any issues that you are having with this type of integration are most likely attributed to the fact that s2Member has not yet been integrated with this particular aspect of ClickBank’s offering.

I’m marking this thread in our TODO list though, and I’ll be sure to update you as soon as s2Member supports this feature that you’re attempting to integrate with.

In the mean time, I would suggest that you take a closer look at the log files we went over before, and see if you can determine why ClickBank is not passing through the “s2 Vars” that I mentioned. Upon review of your log files, I find that s2Member’s post transaction processing is failing due to the absence of these variables in the IPN received from ClickBank after checkout.

Why is this happening? I can’t be sure yet. It’s possible that s2Member needs to be further integrated with this feature in order to satisfy custom requirements for this scenario. We’ll have more information for you as we work our way through this, and support for Pitch Plus Upsells is added into a future release.

FYI: You will find a list of all avaiable features
that s2Member Pro currently supports for ClickBank here.

Posted: Tuesday Feb 7th, 2012 at 11:11 am #4370
Staff Member

Yes, that would be very abnormal behavior.
It looks like files are corrupted to me. Also, what version of PHP are you running please?

Posted: Monday Feb 6th, 2012 at 1:36 pm #4069
Staff Member

Hi Brad. Investigating this now.
~ Thanks for your patience.

Viewing 9 replies - 1,901 through 1,909 (of 1,909 total)

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.