Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
WordAds_Ccpa_Do_Not_Sell_Link_Widget
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
 widget
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * CCPA Do Not Sell Widget
4 *
5 * @package automattic/jetpack
6 */
7
8if ( ! defined( 'ABSPATH' ) ) {
9    exit( 0 );
10}
11
12/**
13 * Class WordAds_Ccpa_Do_Not_Sell_Link_Widget
14 */
15class WordAds_Ccpa_Do_Not_Sell_Link_Widget extends WP_Widget {
16
17    /**
18     * WordAds_Ccpa_Do_Not_Sell_Link_Widget constructor.
19     */
20    public function __construct() {
21        parent::__construct(
22            'wordads_ccpa_do_not_sell_link_widget',
23            /** This filter is documented in modules/widgets/facebook-likebox.php */
24            apply_filters( 'jetpack_widget_name', __( 'Do Not Sell Link (US Privacy)', 'jetpack' ) ),
25            array(
26                'description'                 => __( 'Inserts "Do Not Sell or Share My Personal Information" link required by some US states to opt-out of targeted advertising', 'jetpack' ),
27                'customize_selective_refresh' => true,
28            )
29        );
30    }
31
32    /**
33     * Widget outputter.
34     *
35     * @param array $args Widget args.
36     * @param array $instance Widget instance.
37     */
38    public function widget( $args, $instance ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
39        echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
40        echo do_shortcode( '[privacy-do-not-sell-link]' );
41        echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
42    }
43}