Title: João Faria's Replies | WordPress.org

---

# João Faria

  [  ](https://wordpress.org/support/users/jffaria/)

 *   [Profile](https://wordpress.org/support/users/jffaria/)
 *   [Topics Started](https://wordpress.org/support/users/jffaria/topics/)
 *   [Replies Created](https://wordpress.org/support/users/jffaria/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/jffaria/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/jffaria/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/jffaria/engagements/)
 *   [Favorites](https://wordpress.org/support/users/jffaria/favorites/)

 Search replies:

## Forum Replies Created

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

1 [2](https://wordpress.org/support/users/jffaria/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/jffaria/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Index WP Users For Speed] Background user index building in progress: 1% complete.](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/#post-16054716)
 * An update: not sure if the issue is gone, but last night the index was rebuilt
   to 100% complete and did not get stuck. I did the WP-CLI patch I mentioned above,
   and also removed the plugin cron kick by commenting out the include for instacron.
   php:
 *     ```
       /* Disabled-cron only. We use WP_Cron's wp_schedule_single_event to do the batched-up index, so
            * we need to activate it when it's disabled.  */
           if ( ! wp_doing_cron() ) {
             $cronDisabled = defined( 'DISABLE_WP_CRON' ) && true === DISABLE_WP_CRON;
             if ( $cronDisabled ) {
             #  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/instacron.php';
             }
           }
       ```
   
 * I will see if the index rebuilds tonight again, or if it gets stuck again, but
   I think the WP-CLI check might have been what did the trick, considering I invoke
   cron via WP-CLI as I mentioned before.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Index WP Users For Speed] Background user index building in progress: 1% complete.](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/#post-16053273)
 * Hi [@olliejones](https://wordpress.org/support/users/olliejones/)! Thanks for
   the reply. I sent you a PR on GitHub with the WP-CLI fix.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Index WP Users For Speed] Background user index building in progress: 1% complete.](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/#post-16051752)
 * Another followup: I was able to deactivate via admin. I see in the source code
   that the depopulate task class is only loaded in certain cases:
 *     ```
       /* stuff required for all back-end. cron, REST api operations. */
           if ( wp_doing_cron() || wp_doing_ajax() || is_admin() || wp_is_json_request() || wp_is_xml_request() ) { (... requiring files ...) }
       ```
   
 * I guess adding a `|| ( defined( 'WP_CLI' ) && WP_CLI )` to that if clause will
   solve the WP-CLI issue.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Index WP Users For Speed] Background user index building in progress: 1% complete.](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/#post-16051555)
 * A followup:
 * I tried to deactivate/activate, but the plugin failed to deactivate, and remained
   active. WP-CLI printed out this error:
 *     ```
       $ wp plugin deactivate index-wp-users-for-speed
       (... omitted a few deprecation notices from other plugins ...)
       Fatal error: Uncaught Error: Class 'IndexWpUsersForSpeed\DepopulateMetaIndexes' not found in /xxx/xxx/xxx/wp-content/plugins/index-wp-users-for-speed/includes/deactivator.php:56
       Stack trace:
       #0 /xxx/xxx/xxx/wp-content/plugins/index-wp-users-for-speed/includes/deactivator.php(38): IndexWpUsersForSpeed\Deactivator::depopulateIndexMetadata()
       #1 /xxx/xxx/xxx/wp-content/plugins/index-wp-users-for-speed/index-wp-users-for-speed.php(69): IndexWpUsersForSpeed\Deactivator::deactivate()
       #2 /xxx/xxx/xxx/wp-includes/class-wp-hook.php(307): deactivate_index_wp_users_for_speed()
       #3 /xxx/xxx/xxx/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
       #4 /xxx/xxx/xxx/wp-includes/plugin.php(476): WP_Hook->do_action()
       #5 /xxx/xxx/xxx/wp-admin/includes/plugin.php(814): do_action()
       #6 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(395): deactivate_plugins()
       #7 [internal function]: Plugin_Command->deactivate()
       #8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/W in /xxx/xxx/xxx/wp-content/plugins/index-wp-users-for-speed/includes/deactivator.php on line 56
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Index WP Users For Speed] Background user index building in progress: 1% complete.](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/background-user-index-building-in-progress-1-complete/#post-16051529)
 * Hello [@olliejones](https://wordpress.org/support/users/olliejones/) !
 * I have been using the plugin for a few of weeks or so, and the index rebuilding
   seems to be a bit erratic, running outside of the scheduled time and for the 
   past few days or so the message has been stuck in admin: “Background user index
   building in progress: 11% complete. You may use your site normally during index
   building.”
 * This is a production site with traffic both in frontend and dashboard, and I 
   have WP-Cron disabled, running a cronjob on the linux box every 10 minutes calling
   via CP-CLI (wp cron event run –due-now). I see in the logs that task index_wp_users_for_speed_task
   was run last by the WP-CLI cron runner on Friday, Sep 23rd 08:25AM. Before that
   I see those tasks being run through the day, taking anything from a fraction 
   of a second to even 2-3 minutes to execute. The website has ~15k registered users,
   out of which some 50 or so have editing roles.
 * Do you have any ideas on how I can investigate this issue? Should I try to deactivate
   and activate again the plugin and see if it gets unstuck?
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Claudio Sanches - PagSeguro for WooCommerce] pagamento pix](https://wordpress.org/support/topic/pagamento-pix/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/pagamento-pix/page/2/#post-14567693)
 * [@romulokriya](https://wordpress.org/support/users/romulokriya/) veja os posts
   anteriores neste tópico.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Claudio Sanches - PagSeguro for WooCommerce] pagamento pix](https://wordpress.org/support/topic/pagamento-pix/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/pagamento-pix/page/2/#post-13852680)
 * [@macolez](https://wordpress.org/support/users/macolez/) veja os comentários 
   anteriores para um quick fix
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Claudio Sanches - PagSeguro for WooCommerce] pagamento pix](https://wordpress.org/support/topic/pagamento-pix/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/pagamento-pix/#post-13828695)
 * [@jorgehen](https://wordpress.org/support/users/jorgehen/) [@fabriciobw](https://wordpress.org/support/users/fabriciobw/)
   essa solução aqui em cima só resolve pro checkout com redirecionamento. checkout
   transparente o buraco é mais embaixo…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Claudio Sanches - PagSeguro for WooCommerce] pagamento pix](https://wordpress.org/support/topic/pagamento-pix/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/pagamento-pix/#post-13828681)
 * [@ricardomorganti](https://wordpress.org/support/users/ricardomorganti/) [@jorgehen](https://wordpress.org/support/users/jorgehen/)
   [@fabriciobw](https://wordpress.org/support/users/fabriciobw/) [@alanabilio](https://wordpress.org/support/users/alanabilio/)
   btw so o jeito mais fácil de fazer funcionar (mas não solução completa pra integrar
   o PIX de fato) é trocar o case ali de cima por isso aqui:
 *     ```
        case 4:
            // Check if order is not paid already
            if ( method_exists( $order, 'get_status' ) && 'processing' !== $order->get_status() && 'completed' !== $order->get_status() ) {
                if ( method_exists( $order, 'get_status' ) && 'cancelled' === $order->get_status() ) {
                    $order->update_status( 'processing', __( 'PagSeguro: Payment approved.', 'woocommerce-pagseguro' ) );
                    wc_reduce_stock_levels( $order_id );
                } else {
                    $order->add_order_note( __( 'PagSeguro: Payment approved.', 'woocommerce-pagseguro' ) );
                    $order->payment_complete( sanitize_text_field( (string) $posted->code ) );
                }
             }
             $order->add_order_note( __( 'PagSeguro: Payment completed and credited to your account.', 'woocommerce-pagseguro' ) );
   
             break;
       ```
   
 * linha 595 do arquivo includes/class-wc-pagseguro-gateway.php
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Claudio Sanches - PagSeguro for WooCommerce] pagamento pix](https://wordpress.org/support/topic/pagamento-pix/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/pagamento-pix/#post-13828465)
 * Amigos, o que acontece é que o PagSeguro retorna direto o status 4. E é isso 
   que o código faz quando recebe esse status:
 *     ```
       case 4:
            $order->add_order_note( __( 'PagSeguro: Payment completed and credited to your account.', 'woocommerce-pagseguro' ) );
       ```
   
 * Normalmente esse status é utilizado para quando o valor é liberado na nossa conta
   PagBank, ou seja, no caso do cartão de crédito ali 15 ou 30 dias depois… então
   o plugin só adiciona essa nota mas não faz mais nada, pois a essa altura do campeonato
   tudo já foi feito. Esse é o problema. Para resolver é preciso verificar se o 
   pedido ainda está com pagamento pendente e, se for o caso, atualizar o que tem
   pra atualizar.
 * [@claudiosanches](https://wordpress.org/support/users/claudiosanches/) se você
   achar ok posso fazer um PR.
    -  This reply was modified 5 years, 5 months ago by [João Faria](https://wordpress.org/support/users/jffaria/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Claudio Sanches - PagSeguro for WooCommerce] pagamento pix](https://wordpress.org/support/topic/pagamento-pix/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/pagamento-pix/#post-13788509)
 * [@alanabilio](https://wordpress.org/support/users/alanabilio/) qual a resolução
   para o problema vocês conseguiram? Tenho o mesmo problema com o PIX aqui.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Vimeo oEmbed now has dnt=1 parameter](https://wordpress.org/support/topic/vimeo-oembed-now-has-dnt1-parameter/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/vimeo-oembed-now-has-dnt1-parameter/#post-13481656)
 * I had this issue a while ago. The fix was adding this to the child theme’s functions.
   php:
 * function custom_remove_embed_url_dnt($provider, $url, $args){
    return add_query_arg(
   array(‘dnt’ => false), $provider ); } add_filter(‘oembed_fetch_url’, ‘custom_remove_embed_url_dnt’,
   10, 3);`
 * I think that’s cleaner than jQuery or anything else I could think of.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce Stripe Payment Gateway] Webhook failing with error 500](https://wordpress.org/support/topic/webhook-failing-with-error-500/)
 *  [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/webhook-failing-with-error-500/#post-13470692)
 * Hi [@matiasmarchetti](https://wordpress.org/support/users/matiasmarchetti/) [@adriangzz](https://wordpress.org/support/users/adriangzz/)
   if you want to chat about this: [https://t.me/joinchat/GbQ39BY1gaFyoTE-QvZyAw](https://t.me/joinchat/GbQ39BY1gaFyoTE-QvZyAw)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce Stripe Payment Gateway] Stripe webhook failing](https://wordpress.org/support/topic/stripe-webhook-failing/)
 *  Thread Starter [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/stripe-webhook-failing/#post-13450906)
 * [@matiasmarchetti](https://wordpress.org/support/users/matiasmarchetti/) yes,
   the webhook is only to notify WooCommerce of things that happened, but it doesn’t
   affect credit card payments because they are synchronous anyway. The issue would
   be for async payments or, for example, if you get a chargeback on a card payment,
   WooCommerce only knows of the chargeback because of the webhook (and is supposed
   to add a note to the order, and set the order to pending or something like that).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce Stripe Payment Gateway] Stripe webhook failing](https://wordpress.org/support/topic/stripe-webhook-failing/)
 *  Thread Starter [João Faria](https://wordpress.org/support/users/jffaria/)
 * (@jffaria)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/stripe-webhook-failing/#post-13449962)
 * [@matiasmarchetti](https://wordpress.org/support/users/matiasmarchetti/) yes,
   they do that to avoid expending resources on that busy load that doesn’t accomplish
   anything.

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

1 [2](https://wordpress.org/support/users/jffaria/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/jffaria/replies/page/2/?output_format=md)