Code Monkey home page Code Monkey logo

firebase-wordpress-plugin's Introduction

Integrate Firebase WordPress Plugin

Contributors: dalenguyen

Buy me a coffee: https://www.paypal.me/DaleNguyen

Tags: firebase, wordpress

Requires at least: 4.0.0

Tested up to: 6.5.2

Stable tag: 0.9.3

Requires PHP: 5.2.4

License: GPLv2 or later

License URI: http://www.gnu.org/licenses/gpl-2.0.html

Integrate Firebase is a plugin that helps to integrate Firebase features to WordPress

Announcement

If you want a secured implementation, with much more features, check the Interate Firebase PRO version.

Description

The Integrate Firebase Plugin will help a Firebase user to login to your WordPress interface - not to WordPress dashboard - from Firebase authentication. You can show user info display data that is only available to your Firebase users.

You also can view Real Time Database and Firestore from your Dashboard in Version 0.5.3

Links

Installation

If installing the plugin from wordpress.org:

  1. Upload the entire /integrate-firebase directory to the /wp-content/plugins/ directory.
  2. Activate Integrate Firebase Plugin through the 'Plugins' menu in WordPress.
  3. Profit.

Frequently Asked Questions

What can I do with this Integrate Firebase plugin?

At version 0.3.2, a user can integrate Firebase authentication to WordPress. That means you can:

  • log in, log out and show data only to logged in users.
  • Get Real Time database in Dashboard

How can I put a shortcode in a widget or WordPress editor? =

The example in this guide only shows you how to put in a PHP file. If you want to put the shortcode inside a widget or editor. You can simply do this:

[firebase_login][/firebase_login]

How can I add a login form to WordPress?

After adding Firebase credentials from Settings > Firebase. You can add login form through shortcodes:

echo do_shortcode("[firebase_login]");

If you want to create your own form. Please start with

. For submit button, you have to add 'firebase-form-submit' as an ID.

How can I show user info after login?

You can add a shortcode to show user's info

echo do_shortcode("[firebase_greetings]");

How can I show error when a user cannot login?

You can show error message when a user cannot login by using a shortcode

echo do_shortcode("[firebase_login_error class='your-optional-CSS-class-name'][/firebase_login_error]");

How can I show data for a not logged in user?

You can put your data as an HTML code inside a shortcode

echo do_shortcode("[firebase_show_not_login class='your-optional-CSS-class-name']YOUR HTML CODE[/firebase_show_not_login]");

How can I hide or show data for a logged in user?

You can put your data as an HTML code inside a shortcode

echo do_shortcode("[firebase_show class='your-optional-CSS-class-name']YOUR HTML CODE[/firebase_show]");

How can I show realtime database for a logged in user?

You can put your data as an HTML code inside a shortcode. Realtime data will be shown as a table with an id #if-realtime.

echo do_shortcode("[realtime class='your-optional-CSS-class-name' collection_name='string' document_name='string']");

How can I log out?

This is a shortcode for log out button.

echo do_shortcode("[firebase_logout]");

Screenshots

  1. After activating the plugin, you need enter Firebase credentials under Setting > Firebase.

Firebase Settings

  1. Please enter collection names in order to show the data from Real Time Database

Database Settings

  1. Please edit the read rules in order to view data from Firestore

Firestore Settings

Upgrade Notice

Please use github issues when submitting your logs. Please do not post to the forums.

firebase-wordpress-plugin's People

Contributors

dalenguyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firebase-wordpress-plugin's Issues

Problem with login form

I downloaded and activated "Integrate Firebase" plugin and created a WordPress page with [firebase_login] as a shortcode. The form states to enter name and email, but the name field expects @ sign. However, when entering my Firebase email and password, I am unable to login. The screenshot is below. What might be the problem? Also, after logging in, should I be seeing real-time database as if I was logged into Firebase?
Thank you!
loginform

Installation of Plugin

I am having a few issues - I was wondering if someone could kindly help me.

  1. I logged into my Wordpress website, searched for "Integrate Firebase".
  2. Clicked on "Install" for "Integrate Firebase".
  3. Went into Plugins and clicked "Activate" for "Integrate Firebase" plugin.
  4. Went to Settings > Firebase and added all my Firebase credentials.
  5. Added short code into a page:

[firebase_login][/firebase_login]

  1. A place for typing in "Email" & "Password" shows up.
  2. I enter in my "Email" & "Password".
  3. Nothing happens...

I guess what I wanted to know is - have I done everything correctly?

Is there a step I have missed?

Thank you!

image

image

Update #1 >>>>>

When I click on "Database" in "Firebase" under "Settings" - I successfully get this:

image

So it would seem that it is pulling successfully from Firebase - just don't know what I am doing wrong in integrating the short-code in a page then.

Update #2 >>>>>

I also updated my Authentication settings in Firebase to add the domain.

image

Integratiuon with WPBakery Page Builder

Is your feature request related to a problem? Please describe.
Put all the shortcode available in the WPBakery Page Builder

Describe the solution you'd like
Just put all the shortcode in the plugin, just like woocomerce or dokan did...

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Which fields does it relate to?
Firebase Auth, Realtime DB, Firestore, Storage...

Additional context
Add any other context or screenshots about the feature request here.

Deleting all claims seems to be an invalid operation?

Describe the bug
Not able to fully delete a custom claim

To Reproduce
Steps to reproduce the behavior:

  1. Go to users tab
  2. Find a user with an existing custom claim
  3. Click edit, delete the text in the claim box. Click Save
  4. Reload the page and user db, you will see that the claim is still present with the user.

Expected behavior
I expected the claim box to be empty due to deleting the content and saving the user before refreshing the page.

Additional context
I found that was able to successfully change the claim to 'false' and save it and reload to see the change. I'm assuming this is the preferred approach by the plugin. Some feedback to the user would be useful if this is the case. For example either not allowing the text to be deleted or indicating that removing the array of claims is not allowed when trying to click save. And maybe a suggestion to change to false instead.

I may make a separate feature request to get a more GUI-focused way to change existing claims (a checkbox or something).

How to get the latest versions installed?

How is the latest versions of the plugin installed? I have read though the docs, but cannot find any info about updating.

Du the whole plugin need to be deleted and reinstalled? Or can it be done in a easier way?

-Thanks

Write data

How to write data to firebase database on click of a button

Login Through Wordpress

I have the integrate firebase plug in for wordpress. I have the info in there like I should. I just do not know how to set up the login

Sync WP User Registration and Firebase Registration

I build a mobile app including the function of Firebase's Cloud Notification Service.
When a user signs up on my App, a new User will be created in my Firebase Project.
Everything works perfectly fine. However, when I decided to extend my Service by building an WordPress Website, I got a lot of trouble with including the Firebase Registration Part to Wordpress.
At the moment I'm using the standard Wordpress Login Page (wp-login.php) and just redesigned the style using a free version of loginpress. The Wordpress Site allows everyone to register and with the registration I need to create an Firebase Account in sync with the Wordpress account. (Actually I also need the password which is stored in Firebase to be the same as it is on Wordpress, because, when the user decides to switch to the App instead of the Website or vice versa, he needs to be abled to login without creating an other account.

Describe the solution you'd like
At the moment you are using seperate Shortcodes for the Firebase Authentication. Which would mean, that I have to manipulate the Login Page of Wordpress. As far as i understood, you need those Shortcodes to later crap the data using jQuery.
The Solution i'd prefer contains two steps:

  1. Add the option to use the regular Login Page of Wordpress using the fields inputs "user_pass" "user_login" of form "loginform" instead of your own shortcodes
  2. Adding the function "firebase.auth().createUserWithEmailAndPassword(email, password)" on the Wordpress hook "password_reset". Further this would mean, you also would need to change the password if the user already exists (for example by calling Firebase Auth API (https://identitytoolkit.googleapis.com/v1/accounts:update?key=[API_KEY]) in the Exception Case, when firebase says that the user account already exists.

Describe alternatives you've considered
I would love to see a Tutorial how to implement your Shortcodes into the regular Wordpress Login php, without manipulating the original files. Because, when I Update my project i don't want to lose the functionality.

Which fields does it relate to?
Firebase Auth

FrontEnd User Profile Maker

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

I would like the user to be able to create there own profile and log in. This way the user can purchase my product to create an account and use it as needed. I would prefer not having to let all users into my dashboard to create an acct.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add forgot password

should add forgot password button or link to form when using shortcode for custom form.
add

Short code for logged-in user with certain custom claim

Feature request for a new shortcode that shows/hides content for the current logged in user based on custom claims that user has/doesn't have.

Note on the bottom of this page:

https://firebase-wordpress-docs.readthedocs.io/en/latest/work-with-firebase-custom-claims.html

You tease us with this feature.

In the next update, I will update the plugin to support custom claims through shortcodes.

Just opening a ticket as a little reminder. Thanks again for all the effort on this plugin... I think with this feature, all of my primary use cases are handled.

Any way to customize the UI

The Firebase Frontend UI is nice but is there any way to customize it. I need to add some extra labels in the form. Basically where it show Sign in with email, I would like to have an H3 tag above that with some custom text

Be able to search others informations in a collection

Is your feature request related to a problem? Please describe.
Now a days, all the shortcode we can search for the document id.
I think that will be goog if we can search for all the informations.
For example:

[firestore class='your-class-name' collection_name='string' document_search='email' document_name='[email protected]' display_fields='email,displayName,role,uid']

Pull from Membership List to Sync to Firebase

Hi! This may be a dead end, but I thought I'd ask.

I'm working on building a website to correspond with an App built within Firebase. Clients come to our site, purchase the membership, create their login, and then download the app - sign in and voila. We have a membership area on the website with member-only content. Is there a way for your Plugin to pull directly from a Membership plugin, so that every new member gets auto-synced with the Firebase database?

Thanks!

Only getting data from Firestore, not RealTime DB

Great initiative for this app. Seems like the thing I need, though I'm not able to test it properly.

I'm able to connect to the FireStore DB (which I just created for testing) but not the corresponding Real Time DB. As you can see below, theres no output from RealTime, only from FireStore

Is there a way to verbose the output?

error

Support for Firebase Auth

Enhancement idea: provide support for Firebase Authentication feature out-of-the-box.

The use case is to use Firebase Authentication for mobile apps (this is ready) and for pwa apps (built using WordPress with this plugin and shortcodes).

Logout

Issues with logout. Using the shortcode you provide to logout works to sign you out of firebase and wordpress. HOWEVER: if you use a plugin to hide the admin bar, the shortcode you provide will provide a logout button and it will log you out of firebase however it does not log you out of wordpress

Consider use of FirebaseUI for login?

For UX/UI consistency it would be neat to have the option of FirebaseUI login:

https://github.com/firebase/firebaseui-web

We use this on our main site, so it would be nice to have a similar look and feel for login. It is recommended in the Firebase docs as well (https://firebase.google.com/docs/auth/web/firebaseui).

My guess is that you'd have a button instead of the "E-mail" and "Password" form currently implemented. And that button would pop up the "standard" login window provided by the FirebaseUI library. I think this would open the door to allowing smoother login via other providers if one's Firebase auth was configured to do so.

I'm unsure of the level of effort to add this option, but hoping you might consider it!

1000 limit on viewing users

Describe the bug
Users tab can only load up to 1000 users

To Reproduce
Steps to reproduce the behavior:

  1. Have 1000+ users in firebase auth
  2. Click on 'load users' in Users tab of plugin GUI
  3. Search for the word "Delete" and see there are 1000 results (one per row/user)
  4. See that all of your users are not loaded.

Expected behavior
Some method to see all users, perhaps paginate results, perhaps a filter (see other issue)

Screenshots
If applicable, add screenshots to help explain your problem. You can find the error code from inspecting the browser.

Desktop (please complete the following information):

  • OS: OSX 10.15.2
  • Browser Chrome 79.0.3945.130
  • Version 11.0

Additional context
We have roughly 1400 users in Firebase. Found this bug as I searched the Users page for a particular user after loading and couldn't find. Happy to follow up as needed.

How can I call a Cloudfirestore?

This is not a bug
When a read the documentation, I saw this shortcode [realtime class='your-class-name' collection_name='Users' document_name='string']
And I dont know how to use....

Can you put a example of a cloud firestore call users ?

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
The version of the plugin. E.g PRO v0.5.5

Screenshots
If applicable, add screenshots to help explain your problem. You can find the error code from inspecting the browser.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

New database

If I am setting up a new database and new wordpress site with no data available how do I parse the data to the proper collections? There are not setting or documents I found to explain this aspect. Please help

Nice to have JS error to GUI

Very minor request/suggestion for a future release.

Is your feature request related to a problem? Please describe.
When setting up the new version of the plugin, I set the project settings in "General", then navigate to "Users." A button is presented to "Click to load users." I clicked it and waited. Clicked again. Didn't know if there was an error or latency. There was no feedback in the GUI to indicate what might be happening. I opened the JS dev console and saw a helpful message about finishing setup in "Settings" tab.

Describe the solution you'd like
Would suggest sending that helpful console message (forget the exact words now, but something to the effect of finishing setup first in the "Settings" tab) to the GUI to reduce confusion.

Additional context
Happy to clarify if needed.

Word Press

I have put in the short code and submit button but, I can not get it to link to the firebase site. Not sure what I'm doing wrong

Sign In Success Url not working

I have pro version of the plugin.

  1. I have set Sign In Success Url to /accounts
  2. When someone go to the login page /login then they put in their login information and press submit they are logged in successful however the plugin redirects them back to the current page just without the login form. They are able to see content for login users however they are not being redirected. to /accounts

user not created in wordpress after login with firebase login

I am using the pro version of this plugin. I followed all the steps that are in the video turutals #1 and #2.

  1. I have a account in firebase but not wordpress.
  2. I login with your plugin login form and login is successful.
  3. Then I check my wordpress database using the admin account. I check for a new user which would be the user that I just login with in step 2. The user account is not created. Also I am not logged into firebase and wordpress the same time. What am I doing wrong

Note the functions folder is not in the plugin directory. I just used that folder to get the api keys and tokens as show in the video. If I need the functions folder can you tell me what path it should be placed in

Can you help me get wordpress and firebase users synced. I need to be able to have my firebase users in my wordpress database

Create new user in Firebase

Your plugin has a feature where on the backend we can add a new user. I have membership plugin where members need to be created in the wordpress database first. Can you add the feature where when a user create an account directly in wordpress then for that current user it will create an account for them in firebase

Data not showing up

Hi Dale, I am having issues getting the information pulled in from Firebase and Being able to login. Do you have other instructions that might help me.

Include a bottom to export Users

Is your feature request related to a problem? Please describe.
A button in the Dashboard/Userspage that export all users that is in Firebase

Describe the solution you'd like
A button in the Dashboard/Userspage that export all users that is in Firebase

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Which fields does it relate to?
Firebase Auth, Realtime DB, Firestore, Storage...

Additional context
Add any other context or screenshots about the feature request here.

Shortcode to display Firestore DB?

Hello. I see the Realtime DB shortcode, but nothing to display a Firestore shortcode. I tried changing "Realtime" to "Firestore" on the Realtime hsortcode, but that didn't work.

I have the Firestore connection set up in the admin, but no way to display it.

Thanks in advance for your help!

Enable use of custom claims

Haven't tried the plugin yet, but trying to evaluate the features.

Is there a way to enable use of custom claims from Firebase rather than relying on a database for user metadata? We already use custom claims for our website by checking if logged in users have a certain claim.

Would be ideal to have this plugin check if a logged in user has a certain claim in order to manage access. Is that possible?

For reference: https://firebase.google.com/docs/auth/admin/custom-claims

Firebaseui redirect URL, possible to default to current page?

We will have the login present as a gate for users to access everything beyond the beginning of a post. So the login will be on every post for not-logged-in users. In order for such a scheme to work with Firebaseui-web, the redirect on successful login would need to come back to the current page, not a general redirect.

Is this possible for me to configure in the current version or would it be a new feature?

Make possible to get just a few informations in a collectio for a document

Is your feature request related to a problem? Please describe.
How can I get just one information of a collection? For example: in the collection Users, I just want to bring the Photo... Is it possible to do that?

Describe the solution you'd like
I`m talking to something like this: [firestore class='your-class-name' collection_name='Users' display_fields='foto' document_name='hHmTfzqCcgTbMChH2K2dF8AoYES2']

When "Display_information" is the name of informations that we have in a collection... could be more than one

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Which fields does it relate to?
Firebase Auth, Realtime DB, Firestore, Storage...

Additional context
Add any other context or screenshots about the feature request here.

Not logged in message

Can I first say, thank you for this plugin. If you keep developing this I think you are onto something very powerful and profitable for you. Great start!

One thing I would really like right now is a short code to show content if you are not logged in. So exactly the same way as it shows content if you are but the opposite. This way we can have a message saying something like "Login to see the rest of the page" if they are not logged in.

This would be my first request.

The second request would be some message which said "sorry those login details were not correct" or similar when someone entered the wrong login details.

Great stuff so far though!

create a My account page to add or change information

Is your feature request related to a problem? Please describe.
I`m trying to create a My account page, but I cannot integrate the logged users with the Users collection.

For example, the user that are trying to log in is hHmTfzqCcgTbMChH2K2dF8AoYES2

and when this user logged in, I want to him see the information that are in this shortcode:
[firestore class='your-class-name' collection_name='Users' document_name='string']
How can I do this?

Describe the solution you'd like
[firestore class='your-class-name' collection_name='Users' document_name='current_uid' document_uid='id']

When:

  • document_name='current_uid' --- the UID that is logged in
  • document_uid='id' --- the locations of UID in the collections name 'Users'

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Which fields does it relate to?
Firebase Auth, Realtime DB, Firestore, Storage...

Additional context
Add any other context or screenshots about the feature request here.

Username

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I want my app users to use the forum on WP site to discuss feature and bugs and I want them to use their app firebase credentials. This will show everyone their email as username which has privacy issues.

Describe the solution you'd like
A clear and concise description of what you want to happen.
I want the username to be taken from a firestore collection as the username on the website.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

User Search

Is your feature request related to a problem? Please describe.
When clicking "Click to load users" in the "Users" tab, I get a full list of all of our users. However, that list is 100's of folks long. They only way to find a particular user is via using the browser to search the page. Unless I am missing a filter feature?

Describe the solution you'd like
I'd like a way to filter users or search for a particular user.

Describe alternatives you've considered
Searching the full list of users via browser command-F is all I seem to be able to do currently.

Which fields does it relate to?
Firebase Auth tab

Additional context
Would like to use this for the business folks to be able to manage claims so that I don't have to run a standalone program to do that updating. This search feature would be vital for that.

Happy to provide more details as needed.

firebase.User#updatePassword

Hi Dale

I'm brand new to using Firebase . I have a quick question.
My team has a mobile app, supported by Firebase. They asked me to set up a "forgot password" page on their WordPress website.Their users will be redirected to this page when they click on "forgot password" in the mobile app. I made a page with a simple form ( email, new password, confirm new password).

I want to update the user password in firebase.auth. For that I apparently need to call the firebase.User#updatePassword function, to use the password entered in the form to update the user matching the email entered in the form.

My question is this: Will the transaction work if I write my code in the Wordpress Custom CSS section?
Thank you

How use shortcode to get Data

hi Dale !!! ๐Ÿฅ‡

image

how can i get the value of "Numero" whit a shortcode ?

give me a example please !!! :)

Thaks !!! i dont understand the shortcode, im new in wordpress, sorry !!!

i dont understand this ---> echo do_shortcode("[firebase_show_not_login class='your-class-name']YOUR HTML CODE[/firebase_show_not_login]");

Integration Firebase plugin is cause issues with another wordpress plugin

I am using integration firebase pro in my wordpress site. I am also using another plugin called ARMember which is a membership plugin that allow me to have membership plans. The issue is when I activate the integration firebase pro plugin it causes one of my pages from ARMember not to load

see 2
see

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.