3v4l.org

run code in 300+ 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 = 4
Branch analysis from position: 2
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 30
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 107, Position 2 = 152
Branch analysis from position: 107
2 jumps found. (Code = 77) Position 1 = 109, Position 2 = 151
Branch analysis from position: 109
2 jumps found. (Code = 78) Position 1 = 110, Position 2 = 151
Branch analysis from position: 110
2 jumps found. (Code = 43) Position 1 = 119, Position 2 = 121
Branch analysis from position: 119
1 jumps found. (Code = 42) Position 1 = 122
Branch analysis from position: 122
2 jumps found. (Code = 43) Position 1 = 138, Position 2 = 140
Branch analysis from position: 138
1 jumps found. (Code = 42) Position 1 = 141
Branch analysis from position: 141
1 jumps found. (Code = 42) Position 1 = 109
Branch analysis from position: 109
Branch analysis from position: 140
1 jumps found. (Code = 42) Position 1 = 109
Branch analysis from position: 109
Branch analysis from position: 121
2 jumps found. (Code = 43) Position 1 = 138, Position 2 = 140
Branch analysis from position: 138
Branch analysis from position: 140
Branch analysis from position: 151
2 jumps found. (Code = 43) Position 1 = 155, Position 2 = 184
Branch analysis from position: 155
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 184
Branch analysis from position: 151
Branch analysis from position: 152
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 107, Position 2 = 152
Branch analysis from position: 107
Branch analysis from position: 152
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 30
Branch analysis from position: 20
Branch analysis from position: 30
filename:       /in/BQtPS
function name:  (null)
number of ops:  193
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, ->4
          2    > > EXIT                                                     
          3*       BOOL                                             ~10     <true>
   21     4    >   INIT_FCALL_BY_NAME                                       'is_rtl'
          5        DO_FCALL                                      0  $11     
          6      > JMPZ                                                     $11, ->9
          7    >   QM_ASSIGN                                        ~12     'right'
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~12     'left'
         10    >   ASSIGN                                                   !0, ~12
   23    11        INIT_FCALL_BY_NAME                                       'do_action'
         12        SEND_VAL_EX                                              'woocommerce_email_before_order_table'
         13        SEND_VAR_EX                                              !1
         14        SEND_VAR_EX                                              !2
         15        SEND_VAR_EX                                              !3
         16        SEND_VAR_EX                                              !4
         17        DO_FCALL                                      0          
   24    18        ECHO                                                     '%0A%3Ch2%3E%0A%09'
   27    19      > JMPZ                                                     !2, ->30
   28    20    >   INIT_FCALL_BY_NAME                                       'esc_url'
         21        INIT_METHOD_CALL                                         !1, 'get_edit_order_url'
         22        DO_FCALL                                      0  $15     
         23        SEND_VAR_NO_REF_EX                                       $15
         24        DO_FCALL                                      0  $16     
         25        CONCAT                                           ~17     '%3Ca+class%3D%22link%22+href%3D%22', $16
         26        CONCAT                                           ~18     ~17, '%22%3E'
         27        ASSIGN                                                   !5, ~18
   29    28        ASSIGN                                                   !6, '%3C%2Fa%3E'
   27    29      > JMP                                                      ->32
   31    30    >   ASSIGN                                                   !5, ''
   32    31        ASSIGN                                                   !6, ''
   35    32    >   INIT_FCALL_BY_NAME                                       'wp_kses_post'
         33        INIT_FCALL                                               'sprintf'
         34        INIT_FCALL_BY_NAME                                       '__'
         35        SEND_VAL_EX                                              '%5BOrder+%23%25s%5D'
         36        SEND_VAL_EX                                              'woocommerce'
         37        DO_FCALL                                      0  $23     
         38        CONCAT                                           ~24     $23, !6
         39        CONCAT                                           ~25     ~24, '+%28%3Ctime+datetime%3D%22%25s%22%3E%25s%3C%2Ftime%3E%29'
         40        SEND_VAL                                                 ~25
         41        INIT_METHOD_CALL                                         !1, 'get_order_number'
         42        DO_FCALL                                      0  $26     
         43        SEND_VAR                                                 $26
         44        INIT_METHOD_CALL                                         !1, 'get_date_created'
         45        DO_FCALL                                      0  $27     
         46        INIT_METHOD_CALL                                         $27, 'format'
         47        SEND_VAL_EX                                              'c'
         48        DO_FCALL                                      0  $28     
         49        SEND_VAR                                                 $28
         50        INIT_FCALL_BY_NAME                                       'wc_format_datetime'
         51        INIT_METHOD_CALL                                         !1, 'get_date_created'
         52        DO_FCALL                                      0  $29     
         53        SEND_VAR_NO_REF_EX                                       $29
         54        DO_FCALL                                      0  $30     
         55        SEND_VAR                                                 $30
         56        DO_ICALL                                         $31     
         57        CONCAT                                           ~32     !5, $31
         58        SEND_VAL_EX                                              ~32
         59        DO_FCALL                                      0  $33     
         60        ECHO                                                     $33
   37    61        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    62        INIT_FCALL_BY_NAME                                       'esc_attr'
         63        SEND_VAR_EX                                              !0
         64        DO_FCALL                                      0  $34     
         65        ECHO                                                     $34
         66        ECHO                                                     '%3B%22%3E'
         67        INIT_FCALL_BY_NAME                                       'esc_html_e'
         68        SEND_VAL_EX                                              'Product'
         69        SEND_VAL_EX                                              'woocommerce'
         70        DO_FCALL                                      0          
         71        ECHO                                                     '%3C%2Fth%3E%0A%09%09%09%09%3Cth+class%3D%22td%22+scope%3D%22col%22+style%3D%22text-align%3A'
   44    72        INIT_FCALL_BY_NAME                                       'esc_attr'
         73        SEND_VAR_EX                                              !0
         74        DO_FCALL                                      0  $36     
         75        ECHO                                                     $36
         76        ECHO                                                     '%3B%22%3E'
         77        INIT_FCALL_BY_NAME                                       'esc_html_e'
         78        SEND_VAL_EX                                              'Quantity'
         79        SEND_VAL_EX                                              'woocommerce'
         80        DO_FCALL                                      0          
         81        ECHO                                                     '%3C%2Fth%3E%0A%09%09%09%09%3Cth+class%3D%22td%22+scope%3D%22col%22+style%3D%22text-align%3A'
   45    82        INIT_FCALL_BY_NAME                                       'esc_attr'
         83        SEND_VAR_EX                                              !0
         84        DO_FCALL                                      0  $38     
         85        ECHO                                                     $38
         86        ECHO                                                     '%3B%22%3E'
         87        INIT_FCALL_BY_NAME                                       'esc_html_e'
         88        SEND_VAL_EX                                              'Price'
         89        SEND_VAL_EX                                              'woocommerce'
         90        DO_FCALL                                      0          
         91        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    92        INIT_FCALL_BY_NAME                                       'wc_get_email_order_items'
   51    93        SEND_VAR_EX                                              !1
   53    94        INIT_ARRAY                                       ~40     !2, 'show_sku'
         95        ADD_ARRAY_ELEMENT                                ~40     <false>, 'show_image'
         96        ADD_ARRAY_ELEMENT                                ~40     <array>, 'image_size'
   56    97        ADD_ARRAY_ELEMENT                                ~40     !3, 'plain_text'
   57    98        ADD_ARRAY_ELEMENT                                ~40     !2, 'sent_to_admin'
         99        SEND_VAL_EX                                              ~40
   50   100        DO_FCALL                                      0  $41     
   57   101        ECHO                                                     $41
   61   102        ECHO                                                     '%09%09%3C%2Ftbody%3E%0A%09%09%3Ctfoot%3E%0A%09%09%09'
   64   103        INIT_METHOD_CALL                                         !1, 'get_order_item_totals'
        104        DO_FCALL                                      0  $42     
        105        ASSIGN                                                   !7, $42
   66   106      > JMPZ                                                     !7, ->152
   67   107    >   ASSIGN                                                   !8, 0
   68   108      > FE_RESET_R                                       $45     !7, ->151
        109    > > FE_FETCH_R                                               $45, !9, ->151
   69   110    >   PRE_INC                                                  !8
   71   111        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   112        INIT_FCALL_BY_NAME                                       'esc_attr'
        113        SEND_VAR_EX                                              !0
        114        DO_FCALL                                      0  $47     
        115        ECHO                                                     $47
        116        ECHO                                                     '%3B+'
        117        IS_IDENTICAL                                             !8, 1
        118      > JMPZ                                                     ~48, ->121
        119    >   QM_ASSIGN                                        ~49     'border-top-width%3A+4px%3B'
        120      > JMP                                                      ->122
        121    >   QM_ASSIGN                                        ~49     ''
        122    >   ECHO                                                     ~49
        123        ECHO                                                     '%22%3E'
        124        INIT_FCALL_BY_NAME                                       'wp_kses_post'
        125        CHECK_FUNC_ARG                                           
        126        FETCH_DIM_FUNC_ARG                               $50     !9, 'label'
        127        SEND_FUNC_ARG                                            $50
        128        DO_FCALL                                      0  $51     
        129        ECHO                                                     $51
        130        ECHO                                                     '%3C%2Fth%3E%0A%09%09%09%09%09%09%3Ctd+class%3D%22td%22+style%3D%22text-align%3A'
   73   131        INIT_FCALL_BY_NAME                                       'esc_attr'
        132        SEND_VAR_EX                                              !0
        133        DO_FCALL                                      0  $52     
        134        ECHO                                                     $52
        135        ECHO                                                     '%3B+'
        136        IS_IDENTICAL                                             !8, 1
        137      > JMPZ                                                     ~53, ->140
        138    >   QM_ASSIGN                                        ~54     'border-top-width%3A+4px%3B'
        139      > JMP                                                      ->141
        140    >   QM_ASSIGN                                        ~54     ''
        141    >   ECHO                                                     ~54
        142        ECHO                                                     '%22%3E'
        143        INIT_FCALL_BY_NAME                                       'wp_kses_post'
        144        CHECK_FUNC_ARG                                           
        145        FETCH_DIM_FUNC_ARG                               $55     !9, 'value'
        146        SEND_FUNC_ARG                                            $55
        147        DO_FCALL                                      0  $56     
        148        ECHO                                                     $56
        149        ECHO                                                     '%3C%2Ftd%3E%0A%09%09%09%09%09%3C%2Ftr%3E%0A%09%09%09%09%09'
   68   150      > JMP                                                      ->109
        151    >   FE_FREE                                                  $45
   78   152    >   INIT_METHOD_CALL                                         !1, 'get_customer_note'
        153        DO_FCALL                                      0  $57     
        154      > JMPZ                                                     $57, ->184
   80   155    >   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   156        INIT_FCALL_BY_NAME                                       'esc_attr'
        157        SEND_VAR_EX                                              !0
        158        DO_FCALL                                      0  $58     
        159        ECHO                                                     $58
        160        ECHO                                                     '%3B%22%3E'
        161        INIT_FCALL_BY_NAME                                       'esc_html_e'
        162        SEND_VAL_EX                                              'Note%3A'
        163        SEND_VAL_EX                                              'woocommerce'
        164        DO_FCALL                                      0          
        165        ECHO                                                     '%3C%2Fth%3E%0A%09%09%09%09%09%3Ctd+class%3D%22td%22+style%3D%22text-align%3A'
   82   166        INIT_FCALL_BY_NAME                                       'esc_attr'
        167        SEND_VAR_EX                                              !0
        168        DO_FCALL                                      0  $60     
        169        ECHO                                                     $60
        170        ECHO                                                     '%3B%22%3E'
        171        INIT_FCALL_BY_NAME                                       'wp_kses_post'
        172        INIT_FCALL                                               'nl2br'
        173        INIT_FCALL_BY_NAME                                       'wptexturize'
        174        INIT_METHOD_CALL                                         !1, 'get_customer_note'
        175        DO_FCALL                                      0  $61     
        176        SEND_VAR_NO_REF_EX                                       $61
        177        DO_FCALL                                      0  $62     
        178        SEND_VAR                                                 $62
        179        DO_ICALL                                         $63     
        180        SEND_VAR_NO_REF_EX                                       $63
        181        DO_FCALL                                      0  $64     
        182        ECHO                                                     $64
        183        ECHO                                                     '%3C%2Ftd%3E%0A%09%09%09%09%3C%2Ftr%3E%0A%09%09%09%09'
   87   184    >   ECHO                                                     '%09%09%3C%2Ftfoot%3E%0A%09%3C%2Ftable%3E%0A%3C%2Fdiv%3E%0A%0A'
   91   185        INIT_FCALL_BY_NAME                                       'do_action'
        186        SEND_VAL_EX                                              'woocommerce_email_after_order_table'
        187        SEND_VAR_EX                                              !1
        188        SEND_VAR_EX                                              !2
        189        SEND_VAR_EX                                              !3
        190        SEND_VAR_EX                                              !4
        191        DO_FCALL                                      0          
        192      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.69 ms | 1016 KiB | 15 Q