Passed
Push — master ( 6f0a6d...90a9ca )
by
unknown
09:41
created

MonsterInsights_Notification_Headline_Analyzer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 26
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A prepare_notification_data() 0 12 1
1
<?php
2
3
/**
4
 * Add notification for headline analyzer
5
 * Recurrence: 60 Days
6
 *
7
 * @since 7.12.3
8
 */
9
final class MonsterInsights_Notification_Headline_Analyzer extends MonsterInsights_Notification_Event {
10
11
	public $notification_id             = 'monsterinsights_notification_headline_analyzer';
12
	public $notification_interval       = 60; // in days
13
	public $notification_first_run_time = '+7 day';
14
	public $notification_type           = array( 'basic', 'lite', 'master', 'plus', 'pro' );
15
16
	/**
17
	 * Build Notification
18
	 *
19
	 * @return array $notification notification is ready to add
20
	 *
21
	 * @since 7.12.3
22
	 */
23
	public function prepare_notification_data( $notification ) {
24
		$notification['title']   = __( 'Headline Analyzer to Boost Your Clicks & Traffic', 'google-analytics-for-wordpress' );
25
		// Translators: Headline Analyzer notification content
26
		$notification['content'] = sprintf( __( 'Did you know that 36%% of SEO experts think the headline is the most important SEO element? Yet many website owners don’t know how to optimize their headlines for SEO and clicks. Instead, they write copy and hope for the best, only to see disappointing results. Now there’s an easier way! <br><br>%sWith the MonsterInsights Headline Analyzer%s, you can get targeted suggestions to improve your headlines, right in the WordPress editor.', 'google-analytics-for-wordpress' ), '<a href="'. $this->build_external_link('https://www.monsterinsights.com/announcing-monsterinsights-new-headline-analyzer/' ) .'" target="_blank">', '</a>' );
27
		$notification['btns'] = array(
28
			"learn_more" => array(
29
				'url'   => $this->build_external_link('https://www.monsterinsights.com/announcing-monsterinsights-new-headline-analyzer/' ),
30
				'text'  => __( 'Learn More', 'google-analytics-for-wordpress' )
31
			),
32
		);
33
34
		return $notification;
35
	}
36
37
}
38
39
// initialize the class
40
new MonsterInsights_Notification_Headline_Analyzer();
41