Skip to content

Commit

Permalink
Removes various production-enabled feature flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpap committed Jan 14, 2025
1 parent 5da4ed7 commit 6f892c4
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 149 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import { WPCOM_FEATURES_BACKUPS, WPCOM_FEATURES_SCAN } from '@automattic/calypso-products';
import { Icon, plugins } from '@wordpress/icons';
import { useTranslate } from 'i18n-calypso';
Expand Down Expand Up @@ -48,8 +47,6 @@ export default ( { path } ) => {
isSectionNameEnabled( 'site-purchases' ) &&
useSelector( ( state ) => canCurrentUser( state, siteId, 'own_site' ) );

const isPluginManagementEnabled = config.isEnabled( 'jetpack/plugin-management' );

return (
<>
<QuerySiteFeatures siteIds={ [ siteId ] } />
Expand All @@ -64,7 +61,7 @@ export default ( { path } ) => {
socialClicked: 'calypso_jetpack_sidebar_social_clicked',
} }
/>
{ isPluginManagementEnabled && isAgency && (
{ isAgency && (
<SidebarItem
// eslint-disable-next-line wpcalypso/jsx-classname-namespace
customIcon={ <Icon className="sidebar__menu-icon" size={ 28 } icon={ plugins } /> }
Expand Down
7 changes: 0 additions & 7 deletions client/hosting/performance/controller.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import config from '@automattic/calypso-config';
import page from '@automattic/calypso-router';
import PageViewTracker from 'calypso/lib/analytics/page-view-tracker';
import { SitePerformance } from './site-performance';
import type { Context as PageJSContext } from '@automattic/calypso-router';

export function sitePerformance( context: PageJSContext, next: () => void ) {
if ( ! config.isEnabled( 'performance-profiler/logged-in' ) ) {
page.redirect( '/' );
return;
}

context.primary = (
<>
<PageViewTracker path="/sites/performance/:site" title="Site Performance" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { recordTracksEvent } from '@automattic/calypso-analytics';
import config from '@automattic/calypso-config';
import page, { type Callback } from '@automattic/calypso-router';
import JetpackManageSidebar from 'calypso/jetpack-cloud/sections/sidebar-navigation/jetpack-manage';
import SitesSidebar from 'calypso/jetpack-cloud/sections/sidebar-navigation/sites';
Expand Down Expand Up @@ -31,8 +30,7 @@ export const agencyDashboardContext: Callback = ( context, next ) => {
};
const state = context.store.getState();
const isAgency = isAgencyUser( state );
const isAgencyEnabled = config.isEnabled( 'jetpack/agency-dashboard' );
if ( ! isAgency || ! isAgencyEnabled ) {
if ( ! isAgency ) {
// Redirect to Jetpack.com if the user is not an agency user & the origin is wp-admin
if ( origin === 'wp-admin' ) {
recordTracksEvent( 'calypso_jetpack_manage_redirect_to_manage_in_jetpack_dot_com' );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import config, { isEnabled } from '@automattic/calypso-config';
import { isEnabled } from '@automattic/calypso-config';
import { urlToSlug } from 'calypso/lib/url/http-utils';
import { AllowedTypes } from '../../types';

Expand Down Expand Up @@ -67,8 +67,7 @@ const getLinks = (
case 'plugin': {
link = `${ siteUrlWithScheme }/wp-admin/plugins.php`;
isExternalLink = true;
// FIXME: Remove this condition when we enable plugin management in production
if ( config.isEnabled( 'jetpack/plugin-management' ) && ! isAtomicSite ) {
if ( ! isAtomicSite ) {
link =
status === 'warning'
? `/plugins/updates/${ siteUrlWithMultiSiteSupport }`
Expand Down
4 changes: 1 addition & 3 deletions client/jetpack-cloud/sections/landing/controller.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import page, { type Callback, type Context } from '@automattic/calypso-router';
import debugModule from 'debug';
import { dashboardPath } from 'calypso/lib/jetpack/paths';
Expand Down Expand Up @@ -50,10 +49,9 @@ export const landForPrimarySite: Callback = ( context, next ) => {

const state = context.store.getState();

const isAgencyEnabled = config.isEnabled( 'jetpack/agency-dashboard' );
const isAgency = isAgencyUser( state );
const dashboardRedirectLink = dashboardPath();
if ( isAgencyEnabled && isAgency ) {
if ( isAgency ) {
debug( '[landForPrimarySite]: redirecting to agency dashboard' );

page.redirect( dashboardRedirectLink );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import page, { type Callback, type Context } from '@automattic/calypso-router';
import JetpackManageSidebar from 'calypso/jetpack-cloud/sections/sidebar-navigation/jetpack-manage';
import { isAgencyUser } from 'calypso/state/partner-portal/partner/selectors';
Expand All @@ -8,10 +7,8 @@ import PluginsOverview from './plugins-overview';
const redirectIfHasNoAccess = ( context: Context ) => {
const state = context.store.getState();
const isAgency = isAgencyUser( state );
const isAgencyEnabled = config.isEnabled( 'jetpack/agency-dashboard' );
const isPluginManagementEnabled = config.isEnabled( 'jetpack/plugin-management' );

if ( ! isAgency || ! isAgencyEnabled || ! isPluginManagementEnabled ) {
if ( ! isAgency ) {
page.redirect( '/' );
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import { WPCOM_FEATURES_BACKUPS, WPCOM_FEATURES_SCAN } from '@automattic/calypso-products';
import page from '@automattic/calypso-router';
import {
Expand Down Expand Up @@ -81,8 +80,6 @@ const useMenuItems = ( {
useSelector( ( state ) => canCurrentUser( state, siteId, 'own_site' ) ) &&
isSectionNameEnabled( 'site-purchases' );

const isPluginManagementEnabled = config.isEnabled( 'jetpack/plugin-management' );

return useMemo(
() =>
[
Expand All @@ -101,7 +98,7 @@ const useMenuItems = ( {
link: pluginsPath( siteSlug ),
title: translate( 'Plugins' ),
trackEventName: 'calypso_jetpack_sidebar_plugins_clicked',
enabled: isPluginManagementEnabled && isAgency,
enabled: isAgency,
isSelected: itemLinkMatches( path, pluginsPath( siteSlug ) ),
},
{
Expand Down Expand Up @@ -190,7 +187,7 @@ const useMenuItems = ( {
[
isAdmin,
isAgency,
isPluginManagementEnabled,
showScanHistory,
isWPCOM,
isWPForTeamsSite,
path,
Expand Down
71 changes: 32 additions & 39 deletions client/my-sites/plugins/index.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { JSDOM } from 'jsdom';
import { makeLayout, ssrSetupLocale } from 'calypso/controller';
import { setHrefLangLinks, setLocalizedCanonicalUrl } from 'calypso/controller/localized-links';
import { overrideSanitizeSectionRoot } from 'calypso/lib/plugins/sanitize-section-content';
import { isEnabled } from 'calypso/server/config';
import { browsePlugins, browsePluginsOrPlugin } from './controller';
import {
fetchPlugins,
Expand All @@ -16,47 +15,41 @@ import {
export default function ( router ) {
const langParam = getLanguageRouteParam();

if ( isEnabled( 'plugins/ssr-landing' ) ) {
overrideSanitizeSectionRoot( new JSDOM().window );
overrideSanitizeSectionRoot( new JSDOM().window );

router(
[ `/${ langParam }/plugins` ],
skipIfLoggedIn,
ssrSetupLocale,
fetchPlugins,
setHrefLangLinks,
setLocalizedCanonicalUrl,
browsePlugins,
makeLayout
);
}
router(
[ `/${ langParam }/plugins` ],
skipIfLoggedIn,
ssrSetupLocale,
fetchPlugins,
setHrefLangLinks,
setLocalizedCanonicalUrl,
browsePlugins,
makeLayout
);

if ( isEnabled( 'plugins/ssr-categories' ) ) {
router(
`/${ langParam }/plugins/browse/:category`,
skipIfLoggedIn,
ssrSetupLocale,
fetchCategoryPlugins,
setHrefLangLinks,
setLocalizedCanonicalUrl,
browsePlugins,
makeLayout
);
}
router(
`/${ langParam }/plugins/browse/:category`,
skipIfLoggedIn,
ssrSetupLocale,
fetchCategoryPlugins,
setHrefLangLinks,
setLocalizedCanonicalUrl,
browsePlugins,
makeLayout
);

if ( isEnabled( 'plugins/ssr-details' ) ) {
router(
`/${ langParam }/plugins/:plugin`,
skipIfLoggedIn,
validatePlugin,
ssrSetupLocale,
fetchPlugin,
setHrefLangLinks,
setLocalizedCanonicalUrl,
browsePluginsOrPlugin,
makeLayout
);
}
router(
`/${ langParam }/plugins/:plugin`,
skipIfLoggedIn,
validatePlugin,
ssrSetupLocale,
fetchPlugin,
setHrefLangLinks,
setLocalizedCanonicalUrl,
browsePluginsOrPlugin,
makeLayout
);

router( [ `/${ langParam }/plugins`, `/${ langParam }/plugins/*` ], ssrSetupLocale );
}
29 changes: 13 additions & 16 deletions client/my-sites/plugins/index.web.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isEnabled } from '@automattic/calypso-config';
import { getLanguageRouteParam } from '@automattic/i18n-utils';
import {
makeLayout,
Expand Down Expand Up @@ -176,21 +175,19 @@ export default function ( router ) {
clientRender
);

if ( isEnabled( 'plugins/multisite-scheduled-updates' ) ) {
router(
[
`/${ langParam }/plugins/scheduled-updates`,
`/${ langParam }/plugins/scheduled-updates/:action(create)`,
`/${ langParam }/plugins/scheduled-updates/:action(edit)/:id`,
],
redirectLoggedOut,
navigation,
renderPluginsSidebar,
scheduledUpdatesMultisite,
makeLayout,
clientRender
);
}
router(
[
`/${ langParam }/plugins/scheduled-updates`,
`/${ langParam }/plugins/scheduled-updates/:action(create)`,
`/${ langParam }/plugins/scheduled-updates/:action(edit)/:id`,
],
redirectLoggedOut,
navigation,
renderPluginsSidebar,
scheduledUpdatesMultisite,
makeLayout,
clientRender
);

router(
[
Expand Down
11 changes: 4 additions & 7 deletions client/performance-profiler/components/metrics-insight/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isEnabled } from '@automattic/calypso-config';
import { FoldableCard } from '@automattic/components';
import styled from '@emotion/styled';
import { useTranslate } from 'i18n-calypso';
Expand Down Expand Up @@ -112,7 +111,7 @@ export const MetricsInsight: React.FC< MetricsInsightProps > = ( props ) => {
insight,
hash,
isWpcom,
isEnabled( 'performance-profiler/llm' ) && retrieveInsight,
retrieveInsight,
translate.localeSlug,
activeTab
);
Expand Down Expand Up @@ -162,14 +161,12 @@ export const MetricsInsight: React.FC< MetricsInsightProps > = ( props ) => {
fullPageScreenshot={ fullPageScreenshot }
data={ {
...insight,
...( isEnabled( 'performance-profiler/llm' )
? { description: llmAnswer?.messages }
: {} ),
description: llmAnswer?.messages,
} }
secondaryArea={ tip && <Tip { ...tip } /> }
isLoading={ isEnabled( 'performance-profiler/llm' ) && isLoadingLlmAnswer }
isLoading={ isLoadingLlmAnswer }
isWpscanLoading={ isWpscanLoading }
AIGenerated={ isEnabled( 'performance-profiler/llm' ) }
AIGenerated
hash={ hash }
url={ props.url }
chatId={ llmAnswer?.chatId }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const DotcomPreviewPane = ( {
},
{
label: __( 'Performance' ),
enabled: isActiveAtomicSite && config.isEnabled( 'performance-profiler/logged-in' ),
enabled: isActiveAtomicSite,
featureIds: [ DOTCOM_SITE_PERFORMANCE ],
},
{
Expand Down
3 changes: 1 addition & 2 deletions client/state/partner-portal/partner/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import find from 'lodash/find';
import { getCurrentUser } from 'calypso/state/current-user/selectors';
import type {
Expand Down Expand Up @@ -68,7 +67,7 @@ export function isA4AUser( state: PartnerPortalStore | IAppState ): boolean {
}

export function showAgencyDashboard( state: PartnerPortalStore ): boolean {
return config.isEnabled( 'jetpack/agency-dashboard' ) && isAgencyUser( state );
return isAgencyUser( state );
}

export function hasValidPaymentMethod( state: PartnerPortalStore ): boolean {
Expand Down
9 changes: 0 additions & 9 deletions config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"calypso/all-domain-management": false,
"calypso/big-sky": true,
"calypso/help-center": true,
"calypsoify/plugins": true,
"cancellation-offers": true,
"checkout/ebanx-pix": true,
"checkout/google-pay": true,
Expand Down Expand Up @@ -87,7 +86,6 @@
"importers/newsletter": true,
"importers/substack": true,
"individual-subscriber-stats": true,
"jetpack/agency-dashboard": true,
"jetpack/ai-assistant-request-limit": true,
"jetpack/ai-logo-generator": true,
"jetpack/api-cache": true,
Expand All @@ -104,7 +102,6 @@
"jetpack/golden-token": true,
"jetpack/magic-link-signup": true,
"jetpack/manage-simple-sites": true,
"jetpack/plugin-management": true,
"jetpack/pricing-add-boost-social": true,
"jetpack/pricing-page-annual-only": true,
"jetpack/sharing-buttons-block-enabled": true,
Expand Down Expand Up @@ -168,19 +165,13 @@
"p2/p2-plus": true,
"p2-enabled": false,
"page/export": true,
"performance-profiler/llm": true,
"performance-profiler/logged-in": true,
"plans/hosting-trial": true,
"plans/migration-trial": true,
"plans/personal-plan": true,
"plans/pro-plan": false,
"plans/starter-plan": false,
"plans/updated-storage-labels": true,
"plans/upgradeable-storage": true,
"plugins/multisite-scheduled-updates": true,
"plugins/ssr-categories": true,
"plugins/ssr-details": true,
"plugins/ssr-landing": true,
"post-editor/checkout-overlay": true,
"post-list/qr-code-link": true,
"press-this": true,
Expand Down
5 changes: 0 additions & 5 deletions config/horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"calypso/all-domain-management": false,
"calypso/big-sky": true,
"calypso/help-center": true,
"calypsoify/plugins": true,
"cancellation-offers": true,
"catch-js-errors": true,
"checkout/ebanx-pix": true,
Expand Down Expand Up @@ -107,10 +106,6 @@
"plans/starter-plan": false,
"plans/updated-storage-labels": true,
"plans/upgradeable-storage": true,
"plugins/multisite-scheduled-updates": true,
"plugins/ssr-categories": true,
"plugins/ssr-details": true,
"plugins/ssr-landing": true,
"post-editor/checkout-overlay": true,
"post-list/qr-code-link": false,
"press-this": true,
Expand Down
2 changes: 0 additions & 2 deletions config/jetpack-cloud-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@
"individual-subscriber-stats": true,
"jetpack-cloud": true,
"jetpack/activity-log-sharing": true,
"jetpack/agency-dashboard": true,
"jetpack/backup-messaging-i3": true,
"jetpack/backup-restore-preflight-checks": true,
"jetpack/backup-retention-settings": true,
"jetpack/backup-schedule-setting": true,
"jetpack/card-addition-improvements": true,
"jetpack/golden-token": true,
"jetpack/plugin-management": true,
"jetpack/pricing-add-boost-social": true,
"jetpack/pricing-page": true,
"jetpack/pricing-page-annual-only": true,
Expand Down
Loading

0 comments on commit 6f892c4

Please sign in to comment.