response->results->grouping->group->doc->url)) $xml_url = $xml->response->results->grouping->group->doc->url; if ($xml_url = get_permalink()) $checkyandex = 1; return $checkyandex; } $checkyandex = addurl_autocheckyandex ($url, $ip); $checkgoogle = 0; $url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:'. get_permalink(); $body = file_get_contents($url); $json = json_decode($body); foreach ($json->responseData->results as $resultjson) { $result_google['urls']= $resultjson->url; if ($result_google = get_permalink()) {$checkgoogle = 1;} } if ($checkyandex and $checkgoogle) $addurilkacheck = '● '; if ($checkyandex and !$checkgoogle) $addurilkacheck = '◖ '; if (!$checkyandex and $checkgoogle) $addurilkacheck = '◗ '; $addurilkatitle = $addurilkacheck . __('Addurilka', 'wp-ya-addurl'); } else $addurilkatitle = __('Addurilka', 'wp-ya-addurl'); $args = array( 'id' => 'addurilka', 'title' => $addurilkatitle, 'meta' => array( 'class' => 'addurilka', 'target' => '_blank', 'title' => __('Add url in search engine', 'wp-ya-addurl') ) ); $wp_ya_addurl_admin_bar->add_node($args); $args = array( 'id' => 'addurlcheck', 'title' => __('Check the link in', 'wp-ya-addurl'), 'href' => $linkforcheckyandex, 'parent' => 'addurilka', 'meta' => array( 'class' => 'addurlcheck', 'target' => '_blank', 'menu_icon' => 'dashicons-products', 'title' => __('Checking the url to indexing', 'wp-ya-addurl') ) ); $wp_ya_addurl_admin_bar->add_node($args); $args = array( 'id' => 'yandexurlcheck', 'title' => __('Yandex', 'wp-ya-addurl'), 'href' => $linkforcheckyandex, 'parent' => 'addurlcheck', 'meta' => array( 'class' => 'yandexurlcheck', 'target' => '_blank', 'title' => __('Checking the url to indexing in Yandex', 'wp-ya-addurl') ) ); $wp_ya_addurl_admin_bar->add_node($args); $args = array( 'id' => 'googleurlcheck', 'title' => __('Google', 'wp-ya-addurl'), 'href' => $linkforcheckgoogle, 'parent' => 'addurlcheck', 'meta' => array( 'class' => 'googleurlcheck', 'target' => '_blank', 'title' => __('Checking the url to indexing in Google', 'wp-ya-addurl') ) ); $wp_ya_addurl_admin_bar->add_node($args); $args = array( 'id' => 'addurlsent', 'title' => __('Send the link to', 'wp-ya-addurl'), 'href' => $linkforcheckyandex, 'parent' => 'addurilka', 'meta' => array( 'class' => 'addurlsent', 'target' => '_blank', 'title' => __('Send the url in search engine', 'wp-ya-addurl') ) ); $wp_ya_addurl_admin_bar->add_node($args); $args = array( 'id' => 'yandexaddurlsent', 'title' => __('Yandex', 'wp-ya-addurl'), 'href' => $linkforsenttoyandex, 'parent' => 'addurlsent', 'meta' => array( 'class' => 'yandexaddurlsent', 'target' => '_blank', 'title' => __('Send this url to Yandex.Webmaster', 'wp-ya-addurl') ) ); $wp_ya_addurl_admin_bar->add_node($args); $args = array( 'id' => 'googleaddurlsent', 'title' => __('Google', 'wp-ya-addurl'), 'href' => $linkforsenttogoogle, 'parent' => 'addurlsent', 'meta' => array( 'class' => 'googleaddurlsent', 'target' => '_blank', 'title' => __('Send this url to Google', 'wp-ya-addurl') ) ); $wp_ya_addurl_admin_bar->add_node($args); } add_action('admin_bar_menu', 'wp_ya_addurl', 91); function wp_ya_addurl_settings_init() { add_settings_field( 'wp_ya_addurl_setting_user', __('User', 'wp-ya-addurl'), 'wp_ya_addurl_setting_user', 'reading', 'wp_ya_addurl_plugin_menu' ); register_setting( 'reading', 'wp_ya_addurl_setting_user' ); add_settings_field( 'wp_ya_addurl_setting_user_key', __('Key', 'wp-ya-addurl'), 'wp_ya_addurl_setting_user_key', 'reading', 'wp_ya_addurl_plugin_menu' ); register_setting( 'reading', 'wp_ya_addurl_setting_user_key' ); add_settings_field( 'wp_ya_addurl_setting_user_ip', __('IP', 'wp-ya-addurl'), 'wp_ya_addurl_setting_user_ip', 'reading', 'wp_ya_addurl_plugin_menu' ); register_setting( 'reading', 'wp_ya_addurl_setting_user_ip' ); add_settings_field( 'wp_ya_addurl_setting_autocheck', __('Аutocheck', 'wp-ya-addurl'), 'wp_ya_addurl_setting_autocheck', 'reading', 'wp_ya_addurl_plugin_menu' ); register_setting( 'reading', 'wp_ya_addurl_setting_autocheck' ); } add_action( 'admin_init', 'wp_ya_addurl_settings_init' ); function wp_ya_addurl_plugin_menu() { add_options_page(__('Addurilka', 'wp-ya-addurl'), __('Addurilka', 'wp-ya-addurl'), 'manage_options', 'wp_ya_addurl-plugin', 'wp_ya_addurl_plugin_page'); } add_action('admin_menu', 'wp_ya_addurl_plugin_menu'); function wp_ya_addurl_plugin_page(){ echo '
● " . __('Addurilka - url in Yandex and Google', 'wp-ya-addurl') . "
"; echo "◖ " . __('Addurilka - url in Yandex', 'wp-ya-addurl') . "
"; echo "◗ " . __('Addurilka - url in Google', 'wp-ya-addurl') . "
"; echo "○ " . __('Addurilka - no url in Yandex and Google', 'wp-ya-addurl') . "
"; echo "" . __('In Yandex all very uncomfortable and paranoid, so try to set up autocheck. It can work, but maybe not.', 'wp-ya-addurl') . "
"; echo '