Download the PHP package devuri/wp-env-app without Composer

On this page you can find all versions of the php package devuri/wp-env-app. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-env-app

A Lightweight WordPress Project Framework

A lightweight framework for your next WordPress web application. This framework is focused on providing a well-organized structure, making it more straightforward to develop, deploy, and maintain WordPress websites and web applications.

Note

⚠️ Work in progress: Please note: This framework is currently under active development. We welcome community involvement, so feel free to contribute via pull requests or by reporting issues.

Features

This WordPress App Framework is intended to provide a reliable solution for WordPress web application development, enhancing both efficiency and security. We invite the community to join us in refining and evolving this tool.

Requirements

To use get started, make sure your environment meets the following requirements:

Installation

Run the following command in your terminal:

After the installation process, you will find a new .env file in your project directory. This file contains all the necessary environment variables.

Configuration

Open the .env file in a text editor of your choice and make the following configurations:

Update the WP_HOME value with the correct URL for your application.

The framework will automatically generate salts and set the DB_PREFIX.

By default, the BASIC_AUTH_USER is set to admin and BASIC_AUTH_PASSWORD is set to demo. You can change these values to your preference if you intend to enable basic authentication.

Full list of Environment Variables

Fresh WordPress Installation

Once all configuration is complete, you can execute the following command to set up a fresh WordPress installation:

Now you're ready to start using the framework with your customized configurations and a fresh WordPress installation.

or

  1. Clone or download the repository to your local development environment.
  2. Install dependencies by running composer install in the project root directory.
  3. Rename the .env.example file to .env and customize it according to your environment settings.
  4. Set up your web server to point to the public directory as the document root.
  5. Run the WordPress installation process through your web browser.
  6. Start building your awesome WordPress project!

Auto Login

The framework supports auto login via the command-line interface (CLI) command wp:login. This command will provide you with a signed URL for logging in. It relies on the WPENV_AUTO_LOGIN_SECRET_KEY defined in the .env file.

To generate a new secret key, use the built-in nino CLI tool. Run the following command to create a new key:

This will append a new key to your .env file. You can then safely remove the old key from the .env file.

After generating a new key, run the php nino wp:login command again to obtain a new login link using the updated key.

Folder Structure

Here's an overview of the directory structure used:

You can also check out the basic version with unified directory structure WordPress web app skeleton.

Items marked [-r-r-r] should or can be set as read-only

see framework directory structure

Additional Customization

wp-env-app allows for additional customization options. Here are some examples:

Modify Web Root: By default, the project web root is set to public. To change it to something other than public, edit app.php and composer.json. For example, if the web root is set as public_html, update the following sections:

composer.json:

app.php:

Configuration

The app.php file contains various configuration options that you can customize based on your project requirements. Here's an overview of the available options:

Feel free to modify these options as needed to fit your project's directory structure and requirements.

Full list of Configuration Options

Errors

The framework allows for the use of oops (whoops) or Symfony as the error handler.

By default, the Symfony error handler is used. To change the error handler, set the error_handler option to oops. To disable the error handlers completely, set the error_handler option to null.

Please note that the error handler will only run in debug, development, or local environments.

.htaccess file for highspeed and security.

An ideal .htaccess configuration file for optimal speed and security is suitable for all WordPress websites with proven effectiveness. It has been rigorously tested on numerous websites to ensure both speed and security. In the event that you are operating a WordPress Multisite, adjustments should be made to the final section of this file.

.htaccess configuration file: https://gist.github.com/seoagentur-hamburg/c96bc796764baaa64d43b70731013f8a

Enhanced WordPress Installation Security

Prevents the standard WordPress installation screen from appearing in specific environments for enhanced security.

Installation Security

A 'WP is not installed' message will display in environments marked as 'secure,' 'sec,' 'production,' or 'prod.'

This change helps prevent unauthorized installations and takeovers, which can occur due to various reasons such as a disconnected database or table prefix changes.

To override this enhancement:

  1. Open your .env file.
  2. Set WP_ENVIRONMENT_TYPE explicitly to:
    • staging
    • development
    • dev
    • Or an appropriate value for your environment.

With this setup, your WordPress installation will be secure, and you won't risk unauthorized installations or takeovers.

Private Repository

You can use the auth.json file to install private themes and plugins hosted on GitHub etc using Composer. Follow the steps below:

  1. Create a new access token on GitHub by going to the token settings: https://github.com/settings/tokens.
  2. Generate a new token with the necessary repository access permissions.
  3. Create an auth.json file in the root directory of your project.
  4. Add the following content to the auth.json file, replacing <GITHUB_TOKEN> with your actual token:

  5. In your composer.json file, include the private repositories and required packages as shown in the example provided:

For a fully detailed guide on how to set up private repositories with your project, refer to the GitHub guide.

Premium Plugins

Many Premium plugins provide a way to install via composer, Composer simplifies the process of managing dependencies by automating the installation, updating, and removal of plugins. This ensures that you are using the correct version of the plugin, reducing compatibility issues and potential conflicts with other WordPress components.

For more information on premium plugins, check out the documentation Installation of Premium Plugins.

Local Development Environments (LocalWP)

The framework seamlessly integrates with Local WP, enabling you to construct and engage with local environments. Local WP simplifies the process of setting up, managing, and interacting with local WordPress environments, catering to users of Mac, Windows, and Linux.

To configure your environment appropriately, make sure to rename the .env file to .env.local and adjust the database credentials to match your Local WP settings. Additionally, update the WP_HOME to reflect your home URL, for instance: WP_HOME='http://localhost:10028'.

The files generated after running composer create-project devuri/wp-env-app should be located within the 'app' directory of your Local WP installation.

Here are the database settings for your reference:

If you encounter the well-known error message "Error establishing a database connection", a simple restart of the site in LocalWP might resolve the issue. Additionally, if you're using a VPN, try disconnecting from the VPN, then start the LocalWP site, and attempt the connection again. After this, you can reconnect to your VPN, and everything should function as it previously did.

Enabling Multi-Tenant Support

Before proceeding with any modifications, it's crucial to ensure the safety of your WordPress site. Make sure to create a comprehensive backup of both your WordPress files and database. For more insights on multi-tenant configurations, consider exploring detailed information available at multi-tenant documentation.

Steps to Enable Multi-Tenant:

  1. Navigate to the public directory of the framework installation and locate the wp-config.php file.

  2. Open the wp-config.php file and find the section where ALLOW_MULTITENANT constant is defined. You will need to insert or update the specific line to enable multi-tenant functionality.

  3. Modify the file by adding or updating the following line of code, which sets the ALLOW_MULTITENANT constant to true. This change will activate the multi-tenant features:

For a reference implementation or to see an example of this configuration in action, you can view the Project Framework config file example.

By following these steps, your application installation will be configured to support multi-tenant capabilities, allowing for enhanced flexibility and scalability.

Git Ignore

For more information on the framework gitignore, check out the documentation Git Ignore for the Project Framework.

Congratulations! You now have wp-env-app up and running. Enjoy developing your WordPress web applications with a lightweight and modular framework. Should you have any questions or encounter any issues submit them through the issue tracker.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements. Feel free to fork the repository and submit pull requests to contribute to the project.


All versions of wp-env-app with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package devuri/wp-env-app contains the following files

Loading the files please wait ....