wordpress – plesk error Call to undefined function is_admin()

In the Plesk under the subscription we are seeing the following error and we can not apply the Plesk security settings. 

Error: PHP Fatal error: Call to undefined function is_admin() in /usr/share/plesk-wp-cli/php/wp-cli.php(18) : eval()’d code on line 87

Parallels identifies this in a KB article:


They say:


Modified wp-config.php file inside a WordPress installation document root. Function is_admin() could be handled properly while it evaluated from CLI.


Either remove his function from the wp-config.php or modify it, as it shown on example below:


We compared the config against another new installation and removed the following lines from it.


if(is_admin()) {

    add_filter(‘filesystem_method’, create_function(‘$a’, ‘return “direct”;’ ));

    define( ‘FS_CHMOD_DIR’, 0751 );


if(is_admin()) {

    add_filter(‘filesystem_method’, create_function(‘$a’, ‘return “ftpext”;’ ));

    define( ‘FS_CHMOD_DIR’, 0755 );



Then in the subscriptions control panel we clicked the Plesk to refresh button for WordPress security scan and all appears to be fine now.

Posted in centos, plesk, wordpress.