Google Translate

Thứ Bảy, 21 tháng 2, 2015

Backup & Restore WordPress trên VPS – Cách làm thủ công

Khi đã sử dụng VPS rồi thì việc thao tác các dòng lệnh để tự mình backup và khôi phục dữ liệu thủ công trên đó bạn chắc chắn phải nắm được để linh hoạt hơn mà không phải lúc nào chúng ta có thể dựa vào các công cụ tự động hóa được.
Trong bài này, mình sẽ chỉ hướng dẫn các bạn backup các dữ liệu của website trên VPS. Còn các dữ liệu khác như cấu hình của VPS, Webserver,…thì bạn nên tự download các file đó về máy để cất giữ thì hay hơn.

Chủ Nhật, 1 tháng 2, 2015

HOW TO: Better way to Enable WordPress maintenance mode

WordPress is a great tool. It has its own way of managing updates to your website – and will switch to maintenance mode automatically.  For the best user experience you should enable maintenance mode yourself.

How to Enable Maintenance Mode without a Plugin – method 1

Activating maintenance mode without a plugin is easy. First, open your FTP program and then navigate to the root folder of you WordPress install.
Then create a new file and change the name to .maintenance – WordPress looks for this file and automatically maintenance mode has been turned on.
Once you’re done, you just need to rename or delete the .maintenance file

Enable Maintenance mode & allow access to WP-Admin – method 2

The preferred option for maintenance is a bit more graceful. Any visitors to your site will see a short message and any logged in or Admin users will still have access.
This is probably the best solution – giving the most control to you the web developer.
So this time … create a new file and paste this code:
[php]
<?php
function is_user_logged_in() {
$loggedin = false;
foreach ( (array) $_COOKIE as $cookie => $value ) {
if ( stristr($cookie, ‘wordpress_logged_in_’) )
$loggedin = true;
}
return $loggedin;
}
if ( ! stristr($_SERVER[‘REQUEST_URI’], ‘/wp-admin’) && ! stristr($_SERVER[‘REQUEST_URI’], ‘/wp-login.php’) && ! is_user_logged_in() )
$upgrading = time();
?>
[/php]
Then just save the file and rename it to  .maintenance as and when you need it.  You’ll have a great tool now that can protect your website while you tinker under the hood.
WordPress Maintenance Mode Screen
WordPress Maintenance Mode