bobbingwide / oik-clone

Clone content between sites
https://www.oik-plugins.com/oik-plugins/oik-clone-clone-your-wordpress-content/
GNU General Public License v2.0
5 stars 0 forks source link

Blog display timed out in the [clone] shortcode? #43

Closed bobbingwide closed 3 years ago

bobbingwide commented 4 years ago

There are a number of Warnings produced

    [1] => (string) "Warning: Illegal offset type"
    [2] => (string) "C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\admin\class-oik-clone-tree.php"
    [3] => (integer) 116

also lines 114, 169

  1. bw_lazy_backtrace C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\libs\bwtrace.php:108 0
  2. bw_backtrace C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php:285 0
  3. bw_trace_error_handler(2,Illegal offset type,C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\admin\class-oik-clone-tree.php,116,array) C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\admin\class-oik-clone-tree.php:116 5
  4. add_node(object) C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\admin\class-oik-clone-tree.php:85 1
  5. build_tree(object) C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\admin\class-oik-clone-tree.php:137 1
  6. next_node(object) C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\admin\class-oik-clone-tree.php:48 1
  7. __construct(2886,array) C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\shortcodes\oik-clone.php:11 2
  8. oik_clone_build_tree(2886,array) C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\shortcodes\oik-clone.php:130 2
  9. oik_clone(array,,clone) C:\apache\htdocs\wordpress\wp-content\plugins\oik\oik-add-shortcodes.php:207 3
  10. bw_shortcode_event(array,,clone) C:\apache\htdocs\wp-a2z\wp-includes\shortcodes.php:325 3
  11. do_shortcode_tag(array) C:\apache\htdocs\wp-a2z\wp-includes\shortcodes.php:0 1
  12. preg_replace_callback(/[([?)(cloned|clone)(?![\w-])([^]\/](?:\/(?!])[^]\/])?)(?:(\/)]|](?:([^[]+(?:[(?!\/\2])[^[]+)+)[\/\2])?)(]?)/,do_shortcode_tag,[clone] [cloned]) C:\apache\htdocs\wp-a2z\wp-includes\shortcodes.php:199 3
  13. do_shortcode([clone] [cloned]) C:\apache\htdocs\wp-a2z\wp-includes\class-wp-hook.php:288 1
  14. apply_filters([clone] [cloned],array) C:\apache\htdocs\wp-a2z\wp-includes\plugin.php:208 2
  15. apply_filters(widget_text,[clone] [cloned],array,object) C:\apache\htdocs\wp-a2z\wp-includes\widgets\class-wp-widget-custom-html.php:144 4
  16. widget(array,array) C:\apache\htdocs\wp-a2z\wp-includes\class-wp-widget.php:378 2
  17. display_callback(array,array) C:\apache\htdocs\wp-a2z\wp-includes\widgets.php:770 2
  18. dynamic_sidebar(footer-1) C:\apache\htdocs\wordpress\wp-content\themes\genesis\lib\structure\footer.php:52 1
  19. genesis_footer_widget_areas() C:\apache\htdocs\wp-a2z\wp-includes\class-wp-hook.php:286 1
  20. apply_filters(,array) C:\apache\htdocs\wp-a2z\wp-includes\class-wp-hook.php:310 2
  21. do_action(array) C:\apache\htdocs\wp-a2z\wp-includes\plugin.php:465 1
  22. do_action(genesis_before_footer) C:\apache\htdocs\wordpress\wp-content\themes\genesis\footer.php:27 1
  23. require_once(C:\apache\htdocs\wordpress\wp-content\themes\genesis\footer.php) C:\apache\htdocs\wp-a2z\wp-includes\template.php:722 1
  24. load_template(C:\apache\htdocs\wp-a2z/wp-content/themes/genesis/footer.php,1) C:\apache\htdocs\wp-a2z\wp-includes\template.php:671 2
  25. locate_template(array,1) C:\apache\htdocs\wp-a2z\wp-includes\general-template.php:76 2
  26. get_footer C:\apache\htdocs\wordpress\wp-content\themes\genesis\lib\framework.php:103 0
  27. genesis C:\apache\htdocs\wordpress\wp-content\themes\genesis-a2z\home.php:98 0
  28. include(C:\apache\htdocs\wordpress\wp-content\themes\genesis-a2z\home.php) C:\apache\htdocs\wp-a2z\wp-includes\template-loader.php:78 1
  29. require_once(C:\apache\htdocs\wp-a2z\wp-includes\template-loader.php) C:\apache\htdocs\wp-a2z\wp-blog-header.php:19 1
  30. require(C:\apache\htdocs\wp-a2z\wp-blog-header.php) C:\apache\htdocs\wp-a2z\index.php:17 1 C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-ac

The trace output shows a lot of tracing:

[OIK_clone_tree::is_handled_node] => 12898
[bw_trace_error_handler] => 19334

so there must be a bad loop somewhere.

bobbingwide commented 4 years ago

Q: Should the [clone] shortcode be allowed to run on archive pages? Should we not check is_single()?

And also is_front_page() and for the [cloned] shortcode.

bobbingwide commented 4 years ago

Looks like the problem occurred when processing the block post for kadence/advancedgallery. The logic to find and map post ids in the blocks doesn't cater for arrays.

<!-- wp:kadence/advancedgallery {"uniqueID":"_becf9d-fc","ids":[1816,2084,2185]} -->
bobbingwide commented 3 years ago

I've released oik-clone v2.0.0. Closing this issue.