Site logo

Archived topic

Major issues with 'wp-activate.php'

8 replies · Started by Milan Petrović on June 1, 2021

Viewing posts 1–9 of 9

File 'wp-activate.php' is used in multisite WordPress installation to activate an account signed through 'wp-signup.php'. While the signup page works correctly, there are several issues with 'wp-activate.php':

1. I have customized copyright bar through customizer, but that is ignored and default copyright bar is displayed (with build with GeneratePress message).
2. Secondary navigation on top of the page is not displayed at all, and it does work with wp-signup.php.
3. I have Block Hook element hooked to 'generate_before_footer_content' set for Entire Website, and this does work for wp-signup.php.
4. I have checked and confirmed that header.php and footer.php from GeneratePress are loaded, and all actions are run, but something in the way GeneratePress detects pages work on wp-signup.php, but it doesn't work with wp-activae.php.

To replicate the issue, install the GeneratePress theme and plugin on the first site in the multisite network, configure everything (include secondary navigation and copyright bar, and block hook element, but I am sure more things will be broken also), and try the activation URL: https://www.test.com/wp-activate.php.

Milan

Hi there,

It seems like wp-activate.php has its own template: https://github.com/WordPress/WordPress/blob/5.7.2/wp-activate.php

That template obviously doesn't have any of the GeneratePress hooks or filters, which explains the issues you're seeing. Looking at it, I'm not sure it was ever intended to be "themed"/overwritten in a child theme, unfortunately.

The accepted answer here might be worth looking into: https://wordpress.stackexchange.com/questions/41329/customizing-wp-activate-php

No, that file is similar to wp-signup.php. They both call 'get_header' and 'get_footer' functions, and with wp-signup.php, GeneratePress works fine. And, in wp-activate, a lot of things work, but not everything, and I have checked, GeneratePress theme elements run, the problem is with modules added by GP Premium plugin, they are failing to run. Every normal GeneratePress feature works and all the filters and actions run properly, header.php and footer.php from the theme are loaded.

Test it out, and you will see the problem, I am sure.

Both wp-signup and wp-activate are indeed outside of the normal themes, but they run with normal themes because they load header and footer as they should, they just generate own content.

I have two helper functions I usually use to detect these pages:

function is_signup_page() : bool {
	return isset( $GLOBALS['pagenow'] ) && $GLOBALS['pagenow'] === 'wp-signup.php';
}

function is_activate_page() : bool {
	return isset( $GLOBALS['pagenow'] ) && $GLOBALS['pagenow'] == 'wp-activate.php';
}

Milan

Ah, that makes sense. It is 8 years old ticket no one can/will fix.

I plan to use GP Premium on the whole network, so it will work for me.

Thanks!

hi tom, does this mean you recommend to acticate your plugins gp pro, gb and gb pro for the whole network instead on every single site?

are there more differences or maybe problems between this two possibilities?

Hi Heinrich,

A Network Activated plugin will be loaded and activated on all Sites on the network.
It cannot be activated / de-activated on an individual site.

So the decision of Network Activated vs Individual site is specific to how you want to manage your sites.

However if you have an issue with the open bug relating to the wp-activate.php template, like Milan had, then the only way to fix that is with a multisite install.

hi david, tks for info

You're welcome

This archived topic is closed to new replies.