• Resolved Jim Reekes

    (@reekes)


    I’m migrating my site to a completely new host and installation, with new theme and coding. I very much would like to keep Top 10. I wanted to export the count for some 3,500 articles (some as much as 160,000 views). I can see this when I view the Popular Posts page in the plugins’ admin settings.

    Yet when I click on “export overall tables” I get:

    Warning: Cannot modify header information - headers already sent by (output started at /home/customer/www/my-old-site.com/public_html/wp-content/plugins/top-10/includes/admin/class-import-export.php:306) in /home/customer/www/my-old-site.com/public_html/wp-content/plugins/top-10/includes/admin/class-import-export.php on line 309

    I tried recreating the database keys and rebuilding the tables, but I still get this error.

    I tried looking in the WP tables and couldn’t find the Top 10 data.

    How can I export a list of all the posts and their view counts?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ajay

    (@ajay)

    @reekes

    The plugin saves the data in the wp_top_ten and wp_top_ten_daily tables (wp can be a different prefix if you’ve changed that). Are you able to see these? It might be easier for you to move the tables via the backend (i.e. phpMyAdmin) especially given the volume of the posts that you have vs using the import/export in the admin which relies heavily on PHP limits etc.

    I’m confused on the error as I haven’t changed that piece of code and have got it working for me. Is there a way for you to suppress warnings on your install?

    Thread Starter Jim Reekes

    (@reekes)

    I do have access to the tables via phpMyAdmin. I can export wp_top_ten but it lists the post ID, which will be different on the new site. So I haven’t found a way to migrate the views count to the new site. I’ve been using WP Import Export Lite for migrating data (a great tool) but it doesn’t show wp_top_ten.

    Oddly, the export/import functions in your plug in do not work for the new site which doesn’t yet have any views. The wp_top_ten table is zero length there, but I get the same error.

    If I disable display_errors I get a new web page showing:

    "Post ID",Visits,"Blog ID" <followed by 3 number separated by commas, then a CR>

    Is that how it’s suppose to work? I’m to save the html web page myself? I was expecting it would create a CSV file to save.

    Let’s say that’s how it suppose to work and I save the html, and correct it to be CSV. How should I go about updating the post IDs to the new site’s IDs?

    • This reply was modified 1 year, 1 month ago by Jim Reekes.
    Plugin Author Ajay

    (@ajay)

    Sorry for the delayed response. It is supposed to be a CSV file that gets pushed to download and I’m wondering if something is preventing that in your new host where it is trying to get displayed vs being downloaded.

    Does it work properly at the old host?

    Thread Starter Jim Reekes

    (@reekes)

    Nope, it fails the same way at both hosting sites. No idea why it fails. If I turn off PHP errors it was export the comma separated text to the html page.

    Then I saved the html page as a file locally, and cleaned it up with a text editor.

    Plugin Author Ajay

    (@ajay)

    Jim, I’ll be honest that I am at a loss. I’ll try further researching to see if there is something within the code to force a download. I can’t replicate it on my own installs – both apache and nginx servers.

    Plugin Author Ajay

    (@ajay)

    Would you be in a position to try a beta version. I think this might be a long shot, but I made minor changes to the code to first set the headers and then try to write the file to the browser.

    https://github.com/WebberZone/top-10/releases/tag/v3.3.3-RC1

    Thread Starter Jim Reekes

    (@reekes)

    BINGO!

    The beta does NOT have the problem ??

    Export works. I get a csv file downloaded.

    Plugin Author Ajay

    (@ajay)

    Brilliant. Thanks for confirming. I’ll have this in the new version coming soon.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Cannot modify header information’ is closed to new replies.