| @@ -231,9 +231,9 @@ | ||
| 231 | 231 | * @param string $type |
| 232 | 232 | * |
| 233 | 233 | * @return string |
| 234 | 234 | */ |
| 235 | - public static function generate_cache_key( $where, $args, $field, $type ) { | |
| 235 | + private static function generate_cache_key( $where, $args, $field, $type ) { | |
| 236 | 236 | $cache_key = ''; |
| 237 | 237 | $where = FrmAppHelper::array_flatten( $where ); |
| 238 | 238 | foreach ( $where as $key => $value ) { |
| 239 | 239 | $cache_key .= $key . '_' . $value; |
| @@ -437,9 +437,9 @@ | ||
| 437 | 437 | |
| 438 | 438 | if ( is_array( $where ) || empty( $where ) ) { |
| 439 | 439 | self::get_where_clause_and_values( $where ); |
| 440 | 440 | global $wpdb; |
| 441 | - $query = $wpdb->prepare( $query . $where['where'] . ' ' . implode( ' ', $args ), $where['values'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 441 | + $query = $wpdb->prepare( $query . $where['where'] . ' ' . implode( ' ', $args ), $where['values'] ); // WPCS: unprepared SQL ok. | |
| 442 | 442 | } else { |
| 443 | 443 | /** |
| 444 | 444 | * Allow the $where to be prepared before we recieve it here. |
| 445 | 445 | * This is a fallback for reverse compatibility, but is not recommended |
| @@ -570,28 +570,20 @@ | ||
| 570 | 570 | * @since 2.05.06 |
| 571 | 571 | */ |
| 572 | 572 | public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) { |
| 573 | 573 | if ( empty( $where ) ) { |
| 574 | - $where = ''; | |
| 574 | + return ''; | |
| 575 | + } | |
| 576 | + | |
| 577 | + if ( is_array( $where ) ) { | |
| 578 | + global $wpdb; | |
| 579 | + self::get_where_clause_and_values( $where, $starts_with ); | |
| 580 | + $where = $wpdb->prepare( $where['where'], $where['values'] ); // WPCS: unprepared SQL ok. | |
| 575 | 581 | } else { |
| 576 | - if ( is_array( $where ) ) { | |
| 577 | - global $wpdb; | |
| 578 | - self::get_where_clause_and_values( $where, $starts_with ); | |
| 579 | - $where = $wpdb->prepare( $where['where'], $where['values'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 580 | - } else { | |
| 581 | - $where = $starts_with . $where; | |
| 582 | - } | |
| 582 | + $where = $starts_with . $where; | |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | - /** | |
| 586 | - * Allows modifying where clause when using FrmDb::prepend_and_or_where() method. | |
| 587 | - * | |
| 588 | - * @since 5.0.16 | |
| 589 | - * | |
| 590 | - * @param string $where Where string. | |
| 591 | - * @param string $starts_with The start of where string. | |
| 592 | - */ | |
| 593 | - return apply_filters( 'frm_prepend_and_or_where', $where, $starts_with ); | |
| 585 | + return $where; | |
| 594 | 586 | } |
| 595 | 587 | |
| 596 | 588 | /** |
| 597 | 589 | * Prepare and save settings in styles and actions |
| @@ -622,11 +614,8 @@ | ||
| 622 | 614 | * |
| 623 | 615 | * Used when saving form actions and styles |
| 624 | 616 | * |
| 625 | 617 | * @since 2.05.06 |
| 626 | - * | |
| 627 | - * @param array $settings | |
| 628 | - * @return int|WP_Error | |
| 629 | 618 | */ |
| 630 | 619 | public static function save_json_post( $settings ) { |
| 631 | 620 | global $wp_filter; |
| 632 | 621 | if ( isset( $wp_filter['content_save_pre'] ) ) { |
| @@ -667,9 +656,9 @@ | ||
| 667 | 656 | if ( 'get_posts' == $type ) { |
| 668 | 657 | $results = get_posts( $query ); |
| 669 | 658 | } elseif ( 'get_associative_results' == $type ) { |
| 670 | 659 | global $wpdb; |
| 671 | - $results = $wpdb->get_results( $query, OBJECT_K ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 660 | + $results = $wpdb->get_results( $query, OBJECT_K ); // WPCS: unprepared SQL ok. | |
| 672 | 661 | } else { |
| 673 | 662 | global $wpdb; |
| 674 | 663 | $results = $wpdb->{$type}( $query ); |
| 675 | 664 | } |
| @@ -739,6 +728,30 @@ | ||
| 739 | 728 | } |
| 740 | 729 | |
| 741 | 730 | wp_cache_delete( 'cached_keys', $group ); |
| 742 | 731 | } |
| 732 | + } | |
| 733 | + | |
| 734 | + /** | |
| 735 | + * @deprecated 2.05.06 | |
| 736 | + * @codeCoverageIgnore | |
| 737 | + */ | |
| 738 | + public function upgrade() { | |
| 739 | + FrmDeprecated::upgrade(); | |
| 740 | + } | |
| 741 | + | |
| 742 | + /** | |
| 743 | + * @deprecated 2.05.06 | |
| 744 | + * @codeCoverageIgnore | |
| 745 | + */ | |
| 746 | + public function collation() { | |
| 747 | + return FrmDeprecated::collation(); | |
| 748 | + } | |
| 749 | + | |
| 750 | + /** | |
| 751 | + * @deprecated 2.05.06 | |
| 752 | + * @codeCoverageIgnore | |
| 753 | + */ | |
| 754 | + public function uninstall() { | |
| 755 | + FrmDeprecated::uninstall(); | |
| 743 | 756 | } |
| 744 | 757 | } |