Plugin Directory

Changeset 1905335


Ignore:
Timestamp:
07/06/2018 01:55:58 PM (8 years ago)
Author:
yzhs
Message:

Fix Remove the digital label , Add simple preview

Location:
wp-autotags
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-autotags/trunk/readme.txt

    r1903967 r1905335  
    11=== WP AutoTags ===
    22Contributors: 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 AutoTags
     3Tags: 自动添加相关标签,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
    44Donate link: http://www.9sep.org/
    55Author URI: https://www.9sep.org/author/zhys
    66Plugin URI: http://www.9sep.org/wp-auto-tags
    7 Stable tag: 0.1.9
     7Stable tag: 0.1.11
    88Requires at least: 3.5.1
    99Tested up to: 4.9.6
     
    3434
    3535== Screenshots ==
     361. 简单演示: A simple preview after activating the plug-in
    3637
    3738== Changelog ==
     392018-07-06 v0.1.11 Fix Remove the digital label ,Add simple preview
    38402016-02-28 v0.1.7 Fix inclusion of special characters  THX@Mark :)
    39412015-09-27 v0.1.5 test plugin supports WordPress version and fix the plugin description
  • wp-autotags/trunk/wp-autotags.php

    r1903967 r1905335  
    33Plugin Name: WP AutoTags
    44Description: 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.9
     5Version: 0.1.11
    66Author: Zhys
    77Author URI: https://www.9sep.org/author/zhys
     
    1717
    1818function wp_aatags_sanitize( $taglist ) {
    19     $special_chars = array('?','、','。','“','”','《','》','!',',',':','?','.','[',']','/','\\','\=','<','>',':',';','\'','"','&','$','#','*','(',')','|','~','`','!','{','}','%','+', chr(0));
     19    $special_chars = array('?','、','。','“','”','《','》','!',',',':','?','.','[',']','/','\\','\=','<','>',':',';','\'','"','&','$','#','*','(',')','|','~','`','!','{','}','%','+',chr(0));
    2020    /**
    2121     * Filter the list of characters to remove from a taglist.
     
    2525    $taglist = str_replace( $special_chars, '', $taglist );
    2626    $taglist = str_replace( array( '%20', '+' ), '-', $taglist );
     27    $taglist = preg_replace( '/[\d]+/', '', $taglist );
    2728    $taglist = preg_replace( '/[\r\n\t -]+/', '-', $taglist );
    2829    $taglist = trim( $taglist, ',-_' );
     
    3132
    3233function 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)));
    3435    if(wp_remote_retrieve_response_code($request) != 200){
    3536        return 'rEr';
     
    4950    switch ($tagx) {
    5051        case 3:
    51             $d = strtolower($post_title.' '.wp_trim_words($post_content,333,''));
     52            $d = strtolower($post_title);
    5253            break;
    5354        case 2:
    54             $d = strtolower($post_title.' '.wp_trim_words($post_content,999,''));
     55            $d = strtolower(wp_trim_words($post_content,999,'').' '.$post_title);
    5556            break;
    5657        default:
    57             $d = strtolower($post_title);
     58            $d = strtolower(wp_trim_words($post_content,333,'').' '.$post_title);
    5859            break;
    5960    }
     
    129130
    130131<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>
    132133    <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>
    134135</select>
    135136
Note: See TracChangeset for help on using the changeset viewer.