PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-premium-analytics/src/class-analytics.php +16 -28 16.3 → 16.3-a.1 View file →
@@ -6,9 +6,8 @@
6 6 */
7 7
8 8 namespace Automattic\Jetpack\PremiumAnalytics;
9 9
10 -use Automattic\Jetpack\Admin_UI\Admin_Menu;
11 10 use Automattic\Jetpack\Connection\Manager as Connection_Manager;
12 11 use Automattic\Jetpack\PremiumAnalytics\Reports\Export\Export;
13 12 use Automattic\Jetpack\PremiumAnalytics\REST\Api_Proxy_Controller;
14 13 use Automattic\Jetpack\PremiumAnalytics\REST\Notices_Controller;
@@ -23,9 +22,9 @@
23 22 * Loads the wp-build output and registers the dashboard's admin page.
24 23 */
25 24 class Analytics {
26 25
27 - const PACKAGE_VERSION = '0.11.0';
26 + const PACKAGE_VERSION = '0.7.0';
28 27
29 28 /**
30 29 * Whether the class has been initialized.
31 30 *
@@ -284,9 +283,10 @@
284 283 Connection_Configuration::configure();
285 284
286 285 Sync_Status_Tracker::configure();
287 286
288 - // Opts in to the shared woocommerce_analytics sync module so Sync_Status_Tracker has a full sync to observe.
287 + // TEMPORARY (WOOA7S-1550): register the interim woocommerce_analytics sync module so
288 + // Sync_Status_Tracker has a full sync to observe. Remove when the shared sync-modules package lands.
289 289 Sync_Configuration::register();
290 290 }
291 291
292 292 /**
@@ -328,24 +328,18 @@
328 328 if ( ! function_exists( __NAMESPACE__ . '\\register_widget_modules_rest_route' ) ) {
329 329 require_once __DIR__ . '/widget-modules.php';
330 330 }
331 331
332 - // Default layout primitives and the bundled defaults' seed.
333 - if ( ! function_exists( __NAMESPACE__ . '\\get_dashboard_default_widget_instance' ) ) {
332 + // Default layout's first-load preference injection.
333 + if ( ! function_exists( __NAMESPACE__ . '\\register_dashboard_default_layout_route' ) ) {
334 334 require_once __DIR__ . '/dashboard-layout.php';
335 335 }
336 336
337 - // Dashboard section API, then the package's own sections registered through it.
337 + // Dashboard sections and their default layout seeding.
338 338 if ( ! function_exists( __NAMESPACE__ . '\\register_dashboard_section' ) ) {
339 339 require_once __DIR__ . '/dashboard-sections.php';
340 340 }
341 - if ( ! function_exists( __NAMESPACE__ . '\\register_default_dashboard_sections' ) ) {
342 - require_once __DIR__ . '/default-dashboard-sections.php';
343 - }
344 - // An older copy of the package may have loaded dashboard-sections.php under the previous name.
345 - if ( function_exists( __NAMESPACE__ . '\\configure_dashboard_sections_script_data' ) ) {
346 - configure_dashboard_sections_script_data();
347 - }
341 + configure_dashboard_preview_scope();
348 342
349 343 // Default-on CSV export settings and server-side disable filter.
350 344 if ( ! function_exists( __NAMESPACE__ . '\\configure_csv_exports' ) ) {
351 345 require_once __DIR__ . '/csv-exports.php';
@@ -385,9 +379,8 @@
385 379 private static function load_build() {
386 380 $build_entry = self::$build_entry ?? __DIR__ . '/../build/build.php';
387 381 if ( file_exists( $build_entry ) ) {
388 382 require_once $build_entry;
389 - require_once __DIR__ . '/sdk-module.php';
390 383 }
391 384 }
392 385
393 386 /**
@@ -490,11 +483,8 @@
490 483 *
491 484 * Uses wp-build's `-wp-admin` variant so Core applies the menu capability check. Reports the
492 485 * page and widget artifacts independently since the build loader includes each conditionally.
493 486 *
494 - * Queued through Admin_Menu rather than registered here, so the entry is reachable by the
495 - * `jetpack_admin_menu_visibility` filter.
496 - *
497 487 * @return void
498 488 */
499 489 public static function register_admin_menu() {
500 490 $can_render = function_exists( 'jpa_jetpack_premium_analytics_wp_admin_render_page' );
@@ -527,19 +517,17 @@
527 517 : array( __CLASS__, 'render_missing_build_notice' );
528 518
529 519 $menu_title = self::menu_title();
530 520
531 - $menu_title = esc_html( $menu_title );
532 -
533 - // An older admin-ui, loaded first by another plugin, may predate add_top_level_menu().
534 - if ( ! method_exists( Admin_Menu::class, 'add_top_level_menu' ) ) {
535 - add_menu_page( $menu_title, $menu_title, Capabilities::VIEW_ANALYTICS, self::MENU_PAGE_SLUG, $render_callback, 'dashicons-chart-bar', 2 );
536 - return;
537 - }
538 -
539 - // A fixed key rather than the slug, which carries a build-specific suffix. No gate:
540 - // the dashboard has no My Jetpack product class and no module to name.
541 - Admin_Menu::add_top_level_menu( $menu_title, $menu_title, Capabilities::VIEW_ANALYTICS, self::MENU_PAGE_SLUG, $render_callback, 'dashicons-chart-bar', 2, array( 'key' => 'jetpack-premium-analytics' ) );
521 + add_menu_page(
522 + esc_html( $menu_title ),
523 + esc_html( $menu_title ),
524 + Capabilities::VIEW_ANALYTICS,
525 + self::MENU_PAGE_SLUG,
526 + $render_callback,
527 + 'dashicons-chart-bar',
528 + 2
529 + );
542 530 }
543 531
544 532 /**
545 533 * Stand-in for the generated render callback when the build output is absent.