| @@ -4,8 +4,12 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package automattic/jetpack |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | + exit( 0 ); | |
| 10 | +} | |
| 11 | + | |
| 8 | 12 | /** |
| 9 | 13 | * Checks if the code debug mode turned on, and returns false if it is. When Jetpack is in |
| 10 | 14 | * code debug mode, it shouldn't use minified assets. Note that this filter is not being used |
| 11 | 15 | * in every place where assets are enqueued. The filter is added at priority 9 to be overridden |
| @@ -28,9 +32,8 @@ | ||
| 28 | 32 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php'; |
| 29 | 33 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php'; |
| 30 | 34 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php'; |
| 31 | 35 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php'; |
| 32 | -require_once JETPACK__PLUGIN_DIR . 'class.jetpack-boost-modules.php'; | |
| 33 | 36 | require_once JETPACK__PLUGIN_DIR . 'class.photon.php'; |
| 34 | 37 | require_once JETPACK__PLUGIN_DIR . 'functions.photon.php'; |
| 35 | 38 | require_once JETPACK__PLUGIN_DIR . 'functions.global.php'; |
| 36 | 39 | require_once JETPACK__PLUGIN_DIR . 'functions.compat.php'; |
| @@ -38,16 +41,15 @@ | ||
| 38 | 41 | require_once JETPACK__PLUGIN_DIR . 'functions.cookies.php'; |
| 39 | 42 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php'; |
| 40 | 43 | require_once JETPACK__PLUGIN_DIR . 'class.frame-nonce-preview.php'; |
| 41 | 44 | require_once JETPACK__PLUGIN_DIR . 'modules/module-headings.php'; |
| 42 | -require_once JETPACK__PLUGIN_DIR . 'class.jetpack-connection-banner.php'; | |
| 43 | -require_once JETPACK__PLUGIN_DIR . 'class-jetpack-connection-widget.php'; | |
| 44 | 45 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-plan.php'; |
| 45 | -// Used by the API endpoints. | |
| 46 | +// Used by the API endpoints or used in an odd number of places. | |
| 46 | 47 | require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-utils.php'; |
| 47 | 48 | require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-titles.php'; |
| 48 | 49 | require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-posts.php'; |
| 49 | 50 | require_once JETPACK__PLUGIN_DIR . 'modules/verification-tools/verification-tools-utils.php'; |
| 51 | +require_once JETPACK__PLUGIN_DIR . 'modules/shortcodes/shortcode-utils.php'; // Shortcodes are often referenced in other modules, so making it available early. | |
| 50 | 52 | |
| 51 | 53 | require_once JETPACK__PLUGIN_DIR . 'class-jetpack-xmlrpc-methods.php'; |
| 52 | 54 | Jetpack_XMLRPC_Methods::init(); |
| 53 | 55 | |
| @@ -53,14 +55,28 @@ | ||
| 53 | 55 | |
| 54 | 56 | require_once JETPACK__PLUGIN_DIR . 'class-jetpack-connection-status.php'; |
| 55 | 57 | Jetpack_Connection_Status::init(); |
| 56 | 58 | |
| 59 | +require_once JETPACK__PLUGIN_DIR . '_inc/lib/class-jetpack-application-password-extras.php'; | |
| 60 | +Jetpack_Application_Password_Extras::init(); | |
| 61 | + | |
| 62 | +// Also required directly by the AI extension files because on WordPress.com | |
| 63 | +// Simple this bootstrap never runs. The class self-initializes when loaded. | |
| 64 | +require_once JETPACK__PLUGIN_DIR . '_inc/lib/class-jetpack-ai-settings.php'; | |
| 65 | +require_once JETPACK__PLUGIN_DIR . '_inc/lib/class-jetpack-ai-feature-flags.php'; | |
| 66 | + | |
| 57 | 67 | require_once JETPACK__PLUGIN_DIR . '_inc/lib/class-jetpack-recommendations.php'; |
| 58 | -require_once JETPACK__PLUGIN_DIR . 'class-jetpack-recommendations-banner.php'; | |
| 59 | 68 | |
| 60 | 69 | if ( is_admin() ) { |
| 61 | 70 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php'; |
| 62 | 71 | require_once JETPACK__PLUGIN_DIR . '_inc/lib/debugger.php'; |
| 72 | + | |
| 73 | + // Initialize Newsletter Settings (always-loaded so the settings page URL works even when module is inactive). | |
| 74 | + \Automattic\Jetpack\Newsletter\Settings::init(); | |
| 75 | + | |
| 76 | + \Automattic\Jetpack\Newsletter\Writing_Prompt_Widget::init(); | |
| 77 | + | |
| 78 | + \Automattic\Jetpack\Plugin\Jetpack_Script_Data::configure(); | |
| 63 | 79 | } |
| 64 | 80 | |
| 65 | 81 | // Play nice with https://wp-cli.org/. |
| 66 | 82 | if ( defined( 'WP_CLI' ) && WP_CLI ) { |
| @@ -68,10 +84,18 @@ | ||
| 68 | 84 | } |
| 69 | 85 | |
| 70 | 86 | require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.core-rest-api-endpoints.php'; |
| 71 | 87 | require_once JETPACK__PLUGIN_DIR . '_inc/blogging-prompts.php'; |
| 88 | +if ( is_admin() ) { | |
| 89 | + require_once JETPACK__PLUGIN_DIR . '_inc/content-guidelines-ai.php'; | |
| 90 | +} | |
| 72 | 91 | |
| 73 | -add_action( 'updating_jetpack_version', array( 'Jetpack', 'do_version_bump' ), 10, 2 ); | |
| 92 | +add_action( 'updating_jetpack_version', array( 'Jetpack', 'activate_subscriptions_module_for_existing_sites' ), 10, 2 ); | |
| 93 | +// Seed + keep in sync the durable Jetpack SEO module-state options while the legacy | |
| 94 | +// Sitemaps / Canonical URLs modules still exist. Removed in the deferred post-convergence | |
| 95 | +// follow-up that absorbs those modules into Jetpack SEO. | |
| 96 | +Jetpack::register_seo_module_migration_hooks(); | |
| 97 | +add_action( 'updating_jetpack_version', array( 'Jetpack', 'seed_seo_visibility_cohort' ), 10, 2 ); | |
| 74 | 98 | add_filter( 'is_jetpack_site', '__return_true' ); |
| 75 | 99 | |
| 76 | 100 | require_once JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php'; |
| 77 | 101 | |