• Resolved jibranb

    (@jibran-bisharat)


    Hi,

    I’m running into some weird issues with Awesome Support on my local dev machine. I am using MAMP Pro.

    • When trying to create a new ticket I either get an Internal Server Error or I get the new ticket page with no content (i.e. WordPress admin top bar and left nav display but no page title or form is displayed.)
    • When viewing Tickets > Settings I get Internal Server Error consistently.

    In the WP debug log file I am seeing what may be pertinent errors. See below.

    • Any idea what could be causing this?
    • Are there any known issues or configuration requirements for MAMP Pro?

    I have increased my memory limit to 512MB and I still see these issues. Any help greatly appreciated! Rad plugin.

    • [04-Apr-2016 20:27:56 UTC] WordPress database error Server shutdown in progress for query SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (48062) ORDER BY umeta_id ASC made by require_once(‘wp-admin/admin.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘after_setup_theme’), call_user_func_array, WPAS_Titan->load_titan_framework, apply_filters(‘wpas_plugin_settings’), call_user_func_array, wpas_core_settings_general, wpas_list_users, wpas_get_users, get_users, WP_User_Query->__construct, WP_User_Query->query, WP_User->__construct, WP_User->init, WP_User->for_blog, WP_User->_init_caps, get_user_meta, get_metadata, update_meta_cache
    • [04-Apr-2016 20:28:00 UTC] PHP Warning: mysql_connect(): No such file or directory in /Users/[…]/wp-includes/wp-db.php on line 1518
    • [04-Apr-2016 20:31:34 UTC] PHP Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 64 bytes) in /Users/[…]/wp-includes/meta.php on line 838
    • [04-Apr-2016 20:33:14 UTC] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /Users/[…]/wp-includes/wp-db.php on line 1781

    https://www.ads-software.com/plugins/awesome-support/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author julien731

    (@julien731)

    Hi jibranb,

    Strange issue. Unfortunately I can’t see a valid reason for such an issue in the log. I guess you’re using the latest version of Awesome Support (3.2.9)?

    Have you tried deactivating your other plugin to rule out a plugin conflict?

    Thread Starter jibranb

    (@jibran-bisharat)

    Hi Julien,

    I did as you suggested, but there was no difference. It seems the issue has to do with the number of users in the database (~45K).

    When I comment out lines 72 and 96 in includes/admin/metaboxes/stakeholders.php, I am able to view and submit the new ticket form.

    • 72 wpas_support_users_dropdown( $users_atts );
    • 96 echo wpas_users_dropdown( $staff_atts );

    Also, when I replace the wpas_list_users() call with an empty array() in /includes/admin/settings-general.php line 31 for Default Assignee, all settings pages display. Of course the Default Assignee is empty, but that’s expected for this test!

    • 31 'options' => /* isset( $_GET['post_type'] ) && 'ticket' === $_GET['post_type'] && isset( $_GET['page'] ) && 'wpas-settings' === $_GET['page'] ? wpas_list_users( 'edit_ticket' ) : */ array(),

    It seems that for each call, all users are queries and looped through to determine which users to display in a particular drop down. But because of the large users base it runs into memory issues.

    Do you have any ideas how to deal with this?

    Also note that I’ve edited the capabilities of the WooCommerce role ‘Customer’ to include that of the ‘Support User’. All of my users are assigned the ‘Customer’ role.

    Thanks for your response and willingness to help!

    -Jibran

    Plugin Author julien731

    (@julien731)

    Hi Jibran,

    Your analysis and conclusion are correct. There is indeed a problem with the current version for sites with a lot of users (~6k+).

    The problem is that even though Awesome Support comes with custom roles, lots of AS users give their clients different, pre-existing roles. Typically someone with an e-commerce shop using the customer role and adding Awesome Support capabilities to it.

    That’s what makes our plugin easily compatible with tons of other plugins, but that’s also what causes this issue.

    Because we can’t get users by role (again, support users can have many different roles on different setups) we need to query users by capability. Unfortunately WordPress doesn’t support querying by capability (the system isn’t designed for this).

    This leaves us with one solution: querying all users and then filtering them manually based on their capabilities.

    This is actually working well on the majority of sites containing a few hundreds to a a few thousands of users. But as soon as the number of users reaches 5/6k+ users things start to slow down, and timeouts happen on sites with many thousands of users.

    What causes the issue is a caching layer that’s built in the WP_User_Query class.

    It’s taken us some time but we’re finally in the process of fixing that. Various solutions were considered, and we decided to go about it from 2 angles:

    1. Introduction of a user query class similar to WP_User_Query but way simpler and using custom SQL queries
    2. The use of Ajax to display users lists

    The development is in progress (almost finished actually) and the results are incredibly positive. There is an issue on GitHub where you can follow what’s happening: https://github.com/Awesome-Support/Awesome-Support/issues/285.

    This will be released with version 3.3 that we are planning to release soon: https://github.com/Awesome-Support/Awesome-Support/milestones/3.3

    Thread Starter jibranb

    (@jibran-bisharat)

    Right on, Julien. I’m convinced Awesome Support is the way to go. I won’t be launching my support funnel for 4-6 weeks. Do you expect to release within the next few weeks? No pressure, just ballpark.

    Thanks for confirming my findings.

    Plugin Author julien731

    (@julien731)

    We expect to release it in the upcoming weeks.

    Great, I believe I will need the same thing! Over 246,000 customers ??

    Plugin Author julien731

    (@julien731)

    Wow! That’s a lot!

    I’m happy to say that we have addressed the performance issue and version 3.3 should behave much better with sites having lots of users.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘new ticket shows blank screen on local dev’ is closed to new replies.