Skip to content

Enable/Disable toggle for Auto-updates#45

Open
manishsubachchanyadav wants to merge 1 commit intodevfrom
wsp-2040-enable-auto-update-feature
Open

Enable/Disable toggle for Auto-updates#45
manishsubachchanyadav wants to merge 1 commit intodevfrom
wsp-2040-enable-auto-update-feature

Conversation

@manishsubachchanyadav
Copy link
Collaborator

@manishsubachchanyadav manishsubachchanyadav commented Feb 18, 2025

Pull Request Template

Description

Handles auto-updates for the plugin by enabling auto-updates and toggling the auto-update status.

Checklist

  • Ensure version updates in package.json, composer.json, and bootstrap file.
  • Attach the Jira link for tracking this PR.

Related Jira Issue

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

Please describe the tests that you ran to verify your changes. Provide instructions so others can replicate your testing.

Additional Notes

Add any other notes related to the PR, potential side effects, etc.

Screenshots (if applicable)

image

@vplugins/websitepro

@rajanvijayan
Copy link
Collaborator

Please update version details and CHANGELOG.md @manishsubachchanyadav

* Modify the Auto-Update UI button in the Plugins page.
*/
public static function modifyAutoUpdateUI($html, $plugin_file) {
if ($plugin_file === 'blog-post-connector/blog-post-connector.php') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use get_plugin_file() function instead of write straight file name

if ($plugin_file === 'blog-post-connector/blog-post-connector.php') {
// Fetch the current list of plugins with auto-updates enabled
$auto_update_plugins = get_option('auto_update_plugins', []);
$status = in_array('blog-post-connector', $auto_update_plugins, true) ? 'enabled' : 'disabled';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use get_plugin_slug() method for all places

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants