Uptolike Social Share Buttons - Version 1.5.1

Version Description

*

Download this release

Release Info

Developer na1vez
Plugin Icon 128x128 Uptolike Social Share Buttons
Version 1.5.1
Comparing to
See all releases

Code changes from version 1.5.0 to 1.5.1

Files changed (2) hide show
  1. readme.txt +20 -2
  2. widget_options.php +10 -27
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Uptolike Team
3
  Tags: +1, UpToLike, AddThis, social buttons, bookmark, bookmarking, like, share, share button, sharing, social bookmarking, social bookmarks, social buttons, кнопки соцсетей, социальные кнопки
4
  Requires at least: 3.0.1
5
- Tested up to: 4.5
6
- Stable tag: 1.5.0
7
 
8
  Uptolike Social Share Buttons - social bookmarking widget with sharing statistics.
9
 
@@ -40,6 +40,14 @@ UpToLike is compatible with 25 popular social networking sites. It supports the
40
  * Automatic text selection: the system gives you the option to share a highlighted piece of text on a social network
41
  * Gathering unique statistics of social media activity
42
 
 
 
 
 
 
 
 
 
43
  **Uptolike Social Share Buttons - бесплатный русскоязычный плагин социальных кнопок**
44
 
45
  **Какие задачи выполняет плагин Uptolike?**
@@ -73,6 +81,13 @@ Uptolike поддерживает 25 популярных социальных
73
  * Уникальная статистика социальной активности на сайте
74
  * Кнопки социальных сетей, адаптированные под мобильные устройства
75
 
 
 
 
 
 
 
 
76
  == Installation ==
77
  1. Go to Plugins -> Add New
78
  2. Search for Uptolike
@@ -103,6 +118,9 @@ Answers to Frequently Asked Questions you can find at http://uptolike.ru/faq
103
  3. Traffic and sharing statistics
104
 
105
  == Changelog ==
 
 
 
106
  = 1.5.0 =
107
  * HOTFIX
108
 
2
  Contributors: Uptolike Team
3
  Tags: +1, UpToLike, AddThis, social buttons, bookmark, bookmarking, like, share, share button, sharing, social bookmarking, social bookmarks, social buttons, кнопки соцсетей, социальные кнопки
4
  Requires at least: 3.0.1
5
+ Tested up to: 4.6.1
6
+ Stable tag: 1.5.1
7
 
8
  Uptolike Social Share Buttons - social bookmarking widget with sharing statistics.
9
 
40
  * Automatic text selection: the system gives you the option to share a highlighted piece of text on a social network
41
  * Gathering unique statistics of social media activity
42
 
43
+ **What statistics does UpToLike collect?**
44
+
45
+ * Number of Likes and Shares on site during the selected period
46
+ * Number of users attracted because of Likes and Shares
47
+ * Separation of traffic on social networks
48
+ * Per-page site activity: how many Likes and Shares for each individual page, and how many new visitors came to each page
49
+ * Social buttons adapted to mobile devices
50
+
51
  **Uptolike Social Share Buttons - бесплатный русскоязычный плагин социальных кнопок**
52
 
53
  **Какие задачи выполняет плагин Uptolike?**
81
  * Уникальная статистика социальной активности на сайте
82
  * Кнопки социальных сетей, адаптированные под мобильные устройства
83
 
84
+ **Статистика, которую собирает Uptolike**
85
+
86
+ * Количество лайков и шаров на сайте за выбранный период
87
+ * Количество привлеченных пользователей, благодаря лайкам и шарам
88
+ * Разделение трафика по социальным сетям
89
+ * Постраничная статистика по сайту: сколько лайков и шаров получила каждая отдельная. страница сайта, и сколько новых посетителей пришли именно на эту страницу
90
+
91
  == Installation ==
92
  1. Go to Plugins -> Add New
93
  2. Search for Uptolike
118
  3. Traffic and sharing statistics
119
 
120
  == Changelog ==
121
+ = 1.5.1 =
122
+ * Исправлена ошибка генерации ссылки со статических страниц
123
+
124
  = 1.5.0 =
125
  * HOTFIX
126
 
widget_options.php CHANGED
@@ -516,9 +516,10 @@ function get_widget_code($url = '') {
516
  $protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"], 0, strpos($_SERVER["SERVER_PROTOCOL"], '/'))) . '://';
517
  if ($url == '') {
518
  if (is_single() || is_page()) {
519
- $url = get_permalink();
520
  } else $url = $protocol . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
521
  }
 
522
  if ($_SERVER["REQUEST_URI"] == '/' && !(json_decode($options['uptolike_json'])->orientation < 2) && !empty(json_decode($options['uptolike_json'])->orientation)) {
523
  $url = home_url('/');
524
  }
@@ -528,23 +529,16 @@ function get_widget_code($url = '') {
528
 
529
  $widget_code = str_replace('data-pid="-1"', 'data-pid="' . $data_pid . '"', $widget_code);
530
  $widget_code = str_replace('data-pid=""', 'data-pid="' . $data_pid . '"', $widget_code);
531
- $widget_code = str_replace('div data', 'div data-url="' . $url . '" data', $widget_code);//data-url duplicate
532
- $widget_code = preg_replace('!del-url="(.*?)"!si', '', $widget_code);
533
- $widget_code = str_replace('del-url', '', $widget_code);
534
- $widget_code = str_replace('del-', '', $widget_code);
535
- $widget_code = str_replace('data--', 'data-', $widget_code);
536
- $widget_code = str_replace(' data-url ', ' ', $widget_code);
537
  $align = $options['widget_align'];
538
-
539
- $align_style = 'style="text-align: ' . $align . ';"';
540
  $widget_code = str_replace('div data', 'div data-lang="' . $options['utl_language'] . '" data', $widget_code);
541
- $widget_code = str_replace('<div ', '<div ' . $align_style . ' ', $widget_code);
542
 
543
  return $widget_code;
544
  }
545
 
546
  function add_widget($content) {
547
- global $post;
548
  $options = get_option('my_option_name');
549
  $widget_mode = $options['widget_mode'];
550
  if (is_array($options) && (($widget_mode == 'plg') or ($widget_mode == 'both')) && array_key_exists('widget_code', $options)) {
@@ -590,42 +584,32 @@ function add_widget($content) {
590
  return $content . get_widget_code(get_permalink());
591
  }
592
  }
593
- return $content;
594
  } else { //if vertical panel
595
  if (is_front_page() || is_home()) {
596
  if ($options['on_main'] == 1 && (home_url('/') == request_home_url())) {
597
- return $content . get_widget_code();
598
- } elseif ($options['on_main'] != 1 && (home_url('/') == request_home_url())) {
599
- return $content;
600
  }
601
  } elseif (is_page()) {
602
  if ($options['on_page'] == 1 && (home_url('/') != request_home_url())) {
603
- return $content . get_widget_code();
604
- } elseif ($options['on_page'] != 1) {
605
- return $content;
606
  }
607
  } elseif (is_single()) {
608
  if ($options['on_post'] == 1 && (home_url('/') != request_home_url())) {
609
- return $content . get_widget_code();
610
- } elseif ($options['on_post'] != 1) {
611
- return $content;
612
  }
613
  } elseif (is_archive()) {
614
  if ($options['on_archive'] == 1 && $options['on_post'] == 1 && (home_url('/') != request_home_url())) {
615
- return $content . get_widget_code();
616
- } elseif ($options['on_archive'] != 1) {
617
- return $content;
618
  }
619
  }
620
  }
621
- return $content;
622
  }
623
  return $content;
624
  }
625
 
626
  add_filter('the_content', 'add_widget', 100);
627
 
628
- function uptolike_shortcode($atts) {
629
  $options = get_option('my_option_name');
630
  $widget_mode = $options['widget_mode'];
631
  if (($widget_mode == 'code') or ($widget_mode == 'both')) {
@@ -800,7 +784,6 @@ function uptolike_register_widgets() {
800
  register_activation_hook(__FILE__, 'usb_admin_actions');
801
 
802
  add_action('widgets_init', 'uptolike_register_widgets');
803
- add_action('wp_footer', 'headeruptolike', 1);
804
  add_action('admin_notices', 'my_choice_notice');
805
  add_action('admin_notices', 'my_widgetcode_notice');
806
  add_action('admin_menu', 'usb_admin_actions');
516
  $protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"], 0, strpos($_SERVER["SERVER_PROTOCOL"], '/'))) . '://';
517
  if ($url == '') {
518
  if (is_single() || is_page()) {
519
+ $url = the_permalink();
520
  } else $url = $protocol . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
521
  }
522
+
523
  if ($_SERVER["REQUEST_URI"] == '/' && !(json_decode($options['uptolike_json'])->orientation < 2) && !empty(json_decode($options['uptolike_json'])->orientation)) {
524
  $url = home_url('/');
525
  }
529
 
530
  $widget_code = str_replace('data-pid="-1"', 'data-pid="' . $data_pid . '"', $widget_code);
531
  $widget_code = str_replace('data-pid=""', 'data-pid="' . $data_pid . '"', $widget_code);
532
+ $widget_code = str_replace('div data', 'div data-url="' . $url . '" data', $widget_code);
 
 
 
 
 
533
  $align = $options['widget_align'];
534
+ $align_style = 'style="text-align:' . $align . ';"';
 
535
  $widget_code = str_replace('div data', 'div data-lang="' . $options['utl_language'] . '" data', $widget_code);
536
+ $widget_code = str_replace('<div data', '<div ' . $align_style . ' data', $widget_code);
537
 
538
  return $widget_code;
539
  }
540
 
541
  function add_widget($content) {
 
542
  $options = get_option('my_option_name');
543
  $widget_mode = $options['widget_mode'];
544
  if (is_array($options) && (($widget_mode == 'plg') or ($widget_mode == 'both')) && array_key_exists('widget_code', $options)) {
584
  return $content . get_widget_code(get_permalink());
585
  }
586
  }
 
587
  } else { //if vertical panel
588
  if (is_front_page() || is_home()) {
589
  if ($options['on_main'] == 1 && (home_url('/') == request_home_url())) {
590
+ add_action('wp_footer', 'headeruptolike');
 
 
591
  }
592
  } elseif (is_page()) {
593
  if ($options['on_page'] == 1 && (home_url('/') != request_home_url())) {
594
+ add_action('wp_footer', 'headeruptolike');
 
 
595
  }
596
  } elseif (is_single()) {
597
  if ($options['on_post'] == 1 && (home_url('/') != request_home_url())) {
598
+ add_action('wp_footer', 'headeruptolike');
 
 
599
  }
600
  } elseif (is_archive()) {
601
  if ($options['on_archive'] == 1 && $options['on_post'] == 1 && (home_url('/') != request_home_url())) {
602
+ add_action('wp_footer', 'headeruptolike');
 
 
603
  }
604
  }
605
  }
 
606
  }
607
  return $content;
608
  }
609
 
610
  add_filter('the_content', 'add_widget', 100);
611
 
612
+ function uptolike_shortcode() {
613
  $options = get_option('my_option_name');
614
  $widget_mode = $options['widget_mode'];
615
  if (($widget_mode == 'code') or ($widget_mode == 'both')) {
784
  register_activation_hook(__FILE__, 'usb_admin_actions');
785
 
786
  add_action('widgets_init', 'uptolike_register_widgets');
 
787
  add_action('admin_notices', 'my_choice_notice');
788
  add_action('admin_notices', 'my_widgetcode_notice');
789
  add_action('admin_menu', 'usb_admin_actions');