"Undefined Array Key" warning in Circles Gallery plugin

Hello everyone. New to the forum and with very little knowledge about coding, I am trying to resolve a warning that appeared in a plugin that I use for my website. I first posted this in the General PHP help section, only to realise a few days later that this forum had a dedicated Wordpress section which is more suitable for my question. I guess only administrators can move posts, so this is a re-post.

About two weeks ago, I had to restore my entire Wordpress site from a backup after a core update failed, and the error I am trying to resolve appeared afterwards. While I was at it, I updated the site’s php version to 8.0.11, so I’m not sure if that is the culprit.

On my website, I use a plugin called Circles Gallery to display images in more or less every post. I use the free version of the plugin, since the limited configuration options are more than enough for my needs. However, the plugin doesn’t seem to be updated or supported anymore, which of course could also be a factor in this warning popping up.

Anyhoo, if you go to any post where the gallery is used (e.g. http://thegreatoceanliners.com/articles/great-eastern) you will see the following warning at the top:

Warning: Undefined array key “prettyphoto_theme” in /storage/content/77/168877/thegreatoceanliners.com/public_html/wp-content/plugins/circles-gallery/public/class-circles-gallery.php on line 137 Warning: Undefined array key “colorbox_theme” in /storage/content/77/168877/thegreatoceanliners.com/public_html/wp-content/plugins/circles-gallery/public/class-circles-gallery.php on line 138

The gallery itself works just as intended, though, with all the images lined up as circles in a single column to the right. After some searching, it seems that I can just edit the wp-config file in order to hide the warning, but I would prefer to eliminate the problem that causes the warnings in the first place. The only trouble is that I don’t know enough about PHP to understand or rectify the code. :slight_smile:

The php file that the warning refers to can be accessed here, and more specifically the array looks like this:

‘gallery_width’ => $defaults[‘gallery_width’],
‘circle_width’ => $defaults[‘circle_width’],
‘circle_max_width’ => $defaults[‘circle_max_width’],
‘columns_no’ => $defaults[‘columns_no’],
‘columns_no_1024’ => $defaults[‘columns_no_1024’],
‘columns_no_768’ => $defaults[‘columns_no_768’],
‘columns_no_phone’ => $defaults[‘columns_no_phone’],
‘circle_background_color’=> $defaults[‘circle_background_color’],
‘hover_effect’ => $defaults[‘hover_effect’],
‘title_font_size’ => $defaults[‘title_font_size’],
‘title_color’ => $defaults[‘title_color’],
‘description_font_size’ => $defaults[‘description_font_size’],
‘description_color’ => $defaults[‘description_color’],
‘circle_border_size’ => $defaults[‘circle_border_size’],
‘circle_border_color’ => $defaults[‘circle_border_color’],
‘margin_bottom’ => $defaults[‘margin_bottom’],
‘text_position’ => $defaults[‘text_position’],
‘circle_icon’ => $defaults[‘circle_icon’],
‘circle_icon_color’ => $defaults[‘circle_icon_color’],
‘item_height’ => $defaults[‘item_height’],
‘custom_css’ => $defaults[‘custom_css’],
‘click_action’ => $defaults[‘click_action’],
‘prettyphoto_theme’ => $defaults[‘prettyphoto_theme’],
‘colorbox_theme’ => $defaults[‘colorbox_theme’],
‘ids’ => ‘’
), $atts));

Lines 137 and 138 are the ones about ‘prettyphoto_theme’ and ‘colorbox_theme’ respectively. These two variables are locked in the free version and can’t be changed (see attached screenshot), so my guess is that this is also a factor.

So, can anyone help? Is there some snippet of code that I can add to circumvent this warning? Again, the gallery itself works fine otherwise, so the warning doesn’t appear to be anything critical. Just annoying, and I would like to sort it out instead of just hiding it. :smiley:

Thanks in advance for any feedback!

Well, you can’t just “update” PHP versions or MySQL versions or other “server” setup’s without having the EXACT version of Wordpress files involved.

So, the Wordpress system runs ON TOP OF all the other “parts” and therefore, you changed the server without knowing what the Wordpress system really needs.

There are hundreds of differences between PHP version 8 and version 7…
Did you purchase or update the Wordpress site to the PHP 8 version, too? Doubt it.

To solve this, move your PHP version BACK to the version that matches your Wordpress and all is good!

You updated to a Diesel vehicle and are still using gas… ( Make sense? )

You updated to a Diesel vehicle and are still using gas… ( Make sense? )

Yeah, I think I understand enough of what you’re saying to realise that the error is not at the level that I thought it to be. I’ll go ahead and revert to the previous setup, and see if that clears the issue.

Thanks for your response!

On the PHP.net site, there is a document that lists all the changes for each PHP version.
Often you have to look thru that list to see what needs to be changed in your code before you make it live.
I have a couple of sites that I had to leave back at PHP 7.0 due to too many changes to make to update it to 8.0. But, the 7.0 is working 100% perfectly, so not planning on updating it.

You might want to create a secondary site using Wamp or Xamp and test it that way. Turn on all of the error reporting and find all of the lines that fail and then fix them. Once changed to fit the new PHP version, then move the changed files to the live site and update it’s PHP version.

Sponsor our Newsletter | Privacy Policy | Terms of Service