Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Comments
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 2
30
0.00% covered (danger)
0.00%
0 / 1
 is_enabled
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
20
 init
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Jetpack Comments.
4 *
5 * @package automattic/jetpack-comments
6 */
7
8namespace Automattic\Jetpack\Comments;
9
10/**
11 * Package entry point.
12 */
13class Comments {
14
15    /**
16     * Package version.
17     */
18    const PACKAGE_VERSION = '0.9.1';
19
20    /**
21     * Whether Jetpack Comments handles comments on the current blog. Checked again where comments render,
22     * since a process can load it for one blog and then switch to another.
23     *
24     * @since 0.1.0
25     *
26     * @return bool
27     */
28    public static function is_enabled() {
29        // Blog 522232 is jetpack.wordpress.com, which serves the Verbum iframe to sites on older Jetpack versions.
30        if ( defined( 'IS_WPCOM' ) && IS_WPCOM && 522232 === get_current_blog_id() ) {
31            return false;
32        }
33
34        /**
35         * Whether Jetpack Comments handles comments on the current blog.
36         *
37         * @since $$next-version$$
38         *
39         * @param bool $enabled Default true.
40         */
41        return (bool) apply_filters( 'jetpack_comments_enabled', true );
42    }
43
44    /**
45     * Register the package's features. Safe to call more than once.
46     *
47     * @since 0.1.0
48     *
49     * @return void
50     */
51    public static function init() {
52        Comment_Form::init();
53        Checkpoint::init();
54        Avatars::init();
55        Block_Editor::init();
56        Embeds::init();
57        Tracks::init();
58    }
59}