Title: Warning: Array to string conversion in pluggable.php
Last modified: January 26, 2023

---

# Warning: Array to string conversion in pluggable.php

 *  [rentyl](https://wordpress.org/support/users/rentyl/)
 * (@rentyl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/warning-array-to-string-conversion-in-pluggable-php/)
 * Hi,
 * This erroe appeared on the top of my site.
 * _Warning: Array to string conversion in /home/klimatis/public\_html/wp-includes/
   pluggable.php on line 2279_
 * I have checked line 2279: $nonce = (string) $nonce;
 * Full code:
 *     ```wp-block-code
       if ( ! function_exists( 'wp_verify_nonce' ) ) :
       	/**
       	 * Verifies that a correct security nonce was used with time limit.
       	 *
       	 * A nonce is valid for 24 hours (by default).
       	 *
       	 * @since 2.0.3
       	 *
       	 * @param string     $nonce  Nonce value that was used for verification, usually via a form field.
       	 * @param string|int $action Should give context to what is taking place and be the same when nonce was created.
       	 * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
       	 *                   2 if the nonce is valid and generated between 12-24 hours ago.
       	 *                   False if the nonce is invalid.
       	 */
       	function wp_verify_nonce( $nonce, $action = -1 ) {
       		$nonce = (string) $nonce;
       		$user  = wp_get_current_user();
       		$uid   = (int) $user->ID;
       		if ( ! $uid ) {
       			/**
       			 * Filters whether the user who generated the nonce is logged out.
       			 *
       			 * @since 3.5.0
       			 *
       			 * @param int        $uid    ID of the nonce-owning user.
       			 * @param string|int $action The nonce action, or -1 if none was provided.
       			 */
       			$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
       		}
   
       		if ( empty( $nonce ) ) {
       			return false;
       		}
   
       		$token = wp_get_session_token();
       		$i     = wp_nonce_tick( $action );
   
       		// Nonce generated 0-12 hours ago.
       		$expected = substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
       		if ( hash_equals( $expected, $nonce ) ) {
       			return 1;
       		}
   
       		// Nonce generated 12-24 hours ago.
       		$expected = substr( wp_hash( ( $i - 1 ) . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
       		if ( hash_equals( $expected, $nonce ) ) {
       			return 2;
       		}
   
       		/**
       		 * Fires when nonce verification fails.
       		 *
       		 * @since 4.4.0
       		 *
       		 * @param string     $nonce  The invalid nonce.
       		 * @param string|int $action The nonce action.
       		 * @param WP_User    $user   The current user object.
       		 * @param string     $token  The user's session token.
       		 */
       		do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token );
   
       		// Invalid nonce.
       		return false;
       	}
       endif;
       ```
   

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

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/warning-array-to-string-conversion-in-pluggable-php/#post-16412780)
 * Try [manually resetting your plugins](https://wordpress.org/support/article/faq-troubleshooting/#how-to-deactivate-all-plugins-when-not-able-to-access-the-administrative-menus)(
   no Dashboard access required). If that resolves the issue, reactivate each one
   individually until you find the cause.
 * If that does not resolve the issue, access your server via [SFTP or FTP](https://wordpress.org/support/article/ftp-clients/),
   or a file manager in your hosting account’s control panel (consult your hosting
   provider’s documentation for specifics on these), navigate to /wp-content/themes/
   and rename the directory of your currently active theme. Hopefully, this will
   force the default theme to activate and rule out a theme-specific issue (theme
   functions can interfere like plugins).
 *  Thread Starter [rentyl](https://wordpress.org/support/users/rentyl/)
 * (@rentyl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/warning-array-to-string-conversion-in-pluggable-php/#post-16414010)
 * Thank you very much for the answer.
 * It turned out **Page scroll to id** plugin causing the problem.
 * Is there anything I can do?
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/warning-array-to-string-conversion-in-pluggable-php/#post-16415213)
 * I recommend reporting the issue at [https://wordpress.org/support/plugin/page-scroll-to-id/](https://wordpress.org/support/plugin/page-scroll-to-id/)
   so the plugin’s developers and support community can help you with this.

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

The topic ‘Warning: Array to string conversion in pluggable.php’ is closed to new
replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/warning-array-to-string-conversion-in-pluggable-php/#post-16415213)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
