Skip to content

Commit

Permalink
Merge pull request #4 from turtlepod/dev
Browse files Browse the repository at this point in the history
buddypress + woocommerce fix.
  • Loading branch information
turtlepod committed Sep 8, 2016
2 parents 8fcb5d6 + 89562d6 commit 414b9d0
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 11 deletions.
4 changes: 2 additions & 2 deletions fx-private-site.php
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: f(x) Private Site
* Plugin URI: http://genbumedia.com/plugins/fx-private-site/
* Description: Set your site to member only. All visitor will need to login to view site.
* Version: 1.1.0
* Version: 1.2.0
* Author: David Chandra Purnama
* Author URI: http://shellcreeper.com/
* License: GPLv2 or later
Expand All @@ -18,7 +18,7 @@
------------------------------------------ */

/* Set the version constant. */
define( 'FX_PRIVATE_SITE_VERSION', '1.0.1' );
define( 'FX_PRIVATE_SITE_VERSION', '1.2.0' );

/* Set the constant path to the plugin path. */
define( 'FX_PRIVATE_SITE_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
Expand Down
16 changes: 14 additions & 2 deletions includes/functions.php
Expand Up @@ -68,9 +68,21 @@ function fx_private_site_please_log_in() {
/* Check if the private site feature is active and if the user is not logged in. */
if ( true === fx_private_site_get_option( 'enable', false ) && ! is_user_logged_in() ) {

/* Hook */
do_action( 'fx_private_site_before_auth_redirect' );

/* If using BuddyPress and on the register page, don't do anything. */
if ( function_exists( 'bp_is_current_component' ) ){
if ( bp_is_current_component( 'register' ) || bp_is_current_component( 'activate' ) ){
if ( function_exists( 'bp_is_activation_page' ) && bp_is_activation_page() ){
return;
}
if ( function_exists( 'bp_is_register_page' ) && bp_is_register_page() ){
return;
}

/* WooCommerce: Whitelist My Account Page */
if ( class_exists( 'WooCommerce' ) ){
$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
if( $myaccount_page_id && is_page( $myaccount_page_id ) ){
return;
}
}
Expand Down
Binary file added languages/fx-private-site-id_ID.mo
Binary file not shown.
68 changes: 68 additions & 0 deletions languages/fx-private-site-id_ID.po
@@ -0,0 +1,68 @@
msgid ""
msgstr ""
"Project-Id-Version: f(x) Login Notification\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-09 05:01+0700\n"
"PO-Revision-Date: \n"
"Last-Translator: David Chandra Purnama <david@shellcreeper.com>\n"
"Language-Team: David Chandra P <david@shellcreeper.com>\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _e;__;esc_attr_e;esc_attr__;esc_html_e;esc_html__;_x;"
"_n;_x:1,2c;_n:1,2;_ex\n"
"X-Poedit-Basepath: ..\n"
"X-Generator: Poedit 1.8.8\n"
"X-Poedit-SearchPath-0: .\n"

#: fx-private-site.php:87
#, php-format
msgid ""
"Navigate to <a href=\"%s\">Reading Settings</a> to activate Private Site "
"feature."
msgstr ""
"Navigasi ke <a href=\"%s\">Pengaturan Membaca</a> untuk mengaktifkan fitur "
"Situs Privat."

#: includes/functions.php:105 includes/settings.php:140
msgctxt "default RSS Feed error message"
msgid "You must be logged into the site to view this content."
msgstr "Anda harus log in ke situs untuk melihat konten ini."

#: includes/settings.php:91
msgctxt "settings page"
msgid "Private Site"
msgstr "Situs Privat"

#: includes/settings.php:99
msgctxt "settings page"
msgid "Enable Private Site"
msgstr "Aktifkan Situs Privat"

#: includes/settings.php:108
msgctxt "settings page"
msgid "RSS Feed Error Message"
msgstr "Pesan Galat Umpan RSS"

#: includes/settings.php:121
msgctxt "settings page"
msgid "Set site to private. Only registered user can view this site."
msgstr ""
"Aktifkan situs private. Hanya pengguna terdaftar yang dapat melihat situs "
"ini."

#: includes/settings.php:130
msgid ""
"Redirect all logged-out users to the login page before allowing them to view "
"the site. "
msgstr ""
"Arahkan semua pengguna yang keluar ke halaman login sebelum mereka dapat "
"melihat situs."

#: includes/settings.php:141
msgid ""
"If site is set to private, this error message will replace RSS feed content."
msgstr ""
"Jika situs diatur untuk privat, pesan galat ini akan menggantikan konten "
"umpan RSS."
8 changes: 4 additions & 4 deletions languages/fx-private-site.pot
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: f(x) Login Notification\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-04-05 11:04+0700\n"
"POT-Creation-Date: 2016-09-09 05:01+0700\n"
"PO-Revision-Date: \n"
"Last-Translator: David Chandra Purnama <david@shellcreeper.com>\n"
"Language-Team: David Chandra P <david@shellcreeper.com>\n"
Expand All @@ -14,17 +14,17 @@ msgstr ""
"X-Poedit-KeywordsList: _e;__;esc_attr_e;esc_attr__;esc_html_e;esc_html__;_x;"
"_n;_x:1,2c;_n:1,2;_ex\n"
"X-Poedit-Basepath: ..\n"
"X-Generator: Poedit 1.8.7\n"
"X-Generator: Poedit 1.8.8\n"
"X-Poedit-SearchPath-0: .\n"

#: fx-private-site.php:95
#: fx-private-site.php:87
#, php-format
msgid ""
"Navigate to <a href=\"%s\">Reading Settings</a> to activate Private Site "
"feature."
msgstr ""

#: includes/functions.php:93 includes/settings.php:140
#: includes/functions.php:105 includes/settings.php:140
msgctxt "default RSS Feed error message"
msgid "You must be logged into the site to view this content."
msgstr ""
Expand Down
11 changes: 8 additions & 3 deletions readme.txt
Expand Up @@ -4,15 +4,15 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: private site, members only, protect rss
Requires at least: 4.0
Tested up to: 4.6
Stable tag: 1.1.0
Stable tag: 1.2.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Set your site to member only. All visitor will need to login to view site.

== Description ==

**[f(x) Private Site](http://genbu.me/plugins/fx-private-site/)** is a very simple plugin to set the site to members only website.
**[f(x) Private Site](http://genbumedia.com/plugins/fx-private-site/)** is a very simple plugin to set the site to members only website.

After installation of this plugin, you can enable this in "Settings > Reading" in "Private Site" Section.

Expand All @@ -23,7 +23,7 @@ After installation of this plugin, you can enable this in "Settings > Reading" i
1. Also protect RSS Feed content.
1. Useful to set site private before lauching the site.
1. The GPL v2.0 or later license. :) Use it to make something cool.
1. Support available at [Genbu Media](https://genbu.me/contact-us/).
1. Support available at [Genbu Media](https://genbumedia.com/contact-us/).


== Installation ==
Expand All @@ -46,6 +46,11 @@ The settings is in the bottom of "Settings > Reading" in your admin panel. You w

== Changelog ==

= 1.2.0 - 09 September 2016 =
* Better whitelist for buddypress https://github.com/justintadlock/members/issues/83#issuecomment-245237479
* Whitelist WooCommerce "My Account" Page (fix lost password).
* Add Indonesian Translation.

= 1.1.0 - 05 April 2016 =
* Activation notice: "Settings Page".
* Uninstall Hook: Remove db.
Expand Down

0 comments on commit 414b9d0

Please sign in to comment.