Custom Facebook Feed - Version 2.14.1

Version Description

  • Fix: Some connection error notices not clearing automatically.
Download this release

Release Info

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

Code changes from version 2.14 to 2.14.1

README.txt CHANGED
@@ -1,10 +1,10 @@
1
=== Smash Balloon Social Post Feed ===
2
Contributors: smashballoon
3
- Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook page
4
Requires at least: 3.0
5
Requires PHP: 5.2
6
Tested up to: 5.4
7
- Stable tag: 2.14
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -12,82 +12,80 @@ Formerly "Custom Facebook Feed". Display completely customizable Facebook feeds
12
13
== Description ==
14
15
- Display Facebook posts on your website. **Completely customizable**, **responsive** and **search engine crawlable**. Display **multiple Facebook feeds** from **any public Facebook page**, and completely match the look and feel of the site with tons of customization options!
16
17
*"The perfect Facebook plugin with amazing support! What else do you want? Get it!"* - [JoeJeffries](http://wordpress.org/support/topic/you-dont-already-have-this?facebook)
18
19
- *"I honestly cannot recommend this plugin enough. The plugin itself is gorgeous and super customizable, and if you run into trouble...support will get you out of it. Five Stars across the board."* - [pamsavoybarnett](http://wordpress.org/support/topic/love-this-plugin-w-awesome-support?facebook)
20
21
- **Please note:** This free plugin allows you to display text and links from Facebook posts. To display **photos, videos, comments,** and more, we offer a Pro version of the plugin. See the Pro Version section below for more information.
22
23
### Facebook Feed Features
24
25
* **Super simple to set up** - 1 minute quick setup with no Facebook Developer App required
26
- * **Display feeds from ANY Facebook page** - even ones you aren't an admin of
27
- * **Completely Customizable** - By default the Facebook feed will adopt the style of your website, but can be completely customized to look however you like - with tons of styling and customization options!
28
* Facebook feed content is **crawlable by search engines** adding SEO value to your site - other Facebook plugins embed the feed using iframes which are not crawlable
29
- * Completely **responsive** and mobile optimized - layout looks great on any screen size and in any container width
30
- * Display **feeds from multiple different Facebook pages** and use the shortcode to embed them into a page, post or widget anywhere on your site
31
- * Add your own **custom CSS**
32
* **Caching** means that your Facebook posts load lightning fast. Set your own caching time - check for new posts on Facebook every few seconds, minutes, hours or days. You decide.
33
* Show and hide certain parts of each Facebook post
34
- * Show or hide the Facebook profile picture and name of the author above each post
35
* Display Facebook posts by just the page owner, everyone who posts on your Facebook page, or only other people
36
* Control the width, height, padding and background color of your Facebook feed
37
- * Customize the size, weight and color of text
38
* Choose to set a background color and rounded corners on your Facebook posts
39
* Supports Facebook tags - creates links when using the @ symbol to tag people in your Facebook posts
40
* Automatically links hashtags used in posts to the hashtag page on Facebook
41
- * Select the number of Facebook posts to display
42
- * Select from a range of date formats or enter your own
43
- * Use your own custom link text in place of the defaults
44
* Use the shortcode options to style multiple Facebook feeds in completely different ways
45
* Set a maximum character length for both the text and descriptions of your Facebook posts
46
- * Create a customizable header with a range of icons for your Custom Facebook Feed
47
- * Localization/i18n support to allow every part of the feed to be displayed in your language
48
49
### Pro Version (Custom Facebook Feed Pro)
50
51
- In order to maintain the free version of the plugin on an ongoing basis, and to provide quick and effective support for free, we offer a Pro version of the plugin. The Pro version allows you to display photos, videos, the number of likes, shares, reactions and comments for each Facebook post, choose from multiple layout options, filter posts by type or #hashtag/string, load more posts into your feed, and more. [Click here](https://smashballoon.com/differences-between-the-free-version-and-pro-version-of-the-custom-facebook-feed-plugin/ "Differences between free and Pro version of Custom Facebook Feed plugin") for a full list of all differences between the free version and Pro version.
52
53
- * [Find out more about the Pro version](https://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro")
54
- * [Try out the Pro demo](https://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Pro Demo").
55
56
### Benefits
57
58
* **Increase social engagement** between you and your users, customers, or fans
59
* **Save time** by using the Custom Facebook Feed to generate dynamic, search engine crawlable content on your website
60
* **Get more likes** by displaying your Facebook content directly on your site
61
- * **Improve your SEO** as all of that quality keyword-rich Facebook content from posts and comments is directly embedded into your website
62
* Display your Facebook content your way to perfectly match your website's style
63
* **No Coding Required** - choose from tons of built-in customization options to create a truly unique feed of your Facebook content.
64
- * The plugin is **updated regularly** with new features, bug-fixes and Facebook API changes
65
* Support is quick and effective
66
* We're dedicated to providing the **most customizable**, **robust** and **well supported** Facebook feed plugin in the world!
67
68
- ### How to use the plugin
69
70
- One of our main priorities has always been to make our plugins as easy as possible to setup and use. Once you've installed the plugin there are only a few steps to get up and running:
71
72
- * 1) Click the "Log in and get my Access Token" button on the plugin settings page. This will prompt you to log into your Facebook account to authorize the plugin.
73
- * 2) Once you've connected your account, save the plugin settings.
74
- * 3) Then simply copy and paste the `[custom-facebook-feed]` shortcode onto any page, post, or widget where you want the feed to be displayed.
75
76
- That's it! You can then customize the feed as needed using the settings on the plugin "Customize" page.
77
78
- For full step-by-step setup directions with screenshots, see [here](https://smashballoon.com/custom-facebook-feed/docs/free/ "Custom Facebook Feed Free Setup Doc").
79
80
### Requesting support
81
82
- Customer support is a huge deal to us. We pride ourselves on always providing quick, effective, and courteous support to all of our users. If you're having an issue then just let us know and we'll be there to help as soon as possible. You can either open a ticket on the support forum on [WordPress.org](https://wordpress.org/support/plugin/custom-facebook-feed/ "Custom Facebook Feed Free support forum"), or directly on [our website](https://smashballoon.com/custom-facebook-feed/support/ "Custom Facebook Feed website support form"). We also have a large collection of help documentation and FAQs [on our website](https://smashballoon.com/custom-facebook-feed/faq/ "Custom Facebook Feed support FAQs") for all common issues.
83
84
### Who's behind this plugin?
85
86
- We're Smash Balloon; a fun-loving WordPress plugin development company birthed into existence in early 2013. We specialize in creating plugins that are not only intuitive and simple to use, but also designed to integrate seamlessly into your website and allow you to display your social media content in powerful and unique ways. Over 1 million awesome people have decided to actively use our free plugins, which is an incredible honor that we don't take lightly. This compels us to try to provide the quickest and most effective customer support that we can, blowing users away with the best customer service they've ever experienced.
87
88
- To find out more about the team, see [here](https://smashballoon.com/about/ "Team Smash Balloon").
89
90
- Check out our other free plugins for both [Instagram](https://wordpress.org/plugins/instagram-feed "Instagram Feed free plugin") and [Twitter](https://wordpress.org/plugins/custom-twitter-feeds/ "Custom Twitter Feeds free plugin").
91
92
== Installation ==
93
@@ -105,9 +103,9 @@ For a full list of FAQs and help with troubleshooting please visit the **[FAQ &
105
106
If you have a Facebook **page** with a URL like this: `https://www.facebook.com/smashballoon` then the Page ID is just `smashballoon`. If your page URL is structured like this: `https://www.facebook.com/pages/smashballoon/123654123654123` then the Page ID is actually the number at the end, so in this case `123654123654123`.
107
108
- Due to [recent changes](https://smashballoon.com/facebook-api-changes-april-4-2018/) to the Facebook API it is unfortunately no longer possible to display a feed from a Facebook Group.
109
110
- Copy and paste the ID into the [Pro demo](https://smashballoon.com/custom-facebook-feed/demo/) to test it.
111
112
= Are there any limitations on which Facebook page or group feeds I can display? =
113
@@ -131,11 +129,11 @@ Once you've done so, the plugin will be able to retrieve and display all of your
131
132
= Can I show photos and videos in my Custom Facebook feed? =
133
134
- This free plugin only allows you to display text from your Facebook posts. To display photos and videos in your feed you would need to upgrade to the Pro version of the plugin. Try out a demo of the Pro version on the [Custom Facebook Feed website](https://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo"), and find out more about the Pro version [here](https://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro"). [Click here](https://smashballoon.com/differences-between-the-free-version-and-pro-version-of-the-custom-facebook-feed-plugin/ "Differences between free and Pro version of Custom Facebook Feed plugin") for a full list of all differences between the free version and Pro version.
135
136
= Can I show the comments, shares and likes associated with each Facebook post? =
137
138
- This is a feature of the [Pro version of the plugin](https://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro"). To display comments, shares and likes you would need to upgrade from the free version to the Pro version.
139
140
= Is the content of my Custom Facebook Feed crawlable by search engines? =
141
@@ -147,7 +145,7 @@ You can embed your Facebook feed directly into a template file by using the Word
147
148
= My Facebook feed posts are not showing up, or all I can see is the Facebook Like box but no posts =
149
150
- Please refer to [this FAQ](https://smashballoon.com/facebook-feed-doesnt-show-can-see-like-box-posts-gives/ "My Facebook feed posts are not showing up, or all I can see is the Facebook Like box but no posts") for potential solutions on how to resolve this issue.
151
152
= Create a basic slideshow from your Facebook posts =
153
@@ -183,11 +181,11 @@ setInterval(function(){
183
184
= Changing the font in your Facebook feed and using Google Fonts =
185
186
- Please refer to [this FAQ](https://smashballoon.com/changing-the-font-in-your-facebook-feed-using-google-fonts/ "Changing the font in your Facebook feed and using Google Fonts") for directions on how to use Google fonts in your Facebook posts.
187
188
= Can I display my Facebook posts horizontally or in multiple columns? =
189
190
- Please refer to [this FAQ](https://smashballoon.com/can-display-facebook-post-horizontally-multiple-columns/ "Can I display my Facebook posts horizontally or in multiple columns?") for directions on how to display your Facebook posts in multiple columns.
191
192
= My Facebook feed appears to have stopped updating / working =
193
@@ -203,11 +201,11 @@ Please note, this isn't a limitation of our plugin, it's a restriction which Fac
203
204
= I'm receiving an error message when trying to display my Facebook posts =
205
206
- Please refer to our [Error Message Reference page](https://smashballoon.com/custom-facebook-feed/docs/errors/ "I'm receiving an error message when trying to display my Facebook posts") for information on how to resolve common error messages.
207
208
= Creating a Masonry grid layout from your Facebook posts =
209
210
- Please refer to [this FAQ](https://smashballoon.com/creating-a-masonry-grid-layout-from-your-facebook-posts/ "Creating a Masonry grid layout from your Facebook posts") for directions on how to create a Masonry grid layout from your Facebook feed posts.
211
212
= How do I customize my Facebook feed? =
213
@@ -229,7 +227,7 @@ If your shortcode includes single quotes then check that they are the standard s
229
230
3) Typo in the shortcode option
231
232
- Ensure that there aren't any spelling errors in the shortcode options that you're using and that the format is consistent with that demonstrated on the [Shortcode Options reference page](https://smashballoon.com/custom-facebook-feed/docs/shortcodes/ "The shortcode options aren't working").
233
234
= Facebook avatar pictures aren't showing up in my Facebook feed =
235
@@ -244,25 +242,28 @@ The most common reason for this is that an add-on or extension you have installe
244
245
== Screenshots ==
246
247
- 1. By default the Facebook feed inherits your theme's default styles and is completely responsive
248
2. Completely customize the way your Facebook feed looks to perfectly match your site
249
3. Use custom CSS to customize every part of the Facebook feed
250
- 4. Display Facebook events
251
5. Configuring the Custom Facebook Feed plugin
252
- 6. General options - Custom Facebook Feed Layout & Style page
253
- 7. Typography options - Custom Facebook Feed Layout & Style page
254
- 8. Misc options - Custom Facebook FeedLayout & Style page
255
9. It's super easy to display your Facebook feed in any page or post
256
257
== Changelog ==
258
= 2.14 =
259
- * New: Email alerts for critical issues. If there's an issue with a Facebook feed on your website which hasn't been resolved yet then you'll receive an email notification to let you know. This is sent once per week until the issue is resolved. These emails can be disabled by using the following setting: Facebook Feed > Customize > Misc > Feed Issue Email Report.
260
- * New: Admin notifications for critical issues. If there is an error with the feed, admins will see notices in the dashboard and on the front-end of the site along with instructions on how to resolve the issue. Front-end admin notifications can be disabled by using the following setting: Facebook Feed > Customize > Misc > Disable Admin Error Notice.
261
* New: Added a WordPress 'Site Health' integration. If there is a critical error with your feeds, it will now be flagged in the site health page.
262
* New: Added "About Us" page for those who would like to learn more about Smash Balloon and our other products. Go to Facebook Feed -> About Us in the dashboard.
263
264
= 2.13 =
265
- * New: Added a Custom Facebook Feed Gutenberg block to use in the block editor, allowing you to easily add a feed to posts and pages.
266
* New: Added support for translations.
267
268
= 2.12.4 =
@@ -271,78 +272,78 @@ The most common reason for this is that an add-on or extension you have installe
271
* Fix: Minor bug fixes
272
273
= 2.12.3 =
274
- * Tweak: Added a text link in the settings page footer to our new free [YouTube plugin](https://wordpress.org/plugins/feeds-for-youtube/)
275
- * Tweak: When reconnecting an account on the settings page, if there's an issue with the existing access token then it'll be automatically replaced.
276
* Tweak: Added 'rel="noopener"' to all external links and added 'rel="noreferrer"' to all non-Facebook links. Thanks to Dev VIP for the suggestion.
277
- * Fix: Fixed an issue with some call-to-action link URLs when a link protocol wasn't included
278
* Fix: Fixed a JavaScript conflict with the [Forminator](https://wordpress.org/plugins/forminator/) plugin
279
- * Fix: Fixed duplicate post message displaying due to ellipsis HTML character
280
- * Fix: If a shared link post had no post text then the link title was used causing it to be displayed twice in the post
281
282
= 2.12.2 =
283
* Fix: Fixed a JavaScript error in the admin caused by the previous update. Apologies for any inconvenience.
284
285
= 2.12.1 =
286
- * Fix: Fixed an issue with post date timezones due to changes in the WordPress 5.3 update
287
- * Fix: Fixed a rare issue where a JavaScript error would occur in the WordPress admin if a Facebook account was manually connected and the Page ID used was the full URL
288
* Fix: Fixed a JavaScript error in the admin when using older web browsers
289
* Tweak: Improved the manual account connection process
290
* Tweak: Some minor UI tweaks to match the new WordPress 5.3 UI style
291
292
= 2.12 =
293
- * New: Added a backup cache so the feed will still display even if there's an error from the Facebook API.
294
- * New: You can now easily manage multiple page or group accounts on the plugin settings page allowing you to easily add them to other feeds on your site. When you connect a page or group you will now see it listed in the "Connected Accounts" section. You can add it to the primary feed or to another feed by using the new `account` shortcode option.
295
- * Tweak: Added a filter which can be used to filter the API data when returned; `cff_filter_api_data`.
296
- * Tweak: Updated API error messages
297
- * Fix: Fixed an issue with some @tag links in post text due to a Facebook API change
298
- * Fix: Fixed a rare issue with ellipsis chracter symbols in shared link descriptions causing the entire link description not to be displayed
299
300
= 2.11.1 =
301
- * Tweak: Added the link source URL below the title for shared link posts
302
- * Fix: Some themes would prevent the "Share" link from working successfully
303
- * Fix: Fixed an issue with the "Feed Columns" setting not working if the minified versions of the plugin CSS/JavaScript files were being used
304
305
= 2.11 =
306
- * New: Added a "Feed Columns" setting to allow you to display your feed in multiple columns. This can be found under the "General" tab on the "Customize" page, or by using the `cols` and `colsmobile` shortcode settings.
307
* New: Updated to use v4.0 of the Facebook API
308
309
= 2.10 =
310
- * New: Facebook Groups are making their long-awaited return to the plugin! Just click the 'Log in and get my Access Token' button on the plugin's Settings page and select 'Facebook Group'. Follow the prompts to connect your Group and display your feed.
311
- * Fix: Fixed an issue where a lists of groups or pages wouldn't be displayed when retrieving an Access Token due to a server configuration issue
312
- * Fix: Photo icons weren't showing for album posts
313
- * Tweak: Now uses the `visitor_posts` endpoint to display visitor post feeds
314
315
= 2.9.1 =
316
* New: Added support for v3.3 of the Facebook API.
317
- * Fix: The Access Token selection area was being cut off on small screens when a lot of Facebook pages were listed.
318
319
= 2.9 =
320
- * New: You can now select between a "Regular" or "Boxed" post style. Settings for this can be found at: `Facebook Feed > Customize > Style Posts > Post Item`. A Box Shadow setting has been added to the "Boxed" post style.
321
* New: Added some settings to control the size and color of the Facebook shared link URLs and descriptions. These can be found at: `Facebook Feed > Customize > Style Posts > Shared Link Boxes`.
322
* New: Improved the Facebook Access Token retrieval process to make it more intuitive.
323
- * Tweak: Avatar images are now circular to match Facebook.
324
- * Tweak: Animated the social media icons when the "Share" button is clicked.
325
* Tweak: Changed the way the Facebook Like Box loads to avoid a conflict with the Facebook Messenger widget. It no longer uses the Facebook JavaScript SDK.
326
* Tweak: Changed the elements used for icons from `<i>` to `<span>` to aid accessibility.
327
* Tweak: Removed the Google+ share option as the platform has been deprecated.
328
- * Tweak: Removed the share widgets from the footer of the admin so that they're only loaded when the "Share the plugin" button is clicked.
329
- * Fix: The plugin now uses the built-in WordPress HTTP API to get data from Facebook instead of making it's own cURL requests to the Facebook API.
330
- * Fix: Fixed an issue where the avatars of people posting to the Facebook page weren't being displayed. Individual Facebook API requests for avatars have now been removed and bundled into the main Facebook API request.
331
- * Fix: If the link to the Facebook profile of a visitor posting to your page is not available then remove the link from the avatar and author name.
332
- * Fix: Fixed an accessibility error caused by the share icons being empty links.
333
* Fix: Removed the use of the ENT_HTML5 constant as it isn't supported in PHP 5.4.
334
- * Fix: Fixed a rare issue with tags in Facebook post stories when the locale was set to be Greek.
335
336
= 2.8 =
337
- * New: Added support for Facebook Notes in timeline feeds. If your Facebook timeline feed contains a note then the plugin will now get the content from the note and display it within the Facebook post.
338
- * New: Facebook call-to-action buttons - such as "Learn More", "Shop Now", and "Message Page" - are now supported in your Facebook posts. These text strings can be translated using the settings at: Facebook Feed > Customize > Custom Text/Translate
339
* New: Added a setting that you can enable if you are displaying Facebook posts from a restricted (non-public) Facebook page. This will allow the Facebook page avatar to be displayed, and is located at: Facebook Feed > Customize > Misc > Misc Settings > Is Facebook Page restricted?
340
- * New: If a visitor posts to your Facebook page then their avatar will now be displayed and cached for 6 months. To clear the cache of these avatar images use the button located at: Facebook Feed > Customize > Misc > Misc Settings > Clear Avatar Cache
341
- * Tweak: The Timezone setting can now be set in the shortcode. Eg: `timezone="America/Los_Angeles"`
342
- * Tweak: Minor UI changes to the admin pages
343
* Tweak: Reduced some of the Facebook data in the System Info
344
* Fix: If you backdate a Facebook post it will now be ordered correctly in your Facebook feed
345
- * Fix: Fixed a theme conflict related to the Color Picker in the admins section
346
* Verified compatibility with WordPress 5.0 and Gutenburg
347
348
= 2.7.2 =
@@ -353,507 +354,54 @@ The most common reason for this is that an add-on or extension you have installe
353
* Tweak: Made some adjustments to the Facebook Access Token login process
354
355
= 2.7 =
356
- * New: Now easily get your own Facebook Access Token to avoid any Facebook connection issues. Simply click the blue Facebook "Log in and get my Access Token" button on the Custom Facebook Feed settings page and connect your Facebook account to get your token. The Facebook Access Token will work to get Facebook posts from ANY Facebook page. Thanks to our friends at SlickRemix for powering our new login and getting the plugin back up and running again!
357
* Tweak: Removed the minimum caching time if you're using your own Facebook Page Access Token
358
359
= 2.6.4 =
360
- * **Important:** If you are displaying Facebook posts from a Facebook page that **you are an admin of** then it is now highly recommended that you retrieve your own Facebook Access Token for that Facebook page to avoid any Facebook API rate limit errors. Simply follow these [step-by-step](https://smashballoon.com/custom-facebook-feed/page-token/) instructions to obtain one.
361
362
= 2.6.3 =
363
* Fix: Fixed an issue where Facebook API errors were being cached
364
365
= 2.6.2 =
366
- * Fix: Replaced all HTTP links with HTTPS
367
* Fix: Fixed a rare issue which affected the layout of other Facebook widgets
368
* Fix: Automatically remove slashes at the end of the Facebook Page ID as it caused an error
369
- * Fix: The API response test in the System Info now only tests with your Facebook token if you have the "Use my own Access Token" setting enabled
370
* Fix: Fixed an issue which caused an occasional Facebook API rate limit error
371
372
= 2.6.1 =
373
* Fix: Removed an unnecessary Facebook API call
374
* Fix: Removed a PHP notice which was displayed under rare circumstances
375
- * Fix: Minor bug fixes
376
377
= 2.6 =
378
* Fix: Fixed an issue connecting to the Facebook API caused by a recent Facebook platform change
379
* Tweak: Increased the minimum caching time to be 15 minutes to reduce Facebook API requests
380
381
= 2.5.2 =
382
- * Important: Due to sudden changes in the Facebook API it is no longer possible to display posts from a Facebook Group. Please [see here](https://smashballoon.com/facebook-api-changes-april-4-2018/) for more information. We apologize for any frustration or inconvenience this has caused.
383
- * Removed: Due to Facebook API restrictions, it is no longer possible to display information about an event when it is posted or shared to your Facebook Page timeline.
384
385
= 2.5.1 =
386
- * Fix: Prevented a PHP notice which would be displayed under rare circumstances
387
* Fix: Replaced a function due to a deprecation in PHP 7.2
388
389
= 2.5 =
390
- * New: Added the post story as part of the page/author name at the top of the post
391
* New: Added an option to use minified versions of the plugin CSS and JavaScript files: `Facebook Feed > Customize > Misc > Misc Settings > Minify CSS and JavaScript files`
392
* New: Added support for clearing the cache of major caching plugins when the Facebook feed cache is cleared. You can enable this by setting the following setting to be "Yes": `Facebook Feed > Customize > Misc > Misc Settings > Force cache to clear on interval`
393
- * Tweak: Improved the text truncation so that it applies to both the post text and description as one block of text and accounts for HTML link tags
394
- * Tweak: Added an "Auto" option to the Post Limit setting where it will automatically adjust the post limit based on the number of posts you choose to display
395
- * Tweak: Reorganized the settings pages to be more intuitive
396
* Tweak: Added aria-hidden=true to icons to help improve accessibility
397
- * Tweak: The icon font stylesheet handle has been renamed so it will only be loaded once if another of our plugins is installed
398
- * Tweak: Error messages are now only shown to admins
399
- * Tweak: Added a setting to workaround a theme issue that affects the shortening of the post text. If you're experiencing an issue with the shortening of post text then you can enable the following setting: `Facebook Feed > Customize > Misc > Misc Settings > Fix text shortening issue`
400
- * Fix: Included a fallback in case the author name and avatar aren't available in visitor posts
401
- * Fix: Fixed an issue with apostrophes in the header not being escaped correctly
402
- * Fix: Fixed an issue with the icon font when Font Awesome 5 was added to a site
403
- * Fix: Added support for the @[ID:page-name] tagging format
404
- * Fix: The post description is now able to be displayed even if the post text is hidden
405
-
406
- = 2.4.6 =
407
- * Compatible with WordPress 4.8
408
-
409
- = 2.4.5 =
410
- * Tweak: Updated plugin links for new WordPress.org repo
411
- * Fix: Minor bug fixes
412
-
413
- = 2.4.4 =
414
- * New: If your Facebook posts have been created in more than one language on Facebook then it's now possible to display each language by using the `locale` setting in the shortcode. Eg: English: `[custom-facebook-feed locale=en_EN]`, German: `[custom-facebook-feed locale=de_DE]`
415
- * Fix: Fixed an issue with the order of group posts in some feeds
416
-
417
- = 2.4.3 =
418
- * Fix: Fixed a potential security vulnerability
419
- * Tested with upcoming WordPress 4.6 update
420
-
421
- = 2.4.2 =
422
- * Tweak: Group wall feed posts are now ordered based on recent activity, rather than by the date they were created, to better reflect the order on the Facebook Group wall.
423
- * Tweak: The "5 hours ago" date text strings can now be translated directly in the shortcode if you're displaying different feeds in different languages. See the bottom of the [Shortcode Options table](https://smashballoon.com/custom-facebook-feed/docs/shortcodes/) for more information.
424
- * Tweak: Created some specific [setup directions](https://smashballoon.com/custom-facebook-feed/docs/free/) for the free version.
425
- * Fix: Minor bug fixes
426
-
427
- = 2.4.1.2 =
428
- * Updated to be compatible with Facebook API version 2.6
429
-
430
- = 2.4.1.1 =
431
- * Fix: Fixed a JavaScript error in the admin area when using WordPress 4.5
432
-
433
- = 2.4.1 =
434
- * New: If a post contains either a photo or video then an icon and link are now added to view it on Facebook. You can disable this by unchecking the "Media Link" option in the following location: Customize > Post Layout > Show/Hide. You can also remove it by using the "exclude" shortcode option: exclude="medialink". You can translate or change the text for this link on the "Custom Text / Translate" settings page.
435
- * Tweak: Tested with WordPress 4.5
436
- * Fix: Fixed an issue where the "Share" button in the plugin Like Box wasn't working correctly
437
- * Fix: Added support for wp-config proxy settings. Credit to [@usrlocaldick](https://wordpress.org/support/topic/proxy-support-1) for the patch.
438
-
439
- = 2.4 =
440
- * New: Added a setting to allow you to use a fixed pixel width for the Facebook feed on desktop but switch to a 100% width responsive layout on mobile
441
- * New: You can now click on the name of a setting on the admin pages to reveal the corresponding shortcode for that setting
442
- * New: Added quick links to the top of the Customize settings pages to make it easier to find certain settings
443
- * New: Added a setting to allow you to disable the default plugin text and link styles (Customize > Misc > Disable default styles)
444
- * New: Added a setting which allows you to manually change the request method used to fetch Facebook posts which is necessary for some server setups
445
- * Tweak: Updated the Font Awesome icon font to version 4.5
446
- * Tweak: Moved the 'Show Header' setting to the 'General' tab on the Customize page
447
- * Fix: Hashtag linking now works with all languages and character sets
448
- * Fix: Fixed an error that occurred when trying to activate the Pro version with the free version still activated
449
- * Fix: Fixed a rare error which occurred when the Facebook post contained no text and no story
450
- * Fix: Fixed an issue when trying to display Facebook posts by only visitors to your Facebook page caused by a recent Facebook API update
451
-
452
- = 2.3.10 =
453
- * Fix: If you're experiencing an issue with your Facebook feed not automatically updating successfully then please update the plugin and enable the following setting: Custom Facebook Feed > Customize > Misc > Misc Settings > Force cache to clear on interval. If you set this setting to 'Yes' then it should force your plugin cache to clear either every hour, 12 hours, or 24 hours, depending on how often you have the plugin set to check Facebook for new posts.
454
-
455
- = 2.3.9 =
456
- * Fix: Fixed an issue caused by the recent Facebook API 2.5 update where the posts wouldn't display when using a brand new Access Token
457
-
458
- = 2.3.8 =
459
- * Fix: Fixed a positioning issue with the Facebook "Like Box / Page Plugin" widget caused by a recent Facebook update which was causing it to overlap on top of other content
460
- * Fix: Hashtags containing Chinese characters are now linked
461
- * Fix: Fixed a minor issue in shared link posts where the post text linked to the shared link URL instead of the post on Facebook
462
- * Tweak: Added a timezone for Sydney, Australia
463
-
464
- = 2.3.7 =
465
- * Fix: Fixed an issue caused by the WordPress 4.3 update where feeds from very long page IDs wouldn't update correctly due to the cache not clearing when expired
466
- * Fix: Removed specific encoding parameters from the cURL request method to prevent encoding issues on some servers
467
-
468
- = 2.3.6 =
469
- * New: Added a couple of new customization options for the Facebook Like Box/Page Plugin which allow you to select a small/slim header for the Like Box and hide the call-to-action button (if available)
470
- * Fix: The plugin now works with Access Tokens which use the new recently-released version 2.4 of the Facebook API
471
-
472
- = 2.3.5 =
473
- * New: Replace the Facebook 'Like Box' with the new Facebook 'Page Plugin' as the Facebook Like Box will be deprecated on June 23rd, 2015. Settings can be found under the Misc tab on the plugin's Customize page.
474
- * Fix: Hashtags which contain foreign characters are now correctly linked to the hashtag on Facebook
475
- * Fix: Links within Facebook post descriptions weren't opening in a new tab
476
- * Fix: Removed empty style tags from some elements
477
- * Fix: The URLs used for the 'Share' icons are now encoded to prevent any HTML validation errors
478
- * Fix: Shared Facebook posts now link to the new shared post and not to the original post that was shared on Facebook
479
- * Fix: Corrected a minor issue with the plugin caching string
480
- * Fix: Fixed a minor issue with tags in the Facebook post text when creating/sharing an event
481
- * Tweak: Add some stricter CSS to some parts of the feed to prevent theme conflicts
482
- * Tweak: Automatically link the Facebook event name to the event now rather than it having to be enabled on the plugin's 'Typography' settings page
483
-
484
- = 2.3.4 =
485
- * Fix: The Facebook event description is no longer shown twice in event posts. It was previously shown in the post text itself and in the Facebook event details.
486
- * Fix: Fixed a rare bug which would occur if your Facebook page or Facebook group name contained a number
487
-
488
- = 2.3.3 =
489
- * Fix: Removed a PHP notice which was missed in the last update. Apologies for the two updates in quick succession.
490
-
491
- = 2.3.2 =
492
- * Fix: Fixed some stray PHP notices which were inadvertently introduced in a recent update
493
- * Tweak: Added an option to not load the icon font included in the plugin
494
-
495
- = 2.3.1 =
496
- * New: Added a shortcode option to allow you to offset the number of posts to be shown. Eg: offset=2
497
- * New: Added an email link to the sharing icons
498
- * New: Added a setting to load a local copy of the icon font instead of the CDN version. This can be found at the bottom of the 'Misc' settings page.
499
- * Tweak: Added a prefix to the IDs on all Facebook posts so that they can now be targeted via CSS
500
- * Tweak: Added "nofollow" to all links by default. This can be disabled by using `nofollow=false` in the shortcode.
501
- * Tweak: Added some missing settings to the System Info section
502
- * Tweak: Added the 'Timezone' setting to the main Settings page so that it's easier to find
503
- * Fix: Added a workaround for Facebook changing the event URLs in their API from absolute to relative URLs
504
- * Fix: Facebook removed the 'relevant_count' parameter from their API so added a workaround to get the number of photos attached to a Facebook post
505
- * Fix: Fixed a minor bug in the WP_Http fallback method
506
- * Fix: Removed duplicate IDs on the share icons and replaced with classes
507
- * Fix: Added a check to the file_get_contents data retrieval method to check whether the Open SSL wrapper is enabled
508
- * Fix: The `eventtitlelink` shortcode option now works correctly
509
- * Fix: Added a workaround for 'story_tags' which Facebook deprecated from their API
510
- * Fix: Removed query string from the end of CSS and JavaScript file references and replaced it with the wp_enqueue_script 'ver' parameter instead
511
-
512
- = 2.3 =
513
- * Happy New Year!
514
- * New: Added a share link which allows you to share posts to Facebook, Twitter, Google+ or LinkedIn. This can be disabled at the very bottom of the Typography tab, or by using `showsharelink=false` in the [custom-facebook-feed] shortcode.
515
- * Tweak: Using your own Facebook Access Token in the plugin is still optional but is now recommended in order to protect yourself against future Access Token related issues
516
- * Tweak: Increased the accuracy of the character count when links are included in the Facebook text
517
- * Tweak: Improved the efficiency of the Facebook post caching
518
- * Tweak: Replaced the rel attribute with the HTML5 data attribute when storing data on an element
519
- * Tweak: Added HTTPS stream wrapper check to the System Info to aid in troubleshooting
520
- * Tweak: Updated the plugin's icon font to the latest version
521
- * Tweak: Added the Smash Balloon logo to the credit link which can be optionally displayed at the bottom of your feed. The setting for this is at the bottom of the Misc tab on the Customize page.
522
- * Tweak: Added a shortcode option to only show the Smash Balloon credit link on certain feeds: `[custom-facebook-feed credit=true]`
523
- * Fix: Fixed an issue with quotes being escaped in custom/translated text
524
- * Fix: Display an error message if WPHTTP function isn't working correctly
525
- * Fix: The `postbgcolor` shortcode option is now working correctly
526
-
527
- = 2.2.1 =
528
- * Fix: Fixed a minor JavaScript error which occurs if a Facebook post doesn't contain any text
529
-
530
- = 2.2 =
531
- * New: Added a text area to the Support tab which contains all of the plugin settings and site info for easier troubleshooting
532
- * New: You can now set the number of Facebook posts to '0' if you just want to show the Facebook Like box widget and no posts
533
- * Tweak: If the user doesn't add a unit to the width, height or padding then automatically add 'px'
534
- * Tweak: Added social media sharing links to the bottom of the settings page and an option to add a credit link to the bottom of the feed
535
- * Fix: Fixed an issue with Facebook hashtags not being linked when followed immediately by punctuation
536
- * Fix: When displaying a shared link if the caption is the same as the link URL then don't display it
537
- * Fix: Added a space before the feed header's style attribute to remove HTML validation error
538
- * Fix: Prefixed the 'top' and 'bottom' classes used on the Facebook Like box to prevent CSS conflicts
539
- * Fix: Fixed an issue with the link color not being applied to Facebook hashtag links
540
-
541
- = 2.1.3 =
542
- * Fix: Fixed an issue with the Facebook Access Token used in the plugin hitting its request limit
543
-
544
- = 2.1.2 =
545
- * Fix: Added in a missing closing div tag to the Facebook feed when an error is being displayed
546
-
547
- = 2.1.1 =
548
- * Fix: Fixed an issue with the date not being hidden when unchecked in the Show/Hide section
549
- * Fix: Fixed an issue with the date not being displayed below event posts when the date position was set to 'At the bottom of the post'
550
-
551
- = 2.1 =
552
- * New: Added an option to preserve/save your plugin options after uninstalling the plugin. This makes manually updating the plugin much easier.
553
- * New: Added a 'Settings' link to the plugin on the Plugins page
554
- * New: Added a field to the Misc settings page which allows users to enter their Facebook App ID in order to remove a couple of browser console warnings caused by the Facebook Like box widget
555
- * Tweak: Reduced the size of the author's Facebook profile picture from 50px to 40px to match Facebook
556
- * Tweak: The link description text is now 12px in size by default
557
- * Tweak: Added some default character limits to the post text and descriptions
558
- * Tweak: If the post author is being hidden then change the default date position to be the bottom of the post
559
- * Fix: The post author link is no longer the full width of the post and is only wrapped around the author image and name which helps prevent inadvertently clicking on the post author
560
- * Fix: Added a fb-root element to the Like box to prevent a browser console warning
561
- * Fix: Renamed the ShowError function to prevent conflicts
562
- * Fix: Fixed an issue with the 'seconds' custom text string not being saved correctly
563
- * Fix: When linking the post text to the Facebook post the correct text color is now applied
564
-
565
- = 2.0.1 =
566
- * Tweak: Improved error handling and added an [Error Message reference](https://smashballoon.com/custom-facebook-feed/docs/errors/) to the website
567
-
568
- = 2.0 =
569
- * New: Added an option to display the post date immediately below the author name - as it is on Facebook. This is now the default date position.
570
- * New: Added options to add a background color and rounded corners to your posts
571
- * New: If your Facebook event has an end date then it will now be displayed after the start date
572
- * New: Hashtags in the post descriptions are now also linked
573
- * New: Tested and approved for the upcoming WordPress 4.0 release
574
- * Tweak: Moved the 'View on Facebook' link to the left side
575
- * Tweak: Added error handling to improve user experience
576
- * Tweak: If the Facebook API can't be reached by the plugin for some reason then it no longer caches the empty response and instead keeps trying to retrieve the posts from Facebook until it is successful
577
- * Fix: Removed some redundant inline CSS used on the posts
578
- * Fix: If there is a token in the 'Access Token' field but the 'Enter my own Access Token' box is unchecked then the plugin will no longer use it
579
- * Fix: Added the trim() function to the 'Test connection to Facebook API' function to improve reliability
580
- * Fix: Fixed an occasional JavaScript error which occurred when the post text was hidden
581
-
582
- = 1.9.9.3 =
583
- * New: Hashtags in link, photo and video descriptions are now also linked
584
- * Fix: Fixed an issue with hashtags being linked when the post text is also linked, which interfered with the text formatting
585
-
586
- = 1.9.9.2 =
587
- * Fix: Removed a couple of stray PHP notices
588
-
589
- = 1.9.9.1 =
590
- * Fix: Fixed an occasional issue with hashtags in inline CSS inadvertently being linked
591
-
592
- = 1.9.9 =
593
- * New: Hashtags in your posts are now linked to the hashtag search on Facebook. This can be disabled in the 'Post Text' section on the Typography settings page.
594
- * New: Added a Facebook icon to the Custom Facebook Feed admin menu
595
- * Fix: Corrected the left side margin on the "Like" box so that it aligns correctly with posts
596
-
597
- = 1.9.8.1 =
598
- * Fix: Fixed an admin JavaScript error introduced by the last update
599
-
600
- = 1.9.8 =
601
- * Tweak: The Access Token field is now hidden by default and is revealed by a checkbox
602
- * Fix: Fixed an issue with link colors not being applied to all links
603
- * Fix: Removed the link box container from posts which contain non-youtube/vimeo links
604
- * Fix: Links which don't contain a 'http://' protocol are now linked correctly
605
-
606
- = 1.9.7 =
607
- * Fix: Fixed an issue with a generic function name which was occasionally causing an error
608
-
609
- = 1.9.6 =
610
- * Tweak: Added an HTML wrapper element around the feed
611
-
612
- = 1.9.5 =
613
- * New: Added an option to set a height on the Like box. This allows you to display more faces of your fans if you have that option selected.
614
- * Tweak: Added a few stricter CSS styles to help minimize the chance of theme stylesheets distorting post formatting
615
- * Tweak: Added a span to the header text to allow CSS to be applied
616
- * Fix: Fixed a bug with the post author text bumping down below the author image in the Firefox browser
617
- * Fix: Corrected a bug which caused some links not to have the color applied
618
- * Fix: Fixed a float issue in Firefox which sometimes caused the feed to be pushed off the page
619
-
620
- = 1.9.4 =
621
- * New: Added background and border styling options to shared links
622
- * Tweak: Reduced the clickable area of the post author
623
- * Tweak: Added a 'Customize' tab to the Settings page
624
- * Fix: Fixed an issue with post tag linking not working correctly in some languages
625
- * Fix: Fixed an issue with line breaks not being respected in IE8
626
-
627
- = 1.9.2 =
628
- * Fix: Added title and alt attributes to the post author's Facebook profile picture
629
- * Fix: Improved the reliability of the post tag linking
630
- * Fix: Fixed an issue with HTML characters not rendering correctly when linking the post text
631
- * Fix: Improved the reliability of the CSS clearing method used on the feed container
632
- * Compatible with WordPress 3.9
633
-
634
- = 1.9.1 =
635
- * Fix: Fixed an issue with the 'textlink' shortcode option
636
- * Fix: Fixed an bug with post text sometimes being duplicated when linked
637
- * Fix: Removed error_reporting(0);
638
-
639
- = 1.9.0 =
640
- * New: Added the ability to change the text size and color of the post author
641
- * New: Define the format, size and color of shared link titles
642
- * New: You can now define the color of the links in your post text, descriptions and Facebook events
643
- * Tweak: Moved the Feed Header options to the Typography page
644
- * Tweak: Moved the Ajax setting to the Misc page
645
- * Tweak: Now removes any query strings attached to the Facebook Page ID
646
- * Fix: Fixed an issue with some themes causing the clear element to prevent links being clickable
647
- * Fix: Some minor bug fixes
648
-
649
- = 1.8.2.3 =
650
- * New: Now supports Facebook tags - creates links when using the @ symbol to tag other people or Facebook pages in your posts
651
- * Tweak: Changed the method used for link replacement in posts
652
- * Fix: Fixed issue with php include
653
-
654
- = 1.8.1 =
655
- * New: Added an 'exclude' shortcode option to allow you to easily exclude specific parts of the post
656
- * New: Timeline events are now cached to help reduce page load time
657
- * New: Added an option for when the WordPress theme is loading the feed via AJAX so that the JavaScript runs after the feed has been loaded into the page
658
- * Tweak: Changed author images back to loading via PHP rather than JavaScript due to issues with certain WordPress themes
659
- * Fix: Reset the timezone after the shortcode has run
660
- * Fix: Fixed an issue with the shared link descriptions not being hidden when specified
661
- * Fix: Fixed a rare issue with the 'textlink' shortcode option
662
- * Fix: Use a fallback JSON string if unable to find the cached version in the database
663
-
664
- = 1.8.0 =
665
- * New: Added a built-in color picker
666
- * New: Added class to posts based on the author to allow for independent styling
667
- * Tweak: Now loads the author's Facebook profile picture in using JavaScript to help speed up load times
668
- * Tweak: Now automatically set the Facebook post limit based on the number of Facebook posts to be displayed
669
- * Tweak: Core improvements to the way Facebook posts are output
670
- * Tweak: Changed 'Layout & Style' page name to 'Customize'
671
- * Tweak: Moved the Support information to a tab on the Settings page
672
- * Tweak: Improved the 'Test connection to Facebook API' function
673
- * Fix: Encode Facebook URLs so that they pass HTML validation
674
- * Fix: Fixed an issue with Facebook post captions not displaying under some circumstances
675
- * Fix: More robust method for stripping the URL when a user enters Facebook page URL instead of their Facebook Page ID
676
-
677
- = 1.7.2 =
678
- * Tweak: Moved the 'Show post author' option from the General settings tab to the Post Layout tab
679
- * Tweak: Added the ability to show or hide the author to the 'include' shortcode option
680
- * Fix: Added CSS box-sizing property to feed header so that padding doesn't increase its width
681
- * Fix: Fixed showheader=false and headeroutside=false shortcode options
682
- * Fix: Now allows users to enter their Facebook page URL as their Facebook Page ID
683
-
684
- = 1.7.0 =
685
- * New: Added ability to add a customizable header to your feed
686
- * New: Added a Custom JavaScript section to allow you to add your own JS or jQuery functionality to the feed
687
- * New: Added a 'Custom Text / Translate' tab to house all customizable text
688
- * New: You can now choose to show posts only by other people on your Facebook page
689
- * New: Set your timezone so that dates/times are displayed in your local time
690
- * New: When a Facebook post contains a link to multiple images it now states the number of photos after the post text and links to the Facebook album
691
- * Tweak: Plugin now detects whether the page is using SSL and pulls https resources
692
- * Tweak: Added a button to test the connection to Facebook's API for easier troubleshooting
693
- * Fix: Now using HTML encoding to parse any raw HTML tags in the Facebook post text or descriptions
694
- * Fix: Added a protocol to the beginning of links which don't include one
695
- * Fix: Fixed date width issue in IE7
696
- * Fix: Removed stray PHP notices
697
- * Fix: Added a space between the Like Box attributes
698
-
699
- = 1.6.8.2 =
700
- * Fix: Fixed a CSS bug in Firefox which was causing the page author name to bump down below the avatar
701
-
702
- = 1.6.8.1 =
703
- * Tweak: Moved 'View on Facebook' link up to be level with the date rather than on the line below it
704
- * Fix: Don't show the caption when it is the same as the Facebook post text
705
- * Fix: Fixed issue with enqueueing JavaScript file
706
-
707
- = 1.6.8 =
708
- * New: Added option to remove border from the Facebook Like box when showing faces
709
- * New: Set Facebook "Like" box text color to either blue or white
710
- * Tweak: Moved descripion below video or link title and added link source
711
- * Tweak: Added ability to manually translate the '2 weeks ago' text
712
- * Tweak: Replaced 'View Link' with 'View on Facebook' so that shared links now link to the Facebook post
713
- * Tweak: Facebook "Like" box is now responsive
714
- * Tweak: Displays Facebook post caption if no description is available
715
- * Tweak: Vertically center multi-line author names rather than bumping them down below the Facebook profile picture
716
- * Tweak: Checks whether the Access Token is inputted in the correct format
717
- * Fix: Fixed bug in the 'Show posts on my page by others' option
718
- * Fix: If displaying a Facebook group then automatically hides the Facebook "Like" box
719
- * Fix: 'others=false' shortcode option now working correctly
720
- * Fix: Strip any white space characters from beginning or end of Access Token and Facebook Page ID
721
-
722
- = 1.6.7.1 =
723
- * Fix: Fixed a bug in 1.6.7 which was causing an issue displaying the Facebook feed in some circumstances
724
-
725
- = 1.6.7 =
726
- * New: Your Facebook feed can now be completely displayed in any language - added i18n support for date translation
727
- * Tweak: Improved documentation within the plugin
728
- * Tweak: Changed order of methods used to retrieve Facebook feed data
729
-
730
- = 1.6.6.3 =
731
- * New: Added support for Facebook group events
732
-
733
- = 1.6.6.1 =
734
- * Fix: Resolved jQuery UI draggable bug which was causing issues with drag and drop
735
-
736
- = 1.6.6 =
737
- * New: Now works with Facebook groups
738
- * Fix: Fixed an issue with the 'Show posts by others' option not working correctly in the previous version
739
-
740
- = 1.6.4 =
741
- * New: Added localization support. Full support for various languages coming soon
742
- * New: Added CSS classes to different Facebook post types to allow for different styling based on post type
743
- * New: Option to link statuses to either the status post itself or the directly to the Facebook page/timeline
744
- * New: Added option to add thumbnail faces of fans to the Facebook Like box and define a width
745
- * Tweak: Added separate classes to 'View on Facebook' and 'View Link' links so that they can be targeted with CSS
746
- * Tweak: Prefixed every CSS class to prevent styling conflicts with theme stylesheets. Please note that if you used custom CSS to style parts of the feed that the CSS classes are now prefixed with 'cff-' to prevent theme conflicts. Eg. '.more' is now '.cff-more'.
747
-
748
- = 1.6.3 =
749
- * New: Added support for Facebook 'Offers'
750
- * Fix: Fixed an issue with the 'others' shortcode option not working correctly
751
- * Fix: Prefixed the 'clear' class to prevent conflicts
752
-
753
- = 1.6.2 =
754
- * New: Post caching now temporarily stores your Facebook post data in your WordPress database to allow for super quick load times
755
- * New: Define your own caching time. Check for new Facebook posts every few seconds, minutes, hours or days. You decide.
756
- * New: Define your own custom text for the 'See More' and 'See Less' buttons
757
- * New: Add your own CSS class to your Custom Facebook Feeds
758
- * New: Define a Facebook post limit which is higher or lower than the default 25
759
- * New: Include the Facebook Like box inside or outside of the Facebook feed's container
760
- * New: Customize the Facebook event date independently
761
- * New: Improved layout of admin pages for easier navigation and customization
762
- * Fix: Provided a fix for the Facebook API duplicate post bug
763
- * Fix: Fixed bug which ocurred when multiple Facebook feeds are displayed on the same page with different text lengths defined
764
-
765
- = 1.5.2 =
766
- * Fix: Fixed JavaScript error in previous update
767
-
768
- = 1.5.1 =
769
- * New: Added a 'See More' link to expand any text which is longer than the character limit defined
770
- * New: Choose to show Facebook posts by other people in your feed
771
- * New: Option to show the post author's Facebook profile picture and name above each post
772
- * New: Added options to customize and format the Facebook post date
773
- * New: Add your own text before and after the date and in place of the 'View on Facebook' and 'View Link' text links
774
- * New: Specify the format of the Facebook Event date
775
- * Tweak: Default date format is less specific and better mimics Facebook's - credit Mark Bebbington
776
- * Tweak: Changed the layout of the Typography section to allow for the additional options
777
- * Fix: When a Facebook photo album is shared it now links to the album itself on Facebook and not just the cover photo
778
- * Fix: Fixed issue with hyperlinks in post text which don't have a space before them not being converted to links
779
-
780
- = 1.4.8 =
781
- * Minor fixes
782
-
783
- = 1.4.7 =
784
- * Tweak: Added links to statuses which link to the Facebook page
785
- * Tweak: Added classes to Facebook event date, location and description to allow custom styling
786
- * Tweak: Removed 'Where' and 'When' text from Facebook events and made bold instead
787
-
788
- = 1.4.6 =
789
- * Fix: Fixed 'num' option in shortcode
790
-
791
- = 1.4.4 =
792
- * New: Added more shortcode options
793
- * Minor tweaks
794
-
795
- = 1.4.2 =
796
- * New: Add your own custom CSS to allow for even deeper customization
797
- * New: Optionally link your post text to the Facebook post
798
- * New: Optionally link your event title to the Facebook event page
799
- * Some minor modifications
800
-
801
- = 1.4.1 =
802
- * Fix: Set all parts of the Facebook feed to display by default on activation
803
-
804
- = 1.4.0 =
805
- * Major Update!
806
- * New: Loads of new customization options for your Custom Facebook Feed
807
- * New: Define Facebook feed width, height, padding and background color
808
- * New: Change the font-size, font-weight and color of the Facebook post text, description, date, links and event details
809
- * New: Choose whether to show or hide certain parts of the Facebook posts
810
- * New: Select whether the Facebook Like box is shown at the top of bottom of the Facebook feed
811
- * New: Choose Facebook Like box background color
812
-
813
- = 1.3.6 =
814
- * Minor modifications
815
-
816
- = 1.3.5 =
817
- * New: Shared Facebook events now display event details (name, location, date/time, description) directly in the Facebook feed
818
-
819
- = 1.3.4 =
820
- * New: Email addresses within the Facebook post text are now hyperlinked
821
- * Fix: Links beginning with 'www' are now also hyperlinked
822
-
823
- = 1.3.3 =
824
- * New: Added support for Facebook events - display the Facebook event details (name, location, date/time, description) directly in the Facebook feed
825
- * Fix: Links within the Facebook post text are now hyperlinked
826
- * Tweak: Added additional methods for retrieving Facebook feed data
827
-
828
- = 1.3.2 =
829
- * Fix: Now using the built-in WordPress HTTP API to get retrieve the Facebook data
830
-
831
- = 1.3.1 =
832
- * Fix: Fixed issue with certain Facebook statuses not displaying correctly
833
-
834
- = 1.3.0 =
835
- * Tweak: If 'Number of Posts to show' is not set then default to 10 Facebook posts
836
-
837
- = 1.2.9 =
838
- * Fix: Now using cURL instead of file_get_contents to prevent issues with php.ini configuration on some web servers
839
-
840
- = 1.2.8 =
841
- * Fix: Fixed bug in specifying the number of Facebook posts to display
842
-
843
- = 1.2.7 =
844
- * Tweak: Prevented likes and comments by the page author showing up in the Facebook feed
845
-
846
- = 1.2.6 =
847
- * Tweak: Added help link to Custom Facebook Feed settings page
848
-
849
- = 1.2.5 =
850
- * Fix: Added clear fix
851
-
852
- = 1.2.1 =
853
- * Fix: Minor bug fixes
854
-
855
- = 1.2 =
856
- * New: Added the ability to define a maximum length for both the Facebook post text and description
857
-
858
- = 1.0 =
859
- * Launch!
1
=== Smash Balloon Social Post Feed ===
2
Contributors: smashballoon
3
+ Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook page, Custom Facebook Feed, Facebook group, Facebook social feed, Facebook post, Facebook like box
4
Requires at least: 3.0
5
Requires PHP: 5.2
6
Tested up to: 5.4
7
+ Stable tag: 2.14.1
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
12
13
== Description ==
14
15
+ Display Facebook posts on your website. **Completely customizable**, **responsive** and **search engine crawlable** Facebook feeds. Display **multiple Facebook feeds** from **any public Facebook page**, and completely match the look and feel of the site with tons of Facebook feed customization options!
16
17
*"The perfect Facebook plugin with amazing support! What else do you want? Get it!"* - [JoeJeffries](http://wordpress.org/support/topic/you-dont-already-have-this?facebook)
18
19
+ *"I honestly cannot recommend this Facebook plugin enough. The plugin itself is gorgeous and super customizable, and if you run into trouble...support will get you out of it. Five Stars across the board."* - [pamsavoybarnett](http://wordpress.org/support/topic/love-this-plugin-w-awesome-support?facebook)
20
21
+ **Please note:** This free Facebook plugin allows you to display text and links from Facebook posts. To display **photos, videos, comments,** and more, we offer a Pro version of the plugin. See the Pro Version section below for more information.
22
23
### Facebook Feed Features
24
25
* **Super simple to set up** - 1 minute quick setup with no Facebook Developer App required
26
+ * **Display feeds from ANY Facebook page** - even Facebook pages you aren't an admin of
27
+ * **Completely Customizable** - By default the Facebook feed will adopt the style of your website, but your Facebook feeds can be completely customized to look however you like - with tons of styling and customization options!
28
* Facebook feed content is **crawlable by search engines** adding SEO value to your site - other Facebook plugins embed the feed using iframes which are not crawlable
29
+ * Completely **responsive** and mobile optimized Facebook feeds - layout looks great on any screen size and in any container width
30
+ * Display **feeds from multiple different Facebook pages** and use the shortcode to embed your Facebook feeds into a page, post or widget anywhere on your site
31
* **Caching** means that your Facebook posts load lightning fast. Set your own caching time - check for new posts on Facebook every few seconds, minutes, hours or days. You decide.
32
* Show and hide certain parts of each Facebook post
33
+ * Show or hide the Facebook profile picture and name of the author above each Facebook post
34
* Display Facebook posts by just the page owner, everyone who posts on your Facebook page, or only other people
35
* Control the width, height, padding and background color of your Facebook feed
36
+ * Customize the size, weight and color of text in your Facebook posts
37
* Choose to set a background color and rounded corners on your Facebook posts
38
* Supports Facebook tags - creates links when using the @ symbol to tag people in your Facebook posts
39
* Automatically links hashtags used in posts to the hashtag page on Facebook
40
+ * Select the number of Facebook posts to display in your Facebook feed
41
* Use the shortcode options to style multiple Facebook feeds in completely different ways
42
* Set a maximum character length for both the text and descriptions of your Facebook posts
43
+ * Create a customizable Facebook header with a range of icons for your Custom Facebook Feed
44
+ * Localization/i18n support to allow every part of the Facebook feed to be displayed in your language
45
+ * Add your own **custom CSS**
46
47
### Pro Version (Custom Facebook Feed Pro)
48
49
+ In order to maintain the free version of the Custom Facebook Feed plugin on an ongoing basis, and to provide quick and effective support for free, we offer a Pro version of the plugin. Custom Facebook Feed Pro allows you to display photos, videos, the number of likes, shares, reactions and comments for each Facebook post, choose from multiple layout options, filter Facebook posts by type or #hashtag/string, load more Facebook posts into your feed, and more. [Click here](https://smashballoon.com/differences-between-the-free-version-and-pro-version-of-the-custom-facebook-feed-plugin/ "Differences between free and Pro version of Custom Facebook Feed plugin") for a full list of all differences between the Custom Facebook Feed free and Pro versions.
50
51
+ * [Find out more about Custom Facebook Feed Pro](https://smashballoon.com/custom-facebook-feed/?utm_campaign=facebook-free-readme&utm_source=proversion&utm_medium=findout "Custom Facebook Feed Pro")
52
+ * [Try out the Custom Facebook Feed Pro demo](https://smashballoon.com/custom-facebook-feed/demo/?utm_campaign=facebook-free-readme&utm_source=proversion&utm_medium=demo "Custom Facebook Feed Pro Demo").
53
54
### Benefits
55
56
* **Increase social engagement** between you and your users, customers, or fans
57
* **Save time** by using the Custom Facebook Feed to generate dynamic, search engine crawlable content on your website
58
* **Get more likes** by displaying your Facebook content directly on your site
59
+ * **Improve your SEO** as all of that quality keyword-rich Facebook content from posts and Facebook comments is directly embedded into your website
60
* Display your Facebook content your way to perfectly match your website's style
61
* **No Coding Required** - choose from tons of built-in customization options to create a truly unique feed of your Facebook content.
62
+ * The Custom Facebook Feed plugin is **updated regularly** with new features, bug-fixes and Facebook API changes
63
* Support is quick and effective
64
* We're dedicated to providing the **most customizable**, **robust** and **well supported** Facebook feed plugin in the world!
65
66
+ ### How to use the Custom Facebook Feed plugin
67
68
+ One of our main priorities has always been to make our Custom Facebook Feed plugin as easy as possible to setup and use. Once you've installed the plugin there are only a few steps to get up and running:
69
70
+ * 1) Click the big blue Facebook button on the plugin settings page. This will prompt you to log into your Facebook account to authorize the plugin.
71
+ * 2) Once you've connected your Facebook account, save the plugin settings.
72
+ * 3) Then simply copy and paste the `[custom-facebook-feed]` shortcode onto any page, post, or widget where you want the Facebook feed to be displayed.
73
74
+ That's it! You can then customize the Facebook feed as needed using the settings on the Facebook Feed > Customize page.
75
76
+ For full step-by-step setup directions with screenshots, see [here](https://smashballoon.com/custom-facebook-feed/docs/free/?utm_campaign=facebook-free-readme&utm_source=howto&utm_medium=setup "Custom Facebook Feed Free Setup Doc").
77
78
### Requesting support
79
80
+ Customer support is a huge deal to us. We pride ourselves on always providing quick, effective, and courteous support to all of our users. If you're having an issue using the Custom Facebook Feed plugin then just let us know and we'll be there to help as soon as possible. You can either open a ticket on the support forum on [WordPress.org](https://wordpress.org/support/plugin/custom-facebook-feed/ "Custom Facebook Feed Free support forum"), or directly on the Custom Facebook Feed section of [our website](https://smashballoon.com/custom-facebook-feed/support/ "Custom Facebook Feed website support form"). We also have a large collection of help documentation and FAQs [on our website](https://smashballoon.com/custom-facebook-feed/faq/ "Custom Facebook Feed support FAQs") for all common issues related to the Custom Facebook Feed plugin.
81
82
### Who's behind this plugin?
83
84
+ We're Smash Balloon; a fun-loving WordPress plugin development company birthed into existence in early 2013. We specialize in creating social media plugins that are not only intuitive and simple to use, but also designed to integrate seamlessly into your website and allow you to display your social media content in powerful and unique ways. Over 1 million awesome people have decided to actively use our free plugins, which is an incredible honor that we don't take lightly. This compels us to try to provide the quickest and most effective customer support that we can, blowing users away with the best customer service they've ever experienced.
85
86
+ To find out more about the team, see [here](https://smashballoon.com/about/?utm_campaign=facebook-free-readme&utm_source=who&utm_medium=about "Team Smash Balloon").
87
88
+ Check out our other free plugins for [Instagram](https://wordpress.org/plugins/instagram-feed "Instagram Feed free plugin"), [Twitter](https://wordpress.org/plugins/custom-twitter-feeds/ "Custom Twitter Feeds free plugin"), and [YouTube](https://wordpress.org/plugins/feeds-for-youtube/ "Feeds for YouTube free plugin").
89
90
== Installation ==
91
103
104
If you have a Facebook **page** with a URL like this: `https://www.facebook.com/smashballoon` then the Page ID is just `smashballoon`. If your page URL is structured like this: `https://www.facebook.com/pages/smashballoon/123654123654123` then the Page ID is actually the number at the end, so in this case `123654123654123`.
105
106
+ Due to [recent changes](https://smashballoon.com/facebook-api-changes-april-4-2018/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=id) to the Facebook API it is unfortunately no longer possible to display a feed from a Facebook Group.
107
108
+ Copy and paste the ID into the [Pro demo](https://smashballoon.com/custom-facebook-feed/demo/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=demoid) to test it.
109
110
= Are there any limitations on which Facebook page or group feeds I can display? =
111
129
130
= Can I show photos and videos in my Custom Facebook feed? =
131
132
+ This free plugin only allows you to display text from your Facebook posts. To display photos and videos in your feed you would need to upgrade to the Pro version of the plugin. Try out a demo of the Pro version on the [Custom Facebook Feed website](https://smashballoon.com/custom-facebook-feed/demo/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=media "Custom Facebook Feed Demo"), and find out more about the Pro version [here](https://smashballoon.com/custom-facebook-feed/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=pro "Custom Facebook Feed Pro"). [Click here](https://smashballoon.com/differences-between-the-free-version-and-pro-version-of-the-custom-facebook-feed-plugin/ "Differences between free and Pro version of Custom Facebook Feed plugin") for a full list of all differences between the free version and Pro version.
133
134
= Can I show the comments, shares and likes associated with each Facebook post? =
135
136
+ This is a feature of the [Pro version of the plugin](https://smashballoon.com/custom-facebook-feed/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=comments "Custom Facebook Feed Pro"). To display comments, shares and likes you would need to upgrade from the free version to the Pro version.
137
138
= Is the content of my Custom Facebook Feed crawlable by search engines? =
139
145
146
= My Facebook feed posts are not showing up, or all I can see is the Facebook Like box but no posts =
147
148
+ Please refer to [this FAQ](https://smashballoon.com/facebook-feed-doesnt-show-can-see-like-box-posts-gives/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=errors "My Facebook feed posts are not showing up, or all I can see is the Facebook Like box but no posts") for potential solutions on how to resolve this issue.
149
150
= Create a basic slideshow from your Facebook posts =
151
181
182
= Changing the font in your Facebook feed and using Google Fonts =
183
184
+ Please refer to [this FAQ](https://smashballoon.com/changing-the-font-in-your-facebook-feed-using-google-fonts/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=fonts "Changing the font in your Facebook feed and using Google Fonts") for directions on how to use Google fonts in your Facebook posts.
185
186
= Can I display my Facebook posts horizontally or in multiple columns? =
187
188
+ Please refer to [this FAQ](https://smashballoon.com/can-display-facebook-post-horizontally-multiple-columns/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=horizontal "Can I display my Facebook posts horizontally or in multiple columns?") for directions on how to display your Facebook posts in multiple columns.
189
190
= My Facebook feed appears to have stopped updating / working =
191
201
202
= I'm receiving an error message when trying to display my Facebook posts =
203
204
+ Please refer to our [Error Message Reference page](https://smashballoon.com/custom-facebook-feed/docs/errors/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=errors "I'm receiving an error message when trying to display my Facebook posts") for information on how to resolve common error messages.
205
206
= Creating a Masonry grid layout from your Facebook posts =
207
208
+ Please refer to [this FAQ](https://smashballoon.com/creating-a-masonry-grid-layout-from-your-facebook-posts/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=masonry "Creating a Masonry grid layout from your Facebook posts") for directions on how to create a Masonry grid layout from your Facebook feed posts.
209
210
= How do I customize my Facebook feed? =
211
227
228
3) Typo in the shortcode option
229
230
+ Ensure that there aren't any spelling errors in the shortcode options that you're using and that the format is consistent with that demonstrated on the [Shortcode Options reference page](https://smashballoon.com/custom-facebook-feed/docs/shortcodes/?utm_campaign=facebook-free-readme&utm_source=faq&utm_medium=shortcode "The shortcode options aren't working").
231
232
= Facebook avatar pictures aren't showing up in my Facebook feed =
233
242
243
== Screenshots ==
244
245
+ 1. By default the Facebook feed inherits your theme's default styles and the Facebook feed is completely responsive
246
2. Completely customize the way your Facebook feed looks to perfectly match your site
247
3. Use custom CSS to customize every part of the Facebook feed
248
+ 4. Display Facebook events in your Facebook feed
249
5. Configuring the Custom Facebook Feed plugin
250
+ 6. General Facebook Feed options - Custom Facebook Feed Layout and Style page
251
+ 7. Facebook Feed Typography options - Custom Facebook Feed Layout and Style page
252
+ 8. Misc Facebook Feed options - Custom Facebook Feed Layout and Style page
253
9. It's super easy to display your Facebook feed in any page or post
254
255
== Changelog ==
256
+ = 2.14.1 =
257
+ * Fix: Some connection error notices not clearing automatically.
258
+
259
= 2.14 =
260
+ * New: Email alerts for critical Facebook feed issues. If there's an issue with a Facebook feed on your website which hasn't been resolved yet then you'll receive an email notification to let you know. This is sent once per week until the issue is resolved. These emails can be disabled by using the following setting: Facebook Feed > Customize > Misc > Feed Issue Email Report.
261
+ * New: Admin notifications for critical Facebook feed issues. If there is an error with a Facebook feed, admins will see notices in the dashboard and on the front-end of the site along with instructions on how to resolve the issue. Front-end admin notifications can be disabled by using the following setting: Facebook Feed > Customize > Misc > Disable Admin Error Notice.
262
* New: Added a WordPress 'Site Health' integration. If there is a critical error with your feeds, it will now be flagged in the site health page.
263
* New: Added "About Us" page for those who would like to learn more about Smash Balloon and our other products. Go to Facebook Feed -> About Us in the dashboard.
264
265
= 2.13 =
266
+ * New: Added a "Custom Facebook Feed" Gutenberg block to use in the block editor, allowing you to easily add a Facebook feed to posts and pages.
267
* New: Added support for translations.
268
269
= 2.12.4 =
272
* Fix: Minor bug fixes
273
274
= 2.12.3 =
275
+ * Tweak: Added a text link in the Facebook Feed settings page footer to our new free [YouTube plugin](https://wordpress.org/plugins/feeds-for-youtube/)
276
+ * Tweak: When reconnecting a Facebook account on the settings page, if there's an issue with the existing Facebook access token then it'll be automatically replaced.
277
* Tweak: Added 'rel="noopener"' to all external links and added 'rel="noreferrer"' to all non-Facebook links. Thanks to Dev VIP for the suggestion.
278
+ * Fix: Fixed an issue with some Facebook call-to-action link URLs when a link protocol wasn't included
279
* Fix: Fixed a JavaScript conflict with the [Forminator](https://wordpress.org/plugins/forminator/) plugin
280
+ * Fix: Fixed duplicate Facebook post message displaying due to ellipsis HTML character
281
+ * Fix: If a shared Facebook link post had no post text then the link title was used causing it to be displayed twice in the Facebook post
282
283
= 2.12.2 =
284
* Fix: Fixed a JavaScript error in the admin caused by the previous update. Apologies for any inconvenience.
285
286
= 2.12.1 =
287
+ * Fix: Fixed an issue with Facebook post date timezones due to changes in the WordPress 5.3 update
288
+ * Fix: Fixed a rare issue where a JavaScript error would occur in the WordPress admin if a Facebook account was manually connected and the Facebook Page ID used was the full URL
289
* Fix: Fixed a JavaScript error in the admin when using older web browsers
290
* Tweak: Improved the manual account connection process
291
* Tweak: Some minor UI tweaks to match the new WordPress 5.3 UI style
292
293
= 2.12 =
294
+ * New: Added a backup cache so the Facebook feed will still display even if there's an error from the Facebook API.
295
+ * New: You can now easily manage multiple Facebook page or group accounts on the Facebook Feed plugin settings page allowing you to easily add them to other Facebook feeds on your site. When you connect a Facebook page or group you will now see it listed in the "Connected Accounts" section. You can add it to the primary Facebook feed or to another Facebook feed by using the new `account` shortcode option.
296
+ * Tweak: Added a filter which can be used to filter the Facebook API data when returned; `cff_filter_api_data`.
297
+ * Tweak: Updated Facebook API error messages
298
+ * Fix: Fixed an issue with some @tag links in Facebook post text due to a Facebook API change
299
+ * Fix: Fixed a rare issue with ellipsis chracter symbols in Facebook shared link descriptions causing the entire link description not to be displayed
300
301
= 2.11.1 =
302
+ * Tweak: Added the link source URL below the title for Facebook shared link posts
303
+ * Fix: Some themes would prevent the Facebook "Share" link from working successfully
304
+ * Fix: Fixed an issue with the "Feed Columns" setting not working if the minified versions of the Custom Facebook Feed plugin CSS/JavaScript files were being used
305
306
= 2.11 =
307
+ * New: Added a "Feed Columns" setting to allow you to display your Facebook feed in multiple columns. This can be found under the "General" tab on the "Customize" page, or by using the `cols` and `colsmobile` shortcode settings.
308
* New: Updated to use v4.0 of the Facebook API
309
310
= 2.10 =
311
+ * New: Facebook Groups are making their long-awaited return to the Custom Facebook Feed plugin! Just click the 'Log in and get my Facebook Access Token' button on the Facebook Feed Settings page and select 'Facebook Group'. Follow the prompts to connect your Facebook Group and display your feed.
312
+ * Fix: Fixed an issue where a lists of Facebook groups or pages wouldn't be displayed when retrieving a Facebook Access Token due to a server configuration issue
313
+ * Fix: Photo icons weren't showing for Facebook album posts
314
+ * Tweak: Now uses the Facebook `visitor_posts` endpoint to display visitor Facebook post feeds
315
316
= 2.9.1 =
317
* New: Added support for v3.3 of the Facebook API.
318
+ * Fix: The Facebook Access Token selection area was being cut off on small screens when a lot of Facebook pages were listed.
319
320
= 2.9 =
321
+ * New: You can now select between a "Regular" or "Boxed" Facebook post style. Settings for this can be found at: `Facebook Feed > Customize > Style Posts > Post Item`. A Box Shadow setting has been added to the "Boxed" Facebook post style.
322
* New: Added some settings to control the size and color of the Facebook shared link URLs and descriptions. These can be found at: `Facebook Feed > Customize > Style Posts > Shared Link Boxes`.
323
* New: Improved the Facebook Access Token retrieval process to make it more intuitive.
324
+ * Tweak: Facebook avatar images are now circular to match Facebook.
325
+ * Tweak: Animated the social media icons when the Facebook "Share" button is clicked.
326
* Tweak: Changed the way the Facebook Like Box loads to avoid a conflict with the Facebook Messenger widget. It no longer uses the Facebook JavaScript SDK.
327
* Tweak: Changed the elements used for icons from `<i>` to `<span>` to aid accessibility.
328
* Tweak: Removed the Google+ share option as the platform has been deprecated.
329
+ * Tweak: Removed the social media share widgets from the footer of the admin so that they're only loaded when the "Share the plugin" button is clicked.
330
+ * Fix: The Custom Facebook Feed plugin now uses the built-in WordPress HTTP API to get data from Facebook instead of making it's own cURL requests to the Facebook API.
331
+ * Fix: Fixed an issue where the Facebook avatars of people posting to the Facebook page weren't being displayed. Individual Facebook API requests for avatars have now been removed and bundled into the main Facebook API request.
332
+ * Fix: If the link to the Facebook profile of a visitor posting to your page is not available then remove the link from the Facebook avatar and author name.
333
+ * Fix: Fixed an accessibility error caused by the Facebook share icons being empty links.
334
* Fix: Removed the use of the ENT_HTML5 constant as it isn't supported in PHP 5.4.
335
+ * Fix: Fixed a rare issue with Facebook tags in Facebook post stories when the locale was set to be Greek.
336
337
= 2.8 =
338
+ * New: Added support for Facebook Notes in timeline feeds. If your Facebook timeline feed contains a note then the Custom Facebook Feed plugin will now get the content from the note and display it within the Facebook post.
339
+ * New: Facebook call-to-action buttons - such as "Learn More", "Shop Now", and "Message Facebook Page" - are now supported in your Facebook posts. These text strings can be translated using the settings at: Facebook Feed > Customize > Custom Text/Translate
340
* New: Added a setting that you can enable if you are displaying Facebook posts from a restricted (non-public) Facebook page. This will allow the Facebook page avatar to be displayed, and is located at: Facebook Feed > Customize > Misc > Misc Settings > Is Facebook Page restricted?
341
+ * New: If a Facebook visitor posts to your Facebook page then their avatar will now be displayed and cached for 6 months. To clear the cache of these Facebook avatar images use the button located at: Facebook Feed > Customize > Misc > Misc Settings > Clear Avatar Cache
342
+ * Tweak: The Timezone setting can now be set in the Custom Facebook Feed shortcode. Eg: `timezone="America/Los_Angeles"`
343
+ * Tweak: Minor UI changes to the Facebook Feed admin pages
344
* Tweak: Reduced some of the Facebook data in the System Info
345
* Fix: If you backdate a Facebook post it will now be ordered correctly in your Facebook feed
346
+ * Fix: Fixed a theme conflict related to the Color Picker in the Facebook Feed admin section
347
* Verified compatibility with WordPress 5.0 and Gutenburg
348
349
= 2.7.2 =
354
* Tweak: Made some adjustments to the Facebook Access Token login process
355
356
= 2.7 =
357
+ * New: Now easily get your own Facebook Access Token to avoid any Facebook connection issues. Simply click the blue Facebook "Log in and get my Facebook Access Token" button on the Custom Facebook Feed settings page and connect your Facebook account to get your token. The Facebook Access Token will work to get Facebook posts from ANY Facebook page. Thanks to our friends at SlickRemix for powering our new login and getting the Custom Facebook Feed plugin back up and running again!
358
* Tweak: Removed the minimum caching time if you're using your own Facebook Page Access Token
359
360
= 2.6.4 =
361
+ * **Important:** If you are displaying Facebook posts from a Facebook page that **you are an admin of** then it is now highly recommended that you retrieve your own Facebook Access Token for that Facebook page to avoid any Facebook API rate limit errors. Simply follow these [step-by-step](https://smashballoon.com/custom-facebook-feed/page-token/?utm_campaign=facebook-free-readme&utm_source=changelog&utm_medium=limits) instructions to obtain one.
362
363
= 2.6.3 =
364
* Fix: Fixed an issue where Facebook API errors were being cached
365
366
= 2.6.2 =
367
+ * Fix: Replaced all HTTP links in the Facebook feed with HTTPS
368
* Fix: Fixed a rare issue which affected the layout of other Facebook widgets
369
* Fix: Automatically remove slashes at the end of the Facebook Page ID as it caused an error
370
+ * Fix: The API response test in the System Info now only tests with your Facebook token if you have the "Use my own Facebook Access Token" setting enabled
371
* Fix: Fixed an issue which caused an occasional Facebook API rate limit error
372
373
= 2.6.1 =
374
* Fix: Removed an unnecessary Facebook API call
375
* Fix: Removed a PHP notice which was displayed under rare circumstances
376
+ * Fix: Minor Facebook bug fixes
377
378
= 2.6 =
379
* Fix: Fixed an issue connecting to the Facebook API caused by a recent Facebook platform change
380
* Tweak: Increased the minimum caching time to be 15 minutes to reduce Facebook API requests
381
382
= 2.5.2 =
383
+ * Important: Due to sudden changes in the Facebook API it is no longer possible to display Facebook posts from a Facebook Group. Please [see here](https://smashballoon.com/facebook-api-changes-april-4-2018/) for more information. We apologize for any frustration or inconvenience this has caused.
384
+ * Removed: Due to Facebook API restrictions, it is no longer possible to display information about a Facebook event when it is posted or shared to your Facebook Page timeline.
385
386
= 2.5.1 =
387
+ * Fix: Prevented a PHP notice which would be displayed under rare circumstances in the Facebook feed
388
* Fix: Replaced a function due to a deprecation in PHP 7.2
389
390
= 2.5 =
391
+ * New: Added the Facebook post story as part of the page/author name at the top of the Facebook post
392
* New: Added an option to use minified versions of the plugin CSS and JavaScript files: `Facebook Feed > Customize > Misc > Misc Settings > Minify CSS and JavaScript files`
393
* New: Added support for clearing the cache of major caching plugins when the Facebook feed cache is cleared. You can enable this by setting the following setting to be "Yes": `Facebook Feed > Customize > Misc > Misc Settings > Force cache to clear on interval`
394
+ * Tweak: Improved the text truncation so that it applies to both the Facebook post text and Facebook description as one block of text and accounts for HTML link tags
395
+ * Tweak: Added an "Auto" option to the Facebook Post Limit setting where it will automatically adjust the post limit based on the number of Facebook posts you choose to display in your Facebook feed
396
+ * Tweak: Reorganized the Custom Facebook Feed settings pages to be more intuitive
397
* Tweak: Added aria-hidden=true to icons to help improve accessibility
398
+ * Tweak: The icon font stylesheet handle has been renamed so it will only be loaded once if another of our social media plugins is installed
399
+ * Tweak: Facebook error messages are now only shown to admins
400
+ * Tweak: Added a setting to workaround a theme issue that affects the shortening of the Facebook post text. If you're experiencing an issue with the shortening of Facebook post text then you can enable the following setting: `Facebook Feed > Customize > Misc > Misc Settings > Fix Facebook text shortening issue`
401
+ * Fix: Included a fallback in case the Facebook author name and avatar aren't available in visitor Facebook posts
402
+ * Fix: Fixed an issue with apostrophes in the Facebook feed header not being escaped correctly
403
+ * Fix: Fixed an issue with the Facebook icons when Font Awesome 5 was added to a site
404
+ * Fix: Added support for the @[ID:page-name] Facebook tagging format
405
+ * Fix: The Facebook post description is now able to be displayed even if the Facebook post text is hidden
406
+
407
+ [See changelog for all versions](https://plugins.svn.wordpress.org/custom-facebook-feed/trunk/changelog.txt).
admin/PluginSilentUpgrader.php CHANGED
@@ -1,576 +1,576 @@
1
- <?php
2
-
3
- namespace CFF\Helpers;
4
-
5
- use WP_Error;
6
- use WP_Upgrader;
7
- use WP_Filesystem_Base;
8
-
9
- /** \WP_Upgrader class */
10
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
11
-
12
- /** \Plugin_Upgrader class */
13
- require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';
14
-
15
- /**
16
- * In WP 5.3 a PHP 5.6 splat operator (...$args) was added to \WP_Upgrader_Skin::feedback().
17
- * We need to remove all calls to *Skin::feedback() method, as we can't override it in own Skins
18
- * without breaking support for PHP 5.3-5.5.
19
- *
20
- * @internal Please do not use this class outside of core WPForms development. May be removed at any time.
21
- *
22
- * @since 1.5.6.1
23
- */
24
- class PluginSilentUpgrader extends \Plugin_Upgrader {
25
-
26
- /**
27
- * Run an upgrade/installation.
28
- *
29
- * Attempts to download the package (if it is not a local file), unpack it, and
30
- * install it in the destination folder.
31
- *
32
- * @since 1.5.6.1
33
- *
34
- * @param array $options {
35
- * Array or string of arguments for upgrading/installing a package.
36
- *
37
- * @type string $package The full path or URI of the package to install.
38
- * Default empty.
39
- * @type string $destination The full path to the destination folder.
40
- * Default empty.
41
- * @type bool $clear_destination Whether to delete any files already in the
42
- * destination folder. Default false.
43
- * @type bool $clear_working Whether to delete the files form the working
44
- * directory after copying to the destination.
45
- * Default false.
46
- * @type bool $abort_if_destination_exists Whether to abort the installation if the destination
47
- * folder already exists. When true, `$clear_destination`
48
- * should be false. Default true.
49
- * @type bool $is_multi Whether this run is one of multiple upgrade/installation
50
- * actions being performed in bulk. When true, the skin
51
- * WP_Upgrader::header() and WP_Upgrader::footer()
52
- * aren't called. Default false.
53
- * @type array $hook_extra Extra arguments to pass to the filter hooks called by
54
- * WP_Upgrader::run().
55
- * }
56
- * @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,
57
- * or false if unable to connect to the filesystem.
58
- */
59
- public function run( $options ) {
60
-
61
- $defaults = array(
62
- 'package' => '', // Please always pass this.
63
- 'destination' => '', // And this
64
- 'clear_destination' => false,
65
- 'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please
66
- 'clear_working' => true,
67
- 'is_multi' => false,
68
- 'hook_extra' => array(), // Pass any extra $hook_extra args here, this will be passed to any hooked filters.
69
- );
70
-
71
- $options = wp_parse_args( $options, $defaults );
72
-
73
- /**
74
- * Filters the package options before running an update.
75
- *
76
- * See also {@see 'upgrader_process_complete'}.
77
- *
78
- * @since 4.3.0
79
- *
80
- * @param array $options {
81
- * Options used by the upgrader.
82
- *
83
- * @type string $package Package for update.
84
- * @type string $destination Update location.
85
- * @type bool $clear_destination Clear the destination resource.
86
- * @type bool $clear_working Clear the working resource.
87
- * @type bool $abort_if_destination_exists Abort if the Destination directory exists.
88
- * @type bool $is_multi Whether the upgrader is running multiple times.
89
- * @type array $hook_extra {
90
- * Extra hook arguments.
91
- *
92
- * @type string $action Type of action. Default 'update'.
93
- * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
94
- * @type bool $bulk Whether the update process is a bulk update. Default true.
95
- * @type string $plugin Path to the plugin file relative to the plugins directory.
96
- * @type string $theme The stylesheet or template name of the theme.
97
- * @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',
98
- * or 'core'.
99
- * @type object $language_update The language pack update offer.
100
- * }
101
- * }
102
- */
103
- $options = apply_filters( 'upgrader_package_options', $options );
104
-
105
- if ( ! $options['is_multi'] ) { // call $this->header separately if running multiple times
106
- $this->skin->header();
107
- }
108
-
109
- // Connect to the Filesystem first.
110
- $res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );
111
- // Mainly for non-connected filesystem.
112
- if ( ! $res ) {
113
- if ( ! $options['is_multi'] ) {
114
- $this->skin->footer();
115
- }
116
- return false;
117
- }
118
-
119
- $this->skin->before();
120
-
121
- if ( is_wp_error( $res ) ) {
122
- $this->skin->error( $res );
123
- $this->skin->after();
124
- if ( ! $options['is_multi'] ) {
125
- $this->skin->footer();
126
- }
127
- return $res;
128
- }
129
-
130
- /*
131
- * Download the package (Note, This just returns the filename
132
- * of the file if the package is a local file)
133
- */
134
- $download = $this->download_package( $options['package'], true );
135
-
136
- // Allow for signature soft-fail.
137
- // WARNING: This may be removed in the future.
138
- if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
139
-
140
- // Don't output the 'no signature could be found' failure message for now.
141
- if ( 'signature_verification_no_signature' != $download->get_error_code() || WP_DEBUG ) {
142
- // Outout the failure error as a normal feedback, and not as an error:
143
- //$this->skin->feedback( $download->get_error_message() );
144
-
145
- // Report this failure back to WordPress.org for debugging purposes.
146
- wp_version_check(
147
- array(
148
- 'signature_failure_code' => $download->get_error_code(),
149
- 'signature_failure_data' => $download->get_error_data(),
150
- )
151
- );
152
- }
153
-
154
- // Pretend this error didn't happen.
155
- $download = $download->get_error_data( 'softfail-filename' );
156
- }
157
-
158
- if ( is_wp_error( $download ) ) {
159
- $this->skin->error( $download );
160
- $this->skin->after();
161
- if ( ! $options['is_multi'] ) {
162
- $this->skin->footer();
163
- }
164
- return $download;
165
- }
166
-
167
- $delete_package = ( $download != $options['package'] ); // Do not delete a "local" file
168
-
169
- // Unzips the file into a temporary directory.
170
- $working_dir = $this->unpack_package( $download, $delete_package );
171
- if ( is_wp_error( $working_dir ) ) {
172
- $this->skin->error( $working_dir );
173
- $this->skin->after();
174
- if ( ! $options['is_multi'] ) {
175
- $this->skin->footer();
176
- }
177
- return $working_dir;
178
- }
179
-
180
- // With the given options, this installs it to the destination directory.
181
- $result = $this->install_package(
182
- array(
183
- 'source' => $working_dir,
184
- 'destination' => $options['destination'],
185
- 'clear_destination' => $options['clear_destination'],
186
- 'abort_if_destination_exists' => $options['abort_if_destination_exists'],
187
- 'clear_working' => $options['clear_working'],
188
- 'hook_extra' => $options['hook_extra'],
189
- )
190
- );
191
-
192
- $this->skin->set_result( $result );
193
- if ( is_wp_error( $result ) ) {
194
- $this->skin->error( $result );
195
- //$this->skin->feedback( 'process_failed' );
196
- } else {
197
- // Installation succeeded.
198
- //$this->skin->feedback( 'process_success' );
199
- }
200
-
201
- $this->skin->after();
202
-
203
- if ( ! $options['is_multi'] ) {
204
-
205
- /**
206
- * Fires when the upgrader process is complete.
207
- *
208
- * See also {@see 'upgrader_package_options'}.
209
- *
210
- * @since 3.6.0
211
- * @since 3.7.0 Added to WP_Upgrader::run().
212
- * @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`.
213
- *
214
- * @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a
215
- * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
216
- * @param array $hook_extra {
217
- * Array of bulk item update data.
218
- *
219
- * @type string $action Type of action. Default 'update'.
220
- * @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'.
221
- * @type bool $bulk Whether the update process is a bulk update. Default true.
222
- * @type array $plugins Array of the basename paths of the plugins' main files.
223
- * @type array $themes The theme slugs.
224
- * @type array $translations {
225
- * Array of translations update data.
226
- *
227
- * @type string $language The locale the translation is for.
228
- * @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'.
229
- * @type string $slug Text domain the translation is for. The slug of a theme/plugin or
230
- * 'default' for core translations.
231
- * @type string $version The version of a theme, plugin, or core.
232
- * }
233
- * }
234
- */
235
- do_action( 'upgrader_process_complete', $this, $options['hook_extra'] );
236
-
237
- $this->skin->footer();
238
- }
239
-
240
- return $result;
241
- }
242
-
243
- /**
244
- * Toggle maintenance mode for the site.
245
- *
246
- * Create/delete the maintenance file to enable/disable maintenance mode.
247
- *
248
- * @since 2.8.0
249
- *
250
- * @global WP_Filesystem_Base $wp_filesystem Subclass
251
- *
252
- * @param bool $enable True to enable maintenance mode, false to disable.
253
- */
254
- public function maintenance_mode( $enable = false ) {
255
- global $wp_filesystem;
256
- $file = $wp_filesystem->abspath() . '.maintenance';
257
- if ( $enable ) {
258
- //$this->skin->feedback( 'maintenance_start' );
259
- // Create maintenance file to signal that we are upgrading
260
- $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
261
- $wp_filesystem->delete( $file );
262
- $wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
263
- } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
264
- //$this->skin->feedback( 'maintenance_end' );
265
- $wp_filesystem->delete( $file );
266
- }
267
- }
268
-
269
- /**
270
- * Download a package.
271
- *
272
- * @since 2.8.0
273
- *
274
- * @param string $package The URI of the package. If this is the full path to an
275
- * existing local file, it will be returned untouched.
276
- * @param bool $check_signatures Whether to validate file signatures. Default false.
277
- * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object.
278
- */
279
- public function download_package( $package, $check_signatures = false ) {
280
-
281
- /**
282
- * Filters whether to return the package.
283
- *
284
- * @since 3.7.0
285
- *
286
- * @param bool $reply Whether to bail without returning the package.
287
- * Default false.
288
- * @param string $package The package file name.
289
- * @param WP_Upgrader $this The WP_Upgrader instance.
290
- */
291
- $reply = apply_filters( 'upgrader_pre_download', false, $package, $this );
292
- if ( false !== $reply ) {
293
- return $reply;
294
- }
295
-
296
- if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { //Local file or remote?
297
- return $package; //must be a local file..
298
- }
299
-
300
- if ( empty( $package ) ) {
301
- return new WP_Error( 'no_package', $this->strings['no_package'] );
302
- }
303
-
304
- //$this->skin->feedback( 'downloading_package', $package );
305
-
306
- $download_file = download_url( $package, 300, $check_signatures );
307
-
308
- if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) {
309
- return new WP_Error( 'download_failed', $this->strings['download_failed'], $download_file->get_error_message() );
310
- }
311
-
312
- return $download_file;
313
- }
314
-
315
- /**
316
- * Unpack a compressed package file.
317
- *
318
- * @since 2.8.0
319
- *
320
- * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
321
- *
322
- * @param string $package Full path to the package file.
323
- * @param bool $delete_package Optional. Whether to delete the package file after attempting
324
- * to unpack it. Default true.
325
- * @return string|WP_Error The path to the unpacked contents, or a WP_Error on failure.
326
- */
327
- public function unpack_package( $package, $delete_package = true ) {
328
- global $wp_filesystem;
329
-
330
- //$this->skin->feedback( 'unpack_package' );
331
-
332
- $upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/';
333
-
334
- //Clean up contents of upgrade directory beforehand.
335
- $upgrade_files = $wp_filesystem->dirlist( $upgrade_folder );
336
- if ( ! empty( $upgrade_files ) ) {
337
- foreach ( $upgrade_files as $file ) {
338
- $wp_filesystem->delete( $upgrade_folder . $file['name'], true );
339
- }
340
- }
341
-
342
- // We need a working directory - Strip off any .tmp or .zip suffixes
343
- $working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' );
344
-
345
- // Clean up working directory
346
- if ( $wp_filesystem->is_dir( $working_dir ) ) {
347
- $wp_filesystem->delete( $working_dir, true );
348
- }
349
-
350
- // Unzip package to working directory
351
- $result = unzip_file( $package, $working_dir );
352
-
353
- // Once extracted, delete the package if required.
354
- if ( $delete_package ) {
355
- unlink( $package );
356
- }
357
-
358
- if ( is_wp_error( $result ) ) {
359
- $wp_filesystem->delete( $working_dir, true );
360
- if ( 'incompatible_archive' == $result->get_error_code() ) {
361
- return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $result->get_error_data() );
362
- }
363
- return $result;
364
- }
365
-
366
- return $working_dir;
367
- }
368
-
369
- /**
370
- * Install a package.
371
- *
372
- * Copies the contents of a package form a source directory, and installs them in
373
- * a destination directory. Optionally removes the source. It can also optionally
374
- * clear out the destination folder if it already exists.
375
- *
376
- * @since 2.8.0
377
- *
378
- * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
379
- * @global array $wp_theme_directories
380
- *
381
- * @param array|string $args {
382
- * Optional. Array or string of arguments for installing a package. Default empty array.
383
- *
384
- * @type string $source Required path to the package source. Default empty.
385
- * @type string $destination Required path to a folder to install the package in.
386
- * Default empty.
387
- * @type bool $clear_destination Whether to delete any files already in the destination
388
- * folder. Default false.
389
- * @type bool $clear_working Whether to delete the files form the working directory
390
- * after copying to the destination. Default false.
391
- * @type bool $abort_if_destination_exists Whether to abort the installation if
392
- * the destination folder already exists. Default true.
393
- * @type array $hook_extra Extra arguments to pass to the filter hooks called by
394
- * WP_Upgrader::install_package(). Default empty array.
395
- * }
396
- *
397
- * @return array|WP_Error The result (also stored in `WP_Upgrader::$result`), or a WP_Error on failure.
398
- */
399
- public function install_package( $args = array() ) {
400
- global $wp_filesystem, $wp_theme_directories;
401
-
402
- $defaults = array(
403
- 'source' => '', // Please always pass this
404
- 'destination' => '', // and this
405
- 'clear_destination' => false,
406
- 'clear_working' => false,
407
- 'abort_if_destination_exists' => true,
408
- 'hook_extra' => array(),
409
- );
410
-
411
- $args = wp_parse_args( $args, $defaults );
412
-
413
- // These were previously extract()'d.
414
- $source = $args['source'];
415
- $destination = $args['destination'];
416
- $clear_destination = $args['clear_destination'];
417
-
418
- set_time_limit( 300 );
419
-
420
- if ( empty( $source ) || empty( $destination ) ) {
421
- return new WP_Error( 'bad_request', $this->strings['bad_request'] );
422
- }
423
- //$this->skin->feedback( 'installing_package' );
424
-
425
- /**
426
- * Filters the install response before the installation has started.
427
- *
428
- * Returning a truthy value, or one that could be evaluated as a WP_Error
429
- * will effectively short-circuit the installation, returning that value
430
- * instead.
431
- *
432
- * @since 2.8.0
433
- *
434
- * @param bool|WP_Error $response Response.
435
- * @param array $hook_extra Extra arguments passed to hooked filters.
436
- */
437
- $res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );
438
-
439
- if ( is_wp_error( $res ) ) {
440
- return $res;
441
- }
442
-
443
- //Retain the Original source and destinations
444
- $remote_source = $args['source'];
445
- $local_destination = $destination;
446
-
447
- $source_files = array_keys( $wp_filesystem->dirlist( $remote_source ) );
448
- $remote_destination = $wp_filesystem->find_folder( $local_destination );
449
-
450
- //Locate which directory to copy to the new folder, This is based on the actual folder holding the files.
451
- if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { //Only one folder? Then we want its contents.
452
- $source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] );
453
- } elseif ( count( $source_files ) == 0 ) {
454
- return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files?
455
- } else { // It's only a single file, the upgrader will use the folder name of this file as the destination folder. Folder name is based on zip filename.
456
- $source = trailingslashit( $args['source'] );
457
- }
458
-
459
- /**
460
- * Filters the source file location for the upgrade package.
461
- *
462
- * @since 2.8.0
463
- * @since 4.4.0 The $hook_extra parameter became available.
464
- *
465
- * @param string $source File source location.
466
- * @param string $remote_source Remote file source location.
467
- * @param WP_Upgrader $this WP_Upgrader instance.
468
- * @param array $hook_extra Extra arguments passed to hooked filters.
469
- */
470
- $source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this, $args['hook_extra'] );
471
-
472
- if ( is_wp_error( $source ) ) {
473
- return $source;
474
- }
475
-
476
- // Has the source location changed? If so, we need a new source_files list.
477
- if ( $source !== $remote_source ) {
478
- $source_files = array_keys( $wp_filesystem->dirlist( $source ) );
479
- }
480
-
481
- /*
482
- * Protection against deleting files in any important base directories.
483
- * Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the
484
- * destination directory (WP_PLUGIN_DIR / wp-content/themes) intending
485
- * to copy the directory into the directory, whilst they pass the source
486
- * as the actual files to copy.
487
- */
488
- $protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' );
489
-
490
- if ( is_array( $wp_theme_directories ) ) {
491
- $protected_directories = array_merge( $protected_directories, $wp_theme_directories );
492
- }
493
-
494
- if ( in_array( $destination, $protected_directories ) ) {
495
- $remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) );
496
- $destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) );
497
- }
498
-
499
- if ( $clear_destination ) {
500
- // We're going to clear the destination if there's something there.
501
- //$this->skin->feedback( 'remove_old' );
502
-
503
- $removed = $this->clear_destination( $remote_destination );
504
-
505
- /**
506
- * Filters whether the upgrader cleared the destination.
507
- *
508
- * @since 2.8.0
509
- *
510
- * @param mixed $removed Whether the destination was cleared. true on success, WP_Error on failure
511
- * @param string $local_destination The local package destination.
512
- * @param string $remote_destination The remote package destination.
513
- * @param array $hook_extra Extra arguments passed to hooked filters.
514
- */
515
- $removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
516
-
517
- if ( is_wp_error( $removed ) ) {
518
- return $removed;
519
- }
520
- } elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) {
521
- //If we're not clearing the destination folder and something exists there already, Bail.
522
- //But first check to see if there are actually any files in the folder.
523
- $_files = $wp_filesystem->dirlist( $remote_destination );
524
- if ( ! empty( $_files ) ) {
525
- $wp_filesystem->delete( $remote_source, true ); //Clear out the source files.
526
- return new WP_Error( 'folder_exists', $this->strings['folder_exists'], $remote_destination );
527
- }
528
- }
529
-
530
- //Create destination if needed
531
- if ( ! $wp_filesystem->exists( $remote_destination ) ) {
532
- if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {
533
- return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination );
534
- }
535
- }
536
- // Copy new version of item into place.
537
- $result = copy_dir( $source, $remote_destination );
538
- if ( is_wp_error( $result ) ) {
539
- if ( $args['clear_working'] ) {
540
- $wp_filesystem->delete( $remote_source, true );
541
- }
542
- return $result;
543
- }
544
-
545
- //Clear the Working folder?
546
- if ( $args['clear_working'] ) {
547
- $wp_filesystem->delete( $remote_source, true );
548
- }
549
-
550
- $destination_name = basename( str_replace( $local_destination, '', $destination ) );
551
- if ( '.' == $destination_name ) {
552
- $destination_name = '';
553
- }
554
-
555
- $this->result = compact( 'source', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination' );
556
-
557
- /**
558
- * Filters the installation response after the installation has finished.
559
- *
560
- * @since 2.8.0
561
- *
562
- * @param bool $response Installation response.
563
- * @param array $hook_extra Extra arguments passed to hooked filters.
564
- * @param array $result Installation result data.
565
- */
566
- $res = apply_filters( 'upgrader_post_install', true, $args['hook_extra'], $this->result );
567
-
568
- if ( is_wp_error( $res ) ) {
569
- $this->result = $res;
570
- return $res;
571
- }
572
-
573
- //Bombard the calling function will all the info which we've just used.
574
- return $this->result;
575
- }
576
- }
1
+ <?php
2
+
3
+ namespace CFF\Helpers;
4
+
5
+ use WP_Error;
6
+ use WP_Upgrader;
7
+ use WP_Filesystem_Base;
8
+
9
+ /** \WP_Upgrader class */
10
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
11
+
12
+ /** \Plugin_Upgrader class */
13
+ require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';
14
+
15
+ /**
16
+ * In WP 5.3 a PHP 5.6 splat operator (...$args) was added to \WP_Upgrader_Skin::feedback().
17
+ * We need to remove all calls to *Skin::feedback() method, as we can't override it in own Skins
18
+ * without breaking support for PHP 5.3-5.5.
19
+ *
20
+ * @internal Please do not use this class outside of core WPForms development. May be removed at any time.
21
+ *
22
+ * @since 1.5.6.1
23
+ */
24
+ class PluginSilentUpgrader extends \Plugin_Upgrader {
25
+
26
+ /**
27
+ * Run an upgrade/installation.
28
+ *
29
+ * Attempts to download the package (if it is not a local file), unpack it, and
30
+ * install it in the destination folder.
31
+ *
32
+ * @since 1.5.6.1
33
+ *
34
+ * @param array $options {
35
+ * Array or string of arguments for upgrading/installing a package.
36
+ *
37
+ * @type string $package The full path or URI of the package to install.
38
+ * Default empty.
39
+ * @type string $destination The full path to the destination folder.
40
+ * Default empty.
41
+ * @type bool $clear_destination Whether to delete any files already in the
42
+ * destination folder. Default false.
43
+ * @type bool $clear_working Whether to delete the files form the working
44
+ * directory after copying to the destination.
45
+ * Default false.
46
+ * @type bool $abort_if_destination_exists Whether to abort the installation if the destination
47
+ * folder already exists. When true, `$clear_destination`
48
+ * should be false. Default true.
49
+ * @type bool $is_multi Whether this run is one of multiple upgrade/installation
50
+ * actions being performed in bulk. When true, the skin
51
+ * WP_Upgrader::header() and WP_Upgrader::footer()
52
+ * aren't called. Default false.
53
+ * @type array $hook_extra Extra arguments to pass to the filter hooks called by
54
+ * WP_Upgrader::run().
55
+ * }
56
+ * @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,
57
+ * or false if unable to connect to the filesystem.
58
+ */
59
+ public function run( $options ) {
60
+
61
+ $defaults = array(
62
+ 'package' => '', // Please always pass this.
63
+ 'destination' => '', // And this
64
+ 'clear_destination' => false,
65
+ 'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please
66
+ 'clear_working' => true,
67
+ 'is_multi' => false,
68
+ 'hook_extra' => array(), // Pass any extra $hook_extra args here, this will be passed to any hooked filters.
69
+ );
70
+
71
+ $options = wp_parse_args( $options, $defaults );
72
+
73
+ /**
74
+ * Filters the package options before running an update.
75
+ *
76
+ * See also {@see 'upgrader_process_complete'}.
77
+ *
78
+ * @since 4.3.0
79
+ *
80
+ * @param array $options {
81
+ * Options used by the upgrader.
82
+ *
83
+ * @type string $package Package for update.
84
+ * @type string $destination Update location.
85
+ * @type bool $clear_destination Clear the destination resource.
86
+ * @type bool $clear_working Clear the working resource.
87
+ * @type bool $abort_if_destination_exists Abort if the Destination directory exists.
88
+ * @type bool $is_multi Whether the upgrader is running multiple times.
89
+ * @type array $hook_extra {
90
+ * Extra hook arguments.
91
+ *
92
+ * @type string $action Type of action. Default 'update'.
93
+ * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
94
+ * @type bool $bulk Whether the update process is a bulk update. Default true.
95
+ * @type string $plugin Path to the plugin file relative to the plugins directory.
96
+ * @type string $theme The stylesheet or template name of the theme.
97
+ * @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',
98
+ * or 'core'.
99
+ * @type object $language_update The language pack update offer.
100
+ * }
101
+ * }
102
+ */
103
+ $options = apply_filters( 'upgrader_package_options', $options );
104
+
105
+ if ( ! $options['is_multi'] ) { // call $this->header separately if running multiple times
106
+ $this->skin->header();
107
+ }
108
+
109
+ // Connect to the Filesystem first.
110
+ $res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );
111
+ // Mainly for non-connected filesystem.
112
+ if ( ! $res ) {
113
+ if ( ! $options['is_multi'] ) {
114
+ $this->skin->footer();
115
+ }
116
+ return false;
117
+ }
118
+
119
+ $this->skin->before();
120
+
121
+ if ( is_wp_error( $res ) ) {
122
+ $this->skin->error( $res );
123
+ $this->skin->after();
124
+ if ( ! $options['is_multi'] ) {
125
+ $this->skin->footer();
126
+ }
127
+ return $res;
128
+ }
129
+
130
+ /*
131
+ * Download the package (Note, This just returns the filename
132
+ * of the file if the package is a local file)
133
+ */
134
+ $download = $this->download_package( $options['package'], true );
135
+
136
+ // Allow for signature soft-fail.
137
+ // WARNING: This may be removed in the future.
138
+ if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
139
+
140
+ // Don't output the 'no signature could be found' failure message for now.
141
+ if ( 'signature_verification_no_signature' != $download->get_error_code() || WP_DEBUG ) {
142
+ // Outout the failure error as a normal feedback, and not as an error:
143
+ //$this->skin->feedback( $download->get_error_message() );
144
+
145
+ // Report this failure back to WordPress.org for debugging purposes.
146
+ wp_version_check(
147
+ array(
148
+ 'signature_failure_code' => $download->get_error_code(),
149
+ 'signature_failure_data' => $download->get_error_data(),
150
+ )
151
+ );
152
+ }
153
+
154
+ // Pretend this error didn't happen.
155
+ $download = $download->get_error_data( 'softfail-filename' );
156
+ }
157
+
158
+ if ( is_wp_error( $download ) ) {
159
+ $this->skin->error( $download );
160
+ $this->skin->after();
161
+ if ( ! $options['is_multi'] ) {
162
+ $this->skin->footer();
163
+ }
164
+ return $download;
165
+ }
166
+
167
+ $delete_package = ( $download != $options['package'] ); // Do not delete a "local" file
168
+
169
+ // Unzips the file into a temporary directory.
170
+ $working_dir = $this->unpack_package( $download, $delete_package );
171
+ if ( is_wp_error( $working_dir ) ) {
172
+ $this->skin->error( $working_dir );
173
+ $this->skin->after();
174
+ if ( ! $options['is_multi'] ) {
175
+ $this->skin->footer();
176
+ }
177
+ return $working_dir;
178
+ }
179
+
180
+ // With the given options, this installs it to the destination directory.
181
+ $result = $this->install_package(
182
+ array(
183
+ 'source' => $working_dir,
184
+ 'destination' => $options['destination'],
185
+ 'clear_destination' => $options['clear_destination'],
186
+ 'abort_if_destination_exists' => $options['abort_if_destination_exists'],
187
+ 'clear_working' => $options['clear_working'],
188
+ 'hook_extra' => $options['hook_extra'],
189
+ )
190
+ );
191
+
192
+ $this->skin->set_result( $result );
193
+ if ( is_wp_error( $result ) ) {
194
+ $this->skin->error( $result );
195
+ //$this->skin->feedback( 'process_failed' );
196
+ } else {
197
+ // Installation succeeded.
198
+ //$this->skin->feedback( 'process_success' );
199
+ }
200
+
201
+ $this->skin->after();
202
+
203
+ if ( ! $options['is_multi'] ) {
204
+
205
+ /**
206
+ * Fires when the upgrader process is complete.
207
+ *
208
+ * See also {@see 'upgrader_package_options'}.
209
+ *
210
+ * @since 3.6.0
211
+ * @since 3.7.0 Added to WP_Upgrader::run().
212
+ * @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`.
213
+ *
214
+ * @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a
215
+ * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
216
+ * @param array $hook_extra {
217
+ * Array of bulk item update data.
218
+ *
219
+ * @type string $action Type of action. Default 'update'.
220
+ * @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'.
221
+ * @type bool $bulk Whether the update process is a bulk update. Default true.
222
+ * @type array $plugins Array of the basename paths of the plugins' main files.
223
+ * @type array $themes The theme slugs.
224
+ * @type array $translations {
225
+ * Array of translations update data.
226
+ *
227
+ * @type string $language The locale the translation is for.
228
+ * @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'.
229
+ * @type string $slug Text domain the translation is for. The slug of a theme/plugin or
230
+ * 'default' for core translations.
231
+ * @type string $version The version of a theme, plugin, or core.
232
+ * }
233
+ * }
234
+ */
235
+ do_action( 'upgrader_process_complete', $this, $options['hook_extra'] );
236
+
237
+ $this->skin->footer();
238
+ }
239
+
240
+ return $result;
241
+ }
242
+
243
+ /**
244
+ * Toggle maintenance mode for the site.
245
+ *
246
+ * Create/delete the maintenance file to enable/disable maintenance mode.
247
+ *
248
+ * @since 2.8.0
249
+ *
250
+ * @global WP_Filesystem_Base $wp_filesystem Subclass
251
+ *
252
+ * @param bool $enable True to enable maintenance mode, false to disable.
253
+ */
254
+ public function maintenance_mode( $enable = false ) {
255
+ global $wp_filesystem;
256
+ $file = $wp_filesystem->abspath() . '.maintenance';
257
+ if ( $enable ) {
258
+ //$this->skin->feedback( 'maintenance_start' );
259
+ // Create maintenance file to signal that we are upgrading
260
+ $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
261
+ $wp_filesystem->delete( $file );
262
+ $wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
263
+ } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
264
+ //$this->skin->feedback( 'maintenance_end' );
265
+ $wp_filesystem->delete( $file );
266
+ }
267
+ }
268
+
269
+ /**
270
+ * Download a package.
271
+ *
272
+ * @since 2.8.0
273
+ *
274
+ * @param string $package The URI of the package. If this is the full path to an
275
+ * existing local file, it will be returned untouched.
276
+ * @param bool $check_signatures Whether to validate file signatures. Default false.
277
+ * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object.
278
+ */
279
+ public function download_package( $package, $check_signatures = false ) {
280
+
281
+ /**
282
+ * Filters whether to return the package.
283
+ *
284
+ * @since 3.7.0
285
+ *
286
+ * @param bool $reply Whether to bail without returning the package.
287
+ * Default false.
288
+ * @param string $package The package file name.
289
+ * @param WP_Upgrader $this The WP_Upgrader instance.
290
+ */
291
+ $reply = apply_filters( 'upgrader_pre_download', false, $package, $this );
292
+ if ( false !== $reply ) {
293
+ return $reply;
294
+ }
295
+
296
+ if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { //Local file or remote?
297
+ return $package; //must be a local file..
298
+ }
299
+
300
+ if ( empty( $package ) ) {
301
+ return new WP_Error( 'no_package', $this->strings['no_package'] );
302
+ }
303
+
304
+ //$this->skin->feedback( 'downloading_package', $package );
305
+
306
+ $download_file = download_url( $package, 300, $check_signatures );
307
+
308
+ if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) {
309
+ return new WP_Error( 'download_failed', $this->strings['download_failed'], $download_file->get_error_message() );
310
+ }
311
+
312
+ return $download_file;
313
+ }
314
+
315
+ /**
316
+ * Unpack a compressed package file.
317
+ *
318
+ * @since 2.8.0
319
+ *
320
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
321
+ *
322
+ * @param string $package Full path to the package file.
323
+ * @param bool $delete_package Optional. Whether to delete the package file after attempting
324
+ * to unpack it. Default true.
325
+ * @return string|WP_Error The path to the unpacked contents, or a WP_Error on failure.
326
+ */
327
+ public function unpack_package( $package, $delete_package = true ) {
328
+ global $wp_filesystem;
329
+
330
+ //$this->skin->feedback( 'unpack_package' );
331
+
332
+ $upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/';
333
+
334
+ //Clean up contents of upgrade directory beforehand.
335
+ $upgrade_files = $wp_filesystem->dirlist( $upgrade_folder );
336
+ if ( ! empty( $upgrade_files ) ) {
337
+ foreach ( $upgrade_files as $file ) {
338
+ $wp_filesystem->delete( $upgrade_folder . $file['name'], true );
339
+ }
340
+ }
341
+
342
+ // We need a working directory - Strip off any .tmp or .zip suffixes
343
+ $working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' );
344
+
345
+ // Clean up working directory
346
+ if ( $wp_filesystem->is_dir( $working_dir ) ) {
347
+ $wp_filesystem->delete( $working_dir, true );
348
+ }
349
+
350
+ // Unzip package to working directory
351
+ $result = unzip_file( $package, $working_dir );
352
+
353
+ // Once extracted, delete the package if required.
354
+ if ( $delete_package ) {
355
+ unlink( $package );
356
+ }
357
+
358
+ if ( is_wp_error( $result ) ) {
359
+ $wp_filesystem->delete( $working_dir, true );
360
+ if ( 'incompatible_archive' == $result->get_error_code() ) {
361
+ return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $result->get_error_data() );
362
+ }
363
+ return $result;
364
+ }
365
+
366
+ return $working_dir;
367
+ }
368
+
369
+ /**
370
+ * Install a package.
371
+ *
372
+ * Copies the contents of a package form a source directory, and installs them in
373
+ * a destination directory. Optionally removes the source. It can also optionally
374
+ * clear out the destination folder if it already exists.
375
+ *
376
+ * @since 2.8.0
377
+ *
378
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
379
+ * @global array $wp_theme_directories
380
+ *
381
+ * @param array|string $args {
382
+ * Optional. Array or string of arguments for installing a package. Default empty array.
383
+ *
384
+ * @type string $source Required path to the package source. Default empty.
385
+ * @type string $destination Required path to a folder to install the package in.
386
+ * Default empty.
387
+ * @type bool $clear_destination Whether to delete any files already in the destination
388
+ * folder. Default false.
389
+ * @type bool $clear_working Whether to delete the files form the working directory
390
+ * after copying to the destination. Default false.
391
+ * @type bool $abort_if_destination_exists Whether to abort the installation if
392
+ * the destination folder already exists. Default true.
393
+ * @type array $hook_extra Extra arguments to pass to the filter hooks called by
394
+ * WP_Upgrader::install_package(). Default empty array.
395
+ * }
396
+ *
397
+ * @return array|WP_Error The result (also stored in `WP_Upgrader::$result`), or a WP_Error on failure.
398
+ */
399
+ public function install_package( $args = array() ) {
400
+ global $wp_filesystem, $wp_theme_directories;
401
+
402
+ $defaults = array(
403
+ 'source' => '', // Please always pass this
404
+ 'destination' => '', // and this
405
+ 'clear_destination' => false,
406
+ 'clear_working' => false,
407
+ 'abort_if_destination_exists' => true,
408
+ 'hook_extra' => array(),
409
+ );
410
+
411
+ $args = wp_parse_args( $args, $defaults );
412
+
413
+ // These were previously extract()'d.
414
+ $source = $args['source'];
415
+ $destination = $args['destination'];
416
+ $clear_destination = $args['clear_destination'];
417
+
418
+ set_time_limit( 300 );
419
+
420
+ if ( empty( $source ) || empty( $destination ) ) {
421
+ return new WP_Error( 'bad_request', $this->strings['bad_request'] );
422
+ }
423
+ //$this->skin->feedback( 'installing_package' );
424
+
425
+ /**
426
+ * Filters the install response before the installation has started.
427
+ *
428
+ * Returning a truthy value, or one that could be evaluated as a WP_Error
429
+ * will effectively short-circuit the installation, returning that value
430
+ * instead.
431
+ *
432
+ * @since 2.8.0
433
+ *
434
+ * @param bool|WP_Error $response Response.
435
+ * @param array $hook_extra Extra arguments passed to hooked filters.
436
+ */
437
+ $res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );
438
+
439
+ if ( is_wp_error( $res ) ) {
440
+ return $res;
441
+ }
442
+
443
+ //Retain the Original source and destinations
444
+ $remote_source = $args['source'];
445
+ $local_destination = $destination;
446
+
447
+ $source_files = array_keys( $wp_filesystem->dirlist( $remote_source ) );
448
+ $remote_destination = $wp_filesystem->find_folder( $local_destination );
449
+
450
+ //Locate which directory to copy to the new folder, This is based on the actual folder holding the files.
451
+ if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { //Only one folder? Then we want its contents.
452
+ $source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] );
453
+ } elseif ( count( $source_files ) == 0 ) {
454
+ return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files?
455
+ } else { // It's only a single file, the upgrader will use the folder name of this file as the destination folder. Folder name is based on zip filename.
456
+ $source = trailingslashit( $args['source'] );
457
+ }
458
+
459
+ /**
460
+ * Filters the source file location for the upgrade package.
461
+ *
462
+ * @since 2.8.0
463
+ * @since 4.4.0 The $hook_extra parameter became available.
464
+ *
465
+ * @param string $source File source location.
466
+ * @param string $remote_source Remote file source location.
467
+ * @param WP_Upgrader $this WP_Upgrader instance.
468
+ * @param array $hook_extra Extra arguments passed to hooked filters.
469
+ */
470
+ $source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this, $args['hook_extra'] );
471
+
472
+ if ( is_wp_error( $source ) ) {
473
+ return $source;
474
+ }
475
+
476
+ // Has the source location changed? If so, we need a new source_files list.
477
+ if ( $source !== $remote_source ) {
478
+ $source_files = array_keys( $wp_filesystem->dirlist( $source ) );
479
+ }
480
+
481
+ /*
482
+ * Protection against deleting files in any important base directories.
483
+ * Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the
484
+ * destination directory (WP_PLUGIN_DIR / wp-content/themes) intending
485
+ * to copy the directory into the directory, whilst they pass the source
486
+ * as the actual files to copy.
487
+ */
488
+ $protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' );
489
+
490
+ if ( is_array( $wp_theme_directories ) ) {
491
+ $protected_directories = array_merge( $protected_directories, $wp_theme_directories );
492
+ }
493
+
494
+ if ( in_array( $destination, $protected_directories ) ) {
495
+ $remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) );
496
+ $destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) );
497
+ }
498
+
499
+ if ( $clear_destination ) {
500
+ // We're going to clear the destination if there's something there.
501
+ //$this->skin->feedback( 'remove_old' );
502
+
503
+ $removed = $this->clear_destination( $remote_destination );
504
+
505
+ /**
506
+ * Filters whether the upgrader cleared the destination.
507
+ *
508
+ * @since 2.8.0
509
+ *
510
+ * @param mixed $removed Whether the destination was cleared. true on success, WP_Error on failure
511
+ * @param string $local_destination The local package destination.
512
+ * @param string $remote_destination The remote package destination.
513
+ * @param array $hook_extra Extra arguments passed to hooked filters.
514
+ */
515
+ $removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
516
+
517
+ if ( is_wp_error( $removed ) ) {
518
+ return $removed;
519
+ }
520
+ } elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) {
521
+ //If we're not clearing the destination folder and something exists there already, Bail.
522
+ //But first check to see if there are actually any files in the folder.
523
+ $_files = $wp_filesystem->dirlist( $remote_destination );
524
+ if ( ! empty( $_files ) ) {
525
+ $wp_filesystem->delete( $remote_source, true ); //Clear out the source files.
526
+ return new WP_Error( 'folder_exists', $this->strings['folder_exists'], $remote_destination );
527
+ }
528
+ }
529
+
530
+ //Create destination if needed
531
+ if ( ! $wp_filesystem->exists( $remote_destination ) ) {
532
+ if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {
533
+ return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination );
534
+ }
535
+ }
536
+ // Copy new version of item into place.
537
+ $result = copy_dir( $source, $remote_destination );
538
+ if ( is_wp_error( $result ) ) {
539
+ if ( $args['clear_working'] ) {
540
+ $wp_filesystem->delete( $remote_source, true );
541
+ }
542
+ return $result;
543
+ }
544
+
545
+ //Clear the Working folder?
546
+ if ( $args['clear_working'] ) {
547
+ $wp_filesystem->delete( $remote_source, true );
548
+ }
549
+
550
+ $destination_name = basename( str_replace( $local_destination, '', $destination ) );
551
+ if ( '.' == $destination_name ) {
552
+ $destination_name = '';
553
+ }
554
+
555
+ $this->result = compact( 'source', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination' );
556
+
557
+ /**
558
+ * Filters the installation response after the installation has finished.
559
+ *
560
+ * @since 2.8.0
561
+ *
562
+ * @param bool $response Installation response.
563
+ * @param array $hook_extra Extra arguments passed to hooked filters.
564
+ * @param array $result Installation result data.
565
+ */
566
+ $res = apply_filters( 'upgrader_post_install', true, $args['hook_extra'], $this->result );
567
+
568
+ if ( is_wp_error( $res ) ) {
569
+ $this->result = $res;
570
+ return $res;
571
+ }
572
+
573
+ //Bombard the calling function will all the info which we've just used.
574
+ return $this->result;
575
+ }
576
+ }
admin/PluginSilentUpgraderSkin.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
-
3
- namespace CFF\Helpers;
4
-
5
- /** \WP_Upgrader_Skin class */
6
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';
7
-
8
- /**
9
- * Class PluginSilentUpgraderSkin.
10
- *
11
- * @internal Please do not use this class outside of core WPForms development. May be removed at any time.
12
- *
13
- * @since 1.5.6.1
14
- */
15
- class PluginSilentUpgraderSkin extends \WP_Upgrader_Skin {
16
-
17
- /**
18
- * Empty out the header of its HTML content and only check to see if it has
19
- * been performed or not.
20
- *
21
- * @since 1.5.6.1
22
- */
23
- public function header() {
24
- }
25
-
26
- /**
27
- * Empty out the footer of its HTML contents.
28
- *
29
- * @since 1.5.6.1
30
- */
31
- public function footer() {
32
- }
33
-
34
- /**
35
- * Instead of outputting HTML for errors, just return them.
36
- * Ajax request will just ignore it.
37
- *
38
- * @since 1.5.6.1
39
- *
40
- * @param array $errors Array of errors with the install process.
41
- *
42
- * @return array
43
- */
44
- public function error( $errors ) {
45
- return $errors;
46
- }
47
-
48
- /**
49
- * Empty out JavaScript output that calls function to decrement the update counts.
50
- *
51
- * @since 1.5.6.1
52
- *
53
- * @param string $type Type of update count to decrement.
54
- */
55
- public function decrement_update_count( $type ) {
56
- }
57
- }
1
+ <?php
2
+
3
+ namespace CFF\Helpers;
4
+
5
+ /** \WP_Upgrader_Skin class */
6
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';
7
+
8
+ /**
9
+ * Class PluginSilentUpgraderSkin.
10
+ *
11
+ * @internal Please do not use this class outside of core WPForms development. May be removed at any time.
12
+ *
13
+ * @since 1.5.6.1
14
+ */
15
+ class PluginSilentUpgraderSkin extends \WP_Upgrader_Skin {
16
+
17
+ /**
18
+ * Empty out the header of its HTML content and only check to see if it has
19
+ * been performed or not.
20
+ *
21
+ * @since 1.5.6.1
22
+ */
23
+ public function header() {
24
+ }
25
+
26
+ /**
27
+ * Empty out the footer of its HTML contents.
28
+ *
29
+ * @since 1.5.6.1
30
+ */
31
+ public function footer() {
32
+ }
33
+
34
+ /**
35
+ * Instead of outputting HTML for errors, just return them.
36
+ * Ajax request will just ignore it.
37
+ *
38
+ * @since 1.5.6.1
39
+ *
40
+ * @param array $errors Array of errors with the install process.
41
+ *
42
+ * @return array
43
+ */
44
+ public function error( $errors ) {
45
+ return $errors;
46
+ }
47
+
48
+ /**
49
+ * Empty out JavaScript output that calls function to decrement the update counts.
50
+ *
51
+ * @since 1.5.6.1
52
+ *
53
+ * @param string $type Type of update count to decrement.
54
+ */
55
+ public function decrement_update_count( $type ) {
56
+ }
57
+ }
admin/addon-functions.php CHANGED
@@ -1,175 +1,175 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
-
4
- /**
5
- * Deactivate addon.
6
- *
7
- * @since 1.0.0
8
- */
9
- function cff_deactivate_addon() {
10
-
11
- // Run a security check.
12
- check_ajax_referer( 'cff-admin', 'nonce' );
13
-
14
- // Check for permissions.
15
- if ( ! current_user_can( 'manage_instagram_feed_options' ) ) {
16
- wp_send_json_error();
17
- }
18
-
19
- $type = 'addon';
20
- if ( ! empty( $_POST['type'] ) ) {
21
- $type = sanitize_key( $_POST['type'] );
22
- }
23
-
24
- if ( isset( $_POST['plugin'] ) ) {
25
- deactivate_plugins( $_POST['plugin'] );
26
-
27
- if ( 'plugin' === $type ) {
28
- wp_send_json_success( esc_html__( 'Plugin deactivated.', 'custom-facebook-feed' ) );
29
- } else {
30
- wp_send_json_success( esc_html__( 'Addon deactivated.', 'custom-facebook-feed' ) );
31
- }
32
- }
33
-
34
- wp_send_json_error( esc_html__( 'Could not deactivate the addon. Please deactivate from the Plugins page.', 'custom-facebook-feed' ) );
35
- }
36
- add_action( 'wp_ajax_cff_deactivate_addon', 'cff_deactivate_addon' );
37
-
38
- /**
39
- * Activate addon.
40
- *
41
- * @since 1.0.0
42
- */
43
- function cff_activate_addon() {
44
-
45
- // Run a security check.
46
- check_ajax_referer( 'cff-admin', 'nonce' );
47
-
48
- // Check for permissions.
49
- if ( ! current_user_can( 'manage_options' ) ) {
50
- wp_send_json_error();
51
- }
52
-
53
- if ( isset( $_POST['plugin'] ) ) {
54
-
55
- $type = 'addon';
56
- if ( ! empty( $_POST['type'] ) ) {
57
- $type = sanitize_key( $_POST['type'] );
58
- }
59
-
60
- $activate = activate_plugins( $_POST['plugin'] );
61
-
62
- if ( ! is_wp_error( $activate ) ) {
63
- if ( 'plugin' === $type ) {
64
- wp_send_json_success( esc_html__( 'Plugin activated.', 'custom-facebook-feed' ) );
65
- } else {
66
- wp_send_json_success( esc_html__( 'Addon activated.', 'custom-facebook-feed' ) );
67
- }
68
- }
69
- }
70
-
71
- wp_send_json_error( esc_html__( 'Could not activate addon. Please activate from the Plugins page.', 'custom-facebook-feed' ) );
72
- }
73
- add_action( 'wp_ajax_cff_activate_addon', 'cff_activate_addon' );
74
-
75
- /**
76
- * Install addon.
77
- *
78
- * @since 1.0.0
79
- */
80
- function cff_install_addon() {
81
-
82
- // Run a security check.
83
- check_ajax_referer( 'cff-admin', 'nonce' );
84
-
85
- // Check for permissions.
86
- if ( ! current_user_can( 'manage_options' ) ) {
87
- wp_send_json_error();
88
- }
89
-
90
- $error = esc_html__( 'Could not install addon. Please download from smashballoon.com and install manually.', 'custom-facebook-feed' );
91
-
92
- if ( empty( $_POST['plugin'] ) ) {
93
- wp_send_json_error( $error );
94
- }
95
-
96
- // Set the current screen to avoid undefined notices.
97
- set_current_screen( 'cff-about' );
98
-
99
- // Prepare variables.
100
- $url = esc_url_raw(
101
- add_query_arg(
102
- array(
103
- 'page' => 'cff-about',
104
- ),
105
- admin_url( 'admin.php' )
106
- )
107
- );
108
-
109
- $creds = request_filesystem_credentials( $url, '', false, false, null );
110
-
111
- // Check for file system permissions.
112
- if ( false === $creds ) {
113
- wp_send_json_error( $error );
114
- }
115
-
116
- if ( ! WP_Filesystem( $creds ) ) {
117
- wp_send_json_error( $error );
118
- }
119
-
120
- /*
121
- * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
122
- */
123
-
124
- require_once CFF_PLUGIN_DIR . 'admin/class-install-skin.php';
125
-
126
- // Do not allow WordPress to search/download translations, as this will break JS output.
127
- remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
128
-
129
- // Create the plugin upgrader with our custom skin.
130
- $installer = new CFF\Helpers\PluginSilentUpgrader( new CFF_Install_Skin() );
131
-
132
- // Error check.
133
- if ( ! method_exists( $installer, 'install' ) || empty( $_POST['plugin'] ) ) {
134
- wp_send_json_error( $error );
135
- }
136
-
137
- $installer->install( $_POST['plugin'] ); // phpcs:ignore
138
-
139
- // Flush the cache and return the newly installed plugin basename.
140
- wp_cache_flush();
141
-
142
- $plugin_basename = $installer->plugin_info();
143
-
144
- if ( $plugin_basename ) {
145
-
146
- $type = 'addon';
147
- if ( ! empty( $_POST['type'] ) ) {
148
- $type = sanitize_key( $_POST['type'] );
149
- }
150
-
151
- // Activate the plugin silently.
152
- $activated = activate_plugin( $plugin_basename );
153
-
154
- if ( ! is_wp_error( $activated ) ) {
155
- wp_send_json_success(
156
- array(
157
- 'msg' => 'plugin' === $type ? esc_html__( 'Plugin installed & activated.', 'custom-facebook-feed' ) : esc_html__( 'Addon installed & activated.', 'custom-facebook-feed' ),
158
- 'is_activated' => true,
159
- 'basename' => $plugin_basename,
160
- )
161
- );
162
- } else {
163
- wp_send_json_success(
164
- array(
165
- 'msg' => 'plugin' === $type ? esc_html__( 'Plugin installed.', 'custom-facebook-feed' ) : esc_html__( 'Addon installed.', 'custom-facebook-feed' ),
166
- 'is_activated' => false,
167
- 'basename' => $plugin_basename,
168
- )
169
- );
170
- }
171
- }
172
-
173
- wp_send_json_error( $error );
174
- }
175
add_action( 'wp_ajax_cff_install_addon', 'cff_install_addon' );
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ /**
5
+ * Deactivate addon.
6
+ *
7
+ * @since 1.0.0
8
+ */
9
+ function cff_deactivate_addon() {
10
+
11
+ // Run a security check.
12
+ check_ajax_referer( 'cff-admin', 'nonce' );
13
+
14
+ // Check for permissions.
15
+ if ( ! current_user_can( 'manage_instagram_feed_options' ) ) {
16
+ wp_send_json_error();
17
+ }
18
+
19
+ $type = 'addon';
20
+ if ( ! empty( $_POST['type'] ) ) {
21
+ $type = sanitize_key( $_POST['type'] );
22
+ }
23
+
24
+ if ( isset( $_POST['plugin'] ) ) {
25
+ deactivate_plugins( $_POST['plugin'] );
26
+
27
+ if ( 'plugin' === $type ) {
28
+ wp_send_json_success( esc_html__( 'Plugin deactivated.', 'custom-facebook-feed' ) );
29
+ } else {
30
+ wp_send_json_success( esc_html__( 'Addon deactivated.', 'custom-facebook-feed' ) );
31
+ }
32
+ }
33
+
34
+ wp_send_json_error( esc_html__( 'Could not deactivate the addon. Please deactivate from the Plugins page.', 'custom-facebook-feed' ) );
35
+ }
36
+ add_action( 'wp_ajax_cff_deactivate_addon', 'cff_deactivate_addon' );
37
+
38
+ /**
39
+ * Activate addon.
40
+ *
41
+ * @since 1.0.0
42
+ */
43
+ function cff_activate_addon() {
44
+
45
+ // Run a security check.
46
+ check_ajax_referer( 'cff-admin', 'nonce' );
47
+
48
+ // Check for permissions.
49
+ if ( ! current_user_can( 'manage_options' ) ) {
50
+ wp_send_json_error();
51
+ }
52
+
53
+ if ( isset( $_POST['plugin'] ) ) {
54
+
55
+ $type = 'addon';
56
+ if ( ! empty( $_POST['type'] ) ) {
57
+ $type = sanitize_key( $_POST['type'] );
58
+ }
59
+
60
+ $activate = activate_plugins( $_POST['plugin'] );
61
+
62
+ if ( ! is_wp_error( $activate ) ) {
63
+ if ( 'plugin' === $type ) {
64
+ wp_send_json_success( esc_html__( 'Plugin activated.', 'custom-facebook-feed' ) );
65
+ } else {
66
+ wp_send_json_success( esc_html__( 'Addon activated.', 'custom-facebook-feed' ) );
67
+ }
68
+ }
69
+ }
70
+
71
+ wp_send_json_error( esc_html__( 'Could not activate addon. Please activate from the Plugins page.', 'custom-facebook-feed' ) );
72
+ }
73
+ add_action( 'wp_ajax_cff_activate_addon', 'cff_activate_addon' );
74
+
75
+ /**
76
+ * Install addon.
77
+ *
78
+ * @since 1.0.0
79
+ */
80
+ function cff_install_addon() {
81
+
82
+ // Run a security check.
83
+ check_ajax_referer( 'cff-admin', 'nonce' );
84
+
85
+ // Check for permissions.
86
+ if ( ! current_user_can( 'manage_options' ) ) {
87
+ wp_send_json_error();
88
+ }
89
+
90
+ $error = esc_html__( 'Could not install addon. Please download from smashballoon.com and install manually.', 'custom-facebook-feed' );
91
+
92
+ if ( empty( $_POST['plugin'] ) ) {
93
+ wp_send_json_error( $error );
94
+ }
95
+
96
+ // Set the current screen to avoid undefined notices.
97
+ set_current_screen( 'cff-about' );
98
+
99
+ // Prepare variables.
100
+ $url = esc_url_raw(
101
+ add_query_arg(
102
+ array(
103
+ 'page' => 'cff-about',
104
+ ),
105
+ admin_url( 'admin.php' )
106
+ )
107
+ );
108
+
109
+ $creds = request_filesystem_credentials( $url, '', false, false, null );
110
+
111
+ // Check for file system permissions.
112
+ if ( false === $creds ) {
113
+ wp_send_json_error( $error );
114
+ }
115
+
116
+ if ( ! WP_Filesystem( $creds ) ) {
117
+ wp_send_json_error( $error );
118
+ }
119
+
120
+ /*
121
+ * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
122
+ */
123
+
124
+ require_once CFF_PLUGIN_DIR . 'admin/class-install-skin.php';
125
+
126
+ // Do not allow WordPress to search/download translations, as this will break JS output.
127
+ remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
128
+
129
+ // Create the plugin upgrader with our custom skin.
130
+ $installer = new CFF\Helpers\PluginSilentUpgrader( new CFF_Install_Skin() );
131
+
132
+ // Error check.
133
+ if ( ! method_exists( $installer, 'install' ) || empty( $_POST['plugin'] ) ) {
134
+ wp_send_json_error( $error );
135
+ }
136
+
137
+ $installer->install( $_POST['plugin'] ); // phpcs:ignore
138
+
139
+ // Flush the cache and return the newly installed plugin basename.
140
+ wp_cache_flush();
141
+
142
+ $plugin_basename = $installer->plugin_info();
143
+
144
+ if ( $plugin_basename ) {
145
+
146
+ $type = 'addon';
147
+ if ( ! empty( $_POST['type'] ) ) {
148
+ $type = sanitize_key( $_POST['type'] );
149
+ }
150
+
151
+ // Activate the plugin silently.
152
+ $activated = activate_plugin( $plugin_basename );
153
+
154
+ if ( ! is_wp_error( $activated ) ) {
155
+ wp_send_json_success(
156
+ array(
157
+