-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Plugin Activation - Accessing array offset on value of type bool #198
Comments
@TylerB24890 I'm curious what your fix approach is. I think we'd ideally want to detect that an account is not yet setup and direct new installs to the correct screen/page/site to create an account such that the plugin functions as expected. |
I did take a quick look at this issue. Here are some of the findings and possible approaches to the fix. First of all, this issue can be replicated with PHP 7.4 or greater. Possible solutions
So, the solution is dependent on the minimum PHP version we would like to support for this plugin. I was not able to find the information about the minimum PHP version support for this plugin. |
I've added php compatibility tests here: #262 Since the plugin is compliant with 5.6 compatibility and WordPress core still supports it https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/ I think we should go with the PHP 5.6 solution. |
Diving a bit deeper into it I think the actual solution is to not load those scripts if account has not been configured. If we have not configured a Brightcove account, we don't need to localize data (and also we should not load other parts of the plugin as well). At the same time, I think this is a great opportunity to conditionally fix the same problem for other scenarios. Say you are an editor who can't create new accounts, then files belonging to those features should not load. |
Describe the bug
On plugin activation, a notice appears at the top of the admin panel:
Notice: Trying to access array offset on value of type bool
. This happens when a user does not have an account setup yet with the plugin, which I would imagine is very common on first activation of the plugin.Note: This was tested on a fresh WP installation setup and configured with wp-local-docker-v2
Steps to Reproduce
Expected behavior
Activate plugin to see an Admin notice to add a Brightcove Account. The Admin notice is present, but as is the PHP notice.
Screenshots
Environment information
Site Health Info:
### wp-core ###version: 5.6.2
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 2
dotorg_communication: true
wp-paths-sizes
wordpress_path: /var/www/html
wordpress_size: loading...
uploads_path: /var/www/html/wp-content/uploads
uploads_size: loading...
themes_path: /var/www/html/wp-content/themes
themes_size: loading...
plugins_path: /var/www/html/wp-content/plugins
plugins_size: loading...
database_size: loading...
total_size: loading...
wp-active-theme
name: 10up Theme Scaffold
version: 0.1.0
author: 10up
author_website: https://10up.com
parent_theme: none
theme_features: core-block-patterns, automatic-feed-links, disable-custom-colors, disable-custom-font-sizes, editor-gradient-presets, disable-custom-gradients, editor-color-palette, post-thumbnails, title-tag, html5, editor-font-sizes, menus
theme_path: /var/www/html/wp-content/themes/bx-intranet
auto_update: Disabled
wp-mu-plugins (1)
bx-base.php: author: 10up, version: 0.1.0
wp-plugins-active (2)
Brightcove Video Connect: version: 2.1.2, author: 10up, Auto-updates disabled
ElasticPress: version: 3.5.4, author: 10up, Auto-updates disabled
wp-plugins-inactive (1)
Secure Media: version: 1.0.5, author: 10up, Auto-updates disabled
wp-media
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1690
imagemagick_version: ImageMagick 6.9.10-86 Q16 x86_64 2020-01-13 https://imagemagick.org
file_uploads: File uploads is turned off
post_max_size: 150m
upload_max_filesize: 150m
max_effective_size: 150 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 4 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 786432
imagick::RESOURCETYPE_MAP: 4 GB
imagick::RESOURCETYPE_MEMORY: 2 GB
imagick::RESOURCETYPE_THREAD: 1
gd_version: 2.2.5
ghostscript_version: not available
wp-server
server_architecture: Linux 4.19.121-linuxkit x86_64
httpd_software: nginx/1.19.5
php_version: 7.4.13 64bit
php_sapi: fpm-fcgi
max_input_variables: 1000
time_limit: 30
memory_limit: 128M
admin_memory_limit: 256M
max_input_time: 60
upload_max_filesize: 150m
php_post_max_size: 150m
curl_version: 7.61.1 OpenSSL/1.1.1c
suhosin: false
imagick_availability: true
pretty_permalinks: true
wp-database
extension: mysqli
server_version: 5.7.32
client_version: mysqlnd 7.4.13
wp-constants
WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /var/www/html/wp-content
WP_PLUGIN_DIR: /var/www/html/wp-content/plugins
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: true
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: true
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_LOCAL_DEV: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined
wp-filesystem
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable
Additional context
The text was updated successfully, but these errors were encountered: