Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add early exit clauses to files with procedural code#790

Merged
felixarntz merged 1 commit into
trunkWordPress/performance:trunkfrom
fix/procedural-files-early-exitWordPress/performance:fix/procedural-files-early-exitCopy head branch name to clipboard
Jul 25, 2023
Merged

Add early exit clauses to files with procedural code#790
felixarntz merged 1 commit into
trunkWordPress/performance:trunkfrom
fix/procedural-files-early-exitWordPress/performance:fix/procedural-files-early-exitCopy head branch name to clipboard

Conversation

@felixarntz

Copy link
Copy Markdown
Member

Summary

This was flagged during plugin review of the "Dominant Color Images" submission. Any files with procedural code should have an early exit condition. Most typically the one based on whether ! defined( 'ABSPATH' ), but another relevant constant can used as well. For example, in the files where we already check for a Performance Lab specific constant on top of the file, we don't have to add to or update those files.

Keep in mind that this is only required for files with procedural code, i.e. not files that only contain a class or similar construct.

There are varying opinions on this approach, but given it's requested by the plugin review team and is not a big deal to add, let's follow the pattern.

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

@felixarntz felixarntz added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall performance plugin infrastructure labels Jul 25, 2023
@felixarntz felixarntz added this to the PL Plugin 2.6.0 milestone Jul 25, 2023
@felixarntz
felixarntz merged commit d548c69 into trunk Jul 25, 2023
@felixarntz
felixarntz deleted the fix/procedural-files-early-exit branch July 25, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Issues for the overall performance plugin infrastructure [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.