diff --git a/projects/plugins/wpcomsh/changelog/update-wpcom-plugins-remove-old b/projects/plugins/wpcomsh/changelog/update-wpcom-plugins-remove-old new file mode 100644 index 0000000000000..dea50ed90d129 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/update-wpcom-plugins-remove-old @@ -0,0 +1,4 @@ +Significance: patch +Type: removed + +Remove the old plugin banner code diff --git a/projects/plugins/wpcomsh/composer.json b/projects/plugins/wpcomsh/composer.json index 31a0852c09d86..c0b42f6dd000d 100644 --- a/projects/plugins/wpcomsh/composer.json +++ b/projects/plugins/wpcomsh/composer.json @@ -49,7 +49,6 @@ "widgets", "wpcom-features", "wpcom-migration-helpers", - "wpcom-plugins", "wpcom-themes" ] }, diff --git a/projects/plugins/wpcomsh/wpcom-plugins/css/banner.css b/projects/plugins/wpcomsh/wpcom-plugins/css/banner.css deleted file mode 100644 index cda2b9923ef73..0000000000000 --- a/projects/plugins/wpcomsh/wpcom-plugins/css/banner.css +++ /dev/null @@ -1,123 +0,0 @@ -:root { - --wpcom-plugins-banner-image: ''; -} - -@font-face { - font-display: swap; - font-family: "Recoleta"; - font-weight: 400; - src: url("https://s1.wp.com/i/fonts/recoleta/400.woff2") format("woff2"), url("https://s1.wp.com/i/fonts/recoleta/400.woff") format("woff"); -} - -.wpcom-plugins-banner { - background-color: #242424; - padding: 64px 32px; - border-radius: 10px; - margin: 25px 0; - background-image: var(--wpcom-plugins-banner-image); - background-repeat: no-repeat; - background-position: bottom right 64px; - background-size: 530px; -} - -.rtl .wpcom-plugins-banner { - background-position: bottom left 64px; -} - -.wpcom-plugins-banner__content { - width: 540px; -} - -#wpcontent .wpcom-plugins-banner h3, -#wpcontent .wpcom-plugins-banner p { - font-weight: 400; - letter-spacing: -0.32px; - margin: 10px 0; - text-wrap: pretty; -} - -.wpcom-plugins-banner h3 { - font-family: 'Recoleta'; - font-size: 32px; - line-height: 40px; - color: #FFF; -} - -.wpcom-plugins-banner p { - font-size: 16px; - line-height: 24px; - color: #A7AAAD; -} - -.wpcom-plugins-banner a, -.wpcom-plugins-banner a:visited { - background-color: #3858E9; - color: white; - border-radius: 4px; - padding: 10px 24px; - font-size: 14px; - line-height: 20px; - letter-spacing: 0.32px; - text-decoration: none; - display: inline-block; - margin-top: 32px; -} - -.wpcom-plugins-banner a:hover, -.wpcom-plugins-banner a:focus { - background-color: white; - color: #1d2327; -} - -@media (max-width: 1260px) { - .wpcom-plugins-banner { - padding: 32px; - background-size: 400px; - } - - .wpcom-plugins-banner a { - padding: 10px 20px; - margin-top: 12px; - } -} - -@media (max-width: 1120px) { - .wpcom-plugins-banner { - background-position: bottom right 5px; - background-size: 300px - } - .rtl .wpcom-plugins-banner { - background-position: bottom left 5px; - } -} - -@media (max-width: 850px) { - .wpcom-plugins-banner { - background-image: none; - } - - .wpcom-plugins-banner__content { - width: auto; - } -} - -@media (max-width: 782px) { - .wpcom-plugins-banner { - padding: 24px; - } - - .wpcom-plugins-banner h3, - .wpcom-plugins-banner p { - margin: 8px 0; - } - - .wpcom-plugins-banner h3 { - font-size: 24px; - line-height: 32px; - } - - .wpcom-plugins-banner p { - font-size: 14px; - line-height: 20px; - } -} diff --git a/projects/plugins/wpcomsh/wpcom-plugins/images/banner-background.webp b/projects/plugins/wpcomsh/wpcom-plugins/images/banner-background.webp deleted file mode 100644 index 2c8e6c6aea762..0000000000000 Binary files a/projects/plugins/wpcomsh/wpcom-plugins/images/banner-background.webp and /dev/null differ diff --git a/projects/plugins/wpcomsh/wpcom-plugins/images/wpcom-logo.svg b/projects/plugins/wpcomsh/wpcom-plugins/images/wpcom-logo.svg deleted file mode 100644 index f3c41ebe726fc..0000000000000 --- a/projects/plugins/wpcomsh/wpcom-plugins/images/wpcom-logo.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/projects/plugins/wpcomsh/wpcom-plugins/js/banner.js b/projects/plugins/wpcomsh/wpcom-plugins/js/banner.js deleted file mode 100644 index 9f04625b4a241..0000000000000 --- a/projects/plugins/wpcomsh/wpcom-plugins/js/banner.js +++ /dev/null @@ -1,43 +0,0 @@ -/* global wpcomPluginsBanner */ - -document.addEventListener("DOMContentLoaded", () => { - const pluginBrowser = document.querySelector("#plugin-filter"); - if (!pluginBrowser) { - return; - } - - document.documentElement.style.setProperty( - "--wpcom-plugins-banner-image", - `url(${wpcomPluginsBanner.bannerBackground})` - ); - - pluginBrowser.insertAdjacentHTML( - "beforebegin", - ` -
-
- WordPress.com -

${wpcomPluginsBanner.title}

-

${wpcomPluginsBanner.description}

- ${wpcomPluginsBanner.actionText} -
-
- ` - ); - - const wpcomPluginObserver = new MutationObserver(() => { - if ( - !document.querySelector(".plugin-install-search .current") || - document.querySelector(".no-plugin-results") - ) { - document - .querySelector(".wpcom-plugins-banner") - .classList.remove("hidden"); - } else { - document.querySelector(".wpcom-plugins-banner").classList.add("hidden"); - } - }); - wpcomPluginObserver.observe(document.getElementById("plugin-filter"), { - childList: true, - }); -}); diff --git a/projects/plugins/wpcomsh/wpcom-plugins/plugins.php b/projects/plugins/wpcomsh/wpcom-plugins/plugins.php deleted file mode 100644 index f03ab13f22662..0000000000000 --- a/projects/plugins/wpcomsh/wpcom-plugins/plugins.php +++ /dev/null @@ -1,61 +0,0 @@ - 'defer', - 'in_footer' => true, - ) - ); - wp_localize_script( - 'wpcom-plugins-banner', - 'wpcomPluginsBanner', - array( - 'logo' => esc_url( $wpcom_logo ), - 'title' => esc_html__( "Flex your site's features with plugins", 'wpcomsh' ), - 'description' => esc_html__( "Access a variety of free and paid plugins that can enhance your site's functionality and features.", 'wpcomsh' ), - 'actionUrl' => esc_url( "https://wordpress.com/plugins/$site_slug?ref=woa-plugin-banner" ), - 'actionText' => esc_html__( 'Explore plugins', 'wpcomsh' ), - 'bannerBackground' => esc_url( $background_image ), - ) - ); - wp_enqueue_style( - 'wpcom-plugins-banner', - plugins_url( 'css/banner.css', __FILE__ ), - array(), - WPCOMSH_VERSION, - ); -} -add_action( 'load-plugin-install.php', 'wpcomsh_plugins_show_banner' );