class ForminatorHooksDebugger {
private $entry_id = 'N/A';
public function __construct() {
add_filter( 'forminator_replace_form_data', array( $this, 'replace_form_data' ), 10, 3 );
}
public function replace_form_data( $content, $data, $original_content) {
error_log( "Hook: forminator_form_replace_form_data - Form ID: " . $data['form_id'] );
$this->log_current_entry( $data['form_id'], "replace_form_data", $data);
}
private function log_current_entry( $form_id, $hook_name, $entry = null ) {
if (is_null($entry)) {
error_log( "Current Entry (within " . $hook_name . "): Entry is not available at this point." );
return;
}
if (is_object($entry) or is_array($entry)) {
error_log( "Current Entry (within " . $hook_name . "): " . print_r( $entry, true ) );
} else {
error_log("Current Entry (within " . $hook_name . "): Entry format is unknown.");
error_log(print_r($entry, true));
return;
}
}
}
new ForminatorHooksDebugger();
The Notice is:
[06-Feb-2025 07:52:59 UTC]?PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /public_html/wp-content/plugins/forminator/library/helpers/helper-fields.php on line 1138
There are a multi-upload field and some hidden fields in the form.
]]>Plugin Version 6.4
WP version 6.4.3
php version 8.2, 8.3
Thanks for making this awesome plugin. I have too many lines in php error log like this:
PHP Warning: strpos(): Empty needle in /home/xxx/public_html/wp-content/plugins/optimize-more/includes/functions/async-css.php on line 7
Is it possible to prevent this? The plugin works but makes the the error log file really big
]]>I had a break from working on this site and i came back only to see this error:
<span style=”font-weight: 700; color: rgb(165, 24, 204); font-family: "DM Sans", sans-serif; white-space-collapse: collapse;”>Warning</span><span style=”color: rgb(165, 24, 204); font-family: "DM Sans", sans-serif; white-space-collapse: collapse;”>: strpos() expects parameter 1 to be string, array given in?</span><span style=”font-weight: 700; color: rgb(165, 24, 204); font-family: "DM Sans", sans-serif; white-space-collapse: collapse;”>/home/customer/www/steeleaep.com/public_html/wp-includes/compat.php</span><span style=”color: rgb(165, 24, 204); font-family: "DM Sans", sans-serif; white-space-collapse: collapse;”>?on line?</span><span style=”font-weight: 700; color: rgb(165, 24, 204); font-family: "DM Sans", sans-serif; white-space-collapse: collapse;”>463</span>
This shows at the top of the page even for site visitors, i have no idea how to fix it so any help would be much appreciated thank you
]]>Deprecated: Creation of dynamic property Google\Site_Kit\Core\Authentication\Setup::$proxy_support_link_url is deprecated in /var/www/html/wp-content/plugins/google-site-kit/includes/Core/Authentication/Setup.php on line 94
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/wp-includes/functions.php on line 7053
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/wp-includes/functions.php on line 2165 Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/wp-content/plugins/google-site-kit/includes/Core/Authentication/Setup.php:94) in /var/www/html/wp-admin/includes/misc.php on line 1431 Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/wp-content/plugins/google-site-kit/includes/Core/Authentication/Setup.php:94) in /var/www/html/wp-includes/functions.php on line 6896 Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/wp-content/plugins/google-site-kit/includes/Core/Authentication/Setup.php:94) in /var/www/html/wp-admin/admin-header.php on line 9
Site info:
PHP 8.2
WordPress: 6.2.2
Site Kit by Google: 1.102.0.
Docker (latest) on Ubuntu 22.04
My website has been working fine, however I had to upgrade my PHP version from 5.6.40 to 7.3.33 and now I’m getting some errors on my WordPress admin backend, more specifically on my Widgets page, which is not working.
I have some Warnings on top of the page, such as:
Warning: strpos() expects parameter 1 to be string, array given in /home/customer/www/XXXXX.com/public_html/wp-content/plugins/qtranslate-x/admin/qtx_admin.php on line 783 Warning: substr() expects parameter 1 to be string, array given in /home/customer/www/XXXXX.com/public_html/wp-content/plugins/qtranslate-x/admin/qtx_admin.php on line 784 Warning: strpos(): Offset not contained in string in /home/customer/www/XXXXX.com/public_html/wp-content/plugins/qtranslate-x/admin/qtx_admin.php on line 783 Warning: Cannot modify header information - headers already sent by (output started at /home/customer/www/XXXXX.com/public_html/wp-content/plugins/qtranslate-x/admin/qtx_admin.php:783) in /home/customer/www/XXXXX.com/public_html/wp-admin/admin-header.php on line 9
I also have some messages informing that none of the widgets will work, most likely because of that. Here are some:
`The “custom_html” block was affected by errors and may not function properly. Check the developer tools for more details.
The “recent-posts” block was affected by errors and may not function properly. Check the developer tools for more details.
The “nav_menu” block was affected by errors and may not function properly. Check the developer tools for more details.
The “gmap” block was affected by errors and may not function properly. Check the developer tools for more details.
The “social” block was affected by errors and may not function properly. Check the developer tools for more details.
The “contact_form” block was affected by errors and may not function properly. Check the developer tools for more details.
From what I’ve been investigating the function strpos() has changed in the latest PHP versions, and one of the parameters is not used anymore, that’s why this isn’t working. Any ideas to help me solve this?
]]>[08-Mar-2022 16:35:52 UTC] PHP Fatal error: Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in /var/www/wp-content/themes/hestia-pro/inc/help
Stack trace:
#0 /var/www/wp-content/themes/hestia-pro/inc/helpers/layout-functions.php(1893): strpos(Array, 'fa-')
#1 /var/www/wp-content/themes/hestia-pro/inc/addons/views/front-page/class-hestia-pricing-section.php(107): maybe_trigger_fa_loading(Array)
#2 /var/www/wp-includes/class-wp-hook.php(307): Hestia_Pricing_Section->render_section(false)
#3 /var/www/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
#4 /var/www/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
#5 /var/www/wp-content/themes/hestia-pro/inc/addons/views/front-page/class-hestia-pricing-section.php(32): do_action('hestia_do_prici...', false)
#6 /var/www/wp-includes/class-wp-hook.php(307): Hestia_Pricing_Section->do_section(false)
#7 /var/www/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
#8 /var/www/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
#9 /var/www/wp-content/themes/hestia-pro/front-page.php(39): do_action('hestia_sections', false)
#10 /var/www/wp-includes/template-loader.php(106): include('/var/www/wp-con...')
#11 /var/www/wp-blog-header.php(19): require_once('/var/www/wp-inc...')
#12 /var/www/index.php(17): require('/var/www/wp-blo...')
#13 {main}
thrown in /var/www/wp-content/themes/hestia-pro/inc/helpers/layout-functions.php on line 1893
Please fix.
]]>I have a lot of the below warning lines in my debug log:
PHP Warning: strpos(): Empty needle in /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/w3-total-cache/UserExperience_LazyLoad_Mutator.php on line 240
This means you should check if the needle in strpos function is empty before searching for it as searching for an empty string does not make sense.
Please change the below function in UserExperience_LazyLoad_Mutator.php:
private function is_content_excluded( $content ) {
foreach ( $this->excludes as $w ) {
if ( strpos( $content, $w ) !== FALSE ) {
return true;
}
}
return false;
}
like this:
private function is_content_excluded( $content ) {
foreach ( $this->excludes as $w ) {
if ( !empty($w) ) {
if ( strpos( $content, $w ) !== FALSE ) {
return true;
}
}
}
return false;
}
This will save a lot of debug.log warnings for us.
Thank you!
Best regards,
Endre