HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/ielts-store/wp-content/plugins/automatewoo/includes/Fields_Helper.php
<?php
// phpcs:ignoreFile

namespace AutomateWoo;

/**
 * @class Fields_Helper
 */
class Fields_Helper {

	/**
	 * @return array
	 */
	static function get_categories_list() {
		$list = [];

		$categories = get_terms( 'product_cat', [
			'orderby' => 'name',
			'hide_empty' => false
		]);

		foreach ( $categories as $category ) {
			$list[ $category->term_id ] = $category->name;
		}

		return $list;
	}


	/**
	 * @since 3.2.8
	 * @return array
	 */
	static function get_product_tags_list() {
		$list = [];

		$terms = get_terms( 'product_tag', [
			'orderby' => 'name',
			'hide_empty' => false
		]);

		foreach ( $terms as $term ) {
			$list[ $term->term_id ] = $term->name;
		}

		return $list;
	}


	/**
	 * @since 3.3.2
	 * @return array
	 */
	static function get_coupons_list() {
		$list = [];

		$query = new \WP_Query([
			'post_type' => 'shop_coupon',
			'posts_per_page' => -1,
			'no_found_rows' => true,
			'meta_query' => [
				[
					'key' => '_is_aw_coupon',
					'compare' => 'NOT EXISTS'
				]
			]
		]);

		foreach ( $query->posts as $coupon ) {
			$code = wc_format_coupon_code( $coupon->post_title );
			$list[ $code ] = $code;
		}

		return $list;
	}


	/**
	 * @return array
	 */
	static function get_user_tags_list() {
		$list = [];

		$tags = get_terms([
			'taxonomy' => 'user_tag',
			'hide_empty' => false
		]);

		foreach ( $tags as $tag ) {
			$list[$tag->term_id] = $tag->name;
		}

		return $list;
	}

}