diff --git a/projects/packages/videopress/.phan/baseline.php b/projects/packages/videopress/.phan/baseline.php index 4293758e30be3..b648b5c708a88 100644 --- a/projects/packages/videopress/.phan/baseline.php +++ b/projects/packages/videopress/.phan/baseline.php @@ -10,9 +10,9 @@ return [ // # Issue statistics: // PhanPluginDuplicateConditionalNullCoalescing : 20+ occurrences - // PhanUndeclaredProperty : 8 occurrences // PhanTypeMismatchArgumentProbablyReal : 7 occurrences // PhanTypeMismatchReturnProbablyReal : 7 occurrences + // PhanUndeclaredProperty : 7 occurrences // PhanTypeArraySuspicious : 6 occurrences // PhanTypeMismatchReturn : 6 occurrences // PhanUndeclaredClassMethod : 6 occurrences @@ -42,7 +42,6 @@ 'src/class-block-editor-content.php' => ['PhanPluginDuplicateConditionalNullCoalescing'], 'src/class-block-editor-extensions.php' => ['PhanRedundantCondition', 'PhanTypeMismatchReturnProbablyReal'], 'src/class-data.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeArraySuspicious', 'PhanTypeMismatchReturn'], - 'src/class-divi.php' => ['PhanUndeclaredProperty'], 'src/class-initializer.php' => ['PhanNoopNew', 'PhanPluginDuplicateConditionalNullCoalescing'], 'src/class-jwt-token-bridge.php' => ['PhanTypeMismatchReturn'], 'src/class-plan.php' => ['PhanTypeMismatchReturnProbablyReal'], diff --git a/projects/packages/videopress/changelog/fix-jetpack-handle_deprecation_notices_in_wild_found_during_14.4-a.3_deploy b/projects/packages/videopress/changelog/fix-jetpack-handle_deprecation_notices_in_wild_found_during_14.4-a.3_deploy new file mode 100644 index 0000000000000..ad55ef30b341d --- /dev/null +++ b/projects/packages/videopress/changelog/fix-jetpack-handle_deprecation_notices_in_wild_found_during_14.4-a.3_deploy @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Prevent deprecation notices on PHP 8. diff --git a/projects/packages/videopress/src/class-divi.php b/projects/packages/videopress/src/class-divi.php index bb3894c0f7089..7f3d180bdb3ac 100644 --- a/projects/packages/videopress/src/class-divi.php +++ b/projects/packages/videopress/src/class-divi.php @@ -25,6 +25,13 @@ class Divi { **/ private $running = false; + /** + * VideoPress Divi Extension object. + * + * @var ?\VideoPress_Divi_Extension + **/ + private $vidi_extension; + /** * Initializes VideoPress/Divi integration. * diff --git a/projects/plugins/jetpack/changelog/fix-jetpack-handle_deprecation_notices_in_wild_found_during_14.4-a.3_deploy b/projects/plugins/jetpack/changelog/fix-jetpack-handle_deprecation_notices_in_wild_found_during_14.4-a.3_deploy new file mode 100644 index 0000000000000..8783c5b61c2a2 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-jetpack-handle_deprecation_notices_in_wild_found_during_14.4-a.3_deploy @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Prevent deprecation notices on PHP 8. diff --git a/projects/plugins/jetpack/class.jetpack-post-images.php b/projects/plugins/jetpack/class.jetpack-post-images.php index f34d62dbc8b5f..280a5a040d0a4 100644 --- a/projects/plugins/jetpack/class.jetpack-post-images.php +++ b/projects/plugins/jetpack/class.jetpack-post-images.php @@ -898,7 +898,7 @@ public static function fit_image_url( $src, $width, $height ) { // If WPCOM hosted image use native transformations. $img_host = wp_parse_url( $src, PHP_URL_HOST ); - if ( str_ends_with( $img_host, '.files.wordpress.com' ) ) { + if ( $img_host && str_ends_with( $img_host, '.files.wordpress.com' ) ) { return add_query_arg( array( 'w' => $width, diff --git a/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php b/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php index b7abb5fb2ab40..1a033b3e9bb41 100644 --- a/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php +++ b/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php @@ -818,6 +818,9 @@ class_exists( 'Jetpack_AMP_Support' ) * @return string */ public function add_data_img_tags_and_enqueue_assets( $content ) { + if ( ! is_string( $content ) || $content === '' ) { + return ''; + } if ( class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request() diff --git a/projects/plugins/jetpack/modules/markdown/easy-markdown.php b/projects/plugins/jetpack/modules/markdown/easy-markdown.php index fb61aa1835917..6b0c2b4aa1e59 100644 --- a/projects/plugins/jetpack/modules/markdown/easy-markdown.php +++ b/projects/plugins/jetpack/modules/markdown/easy-markdown.php @@ -667,7 +667,7 @@ public function transform( $text, $args = array() ) { * @param string $text Content to be run through Markdown * @param array $args Array of Markdown options. */ - $text = apply_filters( 'wpcom_markdown_transform_pre', $text, $args ); + $text = apply_filters( 'wpcom_markdown_transform_pre', $text, $args ) ?? ''; // ensure our paragraphs are separated. $text = str_replace( array( '
', "
\n" ), "
\n\n", $text ); // visual editor likes to add
s. Buh-bye. diff --git a/projects/plugins/jetpack/modules/widgets/contact-info.php b/projects/plugins/jetpack/modules/widgets/contact-info.php index a8bda55a5e5b8..d1f769b630771 100644 --- a/projects/plugins/jetpack/modules/widgets/contact-info.php +++ b/projects/plugins/jetpack/modules/widgets/contact-info.php @@ -163,7 +163,10 @@ public function widget( $args, $instance ) { } } - if ( is_email( trim( $instance['email'] ) ) ) { + if ( + $instance['email'] + && is_email( trim( $instance['email'] ) ) + ) { printf( '
', esc_html( $instance['email'] )