Title: [Plugin: ShareThis] does not validate
Last modified: August 19, 2016

---

# [Plugin: ShareThis] does not validate

 *  [Calen Fretts](https://wordpress.org/support/users/frettsy/)
 * (@frettsy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-sharethis-does-not-validate/)
 * attributes “st_url”, “st_title”, and “displayText” do not validate at W3C. this
   is a big issue and I will have to use an older version of the plugin until this
   is fixed.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [stevehodson](https://wordpress.org/support/users/stevehodson/)
 * (@stevehodson)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-sharethis-does-not-validate/#post-1838713)
 * in sharethis.php rename the .js file in this line to .php `$opt_js_location=$
   plugin_location."wp_st_opt.js";` found on line 458
 * then rename the file wp_st_opt.js to wp_st_opt.php
 * here is my wp_st_opt.php file
    note the script reference on line 1 and line 124
   and the php edit on line 77
 *     ```
       <script type="text/x-javascript">if (!window.console || !console.firebug) {
       	var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd",
       				 "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
       	window.console = {};
       	for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
       }
   
       var startPos=1;
   
       function getStartPos(){
       	var arr=[];
       	arr['_large']=1;
       	arr['_hcount']=2;
       	arr['_vcount']=3;
       	arr['classic']=4;
       	arr['chicklet']=5;
       	arr['chicklet2']=6;
       	arr['_buttons']=7;
       	if(typeof(arr[st_current_type])!=="undefined"){
       		startPos=arr[st_current_type];
       	}
       }
   
       jQuery(document).ready(function() {
       	getStartPos();
       	if(/updated=true/.test(document.location.href)){
       		$('#st_updated').show();
       	}
           jQuery("#carousel").jcarousel({
       		size:7,
       		scroll:1,
       		visible:1,
       		start:startPos,
       		wrap:"circular",
       		itemFirstInCallback: {
       		  onAfterAnimation: carDoneCB
       		},
       		itemFallbackDimension:460
       	});
   
       	$('#st_services').bind('keyup', function(){
       		clearTimeout(stkeytimeout);
       		stkeytimeout=setTimeout(function(){makeTags();},500);
       	})
   
       	$('#st_pkey').bind('keyup', function(){
       		clearTimeout(stpkeytimeout);
       		stpkeytimeout=setTimeout(function(){makeHeadTag();},500);
       	})
   
       });
   
       var stkeytimeout=null;
       var stpkeytimeout=null;
   
       function makeHeadTag(){
       	var val=$('#st_pkey').val();
       	var tag=$('#st_widget').val();
       	var reg=new RegExp("(publisher:)('|\")(.*?)('|\")",'gim');
       	var b=tag.replace(reg,'$1$2'+val+'$4');
       	$('#st_widget').val(b);
       }
   
       function makeTags(){
       	var services=$('#st_services').val();
       	var type=$('#curr_type').html();
       	svc=services.split(",");
       	var tags=""
       	var dt="displayText='share'";
       	if(type=="chicklet2"){
       		dt="";
       	}else if(type=="classic"){
       		tags="<?php echo '<span class='.'"st_sharethis"'.'title="{title}" url='.'"{url}"'.'displayText='.'"ShareThis"'.'></span> '?>
   
       		$('#st_tags').val(tags);
       		return true;
       	}
       	if(type=="chicklet" || type=="chicklet2" || type=="classic"){
       		type="";
       	}
       	for(var i=0;i<svc.length;i++){
       		if(svc[i].length>2){
       			tags+="<span class='st_"+svc[i]+type+"' st_title='{TITLE}' st_url='{URL}' "+dt+"></span>";
       		}
       	}
       	$('#st_tags').val(tags);
   
       }
   
       function carDoneCB(a,elem){
       	var type=elem.getAttribute("st_type");
       	$('.services').show()
       	if(type=="vcount"){
       		$('#curr_type').html("_vcount");$("#st_current_type").val("_vcount");
       		$('#currentType').html("<span class='type_name'>Vertical Count</span>");
       	}else if(type=="hcount"){
       			$('#curr_type').html("_hcount");$("#st_current_type").val("_hcount");
       			$('#currentType').html("<span class='type_name'>Horizontal Count</span>");
       	}else if(type=="buttons"){
       			$('#curr_type').html("_buttons");$("#st_current_type").val("_buttons");
       			$('#currentType').html("<span class='type_name'>Buttons</span>");
       	}else if(type=="large"){
       			$('#curr_type').html("_large");$("#st_current_type").val("_large");
       			$('#currentType').html("<span class='type_name'>Large Icons</span>");
       	}else if(type=="chicklet"){
       			$('#curr_type').html("chicklet");$("#st_current_type").val("chicklet");
       			$('#currentType').html("<span class='type_name'>Regular Buttons</span>");
       	}else if(type=="chicklet2"){
       			$('#curr_type').html("chicklet2");$("#st_current_type").val("chicklet2");
       			$('#currentType').html("<span class='type_name'>Regular Buttons No-Text</span>");
       	}else if(type=="sharethis"){
       			$('.services').hide();
       			$('#curr_type').html("classic");$("#st_current_type").val("classic");
       			$('#currentType').html("<span class='type_name'>Classic</span>");
       	}
       	makeTags();
       }
   
       </script>
       ```
   
 * it validates for me. hope that helps
 *  [photocurio](https://wordpress.org/support/users/photocurio/)
 * (@photocurio)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-sharethis-does-not-validate/#post-1838760)
 * I made these same changes and it made no difference, except for messing up sharethis’
   admin screen.
 * This post on Sharethis’ own support forum seems to indicate it was a programming
   choice and that they intentionally dropped validation:
    [W3C Validator error](http://forums.sharethis.com/topic.php?id=3183).
 * Astoundingly sloppy!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: ShareThis] does not validate’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/share-this_b9babb.svg)
 * [ShareThis: Free Sharing Buttons and Tools](https://wordpress.org/plugins/share-this/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/share-this/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/share-this/)
 * [Active Topics](https://wordpress.org/support/plugin/share-this/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/share-this/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/share-this/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [photocurio](https://wordpress.org/support/users/photocurio/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-sharethis-does-not-validate/#post-1838760)
 * Status: not resolved