├── .env.example ├── .env.pantheon ├── .gitignore ├── .lando.upstream.yml ├── CHANGELOG.md ├── CODEOWNERS ├── LICENSE.md ├── README-internal.md ├── README.md ├── catalog-info.yml ├── composer.json ├── config ├── application.pantheon.php └── application.php ├── devops ├── files │ ├── composer-managed-README.md │ └── decoupled-README.md └── scripts │ ├── check-commits.sh │ ├── commit-type.sh │ ├── decoupledpatch.sh │ ├── deploy-decoupled-upstream.sh │ ├── deploy-public-upstream.sh │ └── setup-playwright-tests.sh ├── docs ├── Installing-Sage.md └── images │ └── sage-theme-screenshot.png ├── pantheon.upstream.yml ├── phpcs.xml ├── private └── scripts │ └── helpers.sh ├── upstream-configuration ├── README.md ├── composer.json └── scripts │ └── ComposerScripts.php ├── web ├── app │ ├── mu-plugins │ │ ├── bedrock-autoloader.php │ │ └── filters.php │ ├── plugins │ │ └── .gitkeep │ └── themes │ │ └── .gitkeep ├── index.php ├── wp-cli.yml └── wp-config.php └── wp-cli.yml /.env.example: -------------------------------------------------------------------------------- 1 | # This is a sample config for local development. 2 | # Simply edit/copy as needed and rename to .env.local. 3 | # application.php will load this file if you're not in a Pantheon (dev/test/live) environment. 4 | 5 | # Be sure to replace YOUR-LOCAL-DOMAIN below too. 6 | 7 | WP_HOME='YOUR-LOCAL-DOMAIN' 8 | WP_SITEURL="YOUR-LOCAL-DOMAIN/wp" 9 | WP_ENV='development' 10 | 11 | DB_NAME=$_ENV['DB_NAME'] 12 | DB_USER=$_ENV['DB_USER'] 13 | DB_PASSWORD=$_ENV['DB_PASSWORD'] 14 | DB_HOST=$_ENV['DB_HOST']:$_ENV['DB_PORT'] 15 | 16 | # Optional database variables 17 | # DB_HOST='localhost' 18 | # DB_PREFIX='wp_' 19 | 20 | # Specify optional debug.log path starting from web root. 21 | # WP_DEBUG_LOG='/app/debug.log' 22 | -------------------------------------------------------------------------------- /.env.pantheon: -------------------------------------------------------------------------------- 1 | DB_NAME=$_ENV['DB_NAME'] 2 | DB_USER=$_ENV['DB_USER'] 3 | DB_PASSWORD=$_ENV['DB_PASSWORD'] 4 | 5 | # Pantheon sets these values for you. If you want to shuffle them you can do so via your dashboard. 6 | AUTH_KEY=$_ENV['AUTH_KEY'] 7 | SECURE_AUTH_KEY=$_ENV['SECURE_AUTH_KEY'] 8 | LOGGED_IN_KEY=$_ENV['LOGGED_IN_KEY'] 9 | NONCE_KEY=$_ENV['NONCE_KEY'] 10 | AUTH_SALT=$_ENV['AUTH_SALT'] 11 | SECURE_AUTH_SALT=$_ENV['SECURE_AUTH_SALT'] 12 | LOGGED_IN_SALT=$_ENV['LOGGED_IN_SALT'] 13 | NONCE_SALT=$_ENV['NONCE_SALT'] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This file contains .gitignore rules that are often used with Composer-based 2 | # WordPress projects. Because .gitignore is specific to your site and its 3 | # deployment processes, you may need to uncomment, add, or remove rules. 4 | 5 | # The /web/app/ directory is used in favor of /wp-content in a traditional 6 | # WordPress project. This is where files are uploaded to, where plugins and 7 | # themes are installed and where other writeable directories are created. 8 | # Plugin, theme and mu-plugin paths are defined later and handled differently, 9 | # but in most cases, we don't want to version control anything in here. 10 | # It's unlikely that you would need to change any of these rules. 11 | web/app/upgrade 12 | web/app/uploads/* 13 | !web/app/uploads/.gitkeep 14 | web/app/cache/* 15 | 16 | # WordPress is installed in web/wp so that it can be fully managed by Composer. 17 | # This ensures that the WordPress directory is clean and doesn't contain any 18 | # files other than those that come with the WordPress package. 19 | web/wp 20 | web/.htaccess 21 | 22 | # Our Composer post-install command creates a symbolic link to web/wp inside 23 | # web. We don't want to version control these linked files, so we ignore them 24 | # explicitly. 25 | web/license.txt 26 | web/readme.html 27 | web/index.php 28 | web/wp-* 29 | !web/wp-cli.yml 30 | !web/wp-config.php 31 | !web/wp-config-pantheon.php 32 | web/xmlrpc.php 33 | 34 | # Logfiles should always be ignored. 35 | *.log 36 | 37 | # Environment (.env) files should be ignored as they are generally personal. 38 | # However, the .env.example and .env.pantheon files are left so that they can be 39 | # viewed and modified. You should not store any credentials in your 40 | # .env.pantheon file. Instead, those can go into environment-specific .env 41 | # files. Constants saved in .env files will override those constants that are 42 | # defined in wp-config-pantheon.php. 43 | .env 44 | .env.* 45 | !.env.example 46 | !.env.pantheon 47 | 48 | # Generally you should only ignore the root vendor directory. These files are 49 | # managed by Composer and should not be version controlled. It may be necessary 50 | # to explicitly allow /vendor directories within plugins or themes that are not 51 | # available through Wpackagist (which mirrors WordPress.org), like projects 52 | # that pull from Packagist or custom GitHub repositories. 53 | /vendor 54 | 55 | # Any local WP-CLI rules should not be version controlled. 56 | wp-cli.local.yml 57 | 58 | # :::::::::::::::::::::: Pantheon Additions :::::::::::::::::::::: 59 | 60 | # Must-use plugins 61 | # Ignore packages uploaded to mu-plugins by default. These area typically 62 | # managed by composer as wordpress-muplugins. If you have custom mu-plugins, 63 | # you will need to explicitly exclude them from this rule like this: 64 | # !web/app/mu-plugins/my-muplugin/ 65 | # By default, individual mu-plugin files are not ignored, so any bare file in 66 | # mu-plugins is version controlled. Exceptions to this rule are made to specific 67 | # files managed by Composer. 68 | web/app/mu-plugins/*/ 69 | 70 | # Plugins 71 | # Ignore the plugins directory by default. WordPress plugins should be managed 72 | # by Composer, where we have more control over the version constraints of the 73 | # plugins. If you have custom plugins, you will need to explicitly exclude them 74 | # from this rule like this: 75 | # !web/app/plugins/my-plugin 76 | web/app/plugins/* 77 | !web/app/plugins/.gitkeep 78 | 79 | # Themes 80 | # We don't ignore all themes by default as these are most commonly where a 81 | # bulk of a site's custom code may be. However, we do ignore all of the 82 | # twenty-* themes by default. Any other Composer-managed themes should be 83 | # added to this list. 84 | web/app/themes/twenty* 85 | 86 | # Other WordPress files and directories 87 | # Any other files or directories that should not be version controlled go here. 88 | # A lot of stuff from the non-Composer-managed WordPress upstream is repeated 89 | # here. 90 | web/app/backups/ 91 | web/app/backupwordpress-*/ 92 | web/app/blogs.dir/ 93 | web/app/backup-db/ 94 | web/app/cache/ 95 | web/app/managewp/backups/ 96 | web/app/updraft/ 97 | web/app/upgrade/ 98 | web/app/advanced-cache.php 99 | web/app/wp-cache-config.php 100 | web/wp-config-local.php 101 | sitemap.xml 102 | sitemap.xml.gz 103 | 104 | # Private files 105 | # We want to ignore files inside web/private/ by default, but we don't want to 106 | # ignore the entire directory. The web/private/config directory is excluded from 107 | # this rule because this may contain information that should be shared across 108 | # environments and is not considered sensitive data. However, that exclusion 109 | # should be removed if that is not the case. 110 | !web/private/ 111 | web/private/* 112 | !web/private/config/ 113 | 114 | # Autoloader 115 | # This file loads the Composer autoloader and is moved to the root directory by 116 | # pantheon-systems/composer-scaffold. This should not be moved or removed or it 117 | # could prevent the site from working correctly. 118 | /autoload.php 119 | 120 | # Pantheon.upstream.yml 121 | # Avoid accidental modification of pantheon.upstream.yml in sites 122 | # created from this upstream 123 | pantheon.upstream.yml 124 | 125 | # Files 126 | # Common files that should not be version controlled. 127 | # Packages # 128 | ############ 129 | *.7z 130 | *.dmg 131 | *.gz 132 | *.bz2 133 | *.iso 134 | *.jar 135 | *.rar 136 | *.tar 137 | *.zip 138 | *.tgz 139 | !web/wp/wp-includes/**/*.gz 140 | 141 | # Logs and databases # 142 | ###################### 143 | *.log 144 | *.sql 145 | 146 | # OS generated files # 147 | ###################### 148 | .DS_Store* 149 | ehthumbs.db 150 | Thumbs.db 151 | ._* 152 | 153 | # Vim generated files # 154 | ###################### 155 | *.un~ 156 | 157 | # SASS # 158 | ########## 159 | .sass-cache 160 | -------------------------------------------------------------------------------- /.lando.upstream.yml: -------------------------------------------------------------------------------- 1 | recipe: pantheon 2 | config: 3 | framework: wordpress 4 | xdebug: false 5 | 6 | events: 7 | post-start: 8 | - appserver: composer install 9 | 10 | services: 11 | appserver: 12 | build_as_root: 13 | - curl -sL https://deb.nodesource.com/setup_18.x | bash - 14 | - apt-get install -y nodejs 15 | - npm install --global jq stylelint stylelint-no-browser-hacks stylelint-config-standard stylelint-order 16 | - mkdir -p /root/tmp 17 | - chmod 666 /root/tmp 18 | overrides: 19 | volumes: 20 | - ${HOME}/.lando/composer_cache:/var/www/.composer 21 | 22 | tooling: 23 | npm: 24 | service: appserver 25 | cmd: cd /app/web/wp-content/themes/THEME_NAME && npm 26 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### v1.32.5 (2025-02-10) 2 | * Adds the `maybe-install-symlinks` Composer script to `post-update-cmd` hook. This ensures that symlinks are created (and the `web/index.php` file is re-created) after a `composer update`. ([#175](https://github.com/pantheon-systems/wordpress-composer-managed/pull/175)) 3 | 4 | ### v1.32.4 (2025-02-10) 5 | * Adds a check for `web/index.php` and re-creates the file if it does not exist. Resolves issues where `web/index.php` is missing and breaks a site. ([#173](https://github.com/pantheon-systems/wordpress-composer-managed/pull/173)) 6 | 7 | ### v1.32.3 (2024-09-10) 8 | * Updates `COOKIEPATH` and `SITECOOKIEPATH` values to `/` in `application.pantheon.php` to resolve cookie-related nonce authentication failures. Previously, the values were set to `''` (empty string), which does not allow the cookies to allow authentication within all the paths in a domain. ([#164](https://github.com/pantheon-systems/wordpress-composer-managed/pull/164)) 9 | 10 | ### v1.32.2 (2024-09-03) 11 | * Fixes a bug in the previous update where some WordPress core resources were not available on some single and subdirectory multisite installs. ([161](https://github.com/pantheon-systems/wordpress-composer-managed/pull/161)) 12 | 13 | ### v1.32.1 (2024-08-16) 14 | * Refactors core resource URL filtering and multisite handling. ([#157](https://github.com/pantheon-systems/wordpress-composer-managed/pull/157)) This resolves an issue where some WordPress core resources were 404ing on single site installs. 15 | 16 | ### v1.32.0 (2024-08-06) 17 | * This update primarily fixes consistency issues between the development repository ([`pantheon-systems/wordpress-composer-managed`](https://github.com/pantheon-systems/wordpress-composer-managed)) and the upstream repository ([`pantheon-upstreams/wordpress-composer-managed`](https://github.com/pantheon-upstreams/wordpress-composer-managed)). Most notably, this update removes decoupled packages that were erroneously being added to the non-decoupled upstream (and are not included in this repository). 18 | * Fixes issues with subdomain multisite testing ([#148](https://github.com/pantheon-systems/wordpress-composer-managed/pull/148)) 19 | * Updates automation steps to check PRs for "mixed" commits ([#146](https://github.com/pantheon-systems/wordpress-composer-managed/pull/146)) and adds handling for merge commits and conflicts ([#152](https://github.com/pantheon-systems/wordpress-composer-managed/pull/152)) 20 | * Moves cookie settings inside the pantheon environment check ([#151](https://github.com/pantheon-systems/wordpress-composer-managed/pull/151)) 21 | 22 | ### v1.31.1 (2024-07-29) 23 | * Removes code that for handling wp-admin URLs. ([#143](https://github.com/pantheon-systems/wordpress-composer-managed/pull/143)) This code was not working as intended and testing revealed it to be unnecessary. 24 | * Adds a filter to disable the subdirectory multisite custom wp-content directory warning. ([#144](https://github.com/pantheon-systems/wordpress-composer-managed/pull/144)) This implements the filter added in the [Pantheon MU Plugin](https://github.com/pantheon-systems/pantheon-mu-plugin) in [#51](https://github.com/pantheon-systems/pantheon-mu-plugin/pull/51). 25 | 26 | ### v1.31.0 (2024-07-10) 27 | * `wp-config-pantheon.php` deprecated in favor of `application.pantheon.php`. All previous functionality in `wp-config-pantheon.php` moved to `application.pantheon.php`. ([#139](https://github.com/pantheon-systems/wordpress-composer-managed/pull/139)) 28 | * `DISABLE_WP_CRON` constant removed from `application.php` (and `wp-config-pantheon.php`) and moved to `application.pantheon.php`. ([#139](https://github.com/pantheon-systems/wordpress-composer-managed/pull/139)) It's possible this change could cause a merge conflict. Accept incoming changes from the upstream or [resolve manually](https://docs.pantheon.io/guides/git/resolve-merge-conflicts). 29 | * Cookie domain handling in `application.pantheon.php` to resolve cookie-related login redirect issues on subdomain multisites. ([#137](https://github.com/pantheon-systems/wordpress-composer-managed/pull/137)) 30 | * Updates to `application.php` and `composer.json` to bring WordPress (Composer Managed) in line with [`roots/bedrock`](https://github.com/roots/bedrock) v1.24.x. ([#134](https://github.com/pantheon-systems/wordpress-composer-managed/pull/134)) 31 | * Correct WordPress site urls on main sites or single sites to drop the `/wp` in WordPress-generated home links. ([#132](https://github.com/pantheon-systems/wordpress-composer-managed/pull/132)) This fixes an issue where WordPress-generated links to the primary site always included an unnecessary trailing `/wp`. This is handled by a filter in `mu-plugins/filters.php` set to priority `9` so it can be easily overridden. 32 | * Pre-set the WP GraphQL endpoint path to `wp/graphql` if the plugin exists to preserve existing functionality after URL filters above. ([#138](https://github.com/pantheon-systems/wordpress-composer-managed/pull/138)) 33 | * Bump PHP version to 8.2 and DB version to 10.6. ([#133](https://github.com/pantheon-systems/wordpress-composer-managed/pull/133)) PHP back to 8.1 is still supported but PHP 8.0 support is dropped by the Composer configuration to follow current Bedrock and Sage minimum requirements. 34 | * Update the `update_php` function in `helpers.sh` to update PHP version in `pantheon.yml` to 8.1 (or higher) to follow new Bedrock and Sage PHP minimum. ([#131](https://github.com/pantheon-systems/wordpress-composer-managed/pull/131)) 35 | * Silences the check for multisite in the Sage theme install script. ([#131](https://github.com/pantheon-systems/wordpress-composer-managed/pull/131)) Previously a warning would be shown if the site the script was being run against was not a multisite because the `MULTISITE` constant did not exist. 36 | * Adds a check to see if the generated Sage theme exists prior to theme activation. ([#131](https://github.com/pantheon-systems/wordpress-composer-managed/pull/131)) This change corrects the script's behavior to not attempt to activate the theme if it does not exist. 37 | * Ensure managed WordPress files aren't omitted. ([#128](https://github.com/pantheon-systems/wordpress-composer-managed/pull/128)) This fixes an issue where some required files were being ignored by version control. Props [@araphiel](https://github.com/araphiel) 38 | * Filters core resource URLs for non-main sites in subdirectory multisites. ([#130](https://github.com/pantheon-systems/wordpress-composer-managed/pull/130)) This fixes an issue where core resource URLs (e.g. to WordPress core JavaScript and CSS assets) were linked incorrectly in subdirectory subsites. This is handled by a filter in `mu-plugins/filters.php` set to priority `9` so it can be easily overridden. 39 | * Replace `tput` with a `save_tput` function in `helpers.sh`. ([#129](https://github.com/pantheon-systems/wordpress-composer-managed/pull/129)) This fixes an issue where a warning was being displayed in Workflow Logs in the dashboard because the `tput` function was not available in the terminal environment. 40 | * Adds semver versioning convention to CHANGELOG to track changes easier. (Tags will begin at 1.31.0 rather than retroactively creating new tags.) 41 | * Adds `package.json` file and [Playwright](https://playwright.dev/) tests for functional testing. ([#138](https://github.com/pantheon-systems/wordpress-composer-managed/pull/138)) 42 | 43 | ### v1.30.0 (2024-06-04) 44 | * Filters the configuration file filename on the Setup Network instructions page to use `config/application.php` instead of `wp-config.php`. ([#125](https://github.com/pantheon-systems/wordpress-composer-managed/pull/125)) 45 | * Adds Composer script to update the `platform.php` value to the version of PHP consistent with the version in the `pantheon.yml` file. ([#127](https://github.com/pantheon-systems/wordpress-composer-managed/pull/127) 46 | 47 | ### v1.29.0 (2024-04-30) 48 | * Adds a new `PANTHEON_HOSTNAME` constant to `application.pantheon.php` to be used for configuring multisites. For more information, see our [mulstisite configuration documentation](https://docs.pantheon.io/guides/multisite/config). ([#119](https://github.com/pantheon-systems/wordpress-composer-managed/pull/119)) 49 | * Implements `pantheon.multisite.config_contents` filter to correct the multisite configuration instructions (to use `Config::define` instead of `define`). 50 | * Adds a new `filters.php` mu-plugin for the `pantheon.multisite.config_contents` filter and any future filters we might add. 51 | * Adds `lint:phpcbf` script to the `composer.json`. 52 | 53 | ### v1.28.2 (2024-04-15) 54 | * Fixed an issue where `WP_HOME` was left undefined and throwing notices into New Relic logs. For more information, see our [release note](https://docs.pantheon.io/release-notes/2024/04/wordpress-composer-managed-update). ([#115](https://github.com/pantheon-systems/wordpress-composer-managed/pull/115)) 55 | 56 | ### v1.28.1 (2023-09-25) 57 | * Updates to the [Sage install script](docs/Installing-Sage.md) to support running the script without prompting for input. Also adds automated test runs of the script on `ubuntu-latest` and `macos-latest` environments. ([#113](https://github.com/pantheon-systems/wordpress-composer-managed/pull/113)) 58 | 59 | ### v1.28.0 (2023-06-27) 60 | * Fixed a bug that failed to prevent a `composer.lock` file from being committed to the repository. ([#103](https://github.com/pantheon-systems/wordpress-composer-managed/pull/103)) 61 | * Removed the `upstream-require` script ([#105](https://github.com/pantheon-systems/wordpress-composer-managed/pull/105)). This is now available as a standalone Composer plugin: [`pantheon-systems/upstream-management`](https://packagist.org/packages/pantheon-systems/upstream-management) 62 | * Added a README to the Upstream Configuration path repository with notes about the new `upstream-management` package. ([#104](https://github.com/pantheon-systems/wordpress-composer-managed/pull/104)) 63 | 64 | ### v1.27.0 (2023-05-23) 65 | * Removes the `lh-hsts` plugin requirement from the `composer.json` file. ([#91](https://github.com/pantheon-systems/wordpress-composer-managed/pull/91)) 66 | * Adds the [Pantheon WP Coding Standards](https://github.com/pantheon-systems/pantheon-wp-coding-standards) to use instead of the default PHPCS/WPCS standards ([#94](https://github.com/pantheon-systems/wordpress-composer-managed/pull/94)) 67 | * Backports updates from Roots/Bedrock ([#90](https://github.com/pantheon-systems/wordpress-composer-managed/pull/90)) 68 | * Updates the `post-install-cmd` hook to run a script that checks for the existence of symlinks before attempting to create them. ([#98](https://github.com/pantheon-systems/wordpress-composer-managed/pull/98)) 69 | * Minor improvements to the Sage install process (included in [#98](https://github.com/pantheon-systems/wordpress-composer-managed/pull/98)) 70 | 71 | ### v1.26.0 (2023-03-29) 72 | * Changes the language in comments about appropriate usage of `config/application.php`. `application.php` should be used for any site config customizations rather than `wp-config.php` which should _not_ be edited. ([#76](https://github.com/pantheon-systems/wordpress-composer-managed/pull/76)) 73 | * Updates the Sage install script to properly update the PHP version. ([#81](https://github.com/pantheon-systems/wordpress-composer-managed/pull/81)) 74 | * Updates the Sage install script to force symbolic links rather than attepting to create them on each `composer install`. ([#79](https://github.com/pantheon-systems/wordpress-composer-managed/pull/79)) 75 | * Updates the Sage install script to attempt to fix invalid theme names. ([#80](https://github.com/pantheon-systems/wordpress-composer-managed/pull/80)) 76 | * Updates the Sage install script to fail hard if `jq` is not found, but provide links to download the executable. ([#82](https://github.com/pantheon-systems/wordpress-composer-managed/pull/82)) 77 | * Fixes an issue that led to failing builds due to an unstaged `index.php` file created by the forced symlinks. ([#86](https://github.com/pantheon-systems/wordpress-composer-managed/pull/86)) 78 | 79 | ### v1.25.0 (2023-02-02) 80 | * Adds Composer Patches plugin ([#66](https://github.com/pantheon-systems/wordpress-composer-managed/pull/66)) 81 | 82 | ### v1.24.0 (2023-01-11) 83 | * Remove Dependabot ([#58](https://github.com/pantheon-systems/wordpress-composer-managed/pull/58)) 84 | * Resolves issue where updates to commit choosing logic were causing a merge conflict. ([#60](https://github.com/pantheon-systems/wordpress-composer-managed/pull/60)) 85 | * Adds a Roots Sage install script. See [docs/Installing-Sage.md](docs/Installing-Sage.md) ([#61](https://github.com/pantheon-systems/wordpress-composer-managed/pull/61)) 86 | 87 | ### v1.23.1 (2022-11-30) 88 | * Set minimum-stability to "stable" in `composer.json` ([#55](https://github.com/pantheon-systems/wordpress-composer-managed/pull/55)) 89 | * Add Composer `post-install-cmd` to create symlinks to the `web/wp` directory (for better multisite support) ([#56](https://github.com/pantheon-systems/wordpress-composer-managed/pull/56)) 90 | 91 | ### v1.23.0 (2022-11-09) 92 | * Pull the latest versions of all packages ([#36](https://github.com/pantheon-systems/wordpress-composer-managed/pull/36)) 93 | * Improved debug log path suggested in `.env.example` ([#38](https://github.com/pantheon-systems/wordpress-composer-managed/pull/38)) 94 | * Get latest WP updates (and other WP-related dependencies) automatically ([#40](https://github.com/pantheon-systems/wordpress-composer-managed/pull/40)) 95 | * Always pull the latest Pantheon plugins from wpackagist ([#45](https://github.com/pantheon-systems/wordpress-composer-managed/pull/45)) 96 | * Change from `php_version` to `php-version` in testing matrix ([#46](https://github.com/pantheon-systems/wordpress-composer-managed/pull/46)) 97 | * Additional Lando configuration ([#47](https://github.com/pantheon-systems/wordpress-composer-managed/pull/47)) 98 | * Fix a typo in `README-internal.md` ([#48](https://github.com/pantheon-systems/wordpress-composer-managed/pull/48)) 99 | * Exclude `.github/` from the deploy script for the upstream repository. ([#50](https://github.com/pantheon-systems/wordpress-composer-managed/pull/50)) 100 | * Also forbid `.github/workflows/ci.yml` from the deploy script. ([#51](https://github.com/pantheon-systems/wordpress-composer-managed/pull/51)) 101 | * Skip commits in deploy process for nonrelease changes ([#52](https://github.com/pantheon-systems/wordpress-composer-managed/pull/52) [#53](https://github.com/pantheon-systems/wordpress-composer-managed/pull/53)) 102 | 103 | ### v1.22.2 (2022-10-17) 104 | * Load global .env file even if .env.local is absent ([#32](https://github.com/pantheon-systems/wordpress-composer-managed/pull/32)) 105 | 106 | ### v1.22.1 (2022-10-14) 107 | * Set permalink structure in build-env.install-cms Composer extra property ([#30](https://github.com/pantheon-systems/wordpress-composer-managed/pull/30)) 108 | 109 | ### v1.22.0 (2022-10-03) 110 | * Move Pantheon modifications in application.php ([#29](https://github.com/pantheon-systems/wordpress-composer-managed/pull/29)) 111 | 112 | ### v1.21.0 (2022-09-23) 113 | * `.gitignore` updates - Reported in the Pantheon Community Slack channel was the fact that the `.gitignore` included in this repository did not match the `.gitignore` (with commonly-ignored files) in the default [WordPress upstream](https://github.com/pantheon-systems/wordpress) ([#24](https://github.com/pantheon-systems/wordpress-composer-managed/pull/24)) 114 | * Use `.env.local` for local development ([#26](https://github.com/pantheon-systems/wordpress-composer-managed/pull/26)) - Fixes an issue where Lando was not using `.env` files locally. 115 | * README updates ([#27](https://github.com/pantheon-systems/wordpress-composer-managed/pull/27) and [#28](https://github.com/pantheon-systems/wordpress-composer-managed/pull/28)) - Adds link to https://github.com/pantheon-upstreams/wordpress-composer-managed for forking, as well as additional guidance about the default branch name for custom upstreams. 116 | 117 | ### v1.20.0 (2022-06-16) 118 | * Initial fork from [`roots/bedrock`](https://roots.io/bedrock) at 1.20.0. See the changelog prior to that at [`github.com/roots/bedrock`](https://github.com/roots/bedrock/blob/97f7826f3d284b82d83ff15d13bfc22628d660e2/CHANGELOG.md) 119 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @pantheon-systems/site-experience @pantheon-systems/devrel 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) Roots Software Foundation LLC 2 | Copyright (c) Pantheon Systems 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /README-internal.md: -------------------------------------------------------------------------------- 1 | # Working with the WordPress (Composer Managed) upstream 2 | 3 | ## "Release" and "non-release" commits 4 | The composer-managed upstreams (including Drupal (Composer Managed)) have a idiosyncratic concept of "release" or "normal" commits and "non-release" commits. **Release** commits are those that affect files that are ultimately pushed to the `pantheon-upstreams` repository. This includes everything that makes the base upstream work and _excludes_ any CI-related files, scripts or tests. **Non-release** commits are those that affect files that are not pushed to the `pantheon-upstreams` repository. This includes CI-related files, scripts, tests, and any other files that are not part of the base upstream. 5 | 6 | Because we tend to prefer Squash merges on PRs rather than Merge commits, it is vital to separate interests and not combine _release_ and _non-release_ commits in the same PR. Doing so will lead to portions of the PR being dropped when the deploy script is run, leading to a mismatch between the `pantheon-systems` and `pantheon-upstreams` repositories. Multiple commits in a single PR that keep the division between _release_ and _non-release_ are allowed, **but should not be squash merged.** 7 | 8 | ## Cutting a new release 9 | 1. Update CHANGELOG.md. In the past, the copy has been created in consultation with the product owner. 10 | 1. Ensure the commit message for the last commit in this release says what we want to have appearing on the 11 | dashboard as an available update. See [CORE-2258](https://getpantheon.atlassian.net/browse/CORE-2258) for 12 | the inaugural example of such a commit message. All changes are committed to `pantheon-upstreams` as a single 13 | commit, and the message that is used for it is the one from the last commit. 14 | * Typically the CHANGELOG.md commit is the last one and so is the one whose commit message should be wordsmithed. 15 | 1. Trigger the new release to `pantheon-upstreams` by `--ff-only`-merging `default` into `release` and pushing the 16 | result: 17 | ``` 18 | git fetch 19 | git checkout release && git pull 20 | git merge --ff-only origin/default 21 | git push origin release 22 | ``` 23 | A CircleCI job causes the release to be created. 24 | 25 | ## Preventing `composer.lock` from being committed 26 | 27 | Committing `composer.lock` to the upstream repository will break downstream sites using integrated Composer. To prevent this from happening, after cloning this repository, you can add `composer.lock` to the `.git/info/exclude` in your local copy. Note that this needs to be done for any local copies you wish to apply this rule to. 28 | 29 | ## Development and release procedures 30 | 31 | There are some atypical development and release procedures in use with this repository: 32 | 1. The currently released version of this repository lives in parallel in the `main` branch of [pantheon-upstreams/wordpress-composer-managed](https://github.com/pantheon-upstreams/wordpress-composer-managed). `pantheon-upstreams/wordpress-composer-managed` closely mirrors the development repository at [pantheon-systems/wordpress-composer-managed](https://github.com/pantheon-systems/wordpress-composer-managed) and is updated by CircleCI automation. 33 | 1. Changes are made by submitting a PR against the `default` branch of `pantheon-systems/wordpress-composer-managed`. 34 | 1. Merging a PR to `default` _does not_ create a new release of `pantheon-upstreams/wordpress-composer-managed`. This allows us to batch more than one relatively small change into a single new "release" such that the number of separate update events appearing on customer dashboards is more controlled. 35 | 36 | ### Differences between `pantheon-upstreams` and `pantheon-systems` repos: 37 | 1. Commits modifying any of the following files and directories are omitted from `pantheon-upstreams`: `.circleci`, `devops`, `.github`. This prevents downstream Pantheon sites from being littered with our internal CI configuration, and allows us to enhance CI without generating irrelevant site updates. However, it means **you must not create commits that modify both automation and other files** in the same commit. 38 | 2. Commit authors appear on the dashboard. For this reason, they are rewritten to `Pantheon Automation ` by automation. 39 | 40 | ## Automation demystified 41 | The following workflows run on this repository: 42 | 43 | ### CircleCI 44 | * There is only one CircleCI workflow, [`.circleci/config.yml`](.circleci/config.yml). This workflow runs on merge to `release` and handles the deployment of the new release to the `pantheon-upstreams` repositories. See the `devops` folder for the scripts that are run as part of this workflow. 45 | 46 | ### GitHub Actions 47 | * `ci.yml` - This runs the `Lint and Test` job on pull requests. It runs on PHP 8.1-8.3 (Roots Bedrock does not support < PHP 8.1). Playwright tests are run in `playwright.yml` only after `ci.yml` determines that there are no linting issues. Additionally, `ci.yml` adds the commit checking workflow that is normally run on CircleCI to ensure that there are no non-release file changes mixed with release changes in a single commit. There are no tests configured in the upstream itself, so while `composer test` is run, it does not actually do anything. 48 | * `composer-diff.yml` - This runs the `Composer Diff` job on pull requests. It compares the `composer.lock` file in the pull request to the `composer.lock` file in the `default` branch. If there are differences, it will comment on the pull request with the differences. 49 | * `sage-test.yml` - This workflow only runs when changes have been made to any of the scripts in `private/scripts` (TODO: if we add more scripts to this directory, we might want to change this behavior to be more specific) or to the workflow file itself. It spins up a new multidev on the `wpcm-sage-install-tests` site on Pantheon and attempts to run `composer install-sage` script. The tests run on `ubuntu-latest` and `macos-latest` environments. (Windows environments need WSL2 to run the script which should broadly be covered by `ubuntu-latest`.) 50 | * `sync-default.yml` - This workflow syncs the `default` branch to `main` in the `pantheon-systems/wordpress-composer-managed` repository. This is used for the [WordPress (Composer Managed) Nightly Canary](https://github.com/pantheon-systems/composer-managed-nightly-canaries). The canary is an automated workflow that spins up a brand new site on Pantheon off of the `default` branch of this repository and runs some basic tests to ensure that the site can be created and that the `composer install` script runs successfully. If the canary site fails to build, an update is posted to the `#cms-ecosystem-repos` channel in Slack. 51 | * `playwright.yml` - This runs a suite of "hello world" style tests on fixture sites on the Pantheon platform using [Playwright](https://playwright.dev/). These tests were adapted from the [Composer Managed Nightly Canaries](https://github.com/pantheon-systems/composer-managed-nightly-canaries) tests originally developed by the Decoupled Kit team. The workflows set up new single site WordPress or subdirectory multisite WordPress sites using the Composer Managed upstream, copy files from the PR over to the new site, and install and run the Playwright tests. In the case of subdomain multisite, a single fixture site is maintained due to the complexity of setting up subdomains in automation. 52 | * `phpcbf.yml` - This runs the `PHP Code Beautifier and Fixer` job on pull requests. It runs on all PRs, commits the changes back to the PR and adds a comment on the pull request if it changed anything. Note that `phpcbf` does not fix _all_ linting issues, and things that `phpcbf` cannot fix will still need to be fixed manually. 53 | 54 | ## Branch protections and their rationale 55 | 56 | ### In pantheon-systems 57 | 1. The `default` branch does not accept merge commits. This is because this branch serves as the staging area for commits queued to be released to site upstreams, and the commit messages appear on customer dashboards as available updates. Preventing `Merged "[CORE-1234] Added widget to branch default [#62]"`-style commit messages enhances the user experience. 58 | 59 | ### In pantheon-upstreams 60 | 1. All branches do not accept pushes, except by GitHub user `pantheon-circleci` and owners of the `pantheon-upstreams` organization, because GitHub hardcodes those users as able to push. This is just to avoid accidental direct pushes because commits to the upstreams repo are supposed to be made only from CircleCI as part of an intentional release with the commit authors rewritten. 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Composer-enabled WordPress template 2 | 3 | [![Actively Maintained](https://img.shields.io/badge/Pantheon-Minimal_Support-yellow?logo=pantheon&color=FFDC28)](https://pantheon.io/docs/oss-support-levels#minimal-support) 4 | [![GitHub Release](https://img.shields.io/github/v/release/pantheon-systems/wordpress-composer-managed)](https://github.com/pantheon-upstreams/wordpress-composer-managed) 5 | 6 | This is Pantheon's recommended starting point for forking new [WordPress](https://wordpress.org) upstreams that work with the Platform's Integrated Composer build process. 7 | 8 | Unlike with other Pantheon upstreams, the WordPress core install, which you are unlikely to adjust while building sites, is not in the main branch of the repository. Instead, it is referenced as dependencies within [Roots/Bedrock](https://roots.io/bedrock/) that are installed by [Composer](https://getcomposer.org). 9 | 10 | ## Early Access software 11 | 12 | A product in Early Access denotes a new project or feature set that is in development and available for a limited audience. Some features are stable, but the product is only partially complete and development is still in progress. For more information on support for Early Access projects, refer to our [documentation](https://pantheon.io/docs/guides/support/early-access/). 13 | 14 | Want to participate in the Early Access program? [Fill out this request form.](https://docs.google.com/forms/d/e/1FAIpQLSe5WvxnzA7_U7B4clhhIYsPxI7DXkmQC-Y8J6pXmrbHYPzviw/viewform?usp=sf_link) 15 | 16 | ## Powered by Bedrock 17 | 18 |

19 | 20 | Bedrock 21 | 22 |

23 | 24 | 25 | [Bedrock](https://roots.io/bedrock/) is a modern WordPress stack that helps you get started with the best development tools and project structure. 26 | 27 | Much of the philosophy behind Bedrock is inspired by the [Twelve-Factor App](http://12factor.net/) methodology including the [WordPress specific version](https://roots.io/twelve-factor-wordpress/). 28 | 29 | ## Features 30 | 31 | - Better folder structure 32 | - Dependency management with [Composer](https://getcomposer.org) 33 | - Easy WordPress configuration with environment specific files 34 | - Environment variables with [Dotenv](https://github.com/vlucas/phpdotenv) 35 | - Autoloader for mu-plugins (use regular plugins as mu-plugins) 36 | - Enhanced security (separated web root and secure passwords with [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt)) 37 | 38 | ## How to use this project 39 | There are two main ways to interact with this project template. **Using the Pantheon-maintained WordPress Composer Managed upstream** or **forking this repository to create a custom upstream.** 40 | 41 | ### Using the Pantheon WordPress Composer Managed upstream (recommended) 42 | 43 | 1. Use Terminus to create a site from the Pantheon upstream: 44 | ``` 45 | terminus site:create --org ORG --region REGION --