[wp-trac] [WordPress Trac] #16925: Move the WP_Filesystem_SSH2 class to a plugin

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 5 04:49:20 UTC 2011

#16925: Move the WP_Filesystem_SSH2 class to a plugin
 Reporter:  dd32          |       Owner:  dd32
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  Future Release
Component:  Filesystem    |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |

Comment (by knuthmorris):

 Replying to [comment:6 dd32]:
 > > Also, honestly, I wouldn't even bother with implementing php ssh2
 > Point is, It's already supported and the code written, as well as
 performing the SSH routines in PHP is bound to be slower than those
 implemented in C.

 Not according to this:


 Seriously, you can test this stuff out yourself.  I did so just now.  PHP
 5.3.6, version of phpseclib that's included in the Wordpress plugin, and
 0.11.2.  Here's what I got on three separate trials using the script in
 the above link:

 Trial #1:
 took 5.3246591091156 seconds
 took 7.8901920318604 seconds

 Trial #2:
 took 5.2026791572571 seconds
 took 8.3022320270538 seconds

 Trial #3:
 took 5.1897370815277 seconds
 took 7.1662919521332 seconds

 phpseclib consistently beats php ssh2 hands down.  And there's a fairly
 wide margin too.

 99% of the time the bottle neck in SSH is in how you're uploading data.
 The values you're using for the window size and the SFTP packet size and
 what not.  And programming in C as opposed to PHP isn't going to change

 Maybe you're thinking that the bottle neck in PHP is the encryption.
 Encryption that phpseclib already offloads to mcrypt, if mcrypt is
 installed.  mcrypt being a C extension.  And for stuff like diffie-hellman
 key exchange phpseclib offloads to gmp and then to bcmath if either of
 those are installed.

Ticket URL: <http://core.trac.wordpress.org/ticket/16925#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list