Skip to content

Instantly share code, notes, and snippets.

View agrogeek's full-sized avatar

Sebas MGC agrogeek

View GitHub Profile
@agrogeek
agrogeek / .env
Created September 30, 2021 10:14
Fichero en la raiz de instalación de Prestashop. Invalid token: direct access to this link may lead to a potential security breach. Token no válido: el acceso directo a este enlace puede provocar una posible violación de seguridad
_TOKEN_=disabled
@agrogeek
agrogeek / prestashop_disable_https_ssl.sql
Created September 30, 2021 05:35
Deshabilitar HTTPS (SSL) desde la base de datos en instalación de Prestashop. Revisar también .htaccess. To disable HTTPS (SSL) from data base in Prestashop.
UPDATE `ps_configuration`
SET `value` = 0
WHERE `name` = 'PS_SSL_ENABLED';
UPDATE `ps_configuration`
SET `value` = 0
WHERE `name` = 'PS_SSL_ENABLED_EVERYWHERE';
@agrogeek
agrogeek / gist:54b5093e132fb15b31b580b8c3cfcab2
Created September 29, 2021 06:59
WP: Sorry, you are not allowed to access this page - Tras export de database
UPDATE newprefix_usermeta SET meta_key = REPLACE(meta_key, 'oldprefix_', 'newprefix_') WHERE meta_key LIKE '%oldprefix_%';
UPDATE newprefix_options SET option_name = REPLACE(option_name, 'oldprefix_', 'newprefix_') WHERE option_name LIKE '%oldprefix_%';
@agrogeek
agrogeek / wp-optimice-woocommerce-cookies
Created July 8, 2021 13:04
Cookies de woocomerce excluidas del caché de wp-optimice
> wp-optimice/cache/advanced/cookies
woocommerce_*
wp_woocommerce_session
@agrogeek
agrogeek / custom-woocommerce.js
Created June 22, 2021 10:22
Fix bug open Side Cart Plugin (https://wordpress.org/support/plugin/side-cart-for-woocommerce/) with Pre Order Woocommerce plugin (https://codecanyon.net/item/wordpress-woocommerce-pre-order-plugin/20052905) - Wordpress, Woocommerce, Side Cart For Woocommerce plugin, WordPress WooCommerce Pre Order Plugin
// Fix bug open Side Cart Plugin (https://wordpress.org/support/plugin/side-cart-for-woocommerce/) with Pre Order Woocommerce plugin (https://codecanyon.net/item/wordpress-woocommerce-pre-order-plugin/20052905)
// add wfc_pslide_atc to single_add_to_cart_button
jQuery('.single_add_to_cart_button').addClass('wfc_pslide_atc');
@agrogeek
agrogeek / functions.php
Created March 18, 2021 06:18
Optimizaciones para WordPress (jquery migrate, pingbacks, emojis)
/* Desahbilitar jquery migrate */
function montanera_remove_jquery_migrate( &$scripts ) {
if( !is_admin() ) {
$scripts->remove( 'jquery' );
$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.12.4' );
}
}
add_filter( 'wp_default_scripts', 'montanera_remove_jquery_migrate' );
@agrogeek
agrogeek / dequeue-invisible-recaptcha.php
Created December 16, 2020 15:28
WP HACK - dequeue script google-invisible-recaptcha plugin in front pages
add_action('wp_print_scripts', function (){
if( !in_array( $GLOBALS[ 'pagenow' ], array( 'wp-login.php', 'OTHER PAGES WITHOUT INVISIBLE RECAPTCHA' ), true ) ){
wp_dequeue_script( 'google-invisible-recaptcha' );
}
});
@agrogeek
agrogeek / wp-cli: create block gutenberg
Created June 17, 2020 14:15
Comando de WP CLI para crear arquitectura de un bloque Gutenberg
wp scaffold block <slug-block> --title="<title-block>" --category=<category> --theme
@agrogeek
agrogeek / screenshots.php
Created May 31, 2020 12:01
Make screenshots with PHP
<?php
//index.php
$screen_shot_image = '';
if(isset($_POST["screen_shot"]))
{
$url = $_POST["url"];
$screen_shot_json_data = file_get_contents("https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=$url&screenshot=true");
@agrogeek
agrogeek / Disabled panels WP editor.txt
Created April 29, 2020 14:52
Deshabilitar paneles del editor de WP desde código
// remove excerpt panel
wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'post-excerpt' );
Here is an (incomplete) list of panel IDs:
taxonomy-panel-category - Category panel.
taxonomy-panel-CUSTOM-TAXONOMY-NAME - Custom taxonomy panel. If your taxonomy is topic, then taxonomy-panel-topic works.
taxonomy-panel-post_tag - Tags panel
featured-image - Featured image panel.
post-link - Permalink panel.
page-attributes - Page attributes panel.