I’ve built two apps for the Android Play market. Both function pretty good, but my code is terrible. I’m not a java developer. I learned enough to build those apps and use google to find functionality I need. When I submitted them to play they were live immediately.
WordPress reviews every plugin submitted. This can take days to a week+. Each time I’ve submitted they’ve given me a detailed reasoning why it can’t be accepted yet. Then they go so far above and beyond explaining why and what some solutions would be. I always learn something here. At google I continue to write pretty shoddy code because it just gets released no matter what.
Here is what I learned today:
Don’t use url’s to the plugin directory based on the site’s root. I always thought the site url included any subdirectory it may be installed in so site_url() . ‘/wp-content/plugins’ would always point to the plugin’s directory. Nope.
And the best thing I learned, they told me if my plugin is going to upload/create content you should never store that in your plugin’s directory. It can be deleted when the plugin is upgraded. It’s best to store in a custom sub directory under wp-content, something like ‘wp-content/your-plugins-name/’ or, even better, wp-content/your-plugins-name/uploads’ if you want it to work better with multi-sites. That’s so awesome! I’d never have known or learned that if it weren’t for the awesome review team over at WordPress.org.
Nice Dude! These are the types of functions that really prove you know WordPress and not just dabble in it. Keep it coming!
Hey, look, my first blog comment!! Thanks for the words Chris, and I shall.
For those wanting to know more about these two specific issues:
– The plugins_url() function exists for a reason. The content directory can be moved around via defines. That function will handle all realistic cases.
– If you’re going to deal with file uploads, best to use the existing media system and let it store the files in the existing uploads directory. Handles permissions better, stores metadata about the media files for you, and generally eliminates any associated security issues. Handling uploads securely is tricky and can cause weird problems if you try to DIY it. Not every hosting system is the same, there’s all sorts of edge cases.
Thanks for the insight, Otto! I haven’t dealt much with the existing media system so I guess it’s time to dive in.
Hey Chris
you forgot to put phone numbers for the rest of the team members
lmao