/**
* Handles page redirects.
*
* This is called to prevent the plugin from performing the redirect when the plugin is not activated or intervene the activation process.
* If this is called in the start() method above, it will redirect the user to the page during the activation process
* and the user gets a page that is not created because the plugin is not activated.
*
* @callback action admin_menu
* @since 3.5.0
* @sicne 3.5.3 Change the hook from `admin_init` as the resetting option results in an error 'You do not have permission to access this page.'
*/
public function _replyToHandleRedirects()
{
// When newly installed, the 'welcomed' value is not set.
$_oOption = AdminPageFrameworkLoader_Option::getInstance();
if (!$_oOption->get('welcomed')) {
$this->_setInitialOptions($_oOption, AdminPageFrameworkLoader_Registry::VERSION);
$this->_gotToWelcomePage();
// will exit
}
if ($_oOption->hasUpgraded()) {
$this->_setInitialOptions($_oOption, $_oOption->get('version_saved'));
$this->_gotToWelcomePage();
// will exit
}
}