is_writable( $wp_upload_dir['basedir'] ) || ! fl_builder_filesystem()->is_writable( $bb_upload_dir['path'] ) ) { add_action( 'admin_notices', __CLASS__ . '::permissions_admin_notice' ); add_action( 'network_admin_notices', __CLASS__ . '::permissions_admin_notice' ); } } } /** * Shows an admin notice if we can't write to files. * * @since 1.8.2 * @return void */ static public function permissions_admin_notice() { $message = __( 'Beaver Builder may not be functioning correctly as it does not have permission to write files to the WordPress uploads directory on your server. Please update the WordPress uploads directory permissions before continuing or contact your host for assistance.', 'fl-builder' ); self::render_admin_notice( $message, 'error' ); } /** * Shows an admin notice if another version of the builder * has already been loaded before this one. * * @since 1.8 * @return void */ static public function double_install_admin_notice() { /* translators: %s: plugins page link */ $message = __( 'You currently have two versions of Beaver Builder active on this site. Please deactivate one before continuing.', 'fl-builder' ); self::render_admin_notice( sprintf( $message, admin_url( 'plugins.php' ) ), 'error' ); } /** * Renders an admin notice. * * @since 1.8.2 * @access private * @param string $message * @param string $type * @return void */ static private function render_admin_notice( $message, $type = 'update' ) { if ( ! is_admin() ) { return; } elseif ( ! is_user_logged_in() ) { return; } elseif ( ! current_user_can( 'update_plugins' ) ) { return; } echo '
' . $message . '
'; echo '