├── inc ├── feed-footer.php ├── feed.php ├── feed-single.php ├── feed-header.php ├── feed-item.php ├── hooks.php ├── admin.php └── tst-yandex-feed-core.php ├── img └── logo-itv.png ├── languages ├── yandexnews-feed-by-teplitsa-ru_RU.mo ├── yandexnews-feed-by-teplitsa.pot └── yandexnews-feed-by-teplitsa-ru_RU.po ├── js ├── admin-settings.js └── admin.js ├── css └── admin.css ├── tst-yandex-feed.php ├── readme.md ├── readme.txt └── LICENSE.txt /inc/feed-footer.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /img/logo-itv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teplitsa/tst-yandex-feed/HEAD/img/logo-itv.png -------------------------------------------------------------------------------- /languages/yandexnews-feed-by-teplitsa-ru_RU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teplitsa/tst-yandex-feed/HEAD/languages/yandexnews-feed-by-teplitsa-ru_RU.mo -------------------------------------------------------------------------------- /js/admin-settings.js: -------------------------------------------------------------------------------- 1 | if(typeof postboxes !== 'undefined' && postboxes) { 2 | postboxes.add_postbox_toggles( 'settings_page_layf_settings' ); 3 | } 4 | -------------------------------------------------------------------------------- /inc/feed.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /inc/feed-single.php: -------------------------------------------------------------------------------- 1 | '; 9 | ?> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /css/admin.css: -------------------------------------------------------------------------------- 1 | /** Admin Style **/ 2 | 3 | .layf-columns { 4 | 5 | } 6 | 7 | .layf-columns::after { 8 | clear: both; 9 | content: ""; 10 | display: table; 11 | } 12 | 13 | .layf-columns .layf-form { width: 90%; } 14 | .layf-columns .layf-sidebar { width: 100%; } 15 | 16 | @media screen and (min-width: 980px) { 17 | .layf-columns .layf-form { 18 | float: left; 19 | width: -webkit-calc(100% - 315px); 20 | width: calc(100% - 315px); 21 | max-width: 800px; 22 | } 23 | 24 | .layf-columns .layf-sidebar { 25 | float: left; 26 | width: 280px; 27 | margin-left: 35px; 28 | padding-top: 61px; 29 | } 30 | } 31 | 32 | 33 | #itv-card { 34 | max-width: 280px; 35 | background: #f9f9f9; 36 | padding: 10px; 37 | } 38 | 39 | #itv-card .itv-logo { 40 | width: 160px; 41 | padding: 5px; 42 | } 43 | 44 | #itv-card .itv-logo img { 45 | max-width: 100%; 46 | height: auto; 47 | } 48 | 49 | #itv-card .itv-logo a { display: block; } 50 | #itv-card p:last-child { margin-bottom: 0; } 51 | 52 | #wpbody-content .metabox-holder.tstyn-settings { 53 | padding-top: 0px; 54 | } -------------------------------------------------------------------------------- /inc/feed-header.php: -------------------------------------------------------------------------------- 1 | '; 5 | ?> 6 | xmlns:turbo="http://turbo.yandex.ru" version="2.0"> 7 | 8 | <?php bloginfo_rss('name');?> 9 | 10 | 11 | 15 | 16 | 17 | 21 | 22 | 23 | 27 | 28 | 29 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /js/admin.js: -------------------------------------------------------------------------------- 1 | ( function( wp ) { 2 | if(!wp || !wp.data || !wp.data.select( 'core/editor' )) { 3 | // console.log("no editor"); 4 | return 5 | } 6 | 7 | const { getCurrentPostAttribute } = wp.data.select("core/editor"); 8 | 9 | let wasSavingPost = wp.data.select( 'core/editor' ).isSavingPost(); 10 | let wasAutosavingPost = wp.data.select( 'core/editor' ).isAutosavingPost(); 11 | let wasPreviewingPost = wp.data.select( 'core/editor' ).isPreviewingPost(); 12 | 13 | wp.data.subscribe( () => { 14 | 15 | const isSavingPost = wp.data.select( 'core/editor' ).isSavingPost(); 16 | const isAutosavingPost = wp.data.select( 'core/editor' ).isAutosavingPost(); 17 | const isPreviewingPost = wp.data.select( 'core/editor' ).isPreviewingPost(); 18 | const postMeta = wp.data.select( 'core/editor' ).getCurrentPostAttribute('meta'); 19 | const post2yandexError = postMeta ? postMeta['tstyn_error'] : null; 20 | 21 | const isDoneSaving = ( 22 | ( wasSavingPost && ! isSavingPost && ! wasAutosavingPost ) || 23 | ( wasAutosavingPost && wasPreviewingPost && ! isPreviewingPost ) 24 | ); 25 | 26 | wasSavingPost = isSavingPost; 27 | wasAutosavingPost = isAutosavingPost; 28 | wasPreviewingPost = isPreviewingPost; 29 | 30 | if ( isDoneSaving ) { 31 | let noticeId = 'tstyn-post2yandex-error'; 32 | 33 | wp.data.dispatch( 'core/notices' ).removeNotice( noticeId ); 34 | 35 | if(post2yandexError) { 36 | let errorMessage = decodeURIComponent(post2yandexError.replace(/[+]/g, " ")); 37 | 38 | wp.data.dispatch( 'core/notices' ).createNotice( 39 | 'error', // success, info, warning, error. 40 | errorMessage, 41 | { 42 | isDismissible: true, 43 | id: noticeId, 44 | } 45 | ); 46 | } 47 | } 48 | }); 49 | 50 | } )( window.wp ); 51 | -------------------------------------------------------------------------------- /inc/feed-item.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | turbo=""> 6 | <?php the_title_rss();?> 7 | 8 | 9 | 10 | 17 | 18 | 19 | 22 | 23 | 24 | $img): 27 | ?> 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | $link): ?> 58 | 59 | 60 | 61 | 9) ? $gmt_offset_abs.'00' : ('0'.$gmt_offset_abs.'00'); 68 | $gmt_offset_str = $gmt_offset >= 0 ? '+' . $gmt_offset_str : '-' . $gmt_offset_str; 69 | ?> 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /tst-yandex-feed.php: -------------------------------------------------------------------------------- 1 | 21 | 22 | This program is free software; you can redistribute it and/or modify 23 | it under the terms of the GNU General Public License as published by 24 | the Free Software Foundation; either version 2 of the License, or 25 | (at your option) any later version. 26 | 27 | This program is distributed in the hope that it will be useful, 28 | but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | GNU General Public License for more details. 31 | 32 | You should have received a copy of the GNU General Public License 33 | along with this program; if not, write to the Free Software 34 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 35 | */ 36 | 37 | if(!defined('ABSPATH')) die; // Die if accessed directly 38 | 39 | // Plugin version: 40 | if( !defined('LAYF_VERSION') ) 41 | define('LAYF_VERSION', '1.12.14'); 42 | 43 | // Plugin DIR, with trailing slash: 44 | if( !defined('LAYF_PLUGIN_DIR') ) 45 | define('LAYF_PLUGIN_DIR', plugin_dir_path( __FILE__ )); 46 | 47 | // Plugin URL: 48 | if( !defined('LAYF_PLUGIN_BASE_URL') ) 49 | define('LAYF_PLUGIN_BASE_URL', plugin_dir_url(__FILE__)); 50 | 51 | // Plugin ID: 52 | if( !defined('LAYF_PLUGIN_BASE_NAME') ) 53 | define('LAYF_PLUGIN_BASE_NAME', plugin_basename(__FILE__)); 54 | 55 | // Default max age of feed posts: 56 | if( !defined('LAYF_DEFAULT_MAX_POST_AGE') ) 57 | define('LAYF_DEFAULT_MAX_POST_AGE', '8'); 58 | 59 | // Plugin version: 60 | if( !defined('LAYF_YANDEX_CMS_PLUGIN_ID') ) 61 | define('LAYF_YANDEX_CMS_PLUGIN_ID', '6987189DB81CB618F223396A679B6B05'); 62 | 63 | if(get_locale() === 'ru_RU') { 64 | load_textdomain('yandexnews-feed-by-teplitsa', dirname(realpath(__FILE__)).'/languages/yandexnews-feed-by-teplitsa-ru_RU.mo'); // Load the lang. pack included 65 | } 66 | load_plugin_textdomain('yandexnews-feed-by-teplitsa', false, basename(dirname(__FILE__)).'/languages/'); // Load the lang. pack by priority 67 | 68 | function yandexnews_feed_by_teplitsa_load_plugin_textdomain() { 69 | load_plugin_textdomain('yandexnews-feed-by-teplitsa', false, '/'.basename(LAYF_PLUGIN_DIR).'/languages/'); 70 | } 71 | add_action( 'plugins_loaded', 'yandexnews_feed_by_teplitsa_load_plugin_textdomain' ); 72 | 73 | /** Init **/ 74 | require_once(plugin_dir_path(__FILE__).'inc/tst-yandex-feed-core.php'); 75 | $layf = La_Yandex_Feed_Core::get_instance(); 76 | 77 | 78 | register_activation_hook( __FILE__, array( 'La_Yandex_Feed_Core', 'on_activation' )); 79 | register_deactivation_hook(__FILE__, array( 'La_Yandex_Feed_Core', 'on_deactivation' )); 80 | 81 | require_once(plugin_dir_path(__FILE__).'inc/hooks.php'); 82 | 83 | /** strings to be translated **/ 84 | $strings = array( 85 | __('The plugin creates feed for Yandex.News service', 'yandexnews-feed-by-teplitsa'), 86 | __('Teplitsa', 'yandexnews-feed-by-teplitsa'), 87 | ); 88 | -------------------------------------------------------------------------------- /inc/hooks.php: -------------------------------------------------------------------------------- 1 | query_vars['rest_route']) 14 | && ( empty($_POST['action']) || $_POST['action'] !== 'editpost' || empty($_POST['content']) ) 15 | ) { 16 | // error_log('SKIP tstyn update'); 17 | return; 18 | } 19 | 20 | if ( wp_is_post_revision( $post_id ) ) { 21 | return; 22 | } 23 | 24 | if(!get_option('layf_enable_turbo')) { 25 | return; 26 | } 27 | 28 | // setup_postdata($post_id); 29 | global $post; 30 | if(!get_the_ID() && $post_id) { 31 | $post = get_post($post_id); 32 | } 33 | // error_log("after post setup get_the_ID:" . get_the_ID()); 34 | 35 | if(!get_the_ID() || !get_the_title()) { 36 | return; 37 | } 38 | 39 | // error_log("run update in yandex..."); 40 | 41 | // error_log("update_turbo_page_in_yandex..."); 42 | $yandex_client = TstYandexNewsAPIClient::get_instance(); 43 | 44 | TstYandexNewsShortcodes::setup_shortcodes(); 45 | 46 | $sync_time = get_post_meta( $post_id, 'tstyn_sync_time', true); 47 | if($sync_time) { 48 | if(time() - intval($sync_time) <= self::$sync_delay) { 49 | return; 50 | } 51 | } 52 | 53 | $error = ""; 54 | try { 55 | $yandex_client->update_current_post_in_yandex(); 56 | update_post_meta( $post_id, 'tstyn_sync_time', time()); 57 | } 58 | catch(TstYandexNewsInvalidAuthTokenException $e) { 59 | $error = __( 'Turbo page update error: invalid auth token error', 'yandexnews-feed-by-teplitsa' ); 60 | } 61 | catch(TstYandexNewsHostNotVerifiedException $e) { 62 | $error = __( 'Turbo page update error: host not verified', 'yandexnews-feed-by-teplitsa' ) . " " . La_Yandex_Feed_Core::get_host(); 63 | } 64 | catch(TstYandexNewsResourceNotFoundException $e) { 65 | $error = __( 'Turbo page update error: resource not found', 'yandexnews-feed-by-teplitsa' ) . " " . La_Yandex_Feed_Core::get_host_id(); 66 | } 67 | catch(Exception $e) { 68 | $error = __( 'Turbo page update error:', 'yandexnews-feed-by-teplitsa' ) . " " . $e->getMessage(); 69 | } 70 | 71 | // error_log("get_the_ID: " . get_the_ID()); 72 | // error_log("wp_is_post_revision: " . wp_is_post_revision( $post_id )); 73 | // error_log("get_the_ID: " . get_the_title()); 74 | // error_log("sync result error: " . $error); 75 | 76 | if($error) { 77 | set_transient(self::$error_transient . $post_id, $error); 78 | 79 | update_post_meta( $post_id, 'tstyn_error', $error); 80 | } 81 | else { 82 | delete_post_meta( $post_id, 'tstyn_error'); 83 | } 84 | 85 | wp_reset_postdata(); 86 | } 87 | 88 | public static function show_update_turbo_page_in_yandex_error() { 89 | $post_id = get_the_ID(); 90 | if(!$post_id) { 91 | return; 92 | } 93 | 94 | // error_log("show_update_turbo_page_in_yandex_error..."); 95 | // error_log("post_id:" . $post_id); 96 | 97 | $error_message = get_transient( self::$error_transient . $post_id ); 98 | 99 | if(!$error_message) { 100 | return; 101 | } 102 | 103 | delete_transient( self::$error_transient . $post_id ); 104 | ?> 105 |
106 |

107 |
108 | get_supported_post_types(); 121 | foreach($post_types as $post_type) { 122 | register_post_meta( $post_type, 'tstyn_error', array( 123 | 'show_in_rest' => true, 124 | 'single' => true, 125 | 'type' => 'string', 126 | ) ); 127 | } 128 | } 129 | } 130 | 131 | add_action( 'admin_notices', 'TstYandexNewsHooks::show_update_turbo_page_in_yandex_error' ); 132 | add_action( 'save_post', 'TstYandexNewsHooks::update_turbo_page_in_yandex' ); 133 | add_filter( 'the_content', 'TstYandexNewsHooks::remove_plugin_shortcodes_if_not_feed', 1 ); 134 | add_filter( 'init', 'TstYandexNewsHooks::register_post_meta', 10000 ); -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Yandex.News Feed by Teplitsa # 2 | 3 | Yandex.News Feed by Teplitsa - плагин для WordPress, позволяющий организовать трансляцию материалов сайта для сервиса Яндекс.Новости. 4 | 5 | _For English description scroll down, please._ 6 | 7 | Задача плагина - облегчить интеграцию любого сайта на WordPress с Яндекс.Новостями, позволив авторам сайта избежать кастомных технических решений. 8 | 9 | * Плагин элементарно устанавливается и требует минимум настроек. 10 | * Функции трансляции записей в Яндекс.Новости доступны сразу после установки. 11 | * Поддерживает генерацию турбо-страниц. 12 | 13 | Плагин разработан и поддерживается [Теплицей социальных технологий](http://te-st.ru/). 14 | 15 | 16 | ##Основные функции## 17 | 18 | * Обеспечение строгой и точной поддержки [формата трансляции Яндекс.Новостей](http://help.yandex.ru/news/info-for-mass-media.xml). 19 | * Обеспечение поддержки турбо-страниц Яндекса. 20 | * Настройка пользовательских (кастомных) типов записей, попадающих в трансляцию. 21 | * Фильтрация по категории (или кастомной таксономии), попадающих в трансляцию. 22 | * При редактировании записей доступен метабокс для перечня ссылок на источники, упомянутые в статье, а также для индивидуального исключения записи из трансляции. 23 | * В случае если генерация ленты чрезмерно нагружает ваш сервер БД, вы можете включить кэш, установив время его жизни в настройках. 24 | 25 | ## Установка и использование ## 26 | 27 | Процесс инсталляции плагина стандартен для WordPress. 28 | 29 | Если у вас установлен GIT, то вы можете клонировать репозиторий: https://github.com/Teplitsa/tst-yandex-feed.git 30 | или скачать его в виде ZIP архива: https://github.com/Teplitsa/tst-yandex-feed/archive/master.zip 31 | 32 | После установки настройки плагина доступны через меню _Настройки -> Яндекс.Новости_. Пример страницы настроек 33 | ![](https://itv.te-st.ru/wp-content/uploads/screen-2.png) 34 | 35 | Трансляция (фид) доступна для просмотра по ссылке _domain.ru/yandex/news/_. В настройках может быть указан собственный адрес, который работает при активных "красивых пермалинках". Пример выдачи 36 | ![](https://itv.te-st.ru/wp-content/uploads/screen-1.png) 37 | 38 | Плагин имеет минимум необходимых настроек. Подробнее о его использовании можно узнать на сайте разработчиков: 39 | * [руководство](https://te-st.ru/2014/12/02/wordpress-and-yandex-news/) по использованию плагина; 40 | * [скринкаст](https://te-st.ru/2014/04/08/screencast-yandex-news-plugin/) по использованию плагина; 41 | 42 | 43 | ## Помощь проекту ## 44 | 45 | Мы будем очень благодарны за вашу помощь проекту. Вы можете помочь следующими способами: 46 | 47 | * Добавить сообщение об ошибке или предложение по улучшению на GitHub. 48 | * Поделиться улучшениями кода, послав нам Pull Request. 49 | * Сделать перевод плагина или оптимизировать его для вашей страны. 50 | 51 | Если у вас есть вопросы по работе плагина, то обратитесь за поддержкой с помощью GitHub. 52 | 53 | Если вам нужна помощь волонтеров в установке и настройке - создайте задачу на [https://itv.te-st.ru](https://itv.te-st.ru) 54 | 55 | ##In English## 56 | 57 | Yandex.News Feed by Teplitsa - is the plugin for WordPress that allows you to convert your site materials into Yandex.News format. 58 | 59 | The goal of the plugin is to simplify the integration of any WordPress-powered website with Yandex.News. 60 | 61 | * The installation process is smooth and requires minimum settings. 62 | * Feed compatible with Yandex.News format is available immediately after installation. 63 | 64 | The plugin is developed and maintained by [Teplitsa of social technologies](http://te-st.ru/). 65 | 66 | 67 | ##Features## 68 | 69 | * Compatibility with Yandex.News [guidelines](http://help.yandex.ru/news/info-for-mass-media.xml). 70 | * Yandex turbo-pages support. 71 | * Custom post types support in feed. 72 | * Filtering by category or custom taxonomy term. 73 | * Individual settings for posts in feed. 74 | * If the feed generation process overloads your DB server, you can enable cache. Just set cache lifetime value. 75 | 76 | ## Installation and usage ## 77 | 78 | The plugin could be installed from WordPress dashboard using standard approach. 79 | 80 | If you have GIT, you can clone the repository: https://github.com/Teplitsa/tst-yandex-feed.git 81 | or download it as a ZIP archive: https://github.com/Teplitsa/tst-yandex-feed/archive/master.zip 82 | 83 | After installing the plugin settings are available under menu _Settings -> Yandex.Novosti_. 84 | 85 | Feed is accessible at the link _domain.ru/yandex/news/_. A custom URL could be specify through Settings page in case of active "pretty permalinks". 86 | 87 | The plugin has the minimum of settings. Read more about it's usage at the developers' website: 88 | 89 | * [detailed guide](https://te-st.ru/2014/12/02/wordpress-and-yandex-news/); 90 | * [screencast](https://te-st.ru/2014/04/08/screencast-yandex-news-plugin/); 91 | 92 | 93 | ## Help us ## 94 | 95 | We will be very grateful for your help us to make the plugin better. You can do it in the following ways: 96 | 97 | * Report bugs or suggest improvements at GitHub. 98 | * Send us a Pull Request with your fixes or improvements. 99 | * Translate the plugin or optimize it for your country. 100 | 101 | If you have questions about the plugin, then ask for support through GitHub. 102 | 103 | 104 | -------------------------------------------------------------------------------- /languages/yandexnews-feed-by-teplitsa.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021 Teplitsa 2 | # This file is distributed under the same license as the Yandex.News Feed by Teplitsa plugin. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Yandex.News Feed by Teplitsa 1.12.0\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/yandexnews-feed-by-teplitsa\n" 7 | "Last-Translator: FULL NAME \n" 8 | "Language-Team: LANGUAGE \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "POT-Creation-Date: 2021-04-08T22:11:19+03:00\n" 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 | "X-Generator: WP-CLI 2.1.0\n" 15 | "X-Domain: yandexnews-feed-by-teplitsa\n" 16 | 17 | #. Plugin Name of the plugin 18 | msgid "Yandex.News Feed by Teplitsa" 19 | msgstr "" 20 | 21 | #. Description of the plugin 22 | #: tst-yandex-feed.php:87 23 | msgid "The plugin creates feed for Yandex.News service" 24 | msgstr "" 25 | 26 | #. Author of the plugin 27 | #: tst-yandex-feed.php:88 28 | msgid "Teplitsa" 29 | msgstr "" 30 | 31 | #. Author URI of the plugin 32 | msgid "https://te-st.ru/" 33 | msgstr "" 34 | 35 | #: inc/hooks.php:50 36 | msgid "Turbo page update error: invalid auth token error" 37 | msgstr "" 38 | 39 | #: inc/hooks.php:53 40 | msgid "Turbo page update error: host not verified" 41 | msgstr "" 42 | 43 | #: inc/hooks.php:56 44 | msgid "Turbo page update error: resource not found" 45 | msgstr "" 46 | 47 | #: inc/hooks.php:59 48 | msgid "Turbo page update error:" 49 | msgstr "" 50 | 51 | #: inc/admin.php:55 52 | msgid "Settings" 53 | msgstr "" 54 | 55 | #: inc/admin.php:65 56 | msgid "GitHub" 57 | msgstr "" 58 | 59 | #: inc/admin.php:75 60 | #: inc/admin.php:234 61 | msgid "Yandex.News Feed Settings" 62 | msgstr "" 63 | 64 | #: inc/admin.php:76 65 | msgid "Yandex.News" 66 | msgstr "" 67 | 68 | #: inc/admin.php:83 69 | msgid "General" 70 | msgstr "" 71 | 72 | #: inc/admin.php:88 73 | msgid "URL for news feed" 74 | msgstr "" 75 | 76 | #: inc/admin.php:93 77 | msgid "URL for turbo pages feed" 78 | msgstr "" 79 | 80 | #: inc/admin.php:98 81 | msgid "Available shortcodes" 82 | msgstr "" 83 | 84 | #: inc/admin.php:103 85 | msgid "Yandex.Webmaster OAuth Token" 86 | msgstr "" 87 | 88 | #: inc/admin.php:108 89 | msgid "Post types for feed" 90 | msgstr "" 91 | 92 | #: inc/admin.php:113 93 | msgid "Max posts age for feed" 94 | msgstr "" 95 | 96 | #: inc/admin.php:118 97 | msgid "Logo URL for feed description" 98 | msgstr "" 99 | 100 | #: inc/admin.php:123 101 | msgid "Square Logo URL for feed description" 102 | msgstr "" 103 | 104 | #: inc/admin.php:128 105 | msgid "Taxonomy to filter entries for feed" 106 | msgstr "" 107 | 108 | #: inc/admin.php:133 109 | msgid "Terms to filter entries for feed" 110 | msgstr "" 111 | 112 | #: inc/admin.php:138 113 | msgid "Terms slug to filter entries for feed" 114 | msgstr "" 115 | 116 | #: inc/admin.php:143 117 | msgid "Taxonomy to exclude from feed" 118 | msgstr "" 119 | 120 | #: inc/admin.php:148 121 | msgid "Terms exclude from feed" 122 | msgstr "" 123 | 124 | #: inc/admin.php:153 125 | msgid "Terms slugs exclude from feed" 126 | msgstr "" 127 | 128 | #: inc/admin.php:158 129 | msgid "Include post thumbnails into feed" 130 | msgstr "" 131 | 132 | #: inc/admin.php:163 133 | msgid "Enable Yandex.Turbo Pages" 134 | msgstr "" 135 | 136 | #: inc/admin.php:168 137 | msgid "Analytics and ads" 138 | msgstr "" 139 | 140 | #: inc/admin.php:173 141 | msgid "Remove post author name from feed" 142 | msgstr "" 143 | 144 | #: inc/admin.php:178 145 | msgid "Remove all unexecuted shortcodes" 146 | msgstr "" 147 | 148 | #: inc/admin.php:183 149 | msgid "Remove teaser from yandex:full-text tag" 150 | msgstr "" 151 | 152 | #: inc/admin.php:188 153 | msgid "Allow any tags in turbo-content" 154 | msgstr "" 155 | 156 | #: inc/admin.php:193 157 | msgid "Feed items limit" 158 | msgstr "" 159 | 160 | #: inc/admin.php:198 161 | msgid "Feed cache lifetime" 162 | msgstr "" 163 | 164 | #: inc/admin.php:268 165 | msgid "" 166 | "If necessary, enter your own broadcast URL.\n" 167 | "If simple permalinks are enabled, the feed URL will be\n" 168 | "%s" 169 | msgstr "" 170 | 171 | #: inc/admin.php:287 172 | msgid "" 173 | "If necessary, enter your own broadcast URL.\n" 174 | "Next pages of the feed will be available by URLs:\n" 175 | "%s\n" 176 | "%s\n" 177 | "etc.\n" 178 | "If simple permalinks are enabled, the feed URL will be\n" 179 | "%s\n" 180 | "And the next pages of the feed are available by URLs:\n" 181 | "%s\n" 182 | "%s\n" 183 | "etc." 184 | msgstr "" 185 | 186 | #: inc/admin.php:306 187 | msgid "Button" 188 | msgstr "" 189 | 190 | #: inc/admin.php:309 191 | msgid "Share" 192 | msgstr "" 193 | 194 | #: inc/admin.php:312 195 | msgid "Search" 196 | msgstr "" 197 | 198 | #: inc/admin.php:315 199 | msgid "Feedback" 200 | msgstr "" 201 | 202 | #: inc/admin.php:318 203 | msgid "Ads" 204 | msgstr "" 205 | 206 | #: inc/admin.php:321 207 | msgid "User component" 208 | msgstr "" 209 | 210 | #: inc/admin.php:333 211 | msgid "You can get token in Yandex.Webmaster > Sources > Get token" 212 | msgstr "" 213 | 214 | #: inc/admin.php:344 215 | msgid "Comma separated list of post types" 216 | msgstr "" 217 | 218 | #: inc/admin.php:355 219 | msgid "Max age of feed posts in days" 220 | msgstr "" 221 | 222 | #: inc/admin.php:356 223 | msgid "For Yandex.Turbo this parameter will be ignored. Numeric feed limit will be used instead it." 224 | msgstr "" 225 | 226 | #: inc/admin.php:367 227 | msgid "Direct link to .jpg, .png, .gif file (100px size of max side)" 228 | msgstr "" 229 | 230 | #: inc/admin.php:368 231 | msgid "Logo for Yandex.Turbo should be set directly in Yandex.Webmaster: %s" 232 | msgstr "" 233 | 234 | #: inc/admin.php:379 235 | msgid "Direct link to .jpg, .png, .gif file (180x180px size as min)" 236 | msgstr "" 237 | 238 | #: inc/admin.php:406 239 | #: inc/admin.php:443 240 | msgid "Comma separated list of term IDs" 241 | msgstr "" 242 | 243 | #: inc/admin.php:418 244 | #: inc/admin.php:453 245 | msgid "Comma separated list of term slugs" 246 | msgstr "" 247 | 248 | #: inc/admin.php:468 249 | msgid "Analytics and ads should be set up directly in Yandex.Webmaster: %s" 250 | msgstr "" 251 | 252 | #: inc/admin.php:519 253 | msgid "Numeric limit or empty for no limit" 254 | msgstr "" 255 | 256 | #: inc/admin.php:520 257 | msgid "For Yandex.Turbo it should be %s or more. If not, %s will be used." 258 | msgstr "" 259 | 260 | #: inc/admin.php:530 261 | msgid "Cache lifetime in hours. Leave it empty to disable cache." 262 | msgstr "" 263 | 264 | #: inc/admin.php:563 265 | msgid "Yandex.News settings" 266 | msgstr "" 267 | 268 | #: inc/admin.php:583 269 | msgid "Related links" 270 | msgstr "" 271 | 272 | #: inc/admin.php:586 273 | msgid "Enter related links URL and descrioption separated by space, one link per string." 274 | msgstr "" 275 | 276 | #: inc/admin.php:589 277 | msgid "Exclude entry from Yandex.News feed" 278 | msgstr "" 279 | 280 | #: inc/admin.php:591 281 | msgid "Exclude despite the global settings" 282 | msgstr "" 283 | 284 | #: inc/admin.php:685 285 | msgid "Yandex.News Feed by Teplitsa added a separate turbo pages feed. If you previously added the feed URL to Yandex.Turbo in Yandex.Webmaster, please replace it with the feed URL of the turbo pages." 286 | msgstr "" 287 | 288 | #: inc/admin.php:687 289 | msgid "Yes, I have already changed the feed URL in Yandex.Webmaster" 290 | msgstr "" 291 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Yandex.News Feed by Teplitsa === 2 | Contributors: foralien, denis.cherniatev, ahaenor, teplosup 3 | Tags: yandex,Турбо,Яндекс,новости,news,Турбо-страницы,xml,rss,seo,turbo,turbo pages 4 | Requires at least: 3.9 5 | Tested up to: 5.7 6 | Stable tag: trunk 7 | License: GPLv2 or later 8 | License URI: http://www.gnu.org/licenses/gpl-2.0.txt 9 | 10 | Yandex.News Feed by Teplitsa - allows you to convert your site materials into Yandex News format with turbo pages support. 11 | 12 | The goal of the plugin is to simplify the integration of any WordPress-powered website with Yandex.News. 13 | 14 | * The installation process is smooth and requires minimum settings. 15 | * Feed compatible with Yandex.News format is available immediately after installation. 16 | 17 | The plugin is developed and maintained by [Teplitsa of social technologies](http://te-st.ru/). 18 | 19 | 20 | **Features** 21 | 22 | * Compatibility with Yandex.News [guidelines](http://help.yandex.ru/news/info-for-mass-media.xml). 23 | * Yandex turbo-pages support. 24 | * Custom post types support in feed. 25 | * Filtering by category or custom taxonomy term. 26 | * Individual settings for posts in feed. 27 | * If the feed generation process overloads your DB server, you can enable cache. Just set cache lifetime value. 28 | 29 | After installing the plugin settings are available under menu _Settings -> Yandex.Novosti_. 30 | 31 | Feed is accessible at the link _domain.ru/yandex/news/_. A custom URL could be specify through Settings page in case of active "pretty permalinks". 32 | 33 | The plugin has the minimum of settings. Read more about it's usage at the developers' website: 34 | 35 | * [detailed guide](https://te-st.ru/2014/12/02/wordpress-and-yandex-news/) about plugin usage; 36 | * [screencast](https://te-st.ru/2014/04/08/screencast-yandex-news-plugin/) about plugin usage; 37 | 38 | 39 | **Help us** 40 | 41 | We will be very grateful for your help us to make the plugin better. You can do it in the following ways: 42 | 43 | * Report bugs or suggest improvements at [GitHub](https://github.com/Teplitsa/tst-yandex-feed). 44 | * Send us a Pull Request with your fixes or improvements. 45 | * Translate the plugin or optimize it for your country. 46 | 47 | If you have questions about the plugin, then ask for support through [GitHub](https://github.com/Teplitsa/tst-yandex-feed). 48 | 49 | 50 | == Installation == 51 | Installation process is typical for WordPress. 52 | 53 | You can also use GIT: https://github.com/Teplitsa/tst-yandex-feed.git 54 | or download as ZIP: https://github.com/Teplitsa/tst-yandex-feed/archive/master.zip 55 | 56 | == Screenshots == 57 | 58 | 1. Feed sample 59 | 2. Settings page sample 60 | 61 | 62 | == Changelog == 63 | 64 | = 1.12.0 = 65 | * Update: PDA link deleted from feed. 66 | * New: Added shortcodes to place custom button, share widget, contact widget, feedback form etc. in post content. 67 | * New: Added integration with Yandex.Turbo API. Post will be updated in Yandex right after saving if you provide API Auth Token. 68 | 69 | = 1.11.0 = 70 | * Update: Turbo=False option added for excluded turbo-pages when turbo-feed is on, and for all turbo-pages when turbo-feed is off. 71 | * Update: If "Include post thumbnails into feed" is off, then a post thumbnail will be removed from turbo-page header. 72 | * Update: Turbo pages feed pagination added. 73 | * Update: Separate turbo pages feed added. 74 | 75 | = 1.10.8 = 76 | * Update: Compatibility with PHP5.3 restored. 77 | * Update: Caching optimized. 78 | 79 | = 1.10.7 = 80 | * Update: Default min feed items limit removed. Now less than 300 records allowed. 81 | * Update: Figure video tags support added. 82 | * Update: Caching improved. 83 | 84 | = 1.10.6 = 85 | * Update: Escape special chars in item description improved. 86 | 87 | = 1.10.5 = 88 | * Update: Embed shortcode support added. 89 | 90 | = 1.10.4 = 91 | * Update: Compatibility with WP Multilang plugin added. 92 | 93 | = 1.10.3 = 94 | * Update: Some Turbo settings moved to Yandex.Webmaster. 95 | * Update: Turbo-pages limit settings updated. 96 | 97 | = 1.10.2 = 98 | * Update: New tags allowed. 99 | * Update: Yandex Plugin ID added. 100 | 101 | = 1.10.1 = 102 | * Fix: Timezone negative UTC offset bug fixed. 103 | * Update: Authors list extended. 104 | 105 | = 1.10.0 = 106 | * New: Yandex Ad Network blocks support added. 107 | * New: Analytics support added. 108 | * Update: mp4 video support added. 109 | * Fix: Protocol issue in enclosure resolved. 110 | * Fix: "More" tag removed from short description. 111 | 112 | = 1.9.1 = 113 | * New: Option to set max age of the feed posts added. 114 | * Update: Yandex turbo-content header composition even for posts without thumbnails. 115 | * Update: Links to useful articles fixed. 116 | 117 | = 1.9 = 118 | * Update: Yandex turbo-pages support added. 119 | 120 | = 1.8.13 = 121 | * Update: Readme updated. 122 | 123 | = 1.8.12 = 124 | * Update: External URLs removed from enclosures list. 125 | 126 | = 1.8.11 = 127 | * Fix: Feed limit fixed. 128 | 129 | = 1.8.10 = 130 | * New: Terms slug support added in tax filter. 131 | * New: Terms slug support added in tax exclude filter. 132 | * New: Clear cache occurs when save empty cache lifetime. 133 | 134 | = 1.8.9 = 135 | * New: Feed cache added. Generated feed cache is stored in WP options table. Try to turn it on if feed generation overloads you DB server. 136 | * New: Cache lifetime option added. 137 | 138 | = 1.8.8 = 139 | * New: Exclude terms feature added from h8every1 pull request: https://github.com/Teplitsa/tst-yandex-feed/pull/11 140 | * Fix: Text domain changed 141 | 142 | = 1.8.7 = 143 | * Fix: Feed optimized 144 | 145 | = 1.8.6 = 146 | * New: Remove unused shortcodes option added 147 | * New: Remove pdalink tag option added 148 | * New: Remove teaser from yandex:full-text option added 149 | * New: Feed length optional limit added 150 | * Fix: Feed Content-type fixed for WordPress 4.5 151 | 152 | = 1.8.5 = 153 | * New: thumbnails in feed replaced to original images 154 | * New: Option to include or exclude featured image from feed added 155 | * Fix: youtube links parsing improved 156 | * Fix: duplicated enclosures removed 157 | 158 | = 1.8.4.2 = 159 | * Fix: media:group structure optimized 160 | 161 | = 1.8.4.1 = 162 | * Fix: Size of youtube video thumbnails changed 163 | 164 | = 1.8.4 = 165 | * New: Youtube video thumbnails added 166 | * Fix: media:group structure optimized 167 | 168 | = 1.8.3 = 169 | * Fix: Minor fixes and updates for feed content 170 | 171 | = 1.8.2 = 172 | * Fix: Minor fixes and updated for admin settings 173 | 174 | = 1.8.1 = 175 | * Fix: Incorrect custom URL behaviour on existing installs 176 | 177 | = 1.8 = 178 | * New: Support for YouTube video embedded in the post content 179 | * News: Custom URL for the feed (with pretty permalinks active) 180 | * Fix: Image caption text stripped out from the translation context 181 | 182 | = 1.7 = 183 | * New: Added support for new Yandex square logo format update 184 | 185 | = 1.6 = 186 | * Fix: Minor fixes in plugin dashboard area 187 | 188 | = 1.5 = 189 | * New: Own options page for plugin settings 190 | * New: Posts in feed could be filtering by category or custom taxonomy term 191 | * New: Posts could be excluded from feed with individual setting 192 | 193 | = 1.4 = 194 | * Fix: Incorrect formatting filtering applyed for the full feed content 195 | 196 | = 1.3 = 197 | * Fix: Inline styles appear in feed content 198 | 199 | = 1.2 = 200 | * Fix: Category field should contains only one category label 201 | * Fix: Some shortcodes appeared incorrectly in the feed content 202 | 203 | = 1.1 = 204 | * Fix: Some invalid characters appear in feed 205 | * Fix: Security fix 206 | * Fix: Translation files not loading 207 | * Fix: Incorrect content behaviour due to conflicts with some themes 208 | 209 | = 1.0 = 210 | * First official release! -------------------------------------------------------------------------------- /languages/yandexnews-feed-by-teplitsa-ru_RU.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Yandex.News Feed by Teplitsa\n" 4 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/yandexnews-feed-" 5 | "by-teplitsa\n" 6 | "POT-Creation-Date: 2021-04-08 14:04+0200\n" 7 | "PO-Revision-Date: 2021-04-08 14:05+0200\n" 8 | "Last-Translator: Anna Ladoshkina \n" 9 | "Language-Team: Anna Ladoshkina \n" 10 | "Language: ru\n" 11 | "MIME-Version: 1.0\n" 12 | "Content-Type: text/plain; charset=UTF-8\n" 13 | "Content-Transfer-Encoding: 8bit\n" 14 | "X-Generator: Poedit 2.0.5\n" 15 | "X-Poedit-Basepath: ..\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 18 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 19 | "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 20 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 21 | "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" 22 | "X-Poedit-SearchPath-0: .\n" 23 | 24 | #: inc/admin.php:55 25 | msgid "Settings" 26 | msgstr "Настройки" 27 | 28 | #: inc/admin.php:65 29 | msgid "GitHub" 30 | msgstr "GitHub" 31 | 32 | #: inc/admin.php:75 inc/admin.php:240 33 | msgid "Yandex.News Feed Settings" 34 | msgstr "Настройки трансляции Яндекс.Новости" 35 | 36 | #: inc/admin.php:76 37 | msgid "Yandex.News" 38 | msgstr "Яндекс.Новости" 39 | 40 | #: inc/admin.php:83 41 | msgid "General" 42 | msgstr "Общие" 43 | 44 | #: inc/admin.php:88 45 | msgid "URL for news feed" 46 | msgstr "URL трансляции новостей" 47 | 48 | #: inc/admin.php:93 49 | msgid "URL for turbo pages feed" 50 | msgstr "URL трансляции турбо-страниц" 51 | 52 | #: inc/admin.php:98 53 | msgid "Available shortcodes" 54 | msgstr "Доступные шорткоды" 55 | 56 | #: inc/admin.php:103 57 | msgid "Yandex.Webmaster OAuth Token" 58 | msgstr "Yandex.Webmaster OAuth Token" 59 | 60 | #: inc/admin.php:108 61 | msgid "Post types for feed" 62 | msgstr "Типы записей для трансляции" 63 | 64 | #: inc/admin.php:113 65 | msgid "Max posts age for feed" 66 | msgstr "Максимальный возраст записей ленты" 67 | 68 | #: inc/admin.php:118 69 | msgid "Logo URL for feed description" 70 | msgstr "Ссылка на логотип для описания сайта на сервисе Яндекс.Новости" 71 | 72 | #: inc/admin.php:123 73 | msgid "Square Logo URL for feed description" 74 | msgstr "Ссылка на квадратный логотип" 75 | 76 | #: inc/admin.php:128 77 | msgid "Taxonomy to filter entries for feed" 78 | msgstr "Таксономия для фильтрации трансляции" 79 | 80 | #: inc/admin.php:133 81 | msgid "Terms to filter entries for feed" 82 | msgstr "Термины для фильтрации трансляции" 83 | 84 | #: inc/admin.php:138 85 | msgid "Terms slug to filter entries for feed" 86 | msgstr "Ярлыки терминов для фильтрации трансляции" 87 | 88 | #: inc/admin.php:143 89 | msgid "Taxonomy to exclude from feed" 90 | msgstr "Таксономия, термины которой нужно исключить" 91 | 92 | #: inc/admin.php:148 93 | msgid "Terms exclude from feed" 94 | msgstr "Термины для исключения" 95 | 96 | #: inc/admin.php:153 97 | msgid "Terms slugs exclude from feed" 98 | msgstr "Ярлыки терминов для исключения" 99 | 100 | #: inc/admin.php:158 101 | msgid "Include post thumbnails into feed" 102 | msgstr "Включить миниатюру в трансляцию" 103 | 104 | #: inc/admin.php:163 105 | msgid "Enable Yandex.Turbo Pages" 106 | msgstr "Включить поддержку турбо-страниц" 107 | 108 | #: inc/admin.php:168 109 | msgid "Analytics and ads" 110 | msgstr "Аналитики и реклама" 111 | 112 | #: inc/admin.php:173 113 | msgid "Remove pdalink tag from feed" 114 | msgstr "Не показывать pdalink" 115 | 116 | #: inc/admin.php:178 117 | msgid "Remove post author name from feed" 118 | msgstr "Не показывать автора статьи" 119 | 120 | #: inc/admin.php:183 121 | msgid "Remove all unexecuted shortcodes" 122 | msgstr "Удалить все неиспользованные шорткоды (тэги типа [...])" 123 | 124 | #: inc/admin.php:188 125 | msgid "Remove teaser from yandex:full-text tag" 126 | msgstr "Убрать тизер из тэга yandex:full-text" 127 | 128 | #: inc/admin.php:193 129 | msgid "Allow any tags in turbo-content" 130 | msgstr "Разрешить любые тэги в турбо-страницах" 131 | 132 | #: inc/admin.php:198 133 | msgid "Feed items limit" 134 | msgstr "Лимит количества записей в ленте" 135 | 136 | #: inc/admin.php:203 137 | msgid "Feed cache lifetime" 138 | msgstr "Время жизни кэша ленты" 139 | 140 | #: inc/admin.php:274 141 | #, php-format 142 | msgid "" 143 | "If necessary, enter your own broadcast URL.\n" 144 | "If simple permalinks are enabled, the feed URL will be\n" 145 | "%s" 146 | msgstr "" 147 | "При необходимости укажите собственный URL-адрес трансляции.\n" 148 | "Если включены простые постоянные ссылки, URL-адрес ленты будет\n" 149 | "%s" 150 | 151 | #: inc/admin.php:293 152 | #, php-format 153 | msgid "" 154 | "If necessary, enter your own broadcast URL.\n" 155 | "Next pages of the feed will be available by URLs:\n" 156 | "%s\n" 157 | "%s\n" 158 | "etc.\n" 159 | "If simple permalinks are enabled, the feed URL will be\n" 160 | "%s\n" 161 | "And the next pages of the feed are available by URLs:\n" 162 | "%s\n" 163 | "%s\n" 164 | "etc." 165 | msgstr "" 166 | "При необходимости укажите собственный URL-адрес трансляции.\n" 167 | "Следующие страницы канала будут доступны по URL:\n" 168 | "%s\n" 169 | "%s\n" 170 | "и т.д.\n" 171 | "Если включены простые постоянные ссылки, URL-адрес ленты будет\n" 172 | "%s\n" 173 | "И следующие страницы канала доступны по URL:\n" 174 | "%s\n" 175 | "%s\n" 176 | "и т.д." 177 | 178 | #: inc/admin.php:312 179 | msgid "Button" 180 | msgstr "Кнопка" 181 | 182 | #: inc/admin.php:315 183 | msgid "Share" 184 | msgstr "Поделиться" 185 | 186 | #: inc/admin.php:318 187 | msgid "Search" 188 | msgstr "Поиск" 189 | 190 | #: inc/admin.php:321 191 | msgid "Feedback" 192 | msgstr "Обратная связь" 193 | 194 | #: inc/admin.php:324 195 | msgid "Ads" 196 | msgstr "Реклама" 197 | 198 | #: inc/admin.php:327 199 | msgid "User component" 200 | msgstr "Пользовательский компонент" 201 | 202 | #: inc/admin.php:339 203 | msgid "You can get token in Yandex.Webmaster > Sources > Get token" 204 | msgstr "" 205 | "Вы можете получить токен в Яндекс.Вебмастере > Источники > Получить токен" 206 | 207 | #: inc/admin.php:350 208 | msgid "Comma separated list of post types" 209 | msgstr "Список типов записей, разделенных запятыми" 210 | 211 | #: inc/admin.php:361 212 | msgid "Max age of feed posts in days" 213 | msgstr "Максимальный возраст записей, которые попадают в ленту, в днях" 214 | 215 | #: inc/admin.php:362 216 | msgid "" 217 | "For Yandex.Turbo this parameter will be ignored. Numeric feed limit will be " 218 | "used instead it." 219 | msgstr "" 220 | "Для Турбо-страниц этот параметр не используется. Вместо него используется " 221 | "числовое ограничение длины ленты." 222 | 223 | #: inc/admin.php:373 224 | msgid "Direct link to .jpg, .png, .gif file (100px size of max side)" 225 | msgstr "" 226 | "Прямая ссылка на файл .jpg, .png, .gif file (размер 100px по наибольшей " 227 | "стороне)" 228 | 229 | #: inc/admin.php:374 230 | #, php-format 231 | msgid "" 232 | "Logo for Yandex.Turbo should be set directly in Yandex.Webmaster: %s" 234 | msgstr "" 235 | "Логотип для Турбо-страниц теперь нужно настраивать в Яндекс.Вебмастере: %s" 237 | 238 | #: inc/admin.php:385 239 | msgid "Direct link to .jpg, .png, .gif file (180x180px size as min)" 240 | msgstr "" 241 | "Прямая ссылка на файл .jpg, .png, .gif file (минимальный размер 180х180рх, " 242 | "строго квадратное изображение)" 243 | 244 | #: inc/admin.php:412 inc/admin.php:449 245 | msgid "Comma separated list of term IDs" 246 | msgstr "Список ID терминов, разделенных запятыми" 247 | 248 | #: inc/admin.php:424 inc/admin.php:459 249 | msgid "Comma separated list of term slugs" 250 | msgstr "Список ярлыков терминов, разделенных запятыми" 251 | 252 | #: inc/admin.php:474 253 | #, php-format 254 | msgid "" 255 | "Analytics and ads should be set up directly in Yandex.Webmaster: %s" 257 | msgstr "" 258 | "Настраивать аналитику и рекламу теперь нужно непосредственно в Яндекс." 259 | "Вебмастере: %s" 260 | 261 | #: inc/admin.php:533 262 | msgid "Numeric limit or empty for no limit" 263 | msgstr "" 264 | "Введите число чтобы ограничить, или оставьте пустым для вывода без " 265 | "ограничений" 266 | 267 | #: inc/admin.php:534 268 | #, php-format 269 | msgid "For Yandex.Turbo it should be %s or more. If not, %s will be used." 270 | msgstr "" 271 | "Для Турбо-страниц этот параметр должен быть %s или больше. В противном " 272 | "случае он будет равен %s." 273 | 274 | #: inc/admin.php:544 275 | msgid "Cache lifetime in hours. Leave it empty to disable cache." 276 | msgstr "" 277 | "Время, на которое лента кэшируется, в часах. Оставьте пустым чтобы отключить " 278 | "кэш." 279 | 280 | #: inc/admin.php:577 281 | msgid "Yandex.News settings" 282 | msgstr "Настройки Яндекс.Новости" 283 | 284 | #: inc/admin.php:597 285 | msgid "Related links" 286 | msgstr "Связанные ссылки" 287 | 288 | #: inc/admin.php:600 289 | msgid "" 290 | "Enter related links URL and descrioption separated by space, one link per " 291 | "string." 292 | msgstr "" 293 | "Укажите ссылки на упомянутые источники в формате: адрес ссылки пробел " 294 | "описание ссылки. Указывайте каждую ссылку на отдельной строке." 295 | 296 | #: inc/admin.php:603 297 | msgid "Exclude entry from Yandex.News feed" 298 | msgstr "Исключить запись из трансляции Яндекс.Новости" 299 | 300 | #: inc/admin.php:605 301 | msgid "Exclude despite the global settings" 302 | msgstr "Исключить, не смотря на глобальные настройки" 303 | 304 | #: inc/admin.php:699 305 | #, php-format 306 | msgid "" 307 | "Yandex.News Feed by Teplitsa added a separate turbo pages feed. If you " 308 | "previously added the feed URL to Yandex.Turbo in Yandex.Webmaster, please " 309 | "replace it with the feed URL of the turbo pages." 310 | msgstr "" 311 | "В плагине Yandex.News Feed by Teplitsa добавлена отдельная лента турбо-" 312 | "страниц. Если вы ранее добавляли URL ленты новостей в Яндекс.Вебмастере, " 313 | "пожалуйста, замените его на URL ленты турбо страниц." 314 | 315 | #: inc/admin.php:701 316 | msgid "Yes, I have already changed the feed URL in Yandex.Webmaster" 317 | msgstr "Да, я уже изменил URL ленты в Яндекс.Вебмастере" 318 | 319 | #: inc/admin.php:718 320 | msgid "Shortcode examples" 321 | msgstr "Примеры шоркодов" 322 | 323 | #: inc/hooks.php:22 324 | msgid "Turbo page update error: invalid auth token error" 325 | msgstr "" 326 | "Ошибка обновления турбо-страницы в Яндекс: неправильный токен авторизации" 327 | 328 | #: inc/hooks.php:25 329 | msgid "Turbo page update error: host not verified" 330 | msgstr "Ошибка обновления турбо-страницы в Яндекс: неизвестный хост" 331 | 332 | #: inc/hooks.php:28 333 | msgid "Turbo page update error: resource not found" 334 | msgstr "Ошибка обновления турбо-страницы в Яндекс: ресурс не найден" 335 | 336 | #: inc/hooks.php:31 337 | msgid "Turbo page update error:" 338 | msgstr "Ошибка обновления турбо-страницы в Яндекс:" 339 | 340 | #: tst-yandex-feed.php:80 341 | msgid "The plugin creates feed for Yandex.News service" 342 | msgstr "Плагин создает трансляцию материалов сайта для сервиса Яндекс.Новости" 343 | 344 | #: tst-yandex-feed.php:81 345 | msgid "Teplitsa" 346 | msgstr "Теплица социальных технологий" 347 | 348 | #~ msgid "Yandex.News Feed by Teplitsa" 349 | #~ msgstr "Yandex.News Feed by Teplitsa" 350 | 351 | #~ msgid "https://te-st.ru/" 352 | #~ msgstr "https://te-st.ru/" 353 | 354 | #~ msgid "Customoze the URL of the feed if needed" 355 | #~ msgstr "" 356 | #~ "При необходимости укажите собственный URL-адрес трансляции.\n" 357 | #~ "Если включены простые постоянные ссылки, URL-адрес ленты будет\n" 358 | #~ "%s" 359 | 360 | #~ msgid "Analytics type" 361 | #~ msgstr "Вид аналитики" 362 | 363 | #~ msgid "Yandex Ad Network ID for header" 364 | #~ msgstr "ID в РСЯ для показа рекламы в начале статьи" 365 | 366 | #~ msgid "Yandex Ad Network ID for footer" 367 | #~ msgstr "ID в РСЯ для показа рекламы в конце статьи" 368 | 369 | #~ msgid "Exclude post thumbnails from feed" 370 | #~ msgstr "Исключить миниатюры из трансляции Яндекс.Новости" 371 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. -------------------------------------------------------------------------------- /inc/admin.php: -------------------------------------------------------------------------------- 1 | {$txt}"; 57 | } 58 | 59 | return $links; 60 | } 61 | 62 | public function plugin_links ($links, $file) { 63 | 64 | if (false !== strpos($file, 'tst-yandex-feed.php')) { 65 | $links[] = '' . __('GitHub', 'yandexnews-feed-by-teplitsa') . ''; 66 | } 67 | return $links; 68 | } 69 | 70 | 71 | /** settings */ 72 | function admin_menu() { 73 | 74 | add_options_page( 75 | __('Yandex.News Feed Settings', 'yandexnews-feed-by-teplitsa'), 76 | __('Yandex.News', 'yandexnews-feed-by-teplitsa'), 77 | 'manage_options', 78 | 'layf_settings', 79 | array($this,'layf_settings_screen') 80 | ); 81 | } 82 | function settings_init() { 83 | add_settings_section ( 'layf_base', __ ( 'General', 'yandexnews-feed-by-teplitsa' ), array ( 84 | $this, 85 | 'layf_base_section_screen' 86 | ), 'layf_settings' ); 87 | 88 | add_settings_field ( 'layf_custom_url', __ ( 'URL for news feed', 'yandexnews-feed-by-teplitsa' ), array ( 89 | $this, 90 | 'settngs_custom_url_callback' 91 | ), 'layf_settings', 'layf_base' ); 92 | 93 | add_settings_field ( 'layf_custom_turbo_url', __ ( 'URL for turbo pages feed', 'yandexnews-feed-by-teplitsa' ), array ( 94 | $this, 95 | 'settngs_custom_turbo_url_callback' 96 | ), 'layf_settings', 'layf_base' ); 97 | 98 | add_settings_field ( 'layf_available_shortcodes', __ ( 'Available shortcodes', 'yandexnews-feed-by-teplitsa' ), array ( 99 | $this, 100 | 'settngs_available_shortcodes_callback' 101 | ), 'layf_settings', 'layf_base' ); 102 | 103 | add_settings_field ( 'layf_api_sync_token', __ ( 'Yandex.Webmaster OAuth Token', 'yandexnews-feed-by-teplitsa' ), array ( 104 | $this, 105 | 'settngs_api_sync_token_callback' 106 | ), 'layf_settings', 'layf_base' ); 107 | 108 | add_settings_field ( 'layf_post_types', __ ( 'Post types for feed', 'yandexnews-feed-by-teplitsa' ), array ( 109 | $this, 110 | 'settngs_post_types_callback' 111 | ), 'layf_settings', 'layf_base' ); 112 | 113 | add_settings_field ( 'layf_post_max_age', __ ( 'Max posts age for feed', 'yandexnews-feed-by-teplitsa' ), array ( 114 | $this, 115 | 'settngs_post_max_age_callback' 116 | ), 'layf_settings', 'layf_base' ); 117 | 118 | add_settings_field ( 'layf_feed_logo', __ ( 'Logo URL for feed description', 'yandexnews-feed-by-teplitsa' ), array ( 119 | $this, 120 | 'settings_feed_logo_callback' 121 | ), 'layf_settings', 'layf_base' ); 122 | 123 | add_settings_field ( 'layf_feed_logo_square', __ ( 'Square Logo URL for feed description', 'yandexnews-feed-by-teplitsa' ), array ( 124 | $this, 125 | 'settings_feed_logo_square_callback' 126 | ), 'layf_settings', 'layf_base' ); 127 | 128 | add_settings_field ( 'layf_filter_taxonomy', __ ( 'Taxonomy to filter entries for feed', 'yandexnews-feed-by-teplitsa' ), array ( 129 | $this, 130 | 'settings_filter_taxonomy_callback' 131 | ), 'layf_settings', 'layf_base' ); 132 | 133 | add_settings_field ( 'layf_filter_terms', __ ( 'Terms to filter entries for feed', 'yandexnews-feed-by-teplitsa' ), array ( 134 | $this, 135 | 'settings_filter_terms_callback' 136 | ), 'layf_settings', 'layf_base' ); 137 | 138 | add_settings_field ( 'layf_filter_terms_slug', __ ( 'Terms slug to filter entries for feed', 'yandexnews-feed-by-teplitsa' ), array ( 139 | $this, 140 | 'settings_filter_terms_slug_callback' 141 | ), 'layf_settings', 'layf_base' ); 142 | 143 | add_settings_field( 'layf_exclude_taxonomy', __('Taxonomy to exclude from feed', 'yandexnews-feed-by-teplitsa'), array( 144 | $this, 145 | 'settings_exclude_taxonomy_callback' 146 | ), 'layf_settings', 'layf_base' ); 147 | 148 | add_settings_field( 'layf_exclude_terms', __('Terms exclude from feed', 'yandexnews-feed-by-teplitsa'), array( 149 | $this, 150 | 'settings_exclude_terms_callback' 151 | ), 'layf_settings', 'layf_base' ); 152 | 153 | add_settings_field ( 'layf_exclude_terms_slug', __ ( 'Terms slugs exclude from feed', 'yandexnews-feed-by-teplitsa' ), array ( 154 | $this, 155 | 'settings_exclude_terms_slug_callback' 156 | ), 'layf_settings', 'layf_base' ); 157 | 158 | add_settings_field ( 'layf_include_post_thumbnail', __ ( 'Include post thumbnails into feed', 'yandexnews-feed-by-teplitsa' ), array ( 159 | $this, 160 | 'settings_include_post_thumbnail_callback' 161 | ), 'layf_settings', 'layf_base' ); 162 | 163 | add_settings_field ( 'layf_enable_turbo', __ ( 'Enable Yandex.Turbo Pages', 'yandexnews-feed-by-teplitsa' ), array ( 164 | $this, 165 | 'settings_enable_turbo_callback' 166 | ), 'layf_settings', 'layf_base' ); 167 | 168 | add_settings_field ( 'layf_analytics_type', __ ( 'Analytics and ads', 'yandexnews-feed-by-teplitsa' ), array ( 169 | $this, 170 | 'settings_analytics_type_callback' 171 | ), 'layf_settings', 'layf_base' ); 172 | 173 | add_settings_field ( 'layf_hide_author', __ ( 'Remove post author name from feed', 'yandexnews-feed-by-teplitsa' ), array ( 174 | $this, 175 | 'settings_hide_author_callback' 176 | ), 'layf_settings', 'layf_base' ); 177 | 178 | add_settings_field ( 'layf_remove_shortcodes', __ ( 'Remove all unexecuted shortcodes', 'yandexnews-feed-by-teplitsa' ), array ( 179 | $this, 180 | 'settings_remove_shortcodes_callback' 181 | ), 'layf_settings', 'layf_base' ); 182 | 183 | add_settings_field ( 'layf_remove_teaser_from_fulltext', __ ( 'Remove teaser from yandex:full-text tag', 'yandexnews-feed-by-teplitsa' ), array ( 184 | $this, 185 | 'settings_remove_teaser_from_fulltext_callback' 186 | ), 'layf_settings', 'layf_base' ); 187 | 188 | add_settings_field ( 'layf_allow_any_tags', __ ( 'Allow any tags in turbo-content', 'yandexnews-feed-by-teplitsa' ), array ( 189 | $this, 190 | 'settings_allow_any_tags_callback' 191 | ), 'layf_settings', 'layf_base' ); 192 | 193 | add_settings_field ( 'layf_feed_items_limit', __ ( 'Feed items limit', 'yandexnews-feed-by-teplitsa' ), array ( 194 | $this, 195 | 'settings_feed_items_limit_callback' 196 | ), 'layf_settings', 'layf_base' ); 197 | 198 | add_settings_field ( 'layf_feed_cache_ttl', __ ( 'Feed cache lifetime', 'yandexnews-feed-by-teplitsa' ), array ( 199 | $this, 200 | 'settings_feed_cache_ttl_callback' 201 | ), 'layf_settings', 'layf_base' ); 202 | 203 | register_setting ( 'layf_settings', 'layf_post_types' ); 204 | register_setting ( 'layf_settings', 'layf_post_max_age' ); 205 | register_setting ( 'layf_settings', 'layf_feed_logo' ); 206 | register_setting ( 'layf_settings', 'layf_feed_logo_square' ); 207 | register_setting ( 'layf_settings', 'layf_filter_taxonomy' ); 208 | register_setting ( 'layf_settings', 'layf_filter_terms' ); 209 | register_setting ( 'layf_settings', 'layf_filter_terms_slug' ); 210 | register_setting ( 'layf_settings', 'layf_exclude_taxonomy' ); 211 | register_setting ( 'layf_settings', 'layf_exclude_terms' ); 212 | register_setting ( 'layf_settings', 'layf_exclude_terms_slug' ); 213 | register_setting ( 'layf_settings', 'layf_custom_url' ); 214 | register_setting ( 'layf_settings', 'layf_custom_turbo_url' ); 215 | register_setting ( 'layf_settings', 'layf_include_post_thumbnail' ); 216 | register_setting ( 'layf_settings', 'layf_enable_turbo' ); 217 | register_setting ( 'layf_settings', 'layf_analytics_type' ); 218 | register_setting ( 'layf_settings', 'layf_analytics_id' ); 219 | register_setting ( 'layf_settings', 'layf_adnetwork_id_header' ); 220 | register_setting ( 'layf_settings', 'layf_adnetwork_id_footer' ); 221 | register_setting ( 'layf_settings', 'layf_hide_author' ); 222 | register_setting ( 'layf_settings', 'layf_feed_items_limit' ); 223 | register_setting ( 'layf_settings', 'layf_feed_cache_ttl' ); 224 | register_setting ( 'layf_settings', 'layf_remove_shortcodes' ); 225 | register_setting ( 'layf_settings', 'layf_remove_teaser_from_fulltext' ); 226 | register_setting ( 'layf_settings', 'layf_allow_any_tags' ); 227 | register_setting ( 'layf_settings', 'layf_api_sync_token' ); 228 | } 229 | 230 | function layf_settings_screen(){ 231 | 232 | ?> 233 |
234 |

235 | 236 |
237 |
238 |
239 | 244 |
245 |
246 |
247 |
248 |
249 | 263 | 268 |

'.home_url('/index.php?yandex_feed=news').'');?>

269 | 279 | 284 | 287 |

'.home_url(rtrim($turbo_url_slug, '/') . '/page/2/').'', 289 | ''.home_url(rtrim($turbo_url_slug, '/') . '/page/3/').'', 290 | ''.home_url('/index.php?yandex_feed=turbo').'', 291 | ''.home_url('/index.php?yandex_feed=turbo&paged=2').'', 292 | ''.home_url('/index.php?yandex_feed=turbo&paged=3').'');?>

293 | 298 |
299 | 300 |
301 | 306 |

307 | [TstYandexNewsButton formaction="tel:+7(800)123-45-67" data-background-color="#eee" data-color="white" data-turbo="false" data-primary="true" disabled]8 800 123-45-67[/TstYandexNewsButton] 308 | 309 |

310 | [TstYandexNewsShare data-network="facebook, odnoklassniki, telegram, twitter, vkontakte"/] 311 | 312 |

313 | [TstYandexNewsSearch palceholder="Что-нибудь найти" /] 314 | 315 |

316 | [TstYandexNewsFeedback data-title="Обратная связь" data-stick="false" call="+7 012 345-67-89" callback="mail@example.com" company="ООО Ромашка" agreement="http://example.com" mail="mailto:mail@example.com" chat facebook="https://fb.com/example" google="https://plus.google.com/" odnoklassniki="https://ok.ru/example" telegram="https://t.me/example" twitter="https://twitter.com/yandex" vkontakte="https://vk.com/example" whatsapp="https://wa.me/70123456789" viber="viber://chat?number=+70123456789"/] 317 | 318 |

319 | [TstYandexNewsAds data-turbo-ad-id="mobile_ad" /] 320 | 321 |

322 | [TstYandexNewsComponent tag="MySpecialButton"]Text Inside Component[/TstYandexNewsComponent] 323 | 330 | 333 |

Sources > Get token', 'yandexnews-feed-by-teplitsa');?>

334 | 341 | 344 |

345 | 352 | 355 |

356 |

357 | 364 | 367 |

368 |

%s', 'yandexnews-feed-by-teplitsa'), self::$turbo_logo_settings_url, self::$turbo_logo_settings_url);?>

369 | 376 | 379 |

380 | true), 'objects'); 387 | if(!empty($taxes)){ 388 | ?> 389 | 395 | 403 | 406 |

407 | 415 | 418 |

419 | true), 'objects'); 427 | if(!empty($taxes)){ 428 | ?> 429 | 434 | 442 | 443 |

444 | 452 | 453 |

454 | 461 | checked="checked" /> 463 | 468 |

%s', 'yandexnews-feed-by-teplitsa'), self::$turbo_logo_settings_url, self::$turbo_logo_settings_url);?>

469 | 475 | checked="checked" /> 477 | 483 | checked="checked" /> 485 | 492 | checked="checked" /> 494 | 500 | checked="checked" /> 502 | 508 | checked="checked" /> 510 | 516 | 519 |

520 |

521 | 527 | 530 |

531 | id) { 539 | wp_enqueue_style('layf-admin', LAYF_PLUGIN_BASE_URL.'css/admin.css', array(), LAYF_VERSION); 540 | wp_enqueue_script( 'common' ); 541 | wp_enqueue_script( 'wp-lists' ); 542 | wp_enqueue_script( 'postbox' ); 543 | 544 | wp_enqueue_script( 545 | 'layf-admin-settings', 546 | LAYF_PLUGIN_BASE_URL . 'js/admin-settings.js', 547 | array(), 548 | LAYF_VERSION, 549 | true 550 | ); 551 | 552 | } 553 | else { 554 | wp_enqueue_script( 555 | 'layf-admin', 556 | LAYF_PLUGIN_BASE_URL . 'js/admin.js', 557 | array(), 558 | LAYF_VERSION, 559 | true 560 | ); 561 | } 562 | 563 | } 564 | 565 | 566 | /* create metabox */ 567 | function create_metaboxes() { 568 | 569 | $pt = $this->get_supported_post_types(); 570 | $callback = array($this, 'setting_metabox'); 571 | 572 | if(!empty($pt)){ foreach($pt as $post_type){ 573 | add_meta_box('layf_related_links', __('Yandex.News settings', 'yandexnews-feed-by-teplitsa'), $callback, $post_type, 'advanced'); 574 | }} 575 | 576 | } 577 | 578 | function setting_metabox() { 579 | global $post; 580 | 581 | $value = get_post_meta($post->ID, 'layf_related_links', true); 582 | $value = esc_textarea($value); 583 | $exclude = (int)get_post_meta($post->ID, 'layf_exclude_from_feed', true); 584 | ?> 585 | 592 |
593 | 594 | 596 |

597 |
598 |
599 |
600 | 602 |
603 | get_supported_post_types())){ 616 | 617 | update_post_meta( $post_id, 'layf_related_links', $rel_links_value); 618 | update_post_meta( $post_id, 'layf_exclude_from_feed', $exclude_value); 619 | } 620 | } 621 | 622 | function get_supported_post_types() { 623 | 624 | $layf = La_Yandex_Feed_Core::get_instance(); 625 | return $layf->get_supported_post_types(); 626 | } 627 | 628 | function update_option_feed_cache_ttl($feed_cache_ttl, $feed_cache_ttl_new) { 629 | if(!$feed_cache_ttl_new) { 630 | $layf = La_Yandex_Feed_Core::get_instance(); 631 | $layf->clear_cache(); 632 | } 633 | } 634 | 635 | 636 | } //class 637 | 638 | 639 | /** ITV info-widget **/ 640 | function layf_itv_info_widget(){ 641 | //only in Russian as for now 642 | $locale = get_locale(); 643 | 644 | if($locale != 'ru_RU') 645 | return; 646 | 647 | 648 | $src = LAYF_PLUGIN_BASE_URL.'img/logo-itv.png'; 649 | $domain = parse_url(home_url()); 650 | $itv_url = "https://itv.te-st.ru/?ynfeed=".$domain['host']; 651 | ?> 652 |
653 | 657 | 658 |

659 | Вам нужна помощь в настройке 660 | плагина на вашем сайте? Вы 661 | являетесь социальным или 662 | некоммерческим проектом? 663 | Опубликуйте задачу на платформе it-волонтер 665 |

666 | 667 |

668 | Опубликовать задачу 670 |

671 |
672 | 673 |

674 | Есть вопросы к разработчикм плагина? 675 | Хотите предложить новую функцию? 676 | Напишите свой вопрос или предложение 677 | на GitHub 678 |

679 | 694 |
695 |

turbo pages.', 'yandexnews-feed-by-teplitsa' ), admin_url('/options-general.php?page=layf_settings')); ?>

696 |

697 | 698 |

699 |
700 |