Learn icon indicating copy to clipboard operation
Learn copied to clipboard

PHP code structure

Open jonathanbossenger opened this issue 1 year ago β€’ 23 comments

Details

  • Content type (Online Workshop, Lesson, Course, Tutorial, or Lesson Plan): Lesson
  • Content title: PHP code structure
  • Topic description: A very simplified introduction to using PHP classes to structure code.
  • Audience (User, Developer, Designer, Contributor, etc.): Developer
  • Experience Level (Beginner, Intermediate, Advanced, Any): Intermediate

Prerequisites

It is assumed that the learner has already completed the following lessons:

Learning Objectives

  • Identify different ways to structure PHP using classes
  • Explain the difference between creating an instance of a class and using static class methods

Related Resources and Other Notes

Automation Code

//lesson

jonathanbossenger avatar Aug 20 '24 13:08 jonathanbossenger

Lesson Development Checklist

  • [x] Gather any relevant links to Support, Docs, or related material
  • [x] Description and Objectives finalized
  • [ ] Lesson created and announced to the team for review
  • [ ] Lesson reviewed
  • [ ] Lesson video submitted and published to WPTV
  • [ ] Lesson created on Learn.WordPress.org
  • [ ] Lesson video published to YouTube
  • [ ] Lesson on Learn.WordPress.org updated with YouTube video
  • [ ] Lesson published to Learn.WordPress.org

github-actions[bot] avatar Aug 20 '24 13:08 github-actions[bot]

Script for review:

https://github.com/jonathanbossenger/wp-content/blob/main/plugin-developer-learning-pathway/01-Plugin-Development-Practices/01-php-code-structure.md

jonathanbossenger avatar Aug 20 '24 15:08 jonathanbossenger

Audio file: https://drive.google.com/file/d/18L8m-wZIzuBCfuggzNN-25CQz0t17BTi/view?usp=sharing

jonathanbossenger avatar Aug 23 '24 15:08 jonathanbossenger

@agiljulio this lesson is ready for you to start creating.

jonathanbossenger avatar Aug 23 '24 15:08 jonathanbossenger

hi @jonathanbossenger thank you for the audio and script. I will start working on it as soon as I finish the module from Wes πŸ™

agiljulio avatar Aug 27 '24 06:08 agiljulio

Thanks @agiljulio are you able to make an educated guess as to when this might be, just to help my planning. Thanks

jonathanbossenger avatar Aug 28 '24 09:08 jonathanbossenger

Hi, @agiljulio, I just wanted to check in with you. Are you able to share an ETA for this video?

jonathanbossenger avatar Sep 11 '24 09:09 jonathanbossenger

hi @jonathanbossenger I will aim to finish it by this week and will do my best to have it completed by Friday, as we are currently focusing on our OKRs this week πŸ™

agiljulio avatar Sep 11 '24 09:09 agiljulio

100% thanks for the update.

jonathanbossenger avatar Sep 11 '24 09:09 jonathanbossenger

Hi @jonathanbossenger , here’s the video. Apologies for the delay πŸ™ Also, could you please send the thumbnail for this video? I need it to be included in the intro. And please have a look and feel free to share any feedback, thank you πŸ™

agiljulio avatar Sep 12 '24 23:09 agiljulio

Hi @jonathanbossenger , here’s the video. Apologies for the delay πŸ™

No worries at all, I know you were busy with your OKRs πŸ˜„

Also, could you please send the thumbnail for this video? I need it to be included in the intro.

I usually only create the video thumbnails once all the videos on a module are completed, and then I upload them to WordPress.tv and YouTube when I upload the videos. I do this because I try and pick a single "theme color" for all thumbnails in a module. Does that process work for you?

And please have a look and feel free to share any feedback, thank you πŸ™

I will do, thank you. In the meantime, there's another script/audio file ready for you 😁

jonathanbossenger avatar Sep 13 '24 06:09 jonathanbossenger

Yes, that works for me. Previously, in Wes' module, I used the thumbnail in the video intro and it seemed to work really well πŸ˜ƒ

Thank you, will work on it for the next video πŸ‘

agiljulio avatar Sep 13 '24 08:09 agiljulio

:smile: Wes is better than me at creating thumbnails early on. If you prefer I can create the thumbnails next week?

jonathanbossenger avatar Sep 13 '24 10:09 jonathanbossenger

sure, take your time, no need to rush πŸ˜„

agiljulio avatar Sep 13 '24 11:09 agiljulio

Video is ready for review.

Script: https://github.com/jonathanbossenger/wp-content/blob/main/plugin-developer-learning-pathway/01-Plugin-Development-Practices/01-php-code-structure.md

Video: https://drive.google.com/file/d/1aamHKSG8Gk_k09rIpvdO3S_kTMAjmO3F/view?usp=sharing

Guidelines for reviewing content: https://make.wordpress.org/training/handbook/training-team-how-to-guides/guidelines-for-reviewing-content-on-learn/

jonathanbossenger avatar Sep 17 '24 12:09 jonathanbossenger

Tutorial/Lessons Review Checklist

Please tick all items you've confirmed:

  • [x] Learning outcomes/objectives are clear.
  • [x] Technical concepts introduced in the content are accurate.
  • [x] The speed of demonstrations are easy to follow.
  • [x] The narration audio matches what is shown visually.
  • [x] Spelling and grammar are correct.
  • [x] Sound quality is consistent throughout the video.
  • [x] Brand Usage Guidelines and Promotional Guidelines are being followed.
  • [x] Media assets are all in the public domain (CC0).

@agiljulio, another great video, thank you.

I have some feedback regarding the highlighting of specific blocks of code, making sure that the correct code is highlighted in certain places.

  • [ ] 0:29: please highlight the code of the body (with class="main"), as this is where PHP is used to output the book info
  • [ ] 1:10: please highlight the get_title, get_author, get_publisher methods of the class, not the __construct method
  • [ ] 1:15: please highlight line 25
  • [ ] 1:23: please highlight the __construct method
  • [ ] 1:31: please highlight the object method calls in the HTML (e.g. $book->get_title() etc.)
  • [ ] 2:10: Here, please switch back to the code using non static methods at 0:53 and show the -> being used in the HTML output, Then it can switch back at around 2:20 and show the :: usage for static methods. Please highlight those usages in the HTML output, not in the class.

Please let me know if you have any questions on the above changes.

Thanks

jonathanbossenger avatar Sep 17 '24 12:09 jonathanbossenger

hi @jonathanbossenger thank you for your feedback and here is the updated video, thank you πŸ™

agiljulio avatar Sep 18 '24 22:09 agiljulio

Thanks @agiljulio

I'll leave this issue open until the end of next week, for anyone else who wants to review.

jonathanbossenger avatar Sep 19 '24 07:09 jonathanbossenger

Thanks @agiljulio I've opened the lesson up for the rest of the training team to review.

jonathanbossenger avatar Sep 19 '24 18:09 jonathanbossenger

Tutorial/Lessons Review Checklist

Please tick all items you've confirmed:

  • [x] Learning outcomes/objectives are clear.
  • [x] Technical concepts introduced in the content are accurate.
  • [x] The speed of demonstrations are easy to follow.
  • [x] The narration audio matches what is shown visually.
  • [x] Spelling and grammar are correct.
  • [x] Sound quality is consistent throughout the video.
  • [x] Brand Usage Guidelines and Promotional Guidelines are being followed.
  • [x] Media assets are all in the public domain (CC0).

troychaplin avatar Sep 19 '24 22:09 troychaplin

I just watched this video over a few times and it's really well put together. Clear and to the point without being complicated, and done at a great pace.

troychaplin avatar Sep 19 '24 22:09 troychaplin

Tutorial/Lessons Review Checklist

Please tick all items you've confirmed:

  • [x] Learning outcomes/objectives are clear.
  • [x] Technical concepts introduced in the content are accurate.
  • [x] The speed of demonstrations are easy to follow.
  • [x] The narration audio matches what is shown visually.
  • [x] Spelling and grammar are correct.
  • [x] Sound quality is consistent throughout the video.
  • [x] Brand Usage Guidelines and Promotional Guidelines are being followed.
  • [x] Media assets are all in the public domain (CC0).

Really enjoyed this lesson! The audio is clear, the pace is easy to follow, and I especially enjoyed the animated elements pointing out the relevant code blocks/lines being discussed.

MichelleBlanchette avatar Sep 21 '24 12:09 MichelleBlanchette

@agiljulio I am going to prepare this to be published this week. I will upload the thumbnail here for you tomorrow.

jonathanbossenger avatar Oct 08 '24 07:10 jonathanbossenger