Instagram Feed - Version 2.6.1

Version Description

  • Fix: PHP error due to missing file.
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Instagram Feed
Version 2.6.1
Comparing to
See all releases

Code changes from version 2.6 to 2.6.1

README.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: smashballoon, craig-at-smash-balloon
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 3.4
5
- Tested up to: 5.5
6
- Stable tag: 2.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -332,6 +332,9 @@ We understand that sometimes you need help, have issues or just have questions.
332
  * Plus more customization options added all the time!
333
 
334
  == Changelog ==
 
 
 
335
  = 2.6 =
336
  * New: Integrations with popular GDPR cookie consent solutions added: Cookie Notice by dFactory, GDPR Cookie Consent by WebToffee, Cookiebot by Cybot A/S, Complianz by Really Simple Plugins, and Borlabs Cookie by Borlabs. Visit the Instagram Feed settings page, Customize tab, GDPR section for more information.
337
  * Fix: API error notices would not be removed from the WordPress dashboard after successfully reconnecting an account when the problem was resolved.
2
  Contributors: smashballoon, craig-at-smash-balloon
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 3.4
5
+ Tested up to: 5.6
6
+ Stable tag: 2.6.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
332
  * Plus more customization options added all the time!
333
 
334
  == Changelog ==
335
+ = 2.6.1 =
336
+ * Fix: PHP error due to missing file.
337
+
338
  = 2.6 =
339
  * New: Integrations with popular GDPR cookie consent solutions added: Cookie Notice by dFactory, GDPR Cookie Consent by WebToffee, Cookiebot by Cybot A/S, Complianz by Really Simple Plugins, and Borlabs Cookie by Borlabs. Visit the Instagram Feed settings page, Customize tab, GDPR section for more information.
340
  * Fix: API error notices would not be removed from the WordPress dashboard after successfully reconnecting an account when the problem was resolved.
inc/class-sb-instagram-gdpr-integrations.php CHANGED
@@ -1,154 +1,154 @@
1
- <?php
2
- /**
3
- * Class SB_Instagram_GDPR_Integrations
4
- *
5
- * Adds GDPR related workarounds for third-party plugins:
6
- * https://wordpress.org/plugins/cookie-law-info/
7
- *
8
- * @since 2.6/5.9
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- die( '-1' );
13
- }
14
-
15
- class SB_Instagram_GDPR_Integrations {
16
-
17
- /**
18
- * Undoing of Cookie Notice's Instagram Feed related code
19
- * needs to be done late.
20
- */
21
- public static function init() {
22
- add_filter( 'wt_cli_third_party_scripts', array( 'SB_Instagram_GDPR_Integrations', 'undo_script_blocking' ), 11 );
23
- }
24
-
25
- /**
26
- * Prevents changes made to how JavaScript file is added to
27
- * pages.
28
- */
29
- public static function undo_script_blocking() {
30
- $settings = sbi_get_database_settings();
31
- if ( ! SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
32
- return;
33
- }
34
- remove_filter( 'wt_cli_third_party_scripts', 'wt_cli_instagram_feed_script' );
35
- }
36
-
37
- /**
38
- * Whether or not consent plugins that Instagram Feed
39
- * is compatible with are active.
40
- *
41
- * @return bool|string
42
- */
43
- public static function gdpr_plugins_active() {
44
- if ( class_exists( 'Cookie_Notice' ) ) {
45
- return 'Cookie Notice by dFactory';
46
- }
47
- if ( function_exists( 'run_cookie_law_info' ) ) {
48
- return 'GDPR Cookie Consent by WebToffee';
49
- }
50
- if ( class_exists( 'Cookiebot_WP' ) ) {
51
- return 'Cookiebot by Cybot A/S';
52
- }
53
- if ( class_exists( 'COMPLIANZ' ) ) {
54
- return 'Complianz by Really Simple Plugins';
55
- }
56
- if ( function_exists('BorlabsCookieHelper') ) {
57
- return 'Borlabs Cookie by Borlabs';
58
- }
59
-
60
- return false;
61
- }
62
-
63
- /**
64
- * GDPR features can be added automatically, forced enabled,
65
- * or forced disabled.
66
- *
67
- * @param $settings
68
- *
69
- * @return bool
70
- */
71
- public static function doing_gdpr( $settings ) {
72
- $gdpr = isset( $settings['gdpr'] ) ? $settings['gdpr'] : 'auto';
73
- if ( $gdpr === 'no' ) {
74
- return false;
75
- }
76
- if ( $gdpr === 'yes' ) {
77
- return true;
78
- }
79
- return (SB_Instagram_GDPR_Integrations::gdpr_plugins_active() !== false);
80
- }
81
-
82
- /**
83
- * GDPR features are reliant on the image resizing features
84
- *
85
- * @param bool $retest
86
- *
87
- * @return bool
88
- */
89
- public static function gdpr_tests_successful( $retest = true ) {
90
- $sbi_statuses_option = get_option( 'sbi_statuses', array() );
91
-
92
- if ( ! isset( $sbi_statuses_option['gdpr'] ) || $retest ) {
93
- $test_image = trailingslashit( SBI_PLUGIN_URL ) . 'img/placeholder.png';
94
-
95
- $image_editor = wp_get_image_editor( $test_image );
96
-
97
- // not uncommon for the image editor to not work using it this way
98
- if ( ! is_wp_error( $image_editor ) ) {
99
- $sbi_statuses_option['gdpr']['image_editor'] = true;
100
- } else {
101
- $sbi_statuses_option['gdpr']['image_editor'] = false;
102
- }
103
-
104
- $upload = wp_upload_dir();
105
- $upload_dir = $upload['basedir'];
106
- $upload_dir = trailingslashit( $upload_dir ) . SBI_UPLOADS_NAME;
107
- if ( file_exists( $upload_dir ) ) {
108
- $sbi_statuses_option['gdpr']['upload_dir'] = true;
109
- } else {
110
- $sbi_statuses_option['gdpr']['upload_dir'] = false;
111
- }
112
-
113
- global $wpdb;
114
- $table_name = esc_sql( $wpdb->prefix . SBI_INSTAGRAM_POSTS_TYPE );
115
- $sbi_statuses_option['gdpr']['tables'] = true;
116
- if ( $wpdb->get_var( "show tables like '$table_name'" ) != $table_name ) {
117
- $sbi_statuses_option['gdpr']['tables'] = false;
118
- }
119
-
120
- $feeds_posts_table_name = esc_sql( $wpdb->prefix . SBI_INSTAGRAM_FEEDS_POSTS );
121
- if ( $wpdb->get_var( "show tables like '$feeds_posts_table_name'" ) != $feeds_posts_table_name ) {
122
- $sbi_statuses_option['gdpr']['tables'] = false;
123
- }
124
-
125
- update_option( 'sbi_statuses', $sbi_statuses_option );
126
- }
127
-
128
- if ( ! $sbi_statuses_option['gdpr']['upload_dir']
129
- || ! $sbi_statuses_option['gdpr']['tables']
130
- || ! $sbi_statuses_option['gdpr']['image_editor'] ) {
131
- return false;
132
- }
133
-
134
- return true;
135
- }
136
-
137
- public static function gdpr_tests_error_message() {
138
- $sbi_statuses_option = get_option( 'sbi_statuses', array() );
139
-
140
- $errors = array();
141
- if ( ! $sbi_statuses_option['gdpr']['upload_dir'] ) {
142
- $errors[] = __( 'A folder for storing resized images was not successfully created.' );
143
- }
144
- if ( ! $sbi_statuses_option['gdpr']['tables'] ) {
145
- $errors[] = __( 'Tables used for storing information about resized images were not successfully created.' );
146
- }
147
- if ( ! $sbi_statuses_option['gdpr']['image_editor'] ) {
148
- $errors[] = sprintf( __( 'An image editor is not available on your server. Instagram Feed is unable to create local resized images. See %sthis FAQ%s for more information' ), '<a href="https://smashballoon.com/doc/the-images-in-my-feed-are-missing-or-showing-errors/" target="_blank" rel="noopener noreferrer">','</a>' );
149
- }
150
-
151
- return implode( '<br>', $errors );
152
- }
153
-
154
  }
1
+ <?php
2
+ /**
3
+ * Class SB_Instagram_GDPR_Integrations
4
+ *
5
+ * Adds GDPR related workarounds for third-party plugins:
6
+ * https://wordpress.org/plugins/cookie-law-info/
7
+ *
8
+ * @since 2.6/5.9
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ die( '-1' );
13
+ }
14
+
15
+ class SB_Instagram_GDPR_Integrations {
16
+
17
+ /**
18
+ * Undoing of Cookie Notice's Instagram Feed related code
19
+ * needs to be done late.
20
+ */
21
+ public static function init() {
22
+ add_filter( 'wt_cli_third_party_scripts', array( 'SB_Instagram_GDPR_Integrations', 'undo_script_blocking' ), 11 );
23
+ }
24
+
25
+ /**
26
+ * Prevents changes made to how JavaScript file is added to
27
+ * pages.
28
+ */
29
+ public static function undo_script_blocking() {
30
+ $settings = sbi_get_database_settings();
31
+ if ( ! SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
32
+ return;
33
+ }
34
+ remove_filter( 'wt_cli_third_party_scripts', 'wt_cli_instagram_feed_script' );
35
+ }
36
+
37
+ /**
38
+ * Whether or not consent plugins that Instagram Feed
39
+ * is compatible with are active.
40
+ *
41
+ * @return bool|string
42
+ */
43
+ public static function gdpr_plugins_active() {
44
+ if ( class_exists( 'Cookie_Notice' ) ) {
45
+ return 'Cookie Notice by dFactory';
46
+ }
47
+ if ( function_exists( 'run_cookie_law_info' ) ) {
48
+ return 'GDPR Cookie Consent by WebToffee';
49
+ }
50
+ if ( class_exists( 'Cookiebot_WP' ) ) {
51
+ return 'Cookiebot by Cybot A/S';
52
+ }
53
+ if ( class_exists( 'COMPLIANZ' ) ) {
54
+ return 'Complianz by Really Simple Plugins';
55
+ }
56
+ if ( function_exists('BorlabsCookieHelper') ) {
57
+ return 'Borlabs Cookie by Borlabs';
58
+ }
59
+
60
+ return false;
61
+ }
62
+
63
+ /**
64
+ * GDPR features can be added automatically, forced enabled,
65
+ * or forced disabled.
66
+ *
67
+ * @param $settings
68
+ *
69
+ * @return bool
70
+ */
71
+ public static function doing_gdpr( $settings ) {
72
+ $gdpr = isset( $settings['gdpr'] ) ? $settings['gdpr'] : 'auto';
73
+ if ( $gdpr === 'no' ) {
74
+ return false;
75
+ }
76
+ if ( $gdpr === 'yes' ) {
77
+ return true;
78
+ }
79
+ return (SB_Instagram_GDPR_Integrations::gdpr_plugins_active() !== false);
80
+ }
81
+
82
+ /**
83
+ * GDPR features are reliant on the image resizing features
84
+ *
85
+ * @param bool $retest
86
+ *
87
+ * @return bool
88
+ */
89
+ public static function gdpr_tests_successful( $retest = true ) {
90
+ $sbi_statuses_option = get_option( 'sbi_statuses', array() );
91
+
92
+ if ( ! isset( $sbi_statuses_option['gdpr'] ) || $retest ) {
93
+ $test_image = trailingslashit( SBI_PLUGIN_URL ) . 'img/placeholder.png';
94
+
95
+ $image_editor = wp_get_image_editor( $test_image );
96
+
97
+ // not uncommon for the image editor to not work using it this way
98
+ if ( ! is_wp_error( $image_editor ) ) {
99
+ $sbi_statuses_option['gdpr']['image_editor'] = true;
100
+ } else {
101
+ $sbi_statuses_option['gdpr']['image_editor'] = false;
102
+ }
103
+
104
+ $upload = wp_upload_dir();
105
+ $upload_dir = $upload['basedir'];
106
+ $upload_dir = trailingslashit( $upload_dir ) . SBI_UPLOADS_NAME;
107
+ if ( file_exists( $upload_dir ) ) {
108
+ $sbi_statuses_option['gdpr']['upload_dir'] = true;
109
+ } else {
110
+ $sbi_statuses_option['gdpr']['upload_dir'] = false;
111
+ }
112
+
113
+ global $wpdb;
114
+ $table_name = esc_sql( $wpdb->prefix . SBI_INSTAGRAM_POSTS_TYPE );
115
+ $sbi_statuses_option['gdpr']['tables'] = true;
116
+ if ( $wpdb->get_var( "show tables like '$table_name'" ) != $table_name ) {
117
+ $sbi_statuses_option['gdpr']['tables'] = false;
118
+ }
119
+
120
+ $feeds_posts_table_name = esc_sql( $wpdb->prefix . SBI_INSTAGRAM_FEEDS_POSTS );
121
+ if ( $wpdb->get_var( "show tables like '$feeds_posts_table_name'" ) != $feeds_posts_table_name ) {
122
+ $sbi_statuses_option['gdpr']['tables'] = false;
123
+ }
124
+
125
+ update_option( 'sbi_statuses', $sbi_statuses_option );
126
+ }
127
+
128
+ if ( ! $sbi_statuses_option['gdpr']['upload_dir']
129
+ || ! $sbi_statuses_option['gdpr']['tables']
130
+ || ! $sbi_statuses_option['gdpr']['image_editor'] ) {
131
+ return false;
132
+ }
133
+
134
+ return true;
135
+ }
136
+
137
+ public static function gdpr_tests_error_message() {
138
+ $sbi_statuses_option = get_option( 'sbi_statuses', array() );
139
+
140
+ $errors = array();
141
+ if ( ! $sbi_statuses_option['gdpr']['upload_dir'] ) {
142
+ $errors[] = __( 'A folder for storing resized images was not successfully created.' );
143
+ }
144
+ if ( ! $sbi_statuses_option['gdpr']['tables'] ) {
145
+ $errors[] = __( 'Tables used for storing information about resized images were not successfully created.' );
146
+ }
147
+ if ( ! $sbi_statuses_option['gdpr']['image_editor'] ) {
148
+ $errors[] = sprintf( __( 'An image editor is not available on your server. Instagram Feed is unable to create local resized images. See %sthis FAQ%s for more information' ), '<a href="https://smashballoon.com/doc/the-images-in-my-feed-are-missing-or-showing-errors/" target="_blank" rel="noopener noreferrer">','</a>' );
149
+ }
150
+
151
+ return implode( '<br>', $errors );
152
+ }
153
+
154
  }
instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Smash Balloon Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
- Version: 2.6
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
@@ -23,7 +23,7 @@ along with this program; if not, write to the Free Software
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  if ( ! defined( 'SBIVER' ) ) {
26
- define( 'SBIVER', '2.6' );
27
  }
28
  // Db version.
29
  if ( ! defined( 'SBI_DBVERSION' ) ) {
3
  Plugin Name: Smash Balloon Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
+ Version: 2.6.1
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  if ( ! defined( 'SBIVER' ) ) {
26
+ define( 'SBIVER', '2.6.1' );
27
  }
28
  // Db version.
29
  if ( ! defined( 'SBI_DBVERSION' ) ) {