//Update your packages:
sudo apt-get update
//Install Curl to get the composer library:
sudo apt-get install curl
//Installing composer:
sudo curl -s https://getcomposer.org/installer | php
//Move the composer file to bin path :
sudo mv composer.phar /usr/local/bin/composer
//Verify composer installation :
composer
Install NPM (Ubuntu Terminal cd ~)
sudo apt install npm
Activate WSL 2 and Virtual Machine Platform (Run as Admin in powershell ~)
NB!!! Don't forget to install the kernel for wsl2 : https://docs.microsoft.com/en-za/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
//Enable the WSL2 without reboot
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
//Enable the Virtual Machine Platform
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
// Run the below in your powershell terminal to see installed Apps with WSL //
wsl --list --all
// If you want to remove any packages. Examples: //
wslconfig /unregister Ubuntu
or
wslconfig /unregister Ubuntu-18.04
or
wslconfig /unregister Ubuntu-20.04
So for the specificity of this case I was redirecting to the admin dashboard continuously when ever I tried to navigate to the home page.
I was logged in as admin.
The problem was that I updated my email and this caused a conflict with the site. WordPress wanted me to first confirm the new email before I could go to the website front end.
Alternatively if this is not your solution perhaps check this link. It looked good.
So today a client’s site that had its WordPress version updated (to 4.9.1) started throwing this error when they tried to use the Metaslider plugin to upload new images. Some searching confirmed this was happening to more than a few other people but I did not easily find any actual solutions by people asking who probably like me had sites that needed the functionality this presented. The error:
1
2
3
4
PHP Fatal error:
Cannot redeclare wp_ajax_press_this_save_post()
(previously declared in wp-includes/deprecated.php:3921)
in wp-admin/includes/ajax-actions.php on line 3197
Some digging later I found out the function was not just deprecated but in 4.9.1 and above moved outside of the core entirely to an optional plugin that you can download called Press This. This is part of a general clean up initiative where non-essential functionality is being slowly moved out of a more streamlined core and moved into optional plugins.
Just installing the now optional plugin is not enough to fix the issue entirely though at least for now the easiest fix I could come up with that was the least intrusive was to comment out two functions in this file:
1
wp-admin/includes/ajax-actions.php
If you use your text editor to locate the top function, which is wp_ajax_press_this_save_post() you will find the other one below it and they should look like this:
Now use PHP comments to just comment out both functions entirely from being declared, so then only does the deprecation/new plugin functionality take over to make them appear like below and save the file.
Then your all set, hopefully WordPress have picked up on this and will just take these two declarations out in the next version or two before it gets annoying.