From 63fb678deaf49d1a9a4b76c763a764635a7b4195 Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 18 Jul 2022 17:03:34 +0530 Subject: [PATCH] version 1.10 --- README.md | 6 ++++ includes/settings.php | 4 +-- languages/wppv-ru_RU.mo | Bin 0 -> 1974 bytes languages/wppv-ru_RU.po | 70 ++++++++++++++++++++++++++++++++++++++++ readme.txt | 14 ++++++-- wp-post-views.php | 9 +++++- 6 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 languages/wppv-ru_RU.mo create mode 100644 languages/wppv-ru_RU.po diff --git a/README.md b/README.md index c34ef7b..16abf47 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,12 @@ For this repository i would like to give full credits to [AnkitaTanti](https://g Contribution is highly appriciated. +### Contribution needed below + +- Dynamic Block for the post views for gutenberg +- Language Translations + + ![banner-wp-post-views](https://user-images.githubusercontent.com/26689210/81412482-8e17c880-9161-11ea-86cc-60e2c1f3fa9a.png) diff --git a/includes/settings.php b/includes/settings.php index 0920d41..2de131f 100755 --- a/includes/settings.php +++ b/includes/settings.php @@ -29,7 +29,7 @@ public static function wppv_activation_hook(){ } public static function wppv_api_add_admin_menu( ) { - add_options_page( 'Wp Post Views Settings', 'Wp Post Views Settings', 'manage_options', 'settings-api-page', array( 'Wp_post_view_settings','wppv_api_options_page' ) ); + add_options_page( 'Wp Post Views Settings', __('Wp Post Views Settings', 'wppv'), 'manage_options', 'settings-api-page', array( 'Wp_post_view_settings','wppv_api_options_page' ) ); } public static function wppv_api_settings_init( ) { @@ -105,7 +105,7 @@ public static function wppv_api_settings_section_callback( ) { public static function wppv_api_options_page( ) { ?>
-

Wp post View All Settings Admin Page

+

2Ygh2fPcXkzdO@43C*(uGvB>)zH`oZ&OI}K zy?o}Lf$MqPui;+O8(e?nkl{Gif8u@#_v=sPyoOZk78f_`V*eR7-T(*)GDsJ(n`CihB&AM=?Q2VHEUW=G3;bLBQC3C23mCL5}j%i;c z`-)>*7c5*Ln$v8a>(Hn2%2#sUqzlFM$PHr8l_GLTeW&))FVwEuQ;!OhZqQ25db7@4 zAGUAP)pR*sR$bLOW_2h^%;{T&nwLbbXHJO7j~xmycG$+1w?_2@Vp%yKykT3FicROv zkzQIu72Bq(WD)4t)4LTa4~%1#x3SDztTEeKTFN{!iZy(dZ1|LiM+;Ncsqv#G+C{5y zO$3q!s0zdBki=k>LeJ&FCJ#SWBc85)jz#8p&=5^bn?sjpxh#BQzRv;{ zY@+X|G-c`Y9SB>dN19~vlF_}SBJ%1 z{E-W!L&qTm>gh(2xrS{-?4)1n#={7yI;7gkTbtJjy*LsWkE_yWI!Mt$=Do~wN6XQt zeynC4&QRZ@rM+}R*L^A@OOXB7bSRXHLC~Kfx~`jx8hiQ_FcE+*jtgqi^WNcj+l lfWd&ICl3KZwlbQ|4_DCpAYu%N96zj literal 0 HcmV?d00001 diff --git a/languages/wppv-ru_RU.po b/languages/wppv-ru_RU.po new file mode 100644 index 0000000..ad8656c --- /dev/null +++ b/languages/wppv-ru_RU.po @@ -0,0 +1,70 @@ +msgid "" +msgstr "" +"Project-Id-Version: WP Post Views\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-07-15 19:10+0000\n" +"PO-Revision-Date: 2022-07-15 19:29+0000\n" +"Last-Translator: Сергей\n" +"Language-Team: Русский\n" +"Language: ru-RU\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && " +"n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Loco https://localise.biz/\n" +"X-Loco-Version: 2.6.2; wp-6.0.1\n" +"X-Domain: wppv" + +#: wp-post-views.php:33 +msgid "Hi there! I'm just a plugin, not much I can do when called directly." +msgstr "" +"Всем привет! Я всего лишь плагин, и я мало что могу сделать, когда вызываю " +"его напрямую." + +#. URI of the plugin +msgid "https://github.com/vanpariyar/wp-post-views" +msgstr "https://github.com/vanpariyar/wp-post-views" + +#. Author URI of the plugin +msgid "https://vanpariyar.github.io" +msgstr "https://vanpariyar.github.io" + +#. Author of the plugin +msgid "Ronak J Vanpariya" +msgstr "Ronak J Vanpariya" + +#: includes/settings.php:57 +msgid "Select your custom post type" +msgstr "Выберите типы контента в которых нужно учитывать просмотры" + +#: includes/settings.php:39 +msgid "Settings for WP Post Views" +msgstr "Настройки WP Post Views" + +#: includes/settings.php:45 +msgid "Show post views coloumn" +msgstr "Показывать колонку Views" + +#: includes/settings.php:102 +msgid "" +"This will show one extra coloumn in Post listing page which is show the " +"counts" +msgstr "" +"Это включит доп. колонку в списке страниц и постов, которая показывает " +"количество просмотров" + +#: includes/settings.php:51 +msgid "" +"Views filter on IP (If checked multiple views will not count From same IP)" +msgstr "" +"Фильтр просмотров по IP (если установлен чекбокс, то будет учитываться " +"только один просмотр с одного IP)" + +#. Name of the plugin +msgid "WP Post Views" +msgstr "WP Post Views" + +#. Description of the plugin +msgid "WP Post Views." +msgstr "WP Post Views." diff --git a/readme.txt b/readme.txt index c350b09..3f25adc 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: vanpariyar, ankitatanti, Brijeshdhanani, Tags: post views, count wordpress site views, show post views, post view counter, WP Post Views, post view count based on ip Requires at least: 5.0 Requires PHP: 5.3 -Tested up to: 5.8 -Stable tag: 1.9 +Tested up to: 6.0 +Stable tag: 1.10 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -29,6 +29,10 @@ Use this shortcode. [youtube https://youtu.be/11NH5xOBs68] +### Development +* Development happening on GitHub :- https://github.com/vanpariyar/wp-post-views +* Create issue on the GitHub OR Pull request for new feature when new tag added it will automatically deployed. + == Installation == 1. Install the plugin either via the WordPress.org plugin directory, or by uploading the files to your server (in the /wp-content/plugins/ directory). @@ -46,6 +50,12 @@ Use this shortcode. == Changelog == += 1.10 - 18/07/2022 = +- Version Bump to support 6.0 +- Added ru_RU ( Russian Translation ) +- fixed https://github.com/vanpariyar/wp-post-views/issues/17 +- https://github.com/vanpariyar/wp-post-views/issues/16 + = 1.9 - 23/01/2022 = - Version Bump to support 5.9 diff --git a/wp-post-views.php b/wp-post-views.php index 8fc41ac..81698dc 100644 --- a/wp-post-views.php +++ b/wp-post-views.php @@ -17,6 +17,7 @@ * Author: Ronak J Vanpariya * Author URI: https://vanpariyar.github.io * Text Domain: wppv + * Domain Path: /languages * License: GPL v2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.txt @@ -56,6 +57,7 @@ class WP_Post_Views { function __construct() { + add_action( 'init', array( $this ,'load_textdomain' ) ); add_action( 'wp_head', array( $this , 'counter'), 10, 1 ); add_filter( 'manage_posts_columns', array( $this,'wppv_posts_column_views') ); add_filter( 'manage_pages_columns', array( $this,'wppv_posts_column_views') ); @@ -64,6 +66,10 @@ function __construct() Wp_post_view_settings::settings_init(); } + function load_textdomain() { + load_plugin_textdomain( 'wppv', false, basename( dirname( __FILE__ ) ) . '/languages/' ); + } + public function wppv_posts_column_views( $columns ) { $options = get_option( 'wppv_api_settings' ); @@ -128,7 +134,8 @@ public function counter(){ $options = get_option( 'wppv_api_settings' ); $selected_type = array(); isset($options['wppv_api_post_checkbox_1']) ? $selected_type = $options['wppv_api_post_checkbox_1'] : ''; - if(in_array($post->post_type , $selected_type)){ + + if( is_object($post) && in_array($post->post_type , $selected_type)){ if ( !empty($options['wppv_api_text_field_1']) ) { $stored_ip_addresses = get_post_meta(get_the_ID(),'view_ip',true);