Plugin Directory

Changeset 3464359


Ignore:
Timestamp:
02/18/2026 01:21:47 PM (6 weeks ago)
Author:
ringier
Message:

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

Location:
ringier-bus/trunk
Files:
6 edited

Legend:

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

    r3453810 r3464359  
    1313* (dependency) Fully remove Guzzle/Symfony dependencies
    1414* (dependency) Fully remove Timber/Twig
     15
     16
     17## [3.6.0] - 2026-02-18 ##
     18
     19### Added ###
     20* (payload) Added `taxon_tags[]` (array of TranslationObject) to the Article payload, populated with all tags associated with the article.
     21  * For standard `post` type: includes the built-in `post_tag` taxonomy.
     22  * For custom post types: includes any non-hierarchical (tag-like) custom taxonomy registered for that post type.
     23
     24### Changed ###
     25* (code) Aligned `ArticlesEvent` date methods (`getOgArticlePublishedDate`, `getOgArticleModifiedDate`) with the 3.5.2 hardening applied to `ArticleEvent`: uses native `WP_Post` properties as source of truth and guards against null/zeroed GMT timestamps with a local-date fallback.
    1526
    1627
  • ringier-bus/trunk/README.md

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

    r3453810 r3464359  
    44Requires at least: 6.0
    55Tested up to: 6.9
    6 Stable tag: 3.5.2
     6Stable tag: 3.6.0
    77Requires PHP: 8.1
    88License: GPLv2 or later
     
    161161
    162162== Changelog ==
     163
     164### [3.6.0] - 2026-02-18 ###
     165
     166#### Added ####
     167* (payload) Added `taxon_tags[]` (array of TranslationObject) to the Article payload, populated with all tags associated with the article.
     168  * For standard `post` type: includes the built-in `post_tag` taxonomy.
     169  * For custom post types: includes any non-hierarchical (tag-like) custom taxonomy registered for that post type.
     170
     171#### Changed ####
     172* (code) Aligned `ArticlesEvent` date methods with the 3.5.2 hardening: uses native `WP_Post` properties as source of truth and guards against null/zeroed GMT timestamps with a local-date fallback.
     173
    163174
    164175### [3.5.2] - 2026-02-04 ###
  • ringier-bus/trunk/ringier-bus.php

    r3453810 r3464359  
    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.2
     13 * Version: 3.6.0
    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.2');
     52define('RINGIER_BUS_PLUGIN_VERSION', '3.6.0');
    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

    r3453810 r3464359  
    250250            'parent_category' => $this->getParentCategoryArray($post_ID),
    251251            'categories' => $this->getAllCategoryListArray($post_ID),
     252            'taxon_tags' => $this->getTaxonTags($post_ID),
    252253            'sailthru_tags' => $this->getSailthruTags($post_ID),
    253254            'sailthru_vars' => $this->getSailthruVars($post_ID),
     
    840841
    841842    /**
     843     * Get all tags associated with a post as TranslationObjects.
     844     *
     845     * For standard posts this includes the built-in `post_tag` taxonomy.
     846     * For custom post types it includes any non-hierarchical (tag-like) custom
     847     * taxonomy registered for that post type, excluding irrelevant ones.
     848     *
     849     * @param int $post_ID
     850     *
     851     * @return array
     852     */
     853    private function getTaxonTags(int $post_ID): array
     854    {
     855        $tags = [];
     856        $post_type = get_post_type($post_ID);
     857        $taxonomies = get_object_taxonomies($post_type, 'objects');
     858
     859        if (empty($taxonomies)) {
     860            return $tags;
     861        }
     862
     863        $blacklist = [
     864            'post_format',
     865            'sailthru_user_type',
     866            'sailthru_user_status',
     867            'sailthru_property_type',
     868            'sailthru_experience_level',
     869            'sailthru_functions',
     870            'content_style',
     871            'content_author',
     872            'article_intent',
     873        ];
     874
     875        foreach ($taxonomies as $taxonomy => $taxonomy_obj) {
     876            // Only process flat (non-hierarchical) taxonomies — i.e. tag-like ones
     877            if ($taxonomy_obj->hierarchical || in_array($taxonomy, $blacklist, true)) {
     878                continue;
     879            }
     880
     881            $terms = get_the_terms($post_ID, $taxonomy);
     882            if (is_wp_error($terms) || empty($terms)) {
     883                continue;
     884            }
     885
     886            foreach ($terms as $term) {
     887                $tags[] = [
     888                    'id' => $term->term_id,
     889                    'title' => [
     890                        [
     891                            'culture' => ringier_getLocale(),
     892                            'value' => $term->name,
     893                        ],
     894                    ],
     895                    'slug' => [
     896                        [
     897                            'culture' => ringier_getLocale(),
     898                            'value' => $term->slug,
     899                        ],
     900                    ],
     901                ];
     902            }
     903        }
     904
     905        return $tags;
     906    }
     907
     908    /**
    842909     * Get all hierarchical taxonomies for the post type
    843910     * This will be used to fetch all terms for the post type
  • ringier-bus/trunk/src/Core/Bus/ArticlesEvent.php

    r3447091 r3464359  
    229229            'parent_category' => $this->getParentCategoryArray($post_ID),
    230230            'categories' => $this->getAllCategoryListArray($post_ID),
     231            'taxon_tags' => $this->getTaxonTags($post_ID),
    231232            'sailthru_tags' => $this->getSailthruTags($post_ID),
    232233            'sailthru_vars' => $this->getSailthruVars($post_ID),
     
    700701     * @return string
    701702     */
    702     private function getOgArticleModifiedDate(int $post_ID, \WP_Post $post)
    703     {
    704         if (class_exists('YoastSEO') && (function_exists('YoastSEO'))) {
    705             $yoast = YoastSEO();
    706             if(isset($yoast->meta) && method_exists($yoast->meta, 'for_post')) {
    707                 return $yoast->meta->for_post($post_ID)->open_graph_article_modified_time;
    708             }
    709         }
    710 
    711         return Utils::formatDate($post->post_modified_gmt);
     703    private function getOgArticleModifiedDate(int $post_ID, \WP_Post $post): string
     704    {
     705        // Ensure we have a valid GMT modified date; fallback to local modified if GMT is empty
     706        $date = !empty($post->post_modified_gmt) && $post->post_modified_gmt !== '0000-00-00 00:00:00'
     707            ? $post->post_modified_gmt
     708            : $post->post_modified;
     709
     710        return Utils::formatDate($date);
    712711    }
    713712
     
    721720     * @return string
    722721     */
    723     private function getOgArticlePublishedDate(int $post_ID, \WP_Post $post)
    724     {
    725         if (class_exists('YoastSEO') && (function_exists('YoastSEO'))) {
    726             $yoast = YoastSEO();
    727             if(isset($yoast->meta) && method_exists($yoast->meta, 'for_post')) {
    728                 return $yoast->meta->for_post($post_ID)->open_graph_article_published_time;
    729             }
    730         }
    731 
    732         return Utils::formatDate($post->post_date_gmt);
     722    private function getOgArticlePublishedDate(int $post_ID, \WP_Post $post): string
     723    {
     724        // Ensure we have a valid GMT date; fallback to local date if GMT is empty
     725        $date = !empty($post->post_date_gmt) && $post->post_date_gmt !== '0000-00-00 00:00:00'
     726            ? $post->post_date_gmt
     727            : $post->post_date;
     728
     729        return Utils::formatDate($date);
    733730    }
    734731
     
    773770
    774771        return get_the_excerpt($post_ID);
     772    }
     773
     774    /**
     775     * Get all tags associated with a post as TranslationObjects.
     776     *
     777     * For standard posts this includes the built-in `post_tag` taxonomy.
     778     * For custom post types it includes any non-hierarchical (tag-like) custom
     779     * taxonomy registered for that post type, excluding irrelevant ones.
     780     *
     781     * @param int $post_ID
     782     *
     783     * @return array
     784     */
     785    private function getTaxonTags(int $post_ID): array
     786    {
     787        $tags = [];
     788        $post_type = get_post_type($post_ID);
     789        $taxonomies = get_object_taxonomies($post_type, 'objects');
     790
     791        if (empty($taxonomies)) {
     792            return $tags;
     793        }
     794
     795        $blacklist = [
     796            'post_format',
     797            'sailthru_user_type',
     798            'sailthru_user_status',
     799            'sailthru_property_type',
     800            'sailthru_experience_level',
     801            'sailthru_functions',
     802            'content_style',
     803            'content_author',
     804            'article_intent',
     805        ];
     806
     807        foreach ($taxonomies as $taxonomy => $taxonomy_obj) {
     808            // Only process flat (non-hierarchical) taxonomies — i.e. tag-like ones
     809            if ($taxonomy_obj->hierarchical || in_array($taxonomy, $blacklist, true)) {
     810                continue;
     811            }
     812
     813            $terms = get_the_terms($post_ID, $taxonomy);
     814            if (is_wp_error($terms) || empty($terms)) {
     815                continue;
     816            }
     817
     818            foreach ($terms as $term) {
     819                $tags[] = [
     820                    'id' => $term->term_id,
     821                    'title' => [
     822                        [
     823                            'culture' => ringier_getLocale(),
     824                            'value' => $term->name,
     825                        ],
     826                    ],
     827                    'slug' => [
     828                        [
     829                            'culture' => ringier_getLocale(),
     830                            'value' => $term->slug,
     831                        ],
     832                    ],
     833                ];
     834            }
     835        }
     836
     837        return $tags;
    775838    }
    776839
Note: See TracChangeset for help on using the changeset viewer.