boot-cli 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1413) hide show
  1. checksums.yaml +7 -0
  2. data/bin/boot +9 -0
  3. data/lib/Boot/Lib/Commands/Config.rb +28 -0
  4. data/lib/Boot/Lib/Commands/Help.rb +17 -0
  5. data/lib/Boot/Lib/Commands/New.rb +77 -0
  6. data/lib/Boot/Lib/Commands/Template.rb +87 -0
  7. data/lib/Boot/Lib/Commands/Version.rb +15 -0
  8. data/lib/Boot/Lib/Core/Config.rb +84 -0
  9. data/lib/Boot/Lib/Core/InvalidConfigException.rb +4 -0
  10. data/lib/Boot/Lib/Core/InvalidTemplateException.rb +4 -0
  11. data/lib/Boot/Lib/Core/SubCommand.rb +61 -0
  12. data/lib/Boot/Lib/Core/Template.rb +375 -0
  13. data/lib/Boot/Lib/autoload.rb +23 -0
  14. data/lib/boot-default-config.json +1 -0
  15. data/lib/boot.rb +60 -0
  16. data/lib/template.json-schema +144 -0
  17. data/lib/templates/.document +1 -0
  18. data/lib/templates/.gitmodules +3 -0
  19. data/lib/templates/README.md +3 -0
  20. data/lib/templates/c/static/ext/__dummy-file__ +0 -0
  21. data/lib/templates/c/static/src/main.c +0 -0
  22. data/lib/templates/c/template.json +24 -0
  23. data/lib/templates/gitignores/Actionscript.gitignore +11 -0
  24. data/lib/templates/gitignores/Ada.gitignore +5 -0
  25. data/lib/templates/gitignores/Agda.gitignore +1 -0
  26. data/lib/templates/gitignores/Android.gitignore +27 -0
  27. data/lib/templates/gitignores/AppEngine.gitignore +2 -0
  28. data/lib/templates/gitignores/AppceleratorTitanium.gitignore +3 -0
  29. data/lib/templates/gitignores/ArchLinuxPackages.gitignore +14 -0
  30. data/lib/templates/gitignores/Autotools.gitignore +14 -0
  31. data/lib/templates/gitignores/C++.gitignore +28 -0
  32. data/lib/templates/gitignores/C.gitignore +32 -0
  33. data/lib/templates/gitignores/CFWheels.gitignore +12 -0
  34. data/lib/templates/gitignores/CMake.gitignore +5 -0
  35. data/lib/templates/gitignores/CONTRIBUTING.md +34 -0
  36. data/lib/templates/gitignores/CUDA.gitignore +6 -0
  37. data/lib/templates/gitignores/CakePHP.gitignore +13 -0
  38. data/lib/templates/gitignores/ChefCookbook.gitignore +9 -0
  39. data/lib/templates/gitignores/Clojure.gitignore +12 -0
  40. data/lib/templates/gitignores/CodeIgniter.gitignore +6 -0
  41. data/lib/templates/gitignores/CommonLisp.gitignore +3 -0
  42. data/lib/templates/gitignores/Composer.gitignore +6 -0
  43. data/lib/templates/gitignores/Concrete5.gitignore +3 -0
  44. data/lib/templates/gitignores/Coq.gitignore +3 -0
  45. data/lib/templates/gitignores/CraftCMS.gitignore +3 -0
  46. data/lib/templates/gitignores/DM.gitignore +5 -0
  47. data/lib/templates/gitignores/Dart.gitignore +14 -0
  48. data/lib/templates/gitignores/Delphi.gitignore +57 -0
  49. data/lib/templates/gitignores/Drupal.gitignore +36 -0
  50. data/lib/templates/gitignores/EPiServer.gitignore +4 -0
  51. data/lib/templates/gitignores/Eagle.gitignore +36 -0
  52. data/lib/templates/gitignores/Elisp.gitignore +5 -0
  53. data/lib/templates/gitignores/Elixir.gitignore +4 -0
  54. data/lib/templates/gitignores/Erlang.gitignore +10 -0
  55. data/lib/templates/gitignores/ExpressionEngine.gitignore +19 -0
  56. data/lib/templates/gitignores/ExtJs.gitignore +4 -0
  57. data/lib/templates/gitignores/Fancy.gitignore +2 -0
  58. data/lib/templates/gitignores/Finale.gitignore +13 -0
  59. data/lib/templates/gitignores/ForceDotCom.gitignore +4 -0
  60. data/lib/templates/gitignores/Fortran.gitignore +28 -0
  61. data/lib/templates/gitignores/FuelPHP.gitignore +2 -0
  62. data/lib/templates/gitignores/GWT.gitignore +28 -0
  63. data/lib/templates/gitignores/Gcov.gitignore +5 -0
  64. data/lib/templates/gitignores/GitBook.gitignore +16 -0
  65. data/lib/templates/gitignores/Global/Anjuta.gitignore +3 -0
  66. data/lib/templates/gitignores/Global/Archives.gitignore +27 -0
  67. data/lib/templates/gitignores/Global/BricxCC.gitignore +4 -0
  68. data/lib/templates/gitignores/Global/CVS.gitignore +4 -0
  69. data/lib/templates/gitignores/Global/Cloud9.gitignore +3 -0
  70. data/lib/templates/gitignores/Global/CodeKit.gitignore +3 -0
  71. data/lib/templates/gitignores/Global/DartEditor.gitignore +2 -0
  72. data/lib/templates/gitignores/Global/Dreamweaver.gitignore +3 -0
  73. data/lib/templates/gitignores/Global/Eclipse.gitignore +36 -0
  74. data/lib/templates/gitignores/Global/EiffelStudio.gitignore +2 -0
  75. data/lib/templates/gitignores/Global/Emacs.gitignore +32 -0
  76. data/lib/templates/gitignores/Global/Ensime.gitignore +4 -0
  77. data/lib/templates/gitignores/Global/Espresso.gitignore +1 -0
  78. data/lib/templates/gitignores/Global/FlexBuilder.gitignore +3 -0
  79. data/lib/templates/gitignores/Global/IPythonNotebook.gitignore +2 -0
  80. data/lib/templates/gitignores/Global/JDeveloper.gitignore +13 -0
  81. data/lib/templates/gitignores/Global/JetBrains.gitignore +46 -0
  82. data/lib/templates/gitignores/Global/KDevelop4.gitignore +2 -0
  83. data/lib/templates/gitignores/Global/Kate.gitignore +3 -0
  84. data/lib/templates/gitignores/Global/Lazarus.gitignore +15 -0
  85. data/lib/templates/gitignores/Global/LibreOffice.gitignore +2 -0
  86. data/lib/templates/gitignores/Global/Linux.gitignore +7 -0
  87. data/lib/templates/gitignores/Global/LyX.gitignore +4 -0
  88. data/lib/templates/gitignores/Global/Matlab.gitignore +16 -0
  89. data/lib/templates/gitignores/Global/Mercurial.gitignore +3 -0
  90. data/lib/templates/gitignores/Global/MicrosoftOffice.gitignore +10 -0
  91. data/lib/templates/gitignores/Global/ModelSim.gitignore +23 -0
  92. data/lib/templates/gitignores/Global/Momentics.gitignore +8 -0
  93. data/lib/templates/gitignores/Global/MonoDevelop.gitignore +8 -0
  94. data/lib/templates/gitignores/Global/NetBeans.gitignore +8 -0
  95. data/lib/templates/gitignores/Global/Ninja.gitignore +2 -0
  96. data/lib/templates/gitignores/Global/NotepadPP.gitignore +2 -0
  97. data/lib/templates/gitignores/Global/OSX.gitignore +24 -0
  98. data/lib/templates/gitignores/Global/README.md +10 -0
  99. data/lib/templates/gitignores/Global/Redcar.gitignore +1 -0
  100. data/lib/templates/gitignores/Global/Redis.gitignore +3 -0
  101. data/lib/templates/gitignores/Global/SBT.gitignore +9 -0
  102. data/lib/templates/gitignores/Global/SVN.gitignore +1 -0
  103. data/lib/templates/gitignores/Global/SlickEdit.gitignore +11 -0
  104. data/lib/templates/gitignores/Global/SublimeText.gitignore +14 -0
  105. data/lib/templates/gitignores/Global/SynopsysVCS.gitignore +23 -0
  106. data/lib/templates/gitignores/Global/Tags.gitignore +14 -0
  107. data/lib/templates/gitignores/Global/TextMate.gitignore +3 -0
  108. data/lib/templates/gitignores/Global/TortoiseGit.gitignore +2 -0
  109. data/lib/templates/gitignores/Global/Vagrant.gitignore +1 -0
  110. data/lib/templates/gitignores/Global/Vim.gitignore +6 -0
  111. data/lib/templates/gitignores/Global/VirtualEnv.gitignore +9 -0
  112. data/lib/templates/gitignores/Global/WebMethods.gitignore +14 -0
  113. data/lib/templates/gitignores/Global/Windows.gitignore +18 -0
  114. data/lib/templates/gitignores/Global/Xcode.gitignore +14 -0
  115. data/lib/templates/gitignores/Global/XilinxISE.gitignore +57 -0
  116. data/lib/templates/gitignores/Go.gitignore +24 -0
  117. data/lib/templates/gitignores/Gradle.gitignore +8 -0
  118. data/lib/templates/gitignores/Grails.gitignore +33 -0
  119. data/lib/templates/gitignores/Haskell.gitignore +16 -0
  120. data/lib/templates/gitignores/IGORPro.gitignore +5 -0
  121. data/lib/templates/gitignores/Idris.gitignore +2 -0
  122. data/lib/templates/gitignores/Java.gitignore +12 -0
  123. data/lib/templates/gitignores/Jboss.gitignore +19 -0
  124. data/lib/templates/gitignores/Jekyll.gitignore +3 -0
  125. data/lib/templates/gitignores/Joomla.gitignore +525 -0
  126. data/lib/templates/gitignores/Jython.gitignore +2 -0
  127. data/lib/templates/gitignores/KiCAD.gitignore +11 -0
  128. data/lib/templates/gitignores/Kohana.gitignore +2 -0
  129. data/lib/templates/gitignores/LICENSE +19 -0
  130. data/lib/templates/gitignores/LabVIEW.gitignore +16 -0
  131. data/lib/templates/gitignores/Laravel.gitignore +4 -0
  132. data/lib/templates/gitignores/Leiningen.gitignore +12 -0
  133. data/lib/templates/gitignores/LemonStand.gitignore +21 -0
  134. data/lib/templates/gitignores/Lilypond.gitignore +6 -0
  135. data/lib/templates/gitignores/Lithium.gitignore +2 -0
  136. data/lib/templates/gitignores/Lua.gitignore +41 -0
  137. data/lib/templates/gitignores/Magento.gitignore +126 -0
  138. data/lib/templates/gitignores/Maven.gitignore +9 -0
  139. data/lib/templates/gitignores/Mercury.gitignore +13 -0
  140. data/lib/templates/gitignores/MetaProgrammingSystem.gitignore +16 -0
  141. data/lib/templates/gitignores/Meteor.gitignore +2 -0
  142. data/lib/templates/gitignores/Nanoc.gitignore +10 -0
  143. data/lib/templates/gitignores/Nim.gitignore +1 -0
  144. data/lib/templates/gitignores/Node.gitignore +27 -0
  145. data/lib/templates/gitignores/OCaml.gitignore +20 -0
  146. data/lib/templates/gitignores/Objective-C.gitignore +26 -0
  147. data/lib/templates/gitignores/Opa.gitignore +13 -0
  148. data/lib/templates/gitignores/OpenCart.gitignore +11 -0
  149. data/lib/templates/gitignores/OracleForms.gitignore +8 -0
  150. data/lib/templates/gitignores/Packer.gitignore +5 -0
  151. data/lib/templates/gitignores/Perl.gitignore +20 -0
  152. data/lib/templates/gitignores/Phalcon.gitignore +2 -0
  153. data/lib/templates/gitignores/PlayFramework.gitignore +17 -0
  154. data/lib/templates/gitignores/Plone.gitignore +18 -0
  155. data/lib/templates/gitignores/Prestashop.gitignore +25 -0
  156. data/lib/templates/gitignores/Processing.gitignore +7 -0
  157. data/lib/templates/gitignores/Python.gitignore +57 -0
  158. data/lib/templates/gitignores/Qooxdoo.gitignore +5 -0
  159. data/lib/templates/gitignores/Qt.gitignore +34 -0
  160. data/lib/templates/gitignores/R.gitignore +13 -0
  161. data/lib/templates/gitignores/README.md +79 -0
  162. data/lib/templates/gitignores/ROS.gitignore +47 -0
  163. data/lib/templates/gitignores/Rails.gitignore +35 -0
  164. data/lib/templates/gitignores/RhodesRhomobile.gitignore +9 -0
  165. data/lib/templates/gitignores/Ruby.gitignore +35 -0
  166. data/lib/templates/gitignores/Rust.gitignore +11 -0
  167. data/lib/templates/gitignores/SCons.gitignore +2 -0
  168. data/lib/templates/gitignores/Sass.gitignore +2 -0
  169. data/lib/templates/gitignores/Scala.gitignore +17 -0
  170. data/lib/templates/gitignores/Scrivener.gitignore +7 -0
  171. data/lib/templates/gitignores/Sdcc.gitignore +8 -0
  172. data/lib/templates/gitignores/SeamGen.gitignore +26 -0
  173. data/lib/templates/gitignores/SketchUp.gitignore +1 -0
  174. data/lib/templates/gitignores/Stella.gitignore +12 -0
  175. data/lib/templates/gitignores/SugarCRM.gitignore +25 -0
  176. data/lib/templates/gitignores/Swift.gitignore +33 -0
  177. data/lib/templates/gitignores/Symfony.gitignore +37 -0
  178. data/lib/templates/gitignores/SymphonyCMS.gitignore +6 -0
  179. data/lib/templates/gitignores/TeX.gitignore +126 -0
  180. data/lib/templates/gitignores/Textpattern.gitignore +11 -0
  181. data/lib/templates/gitignores/TurboGears2.gitignore +20 -0
  182. data/lib/templates/gitignores/Typo3.gitignore +18 -0
  183. data/lib/templates/gitignores/Umbraco.gitignore +17 -0
  184. data/lib/templates/gitignores/Unity.gitignore +21 -0
  185. data/lib/templates/gitignores/VVVV.gitignore +6 -0
  186. data/lib/templates/gitignores/VisualStudio.gitignore +196 -0
  187. data/lib/templates/gitignores/Waf.gitignore +3 -0
  188. data/lib/templates/gitignores/WordPress.gitignore +13 -0
  189. data/lib/templates/gitignores/Xojo.gitignore +11 -0
  190. data/lib/templates/gitignores/Yeoman.gitignore +6 -0
  191. data/lib/templates/gitignores/Yii.gitignore +6 -0
  192. data/lib/templates/gitignores/ZendFramework.gitignore +20 -0
  193. data/lib/templates/gitignores/Zephir.gitignore +26 -0
  194. data/lib/templates/templates/boot-template/static/static/___dummy-file___ +1 -0
  195. data/lib/templates/templates/boot-template/static/template.json +7 -0
  196. data/lib/templates/templates/boot-template/template.json +17 -0
  197. data/lib/templates/templates/c/builder/makefile +12 -0
  198. data/lib/templates/templates/c/builder/makefile-pch +12 -0
  199. data/lib/templates/templates/c/misc/main.h +1 -0
  200. data/lib/templates/templates/c/static/lib/___dummy-file___ +1 -0
  201. data/lib/templates/templates/c/static/src/main.c +4 -0
  202. data/lib/templates/templates/c/template.json +32 -0
  203. data/lib/templates/templates/c/vcs/.gitignore +1 -0
  204. data/lib/templates/templates/c/vcs/.svnignore +1 -0
  205. data/lib/templates/templates/gem/Gemfile +3 -0
  206. data/lib/templates/templates/gem/gemname-git.gemspec +13 -0
  207. data/lib/templates/templates/gem/static/[[!gemname]].gemspec +13 -0
  208. data/lib/templates/templates/gem/static/bin/[[!gemname]] +1 -0
  209. data/lib/templates/templates/gem/static/lib/[[!gemname]].rb +0 -0
  210. data/lib/templates/templates/gem/static/test/test_helper.rb +0 -0
  211. data/lib/templates/templates/gem/template.json +33 -0
  212. data/lib/templates/templates/wordpress-plugin/static/wp-content/plugins/[[!plugin-name]]/[[!plugin-name]].php +11 -0
  213. data/lib/templates/templates/wordpress-plugin/template.json +26 -0
  214. data/lib/templates/templates/wordpress-plugin/vcs/git/gitignore.gitignore +1 -0
  215. data/lib/templates/templates/wordpress-theme/static/wp-content/themes/[[!theme-name]]/index.php +1 -0
  216. data/lib/templates/templates/wordpress-theme/static/wp-content/themes/[[!theme-name]]/style.css +12 -0
  217. data/lib/templates/templates/wordpress-theme/template.json +26 -0
  218. data/lib/templates/templates/wordpress-theme/vcs/git/gitignore.gitignore +1 -0
  219. data/lib/templates/wordpress/index.php +17 -0
  220. data/lib/templates/wordpress/license.txt +385 -0
  221. data/lib/templates/wordpress/readme.html +98 -0
  222. data/lib/templates/wordpress/wp-activate.php +131 -0
  223. data/lib/templates/wordpress/wp-admin/about.php +166 -0
  224. data/lib/templates/wordpress/wp-admin/admin-ajax.php +99 -0
  225. data/lib/templates/wordpress/wp-admin/admin-footer.php +99 -0
  226. data/lib/templates/wordpress/wp-admin/admin-functions.php +15 -0
  227. data/lib/templates/wordpress/wp-admin/admin-header.php +249 -0
  228. data/lib/templates/wordpress/wp-admin/admin-post.php +71 -0
  229. data/lib/templates/wordpress/wp-admin/admin.php +361 -0
  230. data/lib/templates/wordpress/wp-admin/async-upload.php +115 -0
  231. data/lib/templates/wordpress/wp-admin/comment.php +330 -0
  232. data/lib/templates/wordpress/wp-admin/credits.php +192 -0
  233. data/lib/templates/wordpress/wp-admin/css/about-rtl.css +454 -0
  234. data/lib/templates/wordpress/wp-admin/css/about.css +454 -0
  235. data/lib/templates/wordpress/wp-admin/css/admin-menu-rtl.css +935 -0
  236. data/lib/templates/wordpress/wp-admin/css/admin-menu.css +935 -0
  237. data/lib/templates/wordpress/wp-admin/css/color-picker-rtl.css +127 -0
  238. data/lib/templates/wordpress/wp-admin/css/color-picker-rtl.min.css +1 -0
  239. data/lib/templates/wordpress/wp-admin/css/color-picker.css +127 -0
  240. data/lib/templates/wordpress/wp-admin/css/color-picker.min.css +1 -0
  241. data/lib/templates/wordpress/wp-admin/css/colors/_admin.scss +521 -0
  242. data/lib/templates/wordpress/wp-admin/css/colors/_mixins.scss +43 -0
  243. data/lib/templates/wordpress/wp-admin/css/colors/_variables.scss +58 -0
  244. data/lib/templates/wordpress/wp-admin/css/colors/blue/colors-rtl.css +330 -0
  245. data/lib/templates/wordpress/wp-admin/css/colors/blue/colors-rtl.min.css +1 -0
  246. data/lib/templates/wordpress/wp-admin/css/colors/blue/colors.css +330 -0
  247. data/lib/templates/wordpress/wp-admin/css/colors/blue/colors.min.css +1 -0
  248. data/lib/templates/wordpress/wp-admin/css/colors/blue/colors.scss +11 -0
  249. data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors-rtl.css +330 -0
  250. data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors-rtl.min.css +1 -0
  251. data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors.css +330 -0
  252. data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors.min.css +1 -0
  253. data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors.scss +7 -0
  254. data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors-rtl.css +330 -0
  255. data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors-rtl.min.css +1 -0
  256. data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors.css +330 -0
  257. data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors.min.css +1 -0
  258. data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors.scss +8 -0
  259. data/lib/templates/wordpress/wp-admin/css/colors/light/colors-rtl.css +338 -0
  260. data/lib/templates/wordpress/wp-admin/css/colors/light/colors-rtl.min.css +1 -0
  261. data/lib/templates/wordpress/wp-admin/css/colors/light/colors.css +338 -0
  262. data/lib/templates/wordpress/wp-admin/css/colors/light/colors.min.css +1 -0
  263. data/lib/templates/wordpress/wp-admin/css/colors/light/colors.scss +38 -0
  264. data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors-rtl.css +330 -0
  265. data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors-rtl.min.css +1 -0
  266. data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors.css +330 -0
  267. data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors.min.css +1 -0
  268. data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors.scss +5 -0
  269. data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors-rtl.css +330 -0
  270. data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors-rtl.min.css +1 -0
  271. data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors.css +330 -0
  272. data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors.min.css +1 -0
  273. data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors.scss +8 -0
  274. data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors-rtl.css +330 -0
  275. data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors-rtl.min.css +1 -0
  276. data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors.css +330 -0
  277. data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors.min.css +1 -0
  278. data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors.scss +6 -0
  279. data/lib/templates/wordpress/wp-admin/css/common-rtl.css +3289 -0
  280. data/lib/templates/wordpress/wp-admin/css/common.css +3289 -0
  281. data/lib/templates/wordpress/wp-admin/css/customize-controls-rtl.css +1191 -0
  282. data/lib/templates/wordpress/wp-admin/css/customize-controls-rtl.min.css +1 -0
  283. data/lib/templates/wordpress/wp-admin/css/customize-controls.css +1191 -0
  284. data/lib/templates/wordpress/wp-admin/css/customize-controls.min.css +1 -0
  285. data/lib/templates/wordpress/wp-admin/css/customize-widgets-rtl.css +636 -0
  286. data/lib/templates/wordpress/wp-admin/css/customize-widgets-rtl.min.css +1 -0
  287. data/lib/templates/wordpress/wp-admin/css/customize-widgets.css +636 -0
  288. data/lib/templates/wordpress/wp-admin/css/customize-widgets.min.css +1 -0
  289. data/lib/templates/wordpress/wp-admin/css/dashboard-rtl.css +1111 -0
  290. data/lib/templates/wordpress/wp-admin/css/dashboard.css +1111 -0
  291. data/lib/templates/wordpress/wp-admin/css/deprecated-media-rtl.css +407 -0
  292. data/lib/templates/wordpress/wp-admin/css/deprecated-media-rtl.min.css +1 -0
  293. data/lib/templates/wordpress/wp-admin/css/deprecated-media.css +407 -0
  294. data/lib/templates/wordpress/wp-admin/css/deprecated-media.min.css +1 -0
  295. data/lib/templates/wordpress/wp-admin/css/edit-rtl.css +1589 -0
  296. data/lib/templates/wordpress/wp-admin/css/edit.css +1589 -0
  297. data/lib/templates/wordpress/wp-admin/css/farbtastic-rtl.css +41 -0
  298. data/lib/templates/wordpress/wp-admin/css/farbtastic.css +41 -0
  299. data/lib/templates/wordpress/wp-admin/css/forms-rtl.css +1175 -0
  300. data/lib/templates/wordpress/wp-admin/css/forms.css +1175 -0
  301. data/lib/templates/wordpress/wp-admin/css/ie-rtl.css +785 -0
  302. data/lib/templates/wordpress/wp-admin/css/ie-rtl.min.css +1 -0
  303. data/lib/templates/wordpress/wp-admin/css/ie.css +785 -0
  304. data/lib/templates/wordpress/wp-admin/css/ie.min.css +1 -0
  305. data/lib/templates/wordpress/wp-admin/css/install-rtl.css +388 -0
  306. data/lib/templates/wordpress/wp-admin/css/install-rtl.min.css +1 -0
  307. data/lib/templates/wordpress/wp-admin/css/install.css +388 -0
  308. data/lib/templates/wordpress/wp-admin/css/install.min.css +1 -0
  309. data/lib/templates/wordpress/wp-admin/css/l10n-rtl.css +111 -0
  310. data/lib/templates/wordpress/wp-admin/css/l10n.css +111 -0
  311. data/lib/templates/wordpress/wp-admin/css/list-tables-rtl.css +1925 -0
  312. data/lib/templates/wordpress/wp-admin/css/list-tables.css +1925 -0
  313. data/lib/templates/wordpress/wp-admin/css/login-rtl.css +265 -0
  314. data/lib/templates/wordpress/wp-admin/css/login-rtl.min.css +1 -0
  315. data/lib/templates/wordpress/wp-admin/css/login.css +265 -0
  316. data/lib/templates/wordpress/wp-admin/css/login.min.css +1 -0
  317. data/lib/templates/wordpress/wp-admin/css/media-rtl.css +1193 -0
  318. data/lib/templates/wordpress/wp-admin/css/media.css +1193 -0
  319. data/lib/templates/wordpress/wp-admin/css/nav-menus-rtl.css +865 -0
  320. data/lib/templates/wordpress/wp-admin/css/nav-menus.css +865 -0
  321. data/lib/templates/wordpress/wp-admin/css/press-this-editor-rtl.css +123 -0
  322. data/lib/templates/wordpress/wp-admin/css/press-this-editor.css +123 -0
  323. data/lib/templates/wordpress/wp-admin/css/press-this-rtl.css +2039 -0
  324. data/lib/templates/wordpress/wp-admin/css/press-this-rtl.min.css +1 -0
  325. data/lib/templates/wordpress/wp-admin/css/press-this.css +2039 -0
  326. data/lib/templates/wordpress/wp-admin/css/press-this.min.css +1 -0
  327. data/lib/templates/wordpress/wp-admin/css/revisions-rtl.css +575 -0
  328. data/lib/templates/wordpress/wp-admin/css/revisions.css +575 -0
  329. data/lib/templates/wordpress/wp-admin/css/themes-rtl.css +1760 -0
  330. data/lib/templates/wordpress/wp-admin/css/themes.css +1760 -0
  331. data/lib/templates/wordpress/wp-admin/css/widgets-rtl.css +579 -0
  332. data/lib/templates/wordpress/wp-admin/css/widgets.css +579 -0
  333. data/lib/templates/wordpress/wp-admin/css/wp-admin-rtl.css +13 -0
  334. data/lib/templates/wordpress/wp-admin/css/wp-admin-rtl.min.css +8 -0
  335. data/lib/templates/wordpress/wp-admin/css/wp-admin.css +13 -0
  336. data/lib/templates/wordpress/wp-admin/css/wp-admin.min.css +8 -0
  337. data/lib/templates/wordpress/wp-admin/custom-background.php +472 -0
  338. data/lib/templates/wordpress/wp-admin/custom-header.php +1303 -0
  339. data/lib/templates/wordpress/wp-admin/customize.php +300 -0
  340. data/lib/templates/wordpress/wp-admin/edit-comments.php +254 -0
  341. data/lib/templates/wordpress/wp-admin/edit-form-advanced.php +668 -0
  342. data/lib/templates/wordpress/wp-admin/edit-form-comment.php +189 -0
  343. data/lib/templates/wordpress/wp-admin/edit-link-form.php +150 -0
  344. data/lib/templates/wordpress/wp-admin/edit-tag-form.php +228 -0
  345. data/lib/templates/wordpress/wp-admin/edit-tags.php +603 -0
  346. data/lib/templates/wordpress/wp-admin/edit.php +338 -0
  347. data/lib/templates/wordpress/wp-admin/export.php +242 -0
  348. data/lib/templates/wordpress/wp-admin/freedoms.php +57 -0
  349. data/lib/templates/wordpress/wp-admin/images/align-center-2x.png +0 -0
  350. data/lib/templates/wordpress/wp-admin/images/align-center.png +0 -0
  351. data/lib/templates/wordpress/wp-admin/images/align-left-2x.png +0 -0
  352. data/lib/templates/wordpress/wp-admin/images/align-left.png +0 -0
  353. data/lib/templates/wordpress/wp-admin/images/align-none-2x.png +0 -0
  354. data/lib/templates/wordpress/wp-admin/images/align-none.png +0 -0
  355. data/lib/templates/wordpress/wp-admin/images/align-right-2x.png +0 -0
  356. data/lib/templates/wordpress/wp-admin/images/align-right.png +0 -0
  357. data/lib/templates/wordpress/wp-admin/images/arrows-2x.png +0 -0
  358. data/lib/templates/wordpress/wp-admin/images/arrows.png +0 -0
  359. data/lib/templates/wordpress/wp-admin/images/bubble_bg-2x.gif +0 -0
  360. data/lib/templates/wordpress/wp-admin/images/bubble_bg.gif +0 -0
  361. data/lib/templates/wordpress/wp-admin/images/comment-grey-bubble-2x.png +0 -0
  362. data/lib/templates/wordpress/wp-admin/images/comment-grey-bubble.png +0 -0
  363. data/lib/templates/wordpress/wp-admin/images/date-button-2x.gif +0 -0
  364. data/lib/templates/wordpress/wp-admin/images/date-button.gif +0 -0
  365. data/lib/templates/wordpress/wp-admin/images/generic.png +0 -0
  366. data/lib/templates/wordpress/wp-admin/images/icons32-2x.png +0 -0
  367. data/lib/templates/wordpress/wp-admin/images/icons32-vs-2x.png +0 -0
  368. data/lib/templates/wordpress/wp-admin/images/icons32-vs.png +0 -0
  369. data/lib/templates/wordpress/wp-admin/images/icons32.png +0 -0
  370. data/lib/templates/wordpress/wp-admin/images/imgedit-icons-2x.png +0 -0
  371. data/lib/templates/wordpress/wp-admin/images/imgedit-icons.png +0 -0
  372. data/lib/templates/wordpress/wp-admin/images/list-2x.png +0 -0
  373. data/lib/templates/wordpress/wp-admin/images/list.png +0 -0
  374. data/lib/templates/wordpress/wp-admin/images/loading.gif +0 -0
  375. data/lib/templates/wordpress/wp-admin/images/marker.png +0 -0
  376. data/lib/templates/wordpress/wp-admin/images/mask.png +0 -0
  377. data/lib/templates/wordpress/wp-admin/images/media-button-2x.png +0 -0
  378. data/lib/templates/wordpress/wp-admin/images/media-button-image.gif +0 -0
  379. data/lib/templates/wordpress/wp-admin/images/media-button-music.gif +0 -0
  380. data/lib/templates/wordpress/wp-admin/images/media-button-other.gif +0 -0
  381. data/lib/templates/wordpress/wp-admin/images/media-button-video.gif +0 -0
  382. data/lib/templates/wordpress/wp-admin/images/media-button.png +0 -0
  383. data/lib/templates/wordpress/wp-admin/images/menu-2x.png +0 -0
  384. data/lib/templates/wordpress/wp-admin/images/menu-vs-2x.png +0 -0
  385. data/lib/templates/wordpress/wp-admin/images/menu-vs.png +0 -0
  386. data/lib/templates/wordpress/wp-admin/images/menu.png +0 -0
  387. data/lib/templates/wordpress/wp-admin/images/no.png +0 -0
  388. data/lib/templates/wordpress/wp-admin/images/post-formats-vs.png +0 -0
  389. data/lib/templates/wordpress/wp-admin/images/post-formats.png +0 -0
  390. data/lib/templates/wordpress/wp-admin/images/post-formats32-vs.png +0 -0
  391. data/lib/templates/wordpress/wp-admin/images/post-formats32.png +0 -0
  392. data/lib/templates/wordpress/wp-admin/images/resize-2x.gif +0 -0
  393. data/lib/templates/wordpress/wp-admin/images/resize-rtl-2x.gif +0 -0
  394. data/lib/templates/wordpress/wp-admin/images/resize-rtl.gif +0 -0
  395. data/lib/templates/wordpress/wp-admin/images/resize.gif +0 -0
  396. data/lib/templates/wordpress/wp-admin/images/se.png +0 -0
  397. data/lib/templates/wordpress/wp-admin/images/sort-2x.gif +0 -0
  398. data/lib/templates/wordpress/wp-admin/images/sort.gif +0 -0
  399. data/lib/templates/wordpress/wp-admin/images/spinner-2x.gif +0 -0
  400. data/lib/templates/wordpress/wp-admin/images/spinner.gif +0 -0
  401. data/lib/templates/wordpress/wp-admin/images/stars-2x.png +0 -0
  402. data/lib/templates/wordpress/wp-admin/images/stars.png +0 -0
  403. data/lib/templates/wordpress/wp-admin/images/w-logo-blue.png +0 -0
  404. data/lib/templates/wordpress/wp-admin/images/w-logo-white.png +0 -0
  405. data/lib/templates/wordpress/wp-admin/images/wheel.png +0 -0
  406. data/lib/templates/wordpress/wp-admin/images/wordpress-logo-white.svg +1 -0
  407. data/lib/templates/wordpress/wp-admin/images/wordpress-logo.png +0 -0
  408. data/lib/templates/wordpress/wp-admin/images/wordpress-logo.svg +1 -0
  409. data/lib/templates/wordpress/wp-admin/images/wpspin_light-2x.gif +0 -0
  410. data/lib/templates/wordpress/wp-admin/images/wpspin_light.gif +0 -0
  411. data/lib/templates/wordpress/wp-admin/images/xit-2x.gif +0 -0
  412. data/lib/templates/wordpress/wp-admin/images/xit.gif +0 -0
  413. data/lib/templates/wordpress/wp-admin/images/yes.png +0 -0
  414. data/lib/templates/wordpress/wp-admin/import.php +130 -0
  415. data/lib/templates/wordpress/wp-admin/includes/admin.php +74 -0
  416. data/lib/templates/wordpress/wp-admin/includes/ajax-actions.php +2973 -0
  417. data/lib/templates/wordpress/wp-admin/includes/bookmark.php +305 -0
  418. data/lib/templates/wordpress/wp-admin/includes/class-ftp-pure.php +190 -0
  419. data/lib/templates/wordpress/wp-admin/includes/class-ftp-sockets.php +250 -0
  420. data/lib/templates/wordpress/wp-admin/includes/class-ftp.php +906 -0
  421. data/lib/templates/wordpress/wp-admin/includes/class-pclzip.php +5687 -0
  422. data/lib/templates/wordpress/wp-admin/includes/class-wp-comments-list-table.php +643 -0
  423. data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-base.php +766 -0
  424. data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-direct.php +463 -0
  425. data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php +513 -0
  426. data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-ftpsockets.php +446 -0
  427. data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php +505 -0
  428. data/lib/templates/wordpress/wp-admin/includes/class-wp-importer.php +301 -0
  429. data/lib/templates/wordpress/wp-admin/includes/class-wp-links-list-table.php +208 -0
  430. data/lib/templates/wordpress/wp-admin/includes/class-wp-list-table.php +1141 -0
  431. data/lib/templates/wordpress/wp-admin/includes/class-wp-media-list-table.php +556 -0
  432. data/lib/templates/wordpress/wp-admin/includes/class-wp-ms-sites-list-table.php +404 -0
  433. data/lib/templates/wordpress/wp-admin/includes/class-wp-ms-themes-list-table.php +480 -0
  434. data/lib/templates/wordpress/wp-admin/includes/class-wp-ms-users-list-table.php +306 -0
  435. data/lib/templates/wordpress/wp-admin/includes/class-wp-plugin-install-list-table.php +515 -0
  436. data/lib/templates/wordpress/wp-admin/includes/class-wp-plugins-list-table.php +648 -0
  437. data/lib/templates/wordpress/wp-admin/includes/class-wp-posts-list-table.php +1416 -0
  438. data/lib/templates/wordpress/wp-admin/includes/class-wp-press-this.php +1466 -0
  439. data/lib/templates/wordpress/wp-admin/includes/class-wp-terms-list-table.php +513 -0
  440. data/lib/templates/wordpress/wp-admin/includes/class-wp-theme-install-list-table.php +431 -0
  441. data/lib/templates/wordpress/wp-admin/includes/class-wp-themes-list-table.php +285 -0
  442. data/lib/templates/wordpress/wp-admin/includes/class-wp-upgrader-skins.php +783 -0
  443. data/lib/templates/wordpress/wp-admin/includes/class-wp-upgrader.php +3254 -0
  444. data/lib/templates/wordpress/wp-admin/includes/class-wp-users-list-table.php +460 -0
  445. data/lib/templates/wordpress/wp-admin/includes/comment.php +173 -0
  446. data/lib/templates/wordpress/wp-admin/includes/continents-cities.php +493 -0
  447. data/lib/templates/wordpress/wp-admin/includes/dashboard.php +1341 -0
  448. data/lib/templates/wordpress/wp-admin/includes/deprecated.php +1183 -0
  449. data/lib/templates/wordpress/wp-admin/includes/export.php +510 -0
  450. data/lib/templates/wordpress/wp-admin/includes/file.php +1229 -0
  451. data/lib/templates/wordpress/wp-admin/includes/image-edit.php +861 -0
  452. data/lib/templates/wordpress/wp-admin/includes/image.php +600 -0
  453. data/lib/templates/wordpress/wp-admin/includes/import.php +204 -0
  454. data/lib/templates/wordpress/wp-admin/includes/list-table.php +113 -0
  455. data/lib/templates/wordpress/wp-admin/includes/media.php +3083 -0
  456. data/lib/templates/wordpress/wp-admin/includes/menu.php +322 -0
  457. data/lib/templates/wordpress/wp-admin/includes/meta-boxes.php +1132 -0
  458. data/lib/templates/wordpress/wp-admin/includes/misc.php +889 -0
  459. data/lib/templates/wordpress/wp-admin/includes/ms-deprecated.php +77 -0
  460. data/lib/templates/wordpress/wp-admin/includes/ms.php +971 -0
  461. data/lib/templates/wordpress/wp-admin/includes/nav-menu.php +1324 -0
  462. data/lib/templates/wordpress/wp-admin/includes/plugin-install.php +580 -0
  463. data/lib/templates/wordpress/wp-admin/includes/plugin.php +1892 -0
  464. data/lib/templates/wordpress/wp-admin/includes/post.php +1742 -0
  465. data/lib/templates/wordpress/wp-admin/includes/revision.php +378 -0
  466. data/lib/templates/wordpress/wp-admin/includes/schema.php +1046 -0
  467. data/lib/templates/wordpress/wp-admin/includes/screen.php +1185 -0
  468. data/lib/templates/wordpress/wp-admin/includes/taxonomy.php +290 -0
  469. data/lib/templates/wordpress/wp-admin/includes/template.php +2248 -0
  470. data/lib/templates/wordpress/wp-admin/includes/theme-install.php +205 -0
  471. data/lib/templates/wordpress/wp-admin/includes/theme.php +564 -0
  472. data/lib/templates/wordpress/wp-admin/includes/translation-install.php +241 -0
  473. data/lib/templates/wordpress/wp-admin/includes/update-core.php +1190 -0
  474. data/lib/templates/wordpress/wp-admin/includes/update.php +435 -0
  475. data/lib/templates/wordpress/wp-admin/includes/upgrade.php +2410 -0
  476. data/lib/templates/wordpress/wp-admin/includes/user.php +442 -0
  477. data/lib/templates/wordpress/wp-admin/includes/widgets.php +245 -0
  478. data/lib/templates/wordpress/wp-admin/index.php +132 -0
  479. data/lib/templates/wordpress/wp-admin/install-helper.php +198 -0
  480. data/lib/templates/wordpress/wp-admin/install.php +307 -0
  481. data/lib/templates/wordpress/wp-admin/js/accordion.js +75 -0
  482. data/lib/templates/wordpress/wp-admin/js/accordion.min.js +1 -0
  483. data/lib/templates/wordpress/wp-admin/js/bookmarklet.js +166 -0
  484. data/lib/templates/wordpress/wp-admin/js/bookmarklet.min.js +1 -0
  485. data/lib/templates/wordpress/wp-admin/js/color-picker.js +157 -0
  486. data/lib/templates/wordpress/wp-admin/js/color-picker.min.js +1 -0
  487. data/lib/templates/wordpress/wp-admin/js/comment.js +50 -0
  488. data/lib/templates/wordpress/wp-admin/js/comment.min.js +1 -0
  489. data/lib/templates/wordpress/wp-admin/js/common.js +893 -0
  490. data/lib/templates/wordpress/wp-admin/js/common.min.js +1 -0
  491. data/lib/templates/wordpress/wp-admin/js/custom-background.js +75 -0
  492. data/lib/templates/wordpress/wp-admin/js/custom-background.min.js +1 -0
  493. data/lib/templates/wordpress/wp-admin/js/custom-header.js +61 -0
  494. data/lib/templates/wordpress/wp-admin/js/customize-controls.js +3071 -0
  495. data/lib/templates/wordpress/wp-admin/js/customize-controls.min.js +2 -0
  496. data/lib/templates/wordpress/wp-admin/js/customize-widgets.js +2024 -0
  497. data/lib/templates/wordpress/wp-admin/js/customize-widgets.min.js +1 -0
  498. data/lib/templates/wordpress/wp-admin/js/dashboard.js +190 -0
  499. data/lib/templates/wordpress/wp-admin/js/dashboard.min.js +1 -0
  500. data/lib/templates/wordpress/wp-admin/js/edit-comments.js +627 -0
  501. data/lib/templates/wordpress/wp-admin/js/edit-comments.min.js +1 -0
  502. data/lib/templates/wordpress/wp-admin/js/editor-expand.js +1237 -0
  503. data/lib/templates/wordpress/wp-admin/js/editor-expand.min.js +1 -0
  504. data/lib/templates/wordpress/wp-admin/js/editor.js +324 -0
  505. data/lib/templates/wordpress/wp-admin/js/editor.min.js +1 -0
  506. data/lib/templates/wordpress/wp-admin/js/farbtastic.js +276 -0
  507. data/lib/templates/wordpress/wp-admin/js/gallery.js +237 -0
  508. data/lib/templates/wordpress/wp-admin/js/gallery.min.js +1 -0
  509. data/lib/templates/wordpress/wp-admin/js/image-edit.js +633 -0
  510. data/lib/templates/wordpress/wp-admin/js/image-edit.min.js +1 -0
  511. data/lib/templates/wordpress/wp-admin/js/inline-edit-post.js +360 -0
  512. data/lib/templates/wordpress/wp-admin/js/inline-edit-post.min.js +1 -0
  513. data/lib/templates/wordpress/wp-admin/js/inline-edit-tax.js +152 -0
  514. data/lib/templates/wordpress/wp-admin/js/inline-edit-tax.min.js +1 -0
  515. data/lib/templates/wordpress/wp-admin/js/iris.min.js +4 -0
  516. data/lib/templates/wordpress/wp-admin/js/language-chooser.js +26 -0
  517. data/lib/templates/wordpress/wp-admin/js/language-chooser.min.js +1 -0
  518. data/lib/templates/wordpress/wp-admin/js/link.js +69 -0
  519. data/lib/templates/wordpress/wp-admin/js/link.min.js +1 -0
  520. data/lib/templates/wordpress/wp-admin/js/media-gallery.js +26 -0
  521. data/lib/templates/wordpress/wp-admin/js/media-gallery.min.js +1 -0
  522. data/lib/templates/wordpress/wp-admin/js/media-upload.js +69 -0
  523. data/lib/templates/wordpress/wp-admin/js/media-upload.min.js +1 -0
  524. data/lib/templates/wordpress/wp-admin/js/media.js +114 -0
  525. data/lib/templates/wordpress/wp-admin/js/media.min.js +1 -0
  526. data/lib/templates/wordpress/wp-admin/js/nav-menu.js +1237 -0
  527. data/lib/templates/wordpress/wp-admin/js/nav-menu.min.js +1 -0
  528. data/lib/templates/wordpress/wp-admin/js/password-strength-meter.js +75 -0
  529. data/lib/templates/wordpress/wp-admin/js/password-strength-meter.min.js +1 -0
  530. data/lib/templates/wordpress/wp-admin/js/plugin-install.js +72 -0
  531. data/lib/templates/wordpress/wp-admin/js/plugin-install.min.js +1 -0
  532. data/lib/templates/wordpress/wp-admin/js/post.js +926 -0
  533. data/lib/templates/wordpress/wp-admin/js/post.min.js +1 -0
  534. data/lib/templates/wordpress/wp-admin/js/postbox.js +199 -0
  535. data/lib/templates/wordpress/wp-admin/js/postbox.min.js +1 -0
  536. data/lib/templates/wordpress/wp-admin/js/press-this.js +796 -0
  537. data/lib/templates/wordpress/wp-admin/js/press-this.min.js +1 -0
  538. data/lib/templates/wordpress/wp-admin/js/revisions.js +1166 -0
  539. data/lib/templates/wordpress/wp-admin/js/revisions.min.js +1 -0
  540. data/lib/templates/wordpress/wp-admin/js/set-post-thumbnail.js +24 -0
  541. data/lib/templates/wordpress/wp-admin/js/set-post-thumbnail.min.js +1 -0
  542. data/lib/templates/wordpress/wp-admin/js/svg-painter.js +240 -0
  543. data/lib/templates/wordpress/wp-admin/js/svg-painter.min.js +1 -0
  544. data/lib/templates/wordpress/wp-admin/js/tags-box.js +202 -0
  545. data/lib/templates/wordpress/wp-admin/js/tags-box.min.js +1 -0
  546. data/lib/templates/wordpress/wp-admin/js/tags.js +72 -0
  547. data/lib/templates/wordpress/wp-admin/js/tags.min.js +1 -0
  548. data/lib/templates/wordpress/wp-admin/js/theme.js +1726 -0
  549. data/lib/templates/wordpress/wp-admin/js/theme.min.js +1 -0
  550. data/lib/templates/wordpress/wp-admin/js/updates.js +553 -0
  551. data/lib/templates/wordpress/wp-admin/js/updates.min.js +1 -0
  552. data/lib/templates/wordpress/wp-admin/js/user-profile.js +149 -0
  553. data/lib/templates/wordpress/wp-admin/js/user-profile.min.js +1 -0
  554. data/lib/templates/wordpress/wp-admin/js/user-suggest.js +30 -0
  555. data/lib/templates/wordpress/wp-admin/js/user-suggest.min.js +1 -0
  556. data/lib/templates/wordpress/wp-admin/js/widgets.js +494 -0
  557. data/lib/templates/wordpress/wp-admin/js/widgets.min.js +1 -0
  558. data/lib/templates/wordpress/wp-admin/js/word-count.js +44 -0
  559. data/lib/templates/wordpress/wp-admin/js/word-count.min.js +1 -0
  560. data/lib/templates/wordpress/wp-admin/js/wp-fullscreen.js +704 -0
  561. data/lib/templates/wordpress/wp-admin/js/wp-fullscreen.min.js +1 -0
  562. data/lib/templates/wordpress/wp-admin/js/xfn.js +17 -0
  563. data/lib/templates/wordpress/wp-admin/js/xfn.min.js +1 -0
  564. data/lib/templates/wordpress/wp-admin/link-add.php +29 -0
  565. data/lib/templates/wordpress/wp-admin/link-manager.php +99 -0
  566. data/lib/templates/wordpress/wp-admin/link-parse-opml.php +87 -0
  567. data/lib/templates/wordpress/wp-admin/link.php +117 -0
  568. data/lib/templates/wordpress/wp-admin/load-scripts.php +162 -0
  569. data/lib/templates/wordpress/wp-admin/load-styles.php +153 -0
  570. data/lib/templates/wordpress/wp-admin/maint/repair.php +124 -0
  571. data/lib/templates/wordpress/wp-admin/media-new.php +84 -0
  572. data/lib/templates/wordpress/wp-admin/media-upload.php +103 -0
  573. data/lib/templates/wordpress/wp-admin/media.php +146 -0
  574. data/lib/templates/wordpress/wp-admin/menu-header.php +242 -0
  575. data/lib/templates/wordpress/wp-admin/menu.php +269 -0
  576. data/lib/templates/wordpress/wp-admin/moderation.php +12 -0
  577. data/lib/templates/wordpress/wp-admin/ms-admin.php +13 -0
  578. data/lib/templates/wordpress/wp-admin/ms-delete-site.php +94 -0
  579. data/lib/templates/wordpress/wp-admin/ms-edit.php +13 -0
  580. data/lib/templates/wordpress/wp-admin/ms-options.php +12 -0
  581. data/lib/templates/wordpress/wp-admin/ms-sites.php +13 -0
  582. data/lib/templates/wordpress/wp-admin/ms-themes.php +13 -0
  583. data/lib/templates/wordpress/wp-admin/ms-upgrade-network.php +13 -0
  584. data/lib/templates/wordpress/wp-admin/ms-users.php +13 -0
  585. data/lib/templates/wordpress/wp-admin/my-sites.php +143 -0
  586. data/lib/templates/wordpress/wp-admin/nav-menus.php +796 -0
  587. data/lib/templates/wordpress/wp-admin/network.php +580 -0
  588. data/lib/templates/wordpress/wp-admin/network/about.php +16 -0
  589. data/lib/templates/wordpress/wp-admin/network/admin.php +32 -0
  590. data/lib/templates/wordpress/wp-admin/network/credits.php +16 -0
  591. data/lib/templates/wordpress/wp-admin/network/edit.php +42 -0
  592. data/lib/templates/wordpress/wp-admin/network/freedoms.php +16 -0
  593. data/lib/templates/wordpress/wp-admin/network/index.php +79 -0
  594. data/lib/templates/wordpress/wp-admin/network/menu.php +63 -0
  595. data/lib/templates/wordpress/wp-admin/network/plugin-editor.php +16 -0
  596. data/lib/templates/wordpress/wp-admin/network/plugin-install.php +19 -0
  597. data/lib/templates/wordpress/wp-admin/network/plugins.php +16 -0
  598. data/lib/templates/wordpress/wp-admin/network/profile.php +16 -0
  599. data/lib/templates/wordpress/wp-admin/network/settings.php +405 -0
  600. data/lib/templates/wordpress/wp-admin/network/setup.php +16 -0
  601. data/lib/templates/wordpress/wp-admin/network/site-info.php +187 -0
  602. data/lib/templates/wordpress/wp-admin/network/site-new.php +170 -0
  603. data/lib/templates/wordpress/wp-admin/network/site-settings.php +173 -0
  604. data/lib/templates/wordpress/wp-admin/network/site-themes.php +195 -0
  605. data/lib/templates/wordpress/wp-admin/network/site-users.php +317 -0
  606. data/lib/templates/wordpress/wp-admin/network/sites.php +275 -0
  607. data/lib/templates/wordpress/wp-admin/network/theme-editor.php +16 -0
  608. data/lib/templates/wordpress/wp-admin/network/theme-install.php +19 -0
  609. data/lib/templates/wordpress/wp-admin/network/themes.php +323 -0
  610. data/lib/templates/wordpress/wp-admin/network/update-core.php +16 -0
  611. data/lib/templates/wordpress/wp-admin/network/update.php +19 -0
  612. data/lib/templates/wordpress/wp-admin/network/upgrade.php +129 -0
  613. data/lib/templates/wordpress/wp-admin/network/user-edit.php +16 -0
  614. data/lib/templates/wordpress/wp-admin/network/user-new.php +107 -0
  615. data/lib/templates/wordpress/wp-admin/network/users.php +329 -0
  616. data/lib/templates/wordpress/wp-admin/options-discussion.php +306 -0
  617. data/lib/templates/wordpress/wp-admin/options-general.php +387 -0
  618. data/lib/templates/wordpress/wp-admin/options-head.php +18 -0
  619. data/lib/templates/wordpress/wp-admin/options-media.php +136 -0
  620. data/lib/templates/wordpress/wp-admin/options-permalink.php +288 -0
  621. data/lib/templates/wordpress/wp-admin/options-reading.php +182 -0
  622. data/lib/templates/wordpress/wp-admin/options-writing.php +178 -0
  623. data/lib/templates/wordpress/wp-admin/options.php +277 -0
  624. data/lib/templates/wordpress/wp-admin/plugin-editor.php +279 -0
  625. data/lib/templates/wordpress/wp-admin/plugin-install.php +138 -0
  626. data/lib/templates/wordpress/wp-admin/plugins.php +489 -0
  627. data/lib/templates/wordpress/wp-admin/post-new.php +76 -0
  628. data/lib/templates/wordpress/wp-admin/post.php +320 -0
  629. data/lib/templates/wordpress/wp-admin/press-this.php +21 -0
  630. data/lib/templates/wordpress/wp-admin/profile.php +18 -0
  631. data/lib/templates/wordpress/wp-admin/revision.php +135 -0
  632. data/lib/templates/wordpress/wp-admin/setup-config.php +352 -0
  633. data/lib/templates/wordpress/wp-admin/theme-editor.php +241 -0
  634. data/lib/templates/wordpress/wp-admin/theme-install.php +271 -0
  635. data/lib/templates/wordpress/wp-admin/themes.php +422 -0
  636. data/lib/templates/wordpress/wp-admin/tools.php +119 -0
  637. data/lib/templates/wordpress/wp-admin/update-core.php +661 -0
  638. data/lib/templates/wordpress/wp-admin/update.php +272 -0
  639. data/lib/templates/wordpress/wp-admin/upgrade-functions.php +12 -0
  640. data/lib/templates/wordpress/wp-admin/upgrade.php +120 -0
  641. data/lib/templates/wordpress/wp-admin/upload.php +294 -0
  642. data/lib/templates/wordpress/wp-admin/user-edit.php +592 -0
  643. data/lib/templates/wordpress/wp-admin/user-new.php +440 -0
  644. data/lib/templates/wordpress/wp-admin/user/about.php +13 -0
  645. data/lib/templates/wordpress/wp-admin/user/admin.php +32 -0
  646. data/lib/templates/wordpress/wp-admin/user/credits.php +13 -0
  647. data/lib/templates/wordpress/wp-admin/user/freedoms.php +13 -0
  648. data/lib/templates/wordpress/wp-admin/user/index.php +13 -0
  649. data/lib/templates/wordpress/wp-admin/user/menu.php +22 -0
  650. data/lib/templates/wordpress/wp-admin/user/profile.php +13 -0
  651. data/lib/templates/wordpress/wp-admin/user/user-edit.php +13 -0
  652. data/lib/templates/wordpress/wp-admin/users.php +475 -0
  653. data/lib/templates/wordpress/wp-admin/widgets.php +459 -0
  654. data/lib/templates/wordpress/wp-blog-header.php +18 -0
  655. data/lib/templates/wordpress/wp-comments-post.php +167 -0
  656. data/lib/templates/wordpress/wp-config-sample.php +80 -0
  657. data/lib/templates/wordpress/wp-content/index.php +2 -0
  658. data/lib/templates/wordpress/wp-content/plugins/akismet/.htaccess +34 -0
  659. data/lib/templates/wordpress/wp-content/plugins/akismet/_inc/akismet.css +366 -0
  660. data/lib/templates/wordpress/wp-content/plugins/akismet/_inc/akismet.js +160 -0
  661. data/lib/templates/wordpress/wp-content/plugins/akismet/_inc/form.js +30 -0
  662. data/lib/templates/wordpress/wp-content/plugins/akismet/_inc/img/logo-full-2x.png +0 -0
  663. data/lib/templates/wordpress/wp-content/plugins/akismet/akismet.php +59 -0
  664. data/lib/templates/wordpress/wp-content/plugins/akismet/class.akismet-admin.php +885 -0
  665. data/lib/templates/wordpress/wp-content/plugins/akismet/class.akismet-widget.php +110 -0
  666. data/lib/templates/wordpress/wp-content/plugins/akismet/class.akismet.php +1088 -0
  667. data/lib/templates/wordpress/wp-content/plugins/akismet/index.php +2 -0
  668. data/lib/templates/wordpress/wp-content/plugins/akismet/readme.txt +266 -0
  669. data/lib/templates/wordpress/wp-content/plugins/akismet/views/config.php +220 -0
  670. data/lib/templates/wordpress/wp-content/plugins/akismet/views/get.php +5 -0
  671. data/lib/templates/wordpress/wp-content/plugins/akismet/views/notice.php +102 -0
  672. data/lib/templates/wordpress/wp-content/plugins/akismet/views/start.php +95 -0
  673. data/lib/templates/wordpress/wp-content/plugins/akismet/views/stats.php +4 -0
  674. data/lib/templates/wordpress/wp-content/plugins/akismet/views/strict.php +7 -0
  675. data/lib/templates/wordpress/wp-content/plugins/akismet/wrapper.php +213 -0
  676. data/lib/templates/wordpress/wp-content/plugins/index.php +2 -0
  677. data/lib/templates/wordpress/wp-content/themes/index.php +2 -0
  678. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/404.php +30 -0
  679. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/archive.php +64 -0
  680. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/author-bio.php +39 -0
  681. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/comments.php +58 -0
  682. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content-link.php +60 -0
  683. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content-none.php +37 -0
  684. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content-page.php +37 -0
  685. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content-search.php +37 -0
  686. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content.php +60 -0
  687. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/css/editor-style.css +493 -0
  688. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/css/ie.css +948 -0
  689. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/css/ie7.css +89 -0
  690. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/footer.php +34 -0
  691. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/functions.php +355 -0
  692. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/COPYING.txt +9 -0
  693. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/Genericons.eot +0 -0
  694. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/Genericons.svg +543 -0
  695. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/Genericons.ttf +0 -0
  696. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/Genericons.woff +0 -0
  697. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/LICENSE.txt +339 -0
  698. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/README.md +152 -0
  699. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/example.html +719 -0
  700. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/genericons.css +209 -0
  701. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/header.php +50 -0
  702. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/image.php +94 -0
  703. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/inc/back-compat.php +63 -0
  704. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/inc/custom-header.php +356 -0
  705. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/inc/customizer.php +715 -0
  706. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/inc/template-tags.php +242 -0
  707. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/index.php +61 -0
  708. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/color-scheme-control.js +78 -0
  709. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/customize-preview.js +35 -0
  710. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/functions.js +162 -0
  711. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/html5.js +9 -0
  712. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/keyboard-image-navigation.js +22 -0
  713. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/skip-link-focus-fix.js +26 -0
  714. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/languages/twentyfifteen.pot +328 -0
  715. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/page.php +38 -0
  716. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/readme.txt +92 -0
  717. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/rtl.css +840 -0
  718. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/screenshot.png +0 -0
  719. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/search.php +53 -0
  720. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/sidebar.php +47 -0
  721. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/single.php +48 -0
  722. data/lib/templates/wordpress/wp-content/themes/twentyfifteen/style.css +5994 -0
  723. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/404.php +32 -0
  724. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/archive.php +74 -0
  725. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/author.php +74 -0
  726. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/category.php +58 -0
  727. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/comments.php +66 -0
  728. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-aside.php +62 -0
  729. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-audio.php +62 -0
  730. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-featured-post.php +34 -0
  731. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-gallery.php +62 -0
  732. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-image.php +62 -0
  733. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-link.php +62 -0
  734. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-none.php +31 -0
  735. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-page.php +31 -0
  736. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-quote.php +62 -0
  737. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-video.php +62 -0
  738. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content.php +71 -0
  739. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/css/editor-style.css +737 -0
  740. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/css/ie.css +1335 -0
  741. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/featured-content.php +39 -0
  742. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/footer.php +28 -0
  743. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/functions.php +519 -0
  744. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/COPYING.txt +9 -0
  745. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/Genericons-Regular.otf +0 -0
  746. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/LICENSE.txt +339 -0
  747. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/README.txt +123 -0
  748. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/example.html +464 -0
  749. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.eot +0 -0
  750. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.svg +135 -0
  751. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.ttf +0 -0
  752. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.woff +0 -0
  753. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/genericons.css +197 -0
  754. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/header.php +65 -0
  755. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/image.php +79 -0
  756. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/images/pattern-dark.svg +16 -0
  757. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/images/pattern-light.svg +6 -0
  758. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/back-compat.php +63 -0
  759. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/custom-header.php +147 -0
  760. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/customizer.php +115 -0
  761. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/featured-content.php +531 -0
  762. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/template-tags.php +227 -0
  763. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/widgets.php +269 -0
  764. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/index.php +61 -0
  765. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/customizer.js +38 -0
  766. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/featured-content-admin.js +9 -0
  767. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/functions.js +170 -0
  768. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/html5.js +8 -0
  769. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js +21 -0
  770. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/slider.js +598 -0
  771. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/languages/twentyfourteen.pot +480 -0
  772. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/page-templates/contributors.php +52 -0
  773. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/page-templates/full-width.php +42 -0
  774. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/page.php +48 -0
  775. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/rtl.css +854 -0
  776. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/screenshot.png +0 -0
  777. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/search.php +49 -0
  778. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/sidebar-content.php +16 -0
  779. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/sidebar-footer.php +19 -0
  780. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/sidebar.php +29 -0
  781. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/single.php +40 -0
  782. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/style.css +4321 -0
  783. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/tag.php +60 -0
  784. data/lib/templates/wordpress/wp-content/themes/twentyfourteen/taxonomy-post_format.php +85 -0
  785. data/lib/templates/wordpress/wp-content/themes/twentythirteen/404.php +31 -0
  786. data/lib/templates/wordpress/wp-content/themes/twentythirteen/archive.php +55 -0
  787. data/lib/templates/wordpress/wp-content/themes/twentythirteen/author-bio.php +34 -0
  788. data/lib/templates/wordpress/wp-content/themes/twentythirteen/author.php +62 -0
  789. data/lib/templates/wordpress/wp-content/themes/twentythirteen/category.php +41 -0
  790. data/lib/templates/wordpress/wp-content/themes/twentythirteen/comments.php +59 -0
  791. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-aside.php +38 -0
  792. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-audio.php +44 -0
  793. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-chat.php +38 -0
  794. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-gallery.php +52 -0
  795. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-image.php +48 -0
  796. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-link.php +43 -0
  797. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-none.php +31 -0
  798. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-quote.php +34 -0
  799. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-status.php +32 -0
  800. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-video.php +48 -0
  801. data/lib/templates/wordpress/wp-content/themes/twentythirteen/content.php +64 -0
  802. data/lib/templates/wordpress/wp-content/themes/twentythirteen/css/editor-style.css +787 -0
  803. data/lib/templates/wordpress/wp-content/themes/twentythirteen/css/ie.css +288 -0
  804. data/lib/templates/wordpress/wp-content/themes/twentythirteen/footer.php +26 -0
  805. data/lib/templates/wordpress/wp-content/themes/twentythirteen/functions.php +552 -0
  806. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/COPYING.txt +9 -0
  807. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/Genericons-Regular.otf +0 -0
  808. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/LICENSE.txt +339 -0
  809. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/README.txt +123 -0
  810. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/example.html +464 -0
  811. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.eot +0 -0
  812. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.svg +135 -0
  813. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.ttf +0 -0
  814. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.woff +0 -0
  815. data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/genericons.css +197 -0
  816. data/lib/templates/wordpress/wp-content/themes/twentythirteen/header.php +51 -0
  817. data/lib/templates/wordpress/wp-content/themes/twentythirteen/image.php +82 -0
  818. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/dotted-line-2x.png +0 -0
  819. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/dotted-line-light-2x.png +0 -0
  820. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/dotted-line-light.png +0 -0
  821. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/dotted-line.png +0 -0
  822. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/circle-thumbnail.png +0 -0
  823. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/circle.png +0 -0
  824. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/diamond-thumbnail.png +0 -0
  825. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/diamond.png +0 -0
  826. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/star-thumbnail.png +0 -0
  827. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/star.png +0 -0
  828. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/search-icon-2x.png +0 -0
  829. data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/search-icon.png +0 -0
  830. data/lib/templates/wordpress/wp-content/themes/twentythirteen/inc/back-compat.php +63 -0
  831. data/lib/templates/wordpress/wp-content/themes/twentythirteen/inc/custom-header.php +230 -0
  832. data/lib/templates/wordpress/wp-content/themes/twentythirteen/index.php +38 -0
  833. data/lib/templates/wordpress/wp-content/themes/twentythirteen/js/functions.js +132 -0
  834. data/lib/templates/wordpress/wp-content/themes/twentythirteen/js/html5.js +8 -0
  835. data/lib/templates/wordpress/wp-content/themes/twentythirteen/js/theme-customizer.js +41 -0
  836. data/lib/templates/wordpress/wp-content/themes/twentythirteen/languages/twentythirteen.pot +336 -0
  837. data/lib/templates/wordpress/wp-content/themes/twentythirteen/page.php +50 -0
  838. data/lib/templates/wordpress/wp-content/themes/twentythirteen/rtl.css +766 -0
  839. data/lib/templates/wordpress/wp-content/themes/twentythirteen/screenshot.png +0 -0
  840. data/lib/templates/wordpress/wp-content/themes/twentythirteen/search.php +36 -0
  841. data/lib/templates/wordpress/wp-content/themes/twentythirteen/sidebar-main.php +18 -0
  842. data/lib/templates/wordpress/wp-content/themes/twentythirteen/sidebar.php +22 -0
  843. data/lib/templates/wordpress/wp-content/themes/twentythirteen/single.php +28 -0
  844. data/lib/templates/wordpress/wp-content/themes/twentythirteen/style.css +3227 -0
  845. data/lib/templates/wordpress/wp-content/themes/twentythirteen/tag.php +43 -0
  846. data/lib/templates/wordpress/wp-content/themes/twentythirteen/taxonomy-post_format.php +41 -0
  847. data/lib/templates/wordpress/wp-cron.php +124 -0
  848. data/lib/templates/wordpress/wp-includes/ID3/getid3.lib.php +1376 -0
  849. data/lib/templates/wordpress/wp-includes/ID3/getid3.php +1796 -0
  850. data/lib/templates/wordpress/wp-includes/ID3/license.commercial.txt +27 -0
  851. data/lib/templates/wordpress/wp-includes/ID3/license.txt +29 -0
  852. data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.asf.php +2013 -0
  853. data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.flv.php +745 -0
  854. data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.matroska.php +1751 -0
  855. data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.quicktime.php +2246 -0
  856. data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.riff.php +2586 -0
  857. data/lib/templates/wordpress/wp-includes/ID3/module.audio.ac3.php +474 -0
  858. data/lib/templates/wordpress/wp-includes/ID3/module.audio.dts.php +291 -0
  859. data/lib/templates/wordpress/wp-includes/ID3/module.audio.flac.php +443 -0
  860. data/lib/templates/wordpress/wp-includes/ID3/module.audio.mp3.php +2012 -0
  861. data/lib/templates/wordpress/wp-includes/ID3/module.audio.ogg.php +756 -0
  862. data/lib/templates/wordpress/wp-includes/ID3/module.tag.apetag.php +371 -0
  863. data/lib/templates/wordpress/wp-includes/ID3/module.tag.id3v1.php +360 -0
  864. data/lib/templates/wordpress/wp-includes/ID3/module.tag.id3v2.php +3424 -0
  865. data/lib/templates/wordpress/wp-includes/ID3/module.tag.lyrics3.php +294 -0
  866. data/lib/templates/wordpress/wp-includes/ID3/readme.txt +604 -0
  867. data/lib/templates/wordpress/wp-includes/SimplePie/Author.php +157 -0
  868. data/lib/templates/wordpress/wp-includes/SimplePie/Cache.php +133 -0
  869. data/lib/templates/wordpress/wp-includes/SimplePie/Cache/Base.php +114 -0
  870. data/lib/templates/wordpress/wp-includes/SimplePie/Cache/DB.php +137 -0
  871. data/lib/templates/wordpress/wp-includes/SimplePie/Cache/File.php +173 -0
  872. data/lib/templates/wordpress/wp-includes/SimplePie/Cache/Memcache.php +183 -0
  873. data/lib/templates/wordpress/wp-includes/SimplePie/Cache/MySQL.php +438 -0
  874. data/lib/templates/wordpress/wp-includes/SimplePie/Caption.php +210 -0
  875. data/lib/templates/wordpress/wp-includes/SimplePie/Category.php +157 -0
  876. data/lib/templates/wordpress/wp-includes/SimplePie/Content/Type/Sniffer.php +332 -0
  877. data/lib/templates/wordpress/wp-includes/SimplePie/Copyright.php +130 -0
  878. data/lib/templates/wordpress/wp-includes/SimplePie/Core.php +57 -0
  879. data/lib/templates/wordpress/wp-includes/SimplePie/Credit.php +156 -0
  880. data/lib/templates/wordpress/wp-includes/SimplePie/Decode/HTML/Entities.php +617 -0
  881. data/lib/templates/wordpress/wp-includes/SimplePie/Enclosure.php +1380 -0
  882. data/lib/templates/wordpress/wp-includes/SimplePie/Exception.php +52 -0
  883. data/lib/templates/wordpress/wp-includes/SimplePie/File.php +292 -0
  884. data/lib/templates/wordpress/wp-includes/SimplePie/HTTP/Parser.php +500 -0
  885. data/lib/templates/wordpress/wp-includes/SimplePie/IRI.php +1238 -0
  886. data/lib/templates/wordpress/wp-includes/SimplePie/Item.php +2964 -0
  887. data/lib/templates/wordpress/wp-includes/SimplePie/Locator.php +372 -0
  888. data/lib/templates/wordpress/wp-includes/SimplePie/Misc.php +2247 -0
  889. data/lib/templates/wordpress/wp-includes/SimplePie/Net/IPv6.php +276 -0
  890. data/lib/templates/wordpress/wp-includes/SimplePie/Parse/Date.php +983 -0
  891. data/lib/templates/wordpress/wp-includes/SimplePie/Parser.php +407 -0
  892. data/lib/templates/wordpress/wp-includes/SimplePie/Rating.php +129 -0
  893. data/lib/templates/wordpress/wp-includes/SimplePie/Registry.php +225 -0
  894. data/lib/templates/wordpress/wp-includes/SimplePie/Restriction.php +155 -0
  895. data/lib/templates/wordpress/wp-includes/SimplePie/Sanitize.php +554 -0
  896. data/lib/templates/wordpress/wp-includes/SimplePie/Source.php +611 -0
  897. data/lib/templates/wordpress/wp-includes/SimplePie/XML/Declaration/Parser.php +362 -0
  898. data/lib/templates/wordpress/wp-includes/SimplePie/gzdecode.php +371 -0
  899. data/lib/templates/wordpress/wp-includes/Text/Diff.php +450 -0
  900. data/lib/templates/wordpress/wp-includes/Text/Diff/Engine/native.php +436 -0
  901. data/lib/templates/wordpress/wp-includes/Text/Diff/Engine/shell.php +162 -0
  902. data/lib/templates/wordpress/wp-includes/Text/Diff/Engine/string.php +248 -0
  903. data/lib/templates/wordpress/wp-includes/Text/Diff/Engine/xdiff.php +64 -0
  904. data/lib/templates/wordpress/wp-includes/Text/Diff/Renderer.php +235 -0
  905. data/lib/templates/wordpress/wp-includes/Text/Diff/Renderer/inline.php +206 -0
  906. data/lib/templates/wordpress/wp-includes/admin-bar.php +959 -0
  907. data/lib/templates/wordpress/wp-includes/atomlib.php +352 -0
  908. data/lib/templates/wordpress/wp-includes/author-template.php +453 -0
  909. data/lib/templates/wordpress/wp-includes/bookmark-template.php +298 -0
  910. data/lib/templates/wordpress/wp-includes/bookmark.php +415 -0
  911. data/lib/templates/wordpress/wp-includes/cache.php +714 -0
  912. data/lib/templates/wordpress/wp-includes/canonical.php +587 -0
  913. data/lib/templates/wordpress/wp-includes/capabilities.php +1575 -0
  914. data/lib/templates/wordpress/wp-includes/category-template.php +1459 -0
  915. data/lib/templates/wordpress/wp-includes/category.php +339 -0
  916. data/lib/templates/wordpress/wp-includes/certificates/ca-bundle.crt +3785 -0
  917. data/lib/templates/wordpress/wp-includes/class-IXR.php +1111 -0
  918. data/lib/templates/wordpress/wp-includes/class-feed.php +141 -0
  919. data/lib/templates/wordpress/wp-includes/class-http.php +2276 -0
  920. data/lib/templates/wordpress/wp-includes/class-json.php +936 -0
  921. data/lib/templates/wordpress/wp-includes/class-oembed.php +615 -0
  922. data/lib/templates/wordpress/wp-includes/class-phpass.php +268 -0
  923. data/lib/templates/wordpress/wp-includes/class-phpmailer.php +3265 -0
  924. data/lib/templates/wordpress/wp-includes/class-pop3.php +652 -0
  925. data/lib/templates/wordpress/wp-includes/class-simplepie.php +3119 -0
  926. data/lib/templates/wordpress/wp-includes/class-smtp.php +943 -0
  927. data/lib/templates/wordpress/wp-includes/class-snoopy.php +1256 -0
  928. data/lib/templates/wordpress/wp-includes/class-wp-admin-bar.php +519 -0
  929. data/lib/templates/wordpress/wp-includes/class-wp-ajax-response.php +145 -0
  930. data/lib/templates/wordpress/wp-includes/class-wp-customize-control.php +1378 -0
  931. data/lib/templates/wordpress/wp-includes/class-wp-customize-manager.php +1591 -0
  932. data/lib/templates/wordpress/wp-includes/class-wp-customize-panel.php +333 -0
  933. data/lib/templates/wordpress/wp-includes/class-wp-customize-section.php +453 -0
  934. data/lib/templates/wordpress/wp-includes/class-wp-customize-setting.php +629 -0
  935. data/lib/templates/wordpress/wp-includes/class-wp-customize-widgets.php +1549 -0
  936. data/lib/templates/wordpress/wp-includes/class-wp-editor.php +1492 -0
  937. data/lib/templates/wordpress/wp-includes/class-wp-embed.php +357 -0
  938. data/lib/templates/wordpress/wp-includes/class-wp-error.php +219 -0
  939. data/lib/templates/wordpress/wp-includes/class-wp-http-ixr-client.php +108 -0
  940. data/lib/templates/wordpress/wp-includes/class-wp-image-editor-gd.php +470 -0
  941. data/lib/templates/wordpress/wp-includes/class-wp-image-editor-imagick.php +516 -0
  942. data/lib/templates/wordpress/wp-includes/class-wp-image-editor.php +485 -0
  943. data/lib/templates/wordpress/wp-includes/class-wp-theme.php +1237 -0
  944. data/lib/templates/wordpress/wp-includes/class-wp-walker.php +416 -0
  945. data/lib/templates/wordpress/wp-includes/class-wp-xmlrpc-server.php +5935 -0
  946. data/lib/templates/wordpress/wp-includes/class-wp.php +714 -0
  947. data/lib/templates/wordpress/wp-includes/class.wp-dependencies.php +509 -0
  948. data/lib/templates/wordpress/wp-includes/class.wp-scripts.php +284 -0
  949. data/lib/templates/wordpress/wp-includes/class.wp-styles.php +248 -0
  950. data/lib/templates/wordpress/wp-includes/comment-template.php +2421 -0
  951. data/lib/templates/wordpress/wp-includes/comment.php +3066 -0
  952. data/lib/templates/wordpress/wp-includes/compat.php +149 -0
  953. data/lib/templates/wordpress/wp-includes/cron.php +470 -0
  954. data/lib/templates/wordpress/wp-includes/css/admin-bar-rtl.css +1123 -0
  955. data/lib/templates/wordpress/wp-includes/css/admin-bar-rtl.min.css +1 -0
  956. data/lib/templates/wordpress/wp-includes/css/admin-bar.css +1123 -0
  957. data/lib/templates/wordpress/wp-includes/css/admin-bar.min.css +1 -0
  958. data/lib/templates/wordpress/wp-includes/css/buttons-rtl.css +360 -0
  959. data/lib/templates/wordpress/wp-includes/css/buttons-rtl.min.css +1 -0
  960. data/lib/templates/wordpress/wp-includes/css/buttons.css +360 -0
  961. data/lib/templates/wordpress/wp-includes/css/buttons.min.css +1 -0
  962. data/lib/templates/wordpress/wp-includes/css/dashicons.css +958 -0
  963. data/lib/templates/wordpress/wp-includes/css/dashicons.min.css +1 -0
  964. data/lib/templates/wordpress/wp-includes/css/editor-rtl.css +2143 -0
  965. data/lib/templates/wordpress/wp-includes/css/editor-rtl.min.css +1 -0
  966. data/lib/templates/wordpress/wp-includes/css/editor.css +2143 -0
  967. data/lib/templates/wordpress/wp-includes/css/editor.min.css +1 -0
  968. data/lib/templates/wordpress/wp-includes/css/jquery-ui-dialog-rtl.css +362 -0
  969. data/lib/templates/wordpress/wp-includes/css/jquery-ui-dialog-rtl.min.css +17 -0
  970. data/lib/templates/wordpress/wp-includes/css/jquery-ui-dialog.css +362 -0
  971. data/lib/templates/wordpress/wp-includes/css/jquery-ui-dialog.min.css +17 -0
  972. data/lib/templates/wordpress/wp-includes/css/media-views-rtl.css +2601 -0
  973. data/lib/templates/wordpress/wp-includes/css/media-views-rtl.min.css +8 -0
  974. data/lib/templates/wordpress/wp-includes/css/media-views.css +2601 -0
  975. data/lib/templates/wordpress/wp-includes/css/media-views.min.css +8 -0
  976. data/lib/templates/wordpress/wp-includes/css/wp-auth-check-rtl.css +109 -0
  977. data/lib/templates/wordpress/wp-includes/css/wp-auth-check-rtl.min.css +1 -0
  978. data/lib/templates/wordpress/wp-includes/css/wp-auth-check.css +109 -0
  979. data/lib/templates/wordpress/wp-includes/css/wp-auth-check.min.css +1 -0
  980. data/lib/templates/wordpress/wp-includes/css/wp-pointer-rtl.css +212 -0
  981. data/lib/templates/wordpress/wp-includes/css/wp-pointer-rtl.min.css +1 -0
  982. data/lib/templates/wordpress/wp-includes/css/wp-pointer.css +212 -0
  983. data/lib/templates/wordpress/wp-includes/css/wp-pointer.min.css +1 -0
  984. data/lib/templates/wordpress/wp-includes/date.php +1013 -0
  985. data/lib/templates/wordpress/wp-includes/default-constants.php +323 -0
  986. data/lib/templates/wordpress/wp-includes/default-filters.php +392 -0
  987. data/lib/templates/wordpress/wp-includes/default-widgets.php +1479 -0
  988. data/lib/templates/wordpress/wp-includes/deprecated.php +3493 -0
  989. data/lib/templates/wordpress/wp-includes/feed-atom-comments.php +115 -0
  990. data/lib/templates/wordpress/wp-includes/feed-atom.php +87 -0
  991. data/lib/templates/wordpress/wp-includes/feed-rdf.php +85 -0
  992. data/lib/templates/wordpress/wp-includes/feed-rss.php +46 -0
  993. data/lib/templates/wordpress/wp-includes/feed-rss2-comments.php +101 -0
  994. data/lib/templates/wordpress/wp-includes/feed-rss2.php +117 -0
  995. data/lib/templates/wordpress/wp-includes/feed.php +651 -0
  996. data/lib/templates/wordpress/wp-includes/fonts/dashicons.eot +0 -0
  997. data/lib/templates/wordpress/wp-includes/fonts/dashicons.svg +253 -0
  998. data/lib/templates/wordpress/wp-includes/fonts/dashicons.ttf +0 -0
  999. data/lib/templates/wordpress/wp-includes/fonts/dashicons.woff +0 -0
  1000. data/lib/templates/wordpress/wp-includes/formatting.php +4377 -0
  1001. data/lib/templates/wordpress/wp-includes/functions.php +4847 -0
  1002. data/lib/templates/wordpress/wp-includes/functions.wp-scripts.php +296 -0
  1003. data/lib/templates/wordpress/wp-includes/functions.wp-styles.php +222 -0
  1004. data/lib/templates/wordpress/wp-includes/general-template.php +3159 -0
  1005. data/lib/templates/wordpress/wp-includes/http.php +552 -0
  1006. data/lib/templates/wordpress/wp-includes/images/admin-bar-sprite-2x.png +0 -0
  1007. data/lib/templates/wordpress/wp-includes/images/admin-bar-sprite.png +0 -0
  1008. data/lib/templates/wordpress/wp-includes/images/arrow-pointer-blue-2x.png +0 -0
  1009. data/lib/templates/wordpress/wp-includes/images/arrow-pointer-blue.png +0 -0
  1010. data/lib/templates/wordpress/wp-includes/images/blank.gif +0 -0
  1011. data/lib/templates/wordpress/wp-includes/images/crystal/archive.png +0 -0
  1012. data/lib/templates/wordpress/wp-includes/images/crystal/audio.png +0 -0
  1013. data/lib/templates/wordpress/wp-includes/images/crystal/code.png +0 -0
  1014. data/lib/templates/wordpress/wp-includes/images/crystal/default.png +0 -0
  1015. data/lib/templates/wordpress/wp-includes/images/crystal/document.png +0 -0
  1016. data/lib/templates/wordpress/wp-includes/images/crystal/interactive.png +0 -0
  1017. data/lib/templates/wordpress/wp-includes/images/crystal/license.txt +9 -0
  1018. data/lib/templates/wordpress/wp-includes/images/crystal/spreadsheet.png +0 -0
  1019. data/lib/templates/wordpress/wp-includes/images/crystal/text.png +0 -0
  1020. data/lib/templates/wordpress/wp-includes/images/crystal/video.png +0 -0
  1021. data/lib/templates/wordpress/wp-includes/images/down_arrow-2x.gif +0 -0
  1022. data/lib/templates/wordpress/wp-includes/images/down_arrow.gif +0 -0
  1023. data/lib/templates/wordpress/wp-includes/images/icon-pointer-flag-2x.png +0 -0
  1024. data/lib/templates/wordpress/wp-includes/images/icon-pointer-flag.png +0 -0
  1025. data/lib/templates/wordpress/wp-includes/images/media/archive.png +0 -0
  1026. data/lib/templates/wordpress/wp-includes/images/media/audio.png +0 -0
  1027. data/lib/templates/wordpress/wp-includes/images/media/code.png +0 -0
  1028. data/lib/templates/wordpress/wp-includes/images/media/default.png +0 -0
  1029. data/lib/templates/wordpress/wp-includes/images/media/document.png +0 -0
  1030. data/lib/templates/wordpress/wp-includes/images/media/interactive.png +0 -0
  1031. data/lib/templates/wordpress/wp-includes/images/media/spreadsheet.png +0 -0
  1032. data/lib/templates/wordpress/wp-includes/images/media/text.png +0 -0
  1033. data/lib/templates/wordpress/wp-includes/images/media/video.png +0 -0
  1034. data/lib/templates/wordpress/wp-includes/images/rss-2x.png +0 -0
  1035. data/lib/templates/wordpress/wp-includes/images/rss.png +0 -0
  1036. data/lib/templates/wordpress/wp-includes/images/smilies/frownie.png +0 -0
  1037. data/lib/templates/wordpress/wp-includes/images/smilies/icon_arrow.gif +0 -0
  1038. data/lib/templates/wordpress/wp-includes/images/smilies/icon_biggrin.gif +0 -0
  1039. data/lib/templates/wordpress/wp-includes/images/smilies/icon_confused.gif +0 -0
  1040. data/lib/templates/wordpress/wp-includes/images/smilies/icon_cool.gif +0 -0
  1041. data/lib/templates/wordpress/wp-includes/images/smilies/icon_cry.gif +0 -0
  1042. data/lib/templates/wordpress/wp-includes/images/smilies/icon_eek.gif +0 -0
  1043. data/lib/templates/wordpress/wp-includes/images/smilies/icon_evil.gif +0 -0
  1044. data/lib/templates/wordpress/wp-includes/images/smilies/icon_exclaim.gif +0 -0
  1045. data/lib/templates/wordpress/wp-includes/images/smilies/icon_idea.gif +0 -0
  1046. data/lib/templates/wordpress/wp-includes/images/smilies/icon_lol.gif +0 -0
  1047. data/lib/templates/wordpress/wp-includes/images/smilies/icon_mad.gif +0 -0
  1048. data/lib/templates/wordpress/wp-includes/images/smilies/icon_mrgreen.gif +0 -0
  1049. data/lib/templates/wordpress/wp-includes/images/smilies/icon_neutral.gif +0 -0
  1050. data/lib/templates/wordpress/wp-includes/images/smilies/icon_question.gif +0 -0
  1051. data/lib/templates/wordpress/wp-includes/images/smilies/icon_razz.gif +0 -0
  1052. data/lib/templates/wordpress/wp-includes/images/smilies/icon_redface.gif +0 -0
  1053. data/lib/templates/wordpress/wp-includes/images/smilies/icon_rolleyes.gif +0 -0
  1054. data/lib/templates/wordpress/wp-includes/images/smilies/icon_sad.gif +0 -0
  1055. data/lib/templates/wordpress/wp-includes/images/smilies/icon_smile.gif +0 -0
  1056. data/lib/templates/wordpress/wp-includes/images/smilies/icon_surprised.gif +0 -0
  1057. data/lib/templates/wordpress/wp-includes/images/smilies/icon_twisted.gif +0 -0
  1058. data/lib/templates/wordpress/wp-includes/images/smilies/icon_wink.gif +0 -0
  1059. data/lib/templates/wordpress/wp-includes/images/smilies/mrgreen.png +0 -0
  1060. data/lib/templates/wordpress/wp-includes/images/smilies/rolleyes.png +0 -0
  1061. data/lib/templates/wordpress/wp-includes/images/smilies/simple-smile.png +0 -0
  1062. data/lib/templates/wordpress/wp-includes/images/spinner-2x.gif +0 -0
  1063. data/lib/templates/wordpress/wp-includes/images/spinner.gif +0 -0
  1064. data/lib/templates/wordpress/wp-includes/images/toggle-arrow-2x.png +0 -0
  1065. data/lib/templates/wordpress/wp-includes/images/toggle-arrow.png +0 -0
  1066. data/lib/templates/wordpress/wp-includes/images/uploader-icons-2x.png +0 -0
  1067. data/lib/templates/wordpress/wp-includes/images/uploader-icons.png +0 -0
  1068. data/lib/templates/wordpress/wp-includes/images/wlw/wp-comments.png +0 -0
  1069. data/lib/templates/wordpress/wp-includes/images/wlw/wp-icon.png +0 -0
  1070. data/lib/templates/wordpress/wp-includes/images/wlw/wp-watermark.png +0 -0
  1071. data/lib/templates/wordpress/wp-includes/images/wpicons-2x.png +0 -0
  1072. data/lib/templates/wordpress/wp-includes/images/wpicons.png +0 -0
  1073. data/lib/templates/wordpress/wp-includes/images/wpspin-2x.gif +0 -0
  1074. data/lib/templates/wordpress/wp-includes/images/wpspin.gif +0 -0
  1075. data/lib/templates/wordpress/wp-includes/images/xit-2x.gif +0 -0
  1076. data/lib/templates/wordpress/wp-includes/images/xit.gif +0 -0
  1077. data/lib/templates/wordpress/wp-includes/js/admin-bar.js +379 -0
  1078. data/lib/templates/wordpress/wp-includes/js/admin-bar.min.js +1 -0
  1079. data/lib/templates/wordpress/wp-includes/js/autosave.js +591 -0
  1080. data/lib/templates/wordpress/wp-includes/js/autosave.min.js +1 -0
  1081. data/lib/templates/wordpress/wp-includes/js/backbone.min.js +1 -0
  1082. data/lib/templates/wordpress/wp-includes/js/colorpicker.js +707 -0
  1083. data/lib/templates/wordpress/wp-includes/js/colorpicker.min.js +1 -0
  1084. data/lib/templates/wordpress/wp-includes/js/comment-reply.js +47 -0
  1085. data/lib/templates/wordpress/wp-includes/js/comment-reply.min.js +1 -0
  1086. data/lib/templates/wordpress/wp-includes/js/crop/cropper.css +165 -0
  1087. data/lib/templates/wordpress/wp-includes/js/crop/cropper.js +516 -0
  1088. data/lib/templates/wordpress/wp-includes/js/crop/marqueeHoriz.gif +0 -0
  1089. data/lib/templates/wordpress/wp-includes/js/crop/marqueeVert.gif +0 -0
  1090. data/lib/templates/wordpress/wp-includes/js/customize-base.js +647 -0
  1091. data/lib/templates/wordpress/wp-includes/js/customize-base.min.js +1 -0
  1092. data/lib/templates/wordpress/wp-includes/js/customize-loader.js +259 -0
  1093. data/lib/templates/wordpress/wp-includes/js/customize-loader.min.js +1 -0
  1094. data/lib/templates/wordpress/wp-includes/js/customize-models.js +247 -0
  1095. data/lib/templates/wordpress/wp-includes/js/customize-models.min.js +1 -0
  1096. data/lib/templates/wordpress/wp-includes/js/customize-preview-widgets.js +129 -0
  1097. data/lib/templates/wordpress/wp-includes/js/customize-preview-widgets.min.js +1 -0
  1098. data/lib/templates/wordpress/wp-includes/js/customize-preview.js +171 -0
  1099. data/lib/templates/wordpress/wp-includes/js/customize-preview.min.js +1 -0
  1100. data/lib/templates/wordpress/wp-includes/js/customize-views.js +231 -0
  1101. data/lib/templates/wordpress/wp-includes/js/customize-views.min.js +1 -0
  1102. data/lib/templates/wordpress/wp-includes/js/heartbeat.js +750 -0
  1103. data/lib/templates/wordpress/wp-includes/js/heartbeat.min.js +1 -0
  1104. data/lib/templates/wordpress/wp-includes/js/hoverIntent.js +115 -0
  1105. data/lib/templates/wordpress/wp-includes/js/hoverIntent.min.js +1 -0
  1106. data/lib/templates/wordpress/wp-includes/js/imgareaselect/border-anim-h.gif +0 -0
  1107. data/lib/templates/wordpress/wp-includes/js/imgareaselect/border-anim-v.gif +0 -0
  1108. data/lib/templates/wordpress/wp-includes/js/imgareaselect/imgareaselect.css +41 -0
  1109. data/lib/templates/wordpress/wp-includes/js/imgareaselect/jquery.imgareaselect.js +1205 -0
  1110. data/lib/templates/wordpress/wp-includes/js/imgareaselect/jquery.imgareaselect.min.js +1 -0
  1111. data/lib/templates/wordpress/wp-includes/js/jcrop/Jcrop.gif +0 -0
  1112. data/lib/templates/wordpress/wp-includes/js/jcrop/jquery.Jcrop.min.css +29 -0
  1113. data/lib/templates/wordpress/wp-includes/js/jcrop/jquery.Jcrop.min.js +22 -0
  1114. data/lib/templates/wordpress/wp-includes/js/jquery/jquery-migrate.js +521 -0
  1115. data/lib/templates/wordpress/wp-includes/js/jquery/jquery-migrate.min.js +2 -0
  1116. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.color.min.js +2 -0
  1117. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.form.js +1193 -0
  1118. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.form.min.js +11 -0
  1119. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.hotkeys.js +134 -0
  1120. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.hotkeys.min.js +1 -0
  1121. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.js +5 -0
  1122. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.masonry.min.js +11 -0
  1123. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.query.js +11 -0
  1124. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.schedule.js +36 -0
  1125. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.serialize-object.js +31 -0
  1126. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.table-hotkeys.js +99 -0
  1127. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.table-hotkeys.min.js +1 -0
  1128. data/lib/templates/wordpress/wp-includes/js/jquery/jquery.ui.touch-punch.js +11 -0
  1129. data/lib/templates/wordpress/wp-includes/js/jquery/suggest.js +316 -0
  1130. data/lib/templates/wordpress/wp-includes/js/jquery/suggest.min.js +1 -0
  1131. data/lib/templates/wordpress/wp-includes/js/jquery/ui/accordion.min.js +11 -0
  1132. data/lib/templates/wordpress/wp-includes/js/jquery/ui/autocomplete.min.js +11 -0
  1133. data/lib/templates/wordpress/wp-includes/js/jquery/ui/button.min.js +11 -0
  1134. data/lib/templates/wordpress/wp-includes/js/jquery/ui/core.min.js +11 -0
  1135. data/lib/templates/wordpress/wp-includes/js/jquery/ui/datepicker.min.js +12 -0
  1136. data/lib/templates/wordpress/wp-includes/js/jquery/ui/dialog.min.js +11 -0
  1137. data/lib/templates/wordpress/wp-includes/js/jquery/ui/draggable.min.js +11 -0
  1138. data/lib/templates/wordpress/wp-includes/js/jquery/ui/droppable.min.js +11 -0
  1139. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-blind.min.js +11 -0
  1140. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-bounce.min.js +11 -0
  1141. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-clip.min.js +11 -0
  1142. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-drop.min.js +11 -0
  1143. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-explode.min.js +11 -0
  1144. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-fade.min.js +11 -0
  1145. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-fold.min.js +11 -0
  1146. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-highlight.min.js +11 -0
  1147. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-puff.min.js +11 -0
  1148. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-pulsate.min.js +11 -0
  1149. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-scale.min.js +11 -0
  1150. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-shake.min.js +11 -0
  1151. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-size.min.js +11 -0
  1152. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-slide.min.js +11 -0
  1153. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-transfer.min.js +11 -0
  1154. data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect.min.js +21 -0
  1155. data/lib/templates/wordpress/wp-includes/js/jquery/ui/menu.min.js +11 -0
  1156. data/lib/templates/wordpress/wp-includes/js/jquery/ui/mouse.min.js +11 -0
  1157. data/lib/templates/wordpress/wp-includes/js/jquery/ui/position.min.js +11 -0
  1158. data/lib/templates/wordpress/wp-includes/js/jquery/ui/progressbar.min.js +11 -0
  1159. data/lib/templates/wordpress/wp-includes/js/jquery/ui/resizable.min.js +11 -0
  1160. data/lib/templates/wordpress/wp-includes/js/jquery/ui/selectable.min.js +11 -0
  1161. data/lib/templates/wordpress/wp-includes/js/jquery/ui/selectmenu.min.js +11 -0
  1162. data/lib/templates/wordpress/wp-includes/js/jquery/ui/slider.min.js +11 -0
  1163. data/lib/templates/wordpress/wp-includes/js/jquery/ui/sortable.min.js +11 -0
  1164. data/lib/templates/wordpress/wp-includes/js/jquery/ui/spinner.min.js +11 -0
  1165. data/lib/templates/wordpress/wp-includes/js/jquery/ui/tabs.min.js +11 -0
  1166. data/lib/templates/wordpress/wp-includes/js/jquery/ui/tooltip.min.js +11 -0
  1167. data/lib/templates/wordpress/wp-includes/js/jquery/ui/widget.min.js +11 -0
  1168. data/lib/templates/wordpress/wp-includes/js/json2.js +480 -0
  1169. data/lib/templates/wordpress/wp-includes/js/json2.min.js +1 -0
  1170. data/lib/templates/wordpress/wp-includes/js/masonry.min.js +17 -0
  1171. data/lib/templates/wordpress/wp-includes/js/mce-view.js +881 -0
  1172. data/lib/templates/wordpress/wp-includes/js/mce-view.min.js +1 -0
  1173. data/lib/templates/wordpress/wp-includes/js/media-audiovideo.js +934 -0
  1174. data/lib/templates/wordpress/wp-includes/js/media-audiovideo.min.js +1 -0
  1175. data/lib/templates/wordpress/wp-includes/js/media-editor.js +1114 -0
  1176. data/lib/templates/wordpress/wp-includes/js/media-editor.min.js +1 -0
  1177. data/lib/templates/wordpress/wp-includes/js/media-grid.js +863 -0
  1178. data/lib/templates/wordpress/wp-includes/js/media-grid.min.js +1 -0
  1179. data/lib/templates/wordpress/wp-includes/js/media-models.js +1503 -0
  1180. data/lib/templates/wordpress/wp-includes/js/media-models.min.js +1 -0
  1181. data/lib/templates/wordpress/wp-includes/js/media-views.js +8421 -0
  1182. data/lib/templates/wordpress/wp-includes/js/media-views.min.js +4 -0
  1183. data/lib/templates/wordpress/wp-includes/js/mediaelement/background.png +0 -0
  1184. data/lib/templates/wordpress/wp-includes/js/mediaelement/bigplay.png +0 -0
  1185. data/lib/templates/wordpress/wp-includes/js/mediaelement/bigplay.svg +1 -0
  1186. data/lib/templates/wordpress/wp-includes/js/mediaelement/controls.png +0 -0
  1187. data/lib/templates/wordpress/wp-includes/js/mediaelement/controls.svg +1 -0
  1188. data/lib/templates/wordpress/wp-includes/js/mediaelement/flashmediaelement.swf +0 -0
  1189. data/lib/templates/wordpress/wp-includes/js/mediaelement/froogaloop.min.js +4 -0
  1190. data/lib/templates/wordpress/wp-includes/js/mediaelement/loading.gif +0 -0
  1191. data/lib/templates/wordpress/wp-includes/js/mediaelement/mediaelement-and-player.min.js +28 -0
  1192. data/lib/templates/wordpress/wp-includes/js/mediaelement/mediaelementplayer.min.css +1 -0
  1193. data/lib/templates/wordpress/wp-includes/js/mediaelement/silverlightmediaelement.xap +0 -0
  1194. data/lib/templates/wordpress/wp-includes/js/mediaelement/skipback.png +0 -0
  1195. data/lib/templates/wordpress/wp-includes/js/mediaelement/wp-mediaelement.css +308 -0
  1196. data/lib/templates/wordpress/wp-includes/js/mediaelement/wp-mediaelement.js +34 -0
  1197. data/lib/templates/wordpress/wp-includes/js/mediaelement/wp-playlist.js +175 -0
  1198. data/lib/templates/wordpress/wp-includes/js/plupload/handlers.js +488 -0
  1199. data/lib/templates/wordpress/wp-includes/js/plupload/handlers.min.js +1 -0
  1200. data/lib/templates/wordpress/wp-includes/js/plupload/license.txt +339 -0
  1201. data/lib/templates/wordpress/wp-includes/js/plupload/plupload.flash.swf +0 -0
  1202. data/lib/templates/wordpress/wp-includes/js/plupload/plupload.full.min.js +28 -0
  1203. data/lib/templates/wordpress/wp-includes/js/plupload/plupload.silverlight.xap +0 -0
  1204. data/lib/templates/wordpress/wp-includes/js/plupload/wp-plupload.js +424 -0
  1205. data/lib/templates/wordpress/wp-includes/js/plupload/wp-plupload.min.js +1 -0
  1206. data/lib/templates/wordpress/wp-includes/js/quicktags.js +683 -0
  1207. data/lib/templates/wordpress/wp-includes/js/quicktags.min.js +1 -0
  1208. data/lib/templates/wordpress/wp-includes/js/shortcode.js +356 -0
  1209. data/lib/templates/wordpress/wp-includes/js/shortcode.min.js +1 -0
  1210. data/lib/templates/wordpress/wp-includes/js/swfobject.js +4 -0
  1211. data/lib/templates/wordpress/wp-includes/js/swfupload/handlers.js +376 -0
  1212. data/lib/templates/wordpress/wp-includes/js/swfupload/handlers.min.js +1 -0
  1213. data/lib/templates/wordpress/wp-includes/js/swfupload/license.txt +32 -0
  1214. data/lib/templates/wordpress/wp-includes/js/swfupload/plugins/swfupload.cookies.js +53 -0
  1215. data/lib/templates/wordpress/wp-includes/js/swfupload/plugins/swfupload.queue.js +98 -0
  1216. data/lib/templates/wordpress/wp-includes/js/swfupload/plugins/swfupload.speed.js +342 -0
  1217. data/lib/templates/wordpress/wp-includes/js/swfupload/plugins/swfupload.swfobject.js +105 -0
  1218. data/lib/templates/wordpress/wp-includes/js/swfupload/swfupload.js +980 -0
  1219. data/lib/templates/wordpress/wp-includes/js/swfupload/swfupload.swf +0 -0
  1220. data/lib/templates/wordpress/wp-includes/js/thickbox/loadingAnimation.gif +0 -0
  1221. data/lib/templates/wordpress/wp-includes/js/thickbox/macFFBgHack.png +0 -0
  1222. data/lib/templates/wordpress/wp-includes/js/thickbox/thickbox.css +138 -0
  1223. data/lib/templates/wordpress/wp-includes/js/thickbox/thickbox.js +314 -0
  1224. data/lib/templates/wordpress/wp-includes/js/tinymce/langs/wp-langs-en.js +519 -0
  1225. data/lib/templates/wordpress/wp-includes/js/tinymce/license.txt +504 -0
  1226. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/charmap/plugin.js +396 -0
  1227. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/charmap/plugin.min.js +1 -0
  1228. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/colorpicker/plugin.js +112 -0
  1229. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
  1230. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css +212 -0
  1231. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/compat3x/plugin.js +304 -0
  1232. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
  1233. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/directionality/plugin.js +64 -0
  1234. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/directionality/plugin.min.js +1 -0
  1235. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/fullscreen/plugin.js +136 -0
  1236. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
  1237. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/hr/plugin.js +30 -0
  1238. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/hr/plugin.min.js +1 -0
  1239. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/image/plugin.js +568 -0
  1240. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/image/plugin.min.js +1 -0
  1241. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/lists/plugin.js +813 -0
  1242. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/lists/plugin.min.js +1 -0
  1243. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/media/moxieplayer.swf +0 -0
  1244. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/media/plugin.js +782 -0
  1245. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/media/plugin.min.js +1 -0
  1246. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/paste/plugin.js +1606 -0
  1247. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/paste/plugin.min.js +1 -0
  1248. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/tabfocus/plugin.js +120 -0
  1249. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
  1250. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/textcolor/plugin.js +282 -0
  1251. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
  1252. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wordpress/plugin.js +754 -0
  1253. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +1 -0
  1254. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +207 -0
  1255. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js +1 -0
  1256. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js +92 -0
  1257. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpdialogs/plugin.min.js +1 -0
  1258. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +976 -0
  1259. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +1 -0
  1260. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpemoji/plugin.js +128 -0
  1261. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpemoji/plugin.min.js +1 -0
  1262. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js +76 -0
  1263. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.min.js +1 -0
  1264. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpgallery/plugin.js +112 -0
  1265. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpgallery/plugin.min.js +1 -0
  1266. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wplink/plugin.js +50 -0
  1267. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wplink/plugin.min.js +1 -0
  1268. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpview/plugin.js +738 -0
  1269. data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpview/plugin.min.js +1 -0
  1270. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
  1271. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/content.min.css +1 -0
  1272. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
  1273. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
  1274. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +62 -0
  1275. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  1276. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
  1277. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  1278. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg +63 -0
  1279. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  1280. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  1281. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
  1282. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/img/loader.gif +0 -0
  1283. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/img/object.gif +0 -0
  1284. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/img/trans.gif +0 -0
  1285. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
  1286. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/skin.min.css +1 -0
  1287. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/audio.png +0 -0
  1288. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png +0 -0
  1289. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no.png +0 -0
  1290. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/embedded.png +0 -0
  1291. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png +0 -0
  1292. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/gallery.png +0 -0
  1293. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/more-2x.png +0 -0
  1294. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/more.png +0 -0
  1295. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/pagebreak-2x.png +0 -0
  1296. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/pagebreak.png +0 -0
  1297. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/playlist-audio.png +0 -0
  1298. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/playlist-video.png +0 -0
  1299. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/video.png +0 -0
  1300. data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/wp-content.css +539 -0
  1301. data/lib/templates/wordpress/wp-includes/js/tinymce/themes/modern/theme.js +617 -0
  1302. data/lib/templates/wordpress/wp-includes/js/tinymce/themes/modern/theme.min.js +1 -0
  1303. data/lib/templates/wordpress/wp-includes/js/tinymce/tiny_mce_popup.js +542 -0
  1304. data/lib/templates/wordpress/wp-includes/js/tinymce/tinymce.min.js +14 -0
  1305. data/lib/templates/wordpress/wp-includes/js/tinymce/utils/editable_selects.js +70 -0
  1306. data/lib/templates/wordpress/wp-includes/js/tinymce/utils/form_utils.js +210 -0
  1307. data/lib/templates/wordpress/wp-includes/js/tinymce/utils/mctabs.js +164 -0
  1308. data/lib/templates/wordpress/wp-includes/js/tinymce/utils/validate.js +252 -0
  1309. data/lib/templates/wordpress/wp-includes/js/tinymce/wp-mce-help.php +142 -0
  1310. data/lib/templates/wordpress/wp-includes/js/tinymce/wp-tinymce.js.gz +0 -0
  1311. data/lib/templates/wordpress/wp-includes/js/tinymce/wp-tinymce.php +39 -0
  1312. data/lib/templates/wordpress/wp-includes/js/tw-sack.js +193 -0
  1313. data/lib/templates/wordpress/wp-includes/js/tw-sack.min.js +1 -0
  1314. data/lib/templates/wordpress/wp-includes/js/twemoji.js +542 -0
  1315. data/lib/templates/wordpress/wp-includes/js/twemoji.min.js +1 -0
  1316. data/lib/templates/wordpress/wp-includes/js/underscore.min.js +5 -0
  1317. data/lib/templates/wordpress/wp-includes/js/utils.js +197 -0
  1318. data/lib/templates/wordpress/wp-includes/js/utils.min.js +1 -0
  1319. data/lib/templates/wordpress/wp-includes/js/wp-a11y.js +46 -0
  1320. data/lib/templates/wordpress/wp-includes/js/wp-a11y.min.js +1 -0
  1321. data/lib/templates/wordpress/wp-includes/js/wp-ajax-response.js +64 -0
  1322. data/lib/templates/wordpress/wp-includes/js/wp-ajax-response.min.js +1 -0
  1323. data/lib/templates/wordpress/wp-includes/js/wp-auth-check.js +114 -0
  1324. data/lib/templates/wordpress/wp-includes/js/wp-auth-check.min.js +1 -0
  1325. data/lib/templates/wordpress/wp-includes/js/wp-backbone.js +386 -0
  1326. data/lib/templates/wordpress/wp-includes/js/wp-backbone.min.js +1 -0
  1327. data/lib/templates/wordpress/wp-includes/js/wp-emoji-loader.js +76 -0
  1328. data/lib/templates/wordpress/wp-includes/js/wp-emoji-loader.min.js +1 -0
  1329. data/lib/templates/wordpress/wp-includes/js/wp-emoji-release.min.js +4 -0
  1330. data/lib/templates/wordpress/wp-includes/js/wp-emoji.js +170 -0
  1331. data/lib/templates/wordpress/wp-includes/js/wp-emoji.min.js +1 -0
  1332. data/lib/templates/wordpress/wp-includes/js/wp-list-revisions.js +24 -0
  1333. data/lib/templates/wordpress/wp-includes/js/wp-list-revisions.min.js +1 -0
  1334. data/lib/templates/wordpress/wp-includes/js/wp-lists.js +469 -0
  1335. data/lib/templates/wordpress/wp-includes/js/wp-lists.min.js +1 -0
  1336. data/lib/templates/wordpress/wp-includes/js/wp-pointer.js +282 -0
  1337. data/lib/templates/wordpress/wp-includes/js/wp-pointer.min.js +1 -0
  1338. data/lib/templates/wordpress/wp-includes/js/wp-util.js +112 -0
  1339. data/lib/templates/wordpress/wp-includes/js/wp-util.min.js +1 -0
  1340. data/lib/templates/wordpress/wp-includes/js/wpdialog.js +19 -0
  1341. data/lib/templates/wordpress/wp-includes/js/wpdialog.min.js +1 -0
  1342. data/lib/templates/wordpress/wp-includes/js/wplink.js +707 -0
  1343. data/lib/templates/wordpress/wp-includes/js/wplink.min.js +1 -0
  1344. data/lib/templates/wordpress/wp-includes/js/zxcvbn-async.js +18 -0
  1345. data/lib/templates/wordpress/wp-includes/js/zxcvbn-async.min.js +1 -0
  1346. data/lib/templates/wordpress/wp-includes/js/zxcvbn.min.js +47 -0
  1347. data/lib/templates/wordpress/wp-includes/kses.php +1543 -0
  1348. data/lib/templates/wordpress/wp-includes/l10n.php +956 -0
  1349. data/lib/templates/wordpress/wp-includes/link-template.php +3631 -0
  1350. data/lib/templates/wordpress/wp-includes/load.php +828 -0
  1351. data/lib/templates/wordpress/wp-includes/locale.php +365 -0
  1352. data/lib/templates/wordpress/wp-includes/media-template.php +1250 -0
  1353. data/lib/templates/wordpress/wp-includes/media.php +3440 -0
  1354. data/lib/templates/wordpress/wp-includes/meta.php +1667 -0
  1355. data/lib/templates/wordpress/wp-includes/ms-blogs.php +946 -0
  1356. data/lib/templates/wordpress/wp-includes/ms-default-constants.php +153 -0
  1357. data/lib/templates/wordpress/wp-includes/ms-default-filters.php +87 -0
  1358. data/lib/templates/wordpress/wp-includes/ms-deprecated.php +349 -0
  1359. data/lib/templates/wordpress/wp-includes/ms-files.php +82 -0
  1360. data/lib/templates/wordpress/wp-includes/ms-functions.php +2433 -0
  1361. data/lib/templates/wordpress/wp-includes/ms-load.php +472 -0
  1362. data/lib/templates/wordpress/wp-includes/ms-settings.php +213 -0
  1363. data/lib/templates/wordpress/wp-includes/nav-menu-template.php +675 -0
  1364. data/lib/templates/wordpress/wp-includes/nav-menu.php +900 -0
  1365. data/lib/templates/wordpress/wp-includes/option.php +1462 -0
  1366. data/lib/templates/wordpress/wp-includes/pluggable-deprecated.php +192 -0
  1367. data/lib/templates/wordpress/wp-includes/pluggable.php +2347 -0
  1368. data/lib/templates/wordpress/wp-includes/plugin.php +907 -0
  1369. data/lib/templates/wordpress/wp-includes/pomo/entry.php +78 -0
  1370. data/lib/templates/wordpress/wp-includes/pomo/mo.php +265 -0
  1371. data/lib/templates/wordpress/wp-includes/pomo/po.php +408 -0
  1372. data/lib/templates/wordpress/wp-includes/pomo/streams.php +241 -0
  1373. data/lib/templates/wordpress/wp-includes/pomo/translations.php +324 -0
  1374. data/lib/templates/wordpress/wp-includes/post-formats.php +232 -0
  1375. data/lib/templates/wordpress/wp-includes/post-template.php +1831 -0
  1376. data/lib/templates/wordpress/wp-includes/post-thumbnail-template.php +160 -0
  1377. data/lib/templates/wordpress/wp-includes/post.php +5937 -0
  1378. data/lib/templates/wordpress/wp-includes/query.php +4725 -0
  1379. data/lib/templates/wordpress/wp-includes/registration-functions.php +7 -0
  1380. data/lib/templates/wordpress/wp-includes/registration.php +7 -0
  1381. data/lib/templates/wordpress/wp-includes/revision.php +657 -0
  1382. data/lib/templates/wordpress/wp-includes/rewrite.php +2195 -0
  1383. data/lib/templates/wordpress/wp-includes/rss-functions.php +9 -0
  1384. data/lib/templates/wordpress/wp-includes/rss.php +936 -0
  1385. data/lib/templates/wordpress/wp-includes/script-loader.php +1090 -0
  1386. data/lib/templates/wordpress/wp-includes/session.php +439 -0
  1387. data/lib/templates/wordpress/wp-includes/shortcodes.php +404 -0
  1388. data/lib/templates/wordpress/wp-includes/taxonomy.php +4726 -0
  1389. data/lib/templates/wordpress/wp-includes/template-loader.php +76 -0
  1390. data/lib/templates/wordpress/wp-includes/template.php +505 -0
  1391. data/lib/templates/wordpress/wp-includes/theme-compat/comments-popup.php +131 -0
  1392. data/lib/templates/wordpress/wp-includes/theme-compat/comments.php +114 -0
  1393. data/lib/templates/wordpress/wp-includes/theme-compat/footer.php +30 -0
  1394. data/lib/templates/wordpress/wp-includes/theme-compat/header.php +49 -0
  1395. data/lib/templates/wordpress/wp-includes/theme-compat/sidebar.php +83 -0
  1396. data/lib/templates/wordpress/wp-includes/theme.php +2048 -0
  1397. data/lib/templates/wordpress/wp-includes/update.php +692 -0
  1398. data/lib/templates/wordpress/wp-includes/user.php +2462 -0
  1399. data/lib/templates/wordpress/wp-includes/vars.php +144 -0
  1400. data/lib/templates/wordpress/wp-includes/version.php +35 -0
  1401. data/lib/templates/wordpress/wp-includes/widgets.php +1720 -0
  1402. data/lib/templates/wordpress/wp-includes/wlwmanifest.xml +43 -0
  1403. data/lib/templates/wordpress/wp-includes/wp-db.php +2949 -0
  1404. data/lib/templates/wordpress/wp-includes/wp-diff.php +544 -0
  1405. data/lib/templates/wordpress/wp-links-opml.php +80 -0
  1406. data/lib/templates/wordpress/wp-load.php +81 -0
  1407. data/lib/templates/wordpress/wp-login.php +987 -0
  1408. data/lib/templates/wordpress/wp-mail.php +260 -0
  1409. data/lib/templates/wordpress/wp-settings.php +374 -0
  1410. data/lib/templates/wordpress/wp-signup.php +732 -0
  1411. data/lib/templates/wordpress/wp-trackback.php +127 -0
  1412. data/lib/templates/wordpress/xmlrpc.php +101 -0
  1413. metadata +1455 -0
@@ -0,0 +1,3254 @@
1
+ <?php
2
+ /**
3
+ * A File upgrader class for WordPress.
4
+ *
5
+ * This set of classes are designed to be used to upgrade/install a local set of files on the filesystem via the Filesystem Abstraction classes.
6
+ *
7
+ * @link https://core.trac.wordpress.org/ticket/7875 consolidate plugin/theme/core upgrade/install functions
8
+ *
9
+ * @package WordPress
10
+ * @subpackage Upgrader
11
+ * @since 2.8.0
12
+ */
13
+
14
+ require ABSPATH . 'wp-admin/includes/class-wp-upgrader-skins.php';
15
+
16
+ /**
17
+ * WordPress Upgrader class for Upgrading/Installing a local set of files via the Filesystem Abstraction classes from a Zip file.
18
+ *
19
+ * @package WordPress
20
+ * @subpackage Upgrader
21
+ * @since 2.8.0
22
+ */
23
+ class WP_Upgrader {
24
+
25
+ /**
26
+ * The error/notification strings used to update the user on the progress.
27
+ *
28
+ * @since 2.8.0
29
+ * @var string $strings
30
+ */
31
+ public $strings = array();
32
+
33
+ /**
34
+ * The upgrader skin being used.
35
+ *
36
+ * @since 2.8.0
37
+ * @var WP_Upgrader_Skin $skin
38
+ */
39
+ public $skin = null;
40
+
41
+ /**
42
+ * The result of the installation.
43
+ *
44
+ * This is set by {@see WP_Upgrader::install_package()}, only when the package is installed
45
+ * successfully. It will then be an array, unless a {@see WP_Error} is returned by the
46
+ * {@see 'upgrader_post_install'} filter. In that case, the `WP_Error` will be assigned to
47
+ * it.
48
+ *
49
+ * @since 2.8.0
50
+ * @var WP_Error|array $result {
51
+ * @type string $source The full path to the source the files were installed from.
52
+ * @type string $source_files List of all the files in the source directory.
53
+ * @type string $destination The full path to the install destination folder.
54
+ * @type string $destination_name The name of the destination folder, or empty if `$destination`
55
+ * and `$local_destination` are the same.
56
+ * @type string $local_destination The full local path to the destination folder. This is usually
57
+ * the same as `$destination`.
58
+ * @type string $remote_destination The full remote path to the destination folder
59
+ * (i.e., from `$wp_filesystem`).
60
+ * @type bool $clear_destination Whether the destination folder was cleared.
61
+ * }
62
+ */
63
+ public $result = array();
64
+
65
+ /**
66
+ * The total number of updates being performed.
67
+ *
68
+ * Set by the bulk update methods.
69
+ *
70
+ * @since 3.0.0
71
+ * @var int $update_count
72
+ */
73
+ public $update_count = 0;
74
+
75
+ /**
76
+ * The current update if multiple updates are being performed.
77
+ *
78
+ * Used by the bulk update methods, and incremented for each update.
79
+ *
80
+ * @since 3.0.0
81
+ * @var int
82
+ */
83
+ public $update_current = 0;
84
+
85
+ /**
86
+ * Construct the upgrader with a skin.
87
+ *
88
+ * @since 2.8.0
89
+ *
90
+ * @param WP_Upgrader_Skin $skin The upgrader skin to use. Default is a {@see WP_Upgrader_Skin}
91
+ * instance.
92
+ */
93
+ public function __construct( $skin = null ) {
94
+ if ( null == $skin )
95
+ $this->skin = new WP_Upgrader_Skin();
96
+ else
97
+ $this->skin = $skin;
98
+ }
99
+
100
+ /**
101
+ * Initialize the upgrader.
102
+ *
103
+ * This will set the relationship between the skin being used and this upgrader,
104
+ * and also add the generic strings to `WP_Upgrader::$strings`.
105
+ *
106
+ * @since 2.8.0
107
+ */
108
+ public function init() {
109
+ $this->skin->set_upgrader($this);
110
+ $this->generic_strings();
111
+ }
112
+
113
+ /**
114
+ * Add the generic strings to WP_Upgrader::$strings.
115
+ *
116
+ * @since 2.8.0
117
+ */
118
+ public function generic_strings() {
119
+ $this->strings['bad_request'] = __('Invalid Data provided.');
120
+ $this->strings['fs_unavailable'] = __('Could not access filesystem.');
121
+ $this->strings['fs_error'] = __('Filesystem error.');
122
+ $this->strings['fs_no_root_dir'] = __('Unable to locate WordPress Root directory.');
123
+ $this->strings['fs_no_content_dir'] = __('Unable to locate WordPress Content directory (wp-content).');
124
+ $this->strings['fs_no_plugins_dir'] = __('Unable to locate WordPress Plugin directory.');
125
+ $this->strings['fs_no_themes_dir'] = __('Unable to locate WordPress Theme directory.');
126
+ /* translators: %s: directory name */
127
+ $this->strings['fs_no_folder'] = __('Unable to locate needed folder (%s).');
128
+
129
+ $this->strings['download_failed'] = __('Download failed.');
130
+ $this->strings['installing_package'] = __('Installing the latest version&#8230;');
131
+ $this->strings['no_files'] = __('The package contains no files.');
132
+ $this->strings['folder_exists'] = __('Destination folder already exists.');
133
+ $this->strings['mkdir_failed'] = __('Could not create directory.');
134
+ $this->strings['incompatible_archive'] = __('The package could not be installed.');
135
+
136
+ $this->strings['maintenance_start'] = __('Enabling Maintenance mode&#8230;');
137
+ $this->strings['maintenance_end'] = __('Disabling Maintenance mode&#8230;');
138
+ }
139
+
140
+ /**
141
+ * Connect to the filesystem.
142
+ *
143
+ * @since 2.8.0
144
+ *
145
+ * @param array $directories Optional. A list of directories. If any of these do
146
+ * not exist, a {@see WP_Error} object will be returned.
147
+ * Default empty array.
148
+ * @param bool $allow_relaxed_file_ownership Whether to allow relaxed file ownership.
149
+ * Default false.
150
+ * @return bool|WP_Error True if able to connect, false or a {@see WP_Error} otherwise.
151
+ */
152
+ public function fs_connect( $directories = array(), $allow_relaxed_file_ownership = false ) {
153
+ global $wp_filesystem;
154
+
155
+ if ( false === ( $credentials = $this->skin->request_filesystem_credentials( false, $directories[0], $allow_relaxed_file_ownership ) ) ) {
156
+ return false;
157
+ }
158
+
159
+ if ( ! WP_Filesystem( $credentials, $directories[0], $allow_relaxed_file_ownership ) ) {
160
+ $error = true;
161
+ if ( is_object($wp_filesystem) && $wp_filesystem->errors->get_error_code() )
162
+ $error = $wp_filesystem->errors;
163
+ // Failed to connect, Error and request again
164
+ $this->skin->request_filesystem_credentials( $error, $directories[0], $allow_relaxed_file_ownership );
165
+ return false;
166
+ }
167
+
168
+ if ( ! is_object($wp_filesystem) )
169
+ return new WP_Error('fs_unavailable', $this->strings['fs_unavailable'] );
170
+
171
+ if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() )
172
+ return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors);
173
+
174
+ foreach ( (array)$directories as $dir ) {
175
+ switch ( $dir ) {
176
+ case ABSPATH:
177
+ if ( ! $wp_filesystem->abspath() )
178
+ return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
179
+ break;
180
+ case WP_CONTENT_DIR:
181
+ if ( ! $wp_filesystem->wp_content_dir() )
182
+ return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
183
+ break;
184
+ case WP_PLUGIN_DIR:
185
+ if ( ! $wp_filesystem->wp_plugins_dir() )
186
+ return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
187
+ break;
188
+ case get_theme_root():
189
+ if ( ! $wp_filesystem->wp_themes_dir() )
190
+ return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
191
+ break;
192
+ default:
193
+ if ( ! $wp_filesystem->find_folder($dir) )
194
+ return new WP_Error( 'fs_no_folder', sprintf( $this->strings['fs_no_folder'], esc_html( basename( $dir ) ) ) );
195
+ break;
196
+ }
197
+ }
198
+ return true;
199
+ } //end fs_connect();
200
+
201
+ /**
202
+ * Download a package.
203
+ *
204
+ * @since 2.8.0
205
+ *
206
+ * @param string $package The URI of the package. If this is the full path to an
207
+ * existing local file, it will be returned untouched.
208
+ * @return string|WP_Error The full path to the downloaded package file, or a {@see WP_Error} object.
209
+ */
210
+ public function download_package( $package ) {
211
+
212
+ /**
213
+ * Filter whether to return the package.
214
+ *
215
+ * @since 3.7.0
216
+ *
217
+ * @param bool $reply Whether to bail without returning the package.
218
+ * Default false.
219
+ * @param string $package The package file name.
220
+ * @param WP_Upgrader $this The WP_Upgrader instance.
221
+ */
222
+ $reply = apply_filters( 'upgrader_pre_download', false, $package, $this );
223
+ if ( false !== $reply )
224
+ return $reply;
225
+
226
+ if ( ! preg_match('!^(http|https|ftp)://!i', $package) && file_exists($package) ) //Local file or remote?
227
+ return $package; //must be a local file..
228
+
229
+ if ( empty($package) )
230
+ return new WP_Error('no_package', $this->strings['no_package']);
231
+
232
+ $this->skin->feedback('downloading_package', $package);
233
+
234
+ $download_file = download_url($package);
235
+
236
+ if ( is_wp_error($download_file) )
237
+ return new WP_Error('download_failed', $this->strings['download_failed'], $download_file->get_error_message());
238
+
239
+ return $download_file;
240
+ }
241
+
242
+ /**
243
+ * Unpack a compressed package file.
244
+ *
245
+ * @since 2.8.0
246
+ *
247
+ * @param string $package Full path to the package file.
248
+ * @param bool $delete_package Optional. Whether to delete the package file after attempting
249
+ * to unpack it. Default true.
250
+ * @return string|WP_Error The path to the unpacked contents, or a {@see WP_Error} on failure.
251
+ */
252
+ public function unpack_package( $package, $delete_package = true ) {
253
+ global $wp_filesystem;
254
+
255
+ $this->skin->feedback('unpack_package');
256
+
257
+ $upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/';
258
+
259
+ //Clean up contents of upgrade directory beforehand.
260
+ $upgrade_files = $wp_filesystem->dirlist($upgrade_folder);
261
+ if ( !empty($upgrade_files) ) {
262
+ foreach ( $upgrade_files as $file )
263
+ $wp_filesystem->delete($upgrade_folder . $file['name'], true);
264
+ }
265
+
266
+ // We need a working directory - Strip off any .tmp or .zip suffixes
267
+ $working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' );
268
+
269
+ // Clean up working directory
270
+ if ( $wp_filesystem->is_dir($working_dir) )
271
+ $wp_filesystem->delete($working_dir, true);
272
+
273
+ // Unzip package to working directory
274
+ $result = unzip_file( $package, $working_dir );
275
+
276
+ // Once extracted, delete the package if required.
277
+ if ( $delete_package )
278
+ unlink($package);
279
+
280
+ if ( is_wp_error($result) ) {
281
+ $wp_filesystem->delete($working_dir, true);
282
+ if ( 'incompatible_archive' == $result->get_error_code() ) {
283
+ return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $result->get_error_data() );
284
+ }
285
+ return $result;
286
+ }
287
+
288
+ return $working_dir;
289
+ }
290
+
291
+ /**
292
+ * Install a package.
293
+ *
294
+ * Copies the contents of a package form a source directory, and installs them in
295
+ * a destination directory. Optionally removes the source. It can also optionally
296
+ * clear out the destination folder if it already exists.
297
+ *
298
+ * @since 2.8.0
299
+ *
300
+ * @param array|string $args {
301
+ * Optional. Array or string of arguments for installing a package. Default empty array.
302
+ *
303
+ * @type string $source Required path to the package source. Default empty.
304
+ * @type string $destination Required path to a folder to install the package in.
305
+ * Default empty.
306
+ * @type bool $clear_destination Whether to delete any files already in the destination
307
+ * folder. Default false.
308
+ * @type bool $clear_working Whether to delete the files form the working directory
309
+ * after copying to the destination. Default false.
310
+ * @type bool $abort_if_destination_exists Whether to abort the installation if
311
+ * the destination folder already exists. Default true.
312
+ * @type array $hook_extra Extra arguments to pass to the filter hooks called by
313
+ * {@see WP_Upgrader::install_package()}. Default empty array.
314
+ * }
315
+ *
316
+ * @return array|WP_Error The result (also stored in `WP_Upgrader:$result`), or a {@see WP_Error} on failure.
317
+ */
318
+ public function install_package( $args = array() ) {
319
+ global $wp_filesystem, $wp_theme_directories;
320
+
321
+ $defaults = array(
322
+ 'source' => '', // Please always pass this
323
+ 'destination' => '', // and this
324
+ 'clear_destination' => false,
325
+ 'clear_working' => false,
326
+ 'abort_if_destination_exists' => true,
327
+ 'hook_extra' => array()
328
+ );
329
+
330
+ $args = wp_parse_args($args, $defaults);
331
+
332
+ // These were previously extract()'d.
333
+ $source = $args['source'];
334
+ $destination = $args['destination'];
335
+ $clear_destination = $args['clear_destination'];
336
+
337
+ @set_time_limit( 300 );
338
+
339
+ if ( empty( $source ) || empty( $destination ) ) {
340
+ return new WP_Error( 'bad_request', $this->strings['bad_request'] );
341
+ }
342
+ $this->skin->feedback( 'installing_package' );
343
+
344
+ /**
345
+ * Filter the install response before the installation has started.
346
+ *
347
+ * Returning a truthy value, or one that could be evaluated as a WP_Error
348
+ * will effectively short-circuit the installation, returning that value
349
+ * instead.
350
+ *
351
+ * @since 2.8.0
352
+ *
353
+ * @param bool|WP_Error $response Response.
354
+ * @param array $hook_extra Extra arguments passed to hooked filters.
355
+ */
356
+ $res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );
357
+ if ( is_wp_error( $res ) ) {
358
+ return $res;
359
+ }
360
+
361
+ //Retain the Original source and destinations
362
+ $remote_source = $args['source'];
363
+ $local_destination = $destination;
364
+
365
+ $source_files = array_keys( $wp_filesystem->dirlist( $remote_source ) );
366
+ $remote_destination = $wp_filesystem->find_folder( $local_destination );
367
+
368
+ //Locate which directory to copy to the new folder, This is based on the actual folder holding the files.
369
+ if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { //Only one folder? Then we want its contents.
370
+ $source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] );
371
+ } elseif ( count( $source_files ) == 0 ) {
372
+ return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files?
373
+ } else { //It's only a single file, the upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename.
374
+ $source = trailingslashit( $args['source'] );
375
+ }
376
+
377
+ /**
378
+ * Filter the source file location for the upgrade package.
379
+ *
380
+ * @since 2.8.0
381
+ *
382
+ * @param string $source File source location.
383
+ * @param string $remote_source Remove file source location.
384
+ * @param WP_Upgrader $this WP_Upgrader instance.
385
+ */
386
+ $source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this );
387
+ if ( is_wp_error( $source ) ) {
388
+ return $source;
389
+ }
390
+
391
+ // Has the source location changed? If so, we need a new source_files list.
392
+ if ( $source !== $remote_source ) {
393
+ $source_files = array_keys( $wp_filesystem->dirlist( $source ) );
394
+ }
395
+ /*
396
+ * Protection against deleting files in any important base directories.
397
+ * Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the
398
+ * destination directory (WP_PLUGIN_DIR / wp-content/themes) intending
399
+ * to copy the directory into the directory, whilst they pass the source
400
+ * as the actual files to copy.
401
+ */
402
+ $protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' );
403
+
404
+ if ( is_array( $wp_theme_directories ) ) {
405
+ $protected_directories = array_merge( $protected_directories, $wp_theme_directories );
406
+ }
407
+ if ( in_array( $destination, $protected_directories ) ) {
408
+ $remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) );
409
+ $destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) );
410
+ }
411
+
412
+ if ( $clear_destination ) {
413
+ //We're going to clear the destination if there's something there
414
+ $this->skin->feedback('remove_old');
415
+ $removed = true;
416
+ if ( $wp_filesystem->exists( $remote_destination ) ) {
417
+ $removed = $wp_filesystem->delete( $remote_destination, true );
418
+ }
419
+
420
+ /**
421
+ * Filter whether the upgrader cleared the destination.
422
+ *
423
+ * @since 2.8.0
424
+ *
425
+ * @param bool $removed Whether the destination was cleared.
426
+ * @param string $local_destination The local package destination.
427
+ * @param string $remote_destination The remote package destination.
428
+ * @param array $hook_extra Extra arguments passed to hooked filters.
429
+ */
430
+ $removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
431
+
432
+ if ( is_wp_error($removed) ) {
433
+ return $removed;
434
+ } elseif ( ! $removed ) {
435
+ return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
436
+ }
437
+ } elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists($remote_destination) ) {
438
+ //If we're not clearing the destination folder and something exists there already, Bail.
439
+ //But first check to see if there are actually any files in the folder.
440
+ $_files = $wp_filesystem->dirlist($remote_destination);
441
+ if ( ! empty($_files) ) {
442
+ $wp_filesystem->delete($remote_source, true); //Clear out the source files.
443
+ return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination );
444
+ }
445
+ }
446
+
447
+ //Create destination if needed
448
+ if ( ! $wp_filesystem->exists( $remote_destination ) ) {
449
+ if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {
450
+ return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination );
451
+ }
452
+ }
453
+ // Copy new version of item into place.
454
+ $result = copy_dir($source, $remote_destination);
455
+ if ( is_wp_error($result) ) {
456
+ if ( $args['clear_working'] ) {
457
+ $wp_filesystem->delete( $remote_source, true );
458
+ }
459
+ return $result;
460
+ }
461
+
462
+ //Clear the Working folder?
463
+ if ( $args['clear_working'] ) {
464
+ $wp_filesystem->delete( $remote_source, true );
465
+ }
466
+
467
+ $destination_name = basename( str_replace($local_destination, '', $destination) );
468
+ if ( '.' == $destination_name ) {
469
+ $destination_name = '';
470
+ }
471
+
472
+ $this->result = compact( 'source', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination' );
473
+
474
+ /**
475
+ * Filter the install response after the installation has finished.
476
+ *
477
+ * @since 2.8.0
478
+ *
479
+ * @param bool $response Install response.
480
+ * @param array $hook_extra Extra arguments passed to hooked filters.
481
+ * @param array $result Installation result data.
482
+ */
483
+ $res = apply_filters( 'upgrader_post_install', true, $args['hook_extra'], $this->result );
484
+
485
+ if ( is_wp_error($res) ) {
486
+ $this->result = $res;
487
+ return $res;
488
+ }
489
+
490
+ //Bombard the calling function will all the info which we've just used.
491
+ return $this->result;
492
+ }
493
+
494
+ /**
495
+ * Run an upgrade/install.
496
+ *
497
+ * Attempts to download the package (if it is not a local file), unpack it, and
498
+ * install it in the destination folder.
499
+ *
500
+ * @since 2.8.0
501
+ *
502
+ * @param array $options {
503
+ * Array or string of arguments for upgrading/installing a package.
504
+ *
505
+ * @type string $package The full path or URI of the package to install.
506
+ * Default empty.
507
+ * @type string $destination The full path to the destination folder.
508
+ * Default empty.
509
+ * @type bool $clear_destination Whether to delete any files already in the
510
+ * destination folder. Default false.
511
+ * @type bool $clear_working Whether to delete the files form the working
512
+ * directory after copying to the destination.
513
+ * Default false.
514
+ * @type bool $abort_if_destination_exists Whether to abort the installation if the destination
515
+ * folder already exists. When true, `$clear_destination`
516
+ * should be false. Default true.
517
+ * @type bool $is_multi Whether this run is one of multiple upgrade/install
518
+ * actions being performed in bulk. When true, the skin
519
+ * {@see WP_Upgrader::header()} and {@see WP_Upgrader::footer()}
520
+ * aren't called. Default false.
521
+ * @type array $hook_extra Extra arguments to pass to the filter hooks called by
522
+ * {@see WP_Upgrader::run()}.
523
+ * }
524
+ *
525
+ * @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,
526
+ * or false if unable to connect to the filesystem.
527
+ */
528
+ public function run( $options ) {
529
+
530
+ $defaults = array(
531
+ 'package' => '', // Please always pass this.
532
+ 'destination' => '', // And this
533
+ 'clear_destination' => false,
534
+ 'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please
535
+ 'clear_working' => true,
536
+ 'is_multi' => false,
537
+ 'hook_extra' => array() // Pass any extra $hook_extra args here, this will be passed to any hooked filters.
538
+ );
539
+
540
+ $options = wp_parse_args( $options, $defaults );
541
+
542
+ if ( ! $options['is_multi'] ) { // call $this->header separately if running multiple times
543
+ $this->skin->header();
544
+ }
545
+
546
+ // Connect to the Filesystem first.
547
+ $res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );
548
+ // Mainly for non-connected filesystem.
549
+ if ( ! $res ) {
550
+ if ( ! $options['is_multi'] ) {
551
+ $this->skin->footer();
552
+ }
553
+ return false;
554
+ }
555
+
556
+ $this->skin->before();
557
+
558
+ if ( is_wp_error($res) ) {
559
+ $this->skin->error($res);
560
+ $this->skin->after();
561
+ if ( ! $options['is_multi'] ) {
562
+ $this->skin->footer();
563
+ }
564
+ return $res;
565
+ }
566
+
567
+ //Download the package (Note, This just returns the filename of the file if the package is a local file)
568
+ $download = $this->download_package( $options['package'] );
569
+ if ( is_wp_error($download) ) {
570
+ $this->skin->error($download);
571
+ $this->skin->after();
572
+ if ( ! $options['is_multi'] ) {
573
+ $this->skin->footer();
574
+ }
575
+ return $download;
576
+ }
577
+
578
+ $delete_package = ( $download != $options['package'] ); // Do not delete a "local" file
579
+
580
+ //Unzips the file into a temporary directory
581
+ $working_dir = $this->unpack_package( $download, $delete_package );
582
+ if ( is_wp_error($working_dir) ) {
583
+ $this->skin->error($working_dir);
584
+ $this->skin->after();
585
+ if ( ! $options['is_multi'] ) {
586
+ $this->skin->footer();
587
+ }
588
+ return $working_dir;
589
+ }
590
+
591
+ //With the given options, this installs it to the destination directory.
592
+ $result = $this->install_package( array(
593
+ 'source' => $working_dir,
594
+ 'destination' => $options['destination'],
595
+ 'clear_destination' => $options['clear_destination'],
596
+ 'abort_if_destination_exists' => $options['abort_if_destination_exists'],
597
+ 'clear_working' => $options['clear_working'],
598
+ 'hook_extra' => $options['hook_extra']
599
+ ) );
600
+
601
+ $this->skin->set_result($result);
602
+ if ( is_wp_error($result) ) {
603
+ $this->skin->error($result);
604
+ $this->skin->feedback('process_failed');
605
+ } else {
606
+ //Install Succeeded
607
+ $this->skin->feedback('process_success');
608
+ }
609
+
610
+ $this->skin->after();
611
+
612
+ if ( ! $options['is_multi'] ) {
613
+
614
+ /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
615
+ do_action( 'upgrader_process_complete', $this, $options['hook_extra'] );
616
+ $this->skin->footer();
617
+ }
618
+
619
+ return $result;
620
+ }
621
+
622
+ /**
623
+ * Toggle maintenance mode for the site.
624
+ *
625
+ * Creates/deletes the maintenance file to enable/disable maintenance mode.
626
+ *
627
+ * @since 2.8.0
628
+ *
629
+ * @param bool $enable True to enable maintenance mode, false to disable.
630
+ */
631
+ public function maintenance_mode( $enable = false ) {
632
+ global $wp_filesystem;
633
+ $file = $wp_filesystem->abspath() . '.maintenance';
634
+ if ( $enable ) {
635
+ $this->skin->feedback('maintenance_start');
636
+ // Create maintenance file to signal that we are upgrading
637
+ $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
638
+ $wp_filesystem->delete($file);
639
+ $wp_filesystem->put_contents($file, $maintenance_string, FS_CHMOD_FILE);
640
+ } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
641
+ $this->skin->feedback('maintenance_end');
642
+ $wp_filesystem->delete($file);
643
+ }
644
+ }
645
+
646
+ }
647
+
648
+ /**
649
+ * Plugin Upgrader class for WordPress Plugins, It is designed to upgrade/install plugins from a local zip, remote zip URL, or uploaded zip file.
650
+ *
651
+ * @package WordPress
652
+ * @subpackage Upgrader
653
+ * @since 2.8.0
654
+ */
655
+ class Plugin_Upgrader extends WP_Upgrader {
656
+
657
+ /**
658
+ * Plugin upgrade result.
659
+ *
660
+ * @since 2.8.0
661
+ * @var array|WP_Error $result
662
+ * @see WP_Upgrader::$result
663
+ */
664
+ public $result;
665
+
666
+ /**
667
+ * Whether a bulk upgrade/install is being performed.
668
+ *
669
+ * @since 2.9.0
670
+ * @var bool $bulk
671
+ */
672
+ public $bulk = false;
673
+
674
+ /**
675
+ * Initialize the upgrade strings.
676
+ *
677
+ * @since 2.8.0
678
+ */
679
+ public function upgrade_strings() {
680
+ $this->strings['up_to_date'] = __('The plugin is at the latest version.');
681
+ $this->strings['no_package'] = __('Update package not available.');
682
+ $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>&#8230;');
683
+ $this->strings['unpack_package'] = __('Unpacking the update&#8230;');
684
+ $this->strings['remove_old'] = __('Removing the old version of the plugin&#8230;');
685
+ $this->strings['remove_old_failed'] = __('Could not remove the old plugin.');
686
+ $this->strings['process_failed'] = __('Plugin update failed.');
687
+ $this->strings['process_success'] = __('Plugin updated successfully.');
688
+ $this->strings['process_bulk_success'] = __('Plugins updated successfully.');
689
+ }
690
+
691
+ /**
692
+ * Initialize the install strings.
693
+ *
694
+ * @since 2.8.0
695
+ */
696
+ public function install_strings() {
697
+ $this->strings['no_package'] = __('Install package not available.');
698
+ $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>&#8230;');
699
+ $this->strings['unpack_package'] = __('Unpacking the package&#8230;');
700
+ $this->strings['installing_package'] = __('Installing the plugin&#8230;');
701
+ $this->strings['no_files'] = __('The plugin contains no files.');
702
+ $this->strings['process_failed'] = __('Plugin install failed.');
703
+ $this->strings['process_success'] = __('Plugin installed successfully.');
704
+ }
705
+
706
+ /**
707
+ * Install a plugin package.
708
+ *
709
+ * @since 2.8.0
710
+ * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
711
+ *
712
+ * @param string $package The full local path or URI of the package.
713
+ * @param array $args {
714
+ * Optional. Other arguments for installing a plugin package. Default empty array.
715
+ *
716
+ * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful.
717
+ * Default true.
718
+ * }
719
+ *
720
+ * @return bool|WP_Error True if the install was successful, false or a WP_Error otherwise.
721
+ */
722
+ public function install( $package, $args = array() ) {
723
+
724
+ $defaults = array(
725
+ 'clear_update_cache' => true,
726
+ );
727
+ $parsed_args = wp_parse_args( $args, $defaults );
728
+
729
+ $this->init();
730
+ $this->install_strings();
731
+
732
+ add_filter('upgrader_source_selection', array($this, 'check_package') );
733
+
734
+ $this->run( array(
735
+ 'package' => $package,
736
+ 'destination' => WP_PLUGIN_DIR,
737
+ 'clear_destination' => false, // Do not overwrite files.
738
+ 'clear_working' => true,
739
+ 'hook_extra' => array(
740
+ 'type' => 'plugin',
741
+ 'action' => 'install',
742
+ )
743
+ ) );
744
+
745
+ remove_filter('upgrader_source_selection', array($this, 'check_package') );
746
+
747
+ if ( ! $this->result || is_wp_error($this->result) )
748
+ return $this->result;
749
+
750
+ // Force refresh of plugin update information
751
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
752
+
753
+ return true;
754
+ }
755
+
756
+ /**
757
+ * Upgrade a plugin.
758
+ *
759
+ * @since 2.8.0
760
+ * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
761
+ *
762
+ * @param string $plugin The basename path to the main plugin file.
763
+ * @param array $args {
764
+ * Optional. Other arguments for upgrading a plugin package. Defualt empty array.
765
+ *
766
+ * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful.
767
+ * Default true.
768
+ * }
769
+ * @return bool|WP_Error True if the upgrade was successful, false or a {@see WP_Error} object otherwise.
770
+ */
771
+ public function upgrade( $plugin, $args = array() ) {
772
+
773
+ $defaults = array(
774
+ 'clear_update_cache' => true,
775
+ );
776
+ $parsed_args = wp_parse_args( $args, $defaults );
777
+
778
+ $this->init();
779
+ $this->upgrade_strings();
780
+
781
+ $current = get_site_transient( 'update_plugins' );
782
+ if ( !isset( $current->response[ $plugin ] ) ) {
783
+ $this->skin->before();
784
+ $this->skin->set_result(false);
785
+ $this->skin->error('up_to_date');
786
+ $this->skin->after();
787
+ return false;
788
+ }
789
+
790
+ // Get the URL to the zip file
791
+ $r = $current->response[ $plugin ];
792
+
793
+ add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2);
794
+ add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
795
+ //'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
796
+
797
+ $this->run( array(
798
+ 'package' => $r->package,
799
+ 'destination' => WP_PLUGIN_DIR,
800
+ 'clear_destination' => true,
801
+ 'clear_working' => true,
802
+ 'hook_extra' => array(
803
+ 'plugin' => $plugin,
804
+ 'type' => 'plugin',
805
+ 'action' => 'update',
806
+ ),
807
+ ) );
808
+
809
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
810
+ remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'));
811
+ remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
812
+
813
+ if ( ! $this->result || is_wp_error($this->result) )
814
+ return $this->result;
815
+
816
+ // Force refresh of plugin update information
817
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
818
+
819
+ return true;
820
+ }
821
+
822
+ /**
823
+ * Bulk upgrade several plugins at once.
824
+ *
825
+ * @since 2.8.0
826
+ * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
827
+ *
828
+ * @param array $plugins Array of the basename paths of the plugins' main files.
829
+ * @param array $args {
830
+ * Optional. Other arguments for upgrading several plugins at once. Default empty array.
831
+ *
832
+ * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful.
833
+ * Default true.
834
+ * }
835
+ *
836
+ * @return array|false An array of results indexed by plugin file, or false if unable to connect to the filesystem.
837
+ */
838
+ public function bulk_upgrade( $plugins, $args = array() ) {
839
+
840
+ $defaults = array(
841
+ 'clear_update_cache' => true,
842
+ );
843
+ $parsed_args = wp_parse_args( $args, $defaults );
844
+
845
+ $this->init();
846
+ $this->bulk = true;
847
+ $this->upgrade_strings();
848
+
849
+ $current = get_site_transient( 'update_plugins' );
850
+
851
+ add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
852
+
853
+ $this->skin->header();
854
+
855
+ // Connect to the Filesystem first.
856
+ $res = $this->fs_connect( array(WP_CONTENT_DIR, WP_PLUGIN_DIR) );
857
+ if ( ! $res ) {
858
+ $this->skin->footer();
859
+ return false;
860
+ }
861
+
862
+ $this->skin->bulk_header();
863
+
864
+ // Only start maintenance mode if:
865
+ // - running Multisite and there are one or more plugins specified, OR
866
+ // - a plugin with an update available is currently active.
867
+ // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
868
+ $maintenance = ( is_multisite() && ! empty( $plugins ) );
869
+ foreach ( $plugins as $plugin )
870
+ $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
871
+ if ( $maintenance )
872
+ $this->maintenance_mode(true);
873
+
874
+ $results = array();
875
+
876
+ $this->update_count = count($plugins);
877
+ $this->update_current = 0;
878
+ foreach ( $plugins as $plugin ) {
879
+ $this->update_current++;
880
+ $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);
881
+
882
+ if ( !isset( $current->response[ $plugin ] ) ) {
883
+ $this->skin->set_result('up_to_date');
884
+ $this->skin->before();
885
+ $this->skin->feedback('up_to_date');
886
+ $this->skin->after();
887
+ $results[$plugin] = true;
888
+ continue;
889
+ }
890
+
891
+ // Get the URL to the zip file
892
+ $r = $current->response[ $plugin ];
893
+
894
+ $this->skin->plugin_active = is_plugin_active($plugin);
895
+
896
+ $result = $this->run( array(
897
+ 'package' => $r->package,
898
+ 'destination' => WP_PLUGIN_DIR,
899
+ 'clear_destination' => true,
900
+ 'clear_working' => true,
901
+ 'is_multi' => true,
902
+ 'hook_extra' => array(
903
+ 'plugin' => $plugin
904
+ )
905
+ ) );
906
+
907
+ $results[$plugin] = $this->result;
908
+
909
+ // Prevent credentials auth screen from displaying multiple times
910
+ if ( false === $result )
911
+ break;
912
+ } //end foreach $plugins
913
+
914
+ $this->maintenance_mode(false);
915
+
916
+ /**
917
+ * Fires when the bulk upgrader process is complete.
918
+ *
919
+ * @since 3.6.0
920
+ *
921
+ * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might
922
+ * be a Theme_Upgrader or Core_Upgrade instance.
923
+ * @param array $data {
924
+ * Array of bulk item update data.
925
+ *
926
+ * @type string $action Type of action. Default 'update'.
927
+ * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
928
+ * @type bool $bulk Whether the update process is a bulk update. Default true.
929
+ * @type array $packages Array of plugin, theme, or core packages to update.
930
+ * }
931
+ */
932
+ do_action( 'upgrader_process_complete', $this, array(
933
+ 'action' => 'update',
934
+ 'type' => 'plugin',
935
+ 'bulk' => true,
936
+ 'plugins' => $plugins,
937
+ ) );
938
+
939
+ $this->skin->bulk_footer();
940
+
941
+ $this->skin->footer();
942
+
943
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
944
+ remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
945
+
946
+ // Force refresh of plugin update information
947
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
948
+
949
+ return $results;
950
+ }
951
+
952
+ /**
953
+ * Check a source package to be sure it contains a plugin.
954
+ *
955
+ * This function is added to the {@see 'upgrader_source_selection'} filter by
956
+ * {@see Plugin_Upgrader::install()}.
957
+ *
958
+ * @since 3.3.0
959
+ *
960
+ * @param string $source The path to the downloaded package source.
961
+ * @return string|WP_Error The source as passed, or a {@see WP_Error} object if no plugins were found.
962
+ */
963
+ public function check_package($source) {
964
+ global $wp_filesystem;
965
+
966
+ if ( is_wp_error($source) )
967
+ return $source;
968
+
969
+ $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit(WP_CONTENT_DIR), $source);
970
+ if ( ! is_dir($working_directory) ) // Sanity check, if the above fails, let's not prevent installation.
971
+ return $source;
972
+
973
+ // Check the folder contains at least 1 valid plugin.
974
+ $plugins_found = false;
975
+ foreach ( glob( $working_directory . '*.php' ) as $file ) {
976
+ $info = get_plugin_data($file, false, false);
977
+ if ( !empty( $info['Name'] ) ) {
978
+ $plugins_found = true;
979
+ break;
980
+ }
981
+ }
982
+
983
+ if ( ! $plugins_found )
984
+ return new WP_Error( 'incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __( 'No valid plugins were found.' ) );
985
+
986
+ return $source;
987
+ }
988
+
989
+ /**
990
+ * Retrieve the path to the file that contains the plugin info.
991
+ *
992
+ * This isn't used internally in the class, but is called by the skins.
993
+ *
994
+ * @since 2.8.0
995
+ *
996
+ * @return string|false The full path to the main plugin file, or false.
997
+ */
998
+ public function plugin_info() {
999
+ if ( ! is_array($this->result) )
1000
+ return false;
1001
+ if ( empty($this->result['destination_name']) )
1002
+ return false;
1003
+
1004
+ $plugin = get_plugins('/' . $this->result['destination_name']); //Ensure to pass with leading slash
1005
+ if ( empty($plugin) )
1006
+ return false;
1007
+
1008
+ $pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list
1009
+
1010
+ return $this->result['destination_name'] . '/' . $pluginfiles[0];
1011
+ }
1012
+
1013
+ /**
1014
+ * Deactivates a plugin before it is upgraded.
1015
+ *
1016
+ * Hooked to the {@see 'upgrader_pre_install'} filter by {@see Plugin_Upgrader::upgrade()}.
1017
+ *
1018
+ * @since 2.8.0
1019
+ * @since 4.1.0 Added a return value.
1020
+ *
1021
+ * @param bool|WP_Error $return Upgrade offer return.
1022
+ * @param array $plugin Plugin package arguments.
1023
+ * @return bool|WP_Error The passed in $return param or {@see WP_Error}.
1024
+ */
1025
+ public function deactivate_plugin_before_upgrade($return, $plugin) {
1026
+
1027
+ if ( is_wp_error($return) ) //Bypass.
1028
+ return $return;
1029
+
1030
+ // When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it
1031
+ if ( defined( 'DOING_CRON' ) && DOING_CRON )
1032
+ return $return;
1033
+
1034
+ $plugin = isset($plugin['plugin']) ? $plugin['plugin'] : '';
1035
+ if ( empty($plugin) )
1036
+ return new WP_Error('bad_request', $this->strings['bad_request']);
1037
+
1038
+ if ( is_plugin_active($plugin) ) {
1039
+ //Deactivate the plugin silently, Prevent deactivation hooks from running.
1040
+ deactivate_plugins($plugin, true);
1041
+ }
1042
+
1043
+ return $return;
1044
+ }
1045
+
1046
+ /**
1047
+ * Delete the old plugin during an upgrade.
1048
+ *
1049
+ * Hooked to the {@see 'upgrader_clear_destination'} filter by
1050
+ * {@see Plugin_Upgrader::upgrade()} and {@see Plugin_Upgrader::bulk_upgrade()}.
1051
+ *
1052
+ * @since 2.8.0
1053
+ */
1054
+ public function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
1055
+ global $wp_filesystem;
1056
+
1057
+ if ( is_wp_error($removed) )
1058
+ return $removed; //Pass errors through.
1059
+
1060
+ $plugin = isset($plugin['plugin']) ? $plugin['plugin'] : '';
1061
+ if ( empty($plugin) )
1062
+ return new WP_Error('bad_request', $this->strings['bad_request']);
1063
+
1064
+ $plugins_dir = $wp_filesystem->wp_plugins_dir();
1065
+ $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
1066
+
1067
+ if ( ! $wp_filesystem->exists($this_plugin_dir) ) //If it's already vanished.
1068
+ return $removed;
1069
+
1070
+ // If plugin is in its own directory, recursively delete the directory.
1071
+ if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory separator AND that it's not the root plugin folder
1072
+ $deleted = $wp_filesystem->delete($this_plugin_dir, true);
1073
+ else
1074
+ $deleted = $wp_filesystem->delete($plugins_dir . $plugin);
1075
+
1076
+ if ( ! $deleted )
1077
+ return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
1078
+
1079
+ return true;
1080
+ }
1081
+ }
1082
+
1083
+ /**
1084
+ * Theme Upgrader class for WordPress Themes, It is designed to upgrade/install themes from a local zip, remote zip URL, or uploaded zip file.
1085
+ *
1086
+ * @package WordPress
1087
+ * @subpackage Upgrader
1088
+ * @since 2.8.0
1089
+ */
1090
+ class Theme_Upgrader extends WP_Upgrader {
1091
+
1092
+ /**
1093
+ * Result of the theme upgrade offer.
1094
+ *
1095
+ * @since 2.8.0
1096
+ * @var array|WP_Erorr $result
1097
+ * @see WP_Upgrader::$result
1098
+ */
1099
+ public $result;
1100
+
1101
+ /**
1102
+ * Whether multiple plugins are being upgraded/installed in bulk.
1103
+ *
1104
+ * @since 2.9.0
1105
+ * @var bool $bulk
1106
+ */
1107
+ public $bulk = false;
1108
+
1109
+ /**
1110
+ * Initialize the upgrade strings.
1111
+ *
1112
+ * @since 2.8.0
1113
+ */
1114
+ public function upgrade_strings() {
1115
+ $this->strings['up_to_date'] = __('The theme is at the latest version.');
1116
+ $this->strings['no_package'] = __('Update package not available.');
1117
+ $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>&#8230;');
1118
+ $this->strings['unpack_package'] = __('Unpacking the update&#8230;');
1119
+ $this->strings['remove_old'] = __('Removing the old version of the theme&#8230;');
1120
+ $this->strings['remove_old_failed'] = __('Could not remove the old theme.');
1121
+ $this->strings['process_failed'] = __('Theme update failed.');
1122
+ $this->strings['process_success'] = __('Theme updated successfully.');
1123
+ }
1124
+
1125
+ /**
1126
+ * Initialize the install strings.
1127
+ *
1128
+ * @since 2.8.0
1129
+ */
1130
+ public function install_strings() {
1131
+ $this->strings['no_package'] = __('Install package not available.');
1132
+ $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>&#8230;');
1133
+ $this->strings['unpack_package'] = __('Unpacking the package&#8230;');
1134
+ $this->strings['installing_package'] = __('Installing the theme&#8230;');
1135
+ $this->strings['no_files'] = __('The theme contains no files.');
1136
+ $this->strings['process_failed'] = __('Theme install failed.');
1137
+ $this->strings['process_success'] = __('Theme installed successfully.');
1138
+ /* translators: 1: theme name, 2: version */
1139
+ $this->strings['process_success_specific'] = __('Successfully installed the theme <strong>%1$s %2$s</strong>.');
1140
+ $this->strings['parent_theme_search'] = __('This theme requires a parent theme. Checking if it is installed&#8230;');
1141
+ /* translators: 1: theme name, 2: version */
1142
+ $this->strings['parent_theme_prepare_install'] = __('Preparing to install <strong>%1$s %2$s</strong>&#8230;');
1143
+ /* translators: 1: theme name, 2: version */
1144
+ $this->strings['parent_theme_currently_installed'] = __('The parent theme, <strong>%1$s %2$s</strong>, is currently installed.');
1145
+ /* translators: 1: theme name, 2: version */
1146
+ $this->strings['parent_theme_install_success'] = __('Successfully installed the parent theme, <strong>%1$s %2$s</strong>.');
1147
+ $this->strings['parent_theme_not_found'] = __('<strong>The parent theme could not be found.</strong> You will need to install the parent theme, <strong>%s</strong>, before you can use this child theme.');
1148
+ }
1149
+
1150
+ /**
1151
+ * Check if a child theme is being installed and we need to install its parent.
1152
+ *
1153
+ * Hooked to the {@see 'upgrader_post_install'} filter by {@see Theme_Upgrader::install()}.
1154
+ *
1155
+ * @since 3.4.0
1156
+ */
1157
+ public function check_parent_theme_filter( $install_result, $hook_extra, $child_result ) {
1158
+ // Check to see if we need to install a parent theme
1159
+ $theme_info = $this->theme_info();
1160
+
1161
+ if ( ! $theme_info->parent() )
1162
+ return $install_result;
1163
+
1164
+ $this->skin->feedback( 'parent_theme_search' );
1165
+
1166
+ if ( ! $theme_info->parent()->errors() ) {
1167
+ $this->skin->feedback( 'parent_theme_currently_installed', $theme_info->parent()->display('Name'), $theme_info->parent()->display('Version') );
1168
+ // We already have the theme, fall through.
1169
+ return $install_result;
1170
+ }
1171
+
1172
+ // We don't have the parent theme, let's install it.
1173
+ $api = themes_api('theme_information', array('slug' => $theme_info->get('Template'), 'fields' => array('sections' => false, 'tags' => false) ) ); //Save on a bit of bandwidth.
1174
+
1175
+ if ( ! $api || is_wp_error($api) ) {
1176
+ $this->skin->feedback( 'parent_theme_not_found', $theme_info->get('Template') );
1177
+ // Don't show activate or preview actions after install
1178
+ add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
1179
+ return $install_result;
1180
+ }
1181
+
1182
+ // Backup required data we're going to override:
1183
+ $child_api = $this->skin->api;
1184
+ $child_success_message = $this->strings['process_success'];
1185
+
1186
+ // Override them
1187
+ $this->skin->api = $api;
1188
+ $this->strings['process_success_specific'] = $this->strings['parent_theme_install_success'];//, $api->name, $api->version);
1189
+
1190
+ $this->skin->feedback('parent_theme_prepare_install', $api->name, $api->version);
1191
+
1192
+ add_filter('install_theme_complete_actions', '__return_false', 999); // Don't show any actions after installing the theme.
1193
+
1194
+ // Install the parent theme
1195
+ $parent_result = $this->run( array(
1196
+ 'package' => $api->download_link,
1197
+ 'destination' => get_theme_root(),
1198
+ 'clear_destination' => false, //Do not overwrite files.
1199
+ 'clear_working' => true
1200
+ ) );
1201
+
1202
+ if ( is_wp_error($parent_result) )
1203
+ add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
1204
+
1205
+ // Start cleaning up after the parents installation
1206
+ remove_filter('install_theme_complete_actions', '__return_false', 999);
1207
+
1208
+ // Reset child's result and data
1209
+ $this->result = $child_result;
1210
+ $this->skin->api = $child_api;
1211
+ $this->strings['process_success'] = $child_success_message;
1212
+
1213
+ return $install_result;
1214
+ }
1215
+
1216
+ /**
1217
+ * Don't display the activate and preview actions to the user.
1218
+ *
1219
+ * Hooked to the {@see 'install_theme_complete_actions'} filter by
1220
+ * {@see Theme_Upgrader::check_parent_theme_filter()} when installing
1221
+ * a child theme and installing the parent theme fails.
1222
+ *
1223
+ * @since 3.4.0
1224
+ *
1225
+ * @param array $actions Preview actions.
1226
+ */
1227
+ public function hide_activate_preview_actions( $actions ) {
1228
+ unset($actions['activate'], $actions['preview']);
1229
+ return $actions;
1230
+ }
1231
+
1232
+ /**
1233
+ * Install a theme package.
1234
+ *
1235
+ * @since 2.8.0
1236
+ * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
1237
+ *
1238
+ * @param string $package The full local path or URI of the package.
1239
+ * @param array $args {
1240
+ * Optional. Other arguments for installing a theme package. Default empty array.
1241
+ *
1242
+ * @type bool $clear_update_cache Whether to clear the updates cache if successful.
1243
+ * Default true.
1244
+ * }
1245
+ *
1246
+ * @return bool|WP_Error True if the install was successful, false or a {@see WP_Error} object otherwise.
1247
+ */
1248
+ public function install( $package, $args = array() ) {
1249
+
1250
+ $defaults = array(
1251
+ 'clear_update_cache' => true,
1252
+ );
1253
+ $parsed_args = wp_parse_args( $args, $defaults );
1254
+
1255
+ $this->init();
1256
+ $this->install_strings();
1257
+
1258
+ add_filter('upgrader_source_selection', array($this, 'check_package') );
1259
+ add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3);
1260
+
1261
+ $this->run( array(
1262
+ 'package' => $package,
1263
+ 'destination' => get_theme_root(),
1264
+ 'clear_destination' => false, //Do not overwrite files.
1265
+ 'clear_working' => true,
1266
+ 'hook_extra' => array(
1267
+ 'type' => 'theme',
1268
+ 'action' => 'install',
1269
+ ),
1270
+ ) );
1271
+
1272
+ remove_filter('upgrader_source_selection', array($this, 'check_package') );
1273
+ remove_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'));
1274
+
1275
+ if ( ! $this->result || is_wp_error($this->result) )
1276
+ return $this->result;
1277
+
1278
+ // Refresh the Theme Update information
1279
+ wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
1280
+
1281
+ return true;
1282
+ }
1283
+
1284
+ /**
1285
+ * Upgrade a theme.
1286
+ *
1287
+ * @since 2.8.0
1288
+ * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
1289
+ *
1290
+ * @param string $theme The theme slug.
1291
+ * @param array $args {
1292
+ * Optional. Other arguments for upgrading a theme. Default empty array.
1293
+ *
1294
+ * @type bool $clear_update_cache Whether to clear the update cache if successful.
1295
+ * Default true.
1296
+ * }
1297
+ * @return bool|WP_Error True if the upgrade was successful, false or a {@see WP_Error} object otherwise.
1298
+ */
1299
+ public function upgrade( $theme, $args = array() ) {
1300
+
1301
+ $defaults = array(
1302
+ 'clear_update_cache' => true,
1303
+ );
1304
+ $parsed_args = wp_parse_args( $args, $defaults );
1305
+
1306
+ $this->init();
1307
+ $this->upgrade_strings();
1308
+
1309
+ // Is an update available?
1310
+ $current = get_site_transient( 'update_themes' );
1311
+ if ( !isset( $current->response[ $theme ] ) ) {
1312
+ $this->skin->before();
1313
+ $this->skin->set_result(false);
1314
+ $this->skin->error( 'up_to_date' );
1315
+ $this->skin->after();
1316
+ return false;
1317
+ }
1318
+
1319
+ $r = $current->response[ $theme ];
1320
+
1321
+ add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
1322
+ add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
1323
+ add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
1324
+
1325
+ $this->run( array(
1326
+ 'package' => $r['package'],
1327
+ 'destination' => get_theme_root( $theme ),
1328
+ 'clear_destination' => true,
1329
+ 'clear_working' => true,
1330
+ 'hook_extra' => array(
1331
+ 'theme' => $theme,
1332
+ 'type' => 'theme',
1333
+ 'action' => 'update',
1334
+ ),
1335
+ ) );
1336
+
1337
+ remove_filter('upgrader_pre_install', array($this, 'current_before'));
1338
+ remove_filter('upgrader_post_install', array($this, 'current_after'));
1339
+ remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
1340
+
1341
+ if ( ! $this->result || is_wp_error($this->result) )
1342
+ return $this->result;
1343
+
1344
+ wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
1345
+
1346
+ return true;
1347
+ }
1348
+
1349
+ /**
1350
+ * Upgrade several themes at once.
1351
+ *
1352
+ * @since 3.0.0
1353
+ * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
1354
+ *
1355
+ * @param array $themes The theme slugs.
1356
+ * @param array $args {
1357
+ * Optional. Other arguments for upgrading several themes at once. Default empty array.
1358
+ *
1359
+ * @type bool $clear_update_cache Whether to clear the update cache if successful.
1360
+ * Default true.
1361
+ * }
1362
+ * @return array[]|false An array of results, or false if unable to connect to the filesystem.
1363
+ */
1364
+ public function bulk_upgrade( $themes, $args = array() ) {
1365
+
1366
+ $defaults = array(
1367
+ 'clear_update_cache' => true,
1368
+ );
1369
+ $parsed_args = wp_parse_args( $args, $defaults );
1370
+
1371
+ $this->init();
1372
+ $this->bulk = true;
1373
+ $this->upgrade_strings();
1374
+
1375
+ $current = get_site_transient( 'update_themes' );
1376
+
1377
+ add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
1378
+ add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
1379
+ add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
1380
+
1381
+ $this->skin->header();
1382
+
1383
+ // Connect to the Filesystem first.
1384
+ $res = $this->fs_connect( array(WP_CONTENT_DIR) );
1385
+ if ( ! $res ) {
1386
+ $this->skin->footer();
1387
+ return false;
1388
+ }
1389
+
1390
+ $this->skin->bulk_header();
1391
+
1392
+ // Only start maintenance mode if:
1393
+ // - running Multisite and there are one or more themes specified, OR
1394
+ // - a theme with an update available is currently in use.
1395
+ // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
1396
+ $maintenance = ( is_multisite() && ! empty( $themes ) );
1397
+ foreach ( $themes as $theme )
1398
+ $maintenance = $maintenance || $theme == get_stylesheet() || $theme == get_template();
1399
+ if ( $maintenance )
1400
+ $this->maintenance_mode(true);
1401
+
1402
+ $results = array();
1403
+
1404
+ $this->update_count = count($themes);
1405
+ $this->update_current = 0;
1406
+ foreach ( $themes as $theme ) {
1407
+ $this->update_current++;
1408
+
1409
+ $this->skin->theme_info = $this->theme_info($theme);
1410
+
1411
+ if ( !isset( $current->response[ $theme ] ) ) {
1412
+ $this->skin->set_result(true);
1413
+ $this->skin->before();
1414
+ $this->skin->feedback( 'up_to_date' );
1415
+ $this->skin->after();
1416
+ $results[$theme] = true;
1417
+ continue;
1418
+ }
1419
+
1420
+ // Get the URL to the zip file
1421
+ $r = $current->response[ $theme ];
1422
+
1423
+ $result = $this->run( array(
1424
+ 'package' => $r['package'],
1425
+ 'destination' => get_theme_root( $theme ),
1426
+ 'clear_destination' => true,
1427
+ 'clear_working' => true,
1428
+ 'is_multi' => true,
1429
+ 'hook_extra' => array(
1430
+ 'theme' => $theme
1431
+ ),
1432
+ ) );
1433
+
1434
+ $results[$theme] = $this->result;
1435
+
1436
+ // Prevent credentials auth screen from displaying multiple times
1437
+ if ( false === $result )
1438
+ break;
1439
+ } //end foreach $plugins
1440
+
1441
+ $this->maintenance_mode(false);
1442
+
1443
+ /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
1444
+ do_action( 'upgrader_process_complete', $this, array(
1445
+ 'action' => 'update',
1446
+ 'type' => 'theme',
1447
+ 'bulk' => true,
1448
+ 'themes' => $themes,
1449
+ ) );
1450
+
1451
+ $this->skin->bulk_footer();
1452
+
1453
+ $this->skin->footer();
1454
+
1455
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
1456
+ remove_filter('upgrader_pre_install', array($this, 'current_before'));
1457
+ remove_filter('upgrader_post_install', array($this, 'current_after'));
1458
+ remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
1459
+
1460
+ // Refresh the Theme Update information
1461
+ wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
1462
+
1463
+ return $results;
1464
+ }
1465
+
1466
+ /**
1467
+ * Check that the package source contains a valid theme.
1468
+ *
1469
+ * Hooked to the {@see 'upgrader_source_selection'} filter by {@see Theme_Upgrader::install()}.
1470
+ * It will return an error if the theme doesn't have style.css or index.php
1471
+ * files.
1472
+ *
1473
+ * @since 3.3.0
1474
+ *
1475
+ * @param string $source The full path to the package source.
1476
+ * @return string|WP_Error The source or a WP_Error.
1477
+ */
1478
+ public function check_package( $source ) {
1479
+ global $wp_filesystem;
1480
+
1481
+ if ( is_wp_error($source) )
1482
+ return $source;
1483
+
1484
+ // Check the folder contains a valid theme
1485
+ $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit(WP_CONTENT_DIR), $source);
1486
+ if ( ! is_dir($working_directory) ) // Sanity check, if the above fails, let's not prevent installation.
1487
+ return $source;
1488
+
1489
+ // A proper archive should have a style.css file in the single subdirectory
1490
+ if ( ! file_exists( $working_directory . 'style.css' ) )
1491
+ return new WP_Error( 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'], __( 'The theme is missing the <code>style.css</code> stylesheet.' ) );
1492
+
1493
+ $info = get_file_data( $working_directory . 'style.css', array( 'Name' => 'Theme Name', 'Template' => 'Template' ) );
1494
+
1495
+ if ( empty( $info['Name'] ) )
1496
+ return new WP_Error( 'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'], __( "The <code>style.css</code> stylesheet doesn't contain a valid theme header." ) );
1497
+
1498
+ // If it's not a child theme, it must have at least an index.php to be legit.
1499
+ if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) )
1500
+ return new WP_Error( 'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'], __( 'The theme is missing the <code>index.php</code> file.' ) );
1501
+
1502
+ return $source;
1503
+ }
1504
+
1505
+ /**
1506
+ * Turn on maintenance mode before attempting to upgrade the current theme.
1507
+ *
1508
+ * Hooked to the {@see 'upgrader_pre_install'} filter by {@see Theme_Upgrader::upgrade()} and
1509
+ * {@see Theme_Upgrader::bulk_upgrade()}.
1510
+ *
1511
+ * @since 2.8.0
1512
+ */
1513
+ public function current_before($return, $theme) {
1514
+
1515
+ if ( is_wp_error($return) )
1516
+ return $return;
1517
+
1518
+ $theme = isset($theme['theme']) ? $theme['theme'] : '';
1519
+
1520
+ if ( $theme != get_stylesheet() ) //If not current
1521
+ return $return;
1522
+ //Change to maintenance mode now.
1523
+ if ( ! $this->bulk )
1524
+ $this->maintenance_mode(true);
1525
+
1526
+ return $return;
1527
+ }
1528
+
1529
+ /**
1530
+ * Turn off maintenance mode after upgrading the current theme.
1531
+ *
1532
+ * Hooked to the {@see 'upgrader_post_install'} filter by {@see Theme_Upgrader::upgrade()}
1533
+ * and {@see Theme_Upgrader::bulk_upgrade()}.
1534
+ *
1535
+ * @since 2.8.0
1536
+ */
1537
+ public function current_after($return, $theme) {
1538
+ if ( is_wp_error($return) )
1539
+ return $return;
1540
+
1541
+ $theme = isset($theme['theme']) ? $theme['theme'] : '';
1542
+
1543
+ if ( $theme != get_stylesheet() ) // If not current
1544
+ return $return;
1545
+
1546
+ // Ensure stylesheet name hasn't changed after the upgrade:
1547
+ if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) {
1548
+ wp_clean_themes_cache();
1549
+ $stylesheet = $this->result['destination_name'];
1550
+ switch_theme( $stylesheet );
1551
+ }
1552
+
1553
+ //Time to remove maintenance mode
1554
+ if ( ! $this->bulk )
1555
+ $this->maintenance_mode(false);
1556
+ return $return;
1557
+ }
1558
+
1559
+ /**
1560
+ * Delete the old theme during an upgrade.
1561
+ *
1562
+ * Hooked to the {@see 'upgrader_clear_destination'} filter by {@see Theme_Upgrader::upgrade()}
1563
+ * and {@see Theme_Upgrader::bulk_upgrade()}.
1564
+ *
1565
+ * @since 2.8.0
1566
+ */
1567
+ public function delete_old_theme( $removed, $local_destination, $remote_destination, $theme ) {
1568
+ global $wp_filesystem;
1569
+
1570
+ if ( is_wp_error( $removed ) )
1571
+ return $removed; // Pass errors through.
1572
+
1573
+ if ( ! isset( $theme['theme'] ) )
1574
+ return $removed;
1575
+
1576
+ $theme = $theme['theme'];
1577
+ $themes_dir = trailingslashit( $wp_filesystem->wp_themes_dir( $theme ) );
1578
+ if ( $wp_filesystem->exists( $themes_dir . $theme ) ) {
1579
+ if ( ! $wp_filesystem->delete( $themes_dir . $theme, true ) )
1580
+ return false;
1581
+ }
1582
+
1583
+ return true;
1584
+ }
1585
+
1586
+ /**
1587
+ * Get the WP_Theme object for a theme.
1588
+ *
1589
+ * @since 2.8.0
1590
+ * @since 3.0.0 The `$theme` argument was added.
1591
+ *
1592
+ * @param string $theme The directory name of the theme. This is optional, and if not supplied,
1593
+ * the directory name from the last result will be used.
1594
+ * @return WP_Theme|false The theme's info object, or false `$theme` is not supplied
1595
+ * and the last result isn't set.
1596
+ */
1597
+ public function theme_info($theme = null) {
1598
+
1599
+ if ( empty($theme) ) {
1600
+ if ( !empty($this->result['destination_name']) )
1601
+ $theme = $this->result['destination_name'];
1602
+ else
1603
+ return false;
1604
+ }
1605
+ return wp_get_theme( $theme );
1606
+ }
1607
+
1608
+ }
1609
+
1610
+ add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1611
+
1612
+ /**
1613
+ * Language pack upgrader, for updating translations of plugins, themes, and core.
1614
+ *
1615
+ * @package WordPress
1616
+ * @subpackage Upgrader
1617
+ * @since 3.7.0
1618
+ */
1619
+ class Language_Pack_Upgrader extends WP_Upgrader {
1620
+
1621
+ /**
1622
+ * Result of the language pack upgrade.
1623
+ *
1624
+ * @since 3.7.0
1625
+ * @var array|WP_Error $result
1626
+ * @see WP_Upgrader::$result
1627
+ */
1628
+ public $result;
1629
+
1630
+ /**
1631
+ * Whether a bulk upgrade/install is being performed.
1632
+ *
1633
+ * @since 3.7.0
1634
+ * @var bool $bulk
1635
+ */
1636
+ public $bulk = true;
1637
+
1638
+ /**
1639
+ * Asynchronously upgrade language packs after other upgrades have been made.
1640
+ *
1641
+ * Hooked to the {@see 'upgrader_process_complete'} action by default.
1642
+ *
1643
+ * @since 3.7.0
1644
+ */
1645
+ public static function async_upgrade( $upgrader = false ) {
1646
+ // Avoid recursion.
1647
+ if ( $upgrader && $upgrader instanceof Language_Pack_Upgrader ) {
1648
+ return;
1649
+ }
1650
+
1651
+ // Nothing to do?
1652
+ $language_updates = wp_get_translation_updates();
1653
+ if ( ! $language_updates ) {
1654
+ return;
1655
+ }
1656
+
1657
+ // Avoid messing with VCS installs, at least for now.
1658
+ // Noted: this is not the ideal way to accomplish this.
1659
+ $check_vcs = new WP_Automatic_Updater;
1660
+ if ( $check_vcs->is_vcs_checkout( WP_CONTENT_DIR ) ) {
1661
+ return;
1662
+ }
1663
+
1664
+ foreach ( $language_updates as $key => $language_update ) {
1665
+ $update = ! empty( $language_update->autoupdate );
1666
+
1667
+ /**
1668
+ * Filter whether to asynchronously update translation for core, a plugin, or a theme.
1669
+ *
1670
+ * @since 4.0.0
1671
+ *
1672
+ * @param bool $update Whether to update.
1673
+ * @param object $language_update The update offer.
1674
+ */
1675
+ $update = apply_filters( 'async_update_translation', $update, $language_update );
1676
+
1677
+ if ( ! $update ) {
1678
+ unset( $language_updates[ $key ] );
1679
+ }
1680
+ }
1681
+
1682
+ if ( empty( $language_updates ) ) {
1683
+ return;
1684
+ }
1685
+
1686
+ $skin = new Language_Pack_Upgrader_Skin( array(
1687
+ 'skip_header_footer' => true,
1688
+ ) );
1689
+
1690
+ $lp_upgrader = new Language_Pack_Upgrader( $skin );
1691
+ $lp_upgrader->bulk_upgrade( $language_updates );
1692
+ }
1693
+
1694
+ /**
1695
+ * Initialize the upgrade strings.
1696
+ *
1697
+ * @since 3.7.0
1698
+ */
1699
+ public function upgrade_strings() {
1700
+ $this->strings['starting_upgrade'] = __( 'Some of your translations need updating. Sit tight for a few more seconds while we update them as well.' );
1701
+ $this->strings['up_to_date'] = __( 'The translation is up to date.' ); // We need to silently skip this case
1702
+ $this->strings['no_package'] = __( 'Update package not available.' );
1703
+ $this->strings['downloading_package'] = __( 'Downloading translation from <span class="code">%s</span>&#8230;' );
1704
+ $this->strings['unpack_package'] = __( 'Unpacking the update&#8230;' );
1705
+ $this->strings['process_failed'] = __( 'Translation update failed.' );
1706
+ $this->strings['process_success'] = __( 'Translation updated successfully.' );
1707
+ }
1708
+
1709
+ /**
1710
+ * Upgrade a language pack.
1711
+ *
1712
+ * @since 3.7.0
1713
+ *
1714
+ * @param string|false $update Optional. Whether an update offer is available. Default false.
1715
+ * @param array $args Optional. Other optional arguments, see
1716
+ * {@see Language_Pack_Upgrader::bulk_upgrade()}. Default empty array.
1717
+ * @return array|WP_Error The result of the upgrade, or a {@see wP_Error} object instead.
1718
+ */
1719
+ public function upgrade( $update = false, $args = array() ) {
1720
+ if ( $update ) {
1721
+ $update = array( $update );
1722
+ }
1723
+
1724
+ $results = $this->bulk_upgrade( $update, $args );
1725
+
1726
+ if ( ! is_array( $results ) ) {
1727
+ return $results;
1728
+ }
1729
+
1730
+ return $results[0];
1731
+ }
1732
+
1733
+ /**
1734
+ * Bulk upgrade language packs.
1735
+ *
1736
+ * @since 3.7.0
1737
+ *
1738
+ * @param array $language_updates Optional. Language pack updates. Default empty array.
1739
+ * @param array $args {
1740
+ * Optional. Other arguments for upgrading multiple language packs. Default empty array
1741
+ *
1742
+ * @type bool $clear_update_cache Whether to clear the update cache when done.
1743
+ * Default true.
1744
+ * }
1745
+ * @return array|true|false|WP_Error Will return an array of results, or true if there are no updates,
1746
+ * false or WP_Error for initial errors.
1747
+ */
1748
+ public function bulk_upgrade( $language_updates = array(), $args = array() ) {
1749
+ global $wp_filesystem;
1750
+
1751
+ $defaults = array(
1752
+ 'clear_update_cache' => true,
1753
+ );
1754
+ $parsed_args = wp_parse_args( $args, $defaults );
1755
+
1756
+ $this->init();
1757
+ $this->upgrade_strings();
1758
+
1759
+ if ( ! $language_updates )
1760
+ $language_updates = wp_get_translation_updates();
1761
+
1762
+ if ( empty( $language_updates ) ) {
1763
+ $this->skin->header();
1764
+ $this->skin->before();
1765
+ $this->skin->set_result( true );
1766
+ $this->skin->feedback( 'up_to_date' );
1767
+ $this->skin->after();
1768
+ $this->skin->bulk_footer();
1769
+ $this->skin->footer();
1770
+ return true;
1771
+ }
1772
+
1773
+ if ( 'upgrader_process_complete' == current_filter() )
1774
+ $this->skin->feedback( 'starting_upgrade' );
1775
+
1776
+ // Remove any existing upgrade filters from the plugin/theme upgraders #WP29425 & #WP29230
1777
+ remove_all_filters( 'upgrader_pre_install' );
1778
+ remove_all_filters( 'upgrader_clear_destination' );
1779
+ remove_all_filterS( 'upgrader_post_install' );
1780
+ remove_all_filters( 'upgrader_source_selection' );
1781
+
1782
+ add_filter( 'upgrader_source_selection', array( $this, 'check_package' ), 10, 2 );
1783
+
1784
+ $this->skin->header();
1785
+
1786
+ // Connect to the Filesystem first.
1787
+ $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) );
1788
+ if ( ! $res ) {
1789
+ $this->skin->footer();
1790
+ return false;
1791
+ }
1792
+
1793
+ $results = array();
1794
+
1795
+ $this->update_count = count( $language_updates );
1796
+ $this->update_current = 0;
1797
+
1798
+ /*
1799
+ * The filesystem's mkdir() is not recursive. Make sure WP_LANG_DIR exists,
1800
+ * as we then may need to create a /plugins or /themes directory inside of it.
1801
+ */
1802
+ $remote_destination = $wp_filesystem->find_folder( WP_LANG_DIR );
1803
+ if ( ! $wp_filesystem->exists( $remote_destination ) )
1804
+ if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) )
1805
+ return new WP_Error( 'mkdir_failed_lang_dir', $this->strings['mkdir_failed'], $remote_destination );
1806
+
1807
+ foreach ( $language_updates as $language_update ) {
1808
+
1809
+ $this->skin->language_update = $language_update;
1810
+
1811
+ $destination = WP_LANG_DIR;
1812
+ if ( 'plugin' == $language_update->type )
1813
+ $destination .= '/plugins';
1814
+ elseif ( 'theme' == $language_update->type )
1815
+ $destination .= '/themes';
1816
+
1817
+ $this->update_current++;
1818
+
1819
+ $options = array(
1820
+ 'package' => $language_update->package,
1821
+ 'destination' => $destination,
1822
+ 'clear_destination' => false,
1823
+ 'abort_if_destination_exists' => false, // We expect the destination to exist.
1824
+ 'clear_working' => true,
1825
+ 'is_multi' => true,
1826
+ 'hook_extra' => array(
1827
+ 'language_update_type' => $language_update->type,
1828
+ 'language_update' => $language_update,
1829
+ )
1830
+ );
1831
+
1832
+ $result = $this->run( $options );
1833
+
1834
+ $results[] = $this->result;
1835
+
1836
+ // Prevent credentials auth screen from displaying multiple times.
1837
+ if ( false === $result )
1838
+ break;
1839
+ }
1840
+
1841
+ $this->skin->bulk_footer();
1842
+
1843
+ $this->skin->footer();
1844
+
1845
+ // Clean up our hooks, in case something else does an upgrade on this connection.
1846
+ remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
1847
+
1848
+ if ( $parsed_args['clear_update_cache'] ) {
1849
+ wp_clean_update_cache();
1850
+ }
1851
+
1852
+ return $results;
1853
+ }
1854
+
1855
+ /**
1856
+ * Check the package source to make sure there are .mo and .po files.
1857
+ *
1858
+ * Hooked to the {@see 'upgrader_source_selection'} filter by
1859
+ * {@see Language_Pack_Upgrader::bulk_upgrade()}.
1860
+ *
1861
+ * @since 3.7.0
1862
+ */
1863
+ public function check_package( $source, $remote_source ) {
1864
+ global $wp_filesystem;
1865
+
1866
+ if ( is_wp_error( $source ) )
1867
+ return $source;
1868
+
1869
+ // Check that the folder contains a valid language.
1870
+ $files = $wp_filesystem->dirlist( $remote_source );
1871
+
1872
+ // Check to see if a .po and .mo exist in the folder.
1873
+ $po = $mo = false;
1874
+ foreach ( (array) $files as $file => $filedata ) {
1875
+ if ( '.po' == substr( $file, -3 ) )
1876
+ $po = true;
1877
+ elseif ( '.mo' == substr( $file, -3 ) )
1878
+ $mo = true;
1879
+ }
1880
+
1881
+ if ( ! $mo || ! $po )
1882
+ return new WP_Error( 'incompatible_archive_pomo', $this->strings['incompatible_archive'],
1883
+ __( 'The language pack is missing either the <code>.po</code> or <code>.mo</code> files.' ) );
1884
+
1885
+ return $source;
1886
+ }
1887
+
1888
+ /**
1889
+ * Get the name of an item being updated.
1890
+ *
1891
+ * @since 3.7.0
1892
+ *
1893
+ * @param object The data for an update.
1894
+ * @return string The name of the item being updated.
1895
+ */
1896
+ public function get_name_for_update( $update ) {
1897
+ switch ( $update->type ) {
1898
+ case 'core':
1899
+ return 'WordPress'; // Not translated
1900
+
1901
+ case 'theme':
1902
+ $theme = wp_get_theme( $update->slug );
1903
+ if ( $theme->exists() )
1904
+ return $theme->Get( 'Name' );
1905
+ break;
1906
+ case 'plugin':
1907
+ $plugin_data = get_plugins( '/' . $update->slug );
1908
+ $plugin_data = reset( $plugin_data );
1909
+ if ( $plugin_data )
1910
+ return $plugin_data['Name'];
1911
+ break;
1912
+ }
1913
+ return '';
1914
+ }
1915
+
1916
+ }
1917
+
1918
+ /**
1919
+ * Core Upgrader class for WordPress. It allows for WordPress to upgrade itself in combination with the wp-admin/includes/update-core.php file
1920
+ *
1921
+ * @package WordPress
1922
+ * @subpackage Upgrader
1923
+ * @since 2.8.0
1924
+ */
1925
+ class Core_Upgrader extends WP_Upgrader {
1926
+
1927
+ /**
1928
+ * Initialize the upgrade strings.
1929
+ *
1930
+ * @since 2.8.0
1931
+ */
1932
+ public function upgrade_strings() {
1933
+ $this->strings['up_to_date'] = __('WordPress is at the latest version.');
1934
+ $this->strings['no_package'] = __('Update package not available.');
1935
+ $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>&#8230;');
1936
+ $this->strings['unpack_package'] = __('Unpacking the update&#8230;');
1937
+ $this->strings['copy_failed'] = __('Could not copy files.');
1938
+ $this->strings['copy_failed_space'] = __('Could not copy files. You may have run out of disk space.' );
1939
+ $this->strings['start_rollback'] = __( 'Attempting to roll back to previous version.' );
1940
+ $this->strings['rollback_was_required'] = __( 'Due to an error during updating, WordPress has rolled back to your previous version.' );
1941
+ }
1942
+
1943
+ /**
1944
+ * Upgrade WordPress core.
1945
+ *
1946
+ * @since 2.8.0
1947
+ *
1948
+ * @param object $current Response object for whether WordPress is current.
1949
+ * @param array $args {
1950
+ * Optional. Arguments for upgrading WordPress core. Default empty array.
1951
+ *
1952
+ * @type bool $pre_check_md5 Whether to check the file checksums before
1953
+ * attempting the upgrade. Default true.
1954
+ * @type bool $attempt_rollback Whether to attempt to rollback the chances if
1955
+ * there is a problem. Default false.
1956
+ * @type bool $do_rollback Whether to perform this "upgrade" as a rollback.
1957
+ * Default false.
1958
+ * }
1959
+ * @return null|false|WP_Error False or WP_Error on failure, null on success.
1960
+ */
1961
+ public function upgrade( $current, $args = array() ) {
1962
+ global $wp_filesystem;
1963
+
1964
+ include( ABSPATH . WPINC . '/version.php' ); // $wp_version;
1965
+
1966
+ $start_time = time();
1967
+
1968
+ $defaults = array(
1969
+ 'pre_check_md5' => true,
1970
+ 'attempt_rollback' => false,
1971
+ 'do_rollback' => false,
1972
+ 'allow_relaxed_file_ownership' => false,
1973
+ );
1974
+ $parsed_args = wp_parse_args( $args, $defaults );
1975
+
1976
+ $this->init();
1977
+ $this->upgrade_strings();
1978
+
1979
+ // Is an update available?
1980
+ if ( !isset( $current->response ) || $current->response == 'latest' )
1981
+ return new WP_Error('up_to_date', $this->strings['up_to_date']);
1982
+
1983
+ $res = $this->fs_connect( array( ABSPATH, WP_CONTENT_DIR ), $parsed_args['allow_relaxed_file_ownership'] );
1984
+ if ( ! $res || is_wp_error( $res ) ) {
1985
+ return $res;
1986
+ }
1987
+
1988
+ $wp_dir = trailingslashit($wp_filesystem->abspath());
1989
+
1990
+ $partial = true;
1991
+ if ( $parsed_args['do_rollback'] )
1992
+ $partial = false;
1993
+ elseif ( $parsed_args['pre_check_md5'] && ! $this->check_files() )
1994
+ $partial = false;
1995
+
1996
+ /*
1997
+ * If partial update is returned from the API, use that, unless we're doing
1998
+ * a reinstall. If we cross the new_bundled version number, then use
1999
+ * the new_bundled zip. Don't though if the constant is set to skip bundled items.
2000
+ * If the API returns a no_content zip, go with it. Finally, default to the full zip.
2001
+ */
2002
+ if ( $parsed_args['do_rollback'] && $current->packages->rollback )
2003
+ $to_download = 'rollback';
2004
+ elseif ( $current->packages->partial && 'reinstall' != $current->response && $wp_version == $current->partial_version && $partial )
2005
+ $to_download = 'partial';
2006
+ elseif ( $current->packages->new_bundled && version_compare( $wp_version, $current->new_bundled, '<' )
2007
+ && ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) )
2008
+ $to_download = 'new_bundled';
2009
+ elseif ( $current->packages->no_content )
2010
+ $to_download = 'no_content';
2011
+ else
2012
+ $to_download = 'full';
2013
+
2014
+ $download = $this->download_package( $current->packages->$to_download );
2015
+ if ( is_wp_error($download) )
2016
+ return $download;
2017
+
2018
+ $working_dir = $this->unpack_package( $download );
2019
+ if ( is_wp_error($working_dir) )
2020
+ return $working_dir;
2021
+
2022
+ // Copy update-core.php from the new version into place.
2023
+ if ( !$wp_filesystem->copy($working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true) ) {
2024
+ $wp_filesystem->delete($working_dir, true);
2025
+ return new WP_Error( 'copy_failed_for_update_core_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-admin/includes/update-core.php' );
2026
+ }
2027
+ $wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE);
2028
+
2029
+ require_once( ABSPATH . 'wp-admin/includes/update-core.php' );
2030
+
2031
+ if ( ! function_exists( 'update_core' ) )
2032
+ return new WP_Error( 'copy_failed_space', $this->strings['copy_failed_space'] );
2033
+
2034
+ $result = update_core( $working_dir, $wp_dir );
2035
+
2036
+ // In the event of an issue, we may be able to roll back.
2037
+ if ( $parsed_args['attempt_rollback'] && $current->packages->rollback && ! $parsed_args['do_rollback'] ) {
2038
+ $try_rollback = false;
2039
+ if ( is_wp_error( $result ) ) {
2040
+ $error_code = $result->get_error_code();
2041
+ /*
2042
+ * Not all errors are equal. These codes are critical: copy_failed__copy_dir,
2043
+ * mkdir_failed__copy_dir, copy_failed__copy_dir_retry, and disk_full.
2044
+ * do_rollback allows for update_core() to trigger a rollback if needed.
2045
+ */
2046
+ if ( false !== strpos( $error_code, 'do_rollback' ) )
2047
+ $try_rollback = true;
2048
+ elseif ( false !== strpos( $error_code, '__copy_dir' ) )
2049
+ $try_rollback = true;
2050
+ elseif ( 'disk_full' === $error_code )
2051
+ $try_rollback = true;
2052
+ }
2053
+
2054
+ if ( $try_rollback ) {
2055
+ /** This filter is documented in wp-admin/includes/update-core.php */
2056
+ apply_filters( 'update_feedback', $result );
2057
+
2058
+ /** This filter is documented in wp-admin/includes/update-core.php */
2059
+ apply_filters( 'update_feedback', $this->strings['start_rollback'] );
2060
+
2061
+ $rollback_result = $this->upgrade( $current, array_merge( $parsed_args, array( 'do_rollback' => true ) ) );
2062
+
2063
+ $original_result = $result;
2064
+ $result = new WP_Error( 'rollback_was_required', $this->strings['rollback_was_required'], (object) array( 'update' => $original_result, 'rollback' => $rollback_result ) );
2065
+ }
2066
+ }
2067
+
2068
+ /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
2069
+ do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'core' ) );
2070
+
2071
+ // Clear the current updates
2072
+ delete_site_transient( 'update_core' );
2073
+
2074
+ if ( ! $parsed_args['do_rollback'] ) {
2075
+ $stats = array(
2076
+ 'update_type' => $current->response,
2077
+ 'success' => true,
2078
+ 'fs_method' => $wp_filesystem->method,
2079
+ 'fs_method_forced' => defined( 'FS_METHOD' ) || has_filter( 'filesystem_method' ),
2080
+ 'fs_method_direct' => !empty( $GLOBALS['_wp_filesystem_direct_method'] ) ? $GLOBALS['_wp_filesystem_direct_method'] : '',
2081
+ 'time_taken' => time() - $start_time,
2082
+ 'reported' => $wp_version,
2083
+ 'attempted' => $current->version,
2084
+ );
2085
+
2086
+ if ( is_wp_error( $result ) ) {
2087
+ $stats['success'] = false;
2088
+ // Did a rollback occur?
2089
+ if ( ! empty( $try_rollback ) ) {
2090
+ $stats['error_code'] = $original_result->get_error_code();
2091
+ $stats['error_data'] = $original_result->get_error_data();
2092
+ // Was the rollback successful? If not, collect its error too.
2093
+ $stats['rollback'] = ! is_wp_error( $rollback_result );
2094
+ if ( is_wp_error( $rollback_result ) ) {
2095
+ $stats['rollback_code'] = $rollback_result->get_error_code();
2096
+ $stats['rollback_data'] = $rollback_result->get_error_data();
2097
+ }
2098
+ } else {
2099
+ $stats['error_code'] = $result->get_error_code();
2100
+ $stats['error_data'] = $result->get_error_data();
2101
+ }
2102
+ }
2103
+
2104
+ wp_version_check( $stats );
2105
+ }
2106
+
2107
+ return $result;
2108
+ }
2109
+
2110
+ /**
2111
+ * Determines if this WordPress Core version should update to an offered version or not.
2112
+ *
2113
+ * @since 3.7.0
2114
+ *
2115
+ * @param string $offered_ver The offered version, of the format x.y.z.
2116
+ * @return bool True if we should update to the offered version, otherwise false.
2117
+ */
2118
+ public static function should_update_to_version( $offered_ver ) {
2119
+ include( ABSPATH . WPINC . '/version.php' ); // $wp_version; // x.y.z
2120
+
2121
+ $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y
2122
+ $new_branch = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y
2123
+ $current_is_development_version = (bool) strpos( $wp_version, '-' );
2124
+
2125
+ // Defaults:
2126
+ $upgrade_dev = true;
2127
+ $upgrade_minor = true;
2128
+ $upgrade_major = false;
2129
+
2130
+ // WP_AUTO_UPDATE_CORE = true (all), 'minor', false.
2131
+ if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {
2132
+ if ( false === WP_AUTO_UPDATE_CORE ) {
2133
+ // Defaults to turned off, unless a filter allows it
2134
+ $upgrade_dev = $upgrade_minor = $upgrade_major = false;
2135
+ } elseif ( true === WP_AUTO_UPDATE_CORE ) {
2136
+ // ALL updates for core
2137
+ $upgrade_dev = $upgrade_minor = $upgrade_major = true;
2138
+ } elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) {
2139
+ // Only minor updates for core
2140
+ $upgrade_dev = $upgrade_major = false;
2141
+ $upgrade_minor = true;
2142
+ }
2143
+ }
2144
+
2145
+ // 1: If we're already on that version, not much point in updating?
2146
+ if ( $offered_ver == $wp_version )
2147
+ return false;
2148
+
2149
+ // 2: If we're running a newer version, that's a nope
2150
+ if ( version_compare( $wp_version, $offered_ver, '>' ) )
2151
+ return false;
2152
+
2153
+ $failure_data = get_site_option( 'auto_core_update_failed' );
2154
+ if ( $failure_data ) {
2155
+ // If this was a critical update failure, cannot update.
2156
+ if ( ! empty( $failure_data['critical'] ) )
2157
+ return false;
2158
+
2159
+ // Don't claim we can update on update-core.php if we have a non-critical failure logged.
2160
+ if ( $wp_version == $failure_data['current'] && false !== strpos( $offered_ver, '.1.next.minor' ) )
2161
+ return false;
2162
+
2163
+ // Cannot update if we're retrying the same A to B update that caused a non-critical failure.
2164
+ // Some non-critical failures do allow retries, like download_failed.
2165
+ // 3.7.1 => 3.7.2 resulted in files_not_writable, if we are still on 3.7.1 and still trying to update to 3.7.2.
2166
+ if ( empty( $failure_data['retry'] ) && $wp_version == $failure_data['current'] && $offered_ver == $failure_data['attempted'] )
2167
+ return false;
2168
+ }
2169
+
2170
+ // 3: 3.7-alpha-25000 -> 3.7-alpha-25678 -> 3.7-beta1 -> 3.7-beta2
2171
+ if ( $current_is_development_version ) {
2172
+
2173
+ /**
2174
+ * Filter whether to enable automatic core updates for development versions.
2175
+ *
2176
+ * @since 3.7.0
2177
+ *
2178
+ * @param bool $upgrade_dev Whether to enable automatic updates for
2179
+ * development versions.
2180
+ */
2181
+ if ( ! apply_filters( 'allow_dev_auto_core_updates', $upgrade_dev ) )
2182
+ return false;
2183
+ // Else fall through to minor + major branches below.
2184
+ }
2185
+
2186
+ // 4: Minor In-branch updates (3.7.0 -> 3.7.1 -> 3.7.2 -> 3.7.4)
2187
+ if ( $current_branch == $new_branch ) {
2188
+
2189
+ /**
2190
+ * Filter whether to enable minor automatic core updates.
2191
+ *
2192
+ * @since 3.7.0
2193
+ *
2194
+ * @param bool $upgrade_minor Whether to enable minor automatic core updates.
2195
+ */
2196
+ return apply_filters( 'allow_minor_auto_core_updates', $upgrade_minor );
2197
+ }
2198
+
2199
+ // 5: Major version updates (3.7.0 -> 3.8.0 -> 3.9.1)
2200
+ if ( version_compare( $new_branch, $current_branch, '>' ) ) {
2201
+
2202
+ /**
2203
+ * Filter whether to enable major automatic core updates.
2204
+ *
2205
+ * @since 3.7.0
2206
+ *
2207
+ * @param bool $upgrade_major Whether to enable major automatic core updates.
2208
+ */
2209
+ return apply_filters( 'allow_major_auto_core_updates', $upgrade_major );
2210
+ }
2211
+
2212
+ // If we're not sure, we don't want it
2213
+ return false;
2214
+ }
2215
+
2216
+ /**
2217
+ * Compare the disk file checksums agains the expected checksums.
2218
+ *
2219
+ * @since 3.7.0
2220
+ *
2221
+ * @return bool True if the checksums match, otherwise false.
2222
+ */
2223
+ public function check_files() {
2224
+ global $wp_version, $wp_local_package;
2225
+
2226
+ $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );
2227
+
2228
+ if ( ! is_array( $checksums ) )
2229
+ return false;
2230
+
2231
+ foreach ( $checksums as $file => $checksum ) {
2232
+ // Skip files which get updated
2233
+ if ( 'wp-content' == substr( $file, 0, 10 ) )
2234
+ continue;
2235
+ if ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum )
2236
+ return false;
2237
+ }
2238
+
2239
+ return true;
2240
+ }
2241
+ }
2242
+
2243
+ /**
2244
+ * Upgrade Skin helper for File uploads. This class handles the upload process and passes it as if it's a local file to the Upgrade/Installer functions.
2245
+ *
2246
+ * @package WordPress
2247
+ * @subpackage Upgrader
2248
+ * @since 2.8.0
2249
+ */
2250
+ class File_Upload_Upgrader {
2251
+
2252
+ /**
2253
+ * The full path to the file package.
2254
+ *
2255
+ * @since 2.8.0
2256
+ * @var string $package
2257
+ */
2258
+ public $package;
2259
+
2260
+ /**
2261
+ * The name of the file.
2262
+ *
2263
+ * @since 2.8.0
2264
+ * @var string $filename
2265
+ */
2266
+ public $filename;
2267
+
2268
+ /**
2269
+ * The ID of the attachment post for this file.
2270
+ *
2271
+ * @since 3.3.0
2272
+ * @var int $id
2273
+ */
2274
+ public $id = 0;
2275
+
2276
+ /**
2277
+ * Construct the upgrader for a form.
2278
+ *
2279
+ * @since 2.8.0
2280
+ *
2281
+ * @param string $form The name of the form the file was uploaded from.
2282
+ * @param string $urlholder The name of the `GET` parameter that holds the filename.
2283
+ */
2284
+ public function __construct( $form, $urlholder ) {
2285
+
2286
+ if ( empty($_FILES[$form]['name']) && empty($_GET[$urlholder]) )
2287
+ wp_die(__('Please select a file'));
2288
+
2289
+ //Handle a newly uploaded file, Else assume it's already been uploaded
2290
+ if ( ! empty($_FILES) ) {
2291
+ $overrides = array( 'test_form' => false, 'test_type' => false );
2292
+ $file = wp_handle_upload( $_FILES[$form], $overrides );
2293
+
2294
+ if ( isset( $file['error'] ) )
2295
+ wp_die( $file['error'] );
2296
+
2297
+ $this->filename = $_FILES[$form]['name'];
2298
+ $this->package = $file['file'];
2299
+
2300
+ // Construct the object array
2301
+ $object = array(
2302
+ 'post_title' => $this->filename,
2303
+ 'post_content' => $file['url'],
2304
+ 'post_mime_type' => $file['type'],
2305
+ 'guid' => $file['url'],
2306
+ 'context' => 'upgrader',
2307
+ 'post_status' => 'private'
2308
+ );
2309
+
2310
+ // Save the data.
2311
+ $this->id = wp_insert_attachment( $object, $file['file'] );
2312
+
2313
+ // Schedule a cleanup for 2 hours from now in case of failed install.
2314
+ wp_schedule_single_event( time() + 2 * HOUR_IN_SECONDS, 'upgrader_scheduled_cleanup', array( $this->id ) );
2315
+
2316
+ } elseif ( is_numeric( $_GET[$urlholder] ) ) {
2317
+ // Numeric Package = previously uploaded file, see above.
2318
+ $this->id = (int) $_GET[$urlholder];
2319
+ $attachment = get_post( $this->id );
2320
+ if ( empty($attachment) )
2321
+ wp_die(__('Please select a file'));
2322
+
2323
+ $this->filename = $attachment->post_title;
2324
+ $this->package = get_attached_file( $attachment->ID );
2325
+ } else {
2326
+ // Else, It's set to something, Back compat for plugins using the old (pre-3.3) File_Uploader handler.
2327
+ if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
2328
+ wp_die( $uploads['error'] );
2329
+
2330
+ $this->filename = $_GET[$urlholder];
2331
+ $this->package = $uploads['basedir'] . '/' . $this->filename;
2332
+ }
2333
+ }
2334
+
2335
+ /**
2336
+ * Delete the attachment/uploaded file.
2337
+ *
2338
+ * @since 3.2.2
2339
+ *
2340
+ * @return bool Whether the cleanup was successful.
2341
+ */
2342
+ public function cleanup() {
2343
+ if ( $this->id )
2344
+ wp_delete_attachment( $this->id );
2345
+
2346
+ elseif ( file_exists( $this->package ) )
2347
+ return @unlink( $this->package );
2348
+
2349
+ return true;
2350
+ }
2351
+ }
2352
+
2353
+ /**
2354
+ * The WordPress automatic background updater.
2355
+ *
2356
+ * @package WordPress
2357
+ * @subpackage Upgrader
2358
+ * @since 3.7.0
2359
+ */
2360
+ class WP_Automatic_Updater {
2361
+
2362
+ /**
2363
+ * Tracks update results during processing.
2364
+ *
2365
+ * @var array
2366
+ */
2367
+ protected $update_results = array();
2368
+
2369
+ /**
2370
+ * Whether the entire automatic updater is disabled.
2371
+ *
2372
+ * @since 3.7.0
2373
+ */
2374
+ public function is_disabled() {
2375
+ // Background updates are disabled if you don't want file changes.
2376
+ if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
2377
+ return true;
2378
+
2379
+ if ( defined( 'WP_INSTALLING' ) )
2380
+ return true;
2381
+
2382
+ // More fine grained control can be done through the WP_AUTO_UPDATE_CORE constant and filters.
2383
+ $disabled = defined( 'AUTOMATIC_UPDATER_DISABLED' ) && AUTOMATIC_UPDATER_DISABLED;
2384
+
2385
+ /**
2386
+ * Filter whether to entirely disable background updates.
2387
+ *
2388
+ * There are more fine-grained filters and controls for selective disabling.
2389
+ * This filter parallels the AUTOMATIC_UPDATER_DISABLED constant in name.
2390
+ *
2391
+ * This also disables update notification emails. That may change in the future.
2392
+ *
2393
+ * @since 3.7.0
2394
+ *
2395
+ * @param bool $disabled Whether the updater should be disabled.
2396
+ */
2397
+ return apply_filters( 'automatic_updater_disabled', $disabled );
2398
+ }
2399
+
2400
+ /**
2401
+ * Check for version control checkouts.
2402
+ *
2403
+ * Checks for Subversion, Git, Mercurial, and Bazaar. It recursively looks up the
2404
+ * filesystem to the top of the drive, erring on the side of detecting a VCS
2405
+ * checkout somewhere.
2406
+ *
2407
+ * ABSPATH is always checked in addition to whatever $context is (which may be the
2408
+ * wp-content directory, for example). The underlying assumption is that if you are
2409
+ * using version control *anywhere*, then you should be making decisions for
2410
+ * how things get updated.
2411
+ *
2412
+ * @since 3.7.0
2413
+ *
2414
+ * @param string $context The filesystem path to check, in addition to ABSPATH.
2415
+ */
2416
+ public function is_vcs_checkout( $context ) {
2417
+ $context_dirs = array( untrailingslashit( $context ) );
2418
+ if ( $context !== ABSPATH )
2419
+ $context_dirs[] = untrailingslashit( ABSPATH );
2420
+
2421
+ $vcs_dirs = array( '.svn', '.git', '.hg', '.bzr' );
2422
+ $check_dirs = array();
2423
+
2424
+ foreach ( $context_dirs as $context_dir ) {
2425
+ // Walk up from $context_dir to the root.
2426
+ do {
2427
+ $check_dirs[] = $context_dir;
2428
+
2429
+ // Once we've hit '/' or 'C:\', we need to stop. dirname will keep returning the input here.
2430
+ if ( $context_dir == dirname( $context_dir ) )
2431
+ break;
2432
+
2433
+ // Continue one level at a time.
2434
+ } while ( $context_dir = dirname( $context_dir ) );
2435
+ }
2436
+
2437
+ $check_dirs = array_unique( $check_dirs );
2438
+
2439
+ // Search all directories we've found for evidence of version control.
2440
+ foreach ( $vcs_dirs as $vcs_dir ) {
2441
+ foreach ( $check_dirs as $check_dir ) {
2442
+ if ( $checkout = @is_dir( rtrim( $check_dir, '\\/' ) . "/$vcs_dir" ) )
2443
+ break 2;
2444
+ }
2445
+ }
2446
+
2447
+ /**
2448
+ * Filter whether the automatic updater should consider a filesystem
2449
+ * location to be potentially managed by a version control system.
2450
+ *
2451
+ * @since 3.7.0
2452
+ *
2453
+ * @param bool $checkout Whether a VCS checkout was discovered at $context
2454
+ * or ABSPATH, or anywhere higher.
2455
+ * @param string $context The filesystem context (a path) against which
2456
+ * filesystem status should be checked.
2457
+ */
2458
+ return apply_filters( 'automatic_updates_is_vcs_checkout', $checkout, $context );
2459
+ }
2460
+
2461
+ /**
2462
+ * Tests to see if we can and should update a specific item.
2463
+ *
2464
+ * @since 3.7.0
2465
+ *
2466
+ * @param string $type The type of update being checked: 'core', 'theme',
2467
+ * 'plugin', 'translation'.
2468
+ * @param object $item The update offer.
2469
+ * @param string $context The filesystem context (a path) against which filesystem
2470
+ * access and status should be checked.
2471
+ */
2472
+ public function should_update( $type, $item, $context ) {
2473
+ // Used to see if WP_Filesystem is set up to allow unattended updates.
2474
+ $skin = new Automatic_Upgrader_Skin;
2475
+
2476
+ if ( $this->is_disabled() )
2477
+ return false;
2478
+
2479
+ // Only relax the filesystem checks when the update doesn't include new files
2480
+ $allow_relaxed_file_ownership = false;
2481
+ if ( 'core' == $type && isset( $item->new_files ) && ! $item->new_files ) {
2482
+ $allow_relaxed_file_ownership = true;
2483
+ }
2484
+
2485
+ // If we can't do an auto core update, we may still be able to email the user.
2486
+ if ( ! $skin->request_filesystem_credentials( false, $context, $allow_relaxed_file_ownership ) || $this->is_vcs_checkout( $context ) ) {
2487
+ if ( 'core' == $type )
2488
+ $this->send_core_update_notification_email( $item );
2489
+ return false;
2490
+ }
2491
+
2492
+ // Next up, is this an item we can update?
2493
+ if ( 'core' == $type )
2494
+ $update = Core_Upgrader::should_update_to_version( $item->current );
2495
+ else
2496
+ $update = ! empty( $item->autoupdate );
2497
+
2498
+ /**
2499
+ * Filter whether to automatically update core, a plugin, a theme, or a language.
2500
+ *
2501
+ * The dynamic portion of the hook name, `$type`, refers to the type of update
2502
+ * being checked. Can be 'core', 'theme', 'plugin', or 'translation'.
2503
+ *
2504
+ * Generally speaking, plugins, themes, and major core versions are not updated
2505
+ * by default, while translations and minor and development versions for core
2506
+ * are updated by default.
2507
+ *
2508
+ * See the {@see 'allow_dev_auto_core_updates', {@see 'allow_minor_auto_core_updates'},
2509
+ * and {@see 'allow_major_auto_core_updates'} filters for a more straightforward way to
2510
+ * adjust core updates.
2511
+ *
2512
+ * @since 3.7.0
2513
+ *
2514
+ * @param bool $update Whether to update.
2515
+ * @param object $item The update offer.
2516
+ */
2517
+ $update = apply_filters( 'auto_update_' . $type, $update, $item );
2518
+
2519
+ if ( ! $update ) {
2520
+ if ( 'core' == $type )
2521
+ $this->send_core_update_notification_email( $item );
2522
+ return false;
2523
+ }
2524
+
2525
+ // If it's a core update, are we actually compatible with its requirements?
2526
+ if ( 'core' == $type ) {
2527
+ global $wpdb;
2528
+
2529
+ $php_compat = version_compare( phpversion(), $item->php_version, '>=' );
2530
+ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) )
2531
+ $mysql_compat = true;
2532
+ else
2533
+ $mysql_compat = version_compare( $wpdb->db_version(), $item->mysql_version, '>=' );
2534
+
2535
+ if ( ! $php_compat || ! $mysql_compat )
2536
+ return false;
2537
+ }
2538
+
2539
+ return true;
2540
+ }
2541
+
2542
+ /**
2543
+ * Notifies an administrator of a core update.
2544
+ *
2545
+ * @since 3.7.0
2546
+ *
2547
+ * @param object $item The update offer.
2548
+ */
2549
+ protected function send_core_update_notification_email( $item ) {
2550
+ $notified = get_site_option( 'auto_core_update_notified' );
2551
+
2552
+ // Don't notify if we've already notified the same email address of the same version.
2553
+ if ( $notified && $notified['email'] == get_site_option( 'admin_email' ) && $notified['version'] == $item->current )
2554
+ return false;
2555
+
2556
+ // See if we need to notify users of a core update.
2557
+ $notify = ! empty( $item->notify_email );
2558
+
2559
+ /**
2560
+ * Filter whether to notify the site administrator of a new core update.
2561
+ *
2562
+ * By default, administrators are notified when the update offer received
2563
+ * from WordPress.org sets a particular flag. This allows some discretion
2564
+ * in if and when to notify.
2565
+ *
2566
+ * This filter is only evaluated once per release. If the same email address
2567
+ * was already notified of the same new version, WordPress won't repeatedly
2568
+ * email the administrator.
2569
+ *
2570
+ * This filter is also used on about.php to check if a plugin has disabled
2571
+ * these notifications.
2572
+ *
2573
+ * @since 3.7.0
2574
+ *
2575
+ * @param bool $notify Whether the site administrator is notified.
2576
+ * @param object $item The update offer.
2577
+ */
2578
+ if ( ! apply_filters( 'send_core_update_notification_email', $notify, $item ) )
2579
+ return false;
2580
+
2581
+ $this->send_email( 'manual', $item );
2582
+ return true;
2583
+ }
2584
+
2585
+ /**
2586
+ * Update an item, if appropriate.
2587
+ *
2588
+ * @since 3.7.0
2589
+ *
2590
+ * @param string $type The type of update being checked: 'core', 'theme', 'plugin', 'translation'.
2591
+ * @param object $item The update offer.
2592
+ */
2593
+ public function update( $type, $item ) {
2594
+ $skin = new Automatic_Upgrader_Skin;
2595
+
2596
+ switch ( $type ) {
2597
+ case 'core':
2598
+ // The Core upgrader doesn't use the Upgrader's skin during the actual main part of the upgrade, instead, firing a filter.
2599
+ add_filter( 'update_feedback', array( $skin, 'feedback' ) );
2600
+ $upgrader = new Core_Upgrader( $skin );
2601
+ $context = ABSPATH;
2602
+ break;
2603
+ case 'plugin':
2604
+ $upgrader = new Plugin_Upgrader( $skin );
2605
+ $context = WP_PLUGIN_DIR; // We don't support custom Plugin directories, or updates for WPMU_PLUGIN_DIR
2606
+ break;
2607
+ case 'theme':
2608
+ $upgrader = new Theme_Upgrader( $skin );
2609
+ $context = get_theme_root( $item->theme );
2610
+ break;
2611
+ case 'translation':
2612
+ $upgrader = new Language_Pack_Upgrader( $skin );
2613
+ $context = WP_CONTENT_DIR; // WP_LANG_DIR;
2614
+ break;
2615
+ }
2616
+
2617
+ // Determine whether we can and should perform this update.
2618
+ if ( ! $this->should_update( $type, $item, $context ) )
2619
+ return false;
2620
+
2621
+ $upgrader_item = $item;
2622
+ switch ( $type ) {
2623
+ case 'core':
2624
+ $skin->feedback( __( 'Updating to WordPress %s' ), $item->version );
2625
+ $item_name = sprintf( __( 'WordPress %s' ), $item->version );
2626
+ break;
2627
+ case 'theme':
2628
+ $upgrader_item = $item->theme;
2629
+ $theme = wp_get_theme( $upgrader_item );
2630
+ $item_name = $theme->Get( 'Name' );
2631
+ $skin->feedback( __( 'Updating theme: %s' ), $item_name );
2632
+ break;
2633
+ case 'plugin':
2634
+ $upgrader_item = $item->plugin;
2635
+ $plugin_data = get_plugin_data( $context . '/' . $upgrader_item );
2636
+ $item_name = $plugin_data['Name'];
2637
+ $skin->feedback( __( 'Updating plugin: %s' ), $item_name );
2638
+ break;
2639
+ case 'translation':
2640
+ $language_item_name = $upgrader->get_name_for_update( $item );
2641
+ $item_name = sprintf( __( 'Translations for %s' ), $language_item_name );
2642
+ $skin->feedback( sprintf( __( 'Updating translations for %1$s (%2$s)&#8230;' ), $language_item_name, $item->language ) );
2643
+ break;
2644
+ }
2645
+
2646
+ $allow_relaxed_file_ownership = false;
2647
+ if ( 'core' == $type && isset( $item->new_files ) && ! $item->new_files ) {
2648
+ $allow_relaxed_file_ownership = true;
2649
+ }
2650
+
2651
+ // Boom, This sites about to get a whole new splash of paint!
2652
+ $upgrade_result = $upgrader->upgrade( $upgrader_item, array(
2653
+ 'clear_update_cache' => false,
2654
+ // Always use partial builds if possible for core updates.
2655
+ 'pre_check_md5' => false,
2656
+ // Only available for core updates.
2657
+ 'attempt_rollback' => true,
2658
+ // Allow relaxed file ownership in some scenarios
2659
+ 'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership,
2660
+ ) );
2661
+
2662
+ // If the filesystem is unavailable, false is returned.
2663
+ if ( false === $upgrade_result ) {
2664
+ $upgrade_result = new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );
2665
+ }
2666
+
2667
+ // Core doesn't output this, so let's append it so we don't get confused.
2668
+ if ( 'core' == $type ) {
2669
+ if ( is_wp_error( $upgrade_result ) ) {
2670
+ $skin->error( __( 'Installation Failed' ), $upgrade_result );
2671
+ } else {
2672
+ $skin->feedback( __( 'WordPress updated successfully' ) );
2673
+ }
2674
+ }
2675
+
2676
+ $this->update_results[ $type ][] = (object) array(
2677
+ 'item' => $item,
2678
+ 'result' => $upgrade_result,
2679
+ 'name' => $item_name,
2680
+ 'messages' => $skin->get_upgrade_messages()
2681
+ );
2682
+
2683
+ return $upgrade_result;
2684
+ }
2685
+
2686
+ /**
2687
+ * Kicks off the background update process, looping through all pending updates.
2688
+ *
2689
+ * @since 3.7.0
2690
+ */
2691
+ public function run() {
2692
+ global $wpdb, $wp_version;
2693
+
2694
+ if ( $this->is_disabled() )
2695
+ return;
2696
+
2697
+ if ( ! is_main_network() || ! is_main_site() )
2698
+ return;
2699
+
2700
+ $lock_name = 'auto_updater.lock';
2701
+
2702
+ // Try to lock
2703
+ $lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_name, time() ) );
2704
+
2705
+ if ( ! $lock_result ) {
2706
+ $lock_result = get_option( $lock_name );
2707
+
2708
+ // If we couldn't create a lock, and there isn't a lock, bail
2709
+ if ( ! $lock_result )
2710
+ return;
2711
+
2712
+ // Check to see if the lock is still valid
2713
+ if ( $lock_result > ( time() - HOUR_IN_SECONDS ) )
2714
+ return;
2715
+ }
2716
+
2717
+ // Update the lock, as by this point we've definitely got a lock, just need to fire the actions
2718
+ update_option( $lock_name, time() );
2719
+
2720
+ // Don't automatically run these thins, as we'll handle it ourselves
2721
+ remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
2722
+ remove_action( 'upgrader_process_complete', 'wp_version_check' );
2723
+ remove_action( 'upgrader_process_complete', 'wp_update_plugins' );
2724
+ remove_action( 'upgrader_process_complete', 'wp_update_themes' );
2725
+
2726
+ // Next, Plugins
2727
+ wp_update_plugins(); // Check for Plugin updates
2728
+ $plugin_updates = get_site_transient( 'update_plugins' );
2729
+ if ( $plugin_updates && !empty( $plugin_updates->response ) ) {
2730
+ foreach ( $plugin_updates->response as $plugin ) {
2731
+ $this->update( 'plugin', $plugin );
2732
+ }
2733
+ // Force refresh of plugin update information
2734
+ wp_clean_plugins_cache();
2735
+ }
2736
+
2737
+ // Next, those themes we all love
2738
+ wp_update_themes(); // Check for Theme updates
2739
+ $theme_updates = get_site_transient( 'update_themes' );
2740
+ if ( $theme_updates && !empty( $theme_updates->response ) ) {
2741
+ foreach ( $theme_updates->response as $theme ) {
2742
+ $this->update( 'theme', (object) $theme );
2743
+ }
2744
+ // Force refresh of theme update information
2745
+ wp_clean_themes_cache();
2746
+ }
2747
+
2748
+ // Next, Process any core update
2749
+ wp_version_check(); // Check for Core updates
2750
+ $core_update = find_core_auto_update();
2751
+
2752
+ if ( $core_update )
2753
+ $this->update( 'core', $core_update );
2754
+
2755
+ // Clean up, and check for any pending translations
2756
+ // (Core_Upgrader checks for core updates)
2757
+ $theme_stats = array();
2758
+ if ( isset( $this->update_results['theme'] ) ) {
2759
+ foreach ( $this->update_results['theme'] as $upgrade ) {
2760
+ $theme_stats[ $upgrade->item->theme ] = ( true === $upgrade->result );
2761
+ }
2762
+ }
2763
+ wp_update_themes( $theme_stats ); // Check for Theme updates
2764
+
2765
+ $plugin_stats = array();
2766
+ if ( isset( $this->update_results['plugin'] ) ) {
2767
+ foreach ( $this->update_results['plugin'] as $upgrade ) {
2768
+ $plugin_stats[ $upgrade->item->plugin ] = ( true === $upgrade->result );
2769
+ }
2770
+ }
2771
+ wp_update_plugins( $plugin_stats ); // Check for Plugin updates
2772
+
2773
+ // Finally, Process any new translations
2774
+ $language_updates = wp_get_translation_updates();
2775
+ if ( $language_updates ) {
2776
+ foreach ( $language_updates as $update ) {
2777
+ $this->update( 'translation', $update );
2778
+ }
2779
+
2780
+ // Clear existing caches
2781
+ wp_clean_update_cache();
2782
+
2783
+ wp_version_check(); // check for Core updates
2784
+ wp_update_themes(); // Check for Theme updates
2785
+ wp_update_plugins(); // Check for Plugin updates
2786
+ }
2787
+
2788
+ // Send debugging email to all development installs.
2789
+ if ( ! empty( $this->update_results ) ) {
2790
+ $development_version = false !== strpos( $wp_version, '-' );
2791
+
2792
+ /**
2793
+ * Filter whether to send a debugging email for each automatic background update.
2794
+ *
2795
+ * @since 3.7.0
2796
+ *
2797
+ * @param bool $development_version By default, emails are sent if the
2798
+ * install is a development version.
2799
+ * Return false to avoid the email.
2800
+ */
2801
+ if ( apply_filters( 'automatic_updates_send_debug_email', $development_version ) )
2802
+ $this->send_debug_email();
2803
+
2804
+ if ( ! empty( $this->update_results['core'] ) )
2805
+ $this->after_core_update( $this->update_results['core'][0] );
2806
+
2807
+ /**
2808
+ * Fires after all automatic updates have run.
2809
+ *
2810
+ * @since 3.8.0
2811
+ *
2812
+ * @param array $update_results The results of all attempted updates.
2813
+ */
2814
+ do_action( 'automatic_updates_complete', $this->update_results );
2815
+ }
2816
+
2817
+ // Clear the lock
2818
+ delete_option( $lock_name );
2819
+ }
2820
+
2821
+ /**
2822
+ * If we tried to perform a core update, check if we should send an email,
2823
+ * and if we need to avoid processing future updates.
2824
+ *
2825
+ * @param object $update_result The result of the core update. Includes the update offer and result.
2826
+ */
2827
+ protected function after_core_update( $update_result ) {
2828
+ global $wp_version;
2829
+
2830
+ $core_update = $update_result->item;
2831
+ $result = $update_result->result;
2832
+
2833
+ if ( ! is_wp_error( $result ) ) {
2834
+ $this->send_email( 'success', $core_update );
2835
+ return;
2836
+ }
2837
+
2838
+ $error_code = $result->get_error_code();
2839
+
2840
+ // Any of these WP_Error codes are critical failures, as in they occurred after we started to copy core files.
2841
+ // We should not try to perform a background update again until there is a successful one-click update performed by the user.
2842
+ $critical = false;
2843
+ if ( $error_code === 'disk_full' || false !== strpos( $error_code, '__copy_dir' ) ) {
2844
+ $critical = true;
2845
+ } elseif ( $error_code === 'rollback_was_required' && is_wp_error( $result->get_error_data()->rollback ) ) {
2846
+ // A rollback is only critical if it failed too.
2847
+ $critical = true;
2848
+ $rollback_result = $result->get_error_data()->rollback;
2849
+ } elseif ( false !== strpos( $error_code, 'do_rollback' ) ) {
2850
+ $critical = true;
2851
+ }
2852
+
2853
+ if ( $critical ) {
2854
+ $critical_data = array(
2855
+ 'attempted' => $core_update->current,
2856
+ 'current' => $wp_version,
2857
+ 'error_code' => $error_code,
2858
+ 'error_data' => $result->get_error_data(),
2859
+ 'timestamp' => time(),
2860
+ 'critical' => true,
2861
+ );
2862
+ if ( isset( $rollback_result ) ) {
2863
+ $critical_data['rollback_code'] = $rollback_result->get_error_code();
2864
+ $critical_data['rollback_data'] = $rollback_result->get_error_data();
2865
+ }
2866
+ update_site_option( 'auto_core_update_failed', $critical_data );
2867
+ $this->send_email( 'critical', $core_update, $result );
2868
+ return;
2869
+ }
2870
+
2871
+ /*
2872
+ * Any other WP_Error code (like download_failed or files_not_writable) occurs before
2873
+ * we tried to copy over core files. Thus, the failures are early and graceful.
2874
+ *
2875
+ * We should avoid trying to perform a background update again for the same version.
2876
+ * But we can try again if another version is released.
2877
+ *
2878
+ * For certain 'transient' failures, like download_failed, we should allow retries.
2879
+ * In fact, let's schedule a special update for an hour from now. (It's possible
2880
+ * the issue could actually be on WordPress.org's side.) If that one fails, then email.
2881
+ */
2882
+ $send = true;
2883
+ $transient_failures = array( 'incompatible_archive', 'download_failed', 'insane_distro' );
2884
+ if ( in_array( $error_code, $transient_failures ) && ! get_site_option( 'auto_core_update_failed' ) ) {
2885
+ wp_schedule_single_event( time() + HOUR_IN_SECONDS, 'wp_maybe_auto_update' );
2886
+ $send = false;
2887
+ }
2888
+
2889
+ $n = get_site_option( 'auto_core_update_notified' );
2890
+ // Don't notify if we've already notified the same email address of the same version of the same notification type.
2891
+ if ( $n && 'fail' == $n['type'] && $n['email'] == get_site_option( 'admin_email' ) && $n['version'] == $core_update->current )
2892
+ $send = false;
2893
+
2894
+ update_site_option( 'auto_core_update_failed', array(
2895
+ 'attempted' => $core_update->current,
2896
+ 'current' => $wp_version,
2897
+ 'error_code' => $error_code,
2898
+ 'error_data' => $result->get_error_data(),
2899
+ 'timestamp' => time(),
2900
+ 'retry' => in_array( $error_code, $transient_failures ),
2901
+ ) );
2902
+
2903
+ if ( $send )
2904
+ $this->send_email( 'fail', $core_update, $result );
2905
+ }
2906
+
2907
+ /**
2908
+ * Sends an email upon the completion or failure of a background core update.
2909
+ *
2910
+ * @since 3.7.0
2911
+ *
2912
+ * @param string $type The type of email to send. Can be one of 'success', 'fail', 'manual', 'critical'.
2913
+ * @param object $core_update The update offer that was attempted.
2914
+ * @param mixed $result Optional. The result for the core update. Can be WP_Error.
2915
+ */
2916
+ protected function send_email( $type, $core_update, $result = null ) {
2917
+ update_site_option( 'auto_core_update_notified', array(
2918
+ 'type' => $type,
2919
+ 'email' => get_site_option( 'admin_email' ),
2920
+ 'version' => $core_update->current,
2921
+ 'timestamp' => time(),
2922
+ ) );
2923
+
2924
+ $next_user_core_update = get_preferred_from_update_core();
2925
+ // If the update transient is empty, use the update we just performed
2926
+ if ( ! $next_user_core_update )
2927
+ $next_user_core_update = $core_update;
2928
+ $newer_version_available = ( 'upgrade' == $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update->version, '>' ) );
2929
+
2930
+ /**
2931
+ * Filter whether to send an email following an automatic background core update.
2932
+ *
2933
+ * @since 3.7.0
2934
+ *
2935
+ * @param bool $send Whether to send the email. Default true.
2936
+ * @param string $type The type of email to send. Can be one of
2937
+ * 'success', 'fail', 'critical'.
2938
+ * @param object $core_update The update offer that was attempted.
2939
+ * @param mixed $result The result for the core update. Can be WP_Error.
2940
+ */
2941
+ if ( 'manual' !== $type && ! apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result ) )
2942
+ return;
2943
+
2944
+ switch ( $type ) {
2945
+ case 'success' : // We updated.
2946
+ /* translators: 1: Site name, 2: WordPress version number. */
2947
+ $subject = __( '[%1$s] Your site has updated to WordPress %2$s' );
2948
+ break;
2949
+
2950
+ case 'fail' : // We tried to update but couldn't.
2951
+ case 'manual' : // We can't update (and made no attempt).
2952
+ /* translators: 1: Site name, 2: WordPress version number. */
2953
+ $subject = __( '[%1$s] WordPress %2$s is available. Please update!' );
2954
+ break;
2955
+
2956
+ case 'critical' : // We tried to update, started to copy files, then things went wrong.
2957
+ /* translators: 1: Site name. */
2958
+ $subject = __( '[%1$s] URGENT: Your site may be down due to a failed update' );
2959
+ break;
2960
+
2961
+ default :
2962
+ return;
2963
+ }
2964
+
2965
+ // If the auto update is not to the latest version, say that the current version of WP is available instead.
2966
+ $version = 'success' === $type ? $core_update->current : $next_user_core_update->current;
2967
+ $subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $version );
2968
+
2969
+ $body = '';
2970
+
2971
+ switch ( $type ) {
2972
+ case 'success' :
2973
+ $body .= sprintf( __( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ), home_url(), $core_update->current );
2974
+ $body .= "\n\n";
2975
+ if ( ! $newer_version_available )
2976
+ $body .= __( 'No further action is needed on your part.' ) . ' ';
2977
+
2978
+ // Can only reference the About screen if their update was successful.
2979
+ list( $about_version ) = explode( '-', $core_update->current, 2 );
2980
+ $body .= sprintf( __( "For more on version %s, see the About WordPress screen:" ), $about_version );
2981
+ $body .= "\n" . admin_url( 'about.php' );
2982
+
2983
+ if ( $newer_version_available ) {
2984
+ $body .= "\n\n" . sprintf( __( 'WordPress %s is also now available.' ), $next_user_core_update->current ) . ' ';
2985
+ $body .= __( 'Updating is easy and only takes a few moments:' );
2986
+ $body .= "\n" . network_admin_url( 'update-core.php' );
2987
+ }
2988
+
2989
+ break;
2990
+
2991
+ case 'fail' :
2992
+ case 'manual' :
2993
+ $body .= sprintf( __( 'Please update your site at %1$s to WordPress %2$s.' ), home_url(), $next_user_core_update->current );
2994
+
2995
+ $body .= "\n\n";
2996
+
2997
+ // Don't show this message if there is a newer version available.
2998
+ // Potential for confusion, and also not useful for them to know at this point.
2999
+ if ( 'fail' == $type && ! $newer_version_available )
3000
+ $body .= __( 'We tried but were unable to update your site automatically.' ) . ' ';
3001
+
3002
+ $body .= __( 'Updating is easy and only takes a few moments:' );
3003
+ $body .= "\n" . network_admin_url( 'update-core.php' );
3004
+ break;
3005
+
3006
+ case 'critical' :
3007
+ if ( $newer_version_available )
3008
+ $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.' ), home_url(), $core_update->current );
3009
+ else
3010
+ $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ), home_url(), $core_update->current );
3011
+
3012
+ $body .= "\n\n" . __( "This means your site may be offline or broken. Don't panic; this can be fixed." );
3013
+
3014
+ $body .= "\n\n" . __( "Please check out your site now. It's possible that everything is working. If it says you need to update, you should do so:" );
3015
+ $body .= "\n" . network_admin_url( 'update-core.php' );
3016
+ break;
3017
+ }
3018
+
3019
+ $critical_support = 'critical' === $type && ! empty( $core_update->support_email );
3020
+ if ( $critical_support ) {
3021
+ // Support offer if available.
3022
+ $body .= "\n\n" . sprintf( __( "The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working." ), $core_update->support_email );
3023
+ } else {
3024
+ // Add a note about the support forums.
3025
+ $body .= "\n\n" . __( 'If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.' );
3026
+ $body .= "\n" . __( 'https://wordpress.org/support/' );
3027
+ }
3028
+
3029
+ // Updates are important!
3030
+ if ( $type != 'success' || $newer_version_available ) {
3031
+ $body .= "\n\n" . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' );
3032
+ }
3033
+
3034
+ if ( $critical_support ) {
3035
+ $body .= " " . __( "If you reach out to us, we'll also ensure you'll never have this problem again." );
3036
+ }
3037
+
3038
+ // If things are successful and we're now on the latest, mention plugins and themes if any are out of date.
3039
+ if ( $type == 'success' && ! $newer_version_available && ( get_plugin_updates() || get_theme_updates() ) ) {
3040
+ $body .= "\n\n" . __( 'You also have some plugins or themes with updates available. Update them now:' );
3041
+ $body .= "\n" . network_admin_url();
3042
+ }
3043
+
3044
+ $body .= "\n\n" . __( 'The WordPress Team' ) . "\n";
3045
+
3046
+ if ( 'critical' == $type && is_wp_error( $result ) ) {
3047
+ $body .= "\n***\n\n";
3048
+ $body .= sprintf( __( 'Your site was running version %s.' ), $GLOBALS['wp_version'] );
3049
+ $body .= ' ' . __( 'We have some data that describes the error your site encountered.' );
3050
+ $body .= ' ' . __( 'Your hosting company, support forum volunteers, or a friendly developer may be able to use this information to help you:' );
3051
+
3052
+ // If we had a rollback and we're still critical, then the rollback failed too.
3053
+ // Loop through all errors (the main WP_Error, the update result, the rollback result) for code, data, etc.
3054
+ if ( 'rollback_was_required' == $result->get_error_code() )
3055
+ $errors = array( $result, $result->get_error_data()->update, $result->get_error_data()->rollback );
3056
+ else
3057
+ $errors = array( $result );
3058
+
3059
+ foreach ( $errors as $error ) {
3060
+ if ( ! is_wp_error( $error ) )
3061
+ continue;
3062
+ $error_code = $error->get_error_code();
3063
+ $body .= "\n\n" . sprintf( __( "Error code: %s" ), $error_code );
3064
+ if ( 'rollback_was_required' == $error_code )
3065
+ continue;
3066
+ if ( $error->get_error_message() )
3067
+ $body .= "\n" . $error->get_error_message();
3068
+ $error_data = $error->get_error_data();
3069
+ if ( $error_data )
3070
+ $body .= "\n" . implode( ', ', (array) $error_data );
3071
+ }
3072
+ $body .= "\n";
3073
+ }
3074
+
3075
+ $to = get_site_option( 'admin_email' );
3076
+ $headers = '';
3077
+
3078
+ $email = compact( 'to', 'subject', 'body', 'headers' );
3079
+
3080
+ /**
3081
+ * Filter the email sent following an automatic background core update.
3082
+ *
3083
+ * @since 3.7.0
3084
+ *
3085
+ * @param array $email {
3086
+ * Array of email arguments that will be passed to wp_mail().
3087
+ *
3088
+ * @type string $to The email recipient. An array of emails
3089
+ * can be returned, as handled by wp_mail().
3090
+ * @type string $subject The email's subject.
3091
+ * @type string $body The email message body.
3092
+ * @type string $headers Any email headers, defaults to no headers.
3093
+ * }
3094
+ * @param string $type The type of email being sent. Can be one of
3095
+ * 'success', 'fail', 'manual', 'critical'.
3096
+ * @param object $core_update The update offer that was attempted.
3097
+ * @param mixed $result The result for the core update. Can be WP_Error.
3098
+ */
3099
+ $email = apply_filters( 'auto_core_update_email', $email, $type, $core_update, $result );
3100
+
3101
+ wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
3102
+ }
3103
+
3104
+ /**
3105
+ * Prepares and sends an email of a full log of background update results, useful for debugging and geekery.
3106
+ *
3107
+ * @since 3.7.0
3108
+ */
3109
+ protected function send_debug_email() {
3110
+ $update_count = 0;
3111
+ foreach ( $this->update_results as $type => $updates )
3112
+ $update_count += count( $updates );
3113
+
3114
+ $body = array();
3115
+ $failures = 0;
3116
+
3117
+ $body[] = sprintf( __( 'WordPress site: %s' ), network_home_url( '/' ) );
3118
+
3119
+ // Core
3120
+ if ( isset( $this->update_results['core'] ) ) {
3121
+ $result = $this->update_results['core'][0];
3122
+ if ( $result->result && ! is_wp_error( $result->result ) ) {
3123
+ $body[] = sprintf( __( 'SUCCESS: WordPress was successfully updated to %s' ), $result->name );
3124
+ } else {
3125
+ $body[] = sprintf( __( 'FAILED: WordPress failed to update to %s' ), $result->name );
3126
+ $failures++;
3127
+ }
3128
+ $body[] = '';
3129
+ }
3130
+
3131
+ // Plugins, Themes, Translations
3132
+ foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
3133
+ if ( ! isset( $this->update_results[ $type ] ) )
3134
+ continue;
3135
+ $success_items = wp_list_filter( $this->update_results[ $type ], array( 'result' => true ) );
3136
+ if ( $success_items ) {
3137
+ $messages = array(
3138
+ 'plugin' => __( 'The following plugins were successfully updated:' ),
3139
+ 'theme' => __( 'The following themes were successfully updated:' ),
3140
+ 'translation' => __( 'The following translations were successfully updated:' ),
3141
+ );
3142
+
3143
+ $body[] = $messages[ $type ];
3144
+ foreach ( wp_list_pluck( $success_items, 'name' ) as $name ) {
3145
+ $body[] = ' * ' . sprintf( __( 'SUCCESS: %s' ), $name );
3146
+ }
3147
+ }
3148
+ if ( $success_items != $this->update_results[ $type ] ) {
3149
+ // Failed updates
3150
+ $messages = array(
3151
+ 'plugin' => __( 'The following plugins failed to update:' ),
3152
+ 'theme' => __( 'The following themes failed to update:' ),
3153
+ 'translation' => __( 'The following translations failed to update:' ),
3154
+ );
3155
+
3156
+ $body[] = $messages[ $type ];
3157
+ foreach ( $this->update_results[ $type ] as $item ) {
3158
+ if ( ! $item->result || is_wp_error( $item->result ) ) {
3159
+ $body[] = ' * ' . sprintf( __( 'FAILED: %s' ), $item->name );
3160
+ $failures++;
3161
+ }
3162
+ }
3163
+ }
3164
+ $body[] = '';
3165
+ }
3166
+
3167
+ $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
3168
+ if ( $failures ) {
3169
+ $body[] = trim( __(
3170
+ "BETA TESTING?
3171
+ =============
3172
+
3173
+ This debugging email is sent when you are using a development version of WordPress.
3174
+
3175
+ If you think these failures might be due to a bug in WordPress, could you report it?
3176
+ * Open a thread in the support forums: https://wordpress.org/support/forum/alphabeta
3177
+ * Or, if you're comfortable writing a bug report: https://core.trac.wordpress.org/
3178
+
3179
+ Thanks! -- The WordPress Team" ) );
3180
+ $body[] = '';
3181
+
3182
+ $subject = sprintf( __( '[%s] There were failures during background updates' ), $site_title );
3183
+ } else {
3184
+ $subject = sprintf( __( '[%s] Background updates have finished' ), $site_title );
3185
+ }
3186
+
3187
+ $body[] = trim( __(
3188
+ 'UPDATE LOG
3189
+ ==========' ) );
3190
+ $body[] = '';
3191
+
3192
+ foreach ( array( 'core', 'plugin', 'theme', 'translation' ) as $type ) {
3193
+ if ( ! isset( $this->update_results[ $type ] ) )
3194
+ continue;
3195
+ foreach ( $this->update_results[ $type ] as $update ) {
3196
+ $body[] = $update->name;
3197
+ $body[] = str_repeat( '-', strlen( $update->name ) );
3198
+ foreach ( $update->messages as $message )
3199
+ $body[] = " " . html_entity_decode( str_replace( '&#8230;', '...', $message ) );
3200
+ if ( is_wp_error( $update->result ) ) {
3201
+ $results = array( 'update' => $update->result );
3202
+ // If we rolled back, we want to know an error that occurred then too.
3203
+ if ( 'rollback_was_required' === $update->result->get_error_code() )
3204
+ $results = (array) $update->result->get_error_data();
3205
+ foreach ( $results as $result_type => $result ) {
3206
+ if ( ! is_wp_error( $result ) )
3207
+ continue;
3208
+
3209
+ if ( 'rollback' === $result_type ) {
3210
+ /* translators: 1: Error code, 2: Error message. */
3211
+ $body[] = ' ' . sprintf( __( 'Rollback Error: [%1$s] %2$s' ), $result->get_error_code(), $result->get_error_message() );
3212
+ } else {
3213
+ /* translators: 1: Error code, 2: Error message. */
3214
+ $body[] = ' ' . sprintf( __( 'Error: [%1$s] %2$s' ), $result->get_error_code(), $result->get_error_message() );
3215
+ }
3216
+
3217
+ if ( $result->get_error_data() )
3218
+ $body[] = ' ' . implode( ', ', (array) $result->get_error_data() );
3219
+ }
3220
+ }
3221
+ $body[] = '';
3222
+ }
3223
+ }
3224
+
3225
+ $email = array(
3226
+ 'to' => get_site_option( 'admin_email' ),
3227
+ 'subject' => $subject,
3228
+ 'body' => implode( "\n", $body ),
3229
+ 'headers' => ''
3230
+ );
3231
+
3232
+ /**
3233
+ * Filter the debug email that can be sent following an automatic
3234
+ * background core update.
3235
+ *
3236
+ * @since 3.8.0
3237
+ *
3238
+ * @param array $email {
3239
+ * Array of email arguments that will be passed to wp_mail().
3240
+ *
3241
+ * @type string $to The email recipient. An array of emails
3242
+ * can be returned, as handled by wp_mail().
3243
+ * @type string $subject Email subject.
3244
+ * @type string $body Email message body.
3245
+ * @type string $headers Any email headers. Default empty.
3246
+ * }
3247
+ * @param int $failures The number of failures encountered while upgrading.
3248
+ * @param mixed $results The results of all attempted updates.
3249
+ */
3250
+ $email = apply_filters( 'automatic_updates_debug_email', $email, $failures, $this->update_results );
3251
+
3252
+ wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
3253
+ }
3254
+ }