Closed jgraup closed 6 years ago
Hi jgraup, what changes did you make to get the load time down to 0.05s?
I just condensed some of the hooks in the main wp-social-login.php.
Maybe they are there for readability, but you don't need two register_activation_hook( FILE) hooks. Also, the plugin is always going to load if activated and by default it hooks into 'plugin_row_meta' & 'plugin_action_links' - both should only be added if state is_admin and if the user can manage options.
I will say, now my plugin.php load time is up to 8.43 seconds on WPSocial! Rediculous.
Actually I just checked again. Locally I just ran a 13.6 seconds on plugin.php and 17.4 seconds on admin-ajax. Runtime by Plugin is saying 77% going to WPSocial - out of 21 plugins loaded.
You can see the changes here to wp-social-login.php. https://github.com/jgraup/wordpress-social-login/blob/master/wp-social-login.php.
See if this speeds up anything for you.
That's an excellent start, at a very minimum we can prevent the admin being loaded on every AJAX call. I'll submit a pull request for this now.
I've submitted a PR for the AJAX calls now https://github.com/miled/wordpress-social-login/pull/75
Have just done some tests to get a baseline: WordPress 4.1.1 All plugins deactivated Twenty Fifteen theme
No plugin - load time on dashboard 415 ms 412 ms 447 ms 445 ms 411 ms 409 ms 404 ms 401 ms 405 ms 401 ms Average: 415ms
WordPress Social Login activated - load time on dashboard 414 ms 411 ms 415 ms 411 ms 459 ms 456 ms 475 ms 473 ms 463 ms 460 ms Average: 444ms
It seems as though there is only a margin impact on performance from loading the plugin. Could you check with your own setup?
What are you using to get your numbers?
Chrome dev tools - it's rudimentary but gives an indication of actual user load times
Also noticing huge performance hit with 2.2.3.
My site has 37 active plugins and P3 - Plugin Performance Profiler is saying WordPress Social Login contributes to 50-60% of the load time!
Thank you for the 2.3 update. Love the new features!
I tested the plugin performance and I'm super sad to say it has not improved. This is a deal breaker forcing me to use bad alternatives. Please look into the plugin performance. @miled
Running v2.2.3 - P3 on 'auto scan' mode. Which pages can I test to see load impact?
I'm also using 'auto scan' mode.
Here it is when the plugin should be doing absolutely nothing. No networks enabled. All plugin components disabled.
Report date: September 18, 2015 Theme name: Twenty Fifteen Pages browsed: 11 Avg. load time: 2.3444 sec Number of plugins: 36 Plugin impact: 91.32% of load time Avg. plugin time: 2.1410 sec Avg. core time: 0.1576 sec Avg. theme time: 0.0108 sec Avg. mem usage: 99.32 MB Avg. ticks: 51,728 Avg. db queries : 70.27 Margin of error : 0.0351 sec
P3 (Plugin Performance Profiler) - 0.0234 sec - 1.09% Advanced Custom Fields - 0.0251 sec - 1.17% AJAX Thumbnail Rebuild - 0.0017 sec - 0.08% bbPress - 0.1184 sec - 5.53% BuddyPress Live Notification - 0.0021 sec - 0.10% Bp Profile As Homepage - 0.0011 sec - 0.05% Bp Profile Search - 0.0037 sec - 0.17% BuddyBoss Media - 0.0162 sec - 0.75% BuddyBoss Wall - 0.0593 sec - 2.77% BuddyPress Edit Activity - 0.0041 sec - 0.19% Buddypress - 0.2270 sec - 10.60% Bp Custom - 0.0000 sec - 0.00% Bws Buddy Event Connector - 0.0015 sec - 0.07% Admin Columns - 0.0135 sec - 0.63% Convert Post Types - 0.0015 sec - 0.07% Custom Post Type UI - 0.0151 sec - 0.70% Enable Media Replace - 0.0004 sec - 0.02% The Events Calendar PRO - 0.0210 sec - 0.98% Facebook Video Embed - 0.0003 sec - 0.01% Favorites - 0.0200 sec - 0.93% I Order Terms - 0.0022 sec - 0.10% Post Thumbnail Editor - 0.0015 sec - 0.07% Radio Buttons for Taxonomies - 0.0040 sec - 0.19% Search & Filter Pro - 0.0051 sec - 0.24% Set All First Images As Featured - 0.0014 sec - 0.06% SG CachePress - 0.0052 sec - 0.24% The Events Calendar Community Events - 0.0428 sec - 2.00% The Events Calendar - 0.0935 sec - 4.37% User Switching - 0.0107 sec - 0.50% Video Thumbnails - 0.0128 sec - 0.60% WooCommerce Memberships - 0.0509 sec - 2.38% WooCommerce Subscriptions - 0.0677 sec - 3.16% WooCommerce - 0.1158 sec - 5.41% WooThemes Helper - 0.0050 sec - 0.23% Wordpress Seo - 0.1629 sec - 7.61% Wordpress Social Login - 1.0043 sec - 46.91%
Can you try Query Monitor to debug what's clocking up those huge requests? It's a fantastic plugin for seeing where the time is being used. Maybe it's some external network requests that are adding weight.
So I installed Query Monitor, but I don't see any query references to WordPress Social Login, only references in the list of hooks. The queries from other plugins seemed ok and not overly long. My guess is the load is coming from somewhere in the plugin not tracked by WordPress or Query Monitor.
It certainly should be able track the plugin - it actually starts monitoring before the wpdb class is initiated. Ensure that SAVEQUERIES is defined and set to true in wp-config.php
This is on a clean install of WordPress Social Login on the option screen -
Thanks you. I added SAVEQUERIES to wp-config, but it didn't seem to make much difference to what Query Monitor displayed.
Yes, I see wordpress-social-login queries on the WordPress Social Login option screen. I was referring to not seeing it on user facing screens where it might make a performance difference.
Nothing I've seen in Query Monitor seems to answer the problem of why WordPress Social Login is slowing down my site, unfortunately. If it made a difference, I would give you my admin login so you can check it out.
Someone else has reported slow speeds too, so I'm not the only one. https://wordpress.org/support/topic/impact-to-page-speed
I can confirm it's slow. Noticed that some time ago, but had no time to investigate yet.
Worth investigating more @brianrc, sent you an email. ihorvorotnov could you try Query Monitor and see where the performance is lagging?
If anyone is feeling up to it, why not profile individual events and figure out which parts are taking the longest? This is a super basic way to see how long operations take by measuring the time between logs. It's not perfect -- but I've learned a lot about my own theme through this process.
// add these functions to the beginning of /plugins/wordpress-social-login/wp-social-login.php
global $WPL_LOGS;
$WPL_LOGS = array();
function log_wpsl_load($label){
global $WPL_LOGS;
// add log item with timestamp
$WPL_LOGS[] = array( $label, timer_stop() );
}
function get_wpsl_load_log(){
global $WPL_LOGS;
return $WPL_LOGS;
}
function print_wpsl_load_log()
{
global $WPL_LOGS;
// If true, you'll need to see the output in your source
$showAsComment = false;
if($showAsComment) echo PHP_EOL." <!-- ".PHP_EOL;
// show difference between event times
$last = 0;
foreach ($WPL_LOGS as $k => $v){
list($label, $time) = $v;
$WPL_LOGS[$k] = array($label, $time, " + ".($time-$last));
$last = $time;
}
// print all info to screen
echo "<pre>".PHP_EOL;
print_r ( $WPL_LOGS );
echo PHP_EOL."</pre>".PHP_EOL;
// show different between first and last event
if(count($WPL_LOGS) > 1) {
list( $label_1, $time_1 ) = array_shift($WPL_LOGS);
list( $label_2, $time_2 ) = array_pop($WPL_LOGS);
$ttl = $time_2 - $time_1;
echo PHP_EOL."<pre>".PHP_EOL;
print_r("Total Time for WPSL : " . $ttl);
echo PHP_EOL."</pre>";
}
if($showAsComment) echo PHP_EOL." --> ".PHP_EOL;
}
// listen to WordPress shutdown event and print logs
add_action( 'shutdown','print_wpsl_load_log', 10);
Then add logs around the plugin
// add log w/timestamp
log_wpsl_load( "plugin-start:\t" . __FILE__);
log_wpsl_load( "plugin-end:\t" . __FILE__);
The more you add, the more detail you'll get.
<pre>
Array
(
[0] => Array
(
[0] => plugin-start: /plugins/wordpress-social-login/wp-social-login.php
[1] => 0.582
[2] => + 0.582
)
[1] => Array
(
[0] => plugin-end: /plugins/wordpress-social-login/wp-social-login.php
[1] => 0.596
[2] => + 0.014
)
)
</pre>
<pre>
Total Time for WPSL : 0.014
</pre>
No news ?
Same problem here...
Not solved yet ?
With Php7 the plugin is working fine & fast. But is it still active ? Last update was made more than one year ago. I use it for a big website and i'm quite anxious for the future.
As per the conversion on https://wordpress.org/support/topic/takes-50-of-all-plugins-load-time, this plugin is taking quite a while to load compared to other plugins.
Using https://wordpress.org/plugins/p3-profiler/ to track performance, I was able to tweak some things in your initial .php file to go from average 0.5 seconds of load time to 0.05 seconds of load time. But there are other pages which may still take over 4 before your plugin has finished loading.
If I get a change I may try to Fork and do a pull-request. In the meantime, I recommend looking at that profiler just so you can see for yourself how it is stacking up against other times including WP_Core and your own theme.