# wordpress-seo/18.6/src/services/health-check/page-comments-runner.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version 18.6. 43 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/18.6/code/src/services/health-check/page-comments-runner.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/18.6/raw/src/services/health-check/page-comments-runner.php
- Modified: 2022-03-22T14:19:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/18.6/code/src/services/health-check/page-comments-runner.php#L10-L20`.

```php
<?php

namespace Yoast\WP\SEO\Services\Health_Check;

/**
 * Runs the Page_Comments health check.
 */
class Page_Comments_Runner implements Runner_Interface {

	/**
	 * Is set to true when comments are set to display on a single page.
	 *
	 * @var bool
	 */
	private $comments_on_single_page;

	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->comments_on_single_page = false;
	}

	/**
	 * Runs the health check. Checks if comments are displayed on a single page.
	 *
	 * @return void
	 */
	public function run() {
		$this->comments_on_single_page = get_option( 'page_comments' ) !== '1';
	}

	/**
	 * Returns true if comments are displayed on a single page.
	 *
	 * @return bool True if comments are displayed on a single page.
	 */
	public function is_successful() {
		return $this->comments_on_single_page;
	}
}


```
