WordPress Custom query to set new username and password to get others site login

We can inset from new row or run query as exampled below to insert new user to existing site. The md5 method of user registration can’t be decrypted. So we need to create new user from query.

INSERT INTO wp_users (ID, user_login, user_pass, user_nicename, user_email)
VALUES (‘2’, ‘prakash’, MD5(‘password’), ‘Prakash’, ‘akash2046@gmail.com’);

INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value)
VALUES (NULL, ‘2’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, ‘2’, ‘wp_user_level’, ’10’);

Laravel Useful Command

Create Model Command:

php artisan make:model Flight
php artisan make:model <folder_path>/Flight

Model With Database Migration

php artisan make:model <folder>/Flight -m

Create Seeder Database

php artisan make:seeder ModelNameSeeder          <modelName>

Run Migration

Run Specif file with defining Path::

php artisan migrate --path=/database/migrations/my_migration.php

Run DB Seed

php artisan db:seed                         ---> Run Full Seeder 

php artisan db:seed --class=UserSeeder      ---> Run Specific Seeder <user>

php artisan migrate:fresh --seed            ---> Run Migration with Seeder

php artisan db:seed --force                 ---> Force Full Seeing db

Git Useful Commands

There are Git Command line which are use full for developer.

Git Initialization:

Additionally, Git does not require any pre-existing server or admin privileges. All you have to do is cd into your project subdirectory and run git init, and you’ll have a fully functional Git repository.

$ git init

We can set up repository on Remote Git servers like git-hub, git-lab, bit bucket etc.

Define Remote address:

$ git remote add origin https://github.com/PrakashKumarBhandari/projectname.git

Then push your project file into remote.

$ git push -u origin master
$ git config --global user.name "Prakash Bhandari"
$ git config --global user.email"akash2046@gmail.com"
Add Username and Email for sync remote and local data.

Show the remote path or git which is cloned or added origin::

$ git remote show origin

We can use Git clone command if we have already exiting project.

Sometime we get error on pulling local file to origin. error like that

the solution would be ::

The error is resolved by toggling the allow-unrelated-histories switch. After a git pull or git merge command, add the following tag:

git pull origin master --allow-unrelated-histories

$git clone <project_url>

Show all Local or Remote Branch

-a shows all local and remote branches, while -r shows only remote branches.

$ git branch   [ Show all local Branch]
$ git branch -a   [ Remote and Local Branch]
$ git branch -r   [ Show all remote Branch]

How Does Git Checkout Remote Branch Work?

Git checkout remote branch lets us switch to (and work on) a remote branch, just like we’d switch to a local one. There are a couple of ways to do this.

First, fetch the remote branches:

git fetch origin

Next, checkout the branch you want. In this case, the branch we want is called “branchxyz”.

git checkout -b branchxyz origin/branchxyz

Or you can use:

git branch branchxyz origin/branchxyz

With newer versions, you can simply use:

$git fetch

$git checkout branchxyz

Rename a Branch

To rename a branch, run the command:


# Alternative

Delete a Branch

Git won’t let you delete a branch that you’re currently on. You first need to checkout a different branch, then run the command:

$git branch -d BRANCH-TO-DELETE

# Alternative:
$git branch --delete BRANCH-TO-DELETE

Compare Branches

You can compare branches with the git diff command: