Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect: Fixed undefined credentials property warning #27394

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

dkmyta
Copy link
Contributor

@dkmyta dkmyta commented Nov 14, 2022

Fixes #
When viewing the Protect UI with no plan, we receive an undefined property warning because we are checking the status report for a property that only exists when the Scan API is used.

Changes proposed in this Pull Request:

  • Adds an isset() check to the corresponding stdClass::$credentials property upon status report generation.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?

Jetpack product discussion

  • 1201069996155224-as-1203359421438051

Does this pull request change what data or activity we track or use?

  • No

Testing instructions:

  • Start up a Jurassic Ninja instance with the Jetpack Beta plugin installed, with detailed error logging enabled
  • Using the Beta plugin install add/scan-in-protect branch of Protect
  • Start with the Free version of the plugin and proceed to the Protect admin page and allow the initial report to generate
  • View the initial report and refer to the site debug.log file to verify the following warning is output:
PHP Warning:  Undefined property: stdClass::$credentials in /usr/local/src/jetpack-monorepo/projects/plugins/protect/src/class-credentials.php
  • Proceed to the Beta plugin admin screen and update the Protect plugin to use the current branch
  • Visit the Protect admin screen and refer once again to your debug.log to ensure the error is no additional error entry

@dkmyta dkmyta changed the title Fixed undefined credentials property warning Protect: Fixed undefined credentials property warning Nov 14, 2022
@github-actions github-actions bot added [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Status] In Progress labels Nov 14, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2022

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • 🔴 Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


🔴 Action required: Please add missing changelog entries for the following projects: projects/plugins/protect

Use the Jetpack CLI tool to generate changelog entries by running the following command: jetpack changelog add.
Guidelines: /docs/writing-a-good-changelog-entry.md


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Protect plugin:

  • Next scheduled release: December 6, 2022.
  • Scheduled code freeze: November 28, 2022.

Copy link
Contributor

@nateweller nateweller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@dkmyta dkmyta marked this pull request as ready for review November 14, 2022 18:10
@dkmyta dkmyta merged commit a4efab1 into add/scan-in-protect Nov 14, 2022
@dkmyta dkmyta deleted the fix/undefined-credentials-warning branch November 14, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants