Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails on PHP 8.0 #803

Open
BadScooter1980 opened this issue Apr 21, 2021 · 23 comments
Open

Fails on PHP 8.0 #803

BadScooter1980 opened this issue Apr 21, 2021 · 23 comments

Comments

@BadScooter1980
Copy link

Has anybody else noticed this gives a critical error on PHP 8.0?

It allows the first plugin to be installed (irregardless of if it is local or on a repository) and then gives a critical error.

Rolling back to PHP 7.4 it works just fine.

@jrfnl
Copy link
Contributor

jrfnl commented Apr 21, 2021

@BadScooter1980 Could you provide more information and a backtrace of the error you are receiving. TGMPA uses WP Core under the hood, so it will need to be determined whether this is an issue with WP Core or with TGMPA.

@BadScooter1980
Copy link
Author

@jrfnl Thanks for your reply. I'm not really sure what is causing this but have just setup another test on PHP 8.0 and upon attempting to install recommended plugins, I get the following message;

`Install Required Plugins
The installation process is starting. This process may take a while on some hosts, so please be patient.

Installing Plugin Advanced Custom Fields PRO (1/5)
There has been a critical error on this website. Please check your site admin email inbox for instructions.

Learn more about troubleshooting WordPress.`

It seems to always install the first one, but fails thereafter. No email is being sent either.

Works fine on 7.4 and below.

@BadScooter1980
Copy link
Author

Turning on debug gives me the following;

Fatal error: Uncaught ArgumentCountError: 3 arguments are required, 2 given in /home/sites/13b/8/815fb5c231/public_html/wp-admin/includes/class-bulk-upgrader-skin.php:152 Stack trace: #0 /home/sites/13b/8/815fb5c231/public_html/wp-admin/includes/class-bulk-upgrader-skin.php(152): sprintf('%1$s installed ...', 'Akismet Anti-Sp...') #1 /home/sites/13b/8/815fb5c231/public_html/wp-content/themes/core/inc/functions/class-tgm-plugin-activation.php(3646): Bulk_Upgrader_Skin->after('Akismet Anti-Sp...') #2 /home/sites/13b/8/815fb5c231/public_html/wp-admin/includes/class-wp-upgrader.php(823): TGMPA_Bulk_Installer_Skin->after() #3 /home/sites/13b/8/815fb5c231/public_html/wp-content/themes/core/inc/functions/class-tgm-plugin-activation.php(3266): WP_Upgrader->run(Array) #4 /home/sites/13b/8/815fb5c231/public_html/wp-content/themes/core/inc/functions/class-tgm-plugin-activation.php(3379): TGMPA_Bulk_Installer->run(Array) #5 /home/sites/13b/8/815fb5c231/public_html/wp-content/themes/core/inc/functions/class-tgm-plugin-activation.php(2985): TGMPA_Bulk_Installer->bulk_install(Array) #6 /home/sites/13b/8/815fb5c231/public_html/wp-content/themes/core/inc/functions/class-tgm-plugin-activation.php(751): TGMPA_List_Table->process_bulk_actions() #7 /home/sites/13b/8/815fb5c231/public_html/wp-includes/class-wp-hook.php(292): TGM_Plugin_Activation->install_plugins_page('') #8 /home/sites/13b/8/815fb5c231/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array) #9 /home/sites/13b/8/815fb5c231/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #10 /home/sites/13b/8/815fb5c231/public_html/wp-admin/admin.php(259): do_action('appearance_page...') #11 /home/sites/13b/8/815fb5c231/public_html/wp-admin/themes.php(10): require_once('/home/sites/13b...') #12 {main} thrown in /home/sites/13b/8/815fb5c231/public_html/wp-admin/includes/class-bulk-upgrader-skin.php on line 152

@jrfnl
Copy link
Contributor

jrfnl commented Apr 21, 2021

@BadScooter1980 Thank you for that additional info. That's helpful. Would you mind testing with the develop version of TGMPA to see if the issue still exists ? And if so, do you feel up to submitting a patch ?

@BadScooter1980
Copy link
Author

@jrfnl No problem. Sure, we can I find it?

@CreativeDive
Copy link

@jrfnl I can confirm, TGM is not working with PHP 8. I get the same error like @BadScooter1980

I think this is a critical error, because a lot of themes on Envato use TGM, because TGM is recommended by Envato to use it.

What will happen now?

@jrfnl Will there be an official release after a very long time?

@CreativeDive
Copy link

CreativeDive commented Apr 21, 2021

@jrfnl and @BadScooter1980 Good news. I have tested the "develop" version and it seems the install and activation process is working fine.

I have installed two plugins with TGM and it works like before.

@jrfnl But what that means for a new release of TGM?

TGM 2.6.1 is official recommended by Envato. But there will come more and more trouble in the future, if more users using PHP8.

@BadScooter1980
Copy link
Author

@jrfnl and @BadScooter1980 Good news. I have tested the "develop" version and it seems the install and activation process is working fine.

I have installed two plugins with TGM and it works like before.

@jrfnl But what that means for a new release of TGM?

TGM 2.6.1 is official recommended by Envato. But there will come more and more trouble in the future, if more users using PHP8.

Where can I get the developer version?

@CreativeDive
Copy link

CreativeDive commented Apr 22, 2021

@BadScooter1980 go to https://github.com/TGMPA/TGM-Plugin-Activation and click on the green button "Code" to download the develop version.

Make sure on the left side selection "develop" is selected.

@BadScooter1980
Copy link
Author

@CreativeDive Perfect! Got it, and works fine on 8. :)

@asim59
Copy link

asim59 commented Aug 18, 2021

@CreativeDive I used it and it worked just fine. But when it comes to theme updates in WordPress, these issues are giving. http://prntscr.com/1qa53m4

@CreativeDive
Copy link

@asim59 I can't confirm this. Tested and it works fine.

@jrfnl
Copy link
Contributor

jrfnl commented Aug 18, 2021

@asim59 The error shown in your screenshot are not code errors, nor PHP warnings or anything. They are (incorrect) warnings from the ThemeCheck plugin. Please ask them to exclude TGMPA.

@MiesSuomesta
Copy link

Where the development version should be placed ?

@ivandurst
Copy link

I'm still getting this error, is this fixed?

@ZebulanStanphill
Copy link

ZebulanStanphill commented Oct 24, 2022

@ivandurst It looks like the issue is only fixed in the development branch, and the stable release of the plugin has been neglected.

Also, it's worth noting that WordPress is currently working on adding a basic plugin dependencies system to core, and a feature plugin is available for testing right now. For simple use-cases, this may suffice as an alternative.

https://make.wordpress.org/core/2022/10/12/call-for-testing-plugin-dependencies/

EDIT: fixed typo, I meant to say the stable release of TGM Plugin Activation has been neglected.

@CreativeDive
Copy link

Yes, it seems this will be added to the core of WordPress in the near future. This could be a good and native alternative.
https://make.wordpress.org/core/2022/10/12/call-for-testing-plugin-dependencies/

@CreativeDive
Copy link

It seems this https://make.wordpress.org/core/2022/10/12/call-for-testing-plugin-dependencies/ will support plugins that are available on wordpress.org only. Therefore currently this is no alternative way for me.

@hellatan
Copy link

Downloading and updating to the latest version of the class-tgm-plugin-activation.php file works. However, this file is misleading since the 2.6.1 version this one has is the same version number I have in the WP project i'm working on, which was created over a year ago. I just downloaded that version today. That should really be updated.

@seliverstov-maxim
Copy link

could you explain when will it be fixed?

@hellatan
Copy link

This was opened two years ago it looks like. If you go to their website and download the file from there, it will work for php 8. Not sure why it hasn't been updated here.

The main things I noticed were that it was a lot of comments/annotations that were changed. I didn't look too closely at all the changes though.

@leadscloud
Copy link

use latest /class-tgm-plugin-activation.php to solved.

php8 function sprintf will raise error when arguments not equal.

@jonshipman
Copy link

If you manage TGM with composer, here's the setup:

{
	"repositories": [
		{
			"url": "https://github.com/TGMPA/TGM-Plugin-Activation.git",
			"type": "vcs"
		}
	],
	"require": {
		"tgmpa/tgm-plugin-activation": "dev-develop#2d34264f4fdcfcc60261d490ff2e689f0c33730c"
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests