Social Media Share Buttons - Version 3.0.1

Version Description

Download this release

Release Info

Developer joaoromao
Plugin Icon 128x128 Social Media Share Buttons
Version 3.0.1
Comparing to
See all releases

Code changes from version 3.0 to 3.0.1

init.php CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  <div id="gs-master-wrapper">
2
  <?php include('tmpl/header.php'); ?>
3
  <main data-href="<?php echo $GS->api_url ?>sites/<?php echo get_option('gs-api-key') ?>">
@@ -300,12 +307,6 @@ UserVoice.push(['identify', {
300
  // Add default trigger to the bottom-right corner of the window:
301
  UserVoice.push(['addTrigger', '#help', { mode: 'contact' }]);
302
 
303
- // Add uservoice to modal help
304
- UserVoice.push(['addTrigger', '#trigger-modal-1', { mode: 'contact' }]);
305
- UserVoice.push(['addTrigger', '#trigger-modal-2', { mode: 'contact' }]);
306
-
307
- UserVoice.push(['addTrigger', '#contact-footer', { mode: 'contact' }]);
308
-
309
  if (document.getElementById('contact_us')) {
310
  UserVoice.push(['addTrigger', '#contact_us', { mode: 'contact' }]);
311
  }
1
+ <?php
2
+ // disable popup after first visit
3
+ if (get_option('gs-popup-showed') != "showed") {
4
+ update_option("gs-popup-showed", "showed");
5
+ ?><script type="text/javascript">var popup_showed = "showed";</script><?php
6
+ }
7
+ ?>
8
  <div id="gs-master-wrapper">
9
  <?php include('tmpl/header.php'); ?>
10
  <main data-href="<?php echo $GS->api_url ?>sites/<?php echo get_option('gs-api-key') ?>">
307
  // Add default trigger to the bottom-right corner of the window:
308
  UserVoice.push(['addTrigger', '#help', { mode: 'contact' }]);
309
 
 
 
 
 
 
 
310
  if (document.getElementById('contact_us')) {
311
  UserVoice.push(['addTrigger', '#contact_us', { mode: 'contact' }]);
312
  }
js/create_popover.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ jQuery( document ).ready(function($) {
3
+ if (popup_showed != 'showed') {
4
+ jQuery(function () {
5
+ jQuery.get(GETSOCIAL_ONBOARDING_PATH, function (data) {
6
+ jQuery("#toplevel_page_wp-share-buttons-analytics-by-getsocial-init").append(data);
7
+
8
+ viewable();
9
+ });
10
+ });
11
+ }
12
+
13
+ function isScrolledIntoView(elem) {
14
+ var $elem = $(elem);
15
+ var $window = $(window);
16
+
17
+ var docViewTop = $window.scrollTop();
18
+ var docViewBottom = docViewTop + $window.height();
19
+
20
+ var elemTop = $elem.offset().top;
21
+ var elemBottom = elemTop + $elem.height();
22
+
23
+ return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
24
+ }
25
+
26
+ function viewable() {
27
+
28
+ jQuery("#toplevel_page_wp-share-buttons-analytics-by-getsocial-init").each(function(i, el) {
29
+
30
+ var el = jQuery(el);
31
+
32
+ if (isScrolledIntoView(el)) {
33
+ jQuery("#getsocial-onboarding-popup").removeClass("gs-menu-hidden");
34
+ } else {
35
+ jQuery("#getsocial-onboarding-popup").addClass("gs-menu-hidden");
36
+ }
37
+ });
38
+ }
39
+
40
+ jQuery(window).scroll(function() {
41
+ viewable();
42
+ });
43
+
44
+ jQuery(window).blur(function() {
45
+ viewable();
46
+ });
47
+ });
js/plugin.js CHANGED
@@ -1,5 +1,3 @@
1
- get_social_version = "2.9.2";
2
-
3
  function forceUpdate(event){
4
  var data = {
5
  'action': 'gs_update'
 
 
1
  function forceUpdate(event){
2
  var data = {
3
  'action': 'gs_update'
lib/gs.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  class GS {
4
 
5
- public $plugin_version = "3.0";
6
 
7
  // Local
8
  // private $gs_url = "//127.0.0.1:3001";
2
 
3
  class GS {
4
 
5
+ public $plugin_version = "3.0.1";
6
 
7
  // Local
8
  // private $gs_url = "//127.0.0.1:3001";
lib/onboarding_popup.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
4
+ require_once( $parse_uri[0] . 'wp-load.php' );
5
+ $plugin_url = admin_url() . '?page=wp-share-buttons-analytics-by-getsocial%2Finit.php';
6
+
7
+ ?>
8
+
9
+
10
+ <!DOCTYPE html>
11
+ <html lang="en">
12
+ <head>
13
+
14
+ <meta charset="UTF-8">
15
+ <title>Popup Test</title>
16
+
17
+ <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700' rel='stylesheet' type='text/css'>
18
+
19
+ <style>
20
+ body{
21
+ background: #ddd;
22
+ }
23
+ .gs-sidebar-tooltip{
24
+ font-family: 'Source Sans Pro', sans-serif;
25
+ width: 350px;
26
+ color: #606060;
27
+ background: #fff;
28
+ border-radius: 4px;
29
+ padding: 10px 25px;
30
+ margin-bottom: 10px;
31
+ position: absolute;
32
+ bottom: 100%;
33
+ left: 20px;
34
+ box-shadow: 0 1px 30px rgba(0,0,0,.2);
35
+ z-index: 9999999;
36
+ cursor: initial;
37
+ }
38
+ .gs-sidebar-tooltip:before{
39
+ width: 0;
40
+ height: 0;
41
+ border-style: solid;
42
+ border-width: 14px 14px 0 14px;
43
+ border-color: #fff transparent transparent transparent;
44
+ content: '';
45
+ display: block;
46
+ position: absolute;
47
+ top: 100%;
48
+ left: 20px;
49
+ }
50
+ .gs-sidebar-tooltip .gs-sidebar-tooltip-title{
51
+ font-size: 16px;
52
+ font-weight: 600;
53
+ color: #fff;
54
+ background: #339ed5;
55
+ text-align: center;
56
+ border-radius: 4px 4px 0 0;
57
+ padding: 12px 25px;
58
+ margin: -10px -25px 10px;
59
+ }
60
+ .gs-sidebar-tooltip p{
61
+ font-size: 14px;
62
+ line-height: 17px;
63
+ margin-bottom: 10px;
64
+ }
65
+ .gs-sidebar-tooltip .gs-sidebar-tooltip-link{
66
+ text-align: center;
67
+ margin: 15px 0 10px;
68
+ }
69
+ .gs-sidebar-tooltip a{
70
+ font-size: 14px;
71
+ font-weight: 600;
72
+ text-decoration: none;
73
+ display: inline-block !important;
74
+ padding: 6px 15px 8px !important;
75
+ border-radius: 4px;
76
+ -webkit-transition: all 200ms;
77
+ transition: all 200ms;
78
+ }
79
+ .gs-sidebar-tooltip a:not(.gs-close-tooltip){
80
+ color: #fff !important;
81
+ background: #339ed5;
82
+ margin-right: 8px;
83
+ }
84
+ .gs-sidebar-tooltip a:not(.gs-close-tooltip):hover, .gs-sidebar-tooltip a:not(.gs-close-tooltip):focus{
85
+ color: #fff !important;
86
+ background: #2687b9;
87
+ }
88
+ .gs-sidebar-tooltip a.gs-close-tooltip{
89
+ color: #d36c65 !important;
90
+ background: #fff;
91
+ }
92
+ .gs-sidebar-tooltip a.gs-close-tooltip:hover, .gs-sidebar-tooltip a.gs-close-tooltip:focus{
93
+ color: #AB4F48 !important;
94
+ }
95
+ .gs-sidebar-tooltip .gs-sidebar-tooltip-video{
96
+ margin: 20px 0 15px;
97
+ }
98
+ .gs-sidebar-tooltip .gs-sidebar-tooltip-video iframe{
99
+ width: 100%;
100
+ min-height: 175px;
101
+ }
102
+ .gs-sidebar-tooltip.gs-menu-hidden {
103
+ position: fixed;
104
+ bottom: 5px;
105
+ }
106
+ </style>
107
+ </head>
108
+ <body>
109
+ <div id="getsocial-onboarding-popup" class="gs-sidebar-tooltip">
110
+ <div class="gs-sidebar-tooltip-title">Welcome to GetSocial!</div>
111
+ <p>Thanks for installing <strong>GetSocial.io</strong>, the plugin that grows your traffic, shares and subscribers on WordPress.</p>
112
+ <p>Here’s a quick video on how to install and use GetSocial:</p>
113
+
114
+ <div class="gs-sidebar-tooltip-video">
115
+ <iframe src="https://www.youtube.com/embed/wDZvmwHk6FA" frameborder="0" allowfullscreen></iframe>
116
+ </div>
117
+
118
+ <p><strong>Now, let’s get started.</strong> Activating your account and installing your first apps is only seconds away.</p>
119
+
120
+ <div class="gs-sidebar-tooltip-link">
121
+ <a href="<?php echo $plugin_url; ?>">Open Plugin</a>
122
+ <a href="javascript:close_onboarding_popup()" target="_blank" class="gs-close-tooltip">Close</a>
123
+ </div>
124
+ </div>
125
+ </body>
126
+ </html>
127
+ <script type="text/javascript">
128
+
129
+ function close_onboarding_popup() {
130
+
131
+ var data = {
132
+ 'action': 'save_popup_visit',
133
+ };
134
+
135
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
136
+ jQuery.post(ajaxurl, data, function(response) {
137
+ });
138
+
139
+ jQuery('#getsocial-onboarding-popup').hide('slow');
140
+ }
141
+ </script>
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: addthis, addtoany, analytics, button, facebook share, facebook button, lik
5
 
6
  Requires at least: 3.0
7
  Tested up to: 4.4
8
- Stable tag: 3.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -284,6 +284,10 @@ Sure, we’re always here to help. You can contact us at support@getsocial.io or
284
 
285
  == Changelog ==
286
 
 
 
 
 
287
  **3.0**
288
 
289
  - Plugin verified and compatible with WordPress 4.4
5
 
6
  Requires at least: 3.0
7
  Tested up to: 4.4
8
+ Stable tag: 3.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
284
 
285
  == Changelog ==
286
 
287
+ **3.0.1**
288
+
289
+ - Added onboarding popup to guide user after plugin is activated
290
+
291
  **3.0**
292
 
293
  - Plugin verified and compatible with WordPress 4.4
wp-share-buttons-analytics-getsocial.php CHANGED
@@ -3,14 +3,13 @@
3
  * Plugin Name: Share Buttons & tools to grow traffic by GetSocial.io
4
  * Plugin URI: http://getsocial.io
5
  * Description: Share Buttons by GetSocial.io is a freemium WordPress plugin that enables you to track social shares on Wordpress. Provide beautiful wordpress sharing buttons, track how many shares were made in each post and see how much traffic, conversions and shares each post generated. Optimize your SEO and increase social shares with GetSocial.io.
6
- * Version: 3.0
7
  * Author: Getsocial, S.A.
8
  * Author URI: http://getsocial.io
9
  * License: GPL2
10
  */
11
 
12
  include('lib/gs.php');
13
-
14
  /* MENU */
15
 
16
  add_action('admin_menu', 'gs_getsocial_menu');
@@ -454,3 +453,33 @@ function getsocialio_save_meta_box_data($post_id) {
454
  }
455
 
456
  add_action( 'save_post', 'getsocialio_save_meta_box_data' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Plugin Name: Share Buttons & tools to grow traffic by GetSocial.io
4
  * Plugin URI: http://getsocial.io
5
  * Description: Share Buttons by GetSocial.io is a freemium WordPress plugin that enables you to track social shares on Wordpress. Provide beautiful wordpress sharing buttons, track how many shares were made in each post and see how much traffic, conversions and shares each post generated. Optimize your SEO and increase social shares with GetSocial.io.
6
+ * Version: 3.0.1
7
  * Author: Getsocial, S.A.
8
  * Author URI: http://getsocial.io
9
  * License: GPL2
10
  */
11
 
12
  include('lib/gs.php');
 
13
  /* MENU */
14
 
15
  add_action('admin_menu', 'gs_getsocial_menu');
453
  }
454
 
455
  add_action( 'save_post', 'getsocialio_save_meta_box_data' );
456
+
457
+ /* Welcome popover */
458
+
459
+ function add_popup_scripts_method() {
460
+
461
+ if (get_option('gs-popup-showed') == "showed") {
462
+ return;
463
+ } else {
464
+
465
+ $url = plugins_url( '/lib/onboarding_popup.php' , __FILE__ );
466
+
467
+ wp_enqueue_script( 'jquery-form');
468
+ wp_enqueue_script('gs-popover', plugins_url( '/js/create_popover.js' , __FILE__ ), array('jquery'));
469
+ wp_localize_script( 'gs-popover', 'GETSOCIAL_ONBOARDING_PATH', $url );
470
+ wp_localize_script( 'gs-popover', 'popup_showed', get_option('gs-popup-showed') );
471
+ }
472
+ }
473
+
474
+ add_action( 'admin_enqueue_scripts', 'add_popup_scripts_method' );
475
+
476
+ add_action( 'wp_ajax_save_popup_visit', 'save_popup_visit' );
477
+
478
+ function save_popup_visit() {
479
+
480
+ global $wpdb; // this is how you get access to the database
481
+
482
+ update_option("gs-popup-showed", "showed");
483
+
484
+ wp_die(); // this is required to terminate immediately and return a proper response
485
+ }