本文整理汇总了PHP中RevSliderOperations::get_performance方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderOperations::get_performance方法的具体用法?PHP RevSliderOperations::get_performance怎么用?PHP RevSliderOperations::get_performance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderOperations
的用法示例。
在下文中一共展示了RevSliderOperations::get_performance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_slider_speed
//.........这里部分代码省略.........
foreach ($my_fonts as $c_font) {
$fcount = RevSliderBase::get_font_weight_count($c_font);
$_li = '<li class="tp-monitor-listli">';
if ($fcount < 4) {
$_li .= '<span class="tp-monitor-good"></span>';
} else {
if ($fcount < 7) {
$_li .= '<span class="tp-monitor-well"></span>';
} else {
$_li .= '<span class="tp-monitor-warning"></span>';
}
}
$_li .= '<span class="tp-monitor-file">';
$_li .= strip_tags($c_font);
$_li .= '</span>';
$_li .= '</li>';
if ($fcount > 4) {
$issues .= $_li;
}
echo $_li;
$all_font_count += $fcount;
}
}
echo '</ul>';
?>
</div><!-- END OF OVERALL Div-->
<script>
jQuery(document).on("ready",function() {
jQuery('body').on('click','.tp-monitor-showdetails',function() {
var bt = jQuery(this);
if (bt.hasClass("selected")) {
bt.find('.tp-show-inner-btn').html(bt.data('close'));
bt.removeClass("selected");
jQuery(bt.data('target')).slideUp(200);
} else {
bt.find('.tp-show-inner-btn').html(bt.data('open'));
bt.addClass("selected");
jQuery(bt.data('target')).slideDown(200);
}
})
})
</script>
<?php
$content = ob_get_contents();
ob_end_clean();
if ($img_counter == 0) {
$img_counter = 1;
}
if ($slide_counter == 0) {
$slide_counter = 1;
}
$overall = RevSliderOperations::get_performance($total_size / $slide_counter, 0, 400000);
// 400KB / Slide is ok
$image = RevSliderOperations::get_performance($img_size / $img_counter, 0, 100000);
// 100KB Image OK
$css = RevSliderOperations::get_performance($css_size, 0, 150000);
// 150KB CSS OK
$js = RevSliderOperations::get_performance($js_size, 0, 250000);
// 250KB Image OK
$font = RevSliderOperations::get_performance($all_font_count, 0, 15);
// 250KB Image OK
$firstslide_size += $js_size;
$firstslide_size += $css_size;
$smartslide_size += $js_size;
$smartslide_size += $css_size;
$content = str_replace("%overall_performance%", $overall["proc"], $content);
$content = str_replace("%overall_color%", $overall["col"], $content);
$content = str_replace("%overall_size%", size_format($total_size, 2), $content);
$content = str_replace("%image_performance%", $image["proc"], $content);
$content = str_replace("%image_color%", $image["col"], $content);
$content = str_replace("%css_performance%", $css["proc"], $content);
$content = str_replace("%css_color%", $css["col"], $content);
$content = str_replace("%css_size%", size_format($css_size, 2), $content);
$content = str_replace("%js_performance%", $js["proc"], $content);
$content = str_replace("%js_color%", $js["col"], $content);
$content = str_replace("%js_size%", size_format($js_size, 2), $content);
$content = str_replace("%font_performance%", $font["proc"], $content);
$content = str_replace("%font_color%", $font["col"], $content);
$content = str_replace("%font_size%", $all_font_count, $content);
$content = str_replace("%issues%", $issues, $content);
$content = str_replace("%firstslide_size%", size_format($firstslide_size, 2), $content);
$content = str_replace("%smartslide_size%", size_format($smartslide_size, 2), $content);
$content = str_replace("%allslide_size%", size_format($total_size, 2), $content);
$total_size = $total_size / 1000;
$content = str_replace("%umtsspeed-all%", gmdate('i:s', $total_size / 48), $content);
$content = str_replace("%dslspeed-all%", gmdate('i:s', $total_size / 307), $content);
$content = str_replace("%t1speed-all%", gmdate('i:s', $total_size / 1180), $content);
$firstslide_size = $firstslide_size / 1000;
$content = str_replace("%umtsspeed-single%", gmdate('i:s', $firstslide_size / 48), $content);
$content = str_replace("%dslspeed-single%", gmdate('i:s', $firstslide_size / 307), $content);
$content = str_replace("%t1speed-single%", gmdate('i:s', $firstslide_size / 1180), $content);
$smartslide_size = $smartslide_size / 1000;
$content = str_replace("%umtsspeed-smart%", gmdate('i:s', $smartslide_size / 48), $content);
$content = str_replace("%dslspeed-smart%", gmdate('i:s', $smartslide_size / 307), $content);
$content = str_replace("%t1speed-smart%", gmdate('i:s', $smartslide_size / 1180), $content);
echo $content;
}