Skip to content

Instantly share code, notes, and snippets.

View bi0xid's full-sized avatar
🏠
In Seville

Rafa Poveda bi0xid

🏠
In Seville
View GitHub Profile
@bi0xid
bi0xid / datebox-18-buddypress.php
Last active September 23, 2022 18:52
BuddyPress Datebox +18 (you have to be at least 18)
<?php
/**
* Datebox +18 xprofile field type.
*
* @since BuddyPress (2.0.1)
* @author bi0xid
*/
class BP_XProfile_Field_Type_Datebox18 extends BP_XProfile_Field_Type {
@bi0xid
bi0xid / access.php
Created November 3, 2016 08:59
Create a backdoor to WP access (softaculous)
<?php
@unlink(__FILE__);
// Validate if the request is from Softaculous
if($_REQUEST['pass'] != 'mv8gdj4ohqfxpu34yj5ursupfabcmvdm'){ // your password here
die("Unauthorized Access");
}
require('wp-blog-header.php');
require('wp-includes/pluggable.php');
<?php if ( jetpack_is_mobile() ) // if is mobile ?>
<?php else :
if (function_exists('is_amp_endpoint')) : //if is AMP
if (is_amp_endpoint()) : ?>
<?php else : // !is_amp_endpoint() ?>
<!-- DESKTOP ADS -->
git clone https://github.com/wpcomvip/xxxxx.git www/xxxxx/public_html/wp-content
git clone git@github.com:Automattic/vip-go-mu-plugins.git --recursive www/xxxxx/public_html/wp-content/mu-plugins/
wp user create bi0xid raven@bi0xid.es --role=administrator
@bi0xid
bi0xid / get_user_data.sql
Created June 12, 2018 10:31
Get ID, user login, user email, first name and last name from WordPress via SQL
SELECT DISTINCT us.ID, us.user_login, us.user_email, umeta.meta_value, umeta2.meta_value FROM wparl_users as us, wparl_usermeta as umeta, wparl_usermeta as umeta2 WHERE umeta.meta_key = 'first_name' AND umeta2.meta_key = 'last_name' AND umeta.user_id = us.ID AND umeta2.user_id = us.ID AND ( user_email = 'xxxxxx'
OR user_email = 'xxxxxxx'
OR user_email = 'xxxxxxxx');
@bi0xid
bi0xid / gist:e6138c0f0c949686a959
Created February 26, 2016 08:22
Permissions for WP
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;
var e = jQuery.Event("keydown");
e.which = 107; // # Some key code value
jQuery('.approve:visible').trigger(e, click);
jQuery('.approve:visible').click().trigger(e);
jQuery(".approve:visible").click(function(){
var e = jQuery.Event("keydown", { keyCode: 107, which: 107});
jQuery(".approve:visible").triggerHandler(e);
@bi0xid
bi0xid / cheatsheet.sql
Last active December 14, 2017 09:17
Cheatsheet for SQL creating a database
select host, user, password from mysql.user;
create database **********;
show databases;
create user '*******'@'%' identified by '**********';
grant all privileges on *********.* to '**********'@'%' identified by '**********';
flush privileges;
mysqldump -u root -p database > database.sql
mysql -u root -p wp_users < wp_users.sql
@bi0xid
bi0xid / # mysql - 2017-03-08_13-44-23.txt
Created March 8, 2017 13:02
mysql on macOS 10.12.3 - Homebrew build logs
Homebrew build logs for mysql on macOS 10.12.3
Build date: 2017-03-08 13:44:23
@bi0xid
bi0xid / prestashop_select.sql
Created February 17, 2017 09:43
Get list of prestashop users with emails
SELECT SQL_CALC_FOUND_ROWS
a.`id_order`, `reference`, `total_paid_tax_incl`, `payment`, a.`date_add` AS `date_add`
,
a.id_currency,
a.id_order AS id_pdf,
CONCAT(c.`firstname`,' ', c.`lastname`) AS `customer`,
c.email as email,
osl.`name` AS `osname`,
os.`color`,
IF((SELECT so.id_order FROM `ps_orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new,