View wp-login-with-sha1-password.php
<?php
// check if hashed password is SHA1 and update as necessary, see function comments
add_filter( 'check_password', 'check_sha1_password', 10, 4 );
/**
* Check if a user has a SHA1 password hash, allows login if password hashes match, then updates password hash to wp format
*
* Hooks into check_password filter, mostly copied from md5 upgrade function with pluggable.php/wp_check_password
*
* @param string $check
View import-image-fix.md

When an image is imported, the name used in the media library is derived from the URL "basename". This can cause problems, especially when using the option "Search through the Media Library for existing images before importing new images". For example, even though they are different images, these URLs all have the same "basename" (in bold). They will generate the same file my-image.jpg in the WordPress library:

http:// example.com/ my-image.jpg
http:// example.com/ my-image?id=1
http:// example.com/subfolder/ my-image.jpg

The solution is to put this PHP code in your function editor:

function fix_img_url($url){
View query_cyrillic_attribute_values.md

XPath doesn't allow you to make queries with Cyrillic symbols. Solutions:

Scenario One

If the values that you're importing do not contain commas, you can use a PHP function to query them.

File Structure

<?xml version="1.0" encoding="utf-8"?>
View import-if-syntax.md

WP All Import - IF/ELSE statement examples

Here are some example WP All Import [IF] statements. The criteria for an IF statment is written in XPath 1.0 syntax and can use XPath functions. Although powerful, XPath syntax can be quite complex. In many cases it might be easier to use a PHP function as shown here.

The [ELSE]<something> part is optional

Number is equal to:

[IF({price[.=0]})]Zero[ELSE]Not Zero[ENDIF]

View Modify import file before import
add_action( 'pmxi_before_xml_import', 'wp_all_import_before_xml_import', 10, 1 );
function wp_all_import_before_xml_import( $import_id ) {
$path = false;
$import = new PMXI_Import_Record();
$import->getById( $import_id );
if ( ! $import->isEmpty() ) {
switch ($import->type) {
case 'url':
View gist:2e26ff65a20c88b80c08e37783d38da2
add_action( 'pmxi_saved_post', 'post_saved', 10, 1 );
function post_saved( $id ) {
global $wpdb;
$pass = get_user_meta( $id, 'xfer_user_pass', true );
$table = $wpdb->prefix . 'users';
$wpdb->query( $wpdb->prepare(
"
UPDATE `" . $table . "`
SET `user_pass` = %s
View wp-increase-timeout.md
View data_feed.php
<?php
/*
################### READ ME #################################
You must create a proxy file that retrieves your import file from FTP and then returns it.
You will then call that file with the 'Download from URL' option in WP All Import.
This is an example of such a proxy file. This is provided in the hopes it is useful, but without any support.
###############################################################
*/
$ftp = array(
'server' => 'ftp.example.com',
View import-ftp-proxy.php
<?php
// Note: Anyone could access your data if they guess this URL. You should remove this file from the server
// after importing or name it to something "unguessable". For even better security use an .htaccess rule.
//
// If you're experiencing problems you can uncomment the following line so errors will be sent to the file.
// ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
//
// Enter the FTP (or HTTP) URL of your data file below. IMPORTANT: This must contain the FULL PATH of the
// file. PHP seems to always start from the root folder rather than the default folder for the given user.
$url = "ftp://username:password@hostname.com/full/path/to/file.csv";
View att_id.md

Sometimes you might need to look up the attachment id for an imported image (or other media library file) to accommodate a third party plugin. You can use this code in the function editor.

/* Returns attachment ID for the given filename, path or URL. Argument can be a
 * URL or local file path because this will only look at the file basename. Ex - These
 * would return the same thing:
 * $id = img_id("myfile.jpg");
 * $id = img_id("http://domain.com/images/myfile.jpg");
 */
function att_id($image_filename) {