Sunday, October 27, 2013

How to Revoke or Cancel an SSL Certificate at Godaddy?

  
Step 1. Log in to your Account Manager.
Step 2:Click SSL Certificates.
Step 3: Click Launch for the certificate you want to revoke.



   Step 4: From the Filters list, click Certificates.


    Step 5: Click the common name of the certificate you want to revoke.


   Step 6:  Click Revoke.



    Step 7: Select a reason from the Revocation Reason menu.





    Step 8: Click Revoke to revoke your certificate.
Read More

Monday, October 21, 2013

How to install wordpress manually?

Most web hosts now offer automatic install of WordPress (ex. Fantastico, Mojo, etc.). But if you wish to install WordPress yourself, here's a simple tutorial to follow in less than 5 minutes.

Step 1. Go to WordPress.org and download Wordpress latest version.
Step 2. Extract the zip file.
Step 3. Open the folder, and upload all contents to the root directory of your domain. ex. /public_html/yourdomain.com
Step 4.  Follow your hosting instructions how to create database.  Here's the steps I followed in Bluehost.
Read More

How to put adsense below post title in Blogger.com?

In order to maximize my adsense revenue, I've tried different locations to place my adsense. One of the best spots is below the post title because readers can easily glance it once they are on your page.  Aside from that,  ads placement below post title will help increase Click Through Rate (CTR). However you should not rely on this, keep on experimenting to determine what's best for your blog.  I'll show you of one of my blogs which has link unit ads with a size 728 x 15
.

Read More

Sunday, October 20, 2013

Migrating Wordpress Sites by WP-Twin Plugin

How to Clone:

Step 1: Upload wptwin.php file into root files of the domain.  

Step 2: Then visit: myoldblogname.com/wptwin.php

Step 3: Press click to proceed; then login to your blog  with admin name and password;


Step 4:  Click to clone (don't include non-wordpress folders because we have add-on domains)

Step 5:  Download the clone file to your computer;  once you are sure you have a copy, then delete the clone (click red button)  


Read More

How to install wordpress in Bluehost?

Step 1: In your Bluehost cPanel,  click WordPress icon under Website Builders section. You will be directed to Mojo Marketplace.


Read More

Saturday, October 19, 2013

How to migrate Wordpress Site from Hostgator to Bluehost manually?

What if the free migrating plugins you are using do not work at all,  or if all else fails, then your last resort would be migrating sites manually. Migrating WordPress site by hand requires a lot of effort and time, but for me this is the safest way to retrieve all your files without experiencing lots of problems. 

I'm not a programmer nor expert in Cpanel, but once you dedicate your time in "learning by doing", all other difficult things become easy. I'll share with you how I migrate WordPress site with less headaches.


Here's how to get started.

From Hostgator:

Step 1: Back up all your WordPress files which is located in the home or root folder of your WordPress installation. Select all files, then click compressed icon. Choose zip archived, then click compressed tab.


Read More

How to Change DNS at GoDaddy?

Step 1: Login to your account with your GoDaddy username and password.

Step 2. Click "My Account Tab". Below you can see domains, web hosting, email, etc, then click Launch Tab found at the right of domain.


Read More

Friday, October 18, 2013

Setting Up Rel="Author" Tag in Blogger

Do you want to appear your photo in Google Search Results like I do?  (see photo below.) If yes, embed now an HTML markup code known as rel="author" to your blog in order to claim your articles as yours.   When set up correctly, a head shot will appear in search results that will make you stand out than the rest. Authorship adds credibility to your blog, thus it will improve readership. Here's an easy tutorial how to link your Google Plus profile to your blog.



Google Plus

Step 1. Create an account in Google Plus. 
Step 2: Fill in necessary information. Be sure to upload the best picture of yours. This will appear in Google search results
Step 3: Go to Google profile >> navigate About menu on top >> then scroll down>> click the Contributor To section on the right.

Read More

Thursday, October 17, 2013

Create, Retrieve, Update, Delate Page

Create Page

	function wpcreatepage(){
		$title = $_REQUEST['title'];
		$content = $_REQUEST['content'];
		$userid = $_REQUEST['userid'];
		$my_post = array(
			  'post_title'    => wp_strip_all_tags($title ),
			  'post_content'  => $content,
			  'post_status'   => 'publish',
			  'post_author'   => $userid,
			  'post_type'     => 'page',
		);
		$pid = wp_insert_post( $my_post );
		echo $pid;
		die();
	}

Retrieve Page

	function wpeditpage(){
		$pageid = $_REQUEST['pageid'];
		$post = get_post( $pageid, ARRAY_A);
		echo json_encode($post);
		die();
	}

Update Page

	function wpupdatepage(){
		$title = $_REQUEST['title'];
		$content = $_REQUEST['content'];
		$pageid = $_REQUEST['pageid'];
	
		$my_post = array();
		$my_post['ID'] = $pageid;
		$my_post['post_title'] = wp_strip_all_tags($title);
		$my_post['post_content'] = $content;
	
		// Update the post into the database
		wp_update_post( $my_post );
		die();
	}

Delete Page

	function wpdeletepage(){
		$pageids = rawurldecode($_REQUEST['pageids']);
		$pageid = rawurldecode($_REQUEST['pageid']);
		
		if(!empty($pageid)){
			echo wp_delete_post($pageid);
		}else if(!empty($pageids)){
			$pageids = explode(",",$pageids);
			foreach($pageids as $id){
				echo wp_delete_post($id);
			}
		}
		
		die(); 
	}

Read More

Create / Retrieve / Update / Delete POST

Create Post

	function wpcreatepost(){
		$title = $_REQUEST['title'];
		$content = $_REQUEST['content'];
		$userid = $_REQUEST['userid'];
		$my_post = array(
			  'post_title'    => wp_strip_all_tags($title ),
			  'post_content'  => $content,
			  'post_status'   => 'publish',
			  'post_author'   => $userid,
			  'post_type'     => 'post',
		);
		$pid = wp_insert_post( $my_post );
		echo $pid;
		die();
	} 
 
 

Retrieve Post

function wpeditpost(){ $postid = $_REQUEST['postid']; $post = get_post( $postid, ARRAY_A); echo json_encode($post); die(); }


Update Post

	function wpupdatepost(){
		$title = $_REQUEST['title'];
		$content = $_REQUEST['content'];
		$postid = $_REQUEST['postid'];
	
		$my_post = array();
		$my_post['ID'] = $postid;
		$my_post['post_title'] = wp_strip_all_tags($title);
		$my_post['post_content'] = $content;
	
		// Update the post into the database
		wp_update_post( $my_post );
		die();
	} 
 

Delete Post

function wpdeletepost(){ $postid = rawurldecode($_REQUEST['postid']); $postids = rawurldecode($_REQUEST['postids']); if(!empty($postid)){ echo wp_delete_post($postid); }else if(!empty($postids)){ $postids = explode(",",$postids); foreach($postids as $id){ echo wp_delete_post($id); } } die(); }
 

 
Read More

Update User Info

                $user_data = array(
		'ID' => $userid,
		'user_login' => $loginName,
		'first_name' => $firstName,
		'last_name' => $lastName,
		'user_email' => $email
	       );
 
	        echo wp_update_user( $user_data ) ;
Read More

Create WP User and send email notification

function wpcreateuser(){

		$loginName = rawurldecode($_REQUEST['login']);
		$firstName = rawurldecode($_REQUEST['firstname']);
		$lastName = rawurldecode($_REQUEST['lastname']);
		$email = rawurldecode($_REQUEST['email']);
		
		$user_data = array(
			'ID' => '',
			'user_pass' => wp_generate_password(),
			'user_login' => $loginName,
			'display_name' => $loginName,
			'first_name' => $firstName,
			'last_name' => $lastName,
			'user_email' => $email,
			'role' => get_option('default_role') // Use default role or another role, e.g. 'editor'
		);
		
		$tempPass = genTempPassword(8);
		$user_id = wp_insert_user( $user_data );
		wp_set_password($tempPass, $user_id);
		
		$headers = "From: Wordpress <".get_bloginfo('admin_email').">\r\n".'X-Mailer: PHP/' . phpversion();
		$subject = "[".get_bloginfo('name')."] Your username and password";
		$siteurl = get_bloginfo('siteurl')."/wp-login.php";
		$msg = wordwrap("Username: ".$loginName." \r\n "."Password: ".$tempPass." \r\n ".$siteurl);
		
		wp_mail($email, $subject, $msg, $headers);
		die();
	}
	
	function genTempPassword ($length = 8)
	{
		// given a string length, returns a random password of that length
		$password = "";
		// define possible characters
		$possible = "0123456789abcdfghjkmnpqrstvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
		$i = 0;
		// add random characters to $password until $length is reached
		while ($i < $length) {
			// pick a random character from the possible ones
			$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
			// we don't want this character if it's already in the password
			if (!strstr($password, $char)) {
				$password .= $char;
				$i++;
			}
		}
		return $password;
	}
Read More

Get WP user and Delete wp user

Get WP user

	$blogusers = get_users('orderby=display_name&order=ASC');
	$users = array();
	foreach($blogusers as $user){
		$users[] = array(
			"ID"=>$user->ID,
			"user_login"=>$user->user_login,
			//"user_pass"=>$user->user_pass,
			"user_nicename"=>$user->user_nicename,
			"user_email"=>$user->user_email,
			"user_registered"=>$user->user_registered,
			"display_name"=>$user->display_name
		);
	}
	echo json_encode($users);
 
 

Delete wp user

echo wp_delete_user($id);

 

 
Read More

Update WP Version

<?php
 function wpupgrade(){
  $reinstall = false;
  global $wp_filesystem;
 
  if ( $reinstall )
   $url = 'update-core.php?action=do-core-reinstall';
  else
   $url = 'update-core.php?action=do-core-upgrade';
  $url = wp_nonce_url($url, 'upgrade-core');
  if ( false === ($credentials = request_filesystem_credentials($url, '', false, ABSPATH)) )
   return;
 
  //$version = isset( $_POST['version'] )? $_POST['version'] : false;
  $version = '3.5.1';
  $locale = isset( $_POST['locale'] )? $_POST['locale'] : 'en_US';
  $update = find_core_update( $version, $locale );
  if ( !$update )
   return;
 
  if ( ! WP_Filesystem($credentials, ABSPATH) ) {
   request_filesystem_credentials($url, '', true, ABSPATH); //Failed to connect, Error and request again
   return;
  }
 ?>
  <div class="wrap">
  <?php screen_icon('tools'); ?>
  <h2> <?php _e('Update WordPress'); ?></h2>
 <?php
  if ( $wp_filesystem->errors->get_error_code() ) {
   foreach ( $wp_filesystem->errors->get_error_messages() as $message )
    show_message($message);
   echo '</div>';
   return;
  }
 
  if ( $reinstall )
   $update->response = 'reinstall';
 
  $result = wp_update_core($update, 'show_message');
 
  if ( is_wp_error($result) ) {
   show_message($result);
   if ('up_to_date' != $result->get_error_code() )
    show_message( __('Installation Failed') );
   echo '</div>';
   return;
  }
 
  show_message( __('WordPress updated successfully') );
  show_message( '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a target="_blank" href="%2$s">Learn more</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' );
  ?>
  </div>
 }
Read More

Get latest wp version

 $request = wp_remote_post( 'http://api.wordpress.org/core/version-check/1.6/', array('body' => array('action' => 'version')));
 
 if (!is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200) {  
  echo json_encode(unserialize($request['body']));  
 }
 
 
 
 

get wordpress version

global $wp_version; echo $wp_version;
 
Read More

Ajax Post

add_action( 'wp_ajax_wptest', 'wptest' );
 add_action( 'wp_ajax_nopriv_wptest', 'wptest' );
 
 function wptest(){
  echo 'test';
  die();
 }
Read More

SQL Select Post

SELECT * 
 FROM wp_terms 
 INNER JOIN wp_term_taxonomy ON wp_terms.term_id = wp_term_taxonomy.term_id 
 INNER JOIN wp_term_relationships wpr ON wpr.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id 
 INNER JOIN wp_posts p ON p.ID = wpr.object_id
Read More

Curl

$url = "http://isanghamak.appspot.com/";
 
 $curl = curl_init();
 curl_setopt ($curl, CURLOPT_URL, $url);
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
 $result = curl_exec ($curl);
 curl_close ($curl);
 
 echo $result;
Read More

Check Browser Code

$u_agent = $_SERVER['HTTP_USER_AGENT']; 
 if(preg_match('/MSIE/i',$u_agent)) { 
  //ie
 }else if(preg_match('/Chrome/i',$u_agent)){
  //chrome
 }else if(preg_match('/webkit/i',$u_agent)){
  //safari
 }else if(preg_match('/Firefox/i',$u_agent)){
  //firefox
 }
Read More

Get Wp Plugins

function getWpPlugins(){
  $array_Plugins = get_plugins();
  $plugins1 = array();
  $active_plugins = get_option('active_plugins');
 
  foreach($array_Plugins as $plugin_file => $data) {
   $status = 'inactive';
 
   if (array_search($plugin_file,$active_plugins)){
    $status = 'active';
   }
   $plugins1[] = array(
    "Status" => $status,
    "Name" => $data['Name'],
    "PluginURI" => $data['PluginURI'],
    "Version" => $data['Version'],
    "Description" => $data['Description'],
    "Author" => $data['Author'],
    "AuthorURI" => $data['AuthorURI'],
    "TextDomain" => $data['TextDomain'],
    "DomainPath" => $data['DomainPath'],
    "Network" => $data['Network'], 
    "Title" => $data['Title'],
    "AuthorName" => $data['AuthorName'],
    "Path"=>$plugin_file
   );
  }
  return $plugins1;
 }
Read More

Get Wp Themes Code

function getWpThemes(){
  $themes_ = get_themes();
  $themes_ = array_keys($themes_);
  
  $current = get_option("template");
  $arr_theme = array();
  $themes = search_theme_directories();
  $i=0;
  foreach($themes as $theme=>$item){
   $active = $current==$theme?"Current Theme":"Activate";
   $arr_theme[] = array("name"=>$theme,"status"=>$active,"title"=>$themes_[$i]);
   $i++;
  }
  return $arr_theme;
 }
Read More

Tuesday, October 8, 2013

How to flush dns in Windows XP?

Step 1: Click the Start button.

Step 2: On the Start menu, click Run....


Read More

Creating add-on domain at Bluehost

Step 1: Log into your Bluehost Control Panel.


Read More

Monday, October 7, 2013

How to Change DNS at Namecheap?

Step 1. Login to your account with your Namecheap username and password.

Step 2. On top left, mouse hover to "Domain's tab ,  and locate manage domains.

Step 3. Click on the domain you would like to change DNS.

Step 4. On the left menu under General Settings, find  Domain Name Server Setup tab then click.


Read More
Powered By Blogger · Designed By Seo Blogger Templates