Title: codealfa's Replies - page 6 | WordPress.org

---

# codealfa

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

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

 Search replies:

## Forum Replies Created

Viewing 15 replies - 76 through 90 (of 105 total)

[←](https://wordpress.org/support/users/codealfa/replies/page/5/?output_format=md)
[1](https://wordpress.org/support/users/codealfa/replies/?output_format=md) [2](https://wordpress.org/support/users/codealfa/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/codealfa/replies/page/3/?output_format=md)…
[5](https://wordpress.org/support/users/codealfa/replies/page/5/?output_format=md)
6 [7](https://wordpress.org/support/users/codealfa/replies/page/7/?output_format=md)
[→](https://wordpress.org/support/users/codealfa/replies/page/7/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] Compatilbity with caching plugins](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/#post-6137431)
 * I don’t think you understand what I am trying to explain so maybe I need to work
   on how to explain myself clearer. While the callback works beautifully in a simple
   script where you are in control of all the codes, that’s not the case in WordPress
   where users can add may different plugins that are handling output buffering 
   in many different ways.
 * The callback is not an option for me as I simply cannot release an update that
   will knowingly break the functionality of the plugin on some sites. I hope you
   can understand that.
 * I want the plugin to be compatible with caching as much as you do so I may have
   a solution that works for both of us. I’ve tested it with GatorCache and it works.
   I’ve edited the jch_buffer_end function as such:
 *     ```
       function jch_buffer_end()
       {
               $sHtml = '';
               $bFlag = FALSE;
   
               while (ob_get_level())
               {
                       $sHtml = ob_get_clean() . $sHtml;
   
                       ob_start();
   
                       if (JchOptimizeHelper::validateHtml($sHtml))
                       {
                               $bFlag = TRUE;
   
                               break;
                       }
               }
   
               if ($bFlag)
               {
                       echo jchoptimize($sHtml);
               }
               else
               {
                       echo $sHtml;
               }
       }
       ```
   
 * If you can confirm that this works then this will be included in the next release.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] Compatilbity with caching plugins](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/#post-6137365)
 * What I actually meant was to have the optimize process run before the caching
   process. Thought you would have understood that since one plugin can be hooking
   into various functions running at different times so you wouldn’t necessarily
   have one plugin running in its entirety before another in WordPress.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] Compatilbity with caching plugins](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/#post-6137349)
 * Yes I’m quite aware of that actually. When I say ‘having the JCH Optimize plugin
   run’, I’m referring to the jchoptimize function that gets called when the buffer
   closes. That’s where the optimization happens. So generally yes that would mean
   starting the caching buffer before the JCH Optimize buffer as you have rightly
   pointed out.
 * With the current implementation though, assuming the caching occurs whenever 
   your buffer closes, then the caching will occur before the optimize function 
   runs even if you started your buffer first since I’m looping through and closing
   all the levels of buffering and concatenating them. There’s no harm done here
   as I explained earlier since WordPress does the exact same thing one step later
   anyway so me doing it shouldn’t affect anybody in anyway that WordPress hasn’t.
 * I’m trying to ensure that the full HTML is available whenever I call the optimize
   function. Your solution doesn’t work for me as I’ve seen plugins starting buffers
   they’re not closing, and I’ve seen plugins closing buffers that haven’t started.
   I’ve also seen different parts of the HTML in different levels so I can’t rely
   on a callback to ensure I’m getting the HTML when my buffer closes.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] Compatilbity with caching plugins](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/#post-6137344)
 * I should also add that I am aware of the ‘incompatibility’ with caching plugins.
   I generally test the plugin with WP Super Cache so I regrettably noted that with
   the last change the caching plugin no longer cached the optimized HTML, something
   I would prefer to have happen myself. The ‘consolation’ though was that JCH Optimize
   comes with its own level of caching.
 * I’ve put in a lot of effort to have the plugin run as fast as possible. The results
   of the combining and minification functions are cached so on subsequent requests
   the plugin should run under 100ms.
 * Anyway I’ll continue to research to see if there’s a way I can have my plugin
   compatible with other plugins including caching plugins.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] Compatilbity with caching plugins](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/compatilbity-with-caching-plugins/#post-6137343)
 * Thanks for your feedback. When you say ‘compatible’ I’m assuming you mean having
   the JCH optimize plugin run before the caching plugin so the output of JCH optimize
   is cached by the plugin.
 * Coming from a Joomla! background, one of the challenges I have with WordPress
   is that there is no native way of accessing the processed HTML. Therefore, developers
   who need to access some or all parts of the HTML have to resort to PHP’s buffering
   functions to do so. I’ve found that different developers are doing all sorts 
   of things so compatibility between plugins that uses output buffering is a major
   challenge.
 * The problem with your solution, which I’ve tried before, is that the plugin needs
   the complete HTML that is enclosed between (and including) the <html> tags in
   order to work. When the optimize function is called in the buffer callback, there’s
   no guarantee what is in the current buffer. If throughout the page requests the
   buffers are not properly nested, which I have encountered, the function gets 
   called before the full HTML is ready. I’ve even seen different parts of the HTML
   in different levels of buffer, which is why I’m looping through all the levels.
 * I’m shutting down the buffer just before WordPress does it anyhow. I do it in
   the shutdown hook using a priority of ‘0’ and WordPress calls this function in
   the shutdown hook using a ‘1’ priority in the wp-includes/functions.php file:
 *     ```
       function wp_ob_end_flush_all() {
       	$levels = ob_get_level();
       	for ($i=0; $i<$levels; $i++)
       		ob_end_flush();
       }
       ```
   
 * In the absence of a native buffer API and a way for users to order which plugins
   should run first, I think as developers we should work together on a convention
   that makes our plugins work well together. I would propose my solution with two
   small changes. I could hook into shutdown a little earlier but restarting the
   buffer after running my functions so caching plugins can hook into shutdown after
   and cache the optimized HTML. So my codes would look like this:
 *     ```
       add_action('template_redirect', 'jch_buffer_start', 0);
        add_action('shutdown', 'jch_buffer_end', -1);
       ```
   
 *  and
 *     ```
       function jch_buffer_end()
       {
               $sHtml = '';
   
               while (ob_get_level())
               {
                       $sHtml = ob_get_clean() . $sHtml;
               }
   
               ob_start();
   
               if (JchOptimizeHelper::validateHtml($sHtml))
               {
                       echo jchoptimize($sHtml);
               }
               else
               {
                       echo $sHtml;
               }
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] PageSpeed report error: small inline css](https://wordpress.org/support/topic/pagespeed-report-error-small-inline-css/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/pagespeed-report-error-small-inline-css/#post-6106953)
 * I don’t think you understand what I was explaining previously so let’s try again.
 * The error is not caused by the plugin. It was there before but PageSpeed is now
   flagging the JCH file because it contains the contents of the original file. 
   This is why I was suggesting that you do the before and after comparison with
   PageSpeed to see for yourself. Please deactivate the plugin and run a PageSpeed
   analysis then run it again with the plugin activated and see if the plugin is
   adding any errors. Even with the free version, if you configured it properly,
   you should see less errors and a higher score. If you don’t then there’s no point
   in using the plugin.
 * The plugin doesn’t fix this error at all. What I was describing was a workaround
   that the pro version provides. If you’re using the Automatic settings then the
   Minimum – Average setting will preserve the original execution order of the files
   on the page so if there are any files excluded from the plugin, the plugin will
   split the combined file around the excluded file to ensure that the execution
   order is preserved. I’m assuming that’s what is happening on your site why you’ll
   end up with a file that small. The higher settings in the pro version will safely
   combine all the files in one and still preserve the execution order. That way
   you’ll have one combined file and it won’t be a small file. The only other error
   you would need to contend with is the Eliminate render-blocking and the article
   I mentioned describes how to address this with the plugin.
 * If you still don’t understand what I’m saying then post your site’s url here 
   with the plugin activated and I’ll run the tests for you and explain again with
   screenshots.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] PageSpeed report error: small inline css](https://wordpress.org/support/topic/pagespeed-report-error-small-inline-css/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/pagespeed-report-error-small-inline-css/#post-6106923)
 * Ok no problem. Looking forward to it.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] PageSpeed report error: small inline css](https://wordpress.org/support/topic/pagespeed-report-error-small-inline-css/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/pagespeed-report-error-small-inline-css/#post-6106911)
 * Did you run the PageSpeed analysis with the plugin off so you can compare both
   reports? My guess is that you would see that suggestion anyhow. It’s not really’
   caused’ by the plugin, the JCH url is shown there now because the contents of
   the original file is now combined by the plugin.
 * It’s just saying that the file is relatively small so instead of putting the 
   CSS in a file, you could have put it in an inline style declaration instead to
   avoid a http request. It’s not a big deal actually. The performance gain is negligible
   with this change.
 * I’m assuming you’re using the free version but the pro version will give you 
   more options that would address this issue anyway. With the higher Automatic 
   settings available, you would be able to safely combine all the files in one,
   further reducing http requests and you would have options to eliminate render-
   blocking. Take a look at this article that sheds more light on that:
    [https://www.jch-optimize.net/documentation/tutorials/eliminate-render-blocking.html](https://www.jch-optimize.net/documentation/tutorials/eliminate-render-blocking.html)
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Autoptimize] It really speed up my website's performance](https://wordpress.org/support/topic/it-really-speed-up-my-websites-performance/)
 *  [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/it-really-speed-up-my-websites-performance/#post-7958517)
 * What do you call bad behavior plugin? And also note that there are many other
   aspects, apart from caching, to speed up your website.
 * Front end performance optimization hosts a list of techniques to improve your
   wordpress speed. And if you are only using caching then I’m pretty sure you can
   get in some more.
 * Do some research on website performance optimization techniques and try [JCH Optimize](https://www.jch-optimize.net/)
   plugin and see if this plugin doesn’t get you faster loading times.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] combine css files does not works with version 1.1.4](https://wordpress.org/support/topic/combine-css-files-does-not-works-with-version-114/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/combine-css-files-does-not-works-with-version-114/#post-6058819)
 * Ok thanks. You can consider leaving a review for use so others will know the 
   plugin can be useful for them.
 * I would like to resolve the issue you have with 1.1.4 though so please submit
   a ticket with admin access and FTP to your server or test site and I will fix
   it for you.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] combine css files does not works with version 1.1.4](https://wordpress.org/support/topic/combine-css-files-does-not-works-with-version-114/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/combine-css-files-does-not-works-with-version-114/#post-6058780)
 * Ok so you’re using 1.1.3 now? You can get the pro version on the website for 
   any official version if you have a subscription. Go to Downloads -> All Official
   Releases -> WordPress.
 * Since you have a subscription the best way for me to address this is if you submit
   a ticket on the website with admin access and FTP login to your server. That 
   way I can troubleshoot and know for sure what the problem is rather than guessing.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Super Cache] still http requests outstanding](https://wordpress.org/support/topic/still-http-requests-outstanding/)
 *  [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/still-http-requests-outstanding/#post-6057692)
 * Try using the JCH Optimize plugin to combine your javascript and css files to
   reduce http request. A powerful combination with WP Super Cache to speed up your
   website. Be sure to flush your cache after installing and configuring the plugin:
 * [https://wordpress.org/plugins/jch-optimize/](https://wordpress.org/plugins/jch-optimize/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] combine css files does not works with version 1.1.4](https://wordpress.org/support/topic/combine-css-files-does-not-works-with-version-114/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/combine-css-files-does-not-works-with-version-114/#post-6058696)
 * Very strange. Are the javascript files still being combined?
 * Try flushing all your cache if you have a caching plugin installed. Try deactivating
   and reactivating the JCH Optimize plugin, clean the plugin cache and re-configure
   the plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] "Remove above the fold CSS and JavaScript"](https://wordpress.org/support/topic/remove-above-the-fold-css-and-javascript/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-above-the-fold-css-and-javascript/#post-6027072)
 * I’ve added a tutorial to the site to explains how to do this in detail:
 * [https://www.jch-optimize.net/documentation/tutorials/eliminate-render-blocking.html](https://www.jch-optimize.net/documentation/tutorials/eliminate-render-blocking.html)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JCH Optimize] Lazy Load Images, images not showing up directly in Widgets](https://wordpress.org/support/topic/lazy-load-images-images-not-showing-up-directly-in-widgets/)
 *  Plugin Author [codealfa](https://wordpress.org/support/users/codealfa/)
 * (@codealfa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/lazy-load-images-images-not-showing-up-directly-in-widgets/#post-6032426)
 * Thanks for your commendations and your support. You should consider writing a
   review for us :).
 * The lazy load image function is not supposed to work like that so I imagine there
   may be a slight conflict with something somewhere. Images above the fold should
   show right away so maybe you want to exclude these images. You can easily exclude
   them now by file path but in a future version there’ll be more options such as
   excluding by class.
 * Did I understand your issue correctly? I’m not sure I understand what you mean
   by “It would be nice to have the option to put a value for lazy loading, put 
   in pixels, that the end-user can change.”

Viewing 15 replies - 76 through 90 (of 105 total)

[←](https://wordpress.org/support/users/codealfa/replies/page/5/?output_format=md)
[1](https://wordpress.org/support/users/codealfa/replies/?output_format=md) [2](https://wordpress.org/support/users/codealfa/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/codealfa/replies/page/3/?output_format=md)…
[5](https://wordpress.org/support/users/codealfa/replies/page/5/?output_format=md)
6 [7](https://wordpress.org/support/users/codealfa/replies/page/7/?output_format=md)
[→](https://wordpress.org/support/users/codealfa/replies/page/7/?output_format=md)