New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix for aioseop_description filter #1468 #1470
fix for aioseop_description filter #1468 #1470
Conversation
This *may fix #1469 as well. |
I have reproduced the problem reported in both issues and confirmed that this PR fixes the issue. The SEO and OG meta is back to how it was prior to v2.4.4. I have tested the different options under Autogenerate Descriptions and confirmed that they all work as normal. |
@wpsmort I added an update that will need retesting. I also have a filter that may need testing; which will force Truncate for those that still want to trim their manual descriptions ( #1469 ).
|
@EkoJR I tested the latest code and it breaks the way the Never Shorten Long Descriptions option works. If you have that unchecked then the meta description is auto generated from the post excerpt and is not truncated and changing the Never Shorten Long Descriptions option has no effect. If you then check the Use Content For Autogenerated Descriptions option then the meta description is auto generated from the post content and is truncated and changing the Never Shorten Long Descriptions option has no effect. To reproduce this, set up a post with a long excerpt and long content. Then check the auto generated descriptions when you enable and disable Use Content For Autogenerated Descriptions. |
Regarding setting for Never Shorten Long Descriptions
@EkoJR I tested and this is now working fine. I tested all of the options under Autogenerate Descriptions. I also tested your new filter which works as long as Never Shorten Long Descriptions is not checked. I think this is a bug because the option for Never Shorten Long Descriptions should only apply to Autogenerated Descriptions and your filter should only apply to manually entered descriptions. |
@EkoJR I tested your latest code and there is still a bug with Never Shorten Long Descriptions. If that option is unchecked then manual descriptions get truncated. We shouldn't be truncating manual descriptions unless your new filter is used. |
@wpsmort I've had to change the concept once more to keep from truncating in those conditions. Note: I did have to change the 2nd filter param was being sent, which I was trying to avoid, but may not affect anyone since it operates the same way needed for the main filter-function. Basically, it sends a variable instead that has that conditional value. |
@wpsmort I can't seem to figure out a way to update truncating for the main function, but here is the basic filter to force/manual truncate.
I was trying to keep it isolated from modifying the OpenGraph Descriptions since they all use the same hook and I can't seem to find any other way to identify what class the value is for. Perhaps AIOSEOP & OG Description should be separate filters, or some form of identifier? I could add a new filter to the plugin for $truncate itself, but I've been trying to figure out other methods without having to introduce a filter. |
@wpsmort This filter should force truncate manual descriptions, but also avoid the Auto-Descriptions. It also avoids being used when Never Shorten Long Descriptions is checked; just in case it is being used.
|
@EkoJR I tested that filter but it is not truncating my manual description. |
@wpsmort It should be working with Never Shorten Long Descriptions is unchecked. Without it, it would be.
|
@EkoJR Here's what I'm seeing on a post with a manually entered SEO description that is 500 characters long:
I hope this helps. |
@wpsmort One of the filters I posted did do that...but I thought that you didn't want it to truncate auto descriptions.
|
@EkoJR The filter should do one thing which is to allow users to truncate manually entered descriptions. This was added because in the last release we removed the ability to truncate manually entered descriptions because we decided that if a user enters a description that is 500 characters long then that's what we should output. Users didn't like this and wanted a way to truncate their manual descriptions again. As of the last release, the Never Shorten Long Descriptions option only applies to auto generated descriptions. |
@wpsmort Ah, I see what's going on now. The Auto-Gen Setting and Auto-Gen Content were separate, and had me a little confused... That would change the filter, and building off the previous, at Code 1, then to more strict/optimal filters, Code 3. Start at Code 3, if you can. If not, decrease. My worry now is the what descriptions gets truncated; which seem to mainly be Pages and Posts. Code 1
Code 2
Code 3
|
@eko Good news! Code 2 worked. I tested it with all the combinations of settings from under Advanced Settings and I tested it with different post types as well as a dynamic and static homepage. @michaeltorbert This is ready for code review. |
Hello there, great news! I am just tagging the right @EkoJR for this conversation ;) |
#1468