When I'm logged, the code works perfect, but if no logged, check_ajax_reffer fails.
First, pass ajax_url and nonce's':
wp_localize_script( $this->plugin_name, 'ajax_object',
array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'security_price' => wp_create_nonce('ga_price'), 'security_arquivo' => wp_create_nonce('ga_arquivo') ) );
And then simply validate:
if ($data == null && defined( 'DOING_AJAX' )) {
check_ajax_referer('ga_price', 'security_price');
...
Why does it happen?