public function can_update() {
		global $pagenow;

		// WP-CLI access has full capabilities.
		if ( static::is_wp_cli() ) {
			return true;
		}

		$can_user_update = current_user_can( 'update_plugins' ) && current_user_can( 'update_themes' );
		$this->load_options();

		$admin_pages = [
			'plugins.php',
			'plugin-install.php',
			'themes.php',
			'theme-install.php',
			'update-core.php',
			'update.php',
			'options-general.php',
			'options.php',
			'settings.php',
			'edit.php',
		];

		// Needed for sequential shiny updating.
		if ( isset( $_POST['action'] ) && in_array( $_POST['action'], [ 'update-plugin', 'update-theme' ], true ) ) {
			$admin_pages[] = 'admin-ajax.php';
		}

		/**
		 * Filter $admin_pages to be able to adjust the pages where GitHub Updater runs.
		 *
		 * @since 8.0.0
		 *
		 * @param array $admin_pages Default array of admin pages where GitHub Updater runs.
		 */
		$admin_pages = array_unique( apply_filters( 'github_updater_add_admin_pages', $admin_pages ) );

		return $can_user_update && in_array( $pagenow, $admin_pages, true );
	}
public function can_update() {
		global $pagenow;

		// WP-CLI access has full capabilities.
		if ( static::is_wp_cli() ) {
			return true;
		}

		$can_user_update = current_user_can( 'update_plugins' ) && current_user_can( 'update_themes' );
		$this->load_options();

		$admin_pages = [
			'plugins.php',
			'plugin-install.php',
			'themes.php',
			'theme-install.php',
			'update-core.php',
			'update.php',
			'options-general.php',
			'options.php',
			'settings.php',
			'edit.php',
		];

		// Needed for sequential shiny updating.
		if ( isset( $_POST['action'] ) && in_array( $_POST['action'], [ 'update-plugin', 'update-theme' ], true ) ) {
			$admin_pages[] = 'admin-ajax.php';
		}

		/**
		 * Filter $admin_pages to be able to adjust the pages where GitHub Updater runs.
		 *
		 * @since 8.0.0
		 *
		 * @param array $admin_pages Default array of admin pages where GitHub Updater runs.
		 */
		$admin_pages = array_unique( apply_filters( 'github_updater_add_admin_pages', $admin_pages ) );

		return $can_user_update && in_array( $pagenow, $admin_pages, true );
	}
public function can_update ( ) { global $ pagenow ; // WP-CLI access has full capabilities. if ( static :: is_wp_cli ( ) ) { return true ; } $ can_user_update = current_user_can ( 'update_plugins' ) && current_user_can ( 'update_themes' ) ; $ this -> load_options ( ) ; $ admin_pages = [ 'plugins.php' , 'plugin-install.php' , 'themes.php' , 'theme-install.php' , 'update-core.php' , 'update.php' , 'options-general.php' , 'options.php' , 'settings.php' , 'edit.php' , ] ; // Needed for sequential shiny updating. if ( isset ( $ _POST [ 'action' ] ) && in_array ( $ _POST [ 'action' ] , [ 'update-plugin' , 'update-theme' ] , true ) ) { $ admin_pages [ ] = 'admin-ajax.php' ; } /**
		 * Filter $admin_pages to be able to adjust the pages where GitHub Updater runs.
		 *
		 * @since 8.0.0
		 *
		 * @param array $admin_pages Default array of admin pages where GitHub Updater runs.
		 */ $ admin_pages = array_unique ( apply_filters ( 'github_updater_add_admin_pages' , $ admin_pages ) ) ; return $ can_user_update && in_array ( $ pagenow , $ admin_pages , true ) ; }
Checks current user capabilities and admin pages.

@return bool
Checks current user capabilities and admin pages .