3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * Order details table shown in emails. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-details.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce/Templates/Emails * @version 3.7.0 */ defined( 'ABSPATH' ) || exit; $text_align = is_rtl() ? 'right' : 'left'; do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?> <h2> <?php if ( $sent_to_admin ) { $before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">'; $after = '</a>'; } else { $before = ''; $after = ''; } /* translators: %s: Order ID. */ echo wp_kses_post( $before . sprintf( __( '[Order #%s]', 'woocommerce' ) . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) ); ?> </h2> <div style="margin-bottom: 40px;"> <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1"> <thead> <tr> <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th> </tr> </thead> <tbody> <?php echo wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $order, array( 'show_sku' => $sent_to_admin, 'show_image' => false, 'image_size' => array( 32, 32 ), 'plain_text' => $plain_text, 'sent_to_admin' => $sent_to_admin, ) ); ?> </tbody> <tfoot> <?php $item_totals = $order->get_order_item_totals(); if ( $item_totals ) { $i = 0; foreach ( $item_totals as $total ) { $i++; ?> <tr> <th class="td" scope="row" colspan="2" style="text-align:<?php echo esc_attr( $text_align ); ?>; <?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo wp_kses_post( $total['label'] ); ?></th> <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; <?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo wp_kses_post( $total['value'] ); ?></td> </tr> <?php } } if ( $order->get_customer_note() ) { ?> <tr> <th class="td" scope="row" colspan="2" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th> <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></td> </tr> <?php } ?> </tfoot> </table> </div> <?php do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email ); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 31
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 108, Position 2 = 153
Branch analysis from position: 108
2 jumps found. (Code = 77) Position 1 = 110, Position 2 = 152
Branch analysis from position: 110
2 jumps found. (Code = 78) Position 1 = 111, Position 2 = 152
Branch analysis from position: 111
2 jumps found. (Code = 43) Position 1 = 120, Position 2 = 122
Branch analysis from position: 120
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
2 jumps found. (Code = 43) Position 1 = 139, Position 2 = 141
Branch analysis from position: 139
1 jumps found. (Code = 42) Position 1 = 142
Branch analysis from position: 142
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
Branch analysis from position: 141
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
Branch analysis from position: 122
2 jumps found. (Code = 43) Position 1 = 139, Position 2 = 141
Branch analysis from position: 139
Branch analysis from position: 141
Branch analysis from position: 152
2 jumps found. (Code = 43) Position 1 = 156, Position 2 = 185
Branch analysis from position: 156
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 185
Branch analysis from position: 152
Branch analysis from position: 153
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 108, Position 2 = 153
Branch analysis from position: 108
Branch analysis from position: 153
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 31
Branch analysis from position: 21
Branch analysis from position: 31
filename:       /in/BQtPS
function name:  (null)
number of ops:  194
compiled vars:  !0 = $text_align, !1 = $order, !2 = $sent_to_admin, !3 = $plain_text, !4 = $email, !5 = $before, !6 = $after, !7 = $item_totals, !8 = $i, !9 = $total
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   DEFINED                                              ~10     'ABSPATH'
          1      > JMPNZ_EX                                             ~10     ~10, ->5
          2    > > INIT_FCALL                                                   'exit'
          3*       DO_ICALL                                             $11     
          4*       BOOL                                                 ~10     $11
   21     5    >   INIT_FCALL_BY_NAME                                           'is_rtl'
          6        DO_FCALL                                          0  $12     
          7      > JMPZ                                                         $12, ->10
          8    >   QM_ASSIGN                                            ~13     'right'
          9      > JMP                                                          ->11
         10    >   QM_ASSIGN                                            ~13     'left'
         11    >   ASSIGN                                                       !0, ~13
   23    12        INIT_FCALL_BY_NAME                                           'do_action'
         13        SEND_VAL_EX                                                  'woocommerce_email_before_order_table'
         14        SEND_VAR_EX                                                  !1
         15        SEND_VAR_EX                                                  !2
         16        SEND_VAR_EX                                                  !3
         17        SEND_VAR_EX                                                  !4
         18        DO_FCALL                                          0          
   24    19        ECHO                                                         '%0A%3Ch2%3E%0A%09'
   27    20      > JMPZ                                                         !2, ->31
   28    21    >   INIT_FCALL_BY_NAME                                           'esc_url'
         22        INIT_METHOD_CALL                                             !1, 'get_edit_order_url'
         23        DO_FCALL                                          0  $16     
         24        SEND_VAR_NO_REF_EX                                           $16
         25        DO_FCALL                                          0  $17     
         26        CONCAT                                               ~18     '%3Ca+class%3D%22link%22+href%3D%22', $17
         27        CONCAT                                               ~19     ~18, '%22%3E'
         28        ASSIGN                                                       !5, ~19
   29    29        ASSIGN                                                       !6, '%3C%2Fa%3E'
   27    30      > JMP                                                          ->33
   31    31    >   ASSIGN                                                       !5, ''
   32    32        ASSIGN                                                       !6, ''
   35    33    >   INIT_FCALL_BY_NAME                                           'wp_kses_post'
         34        INIT_FCALL                                                   'sprintf'
         35        INIT_FCALL_BY_NAME                                           '__'
         36        SEND_VAL_EX                                                  '%5BOrder+%23%25s%5D'
         37        SEND_VAL_EX                                                  'woocommerce'
         38        DO_FCALL                                          0  $24     
         39        CONCAT                                               ~25     $24, !6
         40        CONCAT                                               ~26     ~25, '+%28%3Ctime+datetime%3D%22%25s%22%3E%25s%3C%2Ftime%3E%29'
         41        SEND_VAL                                                     ~26
         42        INIT_METHOD_CALL                                             !1, 'get_order_number'
         43        DO_FCALL                                          0  $27     
         44        SEND_VAR                                                     $27
         45        INIT_METHOD_CALL                                             !1, 'get_date_created'
         46        DO_FCALL                                          0  $28     
         47        INIT_METHOD_CALL                                             $28, 'format'
         48        SEND_VAL_EX                                                  'c'
         49        DO_FCALL                                          0  $29     
         50        SEND_VAR                                                     $29
         51        INIT_FCALL_BY_NAME                                           'wc_format_datetime'
         52        INIT_METHOD_CALL                                             !1, 'get_date_created'
         53        DO_FCALL                                          0  $30     
         54        SEND_VAR_NO_REF_EX                                           $30
         55        DO_FCALL                                          0  $31     
         56        SEND_VAR                                                     $31
         57        DO_ICALL                                             $32     
         58        CONCAT                                               ~33     !5, $32
         59        SEND_VAL_EX                                                  ~33
         60        DO_FCALL                                          0  $34     
         61        ECHO                                                         $34
   37    62        ECHO                                                         '%3C%2Fh2%3E%0A%0A%3Cdiv+style%3D%22margin-bottom%3A+40px%3B%22%3E%0A%09%3Ctable+class%3D%22td%22+cellspacing%3D%220%22+cellpadding%3D%226%22+style%3D%22width%3A+100%25%3B+font-family%3A+%27Helvetica+Neue%27%2C+Helvetica%2C+Roboto%2C+Arial%2C+sans-serif%3B%22+border%3D%221%22%3E%0A%09%09%3Cthead%3E%0A%09%09%09%3Ctr%3E%0A%09%09%09%09%3Cth+class%3D%22td%22+scope%3D%22col%22+style%3D%22text-align%3A'
   43    63        INIT_FCALL_BY_NAME                                           'esc_attr'
         64        SEND_VAR_EX                                                  !0
         65        DO_FCALL                                          0  $35     
         66        ECHO                                                         $35
         67        ECHO                                                         '%3B%22%3E'
         68        INIT_FCALL_BY_NAME                                           'esc_html_e'
         69        SEND_VAL_EX                                                  'Product'
         70        SEND_VAL_EX                                                  'woocommerce'
         71        DO_FCALL                                          0          
         72        ECHO                                                         '%3C%2Fth%3E%0A%09%09%09%09%3Cth+class%3D%22td%22+scope%3D%22col%22+style%3D%22text-align%3A'
   44    73        INIT_FCALL_BY_NAME                                           'esc_attr'
         74        SEND_VAR_EX                                                  !0
         75        DO_FCALL                                          0  $37     
         76        ECHO                                                         $37
         77        ECHO                                                         '%3B%22%3E'
         78        INIT_FCALL_BY_NAME                                           'esc_html_e'
         79        SEND_VAL_EX                                                  'Quantity'
         80        SEND_VAL_EX                                                  'woocommerce'
         81        DO_FCALL                                          0          
         82        ECHO                                                         '%3C%2Fth%3E%0A%09%09%09%09%3Cth+class%3D%22td%22+scope%3D%22col%22+style%3D%22text-align%3A'
   45    83        INIT_FCALL_BY_NAME                                           'esc_attr'
         84        SEND_VAR_EX                                                  !0
         85        DO_FCALL                                          0  $39     
         86        ECHO                                                         $39
         87        ECHO                                                         '%3B%22%3E'
         88        INIT_FCALL_BY_NAME                                           'esc_html_e'
         89        SEND_VAL_EX                                                  'Price'
         90        SEND_VAL_EX                                                  'woocommerce'
         91        DO_FCALL                                          0          
         92        ECHO                                                         '%3C%2Fth%3E%0A%09%09%09%3C%2Ftr%3E%0A%09%09%3C%2Fthead%3E%0A%09%09%3Ctbody%3E%0A%09%09%09'
   50    93        INIT_FCALL_BY_NAME                                           'wc_get_email_order_items'
   51    94        SEND_VAR_EX                                                  !1
   53    95        INIT_ARRAY                                           ~41     !2, 'show_sku'
         96        ADD_ARRAY_ELEMENT                                    ~41     <false>, 'show_image'
         97        ADD_ARRAY_ELEMENT                                    ~41     <array>, 'image_size'
   56    98        ADD_ARRAY_ELEMENT                                    ~41     !3, 'plain_text'
   57    99        ADD_ARRAY_ELEMENT                                    ~41     !2, 'sent_to_admin'
        100        SEND_VAL_EX                                                  ~41
   50   101        DO_FCALL                                          0  $42     
   57   102        ECHO                                                         $42
   61   103        ECHO                                                         '%09%09%3C%2Ftbody%3E%0A%09%09%3Ctfoot%3E%0A%09%09%09'
   64   104        INIT_METHOD_CALL                                             !1, 'get_order_item_totals'
        105        DO_FCALL                                          0  $43     
        106        ASSIGN                                                       !7, $43
   66   107      > JMPZ                                                         !7, ->153
   67   108    >   ASSIGN                                                       !8, 0
   68   109      > FE_RESET_R                                           $46     !7, ->152
        110    > > FE_FETCH_R                                                   $46, !9, ->152
   69   111    >   PRE_INC                                                      !8
   71   112        ECHO                                                         '%09%09%09%09%09%3Ctr%3E%0A%09%09%09%09%09%09%3Cth+class%3D%22td%22+scope%3D%22row%22+colspan%3D%222%22+style%3D%22text-align%3A'
   72   113        INIT_FCALL_BY_NAME                                           'esc_attr'
        114        SEND_VAR_EX                                                  !0
        115        DO_FCALL                                          0  $48     
        116        ECHO                                                         $48
        117        ECHO                                                         '%3B+'
        118        IS_IDENTICAL                                                 !8, 1
        119      > JMPZ                                                         ~49, ->122
        120    >   QM_ASSIGN                                            ~50     'border-top-width%3A+4px%3B'
        121      > JMP                                                          ->123
        122    >   QM_ASSIGN                                            ~50     ''
        123    >   ECHO                                                         ~50
        124        ECHO                                                         '%22%3E'
        125        INIT_FCALL_BY_NAME                                           'wp_kses_post'
        126        CHECK_FUNC_ARG                                               
        127        FETCH_DIM_FUNC_ARG                                   $51     !9, 'label'
        128        SEND_FUNC_ARG                                                $51
        129        DO_FCALL                                          0  $52     
        130        ECHO                                                         $52
        131        ECHO                                                         '%3C%2Fth%3E%0A%09%09%09%09%09%09%3Ctd+class%3D%22td%22+style%3D%22text-align%3A'
   73   132        INIT_FCALL_BY_NAME                                           'esc_attr'
        133        SEND_VAR_EX                                                  !0
        134        DO_FCALL                                          0  $53     
        135        ECHO                                                         $53
        136        ECHO                                                         '%3B+'
        137        IS_IDENTICAL                                                 !8, 1
        138      > JMPZ                                                         ~54, ->141
        139    >   QM_ASSIGN                                            ~55     'border-top-width%3A+4px%3B'
        140      > JMP                                                          ->142
        141    >   QM_ASSIGN                                            ~55     ''
        142    >   ECHO                                                         ~55
        143        ECHO                                                         '%22%3E'
        144        INIT_FCALL_BY_NAME                                           'wp_kses_post'
        145        CHECK_FUNC_ARG                                               
        146        FETCH_DIM_FUNC_ARG                                   $56     !9, 'value'
        147        SEND_FUNC_ARG                                                $56
        148        DO_FCALL                                          0  $57     
        149        ECHO                                                         $57
        150        ECHO                                                         '%3C%2Ftd%3E%0A%09%09%09%09%09%3C%2Ftr%3E%0A%09%09%09%09%09'
   68   151      > JMP                                                          ->110
        152    >   FE_FREE                                                      $46
   78   153    >   INIT_METHOD_CALL                                             !1, 'get_customer_note'
        154        DO_FCALL                                          0  $58     
        155      > JMPZ                                                         $58, ->185
   80   156    >   ECHO                                                         '%09%09%09%09%3Ctr%3E%0A%09%09%09%09%09%3Cth+class%3D%22td%22+scope%3D%22row%22+colspan%3D%222%22+style%3D%22text-align%3A'
   81   157        INIT_FCALL_BY_NAME                                           'esc_attr'
        158        SEND_VAR_EX                                                  !0
        159        DO_FCALL                                          0  $59     
        160        ECHO                                                         $59
        161        ECHO                                                         '%3B%22%3E'
        162        INIT_FCALL_BY_NAME                                           'esc_html_e'
        163        SEND_VAL_EX                                                  'Note%3A'
        164        SEND_VAL_EX                                                  'woocommerce'
        165        DO_FCALL                                          0          
        166        ECHO                                                         '%3C%2Fth%3E%0A%09%09%09%09%09%3Ctd+class%3D%22td%22+style%3D%22text-align%3A'
   82   167        INIT_FCALL_BY_NAME                                           'esc_attr'
        168        SEND_VAR_EX                                                  !0
        169        DO_FCALL                                          0  $61     
        170        ECHO                                                         $61
        171        ECHO                                                         '%3B%22%3E'
        172        INIT_FCALL_BY_NAME                                           'wp_kses_post'
        173        INIT_FCALL                                                   'nl2br'
        174        INIT_FCALL_BY_NAME                                           'wptexturize'
        175        INIT_METHOD_CALL                                             !1, 'get_customer_note'
        176        DO_FCALL                                          0  $62     
        177        SEND_VAR_NO_REF_EX                                           $62
        178        DO_FCALL                                          0  $63     
        179        SEND_VAR                                                     $63
        180        DO_ICALL                                             $64     
        181        SEND_VAR_NO_REF_EX                                           $64
        182        DO_FCALL                                          0  $65     
        183        ECHO                                                         $65
        184        ECHO                                                         '%3C%2Ftd%3E%0A%09%09%09%09%3C%2Ftr%3E%0A%09%09%09%09'
   87   185    >   ECHO                                                         '%09%09%3C%2Ftfoot%3E%0A%09%3C%2Ftable%3E%0A%3C%2Fdiv%3E%0A%0A'
   91   186        INIT_FCALL_BY_NAME                                           'do_action'
        187        SEND_VAL_EX                                                  'woocommerce_email_after_order_table'
        188        SEND_VAR_EX                                                  !1
        189        SEND_VAR_EX                                                  !2
        190        SEND_VAR_EX                                                  !3
        191        SEND_VAR_EX                                                  !4
        192        DO_FCALL                                          0          
        193      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.85 ms | 2151 KiB | 16 Q