show Pinterest for WooCommerce in `Marketing > Installed` (https://github.com/woocommerce/woocommerce-admin/pull/7417)

* show Pinterest for WooCommerce in `Marketing > Installed`

* tweak Pinterest bounding rect so padding is consistent with other icons

* add changelog entry

* add testing instructions

* tweak wording for clarity

* link to correct Pinterest admin settings URL

* detect if Pinterest is set up & link to onboarding if appropriate

* add utm_medium campaign link tracker tag to docs link

* change all the logs 🪵

* Remove redundant changelog entry from readme

Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>

* remove todo for Pinterest onboarded/setup status (now implemented)

Co-authored-by: Rua Haszard <rua@automattic.com>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
This commit is contained in:
Rua Haszard 2021-08-26 15:47:17 +12:00 committed by GitHub
parent 32e8f90c47
commit 0225ffdb8d
6 changed files with 106 additions and 0 deletions

View File

@ -10,6 +10,25 @@
4. Then, before hitting Continue again, click the "Business details" tab above to move back to that step
5. Confirm that the previously selected values are still correct
### Show Pinterest for WooCommerce in `Marketing > Installed` #7417
_Prerequisite_: This requires the forthcoming native [__Pinterest for WooCommerce__ extension](https://github.com/saucal/pinterest-for-woocommerce) (private repo may not be available).
If __Pinterest for WooCommerce__ is installed, marketing screen should show status info.
1. Install __Pinterest for WooCommerce__ extension. Don't activate it.
1. Go to `WooCommerce > Marketing`.
1. Confirm there is a row for Pinterest in `Installed marketing extensions` with `Activate` button.
1. Activate the extension by clicking the button, or via normal `WordPress > Plugins` screen.
1. Go to `WooCommerce > Marketing`.
1. Confirm the Pinterest row guides merchant to set up the extension (if not yet set up) or links to settings and docs.
Marketing screen should be unaffected if __Pinterest for WooCommerce__ is not installed.
1. Ensure __Pinterest for WooCommerce__ is not installed.
1. Go to `WooCommerce > Marketing`.
1. Should look and work the same as in previous versions.
### Fix end date for last periods #6584
1. Update your system clock to March 2021

View File

@ -0,0 +1,4 @@
Significance: minor
Type: Add
Add: Show Pinterest in installed marketing extensions (if installed) #7417

View File

@ -12,6 +12,10 @@ export { default as automatewooAlt } from './library/automatewoo-alt';
export { default as facebook } from './library/facebook';
export { default as facebookForWoocommerce } from './library/facebook';
// Pinterest
export { default as pinterest } from './library/pinterest';
export { default as pinterestForWoocommerce } from './library/pinterest';
// Google Ads
export { default as googleAds } from './library/google';
export { default as googleListingsAndAds } from './library/google';

View File

@ -0,0 +1,26 @@
/**
* External dependencies
*/
import { SVG, Path } from '@wordpress/primitives';
const pinterest = (
<SVG
width="303"
height="303"
viewBox="-30 -30 303 303"
fill="none"
xmlns="http://www.w3.org/2000/SVG"
>
<Path
fill="#E60023"
d="M121.5,0C54.4,0,0,54.4,0,121.5C0,173,32,217,77.2,234.7c-1.1-9.6-2-24.4,0.4-34.9
c2.2-9.5,14.2-60.4,14.2-60.4s-3.6-7.3-3.6-18c0-16.9,9.8-29.5,22-29.5c10.4,0,15.4,7.8,15.4,17.1c0,10.4-6.6,26-10.1,40.5
c-2.9,12.1,6.1,22,18,22c21.6,0,38.2-22.8,38.2-55.6c0-29.1-20.9-49.4-50.8-49.4C86.3,66.5,66,92.4,66,119.2c0,10.4,4,21.6,9,27.7
c1,1.2,1.1,2.3,0.8,3.5c-0.9,3.8-3,12.1-3.4,13.8c-0.5,2.2-1.8,2.7-4.1,1.6c-15.2-7.1-24.7-29.2-24.7-47.1
c0-38.3,27.8-73.5,80.3-73.5c42.1,0,74.9,30,74.9,70.2c0,41.9-26.4,75.6-63,75.6c-12.3,0-23.9-6.4-27.8-14c0,0-6.1,23.2-7.6,28.9
c-2.7,10.6-10.1,23.8-15.1,31.9c11.4,3.5,23.4,5.4,36,5.4c67.1,0,121.5-54.4,121.5-121.5C243,54.4,188.6,0,121.5,0z"
/>
</SVG>
);
export default pinterest;

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 243 243" style="enable-background:new 0 0 243 243;" xml:space="preserve">
<style type="text/css">
.st0{fill:#E60023;}
</style>
<g>
<path class="st0" d="M121.5,0C54.4,0,0,54.4,0,121.5C0,173,32,217,77.2,234.7c-1.1-9.6-2-24.4,0.4-34.9
c2.2-9.5,14.2-60.4,14.2-60.4s-3.6-7.3-3.6-18c0-16.9,9.8-29.5,22-29.5c10.4,0,15.4,7.8,15.4,17.1c0,10.4-6.6,26-10.1,40.5
c-2.9,12.1,6.1,22,18,22c21.6,0,38.2-22.8,38.2-55.6c0-29.1-20.9-49.4-50.8-49.4C86.3,66.5,66,92.4,66,119.2c0,10.4,4,21.6,9,27.7
c1,1.2,1.1,2.3,0.8,3.5c-0.9,3.8-3,12.1-3.4,13.8c-0.5,2.2-1.8,2.7-4.1,1.6c-15.2-7.1-24.7-29.2-24.7-47.1
c0-38.3,27.8-73.5,80.3-73.5c42.1,0,74.9,30,74.9,70.2c0,41.9-26.4,75.6-63,75.6c-12.3,0-23.9-6.4-27.8-14c0,0-6.1,23.2-7.6,28.9
c-2.7,10.6-10.1,23.8-15.1,31.9c11.4,3.5,23.4,5.4,36,5.4c67.1,0,121.5-54.4,121.5-121.5C243,54.4,188.6,0,121.5,0z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -24,6 +24,7 @@ class InstalledExtensions {
$automatewoo = self::get_automatewoo_extension_data();
$mailchimp = self::get_mailchimp_extension_data();
$facebook = self::get_facebook_extension_data();
$pinterest = self::get_pinterest_extension_data();
$google = self::get_google_extension_data();
$hubspot = self::get_hubspot_extension_data();
$amazon_ebay = self::get_amazon_ebay_extension_data();
@ -40,6 +41,10 @@ class InstalledExtensions {
$data[] = $facebook;
}
if ( $pinterest ) {
$data[] = $pinterest;
}
if ( $google ) {
$data[] = $google;
}
@ -66,6 +71,7 @@ class InstalledExtensions {
'mailchimp-for-woocommerce',
'creative-mail-by-constant-contact',
'facebook-for-woocommerce',
'pinterest-for-woocommerce',
'google-listings-and-ads',
'hubspot-for-woocommerce',
'woocommerce-amazon-ebay-integration',
@ -152,6 +158,37 @@ class InstalledExtensions {
return $data;
}
/**
* Get Pinterest extension data.
*
* @return array|bool
*/
protected static function get_pinterest_extension_data() {
$slug = 'pinterest-for-woocommerce';
if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
return false;
}
$data = self::get_extension_base_data( $slug );
$data['icon'] = plugins_url( 'images/marketing/pinterest.svg', WC_ADMIN_PLUGIN_FILE );
// TODO: Finalise docs url.
$data['docsUrl'] = 'https://docs.woocommerce.com/document/pinterest-for-woocommerce/?utm_medium=product';
if ( 'activated' === $data['status'] && class_exists( 'Pinterest_For_Woocommerce' ) ) {
$pinterest_onboarding_completed = Pinterest_For_Woocommerce()::is_setup_complete();
if ( $pinterest_onboarding_completed ) {
$data['status'] = 'configured';
$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/pinterest/settings' );
} else {
$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/pinterest/landing' );
}
}
return $data;
}
/**
* Get Google extension data.
*