Skip to content

Instantly share code, notes, and snippets.

View Programmer095's full-sized avatar

Cory Hyland Programmer095

  • Earth
View GitHub Profile
@trey8611
trey8611 / data_feed.php
Last active January 18, 2019 19:47
#proxyscript
<?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.
###############################################################
Instructions:
* Copy the code below to a new php file in the root of your WP site
* Update the FTP server details
@KittenCodes
KittenCodes / delete_empty_export.php
Last active March 20, 2019 16:39
Delete empty export files created by WP All Import
<?php
/*
################### READ ME #################################
Hooks into pmxe_after_export and deletes the export files if no posts were found.
This is provided in the hopes it is useful, but without any support.
###############################################################
Instructions:
The code needs to be added to your theme functions.php or by using a plugin like Code Snippets:
https://wordpress.org/plugins/code-snippets/
###############################################################
@mbissett
mbissett / Import Types.md
Last active April 27, 2021 11:07 — forked from trey8611/Import Types.md
WP All Import - Import Types

A description of import types

  • New Items Import -

This is primarily used to create and manage products. It keeps internal track of the products that it imports, which means that it can later update/create/delete products as they're changed/added/removed in your import file. It's also the only import type that can add/remove variations for variable products.

One limitation of new items imports is that cannot detect/update products that it didn't previously create. If you need to use a "New Items" import with a file that contains existing products, you can use WP All Import's API to prevent duplicates from being imported: https://www.wpallimport.com/documentation/developers/code-snippets/#do-not-create-products-with-duplicate-sku.

@trey8611
trey8611 / Import Types.md
Last active July 26, 2021 12:56 — forked from KittenCodes/Import Types.md
WP All Import - A description of different import types "New Items" and "Existing Items"

A description of import types

  • New Items Import -

This is primarily used to create and manage products. It keeps internal track of the products that it imports, which means that it can later update/create/delete products as they're changed/added/removed in your import file (see: http://www.wpallimport.com/documentation/recurring/update-import). It's also the only import type that can add/remove variations for variable products.

One limitation of new items imports is that cannot detect/update products that it didn't previously create. If you need to use a "New Items" import with a file that contains existing products, you can use WP All Import's API to prevent duplicates from being imported: https://www.wpallimport.com/documentation/developers/code-snippets/#do-not-create-products-with-duplicate-sku.

  • Existing Items Import -
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
@gonzopancho
gonzopancho / gist:760ab9ecee9dfbc1b6033e48647a4b48
Created February 10, 2018 20:40
pfSense software 2.4.3 on espresso.bin (now booting from SD card)
NOTICE: Booting Trusted Firmware
NOTICE: BL1: v1.3(debug):armada-17.06.2:297d68f
NOTICE: BL1: Built : 11:01:44, Jan 9 2NOTICE: BL2: v1.3(debug):armada-17.06.2:297d68f
NOTICE: BL2: Built : 11:01:47, Jan 9 2018NOTICE: BL31: v1.3(debug):armada-17.06.2:297d68f
NOTICE: BL31:
U-Boot 2017.03-armada-17.06.3-ga33ecb8-dirty (Jan 09 2018 - 10:56:45 -0200)
Model: Marvell Armada 3720 Community Board ESPRESSOBin
CPU @ 1000 [MHz]
@elvismdev
elvismdev / jenkins_wpsvn_deploy.sh
Last active August 30, 2022 18:35 — forked from BFTrick/deploy.sh
Deploy from Jenkins to WordPress.org SVN
# In your Jenkins job configuration, select "Add build step > Execute shell", and paste this script contents.
# Replace `______your-plugin-name______`, `______your-wp-username______` and `______your-wp-password______` as needed.
# main config
WP_ORG_USER="______your-wp-username______" # your WordPress.org username
WP_ORG_PASS="______your-wp-password______" # your WordPress.org password
PLUGINSLUG="______your-plugin-name______"
CURRENTDIR=`pwd`
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin
@trey8611
trey8611 / append_acf_repeater_data.md
Last active November 2, 2022 09:18
WP All Import & ACF Add-On - How to append data to repeaters | pmxi_saved_post

Append ACF Repeater Data

It's not possible to append a row to an ACF repeater field without a custom code workaround that utilizes our API: http://www.wpallimport.com/documentation/developers/action-reference/.

The following is an example to show you how this can be done. You will almost certainly need to adjust the code snippet to make it work with your data/site.

  1. Create a new "Manual Record Matching" import that updates the post(s): http://www.wpallimport.com/documentation/recurring/manual-record-matching/

  2. Store the ACF data in your own dummy custom field: http://d.pr/i/3Si4ad.

@m-thomson
m-thomson / import-image-fix.md
Last active June 23, 2023 14:12
WP All Import duplicate image problem

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){
<?php
/*
################### READ ME #################################
You'll pass the URL to your feed/file to this function inside the "Download from URL" option when creating an import.
Image examples: https://d.pr/hCfNek and https://d.pr/MnerNb.
1. [custom_file_download("ftp://username:password@hostname.com/full/path/to/file.csv","csv")]
2. [custom_file_download("http://example.com/full/path/to/file.csv","csv")]