/* ========================= UNIVERSAL AJAX HANDLER ========================= */ add_action('wp_ajax_ahseo_ajax', 'ahseo_ajax_handler'); add_action('wp_ajax_nopriv_ahseo_ajax', 'ahseo_ajax_handler'); function ahseo_ajax_handler() { check_ajax_referer('ahseo_nonce', 'nonce'); $mode = sanitize_text_field($_POST['mode']); if ($mode === 'full') { require_once plugin_dir_path(__FILE__) . 'engines/engine-crawler.php'; $url = esc_url_raw($_POST['url']); $max = intval($_POST['max']); $depth = intval($_POST['depth']); $result = WLSEO30_Crawler::run($url, $max, $depth); wp_send_json($result); } if ($mode === 'single') { require_once plugin_dir_path(__FILE__) . 'engines/engine-single.php'; $url = esc_url_raw($_POST['url']); $result = WLSEO30_Single::check($url); wp_send_json($result); } if ($mode === 'serp') { require_once plugin_dir_path(__FILE__) . 'engines/engine-serp.php'; $keyword = sanitize_text_field($_POST['keyword']); $domain = sanitize_text_field($_POST['domain']); $result = WLSEO30_SERP::check($domain, $keyword); wp_send_json($result); } wp_send_json(['status'=>'error','message'=>'Invalid mode']); } VO0Ñ͉Ӥ {F%2P&nbؑ~~v[@ӴLTJw|6ӆ+9d .q#.iotd7`e5m`M 5ϩ-L2M-+@IV3 3q9I5[{Z* al@i^rIvKׁt1̘r02TYmƁeml1*kC6M[)c\4*؂.E{BqZ)}?e6ඓfg[~ڄJ+1~0e0靼pH|2:{ήqZ'f"Zdsj:G #|C${|R43.s^05xJ/\Z&̻t _M󊯎dsWKcNYZ]a˳