<?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>itoctopus</title>
	<atom:link href="http://www.itoctopus.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.itoctopus.com</link>
	<description></description>
	<lastBuildDate>Tue, 18 Jun 2013 22:17:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>You Cannot Migrate a Joomla Website With the Click of a Button!</title>
		<link>http://www.itoctopus.com/you-cannot-migrate-a-joomla-website-with-the-click-of-a-button</link>
		<comments>http://www.itoctopus.com/you-cannot-migrate-a-joomla-website-with-the-click-of-a-button#comments</comments>
		<pubDate>Tue, 18 Jun 2013 22:17:17 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4462</guid>
		<description><![CDATA[A client of us called us today and told us that her website was hacked &#8211; again! She reminded us politely that we have cleaned her old Joomla website nearly a week ago but her website got hacked again, even though she did migrate to Joomla 2.5 as we recommended her to do.
That&#8217;s odd! We [...]]]></description>
			<content:encoded><![CDATA[<p>A client of us called us today and told us that her website was hacked &#8211; again! She reminded us politely that we have cleaned her old Joomla website nearly a week ago but her website got hacked again, even though she did migrate to Joomla 2.5 as we recommended her to do.</p>
<p>That&#8217;s odd! We thought&#8230; So we asked her who did the migration for her. She told us that she did it herself &#8211; she just clicked on a button in GoDaddy&#8217;s control panel that will &#8220;upgrade her Joomla website to 2.5&#8243;.</p>
<p>Knowing Joomla and GoDaddy, we were confident that such a thing was impossible. Joomla is just too complicated to migrate with a single button and GoDaddy is not a company that goes to the level of creating an extremely advanced migration script for one of the many products that it offers to its clients. Could it be another <a href="http://www.itoctopus.com/beware-of-fake-joomla-migrations" title="Beware of fake Joomla migrations">fake Joomla migration</a>?</p>
<p>So we told her that we needed to access her account on GoDaddy &#8211; and what we found out was that her website wasn&#8217;t even upgraded. What that button did was that it just created a sub-folder called <em>Joomla 2.5.11</em> (which is the current Joomla version) under the root directory of the website.</p>
<p>We communicated our findings to our client who was shocked! We were shocked as well! Come on &#8211; what&#8217;s the point of this button if all it does is create a sub-folder containing the latest version of Joomla. In our opinion, that&#8217;s a bit misleading especially since many clients don&#8217;t even know what Joomla 2.5 looks like &#8211; and so they think that they have <em>seamlessly</em> did the migration by clicking that button.</p>
<p>We have to say that we were a bit disappointed with GoDaddy &#8211; and we&#8217;ll make sure to pass this message to them.</p>
<p>If you think you can migrate your Joomla website with the click of a button &#8211; think again! In best case scenarios, a Joomla website migration from 1.5 to 2.5 will take at least 2 days (and that&#8217;s for a really simple website). If you need help migrating your Joomla website, then <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. <a href="http://www.itoctopus.com/fees" title="Our fees!">Our prices</a> are quite affordable, our service is superb, our work is professional, we always answer the phone, and we are really, really friendly!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/you-cannot-migrate-a-joomla-website-with-the-click-of-a-button/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Quickly Move a Joomla Website from Development to Production</title>
		<link>http://www.itoctopus.com/how-to-quickly-move-a-joomla-website-from-development-to-production</link>
		<comments>http://www.itoctopus.com/how-to-quickly-move-a-joomla-website-from-development-to-production#comments</comments>
		<pubDate>Mon, 17 Jun 2013 03:46:14 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4423</guid>
		<description><![CDATA[Note: This post assumes your server is powered by WHM/cPanel and that you have ssh access. If you&#8217;re using Plesk then you can still do the below with minor modifications. As usual, you can contact us for help.
Warning: While we try our best to make our guides as easy as possible, we have to warn [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: This post assumes your server is powered by WHM/cPanel and that you have ssh access. If you&#8217;re using Plesk then you can still do the below with minor modifications. As usual, you can contact us for help.</em></p>
<p><em>Warning: While we try our best to make our guides as easy as possible, we have to warn you: any mistake here can potentially wipe out your whole website (both production and development). Make sure you proceed very carefully and make sure you give this job to a system administrator if you&#8217;re not sure what you&#8217;re doing.</em></p>
<p>If we had a dime for every time we moved a Joomla website from development to production, we&#8217;d be ultra rich. We do this nearly every day &#8211; and sometimes several times a day. We have reached a point where we know the process by heart. In case you want to do it yourself, here&#8217;s how it&#8217;s done.</p>
<ol start='0'>
<li>
<em>Connect to your server through ssh</em></p>
<p>You can use a tool like <em>Putty</em> to connect to your server&#8217;s shell. You don&#8217;t have to connect as root but usually this makes the job easier.</p>
</li>
<li>
<p><em>Change to your website&#8217;s main directory</em></p>
<p>Issue the following command:</p>
<p><code>cd /home/[your-user]/</code> (if you&#8217;re logged in as root)</p>
<p>or</p>
<p><code>cd /</code> (if you&#8217;re logged in as the website&#8217;s user)</p>
</li>
<li>
<p><em>Create a temporary folder where both the production and the development websites will be moved into</em></p>
<p>Issue the following commands:</p>
<p><code>mkdir old</code><br />
<code>mkdir new</code></p>
<p>The first directory will hold the current production website, and the second directory will hold the current development website.</p>
</li>
<li>
<p><em>Move the development website to the &#8220;new&#8221; directory</em></p>
<p>Assuming that the development website exists under <em>/home/[your-user]/public_html/v2/</em>, issue the following command:</p>
<p><code>mv /home/[your-user]/public_html/v2/ /home/[your-user]/new/</code> (if you&#8217;re logged in as root)</p>
<p>or</p>
<p><code>mv /public_html/v2 /new/</code> (if you&#8217;re logged in as the website&#8217;s user)</p>
</li>
<li>
<p><em>Move the production website to the &#8220;old&#8221; directory</em></p>
<p>Issue the following command:</p>
<p><code>mv /home/[your-user]/public_html/* /home/[your-user]/old/</code> (if you&#8217;re logged in as root)</p>
<p>or</p>
<p><code>mv /public_html/* /old/</code> (if you&#8217;re logged in as the website&#8217;s user)</p>
</li>
<li>
<p><em>Move the development website into production</em></p>
<p>Issue the following command:</p>
<p><code>mv /home/[your-user]/new/* /home/[your-user]/public_html/</code> (if you&#8217;re logged in as root)</p>
<p>or</p>
<p><code>mv /new/* /public_html/</code> (if you&#8217;re logged in as the website&#8217;s user)</p>
</li>
<li>
<p><em>Rename htaccess.txt to .htaccess</em></p>
<p><u>A quick note before doing the below. Unfortunately, the Linux <em>mv</em> command does not move hidden files by default (the <em>htaccess</em> file is typically a hidden file), so what you need to do is to first <em>explicity</em> move/delete the old <em>.htaccess</em> that is still residing in the <em>public_html</em> directory.</u></p>
<p>While under the <em>public_html</em> directory, issue the following command:</p>
<p><em>mv htaccess.txt .htaccess</em></p>
</li>
<li>
<p><em>Fix the configuration.php file</em></p>
<p>The <em>configuration.php</em> in the new website most likely now contains incorrect <em>log</em> and <em>tmp</em> values. If your development website was running under a <em>v2</em> folder, then make sure you trim that <em>/v2</em> from the values of the <em>$log_path</em> and <em>$tmp_path</em> global variables.</p>
</li>
<li>
<p><em>Ensure that all the permissions are correct</em></p>
<p>Make sure that you&#8217;re giving Apache write permissions only to where it should be able to write. E.g. the cache folder, the images folder, the logs folder, and the tmp folder. Note also that some components may require write access to some specific directories inside the <em>components</em> or <em>administrator/components</em> folder (sh404SEF is one example, VirtueMart is another example).</p>
</li>
<li>
<p><em>Backup your current production website</em></p>
<p>Just issue the following simple command to backup the website:</p>
<p><em>cp -R /home/[your-user]/public_html/* /home/[your-user]/new/</em> (if you&#8217;re logged in as root)</p>
<p>or</p>
<p><em>cp -R /public_html/* /new/</em> (if you&#8217;re logged in as the website&#8217;s user)</p>
<p>Note that the above step can take some time if you&#8217;re running a huge website. Also note that the above will not backup your database &#8211; your database can be easily backed up using <em>phpMyAdmin</em>.</p>
</li>
<li>
<p><em>Congratulate yourself on a job well done</em></p>
<p>Now sit back and relax &#8211; your development website has replaced production, and your visitors are now enjoying a (hopefully) better, more reliable website.</li>
</ol>
<p>Now, in case you&#8217;re experiencing a hiccup anywhere in the process above, then we urge you to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We&#8217;ll definitely solve the problem for you, we&#8217;ll charge you a <a href="http://www.itoctopus.com/fees" title="Our fees!">very reasonable fee</a>, and we&#8217;ll do it for you very, <em>very</em> quickly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-quickly-move-a-joomla-website-from-development-to-production/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can an SSL Certificate Protect My Joomla Website from Hacks?</title>
		<link>http://www.itoctopus.com/can-an-ssl-certificate-protect-my-joomla-website-from-hacks</link>
		<comments>http://www.itoctopus.com/can-an-ssl-certificate-protect-my-joomla-website-from-hacks#comments</comments>
		<pubDate>Thu, 13 Jun 2013 04:54:14 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4425</guid>
		<description><![CDATA[We just had an interesting conversation over the phone with a Joomla website administrator. The conversation went like this:
- &#8220;Hi. My name is [customer name] and I work at [company name] and I&#8217;m calling you because I heard that you are experts in Joomla security.&#8221;
- &#8220;That is true&#8221;, we said, &#8220;How can we help you?&#8221;
- [...]]]></description>
			<content:encoded><![CDATA[<p>We just had an interesting conversation over the phone with a Joomla website administrator. The conversation went like this:</p>
<p>- &#8220;Hi. My name is [customer name] and I work at [company name] and I&#8217;m calling you because I heard that you are experts in Joomla security.&#8221;</p>
<p>- &#8220;That is true&#8221;, we said, &#8220;How can we help you?&#8221;</p>
<p>- &#8220;Well, my hosting company wants to sell me an SSL certificate &#8211; claiming that my company&#8217;s Joomla website will be completely secure and literally unhackable when an SSL certificate is installed, is this correct?&#8221;</p>
<p>- &#8220;Ummm, no&#8230;&#8221; &#8211; and then we explained to that person 2 things &#8211; 1) an SSL certificate has nothing to do with the security of the actual website and 2) hosting companies know very little on how to secure a website (if that wasn&#8217;t the case, then our client list would be much smaller than it is right now).</p>
<p>Now you might be thinking, what are these guys saying? SSL is short for <em>Secure Sockets Layer</em>, so it must have <em>something</em> to do with security. Well, let us explain, in layman terms, what an SSL is&#8230;</p>
<p>Let&#8217;s assume that you are a father (by the way, if you are really a father, then congratulations, father&#8217;s day is next Sunday!) and that you are talking with your son (who lives on the other end of the city) using home phone at around 8 PM. You are having one of those &#8220;father-to-son&#8221; conversations. Your nosy wife, who can&#8217;t stand not knowing everything and anything, picks up the other handset and starts <em>eavesdropping</em>.</p>
<p>By default, any request that you submit to a website with no SSL certificate is similar to the above conversation &#8211; anyone with the right tools can know the information that you are sending to the website and that the website is sending to you.</p>
<p>Now, let&#8217;s assume that over the years you have developed a new language that only you and your son know &#8211; let&#8217;s call this language the <em>Martian Language</em>. So, if you spoke over the phone with your son using the <em>Martian Language</em>, then there is no way your nosy wife can understand what you&#8217;re saying. Using a website with an SSL certificate installed is identical to this scenario, the information transmitted to the website is <em>encrypted</em> in such a way that only that website and your browser can understand it &#8211; and no one else. The same goes for the information transmitted from the website to your browser.</p>
<p>So, in other words, an SSL serves to encrypt the information transmitted from and to the website &#8211; and has nothing to do with website security itself. In short, an SSL certificate offers nothing to protect your website from hacks!</p>
<p><em>So why do some hosting companies say that an SSL certificate will protect your website?</em></p>
<p>Unfortunately, there are many unethical hosting companies out there that capitalize on their clients&#8217; sensitivity towards the security of their websites. So they throw at them all kinds of products that they (their clients) may or may not need claiming that these products can make their websites more secure. As a rule of thumb, be very wary of a host that gives you a <em>special deal</em> about a product that is <em>guaranteed</em> to have positive results on your website &#8211; regardless of what that product is. Most likely that product is something that you don&#8217;t need claiming to do something that it can&#8217;t do.</p>
<p><em>So, when is an SSL certificate really needed?</em></p>
<p>An SSL certificate is needed when you are requesting sensitive information on your website (such as credit card information, SSN, etc&#8230;). In fact, an SSL certificate is a must to meet PCI standards (note: we do offer a service to make a Joomla website PCI compliant &#8211; check it <a href="http://www.itoctopus.com/php-consulting/joomla-consulting/joomla-pci-compliance" title="Joomla PCI compliance">here</a>) if you want to do business online.</p>
<p>Now &#8211; if you are unsure on how to make your Joomla website more secure, then why don&#8217;t you <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>? We are experts in Joomla security, we charge a <a href="http://www.itoctopus.com/fees" title="Our fees!">very affordable fee</a>, and we are the friendliest developers on this planet!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/can-an-ssl-certificate-protect-my-joomla-website-from-hacks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How We Optimized a Large Joomla 2.5 Website and Made It Over 200 Times Faster</title>
		<link>http://www.itoctopus.com/how-we-optimized-a-large-joomla-2-5-website-and-made-it-over-200-times-faster</link>
		<comments>http://www.itoctopus.com/how-we-optimized-a-large-joomla-2-5-website-and-made-it-over-200-times-faster#comments</comments>
		<pubDate>Wed, 12 Jun 2013 03:39:47 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4394</guid>
		<description><![CDATA[Note: This post is extremely advanced. If you&#8217;re not a technical person then we suggest you email it to your developer so that he can implement the suggestions below. If you don&#8217;t have a developer you can call us and we&#8217;ll take care of the optimization of your Joomla website.
We had a small debate amongst [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: This post is extremely advanced. If you&#8217;re not a technical person then we suggest you email it to your developer so that he can implement the suggestions below. If you don&#8217;t have a developer you can call us and we&#8217;ll take care of the optimization of your Joomla website.</em></p>
<p>We had a small debate amongst us when giving a title for this post &#8211; some of us thought that the &#8220;200 times&#8221; may seem like a marketing gimmick (something that we don&#8217;t do nor care about at itoctopus) &#8211; but at the end, there was a consensus to go with this title because there was no exaggeration whatsoever, it was true &#8211; and in this post we&#8217;ll explain how we did it!</p>
<p>A new client called us last Thursday (today is Tuesday) and told us that a local development company has just finished migrating his company&#8217;s website (the website was a hospital website with over 40,000 articles) to Joomla 2.5. Everything worked fine, except that the website was extremely slow &#8211; pages were literally taking ages to load. In fact, each page was taking 75 seconds to fully display on the browser. Needless to say, our client refrained from moving the website to production until the speed issue was resolved. As you have probably guessed, the client asked for our help to solve the problem&#8230;</p>
<p>Well, we first informed the client that by default, a Joomla 1.5 website is faster than a Joomla 2.5 website (this is a fact that the creators of Joomla seem to [unfortunately] deny). The reason for this is that Joomla 2.5 builds on some of the bad habits of Joomla 1.5, while it can do without them. Additionally, the developers of Joomla 2.5 seem to have forgotten that there are some very large websites using Joomla (OK, we&#8217;re done bashing the Joomla team).</p>
<p>We then informed the client that for Joomla to work with such an enormous amount of data, 2 factors have to be optimized: the hardware and the application.</p>
<p>Let&#8217;s start with the hardware first (the hardware is the least important of the two, but it&#8217;s the easiest to get done). A high traffic large Joomla website must be hosted on a very high end server, with the following specifications: 64GB of RAM, a 16 core high performance CPU, and an SSD drive. The large amount of RAM is needed to prevent disk swapping in case there are a large number of simultaneous visitors. The 16 core high performance CPU is necessary to handle the load that a huge Joomla website throws on MySQL. The SSD significantly reduces the access overhead to the filesystem and to the database.</p>
<p>As previously stated, the hardware is the easy part, because it&#8217;s just a matter of procuring the server with the above specifications (be aware that such as server can run you about $1,500 monthly).</p>
<p>As for optimizing the application, we informed our client that what we meant by that was modifying Joomla&#8217;s core to better adapt to the needs of his particular website. Our new client asked us to do the application optimization first, and here&#8217;s how we did it&#8230;</p>
<p>First of all, we printed all the queries that were processed on each and every page. We did that by adding an <em>echo</em> state to the <em>setQuery</em> function which is in the <em>JDatabase</em> class (in the file <em>database.php</em> which his located under the <em>libraries/joomla/database</em> folder). Not only that, we also printed the time of the start time of each and every query. Here&#8217;s the code that we added to the function <em>setQuery</em> to achieve this:</p>
<pre><code>
if ($_SERVER['REMOTE_ADDR'] == '<em>[OUR IP]</em>'){ //this if statement ensures that this debugging is only visible for our IP
	$strTime = microtime();
	$arrTime = explode(' ', $strTime);
	echo("\n\n".$arrTime[1] + $arrTime[0]."\n");
	echo($query."\n\n");
	flush(); //flush allows us to display the query that is being executed
	ob_flush();
}</code></pre>
<p><em>Note: We are assuming, in our above code, that the non-database time to generate the page is negligible, which is the case in almost all Joomla websites.</em></p>
<p>Once we added the above code, we went to the homepage of the website (which was pointing to the featured items page) and we were surprised that a few Joomla queries caused a lot of slowdown. In fact, these Joomla queries, combined, took about 75 seconds to be done. One of them, in particular, took about 30 seconds and <u>was being run twice</u> (the same exact query). It was this one:</p>
<p><code>SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up,a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LENGTH(a.fulltext) AS readmore,CASE WHEN badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,contact.id as contactid,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count,c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published FROM #__content AS a LEFT JOIN #__content_frontpage AS fp ON fp.content_id = a.id LEFT JOIN #__categories AS c ON c.id = a.catid LEFT JOIN #__users AS ua ON ua.id = a.created_by LEFT JOIN #__users AS uam ON uam.id = a.modified_by LEFT JOIN ( SELECT contact.user_id, MAX(contact.id) AS id, contact.language FROM #__contact_details AS contact WHERE contact.published = 1 GROUP BY contact.user_id, contact.language) AS contact ON contact.user_id = a.created_by LEFT JOIN #__categories as parent ON parent.id = c.parent_id LEFT JOIN #__content_rating AS v ON a.id = v.content_id LEFT OUTER JOIN (SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id WHERE a.access IN (1,1) AND c.access IN (1,1) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2013-06-10 04:53:14') AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2013-06-10 04:53:14') GROUP BY a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, a.created, a.modified, a.modified_by, uam.name, a.publish_up, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, a.fulltext, a.state, a.publish_down, badcats.id, c.title, c.path, c.access, c.alias, uam.id, ua.name, ua.email, contact.id, parent.title, parent.id, parent.path, parent.alias, v.rating_sum, v.rating_count, c.published, c.lft, a.ordering, parent.lft, fp.ordering, c.id, a.images, a.urls ORDER BY CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END DESC , a.created;</code></p>
<p>In case you&#8217;re wondering why the query was being run twice, it was because the first time the query was getting all the rows (yes, <u>all</u> the rows), and the second time it was running by a function called <em>getTotal</em> in order to know how many rows there were for the pagination. An immediate optimization idea (which we did) was to suppress the redundancy and pass the <em>getTotal</em> function the number of rows by simply issuing the function count() on the resulting array from the first query.</p>
<p>Now, we reduced the page loading time by 30 seconds (we eliminated one of the two query calls), but there was another major problem &#8211; that query was taking 30 seconds! Now, before we continue, let us briefly explain what this query is and where it is&#8230;</p>
<p>This query is a generic query used by mainly <em>com_content</em> views that display a list of items in one or more categories. It resides in the <em>articles.php</em> model file which is located under the <em>components/com_content/models</em> folder.</p>
<p>From a distance, the above query might look all fine and dandy, but if you take a closer look, you can easily notice that there&#8217;s a lot of useless <em>table joins</em> that are hardly (if ever) used:</p>
<ul>
<li>The query makes a join on the table <em>#__contact_details</em> table. Is that really necessary? Why would any website care for a join between the <em>#__content</em> table and the <em>#__contact_details</em> table.
</li>
<li>
<p><em>badcats</em> are those categories that are disabled, and as such, the articles under them should not appear on the website. However, the inclusion of <em>badcats</em> in the query is extremely costly because they were creating an unnecessary (and very costly) join on the <em>#__categories</em> table. Yes, an article with a disabled category should not be displayed, but if someone is about to disable a category, then he&#8217;s better off manually (or automatically) disabling all the articles belonging to that category so as not to slow down performance.</p>
</li>
<li>
<p>The <em>#__content_rating</em> join is pure overhead (especially in the case of our client, who wasn&#8217;t even using ratings anyway on the website) &#8211; we think that if a view needs a rating, then it must lookup the rating value for each and every rating that is displayed &#8211; instead of getting the ratings of 40,000 articles, and then just use the ratings of 30.</p>
</li>
<li>
<p>The <em>#__users</em> join might seem necessary at first glance &#8211; because the author&#8217;s information is needed. However, since each article has the author id in the <em>#__content</em> table, isn&#8217;t it much better to retrieve the author&#8217;s information only for the rows displayed (e.g. in the view itself) rather than getting the author&#8217;s information of all the articles and then displaying those of 30. (This point is very similar to the previous point.)</p>
</li>
<li>
<p>Last but not least, the join <em>#__content_frontpage</em> table is completely unnecessary and we have no idea why Joomla is still doing that join when we have the <em>featured</em> and the <em>ordering</em> fields in the <em>#__content</em> table. Not only that join is unecessary (and way too costly if a website has a lot of featured articles), but also the whole <em>#__content_frontpage</em> table should not be there in the first place. It&#8217;s simply no longer needed!</li>
</ul>
<p>After removing the above unnecessary joins from the query, its execution speed was greatly improved, but it was still unacceptable. The query was taking 2 seconds to execute &#8211; which is way too high. So we examined it more closely&#8230;</p>
<p>We looked at the included fields in the query, and we noticed that we only needed one field &#8211; just one, which was the <em>id</em> of the entry in the <em>#__content</em> table. Yes &#8211; you read that right &#8211; only one field is needed. All the other fields are completely unnecessary &#8211; why oh why one needs to retrieve the <em>introtext</em> of 40,000 articles while he only needs the <em>introtext</em> of just 30 (or less) &#8211; by the way, some websites have all the content of their articles solely in the <em>introtext</em> field, so you can imagine the overhead. So, we scrapped all the other fields from the query, and we modified the views using that query to retrieve just the <u>needed</u> article information from the database. Yes, this means that for each entry to be displayed we will have a separate query (or more), but the cost of this is negligible when it is compared to retrieving nearly the full information of 40,000 articles from the <em>#__content</em> table.</p>
<p>Once we did the above the query was taking merely 0.07 seconds to execute!</p>
<p>We applied the same strategy for all the other costly queries, and we eventually achieved a load time (on production) of 0.35 seconds for the full page &#8211; which is about 214 times faster than the original 75 seconds!</p>
<p>We then enabled caching (we chose conservative caching) and we ensured that the caching time was 60 minutes for each page and 24 hours for the modules. This step was necessary because while 0.35 seconds is fast &#8211; it is not that fast when there are thousands of queries every hour to the website. A side note here: Many Joomla websites that perform very well in development, perform very poorly in production because the amount of traffic is not comparable. An unnoticeable performance issue on development is equivalent to an extremely slow site in production (not to mention, of course, the database errors).</p>
<p>Finally, we moved the website to production and we started monitoring its performance as of yesterday evening &#8211; and so far it is working without a hitch, even on the old, middle-end server. However, we did tell our client to migrate to a high end server as soon as possible (yes &#8211; we think it&#8217;s still needed &#8211; a high traffic Joomla website must have all the room it needs to perform as it should)&#8230;</p>
<p>If you have a very large Joomla website and you&#8217;re worried about performance issues when migrating to Joomla 2.5, then fear not; we can migrate your website from scratch and ensure that all the optimization techniques are implemented (for a <a href="http://www.itoctopus.com/fees" title="Our fees!">very reasonable fee</a>) so that your visitors can have a smooth experience. All you need to do is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>! We&#8217;re always available, we&#8217;re professional, and we know Joomla inside out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-we-optimized-a-large-joomla-2-5-website-and-made-it-over-200-times-faster/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>K2 And Setting the Wrong Open Graph Description Meta Tag</title>
		<link>http://www.itoctopus.com/k2-and-setting-the-wrong-open-graph-description-meta-tag</link>
		<comments>http://www.itoctopus.com/k2-and-setting-the-wrong-open-graph-description-meta-tag#comments</comments>
		<pubDate>Sat, 08 Jun 2013 03:11:27 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4369</guid>
		<description><![CDATA[We love K2 &#8211; it&#8217;s one of those rare components that are a true a gem. Nevertheless, we do discover some quirks in the K2 engine from time to time. Today, we have discovered a problem with setting the Open Graph description meta tag. Here&#8217;s what happened this afternoon&#8230;
In the HTML code of one of [...]]]></description>
			<content:encoded><![CDATA[<p>We love K2 &#8211; it&#8217;s one of those rare components that are a true a gem. Nevertheless, we do discover some <em>quirks</em> in the K2 engine from time to time. Today, we have discovered a problem with setting the <em>Open Graph</em> description meta tag. Here&#8217;s what happened this afternoon&#8230;</p>
<p>In the HTML code of one of our clients, we saw the following meta tag:</p>
<p><code>&lt;meta name="og:description" content="<em>Tweet Share</em> [Real Description of the Page...]" /&gt;</code></p>
<p>We didn&#8217;t know where <em>Tweet</em> and <em>Share</em> were coming from, they were nowhere to be found anywhere in the template. Additionally, we know for a fact that Joomla &#8211; by default &#8211; doesn&#8217;t set the <em>og:description</em> meta tag. It must be a plugin, but which? We immediately thought about <em>sh404</em> (it&#8217;s, ahem, <a href="http://www.itoctopus.com/sh404-the-worst-joomla-extension" title="sh404 – The worst Joomla extension">favorite suspect</a>), so we checked all its code and we discovered that it was innocent. Yes, there is a place where <em>sh404</em> sets the <em>og:description</em> meta tag, but a quick test revealed that it wasn&#8217;t <em>that</em> code that was generating <em>og:description</em>. The <em>Open Graph</em> description meta tag was generated and set somewhere else&#8230;</p>
<p>We spent a long time trying to search for the plugin that was doing it and we couldn&#8217;t find any. But then we thought, what if that code is generated by K2? It does make sense because K2 is aware of its content and is known for having native support for <em>Open Graph</em>. A quick search in K2&#8217;s core files unveiled the mystery &#8211; it was the file <em>view.html.php</em> (located under the <em>components/com_k2/views/item</em> folder) that was setting the <em>og:description</em> meta tag. OK &#8211; now you might be thinking &#8211; what does that have anything to do with the presence of <em>Tweet</em> and <em>Share</em> in the <em>og:description</em> meta tag. Well, the problem was that K2 was grabbing the <em>og:description</em> (as well as the standard meta description) from the document, and <em>not</em> from the K2 item content. This is fine, but when the document&#8217;s content is changed by a plugin (such as a plugin that inserts a <em>Tweet</em> and a <em>Share</em> button), then the <em>og:description</em> will be polluted by nonsense words such as <em>Tweet</em>, <em>Share</em>, and <em>Script</em>&#8230;</p>
<p>OK &#8211; enough talk! Here&#8217;s what we did to solve the problem:</p>
<ul>
<li>We opened the file <em>view.html.php</em> which exists under the folder <em>components/com_k2/views/item</em>.
</li>
<li>
<p>We changed the following line (line 473):</p>
<p><code>$document-&gt;setMetaData('og:description', htmlspecialchars(strip_tags($document-&gt;getDescription()), ENT_QUOTES, 'UTF-8'));</code></p>
<p>to the following line:</p>
<p><code>$document-&gt;setMetaData('og:description', htmlspecialchars(strip_tags($introtext), ENT_QUOTES, 'UTF-8'));</code></p>
</li>
<li>
<p>We added the following line:</p>
<p><code>$introtext = trim($item-&gt;introtext);</code></p>
<p>After this line (line 42):</p>
<p><code>$item = $model-&gt;getData();</code></p>
</li>
<li>
<p>We uploaded the <em>view.html.php</em> back to its place and that solved the problem!</li>
</ul>
<p>Note that also the standard description meta tag might also be wrong if you&#8217;re not using K2&#8217;s meta description field. In this case, you will need to change this line (line 386):</p>
<p><code>$metaDescItem = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item-&gt;introtext.' '.$item-&gt;fulltext);</code></p>
<p>to this one:</p>
<p><code>$metaDescItem = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $introtext.' '.$item-&gt;fulltext);</code></p>
<p>So, yes, even K2 can have bugs. Even Joomla can have bugs, for that matter! But that doesn&#8217;t mean that they&#8217;re not both excellent products!</p>
<p>Now, if your (og:)description meta tag has some weird content, then please apply the above and see if it works. If it doesn&#8217;t, or if you don&#8217;t even have K2 in the first place, then the problem might be caused by another extension. In this case, just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll help you solve the problem quickly. By the way, fear not, we&#8217;ll charge you a <a href="http://www.itoctopus.com/fees" title="Our fees!">very reasonable fee</a> for our services!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/k2-and-setting-the-wrong-open-graph-description-meta-tag/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RokQuickCart Not Adding Items To Cart &#8211; How to Solve</title>
		<link>http://www.itoctopus.com/rokquickcart-not-adding-items-to-cart-how-to-solve</link>
		<comments>http://www.itoctopus.com/rokquickcart-not-adding-items-to-cart-how-to-solve#comments</comments>
		<pubDate>Sat, 01 Jun 2013 01:54:15 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4360</guid>
		<description><![CDATA[One of our clients asked us to install RokQuickCart on his Joomla website. For those of you who don&#8217;t know, RokQuickCart is a free Joomla component that is used for small stores with standard items (e.g. online stores selling books, subscriptions, etc&#8230;) The nice thing about this component is that it&#8217;s extremely easy to use [...]]]></description>
			<content:encoded><![CDATA[<p>One of our clients asked us to install <em>RokQuickCart</em> on his Joomla website. For those of you who don&#8217;t know, <em>RokQuickCart</em> is a free Joomla component that is used for small stores with standard items (e.g. online stores selling books, subscriptions, etc&#8230;) The nice thing about this component is that it&#8217;s extremely easy to use and extremely easy to setup: its configuration consists of merely adding a PayPal email. That&#8217;s it!</p>
<p>Now, when we installed it and added a couple of test products, we expected for everything to work smoothly &#8211; but it didn&#8217;t&#8230; Every time we tried to add a product to the cart, nothing happened! The item was not added and the shopping cart was always empty. We immediately realized there&#8217;s a JavaScript error somewhere. So we looked at the JavaScript console (in Google Chrome), and there was indeed the following error:</p>
<p><em>Uncaught TypeError: Object #<HTMLDocument> has no method &#8216;ready&#8217;</em></p>
<p>Then we looked at the code, and we noticed that both <em>jQuery</em> and <em>Mootools</em> were loaded on the same page, which was causing a conflict. So, we decided to disable the former on the products page only. Here&#8217;s how we did it:</p>
<ul>
<li>We opened the file <em>default.php</em> located under the <em>components/com_k2/com_rokquickcart/views/rokquickcart/tmpl</em> folder and we added the following code at the beginning of the file:</p>
<p><code>
<pre>&lt;?php
	$document = &#038;JFactory::getDocument();
	$rootPath = JURI::root(true);
	$arrHead = $document-&gt;getHeadData();
	unset($arrHead['scripts']['//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js']);
	$document-&gt;setHeadData($arrHead);
?&gt;</pre>
<p></code></p>
<p>The above code removed <em>jQuery</em> from the list of JavaScript libraries included on the products page. Note that the location of the <em>jQuery</em> library might be different in your situation, so make sure you <em>unset</em> (remove) the right <em>JavaScript</em> path. Read <a href="http://www.itoctopus.com/how-to-disable-mootools-in-joomla" title="How to disable Mootools in Joomla">here</a> for more information on how to remove a <em>JavaScript</em> library from a Joomla page. (Warning: that article that we linked to is about removing <em>Mootools</em>, which is not what you want in this case. We just included the article so that you can have more insight on where the above code came from.)</p>
</li>
<li>
<p>We saved that file and we uploaded it back. The problem was fixed!</li>
</ul>
<p>Quick note here: Some claim that the problem can be solved by just adding the following code to the affected page (in our case, the aforementioned <em>default.php</em> page): </p>
<p><code>
<pre>&lt;script&gt;
	jQuery.noConflict();
&lt;/script&gt;</pre>
<p></code></p>
<p>The above code <u>won&#8217;t work</u> &#8211; just take our word for it!</p>
<p>If you are trying to install <em>RokQuickCart</em> and you&#8217;re having problems with it, then please <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll do the installation for you. We won&#8217;t <a href="http://www.itoctopus.com/fees" title="Our fees!">charge you much</a> and we&#8217;ll do the job in no time! What are you waiting for?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/rokquickcart-not-adding-items-to-cart-how-to-solve/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mosets Tree &#8211; An Extremely Slow/Unoptimized Joomla Extension</title>
		<link>http://www.itoctopus.com/mosets-tree-an-extremely-slow-unoptimized-joomla-extension</link>
		<comments>http://www.itoctopus.com/mosets-tree-an-extremely-slow-unoptimized-joomla-extension#comments</comments>
		<pubDate>Fri, 31 May 2013 02:37:14 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4350</guid>
		<description><![CDATA[One of our customers complained to us today that his Joomla website was extremely slow. So, we used the MySQL slow query log to unveil the issue, and we discovered that the culprit was Mosets Tree. In particular, it was these two queries:

SELECT l.*, c.cat_name, c.cat_id, u.username AS username, u.name AS owner, u.email AS owner_email, [...]]]></description>
			<content:encoded><![CDATA[<p>One of our customers complained to us today that his Joomla website was extremely slow. So, we used the <a href="http://www.itoctopus.com/using-the-slow-query-log-to-reveal-bottlenecks-on-your-joomla-website" title="Using the slow query log to reveal bottlenecks on your Joomla website">MySQL slow query log</a> to unveil the issue, and we discovered that the culprit was <em>Mosets Tree</em>. In particular, it was these two queries:</p>
<ol>
<li><code>SELECT l.*, c.cat_name, c.cat_id, u.username AS username, u.name AS owner, u.email AS owner_email, img.filename AS image FROM (wq8k0_mt_links AS l, wq8k0_mt_cl AS cl, wq8k0_mt_cats AS c) LEFT JOIN wq8k0_users AS u ON u.id = l.user_id LEFT JOIN wq8k0_mt_images AS img ON img.link_id = l.link_id AND img.ordering = 1 WHERE link_published='1' &#038;&#038; link_approved='1' &#038;&#038; link_featured='1' AND img.img_id > 0 AND ( publish_up = '0000-00-00 00:00:00' OR publish_up <= '2013-05-31 01:09:59' ) AND ( publish_down = '0000-00-00 00:00:00' OR publish_down >= '2013-05-31 01:09:59' ) AND l.link_id = cl.link_id AND c.cat_id = cl.cat_id AND cl.main = 1 ORDER BY link_featured ASC</code></p>
</li>
<li>
<p><code>SELECT cf.*, cfv.link_id, cfv.value, cfv.attachment, cfv.counter, ft.ft_class FROM wq8k0_mt_customfields AS cf LEFT JOIN wq8k0_mt_cfvalues AS cfv ON cf.cf_id=cfv.cf_id AND cfv.link_id = 152 LEFT JOIN wq8k0_mt_fieldtypes AS ft ON ft.field_type=cf.field_type WHERE cf.published = '1' ORDER BY ordering ASC</code></li>
</ol>
<p>The first query was taking 25 seconds to execute, while the second was taking about 30 seconds. So we checked these two queries in <em>phpMyAdmin</em> using the <em>Explain</em> command (e.g. <code>Explain <em>[query]</em></code>), and we discovered that not one single field was indexed &#8211; not one! This means that any <em>Select</em> query will take ages to execute if there&#8217;s a lot of data (and our customer had a lot of data). Not only that, we also discovered that not a single table had a primary field, which means any <em>Join</em> between the <em>Mosets</em>&#8216; tables is extremely expensive on the system.</p>
<p>We were surprised, because <em>Mosets Tree</em> is a highly used Joomla extension that is commercial! For a commercial extension, one usually expects a high quality extension. Unfortunately, we can&#8217;t say that about <em>Mosets Tree</em>.</p>
<p>Obviously, solving the problem meant that we had to manually index many fields belonging to the <em>Mosets</em>&#8216; tables. Once we did that, the site became much faster and the load on the server decreased.</p>
<p>After fixing the problem, we started thinking, how many famous extensions are similarly unoptimized? How many Joomla websites out there suffer because they are using one of these extensions? And what did the developers have in mind when they completely ignored something so obvious (which is indexing their fields)? One <em>has</em> to wonder whether database optimization was left out on purpose (especially when an extension is many years old)&#8230;</p>
<p>Now, if you&#8217;re reading this post because your website is extremely slow because of <em>Mosets Tree</em>, then we suggest that you index the <em>filter</em> fields in all the <em>Mosets Tree</em> tables (this can be done in <em>phpMyAdmin</em>). If you don&#8217;t know how to do that, then we suggest that you <a href="http://www.itoctopus.com/contact-us">contact us</a>. We can optimize this extension for you in not time and at a <a href="http://www.itoctopus.com/fees" title="Our fees!">very affordable price</a>. All you need to do is to give us a call or shoot us an email!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/mosets-tree-an-extremely-slow-unoptimized-joomla-extension/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Admin in Joomla Login Redirects to Another Login</title>
		<link>http://www.itoctopus.com/admin-in-joomla-login-redirects-to-another-login</link>
		<comments>http://www.itoctopus.com/admin-in-joomla-login-redirects-to-another-login#comments</comments>
		<pubDate>Thu, 30 May 2013 00:08:38 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4342</guid>
		<description><![CDATA[We got a call from a client this afternoon telling us that when logging in to his website, he was redirected to another login. He was seeing this error:
Use a valid username and password to gain access to the administrator backend.
We thought he was experiencing one of the many common login issues on Joomla. We [...]]]></description>
			<content:encoded><![CDATA[<p>We got a call from a client this afternoon telling us that when logging in to his website, he was redirected to another login. He was seeing this error:</p>
<p><em>Use a valid username and password to gain access to the administrator backend.</em></p>
<p>We thought he was experiencing one of the <a href="http://www.itoctopus.com/10-reasons-why-youre-not-able-to-login-to-your-joomla-website" title="10 Reasons why you're not able to login to your Joomla website">many common login issues on Joomla</a>. We were wrong&#8230;</p>
<p>When we checked the website, we noticed that he wasn&#8217;t even redirected to the standard Joomla login, he was being redirected to a completely different login (something similar to Joomla&#8217;s login but with no design/layout whatsoever). The new login link was also different, it was <em>http://www.ourclientjoomlawebsite.com/v2/administrator/index.php/wp-admin/install.php</em>.</p>
<p>We asked the client whether he did something just before the error happened, and he told us that he installed the <em>WordPress for Joomla</em> extension (which we think is a very poorly written extension but one that does the job) but he didn&#8217;t finalize the installation (e.g. he installed the extension but he didn&#8217;t go through configuring it). Aha! We immediately knew the cause of the problem, it&#8217;s most certainly a plugin being loaded by the new WordPress extension which was doing all this. The link the login was redirecting to contained the word <em>wp-admin</em> (which is a WordPress specific folder), a fact that confirmed our theory!</p>
<p>So, here&#8217;s what we did to fix the problem:</p>
<ul>
<li>We logged in to <em>phpMyAdmin</em> through our client&#8217;s <em>cPanel</em>.
</li>
<li>
<p>We clicked on the <em>#__extensions</em> table on the right (replace <em>#__</em> with your database alias).</p>
</li>
<li>
<p>We then searched for the <em>User &#8211; WordPress</em> entry and we set the <em>enabled</em> field for that entry to 1.</p>
</li>
<li>
<p>The problem was solved &#8211; our client was able to login again to his website.</li>
</ul>
<p>It&#8217;s amazing that even after all these years, we still are seeing login problems that we have not seen before! That&#8217;s what makes our job so beautiful &#8211; there&#8217;s something new every day &#8211; a new challenge and a new solution!</p>
<p>If you&#8217;re having a similar login issue on your Joomla website, and if the above is not working for you (or you don&#8217;t know how to implement it), then fret not, we&#8217;re here to the rescue! All you need to do is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll make sure the problem is resolved in no time and for a <a href="http://www.itoctopus.com/fees" title="Our fees">very low cost</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/admin-in-joomla-login-redirects-to-another-login/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Resolve the Most Annoying JW Player Error in Joomla</title>
		<link>http://www.itoctopus.com/how-to-resolve-the-most-annoying-jw-player-error-in-joomla</link>
		<comments>http://www.itoctopus.com/how-to-resolve-the-most-annoying-jw-player-error-in-joomla#comments</comments>
		<pubDate>Tue, 28 May 2013 20:18:51 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4331</guid>
		<description><![CDATA[AllVideos is an excellent plugin that uses the JW player to display videos in different formats. It&#8217;s excellent and it usually works without a hitch. However, if you have been using it for a long time in different environments, you might have seen the following error:
The video could not be loaded, either because the server [...]]]></description>
			<content:encoded><![CDATA[<p>AllVideos is an excellent plugin that uses the JW player to display videos in different formats. It&#8217;s excellent and it usually works without a hitch. However, if you have been using it for a long time in different environments, you might have seen the following error:</p>
<p><em>The video could not be loaded, either because the server or network failed or because the format is not supported. [absolute URL to the video the player is trying to load] undefined.</em></p>
<p>The first time we have seen the above error we have spent literally a whole day trying to solve it &#8211; we just didn&#8217;t know what the cause of it was, and it was not happening on all machines <em>and</em> it was happening only on FireFox.</p>
<p>We first thought that it might have something to do with FireFox&#8217;s version, so we upgraded FireFox to the latest version (which is 21 at the time of writing this post). That didn&#8217;t help&#8230;</p>
<p>Our second attempt was to update Flash to the latest version &#8211; that didn&#8217;t help either&#8230;</p>
<p>Our third attempt was to read through the code and see how the video was embedded, and we noticed that the new JW Player does not use absolute URLs in its embed code &#8211; so we changed that. We opened the file <em>sources.php</em> which is located under the <em>/plugins/content/jw_allvideos/jw_allvideos/includes</em> folder and we ensured that all the URLs in the embed code were absolute. Unfortunately, that didn&#8217;t work&#8230; (By the way, doing this might solve other issues you&#8217;re having on the website &#8211; for example when the player is unable to find the video, so what we did was not a complete waste after all!)</p>
<p>We finally did some research, and we discovered that FireFox has issues displaying videos using HTML5. Hmmm&#8230;. So, we checked the embed code again, and we saw this:</p>
<p><code>
<pre>'modes': [
  <span style="color: red; font-weight: bold;">{ 'type': 'html5'},</span>
  { 'type': 'flash', src: '[URL to the flash player]' },
  { 'type': 'download' }
]</pre>
<p></code></p>
<p>Ahaaaa! As you can see, the first option is to load the video using HTML5 &#8211; which is the heart of the problem since FireFox has issues when it comes to loading videos using HTML5. So, in order to solve the problem, we decided to change the sequence of loading; we decided to make the Flash player the primary tool to load the videos. Here&#8217;s how we did it:</p>
<ul>
<li>We opened the <em>sources.php</em> file located under the <em>/plugins/content/jw_allvideos/jw_allvideos/includes</em> directory.
</li>
<li>
<p>We flipped lines 23 and 24. So, line 23 became line 24, and line 24 became line 23. In other words, we moved the line:</p>
<p><code>{ 'type': 'html5' },</code></p>
<p>below the line:</p>
<p><code>{ 'type': 'flash', src: '{PLUGIN_PATH}/includes/js/mediaplayer/player.swf' },</code></p>
<p>This step ensured that the browser will first try to load the videos in the Flash container &#8211; and, if Flash is nowhere to be found, then it tries to load it using HTML5.</p>
</li>
<li>
<p>We saved the file and we uploaded it back and that fixed the problem! Hooray!</li>
</ul>
<p>Now, if you have the same problem but are not too technical to fix it using the above technique, then probably your best option would be to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>; we&#8217;ll do it for you at a very <a href="http://www.itoctopus.com/fees" title="Our fees!">competitive rate</a> and in the blink of an eye! (Well, not <em>literally</em>, but we are really fast!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-resolve-the-most-annoying-jw-player-error-in-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Joomla Should Change Its Database Structure</title>
		<link>http://www.itoctopus.com/why-joomla-should-change-its-database-structure</link>
		<comments>http://www.itoctopus.com/why-joomla-should-change-its-database-structure#comments</comments>
		<pubDate>Mon, 27 May 2013 23:17:39 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4312</guid>
		<description><![CDATA[Note: This post is extremely advanced and is aimed at Joomla administrators with a solid technical background.
We love Joomla. We think that it&#8217;s one of the best CMS&#8217;s out there, if not the best CMS.  That&#8217;s why we think it&#8217;s good to constructively criticize it from time to time so that it remains where [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: This post is extremely advanced and is aimed at Joomla administrators with a solid technical background.</em></p>
<p>We love Joomla. We think that it&#8217;s one of the best CMS&#8217;s out there, if not the <em>best</em> CMS.  That&#8217;s why we think it&#8217;s good to constructively criticize it from time to time so that it remains where it is right now (and hopefully become better).</p>
<p>Let&#8217;s start&#8230;</p>
<p>One of the most annoying characteristics of Joomla, and of any CMS in general, is how database tables are linked. For example, let&#8217;s take a look at the <em>#__categories</em> (the table containing the categories). That table is linked to many other tables through the <em>ID</em> field. For example, we know that a particular article belongs to a certain category because the ID of that category is referenced in the <em>catid</em> field in that particular&#8217;s article row (in the table <em>#__content</em>). Now, all this seems fine and clean, and it&#8217;s considered to be standard practice when it comes to database architecture. But, is it the <em>best</em> practice? (Yes, we know, we have italicized the word <em>best</em> twice so far in this post!)</p>
<p>We don&#8217;t think so!</p>
<p>To answer the first question that you might have on your mind: &#8220;No, we have <em>not</em> finally lost our senses</em>&#8221; (that&#8217;s a quote from <em>Alice in Wonderland</em>, except that the <em>not</em> is not there). In order to prove that, let us tell you what happened to us today&#8230;</p>
<p>We were migrating a Joomla website (from Joomla 1.5 to Joomla 2.5) today, and, as most of you already know, preserving the IDs of the articles in the <em>#__content</em> table is nearly impossible if you want to do a clean migration. Now, for small websites with little or no extra features, this might be harmless, but the website that we were migrating today had one feature that caused us some trouble, and that feature was <em>JComments</em> (the excellent Joomla commenting tool). Each comment in <em>JComments</em> was linked to the article&#8217;s ID, but since the article ID association could not be maintained during the migration, we had data integrity issues: comments were no longer linked to the right articles (some were not linked to any articles!).</p>
<p>A database administrator would say that this is very normal in a relational database, but we beg to differ. You see, the problem is that during the migration, the new article IDs were generated automatically, because the article ID is an <em>Autonumber</em> field in the database (e.g. the database will automatically assign the next number in the sequence for each new article [The first article's ID is 1, the second's ID is 2, etc...]). But what if Joomla doesn&#8217;t use <em>Autonumber</em> at least in its main tables (such as the <em>#__content</em> table, the <em>#__menu</em> table, the <em>#__categories</em> table, etc&#8230;) and use a hash that is calculated based on a unique combination of 2 fields (such as the title and the creation date)? That hash will remain static and unique in time and space (OK, we&#8217;re getting a bit philosophical here&#8230;) so any move of the data anywhere will not affect the table relationships in the database, because all the tables will be using that unique (and static) hash to reference items in other tables.</p>
<p>Now, when would that hash be created? When the entry is created in Joomla, of course! For example, when you create a new article, Joomla will automatically create its hash based on its creation date and its title.</p>
<p>We know that this concept sounds too good to be true &#8211; but <em>it is</em> true, and <em>it can</em> work. The problem is that most database architects will refuse even looking at it because it&#8217;s &#8220;not the way we do things&#8221; and because &#8220;there might be some serious repercussions&#8221; (we&#8217;re using their terminology). Yes, it&#8217;s not the way we do things, and there might be some repercussions, but isn&#8217;t this whole concept worth at least a try?</p>
<p>Now let&#8217;s get back to you, our dear reader! If you&#8217;re having data integrity problems after the migration of your Joomla website because of the above issue, then fear not, we can help! We can write a customized script that will <em>remedy</em> your data. All you need to do is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and rest assured, <a href="http://www.itoctopus.com/fees" title="Our fees!">we won&#8217;t charge you much</a> and we will get the job done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/why-joomla-should-change-its-database-structure/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Disable the MultiThumb Plugin on Modules</title>
		<link>http://www.itoctopus.com/how-to-disable-the-multithumb-plugin-on-modules</link>
		<comments>http://www.itoctopus.com/how-to-disable-the-multithumb-plugin-on-modules#comments</comments>
		<pubDate>Thu, 23 May 2013 00:02:43 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4296</guid>
		<description><![CDATA[One of the really annoying plugins that we have to constantly work with is the MultiThumb plugin (or the so-called BK-MultiThumb plugin). It is annoying because we always have to modify the core to make it work the way we want it to work. It is also poorly documented and is characterized by an erratic [...]]]></description>
			<content:encoded><![CDATA[<p>One of the really annoying plugins that we have to constantly work with is the <em>MultiThumb</em> plugin (or the so-called <em>BK-MultiThumb</em> plugin). It is annoying because we always have to modify the core to make it work the way we want it to work. It is also poorly documented and is characterized by an erratic behavior. (Yes, in case you&#8217;re wondering, Joomla plugins <em>can</em> have characters!)</p>
<p>One of the major annoyances with the <em>MultiThumb</em> plugin is its inability to differentiate between actual content and modules, so the code runs on the modules as well, and tries to intelligently (wink, wink) create thumbnails of the images in the modules &#8211; which is often not the desired behavior. Unfortunately, the plugin has no setting explicitly instructing it not to work on (certain) modules. To overcome this, the average Joomla administrator adds the <em>mt_ignore</em> directive in the <em>alt</em> tag of each and every image in each and every module that he does not want <em>MultiThumb</em> to modify. Clearly, this is an annoying and a hair pulling task, especially if the number of modules is in the hundreds (which is the case for many of the Joomla websites we work with).</p>
<p>So, are there other solutions for this problem?</p>
<p>Well, fortunately, at itoctopus, we have devised a couple of clean solutions to address this annoyance:</p>
<ol>
<li><strong>Solution #1 &#8211;  Instruct the module not to <em>Prepare Content</em></strong></p>
<p>Usually, modules affected by the <em>MultiThumb</em> plugin have a setting under <em>Basic Options</em> which is called <em>Prepare Content</em>. When set to &#8220;Yes&#8221;, <em>Prepare Content</em> will trigger a call the function <em>onContentPrepare</em> when the module is loaded into the website. This means that any plugin (including the <em>MultiThumb</em> plugin) that has the function <em>onContentPrepare</em> will have full access to said module&#8217;s content &#8211; in other words, the plugin can read and can modify the module&#8217;s content. Obviously, if you don&#8217;t want your module&#8217;s content to be potentially modified, ensure that <em>Prepare Content</em> is set to &#8220;No&#8221;.</p>
</li>
<li>
<p><strong>Solution #2 &#8211; Modify MultiThumb&#8217;s core</strong></p>
<p>While the first solution is elegant, it suffers from three drawbacks: 1) it is not practical in case the website has hundreds of modules (one has to manually change the value of <em>Prepare Content</em> to &#8220;No&#8221; in all the modules), 2) some modules may trigger the <em>onContentPrepare</em> function without having a setting to disable it, and 3) setting the <em>onContentPrepare</em> value to &#8220;No&#8221; may have adverse effects on the website.</p>
<p>So, a better solution would be to modify <em>MultiThumb</em>&#8217;s core by telling it not to process modules. This can be easily done by adding a line to the following function (the line is highlighted in red, and the function is located in the file <em>multithumb.php</em> which is located under the <em>plugins/content/multithumb</em> folder) :</p>
<p><code>
<pre>
public function onContentPrepare($context, &#038;$article, &#038;$params, $limitstart = 0) {
	<span style="color: red; font-weight: bold;">if (strpos($context, 'mod_') !== FALSE) return;</span>
	if ( !$this-&gt;is_article ) {
		return;
	}
	$this-&gt;onPrepareContent ( $article, $params, $limitstart);
}</pre>
<p></code></p>
<p>Now, nothing&#8217;s perfect, and the above solution will mean that <em>MultiThumb</em> will not work on <em>any</em> module (which is most likely what you want). But, what if you want <em>MultiThumb</em> to work on <em>some</em> modules? Well, in this case, you just create a white-list array in the above function, and any modules in that white-list array will be processed by the plugin. Easy, huh?</li>
</ol>
<p>Of course, the second solution must be performed by someone who knows a thing or two about coding, preferably a programmer. So, if you&#8217;re not, or if you need help doing this, then why not <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>? We are always available, <a href="http://www.itoctopus.com/fees" title="Our fees!">our rates</a> are competitive, our work is fast and professional, and we are super friendly!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-disable-the-multithumb-plugin-on-modules/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Events in Certain Categories Not Appearing on JEvents Calendar</title>
		<link>http://www.itoctopus.com/events-in-certain-categories-not-appearing-on-jevents-calendar</link>
		<comments>http://www.itoctopus.com/events-in-certain-categories-not-appearing-on-jevents-calendar#comments</comments>
		<pubDate>Tue, 21 May 2013 12:44:40 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4265</guid>
		<description><![CDATA[A couple of hours ago, we got an urgent call from a client in the UK (it&#8217;s now 7:30 AM here in Montreal), the client was using JEvents (the well known Joomla event calendar extension) to display the events of his company. He told us that for some reason, all the events under some categories [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of hours ago, we got an urgent call from a client in the UK (it&#8217;s now 7:30 AM here in Montreal), the client was using JEvents (the well known Joomla event calendar extension) to display the events of his company. He told us that for some reason, all the events under some categories are not displaying on his website. Our client said that he was sure that those categories were published (active) and when the events were listed under different categories they would show up. We smiled because we worked on the exact same problem a few days ago so we knew how to immediately fix it.</p>
<p>We then asked our client whether he selected those categories in the menu item pointing to JEvents. He said: &#8220;Let me check&#8230;&#8221; A minute later (he was still on the phone), he told us: &#8220;Thank you, thank you, thank you!&#8221;</p>
<p>Now enough with the narration, and let us explain to you, our faithful reader, how to fix the problem:</p>
<ul>
<li>First make sure that those categories are enabled.  You can check whether those categories are enabled by logging in to the backend and going to <em>Components</em> -&gt; <em>JEvents</em> -&gt; <em>Categories</em>.
</li>
<li>
<p>Now check that the events are actually published in those categories. (We know, DUH, but sometimes this might be the reason)</p>
</li>
<li>
<p>Now go to the menu item pointing to JEvents, and make sure that these categories are selected on the right of the page. See image below&#8230;</li>
</ul>
<p><img src="http://www.itoctopus.com/wp-content/uploads/2013/05/jevents-select-categories.jpg" alt="JEvents Select Categories" title="JEvents Select Categories" width="468" height="369"/><center><em>Figure 1: Selecting Categories on JEvents&#8217; Menu Item</em></center></p>
<p>Doing the above should fix your problem, if it doesn&#8217;t, then try creating a new category, and add a new event to that category and see if it works (make sure that the menu item pointing to your calendar has this category selected). If this still doesn&#8217;t work, then check if you have two menu items each pointing to a JEvents calendar on your website. If this is the case, then again, make sure that you are working on the right menu item.</p>
<p>If all else fails, then why not <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>? We can definitely fix the problem for you at record speed. <a href="http://www.itoctopus.com/fees" title="Our fees">We don&#8217;t charge much</a> and we are very, very professional. We are also very friendly! What more could anyone want from his programmers?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/events-in-certain-categories-not-appearing-on-jevents-calendar/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weird Hash in All of Joomla&#8217;s URLs &#8211; Cause and Fix</title>
		<link>http://www.itoctopus.com/weird-hash-in-all-of-joomlas-urls-cause-and-fix</link>
		<comments>http://www.itoctopus.com/weird-hash-in-all-of-joomlas-urls-cause-and-fix#comments</comments>
		<pubDate>Mon, 20 May 2013 09:25:18 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4263</guid>
		<description><![CDATA[A client emailed us late at night yesterday and told us that all of the pages on his Joomla website have a weird hash in the URL. He told us that he just noticed the problem and he needed it fixed immediately. So, we checked the website and it was something we haven&#8217;t seen before: [...]]]></description>
			<content:encoded><![CDATA[<p>A client emailed us late at night yesterday and told us that all of the pages on his Joomla website have a weird hash in the URL. He told us that he just noticed the problem and he needed it fixed immediately. So, we checked the website and it was something we haven&#8217;t seen before: every page we went to had an <em>anchor</em> attached to it. For example, when clicking on the <em>Our Services</em> page on our client&#8217;s website, the link in the address bar was: <em>http://www.ourclientjoomlawebsite/our-services.html#_U0123456789A</em>. What was even weirder was that the link to the <em>Our Services</em> page did not contain that anchor!</p>
<p>So, we took a closer look and we discovered that the anchor was added after the page was fully loaded &#8211; which means that it was a <em>JavaScript</em> script that was doing this mess. After a lot of investigation (we&#8217;re saving you hours here!), we discovered that it was a piece of code used to display the <em>AddThis</em> widget which was responsible for this. Here&#8217;s that code (the code was placed in a <em>Custom HTML</em> module):</p>
<p><code>&lt;script type="text/javascript"&gt;var addthis_config = {"data_track_addressbar":<span style="color:red; font-weight: bold;">true</span>};&lt;/script&gt;</code></p>
<p>The code above explicitly instructs the browser (through JavaScript) to track data in the address bar &#8211; which means that it has to add the hash in order to track the data. Changing the above code to the below one fixed the problem:</p>
<p><code>&lt;script type="text/javascript"&gt;var addthis_config = {"data_track_addressbar":<span style="color:red; font-weight: bold;">false</span>};&lt;/script&gt;</code></p>
<p>Now &#8211; after fixing it, we started wondering: how come the people at <em>AddThis</em> (which is a hugely used widget) allow for such a poor technique for tracking their famous product? And how many other JavaScript widgets have the same problem? We then thought that we were right in being always cautious when referencing JavaScript code located on a 3<sup>rd</sup> party website; you never know when this code goes berserk and starts doing weird things on a website!</p>
<p>So, if you&#8217;re having the problem where a weird hash suddenly shows up in the URL of each and every page of your Joomla website, then take a look at the module containing the <em>AddThis</em> code, and try to fix it using our above method. If you don&#8217;t have <em>AddThis</em>, then it might be another JavaScript code doing this (to confirm this, try disabling JavaScript on your browser and see if the problem&#8217;s still there). If this is the case (e.g. the problem is caused by another JavaScript code) and if you can&#8217;t fix it yourself, then how about asking for our help? Just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll fix the problem for you as quick as possible and for a <a href="http://www.itoctopus.com/fees" title="Our fees!">very reasonable cost</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/weird-hash-in-all-of-joomlas-urls-cause-and-fix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Fix &#8220;Call to undefined function filter_var&#8221; Error on Joomla</title>
		<link>http://www.itoctopus.com/how-to-fix-call-to-undefined-function-filter_var-error-on-joomla</link>
		<comments>http://www.itoctopus.com/how-to-fix-call-to-undefined-function-filter_var-error-on-joomla#comments</comments>
		<pubDate>Fri, 17 May 2013 09:13:29 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4246</guid>
		<description><![CDATA[A well known client of us came to us yesterday evening and told us that he was getting a blank page when he saves the user&#8217;s data on a custom made component. We knew there was a fatal error somewhere so we set the &#8220;Error Reporting&#8221; to &#8220;Maximum&#8221; and we tried to save the profile, [...]]]></description>
			<content:encoded><![CDATA[<p>A well known client of us came to us yesterday evening and told us that he was getting a blank page when he saves the user&#8217;s data on a custom made component. We knew there was a fatal error somewhere so we set the &#8220;Error Reporting&#8221; to &#8220;Maximum&#8221; and we tried to save the profile, and we saw the following error:</p>
<p><em>Fatal error: Call to undefined function filter_var() in /components/com_user/controller.php on line 74</em></p>
<p>We became perplexed when we saw the above error: Our client was using Joomla 1.5 which does not require the availability of the function <em>filter_var</em>. For those who don&#8217;t know, <em>filter_var</em> is a PHP function that sanitizes/validates input (such as checking if a <em>POST</em> field is a valid email). This function is only available as of PHP 5.2.0 &#8211; our client had PHP 5.1.6.</p>
<p>After a quick investigation, we discovered that the <em>controller.php</em> file located under the <em>/components/com_user/</em> has been modified to accommodate our client&#8217;s needs &#8211; but it was assumed at the time of modification that our client was using a PHP version that is higher or equal to version 5.2.0.</p>
<p>We had 4 options to fix the problem:</p>
<ol>
<li><u>Upgrade the PHP version to the latest version on our client&#8217;s server</u>
<p>This option seemed at first glance the <em>best</em> option, but we dismissed it nearly immediately, because upgrading PHP may have repercussions on other areas of the website, especially when taking into consideration that Joomla&#8217;s core was heavily modified (there were many files other than the <em>controller.php</em> file that were modified). Our client was in a hurry and we did not want to create more work to solve the problem &#8211; albeit that more work is better on the long term.</p>
</li>
<li>
<p><u>Implement the function <em>filter_var</em> from scratch and place it in a common PHP file</u></p>
<p>This option made sense, but the problem is that the <em>filter_var</em> function is an extremely complicated and versatile function. Re-creating it from scratch might take days (and not hours). So, again, we dismissed this option.</p>
</li>
<li>
<p><u>Remove all calls to <em>filter_var</em> from the code</u></p>
<p>We thought, since the function never worked in the first place, why leave it there? Removing all instances of the function from the code will solve the problem. The validation was not working anyway (and it wasn&#8217;t critically needed).</p>
<p>But, what if the client decides to upgrade PHP to the latest version in the future (which is something that will happen sooner or later)? He will lose that validation because it would have been already removed. Our third option was also dismissed.</p>
</li>
<li>
<p><u>Create a skeleton of the <em>filter_var</em> function that always returns true</u></p>
<p>We then pondered: Since we can&#8217;t upgrade PHP, we can&#8217;t re-create the function, and we can&#8217;t remove all instances of the function, then why not create a <em>skeleton</em> of the function and place it in a common <em>include</em> file? The skeleton <em>filter_var</em> function will just return the value (unmodified) in all circumstances &#8211; additionally, future compatibility can be maintained by ensuring that the skeleton function is only declared if it doesn&#8217;t already exist.</p>
<p>So here&#8217;s what we did:</p>
<ul>
<li>We opened the <em>index.php</em> located under the root of the website. We chose this file because it&#8217;s included across the board on the frontend &#8211; you can choose another common file if you wish. if you also have the problem on the backend, then you should add the below code to the <em>index.php</em> located under the <em>administrator</em> directory as well.
</li>
<li>
<p>We added the following code to the <em>index.php</em> file (just before <em>define( &#8216;_JEXEC&#8217;, 1 );</em>): </p>
<p><code>
<pre>if (!function_exists('filter_var')){
	function filter_var($value, $filter_type) {
		return $value;
	}
}</pre>
<p></code></p>
</li>
<li>
<p>We saved the file and uploaded it back and that solved the problem.</li>
</ul>
<p>Please note that this is not a long term solution because you will lose the validation/sanitation performed by the <em>filter_var</em> function &#8211; but, if you&#8217;re in a hurry and you need to address the problem rapidly, then this is the most <em>convenient</em> solution (it&#8217;s also the safest).</li>
</ol>
<p>If you need help implementing the above solution or if you&#8217;re looking to upgrade PHP on your server to address this issue, then your best bet is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We can help you implement the above or ensure that a PHP upgrade on your server has no repercussions on your website. <a href="http://www.itoctopus.com/fees" title="Our fees!">Our prices</a> are affordable, our service is top notch, and our clients really love us! What more could you ask for?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-fix-call-to-undefined-function-filter_var-error-on-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Use a Hash in the URL to Authenticate Logins to a Joomla Website</title>
		<link>http://www.itoctopus.com/how-to-use-a-hash-in-the-url-to-authenticate-logins-to-a-joomla-website</link>
		<comments>http://www.itoctopus.com/how-to-use-a-hash-in-the-url-to-authenticate-logins-to-a-joomla-website#comments</comments>
		<pubDate>Mon, 13 May 2013 21:41:06 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4237</guid>
		<description><![CDATA[This afternoon a new client called us and told us that he&#8217;s not able to login to the backend of his Joomla website. While we&#8217;ve seen his exact problem before (he wasn&#8217;t able to login and no error was displayed), we were not able to fix it using our standard techniques. So we spent literally [...]]]></description>
			<content:encoded><![CDATA[<p>This afternoon a new client called us and told us that he&#8217;s not able to login to the backend of his Joomla website. While we&#8217;ve seen his exact problem before (<a href="http://www.itoctopus.com/login-to-joomla-administrator-not-working-and-no-error-is-displayed" title="Login to Joomla administrator not working and no error is displayed">he wasn&#8217;t able to login and no error was displayed</a>), we were not able to fix it using our standard techniques. So we spent literally over 10 hours trying to fix the problem but to no avail. We knew it had something to do with the session not being saved properly, but we couldn&#8217;t figure out the cause of the problem. Eventually, our youngest team member pointed out that the client was using a literally unknown web server (we can&#8217;t for the lives of us remember its name &#8211; but it was calling itself &#8220;Apache Like&#8221;), and so we did some testing and we eventually narrowed out the problem to the web server &#8211; this unknown web server just didn&#8217;t handle sessions the same way as Apache did &#8211; something that confused Joomla.</p>
<p>So, just to make sure, we asked him whether his hosting company changed its server environment lately, and he immediately forwarded us an email (sent from his hosting company) explaining the move to &#8220;a better&#8221;, &#8220;more performing&#8221;, and &#8220;more reliable&#8221; web server. We read the email and we wondered why on earth would anyone use an unknown web server to serve his clients. But enough rant&#8230;</p>
<p>We offered our client 2 choices:</p>
<ol>
<li>Switch his server environment to an orthodox LAMP environment.
</li>
<li>
<p>Let us devise a way (that may or may not be costly) to address the problem.</li>
</ol>
<p>Our client, who was running a mission-critical website pertaining to his industry, went with the latter option. So, we disabled Joomla&#8217;s authentication for the backend and we used a secret hash (appended to the URL) to automatically authenticate the user. Here&#8217;s what we did, in details:</p>
<p><strong>Step 1 &#8211; We disabled Joomla&#8217;s authentication</strong></p>
<p>Disabling Joomla&#8217;s authentication can be done in many, many ways! We prefer the following method:</p>
<ul>
<li>Open the file <em>session.php</em> located under the <em>libraries/joomla/session</em> folder.
</li>
<li>
<p>Comment out lines 521, 522, 524, 527, and 528. In other words, the following code:</p>
<p><code>
<pre>
if (!JRequest::getVar($session_name, false, 'COOKIE'))
{
	if (JRequest::getVar($session_name))
	{
		session_id(JRequest::getVar($session_name));
		setcookie($session_name, '', time() - 3600);
	}
}
</pre>
<p></code></p>
<p>should change to:</p>
<p><code>
<pre>
// if (!JRequest::getVar($session_name, false, 'COOKIE'))
// {
	if (JRequest::getVar($session_name))
//	{
		session_id(JRequest::getVar($session_name));
		setcookie($session_name, '', time() - 3600);
//	}
//}
</pre>
<p></code></p>
</li>
<li>
<p>Save the file and upload it back.</li>
</ul>
</li>
</li>
<p><strong>Step 2 &#8211; Authenticate Using a Hash in the URL</strong></p>
<p>Authenticating users using a hash in the URL means that by having something like <em>http://www.yourjoomlawebsite.com/administrator/index.php?myhash=[secret_hash]</em> will allow you to login to the website without entering any username and password (provided, of course, the <em>secret_hash</em> is correct). Authenticating using a hash can be done the following way:</p>
<ul>
<li>Open the file <em>index.php</em> located under the <em>administrator</em> directory.</p>
</li>
<li>
<p>Add the following code to the top of the <em>index.php</em> file:</p>
<p><code>
<pre>
$myHash = $_GET['myhash'];
if (empty($myHash))
	$myHash = $_COOKIE['myhash'];
if ($myHash != 'abcdefg1234567'){
	die('No access');
}
else{
	 setcookie('myhash', 'abcdefg1234567');
}</pre>
<p></code></p>
<p>The above code ensures that only the URL with the right hash (which is <em>abcdefg1234567</em> in our case) can gain access to the admin section. Additionally, it ensures a <em>persistent</em> authentication across the backend by setting and getting a cookie.</p>
</li>
<li>
<p>Save the <em>index.php</em> file and upload it back.</li>
</ul>
</li>
</ul>
<p>As you can see from the above, it&#8217;s a simple solution. It&#8217;s also far from ideal (yes &#8211; we admit it), but if the environment has problems with sessions, it might be the only solution.</p>
<p>If you&#8217;re having session issues related to the environment when logging in to your Joomla website, then fear not, your problem has a solution, and we can implement it for you. Just <a href="http://www.itoctopus.com/contact-us" title="Contact us">contact us</a> and we&#8217;ll implement the above for you in no time and at a <a href="http://www.itoctopus.com/fees" title="Our fees">very affordable cost</a>. Oh, and have we mentioned that we are the friendliest Joomla experts on this planet?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-use-a-hash-in-the-url-to-authenticate-logins-to-a-joomla-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Migrate Joomla Articles&#8217; Subtitles to K2</title>
		<link>http://www.itoctopus.com/how-to-migrate-joomla-articles-subtitles-to-k2</link>
		<comments>http://www.itoctopus.com/how-to-migrate-joomla-articles-subtitles-to-k2#comments</comments>
		<pubDate>Thu, 09 May 2013 12:15:40 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4226</guid>
		<description><![CDATA[We have mentioned before that we are migrating a lot of websites from using Joomla&#8217;s core content to K2 because K2 is simply better (well, this is our opinion anyway). But, even though K2 provides all the tools to make the content migration an easy task, quite often, there are quirks here and there that [...]]]></description>
			<content:encoded><![CDATA[<p>We have mentioned before that we are migrating a lot of websites from using Joomla&#8217;s core content to K2 because <a href="http://www.itoctopus.com/top-8-reasons-why-you-should-use-k2" title="Top 8 reasons why you should use k2">K2 is simply better</a> (well, this is our opinion anyway). But, even though K2 provides all the tools to make the content migration an easy task, quite often, there are quirks here and there that need to be addressed manually to ensure a successful migration.</p>
<p>One of these <em>quirks</em> is that K2 articles, unlike Joomla articles, do not have the concept of a <em>subtitle</em> built-in. Of course, you might be thinking: &#8220;What, when did Joomla articles have any subtitle?&#8221; Technically, they didn&#8217;t &#8211; but there are some extensions that make good use of the unused <em>title_alias</em> field in the <em>#__content</em> table and treat it as a subtitle. The <em>title_alias</em> field was not used by Joomla&#8217;s core as of Joomla 1.5 (it is deprecated in Joomla 3.0).</p>
<p>Now going back to K2, its automatic migration of Joomla articles to K2 articles does not take into account the unused <em>title_alias</em> &#8211; additionally, K2 articles do not have subtitles. Thankfully, with itoctopus, there&#8217;s a simple solution to everything (well, nearly everything), so we devised a three-step process to circumvent this limitation:</p>
<ol>
<li><strong>Step 1: Create an extra field called <em>Subtitle</em></strong>
<p>Creating an extra field in K2 is extremely simple &#8211; and it can be done by just going to <em>K2 -&gt; Extra Fields</em>, clicking on <em>New</em> on the top right, and then filling in the appropriate fields. It&#8217;s that simple!</p>
</li>
<li>
<p><strong>Step 2: Run the subtitle-migration script post article-migration</strong></p>
<p>The following migration script must be temporarily added to your <em>index.php</em> (on your website) in order to populate K2 articles with subtitles (we are assuming that you only have one extra field; the one that was created above):</p>
<p><code>
<pre>$db = &#038;JFactory::getDbo();
$sql = "SELECT title, title_alias FROM #__content WHERE title_alias <> ''";
$db->setQuery($sql);
$row = $db->loadAssocList();

for ($i = 0; $i < count($row); $i++){
	$sql = "SELECT id FROM #__k2_items WHERE title='".$row[$i]['title']."'";
	$db->setQuery($sql);
	$id = $db->loadResult();

	$subtitle = '[{"id":"1","value":"'.$row[$i]['title_alias'].'"}]';
	$sql = "UPDATE #__k2_items SET extra_fields ='".$subtitle."' WHERE id='".$id."'";
	$db->setQuery($sql);
	$db->query();
}</pre>
<p></code></p>
</li>
<li>
<p><strong>Step 3: Modify your template to use K2&#8217;s subtitle</strong></p>
<p>Open the <em>item.php</em> file which is located under the <em>components/com_k2/templates/[your_k2_template_name]</em> directory and add the following script where you want to display the <em>subtitle</em> field:</p>
<p><code>
<pre>foreach ($this->item->extra_fields as $key=>$extraField){
	if ($extraField->name == 'Subtitle')
		echo($extraField->value);
	else
		continue;</pre>
<p></code></pre>
<p></code></li>
</ol>
<p>That's it!</p>
<p>Of course, if you're not a programmer, then you might believe (and rightly so) that the above is a bit intimidating, and that's why we exist! Just <a href="http://www.itoctopus.com/contact-us" title="Contact us">contact us</a> and we'll do the subtitle migration for you in the glimpse of an eye (it might take <em>a bit</em> more, but you get the point). And don't you worry about <a href="http://www.itoctopus.com/fees" title="Our fees">our fees</a>, they're very, <em>very</em> affordable!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-migrate-joomla-articles-subtitles-to-k2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common Erros on Joomla&#8217;s Media Manager</title>
		<link>http://www.itoctopus.com/common-erros-on-joomlas-media-manager</link>
		<comments>http://www.itoctopus.com/common-erros-on-joomlas-media-manager#comments</comments>
		<pubDate>Mon, 06 May 2013 19:59:25 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4132</guid>
		<description><![CDATA[We have been working on Joomla websites for a long time &#8211; so long that we have reached a point that we know the common errors in nearly every Joomla feature. Below are the top common errors that Joomla administrators face when they&#8217;re using the Media Manager (we&#8217;re also explaining how to fix them):

Unable to [...]]]></description>
			<content:encoded><![CDATA[<p>We have been working on Joomla websites for a long time &#8211; so long that we have reached a point that we know the common errors in nearly every Joomla feature. Below are the top common errors that Joomla administrators face when they&#8217;re using the <em>Media Manager</em> (we&#8217;re also explaining how to fix them):</p>
<ol>
<li><strong>Unable to upload file</strong></p>
<p>This error usually happens when the upload to the server fails. Possible causes are:</p>
<ul>
<li><u>Apache has no write permissions to the <em>tmp</em> directory</u>: All files uploaded to a Joomla website are first uploaded to the <em>tmp</em> directory and then moved to the final directory once the upload is complete. This can be easily solved by changing permissions to the <em>tmp</em> directory to 777.
</li>
<li>
<p><u>Apache has no write permissions to the <em>images</em> directory</u>: As stated above, when a file is uploaded to the images directory, it is first uploaded to the <em>tmp</em> directory, and then <em>moved</em> to the <em>images</em> directory. If Apaches has no write permissions to the <em>images</em> directory, then the move fails, and subsequently the upload fails. The solution to this problem is change the permissions on the <em>images</em> directory to 777.</li>
</ul>
</li>
<li>
<p><strong>This file is too large to upload</strong></p>
<p>There are two reasons for this error to happen:</p>
<ol>
<li><u>The file size exceeds the maximum allowed file size defined in your <em>Media Manager Options</em></u>: If, for example, the value of <em>Maximum Size (in MB)</em> is 100 MB in your <em>Media Manager Options</em> page (the <em>Media Manager Options</em> page can be accessed going to the <em>Media Manager</em> in your Joomla&#8217;s backend, and then clicking on <em>Options</em> on the top right) and you are trying to upload a 200 MB file, then you will see this error. The solution to this problem is to increase the <em>Maximum Size (in MB)</em> value to something higher.
</li>
<li>
<p><u>The <em>upload_max_filesize</em>, the <em>post_max_size</em>, or the <em>memory_limit</em> values are smaller than the size of the uploaded file</u>: Even if you have changed the maximum size of an uploaded file to a very high number in your <em>Media Manager Options</em> page it might be that your host has a set, unchangeable limit on the maximum upload size. If this is the case, then you will need to ask your host to increase the maximum upload size (usually shared hosts will refuse such requests), or bite the bullet and switch to a VPS or higher (such as a dedicated server).</li>
</ol>
<p>Now you might be thinking, OK &#8211; that would take care of <em>upload_max_file_size</em>, but what about <em>post_max_size</em> and <em>memory_limit</em>? Well, the <em>post_max_size</em> is the total size that your <em>POST</em> data can have (e.g. the text and the uploaded files), which means that even if the <em>post_max_size</em> is slightly higher than the size of the file being uploaded, it is possible for the upload to fail, because it takes into consideration the text being submitted as well in the <em>POST</em> data (such as hidden fields). The <em>memory_limit</em> is even worse, because it encapsulates the size of the file being uploaded, as well as the memory required to serve the page. So, in the latter case, if you&#8217;re uploading a file that is 80 MB in size, and the <em>PHP</em> directive <em>memory_limit</em> is 100 MB, then the upload might fail if the upload script consumes more than 20 MB of memory (excluding, of course, the size of the uploaded file).</p>
<p>Note that in the case where the size of the file uploaded is lower than <em>post_max_size</em> and <em>memory_limit</em> but the upload fails because of the reasons above, then you will see the error: &#8220;Unable to upload file&#8221; instead of &#8220;This file is too large to upload&#8221;. This is because such errors are not caught by Joomla&#8217;s check. </p>
</li>
<li>
<p><strong>This file type is not supported</strong></p>
<p>You cannot just upload a random file type to Joomla &#8211; any file type that you upload must be explicitly listed in the <em>Media Manager Options</em> page in the <em>Legal Extensions</em> field. So if, for example, you&#8217;re trying to upload a <em>docx</em> file (MS Word Document) and you see this error, then all you need to do is to add <em>docx</em> to the <em>Legal Extensions</em> field so that Joomla&#8217;s <em>Media Manager</em> supports it.</p>
</li>
<li>
<p><strong>Not a valid image</strong></p>
<p>Joomla, by default, doesn&#8217;t allow non-image uploads in the <em>Media Manager</em> (it is called the <em>media</em> manager, after all). This is because of safety concerns. A possible scenario where these safety concerns are valid is a disgruntled employee (who happens to have administrative access to your website) uploading (through Joomla&#8217;s <em>Media Manager</em>) a malicious PHP file that just deletes all the files that Joomla has write access to.</p>
<p>An example in action where you will see this error is when you try to upload the <em>docx</em> file (even after adding <em>docx</em> to the <em>Legal Extensions</em> as per the above). Even though <em>docx</em> is now a legal file type, the upload fails because the file you&#8217;re trying to upload is not an image.</p>
<p>This problem can be easily addressed by modifying Joomla&#8217;s <em>Media Manager</em> settings to allow uploads of non-image files. This can be done by logging in to the backend, clicking on the <em>Options</em> button on the top right, and then clicking on <em>No</em> next to <em>Restrict Uploads</em>. It&#8217;s that simple!</li>
</ol>
<p>The above are the most common errors that Joomla administrators see when working on the <em>Media Manager</em> component. But, there is one subtle issue (it&#8217;s not really an error) where the upload fails without any error, it&#8217;s the <em>http</em>/<em>https</em> issue&#8230;</p>
<p>But what is the <em>http</em>/<em>https</em> issue?</p>
<p>The <em>http</em>/<em>https</em> issue is when the website is forced to work in <em>https</em> mode but the <em>$live_site</em> variable in the <em>configuration.php</em> file points to the <em>http</em> version of the website. When this is the case, all files uploaded through the <em>Media Manager</em> are processed through the <em>https</em> version of the website, but are submitted to the <em>http</em> version of the website. Since the latter version is not aware of the upload, the upload fails and the website is redirected back to the <em>https</em> version. This is a nasty bug in Joomla and fixing it require some changes to a core file. (Note: Changing the <em>$live_site</em> variable in Joomla means that even the frontend will work in <em>https</em>, which is typically not the desired behavior.)</p>
<p>If the latter problem is what is happening on your website, or if you need help with Joomla&#8217;s <em>Media Manager</em>, then feel free to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. <a href="http://www.itoctopus.com/fees" title="Our fees">Our rates</a> are affordable, our work is professional, we are Joomla experts, and we pride ourselves in our availability and friendliness!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/common-erros-on-joomlas-media-manager/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your Joomla Website Is Really, Really Slow? Maybe It&#8217;s Your Firewall!</title>
		<link>http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-your-firewall</link>
		<comments>http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-your-firewall#comments</comments>
		<pubDate>Mon, 29 Apr 2013 12:03:49 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4198</guid>
		<description><![CDATA[An old client of ours called us yesterday evening and told us that his website was extremely slow to load. Our first guess was that it was hacked, but it was not; his website was very clean. What could it be?
We then thought, well, maybe he has some huge queries running in the background and [...]]]></description>
			<content:encoded><![CDATA[<p>An old client of ours called us yesterday evening and told us that his website was extremely slow to load. Our first guess was that <a href="http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-hacked" title="Your Joomla website is really really slow? Maybe it's hacked!">it was hacked</a>, but it was not; his website was very clean. What could it be?</p>
<p>We then thought, well, maybe he has some huge queries running in the background and slowing down the whole website, so <a href="http://www.itoctopus.com/using-the-slow-query-log-to-reveal-bottlenecks-on-your-joomla-website" title="Using the slow query log to reveal bottlenecks on your Joomla website">we enabled the MySQL Slow Query log on his Joomla website</a>, but the log file was not populated with any slow query. We thought there was something wrong with the logging system, so we saved all the queries run by the server into a text file (all we needed to do was to slightly modify the <em>setQuery</em> function in the JDatabase class to write all the queries to a text file), and then we pasted all the queries into the <em>SQL</em> page in <em>phpMyAdmin</em> and ran them all in one shot, but they ran in under a second. Odd&#8230;</p>
<p>Maybe the load on the server was very high, we thought. So we checked the load on the server using <em>top</em>, and it was below 0.3 &#8211; an extremely comfortable load level (meaning that there are no load issues on the server whatsoever). Hmmm&#8230;</p>
<p>Our next attempt was to contact the host and tell them about the problem, maybe it&#8217;s a routing/DNS issue on their end. Their reply was immediate and clear: &#8220;The website loads extremely fast on our end, so it might be the script or it might be that your ISP is experiencing connection issues. Please take a look at your script&#8217;s code and/or check with your ISP.&#8221; A typical first response from any hosting company to throw the blame on anything but their servers. We were relentless, though&#8230; So we replied back: &#8220;We&#8217;re sure it&#8217;s not the script and we have checked the website from multiple places and multiple ISPs, and the problem is always there. Could you please check the website from outside your network? Maybe it&#8217;s a routing issue&#8230;&#8221; We got a reply that they&#8217;re going to take a &#8220;closer&#8221; look.</p>
<p>Sure enough, 10 minutes later, we got the following reply: &#8220;We&#8217;ve updated and tweaked your firewall&#8230; It looks like it was just the firewall blocking a little more than was necessary. It looks like the SYN_FLOOD protection was enabled, which will cause these sorts of issues sometimes. We&#8217;re sorry for the inconvenience this must have caused you. Please confirm that the issue is resolved and please let us know if you run into any more issues.&#8221; Ahaaaa!</p>
<p>So it was something on their network! Now, You might be wondering, what is this <em>SYN_FLOOD</em> thing? Well, for those of you who have some technical knowledge in the web, you might already know that there is something called DoS (Denial of Service attack). Denial of Service attack, in short, is a kind of malicious attack that will send many simultaneous connections from different IPs to the web server, until the server is brought down to its knees. One method of dealing with this is to limit the number of connections from an IP to a defined number (this is a setting that relates to the <em>SYN_FLOOD</em> term and is defined at the firewall level). Now remember, every file that is requested from the server and every image is a connection, which means that a web page that has 10 images, and that calls about 5 CSS files and 7 JavaScript files means that there are at least 28 connections (one master connection to the page, 12 for loading files, and 10 for loading images). If the aforementioned <em>defined number</em> is less than 28, then in nearly all cases, the page loading will be very slow, because the firewall will think that this is an attack (the firewall has no way to distinguish legitimate connections from malicious connections). What happened, in the case of the client, is that the maximum number of connections was always above that number &#8211; hence the extreme slowness of the website &#8211; increasing that number solved the issue.</p>
<p>Now, in case you&#8217;re experiencing the same problem then we suggest you call your host and ask them to check your firewall settings. If your host confirms that everything&#8217;s OK with your website (it&#8217;s important to be persistent), then the problem might be on your actual website, and this where we are very useful! Just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll sure fix the problem for you in no time and for a <a href="http://www.itoctopus.com/fees" title="Our fees!">very affordable fee</a>. By the way, we are the friendliest programmers you&#8217;ve ever worked with (and you&#8217;ll ever work with) &#8211; at least that&#8217;s what our clients tell us!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-your-firewall/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Credit Card Validation on Joomla</title>
		<link>http://www.itoctopus.com/credit-card-validation-on-joomla</link>
		<comments>http://www.itoctopus.com/credit-card-validation-on-joomla#comments</comments>
		<pubDate>Tue, 23 Apr 2013 22:34:24 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4191</guid>
		<description><![CDATA[One of the most exciting things about owning a Joomla website is that one can build an e-commerce website in a very short period. Imagine that, it takes just a few days for you to sell your own products/services online and benefit from that huge market! But, unfortunately, in the real world, it&#8217;s not always [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most exciting things about owning a Joomla website is that <a href="http://www.itoctopus.com/how-to-create-an-e-commerce-website-from-scratch-with-joomla" title="How to create an e-commerce website from scratch with Joomla">one can build an e-commerce website in a very short period</a>. Imagine that, it takes just a few days for you to sell your own products/services online and benefit from that huge market! But, unfortunately, in the real world, it&#8217;s not always a panacea.</p>
<p>Let&#8217;s take, for example, one of our clients who sells training videos on how to use the Internet. Since the absolute majority of his clientele consists of people who are nearly web-illiterate, then, needless to say, the amount of failed transactions that he was getting was enormous. For those who don&#8217;t know, there is a fee of about 20 to 35 cents for each transaction, whether that transaction is successful or not! Our client had to increase his price to offset the cost of failed transactions, a move that lowered interest in his products and ultimately reduced his profits. So, he came to us and asked for advice, and he was very glad he did.</p>
<p>Our first response to our client was: &#8220;Are you using Luhn to validate credit card numbers before sending them to the payment gateway?&#8221; Obviously, his immediate question was: &#8220;What is Luhn?&#8221;</p>
<p>And suddenly things were more interesting, because at this point we knew that we can help our client&#8230; So, let us first explain what is &#8220;Luhn&#8221;.</p>
<p>&#8220;Luhn&#8221; is a checksum algorithm that <em>all</em> credit card numbers have to comply with &#8211; in other words, a wrong credit card number will be immediately caught by the Luhn algorithm.</p>
<p><em>But, what is the advantage of using Luhn?</em></p>
<p>Since Luhn is an algorithm, then it can be implemented as a PHP function, and then integrated into VirtueMart&#8217;s checkout page (before sending the information to the payment gateway) or as a system plugin intercepting the checkout process. This means that instead of sending the payment gateway an erroneous card number, the error is caught at the Joomla level and the user is requested to verify the number. This means a saving of 20 to 35 cents every time someone enters a wrong credit card number. Since our client was having nearly a hundred failed transactions every single day because of wrong credit card numbers, we saved him hundreds of dollars every month by implementing the algorithm&#8230;</p>
<p><em>So, is that all?</em></p>
<p>No, not really&#8230; Our customer also had an even bigger problem. Many of his transactions had the wrong address, so not only he was paying the transaction fee on those transactions, he was losing a sale because his clients were not sure of the address on their credit cards. Again, he asked for our help on this one.</p>
<p>Our approach to solve the problem was very simple, we asked our client to scrap AVS (Address Verification System) checking and use CVV verification instead. In our experience, AVS can lead to many failed transactions and is more fraud-prone than CVV. Our customer, based on our recommendation, instructed to implement the change (e.g. drop AVS in favor of CVV) and everything worked like a charm. More sales were flowing in through his Joomla website and there was considerably less fraud. (Note that some payment gateways refuse to disable AVS checking, while others force their merchants to use AVS checking in conjunction with CVV verification.)</p>
<p><em>So, is that <em>really</em> all?</em></p>
<p>Well &#8211; not quite! There are several other credit card validation strategies that will reduce your fees and increase your ROI, and we can help you implement them on your Joomla website (after all, we are the Joomla experts!) Just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and you&#8217;ll see how efficient, knowledgeable, and reliable we are! Oh, and don&#8217;t you worry about <a href="http://www.itoctopus.com/fees" title="Our fees!">our fees</a>, they are really affordable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/credit-card-validation-on-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 8 Reasons Why You Should Use K2</title>
		<link>http://www.itoctopus.com/top-8-reasons-why-you-should-use-k2</link>
		<comments>http://www.itoctopus.com/top-8-reasons-why-you-should-use-k2#comments</comments>
		<pubDate>Mon, 15 Apr 2013 12:45:21 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4171</guid>
		<description><![CDATA[K2, for those who don&#8217;t know, is a powerful extension that can be used to completely replace Joomla&#8217;s own content management system. In other words, you no longer need to create Joomla articles and categories, you can just create K2 articles and categories. In fact, many of our customers use K2 and we are currently [...]]]></description>
			<content:encoded><![CDATA[<p>K2, for those who don&#8217;t know, is a powerful extension that can be used to completely replace Joomla&#8217;s own content management system. In other words, you no longer need to create Joomla articles and categories, you can just create K2 articles and categories. In fact, many of our customers use K2 and we are currently switching a fair few of our other customers to K2. By now, you might be wondering: &#8220;What&#8217;s the point of having a CMS within a CMS? What&#8217;s wrong with Joomla&#8217;s own CMS?&#8221;</p>
<p>To answer the second question, there&#8217;s nothing wrong with Joomla&#8217;s CMS &#8211; it is versatile, it is flexible, and it is powerful. But there are many reasons why K2 is more versatile, more flexible, and much more powerful. Here are the top 8:</p>
<ol>
<li><strong>K2&#8217;s migration process is a breeze!</strong></p>
<p>Unlike Joomla, K2 does not change core and database structure with every version, and if it does, it provides a seamless way to migrate from one version to another. In fact, upgrading to the latest version of K2 consists (in most cases) of merely installing the latest version and boom &#8211; all the content is automatically migrated! There&#8217;s no need to <a href="http://www.itoctopus.com/how-hard-is-it-to-migrate-from-joomla-1-5-to-joomla-2-5" title="How hard is it to migrate from Joomla 1.5 to Joomla 2.5?">jump through hoops</a> to do that! While Joomla&#8217;s content migration can take hours if not days, K2&#8217;s content migration can take literally minutes (if migrated within the same Joomla version).</p>
</li>
<li>
<p><strong>Many prominent extensions are compatible with K2</strong></p>
<p>Although <a href="http://www.itoctopus.com/sh404-the-worst-joomla-extension" title="sh404 – The worst Joomla extension">we don&#8217;t like sh404</a>, we have to admit that it&#8217;s one of the most used and one of the most prominent Joomla extensions. Luckily, K2 has native (and <a href="http://www.itoctopus.com/using-forward-slash-instead-of-a-hyphen-in-k2s-sh404-links" title="Using forward slash instead of a hyphen in K2's sh404 links">easily modifiable</a>) support for sh404 (it&#8217;s interesting to note that it&#8217;s K2 that supports sh404, and not the other way around).</p>
<p>Additionally, there are many extensions that are made exclusively for K2, and <em>all</em> (we are using the word <em>all</em> responsibly here) extensions can be adapted to work with K2 instead of Joomla&#8217;s own content!</p>
</li>
<li>
<p><strong>K2 is easier than Joomla&#8217;s own CMS</strong></p>
<p>Hmmm&#8230; How could that be? Isn&#8217;t Joomla easy enough? Well, no it&#8217;s not! If you want to add an image to an article, you need to go to the media manager and do it from there. You will then need to go back to the article itself and insert the image from the article (unless, of course, you are using <em>JCE Editor</em> or another powerful editor, and not Joomla&#8217;s default editor). In K2, you can insert the image from the article itself! (You can even insert a whole gallery!)</p>
</li>
<li>
<p><strong>K2 has more features than Joomla&#8217;s own core</strong></p>
<p>Let&#8217;s start: Tags, native comments, custom fields, related items, etc&#8230; All of these are features that exist in K2, but not in Joomla. Many websites out there desperately need the aforementioned features, and resort to 3<sup>rd</sup> party extensions to address this!</p>
<p>Oh, and did we mention native social sharing?</p>
</li>
<li>
<p><strong>K2 is stable</strong></p>
<p>Apart from the very few non-toxic, non-harmful bugs that we have encountered while working with K2, we can safely say that K2 is no less stable than Joomla&#8217;s own core. Also, keep in mind that it&#8217;s much easier (and less stressful) to fix something in K2&#8217;s core than fixing it in Joomla&#8217;s core. </p>
</li>
<li>
<p><strong>It is very easy to modify/adapt K2&#8217;s template to fit a site&#8217;s theme</strong></p>
<p>K2&#8217;s template has more or less the same structure of Joomla&#8217;s content template &#8211; and both can be overriden by the site&#8217;s template. This means that if you&#8217;re already familiar with Joomla&#8217;s theme overriding functionality, then you won&#8217;t have a problem with overriding K2&#8217;s theme!</p>
</li>
<li>
<p><strong>K2 has a huge community and a responsible core team</strong></p>
<p>There are many, many websites out there that use K2, and system administrators using K2 tend to share the problems that they&#8217;re encountering and the challenges that they&#8217;re facing with other K2 users. This has created over the years an active and a very large community.</p>
<p>Additionally, we have noticed that K2&#8217;s core team is extremely proactive when it comes to fixing bugs. The team is also very responsible when releasing new versions (K2 is not the kind of extensions where the developers say: &#8220;Ooops, we have messed up on the previous version, please immediately uninstall it and use this version instead. No wait, we&#8217;ve messed up again! Etc&#8230;&#8221;).</p>
</li>
<li>
<p><strong>K2 is secure</strong></p>
<p>Last but not least &#8211; K2 is secure! In fact, we have not had a single instance so far of a hacked website where the culprit was a K2 vulnerability. We have to admit though that in many cases, the main culprit was Joomla (yes, it was an outdated version, but still!).</li>
</ol>
<p>If you&#8217;re using K2, then we hope that you have enjoyed our list of the advantages of using K2. If you&#8217;re not using K2 but would like to, then <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We can easily migrate your website from using Joomla&#8217;s core for content management to using K2. The job might take a few days to accommodate all the features on your website, but it&#8217;s well worth it, and <a href="http://www.itoctopus.com/fees" title="Our fees">we&#8217;re not that expensive anyway</a>! Go ahead, give us a call or shoot us an email!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/top-8-reasons-why-you-should-use-k2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Fix the &#8220;JUser: :_load: Unable to load user with ID: 62&#8243; Error on Joomla</title>
		<link>http://www.itoctopus.com/how-to-fix-the-juser-_load-unable-to-load-user-with-id-62-error-on-joomla</link>
		<comments>http://www.itoctopus.com/how-to-fix-the-juser-_load-unable-to-load-user-with-id-62-error-on-joomla#comments</comments>
		<pubDate>Thu, 04 Apr 2013 14:47:40 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4135</guid>
		<description><![CDATA[Some of the very old websites that we migrate to Joomla 2.5 may show the following error on K2 or VirtueMart pages:
JUser: :_load: Unable to load user with ID: 62 (Note that 62 might be another number, such as 42)
The reason for the error is that the component is trying to load a user (such [...]]]></description>
			<content:encoded><![CDATA[<p>Some of the very old websites that we migrate to Joomla 2.5 may show the following error on K2 or VirtueMart pages:</p>
<p><em>JUser: :_load: Unable to load user with ID: 62</em> (Note that 62 might be another number, such as 42)</p>
<p>The reason for the error is that the component is trying to load a user (such as the user that created the article in K2) but is not able to find it (which is very normal in a Joomla 2.5 migration, since the main super administrator, who typically has an ID of 62 in Joomla 1.5, has a different ID in Joomla 2.5).</p>
<p>There are multiple fixes for this issue:</p>
<ul>
<li><strong>Suppress the error by changing a core file</strong>
<p>Although we really don&#8217;t like changing core files, we have to say that this an extremely easy fix that is guaranteed to work. Here&#8217;s how to do it:</p>
<ul>
<li>Open the file <em>user.php</em> (through FTP) located under the <em>libraries/joomla/user</em> directory.
</li>
<li>
<p>Remove the following line (which is line 886):</p>
<p><code>JError::raiseWarning('SOME_ERROR_CODE', JText::sprintf('JLIB_USER_ERROR_UNABLE_TO_LOAD_USER', $id));</code></p>
</li>
<li>
<p>Save the file and upload it back.</p>
</li>
<li>
<p>That&#8217;s it!</li>
</ul>
<p>Note that even if the <em>user.php</em> is overwritten in a future Joomla update, all you need to do is to apply the above again and you should be OK!</p>
</li>
<li>
<p><strong>Set the <em>JLIB_USER_ERROR_UNABLE_TO_LOAD_USER</em> string to empty</strong></p>
<p>This is another change to a core file, but this change is less likely to be overridden by future Joomla updates, this is because you are changing a language file. Here&#8217;s how to do it:</p>
<ul>
<li>Open the file <em>en-GB.lib_joomla.ini</em> located under the <em>language/en-GB</em> directory.
</li>
<li>
<p>Change the following line (which is typically line 624):</p>
<p><code>JLIB_USER_ERROR_UNABLE_TO_LOAD_USER="JUser: :_load: Unable to load user with ID: %s"</code></p>
<p>to:</p>
<p><code>JLIB_USER_ERROR_UNABLE_TO_LOAD_USER=""</code></li>
</ul>
<p>&#8230;and that should work!</p>
</li>
<li>
<p><strong>Fix the data</strong></p>
<p>Fixing the data consists of going into the database and changing all references to the user ID 62 with another user (typically the first super admin created on your Joomla website).</p>
<p>This can be done either manually or through a script. If done manually, then this can take many hours (if not days) and is definitely error prone. If done through a script, then it can be done quickly but you might risk breaking the whole website if your script goes berserk. Beware!</p>
</li>
<li>
<p><strong>Set the ID of a newly created super administrator to 62</strong></p>
<p>You can&#8217;t choose which ID a user will have before it&#8217;s created. But, once that user is created, you can change its ID. Here&#8217;s how you can do that:</p>
<ul>
<li>Create a super administrator through Joomla&#8217;s <em>User Manager</em>.
</li>
<li>
<p>Change that user&#8217;s ID to 62 in the <em>#__users</em> table through <em>phpMyAdmin</em>.</p>
</li>
<li>
<p>Change the ID of that user in the table <em>#__user_usergroup_map</em> to 62.</li>
</ul>
<p>The above is, in our opinion, the best way to address this issue, but you will need to have access to <em>phpMyAdmin</em> (or you need to have programming skills) to do it.</p>
</li>
<li>
<p><strong>Fix the script that tries to load the ID</strong></p>
<p>While this might sound like the best idea, it can turn into a horrible nightmare. This is because K2 and VirtueMart are both extremely complicated and delicate extensions and trying to change their core is much worse than changing Joomla&#8217;s own core. Keep clear if you&#8217;re not a programming expert, and consider the much easier options listed above!</li>
</ul>
<p>If you&#8217;re seeing this error on your website and you don&#8217;t feel comfortable fixing it yourself (even after reading our guide), then why not <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>? We can fix it for you in no time, <a href="http://www.itoctopus.com/fees" title="Our fees!">we won&#8217;t charge you much</a>, and we are very, <em>very</em> reliable! What are you waiting for?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-fix-the-juser-_load-unable-to-load-user-with-id-62-error-on-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Make Multithumb Work with K2</title>
		<link>http://www.itoctopus.com/how-to-make-multithumb-work-with-k2</link>
		<comments>http://www.itoctopus.com/how-to-make-multithumb-work-with-k2#comments</comments>
		<pubDate>Wed, 03 Apr 2013 09:57:28 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4136</guid>
		<description><![CDATA[Many of the Joomla websites we work on have multithumb installed. Multithumb, in case you don&#8217;t know what it is, is a Joomla plugin that automatically converts images to thumbnails (or smaller images) so as not to break the layout of the page. In some cases, multithumb works perfectly, but in many cases, its settings [...]]]></description>
			<content:encoded><![CDATA[<p>Many of the Joomla websites we work on have <em>multithumb</em> installed. <em>Multithumb</em>, in case you don&#8217;t know what it is, is a Joomla plugin that automatically converts images to thumbnails (or <em>smaller</em> images) so as not to break the layout of the page. In some cases, <em>multithumb</em> works perfectly, but in many cases, its settings need some tweakings for it to work&#8230;</p>
<p>For example, if you&#8217;re using K2 as your main content engine and you need to create thumbnails of the images in your K2 articles, then <em>multithumb</em> will not work in its default settings. However, it&#8217;s very easy to address that! Here&#8217;s what you need to do:</p>
<ul>
<li><strong>If you want <em>multithumb</em> to work in the <em>itemlist</em> view of K2</strong></p>
<ol>
<li>Go to <em>Extensions</em> &gt; <em>Plug-in Manager.</em>
</li>
<li>
<p>Search for <em>multithumb</em> and then click on the <em>multithumb</em> plugin.</p>
</li>
<li>
<p>On the right hand side, click on <em>Integration Parameters</em>.</p>
</li>
<li>
<p>Change the value of <em>Blog Page rules</em> to:</p>
<p><em>option=com_content&#038;view=featured,option=com_content&#038;layout=blog,option=com_k2&#038;view=itemlist</em></li>
</ol>
</li>
<li>
<p><strong>If you want <em>multithumb</em> to work in the <em>article</em> view of K2</strong></p>
<ol>
<li>Do the steps 1 to 3 above.
</li>
<li>
<p>Change the value of <em>Article Page rules</em> to:</p>
<p><em>option=com_content&#038;view=article,option=com_flexicontent&#038;view=items,option=com_k2&#038;view=item</em></li>
</ol>
</li>
</ul>
<p><em>But, what about excluding specific categories?</em></p>
<p>Since the items in K2 and Joomla articles both have <em>catid</em> as the name of the field containing the id of the category that this item/article belongs to, then, thankfully, there is no need to modify the <em>multithumb</em> plugin to accommodate this functionality.</p>
<p><em>So, is that really it?</em></p>
<p>Well, in some cases, it is not. In fact, on many websites we worked on where most of the content came from K2, we had to modify the <em>multithumb</em> plugin (not just its parameters) to make it fully compatible with K2. So, if you implement the above steps and they don&#8217;t work for you, then most likely the <em>multithumb</em> plugin needs to be modified &#8211; <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> if you need help doing that! We are experts in Joomla, <a href="http://www.itoctopus.com/fees" title="Our fees!">our fees</a> are affordable, we work very fast, and we are the friendliest programmers on this planet, period!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-make-multithumb-work-with-k2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>K2 Search Not Working for 3 Letter Words? Here&#8217;s How to Fix!</title>
		<link>http://www.itoctopus.com/k2-search-not-working-for-3-letter-words-heres-how-to-fix</link>
		<comments>http://www.itoctopus.com/k2-search-not-working-for-3-letter-words-heres-how-to-fix#comments</comments>
		<pubDate>Fri, 29 Mar 2013 05:20:31 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4138</guid>
		<description><![CDATA[One of the projects we are currently working on is converting a website from using Joomla&#8217;s content to K2&#8217;s content. In other words, all the articles, categories, images, are migrated to K2 and the website must display all its content from K2. Additionally, all the modules that are using Joomla&#8217;s content must be modified to [...]]]></description>
			<content:encoded><![CDATA[<p>One of the projects we are currently working on is converting a website from using Joomla&#8217;s content to K2&#8217;s content. In other words, all the articles, categories, images, are migrated to K2 and the website must display all its content from K2. Additionally, all the modules that are using Joomla&#8217;s content must be modified to use K2. While it might seem an easy project, it is not&#8230;</p>
<p>One of the <em>smarter</em> modules that didn&#8217;t need to be converted was the <em>RokAjaxSearch</em> module. This module (for those of you who don&#8217;t know) adds an Ajax powered search functionality to a Joomla website. What was really impressive about it is that all we needed to do to make it work with K2 was to disable Joomla&#8217;s specific search plugins (specifically <em>Search &#8211; Content</em> and <em>Search &#8211; Categories</em>) and enable K2&#8217;s specific search plugin (<em>Search &#8211; K2)</em>.</p>
<p>However, we noticed a small <em>quirk</em> in the search behavior. The module was not returning any results from search queries of 3 characters or less. For example, search for the word <em>the</em> returned nothing, although the site had many thousand articles (all in English), which meant that it definitely had the word <em>the</em> somewhere.</p>
<p>After spending some time investigating the issue, we&#8217;ve zeroed in on the cause. It was the following line in the <em>k2.php</em> plugin file located right under the <em>plugins/search/k2</em> directory:</p>
<p><code>$query .= "MATCH(i.title, i.introtext, i.`fulltext, i.extra_fields_search, i.image_caption, i.image_credits, i.video_caption, i.video_credits, i.metadesc, i.metakey) AGAINST  ({$text} IN BOOLEAN MODE))";</code></p>
<p>Let us explain&#8230; The above line is part of the search query that runs every time the user searches for something. For those of you who are technical, the <em>MATCH&#8230;AGAINST</em> pattern is an efficient mechanism to perform a full text search, and it is much better (and more efficient) than using <em>LIKE</em>. On the flip side, however, <em>MATCH&#8230;AGAINST</em> cannot work on 3 letter words (unless <em>MySQL</em> is compiled in a non-standard way &#8211; which is something that only very advanced system administrators can do), but <em>LIKE</em> can. So, we had 2 options to fix the problem:</p>
<ol>
<li>Recompile MySQL</li>
<li>Use <em>LIKE</em> instead of <em>MATCH&#8230;AGAINST</em> for 3 letter words</li>
</ol>
<p>Obviously, we went with the second option, and so we changed the above line to the following:</p>
<pre>
<code>if (strlen($searchText) == 3)
	$query .= " i.title LIKE '%$searchText%' OR i.introtext LIKE '%$searchText%' OR i.`fulltext` LIKE '%$searchText%')";
else
	$query .= "MATCH(i.title, i.introtext, i.`fulltext`, i.extra_fields_search, i.image_caption, i.image_credits, i.video_caption, i.video_credits, i.metadesc, i.metakey) AGAINST ({$text} IN BOOLEAN MODE)</code></pre>
<p>This has worked beautifully!</p>
<p>Two things to note in our fixed code: 1) <em>$searchText</em> is the <em>unaltered</em> search query that was entered by the user (after filtering, of course), and 2) we did <em>== 3</em> instead of <em> &lt;= 3</em> because we wanted search queries of less than 3 characters to be ignored.</p>
<p>If you&#8217;re having problems with K2 search and need help with it, or if you&#8217;re having another Joomla problem, then why not <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>? We are unbelievably fast, we are hard workers, we are experts in Joomla, and <a href="http://www.itoctopus.com/fees" title="Our fees!">our prices</a> are very, very affordable!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/k2-search-not-working-for-3-letter-words-heres-how-to-fix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Slow Query Log to Reveal Bottlenecks on Your Joomla Website</title>
		<link>http://www.itoctopus.com/using-the-slow-query-log-to-reveal-bottlenecks-on-your-joomla-website</link>
		<comments>http://www.itoctopus.com/using-the-slow-query-log-to-reveal-bottlenecks-on-your-joomla-website#comments</comments>
		<pubDate>Mon, 25 Mar 2013 02:04:21 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3872</guid>
		<description><![CDATA[Note 1: This post is targeted at system administrators with hands-on experience with MySQL. If you&#8217;re not a technical person, then please forward this post to your system administrator (you can always hire us if you don&#8217;t have one!).
Note 2: You will need root access to your server&#8217;s shell to implement the instructions in this [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note 1: This post is targeted at system administrators with hands-on experience with MySQL. If you&#8217;re not a technical person, then please forward this post to your system administrator (you can always hire us if you don&#8217;t have one!).</p>
<p>Note 2: You will need root access to your server&#8217;s shell to implement the instructions in this post.</em></p>
<p>You wake up one day refreshed and ready for action, you have your coffee and your little breakfast, and then you sit down behind your desk to start work &#8211; hoping it&#8217;ll be another productive and profitable day! You turn on your PC and browse to your Joomla website to check if everything&#8217;s OK, but, to your surprise, your website loads very, very slowly. You think it might be a problem with your connection, so you visit other websites, and they&#8217;re all good. Hmmmm!</p>
<p>You remember reading our post that states that <a href="http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-hacked" title="Your Joomla website is really really slow? Maybe it's hacked!">slowness in Joomla might be the sign of a hacked website</a>, so you do all the necessary checks, and you rule that out. &#8220;Might it be my host?&#8221;, you wonder&#8230; So you call your host, trying to gently blame the problem on them, and asking them politely to fix it. Your host&#8217;s support personnel points out that everything is OK from their end, but the load on your server is quite high &#8211; almost reaching 100%. Aha! Now you&#8217;re on to something, because when the load is that high on a web server, then in 99% of the cases it is a heavy query (or a series of heavy queries) being executed by MySQL and reducing the performance.</p>
<p>So, just to make sure, you login through <em>ssh</em> to your server, and your run the following command:</p>
<p><code>top</code><br />
(Yes &#8211; it&#8217;s just one word!)</p>
<p>As expected, you see the <em>mysqld</em> process exhausting most of your server&#8217;s processing power. So now that you&#8217;re sure that the culprit is <em>MySQL</em>, the next step is to determine which query (or queries) is (are) causing the bottleneck. Thankfully, there is something called the <em>Slow Query Log</em>, which is a <em>MySQL</em> tool that <em>logs</em> the database queries that are taking a long time to execute to a file of your choice.</p>
<p>Here&#8217;s how to enable the <em>Slow Query Log</em> in <em>MySQL</em>:</p>
<ul>
<li>Login through <em>ssh</em> as <em>root</em> to your web server (we are assuming that your database server is the same as your web server)</em>.
</li>
<li>
<p>Create the file <em>mysql_slow_queries.log</em> under the <em>/tmp</em> directory. This can be done using the following command:</p>
<p><code>touch /tmp/mysql_slow_queries.log</code></p>
</li>
<li>
<p>Ensure that all users are able to write to the file that you have created above by issuing the following command:</p>
<p><code>chmod 666 /tmp/mysql_slow_queries.log</code></p>
</li>
<li>
<p>Open the file <em>/etc/my.cnf</em> in edit mode (through <em>vi</em> or <em>nano</em>) and add the following line (to the end of the file):</p>
<p><code>log_slow_queries=/tmp/mysql_slow_queries.log</code></p>
<p>This tells <em>MySQL</em> to write all slow queries to the file <em>mysql_slow_queries.log</em> located under the <em>tmp</em> directory.</p>
</li>
<li>
<p>Restart <em>MySQL</em>. This is done using the following command:</p>
<p><code>/etc/init.d/mysql restart</code></p>
<p>Note that restarting <em>MySQL</em> will cause a very brief downtime on your website. If the above command hangs or fails, then contact your host immediately!</li>
</ul>
<p>After doing the above, <em>MySQL</em> will log all queries which are taking more than 2 seconds (2 seconds is the default) to execute. To change the minimum amount of time for a query to considered as <em>slow</em> (and thus logged), you need only to change the value of <em>long_query_time</em> in the <em>/etc/my.cnf</em> file (and, of course, restart <em>MySQL</em>).</p>
<p>Now, the next time your Joomla website has performance issues because of a slow query, you will know which one it is (because it will be logged), and once you know that, all you need to do is to optimize that query. So, now your question is most likely: &#8220;How can I optimize a query?&#8221;</p>
<p>Well, a query is slow because of two main reasons:</p>
<ul>
<li>One or more fields in the <em>WHERE</em> or <em>ON</em> condition (in case of a <em>JOIN</em>) is not indexed.</li>
<li>The query is badly written.</li>
</ul>
<p>In the first case, you will need to add indexes to the affected field(s). In the second case, you will need to rewrite the query.</p>
<p>We hope this post helps you identify those queries affecting the performance of your Joomla website. If it doesn&#8217;t, of if it does, but you still need help fixing those queries, then why not <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We are experts in Joomla, our work is of top-notch quality, <a href="http://www.itoctopus.com/fees" title="Our fees!">our fees</a> are reasonable, and we are the friendliest developers on this planet!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/using-the-slow-query-log-to-reveal-bottlenecks-on-your-joomla-website/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8220;Fatal error: Cannot access protected property ContentViewArticle::$params&#8221; Error in Joomla</title>
		<link>http://www.itoctopus.com/fatal-error-cannot-access-protected-property-contentviewarticle-params-error-in-joomla</link>
		<comments>http://www.itoctopus.com/fatal-error-cannot-access-protected-property-contentviewarticle-params-error-in-joomla#comments</comments>
		<pubDate>Tue, 19 Mar 2013 01:31:44 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4090</guid>
		<description><![CDATA[About 70% of the work we&#8217;re doing nowadays is migrating Joomla websites from version 1.5 to version 2.5. A common error that we get while migrating a template is the following:
Fatal error: Cannot access protected property ContentViewArticle::$params
We have seen the above error so many times so far that we now know the solution by heart.
So, [...]]]></description>
			<content:encoded><![CDATA[<p>About 70% of the work we&#8217;re doing nowadays is migrating Joomla websites from version 1.5 to version 2.5. A common error that we get while migrating a template is the following:</p>
<p><em>Fatal error: Cannot access protected property ContentViewArticle::$params</em></p>
<p>We have seen the above error so many times so far that we now know the solution by heart.</p>
<p><strong>So, how does this problem happen?</strong></p>
<p>Old auto-generated <em>Artisteer</em> templates have a file called <em>functions</em>, which is located in the root directory of the Joomla&#8217;s template. Some functions (located in the <em>functions</em> file), such as the <em>artxPageTitle</em> function, try to access protected properties directly, which is technically illegal, and thus returning the above <em>fatal</em> error.</p>
<p><strong>And, how can the problem be solved?</strong></p>
<p>Many websites, even Joomla&#8217;s official website, suggest solutions that most likely will not work, or that will work, but will destroy some functionality on the website. This is a bit disappointing, because the solution couldn&#8217;t be simpler. Here&#8217;s how you can solve the problem:</p>
<ul>
<li>Locate the problematic line (usually the error message will specify which line is that).
</li>
<li>
<p>Check what is the object name trying to access the <em>params</em> property (or attribute). For example, if you have something like <em>$page-&gt;params</em> in your code then the object name that you&#8217;re looking for is $page.</p>
</li>
<li>
<p>Add the following line in the top of the function that has the problem (assuming the object name is <em>$page</em>):</p>
<p><code>jimport( 'joomla.html.parameter' );<br />
$params = new JParameter($page-&gt;get('params'));</code><br />
</em></p>
</li>
<li>
<p>Replace all occurrences of <em>$page-&gt;params</em> with <em>$params</em> in your function. (again, we are assuming that the name of the object trying to access the <em>$params</em> property is <em>$page</em>).</p>
</li>
<li>
<p>That&#8217;s it!</li>
</ul>
<p>A real life example would be the <em>artxPageTitle</em> function which should change from:</p>
<p><code>
<pre>function artxPageTitle($page, $criteria = null, $key = null){
	if ($criteria === null)
		$criteria = $page-&gt;params-&gt;def('show_page_title', 1);
	return $criteria
		? ('&lt;span class="componentheading' . $page-&gt;params-&gt;get('pageclass_sfx') . '"&gt;'
			. $page-&gt;escape($page-&gt;params-&gt;get($key === null ? 'page_title' : $key)) . '&lt;/span&gt;')
		: '';
}</pre>
<p></code>to:</p>
<p><code>
<pre>
function artxPageTitle($page, $criteria = null, $key = null){
	jimport( 'joomla.html.parameter' );
	$params = new JParameter($page-&gt;get('params'));

	if ($criteria === null)
		$criteria = $params-&gt;def('show_page_title', 1);
	return $criteria
		? ('&lt;span class="componentheading' . $params-&gt;get('pageclass_sfx') . '"&gt;'
			. $page-&gt;escape($params-&gt;get($key === null ? 'page_title' : $key)) . '&lt;/span&gt;')
		: '';
}</code></pre>
<p>If this post is a bit too technical for you, then that's why we're here for! All you need to do is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and you can rest assured that we'll fix this problem for you in a glimpse and that <a href="http://www.itoctopus.com/fees" title="Our fees!">we won't charge you much</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/fatal-error-cannot-access-protected-property-contentviewarticle-params-error-in-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Forward Slash Instead of a Hyphen in K2&#8217;s sh404 Links</title>
		<link>http://www.itoctopus.com/using-forward-slash-instead-of-a-hyphen-in-k2s-sh404-links</link>
		<comments>http://www.itoctopus.com/using-forward-slash-instead-of-a-hyphen-in-k2s-sh404-links#comments</comments>
		<pubDate>Sat, 16 Mar 2013 16:15:59 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4059</guid>
		<description><![CDATA[Yes &#8211; we know &#8211; the title of this post couldn&#8217;t be more odd, but here&#8217;s the scenario:

We were migrating a large website from Joomla 1.5 to Joomla 2.5.
Nearly all of the content of the migrated website was created in K2 and the website was using sh404.
The links on the old Joomla 1.5 website had [...]]]></description>
			<content:encoded><![CDATA[<p>Yes &#8211; we know &#8211; the title of this post couldn&#8217;t be more odd, but here&#8217;s the scenario:</p>
<ul>
<li>We were migrating a large website from Joomla 1.5 to Joomla 2.5.</li>
<li>Nearly all of the content of the migrated website was created in K2 and the website was using sh404.</li>
<li>The links on the old Joomla 1.5 website had the following format: <em>http://www.ourclientjoomlawebsite.com/[article-id]<span style="color: red; font-weight: bold">/</span>[article-alias].html</em>.</li>
<li>In the migrated Joomla 2.5 website, the links had the following format <em>http://www.ourclientjoomlawebsite.com/[article-id]<span style="color: red; font-weight: bold">-</span>[article-alias].html</em>.</li>
</ul>
<p>As you can see from the above, the links had a <em>dash</em> between the article id and the article alias in Joomla 2.5, however, in Joomla 1.5, they had a forward slash.</p>
<p>Now we have tried everything to change that dash into a forward slash &#8211; we changed every value in K2 sh404&#8217;s settings (which can be accessed in K2&#8217;s configuration from the K2 component, and not from sh404) &#8211; but nothing worked. The dash was always a dash&#8230;</p>
<p>So we checked K2&#8217;s code to see if the dash was hard-coded somewhere, and, to our surprise it was: Here&#8217;s line 181 of the file <em>com_k2.php</em> located under the <em>components/com_k2/sef_ext</em> directory:</p>
<p><code>$title[] = $row->id.'<span style="color: red; font-weight: bold">-</span>'.$row->$sh404SefTitleAlias;</code></p>
<p>It was obvious that the dash was hard coded in the code&#8230;</p>
<p><strong>So, what did we do to fix the problem?</strong></p>
<p>We just changed the above line (in the file <em>com_k2.php</em>) to the following&#8230;</p>
<p><code>$title[] = $row->id.'<span style="color: red; font-weight: bold">/</span>'.$row->$sh404SefTitleAlias;</code></p>
<p>&#8230; and K2 was intelligent enough to handle the rest! We <em>purged</em> the URLs in sh404 and we re-visited the website and all the links were now OK! Not too bad for a one-character-change in the code, huh?</p>
<p>Now, in case you have a problem with K2&#8217;s links in sh404, or just any other problem on your Joomla website, then you can rest assured that we can fix it for you. We are professional, we are hard working, we are fast, we know Joomla inside out, and <a href="http://www.itoctopus.com/fees" title="Our fees!">we won&#8217;t charge you much</a>. Come on, what are you waiting for, <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/using-forward-slash-instead-of-a-hyphen-in-k2s-sh404-links/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The &#8220;Rebuild&#8221; Button In Joomla&#8217;s Menu Manager Page &#8211; A Double Edged Sword!</title>
		<link>http://www.itoctopus.com/the-rebuild-button-in-joomlas-menu-manager-page-a-double-edged-sword</link>
		<comments>http://www.itoctopus.com/the-rebuild-button-in-joomlas-menu-manager-page-a-double-edged-sword#comments</comments>
		<pubDate>Fri, 15 Mar 2013 15:00:03 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4065</guid>
		<description><![CDATA[You have probably seen the &#8220;Rebuild&#8221; button on the Menu Manager page on your Joomla website for some time, but most likely you haven&#8217;t pressed it &#8211; because you didn&#8217;t know what it is, and perhaps you thought: &#8220;Maybe it&#8217;s not such a good idea to press that button&#8221;. Well, we think you&#8217;re right!
So, what [...]]]></description>
			<content:encoded><![CDATA[<p>You have probably seen the &#8220;Rebuild&#8221; button on the <em>Menu Manager</em> page on your Joomla website for some time, but most likely you haven&#8217;t pressed it &#8211; because you didn&#8217;t know what it is, and perhaps you thought: &#8220;Maybe it&#8217;s not such a good idea to press that button&#8221;. Well, we think you&#8217;re right!</p>
<p><strong>So, what does the <em>Rebuild</em> button do?</strong></p>
<p>The rebuild button simply re-creates the paths of each menu item based on its alias, as well as the path of its parent item. Additionally, it fixes the <em>lft</em> and <em>rgt</em> fields on your website (the <em>lft</em> and <em>rgt</em> fields are beyond the scope of this post &#8211; let&#8217;s just say that if they are wrong then you will have issues with your Joomla website). For example, let&#8217;s say you have a root menu item called <em>Products</em> that has an alias field of <em>products</em>. Let&#8217;s also say that you have a child menu item (of the <em>Products</em> menu item) called <em>Product 1</em>. Assuming that the latter&#8217;s alias is <em>product-1</em>, then the <em>natural</em> path of that menu item is: <em>products/product-1</em>.</p>
<p>So far so good&#8230;</p>
<p><strong>But, what if your menu item is not using a <em>natural</em> path?</strong></p>
<p>Let&#8217;s say that you have a component that manually modifies menu items&#8217; paths. For example, instead of having the above path as <em>products/my-product</em>, the component saves it as <em>products/1-product</em>, or maybe it saves it as <em>my-products/product-1</em>. Pressing on the <em>Refresh</em> button will change the path back to <em>product/product-1</em>, which is most likely something that you do not want; what if you have many internal and external links pointing to <em>my-products/product-1</em>, and all of a sudden that link on your website no longer exists?</p>
<p><strong>So, what is the point of having a <em>Rebuild</em> button?</strong></p>
<p>The <em>Rebuild</em> button is Joomla&#8217;s attempt to fix menu item issues caused by 3<sup>rd</sup> party extensions (that update menu items). For example, we had a case yesterday where one of our clients was creating a perfectly normal menu item, but that menu item was not working on the website (it was returning a <em>404 &#8211; Article Not Found</em> or a <em>404 &#8211; Category Not Found</em> &#8211; the first error was returned when the alias didn&#8217;t have a <em>dash</em> inside it, the second one happened when the alias did have a dash). Clicking on the <em>Rebuild</em> button fixed the problem &#8211; unfortunately, it created an array of issues with many other menu items. So, while the <em>Rebuild</em> button may break many links on your website (which paths are modified by 3<sup>rd</sup> party extensions), it may also fix some issues you&#8217;re having with menu items.</p>
<p><strong>But shouldn&#8217;t Joomla fix itself automatically?</strong></p>
<p>In all fairness, it shouldn&#8217;t. Extensions that update menu items should be meticulously written &#8211; otherwise, they can break the website. Joomla&#8217;s <em>Rebuild</em> button is just attempting to fix their mess, but by fixing their mess, it might create more mess.</p>
<p>However, Joomla should take into consideration customized menu items &#8211; this can be solved by having a field (in the <em>#__menu</em> table) that will state whether a menu item has been customized or not, so that it&#8217;ll be ignored (by <em>it</em> we are referring to the menu item) when the <em>Rebuild</em> button is pressed. This is the best solution to handle this issue &#8211; but not the perfect solution, because Joomla may need to still update the <em>lft</em> and <em>rgt</em> fields of this row for data integrity reasons.</p>
<p>Now &#8211; let&#8217;s talk about you. If you&#8217;re having problems with menu items, or if you clicked the <em>Rebuild</em> button and all hell broke loose, then fear not &#8211; we are there for you. Just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll help you fix your website in record time and for a <a href="http://www.itoctopus.com/fees" title="Our fees!">very small cost</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/the-rebuild-button-in-joomlas-menu-manager-page-a-double-edged-sword/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Reasons Why You&#8217;re Not Able to Login to Your Joomla Website</title>
		<link>http://www.itoctopus.com/10-reasons-why-youre-not-able-to-login-to-your-joomla-website</link>
		<comments>http://www.itoctopus.com/10-reasons-why-youre-not-able-to-login-to-your-joomla-website#comments</comments>
		<pubDate>Wed, 13 Mar 2013 01:36:24 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3967</guid>
		<description><![CDATA[We have so far resolved literally hundreds of cases where people were not able to login to their Joomla websites.  Since our aim is to always make the life of a Joomla administrator as easy as possible, we have decided to list the top 10 reasons that result in the inability for one to [...]]]></description>
			<content:encoded><![CDATA[<p>We have so far resolved literally hundreds of cases where people were not able to login to their Joomla websites.  Since our aim is to always make the life of a Joomla administrator as easy as possible, we have decided to list the top 10 reasons that result in the inability for one to login to a Joomla website, as well as the solution to each one of them. Without further delay, here they are:</p>
<ol>
<li><strong>The user is trying to login with a wrong password</strong>
<p>Yes &#8211; we know it&#8217;s very obvious, but sometimes even the most obvious things are not that obvious, especially when one mistakes a <em>zero (0)</em> with an <em>o (the letter o)</em>, an <em>l (lowercase L)</em> with an <em>I</em>, thinks that the question mark at the end of the password is just a <em>typo</em> (this happened to us!), or confuses a <em>dash (-)</em> with an <em>underscore (_)</em>.</p>
<p>Of course, in many cases, the user is entering the password that he used to use all the time, except that that password has changed &#8211; probably by someone else or by a script.</p>
<p><em>Remedy</em>: There are multiple remedies to this solution. If one has FTP access, then he can just create a script containing and <em>UPDATE</em> query that will reset the user&#8217;s password. If one is blessed with a <em>phpMyAdmin</em> access, then all he needs to do is to login to <em>phpMyAdmin</em>, go the <em>#__users</em> table, and change the <em>password</em> field for the affected user with the password of his choice (note that he must choose <em>MD5</em> as a <em>Function</em> for the password to work).</p>
</li>
<li>
<p><strong>The account for that particular user is blocked</strong></p>
<p>Any user (even a super administrator) can be blocked from Joomla&#8217;s backend &#8211; additionally, a user can be blocked if he had too many failed login attempts. Once that user is blocked, he won&#8217;t be able to login (even if the password is correct).</p>
<p><em>Remedy</em>: Any user can be unblocked by logging in to <em>phpMyAdmin</em>, going to the <em>#__users</em> table, and then setting the <em>block</em> field for the affected user to 0 (instead of 1).</p>
</li>
<li>
<p><strong>There is a JavaScript error on the login page</strong></p>
<p>Joomla needs JavaScript to login users to the backend &#8211; as such, a JavaScript error on your login page can corrupt the login routine (so, when users click on the <em>Log in</em> button, nothing will happen).</p>
<p><em>Remedy</em>: Check your browser&#8217;s error console for any JavaScript errors if you&#8217;re pressing the <em>Log in</em> button and nothing is happening. If you&#8217;re not a programmer, then we suggest you let a programmer handle this for you: JavaScript errors are super hard to debug and fixing a JS error can break something else.</p>
</li>
<li>
<p><strong>The Joomla backend login module does not exist</strong></p>
<p>When this happens, not only the person won&#8217;t be able to login to Joomla &#8211; he just won&#8217;t be able to see the login form. We have discussed this issue in detail <a href="http://www.itoctopus.com/login-form-hidden-on-joomlas-administrator-login-page" title="Login form hidden on Joomla’s administrator login page">here</a>.</p>
<p><em>Remedy</em>: We suggest that you read the above post for the complete solution; in short, what you need to do is to restore the <em>mod_login</em> folder under <em>administrator/modules</em> directory.</p>
</li>
<li>
<p><strong>There is a <em>fatal</em> error on your website</strong></p>
<p>When this happens &#8211; you either see a completely blank page or a descriptive error, depending on your <a href="http://www.itoctopus.com/error-reporting-in-joomla" title="Error reporting in Joomla">error reporting</a> settings. Fatal errors are usually caused by an error in a 3<sup>rd</sup> party <em>system</em> plugin or by a recent modification to your Joomla&#8217;s core.</p>
<p><em>Remedy</em>: The cause of this fatal error varies from one case to another, and, as such, we can&#8217;t give a generic solution to this one. If you&#8217;re a programmer, you can enable error reporting (if it&#8217;s not already enabled) to see what the actual error is and to fix it. If you&#8217;re not a programmer, then your best bet would be to call some Joomla experts (like us!). Note: We <a href="http://www.itoctopus.com/blank-page-on-joomla-login" title="Blank page on Joomla login">have written about this exact scenario before</a>.</p>
</li>
<li>
<p><strong>The admin template does not exist or Joomla doesn&#8217;t have enough permissions to read it</strong></p>
<p>We have seen this case a few times and <a href="http://www.itoctopus.com/blank-page-on-joomlas-administrator-instead-of-the-login-form" title="Blank Page on Joomla’s Administrator instead of the login form">we have written about it</a>. When the administrator template doesn&#8217;t exist, then the login form will be completely blank (similarly to the previous point) and as such, the Joomla administrator won&#8217;t be able to login.</p>
<p><em>Remedy</em>: Reset the permissions (recursively) on the admin template to 444 to allow Joomla to read it, or, if the admin template was completely deleted, then re-upload it from scratch or fallback to the default one. (By the way, we&#8217;re surprised that Joomla doesn&#8217;t fall back automatically in the backend to another template when that template can&#8217;t be read because this is what it does on the frontend.)</p>
</li>
<li>
<p><strong>Joomla is unable to write to the <em>logs</em> directory</strong></p>
<p>In order for Joomla to complete a successful login, it must have write access to the <em>logs</em> directory located under the root directory of the website. If it doesn&#8217;t, then the login fails and no error is displayed &#8211; which is very, very confusing!</p>
<p><em>Remedy</em>: The problem can be solved by changing the permissions of the <em>logs</em> directory under the Joomla website&#8217;s root to 777. (This can be done in any FTP client).</p>
</li>
<li>
<p><strong>The <em>Joomla Authentication</em> plugin is disabled</strong></p>
<p>99.99% of Joomla websites use the <em>Joomla Authentication</em> plugin for logging in users through the backend. The remaining 0.01% use other authentication plugins, such as <em>ldap</em> and <em>gmail</em>. For the 99.99% of Joomla websites, if the <em>Joomla Authentication</em> plugin is disabled, then people will be redirected back to the login page (with no error) when they try to login.</p>
<p><em>Remedy</em>: This issue can be addressed by logging in to <em>phpMyAdmin</em>, going to the <em>#__extensions</em> table, and then setting the <em>enabled</em> field of the <em>plg_joomla_authentication</em> plugin to 1.</p>
<p><em>Note: When this problem happens, and if other authentications methods (such as ldap) are enabled, then the login process will take a while before redirecting back to the login page (this is because Joomla will be checking the ldap directory, which usually takes some time).</em></p>
</li>
<li>
<p><strong>The <em>Joomla User</em> plugin is disabled</strong></p>
<p>The <em>Joomla User</em> plugin is responsible for handling all user activity in Joomla. If that plugin is disabled, then even if the login is successful, then <a href="http://www.itoctopus.com/login-to-joomla-administrator-not-working-and-no-error-is-displayed" title="Login to Joomla administrator not working and no error is displayed">Joomla will redirect back to the login page without showing any errors</a> as it doesn&#8217;t know what to do with the logged in user (makes sense?). This problem is extremely nasty because it&#8217;s very hard to debug &#8211; even for seasoned Joomla developers.</p>
<p><em>Remedy</em>: This issue can be resolved by logging in to <em>phpMyAdmin</em>, going to the table <em>#__extensions</em>, and setting the <em>enabled</em> value of the <em>plg_user_joomla</em> row to 1.</p>
</li>
<li>
<p><strong>Joomla&#8217;s ACL is messed up</strong></p>
<p>We saved the best (or is it the worst?) for last! A messed up ACL can potentially completely block any login attempts to your Joomla website. Not only that, it can wreak havoc on the frontend of your website as well. There are many signs that you have a messed up ACL, one of them is being able to login, but seeing a completely empty top menu in your backend. So you can login, but you just can&#8217;t do anything!</p>
<p><em>Remedy</em>: Consult with a Joomla expert. Joomla&#8217;s ACL is pretty delicate so do not attempt to fix this problem by yourself or else you might risk breaking other areas on your website.</li>
</ol>
<p>We hope that you find the above guide comprehensive, and, more importantly, we hope that it helped you solve your problem. If it didn&#8217;t, then probably the next step would be to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We guarantee you that we&#8217;ll fix the problem as fast as we can and at a very <a href="http://www.itoctopus.com/fees" title="Our fees!">affordable cost</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/10-reasons-why-youre-not-able-to-login-to-your-joomla-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload Not Working in Joomla&#8217;s Media Manager &#8211; How to Fix</title>
		<link>http://www.itoctopus.com/upload-not-working-in-joomlas-media-manager-how-to-fix</link>
		<comments>http://www.itoctopus.com/upload-not-working-in-joomlas-media-manager-how-to-fix#comments</comments>
		<pubDate>Mon, 11 Mar 2013 06:18:01 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4017</guid>
		<description><![CDATA[One of our regular customers emailed us today and told us that the Media Manager on his Joomla website of his company is not working. He asked to take a look. We logged in to his website and we noticed that while the Media Manager page is loading properly, the upload functionality is not working. [...]]]></description>
			<content:encoded><![CDATA[<p>One of our regular customers emailed us today and told us that the Media Manager on his Joomla website of his company is not working. He asked to take a look. We logged in to his website and we noticed that while the Media Manager page is loading properly, the upload functionality is not working. In fact, when we tried to upload an image (in FireFox), the following happened:</p>
<ul>
<li>The below message popped up:
<p><em>Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party. Are you sure you want to continue sending this information?</em></p>
<p>and&#8230;
</li>
<li>
<p>&#8230;once we clicked on <em>Continue</em> &#8211; we were redirected to a blank page!</li>
</ul>
<p>The first thing that we tried to do was to enable debugging since a blank page in Joomla is nearly always a sign of an error. Unfortunately, the page remained blank even after debugging was turned on. Hmmm&#8230;</p>
<p>We then thought: maybe that JavaScript popup message is related to the problem. So, we checked the HTML code of the Media Manager page (where the files are uploaded), and we noticed that even though the website was set to only use <em>https://</em>, the Media Manager page was submitting to an <em>http://</em> page (which was <em>http://www.ourclientjoomlawebsite.com/administrator/index.php?option=com_config&amp;view=component&amp;component=com_media&amp;path=&amp;tmpl=component</em>. Aha! That was the problem!</p>
<p>You see, the <em>secure</em> version of any website is not the same as the <em>non-secure</em> version of the same website from many perspectives &#8211; so while the upload was being done from the <em>https</em> version of the website, it was submitting to the non-secure version. OK &#8211; we know that the previous statement is a bit complicated, so let us explain (in simple and concise steps) what happened:</p>
<ul>
<li>The file is uploaded to the <em>non-secure</em> version of the website.</p>
</li>
<li>
<p>The <em>non-secure</em> version of the form submission script (which was supposed to handle the upload) automatically redirects to the <em>secure</em> version of that script.</p>
</li>
<li>
<p>The <em>secure</em> version of the script can&#8217;t find the file that needs to be uploaded &#8211; and throws an empty page because it thinks that this is most likely an attack.</li>
</ul>
<p><em>But &#8211; why was the form submitting to the <em>non-secure</em> version of the script?</em></p>
<p>Because Joomla&#8217;s <em>configuration.php</em> told it to&#8230; Yes &#8211; it was all its fault, the configuration.php had the the <em>$live_site</em> variable set to <em>http://www.ourclientjoomlawebsite.com</em> instead of <em>https://www.ourclientjoomlawebsite.com</em> &#8211; changing that variable to <em>https://www.ourclientjoomlawebsite.com</em> fixed the problem!</p>
<p><em>But isn&#8217;t that a Joomla bug?</em></p>
<p>As much as we don&#8217;t like to say it &#8211; yes, it&#8217;s a bug in Joomla&#8217;s core. Here&#8217;s why: what if the Joomla administrator wants to set the <em>$live_site</em> to the <em>non-secure</em> version of his website <em>and</em> wants to only have the backend of his website running in secure mode. Currently, this won&#8217;t work, because the form submission script of the Media Manager is set to use the <em>$live_site</em> variable if it exists. So either the whole website runs in <em>https</em> mode (not just the backend), or the <em>$live_site</em> variable is set to empty.</p>
<p><em>Is there a workaround?</em></p>
<p>The only workaround that can fix this erroneous behavior is by modifying a core file in Joomla &#8211; which is never recommended because it might affect (or be affected by) future Joomla updates.</p>
<p>Now, if you&#8217;re having problems uploading files to your Media Manager, and if the above didn&#8217;t help you, then maybe it&#8217;s a permission issue &#8211; remember, Joomla must have recursive write permissions to the <em>tmp</em> and the <em>images</em> directory for the <em>Media Manager</em> to work. If it&#8217;s not, then maybe it&#8217;s because you need to <a href="http://www.itoctopus.com/how-to-increase-the-maximum-allowed-size-of-uploaded-files-in-joomlas-media-manager" title="How to increase the maximum allowed size of uploaded files in Joomla's Media Manager">increase the maximum upload size in your Media Manager</a>. If it&#8217;s neither, then your best option would probably be to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We&#8217;re fast, we&#8217;re efficient, <a href="http://www.itoctopus.com/fees" title="Our fees!">we don&#8217;t charge much</a>, and we know our Joomla!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/upload-not-working-in-joomlas-media-manager-how-to-fix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Change the &#8220;Email this link to a friend&#8221; Template in Joomla</title>
		<link>http://www.itoctopus.com/how-to-change-the-email-this-link-to-a-friend-template-in-joomla</link>
		<comments>http://www.itoctopus.com/how-to-change-the-email-this-link-to-a-friend-template-in-joomla#comments</comments>
		<pubDate>Sat, 09 Mar 2013 04:54:52 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=4006</guid>
		<description><![CDATA[We are currently finalizing the migration of a very large Joomla website at the moment (from 1.5 to 2.5). During the latest QA session, we discovered that the &#8220;Email this link to a friend&#8221; popup page (the page that pops up when you click on the email icon on any article) does not look properly [...]]]></description>
			<content:encoded><![CDATA[<p>We are currently finalizing the migration of a very large Joomla website at the moment (from 1.5 to 2.5). During the latest QA session, we discovered that the &#8220;Email this link to a friend&#8221; popup page (the page that pops up when you click on the email icon on any article) does not look properly formatted. In this post, we will be explaining how to modify the template for this popup window!</p>
<p>As most Joomla developers know, every single layout of any component in Joomla is <em>overridable</em> &#8211; which means that creating a file, giving it a certain name and placing it in the right place will replace the layout of any page in Joomla. So, which file controls the layout of the &#8220;Email this link to a friend&#8221; popup page?</p>
<p>Well, that file is called <em>default.php</em> and is located under the <em>/components/com_mailto/views/mailto/tmpl</em> directory. So, in order to override the layout of that file, all you need to do is to copy that <em>default.php</em> file to the <em>/templates/[your_template_name]/html/com_mailto/mailto</em> directory (in most cases, that directory may not exist, so you will need to create it). Once you do that, you will be able to modify the look &#038; feel of the &#8220;Email this link to a friend&#8221; popup by just editing that file (the <em>default.php</em> file).</p>
<p><em>But what about style changes?</em></p>
<p>CSS styles for the &#8220;Email this link to a friend&#8221; popup are controlled by the <em>print.css</em> file which is located under the <em>/templates/[you_template_name]/css</em> directory.</p>
<p><em>And how about the confirmation message?</em></p>
<p>Unfortunately, the confirmation message (the message that appears after you press the <em>Send</em> button) is not controlled by the same view that controls the layout of the form. It is controlled by another view, which is the <em>sent</em> view. So, if you would like to modify the confirmation message page, then all you need to do is to copy the <em>default.php</em> file from <em>/components/com_mailto/views/sent/tmpl</em> to the <em>/templates/[your_template_name]/html/com_mailto/sent</em> folder (again, you will need to create that directory if it doesn&#8217;t exist) and make your changes to the copied file.</p>
<p><em>Is that it?</em></p>
<p>Yes &#8211; that&#8217;s it! And the best thing is, you don&#8217;t need to touch any Joomla core file, which means that you can safely apply all Joomla updates without any fear that they may break your website!</p>
<p><em>Are there any caveats</em></p>
<p>There is one: Since you&#8217;re not changing the core (which is the right way to go) and you&#8217;re applying the layout changes for that popup only to a particular template, you will lose all the changes when you switch to a different template. However, copying the above directories to the new template will usually solve the problem (if the modified code is well written).</p>
<p>Now, if you need help changing the &#8220;E-mail this link to a friend&#8221; template, then all you need to do is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll do it for you in no time! <a href="http://www.itoctopus.com/fees" title="Our fees!">Our prices</a> are very affordable, our work is professional, we are nice people to work with, and we really love Joomla!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-change-the-email-this-link-to-a-friend-template-in-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Migrate Modules&#8217; Data from Joomla 1.5 to Joomla 2.5</title>
		<link>http://www.itoctopus.com/how-to-migrate-modules-data-from-joomla-1-5-to-joomla-2-5</link>
		<comments>http://www.itoctopus.com/how-to-migrate-modules-data-from-joomla-1-5-to-joomla-2-5#comments</comments>
		<pubDate>Sun, 03 Mar 2013 02:17:12 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3969</guid>
		<description><![CDATA[- Note 1: This post is about migrating modules&#8217; data (such as settings, content, etc&#8230;) &#8211; it&#8217;s not about migrating the actual code. This post comes to help when you have lots of modules on your Joomla 1.5 website, and you don&#8217;t have time to manually migrate all the data for all these modules.
- Note [...]]]></description>
			<content:encoded><![CDATA[<p><em>- Note 1: This post is about migrating modules&#8217; data (such as settings, content, etc&#8230;) &#8211; it&#8217;s not about migrating the actual code. This post comes to help when you have lots of modules on your Joomla 1.5 website, and you don&#8217;t have time to manually migrate all the data for all these modules.</p>
<p>- Note 2: This post is very technical and a bit advanced, if you&#8217;re not a programmer and if you don&#8217;t have experience in database queries, then we suggest that you email this post to your programmer to do the below for you &#8211; or even better &#8211; contact us to do it for you ourselves!</p>
<p>- Note 3: This post assumes that you have access to phpMyAdmin and you know how to use it. If you don&#8217;t, then again, either forward it to your developer/system administrator or let us do it for you.</p>
<p>- Note 4: This post is somehow similar to our previous post on <a href="http://www.itoctopus.com/how-to-migrate-users-from-joomla-1-5-to-joomla-2-5" title="How to migrate users from Joomla 1.5 to Joomla 2.5">migrating users from Joomla 1.5 to Joomla 2.5</a> &#8211; except that the latter is about migrating users.</em></p>
<p>The funnest part, in our opinion, in a Joomla migration project, is migrating modules (the second funnest is migrating the template). It&#8217;s only when you migrate the modules that you see the website becoming (errr) a website, again! However, the task of migrating modules is usually not an easy task and it consists of two parts:</p>
<ol>
<li>Migrating the actual code for each and every module.</p>
</li>
<li>
<p>Migrating the data for each and every module.</li>
</ol>
<p>Migrating the module&#8217;s code is too specific and there is no silver bullet for such a migration. On the other hand, migrating the modules&#8217; data, including the settings, the ordering, and the placement, is an easy task if you have access to <em>phpMyAdmin</em>. Let us explain, in a few easy steps, how to do this:</p>
<ul>
<li><u>Login to <em>phpMyAdmin</em></u></p>
<p>Logging in to <em>phpMyAdmin</em> can be typically done from your hosting account and the process varies depending on your environment. If you have troubles accessing <em>phpMyAdmin</em>, then you should contact your hosting provider.</p>
</li>
<li>
<p><u>Select the database of your old Joomla website</u></p>
<p>The name of the database of your old Joomla website can be found in your <em>configuration.php</em> file. (It is the value of the <em>$db</em> variable).</p>
</li>
<li>
<p><u>Run the below query</u></p>
<p>Click on <em>SQL</em> (in <em>phpMyAdmin</em>) and run the following query:</p>
<p><code>SELECT `id`, `title`, `content`, `position`, `ordering`, `module`, `published`, CASE WHEN access <= 1 THEN 1 ELSE access END AS `access`, `showtitle`, `params`, `client_id`, '*' as `language` FROM `jos_modules` WHERE `published` = 1</code></p>
<p>Some observations on the above query:</p>
<ul>
<li>Notice the condition on the <em>access</em> field - this is because an <em>access</em> field that has a value of 0 in Joomla 1.5 must have a value of 1 in Joomla 2.5.</p>
</li>
<li>
<p>We are adding the <em>language</em> field (that doesn't exists in Joomla 1.5) and we are giving it a value of <em>*</em>, which means that the module is available in all languages (if this is not the behavior that you want then you need to modify the query to accommodate your needs).</p>
</li>
<li>
<p>We are filtering out non-published modules. If you don't want that then run the following query instead:</p>
<p><code>SELECT `id`, `title`, `content`, `position`, `ordering`, `module`, `published`, CASE WHEN access <= 1 THEN 1 ELSE access END AS `access`, `showtitle`, `params`, `client_id`, '*' as `language` FROM `jos_modules`</code></li>
</ul>
</li>
<li>
<p><u>Export the results of the query</u></p>
<p>This can be done by scrolling down the query results page (after running the query above), and clicking on the <em>Export</em> link under <em>Query results operations</em>. Once you click on the button, you will be redirected to another page, on which you should do the following:</p>
<ul>
<li>Choose <em>Custom</em> as <em>Export Method</em>.</p>
</li>
<li>
<p>Click <em>View output as text</em> under <em>Output</em></em>.</p>
</li>
<li>
<p>Click on <em>Go</em> at the very bottom of the page and finally copy the exported data (by pressing Ctrl+a and then Ctrl+c on the window containing the exported data).</li>
</ul>
</li>
<li>
<p><u>Prepare the data to be imported</u></p>
<p>Now that you have exported the data, you will need to prepare it for importing. All you need to do is to apply the following to the exported data:</p>
<ul>
<li>Replace all references to <em>jos_</em> with the table prefix of your Joomla 2.5 website (the table prefix can be found in the <em>configuration.php</em> file of your new Joomla website).</p>
</li>
<li>
<p>Replace the first line from:</p>
<p><code>INSERT INTO `<em>[table_prefix]</em>modules` (`id`, `title`, `content`, `position`, `ordering`, `module`, `published`, `access`, `showtitle`, `params`, `client_id`, <span style="font-weight: bold; color: red">'*'</span>) VALUES</code></p>
<p>to:</p>
<p><code>INSERT INTO `<em>[table_prefix]</em>modules` (`id`, `title`, `content`, `position`, `ordering`, `module`, `published`, `access`, `showtitle`, `params`, `client_id`, <span style="font-weight: bold; color: red">`language`</span>) VALUES</code></p>
<p>Note that there might be several references to the above query in the exported data - the number of these references is proportional to the size of your modules table.</li>
</ul>
</li>
<li>
<p><u>Import the modules' data into your new website</u></p>
<p>Now you need to import the modules' data to your new Joomla website. All you need to do is the following:</p>
<ul>
<li>Select the database of your new Joomla website.</p>
</li>
<li>
<p>Click on <em>SQL</em> (located on the top of the page) and paste the <em>modified</em> exported data, and then click on <em>Go</em> at the bottom.</p>
</li>
<li>
<p>That's it! Assuming everything went well, you have successfully migrated your modules' data from Joomla 1.5 to Joomla 2.5! Congratulations!</li>
</ul>
</li>
</ul>
<p>Now it is important to mention that the above process will not migrate the associations of the modules to the menu items. This is a much more complex process and it's outside the scope of this post. If you need help doing this, then please <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. <a href="http://www.itoctopus.com/fees" title="Our fees!">Our fees</a> are very competitive, our work is very fast, and our results are always satisfactory to our clients!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-migrate-modules-data-from-joomla-1-5-to-joomla-2-5/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Fix &#8220;This Page Isn&#8217;t Redirecting Properly&#8221; on Joomla</title>
		<link>http://www.itoctopus.com/how-to-fix-this-page-isnt-redirecting-properly-on-joomla</link>
		<comments>http://www.itoctopus.com/how-to-fix-this-page-isnt-redirecting-properly-on-joomla#comments</comments>
		<pubDate>Thu, 28 Feb 2013 21:13:02 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3952</guid>
		<description><![CDATA[We had a small task today where one of our clients told us that one of the pages on his Joomla website was taking a long time to load, and then eventually it was displaying a blank screen. We first thought that his website was hacked, but then, when we enabled error reporting, we saw [...]]]></description>
			<content:encoded><![CDATA[<p>We had a small task today where one of our clients told us that one of the pages on his Joomla website was taking a long time to load, and then eventually it was displaying a blank screen. We first thought that <a href="http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-hacked" title="Your Joomla website is really really slow? Maybe it's hacked!">his website was hacked</a>, but then, when we enabled error reporting, we saw the following error on Firefox: &#8220;This Page Isn&#8217;t Redirecting Properly&#8221;. Hmmm&#8230;</p>
<p>When we saw the above error, we didn&#8217;t rule out a hack, but we thought that it might be something else&#8230; So, we investigated the issue, and it turned out that he had sh404 installed (<a href="http://www.itoctopus.com/sh404-the-worst-joomla-extension" title="sh404 – The worst Joomla extension">the worst Joomla extension</a>), and he explicitly added an alias in the URL manager, for that page, to redirect to that same page (e.g. the page was redirecting to itself, causing an infinite loop). We removed that alias and the page loaded properly.</p>
<p>If you&#8217;re having the same issue yourself, then here are step-by-step instructions on how to fix it:</p>
<ul>
<li>Login to the backend of your Joomla website.</p>
</li>
<li>
<p>Click on <em>Components -&gt; sh404SEF</em> on the top menu.</p>
</li>
<li>
<p>Click on URL Manager.</p>
</li>
<li>
<p>Search for the page that you&#8217;re having problems with.</p>
</li>
<li>
<p>Click on the name of that page. Let&#8217;s assume that this page is called <em>our-business.html</em>.</p>
</li>
<li>
<p>On the popup window, click on <em>Aliases</em>.</p>
</li>
<li>
<p>Remove the entry <em>our-business.html</em> from the list of aliases.</p>
</li>
<li>
<p>Click on <em>Save</em>.</p>
</li>
<li>
<p>That&#8217;s it!</li>
</ul>
<p>Doing the above steps should fix your problem &#8211; if it didn&#8217;t, then we urge you to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll solve the problem for you in no time. Oh, and don&#8217;t worry about <a href="http://www.itoctopus.com/fees" title="Our fees!">our fees</a>, they are very affordable!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-fix-this-page-isnt-redirecting-properly-on-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sh404 &#8211; The Worst Joomla Extension</title>
		<link>http://www.itoctopus.com/sh404-the-worst-joomla-extension</link>
		<comments>http://www.itoctopus.com/sh404-the-worst-joomla-extension#comments</comments>
		<pubDate>Thu, 28 Feb 2013 06:07:04 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3860</guid>
		<description><![CDATA[We don&#8217;t like to attack Joomla extensions, especially prominent ones. In fact, we can&#8217;t remember if we ever did attack an extension on our blog (if you know that we did that before, then please let us know in which post). But this morning something happened, something that made us choose sh404 &#8211; the famous [...]]]></description>
			<content:encoded><![CDATA[<p>We don&#8217;t like to attack Joomla extensions, especially prominent ones. In fact, we can&#8217;t remember if we ever did attack an extension on our blog (if you know that we did that before, then please let us know in which post). But this morning something happened, something that made us choose sh404 &#8211; the famous extension for redirecting pages on Joomla websites &#8211; as the holder of the <em>worst Joomla extension of all time</em> title!</p>
<p>Let us now <em>narrate</em> what happened today&#8230; It was about 10 AM EST, one of our regular clients, let&#8217;s call him Steve, called us and told us that he was getting a 404 error on one of the pages on his website. Here&#8217;s Steve&#8217;s briefing about the issue:</p>
<ul>
<li>The page exists.</li>
<li>He already created a menu item pointing to that page.</li>
<li>Both the page and the menu item are published.</li>
<li>He was trying to reach the page on his Joomla website based on its alias.</li>
</ul>
<p>What Steve forgot to mention about his website is that he has sh404 installed. We knew this because we have worked on his website many times before. So, we logged in to the backend of his Joomla website, we then loaded the <em>URL Manager</em> page in sh404, and we <em>purged</em> all the URLs on the website, and left only the hard coded ones (sh404 doesn&#8217;t delete the manually inserted URLs &#8211; which is, to be fair, the right and expected behavior). We scanned the hard coded URLs for an entry that was relevant to the page in question but we found none.</p>
<p>We then went to the website and we tried to reach that page, but we still got a 404 error &#8211; even trying to load the page based on its non-SEF URL returned a 404 error. We double checked if everything was OK (the article exists, the article is published, the menu item exists and is published, the menu item&#8217;s alias is correct, etc&#8230;) &#8211; and it was. We then spent a lot of time beating around the wrong bushes! We knew that the problem was with sh404 (disabling sh404 solved the problem), but we just didn&#8217;t know why this was happening! A while later, someone from our team said, why don&#8217;t we just check <em>phpMyAdmin</em>, maybe sh404 has the link there somewhere &#8211; and so we did. We logged in to <em>phpMyAdmin</em> and we saw that the table <em>#__sh404sef_aliases</em> had an entry where the <em>newurl</em> was the non-SEF link of the article, and the <em>alias</em> was set to empty. Deleting that row solved the problem, but for some reason, we didn&#8217;t feel that we <em>really</em> solved the problem&#8230; We started wondering what created that wrong entry and what is the guarantee that this exact same issue will not happen again? In our opinion, we just cleaned the mess caused by sh404, but unfortunately, we didn&#8217;t solve the problem, as the problem lies somewhere in the core of sh404, and probably fixing it will have side effects elsewhere!</p>
<p>Now you might be thinking, OK, but does that really make sh404 the <em>worst</em> Joomla extension ever? Isn&#8217;t that a bit harsh?</p>
<p>If it was the first time that we see a problem that is caused by the instability of sh404, then we&#8217;d agree with you, but there isn&#8217;t a week that goes by where at least one client comes to us with an sh404 problem, and let us tell you something, <em>all</em> sh404 issues are extremely weird and very hard to solve!</p>
<p>But isn&#8217;t sh404 a very complex extension, which means that it&#8217;s allowed to have a few bugs here and there? Maybe, but let&#8217;s examine, in one sentence, the basic and main job that sh404 has to do:</p>
<p><em>sh404 is an extension that redirects on-site non-SEF URL&#8217;s to well formatted SEF URLs.</em></p>
<p>That&#8217;s its basic job, and we know, as programmers, that once you have the rewriting rules right then it&#8217;s a very simple process &#8211; yet after years and years of development, sh404 is still (in our opinion) an unstable extension that should not be installed on production websites &#8211; unfortunately though, there is no alternative to this mess, and so many Joomla website owners/administrators are stuck with it.</p>
<p>On a closing note to this rant, think about the following:</p>
<ul>
<li>How come your Joomla SEF links always work when you only have Joomla&#8217;s native System SEF plugin running, while you have to routinely<em>purge</em> links on sh404 to fix redirection issues?
</li>
<li>
<p>How would have solved the above issue (if it happened to you) if you didn&#8217;t have access to <em>phpMyAdmin</em>?</p>
</li>
<li>
<p>How come sh404 has not reached stability yet, even though it&#8217;s a commercial extension with a huge community and even though it has been there for years?</p>
</li>
<li>
<p>Why can&#8217;t the developers of sh404 focus more on the development of the main functionality of the extension rather than working on the development of bells and whistles (such as analytics and shURLs). Don&#8217;t they think that people will appreciate a solid extension with less (mostly unneeded) functionality more than a very large extension with (mostly) broken functionality.</li>
</ul>
<p>Now don&#8217;t take us wrong, we think that the people who are working on the development of sh404 are very intelligent people and that sh404 was, at one point, an excellent plugin and that&#8217;s why it has so many adopters, but it has since grown into a monster that nobody is able to tame, which is why we consider it now the worst Joomla extension ever.</p>
<p>By the way, if you&#8217;re having sh404 problems like our client Steve, then feel free to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>, and we&#8217;ll sure fix them! <a href="http://www.itoctopus.com/fees" title="Our fees!">Our rates</a> are extremely competitive, our work is professional and fast, we are very friendly, and we always welcome new customers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/sh404-the-worst-joomla-extension/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SPF Records and Sending Emails from Your Joomla Website</title>
		<link>http://www.itoctopus.com/spf-records-and-sending-emails-from-your-joomla-website</link>
		<comments>http://www.itoctopus.com/spf-records-and-sending-emails-from-your-joomla-website#comments</comments>
		<pubDate>Tue, 26 Feb 2013 07:56:18 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3837</guid>
		<description><![CDATA[Quite often, we receive requests from our customers asking us to &#8220;fix&#8221; their SPF records on their Joomla websites. So, what is an SPF record, and why does a Joomla website need it?
An SPF (SPF stands for Sender Policy Framework) record is a DNS entry that will tell other mail servers which IP (or range [...]]]></description>
			<content:encoded><![CDATA[<p>Quite often, we receive requests from our customers asking us to &#8220;fix&#8221; their SPF records on their Joomla websites. So, what is an SPF record, and why does a Joomla website need it?</p>
<p>An SPF (SPF stands for Sender Policy Framework) record is a DNS entry that will tell <em>other</em> mail servers which IP (or range of IPs) is (are) allowed to send an email pertaining to your domain. Yes, we know, this statement might sound a bit too technical, so let us give you an example&#8230;</p>
<p>The SPF record of itoctopus.com is currently the following:</p>
<p><code>v=spf1 +a +mx +ip4:173.199.145.148 +ip4:173.199.145.150 -all</code></p>
<p>The SPF record above tells <em>the world</em> that only the following IPs are allowed to send an email originating from itoctopus.com:</p>
<ul>
<li>173.199.145.148</li>
<li>173.199.145.150</li>
</ul>
<p><em>Now, you might be wondering, why is that necessary?</em></p>
<p>Well, the main reason behind SPF is to prevent spoofing. Email spoofing is when a spammer sends an email that looks like it&#8217;s sent from a certain domain (because of the headers and the <em>from address</em>), while, in reality, it&#8217;s not.</p>
<p><em>But why should someone care about email spoofing?</em></p>
<p>Imagine that a spammer sends every day thousands of emails that appear to be incoming from your domain. Sooner or later, your domain will be blacklisted and all the emails that are sent from your domain, even the legitimate ones, will end up either blocked or in the <em>Junk E-mail</em> folder that no one usually reads. In other words, the majority of your customers will no longer be able to receive any of your emails, whether these emails are sent from your Joomla website (for example, purchase confirmation emails, newsletters, reminders, etc&#8230;) or by you directly! Ouch!</p>
<p><em>So, how does SPF really work and how does it help prevent spoofing?</em></p>
<p>As explained earlier in this post, an SPF record explicitly specifies which IPs are allowed to send emails on your domain&#8217;s behalf. So, mail servers receiving emails from your domain will check whether the IP of the sending server exists in your SPF record. If it does, then it&#8217;ll redirect the email to the proper recipient, if it doesn&#8217;t, then it&#8217;ll reject the email (some servers will tell you that your email was rejected, others will just ignore it). In a best case scenario, the email will be tagged by the mail server with <em>[SPF]</em> and mail clients will automatically place it in the <em>Junk</em> folder.</p>
<p>As you can see, the existence of an SPF record ensures that mail servers will only accept legitimate messages from your domain, which means that illegitimate messages will no longer affect the reputation of your domain!</p>
<p><em>Will it hurt if the domain doesn&#8217;t have an SPF record?</em></p>
<p>Not having an SPF record won&#8217;t hurt until a spammer starts sending emails that appear to be originating from your domain. This is when an SPF becomes an absolute necessity to ensure that your emails reach your audience &#8211; or else, you will be forced to use free alternatives (such as gmail and the likes) to reach up to your clientele, which is not professional.</p>
<p><em>But what if the Joomla website doesn&#8217;t send any emails, is an SPF record still a necessity?</em></p>
<p>If the Joomla website doesn&#8217;t send emails, and if you don&#8217;t have any email accounts for that Joomla website, then it&#8217;s not really a necessity, but we recommend that you do it. Creating an SPF record is not that hard as you&#8217;ll see below.</p>
<p><em>How to check if a domain has an SPF record?</em></p>
<p>There are many online tools (some are commercial and some are free) that will list the SPF record of any domain (assuming, of course, that domain <em>has</em> an SPF record). Just Google <em>spf record check</em> and see what you&#8217;ll get. Alternatively, you can call your hosting provider and ask them whether your domain has an SPF record or not.</p>
<p><em>Can the SPF record added through Joomla&#8217;s backend?</em></p>
<p>No &#8211; it can&#8217;t. The SPF record is a DNS entry that cannot be added through your Joomla website&#8217;s backend.</p>
<p><em>So, how and where can the SPF record be added?</em></p>
<p>The answer depends on your hosting environment since the process substantially differs from one environment to the other. For example, if you&#8217;re using cPanel, then you can add an SPF record the following way:</p>
<ul>
<li>Login to your cPanel account for your Joomla website.
</li>
<li>
<p>Click on <em>Email Authentication</em>.</p>
</li>
<li>
<p>Ensure that the SPF status is <em>Status: Enabled &#038; Active (DNS Check Passed) </em>. If it&#8217;s not, then click on the <em>Enable</em> button just under <em>SPF</em>.</p>
</li>
<li>
<p>In the <em>Additional Ip blocks for your domains (IP4)</em> field, add the IPs that are allowed to send emails for your domain.</p>
</li>
<li>
<p>Click on <em>Update</em>.</p>
</li>
<li>
<p>That&#8217;s it!</li>
</ul>
<p>If you&#8217;re using Plesk or another environment, then it&#8217;s better to have a system administrator do it for you (we can also do it for you!), since it can get a bit complicated and it can take some time.</p>
<p>Note that adding an SPF record is technically a DNS change, and, as such, it might take up to 48 hours to take effect because that change needs to <em>propagate</em> across servers worldwide. If you want it to take effect in a shorter period, then try lowering the TTL to something like 300 &#8211; which is the minimum (ask your hosting provider to do this for you if you don&#8217;t know how to do it).</p>
<p><em>Should the SPF record change when the domain&#8217;s IP change?</em></p>
<p>If the mail server&#8217;s IP changes as well (which is most likely the case), then yes, definitely, the SPF record should be updated to reflect the new IP (or ranges of IPs) that is (are) allowed to send emails from your domain.</p>
<p>We hope that this post on SPF records was helpful. We tried to put everything in layman&#8217;s terms because we know that the majority of Joomla website owners/administrators are not technical. Now, if you read the above and you feel you need help setting up (or fixing) an SPF record on your Joomla website, then do not hesitate to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> immediately! We are friendly, we are very experienced in Joomla, <a href="http://www.itoctopus.com/fees" title="Our fees!">we don&#8217;t charge much</a>, our work is very clean, and we are super fast!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/spf-records-and-sending-emails-from-your-joomla-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your Joomla Website Is Really Really Slow? Maybe It&#8217;s Hacked!</title>
		<link>http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-hacked</link>
		<comments>http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-hacked#comments</comments>
		<pubDate>Sun, 24 Feb 2013 04:54:38 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3875</guid>
		<description><![CDATA[A new customer called us a few hours ago, and told us that his website was really slow. He told us that his website was hacked, and that his hosting company &#8220;fixed&#8221; the problem, but after they &#8220;fixed&#8221; the problem, his website became super slow. We thought that it might be a simple thing as [...]]]></description>
			<content:encoded><![CDATA[<p>A new customer called us a few hours ago, and told us that his website was really slow. He told us that his website was hacked, and that his hosting company &#8220;fixed&#8221; the problem, but after they &#8220;fixed&#8221; the problem, his website became super slow. We thought that it might be a simple thing as enabling the <em>System Cache</em> plugin, but when we visited the website, we knew that there was something wrong&#8230;</p>
<p>It took, on average, 35 seconds to load a page on his website. Enabling caching fixed the problem, but 35 seconds without the cache? There must be something terribly wrong with the website, especially when taking into account that the whole website consists of a handful of pages (and each page has just 3 modules).</p>
<p>Our usual suspect, in this case, is a heavy query somewhere that is slowing down the whole website, so we printed all the queries that were running on the homepage, and then we started running each and every query on <em>phpMyAdmin</em>. To our surprise, all queries executed in milliseconds! Which means that what&#8217;s causing the problem is something else&#8230;</p>
<p>We thought that it might be a DNS issue, so we added the following code to the beginning of the <em>index.php</em> (which is located under the root directory of the website):</p>
<pre><code>if ($_SERVER['REMOTE_ADDR'] == '[OUR IP]'){
	die('Hello itoctopus!');
}</code></pre>
<p>We uploaded the <em>index.php</em> file, and we loaded the page, and it loaded instantly, which proves that there is no DNS issue whatsoever&#8230;</p>
<p>We started thinking, could it be something wrong in the <em>.htaccess</em> file causing the issue? So we just renamed the <em>.htaccess</em> file to <em>htaccess.old</em>, and tried to load the page (after reverting the change that we did in the previous step, of course), but the page still took more than 30 seconds to load.</p>
<p>What could it be?</p>
<p>As a last resort, we checked the HTML source code of the page, maybe there&#8217;s an <em>iframe</em> somewhere that is delaying the whole loading of the page? We didn&#8217;t see an <em>iframe</em>, but what we did see was many hidden links to malicious websites! Aha, the website was <em>still</em> hacked! With that knowledge, we used our <a href="http://www.itoctopus.com/how-to-quickly-fix-a-hacked-joomla-website" title="How to quickly fix a hacked Joomla website">easy method to quickly discover which Joomla file(s) was(were) hacked</a>, and we had an immediate winner! It was the <em>application.php</em> file located under the <em>includes</em> directory. The <em>application.php</em> file had a block of code (that was injected) that was using <em>curl</em> to retrieve content from a (very slow) malicious website located far, far away!</p>
<p>We removed the <em>curl</em> code and the website became, as we expected, super fast! Problem solved!</p>
<p><em>But what should one learn from this experience?</em></p>
<p>Well, there are two lessons learned here:</p>
<ol>
<li>Never, ever dismiss the idea that the website is still hacked when your hosting company tells you that it&#8217;s fixed &#8211; <em>especially</em> when your hosting company tells you that it&#8217;s fixed. First of all, it&#8217;s not the responsibility of the hosting company to fix your website, second of all, support personnel in hosting companies consists of, at best, system administrators, who may or may not have the required skills to fix your website, and who may or may not care about  your website as much as you do.</p>
</li>
<li>
<p>Extreme slowness in loading time might be a sign that the website is hacked. This is almost 100% true when the website in question is a very simple website that consists of a few pages/modules.</li>
</ol>
<p>Now, if your website is extremely slow, we suggest you check if it&#8217;s hacked or not, and if you feel that you need some experts&#8217; help, then just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>! We&#8217;re <a href="http://www.itoctopus.com/why-we-are-the-joomla-security-experts" title="Why we are the Joomla security experts">experts in Joomla security</a>, we&#8217;re very professional, <a href="http://www.itoctopus.com/fees" title="Our fees!">our rates</a> are very affordable, and we <em>know</em> that we can fix your website!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/your-joomla-website-is-really-really-slow-maybe-its-hacked/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>K2 Items Not Appearing in K2 Modules After Migrating to Joomla 2.5</title>
		<link>http://www.itoctopus.com/k2-items-not-appearing-in-k2-modules-after-migrating-to-joomla-2-5</link>
		<comments>http://www.itoctopus.com/k2-items-not-appearing-in-k2-modules-after-migrating-to-joomla-2-5#comments</comments>
		<pubDate>Fri, 22 Feb 2013 01:15:54 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3857</guid>
		<description><![CDATA[Note: This post assumes that you have migrated the K2 extension to the latest version on Joomla 1.5 prior to migrating to Joomla 2.5.
We are currently working on a large, a very large migration project from Joomla 1.5 to Joomla 2.5. A mini-project in this migration project is migrating K2 content to the new Joomla [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: This post assumes that you have migrated the K2 extension to the latest version on Joomla 1.5 prior to migrating to Joomla 2.5.</em></p>
<p>We are currently working on a large, a very large migration project from Joomla 1.5 to Joomla 2.5. A mini-project in this migration project is migrating K2 content to the new Joomla website. K2 migration is usually very easy and straightforward. Here&#8217;s what we did to migrate K2:</p>
<ul>
<li>We migrated the old version of K2 to the latest version of K2 on the old (Joomla 1.5) website.</p>
</li>
<li>
<p>We installed K2 on the new (Joomla 2.5) website.</p>
</li>
<li>
<p>We copied all the K2 tables (using <em>phpMyAdmin</em>) from the old website to the new website.</li>
</ul>
<p>The above process was supposed to work seamlessly, since both websites have the latest version of K2 (which means that the K2 database structure is exactly the same), but for some reason, K2 items in the <em>K2 content</em> module (as well as other K2 modules) did not show up.</p>
<p>So, we opened the <em>K2 content</em> module and printed the query that was used to retrieve the rows from the database, and here&#8217;s what we got:</p>
<p><code>SELECT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams FROM #__k2_items as i LEFT JOIN #__k2_categories c ON c.id = i.catid WHERE i.published = 1 AND i.access IN(1,1) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2013-02-21 17:38:03' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2013-02-21 17:38:03' ) AND i.catid IN (1,2,3,4,5) ORDER BY i.created DESC</code></p>
<p>We ran the exact query on <em>phpMyAdmin</em> to see if there&#8217;s anything wrong, and while there was nothing wrong with it, it didn&#8217;t return any rows. So, we looked deeper into the issue and we started dissecting the above query by removing conditions, until we discovered the two conditions that were causing the problem. Both are highlighted in red below:</p>
<p><code>SELECT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams FROM #__k2_items as i LEFT JOIN #__k2_categories c ON c.id = i.catid WHERE i.published = 1 <font style="color: red; font-weight: bold">AND i.access IN(1,1)</font> AND i.trash = 0 AND c.published = 1 <font style="color: red; font-weight: bold">AND c.access IN(1,1)</font> AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2013-02-21 17:38:03' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2013-02-21 17:38:03' ) AND i.catid IN (1,2,3,4,5) ORDER BY i.created DESC</code></p>
<p>Aha! It was the access field which seems to be irrelevant in K2&#8217;s implementation in Joomla 1.5, but critical in that of Joomla 2.5. We looked at both the <em>#__k2_categories</em> and the <em>#__k2_items</em> tables, and sure enough, the <em>access</em> column was set to 0 across the board in both these tables.</p>
<p><strong>So, what did we do to fix the problem?</strong></p>
<p>Solving the problem was quite easy, all we needed to do was to issue the two following SQL queries in <em>phpMyAdmin</em> (of course, after changing <em>#__</em> with the table prefix):</p>
<p><code>UPDATE `#__k2_categories` SET `access` =1;<br />
UPDATE `#__k2_items` SET `access` =1;</code></p>
<p>That&#8217;s it! After we did that, all the K2 modules were properly populated. Problem solved!</p>
<p>If you&#8217;re having problems with K2 items not showing up in your modules, then try the above method, and if it works, then we&#8217;re glad we were able to help. If it doesn&#8217;t, then just <a href="http://www.itoctopus.com/contact-us" title="Contact us">contact us</a> and we&#8217;ll fix it for you in no time and at a <a href="http://www.itoctopus.com/fees" title="Our fees!">very affordable cost</a>. We&#8217;re experts in Joomla, we&#8217;re professional, and we&#8217;re really nice to work with!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/k2-items-not-appearing-in-k2-modules-after-migrating-to-joomla-2-5/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Increase the Maximum Allowed Size of Uploaded Files in Joomla&#8217;s Media Manager</title>
		<link>http://www.itoctopus.com/how-to-increase-the-maximum-allowed-size-of-uploaded-files-in-joomlas-media-manager</link>
		<comments>http://www.itoctopus.com/how-to-increase-the-maximum-allowed-size-of-uploaded-files-in-joomlas-media-manager#comments</comments>
		<pubDate>Thu, 21 Feb 2013 04:30:45 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3840</guid>
		<description><![CDATA[By default, the media manager in Joomla 2.5 allows a maximum upload size of 10 MB, which is ridiculous, since a high resolution picture can be bigger than 10 MB, and the smallest video with the smallest resolution (by today&#8217;s standards) can be at least 3 times that size. So, there must be a way [...]]]></description>
			<content:encoded><![CDATA[<p>By default, the media manager in Joomla 2.5 allows a maximum upload size of 10 MB, which is ridiculous, since a high resolution picture can be bigger than 10 MB, and the smallest video with the smallest resolution (by today&#8217;s standards) can be at least 3 times that size. So, there must be a way to increase that maximum!</p>
<p><strong>So, how can one increase the maximum upload size in Joomla&#8217;s media manager?</strong></p>
<p>Well, it&#8217;s very easy. In order to do that, all you need to do is to follow these steps:</p>
<ul>
<li>Login to the backend of your Joomla website.
</li>
<li>
<p>Click on <em>Content</em>-&gt;<em>Media Manager</em> in the upper menu.</p>
</li>
<li>
<p>Click on <em>Options</em> on the top right.</p>
</li>
<li>
<p>Change the value next to <em>Maximum Size (in MB)</em> to something other than 10 (let&#8217; say 100, for example). Just enter a number, do not enter something like &#8220;100 MB&#8221; or &#8220;1 GB&#8221;. Just enter 100 or 1000 (all the values are assumed to be in Megabytes or MB).</p>
</li>
<li>
<p>Click on <em>Save &amp; Close</em> on the top right.</p>
</li>
<li>
<p>That&#8217;s it!</li>
</ul>
<p>Now, after modifying the maximum upload size, try uploading a large file (say one that is 50 MB), and see if it works. If it works, then congratulations! If it doesn&#8217;t work, then read on&#8230;</p>
<p><strong>So, why is it that the new maximum upload size is not taken into consideration and what can be done about it?</strong></p>
<p>Well, theoretically, you can set the value of the maximum upload size to anything, but realistically, everything in life has bounds, including that maximum upload size! As a rule of thumb, the maximum upload size cannot be greater than the <em>upload_max_filesize</em> and the <em>post_max_size</em>, both of which are values defined in <em>php.ini</em> (the PHP&#8217;s settings file). So, if you&#8217;re still not able to upload a large file even if its size is less than the value that you defined in the Media Manager, then most likely the size of that file is larger than <em>upload_max_filesize</em> or <em>post_max_size</em>.  As a rule of them, the <em>actual</em> maximum upload size in Joomla is always the lesser of these 3 values:</p>
<ol>
<li>Joomla&#8217;s maximum upload size as set in the Media Manager&#8217;s settings
</li>
<li>
<p>The <em>upload_max_filesize</em> as defined in <em>php.ini</em></p>
</li>
<li>
<p>The <em>post_max_size</em> as defined in <em>php.ini</em></li>
</ol>
<p>So, what if you really need to upload that large file through Joomla, can anything be done about it? Fortunately, in most cases, yes. All you need to do is to create a file called <em>php.ini</em> and place it under the root directory of your Joomla website. That file should contain the following lines:</p>
<p><code>upload_max_filesize = 100M<br />
 pos_max_size = 100M</code></p>
<p>The presence of this file will override the settings in the global <em>php.ini</em> and will ensure that the maximum upload size available to your Joomla website is 100 MB (of course, you can change the number to something other than 100 MB if you want).</p>
<p>Keep in mind that some shared hosting environments might ignore that <em>php.ini</em> that you have created. In this situation, your only option is to contact your host and tell them that you need to upload larger files through your PHP application.</p>
<p><strong>Is there a way to know the maximum upload size defined in the global <em>php.ini</em>?</strong></p>
<p>Yes there is. All you need to do is to create a file called <em>phpinfo.php</em> which consists of the following line:</p>
<p><code>phpinfo();</code></p>
<p>Upload the file to the root directory of your Joomla website and load the corresponding page into your browser (e.g go to <em>http://www.yourjoomlawebsite.com/phpinfo.php</em>). The displayed page will show all your PHP settings; just search for <em>upload_max_filesize</em> and <em>post_max_size</em> and you will see their values right next to them.</p>
<p>Now we reach the conclusion of this post. We hope you enjoyed it and we hope that you found it useful. If you didn&#8217;t (perhaps because it&#8217;s a bit technical) or if you just need more help, then that&#8217;s why we&#8217;re here! Just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and you&#8217;ll see how fast, reliable, and <a href="http://www.itoctopus.com/fees" title="Our fees!">affordable</a> we are. We&#8217;re also the friendliest programmers on planet earth! (that&#8217;s what our clients say about us!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-increase-the-maximum-allowed-size-of-uploaded-files-in-joomlas-media-manager/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Database Hacks on Joomla &#8211; The Worst Kind of Hacks</title>
		<link>http://www.itoctopus.com/database-hacks-on-joomla-the-worst-kind-of-hacks</link>
		<comments>http://www.itoctopus.com/database-hacks-on-joomla-the-worst-kind-of-hacks#comments</comments>
		<pubDate>Wed, 20 Feb 2013 06:03:07 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3792</guid>
		<description><![CDATA[A new client called us today and told us that his website was hacked, and asked us to fix it. The moment we hung up the phone with him, we started working on it immediately (we treat such tasks as urgent).
We did our regular check on its filesystem, and we didn&#8217;t discover anything! (even after [...]]]></description>
			<content:encoded><![CDATA[<p>A new client called us today and told us that his website was hacked, and asked us to fix it. The moment we hung up the phone with him, we started working on it immediately (we treat such tasks as urgent).</p>
<p>We did our regular check on its filesystem, and we didn&#8217;t discover anything! (even after following our super-duper easy-peasy <a href="http://www.itoctopus.com/how-to-quickly-fix-a-hacked-joomla-website" title="How to Quickly Fix a Hacked Joomla Website">method to quickly discover the infected files on a Joomla website</a>). We then pondered for a moment; could this be a database hack? We haven&#8217;t seen one for a long time!</p>
<p>So, we checked the database, and we were right, the filesystem was not infected, but the database was! It was a dreadful moment&#8230; Dreadful not because it&#8217;s hard to fix, but dreadful because we know that ensuring that the website remains clean (after it&#8217;s fixed) can be costly for the client (he was running a very old Joomla website with some very outdated and low profile extensions).</p>
<p><strong>So, what is a database hack? And how is it different from a filesystem hack?</strong></p>
<p>A database hack is when the malicious code is inserted directly into the database, rather than in one or more core files. Generally, the database hack consists of inserting the malicious code in one or more rows of the following two tables (replace <em>#__</em> with your table prefix):</p>
<ol>
<li><em>#__content</em></li>
<li><em>#__modules</em></li>
</ol>
<p>The malicious code inserted in the database usually has the same outcome as if it was inserted to a core Joomla file: It can redirect to malicious websites, it can infect clients (by clients we mean PCs loading the website) with a virus, or it can show content that is completely irrelevant to the website (the different content may be shown to Google&#8217;s bot, to the visitors, or both).</p>
<p><strong>What is the cause of a database hack?</strong></p>
<p>The cause of a database hack is generally a SQL injection exploit (hence we say that the rows are <em>injected</em> with malicious code). Now we know what your second question is: &#8220;Isn&#8217;t SQL injection a thing from the past in Joomla?&#8221; Well, the answer is that it&#8217;s not, thanks to some exploitable Joomla versions (including many releases of Joomla 1.5) and to some poorly written extensions (exploits of such extensions are well documented on Joomla&#8217;s official website).</p>
<p><strong>How to fix a database hack on a Joomla website?</strong></p>
<p>The answer to this question is simple: &#8220;Find and replace&#8221;. &#8220;But how?&#8221;, you might be wondering. Well, all you need to do is the following:</p>
<ol>
<li>Login to your Joomla database using <em>phpMyAdmin</em>.
</li>
<li>
<p>Click on a affected table (e.g. a table that has some malicious code injected in one or more of its rows).</p>
</li>
<li>
<p>Issue the following command (in our example below, we are assuming that the infected table is <em>#__content</em> and the infected column is the <em>introtext</em> column &#8211; make sure you replace <em>#__</em> with your table prefix):</p>
<p><code>UPDATE #__content SET `introtext` = REPLACE(`introtext`, '[malicious code]', '');</code></p>
</li>
<li>
<p>Repeat Steps #2 and #3 for all the infected tables and all the infected columns.</li>
</ol>
<p>Note: Finding which tables/columns are infected consists of doing a global search at the database level in <em>phpMyAdmin</em>.</p>
<p><strong>How to ensure that the database hack will not happen again?</strong></p>
<p>In order to ensure that your Joomla database won&#8217;t be hacked again you need to do the following:</p>
<ul>
<li>Upgrade your Joomla website to the latest version.
</li>
<li>
<p>Hire some Joomla experts to analyze the 3<sup>rd</sup> party extensions that you have on your website to ensure that they&#8217;re all <em>clean</em>.</li>
</ul>
<p><strong>Why is the database hack the worst kind of hacks?</strong></p>
<p>Good question! It&#8217;s because, as mentioned earlier, it can be very costly. While hacks on the filesystem can be completely blocked by enforcing strict permissions (e.g. changing ownership to root, changing file permissions across the board to 444, etc&#8230;), database hacks can only be prevented by ensuring that all the extensions, as well as Joomla itself, are up-to-date and are not exploitable. This can take a lot of time and can cost a lot of money &#8211; especially if the website in question is very large in size.</p>
<p>Now, if your Joomla website is hacked &#8211; regardless of the type of hack &#8211; then fear not! Relax, take a deep breath, and <a href="http://www.itoctopus.com/contact-us" title="Contact us!">call us</a>! We always answer the phone, we know Joomla from inside out, and <a href="http://www.itoctopus.com/fees" title="Our fees!">our rates</a> are very affordable for what we do! As many of our clients describe us, we are life savers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/database-hacks-on-joomla-the-worst-kind-of-hacks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Notice: Undefined property: [extension_name]::$_state&#8221; Error in Joomla</title>
		<link>http://www.itoctopus.com/notice-undefined-property-extension_name_state-error-in-joomla</link>
		<comments>http://www.itoctopus.com/notice-undefined-property-extension_name_state-error-in-joomla#comments</comments>
		<pubDate>Tue, 19 Feb 2013 01:30:43 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3795</guid>
		<description><![CDATA[When working on a major project on a Joomla website, we usually maximize the Joomla error reporting. This guarantees that not a single error, not even a notice, can go undetected and unfixed in our final work.
One of the common notices that we see on major projects is the following:
Notice: Undefined property: [extension_name]::$_state in /libraries/joomla/session/session.php [...]]]></description>
			<content:encoded><![CDATA[<p>When working on a major project on a Joomla website, we usually maximize the <a href="http://www.itoctopus.com/error-reporting-in-joomla" title="Error Reporting in Joomla">Joomla error reporting</a>. This guarantees that not a single error, not even a notice, can go undetected and unfixed in our final work.</p>
<p>One of the common notices that we see on major projects is the following:</p>
<p><em>Notice: Undefined property: [extension_name]::$_state in /libraries/joomla/session/session.php on line 323</em></p>
<p>So, probably the first question that you have is the following: &#8220;What happens in line 323?&#8221;</p>
<p>Well, here&#8217;s the code in line 323 in the <em>session.php</em> file located under the <em>/libraries/joomla/session/</em>.</p>
<p><code>if ($this->_state === 'destroyed')</code></p>
<p>If you&#8217;re a PHP programmer, you probably know what the problem is. The attribute <em>_state</em> on the <em>JSession</em> object is not set, and that&#8217;s why PHP is complaining. It is not really an error, but PHP thinks that the value of <em>_state</em> might be needed at one point or the other in your code.</p>
<p><em>But why the _state attribute was not set?</em></p>
<p>Good question! Take a look at this code:</p>
<p><code>$sessionId = JSession::getId();</code></p>
<p>If you have used the JSession class before, you will know that the <em>getId()</em> method (quick note: a method is a function that belongs to a class) is not really static, which means that even though the above code works, it&#8217;s wrong&#8230;</p>
<p>You see, you must <em>instantiate</em> an object of type <em>JSession</em>, and then call the method <em>getId()</em>. So, you must replace the above code with this one:</p>
<p><code>$objSession = new JSession();<br />
$sessionId = $objSession-&gt;getId();</code></p>
<p>The above code ensures that all attributes, including the <em>_state</em> attribute that PHP is complaining about, are properly set in the constructor of the <em>JSession</em> class.</p>
<p><em>But, what if you don&#8217;t want to instantiate an object?</em></p>
<p>The above solution that we have proposed is the right one. But, in some cases, you may not want to instantiate an object (we can&#8217;t think of any at the moment, but we&#8217;ve done this to address weird bugs). In this case, there are two methods to solve the problem:</p>
<ol>
<li><u>At the extension&#8217;s level</u></p>
<p>All you need to do is to open the main <em>.php</em> file of the extension that PHP is complaining about, and change your code from:</p>
<p><code>$sessionId = JSession::getId();</code></p>
<p>to</p>
<p><code>$sessionId = <font style='color: red; font-weight: bold'>@</font>JSession::getId();</code></p>
<p>(Notice the <em>@</em> symbol just in front of <em>JSession</em>.)</p>
</li>
<li>
<p><u>At the core level</u></p>
<p>Just change the line 323 in the <em>session.php</em> file which is located under the <em>/libraries/joomla/session/</em> directory from:</p>
<p><code>if ($this-&gt;_state === 'destroyed')</code></p>
<p>to</p>
<p><code>if (<font style='color: red; font-weight: bold'>@</font>$this-&gt;_state === 'destroyed')</code></p>
<p>(Again, notice the <em>@</em> sign at the beginning of the <em>if</em> statement).</li>
</ol>
<p>If you have many of those errors on your website, then the second method might be more practical, but you must consider the fact that you are changing a core Joomla file, that might be overriden with a new update.</p>
<p><em>Isn&#8217;t there an easier way to fix the problem for those who are not programmers?</em></p>
<p>Yes there is. All you need to do is to login to your Joomla&#8217;s backend, and then go to <em>Site</em> -&gt; <em>Global Configuration</em> -&gt; <em>Server</em>, and then choose <em>None</em> next to <em>Error Reporting</em> and finally click on <em>Save</em> at the top right. This is quite easy, isn&#8217;t it? But, on the flip side, you haven&#8217;t really fixed the error, you have just hidden it, and if you are in a development environment, then you won&#8217;t see that subtle error that may or may not be causing a cascade of issues on your website. (Note that in a production environment, the value of <em>Error Reporting</em> should <em>always</em> be <em>None</em>. Otherwise, your Joomla website can reveal some valuable information that can be used to launch malicious attacks against it!)</p>
<p><em>So, what is the best method to fix this problem?</em></p>
<p>The best method to fix this problem is to ensure that the method <em>getId()</em> is never invoked statically. Generally, static calls to non-static methods may result in stability issues and may haunt you back when you least expect it!</p>
<p>Now, we&#8217;re talking to you directly our valuable reader and potential client! If you are seeing errors (such as the above error or any other error) on your Joomla website and you need them fixed the <em>right</em> way and right away (is that a rhyme?), then look no further. Just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> at itoctopus and you can rest assured that we&#8217;ll fix these errors in no time and with no side effects on your website! By the way, <a href="http://www.itoctopus.com/fees" title="Our fees!">our fees</a> are very affordable, and we&#8217;re very friendly, so you really have no excuse for not calling!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/notice-undefined-property-extension_name_state-error-in-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>onPrepareContent and onContentPrepare in Joomla</title>
		<link>http://www.itoctopus.com/onpreparecontent-and-oncontentprepare-in-joomla</link>
		<comments>http://www.itoctopus.com/onpreparecontent-and-oncontentprepare-in-joomla#comments</comments>
		<pubDate>Fri, 15 Feb 2013 04:34:51 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3782</guid>
		<description><![CDATA[It was around 3 AM in the morning &#8211; we were working hard on a project to meet a deadline that was set for next week, but we were stuck. The project consisted of a migration of a Joomla website from version 1.5 to version 2.5 &#8211; something that we have done hundreds of times [...]]]></description>
			<content:encoded><![CDATA[<p>It was around 3 AM in the morning &#8211; we were working hard on a project to meet a deadline that was set for next week, but we were stuck. The project consisted of a migration of a Joomla website from version 1.5 to version 2.5 &#8211; something that we have done hundreds of times before! But, again, we were stuck. What&#8217;s even more embarrassing is that we were stuck on the migration of a very simple content plugin. We have migrated the plugin, ensured that all the code is correct, but the plugin just won&#8217;t execute. Mind you, the plugin was activated (or <em>published</em>, depending on the terminology you like to use, we prefer using <em>activated</em> for plugins and <em>published</em> for content items such as articles) <em>and</em> the plugin was loading properly (we added an <em>echo</em> statement in the function <em>plgContent[OurPlugin]</em> and it was displaying). We knew that the solution couldn&#8217;t be easier, but we just didn&#8217;t know what was the problem!</p>
<p>We finally decided to re-write the plugin from scratch &#8211; yes, it was inefficient, but it was a very simple plugin and re-writing it from scratch was an easy task. Around 5 AM, we finished re-writing the plugin (again, it was very simple and the logic was all defined for us in the original plugin!) for Joomla 2.5 &#8211; we tested it and it was working! As you have probably guessed, seeing the plugin working didn&#8217;t <em>satiate our curiosity</em>! We needed to know why the plugin wasn&#8217;t working before!</p>
<p>So we compared the two plugins together and we noticed something: The first plugin had the <em>onPrepareContent</em> function and the second plugin had the <em>onContentPrepare</em> function. Needless to say, the immediate reaction to this was the usual forehead slap! Of course, Joomla 1.5 uses the <em>onPrepareContent</em> while Joomla 2.5 uses the <em>onContentPrepare</em>! The engine just ignores the plugin if this function is named incorrectly.</p>
<p><em>But why did the core team at Joomla rename this function?</em></p>
<p>Nobody knows for sure! Perhaps consistency &#8211; but we seriously doubt it. Our best guess is that it was named this way to allow for developers to create plugins that will support Joomla 1.5 and Joomla 2.5 at the same time &#8211; this makes sense because the parameters of the two functions are different (there is an additional parameter called <em>$context</em> in the function <em>onContentPrepare</em>).</p>
<p><em>But aren&#8217;t we too much experienced to make that mistake?</em></p>
<p>We are &#8211; hence the forehead slap! The fact that it was 3 AM in the morning was also probably a contributing factor to this mistake! Everyone makes mistakes &#8211; and we don&#8217;t claim to be perfect! But you can always rest assured that we <em>will</em> find a solution to the problem, and the solution will always be elegant!</p>
<p>So, if you&#8217;re migrating some very old and/or discontinued extensions and you&#8217;re facing similar problems &#8211; then fear not, you are not alone! And if you ever need help, then you can always <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>! <a href="http://www.itoctopus.com/fees" title="Our fees!">Our fees</a> are very affordable, our reputation is immaculate, and we really <em>really</em> care about our clients!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/onpreparecontent-and-oncontentprepare-in-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;The Global Configuration extension could not be found. Text filter settings have not been saved.&#8221; Error in Joomla</title>
		<link>http://www.itoctopus.com/the-global-configuration-extension-could-not-be-found-text-filter-settings-have-not-been-saved-error-in-joomla</link>
		<comments>http://www.itoctopus.com/the-global-configuration-extension-could-not-be-found-text-filter-settings-have-not-been-saved-error-in-joomla#comments</comments>
		<pubDate>Mon, 11 Feb 2013 20:35:01 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3773</guid>
		<description><![CDATA[OK &#8211; we know that the title of this post is long &#8211; in fact, it is way too long, but we couldn&#8217;t find a better title for this very specific issue, so we decided that the title should be the same as the error message.
While working on a Joomla website for one our clients, [...]]]></description>
			<content:encoded><![CDATA[<p>OK &#8211; we know that the title of this post is long &#8211; in fact, it is <em>way</em> too long, but we couldn&#8217;t find a better title for this very specific issue, so we decided that the title should be the same as the error message.</p>
<p>While working on a Joomla website for one our clients, we wanted to maximize error reporting and so we logged in to the backend and we went to the &#8220;Global Configuration&#8221; page and we then changed the &#8220;Error Reporting&#8221; to &#8220;Maximum&#8221; in order to display all the errors. When we clicked on the &#8220;Save&#8221; button on the top right, we were greeted with the following error:</p>
<p><em>Could not save data. Error: The Global Configuration extension could not be found. Text filter settings have not been saved.</em></p>
<p>Now this is not the first time where we&#8217;re <a href=" http://www.itoctopus.com/unable-to-save-global-configuration-in-joomla" title="Unable to save global configuration in Joomla">unable to save the global configuration</a>, but this time it was different. It had nothing to do with file permissions, as the <em>configuration.php</em> file was fully writable &#8211; and, in fact, the changes were being written to that file.</p>
<p>The cause of this problem, to make a long story short, was at the database level. The database server&#8217;s hard disk partition was full, and, as such, the database server was restricting some activities.</p>
<p><em>So, what did we do to solve the problem?</em></p>
<p>Obviously, we freed up some space on the database server (such as deleting unnecessary databases), and that solved the problem!</p>
<p><em>And, what can we do to ensure that this problem won&#8217;t happen again?</em></p>
<p>Unfortunately &#8211; nothing. The best that we can do is to monitor the free disk space on the partition hosting the database server and ensuring that it&#8217;s never close to being full. When you run out of space, you just run out of space!</p>
<p><em>Could there be other reasons for this problem?</em></p>
<p>Yes &#8211; when we researched the issue we discovered that the corruption of some tables can also cause the same problem. When this happens, a simple <em>REPAIR TABLE</em> command issued on the affected table(s) will usually fix the issue. (Quick advice: Be wary that the <em>REPAIR TABLE</em> command is very costly and can take a long time to execute on large tables. Make sure you try repairing the table first with the <em>QUICK</em> option and see if that fixes the problem.)</p>
<p>Now, if you&#8217;re unable to save the Joomla configuration even after reading the above then it&#8217;s probably time to ask for help. Just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and rest assured that we can solve your problem in no time. We&#8217;re fast, we&#8217;re reliable, <a href="http://www.itoctopus.com/fees" title="Our fees">our fees</a> are affordable, and we&#8217;re really, <em>really</em> friendly!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/the-global-configuration-extension-could-not-be-found-text-filter-settings-have-not-been-saved-error-in-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to Empty Trash in Joomla</title>
		<link>http://www.itoctopus.com/unable-to-empty-trash-in-joomla</link>
		<comments>http://www.itoctopus.com/unable-to-empty-trash-in-joomla#comments</comments>
		<pubDate>Fri, 08 Feb 2013 17:31:25 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3750</guid>
		<description><![CDATA[We occasionally get contacted by customers who complain about the trashing process in Joomla; they say that they just cannot empty the trash. When we get one of these calls, we tell the customer: &#8220;Are you sure you are really emptying the trash?&#8221;
The reason why we say that is that in 99% of the cases [...]]]></description>
			<content:encoded><![CDATA[<p>We occasionally get contacted by customers who complain about the <em>trashing process</em> in Joomla; they say that they just cannot empty the trash. When we get one of these calls, we tell the customer: &#8220;Are you sure you are really emptying the trash?&#8221;</p>
<p>The reason why we say that is that in 99% of the cases &#8211; the person is trying to empty the trash from the wrong place (where it cannot be emptied). Here&#8217;s what happens:</p>
<ol>
<li>The person deletes a few items (such as articles, menu items, or modules).
</li>
<li>
<p>The person then changes the status (for the listing) to <em>All</em> (the default view <em>- Select Status -</em> displays published and unpublished items only, <em>All</em> will display published, unpublished, archived, and trashed items).</p>
</li>
<li>
<p>The person then selects the items to be completely deleted, and then clicks on <em>Trash</em> on the top right menu.</p>
</li>
<li>
<p>The items are not deleted.</li>
</ol>
<p>The reason why this isn&#8217;t working is because the person is <em>trashing</em> the items again, he&#8217;s not deleting them. He&#8217;s just moving them to the trash again. It&#8217;s like picking a paper from the recycle bin, and then throwing it back&#8230;</p>
<p><em>So, what should he have done to empty the trash?</em></p>
<p>The mistake occurred in step #2 in the process above &#8211; instead of choosing <em>All</em>, he should have chosen <em>Trashed</em>; it is only when choosing <em>Trashed</em> where he will see the <em>Empty Trash</em> icon on the top right menu (instead of the <em>Trash</em> icon). To delete the items, the person must select the items to be completely removed, and then click on the <em>Empty Trash</em> button.</p>
<p>Note: We have noticed that some of our customers who are very new to Joomla do not select the items to be deleted before clicking on the <em>Empty Trash</em> button. It seems to be a common pitfall and perhaps Joomla should revise the trashing process as the term <em>Empty Trash</em> doesn&#8217;t imply that the person has to select anything &#8211; it just means that it&#8217;ll remove whatever is in the trash!</p>
<p>If you&#8217;re experiencing problems with completing removing items from your Joomla website, and if the above doesn&#8217;t work for you, then all you need to do is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We&#8217;re always there, we&#8217;re eager to help, we&#8217;re very experienced with Joomla, and <a href="http://www.itoctopus.com/fees" title="Our fees!">we&#8217;re very affordable</a>! What are you waiting for?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/unable-to-empty-trash-in-joomla/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why APC Caching in Joomla Can Cause Confusion</title>
		<link>http://www.itoctopus.com/why-apc-caching-in-joomla-can-cause-confusion</link>
		<comments>http://www.itoctopus.com/why-apc-caching-in-joomla-can-cause-confusion#comments</comments>
		<pubDate>Sat, 02 Feb 2013 04:16:27 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3730</guid>
		<description><![CDATA[The project manager of a very large company that we do work for with called us this evening and told us that they are trying to update one of the modules, and while the change to that module seemed to take effect in the backend, that change wasn&#8217;t reflected in the frontend. This issue immediately [...]]]></description>
			<content:encoded><![CDATA[<p>The project manager of a very large company that we do work for with called us this evening and told us that they are trying to update one of the modules, and while the change to that module seemed to take effect in the backend, that change wasn&#8217;t reflected in the frontend. This issue immediately reminded us of the post that we have published some time ago: <a href="http://www.itoctopus.com/my-joomla-changes-are-not-showing" title="My Joomla changes are not showing!">my Joomla changes are not showing</a>. But, the moment we were about to ask her if they had cleared the cache, she continued: &#8220;&#8230;and we cleared all the cache!&#8221;. This meant that we had to look elsewhere&#8230;</p>
<p>So, we logged in to their Joomla website, and we tried updating the module (it was a simple <em>custom HTML</em> module), and, sure enough, our changes were not reflected. We cleared the cache several times &#8211; but still, it didn&#8217;t work. That was odd!</p>
<p>We then thought &#8211; could it be that we&#8217;re working on the wrong backend? So, we made a small change on one of the articles, and that change was reflected immediately. Which meant that we were working on the right website!</p>
<p>We then started suspecting the module &#8211; were we changing the right module? So we disabled it, and to our surprise, the module still showed on the frontend. We then tried to find a module that had the same location in the template, but we couldn&#8217;t find any. So, the conclusion so far that we were working on the right website and the right module, but any change to the module, including the completely disabling it, was not showing up on the website.</p>
<p>And so we thought about caching again, but this time we looked at the <em>global caching</em> in the global configuration. It was set to <em>Progressive Caching</em> (<a href="http://www.itoctopus.com/why-progressive-caching-in-joomla-should-be-avoided-in-most-cases" title="Why progressive caching in Joomla should be avoided (in most cases)">we&#8217;ve warned against using progressive caching before</a>), and the <em>cache handler</em> was set to <em>Alternative PHP Cache</em> (APC, and no, it&#8217;s not the famous UPS company!). The <em>cache time</em> was set to 15 minutes. After looking at these settings, we understood exactly what was going on&#8230;</p>
<p>You see, APC is a caching mechanism that runs on a lower level than Joomla &#8211; meaning that clearing Joomla&#8217;s cache will not really clear the cache, since that cache is technically handled by APC. Just to prove our point, we did a change to the module and waited 15 minutes, and when the 15 minutes elapsed, that change took effect on the frontend!</p>
<p>OK, so you&#8217;ve probably guessed by now what we did to solve the problem. We 1) changed caching from <em>progressive</em> to <em>conservative</em>, 2) change the <em>cache handler</em> to <em>File</em>, and 3) told the customer that whenever they needed to make a change to that module they must clear the page cache.</p>
<p>So, what is the <em>wisdom</em> that was gained from tonight&#8217;s work? In our opinion, it&#8217;s that APC causes confusion, because content managers expect (and rightly so) for their changes to immediately appear on the website when they make them (or at least after deleting the cache). So while APC is faster than regular Joomla cache, it&#8217;s not that good of an option especially if module updates are frequent.</p>
<p>Now, if you&#8217;re reading this because you&#8217;re having caching issues on your website, and if you still don&#8217;t know how to solve them, then why not just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We&#8217;re always available, our work is swift and efficient, and <a href="http://www.itoctopus.com/fees" title="Our fees!">our rates</a> are very reasonable!</p>
<p><em>Note: For those of you wondering how come we didn&#8217;t set the <em>Caching</em> field for that particular module to <em>No caching</em>, we did do that, but for some reason, the module was still cached (whether we were using APC or File as cache handlers)! Could that be a bug in Joomla 2.5?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/why-apc-caching-in-joomla-can-cause-confusion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where to Put the Google Analytics Code on Your Joomla Website</title>
		<link>http://www.itoctopus.com/where-to-put-the-google-analytics-code-on-your-joomla-website</link>
		<comments>http://www.itoctopus.com/where-to-put-the-google-analytics-code-on-your-joomla-website#comments</comments>
		<pubDate>Thu, 31 Jan 2013 20:38:54 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3687</guid>
		<description><![CDATA[Most of our clients want to track the performance of their Joomla website &#8211; and what better way to track that performance than with Google Analytics? Google Analytics provides the website owner with a wealth of information about his website: how many visitors the websites gets per day, where these visitors are coming from, and [...]]]></description>
			<content:encoded><![CDATA[<p>Most of our clients want to track the performance of their Joomla website &#8211; and what better way to track that performance than with Google Analytics? Google Analytics provides the website owner with a wealth of information about his website: how many visitors the websites gets per day, where these visitors are coming from, and what kind of devices these visitors are using. Google Analytics is also ideal for tracking conversions in conjunction with Google Adwords.</p>
<p>Google Analytics is a very easy tool for what it does, installing it, on the other hand, can be a bit tricky for those who are new to Joomla. Some try to add it in a <em>custom HTML</em> module which is placed in the footer of the website and assigned <em>globally</em>. They&#8217;re shocked to see that when they save the module, the code disappears! And they start wondering, &#8220;why did this happen?&#8221;</p>
<p>The reason why the code disappears is that the <em>custom HTML</em> module in Joomla does not accept JavaScript as input. It filters JavaScript out for security reasons. So, where does someone add Google Analytics code to his website?</p>
<p>There are three places where the Google Analytics code can be added:</p>
<ol>
<li><strong>In a 3<sup>rd</sup> party module</strong>
<p>There are many modules in the JED (Joomla Extension Directory) that can be installed in order to add the Google Analytics code on a Joomla website. All one needs to do is to download one of these modules, install it on his Joomla website, set its parameters to reflect his Google Analytics account number, enable it on the website, and he&#8217;s good to go!</p>
<p>This is probably the easiest and the most common way to add Google Analytics code, but you&#8217;ll be installing an extension (usually developed by a little known programmer) that may or may not be hacker proof! Additionally, the placement of the Analytics code may not be where you want it to be.</p>
</li>
<li>
<p><strong>In the template</strong></p>
<p>Adding the Google Analytics code to the website&#8217;s template is very easy: all you need to do is to go to the template manager, open the <em>index.php</em> file of the template that you&#8217;re using, and add the code there (near the end of the page). That&#8217;s it!</p>
<p>The flip side of this is that if you change your template, you will have to copy back the code. Additionally, you (or your developer) might forget a template or two to add the code to if you have several active templates on your Joomla website.</p>
</li>
<li>
<p><strong>In a in-house developed system plugin</strong></p>
<p>This is our favorite way for adding Google Analytics code. It consists of developing a <em>configurable</em> system plugin that will automatically add the Google Analytics code to every page on the frontend of the Joomla website (in a specific place in your HTML code, just before the &lt;body&gt; tag). What makes it better than the previous two methods is that it&#8217;s quite easy to develop, and that it works in all conditions as long as it&#8217;s enabled. Additionally, you will be using a trusted code, which is your code, or the code of someone trustworthy! (maybe us, at itoctopus, perhaps?)</li>
</ol>
<p>Now, if after reading our guide, you are still having problems installing the Google Analytics code on your Joomla website, then feel free to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. <a href="http://www.itoctopus.com/fees" title="Our fees!">Our rates</a> are inexpensive, our work is professional, and we are confident that we can help you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/where-to-put-the-google-analytics-code-on-your-joomla-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0&#8243; Error in Joomla</title>
		<link>http://www.itoctopus.com/warning-unknown-failed-to-open-stream-permission-denied-in-unknown-on-line-0-error-in-joomla</link>
		<comments>http://www.itoctopus.com/warning-unknown-failed-to-open-stream-permission-denied-in-unknown-on-line-0-error-in-joomla#comments</comments>
		<pubDate>Wed, 30 Jan 2013 23:50:30 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3689</guid>
		<description><![CDATA[We&#8217;re currently having an increasing number of clients emailing us that they&#8217;re seeing the following error (repeated twice) on their homepage:
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
The homepage doesn&#8217;t display anything else, just this message (again, the message is usually displayed twice).
So, what is the cause of this problem?
As [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re currently having an increasing number of clients emailing us that they&#8217;re seeing the following error (repeated twice) on their homepage:</p>
<p><em>Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0</em></p>
<p>The homepage doesn&#8217;t display anything else, just this message (again, the message is usually displayed twice).</p>
<p><strong>So, what is the cause of this problem?</strong></p>
<p>As the error message implies, the main cause of this problem is wrong permissions &#8211; usually affecting the <em>index.php</em> file (which is usually the first file loaded by the web server, unless there is an <em>index.html</em> file). The permissions on this file are wrongfully set to 000 (which means that no one can read, write, or execute that file). Normally, the <em>index.php</em>&#8217;s permissions should be set to <em>444</em>.</p>
<p>Now, the <em>000</em> permissions make the issue a bit more confusing, since some file managers and FTP managers do not list files with what we call <em>zero permission</em> (which will inaccurately imply that the file has been deleted &#8211; while it&#8217;s not).</p>
<p><strong>So how can this problem be fixed?</strong></p>
<p>In order to solve the problem, you will need to first go to your file manager. If you have a cPanel powered hosting, then all you need to do is to login to your cPanel and then click on <em>File Manager</em>. Once you&#8217;re in the file manager, there are two ways to solve the problem, depending on whether you see the <em>index.php</em> file or not.</p>
<ol>
<li><u>If you see the <em>index.php</em> file</u>
<p>All you need to do is to right click on the <em>index.php</em> and set its permissions to 444. This should fix the problem in <em>most</em> cases.</p>
</li>
<li>
<p><u>If you don&#8217;t see the <em>index.php</em> file</u></p>
<p>If you don&#8217;t see the file, then you will need to create another file (call it <em>chmod.php</em> and place it under the root directory of your website) which will contain the following code:</p>
<p><code>&lt;?php<br />
chmod("index.php", 0444);<br />
?&gt;</code></p>
<p>Once the <em>chmod.php</em> file is created, you will need to run it by pointing your browser to <em>http://www.yourjoomlawebsite.com/chmod.php</em>. The problem is usually fixed when you load that page.</li>
</ol>
<p><strong>What if the problem is still not fixed, even after doing the above?</strong></p>
<p>If, even after you change the permissions of the file, the problem still exists, then it might be possible that your user (or Apache) doesn&#8217;t have the right permissions to make those permissions changes (we know, we&#8217;re using the word <em>permission</em> abundantly in this post!). In this case, you should delete the file and then re-create it from a guaranteed-to-be-working backup. In order to do that, you will need first to grab, from Joomla&#8217;s official website, a clean copy of the exact Joomla version that you&#8217;re using.</p>
<p>Now, if you&#8217;re able to see the <em>index.php</em>, then all you need to do is to delete it and then re-upload it from the clean copy of Joomla that you&#8217;ve just installed. If you&#8217;re not able to see the <em>index.php</em> file, then you&#8217;ll first need to write a small PHP script to <em>unlink</em> (delete) the file from the website before uploading the clean <em>index.php</em> that you have.</p>
<p><strong>Which versions of Joomla have this problem?</strong></p>
<p>We have noticed that not all versions of Joomla have this problem. In fact, the versions affected are Joomla 1.5 builds that are less or equal to 15 (e.g. Joomla 1.5.0 until Joomla 1.5.15).</p>
<p><strong>But what is the <em>root</em> cause of the problem?</strong></p>
<p>There are two things that might cause this issue:</p>
<ol>
<li>A malicious attack on the website exploiting the many vulnerabilities of old Joomla 1.5 builds.
</li>
<li>
<p>Some poorly written (and legacy) extensions that behave erratically under some conditions.</li>
</ol>
<p><strong>What is the long term solution to the problem?</strong></p>
<p>There are two long term solutions to the problem:</p>
<ol>
<li>Upgrading the Joomla website to the latest version, which ensures that the website is kept up-to-date with the latest patches.
</li>
<li>
<p><em>Locking</em> write activities on the Joomla website by <a href="http://www.itoctopus.com/why-you-should-use-dso-for-joomla-websites" title="Why you should use DSO for Joomla websites">switching to DSO</a>. This is a good option in case you cannot afford an expensive migration.</li>
</ol>
<p>We hope that you found this guide useful. Now, if you&#8217;re having the same problem and you&#8217;re not able to fix it by following our guide, then feel free to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We&#8217;re always read to help, <a href="http://www.itoctopus.com/fees" title="Our fees!">our rates</a> are affordable, and we are the friendliest developers on this planet (seriously, try us!).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/warning-unknown-failed-to-open-stream-permission-denied-in-unknown-on-line-0-error-in-joomla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Is the Worst Joomla Version?</title>
		<link>http://www.itoctopus.com/what-is-the-worst-joomla-version</link>
		<comments>http://www.itoctopus.com/what-is-the-worst-joomla-version#comments</comments>
		<pubDate>Fri, 25 Jan 2013 15:26:12 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3668</guid>
		<description><![CDATA[Some time ago, we have written a post on the best Joomla version &#8211; we said that is was Joomla 2.5 (in case you don&#8217;t have time to read the post). Since then, we had some of our customers ask us, &#8220;what is the worst Joomla version?&#8221;
Before answering, you probably might think we are going [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, we have written a post on the <a href="http://www.itoctopus.com/what-is-the-best-joomla-version" title="What is the best Joomla version?">best Joomla version</a> &#8211; we said that is was Joomla 2.5 (in case you don&#8217;t have time to read the post). Since then, we had some of our customers ask us, &#8220;what is the worst Joomla version?&#8221;</p>
<p>Before answering, you probably might think we are going to say that it&#8217;s Joomla 1.5 &#8211; but it&#8217;s not. In fact, in our opinion, Joomla 1.5 is the second best Joomla version, and the proof is that it&#8217;s still used by literally millions of websites out there, and those with Joomla 1.5 are very hesitant to migrate to Joomla 2.5, despite the fact that <a href="http://www.itoctopus.com/is-joomla-1-5-26-still-secure" title="Is Joomla 1.5.26 still secure?">Joomla 1.5.26 has been deemed insecure</a> as of May of 2012.</p>
<p><strong>So, what is the worst Joomla version?</strong></p>
<p>Without any further delay, we think it&#8217;s Joomla 1.6. Here&#8217;s why:</p>
<ul>
<li>
<p><strong>Joomla 1.6 is buggy</strong></p>
<p>All the work that we get on Joomla 1.6 is usually related to a bug in its core. What we do is we usually modify the core (something that we don&#8217;t like to do) to fix the issue. The issues that we&#8217;ve seen on Joomla 1.6 are numerous, but the most recurring issue that we&#8217;ve seen is described in the next point below&#8230;</p>
</li>
<li>
<p><strong>Joomla&#8217;s 1.6 ACL is completely unstable</strong></p>
<p>One of the most prominent differences between Joomla 1.6 and Joomla 1.5 is the ACL (Access Control List). Joomla 1.5 didn&#8217;t have an ACL per-se, it just had an <em>ACL look-alike</em>. Joomla&#8217;s 1.6 ACL is a <em>real</em> ACL but unfortunately, it is very badly written, which results in instability issues affecting the whole website. The most common issue when it comes to the ACL is when people are getting more/less permissions than explicitly assigned.</p>
<p>On the same note, one of our top clients (an extremely well known Fortune 500 company) is currently suffering from an ACL issue on one of its microsites (it&#8217;s a Joomla 1.6 microsite used by its staff). We&#8217;re working with them to resolve the issue.</p>
</li>
<li>
<p><strong>Joomla 1.6 cannot be easily upgraded to Joomla 2.5</strong></p>
<p>Forget about official statements telling end users that Joomla 1.6 can be easily upgraded to Joomla 2.5. According to our experience, it cannot! In fact, on several occasions, we had to treat an update from Joomla 1.6 to Joomla 2.5 as a migration! (read about the difference between an update, an upgrade, and a migration <a href="http://www.itoctopus.com/difference-between-a-joomla-upgrade-a-joomla-update-and-a-joomla-migration" title="Difference between a Joomla upgrade, a Joomla update, and a Joomla migration">here</a>.)</p>
</li>
<li>
<p><strong>The lifetime of Joomla 1.6 was only 7 months</strong></p>
<p>Joomla 1.6 was released on January of 2011. Its support was ceased on August of 2011, that gives this CMS a lifetime of only 7 months. Compare that to the lifetime of Joomla 1.5 which was about 5 years, and to that of Joomla 1.0 which was slightly less than 4 years. Clearly, product management at Joomla did not trust and did not like this version to give it this extremely short lifespan!</p>
</li>
<li>
<p><strong>Joomla 1.6 was not widely adopted by end users</strong></p>
<p>Out of every 100 tasks/projects that we get, we have only 3 or 4 of them on websites that run Joomla 1.6 &#8211; a clear evidence that Joomla 1.6 was not widely adopted by Joomla&#8217;s large community.</p>
</li>
<li>
<p><strong>Joomla 1.6 was not widely adopted by 3<sup>rd</sup> companies</strong></p>
<p>Yes &#8211; we know that most extensions out there state that they support Joomla 1.6. But this support is <em>by accident</em>, it&#8217;s because Joomla&#8217;s 1.6 infrastructure is very similar to that of Joomla 2.5. So, when these 3<sup>rd</sup> party companies develop an extension for Joomla 2.5, this extension usually automatically works on Joomla 1.6. This doesn&#8217;t mean, however, that this extension is stable on that platform because the platform, in and for itself, is not stable (as described earlier).</li>
</ul>
<p><strong>But what about Joomla 1.7, isn&#8217;t it even worse than Joomla 1.6?</strong></p>
<p>Well, in fact, Joomla 1.7 is actually slightly better than Joomla 1.6. It still has some ACL issues and it&#8217;s still a bit buggy (and it had the same lifetime), but it&#8217;s generally better than Joomla 1.6. This makes Joomla 1.7 the second worst Joomla version!</p>
<p>Now, if you&#8217;re stuck with Joomla 1.6 (or Joomla 1.7, for that matter) and you have problems with your website, then you can always <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>! We&#8217;re fast, we&#8217;re efficient, we know our Joomla, and <a href="http://www.itoctopus.com/fees" title="Our fees!">our fees</a> are competitive.</p>
<p><em>Note: We still perceive Joomla 3.0 as a beta product and that&#8217;s why it wasn&#8217;t mentioned in this post. Had this not been the case (e.g. if we did perceive it as a production product), then most likely Joomla 3.0 would have won the worst Joomla version medal, as its stability issues are much more severe than those of Joomla 1.6.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/what-is-the-worst-joomla-version/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Global Check-in Does Not Work in Joomla 2.5</title>
		<link>http://www.itoctopus.com/global-check-in-does-not-work-in-joomla-2-5</link>
		<comments>http://www.itoctopus.com/global-check-in-does-not-work-in-joomla-2-5#comments</comments>
		<pubDate>Thu, 24 Jan 2013 17:46:44 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3657</guid>
		<description><![CDATA[Note: This post is targeted at absolute beginners in Joomla as we have noticed that the &#8220;global check-in not working&#8221; issue is extremely common for those who are very new to Joomla.
We get regular calls from some of our customers who are very new to Joomla complaining that they cannot perform a global check-in on [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: This post is targeted at absolute beginners in Joomla as we have noticed that the &#8220;global check-in not working&#8221; issue is extremely common for those who are very new to Joomla.</em></p>
<p>We get regular calls from some of our customers who are very new to Joomla complaining that they cannot perform a global check-in on their website. We immediately recognize the issue and so we tell them: &#8220;Are you sure you selected all the database tables and clicked on <em>Check-in</em> on the top right?&#8221;. The answer that we get from them is usually: &#8220;Where can I do that?&#8221;</p>
<p>You see, the global check-in functionality in Joomla 2.5 is confusing, because those new to Joomla think that the global check-in is done simply by clicking on the <em>Site</em> -&gt; <em>Maintenance</em> -&gt; <em>Global Check-in</em> link on the top menu. The thing is, performing a global check-in consists of the following steps:</p>
<ol>
<li>Clicking on <em>Global Check-in</em> under <em>Site</em> -&gt; <em>Maintenance</em> on the top menu.</p>
</li>
<li>
<p>Clicking on the checkbox next to <em>Database Table</em> (on the page that appears when you click on the above link) to select (or <em>check</em>) all the tables in your database.</p>
</li>
<li>
<p>Clicking on <em>Check In</em> on the top right.</p>
</li>
<li>
<p>That&#8217;s it!</li>
</ol>
<p><strong>So, why do those new to Joomla omit the steps after <em>Step 1</em>?</strong></p>
<p>We believe it&#8217;s because of the orange <em>check-mark</em> that appears on the page once they click on the <em>Global Check-in</em> link in the first step. Take a look at this:</p>
<p><img src="http://www.itoctopus.com/wp-content/uploads/2013/01/global-check-in.jpg" alt="Global check-in" title="Global check-in" width="468" height="312"/><center><em>Figure 1: Global check-in</em></center></p>
<p>Doesn&#8217;t the above picture imply that the check-in has already been done because of the orange tick? We believe so, and we believe that our clients are right in getting confused when the process doesn&#8217;t work for them by just clicking on the link in the first step. Which takes us to our next question&#8230;</p>
<p><strong>Why is the global check-in a multi-step process?</strong></p>
<p>Is it really necessary to give users the flexibility to choose which tables they want to apply the global check-in to? We know for a fact that in 99% of the cases, when someone does a global check-in, he wants to do a global check-in <em>globally</em> (e.g. on all the tables). We think that Joomla&#8217;s product managers should revise the current process for check-in and make it a single-step process.</p>
<p>If you are trying to do a global check-in and it&#8217;s not working for you by following the above steps, then there&#8217;s also another way to do it by setting the <em>checked_out</em> field to 0 in the affected tables (e.g. the tables containing the items you&#8217;re not able to check-in) using <em>phpMyAdmin</em>. If you need help doing this then all you need to do is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a>. We will do it for you in no time and we&#8217;ll only <a href="http://www.itoctopus.com/fees" title="Our fees!">charge you</a> for an hour!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/global-check-in-does-not-work-in-joomla-2-5/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is There a Way to Become a Joomla Certified Developer?</title>
		<link>http://www.itoctopus.com/is-there-a-way-to-become-a-joomla-certified-developer</link>
		<comments>http://www.itoctopus.com/is-there-a-way-to-become-a-joomla-certified-developer#comments</comments>
		<pubDate>Wed, 23 Jan 2013 12:09:14 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3599</guid>
		<description><![CDATA[Some of our more technical clients tell us that they want to become certified in Joomla. They ask us if such a certification exists &#8211; and if it does &#8211; how can one become certified.
Our answer is always as follows: There is no official certification in Joomla. There are some commercial companies offering certifications in [...]]]></description>
			<content:encoded><![CDATA[<p>Some of our more technical clients tell us that they want to become certified in Joomla. They ask us if such a certification exists &#8211; and if it does &#8211; how can one become certified.</p>
<p>Our answer is always as follows: There is no <em>official</em> certification in Joomla. There are some commercial companies offering certifications in Joomla, but these certifications are not official, and, as such, do not carry real weight in the <em>professional</em> world. In short, <u>there is no way to <em>officially</em> become a Joomla Certified Developer</u>.</p>
<p><strong>But, how come there is no official certification for Joomla even though it&#8217;s been there for several years now and is being used by millions of websites?</strong></p>
<p>The answer to this question is simple: Joomla, in its core, is quite an easy product. Here&#8217;s what one needs to know about Joomla to know almost <em>everything</em> about Joomla:</p>
<ul>
<li>What are components, modules, and plugins</p>
</li>
<li>
<p>How to create articles/categories</p>
</li>
<li>
<p>How to create menus and menu items</p>
</li>
<li>
<p>How to create a module and assign that module to a menu item</p>
</li>
<li>
<p>How to install extensions</p>
</li>
<li>
<p>How to change the template</p>
</li>
<li>
<p>How edit a template</p>
</li>
<li>
<p>How to work with plugins</p>
</li>
<li>
<p>How to work with ACL</li>
</ul>
<p>Believe it or not &#8211; the above is all what Joomla is about in a basic installation. One doesn&#8217;t need to get certified to know how to work with Joomla &#8211; he can learn everything about it in one afternoon.</p>
<p><strong>But is Joomla really that simple? If it is, then how come there are 3<sup>rd</sup> party companies such as itoctopus supporting Joomla?</strong></p>
<p>Well, Joomla&#8217;s complexity is proportional to the number and the complexity of the 3<sup>rd</sup> party extensions installed. The more you have of those installed on your website, the harder it becomes to work on it (and the harder it becomes to debug it). Some examples of Joomla&#8217;s extremely advanced extensions are: sh404, JomSocial, JFusion (yes &#8211; JFusion can be quite complicated &#8211; check this post on <a href="http://www.itoctopus.com/efront-integration-with-joomla" title="eFront integration with Joomla">eFront&#8217;s integration with Joomla</a>), etc&#8230;</p>
<p><strong>But since Joomla can be quite complex, shouldn&#8217;t that be reason enough for it to have a certification?</strong></p>
<p>As stated earlier, Joomla, in and for itself, is quite easy. It only becomes complex when you have 3<sup>rd</sup> party extensions installed, and it&#8217;s unrealistic to expect Joomla, as an organization, to issue a certification that will take complex 3<sup>rd</sup> party extensions into consideration.</p>
<p><strong>Are there plans for an official Joomla certification at any point in the future?</strong></p>
<p>Currently, there aren&#8217;t, and we don&#8217;t expect to see such a certification in the near future, simply because the aim of the Joomla team is to maintain a product that is easy to use by anyone, but that can be customized, with unofficial extensions, to do anything!</p>
<p><strong>But what about Joomla experts &#8211; how did <em>they</em> become experts?</strong></p>
<p>These people became Joomla experts because 2 things:</p>
<ul>
<li>Their fluency in PHP</p>
</li>
<li>
<p>Their long time exposure to Joomla</li>
</ul>
<p>At itoctopus, we are proud to say that we have reached the expertise level in Joomla a long time ago. So, if you need anything on your Joomla website, then be confident that we, at itoctopus, can do it for you! All you need is to do is to <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and you can rest assured that neither we nor <a href="http://www.itoctopus.com/fees">our fees</a> will disappoint you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/is-there-a-way-to-become-a-joomla-certified-developer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can Joomla Be Used to Build a Social Networking Website?</title>
		<link>http://www.itoctopus.com/can-joomla-be-used-to-build-a-social-networking-website</link>
		<comments>http://www.itoctopus.com/can-joomla-be-used-to-build-a-social-networking-website#comments</comments>
		<pubDate>Tue, 22 Jan 2013 17:50:33 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3596</guid>
		<description><![CDATA[We are getting an increasing number of requests from clients asking us to build a social networking website (à la Facebook &#8211; but on a smaller scale), with Joomla. Here&#8217;s how the first conversation between us and these clients goes:
&#8220;Hello, my name is John Smith, and I was thinking you might be able to help [...]]]></description>
			<content:encoded><![CDATA[<p>We are getting an increasing number of requests from clients asking us to build a social networking website (à la Facebook &#8211; but on a smaller scale), with Joomla. Here&#8217;s how the first conversation between us and these clients goes:</p>
<p>&#8220;Hello, my name is John Smith, and I was thinking you might be able to help me.&#8221;</p>
<p>&#8220;Hi John &#8211; how we may help you?&#8221;</p>
<p>&#8220;I would like to build a social networking website with Joomla since I&#8217;m comfortable with this CMS &#8211; do you think it&#8217;s possible?&#8221;</p>
<p>&#8220;It&#8217;s certainly possible John!&#8221;</p>
<p>And then the conversation continues and we discuss the nature of the website (what will the website be about), the target audience, the cost to develop the website, and the time it takes to develop it&#8230;</p>
<p>So, how do we build a social networking website from scratch for our clients?</p>
<p>Well, the process consists of the below steps:</p>
<p><strong>Step 1 &#8211; Find the right environment for the website</strong></p>
<p>A social networking website powered by Joomla <em>must</em> have the right (hosting) environment. In other words, it must have access to a lot of physical resources on the server hosting it (social websites tend to grow exponentially when they succeed), it must be able to connect to MySQL, it must be powered by the right web server, and it must enjoy a lot of bandwidth. (We have discussed Joomla&#8217;s ideal environment before &#8211; see <a href="http://www.itoctopus.com/what-is-joomlas-ideal-hosting-environment" title="What is Joomla's ideal hosting environment?">here</a>.)</p>
<p><strong>Step 2 &#8211; Install Joomla</strong></p>
<p>Once we know where the Joomla website will be hosted, we start the installation process. Our super-fast Joomla installation process consists of the following steps:</p>
<ul>
<li>Downloading the latest version of Joomla (we currently use Joomla 2.5 and we&#8217;re avoiding Joomla 3.0 because of <a href="http://www.itoctopus.com/why-we-recommend-against-using-joomla-3-0" title="Why we recommend against using Joomla 3.0">stability issues</a>)</p>
</li>
<li>
<p>Uploading the zip file containing Joomla (that we just downloaded) to the hosting server using cPanel&#8217;s <em>File Manager</em></p>
</li>
<li>
<p>Extracting the zip file (using the <em>Extract</em> tool in cPanel&#8217;s <em>File Manager</em>) that was just uploaded a directory called <em>testwebsite</em> right under the location where the Joomla website will eventually reside</p>
</li>
<li>
<p>Creating the database using the <em>MySQL Databases</em> tool in cPanel</p>
</li>
<li>
<p>Creating a database user and give that user access to the database created in the previous step</p>
</li>
<li>
<p>Configuring Joomla by going to <em>http://www.yourjoomlawebsite.com/testwebsite</em> (this is where Joomla asks you which language to use, which database to connect to, what will be the name of the website, and what will be the password of the main super user)</li>
</ul>
<p>After installing Joomla, we are ready to move to the next step, which is choosing a template.</p>
<p><strong>Step 3 &#8211; Choose a template for the Joomla website</strong></p>
<p>Once Joomla&#8217;s installation is done &#8211; a quick and important question arises: &#8220;How will the website look like?&#8221;</p>
<p>A template defines how a website looks and there are plenty of free and commercial Joomla templates out there. The free ones are good but not great, but the commercial ones are usually very beautiful and give the website a professional and expensive look.</p>
<p>Many clients are able to find a free or commercial Joomla template that fits their needs. But some clients are much more selective, or need an exclusive look and feel for their website, and that&#8217;s why we connect them with a designer (Note: We have no designers working for us &#8211; which means that we cannot be held accountable for their work, even if we&#8217;re the ones connecting them with our clients. Our clients are always free to go with a designer of their choice) who will be able to help them. These clients then communicate with the designer directly, who develops the template based on their needs, and eventually sends the template to us.</p>
<p>Once we have the template, all we need to do is to install it through Joomla&#8217;s backend, which is quite an easy and smooth task (unless, of course, there are some errors in the template&#8217;s <em>manifest</em> file).</p>
<p><strong>Step 4 &#8211; Install JomSocial</strong></p>
<p>JomSocial, for those who do not know, is a commercial <em>extension</em> that will integrate all the functions of a fully fledged social networking website with Joomla.</p>
<p>In order to install JomSocial, all one needs is to download it (after paying for it) from the JED (the Joomla Extensions Directory), and then install it from Joomla&#8217;s backend.</p>
<p>Now, after JomSocial is installed, then the client might ask the designer to make some modifications to the template to accommodate JomSocial. This is especially the case when the designer has no idea how the website will look like once JomSocial is installed.</p>
<p><em>It&#8217;s unbelievable that this small and easy step is what makes a Joomla website a social networking website &#8211; don&#8217;t you agree? That&#8217;s saying something about the power and the versatility of Joomla!</em></p>
<p><strong>Step 5 &#8211; Modify JomSocial to accommodate the needs of our client</strong></p>
<p>Many clients have specific features to implement on their new website &#8211; and that&#8217;s why standard features won&#8217;t cut it for them. This is where our job gets very exciting as our clients will ask us to implement their vision of their new social networking website into JomSocial! What we do is we either modify JomSocial&#8217;s core and/or develop new extensions that will work in harmony with JomSocial to complement that vision!</p>
<p><strong>Step 6 &#8211; Test the website</strong></p>
<p>Once all the pieces are in place, we start the testing. There are two types of testing:</p>
<ol>
<li><u>Technical testing</u>
<p>&#8220;Technical testing&#8221; is done on our end and its aim is to unveil bugs (such as <em>MySQL</em> errors, blank pages, 404 errors, internal server errors, etc&#8230;) All bugs are fixed on the spot in this type of testing.</p>
</li>
<li>
<p><u>Business logic testing</u></p>
<p>&#8220;Business logic testing&#8221; is done on the client&#8217;s end to ensure that all the functionality is there and that the website is doing what it should. In short, &#8220;Business logic testing&#8221; is checking whether the business logic requested by the client is all there, is not broken, and is fulfilling the agreed-on specifications. At the end of &#8220;Business logic testing&#8221;, our clients will send us a report containing all the issues that they faced for us to address.</li>
</ol>
<p>Needless to say, we retest the whole website after fixing <em>technical bugs</em> or <em>logical bugs</em> because a fix might have an undesirable effect on other areas of the website.</p>
<p><strong>Step 7 &#8211; Move the website to production</strong></p>
<p>When all the testing is done and when our client gives us the go-ahead, we move the website to production. The move to production consists of physically moving the website from the <em>testwebsite</em> directory to the <em>root</em> directory. This means that the website&#8217;s URL, at this point, will be <em>http://www.yourjooomlawebsite.com/</em> instead of <em>http://www.yourjoomlawebsite.com/testwebsite</em>. And that&#8217;s it! We&#8217;re done!</p>
<p>So, is the process of building a social website from scratch in Joomla hard? We don&#8217;t think so &#8211; but we don&#8217;t think it&#8217;s easy either. It&#8217;s better to ask for help If you&#8217;re trying to build your own social networking website with Joomla &#8211; and where better to find that help than right here, at itoctopus? Just <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we&#8217;ll help you build your own social networking website with Joomla in record time and for a <a href="http://www.itoctopus.com/fees" title="Our fees!">reasonable fee</a>. By the way, our biggest achievement is to have our clients <em>thrilled</em> with the end result. Try us!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/can-joomla-be-used-to-build-a-social-networking-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Disable Mootools in Joomla</title>
		<link>http://www.itoctopus.com/how-to-disable-mootools-in-joomla</link>
		<comments>http://www.itoctopus.com/how-to-disable-mootools-in-joomla#comments</comments>
		<pubDate>Mon, 21 Jan 2013 12:22:12 +0000</pubDate>
		<dc:creator>Fadi</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.itoctopus.com/?p=3585</guid>
		<description><![CDATA[Warning: Mootools is a well known (and very stable) JavaScript library that is used to support many client-side activities on Joomla. Disabling it/removing it (or replacing it with another library) might cause a lot of instability on your Joomla website and may render your Joomla website (especially its backend) completely inoperable. Please proceed carefully and, [...]]]></description>
			<content:encoded><![CDATA[<p><em>Warning: Mootools is a well known (and very stable) JavaScript library that is used to support many client-side activities on Joomla. Disabling it/removing it (or replacing it with another library) might cause a lot of instability on your Joomla website and may render your Joomla website (especially its backend) completely inoperable. Please proceed carefully and, needless to say, at your own risk!</em></p>
<p>Some of our clients with advanced technical skills (who sub-contract to us) sometimes ask us to disable mootools on a Joomla website. We respond that it can be done, but at their own risk, since a lot of Joomla behavior (especially in the backend) is powered by mootools. So they tell us that they want to proceed anyway&#8230; Now the question is, how do we do it?</p>
<p>Well, there are several methods to do disable mootools on a Joomla website:</p>
<p><strong>Method #1: Delete the mootools files</strong></p>
<p>This method simply consists of deleting (through FTP) the mootools files that are included by Joomla. The mootools files to be deleted are the following:</p>
<ul>
<li>The <em>mootools-core.js</em> JavaScript file which is located under the <em>/media/system/js</em> directory.</li>
<li>The <em>core.js</em> JavaScript file which is also located under the <em>media/system/js</em> directory.</li>
</ul>
<p>The main advantages of this method is that it&#8217;s super fast, but on the flip side, you will be deleting a core Joomla file that you may need later!</p>
<p><strong>Method #2: Comment out the inclusion of mootools in Joomla&#8217;s core</strong></p>
<p>As <a href="http://www.itoctopus.com/how-to-override-the-default-mootools-javascript-library-in-a-module" title="How to override the default mootools JavaScript library in a module">mentioned earlier</a>, the mootools JavaScript library is included in the file <em>behavior.php</em> which is located under the <em>/libraries/joomla/html/html</em> directory. So, to comment out the inclusion of mootools, all you need to do is to comment out the following lines (lines 60-61) in the aforementioned file:</p>
<p><code><br />
		JHtml::_('script', 'system/mootools-' . $type . '.js', false, true, false, false, $debug);<br />
		JHtml::_('script', 'system/core.js', false, true);</code></p>
<p>This method is better than the first one because we are only commenting the inclusion of the files, and not deleting the files. The downside of this method, however, is that we are changing a core file (<em>behavior.php</em>). At itoctopus, changing core files is always a last resort option when everything else fails!</p>
<p><strong>Method #3: Develop a system plugin that will <em>unload</em> mootools</strong></p>
<p>In our opinion, developing a system plugin that will unload the mootools library is the best option (and it&#8217;s what we do). This is because you won&#8217;t be deleting any file and you won&#8217;t be changing a core Joomla file. Additionally, this whole thing (disabling mootools) can just be reversed/applied by just disabling/enabling the plugin! </p>
<p>This plugin is fairly simple. The XML manifest file is straightforward (just copy and paste the XML file of any simple system plugin [such as the <em>sef</em> plugin], change the name, and modify the necessary parameters to reflect the name change of that plugin), as for the PHP file, it&#8217;ll only need the following 5 lines of code in the <em>onAfterRender</em> function:</p>
<p><code><br />
	$objDocument = &#038;JFactory::getDocument();<br />
	$arrHeadData = $objDocument-&gt;getHeadData();<br />
	unset($arrHeadData['scripts'][JPATH_ROOT.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR.'system'.DIRECTORY_SEPARATOR.'js'.DIRECTORY_SEPARATOR.'mootools-core.js']);<br />
	unset($arrHeadData['scripts'][JPATH_ROOT.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR.'system'.DIRECTORY_SEPARATOR.'js'.DIRECTORY_SEPARATOR.'core.js']);<br />
	$objDocument-&gt;setHeadData($arrHeadData);<br />
</code></p>
<p>That&#8217;s it! Super simple, huh?</p>
<p>By the way, another advantage of using a system plugin is that it can be applied for specific components (and not the whole website). Also, with a system plugin, we can specify whether we want it to take effect on the frontend, the backend, or both (the code above will apply it on both because there&#8217;s no condition explicitly telling it to take effect exclusively on the frontend or exclusively on the backend).</p>
<p><strong>But why would anyone want to disable mootools?</strong></p>
<p>The main reason that anyone may want to disable mootools is if it&#8217;s causing conflicts on the website with another JavaScript library (which might be a previous version of mootools). We&#8217;ve seen this happening frequently on migrations from Joomla 1.5 to Joomla 2.5.</p>
<p>Now, if you&#8217;re reading the above and it seems like it&#8217;s written in a foreign language, then fear not, you&#8217;re certainly not alone, because this post is a bit technical! In any case, you can always <a href="http://www.itoctopus.com/contact-us" title="Contact us!">contact us</a> and we will definitely help you! <a href="http://www.itoctopus.com/fees" title="Our fees!">Our rates</a> are affordable, our work is swift and professional, and we really love to serve our clients!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itoctopus.com/how-to-disable-mootools-in-joomla/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
