From 3e74a3b74a7c1d0d1f012b7bf82c1a39028f9c1a Mon Sep 17 00:00:00 2001 From: Dale Nguyen Date: Tue, 18 Aug 2020 08:56:56 -0400 Subject: [PATCH 1/7] Fixed add_options_page error --- includes/class.firebase-admin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/class.firebase-admin.php b/includes/class.firebase-admin.php index 4068500..02ed413 100644 --- a/includes/class.firebase-admin.php +++ b/includes/class.firebase-admin.php @@ -36,10 +36,9 @@ public static function load_menu() { $capability = 'manage_options'; $menu_slug = 'firebase-setting'; $function = 'display_page'; - $icon_url = ''; - $position = ''; + $position = null; - add_options_page(__($page_title, "firebase"), __($menu_title, "firebase"), $capability, $menu_slug, array("Firebase_Admin", $function), $icon_url, $position); + add_options_page(__($page_title, "firebase"), __($menu_title, "firebase"), $capability, $menu_slug, array("Firebase_Admin", $function), $position); } public static function load_firebase_admin_js() { From 5519f9f5eec77d2b176c42381f93cdd5f68eba96 Mon Sep 17 00:00:00 2001 From: Dale Nguyen Date: Tue, 18 Aug 2020 08:57:35 -0400 Subject: [PATCH 2/7] Updated changelog and version --- CHANGELOG.md | 41 ++++++++++++++++++++++++++++++----------- README.md | 2 +- init.php | 4 ++-- readme.txt | 7 +++++-- 4 files changed, 38 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d40d8d6..f9ae4c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,35 +1,54 @@ # Changelog + All notable changes to this project will be documented in this file. +## [ 0.7.0 ] - 18-08-2020 + +- Fixed add_options_page error + +## [ 0.6.1 ] - 22-05-2019 + +- Removed hide realtime table script + +## [ 0.6.0 ] - 21-05-2020 + +- Show realtime data publicly + +## [ 0.5.3 ] - 16-02-2020 + +- Update firebase scripts + ## [ 0.5.2 ] - 30-03-2019 -* Show realtime database after login + +- Show realtime database after login ## [ 0.5.1 ] - 11-08-2018 -* Hide login form after logging in + +- Hide login form after logging in ## [ 0.5.0 ] - 04-08-2018 -* Add shortcode to display when not login -* Add error handling shortcode +- Add shortcode to display when not login +- Add error handling shortcode ## [ 0.4.0 ] - 17-07-2018 -* Added Firestore database support in Dashboard +- Added Firestore database support in Dashboard ## [ 0.3.2 ] - 17-07-2018 -* Fixed firebase-show shortcode +- Fixed firebase-show shortcode ## [ 0.3.1 ] - 17-07-2018 -* Fixed getting credentials +- Fixed getting credentials ## [ 0.3.0 ] - 02-07-2018 -* Added about information -* Added Real Time database support in Dashboard +- Added about information +- Added Real Time database support in Dashboard ## [ 0.2.0 ] - 25-5-2018 -* Added firebase scripts and styles to header -* Implement login and logout features +- Added firebase scripts and styles to header +- Implement login and logout features diff --git a/README.md b/README.md index 43d70f1..9f07bbc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Requires at least: 4.0.0 Tested up to: 4.9.6 -Stable tag: 0.6.1 +Stable tag: 0.7.0 Requires PHP: 5.2.4 diff --git a/init.php b/init.php index a3539ae..f299709 100644 --- a/init.php +++ b/init.php @@ -15,7 +15,7 @@ * Author URI: http://dalenguyen.me * Contributors: Dale Nguyen (@dalenguyen) * - * Version: 0.6.1 + * Version: 0.7.0 * * Text Domain: integrate-firebase * @@ -53,7 +53,7 @@ exit; } -define('FIREBASE_WP_VERSION', '0.6.1'); +define('FIREBASE_WP_VERSION', '0.7.0'); define('FIREBASE_WP__MINIMUM_WP_VERSION', '4.0.0'); define('FIREBASE_WP__PLUGIN_DIR', plugin_dir_path(__FILE__)); diff --git a/readme.txt b/readme.txt index 1eea4b6..c4e9f99 100644 --- a/readme.txt +++ b/readme.txt @@ -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.3.2 -Stable tag: 0.6.1 +Tested up to: 5.5 +Stable tag: 0.7.0 Requires PHP: 5.2.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -97,6 +97,9 @@ This is a shortcode for log out button. == Changelog == += 0.7.0 = +* Fixed add_options_page error + = 0.6.1 = * Removed hide realtime table script From c6a27382e588e6f2834222b64f2d0511ce7304a0 Mon Sep 17 00:00:00 2001 From: Dale Nguyen Date: Tue, 18 Aug 2020 20:31:35 -0400 Subject: [PATCH 3/7] Preformated data before showing in dashboard --- CHANGELOG.md | 1 + README.md | 62 +------------------------------------------- js/firebase-admin.js | 12 ++++----- readme.txt | 1 + 4 files changed, 9 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9ae4c4..d8ba7f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ## [ 0.7.0 ] - 18-08-2020 - Fixed add_options_page error +- Preformated data before showing in dashboard ## [ 0.6.1 ] - 22-05-2019 diff --git a/README.md b/README.md index 9f07bbc..cf431ab 100644 --- a/README.md +++ b/README.md @@ -132,67 +132,7 @@ echo do_shortcode("[firebase_logout]"); ![Firestore Settings](/assets/screenshot-3.png) -## Changelog - -### [ 0.6.1 ] - 21-05-2020 - -- Removed hide realtime table script - -### [ 0.6.0 ] - 21-05-2020 - -- Show realtime data publicly - -### [ 0.5.3 ] - 16-02-2020 - -- Update firebase scripts - -### [ 0.5.2 ] - 30-03-2019 - -- Show realtime database after login - -### [ 0.5.1 ] - 11-08-2018 - -- Hide login form after logging in - -### [ 0.5.0 ] - 04-08-2018 - -- Add shortcode to display when not login -- Add error handling shortcode - -### [ 0.4.0 ] - -- Added Firestore database support in Dashboard - -### 0.3.2 - -- Fixed firebase show shortcode - -### 0.3.1 - -- Fixing get firebase credentials - -### 0.3.0 - -- Added about information -- Added Real Time database support in Dashboard - -### 0.2.2 - -- Fixed readme typos - -### 0.2.1 - -- Change plugin name -- Update logout shortcode - -### 0.2.0 - -- Add scripts & styles -- Allow to show and hide data after login - -### 0.1.0 - -- Started the project and add an authentication method +## [Changelog](https://github.com/dalenguyen/firebase-wordpress-plugin/blob/master/CHANGELOG.md) ## Upgrade Notice diff --git a/js/firebase-admin.js b/js/firebase-admin.js index 62ebac2..d8a23ec 100644 --- a/js/firebase-admin.js +++ b/js/firebase-admin.js @@ -1,4 +1,4 @@ -;(function($) { +;(function ($) { 'use strict' if ( @@ -10,7 +10,7 @@ firebase.initializeApp(window.firebaseOptions) } - $(document).ready(function() { + $(document).ready(function () { let db let collections @@ -29,7 +29,7 @@ collections = window.firebaseDatabaseOptions.collections } - $('#get_database').on('click', function(e) { + $('#get_database').on('click', function (e) { e.preventDefault() let collectionArray = collections.trim().split(',') collectionArray.map(name => { @@ -40,7 +40,7 @@ const appendData = (collectionName, result, listElemnt) => { const text = document.createTextNode( - collectionName + ': ' + JSON.stringify(result) + collectionName + ': ' + JSON.stringify(result, undefined, 2) ) listElemnt.append(text) $('.database-holder').append(listElemnt) @@ -53,7 +53,7 @@ const ref = db.ref(collectionName) ref.on( 'value', - function(snapshot) { + function (snapshot) { let result = snapshot.val() if (result === null) { result = `No results found.` @@ -63,7 +63,7 @@ } appendData(collectionName, result, listElemnt) }, - function(error) { + function (error) { console.log('There was an error: ' + error) } ) diff --git a/readme.txt b/readme.txt index c4e9f99..c0bf8f9 100644 --- a/readme.txt +++ b/readme.txt @@ -99,6 +99,7 @@ This is a shortcode for log out button. = 0.7.0 = * Fixed add_options_page error +* Preformated data before showing in dashboard = 0.6.1 = * Removed hide realtime table script From 2e3c15b9581705868219c5f697f017f4805db215 Mon Sep 17 00:00:00 2001 From: Dale Nguyen Date: Tue, 18 Aug 2020 20:35:49 -0400 Subject: [PATCH 4/7] Delegated button style to WordPress --- CHANGELOG.md | 1 + README.md | 2 +- css/firebase.css | 22 ++-------------------- readme.txt | 1 + 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8ba7f3..6d139a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. - Fixed add_options_page error - Preformated data before showing in dashboard +- Delegated button style to WordPress ## [ 0.6.1 ] - 22-05-2019 diff --git a/README.md b/README.md index cf431ab..70cd3fa 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ echo do_shortcode("[firebase_logout]"); ![Firestore Settings](/assets/screenshot-3.png) -## [Changelog](https://github.com/dalenguyen/firebase-wordpress-plugin/blob/master/CHANGELOG.md) +## [Changelog](/CHANGELOG.md) ## Upgrade Notice diff --git a/css/firebase.css b/css/firebase.css index a0dbabe..fa2fcb2 100644 --- a/css/firebase.css +++ b/css/firebase.css @@ -1,23 +1,5 @@ /* Login form */ -#firebase-login-form input { - width: 375px; - display: block; - border: 1px solid #999; - height: 25px; - -webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3); - box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3); -} - -.firebase-btn { - border: 1px solid grey; - background-color: white; - padding: 10px 24px; - margin: 20px 0; - cursor: pointer; -} - -.firebase-btn:hover { - border-color: #2196F3;; +#firebase-form-submit { + margin-top: 1rem; } diff --git a/readme.txt b/readme.txt index c0bf8f9..285037c 100644 --- a/readme.txt +++ b/readme.txt @@ -100,6 +100,7 @@ This is a shortcode for log out button. = 0.7.0 = * Fixed add_options_page error * Preformated data before showing in dashboard +* Delegated button style to WordPress = 0.6.1 = * Removed hide realtime table script From 39e26535892d76a7ddb0055eb7ac783d3bee91ac Mon Sep 17 00:00:00 2001 From: Dale Nguyen Date: Tue, 18 Aug 2020 20:44:08 -0400 Subject: [PATCH 5/7] Updated firebase package to 7.18.0 --- CHANGELOG.md | 1 + includes/class.firebase-admin.php | 8 ++++---- readme.txt | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d139a7..debac03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. - Fixed add_options_page error - Preformated data before showing in dashboard - Delegated button style to WordPress +- Updated firebase package to 7.18.0 ## [ 0.6.1 ] - 22-05-2019 diff --git a/includes/class.firebase-admin.php b/includes/class.firebase-admin.php index 02ed413..d37d4ee 100644 --- a/includes/class.firebase-admin.php +++ b/includes/class.firebase-admin.php @@ -46,10 +46,10 @@ 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.8.2/firebase-app.js', array(), FIREBASE_WP_VERSION, false); - wp_enqueue_script('firebase_auth', 'https://www.gstatic.com/firebasejs/7.8.2/firebase-auth.js', array(), FIREBASE_WP_VERSION, false); - wp_enqueue_script('firebase_database', 'https://www.gstatic.com/firebasejs/7.8.2/firebase-database.js', array(), FIREBASE_WP_VERSION, false); - wp_enqueue_script('firebase_firestore', 'https://www.gstatic.com/firebasejs/7.8.2/firebase-firestore.js', array(), FIREBASE_WP_VERSION, false); + 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-admin', plugin_dir_url(dirname(__FILE__)) . 'js/firebase-admin.js', array('jquery'), FIREBASE_WP_VERSION, false); wp_localize_script('firebase-admin', 'firebaseDatabaseOptions', array( diff --git a/readme.txt b/readme.txt index 285037c..f137c08 100644 --- a/readme.txt +++ b/readme.txt @@ -101,6 +101,7 @@ This is a shortcode for log out button. * Fixed add_options_page error * Preformated data before showing in dashboard * Delegated button style to WordPress +* Updated firebase package to 7.18.0 = 0.6.1 = * Removed hide realtime table script From a576cacdebbfa60ae94b42cb0892c8b6c4b1fb5c Mon Sep 17 00:00:00 2001 From: Dale Nguyen Date: Tue, 18 Aug 2020 20:44:33 -0400 Subject: [PATCH 6/7] Updated firebase package to 7.18.0 --- includes/class.firebase.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/class.firebase.php b/includes/class.firebase.php index dc569c4..3466b58 100644 --- a/includes/class.firebase.php +++ b/includes/class.firebase.php @@ -20,10 +20,10 @@ 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.8.2/firebase-app.js', array(), FIREBASE_WP_VERSION, false); - wp_enqueue_script('firebase_auth', 'https://www.gstatic.com/firebasejs/7.8.2/firebase-auth.js', array(), FIREBASE_WP_VERSION, false); - wp_enqueue_script('firebase_database', 'https://www.gstatic.com/firebasejs/7.8.2/firebase-database.js', array(), FIREBASE_WP_VERSION, false); - wp_enqueue_script('firebase_firestore', 'https://www.gstatic.com/firebasejs/7.8.2/firebase-firestore.js', array(), FIREBASE_WP_VERSION, false); + 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', plugin_dir_url(dirname(__FILE__)) . 'js/firebase.js', array('jquery'), FIREBASE_WP_VERSION, false); From d13e832e35d13cf1a7e5dd9ba6348f40eb12c58b Mon Sep 17 00:00:00 2001 From: Dale Nguyen Date: Tue, 18 Aug 2020 20:56:57 -0400 Subject: [PATCH 7/7] Added github action --- .github/master.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/master.yml diff --git a/.github/master.yml b/.github/master.yml new file mode 100644 index 0000000..55438ef --- /dev/null +++ b/.github/master.yml @@ -0,0 +1,19 @@ +name: Push to Master Branch + +on: + push: + tags: + - '*' + +jobs: + deploy-plugin: + name: New tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: WordPress Plugin Deploy + uses: 10up/action-wordpress-plugin-deploy@master + env: + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SLUG: integrate-firebase