@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * Class Constructor. |
| 41 | 41 | * |
| 42 | - * @return void |
|
| 42 | + * @return Shortcodes |
|
| 43 | 43 | */ |
| 44 | 44 | private function __construct() |
| 45 | 45 | { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * Instantiate our class. |
| 55 | 55 | * |
| 56 | - * @return mixed The instance of this class. |
|
| 56 | + * @return Shortcodes|null The instance of this class. |
|
| 57 | 57 | */ |
| 58 | 58 | public static function instance() |
| 59 | 59 | { |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | namespace Subway; |
| 21 | 21 | |
| 22 | 22 | if (! defined('ABSPATH') ) { |
| 23 | - return; |
|
| 23 | + return; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -36,154 +36,154 @@ discard block |
||
| 36 | 36 | final class Shortcodes |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Class Constructor. |
|
| 41 | - * |
|
| 42 | - * @return void |
|
| 43 | - */ |
|
| 44 | - private function __construct() |
|
| 45 | - { |
|
| 39 | + /** |
|
| 40 | + * Class Constructor. |
|
| 41 | + * |
|
| 42 | + * @return void |
|
| 43 | + */ |
|
| 44 | + private function __construct() |
|
| 45 | + { |
|
| 46 | 46 | |
| 47 | - add_action('init', array( $this, 'register')); |
|
| 47 | + add_action('init', array( $this, 'register')); |
|
| 48 | 48 | |
| 49 | - return $this; |
|
| 49 | + return $this; |
|
| 50 | 50 | |
| 51 | - } |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Instantiate our class. |
|
| 55 | - * |
|
| 56 | - * @return mixed The instance of this class. |
|
| 57 | - */ |
|
| 58 | - public static function instance() |
|
| 59 | - { |
|
| 53 | + /** |
|
| 54 | + * Instantiate our class. |
|
| 55 | + * |
|
| 56 | + * @return mixed The instance of this class. |
|
| 57 | + */ |
|
| 58 | + public static function instance() |
|
| 59 | + { |
|
| 60 | 60 | |
| 61 | - static $instance = null; |
|
| 61 | + static $instance = null; |
|
| 62 | 62 | |
| 63 | - if (null === $instance ) { |
|
| 63 | + if (null === $instance ) { |
|
| 64 | 64 | |
| 65 | - $instance = new Shortcodes(); |
|
| 65 | + $instance = new Shortcodes(); |
|
| 66 | 66 | |
| 67 | - } |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - return $instance; |
|
| 69 | + return $instance; |
|
| 70 | 70 | |
| 71 | - } |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * Instantiate our class. |
|
| 75 | - * |
|
| 76 | - * @return void |
|
| 77 | - */ |
|
| 78 | - public function register() |
|
| 79 | - { |
|
| 73 | + /** |
|
| 74 | + * Instantiate our class. |
|
| 75 | + * |
|
| 76 | + * @return void |
|
| 77 | + */ |
|
| 78 | + public function register() |
|
| 79 | + { |
|
| 80 | 80 | |
| 81 | - add_shortcode('subway_login', array( $this, 'loginForm' )); |
|
| 81 | + add_shortcode('subway_login', array( $this, 'loginForm' )); |
|
| 82 | 82 | |
| 83 | - add_action('login_form_middle', array( $this, 'loginFormAction' ), 10, 2); |
|
| 83 | + add_action('login_form_middle', array( $this, 'loginFormAction' ), 10, 2); |
|
| 84 | 84 | |
| 85 | - add_action('login_form_middle', array( $this, 'lostPasswordLink' ), 10, 2); |
|
| 85 | + add_action('login_form_middle', array( $this, 'lostPasswordLink' ), 10, 2); |
|
| 86 | 86 | |
| 87 | - return; |
|
| 87 | + return; |
|
| 88 | 88 | |
| 89 | - } |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * Displays the login form |
|
| 93 | - * |
|
| 94 | - * @return void |
|
| 95 | - */ |
|
| 96 | - public function loginForm() |
|
| 97 | - { |
|
| 91 | + /** |
|
| 92 | + * Displays the login form |
|
| 93 | + * |
|
| 94 | + * @return void |
|
| 95 | + */ |
|
| 96 | + public function loginForm() |
|
| 97 | + { |
|
| 98 | 98 | |
| 99 | - $atts = array(); |
|
| 99 | + $atts = array(); |
|
| 100 | 100 | |
| 101 | - echo $this->renderTemplate($atts, 'login-form.php'); |
|
| 101 | + echo $this->renderTemplate($atts, 'login-form.php'); |
|
| 102 | 102 | |
| 103 | - return; |
|
| 104 | - } |
|
| 103 | + return; |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | - /** |
|
| 107 | - * Include the specific plugin file if there is no template file. |
|
| 108 | - * |
|
| 109 | - * @param mixed $atts The shortcode attribute. |
|
| 110 | - * @param string $file The shortcode template file. |
|
| 111 | - * |
|
| 112 | - * @return string The html template content. |
|
| 113 | - */ |
|
| 114 | - protected function renderTemplate( $atts, $file = '' ) |
|
| 115 | - { |
|
| 106 | + /** |
|
| 107 | + * Include the specific plugin file if there is no template file. |
|
| 108 | + * |
|
| 109 | + * @param mixed $atts The shortcode attribute. |
|
| 110 | + * @param string $file The shortcode template file. |
|
| 111 | + * |
|
| 112 | + * @return string The html template content. |
|
| 113 | + */ |
|
| 114 | + protected function renderTemplate( $atts, $file = '' ) |
|
| 115 | + { |
|
| 116 | 116 | |
| 117 | - ob_start(); |
|
| 117 | + ob_start(); |
|
| 118 | 118 | |
| 119 | - if (empty($file) ) { |
|
| 119 | + if (empty($file) ) { |
|
| 120 | 120 | |
| 121 | - return; |
|
| 121 | + return; |
|
| 122 | 122 | |
| 123 | - } |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - $template = SUBWAY_DIR_PATH . 'templates/'.$file; |
|
| 125 | + $template = SUBWAY_DIR_PATH . 'templates/'.$file; |
|
| 126 | 126 | |
| 127 | - if (file_exists($template) ) { |
|
| 127 | + if (file_exists($template) ) { |
|
| 128 | 128 | |
| 129 | - $theme_template = locate_template(array('gears/shortcodes/'.$file )); |
|
| 129 | + $theme_template = locate_template(array('gears/shortcodes/'.$file )); |
|
| 130 | 130 | |
| 131 | - if ($theme_template) { |
|
| 131 | + if ($theme_template) { |
|
| 132 | 132 | |
| 133 | - $template = $theme_template; |
|
| 133 | + $template = $theme_template; |
|
| 134 | 134 | |
| 135 | - } |
|
| 135 | + } |
|
| 136 | 136 | |
| 137 | - include $template; |
|
| 137 | + include $template; |
|
| 138 | 138 | |
| 139 | - } else { |
|
| 139 | + } else { |
|
| 140 | 140 | |
| 141 | - echo sprintf( |
|
| 142 | - esc_html_e( |
|
| 143 | - 'Subway Error: Unable to find template file in: %1s', 'subway' |
|
| 144 | - ), |
|
| 145 | - $template |
|
| 146 | - ); |
|
| 141 | + echo sprintf( |
|
| 142 | + esc_html_e( |
|
| 143 | + 'Subway Error: Unable to find template file in: %1s', 'subway' |
|
| 144 | + ), |
|
| 145 | + $template |
|
| 146 | + ); |
|
| 147 | 147 | |
| 148 | - } |
|
| 148 | + } |
|
| 149 | 149 | |
| 150 | - return ob_get_clean(); |
|
| 151 | - } |
|
| 150 | + return ob_get_clean(); |
|
| 151 | + } |
|
| 152 | 152 | |
| 153 | - /** |
|
| 154 | - * The action for our login form. |
|
| 155 | - * |
|
| 156 | - * @param string $__content The current filtered contents. |
|
| 157 | - * |
|
| 158 | - * @return string The content of our login form action. |
|
| 159 | - */ |
|
| 160 | - public function loginFormAction( $__content ) |
|
| 161 | - { |
|
| 153 | + /** |
|
| 154 | + * The action for our login form. |
|
| 155 | + * |
|
| 156 | + * @param string $__content The current filtered contents. |
|
| 157 | + * |
|
| 158 | + * @return string The content of our login form action. |
|
| 159 | + */ |
|
| 160 | + public function loginFormAction( $__content ) |
|
| 161 | + { |
|
| 162 | 162 | |
| 163 | - ob_start(); |
|
| 163 | + ob_start(); |
|
| 164 | 164 | |
| 165 | - do_action('login_form'); |
|
| 165 | + do_action('login_form'); |
|
| 166 | 166 | |
| 167 | - return $__content . ob_get_clean(); |
|
| 168 | - |
|
| 169 | - } |
|
| 170 | - |
|
| 171 | - /** |
|
| 172 | - * The action for our 'lost password' link. |
|
| 173 | - * |
|
| 174 | - * @param string $content The current filtered contents. |
|
| 175 | - * |
|
| 176 | - * @return string The content of our lost password link. |
|
| 177 | - */ |
|
| 178 | - public function lostPasswordLink( $content ) |
|
| 179 | - { |
|
| 167 | + return $__content . ob_get_clean(); |
|
| 168 | + |
|
| 169 | + } |
|
| 170 | + |
|
| 171 | + /** |
|
| 172 | + * The action for our 'lost password' link. |
|
| 173 | + * |
|
| 174 | + * @param string $content The current filtered contents. |
|
| 175 | + * |
|
| 176 | + * @return string The content of our lost password link. |
|
| 177 | + */ |
|
| 178 | + public function lostPasswordLink( $content ) |
|
| 179 | + { |
|
| 180 | 180 | |
| 181 | - return $content . $this->renderTemplate( |
|
| 182 | - array(), |
|
| 183 | - 'login-form-lost-password.php' |
|
| 184 | - ); |
|
| 181 | + return $content . $this->renderTemplate( |
|
| 182 | + array(), |
|
| 183 | + 'login-form-lost-password.php' |
|
| 184 | + ); |
|
| 185 | 185 | |
| 186 | - } |
|
| 186 | + } |
|
| 187 | 187 | |
| 188 | 188 | } |
| 189 | 189 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | namespace Subway; |
| 21 | 21 | |
| 22 | -if (! defined('ABSPATH') ) { |
|
| 22 | +if ( ! defined('ABSPATH')) { |
|
| 23 | 23 | return; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | private function __construct() |
| 45 | 45 | { |
| 46 | 46 | |
| 47 | - add_action('init', array( $this, 'register')); |
|
| 47 | + add_action('init', array($this, 'register')); |
|
| 48 | 48 | |
| 49 | 49 | return $this; |
| 50 | 50 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | static $instance = null; |
| 62 | 62 | |
| 63 | - if (null === $instance ) { |
|
| 63 | + if (null === $instance) { |
|
| 64 | 64 | |
| 65 | 65 | $instance = new Shortcodes(); |
| 66 | 66 | |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | public function register() |
| 79 | 79 | { |
| 80 | 80 | |
| 81 | - add_shortcode('subway_login', array( $this, 'loginForm' )); |
|
| 81 | + add_shortcode('subway_login', array($this, 'loginForm')); |
|
| 82 | 82 | |
| 83 | - add_action('login_form_middle', array( $this, 'loginFormAction' ), 10, 2); |
|
| 83 | + add_action('login_form_middle', array($this, 'loginFormAction'), 10, 2); |
|
| 84 | 84 | |
| 85 | - add_action('login_form_middle', array( $this, 'lostPasswordLink' ), 10, 2); |
|
| 85 | + add_action('login_form_middle', array($this, 'lostPasswordLink'), 10, 2); |
|
| 86 | 86 | |
| 87 | 87 | return; |
| 88 | 88 | |
@@ -111,22 +111,22 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * @return string The html template content. |
| 113 | 113 | */ |
| 114 | - protected function renderTemplate( $atts, $file = '' ) |
|
| 114 | + protected function renderTemplate($atts, $file = '') |
|
| 115 | 115 | { |
| 116 | 116 | |
| 117 | 117 | ob_start(); |
| 118 | 118 | |
| 119 | - if (empty($file) ) { |
|
| 119 | + if (empty($file)) { |
|
| 120 | 120 | |
| 121 | 121 | return; |
| 122 | 122 | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $template = SUBWAY_DIR_PATH . 'templates/'.$file; |
|
| 125 | + $template = SUBWAY_DIR_PATH . 'templates/' . $file; |
|
| 126 | 126 | |
| 127 | - if (file_exists($template) ) { |
|
| 127 | + if (file_exists($template)) { |
|
| 128 | 128 | |
| 129 | - $theme_template = locate_template(array('gears/shortcodes/'.$file )); |
|
| 129 | + $theme_template = locate_template(array('gears/shortcodes/' . $file)); |
|
| 130 | 130 | |
| 131 | 131 | if ($theme_template) { |
| 132 | 132 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * |
| 158 | 158 | * @return string The content of our login form action. |
| 159 | 159 | */ |
| 160 | - public function loginFormAction( $__content ) |
|
| 160 | + public function loginFormAction($__content) |
|
| 161 | 161 | { |
| 162 | 162 | |
| 163 | 163 | ob_start(); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * |
| 176 | 176 | * @return string The content of our lost password link. |
| 177 | 177 | */ |
| 178 | - public function lostPasswordLink( $content ) |
|
| 178 | + public function lostPasswordLink($content) |
|
| 179 | 179 | { |
| 180 | 180 | |
| 181 | 181 | return $content . $this->renderTemplate( |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | namespace Subway; |
| 21 | 21 | |
| 22 | 22 | if (! defined('ABSPATH') ) { |
| 23 | - return; |
|
| 23 | + return; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -36,33 +36,33 @@ discard block |
||
| 36 | 36 | final class I18 |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Class Constructor. |
|
| 41 | - * |
|
| 42 | - * @return void |
|
| 43 | - */ |
|
| 44 | - public function __construct() |
|
| 45 | - { |
|
| 39 | + /** |
|
| 40 | + * Class Constructor. |
|
| 41 | + * |
|
| 42 | + * @return void |
|
| 43 | + */ |
|
| 44 | + public function __construct() |
|
| 45 | + { |
|
| 46 | 46 | |
| 47 | - add_action('plugins_loaded', array( $this, 'subwayLocalizePlugin' )); |
|
| 47 | + add_action('plugins_loaded', array( $this, 'subwayLocalizePlugin' )); |
|
| 48 | 48 | |
| 49 | - return; |
|
| 50 | - } |
|
| 49 | + return; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Subway l8n callback. |
|
| 54 | - * |
|
| 55 | - * @return void |
|
| 56 | - */ |
|
| 57 | - public function subwayLocalizePlugin() |
|
| 58 | - { |
|
| 52 | + /** |
|
| 53 | + * Subway l8n callback. |
|
| 54 | + * |
|
| 55 | + * @return void |
|
| 56 | + */ |
|
| 57 | + public function subwayLocalizePlugin() |
|
| 58 | + { |
|
| 59 | 59 | |
| 60 | - $rel_path = SUBWAY_DIR_PATH . 'languages'; |
|
| 60 | + $rel_path = SUBWAY_DIR_PATH . 'languages'; |
|
| 61 | 61 | |
| 62 | - load_plugin_textdomain('subway', false, $rel_path); |
|
| 62 | + load_plugin_textdomain('subway', false, $rel_path); |
|
| 63 | 63 | |
| 64 | - return; |
|
| 65 | - } |
|
| 64 | + return; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | 67 | } |
| 68 | 68 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | namespace Subway; |
| 21 | 21 | |
| 22 | -if (! defined('ABSPATH') ) { |
|
| 22 | +if ( ! defined('ABSPATH')) { |
|
| 23 | 23 | return; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | public function __construct() |
| 45 | 45 | { |
| 46 | 46 | |
| 47 | - add_action('plugins_loaded', array( $this, 'subwayLocalizePlugin' )); |
|
| 47 | + add_action('plugins_loaded', array($this, 'subwayLocalizePlugin')); |
|
| 48 | 48 | |
| 49 | 49 | return; |
| 50 | 50 | } |
@@ -17,12 +17,12 @@ |
||
| 17 | 17 | * @link github.com/codehaiku/subway The Plugin Repository |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 20 | +if ( ! defined('ABSPATH')) { |
|
| 21 | 21 | return; |
| 22 | 22 | } |
| 23 | 23 | ?> |
| 24 | 24 | <p class="subway-login-lost-password"> |
| 25 | - <a href="<?php echo esc_url( wp_lostpassword_url( $redirect = '' ) ); ?>"> |
|
| 26 | - <?php esc_html_e( 'Forgot Password', 'subway' ); ?> |
|
| 25 | + <a href="<?php echo esc_url(wp_lostpassword_url($redirect = '')); ?>"> |
|
| 26 | + <?php esc_html_e('Forgot Password', 'subway'); ?> |
|
| 27 | 27 | </a> |
| 28 | 28 | </p> |
@@ -17,17 +17,17 @@ discard block |
||
| 17 | 17 | * @link github.com/codehaiku/subway The Plugin Repository |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 20 | +if ( ! defined('ABSPATH')) { |
|
| 21 | 21 | return; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | $args = array( |
| 25 | 25 | 'echo' => true, |
| 26 | 26 | 'form_id' => 'loginform', |
| 27 | - 'label_username' => __( 'Username', 'subway' ), |
|
| 28 | - 'label_password' => __( 'Password', 'subway' ), |
|
| 29 | - 'label_remember' => __( 'Remember Me', 'subway' ), |
|
| 30 | - 'label_log_in' => __( 'Log In', 'subway' ), |
|
| 27 | + 'label_username' => __('Username', 'subway'), |
|
| 28 | + 'label_password' => __('Password', 'subway'), |
|
| 29 | + 'label_remember' => __('Remember Me', 'subway'), |
|
| 30 | + 'label_log_in' => __('Log In', 'subway'), |
|
| 31 | 31 | 'id_username' => 'user_login', |
| 32 | 32 | 'id_password' => 'user_pass', |
| 33 | 33 | 'id_remember' => 'rememberme', |
@@ -42,100 +42,100 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $message_types = array(); |
| 44 | 44 | |
| 45 | -$http_request_login = filter_input( INPUT_GET, 'login', FILTER_SANITIZE_SPECIAL_CHARS ); |
|
| 45 | +$http_request_login = filter_input(INPUT_GET, 'login', FILTER_SANITIZE_SPECIAL_CHARS); |
|
| 46 | 46 | |
| 47 | -$http_request_type = filter_input( INPUT_GET, 'type', FILTER_SANITIZE_SPECIAL_CHARS ); |
|
| 47 | +$http_request_type = filter_input(INPUT_GET, 'type', FILTER_SANITIZE_SPECIAL_CHARS); |
|
| 48 | 48 | |
| 49 | -$http_request_logout = filter_input( INPUT_GET, 'loggedout', FILTER_SANITIZE_SPECIAL_CHARS ); |
|
| 49 | +$http_request_logout = filter_input(INPUT_GET, 'loggedout', FILTER_SANITIZE_SPECIAL_CHARS); |
|
| 50 | 50 | |
| 51 | -if ( isset( $http_request_login ) ) { |
|
| 51 | +if (isset($http_request_login)) { |
|
| 52 | 52 | |
| 53 | - if ( 'failed' === $http_request_login ) { |
|
| 53 | + if ('failed' === $http_request_login) { |
|
| 54 | 54 | |
| 55 | - if ( isset( $http_request_type ) ) { |
|
| 55 | + if (isset($http_request_type)) { |
|
| 56 | 56 | |
| 57 | 57 | $message_types = array( |
| 58 | 58 | |
| 59 | 59 | 'default' => array( |
| 60 | - 'message' => __( 'There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway' ), |
|
| 60 | + 'message' => __('There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway'), |
|
| 61 | 61 | ), |
| 62 | 62 | '__blank' => array( |
| 63 | - 'message' => __( 'Required: Username and Password cannot be empty.', 'subway' ), |
|
| 63 | + 'message' => __('Required: Username and Password cannot be empty.', 'subway'), |
|
| 64 | 64 | ), |
| 65 | 65 | '__userempty' => array( |
| 66 | - 'message' => __( 'Required: Username cannot be empty.', 'subway' ), |
|
| 66 | + 'message' => __('Required: Username cannot be empty.', 'subway'), |
|
| 67 | 67 | ), |
| 68 | 68 | '__passempty' => array( |
| 69 | - 'message' => __( 'Required: Password cannot be empty.', 'subway' ), |
|
| 69 | + 'message' => __('Required: Password cannot be empty.', 'subway'), |
|
| 70 | 70 | ), |
| 71 | 71 | 'fb_invalid_email' => array( |
| 72 | - 'message' => __( 'Facebook email address is invalid or is not yet verified.', 'subway' ), |
|
| 72 | + 'message' => __('Facebook email address is invalid or is not yet verified.', 'subway'), |
|
| 73 | 73 | ), |
| 74 | 74 | 'fb_error' => array( |
| 75 | - 'message' => __( 'Facebook Application Error. Misconfigured or App is rejected.', 'subway' ), |
|
| 75 | + 'message' => __('Facebook Application Error. Misconfigured or App is rejected.', 'subway'), |
|
| 76 | 76 | ), |
| 77 | 77 | 'app_not_live' => array( |
| 78 | - 'message' => __( 'Unable to fetch your Facebook Profile.', 'subway' ), |
|
| 78 | + 'message' => __('Unable to fetch your Facebook Profile.', 'subway'), |
|
| 79 | 79 | ), |
| 80 | 80 | 'gears_username_or_email_exists' => array( |
| 81 | - 'message' => __( 'Username or email address already exists', 'subway' ), |
|
| 81 | + 'message' => __('Username or email address already exists', 'subway'), |
|
| 82 | 82 | ), |
| 83 | 83 | 'gp_error_authentication' => array( |
| 84 | - 'message' => __( 'Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway' ), |
|
| 84 | + 'message' => __('Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway'), |
|
| 85 | 85 | ), |
| 86 | 86 | ); |
| 87 | 87 | |
| 88 | 88 | $message = $message_types['default']['message']; |
| 89 | 89 | |
| 90 | - if ( array_key_exists( $http_request_type, $message_types ) ) { |
|
| 90 | + if (array_key_exists($http_request_type, $message_types)) { |
|
| 91 | 91 | |
| 92 | - $message = $message_types[ $http_request_type ]['message']; |
|
| 92 | + $message = $message_types[$http_request_type]['message']; |
|
| 93 | 93 | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - $error_login_message = '<div id="message" class="error">' . esc_html( $message ) . '</div>'; |
|
| 96 | + $error_login_message = '<div id="message" class="error">' . esc_html($message) . '</div>'; |
|
| 97 | 97 | |
| 98 | 98 | } else { |
| 99 | 99 | |
| 100 | - $error_login_message = '<div id="message" class="error">' . esc_html__( 'Error: Invalid username and password combination.', 'subway' ) . '</div>'; |
|
| 100 | + $error_login_message = '<div id="message" class="error">' . esc_html__('Error: Invalid username and password combination.', 'subway') . '</div>'; |
|
| 101 | 101 | |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | -if ( isset( $http_request_logout ) ) { |
|
| 107 | - $error_login_message = '<div id="message" class="success">' . esc_html__( 'You have logged out successfully.', 'subway' ) . '</div>'; |
|
| 106 | +if (isset($http_request_logout)) { |
|
| 107 | + $error_login_message = '<div id="message" class="success">' . esc_html__('You have logged out successfully.', 'subway') . '</div>'; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -$http_request_redirected = filter_input( INPUT_GET, '_redirected', FILTER_SANITIZE_SPECIAL_CHARS ); |
|
| 110 | +$http_request_redirected = filter_input(INPUT_GET, '_redirected', FILTER_SANITIZE_SPECIAL_CHARS); |
|
| 111 | 111 | |
| 112 | -if ( isset( $http_request_redirected ) ) { |
|
| 113 | - $error_login_message = '<div id="message" class="success">' . esc_html__( 'Members only page. Please use the login form below to access the page.', 'subway' ) . '</div>'; |
|
| 112 | +if (isset($http_request_redirected)) { |
|
| 113 | + $error_login_message = '<div id="message" class="success">' . esc_html__('Members only page. Please use the login form below to access the page.', 'subway') . '</div>'; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | ?> |
| 117 | -<?php if ( ! is_user_logged_in() ) { ?> |
|
| 117 | +<?php if ( ! is_user_logged_in()) { ?> |
|
| 118 | 118 | <div class="mg-top-35 mg-bottom-35 subway-login-form"> |
| 119 | 119 | <div class="subway-login-form-form"> |
| 120 | 120 | <div class="subway-login-form__actions"> |
| 121 | 121 | <h3> |
| 122 | - <?php esc_html_e( 'Account Sign-in', 'subway' ); ?> |
|
| 122 | + <?php esc_html_e('Account Sign-in', 'subway'); ?> |
|
| 123 | 123 | </h3> |
| 124 | - <?php do_action( 'gears_login_form' ); ?> |
|
| 124 | + <?php do_action('gears_login_form'); ?> |
|
| 125 | 125 | </div> |
| 126 | 126 | <div class="subway-login-form-message"> |
| 127 | - <?php echo wp_kses_post( $error_login_message ); ?> |
|
| 127 | + <?php echo wp_kses_post($error_login_message); ?> |
|
| 128 | 128 | </div> |
| 129 | 129 | <div class="subway-login-form__form"> |
| 130 | - <?php echo wp_login_form( $args ); ?> |
|
| 130 | + <?php echo wp_login_form($args); ?> |
|
| 131 | 131 | </div> |
| 132 | 132 | </div> |
| 133 | 133 | </div> |
| 134 | 134 | <?php } else { ?> |
| 135 | 135 | <div class="mg-top-35 mg-bottom-35 subway-login-sucessfull" style="background: #CDDC39; padding: 15px 15px 15px 15px;border-radius: 4px;color: #616161;"> |
| 136 | 136 | <p style="margin-bottom: 0px;"> |
| 137 | - <?php $success_message = apply_filters( 'subway_login_message_success', esc_html__( 'Great! You have succesfully login.', 'subway' ) ); ?> |
|
| 138 | - <?php echo esc_html( $success_message ); ?> |
|
| 137 | + <?php $success_message = apply_filters('subway_login_message_success', esc_html__('Great! You have succesfully login.', 'subway')); ?> |
|
| 138 | + <?php echo esc_html($success_message); ?> |
|
| 139 | 139 | </p> |
| 140 | 140 | </div> |
| 141 | 141 | <?php } ?> |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | namespace Subway; |
| 21 | 21 | |
| 22 | 22 | if (! defined('ABSPATH') ) { |
| 23 | - return; |
|
| 23 | + return; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -36,153 +36,153 @@ discard block |
||
| 36 | 36 | final class AdminSettings |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Our class constructor |
|
| 41 | - */ |
|
| 42 | - public function __construct() |
|
| 43 | - { |
|
| 39 | + /** |
|
| 40 | + * Our class constructor |
|
| 41 | + */ |
|
| 42 | + public function __construct() |
|
| 43 | + { |
|
| 44 | 44 | |
| 45 | - add_action('admin_menu', array( $this, 'adminMenu' )); |
|
| 46 | - |
|
| 47 | - add_action('admin_init', array( $this, 'registerSettings' )); |
|
| 48 | - |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * Display 'Subway' link under 'Settings' |
|
| 53 | - * |
|
| 54 | - * @return void |
|
| 55 | - */ |
|
| 56 | - public function adminMenu() |
|
| 57 | - { |
|
| 58 | - |
|
| 59 | - add_options_page( |
|
| 60 | - 'Subway Settings', 'Subway', 'manage_options', |
|
| 61 | - 'subway', array( $this, 'optionsPage' ) |
|
| 62 | - ); |
|
| 63 | - |
|
| 64 | - return; |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * Registers all settings related to Subway. |
|
| 69 | - * |
|
| 70 | - * @return void |
|
| 71 | - */ |
|
| 72 | - public function registerSettings() |
|
| 73 | - { |
|
| 74 | - |
|
| 75 | - // Register our settings section. |
|
| 76 | - add_settings_section( |
|
| 77 | - 'subway-page-visibility-section', __('Pages Visibility', 'subway'), |
|
| 78 | - array( $this, 'sectionCallback' ), 'subway-settings-section' |
|
| 79 | - ); |
|
| 80 | - |
|
| 81 | - // Register Redirect Options pages. |
|
| 82 | - add_settings_section( |
|
| 83 | - 'subway-redirect-section', __('Redirect Options', 'subway'), |
|
| 84 | - array( $this, 'redirectCallback' ), 'subway-settings-section' |
|
| 85 | - ); |
|
| 86 | - |
|
| 87 | - // Register the fields. |
|
| 88 | - $fields = array( |
|
| 89 | - array( |
|
| 90 | - 'id' => 'subway_is_public', |
|
| 91 | - 'label' => __('Public Website', 'subway'), |
|
| 92 | - 'callback' => 'subway_is_public_form', |
|
| 93 | - 'section' => 'subway-settings-section', |
|
| 94 | - 'group' => 'subway-page-visibility-section', |
|
| 95 | - ), |
|
| 45 | + add_action('admin_menu', array( $this, 'adminMenu' )); |
|
| 46 | + |
|
| 47 | + add_action('admin_init', array( $this, 'registerSettings' )); |
|
| 48 | + |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * Display 'Subway' link under 'Settings' |
|
| 53 | + * |
|
| 54 | + * @return void |
|
| 55 | + */ |
|
| 56 | + public function adminMenu() |
|
| 57 | + { |
|
| 58 | + |
|
| 59 | + add_options_page( |
|
| 60 | + 'Subway Settings', 'Subway', 'manage_options', |
|
| 61 | + 'subway', array( $this, 'optionsPage' ) |
|
| 62 | + ); |
|
| 63 | + |
|
| 64 | + return; |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * Registers all settings related to Subway. |
|
| 69 | + * |
|
| 70 | + * @return void |
|
| 71 | + */ |
|
| 72 | + public function registerSettings() |
|
| 73 | + { |
|
| 74 | + |
|
| 75 | + // Register our settings section. |
|
| 76 | + add_settings_section( |
|
| 77 | + 'subway-page-visibility-section', __('Pages Visibility', 'subway'), |
|
| 78 | + array( $this, 'sectionCallback' ), 'subway-settings-section' |
|
| 79 | + ); |
|
| 80 | + |
|
| 81 | + // Register Redirect Options pages. |
|
| 82 | + add_settings_section( |
|
| 83 | + 'subway-redirect-section', __('Redirect Options', 'subway'), |
|
| 84 | + array( $this, 'redirectCallback' ), 'subway-settings-section' |
|
| 85 | + ); |
|
| 86 | + |
|
| 87 | + // Register the fields. |
|
| 88 | + $fields = array( |
|
| 89 | + array( |
|
| 90 | + 'id' => 'subway_is_public', |
|
| 91 | + 'label' => __('Public Website', 'subway'), |
|
| 92 | + 'callback' => 'subway_is_public_form', |
|
| 93 | + 'section' => 'subway-settings-section', |
|
| 94 | + 'group' => 'subway-page-visibility-section', |
|
| 95 | + ), |
|
| 96 | 96 | |
| 97 | - array( |
|
| 98 | - 'id' => 'subway_login_page', |
|
| 99 | - 'label' => __('Private Login Page', 'subway'), |
|
| 100 | - 'callback' => 'subway_login_page_form', |
|
| 101 | - 'section' => 'subway-settings-section', |
|
| 102 | - 'group' => 'subway-page-visibility-section', |
|
| 103 | - ), |
|
| 104 | - array( |
|
| 105 | - 'id' => 'subway_public_post', |
|
| 106 | - 'label' => __('Public Posts IDs', 'subway'), |
|
| 107 | - 'callback' => 'subway_public_post', |
|
| 108 | - 'section' => 'subway-settings-section', |
|
| 109 | - 'group' => 'subway-page-visibility-section', |
|
| 110 | - ), |
|
| 97 | + array( |
|
| 98 | + 'id' => 'subway_login_page', |
|
| 99 | + 'label' => __('Private Login Page', 'subway'), |
|
| 100 | + 'callback' => 'subway_login_page_form', |
|
| 101 | + 'section' => 'subway-settings-section', |
|
| 102 | + 'group' => 'subway-page-visibility-section', |
|
| 103 | + ), |
|
| 104 | + array( |
|
| 105 | + 'id' => 'subway_public_post', |
|
| 106 | + 'label' => __('Public Posts IDs', 'subway'), |
|
| 107 | + 'callback' => 'subway_public_post', |
|
| 108 | + 'section' => 'subway-settings-section', |
|
| 109 | + 'group' => 'subway-page-visibility-section', |
|
| 110 | + ), |
|
| 111 | 111 | |
| 112 | - array( |
|
| 113 | - 'id' => 'subway_redirect_type', |
|
| 114 | - 'label' => __('Redirect Type', 'subway'), |
|
| 115 | - 'callback' => 'subway_redirect_option_form', |
|
| 116 | - 'section' => 'subway-settings-section', |
|
| 117 | - 'group' => 'subway-redirect-section', |
|
| 118 | - ), |
|
| 119 | - array( |
|
| 120 | - 'id' => 'subway_redirect_wp_admin', |
|
| 121 | - 'label' => __('Bypassing <em>wp-login.php</em>', 'subway'), |
|
| 122 | - 'callback' => 'subway_lock_wp_admin', |
|
| 123 | - 'section' => 'subway-settings-section', |
|
| 124 | - 'group' => 'subway-redirect-section', |
|
| 125 | - ), |
|
| 126 | - ); |
|
| 127 | - |
|
| 128 | - foreach ( $fields as $field ) { |
|
| 129 | - |
|
| 130 | - add_settings_field( |
|
| 131 | - $field['id'], $field['label'], |
|
| 132 | - $field['callback'], $field['section'], |
|
| 133 | - $field['group'] |
|
| 134 | - ); |
|
| 135 | - |
|
| 136 | - register_setting('subway-settings-group', $field['id']); |
|
| 137 | - |
|
| 138 | - $file = str_replace('_', '-', $field['callback']); |
|
| 139 | - |
|
| 140 | - include_once trailingslashit(SUBWAY_DIR_PATH) . |
|
| 141 | - 'settings-fields/field-' . sanitize_title($file) . '.php'; |
|
| 142 | - |
|
| 143 | - } |
|
| 144 | - |
|
| 145 | - // Register Redirect Page ID Settings. |
|
| 146 | - register_setting('subway-settings-group', 'subway_redirect_page_id'); |
|
| 147 | - |
|
| 148 | - // Register Redirect Custom URL Settings. |
|
| 149 | - register_setting('subway-settings-group', 'subway_redirect_custom_url'); |
|
| 150 | - |
|
| 151 | - return; |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - /** |
|
| 155 | - * Callback function for the first Section. |
|
| 156 | - * |
|
| 157 | - * @return void |
|
| 158 | - */ |
|
| 159 | - public function sectionCallback() |
|
| 160 | - { |
|
| 161 | - echo esc_html_e( |
|
| 162 | - 'All settings related to the |
|
| 112 | + array( |
|
| 113 | + 'id' => 'subway_redirect_type', |
|
| 114 | + 'label' => __('Redirect Type', 'subway'), |
|
| 115 | + 'callback' => 'subway_redirect_option_form', |
|
| 116 | + 'section' => 'subway-settings-section', |
|
| 117 | + 'group' => 'subway-redirect-section', |
|
| 118 | + ), |
|
| 119 | + array( |
|
| 120 | + 'id' => 'subway_redirect_wp_admin', |
|
| 121 | + 'label' => __('Bypassing <em>wp-login.php</em>', 'subway'), |
|
| 122 | + 'callback' => 'subway_lock_wp_admin', |
|
| 123 | + 'section' => 'subway-settings-section', |
|
| 124 | + 'group' => 'subway-redirect-section', |
|
| 125 | + ), |
|
| 126 | + ); |
|
| 127 | + |
|
| 128 | + foreach ( $fields as $field ) { |
|
| 129 | + |
|
| 130 | + add_settings_field( |
|
| 131 | + $field['id'], $field['label'], |
|
| 132 | + $field['callback'], $field['section'], |
|
| 133 | + $field['group'] |
|
| 134 | + ); |
|
| 135 | + |
|
| 136 | + register_setting('subway-settings-group', $field['id']); |
|
| 137 | + |
|
| 138 | + $file = str_replace('_', '-', $field['callback']); |
|
| 139 | + |
|
| 140 | + include_once trailingslashit(SUBWAY_DIR_PATH) . |
|
| 141 | + 'settings-fields/field-' . sanitize_title($file) . '.php'; |
|
| 142 | + |
|
| 143 | + } |
|
| 144 | + |
|
| 145 | + // Register Redirect Page ID Settings. |
|
| 146 | + register_setting('subway-settings-group', 'subway_redirect_page_id'); |
|
| 147 | + |
|
| 148 | + // Register Redirect Custom URL Settings. |
|
| 149 | + register_setting('subway-settings-group', 'subway_redirect_custom_url'); |
|
| 150 | + |
|
| 151 | + return; |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + /** |
|
| 155 | + * Callback function for the first Section. |
|
| 156 | + * |
|
| 157 | + * @return void |
|
| 158 | + */ |
|
| 159 | + public function sectionCallback() |
|
| 160 | + { |
|
| 161 | + echo esc_html_e( |
|
| 162 | + 'All settings related to the |
|
| 163 | 163 | visibility of your site and pages.', 'subway' |
| 164 | - ); |
|
| 165 | - return; |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - /** |
|
| 169 | - * Callback function for the second Section. |
|
| 170 | - * |
|
| 171 | - * @return void |
|
| 172 | - */ |
|
| 173 | - public function redirectCallback() |
|
| 174 | - { |
|
| 175 | - return; |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - /** |
|
| 179 | - * Renders the 'wrapper' for our options pages. |
|
| 180 | - * |
|
| 181 | - * @return void |
|
| 182 | - */ |
|
| 183 | - public function optionsPage() |
|
| 184 | - { |
|
| 185 | - ?> |
|
| 164 | + ); |
|
| 165 | + return; |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + /** |
|
| 169 | + * Callback function for the second Section. |
|
| 170 | + * |
|
| 171 | + * @return void |
|
| 172 | + */ |
|
| 173 | + public function redirectCallback() |
|
| 174 | + { |
|
| 175 | + return; |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * Renders the 'wrapper' for our options pages. |
|
| 180 | + * |
|
| 181 | + * @return void |
|
| 182 | + */ |
|
| 183 | + public function optionsPage() |
|
| 184 | + { |
|
| 185 | + ?> |
|
| 186 | 186 | |
| 187 | 187 | <div class="wrap"> |
| 188 | 188 | <h2> |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | </div> |
| 197 | 197 | |
| 198 | 198 | <?php |
| 199 | - } |
|
| 199 | + } |
|
| 200 | 200 | |
| 201 | 201 | } |
| 202 | 202 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | namespace Subway; |
| 21 | 21 | |
| 22 | -if (! defined('ABSPATH') ) { |
|
| 22 | +if ( ! defined('ABSPATH')) { |
|
| 23 | 23 | return; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | public function __construct() |
| 43 | 43 | { |
| 44 | 44 | |
| 45 | - add_action('admin_menu', array( $this, 'adminMenu' )); |
|
| 45 | + add_action('admin_menu', array($this, 'adminMenu')); |
|
| 46 | 46 | |
| 47 | - add_action('admin_init', array( $this, 'registerSettings' )); |
|
| 47 | + add_action('admin_init', array($this, 'registerSettings')); |
|
| 48 | 48 | |
| 49 | 49 | } |
| 50 | 50 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | add_options_page( |
| 60 | 60 | 'Subway Settings', 'Subway', 'manage_options', |
| 61 | - 'subway', array( $this, 'optionsPage' ) |
|
| 61 | + 'subway', array($this, 'optionsPage') |
|
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | 64 | return; |
@@ -75,13 +75,13 @@ discard block |
||
| 75 | 75 | // Register our settings section. |
| 76 | 76 | add_settings_section( |
| 77 | 77 | 'subway-page-visibility-section', __('Pages Visibility', 'subway'), |
| 78 | - array( $this, 'sectionCallback' ), 'subway-settings-section' |
|
| 78 | + array($this, 'sectionCallback'), 'subway-settings-section' |
|
| 79 | 79 | ); |
| 80 | 80 | |
| 81 | 81 | // Register Redirect Options pages. |
| 82 | 82 | add_settings_section( |
| 83 | 83 | 'subway-redirect-section', __('Redirect Options', 'subway'), |
| 84 | - array( $this, 'redirectCallback' ), 'subway-settings-section' |
|
| 84 | + array($this, 'redirectCallback'), 'subway-settings-section' |
|
| 85 | 85 | ); |
| 86 | 86 | |
| 87 | 87 | // Register the fields. |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | ), |
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | - foreach ( $fields as $field ) { |
|
| 128 | + foreach ($fields as $field) { |
|
| 129 | 129 | |
| 130 | 130 | add_settings_field( |
| 131 | 131 | $field['id'], $field['label'], |