I got the reverse shell from /usr/share/webshells/php/reverse-shell.php and updated the 404.php file with this content. To edit 404.php file got to Appearence>Editor>404.php.
Then open the listener in terminal and access the page at /wp-content/themes/404.php, you will get a shell.