Конфликт темы с пла...
 
Notifications
Clear all

wpForo 1.x.x [Closed] Конфликт темы с плагином

9 Posts
4 Users
1 Likes
3,562 Views
Posts: 6
Topic starter
(@jeka3000klx)
Active Member
Joined: 5 years ago

Здравствуйте. Начал пользоваться плагином wpForo, очень понравился в работе. Хотел было уже приобретать дополнительные функции к нему, как он начал конфликтовать с темой сайта. Два дня работал нормально, а сейчас возникает следующая ошибка, которая отображается в шапке и подвале сайта:

Warning: session_start(): open(/var/www/u0505985/data/bin-tmp//sess_avm0vr7ko6sbipnfs69u1g21b2, O_RDWR) failed: No such file or directory (2) in /var/www/u0505985/data/www/sprosiservis.ru/wp-content/plugins/wpforo/wpf-includes/class-notices.php on line 16

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/u0505985/data/www/sprosiservis.ru/wp-content/plugins/wpforo/wpf-includes/class-notices.php:16) in /var/www/u0505985/data/www/sprosiservis.ru/wp-content/plugins/wpforo/wpf-includes/class-notices.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at /var/www/u0505985/data/www/sprosiservis.ru/wp-content/plugins/wpforo/wpf-includes/class-notices.php:16) in /var/www/u0505985/data/www/sprosiservis.ru/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1197

Warning: Unknown: open(/var/www/u0505985/data/bin-tmp//sess_avm0vr7ko6sbipnfs69u1g21b2, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/u0505985/data/bin-tmp/) in Unknown on line 0

Откат сайта до момента использования плагина не помогает, все равно при установке возникает ошибка. Хотелось бы у вас попросить совета, возможно ли эту проблему устранить своими силами, если да, то какие действия необходимо сделать? Спасибо.

8 Replies
1 Reply
(@jeka3000klx)
Joined: 5 years ago

Active Member
Posts: 6

Проблема решилась сама собой. Необходимо было почистить куки в браузерах.

Sofy
Posts: 4310
 Sofy
Admin
(@sofy)
Support Team
Joined: 6 years ago

Hi JEKA3000klx,

Thank you for letting us know. 

1 Reply
(@jeka3000klx)
Joined: 5 years ago

Active Member
Posts: 6

Здравствуйте. Проблема так и не разрешилась. В теме сайта  https://sprosiservis.ru до сих пор отображаются эти ошибки. Откат сайта и дальнейшая установка плагина никчему не приводит. Даже если восстановлю сайт и базу данных за месяц до того, как устанавливал этот плагин, приводит к этим ошибкам. Могли бы вы что то посоветовать? Очень хочется установить ваш форум. Спасибо.

Posts: 6
Topic starter
(@jeka3000klx)
Active Member
Joined: 5 years ago

Ссылает от на эту строку - if( !wpforo_is_session_started() && !is_admin() ) session_start();

/**
* @return void
*/
private function init(){
if( !wpforo_is_session_started() && !is_admin() ) session_start();
}

Robert
Posts: 10503
Admin
(@robert)
Support Team
Joined: 8 years ago

Hi @jeka3000klx

This error doesn't have direct relation to wpForo. You'll see errors from all your plugins which have a session function, but this doesn't mean all those plugins have problems. there is another problem which outputs some data in header and affects all other plugins session function. The one of affected plugin is wpForo and the wp-super-cache plugin. You may have other errors if you don't find the real problem maker.

1. Deactivate all plugins, only leave the wpForo. If you see the error is not fixed then this is a theme issue. somewhere in theme files you have error generation or line-breaks in the current active WordPress theme functions.php file after ?> PHP closer.

2. If you don't see any error, start activate back all plugins one by one and check. This will help find the real problem maker.

1 Reply
(@jeka3000klx)
Joined: 5 years ago

Active Member
Posts: 6

Плагины все отключал. Ошибка остается. На счет лишнего пробела не знаю, даже если он и есть, я не смогу определить где он.

<?php

add_action('wp_enqueue_scripts', 'sprosiservis_css');
function sprosiservis_css () {
wp_enqueue_style('style', get_template_directory_uri() . '/css/style.css', array(), '1.0.0');
wp_enqueue_style('page-doc', get_template_directory_uri() . '/css/page-doc.css', array(), '1.0.0');
wp_enqueue_style('single', get_template_directory_uri() . '/css/single.css', array(), '1.0.0');
wp_enqueue_style('google-fonts', '//fonts.googleapis.com/css?family=PT+Serif:400,400i,700|Ubuntu:300', array(), '1.0.0');
}

add_action('admin_head', 'custom_styles');
function custom_styles() { echo '<style type="text/css">#menu-posts,#menu-comments,#toplevel_page_cptui_main_menu,#toplevel_page_edit-post_type-acf,#toplevel_page_acf-options{display:none !important}</style>'; }

add_image_size('consultations', 90, 90, false);
add_image_size('services', 243, 243, true);
add_image_size('news', 248, 150, true);
add_image_size('maintop', 534, 300, false);
add_image_size('main', 329, 400, false);
add_image_size('dost', 125, 88, false);
add_image_size('avatar', 97, 97, true);

add_theme_support('menus');
register_nav_menus(array(
'main-menu' => 'Главное меню',
'bottom-menu' => 'Нижнее меню'
));

remove_action( 'add_option_new_admin_email', 'update_option_new_admin_email' );
remove_action( 'update_option_new_admin_email', 'update_option_new_admin_email' );

function wpdocs_update_option_new_admin_email( $old_value, $value ) {
update_option( 'admin_email', $value );
}

include("js/acf-options-page/acf-options-page.php");

add_action( 'add_option_new_admin_email', 'wpdocs_update_option_new_admin_email', 10, 2 );
add_action( 'update_option_new_admin_email', 'wpdocs_update_option_new_admin_email', 10, 2 );

function cut_string($string, $length = 95){
if ($length && strlen($string) > $length){
$str = strip_tags($string);
$str = substr($str, 0, $length);
$pos = strrpos($str, ' ');
return (substr($str, 0, $pos)).'…';
}
return $string;
}

include("js/acf-repeater/acf-repeater.php");

class multipartmail{
var $header;
var $parts;
var $message;
var $subject;
var $to_address;
var $boundary;
function multipartmail($dest, $src, $sub){
$this->to_address = $dest;
$this->subject = $sub;
$this->parts = array("");
$this->boundary = "--" . md5(uniqid(time()));
$this->header = "From: $src\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: multipart/mixed; " .
" boundary=\"" . $this->boundary . "\"\r\n" .
"X-Mailer: PHP/" . phpversion();
}
function addmessage($msg = "", $ctype = "text/plain"){
$this->parts[0] = "Content-Type: $ctype; charset=UTF-8\r\n" .
"Content-Transfer-Encoding: 7bit\r\n" .
"\n" .$msg."\r\n";
}
function addattachment($file, $ctype){
$fname = substr(strrchr($file, "\\"), 1);
$data = file_get_contents($file);
$i = count($this->parts);
$content_id = "part$i." . sprintf("%09d", crc32($fname)) . strrchr($this->to_address, "@");
$this->parts[$i] = "Content-Type: $ctype; name=\"$fname\"\r\n" .
"Content-Transfer-Encoding: base64\r\n" .
"Content-ID: <$content_id>\r\n" .
"Content-Disposition: attachment; " .
" filename=\"$fname\"\r\n" .
"\n" .
chunk_split( base64_encode($data), 68, "\n");
return $content_id;
}
function buildmessage(){
$this->message = "This is a multipart message in mime format.\n";
$cnt = count($this->parts);
for($i=0; $i<$cnt; $i++){
$this->message .= "--" . $this->boundary . "\n" .
$this->parts[$i];
}
}
function getmessage(){
$this->buildmessage();
return $this->message;
}
function sendmail(){
$this->buildmessage();
mail($this->to_address, $this->subject, $this->message, $this->header);
}
}

if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array('page_title' => __("Дополнительно"),'menu_title' => __("Дополнительно"),'menu_slug' => 'params','post_id' => 'params','update_button' => 'Обновить','updated_message' => 'Обновлено'));
}

add_action( 'show_user_profile', 'add_extra_social_links' );
add_action( 'edit_user_profile', 'add_extra_social_links' );

function add_extra_social_links($user) { ?>
<h3>Дополнительные данные</h3>
<table class="form-table">
<tr>
<th><label for="user_patronymic">Отчество</label></th>
<td><input type="text" name="user_patronymic" value="<?php echo esc_attr(get_the_author_meta( 'user_patronymic', $user->ID )); ?>" class="regular-text" /></td>
</tr>
<tr>
<th><label for="user_sex">Пол</label></th>
<td><select name="user_sex" class="regular-text">
<option value="" disabled<?php if(esc_attr(get_the_author_meta( 'user_sex', $user->ID ))=="") { echo ' selected'; } ?>>Ваш пол</option>
<option value="m"<?php if(esc_attr(get_the_author_meta( 'user_sex', $user->ID ))=="m") { echo ' selected'; } ?>>Мужской</option>
<option value="w"<?php if(esc_attr(get_the_author_meta( 'user_sex', $user->ID ))=="w") { echo ' selected'; } ?>>Женский</option>
</select></td>
</tr>
<tr>
<th><label for="user_birthday">День рождения</label></th>
<td><input type="text" name="user_birthday" value="<?php echo esc_attr(get_the_author_meta( 'user_birthday', $user->ID )); ?>" class="regular-text" /></td>
</tr>
<tr>
<th><label for="user_city">Ваш город</label></th>
<td><input type="text" name="user_city" value="<?php echo esc_attr(get_the_author_meta( 'user_city', $user->ID )); ?>" class="regular-text" /></td>
</tr>
<tr>
<th><label for="user_phone">Ваш телефон</label></th>
<td><input type="text" name="user_phone" value="<?php echo esc_attr(get_the_author_meta( 'user_phone', $user->ID )); ?>" class="regular-text" /></td>
</tr>
</table>
<?php }

add_action( 'personal_options_update', 'save_extra_social_links' );
add_action( 'edit_user_profile_update', 'save_extra_social_links' );

function save_extra_social_links( $user_id )
{
update_user_meta( $user_id,'user_patronymic', sanitize_text_field( $_POST['user_patronymic'] ) );
update_user_meta( $user_id,'user_sex', sanitize_text_field( $_POST['user_sex'] ) );
update_user_meta( $user_id,'user_birthday', sanitize_text_field( $_POST['user_birthday'] ) );
update_user_meta( $user_id,'user_city', sanitize_text_field( $_POST['user_city'] ) );
update_user_meta( $user_id,'user_phone', sanitize_text_field( $_POST['user_phone'] ) );
}

function post_published_notification( $ID, $post ) {
$blogusers = get_users();
foreach ($blogusers as $user) { if (get_the_author_meta( 'subscribe', $user->ID ) != "no") {
$mulmail = new multipartmail($user->user_email, "feedback@sprosiservis.pdnx.ru", "Новости сайта ".get_bloginfo("name"));
$mulmail->addmessage("Новое на сайте\nНазвание: ".get_the_title($ID)."\nСсылка: ".get_permalink($ID));
$mulmail->sendmail();
unset($mulmail);
} }
}
add_action( 'publish_consultations', 'post_published_notification', 10, 2 );
add_action( 'publish_news', 'post_published_notification', 10, 2 );

add_filter( 'deprecated_function_trigger_error', '__return_false' );
Posts: 1602
(@anonymous20)
Noble Member
Joined: 8 years ago

Or just the hosting tmp path is wrong/not permited, because sessions are stored in there ?

 

Page 1 / 2