500 Error When Saving Elementor Page – Stratum Plugin Warnings on PHP 8.2.28
-
Hi there,
I’m encountering a 500 Internal Server Error when trying to save a page using Elementor on my site.
PHP Warning: Undefined array key 0 in /wp-content/plugins/stratum/includes/templates/table.php on line 85
PHP Warning: Trying to access array offset on value of type null in /wp-content/plugins/stratum/includes/templates/table.php on line 85
(repeats multiple times)The issue appears to stem from a deprecated or improperly handled array access in Stratum’s
table.phpfile. Likely cause: the plugin is not fully compatible with PHP 8.2.28, asnullarray access behavior is stricter in recent PHP versions.Steps Tried:
- Deactivated Stratum plugin → issue resolved, page saves normally
- Re-activated → issue returns
Request:
Could the plugin author please:
- Review compatibility with PHP 8.2.x
- Add checks before accessing undefined array keys or null values (e.g.
isset($array[0])or!empty($array))
Until then, the only workaround seems to be disabling Stratum, which isn’t ideal for my setup.
Thanks in advance for your support!
P.s. the page https://wordpress.org/plugins/stratum/ says it supports “5.6 or higher” but as we can see so far it’s not completely true.
-
This topic was modified 1 year, 1 month ago by
utnalove.
-
After further investigating, it seems to related to the newest version of Stratum.
I changed in ngixn the php version to 7. And … the same problem!
[24-May-2025 21:22:24 UTC] PHP Notice: Trying to access array offset on value of type null in /var/www/example.pl/wp-content/plugins/stratum/includes/templates/table.php on line 90
[24-May-2025 21:22:25 UTC] PHP Notice: Undefined offset: 0 in /var/www/example.pl/wp-content/plugins/stratum/includes/templates/table.php on line 90I fixed it this way:
<?php
use \Elementor\Frontend;
use \Elementor\Icons_Manager;
extract(shortcode_atts(array(
'table_head_items' => array(),
'table_body_items' => array(),
'table_head_alignment_horizontal' => '',
'table_body_alignment_horizontal' => '',
), $settings));
$class = 'stratum-table';
$table_tr = [];
$table_td = [];
$frontend = new Frontend;
?>
<div class="<?php echo esc_attr($class); ?>">
<table class="<?php echo esc_attr($class . '__table'); ?>">
<thead>
<tr>
<?php foreach ($table_head_items as $table_head):
$current_text_align = $table_head['table_content_alignment'] ?? null;
$current_bg = !empty($table_head['table_head_unique_bgcolor']) ? "style='background: " . esc_attr($table_head['table_head_unique_bgcolor']) . ";'" : null;
$current_text_color = !empty($table_head['table_head_unique_text_color']) ? "style='color: " . esc_attr($table_head['table_head_unique_text_color']) . ";'" : null;
$current_icon_color = !empty($table_head['table_head_unique_icon_color']) ? "color: " . esc_attr($table_head['table_head_unique_icon_color']) . ";" : null;
$margin = $table_head['table_head_icon_margin'] ?? [];
$current_media_space = !empty($margin['top']) || !empty($margin['right']) || !empty($margin['bottom']) || !empty($margin['left']) ?
"margin: {$margin['top']}{$margin['unit']} {$margin['right']}{$margin['unit']} {$margin['bottom']}{$margin['unit']} {$margin['left']}{$margin['unit']};" : null;
$icon_style = ($current_media_space || $current_icon_color) ? sprintf('style="%s %s"', esc_attr($current_media_space), esc_attr($current_icon_color)) : null;
?>
<th colspan="<?php echo esc_attr($table_head['table_colspan_head'] ?? 1); ?>"
<?php echo $current_bg; ?>>
<div class="<?php echo esc_attr($class . '__header-cell align-content-' . ($current_text_align ?? $table_head_alignment_horizontal)); ?>">
<span class="<?php echo esc_attr($class . '__cell-title has-media-' . ($table_head['table_head_pos'] ?? 'left')); ?>"
<?php echo $current_text_color; ?>>
<?php echo esc_html__($table_head['table_head_title'] ?? ''); ?>
<?php if (($table_head['table_head_icon_type'] ?? 'none') !== 'none'): ?>
<span class="<?php echo esc_attr($class . '__cell-icon'); ?>" <?php echo $icon_style; ?>>
<?php
if ($table_head['table_head_icon_type'] === 'icon') {
$migrated = isset($table_head['__fa4_migrated']['table_head_icons']);
$is_new = empty($table_head['table_head_icon']);
if ($is_new || $migrated) {
Icons_Manager::render_icon($table_head['table_head_icons'] ?? [], ['aria-hidden' => 'true']);
} else {
echo '<i class="' . esc_attr($table_head['table_head_icon']) . '"></i>';
}
} elseif ($table_head['table_head_icon_type'] === 'image' && !empty($table_head['table_head_image']['url'])) {
$img_alt = isset($table_head['table_head_image']['id']) ? get_post_meta($table_head['table_head_image']['id'], '_wp_attachment_image_alt', true) : '';
echo '<img src="' . esc_url($table_head['table_head_image']['url']) . '" alt="' . esc_attr($img_alt) . '" style="width: ' . esc_attr($table_head['table_head_image_size'] ?? 30) . 'px" />';
}
?>
</span>
<?php endif; ?>
</span>
</div>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php
foreach ($table_body_items as $table_body):
$row_id = uniqid();
if (($table_body['table_col_select'] ?? '') === 'Row') {
$table_tr[] = ['id' => $row_id, 'type' => 'Row'];
}
if (($table_body['table_col_select'] ?? '') === 'Col') {
$last_key = array_key_last($table_tr);
if ($last_key !== null && isset($table_tr[$last_key]['id'])) {
$table_td[] = [
'row_id' => $table_tr[$last_key]['id'],
'type' => 'Col',
'title' => esc_html__($table_body['table_col_title'] ?? ''),
'content_type' => $table_body['table_col_content_type'] ?? 'default',
'table_colspan' => $table_body['table_colspan_body'] ?? 1,
'template' => $table_body['table_col_template'] ?? '',
'editor' => $table_body['table_col_editor'] ?? '',
'icon_type' => $table_body['table_col_icon_type'] ?? 'none',
'f4_comp' => isset($table_body['__fa4_migrated']['table_col_icons']),
'icon' => $table_body['table_col_icon'] ?? '',
'icons' => $table_body['table_col_icons'] ?? [],
'image' => $table_body['table_col_image'] ?? [],
'image_size' => $table_body['table_col_image_size'] ?? 30,
'icon_pos' => $table_body['table_col_pos'] ?? 'left',
'content_align' => $table_body['table_col_content_alignment'] ?? '',
'icon_color' => $table_body['table_body_unique_icon_color'] ?? '',
'media_space' => $table_body['table_col_margin'] ?? [],
'text_color' => $table_body['table_body_unique_text_color'] ?? '',
'bg_color' => $table_body['table_body_unique_bgcolor'] ?? '',
];
}
}
endforeach;
foreach ($table_tr as $tr): ?>
<tr>
<?php foreach ($table_td as $td):
if ($tr['id'] !== $td['row_id']) continue;
$body_text_align = $td['content_align'] ?: $table_body_alignment_horizontal;
$body_bg = $td['bg_color'] ? "style='background: {$td['bg_color']};'" : null;
$body_text_color = $td['text_color'] ? "style='color: " . esc_attr($td['text_color']) . ";'" : null;
$body_icon_color = $td['icon_color'] ? "color: " . esc_attr($td['icon_color']) . ";" : null;
$ms = $td['media_space'];
$body_media_space = !empty($ms['top']) || !empty($ms['right']) || !empty($ms['bottom']) || !empty($ms['left']) ?
"margin: {$ms['top']}{$ms['unit']} {$ms['right']}{$ms['unit']} {$ms['bottom']}{$ms['unit']} {$ms['left']}{$ms['unit']};" : null;
$body_icon_style = ($body_media_space || $body_icon_color) ? sprintf('style="%s %s"', esc_attr($body_media_space), esc_attr($body_icon_color)) : null;
?>
<td <?php echo $body_bg; ?> colspan="<?php echo esc_attr($td['table_colspan']); ?>">
<div class="<?php echo esc_attr($class . '__body-cell align-content-' . $body_text_align); ?>">
<?php if ($td['content_type'] === 'default'): ?>
<span class="<?php echo esc_attr($class . '__cell-title has-media-' . $td['icon_pos']); ?>"
<?php echo $body_text_color; ?>>
<?php echo wp_kses_post($td['title']); ?>
<?php if ($td['icon_type'] !== 'none'): ?>
<span class="<?php echo esc_attr($class . '__cell-icon'); ?>" <?php echo $body_icon_style; ?>>
<?php
if ($td['icon_type'] === 'icon') {
$migrated = $td['f4_comp'];
$is_new = empty($td['icon']);
if ($is_new || $migrated) {
Icons_Manager::render_icon($td['icons'], ['aria-hidden' => 'true']);
} else {
echo '<i class="' . esc_attr($td['icon']) . '"></i>';
}
} elseif ($td['icon_type'] === 'image' && !empty($td['image']['url'])) {
$img_alt = isset($td['image']['id']) ? get_post_meta($td['image']['id'], '_wp_attachment_image_alt', true) : '';
echo '<img src="' . esc_url($td['image']['url']) . '" alt="' . esc_attr($img_alt) . '" style="width: ' . esc_attr($td['image_size']) . 'px" />';
}
?>
</span>
<?php endif; ?>
</span>
<?php elseif ($td['content_type'] === 'template'):
$template_id = stratum_translate_post($td['template']);
$template_content = (get_post_status($template_id) === 'publish' || current_user_can('edit_post', $template_id)) ?
$frontend->get_builder_content_for_display($template_id, true) : '';
echo $template_content ?: '<span>' . esc_html__('Template is not found', 'stratum') . '</span>';
else: ?>
<div class="<?php echo esc_attr($class . '__editor-content'); ?>">
<?php echo $td['editor']; ?>
</div>
<?php endif; ?>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>You can compare.
It now works, however something slowed down. All the pages get saved very fast in elementor. but the page with the stratum table takes almost 1 minute. I had to increase the
max_execution_timefrom 30 second to 60 seconds.The PHP Notices are not appearing anymore.
Can you please apply an official fix?
Hello!
I’m sorry to hear that you encountered an issue with our Stratum plugin, and I apologize for the delayed response.
I have escalated your concern to our developers, and I hope they will be able to address it soon.
We will inform you as soon as we have updates on this matter.
The topic ‘500 Error When Saving Elementor Page – Stratum Plugin Warnings on PHP 8.2.28’ is closed to new replies.