Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent saving unnecessary Jetpack post_by_email_address* DB options #5311

Merged
merged 6 commits into from
Mar 12, 2024

Conversation

itsTallulah
Copy link
Contributor

Description

This addresses the main symptom (autoloaded post_by_email_address* options being created per-user) of JP issue Automattic/jetpack#35636

Changelog Description

cleaner_jp_pbe_options uses pre_update_option_post_by_email_address* (where * is the current user ID) to prevent creation of unused NULL post_by_email_address* options (by returning the old_value in place of NULL, which in this case is no option at all).

Pre-review checklist

Please make sure the items below have been covered before requesting a review:

  • [ 👍 ] This change works and has been tested locally (or has an appropriate fallback).
  • [ 👍 ] This change works and has been tested on a Go sandbox
  • [ 👍 ] Also tested live in a VIP test env (with this function in a standalone mu-plugin)
  • [ n/a ] This change has relevant unit tests (if applicable).
  • [ n/a ] This change uses a rollout method to ease with deployment (if applicable - especially for large scale actions that require writes).
  • [ n/a ] This change has relevant documentation additions / updates (if applicable).
  • [ 👍 ] I've created a changelog description that aligns with the provided examples.

Pre-deploy checklist

  • [ n/a ] VIP staff: Ensure any alerts added/updated conform to internal standards (see internal documentation).

Steps to Test

  1. Check out PR.
  2. Login and visit the JP setting page in wp-admin, which without this filter would spawn a post_by_email_address option
  3. Do wp option list --search="post_by_email*" --fields=option_name,option_value,autoload
  4. Verify that no new post_by_email_address option has been created for your logged-in user ID
  5. To verify that non-NULL post_by_email_address* options aren't filtered, add this quick snippet to a sandbox and redo steps 2 & 3:
function create_post_by_email_option()
{
    $current_user_id = get_current_user_id();
    $option_name = 'post_by_email_address' . $current_user_id;
    update_option($option_name, 'NOTNULL');
}

add_action('admin_init', 'create_post_by_email_option');

add a pre_update_option_post_by_email_address* to prevent creation of NULL pbe options
@itsTallulah itsTallulah requested a review from a team as a code owner March 6, 2024 16:43
typo in pbe options descrip
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 28.95%. Comparing base (d51ee58) to head (9f9eacd).
Report is 1 commits behind head on develop.

Files Patch % Lines
vip-jetpack/vip-jetpack.php 0.00% 10 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #5311      +/-   ##
=============================================
- Coverage      29.03%   28.95%   -0.09%     
  Complexity      4822     4822              
=============================================
  Files            283      283              
  Lines          20927    20925       -2     
=============================================
- Hits            6077     6059      -18     
- Misses         14850    14866      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WPprodigy WPprodigy changed the title Update vip-jetpack.php Prevent saving unnecessary Jetpack post_by_email_address* DB options Mar 6, 2024
@WPprodigy WPprodigy merged commit a8d25a6 into develop Mar 12, 2024
36 checks passed
@WPprodigy WPprodigy deleted the fix/jp-pbe-options branch March 12, 2024 19:32
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

sjinks added a commit that referenced this pull request Mar 26, 2024
* Jetpack: Make 13.2 default (#5326)

* Prevent saving unnecessary Jetpack post_by_email_address* DB options (#5311)

* chore(deps): Bump actions/checkout from 4.1.1 to 4.1.2 (#5329)

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump softprops/action-gh-release from 2.0.3 to 2.0.4 (#5330)

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@v2.0.3...v2.0.4)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump webpack-dev-server in /search/search-dev-tools (#5328)

Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 5.0.2 to 5.0.3.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](webpack/webpack-dev-server@v5.0.2...v5.0.3)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump @types/node in /__tests__/e2e (#5327)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.25 to 20.11.26.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update wp-parsely submodule to version 3.14.1 (#5334)

* chore(deps-dev): Bump @types/node in /__tests__/e2e (#5332)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.26 to 20.11.27.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump postcss-preset-env from 9.5.0 to 9.5.1 (#5333)

Bumps [postcss-preset-env](https://github.com/csstools/postcss-plugins/tree/HEAD/plugin-packs/postcss-preset-env) from 9.5.0 to 9.5.1.
- [Changelog](https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/CHANGELOG.md)
- [Commits](https://github.com/csstools/postcss-plugins/commits/HEAD/plugin-packs/postcss-preset-env)

---
updated-dependencies:
- dependency-name: postcss-preset-env
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Removes extraneous text from command description. (#5335)

When describing the command with `wp help vipsupport`, an out-of-place text would appear after the command desciption: "Class command".

* chore(deps-dev): Bump sass in /search/search-dev-tools (#5336)

Bumps [sass](https://github.com/sass/dart-sass) from 1.71.1 to 1.72.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.71.1...1.72.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump follow-redirects from 1.15.5 to 1.15.6 (#5338)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump follow-redirects in /search/search-dev-tools (#5337)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update Akismet to 5.3.1 (#5321)

* chore(deps-dev): Bump @types/node in /__tests__/e2e (#5340)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.27 to 20.11.28.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* WP 6.5 Font Library: Filter the font directory to work with the VIP Filesystem (#5265)

Uses the `font_dir` filter to set the font library upload location to the default upload directory.

* chore(deps): Bump preact from 10.19.6 to 10.19.7 in /search/search-dev-tools (#5345)

* chore(deps): Bump preact in /search/search-dev-tools

Bumps [preact](https://github.com/preactjs/preact) from 10.19.6 to 10.19.7.
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](preactjs/preact@10.19.6...10.19.7)

---
updated-dependencies:
- dependency-name: preact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Regenerate the bundle

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: WordPress VIP Bot <[email protected]>

* chore(deps-dev): Bump postcss-preset-env from 9.5.1 to 9.5.2 (#5344)

Bumps [postcss-preset-env](https://github.com/csstools/postcss-plugins/tree/HEAD/plugin-packs/postcss-preset-env) from 9.5.1 to 9.5.2.
- [Changelog](https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/CHANGELOG.md)
- [Commits](https://github.com/csstools/postcss-plugins/commits/HEAD/plugin-packs/postcss-preset-env)

---
updated-dependencies:
- dependency-name: postcss-preset-env
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update wp-parsely submodule to version 3.14.2 (#5346)

* chore(deps-dev): Bump @babel/plugin-syntax-decorators (#5355)

Bumps [@babel/plugin-syntax-decorators](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-decorators) from 7.24.0 to 7.24.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.1/packages/babel-plugin-syntax-decorators)

---
updated-dependencies:
- dependency-name: "@babel/plugin-syntax-decorators"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump @types/node in /__tests__/e2e (#5354)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.28 to 20.11.30.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump @babel/plugin-syntax-decorators in /__tests__/e2e (#5353)

Bumps [@babel/plugin-syntax-decorators](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-decorators) from 7.24.0 to 7.24.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.1/packages/babel-plugin-syntax-decorators)

---
updated-dependencies:
- dependency-name: "@babel/plugin-syntax-decorators"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump @babel/plugin-transform-class-properties (#5348)

Bumps [@babel/plugin-transform-class-properties](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-properties) from 7.23.3 to 7.24.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.1/packages/babel-plugin-transform-class-properties)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-class-properties"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Jetpack: Revert to 13.1 for WP 6.3 (#5361)

* Disable "Invite user to WordPress.com" checkbox temporarily (#5366)

Add Jetpack SSO workaround to allow user creation on VIP

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Rebecca Hum <[email protected]>
Co-authored-by: Tallulah <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Henrique Mouta <[email protected]>
Co-authored-by: Bruno Basto <[email protected]>
Co-authored-by: Brooke <[email protected]>
Co-authored-by: Noah Allen <[email protected]>
Co-authored-by: WordPress VIP Bot <[email protected]>
Co-authored-by: Alex Cicovic <[email protected]>
Co-authored-by: Luiz Tiago Oliveira <[email protected]>
Co-authored-by: Alec Geatches <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants