Changeset 1905335
- Timestamp:
- 07/06/2018 01:55:58 PM (8 years ago)
- Location:
- wp-autotags
- Files:
-
- 1 added
- 3 edited
-
assets/banner-772×250.jpg (modified) (previous)
-
assets/screenshot-1.gif (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-autotags.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-autotags/trunk/readme.txt
r1903967 r1905335 1 1 === WP AutoTags === 2 2 Contributors: Zhys 3 Tags: tags, auto, save, posts, existing, content, search, tag, tf-idf, edit, publish, post, autotags, wat, keyword, keywords, extract, analysis, aatags, autotags, autotag, wp_aatags, wp_aatag, automatically, extraction, English, Chinese, article, 自动Tags, 自动添加标签, wp_autotags, WordPress自动添加标签, 文章自动添加标签, 文章智能标签, 相关标签, 自动标签, 文章自动标签, 自动更新标签, wp-auto-tags, WP AutoTags3 Tags: 自动添加相关标签,auto tags, wp_autotags, tags, auto, save, posts, existing, content, search, tag, tf-idf, edit, publish, post, autotags, wat, keyword, keywords, extract, analysis, aatags, autotag, wp_aatags, wp_aatag, automatically, extraction, English, Chinese, article, 自动Tags, WordPress自动添加标签, 文章自动添加标签, 文章智能标签, 相关标签, 自动标签, 文章自动标签, 自动更新标签, wp-auto-tags, WP AutoTags 4 4 Donate link: http://www.9sep.org/ 5 5 Author URI: https://www.9sep.org/author/zhys 6 6 Plugin URI: http://www.9sep.org/wp-auto-tags 7 Stable tag: 0.1. 97 Stable tag: 0.1.11 8 8 Requires at least: 3.5.1 9 9 Tested up to: 4.9.6 … … 34 34 35 35 == Screenshots == 36 1. 简单演示: A simple preview after activating the plug-in 36 37 37 38 == Changelog == 39 2018-07-06 v0.1.11 Fix Remove the digital label ,Add simple preview 38 40 2016-02-28 v0.1.7 Fix inclusion of special characters THX@Mark :) 39 41 2015-09-27 v0.1.5 test plugin supports WordPress version and fix the plugin description -
wp-autotags/trunk/wp-autotags.php
r1903967 r1905335 3 3 Plugin Name: WP AutoTags 4 4 Description: Often publish articles and updates people loves forgets to set tags when editing an article, the article automatically add keywords tag. tag extraction based on TF-IDF implementation. Built-in TF-IDF interface does not work when you try to find an existing tag in WordPress. If found, these markers are added to the post automatically each time you save the post. 5 Version: 0.1. 95 Version: 0.1.11 6 6 Author: Zhys 7 7 Author URI: https://www.9sep.org/author/zhys … … 17 17 18 18 function wp_aatags_sanitize( $taglist ) { 19 $special_chars = array('?','、','。','“','”','《','》','!',',',':','?','.','[',']','/','\\','\=','<','>',':',';','\'','"','&','$','#','*','(',')','|','~','`','!','{','}','%','+', chr(0));19 $special_chars = array('?','、','。','“','”','《','》','!',',',':','?','.','[',']','/','\\','\=','<','>',':',';','\'','"','&','$','#','*','(',')','|','~','`','!','{','}','%','+',chr(0)); 20 20 /** 21 21 * Filter the list of characters to remove from a taglist. … … 25 25 $taglist = str_replace( $special_chars, '', $taglist ); 26 26 $taglist = str_replace( array( '%20', '+' ), '-', $taglist ); 27 $taglist = preg_replace( '/[\d]+/', '', $taglist ); 27 28 $taglist = preg_replace( '/[\r\n\t -]+/', '-', $taglist ); 28 29 $taglist = trim( $taglist, ',-_' ); … … 31 32 32 33 function wp_aatags_keycontents($keys,$num){ 33 $request = wp_remote_request('http ://cws.9sep.org/extract/json',array('method'=>'POST','timeout'=>20,'body'=>array('text'=>$keys,'topk'=>$num)));34 $request = wp_remote_request('https://cws.9sep.org/extract/json',array('method'=>'POST','timeout'=>9,'body'=>array('text'=>$keys,'topk'=>$num))); 34 35 if(wp_remote_retrieve_response_code($request) != 200){ 35 36 return 'rEr'; … … 49 50 switch ($tagx) { 50 51 case 3: 51 $d = strtolower($post_title .' '.wp_trim_words($post_content,333,''));52 $d = strtolower($post_title); 52 53 break; 53 54 case 2: 54 $d = strtolower( $post_title.' '.wp_trim_words($post_content,999,''));55 $d = strtolower(wp_trim_words($post_content,999,'').' '.$post_title); 55 56 break; 56 57 default: 57 $d = strtolower( $post_title);58 $d = strtolower(wp_trim_words($post_content,333,'').' '.$post_title); 58 59 break; 59 60 } … … 129 130 130 131 <select name="wp_aatags_opts"> 131 <option value="1" <?php selected('1', $wp_aatags_opts ); ?>><?php if(get_bloginfo('language')=='zh-CN'||get_bloginfo('language')=='zh-TW'): ?> 仅匹配文章标题<?php else: ?>Only Posts Title<?php endif; ?></option>132 <option value="1" <?php selected('1', $wp_aatags_opts ); ?>><?php if(get_bloginfo('language')=='zh-CN'||get_bloginfo('language')=='zh-TW'): ?>标题+正文前333字<?php else: ?>Posts Title&Content before 333.<?php endif; ?></option> 132 133 <option value="2" <?php selected('2', $wp_aatags_opts ); ?>><?php if(get_bloginfo('language')=='zh-CN'||get_bloginfo('language')=='zh-TW'): ?>文章内容前999字<?php else: ?>Only Posts Content before 999.<?php endif; ?></option> 133 <option value="3" <?php selected('3', $wp_aatags_opts ); ?>><?php if(get_bloginfo('language')=='zh-CN'||get_bloginfo('language')=='zh-TW'): ?> 标题+正文前333字<?php else: ?>Posts Title&Content before 333.<?php endif; ?></option>134 <option value="3" <?php selected('3', $wp_aatags_opts ); ?>><?php if(get_bloginfo('language')=='zh-CN'||get_bloginfo('language')=='zh-TW'): ?>仅匹配文章标题<?php else: ?>Only Posts Title<?php endif; ?></option> 134 135 </select> 135 136
Note: See TracChangeset
for help on using the changeset viewer.