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,59 @@
<?php
/**
* Render import history table
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.50.0
*
* phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
*/
$history = get_option( '_advads_importer_history', [] );
if ( empty( $history ) ) {
return;
}
?>
<div id="import-history" class="advads-import-history mt-8">
<header>
<h2 class="advads-h2"><?php esc_html_e( 'Import History', 'advanced-ads' ); ?></h2>
<p class="text-sm"><?php esc_html_e( 'Import history to rollback changes.', 'advanced-ads' ); ?></p>
</header>
<table class="widefat striped">
<thead>
<tr>
<td>Importer</td>
<td>Session Key</td>
<td>Ads Created</td>
<td>Create At</td>
<td></td>
</tr>
</thead>
<tbody>
<?php
foreach ( $history as $session_key => $session ) :
$importer = wp_advads()->importers->get_importer( $session['importer_id'] );
$delete_link = wp_nonce_url(
add_query_arg(
[
'action' => 'advads_import_delete',
'session_key' => $session['session_key'],
]
),
'advads_import_delete'
);
?>
<tr>
<td><?php echo $importer->get_title(); ?></td>
<td><?php echo $session['session_key']; ?></td>
<td><?php echo $session['count']; ?></td>
<td><?php echo wp_date( get_option( 'date_format' ), $session['created_at'] ); ?></td>
<td>
<a href="<?php echo esc_url( $delete_link ); ?>" class="button-link !text-red-500">Rollback Changes</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,20 @@
<?php
/**
* Render Importers
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.50.0
*/
$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
$size = size_format( $bytes );
$upload_dir = wp_upload_dir();
?>
<div class="advads-importers max-w-screen-lg">
<?php wp_advads()->importers->display_message(); ?>
<div class="wp-header-end hidden"></div>
<?php require 'plugin-importer.php'; ?>
<?php require 'other-plugin-importer.php'; ?>
<?php require 'import-history.php'; ?>
</div>

View File

@@ -0,0 +1,68 @@
<?php
/**
* Render Importers
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.50.0
*/
use AdvancedAds\Framework\Utilities\Params;
use AdvancedAds\Utilities\WordPress;
$importers = wp_advads()->importers;
?>
<div class="advads-other-plugin-importer mt-8">
<header>
<h2 class="advads-h2"><?php esc_html_e( 'Other Plugins', 'advanced-ads' ); ?></h2>
<p class="text-sm"><?php esc_html_e( 'To make things even easier, we are working on new ways to import your settings and data from other plugins.', 'advanced-ads' ); ?></p>
</header>
<div class="advads-tab-container">
<div class="advads-tab-menu">
<?php
foreach ( $importers->get_importers() as $importer ) :
if ( ! $importer->is_detected() ) {
continue;
}
?>
<a id="nav-<?php echo esc_attr( $importer->get_id() ); ?>" href="#<?php echo esc_attr( $importer->get_id() ); ?>">
<?php echo $importer->get_icon(); // phpcs:ignore ?>
<span><?php echo esc_html( $importer->get_title() ); ?></span>
</a>
<?php endforeach; ?>
</div>
<div class="advads-tab-content">
<?php
foreach ( $importers->get_importers() as $importer ) :
if ( ! $importer->is_detected() ) {
continue;
}
?>
<form
id="<?php echo esc_attr( $importer->get_id() ); ?>"
class="advads-tab-target"
method="post"
action="<?php echo esc_url( Params::server( 'REQUEST_URI' ) . '#' . $importer->get_id() ); ?>">
<?php wp_nonce_field( 'advads_import' ); ?>
<input type="hidden" name="action" value="advads_import">
<input type="hidden" name="importer" value="<?php echo esc_attr( $importer->get_id() ); ?>">
<div class="advads-tab-content-body">
<?php if ( $importer->get_description() ) : ?>
<p class="text-base"><?php echo esc_html( $importer->get_description() ); ?></p>
<?php endif; ?>
<div class="pt-2">
<?php $importer->render_form(); ?>
</div>
</div>
<?php if ( $importer->show_button() ) : ?>
<div class="advads-tab-content-footer">
<button class="button button-primary button-large" type="submit">
<?php esc_html_e( 'Start Importing', 'advanced-ads' ); ?>&nbsp;<?php echo esc_html( $importer->get_title() ); ?>
</button>
</div>
<?php endif; ?>
</form>
<?php endforeach; ?>
</div>
</div>
</div>

View File

@@ -0,0 +1,102 @@
<?php
/**
* Render Importers
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.50.0
*/
use AdvancedAds\Utilities\WordPress;
use AdvancedAds\Framework\Utilities\Params;
$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
$size = size_format( $bytes );
$upload_dir = wp_upload_dir();
?>
<div class="advads-plugin-importer mt-8">
<header>
<h2 class="advads-h2"><?php esc_html_e( 'Plugin Settings', 'advanced-ads' ); ?></h2>
<p class="text-sm">
<?php
esc_html_e( 'Import or export your Advanced Ads settings, This option is useful for replicating the ads configuration across multiple websites.', 'advanced-ads' );
WordPress::manual_link( 'https://wpadvancedads.com/manual/import-export/', 'tools-quicklinks' );
?>
</p>
</header>
<div class="advads-tab-container">
<div class="advads-tab-menu">
<a href="#import">
<span class="dashicons dashicons-database-import"></span>
<span><?php esc_html_e( 'Import Settings', 'advanced-ads' ); ?></span>
</a>
<a href="#export" class="is-active">
<span class="dashicons dashicons-database-export"></span>
<span><?php esc_html_e( 'Export Settings', 'advanced-ads' ); ?></span>
</a>
</div>
<div class="advads-tab-content">
<form id="import" class="advads-tab-target" enctype="multipart/form-data" method="post" action="<?php echo esc_url( Params::server( 'REQUEST_URI' ) ); ?>#import">
<div class="advads-tab-content-body">
<input type="hidden" name="action" value="advads_import">
<input type="hidden" name="importer" value="xml">
<?php wp_nonce_field( 'advads_import' ); ?>
<p>
<label>
<input class="advads_import_type" type="radio" name="import_type" value="xml_file" checked="checked" />
<?php esc_html_e( 'Choose an XML file', 'advanced-ads' ); ?>
</label>
</p>
<p>
<label>
<input class="advads_import_type" type="radio" name="import_type" value="xml_content" />
<?php esc_html_e( 'Copy an XML content', 'advanced-ads' ); ?>
</label>
</p>
<div id="advads_xml_file">
<?php if ( ! empty( $upload_dir['error'] ) ) : ?>
<p class="advads-notice-inline advads-error">
<?php esc_html_e( 'Before you can upload your import file, you will need to fix the following error:', 'advanced-ads' ); ?>
<strong><?php echo $upload_dir['error']; // phpcs:ignore ?>guu</strong>
</p>
<?php else : ?>
<p>
<input type="file" id="upload" name="import" size="25" /> (<?php /* translators: %s maximum size allowed */ printf( __( 'Maximum size: %s', 'advanced-ads' ), $size ); // phpcs:ignore ?>)
<input type="hidden" name="max_file_size" value="<?php echo $bytes; // phpcs:ignore ?>" />
</p>
<?php endif; ?>
</div>
<div id="advads_xml_content" style="display:none;">
<p><textarea id="xml_textarea" name="xml_textarea" rows="10" cols="20" class="large-text code"></textarea></p>
<?php WordPress::manual_link( 'https://wpadvancedads.com/manual/import-export/', 'tools-quicklinks', __( 'Ad Templates', 'advanced-ads' ) ); ?>
</div>
</div>
<div class="advads-tab-content-footer">
<button class="button button-primary button-large" type="submit">
<?php esc_html_e( 'Start Import', 'advanced-ads' ); ?>
</button>
</div>
</form>
<form id="export" class="advads-tab-target" method="post" action="<?php echo esc_url( Params::server( 'REQUEST_URI' ) ); ?>#export">
<div class="advads-tab-content-body">
<input type="hidden" name="action" value="advads_export">
<?php wp_nonce_field( 'advads_export' ); ?>
<p class="text-sm"><?php esc_html_e( 'When you click the button below Advanced Ads will create an XML file for you to save to your computer.', 'advanced-ads' ); ?></p>
<ul class="advads-checkbox-list mb-0">
<li><label><input type="checkbox" name="content[]" value="ads" checked="checked" /> <?php esc_html_e( 'Ads', 'advanced-ads' ); ?></label></li>
<li><label><input type="checkbox" name="content[]" value="groups" checked="checked" /> <?php esc_html_e( 'Groups', 'advanced-ads' ); ?></label></li>
<li><label><input type="checkbox" name="content[]" value="placements" checked="checked" /> <?php esc_html_e( 'Placements', 'advanced-ads' ); ?></label></li>
<li><label><input type="checkbox" name="content[]" value="options" /> <?php esc_html_e( 'Options', 'advanced-ads' ); ?></label></li>
</ul>
</div>
<div class="advads-tab-content-footer">
<button class="button button-primary button-large" type="submit">
<?php esc_html_e( 'Download Export File', 'advanced-ads' ); ?>
</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,20 @@
<?php
/**
* Render System information
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.50.0
*/
use AdvancedAds\Admin\System_Info;
$system_info = new System_Info();
?>
<div class="advads-system-information">
<h2><?php esc_html_e( 'System Information', 'advanced-ads' ); ?></h2>
<textarea id="advads-system-information" readonly><?php echo esc_textarea( $system_info->get_info() ); ?></textarea>
<button type="button" id="advads-system-information-copy" class="button button-primary">
<?php esc_html_e( 'Copy System Information', 'advanced-ads' ); ?>
</button>
</div>

View File

@@ -0,0 +1,11 @@
<?php
/**
* Render tools page
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.50.0
*/
?>
<h2>Coming Soon</h2>

View File

@@ -0,0 +1,54 @@
<?php
/**
* Render version management page
*
* @package AdvancedAds
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.50.0
*/
use AdvancedAds\Admin\Version_Control;
$versions = get_transient( Version_Control::VERSIONS_TRANSIENT );
?>
<div class="wp-header-end hidden"></div>
<h3>
<?php esc_html_e( 'Rollback to Previous Version', 'advanced-ads' ); ?>
</h3>
<p>
<?php
printf(
/* translators: %s: current version */
esc_html__( 'Experiencing an issue with Advanced Ads version %s? Rollback to a previous version before the issue appeared.', 'advanced-ads' ),
esc_attr( wp_advads()->get_version() )
)
?>
</p>
<form method="post" action="" id="alternative-version">
<input type="hidden" name="nonce" id="version-control-nonce" value="<?php echo esc_attr( wp_create_nonce( 'advads-version-control' ) ); ?>"/>
<table class="form-table">
<tbody>
<tr>
<th scope="row"><?php esc_html_e( 'Available versions', 'advanced-ads' ); ?></th>
<td>
<p>
<label>
<select name="version" id="plugin-version"<?php echo ! $versions ? ' disabled' : ''; ?> class="!border">
<?php if ( ! $versions ) : ?>
<option value="">--<?php esc_html_e( 'Fetching versions', 'advanced-ads' ); ?>--</option>
<?php else : ?>
<?php foreach ( $versions['order'] as $index => $version ) : ?>
<option value="<?php echo esc_attr( $version . '|' . $versions['versions'][ $version ] ); ?>"<?php selected( $index, 0 ); ?>><?php echo esc_html( $version ); ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</label>
<button type="submit" id="install-version" class="button button-primary"<?php echo ! $versions ? ' disabled' : ''; ?>><?php esc_html_e( 'Reinstall', 'advanced-ads' ); ?></button>
<span class="spinner"></span>
</p>
<p class="text-sm italic text-red-600"><?php esc_html_e( 'Warning: It is advised that you backup your database before installing another version.', 'advanced-ads' ); ?></p>
</td>
</tr>
</tbody>
</table>
</form>