• Resolved Nikita_Sp

    (@nikitasp)


    Hi!

    After updating AIOSP to version 4.x there is a notice about deprecated filters.
    First of all, it seems they should work for a few versions before being completely removed:

    Deprecated Filters Detected
    Warning: AIOSEO has detected the use of filters that have been deprecated on your site. These filters may be in use by another plugin or your theme. If that is the case, these filters most likely will not work with this plugin. Please check for an update immediately or contact our support for more information.
    aioseop_title
    aioseop_thumbnail_size

    But it’s ok, we’re the devs, we could fix it ASAP after the update.
    BUT! I can’t find any info about NEW hooks. All the previous hooks in documentation still active and no notices or other suggestions:

    https://aioseo.com/docs/aioseop_title/
    https://aioseo.com/docs/aioseop_title_format/

    How should we resolve this situation? We’ve got a few custom titles for some objects.
    Thanks.

    • This topic was modified 4 years, 3 months ago by Nikita_Sp.
Viewing 15 replies - 1 through 15 (of 16 total)
  • Jon

    (@freshyjon)

    I agree, it seems bad practice to take away certain filters without giving more of a notice. There should be a few versions where BOTH work, otherwise, our custom code breaks after updating plugin. If we change our code before updating plugin, then it still breaks because the old plugin doesn’t support the new filters.

    Things seem to be getting a little sloppy here. Better documentation and better changelogs to say what exactly was changed and to what (especially for filters/hooks).

    Plugin Author benjaminprojas

    (@benjaminprojas)

    @nikitasp,

    Thanks for reaching out!

    We are still working on our documentation and hope to have all that outlined very soon. For now, here are the new hooks that you need to switch to:

    aioseo_title
    aioseo_thumbnail_size

    Our old version had many different hooks that began with different (inconsistent) prefixes like aiosp_ or aioseop_ so we took the opportunity to standardize them all to aioseo_.

    Because the code base is so different there are different hooks as well, so if you find something is not working as expected, just reach out and we will let you know how to use it as well.

    Thread Starter Nikita_Sp

    (@nikitasp)

    @benjaminprojas thank you for a such quick response, I’ll check it!

    Thread Starter Nikita_Sp

    (@nikitasp)

    mistake message

    • This reply was modified 4 years, 3 months ago by Nikita_Sp.
    Plugin Author benjaminprojas

    (@benjaminprojas)

    @nikitasp, is this happening for all pages/posts? The title that is passed into that filter is the same title we use anywhere we are displaying a title.

    Since you are a dev, if you feel comfortable looking at the code you can see where it is defined here:
    all-in-one-seo-pack/app/Common/Meta/Title.php on line 184.

    Plugin Author benjaminprojas

    (@benjaminprojas)

    Oops, looks like its working now? ??

    Thread Starter Nikita_Sp

    (@nikitasp)

    @benjaminprojas now #archive_title contains “Archive: ” string.
    And now the title looks like “Archive: Reviews | Website name” instead of “Reviews | Website name” earlier.

    How we can avoid this?
    Thanks.

    Thread Starter Nikita_Sp

    (@nikitasp)

    Yeah, the new hook name is working like a charm ??

    But now the function is using some dynamics titles, as I see:

    if ( is_archive() ) {
    			$postType = get_queried_object();
    			$options  = aioseo()->options->noConflict();
    			if ( $options->searchAppearance->dynamic->archives->has( $postType->name ) ) {
    				return $this->prepareTitle( aioseo()->options->searchAppearance->dynamic->archives->{ $postType->name }->title );
    			}
    		}

    Instead of labels, like earlier.

    Thread Starter Nikita_Sp

    (@nikitasp)

    After a small research, seems now we should use one more WordPress core filter get_the_archive_title with code like that:

    add_filter( 'get_the_archive_title', function ($title) {    
    	if ( is_category() ) {    
    		$title = single_cat_title( '', false );    
    	} elseif ( is_tag() ) {    
    		$title = single_tag_title( '', false );    
    	} elseif ( is_author() ) {    
    		$title = '<span class="vcard">' . get_the_author() . '</span>' ;    
    	} elseif ( is_tax() ) { //for custom post types
    		$title = sprintf( __( '%1$s' ), single_term_title( '', false ) );
    	} elseif (is_post_type_archive()) {
    		$title = post_type_archive_title( '', false );
    	}
    	return $title;    
    
    });

    Am I right?

    Plugin Author benjaminprojas

    (@benjaminprojas)

    This is a great question. Our code should strip out the Archive: part of it, but if you are seeing it appear, we will need to take a closer look at that.

    What are your title settings and which type of archive is this? I’m assuming it’s for a custom post type?

    Thread Starter Nikita_Sp

    (@nikitasp)

    What are your title settings and which type of archive is this?

    It’s simple and seems default for all websites #archive_title - #site_title ??

    I’m assuming it’s for a custom post type?

    Yeah, of course.

    Thread Starter Nikita_Sp

    (@nikitasp)

    @benjaminprojas if it’s not conceived and it is a mistake, than I think you’d better use post_type_archive_title() instead of get_the_archive_title() in app/Common/Utils/Tags.php on line 910:

    case 'archive_title':
    	$title = wp_strip_all_tags( get_the_archive_title() ); // <--- here
    	return $sampleData ? __( 'Sample Archive Title', 'all-in-one-seo-pack' ) : $title;

    Many thanks.

    Plugin Author benjaminprojas

    (@benjaminprojas)

    @nikitasp,

    You are correct! We’ve made the adjustment and it will be fixed in the next release ??

    Thanks for working with us on this!

    Thread Starter Nikita_Sp

    (@nikitasp)

    @benjaminprojas,

    Nice! You’d better hurry up with this update it’s very important for SEO titles for a ton of plugin’s users.

    Thanks.

    Plugin Author benjaminprojas

    (@benjaminprojas)

    @nikitasp,

    Our 4.0.9 release includes this fix. Can you update and let us know if its working for you?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Hooks update problem “aioseop_title” and “aioseop_thumbnail_size”’ is closed to new replies.