@@ -120,7 +120,7 @@ |
||
| 120 | 120 | * @author Vova Feldman (@svovaf) |
| 121 | 121 | * @since 1.1.8 |
| 122 | 122 | * |
| 123 | - * @return int |
|
| 123 | + * @return double |
|
| 124 | 124 | */ |
| 125 | 125 | function annual_discount_percentage() { |
| 126 | 126 | return floor( $this->annual_savings() / ( $this->monthly_price * 12 * ( $this->is_unlimited() ? 1 : $this->licenses ) ) * 100 ); |
@@ -38,16 +38,25 @@ discard block |
||
| 38 | 38 | include_once fs_get_template_path( $path ); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $path |
|
| 43 | + */ |
|
| 41 | 44 | function fs_require_template( $path, &$params = null ) { |
| 42 | 45 | $VARS = &$params; |
| 43 | 46 | require fs_get_template_path( $path ); |
| 44 | 47 | } |
| 45 | 48 | |
| 49 | + /** |
|
| 50 | + * @param string $path |
|
| 51 | + */ |
|
| 46 | 52 | function fs_require_once_template( $path, &$params = null ) { |
| 47 | 53 | $VARS = &$params; |
| 48 | 54 | require_once fs_get_template_path( $path ); |
| 49 | 55 | } |
| 50 | 56 | |
| 57 | + /** |
|
| 58 | + * @param string $path |
|
| 59 | + */ |
|
| 51 | 60 | function fs_get_template( $path, &$params = null ) { |
| 52 | 61 | ob_start(); |
| 53 | 62 | |
@@ -60,10 +69,19 @@ discard block |
||
| 60 | 69 | |
| 61 | 70 | /* Scripts and styles including. |
| 62 | 71 | --------------------------------------------------------------------------------------------*/ |
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * @param string $handle |
|
| 75 | + * @param string $path |
|
| 76 | + */ |
|
| 63 | 77 | function fs_enqueue_local_style( $handle, $path, $deps = array(), $ver = false, $media = 'all' ) { |
| 64 | 78 | wp_enqueue_style( $handle, plugins_url( plugin_basename( WP_FS__DIR_CSS . '/' . trim( $path, '/' ) ) ), $deps, $ver, $media ); |
| 65 | 79 | } |
| 66 | 80 | |
| 81 | + /** |
|
| 82 | + * @param string $handle |
|
| 83 | + * @param string $path |
|
| 84 | + */ |
|
| 67 | 85 | function fs_enqueue_local_script( $handle, $path, $deps = array(), $ver = false, $in_footer = 'all' ) { |
| 68 | 86 | wp_enqueue_script( $handle, plugins_url( plugin_basename( WP_FS__DIR_JS . '/' . trim( $path, '/' ) ) ), $deps, $ver, $in_footer ); |
| 69 | 87 | } |
@@ -103,6 +121,9 @@ discard block |
||
| 103 | 121 | return $value; |
| 104 | 122 | } |
| 105 | 123 | |
| 124 | + /** |
|
| 125 | + * @param string $key |
|
| 126 | + */ |
|
| 106 | 127 | function fs_request_has( $key ) { |
| 107 | 128 | return isset( $_REQUEST[ $key ] ); |
| 108 | 129 | } |
@@ -147,6 +168,9 @@ discard block |
||
| 147 | 168 | return false; |
| 148 | 169 | } |
| 149 | 170 | |
| 171 | + /** |
|
| 172 | + * @param string $action |
|
| 173 | + */ |
|
| 150 | 174 | function fs_request_is_action( $action, $action_key = 'action' ) { |
| 151 | 175 | return ( strtolower( $action ) === fs_get_action( $action_key ) ); |
| 152 | 176 | } |
@@ -185,6 +209,9 @@ discard block |
||
| 185 | 209 | return true; |
| 186 | 210 | } |
| 187 | 211 | |
| 212 | + /** |
|
| 213 | + * @param string $page_slug |
|
| 214 | + */ |
|
| 188 | 215 | function fs_is_plugin_page( $page_slug ) { |
| 189 | 216 | return ( is_admin() && $page_slug === fs_request_get('page') ); |
| 190 | 217 | } |
@@ -326,7 +353,7 @@ discard block |
||
| 326 | 353 | * @since ~1.1.3 |
| 327 | 354 | * |
| 328 | 355 | * @param string $actionurl URL to add nonce action. |
| 329 | - * @param int|string $action Optional. Nonce action name. Default -1. |
|
| 356 | + * @param integer $action Optional. Nonce action name. Default -1. |
|
| 330 | 357 | * @param string $name Optional. Nonce name. Default '_wpnonce'. |
| 331 | 358 | * |
| 332 | 359 | * @return string Escaped URL with nonce action added. |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * @param bool $exit If true, exit after redirect (Since 1.2.1.5). |
| 46 | 46 | * @param int $status Status code to use. |
| 47 | 47 | * |
| 48 | - * @return bool False if $location is not set |
|
| 48 | + * @return null|boolean False if $location is not set |
|
| 49 | 49 | */ |
| 50 | 50 | function fs_redirect( $location, $exit = true, $status = 302 ) { |
| 51 | 51 | global $is_IIS; |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | * @param string $tag The name of the filter hook. |
| 444 | 444 | * @param mixed $value The value on which the filters hooked to `$tag` are applied on. |
| 445 | 445 | * |
| 446 | - * @return mixed The filtered value after all hooked functions are applied to it. |
|
| 446 | + * @return string|boolean The filtered value after all hooked functions are applied to it. |
|
| 447 | 447 | * |
| 448 | 448 | * @uses apply_filters() |
| 449 | 449 | */ |
@@ -101,6 +101,9 @@ discard block |
||
| 101 | 101 | return self::$_instances[ $plugin_slug ]; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | + /** |
|
| 105 | + * @param string $plugin_slug |
|
| 106 | + */ |
|
| 104 | 107 | protected function __construct( $plugin_slug ) { |
| 105 | 108 | $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $plugin_slug . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); |
| 106 | 109 | |
@@ -111,10 +114,16 @@ discard block |
||
| 111 | 114 | |
| 112 | 115 | #region Helpers |
| 113 | 116 | |
| 117 | + /** |
|
| 118 | + * @param string $key |
|
| 119 | + */ |
|
| 114 | 120 | private function get_option( &$options, $key, $default = false ) { |
| 115 | 121 | return ! empty( $options[ $key ] ) ? $options[ $key ] : $default; |
| 116 | 122 | } |
| 117 | 123 | |
| 124 | + /** |
|
| 125 | + * @param string $key |
|
| 126 | + */ |
|
| 118 | 127 | private function get_bool_option( &$options, $key, $default = false ) { |
| 119 | 128 | return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default; |
| 120 | 129 | } |
@@ -50,6 +50,9 @@ discard block |
||
| 50 | 50 | return self::$_instances[ $slug ]; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | + /** |
|
| 54 | + * @param string $slug |
|
| 55 | + */ |
|
| 53 | 56 | protected function __construct( $slug, $title = '' ) { |
| 54 | 57 | $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_data', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); |
| 55 | 58 | |
@@ -258,7 +261,7 @@ discard block |
||
| 258 | 261 | * @author Vova Feldman (@svovaf) |
| 259 | 262 | * @since 1.0.9 |
| 260 | 263 | * |
| 261 | - * @param $id |
|
| 264 | + * @param string $id |
|
| 262 | 265 | * |
| 263 | 266 | * @return bool |
| 264 | 267 | */ |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | * @author Vova Feldman (@svovaf) |
| 45 | 45 | * @since 1.1.6 |
| 46 | 46 | * |
| 47 | - * @param $id |
|
| 47 | + * @param string $id |
|
| 48 | 48 | * |
| 49 | 49 | * @return FS_Cache_Manager |
| 50 | 50 | */ |
@@ -79,6 +79,10 @@ discard block |
||
| 79 | 79 | return self::$_instances[ $key ]; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $id |
|
| 84 | + * @param string $slug |
|
| 85 | + */ |
|
| 82 | 86 | protected function __construct( $id, $slug ) { |
| 83 | 87 | $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); |
| 84 | 88 | |
@@ -203,7 +207,7 @@ discard block |
||
| 203 | 207 | * @since 1.0.7 |
| 204 | 208 | * |
| 205 | 209 | * @param string $key |
| 206 | - * @param mixed $default |
|
| 210 | + * @param false|null $default |
|
| 207 | 211 | * |
| 208 | 212 | * @return bool|\FS_Plugin |
| 209 | 213 | */ |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | * @author Vova Feldman (@svovaf) |
| 66 | 66 | * @since 1.0.3 |
| 67 | 67 | * |
| 68 | - * @param $id |
|
| 68 | + * @param string $id |
|
| 69 | 69 | * @param $load |
| 70 | 70 | * |
| 71 | 71 | * @return FS_Option_Manager |
@@ -42,6 +42,9 @@ discard block |
||
| 42 | 42 | return self::$_instances[ $slug ]; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param string $slug |
|
| 47 | + */ |
|
| 45 | 48 | protected function __construct( $slug ) { |
| 46 | 49 | $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_' . 'plugins', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); |
| 47 | 50 | |
@@ -76,7 +79,7 @@ discard block |
||
| 76 | 79 | * @author Vova Feldman (@svovaf) |
| 77 | 80 | * @since 1.0.6 |
| 78 | 81 | * |
| 79 | - * @param bool|FS_Plugin $plugin |
|
| 82 | + * @param FS_Plugin $plugin |
|
| 80 | 83 | * @param bool $flush |
| 81 | 84 | * |
| 82 | 85 | * @return bool|\FS_Plugin |