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

Version Description

Download this release

Release Info

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

Code changes from version 2.9.9 to 3.0.1

admin/class-fts-facebook-options-page.php CHANGED
@@ -231,7 +231,6 @@ class FTS_Facebook_Options_Page {
231
  // Echo our shortcode for the page token list with loadmore button
232
  // These functions are on feed-them-functions.php!
233
  echo do_shortcode( '[fts_fb_page_token]' );
234
-
235
  }
236
  ?>
237
  </div>
231
  // Echo our shortcode for the page token list with loadmore button
232
  // These functions are on feed-them-functions.php!
233
  echo do_shortcode( '[fts_fb_page_token]' );
 
234
  }
235
  ?>
236
  </div>
admin/class-fts-instagram-options-page.php CHANGED
@@ -115,22 +115,16 @@ class FTS_Instagram_Options_Page {
115
 
116
  // $insta_url = esc_url( 'https://api.instagram.com/v1/users/self/?access_token=' . $fts_instagram_access_token );
117
 
118
- $insta_url = esc_url_raw( 'https://graph.instagram.com/me?fields=id,username&access_token=' . $fts_instagram_access_token );
 
 
119
 
120
  // Get Data for Instagram!
121
  $response = wp_remote_fopen( $insta_url );
122
  // Error Check!
123
  $test_app_token_response = json_decode( $response );
124
 
125
- // echo '<pre>';
126
- // print_r( $test_app_token_response );
127
- // echo '</pre>';
128
-
129
-
130
- // echo '<pre>';
131
- // print_r($test_app_token_response);
132
- // echo '</pre>';
133
-
134
 
135
  echo sprintf(
136
  esc_html__( '%1$sClick the button below to get an access token. This gives us read-only access to get your Instagram posts.%2$s', 'feed-them-social' ),
@@ -154,7 +148,11 @@ class FTS_Instagram_Options_Page {
154
 
155
  <div class="feed-them-social-admin-input-wrap" style="margin-bottom:0px;
156
  <?php
157
- if ( 'no' === $debug ) {
 
 
 
 
158
  ?>
159
  display:none<?php } ?>">
160
  <div class="feed-them-social-admin-input-label fts-instagram-border-bottom-color-label">
@@ -190,7 +188,7 @@ class FTS_Instagram_Options_Page {
190
 
191
  <?php
192
  // Add yes to show the expiration time and js that runs it below!
193
- $debug = 'no';
194
  ?>
195
  <div class="feed-them-social-admin-input-wrap fts-success-class fts-exp-time-wrapper" style="margin-top:10px;
196
  <?php
@@ -215,8 +213,7 @@ class FTS_Instagram_Options_Page {
215
  // We get 60 days to refresh the token, if it's not refreshed before then it will expire.
216
  $expiration_time = '' !== get_option( 'fts_instagram_custom_api_token_expires_in' ) ? get_option( 'fts_instagram_custom_api_token_expires_in' ) : '';
217
 
218
-
219
- if ( time() < $expiration_time && 'yes' === $debug ) {
220
  ?>
221
  <script>
222
 
@@ -274,12 +271,12 @@ class FTS_Instagram_Options_Page {
274
 
275
  str_replace(".", ".", $fts_instagram_access_token, $count);
276
 
277
- if( ! empty( $fts_instagram_access_token ) && 0 !== $count ){
 
278
  echo sprintf(
279
- esc_html__( '%1$sThe %2$sLegacy API will be depreciated as of March 31st, 2020%3$s in favor of the new Instagram Graph API and the Instagram Basic Display API. Please click the the button above to reconnect your account or you can connect as a Business account below. You must also generate a new shortcode and replace your existing one.%4$s', 'feed-them-social' ),
280
  '<div class="fts-failed-api-token instagram-failed-message">',
281
- '<a href="' . esc_url( 'https://www.instagram.com/developer/' ) . '" target="_blank">',
282
- '</a>',
283
  '</div>'
284
  );
285
  }
@@ -290,14 +287,6 @@ class FTS_Instagram_Options_Page {
290
  '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' . $custom_instagram_link_hash ) . '">',
291
  '</a></div>'
292
  );
293
- } elseif ( isset( $test_app_token_response->error ) && ! empty( $fts_instagram_access_token ) ) {
294
- $text = isset( $test_app_token_response->error->message ) ? $test_app_token_response->error->message : $test_app_token_response->error->message;
295
- echo sprintf(
296
- esc_html__( '%1$sOh No something\'s wrong. %2$s Please try clicking the button again to get a new access token. If you need additional assistance please email us at support@slickremix.com %3$s', 'feed-them-social' ),
297
- '<div class="fts-failed-api-token instagram-failed-message">',
298
- esc_html( $text ),
299
- '</div>'
300
- );
301
  }
302
 
303
  $feed_type = isset( $_GET['feed_type'] ) ? $_GET['feed_type'] : '';
@@ -448,7 +437,7 @@ class FTS_Instagram_Options_Page {
448
  }
449
  }
450
  } else {
451
- if ( ! isset( $_GET['return_long_lived_token'] ) || isset( $_GET['reviews_token'] ) ) {
452
  echo sprintf(
453
  esc_html__( '%1$sTo get started, please click the button above to retrieve your Access Token.%2$s', 'feed-them-social' ),
454
  '<div class="fts-failed-api-token get-started-message">',
115
 
116
  // $insta_url = esc_url( 'https://api.instagram.com/v1/users/self/?access_token=' . $fts_instagram_access_token );
117
 
118
+ $check_basic_token_value = false !== $this->data_protection->decrypt( $fts_instagram_access_token ) ? $this->data_protection->decrypt( $fts_instagram_access_token ) : $fts_instagram_access_token;
119
+
120
+ $insta_url = esc_url_raw( 'https://graph.instagram.com/me?fields=id,username&access_token=' . $check_basic_token_value );
121
 
122
  // Get Data for Instagram!
123
  $response = wp_remote_fopen( $insta_url );
124
  // Error Check!
125
  $test_app_token_response = json_decode( $response );
126
 
127
+ //print_r($test_app_token_response);
 
 
 
 
 
 
 
 
128
 
129
  echo sprintf(
130
  esc_html__( '%1$sClick the button below to get an access token. This gives us read-only access to get your Instagram posts.%2$s', 'feed-them-social' ),
148
 
149
  <div class="feed-them-social-admin-input-wrap" style="margin-bottom:0px;
150
  <?php
151
+
152
+
153
+ $debug = 'no';
154
+
155
+ if ( 'yes' === $debug ) {
156
  ?>
157
  display:none<?php } ?>">
158
  <div class="feed-them-social-admin-input-label fts-instagram-border-bottom-color-label">
188
 
189
  <?php
190
  // Add yes to show the expiration time and js that runs it below!
191
+ $debug = 'yes';
192
  ?>
193
  <div class="feed-them-social-admin-input-wrap fts-success-class fts-exp-time-wrapper" style="margin-top:10px;
194
  <?php
213
  // We get 60 days to refresh the token, if it's not refreshed before then it will expire.
214
  $expiration_time = '' !== get_option( 'fts_instagram_custom_api_token_expires_in' ) ? get_option( 'fts_instagram_custom_api_token_expires_in' ) : '';
215
 
216
+ if ( time() < $expiration_time && isset( $debug ) && 'yes' === $debug ) {
 
217
  ?>
218
  <script>
219
 
271
 
272
  str_replace(".", ".", $fts_instagram_access_token, $count);
273
 
274
+ if ( 'Sorry, this content isn\'t available right now' === $response && ! empty( $fts_instagram_access_token ) || isset( $test_app_token_response->error ) && ! empty( $fts_instagram_access_token ) ) {
275
+ $text = 'Sorry, this content isn\'t available right now' === $response ? 'Sorry, this content isn\'t available right now' : $test_app_token_response->error->message;
276
  echo sprintf(
277
+ esc_html__( '%1$sOh No something\'s wrong. %2$s Please try clicking the button again to get a new access token. If you need additional assistance please email us at support@slickremix.com %3$s', 'feed-them-social' ),
278
  '<div class="fts-failed-api-token instagram-failed-message">',
279
+ esc_html( $text ),
 
280
  '</div>'
281
  );
282
  }
287
  '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' . $custom_instagram_link_hash ) . '">',
288
  '</a></div>'
289
  );
 
 
 
 
 
 
 
 
290
  }
291
 
292
  $feed_type = isset( $_GET['feed_type'] ) ? $_GET['feed_type'] : '';
437
  }
438
  }
439
  } else {
440
+ if ( !isset( $_GET['return_long_lived_token'] ) || '' === $_GET['return_long_lived_token'] || isset( $_GET['reviews_token'] ) ) {
441
  echo sprintf(
442
  esc_html__( '%1$sTo get started, please click the button above to retrieve your Access Token.%2$s', 'feed-them-social' ),
443
  '<div class="fts-failed-api-token get-started-message">',
admin/class-fts-youtube-options-page.php CHANGED
@@ -131,7 +131,7 @@ class FTS_Youtube_Options_Page {
131
  </div>
132
  <?php
133
  // Add yes to show the expiration time and js that runs it below!
134
- $debug = 'no';
135
  ?>
136
  <div class="hide-button-tokens-options" style="<?php echo esc_attr( $extra_keys_no ); ?>;">
137
  <div class="feed-them-social-admin-input-wrap" style="<?php
131
  </div>
132
  <?php
133
  // Add yes to show the expiration time and js that runs it below!
134
+ $debug = 'yes';
135
  ?>
136
  <div class="hide-button-tokens-options" style="<?php echo esc_attr( $extra_keys_no ); ?>;">
137
  <div class="feed-them-social-admin-input-wrap" style="<?php
admin/css/settings-page.css CHANGED
@@ -1 +1 @@
1
- .clear,.fts-clear{clear:both}.display{display:block!important}.facebook-message-generator,.final-instagram-user-id-textarea,.final-shortcode-textarea,.fts-facebook_group-shortcode-form .twitter_name,.fts-fb-event-option-wrap .twitter_name,.shortcode-generator-form,instagram-shortcode-form{display:none}.feed-them_page_fts-facebook-feed-styles-submenu-page .use-of-plugin{font-size:13px;font-weight:400;line-height:20px;max-width:740px;border-bottom:1px solid #ccc}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.feed-them_page_fts-facebook-feed-styles-submenu-page .use-of-plugin,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.feed-them_page_fts-instagram-feed-styles-submenu-page .use-of-plugin,.feed-them_page_fts-pinterest-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-pinterest-feed-styles-submenu-page .use-of-plugin,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.feed-them_page_fts-twitter-feed-styles-submenu-page .use-of-plugin,.feed-them_page_fts-youtube-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-youtube-feed-styles-submenu-page .use-of-plugin{color:#333}.instagram-id-option-wrap{margin-top:25px}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-wrap h2{margin-top:45px}.fts-super-instagram-options-wrap{padding-top:0}.fts-empty-error input{background-color:#fdfdd3!important}.toplevel_page_feed-them-settings-page h1{font-size:32px}.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.fts-youtube-feed-styles-submenu-page .feed-them-social-admin-wrap h2{margin-top:45px;color:#333}.feed-them-social-admin-wrap h1{color:#fff;margin:0 0 5px;line-height:30px;font-weight:700}.feed-them-social-admin-wrap h4{font-size:12px;font-weight:400;color:#000;margin:1px 0 8px}.feed-them-social-admin-wrap input[type=button],.feed-them-social-admin-wrap input[type=submit]{-webkit-appearance:none}.feed-them-social-admin-wrap input[type=text]{line-height:19px;max-width:100%;font-weight:400}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-wrap,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-wrap,.feed-them_page_fts-pinterest-feed-styles-submenu-page .feed-them-social-admin-wrap,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-wrap,.feed-them_page_fts-youtube-feed-styles-submenu-page .feed-them-social-admin-wrap{max-width:100%;width:100%;min-height:auto;background:0 0;padding:0;-webkit-box-shadow:none;box-shadow:none;border-radius:1px;position:relative;margin:20px 20px 0 0;-webkit-text-size-adjust:none}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-input-wrap,.feed-them_page_fts-pinterest-feed-styles-submenu-page .feed-them-social-admin-input-wrap,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-input-wrap,.feed-them_page_fts-youtube-feed-styles-submenu-page .feed-them-social-admin-input-wrap{background:0 0}.feed-them-social-admin-wrap{max-width:806px;min-height:379px;padding:19px;margin:20px 10px 0 0;background-size:cover;-webkit-text-size-adjust:none;overflow:hidden;border-radius:2px}.feed-them_page_fts-youtube-feed-styles-submenu-page h2{color:#333!important;margin-top:45px!important}.feed-them-social-admin-form .feed-them-social-admin-wrap h2{color:#000;font-size:20px;font-weight:400;line-height:23px;margin:15px 0}.feed-them-social-admin-form{padding:5px 0 0;height:auto}.fts-facebook_group-shortcode-form:hover a{background-position:top right!important;background-size:34px!important;height:34px!important;width:34px!important}.feed-them-social-admin-input-wrap{padding:5px 0 10px;margin-bottom:10px;border-radius:2px;-webkit-border-radius:2px}.pinterest-gen-selection{margin-bottom:25px}.final-shortcode-textarea .feed-them-social-admin-input-label{color:#0361b8;width:auto;font-size:14px}.instagram-shortcode-form .final-shortcode-textarea .feed-them-social-admin-input-label{color:#0361b8}.final-shortcode-textarea{margin-top:25px}.final-shortcode-textarea input{width:100%;margin-top:2px}.feed-them-social-admin-input-label{float:left;width:230px;margin-right:10px;font-size:13px;padding-top:6px;font-weight:700;padding-left: 10px;}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-input-label,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-input-label,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-input-label{float:left;width:230px;margin-right:10px;font-size:13px;text-transform:none;padding-top:6px;padding-left: 10px;}.feed-them-social-admin-input-label a{text-decoration:underline!important;cursor:pointer}.feed_them_social_id-answer a,.im-done{cursor:pointer!important}.feed-them-social-admin-input-example{float:left;font-weight:700;margin-left:10px;padding-top:4px}.feed-them-social-admin-input{float:left;width:305px;max-width:100%;font-weight:400}.feed-them-social-admin-input-default{float:left;width:290px;padding:4px 7px;border:1px solid #dfdfdf;background-color:#fff;font-size:12px}.fts-color-settings-admin-form .feed-them-social-admin-submit-btn{float:left;margin:0;padding:0 20px;height:37px;line-height:35px}.feed-them-social-admin-submit-btn{padding:10px 15px;border-radius:1px;background-color:#31ac45!important;color:#fff!important;font-weight:400;cursor:pointer!important;transition:all .3s ease-in-out;border:none;letter-spacing:1px;outline:0;font-size:12px}.feed-them-social-admin-submit-btn,.feed-them-social-admin-submit-btn:hover{-webkit-transition:background 2s;-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out}.feed-them-social-admin-submit-btn:hover{background-color:#2bbe43!important;color:#fff!important;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;outline:0}.toplevel_page_feed-them-settings-page .feed-them-social-admin-slick-logo{right:5px;-webkit-border-radius:3px;border-radius:3px}.feed_them_social_id-answer{padding:15px 0;display:none;font-weight:700}.feed_them_social_id-answer div{padding-bottom:10px}.im-done{padding:10px;background-color:#cd1723!important;border:none!important;color:#fff!important;font-weight:700;text-shadow:1px 1px 3px #000;filter:dropshadow(color=#000000, offx=1, offy=1);-webkit-border-radius:3px;border-radius:3px}#shortcode-form-selector{margin-bottom:10px;height:40px;min-width:290px;line-height:40px}.feed-them-icon-wrap{position:absolute;right:27px;top:25px;width:234px;height:50px}.feed-them-social-admin-wrap,.fts-content,.fts-plugin-reviews{position:relative}.fts-facebook_group-shortcode-form:hover .feed-them-icon-wrap a.facebook-icon{background-position:top right!important;background-size:34px!important;height:34px!important;width:34px!important;display:none}.feed-them-icon-wrap a{opacity:1;float:right;margin-left:1px;margin-bottom:1px;display:block;height:38px;width:38px;cursor:default;outline:0;border:none;box-shadow:0 1px 1px #222;border-radius:0;transition:all .3s ease-in-out}.feed-them-icon-wrap a,.feed-them-icon-wrap a:hover{-webkit-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out}.feed-them-icon-wrap a:hover{opacity:.85;transition:all .3s ease-in-out}.feed-them-icon-wrap a.facebook-icon{background:url(../images/facebook-icon.png) no-repeat}.feed-them-icon-wrap a.twitter-icon{background:url(../images/twitter-icon.png) top right no-repeat}.feed-them-icon-wrap a.instagram-icon{background:url(../images/instagram-icon.png) top right no-repeat}.feed-them-icon-wrap .feed-them-icon-wrap a.youtube-icon{background:url(../images/youtube-icon.png) top right no-repeat}.feed-them-icon-wrap a.pinterest-icon{background:url(../images/pinterest-icon.png) top right no-repeat}a.icon-animate-small{background-position:top right!important;background-size:34px!important;height:34px!important;width:34px!important}.instructional-text{font-size:13px;line-height:19px;margin:0 0 15px;border-bottom:1px dotted #9c9c9c;color:#212121;padding:0 0 5px}.instructional-text a{color:#0073aa;text-decoration:none}.instructional-text a,.instructional-text a:hover{-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out}.instructional-text a:hover{transition:all .3s ease-in-out}.feed-them-custom-css{padding-top:25px;padding-left:0}.feed-them-clear-cache input{background-color:#f11e2e!important;margin-bottom:10px}.feed-them-clear-cache input:hover{background-color:#f15d2e!important}.feed-them-clear-cache-text{color:#f11e2e!important;font-weight:700;background-color:rgba(255,255,255,.88);padding:10px 16px;margin-top:10px;margin-bottom:10px;border-radius:2px;-webkit-border-radius:2px;opacity:.9}.fts-get-premium-version{margin-right:1em;margin-top:15px;display:block;max-width:210px;text-align:center;text-decoration:none!important}textarea#fts-color-options-main-wrapper-css-input{max-width:100%;min-height:350px;clear:both;background:#f9f9f9;font-family:Consolas,Monaco,monospace;font-size:12px;width:100%;height:300px;outline:0}.fts-custom-css-text{margin-bottom:5px}label.toggle-custom-textarea-show:hover{background:#999}label.toggle-custom-textarea-show{max-width:435px;display:block;height:37px;line-height:35px;float:left;text-align:center;padding:0 15px;background:#818181;border-radius:1px;font-size:12px;clear:both;letter-spacing:1px;margin:5px 5px 10px 0;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#fts-color-options-main-wrapper-css-input,.fts-custom-css-text,.toggle-custom-textarea-hide{display:none}.fts-admin-wrap p input[type=checkbox],.fts-wp-header-custom input[type=checkbox]{margin:-1px 7px 0 2px!important}.fts-color-settings-admin-form p,.fts-powered-by-settings-admin-form p{color:#000;font-size:12px;-webkit-text-size-adjust:none}.fts-powered-by-settings-admin-form p{margin-bottom:0}.feed-them-custom-logo-css{margin-top:25px}#discount-for-review{clear:both;margin-bottom:1px;text-align:center;font-weight:700;color:#000;background:rgba(255,255,255,.53);float:right;width:195px;line-height:40px;cursor:pointer}.discount-review-text{clear:both;color:#333;background:rgba(255,255,255,.9);width:165px;float:right;padding:20px 15px;text-align:center;display:none}#discount-for-review a{display:inline-block;width:auto;height:auto;margin:0;padding:0;border:none;box-shadow:none;float:none;cursor:pointer;text-decoration:none;font-size:12px;font-weight:700;color:#0073aa}.fts-color-settings-admin-form label,.fts-color-settings-admin-form span{color:#060606}.fts-color-settings-admin-form p.example{color:#fff;padding-bottom:35px!important}.fts-color-settings-admin-form fieldset label{color:#fff;line-height:30px}.fts-color-settings-admin-form fieldset a{color:#fff;text-decoration:none}@media (max-width:800px){.toplevel_page_feed-them-settings-page .feed-them-social-admin-wrap h1{text-shadow:#fff!important;height:32px!important;width:280px!important;background-size:280px!important}.feed-them-icon-wrap{position:relative;margin:-20px 0 70px;left:0!important;height:auto;clear:both;text-align:left}.feed-them-social-admin-slick-logo{display:none}#fts-date-and-time-format{width:100%}}.fts-failed-api-token,.fts-successful-api-token{clear:both;float:left;padding:7px 14px 7px 10px;border:1px solid rgba(255,255,255,.45);color:#000;margin:10px 20px 0 0;max-width:715px;width:100%}.fts-failed-api-token{background:rgba(245,207,206,.78)}.fts-successful-api-token{background:rgba(220,253,205,.78)}.feed-them_page_fts-facebook-feed-styles-submenu-page .fts-failed-api-token,.feed-them_page_fts-facebook-feed-styles-submenu-page .fts-successful-api-token,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them_page_fts-instagram-feed-styles-submenu-page .fts-successful-api-token,.feed-them_page_fts-instagram-feed-styles-submenu-page .fts-failed-api-token,instagram-failed-message{margin-top:0!important;padding:10px 15px;max-width:708px}.fts-special-working-wrap{padding: 8px 8px 15px 18px!important;max-width: 712px!important;}#fts_facebook_custom_api_token,#fts_facebook_custom_api_token_biz,#fts_facebook_instagram_custom_api_token{margin-bottom:20px!important}.fts-facebook-custom-api-token-label{display:block;margin:0 40px 4px 0}.fts-facebook-custom-api-token-label a{font-weight:700;color:#df1818}.twitter-api-wrap{margin:20px 0 0}.twitter-api-wrap .feed-them-social-admin-input-wrap{margin:0}.fts-facebook-custom-api-token-label,.fts-instagram-custom-api-token-label{max-width:700px;line-height:21px;font-size:13px}.fts-facebook-get-access-token,.fts-facebook-get-access-token:focus,.fts-instagram-get-access-token,.fts-instagram-get-access-token:focus,.fts-pinterest-get-access-token,.fts-pinterest-get-access-token:focus,.fts-twitter-get-access-token,.fts-twitter-get-access-token:focus,.fts-youtube-get-access-token,.fts-youtube-get-access-token:focus{border-radius:5px;box-shadow:0 1px 1px #999;display:block;clear:both;float:left;font-size:14px;margin-bottom:25px;margin-top:5px;text-decoration:none;font-weight:600}.fts-instagram-get-access-token,.fts-instagram-get-access-token:focus{padding:18px 16px 19px 188px;background:url(../images/instagram-logo-admin.png) 13px 12px no-repeat #fff;color:#252525}.fts-pinterest-get-access-token,.fts-pinterest-get-access-token:focus{padding:18px 16px 19px 188px;background:url(../images/pinterest-logo-admin.jpg) 13px 12px no-repeat #fff;color:#252525}.fts-facebook-get-access-token:hover,.fts-instagram-get-access-token:hover,.fts-pinterest-get-access-token:hover{color:#666}.fts-facebook-get-access-token,.fts-facebook-get-access-token:focus{padding:18px 16px 19px 182px;background:url(../images/facebook-logo-admin.jpg) 14px 12px no-repeat #fff;color:#252525}@font-face{margin:0 0 9px;font-size:19px}.fts-title-description-settings-page{padding:25px 0 15px;max-width:740px;border-top:1px solid #ccc}.fts-premium-options-message,.fts-premium-options-message2{font-size:13px;padding:20px 25px 25px;line-height:19px;background-color:#fff;margin:0}.fts-premium-options-message a:first-child,.fts-premium-options-message2 a:first-child{font-size:16px;display:inline-block;padding:0;margin:0 0 5px;text-decoration:none}.fts-plugin-reviews{max-width:789px;padding:25px 28px 31px;box-shadow:0 0 1px #d1d1d1;border-radius:1px;background:rgba(255,255,255,1);-webkit-text-size-adjust:none;font-size:13px;line-height:21px;margin-right:10px}.fts-plugin-reviews a{text-decoration:none}.fts-plugin-reviews-rate{margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid #eee}h1.plugin-author-note{margin:50px 0 15px!important;font-size:22px;color:#222;z-index:1;position:relative}.toplevel_page_feed-them-settings-page .error{margin:20px 20px 20px 0;max-width:818px}.feed-them_page_fts-facebook-feed-styles-submenu-page .error,.feed-them_page_fts-instagram-feed-styles-submenu-page .error,.feed-them_page_fts-pinterest-feed-styles-submenu-page .error,.feed-them_page_fts-system-info-submenu-page .error,.feed-them_page_fts-system-info-submenu-page .notice,.feed-them_page_fts-twitter-feed-styles-submenu-page .error,.feed-them_page_fts-youtube-feed-styles-submenu-page .error{margin:20px 20px 20px 0!important}.feed-them_page_fts-bar-settings-page .error{margin:20px 20px 20px 5px!important;max-width:1005px}.hashtag-option-small-text,.twitter-hashtag-etc-wrap{display:none}.twitter-hashtag-etc-wrap{margin:15px 0 35px}.fts-content{background-color:rgba(241,241,241,.65);padding:30px;z-index:1;display:nonee;border-radius:2px;box-shadow:0 2px 10px rgba(41,41,41,.51);min-height:315px}.shortcode-generator-form{border-radius:3px;margin-top:15px}.instructional-text a:hover{color:#ea1616;text-decoration:underline;opacity:.8}.final-shortcode-textarea h4{border-bottom:1px solid #fff;padding:0 0 10px;font-size:13px;margin-bottom:15px}.toplevel_page_feed-them-settings-page .fts-content h1{color:#fbfbfb;margin:0 0 12px;line-height:30px;text-shadow:1px 1px 1px rgba(51,51,51,.06);font-weight:600;background:url(../images/feed-them-social-logo.png) no-repeat;height:40px;width:377px;font-size:0}.fb-options-wrap .feed-them-social-admin-submit-btn{margin-top:5px}#fts-social-selector,.twitter-gen-selection{margin-bottom:25px}.fts-text-align-center{text-align:center}.toplevel_page_feed-them-settings-page .feed-them-social-admin-slick-logo{background:url(../images/footer-logo.png) center no-repeat;width:110px;height:20px;padding:0;margin:20px 0 -20px;display:inline-block;position:relative;bottom:0;opacity:1}.fb-image,.fts-backg{width:100%;height:100%;}.feed-them-social-admin-wrap h3{color:#000;font-size:20px;font-weight:400;line-height:23px;margin:0 0 5px}.feed-them-social-admin-wrap .feed-them-social-admin-form h2{color:#000;font-size:23px;font-weight:400;line-height:23px;margin:15px 0 20px;padding:0}.instagram-id-option-wrap .feed-them-social-admin-submit-btn,.toplevel_page_feed-them-settings-page .feed-them-social-admin-submit-btn{margin-top:0;margin-left:0!important}.toplevel_page_feed-them-settings-page .instagram-id-option-wrap .feed-them-social-admin-submit-btn{margin-top:5px!important;margin-left:0!important}.feed-them-clear-cache .use-of-plugin{margin:0}.feed-them-clear-cache h2,.feed-them-custom-css h2,.feed-them-custom-logo-css h2{margin-bottom:10px;margin-top:5px;font-size:17px;padding-top:20px;border-top:1px dotted rgba(177,177,177,.88);color:#060606}.feed-them-clear-cache h2{border:none;margin-top:17px;padding-top:0}.feed-them-custom-css p,.feed-them-custom-logo-css p{margin:0 0 5px}#fts-date-and-time-format{margin-bottom:10px}.feed-them-social-admin-submit-btn{margin-top:15px!important}#fts_admin_bar_menu{margin-bottom:0;margin-left:31px}.fts-backg{position:absolute;top:0;right:0;z-index:0;opacity:1;-webkit-animation:ftsettings 5s;animation:ftsettings 5s;background:rgba(255,255,255,.8)}@-webkit-keyframes ftsettings{from{opacity:0}to{opacity:1}}@keyframes ftsettings{from{opacity:0}to{opacity:1}}.fb-reviews,.reviews-options{display:none}.fts-required-token-message{padding:15px;background:#fcfcfc;margin:12px 0 20px;border-left:4px solid #fb3939}.custom_time_ago_wrap{padding-top:10px}.custom_time_ago_wrap h2{margin-bottom:20px}.custom_time_ago_wrap label{color:#000;display:inline-block;min-width:75px;margin:0 10px 12px;font-size:13px}.slideshow-wrap{margin-top:18px}.fb-page-list{margin:0;display:block;max-width:740px}.fb-page-list li{background:#fff;padding:8px 10px 10px;margin:0;border-left:15px solid #3b5999;border-bottom:1px solid #e9ebee;cursor:pointer}.fb-page-list li .feed-them-social-admin-submit-btn{display:none;margin-top:9px!important;position:absolute;right:15px;top:7px}.fb-page-list li:hover{background:rgba(255,255,255,.57)}.fb-image{margin:0 15px 0 0;float:left;line-height:50px;text-align:center!important;max-width:50px;min-width:50px;vertical-align:baseline;min-height:50px;max-height: 50px;}.fb-image img{display:inline-block;vertical-align:middle;border-radius:50px}.fb-name{margin:0;display:inline-block;line-height:15px;color:#4c4c4c;font-weight:500;padding-top:10px}.board-name,.combine-instagram-hashtag-option-text,.combine_instagram_hashtag,.combine_instagram_hashtag_type,.fb-video-play-btn-options-content,.fb-video-play-btn-options-wrap,.fb_album_photos_id,.fts-facebook-grid-options-wrap,.fts-facebook-load-more-options-wrap,.fts-facebook-load-more-options2-wrap,.fts-fb-id,.fts-instagram-load-more-options-wrap,.fts-super-facebook-options-wrap,.fts-youtube-load-more-options-wrap,.fts-youtube-load-more-options2-wrap,.instagram-hashtag-option-text,.instagram-location-option-text,.instagram_hashtag_type,.page-token,.pinterest-board-and-name-text,.slider_options_wrap,.slideshow-wrap,.youtube_align_comments_wrap,.youtube_channelID2,.youtube_name,.youtube_name2,.youtube_playlistID,.youtube_playlistID2,.youtube_singleVideoID{display:none}.fts-pages-info{background:#3b5999;max-width:710px;padding:10px 15px 12px;color:#fff;margin-top:1px;letter-spacing:.5px}.fts-fb-page-thumb{float:left;margin-right:10px;border-radius:50px}.fts-successful-api-token h3{margin-bottom:0;margin-top:4px;font-weight:700}.use-of-plugin{color:#000;font-size:13px;font-weight:400;line-height:20px;max-width:60%;padding-bottom:12px;margin-bottom:0}.fts-admin-button-no-work{margin:0 0 0 25px;line-height:41px}.twitter_hashtag_etc_name{padding-top:0}.page.inst-text-facebook-page{display:block}.slider_options_wrap.not-active-premium-fields,.slideshow-wrap .feed-them-social-admin-input-default{display:block!important}.fts-premium-options-message a.not-active-title:first-child{font-size:16px!important;display:block!important;padding:0!important;margin:0 0 5px!important;text-decoration:none!important}.combine-facebook-wrap,.combine-grid-options-wrap,.combine-instagram-wrap,.combine-pinterest-wrap,.combine-twitter-wrap,.combine-youtube-wrap,.combine_board_id,.combine_playlist_id,.combine_youtube_name,.display-comments-wrap,.facebook-reviews-wrap,.fts-premium-options-message,.fts-twitter-grid-options-wrap,.fts-twitter-load-more-options-wrap,.fts-twitter-load-more-options2-wrap,.inst-text-facebook-reviews,.instagram-profile-options-wrap,.like-box-wrap{display:none}.sectioned-options-title{margin-top:15px!important;margin-bottom:15px!important;border-bottom:1px solid #f1f1f1;padding:10px 10px 10px 30px;font-size:18px!important;color:#060606!important;background:#fff;margin-left:-30px!important;box-shadow:0 1px 1px rgba(153,153,153,.59)}.facebook-image-animation-option-wrap,.multiple_facebook .facebook-loadmore-wrap,.multiple_facebook .facebook-title-options-wrap,.multiple_facebook .like-box-wrap,.multiple_facebook h2{display:none!important}.fts-fb-load-more,.fts-fb-spinner{text-align:center}.fts-fb-spinner>div{width:10px;height:10px;background-color:#999;border-radius:100%;display:inline-block;-webkit-animation:fts-fb-bouncedelay 1.4s infinite ease-in-out;animation:fts-fb-bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.fts-hide-me,.popup-gallery-fb .fts-fb-caption{display:none}.fb-social-btn-below-description,.fb-social-btn-bottom,.fb-social-btn-top{width:100%!important;overflow:hidden}.fts-fb-spinner .bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}.fts-fb-spinner .bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes fts-fb-bouncedelay{0%,100%,80%{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes fts-fb-bouncedelay{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.fts-fluid-videoWrapper-html5 video{object-fit:inherit;margin-bottom:0!important}.fts-fb-album-view-link a{color:#fff}.fts-fb-album-view-link a:hover{color:#eee}.fts-fb-load-more{border-radius:1px;padding:0;line-height:37px!important;width:100%;min-height:37px!important;font-size:13px!important;background:#fff!important;cursor:pointer;color:#787a7b;-webkit-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out;max-width:740px!important;font-weight:700}.toggle-custom-textarea-show span,label.toggle-custom-textarea-show{color:#fffefe}.fts-logo-header{margin-bottom:20px!important}.fts-logo-subheader{margin-bottom:10px!important}.fts-color-settings-admin-form label{font-weight:700;min-width:100px}#fts_clear_cache_developer_mode{margin-left:28px}.toplevel_page_feed-them-settings-page .pane-active{display:block}.toplevel_page_feed-them-settings-page .fts-tabbed{display:block;float:left;color:#545454;font-weight:700;text-decoration:none;line-height:1.9;text-align:center;cursor:pointer;border-bottom:1px solid #ccc;padding:10px 38px!important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-width:115px;background:#fff;margin-right:1px!important;font-size:13px;width:auto!important}.toplevel_page_feed-them-settings-page label.tab-active{background:#0073aa!important;color:#fff!important}.toplevel_page_feed-them-settings-page .fts-tab-content{clear:both;padding-top:15px}.feed-them-social-admin-input-label small{font-weight:400}.not-active-title:hover h3{color:#028fd2}.not-active-title h3{color:#0073aa}@media (max-width:797px){.toplevel_page_feed-them-settings-page #fts-tabs{margin-top:140px!important}}@media (max-width:450px){#shortcode-form-selector{min-width:270px!important}}@media (max-width:500px){.toplevel_page_feed-them-settings-page #fts-tab-content1 .use-of-plugin{max-width:100%!important}}#fts-timezone{max-width:300px}.fts-instagram-username-picker-wrap li{clear:both;background:#e6e6e6;padding:10px;margin-bottom:1px;display:block;width:100%;line-height:16px;float:left}.combine-twitter-hashtag-etc-wrap,.facebook_hide_date,.facebook_hide_name,.facebook_hide_thumbnail,.facebook_show_media,.fts-success,.youtube_video_single_info_display{display:none}.fts-instagram-username-picker-wrap li.fts-insta-id-active,.fts-instagram-username-picker-wrap li:hover{background:#0073aa;color:#fff}.ft-instagram-username-picker{clear:both;margin:0 0 1px;height:65px}.fts-insta-profile-picture-div img{float:left;max-width:65px;margin-right:15px;border-radius:100px}.fts-insta-fullname-div{padding:5px 0 2px}.fts-insta-id-div{font-style:italic;padding:5px 0 0}.fts-instagram-username-picker-wrap{padding-right:20px;max-height:310px;overflow:auto;margin:0}.fts-instagram-username-picker-wrap li:first-child{margin-top:10px}.fts-instagram-username-picker-wrap li:last-child{margin-bottom:10px}.fts-empty-error input,input.fts-empty-error{background:#ffffd8!important}.fts-instagram-username-picker-wrap li{color:#222}.fts-highlight{background:#0073aa;border-radius:20px;color:#fff;padding:0 5px}.fts-youtube-get-access-token,.fts-youtube-get-access-token:focus{padding:18px 16px 19px 188px;background: url(../images/google-logo-admin.jpg) 13px 12px no-repeat #fff;color:#252525;}.fts-twitter-get-access-token,.fts-twitter-get-access-token:focus{padding:18px 16px 19px 188px;background:url(../images/twitter-logo-admin.jpg) 13px 12px no-repeat #fff;color:#252525}.fts-twitter-add-all-keys-click-option,.fts-youtube-add-all-keys-click-option{margin: -10px 0 15px 10px;text-align:left;clear:both}.twitter-extra-keys-text,.youtube-extra-keys-text{max-width:550px;margin-bottom:15px;padding-left: 10px;}.feed-them_page_fts-twitter-feed-styles-submenu-page .fts-successful-api-token{margin-top:0;margin-bottom:-10px}#fts-timer{padding:6px 0 0 1px;float:left}@font-face{font-family:FontAwesomeSlick;src:url(../../feeds/css/font/fontawesome-webfont.eot?v=3.2.1);src:url(../../feeds/css/font/fontawesome-webfont.eot?#iefix&v=3.2.1) format("embedded-opentype"),url(../../feeds/css/font/fontawesome-webfont.woff?v=3.2.1) format("woff"),url(../../feeds/css/font/fontawesome-webfont.ttf?v=3.2.1) format("truetype"),url(../../feeds/css/font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1) format("svg")}.fts-success:before{font-family:FontAwesomeSlick!important;content:"\f00c"!important;font-size:14px;position:relative;line-height:19px}.fts-success{margin:3px 6px 0;padding:2px 4px;color:#fff;background:#01a701;border-radius:20px;float:left;font-size:10px!important;width:auto;height:18px}#discount-for-review a:hover{color:#0073aa}.fb-sublist{border:none!important;overflow:auto;height:200px;background:#f7f7f7}.fb-sublist li{border:1px solid #f7f7f7!important;border-bottom:0;border-right:0}.fts-token-save{border-radius:100px}.fb-sublist .fb-name{letter-spacing:0!important;font-size:13px}.fts-fb-location-text-wrap{padding:8px;text-align:center;color:#f7f7f7;font-weight:700;background:#00a400;margin:10px 0 0}.fb-name small{display:block;line-height:0;letter-spacing:0;color:#969696}.fts-successful-api-token small{font-size:12px}.fb-page-list li{position:relative}.fts-successful-api-token h3 a{text-decoration:none!important;color:#262627;text-shadow:1px 1px 1px #fff;font-size:17px}.fts-successful-api-token h3 a:hover,.fts-successful-api-token img:hover{opacity:.8}.fb-page-list .fts-fb-load-more{color:#00a400}.feed-them-icon-wrap a.youtube-icon{background:url(../images/youtube-icon.png) top right no-repeat}.combine-instagram-wrap .fts-instagram-hashtag-location-options-message{margin-top:25px;margin-bottom:-25px}.fts-fb-token-wrap .dashicons-admin-links:before{font-size:20px;color:#3b5999}.fb-page-master-list .dashicons-admin-links:before{top:-3px;position:relative}.fts-successful-api-token .dashicons-admin-links:before{top:3px;position:relative}.fts-arrow-icon:before{content:'\f054';font-family:FontAwesomeSlick!important;color:#00a400;font-size:18px!important;position:relative;top:2px;padding:0 8px}.fts-fb-icon:before{content:'\f082';font-family:FontAwesomeSlick!important;color:#3a5899;font-size:20px!important;position:relative;top:2px;padding-right:5px}.fts-insta-icon:before{content:'\f16d';font-family:FontAwesomeSlick!important;color:#263232;font-size:22px!important;position:relative;top:3px;padding-right:5px}.fts-special-working-wrap .fts-arrow-icon:before{font-size:18px!important;top:1px}.fts-special-working-wrap .fts-fb-icon:before{top:1px}.fts-special-working-wrap .fts-insta-icon:before{top:2px}.instagram_hashtag{display:none}
1
+ .clear,.fts-clear{clear:both}.display{display:block!important}.facebook-message-generator,.final-instagram-user-id-textarea,.final-shortcode-textarea,.fts-facebook_group-shortcode-form .twitter_name,.fts-fb-event-option-wrap .twitter_name,.shortcode-generator-form,instagram-shortcode-form{display:none}.feed-them_page_fts-facebook-feed-styles-submenu-page .use-of-plugin{font-size:13px;font-weight:400;line-height:20px;max-width:740px;border-bottom:1px solid #ccc}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.feed-them_page_fts-facebook-feed-styles-submenu-page .use-of-plugin,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.feed-them_page_fts-instagram-feed-styles-submenu-page .use-of-plugin,.feed-them_page_fts-pinterest-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-pinterest-feed-styles-submenu-page .use-of-plugin,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.feed-them_page_fts-twitter-feed-styles-submenu-page .use-of-plugin,.feed-them_page_fts-youtube-feed-styles-submenu-page .feed-them-social-admin-wrap h1,.feed-them_page_fts-youtube-feed-styles-submenu-page .use-of-plugin{color:#333}.instagram-id-option-wrap{margin-top:25px}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-wrap h2{margin-top:45px}.fts-super-instagram-options-wrap{padding-top:0}.fts-empty-error input{background-color:#fdfdd3!important}.toplevel_page_feed-them-settings-page h1{font-size:32px}.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-wrap h2,.fts-youtube-feed-styles-submenu-page .feed-them-social-admin-wrap h2{margin-top:45px;color:#333}.feed-them-social-admin-wrap h1{color:#fff;margin:0 0 5px;line-height:30px;font-weight:700}.feed-them-social-admin-wrap h4{font-size:12px;font-weight:400;color:#000;margin:1px 0 8px}.feed-them-social-admin-wrap input[type=button],.feed-them-social-admin-wrap input[type=submit]{-webkit-appearance:none}.feed-them-social-admin-wrap input[type=text]{line-height:19px;max-width:100%;font-weight:400}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-wrap,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-wrap,.feed-them_page_fts-pinterest-feed-styles-submenu-page .feed-them-social-admin-wrap,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-wrap,.feed-them_page_fts-youtube-feed-styles-submenu-page .feed-them-social-admin-wrap{max-width:100%;width:100%;min-height:auto;background:0 0;padding:0;-webkit-box-shadow:none;box-shadow:none;border-radius:1px;position:relative;margin:20px 20px 0 0;-webkit-text-size-adjust:none}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-input-wrap,.feed-them_page_fts-pinterest-feed-styles-submenu-page .feed-them-social-admin-input-wrap,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-input-wrap,.feed-them_page_fts-youtube-feed-styles-submenu-page .feed-them-social-admin-input-wrap{background:0 0}.feed-them-social-admin-wrap{max-width:806px;min-height:379px;padding:19px;margin:20px 10px 0 0;background-size:cover;-webkit-text-size-adjust:none;overflow:hidden;border-radius:2px}.feed-them_page_fts-youtube-feed-styles-submenu-page h2{color:#333!important;margin-top:45px!important}.feed-them-social-admin-form .feed-them-social-admin-wrap h2{color:#000;font-size:20px;font-weight:400;line-height:23px;margin:15px 0}.feed-them-social-admin-form{padding:5px 0 0;height:auto}.fts-facebook_group-shortcode-form:hover a{background-position:top right!important;background-size:34px!important;height:34px!important;width:34px!important}.feed-them-social-admin-input-wrap{padding:5px 0 10px;margin-bottom:10px;border-radius:2px;-webkit-border-radius:2px}.pinterest-gen-selection{margin-bottom:25px}.final-shortcode-textarea .feed-them-social-admin-input-label{color:#0361b8;width:auto;font-size:14px}.instagram-shortcode-form .final-shortcode-textarea .feed-them-social-admin-input-label{color:#0361b8}.final-shortcode-textarea{margin-top:25px}.final-shortcode-textarea input{width:100%;margin-top:2px}.feed-them-social-admin-input-label{float:left;width:230px;margin-right:10px;font-size:13px;padding-top:6px;font-weight:700;padding-left: 10px;}.feed-them_page_fts-facebook-feed-styles-submenu-page .feed-them-social-admin-input-label,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them-social-admin-input-label,.feed-them_page_fts-twitter-feed-styles-submenu-page .feed-them-social-admin-input-label{float:left;width:230px;margin-right:10px;font-size:13px;text-transform:none;padding-top:6px;padding-left: 10px;}.feed-them-social-admin-input-label a{text-decoration:underline!important;cursor:pointer}.feed_them_social_id-answer a,.im-done{cursor:pointer!important}.feed-them-social-admin-input-example{float:left;font-weight:700;margin-left:10px;padding-top:4px}.feed-them-social-admin-input{float:left;width:305px;max-width:100%;font-weight:400}.feed-them-social-admin-input-default{float:left;width:290px;padding:4px 7px;border:1px solid #dfdfdf;background-color:#fff;font-size:12px}.fts-color-settings-admin-form .feed-them-social-admin-submit-btn{float:left;margin:0;padding:0 20px;height:37px;line-height:35px}.feed-them-social-admin-submit-btn{padding:10px 15px;border-radius:1px;background-color:#31ac45!important;color:#fff!important;font-weight:400;cursor:pointer!important;transition:all .3s ease-in-out;border:none;letter-spacing:1px;outline:0;font-size:12px}.feed-them-social-admin-submit-btn,.feed-them-social-admin-submit-btn:hover{-webkit-transition:background 2s;-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out}.feed-them-social-admin-submit-btn:hover{background-color:#2bbe43!important;color:#fff!important;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;outline:0}.toplevel_page_feed-them-settings-page .feed-them-social-admin-slick-logo{right:5px;-webkit-border-radius:3px;border-radius:3px}.feed_them_social_id-answer{padding:15px 0;display:none;font-weight:700}.feed_them_social_id-answer div{padding-bottom:10px}.im-done{padding:10px;background-color:#cd1723!important;border:none!important;color:#fff!important;font-weight:700;text-shadow:1px 1px 3px #000;filter:dropshadow(color=#000000, offx=1, offy=1);-webkit-border-radius:3px;border-radius:3px}#shortcode-form-selector{margin-bottom:10px;height:40px;min-width:290px;line-height:40px}.feed-them-icon-wrap{position:absolute;right:27px;top:25px;width:234px;height:50px}.feed-them-social-admin-wrap,.fts-content,.fts-plugin-reviews{position:relative}.fts-facebook_group-shortcode-form:hover .feed-them-icon-wrap a.facebook-icon{background-position:top right!important;background-size:34px!important;height:34px!important;width:34px!important;display:none}.feed-them-icon-wrap a{opacity:1;float:right;margin-left:1px;margin-bottom:1px;display:block;height:38px;width:38px;cursor:default;outline:0;border:none;box-shadow:0 1px 1px #222;border-radius:0;transition:all .3s ease-in-out}.feed-them-icon-wrap a,.feed-them-icon-wrap a:hover{-webkit-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out}.feed-them-icon-wrap a:hover{opacity:.85;transition:all .3s ease-in-out}.feed-them-icon-wrap a.facebook-icon{background:url(../images/facebook-icon.png) no-repeat}.feed-them-icon-wrap a.twitter-icon{background:url(../images/twitter-icon.png) top right no-repeat}.feed-them-icon-wrap a.instagram-icon{background:url(../images/instagram-icon.png) top right no-repeat}.feed-them-icon-wrap .feed-them-icon-wrap a.youtube-icon{background:url(../images/youtube-icon.png) top right no-repeat}.feed-them-icon-wrap a.pinterest-icon{background:url(../images/pinterest-icon.png) top right no-repeat}a.icon-animate-small{background-position:top right!important;background-size:34px!important;height:34px!important;width:34px!important}.instructional-text{font-size:13px;line-height:19px;margin:0 0 15px;border-bottom:1px dotted #9c9c9c;color:#212121;padding:0 0 5px}.instructional-text a{color:#0073aa;text-decoration:none}.instructional-text a,.instructional-text a:hover{-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out}.instructional-text a:hover{transition:all .3s ease-in-out}.feed-them-custom-css{padding-top:25px;padding-left:0}.feed-them-clear-cache input{background-color:#f11e2e!important;margin-bottom:10px}.feed-them-clear-cache input:hover{background-color:#f15d2e!important}.feed-them-clear-cache-text{color:#f11e2e!important;font-weight:700;background-color:rgba(255,255,255,.88);padding:10px 16px;margin-top:10px;margin-bottom:10px;border-radius:2px;-webkit-border-radius:2px;opacity:.9}.fts-get-premium-version{margin-right:1em;margin-top:15px;display:block;max-width:210px;text-align:center;text-decoration:none!important}textarea#fts-color-options-main-wrapper-css-input{max-width:100%;min-height:350px;clear:both;background:#f9f9f9;font-family:Consolas,Monaco,monospace;font-size:12px;width:100%;height:300px;outline:0}.fts-custom-css-text{margin-bottom:5px}label.toggle-custom-textarea-show:hover{background:#999}label.toggle-custom-textarea-show{max-width:435px;display:block;height:37px;line-height:35px;float:left;text-align:center;padding:0 15px;background:#818181;border-radius:1px;font-size:12px;clear:both;letter-spacing:1px;margin:5px 5px 10px 0;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#fts-color-options-main-wrapper-css-input,.fts-custom-css-text,.toggle-custom-textarea-hide{display:none}.fts-admin-wrap p input[type=checkbox],.fts-wp-header-custom input[type=checkbox]{margin:-1px 7px 0 2px!important}.fts-color-settings-admin-form p,.fts-powered-by-settings-admin-form p{color:#000;font-size:12px;-webkit-text-size-adjust:none}.fts-powered-by-settings-admin-form p{margin-bottom:0}.feed-them-custom-logo-css{margin-top:25px}#discount-for-review{clear:both;margin-bottom:1px;text-align:center;font-weight:700;color:#000;background:rgba(255,255,255,.53);float:right;width:195px;line-height:40px;cursor:pointer}.discount-review-text{clear:both;color:#333;background:rgba(255,255,255,.9);width:165px;float:right;padding:20px 15px;text-align:center;display:none}#discount-for-review a{display:inline-block;width:auto;height:auto;margin:0;padding:0;border:none;box-shadow:none;float:none;cursor:pointer;text-decoration:none;font-size:12px;font-weight:700;color:#0073aa}.fts-color-settings-admin-form label,.fts-color-settings-admin-form span{color:#060606}.fts-color-settings-admin-form p.example{color:#fff;padding-bottom:35px!important}.fts-color-settings-admin-form fieldset label{color:#fff;line-height:30px}.fts-color-settings-admin-form fieldset a{color:#fff;text-decoration:none}@media (max-width:800px){.toplevel_page_feed-them-settings-page .feed-them-social-admin-wrap h1{text-shadow:#fff!important;height:32px!important;width:280px!important;background-size:280px!important}.feed-them-icon-wrap{position:relative;margin:-20px 0 70px;left:0!important;height:auto;clear:both;text-align:left}.feed-them-social-admin-slick-logo{display:none}#fts-date-and-time-format{width:100%}}.fts-failed-api-token,.fts-successful-api-token{clear:both;float:left;padding:7px 14px 7px 10px;border:1px solid rgba(255,255,255,.45);color:#000;margin:10px 20px 0 0;max-width:715px;width:100%}.fts-failed-api-token{background:rgba(245,207,206,.78)}.fts-successful-api-token{background:rgba(220,253,205,.78)}.feed-them_page_fts-facebook-feed-styles-submenu-page .fts-failed-api-token,.feed-them_page_fts-facebook-feed-styles-submenu-page .fts-successful-api-token,.feed-them_page_fts-instagram-feed-styles-submenu-page .feed-them_page_fts-instagram-feed-styles-submenu-page .fts-successful-api-token,.feed-them_page_fts-instagram-feed-styles-submenu-page .fts-failed-api-token,instagram-failed-message{margin-top:0!important;padding:10px 15px;max-width:708px}.fts-special-working-wrap{padding: 8px 8px 15px 18px!important;max-width: 712px!important;}#fts_facebook_custom_api_token,#fts_facebook_custom_api_token_biz,#fts_facebook_instagram_custom_api_token{margin-bottom:20px!important}.fts-facebook-custom-api-token-label{display:block;margin:0 40px 4px 0}.fts-facebook-custom-api-token-label a{font-weight:700;color:#df1818}.twitter-api-wrap{margin:20px 0 0}.twitter-api-wrap .feed-them-social-admin-input-wrap{margin:0}.fts-facebook-custom-api-token-label,.fts-instagram-custom-api-token-label{max-width:700px;line-height:21px;font-size:13px}.fts-facebook-get-access-token,.fts-facebook-get-access-token:focus,.fts-instagram-get-access-token,.fts-instagram-get-access-token:focus,.fts-pinterest-get-access-token,.fts-pinterest-get-access-token:focus,.fts-twitter-get-access-token,.fts-twitter-get-access-token:focus,.fts-youtube-get-access-token,.fts-youtube-get-access-token:focus{border-radius:5px;box-shadow:0 1px 1px #999;display:block;clear:both;float:left;font-size:14px;margin-bottom:25px;margin-top:5px;text-decoration:none;font-weight:600}.fts-instagram-get-access-token,.fts-instagram-get-access-token:focus{padding:18px 16px 19px 188px;background:url(../images/instagram-logo-admin.png) 13px 12px no-repeat #fff;color:#252525}.fts-pinterest-get-access-token,.fts-pinterest-get-access-token:focus{padding:18px 16px 19px 188px;background:url(../images/pinterest-logo-admin.jpg) 13px 12px no-repeat #fff;color:#252525}.fts-facebook-get-access-token:hover,.fts-instagram-get-access-token:hover,.fts-pinterest-get-access-token:hover{color:#666}.fts-facebook-get-access-token,.fts-facebook-get-access-token:focus{padding:18px 16px 19px 182px;background:url(../images/facebook-logo-admin.jpg) 14px 12px no-repeat #fff;color:#252525}@font-face{margin:0 0 9px;font-size:19px}.fts-title-description-settings-page{padding:25px 0 15px;max-width:740px;border-top:1px solid #ccc}.fts-premium-options-message,.fts-premium-options-message2{font-size:13px;padding:20px 25px 25px;line-height:19px;background-color:#fff;margin:0}.fts-premium-options-message a:first-child,.fts-premium-options-message2 a:first-child{font-size:16px;display:inline-block;padding:0;margin:0 0 5px;text-decoration:none}.fts-plugin-reviews{max-width:789px;padding:25px 28px 31px;box-shadow:0 0 1px #d1d1d1;border-radius:1px;background:rgba(255,255,255,1);-webkit-text-size-adjust:none;font-size:13px;line-height:21px;margin-right:10px}.fts-plugin-reviews a{text-decoration:none}.fts-plugin-reviews-rate{margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid #eee}h1.plugin-author-note{margin:50px 0 15px!important;font-size:22px;color:#222;z-index:1;position:relative}.toplevel_page_feed-them-settings-page .error{margin:20px 20px 20px 0;max-width:818px}.feed-them_page_fts-facebook-feed-styles-submenu-page .error,.feed-them_page_fts-instagram-feed-styles-submenu-page .error,.feed-them_page_fts-pinterest-feed-styles-submenu-page .error,.feed-them_page_fts-system-info-submenu-page .error,.feed-them_page_fts-system-info-submenu-page .notice,.feed-them_page_fts-twitter-feed-styles-submenu-page .error,.feed-them_page_fts-youtube-feed-styles-submenu-page .error{margin:20px 20px 20px 0!important}.feed-them_page_fts-bar-settings-page .error{margin:20px 20px 20px 5px!important;max-width:1005px}.hashtag-option-small-text,.twitter-hashtag-etc-wrap{display:none}.twitter-hashtag-etc-wrap{margin:15px 0 35px}.fts-content{background-color:rgba(241,241,241,.65);padding:30px;z-index:1;display:nonee;border-radius:2px;box-shadow:0 2px 10px rgba(41,41,41,.51);min-height:315px}.shortcode-generator-form{border-radius:3px;margin-top:15px}.instructional-text a:hover{color:#ea1616;text-decoration:underline;opacity:.8}.final-shortcode-textarea h4{border-bottom:1px solid #fff;padding:0 0 10px;font-size:13px;margin-bottom:15px}.toplevel_page_feed-them-settings-page .fts-content h1{color:#fbfbfb;margin:0 0 12px;line-height:30px;text-shadow:1px 1px 1px rgba(51,51,51,.06);font-weight:600;background:url(../images/feed-them-social-logo.png) no-repeat;height:40px;width:377px;font-size:0}.fb-options-wrap .feed-them-social-admin-submit-btn{margin-top:5px}#fts-social-selector,.twitter-gen-selection{margin-bottom:25px}.fts-text-align-center{text-align:center}.toplevel_page_feed-them-settings-page .feed-them-social-admin-slick-logo{background:url(../images/footer-logo.png) center no-repeat;width:110px;height:20px;padding:0;margin:20px 0 -20px;display:inline-block;position:relative;bottom:0;opacity:1}.fb-image,.fts-backg{width:100%;height:100%;}.feed-them-social-admin-wrap h3{color:#000;font-size:20px;font-weight:400;line-height:23px;margin:0 0 5px}.feed-them-social-admin-wrap .feed-them-social-admin-form h2{color:#000;font-size:23px;font-weight:400;line-height:23px;margin:15px 0 20px;padding:0}.instagram-id-option-wrap .feed-them-social-admin-submit-btn,.toplevel_page_feed-them-settings-page .feed-them-social-admin-submit-btn{margin-top:0;margin-left:0!important}.toplevel_page_feed-them-settings-page .instagram-id-option-wrap .feed-them-social-admin-submit-btn{margin-top:5px!important;margin-left:0!important}.feed-them-clear-cache .use-of-plugin{margin:0}.feed-them-clear-cache h2,.feed-them-custom-css h2,.feed-them-custom-logo-css h2{margin-bottom:10px;margin-top:5px;font-size:17px;padding-top:20px;border-top:1px dotted rgba(177,177,177,.88);color:#060606}.feed-them-clear-cache h2{border:none;margin-top:17px;padding-top:0}.feed-them-custom-css p,.feed-them-custom-logo-css p{margin:0 0 5px}#fts-date-and-time-format{margin-bottom:10px}.feed-them-social-admin-submit-btn{margin-top:15px!important}#fts_admin_bar_menu{margin-bottom:0;margin-left:31px}.fts-backg{position:absolute;top:0;right:0;z-index:0;opacity:1;-webkit-animation:ftsettings 5s;animation:ftsettings 5s;background:rgba(255,255,255,.8)}@-webkit-keyframes ftsettings{from{opacity:0}to{opacity:1}}@keyframes ftsettings{from{opacity:0}to{opacity:1}}.fb-reviews,.reviews-options{display:none}.fts-required-token-message{padding:15px;background:#fcfcfc;margin:12px 0 20px;border-left:4px solid #fb3939}.custom_time_ago_wrap{padding-top:10px}.custom_time_ago_wrap h2{margin-bottom:20px}.custom_time_ago_wrap label{color:#000;display:inline-block;min-width:75px;margin:0 10px 12px;font-size:13px}.slideshow-wrap{margin-top:18px}.fb-page-list{margin:0;display:block;max-width:740px}.fb-page-list li{background:#fff;padding:8px 10px 10px;margin:0;border-left:15px solid #3b5999;border-bottom:1px solid #e9ebee;cursor:pointer}.fb-page-list li .feed-them-social-admin-submit-btn{display:none;margin-top:9px!important;position:absolute;right:15px;top:7px}.fb-page-list li:hover{background:rgba(255,255,255,.57)}.fb-image{margin:0 15px 0 0;float:left;line-height:50px;text-align:center!important;max-width:50px;min-width:50px;vertical-align:baseline;min-height:50px;max-height: 50px;}.fb-image img{display:inline-block;vertical-align:middle;border-radius:50px}.fb-name{margin:0;display:inline-block;line-height:15px;color:#4c4c4c;font-weight:500;padding-top:10px}.board-name,.combine-instagram-hashtag-option-text,.combine_instagram_hashtag,.combine_instagram_hashtag_type,.fb-video-play-btn-options-content,.fb-video-play-btn-options-wrap,.fb_album_photos_id,.fts-facebook-grid-options-wrap,.fts-facebook-load-more-options-wrap,.fts-facebook-load-more-options2-wrap,.fts-fb-id,.fts-instagram-load-more-options-wrap,.fts-super-facebook-options-wrap,.fts-youtube-load-more-options-wrap,.fts-youtube-load-more-options2-wrap,.instagram-hashtag-option-text,.instagram-location-option-text,.instagram_hashtag_type,.page-token,.pinterest-board-and-name-text,.slider_options_wrap,.slideshow-wrap,.youtube_align_comments_wrap,.youtube_channelID2,.youtube_name,.youtube_name2,.youtube_playlistID,.youtube_playlistID2,.youtube_singleVideoID{display:none}.fts-pages-info{background:#3b5999;max-width:710px;padding:10px 15px 12px;color:#fff;margin-top:1px;letter-spacing:.5px}.fts-fb-page-thumb{float:left;margin-right:10px;border-radius:50px}.fts-successful-api-token h3{margin-bottom:0;margin-top:4px;font-weight:700}.use-of-plugin{color:#000;font-size:13px;font-weight:400;line-height:20px;max-width:60%;padding-bottom:12px;margin-bottom:0}.fts-admin-button-no-work{margin:0 0 0 25px;line-height:41px}.twitter_hashtag_etc_name{padding-top:0}.page.inst-text-facebook-page{display:block}.slider_options_wrap.not-active-premium-fields,.slideshow-wrap .feed-them-social-admin-input-default{display:block!important}.fts-premium-options-message a.not-active-title:first-child{font-size:16px!important;display:block!important;padding:0!important;margin:0 0 5px!important;text-decoration:none!important}.combine-facebook-wrap,.combine-grid-options-wrap,.combine-instagram-wrap,.combine-pinterest-wrap,.combine-twitter-wrap,.combine-youtube-wrap,.combine_board_id,.combine_playlist_id,.combine_youtube_name,.display-comments-wrap,.facebook-reviews-wrap,.fts-premium-options-message,.fts-twitter-grid-options-wrap,.fts-twitter-load-more-options-wrap,.fts-twitter-load-more-options2-wrap,.inst-text-facebook-reviews,.instagram-profile-options-wrap,.like-box-wrap{display:none}.sectioned-options-title{margin-top:15px!important;margin-bottom:15px!important;border-bottom:1px solid #f1f1f1;padding:10px 10px 10px 30px;font-size:18px!important;color:#060606!important;background:#fff;margin-left:-30px!important;box-shadow:0 1px 1px rgba(153,153,153,.59)}.facebook-image-animation-option-wrap,.multiple_facebook .facebook-loadmore-wrap,.multiple_facebook .facebook-title-options-wrap,.multiple_facebook .like-box-wrap,.multiple_facebook h2{display:none!important}.fts-fb-load-more,.fts-fb-spinner{text-align:center}.fts-fb-spinner>div{width:10px;height:10px;background-color:#999;border-radius:100%;display:inline-block;-webkit-animation:fts-fb-bouncedelay 1.4s infinite ease-in-out;animation:fts-fb-bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.fts-hide-me,.popup-gallery-fb .fts-fb-caption{display:none}.fb-social-btn-below-description,.fb-social-btn-bottom,.fb-social-btn-top{width:100%!important;overflow:hidden}.fts-fb-spinner .bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}.fts-fb-spinner .bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes fts-fb-bouncedelay{0%,100%,80%{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes fts-fb-bouncedelay{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.fts-fluid-videoWrapper-html5 video{object-fit:inherit;margin-bottom:0!important}.fts-fb-album-view-link a{color:#fff}.fts-fb-album-view-link a:hover{color:#eee}.fts-fb-load-more{border-radius:1px;padding:0;line-height:37px!important;width:100%;min-height:37px!important;font-size:13px!important;background:#fff!important;cursor:pointer;color:#787a7b;-webkit-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out;max-width:740px!important;font-weight:700}.toggle-custom-textarea-show span,label.toggle-custom-textarea-show{color:#fffefe}.fts-logo-header{margin-bottom:20px!important}.fts-logo-subheader{margin-bottom:10px!important}.fts-color-settings-admin-form label{font-weight:700;min-width:100px}#fts_clear_cache_developer_mode{margin-left:28px}.toplevel_page_feed-them-settings-page .pane-active{display:block}.toplevel_page_feed-them-settings-page .fts-tabbed{display:block;float:left;color:#545454;font-weight:700;text-decoration:none;line-height:1.9;text-align:center;cursor:pointer;border-bottom:1px solid #ccc;padding:10px 38px!important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-width:115px;background:#fff;margin-right:1px!important;font-size:13px;width:auto!important}.toplevel_page_feed-them-settings-page label.tab-active{background:#0073aa!important;color:#fff!important}.toplevel_page_feed-them-settings-page .fts-tab-content{clear:both;padding-top:15px}.feed-them-social-admin-input-label small{font-weight:400}.not-active-title:hover h3{color:#028fd2}.not-active-title h3{color:#0073aa}@media (max-width:797px){.toplevel_page_feed-them-settings-page #fts-tabs{margin-top:140px!important}}@media (max-width:450px){#shortcode-form-selector{min-width:270px!important}}@media (max-width:500px){.toplevel_page_feed-them-settings-page #fts-tab-content1 .use-of-plugin{max-width:100%!important}}#fts-timezone{max-width:300px}.fts-instagram-username-picker-wrap li{clear:both;background:#e6e6e6;padding:10px;margin-bottom:1px;display:block;width:100%;line-height:16px;float:left}.combine-twitter-hashtag-etc-wrap,.facebook_hide_date,.facebook_hide_name,.facebook_hide_thumbnail,.facebook_show_media,.fts-success,.youtube_video_single_info_display{display:none}.fts-instagram-username-picker-wrap li.fts-insta-id-active,.fts-instagram-username-picker-wrap li:hover{background:#0073aa;color:#fff}.ft-instagram-username-picker{clear:both;margin:0 0 1px;height:65px}.fts-insta-profile-picture-div img{float:left;max-width:65px;margin-right:15px;border-radius:100px}.fts-insta-fullname-div{padding:5px 0 2px}.fts-insta-id-div{font-style:italic;padding:5px 0 0}.fts-instagram-username-picker-wrap{padding-right:20px;max-height:310px;overflow:auto;margin:0}.fts-instagram-username-picker-wrap li:first-child{margin-top:10px}.fts-instagram-username-picker-wrap li:last-child{margin-bottom:10px}.fts-empty-error input,input.fts-empty-error{background:#ffffd8!important}.fts-instagram-username-picker-wrap li{color:#222}.fts-highlight{background:#0073aa;border-radius:20px;color:#fff;padding:0 5px}.fts-youtube-get-access-token,.fts-youtube-get-access-token:focus{padding:18px 16px 19px 188px;background: url(../images/google-logo-admin.jpg) 13px 12px no-repeat #fff;color:#252525;}.fts-twitter-get-access-token,.fts-twitter-get-access-token:focus{padding:18px 16px 19px 188px;background:url(../images/twitter-logo-admin.jpg) 13px 12px no-repeat #fff;color:#252525}.fts-twitter-add-all-keys-click-option,.fts-youtube-add-all-keys-click-option{margin: -10px 0 15px 10px;text-align:left;clear:both}.twitter-extra-keys-text,.youtube-extra-keys-text{max-width:550px;margin-bottom:15px;padding-left: 10px;}.feed-them_page_fts-twitter-feed-styles-submenu-page .fts-successful-api-token{margin-top:0;margin-bottom:-10px}#fts-timer{padding:6px 0 0 1px;float:left}@font-face{font-family:FontAwesomeSlick;src:url(../../feeds/css/font/fontawesome-webfont.eot?v=3.2.1);src:url(../../feeds/css/font/fontawesome-webfont.eot?#iefix&v=3.2.1) format("embedded-opentype"),url(../../feeds/css/font/fontawesome-webfont.woff?v=3.2.1) format("woff"),url(../../feeds/css/font/fontawesome-webfont.ttf?v=3.2.1) format("truetype"),url(../../feeds/css/font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1) format("svg")}.fts-success:before{font-family:FontAwesomeSlick!important;content:"\f00c"!important;font-size:14px;position:relative;line-height:19px}.fts-success{margin:3px 6px 0;padding:2px 4px;color:#fff;background:#01a701;border-radius:20px;float:left;font-size:10px!important;width:auto;height:18px}#discount-for-review a:hover{color:#0073aa}.fb-sublist{border:none!important;overflow:auto;height:200px;background:#f7f7f7}.fb-sublist li{border:1px solid #f7f7f7!important;border-bottom:0;border-right:0}.fts-token-save{border-radius:100px}.fb-sublist .fb-name{letter-spacing:0!important;font-size:13px}.fts-fb-location-text-wrap{padding:8px;text-align:center;color:#f7f7f7;font-weight:700;background:#00a400;margin:10px 0 0}.fb-name small{display:block;line-height:0;letter-spacing:0;color:#969696}.fts-successful-api-token small{font-size:12px}.fb-page-list li{position:relative}.fts-successful-api-token h3 a{text-decoration:none!important;color:#262627;text-shadow:1px 1px 1px #fff;font-size:17px}.fts-successful-api-token h3 a:hover,.fts-successful-api-token img:hover{opacity:.8}.fb-page-list .fts-fb-load-more{color:#00a400}.feed-them-icon-wrap a.youtube-icon{background:url(../images/youtube-icon.png) top right no-repeat}.combine-instagram-wrap .fts-instagram-hashtag-location-options-message{margin-top:25px;margin-bottom:-25px}.fts-fb-token-wrap .dashicons-admin-links:before{font-size:20px;color:#3b5999}.fb-page-master-list .dashicons-admin-links:before{top:-3px;position:relative}.fts-successful-api-token .dashicons-admin-links:before{top:3px;position:relative}.fts-arrow-icon:before{content:'\f054';font-family:FontAwesomeSlick!important;color:#00a400;font-size:18px!important;position:relative;top:2px;padding:0 8px}.fts-fb-icon:before{content:'\f082';font-family:FontAwesomeSlick!important;color:#3a5899;font-size:20px!important;position:relative;top:2px;padding-right:5px}.fts-insta-icon:before{content:'\f16d';font-family:FontAwesomeSlick!important;color:#263232;font-size:22px!important;position:relative;top:3px;padding-right:5px}.fts-special-working-wrap .fts-arrow-icon:before{font-size:18px!important;top:1px}.fts-special-working-wrap .fts-fb-icon:before{top:1px}.fts-special-working-wrap .fts-insta-icon:before{top:2px}.instagram_hashtag{display:none}.fts-exp-time-wrapper {display:none;}
admin/js/admin.js CHANGED
@@ -17,109 +17,4 @@ function fts_ClearCache() {
17
  }
18
  }); // end of ajax()
19
  return false;
20
- }
21
-
22
- jQuery(document).ready(function ($) {
23
-
24
- // Grab the url so we can do stuff.
25
- var url_string = window.location.href;
26
- var url = new URL(url_string);
27
-
28
- // Encrypt: Instagram Basic
29
- if ( $('#fts_instagram_custom_api_token').length !== 0 ) {
30
- // Do NOT run this if we are getting a token for Instagram, because we save the token via ajax. The Instagram Business and Facebook Business do not.
31
- if (url_string.indexOf("code") === -1 && url_string.indexOf("feed_type") === -1) {
32
-
33
- if ('' === $('#fts_instagram_custom_api_token').data('token')) {
34
-
35
- if ('' === $('#fts_instagram_custom_api_token').val()) {
36
- console.log('Instagram Basic: No token has been set.');
37
- } else {
38
- // User clicked enter or submit button.
39
- console.log('Instagram Basic: Token set, now encrypting.');
40
- fts_encrypt_token_ajax($('#fts_instagram_custom_api_token').val(), 'basic', '#fts_instagram_custom_api_token');
41
- }
42
- } else {
43
- console.log('Instagram Basic: Token is already set & encrypted.');
44
- }
45
- }
46
- }
47
-
48
- // Encrypt: Instagram Business
49
- if ( $('#fts_instagram_custom_api_token').length !== 0 ) {
50
-
51
- if ('' === $('#fts_facebook_instagram_custom_api_token').data('token')) {
52
-
53
- // If no value set then return message.
54
- if ('' === $('#fts_facebook_instagram_custom_api_token').val()) {
55
- console.log('Instagram Business: No token has been set.');
56
- } else {
57
- // User clicked enter or submit button.
58
- console.log('Instagram Business: Token set, now encrypting.');
59
- fts_encrypt_token_ajax($('#fts_facebook_instagram_custom_api_token').val(), 'business', '#fts_facebook_instagram_custom_api_token');
60
- }
61
- } else {
62
- console.log('Instagram Business: Token is already set & encrypted.');
63
- }
64
- }
65
-
66
- // Encrypt: Facebook Business
67
- if ( $('#fts_facebook_custom_api_token').length !== 0 ) {
68
-
69
- if ('' === $('#fts_facebook_custom_api_token').data('token')) {
70
-
71
- // If no value set then return message.
72
- if ('' === $('#fts_facebook_custom_api_token').val()) {
73
- console.log('Facebook Business: No token has been set.');
74
- } else {
75
- // User clicked enter or submit button.
76
- console.log('Facebook Business: Token set, now encrypting.');
77
- fts_encrypt_token_ajax($('#fts_facebook_custom_api_token').val(), 'fbBusiness', '#fts_facebook_custom_api_token');
78
- }
79
- } else {
80
- console.log('Facebook Business: Token is already set & encrypted.');
81
- }
82
- }
83
-
84
- // Encrypt: Facebook Business Reviews
85
- if ( $('#fts_facebook_custom_api_token_biz').length !== 0 ) {
86
-
87
- if ('' === $('#fts_facebook_custom_api_token_biz').data('token')) {
88
-
89
- // If no value set then return message.
90
- if ('' === $('#fts_facebook_custom_api_token_biz').val()) {
91
- console.log('Facebook Business: No token has been set.');
92
- } else {
93
- // User clicked enter or submit button.
94
- console.log('Facebook Business Reviews: Token set, now encrypting.');
95
- fts_encrypt_token_ajax($('#fts_facebook_custom_api_token_biz').val(), 'fbBusinessReviews', '#fts_facebook_custom_api_token_biz');
96
- }
97
- } else {
98
- console.log('Facebook Business Reviews: Token is already set & encrypted.');
99
- }
100
- }
101
-
102
- function fts_encrypt_token_ajax( access_token, token_type , id ) {
103
-
104
- var token = access_token;
105
-
106
- $.ajax({
107
- data: {
108
- action: 'fts_encrypt_token_ajax',
109
- access_token: token,
110
- token_type: token_type,
111
- },
112
- type: 'POST',
113
- url: ftsAjax.ajaxurl,
114
- success: function ( response ) {
115
-
116
- var data = JSON.parse( response );
117
- // Add the OG token to the input value and add the encrypted token to the data-attribute.
118
- $( id ).attr('value', data.token).attr('data-token', 'encrypted');
119
- console.log( id + ': OG Token and Encrypted Response: ' + response );
120
- }
121
-
122
- }); // end of ajax()
123
- return false;
124
- }
125
- });
17
  }
18
  }); // end of ajax()
19
  return false;
20
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/encrypt.js ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function ($) {
2
+
3
+ // Grab the url so we can do stuff.
4
+ var url_string = window.location.href;
5
+ var url = new URL(url_string);
6
+
7
+ // Encrypt: Instagram Basic
8
+ if ( $('#fts_instagram_custom_api_token').length !== 0 ) {
9
+ // Do NOT run this if we are getting a token for Instagram, because we save the token via ajax. The Instagram Business and Facebook Business do not.
10
+ if (url_string.indexOf("code") === -1 && url_string.indexOf("feed_type") === -1) {
11
+ if ('' === $('#fts_instagram_custom_api_token').data('token')) {
12
+
13
+ if ('' === $('#fts_instagram_custom_api_token').val()) {
14
+ console.log('Instagram Basic: No token has been set.');
15
+ } else {
16
+ // User clicked enter or submit button.
17
+ console.log('Instagram Basic: Token set, now encrypting.');
18
+ fts_encrypt_token_ajax($('#fts_instagram_custom_api_token').val(), 'basic', '#fts_instagram_custom_api_token');
19
+ }
20
+ } else {
21
+ console.log('Instagram Basic: Token is already set & encrypted.');
22
+ }
23
+ }
24
+ }
25
+
26
+ // Encrypt: Instagram Business
27
+ if ( $('#fts_instagram_custom_api_token').length !== 0 ) {
28
+
29
+ if ('' === $('#fts_facebook_instagram_custom_api_token').data('token')) {
30
+
31
+ // If no value set then return message.
32
+ if ('' === $('#fts_facebook_instagram_custom_api_token').val()) {
33
+ console.log('Instagram Business: No token has been set.');
34
+ } else {
35
+ // User clicked enter or submit button.
36
+ console.log('Instagram Business: Token set, now encrypting.');
37
+ fts_encrypt_token_ajax($('#fts_facebook_instagram_custom_api_token').val(), 'business', '#fts_facebook_instagram_custom_api_token');
38
+ }
39
+ } else {
40
+ console.log('Instagram Business: Token is already set & encrypted.');
41
+ }
42
+ }
43
+
44
+ // Encrypt: Facebook Business
45
+ if ( $('#fts_facebook_custom_api_token').length !== 0 ) {
46
+
47
+ if ('' === $('#fts_facebook_custom_api_token').data('token')) {
48
+
49
+ // If no value set then return message.
50
+ if ('' === $('#fts_facebook_custom_api_token').val()) {
51
+ console.log('Facebook Business: No token has been set.');
52
+ } else {
53
+ // User clicked enter or submit button.
54
+ console.log('Facebook Business: Token set, now encrypting.');
55
+ fts_encrypt_token_ajax($('#fts_facebook_custom_api_token').val(), 'fbBusiness', '#fts_facebook_custom_api_token');
56
+ }
57
+ } else {
58
+ console.log('Facebook Business: Token is already set & encrypted.');
59
+ }
60
+ }
61
+
62
+ // Encrypt: Facebook Business Reviews
63
+ if ( $('#fts_facebook_custom_api_token_biz').length !== 0 ) {
64
+
65
+ if ('' === $('#fts_facebook_custom_api_token_biz').data('token')) {
66
+
67
+ // If no value set then return message.
68
+ if ('' === $('#fts_facebook_custom_api_token_biz').val()) {
69
+ console.log('Facebook Business: No token has been set.');
70
+ } else {
71
+ // User clicked enter or submit button.
72
+ console.log('Facebook Business Reviews: Token set, now encrypting.');
73
+ fts_encrypt_token_ajax($('#fts_facebook_custom_api_token_biz').val(), 'fbBusinessReviews', '#fts_facebook_custom_api_token_biz');
74
+ }
75
+ } else {
76
+ console.log('Facebook Business Reviews: Token is already set & encrypted.');
77
+ }
78
+ }
79
+
80
+ function fts_encrypt_token_ajax( access_token, token_type , id ) {
81
+
82
+ const token = access_token;
83
+
84
+ // Get today's date and time.
85
+ const now = new Date().getTime();
86
+
87
+ $.ajax({
88
+ data: {
89
+ action: 'fts_encrypt_token_ajax',
90
+ access_token: token,
91
+ token_type: token_type,
92
+ fts_security: ftsAjaxEncrypt.nonce,
93
+ fts_time: now,
94
+ },
95
+ type: 'POST',
96
+ url: ftsAjaxEncrypt.ajaxurl,
97
+ success: function ( response ) {
98
+
99
+ console.log( response );
100
+
101
+ const data = JSON.parse( response );
102
+ // Add the OG token to the input value and add the encrypted token to the data-attribute.
103
+ $( id ).attr('value', data.token).attr('data-token', 'encrypted');
104
+ console.log( id + ': OG Token and Encrypted Response: ' + response );
105
+ }
106
+
107
+ }); // end of ajax()
108
+ return false;
109
+ }
110
+ });
feed-them.php CHANGED
@@ -7,18 +7,18 @@
7
  * Plugin Name: Feed Them Social - for Twitter feed, Youtube, and more
8
  * Plugin URI: https://feedthemsocial.com/
9
  * Description: Display a Custom Facebook feed, Instagram feed, Twitter feed and YouTube feed on pages, posts or widgets.
10
- * Version: 2.9.9
11
  * Author: SlickRemix
12
  * Author URI: https://www.slickremix.com/
13
  * Text Domain: feed-them-social
14
  * Domain Path: /languages
15
  * Requires at least: WordPress 4.0.0
16
  * Tested up to: WordPress 6.0.1
17
- * Stable tag: 2.9.9
18
- * License: GPLv2 or later
19
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
- * @version 2.9.9
22
  * @package FeedThemSocial/Core
23
  * @copyright Copyright (c) 2012-2022 SlickRemix
24
  *
@@ -31,7 +31,7 @@
31
  *
32
  * Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout!
33
  */
34
- define( 'FTS_CURRENT_VERSION', '2.9.9' );
35
 
36
  define( 'FEED_THEM_SOCIAL_NOTICE_STATUS', get_option( 'rating_fts_slick_notice', false ) );
37
 
@@ -174,7 +174,7 @@ final class Feed_Them_Social {
174
  if ( get_transient( 'fts_updated' ) ) {
175
  echo '<div class="notice notice-success updated is-dismissible">';
176
  echo sprintf(
177
- esc_html__( '%10$sThanks for updating Feed Them Social. We have deleted the cache in our plugin so you can view any changes we have made.%11$s %8$s%6$sNOTE%7$s: Feed Them Social 3.0 will have some amazing changes in the coming months. Please take a moment and %4$s read them here%5$s.%9$s', 'feed-them-social' ),
178
  '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' ) . '">',
179
  '</a>',
180
  '<br/><br/>',
7
  * Plugin Name: Feed Them Social - for Twitter feed, Youtube, and more
8
  * Plugin URI: https://feedthemsocial.com/
9
  * Description: Display a Custom Facebook feed, Instagram feed, Twitter feed and YouTube feed on pages, posts or widgets.
10
+ * Version: 3.0.1
11
  * Author: SlickRemix
12
  * Author URI: https://www.slickremix.com/
13
  * Text Domain: feed-them-social
14
  * Domain Path: /languages
15
  * Requires at least: WordPress 4.0.0
16
  * Tested up to: WordPress 6.0.1
17
+ * Stable tag: 3.0.1
18
+ * License: GPLv3 or later
19
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
+ * @version 3.0.1
22
  * @package FeedThemSocial/Core
23
  * @copyright Copyright (c) 2012-2022 SlickRemix
24
  *
31
  *
32
  * Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout!
33
  */
34
+ define( 'FTS_CURRENT_VERSION', '3.0.1' );
35
 
36
  define( 'FEED_THEM_SOCIAL_NOTICE_STATUS', get_option( 'rating_fts_slick_notice', false ) );
37
 
174
  if ( get_transient( 'fts_updated' ) ) {
175
  echo '<div class="notice notice-success updated is-dismissible">';
176
  echo sprintf(
177
+ esc_html__( '%10$sThanks for updating Feed Them Social. We have deleted the cache in our plugin so you can view any changes we have made.%11$s %8$s%6$sNOTE%7$s: Feed Them Social will have some amazing changes in the coming months. Please take a moment and %4$s read them here%5$s.%9$s', 'feed-them-social' ),
178
  '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' ) . '">',
179
  '</a>',
180
  '<br/><br/>',
feeds/instagram/class-fts-instagram-feed.php CHANGED
@@ -384,15 +384,6 @@ class FTS_Instagram_Feed extends feed_them_social_functions {
384
  }
385
  }
386
 
387
-
388
-
389
-
390
-
391
-
392
-
393
-
394
-
395
-
396
  wp_enqueue_script( 'fts-global', plugins_url( 'feed-them-social/feeds/js/fts-global.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
397
  $instagram_data_array = array();
398
 
384
  }
385
  }
386
 
 
 
 
 
 
 
 
 
 
387
  wp_enqueue_script( 'fts-global', plugins_url( 'feed-them-social/feeds/js/fts-global.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
388
  $instagram_data_array = array();
389
 
feeds/js/fts-global.js CHANGED
@@ -1 +1,479 @@
1
- function slickremixImageResizing(){var e=jQuery(".fts-instagram-inline-block-centered"),t=jQuery(".slicker-instagram-placeholder"),s=e.attr("data-ftsi-columns"),r=e.attr("data-ftsi-margin"),a=2*parseFloat(r),i=e.width(),o=e.attr("data-ftsi-force-columns");if("1"===s||"2"===s||"3"===s||"4"===s||"5"===s||"6"===s||"7"===s||"8"===s){if(i<="376"&&"no"===o)var l="calc(100% - "+a+"px)";else if(i<="736"&&"no"===o)l="calc(50% - "+a+"px)";else if("8"===s)l="calc(12.5% - "+a+"px)";else if("7"===s)l="calc(14.28571428571429% - "+a+"px)";else if("6"===s)l="calc(16.66666666666667% - "+a+"px)";else if("5"===s)l="calc(20% - "+a+"px)";else if("4"===s)l="calc(25% - "+a+"px)";else if("3"===s)l="calc(33.33333333333333% - "+a+"px)";else if("2"===s)l="calc(50% - "+a+"px)";else if("1"===s)l="calc(100% - "+a+"px)";t.css({width:l});var n=t.width();t.css({width:l,height:n,margin:r})}else{var c=e.attr("data-ftsi-width")?e.attr("data-ftsi-width"):"325px";t.css({width:c,height:c,margin:r})}t.width()<180?(jQuery(".fts-instagram-inline-block-centered .slicker-date, .fts-instagram-inline-block-centered .fts-insta-likes-comments-grab-popup").hide(),jQuery(".slicker-instagram-placeholder").addClass("fts-smallerthan-180")):(jQuery(".fts-instagram-inline-block-centered .slicker-date, .fts-instagram-inline-block-centered .fts-insta-likes-comments-grab-popup").show(),jQuery(".slicker-instagram-placeholder, .slicker-youtube-placeholder").removeClass("fts-smallerthan-180"))}function slickremixImageResizingFacebook(){var e=jQuery(".fts-facebook-inline-block-centered"),t=jQuery(".slicker-facebook-placeholder"),s=e.attr("data-ftsi-columns"),r=e.attr("data-ftsi-margin"),a=1*parseFloat(r);e.width();if("2"===s||"3"===s){if("3"===s)var i="calc(33.0777777% - "+a+"px)";else if("2"===s)i="calc(49.777777% - "+a+"px)";t.css({width:i});var o=t.width();t.css({width:i,height:o,margin:r})}else{var l=e.attr("data-ftsi-width")?e.attr("data-ftsi-width"):"325px";t.css({width:l,height:l,margin:r})}t.width()<180?(jQuery(".fts-facebook-inline-block-centered .slicker-date, .fts-facebook-inline-block-centered .fts-insta-likes-comments-grab-popup").hide(),jQuery(".slicker-facebook-placeholder").addClass("fts-smallerthan-180")):(jQuery(".fts-facebook-inline-block-centered .slicker-date, .fts-facebook-inline-block-centered .fts-insta-likes-comments-grab-popup").show(),jQuery(".slicker-facebook-placeholder, .slicker-youtube-placeholder").removeClass("fts-smallerthan-180"))}function slickremixImageResizingFacebook2(){var e=jQuery(".fts-more-photos-2-or-3-photos a"),t="calc(49.88888888% - 1px)";e.css({width:t});var s=e.width();e.css({width:t,height:s,margin:"1px"})}function slickremixImageResizingFacebook3(){var e=jQuery(".fts-more-photos-4-photos a"),t="calc(33.192222222% - 1px)";e.css({width:t});var s=e.width();e.css({width:t,height:s,margin:"1px"})}function slickremixImageResizingYouTube(){var e=jQuery(".fts-youtube-inline-block-centered"),t=jQuery(".slicker-youtube-placeholder"),s=jQuery(".fts-youtube-popup-gallery"),r=jQuery(".fts-yt-large"),a=jQuery(".fts-youtube-scrollable.fts-youtube-thumbs-wrap, .fts-youtube-scrollable.fts-youtube-thumbs-wrap-left, .youtube-comments-wrap-premium, .youtube-comments-wrap.fts-youtube-thumbs-wrap-right, .youtube-comments-wrap.fts-youtube-thumbs-wrap-left"),i=e.attr("data-ftsi-columns"),o=e.attr("data-ftsi-margin"),l=2*parseFloat(o),n=e.width(),c=e.attr("data-ftsi-force-columns");if("1"===i||"2"===i||"3"===i||"4"===i||"5"===i||"6"===i){if(n<="376"&&"no"===c)var u="calc(100% - "+l+"px)";else if(n<="736"&&"no"===c)u="calc(50% - "+l+"px)";else if("6"===i)u="calc(16.66666666666667% - "+l+"px)";else if("5"===i)u="calc(20% - "+l+"px)";else if("4"===i)u="calc(25% - "+l+"px)";else if("3"===i)u="calc(33.33333333333333% - "+l+"px)";else if("2"===i)u="calc(50% - "+l+"px)";else if("1"===i)u="calc(100% - "+l+"px)";var f=r.height();a.css({height:f+"px"}),t.css({width:u}),s.css({padding:o});var d=t.width()-"150";t.css({width:u,height:d,margin:o})}t.width()<180?(jQuery(".slicker-youtube-placeholder").addClass("fts-youtube-smallerthan-180"),jQuery(".fts-yt-large, .fts-youtube-scrollable").css("width","100% !important")):jQuery(".slicker-youtube-placeholder").removeClass("fts-youtube-smallerthan-180"),jQuery(".fts-master-youtube-wrap").width()<550?jQuery(".fts-yt-large, .fts-youtube-scrollable, .youtube-comments-wrap").addClass("fts-youtube-smallerthan-550-stack"):jQuery(".fts-yt-large, .fts-youtube-scrollable, .youtube-comments-wrap").removeClass("fts-youtube-smallerthan-550-stack")}function fts_external_link_meta_content(){return jQuery(".fts-tweeter-wrap").each(function(){var e=jQuery(this).find(".fts-twitter-external-url-wrap");if(e[0]){var t=e.attr("data-twitter-security"),s=e.attr("data-twitter-time"),r=e.attr("data-twitter-url"),a=e.attr("data-image-exists-check"),i=e.attr("data-no-video-image-check"),o=e.attr("data-twitter-popup");console.log("url: "+r+" Image exists: "+a+" No video image exists: "+i),jQuery.ajax({data:{action:"fts_twitter_share_url_check",fts_security:t,fts_time:s,fts_url:r,fts_image_exists:a,fts_no_video_image:i,fts_popup:o},type:"POST",url:fts_twitter_ajax.ajax_url,success:function(t){fts_twitter=t,e.removeAttr("class data-twitter-security data-twitter-time"),console.log("FTS Twitter external link success"),"missing_info"===t?jQuery(e).attr("data-error","Do not return any content, image, title or description missing").hide():jQuery(e).html(t),ftsRetweetHeight(),jQuery(".fts-slicker-twitter-posts")[0]&&(jQuery(".fts-slicker-twitter-posts").masonry("reloadItems"),setTimeout(function(){jQuery(".fts-slicker-twitter-posts").masonry("layout")},500))},error:function(e,t,s){console.log(e),console.log("AJAX errors: "+s)}})}}),!0}function ftsRetweetHeight(){if(jQuery("div").hasClass("fts-tweeter-wrap")){var e=jQuery(".fts-tweeter-wrap");"475"<e.width()?(console.log("Wrap width: "+e.width()),jQuery(".fts-twitter-div").addClass("fts-twitter-wrap-below-width-450"),jQuery("span.fts-twitter-external-backg-image").css({"background-size":"cover"})):(jQuery(".fts-twitter-div").removeClass("fts-twitter-wrap-below-width-450"),jQuery("span.fts-twitter-external-backg-image").css({"background-size":"0"})),jQuery(".fts-twitter-quoted-text").each(function(){var e=jQuery(this).height()+20;jQuery(this).parent().find(".fts-twitter-external-backg-image").css({height:e+"px"})})}}jQuery(document).ready(function(){fts_external_link_meta_content(),jQuery(".fts-youtube-scrollable, .youtube-comments-wrap-premium, .youtube-comments-thumbs").hover(function(){jQuery("body").css("overflow","hidden")},function(){jQuery("body").css("overflow","auto")}),jQuery(document).on("keydown",function(e){27===e.keyCode&&(jQuery(".fts-youtube-scrollable").removeClass("fts-scrollable-function"),jQuery(".youtube-comments-thumbs").hide(),jQuery(".fts-youtube-scrollable, .fts-fb-autoscroll-loader").show(),jQuery(".fts-youtube-thumbs-gallery-master .youtube-comments-thumbs").html(""),slickremixImageResizing())}),jQuery.fn.ftsShare=function(){jQuery(".fts-share-wrap").each(function(){var e=jQuery(this);e.find(".ft-gallery-link-popup").unbind().bind("click",function(){e.find(".ft-gallery-share-wrap").toggle()})})},jQuery.fn.ftsShare&&jQuery.fn.ftsShare(),navigator.userAgent.indexOf("Firefox")>0||jQuery(".fts-instagram-popup-half video, .fts-simple-fb-wrapper video, .fts-slicker-facebook-posts video, .fts-fluid-videoWrapper-html5 video").click(function(){jQuery(this).trigger(this.paused?(this.paused,"play"):"pause")}),jQuery.fn.masonry&&jQuery(".fts-slicker-instagram").masonry({itemSelector:".fts-masonry-option"})}),jQuery.trim(jQuery(".fts-jal-fb-group-display").html()).length||jQuery(".fts-jal-fb-group-display").append('<div class="fts-facebook-add-more-posts-notice"><p>Please go to the <strong>Facebook Options</strong> page of our plugin and look for the "<strong>Change Post Limit</strong>" option and add the number <strong>7</strong> or more. You can also hide this notice on the Facebook Options page if you want.</p>If you are trying to add a Personal Facebook feed and you are seeing this message too, please note: <strong>Personal Facebook Accounts generally do not work with our plugin.</strong></div>'),jQuery(window).on("load",function(){jQuery.fn.masonry&&setTimeout(function(){jQuery(".fts-pinterest-wrapper.masonry").masonry("layout")},200)}),jQuery(document).ready(slickremixImageResizing),jQuery(window).on("resize",slickremixImageResizing),jQuery(document).ready(slickremixImageResizingFacebook,slickremixImageResizingFacebook2,slickremixImageResizingFacebook3),jQuery(window).on("resize",slickremixImageResizingFacebook,slickremixImageResizingFacebook2,slickremixImageResizingFacebook3),jQuery(document).ready(slickremixImageResizingYouTube),jQuery(window).on("resize",slickremixImageResizingYouTube),jQuery(document).ready(ftsRetweetHeight),jQuery(window).on("resize",ftsRetweetHeight);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+
3
+ // Run our funtion after the page has finished loading to retrieve our external urls meta tag details.
4
+ fts_external_link_meta_content();
5
+
6
+ jQuery('.fts-youtube-scrollable, .youtube-comments-wrap-premium, .youtube-comments-thumbs').hover(function() {
7
+ jQuery("body").css("overflow","hidden");
8
+ }, function() {
9
+ jQuery("body").css("overflow","auto");
10
+ });
11
+
12
+
13
+ jQuery( document ).on( 'keydown', function ( e ) {
14
+ if ( e.keyCode === 27 ) { // ESC
15
+ jQuery( ".fts-youtube-scrollable" ).removeClass( "fts-scrollable-function" );
16
+ jQuery('.youtube-comments-thumbs').hide();
17
+ jQuery('.fts-youtube-scrollable, .fts-fb-autoscroll-loader').show();
18
+ jQuery('.fts-youtube-thumbs-gallery-master .youtube-comments-thumbs').html('');
19
+ slickremixImageResizing();
20
+ }
21
+ });
22
+
23
+ jQuery.fn.ftsShare = function() {
24
+ jQuery('.fts-share-wrap').each(function() {
25
+ var $self = jQuery(this);
26
+ //Share toolip function
27
+ $self.find('.ft-gallery-link-popup').unbind().bind('click', function() {
28
+ $self.find('.ft-gallery-share-wrap').toggle();
29
+ });
30
+ });
31
+ };
32
+ // return our share function after page has loaded to speed things up. Plus this way we can recall it in the loadmore areas of each feed instead of duplicating all the js.
33
+ if (jQuery.fn.ftsShare) {
34
+ jQuery.fn.ftsShare();
35
+ }
36
+
37
+ if (navigator.userAgent.indexOf("Firefox") > 0) {} else {
38
+ jQuery(".fts-instagram-popup-half video, .fts-simple-fb-wrapper video, .fts-slicker-facebook-posts video, .fts-fluid-videoWrapper-html5 video").click(function() {
39
+ jQuery(this).trigger(this.paused ? this.paused ? "play" : "play" : "pause")
40
+ })
41
+ }
42
+ if (jQuery.fn.masonry) {
43
+ jQuery(".fts-slicker-instagram").masonry({
44
+ itemSelector: ".fts-masonry-option"
45
+ })
46
+ }
47
+ });
48
+ if (!jQuery.trim(jQuery('.fts-jal-fb-group-display').html()).length) {
49
+ jQuery('.fts-jal-fb-group-display').append('<div class="fts-facebook-add-more-posts-notice"><p>Please go to the <strong>Facebook Options</strong> page of our plugin and look for the "<strong>Change Post Limit</strong>" option and add the number <strong>7</strong> or more. You can also hide this notice on the Facebook Options page if you want.</p>If you are trying to add a Personal Facebook feed and you are seeing this message too, please note: <strong>Personal Facebook Accounts generally do not work with our plugin.</strong></div>')
50
+ }
51
+ jQuery(window).on('load', function() {
52
+ if (jQuery.fn.masonry) {
53
+ setTimeout(function () {
54
+ jQuery(".fts-pinterest-wrapper.masonry").masonry("layout");
55
+ }, 200);
56
+ }
57
+ });
58
+
59
+ // https://www.w3schools.com/js/js_comparisons.asp
60
+ // > greater than x > 8 true
61
+ // < less than x < 8 true
62
+ // https://www.slickremix.com/betablog/2017/09/20200/
63
+
64
+ jQuery(document).ready(slickremixImageResizing);
65
+ jQuery(window).on('resize',slickremixImageResizing);
66
+
67
+ function slickremixImageResizing() {
68
+ // This is the container for our instagram images
69
+ var ftsBlockCenteredAttr = jQuery('.fts-instagram-inline-block-centered');
70
+ // var ftsname = arguments["0"]
71
+ // var ftsBlockCenteredAttr = jQuery(ftsname);
72
+
73
+
74
+ // alert(ftsBlockCenteredAttr);
75
+
76
+ // This is the container for the instagram image post
77
+ var ftsImageSize = jQuery('.slicker-instagram-placeholder');
78
+
79
+ // How many colums do we want to show
80
+ var ftsInstagramColumns = ftsBlockCenteredAttr.attr('data-ftsi-columns');
81
+ // The margin in between photos so we can subtract that from the total %
82
+ var ftsInstagramMargin = ftsBlockCenteredAttr.attr('data-ftsi-margin');
83
+ // The margin without the px and we multiply it by 2 because the margin is on the left and right
84
+ var ftsInstagramMarginfinal = parseFloat(ftsInstagramMargin) * 2;
85
+ // Get the Instagram container .width() so we can keep track of the container size
86
+ var ftsContainerWidth = ftsBlockCenteredAttr.width();
87
+ // Force columns so the images to not scale up from 376px-736px.
88
+ // This keeps the aspect ratio for the columns and is in the if statements below where you will see ftsContainerWidth <= '376' && ftsForceColumns === 'no' and ftsContainerWidth <= '736' && ftsForceColumns === 'no'
89
+ var ftsForceColumns = ftsBlockCenteredAttr.attr('data-ftsi-force-columns');
90
+ // we or each option so if someone tries something other than that it will go to else statement
91
+ if (ftsInstagramColumns === '1' ||
92
+ ftsInstagramColumns === '2' ||
93
+ ftsInstagramColumns === '3' ||
94
+ ftsInstagramColumns === '4' ||
95
+ ftsInstagramColumns === '5' ||
96
+ ftsInstagramColumns === '6' ||
97
+ ftsInstagramColumns === '7' ||
98
+ ftsInstagramColumns === '8') {
99
+ // alert('wtf');
100
+ // if the container is 376px or less we force the image size to be 100%
101
+ if (ftsContainerWidth <= '376' && ftsForceColumns === 'no') {
102
+ var og_size = 'calc(100% - ' + ftsInstagramMarginfinal + 'px)';
103
+ }
104
+ // if the container is 736px or less we force the image size to be 50%
105
+ else if (ftsContainerWidth <= '736' && ftsForceColumns === 'no') {
106
+ var og_size = 'calc(50% - ' + ftsInstagramMarginfinal + 'px)';
107
+ }
108
+ else {
109
+ if (ftsInstagramColumns === '8') {
110
+ var og_size = 'calc(12.5% - ' + ftsInstagramMarginfinal + 'px)';
111
+ }
112
+ else if (ftsInstagramColumns === '7') {
113
+ var og_size = 'calc(14.28571428571429% - ' + ftsInstagramMarginfinal + 'px)';
114
+ }
115
+ else if (ftsInstagramColumns === '6') {
116
+ var og_size = 'calc(16.66666666666667% - ' + ftsInstagramMarginfinal + 'px)';
117
+ }
118
+ else if (ftsInstagramColumns === '5') {
119
+ var og_size = 'calc(20% - ' + ftsInstagramMarginfinal + 'px)';
120
+ }
121
+ else if (ftsInstagramColumns === '4') {
122
+ var og_size = 'calc(25% - ' + ftsInstagramMarginfinal + 'px)';
123
+ }
124
+ else if (ftsInstagramColumns === '3') {
125
+ var og_size = 'calc(33.33333333333333% - ' + ftsInstagramMarginfinal + 'px)';
126
+ }
127
+ else if (ftsInstagramColumns === '2') {
128
+ var og_size = 'calc(50% - ' + ftsInstagramMarginfinal + 'px)';
129
+ }
130
+ else if (ftsInstagramColumns === '1') {
131
+ var og_size = 'calc(100% - ' + ftsInstagramMarginfinal + 'px)';
132
+ }
133
+ }
134
+
135
+ ftsImageSize.css({'width': og_size});
136
+
137
+ var ftsImageHeight = ftsImageSize.width();
138
+ ftsImageSize.css({
139
+ 'width': og_size,
140
+ 'height': ftsImageHeight,
141
+ 'margin': ftsInstagramMargin
142
+ });
143
+ }
144
+ else {
145
+ var ftsImageWidth = ftsBlockCenteredAttr.attr('data-ftsi-width') ? ftsBlockCenteredAttr.attr('data-ftsi-width') : '325px';
146
+ // alert(ftsImageSize.width())
147
+ ftsImageSize.css({
148
+ 'width': ftsImageWidth,
149
+ 'height': ftsImageWidth,
150
+ 'margin': ftsInstagramMargin
151
+ });
152
+ }
153
+
154
+ // If our image square is less than 180px then we hide the date, share option, hearts and comments count and icon and make the whole area clickable.
155
+ if (ftsImageSize.width() < 180) {
156
+ jQuery('.fts-instagram-inline-block-centered .slicker-date, .fts-instagram-inline-block-centered .fts-insta-likes-comments-grab-popup').hide();
157
+ jQuery('.slicker-instagram-placeholder').addClass('fts-smallerthan-180');
158
+
159
+ }
160
+ else {
161
+ jQuery('.fts-instagram-inline-block-centered .slicker-date, .fts-instagram-inline-block-centered .fts-insta-likes-comments-grab-popup').show();
162
+ jQuery('.slicker-instagram-placeholder, .slicker-youtube-placeholder').removeClass('fts-smallerthan-180');
163
+
164
+ }
165
+ }
166
+
167
+ // https://www.w3schools.com/js/js_comparisons.asp
168
+ // > greater than x > 8 true
169
+ // < less than x < 8 true
170
+ // https://www.slickremix.com/betablog/2017/09/20200/
171
+
172
+ jQuery(document).ready(slickremixImageResizingFacebook, slickremixImageResizingFacebook2, slickremixImageResizingFacebook3);
173
+ jQuery(window).on('resize',slickremixImageResizingFacebook, slickremixImageResizingFacebook2, slickremixImageResizingFacebook3);
174
+
175
+ function slickremixImageResizingFacebook() {
176
+ // This is the container for our instagram images
177
+ var ftsBlockCenteredAttr = jQuery('.fts-facebook-inline-block-centered');
178
+ // var ftsname = arguments["0"]
179
+ // var ftsBlockCenteredAttr = jQuery(ftsname);
180
+
181
+
182
+ // alert(ftsBlockCenteredAttr);
183
+
184
+ // This is the container for the instagram image post
185
+ var ftsImageSize = jQuery('.slicker-facebook-placeholder');
186
+
187
+ // How many colums do we want to show
188
+ var ftsInstagramColumns = ftsBlockCenteredAttr.attr('data-ftsi-columns');
189
+ // The margin in between photos so we can subtract that from the total %
190
+ var ftsInstagramMargin = ftsBlockCenteredAttr.attr('data-ftsi-margin');
191
+ // The margin without the px and we multiply it by 2 because the margin is on the left and right
192
+ var ftsInstagramMarginfinal = parseFloat(ftsInstagramMargin) * 1;
193
+ // Get the Instagram container .width() so we can keep track of the container size
194
+ var ftsContainerWidth = ftsBlockCenteredAttr.width();
195
+ // Force columns so the images to not scale up from 376px-736px.
196
+ // This keeps the aspect ratio for the columns and is in the if statements below where you will see ftsContainerWidth <= '376' && ftsForceColumns === 'no' and ftsContainerWidth <= '736' && ftsForceColumns === 'no'
197
+ var ftsForceColumns = 'yes';
198
+ // we or each option so if someone tries something other than that it will go to else statement
199
+ if (ftsInstagramColumns === '2' ||
200
+ ftsInstagramColumns === '3') {
201
+
202
+ if (ftsInstagramColumns === '3') {
203
+ var og_size = 'calc(33.0777777% - ' + ftsInstagramMarginfinal + 'px)';
204
+ }
205
+ else if (ftsInstagramColumns === '2') {
206
+ var og_size = 'calc(49.777777% - ' + ftsInstagramMarginfinal + 'px)';
207
+ }
208
+
209
+
210
+ ftsImageSize.css({'width': og_size});
211
+
212
+ var ftsImageHeight = ftsImageSize.width();
213
+ ftsImageSize.css({
214
+ 'width': og_size,
215
+ 'height': ftsImageHeight,
216
+ 'margin': ftsInstagramMargin
217
+ });
218
+ }
219
+ else {
220
+ var ftsImageWidth = ftsBlockCenteredAttr.attr('data-ftsi-width') ? ftsBlockCenteredAttr.attr('data-ftsi-width') : '325px';
221
+ // alert(ftsImageSize.width())
222
+ ftsImageSize.css({
223
+ 'width': ftsImageWidth,
224
+ 'height': ftsImageWidth,
225
+ 'margin': ftsInstagramMargin
226
+ });
227
+ }
228
+
229
+ // If our image square is less than 180px then we hide the date, share option, hearts and comments count and icon and make the whole area clickable.
230
+ if (ftsImageSize.width() < 180) {
231
+ jQuery('.fts-facebook-inline-block-centered .slicker-date, .fts-facebook-inline-block-centered .fts-insta-likes-comments-grab-popup').hide();
232
+ jQuery('.slicker-facebook-placeholder').addClass('fts-smallerthan-180');
233
+
234
+ }
235
+ else {
236
+ jQuery('.fts-facebook-inline-block-centered .slicker-date, .fts-facebook-inline-block-centered .fts-insta-likes-comments-grab-popup').show();
237
+ jQuery('.slicker-facebook-placeholder, .slicker-youtube-placeholder').removeClass('fts-smallerthan-180');
238
+
239
+ }
240
+ }
241
+
242
+ function slickremixImageResizingFacebook2() {
243
+ var e = jQuery(".fts-more-photos-2-or-3-photos a"),
244
+ t = "calc(49.88888888% - 1px)";
245
+ e.css({
246
+ width: t
247
+ });
248
+ var s = e.width();
249
+ e.css({
250
+ width: t,
251
+ height: s,
252
+ margin: "1px"
253
+ })
254
+ }
255
+
256
+ function slickremixImageResizingFacebook3() {
257
+ var e = jQuery(".fts-more-photos-4-photos a"),
258
+ t = "calc(33.192222222% - 1px)";
259
+ e.css({
260
+ width: t
261
+ });
262
+ var s = e.width();
263
+ e.css({
264
+ width: t,
265
+ height: s,
266
+ margin: "1px"
267
+ })
268
+ }
269
+
270
+ // https://www.w3schools.com/js/js_comparisons.asp
271
+ // > greater than x > 8 true
272
+ // < less than x < 8 true
273
+ // https://www.slickremix.com/betablog/2017/09/20200/
274
+
275
+ jQuery(document).ready(slickremixImageResizingYouTube);
276
+ jQuery(window).on('resize',slickremixImageResizingYouTube);
277
+ function slickremixImageResizingYouTube() {
278
+ // This is the container for our instagram images
279
+ var ftsBlockCenteredAttr = jQuery('.fts-youtube-inline-block-centered');
280
+
281
+ // This is the container for the instagram image post
282
+ var ftsYoutubeImageSize = jQuery('.slicker-youtube-placeholder');
283
+ var ftsYoutubeThumbsContainer = jQuery('.fts-youtube-popup-gallery');
284
+
285
+ var ftsYoutubeLarge = jQuery('.fts-yt-large');
286
+ var ftsYoutubeThumbsWrap = jQuery('.fts-youtube-scrollable.fts-youtube-thumbs-wrap, .fts-youtube-scrollable.fts-youtube-thumbs-wrap-left, .youtube-comments-wrap-premium, .youtube-comments-wrap.fts-youtube-thumbs-wrap-right, .youtube-comments-wrap.fts-youtube-thumbs-wrap-left');
287
+
288
+ // How many colums do we want to show
289
+ var ftsInstagramColumns = ftsBlockCenteredAttr.attr('data-ftsi-columns');
290
+ // The margin in between photos so we can subtract that from the total %
291
+ var ftsInstagramMargin = ftsBlockCenteredAttr.attr('data-ftsi-margin');
292
+ // The margin without the px and we multiply it by 2 because the margin is on the left and right
293
+ var ftsInstagramMarginfinal = parseFloat(ftsInstagramMargin) * 2;
294
+ // Get the Instagram container .width() so we can keep track of the container size
295
+ var ftsContainerWidth = ftsBlockCenteredAttr.width();
296
+ // Force columns so the images to not scale up from 376px-736px.
297
+ // This keeps the aspect ratio for the columns and is in the if statements below where you will see ftsContainerWidth <= '376' && ftsForceColumns === 'no' and ftsContainerWidth <= '736' && ftsForceColumns === 'no'
298
+ var ftsForceColumns = ftsBlockCenteredAttr.attr('data-ftsi-force-columns');
299
+ // we or each option so if someone tries something other than that it will go to else statement
300
+ if (ftsInstagramColumns === '1' ||
301
+ ftsInstagramColumns === '2' ||
302
+ ftsInstagramColumns === '3' ||
303
+ ftsInstagramColumns === '4' ||
304
+ ftsInstagramColumns === '5' ||
305
+ ftsInstagramColumns === '6') {
306
+ // alert('wtf');
307
+ // if the container is 376px or less we force the image size to be 100%
308
+ if (ftsContainerWidth <= '376' && ftsForceColumns === 'no') {
309
+ var og_size = 'calc(100% - ' + ftsInstagramMarginfinal + 'px)';
310
+ }
311
+ // if the container is 736px or less we force the image size to be 50%
312
+ else if (ftsContainerWidth <= '736' && ftsForceColumns === 'no') {
313
+ var og_size = 'calc(50% - ' + ftsInstagramMarginfinal + 'px)';
314
+ }
315
+ else {
316
+ if (ftsInstagramColumns === '6') {
317
+ var og_size = 'calc(16.66666666666667% - ' + ftsInstagramMarginfinal + 'px)';
318
+ }
319
+ else if (ftsInstagramColumns === '5') {
320
+ var og_size = 'calc(20% - ' + ftsInstagramMarginfinal + 'px)';
321
+ }
322
+ else if (ftsInstagramColumns === '4') {
323
+ var og_size = 'calc(25% - ' + ftsInstagramMarginfinal + 'px)';
324
+ }
325
+ else if (ftsInstagramColumns === '3') {
326
+ var og_size = 'calc(33.33333333333333% - ' + ftsInstagramMarginfinal + 'px)';
327
+ }
328
+ else if (ftsInstagramColumns === '2') {
329
+ var og_size = 'calc(50% - ' + ftsInstagramMarginfinal + 'px)';
330
+ }
331
+ else if (ftsInstagramColumns === '1') {
332
+ var og_size = 'calc(100% - ' + ftsInstagramMarginfinal + 'px)';
333
+ }
334
+ }
335
+ var ftsYoutubeLargeHeight = ftsYoutubeLarge.height();
336
+ var ftsYoutubeLargeHeightFinal = 'calc(100% - ' + ftsYoutubeLargeHeight + 'px)';
337
+
338
+ ftsYoutubeThumbsWrap.css({'height': ftsYoutubeLargeHeight + 'px'});
339
+
340
+ ftsYoutubeImageSize.css({'width': og_size});
341
+
342
+ ftsYoutubeThumbsContainer.css({
343
+ 'padding': ftsInstagramMargin
344
+ });
345
+ var ftsImageHeightYoutube = ftsYoutubeImageSize.width() - '150';
346
+ ftsYoutubeImageSize.css({
347
+ 'width': og_size,
348
+ 'height': ftsImageHeightYoutube,
349
+ 'margin': ftsInstagramMargin
350
+ });
351
+ }
352
+
353
+ // If our image square is less than 180px then we hide the play button for the youtube feed
354
+ if (ftsYoutubeImageSize.width() < 180) {
355
+ jQuery('.slicker-youtube-placeholder').addClass('fts-youtube-smallerthan-180');
356
+
357
+ jQuery('.fts-yt-large, .fts-youtube-scrollable').css('width', '100% !important');
358
+
359
+ }
360
+ else {
361
+ jQuery('.slicker-youtube-placeholder').removeClass('fts-youtube-smallerthan-180');
362
+
363
+ }
364
+
365
+ var ftsYoutubeContainer = jQuery('.fts-master-youtube-wrap');
366
+ // If our image square is less than 180px then we hide the play button for the youtube feed
367
+ if (ftsYoutubeContainer.width() < 550) {
368
+ jQuery('.fts-yt-large, .fts-youtube-scrollable, .youtube-comments-wrap').addClass('fts-youtube-smallerthan-550-stack');
369
+
370
+ }
371
+ else {
372
+ jQuery('.fts-yt-large, .fts-youtube-scrollable, .youtube-comments-wrap').removeClass('fts-youtube-smallerthan-550-stack');
373
+
374
+ }
375
+ }
376
+
377
+ // Check each post for an external link and if so then run our function to get the image, title and
378
+ // description from the website and return it and format it nicely.
379
+ function fts_external_link_meta_content () {
380
+
381
+ jQuery('.fts-tweeter-wrap').each(function () {
382
+
383
+ var fts_url_wrap = jQuery( this ).find( '.fts-twitter-external-url-wrap' );
384
+
385
+ if ( fts_url_wrap.length > 0 ) {
386
+
387
+ // alert( fts_url_wrap );
388
+ var fts_security = fts_url_wrap.attr('data-twitter-security');
389
+ var fts_time = fts_url_wrap.attr('data-twitter-time');
390
+
391
+ var fts_url = fts_url_wrap.attr('data-twitter-url');
392
+ var fts_image_exists = fts_url_wrap.attr('data-image-exists-check');
393
+ var fts_no_video_image = fts_url_wrap.attr('data-no-video-image-check');
394
+ var fts_popup = fts_url_wrap.attr('data-twitter-popup');
395
+
396
+ console.log('url: ' + fts_url + ' Image exists: ' + fts_image_exists + ' No video image exists: ' + fts_no_video_image);
397
+
398
+ jQuery.ajax({
399
+ data: {
400
+ action: "fts_twitter_share_url_check",
401
+ fts_security: fts_security,
402
+ fts_time: fts_time,
403
+ fts_url: fts_url,
404
+ fts_image_exists: fts_image_exists,
405
+ fts_no_video_image: fts_no_video_image,
406
+ fts_popup: fts_popup,
407
+ },
408
+ type: 'POST',
409
+ url: fts_twitter_ajax.ajax_url,
410
+ success: function (data) {
411
+ fts_twitter = data;
412
+ fts_url_wrap.removeAttr( 'class data-twitter-security data-twitter-time' );
413
+
414
+ console.log("FTS Twitter external link success");
415
+ // console.log( data );
416
+
417
+ if( 'missing_info' === data ){
418
+ // Add a Error message to the attr data-error on the div. This way if people ask why the extra info is not
419
+ // showing we can look at the div and see if there is an error message :).
420
+ jQuery(fts_url_wrap).attr( 'data-error', 'Do not return any content, image, title or description missing' ).hide();
421
+ }
422
+ else {
423
+ jQuery(fts_url_wrap).html( data );
424
+ }
425
+
426
+ // Must be second to last so we can adjust the height of the image to the container if larger than our css min height.
427
+ ftsRetweetHeight();
428
+
429
+ // Lastly check to see if masonry is a function before we reloadItems and Layout.
430
+ // We need to do this when the grid is being used because the content takes a moment
431
+ // to load and sometimes the grid layout can overlap making the feed look like dukey.
432
+ // fts-slicker-twitter-posts is the class applied when grd=yes so we know masonry is loading.
433
+ if ( jQuery(".fts-slicker-twitter-posts")[0] ) {
434
+ jQuery(".fts-slicker-twitter-posts").masonry("reloadItems");
435
+ setTimeout(function () {
436
+ jQuery(".fts-slicker-twitter-posts").masonry("layout");
437
+ }, 500);
438
+ }
439
+ },
440
+ error: function (data, status, error) {
441
+ console.log(data);
442
+ console.log("AJAX errors: " + error);
443
+ },
444
+ }
445
+ );
446
+ }
447
+ });
448
+
449
+ return true;
450
+ }
451
+
452
+ // Find the height of the external link text wrapper and adjust the background image height
453
+ // so it always matches and the image and fits perfectly all the time.
454
+ function ftsRetweetHeight() {
455
+ if( jQuery('div').hasClass( 'fts-tweeter-wrap' ) ) {
456
+
457
+ var twitter_wrap = jQuery('.fts-tweeter-wrap');
458
+ if( '475' < twitter_wrap.width() ) {
459
+ console.log( 'Wrap width: ' + twitter_wrap.width() );
460
+ jQuery( '.fts-twitter-div' ).addClass( 'fts-twitter-wrap-below-width-450' );
461
+ jQuery( 'span.fts-twitter-external-backg-image' ).css({ 'background-size' : 'cover' } );
462
+
463
+
464
+ }
465
+ else {
466
+ jQuery( '.fts-twitter-div' ).removeClass( 'fts-twitter-wrap-below-width-450' );
467
+ jQuery( 'span.fts-twitter-external-backg-image' ).css({ 'background-size' : '0' } );
468
+ }
469
+
470
+ jQuery('.fts-twitter-quoted-text').each(function () {
471
+ var retweet_height = jQuery(this).height() + 20;
472
+ jQuery(this).parent().find('.fts-twitter-external-backg-image').css({'height': retweet_height + 'px'});
473
+ //alert( jQuery(this).find( '.fts-twitter-quoted-text' ).height() );
474
+ });
475
+ }
476
+ }
477
+ // Return our ftsRetweetHeight function after page has loaded to speed things up. Plus this way we can recall it in the loadmore areas of each feed instead of duplicating all the js.
478
+ jQuery(document).ready(ftsRetweetHeight);
479
+ jQuery(window).on('resize', ftsRetweetHeight);
feeds/twitter/class-fts-twitter-feed.php CHANGED
@@ -247,112 +247,112 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
247
  exit( 'Sorry, You can\'t do that!' );
248
  }
249
 
250
- $twitter_external_url = esc_url_raw( $_REQUEST['fts_url'] );
251
  $no_video_image_check = esc_html( $_REQUEST['fts_no_video_image'] );
252
  $fts_popup = esc_html( $_REQUEST['fts_popup'] );
253
 
254
- // echo ' test ';
255
- // A regular user posted photo or video is not allowed to pass here.
256
- if( 'true' === $no_video_image_check ){
257
-
258
- // There are 2 Types:
259
- // 1. Twitter card data. ie twitter:title, twitter:description, twitter:image.
260
- // 2. Site does not have Twitter info, so we can get the og:title, og:description, og:image
261
- // If 1 or 2 are not found then we return nothing.
262
-
263
- // FYI sometimes get_meta_tags will not work because a website/server will block it's usage.
264
- $tags = '' !== $twitter_external_url ? get_meta_tags( $twitter_external_url ) : '';
265
-
266
- // First try and us the get_meta_tags php function because this is quicker
267
- // Otherwise we use preg_match to find what we need from the <meta properties"og:image" for example.
268
- // More exceptions might need to be created but this is what's been done so far...
269
- if( !empty( $tags['twitter:image'] ) && true == $tags['twitter:image'] || !empty( $tags['twitter:image:src'] ) && true == $tags['twitter:image:src'] ){
270
-
271
- $property_image_url = isset( $tags['twitter:image:src'] ) && true == $tags['twitter:image:src'] ? $tags['twitter:image:src'] : $tags['twitter:image'];
272
- $property_image = true == $property_image_url ? $property_image_url : '';
273
- $property_title = true == $tags['twitter:title'] ? $tags['twitter:title'] :'';
274
- $property_description = true == $tags['twitter:description'] ? $tags['twitter:description'] : '';
275
- // echo ' twitter-card ';
276
- }
277
- else {
278
- // error_log( ' og image ' );
279
- // echo ' og image ';
280
-
281
- $html = $this->fts_get_feed_json( $twitter_external_url );
282
- if( !empty( $html['data'] ) ){
283
- // Try curl
284
- $html = $html['data'];
285
- // error_log( 'FTS: using curl to get external url, image, title & description');
286
- }
287
- elseif( ini_get('allow_url_fopen') ){
288
- // If curl fails try file get contents
289
- $html = file_get_contents( $twitter_external_url );
290
- // error_log( 'FTS: using file_get_contents');
291
- }
292
-
293
- // The first 2 are preg_match_all with single quotes '', the second 2 are with double quotes "". We have to check for both.
294
- // og:image
295
- if( true == preg_match_all( "/ content='(.*?)' property='og:image'/", $html, $matches ) ) {
296
- $property_image = $matches[ 1 ][ 0 ];
297
- }
298
- elseif ( true == preg_match_all( "/ property='og:image' content='(.*?)'/", $html, $matches ) ){
299
- $property_image = $matches[ 1 ][ 0 ];
300
- }
301
- elseif ( true == preg_match_all( '/ property="og:image" content="(.*?)"/', $html, $matches ) ){
302
- $property_image = $matches[ 1 ][ 0 ];
303
- }
304
- elseif ( true == preg_match_all( '/ content="(.*?)" property="og:image"/', $html, $matches ) ){
305
- $property_image = $matches[ 1 ][ 0 ];
306
- }
307
- else {
308
- $property_image = '';
309
- }
310
-
311
- // og:title
312
- if( true == preg_match_all( "/ content='(.*?)' property='og:title'/", $html, $matches2 ) ){
313
- $property_title = $matches2[ 1 ][ 0 ];
314
- }
315
- elseif ( true == preg_match_all( "/ property='og:title' content='(.*?)'/", $html, $matches2 ) ){
316
- $property_title = $matches2[ 1 ][ 0 ];
317
- }
318
- elseif ( true == preg_match_all( '/ property="og:title" content="(.*?)"/', $html, $matches2 ) ){
319
- $property_title = $matches2[ 1 ][ 0 ];
320
- }
321
- elseif ( true == preg_match_all( '/ content="(.*?)" property="og:title"/', $html, $matches2 ) ){
322
- $property_title = $matches2[ 1 ][ 0 ];
323
- }
324
- else {
325
- $property_title = '';
326
- }
327
-
328
- // og:description
329
- if( true == preg_match_all( "/ content='(.*?)' property='og:description'/", $html, $matches3 ) ){
330
- $property_description = $matches3[ 1 ][ 0 ];
331
- }
332
- elseif ( true == preg_match_all( "/ property='og:description' content='(.*?)'/", $html, $matches3 ) ){
333
- $property_description = $matches3[ 1 ][ 0 ];
334
- }
335
- elseif ( true == preg_match_all( '/ property="og:description" content="(.*?)"/', $html, $matches3 ) ){
336
- $property_description = $matches3[ 1 ][ 0 ];
337
- }
338
- elseif ( true == preg_match_all( '/ content="(.*?)" property="og:description"/', $html, $matches3 ) ){
339
- $property_description = $matches3[ 1 ][ 0 ];
340
- }
341
- else {
342
- $property_description = '';
343
- }
344
  }
345
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
 
347
  $twitter_info = array(
348
- 'post_url' => $twitter_external_url,
349
- 'image' => $property_image,
350
- 'title' => $property_title,
351
- 'description' => $property_description,
352
- 'popup' => $fts_popup,
353
- // adding this so when we check the ajax data output we have an error message so we can do something if
354
- // and image, title or description are not present. If so then we will not show the external link content in the post.
355
- 'error' => 'missing_info',
356
  );
357
 
358
  if( !empty( $twitter_info[ 'image' ] ) && !empty( $twitter_info[ 'title' ] ) && !empty( $twitter_info[ 'description' ] ) ){
247
  exit( 'Sorry, You can\'t do that!' );
248
  }
249
 
250
+ $twitter_external_url = esc_url( $_REQUEST['fts_url'] );
251
  $no_video_image_check = esc_html( $_REQUEST['fts_no_video_image'] );
252
  $fts_popup = esc_html( $_REQUEST['fts_popup'] );
253
 
254
+ // echo ' test ';
255
+ // A regular user posted photo or video is not allowed to pass here.
256
+ if( 'true' === $no_video_image_check ){
257
+
258
+ // There are 2 Types:
259
+ // 1. Twitter card data. ie twitter:title, twitter:description, twitter:image.
260
+ // 2. Site does not have Twitter info, so we can get the og:title, og:description, og:image
261
+ // If 1 or 2 are not found then we return nothing.
262
+
263
+ // FYI sometimes get_meta_tags will not work because a website/server will block it's usage.
264
+ $tags = '' !== $twitter_external_url ? get_meta_tags( $twitter_external_url ) : '';
265
+
266
+ // First try and us the get_meta_tags php function because this is quicker
267
+ // Otherwise we use preg_match to find what we need from the <meta properties"og:image" for example.
268
+ // More exceptions might need to be created but this is what's been done so far...
269
+ if( !empty( $tags['twitter:image'] ) && true == $tags['twitter:image'] || !empty( $tags['twitter:image:src'] ) && true == $tags['twitter:image:src'] ){
270
+
271
+ $property_image_url = isset( $tags['twitter:image:src'] ) && true == $tags['twitter:image:src'] ? $tags['twitter:image:src'] : $tags['twitter:image'];
272
+ $property_image = true == $property_image_url ? $property_image_url : '';
273
+ $property_title = true == $tags['twitter:title'] ? $tags['twitter:title'] :'';
274
+ $property_description = true == $tags['twitter:description'] ? $tags['twitter:description'] : '';
275
+ // echo ' twitter-card ';
276
+ }
277
+ else {
278
+ // error_log( ' og image ' );
279
+ // echo ' og image ';
280
+
281
+ $html = $this->fts_get_feed_json( $twitter_external_url );
282
+ if( !empty( $html['data'] ) ){
283
+ // Try curl
284
+ $html = $html['data'];
285
+ // error_log( 'FTS: using curl to get external url, image, title & description');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  }
287
+ elseif( ini_get('allow_url_fopen') ){
288
+ // If curl fails try file get contents
289
+ $html = file_get_contents( $twitter_external_url );
290
+ // error_log( 'FTS: using file_get_contents');
291
+ }
292
+
293
+ // The first 2 are preg_match_all with single quotes '', the second 2 are with double quotes "". We have to check for both.
294
+ // og:image
295
+ if( true == preg_match_all( "/ content='(.*?)' property='og:image'/", $html, $matches ) ) {
296
+ $property_image = $matches[ 1 ][ 0 ];
297
+ }
298
+ elseif ( true == preg_match_all( "/ property='og:image' content='(.*?)'/", $html, $matches ) ){
299
+ $property_image = $matches[ 1 ][ 0 ];
300
+ }
301
+ elseif ( true == preg_match_all( '/ property="og:image" content="(.*?)"/', $html, $matches ) ){
302
+ $property_image = $matches[ 1 ][ 0 ];
303
+ }
304
+ elseif ( true == preg_match_all( '/ content="(.*?)" property="og:image"/', $html, $matches ) ){
305
+ $property_image = $matches[ 1 ][ 0 ];
306
+ }
307
+ else {
308
+ $property_image = '';
309
+ }
310
+
311
+ // og:title
312
+ if( true == preg_match_all( "/ content='(.*?)' property='og:title'/", $html, $matches2 ) ){
313
+ $property_title = $matches2[ 1 ][ 0 ];
314
+ }
315
+ elseif ( true == preg_match_all( "/ property='og:title' content='(.*?)'/", $html, $matches2 ) ){
316
+ $property_title = $matches2[ 1 ][ 0 ];
317
+ }
318
+ elseif ( true == preg_match_all( '/ property="og:title" content="(.*?)"/', $html, $matches2 ) ){
319
+ $property_title = $matches2[ 1 ][ 0 ];
320
+ }
321
+ elseif ( true == preg_match_all( '/ content="(.*?)" property="og:title"/', $html, $matches2 ) ){
322
+ $property_title = $matches2[ 1 ][ 0 ];
323
+ }
324
+ else {
325
+ $property_title = '';
326
+ }
327
+
328
+ // og:description
329
+ if( true == preg_match_all( "/ content='(.*?)' property='og:description'/", $html, $matches3 ) ){
330
+ $property_description = $matches3[ 1 ][ 0 ];
331
+ }
332
+ elseif ( true == preg_match_all( "/ property='og:description' content='(.*?)'/", $html, $matches3 ) ){
333
+ $property_description = $matches3[ 1 ][ 0 ];
334
+ }
335
+ elseif ( true == preg_match_all( '/ property="og:description" content="(.*?)"/', $html, $matches3 ) ){
336
+ $property_description = $matches3[ 1 ][ 0 ];
337
+ }
338
+ elseif ( true == preg_match_all( '/ content="(.*?)" property="og:description"/', $html, $matches3 ) ){
339
+ $property_description = $matches3[ 1 ][ 0 ];
340
+ }
341
+ else {
342
+ $property_description = '';
343
+ }
344
+ }
345
+ }
346
 
347
  $twitter_info = array(
348
+ 'post_url' => $twitter_external_url,
349
+ 'image' => esc_html( $property_image ),
350
+ 'title' => esc_html( $property_title ),
351
+ 'description' => esc_html( $property_description ),
352
+ 'popup' => esc_html( $fts_popup ),
353
+ // adding this so when we check the ajax data output we have an error message so we can do something if
354
+ // and image, title or description are not present. If so then we will not show the external link content in the post.
355
+ 'error' => 'missing_info',
356
  );
357
 
358
  if( !empty( $twitter_info[ 'image' ] ) && !empty( $twitter_info[ 'title' ] ) && !empty( $twitter_info[ 'description' ] ) ){
feeds/youtube/class-youtube-feed-free.php CHANGED
@@ -61,10 +61,6 @@ class FTS_Youtube_Feed_Free extends feed_them_social_functions {
61
  */
62
  public function fts_youtube_func( $atts ) {
63
 
64
- $fts_fb_options_nonce = wp_create_nonce( 'fts-instagram-options-page-nonce' );
65
-
66
- if ( wp_verify_nonce( $fts_fb_options_nonce, 'fts-instagram-options-page-nonce' ) ) {
67
-
68
  global $channel_id, $playlist_id, $username_subscribe_btn, $username;
69
 
70
  $youtube_api_key = get_option( 'youtube_custom_api_token' );
@@ -805,26 +801,20 @@ class FTS_Youtube_Feed_Free extends feed_them_social_functions {
805
  } else {
806
  print 'Please add an access token to the Youtube Options page of Feed Them Social.';
807
  }
808
- }
809
  }
810
 
811
  /**
812
- * Get FTS Dnamic Class Name
813
  *
814
  * @return string
815
  * @since 1.9.6
816
  */
817
  public function get_fts_dynamic_class_name() {
818
- $fts_dynamic_name_nonce = wp_create_nonce( 'fts-dynamic-name-nonce' );
819
-
820
- if ( wp_verify_nonce( $fts_dynamic_name_nonce, 'fts-dynamic-name-nonce' ) ) {
821
- $fts_dynamic_class_name = '';
822
- if ( isset( $_REQUEST['fts_dynamic_name'] ) ) {
823
- $fts_dynamic_class_name = 'feed_dynamic_class' . sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) );
824
- }
825
- return $fts_dynamic_class_name;
826
- }
827
- exit;
828
  }
829
 
830
  /**
61
  */
62
  public function fts_youtube_func( $atts ) {
63
 
 
 
 
 
64
  global $channel_id, $playlist_id, $username_subscribe_btn, $username;
65
 
66
  $youtube_api_key = get_option( 'youtube_custom_api_token' );
801
  } else {
802
  print 'Please add an access token to the Youtube Options page of Feed Them Social.';
803
  }
 
804
  }
805
 
806
  /**
807
+ * Get FTS Dynamic Class Name
808
  *
809
  * @return string
810
  * @since 1.9.6
811
  */
812
  public function get_fts_dynamic_class_name() {
813
+ $fts_dynamic_class_name = '';
814
+ if ( isset( $_REQUEST['fts_dynamic_name'] ) ) {
815
+ $fts_dynamic_class_name = 'feed_dynamic_class' . sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) );
816
+ }
817
+ return $fts_dynamic_class_name;
 
 
 
 
 
818
  }
819
 
820
  /**
includes/feed-them-functions.php CHANGED
@@ -39,6 +39,7 @@ class feed_them_social_functions {
39
  add_action( 'wp_ajax_fts_clear_cache_ajax', array( $this, 'fts_clear_cache_ajax' ) );
40
  }
41
  add_action( 'wp_ajax_fts_encrypt_token_ajax', array( $this, 'fts_encrypt_token_ajax' ) );
 
42
 
43
  add_action( 'wp_ajax_fts_refresh_token_ajax', array( $this, 'fts_refresh_token_ajax' ) );
44
  add_action( 'wp_ajax_nopriv_fts_refresh_token_ajax', array( $this, 'fts_refresh_token_ajax' ) );
@@ -180,19 +181,41 @@ class feed_them_social_functions {
180
  */
181
  public function fts_instagram_token_ajax() {
182
 
183
- $fts_refresh_token_nonce = wp_create_nonce( 'fts_token_nonce' );
184
- $access_token = $_REQUEST['access_token'];
 
 
 
 
 
 
 
 
 
185
  $user_id = $_REQUEST['user_id'];
186
  $expires_in = $_REQUEST['expires_in'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
 
188
- if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_token_nonce' ) ) {
189
- if ( isset( $access_token ) ) {
190
- update_option( 'fts_instagram_custom_api_token', sanitize_text_field( $access_token ) );
191
- update_option( 'fts_instagram_custom_id', sanitize_text_field( $user_id ) );
192
- update_option( 'fts_instagram_custom_api_token_expires_in', sanitize_text_field( $expires_in ) );
193
- }
194
- }
195
- die;
196
  }
197
 
198
  /**
@@ -204,31 +227,39 @@ class feed_them_social_functions {
204
  */
205
  public function fts_encrypt_token_ajax() {
206
 
207
- $fts_refresh_token_nonce = wp_create_nonce( 'fts_encrypt_token_nonce' );
208
- $access_token = $_REQUEST['access_token'];
209
- $encrypt = $this->data_protection->encrypt( $access_token );
 
210
 
211
- if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_encrypt_token_nonce' ) ) {
212
- if( 'business' === $_REQUEST['token_type'] ){
213
- // Now the encrypted version is saved to the DB.
214
- update_option( 'fts_facebook_instagram_custom_api_token', sanitize_text_field( $encrypt ) );
215
- }
216
- elseif ( 'basic' === $_REQUEST['token_type'] ) {
217
- // Now the encrypted version is saved to the DB.
218
- update_option( 'fts_instagram_custom_api_token', sanitize_text_field( $encrypt ) );
219
- }
220
- elseif( 'fbBusiness' === $_REQUEST['token_type'] ){
221
- // Now the encrypted version is saved to the DB.
222
- update_option( 'fts_facebook_custom_api_token', sanitize_text_field( $encrypt ) );
223
- }
224
- elseif( 'fbBusinessReviews' === $_REQUEST['token_type'] ){
225
- // Now the encrypted version is saved to the DB.
226
- update_option( 'fts_facebook_custom_api_token_biz', sanitize_text_field( $encrypt ) );
227
- }
 
 
228
  }
 
 
 
 
 
229
  $token_data = array (
230
- 'token' => $access_token,
231
- 'encrypted' => $encrypt,
232
  );
233
 
234
  // We pass the original access token back so we can add it to our input field.
@@ -248,47 +279,43 @@ class feed_them_social_functions {
248
  */
249
  public function feed_them_instagram_save_token() {
250
 
251
- $fts_refresh_token_nonce = wp_create_nonce( 'access_token' );
 
252
 
253
- if ( wp_verify_nonce( $fts_refresh_token_nonce, 'access_token' ) ) {
 
 
 
 
 
254
  $raw_token = $_GET['code'];
255
- $feed_type = $_GET['feed_type'];
256
- $user_id = $_GET['user_id'];
257
- $expires_in = $_GET['expires_in'];
258
 
259
  if ( isset( $raw_token ) && 'original_instagram' === $feed_type || isset( $raw_token ) && 'instagram_basic' === $feed_type ) {
260
- $encrypted_token = $this->data_protection->encrypt( $raw_token );
261
  // error_log( print_r( $encrypted_token, true ) );
262
 
263
  ?>
264
  <script>
265
  jQuery(document).ready(function () {
266
 
267
- var access_token = '<?php echo sanitize_text_field( $encrypted_token ); ?>';
268
- var user_id = '<?php echo sanitize_text_field( $user_id ); ?>';
269
-
270
- // Take the time() + $expires_in will equal the current date and time in seconds plus 60 days in seconds.
271
- // For now we are going to get a new token every 7 days just to be on the safe side.
272
- // That means we will negate 53 days from the seconds which is 4579200 <-- https://www.convertunits.com/from/60+days/to/seconds
273
- // We get 60 days to refresh the token, if it's not refreshed before then it will expire.
274
- var expires_in = '<?php echo sanitize_text_field( time() + $expires_in - 4579200 ); ?>';
275
-
276
  jQuery.ajax({
277
  data: {
278
  action: 'fts_instagram_token_ajax',
279
- access_token: access_token,
280
- user_id: user_id,
281
- expires_in: expires_in,
 
 
 
282
  },
283
  type: 'POST',
284
  url: ftsAjax.ajaxurl,
285
  success: function (response) {
286
- <?php
287
- $insta_url = 'instagram_basic' === $feed_type ? esc_url_raw( 'https://graph.instagram.com/me?fields=id,username&access_token=' . $raw_token ) : esc_url( 'https://api.instagram.com/v1/users/self/?access_token=' . $raw_token );
288
 
289
- // Get Data for Instagram to check for errors!
290
- $response = wp_remote_fopen( $insta_url );
291
- $test_app_token_response = json_decode( $response );
292
 
293
  // 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.
294
  if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
@@ -296,37 +323,39 @@ class feed_them_social_functions {
296
  } else {
297
  $custom_instagram_link_hash = '#feed_type=instagram';
298
  }
299
- if ( ! isset( $test_app_token_response->meta->error_message ) && ! isset( $test_app_token_response->error_message ) || isset( $test_app_token_response->meta->error_message ) && 'This client has not been approved to access this resource.' === $test_app_token_response->meta->error_message ) {
300
- $fts_instagram_message = sprintf(
 
 
 
301
  esc_html__( '%1$sYour access token is working! Generate your shortcode on the %2$sSettings Page%3$s', 'feed-them-social' ),
302
  '<div class="fts-successful-api-token">',
303
  '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' . $custom_instagram_link_hash ) . '">',
304
- '</a></div>'
305
  );
306
  ?>
307
- jQuery('.instagram-failed-message').hide();
308
- if (!jQuery('.fts-instagram-last-row .fts-successful-api-token').length) {
309
- jQuery('.fts-instagram-last-row').append('<?php echo $fts_instagram_message; ?>');
 
 
 
 
 
310
  }
311
- jQuery('.fts-success').show();
312
- <?php
313
- } elseif ( isset( $test_app_token_response->meta->error_message ) || isset( $test_app_token_response->error_message ) ) {
314
- $text = isset( $test_app_token_response->meta->error_message ) ? $test_app_token_response->meta->error_message : $test_app_token_response->error_message;
315
  $fts_instagram_message = sprintf(
316
- esc_html__( '%1$sOh No something\'s wrong. %2$s. Please try clicking the button again to get a new access token. If you need additional assistance please email us at support@slickremix.com %3$s.', 'feed-them-social' ),
317
  '<div class="fts-failed-api-token">',
318
- esc_html( $text ),
319
- '</div>'
320
  );
321
  ?>
322
- if (jQuery('.instagram-failed-message').length) {
323
- jQuery('.instagram-failed-message').hide();
324
- jQuery('.fts-instagram-last-row').append('<?php echo $fts_instagram_message; ?>');
325
- }
326
- <?php
327
- }
328
- ?>
329
- console.log( 'success saving instagram access token: Encrypted Token: <?php echo $encrypted_token ?>' );
330
  }
331
  }); // end of ajax()
332
  return false;
@@ -334,7 +363,6 @@ class feed_them_social_functions {
334
  </script>
335
  <?php
336
  }
337
- }
338
  }
339
 
340
  /**
@@ -401,432 +429,432 @@ class feed_them_social_functions {
401
  * @since 2.1.4
402
  */
403
  public function fts_fb_page_token_func() {
404
- $fts_fb_page_token_users_nonce = wp_create_nonce( 'fts-fb-page-token-users-nonce' );
405
 
406
- if ( wp_verify_nonce( $fts_fb_page_token_users_nonce, 'fts-fb-page-token-users-nonce' ) ) {
 
 
407
 
408
- // Make sure it's not ajaxing!
409
- if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
410
- $_REQUEST['fts_dynamic_name'] = sanitize_key( $this->feed_them_social_rand_string() );
411
- } //End make sure it's not ajaxing!
412
 
413
- ob_start();
414
 
415
- if ( ! isset( $_GET['locations'] ) ) {
416
 
417
- // SRL 4-23-22. Locations: This endpoint is not supported for Pages that have been migrated to the New Pages Experience. So we need to make an exception.
418
- $fb_url = 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] ? wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=locations{name,id,page_username,locations,store_number,store_location_descriptor,access_token},name,id,link,has_transitioned_to_new_page_experience,access_token&access_token=' . $_GET['code'] . '&limit=500' ) : wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=instagram_business_account{id,username,profile_picture_url},locations{instagram_business_account{profile_picture_url,id,username},name,id,page_username,locations,store_number,store_location_descriptor,access_token},name,id,link,access_token&access_token=' . $_GET['code'] . '&limit=500' );
419
 
420
- $test_fb_app_token_response = json_decode( $fb_url );
421
 
422
- // SRL 4-23-22. For now we are just going to check for error, if error then that would mean the first object in array is a new page experience.
423
- // if is new page has_transitioned_to_new_page_experience => 1 This could be expanded in the future by creating a foreach loops to check each page
424
- // but then you have to run a call for each page and that seems like overkill if you have hundreds of pages. FB should come up with a simpler way.
425
- if( $test_fb_app_token_response->error ){
426
- // Possibly the user is on a new page experience so let's run the call without locations.
427
- $fb_url = 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] ? wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=has_transitioned_to_new_page_experience,name,id,link,access_token&access_token=' . $_GET['code'] . '&limit=500' ) : wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=has_transitioned_to_new_page_experience,instagram_business_account{id,username,profile_picture_url},name,id,link,access_token&access_token=' . $_GET['code'] . '&limit=500' );
428
 
429
- }
430
- $fb_token_response = isset( $_REQUEST['next_url'] ) ? wp_remote_fopen( esc_url_raw( $_REQUEST['next_url'] ) ) : $fb_url;
431
- $test_fb_app_token_response = json_decode( $fb_token_response );
432
 
433
- // Test.
434
- //print_r( $test_fb_app_token_response );
435
 
436
- $_REQUEST['next_url'] = isset( $test_fb_app_token_response->paging->next ) ? esc_url_raw( $test_fb_app_token_response->paging->next ) : '';
437
- } else {
438
- $fb_token_response = isset( $_REQUEST['next_location_url'] ) ? wp_remote_fopen( esc_url_raw( $_REQUEST['next_location_url'] ) ) : '';
439
- $test_fb_app_token_response = json_decode( $fb_token_response );
440
- }
441
 
442
- // IF we still get an error then show a formatted response for the user.
443
- if( !empty( $test_fb_app_token_response->error ) ){
444
- echo '<div style="max-width: 570px; word-wrap: break-word;margin:10px 10px 0 10px;">';
445
- echo '<p>';
446
- echo '<strong>Facebook Response: </strong>';
447
- echo $test_fb_app_token_response->error->message . ' Code #';
448
- echo $test_fb_app_token_response->error->code . '. ';
449
- echo $test_fb_app_token_response->error->error_user_title;
450
- echo $test_fb_app_token_response->error->error_user_msg;
451
-
452
- if( 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] ){
453
- echo '</p> <strong>Helpful Tips:</strong> Make sure you are an admin of the page or pages you are choosing. Next you will see, "What SlickRemix is allowed to do." The 2 options should be, Read content posted on the Page and Show a list of the Pages you manage. Make sure and choose Yes for both.<a href="#" style="display: none" target="_blank">More Tips</a>';
454
- }
455
- if( 'fts-instagram-feed-styles-submenu-page' === $_GET['page'] ) {
456
- echo '</p> <strong>Helpful Tips:</strong> Make sure you are an admin of the page or pages you are choosing. Next you will see, "What SlickRemix is allowed to do." The 3 options should be, Access profile and posts from the Instagram account connected to your Page, Read content posted on the Page and Show a list of the Pages you manage. Make sure and choose Yes for all 3.<a href="#" style="display: none" target="_blank">More Tips</a>';
457
- }
458
- echo '</div>';
459
- return false;
460
  }
 
 
 
 
 
 
461
 
462
- // Make sure it's not ajaxing!
463
- if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
464
- // ******************
465
- // Load More BUTTON Start
466
- // ******************
467
- ?>
468
- <div class="fts-clear"></div>
469
- <?php
470
- } //End make sure it's not ajaxing!
471
-
472
- $build_shortcode = 'fts_fb_page_token';
473
-
474
- // Make sure it's not ajaxing!
475
- if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
476
-
477
- $reviews_token = isset( $_GET['reviews_token'] ) ? 'yes' : 'no';
478
- ?>
479
- <div id="fb-list-wrap">
480
- <div class="fts-pages-info"> <?php echo esc_html__( 'Click on a page in the list below and it will add the Page ID and Access Token above, then click save.', 'feed-them-social' ); ?></div>
481
- <ul class="fb-page-list fb-page-master-list">
482
- <?php
483
- } //End make sure it's not ajaxing!
484
-
485
- foreach ( $test_fb_app_token_response->data as $data ) {
486
-
487
- // if( !empty( $data->instagram_business_account ) ){
488
- $data_id = isset( $data->instagram_business_account ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? $data->instagram_business_account->id : $data->id;
489
- $data_user_name = isset( $data->instagram_business_account ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? '<span class="fts-insta-icon"></span>' . $data->instagram_business_account->username . '<span class="fts-arrow-icon"></span><span class="fts-fb-icon"></span>' . $data->name : $data->name;
490
- $data_thumbnail = isset( $data->instagram_business_account->profile_picture_url ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? $data->instagram_business_account->profile_picture_url : 'https://graph.facebook.com/' . $data->id . '/picture';
491
- ?>
492
- <li class="fts-fb-main-page-li">
493
- <div class="fb-click-wrapper">
494
- <div class="fb-image">
495
- <img border="0" height="50" width="50"
496
- src="<?php echo esc_url( $data_thumbnail ); ?>"/>
497
- </div>
498
- <div class="fb-name-wrap"><span class="fb-name">
499
- <?php
500
- echo $data_user_name;
501
- if ( isset( $data->store_number, $data->store_location_descriptor ) ) {
502
- print '(' . $data->store_location_descriptor . ')';
503
- }
504
- ?>
505
- </span></div>
506
- <div class="fb-other-wrap">
507
- <small>
508
- <?php echo esc_html__( 'ID: ', 'feed-them-social' ); ?>
509
- <span class="fts-api-facebook-id"><?php echo esc_html( $data_id ); ?></span>
510
- <?php echo isset( $data->store_number ) ? esc_html( '| Location: ' . $data->store_number, 'feed-them-social' ) : ''; ?>
511
- </small>
512
- </div>
513
- <div class="page-token"><?php echo esc_attr( $data->access_token ); ?></div>
514
- <?php
515
- $facebook_input_token = $this->get_fb_access_token();
516
- $facebook_access_token = $data->access_token;
517
- if ( $facebook_input_token === $facebook_access_token ) {
518
- ?>
519
- <div class="feed-them-social-admin-submit-btn " style="display: block !important;">
520
- Active
521
- </div>
522
- <?php } else { ?>
523
- <div class="feed-them-social-admin-submit-btn fts-token-save">Save</div>
524
- <?php } ?>
525
- <div class="fts-clear"></div>
526
- </div>
527
- <?php
528
- $_REQUEST['next_location_url'] = isset( $data->locations->paging->next ) ? esc_url_raw( $data->locations->paging->next ) : '';
529
- $remove_class_or_not = isset( $data->locations->paging->next ) ? 'fb-sublist-page-id-' . esc_attr( $data_id ) : '';
530
- if ( isset( $data->locations->data ) ) {
531
- $location_count = count( $data->locations->data );
532
- $location_plus_sign = isset( $data->locations->paging->next ) ? '+' : '';
533
- $location_text = 1 === $location_count ? esc_html( $location_count . ' ' . esc_html__( 'Location for', 'feed-them-social' ) ) : esc_html( $location_count . $location_plus_sign . ' ' . esc_html__( 'Locations for', 'feed-them-social' ) );
534
- // if the locations equal 3 or less we will set the location container height to auto so the scroll loadmore does not fire.
535
- $location_scroll_loadmore_needed_check = $location_count <= 3 ? 'height:auto !important' : 'height: 200px !important;';
536
- }
537
 
538
- if ( ! isset( $_GET['locations'] ) && isset( $data->locations->data ) ) {
539
- ?>
540
- <div class="fts-fb-location-text-wrap"><?php echo esc_html( $location_text . ' ' . $data->name ); ?></div>
541
- <ul class="fb-page-list fb-sublist <?php echo esc_attr( $remove_class_or_not ); ?>"
542
- style="<?php echo esc_attr( $location_scroll_loadmore_needed_check ); ?>">
543
- <?php
544
- foreach ( $data->locations->data as $location ) {
545
-
546
- // if ( !empty( $location->instagram_business_account ) ) {
547
- $loc_data_id = isset( $location->instagram_business_account ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? $location->instagram_business_account->id : $location->id;
548
- $loc_data_user_name = isset( $location->instagram_business_account ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? '<span class="fts-insta-icon"></span>' . $location->instagram_business_account->username . '<span class="fts-arrow-icon"></span><span class="fts-fb-icon"></span>' . $location->name : $location->name;
549
- $loc_data_thumbnail = isset( $location->instagram_business_account->profile_picture_url ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? $location->instagram_business_account->profile_picture_url : 'https://graph.facebook.com/' . $location->id . '/picture';
550
-
551
- ?>
552
- <li>
553
- <div class="fb-click-wrapper">
554
- <div class="fb-image">
555
- <img border="0" height="50" width="50"
556
- src="<?php echo esc_url( $loc_data_thumbnail ); ?>"/>
557
- </div>
558
- <div class="fb-name-wrap"><span
559
- class="fb-name"><?php echo $loc_data_user_name; ?>
560
- <?php
561
- if ( isset( $location->store_location_descriptor ) ) {
562
- echo '(' . esc_html( $location->store_location_descriptor ) . ')';
563
- }
564
- ?>
565
- </span></div>
566
- <div class="fb-other-wrap">
567
- <small>
568
- <?php echo esc_html__( 'ID: ', 'feed-them-social' ); ?>
569
- <span class="fts-api-facebook-id"><?php echo esc_html( $loc_data_id ); ?></span>
570
- <?php
571
- if ( isset( $location->store_number ) ) {
572
- print '| ';
573
- esc_html__( 'Location:', 'feed-them-social' );
574
- print ' ' . esc_html( $location->store_number );
575
- }
576
- ?>
577
- </small>
578
- </div>
579
-
580
- <div class="page-token"><?php echo esc_html( $location->access_token ); ?></div>
581
- <?php
582
- $facebook_input_token = $this->get_fb_access_token();
583
- $facebook_access_token = $location->access_token;
584
- if ( $facebook_input_token === $facebook_access_token ) {
585
- ?>
586
- <div class="feed-them-social-admin-submit-btn "
587
- style="display: block !important;">Active
588
- </div>
589
- <?php } else { ?>
590
- <div class="feed-them-social-admin-submit-btn fts-token-save">
591
- Save
592
- </div>
593
- <?php } ?>
594
- <div class="fts-clear"></div>
595
- </div>
596
- </li>
597
-
598
- <?php
599
- // }
600
- }
601
- ?>
602
- </ul>
603
 
604
- <?php
605
- // Make sure it's not ajaxing locations!
606
- if ( ! isset( $_GET['locations'] ) && isset( $data->locations->paging->next ) ) {
607
- echo '<div id="loadMore_' . esc_attr( $data_id ) . '_location" class="fts-fb-load-more" style="background:none !Important;">' . esc_html__( 'Scroll to view more Locations', 'feed-them-instagram' ) . '</div>';
608
- }//End Check
609
-
610
- // Make sure it's not ajaxing locations!
611
- if ( ! isset( $_GET['locations'] ) ) {
612
- $time = time();
613
- $nonce = wp_create_nonce( $time . 'load-more-nonce' );
614
- $fb_page_id = $data_id;
615
- ?>
616
- <script>
617
- jQuery(document).ready(function () {
618
- jQuery(".fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>").bind("scroll", function () {
619
- if (jQuery(this).scrollTop() + jQuery(this).innerHeight() >= jQuery(this)[0].scrollHeight) {
620
- if (!jQuery('.fts-no-more-locations-<?php echo esc_js( $fb_page_id ); ?>').length) {
621
- jQuery("#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location").addClass('fts-fb-spinner');
622
- var button = jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
623
- console.log(button);
624
- var build_shortcode = "<?php echo esc_js( $build_shortcode ); ?>";
625
- var yes_ajax = "yes";
626
- var fts_d_name = "<?php echo esc_js( $fb_page_id ); ?>";
627
- var fts_security = "<?php echo esc_js( $nonce ); ?>";
628
- var fts_time = "<?php echo esc_js( $time ); ?>";
629
- var fts_reviews_feed = "<?php echo esc_js( $reviews_token ); ?>";
630
- jQuery.ajax({
631
- data: {
632
- action: "my_fts_fb_load_more",
633
- next_location_url: nextURL_location_<?php echo esc_js( $fb_page_id ); ?>,
634
- fts_dynamic_name: fts_d_name,
635
- rebuilt_shortcode: build_shortcode,
636
- load_more_ajaxing: yes_ajax,
637
- fts_security: fts_security,
638
- fts_time: fts_time,
639
- feed_name: build_shortcode,
640
- fts_reviews_feed: fts_reviews_feed,
641
- locations: 'yes'
642
- },
643
- type: 'GET',
644
- url: ajaxurl,
645
- success: function (data) {
646
- console.log('Well Done and got this from sever: ' + data);
647
- jQuery('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').append(data).filter('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').html();
648
- jQuery('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').animate({scrollTop: '+=100px'}, 800); // scroll down a 100px after new items are added
649
-
650
- <?php if ( isset( $data->locations->paging->next ) && $data->locations->paging->next === $_REQUEST['next_location_url'] ) { ?>
651
- jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb fts-no-more-locations-<?php echo esc_js( $fb_page_id ); ?>" style="background:none !important"><?php echo esc_html( 'All Locations loaded', 'feed-them-social' ); ?></div>');
652
- jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').removeAttr('id');
653
- <?php } ?>
654
- jQuery("#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location").removeClass('fts-fb-spinner');
655
- }
656
- }); // end of ajax()
657
- return false;
658
-
659
- } //stop ajax from submitting again if the fts-no-more-locations class is found
660
-
661
- }
662
- }); // end of form.submit
663
-
664
- }); // end of document.ready
665
- </script>
666
- <?php
667
- } //END Make sure it's not ajaxing locations
668
- ?>
669
- <script>var nextURL_location_<?php echo esc_js( $fb_page_id ); ?>= "<?php echo isset( $data->locations->paging->next ) ? esc_url_raw( $data->locations->paging->next ) : ''; ?>";</script>
670
- <?php } ?>
671
- </li>
672
 
673
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
674
 
675
- // }
676
- } // foreach loop of locations
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
 
678
- // Make sure it's not ajaxing!
679
- if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
680
- ?>
681
- </ul>
682
- <div class="fts-clear"></div>
683
- </div>
684
- <?php
685
- } //End make sure it's not ajaxing
686
-
687
- // Make sure it's not ajaxing!
688
- if ( ! isset( $_GET['load_more_ajaxing'] ) && ! isset( $_GET['locations'] ) ) {
689
- $fts_dynamic_name = isset( $_REQUEST['fts_dynamic_name'] ) ? sanitize_key( $_REQUEST['fts_dynamic_name'] ) : '';
690
- $time = time();
691
- $nonce = wp_create_nonce( $time . 'load-more-nonce' );
692
- ?>
693
- <script>
694
- jQuery(document).ready(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
 
696
- jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").click(function () {
697
-
698
- jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").addClass('fts-fb-spinner');
699
- var button = jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
700
- console.log(button);
701
- var build_shortcode = "<?php echo esc_js( $build_shortcode ); ?>";
702
- var yes_ajax = "yes";
703
- var fts_d_name = "<?php echo esc_js( $fts_dynamic_name ); ?>";
704
- var fts_security = "<?php echo esc_js( $nonce ); ?>";
705
- var fts_time = "<?php echo esc_js( $time ); ?>";
706
- var fts_reviews_feed = "<?php echo esc_js( $reviews_token ); ?>";
707
- jQuery.ajax({
708
- data: {
709
- action: "my_fts_fb_load_more",
710
- next_url: nextURL_<?php echo esc_js( $fts_dynamic_name ); ?>,
711
- fts_dynamic_name: fts_d_name,
712
- rebuilt_shortcode: build_shortcode,
713
- load_more_ajaxing: yes_ajax,
714
- fts_security: fts_security,
715
- fts_time: fts_time,
716
- feed_name: build_shortcode,
717
- fts_reviews_feed: fts_reviews_feed
718
- },
719
- type: 'GET',
720
- url: ajaxurl,
721
- success: function (data) {
722
- console.log('Well Done and got this from sever: ' + data);
723
- jQuery('.fb-page-master-list').append(data).filter('.fb-page-list').html();
724
-
725
- if (!nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?> || 'no more' === nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>) {
726
- jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb"><?php echo esc_js( 'No More Pages', 'feed-them-social' ); ?></div>');
727
- jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').removeAttr('id');
728
- }
729
- jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').html('<?php echo esc_js( 'Load More', 'feed-them-social' ); ?>');
730
- // jQuery('#loadMore_< ?php echo $fts_dynamic_name ?>').removeClass('flip360-fts-load-more');
731
- jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").removeClass('fts-fb-spinner');
732
 
 
 
733
 
734
- }
735
- }); // end of ajax()
736
- return false;
737
- }); // end of form.submit
738
- }); // end of document.ready
739
- </script>
740
- <?php
 
741
 
742
- } //END Make sure it's not ajaxing
743
- ?>
744
- <script>
745
- <?php if ( ! isset( $_GET['locations'] ) ) { ?>
746
- var nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>= "<?php echo esc_url_raw( $_REQUEST['next_url'] ); ?>";
747
- // alert('nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>');
748
- <?php } ?>
 
749
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
750
 
751
- if (document.querySelector('#fts-fb-token-wrap .fts-pages-info') !== null) {
752
- jQuery(".fts-successful-api-token.default-token").hide();
753
- }
754
- <?php if ( 'yes' === $reviews_token || isset( $_GET['fts_reviews_feed'] ) && 'yes' === $_GET['fts_reviews_feed'] ) { ?>
755
- if (document.querySelector('.default-token') !== null) {
756
- jQuery(".default-token").show();
757
- }
758
 
759
- <?php } ?>
 
 
 
 
 
 
760
 
761
- jQuery(document).ready(function ($) {
762
- $(".feed-them-social-admin-submit-btn").click(function () {
763
- // alert('test');
764
- var newUrl = "<?php echo esc_url( admin_url( 'admin.php?page=fts-facebook-feed-styles-submenu-page/' ) ); ?>";
765
- history.replaceState({}, null, newUrl);
766
- <?php if ( 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] ) { ?>
767
- $("#fts-facebook-feed-options-form").submit();
768
- <?php
769
- } elseif ( 'fts-instagram-feed-styles-submenu-page' === $_GET['page'] ) {
770
- ?>
771
- $("#fts-instagram-feed-options-form").submit();
772
- <?php } ?>
773
- });
774
-
775
- var fb = ".fb-page-list .fb-click-wrapper";
776
- $('#fb-list-wrap').show();
777
- //alert("reviews_token");
778
-
779
- $(fb).click(function () {
780
- var fb_page_id = $(this).find('.fts-api-facebook-id').html();
781
- var token = $(this).find('.page-token').html();
782
-
783
- // alert(token);
784
- var name = $(this).find('.fb-name').html();
785
- var profile_image = $(this).find('.fb-image img').attr('src');
786
- <?php if ( isset( $_GET['feed_type'] ) && 'instagram' === $_GET['feed_type'] ) { ?>
787
- $("#fts_facebook_instagram_custom_api_token").val(token);
788
- $("#fts_facebook_instagram_custom_api_token_user_id").val(fb_page_id);
789
- $("#fts_facebook_instagram_custom_api_token_user_name").val(name);
790
- $("#fts_facebook_instagram_custom_api_token_profile_image").val(profile_image);
791
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
  } elseif ( 'no' === $reviews_token || isset( $_GET['fts_reviews_feed'] ) && 'no' === $_GET['fts_reviews_feed'] ) {
793
- ?>
794
- $("#fts_facebook_custom_api_token").val(token);
795
- $("#fts_facebook_custom_api_token_user_id").val(fb_page_id);
796
- $("#fts_facebook_custom_api_token_user_name").val(name);
797
- $("#fts_facebook_custom_api_token_profile_image").val(profile_image);
798
- <?php
799
  } else {
800
- ?>
801
- $("#fts_facebook_custom_api_token_biz").val(token);
802
- $("#fts_facebook_custom_api_token_user_id_biz").val(fb_page_id);
803
- $("#fts_facebook_custom_api_token_user_name_biz").val(name);
804
- $("#fts_facebook_custom_api_token_biz_profile_image").val(profile_image);
805
- <?php } ?>
806
- $('.fb-page-list .feed-them-social-admin-submit-btn').hide();
807
- $(this).find('.feed-them-social-admin-submit-btn').toggle();
808
- // alert(name + token)
809
- })
810
- });
811
- </script>
812
- <?php
813
- // Make sure it's not ajaxing!
814
- if ( ! isset( $_GET['load_more_ajaxing'] ) && isset( $test_fb_app_token_response->paging->next ) && ! isset( $_GET['locations'] ) ) {
815
- $fts_dynamic_name = sanitize_key( $_REQUEST['fts_dynamic_name'] );
816
- echo '<div class="fts-clear"></div>';
817
-
818
- echo '<div id="loadMore_' . esc_attr( $fts_dynamic_name ) . '" class="fts-fb-load-more">' . esc_html( 'Load More', 'feed-them-social' ) . '</div>';
819
- }//End make sure it's not ajaxing
 
 
 
 
 
 
 
 
820
 
821
- // Lastly if we can't find a next url we unset the next url from the page to not let the loadmore button be active.
822
- if ( isset( $_GET['locations'] ) ) {
823
- unset( $_REQUEST['next_location_url'] );
824
- } else {
825
- unset( $_REQUEST['next_url'] );
826
- }
827
- return ob_get_clean();
828
- }
829
- exit;
830
  }
831
 
832
 
@@ -1027,24 +1055,43 @@ class feed_them_social_functions {
1027
 
1028
  $fts_admin_activation_clear_cache = get_option( 'Feed_Them_Social_Activated_Plugin' );
1029
  $fts_dev_mode_cache = get_option( 'fts_clear_cache_developer_mode' );
 
 
1030
  if ( '1' === $fts_dev_mode_cache || 'feed-them-social' === $fts_admin_activation_clear_cache ) {
1031
  wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/developer-admin.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
1032
  wp_localize_script( 'fts_clear_cache_script', 'ftsAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
1033
- wp_enqueue_script( 'jquery' );
1034
- wp_enqueue_script( 'fts_clear_cache_script' );
1035
  }
1036
  if ( 'hide-admin-bar-menu' !== $fts_dev_mode_cache && '1' !== $fts_dev_mode_cache ) {
1037
- wp_enqueue_script( 'jquery' );
1038
  wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/admin.js' ), array(), FTS_CURRENT_VERSION, false );
1039
  wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/developer-admin.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
1040
- wp_localize_script( 'fts_clear_cache_script', 'ftsAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
1041
- wp_enqueue_script( 'fts_clear_cache_script' );
1042
  }
1043
 
1044
  // we delete this option if found so we only empty the cache once when the plugin is ever activated or updated!
1045
  delete_option( 'Feed_Them_Social_Activated_Plugin' );
1046
  }
1047
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1048
  /**
1049
  * Feed Them Main Menu
1050
  *
@@ -3551,6 +3598,7 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3551
  exit( 'Sorry, You can\'t do that!' );
3552
  }
3553
 
 
3554
  if ( isset( $_REQUEST['button_pushed'] ) && 'yes' === $_REQUEST['button_pushed'] ) {
3555
 
3556
  if( 'youtube' === $_REQUEST['feed'] && !empty( $_REQUEST['refresh_token'] ) ){
@@ -3561,43 +3609,72 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3561
  update_option( 'fts_instagram_custom_api_token', sanitize_text_field( wp_unslash( $_REQUEST['access_token'] ) ) );
3562
  }
3563
  }
3564
- if ( !empty( $_REQUEST['access_token'] ) ) {
3565
 
3566
- if( 'youtube' === $_REQUEST['feed'] ){
3567
- update_option( 'youtube_custom_access_token', sanitize_text_field( wp_unslash( $_REQUEST['access_token'] ) ) );
3568
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3569
  }
3570
- if ( 'instagram' === $_REQUEST['feed'] ){
3571
- update_option( 'fts_instagram_custom_api_token', sanitize_text_field( wp_unslash( $_REQUEST['access_token'] ) ) );
3572
- }
3573
- }
3574
 
3575
- if( 'youtube' === $_REQUEST['feed'] ){
3576
 
3577
- $startoftime = isset( $_REQUEST['expires_in'] ) ? strtotime( '+' . $_REQUEST['expires_in'] . ' seconds' ) : '';
 
 
3578
  $start_of_time_final = false !== $startoftime ? sanitize_key( $startoftime ) : '';
3579
- update_option( 'youtube_custom_token_exp_time', sanitize_text_field( wp_unslash( $start_of_time_final ) ) );
 
 
 
 
3580
  }
3581
 
3582
- if( 'instagram' === $_REQUEST['feed'] ){
3583
 
3584
- $startoftime = isset( $_REQUEST['expires_in'] ) ? $_REQUEST['expires_in'] : '';
3585
- $start_of_time_final = false !== $startoftime ? sanitize_key( $startoftime ) : '';
3586
- update_option( 'fts_instagram_custom_api_token_expires_in', sanitize_text_field( wp_unslash( $start_of_time_final ) ) );
3587
 
3588
- echo wp_unslash( $_REQUEST['expires_in'] );
3589
- echo '<br/>';
 
3590
  }
3591
 
3592
  // This only happens if the token is expired on the YouTube Options page and you go to re-save or refresh the page for some reason. It will also run this function if the cache is emptied and the token is found to be expired.
3593
  if ( 'no' === $_REQUEST['button_pushed'] ) {
3594
- echo 'Token Refreshed: ';
3595
  // $output .= do_shortcode('[fts _youtube vid_count=3 large_vid=no large_vid_title=no large_vid_description=no thumbs_play_in_iframe=popup vids_in_row=3 space_between_videos=1px force_columns=yes maxres_thumbnail_images=yes thumbs_wrap_color=#000 wrap=none video_wrap_display=none comments_count=12 channel_id=UCqhnX4jA0A5paNd1v-zEysw loadmore=button loadmore_count=5 loadmore_btn_maxwidth=300px loadmore_btn_margin=10px]');
3596
  }
3597
 
3598
- echo sanitize_text_field( $_REQUEST['access_token'] );
 
3599
 
3600
- wp_die();
3601
  }
3602
 
3603
  /**
@@ -3607,10 +3684,6 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3607
  */
3608
  public function feed_them_instagram_refresh_token() {
3609
 
3610
- $fts_refresh_token_nonce = wp_create_nonce( 'fts_refresh_token_nonce' );
3611
-
3612
- if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_refresh_token_nonce' ) ) {
3613
-
3614
  // Used some methods from this link http://ieg.wnet.org/2015/09/using-oauth-in-wordpress-plugins-part-2-persistence/
3615
  // save all 3 get options: happens when clicking the get access token button on the instagram options page!
3616
  if ( isset( $_GET['access_token'], $_GET['expires_in'] ) ) {
@@ -3621,37 +3694,6 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3621
  } else {
3622
  // refresh token!
3623
  $button_pushed = 'no';
3624
- $check_token = get_option( 'fts_instagram_custom_api_token' );
3625
- $check_basic_token_value = false !== $this->data_protection->decrypt( $check_token ) ? $this->data_protection->decrypt( $check_token ) : $check_token;
3626
- $oauth2token_url = esc_url_raw( 'https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=' . $check_basic_token_value );
3627
-
3628
- $response = wp_remote_get( $oauth2token_url );
3629
-
3630
- $auth_obj = json_decode( wp_remote_retrieve_body( $response ), true );
3631
-
3632
- // print_r( $auth_obj['expires_in'] );
3633
-
3634
- // Take the time() + $expires_in will equal the current date and time in seconds plus 60 days in seconds.
3635
- // For now we are going to get a new token every 7 days just to be on the safe side.
3636
- // That means we will negate 53 days from the seconds which is 4579200 <-- https://www.convertunits.com/from/60+days/to/seconds
3637
- // We get 60 days to refresh the token, if it's not refreshed before then it will expire.
3638
-
3639
- $time_minus_fiftythree_days = $auth_obj['expires_in'] - 4579200;
3640
- $expires_in = $time_minus_fiftythree_days + time();
3641
-
3642
- // test.
3643
- // echo ' asdfasdfasdfasdf ';
3644
- // This is our refresh token response;
3645
- // print_r($response['body']);
3646
- // test.
3647
- //$auth_obj['access_token'] = '';
3648
-
3649
- // Return if no access token queried from refresh token. This will stop error on front end feed if cached already.
3650
- if( empty( $auth_obj['access_token'] ) ){
3651
- return;
3652
- }
3653
-
3654
- $encrypted_token = $this->data_protection->encrypt( $auth_obj['access_token'] );
3655
 
3656
  }
3657
 
@@ -3665,14 +3707,12 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3665
  <script>
3666
  jQuery(document).ready(function () {
3667
 
3668
- var fts_time = "<?php echo esc_js( $time ); ?>";
3669
  var fts_security = "<?php echo esc_js( $nonce ); ?>";
3670
 
3671
  jQuery.ajax({
3672
  data: {
3673
  action: "fts_refresh_token_ajax",
3674
- access_token: '<?php echo esc_js( $encrypted_token ); ?>',
3675
- expires_in: '<?php echo esc_js( $expires_in ); ?>',
3676
  button_pushed: '<?php echo esc_js( $button_pushed ); ?>',
3677
  fts_security: fts_security,
3678
  fts_time: fts_time,
@@ -3739,7 +3779,6 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3739
  </script>
3740
  <?php
3741
  // return $auth_obj['access_token'];
3742
- }
3743
  }
3744
 
3745
  /**
@@ -3749,10 +3788,6 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3749
  */
3750
  public function feed_them_youtube_refresh_token() {
3751
 
3752
- $fts_refresh_token_nonce = wp_create_nonce( 'fts_refresh_token_nonce' );
3753
-
3754
- if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_refresh_token_nonce' ) ) {
3755
-
3756
  // Used some methods from this link http://ieg.wnet.org/2015/09/using-oauth-in-wordpress-plugins-part-2-persistence/
3757
  // Save all 3 get options: happens when clicking the get access token button on the youtube options page.
3758
  // A Refresh token is only available when clicking through the oAuth process.
@@ -3806,9 +3841,16 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3806
  return print_r($response);
3807
  }
3808
  }
 
 
 
3809
  ?>
3810
  <script>
3811
  jQuery(document).ready(function () {
 
 
 
 
3812
  jQuery.ajax({
3813
  data: {
3814
  action: "fts_refresh_token_ajax",
@@ -3816,12 +3858,15 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3816
  access_token: '<?php echo esc_js( $access_token ) ?>',
3817
  expires_in: '<?php echo esc_js( $expires_in ) ?>',
3818
  button_pushed: '<?php echo esc_js( $button_pushed ); ?>',
 
 
3819
  feed: 'youtube'
3820
  },
3821
  type: 'POST',
3822
  url: ftsAjax.ajaxurl,
3823
  success: function (response) {
3824
  console.log(response);
 
3825
  <?php
3826
  if ( isset( $_GET['page'] ) && 'fts-youtube-feed-styles-submenu-page' === $_GET['page'] ) {
3827
 
@@ -3879,8 +3924,7 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3879
  return false;
3880
  }); // end of document.ready
3881
  </script>
3882
- <?php
3883
- }
3884
  }
3885
 
3886
  /**
39
  add_action( 'wp_ajax_fts_clear_cache_ajax', array( $this, 'fts_clear_cache_ajax' ) );
40
  }
41
  add_action( 'wp_ajax_fts_encrypt_token_ajax', array( $this, 'fts_encrypt_token_ajax' ) );
42
+ add_action( 'init', array( $this, 'fts_encrypt_script' ) );
43
 
44
  add_action( 'wp_ajax_fts_refresh_token_ajax', array( $this, 'fts_refresh_token_ajax' ) );
45
  add_action( 'wp_ajax_nopriv_fts_refresh_token_ajax', array( $this, 'fts_refresh_token_ajax' ) );
181
  */
182
  public function fts_instagram_token_ajax() {
183
 
184
+ // Check security token is set.
185
+ if ( ! isset( $_REQUEST['fts_security'], $_REQUEST['fts_time'] ) ) {
186
+ exit( 'Sorry, You can\'t do that!' );
187
+ }
188
+
189
+ // Verify Nonce Security.
190
+ if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['fts_security'] ) ) , sanitize_text_field( wp_unslash( $_REQUEST['fts_time'] ) ) . 'instagram_save_token' ) ) {
191
+ exit( 'Sorry, You can\'t do that!' );
192
+ }
193
+
194
+ $access_token = $_REQUEST['access_token'];
195
  $user_id = $_REQUEST['user_id'];
196
  $expires_in = $_REQUEST['expires_in'];
197
+ $feed_type = $_REQUEST['feed_type'];
198
+
199
+ $check_basic_token_value = false !== $this->data_protection->decrypt( $access_token ) ? $this->data_protection->decrypt( $access_token ) : $access_token;
200
+ $insta_url = 'instagram_basic' === $feed_type ? esc_url_raw( 'https://graph.instagram.com/me?fields=id,username&access_token=' . sanitize_text_field( $check_basic_token_value ) ) : esc_url( 'https://api.instagram.com/v1/users/self/?access_token=' . sanitize_text_field( $check_basic_token_value ) );
201
+
202
+ // Get Data for Instagram to check for errors!
203
+ $response = wp_remote_fopen( $insta_url );
204
+ $test_app_token_response = json_decode( $response );
205
+ // Test.
206
+ // print_r( $access_token );
207
+
208
+ if ( ! isset( $test_app_token_response->meta->error_message ) && ! isset( $test_app_token_response->error_message ) && 'Sorry, this content isn\'t available right now' !== $response ) {
209
+ update_option( 'fts_instagram_custom_api_token', sanitize_text_field( $access_token ) );
210
+ update_option( 'fts_instagram_custom_id', sanitize_text_field( $user_id ) );
211
+ update_option( 'fts_instagram_custom_api_token_expires_in', sanitize_text_field( $expires_in ) );
212
+ echo esc_html( 'success' );
213
+ }
214
+ else {
215
+ echo esc_html( 'failed' );
216
+ }
217
 
218
+ wp_die();
 
 
 
 
 
 
 
219
  }
220
 
221
  /**
227
  */
228
  public function fts_encrypt_token_ajax() {
229
 
230
+ // Check security token is set.
231
+ if ( ! isset( $_REQUEST['fts_security'], $_REQUEST['fts_time'] ) ) {
232
+ exit( 'Sorry, You can\'t do that!' );
233
+ }
234
 
235
+ // Verify Nonce Security.
236
+ if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['fts_security'] ) ), 'fts-ajax-nonce' ) ) {
237
+ exit( 'Sorry, You can\'t do that!');
238
+ }
239
+
240
+ $access_token = $_REQUEST['access_token'];
241
+ $encrypt = $this->data_protection->encrypt( sanitize_text_field( $access_token ) );
242
+
243
+ if( 'business' === $_REQUEST['token_type'] ){
244
+ // Now the encrypted version is saved to the DB.
245
+ update_option( 'fts_facebook_instagram_custom_api_token', sanitize_text_field( $encrypt ) );
246
+ }
247
+ elseif ( 'basic' === $_REQUEST['token_type'] ) {
248
+ // Now the encrypted version is saved to the DB.
249
+ update_option( 'fts_instagram_custom_api_token', sanitize_text_field( $encrypt ) );
250
+ }
251
+ elseif( 'fbBusiness' === $_REQUEST['token_type'] ){
252
+ // Now the encrypted version is saved to the DB.
253
+ update_option( 'fts_facebook_custom_api_token', sanitize_text_field( $encrypt ) );
254
  }
255
+ elseif( 'fbBusinessReviews' === $_REQUEST['token_type'] ){
256
+ // Now the encrypted version is saved to the DB.
257
+ update_option( 'fts_facebook_custom_api_token_biz', sanitize_text_field( $encrypt ) );
258
+ }
259
+
260
  $token_data = array (
261
+ 'token' => esc_html( $access_token ),
262
+ 'encrypted' => esc_html( $encrypt ),
263
  );
264
 
265
  // We pass the original access token back so we can add it to our input field.
279
  */
280
  public function feed_them_instagram_save_token() {
281
 
282
+ $time = time();
283
+ $nonce = wp_create_nonce( $time . 'instagram_save_token' );
284
 
285
+ // Take the time() + $expires_in will equal the current date and time in seconds plus 60 days in seconds.
286
+ // For now we are going to get a new token every 7 days just to be on the safe side.
287
+ // That means we will negate 53 days from the seconds which is 4579200 <-- https://www.convertunits.com/from/60+days/to/seconds
288
+ // We get 60 days to refresh the token, if it's not refreshed before then it will expire.
289
+ $expires_in = $time + $_GET['expires_in'] - 4579200;
290
+ $feed_type = $_GET['feed_type'];
291
  $raw_token = $_GET['code'];
292
+ $user_id = $_GET['user_id'];
 
 
293
 
294
  if ( isset( $raw_token ) && 'original_instagram' === $feed_type || isset( $raw_token ) && 'instagram_basic' === $feed_type ) {
295
+ $encrypted_token = $this->data_protection->encrypt( sanitize_text_field( $raw_token ) );
296
  // error_log( print_r( $encrypted_token, true ) );
297
 
298
  ?>
299
  <script>
300
  jQuery(document).ready(function () {
301
 
 
 
 
 
 
 
 
 
 
302
  jQuery.ajax({
303
  data: {
304
  action: 'fts_instagram_token_ajax',
305
+ access_token: '<?php echo sanitize_text_field( $encrypted_token ); ?>',
306
+ user_id: '<?php echo sanitize_text_field( $user_id ); ?>',
307
+ expires_in: '<?php echo sanitize_text_field( $expires_in ); ?>',
308
+ feed_type: '<?php echo sanitize_text_field( $feed_type ); ?>',
309
+ fts_security: '<?php echo sanitize_text_field( $nonce ); ?>',
310
+ fts_time: '<?php echo sanitize_text_field( $time ); ?>',
311
  },
312
  type: 'POST',
313
  url: ftsAjax.ajaxurl,
314
  success: function (response) {
 
 
315
 
316
+ console.log( 'Instagram Basic Save Token: ' + response );
317
+
318
+ <?php
319
 
320
  // 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.
321
  if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
323
  } else {
324
  $custom_instagram_link_hash = '#feed_type=instagram';
325
  }
326
+
327
+ ?>
328
+ if( 'success' === response ){
329
+ <?php
330
+ $fts_instagram_message = sprintf(
331
  esc_html__( '%1$sYour access token is working! Generate your shortcode on the %2$sSettings Page%3$s', 'feed-them-social' ),
332
  '<div class="fts-successful-api-token">',
333
  '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' . $custom_instagram_link_hash ) . '">',
334
+ '</a></div><div class="fts-clear"></div>'
335
  );
336
  ?>
337
+
338
+ jQuery('.instagram-failed-message').hide();
339
+ if (!jQuery('.fts-instagram-last-row .fts-successful-api-token').length) {
340
+ jQuery('.fts-instagram-last-row').append('<?php echo $fts_instagram_message; ?>');
341
+ }
342
+ jQuery('.fts-success').show();
343
+
344
+ console.log( 'Success saving instagram access token: Encrypted Token: <?php echo $encrypted_token ?>' );
345
  }
346
+ else {
347
+ <?php
 
 
348
  $fts_instagram_message = sprintf(
349
+ esc_html__( '%1$sOh No something\'s wrong. Please try clicking the button again to get a new access token. If you need additional assistance please email us at support@slickremix.com %2$s.', 'feed-them-social' ),
350
  '<div class="fts-failed-api-token">',
351
+ '</div><div class="fts-clear"></div>'
 
352
  );
353
  ?>
354
+
355
+ jQuery('.fts-instagram-last-row').html('<?php echo $fts_instagram_message; ?>');
356
+
357
+ console.log( 'Failed saving instagram access token, not valid.' );
358
+ }
 
 
 
359
  }
360
  }); // end of ajax()
361
  return false;
363
  </script>
364
  <?php
365
  }
 
366
  }
367
 
368
  /**
429
  * @since 2.1.4
430
  */
431
  public function fts_fb_page_token_func() {
 
432
 
433
+ if( !empty( $_GET['next_location_url'] ) && false === strpos( $_GET['next_location_url'], 'https://graph.facebook' ) ){
434
+ return false;
435
+ }
436
 
437
+ // Make sure it's not ajaxing!
438
+ if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
439
+ $_REQUEST['fts_dynamic_name'] = sanitize_key( $this->feed_them_social_rand_string() );
440
+ } //End make sure it's not ajaxing!
441
 
442
+ ob_start();
443
 
444
+ if ( ! isset( $_GET['locations'] ) ) {
445
 
446
+ // SRL 4-23-22. Locations: This endpoint is not supported for Pages that have been migrated to the New Pages Experience. So we need to make an exception.
447
+ $fb_url = 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] ? wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=locations{name,id,page_username,locations,store_number,store_location_descriptor,access_token},name,id,link,has_transitioned_to_new_page_experience,access_token&access_token=' . $_GET['code'] . '&limit=500' ) : wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=instagram_business_account{id,username,profile_picture_url},locations{instagram_business_account{profile_picture_url,id,username},name,id,page_username,locations,store_number,store_location_descriptor,access_token},name,id,link,access_token&access_token=' . $_GET['code'] . '&limit=500' );
448
 
449
+ $test_fb_app_token_response = json_decode( $fb_url );
450
 
451
+ // SRL 4-23-22. For now we are just going to check for error, if error then that would mean the first object in array is a new page experience.
452
+ // if is new page has_transitioned_to_new_page_experience => 1 This could be expanded in the future by creating a foreach loops to check each page
453
+ // but then you have to run a call for each page and that seems like overkill if you have hundreds of pages. FB should come up with a simpler way.
454
+ if( !empty( $test_fb_app_token_response->error ) ){
455
+ // Possibly the user is on a new page experience so let's run the call without locations.
456
+ $fb_url = 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] ? wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=has_transitioned_to_new_page_experience,name,id,link,access_token&access_token=' . $_GET['code'] . '&limit=500' ) : wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=has_transitioned_to_new_page_experience,instagram_business_account{id,username,profile_picture_url},name,id,link,access_token&access_token=' . $_GET['code'] . '&limit=500' );
457
 
458
+ }
459
+ $fb_token_response = isset( $_REQUEST['next_url'] ) ? wp_remote_fopen( esc_url_raw( $_REQUEST['next_url'] ) ) : $fb_url;
460
+ $test_fb_app_token_response = json_decode( $fb_token_response );
461
 
462
+ // Test. print_r( $test_fb_app_token_response );
 
463
 
464
+ $_REQUEST['next_url'] = isset( $test_fb_app_token_response->paging->next ) ? esc_url_raw( $test_fb_app_token_response->paging->next ) : '';
465
+ } else {
466
+ $fb_token_response = isset( $_REQUEST['next_location_url'] ) ? wp_remote_fopen( esc_url_raw( $_REQUEST['next_location_url'] ) ) : '';
467
+ $test_fb_app_token_response = json_decode( $fb_token_response );
468
+ }
469
 
470
+ // IF we still get an error then show a formatted response for the user.
471
+ if( !empty( $test_fb_app_token_response->error ) ){
472
+ echo '<div style="max-width: 570px; word-wrap: break-word;margin:10px 10px 0 10px;">';
473
+ echo '<p>';
474
+ echo '<strong>Facebook Response: </strong>';
475
+ echo $test_fb_app_token_response->error->message . ' Code #';
476
+ echo $test_fb_app_token_response->error->code . '. ';
477
+ echo $test_fb_app_token_response->error->error_user_title;
478
+ echo $test_fb_app_token_response->error->error_user_msg;
479
+
480
+ if( 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] ){
481
+ echo '</p> <strong>Helpful Tips:</strong> Make sure you are an admin of the page or pages you are choosing. Next you will see, "What SlickRemix is allowed to do." The 2 options should be, Read content posted on the Page and Show a list of the Pages you manage. Make sure and choose Yes for both.<a href="#" style="display: none" target="_blank">More Tips</a>';
 
 
 
 
 
 
482
  }
483
+ if( 'fts-instagram-feed-styles-submenu-page' === $_GET['page'] ) {
484
+ echo '</p> <strong>Helpful Tips:</strong> Make sure you are an admin of the page or pages you are choosing. Next you will see, "What SlickRemix is allowed to do." The 3 options should be, Access profile and posts from the Instagram account connected to your Page, Read content posted on the Page and Show a list of the Pages you manage. Make sure and choose Yes for all 3.<a href="#" style="display: none" target="_blank">More Tips</a>';
485
+ }
486
+ echo '</div>';
487
+ return false;
488
+ }
489
 
490
+ // Make sure it's not ajaxing!
491
+ if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
492
+ // ******************
493
+ // Load More BUTTON Start
494
+ // ******************
495
+ ?>
496
+ <div class="fts-clear"></div>
497
+ <?php
498
+ } //End make sure it's not ajaxing!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
 
500
+ $build_shortcode = 'fts_fb_page_token';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
 
502
+ // Make sure it's not ajaxing!
503
+ if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504
 
505
+ $reviews_token = isset( $_GET['reviews_token'] ) ? 'yes' : 'no';
506
+ ?>
507
+ <div id="fb-list-wrap">
508
+ <div class="fts-pages-info"> <?php echo esc_html__( 'Click on a page in the list below and it will add the Page ID and Access Token above, then click save.', 'feed-them-social' ); ?></div>
509
+ <ul class="fb-page-list fb-page-master-list">
510
+ <?php
511
+ } //End make sure it's not ajaxing!
512
+
513
+ foreach ( $test_fb_app_token_response->data as $data ) {
514
+
515
+ // if( !empty( $data->instagram_business_account ) ){
516
+ $data_id = isset( $data->instagram_business_account ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? $data->instagram_business_account->id : $data->id;
517
+ $data_user_name = isset( $data->instagram_business_account ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? '<span class="fts-insta-icon"></span>' . $data->instagram_business_account->username . '<span class="fts-arrow-icon"></span><span class="fts-fb-icon"></span>' . $data->name : $data->name;
518
+ $data_thumbnail = isset( $data->instagram_business_account->profile_picture_url ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? $data->instagram_business_account->profile_picture_url : 'https://graph.facebook.com/' . $data->id . '/picture';
519
+ ?>
520
+ <li class="fts-fb-main-page-li">
521
+ <div class="fb-click-wrapper">
522
+ <div class="fb-image">
523
+ <img border="0" height="50" width="50"
524
+ src="<?php echo esc_url( $data_thumbnail ); ?>"/>
525
+ </div>
526
+ <div class="fb-name-wrap"><span class="fb-name">
527
+ <?php
528
+ echo $data_user_name;
529
+ if ( isset( $data->store_number, $data->store_location_descriptor ) ) {
530
+ print '(' . $data->store_location_descriptor . ')';
531
+ }
532
+ ?>
533
+ </span></div>
534
+ <div class="fb-other-wrap">
535
+ <small>
536
+ <?php echo esc_html__( 'ID: ', 'feed-them-social' ); ?>
537
+ <span class="fts-api-facebook-id"><?php echo esc_html( $data_id ); ?></span>
538
+ <?php echo isset( $data->store_number ) ? esc_html( '| Location: ' . $data->store_number, 'feed-them-social' ) : ''; ?>
539
+ </small>
540
+ </div>
541
+ <div class="page-token"><?php echo esc_attr( $data->access_token ); ?></div>
542
+ <?php
543
+ $facebook_input_token = $this->get_fb_access_token();
544
+ $facebook_access_token = $data->access_token;
545
+ if ( $facebook_input_token === $facebook_access_token ) {
546
+ ?>
547
+ <div class="feed-them-social-admin-submit-btn " style="display: block !important;">
548
+ Active
549
+ </div>
550
+ <?php } else { ?>
551
+ <div class="feed-them-social-admin-submit-btn fts-token-save">Save</div>
552
+ <?php } ?>
553
+ <div class="fts-clear"></div>
554
+ </div>
555
+ <?php
556
+ $_REQUEST['next_location_url'] = isset( $data->locations->paging->next ) ? esc_url_raw( $data->locations->paging->next ) : '';
557
+ $remove_class_or_not = isset( $data->locations->paging->next ) ? 'fb-sublist-page-id-' . esc_attr( $data_id ) : '';
558
+ if ( isset( $data->locations->data ) ) {
559
+ $location_count = count( $data->locations->data );
560
+ $location_plus_sign = isset( $data->locations->paging->next ) ? '+' : '';
561
+ $location_text = 1 === $location_count ? esc_html( $location_count . ' ' . esc_html__( 'Location for', 'feed-them-social' ) ) : esc_html( $location_count . $location_plus_sign . ' ' . esc_html__( 'Locations for', 'feed-them-social' ) );
562
+ // if the locations equal 3 or less we will set the location container height to auto so the scroll loadmore does not fire.
563
+ $location_scroll_loadmore_needed_check = $location_count <= 3 ? 'height:auto !important' : 'height: 200px !important;';
564
+ }
565
 
566
+ if ( ! isset( $_GET['locations'] ) && isset( $data->locations->data ) ) {
567
+ ?>
568
+ <div class="fts-fb-location-text-wrap"><?php echo esc_html( $location_text . ' ' . $data->name ); ?></div>
569
+ <ul class="fb-page-list fb-sublist <?php echo esc_attr( $remove_class_or_not ); ?>"
570
+ style="<?php echo esc_attr( $location_scroll_loadmore_needed_check ); ?>">
571
+ <?php
572
+ foreach ( $data->locations->data as $location ) {
573
+
574
+ // if ( !empty( $location->instagram_business_account ) ) {
575
+ $loc_data_id = isset( $location->instagram_business_account ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? $location->instagram_business_account->id : $location->id;
576
+ $loc_data_user_name = isset( $location->instagram_business_account ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? '<span class="fts-insta-icon"></span>' . $location->instagram_business_account->username . '<span class="fts-arrow-icon"></span><span class="fts-fb-icon"></span>' . $location->name : $location->name;
577
+ $loc_data_thumbnail = isset( $location->instagram_business_account->profile_picture_url ) && 'fts-facebook-feed-styles-submenu-page' !== $_GET['page'] ? $location->instagram_business_account->profile_picture_url : 'https://graph.facebook.com/' . $location->id . '/picture';
578
+
579
+ ?>
580
+ <li>
581
+ <div class="fb-click-wrapper">
582
+ <div class="fb-image">
583
+ <img border="0" height="50" width="50"
584
+ src="<?php echo esc_url( $loc_data_thumbnail ); ?>"/>
585
+ </div>
586
+ <div class="fb-name-wrap"><span
587
+ class="fb-name"><?php echo $loc_data_user_name; ?>
588
+ <?php
589
+ if ( isset( $location->store_location_descriptor ) ) {
590
+ echo '(' . esc_html( $location->store_location_descriptor ) . ')';
591
+ }
592
+ ?>
593
+ </span></div>
594
+ <div class="fb-other-wrap">
595
+ <small>
596
+ <?php echo esc_html__( 'ID: ', 'feed-them-social' ); ?>
597
+ <span class="fts-api-facebook-id"><?php echo esc_html( $loc_data_id ); ?></span>
598
+ <?php
599
+ if ( isset( $location->store_number ) ) {
600
+ print '| ';
601
+ esc_html__( 'Location:', 'feed-them-social' );
602
+ print ' ' . esc_html( $location->store_number );
603
+ }
604
+ ?>
605
+ </small>
606
+ </div>
607
+
608
+ <div class="page-token"><?php echo esc_html( $location->access_token ); ?></div>
609
+ <?php
610
+ $facebook_input_token = $this->get_fb_access_token();
611
+ $facebook_access_token = $location->access_token;
612
+ if ( $facebook_input_token === $facebook_access_token ) {
613
+ ?>
614
+ <div class="feed-them-social-admin-submit-btn "
615
+ style="display: block !important;">Active
616
+ </div>
617
+ <?php } else { ?>
618
+ <div class="feed-them-social-admin-submit-btn fts-token-save">
619
+ Save
620
+ </div>
621
+ <?php } ?>
622
+ <div class="fts-clear"></div>
623
+ </div>
624
+ </li>
625
+
626
+ <?php
627
+ // }
628
+ }
629
+ ?>
630
+ </ul>
631
 
632
+ <?php
633
+ // Make sure it's not ajaxing locations!
634
+ if ( ! isset( $_GET['locations'] ) && isset( $data->locations->paging->next ) ) {
635
+ echo '<div id="loadMore_' . esc_attr( $data_id ) . '_location" class="fts-fb-load-more" style="background:none !Important;">' . esc_html__( 'Scroll to view more Locations', 'feed-them-instagram' ) . '</div>';
636
+ }//End Check
637
+
638
+ // Make sure it's not ajaxing locations!
639
+ if ( ! isset( $_GET['locations'] ) ) {
640
+ $time = time();
641
+ $nonce = wp_create_nonce( $time . 'load-more-nonce' );
642
+ $fb_page_id = $data_id;
643
+ ?>
644
+ <script>
645
+ jQuery(document).ready(function () {
646
+ jQuery(".fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>").bind("scroll", function () {
647
+ if (jQuery(this).scrollTop() + jQuery(this).innerHeight() >= jQuery(this)[0].scrollHeight) {
648
+ if (!jQuery('.fts-no-more-locations-<?php echo esc_js( $fb_page_id ); ?>').length) {
649
+ jQuery("#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location").addClass('fts-fb-spinner');
650
+ var button = jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
651
+ console.log(button);
652
+ var build_shortcode = "<?php echo esc_js( $build_shortcode ); ?>";
653
+ var yes_ajax = "yes";
654
+ var fts_d_name = "<?php echo esc_js( $fb_page_id ); ?>";
655
+ var fts_security = "<?php echo esc_js( $nonce ); ?>";
656
+ var fts_time = "<?php echo esc_js( $time ); ?>";
657
+ var fts_reviews_feed = "<?php echo esc_js( $reviews_token ); ?>";
658
+ jQuery.ajax({
659
+ data: {
660
+ action: "my_fts_fb_load_more",
661
+ next_location_url: nextURL_location_<?php echo esc_js( $fb_page_id ); ?>,
662
+ fts_dynamic_name: fts_d_name,
663
+ rebuilt_shortcode: build_shortcode,
664
+ load_more_ajaxing: yes_ajax,
665
+ fts_security: fts_security,
666
+ fts_time: fts_time,
667
+ feed_name: build_shortcode,
668
+ fts_reviews_feed: fts_reviews_feed,
669
+ locations: 'yes'
670
+ },
671
+ type: 'GET',
672
+ url: ajaxurl,
673
+ success: function (data) {
674
+ console.log('Well Done and got this from sever: ' + data);
675
+ jQuery('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').append(data).filter('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').html();
676
+ jQuery('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').animate({scrollTop: '+=100px'}, 800); // scroll down a 100px after new items are added
677
+
678
+ <?php if ( isset( $data->locations->paging->next ) && $data->locations->paging->next === $_REQUEST['next_location_url'] ) { ?>
679
+ jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb fts-no-more-locations-<?php echo esc_js( $fb_page_id ); ?>" style="background:none !important"><?php echo esc_html( 'All Locations loaded', 'feed-them-social' ); ?></div>');
680
+ jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').removeAttr('id');
681
+ <?php } ?>
682
+ jQuery("#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location").removeClass('fts-fb-spinner');
683
+ }
684
+ }); // end of ajax()
685
+ return false;
686
+
687
+ } //stop ajax from submitting again if the fts-no-more-locations class is found
688
+
689
+ }
690
+ }); // end of form.submit
691
+
692
+ }); // end of document.ready
693
+ </script>
694
+ <?php
695
+ } //END Make sure it's not ajaxing locations
696
+ ?>
697
+ <script>var nextURL_location_<?php echo esc_js( $fb_page_id ); ?>= "<?php echo isset( $data->locations->paging->next ) ? esc_url_raw( $data->locations->paging->next ) : ''; ?>";</script>
698
+ <?php } ?>
699
+ </li>
700
 
701
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
702
 
703
+ // }
704
+ } // foreach loop of locations
705
 
706
+ // Make sure it's not ajaxing!
707
+ if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
708
+ ?>
709
+ </ul>
710
+ <div class="fts-clear"></div>
711
+ </div>
712
+ <?php
713
+ } //End make sure it's not ajaxing
714
 
715
+ // Make sure it's not ajaxing!
716
+ if ( ! isset( $_GET['load_more_ajaxing'] ) && ! isset( $_GET['locations'] ) ) {
717
+ $fts_dynamic_name = isset( $_REQUEST['fts_dynamic_name'] ) ? sanitize_key( $_REQUEST['fts_dynamic_name'] ) : '';
718
+ $time = time();
719
+ $nonce = wp_create_nonce( $time . 'load-more-nonce' );
720
+ ?>
721
+ <script>
722
+ jQuery(document).ready(function () {
723
 
724
+ jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").click(function () {
725
+
726
+ jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").addClass('fts-fb-spinner');
727
+ var button = jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
728
+ console.log(button);
729
+ var build_shortcode = "<?php echo esc_js( $build_shortcode ); ?>";
730
+ var yes_ajax = "yes";
731
+ var fts_d_name = "<?php echo esc_js( $fts_dynamic_name ); ?>";
732
+ var fts_security = "<?php echo esc_js( $nonce ); ?>";
733
+ var fts_time = "<?php echo esc_js( $time ); ?>";
734
+ var fts_reviews_feed = "<?php echo esc_js( $reviews_token ); ?>";
735
+ jQuery.ajax({
736
+ data: {
737
+ action: "my_fts_fb_load_more",
738
+ next_url: nextURL_<?php echo esc_js( $fts_dynamic_name ); ?>,
739
+ fts_dynamic_name: fts_d_name,
740
+ rebuilt_shortcode: build_shortcode,
741
+ load_more_ajaxing: yes_ajax,
742
+ fts_security: fts_security,
743
+ fts_time: fts_time,
744
+ feed_name: build_shortcode,
745
+ fts_reviews_feed: fts_reviews_feed
746
+ },
747
+ type: 'GET',
748
+ url: ajaxurl,
749
+ success: function (data) {
750
+ console.log('Well Done and got this from sever: ' + data);
751
+ jQuery('.fb-page-master-list').append(data).filter('.fb-page-list').html();
752
+
753
+ if (!nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?> || 'no more' === nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>) {
754
+ jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb"><?php echo esc_js( 'No More Pages', 'feed-them-social' ); ?></div>');
755
+ jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').removeAttr('id');
756
+ }
757
+ jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').html('<?php echo esc_js( 'Load More', 'feed-them-social' ); ?>');
758
+ // jQuery('#loadMore_< ?php echo $fts_dynamic_name ?>').removeClass('flip360-fts-load-more');
759
+ jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").removeClass('fts-fb-spinner');
760
 
 
 
 
 
 
 
 
761
 
762
+ }
763
+ }); // end of ajax()
764
+ return false;
765
+ }); // end of form.submit
766
+ }); // end of document.ready
767
+ </script>
768
+ <?php
769
 
770
+ } //END Make sure it's not ajaxing
771
+ ?>
772
+ <script>
773
+ <?php if ( ! isset( $_GET['locations'] ) ) { ?>
774
+ var nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>= "<?php echo esc_url_raw( $_REQUEST['next_url'] ); ?>";
775
+ // alert('nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>');
776
+ <?php } ?>
777
+
778
+
779
+ if (document.querySelector('#fts-fb-token-wrap .fts-pages-info') !== null) {
780
+ jQuery(".fts-successful-api-token.default-token").hide();
781
+ }
782
+ <?php if ( 'yes' === $reviews_token || isset( $_GET['fts_reviews_feed'] ) && 'yes' === $_GET['fts_reviews_feed'] ) { ?>
783
+ if (document.querySelector('.default-token') !== null) {
784
+ jQuery(".default-token").show();
785
+ }
786
+
787
+ <?php } ?>
788
+
789
+ jQuery(document).ready(function ($) {
790
+ $(".feed-them-social-admin-submit-btn").click(function () {
791
+ // alert('test');
792
+ var newUrl = "<?php echo esc_url( admin_url( 'admin.php?page=fts-facebook-feed-styles-submenu-page/' ) ); ?>";
793
+ history.replaceState({}, null, newUrl);
794
+ <?php if ( 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] ) { ?>
795
+ $("#fts-facebook-feed-options-form").submit();
796
+ <?php
797
+ } elseif ( 'fts-instagram-feed-styles-submenu-page' === $_GET['page'] ) {
798
+ ?>
799
+ $("#fts-instagram-feed-options-form").submit();
800
+ <?php } ?>
801
+ });
802
+
803
+ var fb = ".fb-page-list .fb-click-wrapper";
804
+ $('#fb-list-wrap').show();
805
+ //alert("reviews_token");
806
+
807
+ $(fb).click(function () {
808
+ var fb_page_id = $(this).find('.fts-api-facebook-id').html();
809
+ var token = $(this).find('.page-token').html();
810
+
811
+ // alert(token);
812
+ var name = $(this).find('.fb-name').html();
813
+ var profile_image = $(this).find('.fb-image img').attr('src');
814
+ <?php if ( isset( $_GET['feed_type'] ) && 'instagram' === $_GET['feed_type'] ) { ?>
815
+ $("#fts_facebook_instagram_custom_api_token").val(token);
816
+ $("#fts_facebook_instagram_custom_api_token_user_id").val(fb_page_id);
817
+ $("#fts_facebook_instagram_custom_api_token_user_name").val(name);
818
+ $("#fts_facebook_instagram_custom_api_token_profile_image").val(profile_image);
819
+ <?php
820
  } elseif ( 'no' === $reviews_token || isset( $_GET['fts_reviews_feed'] ) && 'no' === $_GET['fts_reviews_feed'] ) {
821
+ ?>
822
+ $("#fts_facebook_custom_api_token").val(token);
823
+ $("#fts_facebook_custom_api_token_user_id").val(fb_page_id);
824
+ $("#fts_facebook_custom_api_token_user_name").val(name);
825
+ $("#fts_facebook_custom_api_token_profile_image").val(profile_image);
826
+ <?php
827
  } else {
828
+ ?>
829
+ $("#fts_facebook_custom_api_token_biz").val(token);
830
+ $("#fts_facebook_custom_api_token_user_id_biz").val(fb_page_id);
831
+ $("#fts_facebook_custom_api_token_user_name_biz").val(name);
832
+ $("#fts_facebook_custom_api_token_biz_profile_image").val(profile_image);
833
+ <?php } ?>
834
+ $('.fb-page-list .feed-them-social-admin-submit-btn').hide();
835
+ $(this).find('.feed-them-social-admin-submit-btn').toggle();
836
+ // alert(name + token)
837
+ })
838
+ });
839
+ </script>
840
+ <?php
841
+ // Make sure it's not ajaxing!
842
+ if ( ! isset( $_GET['load_more_ajaxing'] ) && isset( $test_fb_app_token_response->paging->next ) && ! isset( $_GET['locations'] ) ) {
843
+ $fts_dynamic_name = sanitize_key( $_REQUEST['fts_dynamic_name'] );
844
+ echo '<div class="fts-clear"></div>';
845
+
846
+ echo '<div id="loadMore_' . esc_attr( $fts_dynamic_name ) . '" class="fts-fb-load-more">' . esc_html( 'Load More', 'feed-them-social' ) . '</div>';
847
+ }//End make sure it's not ajaxing
848
+
849
+ // Lastly if we can't find a next url we unset the next url from the page to not let the loadmore button be active.
850
+ if ( isset( $_GET['locations'] ) ) {
851
+ unset( $_REQUEST['next_location_url'] );
852
+ } else {
853
+ unset( $_REQUEST['next_url'] );
854
+ }
855
+ return ob_get_clean();
856
 
857
+ wp_die();
 
 
 
 
 
 
 
 
858
  }
859
 
860
 
1055
 
1056
  $fts_admin_activation_clear_cache = get_option( 'Feed_Them_Social_Activated_Plugin' );
1057
  $fts_dev_mode_cache = get_option( 'fts_clear_cache_developer_mode' );
1058
+ wp_enqueue_script( 'jquery' );
1059
+
1060
  if ( '1' === $fts_dev_mode_cache || 'feed-them-social' === $fts_admin_activation_clear_cache ) {
1061
  wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/developer-admin.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
1062
  wp_localize_script( 'fts_clear_cache_script', 'ftsAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
1063
+
 
1064
  }
1065
  if ( 'hide-admin-bar-menu' !== $fts_dev_mode_cache && '1' !== $fts_dev_mode_cache ) {
 
1066
  wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/admin.js' ), array(), FTS_CURRENT_VERSION, false );
1067
  wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/developer-admin.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
1068
+ wp_localize_script( 'fts_clear_cache_script', 'ftsAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
1069
+
1070
  }
1071
 
1072
  // we delete this option if found so we only empty the cache once when the plugin is ever activated or updated!
1073
  delete_option( 'Feed_Them_Social_Activated_Plugin' );
1074
  }
1075
 
1076
+ /**
1077
+ * FTS Encrypt Script
1078
+ *
1079
+ * This is for the fts_clear_cache_ajax submission.
1080
+ *
1081
+ * @since 1.9.6
1082
+ */
1083
+ public function fts_encrypt_script() {
1084
+
1085
+ wp_enqueue_script( 'jquery' );
1086
+ wp_enqueue_script( 'fts_encrypt_script', plugins_url( 'feed-them-social/admin/js/encrypt.js' ), array(), FTS_CURRENT_VERSION, false );
1087
+ wp_localize_script( 'fts_encrypt_script', 'ftsAjaxEncrypt', array(
1088
+ 'ajaxurl' => admin_url('admin-ajax.php'),
1089
+ 'nonce' => wp_create_nonce('fts-ajax-nonce')
1090
+ ));
1091
+
1092
+ wp_enqueue_script( 'fts_clear_cache_script' );
1093
+ }
1094
+
1095
  /**
1096
  * Feed Them Main Menu
1097
  *
3598
  exit( 'Sorry, You can\'t do that!' );
3599
  }
3600
 
3601
+ // This action happens on the Instagram or YouTube Options page if the save change button is pushed.
3602
  if ( isset( $_REQUEST['button_pushed'] ) && 'yes' === $_REQUEST['button_pushed'] ) {
3603
 
3604
  if( 'youtube' === $_REQUEST['feed'] && !empty( $_REQUEST['refresh_token'] ) ){
3609
  update_option( 'fts_instagram_custom_api_token', sanitize_text_field( wp_unslash( $_REQUEST['access_token'] ) ) );
3610
  }
3611
  }
 
3612
 
3613
+ // This needs to work if users is authenticated or not so instead of passing request values from ajax we're just going to use it to fire our function.
3614
+ if( 'instagram' === $_REQUEST['feed'] ){
3615
 
3616
+ $check_token = get_option( 'fts_instagram_custom_api_token' );
3617
+ $check_basic_token_value = false !== $this->data_protection->decrypt( $check_token ) ? $this->data_protection->decrypt( $check_token ) : $check_token;
3618
+ $oauth2token_url = esc_url_raw( 'https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=' . $check_basic_token_value );
3619
+
3620
+ $response = wp_remote_get( $oauth2token_url );
3621
+
3622
+ $auth_obj = json_decode( wp_remote_retrieve_body( $response ), true );
3623
+
3624
+ // print_r( $auth_obj['expires_in'] );
3625
+
3626
+ // Take the time() + $expires_in will equal the current date and time in seconds plus 60 days in seconds.
3627
+ // For now we are going to get a new token every 7 days just to be on the safe side.
3628
+ // That means we will negate 53 days from the seconds which is 4579200 <-- https://www.convertunits.com/from/60+days/to/seconds
3629
+ // We get 60 days to refresh the token, if it's not refreshed before then it will expire.
3630
+
3631
+ $time_minus_fiftythree_days = $auth_obj['expires_in'] - 4579200;
3632
+ $expires_in = $time_minus_fiftythree_days + time();
3633
+
3634
+ // test.
3635
+ // echo ' asdfasdfasdfasdf ';
3636
+ // This is our refresh token response;
3637
+ // print_r($response['body']);
3638
+ // test.
3639
+ //$auth_obj['access_token'] = '';
3640
+
3641
+ // Return if no access token queried from refresh token. This will stop error on front end feed if cached already.
3642
+ if( empty( $auth_obj['access_token'] ) ){
3643
+ return;
3644
  }
 
 
 
 
3645
 
3646
+ $encrypted_token = $this->data_protection->encrypt( $auth_obj['access_token'] );
3647
 
3648
+ update_option( 'fts_instagram_custom_api_token', sanitize_text_field( wp_unslash( $encrypted_token ) ) );
3649
+
3650
+ $startoftime = isset( $expires_in ) ? $expires_in : '';
3651
  $start_of_time_final = false !== $startoftime ? sanitize_key( $startoftime ) : '';
3652
+ update_option( 'fts_instagram_custom_api_token_expires_in', sanitize_text_field( wp_unslash( $start_of_time_final ) ) );
3653
+
3654
+ // Testing. Output to console.log so we can see confirmation.
3655
+ // echo sanitize_text_field( $expires_in );
3656
+ // echo '<br/>';
3657
  }
3658
 
3659
+ if( 'youtube' === $_REQUEST['feed'] ){
3660
 
3661
+ update_option( 'youtube_custom_access_token', sanitize_text_field( wp_unslash( $_REQUEST['access_token'] ) ) );
 
 
3662
 
3663
+ $startoftime = isset( $_REQUEST['expires_in'] ) ? strtotime( '+' . $_REQUEST['expires_in'] . ' seconds' ) : '';
3664
+ $start_of_time_final = false !== $startoftime ? sanitize_key( $startoftime ) : '';
3665
+ update_option( 'youtube_custom_token_exp_time', sanitize_text_field( wp_unslash( $start_of_time_final ) ) );
3666
  }
3667
 
3668
  // This only happens if the token is expired on the YouTube Options page and you go to re-save or refresh the page for some reason. It will also run this function if the cache is emptied and the token is found to be expired.
3669
  if ( 'no' === $_REQUEST['button_pushed'] ) {
3670
+ // echo esc_html( 'Token Refreshed: ' );
3671
  // $output .= do_shortcode('[fts _youtube vid_count=3 large_vid=no large_vid_title=no large_vid_description=no thumbs_play_in_iframe=popup vids_in_row=3 space_between_videos=1px force_columns=yes maxres_thumbnail_images=yes thumbs_wrap_color=#000 wrap=none video_wrap_display=none comments_count=12 channel_id=UCqhnX4jA0A5paNd1v-zEysw loadmore=button loadmore_count=5 loadmore_btn_maxwidth=300px loadmore_btn_margin=10px]');
3672
  }
3673
 
3674
+ // Testing. Output to console.log so we can see confirmation.
3675
+ // echo sanitize_text_field( $_REQUEST['access_token'] );
3676
 
3677
+ wp_die( 'Sorry, You can\'t do that!');
3678
  }
3679
 
3680
  /**
3684
  */
3685
  public function feed_them_instagram_refresh_token() {
3686
 
 
 
 
 
3687
  // Used some methods from this link http://ieg.wnet.org/2015/09/using-oauth-in-wordpress-plugins-part-2-persistence/
3688
  // save all 3 get options: happens when clicking the get access token button on the instagram options page!
3689
  if ( isset( $_GET['access_token'], $_GET['expires_in'] ) ) {
3694
  } else {
3695
  // refresh token!
3696
  $button_pushed = 'no';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3697
 
3698
  }
3699
 
3707
  <script>
3708
  jQuery(document).ready(function () {
3709
 
3710
+ var fts_time = "<?php echo esc_js( $time ); ?>";
3711
  var fts_security = "<?php echo esc_js( $nonce ); ?>";
3712
 
3713
  jQuery.ajax({
3714
  data: {
3715
  action: "fts_refresh_token_ajax",
 
 
3716
  button_pushed: '<?php echo esc_js( $button_pushed ); ?>',
3717
  fts_security: fts_security,
3718
  fts_time: fts_time,
3779
  </script>
3780
  <?php
3781
  // return $auth_obj['access_token'];
 
3782
  }
3783
 
3784
  /**
3788
  */
3789
  public function feed_them_youtube_refresh_token() {
3790
 
 
 
 
 
3791
  // Used some methods from this link http://ieg.wnet.org/2015/09/using-oauth-in-wordpress-plugins-part-2-persistence/
3792
  // Save all 3 get options: happens when clicking the get access token button on the youtube options page.
3793
  // A Refresh token is only available when clicking through the oAuth process.
3841
  return print_r($response);
3842
  }
3843
  }
3844
+
3845
+ $time = time();
3846
+ $nonce = wp_create_nonce( $time . 'fts_refresh_token_nonce' );
3847
  ?>
3848
  <script>
3849
  jQuery(document).ready(function () {
3850
+
3851
+ var fts_time = "<?php echo esc_js( $time ); ?>";
3852
+ var fts_security = "<?php echo esc_js( $nonce ); ?>";
3853
+
3854
  jQuery.ajax({
3855
  data: {
3856
  action: "fts_refresh_token_ajax",
3858
  access_token: '<?php echo esc_js( $access_token ) ?>',
3859
  expires_in: '<?php echo esc_js( $expires_in ) ?>',
3860
  button_pushed: '<?php echo esc_js( $button_pushed ); ?>',
3861
+ fts_security: fts_security,
3862
+ fts_time: fts_time,
3863
  feed: 'youtube'
3864
  },
3865
  type: 'POST',
3866
  url: ftsAjax.ajaxurl,
3867
  success: function (response) {
3868
  console.log(response);
3869
+ // alert( response );
3870
  <?php
3871
  if ( isset( $_GET['page'] ) && 'fts-youtube-feed-styles-submenu-page' === $_GET['page'] ) {
3872
 
3924
  return false;
3925
  }); // end of document.ready
3926
  </script>
3927
+ <?php
 
3928
  }
3929
 
3930
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: slickremix, slickchris
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
  Tested up to: 6.0.1
6
- Stable tag: 2.9.9
7
  License: GPLv2 or later
8
 
9
  Display a Custom Facebook feed, Instagram feed, Twitter feed, and YouTube feed on pages, posts or widgets.
@@ -72,8 +72,13 @@ Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](h
72
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
73
 
74
  == Changelog ==
 
 
 
 
 
75
  = Version 2.9.9 Tuesday, July 12th, 2022 =
76
- * FIX: Sanitize output of access token from fts_refresh_token_ajax function.
77
 
78
  = Version 2.9.8.6 Monday, July 11th, 2022 =
79
  * FIX: Facebook Feed: Share option was throwing invalid APP ID error.
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
  Tested up to: 6.0.1
6
+ Stable tag: 3.0.1
7
  License: GPLv2 or later
8
 
9
  Display a Custom Facebook feed, Instagram feed, Twitter feed, and YouTube feed on pages, posts or widgets.
72
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
73
 
74
  == Changelog ==
75
+ = Version 3.0.1 Wednesday, July 20th, 2022 =
76
+ * FIX: Facebook Options Page: notice if $test_fb_app_token_response->error was empty.
77
+ * FIX: XSS Vulnerability: fts_fb_page_token_func, fts_instagram_token_ajax, feed_them_instagram_save_token
78
+ * FIX: Remove unnecessary/redundant nonce checks.
79
+
80
  = Version 2.9.9 Tuesday, July 12th, 2022 =
81
+ * FIX: Sanitize output of access_token from fts_refresh_token_ajax function.
82
 
83
  = Version 2.9.8.6 Monday, July 11th, 2022 =
84
  * FIX: Facebook Feed: Share option was throwing invalid APP ID error.