Skip to content

Commit 9a40103

Browse files
authored
Merge pull request #2726 from Parsely/prepare/3.16.4-release
Release wp-parsely 3.16.4
2 parents 5c89a4f + 2d2f093 commit 9a40103

File tree

7 files changed

+41
-25
lines changed

7 files changed

+41
-25
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.16.4](https://github.com/Parsely/wp-parsely/compare/3.16.3...3.16.4) - 2024-08-21
9+
10+
### Fixed
11+
12+
- Fix current_user_can_use_pch_feature() issues ([#2723](https://github.com/Parsely/wp-parsely/pull/2723))
13+
14+
### Dependency Updates
15+
16+
- The list of all dependency updates for this release is available [here](https://github.com/Parsely/wp-parsely/pulls?q=is%3Apr+is%3Amerged+milestone%3A3.16.4+label%3A%22Component%3A+Dependencies%22).
17+
818
## [3.16.3](https://github.com/Parsely/wp-parsely/compare/3.16.2...3.16.3) - 2024-08-08
919

1020
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Parse.ly
22

3-
Stable tag: 3.16.3
3+
Stable tag: 3.16.4
44
Requires at least: 5.2
55
Tested up to: 6.5
66
Requires PHP: 7.2

package-lock.json

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wp-parsely",
3-
"version": "3.16.3",
3+
"version": "3.16.4",
44
"private": true,
55
"description": "The Parse.ly plugin facilitates real-time and historical analytics to your content through a platform designed and built for digital publishing.",
66
"author": "parsely, hbbtstar, jblz, mikeyarce, GaryJ, parsely_mike, acicovic, mehmoodak, vaurdan",

src/class-permissions.php

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,6 @@ public static function current_user_can_use_pch_feature(
7070
return false;
7171
}
7272

73-
// All AI features are disabled.
74-
if ( true !== $pch_options['ai_features_enabled'] ) {
75-
return false;
76-
}
77-
78-
// The specific AI feature is disabled.
79-
if ( true !== $feature_options['enabled'] ) {
80-
return false;
81-
}
82-
8373
$current_user = wp_get_current_user();
8474
$user_roles = $current_user->roles;
8575

@@ -91,21 +81,38 @@ public static function current_user_can_use_pch_feature(
9181
*
9282
* @since 3.16.2
9383
*
94-
* @param bool $current_user_can_use_pch_feature Whether the current user can use the feature.
84+
* @param ?bool $current_user_can_use_pch_feature Whether the current user can use the feature.
85+
* Is null when the filter isn't being used.
9586
* @param string $feature_name The feature's name.
9687
* @param \WP_User $current_user The current user object.
9788
* @param int|false $post_id The post ID, if the check is for a specific post.
9889
*/
9990
$filtered_current_user_can_use_pch_feature = apply_filters(
10091
'wp_parsely_current_user_can_use_pch_feature',
101-
false,
92+
null,
10293
$feature_name,
10394
$current_user,
10495
$post_id
10596
);
10697

107-
if ( true === $filtered_current_user_can_use_pch_feature ) {
108-
return true;
98+
// When $wp_parsely_current_user_can_use_pch_feature's value is set,
99+
// return it without further processing.
100+
if ( null !== $filtered_current_user_can_use_pch_feature ) {
101+
if ( true === $filtered_current_user_can_use_pch_feature ) {
102+
return true;
103+
}
104+
105+
return false;
106+
}
107+
108+
// All AI features are disabled.
109+
if ( true !== $pch_options['ai_features_enabled'] ) {
110+
return false;
111+
}
112+
113+
// The specific AI feature is disabled.
114+
if ( true !== $feature_options['enabled'] ) {
115+
return false;
109116
}
110117

111118
// Current user's role is not yet set.

tests/e2e/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
visitAdminPage,
99
} from '@wordpress/e2e-test-utils';
1010

11-
export const PLUGIN_VERSION = '3.16.3';
11+
export const PLUGIN_VERSION = '3.16.4';
1212
export const VALID_SITE_ID = 'demoaccount.parsely.com';
1313
export const INVALID_SITE_ID = 'invalid.parsely.com';
1414
export const VALID_API_SECRET = 'valid_api_secret';

wp-parsely.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Plugin Name: Parse.ly
1212
* Plugin URI: https://docs.parse.ly/wordpress
1313
* Description: This plugin makes it a snap to add Parse.ly tracking code and metadata to your WordPress blog.
14-
* Version: 3.16.3
14+
* Version: 3.16.4
1515
* Author: Parse.ly
1616
* Author URI: https://www.parse.ly
1717
* Text Domain: wp-parsely
@@ -70,7 +70,7 @@
7070
return;
7171
}
7272

73-
const PARSELY_VERSION = '3.16.3';
73+
const PARSELY_VERSION = '3.16.4';
7474
const PARSELY_FILE = __FILE__;
7575

7676
require_once __DIR__ . '/src/Models/class-base-model.php';

0 commit comments

Comments
 (0)