• Resolved xiphi

    (@xiphi)


    I got this warning after upgrading to PHP 7.2:

    PHP Warning: count(): Parameter must be an array or an object that implements Countable in /wp-content/plugins/iwp-client/addons.api.php

    Plugin Version: 1.6.8.1

    See also:
    https://wiki.php.net/rfc/counting_non_countables

    Fix (backwards compatible):

    diff -ur iwp-client-23/addons.api.php iwp-client-24/addons.api.php
    --- iwp-client-23/addons.api.php	2017-12-15 10:54:51.532245753 +0100
    +++ iwp-client-24/addons.api.php	2017-12-15 11:08:06.676780082 +0100
    @@ -37,7 +37,7 @@
     	function iwp_mmb_function_exists($callback)
     	{
     		global $iwp_core;
    -		if (count($callback) === 2) {
    +		if (is_array($callback) && count($callback) === 2) {
     			if (!method_exists($callback[0], $callback[1]))
     				wp_die($iwp_core->iwp_dashboard_widget('Information', '', '<p>Class ' . get_class($callback[0]) . ' does not contain <b>"' . $callback[1] . '"</b> function</p>', '', '50%'));
     		} else {
Viewing 1 replies (of 1 total)
  • Plugin Author infinitewp

    (@infinitewp)

    Hi there,

    We already fixed these warnings in our recent update releases. Kindly update IWP client plugin to the latest version on all your WordPress sites and let us know if you still experience the same problem.

Viewing 1 replies (of 1 total)

The topic ‘PHP 7.2 Warning in addons.api.php’ is closed to new replies.