← All changes
|
modules/stats/class-jetpack-stats-upgrade-nudges.php
+8
-8
12.0.3
→
16.3-a.1
View file →
| @@ -5,8 +5,9 @@ | ||
| 5 | 5 | * @package jetpack |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | use Automattic\Jetpack\Connection\Manager; |
| 9 | +use Automattic\Jetpack\Current_Plan as Jetpack_Plan; | |
| 9 | 10 | use Automattic\Jetpack\Jetpack_CRM_Data; |
| 10 | 11 | use Automattic\Jetpack\Plugins_Installer; |
| 11 | 12 | use Automattic\Jetpack\Redirect; |
| 12 | 13 | use Automattic\Jetpack\Tracking; |
| @@ -238,10 +239,10 @@ | ||
| 238 | 239 | #stats_nudges_toggle { |
| 239 | 240 | height: 100%; |
| 240 | 241 | } |
| 241 | 242 | .dops-banner.dops-card.is-product.jp-stats-report-upgrade-item { |
| 242 | - margin-bottom: 0px; | |
| 243 | - border-left: 0px; | |
| 243 | + margin-bottom: 0; | |
| 244 | + border-left: 0; | |
| 244 | 245 | box-shadow: none; |
| 245 | 246 | border-top: 1px solid #c3c4c7; |
| 246 | 247 | padding: 12px 24px; |
| 247 | 248 | } |
| @@ -246,12 +247,12 @@ | ||
| 246 | 247 | padding: 12px 24px; |
| 247 | 248 | } |
| 248 | 249 | .dops-banner.dops-card.jp-stats-report-upgrade-item.jp-stats-report-upgrade-subitem { |
| 249 | 250 | margin-left: 72px; |
| 250 | - padding-left: 0px; | |
| 251 | + padding-left: 0; | |
| 251 | 252 | } |
| 252 | 253 | .jp-stats-report-upgrade-item .dops-banner__action { |
| 253 | - margin-right: 0px; | |
| 254 | + margin-right: 0; | |
| 254 | 255 | } |
| 255 | 256 | #jp-stats-report-upgrade-wrap .dops-card::after { |
| 256 | 257 | content: ""; |
| 257 | 258 | } |
| @@ -294,9 +295,9 @@ | ||
| 294 | 295 | fetch( '/wp-json/jetpack/v4/settings', { |
| 295 | 296 | method: 'post', |
| 296 | 297 | body: JSON.stringify( { collapse_nudges: collapseValue } ), |
| 297 | 298 | headers: { |
| 298 | - 'X-WP-Nonce': "<?php echo esc_js( wp_create_nonce( 'wp_rest' ) ); ?>", | |
| 299 | + 'X-WP-Nonce': <?php echo wp_json_encode( wp_create_nonce( 'wp_rest' ), JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP ); ?>, | |
| 299 | 300 | 'Content-type': 'application/json' } |
| 300 | 301 | } ); |
| 301 | 302 | }; |
| 302 | 303 | } |
| @@ -362,9 +363,9 @@ | ||
| 362 | 363 | private static function print_item( $title, $text, $icon, $link, $tracks_id, $learn_more_link, $subitem = false, $button_label = null ) { |
| 363 | 364 | $additional_classes = $subitem ? 'jp-stats-report-upgrade-subitem' : ''; |
| 364 | 365 | $button_class = $subitem ? 'is-secondary' : 'is-primary'; |
| 365 | 366 | $icon_url = plugins_url( '', JETPACK__PLUGIN_FILE ) . '/images/products/' . $icon; |
| 366 | - $button_label = $button_label === null ? __( 'Upgrade', 'jetpack' ) : $button_label; | |
| 367 | + $button_label = $button_label === null ? _x( 'Upgrade', 'Call to action to buy a new plan', 'jetpack' ) : $button_label; | |
| 367 | 368 | $view_event = "stats_nudges_view_$tracks_id"; |
| 368 | 369 | $click_event = "stats_nudges_click_$tracks_id"; |
| 369 | 370 | $learn_more_event = "stats_nudges_learn_more_$tracks_id"; |
| 370 | 371 | self::track_event( $view_event ); |
| @@ -404,9 +405,9 @@ | ||
| 404 | 405 | private static function print_security() { |
| 405 | 406 | $link = self::get_product_description_link( 'security' ); |
| 406 | 407 | $learn_link = self::get_upgrade_link( 'stats-nudges-security-learn' ); |
| 407 | 408 | $text = __( 'Comprehensive protection for your site, including Backup, Scan, and Anti-spam.', 'jetpack' ); |
| 408 | - self::print_item( _x( 'Security', 'Jetpack product name', 'jetpack' ), $text, 'product-jetpack-security-bundle.svg', $link, 'security', $learn_link ); | |
| 409 | + self::print_item( _x( 'Security', 'Jetpack product name', 'jetpack' ), $text, 'product-jetpack.svg', $link, 'security', $learn_link ); | |
| 409 | 410 | } |
| 410 | 411 | |
| 411 | 412 | /** |
| 412 | 413 | * Prints the Backup item |
| @@ -578,6 +579,5 @@ | ||
| 578 | 579 | self::get_boost_output(); |
| 579 | 580 | self::get_crm_output(); |
| 580 | 581 | self::print_footer(); |
| 581 | 582 | } |
| 582 | - | |
| 583 | 583 | } |