• Hi Hector,

    I use AWS elastic beanstalk for both my test site and my live site https://www.1688.com.au.
    The process is

    1) I install the WPP plugin on the test site
    2) I create a zip file from the test site
    3) Use the zip to deploy onto AWS EBS as per their instructions (to take advantage of AWS infrastructure) – this means Plugins can’t be installed on the production site – plugins must be committed to git and deployed.

    Currently the test site and the live site share the same wordpress post database.
    Unfortunately because of the process mentioned above the view stat showing is that of the test site and not the live site even after the website code has been deployed onto the live site.

    Can you help?

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hey there!

    No idea, to be honest. I’m not familiar with AWS (I know what it is, just have never used it before).

    WPP is updating the views count of the post IDS that WordPress returns. For some reason, WordPress is returning the IDs of the test site.

    Maybe you should check with AWS if the steps you’re following are the right ones for your project.

    Thread Starter EverythingsAMatterOfTime

    (@danielklam)

    Hi Hector!

    I had another look after reading your post –

    We have two WordPress (test & live) connected to the same database. Sometimes we’ll make some changes on the test server and then deploy that version to the live server. As they’re literally connected to the same database, I think some URLs in the database was accidentally changed to the URL of the test site, so now the WPP of the live site only count the view counts of the test site.

    Basically, we only post on the live site, so the IDs are the same on the live site and the test site. I think it’s something wrong with the WP database, just wonder if you know which part we might have changed?

    Cheers.

    Plugin Author Hector Cabrera

    (@hcabrera)

    I would make sure that the URLs in the database are all changed to the one used by the live site (Google “WordPress migration queries”). Other than that I’m out of suggestions.

    If the above doesn’t solve the issue, I suggest getting in touch with the AWS team and ask for their assistance.

    Thread Starter EverythingsAMatterOfTime

    (@danielklam)

    Thanks Hector

    Do you know where this URL is kept in the wordpress database? I want to take a look at it.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Do you know where this URL is kept in the wordpress database?

    In several places, actually. That’s why I said: Google “WordPress migration queries” ??

    Thread Starter EverythingsAMatterOfTime

    (@danielklam)

    ??

    I took a deeper look and couldn’t reconcile the ID issue – not sure if I stressed this fact earlier but both sites use the same database and therefore the same post IDs.

    WPP is updating the views count of the post IDS that WordPress returns. For some reason, WordPress is returning the IDs of the test site.

    There’s only one post ID for the same post in both sites. Clearly WordPress is only returning incorrect values to the plugin. Would you have any idea where I can take a closer look at this?

    Plugin Author Hector Cabrera

    (@hcabrera)

    (…) not sure if I stressed this fact earlier but both sites use the same database and therefore the same post IDs.

    Yes, you made it pretty much clear. You mentioned that in almost all of your comments here so far ??

    Would you have any idea where I can take a closer look at this?

    I’d love to be of more help, I do, but as I already said I’m not familiar with AWS and so I have no idea what might be wrong with your setup. Hence:

    I would make sure that the URLs in the database are all changed to the one used by the live site (Google “WordPress migration queries”). Other than that I’m out of suggestions.

    If the above doesn’t solve the issue, I suggest getting in touch with the AWS team and ask for their assistance.

    Thread Starter EverythingsAMatterOfTime

    (@danielklam)

    Thanks for your persistence Hector!

    we find out that code in update range summary executes a query which adds value to the last_viewed attribute.

     $result2 = $wpdb->query( $wpdb->prepare(
                "INSERT INTO {$table}summary
                (postid, pageviews, view_date, last_viewed) VALUES (%d, %d, %s, %s)
                ON DUPLICATE KEY UPDATE pageviews = pageviews + %d, last_viewed = %s;",
                $post_ID,
                $views,
                $curdate,
                $now,
                $views,
                $now
            ));

    However, in the database, the “wp_popularpostssummary” table does not have this attribute, but the “view_datatime” attribute. So I think this result in this SQL query could not be correctly executed and such function return False.

    Database Picture

    Plugin Author Hector Cabrera

    (@hcabrera)

    You have an old version of WPP running there. Please update the plugin to the latest version available.

    Plugin Author Hector Cabrera

    (@hcabrera)

    It’s been over a week since OP’s last response so I’m going to assume he’s managed to fix the issue. So, I’m marking this as resolved.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Viewcount showing for wrong site’ is closed to new replies.