mauvais lien dans adresse web des personnes qui commentent (Créer un compte)

  • Statut : non résolu
7 sujets de 1 à 7 (sur un total de 7)
  • Auteur
    Messages
  • #466816
    blandine
    Participant
    Padawan WordPress
    70 contributions

    Bonjour,

    Ma configuration WP actuelle
    – Version de WordPress : la derniere
    – Thème utilisé :
    – Plugins en place :
    – Nom de l’hebergeur : ovh
    – Adresse du site : http://www.onlyhappyinthesun.fr

    Problème(s) rencontré(s) :

    Bonjour
    lorsque l’on clique sur le nom de la personne qui a laissé un commentaire, l’adresse du site web est suivi de rel = external follow.

    comment remédier à ce probleme?

    merci

    #659428
    Lumiere de Lune
    Participant
    Maître WordPress
    19365 contributions

    En quoi est ce un problème ? 😉 si ce n’est que la syntaxe est fausse, cela devrait être rel=’external nofollow’ (même quote ouvrante et fermante)

    Cela a l’air de venir de ton plugin pour suivre les clics. Regarde si cela le fait toujours dans le plugin. Sinon ça doit être dans le fichier comments.php

    #659429
    blandine
    Participant
    Padawan WordPress
    70 contributions

    je ne retrouve pas ces mots dans le fichier comment.php

    en plugin, j’ai:

    akismet
    feedburner
    google analyticator
    suscribe to coments
    et wordpress automatic upgrade

    de quel plugin cela viendrait il?

    #659430
    Lumiere de Lune
    Participant
    Maître WordPress
    19365 contributions

    eh bien comme il s’agit d’un plugin qui trace les clics, je pense qu’il doit s’agir d’analyticator.

    #659431
    blandine
    Participant
    Padawan WordPress
    70 contributions

    merci lumière de lune.

    je vais vérifier

    #659432
    blandine
    Participant
    Padawan WordPress
    70 contributions

    voici la page d’analyticator je ne trouve pas ladite formule

    <?php
    /*
     * Plugin Name: Google Analyticator
     * Version: 2.02
     * Plugin URI: http://cavemonkey50.com/code/google-analyticator/
     * Description: Adds the necessary JavaScript code to enable <a href="http://www.google.com/analytics/">Google’s Analytics</a>. After enabling this plugin visit <a href="options-general.php?page=google-analyticator.php">the options page</a> and enter your Google Analytics’ UID and enable logging.
     * Author: Ronald Heft, Jr.
     * Author URI: http://cavemonkey50.com/
     */
    
    // Constants for enabled/disabled state
    define(“ga_enabled”, “enabled”, true);
    define(“ga_disabled”, “disabled”, true);
    
    // Defaults, etc.
    define(“key_ga_uid”, “ga_uid”, true);
    define(“key_ga_status”, “ga_status”, true);
    define(“key_ga_admin”, “ga_admin_status”, true);
    define(“key_ga_extra”, “ga_extra”, true);
    define(“key_ga_extra_after”, “ga_extra_after”, true);
    define(“key_ga_outbound”, “ga_outbound”, true);
    define(“key_ga_downloads”, “ga_downloads”, true);
    define(“key_ga_footer”, “ga_footer”, true);
    
    define(“ga_uid_default”, “XX-XXXXX-X”, true);
    define(“ga_status_default”, ga_disabled, true);
    define(“ga_admin_default”, ga_enabled, true);
    define(“ga_extra_default”, “”, true);
    define(“ga_extra_after_default”, “”, true);
    define(“ga_outbound_default”, ga_enabled, true);
    define(“ga_downloads_default”, “”, true);
    define(“ga_footer_default”, ga_disabled, true);
    
    // Create the default key and status
    add_option(key_ga_status, ga_status_default, ‘If Google Analytics logging in turned on or off.’);
    add_option(key_ga_uid, ga_uid_default, ‘Your Google Analytics UID.’);
    add_option(key_ga_admin, ga_admin_default, ‘If WordPress admins are counted in Google Analytics.’);
    add_option(key_ga_extra, ga_extra_default, ‘Addition Google Analytics tracking options’);
    add_option(key_ga_extra_after, ga_extra_after_default, ‘Addition Google Analytics tracking options’);
    add_option(key_ga_outbound, ga_outbound_default, ‘Add tracking of outbound links’);
    add_option(key_ga_downloads, ga_downloads_default, ‘Download extensions to track with Google Analyticator’);
    add_option(key_ga_footer, ga_footer_default, ‘If Google Analyticator is outputting in the footer’);
    
    // Create a option page for settings
    add_action(‘admin_menu’, ‘add_ga_option_page’);
    
    // Initialize outbound link tracking
    add_action(‘init’, ‘ga_outgoing_links’);
    
    // Hook in the options page function
    function add_ga_option_page() {
    	global $wpdb;
    	add_options_page(‘Google Analyticator Options’, ‘Google Analytics’, 8, basename(__FILE__), ‘ga_options_page’);
    }
    
    // wp_nonce
    if ( !function_exists(‘wp_nonce_field’) ) {
    	function ga_nonce_field($action = -1) { return; }
    	$ga_nonce = -1;
    } else {
    	function ga_nonce_field($action = -1) { return wp_nonce_field($action); }
    	$ga_nonce = ‘ga-update-key’;
    }
    
    function ga_options_page() {
    	// If we are a postback, store the options
     	if (isset($_POST[‘info_update’])) {
    		check_admin_referer(‘$ga_nonce’, $ga_nonce);
    		
    		// Update the status
    		$ga_status = $_POST[key_ga_status];
    		if (($ga_status != ga_enabled) && ($ga_status != ga_disabled))
    			$ga_status = ga_status_default;
    		update_option(key_ga_status, $ga_status);
    
    		// Update the UID
    		$ga_uid = $_POST[key_ga_uid];
    		if ($ga_uid == ”)
    			$ga_uid = ga_uid_default;
    		update_option(key_ga_uid, $ga_uid);
    
    		// Update the admin logging
    		$ga_admin = $_POST[key_ga_admin];
    		if (($ga_admin != ga_enabled) && ($ga_admin != ga_disabled))
    			$ga_admin = ga_admin_default;
    		update_option(key_ga_admin, $ga_admin);
    		
    		// Update the extra tracking code
    		$ga_extra = $_POST[key_ga_extra];
    		update_option(key_ga_extra, $ga_extra);
    		
    		// Update the extra after tracking code
    		$ga_extra_after = $_POST[key_ga_extra_after];
    		update_option(key_ga_extra_after, $ga_extra_after);
    
    		// Update the outbound tracking
    		$ga_outbound = $_POST[key_ga_outbound];
    		if (($ga_outbound != ga_enabled) && ($ga_outbound != ga_disabled))
    			$ga_outbound = ga_outbound_default;
    		update_option(key_ga_outbound, $ga_outbound);
    		
    		// Update the download tracking code
    		$ga_downloads = $_POST[key_ga_downloads];
    		update_option(key_ga_downloads, $ga_downloads);
    		
    		// Update the footer
    		$ga_footer = $_POST[key_ga_footer];
    		if (($ga_footer != ga_enabled) && ($ga_footer != ga_disabled))
    			$ga_footer = ga_footer_default;
    		update_option(key_ga_footer, $ga_footer);
    
    		// Give an updated message
    		echo “<div class='updated'><p><strong>Google Analyticator options updated</strong></p></div>“;
    	}
    
    	// Output the options page
    	?>
    
    		<form method="post" action="options-general.php?page=google-analyticator.php">
    		
    		<div class="wrap">
    			<h2>Google Analyticator Options</h2>
    			<fieldset class='options'>
    				<legend>Basic Options</legend>
    				
    					<div style="margin:10px auto;border:3px #f00 solid;background-color:#fdd;color:#000;padding:10px;text-align:center">
    					Google Analytics integration is currently <strong>DISABLED</strong>.
    					</div>
    				
    				
    					<div style="margin:10px auto;border:3px #f00 solid;background-color:#fdd;color:#000;padding:10px;text-align:center">
    					Google Analytics integration is currently enabled, but you did not enter a UID. Tracking will not occur.
    					</div>
    				
    				<table class="editform" cellspacing="2" cellpadding="5" width="100%">
    					<tr>
    						<th width="30%" valign="top" style="padding-top: 10px">
    							<label for="”>Google Analytics logging is:</label>
    						</th>
    						<td>
    							<?php
    							echo "n”;
    							
    							echo “Enabledn”;
    							
    							echo “Disabledn”;
    							
    							echo “n”;
    							?>
    						</td>
    					</tr>
    					<tr>
    						<th valign="top" style="padding-top: 10px">
    							<label for="”>Your Google Analytics’ UID:</label>
    						</th>
    						<td>
    							<?php
    							echo "n”;
    							?>
    							<p style="margin: 5px 10px">Enter your Google Analytics’ UID in this box. The UID is needed for Google Analytics to log your website stats. Your UID can be found by looking in the JavaScript Google Analytics gives you to put on your page. Look for your UID in between <strong>_uacct = “UA-11111-1”;</strong> in the JavaScript. In this example you would put <strong>UA-11111-1</strong> in the UID box.</p>
    						</td>
    					</tr>
    				</table>
    			</fieldset>
    			<fieldset class='options'>
    				<legend>Advanced Options</legend>
    					<table class="editform" cellspacing="2" cellpadding="5" width="100%">
    					<tr>
    						<th width="30%" valign="top" style="padding-top: 10px">
    							<label for="”>WordPress admin logging:</label>
    						</th>
    						<td>
    							<?php
    							echo "n”;
    							
    							echo “Enabledn”;
    							
    							echo “Disabledn”;
    							
    							echo “n”;
    							?>
    							<p style="margin: 5px 10px">Disabling this option will prevent all logged in WordPress admins from showing up on your Google Analytics reports. A WordPress admin is defined as a user with a level 8 or higher. Your user level .</p>
    						</td>
    					</tr>
    					<tr>
    						<th width="30%" valign="top" style="padding-top: 10px">
    							<label for="”>Footer tracking code:</label>
    						</th>
    						<td>
    							<?php
    							echo "n”;
    							
    							echo “Enabledn”;
    							
    							echo “Disabledn”;
    							
    							echo “n”;
    							?>
    							<p style="margin: 5px 10px">Enabling this option will insert the Google Analytics tracking code in your site’s footer instead of your header. This will speed up your page loading if turned on. Not all themes support code in the footer, so if you turn this option on, be sure to check the Analytics code is still displayed on your site.</p>
    						</td>
    					</tr>
    					<tr>
    						<th width="30%" valign="top" style="padding-top: 10px">
    							<label for="”>Outbound link tracking:</label>
    						</th>
    						<td>
    							<?php
    							echo "n”;
    							
    							echo “Enabledn”;
    							
    							echo “Disabledn”;
    							
    							echo “n”;
    							?>
    							<p style="margin: 5px 10px">Disabling this option will turn off the tracking of outbound links. It’s recommended not to disable this option unless you’re a privacy advocate (now why would you be using Google Analytics in the first place?) or it’s causing some kind of weird issue.</p>
    						</td>
    					</tr>
    					<tr>
    						<th valign="top" style="padding-top: 10px">
    							<label for="”>Download extensions to track:</label>
    						</th>
    						<td>
    							<?php
    							echo "n”;
    							?>
    							<p style="margin: 5px 10px">Enter any extensions of files you would like to be tracked as a download. For example to track all MP3s and PDFs enter <strong>mp3,pdf</strong>. <em>Outbound link tracking must be enabled for downloads to be tracked.</em></p>
    						</td>
    					</tr>
    					<tr>
    						<th valign="top" style="padding-top: 10px">
    							<label for="”>Additional tracking code<br />(before tracker initialization):</label>
    						</th>
    						<td>
    							<?php
    							echo "<textarea cols='50' rows='8'>“;
    							echo stripslashes(get_option(key_ga_extra)).”</textarea>n”;
    							?>
    							<p style="margin: 5px 10px">Enter any additional lines of tracking code that you would like to include in the Google Anayltics tracking script. The code in this section will be displayed <strong>before</strong> the Google Analytics tracker is initialized. Read <a href="http://www.google.com/analytics/InstallingGATrackingCode.pdf">Google Analytics tracker manual</a> to learn what code goes here and how to use it.</p>
    						</td>
    					</tr>
    					<tr>
    						<th valign="top" style="padding-top: 10px">
    							<label for="”>Additional tracking code<br />(after tracker initialization):</label>
    						</th>
    						<td>
    							<?php
    							echo "<textarea cols='50' rows='8'>“;
    							echo stripslashes(get_option(key_ga_extra_after)).”</textarea>n”;
    							?>
    							<p style="margin: 5px 10px">Enter any additional lines of tracking code that you would like to include in the Google Anayltics tracking script. The code in this section will be displayed <strong>after</strong> the Google Analytics tracker is initialized. Read <a href="http://www.google.com/analytics/InstallingGATrackingCode.pdf">Google Analytics tracker manual</a> to learn what code goes here and how to use it.</p>
    						</td>
    					</tr>
    					</table>
    			</fieldset>
    			<p class="submit">
    				
    			</p>
    		</div>
    		</form>
    
    <?php
    }
    
    // Add the script
    if (get_option(key_ga_footer) == ga_enabled) {
    	add_action('wp_footer', 'add_google_analytics');
    } else {
    	add_action('wp_head', 'add_google_analytics');
    }
    
    // The guts of the Google Analytics script
    function add_google_analytics() {
    	$uid = stripslashes(get_option(key_ga_uid));
    	$extra = stripslashes(get_option(key_ga_extra));
    	$extra_after = stripslashes(get_option(key_ga_extra_after));
    	$extensions = str_replace (",", "|", get_option(key_ga_downloads));
    	
    	// If GA is enabled and has a valid key
    	if ((get_option(key_ga_status) != ga_disabled) && ($uid != "XX-XXXXX-X")) {
    		
    		// Track if admin tracking is enabled or disabled and less than user level 8
    		if ((get_option(key_ga_admin) == ga_enabled) || ((get_option(key_ga_admin) == ga_disabled) && ( !current_user_can('level_8') ))) {
    			
    			echo "<!-- Google Analytics Tracking by Google Analyticator: http://cavemonkey50.com/code/google-analyticator/ -->n”;
    			echo ”	n”;
    			echo ”		var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);n”;
    			echo ”		document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));n”;
    			echo ”	nn”;
    			
    			echo ”	n”;
    			echo ”		var pageTracker = _gat._getTracker(“$uid”);n”;
    			
    			// Insert extra before tracker code
    			if ( ” != $extra )
    				echo ”		” . $extra . “n”;
    			
    			// Initialize the tracker
    			echo ”		pageTracker._initData();n”;
    			echo ”		pageTracker._trackPageview();n”;
    			
    			// Insert extra after tracker code
    			if ( ” != $extra_after )
    				echo ”		” . $extra_after . “n”;
    			
    			echo ”	n”;
    		}
    	}
    }
    
    // Add the ougoing links script
    function ga_outgoing_links() {
    	if (get_option(key_ga_outbound) == ga_enabled) {
    		if ((get_option(key_ga_admin) == ga_enabled) || ((get_option(key_ga_admin) == ga_disabled) && ( !current_user_can(‘level_8’) ))) {
    			add_filter(‘comment_text’, ‘ga_outgoing’, 1000);
    			add_filter(‘get_comment_author_link’, ‘ga_outgoing_comment_author’, 1000);
    			add_filter(‘the_content’, ‘ga_outgoing’, 1000);
    			add_filter(‘the_excerpt’, ‘ga_outgoing’, 1000);
    		}
    	}
    }
    
    // Finds all the links contained in a post or comment
    function ga_outgoing($input) {
    	static $link_pattern = ‘/<a>(.*?)</a>/i’;
    	static $link_pattern_2 = ‘/<a>(.*?)</a>/i’;
    	$input = preg_replace_callback($link_pattern, ga_parse_link, $input);
    	$input = preg_replace_callback($link_pattern_2, ga_parse_link, $input);
    	return $input;
    }
    
    // Takes the comment author link and adds the Google outgoing tracking code
    function ga_outgoing_comment_author($input) {
    	static $link_pattern = ‘(.*hrefs*=s*)[“‘]*(.*)[“‘] (.*)’;
    	ereg($link_pattern, $input, $matches);
    	if ($matches[2] == “”) return $input;
    	
    	$target = ga_find_domain($matches[2]);
    	$local_host = ga_find_domain($_SERVER[“HTTP_HOST”]);
    	if ( $target[“domain”] != $local_host[“domain”]  ){
    		$tracker_code .= “onclick=”javascript:pageTracker._trackPageview (‘/outbound/”.$target[“host”].”‘);””;
    	}
    	return $matches[1] . “”” . $matches[2] . “” ” . $tracker_code . ” ” . $matches[3];
    }
    
    // Takes a link and adds the Google outgoing tracking code
    function ga_parse_link($matches){
    	$local_host = ga_find_domain($_SERVER[“HTTP_HOST”]);
    	$target = ga_find_domain($matches[3]);
    	$url = $matches[3];
    	$file_extension = strtolower(substr(strrchr($url,”.”),1));
    	if ( $target[“domain”] != $local_host[“domain”]  ){
    		$tracker_code .= ” onclick=”javascript:pageTracker._trackPageview (‘/outbound/”.$target[“host”].”‘);””;
    	}
    	if ( ($target[“domain”] == $local_host[“domain”])  && (ga_check_download($file_extension)) ){
    		$url = strtolower(substr(strrchr($url,”/”),1));
    		$tracker_code .= ” onclick=”javascript:pageTracker._trackPageview (‘/downloads/”.$file_extension.”/”.$url.”‘);””;
    	}
    	// Properly format additional code
    	if ( $matches[1] != ” ) {
    		$matches[1] = ‘ ‘. trim($matches[1]);
    	}
    	if ( $matches[4] != ” ) {
    		$matches[4] = ‘ ‘. trim($matches[4]);
    	}	
    	
    	return ‘<a>‘ . $matches[5] . ‘</a>‘;    
    }
    
    // Checks to see if the link is on your site
    function ga_find_domain($url){
    	$host_pattern = “/^(http://)?([^/]+)/i”;
    	$domain_pattern = “/[^./]+.[^./]+$/”;
    
    	preg_match($host_pattern, $url, $matches);
    	$host = $matches[2];
    	preg_match($domain_pattern, $host, $matches);
    	return array(“domain”=>$matches[0],”host”=>$host);    
    }
    
    // Checks to see if the requested URL is a download
    function ga_check_download($file_extension){
    	if (get_option(key_ga_downloads)){
    		$extensions = explode(‘,’, stripslashes(get_option(key_ga_downloads)));
    	
    		foreach ($extensions as $extension) {
    			if ($extension == $file_extension)
    				return true;
    		}
    	}
    }
    
    ?>

    #659433
    Lumiere de Lune
    Participant
    Maître WordPress
    19365 contributions

    Code (le carré avec le C c’est mieux que la citation pour mettre du code.
    Si ce n’est pas là dedans, c’est quelque part dans les fichiers comment ou comments de ton thème

7 sujets de 1 à 7 (sur un total de 7)
  • Vous devez être connecté pour répondre à ce sujet.