0

After upgrading from CiviCRM 5.50.1 to 5.59.3 on WordPress 6.0 I am receiving a CiviCRM System Status page warning "Wordpress Permalinks cache needs to be refreshed." Following the link to click "Save" on the Wordpress permalinks page and clicking "Save" doesn't resolve the problem.

Other than clicking the Hide button on the warning, is there another way of resolving this?

2 Answers 2

3

A minor tweak to the CiviCRM settings.php files fixed the problem on my sites. Here's what I found:

CiviCRM checks the url of active contribution pages to be sure they can be accesed, and if one can't be loaded, assumes that the problem is the wordpress permalink cache. I inserted a little test code on my development server and discovered CiviCRM was actually testing the wrong url for the contribution pages. For example, CiviCRM was checking http://wvecouncil.org/wp/civicrm/contribute/transact/?reset=1&id=1, but the page is actually at http://wvecouncil.org/civicrm/contribute/transact/?reset=1&id=1 (the WordPress subdirectory is in the test url but not the working url).

A few years ago CiviCRM changed how it dealt with front-end urls in WordPress, which eliminated the WordPress subdirectory from the CiviCRM user-front-end url (at least for wp sites configured not to include the wordpress subdirectory in post and page urls). After the change CiviCRM apparently no longer uses the constant named ‘CIVICRM_UF_BASEURL’ when constructing the urls for contribution pages (the urls shown in ‘links’ for a contribution page). But the code now checking whether contribution pages can be loaded is using the CIVICRM_UF_BASEURL constant from settings.php to construct the test url. If the constant has not been updated since the change, contribution pages will not load during the test, causing the permalink cache warning.

In the case of wvecouncil. org, changing

define( 'CIVICRM_UF_BASEURL' , 'https://wvecouncil.org/wp/');

in settings.php to

define( 'CIVICRM_UF_BASEURL' , 'https://wvecouncil.org/');

cleared the permalink cache warning. Since this constant being a bit off never caused a problem until recently, I suspect that none of the components enabled on my sites were referencing CIVICRM_UF_BASEURL until relatively recently when the contribution page tests were added to CiviCRM.

0

(Note: I probably should have posted this as a comment rather than an answer, but will leave it since there are relevant comments. My other answer contains a solution).

I manage 3 sites running CiviCRM, all on the same host. After updating to version 5.60.0, two sites have this problem while one does not (the same is true on a development server running on my laptop).

The site not warning about the Permalinks cache problem is not running the CiviContribut component. When I temporarily disable CiviContribute on the other sites the warning no longer appears, so the errant warning seems to be related to the CiviContribute component.

4
  • I'm on WordPress 6.2 with CiviCRM 5.60.0 and CiviContribute activated, so there is probably another factor in play as I'm not seeing this issue.
    – kapn
    Apr 14, 2023 at 13:22
  • I wonder if you've configured any 'active' donation pages? I can enable CiviContribute on a site not showing the permalink warning and still not see the warning, but if I configure the 'Title and Settings' of a contribution page I see the permalink warning when I refresh the status page (other parts of a contribution page do not have to be configured for the warning to appear). I note that if the 'Is this Online Contribution Page Active?' checkbox is unchecked that the permalink warning goes away. Apr 15, 2023 at 15:45
  • Yes, I do have active donation pages on all those sites. Sorry I can't be more helpful.
    – kapn
    Apr 19, 2023 at 19:50
  • 1
    Actually, your comment helped encourage me to look deeper for something more specific to my sites. The problem turned out to be a constant in the settings file that needed to be updated (details in my other answer). Apr 20, 2023 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.