id; // Only where it matters, so the dashboard and unrelated screens stay free of it. if ( ! $this->capabilities->has_engine() && ( str_contains( $screen_id, 'pixelkeep' ) || in_array( $screen_id, array( 'plugins', 'upload' ), true ) ) ) { printf( '

%1$s %2$s

', esc_html__( 'PixelKeep cannot optimize images on this server.', 'pixelkeep' ), esc_html__( 'Neither Imagick nor GD is working in PHP, so no image will be changed. Ask your host to enable one of them, then recheck under PixelKeep → Tools.', 'pixelkeep' ) ); } if ( str_contains( $screen_id, 'pixelkeep' ) && $this->backups->needs_server_rules() ) { printf( '

%1$s %2$s

', esc_html__( 'Backups can be opened from the web.', 'pixelkeep' ), esc_html__( 'They sit in a folder with a random name, but a server rule should block them. This notice goes away once they are blocked; PixelKeep → Tools → Recheck capabilities tests again.', 'pixelkeep' ) ); if ( $this->backups->is_nginx() ) { printf( '

%1$s

location ~* /wp-content/uploads/pixelkeep-(backups|tmp)/ { deny all; }

', esc_html__( 'Add this rule to your Nginx site configuration:', 'pixelkeep' ) ); } else { printf( '

%s

', esc_html__( 'Allow .htaccess files in the uploads folder, or block the pixelkeep-backups folder in your server configuration.', 'pixelkeep' ) ); } echo '
'; } } }