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

Add a Must-Use loader file. #136

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

costdev
Copy link
Contributor

@costdev costdev commented Nov 5, 2024

Pull Request

What changed?

  1. A Must-Use loader file has been added to mu/aspireupdate-mu-loader.php.
  2. An exclusion for the Must-Use loader file has been added to phpcs.xml.dist.
    • This means that should the original Must-Use loader file receive updates in the future, we can update its code without needing to run it against our coding standard.

Installation instructions:

  1. Copy the AspireUpdate/mu/aspireupdate-mu-loader.php file into wp-content/mu-plugins/.
  2. Navigate to Plugins > Installed plugins and see that AspireUpdate is now loaded as a Must-Use plugin.

Why did it change?

We wanted to add a file that made it convenient for site owners with filesystem access to load AspireUpdate as a Must-Use plugin.

Did you fix any specific issues?

Fixes #79

CERTIFICATION

By opening this pull request, I do agree to abide by
the CODE OF CONDUCT and be bound by the terms
of the Contribution Guidelines in effect on the date and time
of my contribution as proven by the
revision information in GitHub. I also agree that any previous contributions shall be deemed subject to the terms of the
version in effect on the date and time of this pull request, or any future revisions for pull requests I may submit.
Further, I certify that this work is my own, is original, does not violate the intellectual property of any other person
or entity, and I am not violating any license agreements or contracts I have with any person or entity. Finally, I agree
that this code may be licensed under any license deemed appropraite by AspirePress, including but not
limited to open source, closed source, proprietary or custom licenses, and that such license terms neither violate my
rights or my copyright to this code.

Copy link
Contributor

@namithj namithj left a comment

Choose a reason for hiding this comment

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

Do we need to do this. I thought we agreed to move the plugin to mu-plugins folder and add a loader (which can just include the plugin entry file).

/**
* MU Loader
*
* @author Andy Fragen, Colin Stewart
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to Aspirepress

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an externally-maintained resource used by multiple projects and being proposed for use by AspireUpdate, rather than AspireUpdate's own resource. If myself or @afragen release an update to the file, we can open an issue and PR to implement the updates for AspireUpdate.

Pinging @afragen as co-maintainer.

* Plugin URI: https://gist.github.com/afragen/9117fd930d9be16be8a5f450b809dfa8
* Description: Loads AspireUpdate as a Must-Use plugin. Disables normal plugin activation and deletion.
* Version: 0.6.0
* Author: WordPress Upgrade/Install Team
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to Aspirepress

* Author: WordPress Upgrade/Install Team
* License: MIT
* Text Domain: mu-loader
* GitHub Plugin URI: https://gist.github.com/afragen/9117fd930d9be16be8a5f450b809dfa8
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the URL

* Description: Loads AspireUpdate as a Must-Use plugin. Disables normal plugin activation and deletion.
* Version: 0.6.0
* Author: WordPress Upgrade/Install Team
* License: MIT
Copy link
Contributor

Choose a reason for hiding this comment

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

Change License

* Version: 0.6.0
* Author: WordPress Upgrade/Install Team
* License: MIT
* Text Domain: mu-loader
Copy link
Contributor

Choose a reason for hiding this comment

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

Update Text Domain

/**
* Class MU_Loader
*/
class MU_Loader {
Copy link
Contributor

Choose a reason for hiding this comment

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

Update class name to match AU Classes

@namithj
Copy link
Contributor

namithj commented Nov 5, 2024

the mu-loader can just be include(AspireUpdate/aspire-update.php);

@costdev
Copy link
Contributor Author

costdev commented Nov 5, 2024

Just including the main plugin file will still allow deletion of the plugin which would allow any Administrator (or any other role with the manage_plugins cap) to delete a Must-Use plugin. The loader file from me and @afragen was designed to cover these and other cases so projects and site owners wouldn't need to worry about them.

@namithj
Copy link
Contributor

namithj commented Nov 5, 2024

We should also move the plugin to mu-plugins folder

@costdev
Copy link
Contributor Author

costdev commented Nov 5, 2024

AspireUpdate needs to remain in the wp-content/plugins directory in order to receive updates. If moved to the mu-plugins directory, it can only be updated manually via FTP/SSH

@namithj
Copy link
Contributor

namithj commented Nov 5, 2024

Or Lets triage and decide weather we should go this route.

The main issue for me is making something MU in a not recommended way. The prescribed way is to move to mu-plugins folder and in the process make it unchangeable (no updates). If we are going to change that behavior lets make sure everyone know what they are getting into and then decide. Lets keep the PR open until a consensus is reached.

@namithj
Copy link
Contributor

namithj commented Nov 5, 2024

Ignore the changes requested in PR until then, If we go with it, lets keep this file as a dependency and proceed instead of absorbing into the code base so that the original license and contributors are retained.

@asirota asirota self-assigned this Nov 5, 2024
@asirota asirota added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 5, 2024
@asirota asirota added this to the Phase 1 milestone Nov 5, 2024
@asirota
Copy link
Member

asirota commented Nov 5, 2024

@costdev please add docs to readme for the plugin please

@costdev
Copy link
Contributor Author

costdev commented Nov 5, 2024

Or Lets triage and decide weather we should go this route.

The main issue for me is making something MU in a not recommended way. The prescribed way is to move to mu-plugins folder and in the process make it unchangeable (no updates). If we are going to change that behavior lets make sure everyone know what they are getting into and then decide. Lets keep the PR open until a consensus is reached.

Sure, let's make sure we have consensus on the chosen path.

My interpretation was that the desire for implementing a Must-Use facility in the plugin was rooted in preventing other Administrators/manage_plugins cap holders from being able to deactivate or delete the plugin against a site owner's wishes, but without locking the plugin to a specific version and exposing it to possible security/incompatibility risks in future.

@namithj
Copy link
Contributor

namithj commented Nov 5, 2024

@costdev @asirota What if we make this a GIST (or link to this file somewhere) and include instructions on how to do the MU switch using the GIST. That way our official repo can maintain Core recommended workflow and not mix different licenses in its code while providing a pathway for those interested to push MU this way and still have updated delivered to their plugin.

@asirota
Copy link
Member

asirota commented Nov 7, 2024

@caseysoftware what do you think about making AU a "must-use" plugin and integrating code to make it so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add support for must use state of AspireUpdate
3 participants