Why is this Ajax not working?

When you load a php file directly via an ajax request (UncheckPackageThemeHelper.php) it’s loaded outside the context of WordPress, so no WordPress core functions are available.

All WordPress ajax requests should be routed through admin-ajax.php. You can print the URL with the function admin_url:

admin_url( 'admin-ajax.php' )

When admin-ajax.php is loaded, WordPress is bootstrapped, so you’ll now have access to core functions.

The last step is to pass an action parameter from your javascript, and map that action to the function you want called when the action is executed:

add_action( 'wp_ajax_my_action', 'my_action_callback' );