Feed Them Social – Facebook, Instagram, Twitter, YouTube, Pinterest - Version 2.4.0

Version Description

Download this release

Release Info

Developer slickremix
Plugin Icon 128x128 Feed Them Social – Facebook, Instagram, Twitter, YouTube, Pinterest
Version 2.4.0
Comparing to
See all releases

Code changes from version 2.3.9 to 2.4.0

SUPPORT.md DELETED
@@ -1,13 +0,0 @@
1
- Getting help with Feed Them Social or FTS extensions
2
- ========================
3
-
4
- We look forward to helping resolve any issues or relaying any feedback or ideas you have about Feed Them Social. To report an issue, receive support, give us feedback, or send us an idea please open a support ticket.
5
-
6
- Support Ticket
7
- ------
8
-
9
- We recommend all users with support questions email us via the support form found at [SlickRemix.com/support/](https://www.slickremix.com/support/). GitHub is used for core development only, and is not the place to seek help or report non-developer issues for Feed Them Social or FTS extensions.
10
-
11
- Before opening a support ticket, please also review our [Documentation](http://www.slickremix.com/feed-them-social/) for assistance with common issues and FAQs.
12
-
13
- If reporting a bug, please be as descriptive as possible and include links to screenshots or screenshares that demonstrate the issue.
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/feed-them-facebook-style-options-page.php CHANGED
@@ -792,8 +792,6 @@ class FTS_facebook_options_page
792
  <!--/fts-facebook-feed-styles-input-wrap-->
793
  <?php } ?>
794
 
795
-
796
-
797
  <div class="feed-them-social-admin-input-wrap">
798
  <div class="fts-title-description-settings-page">
799
  <h3>
792
  <!--/fts-facebook-feed-styles-input-wrap-->
793
  <?php } ?>
794
 
 
 
795
  <div class="feed-them-social-admin-input-wrap">
796
  <div class="fts-title-description-settings-page">
797
  <h3>
admin/feed-them-instagram-style-options-page.php CHANGED
@@ -27,6 +27,7 @@ class FTS_instagram_options_page
27
  function feed_them_instagram_options_page() {
28
  $fts_functions = new feed_them_social_functions();
29
  $fts_instagram_access_token = get_option('fts_instagram_custom_api_token');
 
30
  $fts_instagram_show_follow_btn = get_option('instagram_show_follow_btn');
31
  $fts_instagram_show_follow_btn_where = get_option('instagram_show_follow_btn_where');
32
 
@@ -71,7 +72,18 @@ class FTS_instagram_options_page
71
  </div>
72
 
73
  <div class="fts-clear"></div>
 
 
74
  <div class="feed-them-social-admin-input-wrap" style="margin-bottom: 0px">
 
 
 
 
 
 
 
 
 
75
  <div class="feed-them-social-admin-input-label fts-instagram-border-bottom-color-label">
76
  <?php _e('Access Token Required', 'feed-them-social'); ?>
77
  </div>
@@ -84,18 +96,34 @@ class FTS_instagram_options_page
84
  }
85
 
86
  if (window.location.hash) {
 
 
 
87
  $('#fts_instagram_custom_api_token').val('');
88
  $('#fts_instagram_custom_api_token').val($('#fts_instagram_custom_api_token').val() + getQueryString('access_token'));
 
 
 
 
 
 
89
  }
90
  });
91
  </script>
92
- <input type="text" name="fts_instagram_custom_api_token" class="feed-them-social-admin-input" id="fts_instagram_custom_api_token" value="<?php echo get_option('fts_instagram_custom_api_token'); ?>"/>
93
  <div class="fts-clear"></div>
94
  </div>
95
  <?php
96
  // Error Check
 
 
 
 
 
 
 
97
  if (!isset($test_app_token_response->meta->error_message) && !empty($fts_instagram_access_token) || isset($test_app_token_response->meta->error_message) && $test_app_token_response->meta->error_message == 'This client has not been approved to access this resource.') {
98
- echo '<div class="fts-successful-api-token">' . __('Your access token is working! Generate your shortcode on the <a href="admin.php?page=feed-them-settings-page">settings page</a>.', 'feed-them-social') . '</div>';
99
  } elseif (isset($test_app_token_response->meta->error_message) && !empty($fts_instagram_access_token)) {
100
  echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response->meta->error_message . '</div>';
101
  }
27
  function feed_them_instagram_options_page() {
28
  $fts_functions = new feed_them_social_functions();
29
  $fts_instagram_access_token = get_option('fts_instagram_custom_api_token');
30
+ $fts_instagram_custom_id = get_option('fts_instagram_custom_id');
31
  $fts_instagram_show_follow_btn = get_option('instagram_show_follow_btn');
32
  $fts_instagram_show_follow_btn_where = get_option('instagram_show_follow_btn_where');
33
 
72
  </div>
73
 
74
  <div class="fts-clear"></div>
75
+
76
+
77
  <div class="feed-them-social-admin-input-wrap" style="margin-bottom: 0px">
78
+ <div class="feed-them-social-admin-input-label fts-instagram-border-bottom-color-label">
79
+ <?php _e('Instagram ID', 'feed-them-social'); ?>
80
+ </div>
81
+ <input type="text" name="fts_instagram_custom_id" class="feed-them-social-admin-input" id="fts_instagram_custom_id" value="<?php echo $fts_instagram_custom_id ?>"/>
82
+ <div class="fts-clear"></div>
83
+ </div>
84
+
85
+
86
+ <div class="feed-them-social-admin-input-wrap">
87
  <div class="feed-them-social-admin-input-label fts-instagram-border-bottom-color-label">
88
  <?php _e('Access Token Required', 'feed-them-social'); ?>
89
  </div>
96
  }
97
 
98
  if (window.location.hash) {
99
+
100
+ $('select').find('option[value=5]').attr('selected','selected');
101
+
102
  $('#fts_instagram_custom_api_token').val('');
103
  $('#fts_instagram_custom_api_token').val($('#fts_instagram_custom_api_token').val() + getQueryString('access_token'));
104
+
105
+
106
+ $('#fts_instagram_custom_id').val('');
107
+ var str = getQueryString('access_token');
108
+ $('#fts_instagram_custom_id').val($('#fts_instagram_custom_id').val() + str.split('.', 1));
109
+
110
  }
111
  });
112
  </script>
113
+ <input type="text" name="fts_instagram_custom_api_token" class="feed-them-social-admin-input" id="fts_instagram_custom_api_token" value="<?php echo $fts_instagram_access_token ?>"/>
114
  <div class="fts-clear"></div>
115
  </div>
116
  <?php
117
  // Error Check
118
+ // if the combined streams plugin is active we won't allow the settings page link to open up the Instagram Feed, instead we'll remove the #feed_type=instagram and just let the user manually select the combined streams or single instagram feed.
119
+ if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php')) {
120
+ $custom_instagram_link_hash = '';
121
+ }
122
+ else {
123
+ $custom_instagram_link_hash = '#feed_type=instagram';
124
+ }
125
  if (!isset($test_app_token_response->meta->error_message) && !empty($fts_instagram_access_token) || isset($test_app_token_response->meta->error_message) && $test_app_token_response->meta->error_message == 'This client has not been approved to access this resource.') {
126
+ echo '<div class="fts-successful-api-token">' . __('Your access token is working! Generate your shortcode on the <a href="admin.php?page=feed-them-settings-page'.$custom_instagram_link_hash .'">settings page</a>.', 'feed-them-social') . '</div>';
127
  } elseif (isset($test_app_token_response->meta->error_message) && !empty($fts_instagram_access_token)) {
128
  echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response->meta->error_message . '</div>';
129
  }
admin/feed-them-settings-page-before-big-change.php DELETED
@@ -1,1452 +0,0 @@
1
- <?php
2
- namespace feedthemsocial;
3
- /**
4
- * Class FTS Settings Page
5
- *
6
- * @package feedthemsocial
7
- * @since 1.9.6
8
- */
9
- class FTS_settings_page
10
- {
11
- /**
12
- * Construct
13
- *
14
- * FTS_settings_page constructor.
15
- *
16
- * @since 1.9.6
17
- */
18
- function __construct()
19
- {
20
- }
21
-
22
- /**
23
- * Feed Them Settings Page
24
- *
25
- * Main Settings Page.
26
- *
27
- * @since 1.9.6
28
- */
29
- function feed_them_settings_page()
30
- {
31
- $fts_functions = new feed_them_social_functions();
32
-
33
- if (!function_exists('curl_init')) {
34
- print '<div class="error"><p>' . __('Warning: cURL is not installed on this server. It is required to use this plugin. Please contact your host provider to install this.', 'feed-them-social') . '</p></div>';
35
- } ?>
36
-
37
- <div class="feed-them-social-admin-wrap">
38
- <div class="fts-backg"></div>
39
- <div class="fts-content">
40
- <h1><?php _e('Feed Them Social', 'feed-them-social'); ?></h1>
41
- <div class="use-of-plugin"><?php _e('Please select what type of feed you would like to see. Then you can copy and paste the shortcode to a page, post or widget.', 'feed-them-social'); ?></div>
42
- <div class="feed-them-icon-wrap">
43
- <a href="javascript:;" class="youtube-icon"></a>
44
- <a href="javascript:;" class="vine-icon"></a>
45
- <a href="javascript:;" class="twitter-icon"></a>
46
- <a href="javascript:;" class="facebook-icon"></a>
47
- <a href="javascript:;" class="instagram-icon"></a>
48
- <a href="javascript:;" class="pinterest-icon"></a>
49
- <?php
50
- //show the js for the discount option under social icons on the settings page
51
- if (!is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?>
52
- <div id="discount-for-review"><?php _e('15% off Premium Version', 'feed-them-social'); ?></div>
53
- <div class="discount-review-text">
54
- <a href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/" target="_blank"><?php _e('Share here', 'feed-them-social'); ?></a> <?php _e('and receive 15% OFF your total order.', 'feed-them-social'); ?>
55
- </div>
56
- <?php } ?>
57
- </div>
58
- <form class="feed-them-social-admin-form">
59
- <select id="shortcode-form-selector">
60
- <option value=""><?php _e('Select a social network to get started', 'feed-them-social'); ?> </option>
61
- <option value="fb-page-shortcode-form"><?php _e('Facebook Feed', 'feed-them-social'); ?></option>
62
- <option value="twitter-shortcode-form"><?php _e('Twitter Feed', 'feed-them-social'); ?></option>
63
- <option value="vine-shortcode-form"><?php _e('Vine Feed', 'feed-them-social'); ?></option>
64
- <option value="instagram-shortcode-form"><?php _e('Instagram Feed', 'feed-them-social'); ?></option>
65
- <option value="youtube-shortcode-form"><?php _e('YouTube Feed'); ?></option>
66
- <option value="pinterest-shortcode-form"><?php _e('Pinterest Feed', 'feed-them-social'); ?></option>
67
- </select>
68
- </form><!--/feed-them-social-admin-form-->
69
- <?php
70
- //Add Facebook Event Form
71
- echo $fts_functions->fts_facebook_group_form(false);
72
- //Add Facebook Page Form
73
- echo $fts_functions->fts_facebook_page_form(false);
74
- //Add Facebook List of Events Form
75
- echo $fts_functions->fts_facebook_list_of_events_form(false);
76
- //Add Facebook Single Event Form
77
- echo $fts_functions->fts_facebook_event_form(false);
78
- //Add Twitter Form
79
- echo $fts_functions->fts_twitter_form();
80
- //Add Vine Form
81
- echo $fts_functions->fts_vine_form(false);
82
- //Add Instagram Form
83
- echo $fts_functions->fts_instagram_form(false);
84
- //Add Youtube Form
85
- echo $fts_functions->fts_youtube_form(false);
86
- //Add Pinterest Form
87
- echo $fts_functions->fts_pinterest_form(false);
88
- ?>
89
- <div class="fts-clear"></div>
90
- <div class="feed-them-clear-cache">
91
- <h2><?php _e('Clear All Cache Options', 'feed-them-social'); ?></h2>
92
- <div class="use-of-plugin"><?php _e('Please Clear Cache if you have changed a Feed Them Social Shortcode. This will Allow you to see the changes right away.', 'feed-them-social'); ?></div>
93
- <?php if (isset($_GET['cache']) && $_GET['cache'] == 'clearcache') {
94
- echo '<div class="feed-them-clear-cache-text">' . $fts_functions->feed_them_clear_cache() . '</div>';
95
- }
96
- isset($ftsDevModeCache) ? $ftsDevModeCache : "";
97
- isset($ftsAdminBarMenu) ? $ftsAdminBarMenu : "";
98
- $ftsDevModeCache = get_option('fts_clear_cache_developer_mode');
99
- $ftsAdminBarMenu = get_option('fts_admin_bar_menu');
100
- ?>
101
-
102
- <form method="post" action="?page=feed-them-settings-page&cache=clearcache">
103
- <input class="feed-them-social-admin-submit-btn" type="submit" value="<?php _e('Clear All FTS Feeds Cache', 'feed-them-social'); ?>"/>
104
- </form>
105
- </div><!--/feed-them-clear-cache-->
106
- <!-- custom option for padding -->
107
- <form method="post" class="fts-color-settings-admin-form" action="options.php">
108
- <p>
109
- <input name="fts_clear_cache_developer_mode" class="fts-color-settings-admin-input fts_clear_cache_developer_mode" type="checkbox" id="fts-color-options-settings-custom-css" value="1" <?php echo checked('1', get_option('fts_clear_cache_developer_mode')); ?>/>
110
- <?php
111
- if (get_option('fts_clear_cache_developer_mode') == '1') { ?>
112
- <?php _e('Cache will clear on every page load now', 'feed-them-social'); ?><?php
113
- } else { ?>
114
- <?php _e('Developer Mode: Clear cache on every page load', 'feed-them-social'); ?><?php
115
- }
116
- ?>
117
- </p>
118
- <select id="fts_admin_bar_menu" name="fts_admin_bar_menu">
119
- <option value="show-admin-bar-menu" <?php if ($ftsAdminBarMenu == 'show-admin-bar-menu') echo 'selected="selected"'; ?>><?php _e('Show Admin Bar Menu', 'feed-them-social'); ?></option>
120
- <option value="hide-admin-bar-menu" <?php if ($ftsAdminBarMenu == 'hide-admin-bar-menu') echo 'selected="selected"'; ?>><?php _e('Hide Admin Bar Menu', 'feed-them-social'); ?></option>
121
- </select>
122
- <div class="feed-them-custom-css">
123
- <?php // get our registered settings from the fts functions
124
- settings_fields('feed-them-social-settings'); ?>
125
- <?php
126
- isset($ftsDateTimeFormat) ? $ftsDateTimeFormat : "";
127
- isset($ftsTimezone) ? $ftsTimezone : "";
128
- isset($ftsCustomDate) ? $ftsCustomDate : "";
129
- isset($ftsCustomTime) ? $ftsCustomTime : "";
130
- $ftsDateTimeFormat = get_option('fts-date-and-time-format');
131
- $ftsTimezone = get_option('fts-timezone');
132
- $ftsCustomDate = get_option('date_format');
133
- $ftsCustomTime = get_option('time_format');
134
- $ftsCustomTimezone = get_option('fts-timezone') ? get_option('fts-timezone') : "America/Los_Angeles";
135
- date_default_timezone_set($ftsCustomTimezone);
136
-
137
- ?>
138
- <div style="float:left; max-width:400px; margin-right:30px;">
139
- <h2><?php _e('FaceBook & Twitter Date Format', 'feed-them-social'); ?></h2>
140
-
141
- <fieldset>
142
- <select id="fts-date-and-time-format" name="fts-date-and-time-format">
143
- <option value="l, F jS, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'l, F jS, Y \a\t g:ia') echo 'selected="selected"'; ?>><?php echo date('l, F jS, Y \a\t g:ia'); ?></option>
144
- <option value="F j, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'F j, Y \a\t g:ia') echo 'selected="selected"'; ?>><?php echo date('F j, Y \a\t g:ia'); ?></option>
145
- <option value="F j, Y g:ia" <?php if ($ftsDateTimeFormat == 'F j, Y g:ia') echo 'selected="selected"'; ?>><?php echo date('F j, Y g:ia'); ?></option>
146
- <option value="F, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'F, Y \a\t g:ia') echo 'selected="selected"'; ?>><?php echo date('F, Y \a\t g:ia'); ?></option>
147
- <option value="M j, Y @ g:ia" <?php if ($ftsDateTimeFormat == 'M j, Y @ g:ia') echo 'selected="selected"'; ?>><?php echo date('M j, Y @ g:ia'); ?></option>
148
- <option value="M j, Y @ G:i" <?php if ($ftsDateTimeFormat == 'M j, Y @ G:i') echo 'selected="selected"'; ?>><?php echo date('M j, Y @ G:i'); ?></option>
149
- <option value="m/d/Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'm/d/Y \a\t g:ia') echo 'selected="selected"'; ?>><?php echo date('m/d/Y \a\t g:ia'); ?></option>
150
- <option value="m/d/Y @ G:i" <?php if ($ftsDateTimeFormat == 'm/d/Y @ G:i') echo 'selected="selected"'; ?>><?php echo date('m/d/Y @ G:i'); ?></option>
151
- <option value="d/m/Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'd/m/Y \a\t g:ia') echo 'selected="selected"'; ?>><?php echo date('d/m/Y \a\t g:ia'); ?></option>
152
- <option value="d/m/Y @ G:i" <?php if ($ftsDateTimeFormat == 'd/m/Y @ G:i') echo 'selected="selected"'; ?>><?php echo date('d/m/Y @ G:i'); ?></option>
153
- <option value="Y/m/d \a\t g:ia" <?php if ($ftsDateTimeFormat == 'Y/m/d \a\t g:ia') echo 'selected="selected"'; ?>><?php echo date('Y/m/d \a\t g:ia'); ?></option>
154
- <option value="Y/m/d @ G:i" <?php if ($ftsDateTimeFormat == 'Y/m/d @ G:i') echo 'selected="selected"'; ?>><?php echo date('Y/m/d @ G:i'); ?></option>
155
- <option value="one-day-ago" <?php if ($ftsDateTimeFormat == 'one-day-ago') echo 'selected="selected"'; ?>><?php _e('1 day ago', 'feed-them-social'); ?></option>
156
- <option value="fts-custom-date" <?php if ($ftsDateTimeFormat == 'fts-custom-date') echo 'selected="selected"'; ?>><?php _e('Use Custom Date and Time Option Below', 'feed-them-social'); ?></option>
157
- </select>
158
- </fieldset>
159
-
160
- <?php
161
- //Date translate
162
- $fts_language_second = get_option('fts_language_second', 'second');
163
- $fts_language_seconds = get_option('fts_language_seconds', 'seconds');
164
- $fts_language_minute = get_option('fts_language_minute', 'minute');
165
- $fts_language_minutes = get_option('fts_language_minutes', 'minutes');
166
- $fts_language_hour = get_option('fts_language_hour', 'hour');
167
- $fts_language_hours = get_option('fts_language_hours', 'hours');
168
- $fts_language_day = get_option('fts_language_day', 'day');
169
- $fts_language_days = get_option('fts_language_days', 'days');
170
- $fts_language_week = get_option('fts_language_week', 'week');
171
- $fts_language_weeks = get_option('fts_language_weeks', 'weeks');
172
- $fts_language_month = get_option('fts_language_month', 'month');
173
- $fts_language_months = get_option('fts_language_months', 'months');
174
- $fts_language_year = get_option('fts_language_year', 'year');
175
- $fts_language_years = get_option('fts_language_years', 'years');
176
- $fts_language_ago = get_option('fts_language_ago', 'ago');
177
- ?>
178
-
179
- <div class="custom_time_ago_wrap" style="display:none;">
180
- <h2><?php _e('Translate words for 1 day ago option.', 'feed-them-social'); ?></h2>
181
- <label for="fts_language_second"><?php _e("second"); ?></label>
182
- <input name="fts_language_second" type="text" value="<?php echo stripslashes(esc_attr($fts_language_second)); ?>" size="25"/>
183
- <br/>
184
- <label for="fts_language_seconds"><?php _e("seconds"); ?></label>
185
- <input name="fts_language_seconds" type="text" value="<?php echo stripslashes(esc_attr($fts_language_seconds)); ?>" size="25"/>
186
- <br/>
187
- <label for="fts_language_minute"><?php _e("minute"); ?></label>
188
- <input name="fts_language_minute" type="text" value="<?php echo stripslashes(esc_attr($fts_language_minute)); ?>" size="25"/>
189
- <br/>
190
- <label for="fts_language_minutes"><?php _e("minutes"); ?></label>
191
- <input name="fts_language_minutes" type="text" value="<?php echo stripslashes(esc_attr($fts_language_minutes)); ?>" size="25"/>
192
- <br/>
193
- <label for="fts_language_hour"><?php _e("hour"); ?></label>
194
- <input name="fts_language_hour" type="text" value="<?php echo stripslashes(esc_attr($fts_language_hour)); ?>" size="25"/>
195
- <br/>
196
- <label for="fts_language_hours"><?php _e("hours"); ?></label>
197
- <input name="fts_language_hours" type="text" value="<?php echo stripslashes(esc_attr($fts_language_hours)); ?>" size="25"/>
198
- <br/>
199
- <label for="fts_language_day"><?php _e("day"); ?></label>
200
- <input name="fts_language_day" type="text" value="<?php echo stripslashes(esc_attr($fts_language_day)); ?>" size="25"/>
201
- <br/>
202
- <label for="fts_language_days"><?php _e("days"); ?></label>
203
- <input name="fts_language_days" type="text" value="<?php echo stripslashes(esc_attr($fts_language_days)); ?>" size="25"/>
204
- <br/>
205
- <label for="fts_language_week"><?php _e("week"); ?></label>
206
- <input name="fts_language_week" type="text" value="<?php echo stripslashes(esc_attr($fts_language_week)); ?>" size="25"/>
207
- <br/>
208
- <label for="fts_language_weeks"><?php _e("weeks"); ?></label>
209
- <input name="fts_language_weeks" type="text" value="<?php echo stripslashes(esc_attr($fts_language_weeks)); ?>" size="25"/>
210
- <br/>
211
- <label for="fts_language_month"><?php _e("month"); ?></label>
212
- <input name="fts_language_month" type="text" value="<?php echo stripslashes(esc_attr($fts_language_month)); ?>" size="25"/>
213
- <br/>
214
- <label for="fts_language_months"><?php _e("months"); ?></label>
215
- <input name="fts_language_months" type="text" value="<?php echo stripslashes(esc_attr($fts_language_months)); ?>" size="25"/>
216
- <br/>
217
- <label for="fts_language_year"><?php _e("year"); ?></label>
218
- <input name="fts_language_year" type="text" value="<?php echo stripslashes(esc_attr($fts_language_year)); ?>" size="25"/>
219
- <br/>
220
- <label for="fts_language_years"><?php _e("years"); ?></label>
221
- <input name="fts_language_years" type="text" value="<?php echo stripslashes(esc_attr($fts_language_years)); ?>" size="25"/>
222
- <br/>
223
- <label for="fts_language_ago"><?php _e("ago"); ?></label>
224
- <input name="fts_language_ago" type="text" value="<?php echo stripslashes(esc_attr($fts_language_ago)); ?>" size="25"/>
225
-
226
- </div>
227
- <script>
228
- // change the feed type 'how to' message when a feed type is selected
229
-
230
- <?php if ($ftsDateTimeFormat == 'one-day-ago'){ ?>
231
- jQuery('.custom_time_ago_wrap').show();
232
- <?php } ?>
233
- jQuery('#fts-date-and-time-format').change(function () {
234
-
235
- var ftsTimeAgo = jQuery("select#fts-date-and-time-format").val();
236
- if (ftsTimeAgo == 'one-day-ago') {
237
- jQuery('.custom_time_ago_wrap').show();
238
- }
239
- else {
240
- jQuery('.custom_time_ago_wrap').hide();
241
- }
242
-
243
- });
244
-
245
- </script>
246
- <h2 style="border-top:0px; margin-bottom:4px !important;"><?php _e('Custom Date and Time', 'feed-them-social'); ?></h2>
247
- <div><?php if ($ftsCustomDate !== '' || $ftsCustomTime !== '') {
248
- echo date(get_option('fts-custom-date') . ' ' . get_option('fts-custom-time'));
249
- } ?></div>
250
- <p style="margin:12px 0 !important;">
251
- <input name="fts-custom-date" style="max-width:105px;" class="fts-color-settings-admin-input" id="fts-custom-date" placeholder="<?php _e('Date', 'feed-them-social'); ?>" value="<?php echo get_option('fts-custom-date'); ?>"/>
252
- <input name="fts-custom-time" style="max-width:75px;" class="fts-color-settings-admin-input" id="fts-custom-time" placeholder="<?php _e('Time', 'feed-them-social'); ?>" value="<?php echo get_option('fts-custom-time'); ?>"/>
253
- </p>
254
- <div><?php _e('This will override the date and time format above.', 'feed-them-social'); ?>
255
- <br/><a href="https://codex.wordpress.org/Formatting_Date_and_Time" target="_blank"><?php _e('Options for custom date and time formatting.', 'feed-them-social'); ?></a>
256
- </div>
257
- </div>
258
- <div style="float:left; max-width:330px; margin-right: 30px;"><h2><?php _e('TimeZone', 'feed-them-social'); ?></h2>
259
- <fieldset>
260
- <select id="fts-timezone" name="fts-timezone">
261
- <option value="Kwajalein" <?php if ($ftsTimezone == "Kwajalein") echo 'selected="selected"' ?> >
262
- <?php _e('UTC-12:00'); ?>
263
- </option>
264
- <option value="Pacific/Midway" <?php if ($ftsTimezone == "Pacific/Midway") echo 'selected="selected"' ?> >
265
- <?php _e('UTC-11:00'); ?>
266
- </option>
267
- <option value="Pacific/Honolulu" <?php if ($ftsTimezone == "Pacific/Honolulu") echo 'selected="selected"' ?> >
268
- <?php _e('UTC-10:00'); ?>
269
- </option>
270
- <option value="America/Anchorage" <?php if ($ftsTimezone == "America/Anchorage") echo 'selected="selected"' ?> >
271
- <?php _e('UTC-09:00'); ?>
272
- </option>
273
- <option value="America/Los_Angeles" <?php if ($ftsTimezone == "America/Los_Angeles") echo 'selected="selected"' ?> >
274
- <?php _e('UTC-08:00'); ?>
275
- </option>
276
- <option value="America/Denver" <?php if ($ftsTimezone == "America/Denver") echo 'selected="selected"' ?> >
277
- <?php _e('UTC-07:00'); ?>
278
- </option>
279
- <option value="America/Chicago" <?php if ($ftsTimezone == "America/Chicago") echo 'selected="selected"' ?> >
280
- <?php _e('UTC-06:00'); ?>
281
- </option>
282
- <option value="America/New_York" <?php if ($ftsTimezone == "America/New_York") echo 'selected="selected"' ?> >
283
- <?php _e('UTC-05:00'); ?>
284
- </option>
285
- <option value="America/Caracas" <?php if ($ftsTimezone == "America/Caracas") echo 'selected="selected"' ?> >
286
- <?php _e('UTC-04:30'); ?>
287
- </option>
288
- <option value="America/Halifax" <?php if ($ftsTimezone == "America/Halifax") echo 'selected="selected"' ?> >
289
- <?php _e('UTC-04:00'); ?>
290
- </option>
291
- <option value="America/St_Johns" <?php if ($ftsTimezone == "America/St_Johns") echo 'selected="selected"' ?> >
292
- <?php _e('UTC-03:30'); ?>
293
- </option>
294
- <option value="America/Sao_Paulo" <?php if ($ftsTimezone == "America/Sao_Paulo") echo 'selected="selected"' ?> >
295
- <?php _e('UTC-03:00'); ?>
296
- </option>
297
- <option value="America/Noronha" <?php if ($ftsTimezone == "America/Noronha") echo 'selected="selected"' ?> >
298
- <?php _e('UTC-02:00'); ?>
299
- </option>
300
- <option value="Atlantic/Cape_Verde" <?php if ($ftsTimezone == "Atlantic/Cape_Verde") echo 'selected="selected"' ?> >
301
- <?php _e('UTC-01:00'); ?>
302
- </option>
303
- <option value="Europe/Belfast" <?php if ($ftsTimezone == "Europe/Belfast") echo 'selected="selected"' ?> >
304
- <?php _e('UTC'); ?>
305
- <option value="Europe/Amsterdam" <?php if ($ftsTimezone == "Europe/Amsterdam") echo 'selected="selected"' ?> >
306
- <?php _e('UTC+01:00'); ?>
307
- </option>
308
- <option value="Asia/Beirut" <?php if ($ftsTimezone == "Asia/Beirut") echo 'selected="selected"' ?> >
309
- <?php _e('UTC+02:00'); ?>
310
- </option>
311
- <option value="Europe/Moscow" <?php if ($ftsTimezone == "Europe/Moscow") echo 'selected="selected"' ?> >
312
- <?php _e('UTC+03:00'); ?>
313
- </option>
314
- <option value="Asia/Tehran" <?php if ($ftsTimezone == "Asia/Tehran") echo 'selected="selected"' ?> >
315
- <?php _e('UTC+03:30'); ?>
316
- </option>
317
- <option value="Asia/Yerevan" <?php if ($ftsTimezone == "Asia/Yerevan") echo 'selected="selected"' ?> >
318
- <?php _e('UTC+04:00'); ?>
319
- </option>
320
- <option value="Asia/Kabul" <?php if ($ftsTimezone == "Asia/Kabul") echo 'selected="selected"' ?> >
321
- <?php _e('UTC+04:30'); ?>
322
- </option>
323
- <option value="Asia/Tashkent" <?php if ($ftsTimezone == "Asia/Tashkent") echo 'selected="selected"' ?> >
324
- <?php _e('UTC+05:00'); ?>
325
- </option>
326
- <option value="Asia/Kolkata" <?php if ($ftsTimezone == "Asia/Kolkata") echo 'selected="selected"' ?> >
327
- <?php _e('UTC+05:30'); ?>
328
- </option>
329
- <option value="Asia/Katmandu" <?php if ($ftsTimezone == "Asia/Katmandu") echo 'selected="selected"' ?> >
330
- <?php _e('UTC+05:45'); ?>
331
- </option>
332
- <option value="Asia/Dhaka" <?php if ($ftsTimezone == "Asia/Dhaka") echo 'selected="selected"' ?> >
333
- <?php _e('UTC+06:00'); ?>
334
- </option>
335
- <option value="Asia/Novosibirsk" <?php if ($ftsTimezone == "Asia/Novosibirsk") echo 'selected="selected"' ?> >
336
- <?php _e('UTC+06:00'); ?>
337
- </option>
338
- <option value="Asia/Rangoon" <?php if ($ftsTimezone == "Asia/Rangoon") echo 'selected="selected"' ?> >
339
- <?php _e('UTC+06:30'); ?>
340
- </option>
341
- <option value="Asia/Bangkok" <?php if ($ftsTimezone == "Asia/Bangkok") echo 'selected="selected"' ?> >
342
- <?php _e('UTC+07:00'); ?>
343
- </option>
344
- <option value="Australia/Perth" <?php if ($ftsTimezone == "Australia/Perth") echo 'selected="selected"' ?> >
345
- <?php _e('UTC+08:00'); ?>
346
- </option>
347
- <option value="Australia/Eucla" <?php if ($ftsTimezone == "Australia/Eucla") echo 'selected="selected"' ?> >
348
- <?php _e('UTC+08:45'); ?>
349
- </option>
350
- <option value="Asia/Tokyo" <?php if ($ftsTimezone == "Asia/Tokyo") echo 'selected="selected"' ?> >
351
- <?php _e('UTC+09:00'); ?>
352
- </option>
353
- <option value="Australia/Adelaide" <?php if ($ftsTimezone == "Australia/Adelaide") echo 'selected="selected"' ?> >
354
- <?php _e('UTC+09:30'); ?>
355
- </option>
356
- <option value="Australia/Hobart" <?php if ($ftsTimezone == "Australia/Hobart") echo 'selected="selected"' ?> >
357
- <?php _e('UTC+10:00'); ?>
358
- </option>
359
- <option value="Australia/Lord_Howe" <?php if ($ftsTimezone == "Australia/Lord_Howe") echo 'selected="selected"' ?> >
360
- <?php _e('UTC+10:30'); ?>
361
- </option>
362
- <option value="Asia/Magadan" <?php if ($ftsTimezone == "Asia/Magadan") echo 'selected="selected"' ?> >
363
- <?php _e('UTC+11:00'); ?>
364
- </option>
365
- <option value="Pacific/Norfolk" <?php if ($ftsTimezone == "Pacific/Norfolk") echo 'selected="selected"' ?> >
366
- <?php _e('UTC+11:30'); ?>
367
- </option>
368
- <option value="Asia/Anadyr" <?php if ($ftsTimezone == "Asia/Anadyr") echo 'selected="selected"' ?> >
369
- <?php _e('UTC+12:00'); ?>
370
- </option>
371
- <option value="Pacific/Chatham" <?php if ($ftsTimezone == "Pacific/Chatham") echo 'selected="selected"' ?> >
372
- <?php _e('UTC+12:45'); ?>
373
- </option>
374
- <option value="Pacific/Tongatapu" <?php if ($ftsTimezone == "Pacific/Tongatapu") echo 'selected="selected"' ?> >
375
- <?php _e('UTC+13:00'); ?>
376
- </option>
377
- <option value="Pacific/Kiritimati" <?php if ($ftsTimezone == "Pacific/Kiritimati") echo 'selected="selected"' ?> >
378
- <?php _e('UTC+14:00'); ?>
379
- </option>
380
- </select>
381
- </fieldset>
382
- </div>
383
- <div class="fts-clear"></div>
384
-
385
- <br/>
386
- <h2><?php _e('Custom CSS Option', 'feed-them-social'); ?></h2>
387
- <p>
388
- <input name="fts-color-options-settings-custom-css" class="fts-color-settings-admin-input" type="checkbox" id="fts-color-options-settings-custom-css" value="1" <?php echo checked('1', get_option('fts-color-options-settings-custom-css')); ?>/>
389
- <?php
390
- if (get_option('fts-color-options-settings-custom-css') == '1') { ?>
391
- <strong><?php _e('Checked:', 'feed-them-social'); ?></strong> <?php _e('Custom CSS option is being used now.', 'feed-them-social'); ?><?php
392
- } else { ?>
393
- <strong><?php _e('Not Checked:', 'feed-them-social'); ?></strong> <?php _e('You are using the default CSS.', 'feed-them-social'); ?><?php
394
- }
395
- ?>
396
- </p>
397
- <label class="toggle-custom-textarea-show"><span><?php _e('Show', 'feed-them-social'); ?></span><span class="toggle-custom-textarea-hide"><?php _e('Hide', 'feed-them-social'); ?></span> <?php _e('custom CSS', 'feed-them-social'); ?>
398
- </label>
399
- <div class="fts-clear"></div>
400
- <div class="fts-custom-css-text"><?php _e('Thanks for using our plugin :) Add your custom CSS additions or overrides below.', 'feed-them-social'); ?></div>
401
- <textarea name="fts-color-options-main-wrapper-css-input" class="fts-color-settings-admin-input" id="fts-color-options-main-wrapper-css-input"><?php echo get_option('fts-color-options-main-wrapper-css-input'); ?></textarea>
402
- </div><!--/feed-them-custom-css-->
403
-
404
-
405
- <div class="feed-them-custom-logo-css">
406
- <h2><?php _e('Disable Magnific Popup CSS', 'feed-them-social'); ?></h2>
407
- <p>
408
- <input name="fts_fix_magnific" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts_fix_magnific" value="1" <?php echo checked('1', get_option('fts_fix_magnific')); ?>/> <?php _e('Check this if you are experiencing problems with your theme(s) or other plugin(s) popups.', 'feed-them-social'); ?>
409
- </p>
410
- <br/>
411
-
412
-
413
- <h2><?php _e('Fix Twitter Time', 'feed-them-social'); ?></h2>
414
- <p>
415
- <input name="fts_twitter_time_offset" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts_twitter_time_offset" value="1" <?php echo checked('1', get_option('fts_twitter_time_offset')); ?>/> <?php _e('Check this if the Twitter time is still off by 3 hours after setting the TimeZone above.', 'feed-them-social'); ?>
416
- </p>
417
- <br/>
418
-
419
- <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php') || is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { ?>
420
- <h2><?php _e('Fix Load More Error', 'feed-them-social'); ?></h2>
421
- <p>
422
- <input name="fts_fix_loadmore" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts_fix_loadmore" value="1" <?php echo checked('1', get_option('fts_fix_loadmore')); ?>/> <?php _e('Check this if you are using the loadmore button for Facebook or Instagram and are seeing a bunch of code under it.', 'feed-them-social'); ?>
423
- </p>
424
- <br/>
425
- <?php } ?>
426
-
427
- <h2><?php _e('Fix Internal Server Error', 'feed-them-social'); ?></h2>
428
- <p>
429
- <input name="fts_curl_option" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts_curl_option" value="1" <?php echo checked('1', get_option('fts_curl_option')); ?>/> <?php _e('Check this option if you are getting a 500 Internal Server Error when trying to load a page with our feed on it.', 'feed-them-social'); ?>
430
- </p>
431
- <br/>
432
-
433
- <h2><?php _e('Powered by Text', 'feed-them-social'); ?></h2>
434
- <p>
435
- <input name="fts-powered-text-options-settings" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts-powered-text-options-settings" value="1" <?php echo checked('1', get_option('fts-powered-text-options-settings')); ?>/>
436
- <?php
437
- if (get_option('fts-powered-text-options-settings') == '1') { ?>
438
- <strong><?php _e('Checked:', 'feed-them-social'); ?></strong> <?php _e('You are not showing the Powered by Logo.', 'feed-them-social'); ?><?php
439
- } else { ?>
440
- <strong><?php _e('Not Checked:', 'feed-them-social'); ?></strong><?php _e('The Powered by text will appear in the site. Awesome! Thanks so much for sharing.', 'feed-them-social'); ?><?php
441
- }
442
- ?>
443
- </p>
444
- <br/>
445
- <input type="submit" class="feed-them-social-admin-submit-btn" value="<?php _e('Save All Changes', 'feed-them-social') ?>"/>
446
- <div class="fts-clear"></div>
447
- </div><!--/feed-them-custom-logo-css-->
448
- </form>
449
- </div><!--/font-content-->
450
- </div><!--/feed-them-social-admin-wrap-->
451
-
452
- <h1 class="plugin-author-note"><?php _e('Plugin Authors Note', 'feed-them-social'); ?></h1>
453
- <div class="fts-plugin-reviews">
454
- <div class="fts-plugin-reviews-rate"><?php _e(' Feed Them Social was created by 2 Brothers, Spencer and Justin Labadie. That’s it, 2 people! We spend all our time creating and supporting this plugin. Show us some love if you like our plugin and leave a quick review for us, it will make our day!', 'feed-them-social'); ?>
455
- <a href="https://wordpress.org/support/view/plugin-reviews/feed-them-social" target="_blank"><?php _e('Leave us a Review', 'feed-them-social'); ?>
456
- ★★★★★</a>
457
- </div>
458
- <div class="fts-plugin-reviews-support"><?php _e('If you\'re having troubles getting setup please contact us. We will respond within 24hrs, but usually within 1-6hrs.', 'feed-them-social'); ?>
459
- <a href="http://www.slickremix.com/support-forum/forum/feed-them-social-2" target="_blank"><?php _e('Support Forum', 'feed-them-social'); ?></a>
460
- <div class="fts-text-align-center">
461
- <a class="feed-them-social-admin-slick-logo" href="http://www.slickremix.com" target="_blank"></a>
462
- </div>
463
- </div>
464
- </div>
465
-
466
- <script>
467
- jQuery(function () {
468
-
469
-
470
- jQuery(".feed-them-social-admin-submit-btn").click(function () {
471
-
472
- // Facebook
473
- var isPXpresent = jQuery('#facebook_page_height').val();
474
- // This is in place to auto add the px if a specific input is missing it.
475
- if (jQuery('#facebook_page_height').val().indexOf('px') <= 0 && isPXpresent !== "") {
476
- jQuery('#facebook_page_height').val(jQuery('#facebook_page_height').val() + 'px');
477
- }
478
- <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php') || is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { ?>
479
- var isPXpresent2 = jQuery('#facebook_grid_colmn_width').val();
480
- if (jQuery('#facebook_grid_colmn_width').val().indexOf('px') <= 0 && isPXpresent2 !== "") {
481
- jQuery('#facebook_grid_colmn_width').val(jQuery('#facebook_grid_colmn_width').val() + 'px');
482
- }
483
- var isPXpresent3 = jQuery('#facebook_grid_space_between_posts').val();
484
- if (jQuery('#facebook_grid_space_between_posts').val().indexOf('px') <= 0 && isPXpresent3 !== "") {
485
- jQuery('#facebook_grid_space_between_posts').val(jQuery('#facebook_grid_space_between_posts').val() + 'px');
486
- }
487
- var isPXpresent4 = jQuery('#loadmore_button_width').val();
488
- if (jQuery('#loadmore_button_width').val().indexOf('px') <= 0 && isPXpresent4 !== "") {
489
- jQuery('#loadmore_button_width').val(jQuery('#loadmore_button_width').val() + 'px');
490
- }
491
- var isPXpresent5 = jQuery('#loadmore_button_margin').val();
492
- if (jQuery('#loadmore_button_margin').val().indexOf('px') <= 0 && isPXpresent5 !== "") {
493
- jQuery('#loadmore_button_margin').val(jQuery('#loadmore_button_margin').val() + 'px');
494
- }
495
- <?php } ?>
496
- // Twitter
497
- var isPXpresent6 = jQuery('#twitter_height').val();
498
- if (jQuery('#twitter_height').val().indexOf('px') <= 0 && isPXpresent6 !== "") {
499
- jQuery('#twitter_height').val(jQuery('#twitter_height').val() + 'px');
500
- }
501
- // Vine
502
- var isPXpresent7 = jQuery('#vine_maxwidth').val();
503
- if (jQuery('#vine_maxwidth').val().indexOf('px') <= 0 && isPXpresent7 !== "") {
504
- jQuery('#vine_maxwidth').val(jQuery('#vine_maxwidth').val() + 'px');
505
- }
506
- var isPXpresent8 = jQuery('#space_between_photos').val();
507
- if (jQuery('#space_between_photos').val().indexOf('px') <= 0 && isPXpresent8 !== "") {
508
- jQuery('#space_between_photos').val(jQuery('#space_between_photos').val() + 'px');
509
- }
510
- var isPXpresent9 = jQuery('#round_thumb_corner_size').val();
511
- if (jQuery('#round_thumb_corner_size').val().indexOf('px') <= 0 && isPXpresent9 !== "") {
512
- jQuery('#round_thumb_corner_size').val(jQuery('#round_thumb_corner_size').val() + 'px');
513
- }
514
- <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php') || is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { ?>
515
- var isPXpresent10 = jQuery('#vine_logo_size').val();
516
- if (jQuery('#vine_logo_size').val().indexOf('px') <= 0 && isPXpresent10 !== "") {
517
- jQuery('#vine_logo_size').val(jQuery('#vine_logo_size').val() + 'px');
518
- }
519
- <?php } ?>
520
- // Instagram
521
- var isPXpresent11 = jQuery('#instagram_page_height').val();
522
- if (jQuery('#instagram_page_height').val().indexOf('px') <= 0 && isPXpresent11 !== "") {
523
- jQuery('#instagram_page_height').val(jQuery('#instagram_page_height').val() + 'px');
524
- }
525
-
526
- });
527
-
528
-
529
- // Master feed selector
530
- jQuery('#shortcode-form-selector').change(function () {
531
- jQuery('.shortcode-generator-form').hide();
532
- jQuery('.' + jQuery(this).val()).fadeIn('fast');
533
-
534
- });
535
-
536
- jQuery('#fb_hide_like_box_button').change(function () {
537
- jQuery('.fb_align_likebox').toggle();
538
- });
539
-
540
- jQuery('#facebook_show_video_button').change(function () {
541
- jQuery('.fb-video-play-btn-options-content').toggle();
542
- });
543
-
544
-
545
- // change the feed type 'how to' message when a feed type is selected
546
- jQuery('#facebook-messages-selector').change(function () {
547
- jQuery('.facebook-message-generator').hide();
548
- jQuery('.' + jQuery(this).val()).fadeIn('fast');
549
- // if the facebook type select is changed we hide the shortcode code so not to confuse people
550
- jQuery('.final-shortcode-textarea').hide();
551
- // only show the Super Gallery Options if the facebook ablum or album covers feed type is selected
552
- var facebooktype = jQuery("select#facebook-messages-selector").val();
553
-
554
- // if (facebooktype == 'albums' || facebooktype == 'album_photos' || facebooktype == 'page' || facebooktype == 'group' || facebooktype == 'event' || facebooktype == 'events') {
555
- //
556
- // }
557
-
558
- <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?>
559
-
560
- // This is to show all option when prem active if you selected the Facebook Page reviews if not active. Otherwise all other fb-options-wraps are hidden when selecting another fb feed from settings page drop down.
561
- jQuery('.fb-options-wrap').show();
562
- jQuery('body .fb_album_photos_id').hide();
563
- if (facebooktype == 'album_videos') {
564
- jQuery('.fts-premium-options-message, .fts-photos-popup, #facebook_super_gallery_container, #facebook_super_gallery_animate').hide();
565
- jQuery('.video, .fb-video-play-btn-options-wrap, #facebook_video_align_images_wrapper').show();
566
- // jQuery(".feed-them-social-admin-input-label:contains('Album')").html("<?php // _e('Video Album ID (required)', 'feed-them-social') ?>");
567
- jQuery(".feed-them-social-admin-input-label:contains('# of Posts')").html("<?php _e('# of Videos', 'feed-them-social') ?>");
568
- }
569
- else {
570
- jQuery('.video, .fb-video-play-btn-options-wrap, #facebook_video_align_images_wrapper').hide();
571
- jQuery('.fts-photos-popup, #facebook_super_gallery_container, #facebook_super_gallery_animate').show();
572
- // jQuery(".feed-them-social-admin-input-label:contains('Video Album ID (required)')").html("<?php // _e('Album ID', 'feed-them-social') ?><br/><small><?php // _e('Leave Blank to show all photos.', 'feed-them-social') ?></small>");
573
- jQuery(".feed-them-social-admin-input-label:contains('# of Videos')").html("<?php _e('# of Posts', 'feed-them-social') ?>");
574
- }
575
- <?php }
576
- else { ?>
577
- if (facebooktype == 'album_videos') {
578
- // we are hiding all fields in the free verison and adding am upgrade message, much easier this way as the options add up.
579
- jQuery('.fb-options-wrap').hide();
580
- jQuery('.fts-premium-options-message').show();
581
-
582
- }
583
- else {
584
- jQuery('.fb-options-wrap').show();
585
- jQuery('.fts-premium-options-message, .video').hide();
586
- }
587
- <?php } ?>
588
-
589
- if (facebooktype == 'page') {
590
- jQuery('.inst-text-facebook-page').show();
591
- }
592
- else {
593
- jQuery('.inst-text-facebook-page').hide();
594
- }
595
-
596
- if (facebooktype == 'events') {
597
- jQuery('.inst-text-facebook-event-list').show();
598
- }
599
- else {
600
- jQuery('.inst-text-facebook-event-list').hide();
601
- }
602
-
603
-
604
- <?php if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { ?>
605
-
606
- if (facebooktype == 'reviews') {
607
- jQuery('.fb-reviews, .inst-text-facebook-page, .reviews-options').show();
608
- jQuery('.fb-page-title-option-hide, .fb-page-description-option-hide, .need-for-premium-fields-wrap').hide();
609
- } else {
610
- jQuery('.fb-reviews, .reviews-options').hide();
611
- jQuery('.fb-page-title-option-hide, .fb-page-description-option-hide, .need-for-premium-fields-wrap').show();
612
- } <?php } else { ?>
613
- if (facebooktype == 'reviews') {
614
- // we are hiding all fields in the free verison and adding am upgrade message, much easier this way as the options add up.
615
- jQuery('.reviews-copy-text, .fb-options-wrap').hide();
616
- jQuery('.fts-premium-options-message2').show();
617
- } else {
618
- jQuery('.fts-premium-options-message2').hide();
619
- }
620
- <?php } ?>
621
-
622
-
623
- if (facebooktype == 'albums' || facebooktype == 'album_photos' || facebooktype == 'album_videos') {
624
- jQuery('.fts-super-facebook-options-wrap').show();
625
- jQuery('.fixed_height_option').hide();
626
- jQuery('.fb-posts-in-grid-option-wrap').hide();
627
- jQuery('.fixed_height_option').hide();
628
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Display Posts in Grid', 'feed-them-social'); ?>')").parent('div').hide();
629
- }
630
- else {
631
- jQuery('.fts-super-facebook-options-wrap').hide();
632
- jQuery('.fixed_height_option').show();
633
- jQuery('.fb-posts-in-grid-option-wrap').show();
634
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Display Posts in Grid', 'feed-them-social'); ?>')").parent('div').show();
635
-
636
-
637
- }
638
- // only show the post type visible if the facebook page feed type is selected
639
- jQuery('.facebook-post-type-visible').hide();
640
- if (facebooktype == 'page') {
641
- jQuery('.facebook-post-type-visible').show();
642
- }
643
- var fb_feed_type_option = jQuery("select#facebook-messages-selector").val();
644
- if (fb_feed_type_option == 'album_photos') {
645
- jQuery('.fb_album_photos_id').show();
646
- }
647
- else {
648
- jQuery('.fb_album_photos_id').hide();
649
- }
650
- });
651
- // Instagram Super Gallery option
652
- jQuery('#instagram-custom-gallery').bind('change', function (e) {
653
- if (jQuery('#instagram-custom-gallery').val() == 'yes') {
654
- jQuery('.fts-super-instagram-options-wrap').show();
655
- }
656
- else {
657
- jQuery('.fts-super-instagram-options-wrap').hide();
658
- }
659
- });
660
- jQuery('#instagram-messages-selector').bind('change', function (e) {
661
- if (jQuery('#instagram-messages-selector').val() == 'hashtag') {
662
- jQuery(".instagram-id-option-wrap").hide();
663
- jQuery(".instagram-hashtag-option-text").show();
664
- jQuery(".instagram-user-option-text").hide();
665
- }
666
- else {
667
- jQuery(".instagram-id-option-wrap").show();
668
- jQuery(".instagram-hashtag-option-text").hide();
669
- jQuery(".instagram-user-option-text").show();
670
- }
671
- });
672
-
673
- jQuery('#twitter-messages-selector').bind('change', function (e) {
674
- if (jQuery('#twitter-messages-selector').val() == 'hashtag') {
675
- jQuery(".hashtag-option-small-text").show();
676
- jQuery(".twitter-hashtag-etc-wrap").show();
677
- jQuery(".hashtag-option-not-required, .must-copy-twitter-name").hide();
678
- }
679
- else {
680
- jQuery(".hashtag-option-not-required, .must-copy-twitter-name").show();
681
- jQuery(".twitter-hashtag-etc-wrap").hide();
682
- jQuery(".hashtag-option-small-text").hide();
683
- }
684
- });
685
-
686
-
687
- // facebook show grid options
688
- jQuery('#fb-grid-option').bind('change', function (e) {
689
- if (jQuery('#fb-grid-option').val() == 'yes') {
690
- jQuery('.fts-facebook-grid-options-wrap').show();
691
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Center Facebook Container?', 'feed-them-social'); ?>')").parent('div').show();
692
- }
693
- else {
694
- jQuery('.fts-facebook-grid-options-wrap').hide();
695
- }
696
- });
697
- // facebook Super Gallery option
698
- jQuery('#facebook-custom-gallery').bind('change', function (e) {
699
- if (jQuery('#facebook-custom-gallery').val() == 'yes') {
700
- jQuery('.fts-super-facebook-options-wrap').show();
701
- }
702
- else {
703
- jQuery('.fts-super-facebook-options-wrap').hide();
704
- }
705
- });
706
- // facebook show load more options
707
- jQuery('#fb_load_more_option').bind('change', function (e) {
708
- if (jQuery('#fb_load_more_option').val() == 'yes') {
709
-
710
- if (jQuery('#facebook-messages-selector').val() !== 'album_videos') {
711
- jQuery('.fts-facebook-load-more-options-wrap').show();
712
- }
713
- jQuery('.fts-facebook-load-more-options2-wrap').show();
714
- }
715
-
716
- else {
717
- jQuery('.fts-facebook-load-more-options-wrap, .fts-facebook-load-more-options2-wrap').hide();
718
- }
719
- });
720
- // Instagram show load more options
721
- jQuery('#instagram_load_more_option').bind('change', function (e) {
722
- if (jQuery('#instagram_load_more_option').val() == 'yes') {
723
- jQuery('.fts-instagram-load-more-options-wrap').show();
724
- }
725
- else {
726
- jQuery('.fts-instagram-load-more-options-wrap').hide();
727
- }
728
- });
729
- // Pinterest options
730
- // hide this div till needed for free version
731
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Pins', 'feed-them-social'); ?>')").parent('div').hide();
732
- jQuery('#pinterest-messages-selector').bind('change', function (e) {
733
- if (jQuery('#pinterest-messages-selector').val() == 'boards_list') {
734
- jQuery('.number-of-boards, .pinterest-name-text').show();
735
- jQuery('.board-name, .show-pins-amount, .pinterest-board-and-name-text').hide();
736
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Boards', 'feed-them-social'); ?>')").parent('div').show();
737
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Pins', 'feed-them-social'); ?>')").parent('div').hide();
738
- }
739
- });
740
- // Pinterest options
741
- jQuery('#pinterest-messages-selector').bind('change', function (e) {
742
- if (jQuery('#pinterest-messages-selector').val() == 'single_board_pins') {
743
- jQuery('.board-name, .show-pins-amount, .pinterest-board-and-name-text').show();
744
- jQuery('.number-of-boards, .pinterest-name-text').hide();
745
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Boards', 'feed-them-social'); ?>')").parent('div').hide();
746
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Pins', 'feed-them-social'); ?>')").parent('div').show();
747
- }
748
- })
749
- // Pinterest options
750
- jQuery('#pinterest-messages-selector').bind('change', function (e) {
751
- if (jQuery('#pinterest-messages-selector').val() == 'pins_from_user') {
752
- jQuery('.show-pins-amount, .pinterest-name-text').show();
753
- jQuery('.number-of-boards, .board-name, .pinterest-board-and-name-text').hide();
754
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Boards', 'feed-them-social'); ?>')").parent('div').hide();
755
- jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Pins', 'feed-them-social'); ?>')").parent('div').show();
756
- }
757
- });
758
-
759
- });
760
- // JS
761
- function updateTextArea_pinterest() {
762
- var pinterest_name = ' pinterest_name=' + jQuery("input#pinterest_name").val();
763
- if (pinterest_name == " pinterest_name=") {
764
- jQuery(".pinterest_name").addClass('fts-empty-error');
765
- jQuery("input#pinterest_name").focus();
766
- return false;
767
- }
768
- if (pinterest_name != " pinterest_name=") {
769
- jQuery(".pinterest_name").removeClass('fts-empty-error');
770
- }
771
- var pinterest_board_name = ' board_id=' + jQuery("input#pinterest_board_name").val();
772
- if (pinterest_board_name == " board_id=" && jQuery("select#pinterest-messages-selector").val() == "single_board_pins") {
773
- jQuery(".board-name").addClass('fts-empty-error');
774
- jQuery("input#pinterest_board_name").focus();
775
- return false;
776
- }
777
- if (pinterest_board_name != " board_id=") {
778
- jQuery(".board-name").removeClass('fts-empty-error');
779
- }
780
- if (pinterest_board_name == " board_id=") {
781
- var pinterest_board_name_final = '';
782
- }
783
- if (pinterest_board_name != " board_id=") {
784
- var pinterest_board_name_final = pinterest_board_name;
785
- }
786
- var type = ' type=' + jQuery("select#pinterest-messages-selector").val();
787
- if (type == " type=") {
788
- var type_final = '';
789
- }
790
- if (type != " type=") {
791
- var type_final = type;
792
- }
793
- <?php
794
- //Premium Plugin
795
- if(is_plugin_active('feed-them-premium/feed-them-premium.php')) {
796
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/pinterest-settings-js.js');
797
- }
798
- else { ?>
799
- //Generate Pinterest Shortcode
800
- if (jQuery("select#pinterest-messages-selector").val() == "pins_from_user") {
801
- var final_pinterest_shorcode = '[fts_pinterest' + pinterest_name + type_final + ']';
802
- }
803
- else if (jQuery("select#pinterest-messages-selector").val() == "single_board_pins") {
804
- var final_pinterest_shorcode = '[fts_pinterest' + pinterest_name + pinterest_board_name_final + type_final + ']';
805
- }
806
- else {
807
- var final_pinterest_shorcode = '[fts_pinterest' + pinterest_name + type_final + ']';
808
- }
809
- <?php } ?>
810
- jQuery('.pinterest-final-shortcode').val(final_pinterest_shorcode);
811
- jQuery('.pinterest-shortcode-form .final-shortcode-textarea').slideDown();
812
- }
813
- //End Pinterest
814
- function updateTextArea_fb_page() {
815
- var fb_feed_type = ' type=' + jQuery("select#facebook-messages-selector").val();
816
- var fb_page_id = ' id=' + jQuery("input#fb_page_id").val();
817
- if (jQuery("input#fb_album_id").val() == '') {
818
- var fb_album_id = ' album_id=photo_stream';
819
- }
820
- else {
821
- var fb_album_id = ' album_id=' + jQuery("input#fb_album_id").val();
822
- }
823
- var fb_page_posts_displayed = ' posts_displayed=' + jQuery("select#fb_page_posts_displayed").val();
824
- var fb_page_post_count_final_check = jQuery("input#fb_page_post_count").val();
825
- if (fb_page_post_count_final_check !== '') {
826
- var fb_page_post_count_final = ' posts=' + jQuery("input#fb_page_post_count").val();
827
- } else {
828
- var fb_page_post_count_final = ' posts=5';
829
- }
830
- var facebook_height = jQuery("input#facebook_page_height").val();
831
- // var super_gallery = ' super_gallery=' + jQuery("select#facebook-custom-gallery").val();
832
- var image_width = ' image_width=' + jQuery("input#fts-slicker-facebook-container-image-width").val();
833
- var image_height = ' image_height=' + jQuery("input#fts-slicker-facebook-container-image-height").val();
834
- var space_between_photos = ' space_between_photos=' + jQuery("input#fts-slicker-facebook-container-margin").val();
835
- var hide_date_likes_comments = ' hide_date_likes_comments=' + jQuery("select#fts-slicker-facebook-container-hide-date-likes-comments").val();
836
- var center_container = ' center_container=' + jQuery("select#fts-slicker-facebook-container-position").val();
837
- var image_stack_animation = ' image_stack_animation=' + jQuery("select#fts-slicker-facebook-container-animation").val();
838
- var position_lr = ' image_position_lr=' + jQuery("input#fts-slicker-facebook-image-position-lr").val();
839
- var position_top = ' image_position_top=' + jQuery("input#fts-slicker-facebook-image-position-top").val();
840
- if (fb_page_id == " id=") {
841
- jQuery(".fb_page_id").addClass('fts-empty-error');
842
- jQuery("input#fb_page_id").focus();
843
- return false;
844
- }
845
- if (fb_page_id != " id=") {
846
- jQuery(".fb_page_id").removeClass('fts-empty-error');
847
- }
848
- if (fb_album_id == " album_id=" && fb_feed_type == " type=album_videos") {
849
- jQuery(".fb_album_photos_id").addClass('fts-empty-error');
850
- jQuery("input#fb_album_id").focus();
851
- return false;
852
- }
853
- if (facebook_height) {
854
- var facebook_height_final = ' height=' + jQuery("input#facebook_page_height").val();
855
- }
856
- else {
857
- var facebook_height_final = '';
858
- }
859
- var super_gallery_option = jQuery("select#facebook-custom-gallery").val();
860
- var albums_photos_option = jQuery("select#facebook-messages-selector").val();
861
- <?php
862
- // IF PREMIUM PLUGIN IS ACTIVE AND REVIEWS IS ACTIVE
863
- if(is_plugin_active('feed-them-premium/feed-them-premium.php') && !is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') && !is_plugin_active('feed-them-carousel-premium/feed-them-carousel-premium.php') || is_plugin_active('feed-them-premium/feed-them-premium.php') && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') && !is_plugin_active('feed-them-carousel-premium/feed-them-carousel-premium.php')) {
864
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-page-settings-js.js'); ?>
865
-
866
- if (albums_photos_option == "album_photos") {
867
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_album_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fb_page_title_align + fb_position_likebox + like_box_width + ']';
868
- }
869
- else if (albums_photos_option == "album_videos") {
870
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + ' video_album=yes' + fb_album_id + ' type=album_photos' + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + image_width + image_height + space_between_photos + fts_play_btn + fts_play_btn_size + fts_play_btn_visible + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + ' popup=yes' + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fts_images_align + fb_position_likebox + like_box_width + ']';
871
- }
872
- else if (albums_photos_option == "albums") {
873
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fb_page_title_align + fb_position_likebox + like_box_width + ']';
874
- }
875
- else if (albums_photos_option == "page") {
876
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_posts_displayed + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + facebook_height_final + fb_feed_type + load_more_posts_style_final + facebook_grid + facebook_grid_space_between_posts + facebook_grid_colmn_width + center_container + image_stack_animation + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fb_page_title_align + fb_page_title_align + fb_position_likebox + like_box_width + ']';
877
- }
878
- <?php
879
- //Premium Plugin
880
- if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) {
881
- include(WP_CONTENT_DIR . '/plugins/feed-them-social-facebook-reviews/admin/js/facebook-page-reviews-js.js');
882
- } ?>
883
-
884
- else {
885
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + facebook_height_final + fb_feed_type + load_more_posts_style_final + facebook_grid + facebook_grid_space_between_posts + facebook_grid_colmn_width + center_container + image_stack_animation + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fb_page_title_align + ']';
886
- }
887
- <?php
888
- }
889
- // IF PREMIUM PLUGIN IS ACTIVE AND CAROUSEL AND REVIEWS IS ACTIVE ETC...
890
- elseif(is_plugin_active('feed-them-premium/feed-them-premium.php') && is_plugin_active('feed-them-carousel-premium/feed-them-carousel-premium.php') || is_plugin_active('feed-them-premium/feed-them-premium.php') && is_plugin_active('feed-them-carousel-premium/feed-them-carousel-premium.php') && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) {
891
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-page-settings-js.js'); ?>
892
-
893
- if (albums_photos_option == "album_photos") {
894
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_album_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fb_page_title_align + fb_position_likebox + like_box_width + slider + scrollhorz_or_carousel + slides_visible + slider_spacing + slider_margin + slider_speed + slider_timeout + slider_controls + slider_controls_text_color + slider_controls_bar_color + slider_controls_width + ']';
895
- }
896
- else if (albums_photos_option == "album_videos") {
897
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + ' video_album=yes' + fb_album_id + ' type=album_photos' + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + image_width + image_height + space_between_photos + fts_play_btn + fts_play_btn_size + fts_play_btn_visible + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + ' popup=yes' + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fts_images_align + fb_position_likebox + like_box_width + slider + scrollhorz_or_carousel + slides_visible + slider_spacing + slider_margin + slider_speed + slider_timeout + slider_controls + slider_controls_text_color + slider_controls_bar_color + slider_controls_width + ']';
898
- }
899
- else if (albums_photos_option == "albums") {
900
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fb_page_title_align + fb_position_likebox + like_box_width + slider + scrollhorz_or_carousel + slides_visible + slider_spacing + slider_margin + slider_speed + slider_timeout + slider_controls + slider_controls_text_color + slider_controls_bar_color + slider_controls_width + ']';
901
- }
902
- else if (albums_photos_option == "page") {
903
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_posts_displayed + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + facebook_height_final + fb_feed_type + load_more_posts_style_final + facebook_grid + facebook_grid_space_between_posts + facebook_grid_colmn_width + center_container + image_stack_animation + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fb_page_title_align + fb_page_title_align + fb_position_likebox + like_box_width + ']';
904
- }
905
- <?php
906
- //Premium Plugin
907
- if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) {
908
- include(WP_CONTENT_DIR . '/plugins/feed-them-social-facebook-reviews/admin/js/facebook-page-reviews-js.js');
909
- } ?>
910
-
911
- else {
912
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + facebook_height_final + fb_feed_type + load_more_posts_style_final + facebook_grid + facebook_grid_space_between_posts + facebook_grid_colmn_width + center_container + image_stack_animation + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fb_page_title_align + ']';
913
- }
914
- <?php
915
- }
916
-
917
- // IF NO PREMIUM PLUGINS ACTIVE
918
- elseif(is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') && !is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?>
919
- // Free version shortcodes for Facebook
920
- if (albums_photos_option == "album_photos") {
921
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_album_id + fb_page_post_count_final + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + ']';
922
- }
923
- else if (albums_photos_option == "albums") {
924
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + ']';
925
- }
926
- else if (albums_photos_option == "page") {
927
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + fb_page_posts_displayed + facebook_height_final + fb_feed_type + ']';
928
- }
929
- <?php
930
- //Premium Plugin
931
- if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) {
932
- include(WP_CONTENT_DIR . '/plugins/feed-them-social-facebook-reviews/admin/js/facebook-page-reviews-js.js');
933
- } ?>
934
-
935
- else {
936
- // This is the group feed in free version.
937
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + facebook_height_final + fb_feed_type + ']';
938
- }
939
- <?php }
940
-
941
- // IF NO PREMIUM PLUGINS ACTIVE
942
- else { ?>
943
- // Free version shortcodes for Facebook
944
- if (albums_photos_option == "album_photos") {
945
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_album_id + fb_page_post_count_final + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + ']';
946
- }
947
- else if (albums_photos_option == "albums") {
948
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + ']';
949
- }
950
- else if (albums_photos_option == "page") {
951
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + fb_page_posts_displayed + facebook_height_final + fb_feed_type + ']';
952
- }
953
- else {
954
- // This is the group feed in free version.
955
- var final_fb_page_shortcode = '[fts_facebook' + fb_page_id + fb_page_post_count_final + facebook_height_final + fb_feed_type + ']';
956
- }
957
- <?php } ?>
958
-
959
-
960
- jQuery('.facebook-page-final-shortcode').val(final_fb_page_shortcode);
961
- jQuery('.fb-page-shortcode-form .final-shortcode-textarea').slideDown();
962
- }
963
- //END Facebook Page//
964
- //START Facebook Group//
965
- function updateTextArea_fb_group() {
966
- var fb_group_id = ' id=' + jQuery("input#fb_group_id").val();
967
- // var fb_group_custom_name = ' custom_name=' + jQuery("select#fb_group_custom_name").val();
968
- var facebook_height = jQuery("input#facebook_group_height").val();
969
- if (fb_group_id == " id=") {
970
- jQuery(".fb_group_id").addClass('fts-empty-error');
971
- jQuery("input#fb_group_id").focus();
972
- return false;
973
- }
974
- if (fb_group_id != " id=") {
975
- jQuery(".fb_group_id").removeClass('fts-empty-error');
976
- }
977
- if (facebook_height) {
978
- var facebook_height_final = ' height=' + jQuery("input#facebook_group_height").val();
979
- }
980
- else {
981
- var facebook_height_final = '';
982
- }
983
- <?php
984
- //Premium Plugin
985
- if(is_plugin_active('feed-them-premium/feed-them-premium.php')) {
986
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-group-settings-js.js');
987
- }
988
- else {
989
- ?>
990
- var final_fb_group_shorcode = '[fts_facebook_group' + fb_group_id + facebook_height_final + ' type=group]';
991
- <?php } ?>
992
- jQuery('.facebook-group-final-shortcode').val(final_fb_group_shorcode);
993
- jQuery('.fb-group-shortcode-form .final-shortcode-textarea').slideDown();
994
- }
995
- //END Facebook Group//
996
- //START Facebook List of Events//
997
- function updateTextArea_fb_list_of_events() {
998
- var fb_event_id = ' id=' + jQuery("input#fb_page_list_of_events_id").val();
999
- var facebook_height = jQuery("input#facebook_event_height").val();
1000
- if (fb_event_id == " id=") {
1001
- jQuery(".fb_page_list_of_events_id").addClass('fts-empty-error');
1002
- jQuery("input#fb_page_list_of_events_id").focus();
1003
- return false;
1004
- }
1005
- if (fb_event_id != " id=") {
1006
- jQuery(".fb_page_list_of_events_id").removeClass('fts-empty-error');
1007
- }
1008
- if (facebook_height) {
1009
- var facebook_height_final = ' height=' + jQuery("input#facebook_event_height").val();
1010
- }
1011
- else {
1012
- var facebook_height_final = '';
1013
- }
1014
- <?php
1015
- //Premium Plugin
1016
- if(is_plugin_active('feed-them-premium/feed-them-premium.php')) {
1017
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-event-settings-js.js');
1018
- }
1019
- else {
1020
- ?>
1021
- var final_fb_event_shorcode = '[fts_facebook_event' + fb_event_id + facebook_height_final + ' type=event]';
1022
- <?php } ?>
1023
- jQuery('.facebook-list-of-events-final-shortcode').val(final_fb_event_shorcode);
1024
- jQuery('.fb-event-shortcode-form .final-shortcode-textarea').slideDown();
1025
- }
1026
- //END Facebook List of Events//
1027
- //START Facebook Single Event//
1028
- function updateTextArea_fb_event() {
1029
- var fb_event_id = ' id=' + jQuery("input#fb_event_id").val();
1030
- var facebook_height = jQuery("input#facebook_event_height").val();
1031
- if (fb_event_id == " id=") {
1032
- jQuery(".fb_event_id").addClass('fts-empty-error');
1033
- jQuery("input#fb_event_id").focus();
1034
- return false;
1035
- }
1036
- if (fb_event_id != " id=") {
1037
- jQuery(".fb_event_id").removeClass('fts-empty-error');
1038
- }
1039
- if (facebook_height) {
1040
- var facebook_height_final = ' height=' + jQuery("input#facebook_event_height").val();
1041
- }
1042
- else {
1043
- var facebook_height_final = '';
1044
- }
1045
- <?php
1046
- //Premium Plugin
1047
- if(is_plugin_active('feed-them-premium/feed-them-premium.php')) {
1048
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-event-settings-js.js');
1049
- }
1050
- else {
1051
- ?>
1052
- var final_fb_event_shorcode = '[fts_facebook_event' + fb_event_id + facebook_height_final + ' type=event]';
1053
- <?php } ?>
1054
- jQuery('.facebook-event-final-shortcode').val(final_fb_event_shorcode);
1055
- jQuery('.fb-event-shortcode-form .final-shortcode-textarea').slideDown();
1056
- }
1057
- //END Facebook Single Event//
1058
- //START Twitter//
1059
- function updateTextArea_twitter() {
1060
- var twitter_name = jQuery("input#twitter_name").val();
1061
- var twitter_search = jQuery("input#twitter_hashtag_etc_name").val();
1062
- var twitter_height = jQuery("input#twitter_height").val();
1063
- var tweets_count = jQuery("input#tweets_count").val();
1064
- var show_retweets = jQuery("select#twitter-show-retweets").val();
1065
- if (tweets_count !== '') {
1066
- var tweets_count_final = ' tweets_count=' + jQuery("input#tweets_count").val();
1067
- } else {
1068
- var tweets_count_final = ' tweets_count=5';
1069
- }
1070
- if (twitter_height) {
1071
- var twitter_height_final = ' twitter_height=' + jQuery("input#twitter_height").val();
1072
- } else {
1073
- var twitter_height_final = ' twitter_height=auto';
1074
- }
1075
-
1076
- jQuery('#twitter-messages-selector').bind('change', function (e) {
1077
- if (jQuery('#twitter-messages-selector').val() == 'hashtag') {
1078
- jQuery(".twitter_name").removeClass('fts-empty-error');
1079
- }
1080
- });
1081
-
1082
-
1083
- if (twitter_name == "" && jQuery('#twitter-messages-selector').val() !== 'hashtag') {
1084
- jQuery(".twitter_name").addClass('fts-empty-error');
1085
- jQuery("input#twitter_name").focus();
1086
- return false;
1087
- }
1088
- else if (twitter_name != "") {
1089
- jQuery(".twitter_name").removeClass('fts-empty-error');
1090
- var twitter_name = ' twitter_name=' + jQuery("input#twitter_name").val();
1091
- }
1092
- if (twitter_search == "" && jQuery('#twitter-messages-selector').val() == 'hashtag') {
1093
- jQuery(".twitter_hashtag_etc_name").addClass('fts-empty-error');
1094
- jQuery("input#twitter_hashtag_etc_name").focus();
1095
- return false;
1096
- }
1097
- else if (twitter_search != "" && jQuery('#twitter-messages-selector').val() == 'hashtag') {
1098
- jQuery(".twitter_search").removeClass('fts-empty-error');
1099
- var twitter_search_final = ' search=' + jQuery("input#twitter_hashtag_etc_name").val();
1100
- }
1101
- else {
1102
- var twitter_search_final = '';
1103
- }
1104
- if (twitter_height) {
1105
- var twitter_height_final = ' twitter_height=' + jQuery("input#twitter_height").val();
1106
- }
1107
- else {
1108
- var twitter_height_final = '';
1109
- }
1110
- if (show_retweets) {
1111
- var show_retweets = ' show_retweets=' + jQuery("select#twitter-show-retweets").val();
1112
- }
1113
- else {
1114
- var show_retweets = '';
1115
- }
1116
- <?php
1117
- if(is_plugin_active('feed-them-premium/feed-them-premium.php')) {
1118
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/twitter-settings-js.js');
1119
- }
1120
- else { ?>
1121
- var final_twitter_shorcode = '[fts_twitter' + twitter_name + twitter_search_final + tweets_count_final + twitter_height_final + show_retweets + ']';
1122
- <?php } ?>
1123
- jQuery('.twitter-final-shortcode').val(final_twitter_shorcode);
1124
- jQuery('.twitter-shortcode-form .final-shortcode-textarea').slideDown();
1125
- }
1126
- //END Twitter//
1127
- //START Vine//
1128
- function updateTextArea_vine() {
1129
- var vine_id = ' id=' + jQuery("input#vine_id").val();
1130
- var vine_maxwidth = jQuery("input#vine_maxwidth").val();
1131
- var space_between_photos = jQuery("input#space_between_photos").val();
1132
- var round_thumb_corner_size = jQuery("input#round_thumb_corner_size").val();
1133
-
1134
- if (vine_id == " id=") {
1135
- jQuery(".vine_id").addClass('fts-empty-error');
1136
- jQuery("input#vine_id").focus();
1137
- return false;
1138
- }
1139
- if (vine_id != " id=") {
1140
- jQuery(".vine_id").removeClass('fts-empty-error');
1141
- }
1142
- if (vine_maxwidth) {
1143
- var vine_maxwidth = ' maxwidth=' + jQuery("input#vine_maxwidth").val();
1144
- }
1145
- else {
1146
- var vine_maxwidth = ' maxwidth=200px';
1147
- }
1148
- if (space_between_photos) {
1149
- var space_between_photos = ' space_between_photos=' + jQuery("input#space_between_photos").val();
1150
- }
1151
- else {
1152
- var round_thumb_corner_size = '';
1153
- }
1154
- if (round_thumb_corner_size) {
1155
- var round_thumb_corner_size = ' round_thumb_corner_size=' + jQuery("input#round_thumb_corner_size").val();
1156
- }
1157
- else {
1158
- var round_thumb_corner_size = '';
1159
- }
1160
- <?php
1161
- if(is_plugin_active('feed-them-premium/feed-them-premium.php') && file_exists(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/vine-settings-js.js')) {
1162
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/vine-settings-js.js');
1163
- }
1164
- else { ?>
1165
- var final_vine_shorcode = '[fts_vine' + vine_id + vine_maxwidth + space_between_photos + round_thumb_corner_size + ']';
1166
- <?php } ?>
1167
- jQuery('.vine-final-shortcode').val(final_vine_shorcode);
1168
- jQuery('.vine-shortcode-form .final-shortcode-textarea').slideDown();
1169
- }
1170
- //END Vine//
1171
- //START Instagram//
1172
- function updateTextArea_instagram() {
1173
- var instagram_id = ' instagram_id=' + jQuery("input#instagram_id").val();
1174
- var instagram_page_height = jQuery("input#instagram_page_height").val();
1175
- var super_gallery = ' super_gallery=' + jQuery("select#instagram-custom-gallery").val();
1176
- var image_size = ' image_size=' + jQuery("input#fts-slicker-instagram-container-image-size").val();
1177
- var icon_size = ' icon_size=' + jQuery("input#fts-slicker-instagram-icon-center").val();
1178
- var space_between_photos = ' space_between_photos=' + jQuery("input#fts-slicker-instagram-container-margin").val();
1179
- var hide_date_likes_comments = ' hide_date_likes_comments=' + jQuery("select#fts-slicker-instagram-container-hide-date-likes-comments").val();
1180
- var center_container = ' center_container=' + jQuery("select#fts-slicker-instagram-container-position").val();
1181
- var image_stack_animation = ' image_stack_animation=' + jQuery("select#fts-slicker-instagram-container-animation").val();
1182
- var instagram_feed_type = ' type=' + jQuery("select#instagram-messages-selector").val();
1183
- var instagram_popup_option = ' popup=' + jQuery("select#instagram-popup-option").val();
1184
- var pics_count = jQuery("input#pics_count").val();
1185
- if (pics_count !== '') {
1186
- var pics_count_final = ' pics_count=' + jQuery("input#pics_count").val();
1187
- } else {
1188
- var pics_count_final = ' pics_count=5';
1189
- }
1190
- if (instagram_id == " instagram_id=") {
1191
- jQuery(".instagram_name").addClass('fts-empty-error');
1192
- jQuery("input#instagram_id").focus();
1193
- return false;
1194
- }
1195
- if (instagram_id != " instagram_id=") {
1196
- jQuery(".instagram_name").removeClass('fts-empty-error');
1197
- }
1198
- if (instagram_page_height != "") {
1199
- var instagram_page_height_final = ' height=' + jQuery("input#instagram_page_height").val();
1200
- }
1201
- else {
1202
- var instagram_page_height_final = '';
1203
- }
1204
- <?php
1205
- //Premium Plugin
1206
- if(is_plugin_active('feed-them-premium/feed-them-premium.php') && WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/vine-settings-js.js') {
1207
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/instagram-settings-js.js');
1208
- }//end if Premium version
1209
- else { ?>
1210
- if (jQuery("select#instagram-custom-gallery").val() == "no") {
1211
- var final_instagram_shorcode = '[fts_instagram' + instagram_id + pics_count_final + instagram_feed_type + instagram_page_height_final + ']';
1212
- }
1213
- else {
1214
- var final_instagram_shorcode = '[fts_instagram' + instagram_id + pics_count_final + super_gallery + image_size + icon_size + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + instagram_feed_type + instagram_page_height_final + ']';
1215
- }
1216
- <?php } ?>
1217
- jQuery('.instagram-final-shortcode').val(final_instagram_shorcode);
1218
- jQuery('.instagram-shortcode-form .final-shortcode-textarea').slideDown();
1219
- }
1220
- //END Instagram//
1221
- //START convert Instagram name to id//
1222
- function converter_instagram_username() {
1223
- var convert_instagram_username = jQuery("input#convert_instagram_username").val();
1224
- if (convert_instagram_username == "") {
1225
- jQuery(".convert_instagram_username").addClass('fts-empty-error');
1226
- jQuery("input#convert_instagram_username").focus();
1227
- return false;
1228
- }
1229
- if (convert_instagram_username != "") {
1230
- jQuery(".convert_instagram_username").removeClass('fts-empty-error');
1231
- var username = jQuery("input#convert_instagram_username").val();
1232
- console.log(username);
1233
-
1234
- <?php $fts_instagram_tokens_array = array('9844495a8c4c4c51a7c519d0e7e8f293', '9844495a8c4c4c51a7c519d0e7e8f293');
1235
- $fts_instagram_access_token = $fts_instagram_tokens_array[array_rand($fts_instagram_tokens_array, 1)];
1236
- ?>
1237
- jQuery.getJSON("https://api.instagram.com/v1/users/search?q=" + username + "&client_id=<?php echo $fts_instagram_access_token; ?>&access_token=258559306.da06fb6.c222db6f1a794dccb7a674fec3f0941f&callback=?",
1238
-
1239
- {
1240
- format: "json"
1241
- },
1242
- function (data) {
1243
- console.log(data);
1244
- var final_instagram_us_id = data.data[0].id;
1245
- jQuery('#instagram_id').val(final_instagram_us_id);
1246
- jQuery('.final-instagram-user-id-textarea').slideDown();
1247
- });
1248
- }
1249
- }
1250
- //select all
1251
- jQuery(".copyme").focus(function () {
1252
- var jQuerythis = jQuery(this);
1253
-
1254
- // we call this function again on copy me to append any values that did not get a px on them
1255
- updateTextArea_fb_page();
1256
- updateTextArea_twitter();
1257
- updateTextArea_vine();
1258
- updateTextArea_instagram();
1259
-
1260
- jQuerythis.select();
1261
- // Work around Chrome's little problem
1262
- jQuerythis.mouseup(function () {
1263
- // Prevent further mouseup intervention
1264
- jQuerythis.unbind("mouseup");
1265
- return false;
1266
- });
1267
- });
1268
- jQuery(document).ready(function () {
1269
- jQuery(".toggle-custom-textarea-show").click(function () {
1270
- jQuery('textarea#fts-color-options-main-wrapper-css-input').slideToggle();
1271
- jQuery('.toggle-custom-textarea-show span').toggle();
1272
- jQuery('.fts-custom-css-text').toggle();
1273
- });
1274
-
1275
- // START: Fix issues when people enter the full url instead of just the ID or Name. We'll truncate this at a later date.
1276
- jQuery("#fb_page_id").change(function () {
1277
- var feedID = jQuery("input#fb_page_id").val();
1278
- if (feedID.indexOf('facebook.com') != -1 || feedID.indexOf('facebook.com') != -1) {
1279
- feedID = feedID.replace(/\/$/, '');
1280
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1281
- var newfeedID = feedID;
1282
- jQuery('#fb_page_id').val(newfeedID);
1283
- return;
1284
- }
1285
- });
1286
-
1287
- jQuery("#twitter_name").change(function () {
1288
- var feedID = jQuery("input#twitter_name").val();
1289
- if (feedID.indexOf('twitter.com') != -1) {
1290
- feedID = feedID.replace(/\/$/, '');
1291
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1292
- var newfeedID = feedID;
1293
- jQuery('#twitter_name').val(newfeedID);
1294
- return;
1295
- }
1296
- });
1297
-
1298
- jQuery("#convert_instagram_username").change(function () {
1299
- var feedID = jQuery("input#convert_instagram_username").val();
1300
- if (feedID.indexOf('instagram.com') != -1) {
1301
- feedID = feedID.replace(/\/$/, '');
1302
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1303
- var newfeedID = feedID;
1304
- jQuery('#convert_instagram_username').val(newfeedID);
1305
- return;
1306
- }
1307
- });
1308
-
1309
- jQuery("#pinterest_board_name").change(function () {
1310
- var feedID = jQuery("input#pinterest_board_name").val();
1311
- if (feedID.indexOf('pinterest.com') != -1) {
1312
- feedID = feedID.replace(/\/$/, '');
1313
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1314
- var newfeedID = feedID;
1315
- jQuery('#pinterest_board_name').val(newfeedID);
1316
- return;
1317
- }
1318
- });
1319
-
1320
- jQuery("#pinterest_name").change(function () {
1321
- var feedID = jQuery("input#pinterest_name").val();
1322
- if (feedID.indexOf('pinterest.com') != -1) {
1323
- feedID = feedID.replace(/\/$/, '');
1324
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1325
- var newfeedID = feedID;
1326
- jQuery('#pinterest_name').val(newfeedID);
1327
- return;
1328
- }
1329
- });
1330
-
1331
- <?php
1332
- //show the js for the discount option under social icons on the settings page
1333
- // also show the youtube feed on change events
1334
- if(is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?>
1335
-
1336
- jQuery("#youtube_name").change(function () {
1337
- var feedID = jQuery("input#youtube_name").val();
1338
- if (feedID.indexOf('youtube.com/user') != -1) {
1339
- feedID = feedID.replace(/\/$/, '');
1340
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1341
- var newfeedID = feedID;
1342
- jQuery('#youtube_name').val(newfeedID);
1343
- return;
1344
- }
1345
- });
1346
-
1347
- jQuery("#youtube_name2").change(function () {
1348
- var feedID = jQuery("input#youtube_name2").val();
1349
- if (feedID.indexOf('youtube.com/user') != -1) {
1350
- feedID = feedID.replace(/\/$/, '');
1351
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1352
- var newfeedID = feedID;
1353
- jQuery('#youtube_name2').val(newfeedID);
1354
- return;
1355
- }
1356
- });
1357
-
1358
- jQuery("#youtube_channelID").change(function () {
1359
- var feedID = jQuery("input#youtube_channelID").val();
1360
- if (feedID.indexOf('youtube.com/channel') != -1) {
1361
- feedID = feedID.replace(/\/$/, '');
1362
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1363
- var newfeedID = feedID;
1364
- jQuery('#youtube_channelID').val(newfeedID);
1365
- return;
1366
- }
1367
- });
1368
-
1369
- jQuery("#youtube_channelID2").change(function () {
1370
- var feedID = jQuery("input#youtube_channelID2").val();
1371
- if (feedID.indexOf('youtube.com/channel') != -1) {
1372
- feedID = feedID.replace(/\/$/, '');
1373
- feedID = feedID.substr(feedID.lastIndexOf('/') + 1);
1374
- var newfeedID = feedID;
1375
- jQuery('#youtube_channelID2').val(newfeedID);
1376
- return;
1377
- }
1378
- });
1379
-
1380
- jQuery("#youtube_playlistID").change(function () {
1381
- var feedID = jQuery("input#youtube_playlistID").val();
1382
- if (feedID.indexOf('youtube.com/playlist?list=') != -1) {
1383
- feedID = feedID.replace(/\/$/, '');
1384
- feedID = feedID.substr(feedID.lastIndexOf('=') + 1);
1385
- var newfeedID = feedID;
1386
- jQuery('#youtube_playlistID').val(newfeedID);
1387
- return;
1388
- }
1389
- });
1390
-
1391
- jQuery("#youtube_playlistID2").change(function () {
1392
- var feedID = jQuery("input#youtube_playlistID2").val();
1393
- if (feedID.indexOf('youtube.com/playlist?list=') != -1) {
1394
- feedID = feedID.replace(/\/$/, '');
1395
- feedID = feedID.substr(feedID.lastIndexOf('=') + 1);
1396
- var newfeedID = feedID;
1397
- jQuery('#youtube_playlistID2').val(newfeedID);
1398
- return;
1399
- }
1400
- });
1401
- // END: Fix issues when people enter the full url instead of just the ID or Name. We'll truncate this at a later date.
1402
- <?php }
1403
- else { ?>
1404
- jQuery("#discount-for-review").click(function () {
1405
- jQuery('.discount-review-text').slideToggle();
1406
- });
1407
- <?php } ?>
1408
- }); //end document ready
1409
-
1410
- <?php
1411
- //Premium JS
1412
- if (is_plugin_active('feed-them-premium/feed-them-premium.php')) {
1413
- include(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/youtube-settings-js.js');
1414
- }
1415
- ?>
1416
-
1417
-
1418
- jQuery('#fb_hide_like_box_button_reviews').change(function () {
1419
- jQuery('.fb_align_likebox_reviews').toggle();
1420
-
1421
- });
1422
-
1423
- // Like box/button Options Premium Content
1424
- jQuery('#facebook-messages-selector').change(function () {
1425
- if (jQuery("select#facebook-messages-selector").val() == "group" || jQuery("select#facebook-messages-selector").val() == "event" || jQuery("select#facebook-messages-selector").val() == "events" || jQuery("select#facebook-messages-selector").val() == "reviews") {
1426
- jQuery('.like-box-wrap').hide();
1427
- // alert(jQuery("select#facebook-messages-selector").val());
1428
- }
1429
- else {
1430
- jQuery('.like-box-wrap').show();
1431
- }
1432
- });
1433
-
1434
- // Carousel and Slideshow Premium Content
1435
- jQuery('#facebook-messages-selector').change(function () {
1436
- if (jQuery("select#facebook-messages-selector").val() == "album_photos" || jQuery("select#facebook-messages-selector").val() == "album_videos") {
1437
- jQuery('.slideshow-wrap').show();
1438
- // alert(jQuery("select#facebook-messages-selector").val());
1439
- }
1440
- else {
1441
- jQuery('.slideshow-wrap').hide();
1442
- }
1443
- });
1444
- jQuery('#scrollhorz_or_carousel').change(function () {
1445
- jQuery('.slider_carousel_wrap').toggle();
1446
- });
1447
- jQuery('#fts-slider').change(function () {
1448
- jQuery('.slider_options_wrap').toggle();
1449
- });
1450
- </script>
1451
- <?php }
1452
- }//END Class
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/feed-them-settings-page.php CHANGED
@@ -7,6 +7,7 @@ namespace feedthemsocial;
7
  * @package feedthemsocial
8
  * @since 1.9.6
9
  */
 
10
  class FTS_settings_page
11
  {
12
  /**
@@ -45,10 +46,7 @@ class FTS_settings_page
45
  <a href="javascript:;" class="instagram-icon"></a>
46
  <a href="javascript:;" class="pinterest-icon"></a>
47
 
48
- <div id="discount-for-review"><a href="https://www.slickremix.com/betablog/wp-admin/admin.php?page=fts-license-page"><?php _e('View Extensions & Demos', 'feed-them-social'); ?></a></div>
49
- <div class="discount-review-text">
50
- <a href="https://www.slickremix.com/downloads/feed-them-social-premium-extension/" target="_blank"><?php _e('Share here', 'feed-them-social'); ?></a> <?php _e('and receive 10% OFF your total order.', 'feed-them-social'); ?>
51
- </div>
52
  </div>
53
 
54
  <div class="fts-tabs" id="fts-tabs">
@@ -76,7 +74,7 @@ class FTS_settings_page
76
  <section>
77
 
78
  <h2 class="fts-logo-subheader"><?php _e('Create Shortcode for Social Network', 'feed-them-social'); ?></h2>
79
- <div class="use-of-plugin"><?php _e('Please select what type of feed you would like to see using the select option below. After setting your options click the green Generate Shortcode button, then copy and paste the shortcode to a page, post or widget.', 'feed-them-social'); ?></div>
80
 
81
  <form class="feed-them-social-admin-form" id="feed-selector-form">
82
  <select id="shortcode-form-selector">
@@ -462,7 +460,7 @@ class FTS_settings_page
462
  array(
463
  'option_type' => 'input',
464
  'input_wrap_class' => 'combine_facebook_name',
465
- 'label' => __('Facebook ID', 'feed-them-social'),
466
  'instructional-text' => '<strong>REQUIRED:</strong> Make sure you have an <strong>Access Token</strong> in place on the <a class="not-active-title" href="admin.php?page=fts-facebook-feed-styles-submenu-page" target="_blank">Facebook Options</a> page then copy your <a href="https://www.slickremix.com/docs/how-to-get-your-facebook-id-and-video-gallery-id" target="_blank">Facebook Name</a> and paste it in the first input below.',
467
  'type' => 'text',
468
  'id' => 'combine_facebook_name',
@@ -678,22 +676,22 @@ class FTS_settings_page
678
 
679
 
680
  //Combine Convert Instagram Name
681
- array(
682
- 'option_type' => 'input',
683
- 'input_wrap_class' => 'combine-instagram-id-option-wrap',
684
- 'label' => __('Convert Instagram Name to ID', 'feed-them-social'),
685
- 'type' => 'text',
686
- 'id' => 'combine_convert_instagram_username',
687
- 'name' => 'combine_convert_instagram_username',
688
- 'instructional-text' => __('You must copy your <a href="https://www.slickremix.com/how-to-get-your-instagram-name-and-convert-to-id/" target="_blank">Instagram Name</a> and paste it in the first input below', 'feed-them-social'),
689
- 'req_plugin' => 'combine_streams',
690
- //Relative to JS.
691
- 'short_attr' => array(
692
- 'attr_name' => '',
693
- 'ifs' => 'combine_instagram',
694
- 'no_attribute' => 'yes'
695
- ),
696
- ),
697
 
698
  //Instagram ID
699
  array(
@@ -719,7 +717,7 @@ class FTS_settings_page
719
  'required' => 'combine_streams',
720
  'instructional-text' => array(
721
  1 => array(
722
- 'text' => __('<div class="fts-insta-info-plus-wrapper">Choose a different ID if yours is not the first name below after clicking Convert Instagram Username button.</div><!-- the li list comes from an ajax call after looking up the user ID --><ul id="fts-instagram-username-picker-wrap-combined" class="fts-instagram-username-picker-wrap"></ul>', 'feed-them-social'),
723
  'class' => 'combine-instagram-user-option-text',
724
  ),
725
  2 => array(
@@ -1168,16 +1166,16 @@ class FTS_settings_page
1168
  'value' => 'events',
1169
  'title' => __('Facebook Page List of Events', 'feed-them-social'),
1170
  ),
1171
- //Facebook Page Single Event Posts
1172
- array(
1173
- 'value' => 'event',
1174
- 'title' => __('Facebook Page Single Event Posts', 'feed-them-social'),
1175
- ),
1176
- //Facebook Group
1177
- array(
1178
- 'value' => 'group',
1179
- 'title' => __('Facebook Group', 'feed-them-social'),
1180
- ),
1181
  //Facebook Album Photos
1182
  array(
1183
  'value' => 'album_photos',
@@ -4238,19 +4236,19 @@ class FTS_settings_page
4238
  ),
4239
  ),
4240
  //Feed Type Selection
4241
- 'conversion_input' => array(
4242
- 'main_wrap_class' => 'instagram-id-option-wrap',
4243
- 'conv_section_title' => __('Convert Instagram Name to ID', 'feed-them-social'),
4244
- 'instructional-text' => 'You must copy your <a href="https://www.slickremix.com/how-to-get-your-instagram-name-and-convert-to-id/" target="_blank">Instagram Name</a> and paste it in the first input below',
4245
- 'input_wrap_class' => 'instagram_name',
4246
- 'label' => __('Instagram Name (required)', 'feed-them-social'),
4247
- 'id' => 'convert_instagram_username',
4248
- 'name' => 'convert_instagram_username',
4249
- //Button
4250
- 'btn-value' => __('Convert Instagram Username', 'feed-them-social'),
4251
- 'onclick' => 'converter_instagram_username();',
4252
- ),
4253
- 'short_attr_final' => 'yes',
4254
  //Inputs relative to all Feed_types of this feed. (Eliminates Duplication)[Excluded from loop when creating select]
4255
  'main_options' => array(
4256
  //Instagram ID
@@ -4277,7 +4275,7 @@ class FTS_settings_page
4277
  'required' => 'yes',
4278
  'instructional-text' => array(
4279
  1 => array(
4280
- 'text' => __('<div class="fts-insta-info-plus-wrapper">Choose a different ID if yours is not the first name below after clicking Convert Instagram Username button.</div><!-- the li list comes from an ajax call after looking up the user ID --><ul id="fts-instagram-username-picker-wrap" class="fts-instagram-username-picker-wrap"></ul>', 'feed-them-social'),
4281
  'class' => 'instagram-user-option-text',
4282
  ),
4283
  2 => array(
@@ -4296,6 +4294,24 @@ class FTS_settings_page
4296
  'empty_error' => 'yes',
4297
  ),
4298
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4299
  //Pic Count
4300
  array(
4301
  'option_type' => 'input',
@@ -5535,6 +5551,42 @@ class FTS_settings_page
5535
  }
5536
  });
5537
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5538
  <?php if (!is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?>
5539
  jQuery('#instagram-messages-selector').bind('change', function (e) {
5540
  if (jQuery('#instagram-messages-selector').val() == 'location') {
@@ -6139,7 +6191,7 @@ class FTS_settings_page
6139
  }
6140
 
6141
  //Append button to instagram converter input
6142
- jQuery(".combine-instagram-id-option-wrap").append('<input type="button" class="feed-them-social-admin-submit-btn" value="Convert Instagram Username" onclick="converter_instagram_username();" tabindex="4" style="margin-right:1em;" />');
6143
 
6144
  jQuery(document).ready(function () {
6145
 
7
  * @package feedthemsocial
8
  * @since 1.9.6
9
  */
10
+
11
  class FTS_settings_page
12
  {
13
  /**
46
  <a href="javascript:;" class="instagram-icon"></a>
47
  <a href="javascript:;" class="pinterest-icon"></a>
48
 
49
+ <div id="discount-for-review"><a href="admin.php?page=fts-license-page"><?php _e('View Extensions & Demos', 'feed-them-social'); ?></a></div>
 
 
 
50
  </div>
51
 
52
  <div class="fts-tabs" id="fts-tabs">
74
  <section>
75
 
76
  <h2 class="fts-logo-subheader"><?php _e('Create Shortcode for Social Network', 'feed-them-social'); ?></h2>
77
+ <div class="use-of-plugin"><?php _e('Please select what type of feed you would like using the select option below. After setting your options click the green Generate Shortcode button, then copy and paste the shortcode to a page, post or widget.', 'feed-them-social'); ?></div>
78
 
79
  <form class="feed-them-social-admin-form" id="feed-selector-form">
80
  <select id="shortcode-form-selector">
460
  array(
461
  'option_type' => 'input',
462
  'input_wrap_class' => 'combine_facebook_name',
463
+ 'label' => __('Facebook Name', 'feed-them-social'),
464
  'instructional-text' => '<strong>REQUIRED:</strong> Make sure you have an <strong>Access Token</strong> in place on the <a class="not-active-title" href="admin.php?page=fts-facebook-feed-styles-submenu-page" target="_blank">Facebook Options</a> page then copy your <a href="https://www.slickremix.com/docs/how-to-get-your-facebook-id-and-video-gallery-id" target="_blank">Facebook Name</a> and paste it in the first input below.',
465
  'type' => 'text',
466
  'id' => 'combine_facebook_name',
676
 
677
 
678
  //Combine Convert Instagram Name
679
+ // array(
680
+ // 'option_type' => 'input',
681
+ // 'input_wrap_class' => 'combine-instagram-id-option-wrap',
682
+ // 'label' => __('Convert Instagram Name to ID', 'feed-them-social'),
683
+ // 'type' => 'text',
684
+ // 'id' => 'combine_convert_instagram_username',
685
+ // 'name' => 'combine_convert_instagram_username',
686
+ // 'instructional-text' => __('You must copy your <a href="https://www.slickremix.com/how-to-get-your-instagram-name-and-convert-to-id/" target="_blank">Instagram Name</a> and paste it in the first input below', 'feed-them-social'),
687
+ // 'req_plugin' => 'combine_streams',
688
+ // //Relative to JS.
689
+ // 'short_attr' => array(
690
+ // 'attr_name' => '',
691
+ // 'ifs' => 'combine_instagram',
692
+ // 'no_attribute' => 'yes'
693
+ // ),
694
+ // ),
695
 
696
  //Instagram ID
697
  array(
717
  'required' => 'combine_streams',
718
  'instructional-text' => array(
719
  1 => array(
720
+ 'text' => __('<div class="fts-insta-info-plus-wrapper">If your Access Token is set on the Instagram Options page of our plugin your ID should appear below.</div>', 'feed-them-social') ,
721
  'class' => 'combine-instagram-user-option-text',
722
  ),
723
  2 => array(
1166
  'value' => 'events',
1167
  'title' => __('Facebook Page List of Events', 'feed-them-social'),
1168
  ),
1169
+ // //Facebook Page Single Event Posts
1170
+ // array(
1171
+ // 'value' => 'event',
1172
+ // 'title' => __('Facebook Page Single Event Posts', 'feed-them-social'),
1173
+ // ),
1174
+ // //Facebook Group
1175
+ // array(
1176
+ // 'value' => 'group',
1177
+ // 'title' => __('Facebook Group', 'feed-them-social'),
1178
+ // ),
1179
  //Facebook Album Photos
1180
  array(
1181
  'value' => 'album_photos',
4236
  ),
4237
  ),
4238
  //Feed Type Selection
4239
+ // 'conversion_input' => array(
4240
+ // 'main_wrap_class' => 'instagram-id-option-wrap',
4241
+ // 'conv_section_title' => __('Convert Instagram Name to ID', 'feed-them-social'),
4242
+ // 'instructional-text' => 'You must copy your <a href="https://www.slickremix.com/how-to-get-your-instagram-name-and-convert-to-id/" target="_blank">Instagram Name</a> and paste it in the first input below',
4243
+ // 'input_wrap_class' => 'instagram_name',
4244
+ // 'label' => __('Instagram Name (required)', 'feed-them-social'),
4245
+ // 'id' => 'convert_instagram_username',
4246
+ // 'name' => 'convert_instagram_username',
4247
+ // //Button
4248
+ // 'btn-value' => __('Convert Instagram Username', 'feed-them-social'),
4249
+ // 'onclick' => 'converter_instagram_username();',
4250
+ // ),
4251
+ // 'short_attr_final' => 'yes',
4252
  //Inputs relative to all Feed_types of this feed. (Eliminates Duplication)[Excluded from loop when creating select]
4253
  'main_options' => array(
4254
  //Instagram ID
4275
  'required' => 'yes',
4276
  'instructional-text' => array(
4277
  1 => array(
4278
+ 'text' => __('<div class="fts-insta-info-plus-wrapper">If your Access Token is set on the Instagram Options page of our plugin your ID should appear below.<br/><strong>To create an additional feed</strong> go back the ', 'feed-them-social') . ' <a href="admin.php?page=fts-instagram-feed-styles-submenu-page" target="">' . __('Instagram Options', 'feed-them-social') . '</a>' . __(' and make sure you are logged into that specific Instagram account then click the button again to get a new Access Token/ID. Remember to click Save all Changes and return here.</div>', 'feed-them-social') ,
4279
  'class' => 'instagram-user-option-text',
4280
  ),
4281
  2 => array(
4294
  'empty_error' => 'yes',
4295
  ),
4296
  ),
4297
+ //Access Token
4298
+ array(
4299
+ 'option_type' => 'input',
4300
+ 'label' => __('Access Token (required) ', 'feed-them-social') . '<br/><small>' . __('', 'feed-them-gallery') . '</small>',
4301
+ 'type' => 'text',
4302
+ 'id' => 'insta_access_token',
4303
+ 'name' => 'insta_access_token',
4304
+ // Only needed if Prem_Req = More otherwise remove (must have array key req_plugin)
4305
+ // 'prem_req_more_msg' => '<br/><small>' . __('More than 6 Requires <a target="_blank" href="https://www.slickremix.com/downloads/feed-them-social-premium-extension/">Premium version</a>', 'feed-them-social') . '</small>',
4306
+ 'placeholder' => __('', 'feed-them-social'),
4307
+ //Relative to JS.
4308
+ 'short_attr' => array(
4309
+ 'attr_name' => 'access_token',
4310
+ 'var_final_if' => 'yes',
4311
+ 'empty_error' => 'set',
4312
+ 'empty_error_value' => '',
4313
+ ),
4314
+ ),
4315
  //Pic Count
4316
  array(
4317
  'option_type' => 'input',
5551
  }
5552
  });
5553
 
5554
+ function getQueryString(Param) {
5555
+ return decodeURI(
5556
+ (RegExp('[#|&]' + Param + '=' + '(.+?)(&|$)').exec(location.hash) || [, null])[1]
5557
+ );
5558
+ }
5559
+
5560
+ if (window.location.hash && getQueryString('feed_type') == 'instagram') {
5561
+ jQuery('#feed-selector-form').find('option[value=instagram-shortcode-form]').attr('selected','selected');
5562
+ jQuery('.shortcode-generator-form.instagram-shortcode-form').show();
5563
+ jQuery('#instagram_id').val(jQuery('#instagram_id').val() + '<?php echo get_option('fts_instagram_custom_id') ?>');
5564
+ jQuery('#insta_access_token').val(jQuery('#insta_access_token').val() + '<?php echo get_option('fts_instagram_custom_api_token') ?>');
5565
+ }
5566
+
5567
+ jQuery('#shortcode-form-selector, #instagram-messages-selector').bind('change', function (e) {
5568
+ if (jQuery('#instagram-messages-selector').val() == 'user') {
5569
+ jQuery('#instagram_id, #insta_access_token').val('');
5570
+ jQuery('#instagram_id').val(jQuery('#instagram_id').val() + '<?php echo get_option('fts_instagram_custom_id') ?>');
5571
+ jQuery('#insta_access_token').val(jQuery('#insta_access_token').val() + '<?php echo get_option('fts_instagram_custom_api_token') ?>');
5572
+ }
5573
+ else {
5574
+ jQuery('#instagram_id').val('');
5575
+ }
5576
+
5577
+ });
5578
+
5579
+ jQuery('#combine_instagram, #combine_instagram_type').bind('change', function (e) {
5580
+ jQuery('#combine_instagram_name').val('');
5581
+ if (jQuery('#combine_instagram_type').val() == 'user') {
5582
+ jQuery('#combine_instagram_name').val(jQuery('#combine_instagram_name').val() + '<?php echo get_option('fts_instagram_custom_id') ?>');
5583
+ }
5584
+ else {
5585
+ jQuery('#combine_instagram_name').val('');
5586
+ }
5587
+
5588
+ });
5589
+
5590
  <?php if (!is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?>
5591
  jQuery('#instagram-messages-selector').bind('change', function (e) {
5592
  if (jQuery('#instagram-messages-selector').val() == 'location') {
6191
  }
6192
 
6193
  //Append button to instagram converter input
6194
+ // jQuery('.combine-instagram-id-option-wrap').append('<input type="button" class="feed-them-social-admin-submit-btn" value="Convert Instagram Username" onclick="converter_instagram_username();" tabindex="4" style="margin-right:1em;" />');
6195
 
6196
  jQuery(document).ready(function () {
6197
 
admin/free-plugin-license-page.php DELETED
@@ -1,359 +0,0 @@
1
- <?php
2
- namespace feedthemsocial;
3
-
4
- // Exit if accessed directly
5
- if ( ! defined( 'ABSPATH' ) ) exit;
6
-
7
- /**
8
- * Class FTS Settings Page
9
- *
10
- * @package feedthemsocial
11
- * @since 2.1.6
12
- */
13
- class fts_Free_Plugin_License_Page {
14
-
15
- public $prem_plugins = '';
16
- public $main_menu_slug = 'feed-them-settings-page';
17
- public $license_page_slug = 'fts-license-page';
18
- public $plugin_identifier = '';
19
-
20
- // static variables
21
- private static $instance = false;
22
-
23
- /**
24
- * Construct
25
- *
26
- * FTS_settings_page constructor.
27
- *
28
- * @since 2.1.6
29
- */
30
- function __construct() {
31
- //List of Plugins! Keep this up to date in order for showing what is available for FTS on Plugin License page.
32
- $this->prem_plugins = array(
33
- 'feed_them_social_premium' => array(
34
- 'title' => 'Feed Them Social Premium',
35
- 'plugin_url' => 'feed-them-premium/feed-them-premium.php',
36
- 'demo_url' => 'http://feedthemsocial.com/facebook-page-feed-demo/',
37
- 'purchase_url' => 'https://www.slickremix.com/downloads/feed-them-social-premium-extension/',
38
- ),
39
- 'feed_them_social_combined_streams' => array(
40
- 'title' => 'Feed Them Social Combined Streams',
41
- 'plugin_url' => 'feed-them-social-combined-streams/feed-them-social-combined-streams.php',
42
- 'demo_url' => 'http://feedthemsocial.com/feed-them-social-combined-streams/',
43
- 'purchase_url' => 'https://www.slickremix.com/downloads/feed-them-social-combined-streams/',
44
- ),
45
- 'feed-them-social-facebook-reviews' => array(
46
- 'title' => 'Feed Them Social Facebook Reviews',
47
- 'plugin_url' => 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php',
48
- 'demo_url' => 'http://feedthemsocial.com/facebook-page-reviews-demo/',
49
- 'purchase_url' => 'https://www.slickremix.com/downloads/feed-them-social-facebook-reviews/',
50
- ),
51
- 'feed_them_carousel_premium' => array(
52
- 'title' => 'Feed Them Carousel Premium',
53
- 'plugin_url' => 'feed-them-carousel-premium/feed-them-carousel-premium.php',
54
- 'demo_url' => 'http://feedthemsocial.com/facebook-carousels-or-sliders/',
55
- 'purchase_url' => 'https://www.slickremix.com/downloads/feed-them-carousel-premium/',
56
- ),
57
- 'fts_bar' => array(
58
- 'title' => 'FTS Bar',
59
- 'plugin_url' => 'fts-bar/fts-bar.php',
60
- 'demo_url' => 'http://feedthemsocial.com/fts-bar/',
61
- 'purchase_url' => 'https://www.slickremix.com/downloads/fts-bar/',
62
- ),
63
- );
64
- $this->install();
65
- }
66
-
67
- /**
68
- * Install Updater
69
- *
70
- * @since 2.1.6
71
- */
72
- function install() {
73
- if (!function_exists('is_plugin_active'))
74
- require_once(ABSPATH . '/wp-admin/includes/plugin.php');
75
-
76
- $prem_active = false;
77
- foreach ($this->prem_plugins as $plugin) {
78
- if (is_plugin_active($plugin['plugin_url'])) {
79
- $prem_active = true;
80
- }
81
-
82
- }
83
- //No Premium plugins Active make Plugin License page.
84
- if ($prem_active == false) {
85
- if (!self::$instance) {
86
- self::$instance = true;
87
- add_action('admin_menu', array($this, 'license_menu'));
88
- }
89
- }
90
- //Premium Active: Add boxes to plugin licence page they don't have.
91
- //Rgister new override options
92
- if (isset($_GET['page']) && $_GET['page'] == 'fts-license-page') {
93
- add_action('current_screen', array($this, 'register_options'));
94
- }
95
- }
96
-
97
- /**
98
- * Register Plugin License Page Options (overrides options from prem extentions updater files
99
- *
100
- * @since 2.1.6
101
- */
102
- function register_options() {
103
- add_settings_section('main_section', '', null, $this->license_page_slug);
104
-
105
- foreach ($this->prem_plugins as $key => $plugin) {
106
- if (is_plugin_active($plugin['plugin_url'])) {
107
- $this->plugin_identifier = $key;
108
- register_setting($this->license_page_slug . '_license_manager_page', $key . '_license_key', array($this, 'edd_sanitize_license'));
109
- $args = array(
110
- 'key' => $key,
111
- 'plugin_name' => $plugin['title'],
112
- 'demo_url' => $plugin['demo_url'],
113
- 'purchase_url' => $plugin['purchase_url'],
114
- );
115
- //Show Active Premium Plugins
116
- add_settings_field($key . '_license_key', '', array($this, 'add_option_setting'), $this->license_page_slug, 'main_section', $args);
117
- } else {
118
- register_setting($this->license_page_slug . '_license_manager_page', $key . '_license_key');
119
- //Show Special Box for non actives plugins!
120
- //Set Variables
121
- $args = array(
122
- 'plugin_name' => $plugin['title'],
123
- 'demo_url' => $plugin['demo_url'],
124
- 'purchase_url' => $plugin['purchase_url'],
125
- );
126
-
127
- //show Premium needed box
128
- add_settings_field($key . '_license_key', '', array($this, 'display_premium_needed_license'), $this->license_page_slug, 'main_section', $args);
129
- }
130
- }
131
- }
132
-
133
- /**
134
- * Add Options to Plugin License page
135
- *
136
- * @param $args
137
- * @since 2.1.6
138
- */
139
- function add_option_setting($args) {
140
- $key = $args['key'];
141
- $plugin_name = $args['plugin_name'];
142
-
143
- $license = get_option($key . '_license_key');
144
- $status = get_option($key . '_license_status');
145
- ?>
146
- <tr valign="top" class="fts-license-wrap">
147
- <th scope="row" valign="top">
148
- <?php _e($plugin_name); ?>
149
- </th>
150
- <td>
151
- <input id="<?php echo $key ?>_license_key" name="<?php echo $key ?>_license_key" type="text" placeholder="<?php _e('Enter your license key'); ?>" class="regular-text" value="<?php esc_attr_e($license); ?>"/>
152
- <label class="description" for="<?php print $key ?>_license_key"><?php if ($status !== false && $status == 'valid') { ?>
153
-
154
- <?php wp_nonce_field($key . 'license_page_nonce', $key . 'license_page_nonce'); ?>
155
- <input type="submit" class="button-secondary" name="<?php echo $key ?>_edd_license_deactivate" value="<?php _e('Deactivate License'); ?>"/>
156
-
157
- <div class="edd-license-data"><p><?php _e('License Key Active.'); ?></p></div>
158
-
159
- <?php
160
- } else {
161
- wp_nonce_field($key . 'license_page_nonce', $key . 'license_page_nonce'); ?>
162
- <input type="submit" class="button-secondary" name="<?php echo $key ?>_edd_license_activate" value="<?php _e('Activate License'); ?>"/>
163
- <div class="edd-license-data edd-license-msg-error"><p><?php $this->update_admin_notices();
164
- _e('To receive updates notifications, please enter your valid license key.'); ?></p>
165
- </div>
166
- <?php } ?></label>
167
-
168
-
169
- <?php
170
- //Create Upgrade Button
171
- if (isset($license) && !empty($license) && $status !== false && $status == 'valid') {
172
- echo '<a class="edd-upgrade-license-btn button-secondary" target="_blank" href="https://www.slickremix.com/my-account/?&view=upgrades&license_key=' . $license . '">Upgrade License</a>';
173
- }
174
- ?>
175
- </td>
176
- </tr> <?php
177
- }
178
-
179
- /**
180
- * Add Plugin License Menu
181
- *
182
- * @since 2.1.6
183
- */
184
- function license_menu() {
185
- global $submenu;
186
- //Override submenu page if needed
187
- if (isset($submenu[$this->main_menu_slug]) && in_array($this->license_page_slug, wp_list_pluck($submenu[$this->main_menu_slug], 2))) {
188
- remove_submenu_page($this->main_menu_slug, $this->license_page_slug);
189
- }
190
- if (isset($submenu[$this->main_menu_slug]) && !in_array($this->license_page_slug, wp_list_pluck($submenu[$this->main_menu_slug], 2))) {
191
- add_submenu_page($this->main_menu_slug, __('Plugin License', 'feed-them-social'), __('Plugin License', 'feed-them-social'), 'manage_options', $this->license_page_slug, array($this, 'license_page'));
192
- }
193
- }
194
-
195
- /**
196
- * Add FREE Plugin License Page for displaying what is available to extend FTS
197
- *
198
- * @since 2.1.6
199
- */
200
- function license_page() {
201
- ?>
202
- <div class="wrap">
203
- <h2><?php _e('Plugin License Options'); ?></h2>
204
- <div class="license-note"> <?php _e("If you need more licenses or your key has expired, please go to the <a href='https://www.slickremix.com/my-account/' target='_blank'>MY ACCOUNT</a> page on our website to upgrade or renew your license.<br/>To get started follow the instructions below.", "feed-them-social") ?> </div>
205
-
206
- <div class="fts-activation-msg">
207
- <ol>
208
- <li><?php _e('Install the zip file of the plugin you should have received after purchase on the <a href="plugin-install.php">plugins page</a> and leave the free version active too.', 'feed-them-social') ?></li>
209
- <li><?php _e('Now Enter your License Key and Click the <strong>Save Changes button</strong>.', 'feed-them-social') ?></li>
210
- <li><?php _e('Finally, Click the <strong>Activate License button</strong>.', 'feed-them-social') ?></li>
211
- </ol>
212
- </div>
213
- <form method="post" action="options.php" class="fts-license-master-form">
214
- <?php settings_fields($this->license_page_slug . '_license_manager_page'); ?>
215
- <table class="form-table">
216
- <tbody>
217
-
218
- <?php
219
- $prem_active = false;
220
- foreach ($this->prem_plugins as $plugin) {
221
- if (is_plugin_active($plugin['plugin_url'])) {
222
- $prem_active = true;
223
- }
224
- }
225
- //No Premium plugins Active make Plugin License page.
226
- if ($prem_active === true) {
227
- do_settings_fields($this->license_page_slug, 'main_section');
228
- } else {
229
- //Each Premium Plugin wrap
230
- foreach ($this->prem_plugins as $plugin) {
231
- //Set Variables
232
- $args = array(
233
- 'plugin_name' => $plugin['title'],
234
- 'demo_url' => $plugin['demo_url'],
235
- 'purchase_url' => $plugin['purchase_url'],
236
- );
237
-
238
- //show Premium needed box
239
- $this->display_premium_needed_license($args);
240
- }
241
- } ?>
242
-
243
- </tbody>
244
- </table>
245
- <?php if ($prem_active === true) {
246
- submit_button();
247
- } ?>
248
- </form>
249
- <div style="margin-top:0px;"><a href="https://www.slickremix.com/downloads/feed-them-gallery/" target="_blank"><img style="max-width: 100%;" src="<?php echo plugins_url('feed-them-social/admin/images/ft-gallery-promo.jpg'); ?>"/></a></div>
250
- </div>
251
- <?php
252
- }
253
-
254
- /**
255
- * Display Premium Needed boxes for plugins not active/installed for FTS
256
- *
257
- * @param $args Passed by function or add_settings_field
258
- * @since 2.1.6
259
- */
260
- function display_premium_needed_license($args) {
261
- $this->plugin_title = $args['plugin_name'];
262
- $this->demo_url = $args['demo_url'];
263
- $this->purchase_url = $args['purchase_url'];
264
-
265
- $key = $args['demo_url'];
266
- $plugin_name = $args['purchase_url'];
267
-
268
- ?>
269
-
270
- <tr valign="top" class="fts-license-wrap">
271
- <th scope="row" valign="top"><?php echo $this->plugin_title ?></th>
272
- <td>
273
- <div class="fts-no-license-overlay">
274
- <div class="fts-no-license-button-wrap"
275
- ">
276
- <a class="fts-no-license-button-purchase-btn" href="<?php echo $this->demo_url ?>" target="_blank">Demo</a>
277
- <a class="fts-no-license-button-demo-btn" href="<?php echo $this->purchase_url ?>" target="_blank">Buy
278
- Extension</a>
279
- </div>
280
- </div>
281
- <input id="no_license_key" name="no_license_key" type="text" placeholder="Enter your license key" class="regular-text" value="">
282
- <label class="description" for="no_license_key">
283
- <div class="edd-license-data edd-license-msg-error"><p>To receive updates notifications, please
284
- enter your valid license key.</p></div>
285
-
286
- </label>
287
- </td>
288
- </tr>
289
- <?php return;
290
- }
291
-
292
- /**
293
- * Generates an Upgrade license button based on information from SlickRemix's license keys
294
- *
295
- * @param $license_key
296
- * @since 2.1.6
297
- */
298
- function upgrade_license_btn($plugin_key ,$license_key, $status) {
299
- if (isset($license_key) && !empty($license_key) && $status !== false && $status == 'valid') {
300
- //$api_params = array();
301
- //$response = wp_remote_get('https://www.slickremix.com/wp-json/slick-license/v2/get-license-info?license_key=' . $license_key, array('timeout' => 60, 'sslverify' => false, 'body' => $api_params));
302
-
303
- $response[$plugin_key] = 'https://www.slickremix.com/wp-json/slick-license/v2/get-license-info?license_key=' . $license_key;
304
-
305
- $fts_functions = new feed_them_social_functions();
306
-
307
- $response = $fts_functions->fts_get_feed_json($response);
308
-
309
- $license_data = json_decode($response[$plugin_key]);
310
-
311
- if(isset($license_data->payment_id) && !empty($license_data->payment_id) && isset($license_data->payment_id ) && !empty($license_data->payment_id)){
312
- echo '<a class="edd-upgrade-license-btn button-secondary" target="_blank" href="https://www.slickremix.com/my-account/?&view=upgrades&license_key=' . $license_data->license_id . '">Upgrade License</a>';
313
- }
314
- return;
315
- }
316
- return;
317
- }
318
-
319
- /**
320
- * Sanatize License Keys
321
- *
322
- * @param $new
323
- * @return mixed
324
- * @since 2.1.6
325
- */
326
- function edd_sanitize_license($new) {
327
- $old = get_option($this->plugin_identifier . '_license_key');
328
- if ($old && $old != $new) {
329
- delete_option($this->plugin_identifier . '_license_status'); // new license has been entered, so must reactivate
330
- }
331
- return $new;
332
- }
333
-
334
- /**
335
- * This is a means of catching errors from the activation method above and displaying it to the customer
336
- *
337
- * @since 2.1.6
338
- */
339
- function update_admin_notices() {
340
- if (isset($_GET['sl_activation']) && !empty($_GET['message'])) {
341
-
342
- switch ($_GET['sl_activation']) {
343
-
344
- case 'false':
345
- $message = urldecode($_GET['message']);
346
- echo $message;
347
- break;
348
-
349
- case 'true':
350
- default:
351
- // Developers can put a custom success message here for when activation is successful if they want.
352
- break;
353
- }
354
- }
355
- }
356
-
357
- }//End CLASS
358
-
359
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
feed-them.php CHANGED
@@ -8,18 +8,18 @@
8
  * Plugin Name: Feed Them Social (Facebook, Instagram, Twitter, etc)
9
  * Plugin URI: http://feedthemsocial.com/
10
  * Description: Create and display custom feeds for Facebook Groups, Facebook Pages, Facebook Events, Facebook Photos, Facebook Album Covers, Twitter, Instagram, Pinterest and more.
11
- * Version: 2.3.9
12
  * Author: SlickRemix
13
  * Author URI: https://slickremix.com/
14
  * Text Domain: feed-them-social
15
  * Domain Path: /languages
16
  * Requires at least: wordpress 4.0.0
17
  * Tested up to: WordPress 4.9.5
18
- * Stable tag: 2.3.9
19
  * License: GPLv2 or later
20
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
21
  *
22
- * @version 2.3.9
23
  * @package FeedThemSocial/Core
24
  * @copyright Copyright (c) 2012-2018 SlickRemix
25
  *
@@ -94,7 +94,7 @@ final class Feed_Them_Social {
94
  self::$instance->core_functions = new feedthemsocial\feed_them_social_functions();
95
 
96
  //Free Plugin License page.
97
- self::$instance->plugin_license_page = new feedthemsocial\fts_Free_Plugin_License_Page();
98
 
99
  //Facebook Class
100
  self::$instance->facebook_feed = new feedthemsocial\FTS_Facebook_Feed();
@@ -146,7 +146,7 @@ final class Feed_Them_Social {
146
  function fts_update_notice() {
147
  // Check the transient to see if we've just updated the plugin
148
  if (get_transient('fts_updated')) {
149
- echo '<div class="notice notice-success updated is-dismissible"><p>' . __('Thanks for updating Feed Them Social. We have deleted the cache in our plugin so you can view any changes we have made.', 'feed-them-sociall') . '</p></div>';
150
  delete_transient('fts_updated');
151
  }
152
  }
@@ -159,7 +159,7 @@ final class Feed_Them_Social {
159
  function fts_install_notice() {
160
  // Check the transient to see if we've just activated the plugin
161
  if (get_transient('fts_activated')) {
162
- echo '<div class="notice notice-success updated is-dismissible"><p>' . __('Thanks for installing Feed Them Social. To get started please view our <a href="edit.php?post_type=ft_gallery&page=ft-gallery-settings-page">Settings</a> page.', 'feed-them-sociall') . '</p></div>';
163
  // Delete the transient so we don't keep displaying the activation message
164
  delete_transient('fts_activated');
165
  }
@@ -208,17 +208,14 @@ final class Feed_Them_Social {
208
  }
209
 
210
  if (is_plugin_active('feed-them-premium/feed-them-premium.php')) {
211
-
212
  // Plugin Directoy Path
213
  if (!defined('FEED_THEM_SOCIAL_PREMIUM_PLUGIN_FOLDER_DIR')) {
214
  define('FEED_THEM_SOCIAL_PREMIUM_PLUGIN_FOLDER_DIR', WP_PLUGIN_DIR . '/feed-them-premium/feed-them-premium.php');
215
  }
216
-
217
  }
218
-
219
  // Define constants:
220
  if (!defined('MY_TEXTDOMAIN')) {
221
- define('MY_TEXTDOMAIN', 'feed-them-gallery');
222
  }
223
  }
224
 
@@ -255,10 +252,10 @@ final class Feed_Them_Social {
255
  include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'admin/feed-them-pinterest-style-options-page.php');
256
  include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'admin/feed-them-youtube-style-options-page.php');
257
 
258
-
259
-
260
- //Free Plugin License page.
261
- include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'admin/free-plugin-license-page.php');
262
 
263
  //Feed Classes
264
  include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'feeds/facebook/facebook-feed.php');
@@ -315,7 +312,7 @@ final class Feed_Them_Social {
315
  */
316
  function fts_free_plugin_actions($actions, $plugin_file, $plugin_data, $context) {
317
  array_unshift(
318
- $actions, "<a href=\"" . menu_page_url('fts-settings-page', false) . "\">" . __("Settings") . "</a> | <a href=\"" . __('https://www.slickremix.com/support/') . "\">" . __("Support") . "</a> "
319
 
320
  );
321
  return $actions;
@@ -333,7 +330,7 @@ final class Feed_Them_Social {
333
  */
334
  function fts_leave_feedback_link($links, $file) {
335
  if ($file === plugin_basename(__FILE__)) {
336
- $links['feedback'] = '<a href="http://wordpress.org/support/view/plugin-reviews/feed-them-social" target="_blank">' . __('Rate Plugin', 'feed-me-info') . '</a>';
337
  // $links['support'] = '<a href="http://www.slickremix.com/support-forum/forum/feed-them-social-2/" target="_blank">' . __('Get support', 'feed-them-premium') . '</a>';
338
  // $links['plugininfo'] = '<a href="plugin-install.php?tab=plugin-information&plugin=feed-them-premium&section=changelog&TB_iframe=true&width=640&height=423" class="thickbox">' . __( 'Plugin info', 'gd_quicksetup' ) . '</a>';
339
  }
@@ -363,7 +360,6 @@ final class Feed_Them_Social {
363
  }
364
  }
365
  }
366
-
367
  }
368
 
369
  /**
8
  * Plugin Name: Feed Them Social (Facebook, Instagram, Twitter, etc)
9
  * Plugin URI: http://feedthemsocial.com/
10
  * Description: Create and display custom feeds for Facebook Groups, Facebook Pages, Facebook Events, Facebook Photos, Facebook Album Covers, Twitter, Instagram, Pinterest and more.
11
+ * Version: 2.4.0
12
  * Author: SlickRemix
13
  * Author URI: https://slickremix.com/
14
  * Text Domain: feed-them-social
15
  * Domain Path: /languages
16
  * Requires at least: wordpress 4.0.0
17
  * Tested up to: WordPress 4.9.5
18
+ * Stable tag: 2.4.0
19
  * License: GPLv2 or later
20
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
21
  *
22
+ * @version 2.4.0
23
  * @package FeedThemSocial/Core
24
  * @copyright Copyright (c) 2012-2018 SlickRemix
25
  *
94
  self::$instance->core_functions = new feedthemsocial\feed_them_social_functions();
95
 
96
  //Free Plugin License page.
97
+ self::$instance->updater = new feedthemsocial\updater_init();
98
 
99
  //Facebook Class
100
  self::$instance->facebook_feed = new feedthemsocial\FTS_Facebook_Feed();
146
  function fts_update_notice() {
147
  // Check the transient to see if we've just updated the plugin
148
  if (get_transient('fts_updated')) {
149
+ echo '<div class="notice notice-success updated is-dismissible"><p>' . __('Thanks for updating Feed Them Social. We have deleted the cache in our plugin so you can view any changes we have made.', 'feed-them-social') . '</p></div>';
150
  delete_transient('fts_updated');
151
  }
152
  }
159
  function fts_install_notice() {
160
  // Check the transient to see if we've just activated the plugin
161
  if (get_transient('fts_activated')) {
162
+ echo '<div class="notice notice-success updated is-dismissible"><p>' . __('Thanks for installing Feed Them Social. To get started please view our <a href="admin.php?page=feed-them-settings-page">Settings</a> page.', 'feed-them-social') . '</p></div>';
163
  // Delete the transient so we don't keep displaying the activation message
164
  delete_transient('fts_activated');
165
  }
208
  }
209
 
210
  if (is_plugin_active('feed-them-premium/feed-them-premium.php')) {
 
211
  // Plugin Directoy Path
212
  if (!defined('FEED_THEM_SOCIAL_PREMIUM_PLUGIN_FOLDER_DIR')) {
213
  define('FEED_THEM_SOCIAL_PREMIUM_PLUGIN_FOLDER_DIR', WP_PLUGIN_DIR . '/feed-them-premium/feed-them-premium.php');
214
  }
 
215
  }
 
216
  // Define constants:
217
  if (!defined('MY_TEXTDOMAIN')) {
218
+ define('MY_TEXTDOMAIN', 'feed-them-social');
219
  }
220
  }
221
 
252
  include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'admin/feed-them-pinterest-style-options-page.php');
253
  include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'admin/feed-them-youtube-style-options-page.php');
254
 
255
+ //Updater Classes
256
+ include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'updater/updater-license-page.php');
257
+ include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'updater/updater-check-class.php');
258
+ include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'updater/updater-check-init.php');
259
 
260
  //Feed Classes
261
  include(FEED_THEM_SOCIAL_PLUGIN_FOLDER_DIR . 'feeds/facebook/facebook-feed.php');
312
  */
313
  function fts_free_plugin_actions($actions, $plugin_file, $plugin_data, $context) {
314
  array_unshift(
315
+ $actions, '<a href="admin.php?page=feed-them-settings-page">' . __('Settings') .'</a> | <a href="' . __('https://www.slickremix.com/support/') . '">' . __('Support') . '</a>'
316
 
317
  );
318
  return $actions;
330
  */
331
  function fts_leave_feedback_link($links, $file) {
332
  if ($file === plugin_basename(__FILE__)) {
333
+ $links['feedback'] = '<a href="http://wordpress.org/support/view/plugin-reviews/feed-them-social" target="_blank">' . __('Rate Plugin', 'feed-them-social') . '</a>';
334
  // $links['support'] = '<a href="http://www.slickremix.com/support-forum/forum/feed-them-social-2/" target="_blank">' . __('Get support', 'feed-them-premium') . '</a>';
335
  // $links['plugininfo'] = '<a href="plugin-install.php?tab=plugin-information&plugin=feed-them-premium&section=changelog&TB_iframe=true&width=640&height=423" class="thickbox">' . __( 'Plugin info', 'gd_quicksetup' ) . '</a>';
336
  }
360
  }
361
  }
362
  }
 
363
  }
364
 
365
  /**
feeds/instagram/instagram-feed.php CHANGED
@@ -158,6 +158,7 @@ class FTS_Instagram_Feed extends feed_them_social_functions
158
  'profile_description' => '',
159
  'columns' => '',
160
  'force_columns' => '',
 
161
  ), $atts));
162
  if ($pics_count == NULL)
163
  $pics_count = '6';
@@ -171,11 +172,10 @@ class FTS_Instagram_Feed extends feed_them_social_functions
171
  $pics_count = $pics_count;
172
  }
173
  else {
174
-
175
  $pics_count = '10';
176
  }
177
 
178
- wp_enqueue_script('fts-global', plugins_url('feed-them-social/feeds/js/fts-global.js'), array('jquery'));
179
  $instagram_data_array = array();
180
 
181
  $fts_instagram_access_token = get_option('fts_instagram_custom_api_token');
@@ -197,12 +197,21 @@ class FTS_Instagram_Feed extends feed_them_social_functions
197
  }
198
 
199
  ob_start();
200
- if (empty($fts_instagram_access_token)) {
201
- $fts_instagram_tokens_array = array('267791236.df31d88.30e266dda9f84e9f97d9e603f41aaf9e', '267791236.14c1243.a5268d6ed4cf4d2187b0e98b365443af', '267791236.f78cc02.bea846f3144a40acbf0e56b002c112f8', '258559306.502d2c4.c5ff817f173547d89477a2bd2e6047f9');
202
- $fts_instagram_access_token = $fts_instagram_tokens_array[array_rand($fts_instagram_tokens_array, 1)];
203
- } else {
 
 
 
 
 
 
204
  $fts_instagram_access_token = $fts_instagram_access_token;
205
  }
 
 
 
206
 
207
  //URL to get Feeds
208
  if ($type == 'hashtag') {
@@ -432,10 +441,15 @@ class FTS_Instagram_Feed extends feed_them_social_functions
432
  <?php
433
 
434
  if(is_plugin_active('feed-them-premium/feed-them-premium.php') && isset($popup) && $popup == "yes"){ ?>
435
- <div class="fts-instagram-popup-profile-wrap"><div class="fts-profile-pic"><a href="https://www.instagram.com/<?php print $username; ?>"><img src="<?php print $profile_picture; ?>" title="<?php print $username; ?>"/></a></div>
 
 
 
436
  <div class="fts-profile-name-wrap">
437
 
438
- <div class="fts-isnta-full-name"><?php print $full_name; ?></div>
 
 
439
  <?php
440
  if (isset($fts_instagram_show_follow_btn) && $fts_instagram_show_follow_btn == 'yes' && $fts_instagram_show_follow_btn_where == 'instagram-follow-above' && isset($instagram_username)) {
441
  echo '<div class="fts-follow-header-wrap">';
158
  'profile_description' => '',
159
  'columns' => '',
160
  'force_columns' => '',
161
+ 'access_token' => '',
162
  ), $atts));
163
  if ($pics_count == NULL)
164
  $pics_count = '6';
172
  $pics_count = $pics_count;
173
  }
174
  else {
 
175
  $pics_count = '10';
176
  }
177
 
178
+ wp_enqueue_script('fts-global', plugins_url('feed-them-social/feeds/js/fts-global.js'), array('jquery'));
179
  $instagram_data_array = array();
180
 
181
  $fts_instagram_access_token = get_option('fts_instagram_custom_api_token');
197
  }
198
 
199
  ob_start();
200
+ // Omitting for Time Being since Instagram API changes as of April 4th, 2018
201
+ // if (empty($fts_instagram_access_token)) {
202
+ // $fts_instagram_tokens_array = array('267791236.df31d88.30e266dda9f84e9f97d9e603f41aaf9e', '267791236.14c1243.a5268d6ed4cf4d2187b0e98b365443af', '267791236.f78cc02.bea846f3144a40acbf0e56b002c112f8', '258559306.502d2c4.c5ff817f173547d89477a2bd2e6047f9');
203
+ // $fts_instagram_access_token = $fts_instagram_tokens_array[array_rand($fts_instagram_tokens_array, 1)];
204
+ // } else {
205
+ // $fts_instagram_access_token = $fts_instagram_access_token;
206
+ // }
207
+
208
+ // New method since Instagram API changes as of April 4th, 2018
209
+ if($access_token == '') {
210
  $fts_instagram_access_token = $fts_instagram_access_token;
211
  }
212
+ else {
213
+ $fts_instagram_access_token = $access_token;
214
+ }
215
 
216
  //URL to get Feeds
217
  if ($type == 'hashtag') {
441
  <?php
442
 
443
  if(is_plugin_active('feed-them-premium/feed-them-premium.php') && isset($popup) && $popup == "yes"){ ?>
444
+ <div class="fts-instagram-popup-profile-wrap">
445
+ <div class="fts-profile-pic">
446
+ <a href="https://www.instagram.com/<?php print $username; ?>"><?php if($type == 'user') {?><img src="<?php print $profile_picture; ?>" title="<?php print $username; ?>"/><?php } else { ?><span class="fts-instagram-icon" style="height:40px; width:40px; line-height:40px; font-size:40px;"></span><?php } ?></a>
447
+ </div>
448
  <div class="fts-profile-name-wrap">
449
 
450
+ <div class="fts-isnta-full-name">
451
+ <a href="https://www.instagram.com/<?php print $username; ?>" style="color: #000;"><?php if($type == 'user') { print $full_name; } else { print $username; } ?></a>
452
+ </div>
453
  <?php
454
  if (isset($fts_instagram_show_follow_btn) && $fts_instagram_show_follow_btn == 'yes' && $fts_instagram_show_follow_btn_where == 'instagram-follow-above' && isset($instagram_username)) {
455
  echo '<div class="fts-follow-header-wrap">';
includes/feed-them-functions.php CHANGED
@@ -877,6 +877,7 @@ class feed_them_social_functions
877
  function fts_instagram_style_options_page() {
878
  $instagram_style_options = array(
879
  'fts_instagram_custom_api_token',
 
880
  'instagram_show_follow_btn',
881
  'instagram_show_follow_btn_where',
882
  'instagram_loadmore_background_color',
877
  function fts_instagram_style_options_page() {
878
  $instagram_style_options = array(
879
  'fts_instagram_custom_api_token',
880
+ 'fts_instagram_custom_id',
881
  'instagram_show_follow_btn',
882
  'instagram_show_follow_btn_where',
883
  'instagram_loadmore_background_color',
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: slickremix
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
  Tested up to: 4.9.5
6
- Stable tag: 2.3.9
7
  License: GPLv2 or later
8
 
9
  Custom feeds for Facebook Pages, Groups, Events, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
@@ -33,9 +33,6 @@ Create Social Feeds of any or all your celebrities, family, friends, yourself, o
33
  * Facebook and Instagram feeds now have Load More Button and Infinite Scroll features available in Premium Version and they are mobile friendly.
34
  * Awesome Support!
35
 
36
- = COMING SOON =
37
- * For those of you who are interested in [Steamit](https://steemit.com/) we are working on creating a feed for that too. What better way to gain even more attention and get that crypto :)
38
-
39
  = Demos =
40
  * All Demos can be found on [www.FeedThemSocial.com](http://feedthemsocial.com/)
41
  * [Facebook Page Feed Demo](http://feedthemsocial.com/)
@@ -72,7 +69,7 @@ Create Social Feeds of any or all your celebrities, family, friends, yourself, o
72
 
73
  All SlickRemix plugins come with FREE Basic Support! If you need help or have questions we're here to help, just post on our [Support Forum](https://wordpress.org/support/plugin/feed-them-social#new-topic-0) and we’ll get to you as quickly as we can! (usually within 48hrs)
74
 
75
- If you enjoy using our plugin please tell others. [Click here to share](http://www.facebook.com/sharer.php?u=http://wordpress.org/plugins/feed-them-social/&t=FeedThemSocial).
76
 
77
  Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](https://www.slickremix.com/)
78
 
@@ -81,6 +78,18 @@ Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](h
81
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
82
 
83
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
84
  = Version 2.3.8 - 2.3.9 Wednesday, March 15th, 2018 =
85
  * FIX: Facebook Feed: Extra Images not appearing. We will work on the image slideshow post types in the next update.
86
  * FIX: Facebook Feed: https:// missing on some outgoing facebook links.
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
  Tested up to: 4.9.5
6
+ Stable tag: 2.4.0
7
  License: GPLv2 or later
8
 
9
  Custom feeds for Facebook Pages, Groups, Events, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
33
  * Facebook and Instagram feeds now have Load More Button and Infinite Scroll features available in Premium Version and they are mobile friendly.
34
  * Awesome Support!
35
 
 
 
 
36
  = Demos =
37
  * All Demos can be found on [www.FeedThemSocial.com](http://feedthemsocial.com/)
38
  * [Facebook Page Feed Demo](http://feedthemsocial.com/)
69
 
70
  All SlickRemix plugins come with FREE Basic Support! If you need help or have questions we're here to help, just post on our [Support Forum](https://wordpress.org/support/plugin/feed-them-social#new-topic-0) and we’ll get to you as quickly as we can! (usually within 48hrs)
71
 
72
+ If you enjoy using our plugin please tell others. [Click here to share](https://www.facebook.com/sharer.php?u=http://wordpress.org/plugins/feed-them-social/&t=FeedThemSocial).
73
 
74
  Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](https://www.slickremix.com/)
75
 
78
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
79
 
80
  == Changelog ==
81
+ = Version 2.4.0 Tuesday, April 10th, 2018 =
82
+ * REMOVE: Facebook Group Feed and Specific Events Posts: These feed types have been disabled by Facebook at this time. We'll post changes as we receive them from Facebook. [Read More](https://www.slickremix.com/facebook-api-changes-on-april-4th-2018/).
83
+ * NOTE: Facebook Event Feed: Facebook now requires you use a page access token to view this feed type. The page access token must be for that facebook page for it to work. An APP ID will not work anymore.
84
+ * FIX: Instagram Feed: The convert Instagram name option has been removed now that Instgram as removed access for this option. Set your Access Token from the Instagram Options page to get your Instagram ID now. [Read More](https://www.slickremix.com/instagram-api-change-on-april-4th-2018/).
85
+ * POPUP FIX: Instagram Hashtag or Location Feed: Because of the resent privacy change by Instagram we replaced the missing profile photo with an Instagram Icon and the persons Actual Name replaced with Handle name.
86
+ * FIX: Instagram Feed: To create additional Instragram Feeds we have now added access_token= to the shortcode generator on the Settings page of our plugin.
87
+ * FIX: Settings Page: View Extensions and Demo link not working properly.
88
+ * FIX: Plugins Page: Settings link not working properly.
89
+ * IMPROVE: Plugin License Page is now only takes 1 click to save ALL license keys and activate them. (Backwards Compatible)
90
+ * IMPROVE: Convert old License key fields in database to single option array on license key. (Backwards Compatible)
91
+ * REMOVE: Screenshots for Feed Them Social are no longer in Plugin but moved to the assets folder on wordpress.org repository.
92
+
93
  = Version 2.3.8 - 2.3.9 Wednesday, March 15th, 2018 =
94
  * FIX: Facebook Feed: Extra Images not appearing. We will work on the image slideshow post types in the next update.
95
  * FIX: Facebook Feed: https:// missing on some outgoing facebook links.
screenshot-1.jpg DELETED
Binary file
screenshot-10.jpg DELETED
Binary file
screenshot-11.jpg DELETED
Binary file
screenshot-12.jpg DELETED
Binary file
screenshot-13.jpg DELETED
Binary file
screenshot-14.jpg DELETED
Binary file
screenshot-15.jpg DELETED
Binary file
screenshot-16.jpg DELETED
Binary file
screenshot-17.jpg DELETED
Binary file
screenshot-18.jpg DELETED
Binary file
screenshot-19.jpg DELETED
Binary file
screenshot-2.jpg DELETED
Binary file
screenshot-3.jpg DELETED
Binary file
screenshot-4.jpg DELETED
Binary file
screenshot-5.jpg DELETED
Binary file
screenshot-6.jpg DELETED
Binary file
screenshot-7.jpg DELETED
Binary file
screenshot-8.jpg DELETED
Binary file
screenshot-9.jpg DELETED
Binary file
updater/updater-check-class.php ADDED
@@ -0,0 +1,460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace feedthemsocial;
4
+
5
+ // Exit if accessed directly
6
+ if (!defined('ABSPATH')) exit;
7
+
8
+ /**
9
+ * Allows plugins to use their own update API.
10
+ *
11
+ * @author Pippin Williamson
12
+ * @version 1.6.5
13
+ */
14
+ class updater_check_class {
15
+
16
+ private $api_url = '';
17
+ private $api_data = array();
18
+ private $name = '';
19
+ private $slug = '';
20
+ private $version = '';
21
+ private $wp_override = false;
22
+ private $plugin_identifier = '';
23
+
24
+ /**
25
+ * Class constructor.
26
+ *
27
+ * @uses plugin_basename()
28
+ * @uses hook()
29
+ *
30
+ * @param string $_api_url The URL pointing to the custom API endpoint.
31
+ * @param string $_plugin_file Path to the plugin file.
32
+ * @param array $_api_data Optional data to send with API calls.
33
+ */
34
+ public function __construct($_api_url, $_plugin_file, $_api_data = null, $plugin_identifier, $item_name) {
35
+
36
+ global $edd_plugin_data;
37
+
38
+ $this->api_url = trailingslashit($_api_url);
39
+ $this->api_data = $_api_data;
40
+ $this->name = plugin_basename($this->get_plugin_file_name($_plugin_file));
41
+ $this->slug = basename($this->get_plugin_file_name($_plugin_file), '.php');
42
+ $this->version = $_api_data['version'];
43
+ $this->wp_override = isset($_api_data['wp_override']) ? (bool)$_api_data['wp_override'] : false;
44
+ $this->plugin_identifier = $plugin_identifier;
45
+ $this->plugin_name = $item_name;
46
+
47
+ $edd_plugin_data[$this->slug] = $this->api_data;
48
+
49
+ if (empty($_api_data['license']) && $_api_data['status'] !== 'valid') {
50
+ add_action('admin_notices', array($this, 'plugin_key_empty_admin_notice'));
51
+ } elseif ((!empty($_api_data['license']) && $_api_data['status'] !== 'valid')) {
52
+ add_action('admin_notices', array($this, 'plugin_key_not_valid_admin_notice'));
53
+ }
54
+
55
+
56
+ // Set up hooks.
57
+ $this->init();
58
+ // display custom admin notice
59
+ }
60
+
61
+ /**
62
+ * License Key field Empty on Plugin License Page
63
+ *
64
+ * @since 1.5.6
65
+ */
66
+ function plugin_key_empty_admin_notice() {
67
+ ?>
68
+
69
+ <div class="error notice">
70
+ <p><?php _e($this->plugin_name . ' needs a valid License Key! <a href="admin.php?page=fts-license-page">Click here to add one</a> or you won\'t recieve updates. - <a href="http://www.slickremix.com/my-account/" target="_blank">You can get License Key Here.</a>', 'feed-them-social'); ?></p>
71
+ </div>
72
+
73
+ <?php
74
+ }
75
+
76
+ /**
77
+ * License Key Not Valid or Expired
78
+ *
79
+ * @since 1.5.6
80
+ */
81
+ function plugin_key_not_valid_admin_notice() {
82
+ ?>
83
+
84
+ <div class="error notice">
85
+ <p><?php _e($this->plugin_name . ' - Your License Key is not active, expired, or is invalid. <a href="admin.php?page=fts-license-page">Click here to add one</a> or you won\'t recieve updates. - <a href="http://www.slickremix.com/my-account/" target="_blank">You can get License Key Here.</a>', 'feed-them-social'); ?></p>
86
+ </div>
87
+
88
+ <?php
89
+ }
90
+
91
+ /**
92
+ * Use Plugin Name that this file exists in.
93
+ *
94
+ * @Added by SlickRemix
95
+ * @since version 1.2
96
+ */
97
+ function get_plugin_file_name($_plugin_file) {
98
+
99
+ $plugs = plugin_basename($_plugin_file);
100
+ $plugin_folder_name = explode('/', $plugs);
101
+
102
+
103
+ require_once(ABSPATH . '/wp-admin/includes/plugin.php');
104
+ $plugins = get_plugins();
105
+ foreach ($plugins as $plugin_file => $plugin_info) {
106
+ if (strpos($plugin_file, $plugin_folder_name[0]) !== false) {
107
+ $plug_name = $plugin_file;
108
+ }
109
+ }
110
+ return $plug_name;
111
+ }
112
+
113
+ /**
114
+ * Set up WordPress filters to hook into WP's update process.
115
+ *
116
+ * @uses add_filter()
117
+ *
118
+ * @return void
119
+ */
120
+ public function init() {
121
+
122
+ add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10);
123
+ add_filter('plugins_api', array($this, 'plugins_api_filter'), 10, 3);
124
+ remove_action('after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10, 2);
125
+ add_action('after_plugin_row_' . $this->name, array($this, 'show_update_notification'), 10, 2);
126
+ add_action('admin_init', array($this, 'show_changelog'));
127
+ }
128
+
129
+ /**
130
+ * Check for Updates at the defined API endpoint and modify the update array.
131
+ *
132
+ * This function dives into the update API just when WordPress creates its update array,
133
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
134
+ * It is reassembled from parts of the native WordPress plugin update code.
135
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
136
+ *
137
+ * @uses api_request()
138
+ *
139
+ * @param array $_transient_data Update array build by WordPress.
140
+ * @return array Modified update array with custom plugin data.
141
+ */
142
+ public function check_update($_transient_data) {
143
+
144
+ global $pagenow;
145
+
146
+ if (!is_object($_transient_data)) {
147
+ $_transient_data = new \stdClass;
148
+ }
149
+
150
+ if ('plugins.php' == $pagenow && is_multisite()) {
151
+ return $_transient_data;
152
+ }
153
+
154
+ if (!empty($_transient_data->response) && !empty($_transient_data->response[$this->name]) && false === $this->wp_override) {
155
+ return $_transient_data;
156
+ }
157
+
158
+ $version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
159
+
160
+ if (false !== $version_info && is_object($version_info) && isset($version_info->new_version)) {
161
+
162
+ if (version_compare($this->version, $version_info->new_version, '<')) {
163
+
164
+ $_transient_data->response[$this->name] = $version_info;
165
+
166
+ }
167
+
168
+ $_transient_data->last_checked = time();
169
+ $_transient_data->checked[$this->name] = $this->version;
170
+
171
+ }
172
+
173
+ return $_transient_data;
174
+ }
175
+
176
+ /**
177
+ * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
178
+ *
179
+ * @param string $file
180
+ * @param array $plugin
181
+ */
182
+ public function show_update_notification($file, $plugin) {
183
+
184
+ if (!current_user_can('update_plugins')) {
185
+ return;
186
+ }
187
+
188
+ if (!is_multisite()) {
189
+ return;
190
+ }
191
+
192
+ if ($this->name != $file) {
193
+ return;
194
+ }
195
+
196
+ // Remove our filter on the site transient
197
+ remove_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10);
198
+
199
+ $update_cache = get_site_transient('update_plugins');
200
+
201
+ $update_cache = is_object($update_cache) ? $update_cache : new \stdClass();
202
+
203
+ if (empty($update_cache->response) || empty($update_cache->response[$this->name])) {
204
+
205
+ $cache_key = md5('edd_plugin_' . sanitize_key($this->name) . '_version_info');
206
+ $version_info = get_transient($cache_key);
207
+
208
+ if (false === $version_info) {
209
+
210
+ $version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
211
+
212
+ set_transient($cache_key, $version_info, 3600);
213
+ }
214
+
215
+ if (!is_object($version_info)) {
216
+ return;
217
+ }
218
+
219
+ if (version_compare($this->version, $version_info->new_version, '<')) {
220
+
221
+ $update_cache->response[$this->name] = $version_info;
222
+
223
+ }
224
+
225
+ $update_cache->last_checked = time();
226
+ $update_cache->checked[$this->name] = $this->version;
227
+
228
+ set_site_transient('update_plugins', $update_cache);
229
+
230
+ } else {
231
+
232
+ $version_info = $update_cache->response[$this->name];
233
+
234
+ }
235
+
236
+ // Restore our filter
237
+ add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10);
238
+
239
+ if (!empty($update_cache->response[$this->name]) && version_compare($this->version, $version_info->new_version, '<')) {
240
+
241
+ // build a plugin list row, with update notification
242
+ $wp_list_table = _get_list_table('WP_Plugins_List_Table');
243
+ # <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
244
+ echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
245
+ echo '<td colspan="3" class="plugin-update colspanchange">';
246
+ echo '<div class="update-message notice inline notice-warning notice-alt">';
247
+
248
+ $changelog_link = self_admin_url('index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911');
249
+
250
+ if (empty($version_info->download_link)) {
251
+ printf(
252
+ __('There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'feed-them-social'),
253
+ esc_html($version_info->name),
254
+ '<a target="_blank" class="thickbox" href="' . esc_url($changelog_link) . '">',
255
+ esc_html($version_info->new_version),
256
+ '</a>'
257
+ );
258
+ } else {
259
+ printf(
260
+ __('There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'feed-them-social'),
261
+ esc_html($version_info->name),
262
+ '<a target="_blank" class="thickbox" href="' . esc_url($changelog_link) . '">',
263
+ esc_html($version_info->new_version),
264
+ '</a>',
265
+ '<a href="' . esc_url(wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=') . $this->name, 'upgrade-plugin_' . $this->name)) . '">',
266
+ '</a>'
267
+ );
268
+ }
269
+
270
+ do_action("in_plugin_update_message-{$file}", $plugin, $version_info);
271
+
272
+ echo '</div></td></tr>';
273
+ }
274
+ }
275
+
276
+ /**
277
+ * Updates information on the "View version x.x details" page with custom data.
278
+ *
279
+ * @uses api_request()
280
+ *
281
+ * @param mixed $_data
282
+ * @param string $_action
283
+ * @param object $_args
284
+ * @return object $_data
285
+ */
286
+ public function plugins_api_filter($_data, $_action = '', $_args = null) {
287
+
288
+ if ($_action != 'plugin_information') {
289
+
290
+ return $_data;
291
+
292
+ }
293
+
294
+ if (!isset($_args->slug) || ($_args->slug != $this->slug)) {
295
+
296
+ return $_data;
297
+
298
+ }
299
+
300
+ $to_send = array(
301
+ 'slug' => $this->slug,
302
+ 'is_ssl' => is_ssl(),
303
+ 'fields' => array(
304
+ 'banners' => false, // These will be supported soon hopefully
305
+ 'reviews' => false
306
+ )
307
+ );
308
+
309
+ $cache_key = 'edd_api_request_' . substr(md5(serialize($this->slug)), 0, 15);
310
+
311
+ //Get the transient where we store the api request for this plugin for 24 hours
312
+ $edd_api_request_transient = get_site_transient($cache_key);
313
+
314
+ //If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
315
+ if (empty($edd_api_request_transient)) {
316
+
317
+ $api_response = $this->api_request('plugin_information', $to_send);
318
+
319
+ //Expires in 1 day
320
+ set_site_transient($cache_key, $api_response, DAY_IN_SECONDS);
321
+
322
+ if (false !== $api_response) {
323
+ $_data = $api_response;
324
+ }
325
+
326
+ }
327
+
328
+ return $_data;
329
+ }
330
+
331
+ /**
332
+ * Disable SSL verification in order to prevent download update failures
333
+ *
334
+ * @param array $args
335
+ * @param string $url
336
+ * @return object $array
337
+ */
338
+ public function http_request_args($args, $url) {
339
+ // If it is an https request and we are performing a package download, disable ssl verification
340
+ if (strpos($url, 'https://') !== false && strpos($url, 'edd_action=package_download')) {
341
+ $args['sslverify'] = false;
342
+ }
343
+ return $args;
344
+ }
345
+
346
+ /**
347
+ * Calls the API and, if successful, returns the object delivered by the API.
348
+ *
349
+ * @uses get_bloginfo()
350
+ * @uses wp_remote_post()
351
+ * @uses is_wp_error()
352
+ *
353
+ * @param string $_action The requested action.
354
+ * @param array $_data Parameters for the API action.
355
+ * @return false|object
356
+ */
357
+ private function api_request($_action, $_data) {
358
+
359
+ global $wp_version;
360
+
361
+ $data = array_merge($this->api_data, $_data);
362
+
363
+ if ($data['slug'] != $this->slug) {
364
+ return;
365
+ }
366
+
367
+ if ($this->api_url == trailingslashit(home_url())) {
368
+ return false; // Don't allow a plugin to ping itself
369
+ }
370
+
371
+ $api_params = array(
372
+ 'edd_action' => 'get_version',
373
+ 'license' => !empty($data['license']) ? $data['license'] : '',
374
+ 'item_name' => isset($data['item_name']) ? $data['item_name'] : false,
375
+ 'item_id' => isset($data['item_id']) ? $data['item_id'] : false,
376
+ 'slug' => $data['slug'],
377
+ 'author' => $data['author'],
378
+ 'url' => home_url()
379
+ );
380
+
381
+ $request = wp_remote_post($this->api_url, array('timeout' => 15, 'sslverify' => false, 'body' => $api_params));
382
+
383
+ if (!is_wp_error($request)) {
384
+ $request = json_decode(wp_remote_retrieve_body($request));
385
+ }
386
+
387
+ if ($request && isset($request->sections)) {
388
+ $request->sections = maybe_unserialize($request->sections);
389
+ } else {
390
+ $request = false;
391
+ }
392
+
393
+ return $request;
394
+ }
395
+
396
+ /**
397
+ * Show Changelog
398
+ *
399
+ * @since 1.5.6
400
+ */
401
+ public function show_changelog() {
402
+
403
+ global $edd_plugin_data;
404
+
405
+ if (empty($_REQUEST['edd_sl_action']) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action']) {
406
+ return;
407
+ }
408
+
409
+ if (empty($_REQUEST['plugin'])) {
410
+ return;
411
+ }
412
+
413
+ if (empty($_REQUEST['slug'])) {
414
+ return;
415
+ }
416
+
417
+ if (!current_user_can('update_plugins')) {
418
+ wp_die(__('You do not have permission to install plugin updates', 'feed-them-social'), __('Error', 'feed-them-social'), array('response' => 403));
419
+ }
420
+
421
+ $data = $edd_plugin_data[$_REQUEST['slug']];
422
+ $cache_key = md5('edd_plugin_' . sanitize_key($_REQUEST['plugin']) . '_version_info');
423
+ $version_info = get_transient($cache_key);
424
+
425
+ if (false === $version_info) {
426
+
427
+ $api_params = array(
428
+ 'edd_action' => 'get_version',
429
+ 'item_name' => isset($data['item_name']) ? $data['item_name'] : false,
430
+ 'item_id' => isset($data['item_id']) ? $data['item_id'] : false,
431
+ 'slug' => $_REQUEST['slug'],
432
+ 'author' => $data['author'],
433
+ 'url' => home_url()
434
+ );
435
+
436
+ $request = wp_remote_post($this->api_url, array('timeout' => 15, 'sslverify' => false, 'body' => $api_params));
437
+
438
+ if (!is_wp_error($request)) {
439
+ $version_info = json_decode(wp_remote_retrieve_body($request));
440
+ }
441
+
442
+ if (!empty($version_info) && isset($version_info->sections)) {
443
+ $version_info->sections = maybe_unserialize($version_info->sections);
444
+ } else {
445
+ $version_info = false;
446
+ }
447
+
448
+ set_transient($cache_key, $version_info, 3600);
449
+
450
+ }
451
+
452
+ if (!empty($version_info) && isset($version_info->sections['changelog'])) {
453
+ echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
454
+ }
455
+
456
+ exit;
457
+ }
458
+ }
459
+
460
+ ?>
updater/updater-check-init.php ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace feedthemsocial;
4
+
5
+ // uncomment this line for testing
6
+ //set_site_transient( 'update_plugins', null );
7
+
8
+ // Exit if accessed directly
9
+ if (!defined('ABSPATH')) exit;
10
+
11
+ /**
12
+ * Allows plugins to use their own update API.
13
+ *
14
+ * @author Pippin Williamson
15
+ * @version 1.6.5
16
+ */
17
+ class updater_init {
18
+
19
+ //This info is for creating the updater license page and updater license options
20
+ public $updater_options_info = array();
21
+ //List of Premium Plugins
22
+ public $prem_plugins_list = array();
23
+
24
+ public function __construct() {
25
+ // this is the URL our updater / license checker pings. This should be the URL of the site with EDD installed
26
+ /*if (!defined('SLICKREMIX_STORE_URL')) {
27
+ define('SLICKREMIX_STORE_URL', 'http://www.slickremix.com/'); // you should use your own CONSTANT name, and be sure to replace it throughout this file.
28
+ }*/
29
+
30
+ // this is the URL our updater / license checker pings. This should be the URL of the site with EDD installed
31
+ //New Updater
32
+ //include(dirname(__FILE__) . '/namespaced_updater_overrides.php');
33
+
34
+ if (!function_exists('is_plugin_active')) {
35
+ require_once(ABSPATH . '/wp-admin/includes/plugin.php');
36
+ }
37
+
38
+ $this->updater_options_info = array(
39
+ //Plugins
40
+ 'author' => 'slickremix',
41
+ //Store URL is where the premium plugins are located.
42
+ 'store_url' => 'https://www.slickremix.com/',
43
+ //Menu Slug for the plugin the update license page will be added to.
44
+ 'main_menu_slug' => 'feed-them-settings-page',
45
+ //Slug to be used for license page
46
+ 'license_page_slug' => 'fts-license-page',
47
+ //Settings Section name for license page options
48
+ 'setting_section_name' => 'fts_license_options',
49
+ //Settings Option name (This will house an array of options but save it as one 'option' in WordPress database)
50
+ 'setting_option_name' => 'feed_them_social_license_keys',
51
+ );
52
+
53
+ //List of Plugins! Used for License check and Plugin License page.
54
+ $this->prem_plugins_list = array(
55
+ 'feed_them_social_premium' => array(
56
+ //Title MUST match title of product in EDD store on site plugin is being sold
57
+ 'title' => 'Feed Them Social Premium',
58
+ 'plugin_url' => 'feed-them-premium/feed-them-premium.php',
59
+ 'demo_url' => 'http://feedthemsocial.com/facebook-page-feed-demo/',
60
+ 'purchase_url' => 'https://www.slickremix.com/downloads/feed-them-social-premium-extension/',
61
+ ),
62
+ 'feed_them_social_combined_streams' => array(
63
+ 'title' => 'Feed Them Social Combined Streams',
64
+ 'plugin_url' => 'feed-them-social-combined-streams/feed-them-social-combined-streams.php',
65
+ 'demo_url' => 'http://feedthemsocial.com/feed-them-social-combined-streams/',
66
+ 'purchase_url' => 'https://www.slickremix.com/downloads/feed-them-social-combined-streams/',
67
+ ),
68
+ 'feed_them_social_facebook_reviews' => array(
69
+ 'title' => 'Feed Them Social Facebook Reviews',
70
+ 'plugin_url' => 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php',
71
+ 'demo_url' => 'http://feedthemsocial.com/facebook-page-reviews-demo/',
72
+ 'purchase_url' => 'https://www.slickremix.com/downloads/feed-them-social-facebook-reviews/',
73
+ ),
74
+ 'feed_them_carousel_premium' => array(
75
+ 'title' => 'Feed Them Carousel Premium',
76
+ 'plugin_url' => 'feed-them-carousel-premium/feed-them-carousel-premium.php',
77
+ 'demo_url' => 'http://feedthemsocial.com/facebook-carousels-or-sliders/',
78
+ 'purchase_url' => 'https://www.slickremix.com/downloads/feed-them-carousel-premium/',
79
+ ),
80
+ 'fts_bar' => array(
81
+ 'title' => 'Feed Them Social Bar',
82
+ 'plugin_url' => 'fts-bar/fts-bar.php',
83
+ 'demo_url' => 'http://feedthemsocial.com/fts-bar/',
84
+ 'purchase_url' => 'https://www.slickremix.com/downloads/fts-bar/',
85
+ ),
86
+ );
87
+
88
+ //Create License Page for main plugin.
89
+ new updater_license_page($this->updater_options_info, $this->prem_plugins_list);
90
+
91
+ add_action('plugins_loaded', array($this, 'remove_old_updater_actions'), 0);
92
+
93
+ //Run Update Check Class
94
+ add_action('plugins_loaded', array($this, 'plugin_updater_check_init'), 11, 1);
95
+
96
+ }
97
+
98
+ /**
99
+ * Update old License Keys Check
100
+ *
101
+ * Check if the old License Keys options need to be converted to new array method. (Backwards Compatibility)
102
+ *
103
+ * @param $settings_array
104
+ * @since 1.6.5
105
+ */
106
+ function update_old_license_keys_check($settings_array) {
107
+ $option_update_needed = false;
108
+
109
+ //If Setting array is not set then set to array
110
+ if (!$settings_array) {
111
+ $settings_array = array();
112
+ }
113
+
114
+ //Remove Old Updater Actions
115
+ foreach ($this->prem_plugins_list as $plugin_key => $prem_plugin) {
116
+ //Set Old Key (for EDD sample remove this code. This is only here because we messed up originally)
117
+ $old_plugin_key = ($plugin_key == 'feed_them_social_facebook_reviews') ? 'feed-them-social-facebook-reviews' : $plugin_key;
118
+
119
+ //Backwards Compatibility for Pre-1-click license page will get removed on first save in Sanitize function.
120
+ $old_license = get_option($old_plugin_key . '_license_key');
121
+ $old_status = get_option($old_plugin_key . '_license_status');
122
+
123
+ //Is old License Key set?
124
+ if ($old_license) {
125
+ //Set New Key
126
+ $settings_array[$plugin_key]['license_key'] = $old_license;
127
+
128
+ delete_option($old_plugin_key . '_license_key');
129
+ //set option update needed to true so we know we need to update settings array;
130
+ $option_update_needed = true;
131
+ }
132
+ //Is old Status set?
133
+ if ($old_status) {
134
+ $settings_array[$plugin_key]['license_status'] = $old_status;
135
+
136
+ delete_option($old_plugin_key . '_license_status');
137
+ //set option update needed to true so we know we need to update settings array;
138
+ $option_update_needed = true;
139
+ }
140
+ }
141
+
142
+ //Re-save Settings array with new options
143
+ if ($option_update_needed == true) {
144
+ update_option($this->updater_options_info['setting_option_name'], $settings_array);
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Remove Old Updater Actions
150
+ *
151
+ * Removes any actions previous set by old updaters
152
+ *
153
+ * @since 1.5.6
154
+ */
155
+ function remove_old_updater_actions() {
156
+ //Remove Old Updater Actions
157
+ foreach ($this->prem_plugins_list as $plugin_key => $prem_plugin) {
158
+ if (has_action('plugins_loaded', $plugin_key . '_plugin_updater')) {
159
+ remove_action('plugins_loaded', $plugin_key . '_plugin_updater', 10);
160
+ }
161
+ }
162
+
163
+ //License Key Array Option
164
+ $settings_array = get_option($this->updater_options_info['setting_option_name']);
165
+
166
+ //If Settings array isn't set see if old licence keys exist
167
+ if (!$settings_array) {
168
+ //Backwards Compatibility with old 'Sample Plugin' (only Use if Necessary)
169
+ $this->update_old_license_keys_check($settings_array);
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Premium Plugin Updater Check Initialize
175
+ *
176
+ * Licensing and update code
177
+ *
178
+ * @since 1.5.6
179
+ */
180
+ function plugin_updater_check_init() {
181
+
182
+ $installed_plugins = get_plugins();
183
+
184
+ /*echo '<pre style=" width: 500px; margin: 0 auto; text-align: left">';
185
+ print_r($this->updater_options_info['store_url']);
186
+ echo '</pre>';*/
187
+
188
+ foreach ($this->prem_plugins_list as $plugin_identifier => $plugin_info) {
189
+
190
+ if (isset($plugin_info['plugin_url']) && !empty($plugin_info['plugin_url']) && is_plugin_active($plugin_info['plugin_url'])) {
191
+
192
+ $settings_array = get_option($this->updater_options_info['setting_option_name']);
193
+
194
+ $license = isset($settings_array[$plugin_identifier]['license_key']) ? $settings_array[$plugin_identifier]['license_key'] : '';
195
+ $status = isset($settings_array[$plugin_identifier]['license_status']) ? $settings_array[$plugin_identifier]['license_status'] : '';
196
+
197
+ $plugin_path = plugin_dir_path(basename($plugin_info['plugin_url'], '.php'));
198
+
199
+ //Build updater Array
200
+ $plugin_details = array(
201
+ 'version' => $installed_plugins[$plugin_info['plugin_url']]['Version'], // Current version number
202
+ 'license' => trim($license), // License key (used get_option above to retrieve from DB)
203
+ 'status' => $status, // License key Status (used get_option above to retrieve from DB)
204
+ 'item_name' => $plugin_info['title'], // Name of this plugin
205
+ 'author' => $this->updater_options_info['author'] // Author of this plugin
206
+
207
+ );
208
+
209
+ // setup the updater
210
+ new updater_check_class($this->updater_options_info['store_url'], $plugin_info['plugin_url'], $plugin_details, $plugin_identifier, $plugin_info['title']);
211
+ }
212
+ }
213
+ }
214
+ }
215
+
216
+ ?>
updater/updater-license-page.php ADDED
@@ -0,0 +1,491 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace feedthemsocial;
4
+
5
+ // Exit if accessed directly
6
+ if (!defined('ABSPATH')) exit;
7
+
8
+ /**
9
+ * Class Updater License Page
10
+ *
11
+ * @package feedthemsocial
12
+ * @since 2.1.6
13
+ */
14
+ class updater_license_page {
15
+
16
+ // static variables
17
+ private static $instance = false;
18
+
19
+ /**
20
+ * Construct
21
+ *
22
+ * FTS_settings_page constructor.
23
+ *
24
+ * @since 2.1.6
25
+ */
26
+ function __construct($updater_options_info, $prem_plugins_list) {
27
+
28
+ //Set License Page Variables
29
+ $this->store_url = $updater_options_info['store_url'];
30
+ $this->main_menu_slug = $updater_options_info['main_menu_slug'];
31
+ $this->license_page_slug = $updater_options_info['license_page_slug'];
32
+ $this->setting_section_name = $updater_options_info['setting_section_name'];
33
+ $this->setting_option_name = $updater_options_info['setting_option_name'];
34
+
35
+ $this->prem_plugins = $prem_plugins_list;
36
+
37
+ //Add the License Page
38
+ $this->add_license_page();
39
+ }
40
+
41
+ /**
42
+ * Add the License Page
43
+ *
44
+ * @since 2.1.6
45
+ */
46
+ function add_license_page() {
47
+ if (!function_exists('is_plugin_active'))
48
+ require_once(ABSPATH . '/wp-admin/includes/plugin.php');
49
+
50
+ $prem_active = false;
51
+ foreach ($this->prem_plugins as $plugin) {
52
+ if (is_plugin_active($plugin['plugin_url'])) {
53
+ $prem_active = true;
54
+ }
55
+ }
56
+
57
+ add_action('admin_menu', array($this, 'license_menu'));
58
+ add_action('admin_init', array($this, 'register_options'));
59
+ }
60
+
61
+ /**
62
+ * Register Plugin License Page Options (overrides options from prem extensions updater files
63
+ *
64
+ * @since 2.1.6
65
+ */
66
+ function register_options() {
67
+ //Create settings section
68
+ add_settings_section($this->setting_section_name, '', null, $this->license_page_slug);
69
+
70
+ //Register Option for settings array
71
+ register_setting($this->license_page_slug, $this->setting_option_name, array($this, 'fts_sanitize_license'));
72
+
73
+ //Add settings fields for each plugin/extension
74
+ foreach ($this->prem_plugins as $key => $plugin) {
75
+ //For plugins/extensions that are active
76
+ if (is_plugin_active($plugin['plugin_url'])) {
77
+ $args = array(
78
+ 'key' => $key,
79
+ 'plugin_name' => $plugin['title'],
80
+ );
81
+
82
+ add_settings_field($this->setting_option_name . '[' . $key . '][license_key]', '', array($this, 'add_option_setting'), $this->license_page_slug, $this->setting_section_name, $args);
83
+ } //Show Special Box for non actives plugins/extensions!
84
+ else {
85
+ //Set Variables
86
+ $args = array(
87
+ 'plugin_name' => $plugin['title'],
88
+ 'demo_url' => $plugin['demo_url'],
89
+ 'purchase_url' => $plugin['purchase_url'],
90
+ );
91
+ //show Premium needed box
92
+ add_settings_field($this->setting_option_name . '[' . $key . '][license_key]', '', array($this, 'display_premium_needed_license'), $this->license_page_slug, $this->setting_section_name, $args);
93
+ }
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Add Options to Plugin License page
99
+ *
100
+ * @param $args
101
+ * @since 2.1.6
102
+ */
103
+ function add_option_setting($args) {
104
+ $key = $args['key'];
105
+ $plugin_name = $args['plugin_name'];
106
+
107
+ //License Key Array Option
108
+ $settings_array = get_option($this->setting_option_name);
109
+
110
+ $license = isset($settings_array[$key]['license_key']) ? $settings_array[$key]['license_key'] : '';
111
+ $status = isset($settings_array[$key]['license_status']) ? $settings_array[$key]['license_status'] : '';
112
+ $license_error = isset($settings_array[$key]['license_error']) ? $settings_array[$key]['license_error'] : '';
113
+
114
+ ?>
115
+ <tr valign="top" class="fts-license-wrap">
116
+ <th scope="row" valign="top">
117
+ <?php _e($plugin_name); ?>
118
+ </th>
119
+ <td>
120
+ <input id="<?php echo $this->setting_option_name ?>[<?php echo $key ?>][license_key]" name="<?php echo $this->setting_option_name ?>[<?php echo $key ?>][license_key]" type="text" placeholder="<?php _e('Enter your license key'); ?>" class="regular-text" value="<?php esc_attr_e($license); ?>"/>
121
+ <label class="description" for="<?php echo $this->setting_option_name ?>[<?php echo $key ?>][license_key]"><?php if ($status !== false && $status == 'valid') { ?>
122
+
123
+ <?php wp_nonce_field('license_page_nonce', 'license_page_nonce'); ?>
124
+ <input type="submit" class="button-secondary" name="<?php echo $key ?>_license_deactivate" value="<?php _e('Deactivate License'); ?>"/>
125
+
126
+ <div class="edd-license-data"><p><?php _e('License Key Active.'); ?></p></div>
127
+
128
+ <?php
129
+ } else {
130
+ wp_nonce_field('license_page_nonce', 'license_page_nonce'); ?>
131
+ <div class="edd-license-data edd-license-msg-error">
132
+ <p><?php echo $license_error ?><?php $this->update_admin_notices();
133
+ _e('To receive updates notifications, please enter your valid license key.'); ?></p>
134
+ </div>
135
+ <?php } ?></label>
136
+
137
+ <?php
138
+ //Create Upgrade Button
139
+ if (isset($license) && !empty($license) && $status !== false && $status == 'valid') {
140
+ echo '<a class="edd-upgrade-license-btn button-secondary" target="_blank" href="https://www.slickremix.com/my-account/?&view=upgrades&license_key=' . $license . '">Upgrade License</a>';
141
+ }
142
+ ?>
143
+ </td>
144
+ </tr> <?php
145
+ }
146
+
147
+ /**
148
+ * Add Plugin License Menu
149
+ *
150
+ * @since 2.1.6
151
+ */
152
+ function license_menu() {
153
+ global $submenu;
154
+
155
+ add_submenu_page($this->main_menu_slug, __('Plugin License', 'feed-them-social'), __('Plugin License', 'feed-them-social'), 'manage_options', $this->license_page_slug, array($this, 'license_page'));
156
+ }
157
+
158
+ /**
159
+ * Add FREE Plugin License Page for displaying what is available to extend FTS
160
+ *
161
+ * @since 2.1.6
162
+ */
163
+ function license_page() {
164
+
165
+ ?>
166
+ <div class="wrap">
167
+ <h2><?php _e('Plugin License Options'); ?></h2>
168
+ <div class="license-note"> <?php _e("If you need more licenses or your key has expired, please go to the <a href='https://www.slickremix.com/my-account/' target='_blank'>MY ACCOUNT</a> page on our website to upgrade or renew your license.<br/>To get started follow the instructions below.", "feed-them-social") ?> </div>
169
+
170
+ <div class="fts-activation-msg">
171
+ <ol>
172
+ <li><?php _e('Install the zip file of the plugin you should have received after purchase on the <a href="plugin-install.php">plugins page</a> and leave the free version active too.', 'feed-them-social') ?></li>
173
+ <li><?php _e('Now Enter your License Key and Click the <strong>Save Changes button</strong>.', 'feed-them-social') ?></li>
174
+ </ol>
175
+ </div>
176
+ <form method="post" action="options.php" class="fts-license-master-form">
177
+ <?php settings_fields($this->license_page_slug); ?>
178
+ <table class="form-table">
179
+ <tbody>
180
+
181
+ <?php
182
+ $prem_active = false;
183
+ foreach ($this->prem_plugins as $plugin) {
184
+ if (is_plugin_active($plugin['plugin_url'])) {
185
+ $prem_active = true;
186
+ }
187
+ }
188
+ //No Premium plugins Active make Plugin License page.
189
+ if ($prem_active === true) {
190
+ do_settings_fields($this->license_page_slug, $this->setting_section_name);
191
+ } else {
192
+ //Each Premium Plugin wrap
193
+ foreach ($this->prem_plugins as $plugin) {
194
+ //Set Variables
195
+ $args = array(
196
+ 'plugin_name' => $plugin['title'],
197
+ 'demo_url' => $plugin['demo_url'],
198
+ 'purchase_url' => $plugin['purchase_url'],
199
+ );
200
+
201
+ //show Premium needed box
202
+ $this->display_premium_needed_license($args);
203
+ }
204
+ } ?>
205
+
206
+ </tbody>
207
+ </table>
208
+ <?php
209
+ if ($prem_active === true) {
210
+ submit_button();
211
+ }
212
+ ?>
213
+ </form>
214
+ <div style="margin-top:0px;">
215
+ <a href="https://www.slickremix.com/downloads/feed-them-gallery/" target="_blank"><img style="max-width: 100%;" src="<?php echo plugins_url('feed-them-social/admin/images/ft-gallery-promo.jpg'); ?>"/></a>
216
+ </div>
217
+ </div>
218
+ <?php
219
+ }
220
+
221
+ /**
222
+ * Display Premium Needed boxes for plugins not active/installed for FTS
223
+ *
224
+ * @param $args Passed by function or add_settings_field
225
+ * @since 2.1.6
226
+ */
227
+ function display_premium_needed_license($args) {
228
+ $this->plugin_title = $args['plugin_name'];
229
+ $this->demo_url = $args['demo_url'];
230
+ $this->purchase_url = $args['purchase_url'];
231
+ ?>
232
+
233
+ <tr valign="top" class="fts-license-wrap">
234
+ <th scope="row" valign="top"><?php echo $this->plugin_title ?></th>
235
+ <td>
236
+ <div class="fts-no-license-overlay">
237
+ <div class="fts-no-license-button-wrap"
238
+ ">
239
+ <a class="fts-no-license-button-purchase-btn" href="<?php echo $this->demo_url ?>" target="_blank">Demo</a>
240
+ <a class="fts-no-license-button-demo-btn" href="<?php echo $this->purchase_url ?>" target="_blank">Buy
241
+ Extension</a>
242
+ </div>
243
+ </div>
244
+ <input id="no_license_key" name="no_license_key" type="text" placeholder="Enter your license key" class="regular-text" value="">
245
+ <label class="description" for="no_license_key">
246
+ <div class="edd-license-data edd-license-msg-error"><p>To receive updates notifications, please
247
+ enter your valid license key.</p></div>
248
+
249
+ </label>
250
+ </td>
251
+ </tr>
252
+ <?php return;
253
+ }
254
+
255
+ /**
256
+ * Generates an Upgrade license button based on information from SlickRemix's license keys
257
+ *
258
+ * @param $license_key
259
+ * @since 2.1.6
260
+ */
261
+ function upgrade_license_btn($plugin_key, $license_key, $status) {
262
+ if (isset($license_key) && !empty($license_key) && $status !== false && $status == 'valid') {
263
+ //$api_params = array();
264
+ //$response = wp_remote_get('https://www.slickremix.com/wp-json/slick-license/v2/get-license-info?license_key=' . $license_key, array('timeout' => 60, 'sslverify' => false, 'body' => $api_params));
265
+
266
+ $response[$plugin_key] = 'https://www.slickremix.com/wp-json/slick-license/v2/get-license-info?license_key=' . $license_key;
267
+
268
+ $fts_functions = new feed_them_social_functions();
269
+
270
+ $response = $fts_functions->fts_get_feed_json($response);
271
+
272
+ $license_data = json_decode($response[$plugin_key]);
273
+
274
+ if (isset($license_data->payment_id) && !empty($license_data->payment_id) && isset($license_data->payment_id) && !empty($license_data->payment_id)) {
275
+ echo '<a class="edd-upgrade-license-btn button-secondary" target="_blank" href="https://www.slickremix.com/my-account/?&view=upgrades&license_key=' . $license_data->license_id . '">Upgrade License</a>';
276
+ }
277
+ return;
278
+ }
279
+ return;
280
+ }
281
+
282
+ /**
283
+ * Sanitize License Keys
284
+ *
285
+ * @param $new
286
+ * @return mixed
287
+ * @since 1.5.6
288
+ */
289
+ function fts_sanitize_license($new) {
290
+
291
+ $settings_array = get_option($this->setting_option_name);
292
+
293
+ if (!$settings_array) {
294
+ $settings_array = $new;
295
+ } else {
296
+ $settings_array = array_merge($settings_array, $new);
297
+ }
298
+
299
+ foreach ($this->prem_plugins as $key => $plugin) {
300
+ if (is_plugin_active($plugin['plugin_url'])) {
301
+
302
+ // listen for our activate button to be clicked
303
+ if (isset($_POST[$key . '_license_deactivate'])) {
304
+ $settings_array = $this->deactivate_license($key, $settings_array[$key]['license_key'], $settings_array);
305
+ } else {
306
+ //Clean Up old options if they exist
307
+ $old_license = get_option($key . '_license_key');
308
+ $old_status = get_option($key . '_license_status');
309
+
310
+ if (!empty($old_license)) {
311
+ delete_option($key . '_license_key');
312
+ }
313
+ if (!empty($old_status)) {
314
+ delete_option($key . '_license_status');
315
+ }
316
+ $settings_array = $this->activate_license($key, $new[$key]['license_key'], $settings_array);
317
+ }
318
+ }
319
+ }
320
+
321
+ return $settings_array;
322
+ }
323
+
324
+ /**
325
+ * Activate License Key
326
+ *
327
+ * @since 1.5.6
328
+ */
329
+ function activate_license($key, $license, $settings_array) {
330
+
331
+ $license = trim($license);
332
+
333
+ // data to send in our API request
334
+ $api_params = array(
335
+ 'edd_action' => 'activate_license',
336
+ 'license' => $license,
337
+ 'item_name' => urlencode($this->prem_plugins[$key]['title']), // the name of our product in EDD
338
+ 'url' => home_url(),
339
+ );
340
+
341
+ // Call the custom API.
342
+ $response = wp_remote_post($this->store_url, array('timeout' => 60, 'sslverify' => false, 'body' => $api_params));
343
+
344
+ // make sure the response came back okay
345
+ if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) {
346
+
347
+ if (is_wp_error($response)) {
348
+ $message = $response->get_error_message();
349
+ } else {
350
+ $message = __('An error occurred, please try again.');
351
+ }
352
+
353
+ } else {
354
+ $license_data = json_decode(wp_remote_retrieve_body($response));
355
+
356
+ if (false === $license_data->success) {
357
+
358
+ switch ($license_data->error) {
359
+
360
+ case 'expired' :
361
+
362
+ $message = sprintf(
363
+ __('Your license key expired on %s.'),
364
+ date_i18n(get_option('date_format'), strtotime($license_data->expires, time()))
365
+ );
366
+ break;
367
+
368
+ case 'revoked' :
369
+
370
+ $message = __('Your license key has been disabled.');
371
+ break;
372
+
373
+ case 'missing' :
374
+
375
+ $message = __('Invalid license.');
376
+ break;
377
+
378
+ case 'invalid' :
379
+ case 'site_inactive' :
380
+
381
+ $message = __('Your license is not active for this URL.');
382
+ break;
383
+
384
+ case 'item_name_mismatch' :
385
+
386
+ $message = sprintf(__('This appears to be an invalid license key for %s.'), $this->prem_plugins[$key]['title']);
387
+ break;
388
+
389
+ case 'no_activations_left':
390
+
391
+ $message = __('Your license key has reached its activation limit.');
392
+ break;
393
+
394
+ default :
395
+
396
+ $message = __('An error occurred, please try again.');
397
+ break;
398
+ }
399
+ }
400
+ }
401
+
402
+ //There is an error so set it in array
403
+ if (!empty($message)) {
404
+ unset($settings_array[$key]['license_status']);
405
+ $settings_array[$key]['license_error'] = $message;
406
+
407
+ return $settings_array;
408
+ }
409
+
410
+ //No errors. Set License Status in array
411
+ unset($settings_array[$key]['license_error']);
412
+ $settings_array[$key]['license_status'] = $license_data->license;
413
+
414
+ return $settings_array;
415
+ }
416
+
417
+ /***********************************************
418
+ * Illustrates how to deactivate a license key.
419
+ * This will decrease the site count
420
+ ***********************************************/
421
+ function deactivate_license($key, $license, $settings_array) {
422
+ // retrieve the license from the database
423
+ $license = trim($license);
424
+
425
+ // data to send in our API request
426
+ $api_params = array(
427
+ 'edd_action' => 'deactivate_license',
428
+ 'license' => $license,
429
+ 'item_name' => urlencode($this->prem_plugins[$key]['title']), // the name of our product in EDD
430
+ 'url' => home_url()
431
+ );
432
+
433
+ // Call the custom API.
434
+ $response = wp_remote_post($this->store_url, array('timeout' => 15, 'sslverify' => false, 'body' => $api_params));
435
+
436
+ // make sure the response came back okay
437
+ if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) {
438
+
439
+ if (is_wp_error($response)) {
440
+ $message = $response->get_error_message();
441
+ } else {
442
+ $message = __('An error occurred, please try again.');
443
+ }
444
+ }
445
+
446
+ // decode the license data
447
+ $license_data = json_decode(wp_remote_retrieve_body($response));
448
+
449
+ //There is an error so set it in array
450
+ if (!empty($message)) {
451
+ unset($settings_array[$key]['license_status']);
452
+ $settings_array[$key]['license_error'] = $message;
453
+
454
+ return $settings_array;
455
+ }
456
+
457
+ // $license_data->license will be either "deactivated" or "failed"
458
+ if ($license_data->license == 'deactivated') {
459
+ //No errors. unset plugin key from main options array
460
+ unset($settings_array[$key]);
461
+ }
462
+
463
+ return $settings_array;
464
+ }
465
+
466
+ /**
467
+ * This is a means of catching errors from the activation method above and displaying it to the customer
468
+ *
469
+ * @since 2.1.6
470
+ */
471
+ function update_admin_notices() {
472
+ if (isset($_GET['sl_activation']) && !empty($_GET['message'])) {
473
+
474
+ switch ($_GET['sl_activation']) {
475
+
476
+ case 'false':
477
+ $message = urldecode($_GET['message']);
478
+ echo $message;
479
+ break;
480
+
481
+ case 'true':
482
+ default:
483
+ // Developers can put a custom success message here for when activation is successful if they want.
484
+ break;
485
+ }
486
+ }
487
+ }
488
+
489
+ }//End CLASS
490
+
491
+ ?>