Version Description
Download this release
Release Info
Developer | joaoromao |
Plugin | Social Media Share Buttons |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.1.1
- css/getsocial-style.css +11 -5
- images/custom-bar.png +0 -0
- images/custom-expressions.png +0 -0
- images/floating-bar.png +0 -0
- images/social-bar.png +0 -0
- init.php +1 -1
- js/plugin.js +0 -1
- lib/gs.php +22 -14
- readme.txt +6 -1
- tmpl/apps.php +5 -4
- tmpl/custom-expressions.php +43 -40
- tmpl/header.php +4 -4
- wp-share-buttons-analytics-getsocial.php +2 -2
css/getsocial-style.css
CHANGED
@@ -84,7 +84,7 @@ header h2 {
|
|
84 |
|
85 |
.app-wrapper {
|
86 |
width: 290px;
|
87 |
-
margin: 20px
|
88 |
display: inline-block;
|
89 |
float: left;
|
90 |
position: relative;
|
@@ -160,15 +160,16 @@ header h2 {
|
|
160 |
color: white;
|
161 |
text-align: center;
|
162 |
}
|
163 |
-
|
164 |
font-size: 13px;
|
165 |
-
color:
|
|
|
166 |
text-decoration: none;
|
167 |
border-radius: 3px;
|
168 |
padding: 5px 9px;
|
169 |
margin-top: -4px;
|
170 |
float: right;
|
171 |
-
}
|
172 |
|
173 |
/* red */
|
174 |
.red-cta{
|
@@ -185,7 +186,7 @@ header h2 {
|
|
185 |
background: #edac2c;
|
186 |
}
|
187 |
.yellow-cta a, .yellow-cta a:visited{
|
188 |
-
background:
|
189 |
}
|
190 |
.yellow-cta a:focus, .yellow-cta a:hover{
|
191 |
background: #d19726;
|
@@ -337,6 +338,11 @@ form {
|
|
337 |
margin-bottom: 20px;
|
338 |
}
|
339 |
|
|
|
|
|
|
|
|
|
|
|
340 |
.form-content > * {
|
341 |
padding: 20px 15px;
|
342 |
}
|
84 |
|
85 |
.app-wrapper {
|
86 |
width: 290px;
|
87 |
+
margin: 20px 10px 0 0;
|
88 |
display: inline-block;
|
89 |
float: left;
|
90 |
position: relative;
|
160 |
color: white;
|
161 |
text-align: center;
|
162 |
}
|
163 |
+
.notification-bar a, .notification-bar a:visited, header a{
|
164 |
font-size: 13px;
|
165 |
+
color: gray;
|
166 |
+
background: white;
|
167 |
text-decoration: none;
|
168 |
border-radius: 3px;
|
169 |
padding: 5px 9px;
|
170 |
margin-top: -4px;
|
171 |
float: right;
|
172 |
+
}
|
173 |
|
174 |
/* red */
|
175 |
.red-cta{
|
186 |
background: #edac2c;
|
187 |
}
|
188 |
.yellow-cta a, .yellow-cta a:visited{
|
189 |
+
background: white;
|
190 |
}
|
191 |
.yellow-cta a:focus, .yellow-cta a:hover{
|
192 |
background: #d19726;
|
338 |
margin-bottom: 20px;
|
339 |
}
|
340 |
|
341 |
+
.form-content h4 {
|
342 |
+
margin: 3px;
|
343 |
+
padding: 5px 15px;
|
344 |
+
}
|
345 |
+
|
346 |
.form-content > * {
|
347 |
padding: 20px 15px;
|
348 |
}
|
images/custom-bar.png
DELETED
Binary file
|
images/custom-expressions.png
ADDED
Binary file
|
images/floating-bar.png
CHANGED
Binary file
|
images/social-bar.png
CHANGED
Binary file
|
init.php
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
</dl>
|
26 |
|
27 |
<p class="create-account">
|
28 |
-
<a href="<?php echo $
|
29 |
Get my API KEY!
|
30 |
</a>
|
31 |
</p>
|
25 |
</dl>
|
26 |
|
27 |
<p class="create-account">
|
28 |
+
<a href="<?php echo $GS->getGSAccount() ?>/api/v1/sites/create?source=wordpress&email=<?php echo get_option('admin_email') ?>&url=<?php echo get_option('siteurl') ?>" class="button button-primary create-gs-account">
|
29 |
Get my API KEY!
|
30 |
</a>
|
31 |
</p>
|
js/plugin.js
CHANGED
@@ -32,7 +32,6 @@ jQuery(function($) {
|
|
32 |
|
33 |
$.get(graph_api, function(data){
|
34 |
$.each(['total_visits', 'total_shares', 'total_leads'], function(i,stat){
|
35 |
-
console.log(stat);
|
36 |
jQuery('.'+stat).html(data[stat]);
|
37 |
});
|
38 |
|
32 |
|
33 |
$.get(graph_api, function(data){
|
34 |
$.each(['total_visits', 'total_shares', 'total_leads'], function(i,stat){
|
|
|
35 |
jQuery('.'+stat).html(data[stat]);
|
36 |
});
|
37 |
|
lib/gs.php
CHANGED
@@ -1,9 +1,14 @@
|
|
1 |
<?php
|
2 |
|
3 |
class GS {
|
4 |
-
private $gs_url = "http://api.at.getsocial.io
|
|
|
5 |
private $api_url = "http://getsocial.io/api/v1/";
|
6 |
|
|
|
|
|
|
|
|
|
7 |
function __construct($api_key, $identifier, $elements, $lang){
|
8 |
$this->api_key = $api_key;
|
9 |
$this->identifier = $identifier;
|
@@ -45,7 +50,7 @@ class GS {
|
|
45 |
if($this->api_key != ''):
|
46 |
return $this->api('sites/'.$this->api_key);
|
47 |
else:
|
48 |
-
return
|
49 |
endif;
|
50 |
}
|
51 |
|
@@ -58,7 +63,6 @@ class GS {
|
|
58 |
}
|
59 |
|
60 |
function save($site_info){
|
61 |
-
print_r($site_info);
|
62 |
update_option('gs-identifier', $site_info->identifier);
|
63 |
update_option('gs-elements', json_encode($site_info->elements));
|
64 |
}
|
@@ -68,17 +72,17 @@ class GS {
|
|
68 |
// return true;
|
69 |
// endif;
|
70 |
|
71 |
-
$site = $this->getSite();
|
72 |
-
|
73 |
-
$needs_update = $site == null ? '2' : $site == '3' ? '3' : '0';
|
74 |
-
|
75 |
-
if($site != null && $needs_update != '3'):
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
endif;
|
80 |
-
|
81 |
-
return $needs_update;
|
82 |
}
|
83 |
|
84 |
function getLib(){
|
@@ -181,4 +185,8 @@ EOF;
|
|
181 |
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
184 |
}
|
1 |
<?php
|
2 |
|
3 |
class GS {
|
4 |
+
private $gs_url = "http://api.at.getsocial.io";
|
5 |
+
private $gs_account = "http://getsocial.io/";
|
6 |
private $api_url = "http://getsocial.io/api/v1/";
|
7 |
|
8 |
+
// private $gs_url = "//localhost:3001";
|
9 |
+
// private $gs_account = "http://localhost:3000/";
|
10 |
+
// private $api_url = "http://localhost:3000/api/v1/";
|
11 |
+
|
12 |
function __construct($api_key, $identifier, $elements, $lang){
|
13 |
$this->api_key = $api_key;
|
14 |
$this->identifier = $identifier;
|
50 |
if($this->api_key != ''):
|
51 |
return $this->api('sites/'.$this->api_key);
|
52 |
else:
|
53 |
+
return null;
|
54 |
endif;
|
55 |
}
|
56 |
|
63 |
}
|
64 |
|
65 |
function save($site_info){
|
|
|
66 |
update_option('gs-identifier', $site_info->identifier);
|
67 |
update_option('gs-elements', json_encode($site_info->elements));
|
68 |
}
|
72 |
// return true;
|
73 |
// endif;
|
74 |
|
75 |
+
// $site = $this->getSite();
|
76 |
+
//
|
77 |
+
// $needs_update = $site == null ? '2' : $site == '3' ? '3' : '0';
|
78 |
+
//
|
79 |
+
// if($site != null && $needs_update != '3'):
|
80 |
+
// $needs_update = (json_encode($site->elements) != get_option('gs-elements')) ? '1' : '0';
|
81 |
+
//
|
82 |
+
// update_option('gs-needs-update', $needs_update);
|
83 |
+
// endif;
|
84 |
+
//
|
85 |
+
// return $needs_update;
|
86 |
}
|
87 |
|
88 |
function getLib(){
|
185 |
|
186 |
}
|
187 |
|
188 |
+
function getGSAccount(){
|
189 |
+
return $this->gs_account;
|
190 |
+
}
|
191 |
+
|
192 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: getsocial, sharing buttons, share button, social buttons, social sharing, ecommerce, social analytics, addthis, sharethis, woocommerce, e-commerce, AddThis, addtoany, admin, bookmark, bookmarking, bookmarks, button, Facebook, Facebook share, facebook like, google, google plus, google plus one, Like, linkedin, lockerz, pin, pin it, pinit, pinterest, plugin, plus 1, plus one, Post, posts, Reddit, save, seo, sexybookmarks, share, shareaholic, sharedaddy, sharethis, sharing, sidebar, sociable, social, social bookmarking, social bookmarks, statistics, stats, stumbleupon, tumblr, tweet, twitter, social media, social share, widget
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.1
|
7 |
-
Stable tag: 1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -86,6 +86,11 @@ Today, Facebook buttons are simply buttons with counters. The data and value you
|
|
86 |
|
87 |
== Changelog ==
|
88 |
|
|
|
|
|
|
|
|
|
|
|
89 |
**1.1**
|
90 |
|
91 |
- Create account without leaving the plugin
|
4 |
Tags: getsocial, sharing buttons, share button, social buttons, social sharing, ecommerce, social analytics, addthis, sharethis, woocommerce, e-commerce, AddThis, addtoany, admin, bookmark, bookmarking, bookmarks, button, Facebook, Facebook share, facebook like, google, google plus, google plus one, Like, linkedin, lockerz, pin, pin it, pinit, pinterest, plugin, plus 1, plus one, Post, posts, Reddit, save, seo, sexybookmarks, share, shareaholic, sharedaddy, sharethis, sharing, sidebar, sociable, social, social bookmarking, social bookmarks, statistics, stats, stumbleupon, tumblr, tweet, twitter, social media, social share, widget
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 1.1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
86 |
|
87 |
== Changelog ==
|
88 |
|
89 |
+
**1.1.1**
|
90 |
+
|
91 |
+
- Bug fixes
|
92 |
+
- App Custom actions added
|
93 |
+
|
94 |
**1.1**
|
95 |
|
96 |
- Create account without leaving the plugin
|
tmpl/apps.php
CHANGED
@@ -13,9 +13,10 @@
|
|
13 |
// 'native bar' => array(
|
14 |
// 'file' => 'native-bar'
|
15 |
// ),
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
19 |
// 'url tracking' => array(
|
20 |
// 'file' => 'url tracking'
|
21 |
// ),
|
@@ -32,7 +33,7 @@
|
|
32 |
<? if($settings['active']): ?>
|
33 |
<div class="app-status done"><i class="fa fa-check"></i></div>
|
34 |
<? endif; ?>
|
35 |
-
<img src="
|
36 |
<div class="app-link-buttons app-type-edit">
|
37 |
<a href="admin.php?page=<? echo slug_path('init.php&tab='.$settings['file']) ?>">
|
38 |
|
13 |
// 'native bar' => array(
|
14 |
// 'file' => 'native-bar'
|
15 |
// ),
|
16 |
+
'custom expressions' => array(
|
17 |
+
'file' => 'custom-expressions',
|
18 |
+
'active' => (get_option('gs-custom-expression-active') == '1'),
|
19 |
+
),
|
20 |
// 'url tracking' => array(
|
21 |
// 'file' => 'url tracking'
|
22 |
// ),
|
33 |
<? if($settings['active']): ?>
|
34 |
<div class="app-status done"><i class="fa fa-check"></i></div>
|
35 |
<? endif; ?>
|
36 |
+
<img src="<? echo plugins_url( '../images/'.$settings['file'].'.png', __FILE__ ) ?>" alt="">
|
37 |
<div class="app-link-buttons app-type-edit">
|
38 |
<a href="admin.php?page=<? echo slug_path('init.php&tab='.$settings['file']) ?>">
|
39 |
|
tmpl/custom-expressions.php
CHANGED
@@ -1,56 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
$has_custom_social_actions = !(get_option('gs-api-key') != '' && get_option('gs-elements') == '{}' );
|
3 |
if(!$has_custom_social_actions): ?>
|
4 |
<div class="notification-bar blue-cta">
|
5 |
<p>You haven’t created any social action yet. Create your first action button now.</p>
|
6 |
-
<a href="http://getsocial.io" target="_blank">Create Social Actions</a>
|
7 |
</div>
|
8 |
-
<?php endif; ?>
|
9 |
-
|
10 |
-
<div class="editor">
|
11 |
-
<form id="config-form" method="post" action="options.php">
|
12 |
-
<?php settings_fields( 'getsocial-gs-custom-expressions' ); ?>
|
13 |
-
<?php do_settings_sections( 'getsocial-gs-custom-expressions' ); ?>
|
14 |
-
|
15 |
-
<?php if($has_custom_social_actions): ?>
|
16 |
-
|
17 |
-
<div class="half">
|
18 |
-
<div class="onoff_check">
|
19 |
-
<span class="label">Active</span> <input type="checkbox" class="onoff" name="gs-custom-expression-active" value="1" style="display:none" <?php echo (get_option('gs-custom-expression-active') == '1' ? 'checked' : '') ?>/>
|
20 |
-
</div>
|
21 |
-
|
22 |
-
<div class="tab-content" id="config-form" >
|
23 |
-
<div class="half gs-clearfix">
|
24 |
-
<div class="form-group">
|
25 |
-
<label class="form-title" for="gs-buttons-position">Position on post</label>
|
26 |
|
27 |
-
|
28 |
-
<input type="radio" value="1" name="gs-custom-expression-position" <?php echo (get_option('gs-custom-expression-position') == 1 ? 'checked="checked"' : '') ?> />
|
29 |
-
<label>Bottom</label>
|
30 |
-
<input type="radio" value="0" name="gs-custom-expression-position" <?php echo (get_option('gs-custom-expression-position') == 0 ? 'checked="checked"' : '') ?> />
|
31 |
-
</div>
|
32 |
-
</div>
|
33 |
-
</div>
|
34 |
-
|
35 |
-
<div class="cl"></div>
|
36 |
|
37 |
-
|
38 |
-
|
|
|
39 |
|
40 |
-
|
41 |
-
<h3>List of created expressions</h3>
|
42 |
|
43 |
-
|
44 |
-
|
|
|
|
|
45 |
<tr>
|
46 |
<td><?= $elem ?></td>
|
47 |
</tr>
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
</div>
|
1 |
+
<h2><i class="fa fa-cog"></i>Custom Actions</h2>
|
2 |
+
|
3 |
+
<p class="notification-bar yellow-cta">
|
4 |
+
Sorry, in this version you have to build our custom actions in our site editor.
|
5 |
+
<a href="http://getsocial.io" target="_blank" class="button"><i class="fa fa-add"></i>New Custom Action</a>
|
6 |
+
</p>
|
7 |
+
|
8 |
<?php
|
9 |
$has_custom_social_actions = !(get_option('gs-api-key') != '' && get_option('gs-elements') == '{}' );
|
10 |
if(!$has_custom_social_actions): ?>
|
11 |
<div class="notification-bar blue-cta">
|
12 |
<p>You haven’t created any social action yet. Create your first action button now.</p>
|
|
|
13 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
+
<form id="custom-bar" method="post" action="options.php">
|
18 |
+
<?php settings_fields( 'getsocial-gs-custom-expressions' ); ?>
|
19 |
+
<?php do_settings_sections( 'getsocial-gs-custom-expressions' ); ?>
|
20 |
|
21 |
+
<?php if($has_custom_social_actions): ?>
|
|
|
22 |
|
23 |
+
<div class="form-content">
|
24 |
+
<h4>Expressions created</h4>
|
25 |
+
<table class="custom-expressions">
|
26 |
+
<?php foreach($GS->getElements() as $identifier => $elem): ?>
|
27 |
<tr>
|
28 |
<td><?= $elem ?></td>
|
29 |
</tr>
|
30 |
+
<?php endforeach; ?>
|
31 |
+
</table>
|
32 |
+
</div>
|
33 |
+
|
34 |
+
<div class="form-content">
|
35 |
+
<label class="control active">Active</label>
|
36 |
+
<div>
|
37 |
+
<input type="checkbox" name="gs-custom-expression-active" value="1" <?php echo (get_option('gs-custom-expression-active') == '1' ? 'checked' : '') ?>/>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
|
41 |
+
<div class="form-content">
|
42 |
+
<label class="control">Position</label>
|
43 |
+
|
44 |
+
<div class="position with-inputs-label">
|
45 |
+
<label>Top</label>
|
46 |
+
<input type="radio" value="1" name="gs-custom-expression-position" <?php echo (get_option('gs-custom-expression-position') == 1 ? 'checked="checked"' : '') ?> />
|
47 |
+
<label>Bottom</label>
|
48 |
+
<input type="radio" value="0" name="gs-custom-expression-position" <?php echo (get_option('gs-custom-expression-position') == 0 ? 'checked="checked"' : '') ?> />
|
49 |
</div>
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<div class="bar-active">
|
53 |
+
<?php submit_button('Save Changes'); ?>
|
54 |
+
|
55 |
+
<div class="cl"></div>
|
56 |
+
</div>
|
57 |
|
58 |
+
<?php endif; ?>
|
59 |
+
</form>
|
|
tmpl/header.php
CHANGED
@@ -3,7 +3,7 @@ if ( !current_user_can( 'manage_options' ) ) {
|
|
3 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
4 |
}
|
5 |
|
6 |
-
$GETSOCIAL_URL = 'http://getsocial.io';
|
7 |
// $GETSOCIAL_URL = 'http://localhost:3000';
|
8 |
|
9 |
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
@@ -13,9 +13,9 @@ $GS = new GS( get_option('gs-api-key'),
|
|
13 |
get_option('gs-elements'),
|
14 |
get_option('gs-lang'));
|
15 |
|
16 |
-
if(isset($_GET["refresh"]) && $GS->needs_update()):
|
17 |
-
|
18 |
-
endif;
|
19 |
|
20 |
$needs_update = $GS->needs_update();
|
21 |
|
3 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
4 |
}
|
5 |
|
6 |
+
// $GETSOCIAL_URL = 'http://getsocial.io';
|
7 |
// $GETSOCIAL_URL = 'http://localhost:3000';
|
8 |
|
9 |
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
13 |
get_option('gs-elements'),
|
14 |
get_option('gs-lang'));
|
15 |
|
16 |
+
// if(isset($_GET["refresh"]) && $GS->needs_update()):
|
17 |
+
$site_info = $GS->refreshSite();
|
18 |
+
// endif;
|
19 |
|
20 |
$needs_update = $GS->needs_update();
|
21 |
|
wp-share-buttons-analytics-getsocial.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/**
|
3 |
* Plugin Name: WP Share Buttons & Analytics by GetSocial
|
4 |
* Plugin URI: http://getsocial.io
|
5 |
-
* Description:
|
6 |
-
* Version: 1.1
|
7 |
* Author: Getsocial, S.A.
|
8 |
* Author URI: http://getsocial.io
|
9 |
* License: A "Slug" license name e.g. GPL2
|
2 |
/**
|
3 |
* Plugin Name: WP Share Buttons & Analytics by GetSocial
|
4 |
* Plugin URI: http://getsocial.io
|
5 |
+
* Description: Add social media sharing buttons from the most popular networks to track user activity, increase traffic, improve SEO, and follow conversions.
|
6 |
+
* Version: 1.1.1
|
7 |
* Author: Getsocial, S.A.
|
8 |
* Author URI: http://getsocial.io
|
9 |
* License: A "Slug" license name e.g. GPL2
|