• Resolved Nicola Modugno

    (@shark986)


    Hello,

    I added a simple custom code to Basel theme to show a notification to the user when his review is pending for approval, but using Safari on desktop or Safari/Chrome on mobile the notification is not shown.

    If I try to leave a review with the Safari web inspector opened the notification is shown, so it seems to me that the problem is cache-related.

    The production site is under quic.cloud CDN so I have tried to add reviews on the staging site, without the CDN, and the notifications appear in all conditions.

    I also tried to add the parameters “unapproved” and “moderation-hash” (from WooCommerce) to the “Do Not Cache Query Strings” option in Cache > Excludes with no luck.

    Could someone help with this kind of problem?

    The report num from the LS cache plugin is WKTIPMYW, and the following is the code for the notification:

    
    \add_action( 'comment_post', __NAMESPACE__ . '\add_unapproved_notice', 10, 1 );
    function add_unapproved_notice( $comment_id ) : void {
        $comment = \get_comment( $comment_id );
        if ( $comment && !(bool)$comment->comment_approved ) {
            \wc_add_notice( \esc_html__( 'unapproved text', 'textdomain' ), 'success' );
        }
    }
    

    Thanks ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support qtwrk

    (@qtwrk)

    try disable object cache ?

    Thread Starter Nicola Modugno

    (@shark986)

    Thank you qtwkr for your answer.

    The server shares the same configuration between production and staging site: the object cache (via Redis) is enabled in all sites, but only in the staging site the notifications appear correctly.

    Plugin Support qtwrk

    (@qtwrk)

    hmmm? any other difference between stage/prod ?

    Thread Starter Nicola Modugno

    (@shark986)

    @qtwrk excuse me for the delay.

    No other differences between staging/production site. They run on the same site, under the same virtual host.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom WooCommerce notices not shown on Safari with quic.cloud CDN’ is closed to new replies.