Body: <ul>
  <li>WordPress v5.6.1</li>
  <li>CiviCRM 5.34.0</li>
  <li>php 7.3</li>
  <li>No custom extensions that affect contributions except CiviDiscount.</li>
  </ul>
  <p>When I try to add a new contribution or view contributions, I get an error and the log files have the following:</p>
  <pre><code>PHP Fatal error:  Only variables can be passed by reference in /home/xxx/www/www/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php on line 684
  PHP Warning:  Declaration of CRM_Contribute_BAO_Contribution::getExportableFieldsWithPseudoConstants() should be compatible with CRM_Core_DAO::getExportableFieldsWithPseudoConstants($baoClass) in /home/xxx/www/www/civicrm_custom/php/CRM/Contribute/BAO/Contribution.php on line 33
  </code></pre>
  <p>It's also affecting groups so they won't load the contacts but I can view the group settings/Manage groups page.</p>
  <p>If I disable the CiviContribute component, it all works fine.</p>
  <p>Under the WordPress Site Health page, there are some php warnings but I don't know enough to know whether any of these would affect CiviCRM, e.g.</p>
  <blockquote>
  <p>An active PHP session was detected<br />
  A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.</p>
  </blockquote>
  <blockquote>
  <p>The REST API encountered an error<br />
  The REST API request failed due to an error.
  Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)</p>
  </blockquote>
  <blockquote>
  <p>Your site could not complete a loopback request<br />
  The loopback request to your site failed, this means features relying on them are not currently working as expected.
  Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)</p>
  </blockquote>
  <p>I did try the site with php7.4 but that made no difference. From the error log, it looks like this has been happening since I upgraded the site to 5.33.2 in January. I ran another update today to 5.34.0 but that's not made a difference.</p>
  <p>Any ideas would be gratefully received!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-14T18:52:45.720Z
Comments.Text: Immediately below the error in the CiviCRM logs there should be a "backtrace" - it will have the same timestamp.  Could you please edit your question to include every line in the backtrace (that is, everything up to the next timestamped entry)?  This will help people understand if an extension is causing this, etc.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-14T21:41:10.953Z
Comments.Text: @JonG-MegaphoneTech Just checked and there's no backtrace recorded when I enable Contributions or when I try to open a page that triggers the error (e.g. Contributions > New Contribution). Only errors are recorded in the WordPress logs
Comments.UserDisplayName: Rose Lanigan
Tags: <wordpress><civicontribute><php>
Title: Contributions in WordPress causing fatal errors
ThreadText: # Contributions in WordPress causing fatal errors
  
  (Asked by: username_0 on 2021-02-14)
  
  * WordPress v5.6.1
  * CiviCRM 5.34.0
  * php 7.3
  * No custom extensions that affect contributions except CiviDiscount.
  
  When I try to add a new contribution or view contributions, I get an error and the log files have the following:
  
  ```
  PHP Fatal error:  Only variables can be passed by reference in /home/xxx/www/www/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php on line 684
  PHP Warning:  Declaration of CRM_Contribute_BAO_Contribution::getExportableFieldsWithPseudoConstants() should be compatible with CRM_Core_DAO::getExportableFieldsWithPseudoConstants($baoClass) in /home/xxx/www/www/civicrm_custom/php/CRM/Contribute/BAO/Contribution.php on line 33
  
  ```
  
  It's also affecting groups so they won't load the contacts but I can view the group settings/Manage groups page.
  
  If I disable the CiviContribute component, it all works fine.
  
  Under the WordPress Site Health page, there are some php warnings but I don't know enough to know whether any of these would affect CiviCRM, e.g.
  
  > An active PHP session was detected  
  > A PHP session was created by a session\_start() function call. This interferes with REST API and loopback requests. The session should be closed by session\_write\_close() before making any HTTP requests.
  
  > The REST API encountered an error  
  > The REST API request failed due to an error.
  > Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http\_request\_failed)
  
  > Your site could not complete a loopback request  
  > The loopback request to your site failed, this means features relying on them are not currently working as expected.
  > Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http\_request\_failed)
  
  I did try the site with php7.4 but that made no difference. From the error log, it looks like this has been happening since I upgraded the site to 5.33.2 in January. I ran another update today to 5.34.0 but that's not made a difference.
  
  Any ideas would be gratefully received!
  
  **Tags:** wordpress, civicontribute, php
  
  > **Comments:**
  > **username_1**: Immediately below the error in the CiviCRM logs there should be a "backtrace" - it will have the same timestamp.  Could you please edit your question to include every line in the backtrace (that is, everything up to the next timestamped entry)?  This will help people understand if an extension is causing this, etc.  
  > **username_0**: @username_1 Just checked and there's no backtrace recorded when I enable Contributions or when I try to open a page that triggers the error (e.g. Contributions > New Contribution). Only errors are recorded in the WordPress logs  
  
  ---
  
  ## 0 answers
  
  