automattic / jetpack-my-jetpack
WP Admin page with information and configuration shared among all Jetpack stand-alone plugins
Installs: 25 202
Dependents: 9
Suggesters: 0
Security: 0
Stars: 2
Watchers: 5
Forks: 2
Type:jetpack-library
Requires
- php: >=7.2
- automattic/jetpack-admin-ui: ^0.5.10
- automattic/jetpack-assets: ^4.1.2
- automattic/jetpack-boost-speed-score: ^0.4.9
- automattic/jetpack-connection: ^6.14.1
- automattic/jetpack-constants: ^3.0.8
- automattic/jetpack-explat: ^0.3.3
- automattic/jetpack-jitm: ^4.2.28
- automattic/jetpack-licensing: ^3.0.9
- automattic/jetpack-plans: ^0.8.0
- automattic/jetpack-plugins-installer: ^0.5.5
- automattic/jetpack-protect-status: ^0.6.0
- automattic/jetpack-redirect: ^3.0.7
- automattic/jetpack-status: ^5.4.0
- automattic/jetpack-sync: ^4.15.1
Requires (Dev)
- automattic/jetpack-changelogger: ^6.0.5
- automattic/jetpack-test-environment: @dev
- automattic/phpunit-select-config: ^1.0.3
- yoast/phpunit-polyfills: ^4.0.0
Suggests
- automattic/jetpack-autoloader: Allow for better interoperability with other plugins that use this package.
- dev-trunk / 5.18.x-dev
- v5.17.4
- v5.17.3
- v5.17.2
- v5.17.1
- v5.17.0
- v5.16.8
- v5.16.7
- v5.16.6
- v5.16.5
- v5.16.4
- v5.16.3
- v5.16.2
- v5.16.1
- v5.16.0
- v5.15.0
- v5.14.5
- v5.14.4
- v5.14.3
- v5.14.2
- v5.14.1
- v5.14.0
- v5.13.1
- v5.13.0
- v5.12.0
- v5.11.2
- v5.11.1
- v5.11.0
- v5.10.1
- v5.10.0
- v5.9.2
- v5.9.1
- v5.9.0
- v5.8.0
- v5.7.3
- v5.7.2
- v5.7.1
- v5.7.0
- v5.6.0
- v5.5.3
- v5.5.2
- v5.5.1
- v5.5.0
- v5.4.5
- v5.4.4
- v5.4.3
- v5.4.2
- v5.4.1
- v5.4.0
- v5.3.3
- v5.3.2
- v5.3.1
- v5.3.0
- v5.2.0
- v5.1.2
- v5.1.1
- v5.1.0
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- v4.37.0
- v4.36.0
- v4.35.16
- v4.35.15
- v4.35.14
- v4.35.13
- v4.35.12
- v4.35.11
- v4.35.10
- v4.35.9
- v4.35.8
- v4.35.7
- v4.35.6
- v4.35.5
- v4.35.4
- v4.35.3
- v4.35.2
- v4.35.1
- v4.35.0
- v4.34.1
- v4.34.0
- v4.33.1
- v4.33.0
- v4.32.4
- v4.32.3
- v4.32.2
- v4.32.1
- v4.32.0
- v4.31.0
- v4.30.0
- v4.29.0
- v4.28.0
- v4.27.2
- v4.27.1
- v4.27.0
- v4.26.0
- v4.25.4
- v4.25.3
- v4.25.2
- v4.25.1
- v4.25.0
- v4.24.7
- v4.24.6
- v4.24.5
- v4.24.4
- v4.24.3
- v4.24.2
- v4.24.1
- v4.24.0
- v4.23.3
- v4.23.2
- v4.23.1
- v4.23.0
- v4.22.3
- v4.22.2
- v4.22.1
- v4.22.0
- v4.21.0
- v4.20.2
- v4.20.1.1
- v4.20.1
- v4.20.0
- v4.19.0
- v4.18.0
- v4.17.1
- v4.17.0
- v4.16.0
- v4.15.0
- v4.14.0
- v4.13.0
- v4.12.1
- v4.12.0
- v4.11.0
- v4.10.0
- v4.9.2
- v4.9.1
- v4.9.0
- v4.8.0
- v4.7.0
- v4.6.2
- v4.6.1
- v4.6.0
- v4.5.0
- v4.4.0
- v4.3.0
- v4.2.1
- v4.2.0
- v4.1.4
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.12.2
- v3.12.1
- v3.12.0
- v3.11.1
- v3.11.0
- v3.10.0
- v3.9.1
- v3.9.0.1
- v3.9.0
- v3.8.2
- v3.8.1
- v3.8.0
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.5
- v3.4.4
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- v3.3.3
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.1
- v3.2.0
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.0
- v2.15.0
- v2.14.3
- v2.14.2
- v2.14.1
- v2.14.0
- v2.13.0
- v2.12.2
- v2.12.1
- v2.12.0
- v2.11.0
- v2.10.3
- v2.10.2
- v2.10.1
- v2.10.0
- v2.9.2
- v2.9.1
- v2.9.0
- v2.8.1
- v2.8.0
- v2.7.13
- v2.7.12
- v2.7.11
- v2.7.10
- v2.7.9
- v2.7.8
- v2.7.7
- v2.7.6
- v2.7.5
- v2.7.4
- v2.7.3
- v2.7.2.1
- v2.7.2
- v2.7.1
- v2.7.0
- v2.6.1
- v2.6.0
- v2.5.2
- v2.5.1
- v2.5.0.1
- v2.5.0
- v2.4.1
- v2.4.0
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.4
- v1.7.3
- v1.7.2.1
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v0.6.13
- v0.6.12
- v0.6.11
- v0.6.10
- v0.6.9
- v0.6.8
- v0.6.7
- v0.6.6
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.3
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.3
- v0.1.2
- dev-prerelease
- dev-release-v2.9.2
- dev-release-v2.7.8
- dev-release-v2.7.2.1
- dev-release-v2.5.0.1
- dev-release-v1.7.2.1
- dev-release-v0.6.13
- dev-release-v0.6.6
- dev-fix/slack-workflow-branch-detection
- dev-release-v0.6.4
This package is auto-updated.
Last update: 2025-07-11 16:44:22 UTC
README
WP Admin page with information and configuration shared among all Jetpack stand-alone plugins
Overview
My Jetpack is a centralized WordPress admin page that provides a unified interface for managing all Jetpack products and services. It serves as the main dashboard where users can view, install, configure, and manage their Jetpack products.
Usage
Every Jetpack plugin must include the My Jetpack package.
Require this package and initialize it:
add_action( 'init', function() { Automattic\Jetpack\My_Jetpack\Initializer::init(); } );
Conditionally loading licensing UI behind a feature flag
To disable the licensing UI at /wp-admin/admin.php?page=my-jetpack#/add-license
, add a filter on jetpack_my_jetpack_should_enable_add_license_screen
and return false: add_filter( 'jetpack_my_jetpack_should_enable_add_license_screen', '__return_false' );
Architecture
Core Components
PHP Backend (src/
)
- Initializer (
class-initializer.php
): Main entry point that sets up admin menu, REST endpoints, and asset enqueuing - Products (
class-products.php
): Core product management system with status constants and lifecycle handling - Product Classes (
src/products/
): Individual product implementations inheriting from baseProduct
class - REST API (
class-rest-*.php
): API endpoints for product management, purchases, and AI functionality
React Frontend (_inc/
)
- Main App (
admin.jsx
): Entry point with React Router setup - Components (
components/
): Reusable UI components for product cards, screens, and interstitials - Data Layer (
data/
): Custom hooks and API integration using React Query (see Data Layer Documentation) - Context (
context/
): Global state management for notices and values
Product System
- Products inherit from base
Product
class with standardized interface - Status constants define product lifecycle:
active
,inactive
,needs_plan
,plugin_absent
, etc. - Hybrid products can function as both standalone plugins and Jetpack modules
- Product cards dynamically display status, actions, and pricing information
Key Features
- Connection Management: Handles WordPress.com site and user connections
- Product Interstitials: Purchase/activation flows for each product
- Onboarding Flow: Guided setup for new users
- Licensing: License key management and validation
- Activity Log: Integration with Jetpack activity monitoring
- Speed Score: Boost performance metrics integration
Frontend Architecture
- React 18 with functional components and hooks
- React Router for client-side navigation
- CSS Modules for component styling
- TypeScript for type safety
- Custom data hooks using React Query for API state management
Build System
- Webpack with Jetpack-specific configuration
- Babel for JavaScript transpilation
- Sass for CSS preprocessing
- Asset optimization for production builds
- Textdomain replacement for internationalization
Development
Commands
Build Commands:
jetpack build packages/my-jetpack
- Build from monorepo rootjetpack watch packages/my-jetpack
- Watch mode from monorepo rootpnpm run build
- Build from package directorypnpm run test
- Run tests from package directory
Testing Strategy
Testing:
- PHP: PHPUnit with WordPress test environment and polyfills
- JavaScript: Jest with React Testing Library
- E2E: Integration with monorepo Playwright setup
Development Notes
Code Standards:
- Uses WordPress coding standards and Jetpack extensions
- Requires WordPress.com connection for full functionality
- Integrates with Jetpack licensing and purchase systems
- Supports feature flags for gradual rollouts
- Compatible with WordPress multisite (when enabled)
API Endpoints
REST API Patterns
- Base namespace:
jetpack/v4/my-jetpack
- Products endpoint:
/products
- main product data and actions - Purchases endpoint:
/purchases
- user purchase information - Feature endpoints: Various feature-specific endpoints
Data Flow
- React components call API via
apiFetch
- WordPress routes to appropriate REST controller
- Controller validates permissions and processes request
- Product classes handle business logic
- Response returned to frontend for UI updates
Key Files Reference
PHP Files
src/class-initializer.php
- Main initialization, admin menu setupsrc/class-products.php
- Core product management, status constantssrc/products/class-product.php
- Base product classsrc/class-rest-products.php
- Main products API endpointsrc/class-wpcom-products.php
- WordPress.com product integration
React Files
_inc/admin.jsx
- Main React application entry point_inc/providers.tsx
- Context providers wrapper_inc/constants.ts
- Route definitions and constants_inc/components/my-jetpack-screen/
- Main dashboard screen_inc/components/product-interstitial/
- Product setup flows_inc/data/
- API hooks and data management using React Query
Configuration Files
package.json
- Dependencies and scriptswebpack.config.js
- Build configurationbabel.config.js
- JavaScript transpilationtsconfig.json
- TypeScript configuration
Using this package in your WordPress plugin
If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.
Security
Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.
License
my-jetpack is licensed under GNU General Public License v2 (or later)