Hi @forinn,
Can you please share on which screen/page you are seeing this notice? We made changes to prevent translatable strings from being loaded too early in version 2.2.3.1 and haven’t encountered this issue since.
Thread Starter
wpuser
(@forinn)
Hi Mircea,
Thank you for your swift response!
I have two different WordPress websites, on two different servers, and the error message has actually always been there since the WordPress 6.7 update. On both my websites. Latest WordPress and latest wpcode version.
The errormessage comes in my debug/errorlog on each pageview and is always te same.
Hi @forinn,
Do you have any snippets active on the website? We haven’t had any reports about this behavior since the fix in 2.2.3.1 and we can’t replicate it on our end.
Can you please try deactivating your WPCode snippets to see if that makes a difference?
Thread Starter
wpuser
(@forinn)
Hi Mircea,
Disabling the snippets does indeed resolve the issue, no more errors appear in my error/debug log.
But not having the snippets active, that would make the plugin obsolete right, it’s kinda the purpose to use snippets 🙂
What do you need from me in order to fix the error?
Hi @forinn,
Thank you for confirming that. You are right that disabling all the snippets is not a solution, but in this case, we should rule out that one of the snippets you are using is causing this notice.
Would it be possible to reactivate the snippets one by one until you see the notice again and share the code of the snippet that is causing this notice with us? It could also be helpful to know which auto-insert location or conditional logic rules that snippet is using in case that is part of why you are seeing this notice.
Thank you
Thread Starter
wpuser
(@forinn)
Hi there,
First off, Merry Christmas!
I have been looking at which snippets are causing it. I believe it has something to do with function to generate a shortcode.
Below snippet is set to run everywhere
function content_voor_ingelogde_gebruikers( $atts, $content = null ) {
if ( is_user_logged_in() ) {
return do_shortcode($content);
} else {
return '<p>Deze pagina is alleen toegankelijk voor ingelogde gebruikers.</p>';
}
}
add_shortcode( 'alleen_ingelogd', 'content_voor_ingelogde_gebruikers' );
There are about 2-4 errors of the same kind on each pageview with this snippet enabled.
Hope this helps.
Br,
Alessia
Hi Alessia,
Thank you for providing more details. The snippet you shared does not run the shortcode logic through WPCode and instead runs the php code for that directly, so I don’t see how that could be causing this issue (it should be causing the same notice for any snippet).
Would it be possible to reach out using the form at https://wpcode.com/contact and share with us an export of the snippets you are using on your site? You can grab that from the WPCode Tools page.
That should help us replicate the issue in order to provide a fix.
Thank you
Thread Starter
wpuser
(@forinn)
I did not want to disable my snippets on my live website, where traffic comes in, so I disabled them all on the staging site and enabled them one by one. The one I shared with you is the only one creating the error. It was also the only one enabled at the time. When enabled, that error comes in immediately. When turned off, the errors disappear as well. I also have no explanation for it.
I am happy to give you a look behind the scenes, but my staging site is behind a IP authentication. I will need to authorize your IP address to give you access. Also I would like to have your email to create a backend login for you. Would you be able to share me a password protected snippet or dm with your IP address and e-mail so I can give you a look?
I will also share both exports with you via the form.
Thanks in advance and happy holidays.
Hi @forinn,
There’s no way to DM you here, that’s why I suggested using the contact form to share those exports privately.
Thank you
Hi @forinn,
We haven’t heard back from you, so I will mark this as resolved for now. Please reply here if you are still encountering this issue.
I recommend also updating the translations for your site, as some users mentioned that fixed the issue for them.