the-seo-framework icon indicating copy to clipboard operation
the-seo-framework copied to clipboard

PHP Pixel Counter

Open sybrew opened this issue 8 years ago • 5 comments

Previous: https://github.com/sybrew/the-seo-framework/issues/161#issuecomment-309193478

Now the Pixel Counter has been implemented for JS, we also need to do this for PHP. So, the SEO Bar complies to what's used.

Because the Pixel Counter shows the true size, users will more likely see a wall of yellow, which isn't what we want.

PHP text length calculation will severely tax the server. So, we still need to find a way to preemptively cache this value. Maybe even through save, where we add the "good/bad" lengths as metadata set through JavaScript (with a fallback to PHP).

sybrew avatar Oct 13 '17 09:10 sybrew

Before storing this as meta, I first want this to be implemented: https://github.com/sybrew/the-seo-framework/issues/185

When we plan to follow a different route than storing it as meta, this comment can be ignored.

sybrew avatar Nov 29 '17 14:11 sybrew

From David's comment: If this implementation is not ready by the next update, notify in the tooltip that the title or description is "okay" or even "bad" by the character counter, instead of the pixel counter.

  • [x] Implemented for v3.3.0

image

sybrew avatar Dec 13 '17 18:12 sybrew

We keep punting this as the performance trade-off and absence of core rendering components in PHP isn't worth the inclusion. Let's see if PHP 7.x has anything useful when we get there.

Moreover, we need a license to use the Arial font—which isn't freely given. Alternatives exist, like LiberationSans under the SIL Open Font License, but it's not ideal including a 1MB load of source files.

sybrew avatar Jul 01 '19 04:07 sybrew

We'll probably move this as a PHP 8-only feature (December 2020), where a lot more processing power will be available.

sybrew avatar Jun 05 '20 14:06 sybrew