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

Harden WP eCommerce against APC cache deserialization errors #1835

Closed
wants to merge 21 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@JeffPyeBrook
Contributor

JeffPyeBrook commented Apr 12, 2015

Harden countries class against bad cache based on issues noted on sites using GoDaddy APC caching reported here:

https://wordpress.org/support/topic/fatal-error-wpsc_countries/page/2?replies=38#post-6810134

JeffPyeBrook added some commits Apr 9, 2015

move include of datamap class before country class in an attempt to a…
…void errors such as this:

Fatal error: WPSC_Countries::_dirty(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 1142"

JeffPyeBrook added some commits Apr 12, 2015

wrap get/set transient calls in utility function
serialize/deserialize transient data to stop APC from throwing PHP fatal error on deserialization
Wrap all calls to set/get/delete WordPress transients in a function t…
…o encode and serialize the

data.  Done to work around fatal error on some hosts using APC 3.1.12 or newer that happens when
APC tries to deserialize a transient that contains an array of objects, or objects that contain other objects.

Issue is discussed here:
https://wordpress.org/support/topic/fatal-error-wpsc_countries/page/2?replies=60#post-6819037

@JeffPyeBrook JeffPyeBrook changed the title from Harden countries class against bad cache to Harden WP eCommerce against APC cache deserialization errors Apr 14, 2015

@JeffPyeBrook

This comment has been minimized.

Show comment
Hide comment
@JeffPyeBrook

JeffPyeBrook Apr 14, 2015

Contributor

@JustinSainton can you give this PR a read and a test

Contributor

JeffPyeBrook commented Apr 14, 2015

@JustinSainton can you give this PR a read and a test

@JustinSainton

This comment has been minimized.

Show comment
Hide comment
@JustinSainton

JustinSainton Apr 14, 2015

Member

@JeffPyeBrook Would like to see 273acd1 mostly reverted, aside from the function definitions. Would like to keep this PR as tightly scope and low-touch as possible. We're dealing with an edge case here, and I'd like the PR to solve the reported issue. Trying to solve issues we're not yet having can only lead to pain and suffering.

Member

JustinSainton commented Apr 14, 2015

@JeffPyeBrook Would like to see 273acd1 mostly reverted, aside from the function definitions. Would like to keep this PR as tightly scope and low-touch as possible. We're dealing with an edge case here, and I'd like the PR to solve the reported issue. Trying to solve issues we're not yet having can only lead to pain and suffering.

JeffPyeBrook added some commits Apr 17, 2015

always, unserialize, or the value could return as a improperly base64…
… decoded string, and even cause an infinite loop, crash or other bad stuff when a corrupted transient is returned
break up compound serialization satatements so that stack traces poin…
…t to to the line of an issue if there is a problem
@JustinSainton

This comment has been minimized.

Show comment
Hide comment
@JustinSainton

JustinSainton Apr 21, 2015

Member

@JeffPyeBrook Can you update the PR to reflect my last comment? I'd like to see this land in 4.0. Thanks!

Member

JustinSainton commented Apr 21, 2015

@JeffPyeBrook Can you update the PR to reflect my last comment? I'd like to see this land in 4.0. Thanks!

}
}
return $value;

This comment has been minimized.

@JustinSainton

JustinSainton Apr 23, 2015

Member

Value is not defined for all paths. $encoded_value, maybe?

@JustinSainton

JustinSainton Apr 23, 2015

Member

Value is not defined for all paths. $encoded_value, maybe?

@JustinSainton

This comment has been minimized.

Show comment
Hide comment
@JustinSainton

JustinSainton Apr 27, 2015

Member

haha, what is going on here?

Member

JustinSainton commented Apr 27, 2015

haha, what is going on here?

@JeffPyeBrook

This comment has been minimized.

Show comment
Hide comment
@JeffPyeBrook

JeffPyeBrook Apr 27, 2015

Contributor

change localized in this branch JeffPyeBrook:harden-countries-class-against-bad-cache-redux., this PR is no longer

Contributor

JeffPyeBrook commented Apr 27, 2015

change localized in this branch JeffPyeBrook:harden-countries-class-against-bad-cache-redux., this PR is no longer

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Dec 16, 2016

Coverage Status

Changes Unknown when pulling 428224c on JeffPyeBrook:harden-countries-class-against-bad-cache into ** on wp-e-commerce:master**.

coveralls commented Dec 16, 2016

Coverage Status

Changes Unknown when pulling 428224c on JeffPyeBrook:harden-countries-class-against-bad-cache into ** on wp-e-commerce:master**.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment