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 @@
<?php // Silence is golden.

View File

@@ -0,0 +1,101 @@
<?php
/**
* Payment Meta Functions
*
* @package restrict-content-pro
* @copyright Copyright (c) 2019, Restrict Content Pro team
* @license GPL2+
* @since 3.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Add meta data field to a payment.
*
* @param int $payment_id Payment ID.
* @param string $meta_key Meta data name.
* @param mixed $meta_value Meta data value. Must be serializable if non-scalar.
* @param bool $unique Optional. Whether the same key should not be added. Default false.
*
* @since 3.1
* @return false|int
*/
function rcp_add_payment_meta( $payment_id, $meta_key, $meta_value, $unique = false ) {
/**
* @var RCP_Payments $rcp_payments_db
*/
global $rcp_payments_db;
return $rcp_payments_db->add_meta( $payment_id, $meta_key, $meta_value, $unique );
}
/**
* Remove meta data matching criteria from a payment.
*
* You can match based on the key, or key and value. Removing based on key and value, will keep from removing duplicate
* meta data with the same key. It also allows removing all meta data matching key, if needed.
*
* @param int $payment_id Payment ID.
* @param string $meta_key Meta data name.
* @param mixed $meta_value Meta data value. Must be serializable if non-scalar. Default empty.
*
* @since 3.1
* @return false|int
*/
function rcp_delete_payment_meta( $payment_id, $meta_key, $meta_value = '' ) {
/**
* @var RCP_Payments $rcp_payments_db
*/
global $rcp_payments_db;
return $rcp_payments_db->delete_meta( $payment_id, $meta_key, $meta_value );
}
/**
* Retrieve payment meta field for a payment.
*
* @param int $payment_id Payment ID.
* @param string $key Optional. The meta key to retrieve. By default, returns data for all keys. Default
* empty.
* @param bool $single Optional, default is false. If true, return only the first value of the specified
* meta_key. This parameter has no effect if meta_key is not specified.
*
* @since 3.1
* @return mixed Will be an array if $single is false. Will be value of meta data field if $single is true.
*/
function rcp_get_payment_meta( $payment_id, $key = '', $single = false ) {
/**
* @var RCP_Payments $rcp_payments_db
*/
global $rcp_payments_db;
return $rcp_payments_db->get_meta( $payment_id, $key, $single );
}
/**
* Update payment meta field based on payment ID.
*
* Use the $prev_value parameter to differentiate between meta fields with the
* same key and payment ID.
*
* If the meta field for the payment does not exist, it will be added.
*
* @param int $payment_id Payment ID.
* @param string $meta_key Meta data key.
* @param mixed $meta_value Meta data value. Must be serializable if non-scalar.
* @param mixed $prev_value Optional. Previous value to check before removing. Default empty.
*
* @since 3.1
* @return int|false Meta ID if the key didn't exist, true on successful update, false on failure.
*/
function rcp_update_payment_meta( $payment_id, $meta_key, $meta_value, $prev_value = '' ) {
/**
* @var RCP_Payments $rcp_payments_db
*/
global $rcp_payments_db;
return $rcp_payments_db->update_meta( $payment_id, $meta_key, $meta_value, $prev_value );
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* Payment Actions
*
* @package restrict-content-pro
* @copyright Copyright (c) 2019, Restrict Content Pro team
* @license GPL2+
* @since 3.1
*/
/**
* Add a note to customer and membership records when a payment is completed.
*
* @param int $payment_id
*
* @since 3.1
* @return void
*/
function rcp_log_notes_on_payment_completion( $payment_id ) {
$payments = new RCP_Payments();
$payment = $payments->get_payment( $payment_id );
if ( empty( $payment ) ) {
return;
}
$charge_type_slug = ! empty( $payment->transaction_type ) ? $payment->transaction_type : 'new';
$note = sprintf( __( 'Successful payment for membership "%s". Payment ID: #%d; Amount: %s; Gateway: %s; Type: %s.', 'rcp' ), rcp_get_subscription_name( $payment->object_id ), $payment->id, rcp_currency_filter( $payment->amount ), $payment->gateway, $charge_type_slug );
if ( ! empty( $payment->customer_id ) && $customer = rcp_get_customer( $payment->customer_id ) ) {
$customer->add_note( $note );
}
if ( ! empty( $payment->membership_id ) && $membership = rcp_get_membership( $payment->membership_id ) ) {
$membership->add_note( $note );
}
}
add_action( 'rcp_update_payment_status_complete', 'rcp_log_notes_on_payment_completion' );
/**
* Deletes the membership `renewal_payment_failed_emails_number` meta when a payment is completed.
* This allows renewal payment failed emails to be sent again.
*
* @param int $payment_id
*
* @since 3.3.2
* @return void
*/
function rcp_remove_renewal_failure_meta_on_payment_completion( $payment_id ) {
$payments = new RCP_Payments();
$payment = $payments->get_payment( $payment_id );
if ( empty( $payment ) || empty( $payment->membership_id ) ) {
return;
}
rcp_delete_membership_level_meta( $payment_id, 'renewal_payment_failed_emails_number' );
}
add_action( 'rcp_update_payment_status_complete', 'rcp_remove_renewal_failure_meta_on_payment_completion' );

View File

@@ -0,0 +1,40 @@
<?php
/**
* Payment Functions
*
* @package restrict-content-pro
* @copyright Copyright (c) 2019, Sandhills Development, LLC
* @license GPL2+
* @since 3.2.3
*/
/**
* Get the recovery URL for a payment.
*
* @param int $payment_id
*
* @since 3.2.3
* @return string
*/
function rcp_get_payment_recovery_url( $payment_id ) {
/**
* @var RCP_Payments $rcp_payments_db
*/
global $rcp_payments_db;
$payment = $rcp_payments_db->get_payment( $payment_id );
if ( empty( $payment ) ) {
return '';
}
$url = add_query_arg( array(
'registration_type' => urlencode( $payment->transaction_type ),
'rcp_registration_payment_id' => urlencode( $payment_id ),
'level' => urlencode( $payment->object_id )
), rcp_get_registration_page_url() );
return $url;
}