case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_FORM_SIZE: $message = __('Upload file is too large.', 'wprss'); break; case UPLOAD_ERR_PARTIAL: $message = __('The file was not fully uploaded.', 'wprss'); break; default: $message = __('The file upload failed. Please try again.', 'wprss'); break; } wp_die($message, __('Upload error', 'wprss'), ['back_link' => true]); exit; } $importFile = $_FILES['wpra_import_file']; $rawContents = file_get_contents($importFile['tmp_name']); $settings = json_decode($rawContents, true); if ($settings === null) { wprss()->getAdminAjaxNotices()->addNotice('settings_import_failed'); exit; } foreach ($settings as $key => $value) { update_option($key, $value); } wprss()->getAdminAjaxNotices()->addNotice('settings_import_success'); do_action('wprss_settings_imported'); }; }, ]; } /** * @inheritdoc * * @since 4.17 */ public function getExtensions() { return [ /* * Registers the "Export" and "Import" tools. * * @since 4.17 */ 'wpra/admin/tools' => function (ContainerInterface $c, $tools) { return $tools + [ 'export' => $c->get('wpra/admin/tools/export/info'), 'import' => $c->get('wpra/admin/tools/import/info'), ]; }, ]; } /** * @inheritdoc * * @since 4.17 */ public function run(ContainerInterface $c) { // Register the Export and Import handlers add_action('admin_init', $c->get('wpra/admin/tools/export/handler')); add_action('admin_init', $c->get('wpra/admin/tools/import/handler')); } } looks — CRYPT.ru

looks