| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( !class_exists( 'MeowCommon_News' ) ) { | |
| 3 | +if ( !class_exists( 'MeowKit_MWCODE_News' ) ) { | |
| 4 | 4 | |
| 5 | - class MeowCommon_News { | |
| 5 | + class MeowKit_MWCODE_News { | |
| 6 | 6 | private $domain = null; |
| 7 | 7 | private $topic = null; |
| 8 | 8 | private $fromDate = null; |
| 9 | 9 | private $toDate = null; |
| @@ -20,12 +20,15 @@ | ||
| 20 | 20 | if ( $now < $this->fromDate || $now > $this->toDate ) { |
| 21 | 21 | return; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - if ( isset( $_SESSION['meowapps_news_displayed'] ) ) { | |
| 24 | + // Use transient instead of session for better compatibility | |
| 25 | + $user_id = get_current_user_id(); | |
| 26 | + $transient_key = 'meowapps_news_displayed_' . $user_id; | |
| 27 | + if ( get_transient( $transient_key ) ) { | |
| 25 | 28 | return; |
| 26 | 29 | } |
| 27 | - $_SESSION['meowapps_news_displayed'] = true; | |
| 30 | + set_transient( $transient_key, true, 12 * HOUR_IN_SECONDS ); | |
| 28 | 31 | |
| 29 | 32 | // Other constraint for the news. |
| 30 | 33 | $mwai_options = get_option( 'mwai_options' ); |
| 31 | 34 | if ( !empty( $mwai_options ) ) { |