This commit is contained in:
Javier Casares 2026-08-18 10:48:13 +00:00
commit 5589c54b9b
13 changed files with 138 additions and 58 deletions

View file

@ -417,7 +417,7 @@ class Robotstxt_Manager_Installer {
* @return string The sanitized plugin slug.
*/
private function authorize( string $action ): string {
if ( ! current_user_can( 'manage_options' ) ) {
if ( ! current_user_can( is_multisite() ? 'manage_network_options' : 'manage_options' ) ) {
wp_die( esc_html__( 'Insufficient permissions.', 'robotstxt-manager' ) );
}
@ -543,7 +543,7 @@ class Robotstxt_Manager_Installer {
$headers = array();
if ( $use_download_endpoint ) {
$api_key_raw = get_option( 'robotstxt_manager_api_key', '' );
$api_key_raw = get_site_option( 'robotstxt_manager_api_key', '' );
$api_key = is_string( $api_key_raw ) ? Robotstxt_Manager_Encryption::decrypt( $api_key_raw ) : '';
if ( '' !== $api_key ) {
@ -686,7 +686,7 @@ class Robotstxt_Manager_Installer {
'robotstxt_manager_result' => $result,
'robotstxt_manager_message' => rawurlencode( $message ),
),
admin_url( 'admin.php' )
( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) )
)
);
exit;