Skip to content

Commit

Permalink
Merge pull request #2160 from woocommerce/release/2.5.12
Browse files Browse the repository at this point in the history
Release 2.5.12
  • Loading branch information
jorgemd24 authored Nov 22, 2023
2 parents 1e9f143 + 676d649 commit 319a54b
Show file tree
Hide file tree
Showing 272 changed files with 1,653 additions and 2,914 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ Now you can build the files using one of these commands:
- `npm run start` : Build a development version, watch files for changes
- `npm run start:hot` : Build a development version in Fast Refresh mode, watch files for changes.

Notice this repository has `engine-strict=true` directive set. That means you cannot install dependencies with other Node engines rather than the ones defined in the `engines` directive inside [package.json](./package.json). It's recommended to use [NVM](https://github.com/nvm-sh/nvm) and run `nvm use` before installing the dependencies to be sure you're using the recommended Node version.

We added Node `^18` and npm `^9` to allow dependabot to update our dependencies. But these are not supported versions.

## Working with DEWP

The Dependency Extraction Webpack Plugin makes working with frontend dependencies not so obvious, check [`Working with DEWP.md`](Working with DEWP.md) for more details.
Expand Down
38 changes: 19 additions & 19 deletions bin/GoogleAdsCleanupServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,36 +160,36 @@ protected function remove_enums() {

foreach ( array_diff( $library_enums, $used_enums ) as $enum ) {
$this->remove_enum( $enum );
};
}
}

/**
* Remove a specific enum.
*
* @param string $enum Enum name.
* @param string $enum_name Enum name.
*/
protected function remove_enum( string $enum ) {
$this->output_text( "Removing enum {$enum}" );
protected function remove_enum( string $enum_name ) {
$this->output_text( "Removing enum {$enum_name}" );
$this->src_path = '/src/Google/Ads/GoogleAds';

$this->remove_file( "/{$this->version}/Enums/{$enum}Enum.php" );
$this->remove_file( "/{$this->version}/Enums/{$enum}Enum_{$enum}.php" );
$this->remove_file( "/{$this->version}/Enums/{$enum}Enum/{$enum}.php" );
$this->remove_directory( "/{$this->version}/Enums/{$enum}Enum" );
$this->remove_file( "/{$this->version}/Enums/{$enum_name}Enum.php" );
$this->remove_file( "/{$this->version}/Enums/{$enum_name}Enum_{$enum_name}.php" );
$this->remove_file( "/{$this->version}/Enums/{$enum_name}Enum/{$enum_name}.php" );
$this->remove_directory( "/{$this->version}/Enums/{$enum_name}Enum" );

// Remove metadata files.
$this->src_path = '/metadata/Google/Ads/GoogleAds';
$this->remove_file( "/{$this->version}/Enums/{$enum}.php" );
$this->remove_file( "/{$this->version}/Enums/{$enum_name}.php" );
}

/**
* Find a list of files in a path, including subdirectories, matching a pattern.
*
* @param string $path Package path
* @param string $match Regex pattern to match
* @param string $path Package path
* @param string $pattern Regex pattern to match
* @return array Matching files
*/
protected function get_dir_contents( $path, $match ) {
protected function get_dir_contents( $path, $pattern ) {
try {
$rdi = new RecursiveDirectoryIterator( $path );
} catch ( UnexpectedValueException $e ) {
Expand All @@ -203,7 +203,7 @@ protected function get_dir_contents( $path, $match ) {
}

$rii = new RecursiveIteratorIterator( $rdi );
$rri = new RegexIterator( $rii, $match );
$rri = new RegexIterator( $rii, $pattern );
$files = [];
foreach ( $rri as $file ) {
$files[] = $file->getPathname();
Expand Down Expand Up @@ -255,7 +255,7 @@ protected function find_library_file_pattern( string $pattern, string $suffix =
}

return array_map(
function( $file ) use ( $suffix ) {
function ( $file ) use ( $suffix ) {
$name = pathinfo( $file, PATHINFO_FILENAME );
return $suffix ? $this->remove_suffix( $suffix, $name ) : $name;
},
Expand Down Expand Up @@ -317,10 +317,10 @@ protected function remove_function( string $file, string $name ) {
// Parse until we encounter closing bracket.
for ( $end = $offset; $end < $length; $end++ ) {
if ( '{' === $contents[ $end ] ) {
$bracket++;
++$bracket;
}
if ( '}' === $contents[ $end ] ) {
$bracket--;
--$bracket;
if ( 1 > $bracket ) {
break;
}
Expand All @@ -334,7 +334,7 @@ protected function remove_function( string $file, string $name ) {

// Include whitespaces before start.
while ( 0 < $start && ctype_space( $contents[ $start - 1 ] ) ) {
$start--;
--$start;
}

$new = substr( $contents, 0, $start );
Expand Down Expand Up @@ -388,7 +388,7 @@ protected function remove_file( string $file ) {
return;
}

unlink( $file );
unlink( $file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.unlink_unlink
}

/**
Expand All @@ -403,7 +403,7 @@ protected function remove_directory( string $directory ) {
return;
}

rmdir( $directory );
rmdir( $directory ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_rmdir
}

/**
Expand Down
9 changes: 4 additions & 5 deletions bin/SymfonyPolyfillCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ protected function get_list_of_polyfills(): array {
public static function remove( Event $event = null ) {
$cleanup = new SymfonyPolyfillCleanup( $event );
$cleanup->remove_bootstraps80();

}

/**
Expand Down Expand Up @@ -131,10 +130,10 @@ protected function remove_statement_with_pattern( string $file, string $inner_pa
// Parse until we encounter closing bracket.
for ( $end = $offset; $end < $length; $end++ ) {
if ( '{' === $contents[ $end ] ) {
$bracket++;
++$bracket;
}
if ( '}' === $contents[ $end ] ) {
$bracket--;
--$bracket;
if ( 1 > $bracket ) {
break;
}
Expand All @@ -148,7 +147,7 @@ protected function remove_statement_with_pattern( string $file, string $inner_pa

// Include whitespaces before start.
while ( 0 < $start && ctype_space( $contents[ $start - 1 ] ) ) {
$start--;
--$start;
}

$new = substr( $contents, 0, $start );
Expand All @@ -174,7 +173,7 @@ protected function remove_file( string $file ) {
return;
}

unlink( $file );
unlink( $file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.unlink_unlink
}

/**
Expand Down
8 changes: 4 additions & 4 deletions bin/prefix-vendor-namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ function prefix_string( &$contents, $search ) {
*
* @since 2.2.2
*
* @param string $path Package path
* @param string $match Regex pattern to match
* @param string $path Package path
* @param string $pattern Regex pattern to match
* @return array Matching files
*/
function get_dir_contents( $path, $match ) {
function get_dir_contents( $path, $pattern ) {
try {
$rdi = new RecursiveDirectoryIterator( $path );
} catch ( UnexpectedValueException $e ) {
Expand All @@ -326,7 +326,7 @@ function get_dir_contents( $path, $match ) {
}

$rii = new RecursiveIteratorIterator( $rdi );
$rri = new RegexIterator( $rii, $match );
$rri = new RegexIterator( $rii, $pattern );
$files = [];
foreach ( $rri as $file ) {
$files[] = $file->getPathname();
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
*** WooCommerce Google Listings and Ads Changelog ***

= 2.5.12 - 2023-11-22 =
* Dev - Fix E2E gtag events tests.
* Dev - Update WordPress CS to 3.0.
* Dev - Update phpunit polyfills to 1.1 for WP 6.4.
* Tweak - Add filter to be able to build custom shipping method rate handers.
* Tweak - Remove rewrite rules flush.

= 2.5.11 - 2023-11-07 =
* Add - Record tracking events for moving steps on the campaign creation and editing pages.
* Tweak - Add tracking for campaign count.
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"dealerdirect/phpcodesniffer-composer-installer": "^v0.7",
"phpunit/phpunit": "^9.5",
"wp-cli/i18n-command": "^2.2",
"wp-coding-standards/wpcs": "^2.3",
"yoast/phpunit-polyfills": "^1.0"
"wp-coding-standards/wpcs": "^3.0",
"yoast/phpunit-polyfills": "^1.1.0"
},
"replace" : {
"google/grpc-gcp": "*",
Expand Down
Loading

0 comments on commit 319a54b

Please sign in to comment.