<?php
$users = get_users(array(
    'meta_key'     => 'wp_dummy_content_generator_user',
    'meta_value'   => 'true',
    'meta_compare' => '=',
)); ?>
 <h2>Bellow are all the users generated by this plugin 
 	<?php if ( !empty($users) ) { ?>
	 	<span class="deleteSpan">
		 	<form action='<?php echo esc_url(admin_url('admin-post.php'))?>' method="">
			    <input type="hidden" name="action" value="wp_dummy_content_generator_deleteusers" />
			    <input type="hidden" name="nonce" value="<?=wp_create_nonce('wpdcg-ajax-nonce')?>" />
			    <input type="submit" name="submit" value="Delete dummy users">
			</form>
		</span>

 	<?php } ?>
 </h2>
<table id="wp_dummy_content_generatorListPostsTbl" class="stripe" style="width:100%">
	<thead>
		<tr>
			<th>#</th>
			<th>Display name</th>
			<th>Email</th>
			<th>Role</th>
		</tr>
	</thead>
	<tbody>
		<?php
		if ( !empty($users) ) {
			$counter = 1;
			foreach ($users as $key => $userDatavalue){ ?>
				<tr>
					<td><?=$counter?></td>
					<td><?=$userDatavalue->data->display_name?></td>
					<td><?=$userDatavalue->data->user_email?></td>
					<td><?=$userDatavalue->roles[0]?></td>
				</tr>
				<?php
				$counter++;
			}
		} ?>
	</tbody>
</table>