Title: Woocommerce: Multiple PHP errors in Site
Last modified: August 31, 2016

---

# Woocommerce: Multiple PHP errors in Site

 *  [dacano_1990](https://wordpress.org/support/users/dacano_1990/)
 * (@dacano_1990)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-multiple-php-errors-in-site/)
 * Hi everyone, This site of mine was running all this while suddenly this morning,
   it had reverted to the twentyfifteen theme. So looking through the admin, I noticed
   the old theme was broken. I re-uploaded the theme, and now I get the following
   errors:
 * > PHP Warning: in_array() expects parameter 2 to be array, string given
 * > PHP Warning: in_array() expects parameter 2 to be array, string given
 * > PHP Fatal error: Call to undefined function WC()
 * This is for the first error The second error code is similar to this
 *     ```
       if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
       function trizzy_woocommerce_recent_products( $atts, $content ) {
           extract(shortcode_atts(array(
               'orderby'=> 'date',
               'order'=> 'DESC',
               'per_page'  => '12',
               'category'  => '',
               'ids' => '',
               ), $atts));
   
       global $woocommerce, $product;
       ```
   
 * This is for the third error:
 *     ```
       <div class="cart-btn">
           <a href="#" class="button adc"><?php echo WC()->cart->get_cart_subtotal(); ?></a>
           </div>
       ```
   

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

 *  [tim.vodien](https://wordpress.org/support/users/timvodien/)
 * (@timvodien)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-multiple-php-errors-in-site/#post-7172386)
 * Have you tried updating your Woocommerce plugin? This error can occur when you
   are on a outdated version of WooCommerce.
 * You may want to refer to this [article](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-wc-2?replies=4).
 * Also, it would be best to post this in [WordPress Plugin and Hacks Forum](https://wordpress.org/support/forum/plugins-and-hacks)
   since there are a lot of plugin authors subscribed to it.
 *  Thread Starter [dacano_1990](https://wordpress.org/support/users/dacano_1990/)
 * (@dacano_1990)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-multiple-php-errors-in-site/#post-7172387)
 * Hi Tim, Thanks, I will post this question in the plugin and hacks thread.

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

The topic ‘Woocommerce: Multiple PHP errors in Site’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [dacano_1990](https://wordpress.org/support/users/dacano_1990/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-multiple-php-errors-in-site/#post-7172387)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
