0

I'm developing a freemium wordpress plugin where "skins" will be available for purchase to customize the appearance of the plugin.

If I commit an update to my plugin, it sounds like the contents of the "skins" folder inside of my plugin would be removed (since the skins don't come bundled with the core plugin), and the user would lose any skins they may have purchased.

What can I do to circumvent this issue? Should I look into moving the skins folder temporarily while upgrading, or somehow utilize the database?

Thanks!

1 Answer 1

2

I'd suggest either using the database if possible or using a folder outside your plugin folder. A sub-folder of the wp-content/uploads appears to be a popular choice, as it survives updates/upgrades.

6
  • Do you think it'd be trivial to have an "addon" plugin for every skin?
    – Dave Kiss
    Commented Jun 11, 2012 at 1:12
  • @Dave, I'm not clear about what you're asking here. I thought you were asking about skins for a plugin, not a plugin for skins. Nevertheless, a MySQL 'LONGTEXT' field, such as is used to store option values, can hold up to 1 byte short of 4GB, so storage certainly won't be an issue. Reading and writing to the database is indeed trivial using the 'get_option()` and update_option() functions. Commented Jun 11, 2012 at 1:22
  • thanks, sorry for the misleading comment. I am indeed asking about skins for a plugin. What I mean to say is, instead of having a folder containing "skin" files inside of my native plugin, perhaps I should distribute the skins separate from the plugin and hook into the plugin with a custom hook?
    – Dave Kiss
    Commented Jun 11, 2012 at 1:28
  • @Dave, you then have the problem of where to put those files. If you stray away from "standard" locations, such as the themes, plugins or uploads folders, you risk losing them on a WP upgrade. If you place them in the database, say one option value per file, they will not only survive upgrades, they'll also be backed up along with the rest of the database if/when that occurs (hopefully every day). Speed-wise there won't be a big enough difference to bother about for any but the most heavily trafficked sites. Commented Jun 11, 2012 at 1:33
  • Hey John, I went this route, but now I'm wondering if I made a mistake. It seems that Google is indexing a lot of the paid skins that are install on other people's sites. What is to prevent people from accessing the assets from someone else's wp-content/uploads folder? How should I block this indexing?
    – Dave Kiss
    Commented Jul 18, 2012 at 3:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.