Title: Code snippets error 582 &#8211; Creating big server load
Last modified: May 25, 2023

---

# Code snippets error 582 – Creating big server load

 *  Resolved [dav74](https://wordpress.org/support/users/dav74/)
 * (@dav74)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/)
 * Hello,
 * We have an issue with the snippets plugin. It is creating a very large server
   load with thousands of error messages (all the same). I already see another user
   has also spotted this. Screenshot: [https://ibb.co/12FZZHY](https://ibb.co/12FZZHY)
 * We need a fix ASAP. Thank you

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

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16769792)
 * Hi [@dav74](https://wordpress.org/support/users/dav74/),
 * This is a bug in one of your snippets, not in the core plugin. It’s not something
   we can fix on our end.
 * You should be able to narrow down which snippet it is by doing a search for `
   total @line:5`. Feel free to post the code here if you’d like help fixing the
   problem.
 *  Thread Starter [dav74](https://wordpress.org/support/users/dav74/)
 * (@dav74)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16769992)
 * Hi [@bungeshea](https://wordpress.org/support/users/bungeshea/)
 * many thanks for your reply! Ok that’s interesting. Apologies for jumping to conclusions.
   Can you tell me how I start narrowing down which snippet it is, if I have like
   30 snippets? Are you saying that the snippet in question has “total @ line:5”
   in it?
 *  Thread Starter [dav74](https://wordpress.org/support/users/dav74/)
 * (@dav74)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16770103)
 * Hi [@bungeshea](https://wordpress.org/support/users/bungeshea/)
 * OK I have looked at all of the 23 published snippets we have but none of them
   contain `total @line:5` I am not sure what exactly I am suppose to be looking
   for. Can you please advise here so I can find out which snippet is causing the
   issue?
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16770444)
 * [@dav74](https://wordpress.org/support/users/dav74/) the snippet itself won’t
   contain `total @line:5` – that’s just a search term you can put in the search
   box on the Snippets menu to narrow down the list.
 * If you’re searching through manually, you should look for a snippet that contains
   the term `total` on line 5 of the code.
 *  Thread Starter [dav74](https://wordpress.org/support/users/dav74/)
 * (@dav74)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16770483)
 * Ah! OK we’re learning with you help 🙂 That is perfect. I straight away narrowed
   it down to 2 snippets, and only one of them was published. Bingo.
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16770556)
 * Awesome, feel free to post the code here and I’ll do what I can to fix it up.
 *  Thread Starter [dav74](https://wordpress.org/support/users/dav74/)
 * (@dav74)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16770805)
 * Well if you feel like looking that would be great. Snippet below.
 *     ```wp-block-code
       add_filter( 'woocommerce_available_payment_gateways', 'disable_klarna_above_250' );
   
       function disable_klarna_above_250( $available_gateways ) {
       $maximum = 250;
       if ( WC()->cart->total > $maximum ) {
       unset( $available_gateways['klarna_payments'] );
       }
       return $available_gateways;
       }
       ```
   
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16772953)
 * You should be able to fix this by adding an `isset` check:
 *     ```wp-block-code
       add_filter(
       	'woocommerce_available_payment_gateways',
       	function ( $available_gateways ) {
       		$maximum = 250;
       		if ( isset( WC()->cart->total ) && WC()->cart->total > $maximum ) {
       			unset( $available_gateways['klarna_payments'] );
       		}
       		return $available_gateways;
       	}
       );
       ```
   
 *  Thread Starter [dav74](https://wordpress.org/support/users/dav74/)
 * (@dav74)
 * [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16774649)
 * Great will give that a go!

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

The topic ‘Code snippets error 582 – Creating big server load’ is closed to new 
replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [dav74](https://wordpress.org/support/users/dav74/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/code-snippets-error-582-creating-big-server-load/#post-16774649)
 * Status: resolved