Skip to content
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

ACF module does not analyse content inside Repeater and Flexible Content fields #27

Open
ghost opened this issue Dec 14, 2019 · 9 comments
Assignees
Labels
Bug Something isn't working, displaying properly or is producing an error In progress Currently being worked on

Comments

@ghost
Copy link

ghost commented Dec 14, 2019

I've noticed that on sites using ACF Pro, Classic SEO only reads top level WYSIWYG and Text fields when analysing the page content. Any content in Text or WYSIWYG fields that are inside Repeaters or Flexible Content fields are not read - as least as far as I can tell.

Obviously this doesn't affect Google, but because it affects the analysis and score on the editor page, it makes it harder to see whether my content is sufficiently optimised.

It would be great to have a more intelligent ACF module that can recursively dive into Repeater and Flexible Content fields to find any WYSIWYG or Text fields that may be inside them.

@ghost
Copy link
Author

ghost commented Dec 14, 2019

OK, after further testing I'm going to redefine this issue.

If you're editing a page and add a focus keyword that is already in the content (including within an ACF repeater or flexible content field), it is found.

But if you add a focus keyword that is not currently in the content and then subsequently add it to the content, inside a repeater or flexible content field, it is not found.

So the workaround is to delete the focus keyword, save the page, then re-add the focus keyword.

@timbocode timbocode added the Bug Something isn't working, displaying properly or is producing an error label Dec 14, 2019
@timbocode timbocode self-assigned this Dec 14, 2019
@timbocode
Copy link
Contributor

Sounds like a bug. Will look into it.

@timbocode timbocode added this to the Version 1.0.0 milestone Dec 14, 2019
@timbocode timbocode added the In progress Currently being worked on label Dec 21, 2019
@timbocode
Copy link
Contributor

@zigpress are you still experiencing this problem?

This is what I found in one particular test:

Test

  1. Created a new page
  2. Entered page title
  3. Added some Lorem Ipsum filler content in the main content area
  4. Set a keyword in Classic SEO (which did not exist in the Lorem text)
  5. Publish / save the page
  6. Added some text in a repeater field containing the keyword
  7. Added some text in a flexible field containing the keyword

Result
Both occurrences of the keyword were recognised by Classic SEO insofar as they increased the keyword density (and number of words) but overall SEO score was not affected. It made no difference if I saved in between.


Does that match your own experience? I know this differs from the scenario you describe in your second post but I can't reproduce that.

@ghost
Copy link
Author

ghost commented Jan 23, 2020 via email

@ghost
Copy link
Author

ghost commented Jan 24, 2020

I just installed Classic SEO 0.7.0 on a localhost site, and followed the following steps:

  1. Created a test page called "Test Page" and added a paragraph of Lorem Ipsum in an ACF WYSIWYG field which contains the word "Mauris" half way through the paragraph. Saved the page. SEO score 6.
  2. Added mauris as a keyword without saving page. SEO score 12, focus keyword found in content.
  3. Saved page. SEO score 6, focus keyword not found in content.
  4. Removed and re-added mauris as keyword without saving page. SEO score 12, focus keyword found in content.

I did the same exercise but with a plain (not ACF) page, pasting the lorem ipsum into the standard TinyMCE editor, and the problem in point 3 above did not occur.
So something is definitely wrong with the way the on-page scripts detect ACF content when the admin edit page is loaded after saving the post. When the scripts are triggered when the keywords change, they work.

@timbocode
Copy link
Contributor

OK, thanks for testing this @zigpress . I will look into it further.

@timbocode
Copy link
Contributor

Hi @zigpress

I've had a good long play with Classic SEO and ACF and, you're not going to like this, but I can't reproduce the issue you report above.

The first question I have is: are you still using v0.7.0? If so, can you update to the latest version (currently 1.0.0 beta 3) and see if you still have the problem.

If you are running beta 3 and are still having the problem, read on...

My setup is:

PHP 7.2
Apache 2.4.39
ClassicPress memory allocation: 128MB
ClassicPress v1.1.3 (also tested on 1.1.2)
Classic SEO v1.0.0 beta 3
ACF Pro 5.8.9
ClassicPress TwentySeventeen theme (also tested with Divi)
No other plugins active
Firefox and Chrome

I've recorded a screencast of my latest attempt which you can view here:

https://drive.google.com/file/d/1FrllIklDC7BIrOeIzfQucJhyDLtBXFFF/view

In the video, you may note that after saving the page, the SEO score briefly reverts to 4/100 before updating itself. This seems to be similar to what you are experiencing except that in your case, it does not update after saving.

The second question is: are you getting any JavaScript errors when saving the page?

If yes and you are running CPSEO v1.0.0 beta 3, can you let me know what the JS error(s) is(are) and can you also let me know your set up.

Thanks

@ghost
Copy link
Author

ghost commented May 9, 2020

I'm using 1.0.0-beta3. There are no errors in my JavaScript console, either when I load the page or when I add/remove focus keywords.
I've watched your screencast and yes, what I'm experiencing is that the "4" doesn't revert up to "20". I think it should be the AJAX call with action "cpseo_is_keyword_new" that corrects the value, and this call IS being made.
My setup is Brave Browser on Mac, all shields disabled, testing on http://localhost/ (XAMPP) and on https://www.zigpress.com/ (RunCloud+UpCloud). PHP 7.3.
I'll do some investigating of my own.

EDIT: is there any way you can provide a version of the plugin where the JS files are not compressed onto one line?

@timbocode
Copy link
Contributor

Weird. I've installed Brave Browser on my Windows PC and it works fine on that too, so definitely more testing required.

I don't have the uncompressed versions of the JS files unfortunately. RM haven't made these available which, to my mind, goes against GPL. I have asked them but they were not very helpful.

But that is on my list of things to do after I've released v1.

@timbocode timbocode removed this from the Version 1.0.0-Beta4 milestone May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working, displaying properly or is producing an error In progress Currently being worked on
Projects
None yet
Development

No branches or pull requests

1 participant