I have had FORCE_SSL_ADMIN set for quite awhile now in my wp-config.php file which forces all traffic to /wp-admin/ to be HTTPS. When I initially configured this setting it broke numerous WordPress plugins which I fixed however I missed MM-Forms being broken. The issue was the exact same as previous plugins that had the issue so it wasn’t to hard to fix but I wanted to share in case anyone else is having trouble getting the MM-Forms plugin working over SSL. Below I will explain what lines need to be changed to get MM-Forms working over HTTPS including syntax, line numbers, and old code.
Modify MM-Forms To Work Over HTTPS With FORCE_SSL_ADMIN:
All of the below changes are made to the mm-forms.php file located in the “wp-root/wp-content/plugins/mm-forms/” directory.
- First MM-Forms Code Modification: Modify line 416 of mm-forms.php changing the below PHP code.
Old mm-forms.php Line 416:
- $base_url = get_option('siteurl') . '/wp-admin/options-general.php';
New mm-forms.php Line 416:
- $base_url = admin_url("/options-general.php");
- Second MM-Forms Code Modification: Modify line 574 of mm-forms.php changing the below PHP code.
Old mm-forms.php Line 574:
- $base_url = get_option('siteurl') . '/wp-admin/options-general.php';
New mm-forms.php Line 574:
- $base_url = admin_url("/options-general.php");
- Third MM-Forms Code Modification: Modify line 1536 of mm-forms.php changing the below PHP code.
Old mm-forms.php Line 1536:
- echo "<th style='font-weight:normal;' scope='col'><a href='" . get_bloginfo('url') . "/wp-admin/options-general.php?page=mm-forms/mm-forms.php&action=viewDetail&id=" . $res->fk_form_joiner_id . "'><img src='" . get_bloginfo('url') . "/wp-content/plugins/mm-forms/images/view.png' /></a></th></tr>";
New mm-forms.php Line 1536:
- echo "<th style='font-weight:normal;' scope='col'><a href='" . admin_url("/options-general.php?page=mm-forms/mm-forms.php&action=viewDetail&id=") . $res->fk_form_joiner_id . "'><img src='" . get_bloginfo('url') . "/wp-content/plugins/mm-forms/images/view.png' /></a></th></tr>";
- Verify MM-Forms Over SSL: Now verify that MM-Forms is working properly over HTTPS. If you are able to save new forms then MM-Forms is functioning properly again.
This can happen with many plugins that haven’t been updated in awhile since the get_bloginfo(‘url’) was a popular variable that was changed to admin_url(‘shorter_url’). MM-Forms is a great forms plugin so if you are not currently using it I recommend it as the best contact form package available on WordPress.