Title: PHP Fatal Error wp_get_loading_optimization_attributes
Last modified: November 8, 2023

---

# PHP Fatal Error wp_get_loading_optimization_attributes

 *  Resolved [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * (@pixelbart)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-wp_get_loading_optimization_attributes/)
 * Hello,
 * I hope this message finds you well. I am encountering a PHP Fatal Error within
   the AdvancedAds plugin on my website, and I’d like to report it for assistance
   in resolving the issue.
 * Here are the details of our setup:
    - WordPress Version: 6.4
    - Advanced Ads Version: 1.47.3
    - Advanced Ads Pro Version: 2.24.2
 * The error was discovered yesterday and appears to be occurring only in posts 
   where we use the automatic ad insertion feature. We utilize the placement with
   the jQuery selector `.post-content p:eq(1)` for this purpose. This specific placement
   is necessary because the automatic placement using 2 paragraphs does not work
   correctly within the Elementor page builder, for reasons unknown to us.
 * Here’s the error message along with the relevant stack trace (with anonymized
   paths):
 *     ```wp-block-code
       [08-Nov-2023 10:08:07 UTC] PHP Fatal error:  Uncaught TypeError: Illegal offset type in isset or empty in /wp-includes/media.php:5771
       Stack trace:
       #0 /wp-includes/media.php(1961): wp_get_loading_optimization_attributes('img', Array, Array)
       #1 /wp-content/plugins/advanced-ads/classes/ad_type_abstract.php(174): wp_img_tag_add_loading_optimization_attrs('<img src="https...', Array)
       ...
       ```
   
 * The temporary solution I implemented was to remove lines 172 to 175 in the file`/
   wp-content/plugins/advanced-ads/classes/ad_type_abstract.php`. While this resolved
   the issue for now, I would appreciate your guidance on whether there is a more
   official fix or if this will be addressed in future updates.
 * Thank you for your prompt assistance in resolving this issue. If you need any
   further information from me, please let me know.
 * Greetings Kevin

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

 *  [providerpt](https://wordpress.org/support/users/providerpt/)
 * (@providerpt)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-wp_get_loading_optimization_attributes/#post-17183934)
 * Hello! We are experiencing the same issue. Same version and specs as [@pixelbart](https://wordpress.org/support/users/pixelbart/).
   Same temporary fix in place. Thanks!
    -  This reply was modified 2 years, 5 months ago by [providerpt](https://wordpress.org/support/users/providerpt/).
 *  [HansVanEijsden](https://wordpress.org/support/users/hansvaneijsden/)
 * (@hansvaneijsden)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-wp_get_loading_optimization_attributes/#post-17183993)
 * Thank you for this temporary fix and the writeup. Here it also seems to be working
   again.
 *  [HansVanEijsden](https://wordpress.org/support/users/hansvaneijsden/)
 * (@hansvaneijsden)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-wp_get_loading_optimization_attributes/#post-17184293)
 * Update: for me it seems to be solved in version 1.47.4.
 *  [henningaa](https://wordpress.org/support/users/henningaa/)
 * (@henningaa)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-wp_get_loading_optimization_attributes/#post-17184415)
 * Hi there,
 * Yes, the issue was addressed with the update 1.47.4. Advanced Ads should work
   again with WP version 6.4.
 * If you have further questions regarding Advanced Ads, please don’t hesitate to
   reach out to me again.
 * Best regards,
   Henning
 *  Thread Starter [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * (@pixelbart)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-wp_get_loading_optimization_attributes/#post-17184650)
 * True, is working now. Thank you for the fast update!

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

The topic ‘PHP Fatal Error wp_get_loading_optimization_attributes’ is closed to 
new replies.

 * ![](https://ps.w.org/advanced-ads/assets/icon-256x256.gif?rev=2773443)
 * [Advanced Ads – Ad Manager & AdSense](https://wordpress.org/plugins/advanced-ads/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-ads/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-ads/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-ads/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-ads/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-ads/reviews/)

## Tags

 * [pro](https://wordpress.org/support/topic-tag/pro/)

 * 5 replies
 * 4 participants
 * Last reply from: [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-wp_get_loading_optimization_attributes/#post-17184650)
 * Status: resolved