Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda