Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7d1a57a
build(deps-dev): bump node-forge from 1.3.2 to 1.4.0
dependabot[bot] Mar 30, 2026
68d2b21
Merge pull request #4103 from Parsely/trunk
acicovic Mar 30, 2026
a275444
Merge branch 'develop' into dependabot/npm_and_yarn/node-forge-1.4.0
acicovic Mar 30, 2026
bce8837
Merge pull request #4101 from Parsely/dependabot/npm_and_yarn/node-fo…
acicovic Mar 30, 2026
1aad012
feat: add wp_parsely_tracker_url filter and custom tracker URL settin…
Copilot Apr 1, 2026
cf8b28f
build(deps-dev): bump lodash-es from 4.17.23 to 4.18.1
dependabot[bot] Apr 2, 2026
affa096
Merge pull request #4132 from Parsely/dependabot/npm_and_yarn/lodash-…
acicovic Apr 2, 2026
372c2da
build(deps-dev): bump lodash from 4.17.23 to 4.18.1
dependabot[bot] Apr 2, 2026
dbf06dd
Merge pull request #4133 from Parsely/dependabot/npm_and_yarn/lodash-…
acicovic Apr 2, 2026
4084030
refactor: keep only wp_parsely_tracker_url filter, remove option/UI m…
Copilot Apr 2, 2026
90125a6
Merge branch 'develop' into copilot/fix-issue-4107
jblz Apr 2, 2026
d64d833
Update post list stats column to use icons
acicovic Apr 3, 2026
a4bc623
Merge pull request #4136 from Parsely/update/post-list-stats-icon-dis…
acicovic Apr 6, 2026
41fe48b
Merge branch 'develop' into copilot/fix-issue-4107
acicovic Apr 6, 2026
4a5394f
Update since tags
acicovic Apr 6, 2026
21b63ec
get_tracker_url(): Use esc_url_raw()
acicovic Apr 6, 2026
42549d1
Merge pull request #4108 from Parsely/copilot/fix-issue-4107
acicovic Apr 6, 2026
543a9aa
Update wp-parsely version number to 3.23.0
github-actions[bot] Apr 6, 2026
fbaac39
Update CHANGELOG.md for version 3.23.0
github-actions[bot] Apr 6, 2026
ca6af12
Merge pull request #4138 from Parsely/update/wp-parsely-version-to-3.…
acicovic Apr 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ 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.23.0](https://github.com/Parsely/wp-parsely/compare/3.22.1...3.23.0) - 2026-04-06

### Added

- Add `wp_parsely_tracker_url` filter ([#4108](https://github.com/Parsely/wp-parsely/pull/4108))

### Changed

- Update post list stats column to use icons ([#4136](https://github.com/Parsely/wp-parsely/pull/4136))

### Dependency Updates

- 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.23.0+label%3ADeps).

## [3.22.1](https://github.com/Parsely/wp-parsely/compare/3.22.0...3.22.1) - 2026-03-30

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Parse.ly

Stable tag: 3.22.1
Stable tag: 3.23.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Expand Down
2 changes: 1 addition & 1 deletion build/content-helper/post-list-stats-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/content-helper/post-list-stats.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '150ace49707b05c46bdb');
<?php return array('dependencies' => array('wp-i18n'), 'version' => '0f380989aa4951c0833b');
2 changes: 1 addition & 1 deletion build/content-helper/post-list-stats.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion build/content-helper/post-list-stats.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-parsely",
"version": "3.22.1",
"version": "3.23.0",
"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",
Expand Down Expand Up @@ -94,7 +94,7 @@
"express": "^4.22.0",
"glob": "^10.5.0",
"js-yaml@^3": "3.14.2",
"node-forge": "^1.3.2",
"node-forge": "^1.4.0",
"puppeteer-core": "^23.1.0",
"qs": "^6.14.1"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/class-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public static function get_formatted_time( $seconds ): string {
return esc_html(
sprintf(
/* translators: 1: Number of seconds */
__( '%1$d sec.', 'wp-parsely' ),
__( '%1$ds', 'wp-parsely' ),
round( $seconds )
)
);
Expand Down
13 changes: 12 additions & 1 deletion src/class-parsely.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,19 @@ public function get_rest_api_controller(): REST_API_Controller {
public function get_tracker_url(): string {
if ( $this->site_id_is_set() ) {
$tracker_url = 'https://cdn.parsely.com/keys/' . $this->get_site_id() . '/p.js';
return esc_url( $tracker_url );

/**
* Filters the URL of the Parse.ly tracker script.
*
* The filtered value gets sanitized with {@see esc_url_raw()}.
*
* @since 3.23.0
*
* @param string $tracker_url The URL of the tracker script.
*/
return esc_url_raw( apply_filters( 'wp_parsely_tracker_url', $tracker_url ) );
}

return '';
}

Expand Down
12 changes: 6 additions & 6 deletions src/content-helper/post-list-stats/class-post-list-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function enqueue_parsely_stats_styles(): void {
wp_enqueue_style(
static::get_style_id(),
$built_assets_url . 'post-list-stats.css',
$admin_settings_asset['dependencies'],
array(),
$admin_settings_asset['version']
);
}
Expand All @@ -177,7 +177,7 @@ public function enqueue_parsely_stats_styles(): void {
*/
public function add_parsely_stats_column_on_list_view( array $columns ): array {
if ( $this->is_tracked_as_post_type() ) {
$columns['parsely-stats'] = __( 'Parse.ly Stats (7d)', 'wp-parsely' );
$columns['parsely-stats'] = __( 'Parse.ly (7d)', 'wp-parsely' );
}

return $columns;
Expand Down Expand Up @@ -210,7 +210,7 @@ public function update_published_times_and_show_placeholder( string $column_name
$stats_key = $this->get_unique_stats_key_of_current_post();
?>
<div class="parsely-post-stats" data-stats-key="<?php echo esc_attr( $stats_key ); ?>">
<span class="parsely-post-stats-placeholder">...</span>
<span class="parsely-post-stats-placeholder"></span>
</div>
<?php
}
Expand Down Expand Up @@ -349,9 +349,9 @@ public function get_parsely_stats_response(): ?array {
* @var Parsely_Post_Stats $stats
*/
$stats = array(
'page_views' => Utils::get_formatted_number( (string) $views ) . ' ' . _n( 'page view', 'page views', $views, 'wp-parsely' ),
'visitors' => Utils::get_formatted_number( (string) $visitors ) . ' ' . _n( 'visitor', 'visitors', $visitors, 'wp-parsely' ),
'avg_time' => Utils::get_formatted_time( $engaged_seconds ) . ' ' . __( 'avg time', 'wp-parsely' ),
'page_views' => Utils::get_formatted_number( (string) $views ),
'visitors' => Utils::get_formatted_number( (string) $visitors ),
'avg_time' => Utils::get_formatted_time( $engaged_seconds ),
);

$parsely_stats_map[ $key ] = $stats;
Expand Down
27 changes: 17 additions & 10 deletions src/content-helper/post-list-stats/post-list-stats.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
.column-parsely-stats {
width: 200px;

@media only screen and (max-width: 991px) {
width: 150px;
}

.parsely-post-stats {
color: #959da5;
cursor: default;
display: flex;
flex-wrap: wrap;
gap: 2px 8px;
min-height: 54px;
line-height: 18px;
}

.parsely-post-stats-placeholder {
color: #959da5;
letter-spacing: 2px;
}

.parsely-post-page-views {
color: #000;
.parsely-post-page-views,
.parsely-post-visitors,
.parsely-post-avg-time {
display: flex;
align-items: center;
gap: 4px;

.dashicons {
font-size: 16px;
width: 16px;
height: 16px;
}
}
}
38 changes: 35 additions & 3 deletions src/content-helper/post-list-stats/post-list-stats.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { __, sprintf } from '@wordpress/i18n';
import { ParselyAPIError, ParselyAPIErrorInfo } from './common.interface';

export interface ParselyPostsStatsResponse extends ParselyAPIError {
Expand Down Expand Up @@ -71,19 +72,50 @@ function showParselyStats( parselyStatsMap: ParselyStatsMap ): void {
statsElement.innerHTML = '';

if ( stats.page_views ) {
statsElement.innerHTML += `<span class="parsely-post-page-views">${ stats.page_views }</span><br/>`;
statsElement.innerHTML += getStatSpan(
'parsely-post-page-views', 'visibility',
/* translators: %s: number of page views */
sprintf( __( 'Page views: %s', 'wp-parsely' ), stats.page_views ),
stats.page_views
);
}

if ( stats.visitors ) {
statsElement.innerHTML += `<span class="parsely-post-visitors">${ stats.visitors }</span><br/>`;
statsElement.innerHTML += getStatSpan(
'parsely-post-visitors', 'groups',
/* translators: %s: number of visitors */
sprintf( __( 'Visitors: %s', 'wp-parsely' ), stats.visitors ),
stats.visitors
);
}

if ( stats.avg_time ) {
statsElement.innerHTML += `<span class="parsely-post-avg-time">${ stats.avg_time }</span><br/>`;
statsElement.innerHTML += getStatSpan(
'parsely-post-avg-time', 'clock',
/* translators: %s: average time spent on post */
sprintf( __( 'Avg. time: %s', 'wp-parsely' ), stats.avg_time ),
stats.avg_time
);
}
} );
}

/**
* Gets HTML for a single stat metric span with an icon and screen-reader label.
*
* @param {string} className CSS class for the outer span.
* @param {string} dashicon Dashicon class name (without `dashicons` prefix).
* @param {string} srText Full screen reader text (including the value).
* @param {string} value The metric value to display visually.
*/
function getStatSpan( className: string, dashicon: string, srText: string, value: string ): string {
return `<span class="${ className }">` +
`<span class="dashicons dashicons-${ dashicon }" aria-hidden="true"></span>` +
`<span class="screen-reader-text">${ srText }</span>` +
`<span aria-hidden="true">${ value }</span>` +
`</span>`;
}

/**
* Shows Parse.ly Stats error as a wp-admin error notice.
*
Expand Down
Loading
Loading