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

Plugin system #14

Closed
nodiscc opened this issue Aug 3, 2014 · 11 comments
Closed

Plugin system #14

nodiscc opened this issue Aug 3, 2014 · 11 comments
Labels
discussion enhancement plugin bells and whistles tools developer tools
Milestone

Comments

@nodiscc
Copy link
Member

nodiscc commented Aug 3, 2014

update: See https://github.com/shaarli/Shaarli/wiki/Ideas-for-plugins

Hey, I did a roundup of issues on https://github.com/sebsauvage/Shaarli/issues and tried to list requests/bugs that would fit as plugins. Then see what we have:

Add/remove page elements

Sharing tools

Thumbnailers

Themes

Comment systems

@Sbgodin
Copy link

Sbgodin commented Aug 3, 2014

Great work! Congratulation. Well, what does @sebsauvage thinks about the seditious team building the seditious shaarli?

@e2jk
Copy link

e2jk commented Aug 4, 2014

Thanks @nodiscc for this thorough investigation work.
What I fail to understand, is what makes it so different:

  • having a "plugin" system that are enabled by configuration switches
  • having the features directly backed in the standard code, and enabled by configuration switches?

In other words, why put the HTML files in a separate plugin folder, instead of just putting it with the other files in the tpl folder?

We'll be bound of having "plugins" (e.g. share to Twitter) which just add a link in an existing template. those plugins would not have a different HTML file, which means some plugins are in the main code directly, and others in the plugins directory. After a while, it'll just be confusing. For example, we currently have thumbnails for a couple of sites in the main code. Why would we treat Deviantart differently, and have that turned off by default, whereas e.g. xkcd is included inthe main code. Or does that mean we move xkcd as a plugin, and turn it off by default? Doesn't seem like a better idea to me.

So either create plugins that are just features available in the main code, but turned off by default, or not have any plugins, keep the code simple (KISS-principle) and just be firm in refusing some features. Although I'm not completely against the first option, I think it makes more sense to keep it simple. Otherwise we'll soon be building some kind of half-backed social media site (multi-user link sharing with comments included), which will do a lot of things in a mediocre way, an nothing in an excellent way...

That being said, I would call out the themes functionality as something that makes sense to be built as "plugin", e.g. a themes folder, there within a folder with the name of the theme, and in that folder the CSS file, and potentially extra HTML files (if needed by the theme). You would activate that theme in the config file, by listing the name of the theme.

@nodiscc
Copy link
Member Author

nodiscc commented Nov 8, 2014

@e2jk @Sbgodin @sebsauvage @timovn @BoboTiG @Alkarex Working plugin system proposal at #52

@e2jk
Copy link

e2jk commented Feb 18, 2015

I have just created a page on the wiki to list plugin suggestions, as a way to unclutter the issues list. But that's before I had realized we had this issue open. Should we delete the wiki page instead?
The idea behind the wiki page is to be able to close issues for plugins that nobody is picking up at the moment, to have a somewhat cleaner issues list, which enables to focus on what is broken. First quality, then quantity...

@nodiscc
Copy link
Member Author

nodiscc commented Feb 18, 2015

@e2jk Thanks for creating the wiki page; we can move "wontfix" plugin requests there (eg. #58). Just make sure the wiki page is linked from somewhere (the wiki Home page, or the README)

Should we delete the wiki page instead

I'd keep both for the moment, this issue is a great way to see what would be required for a plugin system, as the current proposal #52 is not complete (I'll have to rebase/redo it on top of the latest changes). We can close this issue when the plugin system is implemented.

For example, judging by the list at the top:

  • I think we need a plugin system as a way to inject components in the HTML head (piwik), in the toolbar (configurable custom page link, JS button), in the linklist info bar (links to external sharing/comments/archival services, qr, Link to dead link signalling ...), in the footer (JS includes).
  • We may need to enable adding new fields to the editlink dialog via plugins, to allow them to set custom properties for links (thumbnail URL? "via" field? Custom comment url? geo-URI ?) via plugins, but it's not as clear. The savedb() function would also need to be changed to allow extra fields (currently they are hardcoded).
  • Some ideas listed at the top would probably be better implemented in Shaarli's core (new bookmarklets, tagcloud improvments), or marked wontfix because they would require complex plugin infrastructure or are insecure (HTML descriptions support, syntax highlighting...)

@nodiscc
Copy link
Member Author

nodiscc commented Mar 4, 2015

Plugin system pull request at #129

@nodiscc
Copy link
Member Author

nodiscc commented Mar 5, 2015

I've closed #129. The plugin system is available in branch https://github.com/shaarli/Shaarli/tree/new-plugin-system. Feel free to add your work on top of it and send Pull Requests. Items that need to be dealt with before merging:

  • QR code onClick event is broken
  • plugin option defaults should not be defined in index.php, rather, explain they have to be configured (in the wiki)bsp@TE:~/git/Shaarli/tpl/plugins (new-plugin-system %=)$

I'll sort more items from the original list and forward people here.

@nodiscc
Copy link
Member Author

nodiscc commented Mar 11, 2015

Clean Pull Request back at #164

@nodiscc
Copy link
Member Author

nodiscc commented Apr 6, 2015

Blocked by #163

@ArthurHoaro
Copy link
Member

Blocked by #163

Why? Also, #163 if 1.0 milestone. We can work on it later.

@virtualtam virtualtam added the tools developer tools label Jul 8, 2015
@virtualtam virtualtam modified the milestones: 0.9.0, 0.5.1, 0.6.0 Jul 30, 2015
@nodiscc nodiscc removed their assignment Sep 29, 2015
@ArthurHoaro
Copy link
Member

Closing this with #275.

Please open separate issues for plugin suggestion.

ajabep added a commit to ajabep/Shaarli that referenced this issue Apr 2, 2021
When we try to access the atom feed and have no bookmarks, it raised the following exception :

```
Call to a member function reorder() on array /webroot/application/bookmark/BookmarkFileService.php:143
#0 /webroot/application/feed/FeedBuilder.php(106): Shaarli\Bookmark\BookmarkFileService->search(Array, 'public', false, false, true)
shaarli#1 /webroot/application/front/controller/visitor/FeedController.php(47): Shaarli\Feed\FeedBuilder->buildData('atom', Array)
shaarli#2 /webroot/application/front/controller/visitor/FeedController.php(20): Shaarli\Front\Controller\Visitor\FeedController->processRequest('atom', Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#3 [internal function]: Shaarli\Front\Controller\Visitor\FeedController->atom(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#4 /webroot/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#5 /webroot/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#6 /webroot/application/front/ShaarliMiddleware.php(55): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#7 [internal function]: Shaarli\Front\ShaarliMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#8 /webroot/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Array, Array)
shaarli#9 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#10 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#11 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#12 /webroot/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#13 /webroot/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#14 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#15 /webroot/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#16 /webroot/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#17 /webroot/index.php(177): Slim\App->run(true)
shaarli#18 {main}
```
ArthurHoaro pushed a commit to ArthurHoaro/Shaarli that referenced this issue May 8, 2021
When we try to access the atom feed and have no bookmarks, it raised the following exception :

```
Call to a member function reorder() on array /webroot/application/bookmark/BookmarkFileService.php:143
#0 /webroot/application/feed/FeedBuilder.php(106): Shaarli\Bookmark\BookmarkFileService->search(Array, 'public', false, false, true)
#1 /webroot/application/front/controller/visitor/FeedController.php(47): Shaarli\Feed\FeedBuilder->buildData('atom', Array)
#2 /webroot/application/front/controller/visitor/FeedController.php(20): Shaarli\Front\Controller\Visitor\FeedController->processRequest('atom', Object(Slim\Http\Request), Object(Slim\Http\Response))
#3 [internal function]: Shaarli\Front\Controller\Visitor\FeedController->atom(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#4 /webroot/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#5 /webroot/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#6 /webroot/application/front/ShaarliMiddleware.php(55): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#7 [internal function]: Shaarli\Front\ShaarliMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#8 /webroot/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Array, Array)
shaarli#9 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#10 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#11 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#12 /webroot/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#13 /webroot/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#14 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#15 /webroot/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#16 /webroot/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#17 /webroot/index.php(177): Slim\App->run(true)
shaarli#18 {main}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement plugin bells and whistles tools developer tools
Projects
None yet
Development

No branches or pull requests

5 participants