Comments (3)
I did some more tests and found that if I outcomment the "non-versioned variants of the update checker classes" at the end of the class, both plugins work fine:
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
/*
if ( !class_exists('PluginUpdateChecker', false) ) {
class PluginUpdateChecker extends PluginUpdateChecker_2_2 { }
}
if ( !class_exists('PluginUpdate', false) ) {
class PluginUpdate extends PluginUpdate_2_2 {}
}
if ( !class_exists('PluginInfo', false) ) {
class PluginInfo extends PluginInfo_2_2 {}
}
*/
As my plugin is named "Maps Marker Pro", my PUC class is first loaded I guess and so when PUC for "UpDraftPlus" is loaded afterwards, the code above has already loaded PUC2.2 which breaks the PUC for UpdraftPlus - at least this is what I think happens.
what would be your advice here, taking into account that multiple PUC instances with different versions might be active on a WordPress site?
from plugin-update-checker.
Are both plugins instantiating a specific version of PUC by using e.g. new PluginUpdateChecker_2_0(...)
, or are they using PucFactory::buildUpdateChecker
which always gives you the newest loaded version? Or some combination of both?
If both plugins explicitly ask for a specific version, there shouldn't be any conflicts (and if there are, then that's a bug in PUC). On the other hand, if a plugin uses the "give me the newest version" approach, then it must be prepared to actually support the newest version of PUC, and things may break if it does not.
I did some more tests and found that if I outcomment the "non-versioned variants of the update checker classes" at the end of the class, both plugins work fine [...]
Ah, it sounds like UpDraftPlus is using the old way to instantiate the update checker that didn't really allow for running multiple different versions at the same time. I should probably deprecate or remove those classes.
In this case, removing that code from your copy of plugin-update-checker.php would probably be the easiest solution.
from plugin-update-checker.
Thanks for the prompt reply!
You seem to be right - UpDraftPlus is using the following code to load PUC:
$plug_updatechecker = new PluginUpdateChecker($this->url."/plugin-info/", WP_PLUGIN_DIR.'/'.$this->slug.'/'.$this->slug.'.php', $this->slug, 24);
while I am using
$run_PluginUpdateChecker = new PluginUpdateChecker_2_2(
$lmm_plugin_updater_url,
plugin_dir_path( __FILE__ ) . 'leaflet-maps-marker.php',
'leaflet-maps-marker-pro',
'12',
'leafletmapsmarkerpro_pluginupdatechecker'
);
I will remove the "non-versioned variants of the update checker classes" from my PUC class as I do not use them within my plugin and those might only conflict with other plugins.
from plugin-update-checker.
Related Issues (20)
- Disable Update Mechanism / Hooks for License Management HOT 8
- 404 Issue when Updating (Fine grained tokens?) HOT 2
- enableReleaseAssets() no longer the supported method HOT 5
- Error PUC 5.1 does not support GitHub in ... HOT 13
- Question about translations HOT 2
- PHP 8.2 Compatibility - Deprecation Notice HOT 3
- "Can't to read the plugin header" errors HOT 2
- Deprecated error HOT 2
- Deprecation notices PHP8 HOT 3
- Some assistance with a universal updater for a private repo HOT 6
- Unable to check version HOT 7
- Using PUC on an external server HOT 2
- Fatal error: Uncaught Error: Class 'YahnisElsts\PluginUpdateChecker\v5p1\DebugBar\Panel' not found HOT 11
- API for self update function HOT 11
- Fatal Error: Unable to determine if plugin or theme HOT 7
- Add query arg to requested .php file HOT 4
- Exclude repo file when updating my plugin HOT 1
- Not seeing "Install Update Now" button in plugin details popup HOT 5
- installed plugin on view details showing "install Now" instead "latest Version installed" HOT 2
- Lite version of the project HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugin-update-checker.