WPIntell

Source evidence

PHP Warning – Expected parameter 2 to be an array

Error Log Monitor · support · 2023-02-24T04:42:00+00:00

mixedsentiment
mediumseverity
0.85relevance
13replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 31 rows with source links

16.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Robert resolved
Recently received this PHP Log warning: Warning: array_merge(): Expected parameter 2 to be an array, bool given in /home/onenameg/public_html/wp/wp-content/plugins/error-log-monitor/Elm/Settings.php on line 8 Could you please advise if this is anything to worry about? Many thanks Robert Thank you for the report. That’s an unusual error, it sounds like maybe the plugin settings have been overwritten with invalid data. Please try this: click the “Configure” link in the widget header, then click “Save Changes” in the configuration screen (no need to change anything, just save the existing settings). Thanks for your advice Janis. Have done as you suggested. Will let you know how that goes. Many thanks Robert Hi Janis I tried the fix you suggested and cleared the log. However, the same error appeared again the next day: Warning: array_merge(): Expected parameter 2 to be an array, string given in /home/onenameg/public_html/wp/wp-content/plugins/error-log-monitor/Elm/Settings.php on line 8 Should I try something else? Many thanks Robert This reply was modified 3 years, 3 months ago by Robert . This error looks slightly different: the first one said bool given , while this error says string given . That suggests some data was loaded from the database, but now it’s in the wrong format (or invalid; impossible to say without seeing the data). The fact that the plugin is active all the time (presumably), but the error only happened again after a day or so, could mean that the error only happens during a cron job or another periodic event. Is there anything on your site that could affect how settings are loaded from the database during a cron job? Like a caching plugin or a filter that chooses which DB prefix (for Multisite) to use depending on the environment? Thanks very much for getting back Janis. I confirm the plugin runs all the time. Let me discuss with others in our little Web Team and get back to you. FYI we’re running WordPress 6.1.1 on Focus Pro Theme using Genesis 3.4.0 and Error Log Monitor 1.7.4 With much thanks Robert Have discussed with our Web Team [all volunteers] but no one can throw any more light on the issue. It may be connected to the upgrade to WP6 that produced a lot of PHP cron warning errors that we have never seen before – probably because the PHP upgrade made errors visible that previously weren’t reported. We generally now ignore these cron errors – without any noticeable impact on the website. Ignoring the error doesn’t always stop the error from appearing. In which case we add these errors to ignored regular expressions in the PHP Error Log. However, I notice with this error: Warning: array_merge(): Expected parameter 2 to be an array, string given in /home/onenameg/public_html/wp/wp-content/plugins/error-log-monitor/Elm/Settings.php on line 8 that when I ignore it and go to Configure, it doesn’t appear in the list of Ignored errors. And when I click Cancel, the same error appears again in PHP Error Log. I tried this several times with the same result. If I Clear Log, the error remains. So I can’t delete it! Very odd behaviour. Hope you can help. Cheers Robert The ignored errors are stored in the same database entry as other plugin settings. Are you able to edit any other settings in the widget configuration? For example, if you change the “number of entries to show” field, does that change persist if you leave and reopen the configuration screen? I’m asking that to check if there could be a bigger problem where the plugin can’t either load or save settings in some circumstances. Also, is this happening on a regular site or in a Multisite network? There are certain database issues that are more common in Multisite, and it’s possible they could affect the plugin this way. Thanks Janis for helping with this one. Currently we don’t have anything entered in the “number of entries to show” field. So added ’10’ and saved. But when I went back to the config screen, it hadn’t saved anything! We’re not using a multi site network. Just a regular WP installation. Hope this helps, Robert On a regular site, the plugin settings would be saved in the wp_options table, in an option named ws_error_log_monitor_settings . Does this option exist in your database? If so, please try deleting it and then changing a setting again. Does it save properly now? You could also try checking the wp_options table for errors. Most database management tools should have a button or link that does that. Found the options table and deleted ws_error_log_monitor_settings. And yes, it’s now saving “PHP Warning: array_merge(): Expected parameter 1 to be an array …” in Ignored Messages. So the PHP Error Log in Dashboard is now showing no entries. Do I need to do anything further at this stage? It sounds like it’s working now. But just to be sure, I would recommend this: wait a day or two, then un-ignore that warning, and see if any more warnings like that have been logged in the past 24 hours. If not, the problem has probably been fixed, and you can add the warning to the ignore list again. Thanks heaps Janis. Will do the final test as you suggest. A lot of the cron errors that we previously set to Ignore will probably reappear now as we deleted the ELM settings. So will just set to ignore again. So not a problem. Will let you know if we have any further problems. But looking good so far. Cheers – Robert Hi Janis Did final test and unignored error. No new similar errors in past 24 hours. So ignored again and assume everything ok. Huge thanks for all your help. All the best Robert

Comments

13 shown
Janis Elsts 2023-02-24T11:57:00+00:00

Thank you for the report. That’s an unusual error, it sounds like maybe the plugin settings have been overwritten with invalid data. Please try this: click the “Configure” link in the widget header, then click “Save Changes” in the configuration screen (no need to change anything, just save the existing settings).

Robert 2023-02-24T23:49:00+00:00

Thanks for your advice Janis. Have done as you suggested. Will let you know how that goes. Many thanks Robert

Robert 2023-02-26T02:01:00+00:00

Hi Janis I tried the fix you suggested and cleared the log. However, the same error appeared again the next day: Warning: array_merge(): Expected parameter 2 to be an array, string given in /home/onenameg/public_html/wp/wp-content/plugins/error-log-monitor/Elm/Settings.php on line 8 Should I try something else? Many thanks Robert This reply was modified 3 years, 3 months ago by Robert .

Janis Elsts 2023-02-26T10:38:00+00:00

This error looks slightly different: the first one said bool given , while this error says string given . That suggests some data was loaded from the database, but now it’s in the wrong format (or invalid; impossible to say without seeing the data). The fact that the plugin is active all the time (presumably), but the error only happened again after a day or so, could mean that the error only happens during a cron job or another periodic event. Is there anything on your site that could affect how settings are loaded from the database during a cron job? Like a caching plugin or a filter that chooses which DB prefix (for Multisite) to use depending on the environment?

Robert 2023-02-26T23:42:00+00:00

Thanks very much for getting back Janis. I confirm the plugin runs all the time. Let me discuss with others in our little Web Team and get back to you. FYI we’re running WordPress 6.1.1 on Focus Pro Theme using Genesis 3.4.0 and Error Log Monitor 1.7.4 With much thanks Robert

Robert 2023-03-01T03:11:00+00:00

Have discussed with our Web Team [all volunteers] but no one can throw any more light on the issue. It may be connected to the upgrade to WP6 that produced a lot of PHP cron warning errors that we have never seen before – probably because the PHP upgrade made errors visible that previously weren’t reported. We generally now ignore these cron errors – without any noticeable impact on the website. Ignoring the error doesn’t always stop the error from appearing. In which case we add these errors to ignored regular expressions in the PHP Error Log. However, I notice with this error: Warning: array_merge(): Expected parameter 2 to be an array, string given in /home/onenameg/public_html/wp/wp-content/plugins/error-log-monitor/Elm/Settings.php on line 8 that when I ignore it and go to Configure, it doesn’t appear in the list of Ignored errors. And when I click Cancel, the same error appears again in PHP Error Log. I tried this several times with the same result. If I Clear Log, the error remains. So I can’t delete it! Very odd behaviour. Hope you can help. Cheers Robert

Janis Elsts 2023-03-01T18:56:00+00:00

The ignored errors are stored in the same database entry as other plugin settings. Are you able to edit any other settings in the widget configuration? For example, if you change the “number of entries to show” field, does that change persist if you leave and reopen the configuration screen? I’m asking that to check if there could be a bigger problem where the plugin can’t either load or save settings in some circumstances. Also, is this happening on a regular site or in a Multisite network? There are certain database issues that are more common in Multisite, and it’s possible they could affect the plugin this way.

Robert 2023-03-02T02:14:00+00:00

Thanks Janis for helping with this one. Currently we don’t have anything entered in the “number of entries to show” field. So added ’10’ and saved. But when I went back to the config screen, it hadn’t saved anything! We’re not using a multi site network. Just a regular WP installation. Hope this helps, Robert

Janis Elsts 2023-03-02T09:08:00+00:00

On a regular site, the plugin settings would be saved in the wp_options table, in an option named ws_error_log_monitor_settings . Does this option exist in your database? If so, please try deleting it and then changing a setting again. Does it save properly now? You could also try checking the wp_options table for errors. Most database management tools should have a button or link that does that.

Robert 2023-03-04T01:57:00+00:00

Found the options table and deleted ws_error_log_monitor_settings. And yes, it’s now saving “PHP Warning: array_merge(): Expected parameter 1 to be an array …” in Ignored Messages. So the PHP Error Log in Dashboard is now showing no entries. Do I need to do anything further at this stage?

Janis Elsts 2023-03-04T09:48:00+00:00

It sounds like it’s working now. But just to be sure, I would recommend this: wait a day or two, then un-ignore that warning, and see if any more warnings like that have been logged in the past 24 hours. If not, the problem has probably been fixed, and you can add the warning to the ignore list again.

Robert 2023-03-05T01:44:00+00:00

Thanks heaps Janis. Will do the final test as you suggest. A lot of the cron errors that we previously set to Ignore will probably reappear now as we deleted the ELM settings. So will just set to ignore again. So not a problem. Will let you know if we have any further problems. But looking good so far. Cheers – Robert

Robert 2023-03-07T02:27:00+00:00

Hi Janis Did final test and unignored error. No new similar errors in past 24 hours. So ignored again and assume everything ok. Huge thanks for all your help. All the best Robert