Development issueshttps://lab.civicrm.org/groups/dev/-/issues2024-03-02T23:35:31Zhttps://lab.civicrm.org/dev/core/-/issues/5059FormBuilder Contact Blocks break with various modifications2024-03-02T23:35:31ZJoeMurrayFormBuilder Contact Blocks break with various modificationsOverview
----------------------------------------
_Address block for individual contact on wpmaster does not render properly on simple FB form, but does on dmaster._
Reproduction steps
----------------------------------------
1. On wpma...Overview
----------------------------------------
_Address block for individual contact on wpmaster does not render properly on simple FB form, but does on dmaster._
Reproduction steps
----------------------------------------
1. On wpmaster 5.72.alpha1 rebuilt as http://demo-248-8hhyk.test-1.civicrm.org:8001/, click on **Administer > Customize Data and Screens > FormBuilder**.
2. Click on New Submission Form.
3. Set Title = test, Permission to Generic: Allow all users, Page Route civicrm/test , Accessible on Front End of Site = true.
4. Click Individual 1 tab, set Security to Form-Based, then drag Contact Address(es) block into bottom of Individual 1 canvas.
4. Form renders improperly.
![2024-03-02_18-26-12](/uploads/fa4edb46a99b74179ce9e17875ecd750/2024-03-02_18-26-12.png)
1. On dmaster, click on **Administer > Customize Data and Screens > FormBuilder**.
2. Click on New Submission Form.
3. Set Title = test, Permission to Generic: Allow all users, Page Route civicrm/test , Accessible on Front End of Site = true.
4. Click Individual 1 tab, set Security to Form-Based, then drag Contact Address(es) block into bottom of Individual 1 canvas.
4. Form renders properly.
![2024-03-02_18-09-55](/uploads/e3c5cbe752876a2e35cab1e70f703ba4/2024-03-02_18-09-55.png)colemanwcolemanwhttps://lab.civicrm.org/dev/core/-/issues/4845CiviEvent with approvals: Registration form not pre-filled with (custom) part...2023-12-20T19:21:06ZTobias Voigttobias.voigt@civiservice.deCiviEvent with approvals: Registration form not pre-filled with (custom) participant dataI'm not sure wether this is a proposal or an issue. I'm using the approval workflow for CiviEvent where participants get a confirmation link after they've been approved by admins.
While this works great for simple registration use cases...I'm not sure wether this is a proposal or an issue. I'm using the approval workflow for CiviEvent where participants get a confirmation link after they've been approved by admins.
While this works great for simple registration use cases, where only contact information is gathered in the initial registration form, this feature regrettably can't be used for more comlex use cases, where the initial form also contains additional (custom) participant data (e.g. "Do you want the vegetarian option for dinner?").
So, if there's any fields for custom participant data in the initial registration form, users would fill out the form and send it. Afterwards, admins approve the registration and a confirmation link is sent out to the approved user. If he/she clicks on the confirmation link and chooses to confirm, all contact data gets pre-filled into the form - BUT: the participant data - which is already stored in the database from the initial form - is not pre-filled and has to be filled out again.
This drastically limits the scope of use cases this feature could work for, since in almost all our client's projects we work with additional / custom participant data.
So my question is: Is this a bug and the participant data should actually be loaded during the confirmation process? Or was this feature never intended? Or maybe the feature was intended but never realized? In any case: What might be the scope of development work necessary to not only pre-fill the confirmation form with contact data but also with participant data?https://lab.civicrm.org/dev/wordpress/-/issues/144Attempting to create a pretty URL on a subpage results in non-pretty URL2023-11-22T11:10:32ZshaneonabikeAttempting to create a pretty URL on a subpage results in non-pretty URLI discovered a strange issue today with regards to pretty CiviCRM Urls via the implemention ```CRM_Utils_System::url``` for Wordpress
## To recreate
1. Create a subpage called ```Profile```
2. In ```functions.php``` create a function l...I discovered a strange issue today with regards to pretty CiviCRM Urls via the implemention ```CRM_Utils_System::url``` for Wordpress
## To recreate
1. Create a subpage called ```Profile```
2. In ```functions.php``` create a function like
```php
civicrm_initialize();
$url = '';
$result = get_user_participation($current_user, $event_id);
if (!empty($result) && isset($result['values'][0]['participant_id'])) {
$pid = $result['values'][0]['participant_id'];
$eligible = CRM_Event_BAO_Participant::getSelfServiceEligibility($pid, '', FALSE)['eligible'];
if ($eligible) {
$checksum = \Civi\Api4\Contact::getChecksum(FALSE)->setContactId($result['values'][0]['contact_id'])->execute()->first()['checksum'];
$url = CRM_Utils_System::url("/civicrm/event/selfsvcupdate", "reset=1&pid=$pid&cs=$checksum", TRUE, FALSE, TRUE);
}
}
return $url;
}
3. Override the ```Profile``` page within your theme by creating ```Profile.php``` (Note: I didn't test if we use a shortcode here)
```
4. Call the function above to output the URL
## Result
The logic in the code determines if we have a [basepage](https://lab.civicrm.org/dev/core/-/blob/master/CRM/Utils/System/WordPress.php?ref_type=heads#L324), and if it doesn't find one well it resorts to creating a non-pretty path.
I don't think that I'm proposing we change this, but it could be good to be able to override this maybe in the function call? To force it to make pretty links regardless, because on some subpages for sure we would want to have nice links.
Ironically, the link generated doesn't work in this case either. When it's a pretty link it's fine but otherwise no dice. It could be a configuration issue with my client I'm not sure.https://lab.civicrm.org/dev/core/-/issues/4500Ongoing duplicate contact creation if mismatch in civicrm_uf_match2024-01-24T21:04:46ZAllenShawOngoing duplicate contact creation if mismatch in civicrm_uf_match(I've only seen this on WordPress, but the relevant file is in core, so I'm filing under dev/core).
**Summary:**
Under certain circumstances involving "crossed wires" in the `civicrm_uf_match` table, a logged-in user's mere activity in...(I've only seen this on WordPress, but the relevant file is in core, so I'm filing under dev/core).
**Summary:**
Under certain circumstances involving "crossed wires" in the `civicrm_uf_match` table, a logged-in user's mere activity in CiviCRM will create a new contact (containing only the user's email address) for each CiviCRM page load (or ajax call, etc.). Left un-checked, this can lead to thousands of duplicate contacts containing only an identical email address.
**Scope of impact:**
I've seen this on a handful of WordPress sites over the past 5-7 years. I've not heard others in the community mention it, nor seen an existing issue on l.c.o.
**Example steps to reproduce:**
This is only one example; there are surely other steps that will get us there. See "Requisite data conditions" below.
These steps are for repro under WordPress. I haven't tried this under other CMSs.
1. Create WP user _a_ with email address _a@example.com_. Observe this creates a corresponding civicrm contact; we'll call this contact C1. Observe that the entry in `civicrm_uf_match` is correct (i.e. Summary tab for contact C1 shows the user ID of user _a_).
2. Change the email address for user _a_ to _a2@example.com_. Observe that the `civicrm_uf_match` link is preserved (but also that the email address in `civicrm_uf_match.uf_name` is unchanged).
3. Delete contact C1 (permanently or to trash). Observe entry in `civicrm_uf_match` is deleted, and user _a_ still exists.
4. Create a new contact (which we'll call C2) with another email address, e.g. _aFoo@example.com_.
5. Use CiviCRM's "Create User Record" feature to create a new WP user for contact C2; specify any username you like, but we'll assume username _a2_. Observe that the entry in `civicrm_uf_match` is correct (i.e. Summary tab for contact C2 shows the user ID of user _a2_), and that user _a2_ has email address _aFoo@example.com_.
6. Change contact C2's email address to _a2@example.com_. Observe that the email address in `civicrm_uf_match.uf_name` is updated, and the emmail address for WP user _a2_ is unchanged.
At this point, you'll have this state of data:
| wp_users.ID* | wp_users.user_login | civicrm_uf_match.id* | civicrm_uf_match.contact_id* | civicrm contact primary email | civicrm_uf_match.uf_name | wp_users.user_email |
|-------------|---------------------|---------------------|-----------------------------|-------------------------------|--------------------------|---------------------|
| 64 | a | NULL | NULL | NULL | NULL | a2@example.com |
| 65 | a2 | 162 | 75512 | a2@example.com | a2@example.com | aFoo@example.com |
_\* IDs in this table are from my real data; yours will differ of course._
7. As for permissions, I granted user _a_ the WP Administrator role, which has _Administer CiviCRM_; you could probably repro with narrower permissions.
8. Log in as user _a_. Perform a CiviCRM search for contacts having email address _a2@example.com_. Observe the result count N.
9. **Bad Behavior:** Do just about anything in CiviCRM. For example, refresh the search just performed. Observe the result count is >N.
10. Repeat step 9 and observe the increasing number of contacts with email address _a2@example.com_.
**Requisite data conditions**:
As mentioned above, there are probably many possible repro recipes, but the key is to arrive at this requisite state of data:
Given a specific WP user e.g. username _a_, email address _a2@example.com_, new contacts are created containing only this email address, each time this logged-in user takes any action (or presumably almost any action) in CiviCRM, as long as:
1. The WP user ID is not represented in `civicrm_uf_match.uf_id`; and
2. The WP user email (_a2@example.com_) is associated with one or more CiviCRM contacts; in a list of these contacts, sorted by `is_primary DESC, contact_id`, the first contact in that list is represented in `civicrm_uf_match.contact_id`; and
3. The WP user email (_a2@example.com_) is represented in `civicrm_uf_match.uf_name`.
**Relevant code:**
This all seems to be primarily handled by `CRM_Core_DAO_UFMatch::synchronizeUFMatch()`. The above "requisite data conditions" are a summary of the logical path in that method that leads to the stated problem.
Interestingly, the code seems to be aware of this problem, as in [line 284](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/BAO/UFMatch.php#L284) it defines a variable `$msg` which would read along the lines of (using values from my data-state above) "Contact ID 162 is a match for WordPress user 64 but has already been matched to 65" -- but that message is never used or logged anywhere.
**Workarounds:**
My simplest fix has been simply to update civicrm_uf_match via SQL to link the right user with the right contact, like so (again using values from my real data above): `update civicrm_uf_match set uf_id = 64 where contact_id = 75512;`. And then of course to remove all of the duplicate contacts.
I thought _Synchronize Users to Contacts_ might do the trick, but it has no affect on the relevant data, and the bad behavior persists.
(Joinery reference: F#1180, F#1339)https://lab.civicrm.org/dev/core/-/issues/4293Uncaught SyntaxError: '#' not followed by identifier2023-11-23T07:47:01ZBastien HoUncaught SyntaxError: '#' not followed by identifierIn a contribution page, I get an `Uncaught SyntaxError: '#' not followed by identifier` error in the console.
Reproduction steps
----------------------------------------
1. Create a contribution page.
1. Insert it in a WordPress page.
1...In a contribution page, I get an `Uncaught SyntaxError: '#' not followed by identifier` error in the console.
Reproduction steps
----------------------------------------
1. Create a contribution page.
1. Insert it in a WordPress page.
1. Display the page.
1. Open the console of the navigator
In _templates/CRM/Contribute/Form/Contribution/Main.tpl_, the following lines are misinterpreted before being output:
```js
function useAmountOther() {
var priceset = {/literal}
{if $contriPriceset}'{$contriPriceset}'
{else}0
{/if}
{literal};
for (i = 0; i < document.Main.elements.length; i++) {
element = document.Main.elements[i];
if (element.type == 'radio' && element.name == priceset) {
if (element.value == '0') {
element.click();
} else {
element.checked = false;
}
}
}
}
```
In the source of the generated page:
```js
function useAmountOther() {
var priceset =
0
;
for (i = 0; i < document.Main.elements.length; i++) {
element = document.Main.elements[i];
if (element.type == 'radio' && element.name == priceset) {
if (element.value == '0') {
element.click();
} else {
element.checked = false;
}
}
}
}
```
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
* __Browser:__ _Firefox 112_
* __CiviCRM:__ _5.61.2_
* __PHP:__ _8.0_
* __CMS:__ _WordPress 6.2_
* __Database:__ _MariaDB 10.5_
* __Web Server:__ _Apache 2.4_https://lab.civicrm.org/dev/core/-/issues/4212Wordpress - allow suppressing CiviCRM title in profiles / contribution pages?...2023-04-04T08:45:49ZeileenWordpress - allow suppressing CiviCRM title in profiles / contribution pages? when displaying via short codeThere is a problem @justinfreeman has been reporting whereby you wind up with double-titles because the title is not optional on the CiviCRM or the Wordpress level.
I think the right fix for this is to handle in within the short code co...There is a problem @justinfreeman has been reporting whereby you wind up with double-titles because the title is not optional on the CiviCRM or the Wordpress level.
I think the right fix for this is to handle in within the short code configuration - do you have any thoughts on how to do that @kcristiano @haystack ?
![image](/uploads/e40555c9a25d0948ca0dc5f8d60daa1f/image.png)
![image](/uploads/0a1231cdc2be7d04feeb0801163b0d38/image.png)https://lab.civicrm.org/dev/core/-/issues/4042Link to import search display goes to front end form in wordpress2022-12-20T10:02:03ZeileenLink to import search display goes to front end form in wordpressAfter doing an import with Civi-Import enabled there is a link from the import summary screen to the error page (perhaps not if there are no errors?) - that links to the search kit display, filtered for errors - but on Wordpress I'm lan...After doing an import with Civi-Import enabled there is a link from the import summary screen to the error page (perhaps not if there are no errors?) - that links to the search kit display, filtered for errors - but on Wordpress I'm landing on a front end url.
E.g you can go back to the contact summary screen via Reports->My imports
![image](/uploads/f729ec641ae159fdbf18e922fc4f12b9/image.png)
And I'm looking at the link to view errors
![image](/uploads/05b060cfa95c0b5371a3e104235db5c0/image.png)
On drupal I correctly end up at https://dmaster.localhost:32353/civicrm/search#/display/Import_5/Import_5?_status=ERROR
Currently it is being assigned [here](https://github.com/civicrm/civicrm-core/blob/da9cd2454fbca7e38a78f7cb1539decaa5c2f4ff/ext/civiimport/civiimport.php#L278) in a non-WP-friendly way
```
if ($formName === 'CRM_Contact_Import_Form_Summary') {
$form->assign('downloadErrorRecordsUrl', '/civicrm/search#/display/Import_' . $form->getUserJobID() . '/Import_' . $form->getUserJobID() . '?_status=ERROR');
}
```
On my WP site the search display url is
The correct url is
https://bepartoftheart.co.nz/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fsearch#/display/Import_36/Import_36
- with the `_status=Error` added - which doesn't seem to work...
But the things I tried to generate the url didn't work...
```
if ($formName === 'CRM_Contact_Import_Form_Summary') {
$form->assign('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/search', ['_status'=> 'ERROR'], FALSE, '/display/Import_' . $form->getUserJobID() . '/Import_' . $form->getUserJobID(), FALSE, TRUE));
}
```
But wind up at
https://bepartoftheart.co.nz/civicrm/search/?_status=ERROR#/display/Import_36/Import_36
Or
```
if ($formName === 'CRM_Contact_Import_Form_Summary') {
$form->assign('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/search/display/Import_' . $form->getUserJobID() . '/Import_' . $form->getUserJobID(), ['_status'=> 'ERROR'], FALSE, NULL, FALSE, TRUE));
}
```
But wind up at
https://bepartoftheart.co.nz/civicrm/search/display/Import_36/Import_36/?_status=ERRORdhttps://lab.civicrm.org/dev/core/-/issues/4023Check Clean URLs check: Frequent error noise when no contribution pages and p...2022-12-08T09:42:33ZJonGoldCheck Clean URLs check: Frequent error noise when no contribution pages and public can't access events#### Replication Steps
* Be on WordPress.
* Have no contribution pages.
* Have at least 1 active event.
* Remove "CiviEvent: register for events" permission from anonymous user.
Get a bunch of these errors:
```
[error]
$Fatal Error De...#### Replication Steps
* Be on WordPress.
* Have no contribution pages.
* Have at least 1 active event.
* Remove "CiviEvent: register for events" permission from anonymous user.
Get a bunch of these errors:
```
[error]
$Fatal Error Details = array:3 [
"message" => "You do not have permission to access this page."
"code" => null
"exception" => CRM_Core_Exception {#8688
#message: "You do not have permission to access this page."
#code: 0
#file: "/home/jon/local/nmysite/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php"
#line: 615
#cause: null
-_trace: null
-errorData: array:1 [
"error_code" => 0
]
trace: {
/home/jon/local/nmysite/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:615 {
› $civicrm_wp_title = ts('You do not have permission to access this page.');
› throw new CRM_Core_Exception(ts('You do not have permission to access this page.'));
› }
}
/home/jon/local/nmysite/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:62 { …}
/home/jon/local/nmysite/web/wp-content/plugins/civicrm/civicrm/CRM/Event/Page/EventInfo.php:42 { …}
/home/jon/local/nmysite/web/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319 { …}
/home/jon/local/nmysite/web/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
/home/jon/local/nmysite/web/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
/home/jon/local/nmysite/web/wp-content/plugins/civicrm/civicrm.php:1199 { …}
/home/jon/local/nmysite/web/wp-content/plugins/civicrm/includes/civicrm.basepage.php:380 { …}
/home/jon/local/nmysite/web/wp-includes/class-wp-hook.php:308 { …}
/home/jon/local/nmysite/web/wp-includes/class-wp-hook.php:332 { …}
/home/jon/local/nmysite/web/wp-includes/plugin.php:565 { …}
/home/jon/local/nmysite/web/wp-includes/class-wp.php:797 { …}
/home/jon/local/nmysite/web/wp-includes/functions.php:1332 { …}
/home/jon/local/nmysite/web/wp-blog-header.php:16 { …}
/home/jon/local/nmysite/web/index.php:17 { …}
}
}
]
```
I want to ping Eli Lisseck but I don't think they're pingable?https://lab.civicrm.org/dev/core/-/issues/3914Missing getRoleNames() method in WordPress System Utility2022-11-01T08:51:34ZBastien HoMissing getRoleNames() method in WordPress System UtilityOverview
----------------------------------------
Some extensions use the `CRM_Core_Config::singleton()->userSystem->getRoleNames()` method, which is not implemented for WordPressOverview
----------------------------------------
Some extensions use the `CRM_Core_Config::singleton()->userSystem->getRoleNames()` method, which is not implemented for WordPresshttps://lab.civicrm.org/dev/wordpress/-/issues/131CIviCRM is incompatible with WordPress "Block Themes" because Javascript is b...2024-01-23T17:05:21ZtcmallocCIviCRM is incompatible with WordPress "Block Themes" because Javascript is broken by `wptexturize()`Certain components (in my case civicrm) embed some inline js into form templates, however some part of wordpress or civicrm picks this up and tries to html escape the content, meaning any code snippet using AND (`&&`) will not work.
The...Certain components (in my case civicrm) embed some inline js into form templates, however some part of wordpress or civicrm picks this up and tries to html escape the content, meaning any code snippet using AND (`&&`) will not work.
The specific bug we ran into was with CiviContribute: when allow other amounts is ticked the code
```js
// Putting these functions directly in template so they are available for standalone forms
function useAmountOther() {
var priceset = 'price_2';
for( i=0; i < document.Main.elements.length; i++ ) {
element = document.Main.elements[i];
if ( element.type == 'radio' && element.name == priceset ) {
```
has the last line turned into `if ( element.type == 'radio' && element.name == priceset ) {`, meaning the whole snippet fails to load and so selecting/clearing the other amount field doesn't work properly.
I cannot recreate this on the wordpress demo site, as it uses caldera forms. Our workaround was to embed the JS snippet to the bottom of the CiviCrm page, however this is not ideal.
Wordpress 6.0.2, CiviCRM 5.53.0https://lab.civicrm.org/dev/wordpress/-/issues/92Feature Request, CiviCRM Mailing, Public Page (ie. the page you use to read t...2023-02-09T16:50:04Zjustinfreeman (Agileware)Feature Request, CiviCRM Mailing, Public Page (ie. the page you use to read the email on-line) entirely bypass WordPress pages and are therefore rendered without website title, meta tags which negatively impacts sharing on social networksCurrently the CiviCRM Mailing, Public Page (ie. the page you use to read the email on-line) entirely bypass WordPress pages and are therefore rendered without website title, meta tags which negatively impacts sharing on social networks. ...Currently the CiviCRM Mailing, Public Page (ie. the page you use to read the email on-line) entirely bypass WordPress pages and are therefore rendered without website title, meta tags which negatively impacts sharing on social networks. See for example, https://civicrm.org/civicrm/mailing/view?reset=1&id=1686
If you share this page on a social network, it is expected by end users that you would see:
1. Organisation logo or at least a feature image
2. Short summary
3. Title of the newsletter
What you in fact see is very different. See for example https://developers.facebook.com/tools/debug/ using https://civicrm.org/civicrm/mailing/view?reset=1&id=1686
![screencapture-developers-facebook-tools-debug-2021-02-25-08_59_54](/uploads/d47e952a224080e34ad7d2ff08d99b3f/screencapture-developers-facebook-tools-debug-2021-02-25-08_59_54.png)
This is increasingly becoming a problem as CiviCRM sites re-share newsletters that they have recently sent out to their social networks.
The feature request is to provide a **Setting** which defines the **WordPress Page to be used to display the CiviCRM Mailing, Public Page** (ie. the page you use to read the email on-line). This is the same concept of the CiviCRM base page. On the CiviCRM Mailing page, a new shortcode would be present which is then used to render the public mailing.
The advantage of using a shortcode is that it then gives the website builder the ability to control how the page is presented, what metatags are used on that page and the template to be used for that page.
This is similar to the recent work to improve CiviCRM shortcode handling. See https://github.com/civicrm/civicrm-wordpress/pull/239 and https://lab.civicrm.org/dev/wordpress/-/issues/90
Ping @haystack and @kcristiano
Agileware Ref: CIVICRM-1662https://lab.civicrm.org/dev/wordpress/-/issues/81Synchronising WordPress Users and CiviCRM Contacts2020-11-24T15:11:13ZhaystackSynchronising WordPress Users and CiviCRM ContactsWhilst trying to clean up some logic in the CiviCRM-WordPress plugin I have come across a mismatch in how the CiviCRM-Drupal module and the CiviCRM-WordPress plugin synchronises the CMS User to the corresponding CiviCRM Contact. See [thi...Whilst trying to clean up some logic in the CiviCRM-WordPress plugin I have come across a mismatch in how the CiviCRM-Drupal module and the CiviCRM-WordPress plugin synchronises the CMS User to the corresponding CiviCRM Contact. See [this Mattermost thread](https://chat.civicrm.org/civicrm/pl/u95r1msnwinmdpne3kmjrwd8kh) for preliminary discussion.
There are currently two different types of call to `CRM_Core_BAO_UFMatch::synchronize()` happening:
1. In `CiviCRM_For_WordPress::initialize()` (set up the session)
2. In `CiviCRM_For_WordPress::invoke()` and `CiviCRM_For_WordPress_Users::sync_user()` (do a full User->Contact sync)
This is the reason for the behaviour that @totten identified and that I don't think should happen at that point, i.e.:
> If you access a `civicrm/*` page, then it autocreates a Contact.
As per the Mattermost discussion, it seems to me that the types of call should be:
1. In `CiviCRM_For_WordPress::initialize()` and `CiviCRM_For_WordPress::invoke()` (set up the session)
2. In `CiviCRM_For_WordPress_Users::sync_user()` (do a full User->Contact sync)
This pattern reverts the types of calls to their pre-4.6 state. My fault for the change back then :blush:
My proposal is to keep the calls to `CRM_Core_BAO_UFMatch::synchronize()` in both `CiviCRM_For_WordPress::initialize()` and `CiviCRM_For_WordPress::invoke()` but to make the calls indirectly via a new method in the `CiviCRM_For_WordPress_Users` class. The reason for this is that:
1. It is possible that some code calls `civi_wp()->initialize()`, `civicrm_wp_initialize()` or `civicrm_initialize()` before the WordPress User has been properly set up. I've seen this in the wild, though I can't remember where. When this happens, I don't think `CRM_Core_BAO_UFMatch::synchronize()` should be called. The `CiviCRM_For_WordPress_Users` class can keep track of the state of the WordPress User and make sure the call occurs only at the appropriate time.
2. If no calls have succeeded by the time `CiviCRM_For_WordPress::invoke()` runs, then `CRM_Core_BAO_UFMatch::synchronize()` will be called correctly when it's most definitely needed. The `CiviCRM_For_WordPress_Users` class will know if it's been called already.
I don't think this change will have any adverse effects (in fact it should have marginally beneficial effects by only calling `CRM_Core_BAO_UFMatch::synchronize()` when needed) but if anyone knows of code that expects Contacts to be created a `civicrm/*` page then shout here.haystackhaystackhttps://lab.civicrm.org/dev/wordpress/-/issues/45Apply for listing in WordPress directory2023-12-11T12:27:09Zjoshjosh@civicrm.orgApply for listing in WordPress directoryIssue to track progress and outstanding issues related to listing CiviCRM in WP directory.Issue to track progress and outstanding issues related to listing CiviCRM in WP directory.