getButterfly Logo getButterfly

The eCards plugin is pending an update and sending statistics needs to be introduced. I’ve been thinking how to store the statistics data, meaning 2 values for each day: the actual date and the number of eCards.

I have 3 possible solutions:

  1. Store the information inside a new database table.
  2. Store the information as (hidden) custom posts.
  3. Store the information inside one custom post with meta values as separate rows.
  4. Store the information as serialized data inside wp_options.

The first solution seems to be the most appropriate one, but it adds an extra table to the database and I want to keep the plugin footprint light.

The second solution is overkill and I won’t consider it. I just added it as a possible option.

The third solution sounds interesting and it’s easy to extend and transfer/migrate. However, a custom post should not store such information.

The fourth solution sounds really good, but it’s the worst performance-wise.

So, what should I choose?

UPDATE #1: I have decided to go with the first option, creating a new database table, as I intend to filter data, create charts and graphs and keep an indeterminate amount of data (like Google Analytics). That’s why I’ll create a table structure with 2 columns – date and number of eCards sent – as I won’t need any other information.

Subscribe to getButterfly Blog

Once a week or so we send an email with our best content. We never bug you, we just send you our latest piece of content.

If you found any value in this post, agree, disagree, or have anything to add - please do. I use comments as my #1 signal for what to write about. Read our comment policy before commenting! Comments such as "Thank you!", "Awesome!", "You're the man!" are either marked as spam or stripped from URL.

Leave a Reply

Your email address will not be published. Required fields are marked *