<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>wordpress Archives - My Silly Point of View</title>
	<atom:link href="https://mysillypointofview.com/tag/wordpress-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://mysillypointofview.com</link>
	<description>it&#039;s my blog anyway</description>
	<lastBuildDate>Wed, 29 Aug 2012 11:47:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.13</generator>
<site xmlns="com-wordpress:feed-additions:1">13951596</site>	<item>
		<title>How to fix WordPress permalinks on Mac OS X&#8217;s localhost</title>
		<link>https://mysillypointofview.com/2012/08/29/how-to-fix-wordpress-permalinks-on-mac-os-xs-localhost/</link>
					<comments>https://mysillypointofview.com/2012/08/29/how-to-fix-wordpress-permalinks-on-mac-os-xs-localhost/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Wed, 29 Aug 2012 14:27:46 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[permalinks]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.richardferaro.com/?p=773</guid>

					<description><![CDATA[<p>I recently installed a WordPress blog in my localhost using Mac OS X&#8217;s built in Apache and PHP with MySQL to test a functionality when I decided to update the permalinks to use a different format other than the default setting. When I tested the new URL, I was greeted with the following error: Not [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2012/08/29/how-to-fix-wordpress-permalinks-on-mac-os-xs-localhost/">How to fix WordPress permalinks on Mac OS X&#8217;s localhost</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I recently installed a WordPress blog in my localhost using Mac OS X&#8217;s built in Apache and PHP with MySQL to test a functionality when I decided to update the permalinks to use a different format other than the default setting. When I tested the new URL, I was greeted with the following error:</p>
<p><strong>Not Found</strong><br />
The requested URL /~user/wordpress/category/sample/ was not found on this server.<br />
Apache/2.2.21 (Unix) DAV/2 PHP/5.3.10 with Suhosin-Patch Server at localhost Port 80</p>
<p><span id="more-773"></span></p>
<p>To fix this, create a file and name it <code>&lt;username&gt;.conf</code>, where <strong>username</strong> is your user account&#8217;s <em>short name</em>. Paste the text below within the file:</p>
<p><code>&lt;Directory "/Users/username/Sites/"&gt;<br />
Options Indexes MultiViews FollowSymLinks<br />
AllowOverride All AuthConfig<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</code></p>
<p>Save the file and make sure it uses the <code>.conf</code> extension. Copy the file to this location (you may need to provide your credentials to overwrite the current one):</p>
<p><code>/etc/apache2/users/</code></p>
<p>Restart Apache to apply the changes by running the following in the Terminal:</p>
<p><code>sudo apachectl restart</code></p>
<p>Reapply your permalinks in the WordPress admin by choosing the default option and then setting it back to your desired format.</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2012/08/29/how-to-fix-wordpress-permalinks-on-mac-os-xs-localhost/">How to fix WordPress permalinks on Mac OS X&#8217;s localhost</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2012/08/29/how-to-fix-wordpress-permalinks-on-mac-os-xs-localhost/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">773</post-id>	</item>
		<item>
		<title>How to create a new Magento customer account from an external site?</title>
		<link>https://mysillypointofview.com/2011/02/22/create-new-magento-customer-from-external-site/</link>
					<comments>https://mysillypointofview.com/2011/02/22/create-new-magento-customer-from-external-site/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Tue, 22 Feb 2011 00:00:08 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.richardferaro.com/?p=655</guid>

					<description><![CDATA[<p>I&#8217;ve been receiving a lot of inquiries on how to create a new customer record on the fly using Mage.php or using the plugin Mage Enabler for WordPress. So, to save you time and also to provide a thread for this specific topic, here&#8217;s how to accomplish it. First, include the file Mage.php from your [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2011/02/22/create-new-magento-customer-from-external-site/">How to create a new Magento customer account from an external site?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve been receiving a lot of inquiries on how to create a new customer record on the fly using <code>Mage.php</code> or using the plugin <a href="http://wordpress.org/extend/plugins/mage-enabler/">Mage Enabler</a> for WordPress. So, to save you time and also to provide a thread for this specific topic, here&#8217;s how to accomplish it.</p>
<p><span id="more-655"></span>First, include the file <code>Mage.php</code> from your Magento installation to your PHP file. Doing this will enable you to connect to your shop using the Mage object.</p>
<p><strong>If you&#8217;re using Mage Enabler for WordPress, you may skip this part:</strong></p>
<pre class="brush: php; title: ; notranslate">&lt;?php
require_once (&quot;/your/magento/app/Mage.php&quot;);
umask(0);</pre>
<p>and here&#8217;s the rest of the code&#8230;</p>
<pre class="brush: php; first-line: 4; title: ; notranslate">// Customer Information
$firstname = &quot;John&quot;;
$lastname = &quot;Smith&quot;;
$email = &quot;johnsmith@localhost.local&quot;;
$password = &quot;myverysecretpassword&quot;;

// Website and Store details
$websiteId = Mage::app()-&gt;getWebsite()-&gt;getId();
$store = Mage::app()-&gt;getStore();

$customer = Mage::getModel(&quot;customer/customer&quot;);
$customer-&gt;website_id = $websiteId;
$customer-&gt;setStore($store);

try {
	// If new, save customer information
	$customer-&gt;firstname = $firstname;
	$customer-&gt;lastname = $lastname;
	$customer-&gt;email = $email;
	$customer-&gt;password_hash = md5($password);
	if($customer-&gt;save()){
		echo $customer-&gt;firstname.&quot; &quot;.$customer-&gt;lastname.&quot; information is saved!&quot;;
	}else{
		echo &quot;An error occured while saving customer&quot;;
	}
}catch(Exception $e){
	// If customer already exists, initiate login
	if(preg_match('/Customer email already exists/', $e)){
		$customer-&gt;loadByEmail($email);

		$session = Mage::getSingleton('customer/session');
		$session-&gt;login($email, $password);

		echo $session-&gt;isLoggedIn() ? $session-&gt;getCustomer()-&gt;getName().' is online!' : 'not logged in';
	}
}</pre>
<p>The above code tries to create a Magento customer account using the given parameters such as <code>$firstname</code>, <code>$lastname</code>, <code>$email</code> and <code>$password</code>. If the email doesn&#8217;t have a match in the database, the request proceeds. But if a match is found, it logs in the customer using the parameters <code>$email</code> and <code>$password</code> then checks if the customer is online or not logged in. There are actually more parameters that you can pass such as if you want to send confirmation message or not but these are the basic fields to help you get started.</p>
<p>I hope this will help you integrate the Magento registration to your external site <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2011/02/22/create-new-magento-customer-from-external-site/">How to create a new Magento customer account from an external site?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2011/02/22/create-new-magento-customer-from-external-site/feed/</wfw:commentRss>
			<slash:comments>31</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">655</post-id>	</item>
		<item>
		<title>Separating message and author in &#8216;Stray Random Quotes&#8217; WordPress plugin</title>
		<link>https://mysillypointofview.com/2011/01/30/separate-message-author-in-stray-random-plugin/</link>
					<comments>https://mysillypointofview.com/2011/01/30/separate-message-author-in-stray-random-plugin/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Sun, 30 Jan 2011 04:05:22 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<guid isPermaLink="false">http://mysillypointofview.richardferaro.com/?p=639</guid>

					<description><![CDATA[<p>I needed a plugin that can show random quotes with author options as well and I found Stray Random Quotes WordPress plugin could do the trick. The only problem is, the function to display the random quote directly outputs the text onscreen together with the author. What I need to do is to suppress the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2011/01/30/separate-message-author-in-stray-random-plugin/">Separating message and author in &#8216;Stray Random Quotes&#8217; WordPress plugin</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I needed a plugin that can show random quotes with author options as well and I found <a href="http://wordpress.org/extend/plugins/stray-quotes/">Stray Random Quotes</a> WordPress plugin could do the trick. The only problem is, the function to display the random quote directly outputs the text onscreen together with the author.</p>
<p><span id="more-639"></span>What I need to do is to suppress the display of the function output onscreen, pass it to a variable then do a split of the variable to separate the message and author in an array. See the code below on how I did it <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<pre class="brush: php; title: ; notranslate">&lt;?php 
if (function_exists('stray_random_quote')) 
// turn on output buffer
ob_start(); 
// run the function of the plugin
stray_random_quote('feedback',false,'',true,1,0,'Category','ASC',false,''); 
// get the content from the buffer
$string = ob_get_contents(); 
ob_end_clean();
// split the output and remove unnecessary HTML tags
$feedback = split('by',strip_tags($string));
// access the message
echo trim($feedback[0]);
// access the author
echo trim($feedback[1]);</pre>
<p>Pretty easy!</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2011/01/30/separate-message-author-in-stray-random-plugin/">Separating message and author in &#8216;Stray Random Quotes&#8217; WordPress plugin</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2011/01/30/separate-message-author-in-stray-random-plugin/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">639</post-id>	</item>
		<item>
		<title>How to fix the &#8216;The plugin does not have a valid header&#8217; error when activating a WordPress plugin</title>
		<link>https://mysillypointofview.com/2010/05/27/fix-the-plugin-does-not-have-a-valid-header-error/</link>
					<comments>https://mysillypointofview.com/2010/05/27/fix-the-plugin-does-not-have-a-valid-header-error/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Thu, 27 May 2010 00:03:27 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=420</guid>

					<description><![CDATA[<p>You want to extend WordPress&#8217; functionality and decided to download some plugins found in the Official WordPress Plugin repository. After searching the repo, you&#8217;ve found two plugins that accomplishes the tasks you needed to implement in your blog. Downloading the plugins gives you two ZIP files that when double-clicked, shows you the contents in the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/27/fix-the-plugin-does-not-have-a-valid-header-error/">How to fix the &#8216;The plugin does not have a valid header&#8217; error when activating a WordPress plugin</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>You want to extend WordPress&#8217; functionality and decided to download some plugins found in the <a href="http://wordpress.org/extend/plugins/">Official WordPress Plugin</a> repository. After searching the repo, you&#8217;ve found two plugins that accomplishes the tasks you needed to implement in your blog. Downloading the plugins gives you two ZIP files that when double-clicked, shows you the contents in the following format:</p>
<blockquote><p><strong>plugin-a.zip</strong></p>
<pre style="white-space: pre">plugin-a-folder
---- plugin-a-main-file.php
---- plugin-a-readme.txt</pre>
</blockquote>
<p></p>
<blockquote><p>
<strong>plugin-b.zip</strong></p>
<pre style="white-space: pre">plugin-b-folder
---- plugin-b-subfolder
-------- plugin-b-main-file.php
-------- plugin-b-readme.txt</pre>
</blockquote>
<p></p>
<p><span id="more-420"></span>There are two ways to install a plugin. <strong>Option 1</strong> is to unzip the file and upload the contents to <code>wordpress_root/wp-content/plugins/</code> directory. <strong>Option 2</strong> is to use the <code>Add New -&gt; Upload</code> option found in the left panel bar of the administrative page of WordPress. Let&#8217;s assume the two plugins went through the two installation options.</p>
<h4>Installing &#8216;plugin-a.zip&#8217; using Option 1</h4>
<ol>
<li>Unzip the file</li>
<li>Upload the contents to <code>wordpress_root/wp-content/plugins/</code></li>
<li>Login as admin and go to <code>Plugins -&gt; Installed</code>.</li>
<li>Locate plugin and click <span style="text-decoration:underline;">Activate</span> link.</li>
<li><strong>Result:</strong>
<div style="display:inline;border:1px solid #E6DB55;background:#FFFFE0;-moz-border-radius:3px 3px 3px 3px;padding:3px 10px;">Plugin <strong>activated.</strong></div>
</li>
</ol>
<h4>Installing &#8216;plugin-a.zip&#8217; using Option 2</h4>
<ol>
<li>Login as admin and go to <code>Plugins -&gt; Add New -&gt; Upload</code></li>
<li>Locate the file <code>plugin-a.zip</code> by clicking the <em>Browse</em> button.</li>
<li>Click <em>Install Now</em> button.</li>
<li><strong>Result:</strong><br />
	Unpacking the package?<br />
Installing the plugin?<br />
Plugin installed successfully.
	</li>
<li>Click <span style="text-decoration:underline;">Activate Plugin</span> link.</li>
<li><strong>Result:</strong>
<div style="display:inline;border:1px solid #E6DB55;background:#FFFFE0;-moz-border-radius:3px 3px 3px 3px;padding:3px 10px;">Plugin <strong>activated.</strong></div>
</ol>
<h4>Installing &#8216;plugin-b.zip&#8217; using Option 1</h4>
<ol>
<li>Unzip the file</li>
<li>Upload the contents to <code>wordpress_root/wp-content/plugins/</code></li>
<li>Login as admin and go to <code>Plugins -&gt; Installed</code>.</li>
<li>Locate plugin and click <span style="text-decoration:underline;">Activate</span> link.</li>
<li><span style="color:#FF0000;"><strong>Error:</strong> Plugin does not exists in the list.</span></li>
</ol>
<h4>Installing &#8216;plugin-b.zip&#8217; using Option 2</h4>
<ol>
<li>Login as admin and go to <code>Plugins -&gt; Add New -&gt; Upload</code></li>
<li>Locate the file <code>plugin-b.zip</code> by clicking the <em>Browse</em> button.</li>
<li>Click <em>Install Now</em> button.</li>
<li><strong>Result:</strong><br />
	Unpacking the package?<br />
Installing the plugin?<br />
Plugin installed successfully.
	</li>
<li>Click <span style="text-decoration:underline;">Activate Plugin</span> link.</li>
<li><span style="color:#FF0000;"><strong>WordPress ? Error</strong></span>
<div style="color:#333333;display:block;border:1px solid #DFDFDF;background:#FFFFFF;-moz-border-radius:11px 11px 11px 11px;font-family:'Lucida Grande',Verdana,Arial,'Bitstream Vera Sans',sans-serif;padding:1em 2em;">The plugin does not have a valid header.</div>
</ol>
<p>Based on our testing, <code>plugin-b.zip</code> seems to fail on both methods of installation. To find out what is causing the error, we have to understand how the plugin installation works. Upon checking the core files I found this excerpt in <strong>get_plugins()</strong> function:</p>
<blockquote><p>* WordPress only supports plugin files in the base plugins directory<br />
 * (wp-content/plugins) and in one directory above the plugins directory<br />
 * (wp-content/plugins/my-plugin). The file it looks for has the plugin data and<br />
 * must be found in those two locations. It is recommended that do keep your<br />
 * plugin files in directories.</p></blockquote>
<p>The plugin data that the function is looking for can be found below:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
/*
Plugin Name: Name Of The Plugin
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
Description: A brief description of the Plugin.
Version: The Plugin's Version Number, e.g.: 1.0
Author: Name Of The Plugin Author
Author URI: http://URI_Of_The_Plugin_Author
License: A &quot;Slug&quot; license name e.g. GPL2
*/
?&gt;</pre>
<p>So in order to properly install and activate a plugin, the following two conditions must be satisfied:</p>
<ul>
<li>that a plugin main file (.php) must be placed in <code>plugins</code> root folder or in <strong>first-level subdirectory within plugins folder</strong></li>
<li>and it should contain the necessary plugin data for identification/validation purposes</li>
</ul>
<p>In the case of <code>plugin-b.zip</code>, although the main PHP file contains the needed plugin data, the <strong>validate_plugin()</strong> function returned an error since neither the file can be found or check if it contains the plugin data because it is placed in the <strong>second level subdirectory</strong>, <span style="text-decoration:underline;">a directory location in which the function is not designed to scan the content.</span></p>
<p>To fix the <code>plugin-b.zip</code> file, it needs to have the following content structure:</p>
<blockquote><p><strong>plugin-b.zip</strong></p>
<pre style="white-space: pre">plugin-b-folder
---- plugin-b-main-file.php
---- plugin-b-readme.txt</pre>
</blockquote>
<p></p>
<p>I hope this post will enlighten WordPress users who wants to maximize their blog&#8217;s potential <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/27/fix-the-plugin-does-not-have-a-valid-header-error/">How to fix the &#8216;The plugin does not have a valid header&#8217; error when activating a WordPress plugin</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2010/05/27/fix-the-plugin-does-not-have-a-valid-header-error/feed/</wfw:commentRss>
			<slash:comments>35</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">420</post-id>	</item>
		<item>
		<title>Mage Enabler is now available for download in the Official WordPress Plugin repository!</title>
		<link>https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/</link>
					<comments>https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Wed, 12 May 2010 14:48:03 +0000</pubDate>
				<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=378</guid>

					<description><![CDATA[<p>I&#8217;m soooo happy to see my very first plugin to be released for everyone to use. I hope it will help a lot of Magento and WordPress users! Click! click! click!</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/">Mage Enabler is now available for download in the Official WordPress Plugin repository!</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://mysillypointofview.files.wordpress.com/2010/05/wordpress-e280ba-newest-c2ab-wordpress-plugins_1273645824215.png?resize=497%2C207"><img loading="lazy" src="http://mysillypointofview.files.wordpress.com/2010/05/wordpress-e280ba-newest-c2ab-wordpress-plugins_1273645824215.png?resize=497%2C207" alt="" title="Mage Enabler plugin" width="497" height="207" class="alignnone size-full wp-image-379" data-recalc-dims="1" /></a></p>
<p>I&#8217;m soooo happy to see my very first plugin to be released for everyone to use. I hope it will help a lot of Magento and WordPress users!</p>
<p><a href="http://wordpress.org/extend/plugins/mage-enabler/">Click! click! click!</a></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/">Mage Enabler is now available for download in the Official WordPress Plugin repository!</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">378</post-id>	</item>
		<item>
		<title>Mage Enabler: A plugin to run Magento&#039;s session within WordPress</title>
		<link>https://mysillypointofview.com/2010/05/11/mage-enabler/</link>
					<comments>https://mysillypointofview.com/2010/05/11/mage-enabler/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Tue, 11 May 2010 18:56:30 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=350</guid>

					<description><![CDATA[<p>Update (May 12, 2010): Mage Enabler is now available in the Official WordPress Plugin repository. Get it here! It&#8217;s been a while since I posted my tweak that allows Mage object to be utilized within any WordPress installation. The tweak requires the blog owner to modify functions.php as stated in my post. I&#8217;m inspired by [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/11/mage-enabler/">Mage Enabler: A plugin to run Magento&#039;s session within WordPress</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" class="alignnone size-full wp-image-365" title="mage_enabler" src="http://mysillypointofview.files.wordpress.com/2010/05/mage_enabler.png?resize=497%2C167" alt="Mage Enabler" width="497" height="167" data-recalc-dims="1" /></p>
<p><strong>Update (May 12, 2010):</strong> Mage Enabler is now available in the Official WordPress Plugin repository. <a href="http://wordpress.org/extend/plugins/mage-enabler/">Get it here!</a></p>
<p>It&#8217;s been a while since I posted my tweak that allows Mage object to be utilized within any WordPress installation. The tweak requires the blog owner to modify <strong>functions.php</strong> as stated in my <a href="http://mysillypointofview.wordpress.com/2010/04/08/how-to-use-magentos-session-within-wordpress/">post</a>. I&#8217;m inspired by the feedback of the readers who used the tweak so I decided that a plugin that does the same thing should be made to prevent modifying the WordPress core files thus preventing the tweak to cause inconsistencies when an upgrade is necessary.</p>
<p><span id="more-350"></span>It is my pleasure to introduce to you, <strong>Mage Enabler</strong> plugin. <del datetime="2010-05-12T06:31:45+00:00">Just copy the whole code snippet below and save it as <em>mage-enabler.php</em>. Place it inside a folder named <strong>mage-enabler</strong> together with the <em>readme.txt</em> available right after the code block.</del> Please take time to read and follow the readme.txt instruction on how to install the plugin in your WordPress setup.</p>
<h2>How to use the plugin?</h2>
<p>To show you how the plugin works, I&#8217;ve decided to convert my example in my previous <a href="http://mysillypointofview.wordpress.com/2010/04/08/how-to-use-magentos-session-within-wordpress/">post</a> by providing a single login page for both WordPress (subscriber) and Magento (customer). This setup assumes that the account credentials (subcriber/customer) in both database are the same and that the function collision problem between WordPress and Magento has been <a href="http://mysillypointofview.wordpress.com/2010/04/08/how-to-use-magentos-session-within-wordpress/">fixed</a>. If you followed the <strong>functions.php</strong> update in that post, <strong>remove the block of code added at line 4123 to 4138</strong>.</p>
<p>Location of functions.php</p>
<pre>path-to-your-root-htdocs/wordpress/wp-includes/functions.php</pre>
<p>Let&#8217;s start by opening the <strong>index.php</strong> file of the WordPress theme Twenty Ten. I&#8217;m using version 3.0-beta1 of WordPress in this article. You can replicate the same code update to any WordPress version and theme you have.</p>
<pre>wordpress_root\wp-content\themes\twentyten\index.php</pre>
<p>Copy the necessary codes (lines 16-18 and 22-40) to make it similar below:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php

/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty Ten
 * @since 3.0.0
 */
 if(class_exists('Mage')){
 	Mage::getSingleton('core/session', array('name' =&gt; 'frontend'));
 }
?&gt;

&lt;?php get_header(); ?&gt;
&lt;!-- Magento's custom greeting --&gt;
&lt;div style=&quot;font-size: 15px; margin-bottom: 15px; border-bottom: 1px solid #000; padding-bottom: 10px;&quot;&gt;
&lt;?php
if(class_exists('Mage')){
	$session = Mage::getSingleton(&quot;customer/session&quot;);
	$magento_message = &quot;Welcome &quot;;
	// Generate a personalize greeting
	if($session-&gt;isLoggedIn()){
		$magento_message .= $session-&gt;getCustomer()-&gt;getData('firstname').' ';
		$magento_message .= $session-&gt;getCustomer()-&gt;getData('lastname').'!';
	}else{
		$magento_message .= &quot;Guest!&quot;;
	}

	echo $magento_message;
}
?&gt;
&lt;/div&gt;
&lt;!-- End of Magento's custom greeting --&gt;</pre>
<p>The purpose of the code change above is to display a ?Welcome [customer name here]? when a customer is logged in, and show ?Welcome Guest? when they are not. <strong>Make sure that if you&#8217;re going to use any Magento related script in your code, always write it within the following if condition:</strong></p>
<pre class="brush: php; title: ; notranslate">if(class_exists('Mage')){
	// Write your Magento codes here
}</pre>
<p>This will prevent your page or theme files from breaking up if in case the plugin is deactivated, not working or if Mage.php can&#8217;t be found.</p>
<p>Open user.php file found at following address below:</p>
<pre>path-to-your-root-htdocs/wordpress/wp-includes/user.php</pre>
<p>Locate the function wp_authenticate_username_password()  and find the similar code below. I found mine at line 108.</p>
<pre class="brush: php; first-line: 108; title: ; notranslate">	if ( !wp_check_password($password, $userdata-&gt;user_pass, $userdata-&gt;ID) )
		return new WP_Error('incorrect_password', sprintf(__('&lt;strong&gt;ERROR&lt;/strong&gt;: Incorrect password. &lt;a href=&quot;%s&quot; title=&quot;Password Lost and Found&quot;&gt;Lost your password&lt;/a&gt;?'), site_url('wp-login.php?action=lostpassword', 'login')));</pre>
<p>Right after the code above, add the following code starting at line 111 to make it similar to the code below. This update allows us to run the login request of Magento within WordPress:</p>
<pre class="brush: php; first-line: 108; title: ; notranslate">	if ( !wp_check_password($password, $userdata-&gt;user_pass, $userdata-&gt;ID) )
		return new WP_Error('incorrect_password', sprintf(__('&lt;strong&gt;ERROR&lt;/strong&gt;: Incorrect password. &lt;a href=&quot;%s&quot; title=&quot;Password Lost and Found&quot;&gt;Lost your password&lt;/a&gt;?'), site_url('wp-login.php?action=lostpassword', 'login')));
	// Start Magento
	if(class_exists('Mage')){
		Mage::getSingleton('core/session', array('name' =&gt; 'frontend'));
		$session = Mage::getSingleton(&quot;customer/session&quot;);
		try{
			$login = $session-&gt;login($username, $password);
		}catch(Exception $e){
			// Do nothing
		}
	}</pre>
<p>Finally, to call the Magento&#8217;s logout function, locate the file below and open it:</p>
<pre>path-to-your-root-htdocs/wordpress/wp-login.php</pre>
<p>Find the switch case statement at line 352. Add the necessary code to make it similar to the code below and save it:</p>
<pre class="brush: plain; first-line: 352; title: ; notranslate">switch ($action) {

case 'logout' :
	check_admin_referer('log-out');
	// Start Magento
	if(class_exists('Mage')){
		Mage::getSingleton('core/session', array('name' =&gt; 'frontend'));
		Mage::getSingleton(&quot;customer/session&quot;)-&gt;logout();
	}
	wp_logout();</pre>
<p>Now test your WordPress by accessing the homepage at http://localhost/wordpress/. It should display the &#8216;Welcome Guest&#8217; similar to the image below with a cookie named as &#8216;frontend&#8217; in your Firebug cookie tab. That is your Magento cookie.</p>
<figure id="attachment_304" aria-describedby="caption-attachment-304" style="width: 489px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_home.png?resize=489%2C516"><img loading="lazy" class="size-full wp-image-304 " title="A Test WordPress homepage showing the default welcome message for Magento" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_home.png?resize=489%2C516" alt="A Test WordPress homepage showing the default welcome message for Magento" width="489" height="516" data-recalc-dims="1" /></a><figcaption id="caption-attachment-304" class="wp-caption-text">A Test WordPress homepage showing the default welcome message for Magento</figcaption></figure>
<p>Clicking the login for WordPress redirects us to the login form like the one below while still showing the &#8216;frontend&#8217; cookie. Since I have a customer with same credentials on both Magento (Customer) and WordPress (set as Subscriber), all I have to do is to use the username and password to login in the form below.</p>
<figure id="attachment_306" aria-describedby="caption-attachment-306" style="width: 486px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_login.png?resize=486%2C455"><img loading="lazy" class="size-full wp-image-306 " title="A Test WordPress login page with a generated Magento cookie" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_login.png?resize=486%2C455" alt="A Test WordPress login page with a generated Magento cookie" width="486" height="455" data-recalc-dims="1" /></a><figcaption id="caption-attachment-306" class="wp-caption-text">A Test WordPress login page with a generated Magento cookie</figcaption></figure>
<p>At this point, your Magento session should be running with an active customer session. To check if it does, go back to your homepage by clicking the top header text or going to http://localhost/wordpress/. It should display now the welcome message with your customer&#8217;s name.</p>
<figure id="attachment_308" aria-describedby="caption-attachment-308" style="width: 486px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_with_active_customer.png?resize=486%2C500"><img loading="lazy" class="size-full wp-image-308 " title="A Test WordPress homepage showing the customer's name in the welcome message" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_with_active_customer.png?resize=486%2C500" alt="A Test WordPress homepage showing the customer's name in the welcome message" width="486" height="500" data-recalc-dims="1" /></a><figcaption id="caption-attachment-308" class="wp-caption-text">A Test WordPress homepage showing the customer&#039;s name in the welcome message</figcaption></figure>
<p>For those who will use this plugin, let me know the version of WordPress and Magento you&#8217;re using so I can keep track of the list of versions in which this plugin is compatible. <del datetime="2010-05-12T06:31:45+00:00">Until such time that the plugin is moved to the Official WordPress Plugin repository, I&#8217;ll accept and answer inquiries here thru comment/feedback form below.</del> Mage Enabler is now available in the Official WordPress Plugin repository. <a href="http://wordpress.org/extend/plugins/mage-enabler/">Get it here!</a></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/11/mage-enabler/">Mage Enabler: A plugin to run Magento&#039;s session within WordPress</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2010/05/11/mage-enabler/feed/</wfw:commentRss>
			<slash:comments>205</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">350</post-id>	</item>
		<item>
		<title>WordCamp Philippines on October 2010!</title>
		<link>https://mysillypointofview.com/2010/04/28/wordcamp-philippines-on-october-2010/</link>
					<comments>https://mysillypointofview.com/2010/04/28/wordcamp-philippines-on-october-2010/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 00:00:50 +0000</pubDate>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[WordCamp]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=339</guid>

					<description><![CDATA[<p>I&#8217;m sooo excited about this! For those who don&#8217;t know what WordCamp is, here is an excerpt from their site: WordCamp is a conference that focuses on everything WordPress. WordCamps are informal, community-organized events that are put together by WordPress users like you. Everyone from casual users to core developers participate, share ideas, and get [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/04/28/wordcamp-philippines-on-october-2010/">WordCamp Philippines on October 2010!</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m sooo excited about this! For those who don&#8217;t know what WordCamp is, here is an excerpt from their <a href="http://philippines.wordcamp.org/what-is-wordcamp/">site</a>:</p>
<blockquote><p>WordCamp is a conference that focuses on everything WordPress.</p>
<p>WordCamps are informal, community-organized events that are put together by WordPress users like you. Everyone from casual users to core developers participate, share ideas, and get to know each other.  WordCamps are open to WordPress.com and WordPress.org users alike.</p></blockquote>
<p>It is scheduled on October 2 this year and they haven&#8217;t publish any details yet, but what the heck! I&#8217;m still going! So fellow WordPress bloggers, hop on to our mothership!</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/04/28/wordcamp-philippines-on-october-2010/">WordCamp Philippines on October 2010!</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2010/04/28/wordcamp-philippines-on-october-2010/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">339</post-id>	</item>
		<item>
		<title>How to use Magento&#8217;s session within WordPress</title>
		<link>https://mysillypointofview.com/2010/04/08/how-to-use-magentos-session-within-wordpress/</link>
					<comments>https://mysillypointofview.com/2010/04/08/how-to-use-magentos-session-within-wordpress/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Thu, 08 Apr 2010 21:38:31 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=283</guid>

					<description><![CDATA[<p>Update (May 11, 2010): I created a WordPress plugin for this one. Check it out here. You have a free WordPress blog that has been online for sometime. You love its simple yet powerful way of managing your content so you&#8217;ve decided to have it hosted to a different provider in order to have a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/04/08/how-to-use-magentos-session-within-wordpress/">How to use Magento&#8217;s session within WordPress</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>Update (May 11, 2010):</strong> I created a WordPress plugin for this one. Check it out <a href="http://mysillypointofview.wordpress.com/2010/05/11/mage-enabler/">here</a>.</p>
<p>You have a free WordPress blog that has been online for sometime. You love its simple yet powerful way of managing your content so you&#8217;ve decided to have it hosted to a different provider in order to have a more granular control to its code and functionality. Eventually, you needed cash to support the hosting expenses so you decided to utilize your blog for e-commerce use. That&#8217;s when Magento comes in to the scene. You want to find a way to use Magento as your backend while pulling your catalog and customer information to be posted to WordPress site. This is what my article is for.</p>
<p><span id="more-283"></span>Since your WordPress will serve as the frontend, you don&#8217;t have to worry about where the database for Magento will be located as long as you have a local access to the Mage.php file in order to extend all Magento&#8217;s functionality to your WordPress pages. My current setup is still the same with the rest of my post here having &#8216;htdocs&#8217; as my root directory, magento has its own subdirectory &#8216;htdocs/magento&#8217; as well as wordpress in &#8216;htdocs/wordpress&#8217;. The goal here is to able to use Magento as if it is a native function within our WordPress installation.</p>
<p>Since there is an existing function collision between Magento and WordPress because both application has an existing translator function named <strong>__()</strong>, our first task is to automatically detect if the function already exists and disable it in Magento and run as usual if it doesn&#8217;t.</p>
<p><del datetime="2010-05-11T14:41:01+00:00">To do that, locate the file below in your Magento installation:</del><br />
Copy the file <strong>functions.php</strong> below from your Magento core folder</p>
<pre>path:to-your-htdocs/magento/app/code/core/Mage/Core/functions.php</pre>
<p>and paste it in the Magento local folder which can be found below and open it for editing (create needed folders if it doesn&#8217;t exists):</p>
<pre>path:to-your-htdocs/magento/app/code/local/Mage/Core/functions.php</pre>
<p>Locate the function <strong>__()</strong> or go to line 93:</p>
<pre class="brush: php; first-line: 93; title: ; notranslate">function __()
{
    return Mage::app()-&gt;getTranslator()-&gt;translate(func_get_args());
}</pre>
<p>replace it with this:</p>
<pre class="brush: php; first-line: 93; title: ; notranslate">if (!function_exists('__')) {
	function __()
	{
		return Mage::app()-&gt;getTranslator()-&gt;translate(func_get_args());
	}
}</pre>
<p>Why did I choose to disable Magento&#8217;s translator function instead of WordPress&#8217;? It is because in Magento, it has already been marked as deprecated in version 1.3 and searching throughout the installation I didn&#8217;t see any file that uses that function.</p>
<p>Now that the function collision has been solved, let&#8217;s proceed in modifying WordPress to include our Mage.php file. Locate and open the WordPress file below:</p>
<pre>path-to-your-root-htdocs/wordpress/wp-includes/functions.php</pre>
<p>Scroll down to the end of the file. Add the codes below right after the last function statement which is after line 4122</p>
<p><ins datetime="2010-07-15T15:11:08+00:00"><strong>Note: Mage Enabler plugin users don&#8217;t need to do this anymore.</strong></ins></p>
<pre class="brush: php; first-line: 4123; title: ; notranslate">/**
 * Run Magento's Mage.php within WordPress
 *
 * @author Richard Feraro &lt;richardferaro@gmail.com&gt;
 * @link http://mysillypointofview.richardferaro.com
 *
 * @return object
 */
function magento($name = &quot;frontend&quot;) {
	// Include Magento application
	require_once ( &quot;../magento/app/Mage.php&quot; );
	umask(0);
	// Initialize Magento
	Mage::app(&quot;default&quot;);
	return Mage::getSingleton(&quot;core/session&quot;, array(&quot;name&quot; =&gt; $name));
}</pre>
<p>That&#8217;s it! I know it&#8217;s weird that it isn&#8217;t like the solution given by others that require modifying a lot of files. Nevertheless, I tested it and it does work. You just have to make sure that whenever you use the <strong>magento()</strong> function to any file within WordPress, <strong>always place it at the top most part of the code where there&#8217;s no header request</strong> or else you will get a similar error below:</p>
<pre>Fatal error: Uncaught exception 'Exception' with message 'Warning: session_start() [<a href="function.session-start">function.session-start</a>]: Cannot send session cookie - headers already sent by (output started at path:to-your-htdocs\wordpress\wp-content\themes\twentyten\index.php:19) in path:to-your-htdocs\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 115' in path:to-your-htdocs\magento\app\code\core\Mage\Core\functions.php:245 Stack trace: #0 [internal function]: mageCoreErrorHandler(2, 'session_start()...', 'path:to-your-htdocs...', 115, Array) #1 path:to-your-htdocs\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php(115): session_start() #2 path:to-your-htdocs\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php(155): Mage_Core_Model_Session_Abstract_Varien-&gt;start('frontend') #3 path:to-your-htdocs\magento\app\code\core\Mage\Core\Model\Session\Abstract.php(84): Mage_Core_Model_Session_Abstract_Varien-&gt;init('core', 'frontend') #4 path:to-your-htdocs\magento\app\code\core\Mage\Core\Model\Ses in path:to-your-htdocs\magento\app\code\core\Mage\Core\functions.php  on line 245</pre>
<p>An example of how to use this is to check whether a customer is logged in or not. To do this, open the <strong>index.php</strong> of WordPress&#8217; default theme which is Twenty Ten 0.7:</p>
<pre>path-to-your-root-htdocs/wordpress/wp-content/themes/twentyten/index.php</pre>
<p>Just below line 15, add the <strong>magento()</strong> function. It should look like the codes below:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php

/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty Ten
 * @since 3.0.0
 */
 magento(); // Don't add this anymore if you're already using Mage Enabler

?&gt;

&lt;?php get_header(); ?&gt;</pre>
<p>Add the code below marked as <em>Magento&#8217;s custom greeting</em> right after the <strong>get_header()</strong> function of WordPress in the same file:</p>
<pre class="brush: php; first-line: 20; title: ; notranslate">&lt;?php get_header(); ?&gt;
&lt;!-- Magento's custom greeting --&gt;
&lt;div style=&quot;font-size: 15px; margin-bottom: 15px; border-bottom: 1px solid #000; padding-bottom: 10px;&quot;&gt;
&lt;?php
	$session = Mage::getSingleton(&quot;customer/session&quot;);
	$magento_message = &quot;Welcome &quot;;
	// Generate a personalize greeting
	if($session-&gt;isLoggedIn()){
		$magento_message .= $session-&gt;getCustomer()-&gt;getData('firstname').' ';
		$magento_message .= $session-&gt;getCustomer()-&gt;getData('lastname').'!';
	}else{
		$magento_message .= &quot;Guest!&quot;;
	}

	echo $magento_message;
	//echo &quot;&lt;br&gt;&quot;;
	//print_r($session);
?&gt;
&lt;/div&gt;
&lt;!-- End of Magento's custom greeting --&gt;</pre>
<p>The purpose of the code change above is to display a &#8216;Welcome [customer name here]&#8217; when a customer is logged in, and show &#8216;Welcome Guest&#8217; when they are not.</p>
<p>Next we have to edit the file below to allow us to use the default login page of WordPress as entry point for Magento also. <strong>We assumed here that both Magento and WordPress has the same list of user credentials.</strong> Your setup maybe different as to which user&#8217;s database to use so it&#8217;s up to you how to implement it.</p>
<pre>path-to-your-root-htdocs/wordpress/wp-includes/user.php</pre>
<p>Locate the function <strong>wp_authenticate_username_password()</strong> and find the similar code below. I found mine at line 108.</p>
<pre class="brush: php; first-line: 108; title: ; notranslate">	if ( !wp_check_password($password, $userdata-&gt;user_pass, $userdata-&gt;ID) )
		return new WP_Error('incorrect_password', sprintf(__('&lt;strong&gt;ERROR&lt;/strong&gt;: Incorrect password. &lt;a href=&quot;%s&quot; title=&quot;Password Lost and Found&quot;&gt;Lost your password&lt;/a&gt;?'), site_url('wp-login.php?action=lostpassword', 'login')));</pre>
<p>Right after the code above, add the following code starting at line 111 to make it similar to the code below. This update allows us to run the login request of Magento within WordPress:</p>
<pre class="brush: php; first-line: 108; title: ; notranslate">	if ( !wp_check_password($password, $userdata-&gt;user_pass, $userdata-&gt;ID) )
		return new WP_Error('incorrect_password', sprintf(__('&lt;strong&gt;ERROR&lt;/strong&gt;: Incorrect password. &lt;a href=&quot;%s&quot; title=&quot;Password Lost and Found&quot;&gt;Lost your password&lt;/a&gt;?'), site_url('wp-login.php?action=lostpassword', 'login')));
	// Start Magento
	magento(); // Don't add this anymore if you're already using Mage Enabler
	$session = Mage::getSingleton(&quot;customer/session&quot;);
	try{
		$login = $session-&gt;login($username, $password);
	}catch(Exception $e){
		// Do nothing
	}</pre>
<p>Finally, to call the Magento&#8217;s logout function, locate the file below and open it:</p>
<pre>path-to-your-root-htdocs/wordpress/wp-login.php</pre>
<p>Find the switch case statement at line 352. Add the necessary code to make it similar to the code below and save it:</p>
<pre class="brush: php; first-line: 352; title: ; notranslate">switch ($action) {

case 'logout' :
	check_admin_referer('log-out');
	// Start Magento
	magento(); // Don't add this anymore if you're already using Mage Enabler
	Mage::getSingleton(&quot;customer/session&quot;)-&gt;logout();
	wp_logout();</pre>
<p>Now test your WordPress by accessing the homepage at http://localhost/wordpress/. It should display the &#8216;Welcome Guest&#8217; similar to the image below with a cookie named as &#8216;frontend&#8217; in your Firebug cookie tab. That is your Magento cookie.</p>
<figure id="attachment_304" aria-describedby="caption-attachment-304" style="width: 489px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_home.png?resize=489%2C516"><img loading="lazy" class="size-full wp-image-304 " title="A Test WordPress homepage showing the default welcome message for Magento" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_home.png?resize=489%2C516" alt="A Test WordPress homepage showing the default welcome message for Magento" width="489" height="516" data-recalc-dims="1" /></a><figcaption id="caption-attachment-304" class="wp-caption-text">A Test WordPress homepage showing the default welcome message for Magento</figcaption></figure>
<p>Clicking the login for WordPress redirects us to the login form like the one below while still showing the &#8216;frontend&#8217; cookie. Since I have a customer with same credentials on both Magento (Customer) and WordPress (set as Subscriber), all I have to do is to use the username and password to login in the form below.</p>
<figure id="attachment_306" aria-describedby="caption-attachment-306" style="width: 486px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_login.png?resize=486%2C455"><img loading="lazy" class="size-full wp-image-306 " title="A Test WordPress login page with a generated Magento cookie" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_login.png?resize=486%2C455" alt="A Test WordPress login page with a generated Magento cookie" width="486" height="455" data-recalc-dims="1" /></a><figcaption id="caption-attachment-306" class="wp-caption-text">A Test WordPress login page with a generated Magento cookie</figcaption></figure>
<p>At this point, your Magento session should be running with an active customer session. To check if it does, go back to your homepage by clicking the top header text or going to http://localhost/wordpress/. It should display now the welcome message with your customer&#8217;s name.</p>
<figure id="attachment_308" aria-describedby="caption-attachment-308" style="width: 486px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_with_active_customer.png?resize=486%2C500"><img loading="lazy" class="size-full wp-image-308 " title="A Test WordPress homepage showing the customer's name in the welcome message" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_with_active_customer.png?resize=486%2C500" alt="A Test WordPress homepage showing the customer's name in the welcome message" width="486" height="500" data-recalc-dims="1" /></a><figcaption id="caption-attachment-308" class="wp-caption-text">A Test WordPress homepage showing the customer&#039;s name in the welcome message</figcaption></figure>
<p>I hope this article will help you get started in using Magento&#8217;s functionality within WordPress.</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/04/08/how-to-use-magentos-session-within-wordpress/">How to use Magento&#8217;s session within WordPress</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2010/04/08/how-to-use-magentos-session-within-wordpress/feed/</wfw:commentRss>
			<slash:comments>179</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">283</post-id>	</item>
		<item>
		<title>a customized theme for ipod users!</title>
		<link>https://mysillypointofview.com/2008/03/25/a-customized-theme-for-ipod-users/</link>
					<comments>https://mysillypointofview.com/2008/03/25/a-customized-theme-for-ipod-users/#respond</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Tue, 25 Mar 2008 01:06:51 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Mobile Thoughts]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://richardferaro.com/2008/03/25/a-customized-theme-for-ipod-users/</guid>

					<description><![CDATA[<p>it seems more and more people are starting to enjoy the convenience of having wifi access to different blogs through their ipod touch and iphones. for those who read my blog, you can view my silly point of view blog on a customized theme for iphone and ipod touch users 🙂 here&#8217;s a screenshot of [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2008/03/25/a-customized-theme-for-ipod-users/">a customized theme for ipod users!</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>it seems more and more people are starting to enjoy the convenience of having wifi access to different blogs through their ipod touch and iphones. for those who read my blog, you can view my silly point of view blog on a customized theme for iphone and ipod touch users <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>here&#8217;s a screenshot of my blog using safari browser of my ipod touch:</p>
<figure id="attachment_40" aria-describedby="caption-attachment-40" style="width: 320px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2008/10/snap_005403.jpg?resize=320%2C480"><img loading="lazy" class="size-full wp-image-40" title="snap_005403" src="http://mysillypointofview.files.wordpress.com/2008/10/snap_005403.jpg?resize=320%2C480" alt="my silly point of view customized theme for ipod and iphone" width="320" height="480" data-recalc-dims="1" /></a><figcaption id="caption-attachment-40" class="wp-caption-text">my silly point of view customized theme for ipod and iphone</figcaption></figure>
<p>i used the <a href="http://iwphone.contentrobot.com/2007/07/04/iwphone-wordpress-plugin-and-theme">iWPhone WordPress Plugin and Theme</a> to run this feature on my blog. you can check out their site on how to use it also in your wordpress blog!</p>
<p>thanks to content.robot for this very useful plugin <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2008/03/25/a-customized-theme-for-ipod-users/">a customized theme for ipod users!</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2008/03/25/a-customized-theme-for-ipod-users/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">17</post-id>	</item>
	</channel>
</rss>
