Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

169
Vistas
403 on ajax post creating Wordpress Plugin

I am creating a plugin in wordpress that needs an AJAX call. The call goes through, but I get a 403.

I've gone through tutorials and checked other plugin codes and can't figure out why it's not working. Apparently all my enqueues are OK.

This is my main.php plugin code:

function launchRecommender(){
    wp_enqueue_style( 'ai-plugin-css', plugin_dir_url( __FILE__ ) . 'css/style.css');
    wp_enqueue_script('ai-plugin-js', plugin_dir_url( __FILE__ ). 'js/index.js', array( 'jquery' ));
    wp_localize_script('ai-plugin-js', 'ia', array(
        'pluginsUrl' => plugins_url()
    ));

    include('includes/recommender.php');
}

add_shortcode('recomendador', 'launchRecommender');

And this is the JS code that after being executed receives the 403 error:

jQuery.ajax({
    type: "POST",
    url: ia.pluginsUrl + "/plugin-name/includes/process.php",
    data: {student_email:'ex@ex.com'},
    action: "",
    success: function(xml) {
        console.log(xml)
    },
    error: function(e){
        console.log(e)
    }
})

Do I need an additional hook? Is the url badly managed?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda