Zálohování a obnova

**UpdraftPlus Backup and Restoration**
„https://wordpress.org/plugins/updraftplus/“:https://wordpress.org/plugins/updraftplus/

Simplifies backups (and restoration). Backup into the cloud (Amazon S3 (or compatible), Dropbox, Google Drive, Rackspace Cloud, DreamObjects, FTP, SFTP, SCP, WebDAV, OpenStack Swift and email) and restore with a single click. Backups of files and database can have separate schedules.

UpdraftPlus is the highest-ranking backup plugin on rankwp.com (ranks in the top 40 out of 30,000 WordPress plugins for quality on rankwp.com – last checked 21 September 2014).

Widely tested and reliable (over 1.8 million downloads). Ranks in the top 100 most used of all WordPress plugins on rankwp.com. Millions of backups completed!

*Alternativy*

**XCloner – Backup and Restore**
„http://wordpress.org/extend/plugins/xcloner-backup-and-restore/“:http://wordpress.org/extend/plugins/xcloner-backup-and-restore/

XCloner is a Backup and Restore component designed for PHP/Mysql websites, it can work as a native plugin for WordPress and Joomla!.

XCloner design was specifically created to Generate custom backups of any LAMP website through custom admin inputs, and to be able to Restore the clone on any other location with the help of the automatic Restore script we provide, independent from the main package!

XCloner Backup tool uses Open Source standards like TAR and Mysql formats so you can rest assured your backups can be restored in a variety of ways, giving you more flexibility and full control.

XCloner Generate, Move and Restore process:

1. Generate and Store the backups
2. Move the backup and restore script to the new location
3. Restore the backup by launching the XCloner.php restore script

**Duplicator**
„http://wordpress.org/extend/plugins/duplicator/“:http://wordpress.org/extend/plugins/duplicator/

The Duplicator plugin is designed to give WordPress Administrators the ability to migrate a site from one location to another location in 3 easy steps. Just create a package, download it and install. No need to change all your settings and re-run import/export scripts. The plugin also serves as a simple backup utility.
This tool is great for pulling a production site down onto your local machine for testing and validation. It also works great for developing locally and then pushing up to a production server.

It reduces the process to three easy steps:

1. Create a package

2. Download

3. Install in the new location

**EZPZ One Click Backup**
„http://wordpress.org/extend/plugins/ezpz-one-click-backup/“:http://wordpress.org/extend/plugins/ezpz-one-click-backup/

EZPZ One Click Backup is a very easy way to do a complete backup and restoring of your entire WordPress site. In fact it’s so easy to use there are no required user settings, everything is automatic. Just one click and presto, you’ll have a complete backup stored on your server. One more click and you can download the entire backup to your own computer.

If you prefer to download your backup via FTP the path you’ll need is also included. EZPZ OCB also stores your last backup on the server in case you ever need to download it again.

With the new EZPZ Easy Restore restoring your site is a simple two step process.

**BackUpWordPress**
„http://wordpress.org/extend/plugins/backupwordpress/“:http://wordpress.org/extend/plugins/backupwordpress/

Simple automated backups of your WordPress powered website. BackUpWordPress will back up your entire site including your database and all your files.

**WordPress Database Backup**
„http://austinmatzko.com/wordpress-plugins/wp-db-backup/“:http://austinmatzko.com/wordpress-plugins/wp-db-backup/

(Pouze) databázi lze zazálohovat manuálně uložením na server, vlastní počítač nebo posláním na email, ev. automaticky ve zvoleném intervalu.

**myEASYbackup**
„http://wordpress.org/extend/plugins/myeasybackup/“:http://wordpress.org/extend/plugins/myeasybackup/

Backup, restore, migrate your WP installation, both code and MySQL tables, with a single click.

**WP Staging – DB & File Duplicator & Migration**
„https://wordpress.org/plugins/wp-staging/“:https://wordpress.org/plugins/wp-staging/

This duplicator plugin allows you to create an staging or development environment in seconds.
It creates a file clone of your website into a subfolder of your current WordPress installation with an entire copy of your database. This sounds pretty simple and yes it is! All the hard time consumptive database and file copy stuff including url replacements is done in the background. For testing new plugins and updates first before installing them on live website.

Zvýraznění právě hledaných slov

Několik následujících řádků kódu obalí všechna právě vyhledávaná klíčová slova do značky STRONG (class search-keyword). Kód je možné vložit do function.php ve Vašem template. Nebo jej můžete vložit rovnou do search.php někde těsně za volání funkce get_header(). Předpokladem samozřejmě je, že využíváte standardních vyhledávacích funkcí WordPress.

function omSearchHeighlight($text)
{
$keys = explode(" ", get_search_query());
$text = preg_replace('/('.implode('|', $keys) .')/iu', '<strong class="search-keyword">\0</strong>', $text);
return $text;
}

add_filter('the_title','omSearchHeighlight');
add_filter('the_content','omSearchHeighlight');
add_filter('the_excerpt','omSearchHeighlight');

// nezapomeňte strong element nastylovat např.
// strong.search-keyword {background: #f3ff0f!important; color:#000!important;}

Výsledkem je malé, ale užitečné, vylepšení výsledků vyhledávání, které Vás navíc nestojí téměř žádnou námahu. Ještě malá poznámka na závěr: Kód nedbá na velikost písmen.

Snadné stránkování bez pluginu

Pokud chcete své příspěvky ve WordPress stránkovat, musíte obvykle sáhnout po nějakém pluginu. Což rozhodně není ideální řešení. Stránkování obsahu je prostě základní funkce. Je škoda, že to WordPress neumí bez nějakého zbytečného pluginu!

Jenže on to umí. V administraci se stránkování obsahu používá téměř všude. Což mimo jiné znamená, že na to existuje funkce. Stačí ji tedy jen dobře použít:

$pagination = array(
	'base' => get_pagenum_link().'%_%',
	'format' => 'page/%#%',
	'total' => ceil($wp_query->found_posts / get_settings('posts_per_page')),
	'current' => absint( get_query_var( 'paged' ) ),
	'show_all' => false,
	'prev_next' => true,
	'prev_text' => __('&laquo; Previous'),
	'next_text' => __('Next &raquo;'),
	'end_size' => 3,
	'mid_size' => 5,
	'type' => 'plain',
	'add_args' => false,
	'add_fragment' => ''
);

echo paginate_links($pagination);

Funkce paginate_links má řadu vstupních parametrů, které jsou podrobně popsány v dokumentaci.

Nejdůležitější je samozřejmě total – měl by obsahovat počet stránek. Ten jsem vypočítal jako zaokrouhlený podíl celkového počtu příspěvku a počtu příspěvků na stránku (tohle se nastavuje se v administraci).

Parametr current by měl obsahovat číslo aktuálně prohlížené stránky. Zjistíte jej snadno pomocí get_query_var. Další dva neméně důležité parametry jsou baseformat – pomocí kterých se tvoří URL odkazu.

Base by měl obsahovat základní část URL. Což je ta část, které se při procházení jednotlivých stránek nemění. Nenapadl mě lepší způsob, než zavolat funkci get_pagenum_link. Řetězec %_% bude při tvorbě URL nahrazen obsahem parametru format.

Format je ono samotné stránkování. Měl by obsahovat tu část URL, která se bude měnit. V mém příkladu využívám tzv. hezké URL. Takže číslo stránky je očekávané za page. Řetězec %#% bude nahrazen čísly. Výsledná URL tak bude vypadat například takto http://www.nabito.net/page/2

Ostatní parametry jsou spíš doplňkové.

Odstranění části admin menu

WordPress není systém, který by nabízel přebujelé množství funkcí. Administrace je jednoduchá a přehledná. Přesto se občas může hodit, nějakou tu funkci natvrdo schovat před nenechavým klikáním zákazníka.

Celé administrátorské menu je uložené v souboru wp-admin/menu.php – do toho samozřejmě sahat nebudeme. Tento soubor nám postačí k tomu, abychom zjistili jak se menu tvoří. Menu je uložené ve dvou polích: $menu$submenu. Obě tyto pole můžeme svobodně upravit, protože se jedná o globální proměnné. Svobodně upravit znamená například část vymazat. Úpravu těchto polí musíme samozřejmě stihnout před tím, než se pole použijí při vykreslování menu.

Do souboru function.php, který najdete ve wp-content/template/cokoliv, stačí přidat nový hook a funkci:

function edit_remove_menu() {
  global $menu, $submenu;
  unset($menu[25]); // odstraní z menu komentáře
  unset($menu[15]); // odstraní z menu odkazy

  // dale je mozne upravit také submenu
  unset($submenu['edit.php'][15]); // odstraní Příspěvky / Štítky
}

add_action('admin_menu', 'edit_remove_menu');

Na závěr malé upozornění, jednotlivé skryté funkcionality nadále fungují, pouze nejsou vidět v menu. Takže pokud znáte tu správnou adresu, můžete se k nim normálně dostat.

Integrování obsahu z Facebooku

**Embed Facebook**
„http://wordpress.org/extend/plugins/embed-facebook/“:http://wordpress.org/extend/plugins/embed-facebook/

Plugin that makes the process of posting Facebook content in WordPress ridiculously simple: Paste the URL (of a facebook album, picture, video, page, or event) and the plugin will automatically embed the related object. The only requirement is that the object must be public and should belong to a Facebook Page.

Vybrané free šablony pro WordPress

WPTuts
********

[* http://cdn.wplift.com/wp-content/uploads/2011/08/99.png 300×203 *]

„Demo »“:http://www.aoclarkejr.com/themes/wptuts/category/category/
„Download »“:http://www.wpexplorer.com/downloads/wptuts.zip

Big Square
********

[* http://media.smashingmagazine.com/wp-content/uploads/2011/07/wp2.jpg 300×241 *]

„Demo »“:http://demo.wordspop.com/bigsquare
„Download »“:http://downloads.wordspop.com/big-square-1.1.zip

Suburbia
*******

[* http://wpmu.org/wp-content/uploads/2010/10/suburbia.png 300×150 *]

„Demo »“:http://suburbia.wpshower.com/
„Download »“:http://wpshower.com/free-wordpress-themes/suburbia-free-wordpress-theme/

Sideblog
******

[* http://wpmu.org/wp-content/uploads/2010/10/sideblog.png 300×150 *]

„Demo »“:http://www.press75.com/themes/side-blog/
„Download »“:http://www.press75.com/blog/side-blog-wordpress-theme/

Aparatus
*******

[* http://cdn.wpbeginner.com/wp-content/uploads/2010/12/Picture-221-300×126.png *]

„Demo »“:http://aparatus.fearlessflyer.com/
„Download »“:http://fearlessflyer.com/downloads/aparatus.zip

Masugid
*******

[* http://images.naldzgraphics.net/2010/07/2-masugid.jpg 300×150 *]

„Demo »“:http://www.paddsolutions.com/wpmag/masugid/
„Download »“:http://www.paddsolutions.com/wordpress-theme-masugid/

Boldly
*******

[* http://bloggingexperiment.com/wp-content/uploads/free-wordpress-theme-2011-boldly.jpg 300×203 *]

„Demo »“:http://wordpress.site5.net/boldy/
„Download »“:http://gk.site5.com/t/325

SimplyBiz
*******

[* http://wplift.com/wp-content/uploads/2011/01/205.jpg 300×203 *]

„Demo »“:http://wpcrunchy.com/demo/?wptheme=simplybiz
„Download »“:http://wpcrunchy.com/downloads/62

Businezz
*******

[* http://www.blogohblog.com/wp-content/pop/2010/05/businezz-free-wordpress-theme.png 300×300 *]

„Demo »“:http://businezz.blogohblog.net/
„Download »“:http://www.blogohblog.com/download/businezz.zip

Satoshi
*******

[* http://wpmu.org/wp-content/uploads/2011/04/Satoshi.jpg 300×170 *]

„Demo »“:http://vooshthemes.com/gallery/satoshi-v2/
„Download »“:http://www.vooshthemes.com/wordpress-theme/satoshi-2/

Paragams
*******

[* http://media.smashingmagazine.com/wp-content/uploads/2011/07/wp4.jpg 300×224 *]

„Demo »“:http://paragrams.wpshower.com/
„Download »“:http://wpshower.com/paragrams.zip

Melville
*******

[* http://media.smashingmagazine.com/wp-content/uploads/2011/03/sm_wordpress_theme_c.jpg 300×180 *]

„Demo »“:http://demo.madebyraygun.com/melville/
„Download »“:http://cdn2.madebyraygun.com/x/wp-content/uploads/2010/12/melville.zip

Diary
*******

[* http://cdn.wplift.com/wp-content/uploads/2011/08/166.png 300×203 *]

„Demo »“:http://www.wpdiarytheme.com/preview/
„Download »“:http://gk.site5.com/t/361

Přizpůsobení administračního rozhraní

**White Label CMS**
„http://wordpress.org/extend/plugins/white-label-cms/“:http://wordpress.org/extend/plugins/white-label-cms/

The White Label CMS plugin is for developers who want to give their clients a more personalised and less confusing CMS.
Allows customization of dashboard and logos, removal of menus, giving editors access to widgets and menus plus lots more.

White Label CMS allows you to remove all the panels from the WordPress dashboard and insert your own panel, which you can use to write a personalised message to your client and link to the important elements in the CMS.

It also allows you to add custom logos to the header and footer as well as the all important login page, giving your client a better branded experience of using their new website.

There is also the option to hide the nag updates as well.

*Alternativy:*

**Web Editors CMS**
„http://wordpress.org/extend/plugins/web-editors-cms/“:http://wordpress.org/extend/plugins/web-editors-cms/

A collection of plugins that optimize WordPress 3 to use (and brand!) as a CMS. Includes our custom plugins and some extra’s. It is intended as an all-in-one package. Using this plugin in combination with the recommended plugins will turn WordPress into a perfect dream CMS tool that you can use for your customers. This plugin will let you know what other plugins to install. You will find the configuration settings in the „Settings >> Web Editors CMS“ menu.

This plugin is intended to make worpdress a CMS… something to dummy down the admin interface for your customers with you branded name it. We recommend a lot of plugins; setting user roles and knowing how to code PHP is really a must especially when using Pods. If this is not you then this plugin is probably not for you.
Features:

– Brand WordPress
– Customize Dashboard
– Add Permalink shortcodes into CMS
– Multiple content blocks
– Cleans up Messy Dashboard
– Easily edit pages from admin menu – Adds all pages in drop down of admin pages menu

**WPlite**
„http://wordpress.org/extend/plugins/wplite/“:http://wordpress.org/extend/plugins/wplite/

Lets you hide ‚unnecessary‘ items from the WordPress administration menu—even the Dashboard. On top of that, you can also hide post meta controls on the Write page, so as to simplify the editing interface.

**iMasters WP Hacks**
„http://wordpress.org/extend/plugins/imasters-wp-hacks/“:http://wordpress.org/extend/plugins/imasters-wp-hacks/

A solution to personalize the WordPress admin to final users. Hide some widgets, show anothers, hide menu itens and controll what your client can see.

**

**Custom Admin Branding**
http://wordpress.org/extend/plugins/custom-admin-branding/

The Custom Admin Branding Plugin allows you to brand and customize the WordPress administration area for clients or for personal use. You can display custom images and styles for the login screen, admin header and footer.

**Úprava administračního rozhraní pomocí actions a filters:**
„http://sixrevisions.com/wordpress/how-to-customize-the-wordpress-admin-area/“:http://sixrevisions.com/wordpress/how-to-customize-the-wordpress-admin-area/
„http://loneplacebo.com/how-to-customize-wordpress-admin-area/“:http://loneplacebo.com/how-to-customize-wordpress-admin-area/

„Viz též »“:https://wordpresso.ovx.cz/uprava-administracniho-rozhrani-pomoci-functions/

„10 Techniques for Customizing the WordPress Admin Panel »“:http://sixrevisions.com/wordpress/10-techniques-for-customizing-the-wordpress-admin-panel/

Údržbový mód

**WP Maintenance Mode**
„http://wordpress.org/extend/plugins/wp-maintenance-mode/“:http://wordpress.org/extend/plugins/wp-maintenance-mode/

Adds a maintenance-page to your blog that lets visitors know your blog is down for maintenancetime. User with rights for theme-options get full access to the blog including the frontend. Activate the plugin and your blog is in maintenance-mode, works and see the frontend, only registered users with enough rights. You can use a date with a countdown for informations the visitors or set a value and unit for infomrations. Also you can add urls for exlude of maintenance mode.

You can add your own html and stylesheet and add the url of this style to the options of the plugin.

**Maintenance Mode Without Plugin**

/—code php
function wp_maintenance_mode(){
if(!current_user_can(‚edit_themes‘) || !is_user_logged_in()){
wp_die(‚

Chystá se.

Zkuste to později.‘);
}
}
add_action(‚get_header‘, ‚wp_maintenance_mode‘);
\—

Speciální šablona pro všechny příspěvky v konkrétní kategorii

O různých zobrazení vybraných příspěvků, stránek a kategorií jsem napsal již dva články:

Speciální šablona pro konkrétní rubriku, stránku či příspěvek
Dvě různé WordPress šablony na jednom blogu

Pokud ale chceme pro všechny příspěvky v dané kategorii užít rozdílný layout, a vůbec jinou šablonu, se slug a id si moc nevystačíme. V tom případě budeme muset využít komplikovanější techniky.

Musíme si vytvořit “prakticky prázný” soubor single.php, který bude obsahovat pouze rozhodovací algoritmus. Na to využijeme WordPress funkce in_category()php funkce include() ve spolupráci s WordPress konstantou TEMPLATEPATH.

Obsah bude následující (v případě, že chceme speciální šalonu pro příspěvky v rubrice speciální a moje kategorie):

<php 
if ( in_category( array('specialni', 'moje-kategorie' ) ) ) {
 include (TEMPLATEPATH.'single-specialni.php');
}else {
 include (TEMPLATEPATH.'single-normalni.php');
}
?>

Přičemž soubor single-normalni.php bude obsahovat původní obsah souboru single.php. Popřípadě, pokud do této doby neexistoval single.php, obsah souboru index.php. A soubor single-specialni.php bude obsahovat upravený kód vašeho speciálního zobrazení všech příspěvků v kategorii speciální a moje kategorie.

Pozor, soubor single-normalni.php a single-specialni.php musí obsahovat get_header() a get_footer(), jako každý jiný tradiční soubor WordPress šablony. Jen, dle tohoto článku, upravený soubor single.php tyto funkce obsahovat nesmí.

Jak vytvářet speciální hlavičky a patičky a sidebary jsem probíral v předchozím článku.