codealfa
Forum Replies Created
-
Forum: Plugins
In reply to: [JCH Optimize] CSS FormattingIf you’re copying and pasting the url try typing it in instead. Sometimes when you paste it, it doesn’t quite ‘register’. I’ll check out the issue of no dropdown of css files.
Forum: Plugins
In reply to: [JCH Optimize] CSS FormattingHave you tried different settings to see if it works on any of the settings? Try the Minimum setting.
I suspect you may have some parsing errors in one or more of your CSS files so when the files are minified then it causes problems.
Refer to this article in the section on resolving CSS conflicts to see how to check your CSS files for parsing errors:
https://www.jch-optimize.net/documentation/tutorials/how-to-resolve-conflicts-with-third-party-extensions.htmlForum: Reviews
In reply to: [JCH Optimize] Didn't see any changeYou need to check if the plugin is running. The most likely reason would be caching so be sure to flush your cache and disable your caching plugin while configuring JCH Optimize.
Check the source of the page for the JCH generated combined file. It looks like this:
https://yourwebsite.com/wp-content/plugins/jch-optimize/assets/wp-content/plugins/gz/30/0/381259820a40ccb26059b76d87c406a7.css
If you’re not seeing that turn on ‘Log caught exceptions’ in Advanced Options and check for logs in /wp-content/plugins/jch-optimize/logs/jch-optimize.log and the log would tell you why the plugin didn’t run. Try to correct the issue and try the plugin again.
Forum: Plugins
In reply to: [JCH Optimize] Plugin caused 404 error for all postsOk good to know.
Is the plugin working properly now or you didn’t bother to try again? Maybe you can try it on a test site first.
I can’t think of how the plugin could cause that so I suspect it might have been something else coincidentally at that time.
Forum: Plugins
In reply to: [JCH Optimize] Error on activating pluginOk great so this confirms what I was thinking about the server. Well happy to know it’s resolved.
Regards.
Forum: Plugins
In reply to: [JCH Optimize] Compatilbity with caching pluginsI don’t know why you have completely ignored and disregarded what I have said about encountering cases where the callback doesn’t work as expected. This works well if the buffers are properly nested. The PHP Manual also points this out.
https://php.net/ob_start/
“Output buffers are stackable, that is, you may call ob_start() while another ob_start() is active. Just make sure that you call ob_end_flush() the appropriate number of times.”In WordPress you can’t guarantee that this will be the case when users can install any number of arbitrary plugins that are doing all sorts of things with buffering. These plugins are hooking into all manner of different actions and have little control of the order in which hooked actions are called with respect to all the other plugins.
If using the callback works for the other plugins then that’s fine. You may consider what I’m doing to be unorthodox but for me “to do this correctly” means to do it in a way that works. I’ve tested it with GatorCache and other plugins using output buffering and it works in all scenarios when the callback fails in some.
Have you tested the latest version at all? As I have already stated I am also interested in having the plugin compatible with other plugins, not just GatorCache, so confirming whether this works or not for you would be more helpful than insisting I write codes in a particular way.
Forum: Plugins
In reply to: [JCH Optimize] Error on activating pluginDid you check your host for assistance on this? This is more of a server issue because the plugin works on other servers. Check if there’s some restriction on your server regarding plugins creating and saving files and folders on the server.
Forum: Plugins
In reply to: [JCH Optimize] Lazy Load Images, images not showing up directly in WidgetsOk I’m glad to know your issues are resolved. Be sure to let me know if you have any more issues.
Regards.
Forum: Plugins
In reply to: [JCH Optimize] Lazy Load Images, images not showing up directly in WidgetsAs a subscriber, if you can provide admin access you can submit a private ticket on the website and I’ll configure it for you.
Forum: Plugins
In reply to: [JCH Optimize] Error on activating pluginIt seems the plugin is having some trouble creating or accessing the plugin’s cache folder on your server. Maybe you can try to create it manually and make sure the folder has correct permissions.
The plugin’s cache directory is at /wp-content/cache/jch-optimize/
Normally the permissions of the folder should be 755 but check with your host to confirm what permissions you need to set for the plugin to access this folder.
Forum: Plugins
In reply to: [JCH Optimize] Lazy Load Images, images not showing up directly in WidgetsThank you for your review. It’s much appreciated. I’m happy you find the plugin useful and beneficial.
Did you try excluding the images from Lazy Load as I suggested before? The images don’t generally wait for you to scroll in order to show. Once they’re above the fold they should show. If the images are in some way manipulated by javascript then it’s likely it will conflict with the Lazy Load function so in those cases you should exclude them.
There’s an option ‘Exclude these images from lazy loading’ in the Exclude Options on the Pro Options tab. You should be able to select the images you want to exclude from the drop down list. If they’re not there you can add them by typing the full url to the image in the textbox and click the ‘Add item’ button then save your settings.
It is highly recommended that you use a caching plugin along with JCH Optimize to further reduce your page load time. JCH Optimize does front-end optimizations by making changes to your HTML to make it download faster. A caching plugin will help your server to respond faster by caching the HTML so the website don’t have to build it from scratch each time.
I released a new version today so make sure you update your plugin because this one should resolve some compatibility issues with caching plugins.
Forum: Plugins
In reply to: [JCH Optimize] Compatilbity with caching pluginsUpdate released with compatibility with caching plugins.
Forum: Plugins
In reply to: [JCH Optimize] Compatilbity with caching pluginsI just thought I’d give one use case scenario that I’ve encountered where the callback implementation does not work for me. Remember I need the full HTML in order for the plugin to work:
ob_start('my_optimizing_function'); echo '<html>'; echo '<head></head>'; echo '<body>'; echo '<pre>Hello World</pre>'; ob_end_flush(); echo '<pre>Hello again world</pre>'; echo '</body>'; echo '</html>'; function my_optimizing_function($html) { $buffer = '<!--Optimization start-->' . "\n"; $buffer .= $html . "\n"; $buffer .= '<!--Optimization ends-->' . "\n"; return $buffer; }
Will return:
<!--Optimization start--> <html><head></head><body><pre>Hello World</pre> <!--Optimization ends--> <pre>Hello again world</pre></body></html>
With my solution:
ob_start(); echo '<html>'; echo '<head></head>'; echo '<body>'; echo '<pre>Hello World</pre>'; ob_end_flush(); echo '<pre>Hello again world</pre>'; echo '</body>'; echo '</html>'; $sHtml = ''; while (ob_get_level()) { $sHtml = ob_get_clean() . $sHtml; ob_start(); if($sHtml) { break; } } echo my_optimizing_function($sHtml); function my_optimizing_function($html) { $buffer = '<!--Optimization start-->' . "\n"; $buffer .= $html . "\n"; $buffer .= '<!--Optimization ends-->' . "\n"; return $buffer; }
returns:
<!--Optimization start--> <html><head></head><body><pre>Hello World</pre><pre>Hello again world</pre></body></html> <!--Optimization ends-->
And there are others.
My solution is also compatible with your plugin:
ob_start('my_cache_function'); ob_start();//Optimization buffer starts echo '<pre>Hello World</pre>'; $sHtml = ''; while (ob_get_level()) { $sHtml = ob_get_clean() . $sHtml; ob_start(); if($sHtml) { break; } } echo my_optimizing_function($sHtml); function my_optimizing_function($html) { return $html . "\n" . '<!-- Optimized by great optimizer -->'; } function my_cache_function($html) { return $html . "\n" . '<!-- Cached by mighty cacher -->'; }
returns:
<pre>Hello World</pre> <!-- Optimized by great optimizer --> <!-- Cached by mighty cacher -->
Of course, if you need the full HTML for your plugin to work correctly too then your plugin will fail in the first scenario.
Forum: Plugins
In reply to: [JCH Optimize] Compatilbity with caching pluginsI 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
In reply to: [JCH Optimize] Compatilbity with caching pluginsWhat 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.