I'm writing a plugin for WordPress that dynamically generates content from a Google Documents Spreadsheet. Specifically, the plugin provides a shortcode that generates a good-looking staff list. It works, but there are two problems:
- Pages that use the shortcode load a little slow, because they have to make multiple requests to another server
- Since the content is generated when the page is loaded, the contents of the staff list do not show up in search results on the site
I can fix the first problem with some level of caching, but what can I do about the second problem? I mention the first problem because I think the ideal solution is one in which WordPress indexes the cached copy of the page.
Another solution I can think of would be to have the content of the page composed by a plugin periodically. That way the page could be searched and wouldn't be dynamically generated every time. However, it seems like a strange paradigm for a plugin to completely control the content of a page...are there other plugins that do this? Also, this approach exposes complexity to the user that it shouldn't have to. (They'd have to edit the contents of the page from a plugin page instead of the normal place.)
Here's a sample of what part of the markup for the page looks like:
<h2>General Management</h2> [staff-directory department="General Management"]
The spreadsheet to hit is configured separately. The "department" specifies the worksheet. (I'd show you what the results look like, but I don't have enough rep to post an image.)
Your suggestions are greatly appreciated.