Remove taxonomy base slug

It’s very easy to remove taxonomy base slug from url.

Suppose your old url like this : http://mysite.com/project-category/category1
and your new url like this : http://mysite.com/category1

You have couple of plugins for this.Some of are as under

1) Remove taxonomy base slug
remove-taxonomy-base-slug.

2) Seo ultimate
Seo ultimate

 

Install and configure plugin as per give instruction in plugin.

Enjoy It.

How To Speed Up WordPress

As a side note, these are not ordered by importance or any criteria, I’ve just gathered everything I’ve learned about speeding up page loads on WordPress and compiled them here.

I guarantee that using even a few will help speed up your site.

1. Choose a good host
2. Start with a solid framework/theme
3. Use an effective caching plugin
4. Use a content delivery network (CDN)
5. Optimize images (automatically)
6. Optimize your homepage to load quickly
7. Optimize your WordPress database
8. Disable hotlinking and leeching of your content
9. Add an expires header to static resources
10. Adjust Gravatar images
11. Add LazyLoad to your images
12. Control the amount of post revisions stored
13. Turn off pingbacks and trackbacks
14. Replace PHP with static HTML, when necessary
15. Use CloudFlare

Using PHP Copy to move files from server to server.

You can just create a php file in the destination server and load the file once in your browser. For example you add this code in http://destination-url/copy-files.php and in copy-files.php you add this php code:

     /*

  Transfer Files Server to Server using PHP Copy

*/

 

/* Source File URL */

$remote_file_url =http://origin-server-url/files.zip”

 

/* New file name and path for this file */

$local_file =files.zip”;

/* Copy the file from source url to server */

$copy = copy( $remote_file_url, $local_file );

/* Add notice for success/failure */

if( !$copy ) {

    echo “Doh! failed to copy $file…\n”;

}

else{

    echo “WOOT! success to copy $file…\n”;

}

How to send email using PHPMailer

First, download PHPMailer using the direct link below:

PHPMailer_5.2.0.zip

After you have downloaded the file, unzip and extract it to your public_html. After unzipping the file we have public_html/PHPMailer_5.2.0. Next you will need to edit your web pages to use the PHPMailer code.

Add the PHPMailer code to your site:

<?php
require("class.PHPMailer.php");

$mail = new PHPMailer();

$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "mail.hostname.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "USERNAME"; // SMTP username
$mail->Password = "PASSWORD"; // SMTP password

$mail->From = "from@example.com";
$mail->FromName = "Mailer";
$mail->AddAddress("josh@example.net", "Josh Adams");
$mail->AddAddress("ellen@example.com"); // name is optional
$mail->AddReplyTo("info@example.com", "Information");

$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML

$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";

if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}

echo "Message has been sent";
?>

Datetime of server and datetime of Magento don’t match

Datetime of server and datetime of Magento don’t match

Magento: Datetime of server and datetime of Magento don’t match

We’ve got the exact same issue happening; our server is CDT (GMT -5 hours) and it’s also set to Central time in Magento, but there’s several times when date() calls are performed when it returns the time in UTC (GMT+0 hours, effectively), thereby causing some dates and times to be off by 5 hours. What we did to fix it is:

1) Ensured the clock on our webserver was set to the correct time and time zone: http://www.wikihow.com/Change-the-Timezone-in-Linux
2) Ensured that PHP is set to the correct time zone: http://www.electrictoolbox.com/correct-php-timezone/
3) Ensured that Magento was also set to the correct time zone (System -> Configuration -> General)
4) Changed the default time zone in Magento from UTC to our timezone: edit app/code/core/Mage/Core/Model/Locale.php
Find line 30 and change to:
//const DEFAULT_TIMEZONE = ‘UTC’;
const DEFAULT_TIMEZONE = ‘Europe/Rome’; // Use your time zone as found in http://www.php.net/manual/en/timezones.php

5) Change the default timezon in file ‘app/Mage.php’

//date_default_timezone_set(‘UTC’);

date_default_timezone_set(‘Europe/Rome’);

Chances are high that your web server is already set up correctly, and if you’re not running a dedicated server your host will be the one to determine steps 1 & 2. Steps 3-4 are the important ones for you to do. Note that because you’re editing a core file, your changes will have to be re-applied each time you upgrade (as necessary).

Easy SMTP email settings for WordPress

add_action( ‘phpmailer_init’, ‘send_smtp_email’ );
function send_smtp_email( $phpmailer ) {

// Define that we are sending with SMTP
$phpmailer->isSMTP();

// The hostname of the mail server
$phpmailer->Host = “smtp.example.com”;

// Use SMTP authentication (true|false)
$phpmailer->SMTPAuth = true;

// SMTP port number – likely to be 25, 465 or 587
$phpmailer->Port = “587”;

// Username to use for SMTP authentication
$phpmailer->Username = “yourusername”;

// Password to use for SMTP authentication
$phpmailer->Password = “yourpassword”;

// Encryption system to use – ssl or tls
$phpmailer->SMTPSecure = “tls”;

$phpmailer->From = “you@yourdomail.com”;
$phpmailer->FromName = “Your Name”;
}