Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cwiccer.com - activating oik-bob-bing-wide doesn't last long #6

Open
bobbingwide opened this issue Feb 10, 2022 · 6 comments
Open

cwiccer.com - activating oik-bob-bing-wide doesn't last long #6

bobbingwide opened this issue Feb 10, 2022 · 6 comments
Assignees
Labels
bug Something isn't working Gutenberg

Comments

@bobbingwide
Copy link
Owner

I've been trying to activate oik-bob-bing-wide in cwiccer.com but it doesn't seem to want to stay activated.
It worked for a short while since I was able to insert some of the blocks provided by it.
But when I viewed the page and edited it again the blocks weren't registered.
No idea why at present.

Updating to v2.1.1 didn't resolve the issue.

@bobbingwide bobbingwide self-assigned this Feb 10, 2022
@bobbingwide bobbingwide added bug Something isn't working Gutenberg labels Feb 10, 2022
@bobbingwide
Copy link
Owner Author

I deactivated a couple of plugins and tried again. I was able to edit a post to add the WordPress info block.
This worked. But the next time I edited the home page the plugin was deactivated. Hmm!

@bobbingwide
Copy link
Owner Author

Looks like it was something to do with oik-unloader.
Or it could be oik-bwtrace trying to set itself to first in the list!
Or any other plugin for that matter.

@bobbingwide
Copy link
Owner Author

Or any other plugin for that matter.

The battle could be with Elementor. It does something with the uninstall_plugins hook.

/home/customer/www/cwiccer.com/public_html/wp-content/plugins/oik-bwtrace/includes/bwtrace-actions.php(618:0) bw_trace_backtrace(1) 24 0 2022-02-12T09:08:23+00:00 0.030573 0.026124 cf=pre_option_uninstall_plugins 2841 1 0 25165824/25165824 768M F=320 3 Array

[0] => (boolean) 
[1] => (string) "uninstall_plugins"
[2] => (boolean) 
  1. bw_lazy_backtrace /home/customer/www/cwiccer.com/public_html/wp-content/plugins/oik-bwtrace/libs/bwtrace.php:108 0
  2. bw_backtrace /home/customer/www/cwiccer.com/public_html/wp-content/plugins/oik-bwtrace/includes/bwtrace-actions.php:619 0
  3. bw_trace_backtrace(,uninstall_plugins,) /home/customer/www/cwiccer.com/public_html/wp-includes/class-wp-hook.php:307 3
  4. apply_filters(,array) /home/customer/www/cwiccer.com/public_html/wp-includes/plugin.php:189 2
  5. apply_filters(pre_option_uninstall_plugins,,uninstall_plugins,) /home/customer/www/cwiccer.com/public_html/wp-includes/option.php:131 4
  6. get_option(uninstall_plugins) /home/customer/www/cwiccer.com/public_html/wp-includes/plugin.php:879 1
  7. register_uninstall_hook(elementor/elementor.php,array) /home/customer/www/cwiccer.com/public_html/wp-content/plugins/elementor/includes/maintenance.php:76 2
  8. init /home/customer/www/cwiccer.com/public_html/wp-content/plugins/elementor/includes/plugin.php:864 0
  9. __construct /home/customer/www/cwiccer.com/public_html/wp-content/plugins/elementor/includes/plugin.php:609 0
  10. instance /home/customer/www/cwiccer.com/public_html/wp-content/plugins/elementor/includes/plugin.php:878 0
  11. require(/home/customer/www/cwiccer.com/public_html/wp-content/plugins/elementor/includes/plugin.php) /home/customer/www/cwiccer.com/public_html/wp-content/plugins/elementor/elementor.php:54 1
  12. include_once(/home/customer/www/cwiccer.com/public_html/wp-content/plugins/elementor/elementor.php) /home/customer/www/cwiccer.com/public_html/wp-settings.php:418 1
  13. require_once(/home/customer/www/cwiccer.com/public_html/wp-settings.php) /home/customer/www/cwiccer.com/public_html/wp-config.php:112 1
  14. require_once(/home/customer/www/cwiccer.com/public_html/wp-config.php) /home/customer/www/cwiccer.com/public_html/wp-load.php:50 1
  15. require_once(/home/customer/www/cwiccer.com/public_html/wp-load.php) /home/customer/www/cwiccer.com/public_html/wp-blog-header.php:13 1
  16. require(/home/customer/www/cwiccer.com/public_html/wp-blog-header.php) /home/customer/www/cwiccer.com/public_html/index.php:17 1

@bobbingwide
Copy link
Owner Author

The battle could be with Elementor

No, it wasn't Elementor. The problem seems to occur when the NextGEN Gallery plugin is activated.

I can see code that will invoke update_option( 'active_plugins').
The trouble is, I can't find any trace output that shows the database being updated.

Having updated my local install to the latest version of the nextgen-gallery plugin I've found the code.

  • It's in a function called fix_loading_order()
  • This is attached to shutdown at priority 10.
  • So it's no surprise that we can't see any SQL queries since these have been reported earlier.

Attached hooks at shutdown were:

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php(579:0) bw_trace_attached_hooks(3) 43 0 2022-02-12T14:28:16+00:00 0.841760 0.000163 cf=shutdown 42527 67 2293 10485760/10485760 256M F=514 shutdown 
: 0   bw_trace_parms;9 bw_trace_attached_hooks;9 bw_trace_backtrace;9 QM_Collector_Overview::process_timing;1 QM_Dispatcher_AJAX::dispatch;1 QM_Dispatcher_Html::dispatch;1 QM_Dispatcher_WP_Die::dispatch;1
: 1   wp_ob_end_flush_all;1
: 10   bw_trace_plugin_loaded_report;1 bw_trace_included_files;1 bw_trace_functions_traced;1 bw_trace_status_report;1 C_NextGEN_Bootstrap::fix_loading_order;1
: 11   OIK_trace_summary::record_vt;1
: 99   bw_trace_count_report;1

Both Query Monitor and oik-bwtrace run their shutdown logic before C_NextGEN_Bootstrap::fix_loading_order().

Proposed fix

Change oik-unloader to remove the filter hook when the shutdown action is invoked, priority < 10.

@bobbingwide bobbingwide transferred this issue from bobbingwide/bobbingwide Feb 12, 2022
@bobbingwide bobbingwide reopened this Feb 15, 2022
@bobbingwide
Copy link
Owner Author

Rather than hooking into shutdown I think we should do it earlier. plugins_loaded seems a sensible place.
The same problem occurs with oik-loader. So I'll try changing that plugin first.

@bobbingwide
Copy link
Owner Author

The solution doesn't work for NextGen Gallery. On shutdown it makes itself activated in C_NextGEN_Bootstrap::fix_loading_order().
Bugger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Gutenberg
Projects
None yet
Development

No branches or pull requests

1 participant