@@ -206,6 +206,9 @@ discard block |
||
| 206 | 206 | /* Ctor |
| 207 | 207 | ------------------------------------------------------------------------------------------------------------------*/ |
| 208 | 208 | |
| 209 | + /** |
|
| 210 | + * @param string $slug |
|
| 211 | + */ |
|
| 209 | 212 | private function __construct( $slug ) { |
| 210 | 213 | $this->_slug = $slug; |
| 211 | 214 | |
@@ -652,7 +655,7 @@ discard block |
||
| 652 | 655 | * @author Vova Feldman (@svovaf) |
| 653 | 656 | * @since 1.0.1 |
| 654 | 657 | * |
| 655 | - * @param $plugin_file |
|
| 658 | + * @param string $plugin_file |
|
| 656 | 659 | * |
| 657 | 660 | * @return false|Freemius |
| 658 | 661 | */ |
@@ -1423,14 +1426,23 @@ discard block |
||
| 1423 | 1426 | ) ); |
| 1424 | 1427 | } |
| 1425 | 1428 | |
| 1429 | + /** |
|
| 1430 | + * @param string $key |
|
| 1431 | + */ |
|
| 1426 | 1432 | private function _get_option( &$options, $key, $default = false ) { |
| 1427 | 1433 | return ! empty( $options[ $key ] ) ? $options[ $key ] : $default; |
| 1428 | 1434 | } |
| 1429 | 1435 | |
| 1436 | + /** |
|
| 1437 | + * @param string $key |
|
| 1438 | + */ |
|
| 1430 | 1439 | private function _get_bool_option( &$options, $key, $default = false ) { |
| 1431 | 1440 | return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default; |
| 1432 | 1441 | } |
| 1433 | 1442 | |
| 1443 | + /** |
|
| 1444 | + * @param string $key |
|
| 1445 | + */ |
|
| 1434 | 1446 | private function _get_numeric_option( &$options, $key, $default = false ) { |
| 1435 | 1447 | return isset( $options[ $key ] ) && is_numeric( $options[ $key ] ) ? $options[ $key ] : $default; |
| 1436 | 1448 | } |
@@ -2756,7 +2768,7 @@ discard block |
||
| 2756 | 2768 | * @author Vova Feldman (@svovaf) |
| 2757 | 2769 | * @since 1.0.4 |
| 2758 | 2770 | * |
| 2759 | - * @return mixed Plugin secret key. |
|
| 2771 | + * @return string Plugin secret key. |
|
| 2760 | 2772 | */ |
| 2761 | 2773 | function get_secret_key() { |
| 2762 | 2774 | return $this->_plugin->secret_key; |
@@ -3475,7 +3487,7 @@ discard block |
||
| 3475 | 3487 | * @author Vova Feldman (@svovaf) |
| 3476 | 3488 | * @since 1.0.6 |
| 3477 | 3489 | * |
| 3478 | - * @return bool|\FS_Plugin_License |
|
| 3490 | + * @return FS_Plugin_License |
|
| 3479 | 3491 | */ |
| 3480 | 3492 | function _get_license() { |
| 3481 | 3493 | return $this->_license; |
@@ -4171,7 +4183,7 @@ discard block |
||
| 4171 | 4183 | * @param FS_Site $site |
| 4172 | 4184 | * @param bool $redirect |
| 4173 | 4185 | * |
| 4174 | - * @return bool False if account already set. |
|
| 4186 | + * @return boolean|null False if account already set. |
|
| 4175 | 4187 | */ |
| 4176 | 4188 | function setup_account( FS_User $user, FS_Site $site, $redirect = true ) { |
| 4177 | 4189 | $this->_user = $user; |
@@ -4808,8 +4820,6 @@ discard block |
||
| 4808 | 4820 | * @since 1.0.1 |
| 4809 | 4821 | * |
| 4810 | 4822 | * @param string $tag The name of the action to be executed. |
| 4811 | - * @param mixed $arg,... Optional. Additional arguments which are passed on to the |
|
| 4812 | - * functions hooked to the action. Default empty. |
|
| 4813 | 4823 | * |
| 4814 | 4824 | * @uses do_action() |
| 4815 | 4825 | */ |
@@ -5277,7 +5287,7 @@ discard block |
||
| 5277 | 5287 | * |
| 5278 | 5288 | * @param number|bool $plugin_id |
| 5279 | 5289 | * |
| 5280 | - * @return FS_Plugin_License[]|object |
|
| 5290 | + * @return FS_Plugin_License[] |
|
| 5281 | 5291 | */ |
| 5282 | 5292 | private function _fetch_licenses( $plugin_id = false ) { |
| 5283 | 5293 | $this->_logger->entrance(); |
@@ -7101,7 +7111,7 @@ discard block |
||
| 7101 | 7111 | * @since 1.0.0 |
| 7102 | 7112 | * |
| 7103 | 7113 | * @param $label |
| 7104 | - * @param $url |
|
| 7114 | + * @param string $url |
|
| 7105 | 7115 | * @param bool $external |
| 7106 | 7116 | * @param int $priority |
| 7107 | 7117 | * @param bool $key |
@@ -7336,7 +7346,7 @@ discard block |
||
| 7336 | 7346 | * @author Vova Feldman (@svovaf) |
| 7337 | 7347 | * @since 1.0.9 |
| 7338 | 7348 | * |
| 7339 | - * @return bool |
|
| 7349 | + * @return boolean|null |
|
| 7340 | 7350 | */ |
| 7341 | 7351 | function set_sdk_upgrade_complete() { |
| 7342 | 7352 | $this->_storage->sdk_upgrade_mode = false; |
@@ -7362,7 +7372,7 @@ discard block |
||
| 7362 | 7372 | * @author Vova Feldman (@svovaf) |
| 7363 | 7373 | * @since 1.0.9 |
| 7364 | 7374 | * |
| 7365 | - * @return bool |
|
| 7375 | + * @return boolean|null |
|
| 7366 | 7376 | */ |
| 7367 | 7377 | function set_plugin_upgrade_complete() { |
| 7368 | 7378 | $this->_storage->plugin_upgrade_mode = false; |
@@ -7378,7 +7388,7 @@ discard block |
||
| 7378 | 7388 | * @author Vova Feldman (@svovaf) |
| 7379 | 7389 | * @since 1.0.9 |
| 7380 | 7390 | * |
| 7381 | - * @return bool |
|
| 7391 | + * @return boolean|null |
|
| 7382 | 7392 | */ |
| 7383 | 7393 | function has_purchased_before() { |
| 7384 | 7394 | // TODO: Implement has_purchased_before() method. |
@@ -7390,7 +7400,7 @@ discard block |
||
| 7390 | 7400 | * @author Vova Feldman (@svovaf) |
| 7391 | 7401 | * @since 1.0.9 |
| 7392 | 7402 | * |
| 7393 | - * @return bool |
|
| 7403 | + * @return boolean|null |
|
| 7394 | 7404 | */ |
| 7395 | 7405 | function is_agency() { |
| 7396 | 7406 | // TODO: Implement is_agency() method. |
@@ -7402,7 +7412,7 @@ discard block |
||
| 7402 | 7412 | * @author Vova Feldman (@svovaf) |
| 7403 | 7413 | * @since 1.0.9 |
| 7404 | 7414 | * |
| 7405 | - * @return bool |
|
| 7415 | + * @return boolean|null |
|
| 7406 | 7416 | */ |
| 7407 | 7417 | function is_developer() { |
| 7408 | 7418 | // TODO: Implement is_developer() method. |
@@ -7414,7 +7424,7 @@ discard block |
||
| 7414 | 7424 | * @author Vova Feldman (@svovaf) |
| 7415 | 7425 | * @since 1.0.9 |
| 7416 | 7426 | * |
| 7417 | - * @return bool |
|
| 7427 | + * @return boolean|null |
|
| 7418 | 7428 | */ |
| 7419 | 7429 | function is_business() { |
| 7420 | 7430 | // TODO: Implement is_business() method. |
@@ -261,6 +261,9 @@ |
||
| 261 | 261 | return $cache_entry->result; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | + /** |
|
| 265 | + * @param string $path |
|
| 266 | + */ |
|
| 264 | 267 | private function get_cache_key( $path, $method = 'GET', $params = array() ) { |
| 265 | 268 | $canonized = $this->_api->CanonizePath( $path ); |
| 266 | 269 | // $exploded = explode('/', $canonized); |
@@ -21,6 +21,9 @@ discard block |
||
| 21 | 21 | private static $CNT = 0; |
| 22 | 22 | private static $_HOOKED_FOOTER = false; |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param string $id |
|
| 26 | + */ |
|
| 24 | 27 | private function __construct( $id, $on = false, $echo = false ) { |
| 25 | 28 | $this->_id = $id; |
| 26 | 29 | |
@@ -87,6 +90,9 @@ discard block |
||
| 87 | 90 | } |
| 88 | 91 | |
| 89 | 92 | |
| 93 | + /** |
|
| 94 | + * @param boolean $wrapper |
|
| 95 | + */ |
|
| 90 | 96 | private function _log( &$message, $type = 'log', $wrapper ) { |
| 91 | 97 | if ( ! $this->is_on() ) { |
| 92 | 98 | return; |
@@ -115,10 +121,16 @@ discard block |
||
| 115 | 121 | } |
| 116 | 122 | } |
| 117 | 123 | |
| 124 | + /** |
|
| 125 | + * @param string $message |
|
| 126 | + */ |
|
| 118 | 127 | function log( $message, $wrapper = false ) { |
| 119 | 128 | $this->_log( $message, 'log', $wrapper ); |
| 120 | 129 | } |
| 121 | 130 | |
| 131 | + /** |
|
| 132 | + * @param string $message |
|
| 133 | + */ |
|
| 122 | 134 | function info( $message, $wrapper = false ) { |
| 123 | 135 | $this->_log( $message, 'info', $wrapper ); |
| 124 | 136 | } |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | * |
| 96 | 96 | * @param stdClass $transient_data Update array build by WordPress. |
| 97 | 97 | * |
| 98 | - * @return array Modified update array with custom plugin data. |
|
| 98 | + * @return stdClass Modified update array with custom plugin data. |
|
| 99 | 99 | */ |
| 100 | 100 | function pre_set_site_transient_update_plugins_filter( $transient_data ) { |
| 101 | 101 | $this->_logger->entrance(); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * @author Vova Feldman (@svovaf) |
| 17 | 17 | * @since 1.0.0 |
| 18 | 18 | * |
| 19 | - * @param object $object |
|
| 19 | + * @param FS_Entity $object |
|
| 20 | 20 | * |
| 21 | 21 | * @return array |
| 22 | 22 | */ |
@@ -39,16 +39,25 @@ discard block |
||
| 39 | 39 | include_once( fs_get_template_path( $path ) ); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | + /** |
|
| 43 | + * @param string $path |
|
| 44 | + */ |
|
| 42 | 45 | function fs_require_template( $path, &$params = null ) { |
| 43 | 46 | $VARS = &$params; |
| 44 | 47 | require( fs_get_template_path( $path ) ); |
| 45 | 48 | } |
| 46 | 49 | |
| 50 | + /** |
|
| 51 | + * @param string $path |
|
| 52 | + */ |
|
| 47 | 53 | function fs_require_once_template( $path, &$params = null ) { |
| 48 | 54 | $VARS = &$params; |
| 49 | 55 | require_once( fs_get_template_path( $path ) ); |
| 50 | 56 | } |
| 51 | 57 | |
| 58 | + /** |
|
| 59 | + * @param string $path |
|
| 60 | + */ |
|
| 52 | 61 | function fs_get_template( $path, &$params = null ) { |
| 53 | 62 | ob_start(); |
| 54 | 63 | |
@@ -68,12 +77,20 @@ discard block |
||
| 68 | 77 | return isset( $fs_text[ $key ] ) ? $fs_text[ $key ] : $key; |
| 69 | 78 | } |
| 70 | 79 | |
| 80 | + /** |
|
| 81 | + * @param string $key |
|
| 82 | + */ |
|
| 71 | 83 | function _efs( $key ) { |
| 72 | 84 | echo __fs( $key ); |
| 73 | 85 | } |
| 74 | 86 | |
| 75 | 87 | /* Scripts and styles including. |
| 76 | 88 | --------------------------------------------------------------------------------------------*/ |
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * @param string $handle |
|
| 92 | + * @param string $path |
|
| 93 | + */ |
|
| 77 | 94 | function fs_enqueue_local_style( $handle, $path, $deps = array(), $ver = false, $media = 'all' ) { |
| 78 | 95 | global $fs_core_logger; |
| 79 | 96 | if ( $fs_core_logger->is_on() ) { |
@@ -108,10 +125,16 @@ discard block |
||
| 108 | 125 | return isset( $_REQUEST[ $key ] ) ? $_REQUEST[ $key ] : $def; |
| 109 | 126 | } |
| 110 | 127 | |
| 128 | + /** |
|
| 129 | + * @param string $key |
|
| 130 | + */ |
|
| 111 | 131 | function fs_request_has( $key ) { |
| 112 | 132 | return isset( $_REQUEST[ $key ] ); |
| 113 | 133 | } |
| 114 | 134 | |
| 135 | + /** |
|
| 136 | + * @param string $key |
|
| 137 | + */ |
|
| 115 | 138 | function fs_request_get_bool( $key, $def = false ) { |
| 116 | 139 | return ( isset( $_REQUEST[ $key ] ) && ( 1 == $_REQUEST[ $key ] || 'true' === strtolower( $_REQUEST[ $key ] ) ) ) ? true : $def; |
| 117 | 140 | } |
@@ -140,10 +163,16 @@ discard block |
||
| 140 | 163 | return false; |
| 141 | 164 | } |
| 142 | 165 | |
| 166 | + /** |
|
| 167 | + * @param string $action |
|
| 168 | + */ |
|
| 143 | 169 | function fs_request_is_action( $action, $action_key = 'action' ) { |
| 144 | 170 | return ( strtolower( $action ) === fs_get_action( $action_key ) ); |
| 145 | 171 | } |
| 146 | 172 | |
| 173 | + /** |
|
| 174 | + * @param string $menu_slug |
|
| 175 | + */ |
|
| 147 | 176 | function fs_is_plugin_page( $menu_slug ) { |
| 148 | 177 | return ( is_admin() && $_REQUEST['page'] === $menu_slug ); |
| 149 | 178 | } |
@@ -313,6 +342,10 @@ discard block |
||
| 313 | 342 | return wp_normalize_path( $path ); |
| 314 | 343 | } |
| 315 | 344 | } else { |
| 345 | + |
|
| 346 | + /** |
|
| 347 | + * @return string |
|
| 348 | + */ |
|
| 316 | 349 | function fs_normalize_path( $path ) { |
| 317 | 350 | $path = str_replace( '\\', '/', $path ); |
| 318 | 351 | $path = preg_replace( '|/+|', '/', $path ); |
@@ -321,6 +354,11 @@ discard block |
||
| 321 | 354 | } |
| 322 | 355 | } |
| 323 | 356 | |
| 357 | + /** |
|
| 358 | + * @param string $actionurl |
|
| 359 | + * |
|
| 360 | + * @return string |
|
| 361 | + */ |
|
| 324 | 362 | function fs_nonce_url( $actionurl, $action = - 1, $name = '_wpnonce' ) { |
| 325 | 363 | // $actionurl = str_replace( '&', '&', $actionurl ); |
| 326 | 364 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * @param string $plugin_slug |
| 87 | 87 | * |
| 88 | - * @return FS_Admin_Notice_Manager |
|
| 88 | + * @return FS_Admin_Menu_Manager |
|
| 89 | 89 | */ |
| 90 | 90 | static function instance( $plugin_slug ) { |
| 91 | 91 | if ( ! isset( self::$_instances[ $plugin_slug ] ) ) { |
@@ -95,6 +95,9 @@ discard block |
||
| 95 | 95 | return self::$_instances[ $plugin_slug ]; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | + /** |
|
| 99 | + * @param string $plugin_slug |
|
| 100 | + */ |
|
| 98 | 101 | protected function __construct( $plugin_slug ) { |
| 99 | 102 | $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $plugin_slug . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); |
| 100 | 103 | |
@@ -105,10 +108,16 @@ discard block |
||
| 105 | 108 | |
| 106 | 109 | #region Helpers |
| 107 | 110 | |
| 111 | + /** |
|
| 112 | + * @param string $key |
|
| 113 | + */ |
|
| 108 | 114 | private function get_option( &$options, $key, $default = false ) { |
| 109 | 115 | return ! empty( $options[ $key ] ) ? $options[ $key ] : $default; |
| 110 | 116 | } |
| 111 | 117 | |
| 118 | + /** |
|
| 119 | + * @param string $key |
|
| 120 | + */ |
|
| 112 | 121 | private function get_bool_option( &$options, $key, $default = false ) { |
| 113 | 122 | return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default; |
| 114 | 123 | } |
@@ -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 | |
@@ -251,7 +254,7 @@ discard block |
||
| 251 | 254 | * @author Vova Feldman (@svovaf) |
| 252 | 255 | * @since 1.0.9 |
| 253 | 256 | * |
| 254 | - * @param $id |
|
| 257 | + * @param string $id |
|
| 255 | 258 | * |
| 256 | 259 | * @return bool |
| 257 | 260 | */ |
@@ -48,6 +48,10 @@ discard block |
||
| 48 | 48 | return self::$_instances[ $key ]; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | + /** |
|
| 52 | + * @param string $id |
|
| 53 | + * @param string $slug |
|
| 54 | + */ |
|
| 51 | 55 | protected function __construct( $id, $slug ) { |
| 52 | 56 | $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); |
| 53 | 57 | |
@@ -166,7 +170,7 @@ discard block |
||
| 166 | 170 | * @since 1.0.7 |
| 167 | 171 | * |
| 168 | 172 | * @param string $key |
| 169 | - * @param mixed $default |
|
| 173 | + * @param false|null $default |
|
| 170 | 174 | * |
| 171 | 175 | * @return bool|\FS_Plugin |
| 172 | 176 | */ |