• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 6987097851

25 Nov 2023 04:49AM UTC coverage: 49.206% (-0.1%) from 49.302%
6987097851

push

github

web-flow
Merge pull request #20878 from Yoast/JRF/ghactions-minor-tweak

GH Actions: update a few links in inline comments

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/admin/tracking/class-tracking-default-data.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin\Tracking
6
 */
7

8
/**
9
 * Represents the default data.
10
 */
11
class WPSEO_Tracking_Default_Data implements WPSEO_Collection {
12

13
        /**
14
         * Returns the collection data.
15
         *
16
         * @return array The collection data.
17
         */
18
        public function get() {
×
19
                return [
20
                        'siteTitle'       => get_option( 'blogname' ),
×
21
                        '@timestamp'      => (int) gmdate( 'Uv' ),
×
22
                        'wpVersion'       => $this->get_wordpress_version(),
×
23
                        'homeURL'         => home_url(),
×
24
                        'adminURL'        => admin_url(),
×
25
                        'isMultisite'     => is_multisite(),
×
26
                        'siteLanguage'    => get_bloginfo( 'language' ),
×
27
                        'gmt_offset'      => get_option( 'gmt_offset' ),
×
28
                        'timezoneString'  => get_option( 'timezone_string' ),
×
29
                        'migrationStatus' => get_option( 'yoast_migrations_free' ),
×
30
                        'countPosts'      => $this->get_post_count( 'post' ),
×
31
                        'countPages'      => $this->get_post_count( 'page' ),
×
32
                ];
33
        }
34

35
        /**
36
         * Returns the number of posts of a certain type.
37
         *
38
         * @param string $post_type The post type return the count for.
39
         *
40
         * @return int The count for this post type.
41
         */
42
        protected function get_post_count( $post_type ) {
×
43
                $count = wp_count_posts( $post_type );
×
44
                if ( isset( $count->publish ) ) {
×
45
                        return $count->publish;
×
46
                }
47
                return 0;
×
48
        }
49

50
        /**
51
         * Returns the WordPress version.
52
         *
53
         * @return string The version.
54
         */
55
        protected function get_wordpress_version() {
×
56
                global $wp_version;
×
57

58
                return $wp_version;
×
59
        }
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc