0 ? 1 : 0; if ( ! $transient || empty( $transient ) ) { return 0; } $ignored_checks = get_site_option( 'oc_marked_resolved', array() ); if ( empty( $ignored_checks ) ) { $ignored_checks = array(); } @$time = $transient['time']; unset( $transient['time'] ); $success = 0; $todo = 0; foreach ( $transient as $check => $score ) { if ( in_array( str_replace( array( 'ocsh_fix_', 'ocsh_fix_check_', 'check_' ), '', $check ), $ignored_checks ) ) { $score = OC_RESOLVED; } if ( $score == OC_RESOLVED ) { $success++; } elseif ( $score == OC_OPEN ) { $todo++; } } $percent = floor( ( $success * 100 ) / ( count( $transient ) + $count ) ); if ( $percent == '100.00' ) { $percent = 100; } return array( OC_HM_SCORE => $percent, 'time' => $time, 'todo' => $todo, ); } } if ( ! function_exists( 'oc_vulns_count' ) ) { function oc_vulns_count() { if ( class_exists( 'OCVMNotifications' ) ) { $notices = new OCVMNotifications(); $notices->prepareNotifications( 1 ); // get notices count $count = is_countable( $notices->notices ) ? count( $notices->notices ) : 0; } else { $count = 0; } return $count; } }