ContactForm7 prevents migrating to CC

Hi,
Finally I can post questions here on the forum. ContactForm7 is a very important plug-in for me since it is installed in at least 12 sites that I need to migrate from WP to ClassicPress.

However each time it gives a 500 error or whitescreen of death. After disabling all plugins, I discovered that it is CF7 that is preventing me to migrate.

Please help. Is there a way to keep using cf7 after migrating and if so: how?

Thank you

2 Likes

Hello @essence and welcome to ClassicPress!

Unfortunately, later versions of CF7 require WordPress 5+ and as you may know, ClassicPress is based on WordPress 4.9.

The most recent version of CF7 to be compatible with WP 4.9 is version 5.1.9 which you can download from here https://downloads.wordpress.org/plugin/contact-form-7.5.1.9.zip.

I would suggest the following:

Take a backup of the contact-form-7 folder of your website. Download the above zip file, extract it to a local drive and then replace all files in the contact-form-7 folder with the files just downloaded. This will downgrade your CF7 installation to version 5.1.9 which should work perfectly well with ClassicPress.

An alternative method is to use the WP Rollback plugin.

Let us know if you have any problems.

3 Likes

Hi and thank you for your help. That did the trick. However, on many of the sites the theme is also the problem. After resolving this CF7 hurdle, it now seems that the theme can’t handle ClassicPress.

It’s the Prostyler Theme from Yunus and Michael Formby. And they haven’t updated their 3.5 thousand members yet with a solution in the form of an update. So like many of us, I am still in problems with many of these sites that don’t function in both Classic Press and WP 5.6.

Kind regards

I’m preparing a fork (which I gonna call CF 8, because of its history, which I am WELL aware of, having been around when there still was a CF 2 and 3 :smiley: ).

Currently testing which versions above 5.1.9 are ACTUALLY still compatible with CP - testing with CP 1.2.

cu, w0lf.

3 Likes

I have 5.2.2 on a CP site all seems to work ok. i.e. I get a message if someone uses the form and form creation works as well.
Although I do have this message on the backend Contact page
“Contact Form 7 5.2.2 requires WordPress 5.3 or higher. Please update WordPress first.”

I think the workaround is to just comment out the line in contact-form-7/load.php which includes the block editor component, which seems to be around since CF 7 5.3 (includes/block-editor/block-editor.php).

For CF 7 v5.3.2 this would be line 21.

cu, w0lf.

I agree, i’ve successfully tested this by manually installing CF 7 v5.2.2.

To get rid of the message, you just have to change the constant WPCF7_REQUIRED_WP_VERSION to 4.9 in the main plugin loading file, ie. contact-form-7/wp-contact-form-7.php.

cu, w0lf.

1 Like

Yes I have done that on a few plugins. I had not on this one as having the message reminded me not to update the plugin further

See my previous reply to tyn - you essentially have to additionally comment out one line in the load.php file, and be done with it :slight_smile:

cu, w0lf.

@fwolf would you like to make this a CP research project?

We’d give it a home in the ClassicPress Research GitHub repo and give it a new name such as “Classic Contact Form”, alongside Classic Commerce and Classic SEO.

I’d already discussed forking CF7 with James before you mentioned this so it is certainly on our radar.

2 Likes

Sure, lets do that :slight_smile:
I’ve already started working on the code, called it Contact Form 8 (but we could go with Classic Form or so as well), did a few tests and did the described changes to make it work with CP again.

cu, w0lf.

1 Like

Let me know if you want testing assistance.

1 Like

Classic Form…I like it; it sounds very “classy” to my ears :joy:

2 Likes

Great! :+1:t3:

Can you let me have the URL to your GitHub repo please. And, can you give me (@timbocode) full admin rights to that repo so that I can transfer it to research.

EDIT

I’ve created the following repo, so it’s all good to go. To confirm what I’ve said elsewhere, I’d like version 1 to be little more than refactoring and I’ve created a few issues to get started.

EDIT 2

Repo is now at:

2 Likes

As a CP research project, you can help in any way you’re able to. The code will need refactoring for one thing and that’s the area I think we need to focus on first.

What I’d like to see for version 1 is little more than a “re-badged” version of CF7 5.1.9 (plus recent security patch) so it should, in theory, be a relatively painless job.

We can then look at improving / removing / adding in later versions.

1 Like

Perfect … guess I do a fork to my account, then incorporate my (simple) adaptions and then add a pull request with the changes from my fork?

I’ve just called it CF 8, while retaining all pre-existing version numbers … but could also just call it Classic Contact Form 7 for now.

The CF8 relable thingy is, because CF 7 really came to be like this - in the early history of WP there were several (rather successful) contact form plugins with the fancy titles “Contact Form”, “Contact Form 2”, “Contact Form 3” and so on. Each one taking the best bits or whatever their author(s) considered to be useful and incorporating it into the new plugin. At some point, CF 7 was the only one that remained … hence my idea calling it CF 8 later on. Could do it similar to ClassicPress, ie. internally keeping the version numbers of CF 7 5.3.x, and enhancing it with own version strings / numbers and functions / methods for potentially supporting CF 7 / CF 8 add-ons.

Maybe when starting to do actual changes, eg. adding a less complicated way of parsing the CF 7 short tags / patterns.

Cause that is the main PITA for beginners but also professional users - you always have to stick to the patterns and try multiple times, rearranging things, when the field you wanted to add clearly does not work like it should.

I am aware of the efforts of establishing a secondary short code system just for CF 7, eg. using double square brackets (a la[[my_tag]]), but it could easily be just a less strict shortcode pattern or just a bit more logical one (eg. class:"class-name1 class-name2" instead of having to wonder whether class:my-cllass classname2 is actually gonna work or not) and so on …

cu, w0lf.

2 Likes

CF8 = Classic Forms 8 (my proposal).

And people that were there early days will know about the backstory to the name and our way of “honouring” it will please the community because it’s a way of paying back to the devs who where before.

And it can be CF8 version x.x.x (the 7 wasn’t a version number in CF7, so why should the 8 be?).

1 Like

Yup, sounds about right. Could you do one PR for each issue rather than bundle everything into one big one. It’s easier to manage.

As for the plugin name. I’d like to retain the “Classic” prefix to keep it in the family, so Classic Forms would work well.

@ElisabettaCarrara’s compromise of Classic Forms 8 is also a possibility.

So I think the name has to be either Classic Forms or Classic Forms 8. My personal preference is for the former but I’m open to suggestions.

The version number should begin at 1.0.0 as we’ve done with CC and CPSEO.

Just to confirm, the fork is from version 5.1.9 of CF7.

Looking forward to it!

From branding perspective, CF8 is the best option. Fits both - Contact Forms (usable for WP 4.9 users) and Classic Forms. And respect to the history.

4 Likes

No, its straight forward from 5.3.2 - which works flawlessly in CP 1.2, but only with the before-mentioned modifactions. This ensures a) latest security issues fixed (the one that broke it for CP 1.2 + WP 4.9.x) and b) as much as compatible to the main branch as possible.

cu, w0lf.

1 Like