-
Notifications
You must be signed in to change notification settings - Fork 8
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
import and export features implemented #12
Conversation
Hi @lucasbhjf, First of all, thank you so much for this amazing work. However, before I merge, I have some considerations. Be free to implement yourself, or I might code myself. Up to you. 1) I don't see why we would force TRUNCATE the table. There are some cases when the user would like to import only, but keeping their old data.
I believe we need to ignore the auto-increment ID for these cases. 2) The functions name are too generic and I'm worried if it can cause a conflict with some other plugins or theme. For the ajax actions, I normally like simulating a directory for this kind, so I would rename for: 3) I also recommend the use of the functions wp_send_json_error() and wp_send_json_success() for AJAX, instead of To clarify: They do the same job. It's just an easy way to read, in my opinion. 4) For the Javascript, I'd like to implement an IIFE or a jQuery closure. I don't see why we would use global variables such as I really like your singleton. I normally code singletons when I code jQuery. Thanks for coding that way. I would wrap the jQuery(document).ready(function($) {
var importExport = {..}
importExport.init();
}); Lucas, thanks a lot for this work. I'm sorry being a little pick, but this simple plugin has been used for over 10k users and we need to make sure they won't have any issues with the update. É nóis! |
Hi @lucasbhjf, Just checking some more security issues, I'd like to implement a nonce for the ajax methods import(especially) and export. If you would like to try, here is a good way to use ajax within WordPress: |
update readme bower.json fix bower.json update fix bower.json version update fix bower.json fix bower.json fix bower.json
I'm sorry, but why would we add bower in a plugin? |
Hello, @leocaseiro, first of all, thanks for answering. I really enjoy your considerations and I understand that is important we follow the standard of things, as you mentioned, to make it maintainable. Bower was just a way to make easier the download and keep it popular and available (well, the plugin is available in Github and in Wordpress page, but Bower was an experimental feature because I use it a lot, feel free to use it or not as you like). Ask me anytime. Feedback are welcome! :) |
Just to keep you informed, I did a front end page for lay people. How it works: The secondary user( the user that id didn't match id 1) will see only a page the menu "Options" with a page the name or label of fields, just value. This is useful for customer that will care only about the value of things. I take as reference ACF. Maybe later we can implement a drag and drop(arrasta e solta) for replace fields of position. att. Lucas |
@leocaseiro, I think you should add screenshots to plugin, most people don't download plugins without see it working, this is sad but almost "automattic". |
Hi @lucasbhjf. Thanks for your big improvement on the plugin. In regards to Bower, I see Bower only as a dependency manager for frontend libraries. I was going to merge this branch, but unfortunately, I'll need to cleanup. There're some extra items that are not relevant for the plugin such as Bower, for example. I created a new branch and I'm refactoring all your suggestions/ideas to merge it later on. I''ll keep you up to date. Yep! I'm happy to add some screenshots. My idea was make a video, but I never had the time to do it. Could you please explain me your ideia of drag and drop in more details? (Escreve em Portugues se for mais fácil) Valeu! |
Aí, tentei ilustrar da melhor forma possível, eu dei o exemplo do ACF que é um plugin muito útil: Tem algumas ferramentas interessantes para fazer isso: https://github.com/isocra/TableDnD |
Thanks @lucasbhjf, I created a new issue #13 for that. This should be implemented in a different branch. I suggest we use the https://jqueryui.com/sortable/ which is on WP core and it's used in many places already. |
I'm closing this Pull Request in regards the release of We can discuss some other changes and improvements in others issues! I'll open one for internationalization as well. @lucasbhjf, Thanks a lot for your help. |
Hi Lucas, thanks a lot for your big improvement on the Custom Option Plus. We're Brazilian and I'd like to send you a feedback exclusivelly to you, so I'll write in Portuguese.(português) Plugin em WordPress com Bower, eu acho que nem tem como fazer isso. Se você quiser sugerir para eu publicar o COP para um package manager, eu acho até bem bacanca em utilizar o Composer. Que é próprio para bibliotecas PHP e existem muitos devs utilizando Composer para gerenciar os plugins de WordPress. Mesmo não ser tão comum, acho que poderia ser uma saída. Por fim, eu afirmo que eu ia apertar o botão aqui de "Merge", mas infelizmente agora este branch/repo está com muitas outras features que deveriam ser incluídas separadamente. Eu sempre quis e pretendo incluir uma tradução com .mo, conforme o issue que já discutimos aqui. Eu talvez esteja sendo meio fresco, mas eu gostaria de cada feature com um Pull Request específico com ela. Assim, a gente não se perde na timeline do git. E é bacana para acompanhar a evolução do repositório. Espero que entenda! Se você tiver tranquilo e quiser criar um PR(pull request) para cada item que a gente tem na lista de Issue. Eu farei um code-review e assim que estiver perfeito, vou apertar o botão de MERGE. Mais uma vez, UMA SUPER OBRIGADO pelo tempo, disposição, e principalmente pelo super corre com o seu código. Aqui deixo alguns links sobre o Composer com WordPress. |
@lucasbhjf, eu criei um gitter pra gente poder discutir o COP, se você estiver interessado https://gitter.im/WordPress-Plugin-Custom-Options-Plus/Lobby |
Po, valeu ai pela força e humildade, irmão! Agradeço primeiramente por fazer o plugin de fácil acesso ao público. Eu realmente sou novato nesse esquema de gerenciamento de pacotes, estou começando a usar o composer, npm e o bower porque facilita muito na instalação de projetos. A escolha do Bower foi sem pensar muito, eu uso pra baixar jquery, o próprio wordpress e o underscores(tema padrão do wordpress), e outras ferramentas bacanas feitas em js. Vamos usar o composer sim ou qualquer outro gerenciador de pacotes que atenda as nossas necessidades. Sou novo no github também, tive dificuldades para manter sincronizado com o plugin original, mas é o primeiro projeto que eu realmente contribui. Vou estudar mais as ferramentas apresentadas para fazer o melhor daqui para frente. Entendo também que é dificil englobar tantas mudanças em um curto espaço de tempo, até porque ele está sendo atualmente usado e precisa de ser estável, mas qualquer melhoria acrescentada ao original já é uma vitória conquistada. :). O melhor para o COP! Pode contar comigo se precisar de ajuda na hora de aplicar as tecnologias no master. valeu! |
Hello! Thanks for plugin, @leocaseiro, I'm brazilian too and i i'm wordpress developer for 1 year almost, i did some changes in plugin to support export and import and i'm about to do some mods to use it in my work, i hope you approve that, regards.