functional_asset_path(); if ( ! is_dir( $path ) ) { mkdir( $path ); } if ( ! current_user_can( 'activate_plugins' ) ) { return; } $role = get_role( 'administrator' ); if ( empty( $role ) ) { update_site_option( 'rt_wp_nginx_helper_init_check', __( 'Sorry, you need to be an administrator to use Nginx Helper', 'nginx-helper' ) ); return; } $role->add_cap( 'Nginx Helper | Config' ); $role->add_cap( 'Nginx Helper | Purge cache' ); wp_schedule_event( time(), 'daily', 'rt_wp_nginx_helper_check_log_file_size_daily' ); } }