WordPress.org

Plugin Directory

Changeset 690134


Ignore:
Timestamp:
04/01/13 15:46:17 (13 months ago)
Author:
Strictly Software
Message:

Fixed bugs from last release

Location:
strictly-autotags/trunk
Files:
2 edited

Legend:

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

    r689459 r690134  
    66Requires at least: 2.0.2                     
    77Tested up to: 3.4.2 
    8 Stable tag: 2.8.3 
     8Stable tag: 2.8.4 
    99 
    1010Strictly AutoTags is a plugin that automatically adds the most relevant tags to posts. 
     
    190190* Fixed bug that prevented noise words with the digit 0 from being saved. 
    191191* Removed some code 
     192 
     193= 2.8.4 = 
     194* Fixed bug that was breaking new code with href="/blah title= 
     195* Fixed code that wasn't adding in the trailing slash to the permalink if it was set for site 
     196* Split code to store href/src/title/alt into 2 one for single quotes ' and one for double " 
  • strictly-autotags/trunk/strictlyautotags.class.php

    r689960 r690134  
    33/** 
    44 * Plugin Name: Strictly Auto Tags 
    5  * Version: 2.8.3 
     5 * Version: 2.8.4 
    66 * Plugin URI: http://www.strictly-software.com/plugins/strictly-auto-tags/ 
    77 * Description: This plugin automatically detects tags to place against posts using existing tags as well as a simple formula that detects common tag formats such as Acronyms, names and countries. Whereas other smart tag plugins only detect a single occurance of a tag within a post this plugin will search for the most used tags within the content so that only the most relevant tags get added. 
     
    2626    * @var string 
    2727    */ 
    28     protected $version = "2.8.2"; 
     28    protected $version = "2.8.4"; 
    2929 
    3030    /** 
     
    283283        // set a function to run whenever posts are saved that will call our AutoTag function 
    284284        add_action('save_post'              , array(&$this, 'SaveAutoTags'),1); 
    285          
     285        //add_action('publish_post'         , array(&$this, 'SaveAutoTags'),1); 
     286        //add_action('post_syndicated_item' , array(&$this, 'SaveAutoTags'),1); 
     287 
    286288 
    287289    } 
     
    591593        } 
    592594 
     595         
     596 
     597        ShowDebugAutoTag("look at how it would appear"); 
     598         
    593599 
    594600        ShowDebugAutoTag("BOLDED RETURNS $content"); 
     
    634640            $this->addtrailingslash = $wp_rewrite->use_trailing_slashes; 
    635641 
    636             ShowDebugAutoTag("tag permalink structure is $taglink"); 
     642            ShowDebugAutoTag("tag permalink structure is $taglink do we add trailing slashes = " . intval($wp_rewrite->use_trailing_slashes)); 
    637643 
    638644            // ensure the start of the tag rewrite url has a / as for some reason 3.0+ stopped adding it 
     
    645651 
    646652            // set tag placeholder           
    647             $tagplaceholder = ($this->addtrailingslash) ? $taglink ."/" : $taglink; 
     653            $tagplaceholder = ($this->addtrailingslash) ? ( $taglink ."/") : $taglink; 
     654 
     655            ShowDebugAutoTag("tag placeholder is $tagplaceholder"); 
     656 
    648657            $siteurl    = untrailingslashit(get_option('siteurl')); 
    649658 
     
    680689                    $actualtitle = preg_replace("@%tag%@i",$tag->name,$this->deeplinktitle); 
    681690                    $actualtitle = preg_replace("@%post_tag%@i",$tag->name,$actualtitle); 
    682                     $actualurl   = $siteurl . preg_replace('@%tag%@i',$tag->slug,$taglink); 
     691 
     692                    ShowDebugAutoTag("replace %tag% with " . $tag->slug . " in " . $tagplaceholder); 
     693 
     694                    $actualurl   = $siteurl . preg_replace('@%tag%@i',$tag->slug,$tagplaceholder); 
    683695                    $actualurl   = preg_replace('@%post_tag%@i',$tag->slug,$actualurl); 
    684696 
     697                    ShowDebugAutoTag("actual url is now $actualurl"); 
    685698 
    686699                    ShowDebugAutoTag("did we already bold = " . intval($this->boldtaggedwords)); 
     
    689702                    if($this->boldtaggedwords){                      
    690703 
    691                         $link = '<a class="StrictlyAutoTagAnchor" href="' . $actualurl . ' title="' . $actualtitle . '">' . $tag->name . '</a>'; 
     704                        $link = '<a class="StrictlyAutoTagAnchor" href="' . $actualurl . '" title="' . $actualtitle . '">' . $tag->name . '</a>'; 
    692705 
    693706                        $regex = "@<strong class='StrictlyAutoTagBold'>" . preg_quote($tag->name) . "</strong>@i";                       
     
    706719                        // easier to do a positive match than a negative especially with nested matches 
    707720 
    708                         $link = '<a class="StrictlyAutoTagAnchor" href="' . $actualurl . ' title="' . $actualtitle . '">$1</a>'; 
     721                        $link = '<a class="StrictlyAutoTagAnchor" href="' . $actualurl . '" title="' . $actualtitle . '">$1</a>'; 
    709722 
    710723                         
     
    754767    protected function StoreContent($content, $dir) 
    755768    { 
    756         // works on my PC but not on Wordpress? 
    757         return $content; 
    758  
     769        // works on my test page on my PC but not on Wordpress why? I have no idea? 
     770        //return $content; 
     771         
    759772        ShowDebugAutoTag("IN StoreContent direction = $dir"); 
    760773         
    761774        if($dir == "STORE") 
    762775        { 
    763             preg_match_all('@((?:title|src|href|alt)\s?=\s?[\'"])([\s\S]+?)([\'"])@',$content,$matches,PREG_SET_ORDER); 
     776            preg_match_all('@((?:title|src|href|alt)\s?=\s?)(")([\s\S]*?)(")@',$content,$matches,PREG_SET_ORDER); 
     777            $x = 0; 
    764778 
    765779            if($matches) 
    766780            { 
    767                 $x = 0; 
     781                 
    768782                foreach($matches as $match) 
    769783                { 
     
    780794            } 
    781795 
     796            preg_match_all("@((?:title|src|href|alt)\s?=\s?)(')([\s\S]*?)(')@",$content,$matches,PREG_SET_ORDER); 
     797             
     798            if($matches) 
     799            { 
     800                 
     801                foreach($matches as $match) 
     802                { 
     803                    $word = $match[0]; 
     804 
     805                    ShowDebugAutoTag("store match $word"); 
     806 
     807                    $this->storage[] = $word; 
     808 
     809                    $content = str_replace($word, "##M".$x."##", $content); 
     810                    $x++; 
     811                } 
     812            } 
     813 
    782814            ShowDebugAutoTag($href); 
    783815 
     
    793825                foreach($this->storage as $match) 
    794826                { 
    795                     ShowDebugAutoTag("replace match $match[0]"); 
    796  
    797                     $word = $match; 
    798                     $content = str_replace( "##M".$x."##",$word, $content); 
     827                     
     828                    ShowDebugAutoTag("put $match back in ##M".$x."##"); 
     829             
     830 
     831                    $content = str_replace( "##M".$x."##",$match, $content); 
    799832                    $x++; 
     833 
     834                    ShowDebugAutoTag("now content = $content"); 
    800835                } 
    801836            } 
     
    26722707                    <p>'.__('If you enjoy using this Wordpress plugin you might be interested in some other websites, tools and plugins I have      developed.', 'strictlyautotags').'</p> 
    26732708                    <ul> 
    2674                         <li><a href="http://www.strictly-software.com/applications/twitter-hash-tag-hunter">'.__('Strictly Twitter Hash Tag Hunter','strictlyautotags').'</a> 
    2675                             <p>'.__('Strictly Twitter Hash Tag Hunter is a windows application that lets you find out the hash tags and followers you should be tweeting to. Used mostly with my Tweetbot it is great for new site owners to find out what hash tags people use for the search terms and keywords their site ranks for and then easily find the key Tweeters using those hash tags. With proxy and timeout features this multi threaded application is great for SEO and advertising your website.','strictlyautotags').'</p> 
     2709                        <li><a href="http://www.strictly-software.com/plugins/strictly-google-sitemap">'.__('Strictly Google Sitemap','strictlyautotags').'</a> 
     2710                            <p>'.__('Strictly Google Sitemap is a feature rich Wordpress plugin built for sites requiring high performance. Not only does it use a tiny number of database queries compared to other plugins it uses less memory and was designed specifically for under performing or low spec systems. As well as offering all the features of other sitemap plugins it brings all those missing features such as sitemap index files, XML validation, scheduled builds, configuration analysis and SEO reports.','strictlyautotags').'</p> 
    26762711                        </li> 
    26772712                        <li><a href="http://wordpress.org/extend/plugins/strictly-tweetbot/">'.__('Strictly Tweetbot','strictlyautotags').'</a> 
Note: See TracChangeset for help on using the changeset viewer.