DUPLICATE: An error of type E_ERROR was caused in line 4

Bricks Version: 1.6.1
Wordpress Version: 6.1.1
Browser: All
URL: https://www.geopozzifirenze.it/

I receive daily emails with the subject “your site is experiencing a technical issue” but the website works normally.

I’m also having the same error on 4 other websites with the same configuration but in different hostings

Specifically, the following error is indicated:

An error of type E_ERROR was caused in line 4 of the file /wp-content/themes/bricks/searchform.php. Messaggio di errore: Uncaught Error: Using $this when not in object context in /wp-content/themes/bricks/searchform.php:4

Stack trace:

#0 /wp-includes/general-template.php(308): require()
#1 /wp-content/themes/bricks/404.php(11): get_search_form()

If it can be useful, the following plugins are also installed on the website:

  • All In One WP Security
  • Complianz GDPR Cookie Consent
  • Rank Math SEO
  • WP Sweep

Has anyone encountered the same problem?
Thanks for your support !

Hi,

I’m having the same issue on wp-login.php page when I use the rename login page functionnality (brute force settings) in All In One Security plugin.

When accessing the non-existing default login page (wp-login.php), it looks like Bricks launches its default 404 template instead of mine and crashes on search form.

Do you use the rename login option in AIOS?
Which page is causing the crash?

Détails de l’erreur
======================
Une erreur de type E_ERROR a été causée dans la ligne 4 du fichier /home/blabla/www/wp-content/themes/bricks/searchform.php. Message d’erreur : Uncaught Error: Using $this when not in object context in /home/blabla/www/wp-content/themes/bricks/searchform.php:4
Stack trace:
#0 /home/blabla/www/wp-includes/general-template.php(308): require()
#1 /home/blabla/www/wp-content/themes/bricks/404.php(11): get_search_form(Array)
#2 /home/blabla/www/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-process-renamed-login-page.php(272): include('/home/ampdupuyh...')
#3 /home/blabla/www/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-process-renamed-login-page.php(184): AIOWPSecurity_Process_Renamed_Login_Page::aiowps_set_404()
#4 /home/blabla/www/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-wp-loaded-tasks.php(21): AIOWPSecurity_Process_Renamed_Login_Page::renamed_login_init_tasks()
#5 /home/blabla/www/wp-content/plugins/all-in-one-wp-security-and-firewall/wp-security-core.php(555): AIOWPSecurity_WP_Loaded_Tasks->__construct()
#6 /home/blabla/www/wp-

Hi @yankiara,
Thank you for your answer!

Yes, I changed the login page url (as I always did with any other website) and actually “trimmed” a part of the AIOS plugin error as I thought it wasn’t important.

This is the full text of the error received via email:

An error of type E_ERROR was caused in line 4 of the file /wp-content/themes/bricks/searchform.php. Messaggio di errore: Uncaught Error: Using $this when not in object context in /wp-content/themes/bricks/searchform.php:4

Stack trace:

#0 /wp-includes/general-template.php(308): require()
#1 /wp-content/themes/bricks/404.php(11): get_search_form()
#2 /wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-process-renamed-login-page.php(272): include(‘/www/MW_qIGncaP…’)
#3 /wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-process-renamed-login-page.php(184): AIOWPSecurity_Process_Renamed_Login_Page::aiowps_set_404()
#4 /wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-wp-loaded-tasks.php(21): AIOWPSecurity_Process_Renamed_Login_Page::renamed_login_init_tasks()

So you think this is “normal behavior”?
Do you know if there is any way to avoid it?

Thanks again for your time!

No, it’s not normal :wink:

And it started happening just before Christmas when I updated a lot of my sites (Bricks+AIOS).
But as I updated Bricks and AIOS at the same time and received these error emails a few days ago, I can’t tell which one is to blame :rofl:

That said, I don’t have any issue with non-Bricks sites.

For instance, with my Oxygen sites, if I try to access wp-login, I have the right 404 template displayed and no error.

Okay :slight_smile:
Thanks again for your contribution.
Let’s wait and see what happens with the next updates

Have a nice day !

I tested a site in V1.6, no problem, then updated to 1.6.1, issue appeared (no other change).
And it seems that fatal error comes from seach form, any idea @timmse?

Note:
Accessing /wp-login/ is OK and triggers the right 404 template (mine) with no error.
Accessing /wp-login.php crashes the site with Bricks 404 template.

Note 2: Before update, accessing /wp-login.php didn’t crash, but still triggered Bricks 404 template instead of user template.

1 Like

Hi Yan and Lapo can confirm. Same problem here!

1 Like

I have the same problem after updating to 1.6.1

Fatal error: Uncaught Error: Using $this when not in object context in /home/sites/22b/9/98f67fbaa3/something.ie/wp-content/themes/bricks/searchform.php:4

Timestamp: 2023-01-04 23:20:55 UTC

Stack Trace

  1. {anonymous}()
    /home/sites/22b/9/98f67fbaa3/something.ie/wp-content/themes/bricks/searchform.php:4
  2. require()
    /home/sites/22b/9/98f67fbaa3/something.ie/wp-includes/general-template.php:308
  3. get_search_form(Array(2))
    /home/sites/22b/9/98f67fbaa3/something.ie/wp-content/themes/bricks/404.php:11
  4. include(‘/home/sites/22b/9/98f6…’)
    /home/sites/22b/9/98f67fbaa3/something.ie/wp-includes/template-loader.php:106
  5. require_once(‘/home/sites/22b/9/98f6…’)
    /home/sites/22b/9/98f67fbaa3/something.ie/wp-blog-header.php:19
  6. require(‘/home/sites/22b/9/98f6…’)
    /home/sites/22b/9/98f67fbaa3/something.ie/index.php:17

Context

URL : /wp-content/plugins/support-genix/css/dashboard.css?ver=1.4.2
Referer : https://something.ie/wp-admin/index.php
HTTP Method : GET
HTTP Host : something.ie
HTTP Status : 404
isSSL : Yes
Current Filter : -
Execution Time : 2.208 s
Memory Usage : 29.94 MiB
PHP SAPI : fpm-fcgi

Hi @lapocerchiai ,

Thank you very much and we are aware of the issue.

Kindly refer to this thread :slight_smile:

And I will close this thread.

1 Like