• Hi

    I need some advice, as I get an error when activating your free plugin. I have used your plugin many times before with no error but last 2 client sites I added your plugin I got this.

    I presume your Free Plugin is compatible with 5.1.1. WordPress version ?

    Site is still viewable as it is in development mode, but when activating the plugin get this Fatal error within the Admin Plugin area. No idea why that is the case. It is ONLY your plugin saying Fatal error. Is it trying to call the Pro WP Touch plugin for some reason ?

    Any help would be greatly appreciated as I like this little plugin.

    Fatal error: Uncaught Error: Call to undefined method stdClass::save() in /home/des/public_html/domain.com.au/wp-content/plugins/wptouch/core/class-wptouch-pro.php:220 Stack trace: #0 /home/des/public_html/domain.com.au/wp-content/plugins/wptouch/wptouch.php(49): WPtouchProFour->initialize() #/home/des/public_html/domain.com.au/wp-content/plugins/wptouch/wptouch.php(77): wptouch_create_four_object() #2 /home/des/public_html/domain.com.au/wp-includes/class-wp-hook.php(286): wptouch_handle_activation(”) #3 /home/des/public_html/domain.com.au/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array) #4 /home/des/public_html/domain.com.au/wp-includes/plugin.php(465): WP_Hook->do_action(Array) #5 //home/des/public_html/domain.com.au/wp-admin/plugins.php(177): do_action(‘activate_wptouc…’) #6 {main} thrown in /home/des/public_html/domain.com.au/wp-content/plugins/wptouch/core/class-wptouch-pro.php on line 220

Viewing 5 replies - 1 through 5 (of 5 total)
  • Can you view the database? For example do you have PHPMyAdmin in cPanel? Go to the table wp_options and Search:
    option_value LIKE wpt%

    In my case I had wpts_foundation with value O:8:"stdClass":...
    The objects should have classes. So it should be like

    wpts_bauhaus O:15:"WPtouchSettings":...
    wpts_bncid O:29:"WPtouchDefaultSettingsBNCID30":...
    wpts_foundation O:15:"WPtouchSettings":...
    wpts_wptouch_pro O:24:"WPtouchDefaultSettings30":...

    The details vary, but there should be no “stdClass” objects, only “WPtouch…”.

    If it’s a fresh install just delete the bad ones and try again. Maybe you had some old settings from previous work. Or it could be a bug or rogue filter in another plugin? The settings code in WP Touch is pretty complex. Seems to be recursive. Runs on filters and actions.

    Maybe deleting the plugin in Dashboard would clear old settings.

    In my case I had done an unfortunate search-and-replace to cause the problem in PHP, so I had to convert the stdClass to WPtouchSettings to save my settings. Exercise left to the reader.

    Ideally in its code WP Touch would catch bad objects the same way it catches arrays and other invalid settings pulled from the db.

    • This reply was modified 5 years, 11 months ago by kitchin.
    • This reply was modified 5 years, 11 months ago by kitchin.
    Thread Starter kristinubute

    (@kristinubute)

    Thanks for your reply. Yes I had also tried to uninstall the plugin totally and reinstall it also but same thing. Then tried an older version of the plugin also.

    I am trying process of elimination at moment. Its frustrating as I have never had this issue before.

    I will look into your notes.

    Thanks
    Kristin

    Thread Starter kristinubute

    (@kristinubute)

    Hi (@kitchin)

    THanks very much for your help and response.

    So do you think the plugin is clashing with something ?

    I tried reinstalling different versions of WP Touch free but still the error.

    I re-uploaded WordPress files again thinking that may fix it but didn’t.

    I am not that familiar with the SQL database section so not fully understanding your instructions you suggested. I know how to get into that section

    Very appreciated that you offered some help.

    So as you mentioned “there should be no “stdClass” objects, only “WPtouch…”.
    So I am not exactly sure how to fix that. Is it a database error with WP Touch plugin do you think ?
    What could have caused this ?
    Maybe a conflict with WordPress 5.1.1 ?
    Could it be a clash with Sydney theme ?

    Thanks
    Kristin

    CORRECTION to my post above. (The search is option_name rather than option_value).

    Deactivate and uninstall the plugin. Reinstall and see if it’s fixed. If not:

    Deactivate and uninstall the plugin. Use PHPMyAdmin from cPanel in your web hosting account. If you have just one database, and after clicking it, if you see the table wp_options, then it’s easy to remove the remnants of the plugin so you can reinstall it clean. Do this:

    1. Click wp_options in PHPMyAdmin.
    2. Click Search.
    3. Next to option_name LIKE, enter “wpt%”, without the quotes.
    4. Click Go.
    5. If they all look like “wptouch_…” or “wpts_…” then click “Check all” and Delete.
    6. Reinstall the plugin.

    I wonder if a poorly designed backup or maintenance plugin altered the database, or if it is a WPTouch bug.

    In any case, WPTouch fix this by checking the object class before accessing it. That would prevent the fatal error.

    • This reply was modified 5 years, 7 months ago by kitchin.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error when activating this plugin for WordPress 5.1.1’ is closed to new replies.