Skip to content

Commit 17e2e7f

Browse files
committed
Update to 2.1.1
* Fix depricated classes for PHP 8.2 * Clear code
1 parent 8604fc1 commit 17e2e7f

File tree

13 files changed

+23
-19
lines changed

13 files changed

+23
-19
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## Download
1717

18-
[JUPWA v 2.0.0](https://github.com/Joomla-Ukraine/JUPWA/releases/download/2.0.0/pkg_jupwa_v2.0.0.zip)
18+
[JUPWA v 2.1.1](https://github.com/Joomla-Ukraine/JUPWA/releases/download/2.1.1/pkg_jupwa_v2.1.1.zip)
1919

2020
## Integration
2121

build.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
basedir=".">
44

55
<property name="VERSION"
6-
value="2.1.0" />
6+
value="2.1.1" />
77
<property name="JOOMLA"
88
value="4.0" />
99

packages/plg_jupwa_content/content.php

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
defined('_JEXEC') or die;
2121

22+
#[AllowDynamicProperties]
2223
class PlgJUPWAContent extends CMSPlugin
2324
{
2425
/**

packages/plg_jupwa_jshopping/jshopping.php

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
defined('_JEXEC') or die;
2323

24+
#[AllowDynamicProperties]
2425
class PlgJUPWAJShopping extends CMSPlugin
2526
{
2627
/**

packages/plg_jupwa_seblod/seblod.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
require_once __DIR__ . '/SeblodAPI.php';
2424

25+
#[AllowDynamicProperties]
2526
class PlgJUPWASeblod extends CMSPlugin
2627
{
2728
/**
@@ -350,14 +351,14 @@ private function seblod($id, $attr = null): bool|array
350351
{
351352
$descriptions = json_decode($this->loaded[ $contentType . '_' . $client . '_options' ][ 'metadesc' ]);
352353
$lang_tag = $lang->getTag();
353-
$this->loaded[ $contentType . '_' . $client . '_options' ][ 'metadesc' ] = (isset($descriptions->$lang_tag)) ? $descriptions->$lang_tag : '';
354+
$this->loaded[ $contentType . '_' . $client . '_options' ][ 'metadesc' ] = $descriptions->$lang_tag ?? '';
354355
}
355356

356357
if(isset($this->loaded[ $contentType . '_' . $client . '_options' ][ 'title' ]) && $this->loaded[ $contentType . '_' . $client . '_options' ][ 'title' ] != '' && $this->loaded[ $contentType . '_' . $client . '_options' ][ 'title' ][ 0 ] == '{')
357358
{
358359
$titles = json_decode($this->loaded[ $contentType . '_' . $client . '_options' ][ 'title' ]);
359360
$lang_tag = $lang->getTag();
360-
$this->loaded[ $contentType . '_' . $client . '_options' ][ 'title' ] = (isset($titles->$lang_tag)) ? $titles->$lang_tag : '';
361+
$this->loaded[ $contentType . '_' . $client . '_options' ][ 'title' ] = $titles->$lang_tag ?? '';
361362
}
362363
}
363364

packages/plg_system_jupwa/jupwa.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333

3434
require_once __DIR__ . '/libraries/vendor/autoload.php';
3535

36-
/**
37-
* JUPWA System Plugin.
38-
*
39-
* @since 1.0
40-
*/
36+
#[AllowDynamicProperties]
4137
class plgSystemJUPWA extends CMSPlugin
4238
{
4339
/**

packages/plg_system_jupwa/libraries/src/Classes/PHP_ICO.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public function _add_image_data($im): void
294294
public function _load_image_file($file)
295295
{
296296
// Run a cheap check to verify that it is an image file.
297-
if(($size = getimagesize($file)) === false || ($file_data = file_get_contents($file)) === false || ($im = imagecreatefromstring($file_data)) === false)
297+
if(($file_data = file_get_contents($file)) === false || ($im = imagecreatefromstring($file_data)) === false)
298298
{
299299
return false;
300300
}

packages/plg_system_jupwa/libraries/src/Data/Data.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ class Data
174174
'handle_links' => '',
175175
'launch_handler' => [],
176176
'scope_extensions' => [],
177-
'edge_side_panel' => []
177+
'edge_side_panel' => [],
178+
'author' => [
179+
'name' => 'Joomla! Ukraine',
180+
'website' => 'https://joomla-ua.org',
181+
'github' => 'https://github.com/Joomla-Ukraine/JUPWA'
182+
]
178183
];
179184

180185
public static array $assetlinks = [
@@ -230,6 +235,6 @@ class Data
230235
'https://jnn-pa.googleapis.com',
231236
],
232237
'facebook' => [ 'https://graph.facebook.com' ],
233-
'twitter' => [ 'https://dn.api.twitter.com' ],
238+
'twitter' => [ 'https://platform.twitter.com' ],
234239
];
235240
}

packages/plg_system_jupwa/libraries/src/Helpers/Facebook.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function fix(): bool
5858
}
5959
}
6060

61-
if(($app->get('gzip', 0) == 1) && $unsupported === true)
61+
if($app->get('gzip', 0) == 1 && $unsupported === true)
6262
{
6363
$app->set('gzip', 0);
6464
}

packages/plg_system_jupwa/libraries/src/Helpers/Folders.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function files($path): array
4141
continue;
4242
}
4343

44-
if(preg_match('/\.(jpg|jpeg|png|gif)/', strtolower($currentFile)))
44+
if(preg_match('/\.(jpg|jpeg|png|gif|webp)/', strtolower($currentFile)))
4545
{
4646
$file = $path . '/' . $currentFile;
4747
$files[] = trim($file, '/');

packages/plg_system_jupwa/libraries/src/Thumbs/Render.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function image(string $image): string
118118
* @throws \Exception
119119
* @since 1.0
120120
*/
121-
public static function og_default(array $option = [])
121+
public static function og_default(array $option = []): \Intervention\Image\Image|string
122122
{
123123
$source = 'media/jupwa/image/jupwa.png';
124124
$out = 'favicons/og_cover.png';

packages/plg_system_jupwa/libraries/vendor/composer/installed.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => 'joomla-ua/jupwa',
44
'pretty_version' => 'dev-main',
55
'version' => 'dev-main',
6-
'reference' => '5f0f9ac7e96875b971e24d984a70f900f450accb',
6+
'reference' => '8604fc1a57b8a717874e58106271f4e0d59601b0',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -31,7 +31,7 @@
3131
'joomla-ua/jupwa' => array(
3232
'pretty_version' => 'dev-main',
3333
'version' => 'dev-main',
34-
'reference' => '5f0f9ac7e96875b971e24d984a70f900f450accb',
34+
'reference' => '8604fc1a57b8a717874e58106271f4e0d59601b0',
3535
'type' => 'library',
3636
'install_path' => __DIR__ . '/../../',
3737
'aliases' => array(),

packages/plg_system_jupwa/tmpl/sw.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
?>
2020
const CACHE = 'jupwa-pages';
21+
const offlineFallbackPage = "/offline.php";
2122

2223
importScripts('<?php echo $data->workbox; ?>');
2324

@@ -27,8 +28,6 @@
2728
const {ExpirationPlugin} = workbox.expiration;
2829
const {precacheAndRoute, matchPrecache} = workbox.precaching;
2930

30-
const offlineFallbackPage = "/offline.php";
31-
3231
self.addEventListener("message", (event) => {
3332
if (event.data && event.data.type === "SKIP_WAITING") {
3433
self.skipWaiting();
@@ -102,6 +101,7 @@
102101
statuses: [0, 200]
103102
}),
104103
new ExpirationPlugin({
104+
maxEntries: 100,
105105
maxAgeSeconds: 30 * 24 * 60 * 60,
106106
purgeOnQuotaError: true
107107
})

0 commit comments

Comments
 (0)