分类文章订阅

描述

这个插件让使用者能够定基于不同的分类来订阅或取消订阅相关文章。
订阅者将将受到一封含有文章链接的电子邮件通知。

For a complete overview of STC read: /wp-content/plugins/subscribe-to-category/STC’s User Manual version 2.6.12.
This document also includes a Step by Step Get Started chapter.

The following features are available

  • E-mail notification template with placeholders
  • Custom Posts
  • Custom Taxonomies
  • 强化关键词搜索在题目、内容、标签、分类
  • E-mail notification on timer or daily basis
  • 短信通知基于计时器或者每日推送
  • For newly created and / or updated Posts
  • Works with classic editor and the block editor
  • 导出或导入订阅者
  • Implementation by widget and / or by shortcode

Usage

For a complete overview of STC read: /wp-content/plugins/subscribe-to-category/STC’s User Manual version 2.6.12

屏幕截图

  • 设置页面展示的是STC订阅的菜单结构。
  • With Bootstrap framework.
  • Without Bootstrap framework, override and add your own CSS.
  • When resend post is enabled in settings there is a new option available when editing a post.
  • When resend post and Gutenberg editor settings are both enabled, resend options are available in the Gutenberg document tab
  • Taxonomy edit possibility
  • STC Subscribers list with one custom taxonomy called "Taxonomies"
  • 通过短代码创建订阅(树状图模式)
  • 通过短代码创建订阅(普通清单模式)
  • 启用通知邮件中的6个HTML模块。
  • 通知邮件模板开启
  • 设置小工具属性

安装

This section describes how to install the plugin and get it working.

  1. subscribe-to-category上传到/wp-content/plugins/目录
  2. Activate the plugin through the ‘Plugins’ menu in WordPress Admin
  3. Inspect and Save your settings with the dashboard menu item ‘STC Subscribe > Settings’.
  4. Create a page and add shortcode [stc-subscribe] or use the STC Widget to display STC form subscription.
  5. Inspect /create / update subscribers with the dashboard menu item STC Subscriber > Subscribers

Shortcode Attributes

‘category_in’ – 如果你想让一个或者多个分类能够被订阅,使用这个属性。输入值是分类名称。注意只有顶级分类(无父级)才能够被输入。
‘category_id_in’ – 与上面不同的就是用ID代替了分类名称。
‘category_not_in’ – 使用这个属性排除订阅分类。输入值是分类名称。
‘category_id_not_in’ – 与上面不同的就是用ID代替了分类名称。
上面的属性你可以使用逗号来分隔多个分类, 如 [stc-subscribe category_in=”news, article”]。

‘hide_unsubscribe’ – hide_unsubscribe=”true” 禁止取消订阅功能,只在相应的短代码属性在管理设置中也被激活时起效。
‘treeview_folded’ – treeview_folded=”false” 默认是否开启分类、标签的层级视图。
‘treeview_enabled’ – treeview_enabled=”false” 取消分类、标签的层级视图。请注意只有被选中的分类或标签才会起效。
‘keyword_search’ – keyword_search=”on” 在选中的文章类型中开启关键词搜索功能,. 默认是关闭的。
‘subscriber_notification’ – subscriber_notification=”true” 开启基于用户的订阅通知功能。 默认是关闭的。
‘mobile_phone’ – mobile_phone=”on” 开启短信通知功能。短信通知就想邮件一样,将针对新文章或更新文章进行通知推送。

Filter and hooks

Following filters and hooks can be used for customizing the email message.

<?php
// FILTERS
// Parameters: $value
add_filter( 'stc_message_length_sum_of_words', 'stc_message_length_sum_of_words', 10, 1 ); //set return value to a negative number to show the full content


// Parameters: $value, $post_id, $subscriber_post_id
add_filter( 'stc_message_title_html', 'my_stc_message_title_html', 10, 3 );
add_filter( 'stc_message_link_to_post_html', 'my_stc_message_link_to_post_html', 10, 3 );
add_filter( 'stc_message_unsubscribe_html', 'my_stc_message_unsubscribe_html', 10, 3 );
add_filter( 'stc_message_subscribe_html', 'my_stc_message_subscribe_html', 10, 3 );

// Parameters: $email_adress, $email_subject, $email_contents, $email headers
// Return: $email_address if email address still needs to be send by STC else an empty ""
add_filter( 'stc_filter_wp_mail', 'my_stc_filter_wp_mail', 10, 4 );

// HOOKS
// Parameters: $post_id, $subscriber_post_id  
add_action( 'stc_before_message', 'my_stc_before_message', 10, 2 );
add_action( 'stc_before_message_title', 'my_stc_before_message_title', 10, 2 );
add_action( 'stc_after_message_title', 'my_stc_after_message_title', 10, 2 );
add_action( 'stc_before_message_content', 'my_stc_before_message_content', 10, 2 );
add_action( 'stc_after_message_content', 'my_stc_after_message_content', 10, 2 );
add_action( 'stc_after_message', 'my_stc_after_message', 10, 2 );

// Parameters: $subscriber_post_id, $categories, bool $all_categories
add_action( 'stc_after_update_subscriber', 'my_stc_after_update_subscriber', 10, 3 );
add_action( 'stc_after_insert_subscriber', 'my_stc_after_insert_subscriber', 10, 3 );

// Parameters: $subscriber_post_id, 
add_action( 'stc_before_unsubscribe', 'my_stc_before_unsubscribe', 10, 1 ); // runs before deleting a subscriber from database
add_action( 'stc_before_subscribe', 'my_stc_before_subscribe', 10, 1 ); // runs before adding a subscriber to the database


/**
 * Example for adding featured image to STC email
 */
function my_stc_after_message_title( $post_id ){
    echo get_the_post_thumbnail( $post_id, 'thumbnail' );
}
add_action( 'stc_after_message_title', 'my_stc_after_message_title', 10, 2 );

?>

Optionally but recommended

As WordPress Cron is depending on that you have visits on your website you should set up a Cron job on your server to hit http://yourdomain.com/wp-cron.php at a regular interval to make sure that WP Cron is running as expected. In current version of Subscribe to Category the WP Cron is running once every hour, that might be an option that is changeable in future versions.
Therefore, a suggested interval for your server Cron could be once every 5 minutes.

常见问题

让STC插入额外的HTML内容到通知邮件里

是的,在通知邮件中通过使用可行的hooks置入HTML,这需要一些编程技巧。在2.4.9版本后,同时样式将有有更多的可能性。你可以在screenshot-10.jpg中看到在哪里你可以置入代码。

要重新开始的最好方法就是把所有的HTML邮件模板删除(已发布的与已删除的)。之后STC订阅将自动设置一个可编辑的模板文件,如screenshot-11中一样。别忘了在STC订阅-> 设置中,选中这个模板。

或者根据下面三个步骤:
步骤1:STC订阅->通知->添加新的通知来创建通知模板。
步骤2:编辑模板文章(做好在单一的html编辑模块下完成),所有的样式代码必须在每一个html模块内。要注意不是每个邮件服务商都支持HTML样式的。请使用插件专用占位符{{post_title}},{{post_content}},{{justify}} 和 {{unsubscribe}}。
步骤3:在STC订阅->设置中,激活相应的的通知模板。

STC小工具能够控制属性吗?

是的,从2.4.16版本起,小工具设置中就添加了属性区域。格式与短码中使用的相同。

STC能够兼容自定义文章类型吗

是的,从2.4.1版本开始,用户可以将自定义文章分类和STC进行捆绑,你可以在STC设置页面选择“自定义文章类型”。

Can STC handle custom Taxonomies

Yes, from version 2.3.1 it is possible to link STC with Custom created Taxonomies. You can activate these within STC on the STC admin settings page.

为什么我只有0层级的分类在过滤器中

这是因为你选择了一个子分类作为过滤器,树状图无法在分类结构的中间开始展示。但是,当属性 ‘treeview_enabled=”false”‘ 被激活时,你可以选择一个没有父级的子分类,他们将会显示成单个的分类项。

我如何能够启动普通清单模式而不是树状图模式

你可以通过设置短代码 attribute treeview_enabled=”false” 设置分类形式为清单模式。请注意,当次属性被激活后,在过滤器里的分类层级将被忽略,结果将和过滤器属性的清单模式一样。

导入订阅者名单的文件格式是什么?

STC 只能处理表单文件,因为分类信息都会被逗号隔开的。
Excel文件能支持你导出txt文件的表单。

评价

2022年8月29日
This is exactly what I was looking for in order to be able to send personalized publications to subscribers which other plugins do not do and simple to configure. Not to mention responsive support Thanks to the Developers
2022年6月15日 1 回复
I wanted to allow readers to subscribe to what they were interested in and this was the plugin I needed. It's simple and straightforward and works. The maintainer is also very helpful and responsive. The one feature I'm waiting for is to be able to have the author's name in the email.
2022年4月23日 1 回复
This has wasted me a lot of time. The widget does not work. It does appear on the sidebar, but attributes simply do not work. I tried many variations and read the instructions, and was very sure I did the way as instructed. But no, it does not work. Something does happen based on the attributes entered, but completely unpredictable and unreliable.
2021年7月13日
No nonsense plugin without unnecessary marketing features. Simple and with good documentation, if you bother to read through it carefully (which I didn't but that's on me). Active and helpful developer with great support. Even got in a call with me to help, far beyond anything you can demand. Getting a placeholder for the updated category without "Term:" and "found." would be great but that's too small an issue to complain about.
2021年5月6日
This plugin does exactly what it should and it comes with amazing support. Some other review says: "Do one thing and do it well" I totally agree.
阅读所有31条评价

贡献者及开发者

“分类文章订阅” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

“分类文章订阅”插件已被翻译至5种本地话语言。 感谢所有译者为本插件所做的贡献。

将“分类文章订阅”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

= 2.7.4.
* fixed some php warnings that popped up using the latest PHP versions

= 2.7.3.
* added add_filter feature for users that want to send bulk emails
* small bug fixes

= 2.7.1.
* fixed double “WP” call for $_GET receiving subscribe notification url.

= 2.6.13.
* fixed multiple subscribers in Approval state when refressing the subscription page/widget

= 2.6.12.
* added {{post_featured_image_url}} and {{post_author}} placeholders

= 2.6.11.
* Fixed Approval Waiting message to become translatable with WP

= 2.6.10.
* added Create STC metafields for posts added by others not following WP save post protocoll

= 2.6.9.
* added action-xhr=”#” to form satisfy amp error: missing tag

= 2.6.8.
* Moved setting post status from the end of the send cycle to the beginning but leaving the sent time back at the end.

= 2.6.7.
* Fixed small problem with rescheduling hourly timer
* Moved setting post status from the end of the send cycle to the beginning
* Added set_time_limit(0) to avoid triggerring the maximum execution time

= 2.6.6.
* Fixed problem with scheduled post not processed by STC

= 2.6.5.
* Initialization error when changing email address field with all categories checkbox selected
* two small bug fixes

= 2.6.4.1
* textmagic files missing on version 2.6.4 (only needed on sms notofications)

2.6.4

  • corrrected typo in text of confirmation e-mail to subscribers
  • fixed added “stc-” to function name to avoid conflict in name of function “general_admin_notice()” with plugin “quiz-maker”

2.6.3

  • added possibility to use jet smart filter checkbox settings as subscription categories.
  • buf fixes

2.6.2

  • On import subscribers changed seperator from “, ” to “,” and allowing for subscribers with zero assigned Taxonomies
  • Simplified Import and Export so it can now cope with custom taxonomy groups
  • Text changes to allow for *.txt and *.csv files on import subscribers
  • STC Subscription CSS changed theme ul style causing problems for some themes
  • minor bug fixes

2.6.1

  • Added admin setting to enable the SMS Notifications (default is off))
  • Added Mobile Number and SMS Status Fields to the STC Subscribers List
  • fixed several debug notices, warnings and code bugs.

2.5.9

  • Added attribute to show taxonomy hierarchy in the reason why a notification was sent.
  • minor bug fixes

2.5.8

  • Fixed warning on directory or file does not exsist
  • Fixed problems with containers with two or more columns

2.5.7

  • added confirmpage slug: stcs-confirmation-page for stage one of email confirmation
  • added SMS Notification feature (workonly with TextMagic as send sms provider)
  • Fixed problem with email notification subject
  • Fixed mixed some text messages wrongly using Blog where it should be Post
  • Fixed problem with do not send this Post on new/update
  • minor bug fixes.

2.5.5

  • added landingspage with slug stcs-landing-page
  • solved bug in succesfull reply on import susbscribers
  • solved bug in subscribers not having a proper default value for individual subscribtions

2.5.4

  • new placeholders
  • choice for weekdays, daily and hourly notifications on individual basis
  • problem with word / character cutoff in middle of html tag’s
  • small bugfixes

2.5.3

  • added new place holder {{post_excerpt}}
  • added new place holder {{post_featured_image}}
  • new STC Basic e-Mail Template V2.1 (delete older versions)
  • solved problem {{search_reason}} containing “” in some cases.

2.5.2

  • added possibility in the post ducoment sidebar to inhibbit send e-mail notifications
  • Ignore default treeview enabled when category attributes are used in the same shortcode this makes it possible to upgrade STC from older (before treeview) versions

2.5.1

  • revised readme.txt and introduction of STC’s User Manual
  • Added enhanced keyword search facilities.
  • Added stc_update_count_callback function which filters out the terms count for custom post type ‘stc’.
  • Check for STC meta keys present on custom posts created by others. Add STC meta keys/values if not present.
  • Added more placeholders to control the e-mail notification template
  • For newly created e-mail notification post are created with content explanatory content and possible placeholders.
  • small bugfixes

2.4.18

  • Removal of all the non textual tags preventing cutoff’s causing e-mail layout failure
  • Added multibyte characters count for the E-Mail Notification
  • Added hidden

tags to separate multiple updates and / or saves posts. HR styling is available in body class “stc-notify-hr”
* Added workaround to control justification in the contents row of the e-mail notification template. text-align: left”>{{post_content}} is used by STC to replace the word left for center allowing dynamic justification depending on content cutoff is 0 or > 0
* small bugfixes

2.4.17

  • Created “STC Demo E-mail Template V1.1” to enable background-color style change with Chinese SMTP provider (tested with outlook, gmail and exmail).
  • Improved handling of E-mail Template
  • small bugfixes

2.4.16

  • Unsubscribe via e-mail link firing more then once causing incorrect fault message
  • New single HTML E-mail Notification layout with placeholders for title, content and unsubscribe
  • Widget settings for STC Widget: new possibility to use shortcode attributes
  • small bugfixes

2.4.14

  • adding a feature to send all email notifications once per day
  • revised the STC Settings Notification E-mail status pane
  • small bugfixes

2.4.12

  • Added/Revised code and HTML section post to create an initial html template setup like in screenshot-11. Delete all HTML sections (published and trashed) to replace existing HTML sections
  • corrected quite a view spelling mistakes in messages and readme.txt
  • small bugfixes

2.4.11

  • Redesigned the STC menu structure. Dashboard: STC Subscribe => Submenu: (Settings, Notifications, Subscribers)
  • Added code to create the basic notification structure automatically (if HTML section names not checked && post does not exist) {wp_insert_post(….)}
  • small bugfixes

2.4.10

  • created a way that categories are default on until the user itself disables it through STC admin settings
  • redesigned option structure for compatibility reasons

2.4.9

  • major change in adding HTML text to the notification e-mail (read FAQ concerning HTML inserts)
  • categories can now be disabled to accommodate users how only work with custom taxonomies
  • small bugfixes

2.4.8

  • small bug fixes.

2.4.7

  • STC used Sendmail instead of PHPMailer because in version 5.5 from WordPres wp_mail can’t cope with a encoded_basic64. Analasys of the PHPMailer’s showed that it takes care of 8-bit characters itself so no need to do this in STC. wp_mail() again used enabling Mail plugins to pick up STC mails.

2.4.6

  • added attribute ‘treeview_folded’ -> treeview_folded=”false” unfolds the category / taxonomy tree view by default
  • added attribute ‘treeview_enabled’ -> treeview_enabled=”false” displays the categories / taxonomies as one list ignoring hierarchy. Please note that only the selected categories are in or out
  • added/changed some French translations
  • small bug fixes.

2.4.5

  • filter categories caused the tree view to be messed up completely now any category can be taken out but only categories of level 0 can be filtered in.

2.4.4

  • allow for no categories or taxonomies selected at all
  • fixed issue that subscribers in trash taxonomies where picked up
  • fixed issue displaying wrong indent for category and taxonomy treeview

2.4.3

  • fixed issue on shortcodes attributes: category_in, category_id_in, category_not_in, category_id_not_in

2.4.2

  • fixed issue on STC settings page when no custom post or no custom taxonomies where available
  • fixed issue on subscription warning when no taxonomies where selected
  • fixed issue on first use of the block editor STC resend checkbox

2.4.1

  • Added Custom Posts Functionality
  • Minor bugfixes

2.3.9

  • Fixed error in CSS file stc-tax-style.css causing CSS optimization to fail

2.3.8

  • Revised category and taxonomy selection for the shortcode and widget
  • Several changes to make understand STC better
  • Fix bug in wp-mail sending corrupted base64 encode subject in notification
  • Other bugfixes

2.3.6

*bugfixes

2.3.5

  • Small changes to adapt to WP 5.5
  • bugfixes

2.3.1

  • New admin setting to select custom taxonomies names (shortcode for taxonomy selection comes later for now use admin edit of subscription)
  • Multiple post to one subscriber are added together in one notification.
  • bugfixes

2.2.1

  • Introduced subscriber verification for subscriptions and updates while not logged in to WordPress
  • Introduced disabling of the unsubscribe checkbox
  • New admin setting to control the length of the content in the email notification
  • bugfixes

2.1.7

  • Added email conformation to intended STC subscriber. When confirmed the new STC subscriber becomes active. This is not required when the user is in admin mode.

2.1.6

  • minor bugfixes

2.1.5

  • changed subscription method for existing subscribers to enable updating the subscription
  • bug fixed with only one category causing nothing to show

2.1.4

  • Changed text for using the Gutenberg/Block editor to be more clear
  • Redirect to first page after subscription stays now on the current page
  • Bug fixed causing not to update the subscribers when using the classic WP editor

2.1.3

  • Added an admin feature to import a csv subscriber list in exactly the same format as created by the export function

2.1.2

  • Added an admin setting to control the WP-Cron STC rescheduling “send email time”. Default is 3600 second but the user can now set it to any value between 180 and 3600 => 2 minutes and 1 hour

2.1.1

  • during sanitizing process, the email address from the unsubscriber lost the “@” sign causing failed unsubscribing issues

2.1.0

  • implemented sanitizing and escaping according WPCS
  • adapted internationalization text domain to plugin standards
  • added ‘numberposts’ => -1 to the arguments for exporting all subscribers to excel it was defaulting to a maximum of 5
  • minor bugfixes

2.0.0

  • adapted STC to wp 5.3 features by adding a STC resend option to the document tab

1.9.0

  • Email address preset for logged in users.
  • Japanese, Dutch, German and Norwegian language added.

1.8.1

  • Added pot file to be used for translation.
  • Bugfix – changed text domain to string instead of constant.

1.7.0

  • Added some new hooks: stc_after_update_subscriber, stc_after_insert_subscriber, stc_before_unsubscribe.

1.6.0

  • Added a Widget for subscription form.
  • Don’t show category list if only one is available (thanks to davefx).
  • Extended short code attributes with an option to use category id instead of category name (thanks to Stingray_454).

1.3

  • Added hooks and filters to make the plugin extensible.
  • Added Lithuanian language.

1.2.1

  • Fixed some undefined variables that might have caused some errors for some environments.
  • Renamed language files for Russian language to correct syntax.
  • Added Italian language.

1.2.0

  • Possibility to re-send a post on update that has already been sent. This option needs to be activated in the settings for the plugin.
  • Attribute ‘category_in’ added to shortcode to show only entered categories in the subscribe form. Multiple categories are separated by a comma sign.
  • Attribute ‘category_not_in’ added to shortcode to exclude categories in the subscribe form. Multiple categories are separated by a comma sign.

1.1.0

  • Added php sleep() function to prevent sending all e-mails in the same scope.
  • Using Ajax when send is manually triggered in back-end.

1.0.0

  • First release