Skip to content

Commit 41823db

Browse files
authored
Merge branch 'add/module-link-tracker' into FIX/PRESS7-515-remove-action-link
2 parents 992c412 + 248b9a3 commit 41823db

File tree

11 files changed

+104
-25
lines changed

11 files changed

+104
-25
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '4b455cd2f16b1fc7ec6f');
1+
<?php return array('dependencies' => array('lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '2cd71d34c77ef5bc3e3c');

build/performance/performance.min.js

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

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"wp-forge/wp-htaccess-manager": "^1.0",
3838
"wpscholar/url": "^1.2",
3939
"newfold-labs/wp-module-features": "^1.5",
40-
"newfold-labs/wp-module-installer": "^1.6"
40+
"newfold-labs/wp-module-installer": "^1.6",
41+
"newfold-labs/wp-module-link-tracker": "^1.0"
4142
},
4243
"require-dev": {
4344
"newfold-labs/wp-php-standards": "^1.2",

composer.lock

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

includes/HealthChecks/PersistentObjectCacheHealthCheck.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace NewfoldLabs\WP\Module\Performance\HealthChecks;
44

5+
use function NewfoldLabs\WP\Module\LinkTracker\Functions\build_link as buildLink;
56
/**
67
* Health check for persistent object cache.
78
*/

includes/Images/ImageLimitBanner.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace NewfoldLabs\WP\Module\Performance\Images;
44

5+
use function NewfoldLabs\WP\Module\LinkTracker\Functions\build_link as buildLink;
6+
57
/**
68
* Displays admin notices for rate limits and bans in the WP Admin area.
79
*/
@@ -64,7 +66,7 @@ private function display_rate_limit_banner( $rate_limit_time ) {
6466
* Displays the permanent ban banner.
6567
*/
6668
private function display_ban_banner() {
67-
$support_link = admin_url( "admin.php?page={$this->brand}#/help" );
69+
$support_link = buildLink( admin_url( "admin.php?page={$this->brand}#/help" ) );
6870

6971
echo '<div class="notice notice-error">';
7072
echo '<p>';

includes/JetpackBoost/JetpackBoost.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
use NewfoldLabs\WP\Module\Installer\Services\PluginInstaller;
88
use Automattic\Jetpack\My_Jetpack\Products\Boost;
9+
use function NewfoldLabs\WP\Module\LinkTracker\Functions\build_link as buildLink;
10+
911

1012
/**
1113
* Handles link prefetch functionality.
@@ -86,7 +88,7 @@ public function is_jetpackpremium_active() {
8688
*/
8789
public function prefetch_jetpack_boost() {
8890
if ( is_plugin_active( 'jetpack-boost/jetpack-boost.php' ) ) {
89-
$admin_url = admin_url( 'admin.php?page=jetpack-boost' );
91+
$admin_url = buildLink( admin_url( 'admin.php?page=jetpack-boost' ) );
9092
echo '<link rel="prefetch" href="' . esc_url( $admin_url ) . '">' . "\n";
9193
}
9294
}

includes/Performance.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use NewfoldLabs\WP\Module\Performance\Fonts\FontManager;
1515
use NewfoldLabs\WP\Module\Performance\Skip404\Skip404;
1616
use NewfoldLabs\WP\Module\Performance\JetpackBoost\JetpackBoost;
17+
use function NewfoldLabs\WP\Module\LinkTracker\Functions\build_link as buildLink;
1718

1819
use function NewfoldLabs\WP\Module\Performance\get_cache_level;
1920

@@ -241,7 +242,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
241242
'id' => 'nfd_purge_menu-purge_all',
242243
'title' => __( 'Purge All', 'wp-module-performance' ),
243244
'parent' => 'nfd_purge_menu',
244-
'href' => add_query_arg( array( self::PURGE_ALL => true ) ),
245+
'href' => buildLink( add_query_arg( array( self::PURGE_ALL => true ) ) ),
245246
)
246247
);
247248

@@ -251,7 +252,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
251252
'id' => 'nfd_purge_menu-purge_single',
252253
'title' => __( 'Purge This Page', 'wp-module-performance' ),
253254
'parent' => 'nfd_purge_menu',
254-
'href' => add_query_arg( array( self::PURGE_URL => true ) ),
255+
'href' => buildLink( add_query_arg( array( self::PURGE_URL => true ) ) ),
255256
)
256257
);
257258
}
@@ -262,7 +263,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
262263
'id' => 'nfd_purge_menu-cache_settings',
263264
'title' => __( 'Cache Settings', 'wp-module-performance' ),
264265
'parent' => 'nfd_purge_menu',
265-
'href' => admin_url( 'tools.php?page=' . self::PAGE_SLUG ),
266+
'href' => buildLink( admin_url( 'tools.php?page=' . self::PAGE_SLUG ) ),
266267
)
267268
);
268269
}

src/sections/ImageOptimization/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ const ImageOptimization = () => {
237237

238238
const mediaLibraryLink = () => {
239239
const basePath = window.location.pathname.split( '/wp-admin' )[ 0 ];
240-
return `${ window.location.origin }${ basePath }/wp-admin/upload.php?autoSelectBulk`;
240+
const mediaLink = `${ window.location.origin }${ basePath }/wp-admin/upload.php?autoSelectBulk`;
241+
return window.NewfoldRuntime.linkTracker.addUtmParams( mediaLink );
241242
};
242243

243244
const polishEnabled = isCapabilityEnabled( 'hasCloudflarePolish' );

src/sections/JetpackBoost/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const JetpackBoost = () => {
148148
await new Promise( ( resolve ) => setTimeout( resolve, 1000 ) );
149149
const adminUrl = `${ siteUrl }/wp-admin/admin.php?page=jetpack-boost`;
150150
iframe = document.createElement( 'iframe' );
151-
iframe.src = adminUrl;
151+
iframe.src = window.NewfoldRuntime.linkTracker.addUtmParams( adminUrl );
152152
document.body.appendChild( iframe );
153153
iframe.style.height = '0';
154154
iframe.onload = async function () {
@@ -340,7 +340,7 @@ const JetpackBoost = () => {
340340
{ isModuleEnabled && ! isPremiumActive ? (
341341
<FeatureUpsell
342342
cardText={ upgradeModule }
343-
cardLink={ `${ siteUrl }/wp-admin/admin.php?page=my-jetpack#/add-boost` }
343+
cardLink={ window.NewfoldRuntime.linkTracker.addUtmParams( `${ siteUrl }/wp-admin/admin.php?page=my-jetpack#/add-boost` )}
344344
>
345345
{ cssPremiumField }
346346
</FeatureUpsell>

0 commit comments

Comments
 (0)