• Resolved Ron Strilaeff

    (@ronstrilaeff)


    The icons were not loading in this trackable social share icons plugin.

    I seems the value of $_SERVER['HTTPS'] is “off” but the logic of the functions _trackableshare_buildurl() and _trackableshare_setpaths in the index.php file was changing the “http” to “https” anyways. That created a non-existent url for the icon image file.

    So in order to make the icons show up I replaced that chunk of code with this ('on' == strtolower($_SERVER['HTTPS']))

    I don’t know why this was happening on my site but maybe it’s because I’m using WP Multisite, or something is funky with my redirects within my shared host or something. I hope this helps someone.

    https://www.ads-software.com/extend/plugins/trackable-social-share-icons/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author EcreativeIM

    (@ecreativeim)

    This is a known issue with certain versions of Windows servers (which we don’t support) — which I’m guessing is why you’re seeing it.

    Thread Starter Ron Strilaeff

    (@ronstrilaeff)

    Yeah I read a bit about that, but since I’m on bluehost which uses Linux and Apache (near bottom of page), that’s probably not the issue. I used to have an SSL setup with them so maybe there is some strange artifact getting picked up. It is not a problem for me anymore since I modified that bit of code.

    @ronstrilaeff – would be so kind as to help a php nob? Where in the below code does your fix (('on' == strtolower($_SERVER['HTTPS'])) belong?

    // Return Current URL
    	function _trackableshare_buildurl() {
    		return 'http'.($_SERVER['HTTPS']?'s':'').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    	}
    
    	// Return Button Paths
    	function _trackableshare_setpaths($file,$admin=false) {
    		if($file == 'custom') {
    			$path = WP_CONTENT_DIR.'/uploads/trackableshare/';
    			$url = ($_SERVER['HTTPS']?str_replace('https://','https://',WP_CONTENT_URL):WP_CONTENT_URL).'/uploads/trackableshare/';
    		} else {
    			$path = ($admin?'../':'').TRACKABLESHARE_PLUGINS.'/'.TRACKABLESHARE_DIRNAME.'/buttons/'.$file.'/';
    			$url = ($_SERVER['HTTPS']?str_replace('https://','https://',WP_PLUGIN_URL):WP_PLUGIN_URL).'/'.TRACKABLESHARE_DIRNAME.'/buttons/'.$file.'/';
    		}
    		return array($path,$url);
    	}

    Thank you!

    Thread Starter Ron Strilaeff

    (@ronstrilaeff)

    Hi dpaule..

    See the lines below //ronedit
    Hope this helps.

    // Return Current URL
    	function _trackableshare_buildurl() {
    		//ronedit replaced by line below return 'http'.($_SERVER['HTTPS']?'s':'').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    		//ronedit this plugin always thinks that my site is https even when it is not
    		return 'http'.(('on' == strtolower($_SERVER['HTTPS']))?'s':'').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    	}
    // Return Button Paths
    	function _trackableshare_setpaths($file,$admin=false) {
    		if($file == 'custom') {
    			$path = WP_CONTENT_DIR.'/uploads/trackableshare/';
    		        //ronedit replaced by line below $url = ($_SERVER['HTTPS']?str_replace('https://','https://',WP_CONTENT_URL):WP_CONTENT_URL).'/uploads/trackableshare/';
    			$url = (('on' == strtolower($_SERVER['HTTPS']))?str_replace('https://','https://',WP_CONTENT_URL):WP_CONTENT_URL).'/uploads/trackableshare/';
    		} else {
    			$path = ($admin?'../':'').TRACKABLESHARE_PLUGINS.'/'.TRACKABLESHARE_DIRNAME.'/buttons/'.$file.'/';
    			//ronedit replaced by line below $url = ($_SERVER['HTTPS']?str_replace('https://','https://',WP_PLUGIN_URL):WP_PLUGIN_URL).'/'.TRACKABLESHARE_DIRNAME.'/buttons/'.$file.'/';
    			$url = (('on' == strtolower($_SERVER['HTTPS']))?str_replace('https://','https://',WP_PLUGIN_URL):WP_PLUGIN_URL).'/'.TRACKABLESHARE_DIRNAME.'/buttons/'.$file.'/';
    		}
    		return array($path,$url);
    	}

    oh, and btw .. the correct spelling is “nub” and I are one ??

    Yea! It works beautifully. Thank you for sharing your fix. Nub, yes. Shows what a nub I really am.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Trackable Social Share Icons] It wrongly thinks my site uses https’ is closed to new replies.