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,87 @@
<?php
/**
* Database functions
*
* @link https://raiolanetworks.es
* @since 1.0.0
*
* @package Wp_Database_Tools
* @subpackage Wp_Database_Tools/includes
*/
/**
* Manages communication with the API when sending user feedback.
*
* This class contains the methods called from admin-ajax
*
* @since 1.0.0
* @package Wp_Database_Tools
* @subpackage Wp_Database_Tools/includes
* @author Raiola Networks <info@raiolanetworks.es>
*/
class Wp_Database_Tools_Feedback {
public function save_feedback_user() {
global $wpdb;
// $KEY = WPDBT_PREFIX . 'feedback';
$KEY = 'nonce';
if ( ! isset( $_POST[ $KEY ] ) ) {
Wp_Database_Tools_Logger::error( 'Missing error' );
wp_die( esc_html( __( 'Missing nonce.' ) ) );
}
if ( ! wp_verify_nonce( sanitize_key( $_POST[ $KEY ] ), 'feedback-user' ) ) {
Wp_Database_Tools_Logger::error( 'Nonce error' );
wp_die( esc_html( __( 'Nonce error.' ) ) );
}
$user_id = get_current_user_id();
if ( $user_id ) {
$KEY = WPDBT_PREFIX . 'feedback';
$feedback = get_user_meta( $user_id, $KEY, true );
if ( $feedback == null ) {
$feedback = wp_json_encode( array() );
} else {
$feedback = wp_json_encode( $feedback );
}
$feedback = json_decode( $feedback );
$feedback_array = (array) $feedback;
$all_feedback = array();
$new_feedback = array();
$names = json_decode( stripslashes( $_POST['name'] ) );
$prefixes = json_decode( stripslashes( $_POST['prefix'] ) );
foreach ( $names as $key => $name ) {
if ( $_POST['section'] == 'tables' && $prefixes[ $key ] == 'true' ) {
$name = $wpdb->prefix . $name;
}
$new_feedback[ $_POST['section'] ][ $name ]['vote'] = $_POST['vote'];
$new_feedback[ $_POST['section'] ][ $name ]['type'] = $_POST['type'];
}
// Merge data.
$all_feedback = array_merge_recursive( $feedback_array, $new_feedback );
$updated = update_user_meta( $user_id, $KEY, $all_feedback );
}
// Save feedback user meta data.
wp_send_json( wp_json_encode( $_POST ) );
wp_die();
}
}