diff --git a/wp/pantheon.upstream.yml b/wp/pantheon.upstream.yml deleted file mode 100644 index ec2d615f..00000000 --- a/wp/pantheon.upstream.yml +++ /dev/null @@ -1,25 +0,0 @@ -# IMPORTANT NOTE: -# Do not edit this file unless you are doing so in your custom upstream repository. -# Override the defaults specified here in a site-specific `pantheon.yml` file. -# For more information see: https://pantheon.io/docs/pantheon-upstream-yml -api_version: 1 -php_version: 8.1 - -# See https://pantheon.io/docs/pantheon-yml#specify-a-version-of-mariadb -database: - version: 10.4 - -# See https://pantheon.io/docs/pantheon-yml/#enforce-https--hsts for valid values. -enforce_https: transitional - -# See https://pantheon.io/docs/pantheon-yml#protected-web-paths for usage. -protected_web_paths: - - /private/ - - /wp-content/uploads/private/ - - /xmlrpc.php - -# By default, any 'protected_web_paths' added to the pantheon.yml file -# are combined with the paths from the pantheon.upstream.yml file. If -# 'protected_web_paths_override' is set to true, then the upstream paths -# are disabled. -protected_web_paths_override: false diff --git a/wp/pantheon.yml b/wp/pantheon.yml deleted file mode 100644 index ca64f39e..00000000 --- a/wp/pantheon.yml +++ /dev/null @@ -1,22 +0,0 @@ -api_version: 1 -enforce_https: full+subdomains -php_version: 7.4 - -protected_web_paths: - - /.user.ini - -workflows: - - # Commits - sync_code: - after: - - type: webphp - description: Post to Slack after each code pushed - script: private/scripts/slack_notification.php - - # Database Clone - clone_database: - after: - - type: webphp - description: Change SFDC environment after database clone - script: private/scripts/sfdc_env.php diff --git a/wp/wp-content/mu-plugins/loader.php b/wp/wp-content/mu-plugins/loader.php deleted file mode 100644 index 791192bf..00000000 --- a/wp/wp-content/mu-plugins/loader.php +++ /dev/null @@ -1,76 +0,0 @@ -items = $plugins['mustuse']; - foreach ( $wp_list_table->items as $plugin_file => $plugin_data ) { - $wp_list_table->items[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true ); - } - - $total_this_page = $GLOBALS['totals']['mustuse']; - - if ( $GLOBALS['orderby'] ) { - uasort( $wp_list_table->items, [ $wp_list_table, '_order_callback' ] ); - } - - // Force showing all plugins. - // See https://core.trac.wordpress.org/ticket/27110. - $plugins_per_page = $total_this_page; - - $wp_list_table->set_pagination_args( [ - 'total_items' => $total_this_page, - 'per_page' => $plugins_per_page, - ] ); -}); - -add_filter( 'network_admin_plugin_action_links', function ( $actions, $plugin_file, $plugin_data, $context ) use ( $pantheon_mu_plugins ) { - if ( $context !== 'mustuse' || ! in_array( $plugin_file, $pantheon_mu_plugins, true ) ) { - return $actions; - } - - $actions[] = sprintf( 'File: %s', $plugin_file ); - return $actions; -}, 10, 4 ); \ No newline at end of file diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/.gitignore b/wp/wp-content/mu-plugins/pantheon-mu-plugin/.gitignore deleted file mode 100644 index 9a4f9975..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore composer files. -/vendor -composer.lock \ No newline at end of file diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/CODEOWNERS b/wp/wp-content/mu-plugins/pantheon-mu-plugin/CODEOWNERS deleted file mode 100644 index 4ca7a074..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @pantheon-systems/cms-platform \ No newline at end of file diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/.editorconfig b/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/.editorconfig deleted file mode 100644 index b634c4ce..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# editorconfig.org -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = tab - -[{.jshintrc,*.json,*.yml}] -indent_style = space -indent_size = 2 - -[{*.txt,wp-config-sample.php}] -end_of_line = crlf diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/css/return-to-pantheon-button.css b/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/css/return-to-pantheon-button.css deleted file mode 100644 index a47af41e..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/css/return-to-pantheon-button.css +++ /dev/null @@ -1,63 +0,0 @@ -#login { - width: 500px; -} - -#return-to-pantheon { - margin-bottom: 20px; - display: flex; - justify-content: space-between; - align-items: center; -} - -#return-to-pantheon .left { - font-size: 16px; - font-weight: 400; - line-height: 1.4; -} - -#return-to-pantheon a{ - display: flex; - align-items: center; - justify-content: space-between; - color: #000000; - padding: 5px 10px; - background: #F8DD44; - color: #000000 !important; - text-decoration: none !important; - font-size: 12px; - text-align: center; - border-radius: 10px; - min-width: 130px -} - -#return-to-pantheon a:hover { - -webkit-transition: all 0.25s; - -moz-transition: all 0.25s; - transition: all 0.25s; - background: #EFD01B; - color: #333333 !important; -} - - #return-to-pantheon .fist-icon { - display: inline-block; - width: 12px; - margin-right: 5px; - } - - @media (max-width: 499px) { - #login { - width: 320px; - } - #return-to-pantheon { - flex-direction: column; - } - - #return-to-pantheon .left { - order: 2; - } - - #return-to-pantheon .right { - margin-bottom: 25px; - order: 1; - } - } \ No newline at end of file diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/images/pantheon-fist-icon-black.svg b/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/images/pantheon-fist-icon-black.svg deleted file mode 100644 index 70a95a17..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/images/pantheon-fist-icon-black.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - Group 11 - Created with Sketch. - - - - - - - - - - - - \ No newline at end of file diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/js/return-to-pantheon-button.js b/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/js/return-to-pantheon-button.js deleted file mode 100644 index 582b161b..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/assets/js/return-to-pantheon-button.js +++ /dev/null @@ -1,8 +0,0 @@ -jQuery(document).ready(function( $ ) { - - $('#return-to-pantheon') - .detach() - .prependTo('#loginform') - .show(); - -}); \ No newline at end of file diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/cli.php b/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/cli.php deleted file mode 100644 index 8868406c..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/cli.php +++ /dev/null @@ -1,97 +0,0 @@ - (deprecated) or - * wp pantheon cache set-maintenance-mode - * - * ## OPTIONS - * - * - * : Maintenance mode status. - * --- - * options: - * - disabled - * - anonymous - * - everyone - * --- - * - * @subcommand set-maintenance-mode - * - * @deprecated 1.0.0 - */ -function __deprecated_maintenance_mode_output( $args ) { - $allowed_args = [ 'disabled', 'anonymous', 'everyone' ]; - $replacement_command = ( ! empty( $args && count( $args ) === 1 ) && in_array( $args[0], $allowed_args, true ) ) ? 'set-maintenance-mode ' . $args[0] : false; - - // translators: %s is the replacement command. - WP_CLI::warning( WP_CLI::colorize( '%y' . sprintf( __( 'This command is deprecated and will be removed in a future release. Use `wp pantheon %s` instead.', 'pantheon-systems' ), $replacement_command ) . '%n' ) ); - WP_CLI::line( __( 'Run `wp pantheon set-maintenance-mode --help` for more information.', 'pantheon-systems' ) ); - - // The command should fail before we get here, but in case it doesn't, display an error. - if ( false === $replacement_command ) { - WP_CLI::error( __( 'Invalid arguments. Run `wp pantheon set-maintenance-mode --help` for more infomation.', 'pantheon-systems' ) ); - } - - set_maintenance_mode_command( $args ); -} - -/** - * Sets maintenance mode status. - * - * Enable maintenance mode to work on your site while serving cached pages - * to visitors and bots, or everyone except administators. - * - * ## OPTIONS - * - * - * : Maintenance mode status. - * --- - * options: - * - disabled - * - anonymous - * - everyone - * --- - * - * @subcommand set-maintenance-mode - */ -function set_maintenance_mode_command( $args ) { - - list( $status ) = $args; - - $out = Pantheon_Cache()->default_options; - if ( ! empty( $status ) - && in_array( $status, [ 'anonymous', 'everyone' ], true ) ) { - $out['maintenance_mode'] = $status; - } else { - $out['maintenance_mode'] = 'disabled'; - } - update_option( Pantheon_Cache::SLUG, $out ); - WP_CLI::success( sprintf( 'Maintenance mode set to: %s', $out['maintenance_mode'] ) ); -} diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/network/includes-network.php b/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/network/includes-network.php deleted file mode 100644 index 81268a78..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/network/includes-network.php +++ /dev/null @@ -1,704 +0,0 @@ -prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) ); - if ( $wpdb->get_var( $sql ) ) { // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared - return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" ); - } - return false; -} - -/** - * Allow subdomain installation - * - * @since 3.0.0 - * @return bool Whether subdomain installation is allowed - */ -function allow_subdomain_install() { - $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) ); - if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) { - return false; - } - - return true; -} - -/** - * Allow subdirectory installation. - * - * @since 3.0.0 - * - * @global wpdb $wpdb WordPress database abstraction object. - * - * @return bool Whether subdirectory installation is allowed - */ -function allow_subdirectory_install() { - global $wpdb; - - /** - * Filters whether to enable the subdirectory installation feature in Multisite. - * - * @since 3.0.0 - * - * @param bool $allow Whether to enable the subdirectory installation feature in Multisite. - * Default false. - */ - if ( apply_filters( 'allow_subdirectory_install', false ) ) { - return true; - } - - if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL ) { - return true; - } - - $post = $wpdb->get_row( "SELECT ID FROM $wpdb->posts WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'" ); - if ( empty( $post ) ) { - return true; - } - - return false; -} - -/** - * Get base domain of network. - * - * @since 3.0.0 - * @return string Base domain. - */ -function get_clean_basedomain() { - $existing_domain = network_domain_check(); - if ( $existing_domain ) { - return $existing_domain; - } - $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) ); - $slash = strpos( $domain, '/' ); - if ( $slash ) { - $domain = substr( $domain, 0, $slash ); - } - return $domain; -} - -/** - * Prints step 1 for Network installation process. - * - * @todo Realistically, step 1 should be a welcome screen explaining what a Network is and such. - * Navigating to Tools > Network should not be a sudden "Welcome to a new install process! - * Fill this out and click here." See also contextual help todo. - * - * @since 3.0.0 - * - * @global bool $is_apache - * - * @param false|WP_Error $errors Optional. Error object. Default false. - */ -function network_step1( $errors = false ) { - if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { - echo '

' . esc_html__( 'Error:' ) . ' ' . sprintf( - /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */ - esc_html__( 'The constant %s cannot be defined when creating a network.' ), - 'DO_NOT_UPGRADE_GLOBAL_TABLES' - ) . '

'; - echo ''; - require_once ABSPATH . 'wp-admin/admin-footer.php'; - die(); - } - - $active_plugins = get_option( 'active_plugins' ); - if ( ! empty( $active_plugins ) ) { - echo '

' . esc_html__( 'Warning:' ) . ' ' . sprintf( - /* translators: %s: URL to Plugins screen. */ - wp_kses_post( __( 'Please deactivate your plugins before enabling the Network feature.' ) ), - esc_url_raw( admin_url( 'plugins.php?plugin_status=active' ) ) - ) . '

'; - echo '

' . esc_html__( 'Once the network is created, you may reactivate your plugins.' ) . '

'; - echo ''; - require_once ABSPATH . 'wp-admin/admin-footer.php'; - die(); - } - - $hostname = get_clean_basedomain(); - $has_ports = strstr( $hostname, ':' ); - if ( ( false !== $has_ports && ! in_array( $has_ports, [ ':80', ':443' ], true ) ) ) { - echo '

' . esc_html__( 'Error:' ) . ' ' . esc_html__( 'You cannot install a network of sites with your server address.' ) . '

'; - echo '

' . sprintf( - /* translators: %s: Port number. */ - esc_html__( 'You cannot use port numbers such as %s.' ), - '' . $has_ports . '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ) . '

'; - echo '' . esc_html__( 'Go to Dashboard' ) . ''; - echo ''; - require_once ABSPATH . 'wp-admin/admin-footer.php'; - die(); - } - - echo '
'; - - wp_nonce_field( 'install-network-1' ); - - $error_codes = []; - if ( is_wp_error( $errors ) ) { - echo '

' . esc_html__( 'Error: The network could not be created.' ) . '

'; - foreach ( $errors->get_error_messages() as $error ) { - echo "

$error

"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - echo '
'; - $error_codes = $errors->get_error_codes(); - } - - if ( ! empty( $_POST['sitename'] ) && ! in_array( 'empty_sitename', $error_codes, true ) ) { - $site_name = $_POST['sitename']; - } else { - /* translators: %s: Default network title. */ - $site_name = sprintf( __( '%s Sites' ), get_option( 'blogname' ) ); - } - - if ( ! empty( $_POST['email'] ) && ! in_array( 'invalid_email', $error_codes, true ) ) { - $admin_email = $_POST['email']; - } else { - $admin_email = get_option( 'admin_email' ); - } - ?> -

-

- -

-

-

-

- - - - - - - - - - - - -

' . esc_html__( 'Warning:' ) . ' ' . esc_html__( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

'; - } - - $is_www = ( 0 === strpos( $hostname, 'www.' ) ); - if ( $is_www ) : - ?> -

-

- ' . substr( $hostname, 4 ) . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - '' . $hostname . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - 'www' - ); - ?> -

- - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ' . esc_html( $errors->get_error_message() ) . ''; - } - - if ( $_POST ) { - if ( allow_subdomain_install() ) { - $subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true; - } else { - $subdomain_install = false; - } - } elseif ( is_multisite() ) { - $subdomain_install = is_subdomain_install(); - ?> -

- get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); - ?> -

-

- -

-

-

- ' . esc_html__( 'Caution:' ) . ' '; - printf( - /* translators: 1: wp-config.php, 2: web.config */ - esc_html__( 'You should back up your existing %1$s and %2$s files.' ), - '' . $config_filename . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - 'web.config' - ); - } else { - echo '' . esc_html__( 'Caution:' ) . ' '; - printf( - /* translators: %s: wp-config.php */ - esc_html__( 'You should back up your existing %s file.' ), - '' . $config_filename . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); - } - ?> -

- -
    -
  1. - above the line reading %3$s:' ), - '' . $config_filename . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - '' . $location_of_wp_config . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - // translators: This string should only be translated if wp-config-sample.php is localized. - // You can check the localized release package or https://i18n.svn.wordpress.org//branches//dist/wp-config-sample.php. - '/* ' . esc_html__( 'That’s all, stop editing! Happy publishing.' ) . ' */' - ); - ?> -

    -

    - - '', - 'SECURE_AUTH_KEY' => '', - 'LOGGED_IN_KEY' => '', - 'NONCE_KEY' => '', - 'AUTH_SALT' => '', - 'SECURE_AUTH_SALT' => '', - 'LOGGED_IN_SALT' => '', - 'NONCE_SALT' => '', - ]; - foreach ( $keys_salts as $c => $v ) { - if ( defined( $c ) ) { - unset( $keys_salts[ $c ] ); - } - } - - if ( ! empty( $keys_salts ) ) { - $keys_salts_str = ''; - $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); - if ( is_wp_error( $from_api ) ) { - foreach ( $keys_salts as $c => $v ) { - $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );"; - } - } else { - $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); - foreach ( $keys_salts as $c => $v ) { - $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );"; - } - } - $num_keys_salts = count( $keys_salts ); - ?> -

    - ' . $config_filename . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); - } else { - printf( - /* translators: %s: wp-config.php */ - esc_html__( 'These unique authentication keys are also missing from your %s file.' ), - '' . $config_filename . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); - } - ?> - -

    -

    - - -
  2. - - - - - - - - - '; - if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { - $web_config_file .= ' - - - - '; - } - $web_config_file .= ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'; - - echo '
  3. '; - printf( - /* translators: 1: File name (.htaccess or web.config), 2: File path. */ - wp_kses_post( __( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ) ), - 'web.config', - '' . $home_path . '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); - echo '

    '; - if ( ! $subdomain_install && WP_CONTENT_DIR !== ABSPATH . 'wp-content' ) { - echo '

    ' . esc_html__( 'Warning:' ) . ' ' . esc_html__( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

    '; - } - ?> -

    - -
  4. -
- -

'; - printf( - /* translators: %s: Documentation URL. */ - wp_kses_post( __( 'It seems your network is running with Nginx web server. Learn more about further configuration.' ) ), - 'https://wordpress.org/support/article/nginx/' - ); - echo '

'; - - else : // End $is_nginx. Construct an .htaccess file instead. - - $ms_files_rewriting = ''; - if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { - $ms_files_rewriting = "\n# uploaded files\nRewriteRule ^"; - $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n"; // phpcs:ignore Generic.Strings.UnnecessaryStringConcat.Found - } - - $htaccess_file = <<

'; - printf( - /* translators: 1: File name (.htaccess or web.config), 2: File path. */ - wp_kses_post( __( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ) ), - '.htaccess', - '' . $home_path . '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); - echo '

'; - if ( ! $subdomain_install && WP_CONTENT_DIR !== ABSPATH . 'wp-content' ) { - echo '

' . esc_html__( 'Warning:' ) . ' ' . esc_html__( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

'; - } - ?> -

- - - - - -

- tables( 'ms_global' ) as $table => $prefixed_table ) { - $wpdb->$table = $prefixed_table; -} - -if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) { - wp_die( - printf( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - /* translators: 1: WP_ALLOW_MULTISITE, 2: wp-config.php */ - esc_html__( 'You must define the %1$s constant as true in your %2$s file to allow creation of a Network.' ), - 'WP_ALLOW_MULTISITE', - 'wp-config.php' - ) - ); -} - -if ( is_network_admin() ) { - // Used in the HTML title tag. - $page_title = esc_html__( 'Network Setup' ); -} else { - // Used in the HTML title tag. - $page_title = __( 'Create a Network of WordPress Sites' ); -} - -$network_help = wp_kses_post( '

' . __( 'This screen allows you to configure a network as having subdomains (site1.example.com) or subdirectories (example.com/site1). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.' ) . '

' . - '

' . __( 'Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your installation. Fill out the network details, and click Install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).' ) . '

' . - '

' . __( 'The next screen for Network Setup will give you individually-generated lines of code to add to your wp-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.' ) . '

' . - '

' . __( 'Add the designated lines of code to wp-config.php (just before /*...stop editing...*/) and .htaccess (replacing the existing WordPress rules).' ) . '

' . - '

' . __( 'Once you add this code and refresh your browser, multisite should be enabled. This screen, now in the Network Admin navigation menu, will keep an archive of the added code. You can toggle between Network Admin and Site Admin by clicking on the Network Admin or an individual site name under the My Sites dropdown in the Toolbar.' ) . '

' . - '

' . __( 'The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with “/blog/” from the main site. This disabling will be addressed in a future version.' ) . '

' . - '

' . __( 'For more information:' ) . '

' . - '

' . __( 'Documentation on Creating a Network' ) . '

' . - '

' . __( 'Documentation on the Network Screen' ) . '

' ); // phpcs:ignore PEAR.Functions.FunctionCallSignature.Indent - -get_current_screen()->add_help_tab( - [ - 'id' => 'network', - 'title' => __( 'Network' ), - 'content' => $network_help, - ] -); - -get_current_screen()->set_help_sidebar( - '

' . __( 'For more information:' ) . '

' . - '

' . __( 'Documentation on Creating a Network' ) . '

' . - '

' . __( 'Documentation on the Network Screen' ) . '

' . - '

' . __( 'Support' ) . '

' -); - -require_once ABSPATH . 'wp-admin/admin-header.php'; -?> -
-

- -get_error_codes() ) && 'no_wildcard_dns' === $result->get_error_code() ) { - network_step2( $result ); - } else { - network_step1( $result ); - } - } else { - network_step2(); - } - } else { - network_step2(); - } -} elseif ( is_multisite() || network_domain_check() ) { - network_step2(); -} else { - network_step1(); -} -?> -
- - diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/pantheon-login-form-mods.php b/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/pantheon-login-form-mods.php deleted file mode 100644 index 3ab2c946..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/pantheon-login-form-mods.php +++ /dev/null @@ -1,69 +0,0 @@ - - - -
- -

-

- Pantheon Multisite Configuration for documentation on how to finalize configuration of your site network.', 'pantheon' ) - ), - 'https://pantheon.io/docs/guides/multisite/config/#install-the-wordpress-site-network' - ); - ?> -

- -

-

- Contact Support.', 'pantheon' ) - ), 'https://pantheon.io/support' - ); - ?> -

- -
- - - setup(); - } - return self::$instance; - } - - protected function __construct() { - /** Don't do anything */ - } - - - /** - * Setup the actions and filters we need to hook into, and initialize any properties we need. - * - * @return void - */ - protected function setup() { - $this->options = get_option( self::SLUG, [] ); - $this->default_options = [ - 'default_ttl' => 600, - 'maintenance_mode' => 'disabled', - ]; - $this->options = wp_parse_args( $this->options, $this->default_options ); - - add_action( 'init', [ $this, 'action_init_do_maintenance_mode' ] ); - - add_action( 'admin_init', [ $this, 'action_admin_init' ] ); - add_action( 'admin_menu', [ $this, 'action_admin_menu' ] ); - add_action( 'load-plugin-install.php', [ $this, 'action_load_plugin_install' ] ); - - add_action( 'admin_post_pantheon_cache_flush_site', [ $this, 'flush_site' ] ); - - add_action( 'send_headers', [ $this, 'cache_add_headers' ] ); - add_filter( 'rest_post_dispatch', [ $this, 'filter_rest_post_dispatch_send_cache_control' ], 10, 2 ); - - add_action( 'admin_notices', function () { - global $wp_object_cache; - if ( empty( $wp_object_cache->missing_redis_message ) ) { - return; - } - $wp_object_cache->missing_redis_message = 'Alert! The Pantheon Redis service needs to be enabled before the WP Redis object cache will function properly.'; - }, 9 ); // Before the message is displayed in the plugin notice. - - add_action( 'shutdown', [ $this, 'cache_clean_urls' ], 999 ); - } - - /** - * Displays maintenance mode when enabled. - */ - public function action_init_do_maintenance_mode() { - - $do_maintenance_mode = false; - - if ( in_array( $this->options['maintenance_mode'], [ 'anonymous', 'everyone' ], true ) - && ! is_user_logged_in() ) { - $do_maintenance_mode = true; - } - - if ( 'everyone' === $this->options['maintenance_mode'] - && is_user_logged_in() - && ! current_user_can( 'manage_options' ) ) { - $do_maintenance_mode = true; - } - - if ( defined( 'WP_CLI' ) && WP_CLI ) { - $do_maintenance_mode = false; - } - - if ( 'wp-login.php' === $GLOBALS['pagenow'] ) { - $do_maintenance_mode = false; - } - - /** - * Modify maintenance mode behavior with more advanced conditionals. - * - * @var boolean $do_maintenance_mode Whether or not to do maintenance mode. - */ - $do_maintenance_mode = apply_filters( 'pantheon_cache_do_maintenance_mode', $do_maintenance_mode ); - - if ( ! $do_maintenance_mode ) { - return; - } - - wp_die( - esc_html__( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ), - esc_html__( 'Maintenance' ), - 503 - ); - } - - /** - * Prep the Settings API. - * - * @return void - */ - public function action_admin_init() { - register_setting( self::SLUG, self::SLUG, [ self::$instance, 'sanitize_options' ] ); - add_settings_section( 'general', false, '__return_false', self::SLUG ); - add_settings_field( 'default_ttl', null, [ self::$instance, 'default_ttl_field' ], self::SLUG, 'general' ); - add_settings_field( 'maintenance_mode', null, [ self::$instance, 'maintenance_mode_field' ], self::SLUG, 'general' ); - } - - - /** - * Add the settings page to the menu. - * - * @return void - */ - public function action_admin_menu() { - add_options_page( __( 'Pantheon Page Cache', 'pantheon-cache' ), __( 'Pantheon Page Cache', 'pantheon-cache' ), $this->options_capability, self::SLUG, [ self::$instance, 'view_settings_page' ] ); - } - - /** - * Check to see if JavaScript should trigger the opening of the plugin install box - */ - public function action_load_plugin_install() { - if ( empty( $_GET['action'] ) || 'pantheon-load-infobox' !== $_GET['action'] ) { - return; - } - add_action( 'admin_footer', [ $this, 'action_admin_footer_trigger_plugin_open' ] ); - } - - /** - * Trigger the opening of the Pantheon Advanced Page Cache infobox - */ - public function action_admin_footer_trigger_plugin_open() { - ?> - - ' . esc_html__( 'Default Time to Live (TTL)', 'pantheon-cache' ) . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo '

' . esc_html__( 'Maximum time a cached page will be served. A higher TTL typically improves site performance.', 'pantheon-cache' ) . '

'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo ' ' . esc_html__( 'seconds', 'pantheon-cache' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - - /** - * Add the HTML for the maintenance mode field. - * - * @return void - */ - public function maintenance_mode_field() { - echo '

' . esc_html__( 'Maintenance Mode', 'pantheon-cache' ) . '

'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo '

' . esc_html__( 'Enable maintenance mode to work on your site while serving cached pages to:', 'pantheon-cache' ) . '

'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - - - /** - * Sanitize our options. - * - * @param array $in The POST values. - * @return array The sanitized POST values. - */ - public function sanitize_options( $in ) { - $out = $this->default_options; - - // Validate default_ttl. - $out['default_ttl'] = absint( $in['default_ttl'] ); - if ( $out['default_ttl'] < 60 && isset( $_ENV['PANTHEON_ENVIRONMENT'] ) && 'live' === $_ENV['PANTHEON_ENVIRONMENT'] ) { - $out['default_ttl'] = 60; - } - - if ( ! empty( $in['maintenance_mode'] ) - && in_array( $in['maintenance_mode'], [ 'anonymous', 'everyone' ], true ) ) { - $out['maintenance_mode'] = $in['maintenance_mode']; - } else { - $out['maintenance_mode'] = 'disabled'; - } - return $out; - } - - - /** - * Output the settings page. - * - * @return void - */ - public function view_settings_page() { - ?> -
-

- - -
-

-
- - - -

Learn more', 'pantheon-cache' ), 'https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin' ) ); ?>

- -

Pantheon Advanced Page Cache.', 'pantheon-cache' ), 'https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin' ) ); ?>

- - - - - - -
- - -

-

- -
- -
- - - - - -
- - - -
- -
- - - -
- options['default_ttl'] ); - if ( $ttl < 60 && isset( $_ENV['PANTHEON_ENVIRONMENT'] ) && 'live' === $_ENV['PANTHEON_ENVIRONMENT'] ) { - $ttl = 60; - } - - return sprintf( 'public, max-age=%d', $ttl ); - } else { - return 'no-cache, no-store, must-revalidate'; - } - } - - /** - * Add the cache-control header. - * - * @return void - */ - public function cache_add_headers() { - header( sprintf( 'cache-control: %s', $this->get_cache_control_header_value() ) ); - } - - /** - * Send the cache control header for REST API requests - * - * @param WP_REST_Response $response Response. - * @return WP_REST_Response Response. - */ - public function filter_rest_post_dispatch_send_cache_control( $response ) { - $response->header( 'Cache-Control', $this->get_cache_control_header_value() ); - return $response; - } - - /** - * Clear the cache for the entire site. - * - * @return void|false - */ - public function flush_site() { - if ( ! function_exists( 'current_user_can' ) || false === current_user_can( 'manage_options' ) ) { - return false; - } - - if ( ! empty( $_POST['pantheon-cache-nonce'] ) && wp_verify_nonce( $_POST['pantheon-cache-nonce'], 'pantheon-cache-clear-all' ) ) { - if ( function_exists( 'pantheon_clear_edge_all' ) ) { - pantheon_clear_edge_all(); - } - wp_cache_flush(); - wp_safe_redirect( admin_url( 'options-general.php?page=pantheon-cache&cache-cleared=true' ) ); - exit(); - } - } - - - /** - * Clear the cache for a post. - * - * @deprecated - * - * @param int $post_id A post ID to clean. - * @return void - */ - public function clean_post_cache( $post_id, $include_homepage = true ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable,Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed - if ( method_exists( 'Pantheon_Advanced_Page_Cache\Purger', 'action_clean_post_cache' ) ) { - Pantheon_Advanced_Page_Cache\Purger::action_clean_post_cache( $post_id ); - } - } - - - /** - * Clear the cache for a given term or terms and taxonomy. - * - * @deprecated - * - * @param int|array $term_ids Single or list of Term IDs. - * @param string $taxonomy Can be empty and will assume tt_ids, else will use for context. - * @return void - */ - public function clean_term_cache( $term_ids, $taxonomy ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed,VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable - if ( method_exists( 'Pantheon_Advanced_Page_Cache\Purger', 'action_clean_term_cache' ) ) { - Pantheon_Advanced_Page_Cache\Purger::action_clean_term_cache( $term_ids ); - } - } - - - /** - * Clear the cache for a given term or terms and taxonomy. - * - * @deprecated - * - * @param int|array $object_ids Single or list of term object ID(s). - * @param array|string $object_type The taxonomy object type. - * @return void - */ - public function clean_object_term_cache( $object_ids, $object_type ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable - // Handled by Pantheon Integrated CDN. - } - - /** - * Enqueue Fully-qualified urls to be cleared on shutdown. - * - * @param array|string $urls List of full urls to clear. - * @return void - */ - public function enqueue_urls( $urls ) { - $paths = []; - $urls = array_filter( (array) $urls, 'is_string' ); - foreach ( $urls as $full_url ) { - // Parse down to the path+query, escape regex. - $parsed = parse_url( $full_url ); - // Sometimes parse_url can return false, on malformed urls. - if ( false === $parsed ) { - continue; - } - // Build up the path, checking if the array key exists first. - if ( array_key_exists( 'path', $parsed ) ) { - $path = $parsed['path']; - if ( array_key_exists( 'query', $parsed ) ) { - $path = $path . $parsed['query']; - } - } else { - // If the path doesn't exist, set it to the null string. - $path = ''; - } - if ( '' === $path ) { - continue; - } - $path = '^' . preg_quote( $path ) . '$'; // phpcs:ignore WordPress.PHP.PregQuoteDelimiter.Missing - $paths[] = $path; - } - - $this->paths = array_merge( $this->paths, $paths ); - } - - /** - * Enqueue a regex to be cleared. - * - * You must understand regular expressions to use this, and be careful. - * - * @param string $regex path regex to clear. - * @return void - */ - public function enqueue_regex( $regex ) { - $this->paths[] = $regex; - } - - - public function cache_clean_urls() { - if ( empty( $this->paths ) ) { - return; - } - - $this->paths = apply_filters( 'pantheon_clean_urls', array_unique( $this->paths ) ); - - // Call the big daddy here. - $this->paths = apply_filters( 'pantheon_final_clean_urls', $this->paths ); - if ( function_exists( 'pantheon_clear_edge_paths' ) ) { - pantheon_clear_edge_paths( $this->paths ); - } - } -} - - - -/** - * Get a reference to the singleton. - * - * This can be used to reference public methods, e.g. `Pantheon_Cache()->clean_post_cache( 123 )` - */ -function Pantheon_Cache() { - return Pantheon_Cache::instance(); -} -add_action( 'plugins_loaded', 'Pantheon_Cache' ); - -/** - * @see Pantheon_Cache::clean_post_cache - * - * @deprecated Please call Pantheon Integrated CDN instead. - */ -function pantheon_clean_post_cache( $post_id, $include_homepage = true ) { - Pantheon_Cache()->clean_post_cache( $post_id, $include_homepage ); -} - - -/** - * @see Pantheon_Cache::clean_term_cache - * - * @deprecated Please call Pantheon Integrated CDN instead. - */ -function pantheon_clean_term_cache( $term_ids, $taxonomy ) { - Pantheon_Cache()->clean_term_cache( $term_ids, $taxonomy ); -} - - -/** - * @see Pantheon_Cache::enqueue_urls - * - * @deprecated Please call Pantheon Integrated CDN instead. - */ -function pantheon_enqueue_urls( $urls ) { - Pantheon_Cache()->enqueue_urls( $urls ); -} diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/pantheon-plugin-install-notice.php b/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/pantheon-plugin-install-notice.php deleted file mode 100644 index b6b17ea7..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/inc/pantheon-plugin-install-notice.php +++ /dev/null @@ -1,29 +0,0 @@ -id || 'plugins-network' === $screen->id ) { ?> -
-

- your Pantheon dashboard.', 'pantheon-systems' ), 'https://dashboard.pantheon.io/sites/' . $_ENV['PANTHEON_SITE'] ) ); - ?> -

-
- current; -} - -/** - * Check if WordPress core is at the latest version. - * - * @return bool - */ -function _pantheon_is_wordpress_core_latest(): bool { - $latest_wp_version = _pantheon_get_latest_wordpress_version(); - $wp_version = _pantheon_get_current_wordpress_version(); - - if ( null === $latest_wp_version ) { - return true; - } - - // Return true if our version is the latest. - return version_compare( str_replace( '-src', '', $latest_wp_version ), str_replace( '-src', '', $wp_version ), '<=' ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -} - -/** - * Check if WordPress core is a pre-release version. - * - * @return bool - */ -function _pantheon_is_wordpress_core_prerelease(): bool { - $wp_version = _pantheon_get_current_wordpress_version(); - - // Return true if our version is a prerelease. Pre-releases are identified by a dash in the version number. - return false !== strpos( $wp_version, '-' ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -} - -/** - * Replace WordPress core update nag EVERYWHERE with our own notice. - * Use git upstream instead - * - * @return void - */ -function _pantheon_upstream_update_notice() { - $wp_version = _pantheon_get_current_wordpress_version(); - $screen = get_current_screen(); - // Translators: %s is a URL to the user's Pantheon Dashboard. - $notice_message = sprintf( __( 'Check for updates on your Pantheon dashboard.', 'pantheon-systems' ), 'https://dashboard.pantheon.io/sites/' . $_ENV['PANTHEON_SITE'] ); - // Translators: %s is a URL to Pantheon's upstream updates documentation. - $upstream_help_message = sprintf( __( 'For details on applying updates, see the Applying Upstream Updates documentation.', 'pantheon-systems' ), 'https://docs.pantheon.io/core-updates' ); - $update_help = __( 'If you need help, contact an administrator for your Pantheon organization.', 'pantheon-systems' ); - $div_class = esc_attr( 'update-nag notice notice-warning' ); - $div_style = esc_attr( 'display: table;' ); - $paragraph_style = esc_attr( 'font-size: 14px; font-weight: bold; margin: 0 0 0.5em 0;' ); - - if ( ! _pantheon_is_wordpress_core_latest() ) { - // If WP core is out of date, alter the message and show the nag everywhere. - // Translators: %s is a URL to the user's Pantheon Dashboard. - $notice_message = sprintf( __( 'A new WordPress update is available! Please update from your Pantheon dashboard.', 'pantheon-systems' ), 'https://dashboard.pantheon.io/sites/' . $_ENV['PANTHEON_SITE'] ); - } - - // If WP core is a pre-release, alter the message. - if ( _pantheon_is_wordpress_core_prerelease() ) { - $version = '(' . $wp_version . ')'; - $paragraph_style = esc_attr( 'font-size: 14px;' ); - // Translators: %s is the current WordPress version. - $notice_message = sprintf( __( 'You are using a development version of WordPress. %s', 'pantheon-systems' ), $version ); - // If we're on the Updates page, add a note about the Beta Tester plugin. - if ( 'update-core' === $screen->id || 'update-core-network' === $screen->id ) { - $notice_message .= '
'; - $notice_message .= __( 'You are responsible for keeping WordPress up-to-date. Pantheon updates to WordPress will not appear in the dashboard as long as you\'re using a pre-release version. If you are using the Beta Tester plugin, you must have your site in SFTP mode to get the latest updates to your Pantheon Dev environment.', 'pantheon-systems' ); - } - } - - ob_start(); - ?> -
-

- -

- - -
- - -
- id || 'update-core-network' === $screen->id ) { - // Escaping is handled above when we're buffering the output, so we can ignore it here. - echo $notice_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } -} - -/** - * Register Pantheon specific WordPress update admin notice. - * - * @return void - */ -function _pantheon_register_upstream_update_notice() { - // Only register notice if we are on Pantheon and this is not a WordPress Ajax request. - if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) && ! wp_doing_ajax() ) { - add_action( 'admin_notices', '_pantheon_upstream_update_notice' ); - add_action( 'network_admin_notices', '_pantheon_upstream_update_notice' ); - } -} -add_action( 'admin_init', '_pantheon_register_upstream_update_notice' ); - -/** - * Return zero updates and current time as last checked time. - * - * @return object - */ -function _pantheon_disable_wp_updates(): object { - $wp_version = _pantheon_get_current_wordpress_version(); - return (object) [ - 'updates' => [], - 'version_checked' => $wp_version, // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable - 'last_checked' => time(), - ]; -} - -// In the Test and Live environments, clear plugin/theme update notifications. -// Users must check a dev or multidev environment for updates. -if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) && in_array( $_ENV['PANTHEON_ENVIRONMENT'], [ 'test', 'live' ], true ) && ( php_sapi_name() !== 'cli' ) ) { - - // Disable Plugin Updates. - remove_action( 'load-update-core.php', 'wp_update_plugins' ); - add_filter( 'pre_site_transient_update_plugins', '_pantheon_disable_wp_updates' ); - - // Disable Theme Updates. - remove_action( 'load-update-core.php', 'wp_update_themes' ); - add_filter( 'pre_site_transient_update_themes', '_pantheon_disable_wp_updates' ); -} diff --git a/wp/wp-content/mu-plugins/pantheon-mu-plugin/pantheon.php b/wp/wp-content/mu-plugins/pantheon-mu-plugin/pantheon.php deleted file mode 100644 index 639db319..00000000 --- a/wp/wp-content/mu-plugins/pantheon-mu-plugin/pantheon.php +++ /dev/null @@ -1,54 +0,0 @@ -