-
I’m sure this is a problem with userpro, no record of it in the error log so I guess it’s a JS error and not php?
Strange thing is that it only happens sometimes, any idea as what the cause could be?
The syntax error can only happen if another theme or plugin is conflicting with UserPro. Did you ever experience it on this site?
Nope.
Any idea why it’d only happen sometimes when I’m logging in and not other times? I think if there was an error it’d happen every time until it’s fixed.
It happens only when using the UP login dialogue.
Syntax error is only caused by php not js. It must be a hook error that get triggered when you login even periodically and causes login to break; similar to the old s2member conflict with userpro
@Ahmed, I decreased allowed memory on my server to 32MB from 128MB, when I login now I get the SyntaxError: Unexpected token < every time.
So it’s related to the allowed memory limit somehow, advice on how to debug?
Looks like I’m not the only one http://userproplugin.com/userpro/forums/topic/syntaxerror-unexpected-token-2/
Error in firefox:- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
When logging in ^
JSON related?
It appears to be caused by a conflict with gravity forms?
To be specific – When I set memory limit to 128MB this DOESN’T happen, but it does occur when the memory limit is 40 MB (define(‘WP_MEMORY_LIMIT’, ’40M’); )
Strange that a lower memory limit would throw a syntaxerror, no?
I get the same syntax error when I edit profiles too.
This is a serious issue that only occurs when WP memory limit is too low, which it shouldn’t I don’t think.
There is an error in userpro’s script, don’t know if this is the cause.
Uncaught TypeError: Cannot read property ‘width’ of undefined 192.168.1.141:8888/wp-content/plugins/userpro/scripts/scripts.min.js?ver=3.9.1:276
Ok after 6 hours yesterday I’ve finally worked out what causes this, it’s UP eating up server memory.
When logging in UP makes an Ajax call to admin-ajax.php and if you’ve set your server memory too low the response is something like ‘<br /> <b>Fatal error</b>: Allowed memory size of 41943040 bytes exhausted (tried to allocate 30720 bytes) in <b>/home/domain/public_html/sitename.com/wp-admin/includes/post.php</b> on line <b>822</b><br />’
Since it returns an html page in error if memory is too low that’s what it see’s as a ‘syntax error’, since it’s expecting a JSON response.
Depending on how many plugins you’re running you probably need a minimum of 64MB of memory allocated on your server.
Or UP needs to work with caching plugins or no one on shared hosting will ever be able to run it properly.
I repeat, ALL of the syntax errors people are getting are NOT plugin conflicts, they’re just UP eating up server memory.
You must be logged in to reply to this topic.