Version Description
We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!
Download this release
Release Info
Developer | shareaholic |
Plugin | WordPress Social Tools, Related Posts, Monetization – Shareaholic |
Version | 9.3.0 |
Comparing to | |
See all releases |
Code changes from version 9.2.0 to 9.3.0
- admin.php +75 -1
- assets/css/common.css +20 -20
- assets/css/main.css +276 -276
- assets/css/reveal.css +80 -78
- assets/js/main.js +245 -210
- content_manager.php +0 -15
- curl.php +18 -18
- lib/plugin-deactivation-survey/deactivate-feedback-form.css +102 -0
- lib/plugin-deactivation-survey/deactivate-feedback-form.js +199 -0
- lib/plugin-deactivation-survey/deactivate-feedback-form.php +85 -0
- lib/plugin-deactivation-survey/remodal-default-theme.css +307 -0
- lib/plugin-deactivation-survey/remodal.css +93 -0
- lib/plugin-deactivation-survey/remodal.min.js +10 -0
- lib/social-share-counts/curl_multi_share_count.php +227 -223
- lib/social-share-counts/seq_share_count.php +81 -83
- lib/social-share-counts/share_count.php +293 -298
- lib/social-share-counts/wordpress_http.php +116 -112
- public_js.php +7 -7
- readme.txt +9 -6
- shareaholic.php +3 -3
- templates/admin.php +12 -12
- templates/admin_form.php +5 -5
- templates/advanced_settings.php +95 -98
- templates/failed_to_create_api_key.php +5 -5
- templates/failed_to_create_api_key_modal.php +5 -5
- templates/footer.php +6 -6
- templates/header.php +4 -4
- templates/meta_boxes.php +16 -16
- templates/script_chat.php +0 -1
- templates/script_tag.php +3 -3
- templates/settings.php +44 -44
- templates/terms_of_service_modal.php +19 -19
- templates/terms_of_service_notice.php +5 -6
- templates/verify_api_key_js.php +21 -21
- templates/why_to_sign_up.php +14 -14
- utilities.php +50 -50
admin.php
CHANGED
@@ -5,6 +5,8 @@
|
|
5 |
* @package shareaholic
|
6 |
*/
|
7 |
|
|
|
|
|
8 |
/**
|
9 |
* This class takes care of all of the admin interface.
|
10 |
*
|
@@ -36,6 +38,10 @@ class ShareaholicAdmin {
|
|
36 |
self::check_redirect_url();
|
37 |
self::check_review_dismissal();
|
38 |
self::check_plugin_review();
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
/**
|
@@ -153,7 +159,7 @@ class ShareaholicAdmin {
|
|
153 |
<a onClick="' . "shr_openWindowReload('https://wordpress.org/support/plugin/shareaholic/reviews/?rate=5#new-post', '$dismiss_forever_url')" . '" class="button button-primary">' . __( 'Ok, you deserve it', 'shareaholic' ) . '</a>
|
154 |
<a href="' . $dismiss_forlater_url . '">' . __( 'No, not good enough', 'shareaholic' ) . '</a>
|
155 |
<a href="' . $dismiss_forever_url . '">' . __( 'I already did', 'shareaholic' ) . '</a>
|
156 |
-
<a href="' . $dismiss_forever_url . '">' . __( 'Dismiss', '
|
157 |
</p>
|
158 |
</div>';
|
159 |
}
|
@@ -874,4 +880,72 @@ JQUERY;
|
|
874 |
echo '</p></div>';
|
875 |
}
|
876 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
877 |
}
|
5 |
* @package shareaholic
|
6 |
*/
|
7 |
|
8 |
+
require_once SHAREAHOLIC_PATH . 'lib/plugin-deactivation-survey/deactivate-feedback-form.php';
|
9 |
+
|
10 |
/**
|
11 |
* This class takes care of all of the admin interface.
|
12 |
*
|
38 |
self::check_redirect_url();
|
39 |
self::check_review_dismissal();
|
40 |
self::check_plugin_review();
|
41 |
+
|
42 |
+
if ( ! has_filter('shareaholic_deactivate_feedback_form_plugins', array('ShareaholicAdmin','deactivation_survey_data')) ) {
|
43 |
+
add_filter('shareaholic_deactivate_feedback_form_plugins', array('ShareaholicAdmin','deactivation_survey_data'));
|
44 |
+
}
|
45 |
}
|
46 |
|
47 |
/**
|
159 |
<a onClick="' . "shr_openWindowReload('https://wordpress.org/support/plugin/shareaholic/reviews/?rate=5#new-post', '$dismiss_forever_url')" . '" class="button button-primary">' . __( 'Ok, you deserve it', 'shareaholic' ) . '</a>
|
160 |
<a href="' . $dismiss_forlater_url . '">' . __( 'No, not good enough', 'shareaholic' ) . '</a>
|
161 |
<a href="' . $dismiss_forever_url . '">' . __( 'I already did', 'shareaholic' ) . '</a>
|
162 |
+
<a href="' . $dismiss_forever_url . '">' . __( 'Dismiss', 'shareaholic' ) . '</a>
|
163 |
</p>
|
164 |
</div>';
|
165 |
}
|
880 |
echo '</p></div>';
|
881 |
}
|
882 |
}
|
883 |
+
|
884 |
+
/**
|
885 |
+
* Registers Shareaholic plugin for the deactivation survey library code.
|
886 |
+
*
|
887 |
+
* @param array $plugins
|
888 |
+
*
|
889 |
+
* @return array
|
890 |
+
*/
|
891 |
+
public static function deactivation_survey_data( $plugins ) {
|
892 |
+
$plugin_data = get_plugin_data(SHAREAHOLIC_FILE, false, false);
|
893 |
+
|
894 |
+
$plugins[] = (object) array(
|
895 |
+
'title_slugged' => sanitize_title($plugin_data['Name']),
|
896 |
+
'basename' => plugin_basename(SHAREAHOLIC_FILE),
|
897 |
+
'logo' => SHAREAHOLIC_ASSET_DIR. '/img/icon-256x256.png',
|
898 |
+
'api_server' => 'yarpp.com',
|
899 |
+
'script_cache_ver' => Shareaholic::VERSION,
|
900 |
+
'bgcolor' => '#fff',
|
901 |
+
'send' => array(
|
902 |
+
'plugin_name' => 'shareaholic',
|
903 |
+
'plugin_version' => Shareaholic::VERSION,
|
904 |
+
'api_key' => ShareaholicUtilities::get_option( 'api_key' ),
|
905 |
+
'verification_key' => ShareaholicUtilities::get_option( 'verification_key' ),
|
906 |
+
'platform' => 'wordpress',
|
907 |
+
'domain' => site_url(),
|
908 |
+
'language' => strtolower( get_bloginfo( 'language' ) ),
|
909 |
+
),
|
910 |
+
'reasons' => array(
|
911 |
+
'error' => esc_html__( 'I think I found a bug', 'shareaholic' ),
|
912 |
+
'feature-missing' => esc_html__( 'It\'s missing a feature I need', 'shareaholic' ),
|
913 |
+
'too-hard' => esc_html__( 'I couldn\'t figure out how to do something', 'shareaholic' ),
|
914 |
+
'inefficient' => esc_html__( 'It\'s too slow or inefficient', 'shareaholic' ),
|
915 |
+
'no-signup' => esc_html__( 'I don\'t want to signup', 'shareaholic' ),
|
916 |
+
'temporary-deactivation' => esc_html__( 'Temporarily deactivating or troubleshooting', 'shareaholic' ),
|
917 |
+
'other' => esc_html__( 'Other', 'shareaholic' )
|
918 |
+
),
|
919 |
+
'reasons_needing_comment' => array(
|
920 |
+
'error',
|
921 |
+
'feature-missing',
|
922 |
+
'too-hard',
|
923 |
+
'other'
|
924 |
+
),
|
925 |
+
'translations' => array(
|
926 |
+
'quick_feedback' => esc_html__( 'Quick Feedback', 'shareaholic' ),
|
927 |
+
'foreword' => esc_html__( 'If you would be kind enough, please tell us why you are deactivating the plugin:',
|
928 |
+
'shareaholic' ),
|
929 |
+
'please_tell_us' => esc_html__( 'Please share anything you think might be helpful. The more we know about your problem, the faster we\'ll be able to fix it.',
|
930 |
+
'shareaholic' ),
|
931 |
+
'cancel' => esc_html__( 'Cancel', 'shareaholic' ),
|
932 |
+
'skip_and_deactivate' => esc_html__( 'Skip & Deactivate', 'shareaholic' ),
|
933 |
+
'submit_and_deactivate' => esc_html__( 'Submit & Deactivate', 'shareaholic' ),
|
934 |
+
'please_wait' => esc_html__( 'Please wait...', 'shareaholic' ),
|
935 |
+
'thank_you' => esc_html__( 'Thank you!', 'shareaholic' ),
|
936 |
+
'ask_for_support' => sprintf(
|
937 |
+
esc_html__( 'Have you visited %1$sthe support forum%2$s and %3$sread the FAQs%2$s for help?',
|
938 |
+
'shareaholic' ),
|
939 |
+
'<a href="https://support.shareaholic.com/" target="_blank" >',
|
940 |
+
'</a>',
|
941 |
+
'<a href="https://support.shareaholic.com/hc/categories/200101476-Shareaholic-WordPress-Plugin" target="_blank" >'
|
942 |
+
),
|
943 |
+
'email_request' => esc_html__( 'If you would like to tell us more, please leave your email here. We will be in touch (only for product feedback, nothing else).',
|
944 |
+
'shareaholic' ),
|
945 |
+
)
|
946 |
+
|
947 |
+
);
|
948 |
+
|
949 |
+
return $plugins;
|
950 |
+
}
|
951 |
}
|
assets/css/common.css
CHANGED
@@ -1,64 +1,64 @@
|
|
1 |
.btn-warning {
|
2 |
-
|
3 |
}
|
4 |
|
5 |
.button-primary {
|
6 |
-
|
7 |
}
|
8 |
|
9 |
.shareaholic-settings-h2 {
|
10 |
-
|
11 |
}
|
12 |
|
13 |
/* Header */
|
14 |
#shr-header {
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
}
|
20 |
|
21 |
#shr-header .shr-header-content {
|
22 |
-
|
23 |
-
|
24 |
}
|
25 |
|
26 |
.shr-mobile {
|
27 |
-
|
28 |
}
|
29 |
|
30 |
#shr-header .shr-nav-2 .shr-user-menu {
|
31 |
-
|
32 |
}
|
33 |
|
34 |
#shr-header .shr-sites-container {
|
35 |
-
|
36 |
}
|
37 |
|
38 |
#shr-header .shr-nav-2 .shr-signup-login {
|
39 |
-
|
40 |
}
|
41 |
|
42 |
#shr-header .shr-nav-2 .shr-profile {
|
43 |
-
|
44 |
}
|
45 |
-
|
46 |
/* End Header */
|
47 |
|
48 |
/* Hides WP Nag Screen */
|
49 |
#update-nag, .update-nag {
|
50 |
-
|
51 |
}
|
52 |
|
53 |
/*** Hides notice pollution from other plugins ***/
|
54 |
.notice {
|
55 |
-
|
56 |
}
|
57 |
.error {
|
58 |
-
|
59 |
}
|
60 |
/* ensure Shareaholic notices show */
|
61 |
.notice.notice-info.is-dismissible.shareaholic-review-notice {
|
62 |
-
|
63 |
}
|
64 |
-
/*** Hides notice pollution ***/
|
1 |
.btn-warning {
|
2 |
+
color: #fff !important;
|
3 |
}
|
4 |
|
5 |
.button-primary {
|
6 |
+
color: #fff !important;
|
7 |
}
|
8 |
|
9 |
.shareaholic-settings-h2 {
|
10 |
+
padding: 0 !important;
|
11 |
}
|
12 |
|
13 |
/* Header */
|
14 |
#shr-header {
|
15 |
+
position: initial !important;
|
16 |
+
z-index: auto !important;
|
17 |
+
margin-left: -20px !important;
|
18 |
+
width: auto !important;
|
19 |
}
|
20 |
|
21 |
#shr-header .shr-header-content {
|
22 |
+
max-width: 100% !important;
|
23 |
+
margin: 0 0 0 20px !important;
|
24 |
}
|
25 |
|
26 |
.shr-mobile {
|
27 |
+
z-index: 2147483647 !important;
|
28 |
}
|
29 |
|
30 |
#shr-header .shr-nav-2 .shr-user-menu {
|
31 |
+
z-index: 2147483647 !important;
|
32 |
}
|
33 |
|
34 |
#shr-header .shr-sites-container {
|
35 |
+
z-index: 2147483647 !important;
|
36 |
}
|
37 |
|
38 |
#shr-header .shr-nav-2 .shr-signup-login {
|
39 |
+
margin-right: 2em !important;
|
40 |
}
|
41 |
|
42 |
#shr-header .shr-nav-2 .shr-profile {
|
43 |
+
margin-right: 15px !important;
|
44 |
}
|
45 |
+
|
46 |
/* End Header */
|
47 |
|
48 |
/* Hides WP Nag Screen */
|
49 |
#update-nag, .update-nag {
|
50 |
+
display: none !important;
|
51 |
}
|
52 |
|
53 |
/*** Hides notice pollution from other plugins ***/
|
54 |
.notice {
|
55 |
+
display: none !important;
|
56 |
}
|
57 |
.error {
|
58 |
+
display: none !important;
|
59 |
}
|
60 |
/* ensure Shareaholic notices show */
|
61 |
.notice.notice-info.is-dismissible.shareaholic-review-notice {
|
62 |
+
display: block !important;
|
63 |
}
|
64 |
+
/*** Hides notice pollution ***/
|
assets/css/main.css
CHANGED
@@ -1,106 +1,106 @@
|
|
1 |
body {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
}
|
9 |
|
10 |
.app a, .text-muted a {
|
11 |
-
|
12 |
-
|
13 |
}
|
14 |
|
15 |
.btn-dark {
|
16 |
-
|
17 |
}
|
18 |
|
19 |
.container-fluid {
|
20 |
-
|
21 |
-
|
22 |
}
|
23 |
|
24 |
.canvas {
|
25 |
-
|
26 |
}
|
27 |
|
28 |
h3 {
|
29 |
-
|
30 |
}
|
31 |
|
32 |
.clear {
|
33 |
-
|
34 |
-
|
35 |
}
|
36 |
|
37 |
#app_settings {
|
38 |
-
|
39 |
}
|
40 |
|
41 |
fieldset {
|
42 |
border: 1px solid #d8d8d8;
|
43 |
margin: 5px;
|
44 |
padding: 10px;
|
45 |
-
|
46 |
}
|
47 |
|
48 |
-
fieldset#facebook-app.failed
|
49 |
-
|
50 |
}
|
51 |
|
52 |
.app {
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
}
|
60 |
|
61 |
.wide-button {
|
62 |
-
|
63 |
}
|
64 |
|
65 |
.button-wrapper {
|
66 |
-
|
67 |
-
|
68 |
}
|
69 |
|
70 |
.app h2 {
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
}
|
76 |
|
77 |
.app-content {
|
78 |
-
|
79 |
}
|
80 |
-
|
81 |
.app label {
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
}
|
86 |
-
|
87 |
legend {
|
88 |
border: none;
|
89 |
width: auto;
|
90 |
font-weight: bold;
|
91 |
padding: 0px 10px;
|
92 |
color: #007bb6;
|
93 |
-
|
94 |
-
|
95 |
}
|
96 |
|
97 |
.location {
|
98 |
-
|
99 |
-
|
100 |
}
|
101 |
|
102 |
.location_item_cta {
|
103 |
-
|
104 |
}
|
105 |
|
106 |
.check {
|
@@ -108,26 +108,26 @@ legend {
|
|
108 |
}
|
109 |
|
110 |
.shr-form-item {
|
111 |
-
|
112 |
}
|
113 |
|
114 |
-
.shr-form-item
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
}
|
119 |
|
120 |
.shr-form-text ~ .shr-form-text {
|
121 |
-
|
122 |
}
|
123 |
|
124 |
.shr-form-text label {
|
125 |
-
|
126 |
}
|
127 |
|
128 |
.regular-text{
|
129 |
-
|
130 |
-
|
131 |
}
|
132 |
|
133 |
.label {
|
@@ -135,72 +135,72 @@ legend {
|
|
135 |
}
|
136 |
|
137 |
#iframe_container, iframe {
|
138 |
-
|
139 |
-
|
140 |
}
|
141 |
|
142 |
.bg-loading-img {
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
}
|
147 |
|
148 |
#shortcode_container, #shortcode {
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
}
|
155 |
|
156 |
#shortcode_container {
|
157 |
-
|
158 |
}
|
159 |
|
160 |
#shortcode {
|
161 |
-
|
162 |
}
|
163 |
|
164 |
.reveal-modal {
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
}
|
171 |
|
172 |
.reveal-modal.has-shortcode iframe,
|
173 |
.reveal-modal.has-shortcode #iframe_container {
|
174 |
-
|
175 |
}
|
176 |
|
177 |
.fieldset-footer {
|
178 |
-
|
179 |
-
|
180 |
}
|
181 |
|
182 |
.fieldset-footer button {
|
183 |
-
|
184 |
}
|
185 |
|
186 |
.fieldset-footer .app-status {
|
187 |
-
|
188 |
}
|
189 |
|
190 |
#editing_modal {
|
191 |
-
|
192 |
}
|
193 |
|
194 |
ul {
|
195 |
-
|
196 |
}
|
197 |
|
198 |
.green {
|
199 |
-
|
200 |
}
|
201 |
|
202 |
.red {
|
203 |
-
|
204 |
}
|
205 |
|
206 |
/**
|
@@ -209,121 +209,121 @@ ul {
|
|
209 |
* Please use judiciously. You want to be using defaults most of the time, these are exceptions!
|
210 |
* <type><location><size>
|
211 |
*/
|
212 |
-
|
213 |
h1, h2, h3, h4, h5, h6, ol,dl, p,blockquote, .media {margin:10px;}
|
214 |
h1, h2, h3, h4, h5, h6,img{padding-bottom:0px;}
|
215 |
pre{margin: 10px;}
|
216 |
table h1,table h2,table h3, table h4, table h5, table h6, table p, table ul, table ol, table dl{padding:0;}
|
217 |
|
218 |
.blocking-modal {
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
}
|
232 |
|
233 |
.api-key-modal {
|
234 |
-
|
235 |
}
|
236 |
|
237 |
h4 {
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
}
|
246 |
|
247 |
.blocking-modal a {
|
248 |
-
|
249 |
-
|
250 |
}
|
251 |
|
252 |
.blocking-modal a:hover {
|
253 |
-
|
254 |
}
|
255 |
|
256 |
.blocking-modal h2 {
|
257 |
-
|
258 |
-
|
259 |
}
|
260 |
|
261 |
.blocking-modal p {
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
}
|
267 |
|
268 |
.blocking-modal img {
|
269 |
-
|
270 |
-
|
271 |
}
|
272 |
|
273 |
.blocking-modal .btn_main {
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
}
|
289 |
|
290 |
.blocking-modal .btn_main:active {
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
}
|
297 |
|
298 |
.blocking-modal .btn_main:hover {
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
}
|
303 |
|
304 |
.blocking-modal .shr-people {
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
}
|
311 |
|
312 |
.blocking-modal .small {
|
313 |
-
|
314 |
-
|
315 |
}
|
316 |
|
317 |
input[type='text'] {
|
318 |
-
|
319 |
}
|
320 |
|
321 |
.settings_updated {
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
}
|
328 |
|
329 |
.signuppromo {
|
@@ -346,18 +346,18 @@ input[type='text'] {
|
|
346 |
}
|
347 |
|
348 |
.signuppromo ul {
|
349 |
-
|
350 |
}
|
351 |
|
352 |
.signuppromo ul li {
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
}
|
362 |
|
363 |
.sidebar_links {
|
@@ -367,94 +367,94 @@ input[type='text'] {
|
|
367 |
}
|
368 |
|
369 |
.sidebar_links ul {
|
370 |
-
|
371 |
-
|
372 |
}
|
373 |
|
374 |
.sidebar_links ul li {
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
}
|
380 |
|
381 |
.key-status {
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
}
|
386 |
|
387 |
.key-description {
|
388 |
-
|
389 |
-
|
390 |
}
|
391 |
|
392 |
.key-status.failed {
|
393 |
-
|
394 |
}
|
395 |
|
396 |
.key-status.passed {
|
397 |
-
|
398 |
}
|
399 |
|
400 |
.key-status.unknown {
|
401 |
-
|
402 |
}
|
403 |
|
404 |
.blink {
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
}
|
412 |
|
413 |
@keyframes blinker {
|
414 |
-
|
415 |
-
|
416 |
}
|
417 |
|
418 |
i.icon.icon-share_buttons {
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
}
|
423 |
|
424 |
i.icon.icon-recommendations {
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
}
|
429 |
|
430 |
i.icon.icon-affiliate {
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
}
|
435 |
|
436 |
i.icon.icon-analytics {
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
}
|
441 |
|
442 |
i.icon.icon-website {
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
}
|
447 |
|
448 |
i.icon {
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
}
|
459 |
|
460 |
|
@@ -463,136 +463,136 @@ i.icon {
|
|
463 |
// *****************************************************************************
|
464 |
|
465 |
.plugin-value-section-container {
|
466 |
-
|
467 |
-
|
468 |
}
|
469 |
|
470 |
.plugin-value-section {
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
}
|
480 |
|
481 |
.plugin-value-section .plugin-value-line {
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
}
|
490 |
|
491 |
.plugin-value-section .plugin-value {
|
492 |
-
|
493 |
}
|
494 |
|
495 |
.plugin-value-section .plugin-value li {
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
}
|
504 |
|
505 |
.plugin-value-section .plugin-value li:last-child {
|
506 |
-
|
507 |
}
|
508 |
|
509 |
.plugin-value-section .plugin-value li p {
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
}
|
515 |
|
516 |
.plugin-value-section .plugin-value li a {
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
}
|
523 |
|
524 |
.plugin-value-section .plugin-value li .icon {
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
}
|
539 |
|
540 |
.plugin-value-section .plugin-value li .icon.fa-bullhorn {
|
541 |
-
|
542 |
}
|
543 |
|
544 |
.plugin-value-section .plugin-value li .icon.fa-fire {
|
545 |
-
|
546 |
}
|
547 |
|
548 |
.plugin-value-section .plugin-value li .icon.fa-bar-chart-o {
|
549 |
-
|
550 |
}
|
551 |
|
552 |
.plugin-value-section .plugin-value li .icon.fa-usd {
|
553 |
-
|
554 |
}
|
555 |
|
556 |
.plugin-value-section .plugin-value li.acquire .title {
|
557 |
-
|
558 |
}
|
559 |
|
560 |
.plugin-value-section .plugin-value li.engage .title {
|
561 |
-
|
562 |
}
|
563 |
|
564 |
.plugin-value-section .plugin-value li.learn .title {
|
565 |
-
|
566 |
}
|
567 |
|
568 |
.plugin-value-section .plugin-value li.monetize .title {
|
569 |
-
|
570 |
}
|
571 |
|
572 |
.plugin-value-section .plugin-value li a:hover {
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
}
|
578 |
|
579 |
.plugin-value-section .plugin-value li .title {
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
}
|
590 |
|
591 |
.plugin-value-section.in-viewport {
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
}
|
1 |
body {
|
2 |
+
background: #f1f1f1 !important;
|
3 |
+
font-family: sans-serif;
|
4 |
+
font-size: 12px !important;
|
5 |
+
color: #666666;
|
6 |
+
-webkit-font-smoothing: antialiased;
|
7 |
+
font-smoothing: antialiased;
|
8 |
}
|
9 |
|
10 |
.app a, .text-muted a {
|
11 |
+
color: #337ab7;
|
12 |
+
text-decoration: none;
|
13 |
}
|
14 |
|
15 |
.btn-dark {
|
16 |
+
color: #fff !important;
|
17 |
}
|
18 |
|
19 |
.container-fluid {
|
20 |
+
padding: 0px;
|
21 |
+
clear: both;
|
22 |
}
|
23 |
|
24 |
.canvas {
|
25 |
+
display: block;
|
26 |
}
|
27 |
|
28 |
h3 {
|
29 |
+
clear: both;
|
30 |
}
|
31 |
|
32 |
.clear {
|
33 |
+
clear: both !important;
|
34 |
+
height: auto !important;
|
35 |
}
|
36 |
|
37 |
#app_settings {
|
38 |
+
padding-top: 0px;
|
39 |
}
|
40 |
|
41 |
fieldset {
|
42 |
border: 1px solid #d8d8d8;
|
43 |
margin: 5px;
|
44 |
padding: 10px;
|
45 |
+
float:left;
|
46 |
}
|
47 |
|
48 |
+
fieldset#facebook-app.failed {
|
49 |
+
border: 1px solid #f44336;
|
50 |
}
|
51 |
|
52 |
.app {
|
53 |
+
width:100%;
|
54 |
+
margin: 15px 0 15px 0;
|
55 |
+
padding: 10px;
|
56 |
+
border: 1px solid #e5e5e5;
|
57 |
+
background-color: #fdfdfd;
|
58 |
+
box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
59 |
}
|
60 |
|
61 |
.wide-button {
|
62 |
+
min-width: 200px;
|
63 |
}
|
64 |
|
65 |
.button-wrapper {
|
66 |
+
clear: both;
|
67 |
+
padding-top: 5px;
|
68 |
}
|
69 |
|
70 |
.app h2 {
|
71 |
+
font-size: 18px;
|
72 |
+
padding: 10px 10px 10px 20px;
|
73 |
+
margin: -10px -10px 0;
|
74 |
+
border-bottom: 1px solid #ccc;
|
75 |
}
|
76 |
|
77 |
.app-content {
|
78 |
+
padding: 15px 0 5px 10px;
|
79 |
}
|
80 |
+
|
81 |
.app label {
|
82 |
+
font-size: 12px;
|
83 |
+
display: inline;
|
84 |
+
line-height: 1.6em;
|
85 |
}
|
86 |
+
|
87 |
legend {
|
88 |
border: none;
|
89 |
width: auto;
|
90 |
font-weight: bold;
|
91 |
padding: 0px 10px;
|
92 |
color: #007bb6;
|
93 |
+
margin-bottom: 0;
|
94 |
+
font-size: 13px;
|
95 |
}
|
96 |
|
97 |
.location {
|
98 |
+
clear: both;
|
99 |
+
padding-top: 5px;
|
100 |
}
|
101 |
|
102 |
.location_item_cta {
|
103 |
+
margin-left: 25px;
|
104 |
}
|
105 |
|
106 |
.check {
|
108 |
}
|
109 |
|
110 |
.shr-form-item {
|
111 |
+
padding-bottom: 4px !important;
|
112 |
}
|
113 |
|
114 |
+
.shr-form-item > * {
|
115 |
+
display: inline-block !important;
|
116 |
+
max-width: 90%;
|
117 |
+
vertical-align: top;
|
118 |
}
|
119 |
|
120 |
.shr-form-text ~ .shr-form-text {
|
121 |
+
margin-top: .5rem;
|
122 |
}
|
123 |
|
124 |
.shr-form-text label {
|
125 |
+
margin-bottom: 0;
|
126 |
}
|
127 |
|
128 |
.regular-text{
|
129 |
+
margin: 1px;
|
130 |
+
padding: 3px 5px;
|
131 |
}
|
132 |
|
133 |
.label {
|
135 |
}
|
136 |
|
137 |
#iframe_container, iframe {
|
138 |
+
width: 100%;
|
139 |
+
height: 100%;
|
140 |
}
|
141 |
|
142 |
.bg-loading-img {
|
143 |
+
background-image:url(../img/ajax_loader_green_128.gif);
|
144 |
+
background-repeat:no-repeat;
|
145 |
+
background-position: center center;
|
146 |
}
|
147 |
|
148 |
#shortcode_container, #shortcode {
|
149 |
+
cursor: inherit;
|
150 |
+
width: 100%;
|
151 |
+
text-align: center;
|
152 |
+
background: white;
|
153 |
+
height: 30px;
|
154 |
}
|
155 |
|
156 |
#shortcode_container {
|
157 |
+
border-top: 3px solid #ccc;
|
158 |
}
|
159 |
|
160 |
#shortcode {
|
161 |
+
font-family: monospace;
|
162 |
}
|
163 |
|
164 |
.reveal-modal {
|
165 |
+
width: 720px;
|
166 |
+
height: 80%;
|
167 |
+
margin-left: -335px;
|
168 |
+
position: fixed;
|
169 |
+
/* display: none; */
|
170 |
}
|
171 |
|
172 |
.reveal-modal.has-shortcode iframe,
|
173 |
.reveal-modal.has-shortcode #iframe_container {
|
174 |
+
height: 100%;
|
175 |
}
|
176 |
|
177 |
.fieldset-footer {
|
178 |
+
clear: both;
|
179 |
+
overflow: hidden;
|
180 |
}
|
181 |
|
182 |
.fieldset-footer button {
|
183 |
+
float: left;
|
184 |
}
|
185 |
|
186 |
.fieldset-footer .app-status {
|
187 |
+
float: left;
|
188 |
}
|
189 |
|
190 |
#editing_modal {
|
191 |
+
padding: 0;
|
192 |
}
|
193 |
|
194 |
ul {
|
195 |
+
margin: 0px;
|
196 |
}
|
197 |
|
198 |
.green {
|
199 |
+
color: #11967a;
|
200 |
}
|
201 |
|
202 |
.red {
|
203 |
+
color: #f44336;
|
204 |
}
|
205 |
|
206 |
/**
|
209 |
* Please use judiciously. You want to be using defaults most of the time, these are exceptions!
|
210 |
* <type><location><size>
|
211 |
*/
|
212 |
+
/* ====== Default spacing ====== */
|
213 |
h1, h2, h3, h4, h5, h6, ol,dl, p,blockquote, .media {margin:10px;}
|
214 |
h1, h2, h3, h4, h5, h6,img{padding-bottom:0px;}
|
215 |
pre{margin: 10px;}
|
216 |
table h1,table h2,table h3, table h4, table h5, table h6, table p, table ul, table ol, table dl{padding:0;}
|
217 |
|
218 |
.blocking-modal {
|
219 |
+
font-family: 'Open Sans', sans-serif;
|
220 |
+
top:150px;
|
221 |
+
background: white;
|
222 |
+
width: 680px;
|
223 |
+
overflow: hidden;
|
224 |
+
text-align: center;
|
225 |
+
color: #414042;
|
226 |
+
font-size: 14px;
|
227 |
+
line-height: 1.6em;
|
228 |
+
box-shadow: 0px 0px 52px rgba(0,0,0,0.32);
|
229 |
+
padding: 0;
|
230 |
+
height: 495px;
|
231 |
}
|
232 |
|
233 |
.api-key-modal {
|
234 |
+
height: auto;
|
235 |
}
|
236 |
|
237 |
h4 {
|
238 |
+
background: #424142;
|
239 |
+
color: #e6e6e6;
|
240 |
+
font-size: 24px;
|
241 |
+
line-height: 1.8em;
|
242 |
+
height: auto;
|
243 |
+
font-weight: 300;
|
244 |
+
margin: 0;
|
245 |
}
|
246 |
|
247 |
.blocking-modal a {
|
248 |
+
color: #3f7792;
|
249 |
+
text-decoration: none;
|
250 |
}
|
251 |
|
252 |
.blocking-modal a:hover {
|
253 |
+
color: #0988be;
|
254 |
}
|
255 |
|
256 |
.blocking-modal h2 {
|
257 |
+
font-size: 28px;
|
258 |
+
font-weight: normal;
|
259 |
}
|
260 |
|
261 |
.blocking-modal p {
|
262 |
+
margin: 10px;
|
263 |
+
font-size: 12px;
|
264 |
+
line-height: 1.6em;
|
265 |
+
padding: 0px 10px 0px 10px;
|
266 |
}
|
267 |
|
268 |
.blocking-modal img {
|
269 |
+
width: 100px;
|
270 |
+
height: 100px;
|
271 |
}
|
272 |
|
273 |
.blocking-modal .btn_main {
|
274 |
+
margin-bottom: 5px;
|
275 |
+
position: relative;
|
276 |
+
cursor: pointer;
|
277 |
+
display: inline-block;
|
278 |
+
background: #FF9800;
|
279 |
+
color: white;
|
280 |
+
text-transform: uppercase;
|
281 |
+
text-decoration: none;
|
282 |
+
padding: 25px 80px;
|
283 |
+
font-size: 20px;
|
284 |
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
|
285 |
+
border-radius: 5px;
|
286 |
+
-webkit-box-shadow: inset 0 -3px #14947b;
|
287 |
+
box-shadow: inset 0 -3px #14947b;
|
288 |
}
|
289 |
|
290 |
.blocking-modal .btn_main:active {
|
291 |
+
top: 1px;
|
292 |
+
color: white;
|
293 |
+
outline: none;
|
294 |
+
-webkit-box-shadow: none;
|
295 |
+
box-shadow: none;
|
296 |
}
|
297 |
|
298 |
.blocking-modal .btn_main:hover {
|
299 |
+
background: #f79300;
|
300 |
+
color: white;
|
301 |
+
border: none;
|
302 |
}
|
303 |
|
304 |
.blocking-modal .shr-people {
|
305 |
+
background-image: url(../img/happy-people-cover.png);
|
306 |
+
background-position: center;
|
307 |
+
min-height: 200px;
|
308 |
+
background-size: contain;
|
309 |
+
background-repeat: no-repeat;
|
310 |
}
|
311 |
|
312 |
.blocking-modal .small {
|
313 |
+
font-size: 12px;
|
314 |
+
color: #888888;
|
315 |
}
|
316 |
|
317 |
input[type='text'] {
|
318 |
+
width: 272px;
|
319 |
}
|
320 |
|
321 |
.settings_updated {
|
322 |
+
color: #fff;
|
323 |
+
text-shadow: 0px 1px 1px rgba(0,0,0,0.4);
|
324 |
+
font-size: 14px;
|
325 |
+
background-color: #45a147 !important;
|
326 |
+
border-color: #316632 !important;
|
327 |
}
|
328 |
|
329 |
.signuppromo {
|
346 |
}
|
347 |
|
348 |
.signuppromo ul {
|
349 |
+
margin: 24px 0px;
|
350 |
}
|
351 |
|
352 |
.signuppromo ul li {
|
353 |
+
background: url(../img/bolt.png) 0 2px no-repeat;
|
354 |
+
background-size: 18px 18px;
|
355 |
+
color: #555;
|
356 |
+
float: left;
|
357 |
+
font: 400 12px/18px "open sans","helvetica neue",helvetica,arial,sans-serif;
|
358 |
+
list-style: none;
|
359 |
+
padding: 2px 0 2px 32px;
|
360 |
+
text-align: left;
|
361 |
}
|
362 |
|
363 |
.sidebar_links {
|
367 |
}
|
368 |
|
369 |
.sidebar_links ul {
|
370 |
+
margin: 0px 0px 0px 15px;
|
371 |
+
list-style-type: square;
|
372 |
}
|
373 |
|
374 |
.sidebar_links ul li {
|
375 |
+
color: #555;
|
376 |
+
font: 400 12px/18px "open sans","helvetica neue",helvetica,arial,sans-serif;
|
377 |
+
margin: 0 0 4px 0;
|
378 |
+
text-align: left;
|
379 |
}
|
380 |
|
381 |
.key-status {
|
382 |
+
color: #fff;
|
383 |
+
text-align: center;
|
384 |
+
font-weight: 400;
|
385 |
}
|
386 |
|
387 |
.key-description {
|
388 |
+
line-height: 1.6em;
|
389 |
+
margin-top:10px;
|
390 |
}
|
391 |
|
392 |
.key-status.failed {
|
393 |
+
color: #EB5353;
|
394 |
}
|
395 |
|
396 |
.key-status.passed {
|
397 |
+
color: #45a147;
|
398 |
}
|
399 |
|
400 |
.key-status.unknown {
|
401 |
+
color: #9e9e9e;
|
402 |
}
|
403 |
|
404 |
.blink {
|
405 |
+
text-decoration: blink;
|
406 |
+
-webkit-animation-name: blinker;
|
407 |
+
-webkit-animation-duration: 2s;
|
408 |
+
-webkit-animation-iteration-count:infinite;
|
409 |
+
-webkit-animation-timing-function:ease-in-out;
|
410 |
+
-webkit-animation-direction: alternate;
|
411 |
}
|
412 |
|
413 |
@keyframes blinker {
|
414 |
+
from {opacity: 1.0;}
|
415 |
+
to {opacity: 0.0;}
|
416 |
}
|
417 |
|
418 |
i.icon.icon-share_buttons {
|
419 |
+
background-position: 0 0px;
|
420 |
+
width: 16px;
|
421 |
+
height: 16px;
|
422 |
}
|
423 |
|
424 |
i.icon.icon-recommendations {
|
425 |
+
background-position: 0 -16px;
|
426 |
+
width: 16px;
|
427 |
+
height: 16px;
|
428 |
}
|
429 |
|
430 |
i.icon.icon-affiliate {
|
431 |
+
background-position: 0 -160px;
|
432 |
+
width: 16px;
|
433 |
+
height: 16px;
|
434 |
}
|
435 |
|
436 |
i.icon.icon-analytics {
|
437 |
+
background-position: 0 -32px;
|
438 |
+
width: 16px;
|
439 |
+
height: 16px;
|
440 |
}
|
441 |
|
442 |
i.icon.icon-website {
|
443 |
+
background-position: 0 -96px;
|
444 |
+
width: 16px;
|
445 |
+
height: 16px;
|
446 |
}
|
447 |
|
448 |
i.icon {
|
449 |
+
vertical-align: middle;
|
450 |
+
background-image: url(../img/shareaholic-icon-sprite@2x.png);
|
451 |
+
background-position: 0 0;
|
452 |
+
background-repeat: no-repeat;
|
453 |
+
display: inline-block;
|
454 |
+
position: relative;
|
455 |
+
background-size: 34px;
|
456 |
+
width: 16px;
|
457 |
+
height: 16px;
|
458 |
}
|
459 |
|
460 |
|
463 |
// *****************************************************************************
|
464 |
|
465 |
.plugin-value-section-container {
|
466 |
+
margin: 25px auto;
|
467 |
+
width: 650px;
|
468 |
}
|
469 |
|
470 |
.plugin-value-section {
|
471 |
+
margin: 25px auto;
|
472 |
+
height: 170px;
|
473 |
+
width: 650px;
|
474 |
+
font: 400 14px/20px "open sans", "helvetica neue", helvetica, arial, sans-serif;
|
475 |
+
-webkit-transition: all 0.3s ease-in-out;
|
476 |
+
-moz-transition: all 0.3s ease-in-out;
|
477 |
+
-o-transition: all 0.3s ease-in-out;
|
478 |
+
transition: all 0.3s ease-in-out;
|
479 |
}
|
480 |
|
481 |
.plugin-value-section .plugin-value-line {
|
482 |
+
display: block;
|
483 |
+
height: 1px;
|
484 |
+
width: 75%;
|
485 |
+
max-width: 770px;
|
486 |
+
margin: 0 auto;
|
487 |
+
border-top: 4px dashed rgba(160, 163, 166, 0.35);
|
488 |
+
margin: 47px auto -44px;
|
489 |
}
|
490 |
|
491 |
.plugin-value-section .plugin-value {
|
492 |
+
padding-top: 0px;
|
493 |
}
|
494 |
|
495 |
.plugin-value-section .plugin-value li {
|
496 |
+
position: relative;
|
497 |
+
float: left;
|
498 |
+
width: 25%;
|
499 |
+
margin-right: 0;
|
500 |
+
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
501 |
+
opacity: 1;
|
502 |
+
text-align: center;
|
503 |
}
|
504 |
|
505 |
.plugin-value-section .plugin-value li:last-child {
|
506 |
+
border-right: none;
|
507 |
}
|
508 |
|
509 |
.plugin-value-section .plugin-value li p {
|
510 |
+
margin: 0;
|
511 |
+
padding: 1em 0.5em;
|
512 |
+
min-height: 110px;
|
513 |
+
color: rgb(136, 136, 136);
|
514 |
}
|
515 |
|
516 |
.plugin-value-section .plugin-value li a {
|
517 |
+
position: relative;
|
518 |
+
display: block;
|
519 |
+
background: transparent;
|
520 |
+
margin: 0 auto;
|
521 |
+
padding: 0;
|
522 |
}
|
523 |
|
524 |
.plugin-value-section .plugin-value li .icon {
|
525 |
+
display: block;
|
526 |
+
overflow: hidden;
|
527 |
+
height: 80px;
|
528 |
+
width: 80px;
|
529 |
+
line-height: 80px;
|
530 |
+
-webkit-border-radius: 50%;
|
531 |
+
-moz-border-radius: 50%;
|
532 |
+
-ms-border-radius: 50%;
|
533 |
+
-o-border-radius: 50%;
|
534 |
+
border-radius: 50%;
|
535 |
+
color: white;
|
536 |
+
margin: 0 auto 12px;
|
537 |
+
font-size: 34px;
|
538 |
}
|
539 |
|
540 |
.plugin-value-section .plugin-value li .icon.fa-bullhorn {
|
541 |
+
background: #bbea76;
|
542 |
}
|
543 |
|
544 |
.plugin-value-section .plugin-value li .icon.fa-fire {
|
545 |
+
background: #77dd77;
|
546 |
}
|
547 |
|
548 |
.plugin-value-section .plugin-value li .icon.fa-bar-chart-o {
|
549 |
+
background: #5ed5a4;
|
550 |
}
|
551 |
|
552 |
.plugin-value-section .plugin-value li .icon.fa-usd {
|
553 |
+
background: #49c0c0;
|
554 |
}
|
555 |
|
556 |
.plugin-value-section .plugin-value li.acquire .title {
|
557 |
+
color: #AAD56A;
|
558 |
}
|
559 |
|
560 |
.plugin-value-section .plugin-value li.engage .title {
|
561 |
+
color: #77dd77;
|
562 |
}
|
563 |
|
564 |
.plugin-value-section .plugin-value li.learn .title {
|
565 |
+
color: #5ed5a4;
|
566 |
}
|
567 |
|
568 |
.plugin-value-section .plugin-value li.monetize .title {
|
569 |
+
color: #49c0c0;
|
570 |
}
|
571 |
|
572 |
.plugin-value-section .plugin-value li a:hover {
|
573 |
+
-webkit-transition: background 0.2s;
|
574 |
+
-moz-transition: background 0.2s;
|
575 |
+
-o-transition: background 0.2s;
|
576 |
+
transition: background 0.2s;
|
577 |
}
|
578 |
|
579 |
.plugin-value-section .plugin-value li .title {
|
580 |
+
text-transform: none;
|
581 |
+
text-transform: uppercase;
|
582 |
+
font-size: 18px;
|
583 |
+
margin: 0;
|
584 |
+
padding: 0;
|
585 |
+
color: #2c3440;
|
586 |
+
display: block;
|
587 |
+
position: relative;
|
588 |
+
width: 100%;
|
589 |
}
|
590 |
|
591 |
.plugin-value-section.in-viewport {
|
592 |
+
-webkit-transition: all 0.5s ease-in-out;
|
593 |
+
-moz-transition: all 0.5s ease-in-out;
|
594 |
+
-o-transition: all 0.5s ease-in-out;
|
595 |
+
transition: all 0.5s ease-in-out;
|
596 |
+
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
597 |
+
opacity: 1;
|
598 |
+
}
|
assets/css/reveal.css
CHANGED
@@ -1,97 +1,99 @@
|
|
1 |
/* --------------------------------------------------
|
2 |
-
|
3 |
-
|
|
|
4 |
.reveal-modal-bg {
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
|
15 |
/* use super high z-index so that no other WP plugins will override */
|
16 |
.reveal-modal {
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
|
52 |
.reveal-modal-iframe {
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
|
57 |
.reveal-modal-iframe iframe {
|
58 |
-
|
59 |
|
60 |
.reveal-modal.small {
|
61 |
-
|
62 |
-
|
63 |
|
64 |
.reveal-modal.medium {
|
65 |
-
|
66 |
-
|
67 |
|
68 |
.reveal-modal.large {
|
69 |
-
|
70 |
-
|
71 |
|
72 |
.reveal-modal.xlarge {
|
73 |
-
|
74 |
-
|
75 |
|
76 |
.reveal-modal .close-reveal-modal {
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
|
87 |
@media all and (max-width: 520px) {
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
95 |
|
96 |
NOTES
|
97 |
|
@@ -100,10 +102,10 @@
|
|
100 |
Example markup
|
101 |
|
102 |
<div id="myModal" class="reveal-modal">
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
</div>
|
108 |
|
109 |
-
|
1 |
/* --------------------------------------------------
|
2 |
+
Reveal Modals
|
3 |
+
-------------------------------------------------- */
|
4 |
+
|
5 |
.reveal-modal-bg {
|
6 |
+
position: fixed;
|
7 |
+
height: 100%;
|
8 |
+
width: 100%;
|
9 |
+
background: #000;
|
10 |
+
background: rgba(0, 0, 0, 0.8);
|
11 |
+
z-index: 100;
|
12 |
+
display: none;
|
13 |
+
top: 0;
|
14 |
+
left: 0; }
|
15 |
|
16 |
/* use super high z-index so that no other WP plugins will override */
|
17 |
.reveal-modal {
|
18 |
+
background: #fff url(modal-gloss.png) no-repeat -200px -80px;
|
19 |
+
border-radius: 5px;
|
20 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
|
21 |
+
left: 50%;
|
22 |
+
margin-left: -300px;
|
23 |
+
position: fixed;
|
24 |
+
padding: 30px 20px 30px;
|
25 |
+
top: 150px;
|
26 |
+
visibility: hidden;
|
27 |
+
width: 500px;
|
28 |
+
z-index: 1000000; }
|
29 |
+
.reveal-modal form {
|
30 |
+
margin: 0; }
|
31 |
+
.reveal-modal h2 {
|
32 |
+
font: 600 18px/1 "open sans", "helvetica neue", helvetica, arial, sans-serif;
|
33 |
+
margin: 0 0 18px 0; }
|
34 |
+
.reveal-modal p {
|
35 |
+
font: 400 14px/1 "open sans", "helvetica neue", helvetica, arial, sans-serif;
|
36 |
+
margin: 0 0 14px 0; }
|
37 |
+
.reveal-modal p.note {
|
38 |
+
color: #888;
|
39 |
+
font-size: 12px; }
|
40 |
+
.reveal-modal p.signup-tos {
|
41 |
+
font: 400 10px/2 "open sans", "helvetica neue", helvetica, arial, sans-serif; }
|
42 |
+
.reveal-modal input[type="submit"] {
|
43 |
+
margin: 14px 0 0 0; }
|
44 |
+
.reveal-modal .config {
|
45 |
+
margin: 0 0 14px 0; }
|
46 |
+
.reveal-modal .config label {
|
47 |
+
display: block;
|
48 |
+
font: 600 12px/1 "open sans", "helvetica neue", helvetica, arial, sans-serif;
|
49 |
+
margin: 0 0 4px 0; }
|
50 |
+
.reveal-modal .config input[type="checkbox"] + label {
|
51 |
+
display: inline-block; }
|
52 |
|
53 |
.reveal-modal-iframe {
|
54 |
+
background: #fff;
|
55 |
+
border-radius: 5px;
|
56 |
+
padding: 0; }
|
57 |
|
58 |
.reveal-modal-iframe iframe {
|
59 |
+
border: 0; }
|
60 |
|
61 |
.reveal-modal.small {
|
62 |
+
width: 200px;
|
63 |
+
margin-left: -140px; }
|
64 |
|
65 |
.reveal-modal.medium {
|
66 |
+
width: 400px;
|
67 |
+
margin-left: -240px; }
|
68 |
|
69 |
.reveal-modal.large {
|
70 |
+
width: 600px;
|
71 |
+
margin-left: -340px; }
|
72 |
|
73 |
.reveal-modal.xlarge {
|
74 |
+
width: 800px;
|
75 |
+
margin-left: -440px; }
|
76 |
|
77 |
.reveal-modal .close-reveal-modal {
|
78 |
+
font-size: 22px;
|
79 |
+
line-height: .5;
|
80 |
+
position: absolute;
|
81 |
+
top: 15px;
|
82 |
+
right: 15px;
|
83 |
+
color: #aaa;
|
84 |
+
text-shadow: 0 -1px 1px rbga(0, 0, 0, 0.6);
|
85 |
+
font-weight: bold;
|
86 |
+
cursor: pointer; }
|
87 |
|
88 |
@media all and (max-width: 520px) {
|
89 |
+
.reveal-modal {
|
90 |
+
left: 50%;
|
91 |
+
margin-left: -160px;
|
92 |
+
padding: 30px 10px 0 10px;
|
93 |
+
top: 30px;
|
94 |
+
width: 300px; } }
|
95 |
+
|
96 |
+
/*
|
97 |
|
98 |
NOTES
|
99 |
|
102 |
Example markup
|
103 |
|
104 |
<div id="myModal" class="reveal-modal">
|
105 |
+
<h2>Awesome. I have it.</h2>
|
106 |
+
<p class="lead">Your couch. I it's mine.</p>
|
107 |
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ultrices aliquet placerat. Duis pulvinar orci et nisi euismod vitae tempus lorem consectetur. Duis at magna quis turpis mattis venenatis eget id diam. </p>
|
108 |
+
<a class="close-reveal-modal">×</a>
|
109 |
</div>
|
110 |
|
111 |
+
*/
|
assets/js/main.js
CHANGED
@@ -1,214 +1,249 @@
|
|
1 |
(function($) {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
53 |
<span id='shortcode_description'></span> \
|
54 |
<textarea id='shortcode' name='widget_div' onclick='select();' readonly='readonly'></textarea> \
|
55 |
</div>"
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
(function($) {
|
2 |
+
window.Shareaholic = window.Shareaholic || {};
|
3 |
+
window.shareaholic_debug = true;
|
4 |
+
|
5 |
+
Shareaholic.bind_button_clicks = function (click_object, off) {
|
6 |
+
if (off) {
|
7 |
+
$( click_object.selector ).off( 'click.app_settings' );
|
8 |
+
}
|
9 |
+
|
10 |
+
$( click_object.selector ).off( 'click.app_settings' ).on(
|
11 |
+
'click.app_settings',
|
12 |
+
function (e) {
|
13 |
+
button = this;
|
14 |
+
e.preventDefault();
|
15 |
+
url = click_object.url( this );
|
16 |
+
if (click_object.selector == '#general_settings' || click_object.selector == '#affiliate_settings') {
|
17 |
+
window.open( url );
|
18 |
+
return false;
|
19 |
+
} else {
|
20 |
+
$frame = $( '<iframe>', { src:url } ).appendTo( '#iframe_container' );
|
21 |
+
if (click_object.callback) {
|
22 |
+
click_object.callback( this );
|
23 |
+
}
|
24 |
+
$( '#editing_modal' ).reveal(
|
25 |
+
{
|
26 |
+
topPosition:50,
|
27 |
+
close:function () {
|
28 |
+
if (click_object.close) {
|
29 |
+
click_object.close( button );
|
30 |
+
}
|
31 |
+
$frame.remove();
|
32 |
+
}
|
33 |
+
}
|
34 |
+
);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
);
|
38 |
+
}
|
39 |
+
|
40 |
+
Shareaholic.click_objects = {
|
41 |
+
'app_settings': {
|
42 |
+
selector: '#app_settings button',
|
43 |
+
url: function(button) {
|
44 |
+
id = $( button ).data( 'location_id' );
|
45 |
+
app = $( button ).data( 'app' )
|
46 |
+
url = first_part_of_url + $( button ).data( 'href' ) + '?embedded=true&'
|
47 |
+
+ 'verification_key=' + verification_key;
|
48 |
+
url = url.replace( /{{id}}/, id );
|
49 |
+
return url;
|
50 |
+
},
|
51 |
+
callback: function(button) {
|
52 |
+
$modal = $( '.reveal-modal' );
|
53 |
+
$modal.addClass( 'has-shortcode' )
|
54 |
+
id = $( button ).data( 'location_id' );
|
55 |
+
app = $( button ).data( 'app' );
|
56 |
+
text = 'You can also use this shortcode to place this {{app}} App anywhere.';
|
57 |
+
html = "<div id='shortcode_container'> \
|
58 |
<span id='shortcode_description'></span> \
|
59 |
<textarea id='shortcode' name='widget_div' onclick='select();' readonly='readonly'></textarea> \
|
60 |
</div>"
|
61 |
+
$( html ).appendTo( $modal );
|
62 |
+
$( '#shortcode_description' ).text( text.replace( /{{app}}/, Shareaholic.titlecase( app ) ) );
|
63 |
+
$( '#shortcode' ).text( '[shareaholic app="' + app + '" id="' + id + '"]' );
|
64 |
+
},
|
65 |
+
close: function(button) {
|
66 |
+
$( '#shortcode_container' ).remove();
|
67 |
+
$( '.reveal-modal' ).removeClass( 'has-shortcode' );
|
68 |
+
}
|
69 |
+
},
|
70 |
+
|
71 |
+
'affiliate_settings': {
|
72 |
+
selector: '#affiliate_settings',
|
73 |
+
url: function(button) {
|
74 |
+
return first_part_of_url + 'websites/edit/'
|
75 |
+
+ '?verification_key=' + verification_key;
|
76 |
+
}
|
77 |
+
},
|
78 |
+
|
79 |
+
'general_settings': {
|
80 |
+
selector: '#general_settings',
|
81 |
+
url: function(button) {
|
82 |
+
return first_part_of_url + 'websites/edit/'
|
83 |
+
+ '?verification_key=' + verification_key;
|
84 |
+
}
|
85 |
+
},
|
86 |
+
'app_wide_settings': {
|
87 |
+
selector: '.app_wide_settings',
|
88 |
+
url: function(button) {
|
89 |
+
url = first_part_of_url + $( button ).data( 'href' ) + '?embedded=true&'
|
90 |
+
+ 'verification_key=' + verification_key;
|
91 |
+
return url
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
Shareaholic.Utils.PostMessage.receive(
|
97 |
+
'settings_saved',
|
98 |
+
{
|
99 |
+
success: function(data) {
|
100 |
+
$( 'input[type="submit"]' ).click();
|
101 |
+
},
|
102 |
+
failure: function(data) {
|
103 |
+
console.log( data );
|
104 |
+
}
|
105 |
+
}
|
106 |
+
);
|
107 |
+
|
108 |
+
Shareaholic.titlecase = function(string) {
|
109 |
+
return string.charAt( 0 ).toUpperCase() + string.replace(
|
110 |
+
/_[a-z]/g,
|
111 |
+
function(match) {
|
112 |
+
return match.toUpperCase().replace( /_/, ' ' );
|
113 |
+
}
|
114 |
+
).slice( 1 );
|
115 |
+
}
|
116 |
+
|
117 |
+
Shareaholic.disable_buttons = function() {
|
118 |
+
$( '#app_settings button' ).each(
|
119 |
+
function() {
|
120 |
+
if ( ! $( this ).data( 'location_id' ) && ! this.id == 'app_wide_settings') {
|
121 |
+
$( this ).attr( 'disabled', 'disabled' );
|
122 |
+
} else {
|
123 |
+
$( this ).removeAttr( 'disabled' );
|
124 |
+
}
|
125 |
+
}
|
126 |
+
);
|
127 |
+
}
|
128 |
+
|
129 |
+
Shareaholic.create_new_location = function(_this) {
|
130 |
+
button = $( _this ).siblings( 'button' )
|
131 |
+
app = button.data( 'app' )
|
132 |
+
location_id = button.data( 'location_id' )
|
133 |
+
if ( ! ! location_id) {
|
134 |
+
return;
|
135 |
+
}
|
136 |
+
|
137 |
+
data = {}
|
138 |
+
data['configuration_' + app + '_location'] = {
|
139 |
+
name: /.*\[(.*)\]/.exec( $( _this ).attr( 'name' ) )[1]
|
140 |
+
}
|
141 |
+
|
142 |
+
$.ajax(
|
143 |
+
{
|
144 |
+
url: first_part_of_url + app + '/locations.json',
|
145 |
+
type: 'POST',
|
146 |
+
data: data,
|
147 |
+
success: function(data, status, jqxhr) {
|
148 |
+
data['action'] = 'shareaholic_add_location';
|
149 |
+
data['nonce'] = window.shareaholic_add_location_nonce;
|
150 |
+
button.data( 'location_id', data['location']['id'] );
|
151 |
+
Shareaholic.disable_buttons();
|
152 |
+
Shareaholic.submit_to_admin(
|
153 |
+
data,
|
154 |
+
function(stuff) {
|
155 |
+
console.log( stuff );
|
156 |
+
}
|
157 |
+
);
|
158 |
+
},
|
159 |
+
failure: function(things) {
|
160 |
+
console.log( things );
|
161 |
+
},
|
162 |
+
xhrFields: {
|
163 |
+
withCredentials: true
|
164 |
+
}
|
165 |
+
}
|
166 |
+
);
|
167 |
+
}
|
168 |
+
|
169 |
+
Shareaholic.submit_to_admin = function(data, callback) {
|
170 |
+
$.ajax(
|
171 |
+
{
|
172 |
+
url: ajaxurl,
|
173 |
+
type: 'POST',
|
174 |
+
data: data,
|
175 |
+
success: function(response) {
|
176 |
+
try {
|
177 |
+
response = JSON.parse( response );
|
178 |
+
} catch (e) {
|
179 |
+
response = {};
|
180 |
+
}
|
181 |
+
callback( response );
|
182 |
+
},
|
183 |
+
failure: function(response) {
|
184 |
+
try {
|
185 |
+
response = JSON.parse( response );
|
186 |
+
} catch (e) {
|
187 |
+
response = {};
|
188 |
+
}
|
189 |
+
callback( response );
|
190 |
+
}
|
191 |
+
}
|
192 |
+
)
|
193 |
+
}
|
194 |
+
|
195 |
+
$( document ).ready(
|
196 |
+
function() {
|
197 |
+
|
198 |
+
Shareaholic.disable_buttons();
|
199 |
+
|
200 |
+
Shareaholic.bind_button_clicks( Shareaholic.click_objects['app_settings'] );
|
201 |
+
Shareaholic.bind_button_clicks( Shareaholic.click_objects['affiliate_settings'] );
|
202 |
+
Shareaholic.bind_button_clicks( Shareaholic.click_objects['general_settings'] );
|
203 |
+
Shareaholic.bind_button_clicks( Shareaholic.click_objects['app_wide_settings'] );
|
204 |
+
if (Shareaholic.click_objects['unverified_general_settings']) {
|
205 |
+
Shareaholic.bind_button_clicks( Shareaholic.click_objects['unverified_general_settings'], true );
|
206 |
+
}
|
207 |
+
|
208 |
+
$( '#terms_of_service_modal' ).reveal(
|
209 |
+
{
|
210 |
+
closeonbackgroundclick: false,
|
211 |
+
closeonescape: false,
|
212 |
+
topPosition: 50
|
213 |
+
}
|
214 |
+
);
|
215 |
+
|
216 |
+
$( '#failed_to_create_api_key' ).reveal(
|
217 |
+
{
|
218 |
+
closeonbackgroundclick: false,
|
219 |
+
closeonescape: false,
|
220 |
+
topPosition: 50
|
221 |
+
}
|
222 |
+
);
|
223 |
+
|
224 |
+
$( '#get_started' ).on(
|
225 |
+
'click',
|
226 |
+
function(e) {
|
227 |
+
e.preventDefault();
|
228 |
+
data = {action: 'shareaholic_accept_terms_of_service'};
|
229 |
+
// $('#terms_of_service_modal').trigger('reveal:close');
|
230 |
+
Shareaholic.submit_to_admin(
|
231 |
+
data,
|
232 |
+
function(){
|
233 |
+
location.reload();
|
234 |
+
}
|
235 |
+
);
|
236 |
+
}
|
237 |
+
)
|
238 |
+
|
239 |
+
$( 'form input[type=checkbox]' ).on(
|
240 |
+
'click',
|
241 |
+
function() {
|
242 |
+
if ($( this ).is( ':checked' ) && ! $( this ).data( 'location_id' )) {
|
243 |
+
Shareaholic.create_new_location( this );
|
244 |
+
}
|
245 |
+
}
|
246 |
+
);
|
247 |
+
}
|
248 |
+
);
|
249 |
+
})( sQuery );
|
content_manager.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* File for the ShareaholicContentManager class.
|
4 |
-
*
|
5 |
-
* @package shareaholic
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* An interface to the Shareaholic Content Manager API's
|
10 |
-
*
|
11 |
-
* @package shareaholic
|
12 |
-
*/
|
13 |
-
class ShareaholicContentManager {
|
14 |
-
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl.php
CHANGED
@@ -18,10 +18,10 @@ class ShareaholicCurl {
|
|
18 |
*
|
19 |
* Performs a POST request
|
20 |
*
|
21 |
-
* @param string $url the url you are POSTing to
|
22 |
-
* @param array $data an associative array of the data you are posting
|
23 |
-
* @param string $data_type defaults to nothing, you can pass in 'json'
|
24 |
-
* @param bool $ignore_error whether to log a networking error
|
25 |
*
|
26 |
* @return array the returned data json decoded
|
27 |
*/
|
@@ -33,10 +33,10 @@ class ShareaholicCurl {
|
|
33 |
*
|
34 |
* Performs a GET request
|
35 |
*
|
36 |
-
* @param string $url the url you are GETing to
|
37 |
-
* @param array $data an associative array of the data you are posting
|
38 |
-
* @param string $data_type defaults to nothing, you can pass in 'json'
|
39 |
-
* @param bool $ignore_error whether to log a networking error
|
40 |
*
|
41 |
* @return array the returned data json decoded
|
42 |
*/
|
@@ -50,11 +50,11 @@ class ShareaholicCurl {
|
|
50 |
* various PHP eccenctricities.
|
51 |
*
|
52 |
* @param string $url
|
53 |
-
* @param array $data an associative array of the data
|
54 |
-
* @param string $data_type either an empty string or 'json'
|
55 |
-
* @param bool $ignore_error whether to log a networking error
|
56 |
-
* @param string $method the HTTP verb to be used
|
57 |
-
* @param int $timeout timeout in seconds
|
58 |
*
|
59 |
* @return mixed the returned data json decoded or false
|
60 |
*/
|
@@ -131,10 +131,10 @@ class ShareaholicCurl {
|
|
131 |
*
|
132 |
* Performs a request using cURL
|
133 |
*
|
134 |
-
* @param string $url the url you are GETing to
|
135 |
-
* @param array $data an associative array of the data you are posting
|
136 |
-
* @param string $data_type either an empty string or 'json'
|
137 |
-
* @param string $method the HTTP verb to be used
|
138 |
*
|
139 |
* @return array the returned data json decoded
|
140 |
*/
|
@@ -251,7 +251,7 @@ class ShareaholicCurl {
|
|
251 |
*
|
252 |
* If it exists, remove it and return the cleaned up string
|
253 |
*
|
254 |
-
* @param {String} $str the string to strip BOM
|
255 |
* @return {String} the stripped out string if BOM exists
|
256 |
*/
|
257 |
private static function strip_utf8_bom( $str ) {
|
18 |
*
|
19 |
* Performs a POST request
|
20 |
*
|
21 |
+
* @param string $url the url you are POSTing to.
|
22 |
+
* @param array $data an associative array of the data you are posting.
|
23 |
+
* @param string $data_type defaults to nothing, you can pass in 'json'.
|
24 |
+
* @param bool $ignore_error whether to log a networking error.
|
25 |
*
|
26 |
* @return array the returned data json decoded
|
27 |
*/
|
33 |
*
|
34 |
* Performs a GET request
|
35 |
*
|
36 |
+
* @param string $url the url you are GETing to.
|
37 |
+
* @param array $data an associative array of the data you are posting.
|
38 |
+
* @param string $data_type defaults to nothing, you can pass in 'json'.
|
39 |
+
* @param bool $ignore_error whether to log a networking error.
|
40 |
*
|
41 |
* @return array the returned data json decoded
|
42 |
*/
|
50 |
* various PHP eccenctricities.
|
51 |
*
|
52 |
* @param string $url
|
53 |
+
* @param array $data an associative array of the data.
|
54 |
+
* @param string $data_type either an empty string or 'json'.
|
55 |
+
* @param bool $ignore_error whether to log a networking error.
|
56 |
+
* @param string $method the HTTP verb to be used.
|
57 |
+
* @param int $timeout timeout in seconds.
|
58 |
*
|
59 |
* @return mixed the returned data json decoded or false
|
60 |
*/
|
131 |
*
|
132 |
* Performs a request using cURL
|
133 |
*
|
134 |
+
* @param string $url the url you are GETing to.
|
135 |
+
* @param array $data an associative array of the data you are posting.
|
136 |
+
* @param string $data_type either an empty string or 'json'.
|
137 |
+
* @param string $method the HTTP verb to be used.
|
138 |
*
|
139 |
* @return array the returned data json decoded
|
140 |
*/
|
251 |
*
|
252 |
* If it exists, remove it and return the cleaned up string
|
253 |
*
|
254 |
+
* @param {String} $str the string to strip BOM.
|
255 |
* @return {String} the stripped out string if BOM exists
|
256 |
*/
|
257 |
private static function strip_utf8_bom( $str ) {
|
lib/plugin-deactivation-survey/deactivate-feedback-form.css
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wp-admin .remodal {
|
2 |
+
margin-top: 20px;
|
3 |
+
}
|
4 |
+
|
5 |
+
.shareaholic-deactivate-dialog {
|
6 |
+
text-align: left;
|
7 |
+
width: auto;
|
8 |
+
}
|
9 |
+
|
10 |
+
.shareaholic-deactivate-dialog {
|
11 |
+
width: auto !important;
|
12 |
+
}
|
13 |
+
|
14 |
+
.shareaholic-deactivate-dialog input[name="comments"] {
|
15 |
+
width: 380px;
|
16 |
+
}
|
17 |
+
|
18 |
+
.shareaholic-deactivate-header {
|
19 |
+
background-size: contain;
|
20 |
+
background-repeat: no-repeat;
|
21 |
+
position: absolute;
|
22 |
+
top: 0px;
|
23 |
+
left: 0px;
|
24 |
+
width: 100%;
|
25 |
+
align-items: center;
|
26 |
+
max-height: 65px;
|
27 |
+
box-shadow: 0 0 8px rgba(0,0,0,.1);
|
28 |
+
-webkit-box-shadow: 0 0 8px rgba(0,0,0,.1);
|
29 |
+
}
|
30 |
+
|
31 |
+
.shareaholic-review-notice-text {
|
32 |
+
background: rgba(255, 255, 255, 0.9);
|
33 |
+
text-shadow: #fff 0px 0px 10px;
|
34 |
+
margin-right: 8em !important;
|
35 |
+
}
|
36 |
+
|
37 |
+
.shareaholic-deactivate-header h2 {
|
38 |
+
font-size: 15px;
|
39 |
+
font-weight: 700;
|
40 |
+
line-height: 1.4;
|
41 |
+
color: #495157;
|
42 |
+
text-transform: uppercase;
|
43 |
+
margin-left: 65px;
|
44 |
+
}
|
45 |
+
|
46 |
+
.shareaholic-deactivate-body {
|
47 |
+
margin-top: 50px;
|
48 |
+
}
|
49 |
+
|
50 |
+
.shareaholic-deactivate-body-foreword {
|
51 |
+
font-size: 15px;
|
52 |
+
font-weight: 700;
|
53 |
+
line-height: 1.6em;
|
54 |
+
color: #495157;
|
55 |
+
margin-bottom: 1.6em;
|
56 |
+
}
|
57 |
+
|
58 |
+
.shareaholic-deactivate-text-area {
|
59 |
+
text-align: left;
|
60 |
+
vertical-align: middle;
|
61 |
+
transition-property: all;
|
62 |
+
transition-duration: 0.15s;
|
63 |
+
transition-timing-function: ease-out;
|
64 |
+
transition-delay: 0s;
|
65 |
+
}
|
66 |
+
|
67 |
+
.shareaholic-deactivate-input, .shareaholic-deactivate-input[type], .shareaholic-deactivate-text-area {
|
68 |
+
font-size: 12px;
|
69 |
+
border-radius: 3px;
|
70 |
+
border: 1px solid #cbd6e2;
|
71 |
+
background-color: #f5f8fa;
|
72 |
+
margin-top: 1.2em;
|
73 |
+
padding: 9px 10px;
|
74 |
+
width: 100%;
|
75 |
+
}
|
76 |
+
|
77 |
+
.shareaholic-deactivate-help {
|
78 |
+
font-size: 0.9em;
|
79 |
+
color: #71767c;
|
80 |
+
margin: 0.6em 0 2em 0;
|
81 |
+
}
|
82 |
+
|
83 |
+
.shareaholic-deactivate-reasons li {
|
84 |
+
margin: 1em 0 1.2em 0;
|
85 |
+
color: #33475b;
|
86 |
+
}
|
87 |
+
|
88 |
+
.shareaholic-deactivate-contact {
|
89 |
+
font-weight: 700;
|
90 |
+
line-height: 1.6em;
|
91 |
+
margin-top: 2em;
|
92 |
+
}
|
93 |
+
|
94 |
+
.shareaholic-deactivate-divider {
|
95 |
+
border-top: 1px #ddd solid;
|
96 |
+
margin: 2.6em -30px 20px -30px;
|
97 |
+
}
|
98 |
+
|
99 |
+
.shareaholic-deactivate-dialog-footer {
|
100 |
+
text-align: right;
|
101 |
+
padding: 0 0 20px 0;
|
102 |
+
}
|
lib/plugin-deactivation-survey/deactivate-feedback-form.js
ADDED
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Displays a Feedback Form when a user clicks on the "Deactivate" link on the plugin settings page.
|
3 |
+
*
|
4 |
+
* @package shareaholic
|
5 |
+
*/
|
6 |
+
|
7 |
+
(function($) {
|
8 |
+
|
9 |
+
if ( ! window.shareaholic) {
|
10 |
+
window.shareaholic = {};
|
11 |
+
}
|
12 |
+
|
13 |
+
if (shareaholic.DeactivateFeedbackForm) {
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
|
17 |
+
function decodeEntities(encodedString) {
|
18 |
+
var textArea = document.createElement( 'textarea' );
|
19 |
+
textArea.innerHTML = encodedString;
|
20 |
+
return textArea.value;
|
21 |
+
}
|
22 |
+
|
23 |
+
shareaholic.DeactivateFeedbackForm = function(plugin)
|
24 |
+
{
|
25 |
+
var self = this;
|
26 |
+
this.plugin = plugin;
|
27 |
+
|
28 |
+
// Dialog HTML.
|
29 |
+
var element = $(
|
30 |
+
'\
|
31 |
+
<div id="shareaholic-deactivate-dialog" class="shareaholic-deactivate-dialog" data-remodal-id="' + plugin.basename + '">\
|
32 |
+
<div class="shareaholic-deactivate-header" style="background-image: url(' + plugin.logo + '); background-color: ' + plugin.bgcolor + ';"><div class="shareaholic-deactivate-text"><h2>' + plugin.translations.quick_feedback + '</h2></div></div>\
|
33 |
+
<div class="shareaholic-deactivate-body">\
|
34 |
+
<form>\
|
35 |
+
<input type="hidden" name="plugin"/>\
|
36 |
+
<div class="shareaholic-deactivate-body-foreword">\
|
37 |
+
' + plugin.translations.foreword + '\
|
38 |
+
</div>\
|
39 |
+
<ul class="shareaholic-deactivate-reasons"></ul>\
|
40 |
+
<div style="display:none;" id="shareaholic-deactivate-comment-area">\
|
41 |
+
<textarea class="shareaholic-deactivate-text-area" name="comment" rows="3" id="shareaholic-deactivate-comment" placeholder="' + plugin.translations.please_tell_us + '"/></textarea>\
|
42 |
+
<p class="shareaholic-deactivate-help">' + plugin.translations.ask_for_support + '</p>\
|
43 |
+
</div>\
|
44 |
+
<div class="shareaholic-deactivate-contact">\
|
45 |
+
' + plugin.translations.email_request + '\
|
46 |
+
</div>\
|
47 |
+
<input type="email" name="email" class="shareaholic-deactivate-input" value="' + plugin.email + '">\
|
48 |
+
<div class="shareaholic-deactivate-divider"></div>\
|
49 |
+
<div class="shareaholic-deactivate-dialog-footer">\
|
50 |
+
<span class="spinner" style="float: none;"></span> \
|
51 |
+
<input type="submit" class="button confirm button-secondary" id="shareaholic-deactivate-submit" value="' + plugin.translations.skip_and_deactivate + '"/>\
|
52 |
+
<button data-remodal-action="cancel" class="button button-secondary">' + plugin.translations.cancel + '</button>\
|
53 |
+
</div>\
|
54 |
+
</form>\
|
55 |
+
</div>\
|
56 |
+
</div>\
|
57 |
+
'
|
58 |
+
)[0];
|
59 |
+
this.element = element;
|
60 |
+
|
61 |
+
$( element ).find( "input[name='plugin']" ).val( JSON.stringify( plugin ) );
|
62 |
+
|
63 |
+
$( element ).on(
|
64 |
+
"click",
|
65 |
+
"input[name='reason']",
|
66 |
+
function(event) {
|
67 |
+
var submit_input = $( element ).find( "input[type='submit']" );
|
68 |
+
var comment_textarea = $( element ).find( '#shareaholic-deactivate-comment-area' );
|
69 |
+
if (plugin.reasons_needing_comment.indexOf( event.target.value ) > -1) {
|
70 |
+
comment_textarea.appendTo( $( event.target ).parent().parent() );
|
71 |
+
comment_textarea.show();
|
72 |
+
} else {
|
73 |
+
comment_textarea.hide();
|
74 |
+
}
|
75 |
+
submit_input.val( decodeEntities( plugin.translations.submit_and_deactivate ) );
|
76 |
+
self.maybeDisableSubmit();
|
77 |
+
}
|
78 |
+
);
|
79 |
+
|
80 |
+
$( element ).find( 'textarea#shareaholic-deactivate-comment' ).keyup(
|
81 |
+
function(){
|
82 |
+
self.maybeDisableSubmit();
|
83 |
+
}
|
84 |
+
);
|
85 |
+
|
86 |
+
$( element ).find( "form" ).on(
|
87 |
+
"submit",
|
88 |
+
function(event) {
|
89 |
+
self.onSubmit( event );
|
90 |
+
}
|
91 |
+
);
|
92 |
+
|
93 |
+
// Reasons list.
|
94 |
+
var ul = $( element ).find( "ul.shareaholic-deactivate-reasons" );
|
95 |
+
for (var key in plugin.reasons) {
|
96 |
+
var li = $( "<li><label><input type='radio' name='reason'/> <span></span></label></li>" );
|
97 |
+
|
98 |
+
$( li ).find( "input" ).val( key );
|
99 |
+
$( li ).find( "span" ).html( plugin.reasons[key] );
|
100 |
+
|
101 |
+
$( ul ).append( li );
|
102 |
+
}
|
103 |
+
|
104 |
+
// Listen for deactivate.
|
105 |
+
// Use either the "data-plugin" attribute (introduced in WP 4.5) or the "id" attribute (removed in WP 4.5)
|
106 |
+
// to identify our plugin's deactivation link.
|
107 |
+
var click_listen_selector = "#the-list [data-plugin='" + plugin.basename + "'] .deactivate>a";
|
108 |
+
if ( typeof plugin.title_slugged !== 'undefined') {
|
109 |
+
click_listen_selector += ", #" + plugin.title_slugged + " .deactivate>a";
|
110 |
+
}
|
111 |
+
$( click_listen_selector ).on(
|
112 |
+
"click",
|
113 |
+
function(event) {
|
114 |
+
self.onDeactivateClicked( event );
|
115 |
+
}
|
116 |
+
);
|
117 |
+
}
|
118 |
+
|
119 |
+
shareaholic.DeactivateFeedbackForm.prototype.maybeDisableSubmit = function (){
|
120 |
+
var submit_input = $( "#shareaholic-deactivate-submit" );
|
121 |
+
var comment_textarea = $( 'textarea#shareaholic-deactivate-comment' );
|
122 |
+
var reason_value = $( 'input[name="reason"]:checked' ).val();
|
123 |
+
if (this.plugin.reasons_needing_comment.indexOf( reason_value ) > -1
|
124 |
+
&& comment_textarea.val().replace( /\s/g, '' ) === '') {
|
125 |
+
submit_input.prop( 'disabled',true );
|
126 |
+
submit_input.prop( 'title',this.plugin.translations.please_tell_us );
|
127 |
+
} else {
|
128 |
+
submit_input.prop( 'disabled',false );
|
129 |
+
submit_input.prop( 'title','' );
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
shareaholic.DeactivateFeedbackForm.prototype.onDeactivateClicked = function(event)
|
134 |
+
{
|
135 |
+
this.deactivateURL = event.target.href;
|
136 |
+
|
137 |
+
if ( ! this.dialog) {
|
138 |
+
this.dialog = $( this.element ).remodal();
|
139 |
+
}
|
140 |
+
this.dialog.open();
|
141 |
+
event.preventDefault();
|
142 |
+
}
|
143 |
+
|
144 |
+
shareaholic.DeactivateFeedbackForm.prototype.onSubmit = function(event)
|
145 |
+
{
|
146 |
+
var element = this.element;
|
147 |
+
var self = this;
|
148 |
+
var data = this.plugin.send;
|
149 |
+
data.survey_response = {
|
150 |
+
contact:{
|
151 |
+
email: $( element ).find( "input[name='email']" ).val().trim().toLowerCase(),
|
152 |
+
role: this.plugin.role || null
|
153 |
+
},
|
154 |
+
type:'uninstall',
|
155 |
+
data:{
|
156 |
+
reason_id: $( element ).find( "input[name='reason']:checked" ).val(),
|
157 |
+
reason_comment: $( element ).find( "textarea[name='comment']" ).val()
|
158 |
+
}
|
159 |
+
};
|
160 |
+
|
161 |
+
$( element ).find( "button, input[type='submit']" ).prop( "disabled", true );
|
162 |
+
$( element ).find( "input[type='submit']" ).val( decodeEntities( this.plugin.translations.please_wait ) );
|
163 |
+
$( element ).find( "button, input[type='submit']" ).siblings( '.spinner' ).addClass( 'is-active' );
|
164 |
+
|
165 |
+
if ($( element ).find( "input[name='reason']:checked" ).length) {
|
166 |
+
$.ajax(
|
167 |
+
{
|
168 |
+
type: "POST",
|
169 |
+
url: "https://" + this.plugin.api_server + "/api/plugin_surveys",
|
170 |
+
data: JSON.stringify( data ),
|
171 |
+
contentType: 'application/json',
|
172 |
+
dataType: 'json',
|
173 |
+
success: function(response, textStatus) {
|
174 |
+
window.location.href = self.deactivateURL;
|
175 |
+
},
|
176 |
+
error: function(response, textStatus, errorThrown) {
|
177 |
+
window.location.href = self.deactivateURL;
|
178 |
+
},
|
179 |
+
}
|
180 |
+
);
|
181 |
+
} else {
|
182 |
+
window.location.href = self.deactivateURL;
|
183 |
+
}
|
184 |
+
event.preventDefault();
|
185 |
+
return false;
|
186 |
+
}
|
187 |
+
|
188 |
+
$( document ).ready(
|
189 |
+
function() {
|
190 |
+
var plugins = shareaholic_deactivate_feedback_form_plugins.length;
|
191 |
+
for (var i = 0; i < plugins; i++) {
|
192 |
+
var plugin = shareaholic_deactivate_feedback_form_plugins[i];
|
193 |
+
new shareaholic.DeactivateFeedbackForm( plugin );
|
194 |
+
}
|
195 |
+
|
196 |
+
}
|
197 |
+
);
|
198 |
+
|
199 |
+
})( jQuery );
|
lib/plugin-deactivation-survey/deactivate-feedback-form.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Displays a Feedback Form when a user clicks on the "Deactivate" link on the plugin settings page.
|
4 |
+
*
|
5 |
+
* @package shareaholic
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! is_admin() ) {
|
9 |
+
return;
|
10 |
+
}
|
11 |
+
|
12 |
+
global $pagenow;
|
13 |
+
|
14 |
+
if ( 'plugins.php' !== $pagenow ) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
+
if ( ! function_exists( 'shareaholic_deactivate_feedback' ) ) {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Handles adding required code for the feedback form
|
22 |
+
*/
|
23 |
+
function shareaholic_deactivate_feedback() {
|
24 |
+
// Plugins.
|
25 |
+
/**
|
26 |
+
* Each plugin adds an array to this filtered value in order to register itself. Please see the callback
|
27 |
+
* to see the expected structure of the array.
|
28 |
+
*/
|
29 |
+
$plugins = apply_filters( 'shareaholic_deactivate_feedback_form_plugins', array() );
|
30 |
+
|
31 |
+
if ( ! $plugins ) {
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( is_array( $plugins ) && end( $plugins )->script_cache_ver ) {
|
36 |
+
$script_cache_ver = end( $plugins )->script_cache_ver;
|
37 |
+
} else {
|
38 |
+
$script_cache_ver = '1.1.1';
|
39 |
+
}
|
40 |
+
|
41 |
+
// Enqueue scripts.
|
42 |
+
wp_enqueue_script( 'remodal', plugin_dir_url( __FILE__ ) . 'remodal.min.js', array(), $script_cache_ver, false );
|
43 |
+
wp_enqueue_style( 'remodal', plugin_dir_url( __FILE__ ) . 'remodal.css', array(), $script_cache_ver );
|
44 |
+
wp_enqueue_style( 'remodal-default-theme', plugin_dir_url( __FILE__ ) . 'remodal-default-theme.css', array(), $script_cache_ver );
|
45 |
+
|
46 |
+
wp_enqueue_script(
|
47 |
+
'shareaholic-deactivate-feedback-form',
|
48 |
+
plugin_dir_url( __FILE__ ) . 'deactivate-feedback-form.js',
|
49 |
+
array(),
|
50 |
+
$script_cache_ver,
|
51 |
+
false
|
52 |
+
);
|
53 |
+
wp_enqueue_style(
|
54 |
+
'shareaholic-deactivate-feedback-form',
|
55 |
+
plugin_dir_url( __FILE__ ) . 'deactivate-feedback-form.css',
|
56 |
+
array(),
|
57 |
+
$script_cache_ver
|
58 |
+
);
|
59 |
+
|
60 |
+
$current_user = wp_get_current_user();
|
61 |
+
if ( $current_user instanceof WP_User && is_user_logged_in() && $current_user->ID ) {
|
62 |
+
$email = $current_user->user_email;
|
63 |
+
if ( $current_user->roles[0] ) {
|
64 |
+
$role = $current_user->roles[0];
|
65 |
+
}
|
66 |
+
} else {
|
67 |
+
$email = '';
|
68 |
+
$role = '';
|
69 |
+
}
|
70 |
+
|
71 |
+
foreach ( $plugins as $plugin ) {
|
72 |
+
$plugin->email = $email;
|
73 |
+
$plugin->role = $role;
|
74 |
+
}
|
75 |
+
|
76 |
+
// Send plugin data.
|
77 |
+
wp_localize_script(
|
78 |
+
'shareaholic-deactivate-feedback-form',
|
79 |
+
'shareaholic_deactivate_feedback_form_plugins',
|
80 |
+
$plugins
|
81 |
+
);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
add_action( 'admin_enqueue_scripts', 'shareaholic_deactivate_feedback' );
|
lib/plugin-deactivation-survey/remodal-default-theme.css
ADDED
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Remodal - v1.1.1
|
3 |
+
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
4 |
+
* http://vodkabears.github.io/remodal/
|
5 |
+
*
|
6 |
+
* Made by Ilya Makarov
|
7 |
+
* Under MIT License
|
8 |
+
*/
|
9 |
+
|
10 |
+
/* ==========================================================================
|
11 |
+
Remodal's default mobile first theme
|
12 |
+
========================================================================== */
|
13 |
+
|
14 |
+
/* Default theme styles of the overlay */
|
15 |
+
|
16 |
+
.remodal-overlay {
|
17 |
+
background: rgba(43, 46, 56, 0.7);
|
18 |
+
}
|
19 |
+
|
20 |
+
.remodal-overlay.remodal-is-opening,
|
21 |
+
.remodal-overlay.remodal-is-closing {
|
22 |
+
-webkit-animation-duration: 0.1s;
|
23 |
+
animation-duration: 0.1s;
|
24 |
+
-webkit-animation-fill-mode: forwards;
|
25 |
+
animation-fill-mode: forwards;
|
26 |
+
}
|
27 |
+
|
28 |
+
.remodal-overlay.remodal-is-opening {
|
29 |
+
-webkit-animation-name: remodal-overlay-opening-keyframes;
|
30 |
+
animation-name: remodal-overlay-opening-keyframes;
|
31 |
+
}
|
32 |
+
|
33 |
+
.remodal-overlay.remodal-is-closing {
|
34 |
+
-webkit-animation-name: remodal-overlay-closing-keyframes;
|
35 |
+
animation-name: remodal-overlay-closing-keyframes;
|
36 |
+
}
|
37 |
+
|
38 |
+
/* Default theme styles of the wrapper */
|
39 |
+
|
40 |
+
.remodal-wrapper {
|
41 |
+
padding: 10px 10px 0;
|
42 |
+
}
|
43 |
+
|
44 |
+
/* Default theme styles of the modal dialog */
|
45 |
+
|
46 |
+
.remodal {
|
47 |
+
box-sizing: border-box;
|
48 |
+
width: 100%;
|
49 |
+
margin-bottom: 10px;
|
50 |
+
padding: 30px 30px 5px 30px;
|
51 |
+
|
52 |
+
-webkit-transform: translate3d(0, 0, 0);
|
53 |
+
transform: translate3d(0, 0, 0);
|
54 |
+
|
55 |
+
color: #2b2e38;
|
56 |
+
background: #fff;
|
57 |
+
}
|
58 |
+
|
59 |
+
.remodal.remodal-is-opening {
|
60 |
+
-webkit-animation-name: remodal-opening-keyframes;
|
61 |
+
animation-name: remodal-opening-keyframes;
|
62 |
+
}
|
63 |
+
|
64 |
+
.remodal.remodal-is-closing {
|
65 |
+
-webkit-animation-name: remodal-closing-keyframes;
|
66 |
+
animation-name: remodal-closing-keyframes;
|
67 |
+
}
|
68 |
+
|
69 |
+
/* Vertical align of the modal dialog */
|
70 |
+
|
71 |
+
.remodal,
|
72 |
+
.remodal-wrapper:after {
|
73 |
+
vertical-align: middle;
|
74 |
+
}
|
75 |
+
|
76 |
+
/* Close button */
|
77 |
+
|
78 |
+
.remodal-close {
|
79 |
+
position: absolute;
|
80 |
+
top: 0;
|
81 |
+
left: 0;
|
82 |
+
|
83 |
+
display: block;
|
84 |
+
overflow: visible;
|
85 |
+
|
86 |
+
width: 35px;
|
87 |
+
height: 35px;
|
88 |
+
margin: 0;
|
89 |
+
padding: 0;
|
90 |
+
|
91 |
+
cursor: pointer;
|
92 |
+
-webkit-transition: color 0.2s;
|
93 |
+
transition: color 0.2s;
|
94 |
+
text-decoration: none;
|
95 |
+
|
96 |
+
color: #95979c;
|
97 |
+
border: 0;
|
98 |
+
outline: 0;
|
99 |
+
background: transparent;
|
100 |
+
}
|
101 |
+
|
102 |
+
.remodal-close:hover,
|
103 |
+
.remodal-close:focus {
|
104 |
+
color: #2b2e38;
|
105 |
+
}
|
106 |
+
|
107 |
+
.remodal-close:before {
|
108 |
+
font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
|
109 |
+
font-size: 25px;
|
110 |
+
line-height: 35px;
|
111 |
+
|
112 |
+
position: absolute;
|
113 |
+
top: 0;
|
114 |
+
left: 0;
|
115 |
+
|
116 |
+
display: block;
|
117 |
+
|
118 |
+
width: 35px;
|
119 |
+
|
120 |
+
content: "\00d7";
|
121 |
+
text-align: center;
|
122 |
+
}
|
123 |
+
|
124 |
+
/* Dialog buttons */
|
125 |
+
|
126 |
+
.remodal-confirm,
|
127 |
+
.remodal-cancel {
|
128 |
+
font: inherit;
|
129 |
+
|
130 |
+
display: inline-block;
|
131 |
+
overflow: visible;
|
132 |
+
|
133 |
+
min-width: 110px;
|
134 |
+
margin: 0;
|
135 |
+
padding: 12px 0;
|
136 |
+
|
137 |
+
cursor: pointer;
|
138 |
+
-webkit-transition: background 0.2s;
|
139 |
+
transition: background 0.2s;
|
140 |
+
text-align: center;
|
141 |
+
vertical-align: middle;
|
142 |
+
text-decoration: none;
|
143 |
+
|
144 |
+
border: 0;
|
145 |
+
outline: 0;
|
146 |
+
}
|
147 |
+
|
148 |
+
.remodal-confirm {
|
149 |
+
color: #fff;
|
150 |
+
background: #81c784;
|
151 |
+
}
|
152 |
+
|
153 |
+
.remodal-confirm:hover,
|
154 |
+
.remodal-confirm:focus {
|
155 |
+
background: #66bb6a;
|
156 |
+
}
|
157 |
+
|
158 |
+
.remodal-cancel {
|
159 |
+
color: #fff;
|
160 |
+
background: #e57373;
|
161 |
+
}
|
162 |
+
|
163 |
+
.remodal-cancel:hover,
|
164 |
+
.remodal-cancel:focus {
|
165 |
+
background: #ef5350;
|
166 |
+
}
|
167 |
+
|
168 |
+
/* Remove inner padding and border in Firefox 4+ for the button tag. */
|
169 |
+
|
170 |
+
.remodal-confirm::-moz-focus-inner,
|
171 |
+
.remodal-cancel::-moz-focus-inner,
|
172 |
+
.remodal-close::-moz-focus-inner {
|
173 |
+
padding: 0;
|
174 |
+
|
175 |
+
border: 0;
|
176 |
+
}
|
177 |
+
|
178 |
+
/* Keyframes
|
179 |
+
========================================================================== */
|
180 |
+
|
181 |
+
@-webkit-keyframes remodal-opening-keyframes {
|
182 |
+
from {
|
183 |
+
-webkit-transform: scale(1.05);
|
184 |
+
transform: scale(1.05);
|
185 |
+
|
186 |
+
opacity: 0;
|
187 |
+
}
|
188 |
+
to {
|
189 |
+
-webkit-transform: none;
|
190 |
+
transform: none;
|
191 |
+
|
192 |
+
opacity: 1;
|
193 |
+
|
194 |
+
-webkit-filter: blur(0);
|
195 |
+
filter: blur(0);
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
@keyframes remodal-opening-keyframes {
|
200 |
+
from {
|
201 |
+
-webkit-transform: scale(1.05);
|
202 |
+
transform: scale(1.05);
|
203 |
+
|
204 |
+
opacity: 0;
|
205 |
+
}
|
206 |
+
to {
|
207 |
+
-webkit-transform: none;
|
208 |
+
transform: none;
|
209 |
+
|
210 |
+
opacity: 1;
|
211 |
+
|
212 |
+
-webkit-filter: blur(0);
|
213 |
+
filter: blur(0);
|
214 |
+
}
|
215 |
+
}
|
216 |
+
|
217 |
+
@-webkit-keyframes remodal-closing-keyframes {
|
218 |
+
from {
|
219 |
+
-webkit-transform: scale(1);
|
220 |
+
transform: scale(1);
|
221 |
+
|
222 |
+
opacity: 1;
|
223 |
+
}
|
224 |
+
to {
|
225 |
+
-webkit-transform: scale(0.95);
|
226 |
+
transform: scale(0.95);
|
227 |
+
|
228 |
+
opacity: 0;
|
229 |
+
|
230 |
+
-webkit-filter: blur(0);
|
231 |
+
filter: blur(0);
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
@keyframes remodal-closing-keyframes {
|
236 |
+
from {
|
237 |
+
-webkit-transform: scale(1);
|
238 |
+
transform: scale(1);
|
239 |
+
|
240 |
+
opacity: 1;
|
241 |
+
}
|
242 |
+
to {
|
243 |
+
-webkit-transform: scale(0.95);
|
244 |
+
transform: scale(0.95);
|
245 |
+
|
246 |
+
opacity: 0;
|
247 |
+
|
248 |
+
-webkit-filter: blur(0);
|
249 |
+
filter: blur(0);
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
+
@-webkit-keyframes remodal-overlay-opening-keyframes {
|
254 |
+
from {
|
255 |
+
opacity: 0;
|
256 |
+
}
|
257 |
+
to {
|
258 |
+
opacity: 1;
|
259 |
+
}
|
260 |
+
}
|
261 |
+
|
262 |
+
@keyframes remodal-overlay-opening-keyframes {
|
263 |
+
from {
|
264 |
+
opacity: 0;
|
265 |
+
}
|
266 |
+
to {
|
267 |
+
opacity: 1;
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
@-webkit-keyframes remodal-overlay-closing-keyframes {
|
272 |
+
from {
|
273 |
+
opacity: 1;
|
274 |
+
}
|
275 |
+
to {
|
276 |
+
opacity: 0;
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
@keyframes remodal-overlay-closing-keyframes {
|
281 |
+
from {
|
282 |
+
opacity: 1;
|
283 |
+
}
|
284 |
+
to {
|
285 |
+
opacity: 0;
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
/* Media queries
|
290 |
+
========================================================================== */
|
291 |
+
|
292 |
+
@media only screen and (min-width: 641px) {
|
293 |
+
.remodal {
|
294 |
+
max-width: 550px;
|
295 |
+
}
|
296 |
+
}
|
297 |
+
|
298 |
+
/* IE8
|
299 |
+
========================================================================== */
|
300 |
+
|
301 |
+
.lt-ie9 .remodal-overlay {
|
302 |
+
background: #2b2e38;
|
303 |
+
}
|
304 |
+
|
305 |
+
.lt-ie9 .remodal {
|
306 |
+
width: 550px;
|
307 |
+
}
|
lib/plugin-deactivation-survey/remodal.css
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Remodal - v1.1.1
|
3 |
+
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
4 |
+
* http://vodkabears.github.io/remodal/
|
5 |
+
*
|
6 |
+
* Made by Ilya Makarov
|
7 |
+
* Under MIT License
|
8 |
+
*/
|
9 |
+
|
10 |
+
/* ==========================================================================
|
11 |
+
Remodal's necessary styles
|
12 |
+
========================================================================== */
|
13 |
+
|
14 |
+
/* Hide scroll bar */
|
15 |
+
|
16 |
+
html.remodal-is-locked {
|
17 |
+
overflow: hidden;
|
18 |
+
|
19 |
+
-ms-touch-action: none;
|
20 |
+
touch-action: none;
|
21 |
+
}
|
22 |
+
|
23 |
+
/* Anti FOUC */
|
24 |
+
|
25 |
+
.remodal,
|
26 |
+
[data-remodal-id] {
|
27 |
+
display: none;
|
28 |
+
}
|
29 |
+
|
30 |
+
/* Necessary styles of the overlay */
|
31 |
+
|
32 |
+
.remodal-overlay {
|
33 |
+
position: fixed;
|
34 |
+
z-index: 9999;
|
35 |
+
top: -5000px;
|
36 |
+
right: -5000px;
|
37 |
+
bottom: -5000px;
|
38 |
+
left: -5000px;
|
39 |
+
|
40 |
+
display: none;
|
41 |
+
}
|
42 |
+
|
43 |
+
/* Necessary styles of the wrapper */
|
44 |
+
|
45 |
+
.remodal-wrapper {
|
46 |
+
position: fixed;
|
47 |
+
z-index: 10000;
|
48 |
+
top: 0;
|
49 |
+
right: 0;
|
50 |
+
bottom: 0;
|
51 |
+
left: 0;
|
52 |
+
|
53 |
+
display: none;
|
54 |
+
overflow: auto;
|
55 |
+
|
56 |
+
text-align: center;
|
57 |
+
|
58 |
+
-webkit-overflow-scrolling: touch;
|
59 |
+
}
|
60 |
+
|
61 |
+
.remodal-wrapper:after {
|
62 |
+
display: inline-block;
|
63 |
+
|
64 |
+
height: 100%;
|
65 |
+
margin-left: -0.05em;
|
66 |
+
|
67 |
+
content: "";
|
68 |
+
}
|
69 |
+
|
70 |
+
/* Fix iPad, iPhone glitches */
|
71 |
+
|
72 |
+
.remodal-overlay,
|
73 |
+
.remodal-wrapper {
|
74 |
+
-webkit-backface-visibility: hidden;
|
75 |
+
backface-visibility: hidden;
|
76 |
+
}
|
77 |
+
|
78 |
+
/* Necessary styles of the modal dialog */
|
79 |
+
|
80 |
+
.remodal {
|
81 |
+
position: relative;
|
82 |
+
|
83 |
+
outline: none;
|
84 |
+
|
85 |
+
-webkit-text-size-adjust: 100%;
|
86 |
+
-ms-text-size-adjust: 100%;
|
87 |
+
text-size-adjust: 100%;
|
88 |
+
}
|
89 |
+
|
90 |
+
.remodal-is-initialized {
|
91 |
+
/* Disable Anti-FOUC */
|
92 |
+
display: inline-block;
|
93 |
+
}
|
lib/plugin-deactivation-survey/remodal.min.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Remodal - v1.1.1
|
3 |
+
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
4 |
+
* http://vodkabears.github.io/remodal/
|
5 |
+
*
|
6 |
+
* Made by Ilya Makarov
|
7 |
+
* Under MIT License
|
8 |
+
*/
|
9 |
+
|
10 |
+
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof exports?b(a,require("jquery")):b(a,a.jQuery||a.Zepto)}(this,function(a,b){"use strict";function c(a){if(w&&"none"===a.css("animation-name")&&"none"===a.css("-webkit-animation-name")&&"none"===a.css("-moz-animation-name")&&"none"===a.css("-o-animation-name")&&"none"===a.css("-ms-animation-name"))return 0;var b,c,d,e,f=a.css("animation-duration")||a.css("-webkit-animation-duration")||a.css("-moz-animation-duration")||a.css("-o-animation-duration")||a.css("-ms-animation-duration")||"0s",g=a.css("animation-delay")||a.css("-webkit-animation-delay")||a.css("-moz-animation-delay")||a.css("-o-animation-delay")||a.css("-ms-animation-delay")||"0s",h=a.css("animation-iteration-count")||a.css("-webkit-animation-iteration-count")||a.css("-moz-animation-iteration-count")||a.css("-o-animation-iteration-count")||a.css("-ms-animation-iteration-count")||"1";for(f=f.split(", "),g=g.split(", "),h=h.split(", "),e=0,c=f.length,b=Number.NEGATIVE_INFINITY;e<c;e++)d=parseFloat(f[e])*parseInt(h[e],10)+parseFloat(g[e]),d>b&&(b=d);return b}function d(){if(b(document).height()<=b(window).height())return 0;var a,c,d=document.createElement("div"),e=document.createElement("div");return d.style.visibility="hidden",d.style.width="100px",document.body.appendChild(d),a=d.offsetWidth,d.style.overflow="scroll",e.style.width="100%",d.appendChild(e),c=e.offsetWidth,d.parentNode.removeChild(d),a-c}function e(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)||(c=b(document.body),a=parseInt(c.css("padding-right"),10)+d(),c.css("padding-right",a+"px"),e.addClass(f))}}function f(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)&&(c=b(document.body),a=parseInt(c.css("padding-right"),10)-d(),c.css("padding-right",a+"px"),e.removeClass(f))}}function g(a,b,c,d){var e=k("is",b),f=[k("is",u.CLOSING),k("is",u.OPENING),k("is",u.CLOSED),k("is",u.OPENED)].join(" ");a.$bg.removeClass(f).addClass(e),a.$overlay.removeClass(f).addClass(e),a.$wrapper.removeClass(f).addClass(e),a.$modal.removeClass(f).addClass(e),a.state=b,!c&&a.$modal.trigger({type:b,reason:d},[{reason:d}])}function h(a,d,e){var f=0,g=function(a){a.target===this&&f++},h=function(a){a.target===this&&0===--f&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())};b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].on(r,g).on(s,h)}),a(),0===c(e.$bg)&&0===c(e.$overlay)&&0===c(e.$wrapper)&&0===c(e.$modal)&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())}function i(a){a.state!==u.CLOSED&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(b,c){a[c].off(r+" "+s)}),a.$bg.removeClass(a.settings.modifier),a.$overlay.removeClass(a.settings.modifier).hide(),a.$wrapper.hide(),f(),g(a,u.CLOSED,!0))}function j(a){var b,c,d,e,f={};for(a=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,","),b=a.split(","),e=0,c=b.length;e<c;e++)b[e]=b[e].split(":"),d=b[e][1],("string"==typeof d||d instanceof String)&&(d="true"===d||"false"!==d&&d),("string"==typeof d||d instanceof String)&&(d=isNaN(d)?d:+d),f[b[e][0]]=d;return f}function k(){for(var a=q,b=0;b<arguments.length;++b)a+="-"+arguments[b];return a}function l(){var a,c,d=location.hash.replace("#","");if(d){try{c=b('[data-remodal-id="'+d+'"]')}catch(e){}c&&c.length&&(a=b[p].lookup[c.data(p)],a&&a.settings.hashTracking&&a.open())}else n&&n.state===u.OPENED&&n.settings.hashTracking&&n.close()}function m(a,c){var d=b(document.body),e=d,f=this;f.settings=b.extend({},t,c),f.index=b[p].lookup.push(f)-1,f.state=u.CLOSED,f.$overlay=b("."+k("overlay")),null!==f.settings.appendTo&&f.settings.appendTo.length&&(e=b(f.settings.appendTo)),f.$overlay.length||(f.$overlay=b("<div>").addClass(k("overlay")+" "+k("is",u.CLOSED)).hide(),e.append(f.$overlay)),f.$bg=b("."+k("bg")).addClass(k("is",u.CLOSED)),f.$modal=a.addClass(q+" "+k("is-initialized")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).attr("tabindex","-1"),f.$wrapper=b("<div>").addClass(k("wrapper")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).hide().append(f.$modal),e.append(f.$wrapper),f.$wrapper.on("click."+q,'[data-remodal-action="close"]',function(a){a.preventDefault(),f.close()}),f.$wrapper.on("click."+q,'[data-remodal-action="cancel"]',function(a){a.preventDefault(),f.$modal.trigger(v.CANCELLATION),f.settings.closeOnCancel&&f.close(v.CANCELLATION)}),f.$wrapper.on("click."+q,'[data-remodal-action="confirm"]',function(a){a.preventDefault(),f.$modal.trigger(v.CONFIRMATION),f.settings.closeOnConfirm&&f.close(v.CONFIRMATION)}),f.$wrapper.on("click."+q,function(a){var c=b(a.target);c.hasClass(k("wrapper"))&&f.settings.closeOnOutsideClick&&f.close()})}var n,o,p="remodal",q=a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.NAMESPACE||p,r=b.map(["animationstart","webkitAnimationStart","MSAnimationStart","oAnimationStart"],function(a){return a+"."+q}).join(" "),s=b.map(["animationend","webkitAnimationEnd","MSAnimationEnd","oAnimationEnd"],function(a){return a+"."+q}).join(" "),t=b.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnOutsideClick:!0,modifier:"",appendTo:null},a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.DEFAULTS),u={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened"},v={CONFIRMATION:"confirmation",CANCELLATION:"cancellation"},w=function(){var a=document.createElement("div").style;return void 0!==a.animationName||void 0!==a.WebkitAnimationName||void 0!==a.MozAnimationName||void 0!==a.msAnimationName||void 0!==a.OAnimationName}(),x=/iPad|iPhone|iPod/.test(navigator.platform);m.prototype.open=function(){var a,c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&(a=c.$modal.attr("data-remodal-id"),a&&c.settings.hashTracking&&(o=b(window).scrollTop(),location.hash=a),n&&n!==c&&i(n),n=c,e(),c.$bg.addClass(c.settings.modifier),c.$overlay.addClass(c.settings.modifier).show(),c.$wrapper.show().scrollTop(0),c.$modal.focus(),h(function(){g(c,u.OPENING)},function(){g(c,u.OPENED)},c))},m.prototype.close=function(a){var c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&c.state!==u.CLOSED&&(c.settings.hashTracking&&c.$modal.attr("data-remodal-id")===location.hash.substr(1)&&(location.hash="",b(window).scrollTop(o)),h(function(){g(c,u.CLOSING,!1,a)},function(){c.$bg.removeClass(c.settings.modifier),c.$overlay.removeClass(c.settings.modifier).hide(),c.$wrapper.hide(),f(),g(c,u.CLOSED,!1,a)},c))},m.prototype.getState=function(){return this.state},m.prototype.destroy=function(){var a,c=b[p].lookup;i(this),this.$wrapper.remove(),delete c[this.index],a=b.grep(c,function(a){return!!a}).length,0===a&&(this.$overlay.remove(),this.$bg.removeClass(k("is",u.CLOSING)+" "+k("is",u.OPENING)+" "+k("is",u.CLOSED)+" "+k("is",u.OPENED)))},b[p]={lookup:[]},b.fn[p]=function(a){var c,d;return this.each(function(e,f){d=b(f),null==d.data(p)?(c=new m(d,a),d.data(p,c.index),c.settings.hashTracking&&d.attr("data-remodal-id")===location.hash.substr(1)&&c.open()):c=b[p].lookup[d.data(p)]}),c},b(document).ready(function(){b(document).on("click","[data-remodal-target]",function(a){a.preventDefault();var c=a.currentTarget,d=c.getAttribute("data-remodal-target"),e=b('[data-remodal-id="'+d+'"]');b[p].lookup[e.data(p)].open()}),b(document).find("."+q).each(function(a,c){var d=b(c),e=d.data("remodal-options");e?("string"==typeof e||e instanceof String)&&(e=j(e)):e={},d[p](e)}),b(document).on("keydown."+q,function(a){n&&n.settings.closeOnEscape&&n.state===u.OPENED&&27===a.keyCode&&n.close()}),b(window).on("hashchange."+q,l)})});
|
lib/social-share-counts/curl_multi_share_count.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* @version 2.0.0.0
|
7 |
*/
|
8 |
|
9 |
-
require_once
|
10 |
|
11 |
/**
|
12 |
* A class that implements ShareaholicShareCounts
|
@@ -15,226 +15,230 @@ require_once('share_count.php');
|
|
15 |
*
|
16 |
* @package shareaholic
|
17 |
*/
|
18 |
-
|
19 |
class ShareaholicCurlMultiShareCount extends ShareaholicShareCount {
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
|
6 |
* @version 2.0.0.0
|
7 |
*/
|
8 |
|
9 |
+
require_once 'share_count.php';
|
10 |
|
11 |
/**
|
12 |
* A class that implements ShareaholicShareCounts
|
15 |
*
|
16 |
* @package shareaholic
|
17 |
*/
|
|
|
18 |
class ShareaholicCurlMultiShareCount extends ShareaholicShareCount {
|
19 |
+
/**
|
20 |
+
* This function should get all the counts for the
|
21 |
+
* supported services
|
22 |
+
*
|
23 |
+
* It should return an associative array with the services as
|
24 |
+
* the keys and the counts as the value.
|
25 |
+
*
|
26 |
+
* Example:
|
27 |
+
* array('facebook' => 12, 'pinterest' => 0, 'twitter' => 14, ...);
|
28 |
+
*
|
29 |
+
* @return Array an associative array of service => counts
|
30 |
+
*/
|
31 |
+
public function get_counts() {
|
32 |
+
$services_length = count( $this->services );
|
33 |
+
$config = self::get_services_config();
|
34 |
+
$response = array();
|
35 |
+
$meta = array();
|
36 |
+
$response['status'] = 200;
|
37 |
+
|
38 |
+
// Input Params.
|
39 |
+
$show_raw = isset( $this->options['show_raw'] ) ? $this->options['show_raw'] : '1';
|
40 |
+
$show_response_header = isset( $this->options['show_response_header'] ) ? $this->options['show_response_header'] : '0';
|
41 |
+
|
42 |
+
// array of curl handles.
|
43 |
+
$curl_handles = array();
|
44 |
+
|
45 |
+
// multi handle.
|
46 |
+
$multi_handle = curl_multi_init();
|
47 |
+
|
48 |
+
for ( $i = 0; $i < $services_length; $i++ ) {
|
49 |
+
$service = $this->services[ $i ];
|
50 |
+
|
51 |
+
if ( ! isset( $config[ $service ] ) ) {
|
52 |
+
continue;
|
53 |
+
}
|
54 |
+
|
55 |
+
if ( isset( $config[ $service ]['prepare'] ) ) {
|
56 |
+
$this->{$config[ $service ]['prepare']}( $this->url, $config );
|
57 |
+
}
|
58 |
+
|
59 |
+
// Create the curl handle.
|
60 |
+
$curl_handles[ $service ] = curl_init();
|
61 |
+
|
62 |
+
// set the curl options to make the request.
|
63 |
+
$this->curl_setopts( $curl_handles[ $service ], $config, $service );
|
64 |
+
|
65 |
+
// add the handle to curl_multi_handle.
|
66 |
+
curl_multi_add_handle( $multi_handle, $curl_handles[ $service ] );
|
67 |
+
}
|
68 |
+
|
69 |
+
// Run curl_multi only if there are some actual curl handles.
|
70 |
+
if ( count( $curl_handles ) > 0 ) {
|
71 |
+
// While we're still active, execute curl.
|
72 |
+
$running = null;
|
73 |
+
do {
|
74 |
+
$mrc = curl_multi_exec( $multi_handle, $running );
|
75 |
+
} while ( $mrc == CURLM_CALL_MULTI_PERFORM );
|
76 |
+
|
77 |
+
while ( $running && $mrc == CURLM_OK ) {
|
78 |
+
// Wait for activity on any curl-connection
|
79 |
+
if ( curl_multi_select( $multi_handle ) == -1 ) {
|
80 |
+
usleep( 1 );
|
81 |
+
}
|
82 |
+
|
83 |
+
// Continue to exec until curl is ready to give us more data.
|
84 |
+
do {
|
85 |
+
$mrc = curl_multi_exec( $multi_handle, $running );
|
86 |
+
} while ( $mrc == CURLM_CALL_MULTI_PERFORM );
|
87 |
+
}
|
88 |
+
|
89 |
+
// handle the responses.
|
90 |
+
foreach ( $curl_handles as $service => $handle ) {
|
91 |
+
if ( curl_errno( $handle ) ) {
|
92 |
+
$response['status'] = 500;
|
93 |
+
}
|
94 |
+
|
95 |
+
$headers = array();
|
96 |
+
$body = array();
|
97 |
+
$headers_arr = array();
|
98 |
+
$aHeaders = array();
|
99 |
+
|
100 |
+
// Parse header and body from response.
|
101 |
+
$header_size = curl_getinfo( $handle, CURLINFO_HEADER_SIZE );
|
102 |
+
$headers = substr( curl_multi_getcontent( $handle ), 0, $header_size );
|
103 |
+
$body = substr( curl_multi_getcontent( $handle ), $header_size );
|
104 |
+
|
105 |
+
// Explode header values.
|
106 |
+
$headers_arr = explode( "\r\n", $headers );
|
107 |
+
// Remove empty values.
|
108 |
+
$headers_arr = array_filter( $headers_arr );
|
109 |
+
// Convert to key=>value.
|
110 |
+
foreach ( $headers_arr as $i => $line ) {
|
111 |
+
if ( 0 === $i ) {
|
112 |
+
$aHeaders['http_code'] = trim( $line );
|
113 |
+
} else {
|
114 |
+
list($key, $val) = explode( ': ', $line, 2 );
|
115 |
+
$aHeaders[ strtolower( $key ) ] = trim( $val );
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
$result = array(
|
120 |
+
'body' => $body,
|
121 |
+
'response' => array(
|
122 |
+
'code' => curl_getinfo( $handle, CURLINFO_HTTP_CODE ),
|
123 |
+
),
|
124 |
+
);
|
125 |
+
|
126 |
+
$callback = $config[ $service ]['callback'];
|
127 |
+
|
128 |
+
// Facebook auth?
|
129 |
+
if ( $service == 'facebook' && isset( $this->options['facebook_access_token'] ) ) {
|
130 |
+
$counts = $this->$callback( $result, isset( $this->options['facebook_access_token'] ) );
|
131 |
+
} else {
|
132 |
+
$counts = $this->$callback( $result );
|
133 |
+
}
|
134 |
+
|
135 |
+
if ( is_numeric( $counts ) ) {
|
136 |
+
$response['data'][ $service ] = $counts;
|
137 |
+
}
|
138 |
+
|
139 |
+
// Include Response Headers?
|
140 |
+
if ( '1' === $show_response_header ) {
|
141 |
+
$whitelisted_response_header_keys = array(
|
142 |
+
'http_code',
|
143 |
+
'x-app-usage',
|
144 |
+
'expires',
|
145 |
+
'cache-control',
|
146 |
+
);
|
147 |
+
$result_response_headers = array(
|
148 |
+
'response' => array(
|
149 |
+
'header' => array_intersect_key( $aHeaders, array_flip( $whitelisted_response_header_keys ) ),
|
150 |
+
'code' => curl_getinfo( $handle, CURLINFO_HTTP_CODE ),
|
151 |
+
),
|
152 |
+
);
|
153 |
+
$meta = array_merge( $meta, $result_response_headers );
|
154 |
+
}
|
155 |
+
|
156 |
+
// Include Raw Body & Headers?
|
157 |
+
if ( '1' === $show_raw ) {
|
158 |
+
$result_raw = array(
|
159 |
+
'raw' => array(
|
160 |
+
'body' => $body,
|
161 |
+
'headers' => $headers,
|
162 |
+
),
|
163 |
+
);
|
164 |
+
$meta = array_merge( $meta, $result_raw );
|
165 |
+
}
|
166 |
+
|
167 |
+
$this->raw_response[ $service ] = $meta;
|
168 |
+
|
169 |
+
curl_multi_remove_handle( $multi_handle, $handle );
|
170 |
+
curl_close( $handle );
|
171 |
+
}
|
172 |
+
curl_multi_close( $multi_handle );
|
173 |
+
}
|
174 |
+
return $response;
|
175 |
+
}
|
176 |
+
|
177 |
+
private function curl_setopts( $curl_handle, $config, $service ) {
|
178 |
+
$facebook_access_token = isset( $this->options['facebook_access_token'] ) ? $this->options['facebook_access_token'] : false;
|
179 |
+
$http2 = isset( $this->options['http2'] ) ? $this->options['http2'] : '0';
|
180 |
+
|
181 |
+
$timeout = isset( $config[ $service ]['timeout'] ) ? $config[ $service ]['timeout'] : 1000;
|
182 |
+
$timeout = isset( $this->options['timeout'] ) ? $this->options['timeout'] : $timeout;
|
183 |
+
|
184 |
+
// set the url to make the curl request to
|
185 |
+
if ( $service == 'facebook' && $facebook_access_token ) {
|
186 |
+
$url = $config[ $service ]['url_auth'];
|
187 |
+
$url = str_replace( '%s', $this->url, $url );
|
188 |
+
$url = str_replace( '%auth%', $facebook_access_token, $url );
|
189 |
+
curl_setopt( $curl_handle, CURLOPT_URL, $url );
|
190 |
+
} else {
|
191 |
+
curl_setopt( $curl_handle, CURLOPT_URL, str_replace( '%s', $this->url, $config[ $service ]['url'] ) );
|
192 |
+
}
|
193 |
+
|
194 |
+
// other necessary settings:
|
195 |
+
// CURLOPT_RETURNTRANSER means return output as string or not.
|
196 |
+
curl_setopt_array(
|
197 |
+
$curl_handle,
|
198 |
+
array(
|
199 |
+
CURLOPT_HEADER => 1,
|
200 |
+
CURLOPT_RETURNTRANSFER => 1,
|
201 |
+
CURLOPT_TIMEOUT_MS => $timeout,
|
202 |
+
CURLOPT_SSL_VERIFYPEER => false,
|
203 |
+
CURLOPT_SSL_VERIFYHOST => false,
|
204 |
+
)
|
205 |
+
);
|
206 |
+
|
207 |
+
// HTTP/2 support?
|
208 |
+
if ( $http2 == '1' ) {
|
209 |
+
curl_setopt( $curl_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0 );
|
210 |
+
}
|
211 |
+
|
212 |
+
// set the http method? default: GET
|
213 |
+
if ( $config[ $service ]['method'] === 'POST' ) {
|
214 |
+
curl_setopt( $curl_handle, CURLOPT_POST, 1 );
|
215 |
+
}
|
216 |
+
|
217 |
+
// set the body and headers?
|
218 |
+
$headers = isset( $config[ $service ]['headers'] ) ? $config[ $service ]['headers'] : array();
|
219 |
+
$body = isset( $config[ $service ]['body'] ) ? $config[ $service ]['body'] : null;
|
220 |
+
|
221 |
+
if ( isset( $body ) ) {
|
222 |
+
if ( isset( $headers['Content-Type'] ) && $headers['Content-Type'] === 'application/json' ) {
|
223 |
+
$data_string = json_encode( $body );
|
224 |
+
|
225 |
+
curl_setopt(
|
226 |
+
$curl_handle,
|
227 |
+
CURLOPT_HTTPHEADER,
|
228 |
+
array(
|
229 |
+
'Content-Type: application/json',
|
230 |
+
'Content-Length: ' . strlen( $data_string ),
|
231 |
+
)
|
232 |
+
);
|
233 |
+
|
234 |
+
curl_setopt( $curl_handle, CURLOPT_POSTFIELDS, $data_string );
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
// set the useragent?
|
239 |
+
$useragent = isset( $config[ $service ]['User-Agent'] ) ? $config[ $service ]['User-Agent'] : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0';
|
240 |
+
curl_setopt( $curl_handle, CURLOPT_USERAGENT, $useragent );
|
241 |
+
}
|
242 |
+
|
243 |
+
|
244 |
+
}
|
lib/social-share-counts/seq_share_count.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* @version 1.0.0.0
|
7 |
*/
|
8 |
|
9 |
-
require_once
|
10 |
|
11 |
/**
|
12 |
* A class that implements ShareaholicShareCounts
|
@@ -15,87 +15,85 @@ require_once('share_count.php');
|
|
15 |
*
|
16 |
* @package shareaholic
|
17 |
*/
|
18 |
-
|
19 |
class ShareaholicSeqShareCount extends ShareaholicShareCount {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
*
|
25 |
-
* It should return an associative array with the services as
|
26 |
-
* the keys and the counts as the value.
|
27 |
-
*
|
28 |
-
* Example:
|
29 |
-
* array('facebook' => 12, 'pinterest' => 0, 'twitter' => 14, ...);
|
30 |
-
*
|
31 |
-
* @return Array an associative array of service => counts
|
32 |
-
*/
|
33 |
-
public function get_counts() {
|
34 |
-
$services_length = count($this->services);
|
35 |
-
$config = self::get_services_config();
|
36 |
-
$response = array();
|
37 |
-
$meta = array();
|
38 |
-
$response['status'] = 200;
|
39 |
-
|
40 |
-
for($i = 0; $i < $services_length; $i++) {
|
41 |
-
$service = $this->services[$i];
|
42 |
-
|
43 |
-
if(!isset($config[$service])) {
|
44 |
-
continue;
|
45 |
-
}
|
46 |
-
|
47 |
-
if(isset($config[$service]['prepare'])) {
|
48 |
-
$this->{$config[$service]['prepare']}($this->url, $config);
|
49 |
-
}
|
50 |
-
|
51 |
-
$timeout = isset($config[$service]['timeout']) ? $config[$service]['timeout'] : 1000;
|
52 |
-
$timeout = isset($this->options['timeout']) ? $this->options['timeout'] : $timeout;
|
53 |
-
$http2 = isset($this->options['http2']) ? $this->options['http2'] : '0';
|
54 |
-
|
55 |
-
$show_raw = isset($this->options['show_raw']) ? $this->options['show_raw'] : '1';
|
56 |
-
$show_response_header = isset($this->options['show_response_header']) ? $this->options['show_response_header'] : '0';
|
57 |
-
|
58 |
-
$options = array(
|
59 |
-
'method' => $config[$service]['method'],
|
60 |
-
'timeout' => $timeout,
|
61 |
-
'headers' => isset($config[$service]['headers']) ? $config[$service]['headers'] : array(),
|
62 |
-
'body' => isset($config[$service]['body']) ? $config[$service]['body'] : NULL,
|
63 |
-
'http2' => $http2,
|
64 |
-
'show_raw' => $show_raw,
|
65 |
-
'show_response_header' => $show_response_header,
|
66 |
-
);
|
67 |
-
|
68 |
-
// set the url to make the curl request
|
69 |
-
$facebook_access_token = isset($this->options['facebook_access_token']) ? $this->options['facebook_access_token'] : false;
|
70 |
-
|
71 |
-
if ($service == 'facebook' && $facebook_access_token) {
|
72 |
-
$url = $config[$service]['url_auth'];
|
73 |
-
$url = str_replace('%s', $this->url, $url);
|
74 |
-
$url = str_replace('%auth%', $facebook_access_token, $url);
|
75 |
-
$result = ShareaholicHttp::send($url, $options);
|
76 |
-
} else {
|
77 |
-
$result = ShareaholicHttp::send(str_replace('%s', $this->url, $config[$service]['url']), $options);
|
78 |
-
}
|
79 |
-
|
80 |
-
if(!$result) {
|
81 |
-
$response['status'] = 500;
|
82 |
-
}
|
83 |
-
|
84 |
-
$callback = $config[$service]['callback'];
|
85 |
-
|
86 |
-
if ($service == 'facebook' && isset($this->options['facebook_access_token'])){
|
87 |
-
$counts = $this->$callback($result, isset($this->options['facebook_access_token']));
|
88 |
-
} else {
|
89 |
-
$counts = $this->$callback($result);
|
90 |
-
}
|
91 |
-
|
92 |
-
if(is_numeric($counts)) {
|
93 |
-
$response['data'][$service] = $counts;
|
94 |
-
}
|
95 |
-
|
96 |
-
$this->raw_response[$service] = $result['meta'];
|
97 |
-
}
|
98 |
-
|
99 |
-
return $response;
|
100 |
-
}
|
101 |
-
}
|
6 |
* @version 1.0.0.0
|
7 |
*/
|
8 |
|
9 |
+
require_once 'share_count.php';
|
10 |
|
11 |
/**
|
12 |
* A class that implements ShareaholicShareCounts
|
15 |
*
|
16 |
* @package shareaholic
|
17 |
*/
|
|
|
18 |
class ShareaholicSeqShareCount extends ShareaholicShareCount {
|
19 |
+
/**
|
20 |
+
* This function should get all the counts for the
|
21 |
+
* supported services
|
22 |
+
*
|
23 |
+
* It should return an associative array with the services as
|
24 |
+
* the keys and the counts as the value.
|
25 |
+
*
|
26 |
+
* Example:
|
27 |
+
* array('facebook' => 12, 'pinterest' => 0, 'twitter' => 14, ...);
|
28 |
+
*
|
29 |
+
* @return Array an associative array of service => counts
|
30 |
+
*/
|
31 |
+
public function get_counts() {
|
32 |
+
$services_length = count( $this->services );
|
33 |
+
$config = self::get_services_config();
|
34 |
+
$response = array();
|
35 |
+
$meta = array();
|
36 |
+
$response['status'] = 200;
|
37 |
+
|
38 |
+
for ( $i = 0; $i < $services_length; $i++ ) {
|
39 |
+
$service = $this->services[ $i ];
|
40 |
+
|
41 |
+
if ( ! isset( $config[ $service ] ) ) {
|
42 |
+
continue;
|
43 |
+
}
|
44 |
+
|
45 |
+
if ( isset( $config[ $service ]['prepare'] ) ) {
|
46 |
+
$this->{$config[ $service ]['prepare']}( $this->url, $config );
|
47 |
+
}
|
48 |
+
|
49 |
+
$timeout = isset( $config[ $service ]['timeout'] ) ? $config[ $service ]['timeout'] : 1000;
|
50 |
+
$timeout = isset( $this->options['timeout'] ) ? $this->options['timeout'] : $timeout;
|
51 |
+
$http2 = isset( $this->options['http2'] ) ? $this->options['http2'] : '0';
|
52 |
+
|
53 |
+
$show_raw = isset( $this->options['show_raw'] ) ? $this->options['show_raw'] : '1';
|
54 |
+
$show_response_header = isset( $this->options['show_response_header'] ) ? $this->options['show_response_header'] : '0';
|
55 |
+
|
56 |
+
$options = array(
|
57 |
+
'method' => $config[ $service ]['method'],
|
58 |
+
'timeout' => $timeout,
|
59 |
+
'headers' => isset( $config[ $service ]['headers'] ) ? $config[ $service ]['headers'] : array(),
|
60 |
+
'body' => isset( $config[ $service ]['body'] ) ? $config[ $service ]['body'] : null,
|
61 |
+
'http2' => $http2,
|
62 |
+
'show_raw' => $show_raw,
|
63 |
+
'show_response_header' => $show_response_header,
|
64 |
+
);
|
65 |
+
|
66 |
+
// set the url to make the curl request
|
67 |
+
$facebook_access_token = isset( $this->options['facebook_access_token'] ) ? $this->options['facebook_access_token'] : false;
|
68 |
+
|
69 |
+
if ( $service == 'facebook' && $facebook_access_token ) {
|
70 |
+
$url = $config[ $service ]['url_auth'];
|
71 |
+
$url = str_replace( '%s', $this->url, $url );
|
72 |
+
$url = str_replace( '%auth%', $facebook_access_token, $url );
|
73 |
+
$result = ShareaholicHttp::send( $url, $options );
|
74 |
+
} else {
|
75 |
+
$result = ShareaholicHttp::send( str_replace( '%s', $this->url, $config[ $service ]['url'] ), $options );
|
76 |
+
}
|
77 |
+
|
78 |
+
if ( ! $result ) {
|
79 |
+
$response['status'] = 500;
|
80 |
+
}
|
81 |
+
|
82 |
+
$callback = $config[ $service ]['callback'];
|
83 |
+
|
84 |
+
if ( $service == 'facebook' && isset( $this->options['facebook_access_token'] ) ) {
|
85 |
+
$counts = $this->$callback( $result, isset( $this->options['facebook_access_token'] ) );
|
86 |
+
} else {
|
87 |
+
$counts = $this->$callback( $result );
|
88 |
+
}
|
89 |
+
|
90 |
+
if ( is_numeric( $counts ) ) {
|
91 |
+
$response['data'][ $service ] = $counts;
|
92 |
+
}
|
93 |
+
|
94 |
+
$this->raw_response[ $service ] = $result['meta'];
|
95 |
+
}
|
96 |
|
97 |
+
return $response;
|
98 |
+
}
|
99 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/social-share-counts/share_count.php
CHANGED
@@ -14,328 +14,323 @@
|
|
14 |
* @package shareaholic
|
15 |
*/
|
16 |
abstract class ShareaholicShareCount {
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
'url' => 'https://api.bufferapp.com/1/links/shares.json?url=%s',
|
51 |
-
'method' => 'GET',
|
52 |
-
'timeout' => 1000,
|
53 |
-
'callback' => 'buffer_count_callback',
|
54 |
-
),
|
55 |
-
'reddit' => array(
|
56 |
-
'url' => 'https://www.reddit.com/button_info.json?url=%s',
|
57 |
-
'method' => 'GET',
|
58 |
-
'timeout' => 1000,
|
59 |
-
'callback' => 'reddit_count_callback',
|
60 |
-
),
|
61 |
-
'vk' => array(
|
62 |
-
'url' => 'https://vk.com/share.php?act=count&url=%s',
|
63 |
-
'method' => 'GET',
|
64 |
-
'timeout' => 1000,
|
65 |
-
'callback' => 'vk_count_callback',
|
66 |
-
),
|
67 |
-
'tumblr' => array(
|
68 |
-
'url' => 'https://api.tumblr.com/v2/share/stats?url=%s',
|
69 |
-
'method' => 'GET',
|
70 |
-
'timeout' => 1000,
|
71 |
-
'callback' => 'tumblr_count_callback',
|
72 |
-
),
|
73 |
-
'odnoklassniki' => array(
|
74 |
-
'url' => 'https://connect.ok.ru/dk?st.cmd=extLike&uid=odklcnt0&ref=%s',
|
75 |
-
'method' => 'GET',
|
76 |
-
'timeout' => 1000,
|
77 |
-
'callback' => 'odnoklassniki_count_callback',
|
78 |
-
),
|
79 |
-
'fancy' => array(
|
80 |
-
'url' => 'https://fancy.com/fancyit/count?ItemURL=%s',
|
81 |
-
'method' => 'GET',
|
82 |
-
'timeout' => 1000,
|
83 |
-
'callback' => 'fancy_count_callback',
|
84 |
-
),
|
85 |
-
'yummly' => array(
|
86 |
-
'url' => 'https://www.yummly.com/services/yum-count?url=%s',
|
87 |
-
'method' => 'GET',
|
88 |
-
'timeout' => 1000,
|
89 |
-
'callback' => 'yummly_count_callback',
|
90 |
-
),
|
91 |
-
);
|
92 |
-
}
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
return false;
|
107 |
-
}
|
108 |
-
return true;
|
109 |
-
}
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
*/
|
134 |
-
public function get_client_ip() {
|
135 |
-
$ip = NULL;
|
136 |
|
137 |
-
|
138 |
-
|
139 |
-
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
140 |
-
}
|
141 |
-
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
142 |
-
// Check for the Proxy User
|
143 |
-
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
144 |
-
}
|
145 |
-
else {
|
146 |
-
$ip = $_SERVER['REMOTE_ADDR'];
|
147 |
-
}
|
148 |
|
149 |
-
return $ip;
|
150 |
-
}
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
if (isset($body['engagement']['share_count'])) {
|
169 |
-
$count += $body['engagement']['share_count'];
|
170 |
-
}
|
171 |
-
if (isset($body['engagement']['reaction_count'])) {
|
172 |
-
$count += $body['engagement']['reaction_count'];
|
173 |
-
}
|
174 |
-
if (isset($body['engagement']['comment_count'])) {
|
175 |
-
$count += $body['engagement']['comment_count'];
|
176 |
-
}
|
177 |
-
return $count;
|
178 |
-
} else {
|
179 |
-
return isset($body['og_object']['engagement']['count']) ? intval($body['og_object']['engagement']['count']) : 0;
|
180 |
-
}
|
181 |
-
}
|
182 |
|
183 |
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
|
200 |
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
|
216 |
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
if($this->has_http_error($response)) {
|
243 |
-
return false;
|
244 |
-
}
|
245 |
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
|
|
|
|
|
|
|
|
253 |
|
|
|
|
|
|
|
|
|
|
|
254 |
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
}
|
273 |
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
*
|
278 |
-
* @param Array $response The response from calling the API
|
279 |
-
* @return mixed The counts from the API or false if error
|
280 |
-
*/
|
281 |
-
public function fancy_count_callback($response) {
|
282 |
-
if($this->has_http_error($response)) {
|
283 |
-
return false;
|
284 |
-
}
|
285 |
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
}
|
307 |
-
$body = json_decode($response['body'], true);
|
308 |
-
return isset($body['response']['note_count']) ? intval($body['response']['note_count']) : 0;
|
309 |
-
}
|
310 |
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
/**
|
327 |
-
* The abstract function to be implemented by its children
|
328 |
-
* This function should get all the counts for the
|
329 |
-
* supported services
|
330 |
-
*
|
331 |
-
* It should return an associative array with the services as
|
332 |
-
* the keys and the counts as the value.
|
333 |
-
*
|
334 |
-
* Example:
|
335 |
-
* array('facebook' => 12, 'pinterest' => 0, 'twitter' => 14, ...);
|
336 |
-
*
|
337 |
-
* @return Array an associative array of service => counts
|
338 |
-
*/
|
339 |
-
public abstract function get_counts();
|
340 |
|
341 |
-
}
|
14 |
* @package shareaholic
|
15 |
*/
|
16 |
abstract class ShareaholicShareCount {
|
17 |
+
protected $url;
|
18 |
+
protected $services;
|
19 |
+
protected $options;
|
20 |
+
public $raw_response;
|
21 |
|
22 |
+
public function __construct( $url, $services, $options ) {
|
23 |
+
// encode the url if needed.
|
24 |
+
if ( ! $this->is_url_encoded( $url ) ) {
|
25 |
+
$url = urlencode( $url );
|
26 |
+
}
|
27 |
+
$this->url = $url;
|
28 |
+
$this->services = $services;
|
29 |
+
$this->options = $options;
|
30 |
+
$this->raw_response = array();
|
31 |
+
}
|
32 |
|
33 |
+
public static function get_services_config() {
|
34 |
+
return array(
|
35 |
+
'facebook' => array(
|
36 |
+
'url' => 'https://graph.facebook.com/?fields=og_object{engagement{count}}&id=%s',
|
37 |
+
'url_auth' => 'https://graph.facebook.com/?access_token=%auth%&fields=engagement&id=%s',
|
38 |
+
'method' => 'GET',
|
39 |
+
'timeout' => 1000, // in number of milliseconds
|
40 |
+
'callback' => 'facebook_count_callback',
|
41 |
+
),
|
42 |
+
'pinterest' => array(
|
43 |
+
'url' => 'https://api.pinterest.com/v1/urls/count.json?url=%s&callback=f',
|
44 |
+
'method' => 'GET',
|
45 |
+
'timeout' => 1000,
|
46 |
+
'callback' => 'pinterest_count_callback',
|
47 |
+
),
|
48 |
+
'buffer' => array(
|
49 |
+
'url' => 'https://api.bufferapp.com/1/links/shares.json?url=%s',
|
50 |
+
'method' => 'GET',
|
51 |
+
'timeout' => 1000,
|
52 |
+
'callback' => 'buffer_count_callback',
|
53 |
+
),
|
54 |
+
'reddit' => array(
|
55 |
+
'url' => 'https://www.reddit.com/button_info.json?url=%s',
|
56 |
+
'method' => 'GET',
|
57 |
+
'timeout' => 1000,
|
58 |
+
'callback' => 'reddit_count_callback',
|
59 |
+
),
|
60 |
+
'vk' => array(
|
61 |
+
'url' => 'https://vk.com/share.php?act=count&url=%s',
|
62 |
+
'method' => 'GET',
|
63 |
+
'timeout' => 1000,
|
64 |
+
'callback' => 'vk_count_callback',
|
65 |
+
),
|
66 |
+
'tumblr' => array(
|
67 |
+
'url' => 'https://api.tumblr.com/v2/share/stats?url=%s',
|
68 |
+
'method' => 'GET',
|
69 |
+
'timeout' => 1000,
|
70 |
+
'callback' => 'tumblr_count_callback',
|
71 |
+
),
|
72 |
+
'odnoklassniki' => array(
|
73 |
+
'url' => 'https://connect.ok.ru/dk?st.cmd=extLike&uid=odklcnt0&ref=%s',
|
74 |
+
'method' => 'GET',
|
75 |
+
'timeout' => 1000,
|
76 |
+
'callback' => 'odnoklassniki_count_callback',
|
77 |
+
),
|
78 |
+
'fancy' => array(
|
79 |
+
'url' => 'https://fancy.com/fancyit/count?ItemURL=%s',
|
80 |
+
'method' => 'GET',
|
81 |
+
'timeout' => 1000,
|
82 |
+
'callback' => 'fancy_count_callback',
|
83 |
+
),
|
84 |
+
'yummly' => array(
|
85 |
+
'url' => 'https://www.yummly.com/services/yum-count?url=%s',
|
86 |
+
'method' => 'GET',
|
87 |
+
'timeout' => 1000,
|
88 |
+
'callback' => 'yummly_count_callback',
|
89 |
+
),
|
90 |
+
);
|
91 |
+
}
|
92 |
|
93 |
+
/**
|
94 |
+
* Check if the url is encoded
|
95 |
+
*
|
96 |
+
* The check is very simple and will fail if the url is encoded
|
97 |
+
* more than once because the check only decodes once
|
98 |
+
*
|
99 |
+
* @param string $url the url to check if it is encoded.
|
100 |
+
* @return boolean true if the url is encoded and false otherwise
|
101 |
+
*/
|
102 |
+
public function is_url_encoded( $url ) {
|
103 |
+
$decoded = urldecode( $url );
|
104 |
+
if ( strcmp( $url, $decoded ) === 0 ) {
|
105 |
+
return false;
|
106 |
+
}
|
107 |
+
return true;
|
108 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
+
/**
|
111 |
+
* Check if calling the service returned any type of error
|
112 |
+
*
|
113 |
+
* @param object $response A response object.
|
114 |
+
* @return bool true if it has an error or false if it does not
|
115 |
+
*/
|
116 |
+
public function has_http_error( $response ) {
|
117 |
+
if ( ! $response || ! isset( $response['response']['code'] ) || ! preg_match( '/20*/', $response['response']['code'] ) || ! isset( $response['body'] ) ) {
|
118 |
+
return true;
|
119 |
+
}
|
120 |
+
return false;
|
121 |
+
}
|
|
|
|
|
|
|
|
|
122 |
|
123 |
+
/**
|
124 |
+
* Get the client's ip address
|
125 |
+
*
|
126 |
+
* NOTE: this function does not care if the IP is spoofed. This was used
|
127 |
+
* only by the google plus count API to separate server side calls in order
|
128 |
+
* to prevent usage limits. Under normal conditions, a request from a user's
|
129 |
+
* browser to this API should not involve any spoofing.
|
130 |
+
*
|
131 |
+
* @return {Mixed} An IP address as string or false otherwise
|
132 |
+
*/
|
133 |
+
public function get_client_ip() {
|
134 |
+
$ip = null;
|
135 |
|
136 |
+
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
|
137 |
+
// check for ip from share internet
|
138 |
+
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
139 |
+
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
|
140 |
+
// Check for the Proxy User
|
141 |
+
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
142 |
+
} else {
|
143 |
+
$ip = $_SERVER['REMOTE_ADDR'];
|
144 |
+
}
|
|
|
|
|
|
|
145 |
|
146 |
+
return $ip;
|
147 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
|
|
|
|
149 |
|
150 |
+
/**
|
151 |
+
* Callback function for facebook count API
|
152 |
+
* Gets the facebook counts from response
|
153 |
+
*
|
154 |
+
* @param Array $response The response from calling the API.
|
155 |
+
* @return mixed The counts from the API or false if error
|
156 |
+
*/
|
157 |
+
public function facebook_count_callback( $response, $facebook_access_token = false ) {
|
158 |
+
if ( $this->has_http_error( $response ) ) {
|
159 |
+
return false;
|
160 |
+
}
|
161 |
+
$body = json_decode( $response['body'], true );
|
162 |
+
$count = 0;
|
163 |
|
164 |
+
if ( $facebook_access_token ) {
|
165 |
+
if ( isset( $body['engagement']['share_count'] ) ) {
|
166 |
+
$count += $body['engagement']['share_count'];
|
167 |
+
}
|
168 |
+
if ( isset( $body['engagement']['reaction_count'] ) ) {
|
169 |
+
$count += $body['engagement']['reaction_count'];
|
170 |
+
}
|
171 |
+
if ( isset( $body['engagement']['comment_count'] ) ) {
|
172 |
+
$count += $body['engagement']['comment_count'];
|
173 |
+
}
|
174 |
+
return $count;
|
175 |
+
} else {
|
176 |
+
return isset( $body['og_object']['engagement']['count'] ) ? intval( $body['og_object']['engagement']['count'] ) : 0;
|
177 |
+
}
|
178 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
|
181 |
+
/**
|
182 |
+
* Callback function for pinterest count API
|
183 |
+
* Gets the pinterest counts from response
|
184 |
+
*
|
185 |
+
* @param Array $response The response from calling the API.
|
186 |
+
* @return mixed The counts from the API or false if error
|
187 |
+
*/
|
188 |
+
public function pinterest_count_callback( $response ) {
|
189 |
+
if ( $this->has_http_error( $response ) ) {
|
190 |
+
return false;
|
191 |
+
}
|
192 |
+
$response['body'] = substr( $response['body'], 2, strlen( $response['body'] ) - 3 );
|
193 |
+
$body = json_decode( $response['body'], true );
|
194 |
+
return isset( $body['count'] ) ? intval( $body['count'] ) : 0;
|
195 |
+
}
|
196 |
|
197 |
|
198 |
+
/**
|
199 |
+
* Callback function for buffer count API
|
200 |
+
* Gets the buffer share counts from response
|
201 |
+
*
|
202 |
+
* @param Array $response The response from calling the API.
|
203 |
+
* @return mixed The counts from the API or false if error
|
204 |
+
*/
|
205 |
+
public function buffer_count_callback( $response ) {
|
206 |
+
if ( $this->has_http_error( $response ) ) {
|
207 |
+
return false;
|
208 |
+
}
|
209 |
+
$body = json_decode( $response['body'], true );
|
210 |
+
return isset( $body['shares'] ) ? intval( $body['shares'] ) : 0;
|
211 |
+
}
|
212 |
|
213 |
|
214 |
+
/**
|
215 |
+
* Callback function for reddit count API
|
216 |
+
* Gets the reddit counts from response
|
217 |
+
*
|
218 |
+
* @param Array $response The response from calling the API.
|
219 |
+
* @return mixed The counts from the API or false if error
|
220 |
+
*/
|
221 |
+
public function reddit_count_callback( $response ) {
|
222 |
+
if ( $this->has_http_error( $response ) ) {
|
223 |
+
return false;
|
224 |
+
}
|
225 |
+
$body = json_decode( $response['body'], true );
|
226 |
+
// special case: do not return false if the ups is not set because the api can return it not set.
|
227 |
+
return isset( $body['data']['children'][0]['data']['ups'] ) ? intval( $body['data']['children'][0]['data']['ups'] ) : 0;
|
228 |
+
}
|
229 |
|
230 |
+
/**
|
231 |
+
* Callback function for vk count API
|
232 |
+
* Gets the vk counts from response
|
233 |
+
*
|
234 |
+
* @param Array $response The response from calling the API.
|
235 |
+
* @return mixed The counts from the API or false if error
|
236 |
+
*/
|
237 |
+
public function vk_count_callback( $response ) {
|
238 |
+
if ( $this->has_http_error( $response ) ) {
|
239 |
+
return false;
|
240 |
+
}
|
241 |
|
242 |
+
/*
|
243 |
+
This API does not return JSON. Just plain text JS. Example: 'VK.Share.count(0, 3779);'
|
244 |
+
From documentation, need to just grab the 2nd param: http://vk.com/developers.php?oid=-17680044&p=Share.
|
245 |
+
*/
|
246 |
+
$matches = array();
|
247 |
+
preg_match( '/^VK\.Share\.count\(\d, (\d+)\);$/i', $response['body'], $matches );
|
248 |
+
return isset( $matches[1] ) ? intval( $matches[1] ) : 0;
|
249 |
+
}
|
|
|
|
|
|
|
250 |
|
251 |
+
/**
|
252 |
+
* Callback function for odnoklassniki count API
|
253 |
+
* Gets the odnoklassniki counts from response
|
254 |
+
*
|
255 |
+
* @param Array $response The response from calling the API.
|
256 |
+
* @return mixed The counts from the API or false if error
|
257 |
+
*/
|
258 |
+
public function odnoklassniki_count_callback( $response ) {
|
259 |
+
if ( $this->has_http_error( $response ) ) {
|
260 |
+
return false;
|
261 |
+
}
|
262 |
|
263 |
+
// Similar to vk, extract the 2nd param from the response: 'ODKL.updateCount('odklcnt0','14198');'
|
264 |
+
$matches = array();
|
265 |
+
preg_match( '/^ODKL\.updateCount\(\'odklcnt0\',\'(\d+)\'\);$/i', $response['body'], $matches );
|
266 |
+
return isset( $matches[1] ) ? intval( $matches[1] ) : 0;
|
267 |
+
}
|
268 |
|
269 |
+
/**
|
270 |
+
* Callback function for Fancy count API
|
271 |
+
* Gets the Fancy counts from response
|
272 |
+
*
|
273 |
+
* @param Array $response The response from calling the API
|
274 |
+
* @return mixed The counts from the API or false if error
|
275 |
+
*/
|
276 |
+
public function fancy_count_callback( $response ) {
|
277 |
+
if ( $this->has_http_error( $response ) ) {
|
278 |
+
return false;
|
279 |
+
}
|
280 |
|
281 |
+
// Fancy always provides a JS callback like this in the response:
|
282 |
+
// '__FIB.collectCount({"url": "http://www.google.com", "count": 26, "thing_url": "http://fancy.com/things/263001623/Google%27s-Jim-Henson-75th-Anniversary-logo", "showcount": 1});'
|
283 |
+
// strip out the callback and parse the JSON from there
|
284 |
+
$response['body'] = str_replace( '__FIB.collectCount(', '', $response['body'] );
|
285 |
+
$response['body'] = substr( $response['body'], 0, strlen( $response['body'] ) - 2 );
|
|
|
286 |
|
287 |
+
$body = json_decode( $response['body'], true );
|
288 |
+
return isset( $body['count'] ) ? intval( $body['count'] ) : 0;
|
289 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
+
/**
|
292 |
+
* Callback function for Tumblr count API
|
293 |
+
* Gets the Tumblr counts from response
|
294 |
+
*
|
295 |
+
* @param Array $response The response from calling the API.
|
296 |
+
* @return mixed The counts from the API or false if error
|
297 |
+
*/
|
298 |
+
public function tumblr_count_callback( $response ) {
|
299 |
+
if ( $this->has_http_error( $response ) ) {
|
300 |
+
return false;
|
301 |
+
}
|
302 |
+
$body = json_decode( $response['body'], true );
|
303 |
+
return isset( $body['response']['note_count'] ) ? intval( $body['response']['note_count'] ) : 0;
|
304 |
+
}
|
305 |
|
306 |
+
/**
|
307 |
+
* Callback function for Yummly count API
|
308 |
+
* Gets the Yummly counts from response
|
309 |
+
*
|
310 |
+
* @param Array $response The response from calling the API.
|
311 |
+
* @return mixed The counts from the API or false if error
|
312 |
+
*/
|
313 |
+
public function yummly_count_callback( $response ) {
|
314 |
+
if ( $this->has_http_error( $response ) ) {
|
315 |
+
return false;
|
316 |
+
}
|
317 |
+
$body = json_decode( $response['body'], true );
|
318 |
+
return isset( $body['count'] ) ? intval( $body['count'] ) : 0;
|
319 |
+
}
|
|
|
|
|
|
|
|
|
320 |
|
321 |
+
/**
|
322 |
+
* The abstract function to be implemented by its children
|
323 |
+
* This function should get all the counts for the
|
324 |
+
* supported services
|
325 |
+
*
|
326 |
+
* It should return an associative array with the services as
|
327 |
+
* the keys and the counts as the value.
|
328 |
+
*
|
329 |
+
* Example:
|
330 |
+
* array('facebook' => 12, 'pinterest' => 0, 'twitter' => 14, ...);
|
331 |
+
*
|
332 |
+
* @return Array an associative array of service => counts
|
333 |
+
*/
|
334 |
+
abstract public function get_counts();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
|
336 |
+
}
|
lib/social-share-counts/wordpress_http.php
CHANGED
@@ -15,118 +15,122 @@
|
|
15 |
*/
|
16 |
class ShareaholicHttp {
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
return self::send_with_wp($url, $options, $ignore_error);
|
54 |
-
}
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
// Convert ms to seconds (WP native function accepts timeouts in seconds only)
|
66 |
-
$timeout_ms = isset($options['timeout']) ? $options['timeout'] : 15000;
|
67 |
-
$request['timeout'] = ceil($timeout_ms / 1000);
|
68 |
-
|
69 |
-
if(isset($options['body'])) {
|
70 |
-
if(isset($request['headers']['Content-Type']) && $request['headers']['Content-Type'] === 'application/json') {
|
71 |
-
$request['body'] = json_encode($options['body']);
|
72 |
-
} else {
|
73 |
-
$request['body'] = $options['body'];
|
74 |
-
}
|
75 |
-
} else {
|
76 |
-
$request['body'] = NULL;
|
77 |
-
}
|
78 |
-
$request['sslverify'] = false;
|
79 |
|
80 |
-
|
|
|
|
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
*/
|
16 |
class ShareaholicHttp {
|
17 |
|
18 |
+
/**
|
19 |
+
* Performs a HTTP request with a url, array of options, and ignore_error flag
|
20 |
+
*
|
21 |
+
* The options object is an associative array that takes the following options:
|
22 |
+
* - method: The http method for the request as a string. Defaults is 'GET'.
|
23 |
+
*
|
24 |
+
* - headers: The headers to send with the request as an associative array of name/value pairs. Default is empty array.
|
25 |
+
*
|
26 |
+
* - body: The body to send with the request as an associative array of name/value pairs. Default is NULL.
|
27 |
+
* If the body is meant to be parsed as json, specify the content type in the headers option to be 'application/json'.
|
28 |
+
*
|
29 |
+
* - redirection: The number of redirects to follow for this request as an integer, Default is 5.
|
30 |
+
*
|
31 |
+
* - timeout: The number of milliseconds the request should take. Default is 15000 milliseconds. Note that this is rounded up to nearest second.
|
32 |
+
*
|
33 |
+
* - user-agent: The useragent for the request. Default is mozilla browser useragent.
|
34 |
+
*
|
35 |
+
*
|
36 |
+
* This function returns an object on success or false if there were errors.
|
37 |
+
* The object is an associative array with the following keys:
|
38 |
+
* - headers: the response headers as an array of key/value pairs
|
39 |
+
* - body: the response body as a string
|
40 |
+
* - response: an array with the following keys:
|
41 |
+
* - code: the response code
|
42 |
+
* - message: the status message
|
43 |
+
*
|
44 |
+
* @param string $url The url you are sending the request to.
|
45 |
+
* @param array $options An array of supported options to pass to the request.
|
46 |
+
* @param bool $ignore_error A flag indicating to log error or not. Default is false.
|
47 |
+
*
|
48 |
+
* @return mixed It returns an associative array of name value pairs or false if there was an error.
|
49 |
+
*/
|
50 |
+
public static function send( $url, $options = array(), $ignore_error = true ) {
|
51 |
+
return self::send_with_wp( $url, $options, $ignore_error );
|
52 |
+
}
|
|
|
|
|
53 |
|
54 |
+
private static function send_with_wp( $url, $options, $ignore_error ) {
|
55 |
+
$request = array();
|
56 |
+
$result = array();
|
57 |
+
$meta = array();
|
58 |
+
$request['method'] = isset( $options['method'] ) ? $options['method'] : 'GET';
|
59 |
+
$request['headers'] = isset( $options['headers'] ) ? $options['headers'] : array();
|
60 |
+
$request['redirection'] = isset( $options['redirection'] ) ? $options['redirection'] : 5;
|
61 |
+
$request['user-agent'] = isset( $options['user-agent'] ) ? $options['user-agent'] : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
+
// Convert ms to seconds (WP native function accepts timeouts in seconds only)
|
64 |
+
$timeout_ms = isset( $options['timeout'] ) ? $options['timeout'] : 15000;
|
65 |
+
$request['timeout'] = ceil( $timeout_ms / 1000 );
|
66 |
|
67 |
+
if ( isset( $options['body'] ) ) {
|
68 |
+
if ( isset( $request['headers']['Content-Type'] ) && $request['headers']['Content-Type'] === 'application/json' ) {
|
69 |
+
$request['body'] = json_encode( $options['body'] );
|
70 |
+
} else {
|
71 |
+
$request['body'] = $options['body'];
|
72 |
+
}
|
73 |
+
} else {
|
74 |
+
$request['body'] = null;
|
75 |
+
}
|
76 |
+
$request['sslverify'] = false;
|
77 |
+
|
78 |
+
$response = wp_remote_request( $url, $request );
|
79 |
+
|
80 |
+
if ( is_wp_error( $response ) ) {
|
81 |
+
$error_message = $response->get_error_message();
|
82 |
+
ShareaholicUtilities::log( $error_message );
|
83 |
+
if ( ! $ignore_error ) {
|
84 |
+
ShareaholicUtilities::log_event(
|
85 |
+
'HttpRequestFailure',
|
86 |
+
array(
|
87 |
+
'error_message' => $error_message,
|
88 |
+
'url' => $url,
|
89 |
+
)
|
90 |
+
);
|
91 |
+
}
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
|
95 |
+
// Include Response Headers?
|
96 |
+
$show_response_header = isset( $options['show_response_header'] ) ? $options['show_response_header'] : '0';
|
97 |
+
|
98 |
+
// Whitelisted Headers
|
99 |
+
$aHeaders = array(
|
100 |
+
'x-app-usage' => $response['headers']['x-app-usage'],
|
101 |
+
);
|
102 |
+
|
103 |
+
// Remove entry from array if value is blank.
|
104 |
+
foreach ( $aHeaders as $key => $value ) {
|
105 |
+
if ( is_null( $value ) || $value == '' ) {
|
106 |
+
unset( $aHeaders[ $key ] );
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( $show_response_header == '1' ) {
|
111 |
+
$result_response_headers = array(
|
112 |
+
'response' => array(
|
113 |
+
'header' => $aHeaders,
|
114 |
+
'code' => wp_remote_retrieve_response_code( $response ),
|
115 |
+
),
|
116 |
+
);
|
117 |
+
$meta = array_merge( $meta, $result_response_headers );
|
118 |
+
}
|
119 |
+
|
120 |
+
// Include Raw Body & Headers?
|
121 |
+
$show_raw = isset( $options['show_raw'] ) ? $options['show_raw'] : '1';
|
122 |
+
if ( $show_raw == '1' ) {
|
123 |
+
$result_raw = array(
|
124 |
+
'raw' => array(
|
125 |
+
'body' => wp_remote_retrieve_body( $response ),
|
126 |
+
'headers' => 'n/a',
|
127 |
+
),
|
128 |
+
);
|
129 |
+
$meta = array_merge( $meta, $result_raw );
|
130 |
+
}
|
131 |
+
|
132 |
+
$response['meta'] = $meta;
|
133 |
+
|
134 |
+
return $response;
|
135 |
+
}
|
136 |
+
}
|
public_js.php
CHANGED
@@ -33,7 +33,7 @@ class ShareaholicPublicJS {
|
|
33 |
$share_counts_connect_check = ShareaholicUtilities::get_option( 'share_counts_connect_check' );
|
34 |
|
35 |
if ( isset( $disable_share_counts_api ) ) {
|
36 |
-
if ( isset( $share_counts_connect_check ) &&
|
37 |
$base_settings['endpoints']['share_counts_url'] = admin_url( 'admin-ajax.php' ) . '?action=shareaholic_share_counts_api';
|
38 |
}
|
39 |
}
|
@@ -43,7 +43,7 @@ class ShareaholicPublicJS {
|
|
43 |
$base_settings['user']['capabilities']['publish_posts'] = true;
|
44 |
}
|
45 |
|
46 |
-
// Used by Share Count Recovery
|
47 |
if ( is_singular() ) {
|
48 |
global $post;
|
49 |
|
@@ -58,7 +58,7 @@ class ShareaholicPublicJS {
|
|
58 |
$base_settings['url_components']['post_id'] = "$post->ID";
|
59 |
$base_settings['url_components']['postname'] = $post->post_name;
|
60 |
|
61 |
-
if ( ShareaholicUtilities::get_option( 'enable_user_nicename' )
|
62 |
$base_settings['url_components']['author'] = get_the_author_meta( 'user_nicename', $post->post_author );
|
63 |
}
|
64 |
|
@@ -82,12 +82,12 @@ class ShareaholicPublicJS {
|
|
82 |
|
83 |
$category_object = get_term( $category_object, 'category' );
|
84 |
$category = $category_object->slug;
|
85 |
-
if ( $
|
86 |
-
$category = get_category_parents( $parent, false, '/', true ) . $category;
|
87 |
}
|
88 |
}
|
89 |
-
//
|
90 |
-
// having to assign it explicitly
|
91 |
if ( empty( $category ) ) {
|
92 |
$default_category = get_term( get_option( 'default_category' ), 'category' );
|
93 |
if ( $default_category && ! is_wp_error( $default_category ) ) {
|
33 |
$share_counts_connect_check = ShareaholicUtilities::get_option( 'share_counts_connect_check' );
|
34 |
|
35 |
if ( isset( $disable_share_counts_api ) ) {
|
36 |
+
if ( isset( $share_counts_connect_check ) && 'SUCCESS' === $share_counts_connect_check && 'on' !== $disable_share_counts_api ) {
|
37 |
$base_settings['endpoints']['share_counts_url'] = admin_url( 'admin-ajax.php' ) . '?action=shareaholic_share_counts_api';
|
38 |
}
|
39 |
}
|
43 |
$base_settings['user']['capabilities']['publish_posts'] = true;
|
44 |
}
|
45 |
|
46 |
+
// Used by Share Count Recovery.
|
47 |
if ( is_singular() ) {
|
48 |
global $post;
|
49 |
|
58 |
$base_settings['url_components']['post_id'] = "$post->ID";
|
59 |
$base_settings['url_components']['postname'] = $post->post_name;
|
60 |
|
61 |
+
if ( ShareaholicUtilities::get_option( 'enable_user_nicename' ) === 'on' ) {
|
62 |
$base_settings['url_components']['author'] = get_the_author_meta( 'user_nicename', $post->post_author );
|
63 |
}
|
64 |
|
82 |
|
83 |
$category_object = get_term( $category_object, 'category' );
|
84 |
$category = $category_object->slug;
|
85 |
+
if ( $category_object->parent ) {
|
86 |
+
$category = get_category_parents( $category_object->parent, false, '/', true ) . $category;
|
87 |
}
|
88 |
}
|
89 |
+
// Show default category in permalinks,
|
90 |
+
// without having to assign it explicitly.
|
91 |
if ( empty( $category ) ) {
|
92 |
$default_category = get_term( get_option( 'default_category' ), 'category' );
|
93 |
if ( $default_category && ! is_wp_error( $default_category ) ) {
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: social, social sharing, google analytics, pinterest, twitter, share butto
|
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.4
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 9.
|
8 |
|
9 |
|
10 |
Boost Audience Engagement with Award Winning Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
|
@@ -16,7 +16,7 @@ Shareaholic is the **world's leading suite of Audience Growth & Engagement tools
|
|
16 |
|
17 |
This plugin makes it easy for any website — big or small — to engage and grow their traffic, market their content, gain insight, and monetize their audience. And it all lives in one simple dashboard.
|
18 |
|
19 |
-
This single plugin combines the functionality of many -- social, content, and monetization plugins including: JetPack, Contextual Related Posts (CRP), Social Warfare, Tasty Pins, Social Pug,
|
20 |
|
21 |
We do all this in a lightweight & lightening fast package by using [advanced code optimization techniques](https://support.shareaholic.com/hc/en-us/articles/204339849-Shareaholic-and-Site-Page-Speed) such a selective and lazy loading. The plugin loads just the functionality that you have selected and when necessary.
|
22 |
|
@@ -100,9 +100,8 @@ To take advantage of this privacy feature, enable "Share Count Proxy" under Adva
|
|
100 |
|
101 |
* Actively notify your visitors that your site uses cookies through a message bar at the top or bottom of your page
|
102 |
* Target EU and EEA visitors specifically or show to everyone
|
103 |
-
* Supports both IPv4 and IPv6 IP
|
104 |
-
|
105 |
-
Learn more about [Cookie Consent Notice](https://www.shareaholic.com/blog/cookie-consent-banner-app/)
|
106 |
|
107 |
= Monetize your Site =
|
108 |
|
@@ -310,6 +309,10 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
|
|
310 |
Each time you change Shareaholic's thumbnail dimensions like this, you will probably want to have WordPress regenerate appropriate sized thumbnails for all of your images. We highly recommend the [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) plugin for this purpose.
|
311 |
|
312 |
== Changelog ==
|
|
|
|
|
|
|
|
|
313 |
= 9.2.0 (2020-04-07) =
|
314 |
* Enhancement: Hook to change the priority number in content, example: `add_filter( 'shareaholic_content_priority', 20 );`
|
315 |
* Enhancement: Don't add content to `get_the_excerpt` because it's too early and strips tags
|
@@ -1041,7 +1044,7 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
|
|
1041 |
* Show Related Posts data status
|
1042 |
|
1043 |
== Upgrade Notice ==
|
1044 |
-
= 9.
|
1045 |
We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!
|
1046 |
|
1047 |
= 8.12.1 =
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.4
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 9.3.0
|
8 |
|
9 |
|
10 |
Boost Audience Engagement with Award Winning Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
|
16 |
|
17 |
This plugin makes it easy for any website — big or small — to engage and grow their traffic, market their content, gain insight, and monetize their audience. And it all lives in one simple dashboard.
|
18 |
|
19 |
+
This single plugin combines the functionality of many -- social, content, and monetization plugins including: JetPack, Contextual Related Posts (CRP), Social Warfare, Tasty Pins, Social Pug, Grow by Mediavine, Zemanta, SexyBookmarks, Shariff, AddThis, AddToAny, and many others.
|
20 |
|
21 |
We do all this in a lightweight & lightening fast package by using [advanced code optimization techniques](https://support.shareaholic.com/hc/en-us/articles/204339849-Shareaholic-and-Site-Page-Speed) such a selective and lazy loading. The plugin loads just the functionality that you have selected and when necessary.
|
22 |
|
100 |
|
101 |
* Actively notify your visitors that your site uses cookies through a message bar at the top or bottom of your page
|
102 |
* Target EU and EEA visitors specifically or show to everyone
|
103 |
+
* Supports both IPv4 and IPv6 IP address lookups for maximum geo accuracy
|
104 |
+
* Learn more about [Cookie Consent Notice](https://www.shareaholic.com/blog/cookie-consent-banner-app/)
|
|
|
105 |
|
106 |
= Monetize your Site =
|
107 |
|
309 |
Each time you change Shareaholic's thumbnail dimensions like this, you will probably want to have WordPress regenerate appropriate sized thumbnails for all of your images. We highly recommend the [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) plugin for this purpose.
|
310 |
|
311 |
== Changelog ==
|
312 |
+
= 9.3.0 (2020-05-18) =
|
313 |
+
* New: Display optional feedback form on plugin deactivation
|
314 |
+
* Code style standards improvements to match WordPress official spec
|
315 |
+
|
316 |
= 9.2.0 (2020-04-07) =
|
317 |
* Enhancement: Hook to change the priority number in content, example: `add_filter( 'shareaholic_content_priority', 20 );`
|
318 |
* Enhancement: Don't add content to `get_the_excerpt` because it's too early and strips tags
|
1044 |
* Show Related Posts data status
|
1045 |
|
1046 |
== Upgrade Notice ==
|
1047 |
+
= 9.3.0 =
|
1048 |
We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!
|
1049 |
|
1050 |
= 8.12.1 =
|
shareaholic.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Shareaholic - Grow and Engage Your Audience
|
4 |
Plugin URI: https://www.shareaholic.com/website-tools/
|
5 |
Description: Shareaholic’s official WordPress plugin allows you to add Award-Winning Social Share Buttons, Related Posts, Content Analytics, Ad Monetization, and more to your website.
|
6 |
-
Version: 9.
|
7 |
Author: Shareaholic
|
8 |
Author URI: https://www.shareaholic.com
|
9 |
Text Domain: shareaholic
|
@@ -14,7 +14,7 @@ Domain Path: /languages
|
|
14 |
* The main file!
|
15 |
*
|
16 |
* @package shareaholic
|
17 |
-
* @version 9.
|
18 |
*/
|
19 |
|
20 |
/**
|
@@ -71,7 +71,7 @@ if ( ! class_exists( 'Shareaholic' ) ) {
|
|
71 |
const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
72 |
const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
73 |
|
74 |
-
const VERSION = '9.
|
75 |
|
76 |
/**
|
77 |
* Starts off as false so that ::get_instance() returns
|
3 |
Plugin Name: Shareaholic - Grow and Engage Your Audience
|
4 |
Plugin URI: https://www.shareaholic.com/website-tools/
|
5 |
Description: Shareaholic’s official WordPress plugin allows you to add Award-Winning Social Share Buttons, Related Posts, Content Analytics, Ad Monetization, and more to your website.
|
6 |
+
Version: 9.3.0
|
7 |
Author: Shareaholic
|
8 |
Author URI: https://www.shareaholic.com
|
9 |
Text Domain: shareaholic
|
14 |
* The main file!
|
15 |
*
|
16 |
* @package shareaholic
|
17 |
+
* @version 9.3.0
|
18 |
*/
|
19 |
|
20 |
/**
|
71 |
const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
72 |
const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
73 |
|
74 |
+
const VERSION = '9.3.0';
|
75 |
|
76 |
/**
|
77 |
* Starts off as false so that ::get_instance() returns
|
templates/admin.php
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
<?php if ( $api_key ) { ?>
|
2 |
-
|
3 |
<?php ShareaholicAdmin::show_header(); ?>
|
4 |
-
|
5 |
-
|
6 |
<!-- h2 tag needed for WP to know where to place notices -->
|
7 |
<h2 class="shareaholic-settings-h2"></h2>
|
8 |
<script>
|
9 |
window.ShareaholicConfig = {
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
};
|
19 |
</script>
|
20 |
|
21 |
<div id="root" class="shr-site-settings"></div>
|
22 |
|
23 |
<script class="shr-app-loader__site-settings" src="<?php echo ShareaholicUtilities::asset_url_admin( 'ui-site-settings/loader.js' ); ?>"></script>
|
24 |
-
|
25 |
|
26 |
<?php } ?>
|
27 |
|
1 |
<?php if ( $api_key ) { ?>
|
2 |
+
|
3 |
<?php ShareaholicAdmin::show_header(); ?>
|
4 |
+
|
5 |
+
<div class='wrap'>
|
6 |
<!-- h2 tag needed for WP to know where to place notices -->
|
7 |
<h2 class="shareaholic-settings-h2"></h2>
|
8 |
<script>
|
9 |
window.ShareaholicConfig = {
|
10 |
+
apiKey: "<?php echo $api_key; ?>",
|
11 |
+
token: "<?php echo $jwt; ?>",
|
12 |
+
apiHost: "<?php echo Shareaholic::API_URL; ?>",
|
13 |
+
serviceHost: "<?php echo Shareaholic::URL; ?>",
|
14 |
+
assetHost: "<?php echo ShareaholicUtilities::asset_url_admin(); ?>",
|
15 |
+
assetFolders: true,
|
16 |
+
origin: "wp_plugin",
|
17 |
+
language: "<?php echo strtolower( get_bloginfo( 'language' ) ); ?>"
|
18 |
};
|
19 |
</script>
|
20 |
|
21 |
<div id="root" class="shr-site-settings"></div>
|
22 |
|
23 |
<script class="shr-app-loader__site-settings" src="<?php echo ShareaholicUtilities::asset_url_admin( 'ui-site-settings/loader.js' ); ?>"></script>
|
24 |
+
</div>
|
25 |
|
26 |
<?php } ?>
|
27 |
|
templates/admin_form.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<form name="shareaholic_settings" method="post" action="<?php echo $action; ?>">
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
</form>
|
1 |
<form name="shareaholic_settings" method="post" action="<?php echo $action; ?>">
|
2 |
+
<input type="hidden" name="already_submitted" value="Y">
|
3 |
+
<p>API Key:<input type="text" name="shareaholic_api_key" value="<?php echo $api_key; ?>" size="30"></p>
|
4 |
+
<p class="submit">
|
5 |
+
<input type="submit" name="Submit" value="Update Options" />
|
6 |
+
</p>
|
7 |
</form>
|
templates/advanced_settings.php
CHANGED
@@ -2,37 +2,35 @@
|
|
2 |
|
3 |
<script>
|
4 |
window.ShareaholicConfig = {
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
};
|
12 |
</script>
|
13 |
|
14 |
<div class='wrap'>
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
<div class="row">
|
20 |
-
|
21 |
<?php _e( 'After changing any Shareaholic plugin setting, it is good practice to clear any WordPress caching plugins like W3 Total Cache or WP Super Cache.', 'shareaholic' ); ?>
|
22 |
-
|
23 |
<div class='clear'></div>
|
24 |
-
|
25 |
<div class="app">
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
</div>
|
30 |
-
|
31 |
<div class='clear'></div>
|
32 |
|
33 |
<div class="app">
|
34 |
-
|
35 |
-
|
36 |
<?php
|
37 |
if ( ShareaholicUtilities::get_option( 'api_key' ) ) {
|
38 |
echo '<code style="font-size: 16px;">' . ShareaholicUtilities::get_option( 'api_key' ) . '</code>';
|
@@ -40,51 +38,51 @@ window.ShareaholicConfig = {
|
|
40 |
_e( 'Not set.', 'shareaholic' );
|
41 |
}
|
42 |
?>
|
43 |
-
|
44 |
</div>
|
45 |
-
|
46 |
<div class='clear'></div>
|
47 |
-
|
48 |
<div class="app">
|
49 |
-
|
50 |
-
|
51 |
<?php if ( ShareaholicUtilities::connectivity_check() == 'SUCCESS' ) { ?>
|
52 |
-
|
53 |
-
|
54 |
<?php } else { // can't connect to any server ?>
|
55 |
-
|
56 |
-
|
57 |
<?php } ?>
|
58 |
|
59 |
<?php if ( ShareaholicUtilities::get_option( 'disable_internal_share_counts_api' ) == null || ShareaholicUtilities::get_option( 'disable_internal_share_counts_api' ) == 'off' ) { ?>
|
60 |
<?php if ( ShareaholicUtilities::share_counts_api_connectivity_check() == 'SUCCESS' ) { ?>
|
61 |
<span class="key-status passed"><i class="fa fa-circle green" aria-hidden="true"></i> <?php _e( 'Server-side Share Counts API is reachable', 'shareaholic' ); ?></span>
|
62 |
<p class="key-description"><?php _e( 'The server-side Share Counts API should be working correctly.', 'shareaholic' ); ?> <?php _e( 'All servers and services needed by the API are accessible.', 'shareaholic' ); ?></p>
|
63 |
-
|
64 |
<span class="key-status failed"><i class="fa fa-circle red blink" aria-hidden="true"></i> <?php _e( 'Unable to reach the server-side Share Count API', 'shareaholic' ); ?></span> <a href="#" onClick="window.location.reload(); this.innerHTML='<?php _e( 'Checking...', 'shareaholic' ); ?>';"><?php _e( 'Re-check', 'shareaholic' ); ?></a>
|
65 |
-
<p class="key-description"><?php echo sprintf( __( 'A network problem or firewall is blocking connections from your web server to various Share Count APIs.
|
66 |
-
|
67 |
<?php } ?>
|
68 |
-
|
69 |
</div>
|
70 |
-
|
71 |
<div class='clear'></div>
|
72 |
-
|
73 |
<div class="app">
|
74 |
-
|
75 |
-
|
76 |
<?php echo sprintf( __( 'Connecting this plugin to a free Shareaholic account is highly recommended. Doing so will unlock additional functionality that requires authentication such as site ownership verification, team features and site integrations like Google Analytics.', 'shareaholic' ) ); ?>
|
77 |
<div class="button-wrapper">
|
78 |
-
|
|
|
79 |
</div>
|
80 |
-
</div>
|
81 |
</div>
|
82 |
-
|
83 |
<div class='clear'></div>
|
84 |
-
|
85 |
<div class="app">
|
86 |
-
|
87 |
-
|
88 |
<?php
|
89 |
$sync_status = ShareaholicUtilities::location_sync_status();
|
90 |
if ( $sync_status == 200 ) {
|
@@ -95,50 +93,49 @@ window.ShareaholicConfig = {
|
|
95 |
<?php } else { ?>
|
96 |
<span class="key-status unknown"><?php _e( 'Sync Status Unknown', 'shareaholic' ); ?></span>
|
97 |
<?php } ?>
|
98 |
-
|
99 |
</div>
|
100 |
-
|
101 |
-
|
102 |
<div class='clear'></div>
|
103 |
|
104 |
<form name='advanced_settings' method='post' action='<?php echo $action; ?>'>
|
105 |
<?php wp_nonce_field( $action, 'nonce_field' ); ?>
|
106 |
<input type='hidden' name='already_submitted' value='Y'>
|
107 |
-
|
108 |
<div class="app">
|
109 |
-
|
110 |
-
|
111 |
|
112 |
<div class="shr-form-item">
|
113 |
-
|
114 |
<?php if ( isset( $settings['enable_user_nicename'] ) ) { ?>
|
115 |
<?php echo ( $settings['enable_user_nicename'] == 'on' ? 'checked' : '' ); ?>
|
116 |
-
|
117 |
<label for="user_nicename"> <?php echo sprintf( __( 'Enable <code>%author%</code> permalink tag for Share Count Recovery', 'shareaholic' ) ); ?></label>
|
118 |
</div>
|
119 |
|
120 |
<div class="shr-form-item">
|
121 |
-
|
122 |
<?php if ( isset( $settings['disable_internal_share_counts_api'] ) ) { ?>
|
123 |
<?php echo ( $settings['disable_internal_share_counts_api'] == 'on' ? 'checked' : '' ); ?>
|
124 |
-
|
125 |
-
|
126 |
</div>
|
127 |
|
128 |
<?php if ( isset( $settings['disable_internal_share_counts_api'] ) && $settings['disable_internal_share_counts_api'] != 'on' ) { ?>
|
129 |
-
|
130 |
-
|
131 |
<?php _e( 'Facebook', 'shareaholic' ); ?>
|
132 |
|
133 |
-
|
134 |
<span class="key-status passed"><i class="fa fa-circle green" aria-hidden="true"></i> <?php _e( 'Live', 'shareaholic' ); ?></span>
|
135 |
-
|
136 |
<span class="key-status failed"><i class="fa fa-circle red blink" aria-hidden="true"></i> <?php _e( 'Missing or Invalid Credentials', 'shareaholic' ); ?></span></a>
|
137 |
-
|
|
|
|
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
<div class="shr-form-item shr-form-text">
|
142 |
<label for="facebook_app_id"><?php _e( 'Facebook App ID', 'shareaholic' ); ?></label><br>
|
143 |
<input class="regular-text" id="facebook_app_id" type="text" name='shareaholic[facebook_app_id]' value="
|
144 |
<?php
|
@@ -146,8 +143,8 @@ window.ShareaholicConfig = {
|
|
146 |
echo $settings['facebook_app_id'];}
|
147 |
?>
|
148 |
">
|
149 |
-
|
150 |
-
|
151 |
<label for="facebook_app_secret"><?php _e( 'Facebook App Secret', 'shareaholic' ); ?></label><br>
|
152 |
<input class="regular-text" id="facebook_app_secret" type="text" name='shareaholic[facebook_app_secret]' value="
|
153 |
<?php
|
@@ -155,80 +152,80 @@ window.ShareaholicConfig = {
|
|
155 |
echo $settings['facebook_app_secret'];}
|
156 |
?>
|
157 |
">
|
158 |
-
|
159 |
-
|
160 |
<?php echo sprintf( __( 'Required for better Facebook Share Counts. Please %1$sfollow documentation%2$s to get your Facebook App ID and Secret.', 'shareaholic' ), '<a href="https://support.shareaholic.com/hc/en-us/articles/360028605231" target="_blank">', '</a>' ); ?>
|
161 |
</fieldset>
|
162 |
<?php } ?>
|
163 |
|
164 |
<div class="button-wrapper">
|
165 |
-
|
|
|
166 |
</div>
|
167 |
-
</div>
|
168 |
</div>
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
<div class="app">
|
173 |
-
|
174 |
-
|
175 |
<div class="shr-form-item">
|
176 |
-
|
177 |
<?php if ( isset( $settings['disable_og_tags'] ) ) { ?>
|
178 |
<?php echo ( $settings['disable_og_tags'] == 'on' ? 'checked' : '' ); ?>
|
179 |
-
|
180 |
<label for="og_tags"> <?php echo sprintf( __( 'Disable <code>Open Graph</code> tags', 'shareaholic' ) ); ?> <?php echo sprintf( __( '(it is recommended NOT to disable open graph tags)', 'shareaholic' ) ); ?></label>
|
181 |
</div>
|
182 |
<div class="shr-form-item">
|
183 |
-
|
184 |
<?php if ( isset( $settings['disable_admin_bar_menu'] ) ) { ?>
|
185 |
<?php echo ( $settings['disable_admin_bar_menu'] == 'on' ? 'checked' : '' ); ?>
|
186 |
-
|
187 |
<label for="admin_bar"> <?php echo sprintf( __( 'Disable Admin Bar Menu (requires page refresh)', 'shareaholic' ) ); ?></label>
|
188 |
</div>
|
189 |
<div class="shr-form-item">
|
190 |
-
|
191 |
<?php if ( isset( $settings['disable_review_notice'] ) ) { ?>
|
192 |
<?php echo ( $settings['disable_review_notice'] == 'on' ? 'checked' : '' ); ?>
|
193 |
-
|
194 |
<label for="review_notice"> <?php echo sprintf( __( 'Disable Review Notice', 'shareaholic' ) ); ?></label>
|
195 |
</div>
|
196 |
<div class="shr-form-item">
|
197 |
-
|
198 |
<?php if ( isset( $settings['disable_debug_info'] ) ) { ?>
|
199 |
<?php echo ( $settings['disable_debug_info'] == 'on' ? 'checked' : '' ); ?>
|
200 |
-
|
201 |
<label for="debugger"> <?php echo sprintf( __( 'Disable Debugger (it is recommended NOT to disable the debugger)', 'shareaholic' ) ); ?></label>
|
202 |
</div>
|
203 |
<div class="button-wrapper">
|
204 |
-
|
|
|
205 |
</div>
|
206 |
-
</div>
|
207 |
</div>
|
208 |
-
|
209 |
</form>
|
210 |
-
|
211 |
<div class='clear'></div>
|
212 |
-
|
213 |
<form name='reset_settings' method='post' action='<?php echo $action; ?>'>
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
<h2><?php _e( 'Reset Plugin', 'shareaholic' ); ?></h2>
|
218 |
<div class="app-content">
|
219 |
-
|
220 |
-
|
221 |
<input class="btn btn-danger btn-medium" type='submit' onclick="this.value='<?php _e( 'Resetting Plugin...', 'shareaholic' ); ?>';" value='<?php _e( 'Reset Plugin', 'shareaholic' ); ?>'>
|
222 |
-
|
223 |
-
</div>
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
</form>
|
229 |
-
|
|
|
230 |
</div>
|
231 |
-
</div>
|
232 |
</div>
|
233 |
|
234 |
<?php ShareaholicAdmin::show_footer(); ?>
|
2 |
|
3 |
<script>
|
4 |
window.ShareaholicConfig = {
|
5 |
+
apiHost: "<?php echo Shareaholic::API_URL; ?>",
|
6 |
+
serviceHost: "<?php echo Shareaholic::URL; ?>",
|
7 |
+
assetHost: "<?php echo ShareaholicUtilities::asset_url_admin(); ?>",
|
8 |
+
assetFolders: true,
|
9 |
+
origin: "wp_plugin",
|
10 |
+
language: "<?php echo strtolower( get_bloginfo( 'language' ) ); ?>"
|
11 |
};
|
12 |
</script>
|
13 |
|
14 |
<div class='wrap'>
|
15 |
+
<h2><?php _e( 'Plugin Settings', 'shareaholic' ); ?></h2>
|
16 |
+
<div style="margin-top:10px;"></div>
|
17 |
+
|
18 |
+
<div class="container-fluid">
|
19 |
<div class="row">
|
20 |
+
<div class="col-md-12">
|
21 |
<?php _e( 'After changing any Shareaholic plugin setting, it is good practice to clear any WordPress caching plugins like W3 Total Cache or WP Super Cache.', 'shareaholic' ); ?>
|
|
|
22 |
<div class='clear'></div>
|
|
|
23 |
<div class="app">
|
24 |
+
<h2><?php echo sprintf( __( 'Getting Started' ) ); ?></h2>
|
25 |
+
<p><?php echo sprintf( __( '%1$sLearn the basics of how to get started and configure Shareaholic through our popular WordPress plugin.%2$s', 'shareaholic' ), '<a href="https://support.shareaholic.com/hc/en-us/categories/200101476-WordPress-Plugin" target="_blank">', '</a>' ); ?> <?php echo sprintf( __( 'If you are upgrading from an earlier version of Shareaholic for WordPress and need help, have a question or have a bug to report, please %1$slet us know%2$s.', 'shareaholic' ), '<a href="https://www.shareaholic.com/help/message" target="_blank">', '</a>' ); ?>
|
26 |
+
</p>
|
27 |
</div>
|
28 |
+
|
29 |
<div class='clear'></div>
|
30 |
|
31 |
<div class="app">
|
32 |
+
<h2><?php _e( 'Shareaholic Site Profile ID', 'shareaholic' ); ?></h2>
|
33 |
+
<div class="app-content">
|
34 |
<?php
|
35 |
if ( ShareaholicUtilities::get_option( 'api_key' ) ) {
|
36 |
echo '<code style="font-size: 16px;">' . ShareaholicUtilities::get_option( 'api_key' ) . '</code>';
|
38 |
_e( 'Not set.', 'shareaholic' );
|
39 |
}
|
40 |
?>
|
41 |
+
</div>
|
42 |
</div>
|
43 |
+
|
44 |
<div class='clear'></div>
|
45 |
+
|
46 |
<div class="app">
|
47 |
+
<h2><?php _e( 'Server Connectivity', 'shareaholic' ); ?></h2>
|
48 |
+
<div class="app-content">
|
49 |
<?php if ( ShareaholicUtilities::connectivity_check() == 'SUCCESS' ) { ?>
|
50 |
+
<span class="key-status passed"><i class="fa fa-circle green" aria-hidden="true"></i> <?php _e( 'Shareaholic.com Cloud servers are reachable', 'shareaholic' ); ?></span>
|
51 |
+
<p class="key-description"><?php _e( 'Shareaholic plugin should be working correctly.', 'shareaholic' ); ?> <?php _e( 'All Shareaholic Cloud servers are accessible.', 'shareaholic' ); ?></p>
|
52 |
<?php } else { // can't connect to any server ?>
|
53 |
+
<span class="key-status failed"><i class="fa fa-circle red blink" aria-hidden="true"></i> <?php _e( 'Unable to reach any Shareaholic server', 'shareaholic' ); ?></span> <a href="#" onClick="window.location.reload(); this.innerHTML='<?php _e( 'Checking...', 'shareaholic' ); ?>';"><?php _e( 'Re-check', 'shareaholic' ); ?></a>
|
54 |
+
<p class="key-description"><?php echo sprintf( __( 'A network problem or firewall is blocking connections from your web server to Shareaholic.com. <strong>Shareaholic cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%1$s" target="_blank">this information about Shareaholic and firewalls</a>. <a href="#" class="%2$s">Let us know too</a>, so we can follow up!' ), 'https://www.shareaholic.com/blog/shareaholic-hosting-faq/', 'drift-open-chat', '</a>' ); ?></p>
|
55 |
<?php } ?>
|
56 |
|
57 |
<?php if ( ShareaholicUtilities::get_option( 'disable_internal_share_counts_api' ) == null || ShareaholicUtilities::get_option( 'disable_internal_share_counts_api' ) == 'off' ) { ?>
|
58 |
<?php if ( ShareaholicUtilities::share_counts_api_connectivity_check() == 'SUCCESS' ) { ?>
|
59 |
<span class="key-status passed"><i class="fa fa-circle green" aria-hidden="true"></i> <?php _e( 'Server-side Share Counts API is reachable', 'shareaholic' ); ?></span>
|
60 |
<p class="key-description"><?php _e( 'The server-side Share Counts API should be working correctly.', 'shareaholic' ); ?> <?php _e( 'All servers and services needed by the API are accessible.', 'shareaholic' ); ?></p>
|
61 |
+
<?php } else { // can't connect to any server ?>
|
62 |
<span class="key-status failed"><i class="fa fa-circle red blink" aria-hidden="true"></i> <?php _e( 'Unable to reach the server-side Share Count API', 'shareaholic' ); ?></span> <a href="#" onClick="window.location.reload(); this.innerHTML='<?php _e( 'Checking...', 'shareaholic' ); ?>';"><?php _e( 'Re-check', 'shareaholic' ); ?></a>
|
63 |
+
<p class="key-description"><?php echo sprintf( __( 'A network problem or firewall is blocking connections from your web server to various Share Count APIs. <strong>The API cannot work correctly until this is fixed.</strong> If you continue to face this issue, please <a href="#" class="%s">contact us</a> and we will follow up! In the meantime, if you disable the server-side Share Counts API from the Social Share Counts options, Shareaholic will default to using client-side APIs for share counts successfully -- so nothing to worry about!' ), 'drift-open-chat' ); ?></p>
|
64 |
+
<?php } ?>
|
65 |
<?php } ?>
|
66 |
+
</div>
|
67 |
</div>
|
68 |
+
|
69 |
<div class='clear'></div>
|
70 |
+
|
71 |
<div class="app">
|
72 |
+
<h2><?php _e( 'Connect Shareaholic Account', 'shareaholic' ); ?></h2>
|
73 |
+
<div class="app-content">
|
74 |
<?php echo sprintf( __( 'Connecting this plugin to a free Shareaholic account is highly recommended. Doing so will unlock additional functionality that requires authentication such as site ownership verification, team features and site integrations like Google Analytics.', 'shareaholic' ) ); ?>
|
75 |
<div class="button-wrapper">
|
76 |
+
<a href="<?php echo esc_url( admin_url( 'admin.php?shareaholic_redirect_url=shareaholic.com/signup/' ) ); ?>" target="_blank" class="btn btn-dark" role="button" style="font-size: 14px;"><?php echo sprintf( __( 'Connect Plugin', 'shareaholic' ) ); ?></a>
|
77 |
+
</div>
|
78 |
</div>
|
|
|
79 |
</div>
|
80 |
+
|
81 |
<div class='clear'></div>
|
82 |
+
|
83 |
<div class="app">
|
84 |
+
<h2><?php _e( 'Plugin ↔ Shareaholic Cloud Sync', 'shareaholic' ); ?></h2>
|
85 |
+
<div class="app-content">
|
86 |
<?php
|
87 |
$sync_status = ShareaholicUtilities::location_sync_status();
|
88 |
if ( $sync_status == 200 ) {
|
93 |
<?php } else { ?>
|
94 |
<span class="key-status unknown"><?php _e( 'Sync Status Unknown', 'shareaholic' ); ?></span>
|
95 |
<?php } ?>
|
96 |
+
</div>
|
97 |
</div>
|
98 |
+
|
|
|
99 |
<div class='clear'></div>
|
100 |
|
101 |
<form name='advanced_settings' method='post' action='<?php echo $action; ?>'>
|
102 |
<?php wp_nonce_field( $action, 'nonce_field' ); ?>
|
103 |
<input type='hidden' name='already_submitted' value='Y'>
|
104 |
+
<div class='clear'>
|
105 |
<div class="app">
|
106 |
+
<h2><?php _e( 'Social Share Counts', 'shareaholic' ); ?></h2>
|
107 |
+
<div class="app-content">
|
108 |
|
109 |
<div class="shr-form-item">
|
110 |
+
<input type='checkbox' id='user_nicename' name='shareaholic[enable_user_nicename]' class='check'
|
111 |
<?php if ( isset( $settings['enable_user_nicename'] ) ) { ?>
|
112 |
<?php echo ( $settings['enable_user_nicename'] == 'on' ? 'checked' : '' ); ?>
|
113 |
+
<?php } ?>>
|
114 |
<label for="user_nicename"> <?php echo sprintf( __( 'Enable <code>%author%</code> permalink tag for Share Count Recovery', 'shareaholic' ) ); ?></label>
|
115 |
</div>
|
116 |
|
117 |
<div class="shr-form-item">
|
118 |
+
<input type='checkbox' id='share_counts' name='shareaholic[disable_internal_share_counts_api]' class='check'
|
119 |
<?php if ( isset( $settings['disable_internal_share_counts_api'] ) ) { ?>
|
120 |
<?php echo ( $settings['disable_internal_share_counts_api'] == 'on' ? 'checked' : '' ); ?>
|
121 |
+
<?php } ?>>
|
122 |
+
<label for="share_counts"> <?php echo sprintf( __( 'Disable Local Share Count Proxy.', 'shareaholic' ) ); ?> <?php echo sprintf( __( 'When enabled, Share Counts will be fetched and cached locally by your server. This local proxy enhances user privacy and share counts but uses your server resources. Retrieving, caching and serving Share Counts can be a server and database intensive activity which can test even the best of web hosts. You can save on your hosting bill by offloading this heavy lifting to Shareaholic Cloud servers instead, <a href="%s" target="_blank">learn more</a>.', 'shareaholic' ), 'https://support.shareaholic.com/hc/en-us/articles/360029500132' ); ?></label>
|
123 |
</div>
|
124 |
|
125 |
<?php if ( isset( $settings['disable_internal_share_counts_api'] ) && $settings['disable_internal_share_counts_api'] != 'on' ) { ?>
|
126 |
+
<fieldset id='facebook-app' <?php echo ( ShareaholicUtilities::facebook_auth_check() != 'SUCCESS' ? "class='failed'" : '' ); ?>>
|
127 |
+
<legend>
|
128 |
<?php _e( 'Facebook', 'shareaholic' ); ?>
|
129 |
|
130 |
+
<?php if ( ShareaholicUtilities::facebook_auth_check() == 'SUCCESS' ) { ?>
|
131 |
<span class="key-status passed"><i class="fa fa-circle green" aria-hidden="true"></i> <?php _e( 'Live', 'shareaholic' ); ?></span>
|
132 |
+
<?php } else { ?>
|
133 |
<span class="key-status failed"><i class="fa fa-circle red blink" aria-hidden="true"></i> <?php _e( 'Missing or Invalid Credentials', 'shareaholic' ); ?></span></a>
|
134 |
+
<?php } ?>
|
135 |
+
|
136 |
+
</legend>
|
137 |
|
138 |
+
<div class="shr-form-item shr-form-text">
|
|
|
|
|
139 |
<label for="facebook_app_id"><?php _e( 'Facebook App ID', 'shareaholic' ); ?></label><br>
|
140 |
<input class="regular-text" id="facebook_app_id" type="text" name='shareaholic[facebook_app_id]' value="
|
141 |
<?php
|
143 |
echo $settings['facebook_app_id'];}
|
144 |
?>
|
145 |
">
|
146 |
+
</div>
|
147 |
+
<div class="shr-form-item shr-form-text">
|
148 |
<label for="facebook_app_secret"><?php _e( 'Facebook App Secret', 'shareaholic' ); ?></label><br>
|
149 |
<input class="regular-text" id="facebook_app_secret" type="text" name='shareaholic[facebook_app_secret]' value="
|
150 |
<?php
|
152 |
echo $settings['facebook_app_secret'];}
|
153 |
?>
|
154 |
">
|
155 |
+
</div>
|
156 |
+
|
157 |
<?php echo sprintf( __( 'Required for better Facebook Share Counts. Please %1$sfollow documentation%2$s to get your Facebook App ID and Secret.', 'shareaholic' ), '<a href="https://support.shareaholic.com/hc/en-us/articles/360028605231" target="_blank">', '</a>' ); ?>
|
158 |
</fieldset>
|
159 |
<?php } ?>
|
160 |
|
161 |
<div class="button-wrapper">
|
162 |
+
<input type='submit' class="btn btn-primary btn-medium" onclick="this.value='<?php echo sprintf( __( 'Saving Changes...', 'shareaholic' ) ); ?>';" value='<?php echo sprintf( __( 'Save Changes', 'shareaholic' ) ); ?>'>
|
163 |
+
</div>
|
164 |
</div>
|
|
|
165 |
</div>
|
166 |
+
</div>
|
167 |
+
|
168 |
+
<div class='clear'>
|
169 |
<div class="app">
|
170 |
+
<h2><?php _e( 'Advanced', 'shareaholic' ); ?></h2>
|
171 |
+
<div class="app-content">
|
172 |
<div class="shr-form-item">
|
173 |
+
<input type='checkbox' id='og_tags' name='shareaholic[disable_og_tags]' class='check'
|
174 |
<?php if ( isset( $settings['disable_og_tags'] ) ) { ?>
|
175 |
<?php echo ( $settings['disable_og_tags'] == 'on' ? 'checked' : '' ); ?>
|
176 |
+
<?php } ?>>
|
177 |
<label for="og_tags"> <?php echo sprintf( __( 'Disable <code>Open Graph</code> tags', 'shareaholic' ) ); ?> <?php echo sprintf( __( '(it is recommended NOT to disable open graph tags)', 'shareaholic' ) ); ?></label>
|
178 |
</div>
|
179 |
<div class="shr-form-item">
|
180 |
+
<input type='checkbox' id='admin_bar' name='shareaholic[disable_admin_bar_menu]' class='check'
|
181 |
<?php if ( isset( $settings['disable_admin_bar_menu'] ) ) { ?>
|
182 |
<?php echo ( $settings['disable_admin_bar_menu'] == 'on' ? 'checked' : '' ); ?>
|
183 |
+
<?php } ?>>
|
184 |
<label for="admin_bar"> <?php echo sprintf( __( 'Disable Admin Bar Menu (requires page refresh)', 'shareaholic' ) ); ?></label>
|
185 |
</div>
|
186 |
<div class="shr-form-item">
|
187 |
+
<input type='checkbox' id='review_notice' name='shareaholic[disable_review_notice]' class='check'
|
188 |
<?php if ( isset( $settings['disable_review_notice'] ) ) { ?>
|
189 |
<?php echo ( $settings['disable_review_notice'] == 'on' ? 'checked' : '' ); ?>
|
190 |
+
<?php } ?>>
|
191 |
<label for="review_notice"> <?php echo sprintf( __( 'Disable Review Notice', 'shareaholic' ) ); ?></label>
|
192 |
</div>
|
193 |
<div class="shr-form-item">
|
194 |
+
<input type='checkbox' id='debugger' name='shareaholic[disable_debug_info]' class='check'
|
195 |
<?php if ( isset( $settings['disable_debug_info'] ) ) { ?>
|
196 |
<?php echo ( $settings['disable_debug_info'] == 'on' ? 'checked' : '' ); ?>
|
197 |
+
<?php } ?>>
|
198 |
<label for="debugger"> <?php echo sprintf( __( 'Disable Debugger (it is recommended NOT to disable the debugger)', 'shareaholic' ) ); ?></label>
|
199 |
</div>
|
200 |
<div class="button-wrapper">
|
201 |
+
<input type='submit' class="btn btn-primary btn-medium" onclick="this.value='<?php echo sprintf( __( 'Saving Changes...', 'shareaholic' ) ); ?>';" value='<?php echo sprintf( __( 'Save Changes', 'shareaholic' ) ); ?>'>
|
202 |
+
</div>
|
203 |
</div>
|
|
|
204 |
</div>
|
205 |
+
</div>
|
206 |
</form>
|
207 |
+
|
208 |
<div class='clear'></div>
|
209 |
+
|
210 |
<form name='reset_settings' method='post' action='<?php echo $action; ?>'>
|
211 |
+
<?php wp_nonce_field( $action, 'nonce_field' ); ?>
|
212 |
+
<input type='hidden' name='reset_settings' value='Y'>
|
213 |
+
<div class="app">
|
214 |
<h2><?php _e( 'Reset Plugin', 'shareaholic' ); ?></h2>
|
215 |
<div class="app-content">
|
216 |
+
<?php _e( 'This will reset all of your settings and start you from scratch. This can not be undone.', 'shareaholic' ); ?>
|
217 |
+
<div class="button-wrapper">
|
218 |
<input class="btn btn-danger btn-medium" type='submit' onclick="this.value='<?php _e( 'Resetting Plugin...', 'shareaholic' ); ?>';" value='<?php _e( 'Reset Plugin', 'shareaholic' ); ?>'>
|
219 |
+
</div>
|
220 |
+
</div>
|
221 |
+
</div>
|
222 |
+
|
223 |
+
<div class='clear' style="padding-bottom:10px;"></div>
|
224 |
+
|
225 |
</form>
|
226 |
+
</div>
|
227 |
+
</div>
|
228 |
</div>
|
|
|
229 |
</div>
|
230 |
|
231 |
<?php ShareaholicAdmin::show_footer(); ?>
|
templates/failed_to_create_api_key.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php if ( current_user_can( 'manage_options' ) ) { ?>
|
2 |
-
|
3 |
<div style="margin: 0px 8px 0 4px; float: left;"><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>img/check.png" width=56 height=50 /></div>
|
4 |
<div class="shareaholic-text-container" style="color: #fff; text-shadow: 0px 1px 1px rgba(0,0,0,0.4); font-size: 14px; display: table-cell;">
|
5 |
-
|
6 |
<strong><?php echo sprintf( __( 'Action required: You\'ve installed Shareaholic for WordPress. We\'re ready when you are. %1$sGet started now »%2$s', 'shareaholic' ), '<a href="admin.php?page=shareaholic-settings" class="button-secondary">', '</a>' ); ?></strong>
|
7 |
-
|
8 |
</div>
|
9 |
-
|
10 |
-
|
11 |
<?php } ?>
|
1 |
<?php if ( current_user_can( 'manage_options' ) ) { ?>
|
2 |
+
<div class="shareaholic-wrap-container" style="padding: 0 20px 0px 15px; background-color: #45a147; margin: 25px 0px 20px -18px;">
|
3 |
<div style="margin: 0px 8px 0 4px; float: left;"><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>img/check.png" width=56 height=50 /></div>
|
4 |
<div class="shareaholic-text-container" style="color: #fff; text-shadow: 0px 1px 1px rgba(0,0,0,0.4); font-size: 14px; display: table-cell;">
|
5 |
+
<p>
|
6 |
<strong><?php echo sprintf( __( 'Action required: You\'ve installed Shareaholic for WordPress. We\'re ready when you are. %1$sGet started now »%2$s', 'shareaholic' ), '<a href="admin.php?page=shareaholic-settings" class="button-secondary">', '</a>' ); ?></strong>
|
7 |
+
</p>
|
8 |
</div>
|
9 |
+
</div>
|
10 |
+
<div style="clear:both;"></div>
|
11 |
<?php } ?>
|
templates/failed_to_create_api_key_modal.php
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<div class='reveal-modal blocking-modal api-key-modal' id='failed_to_create_api_key'>
|
2 |
-
|
3 |
-
|
4 |
<p style="font-size:14px;">
|
5 |
<?php _e( 'It appears that we are having some trouble communicating with Shareaholic Cloud servers right now. This is usually temporary. Please revisit this section after a few minutes or click "retry" now.', 'shareaholic' ); ?>
|
6 |
</p>
|
7 |
<a id='get_started' class="btn_main" style="margin-top: 15px;" href=''><?php echo _e( 'Retry', 'shareaholic' ); ?></a>
|
8 |
<br />
|
9 |
<span style="font-size:12px; font-weight:normal;">
|
10 |
-
|
11 |
</span>
|
12 |
<br /><br />
|
13 |
<p style="font-size:12px; font-weight:normal;">
|
14 |
-
|
15 |
</p>
|
16 |
-
|
17 |
</div>
|
18 |
|
1 |
<div class='reveal-modal blocking-modal api-key-modal' id='failed_to_create_api_key'>
|
2 |
+
<h4><?php echo sprintf( __( 'Setup Shareaholic', 'shareaholic' ) ); ?></h4>
|
3 |
+
<div class="content pal" style="padding:20px;">
|
4 |
<p style="font-size:14px;">
|
5 |
<?php _e( 'It appears that we are having some trouble communicating with Shareaholic Cloud servers right now. This is usually temporary. Please revisit this section after a few minutes or click "retry" now.', 'shareaholic' ); ?>
|
6 |
</p>
|
7 |
<a id='get_started' class="btn_main" style="margin-top: 15px;" href=''><?php echo _e( 'Retry', 'shareaholic' ); ?></a>
|
8 |
<br />
|
9 |
<span style="font-size:12px; font-weight:normal;">
|
10 |
+
<a href='<?php echo admin_url(); ?>'><?php _e( 'or, try again later.', 'shareaholic' ); ?></a>
|
11 |
</span>
|
12 |
<br /><br />
|
13 |
<p style="font-size:12px; font-weight:normal;">
|
14 |
+
<?php echo sprintf( __( 'If you continue to get this prompt for more than a few minutes, ensure that you have the latest version of the plugin installed. If you still continue to get this prompt, then check "Shareaholic Server Connectivity Status" or reset the plugin. Both are available under %1$sAdvanced Settings%2$s.', 'shareaholic' ), '<a href="admin.php?page=shareaholic-advanced">', '</a>' ); ?> <?php echo sprintf( __( 'If you are stuck, have a question or have a bug to report, please %1$slet us know%2$s.', 'shareaholic' ), '<a href="https://www.shareaholic.com/help/message" target="_blank">', '</a>' ); ?>
|
15 |
</p>
|
16 |
+
</div>
|
17 |
</div>
|
18 |
|
templates/footer.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<div style="margin-top:45px;"></div>
|
2 |
<div class='clear'>
|
3 |
-
|
4 |
<?php echo sprintf( __( '%sShareaholic for WordPress v' . ShareaholicUtilities::get_version() . '%s | %sTerms of Service%s | %sSupport Center%s | %sAPI%s', 'shareaholic' ), '<a href="https://www.shareaholic.com/?src=wp_admin" target="_new">', '</a>', '<a href="https://www.shareaholic.com/terms/?src=wp_admin" target="_new">', '</a>', '<a href="https://support.shareaholic.com/" target="_new">', '</a>', '<a href="https://www.shareaholic.com/api/?src=wp_admin" target="_new">', '</a>' ); ?>
|
5 |
-
|
6 |
-
|
7 |
<?php echo sprintf( __( 'If you like our work, please show some love and %1$sleave a ⭐️⭐️⭐️⭐️⭐️ review%2$s. It would help us out a lot and we would really appreciate it.', 'shareaholic' ), '<a href="https://wordpress.org/support/plugin/shareaholic/reviews/?rate=5#new-post" target="_new">', '</a>' ); ?>
|
8 |
-
|
9 |
-
|
10 |
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fshareaholic&width&layout=standard&action=like&show_faces=true&share=false&height=80&width=500&appId=207766518608" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:80px;" allowTransparency="true"></iframe>
|
11 |
-
|
12 |
</div>
|
13 |
|
14 |
<!-- Start of Async HubSpot Analytics -->
|
1 |
<div style="margin-top:45px;"></div>
|
2 |
<div class='clear'>
|
3 |
+
<p class="text-muted">
|
4 |
<?php echo sprintf( __( '%sShareaholic for WordPress v' . ShareaholicUtilities::get_version() . '%s | %sTerms of Service%s | %sSupport Center%s | %sAPI%s', 'shareaholic' ), '<a href="https://www.shareaholic.com/?src=wp_admin" target="_new">', '</a>', '<a href="https://www.shareaholic.com/terms/?src=wp_admin" target="_new">', '</a>', '<a href="https://support.shareaholic.com/" target="_new">', '</a>', '<a href="https://www.shareaholic.com/api/?src=wp_admin" target="_new">', '</a>' ); ?>
|
5 |
+
</p>
|
6 |
+
<p class="text-muted">
|
7 |
<?php echo sprintf( __( 'If you like our work, please show some love and %1$sleave a ⭐️⭐️⭐️⭐️⭐️ review%2$s. It would help us out a lot and we would really appreciate it.', 'shareaholic' ), '<a href="https://wordpress.org/support/plugin/shareaholic/reviews/?rate=5#new-post" target="_new">', '</a>' ); ?>
|
8 |
+
<br />
|
9 |
+
<br />
|
10 |
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fshareaholic&width&layout=standard&action=like&show_faces=true&share=false&height=80&width=500&appId=207766518608" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:80px;" allowTransparency="true"></iframe>
|
11 |
+
</p>
|
12 |
</div>
|
13 |
|
14 |
<!-- Start of Async HubSpot Analytics -->
|
templates/header.php
CHANGED
@@ -4,8 +4,8 @@
|
|
4 |
<!-- Header - end -->
|
5 |
|
6 |
<script>
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
</script>
|
4 |
<!-- Header - end -->
|
5 |
|
6 |
<script>
|
7 |
+
window.first_part_of_url = '<?php echo $settings['base_link']; ?>';
|
8 |
+
window.verification_key = '<?php echo $settings['verification_key']; ?>';
|
9 |
+
window.SHAREAHOLIC_PLUGIN_VERSION = '<?php echo ShareaholicUtilities::get_version(); ?>';
|
10 |
+
window.shareaholic_add_location_nonce = '<?php echo wp_create_nonce( 'shareaholic_add_location' ); ?>';
|
11 |
</script>
|
templates/meta_boxes.php
CHANGED
@@ -1,37 +1,37 @@
|
|
1 |
<label>
|
2 |
-
|
3 |
-
|
4 |
checked
|
5 |
-
|
6 |
-
|
7 |
</label>
|
8 |
|
9 |
<br>
|
10 |
|
11 |
<label>
|
12 |
-
|
13 |
-
|
14 |
checked
|
15 |
-
|
16 |
-
|
17 |
</label>
|
18 |
|
19 |
<br>
|
20 |
|
21 |
<label>
|
22 |
-
|
23 |
-
|
24 |
checked
|
25 |
-
|
26 |
-
|
27 |
</label>
|
28 |
|
29 |
<br>
|
30 |
|
31 |
<label>
|
32 |
-
|
33 |
-
|
34 |
checked
|
35 |
-
|
36 |
-
|
37 |
</label>
|
1 |
<label>
|
2 |
+
<input type='checkbox' name='shareaholic[disable_share_buttons]'
|
3 |
+
<?php if ( get_post_meta( $post->ID, 'shareaholic_disable_share_buttons', true ) ) { ?>
|
4 |
checked
|
5 |
+
<?php } ?>>
|
6 |
+
<?php echo sprintf( __( 'Hide Share Buttons', 'shareaholic' ) ); ?>
|
7 |
</label>
|
8 |
|
9 |
<br>
|
10 |
|
11 |
<label>
|
12 |
+
<input type='checkbox' name='shareaholic[disable_recommendations]'
|
13 |
+
<?php if ( get_post_meta( $post->ID, 'shareaholic_disable_recommendations', true ) ) { ?>
|
14 |
checked
|
15 |
+
<?php } ?>>
|
16 |
+
<?php echo sprintf( __( 'Hide Related Content', 'shareaholic' ) ); ?>
|
17 |
</label>
|
18 |
|
19 |
<br>
|
20 |
|
21 |
<label>
|
22 |
+
<input type='checkbox' name='shareaholic[exclude_recommendations]'
|
23 |
+
<?php if ( get_post_meta( $post->ID, 'shareaholic_exclude_recommendations', true ) ) { ?>
|
24 |
checked
|
25 |
+
<?php } ?>>
|
26 |
+
<?php echo sprintf( __( 'Exclude from Related Content', 'shareaholic' ) ); ?>
|
27 |
</label>
|
28 |
|
29 |
<br>
|
30 |
|
31 |
<label>
|
32 |
+
<input type='checkbox' name='shareaholic[disable_open_graph_tags]'
|
33 |
+
<?php if ( get_post_meta( $post->ID, 'shareaholic_disable_open_graph_tags', true ) ) { ?>
|
34 |
checked
|
35 |
+
<?php } ?>>
|
36 |
+
<?php echo sprintf( __( 'Do not include Open Graph tags', 'shareaholic' ) ); ?>
|
37 |
</label>
|
templates/script_chat.php
CHANGED
@@ -1,2 +1 @@
|
|
1 |
-
|
2 |
<script src="<?php echo ShareaholicUtilities::asset_url_admin( 'assets/pub/shareaholic-chat.js' ); ?>" async></script>
|
|
|
1 |
<script src="<?php echo ShareaholicUtilities::asset_url_admin( 'assets/pub/shareaholic-chat.js' ); ?>" async></script>
|
templates/script_tag.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<!-- Powered by Shareaholic; Grow your Audience faster! - https://www.shareaholic.com -->
|
2 |
<link rel='preload' href='<?php echo ShareaholicUtilities::asset_url( 'assets/pub/shareaholic.js' ); ?>' as='script'/>
|
3 |
<script data-no-minify='1' data-cfasync='false'>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
</script>
|
8 |
<script data-no-minify='1' data-cfasync='false' src='<?php echo ShareaholicUtilities::asset_url( 'assets/pub/shareaholic.js' ); ?>' data-shr-siteid='<?php echo $api_key; ?>' async <?php echo $overrides; ?>></script>
|
1 |
<!-- Powered by Shareaholic; Grow your Audience faster! - https://www.shareaholic.com -->
|
2 |
<link rel='preload' href='<?php echo ShareaholicUtilities::asset_url( 'assets/pub/shareaholic.js' ); ?>' as='script'/>
|
3 |
<script data-no-minify='1' data-cfasync='false'>
|
4 |
+
//<![CDATA[
|
5 |
+
_SHR_SETTINGS = <?php echo json_encode( $base_settings ); ?>;
|
6 |
+
//]]>
|
7 |
</script>
|
8 |
<script data-no-minify='1' data-cfasync='false' src='<?php echo ShareaholicUtilities::asset_url( 'assets/pub/shareaholic.js' ); ?>' data-shr-siteid='<?php echo $api_key; ?>' async <?php echo $overrides; ?>></script>
|
templates/settings.php
CHANGED
@@ -2,12 +2,12 @@
|
|
2 |
|
3 |
<script>
|
4 |
window.ShareaholicConfig = {
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
};
|
12 |
</script>
|
13 |
|
@@ -15,100 +15,100 @@ window.ShareaholicConfig = {
|
|
15 |
<h2><?php echo sprintf( __( 'Dashboard - Legacy', 'shareaholic' ) ); ?></h2>
|
16 |
|
17 |
<div class='reveal-modal' id='editing_modal'>
|
18 |
-
|
19 |
-
|
20 |
</div>
|
21 |
|
22 |
<div class="container-fluid">
|
23 |
-
|
24 |
<div class="col-sm-8">
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
<h2>In-Page App Code Blocks</h2>
|
33 |
<p>
|
34 |
<i class="icon icon-share_buttons"></i> <?php echo sprintf( __( 'In-Page Share Buttons', 'shareaholic' ) ); ?>
|
35 |
-
|
36 |
</p>
|
37 |
|
38 |
<?php foreach ( array( 'post', 'page', 'index', 'category' ) as $page_type ) { ?>
|
39 |
<fieldset id='sharebuttons'>
|
40 |
-
|
41 |
<?php foreach ( array( 'above', 'below' ) as $position ) { ?>
|
42 |
-
|
43 |
<input type="hidden" name="share_buttons[<?php echo "{$page_type}_{$position}_content"; ?>]" value="off" />
|
44 |
<input type="checkbox" id="share_buttons_<?php echo "{$page_type}_{$position}_content"; ?>" name="share_buttons[<?php echo "{$page_type}_{$position}_content"; ?>]" class="check"
|
45 |
<?php if ( isset( $share_buttons[ "{$page_type}_{$position}_content" ] ) ) { ?>
|
46 |
<?php echo ( $share_buttons[ "{$page_type}_{$position}_content" ] == 'on' ? 'checked' : '' ); ?>
|
47 |
<?php } ?> />
|
48 |
<label for="share_buttons_<?php echo "{$page_type}_{$position}_content"; ?>"><?php echo ucfirst( $position ); ?> Content</label>
|
49 |
-
|
50 |
-
|
51 |
</fieldset>
|
52 |
<?php } ?>
|
53 |
|
54 |
<div class='fieldset-footer'>
|
55 |
-
|
56 |
-
<input type="checkbox" id="share_buttons_excerpts" name="shareaholic[share_buttons_display_on_excerpts]" class="check"
|
57 |
<?php if ( isset( $settings['share_buttons_display_on_excerpts'] ) ) { ?>
|
58 |
<?php echo ( $settings['share_buttons_display_on_excerpts'] == 'on' ? 'checked' : '' ); ?>
|
59 |
<?php } ?>>
|
60 |
<label for="share_buttons_excerpts">Display on excerpts</label>
|
61 |
-
|
62 |
</div>
|
63 |
|
64 |
<div class='clear'></div>
|
65 |
|
66 |
<p>
|
67 |
<i class="icon icon-recommendations"></i> <?php echo sprintf( __( 'Related Content', 'shareaholic' ) ); ?>
|
68 |
-
|
69 |
</p>
|
70 |
<?php foreach ( array( 'post', 'page', 'index', 'category' ) as $page_type ) { ?>
|
71 |
<?php foreach ( array( 'below' ) as $position ) { ?>
|
72 |
<fieldset id='recommendations'>
|
73 |
-
|
74 |
<div class="location">
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
<?php echo ( $recommendations[ "{$page_type}_below_content" ] == 'on' ? 'checked' : '' ); ?>
|
79 |
-
|
80 |
-
|
81 |
</div>
|
82 |
-
|
83 |
-
|
84 |
<?php } ?>
|
85 |
|
86 |
<div class='fieldset-footer'>
|
87 |
-
|
88 |
-
<input type="checkbox" id="recommendations_excerpts" name="shareaholic[recommendations_display_on_excerpts]" class="check"
|
89 |
<?php if ( isset( $settings['recommendations_display_on_excerpts'] ) ) { ?>
|
90 |
<?php echo ( $settings['recommendations_display_on_excerpts'] == 'on' ? 'checked' : '' ); ?>
|
91 |
<?php } ?>>
|
92 |
<label for="recommendations_excerpts">Display on excerpts</label>
|
93 |
-
|
94 |
</div>
|
95 |
|
96 |
<div class='fieldset-footer'>
|
97 |
-
|
98 |
<?php echo sprintf( __( 'Note: Shareaholic offloads Related Posts processing to the cloud, so there is no additional load on your server or database, giving you the fastest and most efficient Related Posts solution on the market. The %1$scloud API%2$s starts working as soon as your site is live. Until the cloud-based system starts, we use a basic placeholder API powered by the plugin. This API is temporary and does not respect advanced settings such as content exclusion rules.', 'shareaholic' ), '<a href="https://shrlc.com/1IzOGiI" target="_blank">', '</a>' ); ?>
|
99 |
-
|
|
|
100 |
</div>
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
<div class="app">
|
105 |
<input type='submit' class="btn btn-primary btn-lg btn-block" onclick="this.value='<?php echo sprintf( __( 'Saving Changes...', 'shareaholic' ) ); ?>';" value='<?php echo sprintf( __( 'Save Changes', 'shareaholic' ) ); ?>'>
|
106 |
-
|
107 |
-
|
108 |
</div>
|
109 |
<?php ShareaholicUtilities::load_template( 'why_to_sign_up', array( 'url' => Shareaholic::URL ) ); ?>
|
110 |
</div>
|
111 |
-
|
112 |
</div>
|
113 |
<?php ShareaholicAdmin::show_footer(); ?>
|
114 |
<?php ShareaholicAdmin::include_chat(); ?>
|
2 |
|
3 |
<script>
|
4 |
window.ShareaholicConfig = {
|
5 |
+
apiHost: "<?php echo Shareaholic::API_URL; ?>",
|
6 |
+
serviceHost: "<?php echo Shareaholic::URL; ?>",
|
7 |
+
assetHost: "<?php echo ShareaholicUtilities::asset_url_admin(); ?>",
|
8 |
+
assetFolders: true,
|
9 |
+
origin: "wp_plugin",
|
10 |
+
language: "<?php echo strtolower( get_bloginfo( 'language' ) ); ?>"
|
11 |
};
|
12 |
</script>
|
13 |
|
15 |
<h2><?php echo sprintf( __( 'Dashboard - Legacy', 'shareaholic' ) ); ?></h2>
|
16 |
|
17 |
<div class='reveal-modal' id='editing_modal'>
|
18 |
+
<div id='iframe_container' class='bg-loading-img' allowtransparency='true'></div>
|
19 |
+
<a class="close-reveal-modal">×</a>
|
20 |
</div>
|
21 |
|
22 |
<div class="container-fluid">
|
23 |
+
<div class="row">
|
24 |
<div class="col-sm-8">
|
25 |
+
<form name="settings" method="post" action="<?php echo $action; ?>">
|
26 |
+
<?php wp_nonce_field( $action, 'nonce_field' ); ?>
|
27 |
+
<input type="hidden" name="already_submitted" value="Y">
|
28 |
|
29 |
+
<div id='app_settings'>
|
30 |
+
|
31 |
+
<div class="app">
|
32 |
<h2>In-Page App Code Blocks</h2>
|
33 |
<p>
|
34 |
<i class="icon icon-share_buttons"></i> <?php echo sprintf( __( 'In-Page Share Buttons', 'shareaholic' ) ); ?>
|
35 |
+
<?php echo sprintf( __( '- Pick where you want your In-Page code blocks to be inserted', 'shareaholic' ) ); ?>
|
36 |
</p>
|
37 |
|
38 |
<?php foreach ( array( 'post', 'page', 'index', 'category' ) as $page_type ) { ?>
|
39 |
<fieldset id='sharebuttons'>
|
40 |
+
<legend><?php echo ucfirst( $page_type ); ?></legend>
|
41 |
<?php foreach ( array( 'above', 'below' ) as $position ) { ?>
|
42 |
+
<div class="location">
|
43 |
<input type="hidden" name="share_buttons[<?php echo "{$page_type}_{$position}_content"; ?>]" value="off" />
|
44 |
<input type="checkbox" id="share_buttons_<?php echo "{$page_type}_{$position}_content"; ?>" name="share_buttons[<?php echo "{$page_type}_{$position}_content"; ?>]" class="check"
|
45 |
<?php if ( isset( $share_buttons[ "{$page_type}_{$position}_content" ] ) ) { ?>
|
46 |
<?php echo ( $share_buttons[ "{$page_type}_{$position}_content" ] == 'on' ? 'checked' : '' ); ?>
|
47 |
<?php } ?> />
|
48 |
<label for="share_buttons_<?php echo "{$page_type}_{$position}_content"; ?>"><?php echo ucfirst( $position ); ?> Content</label>
|
49 |
+
</div>
|
50 |
+
<?php } ?>
|
51 |
</fieldset>
|
52 |
<?php } ?>
|
53 |
|
54 |
<div class='fieldset-footer'>
|
55 |
+
<p>
|
56 |
+
<input type="checkbox" id="share_buttons_excerpts" name="shareaholic[share_buttons_display_on_excerpts]" class="check"
|
57 |
<?php if ( isset( $settings['share_buttons_display_on_excerpts'] ) ) { ?>
|
58 |
<?php echo ( $settings['share_buttons_display_on_excerpts'] == 'on' ? 'checked' : '' ); ?>
|
59 |
<?php } ?>>
|
60 |
<label for="share_buttons_excerpts">Display on excerpts</label>
|
61 |
+
</p>
|
62 |
</div>
|
63 |
|
64 |
<div class='clear'></div>
|
65 |
|
66 |
<p>
|
67 |
<i class="icon icon-recommendations"></i> <?php echo sprintf( __( 'Related Content', 'shareaholic' ) ); ?>
|
68 |
+
<?php echo sprintf( __( '- Pick where you want your In-Page code blocks to be inserted', 'shareaholic' ) ); ?>
|
69 |
</p>
|
70 |
<?php foreach ( array( 'post', 'page', 'index', 'category' ) as $page_type ) { ?>
|
71 |
<?php foreach ( array( 'below' ) as $position ) { ?>
|
72 |
<fieldset id='recommendations'>
|
73 |
+
<legend><?php echo ucfirst( $page_type ); ?></legend>
|
74 |
<div class="location">
|
75 |
+
<input type="hidden" name="recommendations[<?php echo "{$page_type}_below_content"; ?>]" value="off" />
|
76 |
+
<input type="checkbox" id="recommendations_<?php echo "{$page_type}_below_content"; ?>" name="recommendations[<?php echo "{$page_type}_below_content"; ?>]" class="check"
|
77 |
+
<?php if ( isset( $recommendations[ "{$page_type}_below_content" ] ) ) { ?>
|
78 |
<?php echo ( $recommendations[ "{$page_type}_below_content" ] == 'on' ? 'checked' : '' ); ?>
|
79 |
+
<?php } ?> />
|
80 |
+
<label for="recommendations_<?php echo "{$page_type}_below_content"; ?>"><?php echo ucfirst( $position ); ?> Content</label>
|
81 |
</div>
|
82 |
+
<?php } ?>
|
83 |
+
</fieldset>
|
84 |
<?php } ?>
|
85 |
|
86 |
<div class='fieldset-footer'>
|
87 |
+
<p>
|
88 |
+
<input type="checkbox" id="recommendations_excerpts" name="shareaholic[recommendations_display_on_excerpts]" class="check"
|
89 |
<?php if ( isset( $settings['recommendations_display_on_excerpts'] ) ) { ?>
|
90 |
<?php echo ( $settings['recommendations_display_on_excerpts'] == 'on' ? 'checked' : '' ); ?>
|
91 |
<?php } ?>>
|
92 |
<label for="recommendations_excerpts">Display on excerpts</label>
|
93 |
+
</p>
|
94 |
</div>
|
95 |
|
96 |
<div class='fieldset-footer'>
|
97 |
+
<p>
|
98 |
<?php echo sprintf( __( 'Note: Shareaholic offloads Related Posts processing to the cloud, so there is no additional load on your server or database, giving you the fastest and most efficient Related Posts solution on the market. The %1$scloud API%2$s starts working as soon as your site is live. Until the cloud-based system starts, we use a basic placeholder API powered by the plugin. This API is temporary and does not respect advanced settings such as content exclusion rules.', 'shareaholic' ), '<a href="https://shrlc.com/1IzOGiI" target="_blank">', '</a>' ); ?>
|
99 |
+
</p>
|
100 |
+
</div>
|
101 |
</div>
|
102 |
+
</div>
|
103 |
+
|
104 |
+
<div class="app">
|
|
|
105 |
<input type='submit' class="btn btn-primary btn-lg btn-block" onclick="this.value='<?php echo sprintf( __( 'Saving Changes...', 'shareaholic' ) ); ?>';" value='<?php echo sprintf( __( 'Save Changes', 'shareaholic' ) ); ?>'>
|
106 |
+
</div>
|
107 |
+
</form>
|
108 |
</div>
|
109 |
<?php ShareaholicUtilities::load_template( 'why_to_sign_up', array( 'url' => Shareaholic::URL ) ); ?>
|
110 |
</div>
|
111 |
+
</div>
|
112 |
</div>
|
113 |
<?php ShareaholicAdmin::show_footer(); ?>
|
114 |
<?php ShareaholicAdmin::include_chat(); ?>
|
templates/terms_of_service_modal.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<div class='reveal-modal blocking-modal' id='terms_of_service_modal'>
|
2 |
-
|
3 |
-
|
4 |
<p style="font-size: 18px; color: #323648; line-height: 1.4em; padding-top: 24px; margin: 0;">
|
5 |
-
|
6 |
</p>
|
7 |
<p style="font-size: 12px; color: #666; line-height: 1.8em; padding-bottom: 0;">
|
8 |
<?php echo sprintf( __( 'Shareaholic provides you with a comprehensive set of marketing tools to engage with your audience, get found on social, and grow your following. The toolkit includes Award-Winning Social Share Buttons, Related Posts, Analytics, Ad Monetization, and more. Customize what is right for your website from the App Manager.', 'shareaholic' ) ); ?>
|
@@ -12,39 +12,39 @@
|
|
12 |
|
13 |
<!--
|
14 |
<div class="plugin-value-section-container">
|
15 |
-
|
16 |
<span class="plugin-value-line"></span>
|
17 |
<ul class="plugin-value">
|
18 |
-
|
19 |
-
<span class="icon fa fa-fire"></span>
|
20 |
<span class="title"><?php _e( 'Engage', 'shareaholic' ); ?></span>
|
21 |
<p><?php _e( 'Increase traffic, time on site and repeat visits.', 'shareaholic' ); ?></p>
|
22 |
-
|
23 |
-
|
24 |
<span class="icon fa fa-bar-chart-o"></span>
|
25 |
<span class="title"><?php _e( 'Discover', 'shareaholic' ); ?></span>
|
26 |
<p><?php _e( 'Understand your audience with our easy-to-use analytics dashboard.', 'shareaholic' ); ?></p>
|
27 |
-
|
28 |
-
|
29 |
<span class="icon fa fa-usd"></span>
|
30 |
<span class="title"><?php _e( 'Earn', 'shareaholic' ); ?></span>
|
31 |
<p><?php _e( 'Generate revenue with personalized, unobtrusive native ads.', 'shareaholic' ); ?></p>
|
32 |
-
|
33 |
-
|
34 |
<span class="icon fa fa-bullhorn"></span>
|
35 |
<span class="title"><?php _e( 'Acquire', 'shareaholic' ); ?></span>
|
36 |
<p><?php _e( 'Reach over 400 million people with native ads and promoted content.', 'shareaholic' ); ?></p>
|
37 |
-
|
38 |
</ul>
|
39 |
-
|
40 |
</div>
|
41 |
-->
|
42 |
-
|
43 |
<div class="pvl">
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
</div>
|
48 |
|
49 |
-
|
50 |
</div>
|
1 |
<div class='reveal-modal blocking-modal' id='terms_of_service_modal'>
|
2 |
+
<h4><?php echo sprintf( __( 'Welcome to Shareaholic!', 'shareaholic' ) ); ?></h4>
|
3 |
+
<div class="content pal">
|
4 |
<p style="font-size: 18px; color: #323648; line-height: 1.4em; padding-top: 24px; margin: 0;">
|
5 |
+
<?php echo sprintf( __( '%1$sA Suite of Essential Tools to Grow Your Website%2$s', 'shareaholic' ), '<strong>', '</strong>' ); ?>
|
6 |
</p>
|
7 |
<p style="font-size: 12px; color: #666; line-height: 1.8em; padding-bottom: 0;">
|
8 |
<?php echo sprintf( __( 'Shareaholic provides you with a comprehensive set of marketing tools to engage with your audience, get found on social, and grow your following. The toolkit includes Award-Winning Social Share Buttons, Related Posts, Analytics, Ad Monetization, and more. Customize what is right for your website from the App Manager.', 'shareaholic' ) ); ?>
|
12 |
|
13 |
<!--
|
14 |
<div class="plugin-value-section-container">
|
15 |
+
<section class="plugin-value-section">
|
16 |
<span class="plugin-value-line"></span>
|
17 |
<ul class="plugin-value">
|
18 |
+
<li class="engage">
|
19 |
+
<span class="icon fa fa-fire"></span>
|
20 |
<span class="title"><?php _e( 'Engage', 'shareaholic' ); ?></span>
|
21 |
<p><?php _e( 'Increase traffic, time on site and repeat visits.', 'shareaholic' ); ?></p>
|
22 |
+
</li>
|
23 |
+
<li class="learn">
|
24 |
<span class="icon fa fa-bar-chart-o"></span>
|
25 |
<span class="title"><?php _e( 'Discover', 'shareaholic' ); ?></span>
|
26 |
<p><?php _e( 'Understand your audience with our easy-to-use analytics dashboard.', 'shareaholic' ); ?></p>
|
27 |
+
</li>
|
28 |
+
<li class="monetize">
|
29 |
<span class="icon fa fa-usd"></span>
|
30 |
<span class="title"><?php _e( 'Earn', 'shareaholic' ); ?></span>
|
31 |
<p><?php _e( 'Generate revenue with personalized, unobtrusive native ads.', 'shareaholic' ); ?></p>
|
32 |
+
</li>
|
33 |
+
<li class="acquire">
|
34 |
<span class="icon fa fa-bullhorn"></span>
|
35 |
<span class="title"><?php _e( 'Acquire', 'shareaholic' ); ?></span>
|
36 |
<p><?php _e( 'Reach over 400 million people with native ads and promoted content.', 'shareaholic' ); ?></p>
|
37 |
+
</li>
|
38 |
</ul>
|
39 |
+
</section>
|
40 |
</div>
|
41 |
-->
|
42 |
+
|
43 |
<div class="pvl">
|
44 |
+
<a id="get_started" class="btn_main" style="margin-top: -20px;"><?php echo sprintf( __( 'Get Started »', 'shareaholic' ) ); ?></a>
|
45 |
+
<p><small style="font-size:12px; color: rgb(136, 136, 136);"><?php echo sprintf( __( 'By clicking "Get Started" you agree to Shareholic\'s %1$sTerms of Service%2$s and %3$sPrivacy Policy%4$s.', 'shareaholic' ), '<a href="https://www.shareaholic.com/terms/?src=wp_admin" target="_new">', '</a>', '<a href="https://www.shareaholic.com/privacy/?src=wp_admin" target="_new">', '</a>' ); ?></small>
|
46 |
+
</p>
|
47 |
</div>
|
48 |
|
49 |
+
</div>
|
50 |
</div>
|
templates/terms_of_service_notice.php
CHANGED
@@ -1,13 +1,12 @@
|
|
1 |
<?php if ( current_user_can( 'manage_options' ) ) { ?>
|
2 |
-
|
3 |
-
<div class="shareaholic-wrap-container" style="background-color: #009688; margin: 5px 0px 5px -20px;">
|
4 |
<div style="margin: 0px 15px 0 20px; float: left;">
|
5 |
-
|
6 |
</div>
|
7 |
<div class="shareaholic-text-container" style="color: #fff; text-shadow: 0px 1px 1px rgba(0,0,0,0.2); font-size: 14px; line-height: 1.5em; height: 50px; vertical-align: middle; display: table-cell; line-height: 1.5;">
|
8 |
-
|
9 |
</div>
|
10 |
-
|
11 |
-
|
12 |
|
13 |
<?php } ?>
|
1 |
<?php if ( current_user_can( 'manage_options' ) ) { ?>
|
2 |
+
<div class="shareaholic-wrap-container" style="background-color: #009688; margin: 5px 0px 5px -20px;">
|
|
|
3 |
<div style="margin: 0px 15px 0 20px; float: left;">
|
4 |
+
<img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>img/check.png" width="56" height="50" />
|
5 |
</div>
|
6 |
<div class="shareaholic-text-container" style="color: #fff; text-shadow: 0px 1px 1px rgba(0,0,0,0.2); font-size: 14px; line-height: 1.5em; height: 50px; vertical-align: middle; display: table-cell; line-height: 1.5;">
|
7 |
+
<?php echo sprintf( __( 'You\'ve added Shareaholic - Welcome! Action required: %1$sComplete Installation »%2$s', 'shareaholic' ), '<a href="admin.php?page=shareaholic-settings" class="button-secondary" style="vertical-align: initial;">', '</a>' ); ?>
|
8 |
</div>
|
9 |
+
</div>
|
10 |
+
<div style="clear:both;"></div>
|
11 |
|
12 |
<?php } ?>
|
templates/verify_api_key_js.php
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
<script>
|
2 |
Shareaholic.click_objects['unverified_app_settings'] = {
|
3 |
-
|
4 |
-
|
5 |
url = first_part_of_url + 'verify'
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
Shareaholic.click_objects['app_settings'].url(button)
|
11 |
-
|
12 |
return url;
|
13 |
-
|
14 |
-
|
15 |
Shareaholic.click_objects['app_settings'].callback(button);
|
16 |
-
|
17 |
-
|
18 |
}
|
19 |
|
20 |
Shareaholic.click_objects['unverified_general_settings'] = {
|
21 |
-
|
22 |
-
|
23 |
url = first_part_of_url + 'verify'
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
Shareaholic.click_objects['general_settings'].url(button)
|
28 |
-
|
29 |
return Shareaholic.click_objects['general_settings'].url(button);
|
30 |
-
|
31 |
-
|
32 |
Shareaholic.click_objects['general_settings'].callback(button);
|
33 |
-
|
34 |
-
|
35 |
}
|
36 |
</script>
|
1 |
<script>
|
2 |
Shareaholic.click_objects['unverified_app_settings'] = {
|
3 |
+
selector: Shareaholic.click_objects['app_settings'].selector,
|
4 |
+
url: function(button) {
|
5 |
url = first_part_of_url + 'verify'
|
6 |
+
+ '?verification_key=<?php echo $verification_key; ?>'
|
7 |
+
+ '&embedded=true'
|
8 |
+
+ '&redirect_to='
|
9 |
+
+ encodeURIComponent(
|
10 |
Shareaholic.click_objects['app_settings'].url(button)
|
11 |
+
);
|
12 |
return url;
|
13 |
+
},
|
14 |
+
callback: function(button) {
|
15 |
Shareaholic.click_objects['app_settings'].callback(button);
|
16 |
+
},
|
17 |
+
close: Shareaholic.click_objects['app_settings'].close
|
18 |
}
|
19 |
|
20 |
Shareaholic.click_objects['unverified_general_settings'] = {
|
21 |
+
selector: Shareaholic.click_objects['general_settings'].selector,
|
22 |
+
url: function(button) {
|
23 |
url = first_part_of_url + 'verify'
|
24 |
+
+ '?verification_key=<?php echo $verification_key; ?>'
|
25 |
+
+ '&redirect_to='
|
26 |
+
+ encodeURIComponent(
|
27 |
Shareaholic.click_objects['general_settings'].url(button)
|
28 |
+
);
|
29 |
return Shareaholic.click_objects['general_settings'].url(button);
|
30 |
+
},
|
31 |
+
callback: function(button) {
|
32 |
Shareaholic.click_objects['general_settings'].callback(button);
|
33 |
+
},
|
34 |
+
close: Shareaholic.click_objects['general_settings'].close
|
35 |
}
|
36 |
</script>
|
templates/why_to_sign_up.php
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
<div class="col-sm-4">
|
2 |
-
|
3 |
<p class="promoh1">
|
4 |
-
|
5 |
</p>
|
6 |
<ul>
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
</ul>
|
15 |
<a href="<?php echo esc_url( admin_url( 'admin.php?shareaholic_redirect_url=shareaholic.com/signup/' ) ); ?>" target="_blank" class="btn btn-info btn-lg" role="button" style="font-size: 16px;"><?php echo sprintf( __( 'Shareaholic Dashboard', 'shareaholic' ) ); ?></a>
|
16 |
<p class="signuppromo_note">
|
17 |
-
|
18 |
</p>
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
<div id="shrsb-updates">
|
24 |
<div id="shrsb-updates-container"></div>
|
25 |
</div>
|
26 |
-
|
27 |
|
28 |
</div>
|
1 |
<div class="col-sm-4">
|
2 |
+
<!--<div class="signuppromo">
|
3 |
<p class="promoh1">
|
4 |
+
<?php echo sprintf( __( 'Link to Shareaholic.com to unlock:', 'shareaholic' ) ); ?>
|
5 |
</p>
|
6 |
<ul>
|
7 |
+
<li><?php echo sprintf( __( 'Analytics', 'shareaholic' ) ); ?></li>
|
8 |
+
<li><?php echo sprintf( __( 'Floating Share buttons', 'shareaholic' ) ); ?></li>
|
9 |
+
<li><?php echo sprintf( __( 'Social Share Count Recovery', 'shareaholic' ) ); ?></li>
|
10 |
+
<li><?php echo sprintf( __( 'Follow buttons', 'shareaholic' ) ); ?></li>
|
11 |
+
<li><?php echo sprintf( __( 'Share Buttons for Images', 'shareaholic' ) ); ?></li>
|
12 |
+
<li><?php echo sprintf( __( 'Earnings Dashboard', 'shareaholic' ) ); ?></li>
|
13 |
+
<li><?php echo sprintf( __( '...lots more!', 'shareaholic' ) ); ?></li>
|
14 |
</ul>
|
15 |
<a href="<?php echo esc_url( admin_url( 'admin.php?shareaholic_redirect_url=shareaholic.com/signup/' ) ); ?>" target="_blank" class="btn btn-info btn-lg" role="button" style="font-size: 16px;"><?php echo sprintf( __( 'Shareaholic Dashboard', 'shareaholic' ) ); ?></a>
|
16 |
<p class="signuppromo_note">
|
17 |
+
<?php echo sprintf( __( 'Already have a Shareaholic account? Click the button above to log in.', 'shareaholic' ) ); ?>
|
18 |
</p>
|
19 |
+
</div>
|
20 |
+
-->
|
21 |
|
22 |
+
<div class="sidebar_links">
|
23 |
<div id="shrsb-updates">
|
24 |
<div id="shrsb-updates-container"></div>
|
25 |
</div>
|
26 |
+
</div>
|
27 |
|
28 |
</div>
|
utilities.php
CHANGED
@@ -20,7 +20,7 @@ class ShareaholicUtilities {
|
|
20 |
* Logs to the PHP error log if plugin's url is set to
|
21 |
* spreadaholic or the SHAREAHOLIC_DEBUG constant is true.
|
22 |
*
|
23 |
-
* @param mixed $thing anything to be logged, it will be passed to `print_r
|
24 |
*/
|
25 |
public static function log( $thing ) {
|
26 |
if ( preg_match( '/spreadaholic/', Shareaholic::URL ) || SHAREAHOLIC_DEBUG ) {
|
@@ -32,8 +32,8 @@ class ShareaholicUtilities {
|
|
32 |
* Locate and require a template, and extract some variables
|
33 |
* to be used in that template.
|
34 |
*
|
35 |
-
* @param string $template the name of the template
|
36 |
-
* @param array $vars any variables to be extracted into the template
|
37 |
*/
|
38 |
public static function load_template( $template, $vars = array() ) {
|
39 |
// you cannot let locate_template to load your template
|
@@ -68,12 +68,12 @@ class ShareaholicUtilities {
|
|
68 |
'json'
|
69 |
);
|
70 |
|
71 |
-
// set the location on/off back to their defaults
|
72 |
if ( isset( $settings['location_name_ids'] ) && is_array( $settings['location_name_ids'] ) ) {
|
73 |
self::set_default_location_settings( $settings['location_name_ids'] );
|
74 |
}
|
75 |
|
76 |
-
// Sync local locations with Cloud
|
77 |
self::location_sync_to_cloud();
|
78 |
}
|
79 |
|
@@ -85,12 +85,12 @@ class ShareaholicUtilities {
|
|
85 |
*/
|
86 |
private static function defaults() {
|
87 |
return array(
|
88 |
-
'disable_admin_bar_menu' => 'on', // advanced
|
89 |
-
'disable_review_notice' => 'off', // advanced
|
90 |
-
'disable_debug_info' => 'off', // advanced
|
91 |
-
'enable_user_nicename' => 'off', // advanced
|
92 |
-
'disable_internal_share_counts_api' => 'on', // advanced
|
93 |
-
'disable_og_tags' => 'off', // advanced
|
94 |
'api_key' => '',
|
95 |
'verification_key' => '',
|
96 |
'recommendations_display_on_excerpts' => 'on',
|
@@ -99,7 +99,7 @@ class ShareaholicUtilities {
|
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
-
* Returns links to add to the plugin options admin page
|
103 |
*
|
104 |
* @param array $links
|
105 |
* @return array
|
@@ -227,7 +227,7 @@ class ShareaholicUtilities {
|
|
227 |
/**
|
228 |
* Wrapper for WordPress's update_option
|
229 |
*
|
230 |
-
* @param array $array an array of options to update
|
231 |
* @return bool
|
232 |
*/
|
233 |
public static function update_options( $array ) {
|
@@ -258,7 +258,7 @@ class ShareaholicUtilities {
|
|
258 |
/**
|
259 |
* Set the current version, how simple.
|
260 |
*
|
261 |
-
* @param string $version the version you want to set
|
262 |
*/
|
263 |
public static function set_version( $version ) {
|
264 |
self::update_options( array( 'version' => $version ) );
|
@@ -378,7 +378,7 @@ class ShareaholicUtilities {
|
|
378 |
if ( ! self::is_locked( 'perform_update' ) ) {
|
379 |
self::set_lock( 'perform_update' );
|
380 |
|
381 |
-
// Upgrade v6
|
382 |
if ( self::get_version() && intval( self::get_version() ) <= 6 ) {
|
383 |
ShareaholicSixToSeven::update();
|
384 |
}
|
@@ -386,15 +386,15 @@ class ShareaholicUtilities {
|
|
386 |
// Activate Shareaholic Cron job
|
387 |
ShareaholicCron::activate();
|
388 |
|
389 |
-
// Upgrade v8
|
390 |
if ( self::get_version() && intval( self::get_version() ) <= 8 && intval( self::get_version() ) > 7 ) {
|
391 |
self::EightToNineUpdate();
|
392 |
}
|
393 |
|
394 |
-
// Clear site cache
|
395 |
self::clear_cache();
|
396 |
|
397 |
-
// add other things that need to run on version change here
|
398 |
self::unlock( 'perform_update' );
|
399 |
}
|
400 |
}
|
@@ -1024,41 +1024,41 @@ class ShareaholicUtilities {
|
|
1024 |
$site_language = strtolower( get_bloginfo( 'language' ) );
|
1025 |
|
1026 |
if ( strpos( $site_language, 'en-' ) !== false ) {
|
1027 |
-
$language_id = 9; // English
|
1028 |
} elseif ( strpos( $site_language, 'da-' ) !== false ) {
|
1029 |
-
$language_id = 7; // Danish
|
1030 |
} elseif ( strpos( $site_language, 'de-' ) !== false ) {
|
1031 |
-
$language_id = 13; // German
|
1032 |
} elseif ( strpos( $site_language, 'es-' ) !== false ) {
|
1033 |
-
$language_id = 31; // Spanish
|
1034 |
} elseif ( strpos( $site_language, 'fr-' ) !== false ) {
|
1035 |
-
$language_id = 12; // French
|
1036 |
} elseif ( strpos( $site_language, 'pt-' ) !== false ) {
|
1037 |
-
$language_id = 25; // Portuguese
|
1038 |
} elseif ( strpos( $site_language, 'it-' ) !== false ) {
|
1039 |
-
$language_id = 18; // Italian
|
1040 |
} elseif ( strpos( $site_language, 'zh-cn' ) !== false ) {
|
1041 |
-
$language_id = 3; // Chinese (Simplified)
|
1042 |
} elseif ( strpos( $site_language, 'zh-tw' ) !== false ) {
|
1043 |
-
$language_id = 4; // Chinese (Traditional)
|
1044 |
} elseif ( strpos( $site_language, 'ja-' ) !== false ) {
|
1045 |
-
$language_id = 19; // Japanese
|
1046 |
} elseif ( strpos( $site_language, 'ar-' ) !== false ) {
|
1047 |
-
$language_id = 1; // Arabic
|
1048 |
} elseif ( strpos( $site_language, 'sv-' ) !== false ) {
|
1049 |
-
$language_id = 32; // Swedish
|
1050 |
} elseif ( strpos( $site_language, 'tr-' ) !== false ) {
|
1051 |
-
$language_id = 34; // Turkish
|
1052 |
} elseif ( strpos( $site_language, 'el-' ) !== false ) {
|
1053 |
-
$language_id = 14; // Greek
|
1054 |
} elseif ( strpos( $site_language, 'nl-' ) !== false ) {
|
1055 |
-
$language_id = 8; // Dutch
|
1056 |
} elseif ( strpos( $site_language, 'pl-' ) !== false ) {
|
1057 |
-
$language_id = 24; // Polish
|
1058 |
} elseif ( strpos( $site_language, 'ru-' ) !== false ) {
|
1059 |
-
$language_id = 27; // Russian
|
1060 |
} elseif ( strpos( $site_language, 'cs-' ) !== false ) {
|
1061 |
-
$language_id = 6; // Czech
|
1062 |
} else {
|
1063 |
$language_id = null;
|
1064 |
}
|
@@ -1459,15 +1459,15 @@ class ShareaholicUtilities {
|
|
1459 |
*/
|
1460 |
public static function clear_cache() {
|
1461 |
|
1462 |
-
// Default WordPress
|
1463 |
if ( function_exists( 'wp_cache_flush' ) ) {
|
1464 |
wp_cache_flush();
|
1465 |
}
|
1466 |
-
// W3 Total Cache plugin
|
1467 |
if ( function_exists( 'w3tc_pgcache_flush' ) ) {
|
1468 |
w3tc_pgcache_flush();
|
1469 |
}
|
1470 |
-
// WP Super Cache
|
1471 |
if ( function_exists( 'wp_cache_clear_cache' ) ) {
|
1472 |
if ( is_multisite() ) {
|
1473 |
$blog_id = get_current_blog_id();
|
@@ -1476,7 +1476,7 @@ class ShareaholicUtilities {
|
|
1476 |
wp_cache_clear_cache();
|
1477 |
}
|
1478 |
}
|
1479 |
-
// Hyper Cache
|
1480 |
if ( function_exists( 'hyper_cache_flush_all' ) ) {
|
1481 |
hyper_cache_flush_all();
|
1482 |
}
|
@@ -1487,7 +1487,7 @@ class ShareaholicUtilities {
|
|
1487 |
$WpFastestCache->deleteCache();
|
1488 |
}
|
1489 |
}
|
1490 |
-
// WPEngine
|
1491 |
if ( class_exists( 'WpeCommon' ) ) {
|
1492 |
if ( method_exists( 'WpeCommon', 'purge_memcached' ) ) {
|
1493 |
WpeCommon::purge_memcached();
|
@@ -1499,19 +1499,19 @@ class ShareaholicUtilities {
|
|
1499 |
WpeCommon::purge_varnish_cache();
|
1500 |
}
|
1501 |
}
|
1502 |
-
// Cachify Cache
|
1503 |
if ( has_action( 'cachify_flush_cache' ) ) {
|
1504 |
do_action( 'cachify_flush_cache' );
|
1505 |
}
|
1506 |
-
// Quick Cache
|
1507 |
if ( function_exists( 'auto_clear_cache' ) ) {
|
1508 |
auto_clear_cache();
|
1509 |
}
|
1510 |
-
// Zencache
|
1511 |
if ( class_exists( 'zencache' ) ) {
|
1512 |
zencache::clear();
|
1513 |
}
|
1514 |
-
// CometCache
|
1515 |
if ( class_exists( 'comet_cache' ) ) {
|
1516 |
comet_cache::clear();
|
1517 |
}
|
@@ -1600,12 +1600,12 @@ class ShareaholicUtilities {
|
|
1600 |
if ( is_array( $response ) && array_key_exists( 'body', $response ) ) {
|
1601 |
$response_code = wp_remote_retrieve_response_code( $response );
|
1602 |
if ( $response_code == '404' ) {
|
1603 |
-
// Site ID is not active in Shareaholic Cloud
|
1604 |
exit;
|
1605 |
}
|
1606 |
}
|
1607 |
|
1608 |
-
// If Cloud location = off then set Plugin location = off
|
1609 |
$publisher_configuration = $response['body'];
|
1610 |
if ( $publisher_configuration && is_array( $publisher_configuration ) ) {
|
1611 |
foreach ( array( 'share_buttons', 'recommendations' ) as $app ) {
|
@@ -1621,7 +1621,7 @@ class ShareaholicUtilities {
|
|
1621 |
}
|
1622 |
}
|
1623 |
|
1624 |
-
// Send Plugin settings to Cloud
|
1625 |
self::location_sync_to_cloud();
|
1626 |
}
|
1627 |
}
|
@@ -1938,8 +1938,8 @@ class ShareaholicUtilities {
|
|
1938 |
* Shorten a string to a certain character limit
|
1939 |
* If the limit is reached, then return the truncated text
|
1940 |
*
|
1941 |
-
* @param {String} $text the text to truncate
|
1942 |
-
* @param {Number} $char_count the max number of characters
|
1943 |
* @return {String} the truncated text
|
1944 |
*/
|
1945 |
public static function truncate_text( $text, $char_count ) {
|
20 |
* Logs to the PHP error log if plugin's url is set to
|
21 |
* spreadaholic or the SHAREAHOLIC_DEBUG constant is true.
|
22 |
*
|
23 |
+
* @param mixed $thing anything to be logged, it will be passed to `print_r`.
|
24 |
*/
|
25 |
public static function log( $thing ) {
|
26 |
if ( preg_match( '/spreadaholic/', Shareaholic::URL ) || SHAREAHOLIC_DEBUG ) {
|
32 |
* Locate and require a template, and extract some variables
|
33 |
* to be used in that template.
|
34 |
*
|
35 |
+
* @param string $template the name of the template.
|
36 |
+
* @param array $vars any variables to be extracted into the template.
|
37 |
*/
|
38 |
public static function load_template( $template, $vars = array() ) {
|
39 |
// you cannot let locate_template to load your template
|
68 |
'json'
|
69 |
);
|
70 |
|
71 |
+
// set the location on/off back to their defaults.
|
72 |
if ( isset( $settings['location_name_ids'] ) && is_array( $settings['location_name_ids'] ) ) {
|
73 |
self::set_default_location_settings( $settings['location_name_ids'] );
|
74 |
}
|
75 |
|
76 |
+
// Sync local locations with Cloud.
|
77 |
self::location_sync_to_cloud();
|
78 |
}
|
79 |
|
85 |
*/
|
86 |
private static function defaults() {
|
87 |
return array(
|
88 |
+
'disable_admin_bar_menu' => 'on', // advanced.
|
89 |
+
'disable_review_notice' => 'off', // advanced.
|
90 |
+
'disable_debug_info' => 'off', // advanced.
|
91 |
+
'enable_user_nicename' => 'off', // advanced.
|
92 |
+
'disable_internal_share_counts_api' => 'on', // advanced.
|
93 |
+
'disable_og_tags' => 'off', // advanced.
|
94 |
'api_key' => '',
|
95 |
'verification_key' => '',
|
96 |
'recommendations_display_on_excerpts' => 'on',
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
+
* Returns links to add to the plugin options admin page.
|
103 |
*
|
104 |
* @param array $links
|
105 |
* @return array
|
227 |
/**
|
228 |
* Wrapper for WordPress's update_option
|
229 |
*
|
230 |
+
* @param array $array an array of options to update.
|
231 |
* @return bool
|
232 |
*/
|
233 |
public static function update_options( $array ) {
|
258 |
/**
|
259 |
* Set the current version, how simple.
|
260 |
*
|
261 |
+
* @param string $version the version you want to set.
|
262 |
*/
|
263 |
public static function set_version( $version ) {
|
264 |
self::update_options( array( 'version' => $version ) );
|
378 |
if ( ! self::is_locked( 'perform_update' ) ) {
|
379 |
self::set_lock( 'perform_update' );
|
380 |
|
381 |
+
// Upgrade v6!
|
382 |
if ( self::get_version() && intval( self::get_version() ) <= 6 ) {
|
383 |
ShareaholicSixToSeven::update();
|
384 |
}
|
386 |
// Activate Shareaholic Cron job
|
387 |
ShareaholicCron::activate();
|
388 |
|
389 |
+
// Upgrade v8!
|
390 |
if ( self::get_version() && intval( self::get_version() ) <= 8 && intval( self::get_version() ) > 7 ) {
|
391 |
self::EightToNineUpdate();
|
392 |
}
|
393 |
|
394 |
+
// Clear site cache.
|
395 |
self::clear_cache();
|
396 |
|
397 |
+
// add other things that need to run on version change here.
|
398 |
self::unlock( 'perform_update' );
|
399 |
}
|
400 |
}
|
1024 |
$site_language = strtolower( get_bloginfo( 'language' ) );
|
1025 |
|
1026 |
if ( strpos( $site_language, 'en-' ) !== false ) {
|
1027 |
+
$language_id = 9; // English!
|
1028 |
} elseif ( strpos( $site_language, 'da-' ) !== false ) {
|
1029 |
+
$language_id = 7; // Danish!
|
1030 |
} elseif ( strpos( $site_language, 'de-' ) !== false ) {
|
1031 |
+
$language_id = 13; // German!
|
1032 |
} elseif ( strpos( $site_language, 'es-' ) !== false ) {
|
1033 |
+
$language_id = 31; // Spanish!
|
1034 |
} elseif ( strpos( $site_language, 'fr-' ) !== false ) {
|
1035 |
+
$language_id = 12; // French!
|
1036 |
} elseif ( strpos( $site_language, 'pt-' ) !== false ) {
|
1037 |
+
$language_id = 25; // Portuguese!
|
1038 |
} elseif ( strpos( $site_language, 'it-' ) !== false ) {
|
1039 |
+
$language_id = 18; // Italian!
|
1040 |
} elseif ( strpos( $site_language, 'zh-cn' ) !== false ) {
|
1041 |
+
$language_id = 3; // Chinese (Simplified)!
|
1042 |
} elseif ( strpos( $site_language, 'zh-tw' ) !== false ) {
|
1043 |
+
$language_id = 4; // Chinese (Traditional)!
|
1044 |
} elseif ( strpos( $site_language, 'ja-' ) !== false ) {
|
1045 |
+
$language_id = 19; // Japanese!
|
1046 |
} elseif ( strpos( $site_language, 'ar-' ) !== false ) {
|
1047 |
+
$language_id = 1; // Arabic!
|
1048 |
} elseif ( strpos( $site_language, 'sv-' ) !== false ) {
|
1049 |
+
$language_id = 32; // Swedish!
|
1050 |
} elseif ( strpos( $site_language, 'tr-' ) !== false ) {
|
1051 |
+
$language_id = 34; // Turkish!
|
1052 |
} elseif ( strpos( $site_language, 'el-' ) !== false ) {
|
1053 |
+
$language_id = 14; // Greek!
|
1054 |
} elseif ( strpos( $site_language, 'nl-' ) !== false ) {
|
1055 |
+
$language_id = 8; // Dutch!
|
1056 |
} elseif ( strpos( $site_language, 'pl-' ) !== false ) {
|
1057 |
+
$language_id = 24; // Polish!
|
1058 |
} elseif ( strpos( $site_language, 'ru-' ) !== false ) {
|
1059 |
+
$language_id = 27; // Russian!
|
1060 |
} elseif ( strpos( $site_language, 'cs-' ) !== false ) {
|
1061 |
+
$language_id = 6; // Czech!
|
1062 |
} else {
|
1063 |
$language_id = null;
|
1064 |
}
|
1459 |
*/
|
1460 |
public static function clear_cache() {
|
1461 |
|
1462 |
+
// Default WordPress?
|
1463 |
if ( function_exists( 'wp_cache_flush' ) ) {
|
1464 |
wp_cache_flush();
|
1465 |
}
|
1466 |
+
// W3 Total Cache plugin?
|
1467 |
if ( function_exists( 'w3tc_pgcache_flush' ) ) {
|
1468 |
w3tc_pgcache_flush();
|
1469 |
}
|
1470 |
+
// WP Super Cache?
|
1471 |
if ( function_exists( 'wp_cache_clear_cache' ) ) {
|
1472 |
if ( is_multisite() ) {
|
1473 |
$blog_id = get_current_blog_id();
|
1476 |
wp_cache_clear_cache();
|
1477 |
}
|
1478 |
}
|
1479 |
+
// Hyper Cache?
|
1480 |
if ( function_exists( 'hyper_cache_flush_all' ) ) {
|
1481 |
hyper_cache_flush_all();
|
1482 |
}
|
1487 |
$WpFastestCache->deleteCache();
|
1488 |
}
|
1489 |
}
|
1490 |
+
// WPEngine?
|
1491 |
if ( class_exists( 'WpeCommon' ) ) {
|
1492 |
if ( method_exists( 'WpeCommon', 'purge_memcached' ) ) {
|
1493 |
WpeCommon::purge_memcached();
|
1499 |
WpeCommon::purge_varnish_cache();
|
1500 |
}
|
1501 |
}
|
1502 |
+
// Cachify Cache?
|
1503 |
if ( has_action( 'cachify_flush_cache' ) ) {
|
1504 |
do_action( 'cachify_flush_cache' );
|
1505 |
}
|
1506 |
+
// Quick Cache?
|
1507 |
if ( function_exists( 'auto_clear_cache' ) ) {
|
1508 |
auto_clear_cache();
|
1509 |
}
|
1510 |
+
// Zencache?
|
1511 |
if ( class_exists( 'zencache' ) ) {
|
1512 |
zencache::clear();
|
1513 |
}
|
1514 |
+
// CometCache?
|
1515 |
if ( class_exists( 'comet_cache' ) ) {
|
1516 |
comet_cache::clear();
|
1517 |
}
|
1600 |
if ( is_array( $response ) && array_key_exists( 'body', $response ) ) {
|
1601 |
$response_code = wp_remote_retrieve_response_code( $response );
|
1602 |
if ( $response_code == '404' ) {
|
1603 |
+
// Site ID is not active in Shareaholic Cloud.
|
1604 |
exit;
|
1605 |
}
|
1606 |
}
|
1607 |
|
1608 |
+
// If Cloud location = off then set Plugin location = off.
|
1609 |
$publisher_configuration = $response['body'];
|
1610 |
if ( $publisher_configuration && is_array( $publisher_configuration ) ) {
|
1611 |
foreach ( array( 'share_buttons', 'recommendations' ) as $app ) {
|
1621 |
}
|
1622 |
}
|
1623 |
|
1624 |
+
// Send Plugin settings to Cloud.
|
1625 |
self::location_sync_to_cloud();
|
1626 |
}
|
1627 |
}
|
1938 |
* Shorten a string to a certain character limit
|
1939 |
* If the limit is reached, then return the truncated text
|
1940 |
*
|
1941 |
+
* @param {String} $text the text to truncate.
|
1942 |
+
* @param {Number} $char_count the max number of characters.
|
1943 |
* @return {String} the truncated text
|
1944 |
*/
|
1945 |
public static function truncate_text( $text, $char_count ) {
|