PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.1.3
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.1.3
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Source/Query.php +10 -3 3.1.23.1.3 View file →
@@ -56,12 +56,14 @@
56 56 /**
57 57 * Fetches information from source, parses it and builds series and data arrays.
58 58 *
59 59 * @param bool $as_html Should the result be fetched as an HTML table or as an object.
60 + * @param bool $results_as_numeric_array Should the result be fetched as ARRAY_N instead of ARRAY_A.
61 + * @param bool $raw_results Should the result be returned without processing.
60 62 * @access public
61 63 * @return boolean TRUE on success, otherwise FALSE.
62 64 */
63 - public function fetch( $as_html = false ) {
65 + public function fetch( $as_html = false, $results_as_numeric_array = false, $raw_results = false ) {
64 66 if ( empty( $this->_query ) ) {
65 67 return false;
66 68 }
67 69
@@ -66,17 +68,22 @@
66 68 }
67 69
68 70 // impose a limit if no limit clause is provided.
69 71 if ( strpos( strtolower( $this->_query ), ' limit ' ) === false ) {
70 - $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 300 );
72 + $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 1000 );
71 73 }
72 74
73 75 global $wpdb;
74 76 $wpdb->hide_errors();
75 77 // @codingStandardsIgnoreStart
76 - $rows = $wpdb->get_results( $this->_query, ARRAY_A );
78 + $rows = $wpdb->get_results( $this->_query, $results_as_numeric_array ? ARRAY_N : ARRAY_A );
79 + do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Firing query %s to get results %s with error %s', $this->_query, print_r( $rows, true ), print_r( $wpdb->last_error, true ) ), 'debug', __FILE__, __LINE__ );
77 80 // @codingStandardsIgnoreEnd
78 81 $wpdb->show_errors();
82 +
83 + if ( $raw_results ) {
84 + return $rows;
85 + }
79 86
80 87 if ( $rows ) {
81 88 $results = array();
82 89 $headers = array();