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,149 @@
<?php
/**
* Database functions
*
* @link https://raiolanetworks.es
* @since 1.0.0
*
* @package Wp_Database_Tools
* @subpackage Wp_Database_Tools/includes
*/
/**
* Detects current plugins in the installation
* *
*
* @since 1.0.0
* @package Wp_Database_Tools
* @subpackage Wp_Database_Tools/includes
* @author Patricia Alvarez <patricia@raiolanetworks.es>
*/
class Wp_Database_Tools_Plugins {
/**
* Plugins in the installation.
*
* @since 1.0.0
* @access protected
* @var array $data The general data of database.
*/
protected $plugins;
public function __construct() {
$this->init();
}
protected function init() {
$this->format_plugins();
}
protected function format_plugins() {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$plugins_data = array();
foreach ( get_plugins() as $key => $plugin ) {
// Check marketplace
$marketplace = 'unknown';
if ( str_contains( $plugin['AuthorURI'], 'codecanyon' ) || str_contains( $plugin['PluginURI'], 'codecanyon' ) ) {
$marketplace = 'https://codecanyon.net';
}
if ( str_contains( $plugin['AuthorURI'], 'themeforest' ) || str_contains( $plugin['PluginURI'], 'themeforest' ) ) {
$marketplace = 'https://themeforest.net';
}
if ( str_contains( $plugin['AuthorURI'], 'wordpress.org' ) || str_contains( $plugin['PluginURI'], 'wordpress.org' ) ) {
$marketplace = 'https://wordpress.org';
}
// Format plugins data
$plugins_data[ $key ]['name'] = $plugin['Name'];
$plugins_data[ $key ]['marketplace'] = $marketplace;
$plugins_data[ $key ]['status'] = $this->get_plugin_status( $key );
$plugins_data[ $key ]['initials'] = $this->get_initials( $key );
$plugins_data[ $key ]['description'] = $plugin['Description'];
$plugins_data[ $key ]['text_domain'] = $plugin['TextDomain'];
$plugins_data[ $key ]['slug'] = explode( '/', $key )[0];
$plugins_data[ $key ]['version'] = $plugin['Version'];
$plugins_data[ $key ]['author'] = $plugin['Author'];
$plugins_data[ $key ]['author_name'] = $plugin['AuthorName'];
$plugins_data[ $key ]['author_url'] = $plugin['AuthorURI'];
$plugins_data[ $key ]['name'] = $plugin['Name'];
$plugins_data[ $key ]['path'] = $key;
}
$this->plugins = $plugins_data;
}
/**
* Get's the activation status for a plugin.
*
* @since 5.5.0
*
* @param string $plugin The plugin file to check.
* @return string 'active' . 'inactive' or 'uninstalled'.
* @author Patricia Alvarez <patricia@raiolanetworks.es>
*/
protected function get_plugin_status( $plugin ) {
// Check if exist path
if ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin ) ) {
return 'uninstalled';
}
// Check if exist is active
if ( is_plugin_active( $plugin ) ) {
return 'active';
}
// Check if exist is inactive
if ( is_plugin_inactive( $plugin ) ) {
return 'inactive';
}
// // Check if exist is active
// if ( is_plugin_active_for_network( $plugin ) ) {
// return 'network-active';
// }
}
public function get_initials( $input ) {
$words = preg_split( '/[\s,_-]+/', $input );
$initials = '';
foreach ( $words as $input => $word ) {
$initials .= substr( $word, 0, 1 );
}
return $initials;
}
/**
* Get's the activation status for a plugin.
*
* @since 1.0.0
*
* @param string $plugin The plugin file to check.
* @return string 'active' . 'inactive' or 'uninstalled'.
* @author Patricia Alvarez <patricia@raiolanetworks.es>
*/
public function get_plugins() {
return $this->plugins;
}
}