Title: Error in wp-includes/functions.php
Last modified: August 20, 2016

---

# Error in wp-includes/functions.php

 *  [GusRuss89](https://wordpress.org/support/users/gusruss89/)
 * (@gusruss89)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/error-in-wp-includesfunctionsphp-1/)
 * Hi there,
 * I’m running WordPress v3.4.2 and WooCommerce v1.6.5.2 (both latest versions).
 * Something was making my sessions expire whenever I tried to check-out after adding
   a product to the cart, so I turned wp-debug on.
 * I’m getting the following two errors:
 * > Notice: wp_register_script was called incorrectly. Scripts and styles should
   > not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts,
   > or init hooks. Please see Debugging in WordPress for more information. (This
   > message was added in version 3.3.) in /home/vexbrand/public_html/wp-includes/
   > functions.php on line 2758
   > Warning: session_start() [function.session-start]: Cannot send session cache
   > limiter – headers already sent (output started at /home/vexbrand/public_html/
   > wp-includes/functions.php:2758) in /home/vexbrand/public_html/wp-content/plugins/
   > woocommerce/woocommerce.php on line 138
 * Strangely, they’re in core files (both of WordPress and of the Plugin).
 * Does anyone have any idea what might be causing these errors?
 * Thanks

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

 *  Thread Starter [GusRuss89](https://wordpress.org/support/users/gusruss89/)
 * (@gusruss89)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/error-in-wp-includesfunctionsphp-1/#post-3115660)
 * Here’s the function that includes line 2758 (line 2758 is the line starting with
   trigger_error).
 *     ```
       /**
        * Marks something as being incorrectly called.
        *
        * There is a hook doing_it_wrong_run that will be called that can be used
        * to get the backtrace up to what file and function called the deprecated
        * function.
        *
        * The current behavior is to trigger a user error if WP_DEBUG is true.
        *
        * @package WordPress
        * @subpackage Debug
        * @since 3.1.0
        * @access private
        *
        * @uses do_action() Calls 'doing_it_wrong_run' and passes the function arguments.
        * @uses apply_filters() Calls 'doing_it_wrong_trigger_error' and expects boolean value of true to do
        *   trigger or false to not trigger error.
        *
        * @param string $function The function that was called.
        * @param string $message A message explaining what has been done incorrectly.
        * @param string $version The version of WordPress where the message was added.
        */
       function _doing_it_wrong( $function, $message, $version ) {
   
       	do_action( 'doing_it_wrong_run', $function, $message, $version );
   
       	// Allow plugin to filter the output error trigger
       	if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
       		$version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
       		$message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
       		trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
       	}
       }
       ```
   
 *  [Rachel Baker](https://wordpress.org/support/users/rachelbaker/)
 * (@rachelbaker)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/error-in-wp-includesfunctionsphp-1/#post-3115662)
 * Where are you calling wp_register_script?
 * In your theme?

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

The topic ‘Error in wp-includes/functions.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Rachel Baker](https://wordpress.org/support/users/rachelbaker/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/error-in-wp-includesfunctionsphp-1/#post-3115662)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
