Changeset 3433887
- Timestamp:
- 01/06/2026 07:49:29 PM (6 weeks ago)
- Location:
- multi-connect/trunk
- Files:
-
- 3 edited
-
includes/class-multi-connect-api.php (modified) (4 diffs)
-
multi-connect.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
multi-connect/trunk/includes/class-multi-connect-api.php
r3433883 r3433887 613 613 require_once MULTICONNECT_PLUGIN_ABSPATH . 'wp-admin/includes/update.php'; 614 614 615 // Guardar actualizaciones de plugins/temas premium antes de limpiar cache. 616 // Los plugins premium (WPCode Pro, etc.) inyectan sus actualizaciones via hooks 617 // que pueden no ejecutarse correctamente en contexto REST API. 618 $existing_plugins = get_site_transient( 'update_plugins' ); 619 $existing_themes = get_site_transient( 'update_themes' ); 620 621 // Identificar plugins premium (los que no están en wordpress.org). 622 $premium_plugin_updates = array(); 623 if ( $existing_plugins && ! empty( $existing_plugins->response ) ) { 624 foreach ( $existing_plugins->response as $plugin_file => $plugin_data ) { 625 $plugin_data = (object) $plugin_data; 626 // Los plugins de wordpress.org tienen id con formato "w.org/plugins/slug". 627 $is_wporg = isset( $plugin_data->id ) && strpos( $plugin_data->id, 'w.org/plugins/' ) !== false; 628 if ( ! $is_wporg ) { 629 $premium_plugin_updates[ $plugin_file ] = $plugin_data; 630 } 631 } 632 } 633 634 // Identificar temas premium. 635 $premium_theme_updates = array(); 636 if ( $existing_themes && ! empty( $existing_themes->response ) ) { 637 foreach ( $existing_themes->response as $theme_slug => $theme_data ) { 638 $theme_data = (array) $theme_data; 639 // Los temas de wordpress.org tienen theme en el array. 640 $is_wporg = isset( $theme_data['theme'] ) && ! empty( $theme_data['url'] ) && strpos( $theme_data['url'], 'wordpress.org' ) !== false; 641 if ( ! $is_wporg ) { 642 $premium_theme_updates[ $theme_slug ] = $theme_data; 643 } 644 } 645 } 646 615 647 // Forzar la verificación de actualizaciones. 616 648 delete_site_transient( 'update_core' ); … … 619 651 delete_site_transient( 'available_translations' ); 620 652 621 // Limpiar la caché de actualizaciones 653 // Limpiar la caché de actualizaciones. 622 654 wp_clean_update_cache(); 623 655 624 // Forzar la verificación de actualizaciones con tiempo actual 656 // Forzar la verificación de actualizaciones con tiempo actual. 625 657 wp_version_check( array(), true ); 626 658 wp_update_plugins(); 627 659 wp_update_themes(); 660 661 // Restaurar actualizaciones de plugins premium al transient. 662 if ( ! empty( $premium_plugin_updates ) ) { 663 $plugins = get_site_transient( 'update_plugins' ); 664 if ( $plugins ) { 665 foreach ( $premium_plugin_updates as $plugin_file => $plugin_data ) { 666 $plugins->response[ $plugin_file ] = $plugin_data; 667 } 668 set_site_transient( 'update_plugins', $plugins ); 669 } 670 } 671 672 // Restaurar actualizaciones de temas premium al transient. 673 if ( ! empty( $premium_theme_updates ) ) { 674 $themes = get_site_transient( 'update_themes' ); 675 if ( $themes ) { 676 foreach ( $premium_theme_updates as $theme_slug => $theme_data ) { 677 $themes->response[ $theme_slug ] = $theme_data; 678 } 679 set_site_transient( 'update_themes', $themes ); 680 } 681 } 628 682 629 683 $updates = array( … … 646 700 // Verificar actualizaciones de plugins. 647 701 get_plugin_updates(); 648 649 // Obtener el transient actual y forzar que los plugins premium agreguen sus actualizaciones.650 702 $plugins = get_site_transient( 'update_plugins' ); 651 if ( $plugins ) {652 // Aplicar el filtro con el transient real para que plugins premium puedan inyectar sus actualizaciones.653 try {654 $plugins = apply_filters( 'pre_set_site_transient_update_plugins', $plugins, 'update_plugins' );655 } catch ( Throwable $e ) {656 // Si hay error, continuar con el transient original.657 }658 }659 703 if ( $plugins && ! empty( $plugins->response ) ) { 660 704 foreach ( $plugins->response as $plugin_file => $plugin_data ) { … … 672 716 // Verificar actualizaciones de temas. 673 717 get_theme_updates(); 674 675 // Obtener el transient actual y forzar que los temas premium agreguen sus actualizaciones.676 718 $themes = get_site_transient( 'update_themes' ); 677 if ( $themes ) {678 // Aplicar el filtro con el transient real para que temas premium puedan inyectar sus actualizaciones.679 try {680 $themes = apply_filters( 'pre_set_site_transient_update_themes', $themes, 'update_themes' );681 } catch ( Throwable $e ) {682 // Si hay error, continuar con el transient original.683 }684 }685 719 if ( $themes && ! empty( $themes->response ) ) { 686 720 foreach ( $themes->response as $theme_slug => $theme_data ) { -
multi-connect/trunk/multi-connect.php
r3433883 r3433887 4 4 * Plugin URI: https://multi-wp.com 5 5 * Description: Connect your WordPress site with Multi-WP for centralized management and updates. 6 * Version: 1.0.5 46 * Version: 1.0.55 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 7.4 -
multi-connect/trunk/readme.txt
r3433883 r3433887 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0.5 47 Stable tag: 1.0.55 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 44 44 45 45 == Changelog == 46 47 = 1.0.55 = 48 * Fixed: Premium plugins and themes updates preserved when refreshing update cache (WPCode Pro, Elementor Pro, etc.) 46 49 47 50 = 1.0.54 =
Note: See TracChangeset
for help on using the changeset viewer.