Просмотр новости

Найдите то, что Вас интересует

Fatal error: get_posts() called during plugin bootstrap in TC_Shortcode_Builder

Дата публикации: 23-06-2026 08:35:32



Plugin: Tickera Event Ticketing System v3.5.7.3Affected file: includes/classes/class.shortcode_builder.phpWordPress version: 7.0.0PHP version: 8.2Other relevant plugins: Anonymous Restricted Content 1.6.6
DescriptionWe are experiencing a PHP fatal error on every front-end and back-end request and during wp-cron.php execution:
PHP Fatal error: Uncaught Error: Call to undefined function is_user_logged_in()in …/anonymous-restricted-content/public/class-arc-public.php:341Stack trace#0 ARC_Public->hide_restricted_in_main_query(Object(WP_Query))#1 WP_Hook->apply_filters() #2 do_action_ref_array('pre_get_posts', …) #3 WP_Query->get_posts() #4 get_posts() #5 Tickera\TC_Events_Search->get_results() (.../class.events_search.php:71)#6 Tickera\TC_Shortcode_Builder->__construct() (.../class.shortcode_builder.php:19)#7 require_once(…/class.shortcode_builder.php) (.../tickera.php:118)#8 Tickera\TC->__construct() (.../tickera.php:5272)#9 include_once(…/tickera.php) during wp-settings.php plugin loading
Root causeTC_Shortcode_Builder is instantiated at the bottom of class.shortcode_builder.php (line 530) as soon as the file is require_once’d during TC::__construct().
The constructor immediately calls TC_Events_Search::get_results(), which runs get_posts(). That fires the pre_get_posts action while WordPress is still loading plugins — before pluggable.php is loaded (see wp-settings.php: plugins are included first, then pluggable.php, then plugins_loaded).
Any plugin hooking into pre_get_posts and calling is_user_logged_in() (or other pluggable functions) will trigger a fatal error. In our case, the conflict is with Anonymous Restricted Content, but the underlying issue is that Tickera performs a database query with full hook execution during plugin bootstrap, which is outside the normal WordPress load order.
Expected behaviourTC_Shortcode_Builder (and its get_posts() call) should be deferred until after WordPress core is fully bootstrapped — at minimum after pluggable.php has been loaded (e.g. on the plugins_loaded or init hook).
Our local workaroundWe have applied the following patch in includes/classes/class.shortcode_builder.php:
Before (problematic):
new TC_Shortcode_Builder();
After (our fix):
add_action( 'plugins_loaded', static function () { new TC_Shortcode_Builder();} );
This resolves the fatal error on our site. However, this change will be overwritten on the next plugin update, so we would appreciate an official fix in a future release.
RequestPlease confirm this as a bug and include a proper fix in an upcoming Tickera update. Ideally, move the instantiation of TC_Shortcode_Builder (and the get_posts() call in its constructor) to a later hook such as plugins_loaded or init, so that no WP_Query / pre_get_posts execution occurs during plugin file loading.
Thank you.

Классификация: Культура

Схожие новости

#Наименование новостиТональностьИнформативность
1Reply To: Error at processing any feed00
2Validated Pro Unlimited License but cannot update themes or bundled plugins00
3Archive page + CS form with error using a loading area element00
4Reply To: WordPress Toolkit Login00
5Reply To: “order” column error00
6Question about filtering default post categories with CS Forms00
7Reply To: New post issue since WP700
8Reply To: DHL Api change broke the plugin00
9Reply To: Clarification on AI Engine MCP capabilities with Claude Desktop00
10PTE Request for Giuliomax Menu Builder00

  • ТональностьТональность 0
  • ИнформативностьИнформативность 0
  • Источникwordpress.org