Execute a cron as a logged in wpuser
-
Is there a way to run a php file as a logged in user via automated cron command?
Our theme prevents access to wp-content/plugins/* if the user is not logged in.
We need to have https://domain.com/wp-content/plugins/ourplugin/ourscript.php executed automated every 15 minutes, but this file is a script that changes some posts’ status from draft to publish and does some other things too.
The problem is that if i m not logged into wp and i navigate to https://domain.com/wp-content/plugins/ourplugin/ourscript.php i will get redirected back to the homepage because of the limitation of our theme.
If im logged in as admin, https://domain.com/wp-content/plugins/ourplugin/ourscript.php will execute with no problems.
So, whenever i add a lynx,php,wget,curl command on my hosting box, it doesnt execute the script because the browser is not logged in.
Is there a way to achieve this?
- The topic ‘Execute a cron as a logged in wpuser’ is closed to new replies.