Forums

[Plugin: WordPress Popular Posts] Data Reset after Update (56 posts)

  1. Topas
    Member
    Posted 2 years ago #

    You are great .... thanks ... and Enjoy your meal :-)

  2. Topas
    Member
    Posted 2 years ago #

    The table wb_wpptemp now exists in my Database.

    I´m not a coder or somebody like this, but this line of your script:
    $wpdb->query("CREATE TABLE wp_wpptemp ( UNIQUE KEY id (postid), postid int(10) NOT NULL, day datetime NOT NULL default '0000-00-00 00:00:00', last_viewed datetime NOT NULL default '0000-00-00 00:00:00', pageviews int(10) default 1 )");

    has been done.

  3. Héctor Cabrera
    Member
    Posted 2 years ago #

    Hi topas,

    Please go to phpmyadmin and run this query: SELECT DISTINCT postid FROM wp_popularpostsdata_backup ORDER BY postid

    Let me know what are the results from that.

  4. Topas
    Member
    Posted 2 years ago #

    Hey Ikki ... i write out all entries (56 Pages á 30 Entries) and sum them up ... i make new entries in wp_popularpostsdata with this data and the number of pageviews of each postid. I have 91 postID´s (my Blog exists since may ... a new blog) and i made it in the last hour. Now the Data is ready, correct and live.

    Thank´s for your great support!!! I hope this was the last time, i make you crazy with my Problems. :-D

    I´m happy that my Blog has only 56 Pages and not 500 ... then your script will be the best solution.

  5. Héctor Cabrera
    Member
    Posted 2 years ago #

    That's why I wrote that script xD Anyways, hope to get a feedback from someone else having this issue.

    Cheers!

  6. Topas
    Member
    Posted 2 years ago #

    Yes your script gave me the idea and the amount of data is small sized. :-D So i do it manually.

    Thank you again!

  7. Gersprenz
    Member
    Posted 2 years ago #

    Ok, so I have an old blog since 2004, more than schubbiduuh articles and run into the same problem as described by topas.
    I didn't have the right to execute the script, and yes i renamed it.
    Any hints how to modify your script?

  8. Héctor Cabrera
    Member
    Posted 2 years ago #

    Well I've been doing some research about that permission issue topas mentioned and it seems to be a WordPress thing. Please try this (backup your data first!): http://beconfused.com/2007/08/28/how-to-solve-you-do-not-have-sufficient-permissions-to-access-this-page-in-wordpress/

  9. jonmrich
    Member
    Posted 2 years ago #

    I had the same problem and tried the script above. Everything worked as you said except that it had precisely the opposite effect. All of my data is now gone. It was showing some data before, but this script seemed to completely reset everything.

    I looked at my database and see that this table wp_popularpostsdata is basically empty (i.e., only has from the time I upgraded the plugin). However, wp_popularpostsdata_backup seems to have all the historical data down to the minute I upgraded the plug in. Is there a way to have the plug in call data form the backup and also current? Or to merge the two?

    Thanks! I love this plugin and hope I can get it working again.

    Best,
    JMR

  10. Héctor Cabrera
    Member
    Posted 2 years ago #

    Hi jonmrich,

    The script attempts to import all data from wp_popularpostsdata_backup into wp_popularpostsdata. However, for some reason I have yet to discover it doesn't work for some people.

    I've updated the script, can you please test it for me? If so, please download it here and place it into the wordpress-popular-posts directory. Then, log in into your wp-admin area, and type this URL into your address bar: http://yoursite.com/wp-admin/options-general.php?page=wordpress-popular-posts/recovery.php (please replace yoursite.com with your actual url!) to run the script.

  11. jonmrich
    Member
    Posted 2 years ago #

    Thanks for getting back with me so quickly. The script ran perfectly fine and I got the "done!" message, but it didn't have any effect. The all-time popular posts and pages appear only to be those since I reactivated the plugin after running the script (i.e., only shows 5 page views total).

    I'm assuming that it is still not pull from the back up. The script actually seems to have the opposite effect from what's intended. As an experiment, I ran the script again and reactivated the plug in. This time it showed "Sorry no data." as if the script erased the data that was captured in the few minutes it was active before I re-ran the script.

    Any other thoughts you have would be appreciated.

    Thanks again for your efforts.

    Best,
    Jonathan

  12. Héctor Cabrera
    Member
    Posted 2 years ago #

    Hey, no problem!

    Anyways, back on topic. This is what happens when the script is ran:

    # Table wp_popularpostsdata is deleted
    # Then, a temporary table is created
    # Next, the script attempts to retrieve all data from wp_popularpostsdata_backup
    # If success, all the retrieved data is inserted into the temporary table that was created earlier
    # Temporary table is renamed to wp_popularpostsdata, and a "success" message is printed

    Can you please re-run the script and then take a screenshot of the wp_popularpostsdata table in your phpmyadmin?

  13. jonmrich
    Member
    Posted 2 years ago #

    Thanks again...

    Re-ran the script and got a message of "done!" Couldn't do a screenshot having trouble with access to my phpmyadmin, but I did a database back up and got this.

    #
    # Data contents of table wp_popularpostsdata
    #

    #
    # End of data contents of table wp_popularpostsdata
    # --------------------------------------------------------

    # --------------------------------------------------------
    # Table: wp_popularpostsdata_backup
    # --------------------------------------------------------

    #
    # Delete any existing table wp_popularpostsdata_backup
    #

    DROP TABLE IF EXISTS wp_popularpostsdata_backup;

    #
    # Table structure of table wp_popularpostsdata_backup
    #

    CREATE TABLE wp_popularpostsdata_backup (
    postid int(10) NOT NULL,
    day datetime NOT NULL default '0000-00-00 00:00:00',
    pageviews int(10) default '1',
    UNIQUE KEY id (postid,day)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

    #
    # Data contents of table wp_popularpostsdata_backup
    #

    INSERT INTO wp_popularpostsdata_backup VALUES (131, '2009-01-18 00:00:00', 1);
    INSERT INTO wp_popularpostsdata_backup VALUES (127, '2009-01-18 00:00:00', 2);
    INSERT INTO wp_popularpostsdata_backup VALUES (83, '2009-01-18 00:00:00', 1);

    This table goes on for a while with all the popular posts data. It looks like the data from the backup wasn't moved at all.

    Let me know if you can make anything of this.

    Thanks again.

    JMR

  14. Héctor Cabrera
    Member
    Posted 2 years ago #

    Hey, sorry for not replying earlier. Busy weekend!

    Anyways, please open recovery.php using a text editor such as Dreamweaver or Windows' Notepad and replace this line of code:

    $old_rows = $wpdb->get_results("SELECT DISTINCT postid FROM ".$wpdb->prefix."popularpostsdata_backup ORDER BY postid");

    ...with this one:

    $old_rows = $wpdb->get_results("SELECT postid FROM ".$wpdb->prefix."popularpostsdata_backup GROUP BY postid ORDER BY postid");

    Then, run the script again. Let me know what happens.

  15. jonmrich
    Member
    Posted 2 years ago #

    Thanks so much for the ongoing help. Unfortunately, this didn't work. The script loaded fine, I got a message of "done!" but the plug in still serves up "Sorry. Not data so far."

    I can't begin to know what's wrong, but I don't think the data from this table (wp_popularpostsdata_backup) is actually being moved. That's where all the data is stored right now. It's still there and I don't see anything in the plug in or script that would indicate that it would try to move or call anything from there. Is that the issue or is the "wp_" part not essential?

    Anyway...happy continue to have your help. I appreciate it. Just bought you a beer via PayPal. The least I can do to get one more minute from you.

    Thanks,
    JMR

  16. Héctor Cabrera
    Member
    Posted 2 years ago #

    Well, WordPress' table prefix is automatically added with $wpdb->prefix, so that can't be the problem. You're right, though. For some reason it's not accesing that table and therefore no exporting can be done. You might want to change ...

    $old_rows = $wpdb->get_results("SELECT postid FROM ".$wpdb->prefix."popularpostsdata_backup GROUP BY postid ORDER BY postid");

    ... into ...

    $old_rows = $wpdb->get_results("SELECT postid FROM wp_popularpostsdata_backup GROUP BY postid ORDER BY postid");

    Also, please change:

    global $wp;

    ...into:

    global $wp, $wpdb;

    ... and run the script again.

    And hey, thanks for the beer! I'd help you even without it, but thanks anyways!

  17. jonmrich
    Member
    Posted 2 years ago #

    Sorry to say that didn't do anything either. I got the "done!" message, but still getting "Sorry. No data so far."

    Any other thoughts?

  18. Héctor Cabrera
    Member
    Posted 2 years ago #

    Hi jonmrich,

    I posted a reply days ago but for some reason it's not here :S Anyways, download this: http://www.2shared.com/file/7252545/d3a31439/recovery.html

    That should fix it!

  19. jonmrich
    Member
    Posted 2 years ago #

    I tried this one and I didn't get the "Done!" message. However, the new file is properly placed in the folder on my server. I'm assuming that since I didn't get this message that somehow the script didn't run all the way through. I didn't get any message, just a blank screen within the middle of my dashboard (top and side nav. loaded fine).

    Suffice it to say, this didn't work. My tables still look like this:

    # --------------------------------------------------------
    # Table: wp_popularpostsdata
    # --------------------------------------------------------

    #
    # Delete any existing table wp_popularpostsdata
    #

    DROP TABLE IF EXISTS wp_popularpostsdata;

    #
    # Table structure of table wp_popularpostsdata
    #

    CREATE TABLE wp_popularpostsdata (
    postid int(10) NOT NULL,
    day datetime NOT NULL default '0000-00-00 00:00:00',
    last_viewed datetime NOT NULL default '0000-00-00 00:00:00',
    pageviews int(10) default '1',
    UNIQUE KEY id (postid)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

    #
    # Data contents of table wp_popularpostsdata
    #

    INSERT INTO wp_popularpostsdata VALUES (1346, '2009-08-18 13:34:34', '2009-08-18 13:34:34', 1);
    INSERT INTO wp_popularpostsdata VALUES (633, '2009-08-22 15:03:47', '2009-08-22 15:05:29', 3);
    INSERT INTO wp_popularpostsdata VALUES (436, '2009-08-22 15:04:53', '2009-08-22 15:04:53', 2);
    #
    # End of data contents of table wp_popularpostsdata
    # --------------------------------------------------------

    # --------------------------------------------------------
    # Table: wp_popularpostsdata_backup
    # --------------------------------------------------------

    #
    # Delete any existing table wp_popularpostsdata_backup
    #

    DROP TABLE IF EXISTS wp_popularpostsdata_backup;

    #
    # Table structure of table wp_popularpostsdata_backup
    #

    CREATE TABLE wp_popularpostsdata_backup (
    postid int(10) NOT NULL,
    day datetime NOT NULL default '0000-00-00 00:00:00',
    pageviews int(10) default '1',
    UNIQUE KEY id (postid,day)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

    #
    # Data contents of table wp_popularpostsdata_backup
    #

    INSERT INTO wp_popularpostsdata_backup VALUES (131, '2009-01-18 00:00:00', 1);
    INSERT INTO wp_popularpostsdata_backup VALUES (127, '2009-01-18 00:00:00', 2);
    INSERT INTO wp_popularpostsdata_backup VALUES (83, '2009-01-18 00:00:00', 1);
    INSERT INTO wp_popularpostsdata_backup VALUES (25, '2009-01-18 00:00:00', 1);

    <followed by all the other data>

  20. Héctor Cabrera
    Member
    Posted 2 years ago #

    I checked that log and wp_popularpostsdata_backup was deleted at the beginning - my script doesn't do that. Can you please tell me what are the steps you're following to run this script? Also, there's a wp_popularpostsdata_backup table with data on it, right?

  21. jonmrich
    Member
    Posted 2 years ago #

    To run the script, I'm first logging into my dashboard, then copying this URL into my browser (http://www.doseofdigital.com/wp-admin/options-general.php?page=wordpress-popular-posts/recovery.php) and then running.

    Yes, wp_popularpostsdata_backup is the table that holds all of the historical data.

    Not sure why the table shows as deleted in the log, when it clearly still has data in it.

    Thanks again.

  22. ollie_kl
    Member
    Posted 2 years ago #

    Hi Ikki24,

    I am having exactly the same problem after upgrading the plugin to 1.5.1. Is there a new solution to fix that or could you please reupload your script, so I may test this as well? I lost thousands of entries.. :(

    All the bests,
    Ollie

  23. Héctor Cabrera
    Member
    Posted 2 years ago #

    Hi ollie,

    I don't have any place where to host it now. However, I'm working on a newer version of WPP that should fix that. In your case, if you're willing to try it out, this is what you gotta do:

    # Backup your database first!!

    # Go to phpmyadmin and check that there is a wp_popularpostsdata_backup table in there.

    # Find and delete the table named wp_popularpostsdata

    # Downgrade to WordPress Popular Posts v.1.4.6

    # Go to http://wordpress.org/support/topic/337947?replies=4#post-1303377 and download the development version of my plugin from the link provided there.

    # Deactivate WPP, install the new version and reactivate it. That should recover all your popular posts back.

  24. ollie_kl
    Member
    Posted 2 years ago #

    Hey Ikki24,

    just saw your post a few minutes ago.. Thank you for your answer. I will wait for a quiet evening for trying this out.. ;)

    And I will let you know, if this works for me..

    Ollie

  25. lowspeed2000
    Member
    Posted 2 years ago #

    i'm having the same issue.

    I dont care about the previous stats that much. But it doesnt seem to populate new statistics.

    Any idea how to check what's going on ?

    (Reverting back to the older version is now not working either)

  26. Héctor Cabrera
    Member
    Posted 2 years ago #

    Hi there,

    Does your theme have the wp_head() tag on the <head> section?

Topic Closed

This topic has been closed to new replies.

About this Topic