//Probably hack or bad refresh, redirect to homepage
$redirect_url=home_url();
}
wp_redirect($redirect_url);
exit;
}
$token=get_option('autopostToMastodon-token');
if(empty($token)){
update_option(
'autopostToMastodon-notice',
serialize(
array(
'message'=>'<strong>Mastodon Autopost</strong> : '.__('Please login to your mastodon account!','autopost-to-mastodon').'<a href="'.get_admin_url().'options-general.php?page=autopost-to-mastodon"> '.__('Go to Mastodon Autopost Settings','autopost-to-mastodon').'</a>',
'class'=>'error',
)
)
);
}
}
/**
* Enqueue_scripts
*
* @return void
*/
publicfunctionenqueue_scripts($hook){
global$pagenow;
$infos=get_plugin_data(__FILE__);
if($pagenow=="options-general.php"){
//We might be on settings page <-- Do you know a bette solution to get if we are in our own settings page?
$message=__("This is my first post with Mastodon Autopost for Wordpress",'autopost-to-mastodon')." - https://wordpress.org/plugins/autopost-to-mastodon/";