• 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

    (@gusruss89)

    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 ) );
    	}
    }

    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.