str_replace("/","",str_replace(basename(__FILE__),"",plugin_basename( __FILE__))))
* @param string $pluginID the pluginID of the plugin (probably $this->pluginID)
* @return SLFramework_Feedback the SLFramework_Feedback object
*/
function SLFramework_Feedback($plugin, $pluginID) {
$this->plugin = $plugin ;
$this->pluginID = $pluginID ;
}
/** ====================================================================================================================================================
* Display the feedback form
* Please note that the users will send you their comments/feedback at the email used is in the header of the main file of your plugin Author Email : name@domain.tld
*
* @return void
*/
public function enable_feedback() {
$_POST['plugin'] = $this->plugin ;
$info_file = pluginSedLex::get_plugins_data(WP_PLUGIN_DIR."/".$this->plugin."/".$this->plugin.".php") ;
if (preg_match("#^[a-z0-9-_.]+@[a-z0-9-_.]{2,}\.[a-z]{2,4}$#",$info_file['Email'])) {
?>
".__("Feedback form",'SL_framework')."" ;
echo "
".__('This form is an easy way to contact the author and to discuss issues/incompatibilities/etc. with him', "SL_framework")."
" ;
echo "
" ;
if (preg_match("#^[a-z0-9-_.]+@[a-z0-9-_.]{2,}\.[a-z]{2,4}$#",$info_file['Email'])) {
$table = new SLFramework_Table() ;
$table->title(array(__("Contact the author", "SL_framework"), "") ) ;
// Name
$cel1 = new adminCell("
".__('Your name:', 'SL_framework')."*
") ;
$cel2 = new adminCell("") ;
$table->add_line(array($cel1, $cel2), '1') ;
// Email
$cel1 = new adminCell("
".__('Your email:', 'SL_framework')."*
".__('Useful... so that the author will be able to anwser you.', 'SL_framework')."
") ;
$cel2 = new adminCell("") ;
$table->add_line(array($cel1, $cel2), '1') ;
// Comment
$cel1 = new adminCell("
".__('Your comments:', 'SL_framework')."*
".__('Please note that additional information on your wordpress installation will be sent to the author in order to help the debugging if needed (such as : the wordpress version, the installed plugins, etc.)', 'SL_framework')."
".__("The feedback has been sent", 'SL_framework')."
" ;
echo "
" ;
SLFramework_Debug::log(get_class(), "A feedback mail has been sent.", 4) ;
} else {
echo "
" ;
echo "
".__("An error occured sending the email.", 'SL_framework')."
".__("Make sure that your wordpress is able to send email.", 'SL_framework')."
" ;
echo "
" ;
SLFramework_Debug::log(get_class(), "A feedback mail has failed to be sent.", 2) ;
}
//Die in order to avoid the 0 character to be printed at the end
die() ;
}
}
}
?>