Edit File by line
/home/zeestwma/richards.../wp-inclu...
File: script-loader.php
*/
[3000] Fix | Delete
$total_inline_size = 0;
[3001] Fix | Delete
[3002] Fix | Delete
// Loop styles.
[3003] Fix | Delete
foreach ( $styles as $style ) {
[3004] Fix | Delete
[3005] Fix | Delete
// Size check. Since styles are ordered by size, we can break the loop.
[3006] Fix | Delete
if ( $total_inline_size + $style['size'] > $total_inline_limit ) {
[3007] Fix | Delete
break;
[3008] Fix | Delete
}
[3009] Fix | Delete
[3010] Fix | Delete
// Get the styles if we don't already have them.
[3011] Fix | Delete
$style['css'] = file_get_contents( $style['path'] );
[3012] Fix | Delete
[3013] Fix | Delete
/*
[3014] Fix | Delete
* Check if the style contains relative URLs that need to be modified.
[3015] Fix | Delete
* URLs relative to the stylesheet's path should be converted to relative to the site's root.
[3016] Fix | Delete
*/
[3017] Fix | Delete
$style['css'] = _wp_normalize_relative_css_links( $style['css'], $style['src'] );
[3018] Fix | Delete
[3019] Fix | Delete
// Set `src` to `false` and add styles inline.
[3020] Fix | Delete
$wp_styles->registered[ $style['handle'] ]->src = false;
[3021] Fix | Delete
if ( empty( $wp_styles->registered[ $style['handle'] ]->extra['after'] ) ) {
[3022] Fix | Delete
$wp_styles->registered[ $style['handle'] ]->extra['after'] = array();
[3023] Fix | Delete
}
[3024] Fix | Delete
array_unshift( $wp_styles->registered[ $style['handle'] ]->extra['after'], $style['css'] );
[3025] Fix | Delete
[3026] Fix | Delete
// Add the styles size to the $total_inline_size var.
[3027] Fix | Delete
$total_inline_size += (int) $style['size'];
[3028] Fix | Delete
}
[3029] Fix | Delete
}
[3030] Fix | Delete
}
[3031] Fix | Delete
[3032] Fix | Delete
/**
[3033] Fix | Delete
* Makes URLs relative to the WordPress installation.
[3034] Fix | Delete
*
[3035] Fix | Delete
* @since 5.9.0
[3036] Fix | Delete
* @access private
[3037] Fix | Delete
*
[3038] Fix | Delete
* @param string $css The CSS to make URLs relative to the WordPress installation.
[3039] Fix | Delete
* @param string $stylesheet_url The URL to the stylesheet.
[3040] Fix | Delete
*
[3041] Fix | Delete
* @return string The CSS with URLs made relative to the WordPress installation.
[3042] Fix | Delete
*/
[3043] Fix | Delete
function _wp_normalize_relative_css_links( $css, $stylesheet_url ) {
[3044] Fix | Delete
return preg_replace_callback(
[3045] Fix | Delete
'#(url\s*\(\s*[\'"]?\s*)([^\'"\)]+)#',
[3046] Fix | Delete
static function ( $matches ) use ( $stylesheet_url ) {
[3047] Fix | Delete
list( , $prefix, $url ) = $matches;
[3048] Fix | Delete
[3049] Fix | Delete
// Short-circuit if the URL does not require normalization.
[3050] Fix | Delete
if (
[3051] Fix | Delete
str_starts_with( $url, 'http:' ) ||
[3052] Fix | Delete
str_starts_with( $url, 'https:' ) ||
[3053] Fix | Delete
str_starts_with( $url, '//' ) ||
[3054] Fix | Delete
str_starts_with( $url, '#' ) ||
[3055] Fix | Delete
str_starts_with( $url, 'data:' )
[3056] Fix | Delete
) {
[3057] Fix | Delete
return $matches[0];
[3058] Fix | Delete
}
[3059] Fix | Delete
[3060] Fix | Delete
// Build the absolute URL.
[3061] Fix | Delete
$absolute_url = dirname( $stylesheet_url ) . '/' . $url;
[3062] Fix | Delete
$absolute_url = str_replace( '/./', '/', $absolute_url );
[3063] Fix | Delete
[3064] Fix | Delete
// Convert to URL related to the site root.
[3065] Fix | Delete
$url = wp_make_link_relative( $absolute_url );
[3066] Fix | Delete
[3067] Fix | Delete
return $prefix . $url;
[3068] Fix | Delete
},
[3069] Fix | Delete
$css
[3070] Fix | Delete
);
[3071] Fix | Delete
}
[3072] Fix | Delete
[3073] Fix | Delete
/**
[3074] Fix | Delete
* Function that enqueues the CSS Custom Properties coming from theme.json.
[3075] Fix | Delete
*
[3076] Fix | Delete
* @since 5.9.0
[3077] Fix | Delete
*/
[3078] Fix | Delete
function wp_enqueue_global_styles_css_custom_properties() {
[3079] Fix | Delete
wp_register_style( 'global-styles-css-custom-properties', false );
[3080] Fix | Delete
wp_add_inline_style( 'global-styles-css-custom-properties', wp_get_global_stylesheet( array( 'variables' ) ) );
[3081] Fix | Delete
wp_enqueue_style( 'global-styles-css-custom-properties' );
[3082] Fix | Delete
}
[3083] Fix | Delete
[3084] Fix | Delete
/**
[3085] Fix | Delete
* Hooks inline styles in the proper place, depending on the active theme.
[3086] Fix | Delete
*
[3087] Fix | Delete
* @since 5.9.1
[3088] Fix | Delete
* @since 6.1.0 Added the `$priority` parameter.
[3089] Fix | Delete
*
[3090] Fix | Delete
* For block themes, styles are loaded in the head.
[3091] Fix | Delete
* For classic ones, styles are loaded in the body because the wp_head action happens before render_block.
[3092] Fix | Delete
*
[3093] Fix | Delete
* @link https://core.trac.wordpress.org/ticket/53494.
[3094] Fix | Delete
*
[3095] Fix | Delete
* @param string $style String containing the CSS styles to be added.
[3096] Fix | Delete
* @param int $priority To set the priority for the add_action.
[3097] Fix | Delete
*/
[3098] Fix | Delete
function wp_enqueue_block_support_styles( $style, $priority = 10 ) {
[3099] Fix | Delete
$action_hook_name = 'wp_footer';
[3100] Fix | Delete
if ( wp_is_block_theme() ) {
[3101] Fix | Delete
$action_hook_name = 'wp_head';
[3102] Fix | Delete
}
[3103] Fix | Delete
add_action(
[3104] Fix | Delete
$action_hook_name,
[3105] Fix | Delete
static function () use ( $style ) {
[3106] Fix | Delete
echo "<style>$style</style>\n";
[3107] Fix | Delete
},
[3108] Fix | Delete
$priority
[3109] Fix | Delete
);
[3110] Fix | Delete
}
[3111] Fix | Delete
[3112] Fix | Delete
/**
[3113] Fix | Delete
* Fetches, processes and compiles stored core styles, then combines and renders them to the page.
[3114] Fix | Delete
* Styles are stored via the style engine API.
[3115] Fix | Delete
*
[3116] Fix | Delete
* @link https://developer.wordpress.org/block-editor/reference-guides/packages/packages-style-engine/
[3117] Fix | Delete
*
[3118] Fix | Delete
* @since 6.1.0
[3119] Fix | Delete
*
[3120] Fix | Delete
* @param array $options {
[3121] Fix | Delete
* Optional. An array of options to pass to wp_style_engine_get_stylesheet_from_context().
[3122] Fix | Delete
* Default empty array.
[3123] Fix | Delete
*
[3124] Fix | Delete
* @type bool $optimize Whether to optimize the CSS output, e.g., combine rules.
[3125] Fix | Delete
* Default false.
[3126] Fix | Delete
* @type bool $prettify Whether to add new lines and indents to output.
[3127] Fix | Delete
* Default to whether the `SCRIPT_DEBUG` constant is defined.
[3128] Fix | Delete
* }
[3129] Fix | Delete
*/
[3130] Fix | Delete
function wp_enqueue_stored_styles( $options = array() ) {
[3131] Fix | Delete
$is_block_theme = wp_is_block_theme();
[3132] Fix | Delete
$is_classic_theme = ! $is_block_theme;
[3133] Fix | Delete
[3134] Fix | Delete
/*
[3135] Fix | Delete
* For block themes, this function prints stored styles in the header.
[3136] Fix | Delete
* For classic themes, in the footer.
[3137] Fix | Delete
*/
[3138] Fix | Delete
if (
[3139] Fix | Delete
( $is_block_theme && doing_action( 'wp_footer' ) ) ||
[3140] Fix | Delete
( $is_classic_theme && doing_action( 'wp_enqueue_scripts' ) )
[3141] Fix | Delete
) {
[3142] Fix | Delete
return;
[3143] Fix | Delete
}
[3144] Fix | Delete
[3145] Fix | Delete
$core_styles_keys = array( 'block-supports' );
[3146] Fix | Delete
$compiled_core_stylesheet = '';
[3147] Fix | Delete
$style_tag_id = 'core';
[3148] Fix | Delete
// Adds comment if code is prettified to identify core styles sections in debugging.
[3149] Fix | Delete
$should_prettify = isset( $options['prettify'] ) ? true === $options['prettify'] : defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
[3150] Fix | Delete
foreach ( $core_styles_keys as $style_key ) {
[3151] Fix | Delete
if ( $should_prettify ) {
[3152] Fix | Delete
$compiled_core_stylesheet .= "/**\n * Core styles: $style_key\n */\n";
[3153] Fix | Delete
}
[3154] Fix | Delete
// Chains core store ids to signify what the styles contain.
[3155] Fix | Delete
$style_tag_id .= '-' . $style_key;
[3156] Fix | Delete
$compiled_core_stylesheet .= wp_style_engine_get_stylesheet_from_context( $style_key, $options );
[3157] Fix | Delete
}
[3158] Fix | Delete
[3159] Fix | Delete
// Combines Core styles.
[3160] Fix | Delete
if ( ! empty( $compiled_core_stylesheet ) ) {
[3161] Fix | Delete
wp_register_style( $style_tag_id, false );
[3162] Fix | Delete
wp_add_inline_style( $style_tag_id, $compiled_core_stylesheet );
[3163] Fix | Delete
wp_enqueue_style( $style_tag_id );
[3164] Fix | Delete
}
[3165] Fix | Delete
[3166] Fix | Delete
// Prints out any other stores registered by themes or otherwise.
[3167] Fix | Delete
$additional_stores = WP_Style_Engine_CSS_Rules_Store::get_stores();
[3168] Fix | Delete
foreach ( array_keys( $additional_stores ) as $store_name ) {
[3169] Fix | Delete
if ( in_array( $store_name, $core_styles_keys, true ) ) {
[3170] Fix | Delete
continue;
[3171] Fix | Delete
}
[3172] Fix | Delete
$styles = wp_style_engine_get_stylesheet_from_context( $store_name, $options );
[3173] Fix | Delete
if ( ! empty( $styles ) ) {
[3174] Fix | Delete
$key = "wp-style-engine-$store_name";
[3175] Fix | Delete
wp_register_style( $key, false );
[3176] Fix | Delete
wp_add_inline_style( $key, $styles );
[3177] Fix | Delete
wp_enqueue_style( $key );
[3178] Fix | Delete
}
[3179] Fix | Delete
}
[3180] Fix | Delete
}
[3181] Fix | Delete
[3182] Fix | Delete
/**
[3183] Fix | Delete
* Enqueues a stylesheet for a specific block.
[3184] Fix | Delete
*
[3185] Fix | Delete
* If the theme has opted-in to separate-styles loading,
[3186] Fix | Delete
* then the stylesheet will be enqueued on-render,
[3187] Fix | Delete
* otherwise when the block inits.
[3188] Fix | Delete
*
[3189] Fix | Delete
* @since 5.9.0
[3190] Fix | Delete
*
[3191] Fix | Delete
* @param string $block_name The block-name, including namespace.
[3192] Fix | Delete
* @param array $args {
[3193] Fix | Delete
* An array of arguments. See wp_register_style() for full information about each argument.
[3194] Fix | Delete
*
[3195] Fix | Delete
* @type string $handle The handle for the stylesheet.
[3196] Fix | Delete
* @type string|false $src The source URL of the stylesheet.
[3197] Fix | Delete
* @type string[] $deps Array of registered stylesheet handles this stylesheet depends on.
[3198] Fix | Delete
* @type string|bool|null $ver Stylesheet version number.
[3199] Fix | Delete
* @type string $media The media for which this stylesheet has been defined.
[3200] Fix | Delete
* @type string|null $path Absolute path to the stylesheet, so that it can potentially be inlined.
[3201] Fix | Delete
* }
[3202] Fix | Delete
*/
[3203] Fix | Delete
function wp_enqueue_block_style( $block_name, $args ) {
[3204] Fix | Delete
$args = wp_parse_args(
[3205] Fix | Delete
$args,
[3206] Fix | Delete
array(
[3207] Fix | Delete
'handle' => '',
[3208] Fix | Delete
'src' => '',
[3209] Fix | Delete
'deps' => array(),
[3210] Fix | Delete
'ver' => false,
[3211] Fix | Delete
'media' => 'all',
[3212] Fix | Delete
)
[3213] Fix | Delete
);
[3214] Fix | Delete
[3215] Fix | Delete
/**
[3216] Fix | Delete
* Callback function to register and enqueue styles.
[3217] Fix | Delete
*
[3218] Fix | Delete
* @param string $content When the callback is used for the render_block filter,
[3219] Fix | Delete
* the content needs to be returned so the function parameter
[3220] Fix | Delete
* is to ensure the content exists.
[3221] Fix | Delete
* @return string Block content.
[3222] Fix | Delete
*/
[3223] Fix | Delete
$callback = static function ( $content ) use ( $args ) {
[3224] Fix | Delete
// Register the stylesheet.
[3225] Fix | Delete
if ( ! empty( $args['src'] ) ) {
[3226] Fix | Delete
wp_register_style( $args['handle'], $args['src'], $args['deps'], $args['ver'], $args['media'] );
[3227] Fix | Delete
}
[3228] Fix | Delete
[3229] Fix | Delete
// Add `path` data if provided.
[3230] Fix | Delete
if ( isset( $args['path'] ) ) {
[3231] Fix | Delete
wp_style_add_data( $args['handle'], 'path', $args['path'] );
[3232] Fix | Delete
[3233] Fix | Delete
// Get the RTL file path.
[3234] Fix | Delete
$rtl_file_path = str_replace( '.css', '-rtl.css', $args['path'] );
[3235] Fix | Delete
[3236] Fix | Delete
// Add RTL stylesheet.
[3237] Fix | Delete
if ( file_exists( $rtl_file_path ) ) {
[3238] Fix | Delete
wp_style_add_data( $args['handle'], 'rtl', 'replace' );
[3239] Fix | Delete
[3240] Fix | Delete
if ( is_rtl() ) {
[3241] Fix | Delete
wp_style_add_data( $args['handle'], 'path', $rtl_file_path );
[3242] Fix | Delete
}
[3243] Fix | Delete
}
[3244] Fix | Delete
}
[3245] Fix | Delete
[3246] Fix | Delete
// Enqueue the stylesheet.
[3247] Fix | Delete
wp_enqueue_style( $args['handle'] );
[3248] Fix | Delete
[3249] Fix | Delete
return $content;
[3250] Fix | Delete
};
[3251] Fix | Delete
[3252] Fix | Delete
$hook = did_action( 'wp_enqueue_scripts' ) ? 'wp_footer' : 'wp_enqueue_scripts';
[3253] Fix | Delete
if ( wp_should_load_separate_core_block_assets() ) {
[3254] Fix | Delete
/**
[3255] Fix | Delete
* Callback function to register and enqueue styles.
[3256] Fix | Delete
*
[3257] Fix | Delete
* @param string $content The block content.
[3258] Fix | Delete
* @param array $block The full block, including name and attributes.
[3259] Fix | Delete
* @return string Block content.
[3260] Fix | Delete
*/
[3261] Fix | Delete
$callback_separate = static function ( $content, $block ) use ( $block_name, $callback ) {
[3262] Fix | Delete
if ( ! empty( $block['blockName'] ) && $block_name === $block['blockName'] ) {
[3263] Fix | Delete
return $callback( $content );
[3264] Fix | Delete
}
[3265] Fix | Delete
return $content;
[3266] Fix | Delete
};
[3267] Fix | Delete
[3268] Fix | Delete
/*
[3269] Fix | Delete
* The filter's callback here is an anonymous function because
[3270] Fix | Delete
* using a named function in this case is not possible.
[3271] Fix | Delete
*
[3272] Fix | Delete
* The function cannot be unhooked, however, users are still able
[3273] Fix | Delete
* to dequeue the stylesheets registered/enqueued by the callback
[3274] Fix | Delete
* which is why in this case, using an anonymous function
[3275] Fix | Delete
* was deemed acceptable.
[3276] Fix | Delete
*/
[3277] Fix | Delete
add_filter( 'render_block', $callback_separate, 10, 2 );
[3278] Fix | Delete
return;
[3279] Fix | Delete
}
[3280] Fix | Delete
[3281] Fix | Delete
/*
[3282] Fix | Delete
* The filter's callback here is an anonymous function because
[3283] Fix | Delete
* using a named function in this case is not possible.
[3284] Fix | Delete
*
[3285] Fix | Delete
* The function cannot be unhooked, however, users are still able
[3286] Fix | Delete
* to dequeue the stylesheets registered/enqueued by the callback
[3287] Fix | Delete
* which is why in this case, using an anonymous function
[3288] Fix | Delete
* was deemed acceptable.
[3289] Fix | Delete
*/
[3290] Fix | Delete
add_filter( $hook, $callback );
[3291] Fix | Delete
[3292] Fix | Delete
// Enqueue assets in the editor.
[3293] Fix | Delete
add_action( 'enqueue_block_assets', $callback );
[3294] Fix | Delete
}
[3295] Fix | Delete
[3296] Fix | Delete
/**
[3297] Fix | Delete
* Loads classic theme styles on classic themes in the frontend.
[3298] Fix | Delete
*
[3299] Fix | Delete
* This is needed for backwards compatibility for button blocks specifically.
[3300] Fix | Delete
*
[3301] Fix | Delete
* @since 6.1.0
[3302] Fix | Delete
*/
[3303] Fix | Delete
function wp_enqueue_classic_theme_styles() {
[3304] Fix | Delete
if ( ! wp_theme_has_theme_json() ) {
[3305] Fix | Delete
$suffix = wp_scripts_get_suffix();
[3306] Fix | Delete
wp_register_style( 'classic-theme-styles', '/' . WPINC . "/css/classic-themes$suffix.css" );
[3307] Fix | Delete
wp_style_add_data( 'classic-theme-styles', 'path', ABSPATH . WPINC . "/css/classic-themes$suffix.css" );
[3308] Fix | Delete
wp_enqueue_style( 'classic-theme-styles' );
[3309] Fix | Delete
}
[3310] Fix | Delete
}
[3311] Fix | Delete
[3312] Fix | Delete
/**
[3313] Fix | Delete
* Loads classic theme styles on classic themes in the editor.
[3314] Fix | Delete
*
[3315] Fix | Delete
* This is needed for backwards compatibility for button blocks specifically.
[3316] Fix | Delete
*
[3317] Fix | Delete
* @since 6.1.0
[3318] Fix | Delete
*
[3319] Fix | Delete
* @param array $editor_settings The array of editor settings.
[3320] Fix | Delete
* @return array A filtered array of editor settings.
[3321] Fix | Delete
*/
[3322] Fix | Delete
function wp_add_editor_classic_theme_styles( $editor_settings ) {
[3323] Fix | Delete
if ( wp_theme_has_theme_json() ) {
[3324] Fix | Delete
return $editor_settings;
[3325] Fix | Delete
}
[3326] Fix | Delete
[3327] Fix | Delete
$suffix = wp_scripts_get_suffix();
[3328] Fix | Delete
$classic_theme_styles = ABSPATH . WPINC . "/css/classic-themes$suffix.css";
[3329] Fix | Delete
[3330] Fix | Delete
/*
[3331] Fix | Delete
* This follows the pattern of get_block_editor_theme_styles,
[3332] Fix | Delete
* but we can't use get_block_editor_theme_styles directly as it
[3333] Fix | Delete
* only handles external files or theme files.
[3334] Fix | Delete
*/
[3335] Fix | Delete
$classic_theme_styles_settings = array(
[3336] Fix | Delete
'css' => file_get_contents( $classic_theme_styles ),
[3337] Fix | Delete
'__unstableType' => 'core',
[3338] Fix | Delete
'isGlobalStyles' => false,
[3339] Fix | Delete
);
[3340] Fix | Delete
[3341] Fix | Delete
// Add these settings to the start of the array so that themes can override them.
[3342] Fix | Delete
array_unshift( $editor_settings['styles'], $classic_theme_styles_settings );
[3343] Fix | Delete
[3344] Fix | Delete
return $editor_settings;
[3345] Fix | Delete
}
[3346] Fix | Delete
[3347] Fix | Delete
/**
[3348] Fix | Delete
* Removes leading and trailing _empty_ script tags.
[3349] Fix | Delete
*
[3350] Fix | Delete
* This is a helper meant to be used for literal script tag construction
[3351] Fix | Delete
* within `wp_get_inline_script_tag()` or `wp_print_inline_script_tag()`.
[3352] Fix | Delete
* It removes the literal values of "<script>" and "</script>" from
[3353] Fix | Delete
* around an inline script after trimming whitespace. Typically this
[3354] Fix | Delete
* is used in conjunction with output buffering, where `ob_get_clean()`
[3355] Fix | Delete
* is passed as the `$contents` argument.
[3356] Fix | Delete
*
[3357] Fix | Delete
* Example:
[3358] Fix | Delete
*
[3359] Fix | Delete
* // Strips exact literal empty SCRIPT tags.
[3360] Fix | Delete
* $js = '<script>sayHello();</script>;
[3361] Fix | Delete
* 'sayHello();' === wp_remove_surrounding_empty_script_tags( $js );
[3362] Fix | Delete
*
[3363] Fix | Delete
* // Otherwise if anything is different it warns in the JS console.
[3364] Fix | Delete
* $js = '<script type="text/javascript">console.log( "hi" );</script>';
[3365] Fix | Delete
* 'console.error( ... )' === wp_remove_surrounding_empty_script_tags( $js );
[3366] Fix | Delete
*
[3367] Fix | Delete
* @since 6.4.0
[3368] Fix | Delete
* @access private
[3369] Fix | Delete
*
[3370] Fix | Delete
* @see wp_print_inline_script_tag()
[3371] Fix | Delete
* @see wp_get_inline_script_tag()
[3372] Fix | Delete
*
[3373] Fix | Delete
* @param string $contents Script body with manually created SCRIPT tag literals.
[3374] Fix | Delete
* @return string Script body without surrounding script tag literals, or
[3375] Fix | Delete
* original contents if both exact literals aren't present.
[3376] Fix | Delete
*/
[3377] Fix | Delete
function wp_remove_surrounding_empty_script_tags( $contents ) {
[3378] Fix | Delete
$contents = trim( $contents );
[3379] Fix | Delete
$opener = '<SCRIPT>';
[3380] Fix | Delete
$closer = '</SCRIPT>';
[3381] Fix | Delete
[3382] Fix | Delete
if (
[3383] Fix | Delete
strlen( $contents ) > strlen( $opener ) + strlen( $closer ) &&
[3384] Fix | Delete
strtoupper( substr( $contents, 0, strlen( $opener ) ) ) === $opener &&
[3385] Fix | Delete
strtoupper( substr( $contents, -strlen( $closer ) ) ) === $closer
[3386] Fix | Delete
) {
[3387] Fix | Delete
return substr( $contents, strlen( $opener ), -strlen( $closer ) );
[3388] Fix | Delete
} else {
[3389] Fix | Delete
$error_message = __( 'Expected string to start with script tag (without attributes) and end with script tag, with optional whitespace.' );
[3390] Fix | Delete
_doing_it_wrong( __FUNCTION__, $error_message, '6.4' );
[3391] Fix | Delete
return sprintf(
[3392] Fix | Delete
'console.error(%s)',
[3393] Fix | Delete
wp_json_encode(
[3394] Fix | Delete
sprintf(
[3395] Fix | Delete
/* translators: %s: wp_remove_surrounding_empty_script_tags() */
[3396] Fix | Delete
__( 'Function %s used incorrectly in PHP.' ),
[3397] Fix | Delete
'wp_remove_surrounding_empty_script_tags()'
[3398] Fix | Delete
) . ' ' . $error_message
[3399] Fix | Delete
)
[3400] Fix | Delete
);
[3401] Fix | Delete
}
[3402] Fix | Delete
}
[3403] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function