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 25 replies - 1,501 through 1,525 (of 1,909 total)
Author Replies
Author Replies
Posted: Friday Apr 20th, 2012 at 12:27 am #11319
Staff Member

Thanks for reporting this important issue.

We fixed a bug related to this in s2Member v120309, where a problem would sometimes occur under installations of PHP that were running in SAFE mode (due to cURL limitations with respect to redirections).

v120309 Bug fix. Some PHP installations running in safe mode were experiencing `400 Bad Request` errors whenever s2Member’s Amazon® CloudFront configuration routines for file downloads were processed. Fixed in this release of s2Member v120309.

However, it sounds like you’re still reporting problems in the latest release even. I’m not aware of this being a widespread issue, so I have to assume (at least at this point), that it’s a server-dependent issue.

If your PHP installation supports allow_url_fopen (see this article), I would suggest the following hack to see if it helps any. Please report back with your findings. If I find a way to avoid this compatibility issue all together, I’ll be happy to update s2Member in a more official capacity going forward.

Create this directory and file please:
/wp-content/mu-plugins/s2-hacks.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

<?php
add_filter ("use_curl_transport", "__return_false");
// This way WordPress will use FOPEN, which might work better in some environments.
?>

In short, disabling the cURL transport method in your WordPress installation, will force WordPress to fall back on another available transport supported by your server. Thereby (hopefully) allowing the communication between WordPress and Amazon to succeed, where it may have been failing under the cURL transport for a reason that is yet to be determined at this point.

Posted: Thursday Apr 19th, 2012 at 9:39 pm #11300
Staff Member

Thanks for the heads up on this thread.

I noticed the URLs being posted here do not contain the s2member_file_inline=yes directive.

I suggest the following URL which includes this directive for the file to be served inline:

http://www.mywebsite.com/?s2member_file_remote=yes&s2member_file_inline=yes&s2member_file_download=podcast-test.xml
Posted: Thursday Apr 19th, 2012 at 8:52 pm #11297
Staff Member

Hi there. Thanks for the heads up on this thread.

@mark lion
Are you creating the User’s account in WordPress BEFORE posting this data to the IPN processor?
In this case, that would be the ideal approach (please do that).

Posting your IPN data to s2Member AFTER the account is created should resolve the issue you’re having here. The log entry you posted, indicates that you are calling the IPN handler before the User’s account is created within WordPress, so it’s queuing things up in anticipation of on-site registration.

If the account already exists, you’ll get the results you desire.

Also, regarding the Proxy return URL. s2Member’s IPN handler exits script execution and returns the full URL in the output. So it’s not going to show up in the log file entries, but your script can collect this value the same way s2Member itself does. That is, you might do something like this…

$url_with_replacement_codes_filled_in = file_get_contents('123.456.789.001/...s2member_paypal_proxy=nmi&...&s2member_paypal_proxy_return_url=%2Fthank-you%2F');
Posted: Thursday Apr 19th, 2012 at 8:07 pm #11295
Staff Member

Thanks for the heads up on this request for a debugging how-to.

HTTP responses in WordPress can be logged with an MU plugin file.

For example, this will record all HTTP communication, logging it inside /wp-content/debug.log for you.

Create this directory and file:
/wp-content/mu-plugins/debug-wp-http-responses.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

<?php
add_filter('http_response', 'debug_wp_http_responses');
function debug_wp_http_responses($response)
	{
		$log_file = WP_CONTENT_DIR.'/debug.log';
		file_put_contents($log_file, var_export($response, TRUE)."\n\n\n\n", FILE_APPEND);
	}
?>

Regarding s2Member’s communication with Amazon® Web Services.
s2Member returns quite a bit of detail in it’s error reporting mechanishm within the Dashboard. However, if you’d like to dig deeper into the routines that s2Member implements, you might find it helpful to have a peek at this source file: /s2member/includes/classes/files-in.inc.php

Methods in this PHP class file, are also documented here:
http://www.s2member.com/codex/stable/s2member/files/c_ws_plugin__s2member_files_in/

Posted: Friday Apr 13th, 2012 at 3:36 pm #10752
Staff Member

Thanks for the heads up on this request for support.

@Nigel

Feeds within WordPress (i.e. those which are NOT inside the secure /s2member-files/ directory), are treated like any other feed. That is, the feed itself will always remain available to the public.

If your feed contains links to Posts/Pages, which you may have protected with s2Member; then upon clicking the links that lead to these protected areas of your site, non-Members will be asked to log into your web site with a Username/Password. Nothing special here, that’s how one would expect this to function.

Alternative View Restrictions

s2Member can also be configured to use Alternative View Restrictions, so that links in your feed are filtered down, to only those which are available to a particular User/Member, based on the current Member’s status on your site. For example, if your feed contains a link to a Page protected at Level #1, and the current Member is logged into their account with Level #1 access, the link would be visible. However, if they are NOT logged in, or they’re logged in as a Free Subscriber at Level #0, the link would not be visible to them.

See: Dashboard -› s2Member® -› Restriction Options -› Alternative View Protection

Please keep in mind that while s2Member’s Alternative View Restrictions have the ability to filter the links made available in a feed, based on the current Member’s status with your site, many feed reading applications pull data via server-side applications, scripts, or even through software apps designed to run on mobile devices, etc, etc. Therefore, it’s not always possible for s2Member to detect the actual Member (i.e. there is no browser involved in many of these feed requests). This is where Remote Authorization might come in handy. If you’re integrating with Kindle, Remote Authorization through a custom feed that you build, designed specifically for use within Kindle, would be more appropriate.

Protecting The Feed Itself (Integrating Remote Authorization)

This is an entirely different approach, and it requires that you make your own custom feed, placing the feed itself into the secure /s2member-files/ directory. Remote Authorization is NOT something that’s built into WordPress by default, it’s something that s2Member makes possible, and it’s only integrated with s2Member’s File Download functionality. Thus, in order to use Remote Authorization, you will need to make your feed a File Download, by placing it into your /s2member-files/ directory.

I understand from your previous post, that you’re attempting to integrate with Kindle. I think you’ll find that an integration with Kindle, is very similar to that of iTunes. However, I’ve not done an integration between s2Member and Kindle myself, so I can’t say with absolute certainty. I would start this project by first watching the video tutorial that we’ve made available for iTunes. Attached to this post for your reference.

Video » s2Member® File Downloads (Remote Auth/Podcasting)

See also: Dashboard -› s2Member® -› Download Options -› Remote Auth/Podcasting

<Embed Playlist>
Posted: Friday Apr 13th, 2012 at 3:05 pm #10750
Staff Member

Hi Lee. Thanks for the follow-up.

Sorry if I added unnecessary confusion to this thread. On our end, we’re dealing with many patches/changes/improvements, but on your end, you’ve been dealing with this one specific patch file, and now the second one I posted is available as well.

Yes, you are correct. Please try the second patch file that I posted in this thread. That should resolve the issue for you. If you continue to have problems with this aspect of ccBill integration, please feel free to follow-up here. I’ll be happy to take another look for you.

Posted: Friday Apr 13th, 2012 at 1:32 am #10710
Staff Member

Thanks for the follow-up.

@Lee Keels

I believe this issue was addressed in a subsequent patch file which
corrected references to $a, converting them into $attr references.

Please unzip and upload the attached patch file, allowing it to override your existing copy of:
/s2member-pro/includes/classes/gateways/ccbill/ccbill-button-in.inc.php

Patch (2nd attempt) / download link:
http://d1v41qemfjie0l.cloudfront.net/s2member/uploads/ccbill-button-in.inc_.php_1.zip

Posted: Friday Apr 13th, 2012 at 1:20 am #10707
Staff Member

Thanks for the heads up on this request for support.

Everything in a Pro Form is validated extensively both client-side and server-side, except for Custom Registration/Profile Fields implemented by a site owner. These are handled via JavaScript only.

The validation of a Custom Registration/Profile Field, is based entirely on the way it’s configured by the site owner whenever they create a Custom Registration/Profile Field in the Dashboard. For example, a site owner can choose to require numerics only, or a specific number of characters, an email address, phone number, etc, etc.. Many options are available under: General Options -> Custom Registration/Profile Fields.

However, the routine within s2Member’s source code, which handles the required validation scan (i.e. based on the field’s configuration by the site owner), was written in JavaScript only, and is not yet implemented server-side. Therefore, it IS still possible for a customer to bypass certain Custom Registration/Profile Field requirements, if they bypass JavaScript. Not a common issue, but possible in cases where hackers are actually trying to bypass them, or possible on a site that’s hosting Pro Forms, which is broken in some way (e.g. JavaScript errors in other areas of the site, which might prevent s2Member Pro Forms from working as expected).

Again, not a common issue, but possible.

This will be corrected in a future release, because the validation routines are being written in PHP as well, and they’ll be integrated into the PHP form handler on the server-side too.

In the mean time, a site owner could implement their own validation routines on the server-side if they’d like.

Here’s a hack file example, for PayPal Pro Forms:
/wp-content/mu-plugins/s2-hacks.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

<?php
add_action("init", "my_custom_validator", 1);
function my_custom_validator()
	{
		if(!empty($_POST&#91;"s2member_pro_paypal_checkout"&#93;&#91;"nonce"&#93;))
			{
				$custom_fields = stripslashes_deep($_POST&#91;"s2member_pro_paypal_checkout"&#93;&#91;"custom_fields"&#93;);
				$response = &$GLOBALS&#91;"ws_plugin__s2member_pro_paypal_checkout_response"&#93;;
				
				if(empty($custom_fields&#91;"my_unique_field_id"&#93;)) // This custom field is missing?
					{
						// Set the error response message for s2Member to display.
						$response&#91;"error"&#93; = TRUE;
						$response&#91;"response"&#93; = "Custom Field ID `my_unique_field_id` is missing. Please try again.";
						
						// Unset this variable to prevent Pro Form processing during checkout.
						unset($_POST&#91;"s2member_pro_paypal_checkout"&#93;&#91;"nonce"&#93;);
					}
			}
	}
?>

Here’s another example for Authorize.Net Pro Forms.

<?php
add_action("init", "my_custom_validator", 1);
function my_custom_validator()
	{
		if(!empty($_POST&#91;"s2member_pro_authnet_checkout"&#93;&#91;"nonce"&#93;))
			{
				$custom_fields = stripslashes_deep($_POST&#91;"s2member_pro_authnet_checkout"&#93;&#91;"custom_fields"&#93;);
				$response = &$GLOBALS&#91;"ws_plugin__s2member_pro_authnet_checkout_response"&#93;;
				
				if(empty($custom_fields&#91;"my_unique_field_id"&#93;)) // This custom field is missing?
					{
						// Set the error response message for s2Member to display.
						$response&#91;"error"&#93; = TRUE;
						$response&#91;"response"&#93; = "Custom Field ID `my_unique_field_id` is missing. Please try again.";
						
						// Unset this variable to prevent Pro Form processing during checkout.
						unset($_POST&#91;"s2member_pro_authnet_checkout"&#93;&#91;"nonce"&#93;);
					}
			}
	}
?>
Posted: Monday Apr 9th, 2012 at 8:17 pm #10411
Staff Member

NOTE: Cristian’s response that both purchase attempts were for page access isn’t correct unless something is wrong. One was for a specific page/post (successful), the other was for a site membership/subscription (not successful).

Gotchya. Thanks.
The first one was for Specific Post/Page Access,
then a recurring Subscription failed after that, due to an error produced by ccBill, regarding an existing customer.

Absolutely confirmed. We do not use ANY CCBill member services. Everything is handled by WordPress/s2Member.
I am unable to find a setting for “do not collect usernames/passwords”…user management does show OFF.
UPDATE: Found the setting and it is turned off as well.

OK. Great. Thank you. May I assume that you’ve run your tests again after making these changes?
Problem still exists after those changes were made?

I think you’re right. I think this is a limitation is way ccBill looks at transactions. It sees everything as a Subscription, regardless of what is actually being purchased, and/or how it’s being billed. If you setup a second sub-account, you can probably work around this. However, the current release of s2Member Pro is not compatible with multiple sub-accounts. I’ve just added support for this into the Shortcode processor for s2Member, and I’m attaching that to this email for you. Hopefully this will help you out.

Please unzip and upload the attached patch file, allowing it to override your existing copy of:
/s2member-pro/includes/classes/gateways/ccbill/ccbill/ccbill-button-in.inc.php

Download patch file: http://d1v41qemfjie0l.cloudfront.net/s2member/uploads/ccbill-button-in.inc_.php_.zip

Once this patch file is in place, you’ll have the ability to add these new Shortcode attributes to your ccBill Payment Buttons generated by s2Member. Two new Shortcode attributes become possible. These include: sub_account="" and form="" (both optional).

So for instance, if you have an additional sub-account that you’d like to integrate with s2Member, you can modify your ccBill Button Shortcodes, and force s2Member to use a particular sub-account and a particular Dynamic Pricing Form associated specifically with that sub-account. Example below.

[s2Member-Pro-ccBill-Button level="1" .... sub_account="0001" form="3445cc" /]

This Shortcode is abbreviated for clarity in this regard.
Only to show these two new attributes that become possible.

Posted: Monday Apr 9th, 2012 at 7:46 pm #10404
Staff Member

Thanks for the follow-up!

I’m so sorry. No, that’s a limitation on the ccBill side of things.

Taken from the DataLink documentation, it reads as follows:
startTime and endTime
startTime and endTime are separate variables that represent the date and time during which the
transactions took place. The values must be passed in YYYYMMDDHHIISS format with hours
expressed in 24‐hour military format. Specified date ranges cannot exceed 24 hours; dates entered
outside this range will produce an error and terminate the script.

I suppose you could try to work around this, but forcing s2Member to re-run with start/end dates numerous times, based on the dates in the past. That would require a slight hack on your part though. If you open this file: /s2member-pro/includes/classes/gateways/ccbill/ccbill-datalink.inc.php, at line #74-75 you will find the start/end dates that s2Member uses (based on the last time it ran).

If you’d like to force s2Member to request data for specific dates in history,
you might do something like this around line #74 – 75. Example follows:

$start = strtotime('-60 days'); /* 60 days ago. */
$end = $last = $start + 86400; /* Plus one full day. */
Posted: Monday Apr 9th, 2012 at 7:34 pm #10403
Staff Member

Taking another look at this right now.
~ One moment please.

Posted: Monday Apr 9th, 2012 at 7:27 pm #10402
Staff Member

Thanks for the heads on up on this thread.

@Lisa. I noticed that you posted a couple of samples, and one of them has a leading http:// and the other does not. Can you please confirm that you’ve tried this WITH the http:// prefix?

success="http://chiccritiqueforum.com/congratulations/?userid=%%user_id%%&group=56"
Posted: Friday Apr 6th, 2012 at 5:16 pm #10255
Staff Member

Thanks for the heads up on this thread…

‘s2member_log’ =>
array (
0 => ‘Storing last DataLink time: Thu Apr 5, 2012 5:00:06 pm UTC’,
1 => ‘No new Datalink IPNs at this time: Thu Apr 5, 2012 5:00:11 pm UTC’,
2 => ‘https://datalink.ccbill.com/data/main.cgi?startTime=20120404170006&endTime=20120405170006&transactionTypes=REBILL%2CEXPIRE%2CREFUND%2CCHARGEBACK&clientAccnum=xxxxxxxxx&clientSubacc=0004&username=s2member&password=xxxxxxxxxx’,
3 => ”,
),
)

In this log entry s2Member did not receive anything from ccBill. To clarify… s2Member will request REBILL, EXPIRE, REFUND, or CHARGEBACK details for the past 24 hours. In this request, it was asking for any of these that occurred starting on 2012-04-04 at 5pm until 2012-04-05 at 5pm (i.e. in the last 24 hours). ccBill responded back, saying none of these occurred in that time frame. Does that help any?

Posted: Friday Apr 6th, 2012 at 4:48 pm #10254
Staff Member

Thanks for the heads up on this thread.
WordPress plugins are mostly event driven. You can avoid errors like this by simply wrapping any of your own code into an event handler, attached to a WordPress Action Hook.

For example…

<?php
add_action('init', 'my_routine');

function my_routine()
{
    // Any code here that depends on s2Member functions will be fine.
}

?>
Posted: Friday Apr 6th, 2012 at 3:10 pm #10252
Staff Member

All of the post-processing routines for AliPay are ultimately handled by s2Member’s core PayPal IPN processor, as they get piped into the core PayPal processor after some initial handling that is specific to AliPay. So while there are no Hooks/Filters specifically for AliPay, there are MANY Hooks/Filters available within the PayPal core processor that can be used to grab this information.

Here is a quick example…
/wp-content/mu-plugins/s2-hacks.php

<?php
add_action('ws_plugin__s2member_during_paypal_notify_after_subscr_signup', 'my_info_grabber');
function my_info_grabber($vars = array())
	{
		if($vars&#91;'paypal'&#93;&#91;'subscr_gateway'&#93; === 'alipay')
			{
				print_r($vars); // An array of all transaction details.
			}
	}
?>

There are many other Hooks/Filters available through these files…
/s2member/includes/classes/paypal-notify-in…php

Posted: Friday Apr 6th, 2012 at 2:35 pm #10250
Staff Member

Thanks for the follow-up.

I sent this account an email with a manual password reset a couple days ago. I see there are still no logins on this account though. I’m sending another email now. Please let us know if you continue to have trouble.

Posted: Tuesday Apr 3rd, 2012 at 12:06 pm #9878
Staff Member

Thanks for the heads up on this thread.

@Lee Keels
Can you please verify that your ccBill account is configured NOT to handle Usernames/Passwords and/or User Mangaement? It sounds to me like your ccBill account is attempting to handle account access, and this might be the underlying reason for this error message during a second attempt to purchase something new.

User Management
*Important* User Management needs to be turned off in your ccBill® account. s2Member’s integration with ccBill® does NOT require ccBill® to manage Usernames/Passwords. Instead, s2Member needs to be given exclusive permission to handle this for you. In your ccBill® account, see: Account Admin -> User Management. Turn this off, and choose: Do NOT collect Usernames/Passwords. You will also want to remove Username/Password references in the APPROVAL Email Receipt configured in your ccBill® account. In your ccBill® account, see: Account Admin -> Custom Emails.
Posted: Tuesday Apr 3rd, 2012 at 11:34 am #9871
Staff Member

Thanks for the heads up on this thread.

Very sorry. Yes, that’s actually the behavior I would expect to see in the current release of s2Member Pro. Custom Registration/Profile Fields are not collected during checkout, if the customer is already logged into an account with your site. All that’s collected during checkout are the details required to complete the purchase.

In other words, if the Customer is logged in, Custom Registration Fields are not shown, under any circumstance. In this scenario, s2Member Pro Forms will streamline the checkout process, so that a customer only needs to enter data required to complete the purchase.

That being said, once the customer completes checkout and is upgraded to the new Level, their Profile will include any Customer Registration/Profile Fields that you configured for Level #1 Members. So once checkout is completed, you can suggest that your customer update his Profile.

We’re working to make things like this more flexible for site owners. Thanks for your patience.

Posted: Tuesday Apr 3rd, 2012 at 11:18 am #9870
Staff Member

Thanks for the heads up on this thread.

I noticed those links you posted were on two different domains.
Can you please describe for me the reason for that?

I suspect that’s the underlying cause. s2Member’s tracking codes work in conjunction with browser cookies that identify a paid customer immediately after a purchase. Mixing multiple domain names into a single installation may cause unexpected conflicts. WordPress will set cookies for the domain the site is configured to run on. If the domain the customer actually ends up on after checkout is different, it may fail to display tracking codes.

If you can please explain why the two links you posted are using different domains, that will help. I’ll assume you’re running a Multisite Network, is that correct?

Posted: Tuesday Apr 3rd, 2012 at 11:09 am #9869
Staff Member

That is correct, s2Member does NOT alter the existing WordPress hash generator in any way.

Posted: Tuesday Apr 3rd, 2012 at 10:57 am #9868
Staff Member

Thanks for the heads up on this thread.
~ Handling this via email.

Posted: Saturday Mar 31st, 2012 at 12:50 pm #9667
Staff Member

Hi there. Thanks for the heads up on this thread.

If you’d like to customize the cut-offs (i.e. title lengths), you may create this directory and file:
/wp-content/mu-plugins/theme-hacks.php

( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

You can change these to numeric values,
indicating the max number of characters to display in various areas of your theme.

<?php
add_action("ws_theme__after_loaded", "my_custom_title_lengths");
function my_custom_title_lengths()
	{
		$GLOBALS&#91;"WS_THEME__"&#93;&#91;"c"&#93;&#91;"max_title_length"&#93;&#91;"index"&#93; = false;
		$GLOBALS&#91;"WS_THEME__"&#93;&#91;"c"&#93;&#91;"max_title_length"&#93;&#91;"index_post"&#93; = 25;
		$GLOBALS&#91;"WS_THEME__"&#93;&#91;"c"&#93;&#91;"max_title_length"&#93;&#91;"page"&#93; = false;
		$GLOBALS&#91;"WS_THEME__"&#93;&#91;"c"&#93;&#91;"max_title_length"&#93;&#91;"fullpage"&#93; = false;
		$GLOBALS&#91;"WS_THEME__"&#93;&#91;"c"&#93;&#91;"max_title_length"&#93;&#91;"single"&#93; = false;
		$GLOBALS&#91;"WS_THEME__"&#93;&#91;"c"&#93;&#91;"max_title_length"&#93;&#91;"fullsingle"&#93; = false;
	}
?>
Posted: Saturday Mar 31st, 2012 at 12:27 pm #9666
Staff Member

Thanks for the heads up on this thread.

While we’re always open to new ideas, I’m not currently aware of any clean/standard way to prevent this. As Cristian mentioned, Flash Cookies, or other forms of extremely advanced tracking might help to thwart this behavior. However, we can’t build things like that into s2Member and offer support for them. Those are things you’d need to implement in some custom fashion.

Posted: Saturday Mar 31st, 2012 at 12:17 pm #9665
Staff Member

Hi Kezz. Great feedback. Thank you!

One thing you could try is this…

Open this button template file:
/s2member/includes/templates/buttons/paypal-checkout-button.php
Inside that file you’ll find the PayPal Button Code that s2Member’s Shortcode uses. If you add the cbt variable into that template, you’ll save yourself some time. That way you can continue to use what you’ve already got.

Posted: Thursday Mar 29th, 2012 at 6:39 am #9445
Staff Member

Hi Theresa. I’m following up with you via email.
~ Thanks for working with our Support Reps.

Viewing 25 replies - 1,501 through 1,525 (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.