qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
546 stars 103 forks source link

Fix custom URL for admin area and login page #1324

Closed poetter-sebastian closed 1 year ago

poetter-sebastian commented 1 year ago

If you use a plugin who hides the admin page on a custom url

Plugins like https://de.wordpress.org/plugins/wp-hide-security-enhancer/ https://de.wordpress.org/plugins/hide-my-wp/ https://de.wordpress.org/plugins/wps-hide-login/

According to #1080 #443

poetter-sebastian commented 1 year ago

I've created two new functions for backend and login name and use the str_replace instead of regex.

(maybe the test is not necessary)

poetter-sebastian commented 1 year ago

Thanks for the comments, I simplified the functions.

herrvigg commented 1 year ago

Looks good at first sight, I'll take a closer look soon.

poetter-sebastian commented 1 year ago

Is there something I can do ?

herrvigg commented 1 year ago

I will merge it, but please test more once it's in master. I spotted possible bugs but they come from the state before patch so let's separate the scope of changes. Beyond the custom wp-admin functionality coming here, this should also fix neutral path for wp-login.php. The previous version has a regex match against wp-login/ (with trailing slash) but this looks wrong to me. The new check is a strict equality vs wp_login_url() which leads to wp-login.php by default.

herrvigg commented 1 year ago

Released in 3.15.0.