WordPress issueshttps://lab.civicrm.org/dev/wordpress/-/issues2023-12-06T21:29:55Zhttps://lab.civicrm.org/dev/wordpress/-/issues/99Support User Account properly for profiles2023-12-06T21:29:55ZJoeMurraySupport User Account properly for profilesCurrently, only Drupal properly implements the Used For options for Profiles. This issue chips away at the backlog for WordPress by proposing to properly support User Account.
1. Change the [x] option for User Account for all profiles s...Currently, only Drupal properly implements the Used For options for Profiles. This issue chips away at the backlog for WordPress by proposing to properly support User Account.
1. Change the [x] option for User Account for all profiles so that it is a checkbox widget.
1. If User Account is unchecked, do not change current behaviour of CiviCRM
1. If User Account is checked, expose the profile on wp-admin/user-edit.php?user_id=nnn and wp-admin/profile.php?user_id=nnn in an appropriate manner consistent with other plugin fields that are exposed. When Update Profile is clicked, validate the profile as appropriate for this form. Once the form is validated, save the field values as appropriate.
1. Create unit tests.JoeMurrayJoeMurrayhttps://lab.civicrm.org/dev/wordpress/-/issues/107WordPress basepage_render shouldn't remove the 'the_content' filter2023-07-26T15:45:51ZchriscantWordPress basepage_render shouldn't remove the 'the_content' filterOn a WordPress CiviCRM site using the Avada theme, removing the 'the_content' filter in basepage_render() in here causes a problem:
https://github.com/civicrm/civicrm-wordpress/blob/master/includes/civicrm.basepage.php
basepage_render()...On a WordPress CiviCRM site using the Avada theme, removing the 'the_content' filter in basepage_render() in here causes a problem:
https://github.com/civicrm/civicrm-wordpress/blob/master/includes/civicrm.basepage.php
basepage_render() is called from wp_trim_excerpt() first and then is called again somewhere to get the content to display the page. If the filter removes itself then the page content isn't replaced with the CiviCRM output.
When displaying /civicrm pages the holding page content is erroneously shown: "Do not delete this page. Page content is generated by CiviCRM."
So this commit needs reversing, which looks like it has only recently been included in 5.39.0:
https://github.com/civicrm/civicrm-wordpress/commit/16137ebf4038e901fb4981d7de2c328d96411fe9https://lab.civicrm.org/dev/wordpress/-/issues/136Unable to use do_shortcode from Template File2023-06-15T15:17:27ZMichael LabriolaUnable to use do_shortcode from Template FileI want to include an email signup form in the footer of my website using CiviCRM profiles. We are currently using a MailChimp signup form in the footer, so I think this is a reasonable thing to do.
I tried adding [civicrm component="pr...I want to include an email signup form in the footer of my website using CiviCRM profiles. We are currently using a MailChimp signup form in the footer, so I think this is a reasonable thing to do.
I tried adding [civicrm component="profile" gid="14" mode="create" hijack="0"] to my theme's footer template, but the shortcode did not get resolved.
I tried adding <?php echo do_shortcode('[civicrm component="profile" gid="14" mode="create" hijack="0"]'); ?> to my theme's footer template, but that did not work either.
Upon looking at the code, do_shortcode calls render_single($atts) in /includes/civicrm_shortcodes.php which calls invoke() in /civicrm.php which gives up if $this->is_page_request() && !in_the_loop() && !is_admin().
In order for do_shortcode to work at the point in time when it's being called the logic in invoke has to be changed to allow the invoke to complete.
I created a fork (since I don't think I have the ability to create a pull request) which modifies those two files: https://lab.civicrm.org/mhlabriola/wordpress
I created a parameter for invoke which can be specified in render_single that will allow do_shortcode to return the requested profile form.https://lab.civicrm.org/dev/wordpress/-/issues/2WordPress Version Update2023-01-25T14:59:09ZkcristianoWordPress Version UpdateCiviCRM files are set to 4.7 in the header blocks on:
- uninstall.php
- civicrm.php
- assets/templates/civicrm.shortcode.php
- includes/civicrm.shortcodes.php
- includes/civicrm.users.php
- includes/civicrm.shortcodes.modal.php
- includ...CiviCRM files are set to 4.7 in the header blocks on:
- uninstall.php
- civicrm.php
- assets/templates/civicrm.shortcode.php
- includes/civicrm.shortcodes.php
- includes/civicrm.users.php
- includes/civicrm.shortcodes.modal.php
- includes/civicrm.basepage.php
- wp-cli/civicrm.php
Is a PR in order or is there a better way to update?
Also
```
// set version here: when it changes, will force JS to reload
define( 'CIVICRM_PLUGIN_VERSION', '4.7' );
```
Needs updating - if a PR is in order we can include this change.https://lab.civicrm.org/dev/wordpress/-/issues/83Avoid direct use of wp_new_user_notification2021-10-10T15:18:15ZBradley TaylorAvoid direct use of wp_new_user_notificationI was taking a look at https://github.com/civicrm/civicrm-core/pull/18982/ and noticed that CiviCRM currently calls `wp_new_user_notification` directly. Whilst this is not considered a private function in WordPress, I do believe its not ...I was taking a look at https://github.com/civicrm/civicrm-core/pull/18982/ and noticed that CiviCRM currently calls `wp_new_user_notification` directly. Whilst this is not considered a private function in WordPress, I do believe its not best practice to call it directly.
## The problem
`wp_new_user_notification` is a very opinionated function. A text-only email is sent via `wp_mail` with fixed (albeit translatable) text.
Site owners may want to replace this functionality:
- To disable new-user emails altogether
- To send a branded HTML email
- To send the email via an email service provider (MailChimp, DotDigital etc)
On sites I work on, we frequently replace the wp_new_user_notification with a more heavily branded custom email using code similar to this:
```
remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
add_action( 'register_new_user', 'my_custom_new_user_notification' );
remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications' );
add_action( 'edit_user_created_user', 'my_custom_new_user_notification' );
```
(Note slightly different actions would be needed to fully handle a multisite context).
These actions can also be used to trigger other functionality unrelated to email notifications.
## The solution
I would like to propose that CiviCRM replaces its direct call to `wp_new_user_notification` with a `do_action()` call, allowing the notification to be unhooked or replaced. The question in my mind is what action should be used. The options are:
- `register_new_user`
- `edit_user_created_user`
- A new CiviCRM specific action. (The `wp_send_new_user_notifications` function would then need to be attached to this action with `add_action`)
I don't have a particular preference either way on this last point.https://lab.civicrm.org/dev/wordpress/-/issues/7Group Jobs2021-07-23T06:17:12ZGhost UserGroup JobsThis is a feature request to group jobs that have similar recommended frequency of call so the process of setting up jobs is less complex.This is a feature request to group jobs that have similar recommended frequency of call so the process of setting up jobs is less complex.https://lab.civicrm.org/dev/wordpress/-/issues/5Add documentation for shortcodes to help users while waiting for a CiviCRM bl...2021-07-23T06:17:12ZherbdoolAdd documentation for shortcodes to help users while waiting for a CiviCRM block for GutenbergIn the old editor there's a CiviCRM button for adding shortcodes. But in Gutenberg it'll need a different approach. People can add shortcodes but there's not info. I suggest at least adding documentation to help people. Even better if th...In the old editor there's a CiviCRM button for adding shortcodes. But in Gutenberg it'll need a different approach. People can add shortcodes but there's not info. I suggest at least adding documentation to help people. Even better if there's a way to add help text within Gutenberg.https://lab.civicrm.org/dev/wordpress/-/issues/62Contact image is broken2021-01-08T12:58:23ZandyburnsContact image is brokenI have reproduced on WP at https://demo.tadpole.cc/ and my install versions 5.26.2. It works on Drupal.
![image](/uploads/d0467024562f844eed2c3f63e0c0c9b1/image.png)
Reproduce:
1. Go to a contact summary screen > edit > upload contact ...I have reproduced on WP at https://demo.tadpole.cc/ and my install versions 5.26.2. It works on Drupal.
![image](/uploads/d0467024562f844eed2c3f63e0c0c9b1/image.png)
Reproduce:
1. Go to a contact summary screen > edit > upload contact image.
1. You'll see the contact image is broken.
1. If you try and navigate to the link (open in new window) it gives the WP error screen.
Link looks like: https://example.org/civicrm/?page=CiviCRM&q=civicrm%2Ffile&reset=1&filename=andy_2018_150x150_20b7648df6da2e1b694b25e5398ee2c7.jpg&mime-type=image/jpeg
Clean URL's are enabled. Note it is using ?page=CiviCRM not ?page=civiwp. The image is being loaded in the /wp-content/uploads/civicrm/custom directory. Images still show on a public profile directory.
WP error log is:
```
Warning: file_get_contents(/wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/node_modules/mime-db/db.json): failed to open stream: No such file or directory in /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/MimeDbRepository.php on line 36
Warning: array_values() expects parameter 1 to be array, null given in /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/MimeDbRepository.php on line 49
Warning: array_map(): Argument #2 should be an array in /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/MimeDbRepository.php on line 49
Warning: array_keys() expects parameter 1 to be array, null given in /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/MimeDbRepository.php on line 52
Warning: array_combine() expects parameter 1 to be array, null given in /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/MimeDbRepository.php on line 52
Fatal error: Uncaught TypeError: Argument 1 passed to MimeTyper\Repository\AbstractRepository::setFromMap() must be of the type array, null given, called in /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/MimeDbRepository.php on line 52 and defined in /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/AbstractRepository.php:18 Stack trace: #0 /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/MimeDbRepository.php(52): MimeTyper\Repository\AbstractRepository->setFromMap(NULL) #1 /wp-content/plugins/civicrm/civicrm/vendor/dflydev/apache-mime-types/src/Dflydev/ApacheMimeTypes/AbstractRepository.php(31): MimeTyper\Repository\MimeDbRepository->internalInit() #2 /wp-content/plugins/civicrm/civicrm/vendor/dflydev/apache-mime-types/src/Dflydev/ApacheMimeTypes/AbstractRepository.php(68): Dflydev\ApacheMimeTypes\AbstractRepository->init() #3 /wp-content/plug in /wp-content/plugins/civicrm/civicrm/vendor/adrienrn/php-mimetyper/src/Repository/AbstractRepository.php on line 18
```5.28.0https://lab.civicrm.org/dev/wordpress/-/issues/34WP_Debug breaks CiviCRM Menu Bar2020-08-31T02:52:23ZtommyboboWP_Debug breaks CiviCRM Menu BarTo replicate using most recent versions of WP and CiviCRM
1. Add define('WP_DEBUG', true); to wp-config.php
2. Refresh page on CiviCRM.
If a debugging message is present, it will be at the top of the page. This is breaking the Menu Ba...To replicate using most recent versions of WP and CiviCRM
1. Add define('WP_DEBUG', true); to wp-config.php
2. Refresh page on CiviCRM.
If a debugging message is present, it will be at the top of the page. This is breaking the Menu Bar JS. Here are the console errors.
> Error: CRM.url called before initialization Common.js:1481:31
> console https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/Common.js?r=2QOSS:1481
> url https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.ajax.js?r=2QOSS:19
> initialize https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:18
> <anonymous> https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:486
> <anonymous> https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:488
>
> SyntaxError: expected expression, got '<' admin.php:1
>
> TypeError: tplURL is undefined crm.ajax.js:26:15
> url https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.ajax.js?r=2QOSS:26
> initialize https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:18
> <anonymous> https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:486
> <anonymous> https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:488https://lab.civicrm.org/dev/wordpress/-/issues/67Slow down the frequency of WordPress "heartbeat" calls in CiviCRM admin2020-08-06T21:22:49ZhaystackSlow down the frequency of WordPress "heartbeat" calls in CiviCRM adminHeartbeat is important to WordPress for a number of tasks - e.g. checking continued authentication whilst on a page and implementing edit locks on post/page edit screens - but it is less important on CiviCRM admin pages and consumes serv...Heartbeat is important to WordPress for a number of tasks - e.g. checking continued authentication whilst on a page and implementing edit locks on post/page edit screens - but it is less important on CiviCRM admin pages and consumes server resources. Reducing the frequency of calls minimises the impact on servers and can make CiviCRM admin pages more responsive.
PR here: https://github.com/civicrm/civicrm-wordpress/pull/214haystackhaystackhttps://lab.civicrm.org/dev/wordpress/-/issues/64Prevent session from starting during WordPress pseudo cron procedures2020-08-06T21:22:28ZhaystackPrevent session from starting during WordPress pseudo cron proceduresThe `wp-cron.php` route triggers warnings:
```
[18-Jul-2020 05:54:32 UTC] PHP Warning: session_start(): Cannot start session when headers already sent in /path/to/wp-content/plugins/civicrm/civicrm.php on line 371
```
There's no need ...The `wp-cron.php` route triggers warnings:
```
[18-Jul-2020 05:54:32 UTC] PHP Warning: session_start(): Cannot start session when headers already sent in /path/to/wp-content/plugins/civicrm/civicrm.php on line 371
```
There's no need to start the session when running WordPress pseudo-cron.
[Related issue in Core](https://lab.civicrm.org/dev/core/-/issues/1889).
PR here: https://github.com/civicrm/civicrm-wordpress/pull/210/fileshaystackhaystackhttps://lab.civicrm.org/dev/wordpress/-/issues/29WordPress different error_reporting level to Drupal / Backdrop2020-08-06T21:22:04ZseamusleeWordPress different error_reporting level to Drupal / BackdropJust putting this here
We are currently having an E2E failure on WordPress v Backdrop / Drupal. The E2E test is specifcally looking at trying to load an invalid asset builder URL and is finding that it is not returning empty, i.e. there...Just putting this here
We are currently having an E2E failure on WordPress v Backdrop / Drupal. The E2E test is specifcally looking at trying to load an invalid asset builder URL and is finding that it is not returning empty, i.e. there is some content coming back when using file_get_contents
WordPress runs generally with the following error_reporting levels
```
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
```
Where as Drupal / Backdrop run as just E_CORE_ERROR iirc
I have proposed 2 sets of fixes for the test
1. Using Guzzle in the test https://github.com/civicrm/civicrm-core/pull/14201
2. overriding the error_reporting level https://github.com/civicrm/civicrm-core/pull/14212
However in both cases that doesn't feel brilliant because we are essentially hiding away the issue that WordPress by default is returning different content to that in Drupal and Backdrop for the same situation (calling an invalid URL)
I tried altering the error_reporting in the part of Civi Code that actualy manages the asset Builder urls but it seemed to not do anything.
Any thoughts?
ping @totten @kcristiano @haystackhttps://lab.civicrm.org/dev/wordpress/-/issues/19Bug with WordPress CiviCRM 5.10.3 Remote Profiles HTML Form Snippet Form Acti...2020-06-17T09:07:23ZjohngehrigBug with WordPress CiviCRM 5.10.3 Remote Profiles HTML Form Snippet Form Action URLVersion: CiviCRM 5.10.3
Type: Bug
CMS: WordPress
With the update to CiviCRM 5.10.3, I noticed the form action URL in the HTML Form Snippet generated for Remote Profile submissions has changed, breaking the form submission functionalit...Version: CiviCRM 5.10.3
Type: Bug
CMS: WordPress
With the update to CiviCRM 5.10.3, I noticed the form action URL in the HTML Form Snippet generated for Remote Profile submissions has changed, breaking the form submission functionality for anonymous users with all newly generated HTML Form Snippets.
**This is the first time I have noticed this bug, which was definitely introduced sometime after version CiviCRM 5.7.2, the last time I generated an HTML Form Snippet that was used with a Remote Profile.**
Previously, the HTML Form Snippet generated code with a form action URL that posted to the "create profile" URL, allowing form submissions from anonymous users:
`<form action="https://wpmaster.demo.civicrm.org/civicrm/?page=CiviCRM&q=civicrm%2Fprofile%2Fcreate" method="post" name="Edit" id="Edit" class="CRM_Profile_Form_Edit" >`
After the update, the code generated by the HTML Form Snippet includes a form action URL that posts to the default "admin group":
`<form action="https://wpmaster.demo.civicrm.org/civicrm/?page=CiviCRM&q=civicrm%2Fadmin%2Fuf%2Fgroup" method="post" name="Edit" id="Edit" class="CRM_Profile_Form_Edit" >`
With the above form action URL, anonymous user see the following error when the user clicks the "Submit" button:
> You do not have permission to access this content.
Manually changing the code in the HTML Form Snippet to use a form action URL with the previous "create profile" version restores the functionality.
This bug is specifically related to the generate HTML Form Snippet code as Profiles work properly for anonymous users when inserted using the "Add CiviCRM Public Pages" button within WordPress, which inserts the code that includes the correct "create profile" form action URL.
I tested both WordPress and Drupal 7 demo sites and was able to replicate the bug with ONLY the WordPress demo site:
https://wpmaster.demo.civicrm.org/
https://dmaster.demo.civicrm.org/
----
Steps to Reproduce Bug with WordPress CiviCRM 5.10.3+:
Login
CiviCRM > Administer > System Settings > Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)
For the "Accept profile submissions from external sites" option, select "Yes" and then click "Save"
Administer > Custom Data and Screens > Profiles
For any Profile, generate the code by clicking: more > HTML Form Snippet
The code generated by the updated version includes a "post" action URL to the "admin group"https://lab.civicrm.org/dev/wordpress/-/issues/17CiviCRM shortcode button not working if pop ups are off in display settings2020-06-17T09:07:23ZkcristianoCiviCRM shortcode button not working if pop ups are off in display settingsIf pop Ups are disabled in [Display preferences](https://wpmaster.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fpreferences%2Fdisplay&reset=1) the CiviCRM shortcode button does not render properly.
![ima...If pop Ups are disabled in [Display preferences](https://wpmaster.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fpreferences%2Fdisplay&reset=1) the CiviCRM shortcode button does not render properly.
![image](/uploads/1160b5a86a17a46fa073b40cb359801b/image.png)
This is the result:
![image](/uploads/6145a145d06561a9dfe5f2bfec65b038/image.png)
Instead of:
![image](/uploads/f915b8bbf5b7f1a19e8232023d42333b/image.png)
[Discussed in Mattermost](https://chat.civicrm.org/civicrm/pl/bj65j3gyi3by9e4yd94t6h3mjr)
cc @haystackhttps://lab.civicrm.org/dev/wordpress/-/issues/15Payment Options not showing when there are two options2020-06-17T09:07:23ZryeradioPayment Options not showing when there are two optionsI have two payment processors set up in Civi. When I am logged in as admin and go to my donate form I see the fieldset "Payment options" (one is for credit card and one is for electronic check). Everything works as expected until I am n...I have two payment processors set up in Civi. When I am logged in as admin and go to my donate form I see the fieldset "Payment options" (one is for credit card and one is for electronic check). Everything works as expected until I am not logged in as admin. When I am not logged in as Admin I only see the default payment processor which is the credit card. I made sure all of the contribution permissions are set for an anonymous user. There is something preventing the "Payment Options" fieldset to show for non-admin users.
I see the fieldset when I debug the page. It is called "crm-group payment-options-group" and it is set to display="None"
Here is the test link I am using: https://aflbs.org/test-donate
I am using Wordpress 4.9, Civi 5.7.2 and I am using a Civi contribution form.https://lab.civicrm.org/dev/wordpress/-/issues/12A civicrm shortcode for a contribution page on the homepage results in a "Too...2020-06-17T09:07:22ZalicefruminA civicrm shortcode for a contribution page on the homepage results in a "Too many redirects" error instead of the thank you pageIf one puts a CiviCRM short code for a contribution page on the home page of their site like in the screenshot below (no basepage just wpv560.localhost):
![shortcode on the homepage](/uploads/d2dc6d1e36d9040c7656cc951f765358/homepage.pn...If one puts a CiviCRM short code for a contribution page on the home page of their site like in the screenshot below (no basepage just wpv560.localhost):
![shortcode on the homepage](/uploads/d2dc6d1e36d9040c7656cc951f765358/homepage.png)
When creating a contribution thru this form, the user can submit the form, confirm the contribution on the confirmation form and the contribution does go thru and get recorded to civi HOWEVER, instead of being taken to the Thank you page, the user receives a "Too Many Redirects" error like below:
![tooManyRedirect error](/uploads/e32ac1b768679c720ef3cf5cf88f0de8/tooManyRedirectErros.png)5.8https://lab.civicrm.org/dev/wordpress/-/issues/9Use WP Cron for CiviCRM Jobs on WP2020-06-17T09:07:22ZGhost UserUse WP Cron for CiviCRM Jobs on WPUse WP Cron for CiviCRM Jobs on WPUse WP Cron for CiviCRM Jobs on WPhttps://lab.civicrm.org/dev/wordpress/-/issues/36REST API calls using json param do not work in Wordpress context --backslashe...2020-06-06T12:56:59ZeileenREST API calls using json param do not work in Wordpress context --backslashes are addedThere is a long discussion on this on this PR but the approach still appears to be unresolved. I have closed the PR to track through gitlab
https://github.com/civicrm/civicrm-core/pull/12813
---
The issue:
When CiviCRM receives an API...There is a long discussion on this on this PR but the approach still appears to be unresolved. I have closed the PR to track through gitlab
https://github.com/civicrm/civicrm-core/pull/12813
---
The issue:
When CiviCRM receives an API request through `extern/rest.php` with a `json` parameter, and the CMS is WordPress, an error will result.
This is because Civi bootstraps WordPress to authenticate the API user, and WordPress escapes all quotation marks in `$_POST` variables whether or not PHP's `magic_quotes_gpc` is enabled. CiviCRM is not expecting an escaped string, and JSON decoding fails due to the extra backslashes. See `wp_magic_quotes()` which is called by `wp-settings.php` during bootstrap.https://lab.civicrm.org/dev/wordpress/-/issues/8Feature Request: Add AJAX Job Running2020-03-20T13:07:14ZGhost UserFeature Request: Add AJAX Job RunningOther OSS Projects like OwnCloud support AJAX based http job processes it would be nice if CiviCRM could add this for atleast some of the job as setting up 15 cron jobs or WPI CLI calls is a lot especially with how much time already goes...Other OSS Projects like OwnCloud support AJAX based http job processes it would be nice if CiviCRM could add this for atleast some of the job as setting up 15 cron jobs or WPI CLI calls is a lot especially with how much time already goes into configuring and maintaining CiviCRM