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,32 @@
<?php
/**
* Render Adsense meta box on ad edit screen.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
* @var string $report_type Value is 'domain'.
* @var string $report_filter Filter to be used.
* @var string $pub_id Adsense ID.
*/
$pub_id = Advanced_Ads_AdSense_Data::get_instance()->get_adsense_id();
// Early bail!!
if ( ! $pub_id ) {
esc_html_e( 'There is an error in your AdSense setup.', 'advanced-ads' );
return;
}
Advanced_Ads_Overview_Widgets_Callbacks::adsense_stats_js( $pub_id );
$arguments = [
'type' => $report_type,
'filter' => $report_filter,
];
$report = new Advanced_Ads_AdSense_Report( $report_type, $report_filter );
echo '<div class="advanced-ads-adsense-dashboard" data-arguments="' . esc_js( wp_json_encode( $arguments ) ) . '">';
echo wp_kses_post( $report->get_markup() );
echo '</div>';

View File

@@ -0,0 +1,43 @@
<?php
/**
* Render additional information below the text area on the ad edit page
* currently "plain text" and "rich content" ad types
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
*
* phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
*/
use AdvancedAds\Utilities\Validation;
if ( defined( 'WP_DEBUG' ) && WP_DEBUG &&
( $error = Validation::is_valid_ad_dom( $ad ) ) ) : // phpcs:ignore ?>
<p class="advads-notice-inline advads-error">
<?php
esc_html_e( 'The code of this ad might not work properly with the Content placement.', 'advanced-ads' );
?>
&nbsp;
<?php
printf(
wp_kses(
/* translators: %s is a URL. */
__( 'Reach out to <a href="%s">support</a> to get help.', 'advanced-ads' ),
[
'a' => [
'href' => [],
],
]
),
esc_url( admin_url( 'admin.php?page=advanced-ads-settings#top#support' ) )
);
?>
<span style="white-space:pre-wrap"><?php echo $error; ?></span>
</p>
<?php
endif;
do_action( 'advanced-ads-ad-params-below-textarea', $ad );

View File

@@ -0,0 +1,108 @@
<?php
/**
* Render Layout/Output meta box on ad edit screen.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
*/
use AdvancedAds\Admin\Upgrades;
use AdvancedAds\Options;
?>
<div class="advads-ad-positioning">
<?php echo ( new Advanced_Ads_Ad_Positioning( $ad ) )->return_admin_view(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<div class="advads-option-list">
<hr class="advads-hide-in-wizard"/>
<label class='label advads-hide-in-wizard' for="advads-output-wrapper-id">
<?php esc_html_e( 'container ID', 'advanced-ads' ); ?>
</label>
<div class="advads-hide-in-wizard">
<input type="text" id="advads-output-wrapper-id" name="advanced_ad[output][wrapper-id]" value="<?php echo esc_attr( $ad->get_wrapper_id() ); ?>"/>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Specify the id of the ad container. Leave blank for random or no id.', 'advanced-ads' ); ?>
<?php esc_html_e( 'An id-like string with only letters in lower case, numbers, and hyphens.', 'advanced-ads' ); ?>
</span>
</span>
&nbsp;<p class="advads-notice-inline advads-error advads-output-wrapper-id-error hidden"><?php esc_attr_e( 'An id-like string with only letters in lower case, numbers, and hyphens.', 'advanced-ads' ); ?></p>
</div>
<hr class="advads-hide-in-wizard"/>
<label class='label advads-hide-in-wizard' for="advads-output-wrapper-class">
<?php esc_html_e( 'container classes', 'advanced-ads' ); ?>
</label>
<div class="advads-hide-in-wizard">
<input type="text" id="advads-output-wrapper-class" name="advanced_ad[output][wrapper-class]" value="<?php echo esc_attr( $ad->get_wrapper_class() ); ?>"/>
<span class="advads-help"><span class="advads-tooltip"><?php esc_html_e( 'Specify one or more classes for the container. Separate multiple classes with a space', 'advanced-ads' ); ?>.</span></span>
</div>
<hr class="advads-hide-in-wizard"/>
<label class="label advads-hide-in-wizard" for="advads-output-ad-label">
<?php esc_html_e( 'Ad label', 'advanced-ads' ); ?>
</label>
<div class="advads-hide-in-wizard">
<input type="text" id="advads-output-ad-label" name="advanced_ad[output][ad_label]" value="<?php echo esc_attr( $ad->get_prop( 'ad_label' ) ); ?>" <?php echo Options::instance()->get( 'advanced-ads.custom-label.enabled' ) ? '' : 'disabled'; ?>/>
<?php if ( ! Options::instance()->get( 'advanced-ads.custom-label.enabled' ) ) : ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php
printf(
/* Translators: %s is the URL to the settings page. */
esc_html__( 'Enable the Ad Label %1$s in the settings%2$s.', 'advanced-ads' ),
'<a href="' . esc_url( admin_url( 'admin.php?page=advanced-ads-settings' ) ) . '" target="_blank">',
'</a>'
);
?>
</span>
</span>
<?php endif; ?>
</div>
<hr />
<label for="advads-output-debugmode" class="label advads-hide-in-wizard">
<?php esc_html_e( 'Enable debug mode', 'advanced-ads' ); ?>
</label>
<div class="advads-hide-in-wizard">
<input type="hidden" name="advanced_ad[debugmode]" value="off">
<input id="advads-output-debugmode" type="checkbox" name="advanced_ad[debugmode]" value="on" <?php checked( $ad->is_debug_mode() ); ?>/>
<a href="https://wpadvancedads.com/manual/ad-debug-mode/?utm_source=advanced-ads&utm_medium=link&utm_campaign=ad-debug-mode" target="_blank" class="advads-manual-link"><?php esc_html_e( 'Manual', 'advanced-ads' ); ?></a>
</div>
<?php if ( ! defined( 'AAP_VERSION' ) ) : ?>
<hr class="advads-hide-in-wizard"/>
<label class="label advads-hide-in-wizard"><?php esc_html_e( 'Display only once', 'advanced-ads' ); ?></label>
<div class="advads-hide-in-wizard">
<?php esc_html_e( 'Display the ad only once per page', 'advanced-ads' ); ?>
<p>
<?php
Upgrades::pro_feature_link( 'upgrade-pro-display-only-once' );
?>
</p>
</div><hr class="advads-hide-in-wizard"/>
<label class="label advads-hide-in-wizard"><?php esc_html_e( 'Custom Code', 'advanced-ads' ); ?></label>
<div class="advads-hide-in-wizard">
<?php
esc_html_e( 'Place your own code below the ad', 'advanced-ads' );
?>
<p>
<?php
Upgrades::pro_feature_link( 'upgrade-pro-custom-code' );
?>
</p> </div>
<?php endif; ?>
<?php do_action( 'advanced-ads-output-metabox-after', $ad ); ?>
</div>

View File

@@ -0,0 +1,37 @@
<?php
/**
* Render the ad type size parameter on the ad edit screen
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var Ad_Type $ad_type Ad type instance.
*/
// dont show sizes for Google Ad Manager ads.
if ( 'gam' === $ad_type->get_id() ) {
return;
}
$show_reserve_space = in_array( $ad_type->get_id(), [ 'plain', 'content', 'group', 'adsense' ], true );
$enable_reserve_space = $show_reserve_space && $ad->is_space_reserved();
?>
<span class="label"><?php esc_html_e( 'size', 'advanced-ads' ); ?></span>
<div id="advanced-ads-ad-parameters-size">
<label>
<?php esc_html_e( 'width', 'advanced-ads' ); ?><input type="number" value="<?php echo esc_attr( $ad->get_width() ); ?>" name="advanced_ad[width]">px
</label>
<label>
<?php esc_html_e( 'height', 'advanced-ads' ); ?><input type="number" value="<?php echo esc_attr( $ad->get_height() ); ?>" name="advanced_ad[height]">px
</label>
<label<?php echo ! $show_reserve_space ? ' style="display:none;"' : ''; ?>>
<input type="checkbox" id="advads-wrapper-add-sizes" name="advanced_ad[reserve_space]" value="true" <?php checked( $enable_reserve_space ); ?>><?php esc_html_e( 'reserve this space', 'advanced-ads' ); ?>
</label>
<?php
if ( 'image' === $ad_type->get_id() ) :
$ad_type->show_original_image_size( $ad );
endif;
?>
</div>
<hr/>

View File

@@ -0,0 +1,37 @@
<?php
/**
* Render the ad type parameters meta box on the ad edit screen
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
*/
$ad_type = $ad->get_type_object();
do_action( "advanced-ads-ad-params-before-{$ad->get_type()}", $ad );
do_action( 'advanced-ads-ad-params-before', $ad );
?>
<div id="advanced-ads-tinymce-wrapper" style="display:none;">
<?php
$args = [
// used here instead of textarea_rows, because of display:none.
'editor_height' => 300,
'drag_drop_upload' => true,
];
wp_editor( '', 'advanced-ads-tinymce', $args );
?>
</div>
<div id="advanced-ads-ad-parameters" class="advads-option-list">
<?php
if ( $ad_type->has_size() ) {
include ADVADS_ABSPATH . 'views/admin/metaboxes/ads/ad-parameters-size.php';
}
?>
</div>
<?php
do_action( "advanced-ads-ad-params-after-{$ad->get_type()}", $ad );
do_action( 'advanced-ads-ad-params-after', $ad );

View File

@@ -0,0 +1,54 @@
<?php
/**
* Render targeting meta box for Display and Visitor Conditions on ad edit page
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
*/
$display_conditions = $ad->get_display_conditions();
$visitor_conditions = $ad->get_visitor_conditions();
$display_conditions_available = empty( $display_conditions );
$visitor_conditions_available = empty( $visitor_conditions );
?>
<h3>
<?php echo esc_html__( 'Display Conditions', 'advanced-ads' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Limit the ad to pages that match the following conditions. Dont do anything here if the ad should appear everywhere you embed it.', 'advanced-ads' ); ?>
</span>
</span>
</h3>
<?php if ( $display_conditions_available ) : ?>
<div class="advads-show-in-wizard">
<p><?php esc_html_e( 'Click on the button below if the ad should NOT show up on all pages when included automatically.', 'advanced-ads' ); ?></p>
<button type="button" class="button button-secondary" id="advads-wizard-display-conditions-show"><?php esc_html_e( 'Hide the ad on some pages', 'advanced-ads' ); ?></button>
</div>
<?php endif; ?>
<div id="advads-display-conditions" <?php echo $display_conditions_available ? 'class="advads-hide-in-wizard"' : ''; ?>>
<?php Advanced_Ads_Display_Conditions::render_condition_list( $display_conditions, 'advads-ad-display-conditions' ); ?>
</div>
<?php do_action( 'advanced-ads-display-conditions-after', $ad ); ?>
<hr/>
<h3>
<?php echo esc_html__( 'Visitor Conditions', 'advanced-ads' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Target the ad to specific user groups that match the following conditions. Dont do anything here if all users should see the ad.', 'advanced-ads' ); ?>
</span>
</span>
</h3>
<?php if ( $visitor_conditions_available ) : ?>
<div class="advads-show-in-wizard">
<p><?php esc_html_e( 'Click on the button below if the ad should NOT be visible to all visitors', 'advanced-ads' ); ?></p>
<button type="button" class="button button-secondary" id="advads-wizard-visitor-conditions-show"><?php esc_html_e( 'Hide the ad from some users', 'advanced-ads' ); ?></button>
</div>
<?php endif; ?>
<div id="advads-visitor-conditions" <?php echo $visitor_conditions_available ? 'class="advads-hide-in-wizard"' : ''; ?>>
<?php Advanced_Ads_Visitor_Conditions::render_condition_list( $visitor_conditions, 'advads-ad-visitor-conditions' ); ?>
</div>
<?php do_action( 'advanced-ads-visitor-conditions-after', $ad ); ?>

View File

@@ -0,0 +1,68 @@
<?php
/**
* Render the types meta box on the ad edit screen
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
*/
use AdvancedAds\Admin\Upgrades;
use AdvancedAds\Utilities\Conditional;
$types = wp_advads_get_ad_types();
if ( empty( $types ) ) : ?>
<p>
<?php esc_html_e( 'No ad types defined', 'advanced-ads' ); ?>
</p>
<?php
return;
endif;
?>
<ul id="advanced-ad-type">
<?php foreach ( $types as $ad_type ) : ?>
<li class="advanced-ads-type-list-<?php echo esc_attr( $ad_type->get_id() ); ?>">
<input
type="radio"
name="advanced_ad[type]"
id="advanced-ad-type-<?php echo esc_attr( $ad_type->get_id() ); ?>"
value="<?php echo esc_attr( $ad_type->get_id() ); ?>"
<?php checked( $ad->get_type(), $ad_type->get_id() ); ?>
<?php disabled( $ad_type->is_premium() ); ?>
/>
<label for="advanced-ad-type-<?php echo esc_attr( $ad_type->get_id() ); ?>"><?php echo esc_html( $ad_type->get_title() ); ?></label>
<?php if ( ! empty( $ad_type->get_description() ) ) : ?>
<span class="advads-help">
<span class="advads-tooltip"><?php echo esc_html( $ad_type->get_description() ); ?></span>
</span>
<?php endif; ?>
<?php
if ( $ad_type->get_upgrade_url() ) {
echo ' ';
Upgrades::upgrade_link(
__( 'Manual', 'advanced-ads' ),
$ad_type->get_upgrade_url(),
'upgrade-ad-type-' . $ad_type->get_id()
);
}
?>
</li>
<?php endforeach; ?>
</ul>
<?php
$_notice = 'nl_adsense';
$box_classes = 'mt-1 advads-notice-adsense' . ( 'adsense' !== $ad->get_type() ? ' !hidden' : '' );
if ( Advanced_Ads_Admin_Notices::get_instance()->can_display( $_notice ) && Conditional::user_can_subscribe( 'nl_first_steps' ) ) {
$text = sprintf(
/* translators: %s: number of add-ons. */
__( 'Subscribe to our free email course for Google AdSense, receive our newsletter for periodic tutorials, and get %s for Advanced Ads.', 'advanced-ads' ),
'<strong>' . __( '2 free add-ons', 'advanced-ads' ) . '</strong>'
);
include ADVADS_ABSPATH . '/admin/views/notices/inline.php';
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* Option to enter notes for a given ad
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
*/
$description = $ad->get_description();
?>
<label class="label" for="advads-usage-notes" onclick="advads_toggle('#advads-ad-notes textarea'); advads_toggle('#advads-ad-notes p')"><?php esc_html_e( 'notes', 'advanced-ads' ); ?></label>
<div id="advads-ad-notes">
<p title="<?php esc_html_e( 'click to change', 'advanced-ads' ); ?>" onclick="advads_toggle('#advads-ad-notes textarea'); advads_toggle('#advads-ad-notes p')">
<?php
if ( ! empty( $description ) ) {
echo nl2br( esc_html( $description ) );
} else {
esc_html_e( 'Click to add notes', 'advanced-ads' );
}
?>
<span class="dashicons dashicons-edit"></span>
</p>
<textarea name="advanced_ad[description]" id="advads-usage-notes"><?php echo esc_html( $description ); ?></textarea>
</div>
<hr/>

View File

@@ -0,0 +1,30 @@
<?php
/**
* Render usage information for ads.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
*/
?>
<label class="label" for="advads-usage-shortcode"><?php esc_html_e( 'Shortcode', 'advanced-ads' ); ?></label>
<div class="advads-usage">
<code><input type="text" id="advads-usage-shortcode" onclick="this.select();" value='[the_ad id="<?php echo esc_attr( $ad->get_id() ); ?>"]' readonly/></code>
</div>
<hr/>
<label class="label" for="advads-usage-function"><?php esc_html_e( 'Template (PHP)', 'advanced-ads' ); ?></label>
<div class="advads-usage">
<code><input type="text" id="advads-usage-function" onclick="this.select();" value="&lt;?php the_ad('<?php echo esc_attr( $ad->get_id() ); ?>'); ?&gt;" readonly/></code>
<?php
printf(
/* translators: 1: is an opening a tag, 2: is a closing a tag */
esc_html__( 'Find more display options in the %1$smanual%2$s.', 'advanced-ads' ),
'<a href="https://wpadvancedads.com/manual/placements/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-ad-title" target="_blank" class="advads-manual-link">',
'</a>'
);
?>
</div>

View File

@@ -0,0 +1,18 @@
<?php
/**
* Render the Usage meta box on the ad edit screen
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.2
*
* @var Ad $ad Ad instance.
*/
?>
<div id="advads-ad-usage" class="advads-option-list">
<?php
require_once ADVADS_ABSPATH . 'views/admin/metaboxes/ads/ad-usage-notes.php';
require_once ADVADS_ABSPATH . 'views/admin/metaboxes/ads/ad-usage-shortcodes.php';
?>
</div>

View File

@@ -0,0 +1,25 @@
<?php
/**
* Render the Usage meta box on the ad edit screen
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var WP_Post|object $post Post instance.
* @var array $values Setting array.
*/
wp_nonce_field( 'advads_post_meta_box', 'advads_post_meta_box_nonce' );
?>
<p>
<a href="https://wpadvancedads.com/how-to-block-ads-on-a-specific-page/?utm_source=advanced-ads&utm_medium=link&utm_campaign=disable-ads-on-specific-pages" target="_blank">
<?php esc_html_e( 'How to disable ads on specific pages', 'advanced-ads' ); ?>
</a>
</p>
<label>
<input type="checkbox" name="advanced_ads[disable_ads]" value="1"<?php checked( $values['disable_ads'] ?? false ); ?>/>
<?php esc_html_e( 'Disable ads on this page', 'advanced-ads' ); ?>
</label>
<?php
do_action( 'advanced_ads_render_post_meta_box', $post, $values );