Post Views Counter - Version 1.0.3

Version Description

  • New: Russian translation, thanks to moonkir
  • Fix: Remove [post-views] shortcode from post excerpts if excerpt is empty
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Post Views Counter
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

includes/frontend.php CHANGED
@@ -12,7 +12,8 @@ class Post_Views_Counter_Frontend
12
  add_action('wp_enqueue_scripts', array(&$this, 'frontend_scripts_styles'));
13
 
14
  // filters
15
- add_filter('the_content', array(&$this, 'add_post_counts'));
 
16
  }
17
 
18
 
@@ -43,7 +44,7 @@ class Post_Views_Counter_Frontend
43
  /**
44
  *
45
  */
46
- public function add_post_counts($content)
47
  {
48
  if(is_singular() && in_array(get_post_type(), Post_Views_Counter()->get_attribute('options', 'display', 'post_types_display'), true))
49
  {
@@ -80,7 +81,18 @@ class Post_Views_Counter_Frontend
80
 
81
  return $content;
82
  }
83
-
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  /**
86
  *
12
  add_action('wp_enqueue_scripts', array(&$this, 'frontend_scripts_styles'));
13
 
14
  // filters
15
+ add_filter('the_content', array(&$this, 'add_post_views_count'));
16
+ add_filter('the_excerpt', array(&$this, 'remove_post_views_count'));
17
  }
18
 
19
 
44
  /**
45
  *
46
  */
47
+ public function add_post_views_count($content)
48
  {
49
  if(is_singular() && in_array(get_post_type(), Post_Views_Counter()->get_attribute('options', 'display', 'post_types_display'), true))
50
  {
81
 
82
  return $content;
83
  }
84
+
85
+
86
+ /**
87
+ * Remove post views shortcode from excerpt
88
+ */
89
+ public function remove_post_views_count($excerpt)
90
+ {
91
+ remove_shortcode('post-views');
92
+ $excerpt = preg_replace ('/\[post-views[^\]]*\]/', '', $excerpt);
93
+ return $excerpt;
94
+ }
95
+
96
 
97
  /**
98
  *
languages/post-views-counter-ru_RU.mo ADDED
Binary file
languages/post-views-counter-ru_RU.po ADDED
@@ -0,0 +1,438 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.6.5\n"
12
+ "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e;esc_attr__;esc_attr_e;"
13
+ "esc_html__;esc_html_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
17
+ "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
18
+ "Language: ru_RU\n"
19
+ "X-Poedit-SearchPath-0: ..\n"
20
+
21
+ #: ../includes/columns.php:113 ../includes/columns.php:121
22
+ msgid "Post Views"
23
+ msgstr "Просмотров"
24
+
25
+ #: ../includes/cron.php:40
26
+ msgid "Post Views Counter reset daily counts interval"
27
+ msgstr ""
28
+
29
+ #: ../includes/functions.php:114
30
+ msgid "No Posts"
31
+ msgstr "Нет записей"
32
+
33
+ #: ../includes/settings.php:41
34
+ msgid "Enable"
35
+ msgstr "Включить"
36
+
37
+ #: ../includes/settings.php:42
38
+ msgid "Disable"
39
+ msgstr "Выключить"
40
+
41
+ #: ../includes/settings.php:46
42
+ msgid "PHP"
43
+ msgstr "PHP"
44
+
45
+ #: ../includes/settings.php:47
46
+ msgid "JavaScript"
47
+ msgstr "JavaScript"
48
+
49
+ #: ../includes/settings.php:51
50
+ msgid "minutes"
51
+ msgstr "минуты"
52
+
53
+ #: ../includes/settings.php:52
54
+ msgid "hours"
55
+ msgstr "час(ов)"
56
+
57
+ #: ../includes/settings.php:53
58
+ msgid "days"
59
+ msgstr "дней"
60
+
61
+ #: ../includes/settings.php:54
62
+ msgid "weeks"
63
+ msgstr "недель"
64
+
65
+ #: ../includes/settings.php:55
66
+ msgid "months"
67
+ msgstr "месяцев"
68
+
69
+ #: ../includes/settings.php:56
70
+ msgid "years"
71
+ msgstr "лет"
72
+
73
+ #: ../includes/settings.php:60
74
+ msgid "robots"
75
+ msgstr "роботы"
76
+
77
+ #: ../includes/settings.php:61
78
+ msgid "logged in users"
79
+ msgstr "Авторизованые пользователи"
80
+
81
+ #: ../includes/settings.php:62
82
+ msgid "guests"
83
+ msgstr "Гости"
84
+
85
+ #: ../includes/settings.php:63
86
+ msgid "selected user roles"
87
+ msgstr "Выберите роли пользователя"
88
+
89
+ #: ../includes/settings.php:67
90
+ msgid "before the content"
91
+ msgstr "ДО контента"
92
+
93
+ #: ../includes/settings.php:68
94
+ msgid "after the content"
95
+ msgstr "ПОСЛЕ контета"
96
+
97
+ #: ../includes/settings.php:69
98
+ msgid "manual"
99
+ msgstr "В ручную"
100
+
101
+ #: ../includes/settings.php:73
102
+ msgid "icon"
103
+ msgstr "Иконка"
104
+
105
+ #: ../includes/settings.php:74
106
+ msgid "label"
107
+ msgstr "Текст"
108
+
109
+ #: ../includes/settings.php:79
110
+ msgid "General"
111
+ msgstr "Основное"
112
+
113
+ #: ../includes/settings.php:85
114
+ msgid "Display"
115
+ msgstr "Отображение"
116
+
117
+ #: ../includes/settings.php:149 ../includes/settings.php:150
118
+ #: ../includes/settings.php:167 ../includes/settings.php:180
119
+ msgid "Post Views Counter"
120
+ msgstr "Post Views Counter"
121
+
122
+ #: ../includes/settings.php:182
123
+ msgid "Need support?"
124
+ msgstr "Необходима помощь?"
125
+
126
+ #: ../includes/settings.php:183
127
+ msgid ""
128
+ "If you are having problems with this plugin, please talk about them in the"
129
+ msgstr "Если у вас есть проблемы с этим плагином, пожалуйста сообщите о них "
130
+
131
+ #: ../includes/settings.php:183
132
+ msgid "Support forum"
133
+ msgstr "Форум поддержки"
134
+
135
+ #: ../includes/settings.php:185
136
+ msgid "Do you like this plugin?"
137
+ msgstr "Вам нравится этот плагин?"
138
+
139
+ #: ../includes/settings.php:186
140
+ msgid "Rate it 5"
141
+ msgstr "Поставьте 5 звезд!"
142
+
143
+ #: ../includes/settings.php:186
144
+ msgid "on WordPress.org"
145
+ msgstr "на WordPress.org"
146
+
147
+ #: ../includes/settings.php:187
148
+ msgid "Blog about it & link to the"
149
+ msgstr "Информация и помощь"
150
+
151
+ #: ../includes/settings.php:187
152
+ msgid "plugin page"
153
+ msgstr "страница плагина"
154
+
155
+ #: ../includes/settings.php:188
156
+ msgid "Check out our other"
157
+ msgstr "Посмотрите наши другие "
158
+
159
+ #: ../includes/settings.php:188
160
+ msgid "WordPress plugins"
161
+ msgstr "WordPress плагины"
162
+
163
+ #: ../includes/settings.php:191
164
+ msgid "Created by"
165
+ msgstr "Создано"
166
+
167
+ #: ../includes/settings.php:207
168
+ msgid "Reset to defaults"
169
+ msgstr "Сбросить настройки"
170
+
171
+ #: ../includes/settings.php:225
172
+ msgid "General settings"
173
+ msgstr "Основные настройки"
174
+
175
+ #: ../includes/settings.php:226
176
+ msgid "Post Types Count"
177
+ msgstr "Считать контент:"
178
+
179
+ #: ../includes/settings.php:227
180
+ msgid "Counter Mode"
181
+ msgstr "Тип счетчика:"
182
+
183
+ #: ../includes/settings.php:228
184
+ msgid "Post Views Column"
185
+ msgstr "Post Views Column"
186
+
187
+ #: ../includes/settings.php:229
188
+ msgid "Time Between Counts"
189
+ msgstr "Период между счетом"
190
+
191
+ #: ../includes/settings.php:230
192
+ msgid "Reset Data"
193
+ msgstr "Сохранение просмотров за период:"
194
+
195
+ #: ../includes/settings.php:231
196
+ msgid "Exclude Visitors"
197
+ msgstr "Исключить посетителей"
198
+
199
+ #: ../includes/settings.php:232
200
+ msgid "Exclude IPs"
201
+ msgstr "Исключить IP"
202
+
203
+ #: ../includes/settings.php:233
204
+ msgid "WP-PostViews"
205
+ msgstr "WP-PostViews"
206
+
207
+ #: ../includes/settings.php:234
208
+ msgid "Deactivation"
209
+ msgstr "Деактивация"
210
+
211
+ #: ../includes/settings.php:238
212
+ msgid "Display settings"
213
+ msgstr "Настройки отображения"
214
+
215
+ #: ../includes/settings.php:239
216
+ msgid "Post Views Label"
217
+ msgstr "Текст перед счетчиком"
218
+
219
+ #: ../includes/settings.php:240
220
+ msgid "Post Types Display"
221
+ msgstr "Отображение счетчика на:"
222
+
223
+ #: ../includes/settings.php:241
224
+ msgid "Restrict Display"
225
+ msgstr "НЕ показывать для"
226
+
227
+ #: ../includes/settings.php:242
228
+ msgid "Position"
229
+ msgstr "Расположение"
230
+
231
+ #: ../includes/settings.php:243
232
+ msgid "Display Style"
233
+ msgstr "Отображать:"
234
+
235
+ #: ../includes/settings.php:244
236
+ msgid "Icon Class"
237
+ msgstr "Вид иконки"
238
+
239
+ #: ../includes/settings.php:258
240
+ msgid "Enter the label for the post views counter field."
241
+ msgstr "Введите метку для встречного поля Просмотров сообщение."
242
+
243
+ #: ../includes/settings.php:272
244
+ msgid "Select post types"
245
+ msgstr "Выберите типы записей"
246
+
247
+ #: ../includes/settings.php:283
248
+ msgid "Select post types for which post views will be counted."
249
+ msgstr "Выберите контент, на котором будет размещен счетчик просмоторов."
250
+
251
+ #: ../includes/settings.php:297 ../includes/settings.php:423
252
+ #: ../includes/settings.php:599
253
+ msgid "Select groups"
254
+ msgstr "Выберите тип посетителей"
255
+
256
+ #: ../includes/settings.php:308
257
+ msgid "Select post types for which post views will be displayed."
258
+ msgstr "Выберите типы контента на которых будет отображен счетчик"
259
+
260
+ #: ../includes/settings.php:332
261
+ msgid ""
262
+ "Select the method of collecting post views data. If you are using any of the "
263
+ "caching plugins select Javascript."
264
+ msgstr ""
265
+ "Выберите метод сбора данных кол-ва просмотров. Если вы используете плагины "
266
+ "для кеширования - выберите Javascript."
267
+
268
+ #: ../includes/settings.php:357
269
+ msgid ""
270
+ "Enable to display post views count column for each of the selected post "
271
+ "types."
272
+ msgstr ""
273
+ "Включить для отображения счетчика колонки рассчитывать для каждого из "
274
+ "выбранных типов контета."
275
+
276
+ #: ../includes/settings.php:383
277
+ msgid "Enter the time between single user visit count."
278
+ msgstr ""
279
+ "Задайте период времени между которами будет считаться просмотр одного "
280
+ "посетителя"
281
+
282
+ #: ../includes/settings.php:409
283
+ msgid ""
284
+ "Delete single day post views data older than specified above. Enter 0 "
285
+ "(number zero) if you want to preserve your data regardless of its age."
286
+ msgstr ""
287
+ "Сохранять данные о просмотрах за выбранный период. Введите 0 (ноль) если вы "
288
+ "хотите сохранять кол-во просмотров за все время."
289
+
290
+ #: ../includes/settings.php:435 ../includes/settings.php:614
291
+ msgid "Select user roles"
292
+ msgstr "Выберите роли пользователей"
293
+
294
+ #: ../includes/settings.php:447
295
+ msgid "Select the type of visitors to be excluded from post views count."
296
+ msgstr "Выберите посетителей, которые будут исключены из исчетчика"
297
+
298
+ #: ../includes/settings.php:466 ../includes/settings.php:475
299
+ msgid "Remove"
300
+ msgstr "Удалить"
301
+
302
+ #: ../includes/settings.php:475
303
+ msgid "Add new"
304
+ msgstr "Добавить новый"
305
+
306
+ #: ../includes/settings.php:475
307
+ msgid "Add my current IP"
308
+ msgstr "Добавить мой текущий IP"
309
+
310
+ #: ../includes/settings.php:477
311
+ msgid "Enter the IP addresses to be excluded from post views count."
312
+ msgstr "Введите IP-адреса которые должны быть исключены из счетчика просмотров"
313
+
314
+ #: ../includes/settings.php:491
315
+ msgid "Import"
316
+ msgstr "Импорт"
317
+
318
+ #: ../includes/settings.php:493
319
+ msgid "Import post views data from WP-PostViews plugin."
320
+ msgstr "Импорт данных из WP-PostViews плагина"
321
+
322
+ #: ../includes/settings.php:494
323
+ msgid "Override existing Post Views Counter data."
324
+ msgstr "Перезаписать текущие данные счетчика."
325
+
326
+ #: ../includes/settings.php:519
327
+ msgid "Enable to delete all plugin data on deactivation."
328
+ msgstr "Включите что бы удалить все данные при деактивации плагина"
329
+
330
+ #: ../includes/settings.php:544
331
+ msgid ""
332
+ "Select where would you like to display the post views counter. Use [post-"
333
+ "views] shortcode for manual display."
334
+ msgstr ""
335
+ "Выберите где вы хотите отобразить счетчик просмотров. Используйте [post-"
336
+ "views] шорткод для ручного отображения счечика"
337
+
338
+ #: ../includes/settings.php:569
339
+ msgid "Choose how to display the post views counter."
340
+ msgstr "Выберите как будет отображаться счетчик"
341
+
342
+ #: ../includes/settings.php:585
343
+ #, php-format
344
+ msgid ""
345
+ "Enter the post views icon class. Any of the <a href=\"%s\" target=\"_blank"
346
+ "\">Dashicons</a> classes are available."
347
+ msgstr ""
348
+ "Введите название иконки для отображения. Выберите любую из <a href=\"%s\" "
349
+ "target=\"_blank\"> Dashicons </ a>"
350
+
351
+ #: ../includes/settings.php:626
352
+ msgid "Use it to hide the post views counter from selected type of visitors."
353
+ msgstr "Используйте для скрытия счетчика от выбраных типов пользователей."
354
+
355
+ #: ../includes/settings.php:661
356
+ msgid "WP-PostViews data imported succesfully."
357
+ msgstr "Данные из WP-PostViews импортированы успешно."
358
+
359
+ #: ../includes/settings.php:665
360
+ msgid "There was no data to import."
361
+ msgstr "Отсутсвуют данные для импорта"
362
+
363
+ #: ../includes/settings.php:827
364
+ msgid "General settings restored to defaults."
365
+ msgstr "Основные настройки восстановлены по умолчанию."
366
+
367
+ #: ../includes/settings.php:833
368
+ msgid "Display settings restored to defaults."
369
+ msgstr "Настройки дисплея восстанавливается по умолчанию."
370
+
371
+ #: ../includes/settings.php:854
372
+ msgid "Support"
373
+ msgstr "Поддержка"
374
+
375
+ #: ../includes/widgets.php:38 ../includes/widgets.php:49
376
+ msgid "Most Viewed Posts"
377
+ msgstr "Самые популярные Сообщений"
378
+
379
+ #: ../includes/widgets.php:40
380
+ msgid "Displays a list of the most viewed posts"
381
+ msgstr "Отображает список самых просматриваемых сообщений"
382
+
383
+ #: ../includes/widgets.php:57
384
+ msgid "No Posts found"
385
+ msgstr "No Posts found"
386
+
387
+ #: ../includes/widgets.php:61
388
+ msgid "Ascending"
389
+ msgstr "По возрастанию"
390
+
391
+ #: ../includes/widgets.php:62
392
+ msgid "Descending"
393
+ msgstr "По убыванию"
394
+
395
+ #: ../includes/widgets.php:105
396
+ msgid "Title"
397
+ msgstr "Заголовок"
398
+
399
+ #: ../includes/widgets.php:109
400
+ msgid "Post types"
401
+ msgstr "Тип записей"
402
+
403
+ #: ../includes/widgets.php:123
404
+ msgid "Number of posts to show"
405
+ msgstr "Количество сообщений, чтобы показать"
406
+
407
+ #: ../includes/widgets.php:127
408
+ msgid "No posts message"
409
+ msgstr "Нет сообщений сообщение"
410
+
411
+ #: ../includes/widgets.php:131
412
+ msgid "Order"
413
+ msgstr "Order"
414
+
415
+ #: ../includes/widgets.php:144
416
+ msgid "Display post views?"
417
+ msgstr "Показать разместить просмотров?"
418
+
419
+ #: ../includes/widgets.php:146
420
+ msgid "Display post excerpt?"
421
+ msgstr "Показать сообщение отрывок?"
422
+
423
+ #: ../includes/widgets.php:148
424
+ msgid "Display post thumbnail?"
425
+ msgstr "Показать сообщение миниатюрами?"
426
+
427
+ #: ../includes/widgets.php:151
428
+ msgid "Thumbnail size"
429
+ msgstr "Размер миниатюры"
430
+
431
+ #: ../post-views-counter.php:251
432
+ msgid "Are you sure you want to reset these settings to defaults?"
433
+ msgstr ""
434
+ "Вы уверены, что хотите сбросить эти настройки на значения по умолчанию?"
435
+
436
+ #: ../post-views-counter.php:285
437
+ msgid "Settings"
438
+ msgstr "Настройки"
post-views-counter.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Post Views Counter
4
  Description: Forget WP-PostViews. Display how many times a post, page or custom post type had been viewed in a simple, fast and reliable way.
5
- Version: 1.0.2
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/post-views-counter/
@@ -80,7 +80,7 @@ class Post_Views_Counter
80
  'link_to_post' => true,
81
  'icon_class' => 'dashicons-visibility'
82
  ),
83
- 'version' => '1.0.2'
84
  );
85
 
86
 
2
  /*
3
  Plugin Name: Post Views Counter
4
  Description: Forget WP-PostViews. Display how many times a post, page or custom post type had been viewed in a simple, fast and reliable way.
5
+ Version: 1.0.3
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/post-views-counter/
80
  'link_to_post' => true,
81
  'icon_class' => 'dashicons-visibility'
82
  ),
83
+ 'version' => '1.0.3'
84
  );
85
 
86
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.dfactory.eu/
4
  Tags: counter, hits, postviews, post views, views, count
5
  Requires at least: 3.8.0
6
  Tested up to: 3.9.1
7
- Stable tag: 1.0.2
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -32,6 +32,7 @@ For more information, check out plugin page at [dFactory](http://www.dfactory.eu
32
 
33
  = Translations: =
34
  * Polish - by Bartosz Arendt
 
35
 
36
 
37
  == Installation ==
@@ -51,6 +52,10 @@ No questions yet.
51
 
52
  == Changelog ==
53
 
 
 
 
 
54
  = 1.0.2 =
55
  * Fix: Pluggable functions initialized too lately
56
 
@@ -58,5 +63,7 @@ No questions yet.
58
  Initial release
59
 
60
  == Upgrade Notice ==
61
- = 1.0.2 =
62
- * Fix: Pluggable functions initialized too lately
 
 
4
  Tags: counter, hits, postviews, post views, views, count
5
  Requires at least: 3.8.0
6
  Tested up to: 3.9.1
7
+ Stable tag: 1.0.3
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
32
 
33
  = Translations: =
34
  * Polish - by Bartosz Arendt
35
+ * Russian - by moonkir
36
 
37
 
38
  == Installation ==
52
 
53
  == Changelog ==
54
 
55
+ = 1.0.3 =
56
+ * New: Russian translation, thanks to moonkir
57
+ * Fix: Remove [post-views] shortcode from post excerpts if excerpt is empty
58
+
59
  = 1.0.2 =
60
  * Fix: Pluggable functions initialized too lately
61
 
63
  Initial release
64
 
65
  == Upgrade Notice ==
66
+
67
+ = 1.0.3 =
68
+ * New: Russian translation, thanks to moonkir
69
+ * Fix: Remove [post-views] shortcode from post excerpts if excerpt is empty