Title: php warning
Last modified: April 9, 2023

---

# php warning

 *  Resolved [rom1our](https://wordpress.org/support/users/rom1our/)
 * (@rom1our)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-417/)
 * Hi there,
 * in debug.log I see
 *     ```wp-block-code
       PHP Warning:  Undefined array key "link" in */public_html/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 1545
       PHP Warning:  Undefined array key "title" in */public_html/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 436
       PHP Warning:  Undefined array key "alt" in */public_html/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 510
       ```
   
 * I found this [already reported in the forum](https://wordpress.org/support/topic/envira-gallery-lite-compatibility-with-php-8-x/#post-16057851).
   How can it be resolved?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-417%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [bmilligan15](https://wordpress.org/support/users/bmilligan15/)
 * (@bmilligan15)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-417/#post-16644906)
 * Hi [@rom1our](https://wordpress.org/support/users/rom1our/)!
 * I apologize for the trouble! The team is aware of these warnings within Envira
   Gallery Lite, and will be pushing a release shortly that addresses them, specifically.
   The moment that the release is made public, I’ll be sure to ping you here :).
 * Thank you for your patience while we work to get these resolved!
 *  Thread Starter [rom1our](https://wordpress.org/support/users/rom1our/)
 * (@rom1our)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-417/#post-16682183)
 * Hi there, I checked your last release 1.8.6, but there is still an error message,
   which filles up the debug.log
 *     ```wp-block-code
       PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /public_html/wp-content/plugins/envira-gallery-lite/includes/global/rest.php on line 437
       ```
   
 *  [bmilligan15](https://wordpress.org/support/users/bmilligan15/)
 * (@bmilligan15)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-417/#post-16703507)
 * Hi, [@rom1our](https://wordpress.org/support/users/rom1our/)!
 * Thank you for the report! I’ve also sent this notice over to the development 
   team, and this will be fixed with our next release :). The moment I have an ETA
   to share on this, I’ll be sure to let you know.
 * Thank you!
 *  [atdugan](https://wordpress.org/support/users/atdugan/)
 * (@atdugan)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-417/#post-16742490)
 * Hi, [@rom1our](https://wordpress.org/support/users/rom1our/)!
 * Just wanted to follow up here and let you know our next release went out, and
   _should_ resolve the issue!
 *  [VIP-Grinders.com](https://wordpress.org/support/users/vipgrinders/)
 * (@vipgrinders)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php-warning-417/#post-16997493)
 * Hi,
 * I still get the array key warnings in your release 1.8.6.2
 *     ```wp-block-code
       Warning: Undefined array key "link" in /xxx/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 1545
   
       Warning: Undefined array key "title" in /xxx/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 436
   
       Warning: Undefined array key "alt" in /xxx/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 510
   
       Warning: Undefined array key "title" in /xxx/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 510
       ```
   
 * My fix for these warnings looks like this, by using a null coalescing operator(??)
   to the array access, e.g. here shortcode.php on line 510:
 *     ```wp-block-code
       $output_item = '<img id="envira-gallery-image-' . sanitize_html_class( $id ) . '" class="envira-gallery-image envira-gallery-image-' . $i . $gallery_theme . ' ' . $envira_lazy_load . '" data-envira-index="' . $i . '" src="' . esc_url( $output_src ) . '"' . ( $this->get_config( 'dimensions', $data ) ? ' width="' . $this->get_config( 'crop_width', $data ) . '" height="' . $this->get_config( 'crop_height', $data ) . '"' : '' ) . ' data-envira-src="' . esc_url( $output_src ) . '" data-envira-gallery-id="' . $data['id'] . '" data-envira-item-id="' . $id . '" data-envira-caption="' . $title . '" alt="' . esc_attr( $item['alt'] ?? '' ) . '" title="' . wp_strip_all_tags( htmlspecialchars( $item['title'] ?? '' ) ) . '" ' . apply_filters( 'envira_gallery_output_image_attr', '', $id, $item, $data, $i ) . ' itemprop="thumbnailUrl" data-envira-srcset="' . esc_url( $output_src ) . ' 400w,' . esc_url( $output_src ) . ' 2x" data-envira-width="' . $output_width . '" data-envira-height="' . $output_height . '" srcset="' . ( ( $envira_lazy_load ) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' : esc_url( $image_src_retina ) . ' 2x' ) . '" data-safe-src="' . ( ( $envira_lazy_load ) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' : esc_url( $output_src ) ) . '" />';
       ```
   
 *  [dbolius](https://wordpress.org/support/users/dbolius/)
 * (@dbolius)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-warning-417/#post-17146223)
 * Hi,
 * it seems the issue is not resolved.
 * On [https://www.bilddesign.at/new-site/kalifornien/](https://www.bilddesign.at/new-site/kalifornien/)
   
   We have the error message here:
 * Warning: Undefined array key “link” in /home/.sites/552/site3088210/web/new-site/
   wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 
   1545 Warning: Undefined array key “title” in /home/.sites/552/site3088210/web/
   new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php
   on line 436 Warning: Undefined array key “alt” in /home/.sites/552/site3088210/
   web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.
   php on line 530 Warning: Undefined array key “link” in /home/.sites/552/site3088210/
   web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.
   php on line 1545 Warning: Undefined array key “title” in /home/.sites/552/site3088210/
   web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.
   php on line 436 Warning: Undefined array key “alt” in /home/.sites/552/site3088210/
   web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.
   php on line 530
 * I have tried php 8.0, 8.1 and 8.2, this makes no difference
   Any help is appreciated!
    -  This reply was modified 2 years, 7 months ago by [dbolius](https://wordpress.org/support/users/dbolius/).

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

The topic ‘php warning’ is closed to new replies.

 * ![](https://ps.w.org/envira-gallery-lite/assets/icon-256x256.png?rev=2022837)
 * [Envira Gallery - Image Photo Gallery, Albums, Video Gallery, Slideshows & More](https://wordpress.org/plugins/envira-gallery-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/envira-gallery-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/envira-gallery-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/envira-gallery-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/envira-gallery-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/envira-gallery-lite/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [dbolius](https://wordpress.org/support/users/dbolius/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/php-warning-417/#post-17146223)
 * Status: resolved