• Resolved salubritas

    (@salubritas)


    There seems to be a bug with paragraph word counting in Ad Inserter 2.7.6 and 2.7.7

    My block #2 has a setting of 15 words minimum for paragraph counting, and no maximum. Since updating to 2.7.6, an article which used to insert this block 3 times does not insert it at all. Clearing the minimum of 15 words gets the block showing again (6 times).

    I did some experimenting:

    * Minimum number of para words = 1 –> 4 insertions
    * Minimum number of para words = 5 –> 3 insertions
    * Minimum number of para words = 10 –> 3 insertions
    * Minimum number of para words = 13 –> 2 insertions
    * Minimum number of para words = 14 –> zero insertions

    This is using debugging and block labeling to do the counting so no interference from the ad code itself.

    Did something change in the paragraph word counting since 2.7.6? I can’t see an obvious pattern to what is happening here.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Spacetime

    (@spacetime)

    Hello,

    the page is inaccessible (password protected) so i can’t check.

    Thread Starter salubritas

    (@salubritas)

    Apologies, I went to disable that straight away but you must have got there before me. Please try again.

    Plugin Author Spacetime

    (@spacetime)

    Remote debugging doesn’t seem to be enabled.
    Please check.

    https://wordpress.org/support/topic/ad-inserter-support-forum-before-you-ask-for-help/

    Thread Starter salubritas

    (@salubritas)

    Oops, enabled now.

    Plugin Author Spacetime

    (@spacetime)

    You are using also paragraph clearance settings.
    There were some fixes in clearance checks.

    Can you please clear them to check only word counting?

    Thread Starter salubritas

    (@salubritas)

    OK I have removed those settings and it is now inserting 5 of blocks #2.

    So maybe it is not the word counting but the position shifting code that has changed? I had it set to try to shift position up to 2 paragraphs below then above.

    Thread Starter salubritas

    (@salubritas)

    Actually looking at the blocks that are now inserted I can’t see why they were failing the clearance settings anyway.

    Plugin Author Spacetime

    (@spacetime)

    Paragraph clearance: the plugin checks all the content from the insertion position to the specified pragraph above or below the insertion position. This is useful when you have some elements you would like to avoid between the pararaphs (elements that are not counted as paragraphs).

    You can use debugging function Log processing to see the reason why some block was not inserted:
    https://adinserter.pro/documentation/debugging

    I would suggest installing this version which contains some additional fixes:
    https://downloads.wordpress.org/plugin/ad-inserter.zip

    Then let’s check again.

    Plugin Author Spacetime

    (@spacetime)

    This is the extract from the insertion log for block 2:

       7  BLOCK 2 CLEARANCE CHECK POSITION 9
       0  BLOCK 2 CLEARANCE CHECK POSITION 9 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 10 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 11 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 8 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 7 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 18
       0  BLOCK 2 CLEARANCE CHECK POSITION 18 OK
       0  BLOCK 2 CLEARANCE CHECK POSITION 27
       0  BLOCK 2 CLEARANCE CHECK POSITION 27 FAILED (ABOVE: <h, BELOW: <ul)
       0  BLOCK 2 CLEARANCE CHECK POSITION 28 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 29 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 26 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 25 FAILED (ABOVE: <h, BELOW: <ul)
       0  BLOCK 2 CLEARANCE CHECK POSITION 36
       0  BLOCK 2 CLEARANCE CHECK POSITION 36 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 37 FAILED (ABOVE: <h, BELOW: <ul)
       0  BLOCK 2 CLEARANCE CHECK POSITION 38 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 35 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 34 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 45
       0  BLOCK 2 CLEARANCE CHECK POSITION 45 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 46 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 44 FAILED (ABOVE: <h)
       0  BLOCK 2 CLEARANCE CHECK POSITION 43 FAILED (ABOVE: <h)
       0  BLOCK 2 INSERTION POSITIONS: *, 18, *, *, *
    Thread Starter salubritas

    (@salubritas)

    `I’ve manually installed the version suggested. WordPress said it was the same as the version installed, but I went ahead anyway.

    With the clearance settings off, block #2s are inserted after paras 12, 21, 32, 44, 53. In each case the block has an ordinary paragraph above and below. The clearance settings I normally have check for images, headings, blockquotes, lists etc. one para above and one para below, so they shouldn’t make any difference right?

    But with the clearance settings back I get just one block #2 showing, after para 21. The log shows it tried to insert a block at position 9 (this seems wrong – it should have ignored 3 paras with < 14 words). It is correct to fail the clearance check at para 9 (it has a heading above) so it then tries positions 10, 11, 8, 7. It thinks all of these fail the clearance check as well, but that is wrong. In each case it says it failed due to “ABOVE: <h”. But this is wrong, not all of those have a heading above.

    So in summary, with clearance checks turned on, it seems to be counting paras that it shouldn’t because they have fewer than 14 words, and it also seems to be failing clearance checks that should pass.

    Thread Starter salubritas

    (@salubritas)

    Hang on… positions are not the same as paragraphs it seems?

    Plugin Author Spacetime

    (@spacetime)

    Need to check on our test server with the same content and clearance settings.

    Thread Starter salubritas

    (@salubritas)

    Assuming that position #9 is actually para #12, what I said about the clearance checks failing incorrectly still holds – not all of the two paras above and below para #12 have a heading above.

    Thread Starter salubritas

    (@salubritas)

    OK thanks

    Plugin Author Spacetime

    (@spacetime)

    The problem has been identified and fixed.
    You can try the latest development version which contains a fix for the issue:
    https://downloads.wordpress.org/plugin/ad-inserter.zip

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Para word counting bug since v2.7.6’ is closed to new replies.