crstauf
Forum Replies Created
-
Forum: Plugins
In reply to: [Action Scheduler] How do I notify to Action that my process is complete?I ran into this the other day, where I wanted to indicate an action had failed (couldn’t retrieve third-party data for example), and to mark it as failed, while enqueuing an async action to try again.
Forum: Plugins
In reply to: [Action Scheduler] Pending items never runYou’re welcome! ???♂?
Forum: Plugins
In reply to: [Action Scheduler] Pending items never runAlso keep in mind that standard WP-Cron is triggered by traffic to the site, so pending actions will only run upon page load.
Forum: Plugins
In reply to: [Action Scheduler] Pending items never runOkay, that’s likely the problem: standard WP-Cron typically doesn’t work if there’s HTTP authentication in place. There are a few plugins that create a GUI for you to add the username and password, or you can hard-code the header on the cron request.
This plugin provides a GUI, and browsing the code will show you how to hard-code the header for the cron request:
Forum: Plugins
In reply to: [Action Scheduler] Pending items never runA couple things to check:
- Is the staging site protected with HTTP authentication?
- Is Alternate WP-Cron setup, or standard WP-Cron?
- Are there any completed items?
Forum: Plugins
In reply to: [Action Scheduler] One schedule or Multiple?@stevejonesdev If you go the batch route, I think using a meta key to identify which posts have been scanned is the best approach. With this approach, you can have only one action scheduled, and that action spawns additional actions until all the posts have been parsed.
From what I know I don’t see how there’d be a performance issue simply due to the number of actions, if the actions were handled appropriately and server resources were sufficient, but @kosiew is official plugin support so probable has more information than I do.
Forum: Plugins
In reply to: [Action Scheduler] One schedule or Multiple?@stevejonesdev You would certainly get better performance if you had an individual scheduled action for each post, mostly in that if there was a failure (like a server timeout) it would retry and pick up where the error occurred. A cron-like scheduled action would probably be your best option.
You could probably get similar performance to batch process posts (like 10 at a time); finer details are up to you to evaluate and test on your environment(s).
Forum: Plugins
In reply to: [Action Scheduler] How to use this plugin to schedule and action or hook@formalxcom The documentation for Action Scheduler describes several functions to use to schedule actions.
Forum: Plugins
In reply to: [Action Scheduler] Not purging Failed actions@elektrobank There’s an issue for this, so for now you’d need to write yourself.
Forum: Plugins
In reply to: [Action Scheduler] How to log the result of an action?@elektrobank The first parameter passed in the
action_scheduler_after_execute
,action_scheduler_failed_execution
, andaction_scheduler_failed_validation
actions is the action’s ID. You’ll probably want to use a WordPress option or transient, maybe post meta depending on what your use is. Best to leave Action Scheduler’s tables alone.Forum: Plugins
In reply to: [Action Scheduler] How to log the result of an action?@elektrobank In my uses I do
throw new Exception( 'Exception message' )
and ‘Exception message’ shows in the Logs column as the reason for the failure.Perhaps better for you to indicate what it is you’re trying to do than to speak generally.
Forum: Plugins
In reply to: [Action Scheduler] How to log the result of an action?@elektrobank In the WordPress admin: Tools > Scheduled Actions.
Forum: Plugins
In reply to: [Action Scheduler] How to log the result of an action?@elektrobank Using the hooks you asked about previously would allow you to store the result elsewhere. You could also define a custom logger I believe, but I’ve no experience with that.
Also, worth noting, that the exception message is shown in the list table of Scheduled Actions, in the Log column.
Forum: Plugins
In reply to: [Action Scheduler] Completion/progress hooks?How can I call a function when a row has been processed? Is there a hook I can tap into that will tell me every time a row has been processed and then I can just check the remaining jobs each time?
@elektrobank The
action_scheduler_after_execute
action is likely your best option. (Note: there are also actions available if the scheduled action failed execution or validation.)Or a hook that will tell me when all the rows are processed for a specific group?
I do not think that is available;
action_scheduler_after_process_queue
action would be your closest option.Where does one find a list of all the hooks and filters available?
There does not appear to be documentation on all of the hooks and filters, though you can search the plugin’s codebase for
do_action
andapply_filters
.Forum: Fixing WordPress
In reply to: First time login failed or too long to wait@harisrozak I have similar issue when using Local by Flywheel (I think it’s called Local WP now?). Clicking the login button a second time usually pushes me into the admin area without issue.