Advanced Scripts 2.5.0 Release Overview

by Abdelouahed

Updated: Dec 12, 2023 

Advanced Scripts 2.5 is available now. In this update, we implemented major changes to the file storage system, added SCSS Partials, and introduced Site Health Checks to improve the scripting experience. Let's delve into more details about these features.

New Storage System

The storage system in Advanced Scripts 2.5 has undergone a major overhaul, offering improved performance and reliability.

Previously, we were relying on temporary files to run PHP scripts with random filenames. This choice was made for security purposes as files were deleted at the end of each page request.

However, various hosting providers and different plugins' setup didn't go well with this approach, and caused frustration and annoying errors to many users.

The new folder location is set to wp-content/advanced-scripts for regular sites and wp-content/advanced-scripts/sites/{id} for multisite installations.

Now, your PHP script files are permanently stored within the php directory, while ensuring the security of your code with directory index files, and direct access protection.

PHP files are generated dynamically if they are missing or whenever a script is created or updated, and the filenames are derived from the script ID and title to be unique and easily identifiable.

With this change and in case of an error within your PHP code, you can now use FTP to directly edit the file content and fix the issue without enabling safe mode.

SCSS Partials Support

Another exciting addition is the support for SCSS Partials. With this update, you can break down your stylesheets into smaller, reusable components, promoting a modular and organized approach to your SCSS code. This not only improves code maintainability but also helps streamline your development process.

Once you've created an SCSS partial, you'll find the import rule code conveniently displayed under the type field. Additionally, there's a handy copy button provided, allowing you to effortlessly use it in other SCSS scripts.

Nested Partials

We also allow SCSS partials to be used in other SCSS partials. For example, you can create a partial with the name "Colors", paste the following code in the editor and click the save button:

$primary-color: #ff0000;
$secondary-color: #00ff00;
Code language: SCSS (scss)

Next, create another partial named "Variables" and import the colors partial:

@import 'colors';

$body-background: $primary-color;
$button-background: $secondary-color;
Code language: SCSS (scss)

Now, you can use the variables partial in your regular SCSS code as follows:

@import 'variables';

body {
    background: $body-background;
    
    button {
        background: $button-background;
    }
}
Code language: SCSS (scss)

Considerations for Partial Naming

The SCSS partials files are stored in the scss directory and are named after the snippet title. For example, if the partial is named "Colors", the filename will be "_colors.scss". Therefore, it is not possible to have two partials with the same name, and you may need to add prefixes.

Site Health Checks

To further enhance the user experience, Advanced Scripts 2.5 introduces integration with the WordPress Site Health tools. We run various tests to make sure the storage and execution functions are working as expected.

Storage Status

It checks if the storage directory is correctly set up, ensuring existence, writability, and the presence of index files to prevent directory listing.

Temporary Files Cleanup

The cleanup process will look for any files in the old temporary folder and provides actions to delete them with a single click if necessary.

For safety reasons, we choose not to do the cleanup step automatically to prevent deletion of any other important files in the directory.

PHP Tests

This is used to validate the process of creating, running, and deleting PHP scripts in the storage folder.

We strongly recommend that you check the site health status page, which can be found in the WordPress dashboard under the "tools" menu, to ensure that all these tests are successful on your site.

Other Changes

In addition to these major updates, Advanced Scripts 2.5 also includes updated dependencies, bug fixes and performance enhancements to ensure a smooth and reliable scripting environment.

We appreciate your important feedback. Should you have any inquiries, suggestions, or come across any problems, feel free to contact our dedicated support team. We are available to assist you throughout your experience.

Keep an eye out for other upcoming exciting updates. Enjoy coding with Advanced Scripts!


If you have any questions or require additional information regarding this topic, please feel free to leave a comment on the corresponding Facebook post.

Discuss on Facebook
cross