Support » Plugin: REST API Log » Store in external database instead of WP

  • Ashish

    (@ashishpatel1992)


    Hi,
    I dont want to assign new postID for each log entry. Is it possible to store it in external database or maybe in same table, but not using the core ID for the post?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Yes please, this plugin is not useful for production websites.
    Log-Data storing in wp_posts i a no go.

    Thread Starter Ashish

    (@ashishpatel1992)

    Most of the wordpress plugins can create custom table to store their entries. I think The plugin author should do the same!

    Plugin Author Pete Nelson

    (@gungeekatx)

    I’ve started to look into this. Originally, the plugin used completely custom tables but it was getting tricky to write all of the custom queries necessary. However, I think it may be possible to create custom tables that match the same structure as WP core, use hooks to switch the table prefix on-the-fly, and still be able to use standard WP_Query calls to insert log entries and query for them.

    Work in progress: https://github.com/petenelson/wp-rest-api-log/tree/feature/custom-db-tables

    Plugin Author Pete Nelson

    (@gungeekatx)

    I’ve made progress on this, but have run into some issues with the way WordPress caches posts. It’s still a work-in-progress.

    Thread Starter Ashish

    (@ashishpatel1992)

    GREAT!! Good to see that you keep updating me regarding progress.

    Until you implement this, can you please add a big red flashy warning on top of the plugin settings page? I am requesting this in hopes that it will save someone else from a lot of frustration, headache and wasted time.

    I left the plugin running for a week on a production website to debug an issue. We have 3 external integrations with logistics companies and apparently one of them did some pretty expensive API calls regularly. This was a good thing to find out, so in that sense, the plugin served its purpose. However, thanks to the plugin storing LOG ENTRIES in the MAIN WP POSTS TABLE (!!!!), our wp_posts table went from 17mb to 5GB, took down a production server, took our team half a day to clean up and resulted in a non-trivial financial loss for our client.

    Lesson learned: audit *every* plugin thoroughly before installing. I usually get a pretty good initial sense of the code quality by just looking at the settings page, file names and structure – and everything looked good in this case. So I am still somewhat reluctant to take the blame here, because the idea of storing log entries in wp_posts is just so utterly absurd that it never would have crossed my mind.

    Please add a warning.

    Plugin Author Pete Nelson

    (@gungeekatx)

    I definitely agree and will get a warning added to the settings page in the near future.

    Why not just add an option to only keep the most recent logs for instance using a cron entry to remove the rest on a regular basis?

    I forgot this exists already. It would be nice to have a link from the Tools log entries to the settings page. Oh and put a default number for the ‘Days to Retain Old Entries’ option or warn when it is not set.

    • This reply was modified 3 years, 2 months ago by therealgilles.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Store in external database instead of WP’ is closed to new replies.