Also tried by renaming the plugin with a @ character for first letter, this only moved up the plugin location in the backend sidebar π
I found this function and tried it:
add_action( ‘activated_plugin’, ‘nelio_load_first’ );
function nelio_load_first()
{
$path = str_replace( WP_PLUGIN_DIR . ‘/’, ”, __FILE__ );
if ( $plugins = get_option( ‘active_plugins’ ) ) {
if ( $key = array_search( $path, $plugins ) ) {
array_splice( $plugins, $key, 1 );
array_unshift( $plugins, $path );
update_option( ‘active_plugins’, $plugins );
}
}
}
Still no luck!
Hi!
I think I know what might be amiss. If you go to includes/controller.php, line 317, you’ll see the following piece of code:
add_action( 'wp_enqueue_scripts',
array( &$this, 'load_tracking_script' ), 99 );
The priority of the hook should be changed from 99 to 1:
add_action( 'wp_enqueue_scripts',
array( &$this, 'load_tracking_script' ), 1 );
As stated in the Codex: “Lower numbers correspond with earlier execution”.
I’ll apply the change in the next release of our plugin, so that your changes are kept when updating the plugin.
Let me know if this helped!
Thanks for the quick reply! Am trying NOW
No luck…Had to bring it back priority to 99!
The script disappeared for logged in users!
My bad! Here’s what you have:
add_action( 'wp_enqueue_scripts',
array( &$this, 'register_tracking_script' ) );
add_action( 'wp_enqueue_scripts',
array( &$this, 'load_tracking_script' ), 99 );
And here’s what you should have:
add_action( 'wp_enqueue_scripts',
array( &$this, 'register_tracking_script' ), 1 );
add_action( 'wp_enqueue_scripts',
array( &$this, 'load_tracking_script' ), 1 );
Before loading the script, we need to register it π Try this and let me know if it worked π
Great!!! However, nelio script is ranking fourth.
jquery.js?ver=1.11.3
jquery-migrate.min.js?ver=1.2.1
widget-groups.min.js?ver=2.3.4
6657419267538944.js?ver=4.2.10
Well, that’s normal. jquery and jquery-migrate are required by our script (that’s why they appear before), and 6657419267538944.js is one of our scripts (which is also a requirement of our tracking.min.js).
The only script that could appear after Nelio’s is widget-groups.min.js, but in order to do that, you’ll probably have to edit some other plugin (or your theme). In my opinion, if it’s only one script, it doesn’t really matter.
How are things working now? Is it faster?
Sorry for the late reply but It was around 5am for me and i had stayed all day and night, so I hit the bed after the last upgrade!
Yes true, jquery are essential no complaining π
Before the Nelio move I had already brought speed down by heavily cleaning up the database tables (the was a little frustrating because for many tables it is hard to identify the related script and we would not want to delete a running script table but was able to do so by searching wp-content with regex), there was a lot of deleted plugins left overs, and that significantly reduced the number of request from around 200 to around 50!
Then I also disabled unnecessary plugin from loading on pages when not needed, that did some magic! At this point speed was reduced about 5s.
Then came the Nelio move which gained us around 2s speed, so the speed objective was accomplished.
Thank you very much for your amazing support, well done and best of luck!
I’m glad to hear!
Have a wonderful day (or night)!
And, remember, if there’s anything else I can do for you, just let me know; I’ll be happy to help.