I have developed a script that will generate an hatml page with a list of duplicated posts in my Wordpress install.
I have coded the page in a way there's a link to delete duplicates, straight away, however due to security reasons this is not allowed by design. You need to use nonces.
So I have started using wp_nonce_url function to add a nonce to my link but this would not work either.
Digging into WP code I have discovered that nonce functions in WP rely on current user, that is they call the wp_get_current_user.
What happens probably is that WP believes the user is not logged in and not allowed to get a proper nonce.
How can I code my script to bypass this? Maybe I can simulate a user log in using some WP functions?