Class ‘PLL_Links_’ not found in /wp-content/plugins/polylang/include/model.php on line 915

After migration website on wordpress to another server and another domain.
I have website root in the same directory. I heard that there is some config in database of this plugin POLYLANG but have no idea where.
I have an error like:

Class ‘PLL_Links_’ not found in /wp-content/plugins/polylang/include/model.php on line 915

Read More

someone has an idea how to fix this problem ?

Related posts

4 comments

  1. I had the same error, prior to the error was an “Undefined index” notice.
    It was caused by an empty $this->options['force_lang'] var.

    This var is loaded from the wp_options table, the option_name within this table is polylang. There should be a JSON encoded array of polylang options.

    In my case the issue could be fixed by removing the domains from the JSON data, so it reads something like:

    "domains";a:0:{}
    
  2. I got here because Polylang 2.3.1 was throwing a similar error after a database migration:

    Class 'PLL_Links_' not found in /wp-content/plugins/polylang/include/model.php on line 560
    

    If you look at the code in the model.php file referenced in the error, you can see that the plugin tries to retrieve a class name using the ‘permalink_structure’ option set in the database. If the migration changes this option to something Polylang can’t handle, it triggers the error.

    To go around the fatal error, you either have to:

    • (re)move or rename the Polylang plugin folder, so that it does not trigger the error
    • Set the Permalinks setting to default in WordPress Admin via Options > Permalinks
    • reinstall Polylang (or remove/rename it) and reactivate it in the Plugins overview.

    or

    • manually delete the value for ‘permalink_structure’ in the wp_options table.

    WordPress should run normally after this. I have not yet found out why it cannot handle certain permalink settings, but if I do, I’ll update this answer.

  3. I did a global domain replacement in the file when moving the database from local to live . The problem in the end was that the serialized array in wp_option.option_name = “polylang” is broken. You must change strings length in the domain array:

    wp_option.option_name = ...."domains";a:1: 
    {s:2:"en";s:21:"http://example.local/";}....
    

    on a local:

    s:21:"http://example.local/";
    

    after replacing in file:

    s:21:"http://example.com/";
    

    must be:

    s:19:"http://example.com/";
    

Comments are closed.