css files and performance issue
-
Hi,
This cooked plugin creating 2 css php files color.php and responsive.php under css folder this can be issue if you minify all your css files and combine them into one file for speed or performance.I think you can combine this small css into the function, I have a quick fix for my website checkout below. If you can update this function and remove that 2 dynamic css files from plugin that will be very good for performance
and imagesloaded.pkgd.min.js also 1 external request if you can serve this file from js folder in plugin…
// custom files
function equeue_my_assets() {
wp_deregister_script(‘cooked-imagesLoaded’);
wp_dequeue_style(‘cooked-colors’);
wp_dequeue_style(‘cooked-responsive’);
wp_register_script(‘cimagesLoaded’, ‘/assets/js/imagesloaded.pkgd.min.js’, array(‘jquery’), true );
wp_enqueue_script(‘cimagesLoaded’);
}
add_action(‘wp_enqueue_scripts’,’equeue_my_assets’,1000);function my_wp_head() {
// Cooked Plugin PHP CSS Files
$_cooked_settings = Cooked_Settings::get();
$cookedprogress = $_cooked_settings[‘main_color’];
$cookedrecipesearch = $_cooked_settings[‘main_color’];
$cookedfsm = $_cooked_settings[‘main_color’];
$cookedbrowsesearchbutton = $_cooked_settings[‘main_color_hover’];
$breakpoint1 = esc_html( $_cooked_settings[‘responsive_breakpoint_1’] );
$breakpoint2 = esc_html( $_cooked_settings[‘responsive_breakpoint_2’] );
$breakpoint3 = esc_html( $_cooked_settings[‘responsive_breakpoint_3′] );
echo ”
<style type=’text/css’>
.cooked-button,
.cooked-fsm .cooked-fsm-top,
.cooked-fsm .cooked-fsm-mobile-nav,
.cooked-fsm .cooked-fsm-mobile-nav a.cooked-active,
.cooked-browse-search-button,
.cooked-icon-loading,
.cooked-progress span { background: $cookedprogress; }
.cooked-recipe-search .cooked-taxonomy-selected { background: $cookedrecipesearch; }
.cooked-timer-obj,
.cooked-fsm a { color: $cookedfsm; }
.cooked-button:hover,
.cooked-recipe-search .cooked-taxonomy-selected:hover,
.cooked-browse-search-button:hover { background: $cookedbrowsesearchbutton; }
@media screen and ( max-width:”.$breakpoint1.”px ) {#cooked-timers-wrap { width:90%; margin:0 -45% 0 0; }
.cooked-recipe-grid { margin:3% -1.5%; width: 103%; }
.cooked-recipe-grid.cooked-columns-3 .cooked-recipe,
.cooked-recipe-grid.cooked-columns-4 .cooked-recipe,
.cooked-recipe-grid.cooked-columns-5 .cooked-recipe,
.cooked-recipe-grid.cooked-columns-6 .cooked-recipe { width: 50%; margin: 0 0 3%; padding: 0 1.5%; }}
@media screen and ( max-width: “.$breakpoint2.”px ) {
.cooked-recipe-grid { margin:5% -2.5%; width:105%; }
.cooked-recipe-grid.cooked-columns-2 .cooked-recipe,
.cooked-recipe-grid.cooked-columns-3 .cooked-recipe,
.cooked-recipe-grid.cooked-columns-4 .cooked-recipe,
.cooked-recipe-grid.cooked-columns-5 .cooked-recipe,
.cooked-recipe-grid.cooked-columns-6 .cooked-recipe
.cooked-recipe-grid .cooked-recipe { width:100%; margin:0 0 5%; padding:0 2.5%; }.cooked-recipe-info .cooked-left, .cooked-recipe-info .cooked-right { float:none; display:block; text-align:center; }
.cooked-recipe-info > section.cooked-right > span, .cooked-recipe-info > section.cooked-left > span { margin:0.5em 1em 1em; }
.cooked-recipe-info > section.cooked-left > span:last-child, .cooked-recipe-info > span:last-child { margin-right:1em; }
.cooked-recipe-info > section.cooked-right > span:first-child { margin-left:1em; }.cooked-recipe-search .cooked-fields-wrap { padding:0; display:block; }
.cooked-recipe-search .cooked-fields-wrap > .cooked-browse-search { width:100%; border-right:1px solid rgba(0,0,0,.15); margin:2% 0; }
.cooked-recipe-search .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block { width:100%; left:0; }
.cooked-recipe-search .cooked-fields-wrap > .cooked-field-wrap-select { display:block; width:100%; }
.cooked-recipe-search .cooked-sortby-wrap { display:block; position:relative; width:48%; right:auto; top:auto; float:left; margin:0; }
.cooked-recipe-search .cooked-sortby-wrap > select { position:absolute; width:100%; border:1px solid rgba(0,0,0,.15); }
.cooked-recipe-search .cooked-browse-search-button { width:50%; right:auto; position:relative; display:block; float:right; }#cooked-timers-wrap { width:20em; right:50%; margin:0 -10em 0 0; transform:translate3d(0,11.2em,0); }
#cooked-timers-wrap.cooked-multiples { margin:0; right:0; border-radius:10px 0 0 0; width:20em; }
#cooked-timers-wrap .cooked-timer-block { padding-left:3.25em; }
#cooked-timers-wrap .cooked-timer-block.cooked-visible { padding-top:1.25em; padding-left:3.25em; }
#cooked-timers-wrap .cooked-timer-block .cooked-timer-step { font-size:0.9em; }
#cooked-timers-wrap .cooked-timer-block .cooked-timer-desc { font-size:1.1em; padding:0; }
#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj { top:auto; right:auto; width:auto; font-size:1.1em; line-height:inherit; }
#cooked-timers-wrap .cooked-timer-block i.cooked-icon-times { line-height:2.1em; font-size:0.9em; top:1.25em; left:1.5em; }body.cooked-fsm-active #cooked-timers-wrap { bottom:4em; }
.cooked-fsm .cooked-fsm-mobile-nav { display:block; }
.cooked-fsm .cooked-fsm-ingredients,
.cooked-fsm .cooked-fsm-directions { width:100%; display:none; left:0; background:#fff; }
.cooked-fsm .cooked-fsm-ingredients.cooked-active,
.cooked-fsm .cooked-fsm-directions.cooked-active { display:block; }}
@media screen and ( max-width: “.$breakpoint3.”px ) {
.cooked-fsm .cooked-fsm-directions p { font-size:1em; }
.cooked-fsm .cooked-recipe-directions .cooked-heading { font-size:1.25em; }#cooked-timers-wrap { width:100%; right:0; margin:0; border-radius:0; }
.cooked-recipe-search .cooked-fields-wrap > .cooked-browse-search { margin:3% 0; }
.cooked-recipe-search .cooked-sortby-wrap { width:47%; }}
</style>
“;
}
add_action( ‘wp_head’, ‘my_wp_head’ );Please check this also body content not comming only title is returning…
1. wp-content/plugins/cooked/includes/class.cooked-recipe-meta.php
Line No: 144$recipe_excerpt = ( isset($recipe_excerpt) && $recipe_excerpt ? $recipe_excerpt : get_the_title( $post_id ) );
———>
$recipe_excerpt = ( isset($recipe_excerpt) && $recipe_excerpt ? $recipe_excerpt : $recipe_settings[‘excerpt’] );2. wp-content/plugins/cooked/includes/class.cooked-recipes.php
Line No: 366wp_update_post( array( ‘ID’ => $post_id, ‘post_excerpt’ => $recipe_settings[‘title’], ‘post_content’ => $recipe_settings[‘title’] ) );
———>
wp_update_post( array( ‘ID’ => $post_id, ‘post_excerpt’ => $recipe_settings[‘excerpt’], ‘post_content’ => $recipe_settings[‘excerpt’] ) );
- The topic ‘css files and performance issue’ is closed to new replies.