<?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>elektro:elch &#187; WordPress</title>
	<atom:link href="http://elektroelch.de/blog/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://elektroelch.de</link>
	<description>Es ist nicht ungefährlich, wenn ein Volk lesen und schreiben kann.</description>
	<lastBuildDate>Fri, 11 May 2012 10:20:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<atom:link rel='hub' href='http://elektroelch.de/?pushpress=hub'/>
		<item>
		<title>WordPress: Aufregen über schlecht programmierte Plugins</title>
		<link>http://elektroelch.de/blog/2012/05/11/wordpress-aufregen-ueber-schlecht-programmierte-plugins/</link>
		<comments>http://elektroelch.de/blog/2012/05/11/wordpress-aufregen-ueber-schlecht-programmierte-plugins/#comments</comments>
		<pubDate>Fri, 11 May 2012 09:04:36 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=2744</guid>
		<description><![CDATA[Neulich stolperte ich über ein Plugin, das einen wirklichen Mehrwert liefert, aber leider so miserabel programmiert ist, dass ich niemanden mit gutem Gewissen den Einsatz empfehlen kann. Obwohl es schon eine größere Anzahl von &#8222;You&#8216;re doing it wrong&#8220;-Blogartikeln gibt, muss ich einfach einen weiteren Artikel darüber schreiben, da dieses nicht näher benannte Plugin so viele [...]]]></description>
			<content:encoded><![CDATA[<p>Neulich stolperte ich über ein Plugin, das einen wirklichen Mehrwert liefert, aber leider so miserabel programmiert ist, dass ich niemanden mit gutem Gewissen den Einsatz empfehlen kann. Obwohl es schon eine größere Anzahl von &#8222;You&#8216;re doing it wrong&#8220;-Blogartikeln gibt, muss ich einfach einen weiteren Artikel darüber schreiben, da dieses nicht näher benannte Plugin so viele Dinge gleichzeitig falsch macht.<br />
<span id="more-2744"></span></p>
<h3>Tabellen in der Datenbank erstellen</h3>
<p>WordPress liefert die notwendigen Tabellen und, noch besser, alle notwendigen Funktionen, um Daten in der Datenbank zu speichern. Es gibt zum Beispiel <code>wp_postmeta</code> um Daten zu speichern, die mit einem Artikel zusammenhängen oder <code>wp_usermeta</code> für Daten in Zusammenhang mit einem Benutzer.<br />
Um allgemeine Daten des Plugins zu speichern sollte man die Tabelle <code>wp_options</code> nutzen. Man muss nicht einmal für jeden Wert einen gesonderten Datensatz erstellen, sondern man kann die Daten in einem Array zusammenfassen, mit <code>serialize()</code> serialisieren und in einem einzelnen Datensatz speichern.<br />
(<b>Edit:</b> Schon seit der Version 2.0.1 ist es nicht mehr notwendig, die Daten selber zu serialisieren, da die update-* -Funktionen das automatisch machen.)<br />
Wie man sieht, ist es also gar nicht notwendig, eigene Tabellen oder SQL-Anweisungen erstellen.</p>
<h3>Ständig neue Daten anfordern</h3>
<p>Man muss Daten von externen Quellen nicht ständig erneuern, denn es ist sehr wahrscheinlich, dass sich die Daten über einen längeren Zeitraum nicht ändern. Mit einigen durchdachten WordPress-Funktionen kann man die Daten zwischenspeichern, indem man die &#8222;<a href="https://codex.wordpress.org/Transients_API">Transient API</a>&#8220; nutzt. Sie stellt Funktionen bereit, um Daten temporär zu speichern (<code><a href="https://codex.wordpress.org/Function_Reference/set_transient">set_transient</a></code>), abzurufen (<code><a href="https://codex.wordpress.org/Function_Reference/get_transient">get_transient</a></code>) und noch weitere, um temporäre Daten zu verwalten.</p>
<h3>Das Rad neu erfinden</h3>
<p>WordPress enthält eine Fülle an Funktionen, insbesondere für das Zusammenspiel mit der Datenbank. Bevor man also anfängt, eigene Datenbankroutinen zu schreiben, sollte man sich die Klasse <code>$wpdb</code> ansehen, die alles enthält um mit der Datenbank zu interagieren, desweiteren <code><a href="https://codex.wordpress.org/Function_Reference/add_user_meta">add_user_meta</a></code>, <code><a href="https://codex.wordpress.org/Function_Reference/add_post_meta">add_post_meta</a></code> und andere hilfreiche Funktionen um Daten zu speichern, zu ändern und zu löschen. Man sollte sich diese Funktionen ansehen, bevor man auch nur einen Gedanken daran verschwendet, eigene SQL-Statements zu erstellen. Neben der einfachen Verwendung ist man auf der sicheren Seite auch wenn sich das Datenbank-Design drastisch ändern sollte.</p>
<h3>Nach mir die Sintflut</h3>
<p>Selbst wenn dein Plugin die beste Erfindung seit geschnitten Brot sein mag und jeder es einsetzen sollte, wird es Nutzer geben, die der Meinung sind, dass es etwas Besseres gibt und es deinstallieren wollen. Man sollte deshalb darauf achten, dass man bei der Deinstallation alle Spuren des Plugins löscht. Bei der <b>Deinstalltion</b>, nicht bei der <b>Deaktivierung</b>, denn es kann durchaus passieren, das ein Benutzer das Plugin deaktiviert, um das Blog zu debuggen und anschließend sehr glücklich ist, dass die Einstellungen noch vorhanden sind.</p>
<p>Es gibt noch viele andere Sachen die man beim Programmieren eines Plugins falsch machen kann und ich hoffe sehr, dass <a href="http://twitter.com/nacin">@nacin</a> irgendwann ein Blog zu dem Thema eröffnet.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2012/05/11/wordpress-aufregen-ueber-schlecht-programmierte-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Die geheimnissvolle Selectbox in WordPress</title>
		<link>http://elektroelch.de/blog/2011/12/06/die-geheimnissvolle-selectbox-in-wordpress/</link>
		<comments>http://elektroelch.de/blog/2011/12/06/die-geheimnissvolle-selectbox-in-wordpress/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 14:50:49 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=2634</guid>
		<description><![CDATA[Neulich wollte ich auf der Optionsseite eines Plugins eine Selectbox mit 5 Einträgen erstellen. Nicht einfacher als das: &#60;select size=&#34;5&#34;&#62; &#60;option &#34;test1&#34; /&#62; &#60;option &#34;test2&#34; /&#62; &#60;option &#34;test3&#34; /&#62; &#60;option &#34;test4&#34; /&#62; &#60;option &#34;test5&#34; /&#62; &#60;option &#34;test6&#34; /&#62; &#60;/select&#62; Jeder, einschließlich mir, erwartet folgende Ausgabe: Tatsächlich wird aber folgendes angezeigt: Das Geheimnis liegt im stylesheet [...]]]></description>
			<content:encoded><![CDATA[<p>Neulich wollte ich auf der Optionsseite eines Plugins eine Selectbox mit 5 Einträgen erstellen. Nicht einfacher als das:</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;select size=&quot;5&quot;&gt;
  &lt;option &quot;test1&quot; /&gt;
  &lt;option &quot;test2&quot; /&gt;
  &lt;option &quot;test3&quot; /&gt;
  &lt;option &quot;test4&quot; /&gt;
  &lt;option &quot;test5&quot; /&gt;
  &lt;option &quot;test6&quot; /&gt;
&lt;/select&gt;</pre></div></div>

<p>Jeder, einschließlich mir, erwartet folgende Ausgabe:<br />
<img style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  src="http://elektroelch.de/net/files/2011/12/select1.png" alt="" title="select1" width="98" height="141" class="alignleft size-full wp-image-508" /><br clear="all"></p>
<p>Tatsächlich wird aber folgendes angezeigt:<br />
<img style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  src="http://elektroelch.de/net/files/2011/12/select2.png" alt="" title="select2" width="88" height="60" class="alignleft size-full wp-image-509" /><br clear="all"></p>
<p>Das Geheimnis liegt im stylesheet des Admin-Bereichs:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wpcontent</span> select <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Dadurch wird jede Selectbox auf einen Eintrag reduziert. Warum dies so definiert ist bleibt mir schleierhaft. Zu diesem Thema existiert auch ein <a href="http://core.trac.wordpress.org/ticket/10331">Ticket</a> im WordPress-Trackingsystem, in dem das Problem seit zwei Jahren diskutiert wird.</p>
<p>Die Lösung des Problems ist relativ einfach:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>select style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;height:auto&quot;</span> size<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #339933;">&gt;</span></pre></div></div>

<p>Sieht einfach aus, hat mich aber eine Stunde meiner Lebenszeit gekostet.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2011/12/06/die-geheimnissvolle-selectbox-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress: Neuladen von Skripts und Stylesheets erzwingen</title>
		<link>http://elektroelch.de/blog/2011/10/21/wordpress-neuladen-von-skripts-und-stylesheets-erzwingen/</link>
		<comments>http://elektroelch.de/blog/2011/10/21/wordpress-neuladen-von-skripts-und-stylesheets-erzwingen/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 07:23:22 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=2436</guid>
		<description><![CDATA[Bei der Entwicklung von WordPress-Themes oder -Plugins taucht immer wieder das Problem auf, dass Skripte oder Stylesheets nicht direkt von der Quelle sondern aus einem Cache geladen werden, weil sie irgendwo auf dem Weg vom Server zum Browser zwischengespeichert werden. Es gibt verschiedenee Möglichkeiten dieses zu unterbinden, indem man z.B. den Browsercache in den Optionen [...]]]></description>
			<content:encoded><![CDATA[<p>Bei der Entwicklung von WordPress-Themes oder -Plugins taucht immer wieder das Problem auf, dass Skripte oder Stylesheets nicht direkt von der Quelle sondern aus einem Cache geladen werden, weil sie irgendwo auf dem Weg vom Server zum Browser zwischengespeichert werden. Es gibt verschiedenee Möglichkeiten dieses zu unterbinden, indem man z.B. den Browsercache in den Optionen ausschaltet oder ein Webentwicklungs-AddOn benutzt. Manchmal funktioniert das allerdings nicht, weil es die verschiedensten Möglichkeiten des Cachings gibt und man vielleicht nicht alle ausgeschaltet hat.<br />
<span id="more-2436"></span><br />
WordPress beinhaltet eine einfache Möglichkeit sicherzustellen, dass alle Stylesheets und Skripte direkt von der Quelle geladen werden, indem man einen Versions-Parameter definiert:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">wp_enqueue_script<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$src</span><span style="color: #339933;">,</span> <span style="color: #000088;">$deps</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ver</span><span style="color: #339933;">,</span> <span style="color: #000088;">$in_footer</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_enqueue_style<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$src</span><span style="color: #339933;">,</span> <span style="color: #000088;">$deps</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ver</span><span style="color: #339933;">,</span> <span style="color: #000088;">$media</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Man erhöht den <code>$ver</code>-Parameter jedesmal, wenn die Datei geändert wird:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">wp_enqueue_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my_script'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_script.js'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'0.11'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_enqueue_style<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my_style'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_style.css'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'0.11'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Die Url des Stylesheets/Plugins ändert sich zu &#8222;<code>.../my_script.js?ver=0.11</code>&#8220;, so dass jedes Cachingsystem erkennt, dass es sich um eine geänderte Datei handelt und lädt sie erneut, damit der Benutzer immer die aktuellste Version erhält.</p>
<p>Es ist allerdings mühselig, die Versionsnummer auf einer Entwicklungsumgebung jedes mal manuell zu ändern, wenn man etwas an der Datei geändert hat und wir sind Programmierer, richtig? Also automatisieren wir die Sache einfach:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">wp_enqueue_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my_script'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_script.js'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_enqueue_style<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my_style'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_style.css'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Der Wert von <a href="http://php.net/manual/de/function.time.php">time()</a> ändert sich jede Sekunde und somit ändert sich auch die Versions-ID der Datei ständig und sie wird von der Quelle und nicht aus irgendeinem Cache geladen.</p>
<p>Etwas nachteilig ist allerdings, das man den zeitbasierten Parameter jefesmal gegen eine &#8222;echte&#8220; Versionsnummer austauschen muss, wenn man den Code an den Benutzer ausliefert, denn dieser soll ja immer noch den Vorteil des Cashing nutzen können. Erweitern wir also die Idee:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'VERSION'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1.1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> version_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> WP_DEBUG <span style="color: #009900;">&#41;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> VERSION<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
wp_enqueue_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my_script'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_script.js'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> version_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_enqueue_style<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my_style'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_style.css'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> version_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Auf diese Weise kann man sicherstellen, das bei der Entwicklung alles direkt von der Quelle geladen wird, in einer Produktionsumgebung allerdings alle Caching-Möglichkeiten genutzt werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2011/10/21/wordpress-neuladen-von-skripts-und-stylesheets-erzwingen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Benutzern das Passwort-Feld entziehen</title>
		<link>http://elektroelch.de/blog/2011/09/29/wordpress-benutzern-das-passwort-feld-entziehen/</link>
		<comments>http://elektroelch.de/blog/2011/09/29/wordpress-benutzern-das-passwort-feld-entziehen/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 13:00:02 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=2427</guid>
		<description><![CDATA[Du hast also einen Benutzer erstellt und ihm ein gutes Passwort gegeben, damit die Sicherheit Deines Blogs nicht gefährdet wird? Leider kannst Du aber nicht sicher sein, dass der Benutzer dieses gute Passwort beibehält, denn er kann es ganz einfach auf seiner Profilesiete ändern. Dieses Problem kann allerdings mit einem Filter gelöst werden: if &#40; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://elektroelch.de/wp-content/uploads/2011/09/120px-crystal_clear_password.png" rel="lightbox[2427]"><img style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  src="http://elektroelch.de/wp-content/uploads/2011/09/120px-crystal_clear_password.png" alt="" title="120px-Crystal_Clear_Password" width="120" height="120" class="alignleft size-full wp-image-2429" /></a>Du hast also einen Benutzer erstellt und ihm ein gutes Passwort gegeben, damit die Sicherheit Deines Blogs nicht gefährdet wird? Leider kannst Du aber nicht sicher sein, dass der Benutzer dieses gute Passwort beibehält, denn er kann es ganz einfach auf seiner Profilesiete ändern.<br />
Dieses Problem kann allerdings mit einem Filter gelöst werden:<br />
<span id="more-2427"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><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>
  add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'disable_password_fields'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> disable_password_fields<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> current_user_can<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'administrator'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #000088;">$show_password_fields</span> <span style="color: #339933;">=</span> add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'show_password_fields'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'__return_false'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Jetzt kein nur noch ein Benutzer mit der Rolle &#8222;Administrator&#8220; das Passwort der Benutzer ändern und sicherstellen, dass sie gute Passwörter haben.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2011/09/29/wordpress-benutzern-das-passwort-feld-entziehen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress: Titel kürzen</title>
		<link>http://elektroelch.de/blog/2011/08/15/wordpress-titel-kuerzen/</link>
		<comments>http://elektroelch.de/blog/2011/08/15/wordpress-titel-kuerzen/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 11:56:56 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=2377</guid>
		<description><![CDATA[Eine Frage, die immer wieder in WordPress-Foren auftaucht, ist, wie man den Titel auf eine bestimmte Anzahl Zeichen kürzen und ein &#8222;&#8230;&#8220; anfügen kann. Das Problem ist mit einigen Zeilen PHP schnell gelöst: 1 2 3 4 5 6 7 8 9 add_filter&#40; 'the_title', 'short_title' &#41;; function short_title&#40; $title &#41; &#123; $chars = 20; if [...]]]></description>
			<content:encoded><![CDATA[<p>Eine Frage, die immer wieder in WordPress-Foren auftaucht, ist, wie man den Titel auf eine bestimmte Anzahl Zeichen kürzen und ein &#8222;&hellip;&#8220; anfügen kann.</p>
<p>Das Problem ist mit einigen Zeilen PHP schnell gelöst:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_title'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'short_title'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> short_title<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$chars</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$chars</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$chars</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$title</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; &amp;hellip;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Die Variable <code>$chars</code> muss auf die Anzahl Zeichen gesetzt werden, die man maximal anzeigen möchte und in Zeile 6 muss der Platzhalter für den ausgelassenen Text eingefügt werden (<code>&amp;hellip;</code> ist typografisch richtige Version für drei Punkte, Ellipse genannt).</p>
<p>Nachteilig an dieser Lösung ist, dass der Titel mitten in einem Wort abgeschnitten werden könnte. Wenn man möchte, kann man die Funktion entsprechend erweitern:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_title'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'short_title'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> short_title<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$chars</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$chars</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$chars</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="display:block;background-color: #ffc;">    <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strrpos</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' '</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		</span>    <span style="color: #000088;">$title</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; &amp;hellip;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Kopiert man diese Funktion in die <code>funtions.php</code> des Themes werden alle Aufrufe von <code>the_title</code> den eingefügten Angaben entsprechend gekürzt.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2011/08/15/wordpress-titel-kuerzen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Paginierung der Plugintabelle ausschalten</title>
		<link>http://elektroelch.de/blog/2011/04/05/wordpress-paginierung-der-plugintabelle-ausschalten/</link>
		<comments>http://elektroelch.de/blog/2011/04/05/wordpress-paginierung-der-plugintabelle-ausschalten/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 12:11:52 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=1635</guid>
		<description><![CDATA[Seit der Version 3.0 wird die Plugintabelle standardmäßig in Seiten aufgeteilt, 20 Einträge pro Seite. In meinen Augen ist die Funktion vollkommen nutzlos, denn sie bedeutet, das ich mich mühsam durch die Seiten klicken muss, anstatt mich einfach mit dem Mausrad durch die Einträge zu scrollen. Es gibt aber eine mehr oder weniger &#8222;versteckte&#8220; Einstellung, [...]]]></description>
			<content:encoded><![CDATA[<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-1636" src="http://elektroelch.de/pics/seiten-1-png" alt="" width="363" height="217" />Seit der Version 3.0 wird die Plugintabelle standardmäßig in Seiten aufgeteilt, 20 Einträge pro Seite. In meinen Augen ist die Funktion vollkommen nutzlos, denn sie bedeutet, das ich mich mühsam durch die Seiten klicken muss, anstatt mich einfach mit dem Mausrad durch die Einträge zu scrollen. Es gibt aber eine mehr oder weniger &#8222;versteckte&#8220; Einstellung, um alle Plugins auf einmal anzuzeigen.<br />
<span id="more-1635"></span><br />
Die meisten Leute übersehen den &#8222;Optionen einblenden&#8220; Knopf am oberen Rand des Browserfensters, aber dahinter verbergen sich nützliche Optionen, um einzustellen wie WordPress die Admin-Seiten darstellt. Auf der Plugin-Seite wird das folgende Formular geöffnet:<br />
<img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.de/pics/seiten-2-png" alt="" width="565" height="208" class="aligncenter size-full wp-image-1637" /><br />
Hier kann man einstellen, wie viele Plugin-Einträge auf einer Seite dargestellt werden. Setzt man diesen Wert auf &#8222;999&#8243; sollte selbst der verrückteste Plugin-Liebhaber alle Plugins auf einer Seite sehen.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2011/04/05/wordpress-paginierung-der-plugintabelle-ausschalten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin Spam, Teil 2</title>
		<link>http://elektroelch.de/blog/2010/12/08/wordpress-plugin-spam-teil-2/</link>
		<comments>http://elektroelch.de/blog/2010/12/08/wordpress-plugin-spam-teil-2/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 16:09:20 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=616</guid>
		<description><![CDATA[Im Artikel Interessante neue Art von WordPress-Spam habe ich über eine Webseite berichtet, die Plugins anbietet um unbedarfte Nutzer auf eine Spam-Seite zu locken. Seitdem war Rahul (der Mann hinter der Spamseite) nicht untätig. Ein deutscher Benutzer berichtete von Problemen mit seiner Webseite, die man ziemlich schnell auf Probleme mit einem Plugin zurückführen konnte. nach [...]]]></description>
			<content:encoded><![CDATA[<p>Im Artikel <a href="http://elektroelch.de/blog/2010/11/interessante-neue-art-von-wordpress-spam/" target="_self">Interessante neue Art von WordPress-Spam</a> habe ich über eine Webseite berichtet, die Plugins anbietet um unbedarfte Nutzer auf eine Spam-Seite zu locken.</p>
<p>Seitdem war Rahul (der Mann hinter der Spamseite) nicht untätig. Ein deutscher Benutzer berichtete von Problemen mit seiner Webseite, die man ziemlich schnell auf Probleme mit einem Plugin zurückführen konnte. nach kurzer Recherche konnte ein Plugin namens <em>Visitor Stats</em> verantwortlich gemacht werden.</p>
<p>Ein kurzer Blick auf die bekannte Webseite bestätigte meinen Verdacht: Das Plugin wird von &#8222;111ways to make money&#8220; angeboten. Interessanterweise wird das Plugin von dieser Seite selbst (nicht mehr) angeboten. Na gut, vielleicht hat Rahul einfach vergessen sie hochzuladen. Aber woher hat der Benutzer das Plugin bekommen?</p>
<p><span id="more-616"></span><br />
Ich gab den Plugin-Namen in meine Lieblingssuchmaschine ein und war überrascht:</p>
<p style="text-align: center"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter" src="http://lh5.ggpht.com/_Z3e_jASabuQ/TP4mdTkJEQI/AAAAAAAAAhM/0Ia4GtY_O-Q/s800/07.12.png" alt="" width="564" height="74" /></p>
<p>Also gut, dies scheint das Original-Plugin zu sein, das von Rahul verändert wurde. Ich lud das Plugin herunter, um zu sehen, was Rahul geändert hat. Zu meiner Überraschung <strong>IST</strong> dies die verseuchte Datei, im offiziellen WordPress-Verzeichnis. OMFG!<br />
Ich war aber nicht der erste der dies entdeckt hat, denn im Forum gab es bereits <a href="http://wordpress.org/tags/visitor-stats?forum_id=10" target="_blank">einige Artikel</a>.</p>
<p>Dann werfen wir mal eine Blick auf den Quelltext.</p>
<h3><span style="text-decoration: underline">Dem Feind auf den Zahn gefühlt</span></h3>
<p>In den vorherigen Plugins sahen die Dateiköpfe sehr verdächtig aus, aber durch die Nutzung eines URL-Verkürzers sieht der Kopf jetzt etwas schlüssiger aus:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Plugin Name<span style="color: #339933;">:</span> visitor<span style="color: #339933;">-</span>stats
Version<span style="color: #339933;">:</span> <span style="color:#800080;">2.00</span>
Plugin URI<span style="color: #339933;">:</span> http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//tinyurl.***/visitorstats</span>
Description<span style="color: #339933;">:</span> This plugin will keep track of visitors<span style="color: #0000ff;">' information. Check &lt;a href=&quot;index.php?page=visitor-stats/visitor-stats.php&quot;&gt;this page&lt;/a&gt; for details. Requires at
least 2.6.3 and tested upto 2.7.1
Author: visitorstats
Author URI: http://tinyurl.***/2vmoonv</span></pre></div></div>

<p>Natürlich führen die URLs zu der bekannten Betrugsseite, aber wer überprüft die Links schon bevor er darauf klickt, wir haben uns doch alle an TinyUrls gewöhnt.</p>
<p>Rahul hat sich auch einige Fähigkeiten in der Plugin-Programmierung angeeignet:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$wp_nr_footer_link_2</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//change to 0 to remove the 'Improve the web...' link</span>
<span style="color: #000000; font-weight: bold;">function</span> wp_nofollow_you_awareness<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_nr_footer_link_2</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_nr_footer_link_2</span><span style="color: #009900;">&#41;</span><span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
&nbsp;
&lt;!--mce:0--&gt;
&nbsp;
'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_sidebar'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_nofollow_you_awareness'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_nofollow_you_awareness'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&quot;</span></pre></div></div>

<p>In Zeile 30 deklariert er eine Variable und schreibt tatsächlich einen Kommentar dazu. Wie nett von ihm! Dann erstellt er eine Funktion die etwas JavaScript ausgibt. Die Funktion wird durch eine Filter und einen Action-Hook in der Sidebar und im Footer aufgerufen. Aber wird sie wirklich aufgerufen? Soweit ich weiß gibt es keinen Filter namens <code>get_sidebar</code>, sondern nur einen Action-Hook mit diesem Namen. Nun gut, ganz so clever scheint Rahul doch nicht zu sein.</p>
<p>Was macht das JavaScript, das auf die Seite geschmuggelt wird? Es zieht sich eine Werbung von linkbucks.com, der dann im Footer dargestellt wird da der Hook <code>get_sidebar</code> nicht funktioniert. Seit meiner letzten Betrachtung dieser Plugins ist das ein neues Geschäftsmodell.</p>
<p>Anschließend benutzt er einige <code>iframes</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;</pre></div></div>

<p>Das ist jetzt aber wirklich gewitzt! <em>Vitbuzz.com</em> scheint eine Community zu sein, in der sich College-Studenten treffen sollen (ist aber nur wenig besucht). Die Seite ist allerdings schlecht programmiert und man sie benutzen, um Links zu verschlüsseln.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;font-size: 0%;clear: both;text-align: center;margin-top: 0px;color: #555&quot;</span><span style="color: #339933;">&gt;</span>
Learn to <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com/&quot;</span><span style="color: #339933;">&gt;</span>make money online<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>We came
up with a idea of putting up all the money making ways and ideas together so that you
can choose one of them and start making money online<span style="color: #339933;">.</span> here we <span style="color: #b1b100;">include</span> the latest money
making ways that help you earn online from home <span style="color: #339933;">.</span>You can find many alternative money
making ways such <span style="color: #b1b100;">as</span> affiliate marketing<span style="color: #339933;">,</span> sock marketing<span style="color: #339933;">,</span> money from blogging<span style="color: #339933;">,</span> paid
surveys and lots more<span style="color: #339933;">.</span>
<span style="color: #339933;">+</span>So have a look at these tips and ideas and start making money online<span style="color: #339933;">...</span>happy earnings<span style="color: #339933;">...</span>
<span style="color: #339933;">&lt;</span>em<span style="color: #339933;">&gt;&lt;/</span>em<span style="color: #339933;">&gt;.&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #0000ff;">');
}</span></pre></div></div>

<p>Hier fügt er einen Absatz hinzu und setzt die Zeichengröße auf 0%. Obwohl das eigentlich genügen sollte fügt er noch einigen CSS-Code hinzu. Ich vermute, dass er nicht wirklich weiß was er macht und einfach den Code per Cut and Paste von einer anderen Seite übernommen hat.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_footer'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_nofollow_me_awareness'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_nofollow_me_awareness'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Erneut versucht er JavaScript auf der Seite zu platzieren. War einmal nicht genug? Schließlich muss Rahul noch den Plugin-Pfad korrigieren, da das Original-Plugin schlecht programmiert ist:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$gi</span> <span style="color: #339933;">=</span> geoip_open<span style="color: #009900;">&#40;</span>ABSPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;wp-content/plugins/visitor-stats/geo_ip
/GeoLiteCity.dat&quot;</span><span style="color: #339933;">,</span>GEOIP_STANDARD<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Ich denke Rahul wird uns weiterhin mit neuen Ideen beschäftigen, mit denen er Leute auf seine Seite locken will. Ich werde Euch weiter informieren, falls ich auf neue versuchte Plugins stoße. Hoffentlich landen sie nicht wieder im offiziellen Verzeichnis. Die Leute würden das Vertrauen in das Verzeichnis und in WordPress als Ganzes verlieren.<br />
Leider befindet sich auf den Plugin-Seiten kein Hinweis auf eine Kontaktperson, die man über solche Plugins informieren könnte. Vielleicht sollte sich eine Gruppe von Leuten zusammenfinden, die Plugins auf solche Betrügereien untersucht oder ein Art Virenscanner erstellt, der Plugins nach bekannten Betrugsseiten oder Code durchforstet. Freiwillige vor!</p>
<p>Nebenbei: Das Original-Plugin heißt &#8222;wp-visitors&#8220; (<a href="http://wordpress.org/extend/plugins/wp-visitors/" target="_blank">http://wordpress.org/extend/plugins/wp-visitors/</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2010/12/08/wordpress-plugin-spam-teil-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Interessante neue Art von WordPress-Spam</title>
		<link>http://elektroelch.de/blog/2010/11/10/interessante-neue-art-von-wordpress-spam/</link>
		<comments>http://elektroelch.de/blog/2010/11/10/interessante-neue-art-von-wordpress-spam/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 14:40:12 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=615</guid>
		<description><![CDATA[E scheint eine neue Art zu geben, wie Spammer versuchen Benutzer auf Spam-Seiten zu locken: WordPress Plugin Spam Wie die meisten anderen Autoren überprüfe ich regelmäßig, was andere über meine Plugins sagen. Tatsächlich habe ich einen Google Alert auf die Namen gesetzt. Neulich erhielt ich eine Mail, die mir mitteilte, dass es einen neuen Fork [...]]]></description>
			<content:encoded><![CDATA[<p>E scheint eine neue Art zu geben, wie Spammer versuchen Benutzer auf Spam-Seiten zu locken: <strong>WordPress Plugin Spam</strong></p>
<p>Wie die meisten anderen Autoren überprüfe ich regelmäßig, was andere über meine Plugins sagen. Tatsächlich habe ich einen <a title="Google Alert" href="http://www.google.com/alerts">Google Alert</a> auf die Namen gesetzt. Neulich erhielt ich eine Mail, die mir mitteilte, dass es einen neuen Fork meines <a title="Pagebar plugin" href="http://wordpress.org/extend/plugins/pagebar/">pagebar-Plugins</a> namens <strong>Advance pagebar</strong> gibt. Cool, da hat jemand ein neues Plugin auf Basis meines Codes geschrieben.</p>
<p>Das Plugin heißt komplett &#8222;Advance Pagebar &#8211; New way to navigate Pages &#8230;&#8220;. Überraschenderweise funktionierte der Link &#8222;<a href="http://wordpress.org/extend/plugins/advance-pagebar/">http://wordpress.org/extend/plugins/advance-pagebar/</a>&#8220; nicht. Was war da los?</p>
<p><span id="more-615"></span></p>
<p>Nachdem ich meine Lieblings-Suchmaschine befragt habe fand ich schließlich eine Kopie des verdächtigen Plugins (Link bewusst ausgelassen).</p>
<p>Der &#8222;Autor&#8220; dieses neuen Plugins hat nicht viel geändert. Zuerst hat er den Kopf des Plugins angepasst:</p>
<p><strong>Original:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Plugin Name<span style="color: #339933;">:</span> Pagebar2
Plugin URI<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification: http://www.elektroelch.de/hacks
/wp/pagebar&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.elektroelch.de/hacks/wp/pagebar&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">//www.elektroelch.de/hacks/wp/pagebar&lt;/a&gt;</span>
Description<span style="color: #339933;">:</span> Adds an advanced page navigation to Wordpress<span style="color: #339933;">.</span>
Version<span style="color: #339933;">:</span> <span style="color:#800080;">2.59</span>
Author<span style="color: #339933;">:</span> Lutz Schröer
Author URI<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification: http://elektroelch.de/blog&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://elektroelch.de/blog&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//elektroelch.de/blog&lt;/a&gt;</span></pre></div></div>

<p><strong>Geänderter Kopf:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Plugin Name<span style="color: #339933;">:</span> Advance Pagebar
Plugin URI<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification: http://***.com/advance-
pagebar/&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com/advance-pagebar/&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//***.com/advance-</span>
pagebar<span style="color: #339933;">/&lt;/</span>a<span style="color: #339933;">&gt;</span>
Description<span style="color: #339933;">:</span> <span style="color: #b1b100;">For</span> using the plugin<span style="color: #339933;">,</span> read the  <span style="color: #339933;">&lt;</span>a title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Advance Pagebar&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com/advance-pagebar/&quot;</span><span style="color: #339933;">&gt;</span>Advance PagebarInstruction Page<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>  <span style="color: #339933;">.</span>Adds 
an advanced page navigation to Wordpress<span style="color: #339933;">.</span>
Version<span style="color: #339933;">:</span> 6<span style="color: #339933;">.</span>143<span style="color: #339933;">.</span>3
Author<span style="color: #339933;">:</span> Lutz Schröer
Author URI<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification: http://***.com/&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com/&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//***.com/&lt;/a&gt;</span></pre></div></div>

<p>(Die drei Sterne waren die Originaladresse.)</p>
<p>Tolle Wurst, er hat noch nicht einmal meinen Namen geändert! Mit der Verwendung der hohen Versionsnummer &#8222;6.143.3&#8243; möchte er wohl vortäuschen, dass es sich u ein etabliertes Plugin handelt.</p>
<p>Zusätzlich hat er die <code>readme.txt</code>-Daei geändert:</p>
<p><b>Original:</b></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">===</span> pagebar <span style="color: #339933;">===</span>
Contributors<span style="color: #339933;">:</span> Lutz Schroeer
Donate <span style="color: #990000;">link</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification: http://elektroelch.de&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://elektroelch.de&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//elektroelch.de&lt;/a&gt;</span>
Tags<span style="color: #339933;">:</span> navigation<span style="color: #339933;">,</span> navi<span style="color: #339933;">,</span> page<span style="color: #339933;">,</span> comments
Requires at least<span style="color: #339933;">:</span> <span style="color:#800080;">2.7</span>
Tested up to<span style="color: #339933;">:</span> <span style="color:#800080;">3.01</span>
Stable tag<span style="color: #339933;">:</span> trunk</pre></div></div>

<p><b>Fälschung:</b></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">===</span> Advance Pagebar <span style="color: #339933;">-</span> <span style="color: #000000; font-weight: bold;">New</span> Way to Navigate Pages <span style="color: #339933;">===</span>
Contributors<span style="color: #339933;">:</span> Lutz Schroeer
Donate <span style="color: #990000;">link</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification:
http://111waystomakemoney.com/donate/&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://111waystomakemoney.com
/donate/&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//111waystomakemoney.com/donate/&lt;/a&gt;</span>
Tags<span style="color: #339933;">:</span> admin<span style="color: #339933;">,</span> plugin<span style="color: #339933;">,</span> footer<span style="color: #339933;">,</span> links<span style="color: #339933;">,</span> copyright<span style="color: #339933;">,</span> administration<span style="color: #339933;">,</span> blog<span style="color: #339933;">,</span>Google Adsense<span style="color: #339933;">,</span> 
WordPress<span style="color: #339933;">,</span>Plugin<span style="color: #339933;">,</span>widget<span style="color: #339933;">,</span>post<span style="color: #339933;">,</span>plugin<span style="color: #339933;">,</span>admin<span style="color: #339933;">,</span>sidebar<span style="color: #339933;">,</span>comments<span style="color: #339933;">,</span>images<span style="color: #339933;">,</span>twitter<span style="color: #339933;">,</span>page<span style="color: #339933;">,</span>google<span style="color: #339933;">,</span>lin
ks<span style="color: #339933;">,</span>image<span style="color: #339933;">,</span>ad<span style="color: #339933;">,</span>admin<span style="color: #339933;">,</span>administration<span style="color: #339933;">,</span>ads<span style="color: #339933;">,</span>adsense<span style="color: #339933;">,</span>advertising<span style="color: #339933;">,</span>affiliate<span style="color: #339933;">,</span>AJAX<span style="color: #339933;">,</span>amazon<span style="color: #339933;">,</span>analytics<span style="color: #339933;">,</span>a
nti<span style="color: #339933;">-</span>spam<span style="color: #339933;">,</span>api<span style="color: #339933;">,</span>archive<span style="color: #339933;">,</span>atom<span style="color: #339933;">,</span>audio<span style="color: #339933;">,</span>authentication<span style="color: #339933;">,</span>author<span style="color: #339933;">,</span>automatic<span style="color: #339933;">,</span>Avatar<span style="color: #339933;">,</span>blog<span style="color: #339933;">,</span>blogroll<span style="color: #339933;">,</span>book<span style="color: #339933;">,</span>
bookmark<span style="color: #339933;">,</span>bookmarking<span style="color: #339933;">,</span>bookmarks<span style="color: #339933;">,</span>buddypress<span style="color: #339933;">,</span>button<span style="color: #339933;">,</span>calendar<span style="color: #339933;">,</span>captcha<span style="color: #339933;">,</span>categories<span style="color: #339933;">,</span>category
<span style="color: #339933;">,</span>cms<span style="color: #339933;">,</span>code<span style="color: #339933;">,</span>comment<span style="color: #339933;">,</span>comments<span style="color: #339933;">,</span>community<span style="color: #339933;">,</span>contact<span style="color: #339933;">,</span>content<span style="color: #339933;">,</span>counter<span style="color: #339933;">,</span>CSS<span style="color: #339933;">,</span>custom<span style="color: #339933;">,</span>dashboard
<span style="color: #339933;">,</span>database<span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #339933;">,</span>del<span style="color: #339933;">.</span>icio<span style="color: #339933;">.</span>us<span style="color: #339933;">,</span>delicious<span style="color: #339933;">,</span>Digg<span style="color: #339933;">,</span>edit<span style="color: #339933;">,</span>editor<span style="color: #339933;">,</span>email<span style="color: #339933;">,</span>embed<span style="color: #339933;">,</span>event<span style="color: #339933;">,</span>events<span style="color: #339933;">,</span>excerpt<span style="color: #339933;">,</span>Fac
ebook<span style="color: #339933;">,</span>feed<span style="color: #339933;">,</span>feeds<span style="color: #339933;">,</span>filter<span style="color: #339933;">,</span>flash<span style="color: #339933;">,</span>flickr<span style="color: #339933;">,</span>form<span style="color: #339933;">,</span>Formatting<span style="color: #339933;">,</span>gallery<span style="color: #339933;">,</span>google<span style="color: #339933;">,</span>google<span style="color: #339933;">,</span>maps<span style="color: #339933;">,</span>html<span style="color: #339933;">,</span>image<span style="color: #339933;">,</span>im
ages<span style="color: #339933;">,</span>integration<span style="color: #339933;">,</span>iphone<span style="color: #339933;">,</span>javascript<span style="color: #339933;">,</span>jquery<span style="color: #339933;">,</span>language<span style="color: #339933;">,</span>lightbox<span style="color: #339933;">,</span><span style="color: #990000;">link</span><span style="color: #339933;">,</span>links<span style="color: #339933;">,</span><span style="color: #990000;">list</span><span style="color: #339933;">,</span>login<span style="color: #339933;">,</span><span style="color: #990000;">mail</span><span style="color: #339933;">,</span>manage<span style="color: #339933;">,</span>
maps<span style="color: #339933;">,</span>media<span style="color: #339933;">,</span>menu<span style="color: #339933;">,</span>meta<span style="color: #339933;">,</span>mobile<span style="color: #339933;">,</span>mp3<span style="color: #339933;">,</span>music<span style="color: #339933;">,</span>myspace<span style="color: #339933;">,</span>navigation<span style="color: #339933;">,</span>News<span style="color: #339933;">,</span>nofollow<span style="color: #339933;">,</span>notification<span style="color: #339933;">,</span>p
age<span style="color: #339933;">,</span>pages<span style="color: #339933;">,</span>password<span style="color: #339933;">,</span>paypal<span style="color: #339933;">,</span>performance<span style="color: #339933;">,</span>permalink<span style="color: #339933;">,</span>photo<span style="color: #339933;">,</span>photos<span style="color: #339933;">,</span>php<span style="color: #339933;">,</span>picture<span style="color: #339933;">,</span>pictures<span style="color: #339933;">,</span>plugi
<span style="color: #339933;">,</span>plugins<span style="color: #339933;">,</span>Post<span style="color: #339933;">,</span>posts<span style="color: #339933;">,</span>profile<span style="color: #339933;">,</span>quotes<span style="color: #339933;">,</span>random<span style="color: #339933;">,</span>Reddit<span style="color: #339933;">,</span>redirect<span style="color: #339933;">,</span>register<span style="color: #339933;">,</span>registration<span style="color: #339933;">,</span>related<span style="color: #339933;">,</span>rss<span style="color: #339933;">,</span>sc
roll<span style="color: #339933;">,</span>search<span style="color: #339933;">,</span>security<span style="color: #339933;">,</span>seo<span style="color: #339933;">,</span>Share<span style="color: #339933;">,</span>sharing<span style="color: #339933;">,</span>shortcode<span style="color: #339933;">,</span>sidebar<span style="color: #339933;">,</span>simple<span style="color: #339933;">,</span>slideshow<span style="color: #339933;">,</span>social<span style="color: #339933;">,</span>social<span style="color: #339933;">,</span>book
marking<span style="color: #339933;">,</span>social<span style="color: #339933;">,</span>media<span style="color: #339933;">,</span>spam<span style="color: #339933;">,</span>statistics<span style="color: #339933;">,</span>stats<span style="color: #339933;">,</span>Style<span style="color: #339933;">,</span>tag<span style="color: #339933;">,</span>tags<span style="color: #339933;">,</span>technorati<span style="color: #339933;">,</span>template<span style="color: #339933;">,</span>text<span style="color: #339933;">,</span>theme<span style="color: #339933;">,</span>t
hemes<span style="color: #339933;">,</span>thumbnail<span style="color: #339933;">,</span><span style="color: #990000;">time</span><span style="color: #339933;">,</span>TinyMCE<span style="color: #339933;">,</span>title<span style="color: #339933;">,</span>tracking<span style="color: #339933;">,</span>tweet<span style="color: #339933;">,</span>twitter<span style="color: #339933;">,</span>update<span style="color: #339933;">,</span>upload<span style="color: #339933;">,</span>url<span style="color: #339933;">,</span>user<span style="color: #339933;">,</span>users<span style="color: #339933;">,</span>vid
eo<span style="color: #339933;">,</span>widget<span style="color: #339933;">,</span>widgets<span style="color: #339933;">,</span>wordpress<span style="color: #339933;">,</span>wpmu<span style="color: #339933;">,</span>xml<span style="color: #339933;">,</span>yahoo<span style="color: #339933;">,</span>youtube navigation<span style="color: #339933;">,</span> navi<span style="color: #339933;">,</span> page<span style="color: #339933;">,</span> comments
&nbsp;
Requires at least<span style="color: #339933;">:</span> <span style="color:#800080;">2.7</span>
Tested up to<span style="color: #339933;">:</span> <span style="color:#800080;">3.01</span>
Stable tag<span style="color: #339933;">:</span> trunk</pre></div></div>

<p>Hey, der Typ muss ein <a href="https://twitter.com/Fountainjohn/status/1560447887085568">SEO-Experte</a> sein (nichts für ungut, Yoast).</p>
<p><b>Original:</b></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Pagebar adds a nice page bar to your blog posts<span style="color: #339933;">,</span> multipaged posts and 
paged comments<span style="color: #339933;">:</span>
 <span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://elektroelch.de/hacks/wp/pagebar/wp-content/uploads/2009/04
/pagebar.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">/&gt;</span></pre></div></div>

<p><b>Fälschung:</b></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Pagebar adds a nice page bar to your blog posts<span style="color: #339933;">,</span> multipaged posts 
&nbsp;
<span style="color: #b1b100;">For</span> detailed description of the plugin visit plugin page at <span style="color: #009900;">&#91;</span>Advance Pagebar<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification: http://111waystomakemoney.com/advance-
pagebar/&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://111waystomakemoney.com/advance-pagebar/&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">//111waystomakemoney.com/advance-pagebar/&lt;/a&gt;).</span></pre></div></div>

<p>Der Spammer hat auch etwas Text der <code>readme.txt</code> zugefügt:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">**</span>Demo<span style="color: #339933;">:**</span>
demo<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>Advance Pagebar Demo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification: 
http://***.com/advance-pagebar/&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com/advance-pagebar/&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">//***.com/advance-pagebar/&lt;/a&gt;).</span>
&nbsp;
Warm Regards<span style="color: #339933;">,</span>
Rahul  
&nbsp;
<span style="color: #009900;">&#91;</span>Advance Pagebar<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkification-ext&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Linkification: http://***.com
/advance-pagebar/&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com/advance-pagebar/&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//***.com/advance-</span>
pagebar<span style="color: #339933;">/&lt;/</span>a<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></div></div>

<p>Was ein netter Typ: Warm Regards (Herzliche Grüße). Und sein Name ist Rahul? Das ist indisch, oder?</p>
<p>Schließlich hat er auch noch die Changelog geändert:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">==</span> Changelog <span style="color: #339933;">==</span>
<span style="color: #339933;">=</span> 6<span style="color: #339933;">.</span>143<span style="color: #339933;">.</span>3 <span style="color: #339933;">=</span>
&nbsp;
<span style="color: #339933;">*</span> initial release</pre></div></div>

<p>Version 6.142.3 als erstes Release? Klar!</p>
<p>Wenn man sich die anderen Dateien ansieht kann man erkennen, dass der Spammer lediglich alle <code>pagebar</code> durch <code>Advance pagebar</code> ersetzt.</p>
<p><b>Original:</b></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pagebar2update'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></div></div>

<p>Fälschung:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Advance Pagebarupdate'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></div></div>

<p>Der Spammer fand es auch ganz toll einige Links in die Einstellungsseiten einzustreuen und er hat sogar eine Spendenseite. Wie niedlich!</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>h2 style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text-align: left&quot;</span><span style="color: #339933;">&gt;</span>For More Useful Plugins Visit<span style="color: #339933;">:&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com/&quot;</span> target<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;_blank&quot;</span><span style="color: #339933;">&gt;</span>Wordpress Plugins<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h2<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
<span style="color: #339933;">&lt;</span>h2 style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text-align: left&quot;</span><span style="color: #339933;">&gt;</span>If u like the plugin please Donate<span style="color: #339933;">:&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com
/donate/&quot;</span> target<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;_blank&quot;</span><span style="color: #339933;">&gt;</span>Plugin Donation Page<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h2<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
<span style="color: #339933;">&lt;</span>h1 style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text-align: left&quot;</span><span style="color: #339933;">&gt;</span>For Instructions Visit<span style="color: #339933;">:&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://***.com/advance-
pagebar/&quot;</span> target<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;_blank&quot;</span><span style="color: #339933;">&gt;</span>Plugin Page<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h1<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Er hat wirklich etwas Arbeit in die Plugin-Fälschung investiert. Schlußendlich hat er noch eine Datei <code>index.html</code> in das Plugin-Verzeichnis kopiert. Warum auch immer:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Wordpress Advance Pagebar <span style="color: #339933;">-</span> <span style="color: #000000; font-weight: bold;">New</span> Way To Navigate Pages Plugin
&nbsp;
<span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;&lt;</span>a title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Wordpress Advance Pagebar - New Way To Navigate  Pages 
Plugin&quot;</span><span style="color: #339933;">&gt;</span>Advance Pagebar <span style="color: #339933;">-</span> <span style="color: #000000; font-weight: bold;">New</span> Way To Navigate Pages Plugin<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h1<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
Pagebar adds a nice page bar to your blog posts<span style="color: #339933;">,</span> multipaged posts
&nbsp;
<span style="color: #b1b100;">For</span> detailed description of the plugin visit plugin page at Advance Pagebar<span style="color: #339933;">.</span>
&nbsp;
			Author<span style="color: #339933;">:</span> Lutz Schroeer		
&nbsp;
Tags<span style="color: #339933;">:</span> ad<span style="color: #339933;">,</span> admin<span style="color: #339933;">,</span> administration<span style="color: #339933;">,</span> ads<span style="color: #339933;">,</span> adsense<span style="color: #339933;">,</span> advertising<span style="color: #339933;">,</span> affiliate<span style="color: #339933;">,</span> AJAX<span style="color: #339933;">,</span> amazon<span style="color: #339933;">,</span>
analytics<span style="color: #339933;">,</span> anti<span style="color: #339933;">-</span>spam<span style="color: #339933;">,</span> api<span style="color: #339933;">,</span> archive<span style="color: #339933;">,</span> atom<span style="color: #339933;">,</span> audio<span style="color: #339933;">,</span> authentication<span style="color: #339933;">,</span> author<span style="color: #339933;">,</span> automatic<span style="color: #339933;">,</span> Avatar<span style="color: #339933;">,</span>
blog<span style="color: #339933;">,</span> blogroll<span style="color: #339933;">,</span> book<span style="color: #339933;">,</span> bookmark<span style="color: #339933;">,</span> bookmarking<span style="color: #339933;">,</span> bookmarks<span style="color: #339933;">,</span> buddypress<span style="color: #339933;">,</span> button<span style="color: #339933;">,</span> calendar<span style="color: #339933;">,</span>
captcha<span style="color: #339933;">,</span> categories<span style="color: #339933;">,</span> category<span style="color: #339933;">,</span> cms<span style="color: #339933;">,</span> code<span style="color: #339933;">,</span> comment<span style="color: #339933;">,</span> comments<span style="color: #339933;">,</span> community<span style="color: #339933;">,</span> contact<span style="color: #339933;">,</span>
content<span style="color: #339933;">,</span> copyright<span style="color: #339933;">,</span> counter<span style="color: #339933;">,</span> CSS<span style="color: #339933;">,</span> custom<span style="color: #339933;">,</span> dashboard<span style="color: #339933;">,</span> database<span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #339933;">,</span> del<span style="color: #339933;">.</span>icio<span style="color: #339933;">.</span>us<span style="color: #339933;">,</span> Digg<span style="color: #339933;">,</span>
edit<span style="color: #339933;">,</span> editor<span style="color: #339933;">,</span> email<span style="color: #339933;">,</span> embed<span style="color: #339933;">,</span> event<span style="color: #339933;">,</span> events<span style="color: #339933;">,</span> excerpt<span style="color: #339933;">,</span> Facebook<span style="color: #339933;">,</span> feed<span style="color: #339933;">,</span> feeds<span style="color: #339933;">,</span> filter<span style="color: #339933;">,</span> flash<span style="color: #339933;">,</span>
flickr<span style="color: #339933;">,</span> footer<span style="color: #339933;">,</span> form<span style="color: #339933;">,</span> Formatting<span style="color: #339933;">,</span> gallery<span style="color: #339933;">,</span> google<span style="color: #339933;">,</span> google adsense<span style="color: #339933;">,</span> html<span style="color: #339933;">,</span> image<span style="color: #339933;">,</span> images<span style="color: #339933;">,</span>
integration<span style="color: #339933;">,</span> iphone<span style="color: #339933;">,</span> javascript<span style="color: #339933;">,</span> jquery<span style="color: #339933;">,</span> language<span style="color: #339933;">,</span> lightbox<span style="color: #339933;">,</span> <span style="color: #990000;">link</span><span style="color: #339933;">,</span> links<span style="color: #339933;">,</span> <span style="color: #990000;">list</span><span style="color: #339933;">,</span> login<span style="color: #339933;">,</span> <span style="color: #990000;">mail</span><span style="color: #339933;">,</span>
manage<span style="color: #339933;">,</span> maps<span style="color: #339933;">,</span> media<span style="color: #339933;">,</span> menu<span style="color: #339933;">,</span> meta<span style="color: #339933;">,</span> mobile<span style="color: #339933;">,</span> mp3<span style="color: #339933;">,</span> music<span style="color: #339933;">,</span> myspace<span style="color: #339933;">,</span> navi<span style="color: #339933;">,</span> navigation<span style="color: #339933;">,</span> News<span style="color: #339933;">,</span>
nofollow<span style="color: #339933;">,</span> notification<span style="color: #339933;">,</span> page<span style="color: #339933;">,</span> pages<span style="color: #339933;">,</span> password<span style="color: #339933;">,</span> paypal<span style="color: #339933;">,</span> performance<span style="color: #339933;">,</span> permalink<span style="color: #339933;">,</span> photo<span style="color: #339933;">,</span>
photos<span style="color: #339933;">,</span> php<span style="color: #339933;">,</span> picture<span style="color: #339933;">,</span> pictures<span style="color: #339933;">,</span> plugin<span style="color: #339933;">,</span> plugins<span style="color: #339933;">,</span> Post<span style="color: #339933;">,</span> posts<span style="color: #339933;">,</span> profile<span style="color: #339933;">,</span> quotes<span style="color: #339933;">,</span> random<span style="color: #339933;">,</span>
Reddit<span style="color: #339933;">,</span> redirect<span style="color: #339933;">,</span> register<span style="color: #339933;">,</span> registration<span style="color: #339933;">,</span> related<span style="color: #339933;">,</span> rss<span style="color: #339933;">,</span> scroll<span style="color: #339933;">,</span> search<span style="color: #339933;">,</span> security<span style="color: #339933;">,</span> seo<span style="color: #339933;">,</span> Share<span style="color: #339933;">,</span>
sharing<span style="color: #339933;">,</span> shortcode<span style="color: #339933;">,</span> sidebar<span style="color: #339933;">,</span> simple<span style="color: #339933;">,</span> slideshow<span style="color: #339933;">,</span> social<span style="color: #339933;">,</span> spam<span style="color: #339933;">,</span> statistics<span style="color: #339933;">,</span> stats<span style="color: #339933;">,</span> Style<span style="color: #339933;">,</span> tag<span style="color: #339933;">,</span>
tags<span style="color: #339933;">,</span> technorati<span style="color: #339933;">,</span> template<span style="color: #339933;">,</span> text<span style="color: #339933;">,</span> theme<span style="color: #339933;">,</span> themes<span style="color: #339933;">,</span> thumbnail<span style="color: #339933;">,</span> <span style="color: #990000;">time</span><span style="color: #339933;">,</span> TinyMCE<span style="color: #339933;">,</span> title<span style="color: #339933;">,</span> tracking<span style="color: #339933;">,</span>
tweet<span style="color: #339933;">,</span> twitter<span style="color: #339933;">,</span> update<span style="color: #339933;">,</span> upload<span style="color: #339933;">,</span> url<span style="color: #339933;">,</span> user<span style="color: #339933;">,</span> users<span style="color: #339933;">,</span> video<span style="color: #339933;">,</span> widget<span style="color: #339933;">,</span> widgets<span style="color: #339933;">,</span> wordpress<span style="color: #339933;">,</span> wpmu<span style="color: #339933;">,</span>
xml<span style="color: #339933;">,</span> yahoo<span style="color: #339933;">,</span> youtube navigation		
&nbsp;
<span style="color: #339933;">&lt;</span>a title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Wordpress Plugins&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.wordpress----plugin.org/&quot;</span><span style="color: #339933;">&gt;</span>Click
<span style="color: #b1b100;">for</span> Beautiful Wordpress Plugins<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Da ist ein Link zur WordPress-Pluginseite. Wirklich? Nein! (Deshalb habe ich drei Striche zu der Adresse hinzugefügt.) Um seinen Betrug zu perfektionieren hat der Spammer tatsächlich eine Domain registriert. Diese Seite listet einige andere Plugins auf, die in ähnlicher Weise infiziert sind, es wurden aber nicht die Namen geändert. Was für eine Ehre für pagebar! Ich denke, ich sollte die anderen Autoren über diese Spam-Attacke informieren.</p>
<h3>Die Spamseite</h3>
<p>Mutig wie ich bin habe ich die Seite besucht, auf die der Spammer verweist:</p>
<p><a href="http://elektroelch.net/wp-content/uploads/2010/11/10.11.png" rel="lightbox[615]"></a><a href="http://elektroelch.net/wp-content/uploads/2010/11/10.111.png" rel="lightbox[615]"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-50" src="http://elektroelch.net/wp-content/uploads/2010/11/10.111.png" alt="" width="997" height="443" /></a></p>
<p>Sieht wie eine typische Seite über WordPress-Plugins aus. Der Quellcode enthäkt keinen verdächtigen Javascript- oder Flashcode. Weiter unten ist sogar richtiger Inhalt:</p>
<p><a href="http://elektroelch.net/wp-content/uploads/2010/11/10.11.1.png" rel="lightbox[615]"><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.net/wp-content/uploads/2010/11/10.11.1.png" alt="" width="433" height="418" class="aligncenter size-full wp-image-51" /></a></p>
<p>Sieht wie echter Inhalt aus. Wie man sieht, gibt es sogar Kommentare:</p>
<p><cite></p>
<ul>
<li>John says:<br />
September 8, 2010 at 8:27 am</p>
<p>hey man, nice blog…really like it and added it to bookmarks. keep up with good work
</li>
<li>
Anton Dirksma says:<br />
September 8, 2010 at 10:46 am</p>
<p>Hey, very nice website. I actually came across this on Bing, and I am happy I did. I will definately be coming back here more often. Wish I could add to the conversation and bring a bit more to the table, but am just absorbing as much info as I can at the moment. Thank You</li>
</ul>
<p></cite><br />
Die Liste geht so immer weiter. Auf den ersten Blick sieht das richtig echt aus, aber wenn man sich die Kommentare und die Zeit der Kommentare näher ansieht erkennt man, dass sie automatisch erstellt wurden.</p>
<h3>Hinter der Bühne</h3>
<p>Wer steckt hinter dem Ganzen? Fragen wir nic.com:</p>
<dl>
<dd>
Registrant:<br />
111waystomakemoney</p>
<p>hyderabad<br />
india<br />
hyderabad, Andhra Pradesh 500016<br />
India</p>
<p>Registered through: GoDaddy.com, Inc. (http://www.godaddy.com)<br />
Domain Name: 111WAYSTOMAKEMONEY.COM<br />
Created on: 30-Aug-10<br />
Expires on: 30-Aug-11<br />
Last Updated on: 30-Aug-10
</dd>
</dl>
<p>Wie ich vermutet habe, ein Typ aus Indien (Rahul ist ein typischer Name in Bollywood-Filmen). Richtig lustig wird es, wenn man die Adresse bei Google Maps eingibt: es ist der Begumpet Flughafen. LOL!</p>
<h3>Zusammenfassung</h3>
<p>Alles in allem ist es Spam, aber einen Schritt weiter. Der durchschnittliche WordPress-Benutzer erwartet keinen Spam in Plugins und, wenn ich die GPL richtig verstanden habe, kann man auch nicht viel dagegen machen. Alle gekaperten Plugins sind unter der GPL veröffentlicht worden. <b>Jeder</b> kann damit <b>fast alles</b> machen, solange er den Code wieder unter der GPL veröffentlicht. Der Spammer macht nichts Illegales und selbst wenn er würde, wie groß sind die Chancen es zu unterbinden? Null. Wir können lediglich ein Auge auf die Seite haben und alle Autoren, deren Plugins betroffen sind, davon informieren.</p>
<p>Moment, etwas können wir doch machen, nämlich uns bei der Mannschaft von Automattic zu bedanken, dass sie solche Spam-Plugins schnell von der offiziellen Plugin-Seite entfernt haben!</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2010/11/10/interessante-neue-art-von-wordpress-spam/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>E-Mails mit WordPress versenden</title>
		<link>http://elektroelch.de/blog/2010/11/08/e-mails-mit-wordpress-versenden/</link>
		<comments>http://elektroelch.de/blog/2010/11/08/e-mails-mit-wordpress-versenden/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 14:57:23 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=614</guid>
		<description><![CDATA[Wenn man mit PHP eine E-Mail versenden möchte kann man natürlich auf die interne mail-Funktion zurückgreifen. Diese Funktion ist allerdings sehr grundlegend und häufig fehlen die nötigen Voraussetzungen auf dem System. Einen Ausweg bieten PHP-Frameworks wie z.B. Zend, CodeIgniter oder Symfony, die eine bequeme API anbieten. WordPress ist zwar kein allgemeines PHP-Framework wie die oben [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn man mit PHP eine E-Mail versenden möchte kann man natürlich auf die interne <a href="http://de.php.net/manual/de/book.mail.php">mail-Funktion</a> zurückgreifen. Diese Funktion ist allerdings sehr grundlegend und häufig fehlen die nötigen Voraussetzungen auf dem System.</p>
<p>Einen Ausweg bieten PHP-Frameworks wie z.B. <a href="http://framework.zend.com/manual/en/zend.mail.html">Zend</a>, <a href="http://codeigniter.com/user_guide/libraries/email.html">CodeIgniter</a> oder <a href="http://www.symfony-project.org/cookbook/1_2/en/email">Symfony</a>, die eine bequeme API anbieten.</p>
<p>WordPress ist zwar kein allgemeines PHP-Framework wie die oben genannten Beispiele, aber es enthält eine Fülle von Funktionen, die bei der Programmierung von Plugins von Hilfe sein können. So gibt es natürlich auch eine Funktion, die das Versenden von E-Mails ermöglicht.</p>
<p><span id="more-614"></span><br />
Diese Funktion trägt den Namen <code>wp_mail()</code> und ist in der Datei <code><a href="http://phpxref.ftwr.co.uk/wordpress/wp-includes/pluggable.php.source.html#l234">&#8230;/wp-includes/pluggable.php</a></code> definiert.</p>
<h3>Die Funktion wp_mail</h3>
<p>Im <a href="http://codex.wordpress.org/Function_Reference/wp_mail">Codex</a> ist die formale Definition von <code>wp_mail()</code> beschrieben:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> ?php wp_mail<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attachments</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>Die Parameter haben dabei folgende Bedeutung:</p>
<dl> <strong>$to</strong></p>
<dd>Empfänger der Mail. Es kann mehr als ein Empfänger angegeben werden, indem man ein Array oder ein Liste mit komma-getrennten Namen angibt.</dd>
<p><strong>$subject</strong></p>
<dd>Ein String, der das <em>Betreff</em> der Mail enthält.</dd>
<p><strong>$message</strong></p>
<dd>Dieser String enthält den Inhalt der Mail. </dd>
<p><strong>$headers</strong></p>
<dd>Header, die mit der Mail mitversand werden sollen (optional).</dd>
<p><strong>$attachments</strong><br />
Anhänge, die mit der Mail versand werden sollen (optional).</p>
</dl>
<h3>Hello world!</h3>
<p>Die einfachste Möglichkeit eine Mail zu versenden sieht dementsprechend folgendermaßen aus:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> wp_mail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;a class=&quot;linkification-ext&quot; title=&quot;Linkification: mailto:ich@beispiel.net&quot; href=&quot;mailto:ich@beispiel.net&quot;&gt;ich@beispiel.net&lt;/a&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hallo Welt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hört mich jemand?'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Eine Mail per WordPress-API ist also ganz einfach. Auf den ersten Blick fällt allerdings auf, dass es keinen Parameter für die Mailadresse des Absenders gibt. Auf den zweiten Blick, dass kein SMTP-Host für den Versand der Mail angegeben werden kann.<br />
Als Absendername wird &#8222;WordPress&#8220; und Absenderadresse <code>wordpress@servername</code> als Vorgabe genommen und ein evtl. &#8222;www&#8220; entfernt:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$from_name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'WordPress'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sitename</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SERVER_NAME'</span><span style="color: #009900;">&#93;</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: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sitename</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'www.'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$sitename</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sitename</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Die Angaben des SMTP-Hosts und des Ports werden aus der php.ini übernommen. Diese sollten auf dem WordPress-System also korrekt gesetzt sein.</p>
<h3>Anpassen der Vorgaben</h3>
<p>Wie eben beschrieben werden alle Mails mit vorgegebenen Werten für den Absendernamen und die Absenderadresse verschickt. Will man diese Angaben ändern, müssen entsprechende Filterfunktionen benutzt werden.</p>
<dl> <strong>Ändern des Absendernamens:</strong></p>
<dd>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_mail_from_name'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> my_name<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'Latz'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

</dd>
</dl>
<dl> <strong>Ändern der Absenderadresse:</strong></p>
<dd>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_mail_from'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_address'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> my_name<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;a class=&quot;linkification-ext&quot; title=&quot;Linkification: mailto:Latz@wp.de&quot; href=&quot;mailto:Latz@wp.de&quot;&gt;Latz@wp.de&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

</dd>
</dl>
<dl>Eine weitere Möglichkeit Absendernamen und -adresse zu ändern ist die direkte Modifizierung des Mailheaders:</p>
<dd>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From: Latz '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;rn&quot;</span><span style="color: #339933;">;</span>
wp_mail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;a class=&quot;linkification-ext&quot; title=&quot;Linkification: mailto:ich@beispiel.net&quot; href=&quot;mailto:ich@beispiel.net&quot;&gt;ich@beispiel.net&lt;/a&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hallo Welt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hört mich jemand?'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</dd>
</dl>
<p>Des weiteren gibt es noch die Filter <code>wp_mail_charset</code> und <code>wp_mail_content_type</code>, die genau wie oben benutzt werden.</p>
<p>Als letztes existiert noch ein Filter (<code>wp_mail_original_content</code>), mit dem man den Inhalt der Email verändern kann, die erstellt wird, wenn man einen Artikel per Email sendet.</p>
<h3>Anhänge</h3>
<p>Natürlich ist es auch möglich auf einfache Weise eine oder mehrere Anhänge zu verschicken. Dazu muss an die <code>wp_mail</code>-Funktion ein Array mit Dateinamen übergeben werden:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$anhang</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>WP_CONTENT_DIR <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/uploads/anhang.zip'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_mail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;a class=&quot;linkification-ext&quot; title=&quot;Linkification: mailto:ich@beispiel.net&quot; href=&quot;mailto:ich@beispiel.net&quot;&gt;ich@beispiel.net&lt;/a&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hallo Welt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hört mich jemand?'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$anhang</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Rückgabewert</h3>
<p>Die Funktion gibt als Rückgabe einen Bool-Wert zurück. Das bedeutet allerdings nicht, dass beim  Rückgabewert &#8222;TRUE&#8220;  die Mail versandt und insbesondere nicht, dass sie empfangen wurde. Er bedeutet lediglich, dass sie korrekt an den SMTP-Host übergeben wurde, was danach mit der Mail passiert kann vom Skript nicht mehr kontrolliert werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2010/11/08/e-mails-mit-wordpress-versenden/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dickes P</title>
		<link>http://elektroelch.de/blog/2010/07/07/dickes-p/</link>
		<comments>http://elektroelch.de/blog/2010/07/07/dickes-p/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 12:53:26 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=602</guid>
		<description><![CDATA[Wie wird WordPress &#8222;richtig&#8220; geschrieben? Variationen gibt es viele: Wordpress, Word Press, WordPress, wordPress, WORDPRESS,  WoRdPrEsS Welche Version ist nun richtig? Die klare Antwort: WordPress, mit einem großen P. Am häufigsten wird es aber wohl einfach WordPress, zum einen aus Unwissenheit zum anderen aber auch einfach als Bequemlichkeit. Das &#8222;Problem&#8220; hat es sogar zu einer [...]]]></description>
			<content:encoded><![CDATA[<p>Wie wird WordPress &#8222;richtig&#8220; geschrieben? Variationen gibt es viele:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Wordpress<span style="color: #339933;">,</span> Word Press<span style="color: #339933;">,</span> WordPress<span style="color: #339933;">,</span> wordPress<span style="color: #339933;">,</span> WORDPRESS<span style="color: #339933;">,</span>  WoRdPrEsS</pre></div></div>

<p>Welche Version ist nun richtig? Die klare Antwort: <em>WordPress</em>, mit einem großen P. Am häufigsten wird es aber wohl einfach <em>WordPress</em>, zum einen aus Unwissenheit zum anderen aber auch einfach als Bequemlichkeit. </p>
<p>Das &#8222;Problem&#8220; hat es sogar zu einer eigenen Webseite gebracht (<a href="http://www.wpcamelcase.com">www.wpcamelcase.com</a>). Aber warum muss man es dem Nutzer aufbürden, sich Gedanken um die Schreibweise zu machen, dafür gibt es schließlich den Computer. In der Version 3.0 wurde von Matt persönlich folgende Funktion in den WordPress-Core eingefügt:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Forever eliminate &quot;Wordpress&quot; from the planet (or at least the little bit we can influence).
 *
 * Violating our coding standards for a good function name.
 *
 * @since 3.0.0&lt;strong&gt;
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> capital_P_dangit<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$text</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #b1b100;">return</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Wordpress'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'WordPress'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>strong<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Alles in allem doch eine sehr schöne Lösung um das Problem zu lösen&#8230; oder doch nicht? </p>
<p>In der <a href="http://lists.automattic.com/pipermail/wp-hackers/">wp-hackers</a>-Mailingliste entspann sich auf jeden Fall entspann sich unter dem Titel <a href="http://lists.automattic.com/pipermail/wp-hackers/2010-July/thread.html#32914">Putting the P in WordPress</a> eine ausufernde Diskussion über den Sinn und Unsinn dieser Funktion. Ich möchte versuchen, hier die Argumente etwas zu sortieren.</p>
<p><em>Argument</em>: unnötiges Aufblähen des Programmcodes<br />
<em>Gegenargument</em>: ist ja nur eine klitzekleine Funktion</p>
<p><em>Argument</em>: der Inhalt eines Artikels sollte nicht vom Programm geändert werden<br />
<em>Gegenargument</em>: der Inhalt wird schon vielen Stellen geändert (emoticons, autop, shortcodes, texturize, special characters, curly quotes, tag balancing, filtered HTML / kses, comment link<br />
nofollows, &#8230;)</p>
<p><em>Argument</em>: Links auf Bilder werden u.U. so geändert, das die Bilder nicht mehr angezeigt werden.<br />
<em>Gegenargument</em>: Wer nutzt denn Großbuchstaben in Dateinamen?</p>
<p><em>Argument</em>: &#8222;WordPress&#8220; ist ein Markenzeichen und muss geschützt werden.<br />
<em>Gegenargument</em>: Ist mir doch egal und völlig unwichtig.</p>
<p><em>Argument</em>: Matt Mullenweg missbraucht seine Stellung als &#8222;benevolent dictator&#8220;<br />
<em>Gegenargument</em>: Einer muss ja das Sagen haben</p>
<p><em>Argument</em>: Es gab keine ausreichende Diskussion über das Thema<br />
<em>Gegenargument</em>: Laut Matt gab es eine Diskussion</p>
<p>Die Liste ist sicher subjektiv und es gab sicher noch viel mehr Argumente (es sind immerhin über 110 Nachrichten bisher), aber dies sind diejenigen, die mir am Wichtigsten erscheinen.</p>
<p>Als Lösungen wurden vorgeschlagen:</p>
<ul>
<li>komplettes Entfernen der Funktion</li>
<li>Auslagern in ein (Core-) Plugin</li>
<li>im Editor als &#8222;Schreibfehler&#8220; erkennen</li>
<li>als (Opt-In-) Einstellung anbieten</li>
<li>als (Opt-Out-) Einstellung anbieten</li>
</ul>
<p>Es stellt sich natürlich die Frage, wie wichtig eine solche Diskussion ist (und wie wichtig ein Artikel über diese Diskussion!). Überraschend auch die rege Beteiligung, denn normalerweise sind die Threads in dieser Mailingliste nicht so lang. Einfache Antwort: endlich mal was Nicht-Technisches, an dem sich jeder beteiligen kann, auch ohne fundiertes Wissen über den Core-Code.</p>
<p>Jetzt bleibt nur noch abzuwarten, ob sich aus der Diskussion etwas Substantielles ergibt oder ob sie sich irgendwann im Sande verläuft. Popcorn steht auf jeden Fall bereit.</p>
<p><b>Update (8 July 10)</b>: Hier noch einige Links (englischsprachig)</p>
<ul>
<li><a href="http://justintadlock.com/archives/2010/07/08/lowercase-p-dangit">Lowercase p, dangit!</a> von Justin Tadlock</li>
<li><a href="http://benjaminbradley.com/wordpress/the-dangit-filter/">The dangit filter</a> von Benjamin Bradley</li>
<li><a href="http://www.wptavern.com/automatically-correcting-the-wordpress-mistake">Automatically Correcting The WordPress Mistake</a> von Jeff Chandler</li>
<li><a href="http://core.trac.wordpress.org/changeset/14996">Changeset 14996</a>  – Das ursprüngliche trac ticket </li>
</ul>
<p>(Links via <a href="http://www.themelab.com">themelab.com</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2010/07/07/dickes-p/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

