TGMPA / TGM-Plugin-Activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
http://tgmpluginactivation.com/
GNU General Public License v2.0
1.76k stars 429 forks source link

Fix "Warning: sprintf(): Too few arguments" #670

Closed andrezrv closed 7 years ago

andrezrv commented 7 years ago

WordPress 4.8 inserts the "read more" link in the update success message automatically. In this process, sprintf() receives only one replacement argument, so PHP throws a warning when two strings are expected to be replaced.

This is the commit in core where the modifications were made: https://github.com/WordPress/WordPress/commit/bab7eb143e3e3651cbb4165a9e904401dd2ed6de#diff-0e5737a4947b2884a63b3a50a59a9d3f.

This issue was already reported in #669, and a fix was proposed. However, I think that checking for the installed version of WordPress is better to keep backwards compatibility.

GaryJones commented 7 years ago

Quick review, but looks sensible. Thanks!

jrfnl commented 7 years ago

@andrezrv The travis error had nothing to do with your PR and has been fixed in the mean time. Would you mind rebasing the PR so we can get a passing build ? Thanks! I'll test the PR after that and will merge it if I don't find any problems with it (I don't expect any issues).

andrezrv commented 7 years ago

@jrfnl Done, and I added one more commit to fix the end of line issue reported by Travis.

Sharifur commented 5 years ago

change this function to this

https://gist.github.com/Sharifur/cdf71a63fb402eb8f38f6fbe03e0522b

Ninetheme commented 5 years ago

change this function to this

https://gist.github.com/Sharifur/cdf71a63fb402eb8f38f6fbe03e0522b

thank you!