I am trying to reply to a form sent by a third party to my Wordpress. I then created a plugin to receive this form and put inside the plugin folder the form file:
<form action="http://www.meusite.com/staging/wp-content/plugins/Integrador/integrador.php" >
<input name="codigo_cliente" value="0" />
<input name="nome" value="XY" />
<input name="fone" value="99 9999.9999" />
<input name="url_xml" value="http://www.site.com/arquivo.xml" />
<input type="submit" name="registernow" value="Inscreva-se"/>
</form>
The file path is OK, the form gets to the address, but when it arrives the result is:
Fatal error: Call to undefined function plugin_dir_url ()
I can not even set the path of the plugin. Follow the code:
<?php
define('INTEGRADOR_FOLDER_NAME','Integrador');
define('INTEGRADOR_VERSION','0.0.1');
define('INTEGRADOR_PLUGIN_NAME','Integrador Plugin');
define('INTEGRADOR_SLUG','Integrador/integrador.php');
// Plugin Folder URL
define( 'INTEGRADOR_URL', plugin_dir_url( __FILE__ ) );
// Plugin Folder Path
define( 'INTEGRADOR_DIR', plugin_dir_path( __FILE__ ) );
$locale = get_locale();
load_textdomain( 'templatic', plugin_dir_path( __FILE__ ).'languages/'.$locale.'.mo' );
/*if(isset($_POST['notificationType']) && $_POST['notificationType'] == 'transaction'){*/
//Todo resto do código iremos inserir aqui.
include_once( ABSPATH . 'wp-admin/includes/plugin.php'
if ($_REQUEST['codigo_cliente'] != ''){
echo '<h1>VOU REGISTRAR ESSE USUÁRIO... AGUARDE....</h1>';
if(file_exists(INTEGRADOR_DIR.'vista/vista_registro.php')){
include_once(INTEGRADOR_DIR.'vista/vista_registro.php');
exit;
}
}
You have a lot more code after this start.
If I access the website first in the browser and send the form everything works (active session). But if I say without entering the site: Error in the basic functions of wordpress.
It's as if wordpress has not loaded.
Can you help me?