Title: &quot;Execute&quot; function does not work
Last modified: August 22, 2016

---

# "Execute" function does not work

 *  Resolved [Andrej Pavlovic](https://wordpress.org/support/users/andrejpavlovic/)
 * (@andrejpavlovic)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/execute-function-does-not-work/)
 * It looks like the changes made for v1.3.1 of the plugin, affected manual execution
   of cron jobs.
 * do_action_ref_array($params[‘task’], $params[‘args’]);
    Throws an error when 
   $params[‘args’] is not an array. It seems that the args are passed through via
   ajax as a string?
 * Either way, args should be an empty array() if none are specified for that task.
 * Also, I’m not sure if it’s a good idea to pass arguments via ajax. I would think
   about getting them from _get_cron_array() inside the execute_task() function.
   Otherwise you have to be really careful about the serialization/unserealization
   of the args.
 * [https://wordpress.org/plugins/advanced-cron-manager/](https://wordpress.org/plugins/advanced-cron-manager/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [11 years ago](https://wordpress.org/support/topic/execute-function-does-not-work/#post-5931930)
 * Hi Andrej,
 * Thanks for reporting the issue.
 * I’ve secured the data passed via ajax and commited it to new version. Please 
   update.
 * Best,
    Kuba
 *  [MoeMorox](https://wordpress.org/support/users/moemorox/)
 * (@moemorox)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/execute-function-does-not-work/#post-5932157)
 * Hello,
 * I’m using 1.4 and seem to have the same error:
 * When clicking on ‘execute’ on a single-event-job, I get the following error:
 *     ```
       PHP message: PHP Warning:  array_slice() expects parameter 1 to be array, string given in wordpress/wp-includes/plugin.php on line 576
       PHP message: PHP Warning:  call_user_func_array() expects parameter 2 to be array, null given in wordpress/wp-includes/plugin.php on line 576
       ```
   
 * I debugged a little bit, and in wp-includes/plugin.php on line 536 (do_action_ref_array)
   i get the following message by the following code:
 *     ```
       if(is_string($args)) {
       		trigger_error("string:");
       		trigger_error(var_export($args, true));
       	}
   
       PHP message: PHP Notice:  string: in wordpress/wp-includes/plugin.php on line 540
       PHP message: PHP Notice:  'some@mail.tld,mailsubject,' in wordpress/wp-includes/plugin.php on line 541
       ```
   
 * in wp_schedule_single_event the $args are an array all the time. I think the 
   unserialize isn’t working the right way.
 * Can anyone reproduce this?
 * Thanks in advance!
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/execute-function-does-not-work/#post-5932158)
 * Hi,
 * Thanks for the message.
 * I’ve spot the issue and updated plugin. Please update and let me know if problem
   is still there.
 *  [MoeMorox](https://wordpress.org/support/users/moemorox/)
 * (@moemorox)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/execute-function-does-not-work/#post-5932159)
 * Hello,
 * it works now.
    Thank you very much for your effort and have a nice day.
 *  [mdbateman66](https://wordpress.org/support/users/mdbateman66/)
 * (@mdbateman66)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/execute-function-does-not-work/#post-5932168)
 * This functions appears to be broken again. The error thrown now is…
 *     ```
       Object { action: "acm_execute_task", task: "zc_quiz_do_batch_report_hook", args: "", noonce: "9ddff7af30" }
       SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
       m.parseJSON()
        load-scripts.php:5
       e.parseJSON()
        load-scripts.php:8
       <anonymous>
        ajax.js:303
       m.Callbacks/j()
        load-scripts.php:2
       m.Callbacks/k.fireWith()
        load-scripts.php:2
       x()
        load-scripts.php:5
       .send/b()
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘"Execute" function does not work’ is closed to new replies.

 * ![](https://ps.w.org/advanced-cron-manager/assets/icon.svg?rev=3096140)
 * [Advanced Cron Manager - debug & control](https://wordpress.org/plugins/advanced-cron-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-cron-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-cron-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-cron-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-cron-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-cron-manager/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [mdbateman66](https://wordpress.org/support/users/mdbateman66/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/execute-function-does-not-work/#post-5932168)
 * Status: resolved