Git Product home page Git Product logo

wp-multi-network's People

Contributors

andreasnrb avatar bueltge avatar carstingaxion avatar cfoellmann avatar felixarntz avatar giuseppebonanno avatar inderpreet99 avatar jamiesmachon avatar jjj avatar joshbetz avatar jpry avatar kraftbj avatar lacimarsik avatar ntwb avatar ouun avatar pbiron avatar peterdavehello avatar phatsk avatar richardtape avatar rmccue avatar spacedmonkey avatar tcrsavage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-multi-network's Issues

Make networks table responsive

At some point, the Networks list-table became broken in a mobile responsive view. I know this, because I just tried using it on my iPhone, and it's very terrible.

Pass arguments to the action `add_network`

The action hook add_network only receives the new network ID as argument. It would be helpful to have it get passed the arguments that were used to create it as well. This way a callback function can easily detect things like which user created the network or similar.

*_network_option() functions to mirror *_blog_option() functions in core

This will require #1 to be fixed first.

We should have the following CRUD functions for site options:

  • get_network_option( $network_id, $key, $default = false )
  • add_network_option( $network_id, $key, $value )
  • update_network_option( $network_id, $key, $value )
  • delete_network_option( $network_id, $key, $value )

Allow short-circuit of `user_has_networks()` function

It would be useful to allow short-circuit of the user_has_networks() function, for example through an additional filter.

I regularly specify my super admins (global vs per network) through the WordPress $super_admins variable (I configure the entire network through custom constants in wp-config.php, and I'd like these constants to determine who is super admin in a network and who isn't). Of course I could use the existing networks_user_is_network_admin filter to address this, but the function would then still make a redundant database request.

Allow sites to be orphaned on purpose

Add the ability in the UI to purposely "orphan" or "disconnect" a site from a network.

This would functionally make the site_id column 0 for that site.

Lack of good Documentation and Example Getting Started

As a user I would like some type of clear example/demo for using this plugin. So far I am failing to get the proper functionality out of it. I try to create a new network and it just doesn't work (404s, page breaking).

Users in the support page have also posted similar issues but there was never a response.
https://wordpress.org/support/topic/wp-multi-network-multisite
https://wordpress.org/support/topic/plugin-wp-multi-network-404-for-child-pages

UI for the assign sites screen is cumbersome for large volumes

If there are large numbers of sites on either side of the equation when assigning sites to different networks, it's very difficult to find and identify specific sites.

Possibly adding the ability to search / filter the multiple select fields would help mitigate the difficult dealing with large volumes.

Logical error on Network Edit Page

As described by several users saving changes on the Network Edit Page results in all subsites orphaned which are not assigned to the currently edited network.
WordPress › Support » When EDIT a network, its subsites become orphaned?
WordPress › Support » Saving a network removes sites from other networks
WordPress › Support » Network.zero as root domain in dashboard
WordPress › Support » Network Edit Screen fails with WP 4.4.1
Comment on issue #63 "Failling sites on WP 4.4"

The reason for this is located at the end of function reassign_sites_handler() in file includes/classes/class-wp-ms-networks-admin.php. All subsites still listet in the left select box (name="from[]") are "orphaned out" when the update is executed.

At least it is logically not possible in that situation to distinguish which subsites in the "from" list should be orphaned and which should remain assigned to their original network.

A quick solution might be to list only orphaned subsites in the "from" list. Moving a subsite would result in two steps then. The first step is to remove subsites from it's current network and click update to get them orphaned. In the second step the edit page of the new network is called and the previously orphaned subsites can be reassigned.

Single Sign On, Cookie Not Enabled

This plugin is awesome, but I can seem to get the single sign on experience working.

I've added and updated the Cookie constants to my config file, but I'm still prompted for a username and password at each network, and WordPress is saying cookies are blocked or not supported, but they definitely are.

Plugin lives in src

Any reason plugin cannot be top-level instead of living in /src? It makes it much more difficult to use the git version as a WordPress plugin.

Add function to get main network

It's pretty useful to be able to fetch the main network. There's a non-trivial loading process currently stuck in is_main_network that can be used for a more generic function.

PR incoming soon.

Network capabilities

Right now we use manage_options for most cap checks, which is both incorrect and lame.

We should be using:

  • manage_networks
  • list_networks
  • create_networks

These better match what's currently checked for sites & users.

Single Sign-on redirect loop

Hi, when i put the single sign-on snippet with my primary domain I've got a redirect loop when i go to a another network

// Cookies
define( 'COOKIEHASH',        md5( 'yourdomain.com' ) );
define( 'COOKIE_DOMAIN',     'yourdomain.com'        );
define( 'ADMIN_COOKIE_PATH', '/' );
define( 'COOKIEPATH',        '/' );
define( 'SITECOOKIEPATH',    '/' );
define( 'TEST_COOKIE',        'thing_test_cookie' );
define( 'AUTH_COOKIE',        'thing_'          . COOKIEHASH );
define( 'USER_COOKIE',        'thing_user_'     . COOKIEHASH );
define( 'PASS_COOKIE',        'thing_pass_'     . COOKIEHASH );
define( 'SECURE_AUTH_COOKIE', 'thing_sec_'      . COOKIEHASH );
define( 'LOGGED_IN_COOKIE',   'thing_logged_in' . COOKIEHASH );

restore_current_network can only restore once

If you call switch_to_network twice, the $old_network_details variable is set twice. Rather than using the switch stack, restore_current_network uses this, so it will be unable to ever switch back. :(

Make it possible to remove admin hooks

I think it should be possible to remove admin hooks in case someone wants to display the menus for networks somewhere else. Theoretically one could remove the menus afterwards, but that's rather a workaround.

Currently the hooks cannot be removed because the object of WP_MS_Networks_Admin cannot be retrieved in any way.

404 for child blogs in subnetwork

Multi-site with subdirectories, not subdomains as blog. Creating networks works fine. However, when assigning blogs to sub-networks, the blogs are not found.

Setup:

domain.com/network1/blog1 - 404 oops
domain.com/network1/blog2 - 404 oops
domain.com/network2/blog1 - 404 oops
domain.com/network2/blog2 - 404 oops
etc.

Half a workaround

Changing "path" in wp_blogs, and "site_url", "home" in wp_*_options by removing the / displays the "frontpage" of the blog

domain.com/network1blog1 - Displays frontpage, but does not work when clicking on posts/pages
domain.com/network1blog2 - same as above
domain.com/network2blog1 - same as above
domain.com/network2blog2 - same as above

Standard Multi-site .htaccess: http://paste.debian.net/plain/152338

Remove _network_option() functions

Since these were introduced to WordPress core in 4.3, we can now safely remove our variants and bump the supported version to the latest.

"Search Networks" is broken

I know the search for WP_List_Table is bad but this one is broken.
Following issues:

  • ALL search terms, but * (all networks are correctly displayed), result in No networks found.
  • the ID of an existing network results in No networks found. BUT shows 1 item for the table

_network_options() functions now in WordPress 4.4

WP Multi Network causes fatal errors from duplicate function names, introduces in WordPress 4.4.

We should wrap them in function_exists() checks for now, and ensure core function parameters match ours.

"Install" Admin. Possible?

Does anyone see a way to create an admin area one level above wp-admin/network? And this in a "(semi-)native" way?

Add per-network setting for subdomain/subdirectory type

Networks should control their own destiny. While any URL combination is certainly possible, each network would benefit from having a way to dictate down what the appropriate pathing is to load sites & networks quickly.

Assign sites screen lacks information for clear identification

On a multi network installation when using the "Assign Sites" screen to move sites from one network to another, there isn't enough information displayed to uniquely identify similarly named sites.

It might be useful to show include the site ID, or sub-domain.

Infinite Redirect loop

Hi,
I've update my copy of the WP repo version with your newest additions here on github,
when creating a 2nd network and going to it's url, it goes into an infinite redirect loop...
Any suggestions? thank you

Can't create networks in WP 4.4 with trunk version of WPMN

(There's a PR inbound).

@jeremyfelt made a great synopsis of what happened in the WP Multisite Slack channel, I'll copy it here verbatim for ease.

@richardtape has found a nice situation with `WP_Network` and WPMN's use of one of the false promises we added to the object, `WP_Network::get_by_path()`.

`WP_Network::get_by_path()` was brought in from `get_network_by_path()`, which is most useful as a bootstrap function where it finds the closest matching network to a given domain/path. It explodes the domain string on `.` and then checks each level in the query. When used as a check to see if a network exists, the answer is not dependable.

In WPMN trunk, `get_network_by_path()` is now used to check for the existence of a network when it is added. This will work when the network is completely different - `abc.dev` vs `xyz.com`, but not when the network is a subdomain - `abc.xyz.com` vs `xyz.com`.

I think it may make sense to remove `get_by_path` from `WP_Network` in 4.4 and leave `get_network_by_path()` on its own as the bootstrap function it is. In 4.5, we can look at some proper lookup methods for finding networks with an exact match.

@jjj - thoughts?

For reference: e1f7c68#diff-e4e3c9edcb69fabfa2875311f180391dR284 is the change in WPMN. $network will never be empty given the conditions above when using get_network_by_path() because it will return at least the root network and therefore it always appears as if the requested new network exists

And, to add; reverting to

$sql     = "SELECT * FROM {$wpdb->site} WHERE domain = %s AND path = %s LIMIT 1";
$query   = $wpdb->prepare( $sql, $r['domain'], $r['path'] );
$network = $wpdb->get_row( $query );

‘fixes’ the issue in `add_network()

Failling sites on WP 4.4

After upgrading to wp4.4, and upgrading this plugin to 1.7.0, I am not able to assign sites to more than one network. When trying to assign sites to another network all other networks loses their sites. also, now i get network.zero domains for sites i try to visit. What's happening?

Ok this is what I did:

  • I already had a multi network site running wp4.3 and wpm 1.6.0 (I think)
  • Upgraded to wp4.4 and wpm 1.7.0 (to avoid crash because of duplicate functions
  • Started fiddling around in /wp-admin/network/admin.php?page=networks&id=1&action=edit_network – trying to edit sites and move them from network to network.
  • suddenly i realize none of my sites are working any more... only the root sites of each network worked
  • Then I realize that when I moved a few sites to one network, then moving some other sites to another network, the first network lost all its sites
  • eventually i just went into the database and edited each sites wp_options -> siteurl and home (url) as well as the wp_blogs table. site_urls were then http://network.zero/xyz/, and I edited them back to their former subdomains. I got things working now. But am a little scared...

Here are my MS settings in wp-config:
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] );
define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] );

Site can be moved to network with conflicting subdomain

If I have a site on network 2 with the subdomain foobar.network2.example.com, and try to move across a site from the main network with the same subdomain (foobar.example.com), WPMN happily does this without complaining.

This causes two sites in the same network to both have the same subdomain, and hence same full URL. 👎

WPMN should check for this when moving, and a) fail to move it at all, and b) offer to move and rename (after running through the uniqueness process).

"View" Quick Link in All Networks UI?

I think it would be handy to add a "View" link in the All Networks UI, would make auditing older Networks easier, especially ones that only have 1 in the sites column. Such as adding view_network to manage_network_action_links would suffice.

esc_html_e() vs _e()

In most cases esc_html_e() is overkill. The language files should be considered safe code, right?
So if there is not (s)printf() injecting some dynamic string _e() is sufficent and secure.

Network Activation Bug

With WP Multi Network all plugins on each network are independent of each other and can be network activated, activated and updated for one network and not the other. That's not the case with WP Multi Network being activated on one network. Its network activated on all networks, even if I only activate it on the root site networkone.com/wp-admin/plugins. It can be network deactivated on the second network, networktwo.com/wp-admin/network/plugins/ but still activated (not network activated) on networkone.com and everything still works (that's good), that's what I want to happen.

Is this a bug or is it the intended action to have WP Multi Network network activated across all networks?

Filter the networks for the current super admin user into the Networks Admin panel

In the "My Networks" page wp-admin/index.php?page=my-networks, the user only sees the networks where he's super admin.

In the "All Networks" page wp-admin/network/admin.php?page=networks, the user sees all the networks.

This behavior has to be corrected, because without that, a super admin user can change everything in all networks, even if he's not a super admin of a network.

Moving site doesn't update home/siteurl

Moving a site from the main network across to a different network doesn't appear to update the siteurl or home, leading it to still think it's available at abc.example.com instead of abc.othernetwork.example.com.

PHP Warning on deleting network with 'ENABLE_NETWORK_ZERO' = true

if

define( 'ENABLE_NETWORK_ZERO', true );
define( 'RESCUE_ORPHANED_BLOGS', true );

then

PHP Error   Count   Location    Call Stack  Component
Warning Creating default object from empty value    
1
/srv/www/wp-content/plugins/wp-multi-network/includes/functions-wp-ms-networks.php:541
move_site()
delete_network()
WPMN_Admin->delete_network_page()
WPMN_Admin->networks_page()
do_action('toplevel_page_networks')
Core

Unfiltered and broken links in admin views

I found a number of broken links in admin list view.

Firstly this view

screen shot 2015-05-13 at 11 52 12

The "Network admin" link doesn't use the network_admin_url function. If you are filtering network_site_url which I am for domain mapping reasons, you get the unfiltered url.

Second view

screen shot 2015-05-13 at 11 56 49

Visit, Dashboard links link to the wrong site url. It links to a different blog in the network. At a guess, I would guess this happened because the links link to the blog in the network that has the lowest blog id. This however is not the "primary" site on the network. This is because the blog was transferred into the network from another earlier network.

Both of these views should work how the sites list table works and use the switch_to_network() and restore_current_network() function calls while loop around network. In that context you can just call network_admin_url and network_site_url functions.

Related: #11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.