Я попытался обновить мою версию PHP, которая хорошо работает с PHP 7.1.25 до 7.2 или 7.3.
Моя страница настроек потерпела крах, потеряв часть в базе данных.
Версия для Wordpress 4.9.7.
Плагины: Tilesim (приват) Elementor и Woocommrece (последняя версия 1.1.19)
Тема: ребенок 2017 года с одной страницы.
Я получаю следующее предупреждение:
``PHP Warning: Cannot modify header information - headers already sent by (output started at .../wp-content/plugins/tilesim/ts_admin.php:300) in .../wp-includes/rest-api/class-wp-rest-server.php on line 1248``
Примечание: поиск Google показывает, что обновление до 7.2 может быть проблемой
Поскольку весь код сформирован с помощью тегов input и textarea.
Есть идеи, в чем может быть проблема?
Вот код для страницы опций, которую я тестировал
``
add_action('admin_init', 'register_tilesim_plugin_settings');
function register_tilesim_plugin_settings() {
//register our settings
register_setting( 'tilesim-option-group', 'ts_manufacture_name' );
register_setting( 'tilesim-option-group', 'ts_manufacture_logo' );
register_setting( 'tilesim-option-group', 'ts_manufacture_email' );
// board settings
register_setting( 'tilesim-option-group', 'ts_online_help_pid' );
register_setting( 'tilesim-option-group', 'ts_init_board_width' );
register_setting( 'tilesim-option-group', 'ts_allowed_min_board_width' );
register_setting( 'tilesim-option-group', 'ts_allowed_max_board_width' );
register_setting( 'tilesim-option-group', 'ts_default_tile_size' ); // default tile size
register_setting( 'tilesim-option-group', 'ts_rotateLR_image' );
register_setting( 'tilesim-option-group', 'ts_rotateRL_image' );
register_setting( 'tilesim-option-group', 'ts_eraser_image' );
// report settings
register_setting( 'tilesim-option-group', 'ts_report_header_image' );
register_setting( 'tilesim-option-group', 'ts_report_footer_image' );
register_setting( 'tilesim-option-group', 'ts_report_title' );
register_setting( 'tilesim-option-group', 'ts_report_sigtext' ); // signature text
// css settings
register_setting( 'tilesim-option-group', 'ts_css' ); // css code
}
function ts_plugin_options() {
if ( !current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
ts_options_page();
}
function ts_options_page(){
$labelStyle= "width:130px;display:inline-block;";
$labelTextareaStyle= "width:130px;display:inline-block;vertical-align: top;";
$logoInStyle = "width: 597px;text-align: right;direction:ltr";
$EmailInStyle = "text-align: left;";
?>
<div class="wrap">
<h2>Tilesim Settings</h2><br />
<form action="options.php" method="post">
<?php settings_fields( 'tilesim-option-group' );?>
<?php do_settings_sections( 'tilesim' );?>
<label style="<?php echo $labelStyle; ?>">Manufacture Name:</label>
<input type="text" name="ts_manufacture_name" value="<?php echo get_option( 'ts_manufacture_name' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Manufacture Logo:</label>
<input style="<?php echo $logoInStyle ; ?>" type="text" name="ts_manufacture_logo" value="<?php echo get_option( 'ts_manufacture_logo' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Manufacture Email:</label>
<input style="<?php echo $EmailInStyle ; ?>" type="text" name="ts_manufacture_email" value="<?php echo get_option( 'ts_manufacture_email' ); ?>" /><br />
<h3 style="font-weight: 500;">Board settings</h3>
<label style="<?php echo $labelStyle; ?>">Help Post ID:</label>
<input type="text" name="ts_online_help_pid" value="<?php echo get_option( 'ts_online_help_pid' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Initial Board Width:</label>
<input type="text" name="ts_init_board_width" value="<?php echo get_option( 'ts_init_board_width' ); ?>" />
<label style="<?php echo $labelStyle; ?>">Default Tile Size:(cm)</label>
<input type="text" name="ts_default_tile_size" value="<?php echo get_option( 'ts_default_tile_size' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Min Board Width:</label>
<input type="text" name="ts_allowed_min_board_width" value="<?php echo get_option( 'ts_allowed_min_board_width' ); ?>" />
<label style="<?php echo $labelStyle; ?>">Max Board Width:</label>
<input type="text" name="ts_allowed_max_board_width" value="<?php echo get_option( 'ts_allowed_max_board_width' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Left to Right image:</label>
<input style="<?php echo $logoInStyle ; ?>" type="text" name="ts_rotateLR_image" value="<?php echo get_option( 'ts_rotateLR_image' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Right to left image:</label>
<input style="<?php echo $logoInStyle ; ?>" type="text" name="ts_rotateRL_image" value="<?php echo get_option( 'ts_rotateRL_image' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Eraser image:</label>
<input style="<?php echo $logoInStyle ; ?>" type="text" name="ts_eraser_image" value="<?php echo get_option( 'ts_eraser_image' ); ?>" /><br />
<h3 style="font-weight: 500;">Report settings</h3>
<label style="<?php echo $labelStyle; ?>">Header Image:</label>
<input style="<?php echo $logoInStyle ; ?>" type="text" name="ts_report_header_image"
value="<?php echo get_option( 'ts_report_header_image' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Footer Image:</label>
<input style="<?php echo $logoInStyle ; ?>" type="text" name="ts_report_footer_image"
value="<?php echo get_option( 'ts_report_footer_image' ); ?>" /><br />
<label style="<?php echo $labelStyle; ?>">Report Title:</label>
<input style="<?php echo $logoInStyle ; ?>" type="text" name="ts_report_title" value="<?php echo get_option( 'ts_report_title' ); ?>" /><br />
<label style="<?php echo $labelTextareaStyle; ?>">Report Signature:</label>
<textarea style="direction:rtl;text-align:right" type="textarea" name="ts_report_sigtext" cols="81" rows="4"><?php echo esc_html(trim(get_option( 'ts_report_sigtext' ))); ?></textarea>
<h3 style="font-weight: 500;">Css settings</h3>
<p>Note: No css validation is provided. CSS loads last. Harmful code removed.</p>
<label style="<?php echo $labelTextareaStyle; ?>">CSS code:</label>
<textarea style="direction:ltr;text-align:left" type="textarea" name="ts_css" cols="81" rows="8"><?php echo esc_html(trim(get_option( 'ts_css' ))); ?></textarea>
<?php submit_button();?>
</form>
</div>
<?php
}
?>
`