We are based in Italy with a GMT+1/GMT+2 time zone - support replies may be delayed due to time zone differences with your country.
September 25, 2019 at 3:32 am #67942
We installed the pro version of the plugin on our website and noticed a huge discrepancy in the word count. For instance, WordPress says 502 whereas the plugin shows it as 582. Could you fix this problem for us? With such a big deviation, it’s impossible to use the plugin on our site.
DivyaSeptember 25, 2019 at 12:20 pm #67951
Could you link to one example post having the issue, so we can try to reproduce the issue? 🙂
Have a nice day,
StefanoSeptember 25, 2019 at 12:31 pm #67954
DivyaThis reply has been marked as private.September 25, 2019 at 11:02 pm #67968
Uhm, this is difficult to debug, the public content copied-pasted in my local WordPress reports 601 words from WP. Could you maybe copy here the HTML version of the post, taken from the editor?September 26, 2019 at 12:06 am #67973
DivyaThis reply has been marked as private.September 26, 2019 at 12:10 am #67975
I think the plugin is counting the caption tags:
[caption id="attachment_20637" align="aligncenter" width="586"]. These are all over in the post.September 26, 2019 at 11:09 am #67982
You are right. I am going to add an option to allow the shortcodes to be applied when words are counted. If you want to test this before release, this is the relevant part of code, starting at line 262 of post-pay-counter/classes/ppc_counting_stuff_class.php:123456789101112131415161718192021//Handle input parameterif( is_a( $post, 'WP_Post' ) )$post_content = apply_filters( 'ppc_count_post_words_post_content_start', $post->post_content, $post->ID );else if( is_string( $post ) )$post_content = apply_filters( 'ppc_count_post_words_post_content_start', $post );elsereturn new WP_Error( 'ppc_invalid_argument', 'count_post_words only accepts a WP_post istance or a text string', array( $post ) );//Strip tags & content with class="ppc_exclude_words" (doesn't handle nested tags, ie <div class="ppc_exclude_posts">some content <div class="nested">nested content</div> this will already be counted</div>$purged_content = preg_replace( '/<([^>]*) [^>]*class=("|\')ppc_exclude_words("|\')[^>]*>(.*?)<\/\1>/s', '', $post_content );if( self::$settings['counting_exclude_quotations'] )$purged_content = preg_replace( '/<(blockquote|q)>(.*?)<\/(blockquote|q)>/s', '', $purged_content );if( self::$settings['counting_words_exclude_pre'] )$purged_content = preg_replace( '/<(pre)>(.*?)<\/(pre)>/s', '', $purged_content );if( ! has_shortcode( $post_content, 'ppc' ) )$purged_content = do_shortcode( $purged_content );$purged_content = strip_tags( $purged_content );September 26, 2019 at 7:36 pm #67992
I see. When will the update be available?September 26, 2019 at 9:54 pm #67995
I would say no later than saturday, I’ll keep you posted 🙂
September 28, 2019 at 4:02 am #68027
- This reply was modified 2 months, 2 weeks ago by Stefano.
Good to know. Looks like just in time before we rollup and make payment to our authors!September 28, 2019 at 11:10 am #68034
Just released! It’s a new, opt-in option, you can find it in Options > Counting settings > Words payment.
Let me know! 🙂
Have a nice day,
StefanoSeptember 29, 2019 at 3:17 am #68066
It works now! Thanks Stefano.September 29, 2019 at 9:42 am #68073
Good, super glad to hear that! 🙂