Code Duplication    Length = 26-26 lines in 2 locations

core/exceptions/ExceptionStackTraceDisplay.php 1 location

@@ 403-428 (lines=26) @@
400
     * @param bool $force_print
401
     * @return string
402
     */
403
    private function printScripts($force_print = false)
404
    {
405
        if (! $force_print && (did_action('admin_enqueue_scripts') || did_action('wp_enqueue_scripts'))) {
406
            if (wp_script_is('ee_error_js', 'enqueued')) {
407
                return '';
408
            }
409
            if (wp_script_is('ee_error_js', 'registered')) {
410
                wp_enqueue_style('espresso_default');
411
                wp_enqueue_style('espresso_custom_css');
412
                wp_enqueue_script( 'ee_error_js' );
413
				wp_localize_script( 'ee_error_js', 'ee_settings', array( 'wp_debug' => WP_DEBUG ) );
414
            }
415
        } else {
416
            return '
417
<script>
418
/* <![CDATA[ */
419
var ee_settings = {"wp_debug":"' . WP_DEBUG . '"};
420
/* ]]> */
421
</script>
422
<script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script>
423
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
424
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
425
';
426
        }
427
        return '';
428
    }
429
430
431

core/EE_Error.core.php 1 location

@@ 1004-1029 (lines=26) @@
1001
     * @param    bool $force_print
1002
     * @return    string
1003
     */
1004
    private static function _print_scripts($force_print = false)
1005
    {
1006
        if (! $force_print && (did_action('admin_enqueue_scripts') || did_action('wp_enqueue_scripts'))) {
1007
            if (wp_script_is('ee_error_js', 'enqueued')) {
1008
                return '';
1009
            }
1010
            if (wp_script_is('ee_error_js', 'registered')) {
1011
                wp_enqueue_style('espresso_default');
1012
                wp_enqueue_style('espresso_custom_css');
1013
                wp_enqueue_script('ee_error_js');
1014
                wp_localize_script('ee_error_js', 'ee_settings', array('wp_debug' => WP_DEBUG));
1015
            }
1016
        } else {
1017
            return '
1018
<script>
1019
/* <![CDATA[ */
1020
const ee_settings = {"wp_debug":"' . WP_DEBUG . '"};
1021
/* ]]> */
1022
</script>
1023
<script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script>
1024
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
1025
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
1026
';
1027
        }
1028
        return '';
1029
    }
1030
1031
1032