Showing posts with label Programming. Show all posts

WordPress User Password Reset

You’ve lost access to your site and you don’t know how to get in again. Normally you can reset your WordPress password in the dashboard or request a new one via email. WordPress stores user passwords in hashed form in the database. You can not find out what saved passwords are. In this post, we’ll walk you through a few quick and easy steps on how to change or reset WordPress password. There are several ways to reset a WordPress dashboard password.

WordPress User Password Reset

If you don't have access to your email or your WordPress site isn't sending emails correctly, then changing the WordPress admin password directly from the database via phpMyAdmin might be the only solution you have.

How to change WordPress password from PhpMyAdmin?

How to Reset WordPress Passwords from cPanel?
1
  1. Login to the cPanel dashboard of your WordPress hosting account.
  2. Click on the phpMyAdmin icon under the database section.
  3. On the left-hand side, click on the database WordPress is associated with.
  4. Click "wp_users" table located on the left. You can have a table prefix added. In this case, it may be named slightly differently, such as "wp_pre_users".
  5. You will now see the rows in your WordPress users table. Click on the "Edit" button next to the username where you want to change the password.
  6. Select MD5 in the "Function" column, type in your new strong password into the "user_pass" box and click "Go".
1

How to change WordPress user password via PHP?

How to change WordPress user password with PHP?
1 If you don't have access to your server's database or don't want to write and run a query, you have another solution. If you can access your server via FTP, you can simply change WordPress user passwords.
  1. Download the PHP file to your computer.
    WordPress User Password Reset
  2. Upload the PHP file via FTP to the root directory on your server where WordPress is running.
  3. Open the address by typing the path of the PHP file into the browser. Example: https://example.com/wordpress-user-password-reset-tool.php
  4. You will see the database name where WordPress is installed, the database user, the database password, the table prefix, and the table listing all WordPress users.
  5. Click the "Reset" button for the user whose password you want to change. When the page is opened after clicking, the user's password will be reset directly. A new password with random numbers like "AtakanAu_01234567" will be determined.
  6. If you want, press the "Back" button to return to the listing page for another password reset, or press the "Login" button to log in to the WordPress administration panel with the username and new password in the tab that will open.
1

Create an admin user in WordPress Database via PHP

As a developer, you may need to create a new administrative user in the database to access the site. For example, this is required when exporting a WordPress database, but you are not provided with login credentials for the admin user.

Of course, you can access it through the database. However, many developers are not very comfortable with MySQL and the process is rather slow compared to what I'm going to show you. Here is the easy way to create a new WordPress admin account:

  1. Upload the above PHP file to your server and open it in your browser.
  2. Enter a value for the required "Login" field. You can optionally write "Nicename", "email" and "Display name" parameters.
  3. After clicking the "Create" button, a new administrator account will be created with the username you specified in the "Login" field. A new password with random numbers like "AtakanAu_01234567" will be determined.
WordPress User Password Reset
WordPress User Password Reset
Share:

Yandex Disk API PHP example

Yandex.Disk is a service for storing files on remote Yandex servers and sharing them with others. Data can be accessed by logging in from any device connected to the internet.

Yandex.Disk API allows software developers to access personal files and upload data to the cloud from any device. REST API uses HTTP requests to synchronize data in Yandex.Disk between different devices and platforms.

You can download and upload files to your cloud storage space on Yandex.Disk via the REST API commands. First you need to start by getting an OAuth access token for your App. You can evaluate the Yandex.Disk API using the convenient interface to send requests via Sandbox

Yandex Disk API PHP example


How to get an Yandex OAuth token?

1) Add a new application to the Yandex OAuth server.

2) Give your app a name. For example: "My web appliction"

3) In order for your application to be used with PHP, check the "Web services" box.

4) Click "Set URL for development" for "Callback URI #1:"
Yandex Disk API PHP example

5) Check the boxes under "Yandex.Disk REST API" for the permissions required by your application.
Yandex Disk API PHP example

6) Click the "Create App" button.
Yandex Disk API PHP example

7) Replace "c0XXXXXXXXXXXXXXXXXXXXXXXXXXXX00" with your "ID" number in the link address below. Open this link address with the browser in which you are logged in to Yandex.

https://oauth.yandex.com/authorize?response_type=token&client_id=c0XXXXXXXXXXXXXXXXXXXXXXXXXXXX00


Done! Here is your token string:

Yandex Disk API PHP example


Use my Github code:

GitHub Yandex.Disk PHP
Share:

Sortable Table Using Pure Javascript

This Javascript code copied from Code Boxx. Code modified for some additional functions.
› Fixed sorting decimal / float and integer numbers.
› Added Bootstrap grid system support.


GitHub Page of Source Code

Click on a table header to sort (click again to sort in reverse order).

Javascript Data Object to Sortable Table

Regular HTML Table to Sortable Table

Browser Version Percentage (%)
Chrome for Android 34.59
Chrome 86.0 20.07
Safari iPhone 13.58
Chrome 87.0 4.09
Safari 14.0 2.3
Samsung Internet 12.1 2.21
Edge 86 2.1
Firefox 82.0 1.9

Responsive Bootstrap Column Row to Sortable Table

Country
City
Year
Turkey
Istanbul
2013
United States
New York
2011
Brazil
Rio de Janeiro
2013
France
Paris
2018
Hong Kong
Victoria
2014
bootstrap sortable table html sortable table html table sort javascript sortable table sortable table html javascript sortable tables javascript sortable sortable table how to sort html table column using javascript sortable table bootstrap javascript sort table rows pure javascript js sortable table html table sortable javascript sort html table bootstrap sortable table example javascript order table bootstrap sortable sortable html table sortable javascript sortable table javascript sortable bootstrap table javascript sort table by column javascript table bootstrap table sortable bootstrap 5 sortable table sortable table js javascript sorttable javascript table sort sort html table using javascript bootstrap sortable list table sortable html sortable table generator js sortable bootstrap sort table bootstrap 5 sort table bootstrap sortable tables table sort javascript sorting html table with javascript sortabletable javascript sort table html table with sorting table program in javascript bootstrap 4 sortable table sorting table javascript sort table bootstrap order table javascript bootstrap sorting table javascript html ekleme js sort table sort table html javascript table with sorting in bootstrap bootstrap table sort javascript sorting table bootstrap table sorting html sortable sort table bootstrap 5 html sort table javascript javascript table sortable sorting table in javascript sortable js table example bootstrap tables sortable sortable html html sort table without javascript how to sort table data in html using javascript sortable table in html table sorting in javascript table sorting javascript bootstrap 4 sortable sortable bootstrap html sort table by clicking header sort table in html sort table rows javascript sort table jquery bootstrap jquery sort table on header click html table sorting
Share:

WordPress fast setup initialize

Preparation for WordPress installation



In order for WordPress to be installed on a server computer, MySQL data definition and codes written in php programming language are required. The first step to starting WordPress installation is to install WordPress files on the server computer. Compressed file size of WordPress files is around 14 MB. These files are over 1900 files in javascript, css, images, php and other formats. There are different options available for uploading files to the server.

• Using FTP only: It is the simplest. But you need to wait more for the process to complete.
»Extract the compressed WordPress file to your computer.
»Upload a large number of files to individual server via FTP.

• Using cPanel: Faster. But you need to have cPanel interface.
»Upload the single compressed file to your server.
»Extract the compressed file in the server with the file manager.

-

Alternative and fast WordPress setup



You can copy WordPress files to your server faster using an alternative method. Install the small php-coded program snippet on the bottom and run it. That's all. You are ready to start WordPress installation with one click.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php 

echo download_wordpress_zip();
// echo download_wordpress_zip('tr_TR');

function download_wordpress_zip( $language = false ){
/**
 * Initialize wordpress for installation with one click.
 *
 * @param string $language		( Optional ) Wordpress setup language. 
 *								false	: (Default) English - en_US
 *								tr_TR	: Turkish
 *								pt_PT	: Portuguese
 *								ja		: Japanese
 *								… See full list of languages: 
 *								 https://make.wordpress.org/polyglots/teams/
 *
 * @return string					Returns process messages.
 *
 * usage
 *		download_wordpress_zip();
 *		download_wordpress_zip('tr_TR');
 *
 * https://atakanau.blogspot.com
 */
	
	$logs = '';
	
	// Generate download link
	// https://wordpress.org/latest.zip
	// https://tr.wordpress.org/latest-tr_TR.zip
	$sub_dir = $language ? explode('_',$language)[0].'.' : '';
	$url = 'https://'.$sub_dir.'wordpress.org/';
	$file_name = 'latest' . ( $language ? '-'.$language : '' ) . '.zip';
	$file_name_local = 'wordpress' . ( $language ? '-'.$language : '' ) . '.zip';
	$logs .= "<pre>Download started: $url.$file_name </pre>";
	// Download zip file from wordpress.org to our server
	file_put_contents($file_name_local, fopen($url.$file_name, 'r'));
	$fileSizeMB = number_format((filesize($file_name_local) / 1024 / 1024), 2);
	$logs .= "<pre>Zip file saved as $file_name_local ($fileSizeMB MB) </pre>";
	// Unzip downloaded file
	if( class_exists('ZipArchive') ){
		$path = pathinfo(realpath($file_name_local), PATHINFO_DIRNAME);
		$zip = new ZipArchive;
		$res = $zip->open($file_name_local);
		if ($res === TRUE) {
			// extract it to the path we determined above
			$zip->extractTo($path);
			$zip->close();
			$logs .= "<pre>$file_name_local extracted to $path</pre>";
		} else {
			$logs .= "<pre>Error, file can not open: $file_name_local</pre>";
		}
	}elseif( function_exists('unzip') ){
		$dir = getcwd();
		unzip($dir,$file_name_local);
		$logs .= "<pre>$file_name_local extracted to $path</pre>";
	}else{
		$logs .= "<pre>Error, file can not unzip: $file_name_local</pre>";
	}
	// Move all files and directories from extracted folder to current directory
	$sourceDir = __DIR__ . DIRECTORY_SEPARATOR . 'wordpress';
	$targetDir = __DIR__ . DIRECTORY_SEPARATOR . '.';
	rmove($sourceDir , $targetDir);
	return $logs;
}

/**
 * A Recursive directory move that allows exclusions. The excluded items in the src will be deleted
 * rather than moved.
 * https://gist.github.com/bubba-h57/5117694
 *
 * @param string $sourceDir			The fully qualified source directory to copy
 * @param string $targetDir			The fully qualified destination directory to copy to
 * @param array $exclusions			An array of preg_match patterns to ignore in the copy process
 * @throws InvalidArgumentException
 * @throws ErrorException
 * @return boolean					Returns TRUE on success, throws an error otherwise.
 */
function rmove($src, $dest, $exclusions = array()){

	// If source is not a directory stop processing
	if(!is_dir($src)) throw new InvalidArgumentException('The source passed in does not appear to be a valid directory: ['.$src.']', 1);

	// If the destination directory does not exist create it
	if(!is_dir($dest)) {
		if(!mkdir($dest, 0, true)){
			throw new InvalidArgumentException('The destination does not exist, and I can not create it: ['.$dest.']', 2);
		}
	}

	// Ensure enclusions parameter is an array.
	if (! is_array($exclusions)) throw new InvalidArgumentException('The exclustion parameter is not an array, it MUST be an array.', 3);

	$emptiedDirs = array();

	// Open the source directory to read in files
	foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($src, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $f) {

		// Check to see if we should ignore this file or directory
		foreach ($exclusions as $pattern){
			if (preg_match($pattern, $f->getRealPath())){
				if ($f->isFile()){
					if (! unlink($f->getRealPath())) throw new ErrorException("Failed to delete file [{$f->getRealPath()}] ", 4);
				}elseif($f->isDir()){
					// we will attempt deleting these after we have moved all the files.
					array_push($emptiedDirs, $f->getRealPath());
				}

				// Because we have to jump up two foreach levels
				continue 2;
			}
		}
		// We need to get a path relative to where we are copying from
		$relativePath = str_replace($src, '', $f->getRealPath());

		// And we can create a destination now.
		$destination = $dest . $relativePath;

		// if it is a file, lets just move that sucker over
		if($f->isFile()) {
			$path_parts = pathinfo($destination);

			// If we don't have a directory for this yet
			if (! is_dir($path_parts['dirname'])){
				// Lets create one!
				if (! mkdir($path_parts['dirname'], 0, true)) throw new ErrorException("Failed to create the destination directory: [{$path_parts['dirname']}]", 5);
			}

			if (! rename($f->getRealPath(), $destination)) throw new ErrorException("Failed to rename file [{$f->getRealPath()}] to [$destination]", 6);

		// if it is a directory, lets handle it
		}elseif($f->isDir()){
			// Check to see if the destination directory already exists
			if (! is_dir($destination)){
				if (! mkdir($destination, 0, true)) throw new ErrorException("Failed to create the destination directory: [$destination]", 7);
			}

			// we will attempt deleting these after we have moved all the files.
			array_push($emptiedDirs, $f->getRealPath());

		// if it is something else, throw a fit. Symlinks can potentially end up here. I haven't tested them yet, but I think isFile() will typically
		// just pick them up and work
		}else{
			throw new ErrorException("I found [{$f->getRealPath()}] yet it appears to be neither a directory nor a file. [{$f->isDot()}] I don't know what to do with that!", 8);
		}
	}

	foreach ($emptiedDirs as $emptyDir){
		// print "Deleting $emptyDir\n";
		if (realpath($emptyDir) == realpath($src)){
			continue;
		}
		if (!is_readable($emptyDir)) throw new ErrorException("The source directory: [$emptyDir] is not Readable", 9);

		// Delete the old directory
		if (! rmdir($emptyDir)){
			// The directory is empty, we should have successfully deleted it.
			if ((count(scandir($emptyDir)) == 2)){
				throw new ErrorException("Failed to delete the source directory: [$emptyDir]", 10);
			}
		}
	}

	// Finally, delete the base of the source directory we just recursed through
	if (! rmdir($src)) throw new ErrorException("Failed to delete the base source directory: [$src]", 11);
	return true;
}


-

How does it works?



This php script downloads the WordPress zip file directly to the server. and extracts (extracts) inside the server with php command.


-

About WordPress



WordPress is the most preferred of the frameworks that can be used to create a website. You can use it without any programming language knowledge. It is an easy to use and simple content management system (C.M.S.). It is suitable for creating a blog site. You can also make use of add-ons, portfolio, service promotion, web sites where you can sell products.


Share:

Compare two lists online

Enter your array values into text areas and click to "Compare" button.

If you want to compare arrays online use this small and basic tool.
Check that a line exists in a list.
Find the same or common values between two arrays.
Find the different values between the two series.
Left / First Array Right / Last Array
[ ] [ ]
Left / First Array Results
Values Copy Exist on right

Right / Last Array Results
Values Copy Exist on left
Only Left / First Array Items
Values Copy Total count

Only Right / Last Array Items
Values Copy Total count
Intersection of two arrays A ∩ B Copy

Union of two arrays A ∪ B Copy

Symmetrical Difference A △ B Copy
compare two arrays online ,array diff online ,array difference online ,diff list online ,javascript compare online ,comparing two list ,diff two lists online intersection, difference, and union
Share:

Online multi line slug generator

Multiline-slug is a bulk slug generator written in jQuery that converts multi-line strings, words or text into SEO-friendly and human-readable URL slugs, permalinks, etc. Supports multiple languages using accent and special characters.

Input string:


Do it ->

Output Slug:
Options






How to online slugify your text into a slug?

How to generate slug from string online?
1
  • Enter one or more article, tutorial, webpage or website title texts in the input field.
  • Specify whether you want to delete the stop Words.
  • Specify whether you want to delete numbers and digits.
  • Specify whether you want to separate words with hyphen ( - ), underscore ( _ ), em dash ( — ) or en dash ( – ) .
  • Click on the Slugify button to batch generate multiple slugs at a time.
1

Creating slugs for domain names is a great way to turn common phrases in to searchable Search Engine friendly domain names. You can try multiple methods of using plain text to generate URL friendly domain names and permalinks. Slugifying is a common practice to get a short, unique, web friendly word from a phrase or name. WordPress slug URLs are used within WordPress to create unique permalink URLs for each post and page. So if you want to add this type of feature to automatically generate your normal text into SEO url friendly link then here I am going to share simple jQuery plugin which help you to generate burl slug url.
texto masivo en línea generador de URL slug slugify
Keywords:bulk hyperlink generator, bulk slug generator, convert to slug, friendly url generator, generate slug, online slug, online slugify, slug converter, slug generator, slug generator online, slug maker, slug name generator, slug online, slug online generator, slug text, slug url generator, slugify, string to slug, string to slug online, text to slug online, url slug, url slug generator.
Share:

Cloudinary yüklü tüm dosyaları listeleme

Cloudinary, bulut tabanlı bir görüntü ve video yönetimi çözümü sunmakta. Kullanıcıların web siteleri ve uygulamalar için resim ve video yükleme, saklama, yönetme, sistematik işlem yapma ve sunmalarını sağlar. WEB sitelerinizde CDN kullanımı için kullanışlıdır.

Cloudinary üye ol
Cloudinary yönetim panelinden yüklü olan dosyaları listeleyebiliyorsunuz. Ancak dosyaların bir listesine erişemiyorsunuz. Buna ihtiyacınız varsa Admin API'sini kullanmak zorundasınız. Aşağıdaki PHP kod ile kaynak dosyalarınızın tümünün çeşitli özellikleri ile birlikte listesini CSV dosyası olarak indirebilirsiniz. Eğer dosya sayınız çok fazla ise PHP kodların çalışması uzun sürebilir ve işlem yarıda kalabilir. Bu kısıtlamayı önlemek gerekirse PHP timeout parametresine daha yüksek bir değer verebilirsiniz.

Kaynak dosyalara şuradan erişebilirsiniz:

GitHub Cloudinary export csv list
Share:

Subscribe to: Posts (Atom)