This file contains 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_filter( 'robots_txt', function( $output, $public ) { | |
$add = "# 0. Un robot no puede perjudicar a la Humanidad ni, por omisión, permitir que la Humanidad sufra daño.\n"; | |
$add .= "# 1. Un robot no debe perjudicar a un ser humano ni, por omisión, permitir que un ser humano sufra daño, salvo cuando esto vulnere la Ley Cero.\n"; | |
$add .= "# 2. Un robot debe obedecer las órdenes que le son dadas por un ser humano, excepto si estas órdenes entran en conflicto con la Primera Ley.\n"; | |
$add .= "# 3. Un robot debe proteger su propia existencia, hasta donde esta protección no entre en conflicto con la Primera o la Segunda Ley.\n"; | |
return $add . $output; | |
}, 99, 2 ); |
This file contains 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
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteRule ^(.*)$ https://sitioproduccion.com/$1 [QSA,L] | |
# Para entornos NGINX me ha funcionado poner lo siguiente en la configuración | |
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp|pdf)$ { | |
try_files $uri @image_fallback; | |
} | |
location @image_fallback { |
This file contains 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 | |
/** | |
* SOAP Test for Redsys. | |
* | |
* @package WooCommerce Redsys Gateway (https://woocommerce.com/es-es/products/redsys-gateway/) | |
* @copyright José Conti | |
*/ | |
if ( ! class_exists( 'SoapClient' ) ) { | |
echo 'ATENCIÓN, SOAP NO ACTIVO'; |
This file contains 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 | |
spl_autoload_register(function($required_file) { | |
# Transform file name from class based to file based | |
$fixed_name = strtolower( str_ireplace( '_', '-', $required_file ) ); | |
$file_path = explode( '\\', $fixed_name ); | |
$last_index = count( $file_path ) - 1; | |
$file_name = "class-{$file_path[$last_index]}.php"; | |
# Get fully qualified path |