Answers.Body: <p>I have seen this error before with this plugin.   The CiviCRM cron job will fail if while bootstrapping WP a fatal error is encountered.  </p>
  
  <p>My only workaround (besides removing the plugin as you did), is to launch the cron job via wp-cli.  See <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs" rel="nofollow">http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs</a> and the section on wp-cli.   In this case the flag --skip-plugins can be used to stop the addthis plugin from loading.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-08T04:40:05.487Z
Answers.Text: This is correct.  Calling CiviCRM involves bootstrapping the CMS, which in most case means calling plugins.  I've found that newer versions of AddThis for WordPress also break the CiviCRM API via REST.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-08T08:48:45.757Z
Answers.Text: My best guess is that this is a scope issue. `$addThisConfigs` is not explicitly declared as a global in the plugin loader file. When WP is bootstrapped from within a Civi function it is not global in scope, thus failing to be properly referenced when `Class AddThis_addjs_sharing_button_plugin` is instantiated. Coleman: perhaps try explicitly declaring `global $addThisConfigs` at the top of addthis_social_widget.php?
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-08T01:43:02.463Z
Answers.LastActivityDate: 2015-07-08T01:43:02.463Z
Answers.UserDisplayName: Kevin Cristiano
Body: <p>I updated AddThis for Wordpress 4.0.7 to AddThis Sharing Buttons 5.0.7 and scheduled emails stopped sending. I determined that the cron job was getting a fatal error. </p>
  
  <p>Job path -  "<a href="https://www.xxxxxx.org/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php" rel="nofollow">https://www.xxxxxx.org/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php</a></p>
  
  <p><b>Fatal error</b>:  Call to a member function getConfigs() on a non-object in <b>/home/xxxxxx/public_html/wordpress/wp-content/plugins/addthis/addthis_addjs_new.php</b> on line <b>57</b><br /></p>
  
  <p>Here is a snip from the file that caused the error:</p>
  
  <pre><code>    // We haven't added our JS yet. Or at least better not have.
      $this-&gt;_js_added = false;
  
  LINE 57:       $this-&gt;_options = $addThisConfigs-&gt;getConfigs();
  
      // Version of AddThis code to use
      $this-&gt;atversion = $this-&gt;_options['atversion'];
  </code></pre>
  
  <p>The cron job was referencing a file in our AddThis plugin folder. It seems to me that file and plugin should have nothing to do with sending email from CiviCRM. I am not well versed in how cron jobs work, so any information you can provide would be appreciated. The day that this plugin was updated to the latest version 5.0.7, which included the file shown in the fatal error above, is the day scheduled jobs stopped sending and the cron job started erroring out. I deleted the updated plugin and reinstalled 4.0.7, the known good version, which did not contain that file. Scheduled emails now send.</p>
  
Tags: <wordpress><email><cron-job><scheduling>
Title: Cron job fatal error - scheduled emails won't send. AddThis 5.0.7 issue
ThreadText: # Cron job fatal error - scheduled emails won't send. AddThis 5.0.7 issue
  
  (Asked by: username_0 on 2015-07-08)
  
  I updated AddThis for Wordpress 4.0.7 to AddThis Sharing Buttons 5.0.7 and scheduled emails stopped sending. I determined that the cron job was getting a fatal error. 
  Job path -  "https://www.xxxxxx.org/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php
  Fatal error:  Call to a member function getConfigs() on a non-object in /home/xxxxxx/public_html/wordpress/wp-content/plugins/addthis/addthis_addjs_new.php on line 57
  Here is a snip from the file that caused the error:
      // We haven't added our JS yet. Or at least better not have.
      $this->_js_added = false;
  
  LINE 57:       $this->_options = $addThisConfigs->getConfigs();
  
      // Version of AddThis code to use
      $this->atversion = $this->_options['atversion'];
  
  The cron job was referencing a file in our AddThis plugin folder. It seems to me that file and plugin should have nothing to do with sending email from CiviCRM. I am not well versed in how cron jobs work, so any information you can provide would be appreciated. The day that this plugin was updated to the latest version 5.0.7, which included the file shown in the fatal error above, is the day scheduled jobs stopped sending and the cron job started erroring out. I deleted the updated plugin and reinstalled 4.0.7, the known good version, which did not contain that file. Scheduled emails now send.
  
  **Tags:** wordpress, email, cron-job, scheduling
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-07-08. Score: 2
  
  I have seen this error before with this plugin. The CiviCRM cron job will fail if while bootstrapping WP a fatal error is encountered.
  
  My only workaround (besides removing the plugin as you did), is to launch the cron job via wp-cli. See <http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs> and the section on wp-cli. In this case the flag --skip-plugins can be used to stop the addthis plugin from loading.
  
  > **Comments:**
  > **username_2**: This is correct.  Calling CiviCRM involves bootstrapping the CMS, which in most case means calling plugins.  I've found that newer versions of AddThis for WordPress also break the CiviCRM API via REST.  
  > **username_3**: My best guess is that this is a scope issue. `$addThisConfigs` is not explicitly declared as a global in the plugin loader file. When WP is bootstrapped from within a Civi function it is not global in scope, thus failing to be properly referenced when `Class AddThis_addjs_sharing_button_plugin` is instantiated. Coleman: perhaps try explicitly declaring `global $addThisConfigs` at the top of addthis_social_widget.php?  
  
  ---
  
  