diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index c89bd9cff1..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -**Before submitting an issue please check that you’ve completed the following steps:** -- Made sure you’re on the latest version -- Used the search feature to ensure that the bug hasn’t been reported before - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Additional context** -Add any other context about the problem here. - -**Backlog Grooming (for WP Media dev team use only)** -- [ ] Reproduce the problem -- [ ] Identify the root cause -- [ ] Scope a solution -- [ ] Estimate the effort diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 066b2d920a..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 81a73aac95..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,39 +0,0 @@ -## Description - -Please include a summary of the change and which issue is fixed/closed. Please also include relevant motivation and context. List any dependencies that are required for this change. - -Fixes #(issue number) - -## Type of change - -Please delete options that are not relevant. - -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] Enhancement (non-breaking change which improves an existing functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] This change requires a documentation update - -## Is the solution different from the one proposed during the grooming? - -Please describe in this section if there is any change to the solution, and why. - -## How Has This Been Tested? - -Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - -- [ ] Test A -- [ ] Test B - -# Checklist: - -Please delete the options that are not relevant. - -- [ ] My code follows the style guidelines of this project -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] New and existing unit tests pass locally with my changes -- [ ] Any dependent changes have been merged and published in downstream modules diff --git a/README.md b/README.md index f82eebf460..4a2e155af6 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Check out our [support page](https://wp-rocket.me/support/?utm_source=github&utm ### Reporting Security Bugs -Please report security bugs found in the site-reviews plugin's source code through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/wp-rocket). The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin. +You can report any security bugs found in the source code of the site-reviews plugin through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/wp-rocket). The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin. ## Contributions diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..5abc080ecb --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,6 @@ +# Security Policy + +## Reporting Security Bugs + +Please report security bugs found in the site-reviews plugin's source code through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/wp-rocket). The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin. +--- \ No newline at end of file diff --git a/inc/Engine/Admin/DomainChange/Subscriber.php b/inc/Engine/Admin/DomainChange/Subscriber.php index 908f873447..2f5cfdcc5e 100644 --- a/inc/Engine/Admin/DomainChange/Subscriber.php +++ b/inc/Engine/Admin/DomainChange/Subscriber.php @@ -66,21 +66,20 @@ public function maybe_launch_domain_changed() { return; } - $base_url = trailingslashit( home_url() ); - $base_url_encoded = base64_encode( $base_url ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + $base_url = trailingslashit( get_option( 'home' ) ); + $base_url_encoded = base64_encode( $base_url ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + $last_base_url_encoded = get_option( self::LAST_BASE_URL_OPTION ); - if ( ! get_option( self::LAST_BASE_URL_OPTION ) ) { - update_option( self::LAST_BASE_URL_OPTION, $base_url_encoded ); + if ( ! $last_base_url_encoded ) { + update_option( self::LAST_BASE_URL_OPTION, $base_url_encoded, true ); return; } - $last_base_url_encoded = get_option( self::LAST_BASE_URL_OPTION ); - if ( $base_url_encoded === $last_base_url_encoded ) { return; } - update_option( self::LAST_BASE_URL_OPTION, $base_url_encoded ); + update_option( self::LAST_BASE_URL_OPTION, $base_url_encoded, true ); $last_base_url = base64_decode( $last_base_url_encoded ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode @@ -194,7 +193,7 @@ public function regenerate_configuration() { } $last_base_url = base64_decode( $last_base_url_encoded ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode - $base_url = trailingslashit( home_url() ); + $base_url = trailingslashit( get_option( 'home' ) ); /** * Fires when the domain of the website has been changed and user clicked on notice. diff --git a/tests/Unit/inc/Engine/Admin/DomainChange/Subscriber/maybeLaunchDomainChanged.php b/tests/Unit/inc/Engine/Admin/DomainChange/Subscriber/maybeLaunchDomainChanged.php index 48341bb75c..563cb947e3 100644 --- a/tests/Unit/inc/Engine/Admin/DomainChange/Subscriber/maybeLaunchDomainChanged.php +++ b/tests/Unit/inc/Engine/Admin/DomainChange/Subscriber/maybeLaunchDomainChanged.php @@ -38,11 +38,18 @@ protected function set_up() public function testShouldDoAsExpected($config, $expected) { Functions\when('trailingslashit')->returnArg(); Functions\when('rocket_get_constant')->returnArg(2); - Functions\expect('home_url')->andReturn($config['base_url']); - Functions\expect('get_option')->with(Subscriber::LAST_BASE_URL_OPTION)->andReturn($config['last_base_url']); + Functions\expect('get_option')->andReturnUsing(function( $option ) use ( $config ) { + switch ( $option ) { + case Subscriber::LAST_BASE_URL_OPTION: + return $config['last_base_url']; + + case 'home': + return $config['base_url']; + } + }); if(!$config['ajax_request'] && ($config['is_base_url_different'] || ! $config['base_url_exist'])) { - Functions\expect('update_option')->with(Subscriber::LAST_BASE_URL_OPTION, $expected['encrypted_old_url']); + Functions\expect('update_option')->with(Subscriber::LAST_BASE_URL_OPTION, $expected['encrypted_old_url'], true); } Functions\expect('wp_doing_ajax')->once()->andReturn( $config['ajax_request'] ); diff --git a/tests/Unit/inc/Engine/Admin/DomainChange/Subscriber/regenerateConfiguration.php b/tests/Unit/inc/Engine/Admin/DomainChange/Subscriber/regenerateConfiguration.php index f082e4038f..dcb128f906 100644 --- a/tests/Unit/inc/Engine/Admin/DomainChange/Subscriber/regenerateConfiguration.php +++ b/tests/Unit/inc/Engine/Admin/DomainChange/Subscriber/regenerateConfiguration.php @@ -43,7 +43,7 @@ public function set_up() { */ public function testShouldDoAsExpected( $config, $expected ) { - Functions\when('home_url')->justReturn($config['home_url']); + Functions\expect('get_option')->with('home')->andReturn($config['home_url']); Functions\when('trailingslashit')->returnArg(); $this->ajax_handler->expects()->validate_referer('rocket_regenerate_configuration', 'rocket_manage_options')->andReturn($config['is_validated']); diff --git a/wp-rocket.php b/wp-rocket.php index f3f2c13391..3a4ac86f73 100755 --- a/wp-rocket.php +++ b/wp-rocket.php @@ -3,7 +3,7 @@ * Plugin Name: WP Rocket * Plugin URI: https://wp-rocket.me * Description: The best WordPress performance plugin. - * Version: 3.14.4.1 + * Version: 3.14.4.2 * Requires at least: 5.8 * Requires PHP: 7.3 * Code Name: Iego @@ -20,7 +20,7 @@ defined( 'ABSPATH' ) || exit; // Rocket defines. -define( 'WP_ROCKET_VERSION', '3.14.4.1' ); +define( 'WP_ROCKET_VERSION', '3.14.4.2' ); define( 'WP_ROCKET_WP_VERSION', '5.8' ); define( 'WP_ROCKET_WP_VERSION_TESTED', '6.3' ); define( 'WP_ROCKET_PHP_VERSION', '7.3' );