Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Theme_Readme (readme.txt) PHP class #626

Merged
merged 11 commits into from
May 13, 2024

Conversation

matiasbenedetto
Copy link
Contributor

@matiasbenedetto matiasbenedetto commented May 10, 2024

What?

  • Refactor ThemeReadme (readme.txt) class to make it more modular, re-usable, and testable.
  • Add tests for their public methods in WordPress core codebase fashion.

Why?

@matiasbenedetto matiasbenedetto added the enhancement New feature or request label May 10, 2024
Comment on lines 28 to 29
* Build a readme.txt file for CHILD/GRANDCHILD themes.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also builds one for BLANK themes, so probably drop the "for CHILD/GRANDCHILD themes" part

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed here: 3e1bd60

@matiasbenedetto matiasbenedetto changed the title Refactor ThemeReadme (readme.txt) PHP class Refactor Theme_Readme (readme.txt) PHP class May 10, 2024
@pbking
Copy link
Contributor

pbking commented May 13, 2024

I found that the "Recommend Plugins" wasn't being sent back to the client (though it was being persisted if edited from the client).

I did a lil' refactoring, pulling the logic to get that and send it to the client from the "utils" class to the "readme" class and had it pull all the sections, not just look exclusively for the "recommended plugins" section.

Copy link
Contributor

@pbking pbking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is working great! Code looks great, huge improvement.

If you're OK with my additions then I think this is ready to come in!

@matiasbenedetto
Copy link
Contributor Author

I found that the "Recommend Plugins" wasn't being sent back to the client (though it was being persisted if edited from the client).

Haha yep, I created an issue about the same #631

I did a lil' refactoring, pulling the logic to get that and send it to the client from the "utils" class to the "readme" class and had it pull all the sections, not just look exclusively for the "recommended plugins" section.

Cool, good addition.

@matiasbenedetto matiasbenedetto merged commit 7aed6ce into trunk May 13, 2024
2 checks passed
@matiasbenedetto matiasbenedetto deleted the improve/readme-class branch May 13, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
2 participants