Title: JMS Rss Feed
Author: James
Published: <strong>2015 年 1 月 19 日</strong>
Last modified: 2018 年 3 月 29 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/jms-rss-feed.svg)

# JMS Rss Feed

 由 [James](https://profiles.wordpress.org/jamesliu-1/) 開發

[下載](https://downloads.wordpress.org/plugin/jms-rss-feed.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/jms-rss-feed/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/jms-rss-feed/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/jms-rss-feed/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/jms-rss-feed/#developers)

 [技術支援](https://wordpress.org/support/plugin/jms-rss-feed/)

## 外掛說明

This plugin only does one task, adding your posts’ featured image to the RSS feed
in tag. It will show your full size featured image url in the tag.

## 安裝方式

 1. Upload the plugin to your wp-content/plugins folder, or use the Plugins > Add New
    section of your dashboard to search for “JMS Rss Feed”
 2. Activate the plugin through the Plugins menu in WordPress

## 常見問題集

  Installation Instructions

 1. Upload the plugin to your wp-content/plugins folder, or use the Plugins > Add New
    section of your dashboard to search for “JMS Rss Feed”
 2. Activate the plugin through the Plugins menu in WordPress

  Q1: How to get rss feed from my WordPress website?

If your website is built on WordPress, you can use this type of link to access your
website rss feed. For example: [https://jmsliu.com/feed?page=1](https://jmsliu.com/feed?page=1)

  Q2: How to get single post content in XML?

Currently, RSS standard doesn’t define rss for single post. If you really need such
feature like loading single post content in XML format, please leave the comment
in this plugin page. We will consider to add this feature in this plugin.

  Q3: What happen if my post doesn’t have featured image?

In this case, there will no be tag in your RSS Feed XML.

  Q4: What does this plugin do?

This plugin adds the featured image of each post to the RSS feed. The featured image
full size version url will be added in tag

  Q5: Where can I see the change?

In your site’s RSS feed. If you have featured image in your posts, you will find
in your rss feed.

## 使用者評論

![](https://secure.gravatar.com/avatar/7d409a1251e11b7fa5d7c3cc621be19f58ba55f5fe29e05470ddf9d7e7c51864?
s=60&d=retro&r=g)

### 󠀁[Code review : Bot detected : this plugin sends outside notifications](https://wordpress.org/support/topic/bot-detected-this-plugin-sends-outside-notifications/)󠁿

 [Frédéric Malo](https://profiles.wordpress.org/osilence/) 2016 年 9 月 3 日

Hello, The description is not correct. This plugin sends notifications, and downloaders
are not informed : "This plugin only does one task, adding your posts' featured 
image to the RSS feed in tag. It will show your full size featured image url in 
the tag." Here is the source code of version 3.0 <?php /* Plugin Name: JMS Rss Feed
Plugin URI: http://www.jmsliu.com/products/jms-rss-feed Description: Adds the featured
image tag <jms-featured-image> to your posts to the RSS feed. Author: James Liu 
Version: 3.0 Author URI: http://jmsliu.com/ */ global $jms_rss_db_version; $jms_rss_db_version
= '1.0'; add_action('rss2_item', 'add_jms_img_rss_node'); add_action( 'publish_post','
send_push_notification', 10, 2 ); //work together add_filter('query_vars', 'add_jms_single_post_var');
add_action('parse_request', 'return_jms_single_post'); //install database register_activation_hook(
__FILE__, 'install_jms' ); function add_jms_img_rss_node() { global $post; if(has_post_thumbnail(
$post->ID)) { $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post-
>ID), "full"); echo "<jms-featured-image>".$thumbnail[0]."</jms-featured-image>";}}
function add_jms_single_post_var($vars) { $vars[] = 'jms_rss_post_url'; $vars[] 
= 'jms_rss_action'; $vars[] = 'jms_rss_token'; $vars[] = 'jms_rss_send'; return 
$vars; } function send_push_notification($ID, $post) { global $wpdb; $table_name
= $wpdb->prefix . 'jms_rss_android_listener'; $devicesList = $wpdb->get_results("
SELECT * FROM $table_name WHERE state=1", "ARRAY_A"); $wpdb->flush(); if ( $devicesList){
define("GOOGLE_API_KEY", "AIzaSyDYVTahqUmT4RX6brZnReUr6Rq2KNEUv90"); $deviceList
= array(); foreach ( $devicesList as $device ) { $token = $device["device_token"];
if(strlen($token) > 10) { $deviceList[] = $token; } } //$author = $post->post_author;//
Post author ID //$name = get_the_author_meta( 'display_name', $author ); //$email
= get_the_author_meta( 'user_email', $author ); $title = $post->post_title; //$permalink
= get_permalink( $ID ); //$edit = get_edit_post_link( $ID, '' ); //$subject = sprintf('
Published: %s', $title ); $message = sprintf ('The article “%s” has been published.',
$title); //$message .= sprintf( 'View: %s', $permalink ); sendNotification($deviceList,
$message); } } function return_jms_single_post($wp) { global $wpdb; //this is for
test if(array_key_exists('jms_rss_send', $wp->query_vars)) { $action = $wp->query_vars['
jms_rss_send']; if($action == '1') { $table_name = $wpdb->prefix . 'jms_rss_android_listener';
$devicesList = $wpdb->get_results("SELECT * FROM $table_name WHERE state=1", "ARRAY_A");
$wpdb->flush(); if ( $devicesList ) { define("GOOGLE_API_KEY", "AIzaSyDYVTahqUmT4RX6brZnReUr6Rq2KNEUv90");
$deviceList = array(); foreach ( $devicesList as $device ) { $token = $device["device_token"];
if(strlen($token) > 10) { $deviceList[] = $token; } } sendNotification($deviceList,"
Hello World!"); } } exit; } if (array_key_exists('jms_rss_action', $wp->query_vars)){
$action = $wp->query_vars['jms_rss_action']; if(!empty($action)) { if($action =="
register_android") { $token = $wp->query_vars['jms_rss_token']; $table_name = $wpdb-
>prefix . 'jms_rss_android_listener'; $wpdb->query( $wpdb->prepare( " INSERT INTO
$table_name ( device_token, state, reg_date ) VALUES ( %s, %d, %s ) ", array( $token,
1, current_time('mysql', 1) ) ) ); echo $wpdb->insert_id; exit; } } } if (array_key_exists('
jms_rss_post_url', $wp->query_vars)) { //for old usage only $url = $wp->query_vars['
jms_rss_post_url']; $postid = url_to_postid( $url ); $post = get_post($postid); //
print_r($post); echo $post->post_content; exit; } } function install_jms() { global
$jms_rss_db_version; global $wpdb; $installed_ver = get_option( "jms_rss_db_version",
null ); if ( $installed_ver == null ) { $table_name = $wpdb->prefix . "jms_rss_android_listener";
$charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE IF NOT EXISTS
$table_name ( id INT NOT NULL AUTO_INCREMENT , device_token VARCHAR(255) NOT NULL,
state TINYINT NOT NULL COMMENT '0 disabled\n1 enabled' , reg_date DATETIME NOT NULL,
PRIMARY KEY (id), UNIQUE INDEX id_UNIQUE (id ASC) , UNIQUE INDEX device_token_UNIQUE(
device_token ASC) ) ENGINE = INNODB $charset_collate;"; require_once( ABSPATH . '
wp-admin/includes/upgrade.php' ); dbDelta( $sql ); add_option( "jms_rss_db_version",
$jms_rss_db_version ); } } function sendNotification($registrationIDs, $message){//
$registrationIDs = array( "reg id1","reg id2"); $url = 'https://gcm-http.googleapis.
com/gcm/send'; $fields = array( 'registration_ids' => $registrationIDs, 'data' =
> array( "message" => $message ), ); $headers = array( 'Authorization: key=' . GOOGLE_API_KEY,'
Content-Type: application/json' ); // Open connection $ch = curl_init(); // Set 
the URL, number of POST vars, POST data curl_setopt( $ch, CURLOPT_URL, $url); curl_setopt(
$ch, CURLOPT_POST, true); curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers); curl_setopt(
$ch, CURLOPT_RETURNTRANSFER, true); //curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode(
$fields)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // curl_setopt($ch, 
CURLOPT_POST, true); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt(
$ch, CURLOPT_POSTFIELDS, json_encode( $fields)); // Execute post $result = curl_exec(
$ch); // Close connection curl_close($ch); echo $result; //print_r($result); //var_dump(
$result); } ?>

 [ 閱讀全部 1 則使用者評論 ](https://wordpress.org/support/plugin/jms-rss-feed/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈JMS Rss Feed〉的開發相關工作。

參與者

 *   [ James ](https://profiles.wordpress.org/jamesliu-1/)

[將〈JMS Rss Feed〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/jms-rss-feed)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/jms-rss-feed/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/jms-rss-feed/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/jms-rss-feed/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/jms-rss-feed/)。

## 變更記錄

#### 3.5

Remove all unnecessary features from the plugin. Now the plugin only has the pure
feature: add tag in RSS Feed XML.

#### 2.0

Add customization url in your wordpress to return a plain text of your articles.

#### 1.0

 * First build

## 中繼資料

 *  版本 **3.5.0**
 *  最後更新 **9 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 4.0.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **4.9.0**
 *  語言
 * [English (US)](https://wordpress.org/plugins/jms-rss-feed/)
 * 標籤:
 * [add featured image](https://tw.wordpress.org/plugins/tags/add-featured-image/)
   [add featured image to rss](https://tw.wordpress.org/plugins/tags/add-featured-image-to-rss/)
   [featured image](https://tw.wordpress.org/plugins/tags/featured-image/)[feed](https://tw.wordpress.org/plugins/tags/feed/)
   [post thumbnail](https://tw.wordpress.org/plugins/tags/post-thumbnail/)
 *  [進階檢視](https://tw.wordpress.org/plugins/jms-rss-feed/advanced/)

## 評分

 1 星，滿分為 5 星

 *  [  0 個 5 星使用者評論     ](https://wordpress.org/support/plugin/jms-rss-feed/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/jms-rss-feed/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/jms-rss-feed/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/jms-rss-feed/reviews/?filter=2)
 *  [  1 個 1 星使用者評論     ](https://wordpress.org/support/plugin/jms-rss-feed/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/jms-rss-feed/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/jms-rss-feed/reviews/)

## 參與者

 *   [ James ](https://profiles.wordpress.org/jamesliu-1/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/jms-rss-feed/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://jmsliu.com/products/jms-rss-feed/)