From f6ab8432eee3df451f6c026a41575ba7d30af058 Mon Sep 17 00:00:00 2001 From: Tim Broddin Date: Thu, 18 Jul 2024 09:34:35 +0200 Subject: [PATCH 1/7] Block Perplexity AI bot when opted out of data sharing. (#38400) * Block Perplexity AI * Add changelog. * Update test --- .../jetpack-mu-wpcom/changelog/add-block-perplexity-ai-bot | 4 ++++ .../src/features/blog-privacy/blog-privacy.php | 1 + .../php/features/blog-privacy/class-blog-privacy-test.php | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/add-block-perplexity-ai-bot diff --git a/projects/packages/jetpack-mu-wpcom/changelog/add-block-perplexity-ai-bot b/projects/packages/jetpack-mu-wpcom/changelog/add-block-perplexity-ai-bot new file mode 100644 index 0000000000000..aba509093218b --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/add-block-perplexity-ai-bot @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Block Perplexity AI bot in robots.txt when opted out of data sharing. diff --git a/projects/packages/jetpack-mu-wpcom/src/features/blog-privacy/blog-privacy.php b/projects/packages/jetpack-mu-wpcom/src/features/blog-privacy/blog-privacy.php index ad3dfcf65f650..6c864472010af 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/blog-privacy/blog-privacy.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/blog-privacy/blog-privacy.php @@ -45,6 +45,7 @@ function robots_txt( string $output, $public ): string { 'GPTBot', 'omgili', 'omgilibot', + 'PerplexityBot', 'SentiBot', 'sentibot', ); diff --git a/projects/packages/jetpack-mu-wpcom/tests/php/features/blog-privacy/class-blog-privacy-test.php b/projects/packages/jetpack-mu-wpcom/tests/php/features/blog-privacy/class-blog-privacy-test.php index 189b41b793058..327068b785d4a 100644 --- a/projects/packages/jetpack-mu-wpcom/tests/php/features/blog-privacy/class-blog-privacy-test.php +++ b/projects/packages/jetpack-mu-wpcom/tests/php/features/blog-privacy/class-blog-privacy-test.php @@ -61,6 +61,9 @@ public function provide_robots_txt(): \Iterator { User-agent: omgilibot Disallow: / +User-agent: PerplexityBot +Disallow: / + User-agent: SentiBot Disallow: / From b40031f82c3e099fa2b78de3cd5b1e5045b919bb Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Thu, 18 Jul 2024 10:10:11 +0200 Subject: [PATCH 2/7] Google Fonts: adjust docblocks for better codex generation (#38348) Following #38343, this further adjusts some of the docblocks in the Google Fonts module so the filters get properly pulled in the codex. --- .../fix-dockblock-comments-google-fonts | 5 ++++ .../current/load-google-fonts.php | 2 ++ .../jetpack/modules/google-fonts/load.php | 30 ++++++++++--------- 3 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/fix-dockblock-comments-google-fonts diff --git a/projects/plugins/jetpack/changelog/fix-dockblock-comments-google-fonts b/projects/plugins/jetpack/changelog/fix-dockblock-comments-google-fonts new file mode 100644 index 0000000000000..934896edb41ed --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-dockblock-comments-google-fonts @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Google Fonts: adjust docblocks for better codex generation + + diff --git a/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php b/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php index 3676e8636469c..338c12a7cef8e 100644 --- a/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php +++ b/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php @@ -59,6 +59,8 @@ function jetpack_get_google_fonts_data() { /** * Filters the Google Fonts API URL. * + * @module google-fonts + * * @since 12.8 * * @param string $url The Google Fonts API URL. diff --git a/projects/plugins/jetpack/modules/google-fonts/load.php b/projects/plugins/jetpack/modules/google-fonts/load.php index d812219478f8c..76e380c7fbf7b 100644 --- a/projects/plugins/jetpack/modules/google-fonts/load.php +++ b/projects/plugins/jetpack/modules/google-fonts/load.php @@ -8,20 +8,22 @@ add_action( 'plugins_loaded', function () { - /** - * Filters whether to skip loading the Jetpack Google Fonts module. - * - * This filter allows skipping the loading of the Jetpack Google Fonts module - * based on specific conditions or requirements. By default, the module will - * load normally. If the filter returns true, the module will be skipped. - * - * @module google-fonts - * - * @since 13.4 - * - * @param bool $skip Whether to skip loading the Jetpack Google Fonts module. Default false. - */ - if ( apply_filters( 'jetpack_google_fonts_skip_load', false ) ) { + if ( + /** + * Filters whether to skip loading the Jetpack Google Fonts module. + * + * This filter allows skipping the loading of the Jetpack Google Fonts module + * based on specific conditions or requirements. By default, the module will + * load normally. If the filter returns true, the module will be skipped. + * + * @module google-fonts + * + * @since 13.4 + * + * @param bool $skip Whether to skip loading the Jetpack Google Fonts module. Default false. + */ + apply_filters( 'jetpack_google_fonts_skip_load', false ) + ) { return; } From 34a32fa1b7a54ed2ba7bb4f0f1040e1a82a813a7 Mon Sep 17 00:00:00 2001 From: Przemek Kuliga Date: Thu, 18 Jul 2024 10:16:43 +0200 Subject: [PATCH 3/7] Subscriptions: Update Newsletter module toggle label (#38373) --- .../plugins/jetpack/_inc/client/newsletter/newsletter.jsx | 5 ++++- .../plugins/jetpack/changelog/update-newsletter-toggle-label | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/jetpack/changelog/update-newsletter-toggle-label diff --git a/projects/plugins/jetpack/_inc/client/newsletter/newsletter.jsx b/projects/plugins/jetpack/_inc/client/newsletter/newsletter.jsx index 4a0b5ae04ba23..48159eda50034 100644 --- a/projects/plugins/jetpack/_inc/client/newsletter/newsletter.jsx +++ b/projects/plugins/jetpack/_inc/client/newsletter/newsletter.jsx @@ -85,7 +85,10 @@ function Newsletter( props ) { toggleModule={ toggleModuleNow } > - { __( 'Let visitors subscribe to this site', 'jetpack' ) } + { __( + 'Let visitors subscribe to this site and receive emails when you publish a post', + 'jetpack' + ) } diff --git a/projects/plugins/jetpack/changelog/update-newsletter-toggle-label b/projects/plugins/jetpack/changelog/update-newsletter-toggle-label new file mode 100644 index 0000000000000..076f04433ae44 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-newsletter-toggle-label @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Subscriptions: Update Newsletter module toggle label From b1ab4faa12b39757650c9e5ed4dd532144fce259 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Thu, 18 Jul 2024 10:23:23 +0200 Subject: [PATCH 4/7] Contact Form: ensure IP address is displayed for each submission (#38352) Fixes #29124 --- .../forms/changelog/fix-contact-form-ip-field | 4 ++++ projects/packages/forms/package.json | 2 +- .../packages/forms/src/class-jetpack-forms.php | 2 +- .../forms/src/contact-form/class-admin.php | 14 +++++++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 projects/packages/forms/changelog/fix-contact-form-ip-field diff --git a/projects/packages/forms/changelog/fix-contact-form-ip-field b/projects/packages/forms/changelog/fix-contact-form-ip-field new file mode 100644 index 0000000000000..ce607e9f4098c --- /dev/null +++ b/projects/packages/forms/changelog/fix-contact-form-ip-field @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Form submissions table: ensure the IP address is displayed for each submission, when available. diff --git a/projects/packages/forms/package.json b/projects/packages/forms/package.json index 60f0aa9f14a7d..bd0667764d9f3 100644 --- a/projects/packages/forms/package.json +++ b/projects/packages/forms/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-forms", - "version": "0.32.4", + "version": "0.32.5-alpha", "description": "Jetpack Forms", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/forms/#readme", "bugs": { diff --git a/projects/packages/forms/src/class-jetpack-forms.php b/projects/packages/forms/src/class-jetpack-forms.php index 3c8ae28b8e232..0546a8eb4a3ec 100644 --- a/projects/packages/forms/src/class-jetpack-forms.php +++ b/projects/packages/forms/src/class-jetpack-forms.php @@ -15,7 +15,7 @@ */ class Jetpack_Forms { - const PACKAGE_VERSION = '0.32.4'; + const PACKAGE_VERSION = '0.32.5-alpha'; /** * Load the contact form module. diff --git a/projects/packages/forms/src/contact-form/class-admin.php b/projects/packages/forms/src/contact-form/class-admin.php index 83a428d658b2e..5d37d93caac14 100644 --- a/projects/packages/forms/src/contact-form/class-admin.php +++ b/projects/packages/forms/src/contact-form/class-admin.php @@ -738,6 +738,18 @@ public function grunion_manage_post_column_response( $post ) { } } + // Extract IP address if we still do not have it at this point. + if ( + ! isset( $content_fields['_feedback_ip'] ) + && is_array( $chunks ) + && ! empty( $chunks[0] ) + ) { + preg_match( '/^IP: (.+)$/m', $chunks[0], $matches ); + if ( ! empty( $matches[1] ) ) { + $content_fields['_feedback_ip'] = $matches[1]; + } + } + $response_fields = array_diff_key( $response_fields, array_flip( $non_printable_keys ) ); echo ''; @@ -757,7 +769,7 @@ public function grunion_manage_post_column_response( $post ) { echo '
'; echo '