Forum Replies Created

Viewing 15 replies - 1 through 15 (of 38 total)
  • For posterity, I wanted to note that the issue with the sites I’ve observed is that they, for some reason, are missing their {database-prefix}_actionscheduler_logs tables.

    Then the StellarWP DB & Shepherd functionality included In TEC encounters a fatal because it doesn’t know how to handle that condition.

    Relevant errors.

    WordPress database error Table 'wp_actionscheduler_logs' doesn't exist for query SHOW FULL COLUMNS FROM wp_actionscheduler_logs /* {site-domain}.tld/wp-admin/admin-ajax.php?action=as_async_request_queue_runner&nonce=xxxxxx request_id: {request_id} */ made by require_once('wp-load.php'), require_once('/srv/htdocs/wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, TEC\Common\StellarWP\Shepherd\Regulator->schedule_cleanup_task, TEC\Common\StellarWP\Shepherd\Regulator->dispatch, TEC\Common\StellarWP\Shepherd\Regulator->dispatch_callback, TEC\Common\StellarWP\Shepherd\Action_Scheduler_Methods::schedule_single_action, as_schedule_single_action, ActionScheduler_ActionFactory->create, ActionScheduler_ActionFactory->store, ActionScheduler_HybridStore->save_action, ActionScheduler_DBStoreMigrator->save_action, ActionScheduler_DBStore->save_action, ActionScheduler_DBStore->save_action_to_db, do_action('action_scheduler_stored_action'), WP_Hook->do_action, WP_Hook->apply_filters, ActionScheduler_Logger->log_stored_action, ActionScheduler_DBLogger->log
    PHP Fatal error:  Uncaught TEC\Common\StellarWP\DB\Database\Exceptions\DatabaseQueryException: Database Query in /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/db/src/DB/DB.php:291
    Stack trace:
    #0 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/db/src/DB/DB.php(114): TEC\Common\StellarWP\DB\DB::runQueryWithErrorChecking(Object(Closure))
    #1 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Traits/Custom_Table_Query_Methods.php(109): TEC\Common\StellarWP\DB\DB::__callStatic('query', Array)
    #2 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Traits/Custom_Table_Query_Methods.php(67): TEC\Common\StellarWP\Shepherd\Abstracts\Table_Abstract::insert_many(Array)
    #3 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Traits/Custom_Table_Query_Methods.php(95): TEC\Common\StellarWP\Shepherd\Abstracts\Table_Abstract::insert(Array)
    #4 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Log.php(335): TEC\Common\StellarWP\Shepherd\Abstracts\Table_Abstract::upsert(Array)
    #5 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Loggers/ActionScheduler_DB_Logger.php(71): TEC\Common\StellarWP\Shepherd\Log->save()
    #6 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Traits/Loggable.php(64): TEC\Common\StellarWP\Shepherd\Loggers\ActionScheduler_DB_Logger->log('info', 'Task 8177 creat...', Array)
    #7 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Traits/Loggable.php(80): TEC\Common\StellarWP\Shepherd\Regulator->log('info', 'created', 8177, 'Task 8177 creat...', Array)
    #8 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Regulator.php(200): TEC\Common\StellarWP\Shepherd\Regulator->log_created(8177, Array)
    #9 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Regulator.php(145): TEC\Common\StellarWP\Shepherd\Regulator->dispatch_callback(Object(TEC\Common\StellarWP\Shepherd\Tasks\Herding), 21600)
    #10 /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/shepherd/src/Regulator.php(395): TEC\Common\StellarWP\Shepherd\Regulator->dispatch(Object(TEC\Common\StellarWP\Shepherd\Tasks\Herding), 21600)
    #11 /wordpress/core/6.8.2/wp-includes/class-wp-hook.php(322): TEC\Common\StellarWP\Shepherd\Regulator->schedule_cleanup_task()
    #12 /wordpress/core/6.8.2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #13 /wordpress/core/6.8.2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #14 /wordpress/core/6.8.2/wp-settings.php(727): do_action('init')
    #15 /srv/htdocs/wp-config.php(85): require_once('/wordpress/core...')
    #16 /wordpress/core/6.8.2/wp-load.php(55): require_once('/srv/htdocs/wp-...')
    #17 /wordpress/core/6.8.2/wp-admin/admin-ajax.php(22): require_once('/wordpress/core...')
    #18 {main}
    thrown in /srv/htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/stellarwp/db/src/DB/DB.php on line 291

    To resolve, you can create the actionscheduler_logs table manually or install the action-scheduler plugin and visit /wp-admin/tools.php?page=action-schedule or run wp action-scheduler fix-schema via WP-CLI.

    Thread Starter Joshua Goode

    (@verygoode)

    Sound good and thank you @senols.

    Sounds good @specialk and thanks for the chat!

    The pro version is completely rewritten btw, and uses WP Ajax instead of including wp-config as in the free version. Thanks again.

    That’s great to hear!

    So am I to understand that there are people working for WordPress.com that are giving incorrect advice? This is very confusing and frustrating.

    I’m not sure if it was incorrect but it didn’t mention best practices. Including wp-load.php is generally not good practice and something we should have highlighted.

    Thom offered an alternative to get things working in many environments similar to WordPress.com’s without removing the require for wp-load.php. But, ideally, wp-load.php wouldn’t be included.

    http://ottopress.com/2010/dont-include-wp-load-please/ covers this a bit better than I can.

    Thom was also correct in his notes regarding wp-config.php, which is the primary cause of the 500s. Generally, wp-config.php should not be included in this way.

    Applying Thom’s notes, removing the requirement for wp-config.php and altering the wp-load.php path to use what he shared would get SAC working on hosts similar to WordPress.com.

    WordPress.com is not the only host that has a setup that SAC would conflict with. Some have entirely different setups that would lead to the same issue.

    • This reply was modified 3 years, 9 months ago by Joshua Goode.

    Thom was correct in his warning about not loading wp-config.php in this way — which the plugin still does and is contributing here.

    As for wp-load.php, that shouldn’t be included. The path recommended might be better but wp-load.php shouldn’t be used this way and can result in issues.

    Howdy, @specialk

    In this case, the issue is with how the plugin is attempting to load wp-config.php and wp-load.php

    Specifically, within /wp-content/plugins/simple-ajax-chat/resources/sac.php

    
    require(dirname(dirname(dirname(dirname(dirname(__FILE__))))) .'/wp-config.php');
    require(ABSPATH .'/wp-load.php');
    

    There’s an incorrect assumption that wp-settings will be within the same directory as wp-config and the plugin is incorrectly bypassing the normal WP load.

    As not all hosting environments are the same, and some symlink and store root files elsewhere, this can result in the following error.

    
    PHP Fatal error:  Uncaught Error: Failed opening required '/srv/htdocs/wp-settings.php' (include_path='/:.') in /srv/htdocs/wp-config.php:83
    Stack trace:
    #0 /srv/htdocs/wp-content/plugins/simple-ajax-chat/resources/sac.php(10): require()
    #1 {main}
      thrown in /srv/htdocs/wp-config.php on line 83

    Ideally, the plugin would not be requiring wp-config and wp-load in this way

    * https://codex.ww.wp.xz.cn/AJAX_in_Plugins
    * http://ottopress.com/2010/dont-include-wp-load-please/
    * https://wordpress.stackexchange.com/questions/159347/best-way-to-include-wp-config-php

    If you would like to get a test site in an environment where this code won’t work, feel free to reach to me via https://wordpress.com/support/developers/

    • This reply was modified 3 years, 9 months ago by Joshua Goode.
    • This reply was modified 3 years, 9 months ago by Joshua Goode.
    • This reply was modified 3 years, 9 months ago by Joshua Goode.
    Thread Starter Joshua Goode

    (@verygoode)

    That’s great news! Thank you.

    @sultan912 I see you’re using WPML.

    There is a conflict between WPML and WP 6.0. It can cause Variable products to be switched to Simple and prevent products from displaying properly on certain category and product pages.

    This might be the cause of your issue.

    There’s more on this at https://wpml.org/errata/wp-6-0-issues-with-terms-assigned-to-posts including a manual fix. WPML appears to be working on a new release to fix it.

    If you apply the manual fix, it may be necessary to flush your site’s cache and rewrite rules to see the change immediately. A quick way to flush rewrite rules is to save your permalink settings.`

    @alberto76 If you’re still having this issue, do you happen to be using WPML?

    If so, there is a conflict between WPML and WP 6.0. It can cause Variable products to be switched to Simple and prevent products from displaying properly on certain category and product pages.

    There’s more on this at https://wpml.org/errata/wp-6-0-issues-with-terms-assigned-to-posts including a manual fix. WPML appears to be working on a new release to fix it.

    If you apply the manual fix, it may be necessary to flush your site’s cache and rewrite rules to see the change immediately. A quick way to flush rewrite rules is to save your permalink settings.

    Thread Starter Joshua Goode

    (@verygoode)

    Please note that support is at official forum:

    I’ve moved my original post, with some additional context, over to the official forums

    https://www.patreondevelopers.com/t/performance-concerns-related-to-usage-of-attachment-url-to-postid-image-locking-feature/5328

    Thread Starter Joshua Goode

    (@verygoode)

    If there is a more appropriate place to report bugs or feature requests for the plugin, I’m happy to move my notes there.

    Thread Starter Joshua Goode

    (@verygoode)

    Hi!

    I’m not exactly looking for support but would like to suggest that you consider reviewing your plugin’s behavior and see if it can be optimized.

    I do not personally use your plugin but I work on hosting and supporting some sites that do. This feature can have a severe impact on a site’s performance.

    Thread Starter Joshua Goode

    (@verygoode)

    Running 2.20.1 but getting “Missing Dependencies” reported by Query Manager on every page. It’s looking for:

    I also noticed the Query Monitor missing dependency errors that @ultravariety reports.

    Seems https://github.com/godaddy-wordpress/coblocks/pull/2162 changed how the scripts are enqueued and now there might be attempts to load editor assets in the frontend. This doesn’t occur in 2.19.1.

    The frontend shouldn’t load the editor assets so it’s not being loaded or they’re enqueued after Query Monitor does its Scripts check.

    This doesn’t result in 404s and doesn’t appear to be as problematic as the original issue but still probably shouldn’t happen. @olivierlafleur @jonathanbardo

    • This reply was modified 4 years, 4 months ago by Joshua Goode.
    Thread Starter Joshua Goode

    (@verygoode)

    Looking further, it appears that wp-travel had been deactivated in some situations. This is what led to the fatal.

    That’s somewhat expected but perhaps that can be handled better so that the site doesn’t crash when wp-travel isn’t present.

Viewing 15 replies - 1 through 15 (of 38 total)