13 cara mengamankan wordpress anda

1. Create Custom Login Links

It is very obvious that in order to access the WordPress admin panel, all one has to do is type in the url of the site with /wp-login.php. Now if you used a same password in more than one location, and it was jeopardized then it is easy for the hacker to hack your site. A plugin called Stealth Login allows you to create custom URLs for logging in, logging out, administration and registering for your WordPress blog. You can also enable “Stealth Mode” which will prevent users from being able to access ‘wp-login.php’ directly. You can then set your login url to something more cryptic. This won’t secure your website perfectly, but if someone does manage to crack your password, it can make it difficult for them to find where to actually login. This also prevents any bots that are used for malicious intents from accessing your wp-login.php file and attempting to break in.

2. Pick a Strong Password

This is a very obvious step, but we must mention it as it can’t be emphasized enough. Do not use the same password in other places. Try to make each password different and hard to guess. Use the WordPress Password Strength Detector to your advantage and make your password strong. Another thing you want to do is change your password periodically, so even if some has guessed your password, it is useless to them once you have changed it.

Continue reading

Mengkunci www pada url website pakai .htaccess

Code:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*) http://www.mydomain.com/$1 [L,R=301]

copy kode di atas pada .htaccess dalam root website kamu, kalau .htacess belum ada silakan buat sendiri. Dalam kode rewrite di atas setiap user masuk lewat mydomain.com akan langsung diredirect 301 menuju http://www.namadomain.tld

Trus apa keuntungannya mengkunci www.?
Sebenarnya ini adalah salah satu teknik seo, supaya tidak terjadi duplicate indexing pada website kamu. Selain itu kamu juga bisa memilih selalu memakai www (www.namadomain.tld) atau selalu tidak memakai www (http://www.namadomain.tld). Gw sendiri memilih selalu memakai www karena penggunaan www sangat umum dipakai. Tapi sebelum mencoba kode di atas coba dulu apakah http://namadomain.tld dan www.namadomain.tld meunuju tempat yg sama

Selamat Mencoba!!!

mengubah file image kedalam format Text menggunakan PHP Script

Ever wanted to create those text made roses and heart shapes that you see in Facebook and Myspace? You might be wondering how they create such. However there are some websites that does the job, you may still be curios to do it by yourself. They convert your image file in to a text which exactly renders as an image. If you are still unclear what I am talking about then see how this JPEG image is manipulated to text.

You might be surprised that this manipulation can be done just by PHP code not more than 30 lines.
We’ll do this just by a PHP code.

Let me show you how can you use PHP imagecreatefromjpeg() function to manipulate the pixeleted image in ASCII character form.
First of all let’s summarize what we’ll do.

Continue reading

contoh plugin wordpress related post

Setelah membuat tutorial ini maka saya lanjutan untuk pembuatan cara pembuatan plugin wp sederhana yaitu rlated post

//related post shortcode
function related_posts_shortcode( $atts ) {

    extract(shortcode_atts(array(
        'limit' => '5',
    ), $atts));

    global $wpdb, $post, $table_prefix;

    if ($post->ID) {

        $retval = '
<ul>';

        // Get tags
        $tags = wp_get_post_tags($post->ID);
        $tagsarray = array();
        foreach ($tags as $tag) {
            $tagsarray[] = $tag->term_id;
        }
        $tagslist = implode(',', $tagsarray);

        // Do the query
        $q = "
            SELECT p.*, count(tr.object_id) as count
            FROM $wpdb->term_taxonomy AS tt, $wpdb->term_relationships AS tr, $wpdb->posts AS p
            WHERE tt.taxonomy ='post_tag'
                AND tt.term_taxonomy_id = tr.term_taxonomy_id
                AND tr.object_id  = p.ID
                AND tt.term_id IN ($tagslist)
                AND p.ID != $post->ID
                AND p.post_status = 'publish'
                AND p.post_date_gmt < NOW()
            GROUP BY tr.object_id
            ORDER BY count DESC, p.post_date_gmt DESC
            LIMIT $limit;";

        $related = $wpdb->get_results($q);

        if ( $related ) {
            foreach($related as $r) {
                $retval .= '
    <li><a title="'.wptexturize($r->post_title).'" href="'.get_permalink($r->ID).'">'.wptexturize($r->post_title).'</a></li>
';
            }
        } else {
            $retval .= '
    <li>No related posts found</li>
';
        }
        $retval .= '</ul>
';
        return $retval;
    }
    return;
}
add_shortcode('related_posts', 'related_posts_shortcode');

dari kode diatas yg di modif hanya menambahkan identifikasi, merubah

return $retval;

jadi

//related post shortcode
return get_the_content().’relatedpost’
Related Posts:
‘.$retval.”; // menambah get_the_content() dan format html

dan menambahkan kode dibawah untuk memodifikasi the_content

add_action(‘the_content’,'related_posts_shortcode’);

Referensi

1 & 2

tekhnik dasar Pembuatan plugin WordPress

Kadangkala untuk memodif wordpress biasanya kita edit2 themenya terutama yg sering di edit adalah functions.php nah daripada klo nanti themenya di ganti trus themenya di otak atik lagi mending kita bikin pluginnya aja.

dalam contoh kali ini ane akan bikin “List Tags tanpa link” karena kmren2 SEO booster Pro disalah satu post ane ngasilin tags sampai ribuan dan ini ga baik bs menyebabkan penalti google makanya linknya harus dihapus, biasanya klo manual tinggal replace <?php the_tags(); ?> dengan kode di bawah ke single.php atau bisa juga di index.php atau archieve.php

< ?php $articletags = strip_tags(get_the_tag_list('',', ','' )); echo $articletags; ?>

tapi klo untuk dibuat plugin wordpress buat file berekstensi php dan masukan identifikasi dibawah ini tepat dibawah kode

  1. < ?php
  2. /*
  3. Plugin Name: List Tags tanpa link
  4. Plugin URI: http://www.ipangsan.web.id/
  5. Description: Menampilkan list tags tanpa link jika ada fungsi the_tags (single.php, index.php)
  6. Author: creatorVersion: 0.1
  7. Author URI: http://www.ipangsan.web.id
  8. */
  9. ?>

kemudian masukan kode
add_action('the_tags','strip_tags');

strip_tags diatas adalah fungsi php untuk menghilangkan kode html temasuk link dan komplit kodenya

Continue reading