Skip to content

Conversation

peterwilsoncc
Copy link
Collaborator

@peterwilsoncc peterwilsoncc commented Sep 15, 2025

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

Relocates the initialization of the privacy export class from the plugin_loaded hook to the woocommerce_init hook, which fires on the WordPress init hook.

This is to prevent WordPress throwing a notice due to the early calling of _load_textdomain_just_in_time via the privacy constructor.

Note

The plugin uses the domain woocommerce-gateway-payfast while the slug on WordPress.org is woocommerce-payfast-gateway. For the time being this is preventing the removal of the load_plugin_textdomain call.

In order to remove it, the domain will need to be updated to match the wp.org plugin slug. See the i18n docs.

Closes https://linear.app/a8c/issue/PAYFAST-38/php-notice-function-load-textdomain-just-in-time-was-called

Steps to test the changes in this Pull Request:

  1. Log in to the dashboard
  2. Enable Query Monitor
  3. Ensure payfast does not trigger a doing_it_wrong notice.

Changelog entry

Fix - Prevent notice being thrown due to the early loading of translations.

@peterwilsoncc peterwilsoncc self-assigned this Sep 15, 2025
@peterwilsoncc peterwilsoncc marked this pull request as draft September 15, 2025 02:52
Copy link
Collaborator

@qasumitbagthariya qasumitbagthariya left a comment

Choose a reason for hiding this comment

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

QA Update ✅


I have verified this PR in the fix/PAYFAST-38-early-i18n-notice branch, which has been fixed and is functioning as intended.

I tested the following on this branch:

Before Fix:

image

After Fix:
image

Testing Environment

  • WordPress: 6.8.3
  • Theme: Twenty Twenty-Five 1.3
  • WooCommerce - 10.2.2
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS 15.2
  • Branch: fix/PAYFAST-38-early-i18n-notice

Steps to Test- As mentioned in the PR description.
Test Results - It is working as expected.
Functional Demo / Screencast -
Special Notes - Ready for UAT
Testing Document status:
Cases related to this Issue/PR are added to the Critical Flow Wiki pages:

  • Yes
  • Not Required/Applicable for this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants