Jump to content
UBot Underground

Uploading a plugin to WP with ubot...I'm stumped


Recommended Posts

I'm building a bot to use with Wordpress and am stumped on how to get past the "install a plugin in .zip format" file selection window. Outside of ubot the window is blank and I can type in the path to the zip file and then hit the install button or just click the window which brings the pop-up that opens the folder that contains the the zip file. Inside of ubot the window has a button in it that says "choose file" and anything I try, type text or change file field, causes the pop up to be activated and that seems to be outside ubot and it's commands.

 

I did get ubot to place the plugin name in the file selection window twice but the next time I ran the bot it activated the pop up or timed out and asked me to please select a file.

 

Any help to be had ? A piece of ubot code that will illustrate what I need to do ?

 

Thanks

John

Link to post
Share on other sites

Yes, if you click on the Browse... button, a File Upload window appears. This is a Windows dialog box, not a HTML form that Ubot can control.

 

Are you doing this to install plugins on many Wordpress websites you own? If so, you may want to take a look at ManageWP where you can control all your sites in one dashboard (including plugins).

Link to post
Share on other sites

Not too sure if this is the kind of thing you are looking for but i just got this script together for you.

You just select the plugin zip file in the ui open file and this will auto populate the correct field without any popups:

 

ui open file("Plugin Zip To Upload", #pluginzip)
navigate("http://yourdomain.com/wp-admin/plugin-install.php?tab=upload", "Wait")
change file field(<name="pluginzip">, #pluginzip)
click(<type="submit">, "Left Click", "No")

 

Hope it helps.

Mark

Link to post
Share on other sites

Mark I'll try your suggestion, I've tried everything else I could think of. I even tried a a partial script that works for someone else I know but the pop up is still dogging me. :angry:

 

ubotusold I actually almost bought your plugin a while back as I do have a lot of sites to manage. I will go back and look again. * not what I thought but will read the sales pitch.

 

Thanks guys :)

Link to post
Share on other sites

Not too sure if this is the kind of thing you are looking for but i just got this script together for you.

You just select the plugin zip file in the ui open file and this will auto populate the correct field without any popups:

 

ui open file("Plugin Zip To Upload", #pluginzip)
navigate("http://yourdomain.com/wp-admin/plugin-install.php?tab=upload", "Wait")
change file field(<name="pluginzip">, #pluginzip)
click(<type="submit">, "Left Click", "No")

 

Hope it helps.

Mark

 

Hi Mark,

 

Do you know if this will work from a list ? I'm trying to put together a bot that will deactivate/delete and then upload a plugin to a list of sites ? The pop up window is the first real hitch I've run into.

Link to post
Share on other sites

John, did you try Marks suggestion?

 

Replace yourdomain string to an actual website you own. Choose the zip file and then run the script. What it will do is take the file you chose in the ui box, and set it in Wordpress' filefield element as if you clicked on Wordpress' choose file button and selected the file.

 

You may be redirected to the wp-login.php page next (as you need to be authenticated by wordpress before you can install a plugin). Add some extra commands to the script to fill in the username and password via type text command, then click on the login button.

 

When you get that part working to the point where it uploads the plugin zip file, then create a text file (mydomains.txt) with one domain per line in the following format:

http://domain1.com/wp-admin/plugin-install.php?tab=upload,adminusername,password
http://domain2.com/wp-admin/plugin-install.php?tab=upload,adminusername,password
http://domain3.com/wp-admin/plugin-install.php?tab=upload.com,adminusername,password
.
.

 

use create table from file which takes a csv file and breaks it up into table cells

 

Then you will be able to work with the table by looping - grab a cell, create the new url string, navigate to url, login and install the plugin for each domain

Link to post
Share on other sites

To work with a list of sites you can use this script:

 

ui open file("Plugin Zip To Upload", #pluginzip)
ui open file("Load Your WP Sites:", #wpsitelist)
clear table(&wpsites)
create table from file(#wpsitelist, &wpsites)
set(#row, 0, "Global")
loop($table total rows(&wpsites)) {
   set(#row0 column0, $table cell(&wpsites, #row, 0), "Global")
   navigate($table cell(&wpsites, $add(#row, 0), 0), "Wait")
   wait for browser event("Everything Loaded", "")
   type text(<username field>, $table cell(&wpsites, #row, 1), "Standard")
   type text(<password field>, $table cell(&wpsites, #row, 2), "Standard")
   click(<login button>, "Left Click", "No")
   wait for browser event("Everything Loaded", "")
   click(<href="plugin-install.php">, "Left Click", "No")
   click(<innertext="Upload">, "Left Click", "No")
   change file field(<name="pluginzip">, #pluginzip)
   click(<type="submit">, "Left Click", "No")
   wait(10)
   click(<login link>, "Left Click", "No")
   increment(#row)
}

 

You have to have your list of sites set up like this:

http://www.firstdomain.com/wp-admin/,adminusername,adminpassword
http://www.seconddomain.com/wp-admin/,adminusername,adminpassword
and so on......

You can use either .txt or .csv files for the site list and it will work.

This will log you into each site, direct you to the upload plugin page, insert the plugin location from the ui open file box and upload the plugin, log you out and then move on to the next site and do the same thing.

 

Hope this helps.

Link to post
Share on other sites

* I altered the http to kill the links in this post.

 

I applied these steps

 

ui open file("Plugin Zip To Upload", #pluginzip)

navigate("htp://yourdomain.com/wp-admin/plugin-install.php?tab=upload", "Wait")

change file field(<name="pluginzip">, #pluginzip)

click(<type="submit">, "Left Click", "No")

 

It worked perfectly once but I haven't been able to repeat that again, it throws the pop up as soon as it reaches "change file field"

 

I did notice on the time it worked that when it got to the navigation step it went to

 

htp://www.yourdomain.com/wp-admin/plugin-install.php?tab=search&type=term&s=&plugin-search-input=Search+Plugins

 

instead of

 

htp://yourdomain.com/wp-admin/plugin-install.php?tab=upload

 

then it stalled for about 20 seconds and completed the upload. I tried that again using the nav module but no go. Any ideas ?

Link to post
Share on other sites

Perhaps you can try to navigate to the upload tab systematically (instead of directly), using button clicks...then start combining steps to see if there is a single step where it is failing...you should not be getting a popup dialog. (I have never used the direct nav to the upload tab and never had that issue, which is why I am suggesting this)

 

 

John

Link to post
Share on other sites

Perhaps you can try to navigate to the upload tab systematically (instead of directly), using button clicks...then start combining steps to see if there is a single step where it is failing...you should not be getting a popup dialog. (I have never used the direct nav to the upload tab and never had that issue, which is why I am suggesting this)

 

 

John

 

Hi,

 

I'm experiencing the same problem. The following used to work without a problem, I didn't use it for several months though, but now I also get a popup (to select a file).

 

define InstallPlugin {
   click(<href="plugins.php">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
   click(<href="plugin-install.php">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
   click(<innertext="Upload">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
   change file field(<name="pluginzip">, "B:\\Sites\\Plugins\\jetpack.1.3.4.zip")
   wait(2)
   click(<value="Install Now">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
   click(<innertext="Activate Plugin">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
}

 

Anyone?

 

Thanks,

Steven

Link to post
Share on other sites

Hi,

 

I'm experiencing the same problem. The following used to work without a problem, I didn't use it for several months though, but now I also get a popup (to select a file).

 

define InstallPlugin {
   click(<href="plugins.php">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
   click(<href="plugin-install.php">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
   click(<innertext="Upload">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
   change file field(<name="pluginzip">, "B:\\Sites\\Plugins\\jetpack.1.3.4.zip")
   wait(2)
   click(<value="Install Now">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
   click(<innertext="Activate Plugin">, "Left Click", "No")
   wait for browser event("Page Loaded", "")
   wait(2)
}

 

Anyone?

 

Thanks,

Steven

 

Bump

Link to post
Share on other sites
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...