WordPress.org

Plugin Directory

Changeset 742250


Ignore:
Timestamp:
07/17/13 11:17:54 (9 months ago)
Author:
Strictly Software
Message:

Try to fix issue that some people have complained of which seems to make src/href attributes get mixed up. Unsetting storage array and wrapping class init to create a singleton to see if that helps fix the problem (which I cannot replicate)

Location:
strictly-autotags/trunk
Files:
3 edited

Legend:

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

    r690134 r742250  
    192192 
    193193= 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 " 
     194* Try to fix unknown issue that I cannot replicate which people are saying is changing their links/href/src tags. If there is a problem I can only imagine it to be in the storage array which holds these values to prevent tagging by mistake. I am unsetting the array before and after storing/replacing to see if that will help. 
     195* Also wrapping the init of the class in a static class so that if the object is loaded multiple times there is only a singleton not multiple instances. This might help as well. 
  • strictly-autotags/trunk/strictlyautotagfuncs.php

    r689459 r742250  
    44*/ 
    55 
    6 //error_reporting(E_ERROR); 
     6error_reporting(E_ERROR); 
    77 
    88// set up constants used by the AutoTag method 
     
    3434         
    3535        // put your IP here 
    36         if($ip == "81.333.22.86"){ 
    37             return true; 
     36        if($ip == "86.4.248.185"){ 
     37            return false; 
    3838        }else{ 
    3939            return false; 
     
    4949    if(!defined('DEBUGAUTOTAG')){ 
    5050        if(me()){ 
    51             define('DEBUGAUTOTAG',false); 
     51            define('DEBUGAUTOTAG',true); 
    5252        }else{ 
    5353            define('DEBUGAUTOTAG',false); 
  • strictly-autotags/trunk/strictlyautotags.class.php

    r690134 r742250  
    774774        if($dir == "STORE") 
    775775        { 
     776            // kill any existing array contents which might be left around due to Wordpress keeping the class in memory 
     777            // between page loads/imports/edits or whatever which "may" cause the values of a previous article stored in the  
     778            // content hash to be used for another article (not proven just guessing) 
     779             
     780            unset($this->storage); 
     781             
    776782            preg_match_all('@((?:title|src|href|alt)\s?=\s?)(")([\s\S]*?)(")@',$content,$matches,PREG_SET_ORDER); 
    777783            $x = 0; 
     
    837843             
    838844            ShowDebugAutoTag("after put content back"); 
     845 
     846            // clean out array again just to be sure! 
     847            unset($this->storage); 
    839848        } 
    840849 
     
    27382747class StrictlyAutoTagControl{ 
    27392748 
     2749     
     2750    private static $StrictlyAutoTag; 
     2751 
     2752 
     2753    /** 
     2754     * Init is called on every page not just when the plugin is activated and creates an instance of my strictly autotag class if it doesn't already exist 
     2755     * 
     2756     */ 
     2757    public static function Init(){ 
     2758         
     2759        if(!isset(StrictlyAutoTagControl::$StrictlyAutoTag)){ 
     2760            // create class and all the good stuff that comes with it 
     2761            StrictlyAutoTagControl::$StrictlyAutoTag = new StrictlyAutoTags();  
     2762        } 
     2763 
     2764    } 
     2765     
    27402766    /** 
    27412767     * Called when plugin is deactivated and removes all the settings related to the plugin 
     
    28022828register_deactivation_hook(__FILE__, 'StrictlyAutoTagControl::Deactivate'); 
    28032829 
     2830add_action('init', 'StrictlyAutoTagControl::Init'); 
     2831 
    28042832// create auto tag object 
    2805 $strictlyautotags = new StrictlyAutoTags(); 
     2833//$strictlyautotags = new StrictlyAutoTags(); 
    28062834 
    28072835?> 
Note: See TracChangeset for help on using the changeset viewer.