You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a mixture of double negatives and interesting concepts that make the code rather perplexing, and suspiciously error prone.
Apply Filter sends empty( $aioseop_options['aiosp_dont_truncate_descriptions'] ). Which will be false when a variable is set, and true when not in use. See Ref 1.
Possible Solution: Send $aioseop_options['aiosp_dont_truncate_descriptions'] variable instead of empty().
Redundant if there is a global variable.
Seems error prone, but has been set elsewhere; as a string instead of a boolean.
Makes not/prevent truncating difficult when making a custom filter.
$aioseop_options['aiosp_dont_truncate_descriptions'] uses a double negative. See Ref 2.
Possible Solution: Changing to $aioseop_options['aiosp_truncate_descriptions'] would be easier, but flips operations.
public function filter_description( $value, $truncate = false ) {
/*
* Doing stuff...
*/
// Truncate / crop
if ( ! empty( $truncate ) && $truncate )
$value = $this->trim_excerpt_without_filters( $value );
// Encode to valid SEO html entities
return $this->seo_entity_encode( $value );
}
This seems like it may need a new filter, and/or a major update. Since it would potentially change operations for websites using 2 variables in a filter. However, those using 1 variable in the filter hook shouldn't be affected.
Some of the functionality connected to this include...
Post Description.
OG Description.
Google Snippet example ( in Edit Posts ).
The text was updated successfully, but these errors were encountered:
The aioseop_description filter does need to be separated out so there is a filter for the SEO description and a filter for the OG description. See discussion in #1470.
There is a mixture of double negatives and interesting concepts that make the code rather perplexing, and suspiciously error prone.
empty( $aioseop_options['aiosp_dont_truncate_descriptions'] )
. Which will be false when a variable is set, and true when not in use. See Ref 1.$aioseop_options['aiosp_dont_truncate_descriptions']
variable instead of empty().$aioseop_options['aiosp_truncate_descriptions']
would be easier, but flips operations.Ref. 1
Located in
All_in_One_SEO_Pack
classRef. 2
Located in
All_in_One_SEO_Pack
classThis seems like it may need a new filter, and/or a major update. Since it would potentially change operations for websites using 2 variables in a filter. However, those using 1 variable in the filter hook shouldn't be affected.
Some of the functionality connected to this include...
The text was updated successfully, but these errors were encountered: