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,41 @@
const TCBSeoPlugin = require( './tcb-seo-plugin' );
module.exports = class TCBRankMathPlugin extends TCBSeoPlugin {
/**
* Init the custom fields
*/
init() {
this.content = '';
this.hooks();
this.fetchContent();
}
/**
* Hook into Rank Math App eco-system
*/
hooks() {
if ( window.wp && wp.hooks ) {
wp.hooks.addFilter( 'rank_math_content', 'rank-math', content => {
return this.content ? this.content : content;
}, 11 );
}
}
/**
* Fetch Post Content from TCB
*
* @param fetchedContent
*/
sendContent( fetchedContent ) {
if ( ! this.isEditedWithTar ) {
this.content = fetchedContent;
}
if ( typeof window.rankMathEditor !== 'undefined' ) {
rankMathEditor.refresh( 'content' );
}
}
afterFetch( response ) {
this.sendContent( response );
}
};

View File

@@ -0,0 +1,30 @@
( $ => {
module.exports = class TCBSeoPlugin {
/**
* Fetch Post Content from TCB
*/
fetchContent() {
$.ajax( {
url: ajaxurl,
type: 'post',
dataType: 'json',
data: {
post_id: TCB_Post_Edit_Data.post_id,
action: 'tve_get_seo_content'
}
} ).done( response => {
const $content = $( `<div>${response.content}</div>` );
/* Remove TTB headers and footers from SEO analysis */
$content.find( 'header#thrive-header, footer#thrive-footer, aside#theme-sidebar-section' ).remove();
this.isEditedWithTar = response.is_edited_with_tar;
this.afterFetch( $content[ 0 ].outerHTML );
} );
}
afterFetch() {
throw Error( 'Class should implement the afterFetch function' );
}
}
} )( jQuery );

View File

@@ -0,0 +1,44 @@
( $ => {
const TCBSeoPlugin = require( './tcb-seo-plugin' );
module.exports = class TCBYoastPlugin extends TCBSeoPlugin {
init() {
YoastSEO.app.registerPlugin( 'tcbYoastPlugin', {status: 'loading'} );
this.fetchContent();
}
sendContent( fetchedContent ) {
YoastSEO.app.pluginReady( 'tcbYoastPlugin' );
/**
* @param modification {string} The name of the filter
* @param callable {function} The callable
* @param pluginName {string} The plugin that is registering the modification.
* @param priority {number} (optional) Used to specify the order in which the callables
* associated with a particular filter are called. Lower numbers
* correspond with earlier execution.
*/
YoastSEO.app.registerModification( 'content', content => this.parseTCBContent( content, fetchedContent ), 'tcbYoastPlugin', 5 );
}
parseTCBContent( content, architectContent ) {
/* Remove empty tags because yoast kind fails on parse here */
if ( architectContent ) {
const contentSelector = '.tcb-style-wrap',
$content = $( `<div>${architectContent}</div>` ).find( contentSelector );
$content.find( '*:empty:not(img,input,br)' ).remove();
architectContent = $content.html();
}
return architectContent ? architectContent : content;
}
afterFetch( response ) {
this.sendContent( response );
}
}
} )( jQuery );