Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the ability to update Woo.com extensions not available in WP.org plugin directory #44279

Merged
merged 82 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
ef548a6
Remove the hook for updating update_plugins transient with data fetch…
thilinah Feb 1, 2024
735c888
Remove the hook for updating update_themes transient with data fetche…
thilinah Feb 1, 2024
17a2b53
Remove the class hand hooks used for updating the API response of WP.…
thilinah Feb 1, 2024
0844ef4
Add change log file.
thilinah Feb 1, 2024
3df65bb
Merge branch 'trunk' into remove/updates-for-woo.com-extensions
thilinah Feb 5, 2024
3f99ff2
Add update_plugins and themes transient update hooks back while remov…
thilinah Feb 7, 2024
bbcae99
Adding a hook to modify the plugin update notification on plugins.php.
thilinah Feb 7, 2024
7edbf8f
Utility class for Woo Marketplace plugin.
thilinah Feb 7, 2024
8f10e2a
Check wether the Woo marketplace plugin is already installed before m…
thilinah Feb 7, 2024
7abb7da
Update docblocks.
thilinah Feb 7, 2024
737bca5
Add status end point for wccom-site API.
thilinah Feb 7, 2024
e4a5304
Check the existence of marketplace plugin only after the plugins are …
thilinah Feb 8, 2024
e6514e4
Add WP.org plugin api response updater back to core.
thilinah Feb 19, 2024
904cdb2
Function to identify if the market-place plugin is installed.
thilinah Feb 20, 2024
86437c6
Update status API response with installation status.
thilinah Feb 20, 2024
dd0aeae
Update the status variable push to store admin frontend with informat…
thilinah Feb 20, 2024
d83adf1
Styles for woo-connect-plugin component.
thilinah Feb 20, 2024
38d510e
Component for displaying the message to install Woo Connect plugin ba…
thilinah Feb 20, 2024
883e8ed
Add Woo Connect plugin notice to my-subscriptions page.
thilinah Feb 20, 2024
991c087
Add Woo connect plugin message to discover page.
thilinah Feb 20, 2024
74fb9d9
Add Woo Connect install/download urls to constants file.
thilinah Feb 20, 2024
12aa01a
Add a modal for asking the user to install Woo Connect plugin.
thilinah Feb 20, 2024
53b5d88
Update strings with constants.
thilinah Feb 20, 2024
004371b
Show the Woo Connect modal when user updating plugins without Woo Con…
thilinah Feb 20, 2024
a444110
Show Woo Connect install notifications only when the site is connected.
thilinah Feb 21, 2024
cf83fde
Update plugin management page messaging.
thilinah Feb 21, 2024
6bed881
Update notification on connect screen.
thilinah Feb 21, 2024
14b4b5e
Update notifications on plugin management page.
thilinah Feb 21, 2024
efc0e6d
Remove additional spacing in Plugin Install Notice and spacing in the…
thilinah Feb 21, 2024
52abc3c
Use notice component instead of Card.
thilinah Feb 22, 2024
fca09b5
Minor improvements to readability.
thilinah Feb 23, 2024
3091121
Add translation support for messages displayed on plugins.php.
thilinah Feb 23, 2024
18ef713
Update woo connect plugin installation URL (#45127)
thilinah Feb 27, 2024
65ec97f
Rename Woo Connect to Woo Update Manager.
thilinah Feb 27, 2024
f76d68b
Rename wccom-site status endpoint response variables based on plugin …
thilinah Feb 27, 2024
ceb645f
Update the plugin main file name for Woo Update Manager.
thilinah Feb 28, 2024
ecf4be0
Updating the download URL.
thilinah Feb 28, 2024
121ef04
Updating css class names and file names from `woo-connect-plugin` to …
thilinah Feb 28, 2024
34572cd
Change wooConnect variables to wooUpdateManager.
thilinah Feb 28, 2024
2dd8ef6
Rename WC_Helper_Plugin to WC_Woo_Update_Manager_Plugin and remove re…
thilinah Feb 28, 2024
7a64470
Extract and reuse the logic for creating the signature.
thilinah Feb 28, 2024
c57dddb
Use WC built-in method to check if the current page is a WC page.
thilinah Feb 28, 2024
4ee30d2
Add source parameter for installer.
thilinah Mar 1, 2024
943c1bc
Update text copies based on flows for in-app Woo Update Manager insta…
thilinah Mar 5, 2024
cfbf362
Update admin notice based on the flows.
thilinah Mar 5, 2024
a45216d
Update connect store message.
thilinah Mar 5, 2024
3e78a1d
Update the text based on the latest flow and show a different message…
thilinah Mar 5, 2024
5af5d4e
Use html text for install notice message.
thilinah Mar 5, 2024
259e9ed
Implement the bubble showing number of updates available on WooCommer…
thilinah Mar 5, 2024
0a973c3
Update install url to new structure.
thilinah Mar 6, 2024
a8bd90d
Update download url for WUM.
thilinah Mar 6, 2024
2ace396
Add a method to get the id of the WUM.
thilinah Mar 6, 2024
b9da926
Remove WUM from available to install list of extensions on my-subscri…
thilinah Mar 6, 2024
fcc74f3
Remove the hard coded ID of the Woo Update Manager and use the slug t…
thilinah Mar 7, 2024
ed5aee5
Fixing the notice generated due to empty body.
thilinah Mar 7, 2024
de79035
Update CTA and image for the not connected screen.
thilinah Mar 7, 2024
5520d4a
Increasing the left margin of the install notice to match admin notices.
thilinah Mar 8, 2024
be685db
Add close button to modal with message to activate WUM.
thilinah Mar 8, 2024
85c6c18
Add install/activate notice to Browse and Themes tabs.
thilinah Mar 8, 2024
561b443
Add the view for showing admin notice for activating the plugin.
thilinah Mar 8, 2024
7cf8f9d
Update plugin name on install admin notice.
thilinah Mar 8, 2024
846b3b4
Show install or activate admin notice based on the context.
thilinah Mar 8, 2024
db61000
Update comment
thilinah Mar 8, 2024
ac5a78e
Make the linked text shorter in plugin update message.
thilinah Mar 8, 2024
d0e1c1f
Generate a signed auto-install URL for woo hosted plugins without hel…
anaspk Mar 12, 2024
5dcebbb
Update activate Woo Update Manager modal buttons.
thilinah Mar 12, 2024
020f0d4
Change install url from Woo Update Manager ID to slug.
thilinah Mar 12, 2024
3d5b30f
Merge branch 'trunk' into remove/updates-for-woo.com-extensions
thilinah Mar 12, 2024
19bb02c
Allow defining the menu title and page title separately for when addi…
thilinah Mar 14, 2024
41c3b3b
Set the page title separately for WooCommerce Extensions menu.
thilinah Mar 14, 2024
7681e62
Fix the update count issue.
thilinah Mar 14, 2024
a853192
Update the download URL for Woo Update Manager.
thilinah Mar 14, 2024
d14074d
Update the download link for WUM in admin notices.
thilinah Mar 19, 2024
61b4248
Show WUM admin notices on WC Admin pages only when the site is connec…
thilinah Mar 19, 2024
2fa0469
Remove additional slash in plugin admin url.
thilinah Mar 19, 2024
f9aa0e1
Add wum-installed parameter to the connect URL (#45702)
anaspk Mar 19, 2024
26c5ac8
Fix lint errors.
thilinah Mar 20, 2024
584c058
Fix lint error.
thilinah Mar 20, 2024
d4ee881
Merge branch 'trunk' into remove/updates-for-woo.com-extensions
thilinah Mar 20, 2024
96e2f50
Fix lint errors.
thilinah Mar 20, 2024
90076c1
Fix js lint issues.
thilinah Mar 20, 2024
75cbfd2
Update Woo Update manager admin notice.
thilinah Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ export const MARKETPLACE_COLLABORATION_PATH =
MARKETPLACE_HOST +
'/document/managing-woocommerce-com-subscriptions/#transfer-a-woocommerce-com-subscription';
export const WP_ADMIN_PLUGIN_LIST_URL = ADMIN_URL + '/plugins.php';
export const WOO_CONNECT_PLUGIN_DOWNLOAD_URL =
MARKETPLACE_HOST + '/product-download/woo-update-manager';
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ProductLoader from '../product-loader/product-loader';
import { MarketplaceContext } from '../../contexts/marketplace-context';
import { ProductType } from '../product-list/types';
import './discover.scss';
import PluginInstallNotice from '../woo-update-manager-plugin/plugin-install-notice';

export default function Discover(): JSX.Element | null {
const [ productGroups, setProductGroups ] = useState<
Expand Down Expand Up @@ -70,6 +71,7 @@ export default function Discover(): JSX.Element | null {
const groupsList = productGroups.flatMap( ( group ) => group );
return (
<div className="woocommerce-marketplace__discover">
<PluginInstallNotice />
{ groupsList.map( ( groups ) => (
<ProductList
key={ groups.id }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
.woocommerce-marketplace__my-subscriptions__icon {
width: 80px;
height: 80px;
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIg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xVjYwLjQ0OTVWNTcuMTE4Mkg0Ni43OTA1VjYwLjQ0OTVaIiBmaWxsPSIjRTBFMEUwIi8+CjxwYXRoIGQ9Ik01NS40MTEyIDU3Ljk2Nkw2MC4xMjMyIDYyLjY3OEw2Mi40NzczIDYwLjMyMzlMNTcuNzY1NCA1NS42MTE5TDU1LjQxMTIgNTMuMjU3OEw1My4wNTcxIDU1LjYxMTlMNTUuNDExMiA1Ny45NjZaIiBmaWxsPSIjRTBFMEUwIi8+CjxwYXRoIGQ9Ik02MC4yNDkgNTAuMzE4Nkg2Ni45MTUzVjQ2Ljk4NzNINjAuMjQ5SDU2LjkyMTRWNTAuMzE4Nkg2MC4yNDlaIiBmaWxsPSIjRTBFMEUwIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDBfMzg1XzQ2NzgiPgo8cmVjdCB3aWR0aD0iNjYuNjY2NyIgaGVpZ2h0PSI2Ni42NjY3IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNyA3KSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=);
}

.woocommerce-marketplace__my-subscriptions__header {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { RefreshButton } from './table/actions/refresh-button';
import Notices from './notices';
import InstallModal from './table/actions/install-modal';
import { connectUrl } from '../../utils/functions';
import PluginInstallNotice from '../woo-update-manager-plugin/plugin-install-notice';

export default function MySubscriptions(): JSX.Element {
const { subscriptions, isLoading } = useContext( SubscriptionsContext );
Expand Down Expand Up @@ -54,7 +55,10 @@ export default function MySubscriptions(): JSX.Element {
);

const subscriptionsAvailable: Array< Subscription > = subscriptions.filter(
( subscription: Subscription ) => ! subscription.subscription_installed
( subscription: Subscription ) =>
! subscription.subscription_installed &&
wccomSettings?.wooUpdateManagerPluginSlug !==
subscription.product_slug
);

if ( ! wccomSettings?.isConnected ) {
Expand All @@ -67,12 +71,12 @@ export default function MySubscriptions(): JSX.Element {
</h2>
<p className="woocommerce-marketplace__my-subscriptions__description">
{ __(
'Connect your account to get updates, manage your subscriptions, and get seamless support. Once connected, your Woo.com subscriptions will appear here.',
"Connect your store to Woo.com using the Woo.com Update Manager. Once connected, you'll be able to manage your subscriptions, receive product updates, and access streamlined support from this screen.",
'woocommerce'
) }
</p>
<Button href={ connectUrl() } variant="primary">
{ __( 'Connect Account', 'woocommerce' ) }
{ __( 'Connect your store', 'woocommerce' ) }
</Button>
</div>
);
Expand All @@ -84,6 +88,7 @@ export default function MySubscriptions(): JSX.Element {
<section className="woocommerce-marketplace__my-subscriptions__notices">
<Notices />
</section>
<PluginInstallNotice />
<section className="woocommerce-marketplace__my-subscriptions-section woocommerce-marketplace__my-subscriptions__installed">
<header className="woocommerce-marketplace__my-subscriptions__header">
<div className="woocommerce-marketplace__my-subscriptions__header-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import {
updateProduct,
} from '../../../../utils/functions';
import { NoticeStatus } from '../../../../contexts/types';
import InstallWooConnectModal from '../../../woo-update-manager-plugin/install-woo-connect-modal';

interface UpdateProps {
subscription: Subscription;
wooUpdateManagerActive: boolean;
}

export default function Update( props: UpdateProps ) {
Expand All @@ -34,7 +36,8 @@ export default function Update( props: UpdateProps ) {
props.subscription.active &&
props.subscription.local &&
props.subscription.local.slug &&
props.subscription.local.path;
props.subscription.local.path &&
props.wooUpdateManagerActive;

function update() {
recordEvent( 'marketplace_product_update_button_clicked', {
Expand Down Expand Up @@ -156,6 +159,13 @@ export default function Update( props: UpdateProps ) {
onClose={ () => setShowModal( false ) }
/>
);
} else if ( ! props.wooUpdateManagerActive ) {
return (
<InstallWooConnectModal
subscription={ props.subscription }
onClose={ () => setShowModal( false ) }
/>
);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
subscribeUrl,
} from '../../../../utils/functions';
import { MARKETPLACE_COLLABORATION_PATH } from '../../../constants';
import { getAdminSetting } from '../../../../../utils/admin-settings';

type StatusBadge = {
text: string;
Expand Down Expand Up @@ -126,12 +127,14 @@ function getStatusBadge( subscription: Subscription ): StatusBadge | false {
}

function getVersion( subscription: Subscription ): string | JSX.Element {
const wccomSettings = getAdminSetting( 'wccomHelper', {} );

if ( subscription.local.version === subscription.version ) {
return <Version span={ subscription.local.version } />;
}

if ( subscription.local.version && subscription.version ) {
return <Update subscription={ subscription } />;
return <Update subscription={ subscription } wooUpdateManagerActive={wccomSettings?.wooUpdateManagerActive}/>;
}

if ( subscription.version ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Product, ProductType, SearchResultType } from '../product-list/types';
import { MARKETPLACE_ITEMS_PER_PAGE } from '../constants';
import { ADMIN_URL } from '~/utils/admin-settings';
import { ThemeSwitchWarningModal } from '~/customize-store/intro/warning-modals';
import PluginInstallNotice from '../woo-update-manager-plugin/plugin-install-notice';

interface ProductsProps {
categorySelector?: boolean;
Expand Down Expand Up @@ -136,6 +137,7 @@ export default function Products( props: ProductsProps ) {

return (
<div className={ containerClassName }>
<PluginInstallNotice />
<h2 className={ productListTitleClassName }>
{ isLoading ? ' ' : title }
</h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
* External dependencies
*/
import { Button, ButtonGroup, Modal } from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import sanitizeHTML from '../../../lib/sanitize-html';
import { Subscription } from '../my-subscriptions/types';
import {
WOO_CONNECT_PLUGIN_DOWNLOAD_URL,
WP_ADMIN_PLUGIN_LIST_URL,
} from '../constants';
import { getAdminSetting } from '../../../utils/admin-settings';

interface ConnectProps {
subscription: Subscription;
onClose: () => void;
}

export default function InstallWooConnectModal( props: ConnectProps ) {
const wccomSettings = getAdminSetting( 'wccomHelper', {} );
if ( ! wccomSettings?.wooUpdateManagerInstalled ) {
return (
<Modal
title={ __( 'Access your updates', 'woocommerce' ) }
onRequestClose={ props.onClose }
focusOnMount={ true }
className="woocommerce-marketplace__header-account-modal"
style={ { borderRadius: 4 } }
overlayClassName="woocommerce-marketplace__header-account-modal-overlay"
>
<p className="woocommerce-marketplace__header-account-modal-text">
<span
dangerouslySetInnerHTML={ sanitizeHTML(
sprintf(
// translators: %s is the product version number (e.g. 1.0.2).
__(
'Version %s is available. To access this update, please first <b>install the Woo.com Update Manager</b> extension. Alternatively, you can download and install it manually.',
'woocommerce'
),
props.subscription.version
)
) }
/>
</p>
<ButtonGroup className="woocommerce-marketplace__header-account-modal-button-group">
<Button
href={ WOO_CONNECT_PLUGIN_DOWNLOAD_URL }
variant="secondary"
>
{ __( 'Download', 'woocommerce' ) }
</Button>
<Button
href={ wccomSettings?.wooUpdateManagerInstallUrl }
variant="primary"
>
{ __( 'Install', 'woocommerce' ) }
</Button>
</ButtonGroup>
</Modal>
);
}

if ( ! wccomSettings?.wooUpdateManagerActive ) {
return (
<Modal
title={ __( 'Access your updates', 'woocommerce' ) }
onRequestClose={ props.onClose }
focusOnMount={ true }
className="woocommerce-marketplace__header-account-modal"
style={ { borderRadius: 4 } }
overlayClassName="woocommerce-marketplace__header-account-modal-overlay"
>
<p className="woocommerce-marketplace__header-account-modal-text">
<span
dangerouslySetInnerHTML={ sanitizeHTML(
sprintf(
// translators: %s is the product version number (e.g. 1.0.2).
__(
'Version %s is available. To access this update, please <b>activate the Woo.com Update Manager</b> extension.',
'woocommerce'
),
props.subscription.version
)
) }
/>
</p>
<ButtonGroup className="woocommerce-marketplace__header-account-modal-button-group">
<Button onClick={ props.onClose } variant="link">
{ __( 'Cancel', 'woocommerce' ) }
</Button>
<Button href={ WP_ADMIN_PLUGIN_LIST_URL } variant="primary">
{ __( 'Activate', 'woocommerce' ) }
</Button>
</ButtonGroup>
</Modal>
);
}

return null;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* External dependencies
*/
import { Button, Notice } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import sanitizeHTML from '../../../lib/sanitize-html';
import { getAdminSetting } from '../../../utils/admin-settings';
import {
WP_ADMIN_PLUGIN_LIST_URL,
WOO_CONNECT_PLUGIN_DOWNLOAD_URL,
} from '../constants';
import './woo-update-manager-plugin.scss';

export default function PluginInstallNotice() {
const wccomSettings = getAdminSetting( 'wccomHelper', {} );
if ( ! wccomSettings?.isConnected ) {
return null;
}

if (
! wccomSettings?.wooUpdateManagerActive &&
! wccomSettings?.wooUpdateManagerInstalled
) {
return (
<section className="woocommerce-marketplace__woo-update-manager-plugin__notices">
<Notice status="error" isDismissible={ false }>
<span
dangerouslySetInnerHTML={ sanitizeHTML(
__(
'Please install the <b>Woo.com Update Manager</b> to continue receiving the updates and streamlined support included in your Woo.com subscriptions.<br/>Alternatively, you can download and install it manually.',
'woocommerce'
)
) }
></span>
<div className="components-notice__buttons">
<Button
href={ wccomSettings?.wooUpdateManagerInstallUrl }
variant="secondary"
>
{ __( 'Install', 'woocommerce' ) }
</Button>
<Button
href={ WOO_CONNECT_PLUGIN_DOWNLOAD_URL }
variant="link"
>
{ __( 'Download', 'woocommerce' ) }
</Button>
</div>
</Notice>
</section>
);
} else if (
wccomSettings?.wooUpdateManagerInstalled &&
! wccomSettings?.wooUpdateManagerActive
) {
return (
<section className="woocommerce-marketplace__woo-update-manager-plugin__notices">
<Notice status="error" isDismissible={ false }>
<span
dangerouslySetInnerHTML={ sanitizeHTML(
__(
'Activate the <b>Woo.com Update Manager</b> to continue receiving the updates and streamlined support included in your Woo.com subscriptions.',
'woocommerce'
)
) }
></span>
<div className="components-notice__buttons">
<Button
href={ WP_ADMIN_PLUGIN_LIST_URL }
variant="secondary"
>
{ __( 'Activate', 'woocommerce' ) }
</Button>
</div>
</Notice>
</section>
);
}

return null;
}