X02 џџџџквЖа `v02 D Hinweis: Diese Konfiguration bezieht sich auf die Darstellungsart "kleine Icons".
links
Elemente werden am Anfang des Containers positioniert.
rechts
Elemente werden am Ende des Containers positioniert.
zentriert
Die Elemente befinden sich in der Mitte des Containers.
space-between
Elemente werden gleichmУЄУig verteilt. Das erste Element an den Start, das letzte an das Ende.
space-around
Elemente werden gleichmУЄУig verteilt. Alle Elemente haben gleiche AbstУЄnde um sie herum. џџџџ џџџџџџџџ џџџџ џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ џџџџџџџџ џџџџџџџџџџџџџџџџџџџџџџџџ џџџџ џџџџџџџџ Ш02 џџџџЅ5и1 v02 802 џџџџSg3йчx02 @w02 џџџџН| w02 02 џџџџBW1 `w02 p02 џџџџРљSїR w02 Ј02 џџџџІУРќцЈ02 а02 џџџџ< `z02 я.2 џџџџа)1 z02 02 џџџџквЖа z02 D Hinweis: Diese Konfiguration bezieht sich auf die Darstellungsart "groУe Icons".
links
Elemente werden am Anfang des Containers positioniert.
rechts
Elemente werden am Ende des Containers positioniert.
zentriert
Die Elemente befinden sich in der Mitte des Containers.
space-between
Elemente werden gleichmУЄУig verteilt. Das erste Element an den Start, das letzte an das Ende.
space-around
Elemente werden gleichmУЄУig verteilt. Alle Elemente haben gleiche AbstУЄnde um sie herum. џџџџ џџџџџџџџ џџџџ џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ џџџџџџџџ џџџџџџџџџџџџџџџџџџџџџџџџ џџџџ џџџџџџџџ 02 џџџџЅ5и1 Рz02 ј02 џџџџSg3йчј02 {02 џџџџН| `{02 02 џџџџBW1 {02 002 џџџџРљSїR Р{02 (
02 џџџџІУРќц(
02 P
02 џџџџ< ~02 02 џџџџа)1 Р~02 а02 џџџџквЖа р~02 џџџџ џџџџџџџџ џџџџ џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ џџџџџџџџ џџџџџџџџџџџџџџџџџџџџџџџџ џџџџ џџџџџџџџ 802 џџџџЅ5и1 Л02 Ј02 џџџџSg3йч02 РЛ02 џџџџН| Л02 М02 џџџџBW1 рЛ02 р02 џџџџРљSїR М02 (02 џџџџІУРќц(02 P02 џџџџ< рН02 PЄ02 џџџџа)1 О02 Є02 џџџџквЖа О02 џџџџ џџџџџџџџ џџџџ џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ џџџџџџџџ џџџџџџџџџџџџџџџџџџџџџџџџ џџџџ џџџџџџџџ 8 12 џџџџЅ5и1 @О02 Ј 12 џџџџSg3йчШ02 П02 џџџџН| рО02
џџџџBW1 П02 р 12 џџџџРљSїR @П02 02 џџџџІУРќц02 @02 џџџџ< РП02 рЄ02 џџџџа)1 рП02 Ѕ02 џџџџквЖа 012 *
* @return void
*/
public function localize_optin_status(): void {
if ( ! current_user_can( 'rocket_manage_options' ) ) {
return;
}
// Get the license email and hash it for privacy.
$consumer_email = $this->options->get( 'consumer_email', '' );
$hashed_email = ! empty( $consumer_email ) ? $this->mixpanel->hash( $consumer_email ) : '';
wp_localize_script(
'wpr-admin-common',
'rocket_mixpanel_data',
[
'optin_enabled' => $this->optin->is_enabled() ? true : false,
'plugin' => 'wp rocket ' . rocket_get_constant( 'WP_ROCKET_VERSION', '' ),
'brand' => 'wp media',
'app' => 'wp rocket',
'context' => 'wp_plugin',
'path' => isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '',
'user_id' => $hashed_email,
]
);
}
/**
* Injects Mixpanel JavaScript SDK when opt-in is enabled.
*
* @since 3.19.2
* @return void
*/
public function inject_mixpanel_script(): void {
// Only inject if user has capability and opt-in is enabled.
if ( ! current_user_can( 'rocket_manage_options' ) || ! $this->optin->is_enabled() ) {
return;
}
$screen = get_current_screen();
if ( ! $screen || 'settings_page_wprocket' !== $screen->id ) {
return;
}
$this->mixpanel->add_script();
}
/**
* Track opt-in change event.
*
* @param bool $status The new opt-in status.
*
* @return void
*/
public function track_optin_change( $status ): void {
$this->mixpanel->track_optin( $status );
}
/**
* Track when a URL is added in Rocket Insights
*
* @param string $url The URL that was added for monitoring.
* @param string $plan Plan name.
* @param int $urls_count The current number of URLs being monitored.
* @param string $source The source of the request.
*
* @return void
*/
public function track_rocket_insights_url_added( $url, $plan, $urls_count, $source ): void {
if ( ! $this->optin->can_track() ) {
return;
}
$this->mixpanel->track(
'Rocket Insights Page Added',
[
'context' => 'wp_plugin',
'plan_type' => $plan,
'tracked_pages' => $urls_count,
'source' => $source,
]
);
}
/**
* Tracks when a performance test is completed or failed in Rocket Insights.
*
* @since 3.20
*
* @param RocketInsights $row_details Details related to the database row.
* @param array $job_details Details related to the job.
* @param string $plan Plan name.
*
* @return void
*/
public function track_rocket_insights_test( $row_details, $job_details, $plan ): void {
if ( ! $this->optin->can_track() ) {
return;
}
if ( empty( $row_details->data ) ) {
return;
}
$event_data = [
'context' => 'wp_plugin',
'status' => $row_details->status,
'score' => $row_details->score,
'retest' => $row_details->data['is_retest'],
'duration' => time() - $row_details->data['start_time'],
'plan_type' => $plan,
'source' => $row_details->data['source'],
];
if ( Utils::is_home( $row_details->url ) ) {
$event_data['ri_page_identifier'] = 'is_home_page';
}
$this->mixpanel->track_direct(
'Rocket Insights Performance Test',
$event_data
);
}
/**
* Track when "View Details" is clicked from the Rocket Insights column.
*
* @since 3.20.5
*
* @param int $row_id The database row ID of the test.
* @param string $context The context where the button was clicked (e.g., 'post type listing').
*
* @return void
*/
public function track_rocket_insights_view_details( int $row_id, string $context ): void {
if ( ! $this->optin->can_track() ) {
return;
}
$this->mixpanel->track(
'Rocket Insights View Details',
[
'context' => 'wp_plugin',
'source' => $context,
'test_id' => $row_id,
]
);
}
/**
* Tracks a Rocket Insights details action event.
*
* @param string $event_name The name of the event to track.
* @param int|string $row_id The ID of the test row, or 'all' for global actions.
* @param string $source The source of the action (e.g., 'url_expand', 'global_expand', 'post type listing', 'auto_expand_url').
*
* @return void
*/
public function track_rocket_insights_details_action( $event_name, $row_id, $source ): void {
if ( ! $this->optin->can_track() ) {
return;
}
$this->mixpanel->track_direct(
$event_name,
[
'context' => 'wp_plugin',
'test_id' => $row_id,
'source' => $source,
]
);
}
/**
* Tracks when the RocketCDN activation failed banner is viewed.
*
* @return void
*/
public function track_rocketcdn_activation_failed_banner_viewed(): void {
if ( ! $this->optin->can_track() ) {
return;
}
$this->mixpanel->track(
'RocketCDN Activation Failed Banner Viewed',
[
'context' => 'wp_plugin',
]
);
}
/**
* Track event dynamically.
*
* @param string $event_name The name of the event to track.
* @param array $event_data An associative array of event data to send with the event.
* @return void
*/
public function track_event( $event_name, $event_data = [] ): void {
if ( ! $this->optin->can_track() ) {
return;
}
$event_data = wp_parse_args(
$event_data,
[
'context' => 'wp_plugin',
]
);
$this->mixpanel->track( $event_name, $event_data );
}
}