Support » Plugin: Easy Plugin Demo » Error in site-actions.php

  • internetfootprint

    (@internetfootprint)


    Line 153 the foreach loop breaks when $plugins is empty. There needs to be a conditional check if $plugins is empty and break out of the function when it is. After adding the check the error goes away.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mike Howard

    (@mikeyhoward1977)

    The variable is an array regardless of whether or not the array is empty. Therefore the foreach loop still works. If the array is empty, PHP will simply do nothing.

    This error only seems to exist on your site and I have not been able to reproduce anywhere else at this time. Within the file on your site I edited, checked if empty and ! is_array and both checks were as expected.

    internetfootprint

    (@internetfootprint)

    On a completely different hosting account I am getting the error. Sites that are not blog ID 1 get the error, but blog ID 1 is fine.

    Warning: Invalid argument supplied for foreach() in ../public_html/wp-content/plugins/easy-plugin-demo/includes/sites/site-actions.php on line 153

    Warning: Cannot modify header information – headers already sent by (output started at ../public_html/wp-content/plugins/easy-plugin-demo/includes/sites/site-actions.php:153) in ../public_html/wp-includes/pluggable.php on line 1251

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error in site-actions.php’ is closed to new replies.