// http://stackoverflow.com/questions/26581467/creating-woocommerce-order-with-line-item-programatically
$address = array(
'first_name' => 'Fresher',
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 characters
| <?php | |
| /** | |
| * This script will delete all `on-hold` subscriptions and their orders and users. | |
| * It will delete all subscriptions based on IP. | |
| * | |
| * wp eval-file delete-fraud-activity-by-ip.php 127.0.0.1 | |
| * | |
| * Dry run: | |
| * wp eval-file delete-fraud-activity-by-ip 127.0.0.1 dry | |
| * |
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 characters
| /* SET THE HOST AND PORT OF WooCommerce | |
| * *********************************************************/ | |
| backend default { | |
| .host = "127.0.0.1"; | |
| .port = "8080"; | |
| } | |
| # SET THE ALLOWED IP OF PURGE REQUESTS | |
| # ########################################################## |
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 characters
| <?php | |
| date_default_timezone_set('America/Los_Angeles'); | |
| session_start(); | |
| include("ratelimiter.php"); | |
| // in this sample, we are using the originating IP, but you can modify to use API keys, or tokens or what-have-you. | |
| $rateLimiter = new RateLimiter($_SERVER["REMOTE_ADDR"]); | |
| $limit = 100; // number of connections to limit user to per $minutes | |
| $minutes = 1; // number of $minutes to check for. |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
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 characters
| { | |
| "apiVersion": 2, | |
| "name": "my-affiliate-plugin/my-affiliate-block", | |
| "version": "0.1.0", | |
| "title": "Affiliate Block", | |
| "category": "design", | |
| "icon": "money", | |
| "keywords": [ "kinsta", "affiliate", "money" ], | |
| "description": "An example block for Kinsta readers", | |
| "supports": { |
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 characters
| <?php | |
| // το παρακάτω funtion παίρνει όλα τα products από ένα woo και φτιάχνει μια xml | |
| // τη γράφει σε ένα buffer ˚αι κάνει force να το κατεβάσεις. Όλα καλά μόνο που προσθέτει ένα | |
| // new line character πριν από το opening tag της xml και αν παςς να το διαβάσεις φαίνεται φυσικά σπασμένο | |
| // αν σβήσεις το new line τότε είναι valid xml | |
| function func_export_all_posts() { | |
| if(isset($_GET['export_all_posts'])) { | |
| $arg = array( | |
| 'post_type' => 'product', |
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 characters
| add_action( 'pre_get_posts', array( $this,'function_pre_get_posts' ) ); | |
| function function_pre_get_posts(){ | |
| // you can't use the query->set here for tax_query | |
| // as tax query has already been made | |
| // so you need to need add youself to any | |
| // existing tax query | |
| $tax_query = array( | |
| 'taxonomy' => 'tax_name', |
NewerOlder