<?php

if (!current_user_can('seoaic_edit_plugin')) {
    return;
}

if (isset($_GET['settings-updated'])) {
    add_settings_error('seoaic_messages', 'seoaic_message', esc_html__('Settings Saved', 'seoai-client'), 'updated');
}

settings_errors('seoaic_messages');

global $SEOAIC, $SEOAIC_OPTIONS;

if (isset($_GET['clean_dashboard']) && $_GET['clean_dashboard'] == 'true') {
    $SEOAIC_OPTIONS['on_page_seo_data'] = [];
    $SEOAIC_OPTIONS['dashboard_seo_data_monthly'] = [];
    update_option('seoaic_options', $SEOAIC_OPTIONS);
}
?>
<div class="row full-width">
    <?php echo $SEOAIC->dashboard->dashboard_HTML();?>
</div>