Custom Facebook Feed - Version 4.0.2

Version Description

  • Important: With this update, the Custom CSS and Custom JS settings have been deprecated. Please see below for details.
  • Tweak: If any Custom CSS was being used in this field then it will be automatically moved into the native WordPress Customizer "Additional CSS" field instead and continue to work as normal.
  • Tweak: If any Custom JavaScript was being used, then this update will prevent that JavaScript from working. There are directions here on how you can migrate this JavaScript into a specialized plugin instead.
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Custom Facebook Feed
Version 4.0.2
Comparing to
See all releases

Code changes from version 4.0.1 to 4.0.2

README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Facebook, Facebook feed, Facebook posts, Facebook group, Facebook page
4
  Requires at least: 4.1
5
  Requires PHP: 5.6
6
  Tested up to: 5.8
7
- Stable tag: 4.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -262,6 +262,11 @@ The most common reason for this is that an add-on or extension you have installe
262
  9. It's super easy to display your Facebook feed in any page or post
263
 
264
  == Changelog ==
 
 
 
 
 
265
  = 4.0.1 =
266
  * Fix: Fixed a compatibility issue with the Complianz Cookie Consent plugin integration.
267
  * Fix: Removed the limit to the number of sources shown at one time when creating a feed.
4
  Requires at least: 4.1
5
  Requires PHP: 5.6
6
  Tested up to: 5.8
7
+ Stable tag: 4.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
262
  9. It's super easy to display your Facebook feed in any page or post
263
 
264
  == Changelog ==
265
+ = 4.0.2 =
266
+ * Important: With this update, the Custom CSS and Custom JS settings have been deprecated. Please see below for details.
267
+ * Tweak: If any Custom CSS was being used in this field then it will be automatically moved into the native WordPress Customizer "Additional CSS" field instead and continue to work as normal.
268
+ * Tweak: If any Custom JavaScript was being used, then this update will prevent that JavaScript from working. There are [directions here](https://smashballoon.com/doc/moving-custom-javascript-code-out-of-our-plugins/) on how you can migrate this JavaScript into a specialized plugin instead.
269
+
270
  = 4.0.1 =
271
  * Fix: Fixed a compatibility issue with the Complianz Cookie Consent plugin integration.
272
  * Fix: Removed the limit to the number of sources shown at one time when creating a feed.
admin/admin-functions.php CHANGED
@@ -5375,6 +5375,29 @@ function cff_admin_hide_unrelated_notices() {
5375
  }
5376
  add_action( 'admin_print_scripts', 'cff_admin_hide_unrelated_notices' );
5377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5378
  function cff_free_add_caps() {
5379
  global $wp_roles;
5380
 
@@ -5434,4 +5457,138 @@ function cff_clear_error_log() {
5434
 
5435
  die();
5436
  }
5437
- add_action( 'wp_ajax_cff_clear_error_log', 'cff_clear_error_log' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5375
  }
5376
  add_action( 'admin_print_scripts', 'cff_admin_hide_unrelated_notices' );
5377
 
5378
+ /**
5379
+ * Remove admin notices from inside our plugin screens so we can show our customized notices
5380
+ *
5381
+ * @since 4.0
5382
+ */
5383
+ add_action( 'in_admin_header', 'cff_remove_admin_notices' );
5384
+ function cff_remove_admin_notices() {
5385
+ $current_screen = get_current_screen();
5386
+ $not_allowed_screens = array(
5387
+ 'facebook-feed_page_cff-feed-builder',
5388
+ 'facebook-feed_page_cff-settings',
5389
+ 'facebook-feed_page_cff-oembeds-manager',
5390
+ 'facebook-feed_page_cff-extensions-manager',
5391
+ 'facebook-feed_page_cff-about-us',
5392
+ 'facebook-feed_page_cff-support',
5393
+ );
5394
+
5395
+ if ( in_array( $current_screen->base, $not_allowed_screens ) ) {
5396
+ remove_all_actions('admin_notices');
5397
+ remove_all_actions('all_admin_notices');
5398
+ }
5399
+ }
5400
+
5401
  function cff_free_add_caps() {
5402
  global $wp_roles;
5403
 
5457
 
5458
  die();
5459
  }
5460
+ add_action( 'wp_ajax_cff_clear_error_log', 'cff_clear_error_log' );
5461
+
5462
+ function cff_custom_cssjs_notice() {
5463
+ $cff_statuses_option = get_option( 'cff_statuses', array() );
5464
+ if ( ! empty( $cff_statuses_option['custom_js_css_dismissed'] ) ) {
5465
+ return;
5466
+ }
5467
+
5468
+ if ( ! empty( $_GET['cff_dismiss_notice'] ) && $_GET['cff_dismiss_notice'] === 'customjscss' ) {
5469
+ $cff_statuses_option['custom_js_css_dismissed'] = true;
5470
+ update_option( 'cff_statuses', $cff_statuses_option, false );
5471
+ return;
5472
+ }
5473
+ $cff_style_settings = get_option( 'cff_style_settings' );
5474
+
5475
+ $custom_js_not_empty = ! empty( $cff_style_settings['cff_custom_js'] ) && trim($cff_style_settings['cff_custom_js']) !== '';
5476
+ $custom_css_not_empty = ! empty( $cff_style_settings['cff_custom_css_read_only'] ) && trim($cff_style_settings['cff_custom_css_read_only']) !== '';
5477
+
5478
+ if ( ! $custom_js_not_empty && ! $custom_css_not_empty ) {
5479
+ return;
5480
+ }
5481
+ $close_href = add_query_arg( array( 'cff_dismiss_notice' => 'customjscss' ) );
5482
+
5483
+ ?>
5484
+ <div class="notice notice-warning is-dismissible cff-dismissible">
5485
+ <p><?php if ( $custom_js_not_empty ) : ?>
5486
+ <?php echo sprintf( __( 'You are currently using Custom CSS or JavaScript in the Custom Facebook Feed plugin, however, these settings have now been deprecated. To continue using any custom code, please go to the Custom CSS and JS settings %shere%s and follow the directions.', 'custom-facebook-feed' ), '<a href="' . admin_url( 'admin.php?page=cff-settings&view=feeds' ) . '">', '</a>' ); ?>
5487
+ <?php else : ?>
5488
+ <?php echo sprintf( __( 'You are currently using Custom CSS in the Custom Facebook Feed plugin, however, this setting has now been deprecated. Your CSS has been moved to the "Additional CSS" field in the WordPress Customizer %shere%s instead.', 'custom-facebook-feed' ), '<a href="' . esc_url( wp_customize_url() ) . '">', '</a>' ); ?>
5489
+ <?php endif; ?>
5490
+ &nbsp;<a href="<?php echo esc_attr( $close_href ); ?>"><?php echo __( 'Dismiss', 'custom-facebook-feed' ); ?></a>
5491
+ </p>
5492
+ </div>
5493
+ <?php
5494
+ }
5495
+ add_action( 'admin_notices', 'cff_custom_cssjs_notice' );
5496
+ add_action( 'cff_admin_notices', 'cff_custom_cssjs_notice' );
5497
+
5498
+ function cff_dismiss_custom_cssjs_notice() {
5499
+ $cap = current_user_can( 'manage_custom_facebook_feed_options' ) ? 'manage_custom_facebook_feed_options' : 'manage_options';
5500
+ $cap = apply_filters( 'cff_settings_pages_capability', $cap );
5501
+ //Only display notice to admins
5502
+ if ( !current_user_can( $cap ) ) return;
5503
+
5504
+ $cff_statuses_option = get_option( 'cff_statuses', array() );
5505
+ $cff_statuses_option['custom_js_css_dismissed'] = true;
5506
+ update_option( 'cff_statuses', $cff_statuses_option, false );
5507
+ }
5508
+ add_action( 'wp_ajax_cff_dismiss_custom_cssjs_notice', 'cff_dismiss_custom_cssjs_notice' );
5509
+
5510
+ /**
5511
+ * Adds CSS to the end of the customizer "Additonal CSS" setting
5512
+ *
5513
+ * @param $custom_css
5514
+ *
5515
+ * @return bool|int
5516
+ *
5517
+ * @since 4.0.2/4.0.7
5518
+ */
5519
+ function cff_transfer_css( $custom_css ) {
5520
+ $value = '';
5521
+ $post = wp_get_custom_css_post( get_stylesheet() );
5522
+ if ( $post ) {
5523
+ $value = $post->post_content;
5524
+ }
5525
+ $value .= "\n\n/* Custom Facebook Feed */\n" . $custom_css . "\n/* Custom Facebook Feed - End */";
5526
+
5527
+ $r = wp_update_custom_css_post(
5528
+ $value,
5529
+ array(
5530
+ 'stylesheet' => get_stylesheet(),
5531
+ )
5532
+ );
5533
+
5534
+ if ( $r instanceof WP_Error ) {
5535
+ return false;
5536
+ }
5537
+ $post_id = $r->ID;
5538
+
5539
+ return $post_id;
5540
+ }
5541
+
5542
+ /**
5543
+ * Validates CSS to detect anything that might be harmful
5544
+ *
5545
+ * @param $css
5546
+ *
5547
+ * @return bool|WP_Error
5548
+ *
5549
+ * @since 4.0.2/4.0.7
5550
+ */
5551
+ function cff_validate_css( $css ) {
5552
+ $validity = new WP_Error();
5553
+
5554
+ if ( preg_match( '#</?\w+#', $css ) ) {
5555
+ $validity->add( 'illegal_markup', __( 'Markup is not allowed in CSS.' ) );
5556
+ }
5557
+
5558
+ if ( ! $validity->has_errors() ) {
5559
+ $validity = true;
5560
+ }
5561
+ return $validity;
5562
+ }
5563
+
5564
+ /**
5565
+ * Check to see if CSS has been transferred
5566
+ *
5567
+ * @since 4.0.2/4.0.7
5568
+ */
5569
+ function cff_check_custom_css() {
5570
+ $cff_style_settings = get_option( 'cff_style_settings', array() );
5571
+ $custom_css = isset( $cff_style_settings['cff_custom_css'] ) ? stripslashes( trim( $cff_style_settings['cff_custom_css'] ) ) : '';
5572
+
5573
+ // only try once
5574
+ if ( empty( $custom_css ) ) {
5575
+ return;
5576
+ }
5577
+
5578
+ // custom css set to nothing after trying the update once
5579
+ $cff_style_settings['cff_custom_css_read_only'] = $custom_css;
5580
+ $cff_style_settings['cff_custom_css'] = '';
5581
+ update_option( 'cff_style_settings', $cff_style_settings );
5582
+ if ( ! function_exists( 'wp_get_custom_css_post' )
5583
+ || ! function_exists( 'wp_update_custom_css_post' ) ) {
5584
+ return;
5585
+ }
5586
+
5587
+ // make sure this is valid CSS or don't transfer
5588
+ if ( is_wp_error( cff_validate_css( $custom_css ) ) ) {
5589
+ return;
5590
+ }
5591
+
5592
+ cff_transfer_css( $custom_css );
5593
+ }
5594
+ add_action( 'init', 'cff_check_custom_css' );
admin/assets/css/settings.css CHANGED
@@ -1882,5 +1882,25 @@ Sources Instance Popup
1882
  }
1883
 
1884
  .sb-tab-content > div {
1885
- min-height: 800px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1886
  }
1882
  }
1883
 
1884
  .sb-tab-content > div {
1885
+ min-height: 520px;
1886
+ }
1887
+ .sb-form-field .sb-disabled-custom-code textarea{
1888
+ display: block;
1889
+ margin: 20px 0 0 0;
1890
+ padding: 10px;
1891
+ background: rgba(0, 0, 0, 0.07);
1892
+ width: 100%;
1893
+ height: 300px;
1894
+ overflow-y: scroll;
1895
+ border: 1px solid #ccc;
1896
+ color: #555;
1897
+ }
1898
+ .sb-form-field code {
1899
+ background: none;
1900
+ padding: 0;
1901
+ width: 100%;
1902
+ height: 300px;
1903
+ overflow-y: scroll;
1904
+ border: 1px solid #ccc;
1905
+ color: #666;
1906
  }
admin/assets/js/cff-admin-scripts.js CHANGED
@@ -30,6 +30,21 @@ jQuery(document).ready(function($) {
30
  });
31
  });
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  //The "cff_ppca_access_token_invalid" transient is set if the access token doesn't match the ID specified. Use an Ajax call to check whether that transient is set, and if so, then displays a notice under the access token field. This used so we don't need to make an API call every time the page loads. It stores the value in this transient and checks it via ajax.
34
  $.ajax({
35
  url : cffA.ajax_url,
30
  });
31
  });
32
 
33
+ $('body').on('click','.cff-dismissible .notice-dismiss',function() {
34
+ $.ajax({
35
+ url : cffA.ajax_url,
36
+ type : 'post',
37
+ data : {
38
+ action : 'cff_dismiss_custom_cssjs_notice'
39
+ },
40
+ success : function(data) {
41
+ },
42
+ error : function(e) {
43
+ console.log(e);
44
+ }
45
+ });
46
+ });
47
+
48
  //The "cff_ppca_access_token_invalid" transient is set if the access token doesn't match the ID specified. Use an Ajax call to check whether that transient is set, and if so, then displays a notice under the access token field. This used so we don't need to make an API call every time the page loads. It stores the value in this transient and checks it via ajax.
49
  $.ajax({
50
  url : cffA.ajax_url,
admin/views/settings/tab/feeds.php CHANGED
@@ -114,27 +114,25 @@
114
  </div>
115
  </div>
116
  </div>
117
- <div class="sb-tab-box sb-custom-css-box sb-reset-box-style clearfix">
118
  <div class="tab-label">
119
  <h3>{{feedsTab.customCSSBox.title}}</h3>
120
  </div>
121
  <div class="cff-tab-form-field">
122
  <div class="sb-form-field">
123
- <div class="d-flex mb-15">
124
- <textarea name="" class="cff-textarea" v-model="model.feeds.customCSS" :placeholder="feedsTab.customCSSBox.placeholder"></textarea>
125
- </div>
126
  </div>
127
  </div>
128
  </div>
129
- <div class="sb-tab-box sb-custom-js-box clearfix">
130
  <div class="tab-label">
131
  <h3>{{feedsTab.customJSBox.title}}</h3>
132
  </div>
133
  <div class="cff-tab-form-field">
134
  <div class="sb-form-field">
135
- <div class="d-flex mb-15">
136
- <textarea name="" class="cff-textarea" v-model="model.feeds.customJS" :placeholder="feedsTab.customJSBox.placeholder"></textarea>
137
- </div>
138
  </div>
139
  </div>
140
  </div>
114
  </div>
115
  </div>
116
  </div>
117
+ <div class="sb-tab-box sb-custom-css-box sb-reset-box-style clearfix" v-if="model.feeds.customCSS !== ''">
118
  <div class="tab-label">
119
  <h3>{{feedsTab.customCSSBox.title}}</h3>
120
  </div>
121
  <div class="cff-tab-form-field">
122
  <div class="sb-form-field">
123
+ <div class="sb-custom-cssjs-notice" v-html="feedsTab.customCSSBox.message"></div>
124
+ <div class="sb-disabled-custom-code"><textarea readonly v-html="model.feeds.customCSS"></textarea></div>
 
125
  </div>
126
  </div>
127
  </div>
128
+ <div class="sb-tab-box sb-custom-js-box clearfix" v-if="model.feeds.customJS !== ''">
129
  <div class="tab-label">
130
  <h3>{{feedsTab.customJSBox.title}}</h3>
131
  </div>
132
  <div class="cff-tab-form-field">
133
  <div class="sb-form-field">
134
+ <div class="sb-custom-cssjs-notice" v-html="feedsTab.customJSBox.message"></div>
135
+ <div class="sb-disabled-custom-code"><textarea readonly v-html="model.feeds.customJS"></textarea></div>
 
136
  </div>
137
  </div>
138
  </div>
custom-facebook-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Smash Balloon Custom Facebook Feed
4
  Plugin URI: https://smashballoon.com/custom-facebook-feed
5
  Description: Add completely customizable Facebook feeds to your WordPress site
6
- Version: 4.0.1
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
27
 
28
- define('CFFVER', '4.0.1');
29
  define( 'WPW_SL_STORE_URL', 'https://smashballoon.com/' );
30
  define( 'WPW_SL_ITEM_NAME', 'Custom Facebook Feed WordPress Plugin Personal' ); //*!*Update Plugin Name at top of file*!*
31
 
3
  Plugin Name: Smash Balloon Custom Facebook Feed
4
  Plugin URI: https://smashballoon.com/custom-facebook-feed
5
  Description: Add completely customizable Facebook feeds to your WordPress site
6
+ Version: 4.0.2
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
25
  */
26
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
27
 
28
+ define('CFFVER', '4.0.2');
29
  define( 'WPW_SL_STORE_URL', 'https://smashballoon.com/' );
30
  define( 'WPW_SL_ITEM_NAME', 'Custom Facebook Feed WordPress Plugin Personal' ); //*!*Update Plugin Name at top of file*!*
31
 
inc/Admin/CFF_Global_Settings.php CHANGED
@@ -916,10 +916,12 @@ class CFF_Global_Settings {
916
  'customCSSBox' => array(
917
  'title' => __( 'Custom CSS', 'custom-facebook-feed' ),
918
  'placeholder' => __( 'Enter any custom CSS here', 'custom-facebook-feed' ),
 
919
  ),
920
  'customJSBox' => array(
921
  'title' => __( 'Custom JS', 'custom-facebook-feed' ),
922
  'placeholder' => __( 'Enter any custom JS here', 'custom-facebook-feed' ),
 
923
  )
924
  ),
925
  'translationTab' => array(
@@ -1363,6 +1365,18 @@ class CFF_Global_Settings {
1363
  $active_gdpr_plugin = CFF_GDPR_Integrations::gdpr_plugins_active();
1364
  $cff_cache_time = get_option( 'cff_cache_time', 1 );
1365
  $cff_cache_time_unit = get_option( 'cff_cache_time_unit', 'hours' );
 
 
 
 
 
 
 
 
 
 
 
 
1366
 
1367
  return array(
1368
  'general' => array(
@@ -1379,8 +1393,8 @@ class CFF_Global_Settings {
1379
  'cacheTimeUnit' => $cff_cache_time_unit,
1380
  'gdpr' => $cff_style_settings['gdpr'],
1381
  'gdprPlugin' => $active_gdpr_plugin,
1382
- 'customCSS' => isset( $cff_style_settings['cff_custom_css'] ) ? $cff_style_settings['cff_custom_css'] : '',
1383
- 'customJS' => stripslashes( isset( $cff_style_settings['cff_custom_js'] ) ? $cff_style_settings['cff_custom_js'] : '' ),
1384
  ),
1385
  'translation' => array(
1386
  'cff_see_more_text' => $cff_style_settings['cff_see_more_text'],
916
  'customCSSBox' => array(
917
  'title' => __( 'Custom CSS', 'custom-facebook-feed' ),
918
  'placeholder' => __( 'Enter any custom CSS here', 'custom-facebook-feed' ),
919
+ 'message' => sprintf( __( 'The Custom CSS field has been deprecated. Your CSS has been moved into the native WordPress Custom CSS field instead. This is located %shere%s at <i>Appearance > Customize > Additional CSS.</i>', '' ), '<a href="' . esc_url( wp_customize_url() ) . '" target="_blank" rel="noopener noreferrer">', '</a>' )
920
  ),
921
  'customJSBox' => array(
922
  'title' => __( 'Custom JS', 'custom-facebook-feed' ),
923
  'placeholder' => __( 'Enter any custom JS here', 'custom-facebook-feed' ),
924
+ 'message' => sprintf( __( 'The Custom JS field has been deprecated. Your JavaScript is displayed below. To continue using this JavaScript, please first review the code below and follow the directions in %sthis doc%s.', '' ), '<a href="https://smashballoon.com/doc/moving-custom-javascript-code-out-of-our-plugins/?utm_campaign=facebook&utm_source=settings&utm_medium=move-js" target="_blank" rel="noopener noreferrer">', '</a>' )
925
  )
926
  ),
927
  'translationTab' => array(
1365
  $active_gdpr_plugin = CFF_GDPR_Integrations::gdpr_plugins_active();
1366
  $cff_cache_time = get_option( 'cff_cache_time', 1 );
1367
  $cff_cache_time_unit = get_option( 'cff_cache_time_unit', 'hours' );
1368
+ $custom_js_text = ! empty( $cff_style_settings['cff_custom_js'] ) && trim( wp_unslash( $cff_style_settings['cff_custom_js'] ) ) !== '' ? wp_unslash( $cff_style_settings['cff_custom_js'] ) : '';
1369
+ if ( ! empty( $custom_js_text ) ) {
1370
+ $js_html = esc_html( '<!-- Custom Facebook Feed JS -->' ) . "\n";
1371
+ $js_html .= esc_html( '<script type="text/javascript">' ) . "\n";
1372
+ $js_html .= esc_html( 'function cff_custom_js($){' ) . "\n";
1373
+ $js_html .= esc_html( ' var $ = jQuery;' ) . "\n";
1374
+ $js_html .= esc_html( $custom_js_text ) . "\n";
1375
+ $js_html .= esc_html( '}cff_custom_js($);' ) . "\n";
1376
+ $js_html .= esc_html( '</script>' ) . "\n";
1377
+
1378
+ $custom_js_text = $js_html;
1379
+ }
1380
 
1381
  return array(
1382
  'general' => array(
1393
  'cacheTimeUnit' => $cff_cache_time_unit,
1394
  'gdpr' => $cff_style_settings['gdpr'],
1395
  'gdprPlugin' => $active_gdpr_plugin,
1396
+ 'customCSS' => isset( $cff_style_settings['cff_custom_css_read_only'] ) ? esc_html( stripslashes( trim( $cff_style_settings['cff_custom_css_read_only'] ) ) ) : '',
1397
+ 'customJS' => $custom_js_text,
1398
  ),
1399
  'translation' => array(
1400
  'cff_see_more_text' => $cff_style_settings['cff_see_more_text'],
inc/Admin/CFF_Notifications.php CHANGED
@@ -234,6 +234,15 @@ class CFF_Notifications {
234
  $option = $this->get_option();
235
 
236
  foreach ( $notifications as $notification ) {
 
 
 
 
 
 
 
 
 
237
 
238
  // The message and license should never be empty, if they are, ignore.
239
  if ( empty( $notification['content'] ) || empty( $notification['type'] ) ) {
@@ -292,6 +301,16 @@ class CFF_Notifications {
292
  || ( ! empty( $notification['end'] ) && cff_get_current_time() > strtotime( $notification['end'] ) ) ) {
293
  unset( $notifications[ $key ] );
294
  }
 
 
 
 
 
 
 
 
 
 
295
  }
296
 
297
  return $notifications;
234
  $option = $this->get_option();
235
 
236
  foreach ( $notifications as $notification ) {
237
+ // Ignore if max version has been reached
238
+ if ( ! empty( $notification['maxver'] ) && version_compare( $notification['maxver'], CFFVER ) <= 0 ) {
239
+ continue;
240
+ }
241
+
242
+ // Ignore if min version has not been reached
243
+ if ( ! empty( $notification['minver'] ) && version_compare( $notification['minver'], CFFVER ) >= 0 ) {
244
+ continue;
245
+ }
246
 
247
  // The message and license should never be empty, if they are, ignore.
248
  if ( empty( $notification['content'] ) || empty( $notification['type'] ) ) {
301
  || ( ! empty( $notification['end'] ) && cff_get_current_time() > strtotime( $notification['end'] ) ) ) {
302
  unset( $notifications[ $key ] );
303
  }
304
+
305
+ // Ignore if max version has been reached
306
+ if ( ! empty( $notification['maxver'] ) && version_compare( $notification['maxver'], CFFVER ) <= 0 ) {
307
+ unset( $notifications[ $key ] );
308
+ }
309
+
310
+ // Ignore if min version has not been reached
311
+ if ( ! empty( $notification['minver'] ) && version_compare( $notification['minver'], CFFVER ) >= 0 ) {
312
+ unset( $notifications[ $key ] );
313
+ }
314
  }
315
 
316
  return $notifications;
inc/Builder/CFF_Source.php CHANGED
@@ -340,8 +340,9 @@ class CFF_Source {
340
  #$urls['page'] = 'https://api.smashballoon.com/v2/facebook-login.php?state=' . $admin_url_state;
341
  #$urls['group'] = 'https://api.smashballoon.com/v2/facebook-group-login.php?state=' . $admin_url_state;
342
 
343
- $urls['page'] = 'https://connect.smashballoon.com/auth/fb/?state=';
344
- $urls['group'] = 'https://connect.smashballoon.com/auth/fb/?state=';
 
345
  $urls['stateURL'] = $admin_url_state;
346
 
347
  return $urls;
340
  #$urls['page'] = 'https://api.smashballoon.com/v2/facebook-login.php?state=' . $admin_url_state;
341
  #$urls['group'] = 'https://api.smashballoon.com/v2/facebook-group-login.php?state=' . $admin_url_state;
342
 
343
+ $sb_admin_email = get_option('admin_email');
344
+ $urls['page'] = 'https://connect.smashballoon.com/auth/fb/?wordpress_user=' . $sb_admin_email . '&state=';
345
+ $urls['group'] = 'https://connect.smashballoon.com/auth/fb/?wordpress_user=' . $sb_admin_email . '&state=';
346
  $urls['stateURL'] = $admin_url_state;
347
 
348
  return $urls;
inc/Custom_Facebook_Feed.php CHANGED
@@ -267,7 +267,6 @@ final class Custom_Facebook_Feed{
267
 
268
  add_action( 'wp_loaded', [ self::$instance, 'cff_check_for_db_updates' ] );
269
 
270
- add_action( 'wp_head', [ self::$instance, 'cff_custom_css' ] );
271
  add_action( 'wp_footer', [ self::$instance, 'cff_js' ] );
272
 
273
  add_filter( 'cron_schedules', [ self::$instance, 'cff_cron_custom_interval' ] );
@@ -800,20 +799,10 @@ final class Custom_Facebook_Feed{
800
  *
801
  * @since 2.19
802
  * @access public
 
803
  */
804
  function cff_custom_css() {
805
- $options = get_option('cff_style_settings');
806
- isset($options[ 'cff_custom_css' ]) ? $cff_custom_css = $options[ 'cff_custom_css' ] : $cff_custom_css = '';
807
-
808
- if( !empty($cff_custom_css) ) echo "\r\n";
809
- if( !empty($cff_custom_css) ) echo '<!-- Custom Facebook Feed Custom CSS -->';
810
- if( !empty($cff_custom_css) ) echo "\r\n";
811
- if( !empty($cff_custom_css) ) echo '<style type="text/css">';
812
- if( !empty($cff_custom_css) ) echo "\r\n";
813
- if( !empty($cff_custom_css) ) echo stripslashes($cff_custom_css);
814
- if( !empty($cff_custom_css) ) echo "\r\n";
815
- if( !empty($cff_custom_css) ) echo '</style>';
816
- if( !empty($cff_custom_css) ) echo "\r\n";
817
  }
818
 
819
 
@@ -827,7 +816,6 @@ final class Custom_Facebook_Feed{
827
  */
828
  function cff_js() {
829
  $options = get_option('cff_style_settings');
830
- $cff_custom_js = isset($options[ 'cff_custom_js' ]) ? $options[ 'cff_custom_js' ] : '';
831
 
832
  //Link hashtags?
833
  isset($options[ 'cff_link_hashtags' ]) ? $cff_link_hashtags = $options[ 'cff_link_hashtags' ] : $cff_link_hashtags = 'true';
@@ -845,12 +833,6 @@ final class Custom_Facebook_Feed{
845
  echo "\r\n";
846
  echo 'var cfflinkhashtags = "' . $cff_link_hashtags . '";';
847
  echo "\r\n";
848
- if( !empty($cff_custom_js) ) echo "jQuery( document ).ready(function($) {";
849
- if( !empty($cff_custom_js) ) echo "\r\n";
850
- if( !empty($cff_custom_js) ) echo stripslashes($cff_custom_js);
851
- if( !empty($cff_custom_js) ) echo "\r\n";
852
- if( !empty($cff_custom_js) ) echo "});";
853
- if( !empty($cff_custom_js) ) echo "\r\n";
854
  echo '</script>';
855
  echo "\r\n";
856
  }
267
 
268
  add_action( 'wp_loaded', [ self::$instance, 'cff_check_for_db_updates' ] );
269
 
 
270
  add_action( 'wp_footer', [ self::$instance, 'cff_js' ] );
271
 
272
  add_filter( 'cron_schedules', [ self::$instance, 'cff_cron_custom_interval' ] );
799
  *
800
  * @since 2.19
801
  * @access public
802
+ * @deprecated
803
  */
804
  function cff_custom_css() {
805
+
 
 
 
 
 
 
 
 
 
 
 
806
  }
807
 
808
 
816
  */
817
  function cff_js() {
818
  $options = get_option('cff_style_settings');
 
819
 
820
  //Link hashtags?
821
  isset($options[ 'cff_link_hashtags' ]) ? $cff_link_hashtags = $options[ 'cff_link_hashtags' ] : $cff_link_hashtags = 'true';
833
  echo "\r\n";
834
  echo 'var cfflinkhashtags = "' . $cff_link_hashtags . '";';
835
  echo "\r\n";
 
 
 
 
 
 
836
  echo '</script>';
837
  echo "\r\n";
838
  }