Plugin Directory

Changeset 3417951


Ignore:
Timestamp:
12/12/2025 06:56:44 AM (3 months ago)
Author:
crowdaa
Message:

Version 2.2.3

Location:
crowdaa-sync
Files:
5 edited
44 copied

Legend:

Unmodified
Added
Removed
  • crowdaa-sync/tags/2.2.3/CHANGELOG

    r3405179 r3417951  
    77
    88## [Unreleased]
     9
     10## [2.2.3] - 2025-12-12
     11
     12### Changed
     13
     14- Fixed issue during categories synchronization : There was a possibility that an empty/invalid response would accidentally trigger a deletion of all wordpress categories.
    915
    1016## [2.2.2] - 2025-11-28
  • crowdaa-sync/tags/2.2.3/README.txt

    r3405179 r3417951  
    66Requires PHP: 7.3
    77Tested up to: 5.9
    8 Stable tag: 2.2.2
     8Stable tag: 2.2.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • crowdaa-sync/tags/2.2.3/admin/class-crowdaa-sync-add-info-api.php

    r3376210 r3417951  
    378378        'error' => __('API query error : ', CROWDAA_SYNC_PLUGIN_NAME) . $all_categories->message,
    379379      ]);
    380     }
    381 
    382     if ($all_categories->categories) {
    383       foreach ($all_categories->categories as $category) {
    384         if ($category->parentId) {
    385           $category->rootParentId = $category->parentId;
    386         }
    387         $category->isEvent = isset($category->isEvent) ? $category->isEvent : false;
    388         $category->badges = isset($category->badges) ? $category->badges : ((object) ['list' => [], 'allow' => 'any']);
    389         $category->hash = self::hash_category($category);
    390         $category->pictureData = null;
    391         if ($category->picture && isset($category->picture[0]->pictureUrl)) {
    392           $category->pictureData = [
    393             'id' => $category->picture[0]->_id,
    394             'url' => $category->picture[0]->pictureUrl,
    395           ];
    396         }
    397         $categories_by_id[$category->_id] = $category;
    398       }
     380    } else if (!isset($all_categories->categories)) {
     381      return ([
     382        'error' => __('API query error : ', CROWDAA_SYNC_PLUGIN_NAME) . 'Missing "categories" list from the API response!',
     383      ]);
     384    }
     385
     386    foreach ($all_categories->categories as $category) {
     387      if ($category->parentId) {
     388        $category->rootParentId = $category->parentId;
     389      }
     390      $category->isEvent = isset($category->isEvent) ? $category->isEvent : false;
     391      $category->badges = isset($category->badges) ? $category->badges : ((object) ['list' => [], 'allow' => 'any']);
     392      $category->hash = self::hash_category($category);
     393      $category->pictureData = null;
     394      if ($category->picture && isset($category->picture[0]->pictureUrl)) {
     395        $category->pictureData = [
     396          'id' => $category->picture[0]->_id,
     397          'url' => $category->picture[0]->pictureUrl,
     398        ];
     399      }
     400      $categories_by_id[$category->_id] = $category;
     401    }
     402
     403    if (count($synced) > 0 && count($categories_by_id) === 0) {
     404      return ([
     405        'error' => __('API query error : ', CROWDAA_SYNC_PLUGIN_NAME) . 'Found zero API categories but multiple synced ones already, aborting request for safety reasons.',
     406      ]);
    399407    }
    400408
  • crowdaa-sync/tags/2.2.3/admin/class-crowdaa-sync-api.php

    r3405179 r3417951  
    4040      if (isset($json->message)) {
    4141        Crowdaa_Sync_Logs::log('Get categories error', $json->message);
     42        return ((object) [
     43          'message' => $json->message,
     44        ]);
    4245      }
    4346
     
    6568    if (isset($json->message)) {
    6669      Crowdaa_Sync_Logs::log('Get articles error', $json->message);
     70      return ((object) [
     71        'message' => $json->message,
     72      ]);
    6773    }
    6874
     
    8995    if (isset($json->message)) {
    9096      Crowdaa_Sync_Logs::log('Get article error', $json->message);
     97      return ((object) [
     98        'message' => $json->message,
     99      ]);
    91100    }
    92101
  • crowdaa-sync/tags/2.2.3/crowdaa-sync.php

    r3405179 r3417951  
    1414 * Plugin URI:       
    1515 * Description:       Plugin for synchronizing WordPress site and Crowdaa CMS
    16  * Version:           2.2.2
     16 * Version:           2.2.3
    1717 * Requires at least: 5.5
    1818 * Requires PHP:      7.2
     
    3434 * Uses SemVer - https://semver.org
    3535 */
    36 define('CROWDAA_SYNC_VERSION', '2.2.2');
     36define('CROWDAA_SYNC_VERSION', '2.2.3');
    3737define('CROWDAA_SYNC_PLUGIN_DIR', __DIR__);
    3838define('CROWDAA_SYNC_PLUGIN_NAME', 'crowdaa-sync');
  • crowdaa-sync/trunk/CHANGELOG

    r3405179 r3417951  
    77
    88## [Unreleased]
     9
     10## [2.2.3] - 2025-12-12
     11
     12### Changed
     13
     14- Fixed issue during categories synchronization : There was a possibility that an empty/invalid response would accidentally trigger a deletion of all wordpress categories.
    915
    1016## [2.2.2] - 2025-11-28
  • crowdaa-sync/trunk/README.txt

    r3405179 r3417951  
    66Requires PHP: 7.3
    77Tested up to: 5.9
    8 Stable tag: 2.2.2
     8Stable tag: 2.2.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • crowdaa-sync/trunk/admin/class-crowdaa-sync-add-info-api.php

    r3376210 r3417951  
    378378        'error' => __('API query error : ', CROWDAA_SYNC_PLUGIN_NAME) . $all_categories->message,
    379379      ]);
    380     }
    381 
    382     if ($all_categories->categories) {
    383       foreach ($all_categories->categories as $category) {
    384         if ($category->parentId) {
    385           $category->rootParentId = $category->parentId;
    386         }
    387         $category->isEvent = isset($category->isEvent) ? $category->isEvent : false;
    388         $category->badges = isset($category->badges) ? $category->badges : ((object) ['list' => [], 'allow' => 'any']);
    389         $category->hash = self::hash_category($category);
    390         $category->pictureData = null;
    391         if ($category->picture && isset($category->picture[0]->pictureUrl)) {
    392           $category->pictureData = [
    393             'id' => $category->picture[0]->_id,
    394             'url' => $category->picture[0]->pictureUrl,
    395           ];
    396         }
    397         $categories_by_id[$category->_id] = $category;
    398       }
     380    } else if (!isset($all_categories->categories)) {
     381      return ([
     382        'error' => __('API query error : ', CROWDAA_SYNC_PLUGIN_NAME) . 'Missing "categories" list from the API response!',
     383      ]);
     384    }
     385
     386    foreach ($all_categories->categories as $category) {
     387      if ($category->parentId) {
     388        $category->rootParentId = $category->parentId;
     389      }
     390      $category->isEvent = isset($category->isEvent) ? $category->isEvent : false;
     391      $category->badges = isset($category->badges) ? $category->badges : ((object) ['list' => [], 'allow' => 'any']);
     392      $category->hash = self::hash_category($category);
     393      $category->pictureData = null;
     394      if ($category->picture && isset($category->picture[0]->pictureUrl)) {
     395        $category->pictureData = [
     396          'id' => $category->picture[0]->_id,
     397          'url' => $category->picture[0]->pictureUrl,
     398        ];
     399      }
     400      $categories_by_id[$category->_id] = $category;
     401    }
     402
     403    if (count($synced) > 0 && count($categories_by_id) === 0) {
     404      return ([
     405        'error' => __('API query error : ', CROWDAA_SYNC_PLUGIN_NAME) . 'Found zero API categories but multiple synced ones already, aborting request for safety reasons.',
     406      ]);
    399407    }
    400408
  • crowdaa-sync/trunk/admin/class-crowdaa-sync-api.php

    r3405179 r3417951  
    4040      if (isset($json->message)) {
    4141        Crowdaa_Sync_Logs::log('Get categories error', $json->message);
     42        return ((object) [
     43          'message' => $json->message,
     44        ]);
    4245      }
    4346
     
    6568    if (isset($json->message)) {
    6669      Crowdaa_Sync_Logs::log('Get articles error', $json->message);
     70      return ((object) [
     71        'message' => $json->message,
     72      ]);
    6773    }
    6874
     
    8995    if (isset($json->message)) {
    9096      Crowdaa_Sync_Logs::log('Get article error', $json->message);
     97      return ((object) [
     98        'message' => $json->message,
     99      ]);
    91100    }
    92101
  • crowdaa-sync/trunk/crowdaa-sync.php

    r3405179 r3417951  
    1414 * Plugin URI:       
    1515 * Description:       Plugin for synchronizing WordPress site and Crowdaa CMS
    16  * Version:           2.2.2
     16 * Version:           2.2.3
    1717 * Requires at least: 5.5
    1818 * Requires PHP:      7.2
     
    3434 * Uses SemVer - https://semver.org
    3535 */
    36 define('CROWDAA_SYNC_VERSION', '2.2.2');
     36define('CROWDAA_SYNC_VERSION', '2.2.3');
    3737define('CROWDAA_SYNC_PLUGIN_DIR', __DIR__);
    3838define('CROWDAA_SYNC_PLUGIN_NAME', 'crowdaa-sync');
Note: See TracChangeset for help on using the changeset viewer.