Skip to content

Commit e8ee0ce

Browse files
authored
Merge pull request #285 from newfold-labs/add/module-link-tracker
Implement wp-module-link-tracker features across different URLs
2 parents 3733c19 + 12d8b5b commit e8ee0ce

File tree

10 files changed

+18
-21
lines changed

10 files changed

+18
-21
lines changed

bootstrap.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function () {
3838
}
3939
);
4040
}
41-
4241
new CacheFeatureHooks();
4342

4443
require_once __DIR__ . '/includes/BurstSafetyMode/init.php';
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
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(
2+
'dependencies' => array( 'lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n' ),
3+
'version' => '11d04f72fe03b2aa1166',
4+
);

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.lock

Lines changed: 3 additions & 3 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: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ public function __construct() {
1515
$this->passing_text = esc_html__( 'Object caching is enabled', 'wp-module-performance' );
1616
$this->failing_text = esc_html__( 'Object caching is disabled', 'wp-module-performance' );
1717
$this->description = esc_html__( 'Object caching saves results from frequent database queries, reducing load times by avoiding repetitive query processing. Object caching is available in all tiers of Bluehost Cloud.', 'wp-module-performance' );
18-
$this->actions = sprintf(
19-
'<a href="%1$s" target="_blank" rel="noopener">%2$s</a><span class="screen-reader-text"> (%3$s)</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
20-
'https://www.bluehost.com/help/article/object-caching',
21-
esc_html__( 'Learn more about object caching', 'wp-module-performance' ),
22-
__( 'opens in a new tab', 'wp-module-performance' )
23-
);
2418
}
2519

2620
/**

includes/Images/ImageLimitBanner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private function display_rate_limit_banner( $rate_limit_time ) {
6464
* Displays the permanent ban banner.
6565
*/
6666
private function display_ban_banner() {
67-
$support_link = admin_url( "admin.php?page={$this->brand}#/help" );
67+
$support_link = apply_filters( 'nfd_build_url', admin_url( "admin.php?page={$this->brand}#/help" ) );
6868

6969
echo '<div class="notice notice-error">';
7070
echo '<p>';

includes/JetpackBoost/JetpackBoost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function is_jetpackpremium_active() {
8686
*/
8787
public function prefetch_jetpack_boost() {
8888
if ( is_plugin_active( 'jetpack-boost/jetpack-boost.php' ) ) {
89-
$admin_url = admin_url( 'admin.php?page=jetpack-boost' );
89+
$admin_url = apply_filters( 'nfd_build_url', admin_url( 'admin.php?page=jetpack-boost' ) );
9090
echo '<link rel="prefetch" href="' . esc_url( $admin_url ) . '">' . "\n";
9191
}
9292
}

includes/Performance.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
241241
'id' => 'nfd_purge_menu-purge_all',
242242
'title' => __( 'Purge All', 'wp-module-performance' ),
243243
'parent' => 'nfd_purge_menu',
244-
'href' => add_query_arg( array( self::PURGE_ALL => true ) ),
244+
'href' => apply_filters( 'nfd_build_url', add_query_arg( array( self::PURGE_ALL => true ) ) ),
245245
)
246246
);
247247

@@ -251,7 +251,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
251251
'id' => 'nfd_purge_menu-purge_single',
252252
'title' => __( 'Purge This Page', 'wp-module-performance' ),
253253
'parent' => 'nfd_purge_menu',
254-
'href' => add_query_arg( array( self::PURGE_URL => true ) ),
254+
'href' => apply_filters( 'nfd_build_url', add_query_arg( array( self::PURGE_URL => true ) ) ),
255255
)
256256
);
257257
}
@@ -262,7 +262,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
262262
'id' => 'nfd_purge_menu-cache_settings',
263263
'title' => __( 'Cache Settings', 'wp-module-performance' ),
264264
'parent' => 'nfd_purge_menu',
265-
'href' => admin_url( 'tools.php?page=' . self::PAGE_SLUG ),
265+
'href' => apply_filters( 'nfd_build_url', admin_url( 'tools.php?page=' . self::PAGE_SLUG ) ),
266266
)
267267
);
268268
}

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 ) || 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 ) || 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` ) || `${ siteUrl }/wp-admin/admin.php?page=my-jetpack#/add-boost` }
344344
>
345345
{ cssPremiumField }
346346
</FeatureUpsell>

0 commit comments

Comments
 (0)