Update INN/wordpress-mailchimp-tools submodule, and diverse other updates#139
Update INN/wordpress-mailchimp-tools submodule, and diverse other updates#139
Conversation
|
@kaylima assigning this to you for several tasks:
|
|
The WordPress Mailchimp API submodule https://bitbucket.org/mailchimp/mailchimp-api-php hasn't been updated since 2015. The Mailchimp API settings block seen in https://github.com/INN/link-roundups/blob/136-update-wordpress-mailchimp-tools/docs/mailchimp.md isn't appearing, in my specific install, at this time. This appears to be because my install lacks the entire Next steps:
|
|
Correction: the MailChimp settings page is no longer in Link Roundups > Options; it's in Settings > MailChimp Settings. This is true of both the pure-git-clone branch and the wp-release.zip install above. Edited 2019-05-02 to add: This, too, was caused by 675a1631f85cb056ca183206749e1cf60b9bc498's removal of a lot of code into the INN/wordpress-mailchimp-tools module |
|
After enabling the MailChimp API key in the |
|
The timing-out page doesn't come from this plugin directly; it's generated by the WordPress MailChimp Tools: I'm guessing this is because the API query to get the list of campaigns, which runs on every fetch of the page, is timing out: |
|
The Mailchimp Tools Settings Page only displays 10 templates; the account I'm testing with has more than 10.
|
|
…admin settings page's list of templates: 100, sorted by name For INN/link-roundups#139 (comment)
|
So it looks like 675a163 removed this bit by removing the entire function _lroundups_render_mailchimp_template( $source, $post ) {
$author = get_user_by( 'id', $post->post_author );
$tags = array(
'*|ROUNDUPLINKS|*' => apply_filters( 'the_content', $post->post_content ),
'*|ROUNDUPTITLE|*' => $post->post_title,
'*|ROUNDUPAUTHOR|*' => $author->display_name,
'*|ROUNDUPDATE|*' => get_the_date( '',$post->ID ),
'*|ROUNDUPPERMALINK|*' => get_post_permalink( $post->ID )
);
foreach ( $tags as $tag => $value )
$source = str_replace( $tag, $value, $source );
return $source;
}That commit just outright removed the file, and the file doesn't appear to have been replaced. Nor was the functionality in there. That was release v0.4. I remember us having bug reports about it, but I can't find an issue for it. |
|
In https://secure.helpscout.net/conversation/573233977/1940?folderId=1259183 on May 30, 2018:
|
|
#146 should be fixable by re-adding that removed function. What's not clear there yet is:
|
|
The removed function was applied here: /**
* Replace the template tags in the MailChimp post
*/
$html = _lroundups_render_mailchimp_template( $template_info['source'], $post );
$campaign_content = array(
'html' => $html, // the content!
'text' => '' // Leave blank for the auto-generated text content
);The analogous functionality in the current WP MC Tools is: But there's no way to configure the parameters that are set on that email. So:
|
|
It is currently creating the email, but entirely replacing the content of the email with the Right now it's using a drag-and-drop template with a block that contains the following: This should be the roundup title:
<section mc:edit="ROUNDUPTITLE">This should be replaced with the roundup title</section>
This should be the roundup author:
<section mc:edit="ROUNDUPAUTHOR">This should be replaced with the roundup author</section>
This should be the roundup date:
<section mc:edit="ROUNDUPDATE">This should be replaced with the roundup date</section>
This should be the roundup links:
<section mc:edit="ROUNDUPLINKS">This should be replaced with the roundup links</section>
This should be the roundup permalink:
<section mc:edit="ROUNDUPPERMALINK">This should be replaced with the roundup permalink</section>
<hr />
<h1 style="text-align: center;">*|ROUNDUPTITLE|*</h1>
<p><em>*|ROUNDUPAUTHOR|* — *|ROUNDUPDATE|*</em></p>
*|ROUNDUPLINKS|*
<p>Originally posted at *|ROUNDUPPERMALINK|*</p> |
|
It's not possible to get the whole default content of a template via the API. The closest thing is https://developer.mailchimp.com/documentation/mailchimp/reference/templates/default-content/, which returns the default content of the various editable areas defined in the template, but not the whole body content of the campaign. Therefore, the approach taken in the previous version of the WordPress MailChimp Tools to set the $html parameter to the post content will not work for the Link Roundup Plugin's purposes. The filter introduced in INN/wordpress-mailchimp-tools@4e768f7 will have to be used to set the HTML parameter on the campaign content, if the user of the WMT package desires to have that set. Because the whole content cannot be accessed, the idea of filtering that content for the various merge tags in this plugin to do a search and replace for this plugin's desired content output is no longer valid.
|
… lowercase in accordance with MailChimp's practice.
|
Consolidating earlier checklists:
|
|
|
🎉 Next step: Someone please test that this works for them. |
…-to-be-linked Allow Link Roundups widget to have a linked title

Changes
This PR merges the last couple year's work from the WordPress Mailchimp Tools repo into this plugin. Resolves #136
Notable change from https://github.com/INN/wordpress-mailchimp-tools/commits/master:
Also:
Source:label in the Saved Links List widget in aspan.source-label, resolves Use separate markup for thesource:text in the Saved Links widget's p.source #144release.shand adds maintainer docs, resolves Make sure release.sh.md is up to date #140Tested up to:to 5.2 and adds a minimum PHP version, resolves WordPress.org metadata improvements #134Testing
Can these steps still be followed? https://github.com/INN/link-roundups/blob/master/docs/mailchimp.md
Why
To address several PHP errors and notices in the WordPress MailChimp Tools.
To support the new version of the MailChimp API, introduced in 2017: https://mailchi.mp/f2bbb62b3016/were-shutting-down-api-11-12-and-13