Skip to content

Commit

Permalink
version 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Antontokarchuk0302 committed Jul 18, 2022
1 parent 066de0a commit 63fb678
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 5 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions includes/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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( ) {
Expand Down Expand Up @@ -105,7 +105,7 @@ public static function wppv_api_settings_section_callback( ) {
public static function wppv_api_options_page( ) {
?>
<form action='options.php' method='post'>
<h2>Wp post View All Settings Admin Page</h2>
<h2><?php _e("Wp post View All Settings Admin Page", 'wppv'); ?></h2>
<?php
settings_fields( 'wppvPlugin' );
do_settings_sections( 'wppvPlugin' );
Expand Down
Binary file added languages/wppv-ru_RU.mo
Binary file not shown.
70 changes: 70 additions & 0 deletions languages/wppv-ru_RU.po
Original file line number Diff line number Diff line change
@@ -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."
14 changes: 12 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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).
Expand All @@ -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

Expand Down
9 changes: 8 additions & 1 deletion wp-post-views.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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') );
Expand All @@ -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' );
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 63fb678

Please sign in to comment.