Skip to content

Commit

Permalink
Merge branch 'develop' into pinterest-v5-integration-branch
Browse files Browse the repository at this point in the history
# Conflicts:
#	class-pinterest-for-woocommerce.php
#	i18n/languages/pinterest-for-woocommerce.pot
#	src/API/Base.php
  • Loading branch information
message-dimke committed Aug 25, 2023
2 parents 5e60e5a + c0eebf9 commit 591ce98
Show file tree
Hide file tree
Showing 26 changed files with 1,891 additions and 968 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Prepare New Release'
run-name: Prepare New Release `${{ github.event.inputs.type }}/${{ github.event.inputs.version }}` from by @${{ github.actor }}

# **What it does**: Does release preparation: creates the release branch and the PR with a checklist.
# **Why we have it**: To support devs automating a few manual steps, and to leave a nice reference for consumers.

on:
workflow_dispatch:
inputs:
## In the future we could infer that version from the changelog, or bump it via major|minor|patch.
version:
description: 'Version number to be released'
required: true
type:
description: 'Type of the release (release|hotfix)'
required: true
default: 'release'
wp-version:
description: 'WordPress tested up to'
wc-version:
description: 'WooCommerce tested up to'


jobs:
PrepareRelease:
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Create branch & PR
uses: woocommerce/grow/prepare-extension-release@actions-v1
with:
version: ${{ github.event.inputs.version }}
type: ${{ github.event.inputs.type }}
wp-version: ${{ github.event.inputs.wp-version }}
wc-version: ${{ github.event.inputs.wc-version }}
main-branch: 'trunk'
190 changes: 116 additions & 74 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
*** Pinterest for WooCommerce Changelog ***

*** Pinterest for WooCommerce Changelog ***

= 1.3.8 - 2023-08-15 =
* Fix - Caching of API calls.
* Fix - Make add to cart events independent from WooCommerce archive page settings.

= 1.3.7 - 2023-08-09 =
* Tweak - Don't fetch the allowed countries list when not connected.
* Tweak - Increase allowed countries cache lifetime to two days.
* Tweak - WC 8.0 compatibility.
* Tweak - WP 6.3 compatibility.
* Update - Add missing countries to the allowed countries list.

= 1.3.6 - 2023-07-25 =
* Dev - Add release preparation GH workflow.

= 1.3.5 - 2023-06-28 =
* Tweak - WC 7.9 compatibility.

= 1.3.4 - 2023-06-21 =
* Fix - Fixed error when getting transient for a key of null value.
* Fix - Release 1.3.3 - merge trunk into develop.
* Tweak - Generate a new pot file for translations.

= 1.3.3 - 2023-06-13 =
* Tweak - WC 7.8 compatibility.

= 1.3.2 - 2023-06-06 =
* Fix - Ensure there is no fatal error for PHP 8+ during activation.

= 1.3.1 - 2023-06-06 =
* Update - Pinterest feed generator backoff adjustments.

= 1.3.0 - 2023-05-30 =
* Add - Integration with WooCommerce multichannel marketing dashboard.
* Fix - Remove feed configuration during plugin uninstall procedure.
* Fix - Connection flow not redirection the wizard view.

= 1.2.21 - 2023-05-02 =
* Tweak - WC 7.7 compatibility.

= 1.2.20 - 2023-04-26 =
* Fix - Unescaped `add_query_arg` function calls.

= 1.2.19 - 2023-04-18 =
* Fix - Escape product name for JS tracker.
* Fix - On backorder items missing from the feed.
Expand Down Expand Up @@ -136,75 +178,75 @@
* Tweak - Updated the Track event generation script to prevent future errors.
* Tweak - WC 6.3 compatibility.
* Tweak - WP 5.9 compatibility.
= 1.0.10 - 2022-03-31 =
* Update - Feed Refactor with Action Scheduler Framework. ( [#368](https://github.com/woocommerce/pinterest-for-woocommerce/pull/368) )
= 1.0.9 - 2022-03-29 =
* Add - Plugin update framework. ( [#390](https://github.com/woocommerce/pinterest-for-woocommerce/pull/390 ) )
* Tweak - Use website verification instead of domains. ( [#391](https://github.com/woocommerce/pinterest-for-woocommerce/pull/391) )
* Tweak - Move deactivation hook to plugin file ( [#397](https://github.com/woocommerce/pinterest-for-woocommerce/pull/397) )
* Update - Add np:woocomerce param to partner data in the tag. ( [#404](https://github.com/woocommerce/pinterest-for-woocommerce/pull/404) )
* Fix - Remove invalid XML characters from feed. ( [#409](https://github.com/woocommerce/pinterest-for-woocommerce/pull/409) )
= 1.0.8 - 2022-03-11 =
* Update - Shipping column format. ( [#370](https://github.com/woocommerce/pinterest-for-woocommerce/pull/370) )
* Fix - Escape XML special chars in SKU for the XML MPN section. ( [#371](https://github.com/woocommerce/pinterest-for-woocommerce/pull/371) )
* Fix - Clean account data if user Disconnect during the onboarding process with a personal account. ( [#381](https://github.com/woocommerce/pinterest-for-woocommerce/pull/381) )
* Fix - Do not create merchant on get_feed_state. ( [#353](https://github.com/woocommerce/pinterest-for-woocommerce/pull/353) )
* Update - Disable enhanced match support when tracking is disabled. ( [#386](https://github.com/woocommerce/pinterest-for-woocommerce/pull/386) )
* Tweak - Take full size images for the feed. ( [#383](https://github.com/woocommerce/pinterest-for-woocommerce/pull/383) )
* Update - Enable shipping column in the feed. ( [#388](https://github.com/woocommerce/pinterest-for-woocommerce/pull/388) )
= 1.0.7 - 2022-02-24 =
* Fix - Critical error on Jetpack sites.
= 1.0.6 - 2022-02-16 =
* Fix – Fix the changelog for the 1.0.5 release by adding omitted changes.
= 1.0.5 - 2022-02-15 =
* Fix - Strip HTML shortcodes from feed.
* Fix - Make the price format consistent in the feed.
* Fix - Exclude zero price items from product feed.
* Tweak - Force logging to be enabled when setup is not complete.
* Add – Shipping column for developers and testers.
= 1.0.4 - 2022-02-03 =
* Fix - Store merchant id during the account creation. ( [#343](https://github.com/woocommerce/pinterest-for-woocommerce/pull/343) )
= 1.0.3 - 2022-01-25 =
* Fix - Allow proper setup for new merchants with no catalogs. ( [#339](https://github.com/woocommerce/pinterest-for-woocommerce/pull/339) )
= 1.0.2 - 2022-01-25 =
* Fix - Update and improve feedstate. ( [#240](https://github.com/woocommerce/pinterest-for-woocommerce/pull/240) )
* Add - Tooltips for the Publish Pins and Rich Pins options on the settings page. ( [#253](https://github.com/woocommerce/pinterest-for-woocommerce/pull/253) )
* Add - Merchant guidelines link in the setup page. ( [#255](https://github.com/woocommerce/pinterest-for-woocommerce/pull/255) )
* Add - Show a notice on the landing page if this extension does not support store country. ( [#256](https://github.com/woocommerce/pinterest-for-woocommerce/pull/256) )
* Update - Adjust image size for additional images. ( [#268](https://github.com/woocommerce/pinterest-for-woocommerce/pull/268) )
* Fix - Error message for merchants with declined status. ( [#272](https://github.com/woocommerce/pinterest-for-woocommerce/pull/272) )
* Add - Pinterest Ads Manager Call To Action UI. ( [#273](https://github.com/woocommerce/pinterest-for-woocommerce/pull/273) )
* Update - Tweak the UI of claim website. ( [#286](https://github.com/woocommerce/pinterest-for-woocommerce/pull/286) )
* Update - Remove unused parameters sent in create merchant request. ( [#294](https://github.com/woocommerce/pinterest-for-woocommerce/pull/294) )
* Add - Adding Woo Tracker for Usage Tracking. ( [#301](https://github.com/woocommerce/pinterest-for-woocommerce/pull/301) )
* Add - Implement Events Tracking. ( [#296](https://github.com/woocommerce/pinterest-for-woocommerce/pull/296) )
* Add - Product Attributes. ( [#303](https://github.com/woocommerce/pinterest-for-woocommerce/pull/303) )
* Update - API to v4. ( [#305](https://github.com/woocommerce/pinterest-for-woocommerce/pull/305) )
* Update - Refactor AccountConnection component. ( [#312](https://github.com/woocommerce/pinterest-for-woocommerce/pull/312) )
* Add - Product attribute for Google product category. ( [#317](https://github.com/woocommerce/pinterest-for-woocommerce/pull/317) )
* Fix - Onboarding wizard steps ( 2 and 3 ) are not clickable. ( [#318](https://github.com/woocommerce/pinterest-for-woocommerce/pull/318) )
* Fix - Fetch parent id for variable product during feed xml generation. ( [#320](https://github.com/woocommerce/pinterest-for-woocommerce/pull/320) )
* Fix - Plugin is blocking some 3rd party scripts. ( [#324](https://github.com/woocommerce/pinterest-for-woocommerce/pull/324) )
* Fix - Multiple catalog created on pinterest with no possibility to delete them. ( [#305](https://github.com/woocommerce/pinterest-for-woocommerce/pull/305) )
* Fix - Feed registration status is incorrect when user has more than one feed profile. ( [#335](https://github.com/woocommerce/pinterest-for-woocommerce/pull/335) )
= 1.0.1 - 2021-11-16 =
* Fix - Add PHP, JS & CSS linting GH actions.
* Fix - Enable enhanced match by default .
* Fix - Fix error with WC Session when accessing REST API endpoints publicly.
* Fix - Fix npm vulnerabilities.
* Fix - Update, clean and make green CSS & JS linters.
* Fix - Use Task List API to detect if we should show Pinterest onboarding tasks.
= 1.0.0 - 2021-10-25 =
- Initial release

= 1.0.10 - 2022-03-31 =
* Update - Feed Refactor with Action Scheduler Framework. ( [#368](https://github.com/woocommerce/pinterest-for-woocommerce/pull/368) )

= 1.0.9 - 2022-03-29 =
* Add - Plugin update framework. ( [#390](https://github.com/woocommerce/pinterest-for-woocommerce/pull/390 ) )
* Tweak - Use website verification instead of domains. ( [#391](https://github.com/woocommerce/pinterest-for-woocommerce/pull/391) )
* Tweak - Move deactivation hook to plugin file ( [#397](https://github.com/woocommerce/pinterest-for-woocommerce/pull/397) )
* Update - Add np:woocomerce param to partner data in the tag. ( [#404](https://github.com/woocommerce/pinterest-for-woocommerce/pull/404) )
* Fix - Remove invalid XML characters from feed. ( [#409](https://github.com/woocommerce/pinterest-for-woocommerce/pull/409) )

= 1.0.8 - 2022-03-11 =
* Update - Shipping column format. ( [#370](https://github.com/woocommerce/pinterest-for-woocommerce/pull/370) )
* Fix - Escape XML special chars in SKU for the XML MPN section. ( [#371](https://github.com/woocommerce/pinterest-for-woocommerce/pull/371) )
* Fix - Clean account data if user Disconnect during the onboarding process with a personal account. ( [#381](https://github.com/woocommerce/pinterest-for-woocommerce/pull/381) )
* Fix - Do not create merchant on get_feed_state. ( [#353](https://github.com/woocommerce/pinterest-for-woocommerce/pull/353) )
* Update - Disable enhanced match support when tracking is disabled. ( [#386](https://github.com/woocommerce/pinterest-for-woocommerce/pull/386) )
* Tweak - Take full size images for the feed. ( [#383](https://github.com/woocommerce/pinterest-for-woocommerce/pull/383) )
* Update - Enable shipping column in the feed. ( [#388](https://github.com/woocommerce/pinterest-for-woocommerce/pull/388) )

= 1.0.7 - 2022-02-24 =
* Fix - Critical error on Jetpack sites.

= 1.0.6 - 2022-02-16 =
* Fix – Fix the changelog for the 1.0.5 release by adding omitted changes.

= 1.0.5 - 2022-02-15 =
* Fix - Strip HTML shortcodes from feed.
* Fix - Make the price format consistent in the feed.
* Fix - Exclude zero price items from product feed.
* Tweak - Force logging to be enabled when setup is not complete.
* Add – Shipping column for developers and testers.

= 1.0.4 - 2022-02-03 =
* Fix - Store merchant id during the account creation. ( [#343](https://github.com/woocommerce/pinterest-for-woocommerce/pull/343) )

= 1.0.3 - 2022-01-25 =
* Fix - Allow proper setup for new merchants with no catalogs. ( [#339](https://github.com/woocommerce/pinterest-for-woocommerce/pull/339) )

= 1.0.2 - 2022-01-25 =
* Fix - Update and improve feedstate. ( [#240](https://github.com/woocommerce/pinterest-for-woocommerce/pull/240) )
* Add - Tooltips for the Publish Pins and Rich Pins options on the settings page. ( [#253](https://github.com/woocommerce/pinterest-for-woocommerce/pull/253) )
* Add - Merchant guidelines link in the setup page. ( [#255](https://github.com/woocommerce/pinterest-for-woocommerce/pull/255) )
* Add - Show a notice on the landing page if this extension does not support store country. ( [#256](https://github.com/woocommerce/pinterest-for-woocommerce/pull/256) )
* Update - Adjust image size for additional images. ( [#268](https://github.com/woocommerce/pinterest-for-woocommerce/pull/268) )
* Fix - Error message for merchants with declined status. ( [#272](https://github.com/woocommerce/pinterest-for-woocommerce/pull/272) )
* Add - Pinterest Ads Manager Call To Action UI. ( [#273](https://github.com/woocommerce/pinterest-for-woocommerce/pull/273) )
* Update - Tweak the UI of claim website. ( [#286](https://github.com/woocommerce/pinterest-for-woocommerce/pull/286) )
* Update - Remove unused parameters sent in create merchant request. ( [#294](https://github.com/woocommerce/pinterest-for-woocommerce/pull/294) )
* Add - Adding Woo Tracker for Usage Tracking. ( [#301](https://github.com/woocommerce/pinterest-for-woocommerce/pull/301) )
* Add - Implement Events Tracking. ( [#296](https://github.com/woocommerce/pinterest-for-woocommerce/pull/296) )
* Add - Product Attributes. ( [#303](https://github.com/woocommerce/pinterest-for-woocommerce/pull/303) )
* Update - API to v4. ( [#305](https://github.com/woocommerce/pinterest-for-woocommerce/pull/305) )
* Update - Refactor AccountConnection component. ( [#312](https://github.com/woocommerce/pinterest-for-woocommerce/pull/312) )
* Add - Product attribute for Google product category. ( [#317](https://github.com/woocommerce/pinterest-for-woocommerce/pull/317) )
* Fix - Onboarding wizard steps ( 2 and 3 ) are not clickable. ( [#318](https://github.com/woocommerce/pinterest-for-woocommerce/pull/318) )
* Fix - Fetch parent id for variable product during feed xml generation. ( [#320](https://github.com/woocommerce/pinterest-for-woocommerce/pull/320) )
* Fix - Plugin is blocking some 3rd party scripts. ( [#324](https://github.com/woocommerce/pinterest-for-woocommerce/pull/324) )
* Fix - Multiple catalog created on pinterest with no possibility to delete them. ( [#305](https://github.com/woocommerce/pinterest-for-woocommerce/pull/305) )
* Fix - Feed registration status is incorrect when user has more than one feed profile. ( [#335](https://github.com/woocommerce/pinterest-for-woocommerce/pull/335) )

= 1.0.1 - 2021-11-16 =
* Fix - Add PHP, JS & CSS linting GH actions.
* Fix - Enable enhanced match by default .
* Fix - Fix error with WC Session when accessing REST API endpoints publicly.
* Fix - Fix npm vulnerabilities.
* Fix - Update, clean and make green CSS & JS linters.
* Fix - Use Task List API to detect if we should show Pinterest onboarding tasks.

= 1.0.0 - 2021-10-25 =
- Initial release

28 changes: 26 additions & 2 deletions class-pinterest-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ public function init_plugin() {
add_action( 'init', array( Pinterest\AdCredits::class, 'schedule_event' ) );
add_action( 'init', array( Pinterest\RefreshToken::class, 'schedule_event' ) );

// Register the marketing channel if the feature is included.
if ( defined( 'WC_MCM_EXISTS' ) ) {
add_action(
'init',
array( Pinterest\MultichannelMarketing\MarketingChannelRegistrar::class, 'register' )
);
}

// Verify that the ads_campaign is active or not.
add_action( 'admin_init', array( Pinterest\AdCredits::class, 'check_if_ads_campaign_is_active' ) );

Expand Down Expand Up @@ -549,7 +557,7 @@ public static function get_data( $key, $force = false ) {

$settings = self::get_settings( $force, PINTEREST_FOR_WOOCOMMERCE_DATA_NAME );

return empty( $settings[ $key ] ) ? null : $settings[ $key ];
return $settings[ $key ] ?? null;
}


Expand All @@ -572,6 +580,20 @@ public static function save_data( $key, $data ) {
return self::save_settings( $settings, PINTEREST_FOR_WOOCOMMERCE_DATA_NAME );
}

/**
* Remove APP Data key.
*
* @param string $key - The key of specific data to retrieve.
*
* @since 1.3.1
*
* @return bool - True if the data was removed, false otherwise.
*/
public static function remove_data( string $key ) {
$settings = self::get_settings( true, PINTEREST_FOR_WOOCOMMERCE_DATA_NAME );
unset( $settings[ $key ] );
return self::save_settings( $settings, PINTEREST_FOR_WOOCOMMERCE_DATA_NAME );
}

/**
* Add API endpoints
Expand Down Expand Up @@ -808,9 +830,11 @@ public static function get_middleware_url( $context = 'login', $args = array() )

$state = http_build_query( $state_params );

set_transient( PINTEREST_FOR_WOOCOMMERCE_AUTH, $control_key, MINUTE_IN_SECONDS * 5 );

// phpcs:ignore Squiz.Commenting.InlineComment.InvalidEndChar
// nosemgrep: audit.php.wp.security.xss.query-arg
return self::get_connection_proxy_url() . 'connect/' . PINTEREST_FOR_WOOCOMMERCE_WOO_CONNECT_SERVICE . '?' . $state;
return self::get_connection_proxy_url() . 'login/' . PINTEREST_FOR_WOOCOMMERCE_WOO_CONNECT_SERVICE . '?' . $state;
}


Expand Down
Loading

0 comments on commit 591ce98

Please sign in to comment.