1

All those Pro's in wordpress I need your suggestions. PHP is a very vast language and it can't be mastered in days. Infact it is a life learning process.

I know basic PHP such as DB creation and few syntax. I started to learn wordpress very recently and so far I do not face any issues in understanding anything, but for building plugins of commercial importance would I be required to dive deeper into the details. If yes then what course to follow I mean from where should I learn.

I have completed this course. I think the people who started learning wordpress w/o being a PRO or experienced in PHP would be able to understand it correctly what I am asking. I hope so I haven't breached any terms by asking this question.

3

Wordpress will work with PHP 5.2.4+ and MySQL 5.0+ but the Wordpress docs suggest sites run on 5.6 or greater (April 6, 2016).

For personal themes/plugins I would suggest supporting at least php 5.5, but for plugins/themes you are trying to sell you may want to go down to 5.3. While PHP versions 5.5 is nearing end of life and 5.4 and below are no longer actively supported, supporting lower version would also avoid the headache of people giving your plugin/theme bad reviews if it "didn't work properly" when they are running an outdated PHP version.

Here are the current results of what php versions sites are using that are running wordpress:

5.2 : 8.545%
5.3 : 22.987%
5.4 : 33.878%
5.5 : 18.161%
5.6 : 15.512%
7.0 : 0.916%

You can check the version of php as well as wordpress on activation of your plugin and auto disable it with an optional notification. This would allow you to to use a higher php version and let you notify the user that they need to update their php version when they try to activate the plugin. This would avoid what I mentioned earlier about users/customers freaking out or giving you a bad review because the plugin broke, caused errors, or just didn't work on their site.

Also, there are several great "boilerplates" out there that give you a great foundation for building themes and plugins. I suggest using or looking through which should (for the most part) ensure you're "doing it right".

Here's a few of the most popular:

  1. Plugin Boilerplate
  2. Plugin Boilerplate Generator
  3. Roots Theme Development Starter
  4. Underscores Theme Generator
  5. Bones Starter Theme

Lastly, if you're just learning PHP and your goal is to develop wordpress themes or plugins, I wouldn't spend much if any time trying to learn outdated practices. There are several useful tools you can use to test your php and know what version it will run on (like this or PHPCompatibility. This way you can check what minimum version the user will need if you're unsure. Alongside this you can use WP-CLI for unit tests (it also lets you do a ton of other awesome things while developing). Also, most php is backward compatible so a lot of times using older features will still work in newer versions.

If compatibility is your main concern, make sure you are following development guidelines as outlined by the Theme Review Team and use the Theme Check plugin or something similar for plugins.

Final note: If you're selling on an online marketplace you'll need to pass a similar theme/plugin review that wordpress.org does before you're allowed to sell with them. So you should always try to follow guidelines provided by wordpress.org. However, online marketplaces can have slightly different requirements (like themeforest) so if you're still concerned you should check with them.

| improve this answer | |
  • Thanks, but sir my actual question was regarding the knowledge of PHP as a language. I mean what minimum PHP language must one know in order to code WP Themes and plugins for commercial needs. – The WP Intermediate Apr 7 '16 at 4:03
  • I updated the answer, it should answer your question now. At the end of the day, don't fret too much over this especially when developing a theme. I started developing wordpress themes about 12 years ago and didn't take one structured php class until 3 years ago. As long as you have a general knowledge of php/html/css, you're probably fine getting started building a theme/plugin and learning specific wordpress and php functionality specific to that project as you go. No need to waste time learning stuff you'll forget or never use. Plus there's always WordPress StackExchnage when you get lost! – Bryan Willis Apr 7 '16 at 5:42
  • First of all thank you so much for such a detailed help. It must have taken you several minutes to write that solution to the question i posted. I thank you again for your help. Boss I think i was unable to convey my mental wrestling. when I say how much PHP do I need to learn I didn't exactly mean the versions. – The WP Intermediate Apr 7 '16 at 14:28
  • 2. Let suppose I need to build a plugin in wordpress that will be used for booking. It will have many features such as selection from calendar, select services, day and time etc + Payment Options such as Stripe then do i need to go back and dive in very detail about PHP or GPL's will be easily available and building that plugin wont require in depth understanding of PHP Functions and PHP coding Knowledge. I hope I am able to convey my message this time. Thanks! – The WP Intermediate Apr 7 '16 at 14:34
  • 1
    The thing about php is that no matter how much time you spend learning it there always seems to be more stuff you don't know. Despite the fact that it's always changing/improving, its pretty complex. While what you're asking can be seen as more of an opinion based question, I personally think if you have a good knowledge of php/html/css you should be fine to get started, especially for theme development. – Bryan Willis Apr 8 '16 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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