-
-
Save trey8611/b7df39e7c5b09776c0ffc17dd4e2ead1 to your computer and use it in GitHub Desktop.
Revisions
-
trey8611 revised this gist
May 7, 2020 . No changes.There are no files selected for viewing
-
m-thomson revised this gist
Sep 2, 2017 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,7 @@ // 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. $url = "ftp://username:[email protected]/full/path/to/file.csv"; // These headers aren't strictly needed but can be helpful -
Mark Thomson revised this gist
Feb 1, 2017 . No changes.There are no files selected for viewing
-
Mark Thomson revised this gist
Feb 1, 2017 . No changes.There are no files selected for viewing
-
Mark Thomson revised this gist
Jan 22, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ <?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:[email protected]/full/path/to/file.csv"; -
Mark Thomson revised this gist
Jan 22, 2017 . 1 changed file with 8 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,13 @@ <?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 here. 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:[email protected]/full/path/to/file.csv"; // These headers aren't strictly needed but can be helpful header('Content-Type: text/plain'); -
Mark Thomson revised this gist
Dec 15, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ // These headers aren't strictly needed but can be helpful header('Content-Type: text/plain'); header('Content-Disposition: attachment; filename="ftp-proxy-data.txt"'); header('Pragma: no-cache'); // Fetch the file and echo it -
Mark Thomson renamed this gist
Dec 15, 2016 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,8 @@ <?php /* * Note: Anyone could access your data if they guess this URL. You should remove * this file from the server after importing or rename it to something "unguessable" * like 'proxy-24dxfi3.php'. For even better security use an .htaccess rule. */ // Enter the FTP (or HTTP) URL of your data file here. -
Mark Thomson revised this gist
Dec 15, 2016 . 3 changed files with 19 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ <?php /* * Security note: Anyone could access your data if they guess this URL. * You should remove this file from the server after importing or rename * to something "unguessable" (e.g. 'ftp-proxy-24dxfi3.php') But understand, * that method is not perfectly secure. For best security use an .htaccess * rule allowing access only from localhost. */ // Enter the FTP (or HTTP) URL of your data file here. $url = "ftp://username:[email protected]/path/to/file.csv"; // These headers aren't strictly needed but can be helpful header('Content-Type: text/plain'); header('Content-Disposition: attachment'); header('Pragma: no-cache'); // Fetch the file and echo it readfile($url); -
Mark Thomson revised this gist
Dec 15, 2016 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ <?php /* Security note: Anyone could access your data if they guess this URL.We recommend either removing this file from the server after you've run your import or renaming this file to something "unguessable" (e.g. 'ftp-proxy-24dxfi3.php') but understand that method is not perfectly secure. For best security use an .htaccess rule allowing access only from localhost. */ // Enter the FTP (or HTTP) URL of your data file here. $url = "ftp://username:[email protected]/path/to/file.csv"; -
Mark Thomson revised this gist
Dec 15, 2016 . 2 changed files with 1 addition and 29 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,4 @@ For example, you could have a PHP script on your server called `ftp-proxy.php` a `http://example.com/ftp-proxy.php` *Security note: Anyone could access your data if they guess this URL.We recommend either removing this file from the server after you've run your import or renaming this file to something "unguessable" (e.g. 'ftp-proxy-24dxfi3.php') but understand that method is not perfectly secure. For best security use an .htaccess rule allowing access only from localhost.* This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,28 +0,0 @@ -
Mark Thomson created this gist
Dec 15, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ Since WP All Import only supports fetching data files over HTTP or HTTPS, many users employ their own proxy script in PHP to act as an intermediary. This script would read the data file from the FTP server and output it over HTTP (for consumption by WP All Import). For example, you could have a PHP script on your server called `ftp-proxy.php` and then tell WP All Import to import from that URL: `http://example.com/ftp-proxy.php` Security note: Anyone could access your data if they guess this URL.We recommend either removing this file from the server after you've run your import or renaming this file to something "unguessable" (e.g. 'ftp-proxy-24dxfi3.php') but understand that method is not perfectly secure. For best security use an .htaccess rule allowing access only from localhost. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <?php // Enter the FTP (or HTTP) URL of your data file here. $url = "ftp://username:[email protected]/path/to/file.csv"; // These headers aren't strictly needed but can be helpful header('Content-Type: text/plain'); header('Content-Disposition: attachment'); header('Pragma: no-cache'); // Fetch the file and echo it readfile($url); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ <?php // These headers aren't strictly needed but can be helpful header('Content-Type: text/plain'); header('Content-Disposition: attachment'); header('Pragma: no-cache'); // Enter the FTP (or HTTP) URL of your data file here. $url = "ftp://username:[email protected]/path/to/file.csv"; // Open remote file if (($handle = fopen($url, "r")) !== false) { // Read each line while (($line = fgets($handle, 4096)) !== false) { // Output each line from the file as it is read. If needed, you could even filter the output here. // e.g: echo str_replace("foo", "bar", $line); echo $line; } fclose($handle); } else { // You might want to code some better error handling here. echo "Error: failed to open remote file\n"; }