' .__('Please, set setting for Addurilka plugin.', 'addurilka') . '
'; delete_transient( 'addurl-admin-notice' ); } } $plugin_file = plugin_basename(__FILE__); add_filter("plugin_action_links_$plugin_file", 'addurl_plugin_settings_link' ); function addurl_plugin_settings_link($links) { $settings_link = '' . __('Settings', 'addurilka') . ''; array_unshift( $links, $settings_link ); return $links; } function addurl_is_user_role( $role, $user_id = null ) { $user = is_numeric( $user_id ) ? get_userdata( $user_id ) : wp_get_current_user(); if( ! $user ) return false; return in_array( $role, (array) $user->roles ); } add_action('admin_bar_menu', 'wp_ya_addurl', 91); function wp_ya_addurl($wp_ya_addurl_admin_bar) { $addurilkatitle =''; function addurl_get_check_URL() { $check_url = get_permalink(); $check_url = preg_replace('~^https?://(?:www\.)?|/$~', '', $check_url); $check_url = rawurlencode($check_url); return $check_url; } $linkforcheckyandex = 'http://yandex.ru/yandsearch?text=url%3A%28www.'.addurl_get_check_URL().'%29+%7C+url%3A%28'.addurl_get_check_URL().'%29'; $linkforcheckgoogle = 'https://www.google.ru/?q=site:'.addurl_get_check_URL().'#newwindow=1&q=site:'.addurl_get_check_URL().''; function addurl_get_sent_URL() { $sent_url = get_permalink(); $sent_url = rawurlencode($sent_url); return $sent_url; } $linkforsenttoyandex = 'http://webmaster.yandex.ru/addurl.xml?url='.addurl_get_sent_URL(); $linkforsenttogoogle = 'https://www.google.com/webmasters/tools/submit-url?urlnt='.addurl_get_sent_URL(); if (get_option('wp_ya_addurl_setting_autocheck') == true) { $addurilkacheck = '○ '; if (get_option('wp_ya_addurl_setting_user') && get_option('wp_ya_addurl_setting_user_key') && get_option('wp_ya_addurl_setting_user_ip')) { $url = 'https://yandex.ru/search/xml?user=' . get_option('wp_ya_addurl_setting_user') . '&key=' . get_option('wp_ya_addurl_setting_user_key') . '&query='. get_permalink() . ''; $ip = get_option('wp_ya_addurl_setting_user_ip'); function addurl_autocheckyandex ($url, $ip) { $checkyandex = 0; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_NOBODY, false); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (Windows; U; Windows NT 5.0; En; rv:1.8.0.2) Gecko/20070306 Firefox/1.0.0.4"); curl_setopt($ch, CURLOPT_INTERFACE, $ip); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $xml_data = curl_exec($ch); curl_close($ch); $xml = new SimpleXMLElement($xml_data); if (isset($xml->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); } else { $checkyandex = 0; if( get_transient( 'addurl-admin-notice-2' ) ){ echo '' .__('Please, enter all setting for Yandex.XML. Automatic check link for Yandex not working.', 'addurilka') . '
| ';
echo ' ';
echo " ';
submit_button();
echo '';
echo '" . __('Settings for Addurilka', 'addurilka') . ""; echo "" . __('Values display for automatic check url (test)', 'addurilka') . ""; echo "● " . __('Addurilka - url in Yandex and Google', 'addurilka') . " "; echo "◖ " . __('Addurilka - url in Yandex', 'addurilka') . " "; echo "◗ " . __('Addurilka - url in Google', 'addurilka') . " "; echo "○ " . __('Addurilka - no url in Yandex and Google', 'addurilka') . " "; echo "" . __('Main options', 'addurilka') . ""; echo ' | ';
?>
Thank you for using my plugin! – how can I thank you?', 'addurilka') ?>
support forum or plugin\'s site for help.', 'addurilka'), "https://wordpress.org/support/plugin/addurilka", "http://wp.starcoms.ru/plugin-addurilka/") ?> |