Skip to content

Critical error with file-based execution #275

@AmibeWebsites

Description

@AmibeWebsites

Current behavior

File-based execution inserts the following security code at the top of each file:
if ( ! defined( 'ABSPATH' ) ) { return; }

This causes a fatal error with any script that uses namespace declarations.

PHP Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in [redacted]

Expected behavior

Insert the security code after any namespace declaration statement.

Steps to reproduce

No response

WordPress version

6.8.3

Code Snippets version

3.8.0

Code Snippets license

Core (free)

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions