Skip to content

PTK: Log warning once per day#53665

Merged
tjcafferkey merged 2 commits intotrunkfrom
update/ptk-warning-log-once-a-day
Dec 13, 2024
Merged

PTK: Log warning once per day#53665
tjcafferkey merged 2 commits intotrunkfrom
update/ptk-warning-log-once-a-day

Conversation

@tjcafferkey
Copy link
Copy Markdown
Contributor

@tjcafferkey tjcafferkey commented Dec 12, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

Some users are experiencing their sites log file being spammed with warnings from the PTK log warnings. This PR introduces a change which sets a transient to track that the warning log only happens once per day.

https://wordpress.org/support/topic/ptk-pattern-store/page/4/

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Enable tracking in your WooCommerce settings (/wp-admin/admin.php?page=wc-settings&tab=advanced&section=woocommerce_com)
  2. Delete transient ptk_patterns transient. You can do so via the Transient Manager plugin.
  3. Load your homepage
  4. Check that the log is not present in your log file
  5. Force your log to happen by setting $patterns = array() OR by deleting the transient wc_ptk_pattern_store_warning and canceling the scheduled action fetch_patterns
  6. Load your homepage multiple times. Ensure that the transient wc_ptk_pattern_store_warning exists and that only 1 warning is in your log file

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Changelog Entry Comment

Comment

@tjcafferkey tjcafferkey added Enhancement The issue is a request for an enhancement. plugin: woocommerce Issues related to the WooCommerce Core plugin. focus: patterns labels Dec 12, 2024
@tjcafferkey tjcafferkey self-assigned this Dec 12, 2024
@tjcafferkey tjcafferkey marked this pull request as ready for review December 12, 2024 14:19
@tjcafferkey tjcafferkey requested a review from gigitux December 12, 2024 14:20
@woocommercebot woocommercebot requested a review from a team December 12, 2024 14:20
@github-actions
Copy link
Copy Markdown
Contributor

Hi @gigitux, @woocommerce/woo-fse

Apart from reviewing the code changes, please make sure to review the testing instructions and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@github-actions
Copy link
Copy Markdown
Contributor

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

Copy link
Copy Markdown
Contributor

@gigitux gigitux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
In the testing instruction, I would mention that after removing the transients, it is necessarily to cancel the fetch_patterns scheduled action to trigger the log of the error.

@tjcafferkey tjcafferkey merged commit e5a8658 into trunk Dec 13, 2024
@tjcafferkey tjcafferkey deleted the update/ptk-warning-log-once-a-day branch December 13, 2024 08:52
@github-actions github-actions bot added this to the 9.6.0 milestone Dec 13, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Dec 13, 2024
@nigeljamesstevenson nigeljamesstevenson added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Dec 18, 2024
PavloBorysenko pushed a commit to PavloBorysenko/woocommerce that referenced this pull request Jan 3, 2025
* Set a transient to track the logger so it only logs once-per-day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement The issue is a request for an enhancement. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants