diff --git a/CHANGELOG.md b/CHANGELOG.md index 7364bfbe00..abedd044e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.19.1](https://github.com/Parsely/wp-parsely/compare/3.19.0...3.19.1) - 2025-05-21 + +### Fixed + +- Make some caching checks more flexible ([#3351](https://github.com/Parsely/wp-parsely/pull/3351)) + ## [3.19.0](https://github.com/Parsely/wp-parsely/compare/3.18.1...3.19.0) - 2025-05-20 ### Added diff --git a/README.md b/README.md index c9a30e5c9b..031fc7f2fb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Parse.ly -Stable tag: 3.19.0 +Stable tag: 3.19.1 Requires at least: 6.0 Tested up to: 6.8 Requires PHP: 7.2 diff --git a/package-lock.json b/package-lock.json index ee52d36c49..5d9cf41de6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wp-parsely", - "version": "3.19.0", + "version": "3.19.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wp-parsely", - "version": "3.19.0", + "version": "3.19.1", "license": "GPL-2.0-or-later", "dependencies": { "@types/js-cookie": "^3.0.6", diff --git a/package.json b/package.json index 97f071cdd0..d79b6c882c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wp-parsely", - "version": "3.19.0", + "version": "3.19.1", "private": true, "description": "The Parse.ly plugin facilitates real-time and historical analytics to your content through a platform designed and built for digital publishing.", "author": "parsely, hbbtstar, jblz, mikeyarce, GaryJ, parsely_mike, acicovic, mehmoodak, vaurdan", diff --git a/src/Models/class-inbound-smart-link.php b/src/Models/class-inbound-smart-link.php index 6aaeed898c..0456db84d4 100644 --- a/src/Models/class-inbound-smart-link.php +++ b/src/Models/class-inbound-smart-link.php @@ -1069,9 +1069,8 @@ public static function get_suggestions_count( int $post_id ): int { $cache_key = self::get_suggestions_count_cache_key( $post_id ); $count = wp_cache_get( $cache_key, PARSELY_CACHE_GROUP ); - if ( false !== $count ) { - /** @var int $count */ - return $count; + if ( false !== $count && is_numeric( $count ) ) { + return (int) $count; } $args = array( diff --git a/src/Models/class-smart-link.php b/src/Models/class-smart-link.php index df48c2ac4d..212b1d4ba3 100644 --- a/src/Models/class-smart-link.php +++ b/src/Models/class-smart-link.php @@ -196,8 +196,9 @@ public function __construct( private function get_smart_link_object_by_uid( string $uid ): int { $cache_key = self::get_uid_to_smart_link_cache_key( $uid ); $cached = wp_cache_get( $cache_key, PARSELY_CACHE_GROUP ); - if ( is_int( $cached ) && 0 !== $cached ) { - return $cached; + + if ( false !== $cached && is_numeric( $cached ) ) { + return (int) $cached; } $smart_links = new \WP_Query( @@ -1097,8 +1098,7 @@ public static function get_link_counts( int $post_id, string $status = Smart_Lin $cache_group = self::get_smart_links_post_cache_group( $post_id ); $link_counts = wp_cache_get( $cache_key, $cache_group ); - if ( false !== $link_counts ) { - /** @var array */ + if ( false !== $link_counts && is_array( $link_counts ) ) { return $link_counts; } diff --git a/src/Utils/class-utils.php b/src/Utils/class-utils.php index d5b9789da5..625337c9af 100644 --- a/src/Utils/class-utils.php +++ b/src/Utils/class-utils.php @@ -430,8 +430,8 @@ public static function get_post_id_by_url( string $url ): int { $cache_key = sprintf( 'url-to-postid-%s', hash( 'sha256', $url ) ); $cache = wp_cache_get( $cache_key, PARSELY_CACHE_GROUP ); - if ( is_integer( $cache ) ) { - return $cache; + if ( false !== $cache && is_numeric( $cache ) ) { + return (int) $cache; } if ( function_exists( 'wpcom_vip_url_to_postid' ) ) { diff --git a/tests/e2e/utils.ts b/tests/e2e/utils.ts index cfc0669367..4e4e236415 100644 --- a/tests/e2e/utils.ts +++ b/tests/e2e/utils.ts @@ -8,7 +8,7 @@ import { type Page } from '@playwright/test'; */ import { Admin } from '@wordpress/e2e-test-utils-playwright'; -export const PLUGIN_VERSION = '3.19.0'; +export const PLUGIN_VERSION = '3.19.1'; export const VALID_SITE_ID = 'demoaccount.parsely.com'; export const INVALID_SITE_ID = 'invalid.parsely.com'; export const VALID_API_SECRET = 'valid_api_secret'; diff --git a/wp-parsely.php b/wp-parsely.php index 59ab597308..848871c6ff 100644 --- a/wp-parsely.php +++ b/wp-parsely.php @@ -11,7 +11,7 @@ * Plugin Name: Parse.ly * Plugin URI: https://docs.parse.ly/wordpress * Description: This plugin makes it a snap to add Parse.ly tracking code and metadata to your WordPress blog. - * Version: 3.19.0 + * Version: 3.19.1 * Author: Parse.ly * Author URI: https://www.parse.ly * Text Domain: wp-parsely @@ -49,7 +49,7 @@ return; } -const PARSELY_VERSION = '3.19.0'; +const PARSELY_VERSION = '3.19.1'; const PARSELY_FILE = __FILE__; const PARSELY_DATA_SCHEMA_VERSION = '1'; const PARSELY_CACHE_GROUP = 'wp-parsely';