Plugin Directory

Changeset 3453810


Ignore:
Timestamp:
02/04/2026 01:09:50 PM (2 months ago)
Author:
ringier
Message:

chore: commit changes for v3.5.2 - see CHANGELOG.md

Location:
ringier-bus/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ringier-bus/trunk/CHANGELOG.md

    r3449331 r3453810  
    1313* (dependency) Fully remove Guzzle/Symfony dependencies
    1414* (dependency) Fully remove Timber/Twig
     15
     16
     17## [3.5.2] - 2026-02-04 ##
     18
     19### Changed ###
     20* (code) Refactored `getOgArticlePublishedDate` and `getOgArticleModifiedDate` to use native `WP_Post` properties instead of Yoast SEO Indexables. This ensures the API uses the database "Source of Truth" and avoids data cross-contamination when posts share slugs with historical attachments.
     21* (code) Hardened `Utils::formatDate` to handle null or "zeroed" database timestamps (`0000-00-00 00:00:00`), ensuring strict RFC3339 compliance.
    1522
    1623
  • ringier-bus/trunk/README.md

    r3449331 r3453810  
    77**Requires at least:** 6.0 
    88**Tested up to:** 6.9 
    9 **Stable tag:** 3.5.1 
     9**Stable tag:** 3.5.2 
    1010**Requires PHP:** 8.1 
    1111**License:** GPLv2 or later 
  • ringier-bus/trunk/readme.txt

    r3449331 r3453810  
    44Requires at least: 6.0
    55Tested up to: 6.9
    6 Stable tag: 3.5.1
     6Stable tag: 3.5.2
    77Requires PHP: 8.1
    88License: GPLv2 or later
     
    161161
    162162== Changelog ==
     163
     164### [3.5.2] - 2026-02-04 ###
     165
     166#### Changed ####
     167* (code) Refactored `getOgArticlePublishedDate` and `getOgArticleModifiedDate` to use native `WP_Post` properties instead of Yoast SEO Indexables. This ensures the API uses the database "Source of Truth" and avoids data cross-contamination when posts share slugs with historical attachments.
     168* (code) Hardened `Utils::formatDate` to handle null or "zeroed" database timestamps (`0000-00-00 00:00:00`), ensuring strict RFC3339 compliance.
     169
    163170
    164171### [3.5.1] - 2026-01-29 ###
  • ringier-bus/trunk/ringier-bus.php

    r3449331 r3453810  
    1111 * Plugin URI: https://github.com/RingierIMU/mkt-plugin-wordpress-bus
    1212 * Description: A plugin to push events to Ringier CDE via the BUS API whenever an article is created, updated or deleted
    13  * Version: 3.5.1
     13 * Version: 3.5.2
    1414 * Requires at least: 6.0
    1515 * Author: Ringier SA, Wasseem Khayrattee
     
    5050 */
    5151define('RINGIER_BUS_DS', DIRECTORY_SEPARATOR);
    52 define('RINGIER_BUS_PLUGIN_VERSION', '3.5.1');
     52define('RINGIER_BUS_PLUGIN_VERSION', '3.5.2');
    5353define('RINGIER_BUS_PLUGIN_MINIMUM_WP_VERSION', '6.0');
    5454define('RINGIER_BUS_PLUGIN_DIR_URL', plugin_dir_url(__FILE__)); //has trailing slash at end
  • ringier-bus/trunk/src/Core/Bus/ArticleEvent.php

    r3321163 r3453810  
    774774     * @return string
    775775     */
    776     private function getOgArticleModifiedDate(int $post_ID, \WP_Post $post)
    777     {
    778         if (class_exists('YoastSEO') && (is_object(YoastSEO()))) {
    779             return YoastSEO()->meta->for_post($post_ID)->open_graph_article_modified_time;
    780         }
    781 
    782         return Utils::formatDate($post->post_modified_gmt);
     776    private function getOgArticleModifiedDate(int $post_ID, \WP_Post $post): string
     777    {
     778        // Ensure we have a valid GMT modified date; fallback to local modified if GMT is empty
     779        $date = !empty($post->post_modified_gmt) && $post->post_modified_gmt !== '0000-00-00 00:00:00'
     780            ? $post->post_modified_gmt
     781            : $post->post_modified;
     782
     783        return Utils::formatDate($date);
    783784    }
    784785
     
    792793     * @return string
    793794     */
    794     private function getOgArticlePublishedDate(int $post_ID, \WP_Post $post)
    795     {
    796         if (class_exists('YoastSEO') && (is_object(YoastSEO()))) {
    797             return YoastSEO()->meta->for_post($post_ID)->open_graph_article_published_time;
    798         }
    799 
    800         return Utils::formatDate($post->post_date_gmt);
     795    private function getOgArticlePublishedDate(int $post_ID, \WP_Post $post): string
     796    {
     797        // Ensure we have a valid GMT date; fallback to local date if GMT is empty
     798        $date = !empty($post->post_date_gmt) && $post->post_date_gmt !== '0000-00-00 00:00:00'
     799            ? $post->post_date_gmt
     800            : $post->post_date;
     801
     802        return Utils::formatDate($date);
    801803    }
    802804
  • ringier-bus/trunk/src/Core/Utils.php

    r3447091 r3453810  
    441441     * @return string
    442442     */
    443     public static function formatDate($date, $format = \DATE_RFC3339): string
    444     {
     443    public static function formatDate($date, string $format = \DATE_RFC3339): string
     444    {
     445        // Handle empty or null inputs immediately
     446        if (empty($date) || $date === '0000-00-00 00:00:00') {
     447            return '';
     448        }
     449
    445450        $immutable_date = \date_create_immutable_from_format('Y-m-d H:i:s', $date, new \DateTimeZone('UTC'));
    446451
    447452        if (!$immutable_date) {
    448             return $date;
     453            // Try a generic parse as a final fallback before giving up
     454            try {
     455                $immutable_date = new \DateTimeImmutable($date, new \DateTimeZone('UTC'));
     456            } catch (\Exception $e) {
     457                return $date;
     458            }
    449459        }
    450460
Note: See TracChangeset for help on using the changeset viewer.