Parsely / wp-parsely

The official WordPress plugin for Parse.ly - makes it a snap to add the required tracking code to enable Parse.ly on your WordPress site.
https://wordpress.org/plugins/wp-parsely/
GNU General Public License v2.0
62 stars 31 forks source link

PCH Smart Linking: Improve Classic Block handling #2619

Closed acicovic closed 3 weeks ago

acicovic commented 1 month ago

Is your feature request related to a problem?

Smart Linking doesn't support Classic Blocks, and we alert users of this.

  1. When we try to use Smart Linking on a Classic Block, we get Smart Linking is not supported for the Freeform block.
  2. When we try to use Smart Linking for the whole post ("All Blocks" setting) and the post contains at least one Classic Block, we get the same error message.

Describe the solution you'd like

  1. In the message, change Freeform block to Classic Block for clarity, as this is how it's generally referenced.
  2. Come up with a better error message for the second case. For example, This post contains one or more Classic Blocks, which are unsupported by Smart Linking. Operation aborted. It would be nice if we could come up with a shorter message.

Describe alternatives you've considered

When the "All Blocks" setting is selected, we could consider removing Classic Blocks and submit the rest of the content. Noting though that this could result in suboptimal results, and that implementation might be tricky.

vaurdan commented 1 month ago

When the "All Blocks" setting is selected, we could consider removing Classic Blocks and submit the rest of the content. Noting though that this could result in suboptimal results, and that implementation might be tricky.

The issue that I see with that - I tried something similar - is that the offsets returned by the Content Suggestions API will not match the actual content offsets. It should be possible to make it work by ignoring the classc blocks when processing the Smart Links suggestions, but it's definitely not trivial.

acicovic commented 1 month ago

Thanks for the info! In this case, I think that just having a better error message for the second case should be enough.

acicovic commented 4 weeks ago

@vaurdan, does this issue get invalidated by #2673, partly or completely?

vaurdan commented 4 weeks ago

Ah yes, it does! Good catch!

acicovic commented 4 weeks ago

For posterity, can you give a brief description here of what will happen in the 2 cases?

vaurdan commented 3 weeks ago

Absolutely. When we try to add Smart Links to a Classic Block, it will not allow selecting the individual block, per the video below. This is the behaviour for all unsupported blocks.

https://github.com/user-attachments/assets/4cf05edb-cae5-4c89-bb53-dbb04054ab0b

If we try to generate Smart Links for the full content, unsupported blocks, such as the Classic Block, will be ignored.