• Wordpress updated to 4.9.8.
    Plugin updated to 4.0.

    Now I get this notice on every page : “Notice: register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in D:\Websites\iriscaretest\wp-includes\functions.php on line 4161”.

    If I comment the line 90 in mw-polylang-theme-strings.php this notice desapears.

    I notice that the register_uninstall_hook is modified with the last version.
    Old version = register_uninstall_hook($this->Path_Get(‘plugin_file_index’), array(__CLASS__, ‘Uninstall’));
    New version = register_uninstall_hook($this->Path_Get(‘plugin_file_index’), array($this, ‘Uninstall’));

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same problem here

    WordPress updated to 4.9.8.
    Plugin updated to 4.0.

    Hello,
    I have same problem with polylang theme strings v4 on wp 4.9.8.
    I replace the code with :
    register_uninstall_hook($this->Path_Get(‘plugin_file_index’), array(__CLASS__, ‘Uninstall’));
    this work but i have an other problem, when i enter into /wp-admin/admin.php?page=mlang_strings, i have this error :
    Undefined index: plugins-strings-count
    window.<?php echo self::$prefix; ?>admin.lng[36] = '<?php echo $this->var['plugins-strings-count']; ?>';

    Thanks for your reply

    Same error here. I used wp-rollback to rollback to 3.5. When debug s enabled this error causes a error 500 due to headers already sent. Should have not slipped through QA…

    I’ve managed to fix it. You just need to replace 2 lines of code ??
    I did PR at github, but I don’t know whether this repo is still active:
    https://github.com/wp-plugins/polylang-theme-strings/pull/1/files

    If you want to fix it manually, you just need to go to
    `/wp-content/plugins/polylang-theme-strings/mw-polylang-theme-strings.php’, and change line 89 and 90 from:
    register_activation_hook($this->Path_Get('plugin_file_index'), array($this, 'Install'));
    register_uninstall_hook($this->Path_Get('plugin_file_index'), array($this, 'Uninstall'));
    to:
    register_activation_hook($this->Path_Get('plugin_file_index'), 'Install');
    register_uninstall_hook($this->Path_Get('plugin_file_index'), 'Uninstall');

    BTW do you know how I can propose this changes to the author in more dev way? ??

    I have it too. Following.

    Same error.

    I tried to borrow others things, but almost sure that the issue comme from here.

    Notice: register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /Applications/MAMP/htdocs/anodine/wordpress/wp-includes/functions.php on line 4161

    Changing

    register_activation_hook($this->Path_Get('plugin_file_index'), array($this, 'Install'));
    register_uninstall_hook($this->Path_Get('plugin_file_index'), array($this, 'Uninstall'));

    to:

    register_activation_hook($this->Path_Get('plugin_file_index'), 'Install');
    register_uninstall_hook($this->Path_Get('plugin_file_index'), 'Uninstall');

    generate an other issue – PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘Install’ not found or invalid function name.

    And that normal cause this function exists only on $this object.

    BUT if i Change $this for __class__ as said rajolalaina upper, but for two lines, it works in local but not on server.

    Bye!

    • This reply was modified 6 years, 1 month ago by an?dine.
    • This reply was modified 6 years, 1 month ago by an?dine.
    • This reply was modified 6 years, 1 month ago by an?dine.
    • This reply was modified 6 years, 1 month ago by an?dine.
    • This reply was modified 6 years, 1 month ago by an?dine.
    quangpro1610

    (@quangpro1610)

    I have it too. How to fix?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘register_uninstall_hook was called incorrectly’ is closed to new replies.