Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change 'autoload' option values in various files #6417

Conversation

pbearne
Copy link

@pbearne pbearne commented Apr 19, 2024

Updated values of 'autoload' option from 'yes' or 'no' to 'on' or 'off' respectively, across several PHP files. This change was implemented in the functions handling options and lock settings, enhancing clarity and consistency of the code.

Trac ticket: https://core.trac.wordpress.org/ticket/61045

Updated values of 'autoload' option from 'yes' or 'no' to 'on' or 'off' respectively, across several PHP files. This change was implemented in the functions handling options and lock settings, enhancing clarity and consistency of the code.
Copy link

github-actions bot commented Apr 19, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @paul.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props joemcgill, pbearne, mukesh27.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pbearne. These all look right to me. I see a few places in wp_ajax_wp_compression_test() that could be changed as well.

There are also a few places in upgrade.php where the previous values are used, but it may be best to leave those alone for now, since they were written for previous WP versions prior to this change being made.

The commit modifies the 'can_compress_scripts' options in the ajax-actions.php file. The update_site_option and update_option functions now have a third argument which controls whether the setting is on or off. This enhances flexibility and control over the script compression feature.
Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. One important change that needs to be addressed.

src/wp-admin/includes/ajax-actions.php Outdated Show resolved Hide resolved
The commit adjusts the parameters for 'update_option' functions in 'featured-content.php' and 'ajax-actions.php'. It changes the 'autoload' parameter where necessary, updating the values for "featured-content" and "can_compress_scripts" options. It's done to ensure the correct use of the autoloading feature in WordPress functionality.
Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me now.

This commit adds a third argument to the update_option() function calls across a large number of scripts. This argument toggles whether the option should be loaded from cache (on) or not (off). The changes made help to better manage data caching in WordPress and potentially improve performance by avoiding unnecessary database queries.
Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed the change to twentyfourteen in my last review. Can we remove that change and also not change any instances of update_option() that were previously using the default value?

The scope of this ticket should just be to update places in core where a third parameter was defined, but was using the old "true|false" values.

paul bearne added 2 commits April 29, 2024 15:09
This commit adds a third argument to the update_option() function calls across a large number of scripts. This argument toggles whether the option should be loaded from cache (on) or not (off). The changes made help to better manage data caching in WordPress and potentially improve performance by avoiding unnecessary database queries.
Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this, @pbearne. This looks like a good update.

@joemcgill
Copy link
Member

@joemcgill joemcgill closed this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants