• Hi there, we use your plugin on a variety of sites. I have noticed this error message in version 4.0

    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 /var/www/html/wp/wp-includes/functions.php on line 4161

Viewing 3 replies - 1 through 3 (of 3 total)
  • justinblayney

    (@justinblayney)

    Hello,

    I get this error as well, it my new sever with php 7.2… php 5.6 seems to work fine

    WP Apps

    (@wp-apps)

    Method Plugin_Install_Hooks_Init in file mw-polylang-theme-strings.php should be rewritten. An invalid approach is used! According to WP documentation the callback to run when the hook is called, must be a static method or function.

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

    but it should be something like this:

    register_uninstall_hook( __FILE__, 'MW_Polylang_Theme_Strings::Uninstall');

    Method Plugin_Install_Hooks_Init shall be rewritten to load other required recourses.

    
            private function Plugin_Install_Hooks_Init(){
                register_activation_hook($this->Path_Get('plugin_file_index'), array($this, 'Install'));
                register_uninstall_hook($this->Path_Get('plugin_file_index'), array($this, 'Uninstall'));
                add_action('upgrader_process_complete', array($this, 'Plugin_Upgrade'), 10, 2);
            }

    While the master code is being updated, I commented the line that @wp-apps said BEFORE installing the add-on. Of course, you may have some problems when trying to uninstall.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin error message in Version 4.0 register uninstall hook’ is closed to new replies.