Skip to content

Commit

Permalink
Merge pull request #142 from dalenguyen/develop
Browse files Browse the repository at this point in the history
Updated scripts & moved script to body
  • Loading branch information
Dale Nguyen authored Jan 31, 2021
2 parents 0f291ac + 21c47cf commit 5dbf3bd
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## [ 0.8.0 ] - 30-01-2021

- Updated firebase packages to 8.2.5
- Moved scripts to the end of body tag

## [ 0.7.0 ] - 18-08-2020

- Fixed add_options_page error
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Requires at least: 4.0.0

Tested up to: 4.9.6

Stable tag: 0.7.0
Stable tag: 0.8.0

Requires PHP: 5.2.4

Expand Down
10 changes: 5 additions & 5 deletions includes/class.firebase-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public static function load_firebase_admin_js() {

wp_enqueue_style('firebase-admin', plugin_dir_url(dirname(__FILE__)) . 'css/firebase-admin.css');

wp_enqueue_script('firebase_app', 'https://www.gstatic.com/firebasejs/7.18.0/firebase-app.js', array(), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase_auth', 'https://www.gstatic.com/firebasejs/7.18.0/firebase-auth.js', array(), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase_database', 'https://www.gstatic.com/firebasejs/7.18.0/firebase-database.js', array(), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase_firestore', 'https://www.gstatic.com/firebasejs/7.18.0/firebase-firestore.js', array(), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase_app', 'https://www.gstatic.com/firebasejs/8.2.5/firebase-app.js', array(), FIREBASE_WP_VERSION, true);
wp_enqueue_script('firebase_auth', 'https://www.gstatic.com/firebasejs/8.2.5/firebase-auth.js', array(), FIREBASE_WP_VERSION, true);
wp_enqueue_script('firebase_database', 'https://www.gstatic.com/firebasejs/8.2.5/firebase-database.js', array(), FIREBASE_WP_VERSION, true);
wp_enqueue_script('firebase_firestore', 'https://www.gstatic.com/firebasejs/8.2.5/firebase-firestore.js', array(), FIREBASE_WP_VERSION, true);

wp_enqueue_script('firebase-admin', plugin_dir_url(dirname(__FILE__)) . 'js/firebase-admin.js', array('jquery'), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase-admin', plugin_dir_url(dirname(__FILE__)) . 'js/firebase-admin.js', array('jquery'), FIREBASE_WP_VERSION, true);
wp_localize_script('firebase-admin', 'firebaseDatabaseOptions', array(
'databaseType' => self::$options_database['database_type'],
'collections' => self::$options_database['collection_names'],
Expand Down
10 changes: 5 additions & 5 deletions includes/class.firebase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public static function load_firebase_js() {

wp_enqueue_style('firebase', plugin_dir_url(dirname(__FILE__)) . 'css/firebase.css');

wp_enqueue_script('firebase_app', 'https://www.gstatic.com/firebasejs/7.18.0/firebase-app.js', array(), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase_auth', 'https://www.gstatic.com/firebasejs/7.18.0/firebase-auth.js', array(), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase_database', 'https://www.gstatic.com/firebasejs/7.18.0/firebase-database.js', array(), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase_firestore', 'https://www.gstatic.com/firebasejs/7.18.0/firebase-firestore.js', array(), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase_app', 'https://www.gstatic.com/firebasejs/8.2.5/firebase-app.js', array(), FIREBASE_WP_VERSION, true);
wp_enqueue_script('firebase_auth', 'https://www.gstatic.com/firebasejs/8.2.5/firebase-auth.js', array(), FIREBASE_WP_VERSION, true);
wp_enqueue_script('firebase_database', 'https://www.gstatic.com/firebasejs/8.2.5/firebase-database.js', array(), FIREBASE_WP_VERSION, true);
wp_enqueue_script('firebase_firestore', 'https://www.gstatic.com/firebasejs/8.2.5/firebase-firestore.js', array(), FIREBASE_WP_VERSION, true);

wp_enqueue_script('firebase', plugin_dir_url(dirname(__FILE__)) . 'js/firebase.js', array('jquery'), FIREBASE_WP_VERSION, false);
wp_enqueue_script('firebase', plugin_dir_url(dirname(__FILE__)) . 'js/firebase.js', array('jquery'), FIREBASE_WP_VERSION, true);

wp_localize_script('firebase', 'firebaseOptions', array(
'apiKey' => self::$options['api_key'],
Expand Down
4 changes: 2 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Author URI: http://dalenguyen.me
* Contributors: Dale Nguyen (@dalenguyen)
*
* Version: 0.7.0
* Version: 0.8.0
*
* Text Domain: integrate-firebase
*
Expand Down Expand Up @@ -53,7 +53,7 @@
exit;
}

define('FIREBASE_WP_VERSION', '0.7.0');
define('FIREBASE_WP_VERSION', '0.8.0');
define('FIREBASE_WP__MINIMUM_WP_VERSION', '4.0.0');
define('FIREBASE_WP__PLUGIN_DIR', plugin_dir_path(__FILE__));

Expand Down
16 changes: 10 additions & 6 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: hanthuy
Donate link: https://www.paypal.me/DaleNguyen
Tags: firebase
Requires at least: 4.0.0
Tested up to: 5.5
Stable tag: 0.7.0
Tested up to: 5.6
Stable tag: 0.8.0
Requires PHP: 5.2.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -64,25 +64,25 @@ You can add a shortcode to show user's info

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

> echo do_shortcode("[firebase_login_error class='your-class-name'][/firebase_login_error]");
> echo do_shortcode("[firebase_login_error class="your-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-class-name']YOUR HTML CODE[/firebase_show_not_login]");
> echo do_shortcode("[firebase_show_not_login class="your-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-class-name']YOUR HTML CODE[/firebase_show]");
> echo do_shortcode("[firebase_show class="your-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-class-name' collection_name='string' document_name='string']");
> echo do_shortcode("[realtime class="your-class-name" collection_name="string" document_name="string"]");

= How can I log out?

Expand All @@ -97,6 +97,10 @@ This is a shortcode for log out button.

== Changelog ==

= 0.8.0 =
* Updated firebase packages to 8.2.5
* Moved scripts to the end of body tag

= 0.7.0 =
* Fixed add_options_page error
* Preformated data before showing in dashboard
Expand Down

0 comments on commit 5dbf3bd

Please sign in to comment.