From 5ac48143becd71cf746381c10c154c008e84c4cb Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 21 Mar 2024 12:31:57 -0500 Subject: [PATCH 1/2] Update and rename `no-response.yml` to `close-stale-issues.yml` --- ...no-response.yml => close-stale-issues.yml} | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) rename .github/workflows/{no-response.yml => close-stale-issues.yml} (55%) diff --git a/.github/workflows/no-response.yml b/.github/workflows/close-stale-issues.yml similarity index 55% rename from .github/workflows/no-response.yml rename to .github/workflows/close-stale-issues.yml index d312c2c3..4ffcfbc8 100644 --- a/.github/workflows/no-response.yml +++ b/.github/workflows/close-stale-issues.yml @@ -1,26 +1,27 @@ -name: No Response +name: 'Close stale issues' # **What it does**: Closes issues where the original author doesn't respond to a request for information. # **Why we have it**: To remove the need for maintainers to remember to check back on issues periodically to see if contributors have responded. -# **Who does it impact**: Everyone that works on docs or docs-internal. on: - issue_comment: - types: [created] schedule: - # Schedule for five minutes after the hour, every hour - - cron: '5 * * * *' + # Schedule for every day at 1:30am UTC + - cron: '30 1 * * *' + +permissions: + issues: write jobs: - noResponse: + stale: runs-on: ubuntu-latest steps: - - uses: lee-dohm/no-response@v0.5.0 + - uses: actions/stale@v9 with: - token: ${{ github.token }} - daysUntilClose: 14 # Number of days of inactivity before an Issue is closed for lack of response - responseRequiredLabel: "needs:feedback " # Label indicating that a response from the original author is required - closeComment: > + days-before-stale: 7 + days-before-close: 7 + stale-issue-message: > + It has been 7 days since more information was requested from you in this issue and we have not heard back. This issue is now marked as stale and will be closed in 7 days, but if you have more information to add then please comment and the issue will stay open. + close-issue-message: > This issue has been automatically closed because there has been no response to our request for more information. With only the information that is currently in the issue, we don't have enough information @@ -28,3 +29,8 @@ jobs: that we can investigate further. See [this blog post on bug reports and the importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/) for more information about the kind of information that may be helpful. + stale-issue-label: 'stale' + close-issue-reason: 'not_planned' + any-of-labels: 'needs:feedback' + remove-stale-when-updated: true + From 741cc55a415cf234ccc3e41941d9c84ff93d273c Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Mon, 25 Mar 2024 14:15:00 -0600 Subject: [PATCH 2/2] Add a check to ensure our svg was loaded before we try getting it's dimensions --- safe-svg.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/safe-svg.php b/safe-svg.php index 399fc3a1..440ca98e 100644 --- a/safe-svg.php +++ b/safe-svg.php @@ -597,6 +597,11 @@ protected function svg_dimensions( $attachment_id ) { } elseif ( $svg ) { $svg = @simplexml_load_file( $svg ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + // Ensure the svg could be loaded. + if ( ! $svg ) { + return false; + } + $attributes = $svg->attributes(); if ( isset( $attributes->viewBox ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase