*/ namespace RankMath\SEO_Analysis; use RankMath\Helper; defined( 'ABSPATH' ) || exit; /** * Result class. */ class Result { /** * Result ID. * * @var string */ private $id; /** * Hold result data. * * @var array */ private $result; /** * Is sub-page. * * @var array */ private $is_subpage; /** * The Constructor. * * @param string $id Result id. * @param object $data Result data. * @param bool $is_subpage Is sub-page result. */ public function __construct( $id, $data, $is_subpage ) { if ( is_a( $data, 'RankMath\\SEO_Analysis\\Result' ) ) { $data = $data->result; } $this->id = $id; $this->result = $data; $this->is_subpage = $is_subpage; } /** * Magic method: convert object to string. */ public function __toString() { $kb_link = 'https://rankmath.com/kb/seo-analysis/'; if ( ! empty( $this->result['kb_link'] ) ) { $kb_link = $this->result['kb_link']; } ob_start(); ?>
' . wp_kses_post( join( ', ', (array) $data ) ) . '
';
return;
}
}
/**
* Render results list.
*
* @param array $data Keywords.
*/
private function the_list( $data ) {
$is_reverse_heading = $this->is_reverse_heading();
$html = '