-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into CANTINA-852
- Loading branch information
Showing
4,689 changed files
with
775,873 additions
and
101,114 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: CodeQL Config | ||
|
||
paths: | ||
- search/search-dev-tools/src/ | ||
|
||
paths-ignore: | ||
- node_modules | ||
|
||
queries: | ||
- uses: security-and-quality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: CodeQL Analysis | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- "search/search-dev-tools/src/**.js" | ||
- ".github/workflows/codeql-analysis.yml" | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- "search/search-dev-tools/src/**.js" | ||
- ".github/workflows/codeql-analysis.yml" | ||
schedule: | ||
- cron: '24 2 * * 6' | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
jobs: | ||
analyze: | ||
name: Static Code Analysis with CodeQL | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: | ||
- javascript | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@a3a6c128d771b6b9bdebb1c9d0583ebd2728a108 # tag=v2.1.11 | ||
with: | ||
languages: ${{ matrix.language }} | ||
config-file: ./.github/codeql-config.yml | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@a3a6c128d771b6b9bdebb1c9d0583ebd2728a108 # tag=v2.1.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Dependency Review | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
dependency-review: | ||
runs-on: ubuntu-latest | ||
name: Review Dependencies | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@248ae51c2e8cc9622ecf50685c8bf7150c6e8813 # tag=v1.4.3 | ||
with: | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
- name: Check out the source code | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 | ||
|
||
- name: Review dependencies | ||
uses: actions/dependency-review-action@a9c83d3af6b9031e20feba03b904645bb23d1dab # tag=v1.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
*/ | ||
|
||
use Automattic\VIP\Utils\Context; | ||
use Automattic\VIP\Utils\WPComVIP_Restrictions; | ||
|
||
/** | ||
* By virtue of the filename, this file is included first of | ||
|
@@ -22,6 +23,10 @@ | |
exit(); | ||
} | ||
|
||
if ( file_exists( __DIR__ . '/healthcheck/healthcheck.php' ) ) { | ||
require_once __DIR__ . '/healthcheck/healthcheck.php'; | ||
} | ||
|
||
// Execute the healthcheck as quickly as possible | ||
if ( isset( $_SERVER['REQUEST_URI'] ) && '/cache-healthcheck?' === $_SERVER['REQUEST_URI'] ) { | ||
if ( function_exists( 'newrelic_end_transaction' ) ) { | ||
|
@@ -127,13 +132,15 @@ | |
defined( 'WPCOM_VIP_MACHINE_USER_EMAIL' ) || define( 'WPCOM_VIP_MACHINE_USER_EMAIL', '[email protected]' ); | ||
defined( 'WPCOM_VIP_MACHINE_USER_ROLE' ) || define( 'WPCOM_VIP_MACHINE_USER_ROLE', 'administrator' ); | ||
|
||
add_action( 'set_current_user', function() { | ||
$user = get_user_by( 'login', WPCOM_VIP_MACHINE_USER_LOGIN ); | ||
if ( ! defined( 'WP_INSTALLING' ) || ! WP_INSTALLING ) { | ||
add_action( 'set_current_user', function() { | ||
$user = get_user_by( 'login', WPCOM_VIP_MACHINE_USER_LOGIN ); | ||
|
||
if ( $user && $user->ID ) { | ||
defined( 'WPCOM_VIP_MACHINE_USER_ID' ) || define( 'WPCOM_VIP_MACHINE_USER_ID', $user->ID ); | ||
} | ||
}, PHP_INT_MIN ); | ||
if ( $user && $user->ID ) { | ||
defined( 'WPCOM_VIP_MACHINE_USER_ID' ) || define( 'WPCOM_VIP_MACHINE_USER_ID', $user->ID ); | ||
} | ||
}, PHP_INT_MIN ); | ||
} | ||
|
||
// Support a limited number of additional "Internal Events" in Cron Control. | ||
// These events run regardless of the number of pending events, and they cannot be deleted. | ||
|
@@ -191,6 +198,9 @@ | |
require_once __DIR__ . '/vip-helpers/vip-syndication-cache.php'; | ||
require_once __DIR__ . '/vip-helpers/vip-migrations.php'; | ||
require_once __DIR__ . '/vip-helpers/class-user-cleanup.php'; | ||
require_once __DIR__ . '/vip-helpers/class-wpcomvip-restrictions.php'; | ||
|
||
add_action( 'init', [ WPComVIP_Restrictions::class, 'instance' ] ); | ||
|
||
//enabled on selected sites for now | ||
if ( true === defined( 'WPCOM_VIP_CLEAN_TERM_CACHE' ) && true === constant( 'WPCOM_VIP_CLEAN_TERM_CACHE' ) ) { | ||
|
@@ -228,11 +238,6 @@ | |
} | ||
|
||
define( 'WP_ENVIRONMENT_TYPE', $environment_type ); | ||
|
||
// VIP sites should not be set as staging in Jetpack | ||
// since it breaks SSO and prevents data from being passed to | ||
// WordPress.com | ||
add_filter( 'jetpack_is_staging_site', '__return_false' ); | ||
} | ||
|
||
// Load config related helpers | ||
|
@@ -263,9 +268,11 @@ | |
return $headers; | ||
} ); | ||
|
||
// Disable core sitemaps | ||
// | ||
// https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/ | ||
add_filter( 'wp_sitemaps_enabled', '__return_false' ); | ||
if ( ! defined( 'WP_RUN_CORE_TESTS' ) || ! WP_RUN_CORE_TESTS ) { | ||
// Disable core sitemaps | ||
// | ||
// https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/ | ||
add_filter( 'wp_sitemaps_enabled', '__return_false' ); | ||
} | ||
|
||
do_action( 'vip_loaded' ); |
Oops, something went wrong.