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.

About: John Potter

Sorry, I've not written a description yet. I'll get to it soon!


Topics I've Started

Viewing 4 topics - 1 through 4 (of 4 total)
Topic Count Last Reply
Automatic Login Based on IP not working

By:  John Potter in: Community Forum

voices: 3
replies: 10

4 years, 2 months ago  Bruce

Can I suppress single Java Script prompt?

By:  John Potter in: Community Forum

voices: 4
replies: 6

4 years, 5 months ago  Raam Dev

How to edit JavaScript confirmation prompt?

By:  John Potter in: Community Forum

voices: 3
replies: 7

4 years, 6 months ago  Raam Dev

Viewing 4 topics - 1 through 4 (of 4 total)

My Latest Replies (From Various Topics)

Viewing 22 replies - 1 through 22 (of 22 total)
Author Replies
Author Replies
Posted: Tuesday May 28th, 2013 at 11:29 pm #50786
John Potter
Username: johnp

We paid Ryan to write the plugin for us.

I suggest if you offer to hire him for a few hours he is likely to respond very quickly, and be much more committed to solving your problem.

So, how do you handle new sign ups?

If they need access by IP, then completely manually (ie: by email and the WP admin “Add new user” screen).

How do you manage it when all customers with IP based access are under one username (and presumably email address)?

We are only likely to have a few dozen customers in this category, but with thousands of potential users, all sharing the single username. The email address is meaningless for this ID.

As far as I can see, there is no way for WordPress to distinguish these users from one another, so this is probably not going to work if social interaction is part of your site. Even a single IP address might have half a dozen users sharing a wi-fi network.

Generally, each of our IP based clients has a librarian or similar who manages bulk access to publications, and this is the person we deal with.

If a customer is prepared to pay many hundreds of dollars per year, a bit of inconvenient manual administration is worth accepting, in my view.

Posted: Tuesday May 28th, 2013 at 7:10 pm #50771
John Potter
Username: johnp

you have one single user for all of your bulk ip access?

Yes, that’s correct.

And then you just add IPs or ranges as needed for different customers

The script at the top of this page will only handle single IPs. You need Ryan’s plugin to use ranges.

Or is there a way to add individual IDs to the ID list in the functions.php file?

You could use the theme file editor, but I wouldn’t recommend this. Better to edit functions.php locally with your normal text editor and upload via FTP, so you can quickly roll it back if a typo crashes the site.

Posted: Saturday May 25th, 2013 at 4:00 am #50621
John Potter
Username: johnp

I think you might need to lower your expectations somewhat Chris.

My client runs an academic journal; Universities, Government agencies and large corporates expect to be able to purchase a ‘site licence’, with unlimited access for their entire network.

Our single “collective” ID is potentially used by hundreds or even thousands of users. It uses our only s2member level the same as the other paid members.

We negotiate a fee for each organisation depending on how many users they might reasonably be expected to have, but there is no way I can see of actually limiting their use to numbers of seats or downloads, etc.

Adding this kind of access by IP is not automatic; in fact there isn’t even a nice admin screen to update the data.
I need to edit our function.php file every time we add a new member (or group) with access by IP.

If you (ie: anyone reading this) are not experienced with modifying the PHP in theme function files, this solution is probably not for you – crashing your site and locking yourself out of the admin is extremely easy if you make an error in this particular file.

I’m just an s2member customer like you.

I’m hoping that if enough people start asking for this feature, Jason (the lead developer of s2member) will get inspired to include it in the core, with a user friendly admin page.

Then, what I really want, is that Quick Cache can be updated to ignore our list of IPs so I can turn it back on.

Posted: Tuesday May 21st, 2013 at 5:28 pm #50307
John Potter
Username: johnp

I don’t think the plugin is available for download anywhere, so yes, you’ll have to email Ryan.

You would use Ryan’s plugin instead of the hack on this page.

The plugin allows for multiple:

  • individual IPS
  • ranges of IPs
  • IPs with wildcards
Posted: Tuesday May 21st, 2013 at 3:50 pm #50304
John Potter
Username: johnp

The code above can only handle single IPs.

Ryan Imel (ryan@aspiringindie.com) made us a plugin which can handle both multiple ranges and wildcards.

Posted: Tuesday May 21st, 2013 at 6:19 am #50283
John Potter
Username: johnp

Hi Chris

The array looks something like this when you have multiple IPs:

( '111.222.333.444', '222.333.444.555', '333.444.555.666')

All users logged in this way will end up with a single ID, which you specify in the plugin code on line 8.

You do need to create this ‘collective’ user and decide how much access they have to your site.

Everything you need to make this work for single IPs is in Bruce’s instructions above.

Posted: Sunday Apr 7th, 2013 at 6:25 pm #46813
John Potter
Username: johnp

My client badly needs this functionality, so I will follow up your suggestion above of getting a free-lance developer to quote on this if you guys aren’t interested.

I’m thinking it would be so great to have a page in the s2member admin where allowed IPs, ranges of IPs and IPs with wildcards could be entered.

If they could be labeled by institution as well, to make updating simple, that would be fantastic.

And if Quick Cache could be then instructed to ignore those IPs all would be perfect.

Posted: Wednesday Apr 3rd, 2013 at 5:37 pm #46538
John Potter
Username: johnp

My client might be prepared to contribute a small amount towards development costs.

If anyone else reading this needs this function, please lobby s2member to get it moved up the priority list.

I understand that both Joomla and Drupul have modules that allow auto-login by IP, but this not currently easy with WordPress.

Posted: Wednesday Apr 3rd, 2013 at 5:24 pm #46533
John Potter
Username: johnp

Thanks for your quick response Bruce.

Your suggestion confirms that this particular customization is beyond my abilities.

If you guys offered this functionality as an add-on module or even a stand-alone plugin I’m sure many users would pay extra for it.

Posted: Wednesday Apr 3rd, 2013 at 2:35 am #46448
John Potter
Username: johnp

NB: this hack does not work if you have Quick Cache activated.

Posted: Wednesday Nov 7th, 2012 at 11:54 pm #30995
John Potter
Username: johnp

YES! It works now!

Thank you very much for your help Bruce.

It would be useful to others if you could update my original thread.

Posted: Wednesday Nov 7th, 2012 at 4:17 pm #30934
John Potter
Username: johnp

Correction – “corporate” user does, in fact, get access to protected posts, but NOT to restricted downloads.

My settings allow unlimited downloads for Level #2members.

Posted: Wednesday Nov 7th, 2012 at 4:05 pm #30933
John Potter
Username: johnp

OK Raam, I’ve found the problem – when I turn off the Quick Cache plugin I am automatically logged in as “corporate” (using the id in the script).

Unfortunately Quick Cache does not seem to have an option for configuring No-cache remote-address patterns.

But even if I proceed without a cache I’m no further ahead – even though “corporate” is a s2Member Level #2 there is still no access to protected content – I am referred to the “Membership Options” page when I try.

I also note there is no admin bar when logged in this way, and if I try to access wp-admin I am asked for a password.

The login page has a message:
“ERROR: The username field is empty.”
but actually the Username field has “corporate” pre-filled.

FYI this login also does not by-pass the Maintenance Mode plugin (not an issue for me).

Any further suggestions would be appreciated.

Posted: Monday Nov 5th, 2012 at 9:04 pm #30715
John Potter
Username: johnp

I just checked now, and yes, $_SERVER[‘REMOTE_ADDR’] also reports my IP address correctly.

Posted: Sunday Nov 4th, 2012 at 11:31 pm #30616
John Potter
Username: johnp

Hi Raam

The complete line from the code that I tried at first was:

$id = 82; # The ID of the user you wish to log the visitor in as / Could also be User's Login

so you can see why I next tried the login: ‘corporate’.

The traffic tracking service verifies that my reported IP is correct.

Posted: Friday Oct 5th, 2012 at 4:56 pm #27602
John Potter
Username: johnp

I have a client who needs this feature as well.

He runs a legal journal, and has found that big firms, institutions and libraries expect automatic login based on IP address.

There is a plugin which claims to be able to do this, but the support forum for User Access Manager , which does not seem to be monitored by the plugin author, suggests that it only works with old versions of PHP and may also be broken in recent versions of WordPress.

Is it possible to incorporate this into s2member?

Posted: Sunday Jul 15th, 2012 at 5:46 pm #19312
John Potter
Username: johnp

Thank you for this Jason. I actually figured out a similar solution on my own, and came back here to document it:

<?php if (current_user_can("access_s2member_level2")){ ?>
		<script type="text/javascript">
			var ws_plugin__s2member_skip_all_file_confirmations = true;
		</script>
<?php } ?>
Posted: Wednesday Jul 11th, 2012 at 2:35 am #18878
John Potter
Username: johnp

I’ve just spent a wasted hour trying to solve this myself! So it’s reassuring to find this.

Perhaps a line of advice added to the Registration/Profile Fields & Options edit box might be helpful?

Posted: Sunday Jul 8th, 2012 at 7:28 pm #18630
John Potter
Username: johnp

Hi Raam

My s2-hacks.php file with the code above does not stop the pop-up.

However I have followed the advice in a post by Jason and this does indeed disable all JavaScript confirmations.

<script type="text/javascript">
	var ws_plugin__s2member_skip_all_file_confirmations = true;
</script>

If anyone finds a way of stopping or altering this single, redundant message without loosing the entire file-counting feature, I’d be much appreciated.

Posted: Sunday Jul 1st, 2012 at 9:48 pm #18051
John Potter
Username: johnp

I appreciate the assistance guys. I’ve now got this in the plug-in:

<?php
add_filter("gettext_with_context", "s2_contextual_translation", 10, 3);
function s2_contextual_translation($translation = NULL, $original = NULL, $context = NULL)
	{
		if($context === "s2member-front" && $original === "You`re entitled to UNLIMITED downloads though ( so, no worries ).")
			$translation = "You`re entitled to UNLIMITED downloads.";
		return $translation;
	}
?>

But still no change :-(

Posted: Sunday Jul 1st, 2012 at 1:35 am #18005
John Potter
Username: johnp

Thanks for the suggestion.

I’ve uploaded a plugin here: /wp-content/mu-plugins/s2-contextual-translation.php
with this code:

<?php
add_filter("gettext_with_context", "s2_contextual_translation", 10, 3);
function s2_contextual_translation($translation = NULL, $original = NULL, $context = NULL)
	{
		if($context === "s2member-front" && $original === "( so, no worries )")
			$translation = "";
		return $translation;
	}
?>

but the message is still there in the javascript prompt.

Posted: Thursday Jun 28th, 2012 at 3:09 am #17727
John Potter
Username: johnp

I’ve found and deleted the text from s2member.pot , but it still appears in the pop-up.

There is no cacheing installed yet.

Viewing 22 replies - 1 through 22 (of 22 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.