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
// ==UserScript== | |
// @name Aliexpress | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://trade.aliexpress.com/orderList.htm* | |
// @grant unsafeWindow | |
// @grant GM_xmlhttpRequest | |
// @grant GM_setClipboard |
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
function insert_product ($product_data) | |
{ | |
$post = array( // Set up the basic post data to insert for our product | |
'post_author' => 1, | |
'post_content' => $product_data['description'], | |
'post_status' => 'publish', | |
'post_title' => $product_data['name'], | |
'post_parent' => '', |
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
//Order only from 1 shop | |
//https://www.wcvendors.com/help/topic/restrict-clientbuyer-to-order-from-one-vendor-at-a-time/ | |
add_filter( 'woocommerce_add_cart_item_data', 'woo_custom_add_to_cart' ); | |
function woo_custom_add_to_cart( $cart_item_data ) { | |
global $woocommerce; | |
$items = $woocommerce->cart->get_cart(); //getting cart items | |
$_product = array(); | |
foreach($items as $item => $values) { | |
$_product[] = $values['data']->post; | |
} |
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('wp_head', function () { | |
global $wp_scripts; | |
foreach($wp_scripts->queue as $handle) { | |
$script = $wp_scripts->registered[$handle]; | |
//-- Weird way to check if script is being enqueued in the footer. | |
if($script->extra['group'] === 1) { |
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 $password = 'abc'; | |
if (!preg_match('/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,12}$/', $password) ) { | |
$error['password_length'] = "Password must be at least 6 characters, containing at least one latter and one number"; | |
} |
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 | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
$ip = $_SERVER['HTTP_CLIENT_IP'];} | |
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip = $_SERVER['REMOTE_ADDR']; | |
} | |
$url = "http://api.wipmania.com/".$ip; | |
$country = file_get_contents($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 characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> | |
<select name="select1" id="select1"> | |
<option country-code="pk" value="Pakistan">Pakistan</option> | |
<option country-code="in" value="India">India</option> | |
<option country-code="us" value="Usa">USA</option> | |
<option country-code="uk" value="Uk">United Kingdom</option> | |
<option country-code="fr" value="France">France</option> | |
<option country-code="gr" value="Germny">Germny</option> | |
<option country-code="it" value="Italy">Italy</option> | |
<option country-code="ch" value="China">China</option> |
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
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
$ip = $_SERVER['HTTP_CLIENT_IP'];} | |
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip = $_SERVER['REMOTE_ADDR']; | |
} | |
$url = "http://api.wipmania.com/".$ip; | |
$country = file_get_contents($url); | |
echo $country; |
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
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "http://www.zillow.com/webservice/GetDeepSearchResults.htm", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", |
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( 'woocommerce_thankyou', 'bbloomer_redirectcustom'); | |
function bbloomer_redirectcustom( $order_id ){ | |
$order = new WC_Order( $order_id ); | |
$url = 'https://siteurl/thank-you-payment/'; //Thank you page | |
$mem_url = 'https://siteurl/payment-denied/'; // denied page | |
if ( $order->status == 'pending' ) { | |
wp_redirect($mem_url); | |
} | |
else{ |