Support » Plugin: Restrict Taxonomies » Warnings when activated

  • Resolved fmpweb

    (@fmpweb)


    Hi – I’ve just uploaded and activated your plugin and the following warnings display:

    Warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 607

    Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 609

    When I enter the Settings > Restrict Taxonomies menu there are more warnings:

    Warning: in_array() expects parameter 2 to be array, string given in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 427

    Warning: in_array() expects parameter 2 to be array, string given in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 437

    Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 466

    I have no other plugins activated and it’s on a clean install.

    Thanks. Gavin.

    https://wordpress.org/plugins/restrict-taxonomies/

Viewing 2 replies - 1 through 2 (of 2 total)
  • An update. The first two warnings are at the top of the screen.

    The last three display in the Settings > Restrict Taxonomies page:

    /wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 427 – next to the Custom post types to handle checkbox;

    /wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 437 – next to the Categories checkbox.

    If I create a custom taxonomy, another warning displays next to that check box.

    The final warning above – /wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 466 – is inside the Roles tab.

    If I select the Users tab, there is another warning:

    Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 496

    Now, if I check the Posts checkbox and click Save Changes, I land on a white screen for wp-admin/options.php with the following warning:

    Warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in /home/freeman6/public_html/fmp/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 607

    Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 609

    Warning: Cannot modify header information – headers already sent by (output started at …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php:607) in …/wp-includes/pluggable.php on line 1228

    I then refresh my browser and land on the All Settings page (something similar I’ve only seen in a multisite installation).

    I go back to the Restrict Taxonomies page and the error next to the ‘checked’ Posts checkbox is now gone. The warnings elsewhere still show.

    I then check the Custom Taxonomies to handle/Categories checkbox and click Save Changes. Again I land on a white screen with the following warnings, as before:

    Warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 607

    Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php on line 609

    Warning: Cannot modify header information – headers already sent by (output started at /home/freeman6/public_html/fmp/wp-content/plugins/restrict-taxonomies/restrict-taxonomies.php:607) in …/wp-includes/pluggable.php on line 1228

    I reload my browser and again land on the All Settings page.

    I now visit the Restrict Taxonomies page and now all the warnings have disappeared, including the one next to the now checked Categories checkbox.

    If I try to uncheck the Posts and/or Categories checkboxes, and click Save Changes, the don’t uncheck. Is this correct?

    If I create custom post types and taxonomies, checkxes can be checked/unchecked not problem.

    If Reset to Default Settings, all the warning return.

    I hope that’s helpful. Thanks.

    Plugin Author sladix

    (@sladix)

    Thanks to your detailed report, the warnings shouldn’t appears anymore with the last update 🙂

    (Please close the bug when you are done testing)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Warnings when activated’ is closed to new replies.