%3$s',
esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=mcp-adapter&TB_iframe=true&width=600&height=550' ) ),
esc_attr__( 'MCP Adapter', 'ai-content-generator-for-woocommerce' ),
$plugin_link
);
}
?>
array(
'href' => array(),
'class' => array(),
'data-title' => array(),
),
)
);
?>
204 ) );
} );
}
} );
// Backwards compatibility: auto-enable the API key toggle for existing installs.
add_action( 'admin_init', function() {
if ( '' !== trim( (string) get_option( 'wtofe_chatgpt_api_key', '' ) )
&& false === get_option( 'wtofe_use_custom_api_key' ) ) {
update_option( 'wtofe_use_custom_api_key', true );
}
} );
// Backwards compatibility: raise product names from the old 300-token default,
// which reasoning models use up before writing any names. Runs once, so a
// limit of 300 chosen later is left alone.
add_action( 'admin_init', function() {
if ( get_option( 'wtofe_ai_title_tokens_raised' ) ) {
return;
}
if ( 300 === absint( get_option( 'wtofe_ai_max_tokens_title', 0 ) ) ) {
update_option( 'wtofe_ai_max_tokens_title', 2000 );
}
update_option( 'wtofe_ai_title_tokens_raised', 1 );
} );
// ── Core loader ───────────────────────────────────────────────────────────────
require_once WTOFE_AI_PLUGIN_DIR . 'includes/class-ai-content-generator-for-woocommerce-loader.php';
require_once WTOFE_AI_PLUGIN_DIR . 'includes/class-ai-content-generator-for-woocommerce.php';
// ── Module files loaded at request time ──────────────────────────────────────
require_once WTOFE_AI_PLUGIN_DIR . 'admin/modules/uninstall-feedback.php';
require_once WTOFE_AI_PLUGIN_DIR . 'admin/modules/request-feature/class-request-feature.php';
// ── Boot ─────────────────────────────────────────────────────────────────────
function wtofe_run_ai_content_generator() {
$plugin = new AI_Content_Generator_For_WooCommerce();
$plugin->run();
}
wtofe_run_ai_content_generator();