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,27 @@
<?php
namespace bizpanda\includes\gates\context;
/**
* Returns values from the configuration storage.
*/
class ConfigService implements IContextReader
{
/**
* @inheritDoc
*/
public function init($id = null)
{
// no init needed
}
/**
* Returns a value from configuration.
* @param $name string A key of the config to return.
* @param $default mixed A value to return if the param doesn't exist.
* @return mixed A value from the config.
*/
public function get( $name, $default = null ) {
return opanda_get_handler_options( $name );
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace bizpanda\includes\gates\context;
/**
* Interface IContextReader
*/
interface IContextReader
{
/**
* Inits the context.
* @param $id string An custom ID to init.
*/
public function init( $id = null );
/**
* Gets a value with a given key/name.
* @param $name string A key to get a value.
* @param null $default A default value if there is not any values exist.
* @return mixed A value.
*/
public function get( $name, $default = null );
}

View File

@@ -0,0 +1,16 @@
<?php
namespace bizpanda\includes\gates\context;
/**
* Interface IContextReader
*/
interface IContextReaderWriter extends IContextReader
{
/**
* Saves a value into the context.
* @param $name string A key of the value to save.
* @param $value mixed A value to save.
*/
public function set( $name, $value );
}

View File

@@ -0,0 +1,31 @@
<?php
namespace bizpanda\includes\gates\context;
/**
* Returns values from the current request.
*/
class RequestService implements IContextReader
{
/**
* @inheritDoc
*/
public function init($id = null)
{
// no init needed
}
/**
* Returns a param from the $_REQUEST array.
* @param $name string A key of the param to return.
* @param $default mixed A value to return if the param doesn't exist.
* @return mixed A value to return.
*/
public function get( $name, $default = null ) {
$prefixedName = 'opanda' . ucfirst( $name );
if ( isset( $_REQUEST[$prefixedName] ) ) return $_REQUEST[$prefixedName];
return ( isset( $_REQUEST[$name] ) ) ? $_REQUEST[$name] : $default;
}
}

View File

@@ -0,0 +1,57 @@
<?php
namespace bizpanda\includes\gates\context;
/**
* Manages the session.
*/
class SessionService implements IContextReaderWriter
{
public $sessionId = null;
/**
* Inits the session.
* @param $id string An ID of the session.
*/
public function init( $id = null ) {
$this->sessionId = $id;
}
/**
* Saves a value into the session.
* @param $name string A key of the value to save.
* @param $value mixed A value to save.
*/
public function set( $name, $value ) {
if ( defined('W3TC') ) {
setcookie( 'opanda_' . md5($name), $value, time() + 60 * 60 * 1 , COOKIEPATH, COOKIE_DOMAIN );
} else {
set_transient( 'opanda_' . md5($this->sessionId . '_' . $name), $value, 60 * 60 * 1 );
}
}
/**
* Returns a value from the session.
* @param $name string A key of the session value to return.
* @param $default mixed A value to return if the param doesn't exist.
* @return mixed A value from the session.
*/
public function get( $name, $default = null ) {
if ( defined('W3TC') ) {
$cookieName = 'opanda_' . md5($name);
$value = isset( $_COOKIE[$cookieName] ) ? $_COOKIE[$cookieName] : null;
if ( empty( $value ) ) return $default;
return $value;
} else {
$value = get_transient( 'opanda_' . md5($this->sessionId . '_' . $name) );
if ( empty( $value ) ) return $default;
return $value;
}
}
}