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,12 @@
<?php
/**
* Render the Adsense ID column content in the ad list.
*
* @package AdvancedAds
* @var string $slotid Adsense Slot ID.
*/
?>
<?php if ( null !== $slotid ) : ?>
<div><?php echo esc_html( $slotid ); ?></div>
<?php endif; ?>

View File

@@ -0,0 +1,22 @@
<?php
/**
* Render the "Date" column date in the ad list.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var string $published_date ad published date.
* @var string $modified_date ad modified date.
*/
?>
<div class="advads-ad-list-date">
<?php if ( $modified_date === $published_date ) : ?>
<?php esc_html_e( 'Published', 'advanced-ads' ); ?>
<?php else : ?>
<?php esc_html_e( 'Last Modified', 'advanced-ads' ); ?>
<?php endif; ?>
<br/>
<?php echo esc_html( $modified_date ); ?>
</div>

View File

@@ -0,0 +1,10 @@
<?php
/**
* Render 'debug' column.
*
* @package AdvancedAds
*
* @var bool $debug_mode Debug mode checked or not.
*/
echo $debug_mode ? esc_html__( 'Enabled', 'advanced-ads' ) : '&mdash;';

View File

@@ -0,0 +1,15 @@
<?php
/**
* Render the "Notes" column content in the ad list.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var string $description ad description.
*/
?>
<div class="advads-ad-list-description">
<?php echo esc_html( $description ); ?>
</div>

View File

@@ -0,0 +1,10 @@
<?php
/**
* Render 'debug' column.
*
* @package AdvancedAds
*
* @var bool $display_once 'Display once' checked or not.
*/
echo $display_once ? esc_html__( 'Enabled', 'advanced-ads' ) : '&mdash;';

View File

@@ -0,0 +1,10 @@
<?php
/**
* Render 'debug' column.
*
* @package AdvancedAds
*
* @var bool $privacyignore Debug mode checked or not.
*/
echo $privacyignore ? esc_html__( 'Enabled', 'advanced-ads' ) : '&mdash;';

View File

@@ -0,0 +1,13 @@
<?php
/**
* Render ad shortcode column in the ad overview list
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var int $ad_id Ad id.
*/
?>
<input class="advads-ad-injection-shortcode" onclick="this.select();" value="[the_ad id=&quot;<?php echo esc_attr( $ad_id ); ?>&quot;]"/>

View File

@@ -0,0 +1,16 @@
<?php
/**
* Render the ad size column content in the ad list.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var string $size ad size string.
*/
?>
<span class="advads-ad-size">
<?php echo esc_html( $size ); ?>
</span>

View File

@@ -0,0 +1,22 @@
<?php
/**
* Render content of the Ad Schedule column in the ad overview list
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var string $html_classes Additonal values for class attribute.
* @var string[] $status_strings Status string.
* @var string $content_after HTML to load after the schedule content.
*/
?>
<fieldset class="inline-edit-col-left">
<div class="inline-edit-col <?php echo esc_attr( $html_classes ); ?>">
<p>
<?php echo wp_kses( implode( '<br/>', $status_strings ), [ 'br' => [] ] ); ?>
</p>
<?php echo $content_after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
</fieldset>

View File

@@ -0,0 +1,37 @@
<?php
/**
* Render the ad type column content in the ad list.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var string $size_string Ad size string.
* @var Ad $ad Ad instance.
*/
use AdvancedAds\Framework\Utilities\Params;
$type_object = $ad->get_type_object();
?>
<span class="advads-ad-list-tooltip">
<span class="advads-ad-list-tooltip-content">
<strong><?php echo esc_html( $type_object->get_title() ); ?></strong><br/>
<?php if ( ! empty( $size_string ) ) : ?>
<span class="advads-ad-size"><?php echo esc_html( $size_string ); ?></span>
<?php endif; ?>
</span>
<a href="<?php echo esc_url( get_edit_post_link( $ad->get_id() ) ?? '' ); ?>">
<img src="<?php echo esc_url( $type_object->get_image() ); ?>" alt="<?php echo esc_attr( $type_object->get_title() ); ?>" title="<?php echo esc_attr( $type_object->get_title() ); ?>" width="50">
</a>
</span>
<?php
// Not inline edit, or no permission.
if (
! wp_verify_nonce( sanitize_key( Params::post( '_inline_edit' ) ), 'inlineeditnonce' ) ||
! current_user_can( 'advanced_ads_edit_ads' )
) {
return;
}
?>
<script>window.advancedAds.notifications.addSuccess( '<?php esc_html_e( 'Ad updated', 'advanced-ads' ); ?>' );</script>

View File

@@ -0,0 +1,48 @@
<?php
/**
* Render column.
*
* @package AdvancedAds
* @var int $ad_id Ad ID.
*/
$groups = wp_advads_get_group_repository()->get_groups_by_ad_id( $ad_id );
$placements = wp_advads_get_placement_repository()->find_by_item_id( 'ad_' . $ad_id );
if ( $groups ) :
?>
<strong><?php echo esc_html__( 'Groups', 'advanced-ads' ) . ':'; ?></strong>
<div>
<?php
$group_links = [];
foreach ( $groups as $group ) {
$group_links[] = '<a href="' . esc_attr( $group->get_edit_link() ) . '" target="_blank">'
. esc_html( $group->get_name() ) . '</a>';
}
echo implode( ', ', $group_links ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $group_links is HTML.
?>
</div>
<?php
endif;
if ( $groups && $placements ) {
echo '<br>';
}
if ( $placements ) :
?>
<strong><?php echo esc_html__( 'Placements', 'advanced-ads' ) . ':'; ?></strong>
<div>
<?php
$ids = [];
$placement_links = [];
foreach ( $placements as $placement ) {
$ids[] = $placement->get_id();
$placement_links[] = '<a href="' . esc_attr( $placement->get_edit_link() ) . '" target="_blank">'
. esc_html( $placement->get_title() ) . '</a>';
}
echo implode( ', ', $placement_links ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $placement_links is HTML.
?>
</div>
<?php
endif;

View File

@@ -0,0 +1,124 @@
<?php
/**
* Render ad list filters.
*
* @package AdvancedAds
*/
use AdvancedAds\Framework\Utilities\Params;
use AdvancedAds\Options;
// TODO: refactor whole filter system.
global $wp_query;
$screen = get_current_screen();
$filters_to_show = $screen->get_option( 'filters_to_show' ) ?? [];
$is_privacy_enabled = Options::instance()->get( 'privacy.enabled' );
$all_filters = wp_advads()->list_filters->get_all_filters();
$selected_ad_type = Params::request( 'adtype', '' );
$ad_size = Params::request( 'adsize', '' );
$ad_date = Params::request( 'addate', '' );
$ad_group = Params::request( 'adgroup', '' );
$ad_author = Params::request( 'ad_author', '' );
$ad_debug = Params::request( 'ad_debugmode', '' );
$ad_displayonce = Params::request( 'ad_displayonce', '' );
$ad_privacyignore = Params::request( 'ad_privacyignore', '' );
// hide the filter button. Can not filter correctly with "trashed" posts.
if ( 'trash' === Params::request( 'post_status', '' ) ) {
echo '<style type="text/css">#post-query-submit{display:none;}</style>';
}
$ad_types = wp_advads_get_ad_types();
usort(
$ad_types,
function ( $a, $b ) {
return strcmp( $a->get_title(), $b->get_title() );
}
);
?>
<div class="advads-ad-filters-container">
<!-- Types -->
<select id="advads-filter-type" name="adtype">
<option value="">- <?php esc_html_e( 'Ad Types', 'advanced-ads' ); ?> -</option>
<?php foreach ( $ad_types as $ad_type ) : ?>
<option <?php selected( $selected_ad_type, $ad_type->get_id() ); ?> value="<?php echo esc_attr( $ad_type->get_id() ); ?>"><?php echo esc_html( $ad_type->get_title() ); ?></option>
<?php endforeach; ?>
</select>
<!-- Sizes -->
<?php if ( ! empty( $all_filters['all_sizes'] ) ) : ?>
<select id="advads-filter-size" name="adsize">
<option value="">- <?php esc_html_e( 'Ad Sizes', 'advanced-ads' ); ?> -</option>
<?php foreach ( $all_filters['all_sizes'] as $key => $value ) : ?>
<option <?php selected( $ad_size, $key ); ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<!-- Dates -->
<?php if ( ! empty( $all_filters['all_dates'] ) ) : ?>
<select id="advads-filter-date" name="addate">
<option value="">- <?php esc_html_e( 'Ad Dates', 'advanced-ads' ); ?> -</option>
<?php foreach ( $all_filters['all_dates'] as $key => $value ) : ?>
<option <?php selected( $ad_date, $key ); ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<!-- Groups -->
<?php if ( ! empty( $all_filters['all_groups'] ) ) : ?>
<select id="advads-filter-group" name="adgroup">
<option value="">- <?php esc_html_e( 'Ad Groups', 'advanced-ads' ); ?> -</option>
<?php foreach ( $all_filters['all_groups'] as $key => $value ) : ?>
<option <?php selected( $ad_group, $key ); ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<!-- Debug Mode -->
<?php if ( in_array( 'all_debug_mode', $filters_to_show, true ) ) : ?>
<select name="ad_debugmode">
<option value="">- <?php esc_html_e( 'Debug Mode', 'advanced-ads' ); ?> -</option>
<option <?php selected( $ad_debug, 'yes' ); ?> value="yes"><?php esc_html_e( 'Enabled', 'advanced-ads' ); ?></option>
<option <?php selected( $ad_debug, 'no' ); ?> value="no"><?php esc_html_e( 'Disabled', 'advanced-ads' ); ?></option>
</select>
<?php endif; ?>
<!-- Author -->
<?php if ( in_array( 'all_authors', $filters_to_show, true ) && ! empty( $all_filters['all_authors'] ) ) : ?>
<select name="ad_author">
<option value="">- <?php esc_html_e( 'Ad Authors', 'advanced-ads' ); ?> -</option>
<?php foreach ( $all_filters['all_authors'] as $key => $value ) : ?>
<option <?php selected( $ad_author, $key ); ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<!-- Display once -->
<?php if ( defined( 'AAP_VERSION' ) && in_array( 'all_displayonce', $filters_to_show, true ) ) : ?>
<select name="ad_displayonce">
<option value="">- <?php esc_html_e( 'Display Once', 'advanced-ads' ); ?> -</option>
<option <?php selected( $ad_displayonce, 'yes' ); ?> value="yes"><?php esc_html_e( 'Enabled', 'advanced-ads' ); ?></option>
<option <?php selected( $ad_displayonce, 'no' ); ?> value="no"><?php esc_html_e( 'Disabled', 'advanced-ads' ); ?></option>
</select>
<?php endif; ?>
<!-- Privacy ignore -->
<?php if ( $is_privacy_enabled && in_array( 'all_privacyignore', $filters_to_show, true ) ) : ?>
<select name="ad_privacyignore">
<option value="">- <?php esc_html_e( 'Privacy Ignore', 'advanced-ads' ); ?> -</option>
<option <?php selected( $ad_privacyignore, 'yes' ); ?> value="yes"><?php esc_html_e( 'Enabled', 'advanced-ads' ); ?></option>
<option <?php selected( $ad_privacyignore, 'no' ); ?> value="no"><?php esc_html_e( 'Disabled', 'advanced-ads' ); ?></option>
</select>
<?php endif; ?>
<?php if ( isset( $wp_query->found_posts ) && $wp_query->found_posts > 0 ) : ?>
<?php do_action( 'advanced-ads-ad-list-filter-markup', $all_filters ); ?>
<?php endif; ?>
<a href="#" id="advads-ad-filter-customize"><?php esc_html_e( 'Customize filters', 'advanced-ads' ); ?></a>
</div>

View File

@@ -0,0 +1,18 @@
<?php
/**
* Render the tooltip for ad status on the group overview page.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var string[] $status_strings
* @var string $status_type
*/
?>
<span class="advads-help advads-help-no-icon advads-ad-status-icon advads-ad-status-icon-<?php echo esc_attr( $status_type ); ?>">
<span class="advads-tooltip">
<?php echo wp_kses( implode( '<br/>', $status_strings ), [ 'br' => [] ] ); ?>
</span>
</span>

View File

@@ -0,0 +1,41 @@
<?php
/**
* Render the view navigation items on the ad list.
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.48.0
*
* @var array $views_new list of views.
* @var bool $show_trash_delete_button if the trash delete button is visible.
*/
use AdvancedAds\Framework\Utilities\Str;
?>
<ul class="advanced-ads-ad-list-views">
<?php
foreach ( $views as $view ) :
$view = str_replace( [ ')', '(' ], '', $view );
$class = Str::contains( 'current', $view ) ? 'advads-button-primary' : 'advads-button-secondary';
?>
<li class="button <?php echo esc_attr( $class ); ?>">
<?php
echo wp_kses(
$view,
[
'a' => [ 'href' => [] ],
'span' => [ 'class' => [] ],
]
);
?>
</li>
<?php endforeach; ?>
</ul>
<?php if ( $show_trash_delete_button ) : ?>
<button type="submit" name="delete_all" id="delete_all" class="button advads-button-primary">
<span class="dashicons dashicons-trash"></span><?php esc_html_e( 'Empty Trash', 'advanced-ads' ); ?>
</button>
<?php
endif;