| @@ -828,8 +828,38 @@ | ||
| 828 | 828 | |
| 829 | 829 | return ! $error; |
| 830 | 830 | } |
| 831 | 831 | |
| 832 | + /** | |
| 833 | + * Method sync_partial_information() | |
| 834 | + * | |
| 835 | + * @param object $pWebsite The website object. | |
| 836 | + * @param array $information Array contaning information returned from child site. | |
| 837 | + */ | |
| 838 | + public static function sync_partial_information( &$pWebsite, &$information ) { | |
| 839 | + $websiteValues = array(); | |
| 840 | + | |
| 841 | + /** | |
| 842 | + * Filter: mainwp_before_save_partial_sync_result | |
| 843 | + * | |
| 844 | + * Filters partial sync data returned from the child site before saving it to the database. | |
| 845 | + * | |
| 846 | + * @param array $information Partial sync data returned from the child site. | |
| 847 | + * @param object $pWebsite Object containing child site data. | |
| 848 | + * | |
| 849 | + * @since 6.2.1 | |
| 850 | + */ | |
| 851 | + $information = apply_filters( 'mainwp_before_save_partial_sync_result', $information, $pWebsite ); | |
| 852 | + | |
| 853 | + if ( isset( $information['plugins'] ) ) { | |
| 854 | + $plugins_info = $information['plugins']; | |
| 855 | + $websiteValues['plugins'] = wp_json_encode( $plugins_info ); | |
| 856 | + } | |
| 857 | + if ( ! empty( $websiteValues ) ) { | |
| 858 | + MainWP_DB::instance()->update_website_values( $pWebsite->id, $websiteValues ); | |
| 859 | + } | |
| 860 | + } | |
| 861 | + | |
| 832 | 862 | |
| 833 | 863 | /** |
| 834 | 864 | * Method get_telem_sync_info. |
| 835 | 865 | * |