<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>piouPiouM&#039;s dev&#187; Archives pour le tag google – piouPiouM&#039;s dev</title>
	<atom:link href="http://pioupioum.fr/tag/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://pioupioum.fr</link>
	<description>Bloc-note d&#039;un développeur web</description>
	<lastBuildDate>Fri, 23 Dec 2011 23:41:36 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WordPress&#160;: forcer le chargement de jQuery en bas de page</title>
		<link>http://pioupioum.fr/snippets/wordpress-forcer-chargement-jquery-footer.html</link>
		<comments>http://pioupioum.fr/snippets/wordpress-forcer-chargement-jquery-footer.html#comments</comments>
		<pubDate>Thu, 09 Sep 2010 13:45:08 +0000</pubDate>
		<dc:creator>piouPiouM</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://pioupioum.fr/?p=442</guid>
		<description><![CDATA[Le snippet qui suit ne se limite pas à forcer le chargement de jQuery en pied de page. Il permet également de remplacer la version locale à l&#8217;installion WordPress par une version équivalente, mais servie par le service Google Libraries API.

Si un script tierce remplace la version jQuery, son chargement sera forcé en bas de [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Le snippet qui suit ne se limite pas à forcer le <strong>chargement de jQuery</strong> en pied de page. Il permet également de remplacer la version locale à l&#8217;installion WordPress par une version équivalente, mais servie par le service <strong><a href="http://code.google.com/intl/fr-FR/apis/libraries/devguide.html#jquery" title="Google Libraries API - Developer&#39;s Guide - Google Libraries API - Google Code">Google Libraries API</a></strong>.</p>

<p>Si un script tierce remplace la version jQuery, son <strong>chargement</strong> sera <strong>forcé</strong> en <strong>bas de page</strong>.</p>

<p>Bien évidemment, il est aisé d&#8217;adapter ce snippet pour n&#8217;importe quel autre fichier JavaScript.
<span id="more-442"></span></p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * Force load jQuery in the footer.
 *
 * @param boolean $google Set to true for load jQuery from the
 *                        Google Libraries Api servers. Default to false.
 * @global WP_Scripts $wp_scripts
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> forcejQueryInFooter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$google</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Do not apply in the WordPress admin Panel.</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_scripts</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_a</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_scripts</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'WP_Scripts'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$wp_scripts</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Scripts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000088;">$jquery</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_scripts</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'registered'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">!==</span> <span style="color: #000088;">$jquery</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$jquery_google</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://ajax.googleapis.com/ajax/libs/jquery/%s/jquery.min.js'</span><span style="color: #339933;">;</span>
        wp_deregister_script<span style="color: #009900;">&#40;</span><span style="color: #000088;">$jquery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        wp_register_script<span style="color: #009900;">&#40;</span>
            <span style="color: #000088;">$jquery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handle</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#40;</span><span style="color: #000088;">$google</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$jquery_google</span><span style="color: #339933;">,</span> <span style="color: #000088;">$jquery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ver</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$jquery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">src</span><span style="color: #339933;">,</span>
            <span style="color: #000088;">$jquery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">deps</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#40;</span><span style="color: #000088;">$google</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">null</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$jquery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ver</span><span style="color: #339933;">,</span>
            <span style="color: #009900; font-weight: bold;">true</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Force load jQuery in the footer from the Google Libraries Api servers.
 *
 * @see forcejQueryInFooter()
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> forcejQueryGoogleLibrariesApiInFooter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    forcejQueryInFooter<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_enqueue_scripts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'forcejQueryGoogleLibrariesApiInFooter'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">101</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<p>Remplacez <code>forcejQueryGoogleLibrariesApiInFooter</code> par <code>forcejQueryInFooter</code> dans l&#8217;ajout d&#8217;action à <code>wp_enqueue_scripts</code> pour utiliser la version de jQuery livrée avec <strong>WordPress</strong>.</p>

<h3 class='related_post_title'>Continuez votre lecture sur des sujets similaires</h3>

<ul class='related_post'><li><a href='http://pioupioum.fr/plugins-wordpress/wordpress-jquery-ui-effects.html' title='WordPress jQuery UI Effects'>WordPress jQuery UI Effects</a></li><li><a href='http://pioupioum.fr/outils-astuces/wordpress-shortcode-afficher-fichiers-joints.html' title='Shortcode WordPress : afficher les documents liés aux billets'>Shortcode WordPress&#160;: afficher les documents liés aux billets</a></li><li><a href='http://pioupioum.fr/snippets/wordpress-create-shortcode-class.html' title='WordPress : une classe abstraite pour aider la création de shortcodes'>WordPress&#160;: une classe abstraite pour aider la création de shortcodes</a></li><li><a href='http://pioupioum.fr/developpement/javascript-array-intersection.html' title='JavaScript : optimiser le calcul de l&#8217;intersection de tableaux de grandes tailles'>JavaScript&#160;: optimiser le calcul de l&#8217;intersection de tableaux de grandes tailles</a></li><li><a href='http://pioupioum.fr/developpement/optimiser-rapidite-chargement-adsense-jquery.html' title='Optimiser le chargement des AdSense'>Optimiser le chargement des AdSense</a></li></ul>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://pioupioum.fr/snippets/wordpress-forcer-chargement-jquery-footer.html/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SPIP Google Tools 1.0.1</title>
		<link>http://pioupioum.fr/plugins-spip/google-tools-1-0-1.html</link>
		<comments>http://pioupioum.fr/plugins-spip/google-tools-1-0-1.html#comments</comments>
		<pubDate>Fri, 18 Dec 2009 20:26:10 +0000</pubDate>
		<dc:creator>piouPiouM</dc:creator>
				<category><![CDATA[Plugins Spip]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[indefero]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[projet]]></category>
		<category><![CDATA[Spip]]></category>
		<category><![CDATA[statistiques]]></category>

		<guid isPermaLink="false">http://pioupioum.fr/?p=276</guid>
		<description><![CDATA[La version 1.0.1 du plugin SPIP Google Tools est disponible. Le plugin SPIP Google Tools ajoute proprement le code de suivi du service Google Analytics et le code de vérification du service Google Webmaster Tools sur les pages de votre site.

Cette nouvelle version supporte le nouveau tag Meta de validation de site requis par GWT. [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>La version 1.0.1 du plugin <strong><a href="http://pioupioum.fr/plugins-spip/google-tools.html" title="Plugin Spip Google Tools : intégration de l&#8217;outil de tracking Google Analytics et de Google Webmaster Tools – piouPiouM&#039;s dev">SPIP Google Tools</a></strong> est disponible. Le plugin <a href="http://www.spip.net/" title="SPIP">SPIP</a> Google Tools ajoute proprement le code de suivi du service <a href="http://www.google.com/analytics/" title="Google Analytics  | Official Website">Google Analytics</a> et le code de vérification du service <a href="https://www.google.com/webmasters/tools/">Google Webmaster Tools</a> sur les pages de votre site.</p>

<p>Cette nouvelle version supporte le nouveau tag Meta de validation de site requis par <abbr title="Google Webmaster Tools">GWT</abbr>. En effet, le nouveau meta tag <strong>google-site-verification</strong> remplace désormais l&#8217;ancien <strong>verify-v1</strong>.<br />
<strong>Attention&#160;:</strong> la valeur du code de validation n&#8217;est plus le même&#160;! N&#8217;oubliez pas de renseigner sa nouvelle valeur <em>via</em> la page d&#8217;administration du plugin.</p>

<h3 class='related_post_title'>Continuez votre lecture sur des sujets similaires</h3>

<ul class='related_post'><li><a href='http://pioupioum.fr/plugins-spip/google-tools.html' title='SPIP Google Tools'>SPIP Google Tools</a></li><li><a href='http://pioupioum.fr/plugins-wordpress/wordpress-jquery-ui-effects.html' title='WordPress jQuery UI Effects'>WordPress jQuery UI Effects</a></li><li><a href='http://pioupioum.fr/plugins-wordpress/get-authors-comments.html' title='Get Author&#8217;s Comments'>Get Author&#8217;s Comments</a></li><li><a href='http://pioupioum.fr/snippets/wordpress-forcer-chargement-jquery-footer.html' title='WordPress : forcer le chargement de jQuery en bas de page'>WordPress&#160;: forcer le chargement de jQuery en bas de page</a></li><li><a href='http://pioupioum.fr/outils-astuces/license-helper-textmate-bundle.html' title='Bundle License Helper pour TextMate'>Bundle License Helper pour TextMate</a></li></ul>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://pioupioum.fr/plugins-spip/google-tools-1-0-1.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPIP Google Tools</title>
		<link>http://pioupioum.fr/plugins-spip/google-tools.html</link>
		<comments>http://pioupioum.fr/plugins-spip/google-tools.html#comments</comments>
		<pubDate>Tue, 04 Aug 2009 09:54:37 +0000</pubDate>
		<dc:creator>piouPiouM</dc:creator>
				<category><![CDATA[Plugins Spip]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[indefero]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[projet]]></category>
		<category><![CDATA[Spip]]></category>
		<category><![CDATA[statistiques]]></category>

		<guid isPermaLink="false">http://pioupioum.fr/?p=179</guid>
		<description><![CDATA[Le plugin SPIP Google Tools propose d&#8217;ajouter proprement1 le code de suivi du service Google Analytics sur les pages de votre site.

Optionnellement, ce plugin vous permet de choisir le champ d&#8217;application du code de tracking GA&#160;: restreindre son ajout à l&#8217;espace publique ou le généraliser à l&#8217;ensemble du site (partie privée et publique).

Autre fonctionnalité, le [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Le plugin <strong><a href="http://www.spip.net/" title="SPIP">SPIP</a> Google Tools</strong> propose d&#8217;ajouter <em>proprement</em><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> le code de suivi du service <a href="http://www.google.com/analytics/" title="Google Analytics | Official Website">Google Analytics</a> sur les pages de votre site.</p>

<p>Optionnellement, ce plugin vous permet de choisir le champ d&#8217;application du code de tracking GA&#160;: restreindre son ajout à l&#8217;espace publique ou le généraliser à l&#8217;ensemble du site (partie privée et publique).</p>

<p>Autre fonctionnalité, le plugin <strong>SPIP Google Tools</strong> propose d&#8217;inclure sur la page d&#8217;accueil du site la balise Meta de vérification de site proposé par le service <a href="https://www.google.com/webmasters/tools/">Google Webmasters Tools</a>.
<span id="more-179"></span></p>

<h2 id="toc">Table des matières</h2>

<ol>
<li><a href="#telecharger">Téléchargement</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#compatibilite">Compatibilité</a></li>
<li><a href="#todo">Tâches à faire</a></li>
<li><a href="#developpement">Développement</a></li>
<li><a href="#changelog">Historique des versions et changelog</a></li>
</ol>

<h2 id="telecharger">Téléchargement</h2>

<div class="download box">
    <a href="http://pioupioum.indefero.net/p/spip-google-tools/downloads/3/get/" title="Téléchargement depuis la forge InDefero"><span>Télécharger la dernière version du plugin SPIP Google Tools (15.01&#160;Ko)</span></a>
</div>

<h2 id="installer">Installation</h2>

<ol>
<li>Décompressez l&#8217;archive puis téléversez le répertoire <code>spip-google-tools</code> dans votre répertoire <code>plugins</code>.</li>
<li>Procédez à son <a href="http://www.spip.net/fr_article3396.html" title="Installer un plugin - SPIP">activation</a>.</li>
<li>Rendez-vous sur la page d&#8217;administration du plugin <em>via</em> le menu Statistiques > Google Tools.</li>
</ol>

<p><div id="attachment_178" class="wp-caption aligncenter" style="width: 466px"><a href="http://assets1.pioupioum.fr/uploads/2009/08/spip-google-tools.png"><img src="http://assets1.pioupioum.fr/uploads/2009/08/spip-google-tools-456x350.png" alt="Panel de configuration du plugin Spip Google Tools" title="Configuration du plugin Spip Google Tools" width="456" height="350" class="size-medium wp-image-178" /></a><p class="wp-caption-text">Panel de configuration du plugin Spip Google Tools</p></div></p>

<h3>Notes</h3>

<ul>
<li>Le plugin ne nécessite aucune dépendance particulière.</li>
<li>L&#8217;inclusion de la balise de validation de Google Webmasters Tools requiert la présence de la balise <code>#INSERT_HEAD</code> dans les squelettes.</li>
</ul>

<h2 id="compatibilite">Compatibilité</h2>

<ul>
<li>SPIP 1.9.2+</li>
<li>SPIP 2.0.0+</li>
</ul>

<h2 id="todo">Tâches à faire</h2>

<p>Fonctionnalités en attente de développement.</p>

<ul>
<li>Ajouter une gestion des liens sortants et des téléchargements.</li>
</ul>

<h2 id="developpement">Développement</h2>

<p>Le code source du plugin, distribué sous licence <a href="http://fr.wikipedia.org/wiki/Licence_publique_g%C3%A9n%C3%A9rale_GNU" title="Licence publique générale GNU - Wikipédia">GNU/GLP</a>, est accessible sur <a href="http://pioupioum.indefero.net/p/spip-google-tools/" title="spip-google-tools - Plugin Spip d'intégration de Google Analytics et Google Webmasters Tools.">ma forge InDefero</a>.</p>

<p>Vous venez de trouver un bug&#160;? N&#8217;hésitez pas à me <a href="http://pioupioum.indefero.net/p/spip-google-tools/issues/" title="spip-google-tools Open Issues - Plugin Spip d'intégration de Google Analytics et Google Webmasters Tools.">le faire remonter</a>&#160;!</p>

<h2 id="changelog">Historique des versions et changelog</h2>

<h3>1.0.1</h3>

<ul>
<li>Support du nouveau code Meta de vérification de site <code>google-site-verification</code> du service Google Webmaster Tools.</li>
</ul>

<h3>1.0.0</h3>

<ul>
<li>Version initiale.</li>
</ul>

<h3 class='related_post_title'>Continuez votre lecture sur des sujets similaires</h3>

<ul class='related_post'><li><a href='http://pioupioum.fr/plugins-spip/google-tools-1-0-1.html' title='SPIP Google Tools 1.0.1'>SPIP Google Tools 1.0.1</a></li><li><a href='http://pioupioum.fr/plugins-wordpress/wordpress-jquery-ui-effects.html' title='WordPress jQuery UI Effects'>WordPress jQuery UI Effects</a></li><li><a href='http://pioupioum.fr/plugins-wordpress/get-authors-comments.html' title='Get Author&#8217;s Comments'>Get Author&#8217;s Comments</a></li><li><a href='http://pioupioum.fr/snippets/wordpress-forcer-chargement-jquery-footer.html' title='WordPress : forcer le chargement de jQuery en bas de page'>WordPress&#160;: forcer le chargement de jQuery en bas de page</a></li><li><a href='http://pioupioum.fr/outils-astuces/license-helper-textmate-bundle.html' title='Bundle License Helper pour TextMate'>Bundle License Helper pour TextMate</a></li></ul>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>c&#8217;est à dire que le code de suivi est ajouté en fin de page comme le préconise Google ainsi que tout bon développeur web. Le chargement de vos pages n&#8217;est ainsi pas bloqué par une latence des serveurs du service.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://pioupioum.fr/plugins-spip/google-tools.html/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

