Support » Plugins » How to store data for my plugin?

  • I am building an RSS reader plugin and I’d like some advice on how to store the data and settings for this plugin.

    The idea is to be able to enter a set of feed sources and associate each one of these sources with one or more categories. Thus you can have several categories e.g. sports, politics each having their own associated feed sources.

    So for example:

    When the feed items from these feed sources are imported every few hours via Cron they are then stored as custom post types. Each feed item must of course be associated with the feed source.

    When it comes to display feed items the plugin will use this logic:

    Check which category is being called (via shortcode)
    Check which feed sources are associated with that category
    Get feed items associated with feed sources identified in step 2
    I am still unsure about how all this data needs to be stored.

    The plugin will have a settings page and for that I am settled about storing everything in the wp_options table.

    However when it comes to the feed sources, categories and feed items, I’m still confused how to store them best.

    Any suggestions on how to do this?

    I’ve been reading about the CPTonomies plugin which seems to do what I need, but I want the functionality in built into this plugin and I cannot use another external plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • I don’t understand why you are storing them as custom post types. That is a fair bit of work for what sounds like temporary storage. You are updating every few hours. I’d use the Transient’s API instead.

    Unless, what you are doing is scraping, in which case I’m out.

    If you do have a legit reason to be storing as a custom post type, put the feed item associations in wp_postmeta. There are functions for that too.

    I think it would be more efficient to use CPTs, also giving me an interface for the user to view his feeds, and even add to them, for example his own comment after a feed excerpt. The idea is definitely not to scrape, but to act like a normal aggregator.

    You want this to be something like Digg, or Newsvine or something, where people can comment on content from other sites? I guess you do need custom post post types for that. The answer to your original question is wp_postmeta, as above.

    There is no need for people to be able to comment. I still cannot see how associations between the data as described can be done via wp_postmeta.

    There is no need for people to be able to comment.

    You mentioned adding a comment after a feed excerpt.

    I still cannot see how associations between the data as described can be done via wp_postmeta.

    Then describe your project in more detail. I must not be understanding you.

    As they closed your duplicate post, I will repost my thoughts here also:

    Each Competition would be a Page. That page would load a custom page template that would use a combination of HTML and custom queries to output data in the manner desired (and some CSS work also).

    Each Team is given it’s own category which of course would be the team name. Each category would have it’s own custom template (Team logo, output list of players, etc.)

    Each Player has a post in the team category. Using the permalink structure /%category%/%postname%/ would make their url to be (which would work well for SEO). If a player is added or removed from said Team category, the well written custom queries used would then not display them in the lists(s).

    Once above is all created, it’s a matter of site flow and design (custom queries, those page templates, custom css).

    Assuming yearly competitions, I would set up WP Multisite per year, first year of course requiring much work, but the subsequent years would start with a copy of the previous year db, and an import of pages and posts to start.

    If done well with CSS, each year could easily provide a fresh look by simple edits to the stylesheet.

    @seacoast Thanks, I had actually tried explaining my issue via another example in the other post. I still don’t have a proper answer for how to organise data for this RSS plugin I’m building.

    Probably going to spend some time analysing the Posts to Posts plugin to see whether I can adapt some code from it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to store data for my plugin?’ is closed to new replies.