updates as $update ) { if ( 'development' === $update->response || 'upgrade' === $update->response ) { $has_update = true; break; } } if ( $has_update ) { if ( ! isset( $details['core'] ) || version_compare( $wp_version, $details['core']['current'], '>' ) ) { $details['core'] = array( 'current' => $wp_version, 'time' => time(), ); } } else if ( isset( $details['core'] ) ) { unset( $details['core'] ); } $plugins = get_site_transient( 'update_plugins' ); if ( isset( $details['plugins'] ) && is_array( $details['plugins'] ) ) { foreach ( $details['plugins'] as $plugin_slug => $plugin_details ) { if ( ! isset( $plugins->response[$plugin_slug] ) ) { unset( $details['plugins'][$plugin_slug] ); continue; } if ( isset( $plugins->checked[$plugin_slug] ) && version_compare( $plugins->checked[$plugin_slug], $plugin_details['current'], '>' ) ) { unset( $details['plugins'][$plugin_slug] ); } } } else { $details['plugins'] = array(); } foreach ( $plugins->response as $plugin_slug => $plugin_details ) { if ( isset( $plugins->checked[$plugin_slug] ) && version_compare( $plugins->checked[$plugin_slug], $plugin_details->new_version, '>=' ) ) { unset( $details['plugins'][$plugin_slug] ); continue; } if ( isset( $details['plugins'][$plugin_slug] ) || ! isset( $plugins->checked[$plugin_slug] ) ) { continue; } $details['plugins'][$plugin_slug] = array( 'current' => $plugins->checked[$plugin_slug], 'time' => time(), ); } if ( empty( $details['plugins'] ) ) { unset( $details['plugins'] ); } $themes = get_site_transient( 'update_themes' ); if ( isset( $details['themes'] ) && is_array( $details['themes'] ) ) { foreach ( $details['themes'] as $theme_slug => $theme_details ) { if ( ! isset( $themes->response[$theme_slug] ) ) { unset( $details['themes'][$theme_slug] ); continue; } if ( isset( $themes->checked[$theme_slug] ) && version_compare( $themes->checked[$theme_slug], $theme_details['current'], '>' ) ) { unset( $details['themes'][$theme_slug] ); } } } else { $details['themes'] = array(); } foreach ( $themes->response as $theme_slug => $theme_details ) { if ( isset( $themes->checked[$theme_slug] ) && version_compare( $themes->checked[$theme_slug], $theme_details['new_version'], '>=' ) ) { unset( $details['themes'][$theme_slug] ); continue; } if ( isset( $details['themes'][$theme_slug] ) || ! isset( $themes->checked[$theme_slug] ) ) { continue; } $details['themes'][$theme_slug] = array( 'current' => $themes->checked[$theme_slug], 'time' => time(), ); } if ( empty( $details['themes'] ) ) { unset( $details['themes'] ); } ITSEC_Modules::set_setting( 'version-management', 'update_details', $details ); } }