";
$mail_text .= "\r\n$name\r\n----------\r\n";
}
}
}
do {
if ( ! empty( $_REQUEST['sfwd_debug_submit'] ) ) {
$nonce = $_REQUEST['sfwd_debug_nonce'];
if ( ! wp_verify_nonce( $nonce, 'sfwd-debug-nonce' ) ) {
echo "" .
/* translators: This message is shown when a form could not be submitted due to a verification error (e.g. when a field is required and is still blank). */
__( 'Form submission error: verification check failed.', 'all-in-one-seo-pack' )
. '
';
break;
}
$email = '';
if ( ! empty( $_REQUEST['sfwd_debug_send_email'] ) ) {
$email = sanitize_email( $_REQUEST['sfwd_debug_send_email'] );
}
if ( $email ) {
$attachments = array();
$upload_dir = wp_upload_dir();
$dir = $upload_dir['basedir'] . '/aiosp-log/';
if ( wp_mkdir_p( $dir ) ) {
$file_path = $dir . 'settings_aioseop-' . date( 'Y-m-d' ) . '-' . time() . '.ini';
if ( ! file_exists( $file_path ) ) {
// @codingStandardsIgnoreStart
if ( $file_handle = @fopen( $file_path, 'w' ) ) {
// @codingStandardsIgnoreEnd
global $aiosp;
$buf = '; ' . sprintf(
/* translators: %s is a placeholder so it should not be translated. It will be replaced with the name of the plugin, All in One SEO Pack. */
__( 'Settings export file for %s', 'all-in-one-seo-pack' ),
AIOSEOP_PLUGIN_NAME
) . "\n";
// Adds all settings and posts data to settings file.
add_filter( 'aioseop_export_settings_exporter_post_types', array( $this, 'get_exporter_post_types' ) );
add_filter( 'aioseop_export_settings_exporter_choices', array( $this, 'get_exporter_choices' ) );
$buf = $aiosp->settings_export( $buf );
$buf = apply_filters( 'aioseop_export_settings', $buf );
fwrite( $file_handle, $buf );
fclose( $file_handle );
$attachments[] = $file_path;
}
}
}
/* translators: %s is a placeholder and should not be translated. It will be replaced with the URL of the website. Also, "SFWD" is an abbreviation for our business name and shouldn't be translated either. */
if ( wp_mail(
$email,
sprintf( __( 'SFWD Debug Mail From Site %s.', 'all-in-one-seo-pack' ), $siteurl ),
$mail_text,
'',
$attachments
) ) {
echo "" .
/* translators: %s is a placeholder and should not be translated. It will be replaced with an e-mail address. */
sprintf( __( 'Sent to %s.', 'all-in-one-seo-pack' ), $email ) . '
';
} else {
echo "" .
/* translators: %s is a placeholder and should not be translated. It will be replaced with an e-mail address. */
sprintf( __( 'Failed to send to %s.', 'all-in-one-seo-pack' ), $email ) . '
';
}
} else {
echo "" . __( 'Error: please enter an e-mail address before submitting.', 'all-in-one-seo-pack' ) . '
';
}
}
} while ( 0 ); // Control structure for use with break.
$buf = "\n";
return $buf;
}
/**
* Get Email Input
*
* @since ?
*
* @return string
*/
function get_email_input() {
$nonce = wp_create_nonce( 'sfwd-debug-nonce' );
$buf =
'' .
'' .
'';
return $buf;
}
/**
* Get Exporter Choices
*
* @since 2.3.13
*
* @return array
*/
function get_exporter_choices() {
return array( 1, 2 );
}
/**
* Get Exporter Post Types
*
* @since 2.3.13
*
* @return array
*/
function get_exporter_post_types() {
$post_types = $this->get_post_type_titles();
$rempost = array(
'customize_changeset' => 1,
'custom_css' => 1,
'revision' => 1,
'nav_menu_item' => 1,
);
$post_types = array_diff_key(
$post_types,
$rempost
);
return array_keys( $post_types );
}
}
}