@Suleimanov_Ismar

Почему не грузится библиотека медиафайлов, не загружается фото в пост?

Здравствуйте,

Суть проблемы:
Поднял сайт из почти годовалого бэкапа загружаю а там каша, куча ошибок просто пипец. Исправил все кроме последнего, фотографии не загружаются и не цепляются на новые посты. Определил место ошибки это из за темы, но что именно не понятно.

Прошу помощи, пожалуйста подскажите в чем может быть проблема?

Вот что выводит wp_debug в админке:
Notice: The called constructor method for WP_Widget in SuperNews_Ads_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Ads125_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Feedburner_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Recent_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Popular_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Random_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Video_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Tabs_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Counter_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Ads_Builder is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Slider_Builder is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Headlines_Builder is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Posts_Varian1_Builder is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Posts_Varian2_Builder is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Posts_Varian3_Builder is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: The called constructor method for WP_Widget in SuperNews_Posts_Varian4_Builder is deprecated since version 4.3.0! Use
__construct()
instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3903

Notice: add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3840

Notice: get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead. in /home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php on line 3840


Вот что выводит wp_debug на фронте:
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Ads_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Ads125_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Feedburner_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Recent_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Popular_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Random_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Video_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Tabs_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Counter_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Ads_Builder is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Slider_Builder is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Headlines_Builder is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Posts_Varian1_Builder is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Posts_Varian2_Builder is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Posts_Varian3_Builder is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Notice</b>:  The called constructor method for WP_Widget in SuperNews_Posts_Varian4_Builder is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/functions.php</b> on line <b>3903</b><br />
<br />
<b>Warning</b>:  Parameter 2 to qtranxf_excludeUntranslatedPosts() expected to be a reference, value given in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/class-wp-hook.php</b> on line <b>286</b><br />
<br />
<b>Warning</b>:  Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/class-wp-hook.php</b> on line <b>286</b><br />
<br />
<b>Warning</b>:  Parameter 2 to qtranxf_excludeUntranslatedPosts() expected to be a reference, value given in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/class-wp-hook.php</b> on line <b>286</b><br />
<br />
<b>Warning</b>:  Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in <b>/home/users/ismarsuleimanov_wp3/site/wp-includes/class-wp-hook.php</b> on line <b>286</b>
  • Вопрос задан
  • 320 просмотров
Решения вопроса 2
HeadOnFire
@HeadOnFire
PHP, Laravel & WordPress Evangelist
Копируем суть ошибки, вставляем в поисковую строку браузера и получаем ответ: https://www.google.com.ua/search?q=the+called+cons...

По сути - у вас PHP 7, который больше не поддерживает старые конструкторы классов. И вместе с этим, у вас виджеты в теме используют старые конструкторы. Переименуйте все древние конструкторы (а они прям очень древние) и ошибка уйдет. Где переименовывать надеюсь поймете - в каждой ошибке указан путь к нужному файлу и даже номер строки.

Это не проблема WordPress вообще, кстати. У вас древний PHP-код, а сам PHP - свежий.
Ответ написан
Комментировать
@Suleimanov_Ismar Автор вопроса
Ошибка исправлена.

Решение: Сама тема устарела и обновлений не было а wordpress обновленный, последняя версия, пришлось полностью заменять все старые вызовы типа: $this->WC_Widget на parent::__construct и много едругое. Так же в некоторых плагинах наблюдались такие же проблемы. В папке wp-include были найдены какие то левые файлы не относящиеся к wordpress.

Все удалил, изменил, заменил и все заработало.

Всем спасибо за помощь!
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
aleksand44
@aleksand44
Несоответствие версий видимо.
"Deprecated "- значит устаревший, либо обновляйте тему, либо откатывайте версию вордпресс.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы