'GET', 'callback' => array( $this, 'kpis' ), 'permission_callback' => static fn(): bool => current_user_can( 'manage_options' ), ) ); register_rest_route( self::NAMESPACE, '/dashboard/trends', array( 'methods' => 'GET', 'callback' => array( $this, 'trends' ), 'permission_callback' => static fn(): bool => current_user_can( 'manage_options' ), ) ); } /** * The three histories a dashboard should open with. * * Each is read from a record the plugin already keeps rather than from a * sampler that starts empty on install: the score is stamped on every * recalculation, findings on every audit run, and the day each page was * analysed is inside the analysis itself. On a site that has been running * for a fortnight all three are real lines the first time this loads. * * @return WP_REST_Response */ public function trends(): WP_REST_Response { $cached = get_transient( self::TREND_CACHE ); if ( is_array( $cached ) ) { return new WP_REST_Response( $cached ); } $this->freshen_score(); // The coverage figures travel with the series. On the first day there // is one reading, so a "total" tile and a "change since yesterday" // tile are the same number — printing it three times looks like a // fault. With these, the card can say what is *not* scored instead. $counts = \AiRankSuite\Support\Inventory::counts(); $payload = array( 'score' => $this->score_series(), 'findings' => $this->findings_series(), 'scored' => $this->scored_series(), 'coverage' => array( 'published' => (int) $counts['published'], 'analyzed' => (int) $counts['analyzed'], 'unanalyzed' => (int) $counts['unanalyzed'], ), 'meta' => $this->meta(), ); set_transient( self::TREND_CACHE, $payload, 10 * MINUTE_IN_SECONDS ); return new WP_REST_Response( $payload ); } /** * A reading of the score when the last one is a day old. * * The daily cron event exists, but WP-Cron only runs when somebody * visits the site, and a quiet site can go days without a visit. The * person who then opens the dashboard sees a line whose last date is * from before the quiet spell and reads it as broken. So the dashboard * takes the reading itself when the last one is older than twenty hours: * the score calculator is a few settings lookups, cheaper than the * charts drawn from it, and the result is what the visitor came to see. */ private function freshen_score(): void { $history = get_option( 'airanksuite_geo_score_history', array() ); $last = is_array( $history ) && ! empty( $history ) ? end( $history ) : null; $stamped = is_array( $last ) ? (int) ( $last['time'] ?? 0 ) : 0; if ( $stamped > time() - 20 * HOUR_IN_SECONDS ) { return; } try { \AiRankSuite\Kernel::service( \AiRankSuite\Modules\GeoScore\Services\ScoreCalculator::class )->calculate(); } catch ( \Throwable $e ) { // A failed reading must not take the dashboard down with it; the // line simply keeps its last point and the cron event tries later. return; } } /** * When each line last moved and when it will move next. * * A line whose last label reads three weeks ago looks broken, and the * cards could not say why: the score line moves when the score is * recalculated, the findings line when an audit finishes. So each card * states its last reading and, when one is on the calendar, the next. * Labels are formatted here, in the site's timezone, like the points. * * @return array */ private function meta(): array { $history = get_option( 'airanksuite_geo_score_history', array() ); $last_point = is_array( $history ) && ! empty( $history ) ? end( $history ) : null; $score_last = is_array( $last_point ) ? (int) ( $last_point['time'] ?? 0 ) : 0; $score_next = (int) ( wp_next_scheduled( \AiRankSuite\Modules\GeoScore\GeoScoreModule::CRON_HOOK ) ?: 0 ); global $wpdb; $run = (string) get_option( 'airanksuite_audit_last', '' ); $ran = '' === $run ? '' : (string) $wpdb->get_var( $wpdb->prepare( 'SELECT MIN(created_at) FROM %i WHERE run_id = %s', Database::audit(), $run ) ); $last = '' === $ran ? 0 : (int) strtotime( $ran . ' UTC' ); // A run that found nothing writes no rows; its finish time is on the job. $job = get_option( 'airanksuite_audit_job' ); if ( 0 === $last && is_array( $job ) && '' !== $run && (string) ( $job['run_id'] ?? '' ) === $run ) { $last = (int) ( $job['ended'] ?? 0 ); } $audit_next = (int) ( wp_next_scheduled( 'airanksuite_job_audit_alerts' ) ?: 0 ); $running = is_array( $job ) && 'running' === ( $job['state'] ?? '' ); $label = static fn( int $t ): string => $t > 0 ? wp_date( 'M j, H:i', $t ) : ''; return array( 'score_last' => $label( $score_last ), 'score_next' => $label( $score_next ), 'findings_last' => $label( $last ), 'audit_next' => $label( $audit_next ), 'audit_running' => $running, ); } /** * AI-search score per day, from the history the calculator stamps. * * @return array */ private function score_series(): array { $history = get_option( 'airanksuite_geo_score_history', array() ); $out = array(); foreach ( array_slice( is_array( $history ) ? $history : array(), -60 ) as $point ) { $time = (int) ( $point['time'] ?? 0 ); if ( $time <= 0 ) { continue; } $out[] = array( 'date' => wp_date( 'M j, H:i', $time ), 'value' => (int) ( $point['value'] ?? 0 ), ); } return $out; } /** * Open findings per audit run, with the severity split of the last one. * * @return array */ private function findings_series(): array { global $wpdb; $table = Database::audit(); /* * A run that is still crawling has written some of its findings and * not the rest, so plotting it draws a cliff that reverses itself an * hour later. The audit job holds the id of the run in flight; it is * excluded until it completes, at which point it appears with its * real total. */ $job = get_option( 'airanksuite_audit_job' ); $running = is_array( $job ) && 'running' === ( $job['state'] ?? '' ) ? (string) ( $job['run_id'] ?? '' ) : ''; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $rows = $wpdb->get_results( $wpdb->prepare( "SELECT run_id, MIN(created_at) AS ran, COUNT(*) AS total, SUM(severity = 'critical') AS critical, SUM(severity = 'warning') AS warning, SUM(severity = 'notice') AS notice FROM %i GROUP BY run_id ORDER BY ran DESC LIMIT 30", $table ), ARRAY_A ); $series = array(); foreach ( array_reverse( (array) $rows ) as $row ) { if ( '' !== $running && (string) $row['run_id'] === $running ) { continue; } $series[] = array( // wp_date, like the score series next to it. Two charts side // by side labelled in two different timezones is how a reading // taken at 2am appears to belong to the previous day in one // and the next day in the other. 'date' => wp_date( 'M j', (int) strtotime( (string) $row['ran'] . ' UTC' ) ), 'value' => (int) $row['total'], 'critical' => (int) $row['critical'], 'warning' => (int) $row['warning'], 'notice' => (int) $row['notice'], ); } return $series; } /** * Pages carrying a score, cumulative per day. * * Reconstructed from the timestamp inside each stored analysis, read in * pages so a hundred-thousand-page site does not load them all at once. * * @return array */ private function scored_series(): array { global $wpdb; $per_day = array(); $batch = 2000; $after = 0; /* * Keyset pagination, and no silent ceiling. * * This read LIMIT/OFFSET with no ORDER BY, which MySQL is free to * answer in any order it likes: successive pages could repeat a row or * skip one, so the same site could draw a different curve on two * consecutive loads. And the loop stopped dead at offset 20000, so a * catalogue larger than that was charted from an arbitrary fifth of * itself, with nothing on screen saying so — on a plugin that * advertises itself for hundred-thousand-page sites. * * Walking meta_id upwards is stable and needs no OFFSET at all. The * bound is a runaway guard, not a policy: at 2000 a page it allows two * million analyses, and it is logged rather than swallowed. */ $guard = 1000; while ( $guard-- > 0 ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $rows = $wpdb->get_results( $wpdb->prepare( "SELECT meta_id, meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s AND meta_id > %d ORDER BY meta_id ASC LIMIT %d", '_airanksuite_analysis', $after, $batch ), ARRAY_A ); if ( empty( $rows ) ) { break; } foreach ( $rows as $row ) { $after = (int) $row['meta_id']; $raw = (string) $row['meta_value']; if ( false === strpos( $raw, 'analyzed_at' ) ) { continue; } $decoded = json_decode( $raw, true ); $at = is_array( $decoded ) ? (int) ( $decoded['analyzed_at'] ?? 0 ) : 0; if ( $at > 0 ) { // Bucketed by the site's day, not UTC's: a page scored at // 1am in Dubai belongs to that morning, not to the evening // before, and the score chart beside it already agrees. $day = wp_date( 'Y-m-d', $at ); $per_day[ $day ] = ( $per_day[ $day ] ?? 0 ) + 1; } } unset( $rows ); } if ( $guard <= 0 && defined( 'WP_DEBUG' ) && WP_DEBUG ) { // Two million analyses is not a real site; if this ever fires the // query is wrong, not the catalogue. Say so where a developer looks // rather than inventing a warning for a customer who cannot act. error_log( 'AI Rank Suite: scored_series stopped at the runaway guard; the curve is incomplete.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log } ksort( $per_day ); /* * The curve is cumulative, so it starts where the site already was. * * The last sixty days were sliced off first and the running total then * began at zero, which drew a site with forty thousand scored pages as * a line rising from nothing — and on a site that scored everything * three months ago and nothing since, as a flat line at zero. The * baseline is everything before the window. */ $window = array_slice( $per_day, -60, null, true ); $baseline = 0; foreach ( $per_day as $day => $count ) { if ( isset( $window[ $day ] ) ) { break; } $baseline += (int) $count; } $series = array(); $cumulative = $baseline; foreach ( $window as $day => $count ) { $cumulative += (int) $count; $series[] = array( 'date' => wp_date( 'M j', (int) strtotime( $day . ' 12:00:00 UTC' ) ), 'value' => $cumulative, ); } return $series; } public function kpis(): WP_REST_Response { $cached = get_transient( self::CACHE ); if ( is_array( $cached ) ) { return new WP_REST_Response( $cached ); } $payload = array( 'geo' => $this->geo(), 'visibility' => $this->visibility(), 'content' => $this->content(), 'links' => $this->links(), 'search' => $this->search(), 'indexing' => $this->indexing(), 'commerce' => $this->commerce(), 'health' => $this->health(), 'audit' => $this->audit_open(), ); // Short TTL: the dashboard should feel live, but a reload storm must // not re-run eight aggregate queries per visit. set_transient( self::CACHE, $payload, 5 * MINUTE_IN_SECONDS ); return new WP_REST_Response( $payload ); } /** @return array */ private function geo(): array { $latest = get_option( 'airanksuite_geo_score_latest' ); $history = get_option( 'airanksuite_geo_score_history' ); $series = array(); foreach ( array_slice( is_array( $history ) ? $history : array(), -12 ) as $point ) { $series[] = (int) ( $point['value'] ?? 0 ); } $current = is_array( $latest ) ? (int) ( $latest['dimensions']['overall'] ?? 0 ) : 0; if ( empty( $series ) && $current > 0 ) { $series = array( $current ); } return array( 'value' => $current, 'series' => $series, 'delta' => count( $series ) > 1 ? $current - (int) $series[0] : null, 'time' => is_array( $latest ) ? (int) ( $latest['calculated_at'] ?? 0 ) : 0, ); } /** @return array */ private function visibility(): array { global $wpdb; $table = Database::mentions(); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $exists = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM %i", $table ) ); if ( 0 === $exists ) { return array( 'value' => null, 'series' => array(), 'mentioned' => 0, 'total' => 0 ); } // Answer simulation is a Pro module: the free edition ships without it, // so the panel reports "not measured" rather than referencing a class // that is not installed. $tracker = '\\AiRankSuite\\Modules\\AiVisibility\\Services\\VisibilityTracker'; if ( ! class_exists( $tracker ) ) { return array( 'value' => null, 'series' => array(), 'mentioned' => 0, 'total' => 0 ); } $latest = $tracker::latest(); $series = array(); foreach ( $tracker::history( 12 ) as $point ) { $series[] = (int) $point['value']; } return array( 'value' => $tracker::score( $latest ), 'series' => $series, 'delta' => count( $series ) > 1 ? $series[ count( $series ) - 1 ] - $series[0] : null, 'mentioned' => count( array_filter( $latest, static fn( $r ) => ! empty( $r->mentioned ) ) ), 'total' => count( $latest ), ); } /** @return array */ private function content(): array { global $wpdb; // The same population as every other counter (Support\Inventory): // published pages of the eligible types. Scores on drafts, templates // and trashed posts exist in postmeta but are not the site's number. $counts = \AiRankSuite\Support\Inventory::counts(); $types = (array) $counts['types']; if ( empty( $types ) ) { return array( 'analyzed' => 0, 'pages' => 0, 'avg_geo' => 0, 'avg_seo' => 0, 'distribution' => array( 0, 0, 0, 0, 0 ) ); } $in = implode( ',', array_fill( 0, count( $types ), '%s' ) ); // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $row = $wpdb->get_row( $wpdb->prepare( "SELECT AVG(CAST(g.meta_value AS DECIMAL(5,1))) AS avg_geo, AVG(CAST(s.meta_value AS DECIMAL(5,1))) AS avg_seo FROM {$wpdb->posts} p INNER JOIN {$wpdb->postmeta} g ON g.post_id = p.ID AND g.meta_key = '_airanksuite_geo_score' LEFT JOIN {$wpdb->postmeta} s ON s.post_id = p.ID AND s.meta_key = '_airanksuite_seo_score' WHERE p.post_type IN ({$in}) AND p.post_status = 'publish'", ...$types ) ); // Distribution for a mini bar chart: how many pages per score band. $bands = $wpdb->get_results( $wpdb->prepare( "SELECT FLOOR(CAST(g.meta_value AS DECIMAL(5,1)) / 20) AS band, COUNT(*) AS n FROM {$wpdb->posts} p INNER JOIN {$wpdb->postmeta} g ON g.post_id = p.ID AND g.meta_key = '_airanksuite_geo_score' WHERE p.post_type IN ({$in}) AND p.post_status = 'publish' GROUP BY band", ...$types ) ); // phpcs:enable $distribution = array_fill( 0, 5, 0 ); foreach ( (array) $bands as $band ) { $index = max( 0, min( 4, (int) $band->band ) ); $distribution[ $index ] += (int) $band->n; } return array( 'analyzed' => (int) $counts['analyzed'], 'pages' => (int) $counts['published'], 'avg_geo' => (int) round( (float) ( $row->avg_geo ?? 0 ) ), 'avg_seo' => (int) round( (float) ( $row->avg_seo ?? 0 ) ), 'distribution' => array_values( $distribution ), ); } /** @return array */ private function links(): array { global $wpdb; $found = Database::found_links(); // Published scan only; with none published the flag is 0 and nothing matches. $scope = \AiRankSuite\Support\StoredReads::linkscan_scope(); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $row = $wpdb->get_row( $wpdb->prepare( 'SELECT COUNT(*) AS total, SUM(status >= 400 OR (status = 0 AND checked_at IS NOT NULL)) AS broken, SUM(status >= 300 AND status < 400) AS redirected FROM %i WHERE ( %d = 1 AND run_id = %s )', $found, $scope[0], $scope[1] ) ); $not_found = Database::not_found(); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $errors = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM %i", $not_found ) ); $redirects = Database::redirects(); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $rules = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM %i", $redirects ) ); return array( 'checked' => (int) ( $row->total ?? 0 ), 'broken' => (int) ( $row->broken ?? 0 ), 'redirected' => (int) ( $row->redirected ?? 0 ), 'not_found' => $errors, 'redirects' => $rules, ); } /** @return array */ private function search(): array { global $wpdb; $connected = is_array( get_option( 'airanksuite_gsc_tokens' ) ); $ranks = Database::ranks(); $keywords = Database::keywords(); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $tracked = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM %i", $keywords ) ); // Latest snapshot per keyword, then the aggregate over that snapshot. // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $row = $wpdb->get_row( $wpdb->prepare( "SELECT AVG(r.position) AS avg_position, SUM(r.position <= 10) AS top10, SUM(r.position <= 3) AS top3, SUM(r.clicks) AS clicks, SUM(r.impressions) AS impressions FROM %i r INNER JOIN ( SELECT keyword_id, MAX(snapshot_date) AS d FROM %i GROUP BY keyword_id ) latest ON latest.keyword_id = r.keyword_id AND latest.d = r.snapshot_date", $ranks, $ranks ) ); // Clicks per snapshot date for the sparkline. // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared /* * The last thirty snapshots, in date order. * * `ORDER BY snapshot_date ASC LIMIT 30` takes the *oldest* thirty, so * on any site with more history than that the sparkline froze on its * first month and never moved again however the traffic changed. The * newest thirty are selected first, then turned back the right way * round for drawing. */ $series = $wpdb->get_col( $wpdb->prepare( "SELECT c FROM ( SELECT SUM(clicks) AS c, snapshot_date FROM %i GROUP BY snapshot_date ORDER BY snapshot_date DESC LIMIT 30 ) recent ORDER BY recent.snapshot_date ASC", $ranks ) ); return array( 'connected' => $connected, 'tracked' => $tracked, 'avg_position' => null !== ( $row->avg_position ?? null ) ? round( (float) $row->avg_position, 1 ) : null, 'top10' => (int) ( $row->top10 ?? 0 ), 'top3' => (int) ( $row->top3 ?? 0 ), 'clicks' => (int) ( $row->clicks ?? 0 ), 'impressions' => (int) ( $row->impressions ?? 0 ), 'series' => array_map( 'intval', (array) $series ), ); } /** @return array */ private function indexing(): array { $options = \AiRankSuite\Kernel::service( Options::class ); $indexnow = $options->get( 'indexnow', array( 'enabled' => false ) ); $log = get_option( 'airanksuite_indexnow_log' ); $log = is_array( $log ) ? $log : array(); $google = get_option( 'airanksuite_indexing_log' ); $google = is_array( $google ) ? $google : array(); $week = time() - WEEK_IN_SECONDS; return array( 'indexnow_on' => ! empty( $indexnow['enabled'] ), 'indexnow_week' => count( array_filter( $log, static fn( $e ) => (int) ( $e['time'] ?? 0 ) > $week ) ), 'google_on' => '' !== (string) get_option( 'airanksuite_google_service_account', '' ), 'google_week' => count( array_filter( $google, static fn( $e ) => (int) ( $e['time'] ?? 0 ) > $week ) ), 'llms_txt' => ! empty( $options->get( 'llms_txt', array( 'enabled' => false ) )['enabled'] ), ); } /** @return array */ private function commerce(): array { if ( ! class_exists( 'WooCommerce' ) ) { return array( 'active' => false ); } global $wpdb; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $products = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = %s AND post_status = %s", 'product', 'publish' ) ); $google = get_transient( 'airanksuite_feed_google' ); $meta = get_transient( 'airanksuite_feed_meta' ); $out = array( 'active' => true, 'products' => $products, 'feed_google' => is_string( $google ) ? substr_count( $google, '' ) : null, 'feed_meta' => is_string( $meta ) ? substr_count( $meta, '' ) : null, ); // The shop band on the dashboard: readiness and the three biggest gaps. if ( class_exists( \AiRankSuite\Modules\WooCommerce\Services\StoreOverview::class ) ) { $overview = \AiRankSuite\Modules\WooCommerce\Services\StoreOverview::run(); $out['readiness'] = (int) ( $overview['readiness'] ?? 0 ); $out['counts'] = (array) ( $overview['counts'] ?? array() ); $out['unscored'] = (int) ( $overview['unscored'] ?? 0 ); $out['weakest'] = array_slice( (array) ( $overview['weakest'] ?? array() ), 0, 3 ); } return $out; } /** @return array */ /** * The open findings of the latest audit run, by severity. * * The dashboard tile labelled "Open findings" counted the site checks — a * handful of foundation tests — while linking to an audit page reporting * hundreds. On a live site it read "0 open findings" beside an audit that * had 43 warnings and 292 notices. The number a person looks at first said * everything was fine, and one click away nothing was. * * This is the same table and the same grouping the findings chart uses, so * the tile and the chart under it cannot disagree. * * @return array{total: int, critical: int, warning: int, notice: int} */ /** * Open findings from the last audit that actually finished. * * The run is read from `airanksuite_audit_last`, the option the auditor writes * when a run reaches its final phase, and which the audit report itself * uses. It used to be derived from the newest row in the table, which is * not the same thing twice over: a run that found nothing writes no rows, * so the newest row still belonged to the run before it and the dashboard * kept showing findings that had just been fixed; and while a run is in * progress its half-written rows are the newest, so the tile counted a * fraction of a run as if it were the whole. Both are gone: no finished * run, no number. */ private function audit_open(): array { global $wpdb; $run = (string) get_option( 'airanksuite_audit_last', '' ); $rules_total = count( \AiRankSuite\Modules\SiteAudit\Services\Auditor::checks() ); if ( '' === $run ) { return array( 'total' => 0, 'critical' => 0, 'warning' => 0, 'notice' => 0, 'rules' => 0, 'rules_critical' => 0, 'rules_total' => $rules_total, 'pages' => 0 ); } $table = Database::audit(); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $row = $wpdb->get_row( $wpdb->prepare( "SELECT COUNT(*) AS total, SUM(severity = 'critical') AS critical, SUM(severity = 'warning') AS warning, SUM(severity = 'notice') AS notice, COUNT(DISTINCT check_id) AS rules, COUNT(DISTINCT CASE WHEN severity = 'critical' THEN check_id END) AS rules_critical, COUNT(DISTINCT post_id) AS pages FROM {$table} WHERE run_id = %s", $run ), ARRAY_A ); /* * Both numbers, because they answer different questions. * * A site of 2,538 pages reported 17,733 open findings, which is a wall * rather than a number: nobody opens a list of seventeen thousand. The * same run came from twelve rules. A rule is the unit of work, because * one fix to a template clears every page it touches at once, so the * dashboard counts rules and keeps the finding count as the detail * underneath it. */ return array( 'total' => (int) ( $row['total'] ?? 0 ), 'critical' => (int) ( $row['critical'] ?? 0 ), 'warning' => (int) ( $row['warning'] ?? 0 ), 'notice' => (int) ( $row['notice'] ?? 0 ), 'rules' => (int) ( $row['rules'] ?? 0 ), 'rules_critical' => (int) ( $row['rules_critical'] ?? 0 ), 'rules_total' => $rules_total, 'pages' => (int) ( $row['pages'] ?? 0 ), ); } private function health(): array { $quarantine = get_option( 'airanksuite_quarantine' ); return array( 'modules' => count( \AiRankSuite\Kernel::instance()->moduleIds() ), 'quarantined' => is_array( $quarantine ) ? count( $quarantine ) : 0, // A caught throw on the public site is invisible to the visitor by // design — which is exactly why it has to be loud in here. 'hook_faults' => count( \AiRankSuite\Support\Guard::failures() ), 'conflict' => \AiRankSuite\Modules\Seo\SeoModule::conflict(), 'permalinks' => (bool) get_option( 'permalink_structure' ), ); } }