Support » Plugin: Site Reviews » issues after updating

  • Resolved adminseekout

    (@adminseekout)


    Hi,

    encounter abit of an error after the latest update.

    1) when i submit a review, it’s redirecting me back to the mainpage. is there a way to keep it to refresh to the page itself?

    2) it seems that there’s a weird scenario happening after updating. When i submit a review via google chrome, the review get sent and would be display out in the website or the wordpress admin panel. However if i use firefox or other browser, the review would be recorded in my wordpress admin console but it would not reflect in the website.

    3) if i enable re-captcha, the review is not recorded in the wordpress admin.

    You can test it out here test link

    i receive this code from your support before

    add_action( 'site-reviews/review/created', function() {
        if( function_exists( 'wp_cache_post_change' )) {
            wp_cache_post_change( get_the_ID() );
        }
    });
    

    just wondering for this update do i need to delete it off?

    • This topic was modified 1 year, 1 month ago by adminseekout.
    • This topic was modified 1 year, 1 month ago by adminseekout.
Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    Hi @adminseekout

    Thanks for reporting this. This was happening due to the plugin javascript trying to remove a CSS class (which was actually an empty string) from the form. This was throwing a javascript error which was being handled differently in Chrome and Firefox. Since recaptcha requires javascript, it was affecting this also.

    According to the javascript spec:

    Removing a class that does not exist does NOT throw an error.

    However, I suppose that doesn’t include empty strings.

    The next update should fix this, it will be released within the hour.

    When you update, please be sure to also clear the WP Super Cache.

    Thanks

    Thanks paul! guess i will sleep a little later tonight. will wait for you and keep you posted!

    • This reply was modified 1 year, 1 month ago by adminseekout.
    Plugin Author Gemini Labs

    (@geminilabs)

    @adminseekout try now…

    Hi paul,

    it seems that there are still issues with firefox. when i submit the form using firefox, it did pass the data to wordpress admin and using google chrome, i can see the submitted review. However when i see the form using firefox i cant seems to do it.

    recaptcha seems to work well too. Just that using firefox i still cant seems to see the updated reviews.

    Update*
    i tested on a few platform. internet explorer/firefox/ Android mobile samsung internet does not reflect the updated reviews. Google chrome/safari browser reflects

    But however when i clear my wp super cache, it seems to populate out all the reviews so i guess the problem might lies there.

    add_action( 'site-reviews/review/created', function() {
        if( function_exists( 'wp_cache_post_change' )) {
            wp_cache_post_change( get_the_ID() );
        }
    });
    

    is this code not working for me ?

    • This reply was modified 1 year, 1 month ago by adminseekout.
    Plugin Author Gemini Labs

    (@geminilabs)

    You can test this by changing it to:

    add_action( 'site-reviews/review/created', function( $review ) {
        glsr_log( 'review created' );
        if( function_exists( 'wp_cache_post_change' )) {
            glsr_log( 'wp_cache_post_change('.get_the_ID().') triggered' )->info( $review );
            wp_cache_post_change( get_the_ID() );
        }
    });

    This will add three entries to the Site Reviews Console whenever a review is submitted, this will allow you to verify if the hook is being triggered correctly.

    Let me know how that goes after testing (make sure to remove the glsr_log() parts after this is solved).

    • This reply was modified 1 year, 1 month ago by Gemini Labs.
    • This reply was modified 1 year, 1 month ago by Gemini Labs.
    • This reply was modified 1 year, 1 month ago by Gemini Labs.

    So after entering this code i should 2 entries whenever i submit a review?

    i just the old code with this. It seems that it does not clear my wp super cache away whenever i submit a review.

    i remember last time i had a similar issue where i ahd to manually clear that cache to load that review. but after i put this code into my functions.php

    add_action( 'site-reviews/review/created', function() {
        if( function_exists( 'wp_cache_post_change' )) {
            wp_cache_post_change( get_the_ID() );
        }
    });
    

    it kind of work. strange..

    • This reply was modified 1 year, 1 month ago by adminseekout.
    Plugin Author Gemini Labs

    (@geminilabs)

    No.

    add_action( 'site-reviews/review/created', function( $review ) {
        glsr_log( 'review created' );
        if( function_exists( 'wp_cache_post_change' )) {
            glsr_log( 'wp_cache_post_change('.get_the_ID().') triggered' )->info( $review );
            wp_cache_post_change( get_the_ID() );
        }
    });

    If you change the code to the one above, you should see three log entries in the Site Reviews Console whenever a review is successfully submitted:

    This should help you track down if it is being triggered correctly every time.

    • This reply was modified 1 year, 1 month ago by Gemini Labs.
    • This reply was modified 1 year, 1 month ago by Gemini Labs.
    • This reply was modified 1 year, 1 month ago by Gemini Labs.

    This is what i see after i submit a review via firefox.

    [2018-12-23 00:40:56|/home/seekout0/public_html/wp-content/themes/bb-theme-child/functions.php:73] DEBUG: review created
    [2018-12-23 00:40:56|/home/seekout0/public_html/wp-content/themes/bb-theme-child/functions.php:75] DEBUG: wp_cache_post_change triggered for: testt for console

    Plugin Author Gemini Labs

    (@geminilabs)

    I had edited the code, please copy and paste the code again.

    this was the new result

    [2018-12-23 00:47:46|/home/seekout0/public_html/wp-content/themes/bb-theme-child/functions.php:73] DEBUG: review created
    [2018-12-23 00:47:46|/home/seekout0/public_html/wp-content/themes/bb-theme-child/functions.php:75] DEBUG: wp_cache_post_change() triggered
    [2018-12-23 00:47:46|/home/seekout0/public_html/wp-content/themes/bb-theme-child/functions.php:75] INFO: GeminiLabs\SiteReviews\Review Object
    (
        [assigned_to] => 8137
        [author] => reuben
        [avatar] => https://secure.gravatar.com/avatar/d10ca8d11301c2f4993ac2279ce4b930?s=96&d=mm&r=g
        [content] => testt for console123
        [custom] => Array
            (
            )
    
        [date] => 2018-12-23 00:47:46
        [email] => a@a.com
        [ID] => 8185
        [ip_address] => 115.66.168.16
        [modified] => 
        [pinned] => 
        [rating] => 5
        [response] => 
        [review_id] => 9bccadc9f32de8a9bb24429cda9775e1
        [review_type] => local
        [status] => publish
        [term_ids] => Array
            (
            )
    
        [title] => testt for console123
        [url] => 
        [user_id] => 0
    )
    
    

    does this tells me why some browser have the cache issue?

    • This reply was modified 1 year, 1 month ago by adminseekout.
    Plugin Author Gemini Labs

    (@geminilabs)

    Great!

    So this tells us that get_the_ID() is not returning the ID of the page which is why the cache is not being cleared.

    Try this:

    add_action( 'site-reviews/review/created', function( $review, $command ) {
        if( function_exists( 'wp_cache_post_change' )) {
            glsr_log( get_the_ID() )->info( $command );
            wp_cache_post_change( $command->post_id );
        }
    }, 10, 2 );
    • This reply was modified 1 year, 1 month ago by Gemini Labs.

    anddddd it worked! thanks alot paul! knew i could count on you! 😀

    Plugin Author Gemini Labs

    (@geminilabs)

    Perfect!

    Make sure to remove this line now as it is no longer necessary to log anything:

    glsr_log( get_the_ID() )->info( $command );

    • This reply was modified 1 year, 1 month ago by Gemini Labs.

    got it!

    Plugin Author Gemini Labs

    (@geminilabs)

    @adminseekout

    This now happens automatically in v3.1.0 so after updating you can remove this function from your functions.php file.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘issues after updating’ is closed to new replies.