Giter VIP home page Giter VIP logo

vip-site-template's Introduction

WordPress VIP Site Template

Travis CI Status GitHub Action CI Status

Site setup, development environment and deploy tooling for WordPress VIP:

  • Uses Composer for adding project dependencies, including plugins and themes.
  • Uses Composer autoloader for using any of the popular PHP packages anywhere in the codebase.
  • Includes a local development environment based on Docker with support for PHP Xdebug and a mail catcher.
  • Includes automated build and deploy pipelines to WordPress VIP Go using Travis CI or GitHub Actions.

Links & Resources

Requirements

Install Dependencies

We suggest using Homebrew on macOS or Chocolatey for Windows to install the project dependencies.

brew install git [email protected] composer node@18 mkcert
brew install --cask docker

Code Editor and Git Client

This repository includes a list of suggested extensions for the Visual Studio Code editor and Xdebug support in the .vscode directory.

A user-friendly Git client such as GitHub Desktop or Tower enables smaller commits and simplifies merge conflict resolution.

Overview

  • Project plugins and themes can be added as Composer dependencies or manualy to this repository under plugins/your-plugin and themes/your-theme.
  • Composer dependencies are placed under plugins/vendor since it has to be in the same location relative to the project root (which is not the case for vip-config which is mapped to the WP root directory on the server).
  • Composer autoloader plugins/vendor/autoload.php is included in vip-config/vip-config.php.

Initial Setup

Important: This section can be deleted once you've completed the initial setup from the VIP Go Site template.

The site project generated from this template is designed to be hosted under the WP VIP GitHub organization which is why it uses Travis for deployments since VIP repositories currently don't support GitHub actions. It also includes a GitHub Action based workflow which can be used for projects hosted under any GitHub organization that does support GitHub Actions.

VIP Platform Configuration

The following configuration must be requested from VIP Go to use this site repository:

  1. Deployments from *-built branches such as master-built and develop-built.
  2. Staging environment tracking the develop-built branch.

VIP Repository Setup

  1. Ensure that VIP has configured the site to deploy from the *-built branches.

  2. Create a fresh local Git repository from this reference repository:

     composer create-project xwp/vip-site-template --stability dev
    
  3. Add your theme and plugins as Composer dependencies:

     composer require your/theme your/plugin another/plugin
    

    or by manually copying them to themes or plugins. Remember to start tracking those directories by excluding them in themes/.gitignore and plugins/.gitignore.

  4. Adjust strings and URLs in all files match your project. Search and replace the following strings: xwp/vip-site-template, wpcomvip/devgo-vip, XWP\Vip_Site_Template, local.wpenv.net.

  5. If hosting this source repository under the VIP GitHub organization, add the VIP Go upstream repository as another remote to this repository locally and force-push the current master to that upstream repository to override the master branch with this. Do the same for the develop branch.

    For hosting this source repository under any other GitHub organization, simply push it to that repository.

  6. Generate a fresh SSH key pair and add the private part to the Travis CI configuration or as a DEPLOY_SSH_KEY GitHub Actions secret, and the public part as the Deploy key to the VIP GitHub repository.

     ssh-keygen -f deploy-key -t rsa -b 4096 -C "[email protected]"
    

    This provides Travis CI or GitHub Actions with access to the VIP repository for deployments.

  7. Remove references to either Travis CI or GitHub actions from this README depending on which deploy strategy was selected.

  8. Remove these initial setup instructions from the README after the initial project setup.

Consider using a dedicated GitHub machine user for deployments in case the deploy logic requires access to multiple private GitHub repositories as there can be only one custom key associated with the Travis CI repository and GitHub doesn't allow sharing the same deploy key accross multiple repositories.

Setup ๐Ÿ› 

  1. Clone this repository:

     git clone [email protected]:wpcomvip/devgo-vip.git
    
  2. Move into the project directory:

     cd devgo-vip
    
  3. Install the project dependencies:

     npm install
    
  4. Start the development environment using Docker:

     npm run start
    

    and npm run stop to stop the virtual environment at any time. Run npm run start-debug to start the environment in debug mode where all output from containers is displayed. Run npm run stop-all to stop all active Docker containers in case you're running into port conflicts.

  5. Install the local WordPress multisite environment:

     npm run setup
    

    with the configuration from local/public/wp-cli.yml.

  6. Visit local.wpenv.net to view the development environment. WordPress username devgo and password devgo.

  7. Visit mail.local.wpenv.net to view all emails sent by WordPress.

The local development environment uses a self-signed SSL sertificate for HTTPS so the "Your connection is not private" error can be ignored to visit the site.

Resolving Port Conflicts

Docker engine shares the networking interface with the host computer so all the ports used by the containers need to be free and unused by any other services such as a DNS resolver on port 53, MySQL service on port 3306 or another web server running on port 80.

Use the included npm run stop-all command to stop all containers running Docker containers on the host machine. Alternativelly, you can adjust the port mappings in docker-compose.yml to expose different ports on the host machine.

Contribute

  1. Setup the local environment environment as described in the "Setup" section above.

  2. Create a Git branch such as feature/name or fix/vertical-scroll when you start working on a feature or a bug fix. Commit your work to that branch until it's ready for quality assurance and testing.

  3. Open a pull request from your feature branch to the develop branch or the staging environment.

  4. Review any feedback from the automated checks. Note that your local environment is configured to automatically check for any issues before each commit so there should be very few issues if you commit early and often.

  5. Merge the feature branch into develop on GitHub if all check pass. The automated Travis CI workflow (see the "Deployments" section below for details) or GitHub Actions workflow will deploy it to the develop-built branch.

  6. Test your feature on the VIP Go staging server. Open a new pull request from the same feature branch to develop if any fixes or changes are necessary.

  7. Once the feature is ready for production, open a new pull request from the same feature branch to the master branch.

  8. Ensure that all automated checks pass and merge in the pull request. The automated Travis CI workflow or GitHub Action workflow will deploy it to the master-built branch.

Plugins and Themes

Add new themes and plugins as Composer dependencies:

composer require your/theme your/plugin another/plugin

or manually copy them to themes, plugins or client-mu-plugins directories. Remember to start tracking the directories copied manually by excluding them from being ignored in themes/.gitignore and plugins/.gitignore.

Use client-mu-plugins/plugin-loader.php to force-enable certain plugins.

To update plugins and themes added as Composer dependencies, use composer install package/name or composer install --dev package/name where package/name is the name of the plugin or theme package. Be sure to commit the updated composer.json with composer.lock to the GitHub repository.

For manually installed plugins and themes replace the directory with the updated set of files and commit them to the GitHub repository.

Local Development Environment

We use Docker containers to replicate the VIP Go production environment with all VIP dependencies added as Composer packages and mapped to specific directories inside the containers as defined in docker-compose.yml.

Requests to port 80 of the container host are captured by an Nginx proxy container that routes all requests to the necessary service container based on the HTTP host name.

Importing and Exporting Data

Use VIP dashboard or VIP-CLI to download the database data from the production environment.

  • Run npm run vip -- export sql --output=local/public/wp/vip-export.sql to download the latest available backup to your local computer.

  • Run npm run cli -- wp db export to export and backup the database of your local development environment which will place a file like wordpress-2020-03-04-448b132.sql in the local/public/wp directory.

  • Run npm run cli -- wp db import vip-export.sql to import local/public/wp/vip-export.sql into your local development environment.

  • Run npm run cli -- bash -c "pv import.sql | wp db query" to import a large database file local/public/wp/vip-export.sql while monitoring the progress with pv which is bundled with the WordPress container. The bash -c prefix allows us to run multiple commands inside the container without affecting the main npm run cli command.

Scripts ๐Ÿงฐ

We use npm as the canonical task runner for things like linting files and creating release bundles. Composer scripts (defined in composer.json) are used only for PHP related tasks and they have a wrapper npm script in package.json for consistency with the rest of the registered tasks.

  • npm run start and npm run stop to start and stop the local development environment. Run npm run start-debug to start the environment in debug mode where all output from containers is displayed. Run npm run stop-all to stop all active Docker containers in case you're running into port conflicts. Run npm run stop -- --volumes to stop the project containers and delete the database data volume.

  • npm run lint to check source code against the defined coding standards.

  • npm run cli -- wp help where wp help is any command to run inside the WordPress docker container. For example, run npm run cli -- wp plugin list to list all of the available plugins or npm run cli -- composer update to update the Composer dependencies using the PHP binary in the container instead of your host machine. Run npm run cli -- wp user create devgo [email protected] --role=administrator --user_pass=devgo to create a new administrator user with devgo as username and password.

  • npm run vip to run VIP CLI commands on staging and production environments.

Deployments ๐Ÿš€

The deployment process always starts from the same clean state which enables reproducable builds accross different environments such as local development machines and continuous integration services.

Deployments to the VIP upstream repository are handled automatically by the Travis CI build process or GitHub Actions workflow after a feature branch is merged into master for production or develop for staging.

The CI process checks the code against the VIP coding standards, builds the release bundle and pushes the changes to the master-built branch for production or develop-built for staging deployment.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  master  โ”œโ”€โ”€โ–บโ”‚  Travis / GitHub Actions  โ”œโ”€โ”€โ–บโ”‚  master-built  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Internally it runs the local/scripts/deploy.sh script which does a clean checkout of the deploy source branch to local/deploy/src, runs the build process and copies the project files with the release artifects to deploy/dist using rsync. It then commits the changes to the matching *-built branch which is then imported by the VIP Go servers.

NewRelic Deploy Markers

The repository includes support for publishing NewRelic deployment markers after each deploy, if the NEW_RELIC_API_KEY key is configured in the Travis CI or GitHub Actions environment. Note that we're not using the official NewRelic deployment marker GitHub action because it is harder to configure for multiple App GUIDs.

npm run newrelic-mark-deploy -- --search "*-production" --api_key "${{ secrets.NEW_RELIC_API_KEY }}" --commit "${{ github.sha }}" --user "${{ github.actor }}" --description "$(git log -1 --pretty=%B)"

where:

  • --search is the search term to find the NewRelic app GUIDs by app name. The app names are set to $_SERVER['HTTP_HOST']-VIP_GO_APP_ENVIRONMENT in vip-config/vip-config.php so we use a wildcard search for *-VIPENVNAME where VIPENVNAME is the environment name such as staging or production.
  • --api_key is the API key to authenticate with New Relic.
  • --commit is the commit hash to use for the deployment.
  • --user is the user to associate with the deployment.
  • --description is the description to use for the deployment.

vip-site-template's People

Contributors

akshitsethi avatar delawski avatar dipskakadiya avatar edmundcwm avatar kasparsd avatar kopepasah avatar m-muhsin avatar nandotess avatar nikschavan avatar piotr-bajer avatar ramsesdelr avatar renovate-bot avatar renovate[bot] avatar say2me avatar zzap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vip-site-template's Issues

Webgrind returning unreadable zip files

Looks like Xdebug V3+ adds gzip compression by default when generating profiles for Webgrind, the thing is that Webgrind doesn't support gzip compression, hence it can open the file on the browser.

DEV_URL variable that exists on .env file is not working as expected

If I rename the file .env.example to .env and updated the DEV_URL variable to anything different from local.devgo.vip, in the end of the process the custom URL provided doesn't resolve to any Docker container.

Instead the local.devgo.vip continue to respond via NGINX proxy container.

I saw that docker-compose.yml is actually considering the variable, so I'm not sure what is the route cause of this issue.

Re-use pre-build Docker images during Travis CI

Considering that VIP doesn't support GitHub Actions, we're defaulting to using Travis CI for all the CI/CD needs. Currently Travis is building the development images on every run which is taking long. We could add support for hosting the images on GitHub packages and let Travis use them instead.

Privacy error issue with mkcert

Hello. I am running into an issue with mkcert.

mkcert installed successfully as did the certificates. Here's the output from the docker container:

Created a new certificate valid for the following names ๐Ÿ“œ
- "local.devgo.vip"
- "*.local.devgo.vip"
Reminder: X.509 wildcards only go one level deep, so this won't match a.b.local.devgo.vip โ„น๏ธ
The certificate is at "local.devgo.vip.crt" and the key at "local.devgo.vip.key" โœ…
It will expire on 11 June 2023 ๐Ÿ—“
Note: the local CA is not installed in the system trust store.
Run "mkcert -install" for certificates to be trusted automatically โš ๏ธ

Chrome is not recognizing the certificate authority - i.e. NET::ERR_CERT_AUTHORITY_INVALID

Add GitHub Actions for deploys from downstream repositories

The current setup assumes that the repository will be hosted by VIP in their origin repositories which currently don't support GitHub actions. However, a lot of setups rely on self-hosted downstream repositories pushing only release artifacts to the VIP upstream.

Add sample configuration and explain the required setup.

Documentation for changing WP version

The composer package for WordPress Core is using the dev-master tag which means one could be running an alpha release version of WP on their local.

Should we include instructions on how to change the WP version? AFAIK it could be as simple as replacing dev-master with the desired version in composer.json e.g., "johnpbloch/wordpress": "5.5",

I'll be more than happy to do a short write-up if necessary!

M1(2,3) Macs require docker-compose.override

Documentation should include notations about the overrides needed for use on an M1 Mac.

For example, I got this error:

[+] Running 2/4
 โ ด webgrind Pulling                                                                                                                                   1.6s
 โ ด mkcert Pulling                                                                                                                                     1.6s
 ! wordpress Warning                                                                                                                                  1.6s
 โœ” db Pulled                                                                                                                                          1.2s
no matching manifest for linux/arm64/v8 in the manifest list entries

And to fix it, I had to update my override to include these:

  db:
    image: mysql:8
    platform: linux/amd64/v8
  webgrind:
    platform: linux/amd64/v8
  dnsmasq:
    ports: !reset
      - "54:54/udp"

(dnsmasq is not needed for all projects, but I just have it in there to be safe since Macs are weird).

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Add support for defining specific Node version.

In a recent project support for specifying a Node version was added and that functionality assists with predictable development processes and builds.

The way this was added was by first defining engines property in package.json:

"engines": {
  "node": "^12.16.0"
}

Then adding an .npmrc with the key/value: engine-strict = true (this forces NPM to fail if the correct Node version is not installed.

Next we define an .nvmrc which specifies the Node version: 12.16. Here we leave off the .0 to install the latest patch version (which is what our engines property expects).

Lastly, for the CI process, we define the following in Travis:

before_install:
  - nvm install
  - nvm use

Locally, engineers can run nvm install from the project directory and the correct Node version will be downloaded and used during development.

Update to Node v18

Our theme template now defaults to Node v18 so we should update this template to match that.

All dependencies appear to support this new version of Node.

Homebrew deprecated command

On the documentation where it says to run the command brew cask install docker, it's actually brew install --cask docker if you have the most updated version of Homebrew... based on this thread:

Homebrew/discussions#340 (comment)

brew cask <command> was deprecated in favor of brew <command> --cask in Homebrew 2.6.0. Now that 2.7.0 has been released, they have been disabled.

So depending on the version of your Homebrew, this command might fail as it happened to me.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency automattic/vipwpcs to ^3.0.1
  • Update dependency yoast/phpunit-polyfills to ^2.0.1
  • Update dependency php to >=8.3.7
  • Update dependency wpackagist-theme/twentytwenty to ^2.6
  • Update mysql Docker tag to v8.4
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

composer
composer.json
  • php >=8.2
  • composer/installers ^1.12
  • wpackagist-theme/twentytwenty ^2.5
  • automattic/vipwpcs ^3.0
  • dealerdirect/phpcodesniffer-composer-installer ^1.0
  • phpunit/phpunit ^9.6.13
  • wp-cli/wp-cli-bundle ^2.8
  • wp-phpunit/wp-phpunit ^6.4.2
  • xwp/wait-for ^0.0.2
  • yoast/phpunit-polyfills ^2.0
docker-compose
docker-compose.yml
  • jwilder/nginx-proxy 1.3.1
  • andyshinn/dnsmasq 2.83
  • mysql 8.0
  • phpmyadmin/phpmyadmin 5.2.1
  • mailhog/mailhog v1.0.1
  • memcached 1.6
  • elasticsearch 7.17.2
dockerfile
local/docker/mkcert/Dockerfile
  • golang 1.22-alpine
local/docker/wordpress/Dockerfile
github-actions
.github/workflows/docker-images.yml
  • actions/checkout v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • ubuntu 22.04
.github/workflows/test-deploy.yml
  • actions/checkout v4
  • shivammathur/setup-php v2
  • actions/cache v4
  • actions/setup-node v4
  • docker/login-action v3
  • ubuntu 22.04
npm
package.json
  • @automattic/vip ^2.38.0
  • @wordpress/scripts ^27.1.0
  • lint-staged ^15.0.2
  • npm-run-all2 ^5.0.0
  • node ^18
nvm
.nvmrc
  • node 18

  • Check this box to trigger a request for Renovate to run again on this repository

Scaffolding script to replace strings during `composer create-project`

See existing examples:

Use command line prompt to request the following information:

  • Organization and project slug. Default to whatever is passed to composer create-project.
  • VIP GitHub repository name/ID. Uses for deployments.

Map:

  • xwp/vip-go-site with PROJECT_VENDOR/PROJECT_NAME
  • vip-go-site to PROJECT_NAME
  • devgo-vip to VIP_SITE_ID
  • local.devgo.vip with PROJECT_NAME.devgo.vip

Add GitHub Action for deploy to VIP upstream

The current Travis CI setup works great on VIP hosted GitHub repositories that don't have GitHub Actions available (only Travis).

For projects using a separate source repository it would be benificial to include a GitHub Action workflow for the same deploy workflow.

Document why sub-domain is better for local dev and staging

Using a subdomain multisite is more reliable because the request paths are the same on production and during testing. Adding port numbers and sub-directory prefixes such as /site-one/page-slug can lead to unexpected behaviour either locally on production.

Issue with MySQL on M1 Mac

When I start the docker instance using the docker-compose up --detach --remove-orphans --build command, I get this error:

ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries```

This is due to an issue with MySQL not being supported on M1 processors by default.

Lint YAML files

YAML can be confusing with boolean, yes/no and integer/string values. Add linting support to enforce a single standard. Preferably using known schemas for files that do have them.

WP Register Script Errors

Recently (unsure of the timing) this template started outputting register script errors, which seem to come from the Two Factor plugin. I feel this may not be entirely related to the plugin (needs investigation), but may be related to how the plugin works locally.

Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the fido-u2f-api handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /var/www/html/wp-includes/functions.php on line 5184 Call Stack: 0.0006 374912 1. {main}() /var/www/html/wp-admin/index.php:0 0.0012 376160 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/index.php:10 0.0012 376800 3. require_once('/var/www/html/wp-load.php') /var/www/html/wp-admin/admin.php:34 0.0018 377176 4. require_once('/var/www/html/wp-config.php') /var/www/html/wp-load.php:37 0.0330 396256 5. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-config.php:40 0.3681 2253944 6. do_action() /var/www/html/wp-settings.php:415 0.3681 2254320 7. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:478 0.3681 2254320 8. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-hook.php:311 0.4751 2315360 9. wpcom_vip_qm_require() /var/www/html/wp-includes/class-wp-hook.php:287 0.4751 2315360 10. apply_filters() /var/www/html/wp-content/mu-plugins/query-monitor.php:81 0.4751 2315768 11. WP_Hook->apply_filters() /var/www/html/wp-includes/plugin.php:206 0.4752 2317272 12. wpcom_vip_qm_enable() /var/www/html/wp-includes/class-wp-hook.php:287 0.4752 2317376 13. current_user_can() /var/www/html/wp-content/mu-plugins/query-monitor.php:57 0.4752 2317376 14. wp_get_current_user() /var/www/html/wp-includes/capabilities.php:665 0.4752 2317376 15. _wp_get_current_user() /var/www/html/wp-includes/pluggable.php:70 0.4789 2401392 16. wp_set_current_user() /var/www/html/wp-includes/user.php:2789 0.4799 2413152 17. do_action() /var/www/html/wp-includes/pluggable.php:48 0.4799 2413848 18. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:478 0.4799 2413848 19. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-hook.php:311 0.4819 2434376 20. wpcom_vip_enforce_two_factor_plugin() /var/www/html/wp-includes/class-wp-hook.php:287 0.4822 2436584 21. Two_Factor_Core::is_user_using_two_factor() /var/www/html/wp-content/mu-plugins/two-factor.php:144 0.4822 2436584 22. Two_Factor_Core::get_primary_provider_for_user() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/class-two-factor-core.php:406 0.4823 2436584 23. Two_Factor_Core::get_providers() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/class-two-factor-core.php:365 0.4828 2451832 24. Two_Factor_FIDO_U2F::get_instance() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/class-two-factor-core.php:148 0.4828 2452280 25. Two_Factor_FIDO_U2F->__construct() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/providers/class.two-factor-fido-u2f.php:48 0.4845 2462728 26. wp_register_script() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/providers/class.two-factor-fido-u2f.php:75 0.4845 2462728 27. _wp_scripts_maybe_doing_it_wrong() /var/www/html/wp-includes/functions.wp-scripts.php:174 0.4847 2463048 28. _doing_it_wrong() /var/www/html/wp-includes/functions.wp-scripts.php:67 0.4850 2464840 29. trigger_error() /var/www/html/wp-includes/functions.php:5184 Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the fido-u2f-login handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /var/www/html/wp-includes/functions.php on line 5184 Call Stack: 0.0006 374912 1. {main}() /var/www/html/wp-admin/index.php:0 0.0012 376160 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/index.php:10 0.0012 376800 3. require_once('/var/www/html/wp-load.php') /var/www/html/wp-admin/admin.php:34 0.0018 377176 4. require_once('/var/www/html/wp-config.php') /var/www/html/wp-load.php:37 0.0330 396256 5. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-config.php:40 0.3681 2253944 6. do_action() /var/www/html/wp-settings.php:415 0.3681 2254320 7. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:478 0.3681 2254320 8. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-hook.php:311 0.4751 2315360 9. wpcom_vip_qm_require() /var/www/html/wp-includes/class-wp-hook.php:287 0.4751 2315360 10. apply_filters() /var/www/html/wp-content/mu-plugins/query-monitor.php:81 0.4751 2315768 11. WP_Hook->apply_filters() /var/www/html/wp-includes/plugin.php:206 0.4752 2317272 12. wpcom_vip_qm_enable() /var/www/html/wp-includes/class-wp-hook.php:287 0.4752 2317376 13. current_user_can() /var/www/html/wp-content/mu-plugins/query-monitor.php:57 0.4752 2317376 14. wp_get_current_user() /var/www/html/wp-includes/capabilities.php:665 0.4752 2317376 15. _wp_get_current_user() /var/www/html/wp-includes/pluggable.php:70 0.4789 2401392 16. wp_set_current_user() /var/www/html/wp-includes/user.php:2789 0.4799 2413152 17. do_action() /var/www/html/wp-includes/pluggable.php:48 0.4799 2413848 18. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:478 0.4799 2413848 19. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-hook.php:311 0.4819 2434376 20. wpcom_vip_enforce_two_factor_plugin() /var/www/html/wp-includes/class-wp-hook.php:287 0.4822 2436584 21. Two_Factor_Core::is_user_using_two_factor() /var/www/html/wp-content/mu-plugins/two-factor.php:144 0.4822 2436584 22. Two_Factor_Core::get_primary_provider_for_user() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/class-two-factor-core.php:406 0.4823 2436584 23. Two_Factor_Core::get_providers() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/class-two-factor-core.php:365 0.4828 2451832 24. Two_Factor_FIDO_U2F::get_instance() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/class-two-factor-core.php:148 0.4828 2452280 25. Two_Factor_FIDO_U2F->__construct() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/providers/class.two-factor-fido-u2f.php:48 0.4972 2549072 26. wp_register_script() /var/www/html/wp-content/mu-plugins/shared-plugins/two-factor/providers/class.two-factor-fido-u2f.php:83 0.4972 2549072 27. _wp_scripts_maybe_doing_it_wrong() /var/www/html/wp-includes/functions.wp-scripts.php:174 0.4974 2549392 28. _doing_it_wrong() /var/www/html/wp-includes/functions.wp-scripts.php:67 0.4977 2551184 29. trigger_error() /var/www/html/wp-includes/functions.php:5184 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-includes/functions.php:5184) in /var/www/html/wp-includes/functions.php on line 6231 Call Stack: 0.0006 374912 1. {main}() /var/www/html/wp-admin/index.php:0 0.0012 376160 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/index.php:10 1.4330 3462552 3. do_action() /var/www/html/wp-admin/admin.php:173 1.4330 3462928 4. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:478 1.4330 3462928 5. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-hook.php:311 1.4692 3483512 6. send_frame_options_header() /var/www/html/wp-includes/class-wp-hook.php:285 1.4692 3483512 7. header() /var/www/html/wp-includes/functions.php:6231 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-includes/functions.php:5184) in /var/www/html/wp-admin/includes/misc.php on line 1284 Call Stack: 0.0006 374912 1. {main}() /var/www/html/wp-admin/index.php:0 0.0012 376160 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/index.php:10 1.4330 3462552 3. do_action() /var/www/html/wp-admin/admin.php:173 1.4330 3462928 4. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:478 1.4330 3462928 5. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-hook.php:311 2.3836 3556936 6. wp_admin_headers() /var/www/html/wp-includes/class-wp-hook.php:287 2.3836 3557256 7. header() /var/www/html/wp-admin/includes/misc.php:1284 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-includes/functions.php:5184) in /var/www/html/wp-admin/admin-header.php on line 9 Call Stack: 0.0006 374912 1. {main}() /var/www/html/wp-admin/index.php:0 2.6752 3606632 2. require_once('/var/www/html/wp-admin/admin-header.php') /var/www/html/wp-admin/index.php:111 2.6760 3606856 3. header() /var/www/html/wp-admin/admin-header.php:9 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-includes/functions.php:5184) in /var/www/html/wp-includes/option.php on line 962 Call Stack: 0.0006 374912 1. {main}() /var/www/html/wp-admin/index.php:0 2.6752 3606632 2. require_once('/var/www/html/wp-admin/admin-header.php') /var/www/html/wp-admin/index.php:111 2.6767 3607328 3. wp_user_settings() /var/www/html/wp-admin/admin-header.php:70 2.6788 3607960 4. setcookie() /var/www/html/wp-includes/option.php:962 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-includes/functions.php:5184) in /var/www/html/wp-includes/option.php on line 963 Call Stack: 0.0006 374912 1. {main}() /var/www/html/wp-admin/index.php:0 2.6752 3606632 2. require_once('/var/www/html/wp-admin/admin-header.php') /var/www/html/wp-admin/index.php:111 2.6767 3607328 3. wp_user_settings() /var/www/html/wp-admin/admin-header.php:70 2.6789 3607968 4. setcookie() /var/www/html/wp-includes/option.php:963

Exclude /local in phpcs.xml

Hello @kasparsd !

Since the local folder contains the default WP installation, should we look to exclude it from phpcs.xml?

The project I'm working on uses this template but has its own custom PHPCS ruleset, which didn't exclude the local folder. As a result, the PHP linting took really long.

It seems unnecessary to sniff Core WP files?

Error: Cannot start service wordpress

Creating vip-go-site_wordpress_1 ... error

ERROR: for vip-go-site_wordpress_1 Cannot start service wordpress: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/host_mnt/Users/mike/Sites/test-vip-go/vip-go-site/local/public/wp-cli.yml" to rootfs at "/var/www/html/wp-cli.yml" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for wordpress Cannot start service wordpress: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/host_mnt/Users/mike/Sites/test-vip-go/vip-go-site/local/public/wp-cli.yml" to rootfs at "/var/www/html/wp-cli.yml" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: Encountered errors while bringing up the project.

OSX Catalina 10.15.7 / Docker 3.4.0 / Node 12.22

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.