0

I've just started learning to build Wordpress themes and upon initial install of Wordpress on my localhost I get 2 Warnings and a Notice when I look at the homepage after installation. They are:

  • Warning: sprintf(): Too few arguments in C:\MAMP\htdocs\pluralsight\Wordpress Custom Theme Development\wordpress\wp-includes\theme.php on line 874
  • Warning: sprintf(): Too few arguments in C:\MAMP\htdocs\pluralsight\Wordpress Custom Theme Development\wordpress\wp-includes\theme.php on line 874 class="home blog logged-in admin-bar no-customize-support hfeed has-sidebar colors-light">
  • Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in C:\MAMP\htdocs\pluralsight\Wordpress Custom Theme Development\wordpress\wp-includes\functions.php on line 3743

I was recently doing learning about accounts and privileges for MySQL and changed some things in the database, although as far as I'm aware I've now changed them back.

Any idea how to fix these warnings? Is there a problem with Wordpress or did I do something?

Niall
  • 87
  • 9
  • both warning indicate you enter not enough argument on your function. Check the mentioned file and line and read this docs to be sure : http://php.net/manual/en/function.sprintf.php – Charis Jul 13 '18 at 05:49
  • the notice is pretty solveable and explained here: https://stackoverflow.com/questions/38693992/notice-ob-end-flush-failed-to-send-buffer-of-zlib-output-compression-1-in – Charis Jul 13 '18 at 05:50
  • I didn't touch these files though, that's how they were on installation. – Niall Jul 13 '18 at 05:50
  • Well, those files get some value from your theme. Hence the notice on those files. – Charis Jul 13 '18 at 05:51
  • Ok, I'm trying the method in the link you provided but I seem to be having another problem now, when I try to change my php.ini, after saving it, it doesn't update on the MAMP site...I'm updating the correct file so not sure what's going on... – Niall Jul 13 '18 at 06:23
  • Got the updating of the php.ini file working! I turned off the zlib.output_compression so the notice is no longer displaying, did that actually fix the problem or cover it up? The first two warnings are still showing, I read the documentation but it doesn't seem to offer me a solution. The line of code it is referring to is: $default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() ) – Niall Jul 13 '18 at 06:35
  • I think you really need to read the docs on ob_end_flush, do some research about using it with zlib or other. Then you will get your answer. About the sprintf, why not dumo the var and make sure it has the correct value? – Charis Jul 13 '18 at 06:46
  • Ok, I'll look into it, and just to note the notice appears in the dashboard as well as the front of the site. For the sprintf I checked out the var but still not sure what the problem is as it's a bit of advanced coding for my level. I changed the theme I was using though and the warnings dissappeared, must just be something faulty with the themes. Thanks for the help :) – Niall Jul 13 '18 at 07:03

0 Answers0