stump-cli 0.1.0 → 0.1.1

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 (1310) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +18 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +3 -16
  6. data/Rakefile +2 -0
  7. data/bin/stump-cli +58 -0
  8. data/lib/stump-cli/version.rb +3 -0
  9. data/lib/stump.rb +5 -0
  10. data/lib/wp/Movefile-example +62 -0
  11. data/lib/wp/README.md +25 -0
  12. data/lib/wp/index.php +17 -0
  13. data/lib/wp/license.txt +385 -0
  14. data/lib/wp/readme.html +96 -0
  15. data/lib/wp/wp-activate.php +131 -0
  16. data/lib/wp/wp-admin/about.php +193 -0
  17. data/lib/wp/wp-admin/admin-ajax.php +98 -0
  18. data/lib/wp/wp-admin/admin-footer.php +99 -0
  19. data/lib/wp/wp-admin/admin-functions.php +15 -0
  20. data/lib/wp/wp-admin/admin-header.php +243 -0
  21. data/lib/wp/wp-admin/admin-post.php +71 -0
  22. data/lib/wp/wp-admin/admin.php +347 -0
  23. data/lib/wp/wp-admin/async-upload.php +114 -0
  24. data/lib/wp/wp-admin/comment.php +299 -0
  25. data/lib/wp/wp-admin/credits.php +192 -0
  26. data/lib/wp/wp-admin/css/about-rtl.css +446 -0
  27. data/lib/wp/wp-admin/css/about.css +446 -0
  28. data/lib/wp/wp-admin/css/admin-menu-rtl.css +917 -0
  29. data/lib/wp/wp-admin/css/admin-menu.css +917 -0
  30. data/lib/wp/wp-admin/css/color-picker-rtl.css +127 -0
  31. data/lib/wp/wp-admin/css/color-picker-rtl.min.css +1 -0
  32. data/lib/wp/wp-admin/css/color-picker.css +127 -0
  33. data/lib/wp/wp-admin/css/color-picker.min.css +1 -0
  34. data/lib/wp/wp-admin/css/colors/_admin.scss +525 -0
  35. data/lib/wp/wp-admin/css/colors/_mixins.scss +43 -0
  36. data/lib/wp/wp-admin/css/colors/_variables.scss +58 -0
  37. data/lib/wp/wp-admin/css/colors/blue/colors-rtl.css +341 -0
  38. data/lib/wp/wp-admin/css/colors/blue/colors-rtl.min.css +1 -0
  39. data/lib/wp/wp-admin/css/colors/blue/colors.css +341 -0
  40. data/lib/wp/wp-admin/css/colors/blue/colors.min.css +1 -0
  41. data/lib/wp/wp-admin/css/colors/blue/colors.scss +11 -0
  42. data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.css +341 -0
  43. data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.min.css +1 -0
  44. data/lib/wp/wp-admin/css/colors/coffee/colors.css +341 -0
  45. data/lib/wp/wp-admin/css/colors/coffee/colors.min.css +1 -0
  46. data/lib/wp/wp-admin/css/colors/coffee/colors.scss +7 -0
  47. data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.css +341 -0
  48. data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.min.css +1 -0
  49. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.css +341 -0
  50. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.min.css +1 -0
  51. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.scss +8 -0
  52. data/lib/wp/wp-admin/css/colors/light/colors-rtl.css +349 -0
  53. data/lib/wp/wp-admin/css/colors/light/colors-rtl.min.css +1 -0
  54. data/lib/wp/wp-admin/css/colors/light/colors.css +349 -0
  55. data/lib/wp/wp-admin/css/colors/light/colors.min.css +1 -0
  56. data/lib/wp/wp-admin/css/colors/light/colors.scss +38 -0
  57. data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.css +341 -0
  58. data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.min.css +1 -0
  59. data/lib/wp/wp-admin/css/colors/midnight/colors.css +341 -0
  60. data/lib/wp/wp-admin/css/colors/midnight/colors.min.css +1 -0
  61. data/lib/wp/wp-admin/css/colors/midnight/colors.scss +5 -0
  62. data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.css +341 -0
  63. data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.min.css +1 -0
  64. data/lib/wp/wp-admin/css/colors/ocean/colors.css +341 -0
  65. data/lib/wp/wp-admin/css/colors/ocean/colors.min.css +1 -0
  66. data/lib/wp/wp-admin/css/colors/ocean/colors.scss +8 -0
  67. data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.css +341 -0
  68. data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.min.css +1 -0
  69. data/lib/wp/wp-admin/css/colors/sunrise/colors.css +341 -0
  70. data/lib/wp/wp-admin/css/colors/sunrise/colors.min.css +1 -0
  71. data/lib/wp/wp-admin/css/colors/sunrise/colors.scss +6 -0
  72. data/lib/wp/wp-admin/css/common-rtl.css +3212 -0
  73. data/lib/wp/wp-admin/css/common.css +3212 -0
  74. data/lib/wp/wp-admin/css/customize-controls-rtl.css +889 -0
  75. data/lib/wp/wp-admin/css/customize-controls-rtl.min.css +1 -0
  76. data/lib/wp/wp-admin/css/customize-controls.css +889 -0
  77. data/lib/wp/wp-admin/css/customize-controls.min.css +1 -0
  78. data/lib/wp/wp-admin/css/customize-widgets-rtl.css +603 -0
  79. data/lib/wp/wp-admin/css/customize-widgets-rtl.min.css +1 -0
  80. data/lib/wp/wp-admin/css/customize-widgets.css +603 -0
  81. data/lib/wp/wp-admin/css/customize-widgets.min.css +1 -0
  82. data/lib/wp/wp-admin/css/dashboard-rtl.css +1116 -0
  83. data/lib/wp/wp-admin/css/dashboard.css +1116 -0
  84. data/lib/wp/wp-admin/css/deprecated-media-rtl.css +371 -0
  85. data/lib/wp/wp-admin/css/deprecated-media-rtl.min.css +1 -0
  86. data/lib/wp/wp-admin/css/deprecated-media.css +371 -0
  87. data/lib/wp/wp-admin/css/deprecated-media.min.css +1 -0
  88. data/lib/wp/wp-admin/css/edit-rtl.css +1501 -0
  89. data/lib/wp/wp-admin/css/edit.css +1501 -0
  90. data/lib/wp/wp-admin/css/farbtastic-rtl.css +41 -0
  91. data/lib/wp/wp-admin/css/farbtastic.css +41 -0
  92. data/lib/wp/wp-admin/css/forms-rtl.css +992 -0
  93. data/lib/wp/wp-admin/css/forms.css +992 -0
  94. data/lib/wp/wp-admin/css/ie-rtl.css +785 -0
  95. data/lib/wp/wp-admin/css/ie-rtl.min.css +1 -0
  96. data/lib/wp/wp-admin/css/ie.css +785 -0
  97. data/lib/wp/wp-admin/css/ie.min.css +1 -0
  98. data/lib/wp/wp-admin/css/install-rtl.css +389 -0
  99. data/lib/wp/wp-admin/css/install-rtl.min.css +1 -0
  100. data/lib/wp/wp-admin/css/install.css +389 -0
  101. data/lib/wp/wp-admin/css/install.min.css +1 -0
  102. data/lib/wp/wp-admin/css/l10n-rtl.css +101 -0
  103. data/lib/wp/wp-admin/css/l10n.css +101 -0
  104. data/lib/wp/wp-admin/css/list-tables-rtl.css +1875 -0
  105. data/lib/wp/wp-admin/css/list-tables.css +1875 -0
  106. data/lib/wp/wp-admin/css/login-rtl.css +269 -0
  107. data/lib/wp/wp-admin/css/login-rtl.min.css +1 -0
  108. data/lib/wp/wp-admin/css/login.css +269 -0
  109. data/lib/wp/wp-admin/css/login.min.css +1 -0
  110. data/lib/wp/wp-admin/css/media-rtl.css +1196 -0
  111. data/lib/wp/wp-admin/css/media.css +1196 -0
  112. data/lib/wp/wp-admin/css/nav-menus-rtl.css +857 -0
  113. data/lib/wp/wp-admin/css/nav-menus.css +857 -0
  114. data/lib/wp/wp-admin/css/press-this-rtl.css +458 -0
  115. data/lib/wp/wp-admin/css/press-this.css +458 -0
  116. data/lib/wp/wp-admin/css/revisions-rtl.css +574 -0
  117. data/lib/wp/wp-admin/css/revisions.css +574 -0
  118. data/lib/wp/wp-admin/css/themes-rtl.css +1732 -0
  119. data/lib/wp/wp-admin/css/themes.css +1732 -0
  120. data/lib/wp/wp-admin/css/widgets-rtl.css +577 -0
  121. data/lib/wp/wp-admin/css/widgets.css +577 -0
  122. data/lib/wp/wp-admin/css/wp-admin-rtl.css +14 -0
  123. data/lib/wp/wp-admin/css/wp-admin-rtl.min.css +1 -0
  124. data/lib/wp/wp-admin/css/wp-admin.css +14 -0
  125. data/lib/wp/wp-admin/css/wp-admin.min.css +1 -0
  126. data/lib/wp/wp-admin/custom-background.php +482 -0
  127. data/lib/wp/wp-admin/custom-header.php +1366 -0
  128. data/lib/wp/wp-admin/customize.php +278 -0
  129. data/lib/wp/wp-admin/edit-comments.php +254 -0
  130. data/lib/wp/wp-admin/edit-form-advanced.php +636 -0
  131. data/lib/wp/wp-admin/edit-form-comment.php +160 -0
  132. data/lib/wp/wp-admin/edit-link-form.php +150 -0
  133. data/lib/wp/wp-admin/edit-tag-form.php +204 -0
  134. data/lib/wp/wp-admin/edit-tags.php +591 -0
  135. data/lib/wp/wp-admin/edit.php +330 -0
  136. data/lib/wp/wp-admin/export.php +243 -0
  137. data/lib/wp/wp-admin/freedoms.php +57 -0
  138. data/lib/wp/wp-admin/images/align-center-2x.png +0 -0
  139. data/lib/wp/wp-admin/images/align-center.png +0 -0
  140. data/lib/wp/wp-admin/images/align-left-2x.png +0 -0
  141. data/lib/wp/wp-admin/images/align-left.png +0 -0
  142. data/lib/wp/wp-admin/images/align-none-2x.png +0 -0
  143. data/lib/wp/wp-admin/images/align-none.png +0 -0
  144. data/lib/wp/wp-admin/images/align-right-2x.png +0 -0
  145. data/lib/wp/wp-admin/images/align-right.png +0 -0
  146. data/lib/wp/wp-admin/images/arrows-2x.png +0 -0
  147. data/lib/wp/wp-admin/images/arrows.png +0 -0
  148. data/lib/wp/wp-admin/images/bubble_bg-2x.gif +0 -0
  149. data/lib/wp/wp-admin/images/bubble_bg.gif +0 -0
  150. data/lib/wp/wp-admin/images/comment-grey-bubble-2x.png +0 -0
  151. data/lib/wp/wp-admin/images/comment-grey-bubble.png +0 -0
  152. data/lib/wp/wp-admin/images/date-button-2x.gif +0 -0
  153. data/lib/wp/wp-admin/images/date-button.gif +0 -0
  154. data/lib/wp/wp-admin/images/generic.png +0 -0
  155. data/lib/wp/wp-admin/images/icons32-2x.png +0 -0
  156. data/lib/wp/wp-admin/images/icons32-vs-2x.png +0 -0
  157. data/lib/wp/wp-admin/images/icons32-vs.png +0 -0
  158. data/lib/wp/wp-admin/images/icons32.png +0 -0
  159. data/lib/wp/wp-admin/images/imgedit-icons-2x.png +0 -0
  160. data/lib/wp/wp-admin/images/imgedit-icons.png +0 -0
  161. data/lib/wp/wp-admin/images/list-2x.png +0 -0
  162. data/lib/wp/wp-admin/images/list.png +0 -0
  163. data/lib/wp/wp-admin/images/loading.gif +0 -0
  164. data/lib/wp/wp-admin/images/marker.png +0 -0
  165. data/lib/wp/wp-admin/images/mask.png +0 -0
  166. data/lib/wp/wp-admin/images/media-button-2x.png +0 -0
  167. data/lib/wp/wp-admin/images/media-button-image.gif +0 -0
  168. data/lib/wp/wp-admin/images/media-button-music.gif +0 -0
  169. data/lib/wp/wp-admin/images/media-button-other.gif +0 -0
  170. data/lib/wp/wp-admin/images/media-button-video.gif +0 -0
  171. data/lib/wp/wp-admin/images/media-button.png +0 -0
  172. data/lib/wp/wp-admin/images/menu-2x.png +0 -0
  173. data/lib/wp/wp-admin/images/menu-vs-2x.png +0 -0
  174. data/lib/wp/wp-admin/images/menu-vs.png +0 -0
  175. data/lib/wp/wp-admin/images/menu.png +0 -0
  176. data/lib/wp/wp-admin/images/no.png +0 -0
  177. data/lib/wp/wp-admin/images/post-formats-vs.png +0 -0
  178. data/lib/wp/wp-admin/images/post-formats.png +0 -0
  179. data/lib/wp/wp-admin/images/post-formats32-vs.png +0 -0
  180. data/lib/wp/wp-admin/images/post-formats32.png +0 -0
  181. data/lib/wp/wp-admin/images/resize-2x.gif +0 -0
  182. data/lib/wp/wp-admin/images/resize-rtl-2x.gif +0 -0
  183. data/lib/wp/wp-admin/images/resize-rtl.gif +0 -0
  184. data/lib/wp/wp-admin/images/resize.gif +0 -0
  185. data/lib/wp/wp-admin/images/se.png +0 -0
  186. data/lib/wp/wp-admin/images/sort-2x.gif +0 -0
  187. data/lib/wp/wp-admin/images/sort.gif +0 -0
  188. data/lib/wp/wp-admin/images/spinner-2x.gif +0 -0
  189. data/lib/wp/wp-admin/images/spinner.gif +0 -0
  190. data/lib/wp/wp-admin/images/stars-2x.png +0 -0
  191. data/lib/wp/wp-admin/images/stars.png +0 -0
  192. data/lib/wp/wp-admin/images/w-logo-blue.png +0 -0
  193. data/lib/wp/wp-admin/images/w-logo-white.png +0 -0
  194. data/lib/wp/wp-admin/images/wheel.png +0 -0
  195. data/lib/wp/wp-admin/images/wordpress-logo-white.svg +1 -0
  196. data/lib/wp/wp-admin/images/wordpress-logo.png +0 -0
  197. data/lib/wp/wp-admin/images/wordpress-logo.svg +1 -0
  198. data/lib/wp/wp-admin/images/wpspin_light-2x.gif +0 -0
  199. data/lib/wp/wp-admin/images/wpspin_light.gif +0 -0
  200. data/lib/wp/wp-admin/images/xit-2x.gif +0 -0
  201. data/lib/wp/wp-admin/images/xit.gif +0 -0
  202. data/lib/wp/wp-admin/images/yes.png +0 -0
  203. data/lib/wp/wp-admin/import.php +132 -0
  204. data/lib/wp/wp-admin/includes/admin.php +74 -0
  205. data/lib/wp/wp-admin/includes/ajax-actions.php +2762 -0
  206. data/lib/wp/wp-admin/includes/bookmark.php +305 -0
  207. data/lib/wp/wp-admin/includes/class-ftp-pure.php +190 -0
  208. data/lib/wp/wp-admin/includes/class-ftp-sockets.php +250 -0
  209. data/lib/wp/wp-admin/includes/class-ftp.php +907 -0
  210. data/lib/wp/wp-admin/includes/class-pclzip.php +5687 -0
  211. data/lib/wp/wp-admin/includes/class-wp-comments-list-table.php +637 -0
  212. data/lib/wp/wp-admin/includes/class-wp-filesystem-base.php +815 -0
  213. data/lib/wp/wp-admin/includes/class-wp-filesystem-direct.php +384 -0
  214. data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpext.php +415 -0
  215. data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php +352 -0
  216. data/lib/wp/wp-admin/includes/class-wp-filesystem-ssh2.php +392 -0
  217. data/lib/wp/wp-admin/includes/class-wp-importer.php +302 -0
  218. data/lib/wp/wp-admin/includes/class-wp-links-list-table.php +207 -0
  219. data/lib/wp/wp-admin/includes/class-wp-list-table.php +1080 -0
  220. data/lib/wp/wp-admin/includes/class-wp-media-list-table.php +574 -0
  221. data/lib/wp/wp-admin/includes/class-wp-ms-sites-list-table.php +402 -0
  222. data/lib/wp/wp-admin/includes/class-wp-ms-themes-list-table.php +459 -0
  223. data/lib/wp/wp-admin/includes/class-wp-ms-users-list-table.php +303 -0
  224. data/lib/wp/wp-admin/includes/class-wp-plugin-install-list-table.php +490 -0
  225. data/lib/wp/wp-admin/includes/class-wp-plugins-list-table.php +605 -0
  226. data/lib/wp/wp-admin/includes/class-wp-posts-list-table.php +1306 -0
  227. data/lib/wp/wp-admin/includes/class-wp-terms-list-table.php +466 -0
  228. data/lib/wp/wp-admin/includes/class-wp-theme-install-list-table.php +431 -0
  229. data/lib/wp/wp-admin/includes/class-wp-themes-list-table.php +279 -0
  230. data/lib/wp/wp-admin/includes/class-wp-upgrader-skins.php +767 -0
  231. data/lib/wp/wp-admin/includes/class-wp-upgrader.php +2676 -0
  232. data/lib/wp/wp-admin/includes/class-wp-users-list-table.php +459 -0
  233. data/lib/wp/wp-admin/includes/comment.php +171 -0
  234. data/lib/wp/wp-admin/includes/continents-cities.php +493 -0
  235. data/lib/wp/wp-admin/includes/dashboard.php +1333 -0
  236. data/lib/wp/wp-admin/includes/deprecated.php +1190 -0
  237. data/lib/wp/wp-admin/includes/export.php +508 -0
  238. data/lib/wp/wp-admin/includes/file.php +1152 -0
  239. data/lib/wp/wp-admin/includes/image-edit.php +828 -0
  240. data/lib/wp/wp-admin/includes/image.php +598 -0
  241. data/lib/wp/wp-admin/includes/import.php +206 -0
  242. data/lib/wp/wp-admin/includes/list-table.php +113 -0
  243. data/lib/wp/wp-admin/includes/media.php +3012 -0
  244. data/lib/wp/wp-admin/includes/menu.php +322 -0
  245. data/lib/wp/wp-admin/includes/meta-boxes.php +1119 -0
  246. data/lib/wp/wp-admin/includes/misc.php +845 -0
  247. data/lib/wp/wp-admin/includes/ms-deprecated.php +78 -0
  248. data/lib/wp/wp-admin/includes/ms.php +814 -0
  249. data/lib/wp/wp-admin/includes/nav-menu.php +1328 -0
  250. data/lib/wp/wp-admin/includes/plugin-install.php +550 -0
  251. data/lib/wp/wp-admin/includes/plugin.php +1899 -0
  252. data/lib/wp/wp-admin/includes/post.php +1661 -0
  253. data/lib/wp/wp-admin/includes/revision.php +228 -0
  254. data/lib/wp/wp-admin/includes/schema.php +1038 -0
  255. data/lib/wp/wp-admin/includes/screen.php +1179 -0
  256. data/lib/wp/wp-admin/includes/taxonomy.php +284 -0
  257. data/lib/wp/wp-admin/includes/template.php +2157 -0
  258. data/lib/wp/wp-admin/includes/theme-install.php +205 -0
  259. data/lib/wp/wp-admin/includes/theme.php +474 -0
  260. data/lib/wp/wp-admin/includes/translation-install.php +240 -0
  261. data/lib/wp/wp-admin/includes/update-core.php +1186 -0
  262. data/lib/wp/wp-admin/includes/update.php +432 -0
  263. data/lib/wp/wp-admin/includes/upgrade.php +2218 -0
  264. data/lib/wp/wp-admin/includes/user.php +442 -0
  265. data/lib/wp/wp-admin/includes/widgets.php +245 -0
  266. data/lib/wp/wp-admin/index.php +131 -0
  267. data/lib/wp/wp-admin/install-helper.php +199 -0
  268. data/lib/wp/wp-admin/install.php +305 -0
  269. data/lib/wp/wp-admin/js/accordion.js +143 -0
  270. data/lib/wp/wp-admin/js/accordion.min.js +1 -0
  271. data/lib/wp/wp-admin/js/color-picker.js +155 -0
  272. data/lib/wp/wp-admin/js/color-picker.min.js +1 -0
  273. data/lib/wp/wp-admin/js/comment.js +50 -0
  274. data/lib/wp/wp-admin/js/comment.min.js +1 -0
  275. data/lib/wp/wp-admin/js/common.js +804 -0
  276. data/lib/wp/wp-admin/js/common.min.js +1 -0
  277. data/lib/wp/wp-admin/js/custom-background.js +75 -0
  278. data/lib/wp/wp-admin/js/custom-background.min.js +1 -0
  279. data/lib/wp/wp-admin/js/custom-header.js +61 -0
  280. data/lib/wp/wp-admin/js/customize-controls.js +1305 -0
  281. data/lib/wp/wp-admin/js/customize-controls.min.js +1 -0
  282. data/lib/wp/wp-admin/js/customize-widgets.js +1882 -0
  283. data/lib/wp/wp-admin/js/customize-widgets.min.js +1 -0
  284. data/lib/wp/wp-admin/js/dashboard.js +190 -0
  285. data/lib/wp/wp-admin/js/dashboard.min.js +1 -0
  286. data/lib/wp/wp-admin/js/edit-comments.js +625 -0
  287. data/lib/wp/wp-admin/js/edit-comments.min.js +1 -0
  288. data/lib/wp/wp-admin/js/editor-expand.js +705 -0
  289. data/lib/wp/wp-admin/js/editor-expand.min.js +1 -0
  290. data/lib/wp/wp-admin/js/editor.js +324 -0
  291. data/lib/wp/wp-admin/js/editor.min.js +1 -0
  292. data/lib/wp/wp-admin/js/farbtastic.js +276 -0
  293. data/lib/wp/wp-admin/js/gallery.js +237 -0
  294. data/lib/wp/wp-admin/js/gallery.min.js +1 -0
  295. data/lib/wp/wp-admin/js/image-edit.js +633 -0
  296. data/lib/wp/wp-admin/js/image-edit.min.js +1 -0
  297. data/lib/wp/wp-admin/js/inline-edit-post.js +359 -0
  298. data/lib/wp/wp-admin/js/inline-edit-post.min.js +1 -0
  299. data/lib/wp/wp-admin/js/inline-edit-tax.js +142 -0
  300. data/lib/wp/wp-admin/js/inline-edit-tax.min.js +1 -0
  301. data/lib/wp/wp-admin/js/iris.min.js +4 -0
  302. data/lib/wp/wp-admin/js/language-chooser.js +26 -0
  303. data/lib/wp/wp-admin/js/language-chooser.min.js +1 -0
  304. data/lib/wp/wp-admin/js/link.js +69 -0
  305. data/lib/wp/wp-admin/js/link.min.js +1 -0
  306. data/lib/wp/wp-admin/js/media-gallery.js +26 -0
  307. data/lib/wp/wp-admin/js/media-gallery.min.js +1 -0
  308. data/lib/wp/wp-admin/js/media-upload.js +69 -0
  309. data/lib/wp/wp-admin/js/media-upload.min.js +1 -0
  310. data/lib/wp/wp-admin/js/media.js +111 -0
  311. data/lib/wp/wp-admin/js/media.min.js +1 -0
  312. data/lib/wp/wp-admin/js/nav-menu.js +1205 -0
  313. data/lib/wp/wp-admin/js/nav-menu.min.js +1 -0
  314. data/lib/wp/wp-admin/js/password-strength-meter.js +75 -0
  315. data/lib/wp/wp-admin/js/password-strength-meter.min.js +1 -0
  316. data/lib/wp/wp-admin/js/plugin-install.js +76 -0
  317. data/lib/wp/wp-admin/js/plugin-install.min.js +1 -0
  318. data/lib/wp/wp-admin/js/post.js +1094 -0
  319. data/lib/wp/wp-admin/js/post.min.js +1 -0
  320. data/lib/wp/wp-admin/js/postbox.js +199 -0
  321. data/lib/wp/wp-admin/js/postbox.min.js +1 -0
  322. data/lib/wp/wp-admin/js/revisions.js +1110 -0
  323. data/lib/wp/wp-admin/js/revisions.min.js +1 -0
  324. data/lib/wp/wp-admin/js/set-post-thumbnail.js +24 -0
  325. data/lib/wp/wp-admin/js/set-post-thumbnail.min.js +1 -0
  326. data/lib/wp/wp-admin/js/svg-painter.js +240 -0
  327. data/lib/wp/wp-admin/js/svg-painter.min.js +1 -0
  328. data/lib/wp/wp-admin/js/tags.js +72 -0
  329. data/lib/wp/wp-admin/js/tags.min.js +1 -0
  330. data/lib/wp/wp-admin/js/theme.js +1691 -0
  331. data/lib/wp/wp-admin/js/theme.min.js +1 -0
  332. data/lib/wp/wp-admin/js/updates.js +65 -0
  333. data/lib/wp/wp-admin/js/updates.min.js +1 -0
  334. data/lib/wp/wp-admin/js/user-profile.js +127 -0
  335. data/lib/wp/wp-admin/js/user-profile.min.js +1 -0
  336. data/lib/wp/wp-admin/js/user-suggest.js +30 -0
  337. data/lib/wp/wp-admin/js/user-suggest.min.js +1 -0
  338. data/lib/wp/wp-admin/js/widgets.js +494 -0
  339. data/lib/wp/wp-admin/js/widgets.min.js +1 -0
  340. data/lib/wp/wp-admin/js/word-count.js +44 -0
  341. data/lib/wp/wp-admin/js/word-count.min.js +1 -0
  342. data/lib/wp/wp-admin/js/wp-fullscreen.js +704 -0
  343. data/lib/wp/wp-admin/js/wp-fullscreen.min.js +1 -0
  344. data/lib/wp/wp-admin/js/xfn.js +17 -0
  345. data/lib/wp/wp-admin/js/xfn.min.js +1 -0
  346. data/lib/wp/wp-admin/link-add.php +29 -0
  347. data/lib/wp/wp-admin/link-manager.php +99 -0
  348. data/lib/wp/wp-admin/link-parse-opml.php +84 -0
  349. data/lib/wp/wp-admin/link.php +117 -0
  350. data/lib/wp/wp-admin/load-scripts.php +162 -0
  351. data/lib/wp/wp-admin/load-styles.php +153 -0
  352. data/lib/wp/wp-admin/maint/repair.php +124 -0
  353. data/lib/wp/wp-admin/media-new.php +84 -0
  354. data/lib/wp/wp-admin/media-upload.php +100 -0
  355. data/lib/wp/wp-admin/media.php +146 -0
  356. data/lib/wp/wp-admin/menu-header.php +227 -0
  357. data/lib/wp/wp-admin/menu.php +255 -0
  358. data/lib/wp/wp-admin/moderation.php +12 -0
  359. data/lib/wp/wp-admin/ms-admin.php +13 -0
  360. data/lib/wp/wp-admin/ms-delete-site.php +91 -0
  361. data/lib/wp/wp-admin/ms-edit.php +13 -0
  362. data/lib/wp/wp-admin/ms-options.php +12 -0
  363. data/lib/wp/wp-admin/ms-sites.php +13 -0
  364. data/lib/wp/wp-admin/ms-themes.php +13 -0
  365. data/lib/wp/wp-admin/ms-upgrade-network.php +13 -0
  366. data/lib/wp/wp-admin/ms-users.php +13 -0
  367. data/lib/wp/wp-admin/my-sites.php +145 -0
  368. data/lib/wp/wp-admin/nav-menus.php +798 -0
  369. data/lib/wp/wp-admin/network.php +561 -0
  370. data/lib/wp/wp-admin/network/about.php +16 -0
  371. data/lib/wp/wp-admin/network/admin.php +32 -0
  372. data/lib/wp/wp-admin/network/credits.php +16 -0
  373. data/lib/wp/wp-admin/network/edit.php +42 -0
  374. data/lib/wp/wp-admin/network/freedoms.php +16 -0
  375. data/lib/wp/wp-admin/network/index.php +79 -0
  376. data/lib/wp/wp-admin/network/menu.php +63 -0
  377. data/lib/wp/wp-admin/network/plugin-editor.php +16 -0
  378. data/lib/wp/wp-admin/network/plugin-install.php +19 -0
  379. data/lib/wp/wp-admin/network/plugins.php +16 -0
  380. data/lib/wp/wp-admin/network/profile.php +16 -0
  381. data/lib/wp/wp-admin/network/settings.php +347 -0
  382. data/lib/wp/wp-admin/network/setup.php +16 -0
  383. data/lib/wp/wp-admin/network/site-info.php +178 -0
  384. data/lib/wp/wp-admin/network/site-new.php +153 -0
  385. data/lib/wp/wp-admin/network/site-settings.php +173 -0
  386. data/lib/wp/wp-admin/network/site-themes.php +185 -0
  387. data/lib/wp/wp-admin/network/site-users.php +319 -0
  388. data/lib/wp/wp-admin/network/sites.php +275 -0
  389. data/lib/wp/wp-admin/network/theme-editor.php +16 -0
  390. data/lib/wp/wp-admin/network/theme-install.php +19 -0
  391. data/lib/wp/wp-admin/network/themes.php +291 -0
  392. data/lib/wp/wp-admin/network/update-core.php +16 -0
  393. data/lib/wp/wp-admin/network/update.php +19 -0
  394. data/lib/wp/wp-admin/network/upgrade.php +120 -0
  395. data/lib/wp/wp-admin/network/user-edit.php +16 -0
  396. data/lib/wp/wp-admin/network/user-new.php +106 -0
  397. data/lib/wp/wp-admin/network/users.php +296 -0
  398. data/lib/wp/wp-admin/options-discussion.php +273 -0
  399. data/lib/wp/wp-admin/options-general.php +355 -0
  400. data/lib/wp/wp-admin/options-head.php +18 -0
  401. data/lib/wp/wp-admin/options-media.php +136 -0
  402. data/lib/wp/wp-admin/options-permalink.php +289 -0
  403. data/lib/wp/wp-admin/options-reading.php +184 -0
  404. data/lib/wp/wp-admin/options-writing.php +194 -0
  405. data/lib/wp/wp-admin/options.php +265 -0
  406. data/lib/wp/wp-admin/plugin-editor.php +279 -0
  407. data/lib/wp/wp-admin/plugin-install.php +134 -0
  408. data/lib/wp/wp-admin/plugins.php +474 -0
  409. data/lib/wp/wp-admin/post-new.php +74 -0
  410. data/lib/wp/wp-admin/post.php +318 -0
  411. data/lib/wp/wp-admin/press-this.php +691 -0
  412. data/lib/wp/wp-admin/profile.php +18 -0
  413. data/lib/wp/wp-admin/revision.php +221 -0
  414. data/lib/wp/wp-admin/setup-config.php +345 -0
  415. data/lib/wp/wp-admin/theme-editor.php +243 -0
  416. data/lib/wp/wp-admin/theme-install.php +278 -0
  417. data/lib/wp/wp-admin/themes.php +374 -0
  418. data/lib/wp/wp-admin/tools.php +75 -0
  419. data/lib/wp/wp-admin/update-core.php +653 -0
  420. data/lib/wp/wp-admin/update.php +272 -0
  421. data/lib/wp/wp-admin/upgrade-functions.php +12 -0
  422. data/lib/wp/wp-admin/upgrade.php +116 -0
  423. data/lib/wp/wp-admin/upload.php +292 -0
  424. data/lib/wp/wp-admin/user-edit.php +557 -0
  425. data/lib/wp/wp-admin/user-new.php +439 -0
  426. data/lib/wp/wp-admin/user/about.php +13 -0
  427. data/lib/wp/wp-admin/user/admin.php +32 -0
  428. data/lib/wp/wp-admin/user/credits.php +13 -0
  429. data/lib/wp/wp-admin/user/freedoms.php +13 -0
  430. data/lib/wp/wp-admin/user/index.php +12 -0
  431. data/lib/wp/wp-admin/user/menu.php +22 -0
  432. data/lib/wp/wp-admin/user/profile.php +12 -0
  433. data/lib/wp/wp-admin/user/user-edit.php +12 -0
  434. data/lib/wp/wp-admin/users.php +460 -0
  435. data/lib/wp/wp-admin/widgets.php +442 -0
  436. data/lib/wp/wp-blog-header.php +18 -0
  437. data/lib/wp/wp-comments-post.php +164 -0
  438. data/lib/wp/wp-config-sample.php +80 -0
  439. data/lib/wp/wp-content/index.php +2 -0
  440. data/lib/wp/wp-content/plugins/hello.php +82 -0
  441. data/lib/wp/wp-content/plugins/index.php +2 -0
  442. data/lib/wp/wp-content/themes/index.php +2 -0
  443. data/lib/wp/wp-content/themes/stump/.editorconfig +11 -0
  444. data/lib/wp/wp-content/themes/stump/.jshintrc +16 -0
  445. data/lib/wp/wp-content/themes/stump/404.php +13 -0
  446. data/lib/wp/wp-content/themes/stump/CHANGELOG.md +333 -0
  447. data/lib/wp/wp-content/themes/stump/CONTRIBUTING.md +121 -0
  448. data/lib/wp/wp-content/themes/stump/Gruntfile.js +151 -0
  449. data/lib/wp/wp-content/themes/stump/LICENSE.md +19 -0
  450. data/lib/wp/wp-content/themes/stump/assets/coffee/build/.gitkeep +0 -0
  451. data/lib/wp/wp-content/themes/stump/assets/coffee/build/site.js +6 -0
  452. data/lib/wp/wp-content/themes/stump/assets/css/editor-style.css +548 -0
  453. data/lib/wp/wp-content/themes/stump/assets/css/main.min.css +4 -0
  454. data/lib/wp/wp-content/themes/stump/assets/css/main.min.css.map +7 -0
  455. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  456. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  457. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  458. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  459. data/lib/wp/wp-content/themes/stump/assets/img/.gitignore +0 -0
  460. data/lib/wp/wp-content/themes/stump/assets/js/_main.js +63 -0
  461. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/affix.js +137 -0
  462. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/alert.js +88 -0
  463. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/button.js +107 -0
  464. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/carousel.js +205 -0
  465. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/collapse.js +170 -0
  466. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/dropdown.js +147 -0
  467. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/modal.js +243 -0
  468. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/popover.js +110 -0
  469. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/scrollspy.js +153 -0
  470. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tab.js +125 -0
  471. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tooltip.js +399 -0
  472. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/transition.js +48 -0
  473. data/lib/wp/wp-content/themes/stump/assets/js/scripts.min.js +1 -0
  474. data/lib/wp/wp-content/themes/stump/assets/js/vendor/jquery-1.11.0.min.js +4 -0
  475. data/lib/wp/wp-content/themes/stump/assets/js/vendor/modernizr-2.7.0.min.js +4 -0
  476. data/lib/wp/wp-content/themes/stump/assets/sass/app.scss +9 -0
  477. data/lib/wp/wp-content/themes/stump/assets/sass/core/_variables.scss +1 -0
  478. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_alerts.scss +67 -0
  479. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_badges.scss +55 -0
  480. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_bootstrap.scss +49 -0
  481. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_breadcrumbs.scss +26 -0
  482. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_button-groups.scss +226 -0
  483. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_buttons.scss +159 -0
  484. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_carousel.scss +232 -0
  485. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_close.scss +35 -0
  486. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_code.scss +63 -0
  487. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_component-animations.scss +29 -0
  488. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_dropdowns.scss +213 -0
  489. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_forms.scss +436 -0
  490. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_glyphicons.scss +233 -0
  491. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_grid.scss +84 -0
  492. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_input-groups.scss +162 -0
  493. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_jumbotron.scss +44 -0
  494. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_labels.scss +64 -0
  495. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_list-group.scss +110 -0
  496. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_media.scss +56 -0
  497. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_mixins.scss +947 -0
  498. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_modals.scss +139 -0
  499. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navbar.scss +620 -0
  500. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navs.scss +242 -0
  501. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_normalize.scss +423 -0
  502. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pager.scss +55 -0
  503. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pagination.scss +88 -0
  504. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_panels.scss +241 -0
  505. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_popovers.scss +133 -0
  506. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_print.scss +101 -0
  507. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_progress-bars.scss +80 -0
  508. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_responsive-utilities.scss +74 -0
  509. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_scaffolding.scss +134 -0
  510. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tables.scss +233 -0
  511. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_theme.scss +247 -0
  512. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_thumbnails.scss +38 -0
  513. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tooltip.scss +95 -0
  514. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_type.scss +284 -0
  515. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_utilities.scss +56 -0
  516. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_variables.scss +833 -0
  517. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_wells.scss +29 -0
  518. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon-deprecated-upcoming.scss +13 -0
  519. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon.scss +59 -0
  520. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_button.scss +273 -0
  521. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_clearfix.scss +29 -0
  522. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_font-family.scss +5 -0
  523. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_hide-text.scss +5 -0
  524. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_html5-input-types.scss +56 -0
  525. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_position.scss +42 -0
  526. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_prefixer.scss +49 -0
  527. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_retina-image.scss +32 -0
  528. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_size.scss +44 -0
  529. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_timing-functions.scss +32 -0
  530. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_triangle.scss +45 -0
  531. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_animation.scss +52 -0
  532. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_appearance.scss +3 -0
  533. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_backface-visibility.scss +6 -0
  534. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background-image.scss +48 -0
  535. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background.scss +103 -0
  536. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-image.scss +55 -0
  537. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-radius.scss +22 -0
  538. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_box-sizing.scss +4 -0
  539. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_columns.scss +47 -0
  540. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_flex-box.scss +52 -0
  541. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_font-face.scss +23 -0
  542. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_hidpi-media-query.scss +10 -0
  543. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_image-rendering.scss +13 -0
  544. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_inline-block.scss +8 -0
  545. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_keyframes.scss +43 -0
  546. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_linear-gradient.scss +41 -0
  547. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_perspective.scss +8 -0
  548. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_placeholder.scss +29 -0
  549. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_radial-gradient.scss +44 -0
  550. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transform.scss +15 -0
  551. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transition.scss +34 -0
  552. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_user-select.scss +3 -0
  553. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_compact.scss +11 -0
  554. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_flex-grid.scss +39 -0
  555. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_grid-width.scss +13 -0
  556. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_linear-gradient.scss +13 -0
  557. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_modular-scale.scss +40 -0
  558. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_px-to-em.scss +8 -0
  559. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_radial-gradient.scss +23 -0
  560. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_tint-shade.scss +9 -0
  561. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_transition-property-name.scss +22 -0
  562. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_deprecated-webkit-gradient.scss +39 -0
  563. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_gradient-positions-parser.scss +13 -0
  564. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_linear-positions-parser.scss +61 -0
  565. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-arg-parser.scss +69 -0
  566. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-positions-parser.scss +18 -0
  567. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_render-gradients.scss +26 -0
  568. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_shape-size-stripper.scss +10 -0
  569. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan.sass +11 -0
  570. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_grid.sass +161 -0
  571. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_mixins.sass +63 -0
  572. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_utilities.sass +24 -0
  573. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_variables.sass +42 -0
  574. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat-helpers.scss +8 -0
  575. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat.scss +21 -0
  576. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_new-breakpoint.scss +16 -0
  577. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_private.scss +107 -0
  578. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_px-to-em.scss +3 -0
  579. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_fill-parent.scss +7 -0
  580. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_grid.scss +5 -0
  581. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_media.scss +51 -0
  582. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_omega.scss +79 -0
  583. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_outer-container.scss +8 -0
  584. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_pad.scss +8 -0
  585. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_private.scss +50 -0
  586. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_reset.scss +12 -0
  587. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_row.scss +17 -0
  588. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_shift.scss +9 -0
  589. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_span-columns.scss +38 -0
  590. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_to-deprecate.scss +57 -0
  591. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_visual-grid.scss +41 -0
  592. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_grid.scss +7 -0
  593. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_visual-grid.scss +5 -0
  594. data/lib/wp/wp-content/themes/stump/base.php +36 -0
  595. data/lib/wp/wp-content/themes/stump/functions.php +19 -0
  596. data/lib/wp/wp-content/themes/stump/index.php +21 -0
  597. data/lib/wp/wp-content/themes/stump/lang/ar.mo +0 -0
  598. data/lib/wp/wp-content/themes/stump/lang/ar.po +270 -0
  599. data/lib/wp/wp-content/themes/stump/lang/bg_BG.mo +0 -0
  600. data/lib/wp/wp-content/themes/stump/lang/bg_BG.po +338 -0
  601. data/lib/wp/wp-content/themes/stump/lang/ca.mo +0 -0
  602. data/lib/wp/wp-content/themes/stump/lang/ca.po +517 -0
  603. data/lib/wp/wp-content/themes/stump/lang/da_DK.mo +0 -0
  604. data/lib/wp/wp-content/themes/stump/lang/da_DK.po +305 -0
  605. data/lib/wp/wp-content/themes/stump/lang/de_DE.mo +0 -0
  606. data/lib/wp/wp-content/themes/stump/lang/de_DE.po +271 -0
  607. data/lib/wp/wp-content/themes/stump/lang/el.mo +0 -0
  608. data/lib/wp/wp-content/themes/stump/lang/el.po +319 -0
  609. data/lib/wp/wp-content/themes/stump/lang/es_ES.mo +0 -0
  610. data/lib/wp/wp-content/themes/stump/lang/es_ES.po +270 -0
  611. data/lib/wp/wp-content/themes/stump/lang/et.mo +0 -0
  612. data/lib/wp/wp-content/themes/stump/lang/et.po +262 -0
  613. data/lib/wp/wp-content/themes/stump/lang/fa_IR.mo +0 -0
  614. data/lib/wp/wp-content/themes/stump/lang/fa_IR.po +273 -0
  615. data/lib/wp/wp-content/themes/stump/lang/fi_FI.mo +0 -0
  616. data/lib/wp/wp-content/themes/stump/lang/fi_FI.po +367 -0
  617. data/lib/wp/wp-content/themes/stump/lang/fr_FR.mo +0 -0
  618. data/lib/wp/wp-content/themes/stump/lang/fr_FR.po +336 -0
  619. data/lib/wp/wp-content/themes/stump/lang/he_IL.mo +0 -0
  620. data/lib/wp/wp-content/themes/stump/lang/he_IL.po +336 -0
  621. data/lib/wp/wp-content/themes/stump/lang/hu_HU.mo +0 -0
  622. data/lib/wp/wp-content/themes/stump/lang/hu_HU.po +271 -0
  623. data/lib/wp/wp-content/themes/stump/lang/id_ID.mo +0 -0
  624. data/lib/wp/wp-content/themes/stump/lang/id_ID.po +278 -0
  625. data/lib/wp/wp-content/themes/stump/lang/it_IT.mo +0 -0
  626. data/lib/wp/wp-content/themes/stump/lang/it_IT.po +269 -0
  627. data/lib/wp/wp-content/themes/stump/lang/ja.mo +0 -0
  628. data/lib/wp/wp-content/themes/stump/lang/ja.po +267 -0
  629. data/lib/wp/wp-content/themes/stump/lang/ko_KR.mo +0 -0
  630. data/lib/wp/wp-content/themes/stump/lang/ko_KR.po +282 -0
  631. data/lib/wp/wp-content/themes/stump/lang/mk_MK.mo +0 -0
  632. data/lib/wp/wp-content/themes/stump/lang/mk_MK.po +297 -0
  633. data/lib/wp/wp-content/themes/stump/lang/ms_MY.mo +0 -0
  634. data/lib/wp/wp-content/themes/stump/lang/ms_MY.po +342 -0
  635. data/lib/wp/wp-content/themes/stump/lang/nb_NO.mo +0 -0
  636. data/lib/wp/wp-content/themes/stump/lang/nb_NO.po +517 -0
  637. data/lib/wp/wp-content/themes/stump/lang/nl_NL.mo +0 -0
  638. data/lib/wp/wp-content/themes/stump/lang/nl_NL.po +261 -0
  639. data/lib/wp/wp-content/themes/stump/lang/nn_NO.mo +0 -0
  640. data/lib/wp/wp-content/themes/stump/lang/nn_NO.po +517 -0
  641. data/lib/wp/wp-content/themes/stump/lang/pl_PL.mo +0 -0
  642. data/lib/wp/wp-content/themes/stump/lang/pl_PL.po +283 -0
  643. data/lib/wp/wp-content/themes/stump/lang/pt_BR.mo +0 -0
  644. data/lib/wp/wp-content/themes/stump/lang/pt_BR.po +394 -0
  645. data/lib/wp/wp-content/themes/stump/lang/ro_RO.mo +0 -0
  646. data/lib/wp/wp-content/themes/stump/lang/ro_RO.po +271 -0
  647. data/lib/wp/wp-content/themes/stump/lang/roots.pot +244 -0
  648. data/lib/wp/wp-content/themes/stump/lang/ru_RU.mo +0 -0
  649. data/lib/wp/wp-content/themes/stump/lang/ru_RU.po +255 -0
  650. data/lib/wp/wp-content/themes/stump/lang/sk_SK.mo +0 -0
  651. data/lib/wp/wp-content/themes/stump/lang/sk_SK.po +267 -0
  652. data/lib/wp/wp-content/themes/stump/lang/sr_RS.mo +0 -0
  653. data/lib/wp/wp-content/themes/stump/lang/sr_RS.pot +261 -0
  654. data/lib/wp/wp-content/themes/stump/lang/sv_SE.mo +0 -0
  655. data/lib/wp/wp-content/themes/stump/lang/sv_SE.po +323 -0
  656. data/lib/wp/wp-content/themes/stump/lang/tr_TR.mo +0 -0
  657. data/lib/wp/wp-content/themes/stump/lang/tr_TR.po +405 -0
  658. data/lib/wp/wp-content/themes/stump/lang/vi_VN.mo +0 -0
  659. data/lib/wp/wp-content/themes/stump/lang/vi_VN.po +516 -0
  660. data/lib/wp/wp-content/themes/stump/lang/zh_CN.mo +0 -0
  661. data/lib/wp/wp-content/themes/stump/lang/zh_CN.po +329 -0
  662. data/lib/wp/wp-content/themes/stump/lang/zh_TW.mo +0 -0
  663. data/lib/wp/wp-content/themes/stump/lang/zh_TW.po +261 -0
  664. data/lib/wp/wp-content/themes/stump/lib/activation.php +215 -0
  665. data/lib/wp/wp-content/themes/stump/lib/cleanup.php +261 -0
  666. data/lib/wp/wp-content/themes/stump/lib/comments.php +52 -0
  667. data/lib/wp/wp-content/themes/stump/lib/config.php +79 -0
  668. data/lib/wp/wp-content/themes/stump/lib/custom.php +4 -0
  669. data/lib/wp/wp-content/themes/stump/lib/gallery.php +130 -0
  670. data/lib/wp/wp-content/themes/stump/lib/init.php +25 -0
  671. data/lib/wp/wp-content/themes/stump/lib/nav.php +93 -0
  672. data/lib/wp/wp-content/themes/stump/lib/relative-urls.php +50 -0
  673. data/lib/wp/wp-content/themes/stump/lib/scripts.php +67 -0
  674. data/lib/wp/wp-content/themes/stump/lib/sidebar.php +43 -0
  675. data/lib/wp/wp-content/themes/stump/lib/titles.php +37 -0
  676. data/lib/wp/wp-content/themes/stump/lib/utils.php +14 -0
  677. data/lib/wp/wp-content/themes/stump/lib/widgets.php +133 -0
  678. data/lib/wp/wp-content/themes/stump/lib/wrapper.php +49 -0
  679. data/lib/wp/wp-content/themes/stump/package.json +32 -0
  680. data/lib/wp/wp-content/themes/stump/page.php +2 -0
  681. data/lib/wp/wp-content/themes/stump/screenshot.png +0 -0
  682. data/lib/wp/wp-content/themes/stump/single.php +1 -0
  683. data/lib/wp/wp-content/themes/stump/style.css +11 -0
  684. data/lib/wp/wp-content/themes/stump/template-custom.php +8 -0
  685. data/lib/wp/wp-content/themes/stump/templates/comment.php +14 -0
  686. data/lib/wp/wp-content/themes/stump/templates/comments.php +80 -0
  687. data/lib/wp/wp-content/themes/stump/templates/content-page.php +4 -0
  688. data/lib/wp/wp-content/themes/stump/templates/content-single.php +15 -0
  689. data/lib/wp/wp-content/themes/stump/templates/content.php +9 -0
  690. data/lib/wp/wp-content/themes/stump/templates/entry-meta.php +2 -0
  691. data/lib/wp/wp-content/themes/stump/templates/footer.php +8 -0
  692. data/lib/wp/wp-content/themes/stump/templates/head.php +12 -0
  693. data/lib/wp/wp-content/themes/stump/templates/header-top-navbar.php +21 -0
  694. data/lib/wp/wp-content/themes/stump/templates/header.php +14 -0
  695. data/lib/wp/wp-content/themes/stump/templates/page-header.php +5 -0
  696. data/lib/wp/wp-content/themes/stump/templates/searchform.php +9 -0
  697. data/lib/wp/wp-content/themes/stump/templates/sidebar.php +1 -0
  698. data/lib/wp/wp-content/themes/twentyfourteen/404.php +32 -0
  699. data/lib/wp/wp-content/themes/twentyfourteen/archive.php +74 -0
  700. data/lib/wp/wp-content/themes/twentyfourteen/author.php +74 -0
  701. data/lib/wp/wp-content/themes/twentyfourteen/category.php +58 -0
  702. data/lib/wp/wp-content/themes/twentyfourteen/comments.php +66 -0
  703. data/lib/wp/wp-content/themes/twentyfourteen/content-aside.php +57 -0
  704. data/lib/wp/wp-content/themes/twentyfourteen/content-audio.php +57 -0
  705. data/lib/wp/wp-content/themes/twentyfourteen/content-featured-post.php +34 -0
  706. data/lib/wp/wp-content/themes/twentyfourteen/content-gallery.php +57 -0
  707. data/lib/wp/wp-content/themes/twentyfourteen/content-image.php +57 -0
  708. data/lib/wp/wp-content/themes/twentyfourteen/content-link.php +57 -0
  709. data/lib/wp/wp-content/themes/twentyfourteen/content-none.php +31 -0
  710. data/lib/wp/wp-content/themes/twentyfourteen/content-page.php +31 -0
  711. data/lib/wp/wp-content/themes/twentyfourteen/content-quote.php +57 -0
  712. data/lib/wp/wp-content/themes/twentyfourteen/content-video.php +57 -0
  713. data/lib/wp/wp-content/themes/twentyfourteen/content.php +66 -0
  714. data/lib/wp/wp-content/themes/twentyfourteen/css/editor-style.css +717 -0
  715. data/lib/wp/wp-content/themes/twentyfourteen/css/ie.css +1335 -0
  716. data/lib/wp/wp-content/themes/twentyfourteen/featured-content.php +39 -0
  717. data/lib/wp/wp-content/themes/twentyfourteen/footer.php +28 -0
  718. data/lib/wp/wp-content/themes/twentyfourteen/functions.php +519 -0
  719. data/lib/wp/wp-content/themes/twentyfourteen/genericons/COPYING.txt +9 -0
  720. data/lib/wp/wp-content/themes/twentyfourteen/genericons/Genericons-Regular.otf +0 -0
  721. data/lib/wp/wp-content/themes/twentyfourteen/genericons/LICENSE.txt +339 -0
  722. data/lib/wp/wp-content/themes/twentyfourteen/genericons/README.txt +123 -0
  723. data/lib/wp/wp-content/themes/twentyfourteen/genericons/example.html +464 -0
  724. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.eot +0 -0
  725. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.svg +135 -0
  726. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.ttf +0 -0
  727. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.woff +0 -0
  728. data/lib/wp/wp-content/themes/twentyfourteen/genericons/genericons.css +197 -0
  729. data/lib/wp/wp-content/themes/twentyfourteen/header.php +65 -0
  730. data/lib/wp/wp-content/themes/twentyfourteen/image.php +79 -0
  731. data/lib/wp/wp-content/themes/twentyfourteen/images/pattern-dark.svg +16 -0
  732. data/lib/wp/wp-content/themes/twentyfourteen/images/pattern-light.svg +6 -0
  733. data/lib/wp/wp-content/themes/twentyfourteen/inc/back-compat.php +63 -0
  734. data/lib/wp/wp-content/themes/twentyfourteen/inc/custom-header.php +147 -0
  735. data/lib/wp/wp-content/themes/twentyfourteen/inc/customizer.php +114 -0
  736. data/lib/wp/wp-content/themes/twentyfourteen/inc/featured-content.php +531 -0
  737. data/lib/wp/wp-content/themes/twentyfourteen/inc/template-tags.php +203 -0
  738. data/lib/wp/wp-content/themes/twentyfourteen/inc/widgets.php +269 -0
  739. data/lib/wp/wp-content/themes/twentyfourteen/index.php +61 -0
  740. data/lib/wp/wp-content/themes/twentyfourteen/js/customizer.js +38 -0
  741. data/lib/wp/wp-content/themes/twentyfourteen/js/featured-content-admin.js +9 -0
  742. data/lib/wp/wp-content/themes/twentyfourteen/js/functions.js +134 -0
  743. data/lib/wp/wp-content/themes/twentyfourteen/js/html5.js +8 -0
  744. data/lib/wp/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js +21 -0
  745. data/lib/wp/wp-content/themes/twentyfourteen/js/slider.js +598 -0
  746. data/lib/wp/wp-content/themes/twentyfourteen/languages/twentyfourteen.pot +467 -0
  747. data/lib/wp/wp-content/themes/twentyfourteen/page-templates/contributors.php +52 -0
  748. data/lib/wp/wp-content/themes/twentyfourteen/page-templates/full-width.php +42 -0
  749. data/lib/wp/wp-content/themes/twentyfourteen/page.php +48 -0
  750. data/lib/wp/wp-content/themes/twentyfourteen/rtl.css +854 -0
  751. data/lib/wp/wp-content/themes/twentyfourteen/screenshot.png +0 -0
  752. data/lib/wp/wp-content/themes/twentyfourteen/search.php +49 -0
  753. data/lib/wp/wp-content/themes/twentyfourteen/sidebar-content.php +16 -0
  754. data/lib/wp/wp-content/themes/twentyfourteen/sidebar-footer.php +19 -0
  755. data/lib/wp/wp-content/themes/twentyfourteen/sidebar.php +29 -0
  756. data/lib/wp/wp-content/themes/twentyfourteen/single.php +40 -0
  757. data/lib/wp/wp-content/themes/twentyfourteen/style.css +4321 -0
  758. data/lib/wp/wp-content/themes/twentyfourteen/tag.php +60 -0
  759. data/lib/wp/wp-content/themes/twentyfourteen/taxonomy-post_format.php +85 -0
  760. data/lib/wp/wp-cron.php +115 -0
  761. data/lib/wp/wp-includes/ID3/getid3.lib.php +1376 -0
  762. data/lib/wp/wp-includes/ID3/getid3.php +1796 -0
  763. data/lib/wp/wp-includes/ID3/license.commercial.txt +27 -0
  764. data/lib/wp/wp-includes/ID3/license.txt +29 -0
  765. data/lib/wp/wp-includes/ID3/module.audio-video.asf.php +2013 -0
  766. data/lib/wp/wp-includes/ID3/module.audio-video.flv.php +745 -0
  767. data/lib/wp/wp-includes/ID3/module.audio-video.matroska.php +1751 -0
  768. data/lib/wp/wp-includes/ID3/module.audio-video.quicktime.php +2246 -0
  769. data/lib/wp/wp-includes/ID3/module.audio-video.riff.php +2586 -0
  770. data/lib/wp/wp-includes/ID3/module.audio.ac3.php +474 -0
  771. data/lib/wp/wp-includes/ID3/module.audio.dts.php +291 -0
  772. data/lib/wp/wp-includes/ID3/module.audio.flac.php +443 -0
  773. data/lib/wp/wp-includes/ID3/module.audio.mp3.php +2012 -0
  774. data/lib/wp/wp-includes/ID3/module.audio.ogg.php +756 -0
  775. data/lib/wp/wp-includes/ID3/module.tag.apetag.php +371 -0
  776. data/lib/wp/wp-includes/ID3/module.tag.id3v1.php +360 -0
  777. data/lib/wp/wp-includes/ID3/module.tag.id3v2.php +3424 -0
  778. data/lib/wp/wp-includes/ID3/module.tag.lyrics3.php +294 -0
  779. data/lib/wp/wp-includes/ID3/readme.txt +604 -0
  780. data/lib/wp/wp-includes/SimplePie/Author.php +157 -0
  781. data/lib/wp/wp-includes/SimplePie/Cache.php +133 -0
  782. data/lib/wp/wp-includes/SimplePie/Cache/Base.php +114 -0
  783. data/lib/wp/wp-includes/SimplePie/Cache/DB.php +137 -0
  784. data/lib/wp/wp-includes/SimplePie/Cache/File.php +173 -0
  785. data/lib/wp/wp-includes/SimplePie/Cache/Memcache.php +183 -0
  786. data/lib/wp/wp-includes/SimplePie/Cache/MySQL.php +438 -0
  787. data/lib/wp/wp-includes/SimplePie/Caption.php +210 -0
  788. data/lib/wp/wp-includes/SimplePie/Category.php +157 -0
  789. data/lib/wp/wp-includes/SimplePie/Content/Type/Sniffer.php +332 -0
  790. data/lib/wp/wp-includes/SimplePie/Copyright.php +130 -0
  791. data/lib/wp/wp-includes/SimplePie/Core.php +57 -0
  792. data/lib/wp/wp-includes/SimplePie/Credit.php +156 -0
  793. data/lib/wp/wp-includes/SimplePie/Decode/HTML/Entities.php +617 -0
  794. data/lib/wp/wp-includes/SimplePie/Enclosure.php +1380 -0
  795. data/lib/wp/wp-includes/SimplePie/Exception.php +52 -0
  796. data/lib/wp/wp-includes/SimplePie/File.php +292 -0
  797. data/lib/wp/wp-includes/SimplePie/HTTP/Parser.php +500 -0
  798. data/lib/wp/wp-includes/SimplePie/IRI.php +1238 -0
  799. data/lib/wp/wp-includes/SimplePie/Item.php +2964 -0
  800. data/lib/wp/wp-includes/SimplePie/Locator.php +372 -0
  801. data/lib/wp/wp-includes/SimplePie/Misc.php +2247 -0
  802. data/lib/wp/wp-includes/SimplePie/Net/IPv6.php +276 -0
  803. data/lib/wp/wp-includes/SimplePie/Parse/Date.php +983 -0
  804. data/lib/wp/wp-includes/SimplePie/Parser.php +407 -0
  805. data/lib/wp/wp-includes/SimplePie/Rating.php +129 -0
  806. data/lib/wp/wp-includes/SimplePie/Registry.php +225 -0
  807. data/lib/wp/wp-includes/SimplePie/Restriction.php +155 -0
  808. data/lib/wp/wp-includes/SimplePie/Sanitize.php +554 -0
  809. data/lib/wp/wp-includes/SimplePie/Source.php +611 -0
  810. data/lib/wp/wp-includes/SimplePie/XML/Declaration/Parser.php +362 -0
  811. data/lib/wp/wp-includes/SimplePie/gzdecode.php +371 -0
  812. data/lib/wp/wp-includes/Text/Diff.php +450 -0
  813. data/lib/wp/wp-includes/Text/Diff/Engine/native.php +436 -0
  814. data/lib/wp/wp-includes/Text/Diff/Engine/shell.php +162 -0
  815. data/lib/wp/wp-includes/Text/Diff/Engine/string.php +248 -0
  816. data/lib/wp/wp-includes/Text/Diff/Engine/xdiff.php +64 -0
  817. data/lib/wp/wp-includes/Text/Diff/Renderer.php +235 -0
  818. data/lib/wp/wp-includes/Text/Diff/Renderer/inline.php +206 -0
  819. data/lib/wp/wp-includes/admin-bar.php +870 -0
  820. data/lib/wp/wp-includes/atomlib.php +352 -0
  821. data/lib/wp/wp-includes/author-template.php +471 -0
  822. data/lib/wp/wp-includes/bookmark-template.php +298 -0
  823. data/lib/wp/wp-includes/bookmark.php +416 -0
  824. data/lib/wp/wp-includes/cache.php +704 -0
  825. data/lib/wp/wp-includes/canonical.php +586 -0
  826. data/lib/wp/wp-includes/capabilities.php +1539 -0
  827. data/lib/wp/wp-includes/category-template.php +1407 -0
  828. data/lib/wp/wp-includes/category.php +343 -0
  829. data/lib/wp/wp-includes/certificates/ca-bundle.crt +3785 -0
  830. data/lib/wp/wp-includes/class-IXR.php +1100 -0
  831. data/lib/wp/wp-includes/class-feed.php +140 -0
  832. data/lib/wp/wp-includes/class-http.php +2245 -0
  833. data/lib/wp/wp-includes/class-json.php +936 -0
  834. data/lib/wp/wp-includes/class-oembed.php +579 -0
  835. data/lib/wp/wp-includes/class-phpass.php +260 -0
  836. data/lib/wp/wp-includes/class-phpmailer.php +3265 -0
  837. data/lib/wp/wp-includes/class-pop3.php +652 -0
  838. data/lib/wp/wp-includes/class-simplepie.php +3119 -0
  839. data/lib/wp/wp-includes/class-smtp.php +943 -0
  840. data/lib/wp/wp-includes/class-snoopy.php +1256 -0
  841. data/lib/wp/wp-includes/class-wp-admin-bar.php +517 -0
  842. data/lib/wp/wp-includes/class-wp-ajax-response.php +199 -0
  843. data/lib/wp/wp-includes/class-wp-customize-control.php +1124 -0
  844. data/lib/wp/wp-includes/class-wp-customize-manager.php +1272 -0
  845. data/lib/wp/wp-includes/class-wp-customize-panel.php +200 -0
  846. data/lib/wp/wp-includes/class-wp-customize-section.php +196 -0
  847. data/lib/wp/wp-includes/class-wp-customize-setting.php +554 -0
  848. data/lib/wp/wp-includes/class-wp-customize-widgets.php +1556 -0
  849. data/lib/wp/wp-includes/class-wp-editor.php +1435 -0
  850. data/lib/wp/wp-includes/class-wp-embed.php +373 -0
  851. data/lib/wp/wp-includes/class-wp-error.php +276 -0
  852. data/lib/wp/wp-includes/class-wp-http-ixr-client.php +97 -0
  853. data/lib/wp/wp-includes/class-wp-image-editor-gd.php +459 -0
  854. data/lib/wp/wp-includes/class-wp-image-editor-imagick.php +512 -0
  855. data/lib/wp/wp-includes/class-wp-image-editor.php +475 -0
  856. data/lib/wp/wp-includes/class-wp-theme.php +1235 -0
  857. data/lib/wp/wp-includes/class-wp-walker.php +471 -0
  858. data/lib/wp/wp-includes/class-wp-xmlrpc-server.php +5984 -0
  859. data/lib/wp/wp-includes/class-wp.php +782 -0
  860. data/lib/wp/wp-includes/class.wp-dependencies.php +509 -0
  861. data/lib/wp/wp-includes/class.wp-scripts.php +247 -0
  862. data/lib/wp/wp-includes/class.wp-styles.php +210 -0
  863. data/lib/wp/wp-includes/comment-template.php +2286 -0
  864. data/lib/wp/wp-includes/comment.php +2606 -0
  865. data/lib/wp/wp-includes/compat.php +125 -0
  866. data/lib/wp/wp-includes/cron.php +469 -0
  867. data/lib/wp/wp-includes/css/admin-bar-rtl.css +1099 -0
  868. data/lib/wp/wp-includes/css/admin-bar-rtl.min.css +1 -0
  869. data/lib/wp/wp-includes/css/admin-bar.css +1099 -0
  870. data/lib/wp/wp-includes/css/admin-bar.min.css +1 -0
  871. data/lib/wp/wp-includes/css/buttons-rtl.css +364 -0
  872. data/lib/wp/wp-includes/css/buttons-rtl.min.css +1 -0
  873. data/lib/wp/wp-includes/css/buttons.css +364 -0
  874. data/lib/wp/wp-includes/css/buttons.min.css +1 -0
  875. data/lib/wp/wp-includes/css/dashicons.css +893 -0
  876. data/lib/wp/wp-includes/css/dashicons.min.css +1 -0
  877. data/lib/wp/wp-includes/css/editor-rtl.css +1993 -0
  878. data/lib/wp/wp-includes/css/editor-rtl.min.css +1 -0
  879. data/lib/wp/wp-includes/css/editor.css +1993 -0
  880. data/lib/wp/wp-includes/css/editor.min.css +1 -0
  881. data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.css +343 -0
  882. data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.min.css +19 -0
  883. data/lib/wp/wp-includes/css/jquery-ui-dialog.css +343 -0
  884. data/lib/wp/wp-includes/css/jquery-ui-dialog.min.css +19 -0
  885. data/lib/wp/wp-includes/css/media-views-rtl.css +2568 -0
  886. data/lib/wp/wp-includes/css/media-views-rtl.min.css +1 -0
  887. data/lib/wp/wp-includes/css/media-views.css +2568 -0
  888. data/lib/wp/wp-includes/css/media-views.min.css +1 -0
  889. data/lib/wp/wp-includes/css/wp-auth-check-rtl.css +100 -0
  890. data/lib/wp/wp-includes/css/wp-auth-check-rtl.min.css +1 -0
  891. data/lib/wp/wp-includes/css/wp-auth-check.css +100 -0
  892. data/lib/wp/wp-includes/css/wp-auth-check.min.css +1 -0
  893. data/lib/wp/wp-includes/css/wp-pointer-rtl.css +212 -0
  894. data/lib/wp/wp-includes/css/wp-pointer-rtl.min.css +1 -0
  895. data/lib/wp/wp-includes/css/wp-pointer.css +212 -0
  896. data/lib/wp/wp-includes/css/wp-pointer.min.css +1 -0
  897. data/lib/wp/wp-includes/date.php +475 -0
  898. data/lib/wp/wp-includes/default-constants.php +323 -0
  899. data/lib/wp/wp-includes/default-filters.php +307 -0
  900. data/lib/wp/wp-includes/default-widgets.php +1423 -0
  901. data/lib/wp/wp-includes/deprecated.php +3501 -0
  902. data/lib/wp/wp-includes/feed-atom-comments.php +115 -0
  903. data/lib/wp/wp-includes/feed-atom.php +87 -0
  904. data/lib/wp/wp-includes/feed-rdf.php +81 -0
  905. data/lib/wp/wp-includes/feed-rss.php +46 -0
  906. data/lib/wp/wp-includes/feed-rss2-comments.php +97 -0
  907. data/lib/wp/wp-includes/feed-rss2.php +115 -0
  908. data/lib/wp/wp-includes/feed.php +659 -0
  909. data/lib/wp/wp-includes/fonts/dashicons.eot +0 -0
  910. data/lib/wp/wp-includes/fonts/dashicons.svg +250 -0
  911. data/lib/wp/wp-includes/fonts/dashicons.ttf +0 -0
  912. data/lib/wp/wp-includes/fonts/dashicons.woff +0 -0
  913. data/lib/wp/wp-includes/formatting.php +4006 -0
  914. data/lib/wp/wp-includes/functions.php +4631 -0
  915. data/lib/wp/wp-includes/functions.wp-scripts.php +258 -0
  916. data/lib/wp/wp-includes/functions.wp-styles.php +245 -0
  917. data/lib/wp/wp-includes/general-template.php +2982 -0
  918. data/lib/wp/wp-includes/http.php +551 -0
  919. data/lib/wp/wp-includes/images/admin-bar-sprite-2x.png +0 -0
  920. data/lib/wp/wp-includes/images/admin-bar-sprite.png +0 -0
  921. data/lib/wp/wp-includes/images/arrow-pointer-blue-2x.png +0 -0
  922. data/lib/wp/wp-includes/images/arrow-pointer-blue.png +0 -0
  923. data/lib/wp/wp-includes/images/blank.gif +0 -0
  924. data/lib/wp/wp-includes/images/crystal/archive.png +0 -0
  925. data/lib/wp/wp-includes/images/crystal/audio.png +0 -0
  926. data/lib/wp/wp-includes/images/crystal/code.png +0 -0
  927. data/lib/wp/wp-includes/images/crystal/default.png +0 -0
  928. data/lib/wp/wp-includes/images/crystal/document.png +0 -0
  929. data/lib/wp/wp-includes/images/crystal/interactive.png +0 -0
  930. data/lib/wp/wp-includes/images/crystal/license.txt +9 -0
  931. data/lib/wp/wp-includes/images/crystal/spreadsheet.png +0 -0
  932. data/lib/wp/wp-includes/images/crystal/text.png +0 -0
  933. data/lib/wp/wp-includes/images/crystal/video.png +0 -0
  934. data/lib/wp/wp-includes/images/down_arrow-2x.gif +0 -0
  935. data/lib/wp/wp-includes/images/down_arrow.gif +0 -0
  936. data/lib/wp/wp-includes/images/icon-pointer-flag-2x.png +0 -0
  937. data/lib/wp/wp-includes/images/icon-pointer-flag.png +0 -0
  938. data/lib/wp/wp-includes/images/media/archive.png +0 -0
  939. data/lib/wp/wp-includes/images/media/audio.png +0 -0
  940. data/lib/wp/wp-includes/images/media/code.png +0 -0
  941. data/lib/wp/wp-includes/images/media/default.png +0 -0
  942. data/lib/wp/wp-includes/images/media/document.png +0 -0
  943. data/lib/wp/wp-includes/images/media/interactive.png +0 -0
  944. data/lib/wp/wp-includes/images/media/spreadsheet.png +0 -0
  945. data/lib/wp/wp-includes/images/media/text.png +0 -0
  946. data/lib/wp/wp-includes/images/media/video.png +0 -0
  947. data/lib/wp/wp-includes/images/rss-2x.png +0 -0
  948. data/lib/wp/wp-includes/images/rss.png +0 -0
  949. data/lib/wp/wp-includes/images/smilies/icon_arrow.gif +0 -0
  950. data/lib/wp/wp-includes/images/smilies/icon_biggrin.gif +0 -0
  951. data/lib/wp/wp-includes/images/smilies/icon_confused.gif +0 -0
  952. data/lib/wp/wp-includes/images/smilies/icon_cool.gif +0 -0
  953. data/lib/wp/wp-includes/images/smilies/icon_cry.gif +0 -0
  954. data/lib/wp/wp-includes/images/smilies/icon_eek.gif +0 -0
  955. data/lib/wp/wp-includes/images/smilies/icon_evil.gif +0 -0
  956. data/lib/wp/wp-includes/images/smilies/icon_exclaim.gif +0 -0
  957. data/lib/wp/wp-includes/images/smilies/icon_idea.gif +0 -0
  958. data/lib/wp/wp-includes/images/smilies/icon_lol.gif +0 -0
  959. data/lib/wp/wp-includes/images/smilies/icon_mad.gif +0 -0
  960. data/lib/wp/wp-includes/images/smilies/icon_mrgreen.gif +0 -0
  961. data/lib/wp/wp-includes/images/smilies/icon_neutral.gif +0 -0
  962. data/lib/wp/wp-includes/images/smilies/icon_question.gif +0 -0
  963. data/lib/wp/wp-includes/images/smilies/icon_razz.gif +0 -0
  964. data/lib/wp/wp-includes/images/smilies/icon_redface.gif +0 -0
  965. data/lib/wp/wp-includes/images/smilies/icon_rolleyes.gif +0 -0
  966. data/lib/wp/wp-includes/images/smilies/icon_sad.gif +0 -0
  967. data/lib/wp/wp-includes/images/smilies/icon_smile.gif +0 -0
  968. data/lib/wp/wp-includes/images/smilies/icon_surprised.gif +0 -0
  969. data/lib/wp/wp-includes/images/smilies/icon_twisted.gif +0 -0
  970. data/lib/wp/wp-includes/images/smilies/icon_wink.gif +0 -0
  971. data/lib/wp/wp-includes/images/spinner-2x.gif +0 -0
  972. data/lib/wp/wp-includes/images/spinner.gif +0 -0
  973. data/lib/wp/wp-includes/images/toggle-arrow-2x.png +0 -0
  974. data/lib/wp/wp-includes/images/toggle-arrow.png +0 -0
  975. data/lib/wp/wp-includes/images/uploader-icons-2x.png +0 -0
  976. data/lib/wp/wp-includes/images/uploader-icons.png +0 -0
  977. data/lib/wp/wp-includes/images/wlw/wp-comments.png +0 -0
  978. data/lib/wp/wp-includes/images/wlw/wp-icon.png +0 -0
  979. data/lib/wp/wp-includes/images/wlw/wp-watermark.png +0 -0
  980. data/lib/wp/wp-includes/images/wpicons-2x.png +0 -0
  981. data/lib/wp/wp-includes/images/wpicons.png +0 -0
  982. data/lib/wp/wp-includes/images/wpspin-2x.gif +0 -0
  983. data/lib/wp/wp-includes/images/wpspin.gif +0 -0
  984. data/lib/wp/wp-includes/images/xit-2x.gif +0 -0
  985. data/lib/wp/wp-includes/images/xit.gif +0 -0
  986. data/lib/wp/wp-includes/js/admin-bar.js +365 -0
  987. data/lib/wp/wp-includes/js/admin-bar.min.js +1 -0
  988. data/lib/wp/wp-includes/js/autosave.js +589 -0
  989. data/lib/wp/wp-includes/js/autosave.min.js +1 -0
  990. data/lib/wp/wp-includes/js/backbone.min.js +1 -0
  991. data/lib/wp/wp-includes/js/colorpicker.js +707 -0
  992. data/lib/wp/wp-includes/js/colorpicker.min.js +1 -0
  993. data/lib/wp/wp-includes/js/comment-reply.js +47 -0
  994. data/lib/wp/wp-includes/js/comment-reply.min.js +1 -0
  995. data/lib/wp/wp-includes/js/crop/cropper.css +165 -0
  996. data/lib/wp/wp-includes/js/crop/cropper.js +516 -0
  997. data/lib/wp/wp-includes/js/crop/marqueeHoriz.gif +0 -0
  998. data/lib/wp/wp-includes/js/crop/marqueeVert.gif +0 -0
  999. data/lib/wp/wp-includes/js/customize-base.js +617 -0
  1000. data/lib/wp/wp-includes/js/customize-base.min.js +1 -0
  1001. data/lib/wp/wp-includes/js/customize-loader.js +246 -0
  1002. data/lib/wp/wp-includes/js/customize-loader.min.js +1 -0
  1003. data/lib/wp/wp-includes/js/customize-models.js +247 -0
  1004. data/lib/wp/wp-includes/js/customize-models.min.js +1 -0
  1005. data/lib/wp/wp-includes/js/customize-preview-widgets.js +129 -0
  1006. data/lib/wp/wp-includes/js/customize-preview-widgets.min.js +1 -0
  1007. data/lib/wp/wp-includes/js/customize-preview.js +154 -0
  1008. data/lib/wp/wp-includes/js/customize-preview.min.js +1 -0
  1009. data/lib/wp/wp-includes/js/customize-views.js +231 -0
  1010. data/lib/wp/wp-includes/js/customize-views.min.js +1 -0
  1011. data/lib/wp/wp-includes/js/heartbeat.js +738 -0
  1012. data/lib/wp/wp-includes/js/heartbeat.min.js +1 -0
  1013. data/lib/wp/wp-includes/js/hoverIntent.js +115 -0
  1014. data/lib/wp/wp-includes/js/hoverIntent.min.js +1 -0
  1015. data/lib/wp/wp-includes/js/imgareaselect/border-anim-h.gif +0 -0
  1016. data/lib/wp/wp-includes/js/imgareaselect/border-anim-v.gif +0 -0
  1017. data/lib/wp/wp-includes/js/imgareaselect/imgareaselect.css +41 -0
  1018. data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.js +1205 -0
  1019. data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.min.js +1 -0
  1020. data/lib/wp/wp-includes/js/jcrop/Jcrop.gif +0 -0
  1021. data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.css +29 -0
  1022. data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.js +22 -0
  1023. data/lib/wp/wp-includes/js/jquery/jquery-migrate.js +521 -0
  1024. data/lib/wp/wp-includes/js/jquery/jquery-migrate.min.js +2 -0
  1025. data/lib/wp/wp-includes/js/jquery/jquery.color.min.js +2 -0
  1026. data/lib/wp/wp-includes/js/jquery/jquery.form.js +1193 -0
  1027. data/lib/wp/wp-includes/js/jquery/jquery.form.min.js +11 -0
  1028. data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.js +134 -0
  1029. data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.min.js +1 -0
  1030. data/lib/wp/wp-includes/js/jquery/jquery.js +5 -0
  1031. data/lib/wp/wp-includes/js/jquery/jquery.masonry.min.js +11 -0
  1032. data/lib/wp/wp-includes/js/jquery/jquery.query.js +11 -0
  1033. data/lib/wp/wp-includes/js/jquery/jquery.schedule.js +36 -0
  1034. data/lib/wp/wp-includes/js/jquery/jquery.serialize-object.js +31 -0
  1035. data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.js +99 -0
  1036. data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.min.js +1 -0
  1037. data/lib/wp/wp-includes/js/jquery/jquery.ui.touch-punch.js +11 -0
  1038. data/lib/wp/wp-includes/js/jquery/suggest.js +316 -0
  1039. data/lib/wp/wp-includes/js/jquery/suggest.min.js +1 -0
  1040. data/lib/wp/wp-includes/js/jquery/ui/accordion.min.js +11 -0
  1041. data/lib/wp/wp-includes/js/jquery/ui/autocomplete.min.js +11 -0
  1042. data/lib/wp/wp-includes/js/jquery/ui/button.min.js +11 -0
  1043. data/lib/wp/wp-includes/js/jquery/ui/core.min.js +11 -0
  1044. data/lib/wp/wp-includes/js/jquery/ui/datepicker.min.js +12 -0
  1045. data/lib/wp/wp-includes/js/jquery/ui/dialog.min.js +11 -0
  1046. data/lib/wp/wp-includes/js/jquery/ui/draggable.min.js +11 -0
  1047. data/lib/wp/wp-includes/js/jquery/ui/droppable.min.js +11 -0
  1048. data/lib/wp/wp-includes/js/jquery/ui/effect-blind.min.js +11 -0
  1049. data/lib/wp/wp-includes/js/jquery/ui/effect-bounce.min.js +11 -0
  1050. data/lib/wp/wp-includes/js/jquery/ui/effect-clip.min.js +11 -0
  1051. data/lib/wp/wp-includes/js/jquery/ui/effect-drop.min.js +11 -0
  1052. data/lib/wp/wp-includes/js/jquery/ui/effect-explode.min.js +11 -0
  1053. data/lib/wp/wp-includes/js/jquery/ui/effect-fade.min.js +11 -0
  1054. data/lib/wp/wp-includes/js/jquery/ui/effect-fold.min.js +11 -0
  1055. data/lib/wp/wp-includes/js/jquery/ui/effect-highlight.min.js +11 -0
  1056. data/lib/wp/wp-includes/js/jquery/ui/effect-puff.min.js +11 -0
  1057. data/lib/wp/wp-includes/js/jquery/ui/effect-pulsate.min.js +11 -0
  1058. data/lib/wp/wp-includes/js/jquery/ui/effect-scale.min.js +11 -0
  1059. data/lib/wp/wp-includes/js/jquery/ui/effect-shake.min.js +11 -0
  1060. data/lib/wp/wp-includes/js/jquery/ui/effect-size.min.js +11 -0
  1061. data/lib/wp/wp-includes/js/jquery/ui/effect-slide.min.js +11 -0
  1062. data/lib/wp/wp-includes/js/jquery/ui/effect-transfer.min.js +11 -0
  1063. data/lib/wp/wp-includes/js/jquery/ui/effect.min.js +21 -0
  1064. data/lib/wp/wp-includes/js/jquery/ui/menu.min.js +11 -0
  1065. data/lib/wp/wp-includes/js/jquery/ui/mouse.min.js +11 -0
  1066. data/lib/wp/wp-includes/js/jquery/ui/position.min.js +11 -0
  1067. data/lib/wp/wp-includes/js/jquery/ui/progressbar.min.js +11 -0
  1068. data/lib/wp/wp-includes/js/jquery/ui/resizable.min.js +11 -0
  1069. data/lib/wp/wp-includes/js/jquery/ui/selectable.min.js +11 -0
  1070. data/lib/wp/wp-includes/js/jquery/ui/selectmenu.min.js +11 -0
  1071. data/lib/wp/wp-includes/js/jquery/ui/slider.min.js +11 -0
  1072. data/lib/wp/wp-includes/js/jquery/ui/sortable.min.js +11 -0
  1073. data/lib/wp/wp-includes/js/jquery/ui/spinner.min.js +11 -0
  1074. data/lib/wp/wp-includes/js/jquery/ui/tabs.min.js +11 -0
  1075. data/lib/wp/wp-includes/js/jquery/ui/tooltip.min.js +11 -0
  1076. data/lib/wp/wp-includes/js/jquery/ui/widget.min.js +11 -0
  1077. data/lib/wp/wp-includes/js/json2.js +480 -0
  1078. data/lib/wp/wp-includes/js/json2.min.js +1 -0
  1079. data/lib/wp/wp-includes/js/masonry.min.js +1 -0
  1080. data/lib/wp/wp-includes/js/mce-view.js +829 -0
  1081. data/lib/wp/wp-includes/js/mce-view.min.js +1 -0
  1082. data/lib/wp/wp-includes/js/media-audiovideo.js +831 -0
  1083. data/lib/wp/wp-includes/js/media-audiovideo.min.js +1 -0
  1084. data/lib/wp/wp-includes/js/media-editor.js +1114 -0
  1085. data/lib/wp/wp-includes/js/media-editor.min.js +1 -0
  1086. data/lib/wp/wp-includes/js/media-grid.js +732 -0
  1087. data/lib/wp/wp-includes/js/media-grid.min.js +1 -0
  1088. data/lib/wp/wp-includes/js/media-models.js +1362 -0
  1089. data/lib/wp/wp-includes/js/media-models.min.js +1 -0
  1090. data/lib/wp/wp-includes/js/media-views.js +7484 -0
  1091. data/lib/wp/wp-includes/js/media-views.min.js +3 -0
  1092. data/lib/wp/wp-includes/js/mediaelement/background.png +0 -0
  1093. data/lib/wp/wp-includes/js/mediaelement/bigplay.png +0 -0
  1094. data/lib/wp/wp-includes/js/mediaelement/bigplay.svg +1 -0
  1095. data/lib/wp/wp-includes/js/mediaelement/controls.png +0 -0
  1096. data/lib/wp/wp-includes/js/mediaelement/controls.svg +1 -0
  1097. data/lib/wp/wp-includes/js/mediaelement/flashmediaelement.swf +0 -0
  1098. data/lib/wp/wp-includes/js/mediaelement/loading.gif +0 -0
  1099. data/lib/wp/wp-includes/js/mediaelement/mediaelement-and-player.min.js +181 -0
  1100. data/lib/wp/wp-includes/js/mediaelement/mediaelementplayer.min.css +1 -0
  1101. data/lib/wp/wp-includes/js/mediaelement/silverlightmediaelement.xap +0 -0
  1102. data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.css +274 -0
  1103. data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.js +34 -0
  1104. data/lib/wp/wp-includes/js/mediaelement/wp-playlist.js +175 -0
  1105. data/lib/wp/wp-includes/js/plupload/handlers.js +488 -0
  1106. data/lib/wp/wp-includes/js/plupload/handlers.min.js +1 -0
  1107. data/lib/wp/wp-includes/js/plupload/license.txt +339 -0
  1108. data/lib/wp/wp-includes/js/plupload/plupload.flash.swf +0 -0
  1109. data/lib/wp/wp-includes/js/plupload/plupload.full.min.js +28 -0
  1110. data/lib/wp/wp-includes/js/plupload/plupload.silverlight.xap +0 -0
  1111. data/lib/wp/wp-includes/js/plupload/wp-plupload.js +376 -0
  1112. data/lib/wp/wp-includes/js/plupload/wp-plupload.min.js +1 -0
  1113. data/lib/wp/wp-includes/js/quicktags.js +652 -0
  1114. data/lib/wp/wp-includes/js/quicktags.min.js +1 -0
  1115. data/lib/wp/wp-includes/js/shortcode.js +356 -0
  1116. data/lib/wp/wp-includes/js/shortcode.min.js +1 -0
  1117. data/lib/wp/wp-includes/js/swfobject.js +4 -0
  1118. data/lib/wp/wp-includes/js/swfupload/handlers.js +376 -0
  1119. data/lib/wp/wp-includes/js/swfupload/handlers.min.js +1 -0
  1120. data/lib/wp/wp-includes/js/swfupload/license.txt +32 -0
  1121. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js +53 -0
  1122. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.queue.js +98 -0
  1123. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.speed.js +342 -0
  1124. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.swfobject.js +105 -0
  1125. data/lib/wp/wp-includes/js/swfupload/swfupload.js +980 -0
  1126. data/lib/wp/wp-includes/js/swfupload/swfupload.swf +0 -0
  1127. data/lib/wp/wp-includes/js/thickbox/loadingAnimation.gif +0 -0
  1128. data/lib/wp/wp-includes/js/thickbox/macFFBgHack.png +0 -0
  1129. data/lib/wp/wp-includes/js/thickbox/thickbox.css +138 -0
  1130. data/lib/wp/wp-includes/js/thickbox/thickbox.js +314 -0
  1131. data/lib/wp/wp-includes/js/tinymce/langs/wp-langs-en.js +519 -0
  1132. data/lib/wp/wp-includes/js/tinymce/license.txt +504 -0
  1133. data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.js +370 -0
  1134. data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.min.js +1 -0
  1135. data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.js +112 -0
  1136. data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
  1137. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css +212 -0
  1138. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.js +304 -0
  1139. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
  1140. data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.js +64 -0
  1141. data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.min.js +1 -0
  1142. data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.js +136 -0
  1143. data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
  1144. data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.js +30 -0
  1145. data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.min.js +1 -0
  1146. data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.js +450 -0
  1147. data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.min.js +1 -0
  1148. data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.js +786 -0
  1149. data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.min.js +1 -0
  1150. data/lib/wp/wp-includes/js/tinymce/plugins/media/moxieplayer.swf +0 -0
  1151. data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.js +774 -0
  1152. data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.min.js +1 -0
  1153. data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.js +1553 -0
  1154. data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.min.js +1 -0
  1155. data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.js +125 -0
  1156. data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
  1157. data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.js +272 -0
  1158. data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
  1159. data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.js +513 -0
  1160. data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +1 -0
  1161. data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +207 -0
  1162. data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js +1 -0
  1163. data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js +92 -0
  1164. data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.min.js +1 -0
  1165. data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +1035 -0
  1166. data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +1 -0
  1167. data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js +78 -0
  1168. data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.min.js +1 -0
  1169. data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.js +130 -0
  1170. data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.min.js +1 -0
  1171. data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.js +63 -0
  1172. data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.min.js +1 -0
  1173. data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.js +694 -0
  1174. data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.min.js +1 -0
  1175. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
  1176. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.min.css +1 -0
  1177. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
  1178. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
  1179. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +62 -0
  1180. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  1181. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
  1182. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  1183. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg +63 -0
  1184. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  1185. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  1186. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
  1187. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/loader.gif +0 -0
  1188. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/object.gif +0 -0
  1189. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/trans.gif +0 -0
  1190. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
  1191. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.min.css +1 -0
  1192. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/audio.png +0 -0
  1193. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png +0 -0
  1194. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png +0 -0
  1195. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/embedded.png +0 -0
  1196. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png +0 -0
  1197. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery.png +0 -0
  1198. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more-2x.png +0 -0
  1199. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more.png +0 -0
  1200. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak-2x.png +0 -0
  1201. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak.png +0 -0
  1202. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-audio.png +0 -0
  1203. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-video.png +0 -0
  1204. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/video.png +0 -0
  1205. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/wp-content.css +618 -0
  1206. data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.js +617 -0
  1207. data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.min.js +1 -0
  1208. data/lib/wp/wp-includes/js/tinymce/tiny_mce_popup.js +539 -0
  1209. data/lib/wp/wp-includes/js/tinymce/tinymce.min.js +11 -0
  1210. data/lib/wp/wp-includes/js/tinymce/utils/editable_selects.js +70 -0
  1211. data/lib/wp/wp-includes/js/tinymce/utils/form_utils.js +210 -0
  1212. data/lib/wp/wp-includes/js/tinymce/utils/mctabs.js +164 -0
  1213. data/lib/wp/wp-includes/js/tinymce/utils/validate.js +252 -0
  1214. data/lib/wp/wp-includes/js/tinymce/wp-mce-help.php +145 -0
  1215. data/lib/wp/wp-includes/js/tinymce/wp-tinymce.js.gz +0 -0
  1216. data/lib/wp/wp-includes/js/tinymce/wp-tinymce.php +39 -0
  1217. data/lib/wp/wp-includes/js/tw-sack.js +193 -0
  1218. data/lib/wp/wp-includes/js/tw-sack.min.js +1 -0
  1219. data/lib/wp/wp-includes/js/underscore.min.js +1 -0
  1220. data/lib/wp/wp-includes/js/utils.js +197 -0
  1221. data/lib/wp/wp-includes/js/utils.min.js +1 -0
  1222. data/lib/wp/wp-includes/js/wp-ajax-response.js +64 -0
  1223. data/lib/wp/wp-includes/js/wp-ajax-response.min.js +1 -0
  1224. data/lib/wp/wp-includes/js/wp-auth-check.js +112 -0
  1225. data/lib/wp/wp-includes/js/wp-auth-check.min.js +1 -0
  1226. data/lib/wp/wp-includes/js/wp-backbone.js +386 -0
  1227. data/lib/wp/wp-includes/js/wp-backbone.min.js +1 -0
  1228. data/lib/wp/wp-includes/js/wp-list-revisions.js +24 -0
  1229. data/lib/wp/wp-includes/js/wp-list-revisions.min.js +1 -0
  1230. data/lib/wp/wp-includes/js/wp-lists.js +469 -0
  1231. data/lib/wp/wp-includes/js/wp-lists.min.js +1 -0
  1232. data/lib/wp/wp-includes/js/wp-pointer.js +282 -0
  1233. data/lib/wp/wp-includes/js/wp-pointer.min.js +1 -0
  1234. data/lib/wp/wp-includes/js/wp-util.js +106 -0
  1235. data/lib/wp/wp-includes/js/wp-util.min.js +1 -0
  1236. data/lib/wp/wp-includes/js/wpdialog.js +19 -0
  1237. data/lib/wp/wp-includes/js/wpdialog.min.js +1 -0
  1238. data/lib/wp/wp-includes/js/wplink.js +615 -0
  1239. data/lib/wp/wp-includes/js/wplink.min.js +1 -0
  1240. data/lib/wp/wp-includes/js/zxcvbn-async.js +18 -0
  1241. data/lib/wp/wp-includes/js/zxcvbn-async.min.js +1 -0
  1242. data/lib/wp/wp-includes/js/zxcvbn.min.js +47 -0
  1243. data/lib/wp/wp-includes/kses.php +1526 -0
  1244. data/lib/wp/wp-includes/l10n.php +908 -0
  1245. data/lib/wp/wp-includes/link-template.php +3141 -0
  1246. data/lib/wp/wp-includes/load.php +828 -0
  1247. data/lib/wp/wp-includes/locale.php +368 -0
  1248. data/lib/wp/wp-includes/media-template.php +1235 -0
  1249. data/lib/wp/wp-includes/media.php +3329 -0
  1250. data/lib/wp/wp-includes/meta.php +1221 -0
  1251. data/lib/wp/wp-includes/ms-blogs.php +939 -0
  1252. data/lib/wp/wp-includes/ms-default-constants.php +153 -0
  1253. data/lib/wp/wp-includes/ms-default-filters.php +82 -0
  1254. data/lib/wp/wp-includes/ms-deprecated.php +347 -0
  1255. data/lib/wp/wp-includes/ms-files.php +82 -0
  1256. data/lib/wp/wp-includes/ms-functions.php +2476 -0
  1257. data/lib/wp/wp-includes/ms-load.php +458 -0
  1258. data/lib/wp/wp-includes/ms-settings.php +213 -0
  1259. data/lib/wp/wp-includes/nav-menu-template.php +678 -0
  1260. data/lib/wp/wp-includes/nav-menu.php +895 -0
  1261. data/lib/wp/wp-includes/option.php +1440 -0
  1262. data/lib/wp/wp-includes/pluggable-deprecated.php +192 -0
  1263. data/lib/wp/wp-includes/pluggable.php +2283 -0
  1264. data/lib/wp/wp-includes/plugin.php +920 -0
  1265. data/lib/wp/wp-includes/pomo/entry.php +78 -0
  1266. data/lib/wp/wp-includes/pomo/mo.php +262 -0
  1267. data/lib/wp/wp-includes/pomo/po.php +384 -0
  1268. data/lib/wp/wp-includes/pomo/streams.php +209 -0
  1269. data/lib/wp/wp-includes/pomo/translations.php +275 -0
  1270. data/lib/wp/wp-includes/post-formats.php +243 -0
  1271. data/lib/wp/wp-includes/post-template.php +1766 -0
  1272. data/lib/wp/wp-includes/post-thumbnail-template.php +142 -0
  1273. data/lib/wp/wp-includes/post.php +5842 -0
  1274. data/lib/wp/wp-includes/query.php +4666 -0
  1275. data/lib/wp/wp-includes/registration-functions.php +7 -0
  1276. data/lib/wp/wp-includes/registration.php +7 -0
  1277. data/lib/wp/wp-includes/revision.php +657 -0
  1278. data/lib/wp/wp-includes/rewrite.php +2180 -0
  1279. data/lib/wp/wp-includes/rss-functions.php +9 -0
  1280. data/lib/wp/wp-includes/rss.php +936 -0
  1281. data/lib/wp/wp-includes/script-loader.php +1045 -0
  1282. data/lib/wp/wp-includes/session.php +430 -0
  1283. data/lib/wp/wp-includes/shortcodes.php +410 -0
  1284. data/lib/wp/wp-includes/taxonomy.php +4006 -0
  1285. data/lib/wp/wp-includes/template-loader.php +76 -0
  1286. data/lib/wp/wp-includes/template.php +505 -0
  1287. data/lib/wp/wp-includes/theme-compat/comments-popup.php +128 -0
  1288. data/lib/wp/wp-includes/theme-compat/comments.php +101 -0
  1289. data/lib/wp/wp-includes/theme-compat/footer.php +30 -0
  1290. data/lib/wp/wp-includes/theme-compat/header.php +49 -0
  1291. data/lib/wp/wp-includes/theme-compat/sidebar.php +83 -0
  1292. data/lib/wp/wp-includes/theme.php +2014 -0
  1293. data/lib/wp/wp-includes/update.php +674 -0
  1294. data/lib/wp/wp-includes/user.php +2292 -0
  1295. data/lib/wp/wp-includes/vars.php +144 -0
  1296. data/lib/wp/wp-includes/version.php +35 -0
  1297. data/lib/wp/wp-includes/widgets.php +1514 -0
  1298. data/lib/wp/wp-includes/wlwmanifest.xml +43 -0
  1299. data/lib/wp/wp-includes/wp-db.php +2190 -0
  1300. data/lib/wp/wp-includes/wp-diff.php +523 -0
  1301. data/lib/wp/wp-links-opml.php +80 -0
  1302. data/lib/wp/wp-load.php +73 -0
  1303. data/lib/wp/wp-login.php +952 -0
  1304. data/lib/wp/wp-mail.php +260 -0
  1305. data/lib/wp/wp-settings.php +374 -0
  1306. data/lib/wp/wp-signup.php +749 -0
  1307. data/lib/wp/wp-trackback.php +127 -0
  1308. data/lib/wp/xmlrpc.php +101 -0
  1309. data/stump-cli.gemspec +26 -0
  1310. metadata +1332 -4
@@ -0,0 +1,2606 @@
1
+ <?php
2
+ /**
3
+ * Manages WordPress comments
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Comment
7
+ */
8
+
9
+ /**
10
+ * Check whether a comment passes internal checks to be allowed to add.
11
+ *
12
+ * If manual comment moderation is set in the administration, then all checks,
13
+ * regardless of their type and whitelist, will fail and the function will
14
+ * return false.
15
+ *
16
+ * If the number of links exceeds the amount in the administration, then the
17
+ * check fails. If any of the parameter contents match the blacklist of words,
18
+ * then the check fails.
19
+ *
20
+ * If the comment author was approved before, then the comment is automatically
21
+ * whitelisted.
22
+ *
23
+ * If all checks pass, the function will return true.
24
+ *
25
+ * @since 1.2.0
26
+ *
27
+ * @global wpdb $wpdb WordPress database access abstraction object.
28
+ *
29
+ * @param string $author Comment author name.
30
+ * @param string $email Comment author email.
31
+ * @param string $url Comment author URL.
32
+ * @param string $comment Content of the comment.
33
+ * @param string $user_ip Comment author IP address.
34
+ * @param string $user_agent Comment author User-Agent.
35
+ * @param string $comment_type Comment type, either user-submitted comment,
36
+ * trackback, or pingback.
37
+ * @return bool If all checks pass, true, otherwise false.
38
+ */
39
+ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) {
40
+ global $wpdb;
41
+
42
+ // If manual moderation is enabled, skip all checks and return false.
43
+ if ( 1 == get_option('comment_moderation') )
44
+ return false;
45
+
46
+ /** This filter is documented in wp-includes/comment-template.php */
47
+ $comment = apply_filters( 'comment_text', $comment );
48
+
49
+ // Check for the number of external links if a max allowed number is set.
50
+ if ( $max_links = get_option( 'comment_max_links' ) ) {
51
+ $num_links = preg_match_all( '/<a [^>]*href/i', $comment, $out );
52
+
53
+ /**
54
+ * Filter the maximum number of links allowed in a comment.
55
+ *
56
+ * @since 3.0.0
57
+ *
58
+ * @param int $num_links The number of links allowed.
59
+ * @param string $url Comment author's URL. Included in allowed links total.
60
+ */
61
+ $num_links = apply_filters( 'comment_max_links_url', $num_links, $url );
62
+
63
+ /*
64
+ * If the number of links in the comment exceeds the allowed amount,
65
+ * fail the check by returning false.
66
+ */
67
+ if ( $num_links >= $max_links )
68
+ return false;
69
+ }
70
+
71
+ $mod_keys = trim(get_option('moderation_keys'));
72
+
73
+ // If moderation 'keys' (keywords) are set, process them.
74
+ if ( !empty($mod_keys) ) {
75
+ $words = explode("\n", $mod_keys );
76
+
77
+ foreach ( (array) $words as $word) {
78
+ $word = trim($word);
79
+
80
+ // Skip empty lines.
81
+ if ( empty($word) )
82
+ continue;
83
+
84
+ /*
85
+ * Do some escaping magic so that '#' (number of) characters in the spam
86
+ * words don't break things:
87
+ */
88
+ $word = preg_quote($word, '#');
89
+
90
+ /*
91
+ * Check the comment fields for moderation keywords. If any are found,
92
+ * fail the check for the given field by returning false.
93
+ */
94
+ $pattern = "#$word#i";
95
+ if ( preg_match($pattern, $author) ) return false;
96
+ if ( preg_match($pattern, $email) ) return false;
97
+ if ( preg_match($pattern, $url) ) return false;
98
+ if ( preg_match($pattern, $comment) ) return false;
99
+ if ( preg_match($pattern, $user_ip) ) return false;
100
+ if ( preg_match($pattern, $user_agent) ) return false;
101
+ }
102
+ }
103
+
104
+ /*
105
+ * Check if the option to approve comments by previously-approved authors is enabled.
106
+ *
107
+ * If it is enabled, check whether the comment author has a previously-approved comment,
108
+ * as well as whether there are any moderation keywords (if set) present in the author
109
+ * email address. If both checks pass, return true. Otherwise, return false.
110
+ */
111
+ if ( 1 == get_option('comment_whitelist')) {
112
+ if ( 'trackback' != $comment_type && 'pingback' != $comment_type && $author != '' && $email != '' ) {
113
+ // expected_slashed ($author, $email)
114
+ $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' LIMIT 1");
115
+ if ( ( 1 == $ok_to_comment ) &&
116
+ ( empty($mod_keys) || false === strpos( $email, $mod_keys) ) )
117
+ return true;
118
+ else
119
+ return false;
120
+ } else {
121
+ return false;
122
+ }
123
+ }
124
+ return true;
125
+ }
126
+
127
+ /**
128
+ * Retrieve the approved comments for post $post_id.
129
+ *
130
+ * @since 2.0.0
131
+ * @uses $wpdb
132
+ *
133
+ * @param int $post_id The ID of the post
134
+ * @return array $comments The approved comments
135
+ */
136
+ function get_approved_comments($post_id) {
137
+ global $wpdb;
138
+ return $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post_id));
139
+ }
140
+
141
+ /**
142
+ * Retrieves comment data given a comment ID or comment object.
143
+ *
144
+ * If an object is passed then the comment data will be cached and then returned
145
+ * after being passed through a filter. If the comment is empty, then the global
146
+ * comment variable will be used, if it is set.
147
+ *
148
+ * @since 2.0.0
149
+ * @uses $wpdb
150
+ *
151
+ * @param object|string|int $comment Comment to retrieve.
152
+ * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants.
153
+ * @return object|array|null Depends on $output value.
154
+ */
155
+ function get_comment(&$comment, $output = OBJECT) {
156
+ global $wpdb;
157
+
158
+ if ( empty($comment) ) {
159
+ if ( isset($GLOBALS['comment']) )
160
+ $_comment = & $GLOBALS['comment'];
161
+ else
162
+ $_comment = null;
163
+ } elseif ( is_object($comment) ) {
164
+ wp_cache_add($comment->comment_ID, $comment, 'comment');
165
+ $_comment = $comment;
166
+ } else {
167
+ if ( isset($GLOBALS['comment']) && ($GLOBALS['comment']->comment_ID == $comment) ) {
168
+ $_comment = & $GLOBALS['comment'];
169
+ } elseif ( ! $_comment = wp_cache_get($comment, 'comment') ) {
170
+ $_comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment));
171
+ if ( ! $_comment )
172
+ return null;
173
+ wp_cache_add($_comment->comment_ID, $_comment, 'comment');
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Fires after a comment is retrieved.
179
+ *
180
+ * @since 2.3.0
181
+ *
182
+ * @param mixed $_comment Comment data.
183
+ */
184
+ $_comment = apply_filters( 'get_comment', $_comment );
185
+
186
+ if ( $output == OBJECT ) {
187
+ return $_comment;
188
+ } elseif ( $output == ARRAY_A ) {
189
+ $__comment = get_object_vars($_comment);
190
+ return $__comment;
191
+ } elseif ( $output == ARRAY_N ) {
192
+ $__comment = array_values(get_object_vars($_comment));
193
+ return $__comment;
194
+ } else {
195
+ return $_comment;
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Retrieve a list of comments.
201
+ *
202
+ * The comment list can be for the blog as a whole or for an individual post.
203
+ *
204
+ * The list of comment arguments are 'status', 'orderby', 'comment_date_gmt',
205
+ * 'order', 'number', 'offset', and 'post_id'.
206
+ *
207
+ * @since 2.7.0
208
+ * @uses $wpdb
209
+ *
210
+ * @param mixed $args Optional. Array or string of options to override defaults.
211
+ * @return array List of comments.
212
+ */
213
+ function get_comments( $args = '' ) {
214
+ $query = new WP_Comment_Query;
215
+ return $query->query( $args );
216
+ }
217
+
218
+ /**
219
+ * WordPress Comment Query class.
220
+ *
221
+ * @since 3.1.0
222
+ */
223
+ class WP_Comment_Query {
224
+ /**
225
+ * Metadata query container
226
+ *
227
+ * @since 3.5.0
228
+ * @access public
229
+ * @var object WP_Meta_Query
230
+ */
231
+ public $meta_query = false;
232
+
233
+ /**
234
+ * Date query container
235
+ *
236
+ * @since 3.7.0
237
+ * @access public
238
+ * @var object WP_Date_Query
239
+ */
240
+ public $date_query = false;
241
+
242
+ /**
243
+ * Make private/protected methods readable for backwards compatibility.
244
+ *
245
+ * @since 4.0.0
246
+ * @access public
247
+ *
248
+ * @param callable $name Method to call.
249
+ * @param array $arguments Arguments to pass when calling.
250
+ * @return mixed|bool Return value of the callback, false otherwise.
251
+ */
252
+ public function __call( $name, $arguments ) {
253
+ return call_user_func_array( array( $this, $name ), $arguments );
254
+ }
255
+
256
+ /**
257
+ * Execute the query
258
+ *
259
+ * @since 3.1.0
260
+ * @since 4.1.0 Introduced 'comment__in', 'comment__not_in',
261
+ * 'post__in', and 'post__not_in' to $query_vars.
262
+ *
263
+ * @param string|array $query_vars
264
+ * @return int|array
265
+ */
266
+ public function query( $query_vars ) {
267
+ global $wpdb;
268
+
269
+ $defaults = array(
270
+ 'author_email' => '',
271
+ 'fields' => '',
272
+ 'ID' => '',
273
+ 'comment__in' => '',
274
+ 'comment__not_in' => '',
275
+ 'karma' => '',
276
+ 'number' => '',
277
+ 'offset' => '',
278
+ 'orderby' => '',
279
+ 'order' => 'DESC',
280
+ 'parent' => '',
281
+ 'post_ID' => '',
282
+ 'post_id' => 0,
283
+ 'post__in' => '',
284
+ 'post__not_in' => '',
285
+ 'post_author' => '',
286
+ 'post_name' => '',
287
+ 'post_parent' => '',
288
+ 'post_status' => '',
289
+ 'post_type' => '',
290
+ 'status' => '',
291
+ 'type' => '',
292
+ 'user_id' => '',
293
+ 'search' => '',
294
+ 'count' => false,
295
+ 'meta_key' => '',
296
+ 'meta_value' => '',
297
+ 'meta_query' => '',
298
+ 'date_query' => null, // See WP_Date_Query
299
+ );
300
+
301
+ $groupby = '';
302
+
303
+ $this->query_vars = wp_parse_args( $query_vars, $defaults );
304
+
305
+ // Parse meta query
306
+ $this->meta_query = new WP_Meta_Query();
307
+ $this->meta_query->parse_query_vars( $this->query_vars );
308
+
309
+ /**
310
+ * Fires before comments are retrieved.
311
+ *
312
+ * @since 3.1.0
313
+ *
314
+ * @param WP_Comment_Query &$this Current instance of WP_Comment_Query, passed by reference.
315
+ */
316
+ do_action_ref_array( 'pre_get_comments', array( &$this ) );
317
+
318
+ // $args can be whatever, only use the args defined in defaults to compute the key
319
+ $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $defaults ) ) ) );
320
+ $last_changed = wp_cache_get( 'last_changed', 'comment' );
321
+ if ( ! $last_changed ) {
322
+ $last_changed = microtime();
323
+ wp_cache_set( 'last_changed', $last_changed, 'comment' );
324
+ }
325
+ $cache_key = "get_comments:$key:$last_changed";
326
+
327
+ if ( $cache = wp_cache_get( $cache_key, 'comment' ) ) {
328
+ return $cache;
329
+ }
330
+
331
+ $status = $this->query_vars['status'];
332
+ if ( 'hold' == $status ) {
333
+ $approved = "comment_approved = '0'";
334
+ } elseif ( 'approve' == $status ) {
335
+ $approved = "comment_approved = '1'";
336
+ } elseif ( ! empty( $status ) && 'all' != $status ) {
337
+ $approved = $wpdb->prepare( "comment_approved = %s", $status );
338
+ } else {
339
+ $approved = "( comment_approved = '0' OR comment_approved = '1' )";
340
+ }
341
+ $order = ( 'ASC' == strtoupper( $this->query_vars['order'] ) ) ? 'ASC' : 'DESC';
342
+
343
+ if ( ! empty( $this->query_vars['orderby'] ) ) {
344
+ $ordersby = is_array( $this->query_vars['orderby'] ) ?
345
+ $this->query_vars['orderby'] :
346
+ preg_split( '/[,\s]/', $this->query_vars['orderby'] );
347
+
348
+ $allowed_keys = array(
349
+ 'comment_agent',
350
+ 'comment_approved',
351
+ 'comment_author',
352
+ 'comment_author_email',
353
+ 'comment_author_IP',
354
+ 'comment_author_url',
355
+ 'comment_content',
356
+ 'comment_date',
357
+ 'comment_date_gmt',
358
+ 'comment_ID',
359
+ 'comment_karma',
360
+ 'comment_parent',
361
+ 'comment_post_ID',
362
+ 'comment_type',
363
+ 'user_id',
364
+ );
365
+ if ( ! empty( $this->query_vars['meta_key'] ) ) {
366
+ $allowed_keys[] = $this->query_vars['meta_key'];
367
+ $allowed_keys[] = 'meta_value';
368
+ $allowed_keys[] = 'meta_value_num';
369
+ }
370
+ $ordersby = array_intersect( $ordersby, $allowed_keys );
371
+ foreach ( $ordersby as $key => $value ) {
372
+ if ( $value == $this->query_vars['meta_key'] || $value == 'meta_value' ) {
373
+ $ordersby[ $key ] = "$wpdb->commentmeta.meta_value";
374
+ } elseif ( $value == 'meta_value_num' ) {
375
+ $ordersby[ $key ] = "$wpdb->commentmeta.meta_value+0";
376
+ }
377
+ }
378
+ $orderby = empty( $ordersby ) ? 'comment_date_gmt' : implode(', ', $ordersby);
379
+ } else {
380
+ $orderby = 'comment_date_gmt';
381
+ }
382
+
383
+ $number = absint( $this->query_vars['number'] );
384
+ $offset = absint( $this->query_vars['offset'] );
385
+
386
+ if ( ! empty( $number ) ) {
387
+ if ( $offset ) {
388
+ $limits = 'LIMIT ' . $offset . ',' . $number;
389
+ } else {
390
+ $limits = 'LIMIT ' . $number;
391
+ }
392
+ } else {
393
+ $limits = '';
394
+ }
395
+
396
+ if ( $this->query_vars['count'] ) {
397
+ $fields = 'COUNT(*)';
398
+ } else {
399
+ switch ( strtolower( $this->query_vars['fields'] ) ) {
400
+ case 'ids':
401
+ $fields = "$wpdb->comments.comment_ID";
402
+ break;
403
+ default:
404
+ $fields = "*";
405
+ break;
406
+ }
407
+ }
408
+
409
+ $join = '';
410
+ $where = $approved;
411
+
412
+ $post_id = absint( $this->query_vars['post_id'] );
413
+ if ( ! empty( $post_id ) ) {
414
+ $where .= $wpdb->prepare( ' AND comment_post_ID = %d', $post_id );
415
+ }
416
+
417
+ // Parse comment IDs for an IN clause.
418
+ if ( ! empty( $this->query_vars['comment__in'] ) ) {
419
+ $where .= ' AND comment_ID IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['comment__in'] ) ) . ' )';
420
+ }
421
+
422
+ // Parse comment IDs for a NOT IN clause.
423
+ if ( ! empty( $this->query_vars['comment__not_in'] ) ) {
424
+ $where .= ' AND comment_ID NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['comment__not_in'] ) ) . ' )';
425
+ }
426
+
427
+ // Parse comment post IDs for an IN clause.
428
+ if ( ! empty( $this->query_vars['post__in'] ) ) {
429
+ $where .= ' AND comment_post_ID IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post__in'] ) ) . ' )';
430
+ }
431
+
432
+ // Parse comment post IDs for a NOT IN clause.
433
+ if ( ! empty( $this->query_vars['post__not_in'] ) ) {
434
+ $where .= ' AND comment_post_ID NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post__not_in'] ) ) . ' )';
435
+ }
436
+
437
+ if ( '' !== $this->query_vars['author_email'] ) {
438
+ $where .= $wpdb->prepare( ' AND comment_author_email = %s', $this->query_vars['author_email'] );
439
+ }
440
+
441
+ if ( '' !== $this->query_vars['karma'] ) {
442
+ $where .= $wpdb->prepare( ' AND comment_karma = %d', $this->query_vars['karma'] );
443
+ }
444
+
445
+ if ( 'comment' == $this->query_vars['type'] ) {
446
+ $where .= " AND comment_type = ''";
447
+ } elseif( 'pings' == $this->query_vars['type'] ) {
448
+ $where .= ' AND comment_type IN ("pingback", "trackback")';
449
+ } elseif ( ! empty( $this->query_vars['type'] ) ) {
450
+ $where .= $wpdb->prepare( ' AND comment_type = %s', $this->query_vars['type'] );
451
+ }
452
+
453
+ if ( '' !== $this->query_vars['parent'] ) {
454
+ $where .= $wpdb->prepare( ' AND comment_parent = %d', $this->query_vars['parent'] );
455
+ }
456
+
457
+ if ( is_array( $this->query_vars['user_id'] ) ) {
458
+ $where .= ' AND user_id IN (' . implode( ',', array_map( 'absint', $this->query_vars['user_id'] ) ) . ')';
459
+ } elseif ( '' !== $this->query_vars['user_id'] ) {
460
+ $where .= $wpdb->prepare( ' AND user_id = %d', $this->query_vars['user_id'] );
461
+ }
462
+
463
+ if ( '' !== $this->query_vars['search'] ) {
464
+ $where .= $this->get_search_sql(
465
+ $this->query_vars['search'],
466
+ array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' )
467
+ );
468
+ }
469
+
470
+ $plucked = wp_array_slice_assoc( $this->query_vars, array( 'post_author', 'post_name', 'post_parent', 'post_status', 'post_type' ) );
471
+ $post_fields = array_filter( $plucked );
472
+
473
+ if ( ! empty( $post_fields ) ) {
474
+ $join = "JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID";
475
+ foreach( $post_fields as $field_name => $field_value )
476
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.{$field_name} = %s", $field_value );
477
+ }
478
+
479
+ if ( ! empty( $this->meta_query->queries ) ) {
480
+ $clauses = $this->meta_query->get_sql( 'comment', $wpdb->comments, 'comment_ID', $this );
481
+ $join .= $clauses['join'];
482
+ $where .= $clauses['where'];
483
+ $groupby = "{$wpdb->comments}.comment_ID";
484
+ }
485
+
486
+ $date_query = $this->query_vars['date_query'];
487
+ if ( ! empty( $date_query ) && is_array( $date_query ) ) {
488
+ $date_query_object = new WP_Date_Query( $date_query, 'comment_date' );
489
+ $where .= $date_query_object->get_sql();
490
+ }
491
+
492
+ $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits', 'groupby' );
493
+ /**
494
+ * Filter the comment query clauses.
495
+ *
496
+ * @since 3.1.0
497
+ *
498
+ * @param array $pieces A compacted array of comment query clauses.
499
+ * @param WP_Comment_Query &$this Current instance of WP_Comment_Query, passed by reference.
500
+ */
501
+ $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
502
+
503
+ $fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
504
+ $join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
505
+ $where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
506
+ $orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
507
+ $order = isset( $clauses[ 'order' ] ) ? $clauses[ 'order' ] : '';
508
+ $limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
509
+ $groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
510
+
511
+ if ( $groupby ) {
512
+ $groupby = 'GROUP BY ' . $groupby;
513
+ }
514
+ $query = "SELECT $fields FROM $wpdb->comments $join WHERE $where $groupby ORDER BY $orderby $order $limits";
515
+
516
+ if ( $this->query_vars['count'] ) {
517
+ return $wpdb->get_var( $query );
518
+ }
519
+
520
+ if ( 'ids' == $this->query_vars['fields'] ) {
521
+ $this->comments = $wpdb->get_col( $query );
522
+ return array_map( 'intval', $this->comments );
523
+ }
524
+
525
+ $results = $wpdb->get_results( $query );
526
+ /**
527
+ * Filter the comment query results.
528
+ *
529
+ * @since 3.1.0
530
+ *
531
+ * @param array $results An array of comments.
532
+ * @param WP_Comment_Query &$this Current instance of WP_Comment_Query, passed by reference.
533
+ */
534
+ $comments = apply_filters_ref_array( 'the_comments', array( $results, &$this ) );
535
+
536
+ wp_cache_add( $cache_key, $comments, 'comment' );
537
+
538
+ return $comments;
539
+ }
540
+
541
+ /**
542
+ * Used internally to generate an SQL string for searching across multiple columns
543
+ *
544
+ * @access protected
545
+ * @since 3.1.0
546
+ *
547
+ * @param string $string
548
+ * @param array $cols
549
+ * @return string
550
+ */
551
+ protected function get_search_sql( $string, $cols ) {
552
+ global $wpdb;
553
+
554
+ $like = '%' . $wpdb->esc_like( $string ) . '%';
555
+
556
+ $searches = array();
557
+ foreach ( $cols as $col ) {
558
+ $searches[] = $wpdb->prepare( "$col LIKE %s", $like );
559
+ }
560
+
561
+ return ' AND (' . implode(' OR ', $searches) . ')';
562
+ }
563
+ }
564
+
565
+ /**
566
+ * Retrieve all of the WordPress supported comment statuses.
567
+ *
568
+ * Comments have a limited set of valid status values, this provides the comment
569
+ * status values and descriptions.
570
+ *
571
+ * @since 2.7.0
572
+ *
573
+ * @return array List of comment statuses.
574
+ */
575
+ function get_comment_statuses() {
576
+ $status = array(
577
+ 'hold' => __('Unapproved'),
578
+ /* translators: comment status */
579
+ 'approve' => _x('Approved', 'adjective'),
580
+ /* translators: comment status */
581
+ 'spam' => _x('Spam', 'adjective'),
582
+ );
583
+
584
+ return $status;
585
+ }
586
+
587
+ /**
588
+ * The date the last comment was modified.
589
+ *
590
+ * @since 1.5.0
591
+ * @uses $wpdb
592
+ *
593
+ * @param string $timezone Which timezone to use in reference to 'gmt', 'blog',
594
+ * or 'server' locations.
595
+ * @return string Last comment modified date.
596
+ */
597
+ function get_lastcommentmodified($timezone = 'server') {
598
+ global $wpdb;
599
+ static $cache_lastcommentmodified = array();
600
+
601
+ if ( isset($cache_lastcommentmodified[$timezone]) )
602
+ return $cache_lastcommentmodified[$timezone];
603
+
604
+ $add_seconds_server = date('Z');
605
+
606
+ switch ( strtolower($timezone)) {
607
+ case 'gmt':
608
+ $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1");
609
+ break;
610
+ case 'blog':
611
+ $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1");
612
+ break;
613
+ case 'server':
614
+ $lastcommentmodified = $wpdb->get_var($wpdb->prepare("SELECT DATE_ADD(comment_date_gmt, INTERVAL %s SECOND) FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1", $add_seconds_server));
615
+ break;
616
+ }
617
+
618
+ $cache_lastcommentmodified[$timezone] = $lastcommentmodified;
619
+
620
+ return $lastcommentmodified;
621
+ }
622
+
623
+ /**
624
+ * The amount of comments in a post or total comments.
625
+ *
626
+ * A lot like {@link wp_count_comments()}, in that they both return comment
627
+ * stats (albeit with different types). The {@link wp_count_comments()} actual
628
+ * caches, but this function does not.
629
+ *
630
+ * @since 2.0.0
631
+ * @uses $wpdb
632
+ *
633
+ * @param int $post_id Optional. Comment amount in post if > 0, else total comments blog wide.
634
+ * @return array The amount of spam, approved, awaiting moderation, and total comments.
635
+ */
636
+ function get_comment_count( $post_id = 0 ) {
637
+ global $wpdb;
638
+
639
+ $post_id = (int) $post_id;
640
+
641
+ $where = '';
642
+ if ( $post_id > 0 ) {
643
+ $where = $wpdb->prepare("WHERE comment_post_ID = %d", $post_id);
644
+ }
645
+
646
+ $totals = (array) $wpdb->get_results("
647
+ SELECT comment_approved, COUNT( * ) AS total
648
+ FROM {$wpdb->comments}
649
+ {$where}
650
+ GROUP BY comment_approved
651
+ ", ARRAY_A);
652
+
653
+ $comment_count = array(
654
+ "approved" => 0,
655
+ "awaiting_moderation" => 0,
656
+ "spam" => 0,
657
+ "total_comments" => 0
658
+ );
659
+
660
+ foreach ( $totals as $row ) {
661
+ switch ( $row['comment_approved'] ) {
662
+ case 'spam':
663
+ $comment_count['spam'] = $row['total'];
664
+ $comment_count["total_comments"] += $row['total'];
665
+ break;
666
+ case 1:
667
+ $comment_count['approved'] = $row['total'];
668
+ $comment_count['total_comments'] += $row['total'];
669
+ break;
670
+ case 0:
671
+ $comment_count['awaiting_moderation'] = $row['total'];
672
+ $comment_count['total_comments'] += $row['total'];
673
+ break;
674
+ default:
675
+ break;
676
+ }
677
+ }
678
+
679
+ return $comment_count;
680
+ }
681
+
682
+ //
683
+ // Comment meta functions
684
+ //
685
+
686
+ /**
687
+ * Add meta data field to a comment.
688
+ *
689
+ * @since 2.9.0
690
+ * @uses add_metadata
691
+ * @link http://codex.wordpress.org/Function_Reference/add_comment_meta
692
+ *
693
+ * @param int $comment_id Comment ID.
694
+ * @param string $meta_key Metadata name.
695
+ * @param mixed $meta_value Metadata value.
696
+ * @param bool $unique Optional, default is false. Whether the same key should not be added.
697
+ * @return int|bool Meta ID on success, false on failure.
698
+ */
699
+ function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) {
700
+ return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique);
701
+ }
702
+
703
+ /**
704
+ * Remove metadata matching criteria from a comment.
705
+ *
706
+ * You can match based on the key, or key and value. Removing based on key and
707
+ * value, will keep from removing duplicate metadata with the same key. It also
708
+ * allows removing all metadata matching key, if needed.
709
+ *
710
+ * @since 2.9.0
711
+ * @uses delete_metadata
712
+ * @link http://codex.wordpress.org/Function_Reference/delete_comment_meta
713
+ *
714
+ * @param int $comment_id comment ID
715
+ * @param string $meta_key Metadata name.
716
+ * @param mixed $meta_value Optional. Metadata value.
717
+ * @return bool True on success, false on failure.
718
+ */
719
+ function delete_comment_meta($comment_id, $meta_key, $meta_value = '') {
720
+ return delete_metadata('comment', $comment_id, $meta_key, $meta_value);
721
+ }
722
+
723
+ /**
724
+ * Retrieve comment meta field for a comment.
725
+ *
726
+ * @since 2.9.0
727
+ * @uses get_metadata
728
+ * @link http://codex.wordpress.org/Function_Reference/get_comment_meta
729
+ *
730
+ * @param int $comment_id Comment ID.
731
+ * @param string $key Optional. The meta key to retrieve. By default, returns data for all keys.
732
+ * @param bool $single Whether to return a single value.
733
+ * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
734
+ * is true.
735
+ */
736
+ function get_comment_meta($comment_id, $key = '', $single = false) {
737
+ return get_metadata('comment', $comment_id, $key, $single);
738
+ }
739
+
740
+ /**
741
+ * Update comment meta field based on comment ID.
742
+ *
743
+ * Use the $prev_value parameter to differentiate between meta fields with the
744
+ * same key and comment ID.
745
+ *
746
+ * If the meta field for the comment does not exist, it will be added.
747
+ *
748
+ * @since 2.9.0
749
+ * @uses update_metadata
750
+ * @link http://codex.wordpress.org/Function_Reference/update_comment_meta
751
+ *
752
+ * @param int $comment_id Comment ID.
753
+ * @param string $meta_key Metadata key.
754
+ * @param mixed $meta_value Metadata value.
755
+ * @param mixed $prev_value Optional. Previous value to check before removing.
756
+ * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
757
+ */
758
+ function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '') {
759
+ return update_metadata('comment', $comment_id, $meta_key, $meta_value, $prev_value);
760
+ }
761
+
762
+ /**
763
+ * Sets the cookies used to store an unauthenticated commentator's identity. Typically used
764
+ * to recall previous comments by this commentator that are still held in moderation.
765
+ *
766
+ * @param object $comment Comment object.
767
+ * @param object $user Comment author's object.
768
+ *
769
+ * @since 3.4.0
770
+ */
771
+ function wp_set_comment_cookies($comment, $user) {
772
+ if ( $user->exists() )
773
+ return;
774
+
775
+ /**
776
+ * Filter the lifetime of the comment cookie in seconds.
777
+ *
778
+ * @since 2.8.0
779
+ *
780
+ * @param int $seconds Comment cookie lifetime. Default 30000000.
781
+ */
782
+ $comment_cookie_lifetime = apply_filters( 'comment_cookie_lifetime', 30000000 );
783
+ $secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );
784
+ setcookie( 'comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
785
+ setcookie( 'comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
786
+ setcookie( 'comment_author_url_' . COOKIEHASH, esc_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
787
+ }
788
+
789
+ /**
790
+ * Sanitizes the cookies sent to the user already.
791
+ *
792
+ * Will only do anything if the cookies have already been created for the user.
793
+ * Mostly used after cookies had been sent to use elsewhere.
794
+ *
795
+ * @since 2.0.4
796
+ */
797
+ function sanitize_comment_cookies() {
798
+ if ( isset( $_COOKIE['comment_author_' . COOKIEHASH] ) ) {
799
+ /**
800
+ * Filter the comment author's name cookie before it is set.
801
+ *
802
+ * When this filter hook is evaluated in wp_filter_comment(),
803
+ * the comment author's name string is passed.
804
+ *
805
+ * @since 1.5.0
806
+ *
807
+ * @param string $author_cookie The comment author name cookie.
808
+ */
809
+ $comment_author = apply_filters( 'pre_comment_author_name', $_COOKIE['comment_author_' . COOKIEHASH] );
810
+ $comment_author = wp_unslash($comment_author);
811
+ $comment_author = esc_attr($comment_author);
812
+ $_COOKIE['comment_author_' . COOKIEHASH] = $comment_author;
813
+ }
814
+
815
+ if ( isset( $_COOKIE['comment_author_email_' . COOKIEHASH] ) ) {
816
+ /**
817
+ * Filter the comment author's email cookie before it is set.
818
+ *
819
+ * When this filter hook is evaluated in wp_filter_comment(),
820
+ * the comment author's email string is passed.
821
+ *
822
+ * @since 1.5.0
823
+ *
824
+ * @param string $author_email_cookie The comment author email cookie.
825
+ */
826
+ $comment_author_email = apply_filters( 'pre_comment_author_email', $_COOKIE['comment_author_email_' . COOKIEHASH] );
827
+ $comment_author_email = wp_unslash($comment_author_email);
828
+ $comment_author_email = esc_attr($comment_author_email);
829
+ $_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email;
830
+ }
831
+
832
+ if ( isset( $_COOKIE['comment_author_url_' . COOKIEHASH] ) ) {
833
+ /**
834
+ * Filter the comment author's URL cookie before it is set.
835
+ *
836
+ * When this filter hook is evaluated in wp_filter_comment(),
837
+ * the comment author's URL string is passed.
838
+ *
839
+ * @since 1.5.0
840
+ *
841
+ * @param string $author_url_cookie The comment author URL cookie.
842
+ */
843
+ $comment_author_url = apply_filters( 'pre_comment_author_url', $_COOKIE['comment_author_url_' . COOKIEHASH] );
844
+ $comment_author_url = wp_unslash($comment_author_url);
845
+ $_COOKIE['comment_author_url_'.COOKIEHASH] = $comment_author_url;
846
+ }
847
+ }
848
+
849
+ /**
850
+ * Validates whether this comment is allowed to be made.
851
+ *
852
+ * @since 2.0.0
853
+ * @uses $wpdb
854
+ *
855
+ * @param array $commentdata Contains information on the comment
856
+ * @return mixed Signifies the approval status (0|1|'spam')
857
+ */
858
+ function wp_allow_comment( $commentdata ) {
859
+ global $wpdb;
860
+
861
+ // Simple duplicate check
862
+ // expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content)
863
+ $dupe = $wpdb->prepare(
864
+ "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = %s AND comment_approved != 'trash' AND ( comment_author = %s ",
865
+ wp_unslash( $commentdata['comment_post_ID'] ),
866
+ wp_unslash( $commentdata['comment_parent'] ),
867
+ wp_unslash( $commentdata['comment_author'] )
868
+ );
869
+ if ( $commentdata['comment_author_email'] ) {
870
+ $dupe .= $wpdb->prepare(
871
+ "OR comment_author_email = %s ",
872
+ wp_unslash( $commentdata['comment_author_email'] )
873
+ );
874
+ }
875
+ $dupe .= $wpdb->prepare(
876
+ ") AND comment_content = %s LIMIT 1",
877
+ wp_unslash( $commentdata['comment_content'] )
878
+ );
879
+ if ( $wpdb->get_var( $dupe ) ) {
880
+ /**
881
+ * Fires immediately after a duplicate comment is detected.
882
+ *
883
+ * @since 3.0.0
884
+ *
885
+ * @param array $commentdata Comment data.
886
+ */
887
+ do_action( 'comment_duplicate_trigger', $commentdata );
888
+ if ( defined( 'DOING_AJAX' ) ) {
889
+ die( __('Duplicate comment detected; it looks as though you&#8217;ve already said that!') );
890
+ }
891
+ wp_die( __('Duplicate comment detected; it looks as though you&#8217;ve already said that!') );
892
+ }
893
+
894
+ /**
895
+ * Fires immediately before a comment is marked approved.
896
+ *
897
+ * Allows checking for comment flooding.
898
+ *
899
+ * @since 2.3.0
900
+ *
901
+ * @param string $comment_author_IP Comment author's IP address.
902
+ * @param string $comment_author_email Comment author's email.
903
+ * @param string $comment_date_gmt GMT date the comment was posted.
904
+ */
905
+ do_action(
906
+ 'check_comment_flood',
907
+ $commentdata['comment_author_IP'],
908
+ $commentdata['comment_author_email'],
909
+ $commentdata['comment_date_gmt']
910
+ );
911
+
912
+ if ( ! empty( $commentdata['user_id'] ) ) {
913
+ $user = get_userdata( $commentdata['user_id'] );
914
+ $post_author = $wpdb->get_var( $wpdb->prepare(
915
+ "SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1",
916
+ $commentdata['comment_post_ID']
917
+ ) );
918
+ }
919
+
920
+ if ( isset( $user ) && ( $commentdata['user_id'] == $post_author || $user->has_cap( 'moderate_comments' ) ) ) {
921
+ // The author and the admins get respect.
922
+ $approved = 1;
923
+ } else {
924
+ // Everyone else's comments will be checked.
925
+ if ( check_comment(
926
+ $commentdata['comment_author'],
927
+ $commentdata['comment_author_email'],
928
+ $commentdata['comment_author_url'],
929
+ $commentdata['comment_content'],
930
+ $commentdata['comment_author_IP'],
931
+ $commentdata['comment_agent'],
932
+ $commentdata['comment_type']
933
+ ) ) {
934
+ $approved = 1;
935
+ } else {
936
+ $approved = 0;
937
+ }
938
+
939
+ if ( wp_blacklist_check(
940
+ $commentdata['comment_author'],
941
+ $commentdata['comment_author_email'],
942
+ $commentdata['comment_author_url'],
943
+ $commentdata['comment_content'],
944
+ $commentdata['comment_author_IP'],
945
+ $commentdata['comment_agent']
946
+ ) ) {
947
+ $approved = 'spam';
948
+ }
949
+ }
950
+
951
+ /**
952
+ * Filter a comment's approval status before it is set.
953
+ *
954
+ * @since 2.1.0
955
+ *
956
+ * @param bool|string $approved The approval status. Accepts 1, 0, or 'spam'.
957
+ * @param array $commentdata Comment data.
958
+ */
959
+ $approved = apply_filters( 'pre_comment_approved', $approved, $commentdata );
960
+ return $approved;
961
+ }
962
+
963
+ /**
964
+ * Check whether comment flooding is occurring.
965
+ *
966
+ * Won't run, if current user can manage options, so to not block
967
+ * administrators.
968
+ *
969
+ * @since 2.3.0
970
+ * @uses $wpdb
971
+ *
972
+ * @param string $ip Comment IP.
973
+ * @param string $email Comment author email address.
974
+ * @param string $date MySQL time string.
975
+ */
976
+ function check_comment_flood_db( $ip, $email, $date ) {
977
+ global $wpdb;
978
+ if ( current_user_can( 'manage_options' ) )
979
+ return; // don't throttle admins
980
+ $hour_ago = gmdate( 'Y-m-d H:i:s', time() - HOUR_IN_SECONDS );
981
+ if ( $lasttime = $wpdb->get_var( $wpdb->prepare( "SELECT `comment_date_gmt` FROM `$wpdb->comments` WHERE `comment_date_gmt` >= %s AND ( `comment_author_IP` = %s OR `comment_author_email` = %s ) ORDER BY `comment_date_gmt` DESC LIMIT 1", $hour_ago, $ip, $email ) ) ) {
982
+ $time_lastcomment = mysql2date('U', $lasttime, false);
983
+ $time_newcomment = mysql2date('U', $date, false);
984
+ /**
985
+ * Filter the comment flood status.
986
+ *
987
+ * @since 2.1.0
988
+ *
989
+ * @param bool $bool Whether a comment flood is occurring. Default false.
990
+ * @param int $time_lastcomment Timestamp of when the last comment was posted.
991
+ * @param int $time_newcomment Timestamp of when the new comment was posted.
992
+ */
993
+ $flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment );
994
+ if ( $flood_die ) {
995
+ /**
996
+ * Fires before the comment flood message is triggered.
997
+ *
998
+ * @since 1.5.0
999
+ *
1000
+ * @param int $time_lastcomment Timestamp of when the last comment was posted.
1001
+ * @param int $time_newcomment Timestamp of when the new comment was posted.
1002
+ */
1003
+ do_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment );
1004
+
1005
+ if ( defined('DOING_AJAX') )
1006
+ die( __('You are posting comments too quickly. Slow down.') );
1007
+
1008
+ wp_die( __('You are posting comments too quickly. Slow down.'), '', array('response' => 403) );
1009
+ }
1010
+ }
1011
+ }
1012
+
1013
+ /**
1014
+ * Separates an array of comments into an array keyed by comment_type.
1015
+ *
1016
+ * @since 2.7.0
1017
+ *
1018
+ * @param array $comments Array of comments
1019
+ * @return array Array of comments keyed by comment_type.
1020
+ */
1021
+ function separate_comments(&$comments) {
1022
+ $comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array());
1023
+ $count = count($comments);
1024
+ for ( $i = 0; $i < $count; $i++ ) {
1025
+ $type = $comments[$i]->comment_type;
1026
+ if ( empty($type) )
1027
+ $type = 'comment';
1028
+ $comments_by_type[$type][] = &$comments[$i];
1029
+ if ( 'trackback' == $type || 'pingback' == $type )
1030
+ $comments_by_type['pings'][] = &$comments[$i];
1031
+ }
1032
+
1033
+ return $comments_by_type;
1034
+ }
1035
+
1036
+ /**
1037
+ * Calculate the total number of comment pages.
1038
+ *
1039
+ * @since 2.7.0
1040
+ *
1041
+ * @uses Walker_Comment
1042
+ *
1043
+ * @param array $comments Optional array of comment objects. Defaults to $wp_query->comments
1044
+ * @param int $per_page Optional comments per page.
1045
+ * @param boolean $threaded Optional control over flat or threaded comments.
1046
+ * @return int Number of comment pages.
1047
+ */
1048
+ function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {
1049
+ global $wp_query;
1050
+
1051
+ if ( null === $comments && null === $per_page && null === $threaded && !empty($wp_query->max_num_comment_pages) )
1052
+ return $wp_query->max_num_comment_pages;
1053
+
1054
+ if ( ( ! $comments || ! is_array( $comments ) ) && ! empty( $wp_query->comments ) )
1055
+ $comments = $wp_query->comments;
1056
+
1057
+ if ( empty($comments) )
1058
+ return 0;
1059
+
1060
+ if ( ! get_option( 'page_comments' ) )
1061
+ return 1;
1062
+
1063
+ if ( !isset($per_page) )
1064
+ $per_page = (int) get_query_var('comments_per_page');
1065
+ if ( 0 === $per_page )
1066
+ $per_page = (int) get_option('comments_per_page');
1067
+ if ( 0 === $per_page )
1068
+ return 1;
1069
+
1070
+ if ( !isset($threaded) )
1071
+ $threaded = get_option('thread_comments');
1072
+
1073
+ if ( $threaded ) {
1074
+ $walker = new Walker_Comment;
1075
+ $count = ceil( $walker->get_number_of_root_elements( $comments ) / $per_page );
1076
+ } else {
1077
+ $count = ceil( count( $comments ) / $per_page );
1078
+ }
1079
+
1080
+ return $count;
1081
+ }
1082
+
1083
+ /**
1084
+ * Calculate what page number a comment will appear on for comment paging.
1085
+ *
1086
+ * @since 2.7.0
1087
+ * @uses get_comment() Gets the full comment of the $comment_ID parameter.
1088
+ * @uses get_option() Get various settings to control function and defaults.
1089
+ * @uses get_page_of_comment() Used to loop up to top level comment.
1090
+ *
1091
+ * @param int $comment_ID Comment ID.
1092
+ * @param array $args Optional args.
1093
+ * @return int|null Comment page number or null on error.
1094
+ */
1095
+ function get_page_of_comment( $comment_ID, $args = array() ) {
1096
+ global $wpdb;
1097
+
1098
+ if ( !$comment = get_comment( $comment_ID ) )
1099
+ return;
1100
+
1101
+ $defaults = array( 'type' => 'all', 'page' => '', 'per_page' => '', 'max_depth' => '' );
1102
+ $args = wp_parse_args( $args, $defaults );
1103
+
1104
+ if ( '' === $args['per_page'] && get_option('page_comments') )
1105
+ $args['per_page'] = get_query_var('comments_per_page');
1106
+ if ( empty($args['per_page']) ) {
1107
+ $args['per_page'] = 0;
1108
+ $args['page'] = 0;
1109
+ }
1110
+ if ( $args['per_page'] < 1 )
1111
+ return 1;
1112
+
1113
+ if ( '' === $args['max_depth'] ) {
1114
+ if ( get_option('thread_comments') )
1115
+ $args['max_depth'] = get_option('thread_comments_depth');
1116
+ else
1117
+ $args['max_depth'] = -1;
1118
+ }
1119
+
1120
+ // Find this comment's top level parent if threading is enabled
1121
+ if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent )
1122
+ return get_page_of_comment( $comment->comment_parent, $args );
1123
+
1124
+ $allowedtypes = array(
1125
+ 'comment' => '',
1126
+ 'pingback' => 'pingback',
1127
+ 'trackback' => 'trackback',
1128
+ );
1129
+
1130
+ $comtypewhere = ( 'all' != $args['type'] && isset($allowedtypes[$args['type']]) ) ? " AND comment_type = '" . $allowedtypes[$args['type']] . "'" : '';
1131
+
1132
+ // Count comments older than this one
1133
+ $oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_approved = '1' AND comment_date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) );
1134
+
1135
+ // No older comments? Then it's page #1.
1136
+ if ( 0 == $oldercoms )
1137
+ return 1;
1138
+
1139
+ // Divide comments older than this one by comments per page to get this comment's page number
1140
+ return ceil( ( $oldercoms + 1 ) / $args['per_page'] );
1141
+ }
1142
+
1143
+ /**
1144
+ * Does comment contain blacklisted characters or words.
1145
+ *
1146
+ * @since 1.5.0
1147
+ *
1148
+ * @param string $author The author of the comment
1149
+ * @param string $email The email of the comment
1150
+ * @param string $url The url used in the comment
1151
+ * @param string $comment The comment content
1152
+ * @param string $user_ip The comment author IP address
1153
+ * @param string $user_agent The author's browser user agent
1154
+ * @return bool True if comment contains blacklisted content, false if comment does not
1155
+ */
1156
+ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) {
1157
+ /**
1158
+ * Fires before the comment is tested for blacklisted characters or words.
1159
+ *
1160
+ * @since 1.5.0
1161
+ *
1162
+ * @param string $author Comment author.
1163
+ * @param string $email Comment author's email.
1164
+ * @param string $url Comment author's URL.
1165
+ * @param string $comment Comment content.
1166
+ * @param string $user_ip Comment author's IP address.
1167
+ * @param string $user_agent Comment author's browser user agent.
1168
+ */
1169
+ do_action( 'wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent );
1170
+
1171
+ $mod_keys = trim( get_option('blacklist_keys') );
1172
+ if ( '' == $mod_keys )
1173
+ return false; // If moderation keys are empty
1174
+ $words = explode("\n", $mod_keys );
1175
+
1176
+ foreach ( (array) $words as $word ) {
1177
+ $word = trim($word);
1178
+
1179
+ // Skip empty lines
1180
+ if ( empty($word) ) { continue; }
1181
+
1182
+ // Do some escaping magic so that '#' chars in the
1183
+ // spam words don't break things:
1184
+ $word = preg_quote($word, '#');
1185
+
1186
+ $pattern = "#$word#i";
1187
+ if (
1188
+ preg_match($pattern, $author)
1189
+ || preg_match($pattern, $email)
1190
+ || preg_match($pattern, $url)
1191
+ || preg_match($pattern, $comment)
1192
+ || preg_match($pattern, $user_ip)
1193
+ || preg_match($pattern, $user_agent)
1194
+ )
1195
+ return true;
1196
+ }
1197
+ return false;
1198
+ }
1199
+
1200
+ /**
1201
+ * Retrieve total comments for blog or single post.
1202
+ *
1203
+ * The properties of the returned object contain the 'moderated', 'approved',
1204
+ * and spam comments for either the entire blog or single post. Those properties
1205
+ * contain the amount of comments that match the status. The 'total_comments'
1206
+ * property contains the integer of total comments.
1207
+ *
1208
+ * The comment stats are cached and then retrieved, if they already exist in the
1209
+ * cache.
1210
+ *
1211
+ * @since 2.5.0
1212
+ *
1213
+ * @param int $post_id Optional. Post ID.
1214
+ * @return object Comment stats.
1215
+ */
1216
+ function wp_count_comments( $post_id = 0 ) {
1217
+ global $wpdb;
1218
+
1219
+ $post_id = (int) $post_id;
1220
+
1221
+ /**
1222
+ * Filter the comments count for a given post.
1223
+ *
1224
+ * @since 2.7.0
1225
+ *
1226
+ * @param array $count An empty array.
1227
+ * @param int $post_id The post ID.
1228
+ */
1229
+ $stats = apply_filters( 'wp_count_comments', array(), $post_id );
1230
+ if ( !empty($stats) )
1231
+ return $stats;
1232
+
1233
+ $count = wp_cache_get("comments-{$post_id}", 'counts');
1234
+
1235
+ if ( false !== $count )
1236
+ return $count;
1237
+
1238
+ $where = '';
1239
+ if ( $post_id > 0 )
1240
+ $where = $wpdb->prepare( "WHERE comment_post_ID = %d", $post_id );
1241
+
1242
+ $count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} {$where} GROUP BY comment_approved", ARRAY_A );
1243
+
1244
+ $total = 0;
1245
+ $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash', 'post-trashed' => 'post-trashed');
1246
+ foreach ( (array) $count as $row ) {
1247
+ // Don't count post-trashed toward totals
1248
+ if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] )
1249
+ $total += $row['num_comments'];
1250
+ if ( isset( $approved[$row['comment_approved']] ) )
1251
+ $stats[$approved[$row['comment_approved']]] = $row['num_comments'];
1252
+ }
1253
+
1254
+ $stats['total_comments'] = $total;
1255
+ foreach ( $approved as $key ) {
1256
+ if ( empty($stats[$key]) )
1257
+ $stats[$key] = 0;
1258
+ }
1259
+
1260
+ $stats = (object) $stats;
1261
+ wp_cache_set("comments-{$post_id}", $stats, 'counts');
1262
+
1263
+ return $stats;
1264
+ }
1265
+
1266
+ /**
1267
+ * Trashes or deletes a comment.
1268
+ *
1269
+ * The comment is moved to trash instead of permanently deleted unless trash is
1270
+ * disabled, item is already in the trash, or $force_delete is true.
1271
+ *
1272
+ * The post comment count will be updated if the comment was approved and has a
1273
+ * post ID available.
1274
+ *
1275
+ * @since 2.0.0
1276
+ * @uses $wpdb
1277
+ * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object
1278
+ *
1279
+ * @param int $comment_id Comment ID
1280
+ * @param bool $force_delete Whether to bypass trash and force deletion. Default is false.
1281
+ * @return bool True on success, false on failure.
1282
+ */
1283
+ function wp_delete_comment($comment_id, $force_delete = false) {
1284
+ global $wpdb;
1285
+ if (!$comment = get_comment($comment_id))
1286
+ return false;
1287
+
1288
+ if ( !$force_delete && EMPTY_TRASH_DAYS && !in_array( wp_get_comment_status($comment_id), array( 'trash', 'spam' ) ) )
1289
+ return wp_trash_comment($comment_id);
1290
+
1291
+ /**
1292
+ * Fires immediately before a comment is deleted from the database.
1293
+ *
1294
+ * @since 1.2.0
1295
+ *
1296
+ * @param int $comment_id The comment ID.
1297
+ */
1298
+ do_action( 'delete_comment', $comment_id );
1299
+
1300
+ // Move children up a level.
1301
+ $children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment_id) );
1302
+ if ( !empty($children) ) {
1303
+ $wpdb->update($wpdb->comments, array('comment_parent' => $comment->comment_parent), array('comment_parent' => $comment_id));
1304
+ clean_comment_cache($children);
1305
+ }
1306
+
1307
+ // Delete metadata
1308
+ $meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->commentmeta WHERE comment_id = %d", $comment_id ) );
1309
+ foreach ( $meta_ids as $mid )
1310
+ delete_metadata_by_mid( 'comment', $mid );
1311
+
1312
+ if ( ! $wpdb->delete( $wpdb->comments, array( 'comment_ID' => $comment_id ) ) )
1313
+ return false;
1314
+
1315
+ /**
1316
+ * Fires immediately after a comment is deleted from the database.
1317
+ *
1318
+ * @since 2.9.0
1319
+ *
1320
+ * @param int $comment_id The comment ID.
1321
+ */
1322
+ do_action( 'deleted_comment', $comment_id );
1323
+
1324
+ $post_id = $comment->comment_post_ID;
1325
+ if ( $post_id && $comment->comment_approved == 1 )
1326
+ wp_update_comment_count($post_id);
1327
+
1328
+ clean_comment_cache($comment_id);
1329
+
1330
+ /** This action is documented in wp-includes/comment.php */
1331
+ do_action( 'wp_set_comment_status', $comment_id, 'delete' );
1332
+
1333
+ wp_transition_comment_status('delete', $comment->comment_approved, $comment);
1334
+ return true;
1335
+ }
1336
+
1337
+ /**
1338
+ * Moves a comment to the Trash
1339
+ *
1340
+ * If trash is disabled, comment is permanently deleted.
1341
+ *
1342
+ * @since 2.9.0
1343
+ *
1344
+ * @uses wp_delete_comment() if trash is disabled
1345
+ *
1346
+ * @param int $comment_id Comment ID.
1347
+ * @return bool True on success, false on failure.
1348
+ */
1349
+ function wp_trash_comment($comment_id) {
1350
+ if ( !EMPTY_TRASH_DAYS )
1351
+ return wp_delete_comment($comment_id, true);
1352
+
1353
+ if ( !$comment = get_comment($comment_id) )
1354
+ return false;
1355
+
1356
+ /**
1357
+ * Fires immediately before a comment is sent to the Trash.
1358
+ *
1359
+ * @since 2.9.0
1360
+ *
1361
+ * @param int $comment_id The comment ID.
1362
+ */
1363
+ do_action( 'trash_comment', $comment_id );
1364
+
1365
+ if ( wp_set_comment_status($comment_id, 'trash') ) {
1366
+ add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved);
1367
+ add_comment_meta($comment_id, '_wp_trash_meta_time', time() );
1368
+
1369
+ /**
1370
+ * Fires immediately after a comment is sent to Trash.
1371
+ *
1372
+ * @since 2.9.0
1373
+ *
1374
+ * @param int $comment_id The comment ID.
1375
+ */
1376
+ do_action( 'trashed_comment', $comment_id );
1377
+ return true;
1378
+ }
1379
+
1380
+ return false;
1381
+ }
1382
+
1383
+ /**
1384
+ * Removes a comment from the Trash
1385
+ *
1386
+ * @since 2.9.0
1387
+ *
1388
+ * @param int $comment_id Comment ID.
1389
+ * @return bool True on success, false on failure.
1390
+ */
1391
+ function wp_untrash_comment($comment_id) {
1392
+ if ( ! (int)$comment_id )
1393
+ return false;
1394
+
1395
+ /**
1396
+ * Fires immediately before a comment is restored from the Trash.
1397
+ *
1398
+ * @since 2.9.0
1399
+ *
1400
+ * @param int $comment_id The comment ID.
1401
+ */
1402
+ do_action( 'untrash_comment', $comment_id );
1403
+
1404
+ $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
1405
+ if ( empty($status) )
1406
+ $status = '0';
1407
+
1408
+ if ( wp_set_comment_status($comment_id, $status) ) {
1409
+ delete_comment_meta($comment_id, '_wp_trash_meta_time');
1410
+ delete_comment_meta($comment_id, '_wp_trash_meta_status');
1411
+ /**
1412
+ * Fires immediately after a comment is restored from the Trash.
1413
+ *
1414
+ * @since 2.9.0
1415
+ *
1416
+ * @param int $comment_id The comment ID.
1417
+ */
1418
+ do_action( 'untrashed_comment', $comment_id );
1419
+ return true;
1420
+ }
1421
+
1422
+ return false;
1423
+ }
1424
+
1425
+ /**
1426
+ * Marks a comment as Spam
1427
+ *
1428
+ * @since 2.9.0
1429
+ *
1430
+ * @param int $comment_id Comment ID.
1431
+ * @return bool True on success, false on failure.
1432
+ */
1433
+ function wp_spam_comment($comment_id) {
1434
+ if ( !$comment = get_comment($comment_id) )
1435
+ return false;
1436
+
1437
+ /**
1438
+ * Fires immediately before a comment is marked as Spam.
1439
+ *
1440
+ * @since 2.9.0
1441
+ *
1442
+ * @param int $comment_id The comment ID.
1443
+ */
1444
+ do_action( 'spam_comment', $comment_id );
1445
+
1446
+ if ( wp_set_comment_status($comment_id, 'spam') ) {
1447
+ add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved);
1448
+ /**
1449
+ * Fires immediately after a comment is marked as Spam.
1450
+ *
1451
+ * @since 2.9.0
1452
+ *
1453
+ * @param int $comment_id The comment ID.
1454
+ */
1455
+ do_action( 'spammed_comment', $comment_id );
1456
+ return true;
1457
+ }
1458
+
1459
+ return false;
1460
+ }
1461
+
1462
+ /**
1463
+ * Removes a comment from the Spam
1464
+ *
1465
+ * @since 2.9.0
1466
+ *
1467
+ * @param int $comment_id Comment ID.
1468
+ * @return bool True on success, false on failure.
1469
+ */
1470
+ function wp_unspam_comment($comment_id) {
1471
+ if ( ! (int)$comment_id )
1472
+ return false;
1473
+
1474
+ /**
1475
+ * Fires immediately before a comment is unmarked as Spam.
1476
+ *
1477
+ * @since 2.9.0
1478
+ *
1479
+ * @param int $comment_id The comment ID.
1480
+ */
1481
+ do_action( 'unspam_comment', $comment_id );
1482
+
1483
+ $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
1484
+ if ( empty($status) )
1485
+ $status = '0';
1486
+
1487
+ if ( wp_set_comment_status($comment_id, $status) ) {
1488
+ delete_comment_meta($comment_id, '_wp_trash_meta_status');
1489
+ /**
1490
+ * Fires immediately after a comment is unmarked as Spam.
1491
+ *
1492
+ * @since 2.9.0
1493
+ *
1494
+ * @param int $comment_id The comment ID.
1495
+ */
1496
+ do_action( 'unspammed_comment', $comment_id );
1497
+ return true;
1498
+ }
1499
+
1500
+ return false;
1501
+ }
1502
+
1503
+ /**
1504
+ * The status of a comment by ID.
1505
+ *
1506
+ * @since 1.0.0
1507
+ *
1508
+ * @param int $comment_id Comment ID
1509
+ * @return string|bool Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
1510
+ */
1511
+ function wp_get_comment_status($comment_id) {
1512
+ $comment = get_comment($comment_id);
1513
+ if ( !$comment )
1514
+ return false;
1515
+
1516
+ $approved = $comment->comment_approved;
1517
+
1518
+ if ( $approved == null )
1519
+ return false;
1520
+ elseif ( $approved == '1' )
1521
+ return 'approved';
1522
+ elseif ( $approved == '0' )
1523
+ return 'unapproved';
1524
+ elseif ( $approved == 'spam' )
1525
+ return 'spam';
1526
+ elseif ( $approved == 'trash' )
1527
+ return 'trash';
1528
+ else
1529
+ return false;
1530
+ }
1531
+
1532
+ /**
1533
+ * Call hooks for when a comment status transition occurs.
1534
+ *
1535
+ * Calls hooks for comment status transitions. If the new comment status is not the same
1536
+ * as the previous comment status, then two hooks will be ran, the first is
1537
+ * 'transition_comment_status' with new status, old status, and comment data. The
1538
+ * next action called is 'comment_OLDSTATUS_to_NEWSTATUS' the NEWSTATUS is the
1539
+ * $new_status parameter and the OLDSTATUS is $old_status parameter; it has the
1540
+ * comment data.
1541
+ *
1542
+ * The final action will run whether or not the comment statuses are the same. The
1543
+ * action is named 'comment_NEWSTATUS_COMMENTTYPE', NEWSTATUS is from the $new_status
1544
+ * parameter and COMMENTTYPE is comment_type comment data.
1545
+ *
1546
+ * @since 2.7.0
1547
+ *
1548
+ * @param string $new_status New comment status.
1549
+ * @param string $old_status Previous comment status.
1550
+ * @param object $comment Comment data.
1551
+ */
1552
+ function wp_transition_comment_status($new_status, $old_status, $comment) {
1553
+ /*
1554
+ * Translate raw statuses to human readable formats for the hooks.
1555
+ * This is not a complete list of comment status, it's only the ones
1556
+ * that need to be renamed
1557
+ */
1558
+ $comment_statuses = array(
1559
+ 0 => 'unapproved',
1560
+ 'hold' => 'unapproved', // wp_set_comment_status() uses "hold"
1561
+ 1 => 'approved',
1562
+ 'approve' => 'approved', // wp_set_comment_status() uses "approve"
1563
+ );
1564
+ if ( isset($comment_statuses[$new_status]) ) $new_status = $comment_statuses[$new_status];
1565
+ if ( isset($comment_statuses[$old_status]) ) $old_status = $comment_statuses[$old_status];
1566
+
1567
+ // Call the hooks
1568
+ if ( $new_status != $old_status ) {
1569
+ /**
1570
+ * Fires when the comment status is in transition.
1571
+ *
1572
+ * @since 2.7.0
1573
+ *
1574
+ * @param int|string $new_status The new comment status.
1575
+ * @param int|string $old_status The old comment status.
1576
+ * @param object $comment The comment data.
1577
+ */
1578
+ do_action( 'transition_comment_status', $new_status, $old_status, $comment );
1579
+ /**
1580
+ * Fires when the comment status is in transition from one specific status to another.
1581
+ *
1582
+ * The dynamic portions of the hook name, $old_status, and $new_status,
1583
+ * refer to the old and new comment statuses, respectively.
1584
+ *
1585
+ * @since 2.7.0
1586
+ *
1587
+ * @param object $comment Comment object.
1588
+ */
1589
+ do_action( "comment_{$old_status}_to_{$new_status}", $comment );
1590
+ }
1591
+ /**
1592
+ * Fires when the status of a specific comment type is in transition.
1593
+ *
1594
+ * The dynamic portions of the hook name, $new_status, and $comment->comment_type,
1595
+ * refer to the new comment status, and the type of comment, respectively.
1596
+ *
1597
+ * Typical comment types include an empty string (standard comment), 'pingback',
1598
+ * or 'trackback'.
1599
+ *
1600
+ * @since 2.7.0
1601
+ *
1602
+ * @param int $comment_ID The comment ID.
1603
+ * @param obj $comment Comment object.
1604
+ */
1605
+ do_action( "comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment );
1606
+ }
1607
+
1608
+ /**
1609
+ * Get current commenter's name, email, and URL.
1610
+ *
1611
+ * Expects cookies content to already be sanitized. User of this function might
1612
+ * wish to recheck the returned array for validity.
1613
+ *
1614
+ * @see sanitize_comment_cookies() Use to sanitize cookies
1615
+ *
1616
+ * @since 2.0.4
1617
+ *
1618
+ * @return array Comment author, email, url respectively.
1619
+ */
1620
+ function wp_get_current_commenter() {
1621
+ // Cookies should already be sanitized.
1622
+
1623
+ $comment_author = '';
1624
+ if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) )
1625
+ $comment_author = $_COOKIE['comment_author_'.COOKIEHASH];
1626
+
1627
+ $comment_author_email = '';
1628
+ if ( isset($_COOKIE['comment_author_email_'.COOKIEHASH]) )
1629
+ $comment_author_email = $_COOKIE['comment_author_email_'.COOKIEHASH];
1630
+
1631
+ $comment_author_url = '';
1632
+ if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) )
1633
+ $comment_author_url = $_COOKIE['comment_author_url_'.COOKIEHASH];
1634
+
1635
+ /**
1636
+ * Filter the current commenter's name, email, and URL.
1637
+ *
1638
+ * @since 3.1.0
1639
+ *
1640
+ * @param string $comment_author Comment author's name.
1641
+ * @param string $comment_author_email Comment author's email.
1642
+ * @param string $comment_author_url Comment author's URL.
1643
+ */
1644
+ return apply_filters( 'wp_get_current_commenter', compact('comment_author', 'comment_author_email', 'comment_author_url') );
1645
+ }
1646
+
1647
+ /**
1648
+ * Inserts a comment to the database.
1649
+ *
1650
+ * The available comment data key names are 'comment_author_IP', 'comment_date',
1651
+ * 'comment_date_gmt', 'comment_parent', 'comment_approved', and 'user_id'.
1652
+ *
1653
+ * @since 2.0.0
1654
+ * @uses $wpdb
1655
+ *
1656
+ * @param array $commentdata Contains information on the comment.
1657
+ * @return int|bool The new comment's ID on success, false on failure.
1658
+ */
1659
+ function wp_insert_comment( $commentdata ) {
1660
+ global $wpdb;
1661
+ $data = wp_unslash( $commentdata );
1662
+
1663
+ $comment_author = ! isset( $data['comment_author'] ) ? '' : $data['comment_author'];
1664
+ $comment_author_email = ! isset( $data['comment_author_email'] ) ? '' : $data['comment_author_email'];
1665
+ $comment_author_url = ! isset( $data['comment_author_url'] ) ? '' : $data['comment_author_url'];
1666
+ $comment_author_IP = ! isset( $data['comment_author_IP'] ) ? '' : $data['comment_author_IP'];
1667
+
1668
+ $comment_date = ! isset( $data['comment_date'] ) ? current_time( 'mysql' ) : $data['comment_date'];
1669
+ $comment_date_gmt = ! isset( $data['comment_date_gmt'] ) ? get_gmt_from_date( $comment_date ) : $data['comment_date_gmt'];
1670
+
1671
+ $comment_post_ID = ! isset( $data['comment_post_ID'] ) ? '' : $data['comment_post_ID'];
1672
+ $comment_content = ! isset( $data['comment_content'] ) ? '' : $data['comment_content'];
1673
+ $comment_karma = ! isset( $data['comment_karma'] ) ? 0 : $data['comment_karma'];
1674
+ $comment_approved = ! isset( $data['comment_approved'] ) ? 1 : $data['comment_approved'];
1675
+ $comment_agent = ! isset( $data['comment_agent'] ) ? '' : $data['comment_agent'];
1676
+ $comment_type = ! isset( $data['comment_type'] ) ? '' : $data['comment_type'];
1677
+ $comment_parent = ! isset( $data['comment_parent'] ) ? 0 : $data['comment_parent'];
1678
+
1679
+ $user_id = ! isset( $data['user_id'] ) ? 0 : $data['user_id'];
1680
+
1681
+ $compacted = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_karma', 'comment_approved', 'comment_agent', 'comment_type', 'comment_parent', 'user_id' );
1682
+ if ( ! $wpdb->insert( $wpdb->comments, $compacted ) ) {
1683
+ return false;
1684
+ }
1685
+
1686
+ $id = (int) $wpdb->insert_id;
1687
+
1688
+ if ( $comment_approved == 1 ) {
1689
+ wp_update_comment_count( $comment_post_ID );
1690
+ }
1691
+ $comment = get_comment( $id );
1692
+
1693
+ /**
1694
+ * Fires immediately after a comment is inserted into the database.
1695
+ *
1696
+ * @since 2.8.0
1697
+ *
1698
+ * @param int $id The comment ID.
1699
+ * @param obj $comment Comment object.
1700
+ */
1701
+ do_action( 'wp_insert_comment', $id, $comment );
1702
+
1703
+ wp_cache_set( 'last_changed', microtime(), 'comment' );
1704
+
1705
+ return $id;
1706
+ }
1707
+
1708
+ /**
1709
+ * Filters and sanitizes comment data.
1710
+ *
1711
+ * Sets the comment data 'filtered' field to true when finished. This can be
1712
+ * checked as to whether the comment should be filtered and to keep from
1713
+ * filtering the same comment more than once.
1714
+ *
1715
+ * @since 2.0.0
1716
+ *
1717
+ * @param array $commentdata Contains information on the comment.
1718
+ * @return array Parsed comment information.
1719
+ */
1720
+ function wp_filter_comment($commentdata) {
1721
+ if ( isset( $commentdata['user_ID'] ) ) {
1722
+ /**
1723
+ * Filter the comment author's user id before it is set.
1724
+ *
1725
+ * The first time this filter is evaluated, 'user_ID' is checked
1726
+ * (for back-compat), followed by the standard 'user_id' value.
1727
+ *
1728
+ * @since 1.5.0
1729
+ *
1730
+ * @param int $user_ID The comment author's user ID.
1731
+ */
1732
+ $commentdata['user_id'] = apply_filters( 'pre_user_id', $commentdata['user_ID'] );
1733
+ } elseif ( isset( $commentdata['user_id'] ) ) {
1734
+ /** This filter is documented in wp-includes/comment.php */
1735
+ $commentdata['user_id'] = apply_filters( 'pre_user_id', $commentdata['user_id'] );
1736
+ }
1737
+
1738
+ /**
1739
+ * Filter the comment author's browser user agent before it is set.
1740
+ *
1741
+ * @since 1.5.0
1742
+ *
1743
+ * @param int $comment_agent The comment author's browser user agent.
1744
+ */
1745
+ $commentdata['comment_agent'] = apply_filters( 'pre_comment_user_agent', ( isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : '' ) );
1746
+ /** This filter is documented in wp-includes/comment.php */
1747
+ $commentdata['comment_author'] = apply_filters( 'pre_comment_author_name', $commentdata['comment_author'] );
1748
+ /**
1749
+ * Filter the comment content before it is set.
1750
+ *
1751
+ * @since 1.5.0
1752
+ *
1753
+ * @param int $comment_content The comment content.
1754
+ */
1755
+ $commentdata['comment_content'] = apply_filters( 'pre_comment_content', $commentdata['comment_content'] );
1756
+ /**
1757
+ * Filter the comment author's IP before it is set.
1758
+ *
1759
+ * @since 1.5.0
1760
+ *
1761
+ * @param int $comment_author_ip The comment author's IP.
1762
+ */
1763
+ $commentdata['comment_author_IP'] = apply_filters( 'pre_comment_user_ip', $commentdata['comment_author_IP'] );
1764
+ /** This filter is documented in wp-includes/comment.php */
1765
+ $commentdata['comment_author_url'] = apply_filters( 'pre_comment_author_url', $commentdata['comment_author_url'] );
1766
+ /** This filter is documented in wp-includes/comment.php */
1767
+ $commentdata['comment_author_email'] = apply_filters( 'pre_comment_author_email', $commentdata['comment_author_email'] );
1768
+ $commentdata['filtered'] = true;
1769
+ return $commentdata;
1770
+ }
1771
+
1772
+ /**
1773
+ * Whether a comment should be blocked because of comment flood.
1774
+ *
1775
+ * @since 2.1.0
1776
+ *
1777
+ * @param bool $block Whether plugin has already blocked comment.
1778
+ * @param int $time_lastcomment Timestamp for last comment.
1779
+ * @param int $time_newcomment Timestamp for new comment.
1780
+ * @return bool Whether comment should be blocked.
1781
+ */
1782
+ function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) {
1783
+ if ( $block ) // a plugin has already blocked... we'll let that decision stand
1784
+ return $block;
1785
+ if ( ($time_newcomment - $time_lastcomment) < 15 )
1786
+ return true;
1787
+ return false;
1788
+ }
1789
+
1790
+ /**
1791
+ * Adds a new comment to the database.
1792
+ *
1793
+ * Filters new comment to ensure that the fields are sanitized and valid before
1794
+ * inserting comment into database. Calls 'comment_post' action with comment ID
1795
+ * and whether comment is approved by WordPress. Also has 'preprocess_comment'
1796
+ * filter for processing the comment data before the function handles it.
1797
+ *
1798
+ * We use REMOTE_ADDR here directly. If you are behind a proxy, you should ensure
1799
+ * that it is properly set, such as in wp-config.php, for your environment.
1800
+ * See {@link https://core.trac.wordpress.org/ticket/9235}
1801
+ *
1802
+ * @since 1.5.0
1803
+ * @param array $commentdata Contains information on the comment.
1804
+ * @return int|bool The ID of the comment on success, false on failure.
1805
+ */
1806
+ function wp_new_comment( $commentdata ) {
1807
+ if ( isset( $commentdata['user_ID'] ) ) {
1808
+ $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
1809
+ }
1810
+
1811
+ $prefiltered_user_id = ( isset( $commentdata['user_id'] ) ) ? (int) $commentdata['user_id'] : 0;
1812
+
1813
+ /**
1814
+ * Filter a comment's data before it is sanitized and inserted into the database.
1815
+ *
1816
+ * @since 1.5.0
1817
+ *
1818
+ * @param array $commentdata Comment data.
1819
+ */
1820
+ $commentdata = apply_filters( 'preprocess_comment', $commentdata );
1821
+
1822
+ $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
1823
+ if ( isset( $commentdata['user_ID'] ) && $prefiltered_user_id !== (int) $commentdata['user_ID'] ) {
1824
+ $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
1825
+ } elseif ( isset( $commentdata['user_id'] ) ) {
1826
+ $commentdata['user_id'] = (int) $commentdata['user_id'];
1827
+ }
1828
+
1829
+ $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0;
1830
+ $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : '';
1831
+ $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
1832
+
1833
+ $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
1834
+ $commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '';
1835
+
1836
+ $commentdata['comment_date'] = current_time('mysql');
1837
+ $commentdata['comment_date_gmt'] = current_time('mysql', 1);
1838
+
1839
+ $commentdata = wp_filter_comment($commentdata);
1840
+
1841
+ $commentdata['comment_approved'] = wp_allow_comment($commentdata);
1842
+
1843
+ $comment_ID = wp_insert_comment($commentdata);
1844
+ if ( ! $comment_ID ) {
1845
+ return false;
1846
+ }
1847
+
1848
+ /**
1849
+ * Fires immediately after a comment is inserted into the database.
1850
+ *
1851
+ * @since 1.2.0
1852
+ *
1853
+ * @param int $comment_ID The comment ID.
1854
+ * @param int $comment_approved 1 (true) if the comment is approved, 0 (false) if not.
1855
+ */
1856
+ do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'] );
1857
+
1858
+ if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
1859
+ if ( '0' == $commentdata['comment_approved'] ) {
1860
+ wp_notify_moderator( $comment_ID );
1861
+ }
1862
+
1863
+ // wp_notify_postauthor() checks if notifying the author of their own comment.
1864
+ // By default, it won't, but filters can override this.
1865
+ if ( get_option( 'comments_notify' ) && $commentdata['comment_approved'] ) {
1866
+ wp_notify_postauthor( $comment_ID );
1867
+ }
1868
+ }
1869
+
1870
+ return $comment_ID;
1871
+ }
1872
+
1873
+ /**
1874
+ * Sets the status of a comment.
1875
+ *
1876
+ * The 'wp_set_comment_status' action is called after the comment is handled.
1877
+ * If the comment status is not in the list, then false is returned.
1878
+ *
1879
+ * @since 1.0.0
1880
+ * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object
1881
+ *
1882
+ * @param int $comment_id Comment ID.
1883
+ * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'.
1884
+ * @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default is false.
1885
+ * @return bool|WP_Error True on success, false or WP_Error on failure.
1886
+ */
1887
+ function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
1888
+ global $wpdb;
1889
+
1890
+ switch ( $comment_status ) {
1891
+ case 'hold':
1892
+ case '0':
1893
+ $status = '0';
1894
+ break;
1895
+ case 'approve':
1896
+ case '1':
1897
+ $status = '1';
1898
+ if ( get_option('comments_notify') ) {
1899
+ wp_notify_postauthor( $comment_id );
1900
+ }
1901
+ break;
1902
+ case 'spam':
1903
+ $status = 'spam';
1904
+ break;
1905
+ case 'trash':
1906
+ $status = 'trash';
1907
+ break;
1908
+ default:
1909
+ return false;
1910
+ }
1911
+
1912
+ $comment_old = clone get_comment($comment_id);
1913
+
1914
+ if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array('comment_ID' => $comment_id) ) ) {
1915
+ if ( $wp_error )
1916
+ return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error);
1917
+ else
1918
+ return false;
1919
+ }
1920
+
1921
+ clean_comment_cache($comment_id);
1922
+
1923
+ $comment = get_comment($comment_id);
1924
+
1925
+ /**
1926
+ * Fires immediately before transitioning a comment's status from one to another
1927
+ * in the database.
1928
+ *
1929
+ * @since 1.5.0
1930
+ *
1931
+ * @param int $comment_id Comment ID.
1932
+ * @param string|bool $comment_status Current comment status. Possible values include
1933
+ * 'hold', 'approve', 'spam', 'trash', or false.
1934
+ */
1935
+ do_action( 'wp_set_comment_status', $comment_id, $comment_status );
1936
+
1937
+ wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment);
1938
+
1939
+ wp_update_comment_count($comment->comment_post_ID);
1940
+
1941
+ return true;
1942
+ }
1943
+
1944
+ /**
1945
+ * Updates an existing comment in the database.
1946
+ *
1947
+ * Filters the comment and makes sure certain fields are valid before updating.
1948
+ *
1949
+ * @since 2.0.0
1950
+ * @uses $wpdb
1951
+ * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object
1952
+ *
1953
+ * @param array $commentarr Contains information on the comment.
1954
+ * @return int Comment was updated if value is 1, or was not updated if value is 0.
1955
+ */
1956
+ function wp_update_comment($commentarr) {
1957
+ global $wpdb;
1958
+
1959
+ // First, get all of the original fields
1960
+ $comment = get_comment($commentarr['comment_ID'], ARRAY_A);
1961
+ if ( empty( $comment ) ) {
1962
+ return 0;
1963
+ }
1964
+ // Escape data pulled from DB.
1965
+ $comment = wp_slash($comment);
1966
+
1967
+ $old_status = $comment['comment_approved'];
1968
+
1969
+ // Merge old and new fields with new fields overwriting old ones.
1970
+ $commentarr = array_merge($comment, $commentarr);
1971
+
1972
+ $commentarr = wp_filter_comment( $commentarr );
1973
+
1974
+ // Now extract the merged array.
1975
+ $data = wp_unslash( $commentarr );
1976
+
1977
+ /**
1978
+ * Filter the comment content before it is updated in the database.
1979
+ *
1980
+ * @since 1.5.0
1981
+ *
1982
+ * @param string $comment_content The comment data.
1983
+ */
1984
+ $data['comment_content'] = apply_filters( 'comment_save_pre', $data['comment_content'] );
1985
+
1986
+ $data['comment_date_gmt'] = get_gmt_from_date( $data['comment_date'] );
1987
+
1988
+ if ( ! isset( $data['comment_approved'] ) ) {
1989
+ $data['comment_approved'] = 1;
1990
+ } else if ( 'hold' == $data['comment_approved'] ) {
1991
+ $data['comment_approved'] = 0;
1992
+ } else if ( 'approve' == $data['comment_approved'] ) {
1993
+ $data['comment_approved'] = 1;
1994
+ }
1995
+
1996
+ $comment_ID = $data['comment_ID'];
1997
+ $comment_post_ID = $data['comment_post_ID'];
1998
+ $keys = array( 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_parent' );
1999
+ $data = wp_array_slice_assoc( $data, $keys );
2000
+ $rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) );
2001
+
2002
+ clean_comment_cache( $comment_ID );
2003
+ wp_update_comment_count( $comment_post_ID );
2004
+ /**
2005
+ * Fires immediately after a comment is updated in the database.
2006
+ *
2007
+ * The hook also fires immediately before comment status transition hooks are fired.
2008
+ *
2009
+ * @since 1.2.0
2010
+ *
2011
+ * @param int $comment_ID The comment ID.
2012
+ */
2013
+ do_action( 'edit_comment', $comment_ID );
2014
+ $comment = get_comment($comment_ID);
2015
+ wp_transition_comment_status($comment->comment_approved, $old_status, $comment);
2016
+ return $rval;
2017
+ }
2018
+
2019
+ /**
2020
+ * Whether to defer comment counting.
2021
+ *
2022
+ * When setting $defer to true, all post comment counts will not be updated
2023
+ * until $defer is set to false. When $defer is set to false, then all
2024
+ * previously deferred updated post comment counts will then be automatically
2025
+ * updated without having to call wp_update_comment_count() after.
2026
+ *
2027
+ * @since 2.5.0
2028
+ * @staticvar bool $_defer
2029
+ *
2030
+ * @param bool $defer
2031
+ * @return unknown
2032
+ */
2033
+ function wp_defer_comment_counting($defer=null) {
2034
+ static $_defer = false;
2035
+
2036
+ if ( is_bool($defer) ) {
2037
+ $_defer = $defer;
2038
+ // flush any deferred counts
2039
+ if ( !$defer )
2040
+ wp_update_comment_count( null, true );
2041
+ }
2042
+
2043
+ return $_defer;
2044
+ }
2045
+
2046
+ /**
2047
+ * Updates the comment count for post(s).
2048
+ *
2049
+ * When $do_deferred is false (is by default) and the comments have been set to
2050
+ * be deferred, the post_id will be added to a queue, which will be updated at a
2051
+ * later date and only updated once per post ID.
2052
+ *
2053
+ * If the comments have not be set up to be deferred, then the post will be
2054
+ * updated. When $do_deferred is set to true, then all previous deferred post
2055
+ * IDs will be updated along with the current $post_id.
2056
+ *
2057
+ * @since 2.1.0
2058
+ * @see wp_update_comment_count_now() For what could cause a false return value
2059
+ *
2060
+ * @param int $post_id Post ID
2061
+ * @param bool $do_deferred Whether to process previously deferred post comment counts
2062
+ * @return bool True on success, false on failure
2063
+ */
2064
+ function wp_update_comment_count($post_id, $do_deferred=false) {
2065
+ static $_deferred = array();
2066
+
2067
+ if ( $do_deferred ) {
2068
+ $_deferred = array_unique($_deferred);
2069
+ foreach ( $_deferred as $i => $_post_id ) {
2070
+ wp_update_comment_count_now($_post_id);
2071
+ unset( $_deferred[$i] ); /** @todo Move this outside of the foreach and reset $_deferred to an array instead */
2072
+ }
2073
+ }
2074
+
2075
+ if ( wp_defer_comment_counting() ) {
2076
+ $_deferred[] = $post_id;
2077
+ return true;
2078
+ }
2079
+ elseif ( $post_id ) {
2080
+ return wp_update_comment_count_now($post_id);
2081
+ }
2082
+
2083
+ }
2084
+
2085
+ /**
2086
+ * Updates the comment count for the post.
2087
+ *
2088
+ * @since 2.5.0
2089
+ * @uses $wpdb
2090
+ *
2091
+ * @param int $post_id Post ID
2092
+ * @return bool True on success, false on '0' $post_id or if post with ID does not exist.
2093
+ */
2094
+ function wp_update_comment_count_now($post_id) {
2095
+ global $wpdb;
2096
+ $post_id = (int) $post_id;
2097
+ if ( !$post_id )
2098
+ return false;
2099
+ if ( !$post = get_post($post_id) )
2100
+ return false;
2101
+
2102
+ $old = (int) $post->comment_count;
2103
+ $new = (int) $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id) );
2104
+ $wpdb->update( $wpdb->posts, array('comment_count' => $new), array('ID' => $post_id) );
2105
+
2106
+ clean_post_cache( $post );
2107
+
2108
+ /**
2109
+ * Fires immediately after a post's comment count is updated in the database.
2110
+ *
2111
+ * @since 2.3.0
2112
+ *
2113
+ * @param int $post_id Post ID.
2114
+ * @param int $new The new comment count.
2115
+ * @param int $old The old comment count.
2116
+ */
2117
+ do_action( 'wp_update_comment_count', $post_id, $new, $old );
2118
+ /** This action is documented in wp-includes/post.php */
2119
+ do_action( 'edit_post', $post_id, $post );
2120
+
2121
+ return true;
2122
+ }
2123
+
2124
+ //
2125
+ // Ping and trackback functions.
2126
+ //
2127
+
2128
+ /**
2129
+ * Finds a pingback server URI based on the given URL.
2130
+ *
2131
+ * Checks the HTML for the rel="pingback" link and x-pingback headers. It does
2132
+ * a check for the x-pingback headers first and returns that, if available. The
2133
+ * check for the rel="pingback" has more overhead than just the header.
2134
+ *
2135
+ * @since 1.5.0
2136
+ *
2137
+ * @param string $url URL to ping.
2138
+ * @param int $deprecated Not Used.
2139
+ * @return bool|string False on failure, string containing URI on success.
2140
+ */
2141
+ function discover_pingback_server_uri( $url, $deprecated = '' ) {
2142
+ if ( !empty( $deprecated ) )
2143
+ _deprecated_argument( __FUNCTION__, '2.7' );
2144
+
2145
+ $pingback_str_dquote = 'rel="pingback"';
2146
+ $pingback_str_squote = 'rel=\'pingback\'';
2147
+
2148
+ /** @todo Should use Filter Extension or custom preg_match instead. */
2149
+ $parsed_url = parse_url($url);
2150
+
2151
+ if ( ! isset( $parsed_url['host'] ) ) // Not an URL. This should never happen.
2152
+ return false;
2153
+
2154
+ //Do not search for a pingback server on our own uploads
2155
+ $uploads_dir = wp_upload_dir();
2156
+ if ( 0 === strpos($url, $uploads_dir['baseurl']) )
2157
+ return false;
2158
+
2159
+ $response = wp_safe_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
2160
+
2161
+ if ( is_wp_error( $response ) )
2162
+ return false;
2163
+
2164
+ if ( wp_remote_retrieve_header( $response, 'x-pingback' ) )
2165
+ return wp_remote_retrieve_header( $response, 'x-pingback' );
2166
+
2167
+ // Not an (x)html, sgml, or xml page, no use going further.
2168
+ if ( preg_match('#(image|audio|video|model)/#is', wp_remote_retrieve_header( $response, 'content-type' )) )
2169
+ return false;
2170
+
2171
+ // Now do a GET since we're going to look in the html headers (and we're sure it's not a binary file)
2172
+ $response = wp_safe_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
2173
+
2174
+ if ( is_wp_error( $response ) )
2175
+ return false;
2176
+
2177
+ $contents = wp_remote_retrieve_body( $response );
2178
+
2179
+ $pingback_link_offset_dquote = strpos($contents, $pingback_str_dquote);
2180
+ $pingback_link_offset_squote = strpos($contents, $pingback_str_squote);
2181
+ if ( $pingback_link_offset_dquote || $pingback_link_offset_squote ) {
2182
+ $quote = ($pingback_link_offset_dquote) ? '"' : '\'';
2183
+ $pingback_link_offset = ($quote=='"') ? $pingback_link_offset_dquote : $pingback_link_offset_squote;
2184
+ $pingback_href_pos = @strpos($contents, 'href=', $pingback_link_offset);
2185
+ $pingback_href_start = $pingback_href_pos+6;
2186
+ $pingback_href_end = @strpos($contents, $quote, $pingback_href_start);
2187
+ $pingback_server_url_len = $pingback_href_end - $pingback_href_start;
2188
+ $pingback_server_url = substr($contents, $pingback_href_start, $pingback_server_url_len);
2189
+
2190
+ // We may find rel="pingback" but an incomplete pingback URL
2191
+ if ( $pingback_server_url_len > 0 ) { // We got it!
2192
+ return $pingback_server_url;
2193
+ }
2194
+ }
2195
+
2196
+ return false;
2197
+ }
2198
+
2199
+ /**
2200
+ * Perform all pingbacks, enclosures, trackbacks, and send to pingback services.
2201
+ *
2202
+ * @since 2.1.0
2203
+ * @uses $wpdb
2204
+ */
2205
+ function do_all_pings() {
2206
+ global $wpdb;
2207
+
2208
+ // Do pingbacks
2209
+ while ($ping = $wpdb->get_row("SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) {
2210
+ delete_metadata_by_mid( 'post', $ping->meta_id );
2211
+ pingback( $ping->post_content, $ping->ID );
2212
+ }
2213
+
2214
+ // Do Enclosures
2215
+ while ($enclosure = $wpdb->get_row("SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) {
2216
+ delete_metadata_by_mid( 'post', $enclosure->meta_id );
2217
+ do_enclose( $enclosure->post_content, $enclosure->ID );
2218
+ }
2219
+
2220
+ // Do Trackbacks
2221
+ $trackbacks = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE to_ping <> '' AND post_status = 'publish'");
2222
+ if ( is_array($trackbacks) )
2223
+ foreach ( $trackbacks as $trackback )
2224
+ do_trackbacks($trackback);
2225
+
2226
+ //Do Update Services/Generic Pings
2227
+ generic_ping();
2228
+ }
2229
+
2230
+ /**
2231
+ * Perform trackbacks.
2232
+ *
2233
+ * @since 1.5.0
2234
+ * @uses $wpdb
2235
+ *
2236
+ * @param int $post_id Post ID to do trackbacks on.
2237
+ */
2238
+ function do_trackbacks($post_id) {
2239
+ global $wpdb;
2240
+
2241
+ $post = get_post( $post_id );
2242
+ $to_ping = get_to_ping($post_id);
2243
+ $pinged = get_pung($post_id);
2244
+ if ( empty($to_ping) ) {
2245
+ $wpdb->update($wpdb->posts, array('to_ping' => ''), array('ID' => $post_id) );
2246
+ return;
2247
+ }
2248
+
2249
+ if ( empty($post->post_excerpt) ) {
2250
+ /** This filter is documented in wp-includes/post-template.php */
2251
+ $excerpt = apply_filters( 'the_content', $post->post_content, $post->ID );
2252
+ } else {
2253
+ /** This filter is documented in wp-includes/post-template.php */
2254
+ $excerpt = apply_filters( 'the_excerpt', $post->post_excerpt );
2255
+ }
2256
+
2257
+ $excerpt = str_replace(']]>', ']]&gt;', $excerpt);
2258
+ $excerpt = wp_html_excerpt($excerpt, 252, '&#8230;');
2259
+
2260
+ /** This filter is documented in wp-includes/post-template.php */
2261
+ $post_title = apply_filters( 'the_title', $post->post_title, $post->ID );
2262
+ $post_title = strip_tags($post_title);
2263
+
2264
+ if ( $to_ping ) {
2265
+ foreach ( (array) $to_ping as $tb_ping ) {
2266
+ $tb_ping = trim($tb_ping);
2267
+ if ( !in_array($tb_ping, $pinged) ) {
2268
+ trackback($tb_ping, $post_title, $excerpt, $post_id);
2269
+ $pinged[] = $tb_ping;
2270
+ } else {
2271
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $tb_ping, $post_id) );
2272
+ }
2273
+ }
2274
+ }
2275
+ }
2276
+
2277
+ /**
2278
+ * Sends pings to all of the ping site services.
2279
+ *
2280
+ * @since 1.2.0
2281
+ *
2282
+ * @param int $post_id Post ID.
2283
+ * @return int Same as Post ID from parameter
2284
+ */
2285
+ function generic_ping( $post_id = 0 ) {
2286
+ $services = get_option('ping_sites');
2287
+
2288
+ $services = explode("\n", $services);
2289
+ foreach ( (array) $services as $service ) {
2290
+ $service = trim($service);
2291
+ if ( '' != $service )
2292
+ weblog_ping($service);
2293
+ }
2294
+
2295
+ return $post_id;
2296
+ }
2297
+
2298
+ /**
2299
+ * Pings back the links found in a post.
2300
+ *
2301
+ * @since 0.71
2302
+ * @uses $wp_version
2303
+ * @uses IXR_Client
2304
+ *
2305
+ * @param string $content Post content to check for links.
2306
+ * @param int $post_ID Post ID.
2307
+ */
2308
+ function pingback($content, $post_ID) {
2309
+ global $wp_version;
2310
+ include_once(ABSPATH . WPINC . '/class-IXR.php');
2311
+ include_once(ABSPATH . WPINC . '/class-wp-http-ixr-client.php');
2312
+
2313
+ // original code by Mort (http://mort.mine.nu:8080)
2314
+ $post_links = array();
2315
+
2316
+ $pung = get_pung($post_ID);
2317
+
2318
+ // Step 1
2319
+ // Parsing the post, external links (if any) are stored in the $post_links array
2320
+ $post_links_temp = wp_extract_urls( $content );
2321
+
2322
+ // Step 2.
2323
+ // Walking thru the links array
2324
+ // first we get rid of links pointing to sites, not to specific files
2325
+ // Example:
2326
+ // http://dummy-weblog.org
2327
+ // http://dummy-weblog.org/
2328
+ // http://dummy-weblog.org/post.php
2329
+ // We don't wanna ping first and second types, even if they have a valid <link/>
2330
+
2331
+ foreach ( (array) $post_links_temp as $link_test ) :
2332
+ if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself
2333
+ && !is_local_attachment($link_test) ) : // Also, let's never ping local attachments.
2334
+ if ( $test = @parse_url($link_test) ) {
2335
+ if ( isset($test['query']) )
2336
+ $post_links[] = $link_test;
2337
+ elseif ( isset( $test['path'] ) && ( $test['path'] != '/' ) && ( $test['path'] != '' ) )
2338
+ $post_links[] = $link_test;
2339
+ }
2340
+ endif;
2341
+ endforeach;
2342
+
2343
+ $post_links = array_unique( $post_links );
2344
+ /**
2345
+ * Fires just before pinging back links found in a post.
2346
+ *
2347
+ * @since 2.0.0
2348
+ *
2349
+ * @param array &$post_links An array of post links to be checked, passed by reference.
2350
+ * @param array &$pung Whether a link has already been pinged, passed by reference.
2351
+ * @param int $post_ID The post ID.
2352
+ */
2353
+ do_action_ref_array( 'pre_ping', array( &$post_links, &$pung, $post_ID ) );
2354
+
2355
+ foreach ( (array) $post_links as $pagelinkedto ) {
2356
+ $pingback_server_url = discover_pingback_server_uri( $pagelinkedto );
2357
+
2358
+ if ( $pingback_server_url ) {
2359
+ @ set_time_limit( 60 );
2360
+ // Now, the RPC call
2361
+ $pagelinkedfrom = get_permalink($post_ID);
2362
+
2363
+ // using a timeout of 3 seconds should be enough to cover slow servers
2364
+ $client = new WP_HTTP_IXR_Client($pingback_server_url);
2365
+ $client->timeout = 3;
2366
+ /**
2367
+ * Filter the user agent sent when pinging-back a URL.
2368
+ *
2369
+ * @since 2.9.0
2370
+ *
2371
+ * @param string $concat_useragent The user agent concatenated with ' -- WordPress/'
2372
+ * and the WordPress version.
2373
+ * @param string $useragent The useragent.
2374
+ * @param string $pingback_server_url The server URL being linked to.
2375
+ * @param string $pagelinkedto URL of page linked to.
2376
+ * @param string $pagelinkedfrom URL of page linked from.
2377
+ */
2378
+ $client->useragent = apply_filters( 'pingback_useragent', $client->useragent . ' -- WordPress/' . $wp_version, $client->useragent, $pingback_server_url, $pagelinkedto, $pagelinkedfrom );
2379
+ // when set to true, this outputs debug messages by itself
2380
+ $client->debug = false;
2381
+
2382
+ if ( $client->query('pingback.ping', $pagelinkedfrom, $pagelinkedto) || ( isset($client->error->code) && 48 == $client->error->code ) ) // Already registered
2383
+ add_ping( $post_ID, $pagelinkedto );
2384
+ }
2385
+ }
2386
+ }
2387
+
2388
+ /**
2389
+ * Check whether blog is public before returning sites.
2390
+ *
2391
+ * @since 2.1.0
2392
+ *
2393
+ * @param mixed $sites Will return if blog is public, will not return if not public.
2394
+ * @return mixed Empty string if blog is not public, returns $sites, if site is public.
2395
+ */
2396
+ function privacy_ping_filter($sites) {
2397
+ if ( '0' != get_option('blog_public') )
2398
+ return $sites;
2399
+ else
2400
+ return '';
2401
+ }
2402
+
2403
+ /**
2404
+ * Send a Trackback.
2405
+ *
2406
+ * Updates database when sending trackback to prevent duplicates.
2407
+ *
2408
+ * @since 0.71
2409
+ * @uses $wpdb
2410
+ *
2411
+ * @param string $trackback_url URL to send trackbacks.
2412
+ * @param string $title Title of post.
2413
+ * @param string $excerpt Excerpt of post.
2414
+ * @param int $ID Post ID.
2415
+ * @return mixed Database query from update.
2416
+ */
2417
+ function trackback($trackback_url, $title, $excerpt, $ID) {
2418
+ global $wpdb;
2419
+
2420
+ if ( empty($trackback_url) )
2421
+ return;
2422
+
2423
+ $options = array();
2424
+ $options['timeout'] = 4;
2425
+ $options['body'] = array(
2426
+ 'title' => $title,
2427
+ 'url' => get_permalink($ID),
2428
+ 'blog_name' => get_option('blogname'),
2429
+ 'excerpt' => $excerpt
2430
+ );
2431
+
2432
+ $response = wp_safe_remote_post( $trackback_url, $options );
2433
+
2434
+ if ( is_wp_error( $response ) )
2435
+ return;
2436
+
2437
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $ID) );
2438
+ return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $ID) );
2439
+ }
2440
+
2441
+ /**
2442
+ * Send a pingback.
2443
+ *
2444
+ * @since 1.2.0
2445
+ * @uses $wp_version
2446
+ * @uses IXR_Client
2447
+ *
2448
+ * @param string $server Host of blog to connect to.
2449
+ * @param string $path Path to send the ping.
2450
+ */
2451
+ function weblog_ping($server = '', $path = '') {
2452
+ global $wp_version;
2453
+ include_once(ABSPATH . WPINC . '/class-IXR.php');
2454
+ include_once(ABSPATH . WPINC . '/class-wp-http-ixr-client.php');
2455
+
2456
+ // using a timeout of 3 seconds should be enough to cover slow servers
2457
+ $client = new WP_HTTP_IXR_Client($server, ((!strlen(trim($path)) || ('/' == $path)) ? false : $path));
2458
+ $client->timeout = 3;
2459
+ $client->useragent .= ' -- WordPress/'.$wp_version;
2460
+
2461
+ // when set to true, this outputs debug messages by itself
2462
+ $client->debug = false;
2463
+ $home = trailingslashit( home_url() );
2464
+ if ( !$client->query('weblogUpdates.extendedPing', get_option('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping
2465
+ $client->query('weblogUpdates.ping', get_option('blogname'), $home);
2466
+ }
2467
+
2468
+ /**
2469
+ * Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI
2470
+ *
2471
+ * @since 3.5.1
2472
+ * @see wp_http_validate_url()
2473
+ *
2474
+ * @param string $source_uri
2475
+ * @return string
2476
+ */
2477
+ function pingback_ping_source_uri( $source_uri ) {
2478
+ return (string) wp_http_validate_url( $source_uri );
2479
+ }
2480
+
2481
+ /**
2482
+ * Default filter attached to xmlrpc_pingback_error.
2483
+ *
2484
+ * Returns a generic pingback error code unless the error code is 48,
2485
+ * which reports that the pingback is already registered.
2486
+ *
2487
+ * @since 3.5.1
2488
+ * @link http://www.hixie.ch/specs/pingback/pingback#TOC3
2489
+ *
2490
+ * @param IXR_Error $ixr_error
2491
+ * @return IXR_Error
2492
+ */
2493
+ function xmlrpc_pingback_error( $ixr_error ) {
2494
+ if ( $ixr_error->code === 48 )
2495
+ return $ixr_error;
2496
+ return new IXR_Error( 0, '' );
2497
+ }
2498
+
2499
+ //
2500
+ // Cache
2501
+ //
2502
+
2503
+ /**
2504
+ * Removes comment ID from the comment cache.
2505
+ *
2506
+ * @since 2.3.0
2507
+ *
2508
+ * @param int|array $ids Comment ID or array of comment IDs to remove from cache
2509
+ */
2510
+ function clean_comment_cache($ids) {
2511
+ foreach ( (array) $ids as $id )
2512
+ wp_cache_delete($id, 'comment');
2513
+
2514
+ wp_cache_set( 'last_changed', microtime(), 'comment' );
2515
+ }
2516
+
2517
+ /**
2518
+ * Updates the comment cache of given comments.
2519
+ *
2520
+ * Will add the comments in $comments to the cache. If comment ID already exists
2521
+ * in the comment cache then it will not be updated. The comment is added to the
2522
+ * cache using the comment group with the key using the ID of the comments.
2523
+ *
2524
+ * @since 2.3.0
2525
+ *
2526
+ * @param array $comments Array of comment row objects
2527
+ */
2528
+ function update_comment_cache($comments) {
2529
+ foreach ( (array) $comments as $comment )
2530
+ wp_cache_add($comment->comment_ID, $comment, 'comment');
2531
+ }
2532
+
2533
+ //
2534
+ // Internal
2535
+ //
2536
+
2537
+ /**
2538
+ * Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts.
2539
+ *
2540
+ * @access private
2541
+ * @since 2.7.0
2542
+ *
2543
+ * @param object $posts Post data object.
2544
+ * @param object $query Query object.
2545
+ * @return object
2546
+ */
2547
+ function _close_comments_for_old_posts( $posts, $query ) {
2548
+ if ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) )
2549
+ return $posts;
2550
+
2551
+ /**
2552
+ * Filter the list of post types to automatically close comments for.
2553
+ *
2554
+ * @since 3.2.0
2555
+ *
2556
+ * @param array $post_types An array of registered post types. Default array with 'post'.
2557
+ */
2558
+ $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
2559
+ if ( ! in_array( $posts[0]->post_type, $post_types ) )
2560
+ return $posts;
2561
+
2562
+ $days_old = (int) get_option( 'close_comments_days_old' );
2563
+ if ( ! $days_old )
2564
+ return $posts;
2565
+
2566
+ if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) {
2567
+ $posts[0]->comment_status = 'closed';
2568
+ $posts[0]->ping_status = 'closed';
2569
+ }
2570
+
2571
+ return $posts;
2572
+ }
2573
+
2574
+ /**
2575
+ * Close comments on an old post. Hooked to comments_open and pings_open.
2576
+ *
2577
+ * @access private
2578
+ * @since 2.7.0
2579
+ *
2580
+ * @param bool $open Comments open or closed
2581
+ * @param int $post_id Post ID
2582
+ * @return bool $open
2583
+ */
2584
+ function _close_comments_for_old_post( $open, $post_id ) {
2585
+ if ( ! $open )
2586
+ return $open;
2587
+
2588
+ if ( !get_option('close_comments_for_old_posts') )
2589
+ return $open;
2590
+
2591
+ $days_old = (int) get_option('close_comments_days_old');
2592
+ if ( !$days_old )
2593
+ return $open;
2594
+
2595
+ $post = get_post($post_id);
2596
+
2597
+ /** This filter is documented in wp-includes/comment.php */
2598
+ $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
2599
+ if ( ! in_array( $post->post_type, $post_types ) )
2600
+ return $open;
2601
+
2602
+ if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) )
2603
+ return false;
2604
+
2605
+ return $open;
2606
+ }