Support » Plugin: Woody code snippets - Insert Header Footer Code, AdSense Ads » Fatal error with WordPress 5.0.2 Guteberg Editor

  • Hallo Support Team,

    after installing the new WordPress Version 5.0.2 i get an error in the WordPress Admin area when i want to edit the Page on which i have implemented an PHP snippet. I think it has something to do with the new Gutenberg Editor.

    Online everythink is working well with the Page and the snippets also work well.

    The Error:
    Fatal error: Call to a member function query() on null in /home/immotdbd/ on line 19

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi
    1. Please put here snippet code.
    2. what is it? Is it your custom code or some plugin?

    Best regards

    Thread Starter jaroslawvenzke


    Thanks Kirill,

    1. The snippet code

    2. Sorry for this Link. I try to explain the problem:
    I create a snippet (see 1.). In my WordPress Admininterface i created a page and in this page i include the snippet like this f.e.: [wbcr_php_snippet id=”3239″]- It works like a charm 🙂 but now i updated to WordPress 5.0.2 and now i can not open this page in my WordPress Adminuserinterface anymore, an instead of that i get this “Fatal Error” message. In the Frontend everything seems to work fine. The snippet works well, but i can not change anything in the page.

    Like i see your tool ist only tested mit WordPress 4.9.9. It could be a good way to test it with WordPress 5.0.2 and the new Gutenberg Editor. After that i think you will see that your plugin ist not loger working well.

    Kind regards

    I got it. We will fix it in next updates.

    I suggest you temporary fix.
    In the file wp-content/plugins/insert-php/includes/shortcodes.php find the follow code:

    public function html($attr, $content)
        if( isset($attr['title']) ) {

    and replace with:

    public function html($attr, $content)
        // gutenberg fix
        if(is_admin() or (defined('REST_REQUEST') && REST_REQUEST)){
        if( isset($attr['title']) ) {

    Thanks for report

    Thread Starter jaroslawvenzke


    Very great support!
    It works :)))
    Thanks Kirill!!

    This also worked for the same problem I was seeing on WordPress 4.9.9. We were getting the same error in the wp-admin page editor for pages with snippets embedded in them. Not all scripts were affected – I have not been able to figure out why some pages were and some were not. There is no significant difference in the scripts.

    Plugin Author webcraftic


    We are actively testing new version, in which all the reported problems will be fixed. I guess we can release the update by Monday.

    Best regards, Alex

    is it work for my snippet codes? I think i got a same problem on my wordpress after I used this snippet and I get blank page with “Koneksi gagal” words on every pages of my wordpress

    *sorry for my bad english, I hope u understand what I mean:)

    This my snippet codes.

    $host =”localhost”; //host server
    $user =”aqiqahbe”; //user login phpMyAdmin
    $pass =”1Cgf5kO1n5″; //pass login phpMyAdmin
    $db =”aqiqahbe_orderan”; //nama database
    $conn = mysqli_connect($host, $user, $pass, $db) or die (“Koneksi gagal”);

    $name = $_REQUEST[‘nama’];
    $pkt = $_REQUEST[‘paket’];
    $tlp = $_REQUEST[‘telp’];
    $imail = $_REQUEST[’email’];
    $hr = $_REQUEST[‘tanggal’];
    $jam = $_REQUEST[‘waktu’];
    $alm = $_REQUEST[‘alamat’];
    $cttn = $_REQUEST[‘catatan’];
    $submit = $_REQUEST[‘submit’];

    function ubahTanggal($hr){
    $pisah = explode(‘/’,$hr);
    $array = array($pisah[2],$pisah[0],$pisah[1]);
    $satukan = implode(‘-‘,$array);
    return $satukan;

    $tgl = ubahTanggal($hr);

    $mysqli = “INSERT INTO order_tabel (nm, paket, tlp, mail, tgl, wkt, addr, note) VALUES (‘$name’, ‘$pkt’, ‘$tlp’,’$imail’,’$tgl’,’$jam’,’$alm’,’$cttn’)”;

    if(empty($name) or empty($pkt) or empty($tlp) or empty($tgl) or empty($jam) or empty($alm)){
    echo “<script>window.alert(‘Maaf, form tidak boleh kosong…’)</script>”;
    } else {
    $result = mysqli_query($conn, $mysqli);
    if ($result) {
    echo ”

    <center>Pemesanan berhasil
    Silakan segera hubungi kontak kami untuk konfirmasi pemesanan</center>”;
    } else {
    echo “<center>Pemesanan gagal
    Mohon coba lagi</center>”;

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error with WordPress 5.0.2 Guteberg Editor’ is closed to new replies.