@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function set_upgrader( &$upgrader ) { |
| 23 | 23 | if ( is_object( $upgrader ) ) { |
| 24 | - $this->upgrader =& $upgrader; |
|
| 24 | + $this->upgrader = & $upgrader; |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
@@ -10,6 +10,8 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @deprecated 2.3 |
| 13 | + * @param string $function |
|
| 14 | + * @param string $version |
|
| 13 | 15 | */ |
| 14 | 16 | public static function deprecated( $function, $version ) { |
| 15 | 17 | _deprecated_function( $function, $version ); |
@@ -68,6 +70,7 @@ discard block |
||
| 68 | 70 | |
| 69 | 71 | /** |
| 70 | 72 | * @deprecated 3.04.03 |
| 73 | + * @param string $url |
|
| 71 | 74 | */ |
| 72 | 75 | private static function send_api_request( $url, $transient = array() ) { |
| 73 | 76 | $data = get_transient( $transient['name'] ); |
@@ -318,6 +321,7 @@ discard block |
||
| 318 | 321 | |
| 319 | 322 | /** |
| 320 | 323 | * @deprecated 3.0 |
| 324 | + * @param string $field |
|
| 321 | 325 | */ |
| 322 | 326 | private static function edit_in_place_value( $field ) { |
| 323 | 327 | _deprecated_function( __FUNCTION__, '3.0' ); |
@@ -714,6 +718,7 @@ discard block |
||
| 714 | 718 | |
| 715 | 719 | /** |
| 716 | 720 | * @deprecated 3.02.03 |
| 721 | + * @return string |
|
| 717 | 722 | */ |
| 718 | 723 | public static function get_form_for_page() { |
| 719 | 724 | _deprecated_function( __FUNCTION__, '3.02.03' ); |
@@ -624,8 +624,8 @@ discard block |
||
| 624 | 624 | */ |
| 625 | 625 | public static function get_shortcode_tag( $shortcodes, $short_key, $args ) { |
| 626 | 626 | _deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' ); |
| 627 | - return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
| 628 | - } |
|
| 627 | + return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
| 628 | + } |
|
| 629 | 629 | |
| 630 | 630 | /** |
| 631 | 631 | * @deprecated 3.01 |
@@ -638,52 +638,52 @@ discard block |
||
| 638 | 638 | /** |
| 639 | 639 | * @deprecated 3.02.03 |
| 640 | 640 | */ |
| 641 | - public static function jquery_themes() { |
|
| 641 | + public static function jquery_themes() { |
|
| 642 | 642 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' ); |
| 643 | 643 | |
| 644 | - $themes = array( |
|
| 645 | - 'ui-lightness' => 'UI Lightness', |
|
| 646 | - 'ui-darkness' => 'UI Darkness', |
|
| 647 | - 'smoothness' => 'Smoothness', |
|
| 648 | - 'start' => 'Start', |
|
| 649 | - 'redmond' => 'Redmond', |
|
| 650 | - 'sunny' => 'Sunny', |
|
| 651 | - 'overcast' => 'Overcast', |
|
| 652 | - 'le-frog' => 'Le Frog', |
|
| 653 | - 'flick' => 'Flick', |
|
| 644 | + $themes = array( |
|
| 645 | + 'ui-lightness' => 'UI Lightness', |
|
| 646 | + 'ui-darkness' => 'UI Darkness', |
|
| 647 | + 'smoothness' => 'Smoothness', |
|
| 648 | + 'start' => 'Start', |
|
| 649 | + 'redmond' => 'Redmond', |
|
| 650 | + 'sunny' => 'Sunny', |
|
| 651 | + 'overcast' => 'Overcast', |
|
| 652 | + 'le-frog' => 'Le Frog', |
|
| 653 | + 'flick' => 'Flick', |
|
| 654 | 654 | 'pepper-grinder' => 'Pepper Grinder', |
| 655 | - 'eggplant' => 'Eggplant', |
|
| 656 | - 'dark-hive' => 'Dark Hive', |
|
| 657 | - 'cupertino' => 'Cupertino', |
|
| 658 | - 'south-street' => 'South Street', |
|
| 659 | - 'blitzer' => 'Blitzer', |
|
| 660 | - 'humanity' => 'Humanity', |
|
| 661 | - 'hot-sneaks' => 'Hot Sneaks', |
|
| 662 | - 'excite-bike' => 'Excite Bike', |
|
| 663 | - 'vader' => 'Vader', |
|
| 664 | - 'dot-luv' => 'Dot Luv', |
|
| 665 | - 'mint-choc' => 'Mint Choc', |
|
| 666 | - 'black-tie' => 'Black Tie', |
|
| 667 | - 'trontastic' => 'Trontastic', |
|
| 668 | - 'swanky-purse' => 'Swanky Purse', |
|
| 669 | - ); |
|
| 655 | + 'eggplant' => 'Eggplant', |
|
| 656 | + 'dark-hive' => 'Dark Hive', |
|
| 657 | + 'cupertino' => 'Cupertino', |
|
| 658 | + 'south-street' => 'South Street', |
|
| 659 | + 'blitzer' => 'Blitzer', |
|
| 660 | + 'humanity' => 'Humanity', |
|
| 661 | + 'hot-sneaks' => 'Hot Sneaks', |
|
| 662 | + 'excite-bike' => 'Excite Bike', |
|
| 663 | + 'vader' => 'Vader', |
|
| 664 | + 'dot-luv' => 'Dot Luv', |
|
| 665 | + 'mint-choc' => 'Mint Choc', |
|
| 666 | + 'black-tie' => 'Black Tie', |
|
| 667 | + 'trontastic' => 'Trontastic', |
|
| 668 | + 'swanky-purse' => 'Swanky Purse', |
|
| 669 | + ); |
|
| 670 | 670 | |
| 671 | 671 | $themes = apply_filters( 'frm_jquery_themes', $themes ); |
| 672 | - return $themes; |
|
| 673 | - } |
|
| 672 | + return $themes; |
|
| 673 | + } |
|
| 674 | 674 | |
| 675 | 675 | /** |
| 676 | 676 | * @deprecated 3.02.03 |
| 677 | 677 | */ |
| 678 | - public static function enqueue_jquery_css() { |
|
| 678 | + public static function enqueue_jquery_css() { |
|
| 679 | 679 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' ); |
| 680 | 680 | |
| 681 | 681 | $form = self::get_form_for_page(); |
| 682 | 682 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
| 683 | - if ( $theme_css != -1 ) { |
|
| 683 | + if ( $theme_css != -1 ) { |
|
| 684 | 684 | wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() ); |
| 685 | - } |
|
| 686 | - } |
|
| 685 | + } |
|
| 686 | + } |
|
| 687 | 687 | |
| 688 | 688 | /** |
| 689 | 689 | * @deprecated 3.02.03 |
@@ -691,26 +691,26 @@ discard block |
||
| 691 | 691 | public static function jquery_css_url( $theme_css ) { |
| 692 | 692 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_css_url' ); |
| 693 | 693 | |
| 694 | - if ( $theme_css == -1 ) { |
|
| 695 | - return; |
|
| 696 | - } |
|
| 694 | + if ( $theme_css == -1 ) { |
|
| 695 | + return; |
|
| 696 | + } |
|
| 697 | 697 | |
| 698 | - if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
| 699 | - $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
| 698 | + if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
| 699 | + $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
| 700 | 700 | } elseif ( preg_match( '/^http.?:\/\/.*\..*$/', $theme_css ) ) { |
| 701 | - $css_file = $theme_css; |
|
| 702 | - } else { |
|
| 703 | - $uploads = FrmStylesHelper::get_upload_base(); |
|
| 701 | + $css_file = $theme_css; |
|
| 702 | + } else { |
|
| 703 | + $uploads = FrmStylesHelper::get_upload_base(); |
|
| 704 | 704 | $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css'; |
| 705 | 705 | if ( file_exists( $uploads['basedir'] . $file_path ) ) { |
| 706 | - $css_file = $uploads['baseurl'] . $file_path; |
|
| 707 | - } else { |
|
| 706 | + $css_file = $uploads['baseurl'] . $file_path; |
|
| 707 | + } else { |
|
| 708 | 708 | $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css'; |
| 709 | - } |
|
| 710 | - } |
|
| 709 | + } |
|
| 710 | + } |
|
| 711 | 711 | |
| 712 | - return $css_file; |
|
| 713 | - } |
|
| 712 | + return $css_file; |
|
| 713 | + } |
|
| 714 | 714 | |
| 715 | 715 | /** |
| 716 | 716 | * @deprecated 3.02.03 |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
| 25 | 25 | |
| 26 | 26 | $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
| 27 | - $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ]; |
|
| 27 | + $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[$action]; |
|
| 28 | 28 | |
| 29 | 29 | if ( $action === 'create' ) { |
| 30 | 30 | FrmFormsController::update( $values ); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $values = FrmFormsHelper::setup_new_vars( $values ); |
| 35 | - $id = FrmForm::create( $values ); |
|
| 35 | + $id = FrmForm::create( $values ); |
|
| 36 | 36 | $values['id'] = $id; |
| 37 | 37 | |
| 38 | 38 | FrmFormsController::edit( $values ); |
@@ -457,8 +457,8 @@ discard block |
||
| 457 | 457 | $path = untrailingslashit( trim( $path ) ); |
| 458 | 458 | $templates = glob( $path . '/*.php' ); |
| 459 | 459 | |
| 460 | - for ( $i = count( $templates ) - 1; $i >= 0; $i-- ) { |
|
| 461 | - $filename = str_replace( '.php', '', str_replace( $path . '/', '', $templates[ $i ] ) ); |
|
| 460 | + for ( $i = count( $templates ) - 1; $i >= 0; $i -- ) { |
|
| 461 | + $filename = str_replace( '.php', '', str_replace( $path . '/', '', $templates[$i] ) ); |
|
| 462 | 462 | $template_query = array( 'form_key' => $filename ); |
| 463 | 463 | if ( $template ) { |
| 464 | 464 | $template_query['is_template'] = 1; |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $values['is_template'] = $template; |
| 474 | 474 | $values['status'] = 'published'; |
| 475 | 475 | |
| 476 | - include( $templates[ $i ] ); |
|
| 476 | + include( $templates[$i] ); |
|
| 477 | 477 | |
| 478 | 478 | //get updated form |
| 479 | 479 | if ( isset( $form ) && ! empty( $form ) ) { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @uses api_request() |
| 74 | 74 | * |
| 75 | 75 | * @param array $_transient_data Update array build by WordPress. |
| 76 | - * @return array Modified update array with custom plugin data. |
|
| 76 | + * @return stdClass Modified update array with custom plugin data. |
|
| 77 | 77 | */ |
| 78 | 78 | public function check_update( $_transient_data ) { |
| 79 | 79 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | * |
| 220 | 220 | * @param string $_action The requested action. |
| 221 | 221 | * @param array $_data Parameters for the API action. |
| 222 | - * @return false|object |
|
| 222 | + * @return string |
|
| 223 | 223 | */ |
| 224 | 224 | private function api_request( $_action, $_data ) { |
| 225 | 225 | |
@@ -297,11 +297,13 @@ |
||
| 297 | 297 | |
| 298 | 298 | global $frm_edd_plugin_data; |
| 299 | 299 | |
| 300 | - if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // WPCS: CSRF ok. |
|
| 300 | + if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { |
|
| 301 | +// WPCS: CSRF ok. |
|
| 301 | 302 | return; |
| 302 | 303 | } |
| 303 | 304 | |
| 304 | - if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // WPCS: CSRF ok. |
|
| 305 | + if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { |
|
| 306 | +// WPCS: CSRF ok. |
|
| 305 | 307 | return; |
| 306 | 308 | } |
| 307 | 309 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; |
| 45 | 45 | $this->cache_key = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) ); |
| 46 | 46 | |
| 47 | - $frm_edd_plugin_data[ $this->slug ] = $this->api_data; |
|
| 47 | + $frm_edd_plugin_data[$this->slug] = $this->api_data; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Fires after the $frm_edd_plugin_data is setup. |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $_transient_data = new stdClass(); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { |
|
| 96 | + if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) { |
|
| 97 | 97 | return $_transient_data; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -120,12 +120,12 @@ discard block |
||
| 120 | 120 | $version_info->plugin = $this->name; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - $_transient_data->response[ $this->name ] = $version_info; |
|
| 123 | + $_transient_data->response[$this->name] = $version_info; |
|
| 124 | 124 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $_transient_data->last_checked = time(); |
| 128 | - $_transient_data->checked[ $this->name ] = $this->version; |
|
| 128 | + $_transient_data->checked[$this->name] = $this->version; |
|
| 129 | 129 | |
| 130 | 130 | } |
| 131 | 131 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { |
| 190 | 190 | $new_sections = array(); |
| 191 | 191 | foreach ( $_data->sections as $key => $value ) { |
| 192 | - $new_sections[ $key ] = $value; |
|
| 192 | + $new_sections[$key] = $value; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $_data->sections = $new_sections; |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { |
| 200 | 200 | $new_banners = array(); |
| 201 | 201 | foreach ( $_data->banners as $key => $value ) { |
| 202 | - $new_banners[ $key ] = $value; |
|
| 202 | + $new_banners[$key] = $value; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $_data->banners = $new_banners; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | $slug = sanitize_text_field( $_REQUEST['slug'] ); // WPCS: CSRF ok. |
| 319 | - $data = $frm_edd_plugin_data[ $slug ]; |
|
| 319 | + $data = $frm_edd_plugin_data[$slug]; |
|
| 320 | 320 | $beta = ! empty( $data['beta'] ) ? true : false; |
| 321 | 321 | $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // WPCS: CSRF ok. |
| 322 | 322 | $version_info = $this->get_cached_version_info( $cache_key ); |
@@ -151,6 +151,7 @@ |
||
| 151 | 151 | |
| 152 | 152 | /** |
| 153 | 153 | * @deprecated 2.04 |
| 154 | + * @param string $val |
|
| 154 | 155 | */ |
| 155 | 156 | private static function get_field_value( $atts, &$val ) { |
| 156 | 157 | _deprecated_function( __FUNCTION__, '2.04', 'instance of FrmEntryValues or FrmProEntryValues' ); |
@@ -98,15 +98,15 @@ discard block |
||
| 98 | 98 | self::prepare_field_output( $atts, $val ); |
| 99 | 99 | |
| 100 | 100 | if ( $atts['format'] != 'text' ) { |
| 101 | - $values[ $f->field_key ] = $val; |
|
| 101 | + $values[$f->field_key] = $val; |
|
| 102 | 102 | if ( $atts['entry'] && $f->type != 'textarea' ) { |
| 103 | - $prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] ); |
|
| 103 | + $prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] ); |
|
| 104 | 104 | if ( $prev_val != $val ) { |
| 105 | - $values[ $f->field_key . '-value' ] = $prev_val; |
|
| 105 | + $values[$f->field_key . '-value'] = $prev_val; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | } else { |
| 109 | - $values[ $f->id ] = array( |
|
| 109 | + $values[$f->id] = array( |
|
| 110 | 110 | 'label' => $f->name, |
| 111 | 111 | 'val' => $val, |
| 112 | 112 | 'type' => $f->type, |
@@ -120,9 +120,9 @@ discard block |
||
| 120 | 120 | private static function fill_missing_fields( $atts, &$values ) { |
| 121 | 121 | _deprecated_function( __FUNCTION__, '2.04', 'instance of FrmEntryValues or FrmProEntryValues' ); |
| 122 | 122 | |
| 123 | - if ( $atts['entry'] && ! isset( $atts['entry']->metas[ $atts['field']->id ] ) ) { |
|
| 123 | + if ( $atts['entry'] && ! isset( $atts['entry']->metas[$atts['field']->id] ) ) { |
|
| 124 | 124 | // In case include_blank is set |
| 125 | - $atts['entry']->metas[ $atts['field']->id ] = ''; |
|
| 125 | + $atts['entry']->metas[$atts['field']->id] = ''; |
|
| 126 | 126 | $atts['entry'] = apply_filters( 'frm_prepare_entry_content', $atts['entry'], array( 'field' => $atts['field'] ) ); |
| 127 | 127 | self::fill_values_from_entry( $atts, $values ); |
| 128 | 128 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | 'type' => $f->type, |
| 151 | 151 | ); |
| 152 | 152 | |
| 153 | - $values[ $f->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f ); |
|
| 153 | + $values[$f->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f ); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | $f = $atts['field']; |
| 163 | 163 | if ( $atts['entry'] ) { |
| 164 | - $prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] ); |
|
| 164 | + $prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] ); |
|
| 165 | 165 | $meta = array( |
| 166 | 166 | 'item_id' => $atts['id'], |
| 167 | 167 | 'field_id' => $f->id, |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | /** |
| 14 | 14 | * Get the singleton instance of this class |
| 15 | 15 | * |
| 16 | - * @return object |
|
| 16 | + * @return FrmPointers |
|
| 17 | 17 | */ |
| 18 | 18 | public static function get_instance() { |
| 19 | 19 | _deprecated_function( __FUNCTION__, '3.01.03' ); |
@@ -306,7 +306,8 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | if ( isset( $version_info->new_version ) && ! empty( $version_info->new_version ) ) { |
| 308 | 308 | $this->clear_old_plugin_version( $version_info ); |
| 309 | - if ( $version_info === false ) { // was cleared with timeout |
|
| 309 | + if ( $version_info === false ) { |
|
| 310 | +// was cleared with timeout |
|
| 310 | 311 | $transient = false; |
| 311 | 312 | } else { |
| 312 | 313 | $this->maybe_use_beta_url( $version_info ); |
@@ -393,7 +394,8 @@ discard block |
||
| 393 | 394 | } |
| 394 | 395 | |
| 395 | 396 | private function is_license_revoked() { |
| 396 | - if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // WPCS: CSRF ok. |
|
| 397 | + if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { |
|
| 398 | +// WPCS: CSRF ok. |
|
| 397 | 399 | return; |
| 398 | 400 | } |
| 399 | 401 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function insert_installed_addon( $plugins ) { |
| 44 | - $plugins[ $this->plugin_slug ] = $this; |
|
| 44 | + $plugins[$this->plugin_slug] = $this; |
|
| 45 | 45 | |
| 46 | 46 | return $plugins; |
| 47 | 47 | } |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | public static function get_addon( $plugin_slug ) { |
| 50 | 50 | $plugins = apply_filters( 'frm_installed_addons', array() ); |
| 51 | 51 | $plugin = false; |
| 52 | - if ( isset( $plugins[ $plugin_slug ] ) ) { |
|
| 53 | - $plugin = $plugins[ $plugin_slug ]; |
|
| 52 | + if ( isset( $plugins[$plugin_slug] ) ) { |
|
| 53 | + $plugin = $plugins[$plugin_slug]; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $plugin; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } else { |
| 110 | 110 | $api = new FrmFormApi( $this->license ); |
| 111 | 111 | $plugins = $api->get_api_info(); |
| 112 | - $_data = $plugins[ $item_id ]; |
|
| 112 | + $_data = $plugins[$item_id]; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | $_data['sections'] = array( |
@@ -301,19 +301,19 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | if ( $this->is_current_version( $transient ) ) { |
| 303 | 303 | //make sure it doesn't show there is an update if plugin is up-to-date |
| 304 | - if ( isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 305 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 304 | + if ( isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 305 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 306 | 306 | } |
| 307 | - } elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 308 | - $this->prepare_update_details( $transient->response[ $this->plugin_folder ] ); |
|
| 307 | + } elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 308 | + $this->prepare_update_details( $transient->response[$this->plugin_folder] ); |
|
| 309 | 309 | |
| 310 | 310 | // if the transient has expired, clear the update and trigger it again |
| 311 | - if ( $transient->response[ $this->plugin_folder ] === false ) { |
|
| 311 | + if ( $transient->response[$this->plugin_folder] === false ) { |
|
| 312 | 312 | if ( ! $this->has_been_cleared() ) { |
| 313 | 313 | $this->cleared_plugins(); |
| 314 | 314 | $this->manually_queue_update(); |
| 315 | 315 | } |
| 316 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 316 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | private function is_current_version( $transient ) { |
| 404 | - if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) { |
|
| 404 | + if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) { |
|
| 405 | 405 | return false; |
| 406 | 406 | } |
| 407 | 407 | |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | return true; |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version; |
|
| 413 | + return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version; |
|
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | private function has_been_cleared() { |
@@ -491,8 +491,8 @@ discard block |
||
| 491 | 491 | $response['message'] = $response['status']; |
| 492 | 492 | } else { |
| 493 | 493 | $messages = $this->get_messages(); |
| 494 | - if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) { |
|
| 495 | - $response['message'] = $messages[ $response['status'] ]; |
|
| 494 | + if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) { |
|
| 495 | + $response['message'] = $messages[$response['status']]; |
|
| 496 | 496 | } else { |
| 497 | 497 | $response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) ); |
| 498 | 498 | } |
@@ -234,6 +234,9 @@ discard block |
||
| 234 | 234 | $this->delete_cache(); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | + /** |
|
| 238 | + * @param string|false $is_active |
|
| 239 | + */ |
|
| 237 | 240 | public function set_active( $is_active ) { |
| 238 | 241 | update_option( $this->option_name . 'active', $is_active ); |
| 239 | 242 | $this->delete_cache(); |
@@ -352,6 +355,7 @@ discard block |
||
| 352 | 355 | * Get the API info for this plugin |
| 353 | 356 | * |
| 354 | 357 | * @since 3.04.03 |
| 358 | + * @param string $license |
|
| 355 | 359 | */ |
| 356 | 360 | protected function get_api_info( $license ) { |
| 357 | 361 | $api = new FrmFormApi( $license ); |
@@ -612,6 +616,9 @@ discard block |
||
| 612 | 616 | return $this_plugin; |
| 613 | 617 | } |
| 614 | 618 | |
| 619 | + /** |
|
| 620 | + * @param string $action |
|
| 621 | + */ |
|
| 615 | 622 | public function send_mothership_request( $action ) { |
| 616 | 623 | $api_params = array( |
| 617 | 624 | 'edd_action' => $action, |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | $cats = array_intersect( $this->skip_categories(), $addon['categories'] ); |
| 79 | 79 | if ( ! empty( $cats ) ) { |
| 80 | - unset( $addons[ $k ] ); |
|
| 80 | + unset( $addons[$k] ); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | return $addon; |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 123 | - $plugin = $addons[ $download_id ]; |
|
| 122 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 123 | + $plugin = $addons[$download_id]; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return $plugin; |
@@ -299,6 +299,9 @@ discard block |
||
| 299 | 299 | return $this->alter_builder_classes( $classes ); |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | + /** |
|
| 303 | + * @param string $classes |
|
| 304 | + */ |
|
| 302 | 305 | protected function alter_builder_classes( $classes ) { |
| 303 | 306 | return $classes; |
| 304 | 307 | } |
@@ -493,6 +496,11 @@ discard block |
||
| 493 | 496 | return $html; |
| 494 | 497 | } |
| 495 | 498 | |
| 499 | + /** |
|
| 500 | + * @param string $html |
|
| 501 | + * |
|
| 502 | + * @return string |
|
| 503 | + */ |
|
| 496 | 504 | protected function after_replace_html_shortcodes( $args, $html ) { |
| 497 | 505 | return $html; |
| 498 | 506 | } |
@@ -788,6 +796,7 @@ discard block |
||
| 788 | 796 | * Link input to field description for screen readers |
| 789 | 797 | * |
| 790 | 798 | * @since 3.0 |
| 799 | + * @param string $input_html |
|
| 791 | 800 | */ |
| 792 | 801 | protected function add_aria_description( $args, &$input_html ) { |
| 793 | 802 | $describedby = ''; |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | $field_val = ''; |
| 130 | 130 | if ( is_object( $this->field ) ) { |
| 131 | 131 | $field_val = $this->field->{$column}; |
| 132 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
| 133 | - $field_val = $this->field[ $column ]; |
|
| 132 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
| 133 | + $field_val = $this->field[$column]; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return $field_val; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if ( is_object( $this->field ) ) { |
| 145 | 145 | $this->field->{$column} = $value; |
| 146 | 146 | } elseif ( is_array( $this->field ) ) { |
| 147 | - $this->field[ $column ] = $value; |
|
| 147 | + $this->field[$column] = $value; |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | printf( |
| 413 | 413 | /* translators: %s: Field type */ |
| 414 | 414 | esc_html__( '%s Options', 'formidable' ), |
| 415 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
| 415 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
| 416 | 416 | ); |
| 417 | 417 | ?> |
| 418 | 418 | <i class="frm_icon_font frm_arrowdown6_icon"></i> |
@@ -519,8 +519,8 @@ discard block |
||
| 519 | 519 | $fields = FrmField::field_selection(); |
| 520 | 520 | $fields = array_merge( $fields, FrmField::pro_field_selection() ); |
| 521 | 521 | |
| 522 | - if ( isset( $fields[ $this->type ] ) ) { |
|
| 523 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
| 522 | + if ( isset( $fields[$this->type] ) ) { |
|
| 523 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | return $name; |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | public function get_default_field_options() { |
| 534 | - $opts = array( |
|
| 534 | + $opts = array( |
|
| 535 | 535 | 'size' => '', |
| 536 | 536 | 'max' => '', |
| 537 | 537 | 'label' => '', |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | } |
| 856 | 856 | } else { |
| 857 | 857 | $args['save_array'] = $this->is_readonly_array(); |
| 858 | - $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
| 858 | + $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | return $hidden; |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | protected function show_single_hidden( $selected, $args ) { |
| 865 | 865 | if ( $args['save_array'] ) { |
| 866 | 866 | $args['field_name'] .= '[]'; |
| 867 | - $id = ''; |
|
| 867 | + $id = ''; |
|
| 868 | 868 | } else { |
| 869 | 869 | $id = ' id="' . esc_attr( $args['html_id'] ) . '"'; |
| 870 | 870 | } |
@@ -880,8 +880,8 @@ discard block |
||
| 880 | 880 | $selected = $values['field_value']; |
| 881 | 881 | |
| 882 | 882 | if ( isset( $values['combo_name'] ) ) { |
| 883 | - $options = $options[ $values['combo_name'] ]; |
|
| 884 | - $selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : ''; |
|
| 883 | + $options = $options[$values['combo_name']]; |
|
| 884 | + $selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : ''; |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | $input = $this->select_tag( $values ); |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | protected function fill_display_field_values( $args = array() ) { |
| 935 | - $defaults = array( |
|
| 935 | + $defaults = array( |
|
| 936 | 936 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
| 937 | 937 | 'field_id' => $this->get_field_column( 'id' ), |
| 938 | 938 | 'field_plus_id' => '', |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | $describedby = 'frm_desc_' . $args['html_id']; |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) ) { |
|
| 973 | + if ( isset( $args['errors']['field' . $args['field_id']] ) ) { |
|
| 974 | 974 | $describedby .= ' frm_error_' . $args['html_id']; |
| 975 | 975 | } |
| 976 | 976 | |
@@ -1033,8 +1033,8 @@ discard block |
||
| 1033 | 1033 | $value = $this->prepare_display_value( $value, $atts ); |
| 1034 | 1034 | |
| 1035 | 1035 | if ( is_array( $value ) ) { |
| 1036 | - if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) { |
|
| 1037 | - $value = $value[ $atts['show'] ]; |
|
| 1036 | + if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) { |
|
| 1037 | + $value = $value[$atts['show']]; |
|
| 1038 | 1038 | } elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) { |
| 1039 | 1039 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
| 1040 | 1040 | $value = implode( $sep, $value ); |
@@ -1103,8 +1103,8 @@ discard block |
||
| 1103 | 1103 | $saved_entries = $atts['ids']; |
| 1104 | 1104 | $new_value = array(); |
| 1105 | 1105 | foreach ( (array) $value as $old_child_id ) { |
| 1106 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
| 1107 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
| 1106 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
| 1107 | + $new_value[] = $saved_entries[$old_child_id]; |
|
| 1108 | 1108 | } |
| 1109 | 1109 | } |
| 1110 | 1110 | |
@@ -300,7 +300,6 @@ discard block |
||
| 300 | 300 | * Get the action link for an addon that isn't active. |
| 301 | 301 | * |
| 302 | 302 | * @since 3.06.03 |
| 303 | - * @param string $addon The plugin slug |
|
| 304 | 303 | * @return array |
| 305 | 304 | */ |
| 306 | 305 | public static function install_link( $plugin ) { |
@@ -403,6 +402,7 @@ discard block |
||
| 403 | 402 | |
| 404 | 403 | /** |
| 405 | 404 | * @since 3.04.02 |
| 405 | + * @param string $link |
|
| 406 | 406 | */ |
| 407 | 407 | private static function prepare_addon_link( &$link ) { |
| 408 | 408 | $site_url = 'https://formidableforms.com/'; |
@@ -736,6 +736,7 @@ discard block |
||
| 736 | 736 | * so let's install the plugin. |
| 737 | 737 | * |
| 738 | 738 | * @since 3.04.02 |
| 739 | + * @return string |
|
| 739 | 740 | */ |
| 740 | 741 | private static function install_addon() { |
| 741 | 742 | require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } else { |
| 64 | 64 | foreach ( $addons as $k => $addon ) { |
| 65 | 65 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 66 | - unset( $addons[ $k ] ); |
|
| 66 | + unset( $addons[$k] ); |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -222,16 +222,16 @@ discard block |
||
| 222 | 222 | continue; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
| 225 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
| 226 | 226 | $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; |
| 227 | 227 | |
| 228 | 228 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 229 | 229 | $slug = explode( '/', $folder ); |
| 230 | 230 | $plugin->slug = $slug[0]; |
| 231 | - $transient->response[ $folder ] = $plugin; |
|
| 231 | + $transient->response[$folder] = $plugin; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $transient->checked[ $folder ] = $wp_version; |
|
| 234 | + $transient->checked[$folder] = $wp_version; |
|
| 235 | 235 | |
| 236 | 236 | } |
| 237 | 237 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | $all_plugins = get_plugins(); |
| 256 | 256 | |
| 257 | - return isset( $all_plugins[ $plugin ] ); |
|
| 257 | + return isset( $all_plugins[$plugin] ); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
@@ -293,13 +293,13 @@ discard block |
||
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; |
| 296 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 296 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 297 | 297 | // if this addon is using its own license, get the update url |
| 298 | 298 | $addon_info = $api->get_api_info(); |
| 299 | 299 | |
| 300 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 300 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 301 | 301 | if ( isset( $addon_info['error'] ) ) { |
| 302 | - $version_info[ $download_id ]['error'] = array( |
|
| 302 | + $version_info[$download_id]['error'] = array( |
|
| 303 | 303 | 'message' => $addon_info['error']['message'], |
| 304 | 304 | 'code' => $addon_info['error']['code'], |
| 305 | 305 | ); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * @return array |
| 319 | 319 | */ |
| 320 | 320 | public static function install_link( $plugin ) { |
| 321 | - $link = array(); |
|
| 321 | + $link = array(); |
|
| 322 | 322 | $addons = self::get_api_addons(); |
| 323 | 323 | self::prepare_addons( $addons ); |
| 324 | 324 | |
@@ -365,8 +365,8 @@ discard block |
||
| 365 | 365 | return $addon; |
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 369 | - $plugin = $addons[ $download_id ]; |
|
| 368 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 369 | + $plugin = $addons[$download_id]; |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | return $plugin; |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | self::prepare_addon_link( $addon['link'] ); |
| 418 | 418 | |
| 419 | 419 | self::set_addon_status( $addon ); |
| 420 | - $addons[ $id ] = $addon; |
|
| 420 | + $addons[$id] = $addon; |
|
| 421 | 421 | } |
| 422 | 422 | } |
| 423 | 423 | |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | 'utm_medium' => 'addons', |
| 436 | 436 | 'utm_campaign' => 'liteplugin', |
| 437 | 437 | ); |
| 438 | - $link = add_query_arg( $query_args, $link ); |
|
| 438 | + $link = add_query_arg( $query_args, $link ); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | /** |