• Resolved Oleksandr

    (@track77)


    After updating to version 2.1.5 I received tons of messages about deprecated code.

    PHP Deprecated (8192): Creation of dynamic property GRIM_SG\PTSettings::$media_sitemap is deprecated
    This part of code is deprecated
    $this->settings->{$post_type}->{$media_sitemap_key}
    		// TODO: Remove this after 2.3.0 release. Use old settings instead of patch.
    if ( isset( $this->settings->page->media_sitemap ) ) {
    $media_sitemap_key = 'media_sitemap';
    } else {
    $media_sitemap_key = 'video-sitemap' === $template ? 'video_sitemap' : 'image_sitemap';
    }

    foreach ( $post_types as $key => $post_type ) {
    if ( isset( $this->settings->{$post_type}->{$media_sitemap_key} ) && ! $this->settings->{$post_type}->{$media_sitemap_key} ) {
    unset( $post_types[ $key ] );
    }
    }
Viewing 15 replies - 1 through 15 (of 21 total)
  • Logs errors to the console in Chrome too. I’m using the Pro version.

    • This reply was modified 10 months, 2 weeks ago by btreece84.
    Plugin Author WP Grim

    (@wpgrim)

    Hello @track77 @btreece84

    Thank you for sending detailed logs. We’ve fixed this deprecation error and released a new version. Please update your plugin and the error should disappear. This error was occurred after separating Image & Video Sitemap settings.

    Thank you for helping us improve this plugin!

    Best regards

    Thread Starter Oleksandr

    (@track77)

    class PTSettings {
    ...

    protected $media_sitemap = null; // this will fix the error

    Unfortunately, I still see the deprecation errors.
    “$media_sitemap” field in the PTSettings class fixex this

    • This reply was modified 10 months, 2 weeks ago by Oleksandr.
    Plugin Author WP Grim

    (@wpgrim)

    Hello @track77

    Thank you for your quick check and fix code. We implemented below changes and released a new version 2.1.7:

    class PTSettings {
    ...
    public $media_sitemap = null;

    Could you please recheck this deprecated error and check if everything is okay with your Image & Video Sitemaps?

    Thank you for your help 🙂

    • This reply was modified 10 months, 2 weeks ago by WP Grim.
    Thread Starter Oleksandr

    (@track77)

    Almost right.
    Thank you.
    But since version 2.15 (but it might be earlier, I just noticed this only now) image sitemap can’t load I always receive the message “A timeout occurred Error code 524”

    Thread Starter Oleksandr

    (@track77)

    But after I exclude the bbpress replies, it shows again.
    But empty
    https://3d-kstudio.com/image-sitemap.xml
    And yes, I tried to clear all caches

    Thread Starter Oleksandr

    (@track77)

    Google Search Console shows that last image-sitemap was accessed 09.10.24

    Thread Starter Oleksandr

    (@track77)

    Version 1.9.8 generates image-sitemap correctly

    Plugin Author WP Grim

    (@wpgrim)

    @track77 Could you please replace this version on your site – https://drive.google.com/file/d/1ZWdJbSKBYNQdGDf–c1hWQsn5Jb2Vk50/view?usp=share_link and check your Image Sitemap one more time after excluding bbPress replies?

    Thread Starter Oleksandr

    (@track77)

    This version doesn’t work also.
    I was wrong, this is not related to bbpress in any way

    @wpgrim

    The new version 2.1.7 fixed the PHP deprecation notice for me and all of my sitemaps seem to be working normally (post, page, category, tags, 1 custom taxonomy, and Google News). Thanks.

    I enabled my image sitemap. It’s a 16-year-old site with more than 20,000 images posted. No BBPress or the like. Works fine on 2.1.7. Also running Cloudflare, like Oleksandr. First time turning that sitemap on and within 2 minutes it had fully generated. FWIW.

    Plugin Author WP Grim

    (@wpgrim)

    Thank you @btreece84

    Yes, we are using dynamic caching logic for Image and Video Sitemaps in order to store links separated into chunks. Therefore, it takes a bit long time for first loading. This dynamic cache will be cleared automatically on change Settings and Save Post hooks.

    We will release another update within a few days which totally remove old media_sitemap checking. Please let us know if you face any problems after this update. We are trying to do everything smoothly.

    Best regards

    Thread Starter Oleksandr

    (@track77)

    class PTSettings {...    protected $media_sitemap = null; // this fixes the error

    Latest versions again generate tons of messages
    PHP Deprecated (8192): Creation of dynamic property GRIM_SG\PTSettings::$media_sitemap is deprecated

    Plugin Author WP Grim

    (@wpgrim)

    Hello @track77

    We’ve totally removed $media_sitemap from our code. Please update your Pro version and it should fix the error. If it doesn’t;t fix the issue, please send us full error log in order to check where this error is coming from.

    Best regards

Viewing 15 replies - 1 through 15 (of 21 total)

The topic ‘PHP Deprecated in version 2.1.5’ is closed to new replies.