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

WordPress Plugin #38

Open
ManiKarthik opened this issue Aug 3, 2016 · 7 comments
Open

WordPress Plugin #38

ManiKarthik opened this issue Aug 3, 2016 · 7 comments

Comments

@ManiKarthik
Copy link

Would love to see a WordPress plugin. Most WP plugins are either slow or just clunky with bloated code and unnecessary frills. Since page load time is a big concern for websites these days, would be great to have a WP plugin built that has no JS and loads fast without using much resoruces.

@apkoponen
Copy link

Sounds awesome! I think the biggest part of the plugin would be the admin UI. Otherwise it is fairly simple. Should we use the same generator JS as on the site to generate button code or do it with PHP in order to better support for e.g. localization? This is always extra work and I don't know what would be ideal for @mxstbr.

We should support three ways for showing the buttons:

  • A PHP function for templates, sharingbuttons_io($options).
  • A shortcode, [sharingbuttons_io option1="foo" option2="bar" ... ]
  • Admin page, where the buttons can be enabled to be shown above/below the content and for selected post types.

@mxstbr
Copy link
Owner

mxstbr commented Aug 4, 2016

Should we use the same generator JS as on the site to generate button code or do it with PHP in order to better support for e.g. localization?

Could we make the generator JS (and thus the site) better? It seems kind of weird to support two codebases doing almost the same thing 😉

Otherwise this sounds absolutely amazing, can't wait for this to happen!

@brianschildt
Copy link

I know it is a bit different, but is has the same purpose - No tracking social buttons - https://github.com/privacore/sharebuttons-wp

@apkoponen
Copy link

@mxstbr Okay. How would you think that we could dynamically fill in the URL and the title of the page/post that were on when using JS generator code?

@mxstbr
Copy link
Owner

mxstbr commented Aug 4, 2016

@apkoponen I've honestly never built a WordPress plugin before so I really have no idea 😊 however you want to do this is honestly fine with me!

@apkoponen
Copy link

I was just checking, if you had better ideas than me, because I had a more in depth to the sharingbuttons.io site and realized my initial implementation idea would not work. I initially thought we could just use the JS script to generate the HTML and CSS output, store it to the DB and just input it to the pages. Implementing this would be super easy. However, it would only work if we want to use the same URL and text on every page on the website (which does not seem too useful?).

If we want to support proper localization of the text in the buttons + dynamic URL and text based on the site we're on we can't really utilize much of the application logic from sharingbuttons.io site. We could use the script on the admin site to show the preview of what the buttons would look like and use the HTML and CSS you've done, but otherwise we'd need to implement the display logic (and options storage) in PHP from scratch. This would be not be a lot of work, as the whole app is not too complicated, but I'm not sure if it's worthwhile, as there are 1000+ "share" plugins for WordPress (https://wordpress.org/plugins/search.php?q=share) and very similar plugins already exists (e.g. https://wordpress.org/plugins/dvk-social-sharing/ that I've used previously).

We could, of course, load the JS on every page and give it parameters through PHP using a script tag that outputs global variables, but that pretty much nullifies the whole "no extra JS thing". :)

@jcage88
Copy link

jcage88 commented Aug 29, 2016

I'd like to get such a plugin for my website too. Does it matter how the website is created? Will it be ok if I use some templates for it from http://www.templatemonster.com/wordpress-themes.php for example? Thanks for your help in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants