When activating the Restricted Site Access plugin on a WordPress multisite network, the following error appears in debug logs. This issue occurs specifically in a multisite setup when a subsite's language is changed to a non-English language.
The plugin functions correctly on a single-site installation but fails on multisite due to translation loading happening too early in the WordPress lifecycle.
Details
`
### wp-core ###
version: 6.7.1
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /blog/%year%/%monthnum%/%day%/%postname%/
https_status: false
multisite: true
user_registration: false
blog_public: 2
default_comment_status: open
environment_type: local
site_id: 1
site_count: 2
network_count: 1
user_count: 2
dotorg_communication: true
wp-active-theme
name: Twenty Twenty-Five (twentytwentyfive)
version: 1.0
author: the WordPress team
author_website: https://wordpress.org
parent_theme: none
theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, widgets-block-editor, block-templates, post-formats, editor-style
theme_path: /Users/ank/Local Sites/multi-site-setup/app/public/wp-content/themes/twentytwentyfive
auto_update: Disabled
wp-themes-inactive (2)
Twenty Twenty-Four: version: 1.3, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Three: version: 1.6, author: the WordPress team, Auto-updates disabled
wp-plugins-active (2)
Debug Log Helper: version: 1.5.3, author: Lukman Nakib, Auto-updates disabled
Restricted Site Access: version: 7.5.1, author: 10up, Auto-updates disabled
wp-media
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1809
imagemagick_version: ImageMagick 7.1.1-15 Q16 x86_64 98eceff6a:20230729 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 1000M
upload_max_filesize: 300M
max_effective_size: 300 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 144 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 7872
imagick::RESOURCETYPE_MAP: 72 GB
imagick::RESOURCETYPE_MEMORY: 36 GB
imagick::RESOURCETYPE_THREAD: 1
imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVS, BAYER, BAYERA, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FITS, FL32, FLV, FRACTAL, FTS, FTXT, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, JXL, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MPO, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YAML, YCbCr, YCbCrA, YUV
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, WebP, BMP
ghostscript_version: 9.56.1
wp-server
server_architecture: Darwin 23.6.0 x86_64
httpd_software: nginx/1.26.1
php_version: 8.3.0 64bit
php_sapi: fpm-fcgi
max_input_variables: 4000
time_limit: 1200
memory_limit: 256M
max_input_time: 600
upload_max_filesize: 300M
php_post_max_size: 1000M
curl_version: 8.7.1 (SecureTransport) LibreSSL/3.3.6
suhosin: false
imagick_availability: true
pretty_permalinks: true
current: 2025-01-20T14:06:07+00:00
utc-time: Monday, 20-Jan-25 14:06:07 UTC
server-time: 2025-01-20T14:06:04+00:00
wp-database
extension: mysqli
server_version: 8.0.35
client_version: mysqlnd 8.3.0
max_allowed_packet: 16777216
max_connections: 151
wp-constants
WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /Users/ank/Local Sites/multi-site-setup/app/public/wp-content
WP_PLUGIN_DIR: /Users/ank/Local Sites/multi-site-setup/app/public/wp-content/plugins
WP_MEMORY_LIMIT: 64M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: true
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: /Users/ank/Local Sites/multi-site-setup/app/public/wp-content/debug-678e0a763c624.log
SCRIPT_DEBUG: true
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: local
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined
wp-filesystem
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
fonts: not writable
`
Describe the bug
When activating the Restricted Site Access plugin on a WordPress multisite network, the following error appears in debug logs. This issue occurs specifically in a multisite setup when a subsite's language is changed to a non-English language.
The plugin functions correctly on a single-site installation but fails on multisite due to translation loading happening too early in the WordPress lifecycle.
https://wordpress.org/support/topic/notice-with-wp-6-7/
Steps to Reproduce the Error
Set up a WordPress Multisite Network
Add a New Subsite
example.com/subsite).Activate the Plugin Network-wide
Change the Subsite Language
Enable Debug Mode
Reload the Subsite
example.com/subsite) or dashboard.Check the Error Log
wp-content/debug.logfile to verify if the following error is logged:Screenshots, screen recording, code snippet
Environment information
Details
` ### wp-core ###version: 6.7.1
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /blog/%year%/%monthnum%/%day%/%postname%/
https_status: false
multisite: true
user_registration: false
blog_public: 2
default_comment_status: open
environment_type: local
site_id: 1
site_count: 2
network_count: 1
user_count: 2
dotorg_communication: true
wp-active-theme
name: Twenty Twenty-Five (twentytwentyfive)
version: 1.0
author: the WordPress team
author_website: https://wordpress.org
parent_theme: none
theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, widgets-block-editor, block-templates, post-formats, editor-style
theme_path: /Users/ank/Local Sites/multi-site-setup/app/public/wp-content/themes/twentytwentyfive
auto_update: Disabled
wp-themes-inactive (2)
Twenty Twenty-Four: version: 1.3, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Three: version: 1.6, author: the WordPress team, Auto-updates disabled
wp-plugins-active (2)
Debug Log Helper: version: 1.5.3, author: Lukman Nakib, Auto-updates disabled
Restricted Site Access: version: 7.5.1, author: 10up, Auto-updates disabled
wp-media
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1809
imagemagick_version: ImageMagick 7.1.1-15 Q16 x86_64 98eceff6a:20230729 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 1000M
upload_max_filesize: 300M
max_effective_size: 300 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 144 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 7872
imagick::RESOURCETYPE_MAP: 72 GB
imagick::RESOURCETYPE_MEMORY: 36 GB
imagick::RESOURCETYPE_THREAD: 1
imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVS, BAYER, BAYERA, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FITS, FL32, FLV, FRACTAL, FTS, FTXT, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, JXL, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MPO, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YAML, YCbCr, YCbCrA, YUV
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, WebP, BMP
ghostscript_version: 9.56.1
wp-server
server_architecture: Darwin 23.6.0 x86_64
httpd_software: nginx/1.26.1
php_version: 8.3.0 64bit
php_sapi: fpm-fcgi
max_input_variables: 4000
time_limit: 1200
memory_limit: 256M
max_input_time: 600
upload_max_filesize: 300M
php_post_max_size: 1000M
curl_version: 8.7.1 (SecureTransport) LibreSSL/3.3.6
suhosin: false
imagick_availability: true
pretty_permalinks: true
current: 2025-01-20T14:06:07+00:00
utc-time: Monday, 20-Jan-25 14:06:07 UTC
server-time: 2025-01-20T14:06:04+00:00
wp-database
extension: mysqli
server_version: 8.0.35
client_version: mysqlnd 8.3.0
max_allowed_packet: 16777216
max_connections: 151
wp-constants
WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /Users/ank/Local Sites/multi-site-setup/app/public/wp-content
WP_PLUGIN_DIR: /Users/ank/Local Sites/multi-site-setup/app/public/wp-content/plugins
WP_MEMORY_LIMIT: 64M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: true
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: /Users/ank/Local Sites/multi-site-setup/app/public/wp-content/debug-678e0a763c624.log
SCRIPT_DEBUG: true
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: local
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined
wp-filesystem
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
fonts: not writable
`