chuckreynolds / WPFBOGP

WordPress Open Graph plugin development
wordpress.org/plugins/wp-facebook-open-graph-protocol/
13 stars 19 forks source link

Improve description extracting #45

Closed garex closed 9 years ago

garex commented 9 years ago

So for non-english posts description will be exactly 160 chars not 80

chuckreynolds commented 9 years ago

Question - does it really need the fallback on mb_substr?
WordPress = "PHP 5.4 or greater" ref: https://wordpress.org/about/requirements/ mb_substr = "PHP 4 >= 4.0.6, PHP 5" ref: http://php.net/manual/en/function.mb-substr.php

chuckreynolds commented 9 years ago

also - feel free to checkout hotfix/2.0.12 branch as a lot has changed. @garex

garex commented 9 years ago
  1. Yes. PHP is not as much other langs with UTF inside. So it's a MUST to extract non-english string of required length, not only 50% of them.
  2. PHP 5.4 recommended. 5.2 is required. See real-time stats of usage.
chuckreynolds commented 9 years ago

Oh I think using mb_substr is a good idea. I'm just thinking the fallback function is not needed since all versions of WordPress require a version of PHP that does support mb_substr.

Right? :)

garex commented 9 years ago

Fallback required as

mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option. See the Install section for details.

http://php.net/manual/en/mbstring.installation.php

chuckreynolds commented 9 years ago

Ah okay. I'm not aware so thank you for the information. I'm assuming you've tested this? It's hard for me to test other languages and non-utf8 stuff so that would help.

I can, at some point, get this merged into hotfix/2.0.12

garex commented 9 years ago

Yes, it's tested. Feel free.


Alexander Ustimenko +7 (952) 918-02-20

2015-02-14 8:52 GMT+06:00 Chuck Reynolds notifications@github.com:

Ah okay. I'm not aware so thank you for the information. I'm assuming you've tested this? It's hard for me to test other languages and non-utf8 stuff so that would help.

I can, at some point, get this merged into hotfix/2.0.12

— Reply to this email directly or view it on GitHub https://github.com/chuckreynolds/WPFBOGP/pull/45#issuecomment-74358480.

chuckreynolds commented 9 years ago

modified and merged into develop 1aa61a6b62b12222c7ca4040ff5b4db4dccac2ad