Title: wpuser10's Replies | WordPress.org

---

# wpuser10

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

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

 Search replies:

## Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Prevent from PhotoSwipe being loaded two times after activation of WooCommerce](https://wordpress.org/support/topic/prevent-from-photoswipe-being-loaded-two-times-after-activation-of-woocommerce/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/prevent-from-photoswipe-being-loaded-two-times-after-activation-of-woocommerce/#post-9758235)
 * Theme is adding all js scripts (included PhotoSwipe) in minified file with different
   handle, so in this case should I use the following code?
 *     ```
       <?php wp_deregister_script( 'photoswipe' );
       wp_deregister_script( 'photoswipe-ui-default' );?>
       ```
   
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Autoptimize] Problem with option “Optimize HTML Code” and “Revolution Slider”](https://wordpress.org/support/topic/problem-with-option-optimize-html-code-and-revolution-slider/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/problem-with-option-optimize-html-code-and-revolution-slider/#post-8230747)
 * Thank you very much. I checked the first code and it didn’t work with my slider,
   but second code works very good, so that now I don’t have any errors from HTML5
   validator. Finally I modified your code slightly to run it only if “Revolution
   Slider” and “Autoptimize” plugins are active:
 *     ```
       if (class_exists('RevSlider') & is_plugin_active('autoptimize/autoptimize.php')) :
       add_filter("autoptimize_html_after_minify","crevslider_fixerupper");
       function revslider_fixerupper($htmlin) {
         $htmlout=preg_replace('#\n(data-.*$)\n#Um'," $1 ",$htmlin);
         $htmlout=preg_replace('#(=\"[^"]*\")(\w)#','$1 $2',$htmlout);
         return $htmlout;
       }
       endif;
       ```
   
 * Thank you!
    -  This reply was modified 9 years, 7 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
    -  This reply was modified 9 years, 7 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Autoptimize] Problem with option “Optimize HTML Code” and “Revolution Slider”](https://wordpress.org/support/topic/problem-with-option-optimize-html-code-and-revolution-slider/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/problem-with-option-optimize-html-code-and-revolution-slider/#post-8217066)
 * > I’m not considering this a priority issue, but if you want I could provide 
   > you with a code snippet that hooks into AO’s API to change the newlines into
   > spaces?
 * I see, yes, that would be great, becuase I don’t want to disable “Optimize HTML
   Code”, becuase this will affect the ranking in GTmetrix, etc.
    It would be great
   to use your code snipped for now to quickfix it and it would be also great if
   this can be later implemented in the future release of Autoptimize, because Revolution
   Slider is very popular.
    -  This reply was modified 9 years, 7 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Autoptimize] Problem with option “Optimize HTML Code” and “Revolution Slider”](https://wordpress.org/support/topic/problem-with-option-optimize-html-code-and-revolution-slider/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/problem-with-option-optimize-html-code-and-revolution-slider/#post-8215027)
 * To replicate please:
 * 1) Install latest WP with for example “Twenty Sixteen” theme.
    2) Install and
   activate latest version of Revolution Slider and Autoptimize. 3) Set the basic
   option “Optimize HTML Code?” in Autoptimize. 4) Import (Slider Revolution > Import
   Slider) for example this slider: [http://revolution.themepunch.com/wp-content/uploads/2015/08/classicslider4.zip](http://revolution.themepunch.com/wp-content/uploads/2015/08/classicslider4.zip)(
   it’s example from [https://revolution.themepunch.com/free-slider-exchange/](https://revolution.themepunch.com/free-slider-exchange/))
   5) Create new page (Pages > Add new) and put this shortcode in text editor: `[
   rev_slider alias="classicslider1"]` 6) Test page using: [https://validator.w3.org/](https://validator.w3.org/).
   You will see errors, like this:
 * > “No space between attributes.”
 * Hope this helps you to investigate and improve the plugin. Revolution Slider 
   support suggested to contact you in this case. Please let me kow if you need 
   more details. I was able to replicate this on different hosts. If you still couldn’t
   replicate then I could send you URL to check via e-mail (please let me know if
   still needed).
    -  This reply was modified 9 years, 7 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
    -  This reply was modified 9 years, 7 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
    -  This reply was modified 9 years, 7 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[One Click Demo Import] Problem with importing widgets to custom sidebars](https://wordpress.org/support/topic/problem-with-importing-widgets-to-custom-sidebars/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/problem-with-importing-widgets-to-custom-sidebars/#post-8177513)
 * Thank you, I implemented and compared the times and it looks the order is correct,
   but I still didn’t resolve the problem.
 * When first time click on “Import Demo Data” then I got in the log file for example:
 * > sidebar1 : Sidebar does not exist in theme (moving widget to Inactive)
 * After importing I can see the sidebars, but empty. When click on “Import Demo
   Data” second time then sidebars are with imported widgets (correct).
 * Do you have any other suggestions what could be wrong? I am using just very basic
   system for creating custom widgets, which is working fine in general.
    -  This reply was modified 9 years, 8 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[One Click Demo Import] Problem with importing widgets to custom sidebars](https://wordpress.org/support/topic/problem-with-importing-widgets-to-custom-sidebars/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/problem-with-importing-widgets-to-custom-sidebars/#post-8161782)
 * Tried different methods and unfortunatelly nothing worked.
 * Double checked this code below and it works correct (add custom sidebars).
 *     ```
       /*add custom sidebars*/
       $custom_sidebar[] = 'sidebar1';
       $custom_sidebar[] = 'sidebar2';
       $custom_sidebar[] = 'sidebar3';
       $custom_sidebar[] = 'sidebar4';
   
       update_option( 'custom_sidebar', $custom_sidebar );
       ```
   
 * It also works correct when it is inside ‘pt-ocdi/before_import’.
    The problem
   is that it’s adding sidebars too late or it needs to reload a page before importing
   the widgets. Not sure why. Is it possible to echo time after importing the sidebars
   and time just before importing the widgets from wie file to investigate it more?
    -  This reply was modified 9 years, 8 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
    -  This reply was modified 9 years, 8 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
    -  This reply was modified 9 years, 8 months ago by [wpuser10](https://wordpress.org/support/users/wpuser10/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[One Click Demo Import] Problem with importing widgets to custom sidebars](https://wordpress.org/support/topic/problem-with-importing-widgets-to-custom-sidebars/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problem-with-importing-widgets-to-custom-sidebars/#post-7666890)
 * The sidebars I am adding are intentionally dynamic (it’s possible to add/remove
   them from settings). There are also static sidebars (registered in functions.
   php) like footer, sidebar and importing to them works fine.
 * Yes, updating “custom_sidebar” is adding the sidebars correctly (I checked it).
 * I observed the issue also after I moved the code to import “Revolution Slider”
   from “**import_start**” action to “**pt-ocdi/before_widgets_import**” action.
   I will move it back to “import_start” and let you know if it helps.
 * The only problem with “import_start” is that is not possible there to select 
   the import with code like in your FAQ:
 *     ```
       if ( 'Demo Import 1' === $selected_import['import_file_name'] ) {
               echo "This will be displayed only on after import if user selects Demo Import 1";
   
               // Set logo in customizer
               set_theme_mod( 'logo_img', get_template_directory_uri() . '/assets/images/logo1.png' );
           }
       ```
   
 * Do you maybe have solution for this?
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[One Click Demo Import] Problem with importing widgets to custom sidebars](https://wordpress.org/support/topic/problem-with-importing-widgets-to-custom-sidebars/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problem-with-importing-widgets-to-custom-sidebars/#post-7666745)
 * There was no errors during the import, importing ended as successful each time.
   Could please you write where can I find the logs you mentioned?
 * Could the reason be that importing Revolution Slider is taking some time and 
   perhaps slowing down the final exacution of action? Sidebars were imported, but
   widgets were not imported, so it sounds like sidebars were created too late.
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[One Click Demo Import] How to disable generation of multiple image sizes?](https://wordpress.org/support/topic/how-to-disable-generation-of-multiple-image-sizes/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/how-to-disable-generation-of-multiple-image-sizes/#post-7391597)
 * Hi,
 * Yes, there was error at the end (after about 5 minutes of importing) and link
   to error log.
 * > The demo import has finished, but there were some import errors.
   >  More details
   > about the errors can be found in this log file
 * In the log file there were lot of errors related to images, but URLs for images
   in dummy.xml were not correct, so the reason with errors for images is not related
   to plugin.
 * There were also lot of warnings like this:
 * > [WARNING] Could not find the author for “bbPress Forum Closed Topic” (post #
   > 5230)
 * I was using custom xml file with different data included: [https://bbpress.trac.wordpress.org/attachment/ticket/2516/bbpress-unit-test-data.xml](https://bbpress.trac.wordpress.org/attachment/ticket/2516/bbpress-unit-test-data.xml)
   and default dummy data from WooCommerce [https://github.com/woothemes/woocommerce/blob/master/dummy-data/dummy-data.xml](https://github.com/woothemes/woocommerce/blob/master/dummy-data/dummy-data.xml)
   mixed with regular posts and pages.
 * I wonder if there are lot of errors with images then can it slow down importing
   a lot and be the reason of problem with full import and skipping after import
   action?
 * I will correct the URLs for images and try to replicate the problem on different
   hosts and if it will be the same without success then I could send you the full
   export for testing if necessary.
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[One Click Demo Import] How to disable generation of multiple image sizes?](https://wordpress.org/support/topic/how-to-disable-generation-of-multiple-image-sizes/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/how-to-disable-generation-of-multiple-image-sizes/#post-7391497)
 * Thank you for quick response. I was actually using the latest version – that’s
   the reason I asked how to disable the option. I remember that at the end of log
   I got info about (max_execution_time = 300) and after import actions were not
   processed.
 * Was this related to max_execution_time or some other things?
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] How to change the settings (Settings->Display) after theme activation?](https://wordpress.org/support/topic/how-to-change-the-settings-settings-display-after-theme-activation/)
 *  Thread Starter [wpuser10](https://wordpress.org/support/users/wpuser10/)
 * (@wpuser10)
 * [10 years ago](https://wordpress.org/support/topic/how-to-change-the-settings-settings-display-after-theme-activation/#post-7341212)
 * Hi,
 * Thank you for response. Wonder if you could provide a bit more details (or reference
   to some best code samples for this), for example can it be done with simple hook
   added to functions.php? Do you have list of available hooks and filters (like
   for example here: [https://docs.woothemes.com/wc-apidocs/hook-docs.html](https://docs.woothemes.com/wc-apidocs/hook-docs.html))?
 * Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)