A FIX to get ChimpExpress Compose screen working on Wordpress 3.9.1

More
10 years 2 months ago #195 by alexbfree
As many on here have commented, the Compose screens do not work on Wordpress 3.9.1. The Next button does nothing, and the WYSIWYG-ness of the editor is broken. Many have posted here and elsewhere about the bug but the plugin authors have apparently abandoned this plugin. Since there seems to be no other plugin like this that allows you to import posts into your MailChimp templates and create a campaign, I therefore decided to set about fixing the problem myself.

It turns out that the latest Wordpress uses a new editor, TinyMCE 4 (previously TinyMCE 3 was used, which is what ChimpExpress was built for). Unfortunately because ChimpExpress was not updated to cope with the changes between TinyMCE 3 and TinyMCE 4, it broke the plugin.

You can fix this yourself by editing the file:
Code:
/wp-content/plugins/chimpexpress/compose.php

There are two parts of the code to change.

First look for this part (line 142 for me):
Code:
complete: function() { jQuery('#ajaxLoader').hide(); //init quicktags quicktags({id : theEditorID}); // REQUIRED to show quick tags and fix tabs tinymce.execCommand('mceAddControl', true, theEditorID); // REQUIRED hack to fix editor created in AJAX }

and change it to:
Code:
complete: function() { jQuery('#ajaxLoader').hide(); window.tinymce.dom.Event.domLoaded = true; tinymce.init({selector:"#"+theEditorID, relative_urls:false, remove_script_host:false, convert_urls:false}); quicktags({id : theEditorID}); }

Now search for this part (Line 670 for me)
Code:
wp_editor($content, $id, array( 'tab_index' => '2', 'teeny' => false, 'textarea_rows' => $rows, 'media_buttons' => true, 'tinymce' => array( 'plugins' => 'inlinepopups, fullscreen, wordpress, wplink, wpdialogs' ) ));

and change it to:
Code:
wp_editor($content, $id, array( 'tab_index' => '2', 'teeny' => false, 'textarea_rows' => $rows, 'media_buttons' => true, 'textarea_name' => $id, 'tinymce' => array( 'selector' => "#".$id, 'plugins' => 'inlinepopups, fullscreen, wordpress, wplink, wpdialogs' ) ));

Now if you reload the compose screen, you should find that
  1. Your template loads correctly into the the WYSIWYG editor at each step (with images showing)
  2. The next button works
  3. Your post content inserts correctly into the editor.
  4. Your URLs are not modified to be relative (which doesn't work in MailChimp) and they stay as absolute URLs.
  5. Your data from each step gets correctly populated into a draft campaign in MailChimp and you can complete the wizard.

I make no guarantees but this worked for me. Hope you find it useful.

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #196 by favola
It worked great for me.

The editor is perfect, I am not able to insert media however? Any ideas?

This is probably unrelated but only my preheader content get send to mailchimp? Is there some field naming guide or something I overlooked?

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #197 by yannicks
Thanks!!

It worked, but only the bodytop got send. The bodybottom stays the same.

The media button doesn't work, but images which are included in posts will be added.
So the best thing to do is to create a post first and then select it in the "Insert content from blog post:"-dropdown menu.

Please Log in or Create an account to join the conversation.

Time to create page: 0.171 seconds