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

Fatal error: Missing format specifier at end of string in classifai.php:91 #743

Closed
1 task done
peterwilsoncc opened this issue Mar 7, 2024 · 2 comments · Fixed by #740
Closed
1 task done

Fatal error: Missing format specifier at end of string in classifai.php:91 #743

peterwilsoncc opened this issue Mar 7, 2024 · 2 comments · Fixed by #740
Assignees
Labels
type:bug Something isn't working.

Comments

@peterwilsoncc
Copy link
Contributor

Describe the bug

See in PHP 8.0.30

The sprintf function call doesn't include a format specifier for the string to be replaced. Instead of %s it's %.

sprintf( esc_html__( 'Fatal Error: Composer not setup in %', 'classifai' ), CLASSIFAI_PLUGIN_DIR )

Running PHP 8.0 (and possibly other versions) this causes a fatal error during activation of the plugin.

Steps to Reproduce

  1. Configure classifai on a PHP 8.0 server
  2. Run npm i; composer i; npm run build in the command line
  3. Attempt to activate the plugin
  4. Activation will fail due to a fatal error

Screenshots, screen recording, code snippet

[07-Mar-2024 00:10:18 UTC] PHP Fatal error:  Uncaught ValueError: Missing format specifier at end of string in /vagrant/content/plugins/classifai/classifai.php:91
Stack trace:
#0 /vagrant/content/plugins/classifai/classifai.php(91): sprintf('Fatal Error: Co...', '/vagrant/conten...')
#1 /vagrant/content/plugins/classifai/classifai.php(116): classifai_autoload()
#2 /vagrant/content/plugins/classifai/classifai.php(152): classifai_autorun()
#3 /vagrant/wp-build/wp-admin/includes/plugin.php(2389): include_once('/vagrant/conten...')
#4 /vagrant/wp-build/wp-admin/includes/plugin.php(675): plugin_sandbox_scrape('classifai/class...')
#5 /vagrant/wp-build/wp-admin/plugins.php(60): activate_plugin('classifai/class...', 'http://xu-class...', false)
#6 {main}
  thrown in /vagrant/content/plugins/classifai/classifai.php on line 91

Environment information

  • PHP 8.0.30
  • WordPress trunk @ 4d6941a48b230e0a40409f5732ab3dac1facb052 in the wordpress/wordpress repo

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@peterwilsoncc peterwilsoncc added the type:bug Something isn't working. label Mar 7, 2024
@dkotter
Copy link
Collaborator

dkotter commented Mar 7, 2024

I believe #740 fixes this

@peterwilsoncc
Copy link
Contributor Author

Sorry Darin, I'm still on my first tab for the reviews you sent through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants