/home/techb158/public_html/wp-content/plugins/wpforms-lite/src/Admin/Tools/Views
Edit: /home/techb158/public_html/wp-content/plugins/wpforms-lite/src/Admin/Tools/Views/Importer.php (10821B)
importers = $importers->get_importers();
if ( ! empty( $_GET['provider'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
$this->importer_forms = $importers->get_importer_forms( sanitize_key( $_GET['provider'] ) );//phpcs:ignore WordPress.Security.NonceVerification.Recommended
}
// Load the Underscores templates for importers.
add_action( 'admin_print_scripts', [ $this, 'importer_templates' ] );
}
/**
* Get view label.
*
* @since 1.6.6
*
* @return string
*/
public function get_label() {
return '';
}
/**
* Checking user capability to view.
*
* @since 1.6.6
*
* @return bool
*/
public function check_capability() {
return wpforms_current_user_can( 'create_forms' );
}
/**
* Checking if needs display in navigation.
*
* @since 1.6.6
*
* @return bool
*/
public function hide_from_nav() {
return true;
}
/**
* Importer view content.
*
* @since 1.6.6
*/
public function display() {
if ( ! current_user_can( 'unfiltered_html' ) ) {
$this->error_unfiltered_html_import_message();
return;
}
$this->heading_block();
$this->forms_block();
$this->analyze_block();
$this->process_block();
}
/**
* Error message for users with no `unfiltered_html` permission.
*
* @since 1.10.1
*/
private function error_unfiltered_html_import_message(): void {
printf(
'
',
sprintf(
wp_kses( /* translators: %s - WPForms contact page URL. */
__( 'You can\'t import forms because you don\'t have unfiltered HTML permissions. Please contact your site administrator or
reach out to our support team.', 'wpforms-lite' ),
[
'a' => [
'href' => [],
'target' => [],
'rel' => [],
],
]
),
esc_url( wpforms_utm_link( 'https://wpforms.com/contact/', 'Tools - Import', 'Support Link - Form Importer No Permissions' ) )
)
);
}
/**
* Get provider.
*
* @since 1.6.6
*
* @return string
*/
private function get_provider_name() {
//phpcs:ignore WordPress.Security.NonceVerification.Recommended
$slug = ! empty( $_GET['provider'] ) ? sanitize_key( $_GET['provider'] ) : '';
return isset( $this->importers[ $slug ] ) ? $this->importers[ $slug ]['name'] : '';
}
/**
* Heading block.
*
* @since 1.6.6
*/
private function heading_block() {
?>