pro = get_option('siteseo_pro_options', []); siteseo_pro_load_license(); //check updates sitseopro_check_updates(); // Check for updates include_once(SITESEO_PRO_DIR . 'main/plugin-update-checker.php'); $siteseo_updater = SiteSEO_PucFactory::buildUpdateChecker(siteseo_pro_api_url().'/updates.php?version='.SITESEO_PRO_VERSION, SITESEO_PRO_FILE); // Add the license key to query arguments $siteseo_updater->addQueryArgFilter('siteseo_pro_updater_filter_args'); // Show the text to install the license key add_filter('puc_manual_final_check_link-siteseo-pro', 'siteseo_pro_updater_check_link', 10, 1); // Cron Action add_action('siteseo_404_cleanup', 'siteseo_404_cleanup'); add_action('siteseo_send_404_report_email', '\SiteSEOPro\RedirectManager::send_weekly_report'); if(wp_doing_ajax()){ \SiteSEOPro\Ajax::hooks(); return; } //breadcrumbs add_action('init', '\SiteSEOPro\RegisterBlocks::init', 999); add_action('init', '\SiteSEOPro\Breadcrumbs::enable_breadcrumbs'); add_action('init', '\SiteSEOPro\Admin::local_business_block'); if(is_admin()){ \SiteSEOPro\Admin::init(); return; } // Actions // TODO: Will need to shift these actions to a seperate file as the code grows. add_action('wp_head','\SiteSEOPro\Tags::dublin_core', 2); add_filter('wp_robots', '\SiteSEOPro\Tags::woocommerce_index_tags',9999); add_filter('wp_head', '\SiteSEOPro\Tags::woocommerce'); add_action('wp_head','\SiteSEOPro\Tags::easy_digital_downloads', 2); add_action('wp_head','\SiteSEOPro\Tags::structured_data'); add_action('template_redirect', '\SiteSEOPro\RedirectManager::handle_404_request'); add_action('wp_head', '\SiteSEOPro\StructuredData::render'); } // Deleting 404 older than 30 days function siteseo_404_cleanup(){ global $wpdb, $siteseo; // Clear Logs if(!empty($siteseo->pro['clean_404_logs'])){ $wpdb->query("DELETE FROM `".$wpdb->prefix."siteseo_redirect_logs` WHERE `timestamp` < DATE_SUB(NOW(), INTERVAL 30 DAY)"); } }