Meta Box – Post info disappeared in admin

Meta Box – Post info disappeared in admin

This problem is due to version conflicts with meta_box plugin

--

The below is when a new album is been created.
All the post info is visible.
NEW ALBUM

The below is editing an existing album.
All of the post info uploaded is no longer displaying. So my client can no longer edit their posts.
EDIT

New Dev Setup PHP & Ubuntu – For Windows

Useful for Debugging :
https://old.garthbaker.co.za/re-install-ubuntu-windows-11/

Install PHP 8 (Ubuntu Terminal cd ~)

sudo apt update
sudo apt -y upgrade
--
sudo apt update
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
--
sudo apt update
sudo apt install php8.0
--
php -v

Installing Required Extensions (Ubuntu Terminal cd ~)

The below command should be enough. But if you missing extensions, check below

sudo apt install php8.0-curl php8.0-cli php8.0-xml php8.0-mbstring php8.0-zip php8.0-pdo php8.0-mysql php8.0-gd

If you want to list all PHP 8.0 loaded modules use the command:
php -m

sudo apt install php8.0-

php8.0-amqp       php8.0-common     php8.0-gd         php8.0-ldap       php8.0-odbc       php8.0-readline   php8.0-sqlite3    php8.0-xsl
php8.0-apcu       php8.0-curl       php8.0-gmp        php8.0-mailparse  php8.0-opcache    php8.0-redis      php8.0-sybase     php8.0-yac
php8.0-ast        php8.0-dba        php8.0-igbinary   php8.0-mbstring   php8.0-pgsql      php8.0-rrd        php8.0-tidy       php8.0-yaml
php8.0-bcmath     php8.0-dev        php8.0-imagick    php8.0-memcached  php8.0-phpdbg     php8.0-smbclient  php8.0-uuid       php8.0-zip
php8.0-bz2        php8.0-ds         php8.0-imap       php8.0-msgpack    php8.0-pspell     php8.0-snmp       php8.0-xdebug     php8.0-zmq
php8.0-cgi        php8.0-enchant    php8.0-interbase  php8.0-mysql      php8.0-psr        php8.0-soap       php8.0-xhprof
php8.0-cli        php8.0-fpm        php8.0-intl       php8.0-oauth      php8.0-raphf      php8.0-solr       php8.0-xml

Install Composer (Ubuntu Terminal cd ~)

//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

Set WSL2 Default (Run as Admin in powershell ~)

wsl --set-default-version 2

Re-install Ubuntu Windows 11

Google Search for Grepper

// 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

Laravel All Routes Returning 404

Replace your .htaccess file with the below solution contents

Solution:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# Set the “ea-php71” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php71 .php .php7 .phtml
</IfModule>

WordPress Login Loop to Dashboard

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.

https://www.hostinger.com/tutorials/fix-wordpress-login-redirect-loop

WordPress Login redirecting to strange url

Define('WP_SITEURL','https://your-site-url');
Define('WP_HOME','https://your-site-url');

The above code must get added to your wp-config.php File
It should fix the redirecting login issue.

I left in inside my file after using it and all seemed fine. So no harm in just keeping it.

Cannot redeclare wp_ajax_press_this_save_post() on WordPress

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
 * Ajax handler for saving a post from Press This.
 *
 * @since 4.2.0
 */
function wp_ajax_press_this_save_post() {
      include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
      $wp_press_this = new WP_Press_This();
      $wp_press_this->save_post();
}
/**
 * Ajax handler for creating new category from Press This.
 *
 * @since 4.2.0
 */
function wp_ajax_press_this_add_category() {
      include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
      $wp_press_this = new WP_Press_This();
      $wp_press_this->add_category();
}

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
 * Ajax handler for saving a post from Press This.
 *
 * @since 4.2.0
 */
//function wp_ajax_press_this_save_post() {
//      include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
//      $wp_press_this = new WP_Press_This();
//      $wp_press_this->save_post();
//}
/**
 * Ajax handler for creating new category from Press This.
 *
 * @since 4.2.0
 */
//function wp_ajax_press_this_add_category() {
//      include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
//      $wp_press_this = new WP_Press_This();
//      $wp_press_this->add_category();
//}

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.