I notice a strange issue when I try to add “foreach” in my code even if it’s in a comment, the request fails with 403
Something with foreach word!
It started with the recent plugin updates …
can you please assist on how to fix?
]]># foreach() receiving null values in getOutput method of Output.php
# Details
I'm getting an exception error reported by sentry saying that a foreach statement in getOutput method of popular posts is receiving null values. The stack trace is:
**"ErrorException: Warning: foreach() argument must be of type array|object, null given"**
The line it is referring to is foreach( $body->childNodes as $node ) {
which is line 181 of web/app/plugins/wordpress-popular-posts/src/Output.php, in the getOutput method. Here is the full code in context for the public function getOutput that this line is inside of:
foreach( $body->childNodes as $node ) {
$clean_html .= $dom->saveHTML($node);
}
So far there appear to be no problems on the site itself, even on the page sentry is reporting that it is finding the error on. However, I wanted to investigate this issue before it became a larger problem.
Wordpress version 6.4.3
PHP version 8.0.22
Plugin version 6.4.2
# Solution
I was considering a defensive programming solution where I might check if the array?is_empy
??prior to the foreach, but since this is inside of a plugin, the only way can think to do that on my end is to create a patch. However, if a solution is already known for this issue or if patching would be overkill when there is a simpler solution, I would appreciate any assistance.
]]>Recently my website became too slow. After checking the nginx error log, I have found that for each page access, I am seeing this error
FastCGI sent in stderr: "PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /wp-admin/includes/plugin.php on line 1784PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /wp-admin/includes/plugin.php on line 1784PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /wp-admin/includes/plugin.php on line 1784" while reading response header from upstream
Seems like its WordPress issue. But I am not really sure.
Help appreciated
Thanks!
]]>I’m programatically creating custom variables using an array and a foreach loop. The array is a list of platforms which corresponds with an meta key in the database which stores the url of the said platform for the current post.
$platform_list = array(
array('name' => 'Apple Music', 'slug' => 'apple_music')
array('name' => 'Soundcloud', 'slug' => 'soundcloud'),
array('name' => 'Spotify', 'slug' => 'spotify')
);
foreach($platform_list as $platform) {
$slug = $platform['slug'];
$name = $platform['name'];
rank_math_register_var_replacement($slug, array(
'name' => esc_html__($name, 'rank-math'),
'description' => esc_html__('url for '.$name, 'rank-math'),
'variable' => $slug,
'example' => 'test'
), 'my_callback_function');
}
function my_callback_function($var_args = array(), $post = array()) {
var_dump($var_args);
return '#url';
}
Using a foreach loop to create custom variables works. However I like to access the arguments I pass into rank_math_register_var_replacement inside my callback function, because I need the value of $slug in order to get the corresponding metadata.
The problem is that $var_args is always empty in the callback function.
I have tried the following:
Relevant functions within Rank Math:
The question:
How can I access the arguments of rank_math_register_var_replacement inside the callback function or pass an argument into the callback function?
Thanks!
]]>I am getting the following error on my site.
Warning: foreach() argument must be of type array|object, string given in /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/db.php on line 267
System info:
== Server Environment ==
Operating System: Linux
Software: Apache
MySQL version: MariaDB Server v10.6.15
PHP Version: 8.2.10
PHP Memory Limit: 128M
PHP Max Input Vars: 5000
PHP Max Post Size: 20M
GD Installed: Yes
ZIP Installed: Yes
Write Permissions: All right
Elementor Library: Connected
== WordPress Environment ==
Version: 6.3.1
Site URL: https://binding.bg
Home URL: https://binding.bg
WP Multisite: No
Max Upload Size: 20 MB
Memory limit: 40M
Max Memory limit: 256M
Permalink Structure: /%year%/%monthnum%/%day%/%postname%/
Language: en-US
Timezone: 0
Debug Mode: Inactive
== Theme ==
Name: OceanWP
Version: 3.5.0
Author: OceanWP
Child Theme: No
== User ==
Role: administrator
WP Profile lang: en_US
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
== Active Plugins ==
Age Gate
Version: 3.2.0
Author: Phil Baker
Akismet Anti-spam: Spam Protection
Version: 5.3
Author: Automattic - Anti-spam Team
Contact Form 7
Version: 5.8.1
Author: Takayuki Miyoshi
CookieYes | GDPR Cookie Consent
Version: 3.1.4
Author: CookieYes
Elementor
Version: 3.16.5
Author: Elementor.com
Essential Addons for Elementor
Version: 5.8.11
Author: WPDeveloper
Jetpack
Version: 12.6.2
Author: Automattic
Ocean Extra
Version: 2.2.0
Author: OceanWP
WP Rollback
Version: 1.7.3
Author: GiveWP.com
WP Version Remover
Version: 1.0
Author: SuperHosting.BG
== Elementor Experiments ==
Optimized DOM Output: Active by default
Improved Asset Loading: Active by default
Improved CSS Loading: Inactive by default
Inline Font Icons: Inactive by default
Additional Custom Breakpoints: Active by default
admin_menu_rearrangement: Inactive by default
Flexbox Container: Inactive by default
Upgrade Swiper Library: Inactive by default
Grid Container: Inactive by default
Editor Top Bar: Inactive by default
Landing Pages: Active by default
Nested Elements: Inactive by default
Lazy Load Background Images: Inactive by default
Global Style Guide: Inactive by default
== Log ==
Log: showing 20 of 292023-01-29 13:41:20
PHP: showing 13 of 13PHP: 2023-10-02 11:43:24 [error X 98][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php::71] Uncaught TypeError: Elementor\Elements_Manager::create_element_instance(): Argument #1 ($element_data) must be of type array, string given, called in /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php on line 172 and defined in /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php:71
Stack trace: 0 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(172): Elementor\Elements_Manager->create_element_instance(‘Array’) 1 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(677): Elementor\Core\Files\CSS\Post->render_css() 2 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/base.php(180): Elementor\Core\Files\CSS\Base->parse_content() 3 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(130): Elementor\Core\Files\Base->update_file() 4 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(226): Elementor\Core\Files\CSS\Base->update() 5 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue() 6 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/dynamic-tags/manager.php(488): Elementor\Core\Files\CSS\Post->enqueue() 7 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(308): Elementor\Core\DynamicTags\Manager->after_enqueue_post_css(Object(Elementor\Core\DynamicTags\Dynamic_CSS)) 8 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array) 9 /home/schofferhofer/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 10 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(273): do_action(‘elementor/css-f…’, Object(Elementor\Core\Files\CSS\Post)) 11 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue() 12 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(676): Elementor\Core\Files\CSS\Post->enqueue() 13 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(308): Elementor\Frontend->enqueue_styles(”) 14 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) 15 /home/schofferhofer/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 16 /home/schofferhofer/public_html/wp-includes/script-loader.php(2180): do_action(‘wp_enqueue_scri…’) 17 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(308): wp_enqueue_scripts(”) 18 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array) 19 /home/schofferhofer/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 20 /home/schofferhofer/public_html/wp-includes/general-template.php(3043): do_action(‘wp_head’) 21 /home/schofferhofer/public_html/wp-content/themes/oceanwp/header.php(15): wp_head() 22 /home/schofferhofer/public_html/wp-includes/template.php(783): require_once(‘/home/schofferh…’) 23 /home/schofferhofer/public_html/wp-includes/template.php(718): load_template(‘/home/schofferh…’, true, Array) 24 /home/schofferhofer/public_html/wp-includes/general-template.php(48): locate_template(Array, true, true, Array) 25 /home/schofferhofer/public_html/wp-content/plugins/elementor/modules/page-templates/templates/header-footer.php(9): get_header() 26 /home/schofferhofer/public_html/wp-includes/template-loader.php(106): include(‘/home/schofferh…’) 27 /home/schofferhofer/public_html/wp-blog-header.php(19): require_once(‘/home/schofferh…’) 28 /home/schofferhofer/public_html/index.php(17): require(‘/home/schofferh…’) 29 {main}
thrown [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-03 07:00:19 [error X 1][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php::71] Uncaught TypeError: Elementor\Elements_Manager::create_element_instance(): Argument #1 ($element_data) must be of type array, string given, called in /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php on line 172 and defined in /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php:71
Stack trace: 0 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(172): Elementor\Elements_Manager->create_element_instance(‘Array’) 1 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(677): Elementor\Core\Files\CSS\Post->render_css() 2 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/base.php(180): Elementor\Core\Files\CSS\Base->parse_content() 3 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(130): Elementor\Core\Files\Base->update_file() 4 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(226): Elementor\Core\Files\CSS\Base->update() 5 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue() 6 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/dynamic-tags/manager.php(488): Elementor\Core\Files\CSS\Post->enqueue() 7 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(308): Elementor\Core\DynamicTags\Manager->after_enqueue_post_css(Object(Elementor\Core\DynamicTags\Dynamic_CSS)) 8 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array) 9 /home/schofferhofer/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 10 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(273): do_action(‘elementor/css-f…’, Object(Elementor\Core\Files\CSS\Post)) 11 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue() 12 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(1155): Elementor\Core\Files\CSS\Post->enqueue() 13 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(1074): Elementor\Frontend->get_builder_content(17991) 14 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(308): Elementor\Frontend->apply_builder_in_content(‘Tucher…’) 15 /home/schofferhofer/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘Tucher…’, Array) 16 /home/schofferhofer/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1857): apply_filters(‘the_content’, ‘Tucher…’) 17 /home/schofferhofer/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(568): WP_REST_Posts_Controller->prepare_item_for_response(Object(WP_Post), Object(WP_REST_Request)) 18 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(1171): WP_REST_Posts_Controller->get_item(Object(WP_REST_Request)) 19 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request(Object(WP_REST_Request), ‘/wp/v2/pages/(?…’, Array, NULL) 20 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(442): WP_REST_Server->dispatch(Object(WP_REST_Request)) 21 /home/schofferhofer/public_html/wp-includes/rest-api.php(410): WP_REST_Server->serve_request(‘/wp/v2/pages/17…’) 22 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(308): rest_api_loaded(Object(WP)) 23 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array) 24 /home/schofferhofer/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array) 25 /home/schofferhofer/public_html/wp-includes/class-wp.php(399): do_action_ref_array(‘parse_request’, Array) 26 /home/schofferhofer/public_html/wp-includes/class-wp.php(780): WP->parse_request(”) 27 /home/schofferhofer/public_html/wp-includes/functions.php(1332): WP->main(”) 28 /home/schofferhofer/public_html/wp-blog-header.php(16): wp() 29 /home/schofferhofer/public_html/index.php(17): require(‘/home/schofferh…’) 30 {main}
thrown [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-03 11:20:37 [error X 1][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/db.php::267] Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-03 11:23:02 [error X 1130][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php::71] Uncaught TypeError: Elementor\Elements_Manager::create_element_instance(): Argument #1 ($element_data) must be of type array, string given, called in /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php on line 172 and defined in /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php:71
Stack trace: 0 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(172): Elementor\Elements_Manager->create_element_instance(‘Array’) 1 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(677): Elementor\Core\Files\CSS\Post->render_css() 2 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/base.php(180): Elementor\Core\Files\CSS\Base->parse_content() 3 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(130): Elementor\Core\Files\Base->update_file() 4 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(226): Elementor\Core\Files\CSS\Base->update() 5 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue() 6 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(676): Elementor\Core\Files\CSS\Post->enqueue() 7 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(310): Elementor\Frontend->enqueue_styles(”) 8 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) 9 /home/schofferhofer/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 10 /home/schofferhofer/public_html/wp-includes/script-loader.php(2225): do_action(‘wp_enqueue_scri…’) 11 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(310): wp_enqueue_scripts(”) 12 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) 13 /home/schofferhofer/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 14 /home/schofferhofer/public_html/wp-includes/general-template.php(3053): do_action(‘wp_head’) 15 /home/schofferhofer/public_html/wp-content/themes/oceanwp/header.php(15): wp_head() 16 /home/schofferhofer/public_html/wp-includes/template.php(785): require_once(‘/home/schofferh…’) 17 /home/schofferhofer/public_html/wp-includes/template.php(720): load_template(‘/home/schofferh…’, true, Array) 18 /home/schofferhofer/public_html/wp-includes/general-template.php(48): locate_template(Array, true, true, Array) 19 /home/schofferhofer/public_html/wp-content/plugins/elementor/modules/page-templates/templates/header-footer.php(9): get_header() 20 /home/schofferhofer/public_html/wp-includes/template-loader.php(106): include(‘/home/schofferh…’) 21 /home/schofferhofer/public_html/wp-blog-header.php(19): require_once(‘/home/schofferh…’) 22 /home/schofferhofer/public_html/index.php(17): require(‘/home/schofferh…’) 23 {main}
thrown [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-03 11:36:16 [error X 5][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/db.php::3] Namespace declaration statement has to be the very first statement or after any declare call in the script [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-03 12:41:54 [notice X 1][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/elements/container.php::43] Creation of dynamic property Elementor\Includes\Elements\Container::$logical_dimensions_inline_end is deprecated [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-06 10:33:14 [error X 1][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php::71] Uncaught TypeError: Elementor\Elements_Manager::create_element_instance(): Argument #1 ($element_data) must be of type array, string given, called in /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php on line 172 and defined in /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php:71
Stack trace: 0 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(172): Elementor\Elements_Manager->create_element_instance(‘Array’) 1 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(677): Elementor\Core\Files\CSS\Post->render_css() 2 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/base.php(180): Elementor\Core\Files\CSS\Base->parse_content() 3 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(130): Elementor\Core\Files\Base->update_file() 4 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(226): Elementor\Core\Files\CSS\Base->update() 5 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue() 6 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(1155): Elementor\Core\Files\CSS\Post->enqueue() 7 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(1074): Elementor\Frontend->get_builder_content(16182) 8 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(310): Elementor\Frontend->apply_builder_in_content(‘Primator</h…’) 9 /home/schofferhofer/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘Primator</h…’, Array) 10 /home/schofferhofer/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1864): apply_filters(‘the_content’, ‘Primator</h…’) 11 /home/schofferhofer/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(569): WP_REST_Posts_Controller->prepare_item_for_response(Object(WP_Post), Object(WP_REST_Request)) 12 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(1188): WP_REST_Posts_Controller->get_item(Object(WP_REST_Request)) 13 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(1035): WP_REST_Server->respond_to_request(Object(WP_REST_Request), ‘/wp/v2/pages/(?…’, Array, NULL) 14 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(447): WP_REST_Server->dispatch(Object(WP_REST_Request)) 15 /home/schofferhofer/public_html/wp-includes/rest-api.php(418): WP_REST_Server->serve_request(‘/wp/v2/pages/16…’) 16 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(310): rest_api_loaded(Object(WP)) 17 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(”, Array) 18 /home/schofferhofer/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array) 19 /home/schofferhofer/public_html/wp-includes/class-wp.php(398): do_action_ref_array(‘parse_request’, Array) 20 /home/schofferhofer/public_html/wp-includes/class-wp.php(779): WP->parse_request(”) 21 /home/schofferhofer/public_html/wp-includes/functions.php(1335): WP->main(”) 22 /home/schofferhofer/public_html/wp-blog-header.php(16): wp() 23 /home/schofferhofer/public_html/index.php(17): require(‘/home/schofferh…’) 24 {main}
thrown [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-07 10:52:40 [error X 1][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php::71] Uncaught TypeError: Elementor\Elements_Manager::create_element_instance(): Argument #1 ($element_data) must be of type array, string given, called in /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php on line 172 and defined in /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php:71
Stack trace: 0 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(172): Elementor\Elements_Manager->create_element_instance(‘Array’) 1 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(677): Elementor\Core\Files\CSS\Post->render_css() 2 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/base.php(180): Elementor\Core\Files\CSS\Base->parse_content() 3 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(130): Elementor\Core\Files\Base->update_file() 4 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(226): Elementor\Core\Files\CSS\Base->update() 5 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue() 6 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(1155): Elementor\Core\Files\CSS\Post->enqueue() 7 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(1074): Elementor\Frontend->get_builder_content(16169) 8 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(310): Elementor\Frontend->apply_builder_in_content(‘Dab\t\t\n…’) 9 /home/schofferhofer/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘Dab\t\t\n…’, Array) 10 /home/schofferhofer/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1864): apply_filters(‘the_content’, ‘Dab\t\t\n…’) 11 /home/schofferhofer/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(569): WP_REST_Posts_Controller->prepare_item_for_response(Object(WP_Post), Object(WP_REST_Request)) 12 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(1188): WP_REST_Posts_Controller->get_item(Object(WP_REST_Request)) 13 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(1035): WP_REST_Server->respond_to_request(Object(WP_REST_Request), ‘/wp/v2/pages/(?…’, Array, NULL) 14 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(447): WP_REST_Server->dispatch(Object(WP_REST_Request)) 15 /home/schofferhofer/public_html/wp-includes/rest-api.php(418): WP_REST_Server->serve_request(‘/wp/v2/pages/16…’) 16 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(310): rest_api_loaded(Object(WP)) 17 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(”, Array) 18 /home/schofferhofer/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array) 19 /home/schofferhofer/public_html/wp-includes/class-wp.php(398): do_action_ref_array(‘parse_request’, Array) 20 /home/schofferhofer/public_html/wp-includes/class-wp.php(779): WP->parse_request(”) 21 /home/schofferhofer/public_html/wp-includes/functions.php(1335): WP->main(”) 22 /home/schofferhofer/public_html/wp-blog-header.php(16): wp() 23 /home/schofferhofer/public_html/index.php(17): require(‘/home/schofferh…’) 24 {main}
thrown [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-07 17:14:51 [error X 12][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/db.php::267] syntax error, unexpected variable “$data_container”, expecting “(” [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-07 17:16:50 [error X 6][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/db.php::271] syntax error, unexpected token “return”, expecting “function” or “const” [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-07 17:56:50 [error X 1][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php::71] Uncaught TypeError: Elementor\Elements_Manager::create_element_instance(): Argument #1 ($element_data) must be of type array, string given, called in /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php on line 172 and defined in /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/managers/elements.php:71
Stack trace: 0 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(172): Elementor\Elements_Manager->create_element_instance(‘Array’) 1 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(677): Elementor\Core\Files\CSS\Post->render_css() 2 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/base.php(180): Elementor\Core\Files\CSS\Base->parse_content() 3 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(130): Elementor\Core\Files\Base->update_file() 4 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/base.php(226): Elementor\Core\Files\CSS\Base->update() 5 /home/schofferhofer/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue() 6 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(1155): Elementor\Core\Files\CSS\Post->enqueue() 7 /home/schofferhofer/public_html/wp-content/plugins/elementor/includes/frontend.php(1074): Elementor\Frontend->get_builder_content(16194) 8 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(310): Elementor\Frontend->apply_builder_in_content(‘Estrella Da…’) 9 /home/schofferhofer/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘Estrella Da…’, Array) 10 /home/schofferhofer/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1864): apply_filters(‘the_content’, ‘Estrella Da…’) 11 /home/schofferhofer/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(569): WP_REST_Posts_Controller->prepare_item_for_response(Object(WP_Post), Object(WP_REST_Request)) 12 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(1188): WP_REST_Posts_Controller->get_item(Object(WP_REST_Request)) 13 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(1035): WP_REST_Server->respond_to_request(Object(WP_REST_Request), ‘/wp/v2/pages/(?…’, Array, NULL) 14 /home/schofferhofer/public_html/wp-includes/rest-api/class-wp-rest-server.php(447): WP_REST_Server->dispatch(Object(WP_REST_Request)) 15 /home/schofferhofer/public_html/wp-includes/rest-api.php(418): WP_REST_Server->serve_request(‘/wp/v2/pages/16…’) 16 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(310): rest_api_loaded(Object(WP)) 17 /home/schofferhofer/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(”, Array) 18 /home/schofferhofer/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array) 19 /home/schofferhofer/public_html/wp-includes/class-wp.php(398): do_action_ref_array(‘parse_request’, Array) 20 /home/schofferhofer/public_html/wp-includes/class-wp.php(779): WP->parse_request(”) 21 /home/schofferhofer/public_html/wp-includes/functions.php(1335): WP->main(”) 22 /home/schofferhofer/public_html/wp-blog-header.php(16): wp() 23 /home/schofferhofer/public_html/index.php(17): require(‘/home/schofferh…’) 24 {main}
thrown [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-11 15:35:59 [error X 24][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/db.php::294] syntax error, unexpected token “public” [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
PHP: 2023-10-11 15:56:54 [error X 3][/home/schofferhofer/public_html/wp-content/plugins/elementor/includes/db.php::584] Unclosed ‘{‘ on line 19 [array (
‘trace’ => ‘ 0: Elementor\Core\Logger\Manager -> shutdown()
‘,
)]
== Elementor – Compatibility Tag ==
Essential Addons for Elementor: Compatible
]]>I noticed in my server error log file that a PHP Warning with your plugin keeps coming all the time, it is the following:
PHP Warning: foreach() argument must be of type array|object, null given in wp-content/plugins/ultimate-addons-for-gutenberg/classes/class-uagb-front-assets.php on line 183
Note: I’m using PHP 8.0 on my server.
Please fix it or tell me how to fix it on my server.
Thanks in advance
I’ve been seeing the following error in my error log for months now, but it wasn’t a daily occurence. However, it started happening a few times daily in the last 4 days.
PHP Warning: foreach() argument must be of type array|object, null given in …/content/themes/generatepress/inc/structure/post-meta.php on line 338
This line is the first in this code:
foreach ( $items as $item ) {
$default_display = true;
if ( 'comments-link' === $item && is_singular() ) {
$default_display = false;
}
Just before it is this code (just part of it):
/**
* Remove post meta items from display if their individual filters are set.
*
* @since 3.0.0
* @param array $items The post meta items.
*/
function generate_disable_post_meta_items( $items )
I’m also using filters to display the updated date and link author name to a custom page (not author archive).
I see no errors on the frontend.
My question: Is this a theme coding issue or is it happening because of my filters maybe? Is there a way to fix it?
Thank you!
]]>Warning: Invalid argument supplied for foreach() in?/home/customer/www/travellingmunchie.com/public_html/wp-content/themes/isla/inc/custom-controls/custom-controls.php?on line?496
I am brand new to setting up my own websites and have no idea where to go or what to do to fix this. I read up on it online and it said something about changing the foreach () but I do not have a clue how to get there. Someone please help!
]]>I’m just working on a website when this error occurred: Warning: Invalid argument supplied for foreach() in /home/customer/www/eierenbestellen.nl/public_html/wp-content/themes/smartic/inc/elementor/class-elementor.php on line 68
When I go to the specific code on line 68 I see:
68 `foreach ($custom_color as $color) {
69 $title = $color[“title”];
70 switch ($title) {
71 case “Light”:
72 $css .= ‘–light:’ . $color[‘color’] . ‘;’;
73 break;
74 case “Dark”:
75 $css .= ‘–dark:’ . $color[‘color’] . ‘;’;
76 break;
77 case “Border”:
78 $css .= ‘–border:’ . $color[‘color’] . ‘;’;
79 break;
80 }`
How can I solve this error?
]]>