wp-parsely icon indicating copy to clipboard operation
wp-parsely copied to clipboard

Audit value types passed to wp_cache_set()

Open acicovic opened this issue 7 months ago • 0 comments

We might be too permissive regarding the values we store in cache.

For example, $post_id here could be int|\WP_Error, but we're storing it even if it is a WP_Error. In another couple of places in the same file, we're storing a value that's \WP_Post[]|int[] (which might be desired though).

In conclusion, we should audit all uses of wp_cache_set() in order to see if extra handling or type checking is needed.

acicovic avatar May 27 '25 09:05 acicovic