Improve Choose Update Source feature based on feedback
Some checks failed
ci/woodpecker/push/woodpecker Pipeline is pending
ci/woodpecker/tag/woodpecker Pipeline is pending
Plugin Asset Update / Push assets to WordPress.org (push) Has been cancelled
Build Release / Build and Create Release (push) Has been cancelled
Build Release / Deploy to WordPress.org (push) Has been cancelled
Some checks failed
ci/woodpecker/push/woodpecker Pipeline is pending
ci/woodpecker/tag/woodpecker Pipeline is pending
Plugin Asset Update / Push assets to WordPress.org (push) Has been cancelled
Build Release / Build and Create Release (push) Has been cancelled
Build Release / Deploy to WordPress.org (push) Has been cancelled
This commit is contained in:
19
.ai-workflows/local-env-vars.md
Normal file
19
.ai-workflows/local-env-vars.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Local Development Environment Variables
|
||||
|
||||
This file contains important paths and URLs for local development.
|
||||
|
||||
## Repository Paths
|
||||
- Local development repository: ~/Git/wp-fix-plugin-does-not-exist-notices
|
||||
- LocalWP plugin testing site storage: ~/Local/plugin-testing/app/wp-fix-plugin-does-not-exist-notices
|
||||
- LocalWP plugin testing site configuration: ~/Local/plugin-testing/conf/
|
||||
|
||||
## URLs
|
||||
- LocalWP plugin testing URL: http://plugin-testing.local/
|
||||
- PHP details: http://plugin-testing.local/local-phpinfo.php
|
||||
- XDebug info: http://plugin-testing.local/local-xdebuginfo.php
|
||||
- Adminer Evo: http://localhost:10010/?username=root&db=local
|
||||
- Mailpit: http://localhost:10000/
|
||||
|
||||
## Build and Deploy Scripts
|
||||
- Build script: ~/Git/wp-fix-plugin-does-not-exist-notices/build.sh
|
||||
- Local deploy script: ~/Git/wp-fix-plugin-does-not-exist-notices/deploy-local.sh
|
@ -1,6 +1,4 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
All notable changes to this project should be documented both here and in the main Readme files.
|
||||
|
||||
#### [2.1.1] - 2025-04-13
|
||||
#### Added
|
||||
|
21
README.md
21
README.md
@ -83,12 +83,13 @@ This plugin allows you to choose where you want to receive updates from:
|
||||
1. In the Plugins list, find "Fix 'Plugin file does not exist' Notices"
|
||||
2. Click the "Choose Update Source" link next to the plugin
|
||||
3. Select your preferred update source:
|
||||
- **Auto-detect** (default): Automatically determines the source based on installation origin
|
||||
- **WordPress.org**: Updates from the official WordPress.org repository (may have delays due to approval process)
|
||||
- **GitHub**: Updates directly from GitHub (usually has the latest version first)
|
||||
- **Gitea**: Updates from Gitea (usually has the latest version first)
|
||||
- **WordPress.org**: Updates from the official WordPress.org repository (has a version update delay due to the WP.org policy review and approval process, best for unmonitored auto-updates)
|
||||
- **GitHub**: Updates directly from the GitHub repo main branch for the latest stable release (requires Git Updater plugin, best for monitored updates where the latest features and fixes are needed immediately)
|
||||
- **Gitea**: Updates directly from the Gitea repo main branch for the latest stable release (requires Git Updater plugin, best for monitored updates and independence from big-tech)
|
||||
4. Click "Save" to apply your preference
|
||||
|
||||
> **Note:** If no preference is set, the plugin will automatically use the source it was installed from.
|
||||
|
||||
> **Note:** GitHub and Gitea options require the Git Updater plugin to be installed and activated.
|
||||
|
||||
## Frequently Asked Questions
|
||||
@ -165,7 +166,17 @@ Your experience and feedback helps others discover the plugin, and encourages co
|
||||
|
||||
### Contributing
|
||||
|
||||
Contributions are welcome! Please feel free to submit a Pull Request.
|
||||
Contributions are welcome! Please follow these steps to set up a development environment:
|
||||
|
||||
1. Install [LocalWP](https://localwp.com/) and create a clean site called "Plugin Testing" using the "Preferred" setup option
|
||||
2. Run "Site shell" once from the LocalWP page on the site's settings to ensure wp-cli is enabled
|
||||
3. Run "Add Run Configurations to VS Code" to update site configuration files in: ~/Local/plugin-testing/conf/
|
||||
4. Clone this repository to your local machine
|
||||
5. Use the build.sh and deploy-local.sh scripts to build and deploy the plugin for testing
|
||||
|
||||
[AugmentCode.com](https://augmentcode.com/) is recommended as a good all-in-one AI IDE for plugin development and testing.
|
||||
|
||||
Please feel free to submit a Pull Request with your improvements.
|
||||
|
||||
1. Fork the repository
|
||||
2. Create your feature branch: `git checkout -b feature/amazing-feature`
|
||||
|
@ -57,7 +57,18 @@
|
||||
|
||||
.fpden-update-source-toggle:hover {
|
||||
/* hover color is now inherited from theme */
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Close button styles */
|
||||
.fpden-close-modal {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 40px; /* Large size */
|
||||
color: #666;
|
||||
line-height: 30px;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
/* Source badges */
|
||||
|
@ -48,7 +48,14 @@ jQuery(document).ready(function($) {
|
||||
});
|
||||
|
||||
// Close modal when clicking overlay or close button
|
||||
$(document).on('click', '#fpden-modal-overlay, .fpden-close-modal', function() {
|
||||
$(document).on('click', '#fpden-modal-overlay', function() {
|
||||
$('#fpden-update-source-modal').hide();
|
||||
$('#fpden-modal-overlay').remove();
|
||||
});
|
||||
|
||||
// Separate handler for close button to ensure it works
|
||||
$(document).on('click', '.fpden-close-modal', function(e) {
|
||||
e.preventDefault();
|
||||
$('#fpden-update-source-modal').hide();
|
||||
$('#fpden-modal-overlay').remove();
|
||||
});
|
||||
@ -80,9 +87,7 @@ jQuery(document).ready(function($) {
|
||||
if (response.success) {
|
||||
// Update the badge
|
||||
var badgeText = source.charAt(0).toUpperCase() + source.slice(1);
|
||||
if (source === 'auto') {
|
||||
badgeText = 'Auto';
|
||||
} else if (source === 'wordpress.org') {
|
||||
if (source === 'wordpress.org') {
|
||||
badgeText = 'WP.org';
|
||||
}
|
||||
|
||||
|
@ -62,15 +62,15 @@ class Updater {
|
||||
*/
|
||||
private function determine_installation_source() {
|
||||
// Check for user preference first
|
||||
$user_preference = \get_option('fpden_update_source', 'auto');
|
||||
$user_preference = \get_option('fpden_update_source', '');
|
||||
|
||||
// If not set to auto, use the user preference
|
||||
if ($user_preference !== 'auto') {
|
||||
// If user has set a preference, use it
|
||||
if (!empty($user_preference)) {
|
||||
return $user_preference;
|
||||
}
|
||||
|
||||
// Otherwise, auto-detect as before
|
||||
$source = 'wordpress.org';
|
||||
// Otherwise, auto-detect the installation source
|
||||
$source = 'wordpress.org'; // Default to WordPress.org if unidentifiable
|
||||
|
||||
// Check if the plugin was installed from GitHub
|
||||
if ($this->is_github_installation()) {
|
||||
|
@ -100,12 +100,13 @@ This plugin allows you to choose where you want to receive updates from:
|
||||
1. In the Plugins list, find "Fix 'Plugin file does not exist' Notices"
|
||||
2. Click the "Choose Update Source" link next to the plugin
|
||||
3. Select your preferred update source:
|
||||
* **Auto-detect** (default): Automatically determines the source based on installation origin
|
||||
* **WordPress.org**: Updates from the official WordPress.org repository (may have delays due to approval process)
|
||||
* **GitHub**: Updates directly from GitHub (usually has the latest version first)
|
||||
* **Gitea**: Updates from Gitea (usually has the latest version first)
|
||||
* **WordPress.org**: Updates from the official WordPress.org repository (has a version update delay due to the WP.org policy review and approval process, best for unmonitored auto-updates)
|
||||
* **GitHub**: Updates directly from the GitHub repo main branch for the latest stable release (requires Git Updater plugin, best for monitored updates where the latest features and fixes are needed immediately)
|
||||
* **Gitea**: Updates directly from the Gitea repo main branch for the latest stable release (requires Git Updater plugin, best for monitored updates and independence from big-tech)
|
||||
4. Click "Save" to apply your preference
|
||||
|
||||
If no preference is set, the plugin will automatically use the source it was installed from.
|
||||
|
||||
**Note:** GitHub and Gitea options require the Git Updater plugin to be installed and activated.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
@ -966,16 +966,10 @@ function fpden_add_update_source_modal() {
|
||||
<p>Select where you want to receive plugin updates from:</p>
|
||||
|
||||
<form id="fpden-update-source-form">
|
||||
<label>
|
||||
<input type="radio" name="update_source" value="auto" <?php checked($current_source, 'auto'); ?>>
|
||||
Auto-detect (recommended)
|
||||
<span class="fpden-source-description">Automatically determines the update source based on where the plugin was installed from.</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="radio" name="update_source" value="wordpress.org" <?php checked($current_source, 'wordpress.org'); ?>>
|
||||
WordPress.org
|
||||
<span class="fpden-source-description">Updates from the official WordPress.org plugin repository. Will have a version update delay due to allow for the WP.org policy review and approval process. Best for unmonitored auto-updates.</span>
|
||||
<span class="fpden-source-description">Updates from the official WordPress.org plugin repository. Has a version update delay, to allow for the WP.org policy review and approval process. Best for unmonitored auto-updates.</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@ -1011,12 +1005,12 @@ function fpden_save_update_source() {
|
||||
}
|
||||
|
||||
// Get and sanitize source
|
||||
$source = isset($_POST['source']) ? sanitize_text_field($_POST['source']) : 'auto';
|
||||
$source = isset($_POST['source']) ? sanitize_text_field($_POST['source']) : '';
|
||||
|
||||
// Validate source
|
||||
$valid_sources = ['auto', 'wordpress.org', 'github', 'gitea'];
|
||||
$valid_sources = ['wordpress.org', 'github', 'gitea'];
|
||||
if (!in_array($source, $valid_sources)) {
|
||||
$source = 'auto';
|
||||
$source = ''; // Empty means use auto-detection
|
||||
}
|
||||
|
||||
// Save option
|
||||
|
Reference in New Issue
Block a user