Disabling/enabling plugins
Disabling/enabling plugins
A feature that I find is very much missing in CMSimple is an option to disabling/enabling plugins without uninstalling/reinstalling them.
I like to play around with lots of plugins and sometimes of course they step on each others toes and to prevent that I usually uninstall the plugin. But it's becoming a hassle because in my testing environment I have to uninstall and reinstall plugins lots of times - including setting file permissions etc. every time.
I have came up with my own little solution for now: Editing the plugin loader code making it skip any plugin with a "#" at the start of the folder name and then I just have to rename a plugin folder to enable/disable it.
But it would be so much more convenient to be able to disable/enable plugins from the CMS system itself. How 'bout it?
- S. Korvell
PS: Hope I hit the right forum section...
I like to play around with lots of plugins and sometimes of course they step on each others toes and to prevent that I usually uninstall the plugin. But it's becoming a hassle because in my testing environment I have to uninstall and reinstall plugins lots of times - including setting file permissions etc. every time.
I have came up with my own little solution for now: Editing the plugin loader code making it skip any plugin with a "#" at the start of the folder name and then I just have to rename a plugin folder to enable/disable it.
But it would be so much more convenient to be able to disable/enable plugins from the CMS system itself. How 'bout it?
- S. Korvell
PS: Hope I hit the right forum section...
Re: Disabling/enabling plugins
Hello,
maybe we find a solution in the next version, we already have thought about sometimes, but other things was more important,
Gert
maybe we find a solution in the next version, we already have thought about sometimes, but other things was more important,
Gert
Re: Disabling/enabling plugins
Hi Korvell, hi Gert,
quite a while ago Manu suggested basically the same. I suggested to use an FTP client to move the folders out of plugins/ and later move them back. Another solution (I would prefer this wherever possible) is to make such tests on a localhost (with Portable_XH that's even possible from an USB drive without any installation -- Windows only).
But OTOH a possibility to disable plugins completely from CMSimple's backend (without the need to use an FTP client) might be a nice addition (similar to the way that's handled by browsers regarding the plugins: activate/deactivate). This plugin management could even be handled by a separate plugin to keep the core small and the system modular (and to avoid the risk, that an inexperienced user disables a needed plugin inadvertently). The only necessary modification to the pluginloader would be to skip deactivated plugins. So it just has to agreed upon how deactivated plugins are marked. Renaming the plugin's folder is a simple solution, but to do this from PHP it would require write permissions for the folder. Perhaps an alternative is a determined file in each plugin's folder (say, .active) that just keeps a number (0/1) to signal the plugins activation. This way only this file would need write permissions.
Perhaps this plugin management can even be merged with the update availability check and some versioning information?
Christoph
quite a while ago Manu suggested basically the same. I suggested to use an FTP client to move the folders out of plugins/ and later move them back. Another solution (I would prefer this wherever possible) is to make such tests on a localhost (with Portable_XH that's even possible from an USB drive without any installation -- Windows only).
But OTOH a possibility to disable plugins completely from CMSimple's backend (without the need to use an FTP client) might be a nice addition (similar to the way that's handled by browsers regarding the plugins: activate/deactivate). This plugin management could even be handled by a separate plugin to keep the core small and the system modular (and to avoid the risk, that an inexperienced user disables a needed plugin inadvertently). The only necessary modification to the pluginloader would be to skip deactivated plugins. So it just has to agreed upon how deactivated plugins are marked. Renaming the plugin's folder is a simple solution, but to do this from PHP it would require write permissions for the folder. Perhaps an alternative is a determined file in each plugin's folder (say, .active) that just keeps a number (0/1) to signal the plugins activation. This way only this file would need write permissions.
Perhaps this plugin management can even be merged with the update availability check and some versioning information?
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: Disabling/enabling plugins
I thought also about this. I work now on kind of Plugins Handbook. When it will be ready depends on time. But my intention is to have an installation with all installed plugins in a pages structure>
[code\h1 - Plugin name + basic description
h2 - Syntax exapmple
h2 - Demo[/code]
Now, that I have all plugins installed, I can't see them all in their drop-down list and it takes time to find the one, I actually make the page for. But anyway, some plugins may conflict with others. So the possibility to switch a plugin out/on would be really very smart.
I tried it by changing a name of a plugin to .plugin. And it seems to work. So I think about the Korvel's suggestion.
Plugin manager
[code\h1 - Plugin name + basic description
h2 - Syntax exapmple
h2 - Demo[/code]
Now, that I have all plugins installed, I can't see them all in their drop-down list and it takes time to find the one, I actually make the page for. But anyway, some plugins may conflict with others. So the possibility to switch a plugin out/on would be really very smart.
I tried it by changing a name of a plugin to .plugin. And it seems to work. So I think about the Korvel's suggestion.
Plugin manager
- function for reading and returning the list of installed plugins - regardless if they are visible or hidden (exceplt of system plugins, which must not be switched off)
- check box for each plugin
- function checking all checboxes and renaming all checked plugins to .plugins
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Disabling/enabling plugins
Hallo,
I have played around a little bit and made a plugin "pluginmanager".
It only works wit some small changes in the index.php of pluginloader, so it is not a publishing, just an idea, how it could work. At first we must publish a new version of CMSimple_XH, with the new pluginloader.
The download contains:
- the pluginmanager plugin
- a new index.php of pluginloader
- the data file "disabled_plugins.txt" (needs writing permissions)
!!! JUST A TOY - use with caution !!! (for CMSimple_XH 1.5 or higher)
Download: http://www.ge-webdesign.de/cmsimple/dlc ... php?id=376
So we could have (beside filebrowser and pagemanager) a pluginmanager,
Gert
I have played around a little bit and made a plugin "pluginmanager".
It only works wit some small changes in the index.php of pluginloader, so it is not a publishing, just an idea, how it could work. At first we must publish a new version of CMSimple_XH, with the new pluginloader.
The download contains:
- the pluginmanager plugin
- a new index.php of pluginloader
- the data file "disabled_plugins.txt" (needs writing permissions)
!!! JUST A TOY - use with caution !!! (for CMSimple_XH 1.5 or higher)
Download: http://www.ge-webdesign.de/cmsimple/dlc ... php?id=376
So we could have (beside filebrowser and pagemanager) a pluginmanager,
Gert
Re: Disabling/enabling plugins
Hi Gert,
that's very nice! Particularly I like the idea to store the disabled plugins in a single file in the plugins/ folder.
One thing to consider: perhaps it's better to avoid loading any plugin files at all (so possible conflicts can be checked), if the plugin is disabled. I've made a quick draft of this: http://3-magi.net/downloads/disabled_plugins.zip.
@all: This is a DEV version for demonstration purposes only. Do not use it in an production environment!
To hide the plugin menu entry of disabled plugins, change line 402 in cmsimple/cms.php:
Christoph
that's very nice! Particularly I like the idea to store the disabled plugins in a single file in the plugins/ folder.
One thing to consider: perhaps it's better to avoid loading any plugin files at all (so possible conflicts can be checked), if the plugin is disabled. I've made a quick draft of this: http://3-magi.net/downloads/disabled_plugins.zip.
@all: This is a DEV version for demonstration purposes only. Do not use it in an production environment!
To hide the plugin menu entry of disabled plugins, change line 402 in cmsimple/cms.php:
Code: Select all
if (strpos($plugin, '.') === false && file_exists($pth['folder']['plugins'] . $plugin . '/admin.php') && !stristr($disabled_plugins, $plugin)) {
Christoph M. Becker – Plugins for CMSimple_XH
Re: Disabling/enabling plugins
I know, but:cmb wrote:To hide the plugin menu entry of disabled plugins, change line 402 in cmsimple/cms.php:
1. I did not want to change a further file (cms.php)
2. I want to see all installed Plugins in the plugins admin menu. Now a hint appears, if you choose a plugin and the plugin is disabled, with a link to the PluginManager.
A new download is online under the same link:
Download: http://www.ge-webdesign.de/cmsimple/dlc ... php?id=376
Gert
Re: Disabling/enabling plugins
Hi Gert,
But I would like to suggest two changes:
Okay.Gert wrote:I know, but:
1. I did not want to change a further file (cms.php)
2. I want to see all installed Plugins in the plugins admin menu. Now a hint appears, if you choose a plugin and the plugin is disabled, with a link to the PluginManager.
But I would like to suggest two changes:
- Avoiding the inclusion of the required_classes, if the plugin is disabled (line 232)
- using $pth['folder']['plugins'] in line 95 and 97 (currently it doesn't work for subsites/second languages)
Christoph M. Becker – Plugins for CMSimple_XH
Re: Disabling/enabling plugins
The plugin is NOT READYcmb wrote:But I would like to suggest two changes:
* Avoiding the inclusion of the required_classes, if the plugin is disabled (line 232)
* using $pth['folder']['plugins'] in line 95 and 97 (currently it doesn't work for subsites/second languages)
I know, what I have to do to make it working multilingual and in Subsites, there also will be language files in the future and a message, if the data file is not writable and so on ...
It's just a Demo to find out, if someone likes it, and if it makes sense to finish the plugin. If we add it to the next version, we also can change something in the cms.php, in my dev installation the disabled plugins are a little bit darker and smaller in the admin menu of plugins,
Gert
Re: Disabling/enabling plugins
Hello,
Pluginmanager_XH beta02 is available for download.
The beta01 was a toy and a demo, beta02 is for testing purposes.
!!! FOR TESTING PURPOSES ONLY - use with caution !!! (for CMSimple_XH 1.5.3 only)
Download: http://www.ge-webdesign.de/cmsimple/dlc ... php?id=376
Pluginmanager_XH beta02 contains a modified cms.php, to identify disabled plugins in the admin menu "Plugins".
Please test at first, if there are any problems with only the modified cms.php and index.php of pluginloader (without the plugin "pluginmanager" and without the data file "disabled_plugins.txt").
Pluginmanager_XH beta02 works in second languages and subsites, speaks en, de and default, and there are some improvements of the backend and some new messages,
Gert
Pluginmanager_XH beta02 is available for download.
The beta01 was a toy and a demo, beta02 is for testing purposes.
!!! FOR TESTING PURPOSES ONLY - use with caution !!! (for CMSimple_XH 1.5.3 only)
Download: http://www.ge-webdesign.de/cmsimple/dlc ... php?id=376
Pluginmanager_XH beta02 contains a modified cms.php, to identify disabled plugins in the admin menu "Plugins".
Please test at first, if there are any problems with only the modified cms.php and index.php of pluginloader (without the plugin "pluginmanager" and without the data file "disabled_plugins.txt").
Pluginmanager_XH beta02 works in second languages and subsites, speaks en, de and default, and there are some improvements of the backend and some new messages,
Gert