Plugin Directory

Changeset 898037


Ignore:
Timestamp:
04/19/2014 12:18:43 PM (12 years ago)
Author:
SivaDu
Message:

new version 0.1.9

Location:
anylink/trunk
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • anylink/trunk/anyLink.php

    r847629 r898037  
    44Plugin URI: http://dudo.org/anylink
    55Description: anyLink is an external links management tool. It help you to covert all the external links in your posts into internal links automatically. It can prevent the website weight flow outside to others. It's absolutely SEO friendly.
    6 Version: 0.1.8
     6Version: 0.1.9
    77Author: dudo
    88Author URI: http://dudo.org/about
  • anylink/trunk/classes/al_filter.php

    r847629 r898037  
    9494            $gotoURL = $_GET[$this -> redirectCat];
    9595        if( ! empty( $gotoURL ) ) {
    96             wp_redirect( htmlspecialchars_decode( $this -> getUrlBySlug( $gotoURL ) ), ( int )$this -> redirectType );
    97             exit;
    98         }   
     96            //since 0.1.9
     97            // changed redirect method by javascript
     98            $gotoLink = htmlspecialchars_decode( $this -> getUrlBySlug( $gotoURL ) );
     99            $redirectType = ( int )$this -> redirectType;
     100            if( $redirectType == 200 ) {
     101                require_once( ANYLNK_PATH . '/re.php');
     102                exit;
     103            } else { //end
     104                wp_redirect( $gotoLink, $redirectType );
     105                exit;
     106            }
     107        }
    99108    }
    100109    public function getUrlBySlug( $slug ) {
  • anylink/trunk/classes/al_option.php

    r846920 r898037  
    151151            $cat = $alOptions['redirectCat'];
    152152            $type = $alOptions['redirectType'];
    153             global $wp_rewrite;
    154             if( $type == '200' ) {
    155                 /* get the relative path of redirect file */
    156                 $redirectFile = substr( plugins_url(), strlen( home_url() ) + 1 ) . '/' . ANYLNK_PLUGIN . '/redirect.php';
    157                 /* add an external rewrite rule which will  be written into .htaccess file */
    158                 $wp_rewrite -> add_external_rule( "$cat/([0-9a-z]{4,})/?$",  $redirectFile . '?slug=$1' );
    159                 flush_rewrite_rules();
    160             } else {
    161                 $wp_rewrite -> flush_rules( true );
    162                 add_rewrite_rule( "$cat/([0-9a-z]{4,})/?$", 'index.php?' . $cat . '=$matches[1]', 'top' );
    163                 flush_rewrite_rules();
    164             }
     153            global $wp_rewrite;            //since 0.1.9
     154            $wp_rewrite -> flush_rules( true );
     155            add_rewrite_rule( "$cat/([0-9a-z]{4,})/?$", 'index.php?' . $cat . '=$matches[1]', 'top' );
     156            flush_rewrite_rules();
    165157            $alOptions['oldCat'] = $alOptions['redirectCat'];
    166158            $alOptions['oldRedirectType'] = $alOptions['redirectType'];
  • anylink/trunk/functions.php

    r846905 r898037  
    137137            update_option( 'anylink_options', $al_option );
    138138        }
     139        if( (float )$al_option['version'] < 19 ) {
     140            global $wp_rewrite;
     141            $wp_rewrite -> flush_rules( true );
     142            add_rewrite_rule( "$cat/([0-9a-z]{4,})/?$", 'index.php?' . $al_option['redirectCat'] . '=$matches[1]', 'top' );
     143            flush_rewrite_rules();
     144            $al_option['version'] = 19;
     145            update_option( 'anylink_options', $al_option );
     146        }
    139147    }       
    140148}
  • anylink/trunk/readme.txt

    r847629 r898037  
    44Tags: seo, link sanitize, covert external links to internal links
    55Requires at least: 3.4
    6 Tested up to: 3.8.1
    7 Stable tag: 0.1.8
     6Tested up to: 3.9
     7Stable tag: 0.1.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141
    4242== Changelog ==
     43
     44= 0.1.9 =
     45*   修改了Javascript跳转方式,不再依赖于.htaccess配置文件
     46*   优化了部分代码,性能得到一定提升
    4347
    4448= 0.1.8 =
Note: See TracChangeset for help on using the changeset viewer.