Browse Source

chore: ๐Ÿค– remove pantheon cruft

default
Josh Habdas 1 month ago
parent
commit
286c26ab46
Signed by: jhabdas GPG Key ID: B148B31154C75A74
823 changed files with 0 additions and 181479 deletions
  1. +0
    -4
      .circleci/.gitignore
  2. +0
    -14
      .circleci/behat.yml
  3. +0
    -33
      .circleci/cleanup.sh
  4. +0
    -58
      .circleci/config.yml
  5. +0
    -48
      .circleci/confirm-safety.sh
  6. +0
    -59
      .circleci/features/0-install.feature
  7. +0
    -45
      .circleci/features/bootstrap/AdminLogIn.php
  8. +0
    -46
      .circleci/features/bootstrap/ResponseHeader.php
  9. +0
    -27
      .circleci/features/options.feature
  10. +0
    -7
      .circleci/features/pantheon-logged-out.feature
  11. +0
    -35
      .circleci/features/pantheon.feature
  12. +0
    -33
      .circleci/features/plugins.feature
  13. +0
    -12
      .circleci/features/terms.feature
  14. +0
    -1
      .circleci/features/themes.feature
  15. +0
    -40
      .circleci/features/users.feature
  16. +0
    -12
      .circleci/local.test.dist
  17. +0
    -43
      .circleci/prepare.sh
  18. +0
    -46
      .circleci/set-up-globals.sh
  19. +0
    -26
      .circleci/test.sh
  20. +0
    -4
      .gitignore
  21. +0
    -21
      pantheon.upstream.yml
  22. +0
    -33
      wp-config-local-sample.php
  23. +0
    -90
      wp-config-pantheon.php
  24. +0
    -90
      wp-config-sample.php
  25. +0
    -86
      wp-config.php
  26. +0
    -0
      wp-content/mu-plugins/.gitkeep
  27. +0
    -22
      wp-content/mu-plugins/pantheon.php
  28. +0
    -16
      wp-content/mu-plugins/pantheon/.editorconfig
  29. +0
    -12
      wp-content/mu-plugins/pantheon/README.md
  30. +0
    -63
      wp-content/mu-plugins/pantheon/assets/css/return-to-pantheon-button.css
  31. +0
    -17
      wp-content/mu-plugins/pantheon/assets/images/pantheon-fist-icon-black.svg
  32. +0
    -8
      wp-content/mu-plugins/pantheon/assets/js/return-to-pantheon-button.js
  33. +0
    -72
      wp-content/mu-plugins/pantheon/pantheon-login-form-mods.php
  34. +0
    -479
      wp-content/mu-plugins/pantheon/pantheon-page-cache.php
  35. +0
    -150
      wp-content/mu-plugins/pantheon/pantheon-updates.php
  36. +0
    -34
      wp-content/plugins/akismet/.htaccess
  37. +0
    -376
      wp-content/plugins/akismet/_inc/akismet.css
  38. +0
    -189
      wp-content/plugins/akismet/_inc/akismet.js
  39. +0
    -30
      wp-content/plugins/akismet/_inc/form.js
  40. BIN
      wp-content/plugins/akismet/_inc/img/logo-full-2x.png
  41. +0
    -61
      wp-content/plugins/akismet/akismet.php
  42. +0
    -965
      wp-content/plugins/akismet/class.akismet-admin.php
  43. +0
    -110
      wp-content/plugins/akismet/class.akismet-widget.php
  44. +0
    -1153
      wp-content/plugins/akismet/class.akismet.php
  45. +0
    -2
      wp-content/plugins/akismet/index.php
  46. +0
    -294
      wp-content/plugins/akismet/readme.txt
  47. +0
    -220
      wp-content/plugins/akismet/views/config.php
  48. +0
    -6
      wp-content/plugins/akismet/views/get.php
  49. +0
    -119
      wp-content/plugins/akismet/views/notice.php
  50. +0
    -97
      wp-content/plugins/akismet/views/start.php
  51. +0
    -4
      wp-content/plugins/akismet/views/stats.php
  52. +0
    -17
      wp-content/plugins/akismet/views/strict.php
  53. +0
    -213
      wp-content/plugins/akismet/wrapper.php
  54. +0
    -82
      wp-content/plugins/hello.php
  55. +0
    -48
      wp-content/themes/twentyeleven/404.php
  56. +0
    -72
      wp-content/themes/twentyeleven/archive.php
  57. +0
    -101
      wp-content/themes/twentyeleven/author.php
  58. +0
    -74
      wp-content/themes/twentyeleven/category.php
  59. +0
    -623
      wp-content/themes/twentyeleven/colors/dark.css
  60. +0
    -81
      wp-content/themes/twentyeleven/comments.php
  61. +0
    -48
      wp-content/themes/twentyeleven/content-aside.php
  62. +0
    -47
      wp-content/themes/twentyeleven/content-featured.php
  63. +0
    -90
      wp-content/themes/twentyeleven/content-gallery.php
  64. +0
    -72
      wp-content/themes/twentyeleven/content-image.php
  65. +0
    -21
      wp-content/themes/twentyeleven/content-intro.php
  66. +0
    -48
      wp-content/themes/twentyeleven/content-link.php
  67. +0
    -23
      wp-content/themes/twentyeleven/content-page.php
  68. +0
    -74
      wp-content/themes/twentyeleven/content-quote.php
  69. +0
    -74
      wp-content/themes/twentyeleven/content-single.php
  70. +0
    -61
      wp-content/themes/twentyeleven/content-status.php
  71. +0
    -84
      wp-content/themes/twentyeleven/content.php
  72. +0
    -24
      wp-content/themes/twentyeleven/editor-style-rtl.css
  73. +0
    -312
      wp-content/themes/twentyeleven/editor-style.css
  74. +0
    -36
      wp-content/themes/twentyeleven/footer.php
  75. +0
    -742
      wp-content/themes/twentyeleven/functions.php
  76. +0
    -145
      wp-content/themes/twentyeleven/header.php
  77. +0
    -112
      wp-content/themes/twentyeleven/image.php
  78. BIN
      wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark-rtl.png
  79. BIN
      wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark.png
  80. BIN
      wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-rtl.png
  81. BIN
      wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor.png
  82. BIN
      wp-content/themes/twentyeleven/images/comment-arrow-dark-rtl.png
  83. BIN
      wp-content/themes/twentyeleven/images/comment-arrow-dark.png
  84. BIN
      wp-content/themes/twentyeleven/images/comment-arrow-rtl.png
  85. BIN
      wp-content/themes/twentyeleven/images/comment-arrow.png
  86. BIN
      wp-content/themes/twentyeleven/images/comment-bubble-dark-rtl.png
  87. BIN
      wp-content/themes/twentyeleven/images/comment-bubble-dark.png
  88. BIN
      wp-content/themes/twentyeleven/images/comment-bubble-rtl.png
  89. BIN
      wp-content/themes/twentyeleven/images/comment-bubble.png
  90. BIN
      wp-content/themes/twentyeleven/images/headers/chessboard-thumbnail.jpg
  91. BIN
      wp-content/themes/twentyeleven/images/headers/chessboard.jpg
  92. BIN
      wp-content/themes/twentyeleven/images/headers/hanoi-thumbnail.jpg
  93. BIN
      wp-content/themes/twentyeleven/images/headers/hanoi.jpg
  94. BIN
      wp-content/themes/twentyeleven/images/headers/lanterns-thumbnail.jpg
  95. BIN
      wp-content/themes/twentyeleven/images/headers/lanterns.jpg
  96. BIN
      wp-content/themes/twentyeleven/images/headers/pine-cone-thumbnail.jpg
  97. BIN
      wp-content/themes/twentyeleven/images/headers/pine-cone.jpg
  98. BIN
      wp-content/themes/twentyeleven/images/headers/shore-thumbnail.jpg
  99. BIN
      wp-content/themes/twentyeleven/images/headers/shore.jpg
  100. BIN
      wp-content/themes/twentyeleven/images/headers/trolley-thumbnail.jpg

+ 0
- 4
.circleci/.gitignore View File

@ -1,4 +0,0 @@
.DS_Store
local.test
local.env
local.ssh

+ 0
- 14
.circleci/behat.yml View File

@ -1,14 +0,0 @@
# behat.yml
default:
suites:
default:
paths:
- features
contexts:
- Behat\MinkExtension\Context\MinkContext
- AdminLogIn
- ResponseHeader
extensions:
Behat\MinkExtension:
# base_url set by ENV
goutte: ~

+ 0
- 33
.circleci/cleanup.sh View File

@ -1,33 +0,0 @@
#!/bin/bash
# Echo commands as they are executed, but don't allow errors to stop the script.
set -x
if [ -z "$TERMINUS_SITE" ] || [ -z "$TERMINUS_ENV" ]; then
echo "TERMINUS_SITE and TERMINUS_ENV environment variables must be set"
exit 1
fi
# Only delete old environments if there is a pattern defined to
# match environments eligible for deletion. Otherwise, delete the
# current multidev environment immediately.
#
# To use this feature, set MULTIDEV_DELETE_PATTERN to '^ci-' or similar
# in the CI server environment variables.
if [ -z "$MULTIDEV_DELETE_PATTERN" ] ; then
terminus env:delete $TERMINUS_SITE.$TERMINUS_ENV --delete-branch --yes
exit 0
fi
# List all but the newest two environments.
OLDEST_ENVIRONMENTS=$(terminus env:list "$TERMINUS_SITE" --format=list | grep -v dev | grep -v test | grep -v live | sort -k2 | grep "$MULTIDEV_DELETE_PATTERN" | sed -e '$d' | sed -e '$d')
# Exit if there are no environments to delete
if [ -z "$OLDEST_ENVIRONMENTS" ] ; then
exit 0
fi
# Go ahead and delete the oldest environments.
for ENV_TO_DELETE in $OLDEST_ENVIRONMENTS ; do
terminus env:delete $TERMINUS_SITE.$ENV_TO_DELETE --delete-branch --yes
done

+ 0
- 58
.circleci/config.yml View File

@ -1,58 +0,0 @@
test-defaults: &test-defaults
docker:
- image: quay.io/pantheon-public/terminus-plugin-test:1.x
working_directory: ~/work/wp
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
TERM: dumb
merge-defaults: &merge-defaults
docker:
- image: quay.io/getpantheon/upstream-update-build:1.x
working_directory: ~/work/wp
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
TERM: dumb
version: 2
jobs:
test:
<<: *test-defaults
steps:
- checkout
- run:
name: Set up environment
command: ./.circleci/set-up-globals.sh
- run:
name: Prepare
command: ./.circleci/prepare.sh
- run:
name: Test
command: ./.circleci/test.sh --strict
- run:
name: Cleanup
command: ./.circleci/cleanup.sh
- run:
name: Confirm that it is safe to merge
command: ./.circleci/confirm-safety.sh
merge:
<<: *merge-defaults
steps:
- checkout
- run:
# https://github.com/pantheon-systems/upstream-update-build/blob/1.x/bin/automerge.sh
name: Merge the default branch back to the master branch
command: automerge.sh
workflows:
version: 2
wordpress:
jobs:
- test
- merge:
requires:
- test
filters:
branches:
only:
- default

+ 0
- 48
.circleci/confirm-safety.sh View File

@ -1,48 +0,0 @@
#!/bin/bash
#
# The purpose of this script is to examine the base branch that this PR is
# set to merge into by usig the GitHub API. We are only querying a public
# repo here, so we do not need to use the GITHUB_TOKEN.
#
# Exit if we are not running on Circle CI.
if [ -z "$CIRCLECI" ] ; then
exit 0
fi
# We only need to make this check for branches forked from default (right) / master (wrong).
# Skip the test for the default branch. (The .circleci directory will never be added to the master branch).
if [ "$CIRCLE_BRANCH" == "default" ] ; then
exit 0
fi
# We cannot continue unless we have a pull request.
if [ -z "$CIRCLE_PULL_REQUEST" ] ; then
echo "No CIRCLE_PULL_REQUEST defined; please create a pull request."
exit 1
fi
# CIRCLE_PULL_REQUEST=https://github.com/ORG/PROJECT/pull/NUMBER
PR_NUMBER=$(echo $CIRCLE_PULL_REQUEST | sed -e 's#.*/pull/##')
# Display the API call we are using
echo curl https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUMBER
base=$(curl https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUMBER 2>/dev/null | jq .base.ref)
echo "The base branch is $base"
# If the PR merges into 'default', then it is safe to merge.
if [ "$base" == '"default"' ] ; then
echo "It is safe to merge this PR into the $base branch"
exit 0
fi
# Force a test failure if the PR's base is the master branch.
if [ "$base" == '"master"' ] ; then
echo "ERROR: merging this PR into the $base branch is not allowed. Change the base branch for the PR to merge into the \"default\" branch instead."
exit 1
fi
echo "Merging probably okay, if you are merging one PR into another. Use caution; do not merge to the \"master\" branch."

+ 0
- 59
.circleci/features/0-install.feature View File

@ -1,59 +0,0 @@
Feature: Install WordPress through the web UI
@upstreamonly
Scenario: Install WordPress with the en_US locale
When I go to "/"
Then print current URL
And I should be on "/wp-admin/install.php"
When I press "language-continue"
Then print current URL
And I should be on "/wp-admin/install.php?step=1"
And I should see "Welcome to the famous five-minute WordPress installation process!"
When I fill in "weblog_title" with "Pantheon WordPress Upstream"
And I fill in "user_name" with the command line global variable: "WORDPRESS_ADMIN_USERNAME"
And I fill in "admin_password" with the command line global variable: "WORDPRESS_ADMIN_PASSWORD"
And I fill in "admin_password2" with the command line global variable: "WORDPRESS_ADMIN_PASSWORD"
And I check "pw_weak"
And I fill in "admin_email" with "wordpress-upstream@getpantheon.com"
And I press "submit"
Then print current URL
And I should be on "/wp-admin/install.php?step=2"
And I should see "WordPress has been installed."
And I follow "Log In"
And I fill in "Username or Email Address" with the command line global variable: "WORDPRESS_ADMIN_USERNAME"
And I fill in "Password" with the command line global variable: "WORDPRESS_ADMIN_PASSWORD"
And I press "Log In"
And I should see "Welcome to WordPress!"
Scenario: Attempting to install WordPress a second time should error
When I go to "/wp-admin/install.php"
Then I should see "You appear to have already installed WordPress."
Scenario: Verify the active theme is Twenty-Something (no point breaking every year for no good reason)
When I go to "/"
Then the response should contain "<link rel='stylesheet' id='twenty"
@upstreamonly
Scenario: Delete Akismet and Hello Dolly
Given I log in as an admin
When I go to "/wp-admin/plugins.php"
Then I should see "2 items" in the ".displaying-num" element
When I follow "Delete"
Then I should see "You are about to remove the following plugin:"
When I press "submit"
Then print current URL
And I should see "The selected plugin has been deleted." in the "#message" element
And I should see "1 item" in the ".displaying-num" element
When I follow "Delete"
Then I should see "You are about to remove the following plugin:"
When I press "submit"
Then print current URL
And I should see "The selected plugin has been deleted." in the "#message" element
And I should see "No plugins are currently available."

+ 0
- 45
.circleci/features/bootstrap/AdminLogIn.php View File

@ -1,45 +0,0 @@
<?php
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\MinkExtension\Context\MinkContext;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
/**
* Define application features from the specific context.
*/
class AdminLogIn implements Context, SnippetAcceptingContext {
/** @var \Behat\MinkExtension\Context\MinkContext */
private $minkContext;
/** @BeforeScenario */
public function gatherContexts(BeforeScenarioScope $scope)
{
$environment = $scope->getEnvironment();
$this->minkContext = $environment->getContext('Behat\MinkExtension\Context\MinkContext');
}
/**
* @Given I log in as an admin
*/
public function ILogInAsAnAdmin()
{
$this->minkContext->visit('wp-login.php');
$this->minkContext->fillField('log', getenv('WORDPRESS_ADMIN_USERNAME'));
$this->minkContext->fillField('pwd', getenv('WORDPRESS_ADMIN_PASSWORD'));
$this->minkContext->pressButton('wp-submit');
$this->minkContext->assertPageAddress("wp-admin/");
}
/**
* Fills in form field with specified id|name|label|value
* Example: When I fill in "admin_password2" with the command line global variable: "WORDPRESS_ADMIN_PASSWORD"
*
* @When I fill in :arg1 with the command line global variable: :arg2
*/
public function fillFieldWithGlobal($field, $value)
{
$this->minkContext->fillField($field, getenv($value));
}
}

+ 0
- 46
.circleci/features/bootstrap/ResponseHeader.php View File

@ -1,46 +0,0 @@
<?php
use Behat\MinkExtension\Context\RawMinkContext;
class ResponseHeader extends RawMinkContext {
/**
* Checks, that current page response header is equal to specified.
*
* @Then /^the response header "(?P<name>(?:[^"]|\\")*)" should be "(?P<value>(?:[^"]|\\")*)"$/
*/
public function assertResponseHeader($name, $value)
{
$this->assertSession()->responseHeaderEquals($name, $value);
}
/**
* Checks, that current page response header is not equal to specified.
*
* @Then /^the response header "(?P<name>(?:[^"]|\\")*)" should not be "(?P<value>(?:[^"]|\\")*)"$/
*/
public function assertResponseHeaderIsNot($name, $value)
{
$this->assertSession()->responseHeaderNotEquals($name, $value);
}
/**
* Checks, that current page response header contains specified value.
*
* @Then /^the response header "(?P<name>(?:[^"]|\\")*)" should contain "(?P<value>(?:[^"]|\\")*)"$/
*/
public function assertResponseHeaderContains($name, $value)
{
$this->assertSession()->responseHeaderContains($name, $value);
}
/**
* Checks, that current page response header does not contain specified value.
*
* @Then /^the response header "(?P<name>(?:[^"]|\\")*)" should not contain "(?P<value>(?:[^"]|\\")*)"$/
*/
public function assertResponseHeaderNotContains($name, $value)
{
$this->assertSession()->responseHeaderNotContains($name, $value);
}
}

+ 0
- 27
.circleci/features/options.feature View File

@ -1,27 +0,0 @@
Feature: Manage WordPress options
Background:
Given I log in as an admin
Scenario: Update the site tagline
When I go to "/"
Then I should see "Just another WordPress site" in the ".site-description" element
And I should not see "Pantheon upstream testing site" in the ".site-description" element
When I go to "/wp-admin/options-general.php"
And I fill in "blogdescription" with "Pantheon upstream testing site"
And I press "submit"
Then I should see "Settings saved."
When I go to "/"
Then I should see "Pantheon upstream testing site" in the ".site-description" element
Then I should not see "Just another WordPress site" in the ".site-description" element
When I go to "/wp-admin/options-general.php"
And I fill in "blogdescription" with "Just another WordPress site"
And I press "submit"
Then I should see "Settings saved."
When I go to "/"
Then I should see "Just another WordPress site" in the ".site-description" element
And I should not see "Pantheon upstream testing site" in the ".site-description" element

+ 0
- 7
.circleci/features/pantheon-logged-out.feature View File

@ -1,7 +0,0 @@
Feature: Verify various Pantheon features as a logged-out user
Scenario: Cache-Control should default to TTL=600
When I go to "/"
And the response header "Cache-Control" should be "public, max-age=600"
And the response header "Pragma" should not contain "no-cache"

+ 0
- 35
.circleci/features/pantheon.feature View File

@ -1,35 +0,0 @@
Feature: Perform Pantheon-specific actions
Background:
Given I log in as an admin
Scenario: Change the cache TTL
When I go to "/wp-admin/options-general.php?page=pantheon-cache"
Then I should see "Pantheon Page Cache"
And the "pantheon-cache[default_ttl]" field should contain "600"
When I fill in "pantheon-cache[default_ttl]" with "300"
And I press "Update TTL"
Then I should see "Settings saved."
And the "pantheon-cache[default_ttl]" field should contain "300"
When I fill in "pantheon-cache[default_ttl]" with "600"
And I press "Update TTL"
Then I should see "Settings saved."
And the "pantheon-cache[default_ttl]" field should contain "600"
Scenario: Clear the site cache
When I go to "/wp-admin/options-general.php?page=pantheon-cache"
Then I should see "Clear Site Cache"
And I should not see "Site cache flushed."
When I press "Clear Cache"
Then print current URL
And I should be on "/wp-admin/options-general.php?page=pantheon-cache&cache-cleared=true"
And I should see "Site cache flushed." in the ".updated" element
Scenario: Verify the Pantheon MU plugin is present
When I go to "/wp-admin/plugins.php?plugin_status=mustuse"
Then I should see "Files in the /wp-content/mu-plugins directory are executed automatically." in the ".tablenav" element
And I should see "Pantheon" in the "#the-list" element
And I should see "Building on Pantheon's and WordPress's strengths, together." in the "#the-list" element

+ 0
- 33
.circleci/features/plugins.feature View File

@ -1,33 +0,0 @@
Feature: Manage WordPress plugins
Background:
Given I log in as an admin
@upstreamonly
Scenario: Install, activate, deactivate, and delete a plugin
When I go to "/wp-admin/plugin-install.php?tab=search&s=hello+dolly"
And I follow "Hello Dolly"
Then print current URL
Then I should see "Hello Dolly" in the "#plugin-information-title" element
When I follow "Install Now"
Then print current URL
And I should see "Successfully installed the plugin Hello Dolly"
When I follow "Activate Plugin"
Then print current URL
And I should see "Plugin activated." in the "#message" element
And I should see a "#dolly" element
And I should see "1 item" in the ".displaying-num" element
When I follow "Deactivate"
Then print current URL
And I should see "Plugin deactivated." in the "#message" element
When I follow "Delete"
Then I should see "You are about to remove the following plugin:"
When I press "submit"
Then print current URL
And I should see "The selected plugin has been deleted." in the "#message" element
And I should see "No plugins are currently available."

+ 0
- 12
.circleci/features/terms.feature View File

@ -1,12 +0,0 @@
Feature: Manage WordPress terms
Background:
Given I log in as an admin
Scenario: Create a new tag
When I go to "/wp-admin/edit-tags.php?taxonomy=post_tag"
And I fill in "tag-name" with "Pantheon Testing Tag"
And I press "submit"
Then print current URL
And I should see "Tag added."
And I should see "Pantheon Testing Tag"

+ 0
- 1
.circleci/features/themes.feature View File

@ -1 +0,0 @@
Feature: Manage WordPress themes

+ 0
- 40
.circleci/features/users.feature View File

@ -1,40 +0,0 @@
Feature: Manage WordPress users
Background:
Given I log in as an admin
Scenario: User create, update and delete
When I go to "/wp-admin/user-new.php"
And I fill in "user_login" with "pantheontestuser"
And I fill in "email" with "test@example.com"
And I fill in "pass1" with "password"
And I fill in "pass2" with "password"
And I press "createuser"
Then print current URL
And I should be on "/wp-admin/users.php?id=2"
And I should see "New user created." in the "#message" element
And I should see "2 items" in the ".displaying-num" element
When I go to "/wp-admin/users.php"
And I follow "pantheontestuser"
Then print current URL
And I should be on "/wp-admin/user-edit.php?user_id=2&wp_http_referer=%2Fwp-admin%2Fusers.php"
And the "first_name" field should not contain "Pantheon Test"
When I fill in "first_name" with "Pantheon Test"
And I press "submit"
Then print current URL
And I should be on "/wp-admin/user-edit.php?user_id=2&wp_http_referer=%2Fwp-admin%2Fusers.php"
And I should see "User updated." in the "#message" element
And the "first_name" field should contain "Pantheon Test"
When I go to "/wp-admin/users.php"
And I follow "Delete"
Then print current URL
And I should see "You have specified this user for deletion:"
When I press "submit"
Then print current URL
And I should be on "/wp-admin/users.php?delete_count=1"
And I should see "User deleted." in the "#message" element
And I should see "1 item" in the ".displaying-num" element

+ 0
- 12
.circleci/local.test.dist View File

@ -1,12 +0,0 @@
#!/bin/bash
# Copy to local.test and customize
circleci \
-e CIRCLE_BUILD_NUM=0 \
-e TERMINUS_TOKEN=$TERMINUS_TOKEN \
-e TERMINUS_SITE=$TERMINUS_SITE \
-e TERMINUS_ENV=ci-$CIRCLE_BUILD_NUM \
-e TERMINUS_HIDE_UPDATE_MESSAGE=1 \
-e WORDPRESS_ADMIN_USERNAME=admin \
-e WORDPRESS_ADMIN_PASSWORD=$ADMIN_PASSWORD \
build --job test

+ 0
- 43
.circleci/prepare.sh View File

@ -1,43 +0,0 @@
#!/bin/bash
###
# Prepare a Pantheon site environment for the Behat test suite, by pushing the
# requested upstream branch to the environment. This script is architected
# such that it can be run a second time if a step fails.
###
set -ex
if [ -z "$TERMINUS_SITE" ] || [ -z "$TERMINUS_ENV" ]; then
echo "TERMINUS_SITE and TERMINUS_ENV environment variables must be set"
exit 1
fi
###
# Create a new environment for this particular test run.
###
terminus --yes env:info $TERMINUS_SITE.$TERMINUS_ENV 2>/dev/null || terminus --yes env:create $TERMINUS_SITE.dev $TERMINUS_ENV
terminus --yes env:wipe $TERMINUS_SITE.$TERMINUS_ENV
###
# Get all necessary environment details.
###
PANTHEON_GIT_URL=$(terminus connection:info $TERMINUS_SITE.$TERMINUS_ENV --field=git_url)
PANTHEON_SITE_URL="$TERMINUS_ENV-$TERMINUS_SITE.pantheonsite.io"
BASH_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
###
# Switch to git mode for pushing the files up
###
terminus --yes connection:set $TERMINUS_SITE.$TERMINUS_ENV git
###
# Push the upstream branch to the environment
###
git remote add pantheon $PANTHEON_GIT_URL
git push -f pantheon $CIRCLE_BRANCH:$TERMINUS_ENV
###
# Switch to SFTP mode so the site can install plugins and themes
###
terminus --yes connection:set $TERMINUS_SITE.$TERMINUS_ENV sftp

+ 0
- 46
.circleci/set-up-globals.sh View File

@ -1,46 +0,0 @@
#!/bin/bash
# Create a local .ssh directory if needed & available
SELF_DIRNAME="`dirname -- "$0"`"
[ -d "$HOME/.ssh" ] || [ ! -d "$SELF_DIRNAME/local.ssh" ] || cp -R "$SELF_DIRNAME/local.ssh" "$HOME/.ssh"
# If an admin password has not been defined, write one to ~/WORDPRESS_ADMIN_PASSWORD
if [ ! -f ~/WORDPRESS_ADMIN_PASSWORD ] && [ -z "$WORDPRESS_ADMIN_PASSWORD" ] ; then
echo $(openssl rand -hex 8) > ~/WORDPRESS_ADMIN_PASSWORD
fi
# If an admin password has not been defined, read it from ~/WORDPRESS_ADMIN_PASSWORD
if [ ! -f ~/WORDPRESS_ADMIN_PASSWORD ] && [ -z "$WORDPRESS_ADMIN_PASSWORD" ] ; then
WORDPRESS_ADMIN_PASSWORD="$(cat ~/WORDPRESS_ADMIN_PASSWORD)"
fi
#=====================================================================================================================
# EXPORT needed environment variables
#
# Circle CI 2.0 does not yet expand environment variables so they have to be manually EXPORTed
# Once environment variables can be expanded this section can be removed
# See: https://discuss.circleci.com/t/unclear-how-to-work-with-user-variables-circleci-provided-env-variables/12810/11
# See: https://discuss.circleci.com/t/environment-variable-expansion-in-working-directory/11322
# See: https://discuss.circleci.com/t/circle-2-0-global-environment-variables/8681
#=====================================================================================================================
mkdir -p $(dirname $BASH_ENV)
touch $BASH_ENV
(
echo 'export PATH=$PATH:$HOME/bin'
echo 'export TERMINUS_HIDE_UPDATE_MESSAGE=1'
echo 'export TERMINUS_ENV=ci-$CIRCLE_BUILD_NUM'
echo 'export WORDPRESS_ADMIN_USERNAME=pantheon'
echo "export WORDPRESS_ADMIN_PASSWORD=$WORDPRESS_ADMIN_PASSWORD"
) >> $BASH_ENV
source $BASH_ENV
echo "Test site is $TERMINUS_SITE.$TERMINUS_ENV"
echo "Logging in with a machine token:"
terminus auth:login -n --machine-token="$TERMINUS_TOKEN"
terminus whoami
touch $HOME/.ssh/config
echo "StrictHostKeyChecking no" >> "$HOME/.ssh/config"
git config --global user.email "$GIT_EMAIL"
git config --global user.name "Circle CI"
# Ignore file permissions.
git config --global core.fileMode false

+ 0
- 26
.circleci/test.sh View File

@ -1,26 +0,0 @@
#!/bin/bash
###
# Execute the Behat test suite against a prepared Pantheon site environment.
###
set -ex
SELF_DIRNAME="`dirname -- "$0"`"
# Require a target site
if [ -z "$TERMINUS_SITE" ] || [ -z "$TERMINUS_ENV" ]; then
echo "TERMINUS_SITE and TERMINUS_ENV environment variables must be set"
exit 1
fi
# Require admin username and password
if [ -z "$WORDPRESS_ADMIN_USERNAME" ] || [ -z "$WORDPRESS_ADMIN_PASSWORD" ]; then
echo "WORDPRESS_ADMIN_USERNAME and WORDPRESS_ADMIN_PASSWORD environment variables must be set"
exit 1
fi
export BEHAT_PARAMS='{"extensions" : {"Behat\\MinkExtension" : {"base_url" : "http://'$TERMINUS_ENV'-'$TERMINUS_SITE'.pantheonsite.io"} }}'
# We expect 'behat' to be in our PATH. Our container symlinks it at /usr/local/bin
cd $SELF_DIRNAME && behat --config=behat.yml $*

+ 0
- 4
.gitignore View File

@ -18,10 +18,6 @@ sitemap.xml.gz
wp-content/cache/
wp-content/backups/
# Avoid accidental modification of pantheon.upstream.yml in sites
# created from this upstream
pantheon.upstream.yml
# Packages #
############
*.7z

+ 0
- 21
pantheon.upstream.yml View File

@ -1,21 +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: 7.3
# 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

+ 0
- 33
wp-config-local-sample.php View File

@ -1,33 +0,0 @@
<?php
/**
* This is a sample config for local development. wp-config.php will
* load this file if you're not in a Pantheon environment. Simply edit/copy
* as needed and rename to wp-config-local.php.
*
* Be sure to replace YOUR LOCAL DOMAIN below too.
*/
define( 'DB_NAME', 'database_name' );
define( 'DB_USER', 'database_username' );
define( 'DB_PASSWORD', 'database_password' );
define( 'DB_HOST', 'database_host' );
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_HOME', '<YOUR LOCAL DOMAIN>' );
define( 'WP_SITEURL', '<YOUR LOCAL DOMAIN>' );
define( 'WP_AUTO_UPDATE_CORE', false );

+ 0
- 90
wp-config-pantheon.php View File

@ -1,90 +0,0 @@
<?php
/**
* Pantheon platform settings.
*
* IMPORTANT NOTE:
* Do not modify this file. This file is maintained by Pantheon.
*
* Site-specific modifications belong in wp-config.php, not this file. This
* file may change in future releases and modifications would cause conflicts
* when attempting to apply upstream updates.
*/
// ** MySQL settings - included in the Pantheon Environment ** //
/** The name of the database for WordPress */
define('DB_NAME', $_ENV['DB_NAME']);
/** MySQL database username */
define('DB_USER', $_ENV['DB_USER']);
/** MySQL database password */
define('DB_PASSWORD', $_ENV['DB_PASSWORD']);
/** MySQL hostname; on Pantheon this includes a specific port number. */
define('DB_HOST', $_ENV['DB_HOST'] . ':' . $_ENV['DB_PORT']);
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys and Salts.
*
* Changing these will force all users to have to log in again.
* Pantheon sets these values for you. If you want to shuffle them you must
* contact support: https://pantheon.io/docs/getting-support
*
* @since 2.6.0
*/
define('AUTH_KEY', $_ENV['AUTH_KEY']);
define('SECURE_AUTH_KEY', $_ENV['SECURE_AUTH_KEY']);
define('LOGGED_IN_KEY', $_ENV['LOGGED_IN_KEY']);
define('NONCE_KEY', $_ENV['NONCE_KEY']);
define('AUTH_SALT', $_ENV['AUTH_SALT']);
define('SECURE_AUTH_SALT', $_ENV['SECURE_AUTH_SALT']);
define('LOGGED_IN_SALT', $_ENV['LOGGED_IN_SALT']);
define('NONCE_SALT', $_ENV['NONCE_SALT']);
/**#@-*/
/** A couple extra tweaks to help things run well on Pantheon. **/
if (isset($_SERVER['HTTP_HOST'])) {
// HTTP is still the default scheme for now.
$scheme = 'http';
// If we have detected that the end use is HTTPS, make sure we pass that
// through here, so <img> tags and the like don't generate mixed-mode
// content warnings.
if (isset($_SERVER['HTTP_USER_AGENT_HTTPS']) && $_SERVER['HTTP_USER_AGENT_HTTPS'] == 'ON') {
$scheme = 'https';
$_SERVER['HTTPS'] = 'on';
}
define('WP_HOME', $scheme . '://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', $scheme . '://' . $_SERVER['HTTP_HOST']);
}
// Don't show deprecations; useful under PHP 5.5
error_reporting(E_ALL ^ E_DEPRECATED);
/** Define appropriate location for default tmp directory on Pantheon */
define('WP_TEMP_DIR', $_SERVER['HOME'] .'/tmp');
// FS writes aren't permitted in test or live, so we should let WordPress know to disable relevant UI
if (in_array($_ENV['PANTHEON_ENVIRONMENT'], array( 'test', 'live' )) && ! defined('DISALLOW_FILE_MODS')) {
define('DISALLOW_FILE_MODS', true);
}
/**
* Set WP_ENVIRONMENT_TYPE according to the Pantheon Environment
*/
if (getenv('WP_ENVIRONMENT_TYPE') === false) {
switch ($_ENV['PANTHEON_ENVIRONMENT']) {
case 'live':
putenv('WP_ENVIRONMENT_TYPE=production');
break;
case 'test':
putenv('WP_ENVIRONMENT_TYPE=staging');
break;
default:
putenv('WP_ENVIRONMENT_TYPE=development');
break;
}
}

+ 0
- 90
wp-config-sample.php View File

@ -1,90 +0,0 @@
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://wordpress.org/support/article/editing-wp-config-php/
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://wordpress.org/support/article/debugging-in-wordpress/
*/
define( 'WP_DEBUG', false );
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

+ 0
- 86
wp-config.php View File

@ -1,86 +0,0 @@
<?php
/**
* This config file is yours to hack on. It will work out of the box on Pantheon
* but you may find there are a lot of neat tricks to be used here.
*
* See our documentation for more details:
*
* https://pantheon.io/docs
*/
/**
* Pantheon platform settings. Everything you need should already be set.
*/
if (file_exists(dirname(__FILE__) . '/wp-config-pantheon.php') && isset($_ENV['PANTHEON_ENVIRONMENT'])) {
require_once(dirname(__FILE__) . '/wp-config-pantheon.php');
/**
* Local configuration information.
*
* If you are working in a local/desktop development environment and want to
* keep your config separate, we recommend using a 'wp-config-local.php' file,
* which you should also make sure you .gitignore.
*/
} elseif (file_exists(dirname(__FILE__) . '/wp-config-local.php') && !isset($_ENV['PANTHEON_ENVIRONMENT'])){
# IMPORTANT: ensure your local config does not include wp-settings.php
require_once(dirname(__FILE__) . '/wp-config-local.php');
/**
* This block will be executed if you are NOT running on Pantheon and have NO
* wp-config-local.php. Insert alternate config here if necessary.
*
* If you are only running on Pantheon, you can ignore this block.
*/
} else {
define('DB_NAME', 'database_name');
define('DB_USER', 'database_username');
define('DB_PASSWORD', 'database_password');
define('DB_HOST', 'database_host');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
}
/** Standard wp-config.php stuff from here on down. **/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* You may want to examine $_ENV['PANTHEON_ENVIRONMENT'] to set this to be
* "true" in dev, but false in test and live.
*/
if ( ! defined( 'WP_DEBUG' ) ) {
define('WP_DEBUG', false);
}
/* That's all, stop editing! Happy Pressing. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

+ 0
- 0
wp-content/mu-plugins/.gitkeep View File


+ 0
- 22
wp-content/mu-plugins/pantheon.php View File

@ -1,22 +0,0 @@
<?php
/**
* Plugin Name: Pantheon
* Plugin URI: https://pantheon.io/
* Description: Building on Pantheon's and WordPress's strengths, together.
* Version: 0.1
* Author: Pantheon
* Author URI: https://pantheon.io/
*
* @package pantheon
*/
if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) {
require_once 'pantheon/pantheon-page-cache.php';
if ( ! defined( 'DISABLE_PANTHEON_UPDATE_NOTICES' ) || ! DISABLE_PANTHEON_UPDATE_NOTICES ) {
require_once 'pantheon/pantheon-updates.php';
}
if ( ! defined('RETURN_TO_PANTHEON_BUTTON') || RETURN_TO_PANTHEON_BUTTON ) {
require_once 'pantheon/pantheon-login-form-mods.php';
}
} // Ensuring that this is on Pantheon.

+ 0
- 16
wp-content/mu-plugins/pantheon/.editorconfig View File

@ -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

+ 0
- 12
wp-content/mu-plugins/pantheon/README.md View File

@ -1,12 +0,0 @@
Pantheon Plugin
=================
Building on Pantheon's and WordPress's strengths, together.
Workflow
--------
Integrates WordPress with Pantheon Flow. Encourages updating plugins and themes in the Development environment and using Pantheon's git-based upstream core updates.
Edge Cache
-----------
Facilitates communication between Pantheon's Edge Cache layer and WordPress. It allows you to set the default cache age, clear individual pages on demand, and it will automatically clear relevant urls when the site is updated. Authored by [Matthew Boynes](http://www.alleyinteractive.com/).

+ 0
- 63
wp-content/mu-plugins/pantheon/assets/css/return-to-pantheon-button.css View File

@ -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;
}
}

+ 0
- 17
wp-content/mu-plugins/pantheon/assets/images/pantheon-fist-icon-black.svg View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="32px" viewBox="0 0 14 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>Group 11</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="WP---button" transform="translate(-322.000000, -538.000000)" fill="#333333">
<g id="Group" transform="translate(311.000000, 534.000000)">
<g id="Group-11" transform="translate(11.000000, 4.000000)">
<path d="M1.54822908,0 L4.52272957,6.90999702 L0.736842105,6.90999702 L1.98837032,9.82347541 L9.66224514,9.82347541 L1.54822908,0 L1.54822908,0 Z M11.589856,24.7575559 L10.3368651,21.8425037 L8.57849426,21.8425037 L8.54163298,21.7553741 L6.11083637,16.1102593 L4.6957728,16.1102593 L7.16386951,21.8425037 L2.66269769,21.8425037 L10.7780302,31.6679821 L7.80265209,24.7575559 L11.589856,24.7575559 L11.589856,24.7575559 Z" id="Fill-1"></path>
<path d="M6.3944081,15.35938 L5.16291955,12.493687 L4.54724842,12.493687 L5.77976089,15.3559463 L3.74741716,15.3559463 L6.2165378,21.0911952 L1.18058487,21.0911952 C0.756241333,21.0911952 0.522640287,21.0911952 0.330873868,20.4898718 C0.102099894,19.7718033 0,18.2748614 0,15.6365067 C0,12.9982951 0.102099894,11.5016393 0.330873868,10.7831416 C0.522640287,10.1818182 0.756241333,10.1818182 1.18058487,10.1818182 L6.73391219,10.1818182 L8.96270314,15.35938 L6.3944081,15.35938 Z M12.6233793,18.7798987 C12.7164101,18.7798987 12.9331895,18.892924 12.9331895,19.9363338 C12.9331895,20.9791714 12.7164101,21.0911952 12.6233793,21.0911952 L8.86294364,21.0911952 L7.86842046,18.7798987 L12.6233793,18.7798987 Z M12.6233793,12.493687 L8.3441065,12.493687 L7.34958333,10.1818182 L12.6233793,10.1818182 C12.7164101,10.1818182 12.9331895,10.2944143 12.9331895,11.3369657 C12.9331895,12.3800894 12.7164101,12.493687 12.6233793,12.493687 Z M13.063228,15.9142057 C13.1571364,15.9142057 13.3739159,16.0268018 13.3739159,17.0699255 C13.3739159,18.1130492 13.1571364,18.225073 13.063228,18.225073 L7.6291147,18.225073 L6.63415269,15.9142057 L13.063228,15.9142057 Z M13.063228,13.0485127 C13.1571364,13.0485127 13.3739159,13.1601073 13.3739159,14.2036602 C13.3739159,15.2463547 13.1571364,15.35938 13.063228,15.35938 L9.57837427,15.35938 L8.58297345,13.0485127 L13.063228,13.0485127 Z" id="Path"></path>
</g>
</g>
</g>
</g>
</svg>

+ 0
- 8
wp-content/mu-plugins/pantheon/assets/js/return-to-pantheon-button.js View File

@ -1,8 +0,0 @@
jQuery(document).ready(function( $ ) {
$('#return-to-pantheon')
.detach()
.prependTo('#loginform')
.show();
});

+ 0
- 72
wp-content/mu-plugins/pantheon/pantheon-login-form-mods.php View File

@ -1,72 +0,0 @@
<?php
/**
* Modify the WordPress login form for Pantheon
*/
/**
* Should we proceed with adding the return to Pantheon button?
*
* Only if we are on a Pantheon subdomain
*/
$show_return_to_pantheon_button = apply_filters( 'show_return_to_pantheon_button', (
(
false !== stripos( get_site_url(), 'pantheonsite.io') ||
( isset( $_SERVER['HTTP_HOST'] ) && false !== stripos( $_SERVER['HTTP_HOST'], 'pantheonsite.io') )
)
) );
if( $show_return_to_pantheon_button ){
/**
* Enqueue Pantheon login styles
*
* @return void
*/
function Pantheon_Enqueue_Login_style()
{
wp_enqueue_style('pantheon-login-mods', plugin_dir_url(__FILE__) . 'assets/css/return-to-pantheon-button.css', false);
}
add_action('login_enqueue_scripts', 'Pantheon_Enqueue_Login_style', 10);
/**
* Enqueue Pantheon login scripts
*
* @return void
*/
function Pantheon_Enqueue_Login_script()
{
wp_enqueue_script('pantheon-login-mods', plugin_dir_url(__FILE__) . 'assets/js/return-to-pantheon-button.js', array('jquery'), false, true);
}
add_action('login_enqueue_scripts', 'Pantheon_Enqueue_Login_script', 1);
/**
* Print return to Pantheon link HTML
*
* @return void
*/
function Return_To_Pantheon_Button_HTML()
{
$pantheon_dashboard_url = 'https://dashboard.pantheon.io/sites/' . $_ENV['PANTHEON_SITE'] . '#' . $_ENV['PANTHEON_ENVIRONMENT'];
$pantheon_fist_icon_url = plugin_dir_url(__FILE__) . 'assets/images/pantheon-fist-icon-black.svg';
$login_message = apply_filters( 'pantheon_wp_login_text', __('Login to your WordPress Site', 'pantheon') );
?>
<div id="return-to-pantheon" style="display: none;">
<div class="left">
<?php echo $login_message; ?>
</div>
<div class="right">
<a href="<?php echo esc_url( $pantheon_dashboard_url ); ?>">
<img class="fist-icon" src="<?php echo esc_url( $pantheon_fist_icon_url ); ?>">
<?php _e('Return to Pantheon', 'pantheon'); ?>
</a>
</div>
</div>
<?php
}
add_action('login_header', 'Return_To_Pantheon_Button_HTML', 10);
}

+ 0
- 479
wp-content/mu-plugins/pantheon/pantheon-page-cache.php View File

@ -1,479 +0,0 @@
<?php
/* This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
class Pantheon_Cache {
/**
* Define the capability required to see and modify the settings page.
*
* @var string
*/
public $options_capability = 'manage_options';
/**
* Define the default options, which are overridden by what's in wp_options.
*
* @var array
*/
public $default_options = array();
/**
* Stores the options for this plugin (from wp_options).
*
* @var array
*/
public $options = array();
/**
* Store the Paths to be flushed at shutdown.
*
* @var array
*/
public $paths = array();
/**
* The slug for the plugin, used in various places like the options page.
*/
const SLUG = 'pantheon-cache';
/**
* Holds the singleton instance.
*
* @static
* @var object
*/
protected static $instance;
/**
* Get a reference to the singleton.
*
* @return object The singleton instance.
*/
public static function instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new Pantheon_Cache;
self::$instance->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, array() );
$this->default_options = array(
'default_ttl' => 600
);
$this->options = wp_parse_args( $this->options, $this->default_options );
add_action( 'admin_init', array( $this, 'action_admin_init' ) );
add_action( 'admin_menu', array( $this, 'action_admin_menu' ) );
add_action( 'load-plugin-install.php', array( $this, 'action_load_plugin_install' ) );
add_action( 'admin_post_pantheon_cache_flush_site', array( $this, 'flush_site' ) );
if ( ! is_admin() && ! is_user_logged_in() ) {
add_action( 'send_headers', array( $this, 'cache_add_headers' ) );
}
else {
add_action( 'send_headers', array( $this, 'no_cache_add_headers' ) );
}
add_filter( 'rest_post_dispatch', array( $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', array( $this, 'cache_clean_urls' ), 999 );
}
/**
* Prep the Settings API.
*
* @return void
*/
public function action_admin_init() {
register_setting( self::SLUG, self::SLUG, array( self::$instance, 'sanitize_options' ) );
add_settings_section( 'general', false, '__return_false', self::SLUG );
add_settings_field( 'default_ttl', null, array( self::$instance, 'default_ttl_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, array( 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', array( $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() {
?>
<script>
jQuery(document).ready(function(){
// Wait until the click event handler is bound by core JavaScript
setTimeout(function(){
jQuery('.plugin-card-pantheon-advanced-page-cache a.open-plugin-details-modal').trigger('click');
}, 1 )
});
</script>
<?php
}
/**
* Add the HTML for the default TTL field.
*
* @return void
*/
public function default_ttl_field() {
echo '<p>' . __( 'Maximum time a cached page will be served. A higher TTL typically improves site performance.', 'pantheon-cache' ) . '</p>';
echo '<input type="text" name="' . self::SLUG . '[default_ttl]" value="' . $this->options['default_ttl'] . '" size="5" /> ' . __( 'seconds', 'pantheon-cache' );
}
/**
* Sanitize our options.
*