Too few arguments

Hi Cristian, when I am editing a post or a page on my website, I get this error:

Warning : sprintf(): Too few arguments in /home/leoraver/public_html/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php on line 107

Warning : Cannot modify header information - headers already sent by (output started at /home/leoraver/public_html/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php:107) in /home/leoraver/public_html/wp-includes/pluggable.php on line 1251

Here is the screenshot, if you need it:

I have to turn off s2member to save the post/page, but when I turn it on the problem is still there.
Thanks in advance, I’m sorry to make you waste time to help me but I didn’t find anything similar in the forums.
Cheers
Leo

Hi Leo.

I can’t see the screenshot.

That line in syscon.inc.php, is about the pro_eot_reminder_email_subject. What did you enter in that field on your options page? WP Admin > s2Member > PayPal Options > EOT Reminder

Thanks.

Hi Cristian

I had EOT renewal/reminder email disabled. I tried to enable and I get the same error, I disabled again and no change. Here is the screenshot (the dropbox link was removed from my post after a while)

Thanks again
Leo

Thank you for the update, Leo.

Okay, I’m not having someone else experiencing this, so something particular to your setup seems to be causing the problem.

Could you test for plugin or theme conflict? If you can reproduce it while logged in as the administrator, this plugin might help troubleshoot deactivating other stuff to see if the behavior changes: https://wordpress.org/plugins/health-check/

Otherwise, you can just disable other plugins and go to the default theme, to try reproduce the behavior with less variables, and identify the culprit.

I look forward to your update. :slight_smile:

Hello Cristian
the conflict seems to be caused by “Classic Editor Plugin”. At least, when I modify a page with blocks editor enabled I don’t get the error message.

Since s2member custom capabilities are not available in block editor, I can’t disable Classic Editor Plugin.

I guess many s2member users (if not all of them) have the classic editor installed, but nobody has this issue except me.

Any idea?

Thanks again for your help

Hi Leo.

Thanks for the update.

You don’t see the Custom Capabilities field in the s2Member section of the new Page Editor? I don’t use the Classic Editor, and I still see the s2Member fields for Level and Custom Capability restrictions.

Screenshot_2019-11-09%20Edit%20Page%20%E2%80%B9%20s2Member%20Membership%20Plugin%20for%20WordPress%20%E2%80%94%20WordPress

Could you show me a screenshot?

:slight_smile:

Hello Cristian, I always thought that S2member and the new gutenberg editor were not compatible. I’m glad to discover they aren’t.

Sadly, I use custom posts that don’t seem to be affected by gutenberg and they are still affected by the error message, even with classic editor disabled.

Since it seems to be something related only with my website, I’ll stay with this error message. I can’t expect you to solve issues like this on each website that use S2member.

If someone else comes with a similar request, you’ll look deeper into this.
Thank you,
sincerely
Leo

Thanks for the update, Leo.

From what I read in the code, the s2 metabox is added by default unless it’s in its excluded list. s2member/src/includes/classes/meta-boxes.inc.php

There’s another thing that may interest you, and is very powerful to customize restriction to content: https://s2member.com/kb-article/custom-restriction-options-for-developers/

I hope that helps. :slight_smile:

Hi Cristian, just a quick update. The error message has changed to:

Warning : sprintf(): Too few arguments in /home/leoraver/public_html/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php on line 107

Warning : Cannot modify header information - headers already sent by (output started at /home/leoraver/public_html/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php:107) in /home/leoraver/public_html/wp-includes/pluggable.php on line 1265

The message disappears if I set the website in english, so it may be a translation issue.
If a fast fix to this is possible let me know, otherwise I’ll stay with the error message

Thanks agains
best wishes
Leo

Cannot modify header information - headers already sent
The message disappears if I set the website in english, so it may be a translation issue.

Check that you aren’t echoing something, or that you don’t have anything before the opening PHP tag.

syscon.inc.php on line 107

Both are referencing that line:

'pro_eot_reminder_email_subject' => array('_' => sprintf(_x('Renewal Reminder (Account Expires in %%%%eot_descriptive_time%%%%)', 's2member-front', 's2member'))),

Check what you changed there.

I hope that helps. :slight_smile:

Hi Cristian, there is nothing before the opening PHP tag and the line in syscon.inc.php is exactly the same as you wrote it.

The message is not shown if the website is set in English but only in Italian. For now, I just change my website to English while I edit posts or pages, and go back to Italian when I have finished.

It’s not a big issue but I am worried s2member code may be corrupted and cause some serious problem in the future.

I saw another user had a similar problem some months ago and apparently she could not solve it, either

If you think something new on this subject, just let me know.
Cheers
Leo

1 Like

I know I’m late to the conversation, but whenever I’ve seen this it’s been another plugin throwing an error message and then s2 comes in and does its thing and gets the blame.

Have you tried disabling all plugins but s2 to see if it persists? If not, add them back one at a time to see which one causes it.

1 Like