Installation of approved plugin (Contact Form 7) fails

If you try to install a plugin from the “Approved plugins” section - Contact Form 7 in this particular case - you’ll get “Error encountered”. Clicking on “Details” reveals “Download failed. A valid URL was not provided.”

In X_TGMPA_Integration::install_plugin(), there’s this line:
$result = $upgrader->install( $plugin_data['source'] );

$plugin_data['source'] is "repo" at this point. WordPress treats "repo" as an URL, tries downloading it and subsequently fails doing so.

X theme 6.5.6

Hello @envato_2015,

Thanks for writing in!

Please try installing the Contact Form 7 plugin from Plugins > Add new and see how it goes. Please refer following post for some more information.

In case issue is still there, please try to manually install Contact Form 7 by downloading the plugin from WordPress plugin section. After that under Plugins > Add New > Upload Plugin select the zip file and upload the plugin. You can download the plugin from following source.

Even if manual install is not working, please share website login details in secure note for us to take a closer look.

Thanks.

Hi and thanks for your fast response!

I can install Contact Form 7 e. g. using the bulk extension manager so this post was meant as a bug report.

This bug occurs if you try to install an approved plugin simply by clicking the Install button on /wp-admin/admin.php?page=x-addons-home. Go try yourself and see how it goes.

I didn’t fully debug this but somewhere in between 5.1.0 and 5.2.5 the package url got removed from approved-plugins.php. This potentially has something to do with this bug.

Hi @envato_2015,

The approved plugins section of the X > Validation or Pro > Validation page is using the latest repository of the respective plugin in wordpress.org. There is no separate linking or URL redirection. I just checked the case on my local installation, and by merely clicking the install button of the Contact Form 7 in the validation page it is installed, and I could activate that successfully.

My Pro theme installation is version 2.5.5. I’d suggest that you check the connection and cURL the stability of your server and ask them if they allow accessing external links with cURL.

This seems to be only happening for you as if it was not this forum would be flooded with the reports that the install button of the Contact Form 7 is not working in the validation page.

Thank you for your understanding and for taking the time to report this case.

This is getting really strange then. Can you post the contact-form-7 section from wp-content/themes/x/framework/data/approved-plugins.php to verify? Maybe my copy is corrupted, downloaded it from ThemeForest a few weeks ago.

Some more observations:

Installation via bulk extension manager calls method TGM_Plugin_Activation::get_download_url() where 'repo' is converted to the actual download url of the plugin. This step is missing from installation via validation page, the code simply passes 'repo' to Plugin_Upgrader::install().

This may be an issue specific to x.5.6 (manual installation with download from ThemeForest) since @christopher.amirian claims he doesn’t experience this bug using Pro 2.5.5.

Hello @envato_2015,

Thanks for updating the thread.

I tested the installation of Contact Form 7 plugin from the extension manager of X Theme and installation and activation worked fine without any issues.

I tried checking the website that’s listed on the licence manager but it’s asking of site login details. As mentioned in the latest reply that you have X 5.6, unfortunately I don’t have X 5.6 version so I am unable to test the same. Please try updating the same and see if you are able to install the Contact Form 7 plugin from Plugin Manager.

You can view the contents of approved-plugins.php file using following Dropbox link:

Thanks.

Thank you for your immediate response!

To clear things up again: I’m using X 6.5.6, not 5.6, lowercase x was meant as a placeholder, sorry for that. The installation in question only has X and Cornerstone installed and activated.

This might be an issue specific to X 6.5.6 which as far as I know is only available as a manual download from ThemeForest. I downloaded the package (“installable wordpress file only”) at about May 25th. Just redownloaded and it’s still the same file. It would be great if someone who has access to such an instance can check if this bug is reproducible. Any other relevant testing already has been done.

The issue ONLY occurs when clicking “Install” for any of the approved plugins on the validation page. Installing plugins - even the approved ones - otherwise works perfectly.

I further investigated this by stepping through the code: the key difference between installing a plugin via e.g. bulk extension manager (working) and by clicking “Install” on the validation page (not working) is that method TGM_Plugin_Activation::get_download_url() is not called from the ajax installation routine. This results in the string literal repo being handed over as the actual download url and that will finally cause this error.

Hello @envato_2015,

We will try to replicate the issue in our local testing servers and investigate this further.

Meanwhile, to save you time in installing the Contact Form 7, simply go to WP Admin > Plugins > Add New and then search for Contact Form 7. This will be using the WordPress plugin installer downloaded from the WordPress plugin repository.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.