PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.4.2
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.4.2
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 +7 -4 0.3.30.4.2 View file →
@@ -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 ) ) {