Hey there,
Is it just on new tweets or all old tweet boxes affected?
Can you send a link to a page (it can be a page that doesn’t appear in menus) with a broken box for me to investigate?
Thanks!
Ben
It seems to only be the new ones but I haven’t been able to check every single page. This is a link to a page where I had to shorten the tweet significantly to get it to work:
http://www.thebookwheelblog.com/buick-audiobooks-and-the-perfect-weekend/
I need a link to one that is broken in order to troubleshoot.
If you want, you can make a page (not post) that is hidden (i.e. it doesn’t show up in a menu anywhere) and I can then see what’s going on.
Also, send along the full text that you were trying to include in the Buick tweet above.
Thanks! We will definitely get you sorted out. I appreciate you help tracking down the bug.
Ben
Here’s a page with a tweet:
http://www.thebookwheelblog.com/better-click-to-tweet/
And the original tweet that cuts off says:
[bctt tweet=”This is what happens with longer tweets that extend beyond 60-80 characters #betterclicktotweet #twitter”]
Thanks!
Here’s what’s going on: your twitter name (once you include the ” via @” takes up 18 characters. The URL linking back to your site takes up 22 characters (that’s automatic and unavoidable based on Twitter’s t.co URL shortener.) 18+22 = 40 so you have only 100 characters to deal with. If I trim your text down to 100 characters, it cuts it off in the middle of the #twitter hashtag. Since my plugin doesn’t truncate mid-word, it goes back to the first space before the 100th character, and truncates there.
So, the truncation portion of my plugin is working as expected. but instead of add an elipsis “…” it was adding the strange character. Thanks to your support ticket, I have tracked down the bug and fixed it. Updating to 4.5.1 will fix the issue.
Thanks so much for using my plugin, and for taking the time to report a bug! Happy blogging!
If my plugins have helped you, I’d appreciate your keeping my 5-star review string going, and all donations go toward continuing to develop great plugins!
Great, thank you! I updated some tweets on the page because (and I’m sure this is me just not getting it), I am still getting cut off early.
On the page I linked above, I quoted the original tweet with and without the via yes/no, as well as the length where which it cuts off – one cuts off at 89 (which makes sense because the next word puts it at exactly 100 characters with the via yes) and one cuts off at 103, although the via is no and should allow for 118 characters (the next word would bring it to 115, which should fit).
What am I missing?
Thanks again!
There’s an outside chance that your server is running a really old version of PHP, which could mean that it is incorrectly counting non-standard characters (like the & in the tweet above). To rule that out, can you test a string with only roman characters?
I just re-looked at my code, and we actually have only 117 characters to deal with. The reason is that some t.co urls take 23 characters (specifically the ones with https:// at the beginning.) so my plugin uses 117 as the total.
That doesn’t answer the question as to why your last tweet is truncated, and I’m honestly not sure what’s going on there. Let’s try the letters only tweet to see if that tracks down the problem.
Thanks!
Glad I’m not crazy! I added a new tweet and it seems to be working properly – what do I need to tell my hosting company?
First you need to determine what version of PHP you are running. You can ask them for that info, or do some sleuthing to find it out. There are plugins out there to determine what version of PHP you are running, or you could follow the guide here:
https://codex.wordpress.org/Finding_Server_Info
The crucial thing that we need to determine is that they have the mbstring php extension loaded. it’s very common (took me 5,000 downloads before any of my users didn’t have it), and without it, it’ll just count things slightly wrong when there are non-roman characters.
The good news is, you are still getting 100ish characters, and all the research shows that the shorter the tweet, the more likely folks will share it.
Thanks!