<?php 
/*
Plugin Name: SEO合集(支持百度/Google/Bing/头条推送)
Description: 含百度站长、360站长、Bing站长、今日头条站长、神马站长、IndexNow、tag标签内链、友情链接、百度地图sitemap、Google地图、 谷歌地图、关键词排名查询监控、360站长JS自动推送、 文章原创率检测、文章伪原创、 网站蜘蛛、robots、图片alt标签、天级推送、category隐藏、死链查询、百度自动推送、批量提交URL到站长、百度收录查询、批量推送未收录、301/404等功能、AI文章助手、流量监控。
Version: 2.2.1
Author: 沃之涛科技
Author URI: https://www.seoceo.cn
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
if(!defined('ABSPATH'))exit;
define('BAIDUSEO_VERSION','2.2.1');
define('BAIDUSEO_FILE',__FILE__);
define('BAIDUSEO_NAME',plugin_basename(__FILE__));

spl_autoload_register('baiduseo_autoload');
function baiduseo_autoload($class) {
    $prefix = 'baiduseo_';

    if (strpos($class, $prefix) !== 0) {
        return;
    }
    $class_map = [
        'common'         => 'inc/common/index.php',
        'cron'           => 'inc/admin/cron.php',
        'cron_tongbu'    => 'inc/admin/cron_tongbu.php',
        'cron_ts'        => 'inc/admin/cron_ts.php',
        'cron_zhizhu'    => 'inc/admin/cron_zhizhu.php',
        'post'           => 'inc/admin/post.php',
        'get'            => 'inc/admin/get.php',
        'kp'             => 'inc/admin/kp.php',
        'seo'            => 'inc/admin/seo.php',
        'tag'            => 'inc/admin/tag.php',
        'zhizhu'         => 'inc/admin/zhizhu.php',
        'zz'             => 'inc/admin/zz.php',
        'youhua'         => 'inc/index/youhua.php',
        'set'            => 'inc/admin/set.php',
        
    ];
    
    $class_name = substr($class, strlen($prefix));

    // 检查映射数组中是否存在该类
    if (isset($class_map[$class_name])) {
        $file = plugin_dir_path(BAIDUSEO_FILE) . $class_map[$class_name];
        if (file_exists($file)) {
            require_once $file;
        }
    }
}

add_action('plugins_loaded', 'baiduseo_init');
function baiduseo_init() {
    (new baiduseo_common())->init();
    (new baiduseo_kp())->init();
    if (is_admin()) {
        
        baiduseo_init_admin();
    } else {
        
        (new baiduseo_youhua())->init();
        
    }
    (new baiduseo_zhizhu())->init();

    if (defined('DOING_CRON') && DOING_CRON) {
        baiduseo_init_cron();
    }
}

function baiduseo_init_admin() {
    (new baiduseo_get())->init();
    (new baiduseo_post())->init();
    (new baiduseo_kp())->init();
    (new baiduseo_seo())->init();
    (new baiduseo_tag())->init();
    
    (new baiduseo_zz())->init();
}
function baiduseo_init_cron() {
    (new baiduseo_cron())->init();
    (new baiduseo_cron_tongbu())->init();
    (new baiduseo_cron_ts())->init();
    (new baiduseo_cron_zhizhu())->init();
}








	




