Skip to content
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

Load Odyssey Stats for simple sites #36628

Merged
merged 7 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion projects/packages/jetpack-mu-wpcom/.phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@
// Require base config.
require __DIR__ . '/../../../../.phan/config.base.php';

return make_phan_config( dirname( __DIR__ ) );
$root = dirname( __DIR__, 4 );

return make_phan_config(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@candy02058912 curious to what's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the new static analyzer tool we're using pdWQjU-Jb-p2

dirname( __DIR__ ),
array(
'parse_file_list' => array(
"$root/projects/packages/stats-admin/src/class-dashboard.php",
"$root/projects/plugins/jetpack/class-jetpack-stats-dashboard-widget.php",
),
)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Add Odyssey Stats to wpcom Simple Site
2 changes: 1 addition & 1 deletion projects/packages/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"autotagger": true,
"branch-alias": {
"dev-trunk": "5.21.x-dev"
"dev-trunk": "5.22.x-dev"
},
"textdomain": "jetpack-mu-wpcom",
"version-constants": {
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/jetpack-mu-wpcom/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-mu-wpcom",
"version": "5.21.1-alpha",
"version": "5.22.0-alpha",
"description": "Enhances your site with features powered by WordPress.com",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Jetpack_Mu_Wpcom main class.
*/
class Jetpack_Mu_Wpcom {
const PACKAGE_VERSION = '5.21.1-alpha';
const PACKAGE_VERSION = '5.22.0-alpha';
const PKG_DIR = __DIR__ . '/../';
const BASE_DIR = __DIR__ . '/';
const BASE_FILE = __FILE__;
Expand Down Expand Up @@ -46,6 +46,7 @@ public static function init() {
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
add_action( 'plugins_loaded', array( __CLASS__, 'load_verbum_comments' ) );
add_action( 'wp_loaded', array( __CLASS__, 'load_verbum_comments_admin' ) );
add_action( 'plugins_loaded', array( __CLASS__, 'load_wpcom_simple_odyssey_stats' ) );
}

// Unified navigation fix for changes in WordPress 6.2.
Expand Down Expand Up @@ -278,4 +279,13 @@ public static function load_verbum_comments_admin() {
public static function load_wpcom_command_palette() {
require_once __DIR__ . '/features/wpcom-command-palette/wpcom-command-palette.php';
}

/**
* Load Odyssey Stats in Simple sites.
*/
public static function load_wpcom_simple_odyssey_stats() {
if ( function_exists( 'wpcom_is_nav_redesign_enabled' ) && wpcom_is_nav_redesign_enabled() ) {
require_once __DIR__ . '/features/wpcom-simple-odyssey-stats/wpcom-simple-odyssey-stats.php';
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Load the Odyssey stats feature on WordPress.com Simple Site.
* See https://github.com/Automattic/jetpack/tree/trunk/projects/packages/stats-admin
*
* @package automattic/jetpack-mu-wpcom
*/

use Automattic\Jetpack\Stats_Admin\Dashboard as OdysseyStats;
OdysseyStats::init();
candy02058912 marked this conversation as resolved.
Show resolved Hide resolved

/**
* Load the Odyssey stats widget in the Dashboard.
*/
if ( defined( 'JETPACK_PLUGIN_LOADER_PATH' ) ) {
require_once JETPACK_PLUGIN_LOADER_PATH . '/class-jetpack-stats-dashboard-widget.php';
add_action( 'wp_dashboard_setup', array( new Jetpack_Stats_Dashboard_Widget(), 'init' ) );
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


2 changes: 1 addition & 1 deletion projects/plugins/mu-wpcom-plugin/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
]
},
"config": {
"autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_1_10"
"autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_1_11_alpha"
}
}
4 changes: 2 additions & 2 deletions projects/plugins/mu-wpcom-plugin/composer.lock

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

2 changes: 1 addition & 1 deletion projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Plugin Name: WordPress.com Features
* Description: Test plugin for the jetpack-mu-wpcom package
* Version: 2.1.10
* Version: 2.1.11-alpha
* Author: Automattic
* License: GPLv2 or later
* Text Domain: jetpack-mu-wpcom-plugin
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/mu-wpcom-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-mu-wpcom-plugin",
"version": "2.1.10",
"version": "2.1.11-alpha",
"description": "Test plugin for the jetpack-mu-wpcom package",
"homepage": "https://jetpack.com",
"bugs": {
Expand Down