Quantcast
Channel: WordPress.org Forums » [Autoptimize] Support
Viewing all articles
Browse latest Browse all 14096

CaveatLector on "[Plugin: Autoptimize] WP-Property Plugin add_action Priority Incompatibility"

$
0
0

I have found another plugin that is not compatible with this new function code priority setting in Autoptimize 1.9.x:

add_action('template_redirect','autoptimize_start_buffering',11);

Autoptimize 1.9.1 does not optimize real estate property listing pages produced by the WP-Property plugin due to the following priority setting in its \wp-property\core\class_property_export.php file:

add_action('wpp_settings_help_tab', array('wpi_property_export', 'help_tab'), 10, 4);

Those pages optimize normally if the priority assignment above is changed from 10 to 12. However, the WP-Property software is complex and extensive testing would be needed to be sure that change doesn't have any adverse consequences. It seems safer to instead change the Autoptimize priority back to 2 by adding the following to the theme function file.

// Change the autoptimize_start_buffering priority
remove_action('template_redirect','autoptimize_start_buffering',11);
add_action('template_redirect','autoptimize_start_buffering',2);

There may be situations where a priority of 11 is needed for some reason, but it has been causing me problems. I have several sites with different sets of plugins running live with that fix where Autoptimize 1.9.1 is working perfectly. It also causes Autoptimize 1.9.1 to work perfectly at an offline development site where it hadn't been working on most of the pages. Therefore, anyone who is having trouble getting Autoptimize 1.9.1 to work probably should try it.

https://wordpress.org/plugins/autoptimize/


Viewing all articles
Browse latest Browse all 14096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>