Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6912
    starxed
    Participant

    The GMedia WordPress plugin (Phantom Gallery) tries to send a POST request to the server each time an image is opened in order to retrieve the views/likes counters:

    POST https:/me/wp-admin/admin-ajax.php
    gmedia_module_interaction
    -> views:n , likes:n

    This should only happen when the views/likes counters are enabled.

    Why does this cause trouble?
    My wordpress is shadowed to multiple loadbalanced static copies, so the POST request will go nowhere and cause undesired actions. Right now, I am manually removing the snipplet from the javascript files on every update.

    Please sort this out, thank you!

    Just for reference, please find below the sniplet where the POST request is issued:
    jquery.gmPhantom.js:671

    
      if (!item.viewed) {
                                item.viewed = true;
                                ViewsCount[item.no] += 1;
                                Storage[id].status = 'viewed';
                                sessionStorage.setItem(elID, JSON.stringify(Storage));
                                if (GmediaGallery.ajaxurl) {
                                    $.ajax({
                                        type : "post",
                                        dataType : "json",
                                        url: GmediaGallery.ajaxurl,
                                        data: {action: 'gmedia_module_interaction', hit: id}
                                    }).done(function(r){
                                        if(r.views){
                                            item.views = ViewsCount[item.no] = r.views;
                                        }
                                    });
                                }
                            }
                            if (like && !item.liked) {
                                item.liked = true;
                                item.likes += 1;
                                LikesCount[item.no] = item.likes;
                                Storage[id].status = 'liked';
                                sessionStorage.setItem(elID, JSON.stringify(Storage));
                                if (GmediaGallery.ajaxurl) {
                                    $.ajax({
                                        type : "post",
                                        dataType : "json",
                                        url: GmediaGallery.ajaxurl,
                                        data: {action: 'gmedia_module_interaction', hit: id, vote: 1}
                                    }).done(function(r){
                                        if(r.likes){
                                            item.likes = LikesCount[item.no] = r.likes;
                                        }
                                    });
                                }
                            }
    
    #6942
    Rattus
    Keymaster

    Update Phantom to v3.5. Now if views and likes disabled, then gallery will not send POST requests.

    Go to Gmedia Modules page and update module to the latest version.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Requests and Feedback’ is closed to new topics and replies.
Forum closed. Use forum at Wordpress.org: Gmedia Support Forum