Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
Do you think it'd be trivial to have an "addon" plugin for every skin? –  Dave Kiss Jun 11 '12 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. –  John Gardeniers Jun 11 '12 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 Jun 11 '12 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. –  John Gardeniers Jun 11 '12 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 Jul 18 '12 at 3:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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