Skip to content

Commit

Permalink
Name change.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauteri committed Oct 4, 2024
1 parent b47a6ca commit aa69812
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gatherpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore

// Constants.
define( 'GATHERPRESS_CACHE', 'gatherpress_cache' );
define( 'GATHERPRESS_CACHE_GROUP', 'gatherpress_cache' );
define( 'GATHERPRESS_CORE_FILE', __FILE__ );
define( 'GATHERPRESS_CORE_PATH', __DIR__ );
define( 'GATHERPRESS_CORE_URL', plugin_dir_url( __FILE__ ) );
Expand Down
6 changes: 3 additions & 3 deletions includes/core/classes/class-rsvp.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function save( int $user_id, string $status, int $anonymous = 0, int $gue
'anonymous' => intval( $anonymous ),
);

wp_cache_delete( sprintf( self::CACHE_KEY, $post_id ), GATHERPRESS_CACHE );
wp_cache_delete( sprintf( self::CACHE_KEY, $post_id ), GATHERPRESS_CACHE_GROUP );

Check failure on line 280 in includes/core/classes/class-rsvp.php

View workflow job for this annotation

GitHub Actions / PHPStan for WordPress

Constant GATHERPRESS_CACHE_GROUP not found.

if ( ! $limit_reached ) {
$this->check_waiting_list();
Expand Down Expand Up @@ -383,7 +383,7 @@ public function attending_limit_reached( array $current_response, int $guests =
public function responses(): array {
$post_id = $this->event->ID;
$cache_key = sprintf( self::CACHE_KEY, $post_id );
$retval = wp_cache_get( $cache_key, GATHERPRESS_CACHE );
$retval = wp_cache_get( $cache_key, GATHERPRESS_CACHE_GROUP );

Check failure on line 386 in includes/core/classes/class-rsvp.php

View workflow job for this annotation

GitHub Actions / PHPStan for WordPress

Constant GATHERPRESS_CACHE_GROUP not found.
$rsvp_query = Rsvp_Query::get_instance();

// @todo add testing with cache.
Expand Down Expand Up @@ -496,7 +496,7 @@ static function ( $response ) use ( $status ) {
$retval[ $status ]['count'] = count( $retval[ $status ]['responses'] ) + $guests;
}

wp_cache_set( $cache_key, $retval, GATHERPRESS_CACHE, 15 * MINUTE_IN_SECONDS );
wp_cache_set( $cache_key, $retval, GATHERPRESS_CACHE_GROUP, 15 * MINUTE_IN_SECONDS );

Check failure on line 499 in includes/core/classes/class-rsvp.php

View workflow job for this annotation

GitHub Actions / PHPStan for WordPress

Constant GATHERPRESS_CACHE_GROUP not found.

return $retval;
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/php/includes/core/classes/class-test-rsvp.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function test_responses(): void {
wp_delete_user( $user_id_2 );

// User will remain while cached until it expires.
wp_cache_delete( sprintf( Rsvp::CACHE_KEY, $post->ID ), GATHERPRESS_CACHE );
wp_cache_delete( sprintf( Rsvp::CACHE_KEY, $post->ID ), GATHERPRESS_CACHE_GROUP );

$responses = $rsvp->responses();

Expand Down

0 comments on commit aa69812

Please sign in to comment.