-
Notifications
You must be signed in to change notification settings - Fork 10
Given the plugin a shape #20
base: main
Are you sure you want to change the base?
Conversation
Hello again @szepeviktor |
@timothyjensen Look! 👀 It is like a rebirth. |
Development continues 🚀 e.g. with a search for container ... |
@curquiza I was struggling with the injector for days. Now it is in place. Could you read my code? |
Please be aware that I've already received feedback like
:) |
Hello @szepeviktor I'll let @eskombro check this PR since he was one of the authors of this repo. |
I just want a confirmation that this code meets your expectations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @szepeviktor!
I am really excited about this huge improvement you are introducing to this plugin and repo, thanks a lot! The project structure and the code readability and in-code documentation are just great!
I checked what you are doing on this PR, but sadly I couldn't test it because it is not possible yet to activate the plugin on the wp-admin dashboard, I got a fatal error (or am I missing something?). In case you think I should be able to run it already, would you mind giving me an idea of the steps you follow to install / activate?
I also got curious about your extension phpstan-wordpress. I see it has got some attention on GitHub, congrats! (I just gave it one more star ⭐ )
My advice would be to try and finish a very basic plugin, something like an MVP that we can run and test, and after that introduce the changes gradually, instead of ending up with one single big change to switch it all at once, what do you think?
Anyways, amazing work, thanks again! 🎉
All right - all right. Running the plugin is the last step of me writing code. |
Oh, that's fine, I just wanted to be sure that I wasn't missing something :)
I don't see any reason why it wouldn't work, and I have seen a few examples (even some small articles talking about it like this one)but this is why I think it would be better to try and run a very basic version of it and make sure everything works together, and then add all the specific functionality, so in case there is a problem with the main plugin structure or some other issue we are not thinking about, we can realize that and correct it early enough! |
I am very 😢 sad, Samuel. That article. function __construct( $config ) {
$this->api_key = $config['api_key'];
add_filter( 'the_content', array( $this, 'form' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'assets' ) );
add_action( 'wp_ajax_msf_form_submit', array( $this, 'submissionHandler' ) );
add_action( 'wp_ajax_nopriv_msf_form_submit', array( $this, 'submissionHandler' ) );
} This is also procedural code masqueraded in a class. Very sad. People are unable to think. |
Before writing code I've made sure I rule the plugin. All its functionality is in my hand, in a tight grip. |
Don't be sad :D This article is indeed just a guide for people who want to transform their procedural way of coding plugins into OOP, so it is focused on that transition. But it just a simple example. I don't see any reason to be worried about any OOP principles causing problems on Wordpress plugin development, I have seen polymorphism, inheritance, interfaces, association, abstraction... So it feels safe to me, do you have any specific concern? Also, don't be sad :) |
Yes. Reader are made believe that putting functions into a class is called OOP. An object is a sovereign entity able to do all of its duties without any outside help. |
Hahaha, I agree, but let me rephrase: Do you have any concern regarding the MeiliSearch plugin implementation concerning OOP? :) |
See the immutable configuration class, that is OOP. |
No, I strive to eliminate all traces of "WordPress programing" as much as I can. |
Hello @szepeviktor! |
Yes, I need to wake up!! |
Take your time, it's ok 🙂 I just needed to know! |
I have no schedule ❌📆 |
Should the post not be deleted when it is changes from published to draft? if ($post->post_status !== 'publish') {
return $this->deletePostFromIndex($post->ID);
}
$this->indexPost($post); |
You are right. |
Hello @szepeviktor and @thijndehaas FYI we chose to stop working on the meilisearch-wordpress plugin. It does not mean we will not continue the work in the future, but this is currently not the priority :) Sorry for this, and thanks for your work and comments :) |
Thank you for that Clémentine! |
Feel completely free to publish the plugin on your side! 😄 We appreciate our community's work around Meilisearch! |
Closes #18
Please like, share and subscribe!