Recently I have been going through Tutorial videos at Pippinsplugins.com. They are a must watch for anyone who is serious about doing something in WordPress like developing a plugin, theme, etc. You can become a member by visiting here.
I just want to mention some of my learnings after watching the first series in those tutorials: Plugin Development 101 Series.
- Never ever, hardcode a URL in your plugin. Use plugins_url() instead.
- Always prefix your function name with something relevant to your plugin.
- Make your code readable. Use appropriate spacing. Readable code solves 50% of your problem.
Some of our own mistakes we made at Tyche:
- Hardcoding URLs, leading to support issues where customers complained that the plugin wouldn’t work as they had their WordPress installed in a separate folder.
- Using same function names as found in code samples on sites like WordPress.org or Stackoverflow.com . This resulted in errors as that function name would also be used by some other plugin. Example: my_custom_checkout_field_update_order_meta
- Using same function names in Lite & Pro versions of a couple of our plugins.
We are happy that we’ve learnt our mistakes & corrected them.
I hope the above tips help you.
Browse more in: Uncategorized