RSS Post Importer - Version 2.2.3

Version Description

Download this release

Release Info

Developer feedsapi
Plugin Icon 128x128 RSS Post Importer
Version 2.2.3
Comparing to
See all releases

Code changes from version 2.2.2 to 2.2.3

app/class-rss-post-importer.php CHANGED
@@ -40,7 +40,7 @@ class rssPostImporter {
40
  $this->upgrade();
41
 
42
  $settings = array(
43
- 'feeds_api_key' => $_POST['feeds_api_key']
44
  );
45
  //$obj = new rssPIAdminProcessor();
46
  global $rss_post_importer;
@@ -233,7 +233,7 @@ class rssPostImporter {
233
  return false;
234
  }
235
 
236
- $url = "http://176.58.108.28/fetch.php?key=$key&url=http://dummyurl.com";
237
  $content = file_get_contents($url);
238
 
239
  if (trim($content) == "A valid key must be supplied") {
40
  $this->upgrade();
41
 
42
  $settings = array(
43
+ 'feeds_api_key' => sanitize_key($_POST['feeds_api_key'])
44
  );
45
  //$obj = new rssPIAdminProcessor();
46
  global $rss_post_importer;
233
  return false;
234
  }
235
 
236
+ $url = esc_url("http://www.rsspostimporter.com/fetch.php?key=$key&url=http://dummyurl.com");
237
  $content = file_get_contents($url);
238
 
239
  if (trim($content) == "A valid key must be supplied") {
app/classes/admin/class-rss-pi-admin-processor.php CHANGED
@@ -30,7 +30,6 @@ class rssPIAdminProcessor {
30
 
31
  // Get ids of feed-rows
32
  $ids = explode(",", $_POST['ids']);
33
-
34
  // formulate the settings array
35
  $settings = $this->process_settings();
36
 
@@ -42,8 +41,10 @@ class rssPIAdminProcessor {
42
  $this->update_cron($settings['frequency']);
43
 
44
  // formulate the feeds array
 
 
45
  $feeds = $this->process_feeds($ids);
46
-
47
 
48
 
49
  // import CSV file
@@ -192,9 +193,12 @@ class rssPIAdminProcessor {
192
  // Get selected settings for all imported posts
193
 
194
  // Code added for custom frequency
195
- if($_POST['frequency']=="custom_frequency")
 
 
 
196
  {
197
- $rss_custom_frequency = $_POST['rss_custom_frequency'];
198
  $frequency = "minutes_".$rss_custom_frequency;
199
  $custom_frequency = 'true';
200
  // Adding option for custom cron
@@ -208,7 +212,7 @@ class rssPIAdminProcessor {
208
  add_option( 'rss_custom_cron_frequency',$rss_custom_cron_frequency);
209
  }else
210
  {
211
- $frequency = $_POST['frequency'];
212
  $custom_frequency = 'false';
213
 
214
  // Delete custom cron if not exixts
@@ -220,17 +224,17 @@ class rssPIAdminProcessor {
220
  'frequency' => $frequency,
221
  'feeds_api_key' => htmlentities($_POST['feeds_api_key']),
222
  'post_template' => stripslashes_deep($_POST['post_template']),
223
- 'post_status' => $_POST['post_status'],
224
- 'author_id' => $_POST['author_id'],
225
- 'allow_comments' => $_POST['allow_comments'],
226
- 'block_indexing' => $_POST['block_indexing'],
227
- 'nofollow_outbound' => $_POST['nofollow_outbound'],
228
- 'enable_logging' => $_POST['enable_logging'],
229
- 'tw_show' => $_POST['tw_show'],
230
- 'gg_show' => $_POST['gg_show'],
231
- 'og_show' => $_POST['og_show'],
232
- 'import_images_locally' => $_POST['import_images_locally'],
233
- 'disable_thumbnail' => $_POST['disable_thumbnail'],
234
  // these values are setup after key_validity check via filter()
235
  'keywords' => array(),
236
  'cache_deleted' => 'true',
@@ -306,21 +310,21 @@ class rssPIAdminProcessor {
306
  'id' => $id,
307
  'url' => $_POST[$id . '-url'],
308
  'name' => $_POST[$id . '-name'],
309
- 'max_posts' => $_POST[$id . '-max_posts'],
310
  // different author ids depending on valid API keys
311
- 'author_id' => ($this->is_key_valid && isset($_POST[$id . '-author_id'])) ? $_POST[$id . '-author_id'] : $_POST['author_id'],
312
  'category_id' => (isset($_POST[$id . '-category_id'])) ? $_POST[$id . '-category_id'] : '',
313
  'tags_id' => (isset($_POST[$id . '-tags_id'])) ? $_POST[$id . '-tags_id'] : '',
314
  'keywords' => array_map('trim',$keywords),
315
- 'strip_html' => (isset($_POST[$id . '-strip_html'])) ? $_POST[$id . '-strip_html'] : '',
316
- 'nofollow_outbound' => (isset($_POST[$id . '-nofollow_outbound'])) ? $_POST[$id . '-nofollow_outbound'] : '',
317
- 'automatic_import_categories' => (isset($_POST[$id . '-automatic_import_categories'])) ? $_POST[$id . '-automatic_import_categories'] : '', 'automatic_import_author' => (isset($_POST[$id . '-automatic_import_author'])) ? $_POST[$id . '-automatic_import_author'] : '',
318
- 'canonical_urls' => (isset($_POST[$id . '-canonical_urls'])) ? $_POST[$id . '-canonical_urls'] : '',
 
319
  'feed_status' => $feed_status
320
  ));
321
  }
322
  }
323
-
324
  return $feeds;
325
  }
326
 
30
 
31
  // Get ids of feed-rows
32
  $ids = explode(",", $_POST['ids']);
 
33
  // formulate the settings array
34
  $settings = $this->process_settings();
35
 
41
  $this->update_cron($settings['frequency']);
42
 
43
  // formulate the feeds array
44
+ $feeds = array();
45
+ if(is_array($ids)){
46
  $feeds = $this->process_feeds($ids);
47
+ }
48
 
49
 
50
  // import CSV file
193
  // Get selected settings for all imported posts
194
 
195
  // Code added for custom frequency
196
+
197
+ $frequency_check = sanitize_text_field($_POST['frequency']);
198
+
199
+ if($frequency_check=="custom_frequency")
200
  {
201
+ $rss_custom_frequency = intval($_POST['rss_custom_frequency']);
202
  $frequency = "minutes_".$rss_custom_frequency;
203
  $custom_frequency = 'true';
204
  // Adding option for custom cron
212
  add_option( 'rss_custom_cron_frequency',$rss_custom_cron_frequency);
213
  }else
214
  {
215
+ $frequency = sanitize_text_field($_POST['frequency']);
216
  $custom_frequency = 'false';
217
 
218
  // Delete custom cron if not exixts
224
  'frequency' => $frequency,
225
  'feeds_api_key' => htmlentities($_POST['feeds_api_key']),
226
  'post_template' => stripslashes_deep($_POST['post_template']),
227
+ 'post_status' => sanitize_text_field($_POST['post_status']),
228
+ 'author_id' => intval($_POST['author_id']),
229
+ 'allow_comments' => sanitize_text_field($_POST['allow_comments']),
230
+ 'block_indexing' => sanitize_text_field($_POST['block_indexing']),
231
+ 'nofollow_outbound' =>sanitize_text_field($_POST['nofollow_outbound']),
232
+ 'enable_logging' => sanitize_text_field($_POST['enable_logging']),
233
+ 'tw_show' => sanitize_text_field($_POST['tw_show']),
234
+ 'gg_show' => sanitize_text_field($_POST['gg_show']),
235
+ 'og_show' => sanitize_text_field($_POST['og_show']),
236
+ 'import_images_locally' => sanitize_text_field($_POST['import_images_locally']),
237
+ 'disable_thumbnail' => sanitize_text_field($_POST['disable_thumbnail']),
238
  // these values are setup after key_validity check via filter()
239
  'keywords' => array(),
240
  'cache_deleted' => 'true',
310
  'id' => $id,
311
  'url' => $_POST[$id . '-url'],
312
  'name' => $_POST[$id . '-name'],
313
+ 'max_posts' => intval($_POST[$id . '-max_posts']),
314
  // different author ids depending on valid API keys
315
+ 'author_id' => ($this->is_key_valid && isset($_POST[$id . '-author_id'])) ? intval($_POST[$id . '-author_id']) : intval($_POST['author_id']),
316
  'category_id' => (isset($_POST[$id . '-category_id'])) ? $_POST[$id . '-category_id'] : '',
317
  'tags_id' => (isset($_POST[$id . '-tags_id'])) ? $_POST[$id . '-tags_id'] : '',
318
  'keywords' => array_map('trim',$keywords),
319
+ 'strip_html' => (isset($_POST[$id . '-strip_html'])) ? sanitize_text_field($_POST[$id . '-strip_html']) : '',
320
+ 'nofollow_outbound' => (isset($_POST[$id . '-nofollow_outbound'])) ? sanitize_text_field($_POST[$id . '-nofollow_outbound']) : '',
321
+ 'automatic_import_categories' => (isset($_POST[$id . '-automatic_import_categories'])) ? sanitize_text_field($_POST[$id . '-automatic_import_categories']) : '',
322
+ 'automatic_import_author' => (isset($_POST[$id . '-automatic_import_author'])) ? sanitize_text_field($_POST[$id . '-automatic_import_author']) : '',
323
+ 'canonical_urls' => (isset($_POST[$id . '-canonical_urls'])) ? sanitize_text_field($_POST[$id . '-canonical_urls']) : '',
324
  'feed_status' => $feed_status
325
  ));
326
  }
327
  }
 
328
  return $feeds;
329
  }
330
 
app/classes/admin/class-rss-pi-stats.php CHANGED
@@ -150,7 +150,6 @@ function drawChart() {};
150
 
151
  $parse = parse_url($feedurl);
152
  $url = $parse['host'];
153
-
154
  $args = array(
155
  "date_query" => array(
156
  array(
150
 
151
  $parse = parse_url($feedurl);
152
  $url = $parse['host'];
 
153
  $args = array(
154
  "date_query" => array(
155
  array(
app/classes/front/class-rss-pi-front.php CHANGED
@@ -199,7 +199,9 @@ class rssPIFront {
199
  $img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), full );
200
  $tc_image_thumb = $img_src[0];
201
  } else {
202
- $tc_image_thumb = site_url() . '/wp-content/plugins/rss-post-importer/app/assets/img/03-04-feedsapi-api.jpg';
 
 
203
  }
204
  echo '<meta name="twitter:card" value="summary" />';
205
  echo '<meta name="twitter:site" value="@feedsapi" />';
@@ -220,7 +222,8 @@ class rssPIFront {
220
  $img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'medium');
221
  $tc_image_thumb = $img_src[0];
222
  } else {
223
- $tc_image_thumb = site_url() . '/wp-content/plugins/rss-post-importer/app/assets/img/03-04-feedsapi-api.jpg';
 
224
  }
225
 
226
  if($excerpt = $post->post_content) {
@@ -249,7 +252,8 @@ class rssPIFront {
249
  $img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), full );
250
  $tc_image_thumb = $img_src[0];
251
  } else {
252
- $tc_image_thumb = site_url() . '/wp-content/plugins/rss-post-importer/app/assets/img/03-04-feedsapi-api.jpg';
 
253
  }
254
 
255
  if($excerpt = $post->post_content) {
199
  $img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), full );
200
  $tc_image_thumb = $img_src[0];
201
  } else {
202
+ //$tc_image_thumb = site_url() . '/wp-content/plugins/rss-post-importer/app/assets/img/03-04-feedsapi-api.jpg';
203
+ //plugins_url( 'images/wordpress.png', __FILE__ )
204
+ $tc_image_thumb = plugins_url( 'app/assets/img/03-04-feedsapi-api.jpg', __FILE__ );
205
  }
206
  echo '<meta name="twitter:card" value="summary" />';
207
  echo '<meta name="twitter:site" value="@feedsapi" />';
222
  $img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'medium');
223
  $tc_image_thumb = $img_src[0];
224
  } else {
225
+ //$tc_image_thumb = site_url() . '/wp-content/plugins/rss-post-importer/app/assets/img/03-04-feedsapi-api.jpg';
226
+ $tc_image_thumb = plugins_url( 'app/assets/img/03-04-feedsapi-api.jpg', __FILE__ );
227
  }
228
 
229
  if($excerpt = $post->post_content) {
252
  $img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), full );
253
  $tc_image_thumb = $img_src[0];
254
  } else {
255
+ //$tc_image_thumb = site_url() . '/wp-content/plugins/rss-post-importer/app/assets/img/03-04-feedsapi-api.jpg';
256
+ $tc_image_thumb = plugins_url( 'app/assets/img/03-04-feedsapi-api.jpg', __FILE__ );
257
  }
258
 
259
  if($excerpt = $post->post_content) {
app/templates/metatags.php CHANGED
@@ -160,7 +160,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
160
  $info = curl_getinfo($ch);
161
  if (intval($info['http_code'])==200) {
162
  //Save the file locally
163
- $fh = fopen(ABSPATH . 'wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml', 'w') or die("Can't open file");
164
  fwrite($fh, $fb_locales);
165
  fclose($fh);
166
  $listLocales=true;
@@ -173,7 +173,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
173
  }
174
  //Offline
175
  if (!$listLocales) {
176
- if ($fb_locales=file_get_contents(ABSPATH . 'wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml')) {
177
  $listLocales=true;
178
  $loadedOffline=true;
179
  }
160
  $info = curl_getinfo($ch);
161
  if (intval($info['http_code'])==200) {
162
  //Save the file locally
163
+ $fh = fopen(RSS_PL_PATH .'wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml', 'w') or die("Can't open file");
164
  fwrite($fh, $fb_locales);
165
  fclose($fh);
166
  $listLocales=true;
173
  }
174
  //Offline
175
  if (!$listLocales) {
176
+ if ($fb_locales=file_get_contents(RSS_PL_PATH .'wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml')) {
177
  $listLocales=true;
178
  $loadedOffline=true;
179
  }
index.php CHANGED
@@ -5,7 +5,7 @@
5
  Plugin URI: https://wordpress.org/plugins/rss-post-importer/
6
  Description: This plugin lets you set up an import posts from one or several rss-feeds and save them as posts on your site, simple and flexible.
7
  Author: feedsapi
8
- Version: 2.2.2
9
  Author URI: https://www.feedsapi.org/
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -18,6 +18,11 @@ if (!defined('RSS_PI_PATH')) {
18
  define('RSS_PI_PATH', trailingslashit(plugin_dir_path(__FILE__)));
19
  }
20
 
 
 
 
 
 
21
  if (!defined('RSS_PI_URL')) {
22
  define('RSS_PI_URL', trailingslashit(plugin_dir_url(__FILE__)));
23
  }
@@ -27,7 +32,7 @@ if (!defined('RSS_PI_BASENAME')) {
27
  }
28
 
29
  if (!defined('RSS_PI_VERSION')) {
30
- define('RSS_PI_VERSION', '2.2.2');
31
  }
32
 
33
  if (!defined('RSS_PI_LOG_PATH')) {
5
  Plugin URI: https://wordpress.org/plugins/rss-post-importer/
6
  Description: This plugin lets you set up an import posts from one or several rss-feeds and save them as posts on your site, simple and flexible.
7
  Author: feedsapi
8
+ Version: 2.2.3
9
  Author URI: https://www.feedsapi.org/
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
18
  define('RSS_PI_PATH', trailingslashit(plugin_dir_path(__FILE__)));
19
  }
20
 
21
+ if (!defined('RSS_PL_PATH')) {
22
+ define('RSS_PL_PATH', trailingslashit(plugin_dir_path(dirname(__FILE__))));
23
+ }
24
+
25
+
26
  if (!defined('RSS_PI_URL')) {
27
  define('RSS_PI_URL', trailingslashit(plugin_dir_url(__FILE__)));
28
  }
32
  }
33
 
34
  if (!defined('RSS_PI_VERSION')) {
35
+ define('RSS_PI_VERSION', '2.2.3');
36
  }
37
 
38
  if (!defined('RSS_PI_LOG_PATH')) {
readme.txt CHANGED
@@ -49,12 +49,12 @@ Not only does this WordPress RSS Aggregator Plugin import a snippet of the rss f
49
  **Premium Features include:**
50
 
51
 
52
- * Full Text RSS Feeds
53
  * Automated Featured images.
54
  * Keywords Based Filters and Curation .
55
  * RegEx Based Filters and Curation.
56
  * Define the number of Words Your Excerpt should have.
57
- * Fetch Full Text Articles + Images from Truncated Feeds.
58
  * Assign Any Imported RSS Feed Stream to a specific Author.
59
  * Assign Imported Posts to as many Tags as you want , the sky is the limit.
60
  * Assign Imported Post to as many categories as you want , the sky is the limit.
@@ -105,6 +105,10 @@ You need a Full Text RSS Key to upgrade your RSS Post Importer Plugin and boost
105
 
106
  Once you've installed RSS Post Importer, your stats will be available via the "Setting" menu which appears in the RSS Post Importer "Stats" block UI (under the RSS Post Importer settings block).
107
 
 
 
 
 
108
  = How do I contribute to RSS Post Importer? =
109
 
110
  Easy! There are opportunities for developers and non-developers at all levels to contribute:
@@ -124,8 +128,13 @@ Learn more (and get detailed instructions) in our [contribute guide](http://jetp
124
 
125
  == Change Log ==
126
 
 
 
 
 
127
  = Version 2.2.2 =
128
- * Stability update.
 
129
 
130
  = Version 2.2.1 =
131
  * Bug fixing and improvement.
@@ -280,4 +289,4 @@ Learn more (and get detailed instructions) in our [contribute guide](http://jetp
280
  * Added possibility to log each time imports are made in a textfile (for debugging purposes).
281
 
282
  = Version 1.0.1 =
283
- * Fixed some localization issues.
49
  **Premium Features include:**
50
 
51
 
52
+ * Full Text RSS Feeds ( Cloud-based processing via [**Full Text RSS**](http://www.feedsapi.com )
53
  * Automated Featured images.
54
  * Keywords Based Filters and Curation .
55
  * RegEx Based Filters and Curation.
56
  * Define the number of Words Your Excerpt should have.
57
+ * Fetch Full Text Articles + Images from Truncated Feeds. **Cloud-processing**
58
  * Assign Any Imported RSS Feed Stream to a specific Author.
59
  * Assign Imported Posts to as many Tags as you want , the sky is the limit.
60
  * Assign Imported Post to as many categories as you want , the sky is the limit.
105
 
106
  Once you've installed RSS Post Importer, your stats will be available via the "Setting" menu which appears in the RSS Post Importer "Stats" block UI (under the RSS Post Importer settings block).
107
 
108
+ = Is this a service or a stand-alone plugin? =
109
+
110
+ This exceptionally powerful and user-friendly wordpress plugin premium features use our cloud-based services: [**Full Text RSS Feed Processor**](http://www.feedsapi.com) and [**Best WP RSS Plugin**](http://www.rsspostimporter.com) in the backend to process your feeds and generate the full text + images version of each feed item
111
+
112
  = How do I contribute to RSS Post Importer? =
113
 
114
  Easy! There are opportunities for developers and non-developers at all levels to contribute:
128
 
129
  == Change Log ==
130
 
131
+ = Version 2.2.3 =
132
+ * Security Improvement
133
+ * Bug fixing
134
+
135
  = Version 2.2.2 =
136
+ * Bug fixing and improvement.
137
+ * Security Improvement
138
 
139
  = Version 2.2.1 =
140
  * Bug fixing and improvement.
289
  * Added possibility to log each time imports are made in a textfile (for debugging purposes).
290
 
291
  = Version 1.0.1 =
292
+ * Fixed some localization issues.