[Fix] Triggering deploys from WordPress mobile apps#2
Conversation
|
Hello, Do you have a timeline for merging this into the main branch and having this update in the Wordpress app directory? I think it's a fix for my issue and I'm wondering if I could update my plugin through the normal channel soon, or if I should just download this branch now. |
|
Hey there @zekecato ! I just released an update to the plugin which contains the fix. I apologize for the time I took in order to merge this, I had plans to work on some more features of the plugin and then update altogether, but couldn't make time to do so. I didn't realize other users were encountering this as well so I updated as soon as I saw your comment. Please let me know if this fixes your issue. If in case it doesn't, feel free to create an issue and I'll be happy to look into it. Hope this helps. Kind regards, |
|
Thanks, Nahid! This did fix my issue. It was just the case of needing non-admin users to be able to trigger builds. I appreciate this clean and simple plugin. Happy trails, |
|
Hi, @zekecato ! I'm glad that resolved your issue. Also, I’m very happy to hear that this plugin was useful to you, thank you for the kind words! I’d really appreciate it if you could share your feedback regarding the plugin in the form of a review so that it can help other users seeking a similar solution. Thank you very much! Kind regards, |
Description
This PR fixes #1 where @sahandnayebaziz reported that edits from WordPress mobile apps were not being triggered.
Cause
Before the deploy trigger action was fired with the
save_posthook, we're currently doing a user role check to make sure the current user is an admin. For some reason, that user check is failing on the mobile apps (we're exactly not sure why as I don't have much knowledge about the WordPress mobile apps and the XML-RPC API).Solution
Upon further considerations, we realized that the user role check is not really necessary here as users without the admin role can also publish/edit posts (e.g. editor, author). As a result, we've removed the user role check in this and according to my tests and of @sahandnayebaziz, triggers from the mobile apps are now working.
⭐️Special props to @sahandnayebaziz for reporting this issue and for testing the solution.