WordPress.org

Ready to get started?Download WordPress

Forums

All in One SEO Pack
[resolved] Undefined variable: description (8 posts)

  1. styledev
    Member
    Posted 1 year ago #

    In file: aioseop_class.php
    Error: Notice: Undefined variable: description in /Users/.../wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 1027

    Line: 1027: $description = apply_filters( 'aioseop_description', $description );

    Change to the following to fix:

    if ( isset($description) ) $description = apply_filters( 'aioseop_description', $description );

    Seen when accessing WooCommerce /shop page.

    http://wordpress.org/extend/plugins/all-in-one-seo-pack/

  2. Casey
    Member
    Posted 1 year ago #

    Awesome! Was just looking for this. Thanks!

  3. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    What I would suggest doing, and what will be the fix in the next version, is to set $description to the empty string much earlier in the wp_head() function there; that'd look like this:

    $description = '';

    The issue with your fix is, it prevents the aioseop_description filter from running when there isn't a description present.

  4. styledev
    Member
    Posted 1 year ago #

    Thanks for weighing in on this!

  5. michael
    Member
    Posted 9 months ago #

    I'm getting the same warning. but it only happens in my custom post type archive pages.

    adding $description = ''; right above wp_head() didn't work. any ideas?

  6. michael
    Member
    Posted 9 months ago #

    i misunderstood. I added $description = ''; in header.php - right above wp_head().

    adding it in all-in-one-seo-pack\aioseop_class.php wp_head() did the trick. per @Peter Baylies - the fix will be in the next plugin release i hope.

  7. Peter Baylies
    Member
    Plugin Author

    Posted 9 months ago #

    michael,

    Glad you fixed it! Yes, as I said, this fix will be in the next release.

  8. brynte
    Member
    Posted 4 months ago #

    There seems to have been several updates since this issue was resolved, still I get the same error.

    My message reads:
    Notice: Undefined variable: author in /storage/content/85/106985/bryntemedia.se/public_html/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 1378

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic