Title: Reply To: fatal error 5.6.5 with WP 7.1 — strtolower() receives integer callback ID
Last modified: August 20, 2026

---

 *  [patsitsolutions](https://wordpress.org/support/users/patsitsolutions/)
 * (@patsitsolutions)
 * [10 hours, 52 minutes ago](https://wordpress.org/support/topic/fatal-error-5-6-5-with-wp-7-1-strtolower-receives-integer-callback-id/#post-18997905)
 * Same issue…
 * **Description:** When navigating to the WP Activity Log viewer (`/wp-admin/admin.
   php?page=wsal-auditlog`), a fatal `TypeError` occurs under PHP 8.0+ / PHP 8.3.
 * The issue stems from `WSAL\Helpers\WP_Helper::hide_unrelated_notices()`, which
   iterates over registered `admin_notices` hooks and calls `strtolower()` on callback
   identifiers^(). When third-party plugins register anonymous functions, closures,
   or dynamically generated callbacks that WordPress assigns integer/numeric identifiers
   to, passing the integer directly to `strtolower()` causes PHP 8.x to throw an
   uncaught `TypeError`^().
 * **Fatal Error Stack Trace:**
 *     ```wp-block-code
       [20-Aug-2026 05:28:54 UTC] PHP Fatal error:  Uncaught TypeError: strtolower(): Argument #1 ($string) must be of type string, int given in /var/www/html/wp-content/plugins/wp-security-audit-log/classes/Helpers/class-wp-helper.php:656Stack trace:#0 /var/www/html/wp-content/plugins/wp-security-audit-log/classes/Helpers/class-wp-helper.php(656): strtolower(1243)#1 /var/www/html/wp-content/plugins/wp-security-audit-log/classes/Helpers/class-wp-helper.php(537): WSAL\Helpers\WP_Helper::remove_unrelated_actions('admin_notices')#2 /var/www/html/wp-includes/class-wp-hook.php(353): WSAL\Helpers\WP_Helper::hide_unrelated_notices('')#3 /var/www/html/wp-includes/class-wp-hook.php(377): WP_Hook->apply_filters(NULL, Array)#4 /var/www/html/wp-includes/plugin.php(523): WP_Hook->do_action(Array)#5 /var/www/html/wp-admin/admin-header.php(151): do_action('admin_print_scr...')#6 /var/www/html/wp-admin/admin.php(244): require_once('/var/www/html/w...')#7 {main}  thrown in /var/www/html/wp-content/plugins/wp-security-audit-log/classes/Helpers/class-wp-helper.php on line 656
       ```
   
 * **Steps to Reproduce:**
    1. Run WordPress on PHP 8.2 or 8.3.
    2. Have an active plugin or theme that registers an anonymous function or integer-
       identified hook to `admin_notices`.
    3. Navigate to **WP Activity Log > Log Viewer** (`page=wsal-auditlog`).
    4. Notice the critical error screen / fatal `TypeError` in `debug.log`.
 * **Environment:**
    - **WordPress Version:** 6.x / 7.x
    - **PHP Version:** 8.3.x
    - **Plugin:** WP Activity Log (wp-security-audit-log)
 * **Suggested Fix:**
 * In `/classes/Helpers/class-wp-helper.php`, cast the parameter explicitly to a
   string or ensure it is a string/numeric value before passing it to `strtolower()`:
 *     ```wp-block-code
       // Existing:strtolower( $callback_identifier )// Suggested:strtolower( (string) $callback_identifier )
       ```
   
 * **Workaround / Temporary Hotfix Applied:**
 * To restore functionality while awaiting an upstream patch, a local type-cast 
   hotfix was applied directly to `class-wp-helper.php` inside the container:
    - **Target File:** `/wp-content/plugins/wp-security-audit-log/classes/Helpers/
      class-wp-helper.php`
    - **Modification:** Updated line 656 to explicitly typecast the hook callback
      identifier to a string prior to passing it to `strtolower()`:
 *     ```wp-block-code
       // Modified from:strtolower( $callback )// Changed to:strtolower( (string) $callback )
       ```
   
 * **Command Used:**
 *     ```wp-block-code
       sed -i 's/strtolower(\([^)]*\))/strtolower((string)\1)/g' /var/www/html/wp-content/plugins/wp-security-audit-log/classes/Helpers/class-wp-helper.php
       ```
   
 * **Result:** Explicitly typecasting the integer hook identifier (e.g., `1242`,`
   1243`) satisfies PHP 8.x strict scalar typing, immediately resolving the fatal`
   TypeError` and allowing the audit log viewer (`page=wsal-auditlog`) to load normally.
    -  This reply was modified 10 hours, 48 minutes ago by [patsitsolutions](https://wordpress.org/support/users/patsitsolutions/).
      Reason: Added workaround

 * 7 replies
 * 7 participants
 * Last reply from: [brightforce](https://wordpress.org/support/users/brightforce/)
 * Last activity: [1 hour, 17 minutes ago](https://wordpress.org/support/topic/fatal-error-5-6-5-with-wp-7-1-strtolower-receives-integer-callback-id/#post-18998567)

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
