Class Dump

Represents a Dump class for WordPress configuration.

Constructors

  • Constructor for the class.

    Initializes the class with the necessary folders for WordPress.

    Parameters

    • paths: WPMMpaths

      The object containing the paths for the WordPress installation.

    Returns Dump

Properties

baseFolder: string

The base folder of the WordPress installation.

pluginsFolder: string

The plugins folder of the WordPress installation.

themeFolder: string

The theme folder of the WordPress installation.

Methods

  • Extracts the version number from a PHP file.

    Parameters

    • filePath: PathOrFileDescriptor

      The path to the PHP file.

    Returns null | string

    The version number extracted from the file, or null if no version is found.

  • Extracts the version number from a style file.

    Parameters

    • filePath: PathOrFileDescriptor

      The path to the style file.

    Returns null | string

    The version number extracted from the style file, or null if no match was found.

  • Initializes the function by logging the baseFolder and themeFolder properties, scanning the theme and plugins directories, retrieving the website name from the baseFolder path, getting the WordPress version from wp-includes/version.php, determining the language using Intl.DateTimeFormat().resolvedOptions().locale, and saving the result to a JSON file.

    Returns Promise<WPMMconfig>

    The configuration object.

    Throws

    Error An error if the configuration file cannot be created.

  • Scans a directory and returns an array of objects containing the name and version of each item found.

    Parameters

    • directory: string

      The path of the directory to scan.

    Returns WPMMconfigPkg[]

    An array of objects with the name and version of each item found.

Generated using TypeDoc