Skip to content

Commit a68e163

Browse files
authored
Merge pull request #449 from ProgressPlanner/develop
v1.4.0
2 parents 6d13674 + 95753c0 commit a68e163

95 files changed

Lines changed: 4652 additions & 1730 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/new-task-recommendation.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: |
99
Thank you for suggesting a new recommendation! Please fill out the following information to help us evaluate and implement your suggestion.
10-
10+
1111
**Note:** All fields are required unless marked as optional.
1212
1313
- type: input
@@ -36,7 +36,6 @@ body:
3636
options:
3737
- content-update
3838
- configuration
39-
- remote
4039
- user
4140
- other
4241
validations:
@@ -119,6 +118,6 @@ body:
119118
attributes:
120119
label: Additional Information
121120
description: Any other relevant information about this recommendation - optional -
122-
placeholder: "Add any additional context or requirements here..."
121+
placeholder: "Add any additional context or requirements here..."
123122
validations:
124123
required: false

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
= 1.4.0 =
2+
3+
Enhancements:
4+
5+
* Review Content task takes into account Yoast SEO readibility score when suggesting posts to update.
6+
* Change update frequency for articles which are not selected in "Your page" section or as Yoast SEO Cornerstone content to 12 months.
7+
* Factor in Yoast SEO readibility score when suggesting which articles should be updated.
8+
9+
Bugs we fixed:
10+
11+
* Fixed a bug where dismissed review content tasks would reappear in the following week.
12+
13+
Added these recommendations from Ravi:
14+
15+
* [Remove terms](http://prpl.fyi/remove-empty-taxonomy) which have less than 2 posts.
16+
* [Give description](http://prpl.fyi/taxonomy-terms-description) to terms which have more than 2 posts.
17+
* Suggest to install [Fewer Tags plugin](https://prpl.fyi/install-fewer-tags).
18+
* Yoast SEO: [do Yoast SEO's Cornerstone Content Workout](http://prpl.fyi/run-orphaned-content-workout).
19+
* Yoast SEO: [do Yoast SEO's Orphaned Content Workout](https://prpl.fyi/run-cornerstone-content-workout).
20+
* Yoast SEO: [add internal links](https://prpl.fyi/fix-orphaned-content) to articles which don't have them.
21+
122
= 1.3.0 =
223

324
Enhancements:

assets/js/external-link-accessibility-helper.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/* global prplDocumentReady */
1+
/* global prplDocumentReady, prplL10n */
22

33
/**
44
* External Link Accessibility Helper script.
55
* A script to add accessibility improvements to external links.
66
*
7-
* Dependencies: progress-planner/document-ready
7+
* Dependencies: progress-planner/document-ready, progress-planner/l10n
88
*/
99

1010
/**
@@ -58,9 +58,15 @@ class ExternalLinkAccessibilityHelper {
5858

5959
// Private: inject icon and screen-reader text
6060
_addAccessibilityMarkup( link ) {
61+
const accessibilityText = link.getAttribute(
62+
'data-prpl_accessibility_text'
63+
);
64+
6165
const srText = document.createElement( 'span' );
6266
srText.className = 'screen-reader-text';
63-
srText.textContent = '(Opens in new window)';
67+
srText.textContent = accessibilityText
68+
? accessibilityText + ' (' + prplL10n( 'opensInNewWindow' ) + ')'
69+
: prplL10n( 'opensInNewWindow' );
6470
link.appendChild( srText );
6571

6672
const iconWrapper = document.createElement( 'span' );

assets/js/web-components/prpl-suggested-task.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ customElements.define(
4141
taskHeading = `<a href="${ url }" target="${ url_target }">${ title }</a>`;
4242
}
4343

44-
const isRemoteTask = task_id.startsWith( 'remote-task-' );
45-
const isDismissable = dismissable || isRemoteTask;
46-
4744
const getTaskStatus = () => {
4845
let status = 'pending';
4946
window[ taskList ].tasks.forEach( ( task ) => {
@@ -173,7 +170,7 @@ customElements.define(
173170
</prpl-tooltip>`
174171
: '',
175172
complete:
176-
isDismissable && ! useCheckbox
173+
dismissable && ! useCheckbox
177174
? `<button
178175
type="button"
179176
class="prpl-suggested-task-button"
@@ -209,21 +206,22 @@ customElements.define(
209206
let checkboxStyle = 'margin-top: 2px;';
210207

211208
// If the task is not dismissable, checkbox is disabled and we want to show a tooltip.
212-
if ( ! isDismissable ) {
209+
if ( ! dismissable ) {
213210
checkboxStyle += 'pointer-events: none;';
214211
output += `<prpl-tooltip class="prpl-suggested-task-disabled-checkbox-tooltip">
215212
<slot name="open-icon">`;
216213
}
217214

218215
output += `<input
219216
type="checkbox"
217+
id="prpl-suggested-task-checkbox-${ task_id }"
220218
class="prpl-suggested-task-checkbox"
221219
style="${ checkboxStyle }"
222-
${ ! isDismissable ? 'disabled' : '' }
220+
${ ! dismissable ? 'disabled' : '' }
223221
${ getTaskStatus() === 'completed' ? 'checked' : '' }
224222
>`;
225223

226-
if ( ! isDismissable ) {
224+
if ( ! dismissable ) {
227225
output += `
228226
</slot>
229227
<slot name="content">
@@ -256,11 +254,19 @@ customElements.define(
256254
data-task-list="${ taskList }"
257255
>
258256
${ actionButtons.completeCheckbox }
259-
<h3 style="width: 100%;"><span${
260-
'user' === category
261-
? ` contenteditable="plaintext-only"`
262-
: ''
263-
}>${ taskHeading }</span></h3>
257+
<h3 style="width: 100%;">
258+
${
259+
useCheckbox
260+
? `<label for="prpl-suggested-task-checkbox-${ task_id }">`
261+
: ''
262+
}
263+
<span${
264+
'user' === category
265+
? ` contenteditable="plaintext-only"`
266+
: ''
267+
}>${ taskHeading }</span>
268+
${ useCheckbox && dismissable ? `</label>` : '' }
269+
</h3>
264270
<div class="prpl-suggested-task-actions">
265271
<div class="tooltip-actions">
266272
${ actionButtons.info }

assets/js/widgets/todo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ prplDocumentReady( () => {
128128
} )
129129
);
130130

131-
// Add the new task to the local tasks array.
131+
// Add the new task to the tasks array.
132132
progressPlannerTodo.tasks.push( newTask );
133133

134134
// Resize the grid items.
@@ -169,7 +169,7 @@ document.addEventListener( 'prpl/suggestedTask/move', () => {
169169
} );
170170

171171
// When the 'prpl/suggestedTask/update' event is triggered,
172-
// update the task title in the local tasks array.
172+
// update the task title in the tasks array.
173173
document.addEventListener( 'prpl/suggestedTask/update', ( event ) => {
174174
const task = progressPlannerTodo.tasks.find(
175175
( item ) =>

autoload.php

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?php
2+
/**
3+
* Autoload classes.
4+
*
5+
* @package Progress_Planner
6+
*/
7+
8+
spl_autoload_register(
9+
/**
10+
* Autoload classes.
11+
*
12+
* @param string $class_name The class name to autoload.
13+
*/
14+
function ( $class_name ) {
15+
$prefix = 'Progress_Planner\\';
16+
17+
if ( 0 !== \strpos( $class_name, $prefix ) ) {
18+
return;
19+
}
20+
21+
// Deprecated classes.
22+
$deprecated = [
23+
'Progress_Planner\Activity' => [ 'Progress_Planner\Activities\Activity', '1.1.1' ],
24+
'Progress_Planner\Query' => [ 'Progress_Planner\Activities\Query', '1.1.1' ],
25+
'Progress_Planner\Date' => [ 'Progress_Planner\Utils\Date', '1.1.1' ],
26+
'Progress_Planner\Cache' => [ 'Progress_Planner\Utils\Cache', '1.1.1' ],
27+
'Progress_Planner\Widgets\Activity_Scores' => [ 'Progress_Planner\Admin\Widgets\Activity_Scores', '1.1.1' ],
28+
'Progress_Planner\Widgets\Badge_Streak' => [ 'Progress_Planner\Admin\Widgets\Badge_Streak', '1.1.1' ],
29+
'Progress_Planner\Widgets\Challenge' => [ 'Progress_Planner\Admin\Widgets\Challenge', '1.1.1' ],
30+
'Progress_Planner\Widgets\Latest_Badge' => [ 'Progress_Planner\Admin\Widgets\Latest_Badge', '1.1.1' ],
31+
'Progress_Planner\Widgets\Published_Content' => [ 'Progress_Planner\Admin\Widgets\Published_Content', '1.1.1' ],
32+
'Progress_Planner\Widgets\Todo' => [ 'Progress_Planner\Admin\Widgets\Todo', '1.1.1' ],
33+
'Progress_Planner\Widgets\Whats_New' => [ 'Progress_Planner\Admin\Widgets\Whats_New', '1.1.1' ],
34+
'Progress_Planner\Widgets\Widget' => [ 'Progress_Planner\Admin\Widgets\Widget', '1.1.1' ],
35+
'Progress_Planner\Rest_API_Stats' => [ 'Progress_Planner\Rest\Stats', '1.1.1' ],
36+
'Progress_Planner\Rest_API_Tasks' => [ 'Progress_Planner\Rest\Tasks', '1.1.1' ],
37+
'Progress_Planner\Data_Collector\Base_Data_Collector' => [ 'Progress_Planner\Suggested_Tasks\Data_Collector\Base_Data_Collector', '1.1.1' ],
38+
'Progress_Planner\Data_Collector\Data_Collector_Manager' => [ 'Progress_Planner\Suggested_Tasks\Data_Collector\Data_Collector_Manager', '1.1.1' ],
39+
'Progress_Planner\Data_Collector\Hello_World' => [ 'Progress_Planner\Suggested_Tasks\Data_Collector\Hello_World', '1.1.1' ],
40+
'Progress_Planner\Data_Collector\Inactive_Plugins' => [ 'Progress_Planner\Suggested_Tasks\Data_Collector\Inactive_Plugins', '1.1.1' ],
41+
'Progress_Planner\Data_Collector\Last_Published_Post' => [ 'Progress_Planner\Suggested_Tasks\Data_Collector\Last_Published_Post', '1.1.1' ],
42+
'Progress_Planner\Data_Collector\Post_Author' => [ 'Progress_Planner\Suggested_Tasks\Data_Collector\Post_Author', '1.1.1' ],
43+
'Progress_Planner\Data_Collector\Sample_Page' => [ 'Progress_Planner\Suggested_Tasks\Data_Collector\Sample_Page', '1.1.1' ],
44+
'Progress_Planner\Data_Collector\Uncategorized_Category' => [ 'Progress_Planner\Suggested_Tasks\Data_Collector\Uncategorized_Category', '1.1.1' ],
45+
'Progress_Planner\Chart' => [ 'Progress_Planner\UI\Chart', '1.1.1' ],
46+
'Progress_Planner\Popover' => [ 'Progress_Planner\UI\Popover', '1.1.1' ],
47+
'Progress_Planner\Debug_Tools' => [ 'Progress_Planner\Utils\Debug_Tools', '1.1.1' ],
48+
'Progress_Planner\Onboard' => [ 'Progress_Planner\Utils\Onboard', '1.1.1' ],
49+
'Progress_Planner\Playground' => [ 'Progress_Planner\Utils\Playground', '1.1.1' ],
50+
51+
'Progress_Planner\Admin\Widgets\Published_Content' => [ 'Progress_Planner\Admin\Widgets\Content_Activity', '1.3.0' ],
52+
53+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Task_Local' => [ 'Progress_Planner\Suggested_Tasks\Task', '1.4.0' ],
54+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Local_Tasks_Interface' => [ 'Progress_Planner\Suggested_Tasks\Tasks_Interface', '1.4.0' ],
55+
'Progress_Planner\Suggested_Tasks\Local_Tasks_Manager' => [ 'Progress_Planner\Suggested_Tasks\Tasks_Manager', '1.4.0' ],
56+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Local_Task_Factory' => [ 'Progress_Planner\Suggested_Tasks\Task_Factory', '1.4.0' ],
57+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time' => [ 'Progress_Planner\Suggested_Tasks\Providers\Task', '1.4.0' ],
58+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Repetitive' => [ 'Progress_Planner\Suggested_Tasks\Providers\Repetitive', '1.4.0' ],
59+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Local_Tasks' => [ 'Progress_Planner\Suggested_Tasks\Providers\Tasks', '1.4.0' ],
60+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\User' => [ 'Progress_Planner\Suggested_Tasks\Providers\User', '1.4.0' ],
61+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Add_Yoast_Providers' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Add_Yoast_Providers', '1.4.0' ],
62+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Archive_Author' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Archive_Author', '1.4.0' ],
63+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Archive_Date' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Archive_Date', '1.4.0' ],
64+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Archive_Format' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Archive_Format', '1.4.0' ],
65+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Crawl_Settings_Emoji_Scripts' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Crawl_Settings_Emoji_Scripts', '1.4.0' ],
66+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Crawl_Settings_Feed_Authors' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Crawl_Settings_Feed_Authors', '1.4.0' ],
67+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Crawl_Settings_Feed_Global_Comments' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Crawl_Settings_Feed_Global_Comments', '1.4.0' ],
68+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Media_Pages' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Media_Pages', '1.4.0' ],
69+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Organization_Logo' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Organization_Logo', '1.4.0' ],
70+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Integrations\Yoast\Yoast_Provider' => [ 'Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Yoast_Provider', '1.4.0' ],
71+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Blog_Description' => [ 'Progress_Planner\Suggested_Tasks\Providers\Blog_Description', '1.4.0' ],
72+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Debug_Display' => [ 'Progress_Planner\Suggested_Tasks\Providers\Debug_Display', '1.4.0' ],
73+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Disable_Comments' => [ 'Progress_Planner\Suggested_Tasks\Providers\Disable_Comments', '1.4.0' ],
74+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Hello_World' => [ 'Progress_Planner\Suggested_Tasks\Providers\Hello_World', '1.4.0' ],
75+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Permalink_Structure' => [ 'Progress_Planner\Suggested_Tasks\Providers\Permalink_Structure', '1.4.0' ],
76+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Php_Version' => [ 'Progress_Planner\Suggested_Tasks\Providers\Php_Version', '1.4.0' ],
77+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Remove_Inactive_Plugins' => [ 'Progress_Planner\Suggested_Tasks\Providers\Remove_Inactive_Plugins', '1.4.0' ],
78+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Rename_Uncategorized_Category' => [ 'Progress_Planner\Suggested_Tasks\Providers\Rename_Uncategorized_Category', '1.4.0' ],
79+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Sample_Page' => [ 'Progress_Planner\Suggested_Tasks\Providers\Sample_Page', '1.4.0' ],
80+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Search_Engine_Visibility' => [ 'Progress_Planner\Suggested_Tasks\Providers\Search_Engine_Visibility', '1.4.0' ],
81+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Set_Valuable_Post_Types' => [ 'Progress_Planner\Suggested_Tasks\Providers\Set_Valuable_Post_Types', '1.4.0' ],
82+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Settings_Saved' => [ 'Progress_Planner\Suggested_Tasks\Providers\Settings_Saved', '1.4.0' ],
83+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\One_Time\Site_Icon' => [ 'Progress_Planner\Suggested_Tasks\Providers\Site_Icon', '1.4.0' ],
84+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Repetitive\Core_Update' => [ 'Progress_Planner\Suggested_Tasks\Providers\Core_Update', '1.4.0' ],
85+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Repetitive\Create' => [ 'Progress_Planner\Suggested_Tasks\Providers\Repetitive\Create', '1.4.0' ],
86+
'Progress_Planner\Suggested_Tasks\Local_Tasks\Providers\Repetitive\Review' => [ 'Progress_Planner\Suggested_Tasks\Providers\Repetitive\Review', '1.4.0' ],
87+
'Progress_Planner\Suggested_Tasks\Remote_Tasks\Remote_Task_Factory' => [ 'Progress_Planner\Suggested_Tasks\Task_Factory', '1.4.0' ],
88+
'Progress_Planner\Suggested_Tasks\Remote_Tasks\Remote_Task' => [ 'Progress_Planner\Suggested_Tasks\Task', '1.4.0' ],
89+
];
90+
91+
if ( isset( $deprecated[ $class_name ] ) ) {
92+
\trigger_error( // phpcs:ignore
93+
sprintf(
94+
'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
95+
\esc_html( $class_name ),
96+
\esc_html( $deprecated[ $class_name ][1] ),
97+
\esc_html( $deprecated[ $class_name ][0] )
98+
),
99+
E_USER_DEPRECATED
100+
);
101+
class_alias( $deprecated[ $class_name ][0], $class_name );
102+
}
103+
104+
$class_name = \str_replace( $prefix, '', $class_name );
105+
106+
$parts = \explode( '\\', $class_name );
107+
$file = PROGRESS_PLANNER_DIR . '/classes/';
108+
$last = \array_pop( $parts );
109+
110+
foreach ( $parts as $part ) {
111+
$file .= str_replace( '_', '-', strtolower( $part ) ) . '/';
112+
}
113+
$file .= 'class-' . \str_replace( '_', '-', \strtolower( $last ) ) . '.php';
114+
115+
if ( \file_exists( $file ) ) {
116+
require_once $file;
117+
}
118+
}
119+
);

classes/actions/class-content-scan.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ public function ajax_reset_posts_data() {
8383
$activities = \progress_planner()->get_activities__query()->query_activities( [ 'category' => 'content' ] );
8484
\progress_planner()->get_activities__query()->delete_activities( $activities );
8585

86-
// Reset the word count.
87-
\progress_planner()->get_settings()->set( 'word_count', [] );
88-
8986
\wp_send_json_success(
9087
[
9188
'messages' => [
@@ -132,7 +129,7 @@ public function update_stats() {
132129
];
133130
}
134131

135-
// Insert the activities and the word-count for posts in the db.
132+
// Insert the activities for posts in the db.
136133
$this->insert_activities( $posts );
137134

138135
// Update the last scanned page.
@@ -161,9 +158,9 @@ public function get_total_pages() {
161158
}
162159

163160
/**
164-
* Insert the activities and the word-count for posts in the db.
161+
* Insert the activities for posts in the db.
165162
*
166-
* @param \WP_Post[] $posts The posts to set the word count for.
163+
* @param \WP_Post[] $posts The posts to insert the activities for.
167164
*
168165
* @return void
169166
*/
@@ -173,8 +170,6 @@ public function insert_activities( $posts ) {
173170
foreach ( $posts as $post ) {
174171
// Set the activity, we're dealing only with published posts (but just in case).
175172
$activities[ $post->ID ] = \progress_planner()->get_activities__content_helpers()->get_activity_from_post( $post, 'publish' === $post->post_status ? 'publish' : 'update' );
176-
// Set the word count.
177-
\progress_planner()->get_activities__content_helpers()->get_word_count( $post->post_content, $post->ID );
178173
}
179174

180175
\progress_planner()->get_activities__query()->insert_activities( $activities );

classes/actions/class-content.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ public function insert_post( $post_id, $post, $update ) {
5656
// Set the type of activity.
5757
$type = $update ? 'update' : 'publish';
5858

59-
// Reset the words count if it's an update.
60-
if ( 'update' === $type ) {
61-
\progress_planner()->get_settings()->set( [ 'word_count', $post_id ], false );
62-
}
63-
6459
// Bail if the post is not published.
6560
if ( 'publish' !== $post->post_status ) {
6661
return;
@@ -123,9 +118,6 @@ public function trash_post( $post_id ) {
123118
}
124119

125120
$this->add_post_activity( $post, 'trash' );
126-
127-
// Reset the words count.
128-
\progress_planner()->get_settings()->set( [ 'word_count', $post_id ], false );
129121
}
130122

131123
/**
@@ -148,9 +140,6 @@ public function delete_post( $post_id ) {
148140
return;
149141
}
150142

151-
// Reset the words count.
152-
\progress_planner()->get_settings()->set( [ 'word_count', $post_id ], false );
153-
154143
// Add activity.
155144
$activity = new Activities_Content();
156145
$activity->category = 'content';
@@ -273,9 +262,6 @@ private function add_post_activity( $post, $type ) {
273262

274263
// If there are activities for this post, on this date, bail.
275264
if ( ! empty( $existing ) ) {
276-
// Reset the words count.
277-
\progress_planner()->get_settings()->set( [ 'word_count', $post->ID ], false );
278-
279265
return;
280266
}
281267
}
@@ -310,8 +296,5 @@ private function add_post_activity( $post, $type ) {
310296
}
311297

312298
$activity->save();
313-
314-
// Reset the words count.
315-
\progress_planner()->get_settings()->set( [ 'word_count', $post->ID ], false );
316299
}
317300
}

0 commit comments

Comments
 (0)