Unfortunately, this is most likely a problem in another plug-in or your theme that’s triggering an error in My Tickets.
Most likely, you have some other software that’s printing information to the screen either in the ‘init’ phase or earlier, and that’s causing this error in My Tickets.
In general, no content should be printed to the screen during the initialization phase, as that prevents headers from being sent.
OK Joe, Thanks. Any tips on working it out?
First step is to find out what is causing the issue. Disable all plugins and see if it goes away; if not, switch to a default theme. Once you’ve got the warnings gone, activate things one at a time until you find out what is causing the issue.
Hi Joe
I have done lots of debugging including using troubleshooting mode with no plugins enabled and the twenty nineteen theme, the error still occured!
I am wondering if this error could be being created by cron jobs, I have added the following to your code and the error has stopped. I am not sure if this is right or even makes sense.
function mt_set_user_unique_id() {
$unique_id = ( isset( $_COOKIE[‘mt_unique_id’] ) ) ? $_COOKIE[‘mt_unique_id’] : false;
if ( ! $unique_id ) {
if ( !defined( ‘DOING_CRON’ ) )
{
$unique_id = mt_generate_unique_id();
setcookie( ‘mt_unique_id’, $unique_id, time() + 60 * 60 * 24 * 7, COOKIEPATH, COOKIE_DOMAIN, true, true );
}
}
}
Apologies if this is wasting your time!
Hi
I did a bit more tidying!
function mt_set_user_unique_id() {
if (( defined( ‘DOING_CRON’ ) AND DOING_CRON) == false)
{
$unique_id = ( isset( $_COOKIE[‘mt_unique_id’] ) ) ? $_COOKIE[‘mt_unique_id’] : false;
if ( ! $unique_id )
{
$unique_id = mt_generate_unique_id();
setcookie( ‘mt_unique_id’, $unique_id, time() + 60 * 60 * 24 * 7, COOKIEPATH, COOKIE_DOMAIN, true, true );
}
}
}
I can see the cookie being created when I refresh a page event in the back office. I assume this is meant to check / create the cookie every time a page is loaded?
I am a develper but not wordpress / php!
Love the plugin by the way, simple to use and just works!
Thanks for adding a fix to the latest update.