|
@@ -11,7 +11,7 @@ discard block |
|
|
block discarded – undo |
|
11
|
11
|
* @since 0.1 |
|
12
|
12
|
* @author Debjit Saha |
|
13
|
13
|
*/ |
|
14
|
|
-class MonsterInsightsHeadlineToolPlugin{ |
|
|
14
|
+class MonsterInsightsHeadlineToolPlugin { |
|
15
|
15
|
|
|
16
|
16
|
/** |
|
17
|
17
|
* Class Variables. |
|
@@ -142,21 +142,13 @@ discard block |
|
|
block discarded – undo |
|
142
|
142
|
$result->length = strlen( str_replace( ' ', '', $input ) ); |
|
143
|
143
|
$scoret = $scoret + 3; |
|
144
|
144
|
|
|
145
|
|
- if ( $result->length <= 19 ) { $scoret += 5; } |
|
146
|
|
- elseif ( $result->length >= 20 && $result->length <= 34 ) { $scoret += 8; } |
|
147
|
|
- elseif ( $result->length >= 35 && $result->length <= 66 ) { $scoret += 11; } |
|
148
|
|
- elseif ( $result->length >= 67 && $result->length <= 79 ) { $scoret += 8; } |
|
149
|
|
- elseif ( $result->length >= 80 ) { $scoret += 5; } |
|
|
145
|
+ if ( $result->length <= 19 ) { $scoret += 5; } elseif ( $result->length >= 20 && $result->length <= 34 ) { $scoret += 8; } elseif ( $result->length >= 35 && $result->length <= 66 ) { $scoret += 11; } elseif ( $result->length >= 67 && $result->length <= 79 ) { $scoret += 8; } elseif ( $result->length >= 80 ) { $scoret += 5; } |
|
150
|
146
|
|
|
151
|
147
|
// Count - typically 6-7 words |
|
152
|
148
|
$result->word_count = count( $input_array ); |
|
153
|
149
|
$scoret = $scoret + 3; |
|
154
|
150
|
|
|
155
|
|
- if ( $result->word_count == 0 ) { $scoret = 0; } |
|
156
|
|
- else if ( $result->word_count >= 2 && $result->word_count <= 4 ) { $scoret += 5; } |
|
157
|
|
- elseif ( $result->word_count >= 5 && $result->word_count <= 9 ) { $scoret += 11; } |
|
158
|
|
- elseif ( $result->word_count >= 10 && $result->word_count <= 11 ) { $scoret += 8; } |
|
159
|
|
- elseif ( $result->word_count >= 12 ) { $scoret += 5; } |
|
|
151
|
+ if ( $result->word_count == 0 ) { $scoret = 0; } else if ( $result->word_count >= 2 && $result->word_count <= 4 ) { $scoret += 5; } elseif ( $result->word_count >= 5 && $result->word_count <= 9 ) { $scoret += 11; } elseif ( $result->word_count >= 10 && $result->word_count <= 11 ) { $scoret += 8; } elseif ( $result->word_count >= 12 ) { $scoret += 5; } |
|
160
|
152
|
|
|
161
|
153
|
// Calculate word match counts |
|
162
|
154
|
$result->power_words = $this->match_words( $result->input, $result->input_array, $this->power_words() ); |
|
@@ -184,8 +176,9 @@ discard block |
|
|
block discarded – undo |
|
184
|
176
|
|
|
185
|
177
|
if ( $result->uncommon_words_per < 0.1 ) { |
|
186
|
178
|
$result->word_balance_use[] = __('uncommon', 'google-analytics-for-wordpress'); |
|
187
|
|
- } else |
|
188
|
|
- $scoret = $scoret + 15; |
|
|
179
|
+ } else { |
|
|
180
|
+ $scoret = $scoret + 15; |
|
|
181
|
+ } |
|
189
|
182
|
|
|
190
|
183
|
if ( count( $result->power_words ) < 1 ) { |
|
191
|
184
|
$result->word_balance_use[] = __('power', 'google-analytics-for-wordpress'); |