queue ); $styles = count( (array) wp_styles()->queue ); $report = array( 'captured_at' => time(), 'scripts' => $scripts, 'styles' => $styles, 'limits' => array( 'scripts' => max( 5, absint( get_option( 'nbh_performance_budget_script_count', 30 ) ) ), 'styles' => max( 5, absint( get_option( 'nbh_performance_budget_style_count', 20 ) ) ), ), ); $report['passed'] = $scripts <= $report['limits']['scripts'] && $styles <= $report['limits']['styles']; update_option( 'nbh_performance_performance_budget_last', $report, false ); do_action( 'nbh_performance_performance_budget_measured', $report ); } /** @param mixed $default_value Default. @return array */ public function report( $default_value = array() ) { $report = get_option( 'nbh_performance_performance_budget_last', array() ); return is_array( $report ) ? $report : (array) $default_value; } }