WordPress.org

Forums

WordPress MU Domain Mapping
Domain mapping tables not created (12 posts)

  1. Jason Judge
    Member
    Posted 4 years ago #

    I am finding this plugin is not creating the mapping tables in my installation. It appears to install okay, and the Settings->Domain Mapping setup page saves without any errors reported - but there are no tables created.

    Without those tables, attempting to create a new domain in the Settings->Domain screen simply throws you back to the blank form, again, with no errors or warnings generated (not even in the Apache log).

  2. Jason Judge
    Member
    Posted 4 years ago #

    In addition, the check for the sunrise script looks in this folder:

    WP_CONTENT_DIR . '/sunrise.php'

    If the sunrise script is not there, it tells you to put it in this folder:

    wp-content/sunrise.php

    That is misleading, as WP_CONTENT_DIR may be custom and so will not be "wp-content".

  3. Jason Judge
    Member
    Posted 4 years ago #

    I would also add, looking through the code of this module, that the function names used are not consistently prefixed, and are just asking for name collisions with other modules.

  4. Jason Judge
    Member
    Posted 4 years ago #

    A fix for the lack of tables:

    The tables are created in the function dm_add_pages(), which does not get called in the WP3.1 network "superuser" administration pages. Instead the dm_network_pages() function is called to add the domain mapping menu items.

    My fix is to add the following line of code to the dm_network_pages() function:

    maybe_create_db();

    That then creates the tables as soon as the administrator displays the network admin pages, which is where they would have installed the plugin anyway.

    However - this does create a wasteful database check every time the admin page is displayed. It would be better to perform the check once in the Settings->Domain Mapping page.

  5. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 4 years ago #

  6. Jason Judge
    Member
    Posted 4 years ago #

    Sorry - not sure if you have logged/changed this and I just can't see it, or you are hinting that I should be directing any bugs there :-)

  7. Jason Judge
    Member
    Posted 4 years ago #

    AH, I didn't spot the change.

    The comment about the functions include stuff like these:

    get_original_url
    remote_login_js
    get_dm_hash
    delete_blog_domain_mapping
    dm_site_admin
    maybe_create_db
    domain_mapping_warning

    Since functions are global, they should really all have a common prefix to avoid clashes with other modules. It is just to avoid any surprises when people install and use various plugins.

  8. Jason Judge
    Member
    Posted 4 years ago #

    In the future, I'm sure these functions will be wrapped up in a class for the plugin, and then they can be called whatever you like, but until WP catches up with a proper OO approach, we have to be a lot more careful when naming functions with global scope.

    I have already had clashes between identically-named functions introduced by themes and plugins, and it is not fun to debug.

  9. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 4 years ago #

    he comment about the functions include stuff like these:

    get_original_url
    remote_login_js
    get_dm_hash
    delete_blog_domain_mapping
    dm_site_admin
    maybe_create_db
    domain_mapping_warning

    Since functions are global, they should really all have a common prefix to avoid clashes with other modules. It is just to avoid any surprises when people install and use various plugins.

    If it's really important to you to have this on a Sunday morning, perhaps you could provide a tested patch.

  10. Jason Judge
    Member
    Posted 4 years ago #

    Ah no, it's not important for me, right now (Sunday Evening here). I'm mentioning this because this seems a rather important plugin in its area of functionality. Someone *could* accidentally break all their sites - which could run into hundreds or thousands - just by installing another plugin that happened to have the function get_original_url().

    My stuff is all working at the moment, so I don't have an itch to scratch; but just making you aware of what may lie down the road.

  11. Anna
    Member
    Posted 4 years ago #

    Hi, I've got this problem right now on my installation.

    Where can I find the dm_network_pages() function so that I may add the line maybe_create_db(); (what file and directory)?

  12. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 4 years ago #

    Download the development version. That's been fixed in it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress MU Domain Mapping
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic