it happens because the sorting it’s based on arrays
To sort on database data, you must to include in SQL query:
private function table_data()
{
global $wpdb;
// Set defaults
$orderby = 'razon';
$order = 'asc';
// If orderby is set, use this as the sort column
if(!empty($_GET['orderby']))
{
$orderby = $_GET['orderby'];
}
// If order is set use this as the order
if(!empty($_GET['order']))
{
$order = $_GET['order'];
}
$sql = "SELECT * FROM ".DB_TABLE." ORDER BY ".$orderby." $order";
$data = $wpdb->get_results($sql, ARRAY_A);
return $data;
}
Replace line 363
$data = $this->example_data;
to
$data = $this->table_data();
Finnaly delete the usort_reorder() and usort functions.