PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.3.9
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.3.9
0.5.7 0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 All 33 releases
← All changes | common/news.php +5 -2 0.3.40.3.9 View file →
@@ -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 ) ) {