Error when updating a post

WHen I try to update a post, instead of refreshing the page, it displays a blank page (with url mysite.com/wp-admin/post.php)

And the following lines :

Warning: sprintf(): Too few arguments in /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php on line 108

Warning: sprintf(): Too few arguments in /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php on line 137

Warning: sprintf(): Too few arguments in /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php on line 108

Warning: sprintf(): Too few arguments in /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php on line 137

Warning: Cannot modify header information - headers already sent by (output started at /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php:108) in /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-admin/post.php on line 222

Warning: Cannot modify header information - headers already sent by (output started at /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php:108) in /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-includes/pluggable.php on line 1251

Warning: Cannot modify header information - headers already sent by (output started at /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php:108) in /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-includes/pluggable.php on line 1254

Thank you for your help,

This is an issue with the French translation of the original English, though I’m not sure if it’s a problem with s2Member, WP core, or both.

Some PHP file somewhere, most likely has a space or newline before the opening <?php.

If you customized any files, review those first.

output started at /homepages/6/d637940218/htdocs/formation-blog-professionnel/wp-content/plugins/s2member-pro/src/includes/syscon.inc.php:108

Did you edit /s2member-pro/src/includes/syscon.inc.php?

Cristian, that wouldn’t cause a “too few arguments” error. It’s a translation issue, which is why you don’t see it in English.

1 Like

So, would you recommend me to set my website and s2member in english ?

I didn’t, and I looked in to search for any space or newline before <?php, but nothing seems wrong.

No, that seems defeatist! The problem is that I am not sure if it’s a core translation problem or an s2Member translation problem because I’m not sure how s2Member handles translations these days.

What version of WP are you running?

I just deleted the s2member translation file and everything is back to normal. I’m running the last version.

So it’s not the WP translation but the s2Member translation that’s the problem then. At least that should tell @clavaque where to look to resolve the problem in future.

That also means that there is a way to fix this if you are prepared to do a little customization. What I’d suggest is that you set up the s2Member Stripe Pro form in English. Include any custom fields that you use. Then go to the front-end of the page where you put the shortcode, right-click, select View Page Source and copy all the HTML code you then see. Then paste that into a plain text editor like Notepad ++ or Geany (don’t use a wordprocessor) and save it with a .php extension (something like new.php).

Now go to /wp-content/plugins/s2member-pro/src/includes/templates/forms/stripe-checkout-form.php, copy the contents of that file into a new plain text file, and save it as old.php.

Then compare the two files you have to see where the code starts to match. It will probably occur shortly before a statement like “Don’t delete this”. In the file that you copied from your site’s front end, delete everything before where the code matches and save again.

Now look lower down the two files, and see where the last line of similar code appears. It will probably end somewhere near a closing </form> tag. In the file that you copied from your site’s front end, delete everything after that point and save again.

Now look at all the English words that will appear on the form, and change them to appropriate French words. (This is how we get around the translation problem.) Save again.

Now re-name that file stripe-checkout-form.php and upload it to your active theme’s main directory (i.e the one where the functions.php and style.css files are). You will need to use FTP or a similar tool for that, or else use the WP File Manager plugin to upload the file to the correct directory from within your site.

s2Member checks for the existence of the file you have just created before it uses the one you copied earlier, so the form in this file will get used instead, so you should leave the original s2Member file where it is.

Similarly, you can change s2Member to French if you want after doing this, and the fix should still work. And it will continue to work even after an s2Member update. An update to your active theme might destroy the file, though, so keep a backup copy just in case.

Hi, thank you for this long post and help, I appreciate.

The problem in this topic was the update of a post. This went back to normal when I deleted s2Member translation file.

But in an other topic, I say that for the stripe form, it’s not working even if I delete this file, even if I set wordpress in english too. So, I think I will give up on Stripe for the moment.

Hello Sophie, you could not find a solution, could you? I have a similar issue, when I set my website in Italian.
Cheers
Leo