Plugin Directory

Changeset 3355651


Ignore:
Timestamp:
09/03/2025 08:03:53 PM (7 months ago)
Author:
pinecast
Message:

[2.0.2] Fix for potential issue related to old versions

Location:
pinecast-wp-sync
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pinecast-wp-sync/tags/2.0.2/includes/admin/settings.php

    r3353549 r3355651  
    162162                // code.
    163163                !isset($v['feed_url']) ||
    164                 (substr($v['feed_url'], 0, 7) !== 'http://' && substr($v['feed_url'], 0, 8) !== 'https://') ||
    165                 !isset($v['categories']) || !is_array($v['categories']) ||
    166                 !isset($v['tags']) || !is_array($v['tags'])
     164                (substr($v['feed_url'], 0, 7) !== 'http://' && substr($v['feed_url'], 0, 8) !== 'https://')
    167165            ) {
    168166                continue;
    169167            }
    170168
    171             $podcast = \Pinecast\get_podcast($k) ?: Podcast::create($k, []);
     169            // Ensure required arrays exist
     170            if (!isset($v['categories']) || !is_array($v['categories'])) {
     171                $v['categories'] = array();
     172            }
     173            if (!isset($v['tags']) || !is_array($v['tags'])) {
     174                $v['tags'] = array();
     175            }
     176
     177            // Get existing podcast or create new one
     178            $podcast = \Pinecast\get_podcast($k);
     179            $is_existing = $podcast !== null;
     180            if (!$is_existing) {
     181                $podcast = Podcast::create($k, []);
     182            }
     183           
    172184            $podcast
    173185                ->set_name(
     
    182194                ->set_sync_option($v['sync_option'])
    183195                ->set_author_id(isset($v['author_id']) ? $v['author_id'] : null)
    184                 ->set_player_type(isset($v['player_type']) ? $v['player_type'] : 'minimal')
     196                ->set_player_type(isset($v['player_type']) ? $v['player_type'] : ($is_existing ? 'wordpress' : 'minimal'))
    185197                ->set_import_as_draft(isset($v['import_as_draft']))
    186198                ->update();
  • pinecast-wp-sync/tags/2.0.2/package-lock.json

    r3353555 r3355651  
    11{
    22  "name": "pinecast",
    3   "version": "2.0.1",
     3  "version": "2.0.2",
    44  "lockfileVersion": 2,
    55  "requires": true,
     
    77    "": {
    88      "name": "pinecast",
    9       "version": "2.0.1",
     9      "version": "2.0.2",
    1010      "license": "GPL-2.0-or-later",
    1111      "devDependencies": {
  • pinecast-wp-sync/tags/2.0.2/package.json

    r3353555 r3355651  
    11{
    22  "name": "pinecast",
    3   "version": "2.0.1",
     3  "version": "2.0.2",
    44  "description": "",
    55  "main": "gulpfile.js",
  • pinecast-wp-sync/tags/2.0.2/pinecast.php

    r3353552 r3355651  
    99
    1010        /** @var string Plugin version */
    11         public $version = '2.0.1';
     11        public $version = '2.0.2';
    1212
    1313        /** @var string Main plugin file */
  • pinecast-wp-sync/tags/2.0.2/plugin.php

    r3353552 r3355651  
    44 * Plugin URI:      https://help.pinecast.com/articles/3072843-pinecast-wordpress-sync-plugin
    55 * Description:     Sync your Pinecast podcast episodes from Pinecast to WordPress
    6  * Version:         2.0.1
     6 * Version:         2.0.2
    77 * Author:          Pinecast
    88 * Author URI:      https://pinecast.com
  • pinecast-wp-sync/tags/2.0.2/readme.txt

    r3353552 r3355651  
    44Requires at least: 5.2
    55Tested up to: 6.8.2
    6 Stable tag: 2.0.1
     6Stable tag: 2.0.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
  • pinecast-wp-sync/trunk/includes/admin/settings.php

    r3353549 r3355651  
    162162                // code.
    163163                !isset($v['feed_url']) ||
    164                 (substr($v['feed_url'], 0, 7) !== 'http://' && substr($v['feed_url'], 0, 8) !== 'https://') ||
    165                 !isset($v['categories']) || !is_array($v['categories']) ||
    166                 !isset($v['tags']) || !is_array($v['tags'])
     164                (substr($v['feed_url'], 0, 7) !== 'http://' && substr($v['feed_url'], 0, 8) !== 'https://')
    167165            ) {
    168166                continue;
    169167            }
    170168
    171             $podcast = \Pinecast\get_podcast($k) ?: Podcast::create($k, []);
     169            // Ensure required arrays exist
     170            if (!isset($v['categories']) || !is_array($v['categories'])) {
     171                $v['categories'] = array();
     172            }
     173            if (!isset($v['tags']) || !is_array($v['tags'])) {
     174                $v['tags'] = array();
     175            }
     176
     177            // Get existing podcast or create new one
     178            $podcast = \Pinecast\get_podcast($k);
     179            $is_existing = $podcast !== null;
     180            if (!$is_existing) {
     181                $podcast = Podcast::create($k, []);
     182            }
     183           
    172184            $podcast
    173185                ->set_name(
     
    182194                ->set_sync_option($v['sync_option'])
    183195                ->set_author_id(isset($v['author_id']) ? $v['author_id'] : null)
    184                 ->set_player_type(isset($v['player_type']) ? $v['player_type'] : 'minimal')
     196                ->set_player_type(isset($v['player_type']) ? $v['player_type'] : ($is_existing ? 'wordpress' : 'minimal'))
    185197                ->set_import_as_draft(isset($v['import_as_draft']))
    186198                ->update();
  • pinecast-wp-sync/trunk/package-lock.json

    r3353555 r3355651  
    11{
    22  "name": "pinecast",
    3   "version": "2.0.1",
     3  "version": "2.0.2",
    44  "lockfileVersion": 2,
    55  "requires": true,
     
    77    "": {
    88      "name": "pinecast",
    9       "version": "2.0.1",
     9      "version": "2.0.2",
    1010      "license": "GPL-2.0-or-later",
    1111      "devDependencies": {
  • pinecast-wp-sync/trunk/package.json

    r3353555 r3355651  
    11{
    22  "name": "pinecast",
    3   "version": "2.0.1",
     3  "version": "2.0.2",
    44  "description": "",
    55  "main": "gulpfile.js",
  • pinecast-wp-sync/trunk/pinecast.php

    r3353552 r3355651  
    99
    1010        /** @var string Plugin version */
    11         public $version = '2.0.1';
     11        public $version = '2.0.2';
    1212
    1313        /** @var string Main plugin file */
  • pinecast-wp-sync/trunk/plugin.php

    r3353552 r3355651  
    44 * Plugin URI:      https://help.pinecast.com/articles/3072843-pinecast-wordpress-sync-plugin
    55 * Description:     Sync your Pinecast podcast episodes from Pinecast to WordPress
    6  * Version:         2.0.1
     6 * Version:         2.0.2
    77 * Author:          Pinecast
    88 * Author URI:      https://pinecast.com
  • pinecast-wp-sync/trunk/readme.txt

    r3353552 r3355651  
    44Requires at least: 5.2
    55Tested up to: 6.8.2
    6 Stable tag: 2.0.1
     6Stable tag: 2.0.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.