Version Description
(2021-07-23) =
Fixed - Fixed an error on the "Widgets" page for WordPress version 5.8 - Fixed a PHP notice when clearing the cache if the thumbnails folder does not exist - The original image would not be deleted after optimization if an error occurs
Download this release
Release Info
Developer | Mekku |
Plugin | Spotlight Social Media Feeds |
Version | 0.9.1 |
Comparing to | |
See all releases |
Code changes from version 0.9 to 0.9.1
- core/Engine/Aggregator/IgAggregationStrategy.php +9 -3
- core/Engine/IgPostStore.php +15 -5
- core/Engine/Store/ThumbnailStore.php +5 -5
- core/Utils/Files.php +5 -1
- modules/UiModule.php +3 -3
- plugin.json +1 -1
- plugin.php +2 -2
- readme.txt +9 -2
- vendor/autoload.php +1 -1
- vendor/composer/autoload_psr4.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +6 -6
core/Engine/Aggregator/IgAggregationStrategy.php
CHANGED
@@ -39,9 +39,15 @@ class IgAggregationStrategy implements AggregationStrategy
|
|
39 |
if ($count === null) {
|
40 |
$numPosts = $feed->get('numPosts');
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
return new Query($feed->sources, null, null, $count, $offset);
|
39 |
if ($count === null) {
|
40 |
$numPosts = $feed->get('numPosts');
|
41 |
|
42 |
+
if (is_array($numPosts)) {
|
43 |
+
$desktop = intval($numPosts['desktop'] ?? 9);
|
44 |
+
$tablet = intval($numPosts['tablet'] ?? 0);
|
45 |
+
$phone = intval($numPosts['phone'] ?? 0);
|
46 |
+
|
47 |
+
$count = (int) max($desktop, $tablet, $phone);
|
48 |
+
} else {
|
49 |
+
$count = (int) $numPosts;
|
50 |
+
}
|
51 |
}
|
52 |
|
53 |
return new Query($feed->sources, null, null, $count, $offset);
|
core/Engine/IgPostStore.php
CHANGED
@@ -54,12 +54,22 @@ class IgPostStore implements Store
|
|
54 |
|
55 |
$postData = $this->itemToPostData($item);
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
60 |
|
61 |
if (is_wp_error($result)) {
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
$insertedId = (int) $result;
|
@@ -254,7 +264,7 @@ class IgPostStore implements Store
|
|
254 |
$thumbnails = $post->{MediaPostType::THUMBNAILS};
|
255 |
$thumbnails = is_array($thumbnails) ? $thumbnails : [];
|
256 |
$thumbnails = Arrays::map($thumbnails, function ($url) {
|
257 |
-
return is_ssl()
|
258 |
? preg_replace('#^http://#', 'https://', $url, 1)
|
259 |
: $url;
|
260 |
});
|
54 |
|
55 |
$postData = $this->itemToPostData($item);
|
56 |
|
57 |
+
if ($item->localId === null) {
|
58 |
+
$result = wp_insert_post($postData, true);
|
59 |
+
} else {
|
60 |
+
$postData['ID'] = $item->localId;
|
61 |
+
$result = wp_update_post($postData, true);
|
62 |
+
}
|
63 |
|
64 |
if (is_wp_error($result)) {
|
65 |
+
global $wpdb;
|
66 |
+
|
67 |
+
$message = $result->get_error_message();
|
68 |
+
if (!empty($wpdb->last_error)) {
|
69 |
+
$message .= ' ' . $wpdb->last_error;
|
70 |
+
}
|
71 |
+
|
72 |
+
throw new StoreException($message, $this);
|
73 |
}
|
74 |
|
75 |
$insertedId = (int) $result;
|
264 |
$thumbnails = $post->{MediaPostType::THUMBNAILS};
|
265 |
$thumbnails = is_array($thumbnails) ? $thumbnails : [];
|
266 |
$thumbnails = Arrays::map($thumbnails, function ($url) {
|
267 |
+
return (is_ssl() && is_string($url))
|
268 |
? preg_replace('#^http://#', 'https://', $url, 1)
|
269 |
: $url;
|
270 |
});
|
core/Engine/Store/ThumbnailStore.php
CHANGED
@@ -89,15 +89,15 @@ class ThumbnailStore
|
|
89 |
$newThumbnails[static::SIZE_LARGE] = IgImageProxy::getUrl($item->get(MediaItem::SHORTCODE), 'l');
|
90 |
}
|
91 |
|
92 |
-
// Then remove the original file
|
93 |
-
if (file_exists($localImg)) {
|
94 |
-
@unlink($localImg);
|
95 |
-
}
|
96 |
-
|
97 |
// Update the item's thumbnail map
|
98 |
$item = $item->with(MediaItem::THUMBNAILS, $newThumbnails);
|
99 |
} catch (Exception $exception) {
|
100 |
// do nothing
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
102 |
|
103 |
// Use proxy image URLs for the original media URLs
|
89 |
$newThumbnails[static::SIZE_LARGE] = IgImageProxy::getUrl($item->get(MediaItem::SHORTCODE), 'l');
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
|
|
92 |
// Update the item's thumbnail map
|
93 |
$item = $item->with(MediaItem::THUMBNAILS, $newThumbnails);
|
94 |
} catch (Exception $exception) {
|
95 |
// do nothing
|
96 |
+
} finally {
|
97 |
+
// Remove the original file
|
98 |
+
if (file_exists($localImg)) {
|
99 |
+
@unlink($localImg);
|
100 |
+
}
|
101 |
}
|
102 |
|
103 |
// Use proxy image URLs for the original media URLs
|
core/Utils/Files.php
CHANGED
@@ -18,7 +18,11 @@ class Files
|
|
18 |
*/
|
19 |
public static function rmDirRecursive(string $path)
|
20 |
{
|
21 |
-
$dir = opendir($path);
|
|
|
|
|
|
|
|
|
22 |
while (false !== ($file = readdir($dir))) {
|
23 |
if (($file != '.') && ($file != '..')) {
|
24 |
$full = $path . '/' . $file;
|
18 |
*/
|
19 |
public static function rmDirRecursive(string $path)
|
20 |
{
|
21 |
+
$dir = @opendir($path);
|
22 |
+
if (!is_resource($dir)) {
|
23 |
+
return;
|
24 |
+
}
|
25 |
+
|
26 |
while (false !== ($file = readdir($dir))) {
|
27 |
if (($file != '.') && ($file != '..')) {
|
28 |
$full = $path . '/' . $file;
|
modules/UiModule.php
CHANGED
@@ -207,11 +207,11 @@ class UiModule extends Module
|
|
207 |
'sli-common',
|
208 |
'sli-feed',
|
209 |
'sli-layouts',
|
210 |
-
'dashicons'
|
211 |
-
'wp-edit-post',
|
212 |
]),
|
213 |
'sli-admin' => Asset::style("{$url}/admin-app.css", $ver, [
|
214 |
-
'sli-admin-common'
|
|
|
215 |
]),
|
216 |
'sli-editor' => Asset::style("{$url}/feed-editor.css", $ver, [
|
217 |
'sli-admin-common',
|
207 |
'sli-common',
|
208 |
'sli-feed',
|
209 |
'sli-layouts',
|
210 |
+
'dashicons'
|
|
|
211 |
]),
|
212 |
'sli-admin' => Asset::style("{$url}/admin-app.css", $ver, [
|
213 |
+
'sli-admin-common',
|
214 |
+
'wp-edit-post',
|
215 |
]),
|
216 |
'sli-editor' => Asset::style("{$url}/feed-editor.css", $ver, [
|
217 |
'sli-admin-common',
|
plugin.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
"name": "Spotlight - Social Media Feeds",
|
3 |
"description": "Easily embed beautiful Instagram feeds on your WordPress site.",
|
4 |
-
"version": "0.9",
|
5 |
"url": "https://spotlightwp.com",
|
6 |
"author": "RebelCode",
|
7 |
"authorUrl": "https://rebelcode.com",
|
1 |
{
|
2 |
"name": "Spotlight - Social Media Feeds",
|
3 |
"description": "Easily embed beautiful Instagram feeds on your WordPress site.",
|
4 |
+
"version": "0.9.1",
|
5 |
"url": "https://spotlightwp.com",
|
6 |
"author": "RebelCode",
|
7 |
"authorUrl": "https://rebelcode.com",
|
plugin.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* Plugin Name: Spotlight - Social Media Feeds
|
7 |
* Description: Easily embed beautiful Instagram feeds on your WordPress site.
|
8 |
-
* Version: 0.9
|
9 |
* Author: RebelCode
|
10 |
* Plugin URI: https://spotlightwp.com
|
11 |
* Author URI: https://rebelcode.com
|
@@ -80,7 +80,7 @@ $bootstrapper = function (SlInstaRuntime $sli) use ($thisIsPro) {
|
|
80 |
// The plugin name
|
81 |
define('SL_INSTA_NAME', 'Spotlight - Social Media Feeds');
|
82 |
// The plugin version
|
83 |
-
define('SL_INSTA_VERSION', '0.9');
|
84 |
// The path to the plugin's main file
|
85 |
define('SL_INSTA_FILE', __FILE__);
|
86 |
// The dir to the plugin's directory
|
5 |
*
|
6 |
* Plugin Name: Spotlight - Social Media Feeds
|
7 |
* Description: Easily embed beautiful Instagram feeds on your WordPress site.
|
8 |
+
* Version: 0.9.1
|
9 |
* Author: RebelCode
|
10 |
* Plugin URI: https://spotlightwp.com
|
11 |
* Author URI: https://rebelcode.com
|
80 |
// The plugin name
|
81 |
define('SL_INSTA_NAME', 'Spotlight - Social Media Feeds');
|
82 |
// The plugin version
|
83 |
+
define('SL_INSTA_VERSION', '0.9.1');
|
84 |
// The path to the plugin's main file
|
85 |
define('SL_INSTA_FILE', __FILE__);
|
86 |
// The dir to the plugin's directory
|
readme.txt
CHANGED
@@ -5,8 +5,8 @@ Plugin URI: https://spotlightwp.com
|
|
5 |
Tags: Instagram, Instagram feed, Instagram feeds, Instagram widget, Instagram embed, social media, social media feed, social media feeds, IGTV, Instagram gallery, Instagram stories, hashtag
|
6 |
Requires at least: 5.0
|
7 |
Requires PHP: 7.1
|
8 |
-
Tested up to: 5.
|
9 |
-
Stable tag: 0.9
|
10 |
License: GPLv3
|
11 |
|
12 |
Instagram feeds for your WordPress site. A simple no-code solution to embed your Instagram account anywhere on your website in seconds.
|
@@ -270,6 +270,13 @@ There are a few reasons that this may happen. We have documented the reasons and
|
|
270 |
|
271 |
== Changelog ==
|
272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
= 0.9 (2021-07-20) =
|
274 |
|
275 |
**Added**
|
5 |
Tags: Instagram, Instagram feed, Instagram feeds, Instagram widget, Instagram embed, social media, social media feed, social media feeds, IGTV, Instagram gallery, Instagram stories, hashtag
|
6 |
Requires at least: 5.0
|
7 |
Requires PHP: 7.1
|
8 |
+
Tested up to: 5.8
|
9 |
+
Stable tag: 0.9.1
|
10 |
License: GPLv3
|
11 |
|
12 |
Instagram feeds for your WordPress site. A simple no-code solution to embed your Instagram account anywhere on your website in seconds.
|
270 |
|
271 |
== Changelog ==
|
272 |
|
273 |
+
= 0.9.1 (2021-07-23) =
|
274 |
+
|
275 |
+
**Fixed**
|
276 |
+
- Fixed an error on the "Widgets" page for WordPress version 5.8
|
277 |
+
- Fixed a PHP notice when clearing the cache if the thumbnails folder does not exist
|
278 |
+
- The original image would not be deleted after optimization if an error occurs
|
279 |
+
|
280 |
= 0.9 (2021-07-20) =
|
281 |
|
282 |
**Added**
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit9643bd0666c54f23e09721d376328b14::getLoader();
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -15,7 +15,7 @@ return array(
|
|
15 |
'RebelCode\\Iris\\' => array($vendorDir . '/rebelcode/iris-engine/src'),
|
16 |
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
17 |
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
18 |
-
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-
|
19 |
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
|
20 |
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
21 |
'Liborm85\\ComposerVendorCleaner\\' => array($vendorDir . '/liborm85/composer-vendor-cleaner/src'),
|
15 |
'RebelCode\\Iris\\' => array($vendorDir . '/rebelcode/iris-engine/src'),
|
16 |
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
17 |
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
18 |
+
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
|
19 |
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
|
20 |
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
21 |
'Liborm85\\ComposerVendorCleaner\\' => array($vendorDir . '/liborm85/composer-vendor-cleaner/src'),
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit9e76b71a309102d5237da63214fd9069
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit9e76b71a309102d5237da63214fd9069
|
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
-
$includeFiles = Composer\Autoload\
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
-
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
-
function
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit9643bd0666c54f23e09721d376328b14
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit9643bd0666c54f23e09721d376328b14', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit9643bd0666c54f23e09721d376328b14', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit9643bd0666c54f23e09721d376328b14::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit9643bd0666c54f23e09721d376328b14::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequire9643bd0666c54f23e09721d376328b14($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
function composerRequire9643bd0666c54f23e09721d376328b14($fileIdentifier, $file)
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
@@ -93,8 +93,8 @@ class ComposerStaticInit9e76b71a309102d5237da63214fd9069
|
|
93 |
),
|
94 |
'Psr\\Http\\Message\\' =>
|
95 |
array (
|
96 |
-
0 => __DIR__ . '/..' . '/psr/http-
|
97 |
-
1 => __DIR__ . '/..' . '/psr/http-
|
98 |
),
|
99 |
'Psr\\Http\\Client\\' =>
|
100 |
array (
|
@@ -530,9 +530,9 @@ class ComposerStaticInit9e76b71a309102d5237da63214fd9069
|
|
530 |
public static function getInitializer(ClassLoader $loader)
|
531 |
{
|
532 |
return \Closure::bind(function () use ($loader) {
|
533 |
-
$loader->prefixLengthsPsr4 =
|
534 |
-
$loader->prefixDirsPsr4 =
|
535 |
-
$loader->classMap =
|
536 |
|
537 |
}, null, ClassLoader::class);
|
538 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit9643bd0666c54f23e09721d376328b14
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
93 |
),
|
94 |
'Psr\\Http\\Message\\' =>
|
95 |
array (
|
96 |
+
0 => __DIR__ . '/..' . '/psr/http-factory/src',
|
97 |
+
1 => __DIR__ . '/..' . '/psr/http-message/src',
|
98 |
),
|
99 |
'Psr\\Http\\Client\\' =>
|
100 |
array (
|
530 |
public static function getInitializer(ClassLoader $loader)
|
531 |
{
|
532 |
return \Closure::bind(function () use ($loader) {
|
533 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit9643bd0666c54f23e09721d376328b14::$prefixLengthsPsr4;
|
534 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit9643bd0666c54f23e09721d376328b14::$prefixDirsPsr4;
|
535 |
+
$loader->classMap = ComposerStaticInit9643bd0666c54f23e09721d376328b14::$classMap;
|
536 |
|
537 |
}, null, ClassLoader::class);
|
538 |
}
|