sybrew/the-seo-framework

Turn SEO Bar item creation into a generator

Opened this issue · 0 comments

Currently, the SEO Bar items are generated procedurally. This means that one check is proceeded immediately by the next.

Converting this to a generator, like what we do with the robots items, will allow us to insert and bypass checks at any point, and users can remove checks if they so desire without disrupting the flow.

Here's how we handle the robots generator:

foreach ( static::assert_no( $sender ) as $key => $value ) {
yield $key => $value;
if ( $value ) {
yield static::HALT;
break;
}
}
break;