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

Issues/1617 #1622

Merged
merged 25 commits into from
Apr 18, 2017
Merged

Issues/1617 #1622

merged 25 commits into from
Apr 18, 2017

Conversation

ravinderk
Copy link
Collaborator

Description

This Pr will fix #1617

Types of changes

Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@ravinderk
Copy link
Collaborator Author

@DevinWalker Few point from this PR:

  1. I added Give_Cache class, in which I am using an option to store values with expiration timestamps.

  2. I added automatic upgrades to remove existing caches values
    for ref: https://github.com/WordImpress/Give/pull/1622/files#diff-fe0e36d5cf90056ccea283fd3c6daa71

  3. Implemented for stat and logging.
    for ref: https://github.com/WordImpress/Give/pull/1622/files#diff-30e950f974f511ffad88200faff49510

  4. Tests added
    for ref: https://github.com/WordImpress/Give/pull/1622/files#diff-6e761737f75590676e65a85f90ebd6d8

Question: There are still lot of transients we are using in our code, they are around 20. Can I update them all?

*/
$cached_options = $wpdb->get_col(
$wpdb->prepare(
"SELECT * FROM {$wpdb->options} where (option_name LIKE '%%%s%%' OR option_name LIKE '%%%s%%')",
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this also check if the transient is expired?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@DevinWalker I designed different model on how cached value store in DB with a timestamp and I am removing all cache without checking expiration to upgrade every cache value.
For Ref: https://github.com/WordImpress/Give/pull/1622/files/f9af10b7a180d8e7e79dad82c5d4882a29ddf30b#diff-338475964ff644868092ed67b2a5cb0eR149

@DevinWalker
Copy link
Member

@ravinderk yes, please update all transients to use the new class.

Copy link
Member

@DevinWalker DevinWalker left a comment

Choose a reason for hiding this comment

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

Please update all transient usage throughout Give core to use new caching class. :)

@DevinWalker DevinWalker merged commit 53e3058 into impress-org:release/1.8.7 Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants