Skip to content

Implement wp-module-link-tracker features across different URLs #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
1 change: 0 additions & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ function () {
}
);
}

new CacheFeatureHooks();

require_once __DIR__ . '/includes/BurstSafetyMode/init.php';
5 changes: 4 additions & 1 deletion build/performance/performance.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<?php return array('dependencies' => array('lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '4b455cd2f16b1fc7ec6f');
<?php return array(
'dependencies' => array( 'lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n' ),
'version' => '11d04f72fe03b2aa1166',
);
4 changes: 2 additions & 2 deletions build/performance/performance.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions composer.lock

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

6 changes: 0 additions & 6 deletions includes/HealthChecks/PersistentObjectCacheHealthCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ public function __construct() {
$this->passing_text = esc_html__( 'Object caching is enabled', 'wp-module-performance' );
$this->failing_text = esc_html__( 'Object caching is disabled', 'wp-module-performance' );
$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' );
$this->actions = sprintf(
'<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>',
'https://www.bluehost.com/help/article/object-caching',
esc_html__( 'Learn more about object caching', 'wp-module-performance' ),
__( 'opens in a new tab', 'wp-module-performance' )
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/Images/ImageLimitBanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private function display_rate_limit_banner( $rate_limit_time ) {
* Displays the permanent ban banner.
*/
private function display_ban_banner() {
$support_link = admin_url( "admin.php?page={$this->brand}#/help" );
$support_link = apply_filters( 'nfd_build_url', admin_url( "admin.php?page={$this->brand}#/help" ) );

echo '<div class="notice notice-error">';
echo '<p>';
Expand Down
2 changes: 1 addition & 1 deletion includes/JetpackBoost/JetpackBoost.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function is_jetpackpremium_active() {
*/
public function prefetch_jetpack_boost() {
if ( is_plugin_active( 'jetpack-boost/jetpack-boost.php' ) ) {
$admin_url = admin_url( 'admin.php?page=jetpack-boost' );
$admin_url = apply_filters( 'nfd_build_url', admin_url( 'admin.php?page=jetpack-boost' ) );
echo '<link rel="prefetch" href="' . esc_url( $admin_url ) . '">' . "\n";
}
}
Expand Down
6 changes: 3 additions & 3 deletions includes/Performance.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
'id' => 'nfd_purge_menu-purge_all',
'title' => __( 'Purge All', 'wp-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => add_query_arg( array( self::PURGE_ALL => true ) ),
'href' => apply_filters( 'nfd_build_url', add_query_arg( array( self::PURGE_ALL => true ) ) ),
)
);

Expand All @@ -251,7 +251,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
'id' => 'nfd_purge_menu-purge_single',
'title' => __( 'Purge This Page', 'wp-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => add_query_arg( array( self::PURGE_URL => true ) ),
'href' => apply_filters( 'nfd_build_url', add_query_arg( array( self::PURGE_URL => true ) ) ),
)
);
}
Expand All @@ -262,7 +262,7 @@ public function admin_bar_menu( \WP_Admin_Bar $wp_admin_bar ) {
'id' => 'nfd_purge_menu-cache_settings',
'title' => __( 'Cache Settings', 'wp-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => admin_url( 'tools.php?page=' . self::PAGE_SLUG ),
'href' => apply_filters( 'nfd_build_url', admin_url( 'tools.php?page=' . self::PAGE_SLUG ) ),
)
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/sections/ImageOptimization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ const ImageOptimization = () => {

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

const polishEnabled = isCapabilityEnabled( 'hasCloudflarePolish' );
Expand Down
4 changes: 2 additions & 2 deletions src/sections/JetpackBoost/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const JetpackBoost = () => {
await new Promise( ( resolve ) => setTimeout( resolve, 1000 ) );
const adminUrl = `${ siteUrl }/wp-admin/admin.php?page=jetpack-boost`;
iframe = document.createElement( 'iframe' );
iframe.src = adminUrl;
iframe.src = window.NewfoldRuntime?.linkTracker?.addUtmParams( adminUrl ) || adminUrl;
document.body.appendChild( iframe );
iframe.style.height = '0';
iframe.onload = async function () {
Expand Down Expand Up @@ -340,7 +340,7 @@ const JetpackBoost = () => {
{ isModuleEnabled && ! isPremiumActive ? (
<FeatureUpsell
cardText={ upgradeModule }
cardLink={ `${ siteUrl }/wp-admin/admin.php?page=my-jetpack#/add-boost` }
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` }
>
{ cssPremiumField }
</FeatureUpsell>
Expand Down
Loading