When you’re migrating WordPress (or any other platform using serialized PHP
strings in the database) between domains, you must use a safe search and replace
method that preserves the integrity of the serialized string lengths. A simple
of a dump file for http://localhost to, for
example, http://thenewdomain.com is
problematic because the length of the string changes but the indexes for the
serialized strings does not. Consequently settings are lost and widgets
disappear. Not good.
This script can now also handle multiply nested serializations, which can
happen in transient values in WP at times, and it can also handle multi-byte
Unicode changes safely. This is important now that internationalised domain
names are allowed.
It’s worth mentioning that the code will work for any platform that stores
PHP serialized arrays in a MySQL database. You can easily use this script on
Drupal, Joomla and many other systems where you need to change items across a
database without messing up your stored arrays.
Pokud chcete pochopit, jak vlastně samotný WordPress funguje, určitě vám
pomůže základní znalost struktury jeho databáze. Ta se zkládá z celkem 11
tabulek, které ještě mohou rozšiřovat pluginy. Každá má svůj prefix,
nejčastěji wp_, který se nastavuje běhěm instalace WordPressu a
vytváření databáze. comments, commentmeta První dvě tabulky obsahují
informace o komentářích na webu. V [...]
Načtení ID a nadpisů čtyř nejnovějších příspěvků
a jejich seřazení podle počtu komentářů (sestupně):
$posts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish'
AND post_type='post' ORDER BY comment_count DESC LIMIT 0,4")
// Echo the title of the first scheduled post
Objekt $results obsahuje pole s výsledky.
get_row načte pouze jediný záznam z tabulky:
$posts = $wpdb->get_row("SELECT ID, post_title FROM wp_posts WHERE post_status = 'publish'
AND post_type='post' ORDER BY comment_count DESC LIMIT 0,1")
// Echo the title of the most commented post
get_col načte celý sloupec:
$posts = $wpdb->get_col("SELECT ID FROM wp_posts WHERE post_status = 'publish'
AND post_type='post' ORDER BY comment_count DESC LIMIT 0,10")
// Echo the ID of the 4th most commented post
get_var načte jedinou hodnotu:
$email = $wpdb->get_var("SELECT user_email FROM wp_users WHERE user_login = 'danielpataki' ")
// Echo the user's email address
// $wpdb->update($table, $data, $where, $format = null, $where_format = null);
// $where parameter - can be an array in the form of column-value pairs:
$wpdb->update( $wpdb->posts, array("post_title" => "Modified Post Title"), array("ID" => 5), array("%s"), array("%d") );
WP CSV to Database plugin allows you to insert CSV file content into
WordPress database. Useful when you want to bulk upload data from your CSV file
(e.g. product details) to the WordPress database in one go.
DB-Toolkit allows you to build web applications within WordPress. From
manager interfaces to capture forms to content viewers or almost any type.
DB-Toolkit is not a simple plugin and has a steep learning curve, but the
results are very rewarding.
Field-by-field data type handling makes data management very powerful and
Data exporting in PDF and CSV * Create API's to connect to your data. This
allows you to build mobile apps that feed from your content.
Multi Interface Layouts using clusters * Build custom content managers, like
galleries, contact lists, application forms, employee databases... and so
Import data from an XML or CSV source * Visually build forms that capture
data to a database existing or not.
Want to add and manage custom database tables from the admin area? This
plugin contains several easily modified examples. This plugin folder contains 2
suites of plugins. The Club Manager Plugin contains 4 Plugins - Programme (of
Events), Stop Press, Recent Events and News. The Specialists Plugin contains a
more generic example of the management of a many to many link table between a
number of "specialists" and their "specialisms". It also demonstrates the use of
left joins and lookup tables. Code to sort data by clicking on the table head
and to filter the selection set has also been added. They are based upon a more
generic system which allows creating and adding data to custom database tables
from the wordpress control panel. These plugins can be used as a template for
creating different types of table and display or you can just use them as they
are if they do what you want to do.
A dangerously powerful plugin that will allow you to access and update your
database tables in your weblog administrator. Uses AJAX and TableKit to update
field data. Simple and fast. Just click, edit, and submit.
Chystaný WordPress 3.2 se zaměřuje hlavně na optimalizaci a zrychlení
načítání webu a v této souvislosti byl objeven docela zajímavý trik. Jde
o „neveřejný“ parametr no_found_rows, který může být využit např. ve
funkcích query_posts(), WP_Query() či get_posts(), ale skoro nikdo o něm
neví a moc se nepoužívá, i když dokáže v mnoha případech zjednodušit
některé prováděné [...]
Plugin maps tables and entries created by plugins in your database. It also
shows you which ones are used by which plugin and whether this plugin is active,
inactive or deleted, so you can decide if you want to keep or delete those
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
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:
Generate and Store the backups
Move the backup and restore script to the new location
Restore the backup by launching the XCloner.php restore script
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.
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
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