• Resolved lepkov

    (@lepkov)


    PHP Fatal error: Uncaught TypeError: unserialize(): Argument #1 ($data) must be of type string, array given in /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/class-y4ym-settings-page-tags-wp-list-table.php:180
    3 Stack trace:
    4 #0 /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/class-y4ym-settings-page-tags-wp-list-table.php(180): unserialize()
    5 #1 /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/class-y4ym-settings-page-tags-wp-list-table.php(119): Y4YM_Settings_Page_Tags_WP_List_Table->get view_html_field_select() 6 #2 /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/class-y4ym-settings-page-tags-wp-list-table.php(321): Y4YM_Settings_Page_Tags_WP_List_Table->tab le_data() 7 #3 /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/views/html-admin-settings-page-tab-tags.php(14): Y4YM_Settings_Page_Tags_WP_List_Table->prepare items()
    8 #4 /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/views/html-admin-settings-page.php(50): include_once(‘…’)
    9 #5 /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/class-y4ym-settings-page.php(323): include_once(‘…’)
    10 #6 /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/class-y4ym-settings-page.php(80): Y4YM_Settings_Page->print_view_html_form()
    11 #7 /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/class-yml-for-yandex-market.php(359): Y4YM_Settings_Page->__construct()
    12 #8 /var/www/vhosts/localhost/html/wp-includes/class-wp-hook.php(324): YmlforYandexMarket->get_plugin_settings_page()
    13 #9 /var/www/vhosts/localhost/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    14 #10 /var/www/vhosts/localhost
    15 2023-11-20 14:37:27.557335 [NOTICE] [42] [172.25.192.1:63951#localhost] [STDERR] /html/wp-includes/plugin.php(517): WP_Hook->do_action()
    16 #11 /var/www/vhosts/localhost/html/wp-admin/admin.php(259): do_action()
    17 #12 {main}
    18 thrown in /var/www/vhosts/localhost/html/wp-content/plugins/yml-for-yandex-market/classes/system/pages/settings-page/class-y4ym-settings-page-tags-wp-list-table.php on line 180

    It only occurs if I use a persistent object cache (or more specifically, I am using Docket Cache. Apparently, the values of the options as stored in the cache get unserialized while still being linked/referenced to the cache or are stored before being serialized or something.

    Plugin – https://ru.www.ads-software.com/plugins/yml-for-yandex-market/

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Nawawi Jamili

    (@nawawijamili)

    Hi,

    This happens because the Docket Cache has already unserialized the data. The plugin needs to replace the use of “unserialize” with the WordPress function “maybe_unserialize“.

    At line 180 on file classes/system/pages/settings-page/class-y4ym-settings-page-tags-wp-list-table.php

    $value?=?unserialize(?yfym_optionGET(?$data_arr['opt_name'],?$this->get_feed_id()?)?);

    Thanks.

    Thread Starter lepkov

    (@lepkov)

    Thank you for a quick reply, @nawawijamili

    Could you suggest a quick solution for Docket Cache to skip caching that plugin?

    I will try to replace the code by myself, but skipping that plugin may work better.

    Plugin Author Nawawi Jamili

    (@nawawijamili)

    Hi,

    Docket cache is an object cache plugin, to skip the plugin from being cached it is not possible, we only can skip by object key.

    BTW, you may download the fix for that plugin here https://docketcache.com/devtest/yml-for-yandex-market-unserialize-fix.zip

    Hope this will help.

    Thanks.

    Thread Starter lepkov

    (@lepkov)

    That worked out perfectly!

    Thank you @nawawijamili, you are awesome ??

    wabetainfo

    (@wabetainfo)

    Hi @nawawijamili

    I experience the same issue with the mobile menu plugin. Unfortunately, when attempting to replace “unserialize” with “maybe_unserialize”, I get this error:
    Call to undefined function maybe_unserialize().

    Plugin Author Nawawi Jamili

    (@nawawijamili)

    Hello @wabetainfo,

    maybe_unserialize is a standard WP function, if can call the get_option function, it should be no issue to use the maybe_unserialize function.

    Btw, you may try to replace

    $admin_options = unserialize( $current_options );

    with

    $admin_options = is_serialized($current_options) ? unserialize( $current_options ) : $current_options;

    in file mobmenu.php at line 260.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP Fatal error: Uncaught TypeError: unserialize()’ is closed to new replies.