Skip to content

Commit

Permalink
Merge pull request ampproject#7864 from ampproject/fix/isset-check
Browse files Browse the repository at this point in the history
Add isset() check in case source type is absent
  • Loading branch information
westonruter authored Sep 3, 2024
2 parents 1350e8b + 296c233 commit ad24bd7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test-measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ jobs:
external-http: true

- php: '7.4'
wp: '6.3'
wp: '6.5'
phpunit: '7'

- php: '7.4'
wp: '6.3'
wp: '6.5'
phpunit: '7'
external-http: true
steps:
Expand Down Expand Up @@ -507,7 +507,7 @@ jobs:
wp: 'latest'

- php: '7.4'
wp: '6.3'
wp: '6.5'
steps:
- name: Shutdown default MySQL service
if: needs.pre-run.outputs.changed-php-count > 0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An easier path to great Page Experience for everyone. Powered by AMP.

**Contributors:** [google](https://profiles.wordpress.org/google), [xwp](https://profiles.wordpress.org/xwp), [rtcamp](https://profiles.wordpress.org/rtcamp), [automattic](https://profiles.wordpress.org/automattic), [westonruter](https://profiles.wordpress.org/westonruter), [albertomedina](https://profiles.wordpress.org/albertomedina), [schlessera](https://profiles.wordpress.org/schlessera), [delawski](https://profiles.wordpress.org/delawski/), [swissspidy](https://profiles.wordpress.org/swissspidy), [pierlo](https://profiles.wordpress.org/pierlo), [joshuawold](https://profiles.wordpress.org/joshuawold), [thelovekesh](https://profiles.wordpress.org/thelovekesh/)
**Tags:** [page experience](https://wordpress.org/plugins/tags/page-experience), [performance](https://wordpress.org/plugins/tags/performance), [amp](https://wordpress.org/plugins/tags/amp), [mobile](https://wordpress.org/plugins/tags/mobile), [optimization](https://wordpress.org/plugins/tags/optimization)
**Requires at least:** 6.3
**Requires at least:** 6.5
**Tested up to:** 6.6
**Stable tag:** 2.5.4
**License:** [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)
Expand Down
2 changes: 1 addition & 1 deletion amp.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
* Version: 2.5.5-alpha
* License: GPLv2 or later
* Requires at least: 6.3
* Requires at least: 6.5
* Requires PHP: 7.4
*
* @package AMP
Expand Down
2 changes: 1 addition & 1 deletion includes/validation/class-amp-validation-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ static function ( $enqueued_script_source ) use ( $script_handle ) {

$has_non_core = false;
foreach ( $extra_sources as $extra_source ) {
if ( 'core' !== $extra_source['type'] ) {
if ( isset( $extra_source['type'] ) && 'core' !== $extra_source['type'] ) {
$has_non_core = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/DependencySupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DependencySupport implements Service {
*
* @var string
*/
const WP_MIN_VERSION = '6.3';
const WP_MIN_VERSION = '6.5';

/**
* Determines whether core or Gutenberg provides minimal support.
Expand Down
2 changes: 1 addition & 1 deletion tests/php/src/Admin/AmpPluginsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function test_is_needed() {
$this->assertFalse( AmpPlugins::is_needed() );

// Test 3: Admin request in supported WordPress .
$wp_version = '6.3';
$wp_version = '6.5';
set_current_screen( 'index.php' );
$this->assertTrue( AmpPlugins::is_needed() );

Expand Down
2 changes: 1 addition & 1 deletion tests/php/src/Admin/AmpThemesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function test_is_needed() {
$this->assertFalse( AmpThemes::is_needed() );

// Test 3: Admin request.
$wp_version = '6.3';
$wp_version = '6.5';
set_current_screen( 'index.php' );
$this->assertTrue( is_admin() );
$this->assertTrue( AmpThemes::is_needed() );
Expand Down
10 changes: 5 additions & 5 deletions tests/php/test-amp-style-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3524,11 +3524,11 @@ function ( $original_dom, $original_source, $amphtml_dom, $amphtml_source ) {
$this->assertStringContainsString( '.wp-block-audio figcaption', $amphtml_source, 'Expected block-library/style.css' );
}

if ( version_compare( strtok( get_bloginfo( 'version' ), '-' ), '6.6', '>=' ) ) {
$this->assertStringContainsString( '[class^="wp-block-"]:not(.wp-block-gallery) > figcaption', $amphtml_source, 'Expected twentyten/blocks.css' );
} else {
$this->assertStringContainsString( '[class^="wp-block-"]:not(.wp-block-gallery) figcaption', $amphtml_source, 'Expected twentyten/blocks.css' );
}
$this->assertStringContainsString(
'[class^="wp-block-"]:not(.wp-block-gallery) figcaption',
str_replace( '> figcaption', 'figcaption', $amphtml_source ), // Account for recent CSS changes.
'Expected twentyten/blocks.css'
);

$amphtml_source = preg_replace( '/\s*>\s*/', '>', $amphtml_source ); // Account for variance in postcss.
$this->assertStringContainsString( '.amp-wp-default-form-message>p', $amphtml_source, 'Expected amp-default.css' );
Expand Down

0 comments on commit ad24bd7

Please sign in to comment.