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

Make OneSignal Wordpress compatible with Yoast Duplicate Posts Plugin #279

Open
piscis opened this issue Aug 10, 2021 · 2 comments
Open

Comments

@piscis
Copy link

piscis commented Aug 10, 2021

Description:
Hi this is a kinda feature request.

We would like to use OneSignal Wordpress together with Yoast Duplicate Post plugin (currently 3 Mio. installations). The Plugin allows to schedule updates to existing posts. This is done by duplicating a post and keep a reference to the original post in the database. Yoast calls this "Rewrite & Republish". When a post is finally schedule for publishing it copies over the draft data to the original post.

More infos can be found here: https://yoast.com/wordpress/plugins/duplicate-post/#what-does

The problem we are facing at the moment is that everytime a post ist schedule for republish it will send the push notification with the url of the draft post. We think it would be possible to check if the post currently getting publish is draft from Yoast Duplicate Post in that case we would use the original instead of the draft url.

Steps to Reproduce Issue:

  1. Install Yoast Duplicate Post and activate the plugin
  2. Make sure that the Rewrite & Republish feature is active in the plugin settings
  3. Create a Post and publish it with slug "/example"
  4. Go to Post list and click on "Rewrite & Republish"
  5. Make some changes and schedule the republish version + activate a push notification
  6. Wait for the push notification to get published
  7. Check the url of the push notification it should have a url like /example-1
  8. If you click on the push notification you should receive a 404 page (because it used the draft url)

Anything else:

To make this work we're currently investigating a solution to use the onesignal_send_notification filter hook to check the current post if its a draft from yoast duplicate post and then change the push notification url to the original post URL. But it would be super awesome if onesignal could do this out of the box.

If you interested to make the plugin compatible we can also provide a PR.

@jkasten2
Copy link
Member

@piscis Thanks for digging in and producing the issue, as well providing steps to reproduce the issue. We haven't verified the Yoast plugin yet, we would be open to a PR if your are interested providing one to address this issue. Thanks.

@piscis
Copy link
Author

piscis commented Aug 11, 2021

Greet 👍 @jkasten2 I opened a PR (#280). This is basically a extract from what we are doing with the onesignal_send_notification filter to get the correct url durring publication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants