ėb>oŅU€`Üt@\>oŅU’’’’’’’’€Õ<yE>oŅUP€’’’’Õch>oŅUP’’’’ ßš=S>oŅU ’’’’°ßHO>oŅU°’’’’’’’’ß>,<>oŅUŠ’’’’’’’’’’’’ą>ž_–gž_–g€—R@@»®•gx@@ŠU@@E@ ļR@@’I@8m@@»®•gˆ“•g±(“•g@“•g’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’Šv>oŅUP ’’’’oØ"q>oŅUąq=@\>oŅU’’’’’’’’pq<yE>oŅU`p’’’’q×j>oŅUPĄrpūw>oŅU’’’’’’’’rdŒ?>oŅUP !r^ĘY>oŅUPr¹×j>oŅU`p8rpėb>oŅUpPrt@\>oŅU’’’’’’’’ r<7>oŅU @°rG­X>oŅU°`rt~>oŅU’’’’’’’’’’’’r<¼?>oŅUPšŠHtRHO>oŅUŠ’’’’’’’’t>,<>oŅUĄ’’’’’’’’’’’’u>„H@€Ń¶•g(DB@(DB@°Ń¶•gpśA@pśA@ŠQJ@ąŃ¶•gE@PѶ•g€µ•g8O@8Ī­•g'>oŅUžP?Šv>oŅU` ’’’’Ø1>oŅU’’’’   6¼?>oŅU`š€ R4N>oŅU €  7”N>oŅU Š 8©E>oŅUp’’’’ ×j>oŅU`  !pū`>oŅUpP!Bū`>oŅUP`!B@\>oŅU’’’’’’’’Š!<yE>oŅUpŠ’’’’!×j>oŅU` 0#pū`>oŅUpP#B@\>oŅU’’’’’’’’š#<½L>oŅUš’’’’#3HO>oŅU’’’’’’’’#>,<>oŅU ’’’’’’’’’’’’$>„H@ąŌ¶•g°Ō¶•gÕ¶•gø E@ø E@(N@(N@ .†g’`©J–gŲB@'>oŅUžPģ?'>oŅU`ģ?r€>oŅUd6oąīpū`>oŅUPPīB"q>oŅUpĄī="q>oŅU€° ī=5c>oŅU PīA5c>oŅU`īA@\>oŅU’’’’’’’’pī<q„>oŅUpPīu×j>oŅU`@(īp@\>oŅU’’’’’’’’€ī<q„>oŅU€`īu&W>oŅU’’’’’’’’īZ>oŅU`ī2~>oŅU’’’’’’’’’’’’ī<,<>oŅU ’’’’’’’’’’’’ļ>ųū@@ųū@@`ó@@8H@)X–gĄß¶•gxęA@PęA@ą.†g’ż­•gąµ•g H@Ž/** * Process a batch of actions pending in the queue. * * Actions are processed by claiming a set of pending actions then processing each one until either the batch * size is completed, or memory or time limits are reached, defined by @see $this->batch_limits_exceeded(). * * @param int $size The maximum number of actions to process in the batch. * @param string $context Optional identifier for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron' * Generally, this should be capitalised and not localised as it's a proper noun. * @return int The number of actions processed. */p`’’’’»¶bu>oŅUp`½Aüq>oŅU’’’’’’’’’’’’»r€>oŅUø\ŗ•@cp@\>oŅU’’’’’’’’€c<¼<>oŅU€ c©E>oŅUP’’’’c"q>oŅU`šd=5c>oŅUąPdA&W>oŅU’’’’’’’’°dyE>oŅU`°’’’’dĮS>oŅUP`Še©E>oŅUpŠ’’’’e"q>oŅUšPg=5c>oŅU@PgAaa>oŅUp`gu¤>oŅU’’’’’’’’šgøbu>oŅUšpgA@\>oŅU’’’’’’’’g<_prefixed_field_name( $name ): string { return "{$this->field_prefix}{$name}"; } /** * Get the field name with the meta prefix. * * @param string $name The field name. * * @return string The prefixed field name. */ private function get_meta_prefixed_field_name( string $name ): string { return "_{$this->get_prefixed_field_name( $name )}"; } /** * Remove the meta prefix from the field name. * * @param string $name The prefixed fieldname . * * @return string */ private function unprefix_meta_field_name( string $name ): string { return str_replace( "_{$this->field_prefix}", '', $name ); } /** * Get the order object with HPOS compatibility. * * @param WC_Order|WP_Post|int $post_or_order The post ID or object. * * @return WC_Order The order object * @throws Exception When the order isn't found. */ private function get_hpos_order_object( $post_or_order ) { // If we've already got an order object, just return it. if ( $post_or_order instanceof WC_Order ) { return $post_or_order; } // If we have a post ID, get the post object. if ( is_numeric( $post_or_order ) ) { $post_or_order = wc_get_order( $post_or_order ); } // Throw an exception if we don't have an order object. if ( ! $post_or_order instanceof WC_Order ) { throw new Exception( __( 'Order not found.', 'woocommerce' ) ); } return $post_or_order; } /** * Map posted, prefixed values to field values. * Used for the classic forms. * * @param array $raw_values The raw values from the POST form. * * @return array */ private function get_unprefixed_field_values( array $raw_values = array() ): array { $values = array(); // Look through each field in POST data. foreach ( $this->field_names as $field_name ) { $values[ $field_name ] = $raw_values[ $this->get_prefixed_field_name( $field_name ) ] ?? '(none)'; } return $values; } /** * Map submitted values to meta values. * * @param array $raw_values The raw (unprefixed) values from the submitted data. * * @return array */ private function get_source_values( array $raw_values = array() ): array { $values = array(); // Look through each field in given data. foreach ( $this->field_names as $field_name ) { $value = sanitize_text_field( wp_unslash( $raw_values[ $field_name ] ) ); if ( '(none)' === $value ) { continue; } $values[ $field_name ] = $value; } // Set the device type if possible using the user agent. if ( array_key_exists( 'user_agent', $values ) && ! empty( $values['user_agent'] ) ) { $values['device_type'] = $this->get_device_type( $values ); } return $values; } /** * Get the label for the Order origin with placeholder where appropriate. Can be * translated (for DB / display) or untranslated (for Tracks). * * @param string $source_type The source type. * @param string $source The source. * @param bool $translated Whether the label should be translated. * * @return string */ private function get_origin_label( string $source_type, string $source, bool $translated = true ): string { // Set up the label based on the source type. switch ( $source_type ) { case 'utm': $label = $translated ? /* translators: %s is the source value */ __( 'Source: %s', 'woocommerce' ) : 'Source: %s'; break; case 'organic': $label = $translated ? /* translators: %s is the source value */ __( 'Organic: %s', 'woocommerce' ) : 'Organic: %s'; break; case 'referral': $label = $translated ? /* translators: %s is the source value */ __( 'Referral: %s', 'woocommerce' ) : 'Referral: %s'; break; case 'typein': $label = ''; $source = $translated ? __( 'Direct', 'woocommerce' ) : 'Direct'; break; case 'mobile_app': $label = ''; $source = $translated ? __( 'Mobile app', 'woocommerce' ) : 'Mobile app'; break; case 'admin': $label = ''; $source = $translated ? __( 'Web admin', 'woocommerce' ) : 'Web admin'; break; default: $label = ''; $source = $translated ? __( 'Unknown', 'woocommerce' ) : 'Unknown'; break; } /** * Filter the formatted source for the order origin. * * @since 8.5.0 * * @param string $formatted_source The formatted source. * @param string $source The source. */ $formatted_source = apply_filters( 'wc_order_attribution_origin_formatted_source', ucfirst( trim( $source, '()' ) ), $source ); /** * Filter the label for the order origin. * * This label should have a %s placeholder for the formatted source to be inserted * via sprintf(). * * @since 8.5.0 * * @param string $label The label for the order origin. * @param string $source_type The source type. * @param string $source The source. * @param string $formatted_source The formatted source. */ $label = (string) apply_filters( 'wc_order_attribution_origin_label', $label, $source_type, $source, $formatted_source ); if ( false === strpos( $label, '%' ) ) { return $formatted_source; } return sprintf( $label, $formatted_source ); } /** * Get the description for the order attribution field. * * @param string $field_name The field name. * * @return string */ private function get_field_description( string $field_name ): string { /* translators: %s is the field name */ $description = sprintf( __( 'Order attribution field: %s', 'woocommerce' ), $field_name ); /** * Filter the description for the order attribution field. * * @since 8.5.0 * * @param string $description The description for the order attribution field. * @param string $field_name The field name. */ return (string) apply_filters( 'wc_order_attribution_field_description', $description, $field_name ); } }