Instagram Feed - Version 6.0.5

Version Description

  • Tweak: If WordPress cron is broken or behind schedule and causing background caching to not work, the plugin will update the feed when the page loads.
  • Fix: Jetpack's "Master Bar" feature was causing the sidebar in the customizer to be partially hidden.
  • Fix: Added back support for the "class" shortcode setting for all feeds.
  • Fix: Only the first 20 sources were available when creating feeds and changing sources for a feed.
  • Fix: Removed all Font Awesome icons and no longer include the CSS file from the Font Awesome CDN.
Download this release

Release Info

Developer Craig at Smash Balloon
Plugin Icon 128x128 Instagram Feed
Version 6.0.5
Comparing to
See all releases

Code changes from version 6.0.4 to 6.0.5

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: 4.1
5
- Tested up to: 5.9
6
- Stable tag: 6.0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -34,8 +34,8 @@ Display Instagram posts from your Instagram accounts, either in the same single
34
  * **Increase Social Engagement** - Increase engagement between you and your Instagram followers. Increase your number of followers by displaying your Instagram content directly on your site.
35
  * **Save Time** - Don't have time to update your photos on your site? Save time and increase efficiency by only posting your photos to Instagram and automatically displaying them on your website
36
  * **Display Your Content Your Way** - Customize your Instagram feeds to look exactly the way you want, so that they blend seemlessly into your site or pop out at your visitors!
37
- * **Keep Your Site Looking Fresh** - Automatically aggregate your new Instagram content straight to your site to keep it looking fresh and keeping your audience engaged.
38
- * **Super simple to set up** - Once installed, you can be displaying your Instagram photos within 30 seconds! No confusing steps or Instagram Developer account needed. The Instagram Feed aggregator plugin is the easiest way to aggregate Instagram posts on your site.
39
  * **Powers all Instagram oEmbeds on your site** - With WordPress removing support for Instagram oEmbeds, the plugin will now power all Instagram embeds on your site, old and new, to allow them to continue working.
40
 
41
  = Pro Version =
@@ -80,7 +80,7 @@ For simple step-by-step directions on how to set up the Instagram Feed plugin pl
80
 
81
  Copy and paste the following shortcode directly into the page, post or widget where you'd like the Instagram feed to show up: `[instagram-feed]`
82
 
83
- **Multiple Instagram Aggregator Feeds**
84
 
85
  If you'd like to display multiple Instagram feeds then you can set different settings directly in the shortcode like so: `[instagram-feed num=9 cols=3]`
86
 
@@ -171,7 +171,7 @@ In version 2.5, support was added to allow the plugin to power your Instagram oE
171
 
172
  We've made it super easy. Simply click on the big blue button on the Instagram Feed Settings page and log into your Instagram account. The plugin will then ask if you'd like to connect the account and start using it in a feed.
173
 
174
- = My Instagram aggregator isn't displaying. Why not!? =
175
 
176
  There are a few common reasons for this:
177
 
@@ -221,7 +221,7 @@ If you are trying to display an Instagram feed that has no posts made to it, a l
221
 
222
  5) The shortcode you are using is incorrect
223
 
224
- You may have an error in the Instagram Feed agregator shortcode you are using or are missing a necessary argument.
225
 
226
  = What are the available shortcode options that I can use to customize my Instagram feed? =
227
 
@@ -331,9 +331,16 @@ We understand that sometimes you need help, have issues or just have questions.
331
  * Plus more customization options added all the time!
332
 
333
  == Changelog ==
 
 
 
 
 
 
 
334
  = 6.0.4 =
335
- * Fix: Added back the ability to use up to 10 columns in feeds for desktop and tablet devices, which was inadvertently removed in v6.0.
336
- * Fix: The reconnect link that would display when an account had an error would not successfully redirect to connect.smashballoon.com to reconnect the account.
337
 
338
  = 6.0.3 =
339
  * Tweak: Updated our logo throughout the plugin to match our new [website](https://smashballoon.com/).
2
  Contributors: smashballoon, craig-at-smash-balloon
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 4.1
5
+ Tested up to: 6.0
6
+ Stable tag: 6.0.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
34
  * **Increase Social Engagement** - Increase engagement between you and your Instagram followers. Increase your number of followers by displaying your Instagram content directly on your site.
35
  * **Save Time** - Don't have time to update your photos on your site? Save time and increase efficiency by only posting your photos to Instagram and automatically displaying them on your website
36
  * **Display Your Content Your Way** - Customize your Instagram feeds to look exactly the way you want, so that they blend seemlessly into your site or pop out at your visitors!
37
+ * **Keep Your Site Looking Fresh** - Automatically push your new Instagram content straight to your site to keep it looking fresh and keeping your audience engaged.
38
+ * **Super simple to set up** - Once installed, you can be displaying your Instagram photos within 30 seconds! No confusing steps or Instagram Developer account needed.
39
  * **Powers all Instagram oEmbeds on your site** - With WordPress removing support for Instagram oEmbeds, the plugin will now power all Instagram embeds on your site, old and new, to allow them to continue working.
40
 
41
  = Pro Version =
80
 
81
  Copy and paste the following shortcode directly into the page, post or widget where you'd like the Instagram feed to show up: `[instagram-feed]`
82
 
83
+ **Multiple Instagram Feeds**
84
 
85
  If you'd like to display multiple Instagram feeds then you can set different settings directly in the shortcode like so: `[instagram-feed num=9 cols=3]`
86
 
171
 
172
  We've made it super easy. Simply click on the big blue button on the Instagram Feed Settings page and log into your Instagram account. The plugin will then ask if you'd like to connect the account and start using it in a feed.
173
 
174
+ = My Instagram feed isn't displaying. Why not!? =
175
 
176
  There are a few common reasons for this:
177
 
221
 
222
  5) The shortcode you are using is incorrect
223
 
224
+ You may have an error in the Instagram Feed shortcode you are using or are missing a necessary argument.
225
 
226
  = What are the available shortcode options that I can use to customize my Instagram feed? =
227
 
331
  * Plus more customization options added all the time!
332
 
333
  == Changelog ==
334
+ = 6.0.5 =
335
+ * Tweak: If WordPress cron is broken or behind schedule and causing background caching to not work, the plugin will update the feed when the page loads.
336
+ * Fix: Jetpack's "Master Bar" feature was causing the sidebar in the customizer to be partially hidden.
337
+ * Fix: Added back support for the "class" shortcode setting for all feeds.
338
+ * Fix: Only the first 20 sources were available when creating feeds and changing sources for a feed.
339
+ * Fix: Removed all Font Awesome icons and no longer include the CSS file from the Font Awesome CDN.
340
+
341
  = 6.0.4 =
342
+ * Fix: Added back the ability to use up to 10 columns in feeds.
343
+ * Fix: The reconnect link that would display when an account had an error would not redirect to connect.smashballoon.com.
344
 
345
  = 6.0.3 =
346
  * Tweak: Updated our logo throughout the plugin to match our new [website](https://smashballoon.com/).
admin/SBI_Admin_Notices.php CHANGED
@@ -51,7 +51,7 @@ class SBI_Admin_Notices
51
 
52
  $output = '';
53
 
54
- $upgrade_url = 'https://smashballoon.com/instagram-feed/?utm_campaign=instagram-free&utm_source=lite-upgrade-bar';
55
  $output .= '<div id="sbi-notice-bar" class="sbi-header-notice">';
56
  $output .= sprintf(
57
  '<span class="sbi-notice-bar-message">%s <a href="%s" target="_blank" rel="noopener noreferrer">%s</a></span>',
@@ -109,7 +109,7 @@ class SBI_Admin_Notices
109
  'instagram-feed_page_sbi-support',
110
  );
111
 
112
- if ( in_array( $current_screen->base, $not_allowed_screens ) ) {
113
  remove_all_actions('admin_notices');
114
  remove_all_actions('all_admin_notices');
115
  }
51
 
52
  $output = '';
53
 
54
+ $upgrade_url = 'https://smashballoon.com/instagram-feed/demo/?utm_campaign=instagram-free&utm_source=lite-upgrade-bar';
55
  $output .= '<div id="sbi-notice-bar" class="sbi-header-notice">';
56
  $output .= sprintf(
57
  '<span class="sbi-notice-bar-message">%s <a href="%s" target="_blank" rel="noopener noreferrer">%s</a></span>',
109
  'instagram-feed_page_sbi-support',
110
  );
111
 
112
+ if ( in_array( $current_screen->base, $not_allowed_screens ) || strpos( $current_screen->base, 'sbi-' ) !== false ) {
113
  remove_all_actions('admin_notices');
114
  remove_all_actions('all_admin_notices');
115
  }
admin/SBI_Global_Settings.php CHANGED
@@ -1055,6 +1055,7 @@ class SBI_Global_Settings {
1055
  'nextCheck' => $this->get_cron_next_check(),
1056
  'loaderSVG' => '<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve"><path fill="#fff" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h6.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"/></path></svg>',
1057
  'checkmarkSVG' => '<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/></svg>',
 
1058
  'uploadSVG' => '<svg class="btn-icon" width="12" height="15" viewBox="0 0 12 15" fill="none" xmlns="http://www.w3.org/2000/svg">
1059
  <path d="M0.166748 14.6667H11.8334V13H0.166748V14.6667ZM0.166748 6.33333H3.50008V11.3333H8.50008V6.33333H11.8334L6.00008 0.5L0.166748 6.33333Z" fill="#141B38"/></svg>',
1060
  'exportSVG' => '<svg class="btn-icon" width="12" height="15" viewBox="0 0 12 15" fill="none" xmlns="http://www.w3.org/2000/svg">
1055
  'nextCheck' => $this->get_cron_next_check(),
1056
  'loaderSVG' => '<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve"><path fill="#fff" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h6.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"/></path></svg>',
1057
  'checkmarkSVG' => '<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/></svg>',
1058
+ 'timesCircleSVG' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Pro 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"/></svg>',
1059
  'uploadSVG' => '<svg class="btn-icon" width="12" height="15" viewBox="0 0 12 15" fill="none" xmlns="http://www.w3.org/2000/svg">
1060
  <path d="M0.166748 14.6667H11.8334V13H0.166748V14.6667ZM0.166748 6.33333H3.50008V11.3333H8.50008V6.33333H11.8334L6.00008 0.5L0.166748 6.33333Z" fill="#141B38"/></svg>',
1061
  'exportSVG' => '<svg class="btn-icon" width="12" height="15" viewBox="0 0 12 15" fill="none" xmlns="http://www.w3.org/2000/svg">
admin/SBI_Support.php CHANGED
@@ -184,9 +184,9 @@ class SBI_Support {
184
  'collapse' => __( 'Collapse', 'instagram-feed' ),
185
  ),
186
  'icons' => array(
187
- 'rocket' => SBI_PLUGIN_URL . 'admin/assets/img/rocket-icon.png',
188
- 'book' => SBI_PLUGIN_URL . 'admin/assets/img/book-icon.png',
189
- 'save' => SBI_PLUGIN_URL . 'admin/assets/img/save-plus-icon.png',
190
  'magnify' => '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.91667 0.5C7.35326 0.5 8.73101 1.07068 9.74683 2.08651C10.7627 3.10233 11.3333 4.48008 11.3333 5.91667C11.3333 7.25833 10.8417 8.49167 10.0333 9.44167L10.2583 9.66667H10.9167L15.0833 13.8333L13.8333 15.0833L9.66667 10.9167V10.2583L9.44167 10.0333C8.45879 10.8723 7.20892 11.3333 5.91667 11.3333C4.48008 11.3333 3.10233 10.7627 2.08651 9.74683C1.07068 8.73101 0.5 7.35326 0.5 5.91667C0.5 4.48008 1.07068 3.10233 2.08651 2.08651C3.10233 1.07068 4.48008 0.5 5.91667 0.5ZM5.91667 2.16667C3.83333 2.16667 2.16667 3.83333 2.16667 5.91667C2.16667 8 3.83333 9.66667 5.91667 9.66667C8 9.66667 9.66667 8 9.66667 5.91667C9.66667 3.83333 8 2.16667 5.91667 2.16667Z" fill="#141B38"/></svg>',
191
  'rightAngle' => '<svg width="7" height="11" viewBox="0 0 5 8" fill="#000" xmlns="http://www.w3.org/2000/svg"><path d="M1.00006 0L0.0600586 0.94L3.11339 4L0.0600586 7.06L1.00006 8L5.00006 4L1.00006 0Z" fill="#000"/></svg>',
192
  'linkIcon' => '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.166626 10.6583L8.99163 1.83329H3.49996V0.166626H11.8333V8.49996H10.1666V3.00829L1.34163 11.8333L0.166626 10.6583Z" fill="#141B38"/></svg>',
184
  'collapse' => __( 'Collapse', 'instagram-feed' ),
185
  ),
186
  'icons' => array(
187
+ 'rocket' => SBI_PLUGIN_URL . 'admin/assets/img/rocket-icon.svg',
188
+ 'book' => SBI_PLUGIN_URL . 'admin/assets/img/book-icon.svg',
189
+ 'save' => SBI_PLUGIN_URL . 'admin/assets/img/save-plus-icon.svg',
190
  'magnify' => '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.91667 0.5C7.35326 0.5 8.73101 1.07068 9.74683 2.08651C10.7627 3.10233 11.3333 4.48008 11.3333 5.91667C11.3333 7.25833 10.8417 8.49167 10.0333 9.44167L10.2583 9.66667H10.9167L15.0833 13.8333L13.8333 15.0833L9.66667 10.9167V10.2583L9.44167 10.0333C8.45879 10.8723 7.20892 11.3333 5.91667 11.3333C4.48008 11.3333 3.10233 10.7627 2.08651 9.74683C1.07068 8.73101 0.5 7.35326 0.5 5.91667C0.5 4.48008 1.07068 3.10233 2.08651 2.08651C3.10233 1.07068 4.48008 0.5 5.91667 0.5ZM5.91667 2.16667C3.83333 2.16667 2.16667 3.83333 2.16667 5.91667C2.16667 8 3.83333 9.66667 5.91667 9.66667C8 9.66667 9.66667 8 9.66667 5.91667C9.66667 3.83333 8 2.16667 5.91667 2.16667Z" fill="#141B38"/></svg>',
191
  'rightAngle' => '<svg width="7" height="11" viewBox="0 0 5 8" fill="#000" xmlns="http://www.w3.org/2000/svg"><path d="M1.00006 0L0.0600586 0.94L3.11339 4L0.0600586 7.06L1.00006 8L5.00006 4L1.00006 0Z" fill="#000"/></svg>',
192
  'linkIcon' => '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.166626 10.6583L8.99163 1.83329H3.49996V0.166626H11.8333V8.49996H10.1666V3.00829L1.34163 11.8333L0.166626 10.6583Z" fill="#141B38"/></svg>',
admin/SBI_oEmbeds.php CHANGED
@@ -217,6 +217,7 @@ class SBI_oEmbeds {
217
  ),
218
  'loaderSVG' => '<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve"><path fill="#fff" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"/></path></svg>',
219
  'checkmarkSVG' => '<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/></svg>',
 
220
  );
221
 
222
  $oembed_token_settings = get_option( 'sbi_oembed_token', array() );
217
  ),
218
  'loaderSVG' => '<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve"><path fill="#fff" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"/></path></svg>',
219
  'checkmarkSVG' => '<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/></svg>',
220
+ 'timesCircleSVG' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Pro 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"/></svg>'
221
  );
222
 
223
  $oembed_token_settings = get_option( 'sbi_oembed_token', array() );
admin/assets/img/book-icon.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg width="57" height="56" viewBox="0 0 57 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0.333374" width="56" height="56" rx="28" fill="#FFF1F0"/>
3
+ <path d="M33.8334 30.33C34.6234 30.33 35.4634 30.41 36.3334 30.57V32.07C35.7134 31.91 34.8734 31.83 33.8334 31.83C31.9334 31.83 30.4434 32.16 29.3334 32.82V31.13C30.5034 30.6 32.0034 30.33 33.8334 30.33ZM29.3334 28.46C30.6234 27.93 32.1234 27.67 33.8334 27.67C34.6234 27.67 35.4634 27.74 36.3334 27.9V29.4C35.7134 29.24 34.8734 29.16 33.8334 29.16C31.9334 29.16 30.4434 29.5 29.3334 30.15V28.46ZM33.8334 26.5C31.9334 26.5 30.4434 26.82 29.3334 27.5V25.84C30.5634 25.28 32.0634 25 33.8334 25C34.6234 25 35.4634 25.08 36.3334 25.23V26.78C35.5934 26.59 34.7434 26.5 33.8334 26.5ZM37.3334 34.5V23C36.2934 22.67 35.1234 22.5 33.8334 22.5C31.7834 22.5 29.9534 23 28.3334 24V35.5C29.9534 34.5 31.7834 34 33.8334 34C35.0234 34 36.1934 34.16 37.3334 34.5ZM33.8334 20.5C36.1834 20.5 38.0234 21 39.3334 22V36.56C39.3334 36.68 39.2834 36.8 39.1734 36.91C39.0634 37 38.9434 37.08 38.8334 37.08C38.7234 37.08 38.6434 37.06 38.5834 37.03C37.3034 36.34 35.7134 36 33.8334 36C31.7834 36 29.9534 36.5 28.3334 37.5C26.9934 36.5 25.1634 36 22.8334 36C21.1734 36 19.5834 36.36 18.0834 37.07C18.0534 37.08 18.0134 37.08 17.9634 37.1C17.9234 37.11 17.8834 37.12 17.8334 37.12C17.7234 37.12 17.6034 37.08 17.4934 37C17.4438 36.9561 17.4039 36.9022 17.3763 36.8419C17.3488 36.7817 17.3341 36.7163 17.3334 36.65V22C18.6734 21 20.5134 20.5 22.8334 20.5C25.1634 20.5 26.9934 21 28.3334 22C29.6734 21 31.5034 20.5 33.8334 20.5Z" fill="#FE544F"/>
4
+ </svg>
admin/assets/img/rocket-icon.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="56" height="56" rx="28" fill="#FFF1F0"/>
3
+ <path d="M29.1301 38.19L27.5001 34.36C29.0701 33.78 30.5401 33 31.9001 32.09L29.1301 38.19ZM21.6401 28.5L17.8101 26.87L23.9101 24.1C23.0001 25.46 22.2201 26.93 21.6401 28.5ZM37.6101 18.39C37.6101 18.39 32.6601 16.269 27.0001 21.93C24.8101 24.12 23.5001 26.53 22.6501 28.64C22.3701 29.39 22.5601 30.21 23.1101 30.77L25.2401 32.89C25.7901 33.45 26.6101 33.63 27.3601 33.35C29.8786 32.3897 32.1654 30.9072 34.0701 29C39.7301 23.34 37.6101 18.39 37.6101 18.39ZM30.5401 25.46C29.7601 24.68 29.7601 23.41 30.5401 22.63C31.3201 21.85 32.5901 21.85 33.3701 22.63C34.1401 23.41 34.1501 24.68 33.3701 25.46C32.5901 26.24 31.3201 26.24 30.5401 25.46ZM23.2402 37L25.8801 34.36C25.5401 34.27 25.2101 34.12 24.9101 33.91L21.8302 37H23.2402ZM19.0002 37H20.4102L24.1801 33.24L22.7601 31.83L19.0002 35.59V37ZM19.0002 34.17L22.0901 31.09C21.8801 30.79 21.7301 30.47 21.6401 30.12L19.0002 32.76V34.17Z" fill="#FE544F"/>
4
+ </svg>
admin/assets/img/save-plus-icon.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg width="57" height="56" viewBox="0 0 57 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0.666748" width="56" height="56" rx="28" fill="#FFF1F0"/>
3
+ <path d="M29.6667 35C29.6667 36.1 29.9667 37.12 30.4767 38H22.6667C21.5567 38 20.6667 37.11 20.6667 36V20C20.6667 19.4696 20.8775 18.9609 21.2525 18.5858C21.6276 18.2107 22.1363 18 22.6667 18H23.6667V25L26.1667 23.5L28.6667 25V18H34.6667C35.1972 18 35.7059 18.2107 36.081 18.5858C36.456 18.9609 36.6667 19.4696 36.6667 20V29.09C36.3367 29.04 36.0067 29 35.6667 29C32.3567 29 29.6667 31.69 29.6667 35ZM36.6667 34V31H34.6667V34H31.6667V36H34.6667V39H36.6667V36H39.6667V34H36.6667Z" fill="#FE544F"/>
4
+ </svg>
admin/assets/js/oembeds.js CHANGED
@@ -18,6 +18,7 @@ var sbioembeds_data = {
18
  openFacebookInstaller: false,
19
  loaderSVG: sbi_oembeds.loaderSVG,
20
  checkmarkSVG: sbi_oembeds.checkmarkSVG,
 
21
  installerStatus: null
22
  }
23
 
@@ -153,7 +154,7 @@ var sbioEmbeds = new Vue({
153
  } else if( this.installerStatus == 'success' ) {
154
  return this.checkmarkSVG;
155
  } else if( this.installerStatus == 'error' ) {
156
- return `<i class="fa fa-times-circle"></i>`;
157
  }
158
  },
159
 
18
  openFacebookInstaller: false,
19
  loaderSVG: sbi_oembeds.loaderSVG,
20
  checkmarkSVG: sbi_oembeds.checkmarkSVG,
21
+ timesCircleSVG: sbi_oembeds.timesCircleSVG,
22
  installerStatus: null
23
  }
24
 
154
  } else if( this.installerStatus == 'success' ) {
155
  return this.checkmarkSVG;
156
  } else if( this.installerStatus == 'error' ) {
157
+ return this.timesCircleSVG;
158
  }
159
  },
160
 
admin/assets/js/settings.js CHANGED
@@ -48,6 +48,7 @@ var settings_data = {
48
  import_file: null,
49
  gdprInfoTooltip: null,
50
  loaderSVG: sbi_settings.loaderSVG,
 
51
  checkmarkSVG: sbi_settings.checkmarkSVG,
52
  uploadSVG: sbi_settings.uploadSVG,
53
  exportSVG: sbi_settings.exportSVG,
@@ -505,9 +506,9 @@ var sbiSettings = new Vue({
505
  } else if ( this.recheckLicenseStatus == 'loading' ) {
506
  return this.loaderSVG;
507
  } else if ( this.recheckLicenseStatus == 'success' ) {
508
- return '<i class="fa fa-check-circle"></i> ' + this.generalTab.licenseBox.licenseValid;
509
  } else if ( this.recheckLicenseStatus == 'error' ) {
510
- return '<i class="fa fa-times-circle"></i> ' + this.generalTab.licenseBox.licenseExpired;
511
  }
512
  },
513
  recheckBtnText: function( btnName ) {
@@ -516,18 +517,18 @@ var sbiSettings = new Vue({
516
  } else if ( this.recheckLicenseStatus == 'loading' && this.pressedBtnName == btnName ) {
517
  return this.loaderSVG;
518
  } else if ( this.recheckLicenseStatus == 'success' ) {
519
- return '<i class="fa fa-check-circle"></i> ' + this.generalTab.licenseBox.licenseValid;
520
  } else if ( this.recheckLicenseStatus == 'error' ) {
521
- return '<i class="fa fa-times-circle"></i> ' + this.generalTab.licenseBox.licenseExpired;
522
  }
523
  },
524
  testConnectionIcon: function() {
525
  if ( this.testConnectionStatus == 'loading' ) {
526
  return this.loaderSVG;
527
  } else if ( this.testConnectionStatus == 'success' ) {
528
- return '<i class="fa fa-check-circle"></i> ' + this.generalTab.licenseBox.connectionSuccessful;
529
  } else if ( this.testConnectionStatus == 'error' ) {
530
- return `<i class="fa fa-times-circle"></i> ${this.generalTab.licenseBox.connectionFailed} ${this.testConnectionStatusMessage}</a>`;
531
  }
532
  },
533
  importFile: function() {
@@ -719,7 +720,7 @@ var sbiSettings = new Vue({
719
  } else if ( this.clearErrorLogStatus == 'success' ) {
720
  return this.checkmarkSVG;
721
  } else if ( this.clearErrorLogStatus == 'error' ) {
722
- return `<i class="fa fa-times-circle"></i>`;
723
  }
724
  },
725
  saveChangesIcon: function() {
@@ -728,7 +729,7 @@ var sbiSettings = new Vue({
728
  } else if ( this.btnStatus === 'success' ) {
729
  return this.checkmarkSVG;
730
  } else if ( this.btnStatus === 'error' ) {
731
- return `<i class="fa fa-times-circle"></i>`;
732
  }
733
  },
734
  importBtnIcon: function() {
@@ -740,7 +741,7 @@ var sbiSettings = new Vue({
740
  } else if ( this.uploadStatus == 'success' ) {
741
  return this.checkmarkSVG;
742
  } else if ( this.uploadStatus == 'error' ) {
743
- return `<i class="fa fa-times-circle"></i>`;
744
  }
745
  },
746
  clearCacheIcon: function() {
@@ -752,7 +753,7 @@ var sbiSettings = new Vue({
752
  } else if ( this.clearCacheStatus == 'success' ) {
753
  return this.checkmarkSVG;
754
  } else if ( this.clearCacheStatus == 'error' ) {
755
- return `<i class="fa fa-times-circle"></i>`;
756
  }
757
  },
758
  clearImageResizeCacheIcon: function() {
@@ -764,7 +765,7 @@ var sbiSettings = new Vue({
764
  } else if ( this.optimizeCacheStatus == 'success' ) {
765
  return this.checkmarkSVG;
766
  } else if ( this.optimizeCacheStatus == 'error' ) {
767
- return `<i class="fa fa-times-circle"></i>`;
768
  }
769
  },
770
  dpaResetStatusIcon: function() {
@@ -776,7 +777,7 @@ var sbiSettings = new Vue({
776
  } else if ( this.dpaResetStatus == 'success' ) {
777
  return this.checkmarkSVG;
778
  } else if ( this.dpaResetStatus == 'error' ) {
779
- return `<i class="fa fa-times-circle"></i>`;
780
  }
781
  },
782
 
48
  import_file: null,
49
  gdprInfoTooltip: null,
50
  loaderSVG: sbi_settings.loaderSVG,
51
+ timesCircleSVG: sbi_settings.timesCircleSVG,
52
  checkmarkSVG: sbi_settings.checkmarkSVG,
53
  uploadSVG: sbi_settings.uploadSVG,
54
  exportSVG: sbi_settings.exportSVG,
506
  } else if ( this.recheckLicenseStatus == 'loading' ) {
507
  return this.loaderSVG;
508
  } else if ( this.recheckLicenseStatus == 'success' ) {
509
+ return this.timesCircleSVG + ' ' + this.generalTab.licenseBox.licenseValid;
510
  } else if ( this.recheckLicenseStatus == 'error' ) {
511
+ return this.timesCircleSVG + ' ' + this.generalTab.licenseBox.licenseExpired;
512
  }
513
  },
514
  recheckBtnText: function( btnName ) {
517
  } else if ( this.recheckLicenseStatus == 'loading' && this.pressedBtnName == btnName ) {
518
  return this.loaderSVG;
519
  } else if ( this.recheckLicenseStatus == 'success' ) {
520
+ return this.timesCircleSVG + ' ' + this.generalTab.licenseBox.licenseValid;
521
  } else if ( this.recheckLicenseStatus == 'error' ) {
522
+ return this.timesCircleSVG + ' ' + this.generalTab.licenseBox.licenseExpired;
523
  }
524
  },
525
  testConnectionIcon: function() {
526
  if ( this.testConnectionStatus == 'loading' ) {
527
  return this.loaderSVG;
528
  } else if ( this.testConnectionStatus == 'success' ) {
529
+ return this.timesCircleSVG + ' ' + this.generalTab.licenseBox.connectionSuccessful;
530
  } else if ( this.testConnectionStatus == 'error' ) {
531
+ return this.timesCircleSVG + ' ' + ` ${this.generalTab.licenseBox.connectionFailed} ${this.testConnectionStatusMessage}`;
532
  }
533
  },
534
  importFile: function() {
720
  } else if ( this.clearErrorLogStatus == 'success' ) {
721
  return this.checkmarkSVG;
722
  } else if ( this.clearErrorLogStatus == 'error' ) {
723
+ return this.timesCircleSVG;
724
  }
725
  },
726
  saveChangesIcon: function() {
729
  } else if ( this.btnStatus === 'success' ) {
730
  return this.checkmarkSVG;
731
  } else if ( this.btnStatus === 'error' ) {
732
+ return this.timesCircleSVG;
733
  }
734
  },
735
  importBtnIcon: function() {
741
  } else if ( this.uploadStatus == 'success' ) {
742
  return this.checkmarkSVG;
743
  } else if ( this.uploadStatus == 'error' ) {
744
+ return this.timesCircleSVG;
745
  }
746
  },
747
  clearCacheIcon: function() {
753
  } else if ( this.clearCacheStatus == 'success' ) {
754
  return this.checkmarkSVG;
755
  } else if ( this.clearCacheStatus == 'error' ) {
756
+ return this.timesCircleSVG;
757
  }
758
  },
759
  clearImageResizeCacheIcon: function() {
765
  } else if ( this.optimizeCacheStatus == 'success' ) {
766
  return this.checkmarkSVG;
767
  } else if ( this.optimizeCacheStatus == 'error' ) {
768
+ return this.timesCircleSVG;
769
  }
770
  },
771
  dpaResetStatusIcon: function() {
777
  } else if ( this.dpaResetStatus == 'success' ) {
778
  return this.checkmarkSVG;
779
  } else if ( this.dpaResetStatus == 'error' ) {
780
+ return this.timesCircleSVG;
781
  }
782
  },
783
 
admin/builder/assets/css/builder.css CHANGED
@@ -493,7 +493,9 @@ Header
493
  align-items: center;
494
  height: 52px;
495
  }
496
-
 
 
497
  @media all and (max-width: 960px) {
498
  .sbi-csz-header-insider{
499
  width: calc(100% - 36px);
@@ -501,6 +503,12 @@ Header
501
  .sb-customizer-ctn .sb-customizer-sidebar{
502
  left: 36px;
503
  }
 
 
 
 
 
 
504
  }
505
 
506
  .sbi-fb-hd-btn{
@@ -2786,6 +2794,9 @@ Feed Instance Popup
2786
  bottom: 0px;
2787
  padding-bottom: 50px;
2788
  }
 
 
 
2789
  body.folded .sb-customizer-sidebar{
2790
  left: 36px;
2791
  }
493
  align-items: center;
494
  height: 52px;
495
  }
496
+ body.jetpack-masterbar .sbi-csz-header-insider {
497
+ width: calc(100% - 272px);
498
+ }
499
  @media all and (max-width: 960px) {
500
  .sbi-csz-header-insider{
501
  width: calc(100% - 36px);
503
  .sb-customizer-ctn .sb-customizer-sidebar{
504
  left: 36px;
505
  }
506
+ body.jetpack-masterbar .sb-customizer-sidebar {
507
+ left: 36px;
508
+ }
509
+ body.jetpack-masterbar .sbi-csz-header-insider {
510
+ width: calc(100% - 36px);
511
+ }
512
  }
513
 
514
  .sbi-fb-hd-btn{
2794
  bottom: 0px;
2795
  padding-bottom: 50px;
2796
  }
2797
+ .jetpack-masterbar .sb-customizer-sidebar {
2798
+ left: 272px;
2799
+ }
2800
  body.folded .sb-customizer-sidebar{
2801
  left: 36px;
2802
  }
admin/builder/assets/js/builder.js CHANGED
@@ -331,6 +331,10 @@ sbiBuilder = new Vue({
331
  self.updatedTimeStamp = new Date().getTime();
332
  }
333
 
 
 
 
 
334
  window.addEventListener('beforeunload', (event) => {
335
  if( self.customizerFeedData ){
336
  self.leaveWindowHandler(event);
331
  self.updatedTimeStamp = new Date().getTime();
332
  }
333
 
334
+ if(self.customizerFeedData == undefined){
335
+ self.feedPagination.pagesNumber = self.feedPagination.feedsCount != null ? Math.ceil(self.feedPagination.feedsCount / self.feedPagination.itemsPerPage) : 1
336
+ }
337
+
338
  window.addEventListener('beforeunload', (event) => {
339
  if( self.customizerFeedData ){
340
  self.leaveWindowHandler(event);
composer.json CHANGED
@@ -5,5 +5,13 @@
5
  "InstagramFeed\\": "inc/"
6
  }
7
  },
8
- "require": {}
9
- }
 
 
 
 
 
 
 
 
5
  "InstagramFeed\\": "inc/"
6
  }
7
  },
8
+ "repositories": [
9
+ {
10
+ "type": "vcs",
11
+ "url": "git@github.com:awesomemotive/sb-stubs.git"
12
+ }
13
+ ],
14
+ "require": {
15
+ "smashballoon/stubs": "dev-master"
16
+ }
17
+ }
inc/Builder/SBI_Feed_Builder.php CHANGED
@@ -13,7 +13,6 @@ class SBI_Feed_Builder {
13
  private static $instance;
14
  public static function instance() {
15
  if ( null === self::$instance) {
16
- require SBI_PLUGIN_DIR . 'vendor/autoload.php';
17
  self::$instance = new self();
18
  return self::$instance;
19
 
@@ -243,6 +242,8 @@ class SBI_Feed_Builder {
243
  'svgIcons' => $this->builder_svg_icons(),
244
  'installPluginsPopup' => $this->install_plugins_popup(),
245
  'feeds' => SBI_Feed_Builder::get_feed_list(),
 
 
246
  'sources' => self::get_source_list(),
247
  'sourceConnectionURLs' => SBI_Source::get_connection_urls(),
248
 
13
  private static $instance;
14
  public static function instance() {
15
  if ( null === self::$instance) {
 
16
  self::$instance = new self();
17
  return self::$instance;
18
 
242
  'svgIcons' => $this->builder_svg_icons(),
243
  'installPluginsPopup' => $this->install_plugins_popup(),
244
  'feeds' => SBI_Feed_Builder::get_feed_list(),
245
+ 'itemsPerPage' => SBI_Db::RESULTS_PER_PAGE,
246
+ 'feedsCount' => SBI_Db::feeds_count(),
247
  'sources' => self::get_source_list(),
248
  'sourceConnectionURLs' => SBI_Source::get_connection_urls(),
249
 
inc/{admin/class-sbi-tracking.php → Helpers/SB_Instagram_Tracking.php} RENAMED
@@ -7,6 +7,11 @@
7
  */
8
 
9
  // Exit if accessed directly
 
 
 
 
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
  exit;
12
  }
@@ -27,7 +32,7 @@ class SB_Instagram_Tracking {
27
  }
28
 
29
  private function normalize_and_format( $key, $value ) {
30
- $normal_bools = array(
31
  'sb_instagram_preserve_settings',
32
  'sb_instagram_ajax_theme',
33
  'enqueue_js_in_head',
@@ -72,14 +77,14 @@ class SB_Instagram_Tracking {
72
  'sb_instagram_carousel_pag',
73
  'sb_instagram_carousel_autoplay',
74
  );
75
- $custom_text_settings = array(
76
  'sb_instagram_btn_text',
77
  'sb_instagram_follow_btn_text',
78
  'sb_instagram_custom_bio',
79
  'sb_instagram_custom_avatar',
80
  'sb_instagram_custom_css',
81
  'sb_instagram_custom_js',
82
- 'email_notification_addresses'
83
  );
84
  $comma_separate_counts_settings = array(
85
  'sb_instagram_user_id',
@@ -89,9 +94,9 @@ class SB_Instagram_Tracking {
89
  'sb_instagram_highlight_hashtag',
90
  'sb_instagram_hide_photos',
91
  'sb_instagram_exclude_words',
92
- 'sb_instagram_include_words'
93
  );
94
- $defaults = class_exists( 'SB_Instagram_Settings_Pro' ) ? SB_Instagram_Settings_Pro::default_settings() : SB_Instagram_Settings::default_settings();
95
 
96
  if ( is_array( $value ) ) {
97
  if ( empty( $value ) ) {
@@ -123,11 +128,11 @@ class SB_Instagram_Tracking {
123
 
124
  }
125
 
126
- private function get_data() {
127
  $data = array();
128
 
129
  // Retrieve current theme info
130
- $theme_data = wp_get_theme();
131
 
132
  $count_b = 1;
133
  if ( is_multisite() ) {
@@ -142,148 +147,149 @@ class SB_Instagram_Tracking {
142
  $php_version = ! empty( $php_version ) ? substr( $php_version, 0, strpos( $php_version, '.', strpos( $php_version, '.' ) + 1 ) ) : phpversion();
143
 
144
  global $wp_version;
145
- $data['this_plugin'] = 'if';
146
- $data['php_version'] = $php_version;
147
- $data['mi_version'] = SBIVER;
148
- $data['wp_version'] = $wp_version;
149
- $data['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '';
150
- $data['multisite'] = is_multisite();
151
- $data['url'] = home_url();
152
- $data['themename'] = $theme_data->Name;
153
- $data['themeversion'] = $theme_data->Version;
154
- $data['pro'] = (int) sbi_is_pro_version();
155
- $data['sites'] = $count_b;
156
- $data['usagetracking'] = get_option( 'sbi_usage_tracking_config', false );
157
- $num_users = function_exists( 'count_users' ) ? count_users() : 'Not Set';
158
- $data['usercount'] = is_array( $num_users ) ? $num_users['total_users'] : 1;
159
- $data['timezoneoffset']= date('P');
 
160
 
161
  $settings_to_send = array();
162
- $raw_settings = get_option( 'sb_instagram_settings', array() );
163
-
164
- foreach ( $raw_settings as $key => $value ) {
165
- $value = $this->normalize_and_format( $key, $value );
166
-
167
- if ( $value !== false ) {
168
- $key = str_replace( array( 'sb_instagram_', 'sbi_' ), '', $key );
169
- $settings_to_send[ $key ] = $value;
170
- }
 
 
 
 
 
 
 
 
 
171
  }
172
- $con_bus_accounts = 0;
 
 
173
  $recently_searched_hashtags = 0;
174
- $access_tokens_tried = array();
175
- if ( isset( $raw_settings['connected_accounts'] ) ) {
176
- foreach ( $raw_settings['connected_accounts'] as $connected_account ) {
177
- if ( isset( $connected_account['type'] ) && $connected_account['type'] === 'business') {
 
 
178
  $con_bus_accounts++;
179
-
180
- if ( ! in_array( $connected_account['access_token'], $access_tokens_tried, true ) && class_exists( 'SB_Instagram_API_Connect_Pro' ) ) {
181
- $access_tokens_tried[] = $connected_account['access_token'];
182
- $connection = new SB_Instagram_API_Connect_Pro( $connected_account, 'recently_searched_hashtags', array( 'hashtag' => '' ) );
183
  $connection->connect();
184
 
185
- $recently_searched_data = !$connection->is_wp_error() ? $connection->get_data() : false;
186
- $num_hashatags_searched = $recently_searched_data && isset( $recently_searched_data ) && ! isset( $recently_searched_data['data'] ) && is_array( $recently_searched_data ) ? count( $recently_searched_data ) : 0;
187
  $recently_searched_hashtags = $recently_searched_hashtags + $num_hashatags_searched;
188
  }
189
-
190
-
191
  }
192
  }
193
  }
194
- $settings_to_send['business_accounts'] = $con_bus_accounts;
195
  $settings_to_send['recently_searched_hashtags'] = $recently_searched_hashtags;
 
196
 
197
- $feed_caches = SB_Instagram_Cron_Updater::get_feed_cache_option_names();
198
- $settings_to_send['num_found_feed_caches'] = count( $feed_caches );
199
-
200
-
201
- if ( isset( $settings_to_send['caching_type'] ) && $settings_to_send['caching_type'] !== 'background' ) {
202
- $settings_to_send['recently_requested_caches'] = $settings_to_send['num_found_feed_caches'];
203
- } else {
204
- $settings_to_send['recently_requested_caches'] = 0;
205
- foreach ( $feed_caches as $feed_cache ) {
206
- $feed_id = str_replace( '_transient_', '', $feed_cache['option_name'] );
207
 
208
- $transient = get_transient( $feed_id );
209
-
210
- if ( $transient ) {
211
- $feed_data = json_decode( $transient, true );
212
- $last_requested = isset( $feed_data['last_requested'] ) ? (int) $feed_data['last_requested'] : false;
213
-
214
- if ( !$last_requested || $last_requested > time() - 5 * 3600 * 24 ) {
215
- $settings_to_send['recently_requested_caches']++;
216
- }
217
- }
218
-
219
- }
220
- }
221
-
222
- $settings_to_send['custom_header_template'] = '' !== locate_template( 'sbi/header.php', false, false ) ? 1 : 0;
223
- $settings_to_send['custom_header_boxed_template'] = '' !== locate_template( 'sbi/header-boxed.php', false, false ) ? 1 : 0;
224
  $settings_to_send['custom_header_generic_template'] = '' !== locate_template( 'sbi/header-generic.php', false, false ) ? 1 : 0;
225
- $settings_to_send['custom_item_template'] = '' !== locate_template( 'sbi/item.php', false, false ) ? 1 : 0;
226
- $settings_to_send['custom_footer_template'] = '' !== locate_template( 'sbi/footer.php', false, false ) ? 1 : 0;
227
- $settings_to_send['custom_feed_template'] = '' !== locate_template( 'sbi/feed.php', false, false ) ? 1 : 0;
 
228
 
229
  $sbi_current_white_names = get_option( 'sb_instagram_white_list_names', array() );
230
- if( empty( $sbi_current_white_names ) ){
231
  $settings_to_send['num_white_lists'] = 0;
232
  } else {
233
  $settings_to_send['num_white_lists'] = count( $sbi_current_white_names );
234
  }
235
 
236
- $data['settings'] = $settings_to_send;
237
 
238
  // Retrieve current plugin information
239
- if( ! function_exists( 'get_plugins' ) ) {
240
  include ABSPATH . '/wp-admin/includes/plugin.php';
241
  }
242
 
243
- $plugins = get_plugins();
244
- $active_plugins = get_option( 'active_plugins', array() );
245
  $plugins_to_send = array();
246
 
247
  foreach ( $plugins as $plugin_path => $plugin ) {
248
  // If the plugin isn't active, don't show it.
249
- if ( ! in_array( $plugin_path, $active_plugins ) )
250
  continue;
 
251
 
252
  $plugins_to_send[] = $plugin['Name'];
253
  }
254
 
255
- $data['active_plugins'] = $plugins_to_send;
256
- $data['locale'] = get_locale();
257
 
258
  return $data;
259
  }
260
 
261
  public function send_checkin( $override = false, $ignore_last_checkin = false ) {
262
-
263
  $home_url = trailingslashit( home_url() );
264
  if ( strpos( $home_url, 'smashballoon.com' ) !== false ) {
265
  return false;
266
  }
267
 
268
- if( ! $this->tracking_allowed() && ! $override ) {
269
  return false;
270
  }
271
 
272
  // Send a maximum of once per week
273
- $usage_tracking = get_option( 'sbi_usage_tracking', array( 'last_send' => 0, 'enabled' => sbi_is_pro_version() ) );
 
 
 
 
 
 
274
  if ( is_numeric( $usage_tracking['last_send'] ) && $usage_tracking['last_send'] > strtotime( '-1 week' ) && ! $ignore_last_checkin ) {
275
  return false;
276
  }
277
 
278
- $request = wp_remote_post( 'https://usage.smashballoon.com/v1/checkin/', array(
279
- 'method' => 'POST',
280
- 'timeout' => 5,
281
- 'redirection' => 5,
282
- 'httpversion' => '1.1',
283
- 'blocking' => false,
284
- 'body' => $this->get_data(),
285
- 'user-agent' => 'MI/' . SBIVER . '; ' . get_bloginfo( 'url' )
286
- ) );
 
 
 
287
 
288
  // If we have completed successfully, recheck in 1 week
289
  $usage_tracking['last_send'] = time();
@@ -292,7 +298,13 @@ class SB_Instagram_Tracking {
292
  }
293
 
294
  private function tracking_allowed() {
295
- $usage_tracking = sbi_get_option( 'sbi_usage_tracking', array( 'last_send' => 0, 'enabled' => sbi_is_pro_version() ) );
 
 
 
 
 
 
296
  $tracking_allowed = isset( $usage_tracking['enabled'] ) ? $usage_tracking['enabled'] : sbi_is_pro_version();
297
 
298
  return $tracking_allowed;
@@ -300,20 +312,20 @@ class SB_Instagram_Tracking {
300
 
301
  public function schedule_send() {
302
  if ( ! wp_next_scheduled( 'sbi_usage_tracking_cron' ) ) {
303
- $tracking = array();
304
- $tracking['day'] = rand( 0, 6 );
305
- $tracking['hour'] = rand( 0, 23 );
306
- $tracking['minute'] = rand( 0, 59 );
307
- $tracking['second'] = rand( 0, 59 );
308
- $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) +
309
- ( $tracking['hour'] * HOUR_IN_SECONDS ) +
310
- ( $tracking['minute'] * MINUTE_IN_SECONDS ) +
311
- $tracking['second'];
312
- $last_sunday = strtotime("next sunday") - (7 * DAY_IN_SECONDS);
313
- if ( ($last_sunday + $tracking['offset']) > time() + 6 * HOUR_IN_SECONDS ) {
314
  $tracking['initsend'] = $last_sunday + $tracking['offset'];
315
  } else {
316
- $tracking['initsend'] = strtotime("next sunday") + $tracking['offset'];
317
  }
318
 
319
  wp_schedule_event( $tracking['initsend'], 'weekly', 'sbi_usage_tracking_cron' );
@@ -325,9 +337,8 @@ class SB_Instagram_Tracking {
325
  // Adds once weekly to the existing schedules.
326
  $schedules['weekly'] = array(
327
  'interval' => 604800,
328
- 'display' => __( 'Once Weekly', 'instagram-feed' )
329
  );
330
  return $schedules;
331
  }
332
  }
333
- new SB_Instagram_Tracking();
7
  */
8
 
9
  // Exit if accessed directly
10
+ namespace InstagramFeed\Helpers;
11
+
12
+ use InstagramFeed\Builder\SBI_Db;
13
+ use InstagramFeed\Builder\SBI_Source;
14
+
15
  if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
32
  }
33
 
34
  private function normalize_and_format( $key, $value ) {
35
+ $normal_bools = array(
36
  'sb_instagram_preserve_settings',
37
  'sb_instagram_ajax_theme',
38
  'enqueue_js_in_head',
77
  'sb_instagram_carousel_pag',
78
  'sb_instagram_carousel_autoplay',
79
  );
80
+ $custom_text_settings = array(
81
  'sb_instagram_btn_text',
82
  'sb_instagram_follow_btn_text',
83
  'sb_instagram_custom_bio',
84
  'sb_instagram_custom_avatar',
85
  'sb_instagram_custom_css',
86
  'sb_instagram_custom_js',
87
+ 'email_notification_addresses',
88
  );
89
  $comma_separate_counts_settings = array(
90
  'sb_instagram_user_id',
94
  'sb_instagram_highlight_hashtag',
95
  'sb_instagram_hide_photos',
96
  'sb_instagram_exclude_words',
97
+ 'sb_instagram_include_words',
98
  );
99
+ $defaults = \SB_Instagram_Settings::default_settings();
100
 
101
  if ( is_array( $value ) ) {
102
  if ( empty( $value ) ) {
128
 
129
  }
130
 
131
+ public function get_data() {
132
  $data = array();
133
 
134
  // Retrieve current theme info
135
+ $theme_data = wp_get_theme();
136
 
137
  $count_b = 1;
138
  if ( is_multisite() ) {
147
  $php_version = ! empty( $php_version ) ? substr( $php_version, 0, strpos( $php_version, '.', strpos( $php_version, '.' ) + 1 ) ) : phpversion();
148
 
149
  global $wp_version;
150
+ $data['this_plugin'] = 'if';
151
+ $data['php_version'] = $php_version;
152
+ $data['mi_version'] = SBIVER;
153
+ $data['wp_version'] = $wp_version;
154
+ $data['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '';
155
+ $data['multisite'] = is_multisite();
156
+ $data['url'] = home_url();
157
+ $data['themename'] = $theme_data->Name;
158
+ $data['themeversion'] = $theme_data->Version;
159
+ $data['settings'] = array();
160
+ $data['pro'] = (int) sbi_is_pro_version();
161
+ $data['sites'] = $count_b;
162
+ $data['usagetracking'] = get_option( 'sbi_usage_tracking_config', false );
163
+ $num_users = function_exists( 'count_users' ) ? count_users() : 'Not Set';
164
+ $data['usercount'] = is_array( $num_users ) ? $num_users['total_users'] : 1;
165
+ $data['timezoneoffset'] = date( 'P' );
166
 
167
  $settings_to_send = array();
168
+ $raw_settings = get_option( 'sb_instagram_settings', array() );
169
+ $feeds = SBI_Db::feeds_query();
170
+ $feed_settings = [];
171
+
172
+ if ( ! empty( $feeds ) ) {
173
+ //recursive json decode
174
+ $feed_settings = array_map( static function($item) {
175
+ return json_decode($item, true);
176
+ }, json_decode($feeds[0]['settings'], true));
177
+ //map array values to key => value pairs in the $feed_settings array
178
+ array_walk($feed_settings, static function($value, $key) use(&$feed_settings) {
179
+ if(is_array($value)) {
180
+ unset($feed_settings[$key]);
181
+ foreach($value as $value_key => $value_item) {
182
+ $feed_settings[$key . '_' . $value_key] = $value_item;
183
+ }
184
+ }
185
+ }, []);
186
  }
187
+
188
+ $settings_to_send = array_merge($settings_to_send, $feed_settings);
189
+ $con_bus_accounts = 0;
190
  $recently_searched_hashtags = 0;
191
+ $access_tokens_tried = array();
192
+ $sources = SBI_Db::source_query();
193
+ if ( !empty($sources) ) {
194
+ $sources = SBI_Source::convert_sources_to_connected_accounts( $sources );
195
+ foreach ( $sources as $source ) {
196
+ if ( isset( $source['account_type'] ) && $source['account_type'] === 'business' ) {
197
  $con_bus_accounts++;
198
+ $source['type'] = $source['account_type'];
199
+ if ( ! in_array( $source['access_token'], $access_tokens_tried, true ) && class_exists( 'SB_Instagram_API_Connect' ) ) {
200
+ $access_tokens_tried[] = $source['access_token'];
201
+ $connection = new \SB_Instagram_API_Connect( $source, 'recently_searched_hashtags', array( 'hashtag' => '' ) );
202
  $connection->connect();
203
 
204
+ $recently_searched_data = ! $connection->is_wp_error() ? $connection->get_data() : false;
205
+ $num_hashatags_searched = $recently_searched_data && isset( $recently_searched_data ) && ! isset( $recently_searched_data['data'] ) && is_array( $recently_searched_data ) ? count( $recently_searched_data ) : 0;
206
  $recently_searched_hashtags = $recently_searched_hashtags + $num_hashatags_searched;
207
  }
 
 
208
  }
209
  }
210
  }
211
+ $settings_to_send['business_accounts'] = $con_bus_accounts;
212
  $settings_to_send['recently_searched_hashtags'] = $recently_searched_hashtags;
213
+ $sbi_cache = new \SB_Instagram_Cache(null);
214
 
215
+ $settings_to_send['num_found_feed_caches'] = (int)$sbi_cache->get_cache_count();
216
+ $settings_to_send['recently_requested_caches'] = (int)$sbi_cache->get_cache_count(true);
 
 
 
 
 
 
 
 
217
 
218
+ $settings_to_send['custom_header_template'] = '' !== locate_template( 'sbi/header.php', false, false ) ? 1 : 0;
219
+ $settings_to_send['custom_header_boxed_template'] = '' !== locate_template( 'sbi/header-boxed.php', false, false ) ? 1 : 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  $settings_to_send['custom_header_generic_template'] = '' !== locate_template( 'sbi/header-generic.php', false, false ) ? 1 : 0;
221
+ $settings_to_send['custom_item_template'] = '' !== locate_template( 'sbi/item.php', false, false ) ? 1 : 0;
222
+ $settings_to_send['custom_footer_template'] = '' !== locate_template( 'sbi/footer.php', false, false ) ? 1 : 0;
223
+ $settings_to_send['custom_feed_template'] = '' !== locate_template( 'sbi/feed.php', false, false ) ? 1 : 0;
224
+ $settings_to_send['num_found_feeds'] = count($feeds);
225
 
226
  $sbi_current_white_names = get_option( 'sb_instagram_white_list_names', array() );
227
+ if ( empty( $sbi_current_white_names ) ) {
228
  $settings_to_send['num_white_lists'] = 0;
229
  } else {
230
  $settings_to_send['num_white_lists'] = count( $sbi_current_white_names );
231
  }
232
 
233
+ $data['settings'] = $settings_to_send;
234
 
235
  // Retrieve current plugin information
236
+ if ( ! function_exists( 'get_plugins' ) ) {
237
  include ABSPATH . '/wp-admin/includes/plugin.php';
238
  }
239
 
240
+ $plugins = get_plugins();
241
+ $active_plugins = get_option( 'active_plugins', array() );
242
  $plugins_to_send = array();
243
 
244
  foreach ( $plugins as $plugin_path => $plugin ) {
245
  // If the plugin isn't active, don't show it.
246
+ if ( ! in_array( $plugin_path, $active_plugins ) ) {
247
  continue;
248
+ }
249
 
250
  $plugins_to_send[] = $plugin['Name'];
251
  }
252
 
253
+ $data['active_plugins'] = $plugins_to_send;
254
+ $data['locale'] = get_locale();
255
 
256
  return $data;
257
  }
258
 
259
  public function send_checkin( $override = false, $ignore_last_checkin = false ) {
 
260
  $home_url = trailingslashit( home_url() );
261
  if ( strpos( $home_url, 'smashballoon.com' ) !== false ) {
262
  return false;
263
  }
264
 
265
+ if ( ! $this->tracking_allowed() && ! $override ) {
266
  return false;
267
  }
268
 
269
  // Send a maximum of once per week
270
+ $usage_tracking = get_option(
271
+ 'sbi_usage_tracking',
272
+ array(
273
+ 'last_send' => 0,
274
+ 'enabled' => sbi_is_pro_version(),
275
+ )
276
+ );
277
  if ( is_numeric( $usage_tracking['last_send'] ) && $usage_tracking['last_send'] > strtotime( '-1 week' ) && ! $ignore_last_checkin ) {
278
  return false;
279
  }
280
 
281
+ $request = wp_remote_post(
282
+ 'https://usage.smashballoon.com/v1/checkin/',
283
+ array(
284
+ 'method' => 'POST',
285
+ 'timeout' => 5,
286
+ 'redirection' => 5,
287
+ 'httpversion' => '1.1',
288
+ 'blocking' => false,
289
+ 'body' => $this->get_data(),
290
+ 'user-agent' => 'MI/' . SBIVER . '; ' . get_bloginfo( 'url' ),
291
+ )
292
+ );
293
 
294
  // If we have completed successfully, recheck in 1 week
295
  $usage_tracking['last_send'] = time();
298
  }
299
 
300
  private function tracking_allowed() {
301
+ $usage_tracking = get_option(
302
+ 'sbi_usage_tracking',
303
+ array(
304
+ 'last_send' => 0,
305
+ 'enabled' => sbi_is_pro_version(),
306
+ )
307
+ );
308
  $tracking_allowed = isset( $usage_tracking['enabled'] ) ? $usage_tracking['enabled'] : sbi_is_pro_version();
309
 
310
  return $tracking_allowed;
312
 
313
  public function schedule_send() {
314
  if ( ! wp_next_scheduled( 'sbi_usage_tracking_cron' ) ) {
315
+ $tracking = array();
316
+ $tracking['day'] = rand( 0, 6 );
317
+ $tracking['hour'] = rand( 0, 23 );
318
+ $tracking['minute'] = rand( 0, 59 );
319
+ $tracking['second'] = rand( 0, 59 );
320
+ $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) +
321
+ ( $tracking['hour'] * HOUR_IN_SECONDS ) +
322
+ ( $tracking['minute'] * MINUTE_IN_SECONDS ) +
323
+ $tracking['second'];
324
+ $last_sunday = strtotime( 'next sunday' ) - ( 7 * DAY_IN_SECONDS );
325
+ if ( ( $last_sunday + $tracking['offset'] ) > time() + 6 * HOUR_IN_SECONDS ) {
326
  $tracking['initsend'] = $last_sunday + $tracking['offset'];
327
  } else {
328
+ $tracking['initsend'] = strtotime( 'next sunday' ) + $tracking['offset'];
329
  }
330
 
331
  wp_schedule_event( $tracking['initsend'], 'weekly', 'sbi_usage_tracking_cron' );
337
  // Adds once weekly to the existing schedules.
338
  $schedules['weekly'] = array(
339
  'interval' => 604800,
340
+ 'display' => __( 'Once Weekly', 'instagram-feed' ),
341
  );
342
  return $schedules;
343
  }
344
  }
 
inc/Services/ServiceContainer.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace InstagramFeed\Services;
4
+
5
+ use Smashballoon\Stubs\Services\ServiceProvider;
6
+
7
+ class ServiceContainer extends ServiceProvider {
8
+ public function register() {
9
+ ( new ShortcodeService() )->register();
10
+ }
11
+ }
inc/Services/ShortcodeService.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace InstagramFeed\Services;
4
+
5
+ use Smashballoon\Stubs\Services\ServiceProvider;
6
+
7
+ class ShortcodeService extends ServiceProvider {
8
+ public function register() {
9
+ add_filter('do_shortcode_tag', [$this, 'check_cron_status'], 10 , 4);
10
+ }
11
+
12
+ /**
13
+ * Hooks into do_shortcode_tag and runs only on instagram-feed shortcode
14
+ * Forces cachetime attribute if the cron job next run is out of order.
15
+ *
16
+ * @param $output
17
+ * @param $tag
18
+ * @param $attributes
19
+ * @param $m
20
+ *
21
+ * @return string
22
+ */
23
+ public function check_cron_status( $output, $tag, $attributes, $m ) {
24
+ if ( $tag !== 'instagram-feed' ) {
25
+ return $output;
26
+ }
27
+
28
+ global $shortcode_tags;
29
+ $next_run = wp_next_scheduled('sbi_feed_update');
30
+ $is_late = false !== $next_run && $next_run < ( time() - 1800 );
31
+
32
+ if ( false === $next_run || $next_run < 0 || $is_late ) {
33
+ if(!is_array($attributes)) {
34
+ $attributes = [];
35
+ }
36
+
37
+ $attributes['cachetime'] = $this->get_cache_time();
38
+ $content = isset( $m[5] ) ? $m[5] : null;
39
+
40
+ return $m[1] . call_user_func( $shortcode_tags[ $tag ], $attributes, $content, $tag ) . $m[6];
41
+ }
42
+
43
+ return $output;
44
+ }
45
+
46
+ private function get_cache_time() {
47
+ $schedule = wp_get_schedule( 'sbi_feed_update' );
48
+ if($schedule === 'twicedaily') {
49
+ return 12 * 60;
50
+ }
51
+
52
+ return 30;
53
+ }
54
+ }
inc/admin/actions.php CHANGED
@@ -101,7 +101,6 @@ add_filter( "plugin_action_links_instagram-feed/instagram-feed.php", 'sbi_add_se
101
 
102
  function sb_instagram_admin_style() {
103
  wp_register_style( 'sb_instagram_admin_css', SBI_PLUGIN_URL . 'css/sb-instagram-admin.css', array(), SBIVER );
104
- wp_enqueue_style( 'sb_instagram_font_awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css' );
105
  wp_enqueue_style( 'sb_instagram_admin_css' );
106
  wp_enqueue_style( 'wp-color-picker' );
107
  }
101
 
102
  function sb_instagram_admin_style() {
103
  wp_register_style( 'sb_instagram_admin_css', SBI_PLUGIN_URL . 'css/sb-instagram-admin.css', array(), SBIVER );
 
104
  wp_enqueue_style( 'sb_instagram_admin_css' );
105
  wp_enqueue_style( 'wp-color-picker' );
106
  }
inc/admin/class-sbi-new-user.php CHANGED
@@ -483,6 +483,7 @@ class SBI_New_User extends SBI_Notifications {
483
 
484
  } elseif ( 'later' === $rating_ignore ) {
485
  set_transient( 'instagram_feed_rating_notice_waiting', 'waiting', 2 * WEEK_IN_SECONDS );
 
486
  update_option( 'sbi_rating_notice', 'pending', false );
487
  }
488
  }
483
 
484
  } elseif ( 'later' === $rating_ignore ) {
485
  set_transient( 'instagram_feed_rating_notice_waiting', 'waiting', 2 * WEEK_IN_SECONDS );
486
+ delete_option( 'sbi_review_consent' );
487
  update_option( 'sbi_rating_notice', 'pending', false );
488
  }
489
  }
inc/class-sb-instagram-cache.php CHANGED
@@ -646,4 +646,29 @@ class SB_Instagram_Cache {
646
  return $affected;
647
  }
648
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
649
  }
646
  return $affected;
647
  }
648
 
649
+ /**
650
+ * Get active/all cache count.
651
+ *
652
+ * @param bool $active when set to true only items updated in the last months are returned.
653
+ *
654
+ * @return int
655
+ */
656
+ public function get_cache_count($active = false) {
657
+ global $wpdb;
658
+ $cache_table_name = $wpdb->prefix . 'sbi_feed_caches';
659
+ $query = "SELECT COUNT(DISTINCT feed_id, cache_key) as cache_count FROM $cache_table_name WHERE feed_id Not Like '%_CUSTOMIZER%'";
660
+
661
+ if($active === true) {
662
+ $query .= " AND feed_id Not Like '%_MODMODE%' AND last_updated >= DATE_SUB(NOW(), INTERVAL 1 MONTH)";
663
+ }
664
+
665
+ $sql = $wpdb->prepare($query);
666
+ $caches = $wpdb->get_results( $sql );
667
+
668
+ if(!empty($caches)) {
669
+ return $caches[0]->cache_count;
670
+ }
671
+
672
+ return 0;
673
+ }
674
  }
inc/class-sb-instagram-settings.php CHANGED
@@ -370,7 +370,8 @@ class SB_Instagram_Settings {
370
  $allowed_legacy_shortcode = array(
371
  'feed',
372
  'headersource',
373
- 'customizer'
 
374
  );
375
 
376
  if ( ! empty( $sbi_statuses['support_legacy_shortcode'] )
370
  $allowed_legacy_shortcode = array(
371
  'feed',
372
  'headersource',
373
+ 'customizer',
374
+ 'class'
375
  );
376
 
377
  if ( ! empty( $sbi_statuses['support_legacy_shortcode'] )
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: 6.0.4
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
@@ -22,6 +22,9 @@ You should have received a copy of the GNU General Public License
22
  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( 'SBI_STORE_URL' ) ) {
26
  define( 'SBI_STORE_URL', 'https://smashballoon.com/' );
27
  }
@@ -29,7 +32,7 @@ if ( ! defined( 'SBI_PLUGIN_NAME' ) ) {
29
  define( 'SBI_PLUGIN_NAME', 'Instagram Feed Free' );
30
  }
31
  if ( ! defined( 'SBIVER' ) ) {
32
- define( 'SBIVER', '6.0.4' );
33
  }
34
  // Db version.
35
  if ( ! defined( 'SBI_DBVERSION' ) ) {
@@ -109,7 +112,7 @@ if ( function_exists( 'sb_instagram_feed_init' ) ) {
109
  define( 'SBI_BUILDER_URL', SBI_PLUGIN_URL . 'admin/builder/' );
110
  }
111
 
112
-
113
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/if-functions.php';
114
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-api-connect.php';
115
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-cache.php';
@@ -132,9 +135,13 @@ if ( function_exists( 'sb_instagram_feed_init' ) ) {
132
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-single.php';
133
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-token-refresher.php';
134
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/admin/blocks/class-sbi-blocks.php';
135
- require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/admin/class-sbi-tracking.php';
136
 
137
  $sbi_blocks = new SB_Instagram_Blocks();
 
 
 
 
 
138
 
139
  if ( $sbi_blocks->allow_load() ) {
140
  $sbi_blocks->load();
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: 6.0.5
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
22
  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
+
26
+ use InstagramFeed\Helpers\SB_Instagram_Tracking;
27
+
28
  if ( ! defined( 'SBI_STORE_URL' ) ) {
29
  define( 'SBI_STORE_URL', 'https://smashballoon.com/' );
30
  }
32
  define( 'SBI_PLUGIN_NAME', 'Instagram Feed Free' );
33
  }
34
  if ( ! defined( 'SBIVER' ) ) {
35
+ define( 'SBIVER', '6.0.5' );
36
  }
37
  // Db version.
38
  if ( ! defined( 'SBI_DBVERSION' ) ) {
112
  define( 'SBI_BUILDER_URL', SBI_PLUGIN_URL . 'admin/builder/' );
113
  }
114
 
115
+ require SBI_PLUGIN_DIR . 'vendor/autoload.php';
116
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/if-functions.php';
117
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-api-connect.php';
118
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-cache.php';
135
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-single.php';
136
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-token-refresher.php';
137
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/admin/blocks/class-sbi-blocks.php';
 
138
 
139
  $sbi_blocks = new SB_Instagram_Blocks();
140
+ new SB_Instagram_Tracking();
141
+
142
+ //Boot all services
143
+ $service_container = new \InstagramFeed\Services\ServiceContainer();
144
+ $service_container->register();
145
 
146
  if ( $sbi_blocks->allow_load() ) {
147
  $sbi_blocks->load();
vendor/composer/ClassLoader.php CHANGED
@@ -37,57 +37,130 @@ namespace Composer\Autoload;
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
 
 
 
45
  // PSR-4
 
 
 
 
46
  private $prefixLengthsPsr4 = array();
 
 
 
 
47
  private $prefixDirsPsr4 = array();
 
 
 
 
48
  private $fallbackDirsPsr4 = array();
49
 
50
  // PSR-0
 
 
 
 
51
  private $prefixesPsr0 = array();
 
 
 
 
52
  private $fallbackDirsPsr0 = array();
53
 
 
54
  private $useIncludePath = false;
 
 
 
 
 
55
  private $classMap = array();
 
 
56
  private $classMapAuthoritative = false;
 
 
 
 
 
57
  private $missingClasses = array();
 
 
58
  private $apcuPrefix;
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
  }
65
 
66
  return array();
67
  }
68
 
 
 
 
 
69
  public function getPrefixesPsr4()
70
  {
71
  return $this->prefixDirsPsr4;
72
  }
73
 
 
 
 
 
74
  public function getFallbackDirs()
75
  {
76
  return $this->fallbackDirsPsr0;
77
  }
78
 
 
 
 
 
79
  public function getFallbackDirsPsr4()
80
  {
81
  return $this->fallbackDirsPsr4;
82
  }
83
 
 
 
 
 
84
  public function getClassMap()
85
  {
86
  return $this->classMap;
87
  }
88
 
89
  /**
90
- * @param array $classMap Class to filename map
 
 
 
91
  */
92
  public function addClassMap(array $classMap)
93
  {
@@ -102,9 +175,11 @@ class ClassLoader
102
  * Registers a set of PSR-0 directories for a given prefix, either
103
  * appending or prepending to the ones previously set for this prefix.
104
  *
105
- * @param string $prefix The prefix
106
- * @param array|string $paths The PSR-0 root directories
107
- * @param bool $prepend Whether to prepend the directories
 
 
108
  */
109
  public function add($prefix, $paths, $prepend = false)
110
  {
@@ -147,11 +222,13 @@ class ClassLoader
147
  * Registers a set of PSR-4 directories for a given namespace, either
148
  * appending or prepending to the ones previously set for this namespace.
149
  *
150
- * @param string $prefix The prefix/namespace, with trailing '\\'
151
- * @param array|string $paths The PSR-4 base directories
152
- * @param bool $prepend Whether to prepend the directories
153
  *
154
  * @throws \InvalidArgumentException
 
 
155
  */
156
  public function addPsr4($prefix, $paths, $prepend = false)
157
  {
@@ -195,8 +272,10 @@ class ClassLoader
195
  * Registers a set of PSR-0 directories for a given prefix,
196
  * replacing any others previously set for this prefix.
197
  *
198
- * @param string $prefix The prefix
199
- * @param array|string $paths The PSR-0 base directories
 
 
200
  */
201
  public function set($prefix, $paths)
202
  {
@@ -211,10 +290,12 @@ class ClassLoader
211
  * Registers a set of PSR-4 directories for a given namespace,
212
  * replacing any others previously set for this namespace.
213
  *
214
- * @param string $prefix The prefix/namespace, with trailing '\\'
215
- * @param array|string $paths The PSR-4 base directories
216
  *
217
  * @throws \InvalidArgumentException
 
 
218
  */
219
  public function setPsr4($prefix, $paths)
220
  {
@@ -234,6 +315,8 @@ class ClassLoader
234
  * Turns on searching the include path for class files.
235
  *
236
  * @param bool $useIncludePath
 
 
237
  */
238
  public function setUseIncludePath($useIncludePath)
239
  {
@@ -256,6 +339,8 @@ class ClassLoader
256
  * that have not been registered with the class map.
257
  *
258
  * @param bool $classMapAuthoritative
 
 
259
  */
260
  public function setClassMapAuthoritative($classMapAuthoritative)
261
  {
@@ -276,6 +361,8 @@ class ClassLoader
276
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
  *
278
  * @param string|null $apcuPrefix
 
 
279
  */
280
  public function setApcuPrefix($apcuPrefix)
281
  {
@@ -296,25 +383,44 @@ class ClassLoader
296
  * Registers this instance as an autoloader.
297
  *
298
  * @param bool $prepend Whether to prepend the autoloader or not
 
 
299
  */
300
  public function register($prepend = false)
301
  {
302
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
 
305
  /**
306
  * Unregisters this instance as an autoloader.
 
 
307
  */
308
  public function unregister()
309
  {
310
  spl_autoload_unregister(array($this, 'loadClass'));
 
 
 
 
311
  }
312
 
313
  /**
314
  * Loads the given class or interface.
315
  *
316
  * @param string $class The name of the class
317
- * @return bool|null True if loaded, null otherwise
318
  */
319
  public function loadClass($class)
320
  {
@@ -323,6 +429,8 @@ class ClassLoader
323
 
324
  return true;
325
  }
 
 
326
  }
327
 
328
  /**
@@ -367,6 +475,21 @@ class ClassLoader
367
  return $file;
368
  }
369
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  private function findFileWithExtension($class, $ext)
371
  {
372
  // PSR-4 lookup
@@ -438,6 +561,10 @@ class ClassLoader
438
  * Scope isolated include.
439
  *
440
  * Prevents access to $this/self from included files.
 
 
 
 
441
  */
442
  function includeFile($file)
443
  {
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see https://www.php-fig.org/psr/psr-0/
41
+ * @see https://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
45
+ /** @var ?string */
46
+ private $vendorDir;
47
+
48
  // PSR-4
49
+ /**
50
+ * @var array[]
51
+ * @psalm-var array<string, array<string, int>>
52
+ */
53
  private $prefixLengthsPsr4 = array();
54
+ /**
55
+ * @var array[]
56
+ * @psalm-var array<string, array<int, string>>
57
+ */
58
  private $prefixDirsPsr4 = array();
59
+ /**
60
+ * @var array[]
61
+ * @psalm-var array<string, string>
62
+ */
63
  private $fallbackDirsPsr4 = array();
64
 
65
  // PSR-0
66
+ /**
67
+ * @var array[]
68
+ * @psalm-var array<string, array<string, string[]>>
69
+ */
70
  private $prefixesPsr0 = array();
71
+ /**
72
+ * @var array[]
73
+ * @psalm-var array<string, string>
74
+ */
75
  private $fallbackDirsPsr0 = array();
76
 
77
+ /** @var bool */
78
  private $useIncludePath = false;
79
+
80
+ /**
81
+ * @var string[]
82
+ * @psalm-var array<string, string>
83
+ */
84
  private $classMap = array();
85
+
86
+ /** @var bool */
87
  private $classMapAuthoritative = false;
88
+
89
+ /**
90
+ * @var bool[]
91
+ * @psalm-var array<string, bool>
92
+ */
93
  private $missingClasses = array();
94
+
95
+ /** @var ?string */
96
  private $apcuPrefix;
97
 
98
+ /**
99
+ * @var self[]
100
+ */
101
+ private static $registeredLoaders = array();
102
+
103
+ /**
104
+ * @param ?string $vendorDir
105
+ */
106
+ public function __construct($vendorDir = null)
107
+ {
108
+ $this->vendorDir = $vendorDir;
109
+ }
110
+
111
+ /**
112
+ * @return string[]
113
+ */
114
  public function getPrefixes()
115
  {
116
  if (!empty($this->prefixesPsr0)) {
117
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
118
  }
119
 
120
  return array();
121
  }
122
 
123
+ /**
124
+ * @return array[]
125
+ * @psalm-return array<string, array<int, string>>
126
+ */
127
  public function getPrefixesPsr4()
128
  {
129
  return $this->prefixDirsPsr4;
130
  }
131
 
132
+ /**
133
+ * @return array[]
134
+ * @psalm-return array<string, string>
135
+ */
136
  public function getFallbackDirs()
137
  {
138
  return $this->fallbackDirsPsr0;
139
  }
140
 
141
+ /**
142
+ * @return array[]
143
+ * @psalm-return array<string, string>
144
+ */
145
  public function getFallbackDirsPsr4()
146
  {
147
  return $this->fallbackDirsPsr4;
148
  }
149
 
150
+ /**
151
+ * @return string[] Array of classname => path
152
+ * @psalm-return array<string, string>
153
+ */
154
  public function getClassMap()
155
  {
156
  return $this->classMap;
157
  }
158
 
159
  /**
160
+ * @param string[] $classMap Class to filename map
161
+ * @psalm-param array<string, string> $classMap
162
+ *
163
+ * @return void
164
  */
165
  public function addClassMap(array $classMap)
166
  {
175
  * Registers a set of PSR-0 directories for a given prefix, either
176
  * appending or prepending to the ones previously set for this prefix.
177
  *
178
+ * @param string $prefix The prefix
179
+ * @param string[]|string $paths The PSR-0 root directories
180
+ * @param bool $prepend Whether to prepend the directories
181
+ *
182
+ * @return void
183
  */
184
  public function add($prefix, $paths, $prepend = false)
185
  {
222
  * Registers a set of PSR-4 directories for a given namespace, either
223
  * appending or prepending to the ones previously set for this namespace.
224
  *
225
+ * @param string $prefix The prefix/namespace, with trailing '\\'
226
+ * @param string[]|string $paths The PSR-4 base directories
227
+ * @param bool $prepend Whether to prepend the directories
228
  *
229
  * @throws \InvalidArgumentException
230
+ *
231
+ * @return void
232
  */
233
  public function addPsr4($prefix, $paths, $prepend = false)
234
  {
272
  * Registers a set of PSR-0 directories for a given prefix,
273
  * replacing any others previously set for this prefix.
274
  *
275
+ * @param string $prefix The prefix
276
+ * @param string[]|string $paths The PSR-0 base directories
277
+ *
278
+ * @return void
279
  */
280
  public function set($prefix, $paths)
281
  {
290
  * Registers a set of PSR-4 directories for a given namespace,
291
  * replacing any others previously set for this namespace.
292
  *
293
+ * @param string $prefix The prefix/namespace, with trailing '\\'
294
+ * @param string[]|string $paths The PSR-4 base directories
295
  *
296
  * @throws \InvalidArgumentException
297
+ *
298
+ * @return void
299
  */
300
  public function setPsr4($prefix, $paths)
301
  {
315
  * Turns on searching the include path for class files.
316
  *
317
  * @param bool $useIncludePath
318
+ *
319
+ * @return void
320
  */
321
  public function setUseIncludePath($useIncludePath)
322
  {
339
  * that have not been registered with the class map.
340
  *
341
  * @param bool $classMapAuthoritative
342
+ *
343
+ * @return void
344
  */
345
  public function setClassMapAuthoritative($classMapAuthoritative)
346
  {
361
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
362
  *
363
  * @param string|null $apcuPrefix
364
+ *
365
+ * @return void
366
  */
367
  public function setApcuPrefix($apcuPrefix)
368
  {
383
  * Registers this instance as an autoloader.
384
  *
385
  * @param bool $prepend Whether to prepend the autoloader or not
386
+ *
387
+ * @return void
388
  */
389
  public function register($prepend = false)
390
  {
391
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
392
+
393
+ if (null === $this->vendorDir) {
394
+ return;
395
+ }
396
+
397
+ if ($prepend) {
398
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
399
+ } else {
400
+ unset(self::$registeredLoaders[$this->vendorDir]);
401
+ self::$registeredLoaders[$this->vendorDir] = $this;
402
+ }
403
  }
404
 
405
  /**
406
  * Unregisters this instance as an autoloader.
407
+ *
408
+ * @return void
409
  */
410
  public function unregister()
411
  {
412
  spl_autoload_unregister(array($this, 'loadClass'));
413
+
414
+ if (null !== $this->vendorDir) {
415
+ unset(self::$registeredLoaders[$this->vendorDir]);
416
+ }
417
  }
418
 
419
  /**
420
  * Loads the given class or interface.
421
  *
422
  * @param string $class The name of the class
423
+ * @return true|null True if loaded, null otherwise
424
  */
425
  public function loadClass($class)
426
  {
429
 
430
  return true;
431
  }
432
+
433
+ return null;
434
  }
435
 
436
  /**
475
  return $file;
476
  }
477
 
478
+ /**
479
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
480
+ *
481
+ * @return self[]
482
+ */
483
+ public static function getRegisteredLoaders()
484
+ {
485
+ return self::$registeredLoaders;
486
+ }
487
+
488
+ /**
489
+ * @param string $class
490
+ * @param string $ext
491
+ * @return string|false
492
+ */
493
  private function findFileWithExtension($class, $ext)
494
  {
495
  // PSR-4 lookup
561
  * Scope isolated include.
562
  *
563
  * Prevents access to $this/self from included files.
564
+ *
565
+ * @param string $file
566
+ * @return void
567
+ * @private
568
  */
569
  function includeFile($file)
570
  {
vendor/composer/InstalledVersions.php ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer;
14
+
15
+ use Composer\Autoload\ClassLoader;
16
+ use Composer\Semver\VersionParser;
17
+
18
+ /**
19
+ * This class is copied in every Composer installed project and available to all
20
+ *
21
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
+ *
23
+ * To require its presence, you can require `composer-runtime-api ^2.0`
24
+ */
25
+ class InstalledVersions
26
+ {
27
+ /**
28
+ * @var mixed[]|null
29
+ * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
30
+ */
31
+ private static $installed;
32
+
33
+ /**
34
+ * @var bool|null
35
+ */
36
+ private static $canGetVendors;
37
+
38
+ /**
39
+ * @var array[]
40
+ * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
41
+ */
42
+ private static $installedByVendor = array();
43
+
44
+ /**
45
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
46
+ *
47
+ * @return string[]
48
+ * @psalm-return list<string>
49
+ */
50
+ public static function getInstalledPackages()
51
+ {
52
+ $packages = array();
53
+ foreach (self::getInstalled() as $installed) {
54
+ $packages[] = array_keys($installed['versions']);
55
+ }
56
+
57
+ if (1 === \count($packages)) {
58
+ return $packages[0];
59
+ }
60
+
61
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
62
+ }
63
+
64
+ /**
65
+ * Returns a list of all package names with a specific type e.g. 'library'
66
+ *
67
+ * @param string $type
68
+ * @return string[]
69
+ * @psalm-return list<string>
70
+ */
71
+ public static function getInstalledPackagesByType($type)
72
+ {
73
+ $packagesByType = array();
74
+
75
+ foreach (self::getInstalled() as $installed) {
76
+ foreach ($installed['versions'] as $name => $package) {
77
+ if (isset($package['type']) && $package['type'] === $type) {
78
+ $packagesByType[] = $name;
79
+ }
80
+ }
81
+ }
82
+
83
+ return $packagesByType;
84
+ }
85
+
86
+ /**
87
+ * Checks whether the given package is installed
88
+ *
89
+ * This also returns true if the package name is provided or replaced by another package
90
+ *
91
+ * @param string $packageName
92
+ * @param bool $includeDevRequirements
93
+ * @return bool
94
+ */
95
+ public static function isInstalled($packageName, $includeDevRequirements = true)
96
+ {
97
+ foreach (self::getInstalled() as $installed) {
98
+ if (isset($installed['versions'][$packageName])) {
99
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
100
+ }
101
+ }
102
+
103
+ return false;
104
+ }
105
+
106
+ /**
107
+ * Checks whether the given package satisfies a version constraint
108
+ *
109
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
110
+ *
111
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
112
+ *
113
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
114
+ * @param string $packageName
115
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
116
+ * @return bool
117
+ */
118
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
119
+ {
120
+ $constraint = $parser->parseConstraints($constraint);
121
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
122
+
123
+ return $provided->matches($constraint);
124
+ }
125
+
126
+ /**
127
+ * Returns a version constraint representing all the range(s) which are installed for a given package
128
+ *
129
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
130
+ * whether a given version of a package is installed, and not just whether it exists
131
+ *
132
+ * @param string $packageName
133
+ * @return string Version constraint usable with composer/semver
134
+ */
135
+ public static function getVersionRanges($packageName)
136
+ {
137
+ foreach (self::getInstalled() as $installed) {
138
+ if (!isset($installed['versions'][$packageName])) {
139
+ continue;
140
+ }
141
+
142
+ $ranges = array();
143
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
144
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
145
+ }
146
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
147
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
148
+ }
149
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
150
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
151
+ }
152
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
153
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
154
+ }
155
+
156
+ return implode(' || ', $ranges);
157
+ }
158
+
159
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
160
+ }
161
+
162
+ /**
163
+ * @param string $packageName
164
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
165
+ */
166
+ public static function getVersion($packageName)
167
+ {
168
+ foreach (self::getInstalled() as $installed) {
169
+ if (!isset($installed['versions'][$packageName])) {
170
+ continue;
171
+ }
172
+
173
+ if (!isset($installed['versions'][$packageName]['version'])) {
174
+ return null;
175
+ }
176
+
177
+ return $installed['versions'][$packageName]['version'];
178
+ }
179
+
180
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
181
+ }
182
+
183
+ /**
184
+ * @param string $packageName
185
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
186
+ */
187
+ public static function getPrettyVersion($packageName)
188
+ {
189
+ foreach (self::getInstalled() as $installed) {
190
+ if (!isset($installed['versions'][$packageName])) {
191
+ continue;
192
+ }
193
+
194
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
195
+ return null;
196
+ }
197
+
198
+ return $installed['versions'][$packageName]['pretty_version'];
199
+ }
200
+
201
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
202
+ }
203
+
204
+ /**
205
+ * @param string $packageName
206
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
207
+ */
208
+ public static function getReference($packageName)
209
+ {
210
+ foreach (self::getInstalled() as $installed) {
211
+ if (!isset($installed['versions'][$packageName])) {
212
+ continue;
213
+ }
214
+
215
+ if (!isset($installed['versions'][$packageName]['reference'])) {
216
+ return null;
217
+ }
218
+
219
+ return $installed['versions'][$packageName]['reference'];
220
+ }
221
+
222
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
223
+ }
224
+
225
+ /**
226
+ * @param string $packageName
227
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
228
+ */
229
+ public static function getInstallPath($packageName)
230
+ {
231
+ foreach (self::getInstalled() as $installed) {
232
+ if (!isset($installed['versions'][$packageName])) {
233
+ continue;
234
+ }
235
+
236
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
237
+ }
238
+
239
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
240
+ }
241
+
242
+ /**
243
+ * @return array
244
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
245
+ */
246
+ public static function getRootPackage()
247
+ {
248
+ $installed = self::getInstalled();
249
+
250
+ return $installed[0]['root'];
251
+ }
252
+
253
+ /**
254
+ * Returns the raw installed.php data for custom implementations
255
+ *
256
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
257
+ * @return array[]
258
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
259
+ */
260
+ public static function getRawData()
261
+ {
262
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
263
+
264
+ if (null === self::$installed) {
265
+ // only require the installed.php file if this file is loaded from its dumped location,
266
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
267
+ if (substr(__DIR__, -8, 1) !== 'C') {
268
+ self::$installed = include __DIR__ . '/installed.php';
269
+ } else {
270
+ self::$installed = array();
271
+ }
272
+ }
273
+
274
+ return self::$installed;
275
+ }
276
+
277
+ /**
278
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
279
+ *
280
+ * @return array[]
281
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
282
+ */
283
+ public static function getAllRawData()
284
+ {
285
+ return self::getInstalled();
286
+ }
287
+
288
+ /**
289
+ * Lets you reload the static array from another file
290
+ *
291
+ * This is only useful for complex integrations in which a project needs to use
292
+ * this class but then also needs to execute another project's autoloader in process,
293
+ * and wants to ensure both projects have access to their version of installed.php.
294
+ *
295
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
296
+ * the data it needs from this class, then call reload() with
297
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
298
+ * the project in which it runs can then also use this class safely, without
299
+ * interference between PHPUnit's dependencies and the project's dependencies.
300
+ *
301
+ * @param array[] $data A vendor/composer/installed.php data set
302
+ * @return void
303
+ *
304
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
305
+ */
306
+ public static function reload($data)
307
+ {
308
+ self::$installed = $data;
309
+ self::$installedByVendor = array();
310
+ }
311
+
312
+ /**
313
+ * @return array[]
314
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
315
+ */
316
+ private static function getInstalled()
317
+ {
318
+ if (null === self::$canGetVendors) {
319
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
320
+ }
321
+
322
+ $installed = array();
323
+
324
+ if (self::$canGetVendors) {
325
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
326
+ if (isset(self::$installedByVendor[$vendorDir])) {
327
+ $installed[] = self::$installedByVendor[$vendorDir];
328
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
329
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
330
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
331
+ self::$installed = $installed[count($installed) - 1];
332
+ }
333
+ }
334
+ }
335
+ }
336
+
337
+ if (null === self::$installed) {
338
+ // only require the installed.php file if this file is loaded from its dumped location,
339
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
340
+ if (substr(__DIR__, -8, 1) !== 'C') {
341
+ self::$installed = require __DIR__ . '/installed.php';
342
+ } else {
343
+ self::$installed = array();
344
+ }
345
+ }
346
+ $installed[] = self::$installed;
347
+
348
+ return $installed;
349
+ }
350
+ }
vendor/composer/autoload_classmap.php CHANGED
@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
  );
vendor/composer/autoload_psr4.php CHANGED
@@ -6,5 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  'InstagramFeed\\' => array($baseDir . '/inc'),
10
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Smashballoon\\Stubs\\' => array($vendorDir . '/smashballoon/stubs/src'),
10
  'InstagramFeed\\' => array($baseDir . '/inc'),
11
  );
vendor/composer/autoload_real.php CHANGED
@@ -13,6 +13,9 @@ class ComposerAutoloaderInit4e34082fb013bad63334b182d1cf5455
13
  }
14
  }
15
 
 
 
 
16
  public static function getLoader()
17
  {
18
  if (null !== self::$loader) {
@@ -20,12 +23,12 @@ class ComposerAutoloaderInit4e34082fb013bad63334b182d1cf5455
20
  }
21
 
22
  spl_autoload_register(array('ComposerAutoloaderInit4e34082fb013bad63334b182d1cf5455', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit4e34082fb013bad63334b182d1cf5455', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
- require_once __DIR__ . '/autoload_static.php';
29
 
30
  call_user_func(\Composer\Autoload\ComposerStaticInit4e34082fb013bad63334b182d1cf5455::getInitializer($loader));
31
  } else {
13
  }
14
  }
15
 
16
+ /**
17
+ * @return \Composer\Autoload\ClassLoader
18
+ */
19
  public static function getLoader()
20
  {
21
  if (null !== self::$loader) {
23
  }
24
 
25
  spl_autoload_register(array('ComposerAutoloaderInit4e34082fb013bad63334b182d1cf5455', 'loadClassLoader'), true, true);
26
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
  spl_autoload_unregister(array('ComposerAutoloaderInit4e34082fb013bad63334b182d1cf5455', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
+ require __DIR__ . '/autoload_static.php';
32
 
33
  call_user_func(\Composer\Autoload\ComposerStaticInit4e34082fb013bad63334b182d1cf5455::getInitializer($loader));
34
  } else {
vendor/composer/autoload_static.php CHANGED
@@ -7,6 +7,10 @@ namespace Composer\Autoload;
7
  class ComposerStaticInit4e34082fb013bad63334b182d1cf5455
8
  {
9
  public static $prefixLengthsPsr4 = array (
 
 
 
 
10
  'I' =>
11
  array (
12
  'InstagramFeed\\' => 14,
@@ -14,17 +18,26 @@ class ComposerStaticInit4e34082fb013bad63334b182d1cf5455
14
  );
15
 
16
  public static $prefixDirsPsr4 = array (
 
 
 
 
17
  'InstagramFeed\\' =>
18
  array (
19
  0 => __DIR__ . '/../..' . '/inc',
20
  ),
21
  );
22
 
 
 
 
 
23
  public static function getInitializer(ClassLoader $loader)
24
  {
25
  return \Closure::bind(function () use ($loader) {
26
  $loader->prefixLengthsPsr4 = ComposerStaticInit4e34082fb013bad63334b182d1cf5455::$prefixLengthsPsr4;
27
  $loader->prefixDirsPsr4 = ComposerStaticInit4e34082fb013bad63334b182d1cf5455::$prefixDirsPsr4;
 
28
 
29
  }, null, ClassLoader::class);
30
  }
7
  class ComposerStaticInit4e34082fb013bad63334b182d1cf5455
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
+ 'S' =>
11
+ array (
12
+ 'Smashballoon\\Stubs\\' => 19,
13
+ ),
14
  'I' =>
15
  array (
16
  'InstagramFeed\\' => 14,
18
  );
19
 
20
  public static $prefixDirsPsr4 = array (
21
+ 'Smashballoon\\Stubs\\' =>
22
+ array (
23
+ 0 => __DIR__ . '/..' . '/smashballoon/stubs/src',
24
+ ),
25
  'InstagramFeed\\' =>
26
  array (
27
  0 => __DIR__ . '/../..' . '/inc',
28
  ),
29
  );
30
 
31
+ public static $classMap = array (
32
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
33
+ );
34
+
35
  public static function getInitializer(ClassLoader $loader)
36
  {
37
  return \Closure::bind(function () use ($loader) {
38
  $loader->prefixLengthsPsr4 = ComposerStaticInit4e34082fb013bad63334b182d1cf5455::$prefixLengthsPsr4;
39
  $loader->prefixDirsPsr4 = ComposerStaticInit4e34082fb013bad63334b182d1cf5455::$prefixDirsPsr4;
40
+ $loader->classMap = ComposerStaticInit4e34082fb013bad63334b182d1cf5455::$classMap;
41
 
42
  }, null, ClassLoader::class);
43
  }
vendor/composer/installed.json CHANGED
@@ -1 +1,43 @@
1
- []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "packages": [
3
+ {
4
+ "name": "smashballoon/stubs",
5
+ "version": "dev-master",
6
+ "version_normalized": "dev-master",
7
+ "source": {
8
+ "type": "git",
9
+ "url": "git@github.com:awesomemotive/sb-stubs.git",
10
+ "reference": "1f3cfc495280e072aac59933690164b3cb4d5b21"
11
+ },
12
+ "dist": {
13
+ "type": "zip",
14
+ "url": "https://api.github.com/repos/awesomemotive/sb-stubs/zipball/1f3cfc495280e072aac59933690164b3cb4d5b21",
15
+ "reference": "1f3cfc495280e072aac59933690164b3cb4d5b21",
16
+ "shasum": ""
17
+ },
18
+ "time": "2022-03-24T11:04:04+00:00",
19
+ "default-branch": true,
20
+ "type": "library",
21
+ "installation-source": "dist",
22
+ "autoload": {
23
+ "psr-4": {
24
+ "Smashballoon\\Stubs\\": "src/"
25
+ }
26
+ },
27
+ "authors": [
28
+ {
29
+ "name": "Ahmed Hussein",
30
+ "email": "ahussein@awesomemotive.com"
31
+ }
32
+ ],
33
+ "description": "Shared common stubs.",
34
+ "support": {
35
+ "source": "https://github.com/awesomemotive/sb-stubs/tree/master",
36
+ "issues": "https://github.com/awesomemotive/sb-stubs/issues"
37
+ },
38
+ "install-path": "../smashballoon/stubs"
39
+ }
40
+ ],
41
+ "dev": true,
42
+ "dev-package-names": []
43
+ }
vendor/composer/installed.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php return array(
2
+ 'root' => array(
3
+ 'pretty_version' => 'dev-master',
4
+ 'version' => 'dev-master',
5
+ 'type' => 'library',
6
+ 'install_path' => __DIR__ . '/../../',
7
+ 'aliases' => array(),
8
+ 'reference' => '32fa15240ac296f92a477f177de0acf333507d67',
9
+ 'name' => 'smashballoon/instagram-feed',
10
+ 'dev' => true,
11
+ ),
12
+ 'versions' => array(
13
+ 'smashballoon/instagram-feed' => array(
14
+ 'pretty_version' => 'dev-master',
15
+ 'version' => 'dev-master',
16
+ 'type' => 'library',
17
+ 'install_path' => __DIR__ . '/../../',
18
+ 'aliases' => array(),
19
+ 'reference' => '32fa15240ac296f92a477f177de0acf333507d67',
20
+ 'dev_requirement' => false,
21
+ ),
22
+ 'smashballoon/stubs' => array(
23
+ 'pretty_version' => 'dev-master',
24
+ 'version' => 'dev-master',
25
+ 'type' => 'library',
26
+ 'install_path' => __DIR__ . '/../smashballoon/stubs',
27
+ 'aliases' => array(
28
+ 0 => '9999999-dev',
29
+ ),
30
+ 'reference' => '1f3cfc495280e072aac59933690164b3cb4d5b21',
31
+ 'dev_requirement' => false,
32
+ ),
33
+ ),
34
+ );
vendor/smashballoon/stubs/composer.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "smashballoon/stubs",
3
+ "description": "Shared common stubs.",
4
+ "type": "library",
5
+ "version": "1.0.0",
6
+ "autoload": {
7
+ "psr-4": {
8
+ "Smashballoon\\Stubs\\": "src/"
9
+ }
10
+ },
11
+ "authors": [
12
+ {
13
+ "name": "Ahmed Hussein",
14
+ "email": "ahussein@awesomemotive.com"
15
+ }
16
+ ],
17
+ "minimum-stability": "dev",
18
+ "require": {}
19
+ }
vendor/smashballoon/stubs/src/Services/ServiceProvider.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Smashballoon\Stubs\Services;
4
+
5
+ abstract class ServiceProvider implements ServiceProviderInterface {
6
+ public function register() {
7
+ // TODO: Implement register() method.
8
+ }
9
+ }
vendor/smashballoon/stubs/src/Services/ServiceProviderInterface.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Smashballoon\Stubs\Services;
4
+
5
+ interface ServiceProviderInterface {
6
+ public function register();
7
+ }
vendor/smashballoon/stubs/src/Traits/Singleton.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Smashballoon\Stubs\Traits;
4
+
5
+ trait Singleton
6
+ {
7
+ protected static $instance;
8
+ final public static function getInstance()
9
+ {
10
+ return isset(static::$instance)
11
+ ? static::$instance
12
+ : static::$instance = new static;
13
+ }
14
+ final private function __construct() {
15
+ $this->init();
16
+ }
17
+ protected function init() {}
18
+ final private function __wakeup() {}
19
+ final private function __clone() {}
20
+ }