Version Description
- ADDITIONAL CODE CLEANUP: This version does some additional code clean-up to remove some obsolete methods of generating output, and to do a better job of sanitizing input and escaping output in the FeedWordPress administrative dashboard.
Download this release
Release Info
Developer | radgeek |
Plugin | FeedWordPress |
Version | 2022.0204 |
Comparing to | |
See all releases |
Code changes from version 2022.0203 to 2022.0204
- admin-ui.php +86 -40
- authors-page.php +25 -22
- categories-page.php +24 -24
- diagnostics-page.php +12 -12
- feeds-page.php +67 -59
- feedwordpress.php +67 -64
- feedwordpress.wp-admin.post-edit.functions.php +3 -3
- feedwordpressadminpage.class.php +16 -16
- feedwordpresssettingsui.class.php +2 -2
- posts-page.php +6 -6
- readme.txt +2 -2
- updatedpostscontrol.class.php +1 -1
admin-ui.php
CHANGED
@@ -15,6 +15,44 @@ $dir = dirname(__FILE__);
|
|
15 |
require_once("${dir}/feedwordpressadminpage.class.php");
|
16 |
require_once("${dir}/feedwordpresssettingsui.class.php");
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
function fwp_update_set_results_message ($delta, $joiner = ';') {
|
19 |
$mesg = array();
|
20 |
if (isset($delta['new'])) : $mesg[] = ' '.$delta['new'].' new posts were syndicated'; endif;
|
@@ -85,17 +123,17 @@ function fwp_tags_box ($tags, $object, $params = array()) {
|
|
85 |
$helps = __('Separate tags with commas.');
|
86 |
$box['title'] = __('Tags');
|
87 |
?>
|
88 |
-
<div class="tagsdiv" id="<?php echo $params['id']; ?>">
|
89 |
<div class="jaxtag">
|
90 |
<div class="nojs-tags hide-if-js">
|
91 |
-
<p><?php echo $oTaxLabels->add_or_remove_items; ?></p>
|
92 |
-
<textarea name="<?php echo $params['textarea_name']; ?>" class="the-tags" id="<?php echo $params['textarea_id']; ?>"><?php echo esc_attr(implode(",", $tags)); ?></textarea></div>
|
93 |
|
94 |
<?php if ( current_user_can($oTax->cap->assign_terms) ) :?>
|
95 |
<div class="ajaxtag hide-if-no-js">
|
96 |
-
<label class="screen-reader-text" for="<?php echo $params['input_id']; ?>"><?php echo $params['box_title']; ?></label>
|
97 |
-
<div class="taghint"><?php echo $oTaxLabels->add_new_item; ?></div>
|
98 |
-
<p><input type="text" id="<?php print $params['input_id']; ?>" name="<?php print $params['input_name']; ?>" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
|
99 |
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p>
|
100 |
</div>
|
101 |
<p class="howto"><?php echo esc_attr( $oTaxLabels->separate_items_with_commas ); ?></p>
|
@@ -105,7 +143,7 @@ function fwp_tags_box ($tags, $object, $params = array()) {
|
|
105 |
<div class="tagchecklist"></div>
|
106 |
</div>
|
107 |
<?php if ( current_user_can($oTax->cap->assign_terms) ) : ?>
|
108 |
-
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $oTaxLabels->choose_from_most_used; ?></a></p>
|
109 |
<?php endif;
|
110 |
|
111 |
}
|
@@ -134,54 +172,62 @@ function fwp_category_box ($checked, $object, $tags = array(), $params = array()
|
|
134 |
$namePrefix = 'feedwordpress_';
|
135 |
endif;
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
?>
|
138 |
-
<div id="<?php print $
|
139 |
-
<ul id="<?php print $
|
140 |
-
<li class="ui-tabs-selected tabs"><a href="#<?php print $
|
141 |
-
<p style="font-size:smaller;font-style:bold;margin:0">Give <?php print $object; ?> these <?php print $oTaxLabels->name; ?></p>
|
142 |
</li>
|
143 |
</ul>
|
144 |
|
145 |
-
<div id="<?php print
|
146 |
-
<input type="hidden" value="0" name="tax_input[<?php print $taxonomy; ?>][]" />
|
147 |
-
<ul id="<?php print $
|
148 |
-
<?php fwp_category_checklist(
|
149 |
</ul>
|
150 |
</div>
|
151 |
|
152 |
-
<div id="<?php print $
|
153 |
-
<h4><a id="<?php print $
|
154 |
-
<p id="<?php print $
|
155 |
-
|
156 |
-
$newcat = 'new'
|
157 |
-
|
158 |
-
|
159 |
-
<label class="screen-reader-text" for="<?php print $idPrefix; ?>new<?php print $taxonomy; ?>"><?php _e('Add New Category'); ?></label>
|
160 |
<input
|
161 |
-
id="<?php print $
|
162 |
-
class="
|
163 |
aria-required="true"
|
164 |
tabindex="3"
|
165 |
-
type="text" name="<?php print $newcat; ?>"
|
166 |
value="<?php _e( 'New category name' ); ?>"
|
167 |
/>
|
168 |
-
<label class="screen-reader-text" for="<?php print $
|
169 |
<?php wp_dropdown_categories( array(
|
170 |
-
|
171 |
'hide_empty' => 0,
|
172 |
-
'id' => $
|
173 |
-
'class' =>
|
174 |
-
'name' => $newcat.'_parent',
|
175 |
'orderby' => 'name',
|
176 |
'hierarchical' => 1,
|
177 |
'show_option_none' => __('Parent category'),
|
178 |
'tab_index' => 3,
|
179 |
) ); ?>
|
180 |
-
<input type="button" id="<?php print $
|
181 |
<?php /* wp_nonce_field currently doesn't let us set an id different from name, but we need a non-unique name and a unique id */ ?>
|
182 |
<input type="hidden" id="_ajax_nonce<?php print esc_html($idSuffix); ?>" name="_ajax_nonce" value="<?php print wp_create_nonce('add-'.$taxonomy); ?>" />
|
183 |
-
<input type="hidden" id="_ajax_nonce-add-<?php print $taxonomy
|
184 |
-
<span id="<?php print $idPrefix
|
185 |
</p>
|
186 |
</div>
|
187 |
|
@@ -360,7 +406,7 @@ function fwp_syndication_manage_page_links_table_rows ($links, $page, $visible =
|
|
360 |
endif;
|
361 |
?>
|
362 |
<tr<?php echo ((count($trClass) > 0) ? ' class="'.implode(" ", $trClass).'"':''); ?>>
|
363 |
-
<th class="check-column" scope="row"><input type="checkbox" name="link_ids[]" value="<?php echo $link->link_id; ?>" /></th>
|
364 |
<?php
|
365 |
$caption = (
|
366 |
(strlen($link->link_rss) > 0)
|
@@ -369,7 +415,7 @@ function fwp_syndication_manage_page_links_table_rows ($links, $page, $visible =
|
|
369 |
);
|
370 |
?>
|
371 |
<td>
|
372 |
-
<strong><a href="<?php print $page->admin_page_href('feeds-page.php', array(), $link); ?>"><?php print esc_html($link->link_name); ?></a></strong>
|
373 |
<div class="row-actions"><?php if ($subscribed) :
|
374 |
$page->display_feed_settings_page_links(array(
|
375 |
'before' => '<div><strong>Settings ></strong> ',
|
@@ -380,12 +426,12 @@ function fwp_syndication_manage_page_links_table_rows ($links, $page, $visible =
|
|
380 |
|
381 |
<div><strong>Actions ></strong>
|
382 |
<?php if ($subscribed) : ?>
|
383 |
-
<a href="<?php print $page->admin_page_href('syndication.php', array('action' => 'feedfinder'), $link); ?>"><?php echo $caption; ?></a>
|
384 |
<?php else : ?>
|
385 |
-
<a href="<?php print $page->admin_page_href('syndication.php', array('action' => FWP_RESUB_CHECKED), $link); ?>"><?php _e('Re-subscribe'); ?></a>
|
386 |
<?php endif; ?>
|
387 |
-
| <a href="<?php print $page->admin_page_href('syndication.php', array('action' => 'Unsubscribe'), $link); ?>"><?php _e(($subscribed ? 'Unsubscribe' : 'Delete permanently')); ?></a>
|
388 |
-
| <a href="<?php print
|
389 |
</div>
|
390 |
</td>
|
391 |
<?php if (strlen($link->link_rss) > 0): ?>
|
15 |
require_once("${dir}/feedwordpressadminpage.class.php");
|
16 |
require_once("${dir}/feedwordpresssettingsui.class.php");
|
17 |
|
18 |
+
function fwp_form_class_attr( $className ) {
|
19 |
+
|
20 |
+
if ( is_string($className) ) :
|
21 |
+
if (strlen($className) > 0 ) :
|
22 |
+
$sClassName = sanitize_html_class( $className );
|
23 |
+
print sprintf( 'class="%s"', esc_attr( $sClassName ) );
|
24 |
+
endif;
|
25 |
+
endif;
|
26 |
+
} /* fwp_form_class_attr() */
|
27 |
+
|
28 |
+
function fwp_selected_flag( /* mixed */ $arg = null, $key = null, $flag = "selected" ) {
|
29 |
+
|
30 |
+
$bIsOn = false;
|
31 |
+
|
32 |
+
$theArg = $arg;
|
33 |
+
if (is_array($arg) and !is_null($key)) :
|
34 |
+
if (array_key_exists($key, $arg)) :
|
35 |
+
$theArg = $arg[$key];
|
36 |
+
else :
|
37 |
+
$theArg = false;
|
38 |
+
endif;
|
39 |
+
endif;
|
40 |
+
|
41 |
+
if (is_string($theArg)) :
|
42 |
+
$bIsOn = (strlen($theArg) > 0);
|
43 |
+
else :
|
44 |
+
$bIsOn = !!($theArg);
|
45 |
+
endif;
|
46 |
+
|
47 |
+
if ( $bIsOn ) :
|
48 |
+
print sprintf( '%s="%s"', esc_attr($flag), esc_attr($flag) );
|
49 |
+
endif;
|
50 |
+
} /* fwp_selected_flag() */
|
51 |
+
|
52 |
+
function fwp_checked_flag( /* mixed */ $arg = null, $key = null ) {
|
53 |
+
fwp_selected_flag( $arg, $key, "checked" );
|
54 |
+
} /* fwp_checked_flag() */
|
55 |
+
|
56 |
function fwp_update_set_results_message ($delta, $joiner = ';') {
|
57 |
$mesg = array();
|
58 |
if (isset($delta['new'])) : $mesg[] = ' '.$delta['new'].' new posts were syndicated'; endif;
|
123 |
$helps = __('Separate tags with commas.');
|
124 |
$box['title'] = __('Tags');
|
125 |
?>
|
126 |
+
<div class="tagsdiv" id="<?php echo esc_attr( $params['id'] ); ?>">
|
127 |
<div class="jaxtag">
|
128 |
<div class="nojs-tags hide-if-js">
|
129 |
+
<p><?php echo esc_html( $oTaxLabels->add_or_remove_items ); ?></p>
|
130 |
+
<textarea name="<?php echo esc_attr( $params['textarea_name'] ); ?>" class="the-tags" id="<?php echo esc_attr( $params['textarea_id'] ); ?>"><?php echo esc_attr(implode(",", $tags)); ?></textarea></div>
|
131 |
|
132 |
<?php if ( current_user_can($oTax->cap->assign_terms) ) :?>
|
133 |
<div class="ajaxtag hide-if-no-js">
|
134 |
+
<label class="screen-reader-text" for="<?php echo esc_attr( $params['input_id'] ); ?>"><?php echo esc_html( $params['box_title'] ); ?></label>
|
135 |
+
<div class="taghint"><?php echo esc_html( $oTaxLabels->add_new_item ); ?></div>
|
136 |
+
<p><input type="text" id="<?php print esc_attr( $params['input_id'] ); ?>" name="<?php print esc_attr( $params['input_name'] ); ?>" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
|
137 |
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p>
|
138 |
</div>
|
139 |
<p class="howto"><?php echo esc_attr( $oTaxLabels->separate_items_with_commas ); ?></p>
|
143 |
<div class="tagchecklist"></div>
|
144 |
</div>
|
145 |
<?php if ( current_user_can($oTax->cap->assign_terms) ) : ?>
|
146 |
+
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo esc_attr( $tax_name ); ?>"><?php echo esc_html( $oTaxLabels->choose_from_most_used ); ?></a></p>
|
147 |
<?php endif;
|
148 |
|
149 |
}
|
172 |
$namePrefix = 'feedwordpress_';
|
173 |
endif;
|
174 |
|
175 |
+
$boxDivId = sanitize_html_class( $idPrefix . 'taxonomy-' . $taxonomy );
|
176 |
+
$tabsUlId = sanitize_html_class( $idPrefix . $taxonomy . '-tabs' );
|
177 |
+
$allTabId = sanitize_html_class( $idPrefix . $taxonomy . '-all' );
|
178 |
+
$chkLstId = sanitize_html_class( $idPrefix . $taxonomy . 'checklist' );
|
179 |
+
$addTaxId = sanitize_html_class( $idPrefix . $taxonomy . '-adder' );
|
180 |
+
$addTogId = sanitize_html_class( $idPrefix . $taxonomy . '-add-toggle' );
|
181 |
+
$addCatId = sanitize_html_class( $idPrefix . $taxonomy . '-add' );
|
182 |
+
$newTaxId = sanitize_html_class( $idPrefix . 'new' . $taxonomy );
|
183 |
+
$taxIdAddSubmit = sanitize_html_class( $idPrefix . $taxonomy . '-add-sumbit' );
|
184 |
?>
|
185 |
+
<div id="<?php print esc_attr( $boxDivId ); ?>" class="feedwordpress-category-div">
|
186 |
+
<ul id="<?php print esc_attr( $tabsUlId ); ?>" class="category-tabs">
|
187 |
+
<li class="ui-tabs-selected tabs"><a href="#<?php print esc_attr( $allTabId ); ?>" tabindex="3"><?php _e( 'All posts' ); ?></a>
|
188 |
+
<p style="font-size:smaller;font-style:bold;margin:0">Give <?php print esc_html( $object ); ?> these <?php print esc_html( $oTaxLabels->name ); ?></p>
|
189 |
</li>
|
190 |
</ul>
|
191 |
|
192 |
+
<div id="<?php print esc_attr( $allTabId); ?>" class="tabs-panel">
|
193 |
+
<input type="hidden" value="0" name="tax_input[<?php print esc_attr( $taxonomy ); ?>][]" />
|
194 |
+
<ul id="<?php print esc_attr($chkLstId); ?>" class="list:<?php print esc_attr( $taxonomy ); ?> categorychecklist form-no-clear">
|
195 |
+
<?php fwp_category_checklist(null, false, $checked, $params) ?>
|
196 |
</ul>
|
197 |
</div>
|
198 |
|
199 |
+
<div id="<?php print esc_attr( $addTaxId ); ?>" class="<?php print esc_attr( $taxonomy ); ?>-adder wp-hidden-children">
|
200 |
+
<h4><a id="<?php print esc_attr( $addTogId ); ?>" class="category-add-toggle" href="#<?php print esc_attr( $addCatId ); ?>" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
|
201 |
+
<p id="<?php print esc_attr($addCatId); ?>" class="category-add wp-hidden-child">
|
202 |
+
<?php
|
203 |
+
$newcat = 'new' . $taxonomy;
|
204 |
+
?>
|
205 |
+
<label class="screen-reader-text" for="<?php print esc_attr($newTaxId); ?>"><?php _e('Add New Category'); ?></label>
|
|
|
206 |
<input
|
207 |
+
id="<?php print esc_attr($newTaxId); ?>"
|
208 |
+
class="<?php print esc_attr( $newcat ); ?> form-required form-input-tip"
|
209 |
aria-required="true"
|
210 |
tabindex="3"
|
211 |
+
type="text" name="<?php print esc_attr( $newcat ); ?>"
|
212 |
value="<?php _e( 'New category name' ); ?>"
|
213 |
/>
|
214 |
+
<label class="screen-reader-text" for="<?php print esc_attr( $newTaxId ); ?>-parent"><?php _e('Parent Category:'); ?></label>
|
215 |
<?php wp_dropdown_categories( array(
|
216 |
+
'taxonomy' => $taxonomy,
|
217 |
'hide_empty' => 0,
|
218 |
+
'id' => $newTaxId . '-parent',
|
219 |
+
'class' => $newcat . '-parent',
|
220 |
+
'name' => $newcat . '_parent',
|
221 |
'orderby' => 'name',
|
222 |
'hierarchical' => 1,
|
223 |
'show_option_none' => __('Parent category'),
|
224 |
'tab_index' => 3,
|
225 |
) ); ?>
|
226 |
+
<input type="button" id="<?php print esc_attr( $taxIdAddSubmit ); ?>" class="add:<?php print esc_attr( $idPrefix . $taxonomy ); ?>checklist:<?php print esc_attr( $idPrefix . $taxonomy ); ?>-add add-categorychecklist-category-add button category-add-submit" value="<?php _e( 'Add' ); ?>" tabindex="3" />
|
227 |
<?php /* wp_nonce_field currently doesn't let us set an id different from name, but we need a non-unique name and a unique id */ ?>
|
228 |
<input type="hidden" id="_ajax_nonce<?php print esc_html($idSuffix); ?>" name="_ajax_nonce" value="<?php print wp_create_nonce('add-'.$taxonomy); ?>" />
|
229 |
+
<input type="hidden" id="_ajax_nonce-add-<?php print esc_attr( $taxonomy . $idSuffix ); ?>" name="_ajax_nonce-add-<?php print esc_attr( $taxonomy ); ?>" value="<?php print wp_create_nonce('add-'.$taxonomy); ?>" />
|
230 |
+
<span id="<?php print esc_attr( $idPrefix . $taxonomy ); ?>-ajax-response" class="<?php print esc_attr( $taxonomy ); ?>-ajax-response"></span>
|
231 |
</p>
|
232 |
</div>
|
233 |
|
406 |
endif;
|
407 |
?>
|
408 |
<tr<?php echo ((count($trClass) > 0) ? ' class="'.implode(" ", $trClass).'"':''); ?>>
|
409 |
+
<th class="check-column" scope="row"><input type="checkbox" name="link_ids[]" value="<?php echo esc_attr( $link->link_id ); ?>" /></th>
|
410 |
<?php
|
411 |
$caption = (
|
412 |
(strlen($link->link_rss) > 0)
|
415 |
);
|
416 |
?>
|
417 |
<td>
|
418 |
+
<strong><a href="<?php print esc_url( $page->admin_page_href('feeds-page.php', array(), $link) ); ?>"><?php print esc_html($link->link_name); ?></a></strong>
|
419 |
<div class="row-actions"><?php if ($subscribed) :
|
420 |
$page->display_feed_settings_page_links(array(
|
421 |
'before' => '<div><strong>Settings ></strong> ',
|
426 |
|
427 |
<div><strong>Actions ></strong>
|
428 |
<?php if ($subscribed) : ?>
|
429 |
+
<a href="<?php print esc_url( $page->admin_page_href('syndication.php', array('action' => 'feedfinder'), $link) ); ?>"><?php echo esc_html( $caption ); ?></a>
|
430 |
<?php else : ?>
|
431 |
+
<a href="<?php print esc_url( $page->admin_page_href('syndication.php', array('action' => FWP_RESUB_CHECKED), $link) ); ?>"><?php _e('Re-subscribe'); ?></a>
|
432 |
<?php endif; ?>
|
433 |
+
| <a href="<?php print esc_url( $page->admin_page_href( 'syndication.php', array('action' => 'Unsubscribe'), $link ) ); ?>"><?php _e( ( $subscribed ? 'Unsubscribe' : 'Delete permanently' ) ); ?></a>
|
434 |
+
| <a href="<?php print esc_url( $link->link_url ); ?>"><?php _e('View')?></a></div>
|
435 |
</div>
|
436 |
</td>
|
437 |
<?php if (strlen($link->link_rss) > 0): ?>
|
authors-page.php
CHANGED
@@ -39,7 +39,7 @@ class FeedWordPressAuthorsPage extends FeedWordPressAdminPage {
|
|
39 |
else :
|
40 |
$key = FeedWordPress::on_unfamiliar('author');
|
41 |
endif;
|
42 |
-
$unfamiliar[$key] =
|
43 |
|
44 |
$match_author_by_email = !('yes' == get_option("feedwordpress_do_not_match_author_by_email"));
|
45 |
$null_emails = FeedWordPress::null_email_set();
|
@@ -53,12 +53,14 @@ if ($page->for_default_settings()) :
|
|
53 |
<tr><th>Unmatched authors</th>
|
54 |
<td><span>Authors who haven’t been syndicated before</span>
|
55 |
<select style="max-width: 27.0em" id="unfamiliar-author" name="unfamiliar_author" onchange="contextual_appearance('unfamiliar-author', 'unfamiliar-author-newuser', 'unfamiliar-author-default', 'newuser', 'inline');">
|
56 |
-
<option value="create"<?php
|
57 |
-
<?php foreach ($page->authorlist as $author_id => $author_name) :
|
58 |
-
|
|
|
|
|
59 |
<?php endforeach; ?>
|
60 |
<option value="newuser">will have their posts attributed to a new user...</option>
|
61 |
-
<option value="filter"<?php
|
62 |
</select>
|
63 |
|
64 |
<span id="unfamiliar-author-newuser">named <input type="text" name="unfamiliar_author_newuser" value="" /></span></p>
|
@@ -86,10 +88,10 @@ authors?</p>
|
|
86 |
from this feed <select class="author-rules" id="author-rules-all"
|
87 |
name="author_rules_action[all]" onchange="contextual_appearance('author-rules-all', 'author-rules-all-newuser', 'author-rules-all-default', 'newuser', 'inline');">
|
88 |
<?php foreach ($page->authorlist as $local_author_id => $local_author_name) : ?>
|
89 |
-
<option value="<?php echo $local_author_id; ?>"<?php
|
90 |
<?php endforeach; ?>
|
91 |
<option value="newuser">will be assigned to a new user...</option>
|
92 |
-
<option value="filter"<?php
|
93 |
</select>
|
94 |
<span class="author-rules-newuser" id="author-rules-all-newuser">named
|
95 |
<input type="text" name="author_rules_newuser[all]" value="" /></span></p></li>
|
@@ -109,20 +111,21 @@ name to delete the rule. Fill in a new name at the bottom to create a new rule.)
|
|
109 |
foreach ($this->link->settings['map authors'] as $author_rules) :
|
110 |
foreach ($author_rules as $author_name => $author_action) :
|
111 |
if ($author_name != '*') :
|
112 |
-
$page->rule_count++;
|
|
|
113 |
?>
|
114 |
<tr>
|
115 |
-
<th style="text-align: left; width: 15.0em">Posts by <input type="text" name="author_rules_name[]" value="<?php echo
|
116 |
<td>
|
117 |
-
<select class="author-rules" id="
|
118 |
<?php foreach ($page->authorlist as $local_author_id => $local_author_name) : ?>
|
119 |
-
<option value="<?php echo $local_author_id; ?>"<?php
|
120 |
<?php endforeach; ?>
|
121 |
<option value="newuser">will be assigned to a new user...</option>
|
122 |
-
<option value="filter"<?php
|
123 |
</select>
|
124 |
|
125 |
-
<span class="author-rules-newuser" id="
|
126 |
</td>
|
127 |
</tr>
|
128 |
<?php
|
@@ -137,7 +140,7 @@ name to delete the rule. Fill in a new name at the bottom to create a new rule.)
|
|
137 |
<td>
|
138 |
<select id="add-author-rule" name="add_author_rule_action" onchange="contextual_appearance('add-author-rule', 'add-author-rule-newuser', 'add-author-rule-default', 'newuser', 'inline');">
|
139 |
<?php foreach ($page->authorlist as $author_id => $author_name) : ?>
|
140 |
-
<option value="<?php echo $author_id; ?>">are assigned to <?php echo $author_name; ?></option>
|
141 |
<?php endforeach; ?>
|
142 |
<option value="newuser">will be assigned to a new user...</option>
|
143 |
<option value="filter">get filtered out</option>
|
@@ -153,14 +156,14 @@ name to delete the rule. Fill in a new name at the bottom to create a new rule.)
|
|
153 |
<span>Authors who haven't been syndicated before</span>
|
154 |
<select style="max-width: 27.0em" id="unfamiliar-author" name="unfamiliar_author" onchange="contextual_appearance('unfamiliar-author', 'unfamiliar-author-newuser', 'unfamiliar-author-default', 'newuser', 'inline');">
|
155 |
<?php if ($page->for_feed_settings()) : ?>
|
156 |
-
<option value="site-default"<?php
|
157 |
<?php endif; ?>
|
158 |
-
<option value="create"<?php
|
159 |
<?php foreach ($page->authorlist as $author_id => $author_name) : ?>
|
160 |
-
<option value="<?php echo $author_id; ?>"<?php
|
161 |
<?php endforeach; ?>
|
162 |
<option value="newuser">will have their posts attributed to a user named ...</option>
|
163 |
-
<option value="filter"<?php
|
164 |
</select>
|
165 |
|
166 |
<span id="unfamiliar-author-newuser"><input type="text" name="unfamiliar_author_newuser" value="" /></span></p>
|
@@ -177,11 +180,11 @@ name to delete the rule. Fill in a new name at the bottom to create a new rule.)
|
|
177 |
<tr>
|
178 |
<th scope="row">Matching Authors</th>
|
179 |
<td><ul style="list-style: none; margin: 0; padding: 0;">
|
180 |
-
<li><div><label><input id="match-author-by-email" type="checkbox" name="match_author_by_email" value="yes" <?php
|
181 |
<div id="unless-null-email">
|
182 |
<p>Unless the e-mail address is one of the following anonymous e-mail addresses:</p>
|
183 |
<textarea name="null_emails" rows="3" style="width: 100%">
|
184 |
-
<?php print implode("\n", $null_emails); ?>
|
185 |
</textarea>
|
186 |
</div></li>
|
187 |
</ul></td>
|
@@ -201,13 +204,13 @@ name to delete the rule. Fill in a new name at the bottom to create a new rule.)
|
|
201 |
<td><p style="margin: 0.5em 0px">Take all the posts from this feed attributed to
|
202 |
<select name="fix_mismatch_from">
|
203 |
<?php foreach ($page->authorlist as $author_id => $author_name) : ?>
|
204 |
-
<option value="<?php echo $author_id; ?>"><?php echo $author_name; ?></option>
|
205 |
<?php endforeach; ?>
|
206 |
</select>
|
207 |
and instead
|
208 |
<select id="fix-mismatch-to" name="fix_mismatch_to" onchange="contextual_appearance('fix-mismatch-to', 'fix-mismatch-to-newuser', null, 'newuser', 'inline');">
|
209 |
<?php foreach ($page->authorlist as $author_id => $author_name) : ?>
|
210 |
-
<option value="<?php echo $author_id; ?>">re-assign them to <?php echo $author_name; ?></option>
|
211 |
<?php endforeach; ?>
|
212 |
<option value="newuser">re-assign them to a new user...</option>
|
213 |
<option value="filter">delete them</option>
|
39 |
else :
|
40 |
$key = FeedWordPress::on_unfamiliar('author');
|
41 |
endif;
|
42 |
+
$unfamiliar[$key] = true;
|
43 |
|
44 |
$match_author_by_email = !('yes' == get_option("feedwordpress_do_not_match_author_by_email"));
|
45 |
$null_emails = FeedWordPress::null_email_set();
|
53 |
<tr><th>Unmatched authors</th>
|
54 |
<td><span>Authors who haven’t been syndicated before</span>
|
55 |
<select style="max-width: 27.0em" id="unfamiliar-author" name="unfamiliar_author" onchange="contextual_appearance('unfamiliar-author', 'unfamiliar-author-newuser', 'unfamiliar-author-default', 'newuser', 'inline');">
|
56 |
+
<option value="create"<?php fwp_selected_flag($unfamiliar, 'create'); ?>>will have a new author account created for them</option>
|
57 |
+
<?php foreach ($page->authorlist as $author_id => $author_name) :
|
58 |
+
if (!isset($unfamiliar[$author_id])) : $unfamiliar[$author_id] = false; endif;
|
59 |
+
?>
|
60 |
+
<option value="<?php echo esc_attr($author_id); ?>"<?php fwp_selected_flag($unfamiliar, $author_id); ?>>will have their posts attributed to <?php echo esc_html($author_name); ?></option>
|
61 |
<?php endforeach; ?>
|
62 |
<option value="newuser">will have their posts attributed to a new user...</option>
|
63 |
+
<option value="filter"<?php fwp_selected_flag($unfamiliar, 'filter'); ?>>get filtered out</option>
|
64 |
</select>
|
65 |
|
66 |
<span id="unfamiliar-author-newuser">named <input type="text" name="unfamiliar_author_newuser" value="" /></span></p>
|
88 |
from this feed <select class="author-rules" id="author-rules-all"
|
89 |
name="author_rules_action[all]" onchange="contextual_appearance('author-rules-all', 'author-rules-all-newuser', 'author-rules-all-default', 'newuser', 'inline');">
|
90 |
<?php foreach ($page->authorlist as $local_author_id => $local_author_name) : ?>
|
91 |
+
<option value="<?php echo esc_attr($local_author_id); ?>"<?php fwp_selected_flag($local_author_id==$author_action); ?>>are assigned to <?php echo esc_html($local_author_name); ?></option>
|
92 |
<?php endforeach; ?>
|
93 |
<option value="newuser">will be assigned to a new user...</option>
|
94 |
+
<option value="filter"<?php fwp_selected_flag('filter'==$author_action); ?>>get filtered out</option>
|
95 |
</select>
|
96 |
<span class="author-rules-newuser" id="author-rules-all-newuser">named
|
97 |
<input type="text" name="author_rules_newuser[all]" value="" /></span></p></li>
|
111 |
foreach ($this->link->settings['map authors'] as $author_rules) :
|
112 |
foreach ($author_rules as $author_name => $author_action) :
|
113 |
if ($author_name != '*') :
|
114 |
+
$page->rule_count++;
|
115 |
+
$authorRulesId = sanitize_html_class(sprintf("author-rules-%d", $page->rule_count));
|
116 |
?>
|
117 |
<tr>
|
118 |
+
<th style="text-align: left; width: 15.0em">Posts by <input type="text" name="author_rules_name[]" value="<?php echo esc_attr($author_name); ?>" size="11" /></th>
|
119 |
<td>
|
120 |
+
<select class="author-rules" id="<?php echo esc_attr($authorRulesId); ?>" name="author_rules_action[]" onchange="contextual_appearance('<?php echo esc_attr($authorRulesId); ?>', '<?php echo esc_attr($authorRulesId); ?>-newuser', '<?php echo esc_attr($authorRulesId); ?>-default', 'newuser', 'inline');">
|
121 |
<?php foreach ($page->authorlist as $local_author_id => $local_author_name) : ?>
|
122 |
+
<option value="<?php echo esc_attr($local_author_id); ?>"<?php fwp_selected_flag($local_author_id==$author_action); ?>>are assigned to <?php echo esc_attr($local_author_name); ?></option>
|
123 |
<?php endforeach; ?>
|
124 |
<option value="newuser">will be assigned to a new user...</option>
|
125 |
+
<option value="filter"<?php fwp_selected_flag('filter'==$author_action); ?>>get filtered out</option>
|
126 |
</select>
|
127 |
|
128 |
+
<span class="author-rules-newuser" id="<?php echo esc_attr($authorRulesId); ?>-newuser">named <input type="text" name="author_rules_newuser[]" value="" /></span>
|
129 |
</td>
|
130 |
</tr>
|
131 |
<?php
|
140 |
<td>
|
141 |
<select id="add-author-rule" name="add_author_rule_action" onchange="contextual_appearance('add-author-rule', 'add-author-rule-newuser', 'add-author-rule-default', 'newuser', 'inline');">
|
142 |
<?php foreach ($page->authorlist as $author_id => $author_name) : ?>
|
143 |
+
<option value="<?php echo esc_attr($author_id); ?>">are assigned to <?php echo esc_html($author_name); ?></option>
|
144 |
<?php endforeach; ?>
|
145 |
<option value="newuser">will be assigned to a new user...</option>
|
146 |
<option value="filter">get filtered out</option>
|
156 |
<span>Authors who haven't been syndicated before</span>
|
157 |
<select style="max-width: 27.0em" id="unfamiliar-author" name="unfamiliar_author" onchange="contextual_appearance('unfamiliar-author', 'unfamiliar-author-newuser', 'unfamiliar-author-default', 'newuser', 'inline');">
|
158 |
<?php if ($page->for_feed_settings()) : ?>
|
159 |
+
<option value="site-default"<?php fwp_selected_flag($unfamiliar, 'site-default'); ?>>are handled according to the default for all feeds</option>
|
160 |
<?php endif; ?>
|
161 |
+
<option value="create"<?php fwp_selected_flag($unfamiliar, 'create'); ?>>will have a new author account created for them</option>
|
162 |
<?php foreach ($page->authorlist as $author_id => $author_name) : ?>
|
163 |
+
<option value="<?php echo esc_attr($author_id); ?>"<?php fwp_selected_flag($unfamiliar, $author_id); ?>>will have their posts attributed to <?php echo esc_html($author_name); ?></option>
|
164 |
<?php endforeach; ?>
|
165 |
<option value="newuser">will have their posts attributed to a user named ...</option>
|
166 |
+
<option value="filter"<?php fwp_selected_flag($unfamiliar, 'filter'); ?>>get filtered out</option>
|
167 |
</select>
|
168 |
|
169 |
<span id="unfamiliar-author-newuser"><input type="text" name="unfamiliar_author_newuser" value="" /></span></p>
|
180 |
<tr>
|
181 |
<th scope="row">Matching Authors</th>
|
182 |
<td><ul style="list-style: none; margin: 0; padding: 0;">
|
183 |
+
<li><div><label><input id="match-author-by-email" type="checkbox" name="match_author_by_email" value="yes" <?php fwp_selected_flag($match_author_by_email, null, "checked"); ?> onchange="contextual_appearance('match-author-by-email', 'unless-null-email', null, 'yes', 'block', /*checkbox=*/ true);" /> Treat syndicated authors with the same e-mail address as the same author.</label></div>
|
184 |
<div id="unless-null-email">
|
185 |
<p>Unless the e-mail address is one of the following anonymous e-mail addresses:</p>
|
186 |
<textarea name="null_emails" rows="3" style="width: 100%">
|
187 |
+
<?php print esc_html(implode("\n", $null_emails)); ?>
|
188 |
</textarea>
|
189 |
</div></li>
|
190 |
</ul></td>
|
204 |
<td><p style="margin: 0.5em 0px">Take all the posts from this feed attributed to
|
205 |
<select name="fix_mismatch_from">
|
206 |
<?php foreach ($page->authorlist as $author_id => $author_name) : ?>
|
207 |
+
<option value="<?php echo esc_attr($author_id); ?>"><?php echo esc_html($author_name); ?></option>
|
208 |
<?php endforeach; ?>
|
209 |
</select>
|
210 |
and instead
|
211 |
<select id="fix-mismatch-to" name="fix_mismatch_to" onchange="contextual_appearance('fix-mismatch-to', 'fix-mismatch-to-newuser', null, 'newuser', 'inline');">
|
212 |
<?php foreach ($page->authorlist as $author_id => $author_name) : ?>
|
213 |
+
<option value="<?php echo esc_attr($author_id); ?>">re-assign them to <?php echo esc_html($author_name); ?></option>
|
214 |
<?php endforeach; ?>
|
215 |
<option value="newuser">re-assign them to a new user...</option>
|
216 |
<option value="filter">delete them</option>
|
categories-page.php
CHANGED
@@ -197,8 +197,8 @@ class FeedWordPressCategoriesPage extends FeedWordPressAdminPage {
|
|
197 |
<tbody>
|
198 |
<tr><td class="equals first <?php if ($defaulted['cats']) : ?>active<?php else: ?>inactive<?php endif; ?>"><p><label><input type="radio" name="match_default[cats]"
|
199 |
value="yes" <?php if ($defaulted['cats']) : ?> checked="checked"<?php endif; ?> />
|
200 |
-
Use the <a href="<?php print $href; ?>">site-wide setting</a>
|
201 |
-
<span class="current-setting">Currently: <strong><?php print $globalMatchLabels['cats']; ?></strong></span></label></p></td>
|
202 |
<td class="equals second <?php if ($defaulted['cats']) : ?>inactive<?php else: ?>active<?php endif; ?>"><p><label><input type="radio" name="match_default[cats]"
|
203 |
value="no" <?php if (!$defaulted['cats']) : ?> checked="checked"<?php endif; ?> />
|
204 |
Do something different with this feed.</label>
|
@@ -210,8 +210,8 @@ locally with:</p>
|
|
210 |
<ul class="options compact">
|
211 |
<?php foreach ($matchUl['cats'] as $name => $li) : ?>
|
212 |
<li><label><input type="checkbox"
|
213 |
-
name="match_categories[cats][]" value="<?php print $name; ?>"
|
214 |
-
<?php
|
215 |
<?php endforeach; ?>
|
216 |
</ul>
|
217 |
<?php if ($offerSiteWideSettings) : ?>
|
@@ -224,7 +224,7 @@ locally with:</p>
|
|
224 |
|
225 |
<tr>
|
226 |
<th scope="row">Unmatched categories:</th>
|
227 |
-
<td><p>When <?php print $this->these_posts_phrase(); ?> have categories on
|
228 |
the feed that don't have any local matches yet...</p>
|
229 |
|
230 |
<?php if (count($unmatchedColumns['category']) > 1) : ?>
|
@@ -237,7 +237,7 @@ the feed that don't have any local matches yet...</p>
|
|
237 |
<?php foreach ($unmatchedColumns['category'] as $index => $column) : ?>
|
238 |
<td class="equals <?php print (($index == 0) ? 'first' : 'second'); ?> inactive"><ul class="options">
|
239 |
<?php foreach ($column as $name => $li) : ?>
|
240 |
-
<li><label><input type="radio" name="unfamiliar_category" value="<?php print $name; ?>"<?php
|
241 |
<?php endforeach; ?>
|
242 |
</ul></td>
|
243 |
<?php endforeach; ?>
|
@@ -260,8 +260,8 @@ like those handled above.</p>
|
|
260 |
<tbody>
|
261 |
<tr><td class="equals first <?php if ($defaulted['tags']) : ?>active<?php else: ?>inactive<?php endif; ?>"><p><label><input type="radio" name="match_default[tags]"
|
262 |
value="yes" <?php if ($defaulted['tags']) : ?> checked="checked"<?php endif; ?> />
|
263 |
-
Use the <a href="<?php print $href; ?>">site-wide setting</a>
|
264 |
-
<span class="current-setting">Currently: <strong><?php print $globalMatchLabels['tags']; ?></strong></span></label></p>
|
265 |
</td>
|
266 |
<td class="equals second <?php if ($defaulted['tags']) : ?>inactive<?php else: ?>active<?php endif; ?>"><p><label><input type="radio" name="match_default[tags]"
|
267 |
value="no" <?php if (!$defaulted['tags']) : ?> checked="checked"<?php endif; ?> />
|
@@ -274,8 +274,8 @@ locally with:</p>
|
|
274 |
<ul class="options compact">
|
275 |
<?php foreach ($matchUl['tags'] as $name => $li) : ?>
|
276 |
<li><label><input type="checkbox"
|
277 |
-
name="match_categories[tags][]" value="<?php print $name; ?>"
|
278 |
-
<?php
|
279 |
<?php endforeach; ?>
|
280 |
</ul>
|
281 |
<?php if ($offerSiteWideSettings) : ?>
|
@@ -288,7 +288,7 @@ locally with:</p>
|
|
288 |
|
289 |
<tr>
|
290 |
<th scope="row">Unmatched inline tags:</th>
|
291 |
-
<td><p>When the text of <?php print $this->these_posts_phrase(); ?> contains
|
292 |
inline tags that don't have any local matches yet...</p>
|
293 |
|
294 |
<?php if (count($unmatchedColumns['post_tag']) > 1) : ?>
|
@@ -301,7 +301,7 @@ inline tags that don't have any local matches yet...</p>
|
|
301 |
<?php foreach ($unmatchedColumns['post_tag'] as $index => $column) : ?>
|
302 |
<td class="equals <?php print (($index == 0) ? 'first' : 'second'); ?> inactive"><ul class="options">
|
303 |
<?php foreach ($column as $name => $li) : ?>
|
304 |
-
<li><label><input type="radio" name="unfamiliar_post_tag" value="<?php print $name; ?>"<?php
|
305 |
<?php endforeach; ?>
|
306 |
</ul></td>
|
307 |
<?php endforeach; ?>
|
@@ -321,8 +321,8 @@ inline tags that don't have any local matches yet...</p>
|
|
321 |
<td class="equals first <?php if ($defaulted['filter']) : ?>active<?php else: ?>inactive<?php endif; ?>">
|
322 |
<p><label><input type="radio" name="match_default[filter]"
|
323 |
value="yes" <?php if ($defaulted['filter']) : ?> checked="checked"<?php endif; ?> />
|
324 |
-
Use the <a href="<?php print $href; ?>">site-wide setting</a>
|
325 |
-
<span class="current-setting">Currently: <strong><?php print $globalMatchLabels['filter']; ?></strong></span></label></p>
|
326 |
</td>
|
327 |
<td class="equals second <?php if ($defaulted['filter']) : ?>inactive<?php else: ?>active<?php endif; ?>">
|
328 |
<p><label><input type="radio" name="match_default[filter]"
|
@@ -333,9 +333,9 @@ Do something different with this feed:</label></p>
|
|
333 |
|
334 |
<ul class="options">
|
335 |
<?php foreach ($matchUl['filter'] as $tax => $li) : ?>
|
336 |
-
<li><label><input type="checkbox" name="match_categories[filter][]" value="<?php print $tax; ?>"
|
337 |
-
<?php
|
338 |
-
least one local <strong><?php $l = $li['labels']; print $l->singular_name; ?></strong></label></li>
|
339 |
<?php endforeach; ?>
|
340 |
</ul>
|
341 |
|
@@ -403,7 +403,7 @@ blank.</p></td>
|
|
403 |
foreach ($taxonomies as $tax) :
|
404 |
$taxonomy = get_taxonomy($tax);
|
405 |
?>
|
406 |
-
<tr><th><?php print $taxonomy->labels->name; ?></th>
|
407 |
<td><?php
|
408 |
if (isset($option_map[$tax])) :
|
409 |
$option = $option_map[$tax];
|
@@ -458,7 +458,7 @@ blank.</p></td>
|
|
458 |
?>
|
459 |
</td>
|
460 |
<td class="secondary">
|
461 |
-
<h4>Site-wide <?php print $taxonomy->labels->name; ?></h4>
|
462 |
<?php if (count($globalCats) > 0) : ?>
|
463 |
<ul class="current-setting">
|
464 |
<?php foreach ($globalDogs as $dog) : ?>
|
@@ -471,13 +471,13 @@ blank.</p></td>
|
|
471 |
<p>Site-wide settings may also assign categories to syndicated
|
472 |
posts.
|
473 |
<?php endif; ?>
|
474 |
-
Should <?php print $page->these_posts_phrase(); ?> be assigned
|
475 |
-
these <?php print $taxonomy->labels->name; ?> from the <a href="<?php print
|
476 |
-
addition to the feed-specific <?php print $taxonomy->labels->name; ?> you set up here?</p>
|
477 |
|
478 |
<ul class="settings">
|
479 |
-
<li><p><label><input type="radio" name="add_global[<?php print $tax; ?>]" value="yes" <?php
|
480 |
-
<li><p><label><input type="radio" name="add_global[<?php print $tax; ?>]" value="no" <?php
|
481 |
</ul>
|
482 |
</td>
|
483 |
</tr>
|
197 |
<tbody>
|
198 |
<tr><td class="equals first <?php if ($defaulted['cats']) : ?>active<?php else: ?>inactive<?php endif; ?>"><p><label><input type="radio" name="match_default[cats]"
|
199 |
value="yes" <?php if ($defaulted['cats']) : ?> checked="checked"<?php endif; ?> />
|
200 |
+
Use the <a href="<?php print esc_url( $href ); ?>">site-wide setting</a>
|
201 |
+
<span class="current-setting">Currently: <strong><?php print esc_html( $globalMatchLabels['cats'] ); ?></strong></span></label></p></td>
|
202 |
<td class="equals second <?php if ($defaulted['cats']) : ?>inactive<?php else: ?>active<?php endif; ?>"><p><label><input type="radio" name="match_default[cats]"
|
203 |
value="no" <?php if (!$defaulted['cats']) : ?> checked="checked"<?php endif; ?> />
|
204 |
Do something different with this feed.</label>
|
210 |
<ul class="options compact">
|
211 |
<?php foreach ($matchUl['cats'] as $name => $li) : ?>
|
212 |
<li><label><input type="checkbox"
|
213 |
+
name="match_categories[cats][]" value="<?php print esc_attr( $name ); ?>"
|
214 |
+
<?php fwp_checked_flag($li, 'checked'); ?> /> <?php $l = $li['labels']; print esc_html($l->name); ?></label></li>
|
215 |
<?php endforeach; ?>
|
216 |
</ul>
|
217 |
<?php if ($offerSiteWideSettings) : ?>
|
224 |
|
225 |
<tr>
|
226 |
<th scope="row">Unmatched categories:</th>
|
227 |
+
<td><p>When <?php print esc_html( $this->these_posts_phrase() ); ?> have categories on
|
228 |
the feed that don't have any local matches yet...</p>
|
229 |
|
230 |
<?php if (count($unmatchedColumns['category']) > 1) : ?>
|
237 |
<?php foreach ($unmatchedColumns['category'] as $index => $column) : ?>
|
238 |
<td class="equals <?php print (($index == 0) ? 'first' : 'second'); ?> inactive"><ul class="options">
|
239 |
<?php foreach ($column as $name => $li) : ?>
|
240 |
+
<li><label><input type="radio" name="unfamiliar_category" value="<?php print esc_attr( $name ); ?>"<?php fwp_checked_flag($unmatchedRadio['category'][$name]); ?> /> <?php print esc_html( $li['label'] ); ?></label></li>
|
241 |
<?php endforeach; ?>
|
242 |
</ul></td>
|
243 |
<?php endforeach; ?>
|
260 |
<tbody>
|
261 |
<tr><td class="equals first <?php if ($defaulted['tags']) : ?>active<?php else: ?>inactive<?php endif; ?>"><p><label><input type="radio" name="match_default[tags]"
|
262 |
value="yes" <?php if ($defaulted['tags']) : ?> checked="checked"<?php endif; ?> />
|
263 |
+
Use the <a href="<?php print esc_url( $href ); ?>">site-wide setting</a>
|
264 |
+
<span class="current-setting">Currently: <strong><?php print esc_html( $globalMatchLabels['tags'] ); ?></strong></span></label></p>
|
265 |
</td>
|
266 |
<td class="equals second <?php if ($defaulted['tags']) : ?>inactive<?php else: ?>active<?php endif; ?>"><p><label><input type="radio" name="match_default[tags]"
|
267 |
value="no" <?php if (!$defaulted['tags']) : ?> checked="checked"<?php endif; ?> />
|
274 |
<ul class="options compact">
|
275 |
<?php foreach ($matchUl['tags'] as $name => $li) : ?>
|
276 |
<li><label><input type="checkbox"
|
277 |
+
name="match_categories[tags][]" value="<?php print esc_attr( $name ); ?>"
|
278 |
+
<?php fwp_checked_flag( $li, 'checked' ); ?> /> <?php $l = $li['labels']; print esc_html( $l->name ); ?></label></li>
|
279 |
<?php endforeach; ?>
|
280 |
</ul>
|
281 |
<?php if ($offerSiteWideSettings) : ?>
|
288 |
|
289 |
<tr>
|
290 |
<th scope="row">Unmatched inline tags:</th>
|
291 |
+
<td><p>When the text of <?php print esc_html( $this->these_posts_phrase() ); ?> contains
|
292 |
inline tags that don't have any local matches yet...</p>
|
293 |
|
294 |
<?php if (count($unmatchedColumns['post_tag']) > 1) : ?>
|
301 |
<?php foreach ($unmatchedColumns['post_tag'] as $index => $column) : ?>
|
302 |
<td class="equals <?php print (($index == 0) ? 'first' : 'second'); ?> inactive"><ul class="options">
|
303 |
<?php foreach ($column as $name => $li) : ?>
|
304 |
+
<li><label><input type="radio" name="unfamiliar_post_tag" value="<?php print esc_attr( $name ); ?>"<?php fwp_checked_flag($unmatchedRadio['post_tag'][$name]); ?> /> <?php print esc_html( $li['label'] ); ?></label></li>
|
305 |
<?php endforeach; ?>
|
306 |
</ul></td>
|
307 |
<?php endforeach; ?>
|
321 |
<td class="equals first <?php if ($defaulted['filter']) : ?>active<?php else: ?>inactive<?php endif; ?>">
|
322 |
<p><label><input type="radio" name="match_default[filter]"
|
323 |
value="yes" <?php if ($defaulted['filter']) : ?> checked="checked"<?php endif; ?> />
|
324 |
+
Use the <a href="<?php print esc_url( $href ); ?>">site-wide setting</a>
|
325 |
+
<span class="current-setting">Currently: <strong><?php print esc_html( $globalMatchLabels['filter'] ); ?></strong></span></label></p>
|
326 |
</td>
|
327 |
<td class="equals second <?php if ($defaulted['filter']) : ?>inactive<?php else: ?>active<?php endif; ?>">
|
328 |
<p><label><input type="radio" name="match_default[filter]"
|
333 |
|
334 |
<ul class="options">
|
335 |
<?php foreach ($matchUl['filter'] as $tax => $li) : ?>
|
336 |
+
<li><label><input type="checkbox" name="match_categories[filter][]" value="<?php print esc_attr( $tax ); ?>"
|
337 |
+
<?php fwp_checked_flag($li, 'checked'); ?> /> Don't syndicate posts unless they match at
|
338 |
+
least one local <strong><?php $l = $li['labels']; print esc_html( $l->singular_name ); ?></strong></label></li>
|
339 |
<?php endforeach; ?>
|
340 |
</ul>
|
341 |
|
403 |
foreach ($taxonomies as $tax) :
|
404 |
$taxonomy = get_taxonomy($tax);
|
405 |
?>
|
406 |
+
<tr><th><?php print esc_html( $taxonomy->labels->name ); ?></th>
|
407 |
<td><?php
|
408 |
if (isset($option_map[$tax])) :
|
409 |
$option = $option_map[$tax];
|
458 |
?>
|
459 |
</td>
|
460 |
<td class="secondary">
|
461 |
+
<h4>Site-wide <?php print esc_html( $taxonomy->labels->name ); ?></h4>
|
462 |
<?php if (count($globalCats) > 0) : ?>
|
463 |
<ul class="current-setting">
|
464 |
<?php foreach ($globalDogs as $dog) : ?>
|
471 |
<p>Site-wide settings may also assign categories to syndicated
|
472 |
posts.
|
473 |
<?php endif; ?>
|
474 |
+
Should <?php print esc_html( $page->these_posts_phrase() ); ?> be assigned
|
475 |
+
these <?php print esc_html( $taxonomy->labels->name ); ?> from the <a href="<?php print esc_url( $siteWideHref ); ?>">site-wide settings</a>, in
|
476 |
+
addition to the feed-specific <?php print esc_html( $taxonomy->labels->name ); ?> you set up here?</p>
|
477 |
|
478 |
<ul class="settings">
|
479 |
+
<li><p><label><input type="radio" name="add_global[<?php print esc_attr( $tax ); ?>]" value="yes" <?php fwp_checked_flag($checked, 'yes'); ?> /> Yes. Place <?php print esc_html( $page->these_posts_phrase() ); ?> under all these categories.</label></p></li>
|
480 |
+
<li><p><label><input type="radio" name="add_global[<?php print esc_attr( $tax ); ?>]" value="no" <?php fwp_checked_flag($checked, 'no'); ?> /> No. Only use the categories I set up on the left. Do not use the global defaults for <?php print esc_html( $page->these_posts_phrase() ); ?></label></p></li>
|
481 |
</ul>
|
482 |
</td>
|
483 |
</tr>
|
diagnostics-page.php
CHANGED
@@ -135,13 +135,13 @@ class FeedWordPressDiagnosticsPage extends FeedWordPressAdminPage {
|
|
135 |
<tr>
|
136 |
<th scope="row">Hosting Environment:</th>
|
137 |
<td><ul style="margin-top: 0; padding-top: 0;">
|
138 |
-
<li><em>WordPress:</em> version <?php print $wp_version; ?></li>
|
139 |
-
<li><em>SimplePie:</em> version <?php print SIMPLEPIE_VERSION; ?></li>
|
140 |
-
<?php if (function_exists('phpversion')) : ?>
|
141 |
-
<li><em>PHP:</em> version <?php print phpversion(); ?></li>
|
142 |
<?php endif; ?>
|
143 |
-
<?php if (function_exists('apache_get_version')) : ?>
|
144 |
-
<li><sem>Web Server:</em> <?php print apache_get_version(); ?></li>
|
145 |
<?php endif; ?>
|
146 |
</ul>
|
147 |
</td>
|
@@ -152,7 +152,7 @@ class FeedWordPressDiagnosticsPage extends FeedWordPressAdminPage {
|
|
152 |
<td><?php if (!is_wp_error($link_category_id)) :
|
153 |
$term = get_term($link_category_id, 'link_category');
|
154 |
?><p>Syndicated feeds are
|
155 |
-
kept in link category #<?php print $term->term_id; ?>, <strong><?php print $term->name; ?></strong>.</p>
|
156 |
<?php else : ?>
|
157 |
<p><strong>FeedWordPress has been unable to set up a valid Link Category
|
158 |
for syndicated feeds.</strong> Attempting to set one up returned an
|
@@ -162,7 +162,7 @@ class FeedWordPressDiagnosticsPage extends FeedWordPressAdminPage {
|
|
162 |
<tbody>
|
163 |
<tr>
|
164 |
<th scope="row">Message:</th>
|
165 |
-
<td><?php print $link_category_id->get_error_message(); ?></td>
|
166 |
</tr>
|
167 |
<?php $data = $link_category_id->get_error_data(); if (!empty($data)) : ?>
|
168 |
<tr>
|
@@ -233,7 +233,7 @@ testing but absolutely inappropriate for a production server.</p>
|
|
233 |
<?php endforeach; ?>
|
234 |
<option value="mailto"<?php if (!is_null($ded_addy)) : ?> selected="selected"<?php endif; ?>>another e-mail address...</option>
|
235 |
</select>
|
236 |
-
<input type="email" id="diagnostics-email-destination-address" name="diagnostics_email_destination_address" value="<?php print $ded_addy; ?>" placeholder="email address" /></li>
|
237 |
</ul></td>
|
238 |
</tr>
|
239 |
</table>
|
@@ -312,8 +312,8 @@ testing but absolutely inappropriate for a production server.</p>
|
|
312 |
<li><label><input
|
313 |
type="checkbox" name="diagnostics_show[]"
|
314 |
value="<?php print esc_html($key); ?>"
|
315 |
-
<?php
|
316 |
-
<?php print $label; ?></label></li>
|
317 |
<?php endforeach; ?>
|
318 |
</ul></td>
|
319 |
</tr>
|
@@ -393,7 +393,7 @@ function clone_http_test_args_keyvalue_prototype () {
|
|
393 |
<div>URL: <code><?php print esc_html($page->test_html['url']); ?></code></div>
|
394 |
<div style="position: relative">
|
395 |
<div style="width: 100%; overflow: scroll; background-color: #eed">
|
396 |
-
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -o-pre-wrap;"><?php print $page->test_html['http_test']; ?></pre>
|
397 |
</div>
|
398 |
</div>
|
399 |
</td>
|
135 |
<tr>
|
136 |
<th scope="row">Hosting Environment:</th>
|
137 |
<td><ul style="margin-top: 0; padding-top: 0;">
|
138 |
+
<li><em>WordPress:</em> version <?php print esc_html( $wp_version ); ?></li>
|
139 |
+
<li><em>SimplePie:</em> version <?php print esc_html( SIMPLEPIE_VERSION ); ?></li>
|
140 |
+
<?php if ( function_exists( 'phpversion' ) ) : ?>
|
141 |
+
<li><em>PHP:</em> version <?php print esc_html( phpversion() ); ?></li>
|
142 |
<?php endif; ?>
|
143 |
+
<?php if (function_exists( 'apache_get_version' )) : ?>
|
144 |
+
<li><sem>Web Server:</em> <?php print esc_html( apache_get_version() ); ?></li>
|
145 |
<?php endif; ?>
|
146 |
</ul>
|
147 |
</td>
|
152 |
<td><?php if (!is_wp_error($link_category_id)) :
|
153 |
$term = get_term($link_category_id, 'link_category');
|
154 |
?><p>Syndicated feeds are
|
155 |
+
kept in link category #<?php print esc_html( $term->term_id ); ?>, <strong><?php print esc_html( $term->name ); ?></strong>.</p>
|
156 |
<?php else : ?>
|
157 |
<p><strong>FeedWordPress has been unable to set up a valid Link Category
|
158 |
for syndicated feeds.</strong> Attempting to set one up returned an
|
162 |
<tbody>
|
163 |
<tr>
|
164 |
<th scope="row">Message:</th>
|
165 |
+
<td><?php print esc_html( $link_category_id->get_error_message() ); ?></td>
|
166 |
</tr>
|
167 |
<?php $data = $link_category_id->get_error_data(); if (!empty($data)) : ?>
|
168 |
<tr>
|
233 |
<?php endforeach; ?>
|
234 |
<option value="mailto"<?php if (!is_null($ded_addy)) : ?> selected="selected"<?php endif; ?>>another e-mail address...</option>
|
235 |
</select>
|
236 |
+
<input type="email" id="diagnostics-email-destination-address" name="diagnostics_email_destination_address" value="<?php print esc_attr( $ded_addy ); ?>" placeholder="email address" /></li>
|
237 |
</ul></td>
|
238 |
</tr>
|
239 |
</table>
|
312 |
<li><label><input
|
313 |
type="checkbox" name="diagnostics_show[]"
|
314 |
value="<?php print esc_html($key); ?>"
|
315 |
+
<?php fwp_selected_flag( $checked, $key, "checked" ); ?> />
|
316 |
+
<?php print esc_html( $label ); ?></label></li>
|
317 |
<?php endforeach; ?>
|
318 |
</ul></td>
|
319 |
</tr>
|
393 |
<div>URL: <code><?php print esc_html($page->test_html['url']); ?></code></div>
|
394 |
<div style="position: relative">
|
395 |
<div style="width: 100%; overflow: scroll; background-color: #eed">
|
396 |
+
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -o-pre-wrap;"><?php print esc_html($page->test_html['http_test']); ?></pre>
|
397 |
</div>
|
398 |
</div>
|
399 |
</td>
|
feeds-page.php
CHANGED
@@ -199,9 +199,9 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
199 |
<tr>
|
200 |
<th scope="row">Update Method:</th>
|
201 |
<td><select id="automatic-updates-selector" name="automatic_updates" size="1" onchange="contextual_appearance('automatic-updates-selector', 'cron-job-explanation', null, 'no');">
|
202 |
-
<option value="shutdown"<?php
|
203 |
-
<option value="init"<?php
|
204 |
-
<option value="no"<?php
|
205 |
</select>
|
206 |
<div id="cron-job-explanation" class="setting-description">
|
207 |
<p><?php
|
@@ -231,7 +231,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
231 |
|
232 |
?>If you want to use a cron job,
|
233 |
you can perform scheduled updates by sending regularly-scheduled
|
234 |
-
requests to <a href="<?php bloginfo('url'); ?>?update_feedwordpress=1"><code><?php bloginfo('url') ?>?update_feedwordpress=1</code></a>
|
235 |
For example, inserting the following line in your crontab:</p>
|
236 |
<pre style="font-size: 0.80em"><code>*/10 * * * * <?php print esc_html($cmdline); ?></code></pre>
|
237 |
<p class="setting-description">will check in every 10 minutes
|
@@ -347,10 +347,10 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
347 |
<tr>
|
348 |
<th scope="row"><?php print __('Time limit on updates'); ?>:</th>
|
349 |
<td><select id="time-limit" name="update_time_limit" size="1" onchange="contextual_appearance('time-limit', 'time-limit-box', null, 'yes');">
|
350 |
-
<option value="no"<?php
|
351 |
-
<option value="yes"<?php
|
352 |
</select>
|
353 |
-
<span id="time-limit-box"><label><input type="text" name="time_limit_seconds" value="<?php print $update_time_limit; ?>" size="5" /> seconds</label></span>
|
354 |
</tr>
|
355 |
|
356 |
<?php endif; ?>
|
@@ -365,7 +365,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
365 |
$updateWindow = DEFAULT_UPDATE_PERIOD;
|
366 |
endif;
|
367 |
?>
|
368 |
-
<p>Wait <input type="text" name="update_window" value="<?php print $updateWindow; ?>" size="4" /> minutes between polling.</p>
|
369 |
<div class="setting-description" id="update-scheduling-note">
|
370 |
<p<?php if ($updateWindow<50) : ?> style="color: white; background-color: #703030; padding: 1.0em;"<?php endif; ?>><strong>Recommendation.</strong> Unless you are positive that you have the webmaster's permission, you generally should not set FeedWordPress to poll feeds more frequently than once every 60 minutes. Many webmasters consider more frequent automated polling to be abusive, and may complain to your web host, or ban your IP address, as retaliation for hammering their servers too hard.</p>
|
371 |
<p><strong>Note.</strong> This is a default setting that FeedWordPress uses to schedule updates when the feed does not provide any scheduling requests. If this feed does provide update scheduling information (through elements such as <code><rss:ttl></code> or <code><sy:updateFrequency></code>), FeedWordPress will respect the feed's request.</p>
|
@@ -393,9 +393,9 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
393 |
endif;
|
394 |
?>
|
395 |
<p>Wait no more than
|
396 |
-
than <input name="fetch_timeout" type="number" min="0" size="3" value="<?php print $timeout; ?>" />
|
397 |
-
second(s) when trying to fetch <?php print $article; ?> feed to check for updates.</p>
|
398 |
-
<p>If <?php print $article; ?> source's web server does not respond before time runs
|
399 |
out, FeedWordPress will skip over the source and try again during
|
400 |
the next update cycle.</p>
|
401 |
<?php
|
@@ -478,24 +478,28 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
478 |
'feedwordpress_http_auth_methods',
|
479 |
$feedwordpress->httpauth->methods_available()
|
480 |
);
|
481 |
-
|
|
|
|
|
|
|
|
|
482 |
if (count($authMethods) > 1) : /* More than '-' */
|
483 |
?>
|
484 |
-
<div class="link-rss-authentication" id="
|
485 |
<table>
|
486 |
<tbody>
|
487 |
-
<tr class="link-rss-authentication-credentials" id="
|
488 |
<td><label>user: <input type="text" name="link_rss_username"
|
489 |
value="<?php print esc_attr($params['username']); ?>" size="16"
|
490 |
placeholder="username to access this feed" /></label></td>
|
491 |
<td><label>pass: <input type="text" name="link_rss_password"
|
492 |
value="<?php print esc_attr($params['password']); ?>" size="16"
|
493 |
placeholder="password to access this feed" /></label></td>
|
494 |
-
<td class="link-rss-authentication-method" id="
|
495 |
<?php foreach ($authMethods as $value => $label) : ?>
|
496 |
<option value="<?php print esc_attr($value); ?>"<?php
|
497 |
-
|
498 |
-
|
499 |
<?php endforeach; ?>
|
500 |
</select></label></td>
|
501 |
</tr>
|
@@ -504,13 +508,13 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
504 |
</div>
|
505 |
|
506 |
<script type="text/javascript">
|
507 |
-
jQuery('<td><a class="add-remove remove-it" id="link-rss-userpass-remove<?php print $slug; ?>" href="#"><span class="x">(X)</span> Remove</a></td>')
|
508 |
-
.appendTo('
|
509 |
.click( feedAuthenticationMethodUnPress );
|
510 |
-
jQuery('#link-rss-auth-method<?php print $slug; ?>').change( feedAuthenticationMethod );
|
511 |
feedAuthenticationMethod({
|
512 |
init: true,
|
513 |
-
node: jQuery('
|
514 |
</script>
|
515 |
|
516 |
<?php
|
@@ -612,12 +616,12 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
612 |
$i = 0;
|
613 |
foreach ($link_rss_params as $index => $pair) :
|
614 |
?>
|
615 |
-
<tr class="link-rss-params-row" id="link-rss-params-<?php print $index; ?>">
|
616 |
<td><label>Parameter: <input type="text" class="link_params_key"
|
617 |
-
name="link_rss_params_key[<?php print $index; ?>]" value="<?php print esc_html($pair[0]); ?>"
|
618 |
size="5" style="width: 5em" placeholder="name" /></label></td>
|
619 |
<td class="link-rss-params-value-cell"><label class="link_params_value_label">= <input type="text" class="link_params_value"
|
620 |
-
name="link_rss_params_value[<?php print $index; ?>]" value="<?php print esc_html($pair[1]); ?>"
|
621 |
size="8" placeholder="value" /></label></td>
|
622 |
</tr>
|
623 |
<?php
|
@@ -627,7 +631,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
627 |
</tbody>
|
628 |
</table>
|
629 |
|
630 |
-
<div><input type="hidden" id="link-rss-params-num" name="link_rss_params_num" value="<?php print $i; ?>" /></div>
|
631 |
|
632 |
<script type="text/javascript">
|
633 |
function linkParamsRowRemove (element) {
|
@@ -675,26 +679,30 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
675 |
"url" => __('Homepage'),
|
676 |
);
|
677 |
foreach ($rows as $what => $label) :
|
|
|
|
|
|
|
|
|
678 |
?>
|
679 |
<tr>
|
680 |
-
<th scope="row"><?php print $label ?></th>
|
681 |
<td>
|
682 |
-
<div id="
|
683 |
-
value="<?php echo $info[$what]; ?>" style="width: 95%" /></div>
|
684 |
-
<div id="
|
685 |
-
<?php if ($what=='url') : ?><a href="<?php print $info[$what]; ?>"><?php else : ?><strong><?php endif; ?>
|
686 |
-
<?php print (strlen(trim($info[$what])) > 0) ? $info[$what] : '(none provided)'; ?>
|
687 |
<?php if ($what=='url') : ?></a><?php else : ?></strong><?php endif; ?></div>
|
688 |
|
689 |
<div>
|
690 |
-
<label><input id="
|
691 |
-
type="radio" name="
|
692 |
<?php echo (($hardcode[$what]=='yes')?'':' checked="checked"');?>
|
693 |
-
onchange="contextual_appearance('basics-hardcode-<?php print $what; ?>', '
|
694 |
/> Update automatically from feed</label>
|
695 |
-
<label><input type="radio" name="
|
696 |
<?php echo (($hardcode[$what]!='yes')?'':' checked="checked"');?>
|
697 |
-
onchange="contextual_appearance('
|
698 |
/> Edit manually</label>
|
699 |
</div>
|
700 |
</td>
|
@@ -753,7 +761,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
753 |
<p class="setting-description">These custom settings are special fields for the <strong>feed</strong> you are
|
754 |
syndicating, to be retrieved in templates using the <code>get_feed_meta()</code> function. They do not create
|
755 |
custom fields on syndicated <strong>posts</strong>. If you want to create custom fields that are applied to each
|
756 |
-
individual post from this feed, set up the settings in <a href="<?php print $postsSettings; ?>">Syndicated Posts</a>.</p>
|
757 |
|
758 |
<div id="postcustomstuff">
|
759 |
<table id="meta-list" cellpadding="3">
|
@@ -769,10 +777,10 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
769 |
if (!preg_match("\007^((".implode(')|(', $page->special_settings)."))$\007i", $key)) :
|
770 |
?>
|
771 |
<tr style="vertical-align:top">
|
772 |
-
<th width="30%" scope="row"><input type="hidden" name="notes[<?php echo $i; ?>][key0]" value="<?php echo esc_html($key); ?>" />
|
773 |
-
<input id="notes-<?php echo $i; ?>-key" name="notes[<?php echo $i; ?>][key1]" value="<?php echo esc_html($key); ?>" /></th>
|
774 |
-
<td width="60%"><textarea rows="2" cols="40" id="notes-<?php echo $i; ?>-value" name="notes[<?php echo $i; ?>][value]"><?php echo esc_html($value); ?></textarea></td>
|
775 |
-
<td width="10%"><select name="notes[<?php echo $i; ?>][action]">
|
776 |
<option value="update">save changes</option>
|
777 |
<option value="delete">delete this setting</option>
|
778 |
</select></td>
|
@@ -783,9 +791,9 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
783 |
endforeach;
|
784 |
?>
|
785 |
<tr>
|
786 |
-
<th scope="row"><input type="text" size="10" name="notes[<?php echo $i; ?>][key1]" value="" /></th>
|
787 |
-
<td><textarea name="notes[<?php echo $i; ?>][value]" rows="2" cols="40"></textarea></td>
|
788 |
-
<td><em>add new setting...</em><input type="hidden" name="notes[<?php echo $i; ?>][action]" value="update" /></td>
|
789 |
</tr>
|
790 |
</table>
|
791 |
</div> <!-- id="postcustomstuff" -->
|
@@ -840,13 +848,13 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
840 |
$current = $this->link->link->link_rss;
|
841 |
$feeds[] = $current;
|
842 |
endif;
|
843 |
-
$name =
|
844 |
else: // Or a new subscription to add?
|
845 |
-
$name = "Subscribe to
|
846 |
endif;
|
847 |
?>
|
848 |
<div class="wrap" id="feed-finder">
|
849 |
-
<h2>Feed Finder: <?php echo $name; ?></h2>
|
850 |
|
851 |
<?php
|
852 |
if ($feedSwitch) :
|
@@ -892,7 +900,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
892 |
|
893 |
if (count($feeds) > 1) :
|
894 |
$option_template = 'Option %d: ';
|
895 |
-
$form_class = '
|
896 |
?>
|
897 |
<p><strong>This web page provides at least <?php print count($feeds); ?> different feeds.</strong> These feeds may provide the same information
|
898 |
in different formats, or may track different items. (You can check the Feed Information and the
|
@@ -938,7 +946,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
938 |
$feed_version = '';
|
939 |
endif;
|
940 |
?>
|
941 |
-
<form<?php print $form_class; ?> action="<?php print $this->form_action('syndication.php'); ?>" method="post">
|
942 |
<div class="inside"><?php FeedWordPressCompatibility::stamp_nonce('feedwordpress_switchfeed'); ?>
|
943 |
|
944 |
<?php
|
@@ -952,7 +960,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
952 |
endif;
|
953 |
?>
|
954 |
<fieldset class="<?php print implode(" ", $classes); ?>">
|
955 |
-
<legend><?php
|
956 |
|
957 |
<?php
|
958 |
$this->stamp_link_id();
|
@@ -974,8 +982,8 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
974 |
<div>
|
975 |
<div class="feed-sample">
|
976 |
<?php
|
977 |
-
$link =
|
978 |
-
$post =
|
979 |
if (!is_wp_error($rss) and count($rss->items) > 0):
|
980 |
// Prepare to display Sample Item
|
981 |
$link = new MagpieMockLink(array('simplepie' => $pie, 'magpie' => $rss), $f);
|
@@ -983,11 +991,11 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
983 |
?>
|
984 |
<h3>Sample Item</h3>
|
985 |
<ul>
|
986 |
-
<li><strong>Title:</strong> <a href="<?php echo $post->post['meta']['syndication_permalink']; ?>"><?php echo $post->post['post_title']; ?></a></li>
|
987 |
<li><strong>Date:</strong> <?php print date('d-M-y g:i:s a', $post->published()); ?></li>
|
988 |
</ul>
|
989 |
<div class="entry">
|
990 |
-
<?php print $post->post['post_content']; ?>
|
991 |
</div>
|
992 |
<?php
|
993 |
do_action('feedwordpress_feed_finder_sample_item', $f, $post, $link);
|
@@ -1012,10 +1020,10 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
1012 |
<div>
|
1013 |
<h3>Feed Information</h3>
|
1014 |
<ul>
|
1015 |
-
<li><strong>Homepage:</strong> <a href="<?php echo $feed_link; ?>"><?php echo is_null($feed_title)?'<em>Unknown</em>'
|
1016 |
-
<li><strong>Feed URL:</strong> <a title="<?php echo esc_html($f); ?>" href="<?php echo
|
1017 |
-
<li><strong>Encoding:</strong> <?php echo isset($rss->encoding)?esc_html($rss->encoding):"<em>Unknown</em>"; ?></li>
|
1018 |
-
<li><strong>Description:</strong> <?php echo isset($rss->channel['description'])?esc_html($rss->channel['description']):"<em>Unknown</em>"; ?></li>
|
1019 |
</ul>
|
1020 |
<?php $this->display_authentication_credentials_box(array(
|
1021 |
'username' => $username,
|
@@ -1106,7 +1114,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
|
|
1106 |
$alt = $params['alt'];
|
1107 |
|
1108 |
?>
|
1109 |
-
<form action="<?php print $this->form_action('syndication.php'); ?>" method="post">
|
1110 |
<div class="inside"><?php
|
1111 |
FeedWordPressCompatibility::stamp_nonce('feedwordpress_feeds');
|
1112 |
?>
|
199 |
<tr>
|
200 |
<th scope="row">Update Method:</th>
|
201 |
<td><select id="automatic-updates-selector" name="automatic_updates" size="1" onchange="contextual_appearance('automatic-updates-selector', 'cron-job-explanation', null, 'no');">
|
202 |
+
<option value="shutdown"<?php fwp_selected_flag( $automatic_updates=='shutdown' ); ?>>automatically check for updates after pages load</option>
|
203 |
+
<option value="init"<?php fwp_selected_flag( $automatic_updates=='init' ); ?>>automatically check for updates before pages load</option>
|
204 |
+
<option value="no"<?php fwp_selected_flag( !$automatic_updates ); ?>>cron job or manual updates</option>
|
205 |
</select>
|
206 |
<div id="cron-job-explanation" class="setting-description">
|
207 |
<p><?php
|
231 |
|
232 |
?>If you want to use a cron job,
|
233 |
you can perform scheduled updates by sending regularly-scheduled
|
234 |
+
requests to <a href="<?php bloginfo('url'); ?>?update_feedwordpress=1"><code><?php bloginfo('url'); ?>?update_feedwordpress=1</code></a>
|
235 |
For example, inserting the following line in your crontab:</p>
|
236 |
<pre style="font-size: 0.80em"><code>*/10 * * * * <?php print esc_html($cmdline); ?></code></pre>
|
237 |
<p class="setting-description">will check in every 10 minutes
|
347 |
<tr>
|
348 |
<th scope="row"><?php print __('Time limit on updates'); ?>:</th>
|
349 |
<td><select id="time-limit" name="update_time_limit" size="1" onchange="contextual_appearance('time-limit', 'time-limit-box', null, 'yes');">
|
350 |
+
<option value="no"<?php fwp_selected_flag($update_time_limit<=0); ?>>no time limit on updates</option>
|
351 |
+
<option value="yes"<?php fwp_selected_flag($update_time_limit>0); ?>>limit updates to no more than...</option>
|
352 |
</select>
|
353 |
+
<span id="time-limit-box"><label><input type="text" name="time_limit_seconds" value="<?php print esc_attr($update_time_limit); ?>" size="5" /> seconds</label></span>
|
354 |
</tr>
|
355 |
|
356 |
<?php endif; ?>
|
365 |
$updateWindow = DEFAULT_UPDATE_PERIOD;
|
366 |
endif;
|
367 |
?>
|
368 |
+
<p>Wait <input type="text" name="update_window" value="<?php print esc_attr($updateWindow); ?>" size="4" /> minutes between polling.</p>
|
369 |
<div class="setting-description" id="update-scheduling-note">
|
370 |
<p<?php if ($updateWindow<50) : ?> style="color: white; background-color: #703030; padding: 1.0em;"<?php endif; ?>><strong>Recommendation.</strong> Unless you are positive that you have the webmaster's permission, you generally should not set FeedWordPress to poll feeds more frequently than once every 60 minutes. Many webmasters consider more frequent automated polling to be abusive, and may complain to your web host, or ban your IP address, as retaliation for hammering their servers too hard.</p>
|
371 |
<p><strong>Note.</strong> This is a default setting that FeedWordPress uses to schedule updates when the feed does not provide any scheduling requests. If this feed does provide update scheduling information (through elements such as <code><rss:ttl></code> or <code><sy:updateFrequency></code>), FeedWordPress will respect the feed's request.</p>
|
393 |
endif;
|
394 |
?>
|
395 |
<p>Wait no more than
|
396 |
+
than <input name="fetch_timeout" type="number" min="0" size="3" value="<?php print esc_attr($timeout); ?>" />
|
397 |
+
second(s) when trying to fetch <?php print esc_html($article); ?> feed to check for updates.</p>
|
398 |
+
<p>If <?php print esc_html($article); ?> source's web server does not respond before time runs
|
399 |
out, FeedWordPress will skip over the source and try again during
|
400 |
the next update cycle.</p>
|
401 |
<?php
|
478 |
'feedwordpress_http_auth_methods',
|
479 |
$feedwordpress->httpauth->methods_available()
|
480 |
);
|
481 |
+
|
482 |
+
$linkRssAuthId = sanitize_html_class('link-rss-authentication' . $slug);
|
483 |
+
$linkRssCredentialsId = sanitize_html_class('link-rss-authentication-credentials' . $slug);
|
484 |
+
$linkRssAuthMethodId = sanitize_html_class('link-rss-authentication-method' . $slug );
|
485 |
+
|
486 |
if (count($authMethods) > 1) : /* More than '-' */
|
487 |
?>
|
488 |
+
<div class="link-rss-authentication" id="<?php print esc_attr($linkRssAuthId); ?>">
|
489 |
<table>
|
490 |
<tbody>
|
491 |
+
<tr class="link-rss-authentication-credentials" id="<?php print esc_attr($linkRssCredentialsId); ?>">
|
492 |
<td><label>user: <input type="text" name="link_rss_username"
|
493 |
value="<?php print esc_attr($params['username']); ?>" size="16"
|
494 |
placeholder="username to access this feed" /></label></td>
|
495 |
<td><label>pass: <input type="text" name="link_rss_password"
|
496 |
value="<?php print esc_attr($params['password']); ?>" size="16"
|
497 |
placeholder="password to access this feed" /></label></td>
|
498 |
+
<td class="link-rss-authentication-method" id="<?php print esc_attr($linkRssAuthMethodId); ?>"><label>method: <select class="link-rss-auth-method" id="link-rss-auth-method" name="link_rss_auth_method" size="1">
|
499 |
<?php foreach ($authMethods as $value => $label) : ?>
|
500 |
<option value="<?php print esc_attr($value); ?>"<?php
|
501 |
+
fwp_selected_flag($value == $params['method']);
|
502 |
+
?>><?php print esc_html($label); ?></option>
|
503 |
<?php endforeach; ?>
|
504 |
</select></label></td>
|
505 |
</tr>
|
508 |
</div>
|
509 |
|
510 |
<script type="text/javascript">
|
511 |
+
jQuery('<td><a class="add-remove remove-it" id="link-rss-userpass-remove<?php print esc_attr($slug); ?>" href="#"><span class="x">(X)</span> Remove</a></td>')
|
512 |
+
.appendTo('#<?php print esc_attr($linkRssCredentialsId); ?>')
|
513 |
.click( feedAuthenticationMethodUnPress );
|
514 |
+
jQuery('#link-rss-auth-method<?php print esc_attr($slug); ?>').change( feedAuthenticationMethod );
|
515 |
feedAuthenticationMethod({
|
516 |
init: true,
|
517 |
+
node: jQuery('#<?php print esc_attr($linkRssAuthId); ?>') });
|
518 |
</script>
|
519 |
|
520 |
<?php
|
616 |
$i = 0;
|
617 |
foreach ($link_rss_params as $index => $pair) :
|
618 |
?>
|
619 |
+
<tr class="link-rss-params-row" id="link-rss-params-<?php print esc_attr($index); ?>">
|
620 |
<td><label>Parameter: <input type="text" class="link_params_key"
|
621 |
+
name="link_rss_params_key[<?php print esc_attr($index); ?>]" value="<?php print esc_html($pair[0]); ?>"
|
622 |
size="5" style="width: 5em" placeholder="name" /></label></td>
|
623 |
<td class="link-rss-params-value-cell"><label class="link_params_value_label">= <input type="text" class="link_params_value"
|
624 |
+
name="link_rss_params_value[<?php print esc_attr($index); ?>]" value="<?php print esc_html($pair[1]); ?>"
|
625 |
size="8" placeholder="value" /></label></td>
|
626 |
</tr>
|
627 |
<?php
|
631 |
</tbody>
|
632 |
</table>
|
633 |
|
634 |
+
<div><input type="hidden" id="link-rss-params-num" name="link_rss_params_num" value="<?php print esc_attr($i); ?>" /></div>
|
635 |
|
636 |
<script type="text/javascript">
|
637 |
function linkParamsRowRemove (element) {
|
679 |
"url" => __('Homepage'),
|
680 |
);
|
681 |
foreach ($rows as $what => $label) :
|
682 |
+
$hardcode_name = sanitize_html_class( sprintf( 'hardcode_%s', $what ) );
|
683 |
+
$hardcode_id = sanitize_html_class( sprintf( 'basics-hardcode-%s', $what ) );
|
684 |
+
$hardcode_view_id = sanitize_html_class( sprintf( 'basics-%s-view', $what ) );
|
685 |
+
$hardcode_edit_id = sanitize_html_class( sprintf( 'basics-%s-edit', $what ) );
|
686 |
?>
|
687 |
<tr>
|
688 |
+
<th scope="row"><?php print esc_html( $label ); ?></th>
|
689 |
<td>
|
690 |
+
<div id="<?php print esc_attr( $hardcode_edit_id ); ?>"><input type="text" name="link<?php print esc_attr($what); ?>"
|
691 |
+
value="<?php echo esc_attr($info[$what]); ?>" style="width: 95%" /></div>
|
692 |
+
<div id="<?php print esc_attr( $hardcode_view_id ); ?>">
|
693 |
+
<?php if ($what=='url') : ?><a href="<?php print esc_url( $info[$what] ); ?>"><?php else : ?><strong><?php endif; ?>
|
694 |
+
<?php print ( strlen( trim( $info[$what] ) ) > 0 ) ? esc_attr( $info[$what] ) : '(none provided)'; ?>
|
695 |
<?php if ($what=='url') : ?></a><?php else : ?></strong><?php endif; ?></div>
|
696 |
|
697 |
<div>
|
698 |
+
<label><input id="<?php print esc_attr($hardcode_id); ?>"
|
699 |
+
type="radio" name="<?php print esc_attr($hardcode_name); ?>" value="no"
|
700 |
<?php echo (($hardcode[$what]=='yes')?'':' checked="checked"');?>
|
701 |
+
onchange="contextual_appearance('basics-hardcode-<?php print esc_attr($what); ?>', '<?php print esc_attr($hardcode_view_id ); ?>', '<?php print esc_attr( $hardcode_edit_id ); ?>', 'no', 'block', /*checkbox=*/ true)"
|
702 |
/> Update automatically from feed</label>
|
703 |
+
<label><input type="radio" name="<?php print esc_attr($hardcode_name); ?>" value="yes"
|
704 |
<?php echo (($hardcode[$what]!='yes')?'':' checked="checked"');?>
|
705 |
+
onchange="contextual_appearance('<?php print esc_attr($hardcode_id); ?>', '<?php print esc_attr($hardcode_view_id); ?>', '<?php print esc_attr($hardcode_edit_id); ?>', 'no', 'block', /*checkbox=*/ true)"
|
706 |
/> Edit manually</label>
|
707 |
</div>
|
708 |
</td>
|
761 |
<p class="setting-description">These custom settings are special fields for the <strong>feed</strong> you are
|
762 |
syndicating, to be retrieved in templates using the <code>get_feed_meta()</code> function. They do not create
|
763 |
custom fields on syndicated <strong>posts</strong>. If you want to create custom fields that are applied to each
|
764 |
+
individual post from this feed, set up the settings in <a href="<?php print esc_url($postsSettings); ?>">Syndicated Posts</a>.</p>
|
765 |
|
766 |
<div id="postcustomstuff">
|
767 |
<table id="meta-list" cellpadding="3">
|
777 |
if (!preg_match("\007^((".implode(')|(', $page->special_settings)."))$\007i", $key)) :
|
778 |
?>
|
779 |
<tr style="vertical-align:top">
|
780 |
+
<th width="30%" scope="row"><input type="hidden" name="notes[<?php echo esc_attr($i); ?>][key0]" value="<?php echo esc_html($key); ?>" />
|
781 |
+
<input id="notes-<?php echo esc_attr($i); ?>-key" name="notes[<?php echo esc_attr($i); ?>][key1]" value="<?php echo esc_html($key); ?>" /></th>
|
782 |
+
<td width="60%"><textarea rows="2" cols="40" id="notes-<?php echo esc_attr($i); ?>-value" name="notes[<?php echo esc_attr($i); ?>][value]"><?php echo esc_html($value); ?></textarea></td>
|
783 |
+
<td width="10%"><select name="notes[<?php echo esc_attr($i); ?>][action]">
|
784 |
<option value="update">save changes</option>
|
785 |
<option value="delete">delete this setting</option>
|
786 |
</select></td>
|
791 |
endforeach;
|
792 |
?>
|
793 |
<tr>
|
794 |
+
<th scope="row"><input type="text" size="10" name="notes[<?php echo esc_attr( $i ); ?>][key1]" value="" /></th>
|
795 |
+
<td><textarea name="notes[<?php echo esc_attr( $i ); ?>][value]" rows="2" cols="40"></textarea></td>
|
796 |
+
<td><em>add new setting...</em><input type="hidden" name="notes[<?php echo esc_attr( $i ); ?>][action]" value="update" /></td>
|
797 |
</tr>
|
798 |
</table>
|
799 |
</div> <!-- id="postcustomstuff" -->
|
848 |
$current = $this->link->link->link_rss;
|
849 |
$feeds[] = $current;
|
850 |
endif;
|
851 |
+
$name = $this->link->link->link_name;
|
852 |
else: // Or a new subscription to add?
|
853 |
+
$name = "Subscribe to ".feedwordpress_display_url($lookup);
|
854 |
endif;
|
855 |
?>
|
856 |
<div class="wrap" id="feed-finder">
|
857 |
+
<h2>Feed Finder: <?php echo esc_html($name); ?></h2>
|
858 |
|
859 |
<?php
|
860 |
if ($feedSwitch) :
|
900 |
|
901 |
if (count($feeds) > 1) :
|
902 |
$option_template = 'Option %d: ';
|
903 |
+
$form_class = 'multi';
|
904 |
?>
|
905 |
<p><strong>This web page provides at least <?php print count($feeds); ?> different feeds.</strong> These feeds may provide the same information
|
906 |
in different formats, or may track different items. (You can check the Feed Information and the
|
946 |
$feed_version = '';
|
947 |
endif;
|
948 |
?>
|
949 |
+
<form<?php print fwp_form_class_attr($form_class); ?> action="<?php print esc_url( $this->form_action( 'syndication.php' ) ); ?>" method="post">
|
950 |
<div class="inside"><?php FeedWordPressCompatibility::stamp_nonce('feedwordpress_switchfeed'); ?>
|
951 |
|
952 |
<?php
|
960 |
endif;
|
961 |
?>
|
962 |
<fieldset class="<?php print implode(" ", $classes); ?>">
|
963 |
+
<legend><?php print esc_html( sprintf( $option_template, ( $key + 1 ) ) ); print esc_html($feed_type) . " "; print esc_html( sprintf( $feed_version_template, $feed_version ) ); ?> feed<?php print esc_html( $currentFeed ); ?></legend>
|
964 |
|
965 |
<?php
|
966 |
$this->stamp_link_id();
|
982 |
<div>
|
983 |
<div class="feed-sample">
|
984 |
<?php
|
985 |
+
$link = null;
|
986 |
+
$post = null;
|
987 |
if (!is_wp_error($rss) and count($rss->items) > 0):
|
988 |
// Prepare to display Sample Item
|
989 |
$link = new MagpieMockLink(array('simplepie' => $pie, 'magpie' => $rss), $f);
|
991 |
?>
|
992 |
<h3>Sample Item</h3>
|
993 |
<ul>
|
994 |
+
<li><strong>Title:</strong> <a href="<?php echo esc_url( $post->post['meta']['syndication_permalink'] ); ?>"><?php echo esc_html( $post->post['post_title'] ); ?></a></li>
|
995 |
<li><strong>Date:</strong> <?php print date('d-M-y g:i:s a', $post->published()); ?></li>
|
996 |
</ul>
|
997 |
<div class="entry">
|
998 |
+
<?php print wp_kses( $post->post['post_content'] ); ?>
|
999 |
</div>
|
1000 |
<?php
|
1001 |
do_action('feedwordpress_feed_finder_sample_item', $f, $post, $link);
|
1020 |
<div>
|
1021 |
<h3>Feed Information</h3>
|
1022 |
<ul>
|
1023 |
+
<li><strong>Homepage:</strong> <a href="<?php echo esc_url( $feed_link ); ?>"><?php echo is_null($feed_title)?'<em>Unknown</em>': esc_html( $feed_title ); ?></a></li>
|
1024 |
+
<li><strong>Feed URL:</strong> <a title="<?php echo esc_html( $f ); ?>" href="<?php echo esc_url( $f ); ?>"><?php echo esc_html( feedwordpress_display_url($f, 40, 10) ); ?></a> (<a title="Check feed <<?php echo esc_html( $f ); ?>> for validity" href="http://feedvalidator.org/check.cgi?url=<?php echo urlencode( $f ); ?>">validate</a>)</li>
|
1025 |
+
<li><strong>Encoding:</strong> <?php echo isset($rss->encoding) ? esc_html($rss->encoding) : "<em>Unknown</em>"; ?></li>
|
1026 |
+
<li><strong>Description:</strong> <?php echo isset($rss->channel['description']) ? esc_html($rss->channel['description']) : "<em>Unknown</em>"; ?></li>
|
1027 |
</ul>
|
1028 |
<?php $this->display_authentication_credentials_box(array(
|
1029 |
'username' => $username,
|
1114 |
$alt = $params['alt'];
|
1115 |
|
1116 |
?>
|
1117 |
+
<form action="<?php print esc_url( $this->form_action('syndication.php') ); ?>" method="post">
|
1118 |
<div class="inside"><?php
|
1119 |
FeedWordPressCompatibility::stamp_nonce('feedwordpress_feeds');
|
1120 |
?>
|
feedwordpress.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: FeedWordPress
|
4 |
Plugin URI: http://feedwordpress.radgeek.com/
|
5 |
Description: simple and flexible Atom/RSS syndication for WordPress
|
6 |
-
Version: 2022.
|
7 |
Author: C. Johnson
|
8 |
Author URI: https://feedwordpress.radgeek.com/contact/
|
9 |
License: GPL
|
@@ -11,7 +11,7 @@ License: GPL
|
|
11 |
|
12 |
/**
|
13 |
* @package FeedWordPress
|
14 |
-
* @version 2022.
|
15 |
*/
|
16 |
|
17 |
# This plugin uses code derived from:
|
@@ -30,7 +30,7 @@ License: GPL
|
|
30 |
## CONSTANTS & DEFAULTS ############################################################
|
31 |
####################################################################################
|
32 |
|
33 |
-
define ('FEEDWORDPRESS_VERSION', '2022.
|
34 |
define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://feedwordpress.radgeek.com/contact');
|
35 |
|
36 |
if (!defined('FEEDWORDPRESS_BLEG')) :
|
@@ -49,13 +49,15 @@ define ('DEFAULT_UPDATE_PERIOD', 60); // value in minutes
|
|
49 |
define ('FEEDWORDPRESS_DEFAULT_CHECKIN_INTERVAL', DEFAULT_UPDATE_PERIOD/10);
|
50 |
|
51 |
if (isset($_REQUEST['feedwordpress_debug'])) :
|
52 |
-
$feedwordpress_debug = $_REQUEST['feedwordpress_debug'];
|
53 |
else :
|
54 |
$feedwordpress_debug = get_option('feedwordpress_debug');
|
55 |
-
if (is_string($feedwordpress_debug)) :
|
56 |
-
$feedwordpress_debug = ($feedwordpress_debug == 'yes');
|
57 |
-
endif;
|
58 |
endif;
|
|
|
|
|
|
|
|
|
|
|
59 |
define ('FEEDWORDPRESS_DEBUG', $feedwordpress_debug);
|
60 |
$feedwordpress_compatibility = true;
|
61 |
define ('FEEDWORDPRESS_COMPATIBILITY', $feedwordpress_compatibility);
|
@@ -240,8 +242,8 @@ function debug_out_feedwordpress_footer () {
|
|
240 |
## FILTERS: syndication-aware handling of post data for templates and feeds ####
|
241 |
################################################################################
|
242 |
|
243 |
-
$feedwordpress_the_syndicated_content =
|
244 |
-
$feedwordpress_the_original_permalink =
|
245 |
|
246 |
function feedwordpress_preserve_syndicated_content ($text) {
|
247 |
global $feedwordpress_the_syndicated_content;
|
@@ -250,7 +252,7 @@ function feedwordpress_preserve_syndicated_content ($text) {
|
|
250 |
if (!$p->is_exposed_to_formatting_filters()) :
|
251 |
$feedwordpress_the_syndicated_content = $text;
|
252 |
else :
|
253 |
-
$feedwordpress_the_syndicated_content =
|
254 |
endif;
|
255 |
return $text;
|
256 |
}
|
@@ -282,7 +284,7 @@ function feedwordpress_item_feed_data () {
|
|
282 |
endif;
|
283 |
$updated = get_feed_meta('feed/updated');
|
284 |
if (strlen($updated) > 0) : ?>
|
285 |
-
<updated><?php print $updated; ?></updated>
|
286 |
<?php
|
287 |
endif;
|
288 |
?>
|
@@ -382,7 +384,7 @@ function syndication_comments_feed_link ($link) {
|
|
382 |
// wfw:commentRss or atom:link/@rel="replies" we can make use of
|
383 |
// that value here.
|
384 |
$source = get_syndication_feed_object();
|
385 |
-
$replacement =
|
386 |
|
387 |
if (is_object($source) && $source->setting('munge comments feed links', 'munge_comments_feed_links', 'yes') != 'no') :
|
388 |
$commentFeeds = get_post_custom_values('wfw:commentRSS');
|
@@ -478,9 +480,9 @@ class FeedWordPress {
|
|
478 |
array('script', 'src')
|
479 |
);
|
480 |
|
481 |
-
var $feeds =
|
482 |
-
var $feedurls =
|
483 |
-
var $httpauth =
|
484 |
|
485 |
/**
|
486 |
* FeedWordPress::__construct (): Construct FeedWordPress singleton object
|
@@ -649,7 +651,7 @@ class FeedWordPress {
|
|
649 |
'Syndicated Sites', 'Syndication',
|
650 |
$menu_cap,
|
651 |
$syndicationMenu,
|
652 |
-
|
653 |
$this->plugin_dir_url( 'assets/images/feedwordpress-tiny.png' )
|
654 |
);
|
655 |
|
@@ -703,8 +705,8 @@ class FeedWordPress {
|
|
703 |
// This is a horrible fucking kludge that I have to do because the
|
704 |
// admin notice code is triggered before the code that updates the
|
705 |
// setting.
|
706 |
-
if (isset($
|
707 |
-
$feedwordpress_debug = $
|
708 |
else :
|
709 |
$feedwordpress_debug = get_option('feedwordpress_debug');
|
710 |
endif;
|
@@ -729,10 +731,10 @@ class FeedWordPress {
|
|
729 |
* it; or a de-activated subscription.
|
730 |
*
|
731 |
* @param mixed $which Numeric ID for a WordPress link object or string URL for a feed
|
732 |
-
* @return mixed SyndicatedLink object if subscription is found;
|
733 |
*/
|
734 |
public function subscription ($which) {
|
735 |
-
$sub =
|
736 |
|
737 |
if (is_string($which) and isset($this->feedurls[$which])) :
|
738 |
$which = $this->feedurls[$which];
|
@@ -764,9 +766,9 @@ class FeedWordPress {
|
|
764 |
# Arguments:
|
765 |
# ----------
|
766 |
# * $uri (string): either the URI of the feed to poll, the URI of the
|
767 |
-
# (human-readable) website whose feed you want to poll, or
|
768 |
#
|
769 |
-
# If $uri is
|
770 |
# ready for polling. It will not poll feeds that are marked as
|
771 |
# "Invisible" Links (signifying that the subscription has been
|
772 |
# de-activated), or feeds that are not yet stale according to their
|
@@ -780,7 +782,7 @@ class FeedWordPress {
|
|
780 |
# of old posts that were updated during the update. If both numbers
|
781 |
# are zero, there was no change since the last poll on that URI.
|
782 |
#
|
783 |
-
# * Returns
|
784 |
# installation of FeedWordPress syndicates.
|
785 |
#
|
786 |
# Effects:
|
@@ -812,7 +814,7 @@ class FeedWordPress {
|
|
812 |
global $wpdb;
|
813 |
|
814 |
if (FeedWordPress::needs_upgrade()) : // Will make duplicate posts if we don't hold off
|
815 |
-
return
|
816 |
endif;
|
817 |
|
818 |
if (!is_null($uri) and $uri != '*') :
|
@@ -853,7 +855,7 @@ class FeedWordPress {
|
|
853 |
|
854 |
|
855 |
// Loop through and check for new posts
|
856 |
-
$delta =
|
857 |
foreach ($feed_set as $feed_id) :
|
858 |
|
859 |
$feed = $this->subscription($feed_id);
|
@@ -903,7 +905,7 @@ class FeedWordPress {
|
|
903 |
return $delta;
|
904 |
} /* FeedWordPress::update () */
|
905 |
|
906 |
-
public function crash_ts ($default =
|
907 |
$crash_dt = (int) get_option('feedwordpress_update_time_limit', 0);
|
908 |
if ($crash_dt > 0) :
|
909 |
$crash_ts = time() + $crash_dt;
|
@@ -926,12 +928,12 @@ class FeedWordPress {
|
|
926 |
return (MyPHP::request('feedwordpress_key')==$this->secret_key());
|
927 |
} /* FeedWordPress::has_secret () */
|
928 |
|
929 |
-
var $update_hooked =
|
930 |
public function automatic_update_hook ($params = array()) {
|
931 |
$params = wp_parse_args($params, array( // Defaults
|
932 |
'setting only' => false,
|
933 |
));
|
934 |
-
$hook = get_option('feedwordpress_automatic_updates',
|
935 |
$method = 'FeedWordPress option';
|
936 |
|
937 |
// Allow for forced behavior in testing.
|
@@ -1135,14 +1137,14 @@ class FeedWordPress {
|
|
1135 |
if (MyPHP::request('zapped')) :
|
1136 |
$n = intval(MyPHP::request('zapped'));
|
1137 |
?>
|
1138 |
-
<div id="message" class="updated"><p><?php print $n; ?> syndicated item<?php print ($n!=1?'s':''); ?> zapped. <strong>These items will not be re-syndicated.</strong> If this was a mistake, you must <strong>immediately</strong> Un-Zap them in the Zapped items section to avoid losing the data.</p></div>
|
1139 |
<?php
|
1140 |
endif;
|
1141 |
|
1142 |
if (MyPHP::request('unzapped')) :
|
1143 |
$n = intval(MyPHP::request('unzapped'));
|
1144 |
?>
|
1145 |
-
<div id="message" class="updated"><p><?php print $n; ?> syndicated item<?php print ($n!=1?'s':'') ?> un-zapped and restored to normal.</p></div>
|
1146 |
<?php
|
1147 |
endif;
|
1148 |
} /* FeedWordPress::all_admin_notices () */
|
@@ -1423,7 +1425,7 @@ class FeedWordPress {
|
|
1423 |
$caption = apply_filters('feedwordpress_ui_erase_link_caption', __('Erase the record of this post (will be re-syndicated if it still appears on the feed).'));
|
1424 |
$linktext = apply_filters('feedwordpress_ui_erase_link_text', __('Erase/Resyndicate'));
|
1425 |
|
1426 |
-
$retireClass =
|
1427 |
if ($post->post_status == 'fwpzapped') :
|
1428 |
if (count(get_post_meta($post->ID, '_feedwordpress_zapped_blank_me')) > 0) :
|
1429 |
$retireCap = 'Un-Zap this syndicated post (so it will appear on the site again)';
|
@@ -1433,7 +1435,7 @@ class FeedWordPress {
|
|
1433 |
// No Un-Zap link for posts that have
|
1434 |
// been blanked. You'll just have to
|
1435 |
// Erase and hope you can resyndicate...
|
1436 |
-
$retireLink =
|
1437 |
endif;
|
1438 |
else :
|
1439 |
$retireCap = apply_filters('feedwordpress_ui_zap_link_caption', __('Zap this syndicated post (so it will not be re-syndicated if it still appears on the feed).'));
|
@@ -1711,9 +1713,9 @@ class FeedWordPress {
|
|
1711 |
|
1712 |
} /* FeedWordPress::null_email_set () */
|
1713 |
|
1714 |
-
public static function is_null_email
|
1715 |
-
$ret = in_array(strtolower(trim($email)), FeedWordPress::null_email_set());
|
1716 |
-
$ret = apply_filters('syndicated_item_author_is_null_email', $ret, $email);
|
1717 |
return $ret;
|
1718 |
} /* FeedWordPress::is_null_email () */
|
1719 |
|
@@ -1783,7 +1785,7 @@ class FeedWordPress {
|
|
1783 |
static function needs_upgrade () {
|
1784 |
|
1785 |
global $wpdb;
|
1786 |
-
$fwp_db_version = get_option('feedwordpress_version',
|
1787 |
$ret = false; // innocent until proven guilty
|
1788 |
if (is_null($fwp_db_version) or ($fwp_db_version < FEEDWORDPRESS_VERSION)) :
|
1789 |
|
@@ -1843,7 +1845,7 @@ class FeedWordPress {
|
|
1843 |
return $ret;
|
1844 |
} /* FeedWordPress::needs_upgrade () */
|
1845 |
|
1846 |
-
static function upgrade_database ($from =
|
1847 |
global $wpdb;
|
1848 |
|
1849 |
if (is_null($from) or $from <= 0.96) : $from = 0.96; endif;
|
@@ -1986,7 +1988,7 @@ class FeedWordPress {
|
|
1986 |
"cache" => true,
|
1987 |
));
|
1988 |
|
1989 |
-
$duration =
|
1990 |
if (!$params['cache']) :
|
1991 |
$duration = 0;
|
1992 |
elseif (defined('FEEDWORDPRESS_CACHE_AGE')) :
|
@@ -2022,7 +2024,7 @@ class FeedWordPress {
|
|
2022 |
|
2023 |
# Internal debugging functions
|
2024 |
|
2025 |
-
static function diagnostic ($level, $out, $persist =
|
2026 |
global $feedwordpress_admin_footer;
|
2027 |
|
2028 |
$output = get_option('feedwordpress_diagnostics_output', array());
|
@@ -2105,7 +2107,7 @@ class FeedWordPress {
|
|
2105 |
if ($this->ready_to_email_diagnostics($dlog)) :
|
2106 |
// No news is good news; only send if
|
2107 |
// there are some messages to send.
|
2108 |
-
$body =
|
2109 |
if (!isset($dlog['mesg'])) : $dlog['mesg'] = array(); endif;
|
2110 |
|
2111 |
foreach ($dlog['mesg'] as $sect => $mesgs) :
|
@@ -2184,7 +2186,7 @@ EOMAIL;
|
|
2184 |
endif;
|
2185 |
|
2186 |
$mesgId = 'feedwordpress+'.time().'@'.$home;
|
2187 |
-
$parentId = get_option('feedwordpress_diagnostics_email_root_message_id',
|
2188 |
|
2189 |
$head = array("Message-ID: <$mesgId>");
|
2190 |
if (!is_null($parentId)) :
|
@@ -2282,11 +2284,11 @@ EOMAIL;
|
|
2282 |
// compatibility with add-ons, older code, etc. Maybe someday they
|
2283 |
// will go away.
|
2284 |
// -------------------------------------------------------------------
|
2285 |
-
static function param ($key, $type = 'REQUEST', $default =
|
2286 |
return MyPHP::param($key, $default, $type);
|
2287 |
} /* FeedWordPress::param () */
|
2288 |
|
2289 |
-
static function post ($key, $default =
|
2290 |
return MyPHP::post($key, $default);
|
2291 |
} /* FeedWordPress::post () */
|
2292 |
|
@@ -2294,11 +2296,11 @@ EOMAIL;
|
|
2294 |
return MyPHP::val($v, $no_newlines);
|
2295 |
} /* FeedWordPress::val () */
|
2296 |
|
2297 |
-
static function critical_bug ($varname, $var, $line, $file =
|
2298 |
FeedWordPressDiagnostic::critical_bug($varname, $var, $line, $file);
|
2299 |
} /* FeedWordPress::critical_bug () */
|
2300 |
|
2301 |
-
static function noncritical_bug ($varname, $var, $line, $file =
|
2302 |
FeedWordPressDiagnostic::noncritical_bug($varname, $var, $line, $file);
|
2303 |
} /* FeedWordPress::noncritical_bug () */
|
2304 |
|
@@ -2311,28 +2313,29 @@ EOMAIL;
|
|
2311 |
$feedwordpress_admin_footer = array();
|
2312 |
|
2313 |
// take your best guess at the realname and e-mail, given a string
|
2314 |
-
define('FWP_REGEX_EMAIL_ADDY', '([^@"(<\s]+@[^"@(<\s]+\.[^"@(<\s]+)');
|
2315 |
-
define('FWP_REGEX_EMAIL_NAME', '("([^"]*)"|([^"<(]+\S))');
|
2316 |
-
define('FWP_REGEX_EMAIL_POSTFIX_NAME', '/^\s*'.FWP_REGEX_EMAIL_ADDY.
|
2317 |
-
define('FWP_REGEX_EMAIL_PREFIX_NAME', '/^\s*'.FWP_REGEX_EMAIL_NAME.'\s*<'.FWP_REGEX_EMAIL_ADDY.'>\s*$/');
|
2318 |
-
define('FWP_REGEX_EMAIL_JUST_ADDY', '/^\s*'.FWP_REGEX_EMAIL_ADDY.'\s*$/');
|
2319 |
-
define('FWP_REGEX_EMAIL_JUST_NAME', '/^\s*'.FWP_REGEX_EMAIL_NAME.'\s*$/');
|
2320 |
-
|
2321 |
-
function parse_email_with_realname
|
2322 |
-
if (preg_match(FWP_REGEX_EMAIL_POSTFIX_NAME, $email, $matches)) :
|
2323 |
-
($ret['name'] = $matches[3])
|
2324 |
$ret['email'] = $matches[1];
|
2325 |
-
elseif (preg_match(FWP_REGEX_EMAIL_PREFIX_NAME, $email, $matches)) :
|
2326 |
-
($ret['name'] = $matches[2])
|
2327 |
$ret['email'] = $matches[4];
|
2328 |
-
elseif (preg_match(FWP_REGEX_EMAIL_JUST_ADDY, $email, $matches)) :
|
2329 |
-
$ret['name']
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
|
|
2333 |
else :
|
2334 |
-
$ret['name']
|
|
|
2335 |
endif;
|
2336 |
return $ret;
|
2337 |
}
|
2338 |
-
|
3 |
Plugin Name: FeedWordPress
|
4 |
Plugin URI: http://feedwordpress.radgeek.com/
|
5 |
Description: simple and flexible Atom/RSS syndication for WordPress
|
6 |
+
Version: 2022.0204
|
7 |
Author: C. Johnson
|
8 |
Author URI: https://feedwordpress.radgeek.com/contact/
|
9 |
License: GPL
|
11 |
|
12 |
/**
|
13 |
* @package FeedWordPress
|
14 |
+
* @version 2022.0204
|
15 |
*/
|
16 |
|
17 |
# This plugin uses code derived from:
|
30 |
## CONSTANTS & DEFAULTS ############################################################
|
31 |
####################################################################################
|
32 |
|
33 |
+
define ('FEEDWORDPRESS_VERSION', '2022.0204');
|
34 |
define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://feedwordpress.radgeek.com/contact');
|
35 |
|
36 |
if (!defined('FEEDWORDPRESS_BLEG')) :
|
49 |
define ('FEEDWORDPRESS_DEFAULT_CHECKIN_INTERVAL', DEFAULT_UPDATE_PERIOD/10);
|
50 |
|
51 |
if (isset($_REQUEST['feedwordpress_debug'])) :
|
52 |
+
$feedwordpress_debug = sanitize_text_field($_REQUEST['feedwordpress_debug']);
|
53 |
else :
|
54 |
$feedwordpress_debug = get_option('feedwordpress_debug');
|
|
|
|
|
|
|
55 |
endif;
|
56 |
+
|
57 |
+
if (is_string($feedwordpress_debug)) :
|
58 |
+
$feedwordpress_debug = ($feedwordpress_debug == 'yes');
|
59 |
+
endif;
|
60 |
+
|
61 |
define ('FEEDWORDPRESS_DEBUG', $feedwordpress_debug);
|
62 |
$feedwordpress_compatibility = true;
|
63 |
define ('FEEDWORDPRESS_COMPATIBILITY', $feedwordpress_compatibility);
|
242 |
## FILTERS: syndication-aware handling of post data for templates and feeds ####
|
243 |
################################################################################
|
244 |
|
245 |
+
$feedwordpress_the_syndicated_content = null;
|
246 |
+
$feedwordpress_the_original_permalink = null;
|
247 |
|
248 |
function feedwordpress_preserve_syndicated_content ($text) {
|
249 |
global $feedwordpress_the_syndicated_content;
|
252 |
if (!$p->is_exposed_to_formatting_filters()) :
|
253 |
$feedwordpress_the_syndicated_content = $text;
|
254 |
else :
|
255 |
+
$feedwordpress_the_syndicated_content = null;
|
256 |
endif;
|
257 |
return $text;
|
258 |
}
|
284 |
endif;
|
285 |
$updated = get_feed_meta('feed/updated');
|
286 |
if (strlen($updated) > 0) : ?>
|
287 |
+
<updated><?php print esc_xml($updated); ?></updated>
|
288 |
<?php
|
289 |
endif;
|
290 |
?>
|
384 |
// wfw:commentRss or atom:link/@rel="replies" we can make use of
|
385 |
// that value here.
|
386 |
$source = get_syndication_feed_object();
|
387 |
+
$replacement = null;
|
388 |
|
389 |
if (is_object($source) && $source->setting('munge comments feed links', 'munge_comments_feed_links', 'yes') != 'no') :
|
390 |
$commentFeeds = get_post_custom_values('wfw:commentRSS');
|
480 |
array('script', 'src')
|
481 |
);
|
482 |
|
483 |
+
var $feeds = null;
|
484 |
+
var $feedurls = null;
|
485 |
+
var $httpauth = null;
|
486 |
|
487 |
/**
|
488 |
* FeedWordPress::__construct (): Construct FeedWordPress singleton object
|
651 |
'Syndicated Sites', 'Syndication',
|
652 |
$menu_cap,
|
653 |
$syndicationMenu,
|
654 |
+
null,
|
655 |
$this->plugin_dir_url( 'assets/images/feedwordpress-tiny.png' )
|
656 |
);
|
657 |
|
705 |
// This is a horrible fucking kludge that I have to do because the
|
706 |
// admin notice code is triggered before the code that updates the
|
707 |
// setting.
|
708 |
+
if (isset($_REQUEST['feedwordpress_debug'])) :
|
709 |
+
$feedwordpress_debug = sanitize_text_field($_REQUEST['feedwordpress_debug']);
|
710 |
else :
|
711 |
$feedwordpress_debug = get_option('feedwordpress_debug');
|
712 |
endif;
|
731 |
* it; or a de-activated subscription.
|
732 |
*
|
733 |
* @param mixed $which Numeric ID for a WordPress link object or string URL for a feed
|
734 |
+
* @return mixed SyndicatedLink object if subscription is found; null if not
|
735 |
*/
|
736 |
public function subscription ($which) {
|
737 |
+
$sub = null;
|
738 |
|
739 |
if (is_string($which) and isset($this->feedurls[$which])) :
|
740 |
$which = $this->feedurls[$which];
|
766 |
# Arguments:
|
767 |
# ----------
|
768 |
# * $uri (string): either the URI of the feed to poll, the URI of the
|
769 |
+
# (human-readable) website whose feed you want to poll, or null.
|
770 |
#
|
771 |
+
# If $uri is null, then FeedWordPress will poll any feeds that are
|
772 |
# ready for polling. It will not poll feeds that are marked as
|
773 |
# "Invisible" Links (signifying that the subscription has been
|
774 |
# de-activated), or feeds that are not yet stale according to their
|
782 |
# of old posts that were updated during the update. If both numbers
|
783 |
# are zero, there was no change since the last poll on that URI.
|
784 |
#
|
785 |
+
# * Returns null if URI it was passed was not a URI that this
|
786 |
# installation of FeedWordPress syndicates.
|
787 |
#
|
788 |
# Effects:
|
814 |
global $wpdb;
|
815 |
|
816 |
if (FeedWordPress::needs_upgrade()) : // Will make duplicate posts if we don't hold off
|
817 |
+
return null;
|
818 |
endif;
|
819 |
|
820 |
if (!is_null($uri) and $uri != '*') :
|
855 |
|
856 |
|
857 |
// Loop through and check for new posts
|
858 |
+
$delta = null; $remaining = $max_polls;
|
859 |
foreach ($feed_set as $feed_id) :
|
860 |
|
861 |
$feed = $this->subscription($feed_id);
|
905 |
return $delta;
|
906 |
} /* FeedWordPress::update () */
|
907 |
|
908 |
+
public function crash_ts ($default = null) {
|
909 |
$crash_dt = (int) get_option('feedwordpress_update_time_limit', 0);
|
910 |
if ($crash_dt > 0) :
|
911 |
$crash_ts = time() + $crash_dt;
|
928 |
return (MyPHP::request('feedwordpress_key')==$this->secret_key());
|
929 |
} /* FeedWordPress::has_secret () */
|
930 |
|
931 |
+
var $update_hooked = null;
|
932 |
public function automatic_update_hook ($params = array()) {
|
933 |
$params = wp_parse_args($params, array( // Defaults
|
934 |
'setting only' => false,
|
935 |
));
|
936 |
+
$hook = get_option('feedwordpress_automatic_updates', null);
|
937 |
$method = 'FeedWordPress option';
|
938 |
|
939 |
// Allow for forced behavior in testing.
|
1137 |
if (MyPHP::request('zapped')) :
|
1138 |
$n = intval(MyPHP::request('zapped'));
|
1139 |
?>
|
1140 |
+
<div id="message" class="updated"><p><?php print esc_html( $n ); ?> syndicated item<?php print esc_html( $n != 1 ? 's' : '' ); ?> zapped. <strong>These items will not be re-syndicated.</strong> If this was a mistake, you must <strong>immediately</strong> Un-Zap them in the Zapped items section to avoid losing the data.</p></div>
|
1141 |
<?php
|
1142 |
endif;
|
1143 |
|
1144 |
if (MyPHP::request('unzapped')) :
|
1145 |
$n = intval(MyPHP::request('unzapped'));
|
1146 |
?>
|
1147 |
+
<div id="message" class="updated"><p><?php print esc-html( $n ); ?> syndicated item<?php print esc_html( $n != 1 ? 's' : '' ) ?> un-zapped and restored to normal.</p></div>
|
1148 |
<?php
|
1149 |
endif;
|
1150 |
} /* FeedWordPress::all_admin_notices () */
|
1425 |
$caption = apply_filters('feedwordpress_ui_erase_link_caption', __('Erase the record of this post (will be re-syndicated if it still appears on the feed).'));
|
1426 |
$linktext = apply_filters('feedwordpress_ui_erase_link_text', __('Erase/Resyndicate'));
|
1427 |
|
1428 |
+
$retireClass = null;
|
1429 |
if ($post->post_status == 'fwpzapped') :
|
1430 |
if (count(get_post_meta($post->ID, '_feedwordpress_zapped_blank_me')) > 0) :
|
1431 |
$retireCap = 'Un-Zap this syndicated post (so it will appear on the site again)';
|
1435 |
// No Un-Zap link for posts that have
|
1436 |
// been blanked. You'll just have to
|
1437 |
// Erase and hope you can resyndicate...
|
1438 |
+
$retireLink = null;
|
1439 |
endif;
|
1440 |
else :
|
1441 |
$retireCap = apply_filters('feedwordpress_ui_zap_link_caption', __('Zap this syndicated post (so it will not be re-syndicated if it still appears on the feed).'));
|
1713 |
|
1714 |
} /* FeedWordPress::null_email_set () */
|
1715 |
|
1716 |
+
public static function is_null_email( $email ) {
|
1717 |
+
$ret = in_array( strtolower( trim( $email ) ), FeedWordPress::null_email_set() );
|
1718 |
+
$ret = apply_filters( 'syndicated_item_author_is_null_email', $ret, $email );
|
1719 |
return $ret;
|
1720 |
} /* FeedWordPress::is_null_email () */
|
1721 |
|
1785 |
static function needs_upgrade () {
|
1786 |
|
1787 |
global $wpdb;
|
1788 |
+
$fwp_db_version = get_option('feedwordpress_version', null);
|
1789 |
$ret = false; // innocent until proven guilty
|
1790 |
if (is_null($fwp_db_version) or ($fwp_db_version < FEEDWORDPRESS_VERSION)) :
|
1791 |
|
1845 |
return $ret;
|
1846 |
} /* FeedWordPress::needs_upgrade () */
|
1847 |
|
1848 |
+
static function upgrade_database ($from = null) {
|
1849 |
global $wpdb;
|
1850 |
|
1851 |
if (is_null($from) or $from <= 0.96) : $from = 0.96; endif;
|
1988 |
"cache" => true,
|
1989 |
));
|
1990 |
|
1991 |
+
$duration = null;
|
1992 |
if (!$params['cache']) :
|
1993 |
$duration = 0;
|
1994 |
elseif (defined('FEEDWORDPRESS_CACHE_AGE')) :
|
2024 |
|
2025 |
# Internal debugging functions
|
2026 |
|
2027 |
+
static function diagnostic ($level, $out, $persist = null, $since = null, $mostRecent = null) {
|
2028 |
global $feedwordpress_admin_footer;
|
2029 |
|
2030 |
$output = get_option('feedwordpress_diagnostics_output', array());
|
2107 |
if ($this->ready_to_email_diagnostics($dlog)) :
|
2108 |
// No news is good news; only send if
|
2109 |
// there are some messages to send.
|
2110 |
+
$body = null;
|
2111 |
if (!isset($dlog['mesg'])) : $dlog['mesg'] = array(); endif;
|
2112 |
|
2113 |
foreach ($dlog['mesg'] as $sect => $mesgs) :
|
2186 |
endif;
|
2187 |
|
2188 |
$mesgId = 'feedwordpress+'.time().'@'.$home;
|
2189 |
+
$parentId = get_option('feedwordpress_diagnostics_email_root_message_id', null);
|
2190 |
|
2191 |
$head = array("Message-ID: <$mesgId>");
|
2192 |
if (!is_null($parentId)) :
|
2284 |
// compatibility with add-ons, older code, etc. Maybe someday they
|
2285 |
// will go away.
|
2286 |
// -------------------------------------------------------------------
|
2287 |
+
static function param ($key, $type = 'REQUEST', $default = null) {
|
2288 |
return MyPHP::param($key, $default, $type);
|
2289 |
} /* FeedWordPress::param () */
|
2290 |
|
2291 |
+
static function post ($key, $default = null) {
|
2292 |
return MyPHP::post($key, $default);
|
2293 |
} /* FeedWordPress::post () */
|
2294 |
|
2296 |
return MyPHP::val($v, $no_newlines);
|
2297 |
} /* FeedWordPress::val () */
|
2298 |
|
2299 |
+
static function critical_bug ($varname, $var, $line, $file = null) {
|
2300 |
FeedWordPressDiagnostic::critical_bug($varname, $var, $line, $file);
|
2301 |
} /* FeedWordPress::critical_bug () */
|
2302 |
|
2303 |
+
static function noncritical_bug ($varname, $var, $line, $file = null) {
|
2304 |
FeedWordPressDiagnostic::noncritical_bug($varname, $var, $line, $file);
|
2305 |
} /* FeedWordPress::noncritical_bug () */
|
2306 |
|
2313 |
$feedwordpress_admin_footer = array();
|
2314 |
|
2315 |
// take your best guess at the realname and e-mail, given a string
|
2316 |
+
define( 'FWP_REGEX_EMAIL_ADDY', '([^@"(<\s]+@[^"@(<\s]+\.[^"@(<\s]+)' );
|
2317 |
+
define( 'FWP_REGEX_EMAIL_NAME', '("([^"]*)"|([^"<(]+\S))' );
|
2318 |
+
define( 'FWP_REGEX_EMAIL_POSTFIX_NAME', '/^\s*' . FWP_REGEX_EMAIL_ADDY . '\s+\(' . FWP_REGEX_EMAIL_NAME . '\)\s*$/' );
|
2319 |
+
define( 'FWP_REGEX_EMAIL_PREFIX_NAME', '/^\s*' . FWP_REGEX_EMAIL_NAME . '\s*<' . FWP_REGEX_EMAIL_ADDY . '>\s*$/' );
|
2320 |
+
define( 'FWP_REGEX_EMAIL_JUST_ADDY', '/^\s*' . FWP_REGEX_EMAIL_ADDY . '\s*$/' );
|
2321 |
+
define( 'FWP_REGEX_EMAIL_JUST_NAME', '/^\s*' . FWP_REGEX_EMAIL_NAME . '\s*$/' );
|
2322 |
+
|
2323 |
+
function parse_email_with_realname( $email ) {
|
2324 |
+
if ( preg_match( FWP_REGEX_EMAIL_POSTFIX_NAME, $email, $matches ) ) :
|
2325 |
+
( $ret['name'] = $matches[3] ) || ( $ret['name'] = $matches[2] );
|
2326 |
$ret['email'] = $matches[1];
|
2327 |
+
elseif ( preg_match( FWP_REGEX_EMAIL_PREFIX_NAME, $email, $matches ) ) :
|
2328 |
+
( $ret['name'] = $matches[2] ) || ( $ret['name'] = $matches[3] );
|
2329 |
$ret['email'] = $matches[4];
|
2330 |
+
elseif ( preg_match( FWP_REGEX_EMAIL_JUST_ADDY, $email, $matches ) ) :
|
2331 |
+
$ret['name'] = null;
|
2332 |
+
$ret['email'] = $matches[1];
|
2333 |
+
elseif ( preg_match( FWP_REGEX_EMAIL_JUST_NAME, $email, $matches ) ) :
|
2334 |
+
$ret['email'] = null;
|
2335 |
+
( $ret['name'] = $matches[2] ) || ( $ret['name'] = $matches[3] );
|
2336 |
else :
|
2337 |
+
$ret['name'] = null;
|
2338 |
+
$ret['email'] = null;
|
2339 |
endif;
|
2340 |
return $ret;
|
2341 |
}
|
|
feedwordpress.wp-admin.post-edit.functions.php
CHANGED
@@ -84,9 +84,9 @@ function feedwordpress_save_post_edit_controls ( $post_id ) {
|
|
84 |
|
85 |
// OK, we're golden. Now let's save some data.
|
86 |
if (isset($_POST['freeze_updates'])) :
|
87 |
-
|
88 |
-
update_post_meta($post_id, '_syndication_freeze_updates', $
|
89 |
-
$ret = $
|
90 |
|
91 |
// If you make manual edits through the WordPress editing
|
92 |
// UI then they should be run through normal WP formatting
|
84 |
|
85 |
// OK, we're golden. Now let's save some data.
|
86 |
if (isset($_POST['freeze_updates'])) :
|
87 |
+
$sFreezeUpdates = sanitize_text_field($_POST['freeze_updates']);
|
88 |
+
update_post_meta($post_id, '_syndication_freeze_updates', sanitize_meta('_syndication_freeze_updates', $sFreezeUpdates, 'post'));
|
89 |
+
$ret = $sFreezeUpdates;
|
90 |
|
91 |
// If you make manual edits through the WordPress editing
|
92 |
// UI then they should be run through normal WP formatting
|
feedwordpressadminpage.class.php
CHANGED
@@ -514,15 +514,15 @@ class FeedWordPressAdminPage {
|
|
514 |
FeedWordPressSettingsUI::ajax_nonce_fields();
|
515 |
|
516 |
?>
|
517 |
-
<div class="wrap feedwordpress-admin" id="feedwordpress-admin-<?php print $this->pageslug(); ?>">
|
518 |
<?php
|
519 |
if (!is_null($header)) :
|
520 |
$this->display_sheet_header($header);
|
521 |
endif;
|
522 |
|
523 |
-
if (!is_null($this->dispatch)) :
|
524 |
?>
|
525 |
-
<form action="<?php print $this->form_action(); ?>" method="post">
|
526 |
<div><?php
|
527 |
FeedWordPressCompatibility::stamp_nonce($this->dispatch);
|
528 |
$this->stamp_link_id();
|
@@ -671,10 +671,10 @@ class FeedWordPressAdminPage {
|
|
671 |
<tr><td class="equals first inactive">
|
672 |
<ul class="options">
|
673 |
<li><label><input type="radio"
|
674 |
-
name="<?php print $defaultInputName; ?>"
|
675 |
-
value="<?php print $defaultInputValue; ?>"
|
676 |
-
<?php if (!is_null($defaultInputId)) : ?>id="<?php print $defaultInputId; ?>" <?php endif; ?>
|
677 |
-
<?php
|
678 |
Use the site-wide setting</label>
|
679 |
<span class="current-setting">Currently:
|
680 |
<strong><?php if (is_callable($labels)) :
|
@@ -683,17 +683,17 @@ class FeedWordPressAdminPage {
|
|
683 |
print $globalSetting;
|
684 |
else :
|
685 |
print $labels[$globalSetting];
|
686 |
-
endif; ?></strong> (<a href="<?php print $href; ?>">change</a>)</span></li>
|
687 |
</ul></td>
|
688 |
|
689 |
<td class="equals second inactive">
|
690 |
<?php if ($defaultInputName != $inputName) : ?>
|
691 |
<ul class="options">
|
692 |
<li><label><input type="radio"
|
693 |
-
name="<?php print $defaultInputName; ?>"
|
694 |
value="no"
|
695 |
-
<?php if (!is_null($defaultInputIdNo)) : ?>id="<?php print $defaultInputIdNo; ?>" <?php endif; ?>
|
696 |
-
<?php
|
697 |
<?php _e('Do something different with this feed.'); ?></label>
|
698 |
<?php endif;
|
699 |
endif;
|
@@ -706,10 +706,10 @@ class FeedWordPressAdminPage {
|
|
706 |
?>
|
707 |
<ul class="options">
|
708 |
<?php foreach ($options as $value => $label) : ?>
|
709 |
-
<li><label><input type="radio" name="<?php print $inputName; ?>"
|
710 |
-
value="<?php print $value; ?>"
|
711 |
-
<?php print $checked
|
712 |
-
<?php print $label; ?></label></li>
|
713 |
<?php endforeach; ?>
|
714 |
</ul> <!-- class="options" -->
|
715 |
<?php
|
@@ -737,7 +737,7 @@ class FeedWordPressAdminPage {
|
|
737 |
if (is_null($caption)) : $caption = __('Save Changes'); endif;
|
738 |
?>
|
739 |
<p class="submit">
|
740 |
-
<input class="button-primary" type="submit" name="save" value="<?php print $caption; ?>" />
|
741 |
</p>
|
742 |
<?php
|
743 |
}
|
514 |
FeedWordPressSettingsUI::ajax_nonce_fields();
|
515 |
|
516 |
?>
|
517 |
+
<div class="wrap feedwordpress-admin" id="feedwordpress-admin-<?php print esc_attr( $this->pageslug() ); ?>">
|
518 |
<?php
|
519 |
if (!is_null($header)) :
|
520 |
$this->display_sheet_header($header);
|
521 |
endif;
|
522 |
|
523 |
+
if ( !is_null( $this->dispatch ) ) :
|
524 |
?>
|
525 |
+
<form action="<?php print esc_url( $this->form_action() ); ?>" method="post">
|
526 |
<div><?php
|
527 |
FeedWordPressCompatibility::stamp_nonce($this->dispatch);
|
528 |
$this->stamp_link_id();
|
671 |
<tr><td class="equals first inactive">
|
672 |
<ul class="options">
|
673 |
<li><label><input type="radio"
|
674 |
+
name="<?php print esc_attr( $defaultInputName ); ?>"
|
675 |
+
value="<?php print esc_attr( $defaultInputValue ); ?>"
|
676 |
+
<?php if (!is_null($defaultInputId)) : ?>id="<?php print esc_attr( $defaultInputId ); ?>" <?php endif; ?>
|
677 |
+
<?php fwp_checked_flag($defaulted, 'yes'); ?> />
|
678 |
Use the site-wide setting</label>
|
679 |
<span class="current-setting">Currently:
|
680 |
<strong><?php if (is_callable($labels)) :
|
683 |
print $globalSetting;
|
684 |
else :
|
685 |
print $labels[$globalSetting];
|
686 |
+
endif; ?></strong> (<a href="<?php print esc_url( $href ); ?>">change</a>)</span></li>
|
687 |
</ul></td>
|
688 |
|
689 |
<td class="equals second inactive">
|
690 |
<?php if ($defaultInputName != $inputName) : ?>
|
691 |
<ul class="options">
|
692 |
<li><label><input type="radio"
|
693 |
+
name="<?php print esc_attr( $defaultInputName ); ?>"
|
694 |
value="no"
|
695 |
+
<?php if (!is_null($defaultInputIdNo)) : ?>id="<?php print esc_attr( $defaultInputIdNo ); ?>" <?php endif; ?>
|
696 |
+
<?php fwp_checked_flag($defaulted, 'no'); ?> />
|
697 |
<?php _e('Do something different with this feed.'); ?></label>
|
698 |
<?php endif;
|
699 |
endif;
|
706 |
?>
|
707 |
<ul class="options">
|
708 |
<?php foreach ($options as $value => $label) : ?>
|
709 |
+
<li><label><input type="radio" name="<?php print esc_attr( $inputName ); ?>"
|
710 |
+
value="<?php print esc_attr( $value ); ?>"
|
711 |
+
<?php print fwp_checked_flag($checked, $value); ?> />
|
712 |
+
<?php print esc_html( $label ); ?></label></li>
|
713 |
<?php endforeach; ?>
|
714 |
</ul> <!-- class="options" -->
|
715 |
<?php
|
737 |
if (is_null($caption)) : $caption = __('Save Changes'); endif;
|
738 |
?>
|
739 |
<p class="submit">
|
740 |
+
<input class="button-primary" type="submit" name="save" value="<?php print esc_attr( $caption ); ?>" />
|
741 |
</p>
|
742 |
<?php
|
743 |
}
|
feedwordpresssettingsui.class.php
CHANGED
@@ -77,7 +77,7 @@ class FeedWordPressSettingsUI {
|
|
77 |
$('.columns-prefs input[type="radio"]').unbind('click');
|
78 |
$('.meta-box-sortables').sortable('destroy');
|
79 |
|
80 |
-
postboxes.add_postbox_toggles('<?php print $context; ?>');
|
81 |
} );
|
82 |
</script>
|
83 |
<?php
|
@@ -137,7 +137,7 @@ class FeedWordPressSettingsUI {
|
|
137 |
?>
|
138 |
<script type="text/javascript">
|
139 |
jQuery(document).ready( function () {
|
140 |
-
var inputBox = jQuery("<?php print $id; ?>");
|
141 |
var boxEl = inputBox.get(0);
|
142 |
if (boxEl.value==boxEl.defaultValue) { inputBox.addClass('form-input-tip'); }
|
143 |
inputBox.focus(function() {
|
77 |
$('.columns-prefs input[type="radio"]').unbind('click');
|
78 |
$('.meta-box-sortables').sortable('destroy');
|
79 |
|
80 |
+
postboxes.add_postbox_toggles('<?php print esc_attr( $context ); ?>');
|
81 |
} );
|
82 |
</script>
|
83 |
<?php
|
137 |
?>
|
138 |
<script type="text/javascript">
|
139 |
jQuery(document).ready( function () {
|
140 |
+
var inputBox = jQuery("<?php print esc_attr( $id ); ?>");
|
141 |
var boxEl = inputBox.get(0);
|
142 |
if (boxEl.value==boxEl.defaultValue) { inputBox.addClass('form-input-tip'); }
|
143 |
inputBox.focus(function() {
|
posts-page.php
CHANGED
@@ -457,7 +457,7 @@ class FeedWordPressPostsPage extends FeedWordPressAdminPage {
|
|
457 |
?>
|
458 |
<tr style="vertical-align:top">
|
459 |
<th width="30%" scope="row"><input type="hidden" name="notes[<?php echo esc_attr($i); ?>][key0]" value="<?php echo esc_html($key); ?>" />
|
460 |
-
<input id="notes-<?php echo $i; ?>-key" name="notes[<?php echo esc_attr($i); ?>][key1]" value="<?php echo esc_html($key); ?>" /></th>
|
461 |
<td width="60%"><textarea rows="2" cols="40" id="notes-<?php echo esc_attr($i); ?>-value" name="notes[<?php echo esc_attr($i); ?>][value]"><?php echo esc_html($value); ?></textarea>
|
462 |
<?php print sprintf($testerButton, esc_attr($i) ); ?></td>
|
463 |
<td width="10%"><select name="notes[<?php echo esc_attr($i); ?>][action]">
|
@@ -633,12 +633,12 @@ class FeedWordPressPostsPage extends FeedWordPressAdminPage {
|
|
633 |
?>
|
634 |
|
635 |
<li id="boilerplate-<?php print esc_attr($index); ?>-li" class="<?php print esc_attr(implode(' ', $line['class'])); ?>">» <strong>Add</strong> <select id="boilerplate-<?php print esc_attr($index); ?>-placement" name="boilerplate[<?php print esc_attr($index); ?>][placement]" style="width: 8.0em">
|
636 |
-
<option value="before"<?php
|
637 |
-
<option value="after"<?php
|
638 |
</select> the <select style="width: 8.0em" id="boilerplate-<?php print esc_attr($index); ?>-element" name="boilerplate[<?php print esc_attr($index); ?>][element]">
|
639 |
-
<option value="title"<?php
|
640 |
-
<option value="post"<?php
|
641 |
-
<option value="excerpt"<?php
|
642 |
</select> of
|
643 |
<?php print esc_html($syndicatedPosts); ?>: <textarea style="vertical-align: top; width: 40%;" rows="2" cols="30" class="boilerplate-template" id="boilerplate-<?php print esc_attr($index); ?>-template" name="boilerplate[<?php print esc_attr($index); ?>][template]"><?php print esc_html($line['template']); ?></textarea></li>
|
644 |
<?php
|
457 |
?>
|
458 |
<tr style="vertical-align:top">
|
459 |
<th width="30%" scope="row"><input type="hidden" name="notes[<?php echo esc_attr($i); ?>][key0]" value="<?php echo esc_html($key); ?>" />
|
460 |
+
<input id="notes-<?php echo esc_attr( $i ); ?>-key" name="notes[<?php echo esc_attr( $i ); ?>][key1]" value="<?php echo esc_html($key); ?>" /></th>
|
461 |
<td width="60%"><textarea rows="2" cols="40" id="notes-<?php echo esc_attr($i); ?>-value" name="notes[<?php echo esc_attr($i); ?>][value]"><?php echo esc_html($value); ?></textarea>
|
462 |
<?php print sprintf($testerButton, esc_attr($i) ); ?></td>
|
463 |
<td width="10%"><select name="notes[<?php echo esc_attr($i); ?>][action]">
|
633 |
?>
|
634 |
|
635 |
<li id="boilerplate-<?php print esc_attr($index); ?>-li" class="<?php print esc_attr(implode(' ', $line['class'])); ?>">» <strong>Add</strong> <select id="boilerplate-<?php print esc_attr($index); ?>-placement" name="boilerplate[<?php print esc_attr($index); ?>][placement]" style="width: 8.0em">
|
636 |
+
<option value="before"<?php fwp_selected_flag( $selected, 'before' ); ?>>before</option>
|
637 |
+
<option value="after"<?php fwp_selected_flag( $selected, 'after' ); ?>>after</option>
|
638 |
</select> the <select style="width: 8.0em" id="boilerplate-<?php print esc_attr($index); ?>-element" name="boilerplate[<?php print esc_attr($index); ?>][element]">
|
639 |
+
<option value="title"<?php fwp_selected_flag($selected, 'title' ); ?>>title</option>
|
640 |
+
<option value="post"<?php fwp_selected_flag( $selected, 'post' ); ?>>content</option>
|
641 |
+
<option value="excerpt"<?php fwp_selected_flag( $selected, 'excerpt' ); ?>>excerpt</option>
|
642 |
</select> of
|
643 |
<?php print esc_html($syndicatedPosts); ?>: <textarea style="vertical-align: top; width: 40%;" rows="2" cols="30" class="boilerplate-template" id="boilerplate-<?php print esc_attr($index); ?>-template" name="boilerplate[<?php print esc_attr($index); ?>][template]"><?php print esc_html($line['template']); ?></textarea></li>
|
644 |
<?php
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://feedwordpress.radgeek.com/donate/
|
|
4 |
Tags: syndication, aggregation, feed, atom, rss
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.9
|
7 |
-
Stable tag: 2022.
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -65,7 +65,7 @@ FeedWordPress has many options which can be accessed through the WordPress Dashb
|
|
65 |
|
66 |
== Changelog ==
|
67 |
|
68 |
-
= 2022.
|
69 |
|
70 |
* ADDITIONAL CODE CLEANUP: This version does some additional code clean-up to remove some obsolete methods of generating output, and to do a better job of sanitizing input and escaping output in the FeedWordPress administrative dashboard.
|
71 |
|
4 |
Tags: syndication, aggregation, feed, atom, rss
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.9
|
7 |
+
Stable tag: 2022.0204
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
65 |
|
66 |
== Changelog ==
|
67 |
|
68 |
+
= 2022.0204 =
|
69 |
|
70 |
* ADDITIONAL CODE CLEANUP: This version does some additional code clean-up to remove some obsolete methods of generating output, and to do a better job of sanitizing input and escaping output in the FeedWordPress administrative dashboard.
|
71 |
|
updatedpostscontrol.class.php
CHANGED
@@ -34,7 +34,7 @@ class UpdatedPostsControl {
|
|
34 |
?>
|
35 |
<tr>
|
36 |
<th scope="row"><?php _e('Updated posts:') ?></th>
|
37 |
-
<td><p>When <?php print $aFeed; ?> includes updated content for
|
38 |
a post that was already syndicated, should the syndicated copy
|
39 |
of the post be updated to match the revised version?</p>
|
40 |
|
34 |
?>
|
35 |
<tr>
|
36 |
<th scope="row"><?php _e('Updated posts:') ?></th>
|
37 |
+
<td><p>When <?php print esc_html( $aFeed ); ?> includes updated content for
|
38 |
a post that was already syndicated, should the syndicated copy
|
39 |
of the post be updated to match the revised version?</p>
|
40 |
|