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

Check that ACF functions exist before use #76

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

snim2
Copy link
Contributor

@snim2 snim2 commented Feb 4, 2025

If this plugin is run via a request to wp-activate.php it will produce a 5xx error in our logs. This commit checks for the existance of ACF functions before they are used, and returns early from methods if ACF is not available.

See:
https://dxw.slack.com/archives/C04AJM8DCRF/p1738687250751619

Testing

  • Install dependencies: composer install
  • Run the lint: ./vendor/bin/php-cs-fixer fix
  • Run Psalm: ./vendor/bin/psalm --find-unused-psalm-suppress
  • Run tests: ./vendor/bin/kahlan spec

Checklist

  • Changelog updated
  • If new release: major version tag to be bumped after release (see docs)

@snim2 snim2 force-pushed the chore/avoid-acf-errors branch from 6ff408b to 9dfd261 Compare February 4, 2025 18:47
If this plugin is run via a request to wp-activate.php
it will produce a 5xx error in our logs. This commit
checks for the existance of ACF functions before they
are used, and returns early from methods if ACF is
not available.
@snim2 snim2 force-pushed the chore/avoid-acf-errors branch from 9dfd261 to 661fd82 Compare February 4, 2025 18:52
@snim2 snim2 merged commit 2c04d76 into main Feb 5, 2025
5 checks passed
@snim2 snim2 deleted the chore/avoid-acf-errors branch February 5, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants