PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.1
Forumax – AI Powered Advanced Community Forum Plugin v2.5.1
2.5.1 2.5.0 2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 All 31 releases
← All changes | includes/Blocks/Render/forum-ajax.php +9 -3 2.4.3 → 2.5.1 View file →
@@ -155,9 +155,9 @@
155 155 }
156 156
157 157 // Enqueue styles/scripts.
158 158 if ( ! wp_style_is( 'elegant-icon', 'registered' ) ) {
159 - wp_register_style( 'elegant-icon', FORUMAX_VEND . '/elegant-icon/style.css' );
159 + wp_register_style( 'elegant-icon', FORUMAX_VEND . 'elegant-icon/style.css', [], FORUMAX_VERSION );
160 160 }
161 161 if ( ! wp_script_is( 'bbpc-ajax', 'registered' ) ) {
162 162 wp_register_script( 'bbpc-ajax', FORUMAX_FRONT_ASS . 'js/ajax.js', array( 'jquery' ), FORUMAX_VERSION, true );
163 163 }
@@ -249,13 +249,18 @@
249 249 $styles .= "{$id} .frmx-load-more-btn:hover { background: #2563eb !important; }";
250 250 }
251 251
252 252 // Query
253 + // "Load more" reveals pre-rendered topics, so it needs more than one
254 + // page, but never the whole site (which rendered every topic).
255 + $load_more_max = max( $ppp2, (int) apply_filters( 'forumax_forum_ajax_load_more_max', 100, $attributes ) );
256 +
253 257 $query_args = array(
254 258 'post_type' => 'topic',
255 - 'posts_per_page' => $load_more_enabled ? -1 : $ppp2,
259 + 'posts_per_page' => $load_more_enabled ? $load_more_max : $ppp2,
256 260 'order' => $order,
257 261 'orderby' => $orderby,
262 + 'no_found_rows' => true,
258 263 );
259 264
260 265 // Forum ID filter (include).
261 266 if ( ! empty( $forum_filter_ids ) ) {
@@ -538,8 +543,9 @@
538 543 </div>
539 544 <?php
540 545 return ob_get_clean();
541 546 } catch ( \Throwable $e ) {
542 - return '<div>Error rendering block: ' . esc_html( $e->getMessage() ) . '</div>';
547 + // Only editors see the reason; visitors shouldn't get internal errors.
548 + return current_user_can( 'edit_posts' ) ? '<div>Error rendering block: ' . esc_html( $e->getMessage() ) . '</div>' : '';
543 549 }
544 550 }
545 551 }