Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
<?php
new Advanced_Ads_Pro_AdSense_Public;

View File

@@ -0,0 +1,29 @@
<?php
/**
* Public AdSense functionality.
*/
class Advanced_Ads_Pro_AdSense_Public {
/**
* Constructor.
*/
public function __construct() {
$options = Advanced_Ads_Pro::get_instance()->get_options();
if ( ! empty( $options['cfp']['enabled'] ) ) {
add_filter( 'advanced-ads-gadsense-page-level-code', [ $this, 'overwrite_page_level_code' ], 10, 2 );
}
}
/**
* Overwrite the page-level code of the base plugin.
*
* @param string $code Existing code.
* @param array $parameters Parameters of the AdSense code.
* @return string $code New code.
*/
public function overwrite_page_level_code( $code, $parameters ) {
ob_start();
require_once __DIR__ . '/views/page-level.php';
return ob_get_clean();
}
}

View File

@@ -0,0 +1,51 @@
<?php
/**
* Output auto ads enabled code in head.
*
* This template is a drop-in replacement for the template of the base plugin.
*
* @var array $parameters {
* Parameters of the AdSense code.
*
* @type bool $privacy_enabled Whether to wait for user consent.
* @type bool $npa_enabled Whether to show non-personalized ads.
* @type string $client_id The Google AdSense client ID.
* @type bool $top_anchor AdSense anchor ad on top of pages.
* @type string $top_anchor_code The code for top anchor ads.
* @type string $script_src AdSense script url.
* }
*
*/
?><script>
(function () {
var scriptDone = false;
document.addEventListener( 'advanced_ads_privacy', function ( event ) {
if (
( event.detail.state !== 'accepted' && event.detail.state !== 'not_needed' && ! advads.privacy.is_adsense_npa_enabled() )
|| scriptDone
|| advads.get_cookie( 'advads_pro_cfp_ban' )
) {
return;
}
// Google adsense script can only be added once.
scriptDone = true;
var script = document.createElement( 'script' ),
first = document.getElementsByTagName( 'script' )[0];
script.async = true;
script.src = '<?php echo esc_url( $parameters['script_src'] ); ?>';
<?php
if ( $parameters['top_anchor'] ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- relevant user input has already been escaped.
echo $parameters['top_anchor_code'];
} else {
printf( 'script.dataset.adClient = "%s";', esc_attr( $parameters['client_id'] ) );
}
?>
first.parentNode.insertBefore( script, first );
} );
} )();
</script>