Skip to content

False positive: using variable or constant for 4th parameter of wp_cache_set #572

@rebeccahum

Description

@rebeccahum

Bug Description

We should adjust the warning message to manually check for the value if a variable or constant is being used in the 4th parameter of wp_cache_set().

Minimal Code Snippet

define( 'TEST_TIME', 5 * MINUTE_IN_SECONDS );
$time = 5 * MINUTE_IN_SECONDS;

wp_cache_set( $key, $data, '', $time );
wp_cache_set( $key, $data, '', TEST_TIME );

Error Code

WordPressVIPMinimum.Performance.LowExpiryCacheTime.LowCacheTime

Additional Context (optional)

Tested Against master branch?

  • I have verified the issue still exists in the master branch of VIPCS.
  • I have verified the issue still exists in the develop branch of VIPCS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions