Title: user_unread_privmsg php warning
Last modified: January 12, 2026

---

# user_unread_privmsg php warning

 *  Resolved [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [4 months, 2 weeks ago](https://wordpress.org/support/topic/user_unread_privmsg-php-warning/)
 * I see this a lot.
 * [12-Jan-2026 17:38:45 UTC] PHP Warning: Attempt to read property “user_unread_privmsg”
   on string in /home/……
 * The code I’m using is this:
 *     ```wp-block-code
       <?php global $w3all_phpbb_usession; if ($w3all_phpbb_usession->user_unread_privmsg > 0) { echo '<span class="ccccccc' . ($w3all_phpbb_usession->user_unread_privmsg > 9 ? ' ttttttt' : '') . ($w3all_phpbb_usession->user_unread_privmsg > 99 ? ' ttttt' : '') . '">' . $w3all_phpbb_usession->user_unread_privmsg . '</span>'; } ?>
       ```
   
 * The goal is to show logged-in users the number of PM notifications. The code 
   works, but I’m not sure why I’m seeing error lines in the error_log.
 * Thanks.

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

 *  Plugin Author [axew3](https://wordpress.org/support/users/axewww/)
 * (@axewww)
 * [4 months, 2 weeks ago](https://wordpress.org/support/topic/user_unread_privmsg-php-warning/#post-18783544)
 * Hello, i did not tested this by long time, anyway, before i attempt to,
 * where/how you are using this?
 * into a widget or template file or where?
 *  Plugin Author [axew3](https://wordpress.org/support/users/axewww/)
 * (@axewww)
 * [4 months, 2 weeks ago](https://wordpress.org/support/topic/user_unread_privmsg-php-warning/#post-18783566)
 * Tested it.
 * Into file, for example
 * /wp-content/plugins/wp-w3all-phpbb-integration/common/apps/phpbb_last_topics/
   render.php
 * having the widget last topics active, so adding on it your code simplified like
   this
 *     ```wp-block-code
       <?php global $w3all_phpbb_usession; 	//print_r($w3all_phpbb_usession);//exit;	if ($w3all_phpbb_usession->user_unread_privmsg > 0) { 		 $a = $w3all_phpbb_usession->user_unread_privmsg > 9 ? ' ttttttt' : '';		 $b = $w3all_phpbb_usession->user_unread_privmsg > 99 ? ' ttttt' : '';		echo '<span class="ccccccc">' . $a . $b. $w3all_phpbb_usession->user_unread_privmsg . '</span>'; } ?>
       ```
   
 * It work fine BUT
 * **NOT FOR THE USER WP ID 1** **OR phpBB USER ID 2**
 * because the UID 1 is excluded and his session is never existent, the var
 * **$w3all_phpbb_usession**
 * return always an empty string as value! So maybe it is the problem?
 * PS good point to be notified into the explain page
    -  This reply was modified 4 months, 2 weeks ago by [axew3](https://wordpress.org/support/users/axewww/).
    -  This reply was modified 4 months, 2 weeks ago by [axew3](https://wordpress.org/support/users/axewww/).
 *  Thread Starter [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/user_unread_privmsg-php-warning/#post-18810345)
 * Yes, I think the problem is the admin ID.
 * I plan to disable the admin later and use my other account, so I will be testing
   more later.
 * Could a match like 1 = 2 be made for w3all_phpbb_usession?
 *  Plugin Author [axew3](https://wordpress.org/support/users/axewww/)
 * (@axewww)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/user_unread_privmsg-php-warning/#post-18811746)
 * Yes! But there are many points where the UID 1 in WP or the phpBB UID 2 are switched.
   It can be done easily since the integration is by email, and could be cleaned
   on next version but is it really useful?

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fuser_unread_privmsg-php-warning%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/wp-w3all-phpbb-integration/assets/icon-128x128.png?rev=3375511)
 * [WP w3all phpBB](https://wordpress.org/plugins/wp-w3all-phpbb-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-w3all-phpbb-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-w3all-phpbb-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-w3all-phpbb-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-w3all-phpbb-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-w3all-phpbb-integration/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [axew3](https://wordpress.org/support/users/axewww/)
 * Last activity: [3 months, 3 weeks ago](https://wordpress.org/support/topic/user_unread_privmsg-php-warning/#post-18811746)
 * Status: resolved