PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.62
Timetics – Appointment Booking Calendar & Scheduling v1.0.62
1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 All 64 releases
timetics / core / dummy-data / provider / internet.php

internet.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.62, at core/dummy-data/provider/internet.php

77 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Internet Faker Class
4 *
5 * @package Timetics
6 */
7 namespace Timetics\Core\DummyData\Provider;
8
9 defined( 'ABSPATH' ) || exit;
10
11 /**
12 * Internet Faker Class
13 */
14 class Internet {
15 /**
16 * Store Internet Free Domain
17 *
18 * @var array
19 */
20 protected static $domains = ['gmail.com', 'yahoo.com', 'hotmail.com'];
21
22 /**
23 * Store random character
24 *
25 * @var string
26 */
27 protected static $str = 'abcdefghijklmnopqrstuvwxyz12345_-.';
28
29 /**
30 * Get username
31 *
32 * @return string
33 */
34 public static function username() {
35 $strLength = strlen( self::$str );
36
37 // Generate a random start position within the valid range
38 $start_pos = wp_rand( 0, max( 0, $strLength - 5 ) );
39
40 // Extract the random substring using substr()
41 $random_substring = substr( self::$str, $start_pos, 5 );
42
43 return $random_substring . '_' . time();
44 }
45
46 /**
47 * Get generated email
48 *
49 * @return string
50 */
51 public static function email() {
52 $email = self::username() . '@' . self::domain();
53
54 return $email;
55 }
56
57 /**
58 * Get generated password
59 *
60 * @return string
61 */
62 public static function password() {
63 $password = uniqid() . '_' . time();
64
65 return $password;
66 }
67
68 /**
69 * Get domain name
70 *
71 * @return string
72 */
73 private static function domain() {
74 return self::$domains[array_rand( self::$domains )];
75 }
76 }
77