Google Analytics Dashboard for WP (GADWP) - Version 5.3.6

Version Description

Download this release

Release Info

Developer chriscct7
Plugin Icon 128x128 Google Analytics Dashboard for WP (GADWP)
Version 5.3.6
Comparing to
See all releases

Code changes from version 5.3.4 to 5.3.6

Files changed (255) hide show
  1. assets/banner-772x250-old.png +0 -0
  2. assets/banner-772x250.png +0 -0
  3. assets/icon-128x128.png +0 -0
  4. assets/icon-256x256.png +0 -0
  5. assets/logo.png +0 -0
  6. assets/screenshot-1.png +0 -0
  7. assets/screenshot-2.png +0 -0
  8. assets/screenshot-3.png +0 -0
  9. assets/screenshot-4.png +0 -0
  10. assets/screenshot-5.png +0 -0
  11. assets/screenshot-6.png +0 -0
  12. assets/screenshot-7.png +0 -0
  13. assets/screenshot-8.png +0 -0
  14. assets/screenshot-9.png +0 -0
  15. tags/5.3.1.1/SECURITY.md +3 -0
  16. tags/5.3.1.1/admin/ajax-actions.php +143 -0
  17. {admin → tags/5.3.1.1/admin}/css/admin-widgets.css +0 -0
  18. tags/5.3.1.1/admin/css/gadwp.css +1 -0
  19. {admin → tags/5.3.1.1/admin}/css/item-reports.css +0 -0
  20. {admin → tags/5.3.1.1/admin}/images/clicky.png +0 -0
  21. {admin → tags/5.3.1.1/admin}/images/gadwp-icon.png +0 -0
  22. {admin → tags/5.3.1.1/admin}/images/google-analytics-dashboard.png +0 -0
  23. {admin → tags/5.3.1.1/admin}/images/help.png +0 -0
  24. {admin → tags/5.3.1.1/admin}/images/mcdn.png +0 -0
  25. {admin → tags/5.3.1.1/admin}/images/ssl.png +0 -0
  26. {admin → tags/5.3.1.1/admin}/images/star.png +0 -0
  27. {admin → tags/5.3.1.1/admin}/images/wp.png +0 -0
  28. tags/5.3.1.1/admin/item-reports.php +56 -0
  29. {admin → tags/5.3.1.1/admin}/js/settings.js +0 -0
  30. {admin → tags/5.3.1.1/admin}/js/ui.js +0 -0
  31. {admin → tags/5.3.1.1/admin}/js/wp-color-picker-script.js +0 -0
  32. tags/5.3.1.1/admin/settings.php +1901 -0
  33. tags/5.3.1.1/admin/setup.php +378 -0
  34. tags/5.3.1.1/admin/views/access-code.php +36 -0
  35. tags/5.3.1.1/admin/widgets.php +65 -0
  36. tags/5.3.1.1/common/ajax-actions.php +42 -0
  37. tags/5.3.1.1/common/js/reports5.js +1 -0
  38. {common → tags/5.3.1.1/common}/nprogress/nprogress.css +0 -0
  39. {common → tags/5.3.1.1/common}/nprogress/nprogress.js +0 -0
  40. {common → tags/5.3.1.1/common}/realtime/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  41. {common → tags/5.3.1.1/common}/realtime/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  42. {common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  43. {common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  44. {common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  45. {common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  46. {common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  47. {common → tags/5.3.1.1/common}/realtime/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  48. {common → tags/5.3.1.1/common}/realtime/images/ui-icons_222222_256x240.png +0 -0
  49. {common → tags/5.3.1.1/common}/realtime/images/ui-icons_2e83ff_256x240.png +0 -0
  50. {common → tags/5.3.1.1/common}/realtime/images/ui-icons_454545_256x240.png +0 -0
  51. {common → tags/5.3.1.1/common}/realtime/images/ui-icons_888888_256x240.png +0 -0
  52. {common → tags/5.3.1.1/common}/realtime/images/ui-icons_cd0a0a_256x240.png +0 -0
  53. tags/5.3.1.1/common/realtime/jquery.ui.tooltip.html.css +3 -0
  54. {common → tags/5.3.1.1/common}/realtime/jquery.ui.tooltip.html.js +0 -0
  55. tags/5.3.1.1/config.php +456 -0
  56. tags/5.3.1.1/front/ajax-actions.php +157 -0
  57. {front → tags/5.3.1.1/front}/css/item-reports.css +0 -0
  58. {front → tags/5.3.1.1/front}/css/widgets.css +0 -0
  59. tags/5.3.1.1/front/item-reports.php +38 -0
  60. {front → tags/5.3.1.1/front}/js/tracking-analytics-events.js +0 -0
  61. {front → tags/5.3.1.1/front}/js/tracking-scrolldepth.js +0 -0
  62. {front → tags/5.3.1.1/front}/js/widgets.js +0 -0
  63. tags/5.3.1.1/front/setup.php +133 -0
  64. tags/5.3.1.1/front/tracking-analytics.php +775 -0
  65. tags/5.3.1.1/front/tracking-tagmanager.php +177 -0
  66. tags/5.3.1.1/front/tracking.php +66 -0
  67. tags/5.3.1.1/front/views/analytics-amp-clientidapi.php +11 -0
  68. tags/5.3.1.1/front/views/analytics-amp-code.php +14 -0
  69. tags/5.3.1.1/front/views/analytics-code.php +40 -0
  70. tags/5.3.1.1/front/views/analytics-optout-code.php +26 -0
  71. tags/5.3.1.1/front/views/optimize-code.php +21 -0
  72. tags/5.3.1.1/front/views/tagmanager-amp-code.php +14 -0
  73. tags/5.3.1.1/front/views/tagmanager-code.php +24 -0
  74. tags/5.3.1.1/front/widgets.php +195 -0
  75. tags/5.3.1.1/gadwp.php +272 -0
  76. tags/5.3.1.1/install/install.php +190 -0
  77. tags/5.3.1.1/install/uninstall.php +34 -0
  78. tags/5.3.1.1/readme.txt +240 -0
  79. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  80. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  81. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  82. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  83. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  84. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  85. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  86. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  87. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_222222_256x240.png +0 -0
  88. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_2e83ff_256x240.png +0 -0
  89. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_454545_256x240.png +0 -0
  90. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_888888_256x240.png +0 -0
  91. {realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_cd0a0a_256x240.png +0 -0
  92. tags/5.3.1.1/realtime/jquery/jquery.ui.tooltip.html.css +3 -0
  93. {realtime → tags/5.3.1.1/realtime}/jquery/jquery.ui.tooltip.html.js +0 -0
  94. tags/5.3.1.1/tools/gapi.php +961 -0
  95. tags/5.3.1.1/tools/iso3166.php +255 -0
  96. {tools → tags/5.3.1.1/tools}/src/Deconf/Auth/Abstract.php +0 -0
  97. {tools → tags/5.3.1.1/tools}/src/Deconf/Auth/AppIdentity.php +0 -0
  98. {tools → tags/5.3.1.1/tools}/src/Deconf/Auth/AssertionCredentials.php +0 -0
  99. {tools → tags/5.3.1.1/tools}/src/Deconf/Auth/ComputeEngine.php +0 -0
  100. tags/5.3.1.1/tools/src/Deconf/Auth/Exception.php +24 -0
  101. {tools → tags/5.3.1.1/tools}/src/Deconf/Auth/LoginTicket.php +0 -0
  102. {tools → tags/5.3.1.1/tools}/src/Deconf/Auth/OAuth2.php +0 -0
  103. {tools → tags/5.3.1.1/tools}/src/Deconf/Auth/Simple.php +0 -0
  104. {tools → tags/5.3.1.1/tools}/src/Deconf/Cache/Abstract.php +0 -0
  105. {tools → tags/5.3.1.1/tools}/src/Deconf/Cache/Apc.php +0 -0
  106. tags/5.3.1.1/tools/src/Deconf/Cache/Exception.php +24 -0
  107. {tools → tags/5.3.1.1/tools}/src/Deconf/Cache/File.php +0 -0
  108. {tools → tags/5.3.1.1/tools}/src/Deconf/Cache/Memcache.php +0 -0
  109. {tools → tags/5.3.1.1/tools}/src/Deconf/Cache/Null.php +0 -0
  110. {tools → tags/5.3.1.1/tools}/src/Deconf/Client.php +0 -0
  111. {tools → tags/5.3.1.1/tools}/src/Deconf/Collection.php +0 -0
  112. {tools → tags/5.3.1.1/tools}/src/Deconf/Config.php +0 -0
  113. tags/5.3.1.1/tools/src/Deconf/Exception.php +20 -0
  114. {tools → tags/5.3.1.1/tools}/src/Deconf/Http/Batch.php +0 -0
  115. {tools → tags/5.3.1.1/tools}/src/Deconf/Http/CacheParser.php +0 -0
  116. {tools → tags/5.3.1.1/tools}/src/Deconf/Http/MediaFileUpload.php +0 -0
  117. {tools → tags/5.3.1.1/tools}/src/Deconf/Http/REST.php +0 -0
  118. {tools → tags/5.3.1.1/tools}/src/Deconf/Http/Request.php +0 -0
  119. tags/5.3.1.1/tools/src/Deconf/IO/Abstract.php +343 -0
  120. {tools → tags/5.3.1.1/tools}/src/Deconf/IO/Curl.php +0 -0
  121. tags/5.3.1.1/tools/src/Deconf/IO/Exception.php +69 -0
  122. tags/5.3.1.1/tools/src/Deconf/IO/Stream.php +246 -0
  123. {tools → tags/5.3.1.1/tools}/src/Deconf/IO/cacerts.pem +0 -0
  124. {tools → tags/5.3.1.1/tools}/src/Deconf/Logger/Abstract.php +0 -0
  125. {tools → tags/5.3.1.1/tools}/src/Deconf/Logger/Exception.php +0 -0
  126. {tools → tags/5.3.1.1/tools}/src/Deconf/Logger/File.php +0 -0
  127. {tools → tags/5.3.1.1/tools}/src/Deconf/Logger/Null.php +0 -0
  128. {tools → tags/5.3.1.1/tools}/src/Deconf/Logger/Psr.php +0 -0
  129. {tools → tags/5.3.1.1/tools}/src/Deconf/Model.php +0 -0
  130. {tools → tags/5.3.1.1/tools}/src/Deconf/Service.php +0 -0
  131. {tools → tags/5.3.1.1/tools}/src/Deconf/Service/Analytics.php +0 -0
  132. {tools → tags/5.3.1.1/tools}/src/Deconf/Service/Exception.php +0 -0
  133. {tools → tags/5.3.1.1/tools}/src/Deconf/Service/Resource.php +0 -0
  134. {tools → tags/5.3.1.1/tools}/src/Deconf/Signer/Abstract.php +0 -0
  135. {tools → tags/5.3.1.1/tools}/src/Deconf/Signer/P12.php +0 -0
  136. {tools → tags/5.3.1.1/tools}/src/Deconf/Task/Exception.php +0 -0
  137. {tools → tags/5.3.1.1/tools}/src/Deconf/Task/Retryable.php +0 -0
  138. {tools → tags/5.3.1.1/tools}/src/Deconf/Task/Runner.php +0 -0
  139. {tools → tags/5.3.1.1/tools}/src/Deconf/Utils.php +0 -0
  140. tags/5.3.1.1/tools/src/Deconf/Utils/URITemplate.php +333 -0
  141. {tools → tags/5.3.1.1/tools}/src/Deconf/Verifier/Abstract.php +0 -0
  142. {tools → tags/5.3.1.1/tools}/src/Deconf/Verifier/Pem.php +0 -0
  143. {tools → tags/5.3.1.1/tools}/src/Deconf/autoload.php +0 -0
  144. tags/5.3.1.1/tools/src/readme.txt +25 -0
  145. tags/5.3.1.1/tools/tools.php +314 -0
  146. tags/5.3.1/SECURITY.md +3 -0
  147. tags/5.3.1/admin/ajax-actions.php +143 -0
  148. tags/5.3.1/admin/css/admin-widgets.css +1 -0
  149. tags/5.3.1/admin/css/gadwp.css +1 -0
  150. tags/5.3.1/admin/css/item-reports.css +1 -0
  151. tags/5.3.1/admin/images/clicky.png +0 -0
  152. tags/5.3.1/admin/images/gadwp-icon.png +0 -0
  153. tags/5.3.1/admin/images/google-analytics-dashboard.png +0 -0
  154. tags/5.3.1/admin/images/help.png +0 -0
  155. tags/5.3.1/admin/images/mcdn.png +0 -0
  156. tags/5.3.1/admin/images/ssl.png +0 -0
  157. tags/5.3.1/admin/images/star.png +0 -0
  158. tags/5.3.1/admin/images/wp.png +0 -0
  159. tags/5.3.1/admin/item-reports.php +56 -0
  160. tags/5.3.1/admin/js/settings.js +1 -0
  161. tags/5.3.1/admin/js/ui.js +1 -0
  162. tags/5.3.1/admin/js/wp-color-picker-script.js +1 -0
  163. tags/5.3.1/admin/settings.php +1909 -0
  164. tags/5.3.1/admin/setup.php +378 -0
  165. tags/5.3.1/admin/views/access-code.php +36 -0
  166. tags/5.3.1/admin/widgets.php +65 -0
  167. tags/5.3.1/common/ajax-actions.php +42 -0
  168. tags/5.3.1/common/js/reports5.js +1 -0
  169. tags/5.3.1/common/nprogress/nprogress.css +1 -0
  170. tags/5.3.1/common/nprogress/nprogress.js +1 -0
  171. tags/5.3.1/common/realtime/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  172. tags/5.3.1/common/realtime/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  173. tags/5.3.1/common/realtime/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  174. tags/5.3.1/common/realtime/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  175. tags/5.3.1/common/realtime/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  176. tags/5.3.1/common/realtime/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  177. tags/5.3.1/common/realtime/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  178. tags/5.3.1/common/realtime/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  179. tags/5.3.1/common/realtime/images/ui-icons_222222_256x240.png +0 -0
  180. tags/5.3.1/common/realtime/images/ui-icons_2e83ff_256x240.png +0 -0
  181. tags/5.3.1/common/realtime/images/ui-icons_454545_256x240.png +0 -0
  182. tags/5.3.1/common/realtime/images/ui-icons_888888_256x240.png +0 -0
  183. tags/5.3.1/common/realtime/images/ui-icons_cd0a0a_256x240.png +0 -0
  184. tags/5.3.1/common/realtime/jquery.ui.tooltip.html.css +3 -0
  185. tags/5.3.1/common/realtime/jquery.ui.tooltip.html.js +1 -0
  186. tags/5.3.1/config.php +456 -0
  187. tags/5.3.1/front/ajax-actions.php +157 -0
  188. tags/5.3.1/front/css/item-reports.css +1 -0
  189. tags/5.3.1/front/css/widgets.css +1 -0
  190. tags/5.3.1/front/item-reports.php +38 -0
  191. tags/5.3.1/front/js/tracking-analytics-events.js +1 -0
  192. tags/5.3.1/front/js/tracking-scrolldepth.js +1 -0
  193. tags/5.3.1/front/js/widgets.js +1 -0
  194. tags/5.3.1/front/setup.php +133 -0
  195. tags/5.3.1/front/tracking-analytics.php +775 -0
  196. tags/5.3.1/front/tracking-tagmanager.php +177 -0
  197. tags/5.3.1/front/tracking.php +66 -0
  198. tags/5.3.1/front/views/analytics-amp-clientidapi.php +11 -0
  199. tags/5.3.1/front/views/analytics-amp-code.php +14 -0
  200. tags/5.3.1/front/views/analytics-code.php +40 -0
  201. tags/5.3.1/front/views/analytics-optout-code.php +26 -0
  202. tags/5.3.1/front/views/optimize-code.php +21 -0
  203. tags/5.3.1/front/views/tagmanager-amp-code.php +14 -0
  204. tags/5.3.1/front/views/tagmanager-code.php +24 -0
  205. tags/5.3.1/front/widgets.php +195 -0
  206. tags/5.3.1/gadwp.php +272 -0
  207. tags/5.3.1/install/install.php +190 -0
  208. tags/5.3.1/install/uninstall.php +34 -0
  209. tags/5.3.1/readme.txt +236 -0
  210. tags/5.3.1/realtime/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  211. tags/5.3.1/realtime/jquery/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  212. tags/5.3.1/realtime/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  213. tags/5.3.1/realtime/jquery/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  214. tags/5.3.1/realtime/jquery/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  215. tags/5.3.1/realtime/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  216. tags/5.3.1/realtime/jquery/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  217. tags/5.3.1/realtime/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  218. tags/5.3.1/realtime/jquery/images/ui-icons_222222_256x240.png +0 -0
  219. tags/5.3.1/realtime/jquery/images/ui-icons_2e83ff_256x240.png +0 -0
  220. tags/5.3.1/realtime/jquery/images/ui-icons_454545_256x240.png +0 -0
  221. tags/5.3.1/realtime/jquery/images/ui-icons_888888_256x240.png +0 -0
  222. tags/5.3.1/realtime/jquery/images/ui-icons_cd0a0a_256x240.png +0 -0
  223. tags/5.3.1/realtime/jquery/jquery.ui.tooltip.html.css +3 -0
  224. tags/5.3.1/realtime/jquery/jquery.ui.tooltip.html.js +1 -0
  225. tags/5.3.1/tools/gapi.php +961 -0
  226. tags/5.3.1/tools/iso3166.php +255 -0
  227. tags/5.3.1/tools/src/Deconf/Auth/Abstract.php +38 -0
  228. tags/5.3.1/tools/src/Deconf/Auth/AppIdentity.php +120 -0
  229. tags/5.3.1/tools/src/Deconf/Auth/AssertionCredentials.php +136 -0
  230. tags/5.3.1/tools/src/Deconf/Auth/ComputeEngine.php +146 -0
  231. tags/5.3.1/tools/src/Deconf/Auth/Exception.php +24 -0
  232. tags/5.3.1/tools/src/Deconf/Auth/LoginTicket.php +71 -0
  233. tags/5.3.1/tools/src/Deconf/Auth/OAuth2.php +646 -0
  234. tags/5.3.1/tools/src/Deconf/Auth/Simple.php +63 -0
  235. tags/5.3.1/tools/src/Deconf/Cache/Abstract.php +53 -0
  236. tags/5.3.1/tools/src/Deconf/Cache/Apc.php +113 -0
  237. tags/5.3.1/tools/src/Deconf/Cache/Exception.php +24 -0
  238. tags/5.3.1/tools/src/Deconf/Cache/File.php +209 -0
  239. tags/5.3.1/tools/src/Deconf/Cache/Memcache.php +184 -0
  240. tags/5.3.1/tools/src/Deconf/Cache/Null.php +57 -0
  241. tags/5.3.1/tools/src/Deconf/Client.php +715 -0
  242. tags/5.3.1/tools/src/Deconf/Collection.php +101 -0
  243. tags/5.3.1/tools/src/Deconf/Config.php +456 -0
  244. tags/5.3.1/tools/src/Deconf/Exception.php +20 -0
  245. tags/5.3.1/tools/src/Deconf/Http/Batch.php +145 -0
  246. tags/5.3.1/tools/src/Deconf/Http/CacheParser.php +185 -0
  247. tags/5.3.1/tools/src/Deconf/Http/MediaFileUpload.php +341 -0
  248. tags/5.3.1/tools/src/Deconf/Http/REST.php +178 -0
  249. tags/5.3.1/tools/src/Deconf/Http/Request.php +504 -0
  250. tags/5.3.1/tools/src/Deconf/IO/Abstract.php +343 -0
  251. tags/5.3.1/tools/src/Deconf/IO/Curl.php +194 -0
  252. tags/5.3.1/tools/src/Deconf/IO/Exception.php +69 -0
  253. tags/5.3.1/tools/src/Deconf/IO/Stream.php +246 -0
  254. tags/5.3.1/tools/src/Deconf/IO/cacerts.pem +2233 -0
  255. tags/5.3.1/tools/src/Deconf/Logger/Abstract.php +221 -0
assets/banner-772x250-old.png ADDED
Binary file
assets/banner-772x250.png ADDED
Binary file
assets/icon-128x128.png ADDED
Binary file
assets/icon-256x256.png ADDED
Binary file
assets/logo.png ADDED
Binary file
assets/screenshot-1.png ADDED
Binary file
assets/screenshot-2.png ADDED
Binary file
assets/screenshot-3.png ADDED
Binary file
assets/screenshot-4.png ADDED
Binary file
assets/screenshot-5.png ADDED
Binary file
assets/screenshot-6.png ADDED
Binary file
assets/screenshot-7.png ADDED
Binary file
assets/screenshot-8.png ADDED
Binary file
assets/screenshot-9.png ADDED
Binary file
tags/5.3.1.1/SECURITY.md ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ Every day we do our best to make sure [Google Analytics Dashboard for WP (GADWP)](https://deconf.com/google-analytics-dashboard-wordpress/) is safe and secure. But we’re only human, and there’s always a chance that we missed something. That’s where you come in – find a security weakness in our plugin, report it on [HackerOne](https://hackerone.com/deconf_eb9eh), and get listed as a contributor!
2
+
3
+ To find out more about our security reports policy for the plugin [click here](https://deconf.com/security/).
tags/5.3.1.1/admin/ajax-actions.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Backend_Ajax' ) ) {
15
+
16
+ final class GADWP_Backend_Ajax {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && ( ( 1 == $this->gadwp->config->options['backend_item_reports'] ) || ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) ) {
24
+ // Items action
25
+ add_action( 'wp_ajax_gadwp_backend_item_reports', array( $this, 'ajax_item_reports' ) );
26
+ }
27
+ if ( current_user_can( 'manage_options' ) ) {
28
+ // Admin Widget action
29
+ add_action( 'wp_ajax_gadwp_dismiss_notices', array( $this, 'ajax_dismiss_notices' ) );
30
+ }
31
+ }
32
+
33
+ /**
34
+ * Ajax handler for Item Reports
35
+ *
36
+ * @return json|int
37
+ */
38
+ public function ajax_item_reports() {
39
+ if ( ! isset( $_POST['gadwp_security_backend_item_reports'] ) || ! wp_verify_nonce( $_POST['gadwp_security_backend_item_reports'], 'gadwp_backend_item_reports' ) ) {
40
+ wp_die( - 30 );
41
+ }
42
+ if ( isset( $_POST['projectId'] ) && $this->gadwp->config->options['switch_profile'] && 'false' !== $_POST['projectId'] ) {
43
+ $projectId = $_POST['projectId'];
44
+ } else {
45
+ $projectId = false;
46
+ }
47
+ $from = $_POST['from'];
48
+ $to = $_POST['to'];
49
+ $query = $_POST['query'];
50
+ if ( isset( $_POST['filter'] ) ) {
51
+ $filter_id = $_POST['filter'];
52
+ } else {
53
+ $filter_id = false;
54
+ }
55
+ if ( isset( $_POST['metric'] ) ) {
56
+ $metric = $_POST['metric'];
57
+ } else {
58
+ $metric = 'sessions';
59
+ }
60
+
61
+ if ( $filter_id && $metric == 'sessions' ) { // Sessions metric is not available for item reports
62
+ $metric = 'pageviews';
63
+ }
64
+
65
+ if ( ob_get_length() ) {
66
+ ob_clean();
67
+ }
68
+
69
+ if ( ! ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && ( ( 1 == $this->gadwp->config->options['backend_item_reports'] ) || ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) ) ) {
70
+ wp_die( - 31 );
71
+ }
72
+ if ( $this->gadwp->config->options['token'] && $this->gadwp->config->options['tableid_jail'] && $from && $to ) {
73
+ if ( null === $this->gadwp->gapi_controller ) {
74
+ $this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
75
+ }
76
+ } else {
77
+ wp_die( - 24 );
78
+ }
79
+ if ( false == $projectId ) {
80
+ $projectId = $this->gadwp->config->options['tableid_jail'];
81
+ }
82
+ $profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $projectId );
83
+ if ( isset( $profile_info[4] ) ) {
84
+ $this->gadwp->gapi_controller->timeshift = $profile_info[4];
85
+ } else {
86
+ $this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
87
+ }
88
+
89
+ if ( $filter_id ) {
90
+ $uri_parts = explode( '/', get_permalink( $filter_id ), 4 );
91
+
92
+ if ( isset( $uri_parts[3] ) ) {
93
+ $uri = '/' . $uri_parts[3];
94
+ } else {
95
+ wp_die( - 25 );
96
+ }
97
+
98
+ // allow URL correction before sending an API request
99
+ $filter = apply_filters( 'gadwp_backenditem_uri', $uri, $filter_id );
100
+
101
+ $lastchar = substr( $filter, - 1 );
102
+
103
+ if ( isset( $profile_info[6] ) && $profile_info[6] && '/' == $lastchar ) {
104
+ $filter = $filter . $profile_info[6];
105
+ }
106
+
107
+ // Encode URL
108
+ $filter = rawurlencode( rawurldecode( $filter ) );
109
+ } else {
110
+ $filter = false;
111
+ }
112
+
113
+ $queries = explode( ',', $query );
114
+
115
+ $results = array();
116
+
117
+ foreach ( $queries as $value ) {
118
+ $results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to, $filter, $metric );
119
+ }
120
+
121
+ wp_send_json( $results );
122
+ }
123
+
124
+ /**
125
+ * Ajax handler for dismissing Admin notices
126
+ *
127
+ * @return json|int
128
+ */
129
+ public function ajax_dismiss_notices() {
130
+ if ( ! isset( $_POST['gadwp_security_dismiss_notices'] ) || ! wp_verify_nonce( $_POST['gadwp_security_dismiss_notices'], 'gadwp_dismiss_notices' ) ) {
131
+ wp_die( - 30 );
132
+ }
133
+
134
+ if ( ! current_user_can( 'manage_options' ) ) {
135
+ wp_die( - 31 );
136
+ }
137
+
138
+ delete_option( 'gadwp_got_updated' );
139
+
140
+ wp_die();
141
+ }
142
+ }
143
+ }
{admin → tags/5.3.1.1/admin}/css/admin-widgets.css RENAMED
File without changes
tags/5.3.1.1/admin/css/gadwp.css ADDED
@@ -0,0 +1 @@
 
1
+ #gadwp-events,#gadwp-custom,#gadwp-advanced,#gadwp-exclude,#gadwp-config,#gadwp-tmdatalayervars,#gadwp-tmintegration,#gadwp-integration{display:none}table.gadwp-settings-options{padding-left:10px;width:100%}.gadwp-settings-options td{padding:0 5px 5px 5px}td.gadwp-settings-title,td.info{width:140px;padding-left:20px}td.gadwp-settings-title-s{width:300px}.gadwp-help{padding-left:15px}td.gadwp-settings-info{padding-bottom:15px}td.gadwp-settings-title label{font-size:1.1em}.gadwp-title{float:left;margin-right:10px;margin-top:2px;clear:left}.gadwp-desc{font-size:1em}.gadwp-top{vertical-align:top}pre.gadwp-settings-logdata{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}pre.gadwp-settings-logdata span{color:#b30000;font-weight:800}table.gadwp-settings-logdata{table-layout:fixed;width:100%}td.gadwp-settings-roles{padding-bottom:15px}#ga_speed_samplerate,#ga_user_samplerate,#ga_realtime_pages{width:50px}#gapi-access-code{color:red !important}#poststuff.gadwp h2{padding-bottom:0;font-size:19.5px;font-weight:normal;padding:0;margin:20px 0 15px 0}#poststuff.gadwp h2.nav-tab-wrapper{border-bottom:1px solid #ccc;padding-bottom:0}.button-primary.gadwp-settings-switchoo{position:relative;width:50px;float:left;border:0;padding:0;height:22px;-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}input.gadwp-settings-switchoo-checkbox{display:none}.gadwp-settings-switchoo-label{display:block;overflow:hidden;cursor:pointer;background:transparent;border:1px solid #ddd;border-radius:2px;text-shadow:none}.gadwp-settings-switchoo-inner{width:200%;margin-left:-100%;border-radius:2px;-moz-transition:margin .2s ease-in 0;-webkit-transition:margin .2s ease-in 0;-o-transition:margin .2s ease-in 0;transition:margin .2s ease-in 0}.gadwp-settings-switchoo-inner:before,.gadwp-settings-switchoo-inner:after{float:left;width:50%;font-weight:normal;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;height:22px;line-height:22px;font-size:12px;text-shadow:none}.gadwp-settings-switchoo-inner:before{content:"On";padding-left:5px;border-bottom:0}.gadwp-settings-switchoo-inner:after{content:"Off";padding-right:5px;background-color:#ddd;text-align:right}.gadwp-settings-switchoo-switch{width:22px;height:22px;background:#fff;color:#ddd;border:1px solid #ddd;border-radius:2px;position:absolute;top:0;bottom:0;right:27px;-moz-transition:all .2s ease-in 0;-webkit-transition:all .2s ease-in 0;-o-transition:all .2s ease-in 0;transition:all .2s ease-in 0}.gadwp-settings-switchoo-switch:hover{color:#aaa;border-color:#aaa}.gadwp-settings-switchoo-switch:after{margin:0;outline:0;display:inline-block;font:400 16px/16px dashicons;content:"\f228";padding:3px 0 0 3px;text-align:left;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-inner{margin-left:0}.gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-switch{right:0}.switch-desc{float:left;margin-left:10px;line-height:20px}
{admin → tags/5.3.1.1/admin}/css/item-reports.css RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/images/clicky.png RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/images/gadwp-icon.png RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/images/google-analytics-dashboard.png RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/images/help.png RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/images/mcdn.png RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/images/ssl.png RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/images/star.png RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/images/wp.png RENAMED
File without changes
tags/5.3.1.1/admin/item-reports.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Backend_Item_Reports' ) ) {
15
+
16
+ final class GADWP_Backend_Item_Reports {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && 1 == $this->gadwp->config->options['backend_item_reports'] ) {
24
+ // Add custom column in Posts List
25
+ add_filter( 'manage_posts_columns', array( $this, 'add_columns' ) );
26
+
27
+ // Populate custom column in Posts List
28
+ add_action( 'manage_posts_custom_column', array( $this, 'add_icons' ), 10, 2 );
29
+
30
+ // Add custom column in Pages List
31
+ add_filter( 'manage_pages_columns', array( $this, 'add_columns' ) );
32
+
33
+ // Populate custom column in Pages List
34
+ add_action( 'manage_pages_custom_column', array( $this, 'add_icons' ), 10, 2 );
35
+ }
36
+ }
37
+
38
+ public function add_icons( $column, $id ) {
39
+ global $wp_version;
40
+
41
+ if ( 'gadwp_stats' != $column ) {
42
+ return;
43
+ }
44
+
45
+ if ( version_compare( $wp_version, '3.8.0', '>=' ) ) {
46
+ echo '<a id="gadwp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '" class="gadwp-icon dashicons-before dashicons-chart-area">&nbsp;</a>';
47
+ } else {
48
+ echo '<a id="gadwp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '"><img class="gadwp-icon-oldwp" src="' . GADWP_URL . 'admin/images/gadwp-icon.png"</a>';
49
+ }
50
+ }
51
+
52
+ public function add_columns( $columns ) {
53
+ return array_merge( $columns, array( 'gadwp_stats' => __( 'Analytics', 'google-analytics-dashboard-for-wp' ) ) );
54
+ }
55
+ }
56
+ }
{admin → tags/5.3.1.1/admin}/js/settings.js RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/js/ui.js RENAMED
File without changes
{admin → tags/5.3.1.1/admin}/js/wp-color-picker-script.js RENAMED
File without changes
tags/5.3.1.1/admin/settings.php ADDED
@@ -0,0 +1,1901 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit();
13
+ }
14
+
15
+ final class GADWP_Settings {
16
+
17
+ private static function update_options( $who ) {
18
+ $gadwp = GADWP();
19
+ $network_settings = false;
20
+ $options = $gadwp->config->options; // Get current options
21
+ if ( isset( $_POST['options']['gadwp_hidden'] ) && isset( $_POST['options'] ) && ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) && 'Reset' != $who ) {
22
+ $new_options = $_POST['options'];
23
+ if ( 'tracking' == $who ) {
24
+ $options['ga_anonymize_ip'] = 0;
25
+ $options['ga_optout'] = 0;
26
+ $options['ga_dnt_optout'] = 0;
27
+ $options['ga_event_tracking'] = 0;
28
+ $options['ga_enhanced_links'] = 0;
29
+ $options['ga_event_precision'] = 0;
30
+ $options['ga_remarketing'] = 0;
31
+ $options['ga_event_bouncerate'] = 0;
32
+ $options['ga_crossdomain_tracking'] = 0;
33
+ $options['ga_aff_tracking'] = 0;
34
+ $options['ga_hash_tracking'] = 0;
35
+ $options['ga_formsubmit_tracking'] = 0;
36
+ $options['ga_force_ssl'] = 0;
37
+ $options['ga_pagescrolldepth_tracking'] = 0;
38
+ $options['tm_pagescrolldepth_tracking'] = 0;
39
+ $options['amp_tracking_analytics'] = 0;
40
+ $options['amp_tracking_clientidapi'] = 0;
41
+ $options['amp_tracking_tagmanager'] = 0;
42
+ $options['optimize_pagehiding'] = 0;
43
+ $options['optimize_tracking'] = 0;
44
+ $options['trackingcode_infooter'] = 0;
45
+ $options['trackingevents_infooter'] = 0;
46
+ $options['ga_with_gtag'] = 0;
47
+ if ( isset( $_POST['options']['ga_tracking_code'] ) ) {
48
+ $new_options['ga_tracking_code'] = trim( $new_options['ga_tracking_code'], "\t" );
49
+ }
50
+ if ( empty( $new_options['track_exclude'] ) ) {
51
+ $new_options['track_exclude'] = array();
52
+ }
53
+ } elseif ( 'backend' == $who ) {
54
+ $options['switch_profile'] = 0;
55
+ $options['backend_item_reports'] = 0;
56
+ $options['dashboard_widget'] = 0;
57
+ $options['backend_realtime_report'] = 0;
58
+ if ( empty( $new_options['access_back'] ) ) {
59
+ $new_options['access_back'][] = 'administrator';
60
+ }
61
+ } elseif ( 'frontend' == $who ) {
62
+ $options['frontend_item_reports'] = 0;
63
+ if ( empty( $new_options['access_front'] ) ) {
64
+ $new_options['access_front'][] = 'administrator';
65
+ }
66
+ } elseif ( 'general' == $who ) {
67
+ $options['user_api'] = 0;
68
+ if ( ! is_multisite() ) {
69
+ $options['automatic_updates_minorversion'] = 0;
70
+ }
71
+ } elseif ( 'network' == $who ) {
72
+ $options['user_api'] = 0;
73
+ $options['network_mode'] = 0;
74
+ $options['superadmin_tracking'] = 0;
75
+ $options['automatic_updates_minorversion'] = 0;
76
+ $network_settings = true;
77
+ }
78
+ $options = array_merge( $options, $new_options );
79
+ $gadwp->config->options = $options;
80
+ $gadwp->config->set_plugin_options( $network_settings );
81
+ }
82
+ return $options;
83
+ }
84
+
85
+ private static function navigation_tabs( $tabs ) {
86
+ echo '<h2 class="nav-tab-wrapper">';
87
+ foreach ( $tabs as $tab => $name ) {
88
+ echo "<a class='nav-tab' id='tab-$tab' href='#top#gadwp-$tab'>$name</a>";
89
+ }
90
+ echo '</h2>';
91
+ }
92
+
93
+ public static function frontend_settings() {
94
+ $gadwp = GADWP();
95
+ if ( ! current_user_can( 'manage_options' ) ) {
96
+ return;
97
+ }
98
+ $options = self::update_options( 'frontend' );
99
+ if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
100
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
101
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
102
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
103
+ }
104
+ }
105
+ if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) {
106
+ $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
107
+ }
108
+ ?>
109
+ <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
110
+ <div class="wrap">
111
+ <?php echo "<h2>" . __( "Google Analytics Frontend Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?><hr>
112
+ </div>
113
+ <div id="poststuff" class="gadwp">
114
+ <div id="post-body" class="metabox-holder columns-2">
115
+ <div id="post-body-content">
116
+ <div class="settings-wrapper">
117
+ <div class="inside">
118
+ <?php if (isset($message)) echo $message; ?>
119
+ <table class="gadwp-settings-options">
120
+ <tr>
121
+ <td colspan="2"><?php echo "<h2>" . __( "Permissions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
122
+ </tr>
123
+ <tr>
124
+ <td class="roles gadwp-settings-title">
125
+ <label for="access_front"><?php _e("Show stats to:", 'google-analytics-dashboard-for-wp' ); ?>
126
+ </label>
127
+ </td>
128
+ <td class="gadwp-settings-roles">
129
+ <table>
130
+ <tr>
131
+ <?php if ( ! isset( $wp_roles ) ) : ?>
132
+ <?php $wp_roles = new WP_Roles(); ?>
133
+ <?php endif; ?>
134
+ <?php $i = 0; ?>
135
+ <?php foreach ( $wp_roles->role_names as $role => $name ) : ?>
136
+ <?php if ( 'subscriber' != $role ) : ?>
137
+ <?php $i++; ?>
138
+ <td>
139
+ <label>
140
+ <input type="checkbox" name="options[access_front][]" value="<?php echo $role; ?>" <?php if ( in_array($role,$options['access_front']) || 'administrator' == $role ) echo 'checked="checked"'; if ( 'administrator' == $role ) echo 'disabled="disabled"';?> /><?php echo $name; ?>
141
+ </label>
142
+ </td>
143
+ <?php endif; ?>
144
+ <?php if ( 0 == $i % 4 ) : ?>
145
+ </tr>
146
+ <tr>
147
+ <?php endif; ?>
148
+ <?php endforeach; ?>
149
+ </table>
150
+ </td>
151
+ </tr>
152
+ <tr>
153
+ <td colspan="2" class="gadwp-settings-title">
154
+ <div class="button-primary gadwp-settings-switchoo">
155
+ <input type="checkbox" name="options[frontend_item_reports]" value="1" class="gadwp-settings-switchoo-checkbox" id="frontend_item_reports" <?php checked( $options['frontend_item_reports'], 1 ); ?>>
156
+ <label class="gadwp-settings-switchoo-label" for="frontend_item_reports">
157
+ <div class="gadwp-settings-switchoo-inner"></div>
158
+ <div class="gadwp-settings-switchoo-switch"></div>
159
+ </label>
160
+ </div>
161
+ <div class="switch-desc"><?php echo " ".__("enable web page reports on frontend", 'google-analytics-dashboard-for-wp' );?></div>
162
+ </td>
163
+ </tr>
164
+ <tr>
165
+ <td colspan="2">
166
+ <hr>
167
+ </td>
168
+ </tr>
169
+ <tr>
170
+ <td colspan="2" class="submit">
171
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
172
+ </td>
173
+ </tr>
174
+ </table>
175
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
176
+ <?php wp_nonce_field('gadwp_form','gadwp_security');?>
177
+
178
+
179
+
180
+
181
+
182
+
183
+ </form>
184
+ <?php
185
+ self::output_sidebar();
186
+ }
187
+
188
+ public static function backend_settings() {
189
+ $gadwp = GADWP();
190
+ if ( ! current_user_can( 'manage_options' ) ) {
191
+ return;
192
+ }
193
+ $options = self::update_options( 'backend' );
194
+ if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
195
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
196
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
197
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
198
+ }
199
+ }
200
+ if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) {
201
+ $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
202
+ }
203
+ ?>
204
+ <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
205
+ <div class="wrap">
206
+ <?php echo "<h2>" . __( "Google Analytics Backend Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?><hr>
207
+ </div>
208
+ <div id="poststuff" class="gadwp">
209
+ <div id="post-body" class="metabox-holder columns-2">
210
+ <div id="post-body-content">
211
+ <div class="settings-wrapper">
212
+ <div class="inside">
213
+ <?php if (isset($message)) echo $message; ?>
214
+ <table class="gadwp-settings-options">
215
+ <tr>
216
+ <td colspan="2"><?php echo "<h2>" . __( "Permissions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
217
+ </tr>
218
+ <tr>
219
+ <td class="roles gadwp-settings-title">
220
+ <label for="access_back"><?php _e("Show stats to:", 'google-analytics-dashboard-for-wp' ); ?>
221
+ </label>
222
+ </td>
223
+ <td class="gadwp-settings-roles">
224
+ <table>
225
+ <tr>
226
+ <?php if ( ! isset( $wp_roles ) ) : ?>
227
+ <?php $wp_roles = new WP_Roles(); ?>
228
+ <?php endif; ?>
229
+ <?php $i = 0; ?>
230
+ <?php foreach ( $wp_roles->role_names as $role => $name ) : ?>
231
+ <?php if ( 'subscriber' != $role ) : ?>
232
+ <?php $i++; ?>
233
+ <td>
234
+ <label>
235
+ <input type="checkbox" name="options[access_back][]" value="<?php echo $role; ?>" <?php if ( in_array($role,$options['access_back']) || 'administrator' == $role ) echo 'checked="checked"'; if ( 'administrator' == $role ) echo 'disabled="disabled"';?> /> <?php echo $name; ?>
236
+ </label>
237
+ </td>
238
+ <?php endif; ?>
239
+ <?php if ( 0 == $i % 4 ) : ?>
240
+ </tr>
241
+ <tr>
242
+ <?php endif; ?>
243
+ <?php endforeach; ?>
244
+
245
+
246
+
247
+
248
+
249
+
250
+ </table>
251
+ </td>
252
+ </tr>
253
+ <tr>
254
+ <td colspan="2" class="gadwp-settings-title">
255
+ <div class="button-primary gadwp-settings-switchoo">
256
+ <input type="checkbox" name="options[switch_profile]" value="1" class="gadwp-settings-switchoo-checkbox" id="switch_profile" <?php checked( $options['switch_profile'], 1 ); ?>>
257
+ <label class="gadwp-settings-switchoo-label" for="switch_profile">
258
+ <div class="gadwp-settings-switchoo-inner"></div>
259
+ <div class="gadwp-settings-switchoo-switch"></div>
260
+ </label>
261
+ </div>
262
+ <div class="switch-desc"><?php _e ( "enable Switch View functionality", 'google-analytics-dashboard-for-wp' );?></div>
263
+ </td>
264
+ </tr>
265
+ <tr>
266
+ <td colspan="2" class="gadwp-settings-title">
267
+ <div class="button-primary gadwp-settings-switchoo">
268
+ <input type="checkbox" name="options[backend_item_reports]" value="1" class="gadwp-settings-switchoo-checkbox" id="backend_item_reports" <?php checked( $options['backend_item_reports'], 1 ); ?>>
269
+ <label class="gadwp-settings-switchoo-label" for="backend_item_reports">
270
+ <div class="gadwp-settings-switchoo-inner"></div>
271
+ <div class="gadwp-settings-switchoo-switch"></div>
272
+ </label>
273
+ </div>
274
+ <div class="switch-desc"><?php _e ( "enable reports on Posts List and Pages List", 'google-analytics-dashboard-for-wp' );?></div>
275
+ </td>
276
+ </tr>
277
+ <tr>
278
+ <td colspan="2" class="gadwp-settings-title">
279
+ <div class="button-primary gadwp-settings-switchoo">
280
+ <input type="checkbox" name="options[dashboard_widget]" value="1" class="gadwp-settings-switchoo-checkbox" id="dashboard_widget" <?php checked( $options['dashboard_widget'], 1 ); ?>>
281
+ <label class="gadwp-settings-switchoo-label" for="dashboard_widget">
282
+ <div class="gadwp-settings-switchoo-inner"></div>
283
+ <div class="gadwp-settings-switchoo-switch"></div>
284
+ </label>
285
+ </div>
286
+ <div class="switch-desc"><?php _e ( "enable the main Dashboard Widget", 'google-analytics-dashboard-for-wp' );?></div>
287
+ </td>
288
+ </tr>
289
+ <tr>
290
+ <td colspan="2">
291
+ <hr><?php echo "<h2>" . __( "Real-Time Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
292
+ </tr>
293
+ <?php if ( $options['user_api'] ) : ?>
294
+ <tr>
295
+ <td colspan="2" class="gadwp-settings-title">
296
+ <div class="button-primary gadwp-settings-switchoo">
297
+ <input type="checkbox" name="options[backend_realtime_report]" value="1" class="gadwp-settings-switchoo-checkbox" id="backend_realtime_report" <?php checked( $options['backend_realtime_report'], 1 ); ?>>
298
+ <label class="gadwp-settings-switchoo-label" for="backend_realtime_report">
299
+ <div class="gadwp-settings-switchoo-inner"></div>
300
+ <div class="gadwp-settings-switchoo-switch"></div>
301
+ </label>
302
+ </div>
303
+ <div class="switch-desc"><?php _e ( "enable Real-Time report (requires access to Real-Time Reporting API)", 'google-analytics-dashboard-for-wp' );?></div>
304
+ </td>
305
+ </tr>
306
+ <?php endif; ?>
307
+ <tr>
308
+ <td colspan="2" class="gadwp-settings-title"> <?php _e("Maximum number of pages to display on real-time tab:", 'google-analytics-dashboard-for-wp'); ?>
309
+ <input type="number" name="options[ga_realtime_pages]" id="ga_realtime_pages" value="<?php echo (int)$options['ga_realtime_pages']; ?>" size="3">
310
+ </td>
311
+ </tr>
312
+ <tr>
313
+ <td colspan="2">
314
+ <hr><?php echo "<h2>" . __( "Location Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
315
+ </tr>
316
+ <tr>
317
+ <td colspan="2" class="gadwp-settings-title">
318
+ <?php echo __("Target Geo Map to country:", 'google-analytics-dashboard-for-wp'); ?>
319
+ <input type="text" style="text-align: center;" name="options[ga_target_geomap]" value="<?php echo esc_attr($options['ga_target_geomap']); ?>" size="3">
320
+ </td>
321
+ </tr>
322
+ <tr>
323
+ <td colspan="2" class="gadwp-settings-title">
324
+ <?php echo __("Maps API Key:", 'google-analytics-dashboard-for-wp'); ?>
325
+ <input type="text" style="text-align: center;" name="options[maps_api_key]" value="<?php echo esc_attr($options['maps_api_key']); ?>" size="50">
326
+ </td>
327
+ </tr>
328
+ <tr>
329
+ <td colspan="2">
330
+ <hr><?php echo "<h2>" . __( "404 Errors Report", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
331
+ </tr>
332
+ <tr>
333
+ <td colspan="2" class="gadwp-settings-title">
334
+ <?php echo __("404 Page Title contains:", 'google-analytics-dashboard-for-wp'); ?>
335
+ <input type="text" style="text-align: center;" name="options[pagetitle_404]" value="<?php echo esc_attr($options['pagetitle_404']); ?>" size="20">
336
+ </td>
337
+ </tr>
338
+ <tr>
339
+ <td colspan="2">
340
+ <hr>
341
+ </td>
342
+ </tr>
343
+ <tr>
344
+ <td colspan="2" class="submit">
345
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
346
+ </td>
347
+ </tr>
348
+ </table>
349
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
350
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
351
+
352
+
353
+
354
+
355
+
356
+
357
+ </form>
358
+ <?php
359
+ self::output_sidebar();
360
+ }
361
+
362
+ public static function tracking_settings() {
363
+ $gadwp = GADWP();
364
+
365
+ if ( ! current_user_can( 'manage_options' ) ) {
366
+ return;
367
+ }
368
+ $options = self::update_options( 'tracking' );
369
+ if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
370
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
371
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
372
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
373
+ }
374
+ }
375
+ if ( ! $gadwp->config->options['tableid_jail'] ) {
376
+ $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
377
+ }
378
+ ?>
379
+ <form name="gadwp_form" method="post" action="<?php esc_url($_SERVER['REQUEST_URI']); ?>">
380
+ <div class="wrap">
381
+ <?php echo "<h2>" . __( "Google Analytics Tracking Code", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
382
+ </div>
383
+ <div id="poststuff" class="gadwp">
384
+ <div id="post-body" class="metabox-holder columns-2">
385
+ <div id="post-body-content">
386
+ <div class="settings-wrapper">
387
+ <div class="inside">
388
+ <?php if ( 'universal' == $options['tracking_type'] ) :?>
389
+ <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ), 'events' => __( "Events Tracking", 'google-analytics-dashboard-for-wp' ), 'custom' => __( "Custom Definitions", 'google-analytics-dashboard-for-wp' ), 'exclude' => __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ), 'advanced' => __( "Advanced Settings", 'google-analytics-dashboard-for-wp' ), 'integration' => __( "Integration", 'google-analytics-dashboard-for-wp' ) );?>
390
+ <?php elseif ( 'tagmanager' == $options['tracking_type'] ) :?>
391
+ <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ), 'tmdatalayervars' => __( "DataLayer Variables", 'google-analytics-dashboard-for-wp' ), 'exclude' => __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ), 'tmintegration' => __( "Integration", 'google-analytics-dashboard-for-wp' ) );?>
392
+ <?php else :?>
393
+ <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ) );?>
394
+ <?php endif; ?>
395
+ <?php self::navigation_tabs( $tabs ); ?>
396
+ <?php if ( isset( $message ) ) : ?>
397
+ <?php echo $message; ?>
398
+ <?php endif; ?>
399
+ <div id="gadwp-basic">
400
+ <table class="gadwp-settings-options">
401
+ <tr>
402
+ <td colspan="2"><?php echo "<h2>" . __( "Tracking Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
403
+ </tr>
404
+ <tr>
405
+ <td class="gadwp-settings-title">
406
+ <label for="tracking_type"><?php _e("Tracking Type:", 'google-analytics-dashboard-for-wp' ); ?>
407
+ </label>
408
+ </td>
409
+ <td>
410
+ <select id="tracking_type" name="options[tracking_type]" onchange="this.form.submit()">
411
+ <option value="universal" <?php selected( $options['tracking_type'], 'universal' ); ?>><?php _e("Analytics", 'google-analytics-dashboard-for-wp');?></option>
412
+ <option value="tagmanager" <?php selected( $options['tracking_type'], 'tagmanager' ); ?>><?php _e("Tag Manager", 'google-analytics-dashboard-for-wp');?></option>
413
+ <option value="disabled" <?php selected( $options['tracking_type'], 'disabled' ); ?>><?php _e("Disabled", 'google-analytics-dashboard-for-wp');?></option>
414
+ </select>
415
+ </td>
416
+ </tr>
417
+ <?php if ( 'universal' == $options['tracking_type'] ) : ?>
418
+ <tr>
419
+ <td class="gadwp-settings-title"></td>
420
+ <td>
421
+ <?php $profile_info = GADWP_Tools::get_selected_profile($gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail']); ?>
422
+ <?php echo '<pre>' . __("View Name:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[0]) . "<br />" . __("Tracking ID:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[2]) . "<br />" . __("Default URL:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[3]) . "<br />" . __("Time Zone:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[5]) . '</pre>';?>
423
+ </td>
424
+ </tr>
425
+ <tr>
426
+ <td colspan="2" class="gadwp-settings-title">
427
+ <div class="button-primary gadwp-settings-switchoo">
428
+ <input type="checkbox" name="options[ga_with_gtag]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_with_gtag" <?php checked( $options['ga_with_gtag'], 1 ); ?>>
429
+ <label class="gadwp-settings-switchoo-label" for="ga_with_gtag">
430
+ <div class="gadwp-settings-switchoo-inner"></div>
431
+ <div class="gadwp-settings-switchoo-switch"></div>
432
+ </label>
433
+ </div>
434
+ <div class="switch-desc"><?php echo " ".__("use global site tag gtag.js (not recommended)", 'google-analytics-dashboard-for-wp' );?></div>
435
+ </td>
436
+ </tr>
437
+ <?php elseif ( 'tagmanager' == $options['tracking_type'] ) : ?>
438
+ <tr>
439
+ <td class="gadwp-settings-title">
440
+ <label for="tracking_type"><?php _e("Web Container ID:", 'google-analytics-dashboard-for-wp' ); ?>
441
+ </label>
442
+ </td>
443
+ <td>
444
+ <input type="text" name="options[web_containerid]" value="<?php echo esc_attr($options['web_containerid']); ?>" size="15">
445
+ </td>
446
+ </tr>
447
+ <?php endif; ?>
448
+ <tr>
449
+ <td class="gadwp-settings-title">
450
+ <label for="trackingcode_infooter"><?php _e("Code Placement:", 'google-analytics-dashboard-for-wp' ); ?>
451
+ </label>
452
+ </td>
453
+ <td>
454
+ <select id="trackingcode_infooter" name="options[trackingcode_infooter]">
455
+ <option value="0" <?php selected( $options['trackingcode_infooter'], 0 ); ?>><?php _e("HTML Head", 'google-analytics-dashboard-for-wp');?></option>
456
+ <option value="1" <?php selected( $options['trackingcode_infooter'], 1 ); ?>><?php _e("HTML Body", 'google-analytics-dashboard-for-wp');?></option>
457
+ </select>
458
+ </td>
459
+ </tr>
460
+ </table>
461
+ </div>
462
+ <div id="gadwp-events">
463
+ <table class="gadwp-settings-options">
464
+ <tr>
465
+ <td colspan="2"><?php echo "<h2>" . __( "Events Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
466
+ </tr>
467
+ <tr>
468
+ <td colspan="2" class="gadwp-settings-title">
469
+ <div class="button-primary gadwp-settings-switchoo">
470
+ <input type="checkbox" name="options[ga_event_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_event_tracking" <?php checked( $options['ga_event_tracking'], 1 ); ?>>
471
+ <label class="gadwp-settings-switchoo-label" for="ga_event_tracking">
472
+ <div class="gadwp-settings-switchoo-inner"></div>
473
+ <div class="gadwp-settings-switchoo-switch"></div>
474
+ </label>
475
+ </div>
476
+ <div class="switch-desc"><?php echo " ".__("track downloads, mailto, telephone and outbound links", 'google-analytics-dashboard-for-wp' ); ?></div>
477
+ </td>
478
+ </tr>
479
+ <tr>
480
+ <td colspan="2" class="gadwp-settings-title">
481
+ <div class="button-primary gadwp-settings-switchoo">
482
+ <input type="checkbox" name="options[ga_aff_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_aff_tracking" <?php checked( $options['ga_aff_tracking'], 1 ); ?>>
483
+ <label class="gadwp-settings-switchoo-label" for="ga_aff_tracking">
484
+ <div class="gadwp-settings-switchoo-inner"></div>
485
+ <div class="gadwp-settings-switchoo-switch"></div>
486
+ </label>
487
+ </div>
488
+ <div class="switch-desc"><?php echo " ".__("track affiliate links", 'google-analytics-dashboard-for-wp' ); ?></div>
489
+ </td>
490
+ </tr>
491
+ <tr>
492
+ <td colspan="2" class="gadwp-settings-title">
493
+ <div class="button-primary gadwp-settings-switchoo">
494
+ <input type="checkbox" name="options[ga_hash_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_hash_tracking" <?php checked( $options['ga_hash_tracking'], 1 ); ?>>
495
+ <label class="gadwp-settings-switchoo-label" for="ga_hash_tracking">
496
+ <div class="gadwp-settings-switchoo-inner"></div>
497
+ <div class="gadwp-settings-switchoo-switch"></div>
498
+ </label>
499
+ </div>
500
+ <div class="switch-desc"><?php echo " ".__("track fragment identifiers, hashmarks (#) in URI links", 'google-analytics-dashboard-for-wp' ); ?></div>
501
+ </td>
502
+ </tr>
503
+ <tr>
504
+ <td colspan="2" class="gadwp-settings-title">
505
+ <div class="button-primary gadwp-settings-switchoo">
506
+ <input type="checkbox" name="options[ga_formsubmit_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_formsubmit_tracking" <?php checked( $options['ga_formsubmit_tracking'], 1 ); ?>>
507
+ <label class="gadwp-settings-switchoo-label" for="ga_formsubmit_tracking">
508
+ <div class="gadwp-settings-switchoo-inner"></div>
509
+ <div class="gadwp-settings-switchoo-switch"></div>
510
+ </label>
511
+ </div>
512
+ <div class="switch-desc"><?php echo " ".__("track form submit actions", 'google-analytics-dashboard-for-wp' ); ?></div>
513
+ </td>
514
+ </tr>
515
+ <tr>
516
+ <td colspan="2" class="gadwp-settings-title">
517
+ <div class="button-primary gadwp-settings-switchoo">
518
+ <input type="checkbox" name="options[ga_pagescrolldepth_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_pagescrolldepth_tracking" <?php checked( $options['ga_pagescrolldepth_tracking'], 1 ); ?>>
519
+ <label class="gadwp-settings-switchoo-label" for="ga_pagescrolldepth_tracking">
520
+ <div class="gadwp-settings-switchoo-inner"></div>
521
+ <div class="gadwp-settings-switchoo-switch"></div>
522
+ </label>
523
+ </div>
524
+ <div class="switch-desc"><?php echo " ".__("track page scrolling depth", 'google-analytics-dashboard-for-wp' ); ?></div>
525
+ </td>
526
+ </tr>
527
+ <tr>
528
+ <td class="gadwp-settings-title">
529
+ <label for="ga_event_downloads"><?php _e("Downloads Regex:", 'google-analytics-dashboard-for-wp'); ?>
530
+ </label>
531
+ </td>
532
+ <td>
533
+ <input type="text" id="ga_event_downloads" name="options[ga_event_downloads]" value="<?php echo esc_attr($options['ga_event_downloads']); ?>" size="50">
534
+ </td>
535
+ </tr>
536
+ <tr>
537
+ <td class="gadwp-settings-title">
538
+ <label for="ga_event_affiliates"><?php _e("Affiliates Regex:", 'google-analytics-dashboard-for-wp'); ?>
539
+ </label>
540
+ </td>
541
+ <td>
542
+ <input type="text" id="ga_event_affiliates" name="options[ga_event_affiliates]" value="<?php echo esc_attr($options['ga_event_affiliates']); ?>" size="50">
543
+ </td>
544
+ </tr>
545
+ <tr>
546
+ <td class="gadwp-settings-title">
547
+ <label for="trackingevents_infooter"><?php _e("Code Placement:", 'google-analytics-dashboard-for-wp' ); ?>
548
+ </label>
549
+ </td>
550
+ <td>
551
+ <select id="trackingevents_infooter" name="options[trackingevents_infooter]">
552
+ <option value="0" <?php selected( $options['trackingevents_infooter'], 0 ); ?>><?php _e("HTML Head", 'google-analytics-dashboard-for-wp');?></option>
553
+ <option value="1" <?php selected( $options['trackingevents_infooter'], 1 ); ?>><?php _e("HTML Body", 'google-analytics-dashboard-for-wp');?></option>
554
+ </select>
555
+ </td>
556
+ </tr>
557
+ </table>
558
+ </div>
559
+ <div id="gadwp-custom">
560
+ <table class="gadwp-settings-options">
561
+ <tr>
562
+ <td colspan="2"><?php echo "<h2>" . __( "Custom Dimensions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
563
+ </tr>
564
+ <tr>
565
+ <td class="gadwp-settings-title">
566
+ <label for="ga_author_dimindex"><?php _e("Authors:", 'google-analytics-dashboard-for-wp' ); ?>
567
+ </label>
568
+ </td>
569
+ <td>
570
+ <select id="ga_author_dimindex" name="options[ga_author_dimindex]">
571
+ <?php for ($i=0;$i<21;$i++) : ?>
572
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_author_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
573
+ <?php endfor; ?>
574
+ </select>
575
+ </td>
576
+ </tr>
577
+ <tr>
578
+ <td class="gadwp-settings-title">
579
+ <label for="ga_pubyear_dimindex"><?php _e("Publication Year:", 'google-analytics-dashboard-for-wp' ); ?>
580
+ </label>
581
+ </td>
582
+ <td>
583
+ <select id="ga_pubyear_dimindex" name="options[ga_pubyear_dimindex]">
584
+ <?php for ($i=0;$i<21;$i++) : ?>
585
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_pubyear_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
586
+ <?php endfor; ?>
587
+ </select>
588
+ </td>
589
+ </tr>
590
+ <tr>
591
+ <td class="gadwp-settings-title">
592
+ <label for="ga_pubyearmonth_dimindex"><?php _e("Publication Month:", 'google-analytics-dashboard-for-wp' ); ?>
593
+ </label>
594
+ </td>
595
+ <td>
596
+ <select id="ga_pubyearmonth_dimindex" name="options[ga_pubyearmonth_dimindex]">
597
+ <?php for ($i=0;$i<21;$i++) : ?>
598
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_pubyearmonth_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
599
+ <?php endfor; ?>
600
+ </select>
601
+ </td>
602
+ </tr>
603
+ <tr>
604
+ <td class="gadwp-settings-title">
605
+ <label for="ga_category_dimindex"><?php _e("Categories:", 'google-analytics-dashboard-for-wp' ); ?>
606
+ </label>
607
+ </td>
608
+ <td>
609
+ <select id="ga_category_dimindex" name="options[ga_category_dimindex]">
610
+ <?php for ($i=0;$i<21;$i++) : ?>
611
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_category_dimindex'], $i ); ?>><?php echo 0 == $i ? 'Disabled':'dimension '.$i; ?></option>
612
+ <?php endfor; ?>
613
+ </select>
614
+ </td>
615
+ </tr>
616
+ <tr>
617
+ <td class="gadwp-settings-title">
618
+ <label for="ga_user_dimindex"><?php _e("User Type:", 'google-analytics-dashboard-for-wp' ); ?>
619
+ </label>
620
+ </td>
621
+ <td>
622
+ <select id="ga_user_dimindex" name="options[ga_user_dimindex]">
623
+ <?php for ($i=0;$i<21;$i++) : ?>
624
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_user_dimindex'], $i ); ?>><?php echo 0 == $i ? 'Disabled':'dimension '.$i; ?></option>
625
+ <?php endfor; ?>
626
+ </select>
627
+ </td>
628
+ </tr>
629
+ <tr>
630
+ <td class="gadwp-settings-title">
631
+ <label for="ga_tag_dimindex"><?php _e("Tags:", 'google-analytics-dashboard-for-wp' ); ?>
632
+ </label>
633
+ </td>
634
+ <td>
635
+ <select id="ga_tag_dimindex" name="options[ga_tag_dimindex]">
636
+ <?php for ($i=0;$i<21;$i++) : ?>
637
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_tag_dimindex'], $i ); ?>><?php echo 0 == $i ? 'Disabled':'dimension '.$i; ?></option>
638
+ <?php endfor; ?>
639
+ </select>
640
+ </td>
641
+ </tr>
642
+ </table>
643
+ </div>
644
+ <div id="gadwp-tmdatalayervars">
645
+ <table class="gadwp-settings-options">
646
+ <tr>
647
+ <td colspan="2"><?php echo "<h2>" . __( "Main Variables", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
648
+ </tr>
649
+ <tr>
650
+ <td class="gadwp-settings-title">
651
+ <label for="tm_author_var"><?php _e("Authors:", 'google-analytics-dashboard-for-wp' ); ?>
652
+ </label>
653
+ </td>
654
+ <td>
655
+ <select id="tm_author_var" name="options[tm_author_var]">
656
+ <option value="1" <?php selected( $options['tm_author_var'], 1 ); ?>>gadwpAuthor</option>
657
+ <option value="0" <?php selected( $options['tm_author_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
658
+ </select>
659
+ </td>
660
+ </tr>
661
+ <tr>
662
+ <td class="gadwp-settings-title">
663
+ <label for="tm_pubyear_var"><?php _e("Publication Year:", 'google-analytics-dashboard-for-wp' ); ?>
664
+ </label>
665
+ </td>
666
+ <td>
667
+ <select id="tm_pubyear_var" name="options[tm_pubyear_var]">
668
+ <option value="1" <?php selected( $options['tm_pubyear_var'], 1 ); ?>>gadwpPublicationYear</option>
669
+ <option value="0" <?php selected( $options['tm_pubyear_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
670
+ </select>
671
+ </td>
672
+ </tr>
673
+ <tr>
674
+ <td class="gadwp-settings-title">
675
+ <label for="tm_pubyearmonth_var"><?php _e("Publication Month:", 'google-analytics-dashboard-for-wp' ); ?>
676
+ </label>
677
+ </td>
678
+ <td>
679
+ <select id="tm_pubyearmonth_var" name="options[tm_pubyearmonth_var]">
680
+ <option value="1" <?php selected( $options['tm_pubyearmonth_var'], 1 ); ?>>gadwpPublicationYearMonth</option>
681
+ <option value="0" <?php selected( $options['tm_pubyearmonth_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
682
+ </select>
683
+ </td>
684
+ </tr>
685
+ <tr>
686
+ <td class="gadwp-settings-title">
687
+ <label for="tm_category_var"><?php _e("Categories:", 'google-analytics-dashboard-for-wp' ); ?>
688
+ </label>
689
+ </td>
690
+ <td>
691
+ <select id="tm_category_var" name="options[tm_category_var]">
692
+ <option value="1" <?php selected( $options['tm_category_var'], 1 ); ?>>gadwpCategory</option>
693
+ <option value="0" <?php selected( $options['tm_category_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
694
+ </select>
695
+ </td>
696
+ </tr>
697
+ <tr>
698
+ <td class="gadwp-settings-title">
699
+ <label for="tm_user_var"><?php _e("User Type:", 'google-analytics-dashboard-for-wp' ); ?>
700
+ </label>
701
+ </td>
702
+ <td>
703
+ <select id="tm_user_var" name="options[tm_user_var]">
704
+ <option value="1" <?php selected( $options['tm_user_var'], 1 ); ?>>gadwpUser</option>
705
+ <option value="0" <?php selected( $options['tm_user_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
706
+ </select>
707
+ </td>
708
+ </tr>
709
+ <tr>
710
+ <td class="gadwp-settings-title">
711
+ <label for="tm_tag_var"><?php _e("Tags:", 'google-analytics-dashboard-for-wp' ); ?>
712
+ </label>
713
+ </td>
714
+ <td>
715
+ <select id="tm_tag_var" name="options[tm_tag_var]">
716
+ <option value="1" <?php selected( $options['tm_tag_var'], 1 ); ?>>gadwpTag</option>
717
+ <option value="0" <?php selected( $options['tm_tag_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
718
+ </select>
719
+ </td>
720
+ </tr>
721
+ </table>
722
+ </div>
723
+ <div id="gadwp-advanced">
724
+ <table class="gadwp-settings-options">
725
+ <tr>
726
+ <td colspan="2"><?php echo "<h2>" . __( "Advanced Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
727
+ </tr>
728
+ <tr>
729
+ <td class="gadwp-settings-title">
730
+ <label for="ga_speed_samplerate"><?php _e("Speed Sample Rate:", 'google-analytics-dashboard-for-wp'); ?>
731
+ </label>
732
+ </td>
733
+ <td>
734
+ <input type="number" id="ga_speed_samplerate" name="options[ga_speed_samplerate]" value="<?php echo (int)($options['ga_speed_samplerate']); ?>" max="100" min="1">
735
+ %
736
+ </td>
737
+ </tr>
738
+ <tr>
739
+ <td class="gadwp-settings-title">
740
+ <label for="ga_user_samplerate"><?php _e("User Sample Rate:", 'google-analytics-dashboard-for-wp'); ?>
741
+ </label>
742
+ </td>
743
+ <td>
744
+ <input type="number" id="ga_user_samplerate" name="options[ga_user_samplerate]" value="<?php echo (int)($options['ga_user_samplerate']); ?>" max="100" min="1">
745
+ %
746
+ </td>
747
+ </tr>
748
+ <tr>
749
+ <td colspan="2" class="gadwp-settings-title">
750
+ <div class="button-primary gadwp-settings-switchoo">
751
+ <input type="checkbox" name="options[ga_anonymize_ip]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_anonymize_ip" <?php checked( $options['ga_anonymize_ip'], 1 ); ?>>
752
+ <label class="gadwp-settings-switchoo-label" for="ga_anonymize_ip">
753
+ <div class="gadwp-settings-switchoo-inner"></div>
754
+ <div class="gadwp-settings-switchoo-switch"></div>
755
+ </label>
756
+ </div>
757
+ <div class="switch-desc"><?php echo " ".__("anonymize IPs while tracking", 'google-analytics-dashboard-for-wp' );?></div>
758
+ </td>
759
+ </tr>
760
+ <tr>
761
+ <td colspan="2" class="gadwp-settings-title">
762
+ <div class="button-primary gadwp-settings-switchoo">
763
+ <input type="checkbox" name="options[ga_optout]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_optout" <?php checked( $options['ga_optout'], 1 ); ?>>
764
+ <label class="gadwp-settings-switchoo-label" for="ga_optout">
765
+ <div class="gadwp-settings-switchoo-inner"></div>
766
+ <div class="gadwp-settings-switchoo-switch"></div>
767
+ </label>
768
+ </div>
769
+ <div class="switch-desc"><?php echo " ".__("enable support for user opt-out", 'google-analytics-dashboard-for-wp' );?></div>
770
+ </td>
771
+ </tr>
772
+ <tr>
773
+ <td colspan="2" class="gadwp-settings-title">
774
+ <div class="button-primary gadwp-settings-switchoo">
775
+ <input type="checkbox" name="options[ga_dnt_optout]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_dnt_optout" <?php checked( $options['ga_dnt_optout'], 1 ); ?>>
776
+ <label class="gadwp-settings-switchoo-label" for="ga_dnt_optout">
777
+ <div class="gadwp-settings-switchoo-inner"></div>
778
+ <div class="gadwp-settings-switchoo-switch"></div>
779
+ </label>
780
+ </div>
781
+ <div class="switch-desc"> <?php _e( 'exclude tracking for users sending Do Not Track header', 'google-analytics-dashboard-for-wp' ); ?></div>
782
+ </td>
783
+ </tr>
784
+ <tr>
785
+ <td colspan="2" class="gadwp-settings-title">
786
+ <div class="button-primary gadwp-settings-switchoo">
787
+ <input type="checkbox" name="options[ga_remarketing]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_remarketing" <?php checked( $options['ga_remarketing'], 1 ); ?>>
788
+ <label class="gadwp-settings-switchoo-label" for="ga_remarketing">
789
+ <div class="gadwp-settings-switchoo-inner"></div>
790
+ <div class="gadwp-settings-switchoo-switch"></div>
791
+ </label>
792
+ </div>
793
+ <div class="switch-desc"><?php echo " ".__("enable remarketing, demographics and interests reports", 'google-analytics-dashboard-for-wp' );?></div>
794
+ </td>
795
+ </tr>
796
+ <tr>
797
+ <td colspan="2" class="gadwp-settings-title">
798
+ <div class="button-primary gadwp-settings-switchoo">
799
+ <input type="checkbox" name="options[ga_event_bouncerate]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_event_bouncerate" <?php checked( $options['ga_event_bouncerate'], 1 ); ?>>
800
+ <label class="gadwp-settings-switchoo-label" for="ga_event_bouncerate">
801
+ <div class="gadwp-settings-switchoo-inner"></div>
802
+ <div class="gadwp-settings-switchoo-switch"></div>
803
+ </label>
804
+ </div>
805
+ <div class="switch-desc"><?php echo " ".__("exclude events from bounce-rate and time on page calculation", 'google-analytics-dashboard-for-wp' );?></div>
806
+ </td>
807
+ </tr>
808
+ <tr>
809
+ <td colspan="2" class="gadwp-settings-title">
810
+ <div class="button-primary gadwp-settings-switchoo">
811
+ <input type="checkbox" name="options[ga_enhanced_links]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_enhanced_links" <?php checked( $options['ga_enhanced_links'], 1 ); ?>>
812
+ <label class="gadwp-settings-switchoo-label" for="ga_enhanced_links">
813
+ <div class="gadwp-settings-switchoo-inner"></div>
814
+ <div class="gadwp-settings-switchoo-switch"></div>
815
+ </label>
816
+ </div>
817
+ <div class="switch-desc"><?php echo " ".__("enable enhanced link attribution", 'google-analytics-dashboard-for-wp' );?></div>
818
+ </td>
819
+ </tr>
820
+ <tr>
821
+ <td colspan="2" class="gadwp-settings-title">
822
+ <div class="button-primary gadwp-settings-switchoo">
823
+ <input type="checkbox" name="options[ga_event_precision]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_event_precision" <?php checked( $options['ga_event_precision'], 1 ); ?>>
824
+ <label class="gadwp-settings-switchoo-label" for="ga_event_precision">
825
+ <div class="gadwp-settings-switchoo-inner"></div>
826
+ <div class="gadwp-settings-switchoo-switch"></div>
827
+ </label>
828
+ </div>
829
+ <div class="switch-desc"><?php echo " ".__("use hitCallback to increase event tracking accuracy", 'google-analytics-dashboard-for-wp' );?></div>
830
+ </td>
831
+ </tr>
832
+ <tr>
833
+ <td colspan="2" class="gadwp-settings-title">
834
+ <div class="button-primary gadwp-settings-switchoo">
835
+ <input type="checkbox" name="options[ga_force_ssl]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_force_ssl" <?php checked( $options['ga_force_ssl'] || $options['ga_with_gtag'], 1 ); ?> <?php disabled( $options['ga_with_gtag'], true );?>>
836
+ <label class="gadwp-settings-switchoo-label" for="ga_force_ssl">
837
+ <div class="gadwp-settings-switchoo-inner"></div>
838
+ <div class="gadwp-settings-switchoo-switch"></div>
839
+ </label>
840
+ </div>
841
+ <div class="switch-desc"><?php echo " ".__("enable Force SSL", 'google-analytics-dashboard-for-wp' );?></div>
842
+ </td>
843
+ </tr>
844
+ <tr>
845
+ <td colspan="2"><?php echo "<h2>" . __( "Cross-domain Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
846
+ </tr>
847
+ <tr>
848
+ <td colspan="2" class="gadwp-settings-title">
849
+ <div class="button-primary gadwp-settings-switchoo">
850
+ <input type="checkbox" name="options[ga_crossdomain_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_crossdomain_tracking" <?php checked( $options['ga_crossdomain_tracking'], 1 ); ?>>
851
+ <label class="gadwp-settings-switchoo-label" for="ga_crossdomain_tracking">
852
+ <div class="gadwp-settings-switchoo-inner"></div>
853
+ <div class="gadwp-settings-switchoo-switch"></div>
854
+ </label>
855
+ </div>
856
+ <div class="switch-desc"><?php echo " ".__("enable cross domain tracking", 'google-analytics-dashboard-for-wp' ); ?></div>
857
+ </td>
858
+ </tr>
859
+ <tr>
860
+ <td class="gadwp-settings-title">
861
+ <label for="ga_crossdomain_list"><?php _e("Cross Domains:", 'google-analytics-dashboard-for-wp'); ?>
862
+ </label>
863
+ </td>
864
+ <td>
865
+ <input type="text" id="ga_crossdomain_list" name="options[ga_crossdomain_list]" value="<?php echo esc_attr($options['ga_crossdomain_list']); ?>" size="50">
866
+ </td>
867
+ </tr>
868
+ <tr>
869
+ <td colspan="2"><?php echo "<h2>" . __( "Cookie Customization", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
870
+ </tr>
871
+ <tr>
872
+ <td class="gadwp-settings-title">
873
+ <label for="ga_cookiedomain"><?php _e("Cookie Domain:", 'google-analytics-dashboard-for-wp'); ?>
874
+ </label>
875
+ </td>
876
+ <td>
877
+ <input type="text" id="ga_cookiedomain" name="options[ga_cookiedomain]" value="<?php echo esc_attr($options['ga_cookiedomain']); ?>" size="50">
878
+ </td>
879
+ </tr>
880
+ <tr>
881
+ <td class="gadwp-settings-title">
882
+ <label for="ga_cookiename"><?php _e("Cookie Name:", 'google-analytics-dashboard-for-wp'); ?>
883
+ </label>
884
+ </td>
885
+ <td>
886
+ <input type="text" id="ga_cookiename" name="options[ga_cookiename]" value="<?php echo esc_attr($options['ga_cookiename']); ?>" size="50">
887
+ </td>
888
+ </tr>
889
+ <tr>
890
+ <td class="gadwp-settings-title">
891
+ <label for="ga_cookieexpires"><?php _e("Cookie Expires:", 'google-analytics-dashboard-for-wp'); ?>
892
+ </label>
893
+ </td>
894
+ <td>
895
+ <input type="text" id="ga_cookieexpires" name="options[ga_cookieexpires]" value="<?php echo esc_attr($options['ga_cookieexpires']); ?>" size="10">
896
+ <?php _e("seconds", 'google-analytics-dashboard-for-wp' ); ?>
897
+ </td>
898
+ </tr>
899
+ </table>
900
+ </div>
901
+ <div id="gadwp-integration">
902
+ <table class="gadwp-settings-options">
903
+ <tr>
904
+ <td colspan="2"><?php echo "<h2>" . __( "Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
905
+ </tr>
906
+ <tr>
907
+ <td colspan="2" class="gadwp-settings-title">
908
+ <div class="button-primary gadwp-settings-switchoo">
909
+ <input type="checkbox" name="options[amp_tracking_analytics]" value="1" class="gadwp-settings-switchoo-checkbox" id="amp_tracking_analytics" <?php checked( $options['amp_tracking_analytics'], 1 ); ?>>
910
+ <label class="gadwp-settings-switchoo-label" for="amp_tracking_analytics">
911
+ <div class="gadwp-settings-switchoo-inner"></div>
912
+ <div class="gadwp-settings-switchoo-switch"></div>
913
+ </label>
914
+ </div>
915
+ <div class="switch-desc"><?php echo " ".__("enable tracking for Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' );?></div>
916
+ </td>
917
+ </tr>
918
+ <tr>
919
+ <td colspan="2" class="gadwp-settings-title">
920
+ <div class="button-primary gadwp-settings-switchoo">
921
+ <input type="checkbox" name="options[amp_tracking_clientidapi]" value="1" class="gadwp-settings-switchoo-checkbox" id="amp_tracking_clientidapi" <?php checked( $options['amp_tracking_clientidapi'] && !$options['ga_with_gtag'], 1 ); ?> <?php disabled( $options['ga_with_gtag'], true );?>>
922
+ <label class="gadwp-settings-switchoo-label" for="amp_tracking_clientidapi">
923
+ <div class="gadwp-settings-switchoo-inner"></div>
924
+ <div class="gadwp-settings-switchoo-switch"></div>
925
+ </label>
926
+ </div>
927
+ <div class="switch-desc"><?php echo " ".__("enable Google AMP Client Id API", 'google-analytics-dashboard-for-wp' );?></div>
928
+ </td>
929
+ </tr>
930
+ <tr>
931
+ <td colspan="2"><?php echo "<h2>" . __( "Ecommerce", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
932
+ </tr>
933
+ <tr>
934
+ <td class="gadwp-settings-title">
935
+ <label for="tracking_type"><?php _e("Ecommerce Tracking:", 'google-analytics-dashboard-for-wp' ); ?>
936
+ </label>
937
+ </td>
938
+ <td>
939
+ <select id="ecommerce_mode" name="options[ecommerce_mode]" <?php disabled( $options['ga_with_gtag'], true );?>>
940
+ <option value="disabled" <?php selected( $options['ecommerce_mode'], 'disabled' ); ?>><?php _e("Disabled", 'google-analytics-dashboard-for-wp');?></option>
941
+ <option value="standard" <?php selected( $options['ecommerce_mode'], 'standard' ); ?>><?php _e("Ecommerce Plugin", 'google-analytics-dashboard-for-wp');?></option>
942
+ <option value="enhanced" <?php selected( $options['ecommerce_mode'], 'enhanced' ); selected( $options['ga_with_gtag'], true );?>><?php _e("Enhanced Ecommerce Plugin", 'google-analytics-dashboard-for-wp');?></option>
943
+ </select>
944
+ </td>
945
+ </tr>
946
+ <tr>
947
+ <td colspan="2"><?php echo "<h2>" . __( "Optimize", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
948
+ </tr>
949
+ <tr>
950
+ <td colspan="2" class="gadwp-settings-title">
951
+ <div class="button-primary gadwp-settings-switchoo">
952
+ <input type="checkbox" name="options[optimize_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="optimize_tracking" <?php checked( $options['optimize_tracking'], 1 ); ?>>
953
+ <label class="gadwp-settings-switchoo-label" for="optimize_tracking">
954
+ <div class="gadwp-settings-switchoo-inner"></div>
955
+ <div class="gadwp-settings-switchoo-switch"></div>
956
+ </label>
957
+ </div>
958
+ <div class="switch-desc"><?php echo " ".__("enable Optimize tracking", 'google-analytics-dashboard-for-wp' );?></div>
959
+ </td>
960
+ </tr>
961
+ <tr>
962
+ <td colspan="2" class="gadwp-settings-title">
963
+ <div class="button-primary gadwp-settings-switchoo">
964
+ <input type="checkbox" name="options[optimize_pagehiding]" value="1" class="gadwp-settings-switchoo-checkbox" id="optimize_pagehiding" <?php checked( $options['optimize_pagehiding'], 1 ); ?>>
965
+ <label class="gadwp-settings-switchoo-label" for="optimize_pagehiding">
966
+ <div class="gadwp-settings-switchoo-inner"></div>
967
+ <div class="gadwp-settings-switchoo-switch"></div>
968
+ </label>
969
+ </div>
970
+ <div class="switch-desc"><?php echo " ".__("enable Page Hiding support", 'google-analytics-dashboard-for-wp' );?></div>
971
+ </td>
972
+ </tr>
973
+ <tr>
974
+ <td class="gadwp-settings-title">
975
+ <label for="tracking_type"><?php _e("Container ID:", 'google-analytics-dashboard-for-wp' ); ?>
976
+ </label>
977
+ </td>
978
+ <td>
979
+ <input type="text" name="options[optimize_containerid]" value="<?php echo esc_attr($options['optimize_containerid']); ?>" size="15">
980
+ </td>
981
+ </tr>
982
+ </table>
983
+ </div>
984
+ <div id="gadwp-tmintegration">
985
+ <table class="gadwp-settings-options">
986
+ <tr>
987
+ <td colspan="2"><?php echo "<h2>" . __( "Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
988
+ </tr>
989
+ <tr>
990
+ <td colspan="2" class="gadwp-settings-title">
991
+ <div class="button-primary gadwp-settings-switchoo">
992
+ <input type="checkbox" name="options[amp_tracking_tagmanager]" value="1" class="gadwp-settings-switchoo-checkbox" id="amp_tracking_tagmanager" <?php checked( $options['amp_tracking_tagmanager'], 1 ); ?>>
993
+ <label class="gadwp-settings-switchoo-label" for="amp_tracking_tagmanager">
994
+ <div class="gadwp-settings-switchoo-inner"></div>
995
+ <div class="gadwp-settings-switchoo-switch"></div>
996
+ </label>
997
+ </div>
998
+ <div class="switch-desc"><?php echo " ".__("enable tracking for Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' );?></div>
999
+ </td>
1000
+ </tr>
1001
+ <tr>
1002
+ <td class="gadwp-settings-title">
1003
+ <label for="tracking_type"><?php _e("AMP Container ID:", 'google-analytics-dashboard-for-wp' ); ?>
1004
+ </label>
1005
+ </td>
1006
+ <td>
1007
+ <input type="text" name="options[amp_containerid]" value="<?php echo esc_attr($options['amp_containerid']); ?>" size="15">
1008
+ </td>
1009
+ </tr>
1010
+ </table>
1011
+ </div>
1012
+ <div id="gadwp-exclude">
1013
+ <table class="gadwp-settings-options">
1014
+ <tr>
1015
+ <td colspan="2"><?php echo "<h2>" . __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1016
+ </tr>
1017
+ <tr>
1018
+ <td class="roles gadwp-settings-title">
1019
+ <label for="track_exclude"><?php _e("Exclude tracking for:", 'google-analytics-dashboard-for-wp' ); ?></label>
1020
+ </td>
1021
+ <td class="gadwp-settings-roles">
1022
+ <table>
1023
+ <tr>
1024
+ <?php if ( ! isset( $wp_roles ) ) : ?>
1025
+ <?php $wp_roles = new WP_Roles(); ?>
1026
+ <?php endif; ?>
1027
+ <?php $i = 0; ?>
1028
+ <?php foreach ( $wp_roles->role_names as $role => $name ) : ?>
1029
+ <?php if ( 'subscriber' != $role ) : ?>
1030
+ <?php $i++; ?>
1031
+ <td>
1032
+ <label>
1033
+ <input type="checkbox" name="options[track_exclude][]" value="<?php echo $role; ?>" <?php if (in_array($role,$options['track_exclude'])) echo 'checked="checked"'; ?> /> <?php echo $name; ?>
1034
+ </label>
1035
+ </td>
1036
+ <?php endif; ?>
1037
+ <?php if ( 0 == $i % 4 ) : ?>
1038
+ </tr>
1039
+ <tr>
1040
+ <?php endif; ?>
1041
+ <?php endforeach; ?>
1042
+
1043
+
1044
+
1045
+
1046
+
1047
+
1048
+ </table>
1049
+ </td>
1050
+ </tr>
1051
+ </table>
1052
+ </div>
1053
+ <table class="gadwp-settings-options">
1054
+ <tr>
1055
+ <td colspan="2">
1056
+ <hr>
1057
+ </td>
1058
+ </tr>
1059
+ <tr>
1060
+ <td colspan="2" class="submit">
1061
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
1062
+ </td>
1063
+ </tr>
1064
+ </table>
1065
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1066
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1067
+
1068
+
1069
+
1070
+
1071
+
1072
+
1073
+ </form>
1074
+ <?php
1075
+ self::output_sidebar();
1076
+ }
1077
+
1078
+ public static function errors_debugging() {
1079
+
1080
+ $gadwp = GADWP();
1081
+
1082
+ if ( ! current_user_can( 'manage_options' ) ) {
1083
+ return;
1084
+ }
1085
+
1086
+ $anonim = GADWP_Tools::anonymize_options( $gadwp->config->options );
1087
+
1088
+ $options = self::update_options( 'frontend' );
1089
+ if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) {
1090
+ $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
1091
+ }
1092
+ ?>
1093
+ <div class="wrap">
1094
+ <?php echo "<h2>" . __( "Google Analytics Errors & Debugging", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1095
+ </div>
1096
+ <div id="poststuff" class="gadwp">
1097
+ <div id="post-body" class="metabox-holder columns-2">
1098
+ <div id="post-body-content">
1099
+ <div class="settings-wrapper">
1100
+ <div class="inside">
1101
+ <?php if (isset($message)) echo $message; ?>
1102
+ <?php $tabs = array( 'errors' => __( "Errors & Details", 'google-analytics-dashboard-for-wp' ), 'config' => __( "Plugin Settings", 'google-analytics-dashboard-for-wp' ), 'sysinfo' => __( "System", 'google-analytics-dashboard-for-wp' ) ); ?>
1103
+ <?php self::navigation_tabs( $tabs ); ?>
1104
+ <div id="gadwp-errors">
1105
+ <table class="gadwp-settings-logdata">
1106
+ <tr>
1107
+ <td>
1108
+ <?php echo "<h2>" . __( "Error Details", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1109
+ </td>
1110
+ </tr>
1111
+ <tr>
1112
+ <td>
1113
+ <?php $errors_count = GADWP_Tools::get_cache( 'errors_count' ); ?>
1114
+ <pre class="gadwp-settings-logdata"><?php echo '<span>' . __("Count: ", 'google-analytics-dashboard-for-wp') . '</span>' . (int)$errors_count;?></pre>
1115
+ <?php $errors = print_r( GADWP_Tools::get_cache( 'last_error' ), true ) ? esc_html( print_r( GADWP_Tools::get_cache( 'last_error' ), true ) ) : ''; ?>
1116
+ <?php $errors = str_replace( 'Deconf_', 'Google_', $errors); ?>
1117
+ <pre class="gadwp-settings-logdata"><?php echo '<span>' . __("Last Error: ", 'google-analytics-dashboard-for-wp') . '</span>' . "\n" . $errors;?></pre>
1118
+ <pre class="gadwp-settings-logdata"><?php echo '<span>' . __("GAPI Error: ", 'google-analytics-dashboard-for-wp') . '</span>'; echo "\n" . esc_html( print_r( GADWP_Tools::get_cache( 'gapi_errors' ), true ) ) ?></pre>
1119
+ <br />
1120
+ <hr>
1121
+ </td>
1122
+ </tr>
1123
+ <tr>
1124
+ <td>
1125
+ <?php echo "<h2>" . __( "Sampled Data", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1126
+ </td>
1127
+ </tr>
1128
+ <tr>
1129
+ <td>
1130
+ <?php $sampling = GADWP_TOOLS::get_cache( 'sampleddata' ); ?>
1131
+ <?php if ( $sampling ) :?>
1132
+ <?php printf( __( "Last Detected on %s.", 'google-analytics-dashboard-for-wp' ), '<strong>'. $sampling['date'] . '</strong>' );?>
1133
+ <br />
1134
+ <?php printf( __( "The report was based on %s of sessions.", 'google-analytics-dashboard-for-wp' ), '<strong>'. $sampling['percent'] . '</strong>' );?>
1135
+ <br />
1136
+ <?php printf( __( "Sessions ratio: %s.", 'google-analytics-dashboard-for-wp' ), '<strong>'. $sampling['sessions'] . '</strong>' ); ?>
1137
+ <?php else :?>
1138
+ <?php _e( "None", 'google-analytics-dashboard-for-wp' ); ?>
1139
+ <?php endif;?>
1140
+ </td>
1141
+ </tr>
1142
+ </table>
1143
+ </div>
1144
+ <div id="gadwp-config">
1145
+ <table class="gadwp-settings-options">
1146
+ <tr>
1147
+ <td><?php echo "<h2>" . __( "Plugin Configuration", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1148
+ </tr>
1149
+ <tr>
1150
+ <td>
1151
+ <pre class="gadwp-settings-logdata"><?php echo esc_html(print_r($anonim, true));?></pre>
1152
+ <br />
1153
+ <hr>
1154
+ </td>
1155
+ </tr>
1156
+ </table>
1157
+ </div>
1158
+ <div id="gadwp-sysinfo">
1159
+ <table class="gadwp-settings-options">
1160
+ <tr>
1161
+ <td><?php echo "<h2>" . __( "System Information", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1162
+ </tr>
1163
+ <tr>
1164
+ <td>
1165
+ <pre class="gadwp-settings-logdata"><?php echo esc_html(GADWP_Tools::system_info());?></pre>
1166
+ <br />
1167
+ <hr>
1168
+ </td>
1169
+ </tr>
1170
+ </table>
1171
+ </div>
1172
+ <?php
1173
+ self::output_sidebar();
1174
+ }
1175
+
1176
+ public static function general_settings() {
1177
+ $gadwp = GADWP();
1178
+
1179
+ if ( ! current_user_can( 'manage_options' ) ) {
1180
+ return;
1181
+ }
1182
+ $options = self::update_options( 'general' );
1183
+ printf( '<div id="gapi-warning" class="updated"><p>%1$s <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=general_screen&utm_campaign=gadwp">%2$s</a></p></div>', __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'google-analytics-dashboard-for-wp' ), __( 'Library conflicts between WordPress plugins', 'google-analytics-dashboard-for-wp' ) );
1184
+ if ( null === $gadwp->gapi_controller ) {
1185
+ $gadwp->gapi_controller = new GADWP_GAPI_Controller();
1186
+ }
1187
+ echo '<script type="text/javascript">jQuery("#gapi-warning").hide()</script>';
1188
+ if ( isset( $_POST['gadwp_access_code'] ) ) {
1189
+ if ( 1 == ! stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) && $_POST['gadwp_access_code'] != get_option( 'gadwp_redeemed_code' ) ) {
1190
+ try {
1191
+ $gadwp_access_code = $_POST['gadwp_access_code'];
1192
+ update_option( 'gadwp_redeemed_code', $gadwp_access_code );
1193
+ GADWP_Tools::delete_cache( 'gapi_errors' );
1194
+ GADWP_Tools::delete_cache( 'last_error' );
1195
+ $gadwp->gapi_controller->client->authenticate( $_POST['gadwp_access_code'] );
1196
+ $gadwp->config->options['token'] = $gadwp->gapi_controller->client->getAccessToken();
1197
+ $gadwp->config->options['automatic_updates_minorversion'] = 1;
1198
+ $gadwp->config->set_plugin_options();
1199
+ $options = self::update_options( 'general' );
1200
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Plugin authorization succeeded.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1201
+ if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) {
1202
+ $profiles = $gadwp->gapi_controller->refresh_profiles();
1203
+ if ( is_array ( $profiles ) && ! empty( $profiles ) ) {
1204
+ $gadwp->config->options['ga_profiles_list'] = $profiles;
1205
+ if ( ! $gadwp->config->options['tableid_jail'] ) {
1206
+ $profile = GADWP_Tools::guess_default_domain( $profiles );
1207
+ $gadwp->config->options['tableid_jail'] = $profile;
1208
+ }
1209
+ $gadwp->config->set_plugin_options();
1210
+ $options = self::update_options( 'general' );
1211
+ }
1212
+ }
1213
+ } catch ( Deconf_IO_Exception $e ) {
1214
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1215
+ GADWP_Tools::set_error( $e, $timeout );
1216
+ } catch ( Deconf_Service_Exception $e ) {
1217
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1218
+ GADWP_Tools::set_error( $e, $timeout );
1219
+ } catch ( Exception $e ) {
1220
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1221
+ GADWP_Tools::set_error( $e, $timeout );
1222
+ $gadwp->gapi_controller->reset_token();
1223
+ }
1224
+ } else {
1225
+ if ( 1 == stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) ) {
1226
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "The access code is <strong>not</strong> your <strong>Tracking ID</strong> (UA-XXXXX-X) <strong>nor</strong> your <strong>email address</strong>!", 'google-analytics-dashboard-for-wp' ) . ".</p></div>";
1227
+ } else {
1228
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "You can only use the access code <strong>once</strong>, please generate a <strong>new access</strong> code following the instructions!", 'google-analytics-dashboard-for-wp' ) . ".</p></div>";
1229
+ }
1230
+ }
1231
+ }
1232
+ if ( isset( $_POST['Clear'] ) ) {
1233
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1234
+ GADWP_Tools::clear_cache();
1235
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Cleared Cache.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1236
+ } else {
1237
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1238
+ }
1239
+ }
1240
+ if ( isset( $_POST['Reset'] ) ) {
1241
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1242
+ $gadwp->gapi_controller->reset_token();
1243
+ GADWP_Tools::clear_cache();
1244
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Token Reseted and Revoked.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1245
+ $options = self::update_options( 'Reset' );
1246
+ } else {
1247
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1248
+ }
1249
+ }
1250
+ if ( isset( $_POST['Reset_Err'] ) ) {
1251
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1252
+
1253
+ if ( GADWP_Tools::get_cache( 'gapi_errors' ) || GADWP_Tools::get_cache( 'last_error' ) ) {
1254
+
1255
+ $info = GADWP_Tools::system_info();
1256
+ $info .= 'GADWP Version: ' . GADWP_CURRENT_VERSION;
1257
+
1258
+ $sep = "\n---------------------------\n";
1259
+ $error_report = GADWP_Tools::get_cache( 'last_error' );
1260
+ $error_report .= $sep . print_r( GADWP_Tools::get_cache( 'gapi_errors' ), true );
1261
+ $error_report .= $sep . GADWP_Tools::get_cache( 'errors_count' );
1262
+ $error_report .= $sep . $info;
1263
+
1264
+ $error_report = urldecode( $error_report );
1265
+
1266
+ $url = GADWP_ENDPOINT_URL . 'gadwp-report.php';
1267
+ /* @formatter:off */
1268
+ $response = wp_remote_post( $url, array(
1269
+ 'method' => 'POST',
1270
+ 'timeout' => 45,
1271
+ 'redirection' => 5,
1272
+ 'httpversion' => '1.0',
1273
+ 'blocking' => true,
1274
+ 'headers' => array(),
1275
+ 'body' => array( 'error_report' => $error_report ),
1276
+ 'cookies' => array()
1277
+ )
1278
+ );
1279
+ }
1280
+
1281
+ /* @formatter:on */
1282
+ GADWP_Tools::delete_cache( 'last_error' );
1283
+ GADWP_Tools::delete_cache( 'gapi_errors' );
1284
+ delete_option( 'gadwp_got_updated' );
1285
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "All errors reseted.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1286
+ } else {
1287
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1288
+ }
1289
+ }
1290
+ if ( isset( $_POST['options']['gadwp_hidden'] ) && ! isset( $_POST['Clear'] ) && ! isset( $_POST['Reset'] ) && ! isset( $_POST['Reset_Err'] ) ) {
1291
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1292
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
1293
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1294
+ }
1295
+ }
1296
+ if ( isset( $_POST['Hide'] ) ) {
1297
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1298
+ $message = "<div class='updated' id='gadwp-action'><p>" . __( "All other domains/properties were removed.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1299
+ $lock_profile = GADWP_Tools::get_selected_profile( $gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] );
1300
+ $gadwp->config->options['ga_profiles_list'] = array( $lock_profile );
1301
+ $options = self::update_options( 'general' );
1302
+ } else {
1303
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1304
+ }
1305
+ }
1306
+ ?>
1307
+ <div class="wrap">
1308
+ <?php echo "<h2>" . __( "Google Analytics Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1309
+ <hr>
1310
+ </div>
1311
+ <div id="poststuff" class="gadwp">
1312
+ <div id="post-body" class="metabox-holder columns-2">
1313
+ <div id="post-body-content">
1314
+ <div class="settings-wrapper">
1315
+ <div class="inside">
1316
+ <?php if ( $gadwp->gapi_controller->gapi_errors_handler() || GADWP_Tools::get_cache( 'last_error' ) ) : ?>
1317
+ <?php $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );?>
1318
+ <?php endif;?>
1319
+ <?php if ( isset( $_POST['Authorize'] ) ) : ?>
1320
+ <?php GADWP_Tools::clear_cache(); ?>
1321
+ <?php $gadwp->gapi_controller->token_request(); ?>
1322
+ <div class="updated">
1323
+ <p><?php _e( "Use the red link (see below) to generate and get your access code! You need to generate a new code each time you authorize!", 'google-analytics-dashboard-for-wp' )?></p>
1324
+ </div>
1325
+ <?php else : ?>
1326
+ <?php if ( isset( $message ) ) :?>
1327
+ <?php echo $message;?>
1328
+ <?php endif; ?>
1329
+ <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
1330
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1331
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1332
+ <table class="gadwp-settings-options">
1333
+ <tr>
1334
+ <td colspan="2">
1335
+ <?php echo "<h2>" . __( "Plugin Authorization", 'google-analytics-dashboard-for-wp' ) . "</h2>";?>
1336
+ </td>
1337
+ </tr>
1338
+ <tr>
1339
+ <td colspan="2" class="gadwp-settings-info">
1340
+ <?php printf(__('You need to create a %1$s and watch this %2$s before proceeding to authorization.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://deconf.com/creating-a-google-analytics-account/?utm_source=gadwp_config&utm_medium=link&utm_content=top_tutorial&utm_campaign=gadwp', __("free analytics account", 'google-analytics-dashboard-for-wp')), sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=top_video&utm_campaign=gadwp', __("video tutorial", 'google-analytics-dashboard-for-wp')));?>
1341
+ </td>
1342
+ </tr>
1343
+ <?php if (! $options['token'] || ($options['user_api'] && ! $options['network_mode'])) : ?>
1344
+ <tr>
1345
+ <td colspan="2" class="gadwp-settings-info">
1346
+ <input name="options[user_api]" type="checkbox" id="user_api" value="1" <?php checked( $options['user_api'], 1 ); ?> onchange="this.form.submit()" <?php echo ($options['network_mode'])?'disabled="disabled"':''; ?> /><?php echo " ".__("developer mode (requires advanced API knowledge)", 'google-analytics-dashboard-for-wp' );?>
1347
+ </td>
1348
+ </tr>
1349
+ <?php endif; ?>
1350
+ <?php if ($options['user_api'] && ! $options['network_mode']) : ?>
1351
+ <tr>
1352
+ <td class="gadwp-settings-title">
1353
+ <label for="options[client_id]"><?php _e("Client ID:", 'google-analytics-dashboard-for-wp'); ?></label>
1354
+ </td>
1355
+ <td>
1356
+ <input type="text" name="options[client_id]" value="<?php echo esc_attr($options['client_id']); ?>" size="40" required="required">
1357
+ </td>
1358
+ </tr>
1359
+ <tr>
1360
+ <td class="gadwp-settings-title">
1361
+ <label for="options[client_secret]"><?php _e("Client Secret:", 'google-analytics-dashboard-for-wp'); ?></label>
1362
+ </td>
1363
+ <td>
1364
+ <input type="text" name="options[client_secret]" value="<?php echo esc_attr($options['client_secret']); ?>" size="40" required="required">
1365
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1366
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1367
+ </td>
1368
+ </tr>
1369
+ <?php endif; ?>
1370
+ <?php if ( $options['token'] ) : ?>
1371
+ <tr>
1372
+ <td colspan="2">
1373
+ <input type="submit" name="Reset" class="button button-secondary" value="<?php _e( "Clear Authorization", 'google-analytics-dashboard-for-wp' ); ?>" <?php echo $options['network_mode']?'disabled="disabled"':''; ?> />
1374
+ <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'google-analytics-dashboard-for-wp' ); ?>" />
1375
+ <input type="submit" name="Reset_Err" class="button button-secondary" value="<?php _e( "Report & Reset Errors", 'google-analytics-dashboard-for-wp' ); ?>" />
1376
+ </td>
1377
+ </tr>
1378
+ <tr>
1379
+ <td colspan="2">
1380
+ <hr>
1381
+ </td>
1382
+ </tr>
1383
+ <tr>
1384
+ <td colspan="2"><?php echo "<h2>" . __( "General Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1385
+ </tr>
1386
+ <tr>
1387
+ <td class="gadwp-settings-title">
1388
+ <label for="tableid_jail"><?php _e("Select View:", 'google-analytics-dashboard-for-wp' ); ?></label>
1389
+ </td>
1390
+ <td>
1391
+ <select id="tableid_jail" <?php disabled(empty($options['ga_profiles_list']) || 1 == count($options['ga_profiles_list']), true); ?> name="options[tableid_jail]">
1392
+ <?php if ( ! empty( $options['ga_profiles_list'] ) ) : ?>
1393
+ <?php foreach ( $options['ga_profiles_list'] as $items ) : ?>
1394
+ <?php if ( $items[3] ) : ?>
1395
+ <option value="<?php echo esc_attr( $items[1] ); ?>" <?php selected( $items[1], $options['tableid_jail'] ); ?> title="<?php _e( "View Name:", 'google-analytics-dashboard-for-wp' ); ?> <?php echo esc_attr( $items[0] ); ?>">
1396
+ <?php echo esc_html( GADWP_Tools::strip_protocol( $items[3] ) )?> &#8658; <?php echo esc_attr( $items[0] ); ?>
1397
+ </option>
1398
+ <?php endif; ?>
1399
+ <?php endforeach; ?>
1400
+ <?php else : ?>
1401
+ <option value=""><?php _e( "Property not found", 'google-analytics-dashboard-for-wp' ); ?></option>
1402
+ <?php endif; ?>
1403
+ </select>
1404
+ <?php if ( count( $options['ga_profiles_list'] ) > 1 ) : ?>
1405
+ &nbsp;<input type="submit" name="Hide" class="button button-secondary" value="<?php _e( "Lock Selection", 'google-analytics-dashboard-for-wp' ); ?>" />
1406
+ <?php endif; ?>
1407
+ </td>
1408
+ </tr>
1409
+ <?php if ( $options['tableid_jail'] ) : ?>
1410
+ <tr>
1411
+ <td class="gadwp-settings-title"></td>
1412
+ <td>
1413
+ <?php $profile_info = GADWP_Tools::get_selected_profile( $gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] ); ?>
1414
+ <pre><?php echo __( "View Name:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[0] ) . "<br />" . __( "Tracking ID:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[2] ) . "<br />" . __( "Default URL:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[3] ) . "<br />" . __( "Time Zone:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[5] );?></pre>
1415
+ </td>
1416
+ </tr>
1417
+ <?php endif; ?>
1418
+ <tr>
1419
+ <td class="gadwp-settings-title">
1420
+ <label for="theme_color"><?php _e("Theme Color:", 'google-analytics-dashboard-for-wp' ); ?></label>
1421
+ </td>
1422
+ <td>
1423
+ <input type="text" id="theme_color" class="theme_color" name="options[theme_color]" value="<?php echo esc_attr($options['theme_color']); ?>" size="10">
1424
+ </td>
1425
+ </tr>
1426
+ <tr>
1427
+ <td colspan="2">
1428
+ <hr>
1429
+ </td>
1430
+ </tr>
1431
+ <?php if ( !is_multisite()) :?>
1432
+ <tr>
1433
+ <td colspan="2"><?php echo "<h2>" . __( "Automatic Updates", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1434
+ </tr>
1435
+ <tr>
1436
+ <td colspan="2" class="gadwp-settings-title">
1437
+ <div class="button-primary gadwp-settings-switchoo">
1438
+ <input type="checkbox" name="options[automatic_updates_minorversion]" value="1" class="gadwp-settings-switchoo-checkbox" id="automatic_updates_minorversion" <?php checked( $options['automatic_updates_minorversion'], 1 ); ?>>
1439
+ <label class="gadwp-settings-switchoo-label" for="automatic_updates_minorversion">
1440
+ <div class="gadwp-settings-switchoo-inner"></div>
1441
+ <div class="gadwp-settings-switchoo-switch"></div>
1442
+ </label>
1443
+ </div>
1444
+ <div class="switch-desc"><?php echo " ".__( "automatic updates for minor versions (security and maintenance releases only)", 'google-analytics-dashboard-for-wp' );?></div>
1445
+ </td>
1446
+ </tr>
1447
+ <tr>
1448
+ <td colspan="2">
1449
+ <hr>
1450
+ </td>
1451
+ </tr>
1452
+ <?php endif; ?>
1453
+ <tr>
1454
+ <td colspan="2" class="submit">
1455
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
1456
+ </td>
1457
+ </tr>
1458
+ <?php else : ?>
1459
+ <tr>
1460
+ <td colspan="2">
1461
+ <hr>
1462
+ </td>
1463
+ </tr>
1464
+ <tr>
1465
+ <td colspan="2">
1466
+ <input type="submit" name="Authorize" class="button button-secondary" id="authorize" value="<?php _e( "Authorize Plugin", 'google-analytics-dashboard-for-wp' ); ?>" <?php echo $options['network_mode']?'disabled="disabled"':''; ?> />
1467
+ <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'google-analytics-dashboard-for-wp' ); ?>" />
1468
+ </td>
1469
+ </tr>
1470
+ <tr>
1471
+ <td colspan="2">
1472
+ <hr>
1473
+ </td>
1474
+ </tr>
1475
+ </table>
1476
+ </form>
1477
+ <?php self::output_sidebar(); ?>
1478
+ <?php return; ?>
1479
+ <?php endif; ?>
1480
+ </table>
1481
+ </form>
1482
+ <?php endif; ?>
1483
+ <?php
1484
+
1485
+ self::output_sidebar();
1486
+ }
1487
+
1488
+ // Network Settings
1489
+ public static function general_settings_network() {
1490
+ $gadwp = GADWP();
1491
+
1492
+ if ( ! current_user_can( 'manage_network_options' ) ) {
1493
+ return;
1494
+ }
1495
+ $options = self::update_options( 'network' );
1496
+ /*
1497
+ * Include GAPI
1498
+ */
1499
+ echo '<div id="gapi-warning" class="updated"><p>' . __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'google-analytics-dashboard-for-wp' ) . ' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=general_screen&utm_campaign=gadwp">Library conflicts between WordPress plugins</a></p></div>';
1500
+
1501
+ if ( null === $gadwp->gapi_controller ) {
1502
+ $gadwp->gapi_controller = new GADWP_GAPI_Controller();
1503
+ }
1504
+
1505
+ echo '<script type="text/javascript">jQuery("#gapi-warning").hide()</script>';
1506
+ if ( isset( $_POST['gadwp_access_code'] ) ) {
1507
+ if ( 1 == ! stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) && $_POST['gadwp_access_code'] != get_option( 'gadwp_redeemed_code' ) ) {
1508
+ try {
1509
+ $gadwp_access_code = $_POST['gadwp_access_code'];
1510
+ update_option( 'gadwp_redeemed_code', $gadwp_access_code );
1511
+ $gadwp->gapi_controller->client->authenticate( $_POST['gadwp_access_code'] );
1512
+ $gadwp->config->options['token'] = $gadwp->gapi_controller->client->getAccessToken();
1513
+ $gadwp->config->options['automatic_updates_minorversion'] = 1;
1514
+ $gadwp->config->set_plugin_options( true );
1515
+ $options = self::update_options( 'network' );
1516
+ $message = "<div class='updated' id='gadwp-action'><p>" . __( "Plugin authorization succeeded.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1517
+ if ( is_multisite() ) { // Cleanup errors on the entire network
1518
+ foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) {
1519
+ switch_to_blog( $blog['blog_id'] );
1520
+ GADWP_Tools::delete_cache( 'last_error' );
1521
+ GADWP_Tools::delete_cache( 'gapi_errors' );
1522
+ restore_current_blog();
1523
+ }
1524
+ } else {
1525
+ GADWP_Tools::delete_cache( 'last_error' );
1526
+ GADWP_Tools::delete_cache( 'gapi_errors' );
1527
+ }
1528
+ if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) {
1529
+ $profiles = $gadwp->gapi_controller->refresh_profiles();
1530
+ if ( is_array ( $profiles ) && ! empty( $profiles ) ) {
1531
+ $gadwp->config->options['ga_profiles_list'] = $profiles;
1532
+ if ( isset( $gadwp->config->options['tableid_jail'] ) && ! $gadwp->config->options['tableid_jail'] ) {
1533
+ $profile = GADWP_Tools::guess_default_domain( $profiles );
1534
+ $gadwp->config->options['tableid_jail'] = $profile;
1535
+ }
1536
+ $gadwp->config->set_plugin_options( true );
1537
+ $options = self::update_options( 'network' );
1538
+ }
1539
+ }
1540
+ } catch ( Deconf_IO_Exception $e ) {
1541
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1542
+ GADWP_Tools::set_error( $e, $timeout );
1543
+ } catch ( Deconf_Service_Exception $e ) {
1544
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1545
+ GADWP_Tools::set_error( $e, $timeout );
1546
+ } catch ( Exception $e ) {
1547
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1548
+ GADWP_Tools::set_error( $e, $timeout );
1549
+ $gadwp->gapi_controller->reset_token();
1550
+ }
1551
+ } else {
1552
+ if ( 1 == stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) ) {
1553
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "The access code is <strong>not</strong> your <strong>Tracking ID</strong> (UA-XXXXX-X) <strong>nor</strong> your <strong>email address</strong>!", 'google-analytics-dashboard-for-wp' ) . ".</p></div>";
1554
+ } else {
1555
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "You can only use the access code <strong>once</strong>, please generate a <strong>new access code</strong> using the red link", 'google-analytics-dashboard-for-wp' ) . "!</p></div>";
1556
+ }
1557
+ }
1558
+ }
1559
+ if ( isset( $_POST['Refresh'] ) ) {
1560
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1561
+ $gadwp->config->options['ga_profiles_list'] = array();
1562
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Properties refreshed.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1563
+ $options = self::update_options( 'network' );
1564
+ if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) {
1565
+ if ( ! empty( $gadwp->config->options['ga_profiles_list'] ) ) {
1566
+ $profiles = $gadwp->config->options['ga_profiles_list'];
1567
+ } else {
1568
+ $profiles = $gadwp->gapi_controller->refresh_profiles();
1569
+ }
1570
+ if ( $profiles ) {
1571
+ $gadwp->config->options['ga_profiles_list'] = $profiles;
1572
+ if ( isset( $gadwp->config->options['tableid_jail'] ) && ! $gadwp->config->options['tableid_jail'] ) {
1573
+ $profile = GADWP_Tools::guess_default_domain( $profiles );
1574
+ $gadwp->config->options['tableid_jail'] = $profile;
1575
+ }
1576
+ $gadwp->config->set_plugin_options( true );
1577
+ $options = self::update_options( 'network' );
1578
+ }
1579
+ }
1580
+ } else {
1581
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1582
+ }
1583
+ }
1584
+ if ( isset( $_POST['Clear'] ) ) {
1585
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1586
+ GADWP_Tools::clear_cache();
1587
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Cleared Cache.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1588
+ } else {
1589
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1590
+ }
1591
+ }
1592
+ if ( isset( $_POST['Reset'] ) ) {
1593
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1594
+ $gadwp->gapi_controller->reset_token();
1595
+ GADWP_Tools::clear_cache();
1596
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Token Reseted and Revoked.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1597
+ $options = self::update_options( 'Reset' );
1598
+ } else {
1599
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1600
+ }
1601
+ }
1602
+ if ( isset( $_POST['options']['gadwp_hidden'] ) && ! isset( $_POST['Clear'] ) && ! isset( $_POST['Reset'] ) && ! isset( $_POST['Refresh'] ) ) {
1603
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1604
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
1605
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1606
+ }
1607
+ }
1608
+ if ( isset( $_POST['Hide'] ) ) {
1609
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1610
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "All other domains/properties were removed.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1611
+ $lock_profile = GADWP_Tools::get_selected_profile( $gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] );
1612
+ $gadwp->config->options['ga_profiles_list'] = array( $lock_profile );
1613
+ $options = self::update_options( 'network' );
1614
+ } else {
1615
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1616
+ }
1617
+ }
1618
+ ?>
1619
+ <div class="wrap">
1620
+ <h2><?php _e( "Google Analytics Settings", 'google-analytics-dashboard-for-wp' );?></h2>
1621
+ <hr>
1622
+ </div>
1623
+ <div id="poststuff" class="gadwp">
1624
+ <div id="post-body" class="metabox-holder columns-2">
1625
+ <div id="post-body-content">
1626
+ <div class="settings-wrapper">
1627
+ <div class="inside">
1628
+ <?php if ( $gadwp->gapi_controller->gapi_errors_handler() || GADWP_Tools::get_cache( 'last_error' ) ) : ?>
1629
+ <?php $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );?>
1630
+ <?php endif; ?>
1631
+ <?php if ( isset( $_POST['Authorize'] ) ) : ?>
1632
+ <?php GADWP_Tools::clear_cache();?>
1633
+ <?php $gadwp->gapi_controller->token_request();?>
1634
+ <div class="updated">
1635
+ <p><?php _e( "Use the red link (see below) to generate and get your access code! You need to generate a new code each time you authorize!", 'google-analytics-dashboard-for-wp' );?></p>
1636
+ </div>
1637
+ <?php else : ?>
1638
+ <?php if ( isset( $message ) ) : ?>
1639
+ <?php echo $message; ?>
1640
+ <?php endif; ?>
1641
+ <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
1642
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1643
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1644
+ <table class="gadwp-settings-options">
1645
+ <tr>
1646
+ <td colspan="2">
1647
+ <?php echo "<h2>" . __( "Network Setup", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1648
+ </td>
1649
+ </tr>
1650
+ <tr>
1651
+ <td colspan="2" class="gadwp-settings-title">
1652
+ <div class="button-primary gadwp-settings-switchoo">
1653
+ <input type="checkbox" name="options[network_mode]" value="1" class="gadwp-settings-switchoo-checkbox" id="network_mode" <?php checked( $options['network_mode'], 1); ?> onchange="this.form.submit()">
1654
+ <label class="gadwp-settings-switchoo-label" for="network_mode">
1655
+ <div class="gadwp-settings-switchoo-inner"></div>
1656
+ <div class="gadwp-settings-switchoo-switch"></div>
1657
+ </label>
1658
+ </div>
1659
+ <div class="switch-desc"><?php echo " ".__("use a single Google Analytics account for the entire network", 'google-analytics-dashboard-for-wp' );?></div>
1660
+ </td>
1661
+ </tr>
1662
+ <?php if ($options['network_mode']) : ?>
1663
+ <tr>
1664
+ <td colspan="2">
1665
+ <hr>
1666
+ </td>
1667
+ </tr>
1668
+ <tr>
1669
+ <td colspan="2"><?php echo "<h2>" . __( "Plugin Authorization", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1670
+ </tr>
1671
+ <tr>
1672
+ <td colspan="2" class="gadwp-settings-info">
1673
+ <?php printf(__('You need to create a %1$s and watch this %2$s before proceeding to authorization.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://deconf.com/creating-a-google-analytics-account/?utm_source=gadwp_config&utm_medium=link&utm_content=top_tutorial&utm_campaign=gadwp', __("free analytics account", 'google-analytics-dashboard-for-wp')), sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=top_video&utm_campaign=gadwp', __("video tutorial", 'google-analytics-dashboard-for-wp')));?>
1674
+ </td>
1675
+ </tr>
1676
+ <?php if ( ! $options['token'] || $options['user_api'] ) : ?>
1677
+ <tr>
1678
+ <td colspan="2" class="gadwp-settings-info">
1679
+ <input name="options[user_api]" type="checkbox" id="user_api" value="1" <?php checked( $options['user_api'], 1 ); ?> onchange="this.form.submit()" /><?php echo " ".__("developer mode (requires advanced API knowledge)", 'google-analytics-dashboard-for-wp' );?>
1680
+ </td>
1681
+ </tr>
1682
+ <?php endif; ?>
1683
+ <?php if ( $options['user_api'] ) : ?>
1684
+ <tr>
1685
+ <td class="gadwp-settings-title">
1686
+ <label for="options[client_id]"><?php _e("Client ID:", 'google-analytics-dashboard-for-wp'); ?>
1687
+ </label>
1688
+ </td>
1689
+ <td>
1690
+ <input type="text" name="options[client_id]" value="<?php echo esc_attr($options['client_id']); ?>" size="40" required="required">
1691
+ </td>
1692
+ </tr>
1693
+ <tr>
1694
+ <td class="gadwp-settings-title">
1695
+ <label for="options[client_secret]"><?php _e("Client Secret:", 'google-analytics-dashboard-for-wp'); ?>
1696
+ </label>
1697
+ </td>
1698
+ <td>
1699
+ <input type="text" name="options[client_secret]" value="<?php echo esc_attr($options['client_secret']); ?>" size="40" required="required">
1700
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1701
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1702
+ </td>
1703
+ </tr>
1704
+ <?php endif; ?>
1705
+ <?php if ( $options['token'] ) : ?>
1706
+ <tr>
1707
+ <td colspan="2">
1708
+ <input type="submit" name="Reset" class="button button-secondary" value="<?php _e( "Clear Authorization", 'google-analytics-dashboard-for-wp' ); ?>" />
1709
+ <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'google-analytics-dashboard-for-wp' ); ?>" />
1710
+ <input type="submit" name="Refresh" class="button button-secondary" value="<?php _e( "Refresh Properties", 'google-analytics-dashboard-for-wp' ); ?>" />
1711
+ </td>
1712
+ </tr>
1713
+ <tr>
1714
+ <td colspan="2">
1715
+ <hr>
1716
+ </td>
1717
+ </tr>
1718
+ <tr>
1719
+ <td colspan="2">
1720
+ <?php echo "<h2>" . __( "Properties/Views Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1721
+ </td>
1722
+ </tr>
1723
+ <?php if ( isset( $options['network_tableid'] ) ) : ?>
1724
+ <?php $options['network_tableid'] = json_decode( json_encode( $options['network_tableid'] ), false ); ?>
1725
+ <?php endif; ?>
1726
+ <?php foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) : ?>
1727
+ <tr>
1728
+ <td class="gadwp-settings-title-s">
1729
+ <label for="network_tableid"><?php echo '<strong>'.$blog['domain'].$blog['path'].'</strong>: ';?></label>
1730
+ </td>
1731
+ <td>
1732
+ <select id="network_tableid" <?php disabled(!empty($options['ga_profiles_list']),false);?> name="options[network_tableid][<?php echo $blog['blog_id'];?>]">
1733
+ <?php if ( ! empty( $options['ga_profiles_list'] ) ) : ?>
1734
+ <?php foreach ( $options['ga_profiles_list'] as $items ) : ?>
1735
+ <?php if ( $items[3] ) : ?>
1736
+ <?php $temp_id = $blog['blog_id']; ?>
1737
+ <option value="<?php echo esc_attr( $items[1] );?>" <?php selected( $items[1], isset( $options['network_tableid']->$temp_id ) ? $options['network_tableid']->$temp_id : '');?> title="<?php echo __( "View Name:", 'google-analytics-dashboard-for-wp' ) . ' ' . esc_attr( $items[0] );?>">
1738
+ <?php echo esc_html( GADWP_Tools::strip_protocol( $items[3] ) );?> &#8658; <?php echo esc_attr( $items[0] );?>
1739
+ </option>
1740
+ <?php endif; ?>
1741
+ <?php endforeach; ?>
1742
+ <?php else : ?>
1743
+ <option value="">
1744
+ <?php _e( "Property not found", 'google-analytics-dashboard-for-wp' );?>
1745
+ </option>
1746
+ <?php endif; ?>
1747
+ </select>
1748
+ <br />
1749
+ </td>
1750
+ </tr>
1751
+ <?php endforeach; ?>
1752
+ <tr>
1753
+ <td colspan="2">
1754
+ <h2><?php echo _e( "Automatic Updates", 'google-analytics-dashboard-for-wp' );?></h2>
1755
+ </td>
1756
+ </tr>
1757
+ <tr>
1758
+ <td colspan="2" class="gadwp-settings-title">
1759
+ <div class="button-primary gadwp-settings-switchoo">
1760
+ <input type="checkbox" name="options[automatic_updates_minorversion]" value="1" class="gadwp-settings-switchoo-checkbox" id="automatic_updates_minorversion" <?php checked( $options['automatic_updates_minorversion'], 1 ); ?>>
1761
+ <label class="gadwp-settings-switchoo-label" for="automatic_updates_minorversion">
1762
+ <div class="gadwp-settings-switchoo-inner"></div>
1763
+ <div class="gadwp-settings-switchoo-switch"></div>
1764
+ </label>
1765
+ </div>
1766
+ <div class="switch-desc"><?php echo " ".__( "automatic updates for minor versions (security and maintenance releases only)", 'google-analytics-dashboard-for-wp' );?></div>
1767
+ </td>
1768
+ </tr>
1769
+ <tr>
1770
+ <td colspan="2">
1771
+ <hr><?php echo "<h2>" . __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1772
+ </tr>
1773
+ <tr>
1774
+ <td colspan="2" class="gadwp-settings-title">
1775
+ <div class="button-primary gadwp-settings-switchoo">
1776
+ <input type="checkbox" name="options[superadmin_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="superadmin_tracking"<?php checked( $options['superadmin_tracking'], 1); ?>">
1777
+ <label class="gadwp-settings-switchoo-label" for="superadmin_tracking">
1778
+ <div class="gadwp-settings-switchoo-inner"></div>
1779
+ <div class="gadwp-settings-switchoo-switch"></div>
1780
+ </label>
1781
+ </div>
1782
+ <div class="switch-desc"><?php echo " ".__("exclude Super Admin tracking for the entire network", 'google-analytics-dashboard-for-wp' );?></div>
1783
+ </td>
1784
+ </tr>
1785
+ <tr>
1786
+ <td colspan="2">
1787
+ <hr>
1788
+ </td>
1789
+ </tr>
1790
+ <tr>
1791
+ <td colspan="2" class="submit">
1792
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
1793
+ </td>
1794
+ </tr>
1795
+ <?php else : ?>
1796
+ <tr>
1797
+ <td colspan="2">
1798
+ <hr>
1799
+ </td>
1800
+ </tr>
1801
+ <tr>
1802
+ <td colspan="2">
1803
+ <input type="submit" name="Authorize" class="button button-secondary" id="authorize" value="<?php _e( "Authorize Plugin", 'google-analytics-dashboard-for-wp' ); ?>" />
1804
+ <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'google-analytics-dashboard-for-wp' ); ?>" />
1805
+ </td>
1806
+ </tr>
1807
+ <?php endif; ?>
1808
+ <tr>
1809
+ <td colspan="2">
1810
+ <hr>
1811
+ </td>
1812
+ </tr>
1813
+ </table>
1814
+ </form>
1815
+ <?php self::output_sidebar(); ?>
1816
+ <?php return; ?>
1817
+ <?php endif;?>
1818
+ </table>
1819
+ </form>
1820
+ <?php endif; ?>
1821
+ <?php
1822
+
1823
+ self::output_sidebar();
1824
+ }
1825
+
1826
+ public static function output_sidebar() {
1827
+ global $wp_version;
1828
+
1829
+ $gadwp = GADWP();
1830
+ ?>
1831
+ </div>
1832
+ </div>
1833
+ </div>
1834
+ <div id="postbox-container-1" class="postbox-container">
1835
+ <div class="meta-box-sortables">
1836
+ <div class="postbox">
1837
+ <h3>
1838
+ <span><?php _e("Setup Tutorial & Demo",'google-analytics-dashboard-for-wp') ?></span>
1839
+ </h3>
1840
+ <div class="inside">
1841
+ <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=video&utm_campaign=gadwp" target="_blank"><img src="<?php echo plugins_url( 'images/google-analytics-dashboard.png' , __FILE__ );?>" width="100%" alt="" /></a>
1842
+ </div>
1843
+ </div>
1844
+ <div class="postbox">
1845
+ <h3>
1846
+ <span><?php _e("Stay Updated",'google-analytics-dashboard-for-wp')?></span>
1847
+ </h3>
1848
+ <div class="inside">
1849
+ <div class="gadwp-desc">
1850
+ <div class="g-ytsubscribe" data-channel="TheDeConf" data-layout="default" data-count="default"></div>
1851
+ </div>
1852
+ <br />
1853
+ <div class="gadwp-desc">
1854
+ <div class="g-follow" data-annotation="bubble" data-height="24" data-href="//plus.google.com/u/0/114149166432576972465" data-rel="publisher"></div>
1855
+ <script src="https://apis.google.com/js/platform.js" async defer></script>
1856
+ </div>
1857
+ <br />
1858
+ <div class="gadwp-desc">
1859
+ <a href="https://twitter.com/deconfcom" class="twitter-follow-button" data-show-screen-name="false"></a>
1860
+ <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
1861
+ </div>
1862
+ </div>
1863
+ </div>
1864
+ <div class="postbox">
1865
+ <h3>
1866
+ <span><?php _e("Further Reading",'google-analytics-dashboard-for-wp')?></span>
1867
+ </h3>
1868
+ <div class="inside">
1869
+ <div class="gadwp-title">
1870
+ <a href="https://deconf.com/clicky-web-analytics-review/?utm_source=gadwp_config&utm_medium=link&utm_content=clicky&utm_campaign=gadwp"><img src="<?php echo plugins_url( 'images/clicky.png' , __FILE__ ); ?>" /></a>
1871
+ </div>
1872
+ <div class="gadwp-desc">
1873
+ <?php printf(__('%s service with users tracking at IP level.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="https://deconf.com/clicky-web-analytics-review/?utm_source=gadwp_config&utm_medium=link&utm_content=clicky&utm_campaign=gadwp">%s</a>', __('Web Analytics', 'google-analytics-dashboard-for-wp')));?>
1874
+ </div>
1875
+ <br />
1876
+ <div class="gadwp-title">
1877
+ <a href="https://deconf.com/move-website-https-ssl/?utm_source=gadwp_config&utm_medium=link&utm_content=ssl&utm_campaign=gadwp"><img src="<?php echo plugins_url( 'images/ssl.png' , __FILE__ ); ?>" /></a>
1878
+ </div>
1879
+ <div class="gadwp-desc">
1880
+ <?php printf(__('%s by moving your website to HTTPS/SSL.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="https://deconf.com/move-website-https-ssl/?utm_source=gadwp_config&utm_medium=link&utm_content=ssl&utm_campaign=gadwp">%s</a>', __('Improve search rankings', 'google-analytics-dashboard-for-wp')));?>
1881
+ </div>
1882
+ <br />
1883
+ <div class="gadwp-title">
1884
+ <a href="http://wordpress.org/support/view/plugin-reviews/google-analytics-dashboard-for-wp#plugin-info"><img src="<?php echo plugins_url( 'images/star.png' , __FILE__ ); ?>" /></a>
1885
+ </div>
1886
+ <div class="gadwp-desc">
1887
+ <?php printf(__('Your feedback and review are both important, %s!', 'google-analytics-dashboard-for-wp'), sprintf('<a href="http://wordpress.org/support/view/plugin-reviews/google-analytics-dashboard-for-wp#plugin-info">%s</a>', __('rate this plugin', 'google-analytics-dashboard-for-wp')));?>
1888
+ </div>
1889
+ </div>
1890
+ </div>
1891
+ </div>
1892
+ </div>
1893
+ </div>
1894
+ </div>
1895
+ <?php
1896
+ // Dismiss the admin update notice
1897
+ if ( version_compare( $wp_version, '4.2', '<' ) && current_user_can( 'manage_options' ) ) {
1898
+ delete_option( 'gadwp_got_updated' );
1899
+ }
1900
+ }
1901
+ }
tags/5.3.1.1/admin/setup.php ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
15
+
16
+ final class GADWP_Backend_Setup {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ // Styles & Scripts
24
+ add_action( 'admin_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
+ // Site Menu
26
+ add_action( 'admin_menu', array( $this, 'site_menu' ) );
27
+ // Network Menu
28
+ add_action( 'network_admin_menu', array( $this, 'network_menu' ) );
29
+ // Settings link
30
+ add_filter( "plugin_action_links_" . plugin_basename( GADWP_DIR . 'gadwp.php' ), array( $this, 'settings_link' ) );
31
+ // Updated admin notice
32
+ add_action( 'admin_notices', array( $this, 'admin_notice' ) );
33
+ }
34
+
35
+ /**
36
+ * Add Site Menu
37
+ */
38
+ public function site_menu() {
39
+ global $wp_version;
40
+ if ( current_user_can( 'manage_options' ) ) {
41
+ include ( GADWP_DIR . 'admin/settings.php' );
42
+ add_menu_page( __( "Google Analytics", 'google-analytics-dashboard-for-wp' ), __( "Google Analytics", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_settings', array( 'GADWP_Settings', 'general_settings' ), version_compare( $wp_version, '3.8.0', '>=' ) ? 'dashicons-chart-area' : GADWP_URL . 'admin/images/gadwp-icon.png' );
43
+ add_submenu_page( 'gadwp_settings', __( "General Settings", 'google-analytics-dashboard-for-wp' ), __( "General Settings", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_settings', array( 'GADWP_Settings', 'general_settings' ) );
44
+ add_submenu_page( 'gadwp_settings', __( "Backend Settings", 'google-analytics-dashboard-for-wp' ), __( "Backend Settings", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_backend_settings', array( 'GADWP_Settings', 'backend_settings' ) );
45
+ add_submenu_page( 'gadwp_settings', __( "Frontend Settings", 'google-analytics-dashboard-for-wp' ), __( "Frontend Settings", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_frontend_settings', array( 'GADWP_Settings', 'frontend_settings' ) );
46
+ add_submenu_page( 'gadwp_settings', __( "Tracking Code", 'google-analytics-dashboard-for-wp' ), __( "Tracking Code", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_tracking_settings', array( 'GADWP_Settings', 'tracking_settings' ) );
47
+ add_submenu_page( 'gadwp_settings', __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_errors_debugging', array( 'GADWP_Settings', 'errors_debugging' ) );
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Add Network Menu
53
+ */
54
+ public function network_menu() {
55
+ global $wp_version;
56
+ if ( current_user_can( 'manage_network' ) ) {
57
+ include ( GADWP_DIR . 'admin/settings.php' );
58
+ add_menu_page( __( "Google Analytics", 'google-analytics-dashboard-for-wp' ), "Google Analytics", 'manage_network', 'gadwp_settings', array( 'GADWP_Settings', 'general_settings_network' ), version_compare( $wp_version, '3.8.0', '>=' ) ? 'dashicons-chart-area' : GADWP_URL . 'admin/images/gadwp-icon.png' );
59
+ add_submenu_page( 'gadwp_settings', __( "General Settings", 'google-analytics-dashboard-for-wp' ), __( "General Settings", 'google-analytics-dashboard-for-wp' ), 'manage_network', 'gadwp_settings', array( 'GADWP_Settings', 'general_settings_network' ) );
60
+ add_submenu_page( 'gadwp_settings', __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), 'manage_network', 'gadwp_errors_debugging', array( 'GADWP_Settings', 'errors_debugging' ) );
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Styles & Scripts conditional loading (based on current URI)
66
+ *
67
+ * @param
68
+ * $hook
69
+ */
70
+ public function load_styles_scripts( $hook ) {
71
+ $new_hook = explode( '_page_', $hook );
72
+
73
+ if ( isset( $new_hook[1] ) ) {
74
+ $new_hook = '_page_' . $new_hook[1];
75
+ } else {
76
+ $new_hook = $hook;
77
+ }
78
+
79
+ /*
80
+ * GADWP main stylesheet
81
+ */
82
+ wp_enqueue_style( 'gadwp', GADWP_URL . 'admin/css/gadwp.css', null, GADWP_CURRENT_VERSION );
83
+
84
+ /*
85
+ * GADWP UI
86
+ */
87
+
88
+ if ( GADWP_Tools::get_cache( 'gapi_errors' ) ) {
89
+ $ed_bubble = '!';
90
+ } else {
91
+ $ed_bubble = '';
92
+ }
93
+
94
+ wp_enqueue_script( 'gadwp-backend-ui', plugins_url( 'js/ui.js', __FILE__ ), array( 'jquery' ), GADWP_CURRENT_VERSION, true );
95
+
96
+ /* @formatter:off */
97
+ wp_localize_script( 'gadwp-backend-ui', 'gadwp_ui_data', array(
98
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
99
+ 'security' => wp_create_nonce( 'gadwp_dismiss_notices' ),
100
+ 'ed_bubble' => $ed_bubble,
101
+ )
102
+ );
103
+ /* @formatter:on */
104
+
105
+ if ( $this->gadwp->config->options['switch_profile'] && count( $this->gadwp->config->options['ga_profiles_list'] ) > 1 ) {
106
+ $views = array();
107
+ foreach ( $this->gadwp->config->options['ga_profiles_list'] as $items ) {
108
+ if ( $items[3] ) {
109
+ $views[$items[1]] = esc_js( GADWP_Tools::strip_protocol( $items[3] ) ); // . ' &#8658; ' . $items[0] );
110
+ }
111
+ }
112
+ } else {
113
+ $views = false;
114
+ }
115
+
116
+ /*
117
+ * Main Dashboard Widgets Styles & Scripts
118
+ */
119
+ $widgets_hooks = array( 'index.php' );
120
+
121
+ if ( in_array( $new_hook, $widgets_hooks ) ) {
122
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && $this->gadwp->config->options['dashboard_widget'] ) {
123
+
124
+ if ( $this->gadwp->config->options['ga_target_geomap'] ) {
125
+ $country_codes = GADWP_Tools::get_countrycodes();
126
+ if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
127
+ $region = $this->gadwp->config->options['ga_target_geomap'];
128
+ } else {
129
+ $region = false;
130
+ }
131
+ } else {
132
+ $region = false;
133
+ }
134
+
135
+ wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
136
+
137
+ wp_enqueue_style( 'gadwp-backend-item-reports', GADWP_URL . 'admin/css/admin-widgets.css', null, GADWP_CURRENT_VERSION );
138
+
139
+ wp_register_style( 'jquery-ui-tooltip-html', GADWP_URL . 'common/realtime/jquery.ui.tooltip.html.css' );
140
+
141
+ wp_enqueue_style( 'jquery-ui-tooltip-html' );
142
+
143
+ wp_register_script( 'jquery-ui-tooltip-html', GADWP_URL . 'common/realtime/jquery.ui.tooltip.html.js' );
144
+
145
+ wp_register_script( 'googlecharts', 'https://www.gstatic.com/charts/loader.js', array(), null );
146
+
147
+ wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
148
+
149
+ wp_enqueue_script( 'gadwp-backend-dashboard-reports', GADWP_URL . 'common/js/reports5.js', array( 'jquery', 'googlecharts', 'gadwp-nprogress', 'jquery-ui-tooltip', 'jquery-ui-core', 'jquery-ui-position', 'jquery-ui-tooltip-html' ), GADWP_CURRENT_VERSION, true );
150
+
151
+ /* @formatter:off */
152
+
153
+ $datelist = array(
154
+ 'realtime' => __( "Real-Time", 'google-analytics-dashboard-for-wp' ),
155
+ 'today' => __( "Today", 'google-analytics-dashboard-for-wp' ),
156
+ 'yesterday' => __( "Yesterday", 'google-analytics-dashboard-for-wp' ),
157
+ '7daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 7 ),
158
+ '14daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 14 ),
159
+ '30daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 30 ),
160
+ '90daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 90 ),
161
+ '365daysAgo' => sprintf( _n( "%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp' ), __('One', 'google-analytics-dashboard-for-wp') ),
162
+ '1095daysAgo' => sprintf( _n( "%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp' ), __('Three', 'google-analytics-dashboard-for-wp') ),
163
+ );
164
+
165
+
166
+ if ( $this->gadwp->config->options['user_api'] && ! $this->gadwp->config->options['backend_realtime_report'] ) {
167
+ array_shift( $datelist );
168
+ }
169
+
170
+ wp_localize_script( 'gadwp-backend-dashboard-reports', 'gadwpItemData', array(
171
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
172
+ 'security' => wp_create_nonce( 'gadwp_backend_item_reports' ),
173
+ 'dateList' => $datelist,
174
+ 'reportList' => array(
175
+ 'sessions' => __( "Sessions", 'google-analytics-dashboard-for-wp' ),
176
+ 'users' => __( "Users", 'google-analytics-dashboard-for-wp' ),
177
+ 'organicSearches' => __( "Organic", 'google-analytics-dashboard-for-wp' ),
178
+ 'pageviews' => __( "Page Views", 'google-analytics-dashboard-for-wp' ),
179
+ 'visitBounceRate' => __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
180
+ 'locations' => __( "Location", 'google-analytics-dashboard-for-wp' ),
181
+ 'contentpages' => __( "Pages", 'google-analytics-dashboard-for-wp' ),
182
+ 'referrers' => __( "Referrers", 'google-analytics-dashboard-for-wp' ),
183
+ 'searches' => __( "Searches", 'google-analytics-dashboard-for-wp' ),
184
+ 'trafficdetails' => __( "Traffic", 'google-analytics-dashboard-for-wp' ),
185
+ 'technologydetails' => __( "Technology", 'google-analytics-dashboard-for-wp' ),
186
+ '404errors' => __( "404 Errors", 'google-analytics-dashboard-for-wp' ),
187
+ ),
188
+ 'i18n' => array(
189
+ __( "A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp' ), //0
190
+ __( "Traffic Mediums", 'google-analytics-dashboard-for-wp' ),
191
+ __( "Visitor Type", 'google-analytics-dashboard-for-wp' ),
192
+ __( "Search Engines", 'google-analytics-dashboard-for-wp' ),
193
+ __( "Social Networks", 'google-analytics-dashboard-for-wp' ),
194
+ __( "Sessions", 'google-analytics-dashboard-for-wp' ),
195
+ __( "Users", 'google-analytics-dashboard-for-wp' ),
196
+ __( "Page Views", 'google-analytics-dashboard-for-wp' ),
197
+ __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
198
+ __( "Organic Search", 'google-analytics-dashboard-for-wp' ),
199
+ __( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
200
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
201
+ __( "No Data", 'google-analytics-dashboard-for-wp' ),
202
+ __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
203
+ __( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
204
+ __( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . menu_page_url( 'gadwp_settings', false ) . '">' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</a>.',
205
+ __( "Browser", 'google-analytics-dashboard-for-wp' ), //16
206
+ __( "Operating System", 'google-analytics-dashboard-for-wp' ),
207
+ __( "Screen Resolution", 'google-analytics-dashboard-for-wp' ),
208
+ __( "Mobile Brand", 'google-analytics-dashboard-for-wp' ),
209
+ __( "REFERRALS", 'google-analytics-dashboard-for-wp' ), //20
210
+ __( "KEYWORDS", 'google-analytics-dashboard-for-wp' ),
211
+ __( "SOCIAL", 'google-analytics-dashboard-for-wp' ),
212
+ __( "CAMPAIGN", 'google-analytics-dashboard-for-wp' ),
213
+ __( "DIRECT", 'google-analytics-dashboard-for-wp' ),
214
+ __( "NEW", 'google-analytics-dashboard-for-wp' ), //25
215
+ __( "Time on Page", 'google-analytics-dashboard-for-wp' ),
216
+ __( "Page Load Time", 'google-analytics-dashboard-for-wp' ),
217
+ __( "Session Duration", 'google-analytics-dashboard-for-wp' ),
218
+ ),
219
+ 'rtLimitPages' => $this->gadwp->config->options['ga_realtime_pages'],
220
+ 'colorVariations' => GADWP_Tools::variations( $this->gadwp->config->options['theme_color'] ),
221
+ 'region' => $region,
222
+ 'mapsApiKey' => apply_filters( 'gadwp_maps_api_key', $this->gadwp->config->options['maps_api_key'] ),
223
+ 'language' => get_bloginfo( 'language' ),
224
+ 'viewList' => $views,
225
+ 'scope' => 'admin-widgets',
226
+ )
227
+
228
+ );
229
+ /* @formatter:on */
230
+ }
231
+ }
232
+
233
+ /*
234
+ * Posts/Pages List Styles & Scripts
235
+ */
236
+ $contentstats_hooks = array( 'edit.php' );
237
+ if ( in_array( $hook, $contentstats_hooks ) ) {
238
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && $this->gadwp->config->options['backend_item_reports'] ) {
239
+
240
+ if ( $this->gadwp->config->options['ga_target_geomap'] ) {
241
+ $country_codes = GADWP_Tools::get_countrycodes();
242
+ if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
243
+ $region = $this->gadwp->config->options['ga_target_geomap'];
244
+ } else {
245
+ $region = false;
246
+ }
247
+ } else {
248
+ $region = false;
249
+ }
250
+
251
+ wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
252
+
253
+ wp_enqueue_style( 'gadwp-backend-item-reports', GADWP_URL . 'admin/css/item-reports.css', null, GADWP_CURRENT_VERSION );
254
+
255
+ wp_enqueue_style( "wp-jquery-ui-dialog" );
256
+
257
+ wp_register_script( 'googlecharts', 'https://www.gstatic.com/charts/loader.js', array(), null );
258
+
259
+ wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
260
+
261
+ wp_enqueue_script( 'gadwp-backend-item-reports', GADWP_URL . 'common/js/reports5.js', array( 'gadwp-nprogress', 'googlecharts', 'jquery', 'jquery-ui-dialog' ), GADWP_CURRENT_VERSION, true );
262
+
263
+ /* @formatter:off */
264
+ wp_localize_script( 'gadwp-backend-item-reports', 'gadwpItemData', array(
265
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
266
+ 'security' => wp_create_nonce( 'gadwp_backend_item_reports' ),
267
+ 'dateList' => array(
268
+ 'today' => __( "Today", 'google-analytics-dashboard-for-wp' ),
269
+ 'yesterday' => __( "Yesterday", 'google-analytics-dashboard-for-wp' ),
270
+ '7daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 7 ),
271
+ '14daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 14 ),
272
+ '30daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 30 ),
273
+ '90daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 90 ),
274
+ '365daysAgo' => sprintf( _n( "%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp' ), __('One', 'google-analytics-dashboard-for-wp') ),
275
+ '1095daysAgo' => sprintf( _n( "%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp' ), __('Three', 'google-analytics-dashboard-for-wp') ),
276
+ ),
277
+ 'reportList' => array(
278
+ 'uniquePageviews' => __( "Unique Views", 'google-analytics-dashboard-for-wp' ),
279
+ 'users' => __( "Users", 'google-analytics-dashboard-for-wp' ),
280
+ 'organicSearches' => __( "Organic", 'google-analytics-dashboard-for-wp' ),
281
+ 'pageviews' => __( "Page Views", 'google-analytics-dashboard-for-wp' ),
282
+ 'visitBounceRate' => __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
283
+ 'locations' => __( "Location", 'google-analytics-dashboard-for-wp' ),
284
+ 'referrers' => __( "Referrers", 'google-analytics-dashboard-for-wp' ),
285
+ 'searches' => __( "Searches", 'google-analytics-dashboard-for-wp' ),
286
+ 'trafficdetails' => __( "Traffic", 'google-analytics-dashboard-for-wp' ),
287
+ 'technologydetails' => __( "Technology", 'google-analytics-dashboard-for-wp' ),
288
+ ),
289
+ 'i18n' => array(
290
+ __( "A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp' ), //0
291
+ __( "Traffic Mediums", 'google-analytics-dashboard-for-wp' ),
292
+ __( "Visitor Type", 'google-analytics-dashboard-for-wp' ),
293
+ __( "Social Networks", 'google-analytics-dashboard-for-wp' ),
294
+ __( "Search Engines", 'google-analytics-dashboard-for-wp' ),
295
+ __( "Unique Views", 'google-analytics-dashboard-for-wp' ),
296
+ __( "Users", 'google-analytics-dashboard-for-wp' ),
297
+ __( "Page Views", 'google-analytics-dashboard-for-wp' ),
298
+ __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
299
+ __( "Organic Search", 'google-analytics-dashboard-for-wp' ),
300
+ __( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
301
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
302
+ __( "No Data", 'google-analytics-dashboard-for-wp' ),
303
+ __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
304
+ __( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
305
+ __( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . menu_page_url( 'gadwp_settings', false ) . '">' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</a>.',
306
+ __( "Browser", 'google-analytics-dashboard-for-wp' ), //16
307
+ __( "Operating System", 'google-analytics-dashboard-for-wp' ),
308
+ __( "Screen Resolution", 'google-analytics-dashboard-for-wp' ),
309
+ __( "Mobile Brand", 'google-analytics-dashboard-for-wp' ), //19
310
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
311
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
312
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
313
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
314
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
315
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ), //25
316
+ __( "Time on Page", 'google-analytics-dashboard-for-wp' ),
317
+ __( "Page Load Time", 'google-analytics-dashboard-for-wp' ),
318
+ __( "Exit Rate", 'google-analytics-dashboard-for-wp' ),
319
+ ),
320
+ 'colorVariations' => GADWP_Tools::variations( $this->gadwp->config->options['theme_color'] ),
321
+ 'region' => $region,
322
+ 'mapsApiKey' => apply_filters( 'gadwp_maps_api_key', $this->gadwp->config->options['maps_api_key'] ),
323
+ 'language' => get_bloginfo( 'language' ),
324
+ 'viewList' => false,
325
+ 'scope' => 'admin-item',
326
+ )
327
+ );
328
+ /* @formatter:on */
329
+ }
330
+ }
331
+
332
+ /*
333
+ * Settings Styles & Scripts
334
+ */
335
+ $settings_hooks = array( '_page_gadwp_settings', '_page_gadwp_backend_settings', '_page_gadwp_frontend_settings', '_page_gadwp_tracking_settings', '_page_gadwp_errors_debugging' );
336
+
337
+ if ( in_array( $new_hook, $settings_hooks ) ) {
338
+ wp_enqueue_style( 'wp-color-picker' );
339
+ wp_enqueue_script( 'wp-color-picker' );
340
+ wp_enqueue_script( 'wp-color-picker-script-handle', plugins_url( 'js/wp-color-picker-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
341
+ wp_enqueue_script( 'gadwp-settings', plugins_url( 'js/settings.js', __FILE__ ), array( 'jquery' ), GADWP_CURRENT_VERSION, true );
342
+ }
343
+ }
344
+
345
+ /**
346
+ * Add "Settings" link in Plugins List
347
+ *
348
+ * @param
349
+ * $links
350
+ * @return array
351
+ */
352
+ public function settings_link( $links ) {
353
+ $settings_link = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=gadwp_settings' ) ) . '">' . __( "Settings", 'google-analytics-dashboard-for-wp' ) . '</a>';
354
+ array_unshift( $links, $settings_link );
355
+ return $links;
356
+ }
357
+
358
+ /**
359
+ * Add an admin notice after a manual or atuomatic update
360
+ */
361
+ function admin_notice() {
362
+ $currentScreen = get_current_screen();
363
+
364
+ if ( ! current_user_can( 'manage_options' ) || strpos( $currentScreen->base, '_gadwp_' ) === false ) {
365
+ return;
366
+ }
367
+
368
+ if ( get_option( 'gadwp_got_updated' ) ) :
369
+ ?>
370
+ <div id="gadwp-notice" class="notice is-dismissible">
371
+ <p><?php echo sprintf( __('Google Analytics Dashboard for WP has been updated to version %s.', 'google-analytics-dashboard-for-wp' ), GADWP_CURRENT_VERSION).' '.sprintf( __('For details, check out %1$s.', 'google-analytics-dashboard-for-wp' ), sprintf(' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_notice&utm_medium=link&utm_content=release_notice&utm_campaign=gadwp">%s</a>', __('the plugin documentation', 'google-analytics-dashboard-for-wp') ) ); ?></p>
372
+ </div>
373
+
374
+ <?php
375
+ endif;
376
+ }
377
+ }
378
+ }
tags/5.3.1.1/admin/views/access-code.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <form name="input" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" method="post">
11
+ <table class="gadwp-settings-options">
12
+ <tr>
13
+ <td colspan="2" class="gadwp-settings-info">
14
+ <?php echo __( "Use this link to get your <strong>one-time-use</strong> access code:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . $data['authUrl'] . '" id="gapi-access-code" target="_blank">' . __ ( "Get Access Code", 'google-analytics-dashboard-for-wp' ) . '</a>.'; ?>
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <td class="gadwp-settings-title">
19
+ <label for="gadwp_access_code" title="<?php _e("Use the red link to get your access code! You need to generate a new one each time you authorize!",'google-analytics-dashboard-for-wp')?>"><?php echo _e( "Access Code:", 'google-analytics-dashboard-for-wp' ); ?></label>
20
+ </td>
21
+ <td>
22
+ <input type="text" id="gadwp_access_code" name="gadwp_access_code" value="" size="61" autocomplete="off" pattern=".\/.{30,}" required="required" title="<?php _e("Use the red link to get your access code! You need to generate a new one each time you authorize!",'google-analytics-dashboard-for-wp')?>">
23
+ </td>
24
+ </tr>
25
+ <tr>
26
+ <td colspan="2">
27
+ <hr>
28
+ </td>
29
+ </tr>
30
+ <tr>
31
+ <td colspan="2">
32
+ <input type="submit" class="button button-secondary" name="gadwp_authorize" value="<?php _e( "Save Access Code", 'google-analytics-dashboard-for-wp' ); ?>" />
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </form>
tags/5.3.1.1/admin/widgets.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Backend_Widgets' ) ) {
15
+
16
+ class GADWP_Backend_Widgets {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) {
23
+ add_action( 'wp_dashboard_setup', array( $this, 'add_widget' ) );
24
+ }
25
+ }
26
+
27
+ public function add_widget() {
28
+ wp_add_dashboard_widget( 'gadwp-widget', __( "Google Analytics Dashboard", 'google-analytics-dashboard-for-wp' ), array( $this, 'dashboard_widget' ), $control_callback = null );
29
+ }
30
+
31
+ public function dashboard_widget() {
32
+ $projectId = 0;
33
+
34
+ if ( empty( $this->gadwp->config->options['token'] ) ) {
35
+ echo '<p>' . __( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . '</p><form action="' . menu_page_url( 'gadwp_settings', false ) . '" method="POST">' . get_submit_button( __( "Authorize Plugin", 'google-analytics-dashboard-for-wp' ), 'secondary' ) . '</form>';
36
+ return;
37
+ }
38
+
39
+ if ( current_user_can( 'manage_options' ) ) {
40
+ if ( $this->gadwp->config->options['tableid_jail'] ) {
41
+ $projectId = $this->gadwp->config->options['tableid_jail'];
42
+ } else {
43
+ echo '<p>' . __( "An admin should asign a default Google Analytics Profile.", 'google-analytics-dashboard-for-wp' ) . '</p><form action="' . menu_page_url( 'gadwp_settings', false ) . '" method="POST">' . get_submit_button( __( "Select Domain", 'google-analytics-dashboard-for-wp' ), 'secondary' ) . '</form>';
44
+ return;
45
+ }
46
+ } else {
47
+ if ( $this->gadwp->config->options['tableid_jail'] ) {
48
+ $projectId = $this->gadwp->config->options['tableid_jail'];
49
+ } else {
50
+ echo '<p>' . __( "An admin should asign a default Google Analytics Profile.", 'google-analytics-dashboard-for-wp' ) . '</p><form action="' . menu_page_url( 'gadwp_settings', false ) . '" method="POST">' . get_submit_button( __( "Select Domain", 'google-analytics-dashboard-for-wp' ), 'secondary' ) . '</form>';
51
+ return;
52
+ }
53
+ }
54
+
55
+ if ( ! ( $projectId ) ) {
56
+ echo '<p>' . __( "Something went wrong while retrieving property data. You need to create and properly configure a Google Analytics account:", 'google-analytics-dashboard-for-wp' ) . '</p> <form action="https://deconf.com/how-to-set-up-google-analytics-on-your-website/" method="POST">' . get_submit_button( __( "Find out more!", 'google-analytics-dashboard-for-wp' ), 'secondary' ) . '</form>';
57
+ return;
58
+ }
59
+
60
+ ?>
61
+ <div id="gadwp-window-1"></div>
62
+ <?php
63
+ }
64
+ }
65
+ }
tags/5.3.1.1/common/ajax-actions.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Common_Ajax' ) ) {
15
+
16
+ final class GADWP_Common_Ajax {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) || GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) ) {
24
+ add_action( 'wp_ajax_gadwp_set_error', array( $this, 'ajax_set_error' ) );
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Ajax handler for storing JavaScript Errors
30
+ *
31
+ * @return json|int
32
+ */
33
+ public function ajax_set_error() {
34
+ if ( ! isset( $_POST['gadwp_security_set_error'] ) || ! ( wp_verify_nonce( $_POST['gadwp_security_set_error'], 'gadwp_backend_item_reports' ) || wp_verify_nonce( $_POST['gadwp_security_set_error'], 'gadwp_frontend_item_reports' ) ) ) {
35
+ wp_die( - 40 );
36
+ }
37
+ $timeout = 24 * 60 * 60;
38
+ GADWP_Tools::set_error( $_POST['response'], $timeout );
39
+ wp_die();
40
+ }
41
+ }
42
+ }
tags/5.3.1.1/common/js/reports5.js ADDED
@@ -0,0 +1 @@
 
1
+ "use strict";if(gadwpItemData.mapsApiKey){google.charts.load("current",{mapsApiKey:gadwpItemData.mapsApiKey,packages:["corechart","table","orgchart","geochart"]})}else{google.charts.load("current",{packages:["corechart","table","orgchart","geochart"]})}google.charts.setOnLoadCallback(GADWPReportLoad);gadwpItemData.getID=function(a){if(gadwpItemData.scope=="admin-item"){if(typeof a.id=="undefined"){return 0}if(a.id.split("-")[1]=="undefined"){return 0}else{return a.id.split("-")[1]}}else{if(typeof a.id=="undefined"){return 1}if(a.id.split("-")[4]=="undefined"){return 1}else{return a.id.split("-")[4]}}};gadwpItemData.getSelector=function(a){if(a=="admin-item"){return'a[id^="gadwp-"]'}else{return'li[id^="wp-admin-bar-gadwp"] a'}};gadwpItemData.responsiveDialog=function(){var b,a,c;c=jQuery(".ui-dialog:visible");c.each(function(){b=jQuery(this).find(".ui-dialog-content").data("ui-dialog");if(b.options.fluid){a=jQuery(window).width();if(a<(parseInt(b.options.maxWidth)+50)){jQuery(this).css("max-width","90%")}else{jQuery(this).css("max-width",b.options.maxWidth+"px")}b.option("position",b.options.position)}})};jQuery.fn.extend({gadwpItemReport:function(g){var a,d,h,e,f,i,c,b="-"+g;d={setCookie:function(k,m){var j,l=new Date();if(gadwpItemData.scope=="admin-widgets"){k="gadwp_wg_"+k}else{k="gadwp_ir_"+k}l.setTime(l.getTime()+(24*60*60*1000*365));j="expires="+l.toUTCString();document.cookie=k+"="+m+"; "+j+"; path=/"},getCookie:function(j){var l,m,n,k=0;if(gadwpItemData.scope=="admin-widgets"){j="gadwp_wg_"+j+"="}else{j="gadwp_ir_"+j+"="}m=document.cookie.split(";");for(k=0;k<m.length;k++){l=m[k];while(l.charAt(0)==" "){l=l.substring(1)}if(l.indexOf(j)==0){return l.substring(j.length,l.length)}}return false},escape:function(j){div=document.createElement("div");div.appendChild(document.createTextNode(j));return div.innerHTML}};h={addOptions:function(o,n){var j,l,m,k=[];if(!d.getCookie("default_metric")||!d.getCookie("default_dimension")||!d.getCookie("default_swmetric")){j="sessions";l="30daysAgo";if(gadwpItemData.scope=="front-item"||gadwpItemData.scope=="admin-item"){c="pageviews"}else{c="sessions"}d.setCookie("default_metric",j);d.setCookie("default_dimension",l);d.setCookie("default_swmetric",c)}else{j=d.getCookie("default_metric");l=d.getCookie("default_dimension");m=d.getCookie("default_view");c=d.getCookie("default_swmetric")}if(n==false){if(gadwpItemData.scope=="front-item"||gadwpItemData.scope=="admin-item"){k=""}else{k='<span id="gadwp-swmetric-sessions" title="'+gadwpItemData.i18n[5]+'" class="dashicons dashicons-clock" style="font-size:22px;padding:4px;"></span>'}k+='<span id="gadwp-swmetric-users" title="'+gadwpItemData.i18n[6]+'" class="dashicons dashicons-admin-users" style="font-size:22px;padding:4px;"></span>';k+='<span id="gadwp-swmetric-pageviews" title="'+gadwpItemData.i18n[7]+'" class="dashicons dashicons-admin-page" style="font-size:22px;padding:4px;"></span>';jQuery(o).html(k);jQuery("#gadwp-swmetric-"+c).css("color","#008ec2")}else{jQuery.each(n,function(p,q){if(p==j||p==l||p==m){k.push('<option value="'+p+'" selected="selected">'+q+"</option>")}else{k.push('<option value="'+p+'">'+q+"</option>")}});jQuery(o).html(k.join(""))}},init:function(){var j;if(!jQuery("#gadwp-window"+b).length){return}if(jQuery("#gadwp-window"+b).html().length){return}j='<div id="gadwp-container'+b+'">';if(gadwpItemData.viewList!=false){j+='<select id="gadwp-sel-view'+b+'"></select>'}j+='<select id="gadwp-sel-period'+b+'"></select> ';j+='<select id="gadwp-sel-report'+b+'"></select>';j+='<div id="gadwp-sel-metric'+b+'" style="float:right;display:none;">';j+="</div>";j+='<div id="gadwp-progressbar'+b+'"></div>';j+='<div id="gadwp-status'+b+'"></div>';j+='<div id="gadwp-reports'+b+'"></div>';j+='<div style="text-align:right;width:100%;font-size:0.8em;clear:both;margin-right:5px;margin-top:10px;">';j+=gadwpItemData.i18n[14];j+=' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_report&utm_medium=link&utm_content=back_report&utm_campaign=gadwp" rel="nofollow" style="text-decoration:none;font-size:1em;">GADWP</a>&nbsp;';j+="</div>";j+="</div>",jQuery("#gadwp-window"+b).append(j);h.addOptions("#gadwp-sel-view"+b,gadwpItemData.viewList);h.addOptions("#gadwp-sel-period"+b,gadwpItemData.dateList);h.addOptions("#gadwp-sel-report"+b,gadwpItemData.reportList);h.addOptions("#gadwp-sel-metric"+b,false)}};e={oldViewPort:0,orgChartTableChartData:"",tableChartData:"",orgChartPieChartsData:"",geoChartTableChartData:"",areaChartBottomStatsData:"",realtime:"",rtRuns:null,i18n:null,getTitle:function(j){if(j=="admin-item"){return jQuery("#gadwp"+b).attr("title")}else{return document.getElementsByTagName("title")[0].innerHTML}},alertMessage:function(j){jQuery("#gadwp-status"+b).css({"margin-top":"3px","padding-left":"5px",height:"auto",color:"#000","border-left":"5px solid red"});jQuery("#gadwp-status"+b).html(j)},areaChartBottomStats:function(j){e.areaChartBottomStatsData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();if(a.query=="visitBounceRate,bottomstats"){e.drawAreaChart(j[0],true)}else{e.drawAreaChart(j[0],false)}}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-areachart"+b,j[0],"125px")}if(!jQuery.isNumeric(j[1])){if(jQuery.isArray(j[1])){jQuery("#gadwp-reports"+b).show();e.drawBottomStats(j[1])}else{e.throwDebug(j[1])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-bottomstats"+b,j[1],"40px")}}else{e.throwDebug(j)}NProgress.done()},orgChartPieCharts:function(j){var k=0;e.orgChartPieChartsData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawOrgChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-orgchart"+b,j[0],"125px")}for(k=1;k<j.length;k++){if(!jQuery.isNumeric(j[k])){if(jQuery.isArray(j[k])){jQuery("#gadwp-reports"+b).show();e.drawPieChart("piechart-"+k,j[k],e.i18n[k])}else{e.throwDebug(j[k])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-piechart-"+k+b,j[k],"80px")}}}else{e.throwDebug(j)}NProgress.done()},geoChartTableChart:function(j){e.geoChartTableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawGeoChart(j[0]);e.drawTableChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-geochart"+b,j[0],"125px");e.throwError("#gadwp-tablechart"+b,j[0],"125px")}}else{e.throwDebug(j)}NProgress.done()},orgChartTableChart:function(j){e.orgChartTableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawOrgChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-orgchart"+b,j[0],"125px")}if(!jQuery.isNumeric(j[1])){if(jQuery.isArray(j[1])){e.drawTableChart(j[1])}else{e.throwDebug(j[1])}}else{e.throwError("#gadwp-tablechart"+b,j[1],"125px")}}else{e.throwDebug(j)}NProgress.done()},tableChart:function(j){e.tableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawTableChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-tablechart"+b,j[0],"125px")}}else{e.throwDebug(j)}NProgress.done()},drawTableChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={page:"enable",pageSize:10,width:"100%",allowHtml:true};k=new google.visualization.Table(document.getElementById("gadwp-tablechart"+b));k.draw(l,j)},drawOrgChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={allowCollapse:true,allowHtml:true,height:"100%"};k=new google.visualization.OrgChart(document.getElementById("gadwp-orgchart"+b));k.draw(l,j)},drawPieChart:function(o,m,n){var l,j,k;l=google.visualization.arrayToDataTable(m);j={is3D:false,tooltipText:"percentage",legend:"none",chartArea:{width:"99%",height:"80%"},title:n,pieSliceText:"value",colors:gadwpItemData.colorVariations};k=new google.visualization.PieChart(document.getElementById("gadwp-"+o+b));k.draw(l,j)},drawGeoChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={chartArea:{width:"99%",height:"90%"},colors:[gadwpItemData.colorVariations[5],gadwpItemData.colorVariations[4]]};if(gadwpItemData.region){j.region=gadwpItemData.region;j.displayMode="markers";j.datalessRegionColor="EFEFEF"}k=new google.visualization.GeoChart(document.getElementById("gadwp-geochart"+b));k.draw(l,j)},drawAreaChart:function(n,o){var m,j,l,k;m=google.visualization.arrayToDataTable(n);if(o){k=new google.visualization.NumberFormat({suffix:"%",fractionDigits:2});k.format(m,1)}j={legend:{position:"none"},pointSize:3,colors:[gadwpItemData.colorVariations[0],gadwpItemData.colorVariations[4]],chartArea:{width:"99%",height:"90%"},vAxis:{textPosition:"in",minValue:0},hAxis:{textPosition:"none"}};l=new google.visualization.AreaChart(document.getElementById("gadwp-areachart"+b));l.draw(m,j)},drawBottomStats:function(j){jQuery("#gdsessions"+b).html(j[0]);jQuery("#gdusers"+b).html(j[1]);jQuery("#gdpageviews"+b).html(j[2]);jQuery("#gdbouncerate"+b).html(j[3]);jQuery("#gdorganicsearch"+b).html(j[4]);jQuery("#gdpagespervisit"+b).html(j[5]);jQuery("#gdpagetime"+b).html(j[6]);jQuery("#gdpageload"+b).html(j[7]);jQuery("#gdsessionduration"+b).html(j[8])},rtOnlyUniqueValues:function(l,k,j){return j.indexOf(l)===k},rtCountSessions:function(k,m){var l=0,j=0;for(j=0;j<k.rows.length;j++){if(jQuery.inArray(m,k.rows[j])>-1){l+=parseInt(k.rows[j][6])}}return l},rtGenerateTooltip:function(k){var m=0,l="",j=0;for(j=0;j<k.length;j++){m+=parseInt(k[j].count);l+="<tr><td class='gadwp-pgdetailsl'>"+k[j].value+"</td><td class='gadwp-pgdetailsr'>"+k[j].count+"</td></tr>"}if(m){return("<table>"+l+"</table>")}else{return("")}},rtPageDetails:function(y,n){var w,o,r,x=0,v=0,m=0,s=0,t=0,z=0,C=0,q=0,l=0,u="",A="",p="",k="",B="";y=y.rows;for(x=0;x<y.length;x++){if(y[x][0]==n){o=y[x][5];switch(y[x][3]){case"REFERRAL":t+=parseInt(y[x][6]);u+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"ORGANIC":z+=parseInt(y[x][6]);A+="<tr><td class='gadwp-pgdetailsl'>"+y[x][2]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"SOCIAL":q+=parseInt(y[x][6]);p+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"CUSTOM":l+=parseInt(y[x][6]);k+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"DIRECT":C+=parseInt(y[x][6]);break}}}if(t){u="<table><tr><td>"+e.i18n[0]+"("+t+")</td></tr>"+u+"</table><br />"}if(z){A="<table><tr><td>"+e.i18n[1]+"("+z+")</td></tr>"+A+"</table><br />"}if(q){p="<table><tr><td>"+e.i18n[2]+"("+q+")</td></tr>"+p+"</table><br />"}if(l){k="<table><tr><td>"+e.i18n[3]+"("+l+")</td></tr>"+k+"</table><br />"}if(C){B="<table><tr><td>"+e.i18n[4]+"("+C+")</td></tr></table><br />"}return("<p><center><strong>"+o+"</strong></center></p>"+u+A+p+k+B)},rtRefresh:function(){if(e.render.focusFlag){a.from=false;a.to=false;a.query="realtime";jQuery.post(gadwpItemData.ajaxurl,a,function(j){if(jQuery.isArray(j)){jQuery("#gadwp-reports"+b).show();e.realtime=j[0];e.drawRealtime(e.realtime)}else{e.throwDebug(j)}NProgress.done()})}},drawRealtime:function(y){var j,n,o,w,t,r,x=0,v=[],z=[],p=[],m=[],q=[],k=[],l=[],s="",o=[],w=[],t=[],r=[],u=["REFERRAL","ORGANIC","SOCIAL","CUSTOM"],A=["DIRECT","NEW"];jQuery(function(){jQuery("#gadwp-widget *").tooltip({tooltipClass:"gadwp"})});y=y[0];if(jQuery.isNumeric(y)||typeof y==="undefined"){y=[];y.totalsForAllResults=[];y.totalsForAllResults["rt:activeUsers"]="0";y.rows=[]}if(y.totalsForAllResults["rt:activeUsers"]!==document.getElementById("gadwp-online").innerHTML){jQuery("#gadwp-online").fadeOut("slow");jQuery("#gadwp-online").fadeOut(500);jQuery("#gadwp-online").fadeOut("slow",function(){if((parseInt(y.totalsForAllResults["rt:activeUsers"]))<(parseInt(document.getElementById("gadwp-online").innerHTML))){jQuery("#gadwp-online").css({"background-color":"#FFE8E8"})}else{jQuery("#gadwp-online").css({"background-color":"#E0FFEC"})}document.getElementById("gadwp-online").innerHTML=y.totalsForAllResults["rt:activeUsers"]});jQuery("#gadwp-online").fadeIn("slow");jQuery("#gadwp-online").fadeIn(500);jQuery("#gadwp-online").fadeIn("slow",function(){jQuery("#gadwp-online").css({"background-color":"#FFFFFF"})})}if(y.totalsForAllResults["rt:activeUsers"]==0){y.rows=[]}for(x=0;x<y.rows.length;x++){v.push(y.rows[x][0]);if(y.rows[x][3]=="REFERRAL"){z.push(y.rows[x][1])}if(y.rows[x][3]=="ORGANIC"){p.push(y.rows[x][2])}if(y.rows[x][3]=="SOCIAL"){m.push(y.rows[x][1])}if(y.rows[x][3]=="CUSTOM"){k.push(y.rows[x][1])}q.push(y.rows[x][3])}n=v.filter(e.rtOnlyUniqueValues);for(x=0;x<n.length;x++){l[x]={pagepath:n[x],count:e.rtCountSessions(y,n[x])}}l.sort(function(C,B){return B.count-C.count});s="";for(x=0;x<l.length;x++){if(x<gadwpItemData.rtLimitPages){s+='<div class="gadwp-pline"><div class="gadwp-pleft"><a href="#" data-gadwp="'+e.rtPageDetails(y,l[x].pagepath)+'">'+l[x].pagepath.substring(0,70)+'</a></div><div class="gadwp-pright">'+l[x].count+"</div></div>"}}document.getElementById("gadwp-pages").innerHTML='<br /><div class="gadwp-pg">'+s+"</div>";o=z.filter(e.rtOnlyUniqueValues);for(x=0;x<o.length;x++){o[x]={value:o[x],count:e.rtCountSessions(y,o[x])}}o.sort(function(C,B){return B.count-C.count});w=p.filter(e.rtOnlyUniqueValues);for(x=0;x<w.length;x++){w[x]={value:w[x],count:e.rtCountSessions(y,w[x])}}w.sort(function(C,B){return B.count-C.count});t=m.filter(e.rtOnlyUniqueValues);for(x=0;x<t.length;x++){t[x]={value:t[x],count:e.rtCountSessions(y,t[x])}}t.sort(function(C,B){return B.count-C.count});r=k.filter(e.rtOnlyUniqueValues);for(x=0;x<r.length;x++){r[x]={value:r[x],count:e.rtCountSessions(y,r[x])}}r.sort(function(C,B){return B.count-C.count});j='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(o)+'"><div class="gadwp-bleft">'+e.i18n[0]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[0])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(w)+'"><div class="gadwp-bleft">'+e.i18n[1]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[1])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(t)+'"><div class="gadwp-bleft">'+e.i18n[2]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[2])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(r)+'"><div class="gadwp-bleft">'+e.i18n[3]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[3])+"</div></div>";j+='<div class="gadwp-bigtext"><div class="gadwp-bleft">'+e.i18n[4]+'</div><div class="gadwp-bright">'+e.rtCountSessions(y,A[0])+"</div></div>";j+='<div class="gadwp-bigtext"><div class="gadwp-bleft">'+e.i18n[5]+'</div><div class="gadwp-bright">'+e.rtCountSessions(y,A[1])+"</div></div>";document.getElementById("gadwp-tdo-right").innerHTML=j},throwDebug:function(j){jQuery("#gadwp-status"+b).css({"margin-top":"3px","padding-left":"5px",height:"auto",color:"#000","border-left":"5px solid red"});if(j=="-24"){jQuery("#gadwp-status"+b).html(gadwpItemData.i18n[15])}else{jQuery("#gadwp-reports"+b).css({"background-color":"#F7F7F7",height:"auto","margin-top":"10px","padding-top":"50px","padding-bottom":"50px",color:"#000","text-align":"center"});jQuery("#gadwp-reports"+b).html(j);jQuery("#gadwp-reports"+b).show();jQuery("#gadwp-status"+b).html(gadwpItemData.i18n[11]);console.log("\n********************* GADWP Log ********************* \n\n"+j);a={action:"gadwp_set_error",response:j,gadwp_security_set_error:gadwpItemData.security};jQuery.post(gadwpItemData.ajaxurl,a)}},throwError:function(l,j,k){jQuery(l).css({"background-color":"#F7F7F7",height:"auto","padding-top":k,"padding-bottom":k,color:"#000","text-align":"center"});if(j==-21){jQuery(l).html(gadwpItemData.i18n[12])}else{jQuery(l).html(gadwpItemData.i18n[13]+" ("+j+")")}},render:function(j,o,n){var k,q,p,l,m;if(o=="realtime"){jQuery("#gadwp-sel-report"+b).hide()}else{jQuery("#gadwp-sel-report"+b).show();clearInterval(e.rtRuns)}jQuery("#gadwp-status"+b).html("");switch(o){case"today":q="today";p="today";break;case"yesterday":q="yesterday";p="yesterday";break;case"7daysAgo":q="7daysAgo";p="yesterday";break;case"14daysAgo":q="14daysAgo";p="yesterday";break;case"90daysAgo":q="90daysAgo";p="yesterday";break;case"365daysAgo":q="365daysAgo";p="yesterday";break;case"1095daysAgo":q="1095daysAgo";p="yesterday";break;default:q="30daysAgo";p="yesterday";break}d.setCookie("default_metric",n);d.setCookie("default_dimension",o);if(typeof j!=="undefined"){d.setCookie("default_view",j);k=j}else{k=false}if(gadwpItemData.scope=="admin-item"){a={action:"gadwp_backend_item_reports",gadwp_security_backend_item_reports:gadwpItemData.security,from:q,to:p,filter:g}}else{if(gadwpItemData.scope=="front-item"){a={action:"gadwp_frontend_item_reports",gadwp_security_frontend_item_reports:gadwpItemData.security,from:q,to:p,filter:gadwpItemData.filter}}else{a={action:"gadwp_backend_item_reports",gadwp_security_backend_item_reports:gadwpItemData.security,projectId:k,from:q,to:p}}}if(o=="realtime"){e.i18n=gadwpItemData.i18n.slice(20,26);e.render.focusFlag=1;jQuery(window).bind("focus",function(r){e.render.focusFlag=1}).bind("blur",function(r){e.render.focusFlag=0});l='<div id="gadwp-realtime'+b+'">';l+='<div class="gadwp-rt-box">';l+='<div class="gadwp-tdo-left">';l+='<div class="gadwp-online" id="gadwp-online">0</div>';l+="</div>";l+='<div class="gadwp-tdo-right" id="gadwp-tdo-right">';l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[0]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[1]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[2]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[3]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[4]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[5]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+="</div>";l+="</div>";l+="<div>";l+='<div id="gadwp-pages" class="gadwp-pages">&nbsp;</div>';l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);e.rtRefresh(e.render.focusFlag);e.rtRuns=setInterval(e.rtRefresh,55000)}else{if(jQuery.inArray(n,["referrers","contentpages","searches"])>-1){l='<div id="gadwp-orgcharttablechart'+b+'">';l+='<div id="gadwp-orgchart'+b+'"></div>';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query="channelGrouping,"+n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.orgChartTableChart(r)})}else{if(n=="404errors"){l='<div id="gadwp-404tablechart'+b+'">';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query=n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.tableChart(r)})}else{if(n=="trafficdetails"||n=="technologydetails"){l='<div id="gadwp-orgchartpiecharts'+b+'">';l+='<div id="gadwp-orgchart'+b+'"></div>';l+='<div class="gadwp-floatwraper">';l+='<div id="gadwp-piechart-1'+b+'" class="halfsize floatleft"></div>';l+='<div id="gadwp-piechart-2'+b+'" class="halfsize floatright"></div>';l+="</div>";l+='<div class="gadwp-floatwraper">';l+='<div id="gadwp-piechart-3'+b+'" class="halfsize floatleft"></div>';l+='<div id="gadwp-piechart-4'+b+'" class="halfsize floatright"></div>';l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();if(n=="trafficdetails"){a.query="channelGrouping,medium,visitorType,source,socialNetwork";e.i18n=gadwpItemData.i18n.slice(0,5)}else{e.i18n=gadwpItemData.i18n.slice(15,20);a.query="deviceCategory,browser,operatingSystem,screenResolution,mobileDeviceBranding"}a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.orgChartPieCharts(r)})}else{if(n=="locations"){l='<div id="gadwp-geocharttablechart'+b+'">';l+='<div id="gadwp-geochart'+b+'"></div>';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query=n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.geoChartTableChart(r)})}else{l='<div id="gadwp-areachartbottomstats'+b+'">';l+='<div id="gadwp-areachart'+b+'"></div>';l+='<div id="gadwp-bottomstats'+b+'">';l+='<div class="inside">';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[5]+'</h3><p id="gdsessions'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[6]+'</h3><p id="gdusers'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[7]+'</h3><p id="gdpageviews'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[8]+'</h3><p id="gdbouncerate'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[9]+'</h3><p id="gdorganicsearch'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[10]+'</h3><p id="gdpagespervisit'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[26]+'</h3><p id="gdpagetime'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[27]+'</h3><p id="gdpageload'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[28]+'</h3><p id="gdsessionduration'+b+'">&nbsp;</p></div>';l+="</div>";l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();a.query=n+",bottomstats";jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.areaChartBottomStats(r)})}}}}}},refresh:function(){if(jQuery("#gadwp-areachartbottomstats"+b).length>0&&jQuery.isArray(e.areaChartBottomStatsData)){e.areaChartBottomStats(e.areaChartBottomStatsData)}if(jQuery("#gadwp-orgchartpiecharts"+b).length>0&&jQuery.isArray(e.orgChartPieChartsData)){e.orgChartPieCharts(e.orgChartPieChartsData)}if(jQuery("#gadwp-geocharttablechart"+b).length>0&&jQuery.isArray(e.geoChartTableChartData)){e.geoChartTableChart(e.geoChartTableChartData)}if(jQuery("#gadwp-orgcharttablechart"+b).length>0&&jQuery.isArray(e.orgChartTableChartData)){e.orgChartTableChart(e.orgChartTableChartData)}if(jQuery("#gadwp-404tablechart"+b).length>0&&jQuery.isArray(e.tableChartData)){e.tableChart(e.tableChartData)}},init:function(){if(!jQuery("#gadwp-reports"+b).length){return}if(jQuery("#gadwp-reports"+b).html().length){return}try{NProgress.configure({parent:"#gadwp-progressbar"+b,showSpinner:false});NProgress.start()}catch(j){e.alertMessage(gadwpItemData.i18n[0])}e.render(jQuery("#gadwp-sel-view"+b).val(),jQuery("#gadwp-sel-period"+b).val(),jQuery("#gadwp-sel-report"+b).val());jQuery(window).resize(function(){var k=jQuery(window).width()-e.oldViewPort;if((k<-5)||(k>5)){e.oldViewPort=jQuery(window).width();e.refresh()}})}};h.init();e.init();jQuery("#gadwp-sel-view"+b).change(function(){jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("#gadwp-sel-period"+b).change(function(){jQuery("#gadwp-sel-metric"+b).hide();jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("#gadwp-sel-report"+b).change(function(){jQuery("#gadwp-sel-metric"+b).hide();jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("[id^=gadwp-swmetric-]").click(function(){c=this.id.replace("gadwp-swmetric-","");d.setCookie("default_swmetric",c);jQuery("#gadwp-swmetric-sessions").css("color","#444");jQuery("#gadwp-swmetric-users").css("color","#444");jQuery("#gadwp-swmetric-pageviews").css("color","#444");jQuery("#"+this.id).css("color","#008ec2");jQuery("#gadwp-reports"+b).html("");e.init()});if(gadwpItemData.scope=="admin-widgets"){return}else{return this.dialog({width:"auto",maxWidth:510,height:"auto",modal:true,fluid:true,dialogClass:"gadwp wp-dialog",resizable:false,title:e.getTitle(gadwpItemData.scope),position:{my:"top",at:"top+100",of:window}})}}});function GADWPReportLoad(){if(gadwpItemData.scope=="admin-widgets"){jQuery("#gadwp-window-1").gadwpItemReport(1)}else{jQuery(gadwpItemData.getSelector(gadwpItemData.scope)).click(function(){if(!jQuery("#gadwp-window-"+gadwpItemData.getID(this)).length>0){jQuery("body").append('<div id="gadwp-window-'+gadwpItemData.getID(this)+'"></div>')}jQuery("#gadwp-window-"+gadwpItemData.getID(this)).gadwpItemReport(gadwpItemData.getID(this))})}jQuery(window).resize(function(){gadwpItemData.responsiveDialog()});jQuery(document).on("dialogopen",".ui-dialog",function(a,b){gadwpItemData.responsiveDialog()})};
{common → tags/5.3.1.1/common}/nprogress/nprogress.css RENAMED
File without changes
{common → tags/5.3.1.1/common}/nprogress/nprogress.js RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-bg_flat_0_aaaaaa_40x100.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-bg_flat_75_ffffff_40x100.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_55_fbf9ee_1x400.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_65_ffffff_1x400.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_75_dadada_1x400.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_75_e6e6e6_1x400.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-bg_glass_95_fef1ec_1x400.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-bg_highlight-soft_75_cccccc_1x100.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-icons_222222_256x240.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-icons_2e83ff_256x240.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-icons_454545_256x240.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-icons_888888_256x240.png RENAMED
File without changes
{common → tags/5.3.1.1/common}/realtime/images/ui-icons_cd0a0a_256x240.png RENAMED
File without changes
tags/5.3.1.1/common/realtime/jquery.ui.tooltip.html.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! jQuery UI - v1.9.2 - 2013-09-22
2
+ * http://jqueryui.com
3
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */.ui-tooltip.gadwp{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}* html .ui-tooltip.gadwp{background-image:none}body .ui-tooltip.gadwp{border-width:2px}.ui-widget.gadwp{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget.gadwp .ui-widget{font-size:1em}.ui-widget.gadwp input,.ui-widget.gadwp select,.ui-widget.gadwp textarea,.ui-widget.gadwp button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content.gadwp{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content.gadwp a{color:#222}.gadwp .ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.gadwp .ui-widget-header a{color:#222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cu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Config' ) ) {
15
+
16
+ final class GADWP_Config {
17
+
18
+ public $options;
19
+
20
+ public function __construct() {
21
+ // Rename old option keys
22
+ $this->option_keys_rename(); // v5.2
23
+ // Get plugin options
24
+ $this->get_plugin_options();
25
+ // Automatic updates
26
+ add_filter( 'auto_update_plugin', array( $this, 'automatic_update' ), 10, 2 );
27
+ // Provide language packs for all available Network languages
28
+ if ( is_multisite() ) {
29
+ add_filter( 'plugins_update_check_locales', array( $this, 'translation_updates' ), 10, 1 );
30
+ }
31
+ }
32
+
33
+ public function get_major_version( $version ) {
34
+ $exploded_version = explode( '.', $version );
35
+ if ( isset( $exploded_version[2] ) ) {
36
+ return $exploded_version[0] . '.' . $exploded_version[1] . '.' . $exploded_version[2];
37
+ } else {
38
+ return $exploded_version[0] . '.' . $exploded_version[1] . '.0';
39
+ }
40
+ }
41
+
42
+ public function automatic_update( $update, $item ) {
43
+ $item = (array) $item;
44
+ if ( is_multisite() && ! is_main_site() ) {
45
+ return;
46
+ }
47
+ if ( ! isset( $item['new_version'] ) || ! isset( $item['plugin'] ) || ! $this->options['automatic_updates_minorversion'] ) {
48
+ return $update;
49
+ }
50
+ if ( isset( $item['slug'] ) && 'google-analytics-dashboard-for-wp' == $item['slug'] ) {
51
+ // Only when a minor update is available
52
+ if ( $this->get_major_version( GADWP_CURRENT_VERSION ) == $this->get_major_version( $item['new_version'] ) ) {
53
+ return ( $this->get_major_version( GADWP_CURRENT_VERSION ) == $this->get_major_version( $item['new_version'] ) );
54
+ }
55
+ }
56
+ return $update;
57
+ }
58
+
59
+ public function translation_updates( $locales ) {
60
+ $languages = get_available_languages();
61
+ return array_values( $languages );
62
+ }
63
+
64
+ // Validates data before storing
65
+ private function validate_data( $options ) {
66
+ /* @formatter:off */
67
+ $numerics = array( 'ga_realtime_pages',
68
+ 'ga_enhanced_links',
69
+ 'ga_crossdomain_tracking',
70
+ 'ga_author_dimindex',
71
+ 'ga_category_dimindex',
72
+ 'ga_tag_dimindex',
73
+ 'ga_user_dimindex',
74
+ 'ga_pubyear_dimindex',
75
+ 'ga_pubyearmonth_dimindex',
76
+ 'tm_author_var',
77
+ 'tm_category_var',
78
+ 'tm_tag_var',
79
+ 'tm_user_var',
80
+ 'tm_pubyear_var',
81
+ 'tm_pubyearmonth_var',
82
+ 'ga_aff_tracking',
83
+ 'amp_tracking_analytics',
84
+ 'amp_tracking_clientidapi',
85
+ 'amp_tracking_tagmanager',
86
+ 'optimize_tracking',
87
+ 'optimize_pagehiding',
88
+ 'trackingcode_infooter',
89
+ 'trackingevents_infooter',
90
+ 'ga_formsubmit_tracking',
91
+ 'superadmin_tracking',
92
+ 'ga_pagescrolldepth_tracking',
93
+ 'tm_pagescrolldepth_tracking',
94
+ 'ga_speed_samplerate',
95
+ 'ga_user_samplerate',
96
+ 'ga_event_precision',
97
+ 'with_endpoint',
98
+ 'backend_realtime_report',
99
+ 'ga_optout',
100
+ 'ga_dnt_optout',
101
+ 'ga_with_gtag',
102
+ );
103
+ foreach ( $numerics as $key ) {
104
+ if ( isset( $options[$key] ) ) {
105
+ $options[$key] = (int) $options[$key];
106
+ }
107
+ }
108
+
109
+ $texts = array( 'ga_crossdomain_list',
110
+ 'client_id',
111
+ 'client_secret',
112
+ 'theme_color',
113
+ 'ga_target_geomap',
114
+ 'ga_cookiedomain',
115
+ 'ga_cookiename',
116
+ 'pagetitle_404',
117
+ 'maps_api_key',
118
+ 'web_containerid',
119
+ 'amp_containerid',
120
+ 'optimize_containerid',
121
+ 'ga_event_downloads',
122
+ 'ga_event_affiliates',
123
+ 'ecommerce_mode',
124
+ 'tracking_type',
125
+ );
126
+ foreach ( $texts as $key ) {
127
+ if ( isset( $options[$key] ) ) {
128
+ $options[$key] = trim (sanitize_text_field( $options[$key] ));
129
+ }
130
+ }
131
+ /* @formatter:on */
132
+
133
+ if ( isset( $options['ga_event_downloads'] ) && empty( $options['ga_event_downloads'] ) ) {
134
+ $options['ga_event_downloads'] = 'zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*';
135
+ }
136
+
137
+ if ( isset( $options['pagetitle_404'] ) && empty( $options['pagetitle_404'] ) ) {
138
+ $options['pagetitle_404'] = 'Page Not Found';
139
+ }
140
+
141
+ if ( isset( $options['ga_event_affiliates'] ) && empty( $options['ga_event_affiliates'] ) ) {
142
+ $options['ga_event_affiliates'] = '/out/';
143
+ }
144
+
145
+ if ( isset( $options['ga_speed_samplerate'] ) && ( $options['ga_speed_samplerate'] < 1 || $options['ga_speed_samplerate'] > 100 ) ) {
146
+ $options['ga_speed_samplerate'] = 1;
147
+ }
148
+
149
+ if ( isset( $options['ga_user_samplerate'] ) && ( $options['ga_user_samplerate'] < 1 || $options['ga_user_samplerate'] > 100 ) ) {
150
+ $options['ga_user_samplerate'] = 100;
151
+ }
152
+
153
+ if ( isset( $options['ga_cookieexpires'] ) && $options['ga_cookieexpires'] ) { // v4.9
154
+ $options['ga_cookieexpires'] = (int) $options['ga_cookieexpires'];
155
+ }
156
+
157
+ return $options;
158
+ }
159
+
160
+ public function set_plugin_options( $network_settings = false ) {
161
+ // Handle Network Mode
162
+ $options = $this->options;
163
+ $get_network_options = get_site_option( 'gadwp_network_options' );
164
+ $old_network_options = (array) json_decode( $get_network_options );
165
+
166
+ if ( is_multisite() ) {
167
+ if ( $network_settings ) { // Retrieve network options, clear blog options, store both to db
168
+ $network_options['token'] = $this->options['token'];
169
+ $options['token'] = '';
170
+ if ( is_network_admin() ) {
171
+ $network_options['ga_profiles_list'] = $this->options['ga_profiles_list'];
172
+ $options['ga_profiles_list'] = array();
173
+ $network_options['client_id'] = $this->options['client_id'];
174
+ $options['client_id'] = '';
175
+ $network_options['client_secret'] = $this->options['client_secret'];
176
+ $options['client_secret'] = '';
177
+ $network_options['user_api'] = $this->options['user_api'];
178
+ $options['user_api'] = 0;
179
+ $network_options['network_mode'] = $this->options['network_mode'];
180
+ $network_options['superadmin_tracking'] = $this->options['superadmin_tracking'];
181
+ $network_options['automatic_updates_minorversion'] = $this->options['automatic_updates_minorversion'];
182
+ unset( $options['network_mode'] );
183
+ if ( isset( $this->options['network_tableid'] ) ) {
184
+ $network_options['network_tableid'] = $this->options['network_tableid'];
185
+ unset( $options['network_tableid'] );
186
+ }
187
+ }
188
+ $merged_options = array_merge( $old_network_options, $network_options );
189
+ update_site_option( 'gadwp_network_options', json_encode( $this->validate_data( $merged_options ) ) );
190
+ }
191
+ }
192
+ update_option( 'gadwp_options', json_encode( $this->validate_data( $options ) ) );
193
+ }
194
+
195
+ private function get_plugin_options() {
196
+ /*
197
+ * Get plugin options
198
+ */
199
+ global $blog_id;
200
+
201
+ if ( ! get_option( 'gadwp_options' ) ) {
202
+ GADWP_Install::install();
203
+ }
204
+ $this->options = (array) json_decode( get_option( 'gadwp_options' ) );
205
+ // Maintain Compatibility
206
+ $this->maintain_compatibility();
207
+ // Handle Network Mode
208
+ if ( is_multisite() ) {
209
+ $get_network_options = get_site_option( 'gadwp_network_options' );
210
+ $network_options = (array) json_decode( $get_network_options );
211
+ if ( isset( $network_options['network_mode'] ) && ( $network_options['network_mode'] ) ) {
212
+ if ( ! is_network_admin() && ! empty( $network_options['ga_profiles_list'] ) && isset( $network_options['network_tableid']->$blog_id ) ) {
213
+ $network_options['ga_profiles_list'] = array( 0 => GADWP_Tools::get_selected_profile( $network_options['ga_profiles_list'], $network_options['network_tableid']->$blog_id ) );
214
+ $network_options['tableid_jail'] = $network_options['ga_profiles_list'][0][1];
215
+ }
216
+ $this->options = array_merge( $this->options, $network_options );
217
+ } else {
218
+ $this->options['network_mode'] = 0;
219
+ }
220
+ }
221
+ }
222
+
223
+ private function maintain_compatibility() {
224
+ $flag = false;
225
+
226
+ $prevver = get_option( 'gadwp_version' );
227
+ if ( $prevver && GADWP_CURRENT_VERSION != $prevver ) {
228
+ $flag = true;
229
+ update_option( 'gadwp_version', GADWP_CURRENT_VERSION );
230
+ update_option( 'gadwp_got_updated', true );
231
+ GADWP_Tools::clear_cache();
232
+ GADWP_Tools::delete_cache( 'last_error' );
233
+ if ( is_multisite() ) { // Cleanup errors and cookies on the entire network
234
+ foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) {
235
+ switch_to_blog( $blog['blog_id'] );
236
+ GADWP_Tools::delete_cache( 'gapi_errors' );
237
+ restore_current_blog();
238
+ }
239
+ } else {
240
+ GADWP_Tools::delete_cache( 'gapi_errors' );
241
+ }
242
+
243
+ // Enable GADWP EndPoint for those updating from a version lower than 5.2, introduced in GADWP v5.3
244
+ if (version_compare( $prevver, '5.2', '<' ) ) {
245
+ $this->options['with_endpoint'] = 2;
246
+ }
247
+ }
248
+
249
+ if ( isset( $this->options['item_reports'] ) ) { // v4.8
250
+ $this->options['backend_item_reports'] = $this->options['item_reports'];
251
+ }
252
+ if ( isset( $this->options['ga_dash_frontend_stats'] ) ) { // v4.8
253
+ $this->options['frontend_item_reports'] = $this->options['ga_dash_frontend_stats'];
254
+ }
255
+
256
+ /* @formatter:off */
257
+ $zeros = array( 'ga_enhanced_links',
258
+ 'network_mode',
259
+ 'ga_enhanced_excludesa',
260
+ 'ga_remarketing',
261
+ 'ga_event_bouncerate',
262
+ 'ga_author_dimindex',
263
+ 'ga_tag_dimindex',
264
+ 'ga_category_dimindex',
265
+ 'ga_user_dimindex',
266
+ 'ga_pubyear_dimindex',
267
+ 'ga_pubyearmonth_dimindex',
268
+ 'tm_author_var', // v5.0
269
+ 'tm_category_var', // v5.0
270
+ 'tm_tag_var', // v5.0
271
+ 'tm_user_var', // v5.0
272
+ 'tm_pubyear_var', // v5.0
273
+ 'tm_pubyearmonth_var', // v5.0
274
+ 'ga_crossdomain_tracking',
275
+ 'api_backoff', // v4.8.1.3
276
+ 'ga_aff_tracking',
277
+ 'ga_hash_tracking',
278
+ 'switch_profile', // V4.7
279
+ 'amp_tracking_analytics', //v5.0
280
+ 'amp_tracking_clientidapi', //v5.1.2
281
+ 'optimize_tracking', //v5.0
282
+ 'optimize_pagehiding', //v5.0
283
+ 'amp_tracking_tagmanager', //v5.0
284
+ 'trackingcode_infooter', //v5.0
285
+ 'trackingevents_infooter', //v5.0
286
+ 'ga_formsubmit_tracking', //v5.0
287
+ 'superadmin_tracking', //v5.0
288
+ 'ga_pagescrolldepth_tracking', //v5.0
289
+ 'tm_pagescrolldepth_tracking', //v5.0
290
+ 'ga_event_precision', //v5.1.1.1
291
+ 'ga_force_ssl', //v5.1.2
292
+ 'with_endpoint', //v5.2
293
+ 'backend_realtime_report', //v5.2
294
+ 'ga_optout', //v5.2.3
295
+ 'ga_dnt_optout', //v5.2.3
296
+ 'ga_with_gtag', //v5.3
297
+ 'frontend_item_reports',
298
+ );
299
+ foreach ( $zeros as $key ) {
300
+ if ( ! isset( $this->options[$key] ) ) {
301
+ $this->options[$key] = 0;
302
+ $flag = true;
303
+ }
304
+ }
305
+
306
+ if ( isset($this->options['ga_dash_tracking']) && 0 == $this->options['ga_dash_tracking'] ) { // v5.0.1
307
+ $this->options['tracking_type'] = 'disabled';
308
+ $flag = true;
309
+ }
310
+
311
+ $unsets = array( 'ga_dash_jailadmins', // v4.7
312
+ 'ga_tracking_code',
313
+ 'ga_dash_tableid', // v4.9
314
+ 'ga_dash_frontend_keywords', // v4.8
315
+ 'ga_dash_apikey', // v4.9.1.3
316
+ 'ga_dash_default_metric', // v4.8.1
317
+ 'ga_dash_default_dimension', // v4.8.1
318
+ 'ga_dash_adsense', // v5.0
319
+ 'ga_dash_frontend_stats', // v4.8
320
+ 'item_reports', // v4.8
321
+ 'ga_dash_tracking', // v5.0
322
+ 'ga_dash_cachetime', // v5.2
323
+ 'ga_dash_default_ua', // v5.2
324
+ 'ga_dash_hidden', // v5.2
325
+ );
326
+ foreach ( $unsets as $key ) {
327
+ if ( isset( $this->options[$key] ) ) {
328
+ unset( $this->options[$key] );
329
+ $flag = true;
330
+ }
331
+ }
332
+
333
+ $empties = array( 'ga_crossdomain_list',
334
+ 'ga_cookiedomain', // v4.9.4
335
+ 'ga_cookiename', // v4.9.4
336
+ 'ga_cookieexpires', // v4.9.4
337
+ 'maps_api_key', // v4.9.4
338
+ 'web_containerid', // v5.0
339
+ 'amp_containerid', // v5.0
340
+ 'optimize_containerid', // v5.0
341
+ );
342
+ foreach ( $empties as $key ) {
343
+ if ( ! isset( $this->options[$key] ) ) {
344
+ $this->options[$key] = '';
345
+ $flag = true;
346
+ }
347
+ }
348
+
349
+ $ones = array( 'ga_speed_samplerate',
350
+ 'automatic_updates_minorversion',
351
+ 'backend_item_reports', // v4.8
352
+ 'dashboard_widget', // v4.7
353
+ );
354
+ foreach ( $ones as $key ) {
355
+ if ( ! isset( $this->options[$key] ) ) {
356
+ $this->options[$key] = 1;
357
+ $flag = true;
358
+ }
359
+ }
360
+
361
+ $arrays = array( 'access_front',
362
+ 'access_back',
363
+ 'ga_profiles_list',
364
+ 'track_exclude',
365
+ );
366
+ foreach ( $arrays as $key ) {
367
+ if ( ! is_array( $this->options[$key] ) ) {
368
+ $this->options[$key] = array();
369
+ $flag = true;
370
+ }
371
+ }
372
+ if ( empty( $this->options['access_front'] ) ) {
373
+ $this->options['access_front'][] = 'administrator';
374
+ }
375
+ if ( empty( $this->options['access_back'] ) ) {
376
+ $this->options['access_back'][] = 'administrator';
377
+ }
378
+ /* @formatter:on */
379
+
380
+ if ( ! isset( $this->options['ga_event_affiliates'] ) ) {
381
+ $this->options['ga_event_affiliates'] = '/out/';
382
+ $flag = true;
383
+ }
384
+
385
+ if ( ! isset( $this->options['ga_user_samplerate'] ) ) {
386
+ $this->options['ga_user_samplerate'] = 100;
387
+ }
388
+
389
+ if ( ! isset( $this->options['ga_event_downloads'] ) ) {
390
+ $this->options['ga_event_downloads'] = 'zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*';
391
+ $flag = true;
392
+ }
393
+
394
+ if ( ! isset( $this->options['pagetitle_404'] ) ) { // v4.9.4
395
+ $this->options['pagetitle_404'] = 'Page Not Found';
396
+ $flag = true;
397
+ }
398
+
399
+ if ( ! isset( $this->options['ecommerce_mode'] ) ) { // v5.0
400
+ $this->options['ecommerce_mode'] = 'disabled';
401
+ $flag = true;
402
+ }
403
+
404
+ if ( isset( $this->options['ga_dash_tracking'] ) && 'classic' == $this->options['ga_dash_tracking'] ) { // v5.0
405
+ $this->options['tracking_type'] = 'universal';
406
+ $flag = true;
407
+ }
408
+
409
+ if ( $flag ) {
410
+ $this->set_plugin_options( false );
411
+ }
412
+ }
413
+
414
+ private function option_keys_rename() {
415
+
416
+ /* @formatter:off */
417
+ $batch = array( 'ga_dash_token' => 'token',
418
+ 'ga_dash_clientid' => 'client_id',
419
+ 'ga_dash_clientsecret' => 'client_secret',
420
+ 'ga_dash_access_front' => 'access_front',
421
+ 'ga_dash_access_back' => 'access_back',
422
+ 'ga_dash_tableid_jail' => 'tableid_jail',
423
+ 'ga_dash_tracking_type' => 'tracking_type',
424
+ 'ga_dash_userapi' => 'user_api',
425
+ 'ga_dash_network' => 'network_mode',
426
+ 'ga_dash_tableid_network' => 'network_tableid',
427
+ 'ga_dash_anonim' => 'ga_anonymize_ip',
428
+ 'ga_dash_profile_list' => 'ga_profiles_list',
429
+ 'ga_dash_remarketing' => 'ga_remarketing',
430
+ 'ga_dash_excludesa' => 'superadmin_tracking',
431
+ 'ga_track_exclude' => 'track_exclude',
432
+ 'ga_dash_style' => 'theme_color',
433
+ );
434
+ /* @formatter:on */
435
+
436
+ if ( is_multisite() ) {
437
+ $options = get_site_option( 'gadash_network_options' );
438
+ if ( $options ) {
439
+ $options = (array) json_decode( $options );
440
+ $options = GADWP_Tools::array_keys_rename( $options, $batch );
441
+ update_site_option( 'gadwp_network_options', json_encode( $this->validate_data( $options ) ) );
442
+ delete_site_option( 'gadash_network_options' );
443
+ }
444
+ }
445
+
446
+ $options = get_option( 'gadash_options' );
447
+ if ( $options ) {
448
+ $options = (array) json_decode( $options );
449
+ $options = GADWP_Tools::array_keys_rename( $options, $batch );
450
+ update_option( 'gadwp_options', json_encode( $this->validate_data( $options ) ) );
451
+ delete_option( 'gadash_options' );
452
+ }
453
+ }
454
+ }
455
+ }
456
+
tags/5.3.1.1/front/ajax-actions.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Frontend_Ajax' ) ) {
15
+
16
+ final class GADWP_Frontend_Ajax {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
24
+ // Item Reports action
25
+ add_action( 'wp_ajax_gadwp_frontend_item_reports', array( $this, 'ajax_item_reports' ) );
26
+ }
27
+
28
+ // Frontend Widget actions
29
+ add_action( 'wp_ajax_ajax_frontwidget_report', array( $this, 'ajax_frontend_widget' ) );
30
+ add_action( 'wp_ajax_nopriv_ajax_frontwidget_report', array( $this, 'ajax_frontend_widget' ) );
31
+ }
32
+
33
+ /**
34
+ * Ajax handler for Item Reports
35
+ *
36
+ * @return string|int
37
+ */
38
+ public function ajax_item_reports() {
39
+ if ( ! isset( $_POST['gadwp_security_frontend_item_reports'] ) || ! wp_verify_nonce( $_POST['gadwp_security_frontend_item_reports'], 'gadwp_frontend_item_reports' ) ) {
40
+ wp_die( - 30 );
41
+ }
42
+
43
+ $from = $_POST['from'];
44
+ $to = $_POST['to'];
45
+ $query = $_POST['query'];
46
+ $uri = $_POST['filter'];
47
+ if ( isset( $_POST['metric'] ) ) {
48
+ $metric = $_POST['metric'];
49
+ } else {
50
+ $metric = 'pageviews';
51
+ }
52
+
53
+ $query = $_POST['query'];
54
+ if ( ob_get_length() ) {
55
+ ob_clean();
56
+ }
57
+
58
+ if ( ! GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) || 0 == $this->gadwp->config->options['frontend_item_reports'] ) {
59
+ wp_die( - 31 );
60
+ }
61
+
62
+ if ( $this->gadwp->config->options['token'] && $this->gadwp->config->options['tableid_jail'] ) {
63
+ if ( null === $this->gadwp->gapi_controller ) {
64
+ $this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
65
+ }
66
+ } else {
67
+ wp_die( - 24 );
68
+ }
69
+
70
+ if ( $this->gadwp->config->options['tableid_jail'] ) {
71
+ $projectId = $this->gadwp->config->options['tableid_jail'];
72
+ } else {
73
+ wp_die( - 26 );
74
+ }
75
+
76
+ $profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $projectId );
77
+
78
+ if ( isset( $profile_info[4] ) ) {
79
+ $this->gadwp->gapi_controller->timeshift = $profile_info[4];
80
+ } else {
81
+ $this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
82
+ }
83
+
84
+ $uri = '/' . ltrim( $uri, '/' );
85
+
86
+ // allow URL correction before sending an API request
87
+ $filter = apply_filters( 'gadwp_frontenditem_uri', $uri );
88
+
89
+ $lastchar = substr( $filter, - 1 );
90
+
91
+ if ( isset( $profile_info[6] ) && $profile_info[6] && '/' == $lastchar ) {
92
+ $filter = $filter . $profile_info[6];
93
+ }
94
+
95
+ // Encode URL
96
+ $filter = rawurlencode( rawurldecode( $filter ) );
97
+
98
+ $queries = explode( ',', $query );
99
+
100
+ $results = array();
101
+
102
+ foreach ( $queries as $value ) {
103
+ $results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to, $filter, $metric );
104
+ }
105
+
106
+ wp_send_json( $results );
107
+ }
108
+
109
+ /**
110
+ * Ajax handler for getting analytics data for frontend Widget
111
+ *
112
+ * @return string|int
113
+ */
114
+ public function ajax_frontend_widget() {
115
+ if ( ! isset( $_POST['gadwp_number'] ) || ! isset( $_POST['gadwp_optionname'] ) || ! is_active_widget( false, false, 'gadwp-frontwidget-report' ) ) {
116
+ wp_die( - 30 );
117
+ }
118
+ $widget_index = $_POST['gadwp_number'];
119
+ $option_name = $_POST['gadwp_optionname'];
120
+ $options = get_option( $option_name );
121
+ if ( isset( $options[$widget_index] ) ) {
122
+ $instance = $options[$widget_index];
123
+ } else {
124
+ wp_die( - 32 );
125
+ }
126
+ switch ( $instance['period'] ) { // make sure we have a valid request
127
+ case '7daysAgo' :
128
+ $period = '7daysAgo';
129
+ break;
130
+ case '14daysAgo' :
131
+ $period = '14daysAgo';
132
+ break;
133
+ default :
134
+ $period = '30daysAgo';
135
+ break;
136
+ }
137
+ if ( ob_get_length() ) {
138
+ ob_clean();
139
+ }
140
+ if ( $this->gadwp->config->options['token'] && $this->gadwp->config->options['tableid_jail'] ) {
141
+ if ( null === $this->gadwp->gapi_controller ) {
142
+ $this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
143
+ }
144
+ } else {
145
+ wp_die( - 24 );
146
+ }
147
+ $projectId = $this->gadwp->config->options['tableid_jail'];
148
+ $profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $projectId );
149
+ if ( isset( $profile_info[4] ) ) {
150
+ $this->gadwp->gapi_controller->timeshift = $profile_info[4];
151
+ } else {
152
+ $this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
153
+ }
154
+ wp_send_json( $this->gadwp->gapi_controller->frontend_widget_stats( $projectId, $period, (int) $instance['anonim'] ) );
155
+ }
156
+ }
157
+ }
{front → tags/5.3.1.1/front}/css/item-reports.css RENAMED
File without changes
{front → tags/5.3.1.1/front}/css/widgets.css RENAMED
File without changes
tags/5.3.1.1/front/item-reports.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Frontend_Item_Reports' ) ) {
15
+
16
+ final class GADWP_Frontend_Item_Reports {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ add_action( 'admin_bar_menu', array( $this, 'custom_adminbar_node' ), 999 );
24
+ }
25
+
26
+ function custom_adminbar_node( $wp_admin_bar ) {
27
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
28
+ /* @formatter:off */
29
+ $args = array( 'id' => 'gadwp-1',
30
+ 'title' => '<span class="ab-icon"></span><span class="">' . __( "Analytics", 'google-analytics-dashboard-for-wp' ) . '</span>',
31
+ 'href' => '#1',
32
+ );
33
+ /* @formatter:on */
34
+ $wp_admin_bar->add_node( $args );
35
+ }
36
+ }
37
+ }
38
+ }
{front → tags/5.3.1.1/front}/js/tracking-analytics-events.js RENAMED
File without changes
{front → tags/5.3.1.1/front}/js/tracking-scrolldepth.js RENAMED
File without changes
{front → tags/5.3.1.1/front}/js/widgets.js RENAMED
File without changes
tags/5.3.1.1/front/setup.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Frontend_Setup' ) ) {
15
+
16
+ final class GADWP_Frontend_Setup {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ // Styles & Scripts
24
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
+ }
26
+
27
+ /**
28
+ * Styles & Scripts conditional loading
29
+ *
30
+ * @param
31
+ * $hook
32
+ */
33
+ public function load_styles_scripts() {
34
+ $lang = get_bloginfo( 'language' );
35
+ $lang = explode( '-', $lang );
36
+ $lang = $lang[0];
37
+
38
+ /*
39
+ * Item reports Styles & Scripts
40
+ */
41
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
42
+
43
+ wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
44
+
45
+ wp_enqueue_style( 'gadwp-frontend-item-reports', GADWP_URL . 'front/css/item-reports.css', null, GADWP_CURRENT_VERSION );
46
+
47
+ $country_codes = GADWP_Tools::get_countrycodes();
48
+ if ( $this->gadwp->config->options['ga_target_geomap'] && isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
49
+ $region = $this->gadwp->config->options['ga_target_geomap'];
50
+ } else {
51
+ $region = false;
52
+ }
53
+
54
+ wp_enqueue_style( "wp-jquery-ui-dialog" );
55
+
56
+ wp_register_script( 'googlecharts', 'https://www.gstatic.com/charts/loader.js', array(), null );
57
+
58
+ wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
59
+
60
+ wp_enqueue_script( 'gadwp-frontend-item-reports', GADWP_URL . 'common/js/reports5.js', array( 'gadwp-nprogress', 'googlecharts', 'jquery', 'jquery-ui-dialog' ), GADWP_CURRENT_VERSION, true );
61
+
62
+ /* @formatter:off */
63
+ wp_localize_script( 'gadwp-frontend-item-reports', 'gadwpItemData', array(
64
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
65
+ 'security' => wp_create_nonce( 'gadwp_frontend_item_reports' ),
66
+ 'dateList' => array(
67
+ 'today' => __( "Today", 'google-analytics-dashboard-for-wp' ),
68
+ 'yesterday' => __( "Yesterday", 'google-analytics-dashboard-for-wp' ),
69
+ '7daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 7 ),
70
+ '14daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 14 ),
71
+ '30daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 30 ),
72
+ '90daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 90 ),
73
+ '365daysAgo' => sprintf( _n( "%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp' ), __('One', 'google-analytics-dashboard-for-wp') ),
74
+ '1095daysAgo' => sprintf( _n( "%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp' ), __('Three', 'google-analytics-dashboard-for-wp') ),
75
+ ),
76
+ 'reportList' => array(
77
+ 'uniquePageviews' => __( "Unique Views", 'google-analytics-dashboard-for-wp' ),
78
+ 'users' => __( "Users", 'google-analytics-dashboard-for-wp' ),
79
+ 'organicSearches' => __( "Organic", 'google-analytics-dashboard-for-wp' ),
80
+ 'pageviews' => __( "Page Views", 'google-analytics-dashboard-for-wp' ),
81
+ 'visitBounceRate' => __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
82
+ 'locations' => __( "Location", 'google-analytics-dashboard-for-wp' ),
83
+ 'referrers' => __( "Referrers", 'google-analytics-dashboard-for-wp' ),
84
+ 'searches' => __( "Searches", 'google-analytics-dashboard-for-wp' ),
85
+ 'trafficdetails' => __( "Traffic", 'google-analytics-dashboard-for-wp' ),
86
+ 'technologydetails' => __( "Technology", 'google-analytics-dashboard-for-wp' ),
87
+ ),
88
+ 'i18n' => array(
89
+ __( "A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp' ), //0
90
+ __( "Traffic Mediums", 'google-analytics-dashboard-for-wp' ),
91
+ __( "Visitor Type", 'google-analytics-dashboard-for-wp' ),
92
+ __( "Search Engines", 'google-analytics-dashboard-for-wp' ),
93
+ __( "Social Networks", 'google-analytics-dashboard-for-wp' ),
94
+ __( "Unique Views", 'google-analytics-dashboard-for-wp' ),
95
+ __( "Users", 'google-analytics-dashboard-for-wp' ),
96
+ __( "Page Views", 'google-analytics-dashboard-for-wp' ),
97
+ __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
98
+ __( "Organic Search", 'google-analytics-dashboard-for-wp' ),
99
+ __( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
100
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
101
+ __( "No Data", 'google-analytics-dashboard-for-wp' ),
102
+ __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
103
+ __( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
104
+ __( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <strong>' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</strong>!',
105
+ __( "Browser", 'google-analytics-dashboard-for-wp' ), //16
106
+ __( "Operating System", 'google-analytics-dashboard-for-wp' ),
107
+ __( "Screen Resolution", 'google-analytics-dashboard-for-wp' ),
108
+ __( "Mobile Brand", 'google-analytics-dashboard-for-wp' ),
109
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
110
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
111
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
112
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
113
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
114
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ), //25
115
+ __( "Time on Page", 'google-analytics-dashboard-for-wp' ),
116
+ __( "Page Load Time", 'google-analytics-dashboard-for-wp' ),
117
+ __( "Exit Rate", 'google-analytics-dashboard-for-wp' ),
118
+ __( "Precision: ", 'google-analytics-dashboard-for-wp' ), //29
119
+ ),
120
+ 'colorVariations' => GADWP_Tools::variations( $this->gadwp->config->options['theme_color'] ),
121
+ 'region' => $region,
122
+ 'mapsApiKey' => apply_filters( 'gadwp_maps_api_key', $this->gadwp->config->options['maps_api_key'] ),
123
+ 'language' => get_bloginfo( 'language' ),
124
+ 'filter' => $_SERVER["REQUEST_URI"],
125
+ 'viewList' => false,
126
+ 'scope' => 'front-item',
127
+ )
128
+ );
129
+ /* @formatter:on */
130
+ }
131
+ }
132
+ }
133
+ }
tags/5.3.1.1/front/tracking-analytics.php ADDED
@@ -0,0 +1,775 @@
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2017 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Tracking_Analytics_Base' ) ) {
15
+
16
+ class GADWP_Tracking_Analytics_Base {
17
+
18
+ protected $gadwp;
19
+
20
+ protected $uaid;
21
+
22
+ public function __construct() {
23
+ $this->gadwp = GADWP();
24
+
25
+ $profile = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $this->gadwp->config->options['tableid_jail'] );
26
+
27
+ $this->uaid = esc_html( $profile[2] );
28
+ }
29
+
30
+ protected function build_custom_dimensions() {
31
+ $custom_dimensions = array();
32
+
33
+ if ( $this->gadwp->config->options['ga_author_dimindex'] && ( is_single() || is_page() ) ) {
34
+ global $post;
35
+ $author_id = $post->post_author;
36
+ $author_name = get_the_author_meta( 'display_name', $author_id );
37
+ $index = (int) $this->gadwp->config->options['ga_author_dimindex'];
38
+ $custom_dimensions[$index] = esc_attr( $author_name );
39
+ }
40
+
41
+ if ( $this->gadwp->config->options['ga_pubyear_dimindex'] && is_single() ) {
42
+ global $post;
43
+ $date = get_the_date( 'Y', $post->ID );
44
+ $index = (int) $this->gadwp->config->options['ga_pubyear_dimindex'];
45
+ $custom_dimensions[$index] = (int) $date;
46
+ }
47
+
48
+ if ( $this->gadwp->config->options['ga_pubyearmonth_dimindex'] && is_single() ) {
49
+ global $post;
50
+ $date = get_the_date( 'Y-m', $post->ID );
51
+ $index = (int) $this->gadwp->config->options['ga_pubyearmonth_dimindex'];
52
+ $custom_dimensions[$index] = esc_attr( $date );
53
+ }
54
+
55
+ if ( $this->gadwp->config->options['ga_category_dimindex'] && is_category() ) {
56
+ $fields = array();
57
+ $index = (int) $this->gadwp->config->options['ga_category_dimindex'];
58
+ $custom_dimensions[$index] = esc_attr( single_tag_title( '', false ) );
59
+ }
60
+
61
+ if ( $this->gadwp->config->options['ga_category_dimindex'] && is_single() ) {
62
+ global $post;
63
+ $categories = get_the_category( $post->ID );
64
+ foreach ( $categories as $category ) {
65
+ $index = (int) $this->gadwp->config->options['ga_category_dimindex'];
66
+ $custom_dimensions[$index] = esc_attr( $category->name );
67
+ break;
68
+ }
69
+ }
70
+
71
+ if ( $this->gadwp->config->options['ga_tag_dimindex'] && is_single() ) {
72
+ global $post;
73
+ $fields = array();
74
+ $post_tags_list = '';
75
+ $post_tags_array = get_the_tags( $post->ID );
76
+ if ( $post_tags_array ) {
77
+ foreach ( $post_tags_array as $tag ) {
78
+ $post_tags_list .= $tag->name . ', ';
79
+ }
80
+ }
81
+ $post_tags_list = rtrim( $post_tags_list, ', ' );
82
+ if ( $post_tags_list ) {
83
+ $index = (int) $this->gadwp->config->options['ga_tag_dimindex'];
84
+ $custom_dimensions[$index] = esc_attr( $post_tags_list );
85
+ }
86
+ }
87
+
88
+ if ( $this->gadwp->config->options['ga_user_dimindex'] ) {
89
+ $fields = array();
90
+ $index = (int) $this->gadwp->config->options['ga_user_dimindex'];
91
+ $custom_dimensions[$index] = is_user_logged_in() ? 'registered' : 'guest';
92
+ }
93
+
94
+ return $custom_dimensions;
95
+ }
96
+
97
+ protected function is_event_tracking( $opt, $with_pagescrolldepth = true ) {
98
+ if ( $this->gadwp->config->options['ga_event_tracking'] || $this->gadwp->config->options['ga_aff_tracking'] || $this->gadwp->config->options['ga_hash_tracking'] || $this->gadwp->config->options['ga_formsubmit_tracking'] ) {
99
+ return true;
100
+ }
101
+
102
+ if ( $this->gadwp->config->options['ga_pagescrolldepth_tracking'] && $with_pagescrolldepth ) {
103
+ return true;
104
+ }
105
+ return false;
106
+ }
107
+ }
108
+ }
109
+
110
+ if ( ! class_exists( 'GADWP_Tracking_Analytics_Common' ) ) {
111
+
112
+ class GADWP_Tracking_Analytics_Common extends GADWP_Tracking_Analytics_Base {
113
+
114
+ protected $commands;
115
+
116
+ public function __construct() {
117
+ parent::__construct();
118
+
119
+ $this->load_scripts();
120
+
121
+ if ( $this->gadwp->config->options['optimize_tracking'] && $this->gadwp->config->options['optimize_pagehiding'] && $this->gadwp->config->options['optimize_containerid'] ) {
122
+ add_action( 'wp_head', array( $this, 'optimize_output' ), 99 );
123
+ }
124
+ }
125
+
126
+ /**
127
+ * Styles & Scripts load
128
+ */
129
+ private function load_scripts() {
130
+ if ( $this->is_event_tracking( true ) ) {
131
+
132
+ $root_domain = GADWP_Tools::get_root_domain();
133
+
134
+ wp_enqueue_script( 'gadwp-tracking-analytics-events', GADWP_URL . 'front/js/tracking-analytics-events.js', array( 'jquery' ), GADWP_CURRENT_VERSION, $this->gadwp->config->options['trackingevents_infooter'] );
135
+
136
+ if ( $this->gadwp->config->options['ga_pagescrolldepth_tracking'] ) {
137
+ wp_enqueue_script( 'gadwp-pagescrolldepth-tracking', GADWP_URL . 'front/js/tracking-scrolldepth.js', array( 'jquery' ), GADWP_CURRENT_VERSION, $this->gadwp->config->options['trackingevents_infooter'] );
138
+ }
139
+
140
+ /* @formatter:off */
141
+ wp_localize_script( 'gadwp-tracking-analytics-events', 'gadwpUAEventsData', array(
142
+ 'options' => array(
143
+ 'event_tracking' => $this->gadwp->config->options['ga_event_tracking'],
144
+ 'event_downloads' => esc_js($this->gadwp->config->options['ga_event_downloads']),
145
+ 'event_bouncerate' => $this->gadwp->config->options['ga_event_bouncerate'],
146
+ 'aff_tracking' => $this->gadwp->config->options['ga_aff_tracking'],
147
+ 'event_affiliates' => esc_js($this->gadwp->config->options['ga_event_affiliates']),
148
+ 'hash_tracking' => $this->gadwp->config->options ['ga_hash_tracking'],
149
+ 'root_domain' => $root_domain,
150
+ 'event_timeout' => apply_filters( 'gadwp_analyticsevents_timeout', 100 ),
151
+ 'event_precision' => $this->gadwp->config->options['ga_event_precision'],
152
+ 'event_formsubmit' => $this->gadwp->config->options ['ga_formsubmit_tracking'],
153
+ 'ga_pagescrolldepth_tracking' => $this->gadwp->config->options['ga_pagescrolldepth_tracking'],
154
+ 'ga_with_gtag' => $this->gadwp->config->options ['ga_with_gtag'],
155
+ ),
156
+ )
157
+ );
158
+ /* @formatter:on */
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Outputs the Google Optimize tracking code
164
+ */
165
+ public function optimize_output() {
166
+ GADWP_Tools::load_view( 'front/views/optimize-code.php', array( 'containerid' => $this->gadwp->config->options['optimize_containerid'] ) );
167
+ }
168
+
169
+ /**
170
+ * Sanitizes the output of commands in the tracking code
171
+ * @param string $value
172
+ * @return string
173
+ */
174
+ protected function filter( $value, $is_dim = false ) {
175
+ if ( 'true' == $value || 'false' == $value || ( is_numeric( $value ) && ! $is_dim ) ) {
176
+ return $value;
177
+ }
178
+
179
+ if ( substr( $value, 0, 1 ) == '[' && substr( $value, - 1 ) == ']' || substr( $value, 0, 1 ) == '{' && substr( $value, - 1 ) == '}' ) {
180
+ return $value;
181
+ }
182
+
183
+ return "'" . $value . "'";
184
+ }
185
+
186
+ /**
187
+ * Retrieves the commands
188
+ */
189
+ public function get() {
190
+ return $this->commands;
191
+ }
192
+
193
+ /**
194
+ * Stores the commands
195
+ * @param array $commands
196
+ */
197
+ public function set( $commands ) {
198
+ $this->commands = $commands;
199
+ }
200
+
201
+ /**
202
+ * Formats the command before being added to the commands
203
+ * @param string $command
204
+ * @param array $fields
205
+ * @param string $fieldsobject
206
+ * @return array
207
+ */
208
+ public function prepare( $command, $fields, $fieldsobject = null ) {
209
+ return array( 'command' => $command, 'fields' => $fields, 'fieldsobject' => $fieldsobject );
210
+ }
211
+
212
+ /**
213
+ * Adds a formatted command to commands
214
+ * @param string $command
215
+ * @param array $fields
216
+ * @param string $fieldsobject
217
+ */
218
+ protected function add( $command, $fields, $fieldsobject = null ) {
219
+ $this->commands[] = $this->prepare( $command, $fields, $fieldsobject );
220
+ }
221
+ }
222
+ }
223
+
224
+ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
225
+
226
+ class GADWP_Tracking_Analytics extends GADWP_Tracking_Analytics_Common {
227
+
228
+ public function __construct() {
229
+ parent::__construct();
230
+
231
+ if ( $this->gadwp->config->options['trackingcode_infooter'] ) {
232
+ add_action( 'wp_footer', array( $this, 'output' ), 99 );
233
+ } else {
234
+ add_action( 'wp_head', array( $this, 'output' ), 99 );
235
+ }
236
+ }
237
+
238
+ /**
239
+ * Builds the commands based on user's options
240
+ */
241
+ private function build_commands() {
242
+ $fields = array();
243
+ $fieldsobject = array();
244
+ $fields['trackingId'] = $this->uaid;
245
+ if ( 1 != $this->gadwp->config->options['ga_speed_samplerate'] ) {
246
+ $fieldsobject['siteSpeedSampleRate'] = (int) $this->gadwp->config->options['ga_speed_samplerate'];
247
+ }
248
+ if ( 100 != $this->gadwp->config->options['ga_user_samplerate'] ) {
249
+ $fieldsobject['sampleRate'] = (int) $this->gadwp->config->options['ga_user_samplerate'];
250
+ }
251
+ if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
252
+ $fieldsobject['allowLinker'] = 'true';
253
+ }
254
+ if ( ! empty( $this->gadwp->config->options['ga_cookiedomain'] ) ) {
255
+ $fieldsobject['cookieDomain'] = $this->gadwp->config->options['ga_cookiedomain'];
256
+ } else {
257
+ $fields['cookieDomain'] = 'auto';
258
+ }
259
+ if ( ! empty( $this->gadwp->config->options['ga_cookiename'] ) ) {
260
+ $fieldsobject['cookieName'] = $this->gadwp->config->options['ga_cookiename'];
261
+ }
262
+ if ( ! empty( $this->gadwp->config->options['ga_cookieexpires'] ) ) {
263
+ $fieldsobject['cookieExpires'] = (int) $this->gadwp->config->options['ga_cookieexpires'];
264
+ }
265
+ if ( $this->gadwp->config->options['amp_tracking_clientidapi'] ) {
266
+ $fieldsobject['useAmpClientId'] = 'true';
267
+ }
268
+ $this->add( 'create', $fields, $fieldsobject );
269
+
270
+ if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
271
+ $fields = array();
272
+ $fields['plugin'] = 'linker';
273
+ $this->add( 'require', $fields );
274
+
275
+ $fields = array();
276
+ $domains = '';
277
+ $domains = explode( ',', $this->gadwp->config->options['ga_crossdomain_list'] );
278
+ $domains = array_map( 'trim', $domains );
279
+ $domains = strip_tags( implode( "','", $domains ) );
280
+ $domains = "['" . $domains . "']";
281
+ $fields['domains'] = $domains;
282
+ $this->add( 'linker:autoLink', $fields );
283
+ }
284
+
285
+ if ( $this->gadwp->config->options['ga_remarketing'] ) {
286
+ $fields = array();
287
+ $fields['plugin'] = 'displayfeatures';
288
+ $this->add( 'require', $fields );
289
+ }
290
+
291
+ if ( $this->gadwp->config->options['ga_enhanced_links'] ) {
292
+ $fields = array();
293
+ $fields['plugin'] = 'linkid';
294
+ $this->add( 'require', $fields );
295
+ }
296
+
297
+ if ( $this->gadwp->config->options['ga_force_ssl'] ) {
298
+ $fields = array();
299
+ $fields['option'] = 'forceSSL';
300
+ $fields['value'] = 'true';
301
+ $this->add( 'set', $fields );
302
+ }
303
+
304
+ $custom_dimensions = $this->build_custom_dimensions();
305
+ if ( ! empty( $custom_dimensions ) ) {
306
+ foreach ( $custom_dimensions as $index => $value ) {
307
+ $fields = array();
308
+ $fields['gadwp_dimension'] = 'dimension' . $index;
309
+ $fields['gadwp_dim_value'] = $value;
310
+ $this->add( 'set', $fields );
311
+ }
312
+ }
313
+
314
+ if ( $this->gadwp->config->options['ga_anonymize_ip'] ) {
315
+ $fields = array();
316
+ $fields['option'] = 'anonymizeIp';
317
+ $fields['value'] = 'true';
318
+ $this->add( 'set', $fields );
319
+ }
320
+
321
+ if ( 'enhanced' == $this->gadwp->config->options['ecommerce_mode'] ) {
322
+ $fields = array();
323
+ $fields['plugin'] = 'ec';
324
+ $this->add( 'require', $fields );
325
+ } else if ( 'standard' == $this->gadwp->config->options['ecommerce_mode'] ) {
326
+ $fields = array();
327
+ $fields['plugin'] = 'ecommerce';
328
+ $this->add( 'require', $fields );
329
+ }
330
+
331
+ if ( $this->gadwp->config->options['optimize_tracking'] && $this->gadwp->config->options['optimize_containerid'] ) {
332
+ $fields = array();
333
+ $fields['plugin'] = esc_attr( $this->gadwp->config->options['optimize_containerid'] );
334
+ $this->add( 'require', $fields );
335
+ }
336
+
337
+ $fields = array();
338
+ $fields['hitType'] = 'pageview';
339
+ $this->add( 'send', $fields );
340
+
341
+ do_action( 'gadwp_analytics_commands', $this );
342
+ }
343
+
344
+ /**
345
+ * Outputs the Google Analytics tracking code
346
+ */
347
+ public function output() {
348
+ $this->commands = array();
349
+
350
+ $this->build_commands();
351
+
352
+ $trackingcode = '';
353
+
354
+ foreach ( $this->commands as $set ) {
355
+ $command = $set['command'];
356
+
357
+ $fields = '';
358
+ foreach ( $set['fields'] as $fieldkey => $fieldvalue ) {
359
+ if ( false === strpos( $fieldkey, 'gadwp_dim_value' ) ) {
360
+ $fieldvalue = $this->filter( $fieldvalue );
361
+ } else {
362
+ $fieldvalue = $this->filter( $fieldvalue, true );
363
+ }
364
+ $fields .= ", " . $fieldvalue;
365
+ }
366
+
367
+ if ( $set['fieldsobject'] ) {
368
+ $fieldsobject = ", {";
369
+ foreach ( $set['fieldsobject'] as $fieldkey => $fieldvalue ) {
370
+ $fieldvalue = $this->filter( $fieldvalue );
371
+ $fieldkey = $this->filter( $fieldkey );
372
+ $fieldsobject .= $fieldkey . ": " . $fieldvalue . ", ";
373
+ }
374
+ $fieldsobject = rtrim( $fieldsobject, ", " );
375
+ $fieldsobject .= "}";
376
+ $trackingcode .= " ga('" . $command . "'" . $fields . $fieldsobject . ");\n";
377
+ } else {
378
+ $trackingcode .= " ga('" . $command . "'" . $fields . ");\n";
379
+ }
380
+ }
381
+
382
+ $tracking_script_path = apply_filters( 'gadwp_analytics_script_path', 'https://www.google-analytics.com/analytics.js' );
383
+
384
+ if ( $this->gadwp->config->options['ga_optout'] || $this->gadwp->config->options['ga_dnt_optout'] ) {
385
+ GADWP_Tools::load_view( 'front/views/analytics-optout-code.php', array( 'uaid' => $this->uaid, 'gaDntOptout' => $this->gadwp->config->options['ga_dnt_optout'], 'gaOptout' => $this->gadwp->config->options['ga_optout'] ) );
386
+ }
387
+
388
+ GADWP_Tools::load_view( 'front/views/analytics-code.php', array( 'trackingcode' => $trackingcode, 'tracking_script_path' => $tracking_script_path, 'ga_with_gtag' => $this->gadwp->config->options['ga_with_gtag'] , 'uaid' => $this->uaid ) );
389
+ }
390
+ }
391
+ }
392
+
393
+
394
+ if ( ! class_exists( 'GADWP_Tracking_GlobalSiteTag' ) ) {
395
+
396
+ class GADWP_Tracking_GlobalSiteTag extends GADWP_Tracking_Analytics_Common {
397
+
398
+ public function __construct() {
399
+ parent::__construct();
400
+
401
+ if ( $this->gadwp->config->options['trackingcode_infooter'] ) {
402
+ add_action( 'wp_footer', array( $this, 'output' ), 99 );
403
+ } else {
404
+ add_action( 'wp_head', array( $this, 'output' ), 99 );
405
+ }
406
+ }
407
+
408
+ /**
409
+ * Builds the commands based on user's options
410
+ */
411
+ private function build_commands() {
412
+ $fields = array();
413
+ $fieldsobject = array();
414
+ $fields['trackingId'] = $this->uaid;
415
+ $custom_dimensions = $this->build_custom_dimensions();
416
+ /*
417
+ * if ( 1 != $this->gadwp->config->options['ga_speed_samplerate'] ) {
418
+ * $fieldsobject['siteSpeedSampleRate'] = (int) $this->gadwp->config->options['ga_speed_samplerate'];
419
+ * }
420
+ */
421
+ if ( ! empty( $this->gadwp->config->options['ga_cookiedomain'] ) ) {
422
+ $fieldsobject['cookie_domain'] = $this->gadwp->config->options['ga_cookiedomain'];
423
+ }
424
+ if ( ! empty( $this->gadwp->config->options['ga_cookiename'] ) ) {
425
+ $fieldsobject['cookie_name'] = $this->gadwp->config->options['ga_cookiename'];
426
+ }
427
+ if ( ! empty( $this->gadwp->config->options['ga_cookieexpires'] ) ) {
428
+ $fieldsobject['cookie_expires'] = (int) $this->gadwp->config->options['ga_cookieexpires'];
429
+ }
430
+ /*
431
+ * if ( $this->gadwp->config->options['amp_tracking_clientidapi'] ) {
432
+ * $fieldsobject['useAmpClientId'] = 'true';
433
+ * }
434
+ */
435
+ if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
436
+ $domains = '';
437
+ $domains = explode( ',', $this->gadwp->config->options['ga_crossdomain_list'] );
438
+ $domains = array_map( 'trim', $domains );
439
+ $domains = strip_tags( implode( "','", $domains ) );
440
+ $domains = "['" . $domains . "']";
441
+ $fieldsobject['linker'] = "{ 'domains' : " . $domains . " }";
442
+ }
443
+ if ( ! $this->gadwp->config->options['ga_remarketing'] ) {
444
+ $fieldsobject['allow_display_features'] = 'false';
445
+ }
446
+ if ( $this->gadwp->config->options['ga_enhanced_links'] ) {
447
+ $fieldsobject['link_attribution'] = 'true';
448
+ }
449
+ if ( $this->gadwp->config->options['ga_anonymize_ip'] ) {
450
+ $fieldsobject['anonymize_ip'] = 'true';
451
+ }
452
+ if ( $this->gadwp->config->options['optimize_tracking'] && $this->gadwp->config->options['optimize_containerid'] ) {
453
+ $fieldsobject['optimize_id'] = esc_attr( $this->gadwp->config->options['optimize_containerid'] );
454
+ }
455
+ if ( 100 != $this->gadwp->config->options['ga_user_samplerate'] ) {
456
+ $fieldsobject['sample_rate'] = (int) $this->gadwp->config->options['ga_user_samplerate'];
457
+ }
458
+ if ( ! empty( $custom_dimensions ) ) {
459
+ $fieldsobject['custom_map'] = "{\n\t\t";
460
+ foreach ( $custom_dimensions as $index => $value ) {
461
+ $fieldsobject['custom_map'] .= "'dimension" . $index . "': '" . "gadwp_dim_" . $index . "', \n\t\t";
462
+ }
463
+ $fieldsobject['custom_map'] = rtrim( $fieldsobject['custom_map'], ", \n\t\t" );
464
+ $fieldsobject['custom_map'] .= "\n\t}";
465
+ }
466
+ $this->add( 'config', $fields, $fieldsobject );
467
+
468
+ if ( ! empty( $custom_dimensions ) ) {
469
+ $fields = array();
470
+ $fieldsobject = array();
471
+ $fields['event_name'] = 'gadwp_dimensions';
472
+ foreach ( $custom_dimensions as $index => $value ) {
473
+ $fieldsobject['gadwp_dim_' . $index] = $value;
474
+ }
475
+ $this->add( 'event', $fields, $fieldsobject );
476
+ }
477
+
478
+ do_action( 'gadwp_analytics_commands', $this );
479
+ }
480
+
481
+ /**
482
+ * Outputs the Google Analytics tracking code
483
+ */
484
+ public function output() {
485
+ $this->commands = array();
486
+
487
+ $this->build_commands();
488
+
489
+ $trackingcode = '';
490
+
491
+ foreach ( $this->commands as $set ) {
492
+ $command = $set['command'];
493
+
494
+ $fields = '';
495
+ foreach ( $set['fields'] as $fieldkey => $fieldvalue ) {
496
+ $fieldvalue = $this->filter( $fieldvalue );
497
+ $fields .= ", " . $fieldvalue;
498
+ }
499
+
500
+ if ( $set['fieldsobject'] ) {
501
+ $fieldsobject = ", {\n\t";
502
+ foreach ( $set['fieldsobject'] as $fieldkey => $fieldvalue ) {
503
+ if ( false === strpos( $fieldkey, 'gadwp_' ) ) {
504
+ $fieldvalue = $this->filter( $fieldvalue );
505
+ } else {
506
+ $fieldvalue = $this->filter( $fieldvalue, true );
507
+ }
508
+ $fieldkey = $this->filter( $fieldkey );
509
+ $fieldsobject .= $fieldkey . ": " . $fieldvalue . ", \n\t";
510
+ }
511
+ $fieldsobject = rtrim( $fieldsobject, ", \n\t" );
512
+ $fieldsobject .= "\n }";
513
+ $trackingcode .= " gtag('" . $command . "'" . $fields . $fieldsobject . ");\n";
514
+ } else {
515
+ $trackingcode .= " gtag('" . $command . "'" . $fields . ");\n";
516
+ }
517
+ }
518
+
519
+ $tracking_script_path = apply_filters( 'gadwp_analytics_script_path', 'https://www.googletagmanager.com/gtag/js' );
520
+
521
+ if ( $this->gadwp->config->options['ga_optout'] || $this->gadwp->config->options['ga_dnt_optout'] ) {
522
+ GADWP_Tools::load_view( 'front/views/analytics-optout-code.php', array( 'uaid' => $this->uaid, 'gaDntOptout' => $this->gadwp->config->options['ga_dnt_optout'], 'gaOptout' => $this->gadwp->config->options['ga_optout'] ) );
523
+ }
524
+
525
+ GADWP_Tools::load_view( 'front/views/analytics-code.php', array( 'trackingcode' => $trackingcode, 'tracking_script_path' => $tracking_script_path, 'ga_with_gtag' => $this->gadwp->config->options['ga_with_gtag'] , 'uaid' => $this->uaid ) );
526
+ }
527
+ }
528
+ }
529
+
530
+ if ( ! class_exists( 'GADWP_Tracking_Analytics_AMP' ) ) {
531
+
532
+ class GADWP_Tracking_Analytics_AMP extends GADWP_Tracking_Analytics_Base {
533
+
534
+ private $config;
535
+
536
+ public function __construct() {
537
+ parent::__construct();
538
+
539
+ add_filter( 'amp_post_template_data', array( $this, 'load_scripts' ) );
540
+ add_action( 'amp_post_template_footer', array( $this, 'output' ) );
541
+ add_filter( 'the_content', array( $this, 'add_data_attributes' ), 999, 1 );
542
+ if ( $this->gadwp->config->options['amp_tracking_clientidapi'] ) {
543
+ add_action( 'amp_post_template_head', array( $this, 'add_amp_client_id' ) );
544
+ }
545
+ }
546
+
547
+ private function get_link_event_data( $link ) {
548
+ if ( empty( $link ) ) {
549
+ return false;
550
+ }
551
+ if ( $this->gadwp->config->options['ga_event_tracking'] ) {
552
+ // on changes adjust the substr() length parameter
553
+ if ( substr( $link, 0, 7 ) === "mailto:" ) {
554
+ return array( 'email', 'send', $link );
555
+ }
556
+
557
+ // on changes adjust the substr() length parameter
558
+ if ( substr( $link, 0, 4 ) === "tel:" ) {
559
+ return array( 'telephone', 'call', $link );
560
+ }
561
+
562
+ // Add download data-vars
563
+ if ( $this->gadwp->config->options['ga_event_downloads'] && preg_match( '/.*\.(' . $this->gadwp->config->options['ga_event_downloads'] . ')(\?.*)?$/i', $link, $matches ) ) {
564
+ return array( 'download', 'click', $link );
565
+ }
566
+ }
567
+ if ( $this->gadwp->config->options['ga_hash_tracking'] ) {
568
+ // Add hashmark data-vars
569
+ $root_domain = GADWP_Tools::get_root_domain();
570
+ if ( $root_domain && ( strpos( $link, $root_domain ) > - 1 || strpos( $link, '://' ) === false ) && strpos( $link, '#' ) > - 1 ) {
571
+ return array( 'hashmark', 'click', $link );
572
+ }
573
+ }
574
+ if ( $this->gadwp->config->options['ga_aff_tracking'] ) {
575
+ // Add affiliate data-vars
576
+ if ( strpos( $link, $this->gadwp->config->options['ga_event_affiliates'] ) > - 1 ) {
577
+ return array( 'affiliates', 'click', $link );
578
+ }
579
+ }
580
+ if ( $this->gadwp->config->options['ga_event_tracking'] ) {
581
+ // Add outbound data-vars
582
+ $root_domain = GADWP_Tools::get_root_domain();
583
+ if ( $root_domain && strpos( $link, $root_domain ) === false && strpos( $link, '://' ) > - 1 ) {
584
+ return array( 'outbound', 'click', $link );
585
+ }
586
+ }
587
+ return false;
588
+ }
589
+
590
+ public function add_data_attributes( $content ) {
591
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && $this->is_event_tracking( false ) ) {
592
+
593
+ $dom = GADWP_Tools::get_dom_from_content( $content );
594
+
595
+ if ( $dom ) {
596
+
597
+ $links = $dom->getElementsByTagName( 'a' );
598
+
599
+ foreach ( $links as $item ) {
600
+
601
+ $data_attributes = $this->get_link_event_data( $item->getAttribute( 'href' ) );
602
+
603
+ if ( $data_attributes ) {
604
+ if ( ! $item->hasAttribute( 'data-vars-ga-category' ) ) {
605
+ $item->setAttribute( 'data-vars-ga-category', $data_attributes[0] );
606
+ }
607
+ if ( ! $item->hasAttribute( 'data-vars-ga-action' ) ) {
608
+ $item->setAttribute( 'data-vars-ga-action', $data_attributes[1] );
609
+ }
610
+ if ( ! $item->hasAttribute( 'data-vars-ga-label' ) ) {
611
+ $item->setAttribute( 'data-vars-ga-label', $data_attributes[2] );
612
+ }
613
+ }
614
+ }
615
+
616
+ if ( $this->gadwp->config->options['ga_formsubmit_tracking'] ) {
617
+ $form_submits = $dom->getElementsByTagName( 'input' );
618
+ foreach ( $form_submits as $item ) {
619
+ if ( $item->getAttribute( 'type' ) == 'submit' ) {
620
+ if ( ! $item->hasAttribute( 'data-vars-ga-category' ) ) {
621
+ $item->setAttribute( 'data-vars-ga-category', 'form' );
622
+ }
623
+ if ( ! $item->hasAttribute( 'data-vars-ga-action' ) ) {
624
+ $item->setAttribute( 'data-vars-ga-action', 'submit' );
625
+ }
626
+ if ( ! $item->hasAttribute( 'data-vars-ga-label' ) ) {
627
+ if ( $item->getAttribute( 'value' ) ) {
628
+ $label = $item->getAttribute( 'value' );
629
+ }
630
+ if ( $item->getAttribute( 'name' ) ) {
631
+ $label = $item->getAttribute( 'name' );
632
+ }
633
+ $item->setAttribute( 'data-vars-ga-label', $label );
634
+ }
635
+ }
636
+ }
637
+ }
638
+ return GADWP_Tools::get_content_from_dom( $dom );
639
+ }
640
+ }
641
+
642
+ return $content;
643
+ }
644
+
645
+ /**
646
+ * Inserts the Analytics AMP script in the head section
647
+ */
648
+ public function load_scripts( $data ) {
649
+ if ( ! isset( $data['amp_component_scripts'] ) ) {
650
+ $data['amp_component_scripts'] = array();
651
+ }
652
+
653
+ $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
654
+
655
+ return $data;
656
+ }
657
+
658
+ /**
659
+ * Retrieves the AMP config array
660
+ */
661
+ public function get() {
662
+ return $this->config;
663
+ }
664
+
665
+ /**
666
+ * Stores the AMP config array
667
+ * @param array $config
668
+ */
669
+ public function set( $config ) {
670
+ $this->config = $config;
671
+ }
672
+
673
+ private function build_json() {
674
+ $this->config = array();
675
+
676
+ // Set the Tracking ID
677
+ /* @formatter:off */
678
+ $this->config['vars'] = array(
679
+ 'account' => $this->uaid,
680
+ 'documentLocation' => '${canonicalUrl}',
681
+ );
682
+ /* @formatter:on */
683
+
684
+ // Set Custom Dimensions as extraUrlParams
685
+ $custom_dimensions = $this->build_custom_dimensions();
686
+
687
+ if ( ! empty( $custom_dimensions ) ) {
688
+ foreach ( $custom_dimensions as $index => $value ) {
689
+ $dimension = 'cd' . $index;
690
+ $this->config['extraUrlParams'][$dimension] = $value;
691
+ }
692
+ }
693
+
694
+ // Set Triggers
695
+ /* @formatter:off */
696
+ $this->config['triggers']['gadwpTrackPageview'] = array(
697
+ 'on' => 'visible',
698
+ 'request' => 'pageview',
699
+ );
700
+ /* @formatter:on */
701
+
702
+ // Set Sampling Rate only if lower than 100%
703
+ if ( 100 != $this->gadwp->config->options['ga_user_samplerate'] ) {
704
+ /* @formatter:off */
705
+ $this->config['triggers']['gadwpTrackPageview']['sampleSpec'] = array(
706
+ 'sampleOn' => '${clientId}',
707
+ 'threshold' => (int) $this->gadwp->config->options['ga_user_samplerate'],
708
+ );
709
+ /* @formatter:on */
710
+ }
711
+
712
+ // Set Scroll events
713
+ if ( $this->gadwp->config->options['ga_pagescrolldepth_tracking'] ) {
714
+ /* @formatter:off */
715
+ $this->config['triggers']['gadwpScrollPings'] = array (
716
+ 'on' => 'scroll',
717
+ 'scrollSpec' => array(
718
+ 'verticalBoundaries' => '&#91;25, 50, 75, 100&#93;',
719
+ ),
720
+ 'request' => 'event',
721
+ 'vars' => array(
722
+ 'eventCategory' => 'Scroll Depth',
723
+ 'eventAction' => 'Percentage',
724
+ 'eventLabel' => '${verticalScrollBoundary}%',
725
+ ),
726
+ );
727
+ /* @formatter:on */
728
+ $this->config['triggers']['gadwpScrollPings']['extraUrlParams'] = array( 'ni' => true );
729
+ }
730
+
731
+ if ( $this->is_event_tracking( false ) ) {
732
+ // Set downloads, outbound links, affiliate links, hashmarks, e-mails, telephones, form submits events
733
+ /* @formatter:off */
734
+ $this->config['triggers']['gadwpEventTracking'] = array (
735
+ 'on' => 'click',
736
+ 'selector' => '[data-vars-ga-category][data-vars-ga-action][data-vars-ga-label]',
737
+ 'request' => 'event',
738
+ 'vars' => array(
739
+ 'eventCategory' => '${gaCategory}',
740
+ 'eventAction' => '${gaAction}',
741
+ 'eventLabel' => '${gaLabel}',
742
+ ),
743
+ );
744
+ /* @formatter:on */
745
+ if ( $this->gadwp->config->options['ga_event_bouncerate'] ) {
746
+ $this->config['triggers']['gadwpEventTracking']['extraUrlParams'] = array( 'ni' => (bool) $this->gadwp->config->options['ga_event_bouncerate'] );
747
+ }
748
+ }
749
+ do_action( 'gadwp_analytics_amp_config', $this );
750
+ }
751
+
752
+ public function add_amp_client_id() {
753
+ GADWP_Tools::load_view( 'front/views/analytics-amp-clientidapi.php' );
754
+ }
755
+
756
+ /**
757
+ * Outputs the Google Analytics tracking code for AMP
758
+ */
759
+ public function output() {
760
+ $this->build_json();
761
+
762
+ if ( version_compare( phpversion(), '5.4.0', '<' ) ) {
763
+ $json = json_encode( $this->config );
764
+ } else {
765
+ $json = json_encode( $this->config, JSON_PRETTY_PRINT );
766
+ }
767
+
768
+ $json = str_replace( array( '"&#91;', '&#93;"' ), array( '[', ']' ), $json ); // make verticalBoundaries a JavaScript array
769
+
770
+ $data = array( 'json' => $json );
771
+
772
+ GADWP_Tools::load_view( 'front/views/analytics-amp-code.php', $data );
773
+ }
774
+ }
775
+ }
tags/5.3.1.1/front/tracking-tagmanager.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2017 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Tracking_TagManager' ) ) {
15
+
16
+ class GADWP_Tracking_TagManager {
17
+
18
+ private $gadwp;
19
+
20
+ private $datalayer;
21
+
22
+ public function __construct() {
23
+ $this->gadwp = GADWP();
24
+
25
+ if ( $this->gadwp->config->options['trackingcode_infooter'] ) {
26
+ add_action( 'wp_footer', array( $this, 'output' ), 99 );
27
+ } else {
28
+ add_action( 'wp_head', array( $this, 'output' ), 99 );
29
+ }
30
+
31
+ if ( $this->gadwp->config->options['amp_tracking_tagmanager'] && $this->gadwp->config->options['amp_containerid'] ) {
32
+ add_filter( 'amp_post_template_data', array( $this, 'amp_add_analytics_script' ) );
33
+ add_action( 'amp_post_template_footer', array( $this, 'amp_output' ) );
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Retrieves the datalayer variables
39
+ */
40
+ public function get() {
41
+ return $this->datalayer;
42
+ }
43
+
44
+ /**
45
+ * Stores the datalayer variables
46
+ * @param array $datalayer
47
+ */
48
+ public function set( $datalayer ) {
49
+ $this->datalayer = $datalayer;
50
+ }
51
+
52
+ /**
53
+ * Adds a variable to the datalayer
54
+ * @param string $name
55
+ * @param string $value
56
+ */
57
+ private function add_var( $name, $value ) {
58
+ $this->datalayer[$name] = $value;
59
+ }
60
+
61
+ /**
62
+ * Builds the datalayer based on user's options
63
+ */
64
+ private function build_custom_dimensions() {
65
+ global $post;
66
+
67
+ if ( $this->gadwp->config->options['tm_author_var'] && ( is_single() || is_page() ) ) {
68
+ global $post;
69
+ $author_id = $post->post_author;
70
+ $author_name = get_the_author_meta( 'display_name', $author_id );
71
+ $this->add_var( 'gadwpAuthor', esc_attr( $author_name ) );
72
+ }
73
+
74
+ if ( $this->gadwp->config->options['tm_pubyear_var'] && is_single() ) {
75
+ global $post;
76
+ $date = get_the_date( 'Y', $post->ID );
77
+ $this->add_var( 'gadwpPublicationYear', (int) $date );
78
+ }
79
+
80
+ if ( $this->gadwp->config->options['tm_pubyearmonth_var'] && is_single() ) {
81
+ global $post;
82
+ $date = get_the_date( 'Y-m', $post->ID );
83
+ $this->add_var( 'gadwpPublicationYearMonth', esc_attr( $date ) );
84
+ }
85
+
86
+ if ( $this->gadwp->config->options['tm_category_var'] && is_category() ) {
87
+ $this->add_var( 'gadwpCategory', esc_attr( single_tag_title( '', false ) ) );
88
+ }
89
+ if ( $this->gadwp->config->options['tm_category_var'] && is_single() ) {
90
+ global $post;
91
+ $categories = get_the_category( $post->ID );
92
+ foreach ( $categories as $category ) {
93
+ $this->add_var( 'gadwpCategory', esc_attr( $category->name ) );
94
+ break;
95
+ }
96
+ }
97
+
98
+ if ( $this->gadwp->config->options['tm_tag_var'] && is_single() ) {
99
+ global $post;
100
+ $post_tags_list = '';
101
+ $post_tags_array = get_the_tags( $post->ID );
102
+ if ( $post_tags_array ) {
103
+ foreach ( $post_tags_array as $tag ) {
104
+ $post_tags_list .= $tag->name . ', ';
105
+ }
106
+ }
107
+ $post_tags_list = rtrim( $post_tags_list, ', ' );
108
+ if ( $post_tags_list ) {
109
+ $this->add_var( 'gadwpTag', esc_attr( $post_tags_list ) );
110
+ }
111
+ }
112
+
113
+ if ( $this->gadwp->config->options['tm_user_var'] ) {
114
+ $usertype = is_user_logged_in() ? 'registered' : 'guest';
115
+ $this->add_var( 'gadwpUser', $usertype );
116
+ }
117
+
118
+ do_action( 'gadwp_tagmanager_datalayer', $this );
119
+ }
120
+
121
+ /**
122
+ * Outputs the Google Tag Manager tracking code
123
+ */
124
+ public function output() {
125
+ $this->build_custom_dimensions();
126
+
127
+ if ( is_array( $this->datalayer ) ) {
128
+ $vars = "{";
129
+ foreach ( $this->datalayer as $var => $value ) {
130
+ $vars .= "'" . $var . "': '" . $value . "', ";
131
+ }
132
+ $vars = rtrim( $vars, ", " );
133
+ $vars .= "}";
134
+ } else {
135
+ $vars = "{}";
136
+ }
137
+
138
+ GADWP_Tools::load_view( 'front/views/tagmanager-code.php', array( 'containerid' => $this->gadwp->config->options['web_containerid'], 'vars' => $vars ) );
139
+ }
140
+
141
+ /**
142
+ * Inserts the Analytics AMP script in the head section
143
+ */
144
+ public function amp_add_analytics_script( $data ) {
145
+ if ( ! isset( $data['amp_component_scripts'] ) ) {
146
+ $data['amp_component_scripts'] = array();
147
+ }
148
+
149
+ $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
150
+
151
+ return $data;
152
+ }
153
+
154
+ /**
155
+ * Outputs the Tag Manager code for AMP
156
+ */
157
+ public function amp_output() {
158
+
159
+ $this->build_custom_dimensions();
160
+
161
+ $vars = array( 'vars' => $this->datalayer );
162
+
163
+ if ( version_compare( phpversion(), '5.4.0', '<' ) ) {
164
+ $json = json_encode( $vars );
165
+ } else {
166
+ $json = json_encode( $vars, JSON_PRETTY_PRINT );
167
+ }
168
+
169
+ $amp_containerid = $this->gadwp->config->options['amp_containerid'];
170
+
171
+ $json = str_replace( array( '"&#91;', '&#93;"' ), array( '[', ']' ), $json ); // make verticalBoundaries a JavaScript array
172
+
173
+ GADWP_Tools::load_view( 'front/views/tagmanager-amp-code.php', array ( 'json' => $json, 'containerid' => $amp_containerid ) );
174
+
175
+ }
176
+ }
177
+ }
tags/5.3.1.1/front/tracking.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2017 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Tracking' ) ) {
15
+
16
+ class GADWP_Tracking {
17
+
18
+ private $gadwp;
19
+
20
+ public $analytics;
21
+
22
+ public $analytics_amp;
23
+
24
+ public $tagmanager;
25
+
26
+ public function __construct() {
27
+ $this->gadwp = GADWP();
28
+
29
+ $this->init();
30
+ }
31
+
32
+ public function tracking_code() { // Removed since 5.0
33
+ GADWP_Tools::doing_it_wrong( __METHOD__, __( "This method is deprecated, read the documentation!", 'google-analytics-dashboard-for-wp' ), '5.0' );
34
+ }
35
+
36
+ public function init() {
37
+ // excluded roles
38
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['track_exclude'], true ) || ( $this->gadwp->config->options['superadmin_tracking'] && current_user_can( 'manage_network' ) ) ) {
39
+ return;
40
+ }
41
+
42
+ if ( 'universal' == $this->gadwp->config->options['tracking_type'] && $this->gadwp->config->options['tableid_jail'] ) {
43
+
44
+ // Analytics
45
+ require_once 'tracking-analytics.php';
46
+
47
+ if ( 1 == $this->gadwp->config->options['ga_with_gtag'] ) {
48
+ $this->analytics = new GADWP_Tracking_GlobalSiteTag();
49
+ } else {
50
+ $this->analytics = new GADWP_Tracking_Analytics();
51
+ }
52
+
53
+ if ( $this->gadwp->config->options['amp_tracking_analytics'] ) {
54
+ $this->analytics_amp = new GADWP_Tracking_Analytics_AMP();
55
+ }
56
+ }
57
+
58
+ if ( 'tagmanager' == $this->gadwp->config->options['tracking_type'] && $this->gadwp->config->options['web_containerid'] ) {
59
+
60
+ // Tag Manager
61
+ require_once 'tracking-tagmanager.php';
62
+ $this->tagmanager = new GADWP_Tracking_TagManager();
63
+ }
64
+ }
65
+ }
66
+ }
tags/5.3.1.1/front/views/analytics-amp-clientidapi.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+
11
+ <meta name="amp-google-client-id-api" content="googleanalytics">
tags/5.3.1.1/front/views/analytics-amp-code.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <amp-analytics type="googleanalytics" id="gadwp-googleanalytics">
11
+ <script type="application/json">
12
+ <?php echo $data['json']; ?>
13
+ </script>
14
+ </amp-analytics>
tags/5.3.1.1/front/views/analytics-code.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+
11
+ <?php if ( 0 == $data['ga_with_gtag'] ):?>
12
+ <!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Universal Analytics - https://deconf.com/google-analytics-dashboard-wordpress/ -->
13
+ <script>
14
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
15
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
16
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
17
+ })(window,document,'script','<?php echo $data['tracking_script_path']?>','ga');
18
+ <?php echo $data['trackingcode']?>
19
+ </script>
20
+ <!-- END GADWP Universal Analytics -->
21
+ <?php else:?>
22
+ <!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Global Site Tag - https://deconf.com/google-analytics-dashboard-wordpress/ -->
23
+ <script async src="<?php echo $data['tracking_script_path']?>?id=<?php echo $data['uaid']?>"></script>
24
+ <script>
25
+ window.dataLayer = window.dataLayer || [];
26
+ function gtag(){dataLayer.push(arguments);}
27
+ gtag('js', new Date());
28
+ <?php echo $data['trackingcode']?>
29
+
30
+ if (window.performance) {
31
+ var timeSincePageLoad = Math.round(performance.now());
32
+ gtag('event', 'timing_complete', {
33
+ 'name': 'load',
34
+ 'value': timeSincePageLoad,
35
+ 'event_category': 'JS Dependencies'
36
+ });
37
+ }
38
+ </script>
39
+ <!-- END GADWP Global Site Tag -->
40
+ <?php endif;?>
tags/5.3.1.1/front/views/analytics-optout-code.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2018 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <script>
11
+ var dnt = false;
12
+ var gaProperty = '<?php echo $data['uaid']?>';
13
+ var gaDntOptout = '<?php echo $data['gaDntOptout']?>';
14
+ var gaOptout = '<?php echo $data['gaOptout']?>';
15
+ var disableStr = 'ga-disable-' + gaProperty;
16
+ if(gaDntOptout && (window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1")) {
17
+ dnt = true;
18
+ }
19
+ if (dnt || (document.cookie.indexOf(disableStr + '=true') > -1 && gaOptout)) {
20
+ window[disableStr] = true;
21
+ }
22
+ function gaOptout() {
23
+ document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
24
+ window[disableStr] = true;
25
+ }
26
+ </script>
tags/5.3.1.1/front/views/optimize-code.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <style>
11
+ .async-hide {
12
+ opacity: 0 !important
13
+ }
14
+ </style>
15
+ <script>
16
+ (function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
17
+ h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
18
+ (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
19
+ })(window,document.documentElement,'async-hide','dataLayer',4000,
20
+ {'<?php echo $data['containerid']; ?>':true});
21
+ </script>
tags/5.3.1.1/front/views/tagmanager-amp-code.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2018 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <amp-analytics config="https://www.googletagmanager.com/amp.json?id=<?php echo $data['containerid']; ?>&gtm.url=SOURCE_URL" data-credentials="include">
11
+ <script type="application/json">
12
+ <?php echo $data['json']; ?>
13
+ </script>
14
+ </amp-analytics>
tags/5.3.1.1/front/views/tagmanager-code.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Tag Manager - https://deconf.com/google-analytics-dashboard-wordpress/ -->
11
+ <script>
12
+ window.dataLayer = window.dataLayer || [];
13
+ window.dataLayer.push(<?php echo $data['vars']; ?>);
14
+ </script>
15
+
16
+ <script>
17
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
18
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
19
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
20
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
21
+ })(window,document,'script','dataLayer','<?php echo $data['containerid']; ?>');
22
+ </script>
23
+ <!-- END GADWP Tag Manager -->
24
+
tags/5.3.1.1/front/widgets.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ final class GADWP_Frontend_Widget extends WP_Widget {
15
+
16
+ private $gadwp;
17
+
18
+ public function __construct() {
19
+ $this->gadwp = GADWP();
20
+
21
+ parent::__construct( 'gadwp-frontwidget-report', __( 'Google Analytics Dashboard', 'google-analytics-dashboard-for-wp' ), array( 'description' => __( "Will display your google analytics stats in a widget", 'google-analytics-dashboard-for-wp' ) ) );
22
+ // Frontend Styles
23
+ if ( is_active_widget( false, false, $this->id_base, true ) ) {
24
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
+ }
26
+ }
27
+
28
+ public function load_styles_scripts() {
29
+ $lang = get_bloginfo( 'language' );
30
+ $lang = explode( '-', $lang );
31
+ $lang = $lang[0];
32
+
33
+ wp_enqueue_style( 'gadwp-front-widget', GADWP_URL . 'front/css/widgets.css', null, GADWP_CURRENT_VERSION );
34
+ wp_enqueue_script( 'gadwp-front-widget', GADWP_URL . 'front/js/widgets.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
35
+ wp_enqueue_script( 'googlecharts', 'https://www.gstatic.com/charts/loader.js', array(), null );
36
+ }
37
+
38
+ public function widget( $args, $instance ) {
39
+ $widget_title = apply_filters( 'widget_title', $instance['title'] );
40
+ $title = __( "Sessions", 'google-analytics-dashboard-for-wp' );
41
+ echo "\n<!-- BEGIN GADWP v" . GADWP_CURRENT_VERSION . " Widget - https://deconf.com/google-analytics-dashboard-wordpress/ -->\n";
42
+ echo $args['before_widget'];
43
+ if ( ! empty( $widget_title ) ) {
44
+ echo $args['before_title'] . $widget_title . $args['after_title'];
45
+ }
46
+
47
+ if ( isset( $this->gadwp->config->options['theme_color'] ) ) {
48
+ $css = "colors:['" . $this->gadwp->config->options['theme_color'] . "','" . GADWP_Tools::colourVariator( $this->gadwp->config->options['theme_color'], - 20 ) . "'],";
49
+ $color = $this->gadwp->config->options['theme_color'];
50
+ } else {
51
+ $css = "";
52
+ $color = "#3366CC";
53
+ }
54
+ ob_start();
55
+ if ( $instance['anonim'] ) {
56
+ $formater = "var formatter = new google.visualization.NumberFormat({
57
+ suffix: '%',
58
+ fractionDigits: 2
59
+ });
60
+
61
+ formatter.format(data, 1);";
62
+ } else {
63
+ $formater = '';
64
+ }
65
+ $periodtext = "";
66
+ switch ( $instance['period'] ) {
67
+ case '7daysAgo' :
68
+ $periodtext = sprintf( __( 'Last %d Days', 'google-analytics-dashboard-for-wp' ), 7 );
69
+ break;
70
+ case '14daysAgo' :
71
+ $periodtext = sprintf( __( 'Last %d Days', 'google-analytics-dashboard-for-wp' ), 14 );
72
+ break;
73
+ case '30daysAgo' :
74
+ $periodtext = sprintf( __( 'Last %d Days', 'google-analytics-dashboard-for-wp' ), 30 );
75
+ break;
76
+ default :
77
+ $periodtext = "";
78
+ break;
79
+ }
80
+ switch ( $instance['display'] ) {
81
+ case '1' :
82
+ echo '<div id="gadwp-widget"><div id="gadwp-widgetchart"></div><div id="gadwp-widgettotals"></div></div>';
83
+ break;
84
+ case '2' :
85
+ echo '<div id="gadwp-widget"><div id="gadwp-widgetchart"></div></div>';
86
+ break;
87
+ case '3' :
88
+ echo '<div id="gadwp-widget"><div id="gadwp-widgettotals"></div></div>';
89
+ break;
90
+ }
91
+ ?>
92
+ <script type="text/javascript">
93
+ google.charts.load('current', {'packages':['corechart']});
94
+ google.charts.setOnLoadCallback( GADWPWidgetLoad );
95
+ function GADWPWidgetLoad (){
96
+ jQuery.post("<?php echo admin_url( 'admin-ajax.php' ); ?>", {action: "ajax_frontwidget_report", gadwp_number: "<?php echo $this->number; ?>", gadwp_optionname: "<?php echo $this->option_name; ?>" }, function(response){
97
+ if (!jQuery.isNumeric(response) && jQuery.isArray(response)){
98
+ if (jQuery("#gadwp-widgetchart")[0]){
99
+ gadwpFrontWidgetData = response[0];
100
+ gadwp_drawFrontWidgetChart(gadwpFrontWidgetData);
101
+ }
102
+ if (jQuery("#gadwp-widgettotals")[0]){
103
+ gadwp_drawFrontWidgetTotals(response[1]);
104
+ }
105
+ }else{
106
+ jQuery("#gadwp-widgetchart").css({"background-color":"#F7F7F7","height":"auto","padding-top":"50px","padding-bottom":"50px","color":"#000","text-align":"center"});
107
+ jQuery("#gadwp-widgetchart").html("<?php __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ); ?> ("+response+")");
108
+ }
109
+ });
110
+ }
111
+ function gadwp_drawFrontWidgetChart(response) {
112
+ var data = google.visualization.arrayToDataTable(response);
113
+ var options = {
114
+ legend: { position: "none" },
115
+ pointSize: "3",
116
+ <?php echo $css; ?>
117
+ title: "<?php echo $title; ?>",
118
+ titlePosition: "in",
119
+ chartArea: { width: "95%", height: "75%" },
120
+ hAxis: { textPosition: "none"},
121
+ vAxis: { textPosition: "none", minValue: 0, gridlines: { color: "transparent" }, baselineColor: "transparent"}
122
+ }
123
+ var chart = new google.visualization.AreaChart(document.getElementById("gadwp-widgetchart"));
124
+ <?php echo $formater; ?>
125
+ chart.draw(data, options);
126
+ }
127
+ function gadwp_drawFrontWidgetTotals(response) {
128
+ if ( null == response ){
129
+ response = 0;
130
+ }
131
+ jQuery("#gadwp-widgettotals").html('<div class="gadwp-left"><?php _e( "Period:", 'google-analytics-dashboard-for-wp' ); ?></div> <div class="gadwp-right"><?php echo $periodtext; ?> </div><div class="gadwp-left"><?php _e( "Sessions:", 'google-analytics-dashboard-for-wp' ); ?></div> <div class="gadwp-right">'+response+'</div>');
132
+ }
133
+ </script>
134
+ <?php
135
+ if ( 1 == $instance['give_credits'] ) :
136
+ ?>
137
+ <div style="text-align: right; width: 100%; font-size: 0.8em; clear: both; margin-right: 5px;"><?php _e( 'generated by', 'google-analytics-dashboard-for-wp' ); ?> <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_report&utm_medium=link&utm_content=front_widget&utm_campaign=gadwp" rel="nofollow" style="text-decoration: none; font-size: 1em;">GADWP</a>&nbsp;
138
+ </div>
139
+
140
+ <?php
141
+ endif;
142
+ $widget_content = ob_get_contents();
143
+ if ( ob_get_length() ) {
144
+ ob_end_clean();
145
+ }
146
+ echo $widget_content;
147
+ echo $args['after_widget'];
148
+ echo "\n<!-- END GADWP Widget -->\n";
149
+ }
150
+
151
+ public function form( $instance ) {
152
+ $widget_title = ( isset( $instance['title'] ) ? $instance['title'] : __( "Google Analytics Stats", 'google-analytics-dashboard-for-wp' ) );
153
+ $period = ( isset( $instance['period'] ) ? $instance['period'] : '7daysAgo' );
154
+ $display = ( isset( $instance['display'] ) ? $instance['display'] : 1 );
155
+ $give_credits = ( isset( $instance['give_credits'] ) ? $instance['give_credits'] : 1 );
156
+ $anonim = ( isset( $instance['anonim'] ) ? $instance['anonim'] : 0 );
157
+ /* @formatter:off */
158
+ ?>
159
+ <p>
160
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( "Title:",'google-analytics-dashboard-for-wp' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $widget_title ); ?>">
161
+ </p>
162
+ <p>
163
+ <label for="<?php echo $this->get_field_id( 'display' ); ?>"><?php _e( "Display:",'google-analytics-dashboard-for-wp' ); ?></label> <select id="<?php echo $this->get_field_id('display'); ?>" class="widefat" name="<?php echo $this->get_field_name( 'display' ); ?>">
164
+ <option value="1" <?php selected( $display, 1 ); ?>><?php _e('Chart & Totals', 'google-analytics-dashboard-for-wp');?></option>
165
+ <option value="2" <?php selected( $display, 2 ); ?>><?php _e('Chart', 'google-analytics-dashboard-for-wp');?></option>
166
+ <option value="3" <?php selected( $display, 3 ); ?>><?php _e('Totals', 'google-analytics-dashboard-for-wp');?></option>
167
+ </select>
168
+ </p>
169
+ <p>
170
+ <label for="<?php echo $this->get_field_id( 'anonim' ); ?>"><?php _e( "Anonymize stats:",'google-analytics-dashboard-for-wp' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'anonim' ); ?>" name="<?php echo $this->get_field_name( 'anonim' ); ?>" type="checkbox" <?php checked( $anonim, 1 ); ?> value="1">
171
+ </p>
172
+ <p>
173
+ <label for="<?php echo $this->get_field_id( 'period' ); ?>"><?php _e( "Stats for:",'google-analytics-dashboard-for-wp' ); ?></label> <select id="<?php echo $this->get_field_id('period'); ?>" class="widefat" name="<?php echo $this->get_field_name( 'period' ); ?>">
174
+ <option value="7daysAgo" <?php selected( $period, '7daysAgo' ); ?>><?php printf( __('Last %d Days', 'google-analytics-dashboard-for-wp'), 7 );?></option>
175
+ <option value="14daysAgo" <?php selected( $period, '14daysAgo' ); ?>><?php printf( __('Last %d Days', 'google-analytics-dashboard-for-wp'), 14 );?></option>
176
+ <option value="30daysAgo" <?php selected( $period, '30daysAgo' ); ?>><?php printf( __('Last %d Days', 'google-analytics-dashboard-for-wp'), 30 );?></option>
177
+ </select>
178
+ </p>
179
+ <p>
180
+ <label for="<?php echo $this->get_field_id( 'give_credits' ); ?>"><?php _e( "Give credits:",'google-analytics-dashboard-for-wp' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'give_credits' ); ?>" name="<?php echo $this->get_field_name( 'give_credits' ); ?>" type="checkbox" <?php checked( $give_credits, 1 ); ?> value="1">
181
+ </p>
182
+ <?php
183
+ /* @formatter:on */
184
+ }
185
+
186
+ public function update( $new_instance, $old_instance ) {
187
+ $instance = array();
188
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : 'Analytics Stats';
189
+ $instance['period'] = ( ! empty( $new_instance['period'] ) ) ? strip_tags( $new_instance['period'] ) : '7daysAgo';
190
+ $instance['display'] = ( ! empty( $new_instance['display'] ) ) ? strip_tags( $new_instance['display'] ) : 1;
191
+ $instance['give_credits'] = ( ! empty( $new_instance['give_credits'] ) ) ? strip_tags( $new_instance['give_credits'] ) : 0;
192
+ $instance['anonim'] = ( ! empty( $new_instance['anonim'] ) ) ? strip_tags( $new_instance['anonim'] ) : 0;
193
+ return $instance;
194
+ }
195
+ }
tags/5.3.1.1/gadwp.php ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Google Analytics Dashboard for WP (GADWP)
4
+ * Plugin URI: https://deconf.com
5
+ * Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
6
+ * Author: Alin Marcu
7
+ * Version: 5.3.1.1
8
+ * Author URI: https://deconf.com
9
+ * Text Domain: google-analytics-dashboard-for-wp
10
+ * Domain Path: /languages
11
+ */
12
+
13
+ // Exit if accessed directly
14
+ if ( ! defined( 'ABSPATH' ) )
15
+ exit();
16
+
17
+ // Plugin Version
18
+ if ( ! defined( 'GADWP_CURRENT_VERSION' ) ) {
19
+ define( 'GADWP_CURRENT_VERSION', '5.3.1.1' );
20
+ }
21
+
22
+ if ( ! defined( 'GADWP_ENDPOINT_URL' ) ) {
23
+ define( 'GADWP_ENDPOINT_URL', 'https://gadwp.deconf.com/' );
24
+ }
25
+
26
+
27
+ if ( ! class_exists( 'GADWP_Manager' ) ) {
28
+
29
+ final class GADWP_Manager {
30
+
31
+ private static $instance = null;
32
+
33
+ public $config = null;
34
+
35
+ public $frontend_actions = null;
36
+
37
+ public $common_actions = null;
38
+
39
+ public $backend_actions = null;
40
+
41
+ public $tracking = null;
42
+
43
+ public $frontend_item_reports = null;
44
+
45
+ public $backend_setup = null;
46
+
47
+ public $frontend_setup = null;
48
+
49
+ public $backend_widgets = null;
50
+
51
+ public $backend_item_reports = null;
52
+
53
+ public $gapi_controller = null;
54
+
55
+ /**
56
+ * Construct forbidden
57
+ */
58
+ private function __construct() {
59
+ if ( null !== self::$instance ) {
60
+ _doing_it_wrong( __FUNCTION__, __( "This is not allowed, read the documentation!", 'google-analytics-dashboard-for-wp' ), '4.6' );
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Clone warning
66
+ */
67
+ private function __clone() {
68
+ _doing_it_wrong( __FUNCTION__, __( "This is not allowed, read the documentation!", 'google-analytics-dashboard-for-wp' ), '4.6' );
69
+ }
70
+
71
+ /**
72
+ * Wakeup warning
73
+ */
74
+ private function __wakeup() {
75
+ _doing_it_wrong( __FUNCTION__, __( "This is not allowed, read the documentation!", 'google-analytics-dashboard-for-wp' ), '4.6' );
76
+ }
77
+
78
+ /**
79
+ * Creates a single instance for GADWP and makes sure only one instance is present in memory.
80
+ *
81
+ * @return GADWP_Manager
82
+ */
83
+ public static function instance() {
84
+ if ( null === self::$instance ) {
85
+ self::$instance = new self();
86
+ self::$instance->setup();
87
+ self::$instance->config = new GADWP_Config();
88
+ }
89
+ return self::$instance;
90
+ }
91
+
92
+ /**
93
+ * Defines constants and loads required resources
94
+ */
95
+ private function setup() {
96
+
97
+ // Plugin Path
98
+ if ( ! defined( 'GADWP_DIR' ) ) {
99
+ define( 'GADWP_DIR', plugin_dir_path( __FILE__ ) );
100
+ }
101
+
102
+ // Plugin URL
103
+ if ( ! defined( 'GADWP_URL' ) ) {
104
+ define( 'GADWP_URL', plugin_dir_url( __FILE__ ) );
105
+ }
106
+
107
+ // Plugin main File
108
+ if ( ! defined( 'GADWP_FILE' ) ) {
109
+ define( 'GADWP_FILE', __FILE__ );
110
+ }
111
+
112
+ /*
113
+ * Load Tools class
114
+ */
115
+ include_once ( GADWP_DIR . 'tools/tools.php' );
116
+
117
+ /*
118
+ * Load Config class
119
+ */
120
+ include_once ( GADWP_DIR . 'config.php' );
121
+
122
+ /*
123
+ * Load GAPI Controller class
124
+ */
125
+ include_once ( GADWP_DIR . 'tools/gapi.php' );
126
+
127
+ /*
128
+ * Plugin i18n
129
+ */
130
+ add_action( 'init', array( self::$instance, 'load_i18n' ) );
131
+
132
+ /*
133
+ * Plugin Init
134
+ */
135
+ add_action( 'init', array( self::$instance, 'load' ) );
136
+
137
+ /*
138
+ * Include Install
139
+ */
140
+ include_once ( GADWP_DIR . 'install/install.php' );
141
+ register_activation_hook( GADWP_FILE, array( 'GADWP_Install', 'install' ) );
142
+
143
+ /*
144
+ * Include Uninstall
145
+ */
146
+ include_once ( GADWP_DIR . 'install/uninstall.php' );
147
+ register_uninstall_hook( GADWP_FILE, array( 'GADWP_Uninstall', 'uninstall' ) );
148
+
149
+ /*
150
+ * Load Frontend Widgets
151
+ * (needed during ajax)
152
+ */
153
+ include_once ( GADWP_DIR . 'front/widgets.php' );
154
+
155
+ /*
156
+ * Add Frontend Widgets
157
+ * (needed during ajax)
158
+ */
159
+ add_action( 'widgets_init', array( self::$instance, 'add_frontend_widget' ) );
160
+ }
161
+
162
+ /**
163
+ * Load i18n
164
+ */
165
+ public function load_i18n() {
166
+ load_plugin_textdomain( 'google-analytics-dashboard-for-wp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
167
+ }
168
+
169
+ /**
170
+ * Register Frontend Widgets
171
+ */
172
+ public function add_frontend_widget() {
173
+ register_widget( 'GADWP_Frontend_Widget' );
174
+ }
175
+
176
+ /**
177
+ * Conditional load
178
+ */
179
+ public function load() {
180
+ if ( is_admin() ) {
181
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
182
+ if ( GADWP_Tools::check_roles( self::$instance->config->options['access_back'] ) ) {
183
+ /*
184
+ * Load Backend ajax actions
185
+ */
186
+ include_once ( GADWP_DIR . 'admin/ajax-actions.php' );
187
+ self::$instance->backend_actions = new GADWP_Backend_Ajax();
188
+ }
189
+
190
+ /*
191
+ * Load Frontend ajax actions
192
+ */
193
+ include_once ( GADWP_DIR . 'front/ajax-actions.php' );
194
+ self::$instance->frontend_actions = new GADWP_Frontend_Ajax();
195
+
196
+ /*
197
+ * Load Common ajax actions
198
+ */
199
+ include_once ( GADWP_DIR . 'common/ajax-actions.php' );
200
+ self::$instance->common_actions = new GADWP_Common_Ajax();
201
+
202
+ if ( self::$instance->config->options['backend_item_reports'] ) {
203
+ /*
204
+ * Load Backend Item Reports for Quick Edit
205
+ */
206
+ include_once ( GADWP_DIR . 'admin/item-reports.php' );
207
+ self::$instance->backend_item_reports = new GADWP_Backend_Item_Reports();
208
+ }
209
+ } else if ( GADWP_Tools::check_roles( self::$instance->config->options['access_back'] ) ) {
210
+
211
+ /*
212
+ * Load Backend Setup
213
+ */
214
+ include_once ( GADWP_DIR . 'admin/setup.php' );
215
+ self::$instance->backend_setup = new GADWP_Backend_Setup();
216
+
217
+ if ( self::$instance->config->options['dashboard_widget'] ) {
218
+ /*
219
+ * Load Backend Widget
220
+ */
221
+ include_once ( GADWP_DIR . 'admin/widgets.php' );
222
+ self::$instance->backend_widgets = new GADWP_Backend_Widgets();
223
+ }
224
+
225
+ if ( self::$instance->config->options['backend_item_reports'] ) {
226
+ /*
227
+ * Load Backend Item Reports
228
+ */
229
+ include_once ( GADWP_DIR . 'admin/item-reports.php' );
230
+ self::$instance->backend_item_reports = new GADWP_Backend_Item_Reports();
231
+ }
232
+ }
233
+ } else {
234
+ if ( GADWP_Tools::check_roles( self::$instance->config->options['access_front'] ) ) {
235
+ /*
236
+ * Load Frontend Setup
237
+ */
238
+ include_once ( GADWP_DIR . 'front/setup.php' );
239
+ self::$instance->frontend_setup = new GADWP_Frontend_Setup();
240
+
241
+ if ( self::$instance->config->options['frontend_item_reports'] ) {
242
+ /*
243
+ * Load Frontend Item Reports
244
+ */
245
+ include_once ( GADWP_DIR . 'front/item-reports.php' );
246
+ self::$instance->frontend_item_reports = new GADWP_Frontend_Item_Reports();
247
+ }
248
+ }
249
+
250
+ if ( ! GADWP_Tools::check_roles( self::$instance->config->options['track_exclude'], true ) && 'disabled' != self::$instance->config->options['tracking_type'] ) {
251
+ /*
252
+ * Load tracking class
253
+ */
254
+ include_once ( GADWP_DIR . 'front/tracking.php' );
255
+ self::$instance->tracking = new GADWP_Tracking();
256
+ }
257
+ }
258
+ }
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Returns a unique instance of GADWP
264
+ */
265
+ function GADWP() {
266
+ return GADWP_Manager::instance();
267
+ }
268
+
269
+ /*
270
+ * Start GADWP
271
+ */
272
+ GADWP();
tags/5.3.1.1/install/install.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ class GADWP_Install {
15
+
16
+ public static function install() {
17
+ if ( ! get_option( 'ga_dash_token' ) ) {
18
+ $options = array();
19
+ $options['client_id'] = '';
20
+ $options['client_secret'] = '';
21
+ $options['access_front'][] = 'administrator';
22
+ $options['access_back'][] = 'administrator';
23
+ $options['tableid_jail'] = '';
24
+ $options['theme_color'] = '#1e73be';
25
+ $options['switch_profile'] = 0;
26
+ $options['tracking_type'] = 'universal';
27
+ $options['ga_anonymize_ip'] = 0;
28
+ $options['user_api'] = 0;
29
+ $options['ga_event_tracking'] = 0;
30
+ $options['ga_event_downloads'] = 'zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*';
31
+ $options['track_exclude'] = array();
32
+ $options['ga_target_geomap'] = '';
33
+ $options['ga_realtime_pages'] = 10;
34
+ $options['token'] = '';
35
+ $options['ga_profiles_list'] = array();
36
+ $options['ga_tracking_code'] = '';
37
+ $options['ga_enhanced_links'] = 0;
38
+ $options['ga_remarketing'] = 0;
39
+ $options['network_mode'] = 0;
40
+ $options['ga_speed_samplerate'] = 1;
41
+ $options['ga_user_samplerate'] = 100;
42
+ $options['ga_event_bouncerate'] = 0;
43
+ $options['ga_crossdomain_tracking'] = 0;
44
+ $options['ga_crossdomain_list'] = '';
45
+ $options['ga_author_dimindex'] = 0;
46
+ $options['ga_category_dimindex'] = 0;
47
+ $options['ga_tag_dimindex'] = 0;
48
+ $options['ga_user_dimindex'] = 0;
49
+ $options['ga_pubyear_dimindex'] = 0;
50
+ $options['ga_pubyearmonth_dimindex'] = 0;
51
+ $options['ga_aff_tracking'] = 0;
52
+ $options['ga_event_affiliates'] = '/out/';
53
+ $options['automatic_updates_minorversion'] = 1;
54
+ $options['backend_item_reports'] = 1;
55
+ $options['backend_realtime_report'] = 0;
56
+ $options['frontend_item_reports'] = 0;
57
+ $options['dashboard_widget'] = 1;
58
+ $options['api_backoff'] = 0;
59
+ $options['ga_cookiedomain'] = '';
60
+ $options['ga_cookiename'] = '';
61
+ $options['ga_cookieexpires'] = '';
62
+ $options['pagetitle_404'] = 'Page Not Found';
63
+ $options['maps_api_key'] = '';
64
+ $options['tm_author_var'] = 0;
65
+ $options['tm_category_var'] = 0;
66
+ $options['tm_tag_var'] = 0;
67
+ $options['tm_user_var'] = 0;
68
+ $options['tm_pubyear_var'] = 0;
69
+ $options['tm_pubyearmonth_var'] = 0;
70
+ $options['web_containerid'] = '';
71
+ $options['amp_containerid'] = '';
72
+ $options['amp_tracking_tagmanager'] = 0;
73
+ $options['amp_tracking_analytics'] = 0;
74
+ $options['amp_tracking_clientidapi'] = 0;
75
+ $options['trackingcode_infooter'] = 0;
76
+ $options['trackingevents_infooter'] = 0;
77
+ $options['ecommerce_mode'] = 'disabled';
78
+ $options['ga_formsubmit_tracking'] = 0;
79
+ $options['optimize_tracking'] = 0;
80
+ $options['optimize_containerid'] = '';
81
+ $options['optimize_pagehiding'] = '';
82
+ $options['superadmin_tracking'] = 0;
83
+ $options['ga_pagescrolldepth_tracking'] = 0;
84
+ $options['tm_pagescrolldepth_tracking'] = 0;
85
+ $options['ga_event_precision'] = 0;
86
+ $options['ga_force_ssl'] = 0;
87
+ $options['with_endpoint'] = 1;
88
+ $options['ga_optout'] = 0;
89
+ $options['ga_dnt_optout'] = 0;
90
+ $options['ga_with_gtag'] = 0;
91
+ } else {
92
+ $options = array();
93
+ $options['client_id'] = get_option( 'ga_dash_clientid' );
94
+ $options['client_secret'] = get_option( 'ga_dash_clientsecret' );
95
+ $options['access_front'][] = 'administrator';
96
+ $options['access_back'][] = 'administrator';
97
+ $options['tableid_jail'] = get_option( 'ga_dash_tableid_jail' );
98
+ $options['frontend_item_reports'] = get_option( 'ga_dash_frontend' );
99
+ $options['theme_color'] = '#1e73be';
100
+ $options['switch_profile'] = get_option( 'ga_dash_jailadmins' );
101
+ $options['tracking_type'] = get_option( 'ga_dash_tracking_type' );
102
+ $options['ga_anonymize_ip'] = get_option( 'ga_dash_anonim' );
103
+ $options['user_api'] = get_option( 'ga_dash_userapi' );
104
+ $options['ga_event_tracking'] = get_option( 'ga_event_tracking' );
105
+ $options['ga_event_downloads'] = get_option( 'ga_event_downloads' );
106
+ $options['track_exclude'] = array();
107
+ $options['ga_target_geomap'] = get_option( 'ga_target_geomap' );
108
+ $options['ga_realtime_pages'] = get_option( 'ga_realtime_pages' );
109
+ $options['token'] = get_option( 'ga_dash_token' );
110
+ $options['ga_profiles_list'] = get_option( 'ga_dash_profile_list' );
111
+ $options['ga_enhanced_links'] = 0;
112
+ $options['ga_remarketing'] = 0;
113
+ $options['network_mode'] = 0;
114
+ $options['ga_event_bouncerate'] = 0;
115
+ $options['ga_crossdomain_tracking'] = 0;
116
+ $options['ga_crossdomain_list'] = '';
117
+ $options['ga_author_dimindex'] = 0;
118
+ $options['ga_category_dimindex'] = 0;
119
+ $options['ga_tag_dimindex'] = 0;
120
+ $options['ga_user_dimindex'] = 0;
121
+ $options['ga_pubyear_dimindex'] = 0;
122
+ $options['ga_pubyearmonth_dimindex'] = 0;
123
+ $options['ga_event_affiliates'] = '/out/';
124
+ $options['ga_aff_tracking'] = 0;
125
+ $options['automatic_updates_minorversion'] = 1;
126
+ $options['backend_item_reports'] = 1;
127
+ $options['backend_realtime_report'] = 0;
128
+ $options['dashboard_widget'] = 1;
129
+ $options['api_backoff'] = 0;
130
+ $options['ga_cookiedomain'] = '';
131
+ $options['ga_cookiename'] = '';
132
+ $options['ga_cookieexpires'] = '';
133
+ $options['pagetitle_404'] = 'Page Not Found';
134
+ $options['maps_api_key'] = '';
135
+ $options['tm_author_var'] = 0;
136
+ $options['tm_category_var'] = 0;
137
+ $options['tm_tag_var'] = 0;
138
+ $options['tm_user_var'] = 0;
139
+ $options['tm_pubyear_var'] = 0;
140
+ $options['tm_pubyearmonth_var'] = 0;
141
+ $options['web_containerid'] = '';
142
+ $options['amp_containerid'] = '';
143
+ $options['amp_tracking_tagmanager'] = 0;
144
+ $options['amp_tracking_analytics'] = 0;
145
+ $options['amp_tracking_clientidapi'] = 0;
146
+ $options['trackingcode_infooter'] = 0;
147
+ $options['trackingevents_infooter'] = 0;
148
+ $options['ecommerce_mode'] = 'disabled';
149
+ $options['ga_formsubmit_tracking'] = 0;
150
+ $options['optimize_tracking'] = 0;
151
+ $options['optimize_containerid'] = '';
152
+ $options['optimize_pagehiding'] = '';
153
+ $options['superadmin_tracking'] = 0;
154
+ $options['ga_pagescrolldepth_tracking'] = 0;
155
+ $options['tm_pagescrolldepth_tracking'] = 0;
156
+ $options['ga_speed_samplerate'] = 1;
157
+ $options['ga_user_samplerate'] = 100;
158
+ $options['ga_event_precision'] = 0;
159
+ $options['ga_force_ssl'] = 0;
160
+ $options['with_endpoint'] = 1;
161
+ $options['ga_optout'] = 0;
162
+ $options['ga_dnt_optout'] = 0;
163
+ $options['ga_with_gtag'] = 0;
164
+
165
+ delete_option( 'ga_dash_clientid' );
166
+ delete_option( 'ga_dash_clientsecret' );
167
+ delete_option( 'ga_dash_access' );
168
+ delete_option( 'ga_dash_access_front' );
169
+ delete_option( 'ga_dash_access_back' );
170
+ delete_option( 'ga_dash_tableid_jail' );
171
+ delete_option( 'ga_dash_frontend' );
172
+ delete_option( 'ga_dash_style' );
173
+ delete_option( 'ga_dash_jailadmins' );
174
+
175
+ delete_option( 'ga_dash_tracking' );
176
+ delete_option( 'ga_dash_tracking_type' );
177
+ delete_option( 'ga_dash_anonim' );
178
+ delete_option( 'ga_dash_userapi' );
179
+ delete_option( 'ga_event_tracking' );
180
+ delete_option( 'ga_event_downloads' );
181
+ delete_option( 'track_exclude' );
182
+ delete_option( 'ga_target_geomap' );
183
+ delete_option( 'ga_realtime_pages' );
184
+ delete_option( 'ga_dash_token' );
185
+ delete_option( 'ga_dash_refresh_token' );
186
+ delete_option( 'ga_dash_profile_list' );
187
+ }
188
+ add_option( 'gadwp_options', json_encode( $options ) );
189
+ }
190
+ }
tags/5.3.1.1/install/uninstall.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ class GADWP_Uninstall {
15
+
16
+ public static function uninstall() {
17
+ global $wpdb;
18
+ if ( is_multisite() ) { // Cleanup Network install
19
+ foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) {
20
+ switch_to_blog( $blog['blog_id'] );
21
+ $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'gadwp_cache_%%'" );
22
+ delete_option( 'gadwp_options' );
23
+ restore_current_blog();
24
+ }
25
+ delete_site_option( 'gadwp_network_options' );
26
+ } else { // Cleanup Single install
27
+ $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'gadwp_cache_%%'" );
28
+ delete_option( 'gadwp_options' );
29
+ }
30
+ GADWP_Tools::unset_cookie( 'default_metric' );
31
+ GADWP_Tools::unset_cookie( 'default_dimension' );
32
+ GADWP_Tools::unset_cookie( 'default_view' );
33
+ }
34
+ }
tags/5.3.1.1/readme.txt ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Google Analytics Dashboard for WP (GADWP) ===
2
+ Contributors: deconf
3
+ Donate link: https://deconf.com/donate/
4
+ Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
5
+ Requires at least: 3.5
6
+ Tested up to: 4.9.4
7
+ Stable tag: 5.3.1.1
8
+ Requires PHP: 5.2.4
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ Connects Google Analytics with your WordPress site. Displays stats to help you understand your users and site content on a whole new level!
13
+
14
+ == Description ==
15
+ This Google Analytics for WordPress plugin enables you to track your site using the latest Google Analytics tracking code and allows you to view key Google Analytics stats in your WordPress install.
16
+
17
+ In addition to a set of general Google Analytics stats, in-depth Page reports and in-depth Post reports allow further segmentation of your analytics data, providing performance details for each post or page from your website.
18
+
19
+ The Google Analytics tracking code is fully customizable through options and hooks, allowing advanced data collection like custom dimensions and events.
20
+
21
+ = Google Analytics Real-Time Stats =
22
+
23
+ Google Analytics reports, in real-time, in your dashboard screen:
24
+
25
+ - Real-time number of visitors
26
+ - Real-time acquisition channels
27
+ - Real-time traffic sources details
28
+
29
+ = Google Analytics Reports =
30
+
31
+ The Google Analytics reports you need, on your dashboard, in your All Posts and All Pages screens, and on site's frontend:
32
+
33
+ - Sessions, organic searches, page views, bounce rate analytics stats
34
+ - Locations, pages, referrers, keywords, 404 errors analytics stats
35
+ - Traffic channels, social networks, traffic mediums, search engines analytics stats
36
+ - Device categories, browsers, operating systems, screen resolutions, mobile brands analytics stats
37
+
38
+ In addition, you can control who can view specific Google Analytics reports by setting permissions based on user roles.
39
+
40
+ = Google Analytics Tracking =
41
+
42
+ Installs the latest Google Analytics tracking code and allows full code customization:
43
+
44
+ - Universal Google Analytics (analytics.js) tracking code
45
+ - Global Site Tag (gtag.js) tracking code
46
+ - Enhanced link attribution
47
+ - Remarketing, demographics and interests tracking
48
+ - Page Speed sampling rate control
49
+ - User sampling rate control
50
+ - Cross domain tracking
51
+ - Exclude user roles from tracking
52
+ - Accelerated Mobile Pages (AMP) support for Google Analytics
53
+ - Ecommerce support for Google Analytics
54
+
55
+ User privacy oriented features:
56
+
57
+ - IP address anonymization
58
+ - option to follow Do Not Track (DNT) sent by browsers
59
+ - support for user tracking opt-out
60
+
61
+ Google Analytics Dashboard for WP enables you to easily track events like:
62
+
63
+ - Downloads
64
+ - Emails
65
+ - Outbound links
66
+ - Affiliate links
67
+ - Fragment identifiers
68
+ - Telephone
69
+ - Page Scrolling Depth
70
+ - Custom event categories, actions and labels using annotated HTML elements
71
+
72
+ With Google Analytics Dashboard for WP you can use custom dimensions to track:
73
+
74
+ - Authors
75
+ - Publication year
76
+ - Publication month
77
+ - Categories
78
+ - Tags
79
+ - User engagement
80
+
81
+ Actions and filters are available for further Google Analytics tracking code customization.
82
+
83
+ = Google Tag Manager Tracking =
84
+
85
+ As an alternative to Google Analytics tracking code, you can use Google Tag Manager for tracking:
86
+
87
+ - Google Tag Manager code
88
+ - Data Layer variables: authors, publication year, publication month, categories, tags, user type
89
+ - Exclude user roles from tracking
90
+ - Accelerated Mobile Pages (AMP) support for Google Tag Manager
91
+
92
+ = Accelerated Mobile Pages (AMP) features =
93
+
94
+ - Google Tag Manager basic tracking
95
+ - Google Analytics basic tracking
96
+ - Automatically removes <em>amp/</em> from Google Analytics tracking page URL
97
+ - Scrolling depth tracking
98
+ - Custom dimensions tracking
99
+ - User sampling rate control
100
+ - Form submit tracking
101
+ - File downloads tracking
102
+ - Affiliate links tracking
103
+ - Hashmarks, outbound links, telephones and e-mails tracking
104
+ - Custom event categories, actions and labels using annotated HTML elements
105
+
106
+ = Google Analytics Dashboard for WP on Multisite =
107
+
108
+ This plugin is fully compatible with multisite network installs, allowing three setup modes:
109
+
110
+ - Mode 1: network activated using multiple Google Analytics accounts
111
+ - Mode 2: network activated using a single Google Analytics account
112
+ - Mode 3: network deactivated using multiple Google Analytics accounts
113
+
114
+ > <strong>Google Analytics Dashboard for WP on GitHub</strong><br>
115
+ > You can submit feature requests or bugs on [Google Analytics Dashboard for WP](https://github.com/deconf/Google-Analytics-Dashboard-for-WP) repository.
116
+
117
+ = Further reading =
118
+
119
+ * Homepage of [Google Analytics Dashboard for WP](https://deconf.com/google-analytics-dashboard-wordpress/)
120
+ * Other [WordPress Plugins](https://deconf.com/wordpress/) by same author
121
+ * [Google Analytics | Partners](https://www.google.com/analytics/partners/company/5127525902581760/gadp/5629499534213120/app/5707702298738688/listing/5639274879778816) Gallery
122
+
123
+ == Installation ==
124
+
125
+ 1. Upload the full google-analytics-dashboard-for-wp directory into your wp-content/plugins directory.
126
+ 2. In WordPress select Plugins from your sidebar menu and activate the Google Analytics Dashboard for WP plugin.
127
+ 3. Open the plugin configuration page, which is located under Google Analytics menu.
128
+ 4. Authorize the plugin to connect to Google Analytics using the Authorize Plugin button.
129
+ 5. Go back to the plugin configuration page, which is located under Google Analytics menu to update/set your settings.
130
+ 6. Go to Google Analytics -> Tracking Code to configure/enable/disable tracking.
131
+
132
+ == Frequently Asked Questions ==
133
+
134
+ = Do I have to insert the Google Analytics tracking code manually? =
135
+
136
+ No, once the plugin is authorized and a default domain is selected the Google Analytics tracking code is automatically inserted in all webpages.
137
+
138
+ = Some settings are missing in the video tutorial =
139
+
140
+ We are constantly improving Google Analytics Dashboard for WP, sometimes the video tutorial may be a little outdated.
141
+
142
+ = How can I suggest a new feature, contribute or report a bug? =
143
+
144
+ You can submit pull requests, feature requests and bug reports on [our GitHub repository](https://github.com/deconf/Google-Analytics-Dashboard-for-WP).
145
+
146
+ = Documentation, Tutorials and FAQ =
147
+
148
+ For documentation, tutorials, FAQ and videos check out: [Google Analytics Dashboard for WP documentation](https://deconf.com/google-analytics-dashboard-wordpress/).
149
+
150
+ == Screenshots ==
151
+
152
+ 1. Google Analytics Dashboard for WP Blue Color
153
+ 2. Google Analytics Dashboard for WP Real-Time
154
+ 3. Google Analytics Dashboard for WP reports per Posts/Pages
155
+ 4. Google Analytics Dashboard for WP Geo Map
156
+ 5. Google Analytics Dashboard for WP Top Pages, Top Referrers and Top Searches
157
+ 6. Google Analytics Dashboard for WP Traffic Overview
158
+ 7. Google Analytics Dashboard for WP statistics per page on Frontend
159
+ 8. Google Analytics Dashboard for WP cities on region map
160
+ 9. Google Analytics Dashboard for WP Widget
161
+
162
+ == Localization ==
163
+
164
+ You can translate Google Analytics Dashboard for WP on [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/google-analytics-dashboard-for-wp).
165
+
166
+ == License ==
167
+
168
+ Google Analytics Dashboard for WP it's released under the GPLv2, you can use it free of charge on your personal or commercial website.
169
+
170
+ == Upgrade Notice ==
171
+
172
+ == Changelog ==
173
+
174
+ [GADWP v5.3 release notes](https://deconf.com/adding-gtag-js-to-your-site/)
175
+
176
+ = 5.3.1.1 =
177
+ * Bug Fixes:
178
+ * avoid tracking issues by not clearing the profiles list on automatic token resets
179
+
180
+ = 5.3.1 =
181
+ * Bug Fixes:
182
+ * frontend_item_reports PHP notice when upgrading from a version lower than v4.8.0.1
183
+
184
+ = 5.3 =
185
+ * Enhancements:
186
+ * adds full support for Global Site Tag (gtag.js)
187
+ * remove Scroll Depth functionality, since this is now available as a trigger on Google Tag Manager
188
+ * adds custom dimensions support for AMP pages with Google Tag Manager tracking
189
+ * adds support for button submits
190
+ * Bug Fixes:
191
+ * form submit events were not following the non-interaction settings
192
+
193
+ = 5.2.3.1 =
194
+ * Bug Fixes:
195
+ * fixing a small reporting issue
196
+
197
+ = 5.2.3 =
198
+ * Enhancements:
199
+ * add Google Analytics user opt-out support
200
+ * add option to exclude tracking for users sending the <em>Do Not Track</em> header
201
+ * add System tab to Errors & Debug screen
202
+ * check to avoid using a redeemed access code
203
+ * Bug Fixes:
204
+ * remove a debugging message
205
+ * cURL options were overwritten during regular API calls
206
+
207
+ = 5.2.2 =
208
+ * Enhancements:
209
+ * more informative alerts and suggestions on the authorization screen
210
+ * disable autocomplete for the access code input field to avoid reuse of the same unique authorization code
211
+ * GADWP Endpoint improvements
212
+ * Error reporting improvements
213
+ * introducing the gadwp_maps_api_key filter
214
+ * Bug Fixes:
215
+ * use the theme color palette for the frontend widget
216
+
217
+ = 5.2.1 =
218
+ * Enhancements:
219
+ * avoid submitting empty error reports
220
+ * Bug Fixes:
221
+ * fixes a bug for custom PHP cURL options
222
+
223
+ = 5.2 =
224
+ * Enhancements:
225
+ * improvements on exponential backoff system
226
+ * introduces a new authentication method with endpoints
227
+ * multiple updates of plugin's options
228
+ * code cleanup
229
+ * improvements on error reporting system
230
+ * option to report errors to developer
231
+ * move the upgrade notice from the Dashboard to plugin's settings page
232
+ * enable PHP cURL proxy support using WordPress settings, props by [Joe Hobson](https://github.com/joehobson)
233
+ * hide unusable options based on plugin's settings
234
+ * Bug Fixes:
235
+ * some thrown errors were not displayed on Errors & Debug screen
236
+ * analytics icon disappears from post list after quick edit, props by [karex](https://github.com/karex)
237
+ * fix for inline SVG links, props by [Andrew Minion](https://github.com/macbookandrew)
238
+ * fixes a bug on affiliate events tracking
239
+
240
+ The full changelog is [available here](https://deconf.com/changelog-google-analytics-dashboard-for-wp/).
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_flat_75_ffffff_40x100.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_65_ffffff_1x400.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_75_dadada_1x400.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_glass_95_fef1ec_1x400.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_222222_256x240.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_2e83ff_256x240.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_454545_256x240.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_888888_256x240.png RENAMED
File without changes
{realtime → tags/5.3.1.1/realtime}/jquery/images/ui-icons_cd0a0a_256x240.png RENAMED
File without changes
tags/5.3.1.1/realtime/jquery/jquery.ui.tooltip.html.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! jQuery UI - v1.9.2 - 2013-09-22
2
+ * http://jqueryui.com
3
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}* html .ui-tooltip{background-image:none}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}
{realtime → tags/5.3.1.1/realtime}/jquery/jquery.ui.tooltip.html.js RENAMED
File without changes
tags/5.3.1.1/tools/gapi.php ADDED
@@ -0,0 +1,961 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
15
+
16
+ final class GADWP_GAPI_Controller {
17
+
18
+ public $client;
19
+
20
+ public $service;
21
+
22
+ public $timeshift;
23
+
24
+ public $managequota;
25
+
26
+ private $gadwp;
27
+
28
+ private $access = array( '65556128672.apps.googleusercontent.com', 'Kc7888wgbc_JbeCmApbFjnYpwE' );
29
+
30
+ public function __construct() {
31
+ $this->gadwp = GADWP();
32
+
33
+ include_once ( GADWP_DIR . 'tools/src/Deconf/autoload.php' );
34
+ $config = new Deconf_Config();
35
+ $config->setCacheClass( 'Deconf_Cache_Null' );
36
+ if ( function_exists( 'curl_version' ) ) {
37
+ $curlversion = curl_version();
38
+ $curl_options = array();
39
+ if ( isset( $curlversion['version'] ) ) {
40
+ $rightversion = ( version_compare( PHP_VERSION, '5.3.0' ) >= 0 ) && version_compare( $curlversion['version'], '7.10.8' ) >= 0;
41
+ } else {
42
+ $rightversion = false;
43
+ }
44
+
45
+ if ( $rightversion && defined( 'GADWP_IP_VERSION' ) && GADWP_IP_VERSION ) {
46
+ $curl_options[CURLOPT_IPRESOLVE] = GADWP_IP_VERSION; // Force CURL_IPRESOLVE_V4 or CURL_IPRESOLVE_V6
47
+ }
48
+
49
+ // add Proxy server settings to curl, if defined
50
+ if ( defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' ) ) {
51
+ $curl_options[CURLOPT_PROXY] = WP_PROXY_HOST;
52
+ $curl_options[CURLOPT_PROXYPORT] = WP_PROXY_PORT;
53
+ }
54
+
55
+ if ( defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' ) ) {
56
+ $curl_options[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;
57
+ $curl_options[CURLOPT_PROXYUSERPWD] = WP_PROXY_USERNAME . ':' . WP_PROXY_PASSWORD;
58
+ }
59
+
60
+ $curl_options = apply_filters( 'gadwp_curl_options', $curl_options );
61
+ if ( ! empty( $curl_options ) ) {
62
+ $config->setClassConfig( 'Deconf_IO_Curl', 'options', $curl_options );
63
+ }
64
+ }
65
+ $this->client = new Deconf_Client( $config );
66
+ $this->client->setScopes( array( 'https://www.googleapis.com/auth/analytics.readonly' ) );
67
+ $this->client->setAccessType( 'offline' );
68
+ $this->client->setApplicationName( 'GADWP ' . GADWP_CURRENT_VERSION );
69
+ $this->client->setRedirectUri( 'urn:ietf:wg:oauth:2.0:oob' );
70
+ $this->managequota = 'u' . get_current_user_id() . 's' . get_current_blog_id();
71
+ $this->access = array_map( array( $this, 'map' ), $this->access );
72
+ if ( $this->gadwp->config->options['user_api'] ) {
73
+ $this->client->setClientId( $this->gadwp->config->options['client_id'] );
74
+ $this->client->setClientSecret( $this->gadwp->config->options['client_secret'] );
75
+ } else {
76
+ $this->client->setClientId( $this->access[0] );
77
+ $this->client->setClientSecret( $this->access[1] );
78
+ }
79
+
80
+ /**
81
+ * GADWP Endpoint support
82
+ */
83
+ add_action( 'gadwp_endpoint_support', array( $this, 'add_endpoint_support' ) );
84
+
85
+ $this->service = new Deconf_Service_Analytics( $this->client );
86
+ if ( $this->gadwp->config->options['token'] ) {
87
+ $token = $this->gadwp->config->options['token'];
88
+ if ( $token ) {
89
+ try {
90
+ $this->client->setAccessToken( $token );
91
+ if ( $this->client->isAccessTokenExpired() ) {
92
+ $refreshtoken = $this->client->getRefreshToken();
93
+ $this->client->refreshToken( $refreshtoken );
94
+ }
95
+ $this->gadwp->config->options['token'] = $this->client->getAccessToken();
96
+ } catch ( Deconf_IO_Exception $e ) {
97
+ $timeout = $this->get_timeouts( 'midnight' );
98
+ GADWP_Tools::set_error( $e, $timeout );
99
+ } catch ( Deconf_Service_Exception $e ) {
100
+ $timeout = $this->get_timeouts( 'midnight' );
101
+ GADWP_Tools::set_error( $e, $timeout );
102
+ $this->reset_token();
103
+ } catch ( Exception $e ) {
104
+ $timeout = $this->get_timeouts( 'midnight' );
105
+ GADWP_Tools::set_error( $e, $timeout );
106
+ $this->reset_token();
107
+ }
108
+ if ( is_multisite() && $this->gadwp->config->options['network_mode'] ) {
109
+ $this->gadwp->config->set_plugin_options( true );
110
+ } else {
111
+ $this->gadwp->config->set_plugin_options();
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ public function add_endpoint_support( $request ) {
118
+ if ( $this->gadwp->config->options['with_endpoint'] && ! $this->gadwp->config->options['user_api'] ) {
119
+
120
+ $url = $request->getUrl();
121
+
122
+ if ( in_array( $url, array( 'https://accounts.google.com/o/oauth2/token', 'https://accounts.google.com/o/oauth2/revoke' ) ) ) {
123
+ if ( get_class( $this->client->getIo() ) != 'Deconf_IO_Stream' ) {
124
+ $curl_old_options = $this->client->getClassConfig( 'Deconf_IO_Curl' );
125
+ $curl_options = $curl_old_options['options'];
126
+ $curl_options[CURLOPT_SSL_VERIFYPEER] = 0;
127
+ $this->client->setClassConfig( 'Deconf_IO_Curl', 'options', $curl_options );
128
+ } else {
129
+ add_filter( 'gadwp_endpoint_stream_options', array( $this, 'add_endpoint_stream_ssl' ), 10 );
130
+ }
131
+ } else {
132
+ if ( get_class( $this->client->getIo() ) != 'Deconf_IO_Stream' ) {
133
+ $curl_old_options = $this->client->getClassConfig( 'Deconf_IO_Curl' );
134
+ $curl_options = $curl_old_options['options'];
135
+ if ( isset( $curl_options[CURLOPT_SSL_VERIFYPEER] ) ) {
136
+ unset( $curl_options[CURLOPT_SSL_VERIFYPEER] );
137
+ if ( empty( $curl_options ) ) {
138
+ $this->client->setClassConfig( 'Deconf_IO_Curl', 'options', '' );
139
+ } else {
140
+ $this->client->setClassConfig( 'Deconf_IO_Curl', 'options', $curl_options );
141
+ }
142
+ }
143
+ }
144
+ }
145
+
146
+ $url = str_replace( 'https://accounts.google.com/o/oauth2/token', GADWP_ENDPOINT_URL . 'gadwp-token.php', $url );
147
+
148
+ $url = str_replace( 'https://accounts.google.com/o/oauth2/revoke', GADWP_ENDPOINT_URL . 'gadwp-revoke.php', $url );
149
+
150
+ $request->setUrl( $url );
151
+
152
+ if ( ! $request->getUserAgent() ) {
153
+ $request->setUserAgent( $this->client->getApplicationName() );
154
+ }
155
+ }
156
+ }
157
+
158
+ public function add_endpoint_stream_ssl( $requestSslContext ) {
159
+ return array( "verify_peer" => false );
160
+ }
161
+
162
+ /**
163
+ * Handles errors returned by GAPI Library
164
+ *
165
+ * @return boolean
166
+ */
167
+ public function gapi_errors_handler() {
168
+ $errors = GADWP_Tools::get_cache( 'gapi_errors' );
169
+
170
+ if ( false === $errors || ! isset( $errors[0] ) ) { // invalid error
171
+ return false;
172
+ }
173
+
174
+ if ( isset( $errors[1][0]['reason'] ) && ( 'invalidParameter' == $errors[1][0]['reason'] || 'badRequest' == $errors[1][0]['reason'] || 'invalidCredentials' == $errors[1][0]['reason'] || 'insufficientPermissions' == $errors[1][0]['reason'] || 'required' == $errors[1][0]['reason'] ) ) {
175
+ $this->reset_token();
176
+ return true;
177
+ }
178
+
179
+ /** Back-off system for subsequent requests - an Auth error generated after a Service request
180
+ * The native back-off system for Service requests is covered by the GAPI PHP Client
181
+ */
182
+ if ( isset( $errors[1][0]['reason'] ) && ( 'authError' == $errors[1][0]['reason'] ) ) {
183
+ if ( $this->gadwp->config->options['api_backoff'] <= 5 ) {
184
+ usleep( $this->gadwp->config->options['api_backoff'] * 1000000 + rand( 100000, 1000000 ) );
185
+ $this->gadwp->config->options['api_backoff'] = $this->gadwp->config->options['api_backoff'] + 1;
186
+ $this->gadwp->config->set_plugin_options();
187
+ return false;
188
+ } else {
189
+ return true;
190
+ }
191
+ }
192
+
193
+ if ( 500 == $errors[0] || 503 == $errors[0] || 400 == $errors[0] || 401 == $errors[0] || 403 == $errors[0] || $errors[0] < - 50 ) {
194
+ return true;
195
+ }
196
+
197
+ return false;
198
+ }
199
+
200
+ /**
201
+ * Calculates proper timeouts for each GAPI query
202
+ *
203
+ * @param
204
+ * $interval
205
+ * @return number
206
+ */
207
+ public function get_timeouts( $interval = '' ) {
208
+ $local_time = time() + $this->timeshift;
209
+ if ( 'daily' == $interval ) {
210
+ $nextday = explode( '-', date( 'n-j-Y', strtotime( ' +1 day', $local_time ) ) );
211
+ $midnight = mktime( 0, 0, 0, $nextday[0], $nextday[1], $nextday[2] );
212
+ return $midnight - $local_time;
213
+ } else if ( 'midnight' == $interval ) {
214
+ $midnight = strtotime( "tomorrow 00:00:00" ); // UTC midnight
215
+ $midnight = $midnight + 8 * 3600; // UTC 8 AM
216
+ return $midnight - time();
217
+ } else if ( 'hourly' == $interval ) {
218
+ $nexthour = explode( '-', date( 'H-n-j-Y', strtotime( ' +1 hour', $local_time ) ) );
219
+ $newhour = mktime( $nexthour[0], 0, 0, $nexthour[1], $nexthour[2], $nexthour[3] );
220
+ return $newhour - $local_time;
221
+ } else {
222
+ $newtime = strtotime( ' +5 minutes', $local_time );
223
+ return $newtime - $local_time;
224
+ }
225
+ }
226
+
227
+ /**
228
+ * Generates and retrieves the Access Code
229
+ */
230
+ public function token_request() {
231
+ $data['authUrl'] = $this->client->createAuthUrl();
232
+ GADWP_Tools::load_view( 'admin/views/access-code.php', $data );
233
+ }
234
+
235
+ /**
236
+ * Retrieves all Google Analytics Views with details
237
+ *
238
+ * @return array
239
+ */
240
+ public function refresh_profiles() {
241
+ try {
242
+
243
+ $ga_profiles_list = array();
244
+ $startindex = 1;
245
+ $totalresults = 65535; // use something big
246
+
247
+ while ( $startindex < $totalresults ) {
248
+
249
+ $profiles = $this->service->management_profiles->listManagementProfiles( '~all', '~all', array( 'start-index' => $startindex ) );
250
+
251
+ $items = $profiles->getItems();
252
+
253
+ $totalresults = $profiles->getTotalResults();
254
+
255
+ if ( $totalresults > 0 ) {
256
+
257
+ foreach ( $items as $profile ) {
258
+ $timetz = new DateTimeZone( $profile->getTimezone() );
259
+ $localtime = new DateTime( 'now', $timetz );
260
+ $timeshift = strtotime( $localtime->format( 'Y-m-d H:i:s' ) ) - time();
261
+ $ga_profiles_list[] = array( $profile->getName(), $profile->getId(), $profile->getwebPropertyId(), $profile->getwebsiteUrl(), $timeshift, $profile->getTimezone(), $profile->getDefaultPage() );
262
+ $startindex++;
263
+ }
264
+ }
265
+ }
266
+
267
+ if ( empty( $ga_profiles_list ) ) {
268
+ $timeout = $this->get_timeouts( 'midnight' );
269
+ GADWP_Tools::set_error( 'No properties were found in this account!', $timeout );
270
+ } else {
271
+ GADWP_Tools::delete_cache( 'last_error' );
272
+ }
273
+ return $ga_profiles_list;
274
+ } catch ( Deconf_IO_Exception $e ) {
275
+ $timeout = $this->get_timeouts( 'midnight' );
276
+ GADWP_Tools::set_error( $e, $timeout );
277
+ return $ga_profiles_list;
278
+ } catch ( Deconf_Service_Exception $e ) {
279
+ $timeout = $this->get_timeouts( 'midnight' );
280
+ GADWP_Tools::set_error( $e, $timeout );
281
+ } catch ( Exception $e ) {
282
+ $timeout = $this->get_timeouts( 'midnight' );
283
+ GADWP_Tools::set_error( $e, $timeout );
284
+ }
285
+ }
286
+
287
+ /**
288
+ * Handles the token reset process
289
+ *
290
+ * @param
291
+ * $all
292
+ */
293
+ public function reset_token( $all = false ) {
294
+ $this->gadwp->config->options['token'] = "";
295
+ if ( $all ) {
296
+ $this->gadwp->config->options['tableid_jail'] = "";
297
+ $this->gadwp->config->options['ga_profiles_list'] = array();
298
+ try {
299
+ $this->client->revokeToken();
300
+ } catch ( Exception $e ) {
301
+ if ( is_multisite() && $this->gadwp->config->options['network_mode'] ) {
302
+ $this->gadwp->config->set_plugin_options( true );
303
+ } else {
304
+ $this->gadwp->config->set_plugin_options();
305
+ }
306
+ }
307
+ }
308
+ if ( is_multisite() && $this->gadwp->config->options['network_mode'] ) {
309
+ $this->gadwp->config->set_plugin_options( true );
310
+ } else {
311
+ $this->gadwp->config->set_plugin_options();
312
+ }
313
+ }
314
+
315
+ /**
316
+ * Get and cache Core Reports
317
+ *
318
+ * @param
319
+ * $projecId
320
+ * @param
321
+ * $from
322
+ * @param
323
+ * $to
324
+ * @param
325
+ * $metrics
326
+ * @param
327
+ * $options
328
+ * @param
329
+ * $serial
330
+ * @return int|Deconf_Service_Analytics_GaData
331
+ */
332
+ private function handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ) {
333
+ try {
334
+ if ( 'today' == $from ) {
335
+ $interval = 'hourly';
336
+ } else {
337
+ $interval = 'daily';
338
+ }
339
+ $transient = GADWP_Tools::get_cache( $serial );
340
+ if ( false === $transient ) {
341
+ if ( $this->gapi_errors_handler() ) {
342
+ return - 23;
343
+ }
344
+ $options['samplingLevel'] = 'HIGHER_PRECISION';
345
+ $data = $this->service->data_ga->get( 'ga:' . $projectId, $from, $to, $metrics, $options );
346
+ if ( method_exists( $data, 'getContainsSampledData' ) && $data->getContainsSampledData() ) {
347
+ $sampling['date'] = date( 'Y-m-d H:i:s' );
348
+ $sampling['percent'] = number_format( ( $data->getSampleSize() / $data->getSampleSpace() ) * 100, 2 ) . '%';
349
+ $sampling['sessions'] = $data->getSampleSize() . ' / ' . $data->getSampleSpace();
350
+ GADWP_Tools::set_cache( 'sampleddata', $sampling, 30 * 24 * 3600 );
351
+ GADWP_Tools::set_cache( $serial, $data, $this->get_timeouts( 'hourly' ) ); // refresh every hour if data is sampled
352
+ } else {
353
+ GADWP_Tools::set_cache( $serial, $data, $this->get_timeouts( $interval ) );
354
+ }
355
+ } else {
356
+ $data = $transient;
357
+ }
358
+ } catch ( Deconf_Service_Exception $e ) {
359
+ $timeout = $this->get_timeouts( 'midnight' );
360
+ GADWP_Tools::set_error( $e, $timeout );
361
+ return $e->getCode();
362
+ } catch ( Exception $e ) {
363
+ $timeout = $this->get_timeouts( 'midnight' );
364
+ GADWP_Tools::set_error( $e, $timeout );
365
+ return $e->getCode();
366
+ }
367
+
368
+ $this->gadwp->config->options['api_backoff'] = 0;
369
+ $this->gadwp->config->set_plugin_options();
370
+
371
+ if ( $data->getRows() > 0 ) {
372
+ return $data;
373
+ } else {
374
+ $data->rows = array();
375
+ return $data;
376
+ }
377
+ }
378
+
379
+ /**
380
+ * Generates serials for transients
381
+ *
382
+ * @param
383
+ * $serial
384
+ * @return string
385
+ */
386
+ public function get_serial( $serial ) {
387
+ return sprintf( "%u", crc32( $serial ) );
388
+ }
389
+
390
+ /**
391
+ * Analytics data for Area Charts (Admin Dashboard Widget report)
392
+ *
393
+ * @param
394
+ * $projectId
395
+ * @param
396
+ * $from
397
+ * @param
398
+ * $to
399
+ * @param
400
+ * $query
401
+ * @param
402
+ * $filter
403
+ * @return array|int
404
+ */
405
+ private function get_areachart_data( $projectId, $from, $to, $query, $filter = '' ) {
406
+ switch ( $query ) {
407
+ case 'users' :
408
+ $title = __( "Users", 'google-analytics-dashboard-for-wp' );
409
+ break;
410
+ case 'pageviews' :
411
+ $title = __( "Page Views", 'google-analytics-dashboard-for-wp' );
412
+ break;
413
+ case 'visitBounceRate' :
414
+ $title = __( "Bounce Rate", 'google-analytics-dashboard-for-wp' );
415
+ break;
416
+ case 'organicSearches' :
417
+ $title = __( "Organic Searches", 'google-analytics-dashboard-for-wp' );
418
+ break;
419
+ case 'uniquePageviews' :
420
+ $title = __( "Unique Page Views", 'google-analytics-dashboard-for-wp' );
421
+ break;
422
+ default :
423
+ $title = __( "Sessions", 'google-analytics-dashboard-for-wp' );
424
+ }
425
+ $metrics = 'ga:' . $query;
426
+ if ( 'today' == $from || 'yesterday' == $from ) {
427
+ $dimensions = 'ga:hour';
428
+ $dayorhour = __( "Hour", 'google-analytics-dashboard-for-wp' );
429
+ } else if ( '365daysAgo' == $from || '1095daysAgo' == $from ) {
430
+ $dimensions = 'ga:yearMonth, ga:month';
431
+ $dayorhour = __( "Date", 'google-analytics-dashboard-for-wp' );
432
+ } else {
433
+ $dimensions = 'ga:date,ga:dayOfWeekName';
434
+ $dayorhour = __( "Date", 'google-analytics-dashboard-for-wp' );
435
+ }
436
+ $options = array( 'dimensions' => $dimensions, 'quotaUser' => $this->managequota . 'p' . $projectId );
437
+ if ( $filter ) {
438
+ $options['filters'] = 'ga:pagePath==' . $filter;
439
+ }
440
+ $serial = 'qr2_' . $this->get_serial( $projectId . $from . $metrics . $filter );
441
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
442
+ if ( is_numeric( $data ) ) {
443
+ return $data;
444
+ }
445
+ if ( empty( $data->rows ) ) {
446
+ // unable to render it as an Area Chart, returns a numeric value to be handled by reportsx.js
447
+ return - 21;
448
+ }
449
+ $gadwp_data = array( array( $dayorhour, $title ) );
450
+ if ( 'today' == $from || 'yesterday' == $from ) {
451
+ foreach ( $data->getRows() as $row ) {
452
+ $gadwp_data[] = array( (int) $row[0] . ':00', round( $row[1], 2 ) );
453
+ }
454
+ } else if ( '365daysAgo' == $from || '1095daysAgo' == $from ) {
455
+ foreach ( $data->getRows() as $row ) {
456
+ /*
457
+ * translators:
458
+ * Example: 'F, Y' will become 'November, 2015'
459
+ * For details see: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters
460
+ */
461
+ $gadwp_data[] = array( date_i18n( __( 'F, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] . '01' ) ), round( $row[2], 2 ) );
462
+ }
463
+ } else {
464
+ foreach ( $data->getRows() as $row ) {
465
+ /*
466
+ * translators:
467
+ * Example: 'l, F j, Y' will become 'Thusday, November 17, 2015'
468
+ * For details see: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters
469
+ */
470
+ $gadwp_data[] = array( date_i18n( __( 'l, F j, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] ) ), round( $row[2], 2 ) );
471
+ }
472
+ }
473
+
474
+ return $gadwp_data;
475
+ }
476
+
477
+ /**
478
+ * Analytics data for Bottom Stats (bottom stats on main report)
479
+ *
480
+ * @param
481
+ * $projectId
482
+ * @param
483
+ * $from
484
+ * @param
485
+ * $to
486
+ * @param
487
+ * $filter
488
+ * @return array|int
489
+ */
490
+ private function get_bottomstats( $projectId, $from, $to, $filter = '' ) {
491
+ $options = array( 'dimensions' => null, 'quotaUser' => $this->managequota . 'p' . $projectId );
492
+ if ( $filter ) {
493
+ $options['filters'] = 'ga:pagePath==' . $filter;
494
+ $metrics = 'ga:uniquePageviews,ga:users,ga:pageviews,ga:BounceRate,ga:organicSearches,ga:pageviewsPerSession,ga:avgTimeOnPage,ga:avgPageLoadTime,ga:exitRate';
495
+ } else {
496
+ $metrics = 'ga:sessions,ga:users,ga:pageviews,ga:BounceRate,ga:organicSearches,ga:pageviewsPerSession,ga:avgTimeOnPage,ga:avgPageLoadTime,ga:avgSessionDuration';
497
+ }
498
+ $serial = 'qr3_' . $this->get_serial( $projectId . $from . $filter );
499
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
500
+ if ( is_numeric( $data ) ) {
501
+ return $data;
502
+ }
503
+ $gadwp_data = array();
504
+ foreach ( $data->getRows() as $row ) {
505
+ $gadwp_data = array_map( 'floatval', $row );
506
+ }
507
+
508
+ // i18n support
509
+ $gadwp_data[0] = isset( $gadwp_data[0] ) ? number_format_i18n( $gadwp_data[0] ) : 0;
510
+ $gadwp_data[1] = isset( $gadwp_data[1] ) ? number_format_i18n( $gadwp_data[1] ) : 0;
511
+ $gadwp_data[2] = isset( $gadwp_data[2] ) ? number_format_i18n( $gadwp_data[2] ) : 0;
512
+ $gadwp_data[3] = isset( $gadwp_data[3] ) ? number_format_i18n( $gadwp_data[3], 2 ) . '%' : '0%';
513
+ $gadwp_data[4] = isset( $gadwp_data[4] ) ? number_format_i18n( $gadwp_data[4] ) : 0;
514
+ $gadwp_data[5] = isset( $gadwp_data[5] ) ? number_format_i18n( $gadwp_data[5], 2 ) : 0;
515
+ $gadwp_data[6] = isset( $gadwp_data[6] ) ? gmdate( "H:i:s", $gadwp_data[6] ) : '00:00:00';
516
+ $gadwp_data[7] = isset( $gadwp_data[7] ) ? number_format_i18n( $gadwp_data[7], 2 ) : 0;
517
+ if ( $filter ) {
518
+ $gadwp_data[8] = isset( $gadwp_data[8] ) ? number_format_i18n( $gadwp_data[8], 2 ) . '%' : '0%';
519
+ } else {
520
+ $gadwp_data[8] = isset( $gadwp_data[8] ) ? gmdate( "H:i:s", $gadwp_data[8] ) : '00:00:00';
521
+ }
522
+
523
+ return $gadwp_data;
524
+ }
525
+
526
+ /**
527
+ * Analytics data for Table Charts (content pages)
528
+ *
529
+ * @param
530
+ * $projectId
531
+ * @param
532
+ * $from
533
+ * @param
534
+ * $to
535
+ * @param
536
+ * $filter
537
+ * @return array|int
538
+ */
539
+ private function get_contentpages( $projectId, $from, $to, $filter = '', $metric ) {
540
+ $metrics = 'ga:' . $metric;
541
+ $dimensions = 'ga:pageTitle';
542
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
543
+ if ( $filter ) {
544
+ $options['filters'] = 'ga:pagePath==' . $filter;
545
+ }
546
+ $serial = 'qr4_' . $this->get_serial( $projectId . $from . $filter . $metric );
547
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
548
+ if ( is_numeric( $data ) ) {
549
+ return $data;
550
+ }
551
+ $gadwp_data = array( array( __( "Pages", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
552
+ foreach ( $data->getRows() as $row ) {
553
+ $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] );
554
+ }
555
+ return $gadwp_data;
556
+ }
557
+
558
+ /**
559
+ * Analytics data for 404 Errors
560
+ *
561
+ * @param
562
+ * $projectId
563
+ * @param
564
+ * $from
565
+ * @param
566
+ * $to
567
+ * @return array|int
568
+ */
569
+ private function get_404errors( $projectId, $from, $to, $filter = "Page Not Found", $metric ) {
570
+ $metrics = 'ga:' . $metric;
571
+ $dimensions = 'ga:pagePath,ga:fullReferrer';
572
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
573
+ $options['filters'] = 'ga:pageTitle=@' . $filter;
574
+ $serial = 'qr4_' . $this->get_serial( $projectId . $from . $filter . $metric );
575
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
576
+ if ( is_numeric( $data ) ) {
577
+ return $data;
578
+ }
579
+ $gadwp_data = array( array( __( "404 Errors", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
580
+ foreach ( $data->getRows() as $row ) {
581
+ $path = esc_html( $row[0] );
582
+ $source = esc_html( $row[1] );
583
+ $gadwp_data[] = array( "<strong>" . __( "URI:", 'google-analytics-dashboard-for-wp' ) . "</strong> " . $path . "<br><strong>" . __( "Source:", 'google-analytics-dashboard-for-wp' ) . "</strong> " . $source, (int) $row[2] );
584
+ }
585
+ return $gadwp_data;
586
+ }
587
+
588
+ /**
589
+ * Analytics data for Table Charts (referrers)
590
+ *
591
+ * @param
592
+ * $projectId
593
+ * @param
594
+ * $from
595
+ * @param
596
+ * $to
597
+ * @param
598
+ * $filter
599
+ * @return array|int
600
+ */
601
+ private function get_referrers( $projectId, $from, $to, $filter = '', $metric ) {
602
+ $metrics = 'ga:' . $metric;
603
+ $dimensions = 'ga:source';
604
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
605
+ if ( $filter ) {
606
+ $options['filters'] = 'ga:medium==referral;ga:pagePath==' . $filter;
607
+ } else {
608
+ $options['filters'] = 'ga:medium==referral';
609
+ }
610
+ $serial = 'qr5_' . $this->get_serial( $projectId . $from . $filter . $metric );
611
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
612
+ if ( is_numeric( $data ) ) {
613
+ return $data;
614
+ }
615
+ $gadwp_data = array( array( __( "Referrers", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
616
+ foreach ( $data->getRows() as $row ) {
617
+ $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] );
618
+ }
619
+ return $gadwp_data;
620
+ }
621
+
622
+ /**
623
+ * Analytics data for Table Charts (searches)
624
+ *
625
+ * @param
626
+ * $projectId
627
+ * @param
628
+ * $from
629
+ * @param
630
+ * $to
631
+ * @param
632
+ * $filter
633
+ * @return array|int
634
+ */
635
+ private function get_searches( $projectId, $from, $to, $filter = '', $metric ) {
636
+ $metrics = 'ga:' . $metric;
637
+ $dimensions = 'ga:keyword';
638
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
639
+ if ( $filter ) {
640
+ $options['filters'] = 'ga:keyword!=(not set);ga:pagePath==' . $filter;
641
+ } else {
642
+ $options['filters'] = 'ga:keyword!=(not set)';
643
+ }
644
+ $serial = 'qr6_' . $this->get_serial( $projectId . $from . $filter . $metric );
645
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
646
+ if ( is_numeric( $data ) ) {
647
+ return $data;
648
+ }
649
+
650
+ $gadwp_data = array( array( __( "Searches", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
651
+ foreach ( $data->getRows() as $row ) {
652
+ $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] );
653
+ }
654
+ return $gadwp_data;
655
+ }
656
+
657
+ /**
658
+ * Analytics data for Table Charts (location reports)
659
+ *
660
+ * @param
661
+ * $projectId
662
+ * @param
663
+ * $from
664
+ * @param
665
+ * $to
666
+ * @param
667
+ * $filter
668
+ * @return array|int
669
+ */
670
+ private function get_locations( $projectId, $from, $to, $filter = '', $metric ) {
671
+ $metrics = 'ga:' . $metric;
672
+ $options = "";
673
+ $title = __( "Countries", 'google-analytics-dashboard-for-wp' );
674
+ $serial = 'qr7_' . $this->get_serial( $projectId . $from . $filter . $metric );
675
+ $dimensions = 'ga:country';
676
+ $local_filter = '';
677
+ if ( $this->gadwp->config->options['ga_target_geomap'] ) {
678
+ $dimensions = 'ga:city, ga:region';
679
+
680
+ $country_codes = GADWP_Tools::get_countrycodes();
681
+ if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
682
+ $local_filter = 'ga:country==' . ( $country_codes[$this->gadwp->config->options['ga_target_geomap']] );
683
+ $title = __( "Cities from", 'google-analytics-dashboard-for-wp' ) . ' ' . __( $country_codes[$this->gadwp->config->options['ga_target_geomap']] );
684
+ $serial = 'qr7_' . $this->get_serial( $projectId . $from . $this->gadwp->config->options['ga_target_geomap'] . $filter . $metric );
685
+ }
686
+ }
687
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
688
+ if ( $filter ) {
689
+ $options['filters'] = 'ga:pagePath==' . $filter;
690
+ if ( $local_filter ) {
691
+ $options['filters'] .= ';' . $local_filter;
692
+ }
693
+ } else {
694
+ if ( $local_filter ) {
695
+ $options['filters'] = $local_filter;
696
+ }
697
+ }
698
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
699
+ if ( is_numeric( $data ) ) {
700
+ return $data;
701
+ }
702
+
703
+ $gadwp_data = array( array( $title, __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
704
+ foreach ( $data->getRows() as $row ) {
705
+ if ( isset( $row[2] ) ) {
706
+ $gadwp_data[] = array( esc_html( $row[0] ) . ', ' . esc_html( $row[1] ), (int) $row[2] );
707
+ } else {
708
+ $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] );
709
+ }
710
+ }
711
+ return $gadwp_data;
712
+ }
713
+
714
+ /**
715
+ * Analytics data for Org Charts (traffic channels, device categories)
716
+ *
717
+ * @param
718
+ * $projectId
719
+ * @param
720
+ * $from
721
+ * @param
722
+ * $to
723
+ * @param
724
+ * $query
725
+ * @param
726
+ * $filter
727
+ * @return array|int
728
+ */
729
+ private function get_orgchart_data( $projectId, $from, $to, $query, $filter = '', $metric ) {
730
+ $metrics = 'ga:' . $metric;
731
+ $dimensions = 'ga:' . $query;
732
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
733
+ if ( $filter ) {
734
+ $options['filters'] = 'ga:pagePath==' . $filter;
735
+ }
736
+ $serial = 'qr8_' . $this->get_serial( $projectId . $from . $query . $filter . $metric );
737
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
738
+ if ( is_numeric( $data ) ) {
739
+ return $data;
740
+ }
741
+ if ( empty( $data->rows ) ) {
742
+ // unable to render as an Org Chart, returns a numeric value to be handled by reportsx.js
743
+ return - 21;
744
+ }
745
+ $block = ( 'channelGrouping' == $query ) ? __( "Channels", 'google-analytics-dashboard-for-wp' ) : __( "Devices", 'google-analytics-dashboard-for-wp' );
746
+ $gadwp_data = array( array( '<div style="color:black; font-size:1.1em">' . $block . '</div><div style="color:darkblue; font-size:1.2em">' . (int) $data['totalsForAllResults'][$metrics] . '</div>', "" ) );
747
+ foreach ( $data->getRows() as $row ) {
748
+ $shrink = explode( " ", $row[0] );
749
+ $gadwp_data[] = array( '<div style="color:black; font-size:1.1em">' . esc_html( $shrink[0] ) . '</div><div style="color:darkblue; font-size:1.2em">' . (int) $row[1] . '</div>', '<div style="color:black; font-size:1.1em">' . $block . '</div><div style="color:darkblue; font-size:1.2em">' . (int) $data['totalsForAllResults'][$metrics] . '</div>' );
750
+ }
751
+ return $gadwp_data;
752
+ }
753
+
754
+ /**
755
+ * Analytics data for Pie Charts (traffic mediums, serach engines, social networks, browsers, screen rsolutions, etc.)
756
+ *
757
+ * @param
758
+ * $projectId
759
+ * @param
760
+ * $from
761
+ * @param
762
+ * $to
763
+ * @param
764
+ * $query
765
+ * @param
766
+ * $filter
767
+ * @return array|int
768
+ */
769
+ private function get_piechart_data( $projectId, $from, $to, $query, $filter = '', $metric ) {
770
+ $metrics = 'ga:' . $metric;
771
+ $dimensions = 'ga:' . $query;
772
+
773
+ if ( 'source' == $query ) {
774
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
775
+ if ( $filter ) {
776
+ $options['filters'] = 'ga:medium==organic;ga:keyword!=(not set);ga:pagePath==' . $filter;
777
+ } else {
778
+ $options['filters'] = 'ga:medium==organic;ga:keyword!=(not set)';
779
+ }
780
+ } else {
781
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
782
+ if ( $filter ) {
783
+ $options['filters'] = 'ga:' . $query . '!=(not set);ga:pagePath==' . $filter;
784
+ } else {
785
+ $options['filters'] = 'ga:' . $query . '!=(not set)';
786
+ }
787
+ }
788
+ $serial = 'qr10_' . $this->get_serial( $projectId . $from . $query . $filter . $metric );
789
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
790
+ if ( is_numeric( $data ) ) {
791
+ return $data;
792
+ }
793
+ $gadwp_data = array( array( __( "Type", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
794
+ $i = 0;
795
+ $included = 0;
796
+ foreach ( $data->getRows() as $row ) {
797
+ if ( $i < 20 ) {
798
+ $gadwp_data[] = array( str_replace( "(none)", "direct", esc_html( $row[0] ) ), (int) $row[1] );
799
+ $included += $row[1];
800
+ $i++;
801
+ } else {
802
+ break;
803
+ }
804
+ }
805
+ $totals = $data->getTotalsForAllResults();
806
+ $others = $totals[$metrics] - $included;
807
+ if ( $others > 0 ) {
808
+ $gadwp_data[] = array( __( 'Other', 'google-analytics-dashboard-for-wp' ), $others );
809
+ }
810
+
811
+ return $gadwp_data;
812
+ }
813
+
814
+ /**
815
+ * Analytics data for Frontend Widget (chart data and totals)
816
+ *
817
+ * @param
818
+ * $projectId
819
+ * @param
820
+ * $period
821
+ * @param
822
+ * $anonim
823
+ * @return array|int
824
+ */
825
+ public function frontend_widget_stats( $projectId, $from, $anonim ) {
826
+ $content = '';
827
+ $to = 'yesterday';
828
+ $metrics = 'ga:sessions';
829
+ $dimensions = 'ga:date,ga:dayOfWeekName';
830
+ $options = array( 'dimensions' => $dimensions, 'quotaUser' => $this->managequota . 'p' . $projectId );
831
+ $serial = 'qr2_' . $this->get_serial( $projectId . $from . $metrics );
832
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
833
+ if ( is_numeric( $data ) ) {
834
+ return $data;
835
+ }
836
+ $gadwp_data = array( array( __( "Date", 'google-analytics-dashboard-for-wp' ), __( "Sessions", 'google-analytics-dashboard-for-wp' ) ) );
837
+ if ( $anonim ) {
838
+ $max_array = array();
839
+ foreach ( $data->getRows() as $item ) {
840
+ $max_array[] = $item[2];
841
+ }
842
+ $max = max( $max_array ) ? max( $max_array ) : 1;
843
+ }
844
+ foreach ( $data->getRows() as $row ) {
845
+ $gadwp_data[] = array( date_i18n( __( 'l, F j, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] ) ), ( $anonim ? round( $row[2] * 100 / $max, 2 ) : (int) $row[2] ) );
846
+ }
847
+ $totals = $data->getTotalsForAllResults();
848
+ return array( $gadwp_data, $anonim ? 0 : number_format_i18n( $totals['ga:sessions'] ) );
849
+ }
850
+
851
+ /**
852
+ * Analytics data for Realtime component (the real-time report)
853
+ *
854
+ * @param
855
+ * $projectId
856
+ * @return array|int
857
+ */
858
+ private function get_realtime( $projectId ) {
859
+ $metrics = 'rt:activeUsers';
860
+ $dimensions = 'rt:pagePath,rt:source,rt:keyword,rt:trafficType,rt:visitorType,rt:pageTitle';
861
+ try {
862
+ $serial = 'qr_realtimecache_' . $this->get_serial( $projectId );
863
+ $transient = GADWP_Tools::get_cache( $serial );
864
+ if ( false === $transient ) {
865
+ if ( $this->gapi_errors_handler() ) {
866
+ return - 23;
867
+ }
868
+ $data = $this->service->data_realtime->get( 'ga:' . $projectId, $metrics, array( 'dimensions' => $dimensions, 'quotaUser' => $this->managequota . 'p' . $projectId ) );
869
+ GADWP_Tools::set_cache( $serial, $data, 55 );
870
+ } else {
871
+ $data = $transient;
872
+ }
873
+ } catch ( Deconf_Service_Exception $e ) {
874
+ $timeout = $this->get_timeouts( 'midnight' );
875
+ GADWP_Tools::set_error( $e, $timeout );
876
+ return $e->getCode();
877
+ } catch ( Exception $e ) {
878
+ $timeout = $this->get_timeouts( 'midnight' );
879
+ GADWP_Tools::set_error( $e, $timeout );
880
+ return $e->getCode();
881
+ }
882
+ if ( $data->getRows() < 1 ) {
883
+ return - 21;
884
+ }
885
+ $i = 0;
886
+ $gadwp_data = $data;
887
+ foreach ( $data->getRows() as $row ) {
888
+ $strip = array_map( 'wp_kses_data', $row );
889
+ $gadwp_data->rows[$i] = array_map( 'esc_html', $strip );
890
+ $i++;
891
+ }
892
+
893
+ $this->gadwp->config->options['api_backoff'] = 0;
894
+ $this->gadwp->config->set_plugin_options();
895
+
896
+ return array( $gadwp_data );
897
+ }
898
+
899
+ private function map( $map ) {
900
+ $map = explode( '.', $map );
901
+ if ( isset( $map[1] ) ) {
902
+ $map[0] += ord( 'map' );
903
+ return implode( '.', $map );
904
+ } else {
905
+ return str_ireplace( 'map', chr( 112 ), $map[0] );
906
+ }
907
+ }
908
+
909
+ /**
910
+ * Handles ajax requests and calls the needed methods
911
+ * @param
912
+ * $projectId
913
+ * @param
914
+ * $query
915
+ * @param
916
+ * $from
917
+ * @param
918
+ * $to
919
+ * @param
920
+ * $filter
921
+ * @return number|Deconf_Service_Analytics_GaData
922
+ */
923
+ public function get( $projectId, $query, $from = false, $to = false, $filter = '', $metric = 'sessions' ) {
924
+ if ( empty( $projectId ) || ! is_numeric( $projectId ) ) {
925
+ wp_die( - 26 );
926
+ }
927
+ if ( in_array( $query, array( 'sessions', 'users', 'organicSearches', 'visitBounceRate', 'pageviews', 'uniquePageviews' ) ) ) {
928
+ return $this->get_areachart_data( $projectId, $from, $to, $query, $filter );
929
+ }
930
+ if ( 'bottomstats' == $query ) {
931
+ return $this->get_bottomstats( $projectId, $from, $to, $filter );
932
+ }
933
+ if ( 'locations' == $query ) {
934
+ return $this->get_locations( $projectId, $from, $to, $filter, $metric );
935
+ }
936
+ if ( 'referrers' == $query ) {
937
+ return $this->get_referrers( $projectId, $from, $to, $filter, $metric );
938
+ }
939
+ if ( 'contentpages' == $query ) {
940
+ return $this->get_contentpages( $projectId, $from, $to, $filter, $metric );
941
+ }
942
+ if ( '404errors' == $query ) {
943
+ $filter = $this->gadwp->config->options['pagetitle_404'];
944
+ return $this->get_404errors( $projectId, $from, $to, $filter, $metric );
945
+ }
946
+ if ( 'searches' == $query ) {
947
+ return $this->get_searches( $projectId, $from, $to, $filter, $metric );
948
+ }
949
+ if ( 'realtime' == $query ) {
950
+ return $this->get_realtime( $projectId );
951
+ }
952
+ if ( 'channelGrouping' == $query || 'deviceCategory' == $query ) {
953
+ return $this->get_orgchart_data( $projectId, $from, $to, $query, $filter, $metric );
954
+ }
955
+ if ( in_array( $query, array( 'medium', 'visitorType', 'socialNetwork', 'source', 'browser', 'operatingSystem', 'screenResolution', 'mobileDeviceBranding' ) ) ) {
956
+ return $this->get_piechart_data( $projectId, $from, $to, $query, $filter, $metric );
957
+ }
958
+ wp_die( - 27 );
959
+ }
960
+ }
961
+ }
tags/5.3.1.1/tools/iso3166.php ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ /* @formatter:off */
15
+ $country_codes = array(
16
+ 'AD' => 'Andorra',
17
+ 'AE' => 'United Arab Emirates',
18
+ 'AF' => 'Afghanistan',
19
+ 'AG' => 'Antigua and Barbuda',
20
+ 'AI' => 'Anguilla',
21
+ 'AL' => 'Albania',
22
+ 'AM' => 'Armenia',
23
+ 'AN' => 'Netherlands Antilles',
24
+ 'AO' => 'Angola',
25
+ 'AQ' => 'Antarctica',
26
+ 'AR' => 'Argentina',
27
+ 'AS' => 'American Samoa',
28
+ 'AT' => 'Austria',
29
+ 'AU' => 'Australia',
30
+ 'AW' => 'Aruba',
31
+ 'AZ' => 'Azerbaijan',
32
+ 'BA' => 'Bosnia and Herzegovina',
33
+ 'BB' => 'Barbados',
34
+ 'BD' => 'Bangladesh',
35
+ 'BE' => 'Belgium',
36
+ 'BF' => 'Burkina Faso',
37
+ 'BG' => 'Bulgaria',
38
+ 'BH' => 'Bahrain',
39
+ 'BI' => 'Burundi',
40
+ 'BJ' => 'Benin',
41
+ 'BM' => 'Bermuda',
42
+ 'BN' => 'Brunei',
43
+ 'BO' => 'Bolivia',
44
+ 'BR' => 'Brazil',
45
+ 'BS' => 'Bahamas',
46
+ 'BT' => 'Bhutan',
47
+ 'BV' => 'Bouvet Island',
48
+ 'BW' => 'Botswana',
49
+ 'BY' => 'Belarus',
50
+ 'BZ' => 'Belize',
51
+ 'CA' => 'Canada',
52
+ 'CC' => 'Cocos (Keeling) Islands',
53
+ 'CD' => 'Congo, The Democratic Republic of the',
54
+ 'CF' => 'Central African Republic',
55
+ 'CG' => 'Congo',
56
+ 'CH' => 'Switzerland',
57
+ 'CI' => 'C�te d?Ivoire',
58
+ 'CK' => 'Cook Islands',
59
+ 'CL' => 'Chile',
60
+ 'CM' => 'Cameroon',
61
+ 'CN' => 'China',
62
+ 'CO' => 'Colombia',
63
+ 'CR' => 'Costa Rica',
64
+ 'CU' => 'Cuba',
65
+ 'CV' => 'Cape Verde',
66
+ 'CX' => 'Christmas Island',
67
+ 'CY' => 'Cyprus',
68
+ 'CZ' => 'Czech Republic',
69
+ 'DE' => 'Germany',
70
+ 'DJ' => 'Djibouti',
71
+ 'DK' => 'Denmark',
72
+ 'DM' => 'Dominica',
73
+ 'DO' => 'Dominican Republic',
74
+ 'DZ' => 'Algeria',
75
+ 'EC' => 'Ecuador',
76
+ 'EE' => 'Estonia',
77
+ 'EG' => 'Egypt',
78
+ 'EH' => 'Western Sahara',
79
+ 'ER' => 'Eritrea',
80
+ 'ES' => 'Spain',
81
+ 'ET' => 'Ethiopia',
82
+ 'FI' => 'Finland',
83
+ 'FJ' => 'Fiji Islands',
84
+ 'FK' => 'Falkland Islands',
85
+ 'FM' => 'Micronesia, Federated States of',
86
+ 'FO' => 'Faroe Islands',
87
+ 'FR' => 'France',
88
+ 'GA' => 'Gabon',
89
+ 'GB' => 'United Kingdom',
90
+ 'GD' => 'Grenada',
91
+ 'GE' => 'Georgia',
92
+ 'GF' => 'French Guiana',
93
+ 'GH' => 'Ghana',
94
+ 'GI' => 'Gibraltar',
95
+ 'GL' => 'Greenland',
96
+ 'GM' => 'Gambia',
97
+ 'GN' => 'Guinea',
98
+ 'GP' => 'Guadeloupe',
99
+ 'GQ' => 'Equatorial Guinea',
100
+ 'GR' => 'Greece',
101
+ 'GS' => 'South Georgia and the South Sandwich Islands',
102
+ 'GT' => 'Guatemala',
103
+ 'GU' => 'Guam',
104
+ 'GW' => 'Guinea-Bissau',
105
+ 'GY' => 'Guyana',
106
+ 'HK' => 'Hong Kong',
107
+ 'HM' => 'Heard Island and McDonald Islands',
108
+ 'HN' => 'Honduras',
109
+ 'HR' => 'Croatia',
110
+ 'HT' => 'Haiti',
111
+ 'HU' => 'Hungary',
112
+ 'ID' => 'Indonesia',
113
+ 'IE' => 'Ireland',
114
+ 'IL' => 'Israel',
115
+ 'IN' => 'India',
116
+ 'IO' => 'British Indian Ocean Territory',
117
+ 'IQ' => 'Iraq',
118
+ 'IR' => 'Iran',
119
+ 'IS' => 'Iceland',
120
+ 'IT' => 'Italy',
121
+ 'JM' => 'Jamaica',
122
+ 'JO' => 'Jordan',
123
+ 'JP' => 'Japan',
124
+ 'KE' => 'Kenya',
125
+ 'KG' => 'Kyrgyzstan',
126
+ 'KH' => 'Cambodia',
127
+ 'KI' => 'Kiribati',
128
+ 'KM' => 'Comoros',
129
+ 'KN' => 'Saint Kitts and Nevis',
130
+ 'KP' => 'North Korea',
131
+ 'KR' => 'South Korea',
132
+ 'KW' => 'Kuwait',
133
+ 'KY' => 'Cayman Islands',
134
+ 'KZ' => 'Kazakstan',
135
+ 'LA' => 'Laos',
136
+ 'LB' => 'Lebanon',
137
+ 'LC' => 'Saint Lucia',
138
+ 'LI' => 'Liechtenstein',
139
+ 'LK' => 'Sri Lanka',
140
+ 'LR' => 'Liberia',
141
+ 'LS' => 'Lesotho',
142
+ 'LT' => 'Lithuania',
143
+ 'LU' => 'Luxembourg',
144
+ 'LV' => 'Latvia',
145
+ 'LY' => 'Libyan Arab Jamahiriya',
146
+ 'MA' => 'Morocco',
147
+ 'MC' => 'Monaco',
148
+ 'MD' => 'Moldova',
149
+ 'MG' => 'Madagascar',
150
+ 'MH' => 'Marshall Islands',
151
+ 'MK' => 'Macedonia',
152
+ 'ML' => 'Mali',
153
+ 'MM' => 'Myanmar',
154
+ 'MN' => 'Mongolia',
155
+ 'MO' => 'Macao',
156
+ 'MP' => 'Northern Mariana Islands',
157
+ 'MQ' => 'Martinique',
158
+ 'MR' => 'Mauritania',
159
+ 'MS' => 'Montserrat',
160
+ 'MT' => 'Malta',
161
+ 'MU' => 'Mauritius',
162
+ 'MV' => 'Maldives',
163
+ 'MW' => 'Malawi',
164
+ 'MX' => 'Mexico',
165
+ 'MY' => 'Malaysia',
166
+ 'MZ' => 'Mozambique',
167
+ 'NA' => 'Namibia',
168
+ 'NC' => 'New Caledonia',
169
+ 'NE' => 'Niger',
170
+ 'NF' => 'Norfolk Island',
171
+ 'NG' => 'Nigeria',
172
+ 'NI' => 'Nicaragua',
173
+ 'NL' => 'Netherlands',
174
+ 'NO' => 'Norway',
175
+ 'NP' => 'Nepal',
176
+ 'NR' => 'Nauru',
177
+ 'NU' => 'Niue',
178
+ 'NZ' => 'New Zealand',
179
+ 'OM' => 'Oman',
180
+ 'PA' => 'Panama',
181
+ 'PE' => 'Peru',
182
+ 'PF' => 'French Polynesia',
183
+ 'PG' => 'Papua New Guinea',
184
+ 'PH' => 'Philippines',
185
+ 'PK' => 'Pakistan',
186
+ 'PL' => 'Poland',
187
+ 'PM' => 'Saint Pierre and Miquelon',
188
+ 'PN' => 'Pitcairn',
189
+ 'PR' => 'Puerto Rico',
190
+ 'PS' => 'Palestine',
191
+ 'PT' => 'Portugal',
192
+ 'PW' => 'Palau',
193
+ 'PY' => 'Paraguay',
194
+ 'QA' => 'Qatar',
195
+ 'RE' => 'Reunion',
196
+ 'RO' => 'Romania',
197
+ 'RU' => 'Russia',
198
+ 'RW' => 'Rwanda',
199
+ 'SA' => 'Saudi Arabia',
200
+ 'SB' => 'Solomon Islands',
201
+ 'SC' => 'Seychelles',
202
+ 'SD' => 'Sudan',
203
+ 'SE' => 'Sweden',
204
+ 'SG' => 'Singapore',
205
+ 'SH' => 'Saint Helena',
206
+ 'SI' => 'Slovenia',
207
+ 'SJ' => 'Svalbard and Jan Mayen',
208
+ 'SK' => 'Slovakia',
209
+ 'SL' => 'Sierra Leone',
210
+ 'SM' => 'San Marino',
211
+ 'SN' => 'Senegal',
212
+ 'SO' => 'Somalia',
213
+ 'SR' => 'Suriname',
214
+ 'ST' => 'Sao Tome and Principe',
215
+ 'SV' => 'El Salvador',
216
+ 'SY' => 'Syria',
217
+ 'SZ' => 'Swaziland',
218
+ 'TC' => 'Turks and Caicos Islands',
219
+ 'TD' => 'Chad',
220
+ 'TF' => 'French Southern territories',
221
+ 'TG' => 'Togo',
222
+ 'TH' => 'Thailand',
223
+ 'TJ' => 'Tajikistan',
224
+ 'TK' => 'Tokelau',
225
+ 'TM' => 'Turkmenistan',
226
+ 'TN' => 'Tunisia',
227
+ 'TO' => 'Tonga',
228
+ 'TP' => 'East Timor',
229
+ 'TR' => 'Turkey',
230
+ 'TT' => 'Trinidad and Tobago',
231
+ 'TV' => 'Tuvalu',
232
+ 'TW' => 'Taiwan',
233
+ 'TZ' => 'Tanzania',
234
+ 'UA' => 'Ukraine',
235
+ 'UG' => 'Uganda',
236
+ 'UM' => 'United States Minor Outlying Islands',
237
+ 'US' => 'United States',
238
+ 'UY' => 'Uruguay',
239
+ 'UZ' => 'Uzbekistan',
240
+ 'VA' => 'Holy See (Vatican City State)',
241
+ 'VC' => 'Saint Vincent and the Grenadines',
242
+ 'VE' => 'Venezuela',
243
+ 'VG' => 'Virgin Islands, British',
244
+ 'VI' => 'Virgin Islands, U.S.',
245
+ 'VN' => 'Vietnam',
246
+ 'VU' => 'Vanuatu',
247
+ 'WF' => 'Wallis and Futuna',
248
+ 'WS' => 'Samoa',
249
+ 'YE' => 'Yemen',
250
+ 'YT' => 'Mayotte',
251
+ 'YU' => 'Yugoslavia',
252
+ 'ZA' => 'South Africa',
253
+ 'ZM' => 'Zambia',
254
+ 'ZW' => 'Zimbabwe' );
255
+ /* @formatter:on */
{tools → tags/5.3.1.1/tools}/src/Deconf/Auth/Abstract.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Auth/AppIdentity.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Auth/AssertionCredentials.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Auth/ComputeEngine.php RENAMED
File without changes
tags/5.3.1.1/tools/src/Deconf/Auth/Exception.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ class Deconf_Auth_Exception extends Deconf_Exception
23
+ {
24
+ }
{tools → tags/5.3.1.1/tools}/src/Deconf/Auth/LoginTicket.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Auth/OAuth2.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Auth/Simple.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Cache/Abstract.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Cache/Apc.php RENAMED
File without changes
tags/5.3.1.1/tools/src/Deconf/Cache/Exception.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ class Deconf_Cache_Exception extends Deconf_Exception
23
+ {
24
+ }
{tools → tags/5.3.1.1/tools}/src/Deconf/Cache/File.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Cache/Memcache.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Cache/Null.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Client.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Collection.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Config.php RENAMED
File without changes
tags/5.3.1.1/tools/src/Deconf/Exception.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ class Deconf_Exception extends Exception
19
+ {
20
+ }
{tools → tags/5.3.1.1/tools}/src/Deconf/Http/Batch.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Http/CacheParser.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Http/MediaFileUpload.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Http/REST.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Http/Request.php RENAMED
File without changes
tags/5.3.1.1/tools/src/Deconf/IO/Abstract.php ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Abstract IO base class
20
+ */
21
+
22
+ if (!class_exists('Deconf_Client')) {
23
+ require_once dirname(__FILE__) . '/../autoload.php';
24
+ }
25
+
26
+ abstract class Deconf_IO_Abstract
27
+ {
28
+ const UNKNOWN_CODE = 0;
29
+ const FORM_URLENCODED = 'application/x-www-form-urlencoded';
30
+ private static $CONNECTION_ESTABLISHED_HEADERS = array(
31
+ "HTTP/1.0 200 Connection established\r\n\r\n",
32
+ "HTTP/1.1 200 Connection established\r\n\r\n",
33
+ );
34
+ private static $ENTITY_HTTP_METHODS = array("POST" => null, "PUT" => null);
35
+ private static $HOP_BY_HOP = array(
36
+ 'connection' => true,
37
+ 'keep-alive' => true,
38
+ 'proxy-authenticate' => true,
39
+ 'proxy-authorization' => true,
40
+ 'te' => true,
41
+ 'trailers' => true,
42
+ 'transfer-encoding' => true,
43
+ 'upgrade' => true
44
+ );
45
+
46
+
47
+ /** @var Deconf_Client */
48
+ protected $client;
49
+
50
+ public function __construct(Deconf_Client $client)
51
+ {
52
+ $this->client = $client;
53
+ $timeout = $client->getClassConfig('Deconf_IO_Abstract', 'request_timeout_seconds');
54
+ if ($timeout > 0) {
55
+ $this->setTimeout($timeout);
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Executes a Deconf_Http_Request
61
+ * @param Deconf_Http_Request $request the http request to be executed
62
+ * @return array containing response headers, body, and http code
63
+ * @throws Deconf_IO_Exception on curl or IO error
64
+ */
65
+ abstract public function executeRequest(Deconf_Http_Request $request);
66
+
67
+ /**
68
+ * Set options that update the transport implementation's behavior.
69
+ * @param $options
70
+ */
71
+ abstract public function setOptions($options);
72
+
73
+ /**
74
+ * Set the maximum request time in seconds.
75
+ * @param $timeout in seconds
76
+ */
77
+ abstract public function setTimeout($timeout);
78
+
79
+ /**
80
+ * Get the maximum request time in seconds.
81
+ * @return timeout in seconds
82
+ */
83
+ abstract public function getTimeout();
84
+
85
+ /**
86
+ * Test for the presence of a cURL header processing bug
87
+ *
88
+ * The cURL bug was present in versions prior to 7.30.0 and caused the header
89
+ * length to be miscalculated when a "Connection established" header added by
90
+ * some proxies was present.
91
+ *
92
+ * @return boolean
93
+ */
94
+ abstract protected function needsQuirk();
95
+
96
+ /**
97
+ * @visible for testing.
98
+ * Cache the response to an HTTP request if it is cacheable.
99
+ * @param Deconf_Http_Request $request
100
+ * @return bool Returns true if the insertion was successful.
101
+ * Otherwise, return false.
102
+ */
103
+ public function setCachedRequest(Deconf_Http_Request $request)
104
+ {
105
+ // Determine if the request is cacheable.
106
+ if (Deconf_Http_CacheParser::isResponseCacheable($request)) {
107
+ $this->client->getCache()->set($request->getCacheKey(), $request);
108
+ return true;
109
+ }
110
+
111
+ return false;
112
+ }
113
+
114
+ /**
115
+ * Execute an HTTP Request
116
+ *
117
+ * @param Deconf_Http_Request $request the http request to be executed
118
+ * @return Deconf_Http_Request http request with the response http code,
119
+ * response headers and response body filled in
120
+ * @throws Deconf_IO_Exception on curl or IO error
121
+ */
122
+ public function makeRequest(Deconf_Http_Request $request)
123
+ {
124
+
125
+ // Add support for GADWP Endpoint
126
+ do_action('gadwp_endpoint_support', $request);
127
+
128
+ // First, check to see if we have a valid cached version.
129
+ $cached = $this->getCachedRequest($request);
130
+ if ($cached !== false && $cached instanceof Deconf_Http_Request) {
131
+ if (!$this->checkMustRevalidateCachedRequest($cached, $request)) {
132
+ return $cached;
133
+ }
134
+ }
135
+
136
+ if (array_key_exists($request->getRequestMethod(), self::$ENTITY_HTTP_METHODS)) {
137
+ $request = $this->processEntityRequest($request);
138
+ }
139
+
140
+ list($responseData, $responseHeaders, $respHttpCode) = $this->executeRequest($request);
141
+
142
+ if ($respHttpCode == 304 && $cached) {
143
+ // If the server responded NOT_MODIFIED, return the cached request.
144
+ $this->updateCachedRequest($cached, $responseHeaders);
145
+ return $cached;
146
+ }
147
+
148
+ if (!isset($responseHeaders['Date']) && !isset($responseHeaders['date'])) {
149
+ $responseHeaders['date'] = date("r");
150
+ }
151
+
152
+ $request->setResponseHttpCode($respHttpCode);
153
+ $request->setResponseHeaders($responseHeaders);
154
+ $request->setResponseBody($responseData);
155
+ // Store the request in cache (the function checks to see if the request
156
+ // can actually be cached)
157
+ $this->setCachedRequest($request);
158
+ return $request;
159
+ }
160
+
161
+ /**
162
+ * @visible for testing.
163
+ * @param Deconf_Http_Request $request
164
+ * @return Deconf_Http_Request|bool Returns the cached object or
165
+ * false if the operation was unsuccessful.
166
+ */
167
+ public function getCachedRequest(Deconf_Http_Request $request)
168
+ {
169
+ if (false === Deconf_Http_CacheParser::isRequestCacheable($request)) {
170
+ return false;
171
+ }
172
+
173
+ return $this->client->getCache()->get($request->getCacheKey());
174
+ }
175
+
176
+ /**
177
+ * @visible for testing
178
+ * Process an http request that contains an enclosed entity.
179
+ * @param Deconf_Http_Request $request
180
+ * @return Deconf_Http_Request Processed request with the enclosed entity.
181
+ */
182
+ public function processEntityRequest(Deconf_Http_Request $request)
183
+ {
184
+ $postBody = $request->getPostBody();
185
+ $contentType = $request->getRequestHeader("content-type");
186
+
187
+ // Set the default content-type as application/x-www-form-urlencoded.
188
+ if (false == $contentType) {
189
+ $contentType = self::FORM_URLENCODED;
190
+ $request->setRequestHeaders(array('content-type' => $contentType));
191
+ }
192
+
193
+ // Force the payload to match the content-type asserted in the header.
194
+ if ($contentType == self::FORM_URLENCODED && is_array($postBody)) {
195
+ $postBody = http_build_query($postBody, '', '&');
196
+ $request->setPostBody($postBody);
197
+ }
198
+
199
+ // Make sure the content-length header is set.
200
+ if (!$postBody || is_string($postBody)) {
201
+ $postsLength = strlen($postBody);
202
+ $request->setRequestHeaders(array('content-length' => $postsLength));
203
+ }
204
+
205
+ return $request;
206
+ }
207
+
208
+ /**
209
+ * Check if an already cached request must be revalidated, and if so update
210
+ * the request with the correct ETag headers.
211
+ * @param Deconf_Http_Request $cached A previously cached response.
212
+ * @param Deconf_Http_Request $request The outbound request.
213
+ * return bool If the cached object needs to be revalidated, false if it is
214
+ * still current and can be re-used.
215
+ */
216
+ protected function checkMustRevalidateCachedRequest($cached, $request)
217
+ {
218
+ if (Deconf_Http_CacheParser::mustRevalidate($cached)) {
219
+ $addHeaders = array();
220
+ if ($cached->getResponseHeader('etag')) {
221
+ // [13.3.4] If an entity tag has been provided by the origin server,
222
+ // we must use that entity tag in any cache-conditional request.
223
+ $addHeaders['If-None-Match'] = $cached->getResponseHeader('etag');
224
+ } elseif ($cached->getResponseHeader('date')) {
225
+ $addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date');
226
+ }
227
+
228
+ $request->setRequestHeaders($addHeaders);
229
+ return true;
230
+ } else {
231
+ return false;
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Update a cached request, using the headers from the last response.
237
+ * @param Deconf_Http_Request $cached A previously cached response.
238
+ * @param mixed Associative array of response headers from the last request.
239
+ */
240
+ protected function updateCachedRequest($cached, $responseHeaders)
241
+ {
242
+ $hopByHop = self::$HOP_BY_HOP;
243
+ if (!empty($responseHeaders['connection'])) {
244
+ $connectionHeaders = array_map(
245
+ 'strtolower',
246
+ array_filter(
247
+ array_map('trim', explode(',', $responseHeaders['connection']))
248
+ )
249
+ );
250
+ $hopByHop += array_fill_keys($connectionHeaders, true);
251
+ }
252
+
253
+ $endToEnd = array_diff_key($responseHeaders, $hopByHop);
254
+ $cached->setResponseHeaders($endToEnd);
255
+ }
256
+
257
+ /**
258
+ * Used by the IO lib and also the batch processing.
259
+ *
260
+ * @param $respData
261
+ * @param $headerSize
262
+ * @return array
263
+ */
264
+ public function parseHttpResponse($respData, $headerSize)
265
+ {
266
+ // check proxy header
267
+ foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) {
268
+ if (stripos($respData, $established_header) !== false) {
269
+ // existed, remove it
270
+ $respData = str_ireplace($established_header, '', $respData);
271
+ // Subtract the proxy header size unless the cURL bug prior to 7.30.0
272
+ // is present which prevented the proxy header size from being taken into
273
+ // account.
274
+ if (!$this->needsQuirk()) {
275
+ $headerSize -= strlen($established_header);
276
+ }
277
+ break;
278
+ }
279
+ }
280
+
281
+ if ($headerSize) {
282
+ $responseBody = substr($respData, $headerSize);
283
+ $responseHeaders = substr($respData, 0, $headerSize);
284
+ } else {
285
+ $responseSegments = explode("\r\n\r\n", $respData, 2);
286
+ $responseHeaders = $responseSegments[0];
287
+ $responseBody = isset($responseSegments[1]) ? $responseSegments[1] :
288
+ null;
289
+ }
290
+
291
+ $responseHeaders = $this->getHttpResponseHeaders($responseHeaders);
292
+ return array($responseHeaders, $responseBody);
293
+ }
294
+
295
+ /**
296
+ * Parse out headers from raw headers
297
+ * @param rawHeaders array or string
298
+ * @return array
299
+ */
300
+ public function getHttpResponseHeaders($rawHeaders)
301
+ {
302
+ if (is_array($rawHeaders)) {
303
+ return $this->parseArrayHeaders($rawHeaders);
304
+ } else {
305
+ return $this->parseStringHeaders($rawHeaders);
306
+ }
307
+ }
308
+
309
+ private function parseStringHeaders($rawHeaders)
310
+ {
311
+ $headers = array();
312
+ $responseHeaderLines = explode("\r\n", $rawHeaders);
313
+ foreach ($responseHeaderLines as $headerLine) {
314
+ if ($headerLine && strpos($headerLine, ':') !== false) {
315
+ list($header, $value) = explode(': ', $headerLine, 2);
316
+ $header = strtolower($header);
317
+ if (isset($headers[$header])) {
318
+ $headers[$header] .= "\n" . $value;
319
+ } else {
320
+ $headers[$header] = $value;
321
+ }
322
+ }
323
+ }
324
+ return $headers;
325
+ }
326
+
327
+ private function parseArrayHeaders($rawHeaders)
328
+ {
329
+ $header_count = count($rawHeaders);
330
+ $headers = array();
331
+
332
+ for ($i = 0; $i < $header_count; $i++) {
333
+ $header = $rawHeaders[$i];
334
+ // Times will have colons in - so we just want the first match.
335
+ $header_parts = explode(': ', $header, 2);
336
+ if (count($header_parts) == 2) {
337
+ $headers[strtolower($header_parts[0])] = $header_parts[1];
338
+ }
339
+ }
340
+
341
+ return $headers;
342
+ }
343
+ }
{tools → tags/5.3.1.1/tools}/src/Deconf/IO/Curl.php RENAMED
File without changes
tags/5.3.1.1/tools/src/Deconf/IO/Exception.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ class Deconf_IO_Exception extends Deconf_Exception implements Deconf_Task_Retryable
23
+ {
24
+ /**
25
+ * @var array $retryMap Map of errors with retry counts.
26
+ */
27
+ private $retryMap = array();
28
+
29
+ /**
30
+ * Creates a new IO exception with an optional retry map.
31
+ *
32
+ * @param string $message
33
+ * @param int $code
34
+ * @param Exception|null $previous
35
+ * @param array|null $retryMap Map of errors with retry counts.
36
+ */
37
+ public function __construct(
38
+ $message,
39
+ $code = 0,
40
+ Exception $previous = null,
41
+ array $retryMap = null
42
+ ) {
43
+ if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
44
+ parent::__construct($message, $code, $previous);
45
+ } else {
46
+ parent::__construct($message, $code);
47
+ }
48
+
49
+ if (is_array($retryMap)) {
50
+ $this->retryMap = $retryMap;
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Gets the number of times the associated task can be retried.
56
+ *
57
+ * NOTE: -1 is returned if the task can be retried indefinitely
58
+ *
59
+ * @return integer
60
+ */
61
+ public function allowedRetries()
62
+ {
63
+ if (isset($this->retryMap[$this->code])) {
64
+ return $this->retryMap[$this->code];
65
+ }
66
+
67
+ return 0;
68
+ }
69
+ }
tags/5.3.1.1/tools/src/Deconf/IO/Stream.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Http Streams based implementation of Deconf_IO.
20
+ *
21
+ * @author Stuart Langley <slangley@google.com>
22
+ */
23
+
24
+ if (!class_exists('Deconf_Client')) {
25
+ require_once dirname(__FILE__) . '/../autoload.php';
26
+ }
27
+
28
+ class Deconf_IO_Stream extends Deconf_IO_Abstract
29
+ {
30
+ const TIMEOUT = "timeout";
31
+ const ZLIB = "compress.zlib://";
32
+ private $options = array();
33
+ private $trappedErrorNumber;
34
+ private $trappedErrorString;
35
+
36
+ private static $DEFAULT_HTTP_CONTEXT = array(
37
+ "follow_location" => 0,
38
+ "ignore_errors" => 1,
39
+ );
40
+
41
+ private static $DEFAULT_SSL_CONTEXT = array(
42
+ "verify_peer" => true,
43
+ );
44
+
45
+ public function __construct(Deconf_Client $client)
46
+ {
47
+ if (!ini_get('allow_url_fopen')) {
48
+ $error = 'The stream IO handler requires the allow_url_fopen runtime ' .
49
+ 'configuration to be enabled';
50
+ $client->getLogger()->critical($error);
51
+ throw new Deconf_IO_Exception($error);
52
+ }
53
+
54
+ parent::__construct($client);
55
+ }
56
+
57
+ /**
58
+ * Execute an HTTP Request
59
+ *
60
+ * @param Deconf_Http_Request $request the http request to be executed
61
+ * @return array containing response headers, body, and http code
62
+ * @throws Deconf_IO_Exception on curl or IO error
63
+ */
64
+ public function executeRequest(Deconf_Http_Request $request)
65
+ {
66
+ $default_options = stream_context_get_options(stream_context_get_default());
67
+
68
+ $requestHttpContext = array_key_exists('http', $default_options) ?
69
+ $default_options['http'] : array();
70
+
71
+ if ($request->getPostBody()) {
72
+ $requestHttpContext["content"] = $request->getPostBody();
73
+ }
74
+
75
+ $requestHeaders = $request->getRequestHeaders();
76
+ if ($requestHeaders && is_array($requestHeaders)) {
77
+ $headers = "";
78
+ foreach ($requestHeaders as $k => $v) {
79
+ $headers .= "$k: $v\r\n";
80
+ }
81
+ $requestHttpContext["header"] = $headers;
82
+ }
83
+
84
+ $requestHttpContext["method"] = $request->getRequestMethod();
85
+ $requestHttpContext["user_agent"] = $request->getUserAgent();
86
+
87
+ $requestSslContext = array_key_exists('ssl', $default_options) ?
88
+ $default_options['ssl'] : array();
89
+
90
+ // Add support for GADWP Endpoint
91
+ $requestSslContext = apply_filters('gadwp_endpoint_stream_options', $requestSslContext, $request);
92
+
93
+ if (!$this->client->isAppEngine() && !array_key_exists("cafile", $requestSslContext)) {
94
+ $requestSslContext["cafile"] = dirname(__FILE__) . '/cacerts.pem';
95
+ }
96
+
97
+ $options = array(
98
+ "http" => array_merge(
99
+ self::$DEFAULT_HTTP_CONTEXT,
100
+ $requestHttpContext
101
+ ),
102
+ "ssl" => array_merge(
103
+ self::$DEFAULT_SSL_CONTEXT,
104
+ $requestSslContext
105
+ )
106
+ );
107
+
108
+ $context = stream_context_create($options);
109
+
110
+ $url = $request->getUrl();
111
+
112
+ if ($request->canGzip()) {
113
+ $url = self::ZLIB . $url;
114
+ }
115
+
116
+ $this->client->getLogger()->debug(
117
+ 'Stream request',
118
+ array(
119
+ 'url' => $url,
120
+ 'method' => $request->getRequestMethod(),
121
+ 'headers' => $requestHeaders,
122
+ 'body' => $request->getPostBody()
123
+ )
124
+ );
125
+
126
+ // We are trapping any thrown errors in this method only and
127
+ // throwing an exception.
128
+ $this->trappedErrorNumber = null;
129
+ $this->trappedErrorString = null;
130
+
131
+ // START - error trap.
132
+ set_error_handler(array($this, 'trapError'));
133
+ $fh = fopen($url, 'r', false, $context);
134
+ restore_error_handler();
135
+ // END - error trap.
136
+
137
+ if ($this->trappedErrorNumber) {
138
+ $error = sprintf(
139
+ "HTTP Error: Unable to connect: '%s'",
140
+ $this->trappedErrorString
141
+ );
142
+
143
+ $this->client->getLogger()->error('Stream ' . $error);
144
+ throw new Deconf_IO_Exception($error, $this->trappedErrorNumber);
145
+ }
146
+
147
+ $response_data = false;
148
+ $respHttpCode = self::UNKNOWN_CODE;
149
+ if ($fh) {
150
+ if (isset($this->options[self::TIMEOUT])) {
151
+ stream_set_timeout($fh, $this->options[self::TIMEOUT]);
152
+ }
153
+
154
+ $response_data = stream_get_contents($fh);
155
+ fclose($fh);
156
+
157
+ $respHttpCode = $this->getHttpResponseCode($http_response_header);
158
+ }
159
+
160
+ if (false === $response_data) {
161
+ $error = sprintf(
162
+ "HTTP Error: Unable to connect: '%s'",
163
+ $respHttpCode
164
+ );
165
+
166
+ $this->client->getLogger()->error('Stream ' . $error);
167
+ throw new Deconf_IO_Exception($error, $respHttpCode);
168
+ }
169
+
170
+ $responseHeaders = $this->getHttpResponseHeaders($http_response_header);
171
+
172
+ $this->client->getLogger()->debug(
173
+ 'Stream response',
174
+ array(
175
+ 'code' => $respHttpCode,
176
+ 'headers' => $responseHeaders,
177
+ 'body' => $response_data,
178
+ )
179
+ );
180
+
181
+ return array($response_data, $responseHeaders, $respHttpCode);
182
+ }
183
+
184
+ /**
185
+ * Set options that update the transport implementation's behavior.
186
+ * @param $options
187
+ */
188
+ public function setOptions($options)
189
+ {
190
+ $this->options = $options + $this->options;
191
+ }
192
+
193
+ /**
194
+ * Method to handle errors, used for error handling around
195
+ * stream connection methods.
196
+ */
197
+ public function trapError($errno, $errstr)
198
+ {
199
+ $this->trappedErrorNumber = $errno;
200
+ $this->trappedErrorString = $errstr;
201
+ }
202
+
203
+ /**
204
+ * Set the maximum request time in seconds.
205
+ * @param $timeout in seconds
206
+ */
207
+ public function setTimeout($timeout)
208
+ {
209
+ $this->options[self::TIMEOUT] = $timeout;
210
+ }
211
+
212
+ /**
213
+ * Get the maximum request time in seconds.
214
+ * @return timeout in seconds
215
+ */
216
+ public function getTimeout()
217
+ {
218
+ return $this->options[self::TIMEOUT];
219
+ }
220
+
221
+ /**
222
+ * Test for the presence of a cURL header processing bug
223
+ *
224
+ * {@inheritDoc}
225
+ *
226
+ * @return boolean
227
+ */
228
+ protected function needsQuirk()
229
+ {
230
+ return false;
231
+ }
232
+
233
+ protected function getHttpResponseCode($response_headers)
234
+ {
235
+ $header_count = count($response_headers);
236
+
237
+ for ($i = 0; $i < $header_count; $i++) {
238
+ $header = $response_headers[$i];
239
+ if (strncasecmp("HTTP", $header, strlen("HTTP")) == 0) {
240
+ $response = explode(' ', $header);
241
+ return $response[1];
242
+ }
243
+ }
244
+ return self::UNKNOWN_CODE;
245
+ }
246
+ }
{tools → tags/5.3.1.1/tools}/src/Deconf/IO/cacerts.pem RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Logger/Abstract.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Logger/Exception.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Logger/File.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Logger/Null.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Logger/Psr.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Model.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Service.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Service/Analytics.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Service/Exception.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Service/Resource.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Signer/Abstract.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Signer/P12.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Task/Exception.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Task/Retryable.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Task/Runner.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Utils.php RENAMED
File without changes
tags/5.3.1.1/tools/src/Deconf/Utils/URITemplate.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Implementation of levels 1-3 of the URI Template spec.
20
+ * @see http://tools.ietf.org/html/rfc6570
21
+ */
22
+ class Deconf_Utils_URITemplate
23
+ {
24
+ const TYPE_MAP = "1";
25
+ const TYPE_LIST = "2";
26
+ const TYPE_SCALAR = "4";
27
+
28
+ /**
29
+ * @var $operators array
30
+ * These are valid at the start of a template block to
31
+ * modify the way in which the variables inside are
32
+ * processed.
33
+ */
34
+ private $operators = array(
35
+ "+" => "reserved",
36
+ "/" => "segments",
37
+ "." => "dotprefix",
38
+ "#" => "fragment",
39
+ ";" => "semicolon",
40
+ "?" => "form",
41
+ "&" => "continuation"
42
+ );
43
+
44
+ /**
45
+ * @var reserved array
46
+ * These are the characters which should not be URL encoded in reserved
47
+ * strings.
48
+ */
49
+ private $reserved = array(
50
+ "=", ",", "!", "@", "|", ":", "/", "?", "#",
51
+ "[", "]",'$', "&", "'", "(", ")", "*", "+", ";"
52
+ );
53
+ private $reservedEncoded = array(
54
+ "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F",
55
+ "%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29",
56
+ "%2A", "%2B", "%3B"
57
+ );
58
+
59
+ public function parse($string, array $parameters)
60
+ {
61
+ return $this->resolveNextSection($string, $parameters);
62
+ }
63
+
64
+ /**
65
+ * This function finds the first matching {...} block and
66
+ * executes the replacement. It then calls itself to find
67
+ * subsequent blocks, if any.
68
+ */
69
+ private function resolveNextSection($string, $parameters)
70
+ {
71
+ $start = strpos($string, "{");
72
+ if ($start === false) {
73
+ return $string;
74
+ }
75
+ $end = strpos($string, "}");
76
+ if ($end === false) {
77
+ return $string;
78
+ }
79
+ $string = $this->replace($string, $start, $end, $parameters);
80
+ return $this->resolveNextSection($string, $parameters);
81
+ }
82
+
83
+ private function replace($string, $start, $end, $parameters)
84
+ {
85
+ // We know a data block will have {} round it, so we can strip that.
86
+ $data = substr($string, $start + 1, $end - $start - 1);
87
+
88
+ // If the first character is one of the reserved operators, it effects
89
+ // the processing of the stream.
90
+ if (isset($this->operators[$data[0]])) {
91
+ $op = $this->operators[$data[0]];
92
+ $data = substr($data, 1);
93
+ $prefix = "";
94
+ $prefix_on_missing = false;
95
+
96
+ switch ($op) {
97
+ case "reserved":
98
+ // Reserved means certain characters should not be URL encoded
99
+ $data = $this->replaceVars($data, $parameters, ",", null, true);
100
+ break;
101
+ case "fragment":
102
+ // Comma separated with fragment prefix. Bare values only.
103
+ $prefix = "#";
104
+ $prefix_on_missing = true;
105
+ $data = $this->replaceVars($data, $parameters, ",", null, true);
106
+ break;
107
+ case "segments":
108
+ // Slash separated data. Bare values only.
109
+ $prefix = "/";
110
+ $data =$this->replaceVars($data, $parameters, "/");
111
+ break;
112
+ case "dotprefix":
113
+ // Dot separated data. Bare values only.
114
+ $prefix = ".";
115
+ $prefix_on_missing = true;
116
+ $data = $this->replaceVars($data, $parameters, ".");
117
+ break;
118
+ case "semicolon":
119
+ // Semicolon prefixed and separated. Uses the key name
120
+ $prefix = ";";
121
+ $data = $this->replaceVars($data, $parameters, ";", "=", false, true, false);
122
+ break;
123
+ case "form":
124
+ // Standard URL format. Uses the key name
125
+ $prefix = "?";
126
+ $data = $this->replaceVars($data, $parameters, "&", "=");
127
+ break;
128
+ case "continuation":
129
+ // Standard URL, but with leading ampersand. Uses key name.
130
+ $prefix = "&";
131
+ $data = $this->replaceVars($data, $parameters, "&", "=");
132
+ break;
133
+ }
134
+
135
+ // Add the initial prefix character if data is valid.
136
+ if ($data || ($data !== false && $prefix_on_missing)) {
137
+ $data = $prefix . $data;
138
+ }
139
+
140
+ } else {
141
+ // If no operator we replace with the defaults.
142
+ $data = $this->replaceVars($data, $parameters);
143
+ }
144
+ // This is chops out the {...} and replaces with the new section.
145
+ return substr($string, 0, $start) . $data . substr($string, $end + 1);
146
+ }
147
+
148
+ private function replaceVars(
149
+ $section,
150
+ $parameters,
151
+ $sep = ",",
152
+ $combine = null,
153
+ $reserved = false,
154
+ $tag_empty = false,
155
+ $combine_on_empty = true
156
+ ) {
157
+ if (strpos($section, ",") === false) {
158
+ // If we only have a single value, we can immediately process.
159
+ return $this->combine(
160
+ $section,
161
+ $parameters,
162
+ $sep,
163
+ $combine,
164
+ $reserved,
165
+ $tag_empty,
166
+ $combine_on_empty
167
+ );
168
+ } else {
169
+ // If we have multiple values, we need to split and loop over them.
170
+ // Each is treated individually, then glued together with the
171
+ // separator character.
172
+ $vars = explode(",", $section);
173
+ return $this->combineList(
174
+ $vars,
175
+ $sep,
176
+ $parameters,
177
+ $combine,
178
+ $reserved,
179
+ false, // Never emit empty strings in multi-param replacements
180
+ $combine_on_empty
181
+ );
182
+ }
183
+ }
184
+
185
+ public function combine(
186
+ $key,
187
+ $parameters,
188
+ $sep,
189
+ $combine,
190
+ $reserved,
191
+ $tag_empty,
192
+ $combine_on_empty
193
+ ) {
194
+ $length = false;
195
+ $explode = false;
196
+ $skip_final_combine = false;
197
+ $value = false;
198
+
199
+ // Check for length restriction.
200
+ if (strpos($key, ":") !== false) {
201
+ list($key, $length) = explode(":", $key);
202
+ }
203
+
204
+ // Check for explode parameter.
205
+ if ($key[strlen($key) - 1] == "*") {
206
+ $explode = true;
207
+ $key = substr($key, 0, -1);
208
+ $skip_final_combine = true;
209
+ }
210
+
211
+ // Define the list separator.
212
+ $list_sep = $explode ? $sep : ",";
213
+
214
+ if (isset($parameters[$key])) {
215
+ $data_type = $this->getDataType($parameters[$key]);
216
+ switch ($data_type) {
217
+ case self::TYPE_SCALAR:
218
+ $value = $this->getValue($parameters[$key], $length);
219
+ break;
220
+ case self::TYPE_LIST:
221
+ $values = array();
222
+ foreach ($parameters[$key] as $pkey => $pvalue) {
223
+ $pvalue = $this->getValue($pvalue, $length);
224
+ if ($combine && $explode) {
225
+ $values[$pkey] = $key . $combine . $pvalue;
226
+ } else {
227
+ $values[$pkey] = $pvalue;
228
+ }
229
+ }
230
+ $value = implode($list_sep, $values);
231
+ if ($value == '') {
232
+ return '';
233
+ }
234
+ break;
235
+ case self::TYPE_MAP:
236
+ $values = array();
237
+ foreach ($parameters[$key] as $pkey => $pvalue) {
238
+ $pvalue = $this->getValue($pvalue, $length);
239
+ if ($explode) {
240
+ $pkey = $this->getValue($pkey, $length);
241
+ $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine.
242
+ } else {
243
+ $values[] = $pkey;
244
+ $values[] = $pvalue;
245
+ }
246
+ }
247
+ $value = implode($list_sep, $values);
248
+ if ($value == '') {
249
+ return false;
250
+ }
251
+ break;
252
+ }
253
+ } else if ($tag_empty) {
254
+ // If we are just indicating empty values with their key name, return that.
255
+ return $key;
256
+ } else {
257
+ // Otherwise we can skip this variable due to not being defined.
258
+ return false;
259
+ }
260
+
261
+ if ($reserved) {
262
+ $value = str_replace($this->reservedEncoded, $this->reserved, $value);
263
+ }
264
+
265
+ // If we do not need to include the key name, we just return the raw
266
+ // value.
267
+ if (!$combine || $skip_final_combine) {
268
+ return $value;
269
+ }
270
+
271
+ // Else we combine the key name: foo=bar, if value is not the empty string.
272
+ return $key . ($value != '' || $combine_on_empty ? $combine . $value : '');
273
+ }
274
+
275
+ /**
276
+ * Return the type of a passed in value
277
+ */
278
+ private function getDataType($data)
279
+ {
280
+ if (is_array($data)) {
281
+ reset($data);
282
+ if (key($data) !== 0) {
283
+ return self::TYPE_MAP;
284
+ }
285
+ return self::TYPE_LIST;
286
+ }
287
+ return self::TYPE_SCALAR;
288
+ }
289
+
290
+ /**
291
+ * Utility function that merges multiple combine calls
292
+ * for multi-key templates.
293
+ */
294
+ private function combineList(
295
+ $vars,
296
+ $sep,
297
+ $parameters,
298
+ $combine,
299
+ $reserved,
300
+ $tag_empty,
301
+ $combine_on_empty
302
+ ) {
303
+ $ret = array();
304
+ foreach ($vars as $var) {
305
+ $response = $this->combine(
306
+ $var,
307
+ $parameters,
308
+ $sep,
309
+ $combine,
310
+ $reserved,
311
+ $tag_empty,
312
+ $combine_on_empty
313
+ );
314
+ if ($response === false) {
315
+ continue;
316
+ }
317
+ $ret[] = $response;
318
+ }
319
+ return implode($sep, $ret);
320
+ }
321
+
322
+ /**
323
+ * Utility function to encode and trim values
324
+ */
325
+ private function getValue($value, $length)
326
+ {
327
+ if ($length) {
328
+ $value = substr($value, 0, $length);
329
+ }
330
+ $value = rawurlencode($value);
331
+ return $value;
332
+ }
333
+ }
{tools → tags/5.3.1.1/tools}/src/Deconf/Verifier/Abstract.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/Verifier/Pem.php RENAMED
File without changes
{tools → tags/5.3.1.1/tools}/src/Deconf/autoload.php RENAMED
File without changes
tags/5.3.1.1/tools/src/readme.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Author: Alin Marcu
3
+ * Author URI: https://deconf.com
4
+ * Copyright 2013 Alin Marcu
5
+ * License: GPLv2 or later
6
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
+ */
8
+
9
+ * Custom GADWP EndPoint:
10
+
11
+ - added an action hook to IO -> Abstract -> MakeRequest to enable custom endpoint support:
12
+
13
+ public function makeRequest(Deconf_Http_Request $request)
14
+ {
15
+
16
+ // Add support for GADWP Endpoint
17
+ do_action('gadwp_endpoint_support', $request);
18
+
19
+ ...
20
+
21
+ }
22
+
23
+ * Updated the IO -> cacerts.pem file to support Let's Encrypt certificates
24
+
25
+ * Changed 'Google' provider to 'Deconf', to avoid conflicts on different versions of GAPI PHP Client
tags/5.3.1.1/tools/tools.php ADDED
@@ -0,0 +1,314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Tools' ) ) {
15
+
16
+ class GADWP_Tools {
17
+
18
+ public static function get_countrycodes() {
19
+ include 'iso3166.php';
20
+ return $country_codes;
21
+ }
22
+
23
+ public static function guess_default_domain( $profiles ) {
24
+ $domain = get_option( 'siteurl' );
25
+ $domain = str_ireplace( array( 'http://', 'https://' ), '', $domain );
26
+ if ( ! empty( $profiles ) ) {
27
+ foreach ( $profiles as $items ) {
28
+ if ( strpos( $items[3], $domain ) ) {
29
+ return $items[1];
30
+ }
31
+ }
32
+ return $profiles[0][1];
33
+ } else {
34
+ return '';
35
+ }
36
+ }
37
+
38
+ public static function get_selected_profile( $profiles, $profile ) {
39
+ if ( ! empty( $profiles ) ) {
40
+ foreach ( $profiles as $item ) {
41
+ if ( $item[1] == $profile ) {
42
+ return $item;
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ public static function get_root_domain() {
49
+ $url = site_url();
50
+ $root = explode( '/', $url );
51
+ preg_match( '/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', str_ireplace( 'www', '', isset( $root[2] ) ? $root[2] : $url ), $root );
52
+ if ( isset( $root['domain'] ) ) {
53
+ return $root['domain'];
54
+ } else {
55
+ return '';
56
+ }
57
+ }
58
+
59
+ public static function strip_protocol( $domain ) {
60
+ return str_replace( array( "https://", "http://", " " ), "", $domain );
61
+ }
62
+
63
+ public static function colourVariator( $colour, $per ) {
64
+ $colour = substr( $colour, 1 );
65
+ $rgb = '';
66
+ $per = $per / 100 * 255;
67
+ if ( $per < 0 ) {
68
+ // Darker
69
+ $per = abs( $per );
70
+ for ( $x = 0; $x < 3; $x++ ) {
71
+ $c = hexdec( substr( $colour, ( 2 * $x ), 2 ) ) - $per;
72
+ $c = ( $c < 0 ) ? 0 : dechex( $c );
73
+ $rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;
74
+ }
75
+ } else {
76
+ // Lighter
77
+ for ( $x = 0; $x < 3; $x++ ) {
78
+ $c = hexdec( substr( $colour, ( 2 * $x ), 2 ) ) + $per;
79
+ $c = ( $c > 255 ) ? 'ff' : dechex( $c );
80
+ $rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;
81
+ }
82
+ }
83
+ return '#' . $rgb;
84
+ }
85
+
86
+ public static function variations( $base ) {
87
+ $variations[] = $base;
88
+ $variations[] = self::colourVariator( $base, - 10 );
89
+ $variations[] = self::colourVariator( $base, + 10 );
90
+ $variations[] = self::colourVariator( $base, + 20 );
91
+ $variations[] = self::colourVariator( $base, - 20 );
92
+ $variations[] = self::colourVariator( $base, + 30 );
93
+ $variations[] = self::colourVariator( $base, - 30 );
94
+ return $variations;
95
+ }
96
+
97
+ public static function check_roles( $access_level, $tracking = false ) {
98
+ if ( is_user_logged_in() && isset( $access_level ) ) {
99
+ $current_user = wp_get_current_user();
100
+ $roles = (array) $current_user->roles;
101
+ if ( ( current_user_can( 'manage_options' ) ) && ! $tracking ) {
102
+ return true;
103
+ }
104
+ if ( count( array_intersect( $roles, $access_level ) ) > 0 ) {
105
+ return true;
106
+ } else {
107
+ return false;
108
+ }
109
+ }
110
+ }
111
+
112
+ public static function unset_cookie( $name ) {
113
+ $name = 'gadwp_wg_' . $name;
114
+ setcookie( $name, '', time() - 3600, '/' );
115
+ $name = 'gadwp_ir_' . $name;
116
+ setcookie( $name, '', time() - 3600, '/' );
117
+ }
118
+
119
+ public static function set_cache( $name, $value, $expiration = 0 ) {
120
+ $option = array( 'value' => $value, 'expires' => time() + (int) $expiration );
121
+ update_option( 'gadwp_cache_' . $name, $option, 'no' );
122
+ }
123
+
124
+ public static function delete_cache( $name ) {
125
+ delete_option( 'gadwp_cache_' . $name );
126
+ }
127
+
128
+ public static function get_cache( $name ) {
129
+ $option = get_option( 'gadwp_cache_' . $name );
130
+
131
+ if ( false === $option || ! isset( $option['value'] ) || ! isset( $option['expires'] ) ) {
132
+ return false;
133
+ }
134
+
135
+ if ( $option['expires'] < time() ) {
136
+ delete_option( 'gadwp_cache_' . $name );
137
+ return false;
138
+ } else {
139
+ return $option['value'];
140
+ }
141
+ }
142
+
143
+ public static function clear_cache() {
144
+ global $wpdb;
145
+ $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'gadwp_cache_qr%%'" );
146
+ }
147
+
148
+ public static function get_sites( $args ) { // Use wp_get_sites() if WP version is lower than 4.6.0
149
+ global $wp_version;
150
+ if ( version_compare( $wp_version, '4.6.0', '<' ) ) {
151
+ return wp_get_sites( $args );
152
+ } else {
153
+ foreach ( get_sites( $args ) as $blog ) {
154
+ $blogs[] = (array) $blog; // Convert WP_Site object to array
155
+ }
156
+ return $blogs;
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Loads a view file
162
+ *
163
+ * $data parameter will be available in the template file as $data['value']
164
+ *
165
+ * @param string $template - Template file to load
166
+ * @param array $data - data to pass along to the template
167
+ * @return boolean - If template file was found
168
+ **/
169
+ public static function load_view( $path, $data = array() ) {
170
+ if ( file_exists( GADWP_DIR . $path ) ) {
171
+ require_once ( GADWP_DIR . $path );
172
+ return true;
173
+ }
174
+ return false;
175
+ }
176
+
177
+ public static function doing_it_wrong( $function, $message, $version ) {
178
+ if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
179
+ if ( is_null( $version ) ) {
180
+ $version = '';
181
+ } else {
182
+ /* translators: %s: version number */
183
+ $version = sprintf( __( 'This message was added in version %s.', 'google-analytics-dashboard-for-wp' ), $version );
184
+ }
185
+
186
+ /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: Version information message */
187
+ trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s', 'google-analytics-dashboard-for-wp' ), $function, $message, $version ) );
188
+ }
189
+ }
190
+
191
+ public static function get_dom_from_content( $content ) {
192
+ $libxml_previous_state = libxml_use_internal_errors( true );
193
+ if ( class_exists( 'DOMDocument' ) ) {
194
+ $dom = new DOMDocument();
195
+ $result = $dom->loadHTML( '<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body>' . $content . '</body></html>' );
196
+ libxml_clear_errors();
197
+ libxml_use_internal_errors( $libxml_previous_state );
198
+ if ( ! $result ) {
199
+ return false;
200
+ }
201
+ return $dom;
202
+ } else {
203
+ self::set_error( __( 'DOM is disabled or libxml PHP extension is missing. Contact your hosting provider. Automatic tracking of events for AMP pages is not possible.', 'google-analytics-dashboard-for-wp' ), 24 * 60 * 60 );
204
+ return false;
205
+ }
206
+ }
207
+
208
+ public static function get_content_from_dom( $dom ) {
209
+ $out = '';
210
+ $body = $dom->getElementsByTagName( 'body' )->item( 0 );
211
+ foreach ( $body->childNodes as $node ) {
212
+ $out .= $dom->saveXML( $node );
213
+ }
214
+ return $out;
215
+ }
216
+
217
+ public static function array_keys_rename( $options, $keys ) {
218
+ foreach ( $keys as $key => $newkey ) {
219
+ if ( isset( $options[$key] ) ) {
220
+ $options[$newkey] = $options[$key];
221
+ unset( $options[$key] );
222
+ }
223
+ }
224
+ return $options;
225
+ }
226
+
227
+ public static function set_error( $e, $timeout ) {
228
+ if ( is_object( $e ) ) {
229
+ self::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $timeout );
230
+ if ( method_exists( $e, 'getCode' ) && method_exists( $e, 'getErrors' ) ) {
231
+ self::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $timeout );
232
+ }
233
+ } else {
234
+ self::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $timeout );
235
+ }
236
+
237
+ // Count Errors until midnight
238
+ $midnight = strtotime( "tomorrow 00:00:00" ); // UTC midnight
239
+ $midnight = $midnight + 8 * 3600; // UTC 8 AM
240
+ $tomidnight = $midnight - time();
241
+ $errors_count = self::get_cache( 'errors_count' );
242
+ $errors_count = (int) $errors_count + 1;
243
+ self::set_cache( 'errors_count', $errors_count, $tomidnight );
244
+ }
245
+
246
+ public static function anonymize_options( $options ) {
247
+ global $wp_version;
248
+
249
+ $options['wp_version'] = $wp_version;
250
+ $options['gadwp_version'] = GADWP_CURRENT_VERSION;
251
+ if ( $options['token'] ) {
252
+ $options['token'] = 'HIDDEN';
253
+ }
254
+ if ( $options['client_secret'] ) {
255
+ $options['client_secret'] = 'HIDDEN';
256
+ }
257
+
258
+ return $options;
259
+ }
260
+
261
+ public static function system_info() {
262
+ $info = '';
263
+
264
+ // Server Software
265
+ $server_soft = "-";
266
+ if ( isset( $_SERVER['SERVER_SOFTWARE'] ) ) {
267
+ $server_soft = $_SERVER['SERVER_SOFTWARE'];
268
+ }
269
+ $info .= 'Server Info: ' . $server_soft . "\n";
270
+
271
+ // PHP version
272
+ if ( defined( 'PHP_VERSION' ) ) {
273
+ $info .= 'PHP Version: ' . PHP_VERSION . "\n";
274
+ } else if ( defined( 'HHVM_VERSION' ) ) {
275
+ $info .= 'HHVM Version: ' . HHVM_VERSION . "\n";
276
+ } else {
277
+ $info .= 'Other Version: ' . '-' . "\n";
278
+ }
279
+
280
+ /*
281
+ * PHP extensions
282
+ * if ( is_callable( 'get_loaded_extensions' ) ) {
283
+ * $info .= 'Loaded Extensions: ' . implode(', ', get_loaded_extensions()) . "\n";
284
+ * } else {
285
+ * $info .= 'Loaded Extensions: ' . '-' . "\n";
286
+ * }
287
+ */
288
+
289
+ // cURL Info
290
+ if ( function_exists( 'curl_version' ) && function_exists( 'curl_exec' ) ) {
291
+ $curl_version = curl_version();
292
+ if ( ! empty( $curl_version ) ) {
293
+ $curl_ver = $curl_version['version'] . " " . $curl_version['ssl_version'];
294
+ } else {
295
+ $curl_ver = '-';
296
+ }
297
+ } else {
298
+ $curl_ver = '-';
299
+ }
300
+ $info .= 'cURL Info: ' . $curl_ver . "\n";
301
+
302
+ // Gzip
303
+ if ( is_callable( 'gzopen' ) ) {
304
+ $gzip = true;
305
+ } else {
306
+ $gzip = false;
307
+ }
308
+ $gzip_status = ( $gzip ) ? 'Yes' : 'No';
309
+ $info .= 'Gzip: ' . $gzip_status . "\n";
310
+
311
+ return $info;
312
+ }
313
+ }
314
+ }
tags/5.3.1/SECURITY.md ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ Every day we do our best to make sure [Google Analytics Dashboard for WP (GADWP)](https://deconf.com/google-analytics-dashboard-wordpress/) is safe and secure. But we’re only human, and there’s always a chance that we missed something. That’s where you come in – find a security weakness in our plugin, report it on [HackerOne](https://hackerone.com/deconf_eb9eh), and get listed as a contributor!
2
+
3
+ To find out more about our security reports policy for the plugin [click here](https://deconf.com/security/).
tags/5.3.1/admin/ajax-actions.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Backend_Ajax' ) ) {
15
+
16
+ final class GADWP_Backend_Ajax {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && ( ( 1 == $this->gadwp->config->options['backend_item_reports'] ) || ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) ) {
24
+ // Items action
25
+ add_action( 'wp_ajax_gadwp_backend_item_reports', array( $this, 'ajax_item_reports' ) );
26
+ }
27
+ if ( current_user_can( 'manage_options' ) ) {
28
+ // Admin Widget action
29
+ add_action( 'wp_ajax_gadwp_dismiss_notices', array( $this, 'ajax_dismiss_notices' ) );
30
+ }
31
+ }
32
+
33
+ /**
34
+ * Ajax handler for Item Reports
35
+ *
36
+ * @return json|int
37
+ */
38
+ public function ajax_item_reports() {
39
+ if ( ! isset( $_POST['gadwp_security_backend_item_reports'] ) || ! wp_verify_nonce( $_POST['gadwp_security_backend_item_reports'], 'gadwp_backend_item_reports' ) ) {
40
+ wp_die( - 30 );
41
+ }
42
+ if ( isset( $_POST['projectId'] ) && $this->gadwp->config->options['switch_profile'] && 'false' !== $_POST['projectId'] ) {
43
+ $projectId = $_POST['projectId'];
44
+ } else {
45
+ $projectId = false;
46
+ }
47
+ $from = $_POST['from'];
48
+ $to = $_POST['to'];
49
+ $query = $_POST['query'];
50
+ if ( isset( $_POST['filter'] ) ) {
51
+ $filter_id = $_POST['filter'];
52
+ } else {
53
+ $filter_id = false;
54
+ }
55
+ if ( isset( $_POST['metric'] ) ) {
56
+ $metric = $_POST['metric'];
57
+ } else {
58
+ $metric = 'sessions';
59
+ }
60
+
61
+ if ( $filter_id && $metric == 'sessions' ) { // Sessions metric is not available for item reports
62
+ $metric = 'pageviews';
63
+ }
64
+
65
+ if ( ob_get_length() ) {
66
+ ob_clean();
67
+ }
68
+
69
+ if ( ! ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && ( ( 1 == $this->gadwp->config->options['backend_item_reports'] ) || ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) ) ) {
70
+ wp_die( - 31 );
71
+ }
72
+ if ( $this->gadwp->config->options['token'] && $this->gadwp->config->options['tableid_jail'] && $from && $to ) {
73
+ if ( null === $this->gadwp->gapi_controller ) {
74
+ $this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
75
+ }
76
+ } else {
77
+ wp_die( - 24 );
78
+ }
79
+ if ( false == $projectId ) {
80
+ $projectId = $this->gadwp->config->options['tableid_jail'];
81
+ }
82
+ $profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $projectId );
83
+ if ( isset( $profile_info[4] ) ) {
84
+ $this->gadwp->gapi_controller->timeshift = $profile_info[4];
85
+ } else {
86
+ $this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
87
+ }
88
+
89
+ if ( $filter_id ) {
90
+ $uri_parts = explode( '/', get_permalink( $filter_id ), 4 );
91
+
92
+ if ( isset( $uri_parts[3] ) ) {
93
+ $uri = '/' . $uri_parts[3];
94
+ } else {
95
+ wp_die( - 25 );
96
+ }
97
+
98
+ // allow URL correction before sending an API request
99
+ $filter = apply_filters( 'gadwp_backenditem_uri', $uri, $filter_id );
100
+
101
+ $lastchar = substr( $filter, - 1 );
102
+
103
+ if ( isset( $profile_info[6] ) && $profile_info[6] && '/' == $lastchar ) {
104
+ $filter = $filter . $profile_info[6];
105
+ }
106
+
107
+ // Encode URL
108
+ $filter = rawurlencode( rawurldecode( $filter ) );
109
+ } else {
110
+ $filter = false;
111
+ }
112
+
113
+ $queries = explode( ',', $query );
114
+
115
+ $results = array();
116
+
117
+ foreach ( $queries as $value ) {
118
+ $results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to, $filter, $metric );
119
+ }
120
+
121
+ wp_send_json( $results );
122
+ }
123
+
124
+ /**
125
+ * Ajax handler for dismissing Admin notices
126
+ *
127
+ * @return json|int
128
+ */
129
+ public function ajax_dismiss_notices() {
130
+ if ( ! isset( $_POST['gadwp_security_dismiss_notices'] ) || ! wp_verify_nonce( $_POST['gadwp_security_dismiss_notices'], 'gadwp_dismiss_notices' ) ) {
131
+ wp_die( - 30 );
132
+ }
133
+
134
+ if ( ! current_user_can( 'manage_options' ) ) {
135
+ wp_die( - 31 );
136
+ }
137
+
138
+ delete_option( 'gadwp_got_updated' );
139
+
140
+ wp_die();
141
+ }
142
+ }
143
+ }
tags/5.3.1/admin/css/admin-widgets.css ADDED
@@ -0,0 +1 @@
 
1
+ .gadwp-pline{width:100%;margin:0;padding:5px 0 5px 0;background:#fff;-moz-box-shadow:0 0 3px 0 #BBB;-webkit-box-shadow:0 0 3px 0 #BBB;box-shadow:0 0 3px 0 #BBB;display:table;overflow:hidden}.gadwp-pleft{width:90%;float:left;padding-left:5px}.gadwp-pright{width:5%;float:right;padding-right:5px}[id^=gadwp-realtime-]{margin:10px 0 0 0;width:100%}.gadwp-rt-box{width:100%;margin:0;background:#fff;text-align:center;-moz-box-shadow:0 0 5px 0 #BBB;-webkit-box-shadow:0 0 5px 0 #BBB;box-shadow:0 0 5px 0 #BBB;display:table}.gadwp-tdo-left{width:60%;padding:33px 0;float:left;text-align:center}.gadwp-tdo-right{width:35%;margin:0 10px 0 0;text-align:left;font-weight:bold;vertical-align:middle;float:right;display:table}.gadwp-online{font-size:100px;font-weight:normal;line-height:1em;margin:0 auto;width:80%}.gadwp-bigtext{font-size:14px;width:100%;margin:0;padding:5px 5px 5px 5px;background:#fff;-moz-box-shadow:0 0 3px 0 #BBB;-webkit-box-shadow:0 0 3px 0 #BBB;box-shadow:0 0 3px 0 #BBB;display:table;overflow:hidden}.gadwp-bleft{float:left;width:80%}.gadwp-bright{float:right;width:20%}.gadwp-pgdetailsr{padding-left:20px;text-align:right}.gadwp-pgdetailsl{min-width:250px}[id^=gadwp-areachart-]{width:98%;height:100%;margin:10px auto 10px 0;height:250px}.gadwp-floatwraper{display:table;width:100%;height:100%}[id^=gadwp-piechart-].halfsize{width:47%;margin:10px 0 0 0;height:200px;float:left}[id^=gadwp-piechart-].floatleft{float:left}[id^=gadwp-piechart-].floatright{float:right}[id^=gadwp-tablechart-],[id^=gadwp-tablechart-]{width:98%;height:100%;margin:10px auto 10px 0}#dashboard-widgets-wrap .postbox{margin-right:10px}[id^=gadwp-progressbar-]{width:100%;height:3px;margin:5px 0 0 0}[id^=gadwp-bottomstats-]{width:100%}[id^=gadwp-bottomstats-] .inside{display:table;margin:0 auto;padding:0}#gadwp-widget .inside .small-box{width:30%;float:left;margin:0 5px 10px 5px;background:#fff;text-align:center;-moz-box-shadow:0 0 7px 0 #BBB;-webkit-box-shadow:0 0 7px 0 #BBB;box-shadow:0 0 7px 0 #BBB}#gadwp-widget .inside .small-box h3{font-size:1em;color:#777;padding:0 5px 0 5px;margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}#gadwp-widget .inside .small-box p{font-size:1.2em;margin:0 0 2px 0}@media screen and (max-width:410px){[id^=gadwp-bottomstats-] .inside .small-box{width:45%}}
tags/5.3.1/admin/css/gadwp.css ADDED
@@ -0,0 +1 @@
 
1
+ #gadwp-events,#gadwp-custom,#gadwp-advanced,#gadwp-exclude,#gadwp-config,#gadwp-tmdatalayervars,#gadwp-tmintegration,#gadwp-integration{display:none}table.gadwp-settings-options{padding-left:10px;width:100%}.gadwp-settings-options td{padding:0 5px 5px 5px}td.gadwp-settings-title,td.info{width:140px;padding-left:20px}td.gadwp-settings-title-s{width:300px}.gadwp-help{padding-left:15px}td.gadwp-settings-info{padding-bottom:15px}td.gadwp-settings-title label{font-size:1.1em}.gadwp-title{float:left;margin-right:10px;margin-top:2px;clear:left}.gadwp-desc{font-size:1em}.gadwp-top{vertical-align:top}pre.gadwp-settings-logdata{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}pre.gadwp-settings-logdata span{color:#b30000;font-weight:800}table.gadwp-settings-logdata{table-layout:fixed;width:100%}td.gadwp-settings-roles{padding-bottom:15px}#ga_speed_samplerate,#ga_user_samplerate,#ga_realtime_pages{width:50px}#gapi-access-code{color:red !important}#poststuff.gadwp h2{padding-bottom:0;font-size:19.5px;font-weight:normal;padding:0;margin:20px 0 15px 0}#poststuff.gadwp h2.nav-tab-wrapper{border-bottom:1px solid #ccc;padding-bottom:0}.button-primary.gadwp-settings-switchoo{position:relative;width:50px;float:left;border:0;padding:0;height:22px;-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}input.gadwp-settings-switchoo-checkbox{display:none}.gadwp-settings-switchoo-label{display:block;overflow:hidden;cursor:pointer;background:transparent;border:1px solid #ddd;border-radius:2px;text-shadow:none}.gadwp-settings-switchoo-inner{width:200%;margin-left:-100%;border-radius:2px;-moz-transition:margin .2s ease-in 0;-webkit-transition:margin .2s ease-in 0;-o-transition:margin .2s ease-in 0;transition:margin .2s ease-in 0}.gadwp-settings-switchoo-inner:before,.gadwp-settings-switchoo-inner:after{float:left;width:50%;font-weight:normal;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;height:22px;line-height:22px;font-size:12px;text-shadow:none}.gadwp-settings-switchoo-inner:before{content:"On";padding-left:5px;border-bottom:0}.gadwp-settings-switchoo-inner:after{content:"Off";padding-right:5px;background-color:#ddd;text-align:right}.gadwp-settings-switchoo-switch{width:22px;height:22px;background:#fff;color:#ddd;border:1px solid #ddd;border-radius:2px;position:absolute;top:0;bottom:0;right:27px;-moz-transition:all .2s ease-in 0;-webkit-transition:all .2s ease-in 0;-o-transition:all .2s ease-in 0;transition:all .2s ease-in 0}.gadwp-settings-switchoo-switch:hover{color:#aaa;border-color:#aaa}.gadwp-settings-switchoo-switch:after{margin:0;outline:0;display:inline-block;font:400 16px/16px dashicons;content:"\f228";padding:3px 0 0 3px;text-align:left;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-inner{margin-left:0}.gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-switch{right:0}.switch-desc{float:left;margin-left:10px;line-height:20px}
tags/5.3.1/admin/css/item-reports.css ADDED
@@ -0,0 +1 @@
 
1
+ .column-gadwp_stats{width:70px}.gadwp-icon{color:#555}.gadwp-icon:hover{color:#2ea2cc}.gadwp-icon-oldwp{padding-top:5px}[id^=gadwp-container-]{width:480px}[id^=gadwp-areachart-]{height:280px}[id^=gadwp-progressbar-]{width:100%;height:3px;margin:5px 0 0 0}[id^=gadwp-bottomstats-]{width:100%}[id^=gadwp-bottomstats-] .inside{display:table;margin:0 auto;padding:0}[id^=gadwp-bottomstats-] .inside .small-box{width:31.2%;float:left;margin:10px 5px 10px 5px;background:#fff;text-align:center;-moz-box-shadow:0 0 7px 0 #BBB;-webkit-box-shadow:0 0 7px 0 #BBB;box-shadow:0 0 7px 0 #BBB}[id^=gadwp-bottomstats-] .inside .small-box h3{font-size:1em;font-weight:normal;color:#777;padding:0 5px 0 5px;margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}[id^=gadwp-bottomstats-] .inside .small-box p{font-size:1.2em;margin:0 0 2px 0;color:black}.gadwp-floatwraper{display:table;width:100%;height:100%}[id^=gadwp-piechart-].halfsize{width:47%;margin:10px 0 0 0;height:200px;float:left}[id^=gadwp-piechart-].floatleft{float:left}[id^=gadwp-piechart-].floatright{float:right}[id^=gadwp-tablechart-],[id^=gadwp-tablechart-]{margin:10px 0 0 0}.gadwp .ui-dialog-titlebar{font-size:1.1em;text-overflow:ellipsis;overflow:hidden}@media screen and (max-width:500px){[id^=gadwp-container-]{width:410px}[id^=gadwp-bottomstats-] .inside .small-box{width:30.8%}}@media screen and (max-width:410px){[id^=gadwp-container-]{width:260px}[id^=gadwp-bottomstats-] .inside .small-box{width:46%}}
tags/5.3.1/admin/images/clicky.png ADDED
Binary file
tags/5.3.1/admin/images/gadwp-icon.png ADDED
Binary file
tags/5.3.1/admin/images/google-analytics-dashboard.png ADDED
Binary file
tags/5.3.1/admin/images/help.png ADDED
Binary file
tags/5.3.1/admin/images/mcdn.png ADDED
Binary file
tags/5.3.1/admin/images/ssl.png ADDED
Binary file
tags/5.3.1/admin/images/star.png ADDED
Binary file
tags/5.3.1/admin/images/wp.png ADDED
Binary file
tags/5.3.1/admin/item-reports.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Backend_Item_Reports' ) ) {
15
+
16
+ final class GADWP_Backend_Item_Reports {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && 1 == $this->gadwp->config->options['backend_item_reports'] ) {
24
+ // Add custom column in Posts List
25
+ add_filter( 'manage_posts_columns', array( $this, 'add_columns' ) );
26
+
27
+ // Populate custom column in Posts List
28
+ add_action( 'manage_posts_custom_column', array( $this, 'add_icons' ), 10, 2 );
29
+
30
+ // Add custom column in Pages List
31
+ add_filter( 'manage_pages_columns', array( $this, 'add_columns' ) );
32
+
33
+ // Populate custom column in Pages List
34
+ add_action( 'manage_pages_custom_column', array( $this, 'add_icons' ), 10, 2 );
35
+ }
36
+ }
37
+
38
+ public function add_icons( $column, $id ) {
39
+ global $wp_version;
40
+
41
+ if ( 'gadwp_stats' != $column ) {
42
+ return;
43
+ }
44
+
45
+ if ( version_compare( $wp_version, '3.8.0', '>=' ) ) {
46
+ echo '<a id="gadwp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '" class="gadwp-icon dashicons-before dashicons-chart-area">&nbsp;</a>';
47
+ } else {
48
+ echo '<a id="gadwp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '"><img class="gadwp-icon-oldwp" src="' . GADWP_URL . 'admin/images/gadwp-icon.png"</a>';
49
+ }
50
+ }
51
+
52
+ public function add_columns( $columns ) {
53
+ return array_merge( $columns, array( 'gadwp_stats' => __( 'Analytics', 'google-analytics-dashboard-for-wp' ) ) );
54
+ }
55
+ }
56
+ }
tags/5.3.1/admin/js/settings.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){if(window.location.href.indexOf("page=gadwp_")!=-1){var a="basic";if(window.location.hash){a=window.location.hash.split("#")[2].split("-")[1]}else{if(window.location.href.indexOf("page=gadwp_errors_debugging")!=-1){a="errors"}}jQuery(".nav-tab-wrapper a").each(function(b){jQuery(this).removeClass("nav-tab-active");jQuery("#"+this.hash.split("#")[2]).hide()});jQuery("#tab-"+a).addClass("nav-tab-active");jQuery("#gadwp-"+a).show()}jQuery('a[href^="#"]').click(function(b){if(window.location.href.indexOf("page=gadwp_")!=-1){jQuery(".nav-tab-wrapper a").each(function(c){jQuery(this).removeClass("nav-tab-active");jQuery("#"+this.hash.split("#")[2]).hide()});jQuery(this).addClass("nav-tab-active");jQuery("#"+this.hash.split("#")[2]).show()}})});
tags/5.3.1/admin/js/ui.js ADDED
@@ -0,0 +1 @@
 
1
+ "use strict";jQuery(document).ready(function(){var a={action:"gadwp_dismiss_notices",gadwp_security_dismiss_notices:gadwp_ui_data.security};jQuery("#gadwp-notice .notice-dismiss").click(function(){jQuery.post(gadwp_ui_data.ajaxurl,a)});if(gadwp_ui_data.ed_bubble!=""){jQuery('#toplevel_page_gadwp_settings li > a[href*="page=gadwp_errors_debugging"]').append('&nbsp;<span class="awaiting-mod count-1"><span class="pending-count" style="padding:0 7px;">'+gadwp_ui_data.ed_bubble+"</span></span>")}});
tags/5.3.1/admin/js/wp-color-picker-script.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){jQuery(".theme_color").wpColorPicker()});
tags/5.3.1/admin/settings.php ADDED
@@ -0,0 +1,1909 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit();
13
+ }
14
+
15
+ final class GADWP_Settings {
16
+
17
+ private static function update_options( $who ) {
18
+ $gadwp = GADWP();
19
+ $network_settings = false;
20
+ $options = $gadwp->config->options; // Get current options
21
+ if ( isset( $_POST['options']['gadwp_hidden'] ) && isset( $_POST['options'] ) && ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) && 'Reset' != $who ) {
22
+ $new_options = $_POST['options'];
23
+ if ( 'tracking' == $who ) {
24
+ $options['ga_anonymize_ip'] = 0;
25
+ $options['ga_optout'] = 0;
26
+ $options['ga_dnt_optout'] = 0;
27
+ $options['ga_event_tracking'] = 0;
28
+ $options['ga_enhanced_links'] = 0;
29
+ $options['ga_event_precision'] = 0;
30
+ $options['ga_remarketing'] = 0;
31
+ $options['ga_event_bouncerate'] = 0;
32
+ $options['ga_crossdomain_tracking'] = 0;
33
+ $options['ga_aff_tracking'] = 0;
34
+ $options['ga_hash_tracking'] = 0;
35
+ $options['ga_formsubmit_tracking'] = 0;
36
+ $options['ga_force_ssl'] = 0;
37
+ $options['ga_pagescrolldepth_tracking'] = 0;
38
+ $options['tm_pagescrolldepth_tracking'] = 0;
39
+ $options['amp_tracking_analytics'] = 0;
40
+ $options['amp_tracking_clientidapi'] = 0;
41
+ $options['amp_tracking_tagmanager'] = 0;
42
+ $options['optimize_pagehiding'] = 0;
43
+ $options['optimize_tracking'] = 0;
44
+ $options['trackingcode_infooter'] = 0;
45
+ $options['trackingevents_infooter'] = 0;
46
+ $options['ga_with_gtag'] = 0;
47
+ if ( isset( $_POST['options']['ga_tracking_code'] ) ) {
48
+ $new_options['ga_tracking_code'] = trim( $new_options['ga_tracking_code'], "\t" );
49
+ }
50
+ if ( empty( $new_options['track_exclude'] ) ) {
51
+ $new_options['track_exclude'] = array();
52
+ }
53
+ } elseif ( 'backend' == $who ) {
54
+ $options['switch_profile'] = 0;
55
+ $options['backend_item_reports'] = 0;
56
+ $options['dashboard_widget'] = 0;
57
+ $options['backend_realtime_report'] = 0;
58
+ if ( empty( $new_options['access_back'] ) ) {
59
+ $new_options['access_back'][] = 'administrator';
60
+ }
61
+ } elseif ( 'frontend' == $who ) {
62
+ $options['frontend_item_reports'] = 0;
63
+ if ( empty( $new_options['access_front'] ) ) {
64
+ $new_options['access_front'][] = 'administrator';
65
+ }
66
+ } elseif ( 'general' == $who ) {
67
+ $options['user_api'] = 0;
68
+ if ( ! is_multisite() ) {
69
+ $options['automatic_updates_minorversion'] = 0;
70
+ }
71
+ } elseif ( 'network' == $who ) {
72
+ $options['user_api'] = 0;
73
+ $options['network_mode'] = 0;
74
+ $options['superadmin_tracking'] = 0;
75
+ $options['automatic_updates_minorversion'] = 0;
76
+ $network_settings = true;
77
+ }
78
+ $options = array_merge( $options, $new_options );
79
+ $gadwp->config->options = $options;
80
+ $gadwp->config->set_plugin_options( $network_settings );
81
+ }
82
+ return $options;
83
+ }
84
+
85
+ private static function navigation_tabs( $tabs ) {
86
+ echo '<h2 class="nav-tab-wrapper">';
87
+ foreach ( $tabs as $tab => $name ) {
88
+ echo "<a class='nav-tab' id='tab-$tab' href='#top#gadwp-$tab'>$name</a>";
89
+ }
90
+ echo '</h2>';
91
+ }
92
+
93
+ public static function frontend_settings() {
94
+ $gadwp = GADWP();
95
+ if ( ! current_user_can( 'manage_options' ) ) {
96
+ return;
97
+ }
98
+ $options = self::update_options( 'frontend' );
99
+ if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
100
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
101
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
102
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
103
+ }
104
+ }
105
+ if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) {
106
+ $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
107
+ }
108
+ ?>
109
+ <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
110
+ <div class="wrap">
111
+ <?php echo "<h2>" . __( "Google Analytics Frontend Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?><hr>
112
+ </div>
113
+ <div id="poststuff" class="gadwp">
114
+ <div id="post-body" class="metabox-holder columns-2">
115
+ <div id="post-body-content">
116
+ <div class="settings-wrapper">
117
+ <div class="inside">
118
+ <?php if (isset($message)) echo $message; ?>
119
+ <table class="gadwp-settings-options">
120
+ <tr>
121
+ <td colspan="2"><?php echo "<h2>" . __( "Permissions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
122
+ </tr>
123
+ <tr>
124
+ <td class="roles gadwp-settings-title">
125
+ <label for="access_front"><?php _e("Show stats to:", 'google-analytics-dashboard-for-wp' ); ?>
126
+ </label>
127
+ </td>
128
+ <td class="gadwp-settings-roles">
129
+ <table>
130
+ <tr>
131
+ <?php if ( ! isset( $wp_roles ) ) : ?>
132
+ <?php $wp_roles = new WP_Roles(); ?>
133
+ <?php endif; ?>
134
+ <?php $i = 0; ?>
135
+ <?php foreach ( $wp_roles->role_names as $role => $name ) : ?>
136
+ <?php if ( 'subscriber' != $role ) : ?>
137
+ <?php $i++; ?>
138
+ <td>
139
+ <label>
140
+ <input type="checkbox" name="options[access_front][]" value="<?php echo $role; ?>" <?php if ( in_array($role,$options['access_front']) || 'administrator' == $role ) echo 'checked="checked"'; if ( 'administrator' == $role ) echo 'disabled="disabled"';?> /><?php echo $name; ?>
141
+ </label>
142
+ </td>
143
+ <?php endif; ?>
144
+ <?php if ( 0 == $i % 4 ) : ?>
145
+ </tr>
146
+ <tr>
147
+ <?php endif; ?>
148
+ <?php endforeach; ?>
149
+ </table>
150
+ </td>
151
+ </tr>
152
+ <tr>
153
+ <td colspan="2" class="gadwp-settings-title">
154
+ <div class="button-primary gadwp-settings-switchoo">
155
+ <input type="checkbox" name="options[frontend_item_reports]" value="1" class="gadwp-settings-switchoo-checkbox" id="frontend_item_reports" <?php checked( $options['frontend_item_reports'], 1 ); ?>>
156
+ <label class="gadwp-settings-switchoo-label" for="frontend_item_reports">
157
+ <div class="gadwp-settings-switchoo-inner"></div>
158
+ <div class="gadwp-settings-switchoo-switch"></div>
159
+ </label>
160
+ </div>
161
+ <div class="switch-desc"><?php echo " ".__("enable web page reports on frontend", 'google-analytics-dashboard-for-wp' );?></div>
162
+ </td>
163
+ </tr>
164
+ <tr>
165
+ <td colspan="2">
166
+ <hr>
167
+ </td>
168
+ </tr>
169
+ <tr>
170
+ <td colspan="2" class="submit">
171
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
172
+ </td>
173
+ </tr>
174
+ </table>
175
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
176
+ <?php wp_nonce_field('gadwp_form','gadwp_security');?>
177
+
178
+
179
+
180
+
181
+
182
+
183
+ </form>
184
+ <?php
185
+ self::output_sidebar();
186
+ }
187
+
188
+ public static function backend_settings() {
189
+ $gadwp = GADWP();
190
+ if ( ! current_user_can( 'manage_options' ) ) {
191
+ return;
192
+ }
193
+ $options = self::update_options( 'backend' );
194
+ if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
195
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
196
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
197
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
198
+ }
199
+ }
200
+ if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) {
201
+ $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
202
+ }
203
+ ?>
204
+ <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
205
+ <div class="wrap">
206
+ <?php echo "<h2>" . __( "Google Analytics Backend Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?><hr>
207
+ </div>
208
+ <div id="poststuff" class="gadwp">
209
+ <div id="post-body" class="metabox-holder columns-2">
210
+ <div id="post-body-content">
211
+ <div class="settings-wrapper">
212
+ <div class="inside">
213
+ <?php if (isset($message)) echo $message; ?>
214
+ <table class="gadwp-settings-options">
215
+ <tr>
216
+ <td colspan="2"><?php echo "<h2>" . __( "Permissions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
217
+ </tr>
218
+ <tr>
219
+ <td class="roles gadwp-settings-title">
220
+ <label for="access_back"><?php _e("Show stats to:", 'google-analytics-dashboard-for-wp' ); ?>
221
+ </label>
222
+ </td>
223
+ <td class="gadwp-settings-roles">
224
+ <table>
225
+ <tr>
226
+ <?php if ( ! isset( $wp_roles ) ) : ?>
227
+ <?php $wp_roles = new WP_Roles(); ?>
228
+ <?php endif; ?>
229
+ <?php $i = 0; ?>
230
+ <?php foreach ( $wp_roles->role_names as $role => $name ) : ?>
231
+ <?php if ( 'subscriber' != $role ) : ?>
232
+ <?php $i++; ?>
233
+ <td>
234
+ <label>
235
+ <input type="checkbox" name="options[access_back][]" value="<?php echo $role; ?>" <?php if ( in_array($role,$options['access_back']) || 'administrator' == $role ) echo 'checked="checked"'; if ( 'administrator' == $role ) echo 'disabled="disabled"';?> /> <?php echo $name; ?>
236
+ </label>
237
+ </td>
238
+ <?php endif; ?>
239
+ <?php if ( 0 == $i % 4 ) : ?>
240
+ </tr>
241
+ <tr>
242
+ <?php endif; ?>
243
+ <?php endforeach; ?>
244
+
245
+
246
+
247
+
248
+
249
+
250
+ </table>
251
+ </td>
252
+ </tr>
253
+ <tr>
254
+ <td colspan="2" class="gadwp-settings-title">
255
+ <div class="button-primary gadwp-settings-switchoo">
256
+ <input type="checkbox" name="options[switch_profile]" value="1" class="gadwp-settings-switchoo-checkbox" id="switch_profile" <?php checked( $options['switch_profile'], 1 ); ?>>
257
+ <label class="gadwp-settings-switchoo-label" for="switch_profile">
258
+ <div class="gadwp-settings-switchoo-inner"></div>
259
+ <div class="gadwp-settings-switchoo-switch"></div>
260
+ </label>
261
+ </div>
262
+ <div class="switch-desc"><?php _e ( "enable Switch View functionality", 'google-analytics-dashboard-for-wp' );?></div>
263
+ </td>
264
+ </tr>
265
+ <tr>
266
+ <td colspan="2" class="gadwp-settings-title">
267
+ <div class="button-primary gadwp-settings-switchoo">
268
+ <input type="checkbox" name="options[backend_item_reports]" value="1" class="gadwp-settings-switchoo-checkbox" id="backend_item_reports" <?php checked( $options['backend_item_reports'], 1 ); ?>>
269
+ <label class="gadwp-settings-switchoo-label" for="backend_item_reports">
270
+ <div class="gadwp-settings-switchoo-inner"></div>
271
+ <div class="gadwp-settings-switchoo-switch"></div>
272
+ </label>
273
+ </div>
274
+ <div class="switch-desc"><?php _e ( "enable reports on Posts List and Pages List", 'google-analytics-dashboard-for-wp' );?></div>
275
+ </td>
276
+ </tr>
277
+ <tr>
278
+ <td colspan="2" class="gadwp-settings-title">
279
+ <div class="button-primary gadwp-settings-switchoo">
280
+ <input type="checkbox" name="options[dashboard_widget]" value="1" class="gadwp-settings-switchoo-checkbox" id="dashboard_widget" <?php checked( $options['dashboard_widget'], 1 ); ?>>
281
+ <label class="gadwp-settings-switchoo-label" for="dashboard_widget">
282
+ <div class="gadwp-settings-switchoo-inner"></div>
283
+ <div class="gadwp-settings-switchoo-switch"></div>
284
+ </label>
285
+ </div>
286
+ <div class="switch-desc"><?php _e ( "enable the main Dashboard Widget", 'google-analytics-dashboard-for-wp' );?></div>
287
+ </td>
288
+ </tr>
289
+ <tr>
290
+ <td colspan="2">
291
+ <hr><?php echo "<h2>" . __( "Real-Time Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
292
+ </tr>
293
+ <?php if ( $options['user_api'] ) : ?>
294
+ <tr>
295
+ <td colspan="2" class="gadwp-settings-title">
296
+ <div class="button-primary gadwp-settings-switchoo">
297
+ <input type="checkbox" name="options[backend_realtime_report]" value="1" class="gadwp-settings-switchoo-checkbox" id="backend_realtime_report" <?php checked( $options['backend_realtime_report'], 1 ); ?>>
298
+ <label class="gadwp-settings-switchoo-label" for="backend_realtime_report">
299
+ <div class="gadwp-settings-switchoo-inner"></div>
300
+ <div class="gadwp-settings-switchoo-switch"></div>
301
+ </label>
302
+ </div>
303
+ <div class="switch-desc"><?php _e ( "enable Real-Time report (requires access to Real-Time Reporting API)", 'google-analytics-dashboard-for-wp' );?></div>
304
+ </td>
305
+ </tr>
306
+ <?php endif; ?>
307
+ <tr>
308
+ <td colspan="2" class="gadwp-settings-title"> <?php _e("Maximum number of pages to display on real-time tab:", 'google-analytics-dashboard-for-wp'); ?>
309
+ <input type="number" name="options[ga_realtime_pages]" id="ga_realtime_pages" value="<?php echo (int)$options['ga_realtime_pages']; ?>" size="3">
310
+ </td>
311
+ </tr>
312
+ <tr>
313
+ <td colspan="2">
314
+ <hr><?php echo "<h2>" . __( "Location Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
315
+ </tr>
316
+ <tr>
317
+ <td colspan="2" class="gadwp-settings-title">
318
+ <?php echo __("Target Geo Map to country:", 'google-analytics-dashboard-for-wp'); ?>
319
+ <input type="text" style="text-align: center;" name="options[ga_target_geomap]" value="<?php echo esc_attr($options['ga_target_geomap']); ?>" size="3">
320
+ </td>
321
+ </tr>
322
+ <tr>
323
+ <td colspan="2" class="gadwp-settings-title">
324
+ <?php echo __("Maps API Key:", 'google-analytics-dashboard-for-wp'); ?>
325
+ <input type="text" style="text-align: center;" name="options[maps_api_key]" value="<?php echo esc_attr($options['maps_api_key']); ?>" size="50">
326
+ </td>
327
+ </tr>
328
+ <tr>
329
+ <td colspan="2">
330
+ <hr><?php echo "<h2>" . __( "404 Errors Report", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
331
+ </tr>
332
+ <tr>
333
+ <td colspan="2" class="gadwp-settings-title">
334
+ <?php echo __("404 Page Title contains:", 'google-analytics-dashboard-for-wp'); ?>
335
+ <input type="text" style="text-align: center;" name="options[pagetitle_404]" value="<?php echo esc_attr($options['pagetitle_404']); ?>" size="20">
336
+ </td>
337
+ </tr>
338
+ <tr>
339
+ <td colspan="2">
340
+ <hr>
341
+ </td>
342
+ </tr>
343
+ <tr>
344
+ <td colspan="2" class="submit">
345
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
346
+ </td>
347
+ </tr>
348
+ </table>
349
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
350
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
351
+
352
+
353
+
354
+
355
+
356
+
357
+ </form>
358
+ <?php
359
+ self::output_sidebar();
360
+ }
361
+
362
+ public static function tracking_settings() {
363
+ $gadwp = GADWP();
364
+
365
+ if ( ! current_user_can( 'manage_options' ) ) {
366
+ return;
367
+ }
368
+ $options = self::update_options( 'tracking' );
369
+ if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
370
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
371
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
372
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
373
+ }
374
+ }
375
+ if ( ! $gadwp->config->options['tableid_jail'] ) {
376
+ $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
377
+ }
378
+ ?>
379
+ <form name="gadwp_form" method="post" action="<?php esc_url($_SERVER['REQUEST_URI']); ?>">
380
+ <div class="wrap">
381
+ <?php echo "<h2>" . __( "Google Analytics Tracking Code", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
382
+ </div>
383
+ <div id="poststuff" class="gadwp">
384
+ <div id="post-body" class="metabox-holder columns-2">
385
+ <div id="post-body-content">
386
+ <div class="settings-wrapper">
387
+ <div class="inside">
388
+ <?php if ( 'universal' == $options['tracking_type'] ) :?>
389
+ <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ), 'events' => __( "Events Tracking", 'google-analytics-dashboard-for-wp' ), 'custom' => __( "Custom Definitions", 'google-analytics-dashboard-for-wp' ), 'exclude' => __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ), 'advanced' => __( "Advanced Settings", 'google-analytics-dashboard-for-wp' ), 'integration' => __( "Integration", 'google-analytics-dashboard-for-wp' ) );?>
390
+ <?php elseif ( 'tagmanager' == $options['tracking_type'] ) :?>
391
+ <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ), 'tmdatalayervars' => __( "DataLayer Variables", 'google-analytics-dashboard-for-wp' ), 'exclude' => __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ), 'tmintegration' => __( "Integration", 'google-analytics-dashboard-for-wp' ) );?>
392
+ <?php else :?>
393
+ <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ) );?>
394
+ <?php endif; ?>
395
+ <?php self::navigation_tabs( $tabs ); ?>
396
+ <?php if ( isset( $message ) ) : ?>
397
+ <?php echo $message; ?>
398
+ <?php endif; ?>
399
+ <div id="gadwp-basic">
400
+ <table class="gadwp-settings-options">
401
+ <tr>
402
+ <td colspan="2"><?php echo "<h2>" . __( "Tracking Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
403
+ </tr>
404
+ <tr>
405
+ <td class="gadwp-settings-title">
406
+ <label for="tracking_type"><?php _e("Tracking Type:", 'google-analytics-dashboard-for-wp' ); ?>
407
+ </label>
408
+ </td>
409
+ <td>
410
+ <select id="tracking_type" name="options[tracking_type]" onchange="this.form.submit()">
411
+ <option value="universal" <?php selected( $options['tracking_type'], 'universal' ); ?>><?php _e("Analytics", 'google-analytics-dashboard-for-wp');?></option>
412
+ <option value="tagmanager" <?php selected( $options['tracking_type'], 'tagmanager' ); ?>><?php _e("Tag Manager", 'google-analytics-dashboard-for-wp');?></option>
413
+ <option value="disabled" <?php selected( $options['tracking_type'], 'disabled' ); ?>><?php _e("Disabled", 'google-analytics-dashboard-for-wp');?></option>
414
+ </select>
415
+ </td>
416
+ </tr>
417
+ <?php if ( 'universal' == $options['tracking_type'] ) : ?>
418
+ <tr>
419
+ <td class="gadwp-settings-title"></td>
420
+ <td>
421
+ <?php $profile_info = GADWP_Tools::get_selected_profile($gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail']); ?>
422
+ <?php echo '<pre>' . __("View Name:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[0]) . "<br />" . __("Tracking ID:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[2]) . "<br />" . __("Default URL:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[3]) . "<br />" . __("Time Zone:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[5]) . '</pre>';?>
423
+ </td>
424
+ </tr>
425
+ <tr>
426
+ <td colspan="2" class="gadwp-settings-title">
427
+ <div class="button-primary gadwp-settings-switchoo">
428
+ <input type="checkbox" name="options[ga_with_gtag]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_with_gtag" <?php checked( $options['ga_with_gtag'], 1 ); ?>>
429
+ <label class="gadwp-settings-switchoo-label" for="ga_with_gtag">
430
+ <div class="gadwp-settings-switchoo-inner"></div>
431
+ <div class="gadwp-settings-switchoo-switch"></div>
432
+ </label>
433
+ </div>
434
+ <div class="switch-desc"><?php echo " ".__("use global site tag gtag.js (not recommended)", 'google-analytics-dashboard-for-wp' );?></div>
435
+ </td>
436
+ </tr>
437
+ <?php elseif ( 'tagmanager' == $options['tracking_type'] ) : ?>
438
+ <tr>
439
+ <td class="gadwp-settings-title">
440
+ <label for="tracking_type"><?php _e("Web Container ID:", 'google-analytics-dashboard-for-wp' ); ?>
441
+ </label>
442
+ </td>
443
+ <td>
444
+ <input type="text" name="options[web_containerid]" value="<?php echo esc_attr($options['web_containerid']); ?>" size="15">
445
+ </td>
446
+ </tr>
447
+ <?php endif; ?>
448
+ <tr>
449
+ <td class="gadwp-settings-title">
450
+ <label for="trackingcode_infooter"><?php _e("Code Placement:", 'google-analytics-dashboard-for-wp' ); ?>
451
+ </label>
452
+ </td>
453
+ <td>
454
+ <select id="trackingcode_infooter" name="options[trackingcode_infooter]">
455
+ <option value="0" <?php selected( $options['trackingcode_infooter'], 0 ); ?>><?php _e("HTML Head", 'google-analytics-dashboard-for-wp');?></option>
456
+ <option value="1" <?php selected( $options['trackingcode_infooter'], 1 ); ?>><?php _e("HTML Body", 'google-analytics-dashboard-for-wp');?></option>
457
+ </select>
458
+ </td>
459
+ </tr>
460
+ </table>
461
+ </div>
462
+ <div id="gadwp-events">
463
+ <table class="gadwp-settings-options">
464
+ <tr>
465
+ <td colspan="2"><?php echo "<h2>" . __( "Events Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
466
+ </tr>
467
+ <tr>
468
+ <td colspan="2" class="gadwp-settings-title">
469
+ <div class="button-primary gadwp-settings-switchoo">
470
+ <input type="checkbox" name="options[ga_event_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_event_tracking" <?php checked( $options['ga_event_tracking'], 1 ); ?>>
471
+ <label class="gadwp-settings-switchoo-label" for="ga_event_tracking">
472
+ <div class="gadwp-settings-switchoo-inner"></div>
473
+ <div class="gadwp-settings-switchoo-switch"></div>
474
+ </label>
475
+ </div>
476
+ <div class="switch-desc"><?php echo " ".__("track downloads, mailto, telephone and outbound links", 'google-analytics-dashboard-for-wp' ); ?></div>
477
+ </td>
478
+ </tr>
479
+ <tr>
480
+ <td colspan="2" class="gadwp-settings-title">
481
+ <div class="button-primary gadwp-settings-switchoo">
482
+ <input type="checkbox" name="options[ga_aff_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_aff_tracking" <?php checked( $options['ga_aff_tracking'], 1 ); ?>>
483
+ <label class="gadwp-settings-switchoo-label" for="ga_aff_tracking">
484
+ <div class="gadwp-settings-switchoo-inner"></div>
485
+ <div class="gadwp-settings-switchoo-switch"></div>
486
+ </label>
487
+ </div>
488
+ <div class="switch-desc"><?php echo " ".__("track affiliate links", 'google-analytics-dashboard-for-wp' ); ?></div>
489
+ </td>
490
+ </tr>
491
+ <tr>
492
+ <td colspan="2" class="gadwp-settings-title">
493
+ <div class="button-primary gadwp-settings-switchoo">
494
+ <input type="checkbox" name="options[ga_hash_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_hash_tracking" <?php checked( $options['ga_hash_tracking'], 1 ); ?>>
495
+ <label class="gadwp-settings-switchoo-label" for="ga_hash_tracking">
496
+ <div class="gadwp-settings-switchoo-inner"></div>
497
+ <div class="gadwp-settings-switchoo-switch"></div>
498
+ </label>
499
+ </div>
500
+ <div class="switch-desc"><?php echo " ".__("track fragment identifiers, hashmarks (#) in URI links", 'google-analytics-dashboard-for-wp' ); ?></div>
501
+ </td>
502
+ </tr>
503
+ <tr>
504
+ <td colspan="2" class="gadwp-settings-title">
505
+ <div class="button-primary gadwp-settings-switchoo">
506
+ <input type="checkbox" name="options[ga_formsubmit_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_formsubmit_tracking" <?php checked( $options['ga_formsubmit_tracking'], 1 ); ?>>
507
+ <label class="gadwp-settings-switchoo-label" for="ga_formsubmit_tracking">
508
+ <div class="gadwp-settings-switchoo-inner"></div>
509
+ <div class="gadwp-settings-switchoo-switch"></div>
510
+ </label>
511
+ </div>
512
+ <div class="switch-desc"><?php echo " ".__("track form submit actions", 'google-analytics-dashboard-for-wp' ); ?></div>
513
+ </td>
514
+ </tr>
515
+ <tr>
516
+ <td colspan="2" class="gadwp-settings-title">
517
+ <div class="button-primary gadwp-settings-switchoo">
518
+ <input type="checkbox" name="options[ga_pagescrolldepth_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_pagescrolldepth_tracking" <?php checked( $options['ga_pagescrolldepth_tracking'], 1 ); ?>>
519
+ <label class="gadwp-settings-switchoo-label" for="ga_pagescrolldepth_tracking">
520
+ <div class="gadwp-settings-switchoo-inner"></div>
521
+ <div class="gadwp-settings-switchoo-switch"></div>
522
+ </label>
523
+ </div>
524
+ <div class="switch-desc"><?php echo " ".__("track page scrolling depth", 'google-analytics-dashboard-for-wp' ); ?></div>
525
+ </td>
526
+ </tr>
527
+ <tr>
528
+ <td class="gadwp-settings-title">
529
+ <label for="ga_event_downloads"><?php _e("Downloads Regex:", 'google-analytics-dashboard-for-wp'); ?>
530
+ </label>
531
+ </td>
532
+ <td>
533
+ <input type="text" id="ga_event_downloads" name="options[ga_event_downloads]" value="<?php echo esc_attr($options['ga_event_downloads']); ?>" size="50">
534
+ </td>
535
+ </tr>
536
+ <tr>
537
+ <td class="gadwp-settings-title">
538
+ <label for="ga_event_affiliates"><?php _e("Affiliates Regex:", 'google-analytics-dashboard-for-wp'); ?>
539
+ </label>
540
+ </td>
541
+ <td>
542
+ <input type="text" id="ga_event_affiliates" name="options[ga_event_affiliates]" value="<?php echo esc_attr($options['ga_event_affiliates']); ?>" size="50">
543
+ </td>
544
+ </tr>
545
+ <tr>
546
+ <td class="gadwp-settings-title">
547
+ <label for="trackingevents_infooter"><?php _e("Code Placement:", 'google-analytics-dashboard-for-wp' ); ?>
548
+ </label>
549
+ </td>
550
+ <td>
551
+ <select id="trackingevents_infooter" name="options[trackingevents_infooter]">
552
+ <option value="0" <?php selected( $options['trackingevents_infooter'], 0 ); ?>><?php _e("HTML Head", 'google-analytics-dashboard-for-wp');?></option>
553
+ <option value="1" <?php selected( $options['trackingevents_infooter'], 1 ); ?>><?php _e("HTML Body", 'google-analytics-dashboard-for-wp');?></option>
554
+ </select>
555
+ </td>
556
+ </tr>
557
+ </table>
558
+ </div>
559
+ <div id="gadwp-custom">
560
+ <table class="gadwp-settings-options">
561
+ <tr>
562
+ <td colspan="2"><?php echo "<h2>" . __( "Custom Dimensions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
563
+ </tr>
564
+ <tr>
565
+ <td class="gadwp-settings-title">
566
+ <label for="ga_author_dimindex"><?php _e("Authors:", 'google-analytics-dashboard-for-wp' ); ?>
567
+ </label>
568
+ </td>
569
+ <td>
570
+ <select id="ga_author_dimindex" name="options[ga_author_dimindex]">
571
+ <?php for ($i=0;$i<21;$i++) : ?>
572
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_author_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
573
+ <?php endfor; ?>
574
+ </select>
575
+ </td>
576
+ </tr>
577
+ <tr>
578
+ <td class="gadwp-settings-title">
579
+ <label for="ga_pubyear_dimindex"><?php _e("Publication Year:", 'google-analytics-dashboard-for-wp' ); ?>
580
+ </label>
581
+ </td>
582
+ <td>
583
+ <select id="ga_pubyear_dimindex" name="options[ga_pubyear_dimindex]">
584
+ <?php for ($i=0;$i<21;$i++) : ?>
585
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_pubyear_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
586
+ <?php endfor; ?>
587
+ </select>
588
+ </td>
589
+ </tr>
590
+ <tr>
591
+ <td class="gadwp-settings-title">
592
+ <label for="ga_pubyearmonth_dimindex"><?php _e("Publication Month:", 'google-analytics-dashboard-for-wp' ); ?>
593
+ </label>
594
+ </td>
595
+ <td>
596
+ <select id="ga_pubyearmonth_dimindex" name="options[ga_pubyearmonth_dimindex]">
597
+ <?php for ($i=0;$i<21;$i++) : ?>
598
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_pubyearmonth_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
599
+ <?php endfor; ?>
600
+ </select>
601
+ </td>
602
+ </tr>
603
+ <tr>
604
+ <td class="gadwp-settings-title">
605
+ <label for="ga_category_dimindex"><?php _e("Categories:", 'google-analytics-dashboard-for-wp' ); ?>
606
+ </label>
607
+ </td>
608
+ <td>
609
+ <select id="ga_category_dimindex" name="options[ga_category_dimindex]">
610
+ <?php for ($i=0;$i<21;$i++) : ?>
611
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_category_dimindex'], $i ); ?>><?php echo 0 == $i ? 'Disabled':'dimension '.$i; ?></option>
612
+ <?php endfor; ?>
613
+ </select>
614
+ </td>
615
+ </tr>
616
+ <tr>
617
+ <td class="gadwp-settings-title">
618
+ <label for="ga_user_dimindex"><?php _e("User Type:", 'google-analytics-dashboard-for-wp' ); ?>
619
+ </label>
620
+ </td>
621
+ <td>
622
+ <select id="ga_user_dimindex" name="options[ga_user_dimindex]">
623
+ <?php for ($i=0;$i<21;$i++) : ?>
624
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_user_dimindex'], $i ); ?>><?php echo 0 == $i ? 'Disabled':'dimension '.$i; ?></option>
625
+ <?php endfor; ?>
626
+ </select>
627
+ </td>
628
+ </tr>
629
+ <tr>
630
+ <td class="gadwp-settings-title">
631
+ <label for="ga_tag_dimindex"><?php _e("Tags:", 'google-analytics-dashboard-for-wp' ); ?>
632
+ </label>
633
+ </td>
634
+ <td>
635
+ <select id="ga_tag_dimindex" name="options[ga_tag_dimindex]">
636
+ <?php for ($i=0;$i<21;$i++) : ?>
637
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_tag_dimindex'], $i ); ?>><?php echo 0 == $i ? 'Disabled':'dimension '.$i; ?></option>
638
+ <?php endfor; ?>
639
+ </select>
640
+ </td>
641
+ </tr>
642
+ </table>
643
+ </div>
644
+ <div id="gadwp-tmdatalayervars">
645
+ <table class="gadwp-settings-options">
646
+ <tr>
647
+ <td colspan="2"><?php echo "<h2>" . __( "Main Variables", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
648
+ </tr>
649
+ <tr>
650
+ <td class="gadwp-settings-title">
651
+ <label for="tm_author_var"><?php _e("Authors:", 'google-analytics-dashboard-for-wp' ); ?>
652
+ </label>
653
+ </td>
654
+ <td>
655
+ <select id="tm_author_var" name="options[tm_author_var]">
656
+ <option value="1" <?php selected( $options['tm_author_var'], 1 ); ?>>gadwpAuthor</option>
657
+ <option value="0" <?php selected( $options['tm_author_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
658
+ </select>
659
+ </td>
660
+ </tr>
661
+ <tr>
662
+ <td class="gadwp-settings-title">
663
+ <label for="tm_pubyear_var"><?php _e("Publication Year:", 'google-analytics-dashboard-for-wp' ); ?>
664
+ </label>
665
+ </td>
666
+ <td>
667
+ <select id="tm_pubyear_var" name="options[tm_pubyear_var]">
668
+ <option value="1" <?php selected( $options['tm_pubyear_var'], 1 ); ?>>gadwpPublicationYear</option>
669
+ <option value="0" <?php selected( $options['tm_pubyear_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
670
+ </select>
671
+ </td>
672
+ </tr>
673
+ <tr>
674
+ <td class="gadwp-settings-title">
675
+ <label for="tm_pubyearmonth_var"><?php _e("Publication Month:", 'google-analytics-dashboard-for-wp' ); ?>
676
+ </label>
677
+ </td>
678
+ <td>
679
+ <select id="tm_pubyearmonth_var" name="options[tm_pubyearmonth_var]">
680
+ <option value="1" <?php selected( $options['tm_pubyearmonth_var'], 1 ); ?>>gadwpPublicationYearMonth</option>
681
+ <option value="0" <?php selected( $options['tm_pubyearmonth_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
682
+ </select>
683
+ </td>
684
+ </tr>
685
+ <tr>
686
+ <td class="gadwp-settings-title">
687
+ <label for="tm_category_var"><?php _e("Categories:", 'google-analytics-dashboard-for-wp' ); ?>
688
+ </label>
689
+ </td>
690
+ <td>
691
+ <select id="tm_category_var" name="options[tm_category_var]">
692
+ <option value="1" <?php selected( $options['tm_category_var'], 1 ); ?>>gadwpCategory</option>
693
+ <option value="0" <?php selected( $options['tm_category_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
694
+ </select>
695
+ </td>
696
+ </tr>
697
+ <tr>
698
+ <td class="gadwp-settings-title">
699
+ <label for="tm_user_var"><?php _e("User Type:", 'google-analytics-dashboard-for-wp' ); ?>
700
+ </label>
701
+ </td>
702
+ <td>
703
+ <select id="tm_user_var" name="options[tm_user_var]">
704
+ <option value="1" <?php selected( $options['tm_user_var'], 1 ); ?>>gadwpUser</option>
705
+ <option value="0" <?php selected( $options['tm_user_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
706
+ </select>
707
+ </td>
708
+ </tr>
709
+ <tr>
710
+ <td class="gadwp-settings-title">
711
+ <label for="tm_tag_var"><?php _e("Tags:", 'google-analytics-dashboard-for-wp' ); ?>
712
+ </label>
713
+ </td>
714
+ <td>
715
+ <select id="tm_tag_var" name="options[tm_tag_var]">
716
+ <option value="1" <?php selected( $options['tm_tag_var'], 1 ); ?>>gadwpTag</option>
717
+ <option value="0" <?php selected( $options['tm_tag_var'], 0 ); ?>><?php _e( "Disabled", 'google-analytics-dashboard-for-wp' ); ?></option>
718
+ </select>
719
+ </td>
720
+ </tr>
721
+ </table>
722
+ </div>
723
+ <div id="gadwp-advanced">
724
+ <table class="gadwp-settings-options">
725
+ <tr>
726
+ <td colspan="2"><?php echo "<h2>" . __( "Advanced Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
727
+ </tr>
728
+ <tr>
729
+ <td class="gadwp-settings-title">
730
+ <label for="ga_speed_samplerate"><?php _e("Speed Sample Rate:", 'google-analytics-dashboard-for-wp'); ?>
731
+ </label>
732
+ </td>
733
+ <td>
734
+ <input type="number" id="ga_speed_samplerate" name="options[ga_speed_samplerate]" value="<?php echo (int)($options['ga_speed_samplerate']); ?>" max="100" min="1">
735
+ %
736
+ </td>
737
+ </tr>
738
+ <tr>
739
+ <td class="gadwp-settings-title">
740
+ <label for="ga_user_samplerate"><?php _e("User Sample Rate:", 'google-analytics-dashboard-for-wp'); ?>
741
+ </label>
742
+ </td>
743
+ <td>
744
+ <input type="number" id="ga_user_samplerate" name="options[ga_user_samplerate]" value="<?php echo (int)($options['ga_user_samplerate']); ?>" max="100" min="1">
745
+ %
746
+ </td>
747
+ </tr>
748
+ <tr>
749
+ <td colspan="2" class="gadwp-settings-title">
750
+ <div class="button-primary gadwp-settings-switchoo">
751
+ <input type="checkbox" name="options[ga_anonymize_ip]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_anonymize_ip" <?php checked( $options['ga_anonymize_ip'], 1 ); ?>>
752
+ <label class="gadwp-settings-switchoo-label" for="ga_anonymize_ip">
753
+ <div class="gadwp-settings-switchoo-inner"></div>
754
+ <div class="gadwp-settings-switchoo-switch"></div>
755
+ </label>
756
+ </div>
757
+ <div class="switch-desc"><?php echo " ".__("anonymize IPs while tracking", 'google-analytics-dashboard-for-wp' );?></div>
758
+ </td>
759
+ </tr>
760
+ <tr>
761
+ <td colspan="2" class="gadwp-settings-title">
762
+ <div class="button-primary gadwp-settings-switchoo">
763
+ <input type="checkbox" name="options[ga_optout]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_optout" <?php checked( $options['ga_optout'], 1 ); ?>>
764
+ <label class="gadwp-settings-switchoo-label" for="ga_optout">
765
+ <div class="gadwp-settings-switchoo-inner"></div>
766
+ <div class="gadwp-settings-switchoo-switch"></div>
767
+ </label>
768
+ </div>
769
+ <div class="switch-desc"><?php echo " ".__("enable support for user opt-out", 'google-analytics-dashboard-for-wp' );?></div>
770
+ </td>
771
+ </tr>
772
+ <tr>
773
+ <td colspan="2" class="gadwp-settings-title">
774
+ <div class="button-primary gadwp-settings-switchoo">
775
+ <input type="checkbox" name="options[ga_dnt_optout]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_dnt_optout" <?php checked( $options['ga_dnt_optout'], 1 ); ?>>
776
+ <label class="gadwp-settings-switchoo-label" for="ga_dnt_optout">
777
+ <div class="gadwp-settings-switchoo-inner"></div>
778
+ <div class="gadwp-settings-switchoo-switch"></div>
779
+ </label>
780
+ </div>
781
+ <div class="switch-desc"> <?php _e( 'exclude tracking for users sending Do Not Track header', 'google-analytics-dashboard-for-wp' ); ?></div>
782
+ </td>
783
+ </tr>
784
+ <tr>
785
+ <td colspan="2" class="gadwp-settings-title">
786
+ <div class="button-primary gadwp-settings-switchoo">
787
+ <input type="checkbox" name="options[ga_remarketing]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_remarketing" <?php checked( $options['ga_remarketing'], 1 ); ?>>
788
+ <label class="gadwp-settings-switchoo-label" for="ga_remarketing">
789
+ <div class="gadwp-settings-switchoo-inner"></div>
790
+ <div class="gadwp-settings-switchoo-switch"></div>
791
+ </label>
792
+ </div>
793
+ <div class="switch-desc"><?php echo " ".__("enable remarketing, demographics and interests reports", 'google-analytics-dashboard-for-wp' );?></div>
794
+ </td>
795
+ </tr>
796
+ <tr>
797
+ <td colspan="2" class="gadwp-settings-title">
798
+ <div class="button-primary gadwp-settings-switchoo">
799
+ <input type="checkbox" name="options[ga_event_bouncerate]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_event_bouncerate" <?php checked( $options['ga_event_bouncerate'], 1 ); ?>>
800
+ <label class="gadwp-settings-switchoo-label" for="ga_event_bouncerate">
801
+ <div class="gadwp-settings-switchoo-inner"></div>
802
+ <div class="gadwp-settings-switchoo-switch"></div>
803
+ </label>
804
+ </div>
805
+ <div class="switch-desc"><?php echo " ".__("exclude events from bounce-rate and time on page calculation", 'google-analytics-dashboard-for-wp' );?></div>
806
+ </td>
807
+ </tr>
808
+ <tr>
809
+ <td colspan="2" class="gadwp-settings-title">
810
+ <div class="button-primary gadwp-settings-switchoo">
811
+ <input type="checkbox" name="options[ga_enhanced_links]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_enhanced_links" <?php checked( $options['ga_enhanced_links'], 1 ); ?>>
812
+ <label class="gadwp-settings-switchoo-label" for="ga_enhanced_links">
813
+ <div class="gadwp-settings-switchoo-inner"></div>
814
+ <div class="gadwp-settings-switchoo-switch"></div>
815
+ </label>
816
+ </div>
817
+ <div class="switch-desc"><?php echo " ".__("enable enhanced link attribution", 'google-analytics-dashboard-for-wp' );?></div>
818
+ </td>
819
+ </tr>
820
+ <tr>
821
+ <td colspan="2" class="gadwp-settings-title">
822
+ <div class="button-primary gadwp-settings-switchoo">
823
+ <input type="checkbox" name="options[ga_event_precision]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_event_precision" <?php checked( $options['ga_event_precision'], 1 ); ?>>
824
+ <label class="gadwp-settings-switchoo-label" for="ga_event_precision">
825
+ <div class="gadwp-settings-switchoo-inner"></div>
826
+ <div class="gadwp-settings-switchoo-switch"></div>
827
+ </label>
828
+ </div>
829
+ <div class="switch-desc"><?php echo " ".__("use hitCallback to increase event tracking accuracy", 'google-analytics-dashboard-for-wp' );?></div>
830
+ </td>
831
+ </tr>
832
+ <tr>
833
+ <td colspan="2" class="gadwp-settings-title">
834
+ <div class="button-primary gadwp-settings-switchoo">
835
+ <input type="checkbox" name="options[ga_force_ssl]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_force_ssl" <?php checked( $options['ga_force_ssl'] || $options['ga_with_gtag'], 1 ); ?> <?php disabled( $options['ga_with_gtag'], true );?>>
836
+ <label class="gadwp-settings-switchoo-label" for="ga_force_ssl">
837
+ <div class="gadwp-settings-switchoo-inner"></div>
838
+ <div class="gadwp-settings-switchoo-switch"></div>
839
+ </label>
840
+ </div>
841
+ <div class="switch-desc"><?php echo " ".__("enable Force SSL", 'google-analytics-dashboard-for-wp' );?></div>
842
+ </td>
843
+ </tr>
844
+ <tr>
845
+ <td colspan="2"><?php echo "<h2>" . __( "Cross-domain Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
846
+ </tr>
847
+ <tr>
848
+ <td colspan="2" class="gadwp-settings-title">
849
+ <div class="button-primary gadwp-settings-switchoo">
850
+ <input type="checkbox" name="options[ga_crossdomain_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_crossdomain_tracking" <?php checked( $options['ga_crossdomain_tracking'], 1 ); ?>>
851
+ <label class="gadwp-settings-switchoo-label" for="ga_crossdomain_tracking">
852
+ <div class="gadwp-settings-switchoo-inner"></div>
853
+ <div class="gadwp-settings-switchoo-switch"></div>
854
+ </label>
855
+ </div>
856
+ <div class="switch-desc"><?php echo " ".__("enable cross domain tracking", 'google-analytics-dashboard-for-wp' ); ?></div>
857
+ </td>
858
+ </tr>
859
+ <tr>
860
+ <td class="gadwp-settings-title">
861
+ <label for="ga_crossdomain_list"><?php _e("Cross Domains:", 'google-analytics-dashboard-for-wp'); ?>
862
+ </label>
863
+ </td>
864
+ <td>
865
+ <input type="text" id="ga_crossdomain_list" name="options[ga_crossdomain_list]" value="<?php echo esc_attr($options['ga_crossdomain_list']); ?>" size="50">
866
+ </td>
867
+ </tr>
868
+ <tr>
869
+ <td colspan="2"><?php echo "<h2>" . __( "Cookie Customization", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
870
+ </tr>
871
+ <tr>
872
+ <td class="gadwp-settings-title">
873
+ <label for="ga_cookiedomain"><?php _e("Cookie Domain:", 'google-analytics-dashboard-for-wp'); ?>
874
+ </label>
875
+ </td>
876
+ <td>
877
+ <input type="text" id="ga_cookiedomain" name="options[ga_cookiedomain]" value="<?php echo esc_attr($options['ga_cookiedomain']); ?>" size="50">
878
+ </td>
879
+ </tr>
880
+ <tr>
881
+ <td class="gadwp-settings-title">
882
+ <label for="ga_cookiename"><?php _e("Cookie Name:", 'google-analytics-dashboard-for-wp'); ?>
883
+ </label>
884
+ </td>
885
+ <td>
886
+ <input type="text" id="ga_cookiename" name="options[ga_cookiename]" value="<?php echo esc_attr($options['ga_cookiename']); ?>" size="50">
887
+ </td>
888
+ </tr>
889
+ <tr>
890
+ <td class="gadwp-settings-title">
891
+ <label for="ga_cookieexpires"><?php _e("Cookie Expires:", 'google-analytics-dashboard-for-wp'); ?>
892
+ </label>
893
+ </td>
894
+ <td>
895
+ <input type="text" id="ga_cookieexpires" name="options[ga_cookieexpires]" value="<?php echo esc_attr($options['ga_cookieexpires']); ?>" size="10">
896
+ <?php _e("seconds", 'google-analytics-dashboard-for-wp' ); ?>
897
+ </td>
898
+ </tr>
899
+ </table>
900
+ </div>
901
+ <div id="gadwp-integration">
902
+ <table class="gadwp-settings-options">
903
+ <tr>
904
+ <td colspan="2"><?php echo "<h2>" . __( "Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
905
+ </tr>
906
+ <tr>
907
+ <td colspan="2" class="gadwp-settings-title">
908
+ <div class="button-primary gadwp-settings-switchoo">
909
+ <input type="checkbox" name="options[amp_tracking_analytics]" value="1" class="gadwp-settings-switchoo-checkbox" id="amp_tracking_analytics" <?php checked( $options['amp_tracking_analytics'], 1 ); ?>>
910
+ <label class="gadwp-settings-switchoo-label" for="amp_tracking_analytics">
911
+ <div class="gadwp-settings-switchoo-inner"></div>
912
+ <div class="gadwp-settings-switchoo-switch"></div>
913
+ </label>
914
+ </div>
915
+ <div class="switch-desc"><?php echo " ".__("enable tracking for Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' );?></div>
916
+ </td>
917
+ </tr>
918
+ <tr>
919
+ <td colspan="2" class="gadwp-settings-title">
920
+ <div class="button-primary gadwp-settings-switchoo">
921
+ <input type="checkbox" name="options[amp_tracking_clientidapi]" value="1" class="gadwp-settings-switchoo-checkbox" id="amp_tracking_clientidapi" <?php checked( $options['amp_tracking_clientidapi'] && !$options['ga_with_gtag'], 1 ); ?> <?php disabled( $options['ga_with_gtag'], true );?>>
922
+ <label class="gadwp-settings-switchoo-label" for="amp_tracking_clientidapi">
923
+ <div class="gadwp-settings-switchoo-inner"></div>
924
+ <div class="gadwp-settings-switchoo-switch"></div>
925
+ </label>
926
+ </div>
927
+ <div class="switch-desc"><?php echo " ".__("enable Google AMP Client Id API", 'google-analytics-dashboard-for-wp' );?></div>
928
+ </td>
929
+ </tr>
930
+ <tr>
931
+ <td colspan="2"><?php echo "<h2>" . __( "Ecommerce", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
932
+ </tr>
933
+ <tr>
934
+ <td class="gadwp-settings-title">
935
+ <label for="tracking_type"><?php _e("Ecommerce Tracking:", 'google-analytics-dashboard-for-wp' ); ?>
936
+ </label>
937
+ </td>
938
+ <td>
939
+ <select id="ecommerce_mode" name="options[ecommerce_mode]" <?php disabled( $options['ga_with_gtag'], true );?>>
940
+ <option value="disabled" <?php selected( $options['ecommerce_mode'], 'disabled' ); ?>><?php _e("Disabled", 'google-analytics-dashboard-for-wp');?></option>
941
+ <option value="standard" <?php selected( $options['ecommerce_mode'], 'standard' ); ?>><?php _e("Ecommerce Plugin", 'google-analytics-dashboard-for-wp');?></option>
942
+ <option value="enhanced" <?php selected( $options['ecommerce_mode'], 'enhanced' ); selected( $options['ga_with_gtag'], true );?>><?php _e("Enhanced Ecommerce Plugin", 'google-analytics-dashboard-for-wp');?></option>
943
+ </select>
944
+ </td>
945
+ </tr>
946
+ <tr>
947
+ <td colspan="2"><?php echo "<h2>" . __( "Optimize", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
948
+ </tr>
949
+ <tr>
950
+ <td colspan="2" class="gadwp-settings-title">
951
+ <div class="button-primary gadwp-settings-switchoo">
952
+ <input type="checkbox" name="options[optimize_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="optimize_tracking" <?php checked( $options['optimize_tracking'], 1 ); ?>>
953
+ <label class="gadwp-settings-switchoo-label" for="optimize_tracking">
954
+ <div class="gadwp-settings-switchoo-inner"></div>
955
+ <div class="gadwp-settings-switchoo-switch"></div>
956
+ </label>
957
+ </div>
958
+ <div class="switch-desc"><?php echo " ".__("enable Optimize tracking", 'google-analytics-dashboard-for-wp' );?></div>
959
+ </td>
960
+ </tr>
961
+ <tr>
962
+ <td colspan="2" class="gadwp-settings-title">
963
+ <div class="button-primary gadwp-settings-switchoo">
964
+ <input type="checkbox" name="options[optimize_pagehiding]" value="1" class="gadwp-settings-switchoo-checkbox" id="optimize_pagehiding" <?php checked( $options['optimize_pagehiding'], 1 ); ?>>
965
+ <label class="gadwp-settings-switchoo-label" for="optimize_pagehiding">
966
+ <div class="gadwp-settings-switchoo-inner"></div>
967
+ <div class="gadwp-settings-switchoo-switch"></div>
968
+ </label>
969
+ </div>
970
+ <div class="switch-desc"><?php echo " ".__("enable Page Hiding support", 'google-analytics-dashboard-for-wp' );?></div>
971
+ </td>
972
+ </tr>
973
+ <tr>
974
+ <td class="gadwp-settings-title">
975
+ <label for="tracking_type"><?php _e("Container ID:", 'google-analytics-dashboard-for-wp' ); ?>
976
+ </label>
977
+ </td>
978
+ <td>
979
+ <input type="text" name="options[optimize_containerid]" value="<?php echo esc_attr($options['optimize_containerid']); ?>" size="15">
980
+ </td>
981
+ </tr>
982
+ </table>
983
+ </div>
984
+ <div id="gadwp-tmintegration">
985
+ <table class="gadwp-settings-options">
986
+ <tr>
987
+ <td colspan="2"><?php echo "<h2>" . __( "Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
988
+ </tr>
989
+ <tr>
990
+ <td colspan="2" class="gadwp-settings-title">
991
+ <div class="button-primary gadwp-settings-switchoo">
992
+ <input type="checkbox" name="options[amp_tracking_tagmanager]" value="1" class="gadwp-settings-switchoo-checkbox" id="amp_tracking_tagmanager" <?php checked( $options['amp_tracking_tagmanager'], 1 ); ?>>
993
+ <label class="gadwp-settings-switchoo-label" for="amp_tracking_tagmanager">
994
+ <div class="gadwp-settings-switchoo-inner"></div>
995
+ <div class="gadwp-settings-switchoo-switch"></div>
996
+ </label>
997
+ </div>
998
+ <div class="switch-desc"><?php echo " ".__("enable tracking for Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' );?></div>
999
+ </td>
1000
+ </tr>
1001
+ <tr>
1002
+ <td class="gadwp-settings-title">
1003
+ <label for="tracking_type"><?php _e("AMP Container ID:", 'google-analytics-dashboard-for-wp' ); ?>
1004
+ </label>
1005
+ </td>
1006
+ <td>
1007
+ <input type="text" name="options[amp_containerid]" value="<?php echo esc_attr($options['amp_containerid']); ?>" size="15">
1008
+ </td>
1009
+ </tr>
1010
+ </table>
1011
+ </div>
1012
+ <div id="gadwp-exclude">
1013
+ <table class="gadwp-settings-options">
1014
+ <tr>
1015
+ <td colspan="2"><?php echo "<h2>" . __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1016
+ </tr>
1017
+ <tr>
1018
+ <td class="roles gadwp-settings-title">
1019
+ <label for="track_exclude"><?php _e("Exclude tracking for:", 'google-analytics-dashboard-for-wp' ); ?></label>
1020
+ </td>
1021
+ <td class="gadwp-settings-roles">
1022
+ <table>
1023
+ <tr>
1024
+ <?php if ( ! isset( $wp_roles ) ) : ?>
1025
+ <?php $wp_roles = new WP_Roles(); ?>
1026
+ <?php endif; ?>
1027
+ <?php $i = 0; ?>
1028
+ <?php foreach ( $wp_roles->role_names as $role => $name ) : ?>
1029
+ <?php if ( 'subscriber' != $role ) : ?>
1030
+ <?php $i++; ?>
1031
+ <td>
1032
+ <label>
1033
+ <input type="checkbox" name="options[track_exclude][]" value="<?php echo $role; ?>" <?php if (in_array($role,$options['track_exclude'])) echo 'checked="checked"'; ?> /> <?php echo $name; ?>
1034
+ </label>
1035
+ </td>
1036
+ <?php endif; ?>
1037
+ <?php if ( 0 == $i % 4 ) : ?>
1038
+ </tr>
1039
+ <tr>
1040
+ <?php endif; ?>
1041
+ <?php endforeach; ?>
1042
+
1043
+
1044
+
1045
+
1046
+
1047
+
1048
+ </table>
1049
+ </td>
1050
+ </tr>
1051
+ </table>
1052
+ </div>
1053
+ <table class="gadwp-settings-options">
1054
+ <tr>
1055
+ <td colspan="2">
1056
+ <hr>
1057
+ </td>
1058
+ </tr>
1059
+ <tr>
1060
+ <td colspan="2" class="submit">
1061
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
1062
+ </td>
1063
+ </tr>
1064
+ </table>
1065
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1066
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1067
+
1068
+
1069
+
1070
+
1071
+
1072
+
1073
+ </form>
1074
+ <?php
1075
+ self::output_sidebar();
1076
+ }
1077
+
1078
+ public static function errors_debugging() {
1079
+
1080
+ $gadwp = GADWP();
1081
+
1082
+ if ( ! current_user_can( 'manage_options' ) ) {
1083
+ return;
1084
+ }
1085
+
1086
+ $anonim = GADWP_Tools::anonymize_options( $gadwp->config->options );
1087
+
1088
+ $options = self::update_options( 'frontend' );
1089
+ if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) {
1090
+ $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
1091
+ }
1092
+ ?>
1093
+ <div class="wrap">
1094
+ <?php echo "<h2>" . __( "Google Analytics Errors & Debugging", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1095
+ </div>
1096
+ <div id="poststuff" class="gadwp">
1097
+ <div id="post-body" class="metabox-holder columns-2">
1098
+ <div id="post-body-content">
1099
+ <div class="settings-wrapper">
1100
+ <div class="inside">
1101
+ <?php if (isset($message)) echo $message; ?>
1102
+ <?php $tabs = array( 'errors' => __( "Errors & Details", 'google-analytics-dashboard-for-wp' ), 'config' => __( "Plugin Settings", 'google-analytics-dashboard-for-wp' ), 'sysinfo' => __( "System", 'google-analytics-dashboard-for-wp' ) ); ?>
1103
+ <?php self::navigation_tabs( $tabs ); ?>
1104
+ <div id="gadwp-errors">
1105
+ <table class="gadwp-settings-logdata">
1106
+ <tr>
1107
+ <td>
1108
+ <?php echo "<h2>" . __( "Error Details", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1109
+ </td>
1110
+ </tr>
1111
+ <tr>
1112
+ <td>
1113
+ <?php $errors_count = GADWP_Tools::get_cache( 'errors_count' ); ?>
1114
+ <pre class="gadwp-settings-logdata"><?php echo '<span>' . __("Count: ", 'google-analytics-dashboard-for-wp') . '</span>' . (int)$errors_count;?></pre>
1115
+ <?php $errors = print_r( GADWP_Tools::get_cache( 'last_error' ), true ) ? esc_html( print_r( GADWP_Tools::get_cache( 'last_error' ), true ) ) : ''; ?>
1116
+ <?php $errors = str_replace( 'Deconf_', 'Google_', $errors); ?>
1117
+ <pre class="gadwp-settings-logdata"><?php echo '<span>' . __("Last Error: ", 'google-analytics-dashboard-for-wp') . '</span>' . "\n" . $errors;?></pre>
1118
+ <pre class="gadwp-settings-logdata"><?php echo '<span>' . __("GAPI Error: ", 'google-analytics-dashboard-for-wp') . '</span>'; echo "\n" . esc_html( print_r( GADWP_Tools::get_cache( 'gapi_errors' ), true ) ) ?></pre>
1119
+ <br />
1120
+ <hr>
1121
+ </td>
1122
+ </tr>
1123
+ <tr>
1124
+ <td>
1125
+ <?php echo "<h2>" . __( "Sampled Data", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1126
+ </td>
1127
+ </tr>
1128
+ <tr>
1129
+ <td>
1130
+ <?php $sampling = GADWP_TOOLS::get_cache( 'sampleddata' ); ?>
1131
+ <?php if ( $sampling ) :?>
1132
+ <?php printf( __( "Last Detected on %s.", 'google-analytics-dashboard-for-wp' ), '<strong>'. $sampling['date'] . '</strong>' );?>
1133
+ <br />
1134
+ <?php printf( __( "The report was based on %s of sessions.", 'google-analytics-dashboard-for-wp' ), '<strong>'. $sampling['percent'] . '</strong>' );?>
1135
+ <br />
1136
+ <?php printf( __( "Sessions ratio: %s.", 'google-analytics-dashboard-for-wp' ), '<strong>'. $sampling['sessions'] . '</strong>' ); ?>
1137
+ <?php else :?>
1138
+ <?php _e( "None", 'google-analytics-dashboard-for-wp' ); ?>
1139
+ <?php endif;?>
1140
+ </td>
1141
+ </tr>
1142
+ </table>
1143
+ </div>
1144
+ <div id="gadwp-config">
1145
+ <table class="gadwp-settings-options">
1146
+ <tr>
1147
+ <td><?php echo "<h2>" . __( "Plugin Configuration", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1148
+ </tr>
1149
+ <tr>
1150
+ <td>
1151
+ <pre class="gadwp-settings-logdata"><?php echo esc_html(print_r($anonim, true));?></pre>
1152
+ <br />
1153
+ <hr>
1154
+ </td>
1155
+ </tr>
1156
+ </table>
1157
+ </div>
1158
+ <div id="gadwp-sysinfo">
1159
+ <table class="gadwp-settings-options">
1160
+ <tr>
1161
+ <td><?php echo "<h2>" . __( "System Information", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1162
+ </tr>
1163
+ <tr>
1164
+ <td>
1165
+ <pre class="gadwp-settings-logdata"><?php echo esc_html(GADWP_Tools::system_info());?></pre>
1166
+ <br />
1167
+ <hr>
1168
+ </td>
1169
+ </tr>
1170
+ </table>
1171
+ </div>
1172
+ <?php
1173
+ self::output_sidebar();
1174
+ }
1175
+
1176
+ public static function general_settings() {
1177
+ $gadwp = GADWP();
1178
+
1179
+ if ( ! current_user_can( 'manage_options' ) ) {
1180
+ return;
1181
+ }
1182
+ $options = self::update_options( 'general' );
1183
+ printf( '<div id="gapi-warning" class="updated"><p>%1$s <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=general_screen&utm_campaign=gadwp">%2$s</a></p></div>', __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'google-analytics-dashboard-for-wp' ), __( 'Library conflicts between WordPress plugins', 'google-analytics-dashboard-for-wp' ) );
1184
+ if ( null === $gadwp->gapi_controller ) {
1185
+ $gadwp->gapi_controller = new GADWP_GAPI_Controller();
1186
+ }
1187
+ echo '<script type="text/javascript">jQuery("#gapi-warning").hide()</script>';
1188
+ if ( isset( $_POST['gadwp_access_code'] ) ) {
1189
+ if ( 1 == ! stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) && $_POST['gadwp_access_code'] != get_option( 'gadwp_redeemed_code' ) ) {
1190
+ try {
1191
+ $gadwp_access_code = $_POST['gadwp_access_code'];
1192
+ update_option( 'gadwp_redeemed_code', $gadwp_access_code );
1193
+ GADWP_Tools::delete_cache( 'gapi_errors' );
1194
+ GADWP_Tools::delete_cache( 'last_error' );
1195
+ $gadwp->gapi_controller->client->authenticate( $_POST['gadwp_access_code'] );
1196
+ $gadwp->config->options['token'] = $gadwp->gapi_controller->client->getAccessToken();
1197
+ $gadwp->config->options['automatic_updates_minorversion'] = 1;
1198
+ $gadwp->config->set_plugin_options();
1199
+ $options = self::update_options( 'general' );
1200
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Plugin authorization succeeded.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1201
+ if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) {
1202
+ if ( ! empty( $gadwp->config->options['ga_profiles_list'] ) ) {
1203
+ $profiles = $gadwp->config->options['ga_profiles_list'];
1204
+ } else {
1205
+ $profiles = $gadwp->gapi_controller->refresh_profiles();
1206
+ }
1207
+ if ( $profiles ) {
1208
+ $gadwp->config->options['ga_profiles_list'] = $profiles;
1209
+ if ( ! $gadwp->config->options['tableid_jail'] ) {
1210
+ $profile = GADWP_Tools::guess_default_domain( $profiles );
1211
+ $gadwp->config->options['tableid_jail'] = $profile;
1212
+ }
1213
+ $gadwp->config->set_plugin_options();
1214
+ $options = self::update_options( 'general' );
1215
+ }
1216
+ }
1217
+ } catch ( Deconf_IO_Exception $e ) {
1218
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1219
+ GADWP_Tools::set_error( $e, $timeout );
1220
+ } catch ( Deconf_Service_Exception $e ) {
1221
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1222
+ GADWP_Tools::set_error( $e, $timeout );
1223
+ } catch ( Exception $e ) {
1224
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1225
+ GADWP_Tools::set_error( $e, $timeout );
1226
+ $gadwp->gapi_controller->reset_token( true );
1227
+ }
1228
+ } else {
1229
+ if ( 1 == stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) ) {
1230
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "The access code is <strong>not</strong> your <strong>Tracking ID</strong> (UA-XXXXX-X) <strong>nor</strong> your <strong>email address</strong>!", 'google-analytics-dashboard-for-wp' ) . ".</p></div>";
1231
+ } else {
1232
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "You can only use the access code <strong>once</strong>, please generate a <strong>new access</strong> code following the instructions!", 'google-analytics-dashboard-for-wp' ) . ".</p></div>";
1233
+ }
1234
+ }
1235
+ }
1236
+ if ( isset( $_POST['Clear'] ) ) {
1237
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1238
+ GADWP_Tools::clear_cache();
1239
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Cleared Cache.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1240
+ } else {
1241
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1242
+ }
1243
+ }
1244
+ if ( isset( $_POST['Reset'] ) ) {
1245
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1246
+ $gadwp->gapi_controller->reset_token( true );
1247
+ GADWP_Tools::clear_cache();
1248
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Token Reseted and Revoked.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1249
+ $options = self::update_options( 'Reset' );
1250
+ } else {
1251
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1252
+ }
1253
+ }
1254
+ if ( isset( $_POST['Reset_Err'] ) ) {
1255
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1256
+
1257
+ if ( GADWP_Tools::get_cache( 'gapi_errors' ) || GADWP_Tools::get_cache( 'last_error' ) ) {
1258
+
1259
+ $info = GADWP_Tools::system_info();
1260
+ $info .= 'GADWP Version: ' . GADWP_CURRENT_VERSION;
1261
+
1262
+ $sep = "\n---------------------------\n";
1263
+ $error_report = GADWP_Tools::get_cache( 'last_error' );
1264
+ $error_report .= $sep . print_r( GADWP_Tools::get_cache( 'gapi_errors' ), true );
1265
+ $error_report .= $sep . GADWP_Tools::get_cache( 'errors_count' );
1266
+ $error_report .= $sep . $info;
1267
+
1268
+ $error_report = urldecode( $error_report );
1269
+
1270
+ $url = GADWP_ENDPOINT_URL . 'gadwp-report.php';
1271
+ /* @formatter:off */
1272
+ $response = wp_remote_post( $url, array(
1273
+ 'method' => 'POST',
1274
+ 'timeout' => 45,
1275
+ 'redirection' => 5,
1276
+ 'httpversion' => '1.0',
1277
+ 'blocking' => true,
1278
+ 'headers' => array(),
1279
+ 'body' => array( 'error_report' => $error_report ),
1280
+ 'cookies' => array()
1281
+ )
1282
+ );
1283
+ }
1284
+
1285
+ /* @formatter:on */
1286
+ GADWP_Tools::delete_cache( 'last_error' );
1287
+ GADWP_Tools::delete_cache( 'gapi_errors' );
1288
+ delete_option( 'gadwp_got_updated' );
1289
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "All errors reseted.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1290
+ } else {
1291
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1292
+ }
1293
+ }
1294
+ if ( isset( $_POST['options']['gadwp_hidden'] ) && ! isset( $_POST['Clear'] ) && ! isset( $_POST['Reset'] ) && ! isset( $_POST['Reset_Err'] ) ) {
1295
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1296
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
1297
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1298
+ }
1299
+ }
1300
+ if ( isset( $_POST['Hide'] ) ) {
1301
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1302
+ $message = "<div class='updated' id='gadwp-action'><p>" . __( "All other domains/properties were removed.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1303
+ $lock_profile = GADWP_Tools::get_selected_profile( $gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] );
1304
+ $gadwp->config->options['ga_profiles_list'] = array( $lock_profile );
1305
+ $options = self::update_options( 'general' );
1306
+ } else {
1307
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1308
+ }
1309
+ }
1310
+ ?>
1311
+ <div class="wrap">
1312
+ <?php echo "<h2>" . __( "Google Analytics Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1313
+ <hr>
1314
+ </div>
1315
+ <div id="poststuff" class="gadwp">
1316
+ <div id="post-body" class="metabox-holder columns-2">
1317
+ <div id="post-body-content">
1318
+ <div class="settings-wrapper">
1319
+ <div class="inside">
1320
+ <?php if ( $gadwp->gapi_controller->gapi_errors_handler() || GADWP_Tools::get_cache( 'last_error' ) ) : ?>
1321
+ <?php $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );?>
1322
+ <?php endif;?>
1323
+ <?php if ( isset( $_POST['Authorize'] ) ) : ?>
1324
+ <?php GADWP_Tools::clear_cache(); ?>
1325
+ <?php $gadwp->gapi_controller->token_request(); ?>
1326
+ <div class="updated">
1327
+ <p><?php _e( "Use the red link (see below) to generate and get your access code! You need to generate a new code each time you authorize!", 'google-analytics-dashboard-for-wp' )?></p>
1328
+ </div>
1329
+ <?php else : ?>
1330
+ <?php if ( isset( $message ) ) :?>
1331
+ <?php echo $message;?>
1332
+ <?php endif; ?>
1333
+ <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
1334
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1335
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1336
+ <table class="gadwp-settings-options">
1337
+ <tr>
1338
+ <td colspan="2">
1339
+ <?php echo "<h2>" . __( "Plugin Authorization", 'google-analytics-dashboard-for-wp' ) . "</h2>";?>
1340
+ </td>
1341
+ </tr>
1342
+ <tr>
1343
+ <td colspan="2" class="gadwp-settings-info">
1344
+ <?php printf(__('You need to create a %1$s and watch this %2$s before proceeding to authorization.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://deconf.com/creating-a-google-analytics-account/?utm_source=gadwp_config&utm_medium=link&utm_content=top_tutorial&utm_campaign=gadwp', __("free analytics account", 'google-analytics-dashboard-for-wp')), sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=top_video&utm_campaign=gadwp', __("video tutorial", 'google-analytics-dashboard-for-wp')));?>
1345
+ </td>
1346
+ </tr>
1347
+ <?php if (! $options['token'] || ($options['user_api'] && ! $options['network_mode'])) : ?>
1348
+ <tr>
1349
+ <td colspan="2" class="gadwp-settings-info">
1350
+ <input name="options[user_api]" type="checkbox" id="user_api" value="1" <?php checked( $options['user_api'], 1 ); ?> onchange="this.form.submit()" <?php echo ($options['network_mode'])?'disabled="disabled"':''; ?> /><?php echo " ".__("developer mode (requires advanced API knowledge)", 'google-analytics-dashboard-for-wp' );?>
1351
+ </td>
1352
+ </tr>
1353
+ <?php endif; ?>
1354
+ <?php if ($options['user_api'] && ! $options['network_mode']) : ?>
1355
+ <tr>
1356
+ <td class="gadwp-settings-title">
1357
+ <label for="options[client_id]"><?php _e("Client ID:", 'google-analytics-dashboard-for-wp'); ?></label>
1358
+ </td>
1359
+ <td>
1360
+ <input type="text" name="options[client_id]" value="<?php echo esc_attr($options['client_id']); ?>" size="40" required="required">
1361
+ </td>
1362
+ </tr>
1363
+ <tr>
1364
+ <td class="gadwp-settings-title">
1365
+ <label for="options[client_secret]"><?php _e("Client Secret:", 'google-analytics-dashboard-for-wp'); ?></label>
1366
+ </td>
1367
+ <td>
1368
+ <input type="text" name="options[client_secret]" value="<?php echo esc_attr($options['client_secret']); ?>" size="40" required="required">
1369
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1370
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1371
+ </td>
1372
+ </tr>
1373
+ <?php endif; ?>
1374
+ <?php if ( $options['token'] ) : ?>
1375
+ <tr>
1376
+ <td colspan="2">
1377
+ <input type="submit" name="Reset" class="button button-secondary" value="<?php _e( "Clear Authorization", 'google-analytics-dashboard-for-wp' ); ?>" <?php echo $options['network_mode']?'disabled="disabled"':''; ?> />
1378
+ <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'google-analytics-dashboard-for-wp' ); ?>" />
1379
+ <input type="submit" name="Reset_Err" class="button button-secondary" value="<?php _e( "Report & Reset Errors", 'google-analytics-dashboard-for-wp' ); ?>" />
1380
+ </td>
1381
+ </tr>
1382
+ <tr>
1383
+ <td colspan="2">
1384
+ <hr>
1385
+ </td>
1386
+ </tr>
1387
+ <tr>
1388
+ <td colspan="2"><?php echo "<h2>" . __( "General Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1389
+ </tr>
1390
+ <tr>
1391
+ <td class="gadwp-settings-title">
1392
+ <label for="tableid_jail"><?php _e("Select View:", 'google-analytics-dashboard-for-wp' ); ?></label>
1393
+ </td>
1394
+ <td>
1395
+ <select id="tableid_jail" <?php disabled(empty($options['ga_profiles_list']) || 1 == count($options['ga_profiles_list']), true); ?> name="options[tableid_jail]">
1396
+ <?php if ( ! empty( $options['ga_profiles_list'] ) ) : ?>
1397
+ <?php foreach ( $options['ga_profiles_list'] as $items ) : ?>
1398
+ <?php if ( $items[3] ) : ?>
1399
+ <option value="<?php echo esc_attr( $items[1] ); ?>" <?php selected( $items[1], $options['tableid_jail'] ); ?> title="<?php _e( "View Name:", 'google-analytics-dashboard-for-wp' ); ?> <?php echo esc_attr( $items[0] ); ?>">
1400
+ <?php echo esc_html( GADWP_Tools::strip_protocol( $items[3] ) )?> &#8658; <?php echo esc_attr( $items[0] ); ?>
1401
+ </option>
1402
+ <?php endif; ?>
1403
+ <?php endforeach; ?>
1404
+ <?php else : ?>
1405
+ <option value=""><?php _e( "Property not found", 'google-analytics-dashboard-for-wp' ); ?></option>
1406
+ <?php endif; ?>
1407
+ </select>
1408
+ <?php if ( count( $options['ga_profiles_list'] ) > 1 ) : ?>
1409
+ &nbsp;<input type="submit" name="Hide" class="button button-secondary" value="<?php _e( "Lock Selection", 'google-analytics-dashboard-for-wp' ); ?>" />
1410
+ <?php endif; ?>
1411
+ </td>
1412
+ </tr>
1413
+ <?php if ( $options['tableid_jail'] ) : ?>
1414
+ <tr>
1415
+ <td class="gadwp-settings-title"></td>
1416
+ <td>
1417
+ <?php $profile_info = GADWP_Tools::get_selected_profile( $gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] ); ?>
1418
+ <pre><?php echo __( "View Name:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[0] ) . "<br />" . __( "Tracking ID:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[2] ) . "<br />" . __( "Default URL:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[3] ) . "<br />" . __( "Time Zone:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[5] );?></pre>
1419
+ </td>
1420
+ </tr>
1421
+ <?php endif; ?>
1422
+ <tr>
1423
+ <td class="gadwp-settings-title">
1424
+ <label for="theme_color"><?php _e("Theme Color:", 'google-analytics-dashboard-for-wp' ); ?></label>
1425
+ </td>
1426
+ <td>
1427
+ <input type="text" id="theme_color" class="theme_color" name="options[theme_color]" value="<?php echo esc_attr($options['theme_color']); ?>" size="10">
1428
+ </td>
1429
+ </tr>
1430
+ <tr>
1431
+ <td colspan="2">
1432
+ <hr>
1433
+ </td>
1434
+ </tr>
1435
+ <?php if ( !is_multisite()) :?>
1436
+ <tr>
1437
+ <td colspan="2"><?php echo "<h2>" . __( "Automatic Updates", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1438
+ </tr>
1439
+ <tr>
1440
+ <td colspan="2" class="gadwp-settings-title">
1441
+ <div class="button-primary gadwp-settings-switchoo">
1442
+ <input type="checkbox" name="options[automatic_updates_minorversion]" value="1" class="gadwp-settings-switchoo-checkbox" id="automatic_updates_minorversion" <?php checked( $options['automatic_updates_minorversion'], 1 ); ?>>
1443
+ <label class="gadwp-settings-switchoo-label" for="automatic_updates_minorversion">
1444
+ <div class="gadwp-settings-switchoo-inner"></div>
1445
+ <div class="gadwp-settings-switchoo-switch"></div>
1446
+ </label>
1447
+ </div>
1448
+ <div class="switch-desc"><?php echo " ".__( "automatic updates for minor versions (security and maintenance releases only)", 'google-analytics-dashboard-for-wp' );?></div>
1449
+ </td>
1450
+ </tr>
1451
+ <tr>
1452
+ <td colspan="2">
1453
+ <hr>
1454
+ </td>
1455
+ </tr>
1456
+ <?php endif; ?>
1457
+ <tr>
1458
+ <td colspan="2" class="submit">
1459
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
1460
+ </td>
1461
+ </tr>
1462
+ <?php else : ?>
1463
+ <tr>
1464
+ <td colspan="2">
1465
+ <hr>
1466
+ </td>
1467
+ </tr>
1468
+ <tr>
1469
+ <td colspan="2">
1470
+ <input type="submit" name="Authorize" class="button button-secondary" id="authorize" value="<?php _e( "Authorize Plugin", 'google-analytics-dashboard-for-wp' ); ?>" <?php echo $options['network_mode']?'disabled="disabled"':''; ?> />
1471
+ <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'google-analytics-dashboard-for-wp' ); ?>" />
1472
+ </td>
1473
+ </tr>
1474
+ <tr>
1475
+ <td colspan="2">
1476
+ <hr>
1477
+ </td>
1478
+ </tr>
1479
+ </table>
1480
+ </form>
1481
+ <?php self::output_sidebar(); ?>
1482
+ <?php return; ?>
1483
+ <?php endif; ?>
1484
+ </table>
1485
+ </form>
1486
+ <?php endif; ?>
1487
+ <?php
1488
+
1489
+ self::output_sidebar();
1490
+ }
1491
+
1492
+ // Network Settings
1493
+ public static function general_settings_network() {
1494
+ $gadwp = GADWP();
1495
+
1496
+ if ( ! current_user_can( 'manage_network_options' ) ) {
1497
+ return;
1498
+ }
1499
+ $options = self::update_options( 'network' );
1500
+ /*
1501
+ * Include GAPI
1502
+ */
1503
+ echo '<div id="gapi-warning" class="updated"><p>' . __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'google-analytics-dashboard-for-wp' ) . ' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=general_screen&utm_campaign=gadwp">Library conflicts between WordPress plugins</a></p></div>';
1504
+
1505
+ if ( null === $gadwp->gapi_controller ) {
1506
+ $gadwp->gapi_controller = new GADWP_GAPI_Controller();
1507
+ }
1508
+
1509
+ echo '<script type="text/javascript">jQuery("#gapi-warning").hide()</script>';
1510
+ if ( isset( $_POST['gadwp_access_code'] ) ) {
1511
+ if ( 1 == ! stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) && $_POST['gadwp_access_code'] != get_option( 'gadwp_redeemed_code' ) ) {
1512
+ try {
1513
+ $gadwp_access_code = $_POST['gadwp_access_code'];
1514
+ update_option( 'gadwp_redeemed_code', $gadwp_access_code );
1515
+ $gadwp->gapi_controller->client->authenticate( $_POST['gadwp_access_code'] );
1516
+ $gadwp->config->options['token'] = $gadwp->gapi_controller->client->getAccessToken();
1517
+ $gadwp->config->options['automatic_updates_minorversion'] = 1;
1518
+ $gadwp->config->set_plugin_options( true );
1519
+ $options = self::update_options( 'network' );
1520
+ $message = "<div class='updated' id='gadwp-action'><p>" . __( "Plugin authorization succeeded.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1521
+ if ( is_multisite() ) { // Cleanup errors on the entire network
1522
+ foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) {
1523
+ switch_to_blog( $blog['blog_id'] );
1524
+ GADWP_Tools::delete_cache( 'last_error' );
1525
+ GADWP_Tools::delete_cache( 'gapi_errors' );
1526
+ restore_current_blog();
1527
+ }
1528
+ } else {
1529
+ GADWP_Tools::delete_cache( 'last_error' );
1530
+ GADWP_Tools::delete_cache( 'gapi_errors' );
1531
+ }
1532
+ if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) {
1533
+ if ( ! empty( $gadwp->config->options['ga_profiles_list'] ) ) {
1534
+ $profiles = $gadwp->config->options['ga_profiles_list'];
1535
+ } else {
1536
+ $profiles = $gadwp->gapi_controller->refresh_profiles();
1537
+ }
1538
+ if ( $profiles ) {
1539
+ $gadwp->config->options['ga_profiles_list'] = $profiles;
1540
+ if ( isset( $gadwp->config->options['tableid_jail'] ) && ! $gadwp->config->options['tableid_jail'] ) {
1541
+ $profile = GADWP_Tools::guess_default_domain( $profiles );
1542
+ $gadwp->config->options['tableid_jail'] = $profile;
1543
+ }
1544
+ $gadwp->config->set_plugin_options( true );
1545
+ $options = self::update_options( 'network' );
1546
+ }
1547
+ }
1548
+ } catch ( Deconf_IO_Exception $e ) {
1549
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1550
+ GADWP_Tools::set_error( $e, $timeout );
1551
+ } catch ( Deconf_Service_Exception $e ) {
1552
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1553
+ GADWP_Tools::set_error( $e, $timeout );
1554
+ } catch ( Exception $e ) {
1555
+ $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' );
1556
+ GADWP_Tools::set_error( $e, $timeout );
1557
+ $gadwp->gapi_controller->reset_token( true );
1558
+ }
1559
+ } else {
1560
+ if ( 1 == stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) ) {
1561
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "The access code is <strong>not</strong> your <strong>Tracking ID</strong> (UA-XXXXX-X) <strong>nor</strong> your <strong>email address</strong>!", 'google-analytics-dashboard-for-wp' ) . ".</p></div>";
1562
+ } else {
1563
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "You can only use the access code <strong>once</strong>, please generate a <strong>new access code</strong> using the red link", 'google-analytics-dashboard-for-wp' ) . "!</p></div>";
1564
+ }
1565
+ }
1566
+ }
1567
+ if ( isset( $_POST['Refresh'] ) ) {
1568
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1569
+ $gadwp->config->options['ga_profiles_list'] = array();
1570
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Properties refreshed.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1571
+ $options = self::update_options( 'network' );
1572
+ if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) {
1573
+ if ( ! empty( $gadwp->config->options['ga_profiles_list'] ) ) {
1574
+ $profiles = $gadwp->config->options['ga_profiles_list'];
1575
+ } else {
1576
+ $profiles = $gadwp->gapi_controller->refresh_profiles();
1577
+ }
1578
+ if ( $profiles ) {
1579
+ $gadwp->config->options['ga_profiles_list'] = $profiles;
1580
+ if ( isset( $gadwp->config->options['tableid_jail'] ) && ! $gadwp->config->options['tableid_jail'] ) {
1581
+ $profile = GADWP_Tools::guess_default_domain( $profiles );
1582
+ $gadwp->config->options['tableid_jail'] = $profile;
1583
+ }
1584
+ $gadwp->config->set_plugin_options( true );
1585
+ $options = self::update_options( 'network' );
1586
+ }
1587
+ }
1588
+ } else {
1589
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1590
+ }
1591
+ }
1592
+ if ( isset( $_POST['Clear'] ) ) {
1593
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1594
+ GADWP_Tools::clear_cache();
1595
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Cleared Cache.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1596
+ } else {
1597
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1598
+ }
1599
+ }
1600
+ if ( isset( $_POST['Reset'] ) ) {
1601
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1602
+ $gadwp->gapi_controller->reset_token( true );
1603
+ GADWP_Tools::clear_cache();
1604
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Token Reseted and Revoked.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1605
+ $options = self::update_options( 'Reset' );
1606
+ } else {
1607
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1608
+ }
1609
+ }
1610
+ if ( isset( $_POST['options']['gadwp_hidden'] ) && ! isset( $_POST['Clear'] ) && ! isset( $_POST['Reset'] ) && ! isset( $_POST['Refresh'] ) ) {
1611
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1612
+ if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
1613
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1614
+ }
1615
+ }
1616
+ if ( isset( $_POST['Hide'] ) ) {
1617
+ if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) {
1618
+ $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "All other domains/properties were removed.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1619
+ $lock_profile = GADWP_Tools::get_selected_profile( $gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] );
1620
+ $gadwp->config->options['ga_profiles_list'] = array( $lock_profile );
1621
+ $options = self::update_options( 'network' );
1622
+ } else {
1623
+ $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
1624
+ }
1625
+ }
1626
+ ?>
1627
+ <div class="wrap">
1628
+ <h2><?php _e( "Google Analytics Settings", 'google-analytics-dashboard-for-wp' );?></h2>
1629
+ <hr>
1630
+ </div>
1631
+ <div id="poststuff" class="gadwp">
1632
+ <div id="post-body" class="metabox-holder columns-2">
1633
+ <div id="post-body-content">
1634
+ <div class="settings-wrapper">
1635
+ <div class="inside">
1636
+ <?php if ( $gadwp->gapi_controller->gapi_errors_handler() || GADWP_Tools::get_cache( 'last_error' ) ) : ?>
1637
+ <?php $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );?>
1638
+ <?php endif; ?>
1639
+ <?php if ( isset( $_POST['Authorize'] ) ) : ?>
1640
+ <?php GADWP_Tools::clear_cache();?>
1641
+ <?php $gadwp->gapi_controller->token_request();?>
1642
+ <div class="updated">
1643
+ <p><?php _e( "Use the red link (see below) to generate and get your access code! You need to generate a new code each time you authorize!", 'google-analytics-dashboard-for-wp' );?></p>
1644
+ </div>
1645
+ <?php else : ?>
1646
+ <?php if ( isset( $message ) ) : ?>
1647
+ <?php echo $message; ?>
1648
+ <?php endif; ?>
1649
+ <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
1650
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1651
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1652
+ <table class="gadwp-settings-options">
1653
+ <tr>
1654
+ <td colspan="2">
1655
+ <?php echo "<h2>" . __( "Network Setup", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1656
+ </td>
1657
+ </tr>
1658
+ <tr>
1659
+ <td colspan="2" class="gadwp-settings-title">
1660
+ <div class="button-primary gadwp-settings-switchoo">
1661
+ <input type="checkbox" name="options[network_mode]" value="1" class="gadwp-settings-switchoo-checkbox" id="network_mode" <?php checked( $options['network_mode'], 1); ?> onchange="this.form.submit()">
1662
+ <label class="gadwp-settings-switchoo-label" for="network_mode">
1663
+ <div class="gadwp-settings-switchoo-inner"></div>
1664
+ <div class="gadwp-settings-switchoo-switch"></div>
1665
+ </label>
1666
+ </div>
1667
+ <div class="switch-desc"><?php echo " ".__("use a single Google Analytics account for the entire network", 'google-analytics-dashboard-for-wp' );?></div>
1668
+ </td>
1669
+ </tr>
1670
+ <?php if ($options['network_mode']) : ?>
1671
+ <tr>
1672
+ <td colspan="2">
1673
+ <hr>
1674
+ </td>
1675
+ </tr>
1676
+ <tr>
1677
+ <td colspan="2"><?php echo "<h2>" . __( "Plugin Authorization", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1678
+ </tr>
1679
+ <tr>
1680
+ <td colspan="2" class="gadwp-settings-info">
1681
+ <?php printf(__('You need to create a %1$s and watch this %2$s before proceeding to authorization.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://deconf.com/creating-a-google-analytics-account/?utm_source=gadwp_config&utm_medium=link&utm_content=top_tutorial&utm_campaign=gadwp', __("free analytics account", 'google-analytics-dashboard-for-wp')), sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=top_video&utm_campaign=gadwp', __("video tutorial", 'google-analytics-dashboard-for-wp')));?>
1682
+ </td>
1683
+ </tr>
1684
+ <?php if ( ! $options['token'] || $options['user_api'] ) : ?>
1685
+ <tr>
1686
+ <td colspan="2" class="gadwp-settings-info">
1687
+ <input name="options[user_api]" type="checkbox" id="user_api" value="1" <?php checked( $options['user_api'], 1 ); ?> onchange="this.form.submit()" /><?php echo " ".__("developer mode (requires advanced API knowledge)", 'google-analytics-dashboard-for-wp' );?>
1688
+ </td>
1689
+ </tr>
1690
+ <?php endif; ?>
1691
+ <?php if ( $options['user_api'] ) : ?>
1692
+ <tr>
1693
+ <td class="gadwp-settings-title">
1694
+ <label for="options[client_id]"><?php _e("Client ID:", 'google-analytics-dashboard-for-wp'); ?>
1695
+ </label>
1696
+ </td>
1697
+ <td>
1698
+ <input type="text" name="options[client_id]" value="<?php echo esc_attr($options['client_id']); ?>" size="40" required="required">
1699
+ </td>
1700
+ </tr>
1701
+ <tr>
1702
+ <td class="gadwp-settings-title">
1703
+ <label for="options[client_secret]"><?php _e("Client Secret:", 'google-analytics-dashboard-for-wp'); ?>
1704
+ </label>
1705
+ </td>
1706
+ <td>
1707
+ <input type="text" name="options[client_secret]" value="<?php echo esc_attr($options['client_secret']); ?>" size="40" required="required">
1708
+ <input type="hidden" name="options[gadwp_hidden]" value="Y">
1709
+ <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
1710
+ </td>
1711
+ </tr>
1712
+ <?php endif; ?>
1713
+ <?php if ( $options['token'] ) : ?>
1714
+ <tr>
1715
+ <td colspan="2">
1716
+ <input type="submit" name="Reset" class="button button-secondary" value="<?php _e( "Clear Authorization", 'google-analytics-dashboard-for-wp' ); ?>" />
1717
+ <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'google-analytics-dashboard-for-wp' ); ?>" />
1718
+ <input type="submit" name="Refresh" class="button button-secondary" value="<?php _e( "Refresh Properties", 'google-analytics-dashboard-for-wp' ); ?>" />
1719
+ </td>
1720
+ </tr>
1721
+ <tr>
1722
+ <td colspan="2">
1723
+ <hr>
1724
+ </td>
1725
+ </tr>
1726
+ <tr>
1727
+ <td colspan="2">
1728
+ <?php echo "<h2>" . __( "Properties/Views Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
1729
+ </td>
1730
+ </tr>
1731
+ <?php if ( isset( $options['network_tableid'] ) ) : ?>
1732
+ <?php $options['network_tableid'] = json_decode( json_encode( $options['network_tableid'] ), false ); ?>
1733
+ <?php endif; ?>
1734
+ <?php foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) : ?>
1735
+ <tr>
1736
+ <td class="gadwp-settings-title-s">
1737
+ <label for="network_tableid"><?php echo '<strong>'.$blog['domain'].$blog['path'].'</strong>: ';?></label>
1738
+ </td>
1739
+ <td>
1740
+ <select id="network_tableid" <?php disabled(!empty($options['ga_profiles_list']),false);?> name="options[network_tableid][<?php echo $blog['blog_id'];?>]">
1741
+ <?php if ( ! empty( $options['ga_profiles_list'] ) ) : ?>
1742
+ <?php foreach ( $options['ga_profiles_list'] as $items ) : ?>
1743
+ <?php if ( $items[3] ) : ?>
1744
+ <?php $temp_id = $blog['blog_id']; ?>
1745
+ <option value="<?php echo esc_attr( $items[1] );?>" <?php selected( $items[1], isset( $options['network_tableid']->$temp_id ) ? $options['network_tableid']->$temp_id : '');?> title="<?php echo __( "View Name:", 'google-analytics-dashboard-for-wp' ) . ' ' . esc_attr( $items[0] );?>">
1746
+ <?php echo esc_html( GADWP_Tools::strip_protocol( $items[3] ) );?> &#8658; <?php echo esc_attr( $items[0] );?>
1747
+ </option>
1748
+ <?php endif; ?>
1749
+ <?php endforeach; ?>
1750
+ <?php else : ?>
1751
+ <option value="">
1752
+ <?php _e( "Property not found", 'google-analytics-dashboard-for-wp' );?>
1753
+ </option>
1754
+ <?php endif; ?>
1755
+ </select>
1756
+ <br />
1757
+ </td>
1758
+ </tr>
1759
+ <?php endforeach; ?>
1760
+ <tr>
1761
+ <td colspan="2">
1762
+ <h2><?php echo _e( "Automatic Updates", 'google-analytics-dashboard-for-wp' );?></h2>
1763
+ </td>
1764
+ </tr>
1765
+ <tr>
1766
+ <td colspan="2" class="gadwp-settings-title">
1767
+ <div class="button-primary gadwp-settings-switchoo">
1768
+ <input type="checkbox" name="options[automatic_updates_minorversion]" value="1" class="gadwp-settings-switchoo-checkbox" id="automatic_updates_minorversion" <?php checked( $options['automatic_updates_minorversion'], 1 ); ?>>
1769
+ <label class="gadwp-settings-switchoo-label" for="automatic_updates_minorversion">
1770
+ <div class="gadwp-settings-switchoo-inner"></div>
1771
+ <div class="gadwp-settings-switchoo-switch"></div>
1772
+ </label>
1773
+ </div>
1774
+ <div class="switch-desc"><?php echo " ".__( "automatic updates for minor versions (security and maintenance releases only)", 'google-analytics-dashboard-for-wp' );?></div>
1775
+ </td>
1776
+ </tr>
1777
+ <tr>
1778
+ <td colspan="2">
1779
+ <hr><?php echo "<h2>" . __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
1780
+ </tr>
1781
+ <tr>
1782
+ <td colspan="2" class="gadwp-settings-title">
1783
+ <div class="button-primary gadwp-settings-switchoo">
1784
+ <input type="checkbox" name="options[superadmin_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="superadmin_tracking"<?php checked( $options['superadmin_tracking'], 1); ?>">
1785
+ <label class="gadwp-settings-switchoo-label" for="superadmin_tracking">
1786
+ <div class="gadwp-settings-switchoo-inner"></div>
1787
+ <div class="gadwp-settings-switchoo-switch"></div>
1788
+ </label>
1789
+ </div>
1790
+ <div class="switch-desc"><?php echo " ".__("exclude Super Admin tracking for the entire network", 'google-analytics-dashboard-for-wp' );?></div>
1791
+ </td>
1792
+ </tr>
1793
+ <tr>
1794
+ <td colspan="2">
1795
+ <hr>
1796
+ </td>
1797
+ </tr>
1798
+ <tr>
1799
+ <td colspan="2" class="submit">
1800
+ <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
1801
+ </td>
1802
+ </tr>
1803
+ <?php else : ?>
1804
+ <tr>
1805
+ <td colspan="2">
1806
+ <hr>
1807
+ </td>
1808
+ </tr>
1809
+ <tr>
1810
+ <td colspan="2">
1811
+ <input type="submit" name="Authorize" class="button button-secondary" id="authorize" value="<?php _e( "Authorize Plugin", 'google-analytics-dashboard-for-wp' ); ?>" />
1812
+ <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'google-analytics-dashboard-for-wp' ); ?>" />
1813
+ </td>
1814
+ </tr>
1815
+ <?php endif; ?>
1816
+ <tr>
1817
+ <td colspan="2">
1818
+ <hr>
1819
+ </td>
1820
+ </tr>
1821
+ </table>
1822
+ </form>
1823
+ <?php self::output_sidebar(); ?>
1824
+ <?php return; ?>
1825
+ <?php endif;?>
1826
+ </table>
1827
+ </form>
1828
+ <?php endif; ?>
1829
+ <?php
1830
+
1831
+ self::output_sidebar();
1832
+ }
1833
+
1834
+ public static function output_sidebar() {
1835
+ global $wp_version;
1836
+
1837
+ $gadwp = GADWP();
1838
+ ?>
1839
+ </div>
1840
+ </div>
1841
+ </div>
1842
+ <div id="postbox-container-1" class="postbox-container">
1843
+ <div class="meta-box-sortables">
1844
+ <div class="postbox">
1845
+ <h3>
1846
+ <span><?php _e("Setup Tutorial & Demo",'google-analytics-dashboard-for-wp') ?></span>
1847
+ </h3>
1848
+ <div class="inside">
1849
+ <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=video&utm_campaign=gadwp" target="_blank"><img src="<?php echo plugins_url( 'images/google-analytics-dashboard.png' , __FILE__ );?>" width="100%" alt="" /></a>
1850
+ </div>
1851
+ </div>
1852
+ <div class="postbox">
1853
+ <h3>
1854
+ <span><?php _e("Stay Updated",'google-analytics-dashboard-for-wp')?></span>
1855
+ </h3>
1856
+ <div class="inside">
1857
+ <div class="gadwp-desc">
1858
+ <div class="g-ytsubscribe" data-channel="TheDeConf" data-layout="default" data-count="default"></div>
1859
+ </div>
1860
+ <br />
1861
+ <div class="gadwp-desc">
1862
+ <div class="g-follow" data-annotation="bubble" data-height="24" data-href="//plus.google.com/u/0/114149166432576972465" data-rel="publisher"></div>
1863
+ <script src="https://apis.google.com/js/platform.js" async defer></script>
1864
+ </div>
1865
+ <br />
1866
+ <div class="gadwp-desc">
1867
+ <a href="https://twitter.com/deconfcom" class="twitter-follow-button" data-show-screen-name="false"></a>
1868
+ <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
1869
+ </div>
1870
+ </div>
1871
+ </div>
1872
+ <div class="postbox">
1873
+ <h3>
1874
+ <span><?php _e("Further Reading",'google-analytics-dashboard-for-wp')?></span>
1875
+ </h3>
1876
+ <div class="inside">
1877
+ <div class="gadwp-title">
1878
+ <a href="https://deconf.com/clicky-web-analytics-review/?utm_source=gadwp_config&utm_medium=link&utm_content=clicky&utm_campaign=gadwp"><img src="<?php echo plugins_url( 'images/clicky.png' , __FILE__ ); ?>" /></a>
1879
+ </div>
1880
+ <div class="gadwp-desc">
1881
+ <?php printf(__('%s service with users tracking at IP level.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="https://deconf.com/clicky-web-analytics-review/?utm_source=gadwp_config&utm_medium=link&utm_content=clicky&utm_campaign=gadwp">%s</a>', __('Web Analytics', 'google-analytics-dashboard-for-wp')));?>
1882
+ </div>
1883
+ <br />
1884
+ <div class="gadwp-title">
1885
+ <a href="https://deconf.com/move-website-https-ssl/?utm_source=gadwp_config&utm_medium=link&utm_content=ssl&utm_campaign=gadwp"><img src="<?php echo plugins_url( 'images/ssl.png' , __FILE__ ); ?>" /></a>
1886
+ </div>
1887
+ <div class="gadwp-desc">
1888
+ <?php printf(__('%s by moving your website to HTTPS/SSL.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="https://deconf.com/move-website-https-ssl/?utm_source=gadwp_config&utm_medium=link&utm_content=ssl&utm_campaign=gadwp">%s</a>', __('Improve search rankings', 'google-analytics-dashboard-for-wp')));?>
1889
+ </div>
1890
+ <br />
1891
+ <div class="gadwp-title">
1892
+ <a href="http://wordpress.org/support/view/plugin-reviews/google-analytics-dashboard-for-wp#plugin-info"><img src="<?php echo plugins_url( 'images/star.png' , __FILE__ ); ?>" /></a>
1893
+ </div>
1894
+ <div class="gadwp-desc">
1895
+ <?php printf(__('Your feedback and review are both important, %s!', 'google-analytics-dashboard-for-wp'), sprintf('<a href="http://wordpress.org/support/view/plugin-reviews/google-analytics-dashboard-for-wp#plugin-info">%s</a>', __('rate this plugin', 'google-analytics-dashboard-for-wp')));?>
1896
+ </div>
1897
+ </div>
1898
+ </div>
1899
+ </div>
1900
+ </div>
1901
+ </div>
1902
+ </div>
1903
+ <?php
1904
+ // Dismiss the admin update notice
1905
+ if ( version_compare( $wp_version, '4.2', '<' ) && current_user_can( 'manage_options' ) ) {
1906
+ delete_option( 'gadwp_got_updated' );
1907
+ }
1908
+ }
1909
+ }
tags/5.3.1/admin/setup.php ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
15
+
16
+ final class GADWP_Backend_Setup {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ // Styles & Scripts
24
+ add_action( 'admin_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
+ // Site Menu
26
+ add_action( 'admin_menu', array( $this, 'site_menu' ) );
27
+ // Network Menu
28
+ add_action( 'network_admin_menu', array( $this, 'network_menu' ) );
29
+ // Settings link
30
+ add_filter( "plugin_action_links_" . plugin_basename( GADWP_DIR . 'gadwp.php' ), array( $this, 'settings_link' ) );
31
+ // Updated admin notice
32
+ add_action( 'admin_notices', array( $this, 'admin_notice' ) );
33
+ }
34
+
35
+ /**
36
+ * Add Site Menu
37
+ */
38
+ public function site_menu() {
39
+ global $wp_version;
40
+ if ( current_user_can( 'manage_options' ) ) {
41
+ include ( GADWP_DIR . 'admin/settings.php' );
42
+ add_menu_page( __( "Google Analytics", 'google-analytics-dashboard-for-wp' ), __( "Google Analytics", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_settings', array( 'GADWP_Settings', 'general_settings' ), version_compare( $wp_version, '3.8.0', '>=' ) ? 'dashicons-chart-area' : GADWP_URL . 'admin/images/gadwp-icon.png' );
43
+ add_submenu_page( 'gadwp_settings', __( "General Settings", 'google-analytics-dashboard-for-wp' ), __( "General Settings", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_settings', array( 'GADWP_Settings', 'general_settings' ) );
44
+ add_submenu_page( 'gadwp_settings', __( "Backend Settings", 'google-analytics-dashboard-for-wp' ), __( "Backend Settings", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_backend_settings', array( 'GADWP_Settings', 'backend_settings' ) );
45
+ add_submenu_page( 'gadwp_settings', __( "Frontend Settings", 'google-analytics-dashboard-for-wp' ), __( "Frontend Settings", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_frontend_settings', array( 'GADWP_Settings', 'frontend_settings' ) );
46
+ add_submenu_page( 'gadwp_settings', __( "Tracking Code", 'google-analytics-dashboard-for-wp' ), __( "Tracking Code", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_tracking_settings', array( 'GADWP_Settings', 'tracking_settings' ) );
47
+ add_submenu_page( 'gadwp_settings', __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), 'manage_options', 'gadwp_errors_debugging', array( 'GADWP_Settings', 'errors_debugging' ) );
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Add Network Menu
53
+ */
54
+ public function network_menu() {
55
+ global $wp_version;
56
+ if ( current_user_can( 'manage_network' ) ) {
57
+ include ( GADWP_DIR . 'admin/settings.php' );
58
+ add_menu_page( __( "Google Analytics", 'google-analytics-dashboard-for-wp' ), "Google Analytics", 'manage_network', 'gadwp_settings', array( 'GADWP_Settings', 'general_settings_network' ), version_compare( $wp_version, '3.8.0', '>=' ) ? 'dashicons-chart-area' : GADWP_URL . 'admin/images/gadwp-icon.png' );
59
+ add_submenu_page( 'gadwp_settings', __( "General Settings", 'google-analytics-dashboard-for-wp' ), __( "General Settings", 'google-analytics-dashboard-for-wp' ), 'manage_network', 'gadwp_settings', array( 'GADWP_Settings', 'general_settings_network' ) );
60
+ add_submenu_page( 'gadwp_settings', __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), 'manage_network', 'gadwp_errors_debugging', array( 'GADWP_Settings', 'errors_debugging' ) );
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Styles & Scripts conditional loading (based on current URI)
66
+ *
67
+ * @param
68
+ * $hook
69
+ */
70
+ public function load_styles_scripts( $hook ) {
71
+ $new_hook = explode( '_page_', $hook );
72
+
73
+ if ( isset( $new_hook[1] ) ) {
74
+ $new_hook = '_page_' . $new_hook[1];
75
+ } else {
76
+ $new_hook = $hook;
77
+ }
78
+
79
+ /*
80
+ * GADWP main stylesheet
81
+ */
82
+ wp_enqueue_style( 'gadwp', GADWP_URL . 'admin/css/gadwp.css', null, GADWP_CURRENT_VERSION );
83
+
84
+ /*
85
+ * GADWP UI
86
+ */
87
+
88
+ if ( GADWP_Tools::get_cache( 'gapi_errors' ) ) {
89
+ $ed_bubble = '!';
90
+ } else {
91
+ $ed_bubble = '';
92
+ }
93
+
94
+ wp_enqueue_script( 'gadwp-backend-ui', plugins_url( 'js/ui.js', __FILE__ ), array( 'jquery' ), GADWP_CURRENT_VERSION, true );
95
+
96
+ /* @formatter:off */
97
+ wp_localize_script( 'gadwp-backend-ui', 'gadwp_ui_data', array(
98
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
99
+ 'security' => wp_create_nonce( 'gadwp_dismiss_notices' ),
100
+ 'ed_bubble' => $ed_bubble,
101
+ )
102
+ );
103
+ /* @formatter:on */
104
+
105
+ if ( $this->gadwp->config->options['switch_profile'] && count( $this->gadwp->config->options['ga_profiles_list'] ) > 1 ) {
106
+ $views = array();
107
+ foreach ( $this->gadwp->config->options['ga_profiles_list'] as $items ) {
108
+ if ( $items[3] ) {
109
+ $views[$items[1]] = esc_js( GADWP_Tools::strip_protocol( $items[3] ) ); // . ' &#8658; ' . $items[0] );
110
+ }
111
+ }
112
+ } else {
113
+ $views = false;
114
+ }
115
+
116
+ /*
117
+ * Main Dashboard Widgets Styles & Scripts
118
+ */
119
+ $widgets_hooks = array( 'index.php' );
120
+
121
+ if ( in_array( $new_hook, $widgets_hooks ) ) {
122
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && $this->gadwp->config->options['dashboard_widget'] ) {
123
+
124
+ if ( $this->gadwp->config->options['ga_target_geomap'] ) {
125
+ $country_codes = GADWP_Tools::get_countrycodes();
126
+ if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
127
+ $region = $this->gadwp->config->options['ga_target_geomap'];
128
+ } else {
129
+ $region = false;
130
+ }
131
+ } else {
132
+ $region = false;
133
+ }
134
+
135
+ wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
136
+
137
+ wp_enqueue_style( 'gadwp-backend-item-reports', GADWP_URL . 'admin/css/admin-widgets.css', null, GADWP_CURRENT_VERSION );
138
+
139
+ wp_register_style( 'jquery-ui-tooltip-html', GADWP_URL . 'common/realtime/jquery.ui.tooltip.html.css' );
140
+
141
+ wp_enqueue_style( 'jquery-ui-tooltip-html' );
142
+
143
+ wp_register_script( 'jquery-ui-tooltip-html', GADWP_URL . 'common/realtime/jquery.ui.tooltip.html.js' );
144
+
145
+ wp_register_script( 'googlecharts', 'https://www.gstatic.com/charts/loader.js', array(), null );
146
+
147
+ wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
148
+
149
+ wp_enqueue_script( 'gadwp-backend-dashboard-reports', GADWP_URL . 'common/js/reports5.js', array( 'jquery', 'googlecharts', 'gadwp-nprogress', 'jquery-ui-tooltip', 'jquery-ui-core', 'jquery-ui-position', 'jquery-ui-tooltip-html' ), GADWP_CURRENT_VERSION, true );
150
+
151
+ /* @formatter:off */
152
+
153
+ $datelist = array(
154
+ 'realtime' => __( "Real-Time", 'google-analytics-dashboard-for-wp' ),
155
+ 'today' => __( "Today", 'google-analytics-dashboard-for-wp' ),
156
+ 'yesterday' => __( "Yesterday", 'google-analytics-dashboard-for-wp' ),
157
+ '7daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 7 ),
158
+ '14daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 14 ),
159
+ '30daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 30 ),
160
+ '90daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 90 ),
161
+ '365daysAgo' => sprintf( _n( "%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp' ), __('One', 'google-analytics-dashboard-for-wp') ),
162
+ '1095daysAgo' => sprintf( _n( "%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp' ), __('Three', 'google-analytics-dashboard-for-wp') ),
163
+ );
164
+
165
+
166
+ if ( $this->gadwp->config->options['user_api'] && ! $this->gadwp->config->options['backend_realtime_report'] ) {
167
+ array_shift( $datelist );
168
+ }
169
+
170
+ wp_localize_script( 'gadwp-backend-dashboard-reports', 'gadwpItemData', array(
171
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
172
+ 'security' => wp_create_nonce( 'gadwp_backend_item_reports' ),
173
+ 'dateList' => $datelist,
174
+ 'reportList' => array(
175
+ 'sessions' => __( "Sessions", 'google-analytics-dashboard-for-wp' ),
176
+ 'users' => __( "Users", 'google-analytics-dashboard-for-wp' ),
177
+ 'organicSearches' => __( "Organic", 'google-analytics-dashboard-for-wp' ),
178
+ 'pageviews' => __( "Page Views", 'google-analytics-dashboard-for-wp' ),
179
+ 'visitBounceRate' => __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
180
+ 'locations' => __( "Location", 'google-analytics-dashboard-for-wp' ),
181
+ 'contentpages' => __( "Pages", 'google-analytics-dashboard-for-wp' ),
182
+ 'referrers' => __( "Referrers", 'google-analytics-dashboard-for-wp' ),
183
+ 'searches' => __( "Searches", 'google-analytics-dashboard-for-wp' ),
184
+ 'trafficdetails' => __( "Traffic", 'google-analytics-dashboard-for-wp' ),
185
+ 'technologydetails' => __( "Technology", 'google-analytics-dashboard-for-wp' ),
186
+ '404errors' => __( "404 Errors", 'google-analytics-dashboard-for-wp' ),
187
+ ),
188
+ 'i18n' => array(
189
+ __( "A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp' ), //0
190
+ __( "Traffic Mediums", 'google-analytics-dashboard-for-wp' ),
191
+ __( "Visitor Type", 'google-analytics-dashboard-for-wp' ),
192
+ __( "Search Engines", 'google-analytics-dashboard-for-wp' ),
193
+ __( "Social Networks", 'google-analytics-dashboard-for-wp' ),
194
+ __( "Sessions", 'google-analytics-dashboard-for-wp' ),
195
+ __( "Users", 'google-analytics-dashboard-for-wp' ),
196
+ __( "Page Views", 'google-analytics-dashboard-for-wp' ),
197
+ __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
198
+ __( "Organic Search", 'google-analytics-dashboard-for-wp' ),
199
+ __( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
200
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
201
+ __( "No Data", 'google-analytics-dashboard-for-wp' ),
202
+ __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
203
+ __( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
204
+ __( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . menu_page_url( 'gadwp_settings', false ) . '">' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</a>.',
205
+ __( "Browser", 'google-analytics-dashboard-for-wp' ), //16
206
+ __( "Operating System", 'google-analytics-dashboard-for-wp' ),
207
+ __( "Screen Resolution", 'google-analytics-dashboard-for-wp' ),
208
+ __( "Mobile Brand", 'google-analytics-dashboard-for-wp' ),
209
+ __( "REFERRALS", 'google-analytics-dashboard-for-wp' ), //20
210
+ __( "KEYWORDS", 'google-analytics-dashboard-for-wp' ),
211
+ __( "SOCIAL", 'google-analytics-dashboard-for-wp' ),
212
+ __( "CAMPAIGN", 'google-analytics-dashboard-for-wp' ),
213
+ __( "DIRECT", 'google-analytics-dashboard-for-wp' ),
214
+ __( "NEW", 'google-analytics-dashboard-for-wp' ), //25
215
+ __( "Time on Page", 'google-analytics-dashboard-for-wp' ),
216
+ __( "Page Load Time", 'google-analytics-dashboard-for-wp' ),
217
+ __( "Session Duration", 'google-analytics-dashboard-for-wp' ),
218
+ ),
219
+ 'rtLimitPages' => $this->gadwp->config->options['ga_realtime_pages'],
220
+ 'colorVariations' => GADWP_Tools::variations( $this->gadwp->config->options['theme_color'] ),
221
+ 'region' => $region,
222
+ 'mapsApiKey' => apply_filters( 'gadwp_maps_api_key', $this->gadwp->config->options['maps_api_key'] ),
223
+ 'language' => get_bloginfo( 'language' ),
224
+ 'viewList' => $views,
225
+ 'scope' => 'admin-widgets',
226
+ )
227
+
228
+ );
229
+ /* @formatter:on */
230
+ }
231
+ }
232
+
233
+ /*
234
+ * Posts/Pages List Styles & Scripts
235
+ */
236
+ $contentstats_hooks = array( 'edit.php' );
237
+ if ( in_array( $hook, $contentstats_hooks ) ) {
238
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && $this->gadwp->config->options['backend_item_reports'] ) {
239
+
240
+ if ( $this->gadwp->config->options['ga_target_geomap'] ) {
241
+ $country_codes = GADWP_Tools::get_countrycodes();
242
+ if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
243
+ $region = $this->gadwp->config->options['ga_target_geomap'];
244
+ } else {
245
+ $region = false;
246
+ }
247
+ } else {
248
+ $region = false;
249
+ }
250
+
251
+ wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
252
+
253
+ wp_enqueue_style( 'gadwp-backend-item-reports', GADWP_URL . 'admin/css/item-reports.css', null, GADWP_CURRENT_VERSION );
254
+
255
+ wp_enqueue_style( "wp-jquery-ui-dialog" );
256
+
257
+ wp_register_script( 'googlecharts', 'https://www.gstatic.com/charts/loader.js', array(), null );
258
+
259
+ wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
260
+
261
+ wp_enqueue_script( 'gadwp-backend-item-reports', GADWP_URL . 'common/js/reports5.js', array( 'gadwp-nprogress', 'googlecharts', 'jquery', 'jquery-ui-dialog' ), GADWP_CURRENT_VERSION, true );
262
+
263
+ /* @formatter:off */
264
+ wp_localize_script( 'gadwp-backend-item-reports', 'gadwpItemData', array(
265
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
266
+ 'security' => wp_create_nonce( 'gadwp_backend_item_reports' ),
267
+ 'dateList' => array(
268
+ 'today' => __( "Today", 'google-analytics-dashboard-for-wp' ),
269
+ 'yesterday' => __( "Yesterday", 'google-analytics-dashboard-for-wp' ),
270
+ '7daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 7 ),
271
+ '14daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 14 ),
272
+ '30daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 30 ),
273
+ '90daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 90 ),
274
+ '365daysAgo' => sprintf( _n( "%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp' ), __('One', 'google-analytics-dashboard-for-wp') ),
275
+ '1095daysAgo' => sprintf( _n( "%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp' ), __('Three', 'google-analytics-dashboard-for-wp') ),
276
+ ),
277
+ 'reportList' => array(
278
+ 'uniquePageviews' => __( "Unique Views", 'google-analytics-dashboard-for-wp' ),
279
+ 'users' => __( "Users", 'google-analytics-dashboard-for-wp' ),
280
+ 'organicSearches' => __( "Organic", 'google-analytics-dashboard-for-wp' ),
281
+ 'pageviews' => __( "Page Views", 'google-analytics-dashboard-for-wp' ),
282
+ 'visitBounceRate' => __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
283
+ 'locations' => __( "Location", 'google-analytics-dashboard-for-wp' ),
284
+ 'referrers' => __( "Referrers", 'google-analytics-dashboard-for-wp' ),
285
+ 'searches' => __( "Searches", 'google-analytics-dashboard-for-wp' ),
286
+ 'trafficdetails' => __( "Traffic", 'google-analytics-dashboard-for-wp' ),
287
+ 'technologydetails' => __( "Technology", 'google-analytics-dashboard-for-wp' ),
288
+ ),
289
+ 'i18n' => array(
290
+ __( "A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp' ), //0
291
+ __( "Traffic Mediums", 'google-analytics-dashboard-for-wp' ),
292
+ __( "Visitor Type", 'google-analytics-dashboard-for-wp' ),
293
+ __( "Social Networks", 'google-analytics-dashboard-for-wp' ),
294
+ __( "Search Engines", 'google-analytics-dashboard-for-wp' ),
295
+ __( "Unique Views", 'google-analytics-dashboard-for-wp' ),
296
+ __( "Users", 'google-analytics-dashboard-for-wp' ),
297
+ __( "Page Views", 'google-analytics-dashboard-for-wp' ),
298
+ __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
299
+ __( "Organic Search", 'google-analytics-dashboard-for-wp' ),
300
+ __( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
301
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
302
+ __( "No Data", 'google-analytics-dashboard-for-wp' ),
303
+ __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
304
+ __( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
305
+ __( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . menu_page_url( 'gadwp_settings', false ) . '">' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</a>.',
306
+ __( "Browser", 'google-analytics-dashboard-for-wp' ), //16
307
+ __( "Operating System", 'google-analytics-dashboard-for-wp' ),
308
+ __( "Screen Resolution", 'google-analytics-dashboard-for-wp' ),
309
+ __( "Mobile Brand", 'google-analytics-dashboard-for-wp' ), //19
310
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
311
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
312
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
313
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
314
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
315
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ), //25
316
+ __( "Time on Page", 'google-analytics-dashboard-for-wp' ),
317
+ __( "Page Load Time", 'google-analytics-dashboard-for-wp' ),
318
+ __( "Exit Rate", 'google-analytics-dashboard-for-wp' ),
319
+ ),
320
+ 'colorVariations' => GADWP_Tools::variations( $this->gadwp->config->options['theme_color'] ),
321
+ 'region' => $region,
322
+ 'mapsApiKey' => apply_filters( 'gadwp_maps_api_key', $this->gadwp->config->options['maps_api_key'] ),
323
+ 'language' => get_bloginfo( 'language' ),
324
+ 'viewList' => false,
325
+ 'scope' => 'admin-item',
326
+ )
327
+ );
328
+ /* @formatter:on */
329
+ }
330
+ }
331
+
332
+ /*
333
+ * Settings Styles & Scripts
334
+ */
335
+ $settings_hooks = array( '_page_gadwp_settings', '_page_gadwp_backend_settings', '_page_gadwp_frontend_settings', '_page_gadwp_tracking_settings', '_page_gadwp_errors_debugging' );
336
+
337
+ if ( in_array( $new_hook, $settings_hooks ) ) {
338
+ wp_enqueue_style( 'wp-color-picker' );
339
+ wp_enqueue_script( 'wp-color-picker' );
340
+ wp_enqueue_script( 'wp-color-picker-script-handle', plugins_url( 'js/wp-color-picker-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
341
+ wp_enqueue_script( 'gadwp-settings', plugins_url( 'js/settings.js', __FILE__ ), array( 'jquery' ), GADWP_CURRENT_VERSION, true );
342
+ }
343
+ }
344
+
345
+ /**
346
+ * Add "Settings" link in Plugins List
347
+ *
348
+ * @param
349
+ * $links
350
+ * @return array
351
+ */
352
+ public function settings_link( $links ) {
353
+ $settings_link = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=gadwp_settings' ) ) . '">' . __( "Settings", 'google-analytics-dashboard-for-wp' ) . '</a>';
354
+ array_unshift( $links, $settings_link );
355
+ return $links;
356
+ }
357
+
358
+ /**
359
+ * Add an admin notice after a manual or atuomatic update
360
+ */
361
+ function admin_notice() {
362
+ $currentScreen = get_current_screen();
363
+
364
+ if ( ! current_user_can( 'manage_options' ) || strpos( $currentScreen->base, '_gadwp_' ) === false ) {
365
+ return;
366
+ }
367
+
368
+ if ( get_option( 'gadwp_got_updated' ) ) :
369
+ ?>
370
+ <div id="gadwp-notice" class="notice is-dismissible">
371
+ <p><?php echo sprintf( __('Google Analytics Dashboard for WP has been updated to version %s.', 'google-analytics-dashboard-for-wp' ), GADWP_CURRENT_VERSION).' '.sprintf( __('For details, check out %1$s.', 'google-analytics-dashboard-for-wp' ), sprintf(' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_notice&utm_medium=link&utm_content=release_notice&utm_campaign=gadwp">%s</a>', __('the plugin documentation', 'google-analytics-dashboard-for-wp') ) ); ?></p>
372
+ </div>
373
+
374
+ <?php
375
+ endif;
376
+ }
377
+ }
378
+ }
tags/5.3.1/admin/views/access-code.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <form name="input" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" method="post">
11
+ <table class="gadwp-settings-options">
12
+ <tr>
13
+ <td colspan="2" class="gadwp-settings-info">
14
+ <?php echo __( "Use this link to get your <strong>one-time-use</strong> access code:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . $data['authUrl'] . '" id="gapi-access-code" target="_blank">' . __ ( "Get Access Code", 'google-analytics-dashboard-for-wp' ) . '</a>.'; ?>
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <td class="gadwp-settings-title">
19
+ <label for="gadwp_access_code" title="<?php _e("Use the red link to get your access code! You need to generate a new one each time you authorize!",'google-analytics-dashboard-for-wp')?>"><?php echo _e( "Access Code:", 'google-analytics-dashboard-for-wp' ); ?></label>
20
+ </td>
21
+ <td>
22
+ <input type="text" id="gadwp_access_code" name="gadwp_access_code" value="" size="61" autocomplete="off" pattern=".\/.{30,}" required="required" title="<?php _e("Use the red link to get your access code! You need to generate a new one each time you authorize!",'google-analytics-dashboard-for-wp')?>">
23
+ </td>
24
+ </tr>
25
+ <tr>
26
+ <td colspan="2">
27
+ <hr>
28
+ </td>
29
+ </tr>
30
+ <tr>
31
+ <td colspan="2">
32
+ <input type="submit" class="button button-secondary" name="gadwp_authorize" value="<?php _e( "Save Access Code", 'google-analytics-dashboard-for-wp' ); ?>" />
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </form>
tags/5.3.1/admin/widgets.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Backend_Widgets' ) ) {
15
+
16
+ class GADWP_Backend_Widgets {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) {
23
+ add_action( 'wp_dashboard_setup', array( $this, 'add_widget' ) );
24
+ }
25
+ }
26
+
27
+ public function add_widget() {
28
+ wp_add_dashboard_widget( 'gadwp-widget', __( "Google Analytics Dashboard", 'google-analytics-dashboard-for-wp' ), array( $this, 'dashboard_widget' ), $control_callback = null );
29
+ }
30
+
31
+ public function dashboard_widget() {
32
+ $projectId = 0;
33
+
34
+ if ( empty( $this->gadwp->config->options['token'] ) ) {
35
+ echo '<p>' . __( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . '</p><form action="' . menu_page_url( 'gadwp_settings', false ) . '" method="POST">' . get_submit_button( __( "Authorize Plugin", 'google-analytics-dashboard-for-wp' ), 'secondary' ) . '</form>';
36
+ return;
37
+ }
38
+
39
+ if ( current_user_can( 'manage_options' ) ) {
40
+ if ( $this->gadwp->config->options['tableid_jail'] ) {
41
+ $projectId = $this->gadwp->config->options['tableid_jail'];
42
+ } else {
43
+ echo '<p>' . __( "An admin should asign a default Google Analytics Profile.", 'google-analytics-dashboard-for-wp' ) . '</p><form action="' . menu_page_url( 'gadwp_settings', false ) . '" method="POST">' . get_submit_button( __( "Select Domain", 'google-analytics-dashboard-for-wp' ), 'secondary' ) . '</form>';
44
+ return;
45
+ }
46
+ } else {
47
+ if ( $this->gadwp->config->options['tableid_jail'] ) {
48
+ $projectId = $this->gadwp->config->options['tableid_jail'];
49
+ } else {
50
+ echo '<p>' . __( "An admin should asign a default Google Analytics Profile.", 'google-analytics-dashboard-for-wp' ) . '</p><form action="' . menu_page_url( 'gadwp_settings', false ) . '" method="POST">' . get_submit_button( __( "Select Domain", 'google-analytics-dashboard-for-wp' ), 'secondary' ) . '</form>';
51
+ return;
52
+ }
53
+ }
54
+
55
+ if ( ! ( $projectId ) ) {
56
+ echo '<p>' . __( "Something went wrong while retrieving property data. You need to create and properly configure a Google Analytics account:", 'google-analytics-dashboard-for-wp' ) . '</p> <form action="https://deconf.com/how-to-set-up-google-analytics-on-your-website/" method="POST">' . get_submit_button( __( "Find out more!", 'google-analytics-dashboard-for-wp' ), 'secondary' ) . '</form>';
57
+ return;
58
+ }
59
+
60
+ ?>
61
+ <div id="gadwp-window-1"></div>
62
+ <?php
63
+ }
64
+ }
65
+ }
tags/5.3.1/common/ajax-actions.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Common_Ajax' ) ) {
15
+
16
+ final class GADWP_Common_Ajax {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) || GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) ) {
24
+ add_action( 'wp_ajax_gadwp_set_error', array( $this, 'ajax_set_error' ) );
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Ajax handler for storing JavaScript Errors
30
+ *
31
+ * @return json|int
32
+ */
33
+ public function ajax_set_error() {
34
+ if ( ! isset( $_POST['gadwp_security_set_error'] ) || ! ( wp_verify_nonce( $_POST['gadwp_security_set_error'], 'gadwp_backend_item_reports' ) || wp_verify_nonce( $_POST['gadwp_security_set_error'], 'gadwp_frontend_item_reports' ) ) ) {
35
+ wp_die( - 40 );
36
+ }
37
+ $timeout = 24 * 60 * 60;
38
+ GADWP_Tools::set_error( $_POST['response'], $timeout );
39
+ wp_die();
40
+ }
41
+ }
42
+ }
tags/5.3.1/common/js/reports5.js ADDED
@@ -0,0 +1 @@
 
1
+ "use strict";if(gadwpItemData.mapsApiKey){google.charts.load("current",{mapsApiKey:gadwpItemData.mapsApiKey,packages:["corechart","table","orgchart","geochart"]})}else{google.charts.load("current",{packages:["corechart","table","orgchart","geochart"]})}google.charts.setOnLoadCallback(GADWPReportLoad);gadwpItemData.getID=function(a){if(gadwpItemData.scope=="admin-item"){if(typeof a.id=="undefined"){return 0}if(a.id.split("-")[1]=="undefined"){return 0}else{return a.id.split("-")[1]}}else{if(typeof a.id=="undefined"){return 1}if(a.id.split("-")[4]=="undefined"){return 1}else{return a.id.split("-")[4]}}};gadwpItemData.getSelector=function(a){if(a=="admin-item"){return'a[id^="gadwp-"]'}else{return'li[id^="wp-admin-bar-gadwp"] a'}};gadwpItemData.responsiveDialog=function(){var b,a,c;c=jQuery(".ui-dialog:visible");c.each(function(){b=jQuery(this).find(".ui-dialog-content").data("ui-dialog");if(b.options.fluid){a=jQuery(window).width();if(a<(parseInt(b.options.maxWidth)+50)){jQuery(this).css("max-width","90%")}else{jQuery(this).css("max-width",b.options.maxWidth+"px")}b.option("position",b.options.position)}})};jQuery.fn.extend({gadwpItemReport:function(g){var a,d,h,e,f,i,c,b="-"+g;d={setCookie:function(k,m){var j,l=new Date();if(gadwpItemData.scope=="admin-widgets"){k="gadwp_wg_"+k}else{k="gadwp_ir_"+k}l.setTime(l.getTime()+(24*60*60*1000*365));j="expires="+l.toUTCString();document.cookie=k+"="+m+"; "+j+"; path=/"},getCookie:function(j){var l,m,n,k=0;if(gadwpItemData.scope=="admin-widgets"){j="gadwp_wg_"+j+"="}else{j="gadwp_ir_"+j+"="}m=document.cookie.split(";");for(k=0;k<m.length;k++){l=m[k];while(l.charAt(0)==" "){l=l.substring(1)}if(l.indexOf(j)==0){return l.substring(j.length,l.length)}}return false},escape:function(j){div=document.createElement("div");div.appendChild(document.createTextNode(j));return div.innerHTML}};h={addOptions:function(o,n){var j,l,m,k=[];if(!d.getCookie("default_metric")||!d.getCookie("default_dimension")||!d.getCookie("default_swmetric")){j="sessions";l="30daysAgo";if(gadwpItemData.scope=="front-item"||gadwpItemData.scope=="admin-item"){c="pageviews"}else{c="sessions"}d.setCookie("default_metric",j);d.setCookie("default_dimension",l);d.setCookie("default_swmetric",c)}else{j=d.getCookie("default_metric");l=d.getCookie("default_dimension");m=d.getCookie("default_view");c=d.getCookie("default_swmetric")}if(n==false){if(gadwpItemData.scope=="front-item"||gadwpItemData.scope=="admin-item"){k=""}else{k='<span id="gadwp-swmetric-sessions" title="'+gadwpItemData.i18n[5]+'" class="dashicons dashicons-clock" style="font-size:22px;padding:4px;"></span>'}k+='<span id="gadwp-swmetric-users" title="'+gadwpItemData.i18n[6]+'" class="dashicons dashicons-admin-users" style="font-size:22px;padding:4px;"></span>';k+='<span id="gadwp-swmetric-pageviews" title="'+gadwpItemData.i18n[7]+'" class="dashicons dashicons-admin-page" style="font-size:22px;padding:4px;"></span>';jQuery(o).html(k);jQuery("#gadwp-swmetric-"+c).css("color","#008ec2")}else{jQuery.each(n,function(p,q){if(p==j||p==l||p==m){k.push('<option value="'+p+'" selected="selected">'+q+"</option>")}else{k.push('<option value="'+p+'">'+q+"</option>")}});jQuery(o).html(k.join(""))}},init:function(){var j;if(!jQuery("#gadwp-window"+b).length){return}if(jQuery("#gadwp-window"+b).html().length){return}j='<div id="gadwp-container'+b+'">';if(gadwpItemData.viewList!=false){j+='<select id="gadwp-sel-view'+b+'"></select>'}j+='<select id="gadwp-sel-period'+b+'"></select> ';j+='<select id="gadwp-sel-report'+b+'"></select>';j+='<div id="gadwp-sel-metric'+b+'" style="float:right;display:none;">';j+="</div>";j+='<div id="gadwp-progressbar'+b+'"></div>';j+='<div id="gadwp-status'+b+'"></div>';j+='<div id="gadwp-reports'+b+'"></div>';j+='<div style="text-align:right;width:100%;font-size:0.8em;clear:both;margin-right:5px;margin-top:10px;">';j+=gadwpItemData.i18n[14];j+=' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_report&utm_medium=link&utm_content=back_report&utm_campaign=gadwp" rel="nofollow" style="text-decoration:none;font-size:1em;">GADWP</a>&nbsp;';j+="</div>";j+="</div>",jQuery("#gadwp-window"+b).append(j);h.addOptions("#gadwp-sel-view"+b,gadwpItemData.viewList);h.addOptions("#gadwp-sel-period"+b,gadwpItemData.dateList);h.addOptions("#gadwp-sel-report"+b,gadwpItemData.reportList);h.addOptions("#gadwp-sel-metric"+b,false)}};e={oldViewPort:0,orgChartTableChartData:"",tableChartData:"",orgChartPieChartsData:"",geoChartTableChartData:"",areaChartBottomStatsData:"",realtime:"",rtRuns:null,i18n:null,getTitle:function(j){if(j=="admin-item"){return jQuery("#gadwp"+b).attr("title")}else{return document.getElementsByTagName("title")[0].innerHTML}},alertMessage:function(j){jQuery("#gadwp-status"+b).css({"margin-top":"3px","padding-left":"5px",height:"auto",color:"#000","border-left":"5px solid red"});jQuery("#gadwp-status"+b).html(j)},areaChartBottomStats:function(j){e.areaChartBottomStatsData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();if(a.query=="visitBounceRate,bottomstats"){e.drawAreaChart(j[0],true)}else{e.drawAreaChart(j[0],false)}}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-areachart"+b,j[0],"125px")}if(!jQuery.isNumeric(j[1])){if(jQuery.isArray(j[1])){jQuery("#gadwp-reports"+b).show();e.drawBottomStats(j[1])}else{e.throwDebug(j[1])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-bottomstats"+b,j[1],"40px")}}else{e.throwDebug(j)}NProgress.done()},orgChartPieCharts:function(j){var k=0;e.orgChartPieChartsData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawOrgChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-orgchart"+b,j[0],"125px")}for(k=1;k<j.length;k++){if(!jQuery.isNumeric(j[k])){if(jQuery.isArray(j[k])){jQuery("#gadwp-reports"+b).show();e.drawPieChart("piechart-"+k,j[k],e.i18n[k])}else{e.throwDebug(j[k])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-piechart-"+k+b,j[k],"80px")}}}else{e.throwDebug(j)}NProgress.done()},geoChartTableChart:function(j){e.geoChartTableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawGeoChart(j[0]);e.drawTableChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-geochart"+b,j[0],"125px");e.throwError("#gadwp-tablechart"+b,j[0],"125px")}}else{e.throwDebug(j)}NProgress.done()},orgChartTableChart:function(j){e.orgChartTableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawOrgChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-orgchart"+b,j[0],"125px")}if(!jQuery.isNumeric(j[1])){if(jQuery.isArray(j[1])){e.drawTableChart(j[1])}else{e.throwDebug(j[1])}}else{e.throwError("#gadwp-tablechart"+b,j[1],"125px")}}else{e.throwDebug(j)}NProgress.done()},tableChart:function(j){e.tableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawTableChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-tablechart"+b,j[0],"125px")}}else{e.throwDebug(j)}NProgress.done()},drawTableChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={page:"enable",pageSize:10,width:"100%",allowHtml:true};k=new google.visualization.Table(document.getElementById("gadwp-tablechart"+b));k.draw(l,j)},drawOrgChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={allowCollapse:true,allowHtml:true,height:"100%"};k=new google.visualization.OrgChart(document.getElementById("gadwp-orgchart"+b));k.draw(l,j)},drawPieChart:function(o,m,n){var l,j,k;l=google.visualization.arrayToDataTable(m);j={is3D:false,tooltipText:"percentage",legend:"none",chartArea:{width:"99%",height:"80%"},title:n,pieSliceText:"value",colors:gadwpItemData.colorVariations};k=new google.visualization.PieChart(document.getElementById("gadwp-"+o+b));k.draw(l,j)},drawGeoChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={chartArea:{width:"99%",height:"90%"},colors:[gadwpItemData.colorVariations[5],gadwpItemData.colorVariations[4]]};if(gadwpItemData.region){j.region=gadwpItemData.region;j.displayMode="markers";j.datalessRegionColor="EFEFEF"}k=new google.visualization.GeoChart(document.getElementById("gadwp-geochart"+b));k.draw(l,j)},drawAreaChart:function(n,o){var m,j,l,k;m=google.visualization.arrayToDataTable(n);if(o){k=new google.visualization.NumberFormat({suffix:"%",fractionDigits:2});k.format(m,1)}j={legend:{position:"none"},pointSize:3,colors:[gadwpItemData.colorVariations[0],gadwpItemData.colorVariations[4]],chartArea:{width:"99%",height:"90%"},vAxis:{textPosition:"in",minValue:0},hAxis:{textPosition:"none"}};l=new google.visualization.AreaChart(document.getElementById("gadwp-areachart"+b));l.draw(m,j)},drawBottomStats:function(j){jQuery("#gdsessions"+b).html(j[0]);jQuery("#gdusers"+b).html(j[1]);jQuery("#gdpageviews"+b).html(j[2]);jQuery("#gdbouncerate"+b).html(j[3]);jQuery("#gdorganicsearch"+b).html(j[4]);jQuery("#gdpagespervisit"+b).html(j[5]);jQuery("#gdpagetime"+b).html(j[6]);jQuery("#gdpageload"+b).html(j[7]);jQuery("#gdsessionduration"+b).html(j[8])},rtOnlyUniqueValues:function(l,k,j){return j.indexOf(l)===k},rtCountSessions:function(k,m){var l=0,j=0;for(j=0;j<k.rows.length;j++){if(jQuery.inArray(m,k.rows[j])>-1){l+=parseInt(k.rows[j][6])}}return l},rtGenerateTooltip:function(k){var m=0,l="",j=0;for(j=0;j<k.length;j++){m+=parseInt(k[j].count);l+="<tr><td class='gadwp-pgdetailsl'>"+k[j].value+"</td><td class='gadwp-pgdetailsr'>"+k[j].count+"</td></tr>"}if(m){return("<table>"+l+"</table>")}else{return("")}},rtPageDetails:function(y,n){var w,o,r,x=0,v=0,m=0,s=0,t=0,z=0,C=0,q=0,l=0,u="",A="",p="",k="",B="";y=y.rows;for(x=0;x<y.length;x++){if(y[x][0]==n){o=y[x][5];switch(y[x][3]){case"REFERRAL":t+=parseInt(y[x][6]);u+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"ORGANIC":z+=parseInt(y[x][6]);A+="<tr><td class='gadwp-pgdetailsl'>"+y[x][2]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"SOCIAL":q+=parseInt(y[x][6]);p+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"CUSTOM":l+=parseInt(y[x][6]);k+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"DIRECT":C+=parseInt(y[x][6]);break}}}if(t){u="<table><tr><td>"+e.i18n[0]+"("+t+")</td></tr>"+u+"</table><br />"}if(z){A="<table><tr><td>"+e.i18n[1]+"("+z+")</td></tr>"+A+"</table><br />"}if(q){p="<table><tr><td>"+e.i18n[2]+"("+q+")</td></tr>"+p+"</table><br />"}if(l){k="<table><tr><td>"+e.i18n[3]+"("+l+")</td></tr>"+k+"</table><br />"}if(C){B="<table><tr><td>"+e.i18n[4]+"("+C+")</td></tr></table><br />"}return("<p><center><strong>"+o+"</strong></center></p>"+u+A+p+k+B)},rtRefresh:function(){if(e.render.focusFlag){a.from=false;a.to=false;a.query="realtime";jQuery.post(gadwpItemData.ajaxurl,a,function(j){if(jQuery.isArray(j)){jQuery("#gadwp-reports"+b).show();e.realtime=j[0];e.drawRealtime(e.realtime)}else{e.throwDebug(j)}NProgress.done()})}},drawRealtime:function(y){var j,n,o,w,t,r,x=0,v=[],z=[],p=[],m=[],q=[],k=[],l=[],s="",o=[],w=[],t=[],r=[],u=["REFERRAL","ORGANIC","SOCIAL","CUSTOM"],A=["DIRECT","NEW"];jQuery(function(){jQuery("#gadwp-widget *").tooltip({tooltipClass:"gadwp"})});y=y[0];if(jQuery.isNumeric(y)||typeof y==="undefined"){y=[];y.totalsForAllResults=[];y.totalsForAllResults["rt:activeUsers"]="0";y.rows=[]}if(y.totalsForAllResults["rt:activeUsers"]!==document.getElementById("gadwp-online").innerHTML){jQuery("#gadwp-online").fadeOut("slow");jQuery("#gadwp-online").fadeOut(500);jQuery("#gadwp-online").fadeOut("slow",function(){if((parseInt(y.totalsForAllResults["rt:activeUsers"]))<(parseInt(document.getElementById("gadwp-online").innerHTML))){jQuery("#gadwp-online").css({"background-color":"#FFE8E8"})}else{jQuery("#gadwp-online").css({"background-color":"#E0FFEC"})}document.getElementById("gadwp-online").innerHTML=y.totalsForAllResults["rt:activeUsers"]});jQuery("#gadwp-online").fadeIn("slow");jQuery("#gadwp-online").fadeIn(500);jQuery("#gadwp-online").fadeIn("slow",function(){jQuery("#gadwp-online").css({"background-color":"#FFFFFF"})})}if(y.totalsForAllResults["rt:activeUsers"]==0){y.rows=[]}for(x=0;x<y.rows.length;x++){v.push(y.rows[x][0]);if(y.rows[x][3]=="REFERRAL"){z.push(y.rows[x][1])}if(y.rows[x][3]=="ORGANIC"){p.push(y.rows[x][2])}if(y.rows[x][3]=="SOCIAL"){m.push(y.rows[x][1])}if(y.rows[x][3]=="CUSTOM"){k.push(y.rows[x][1])}q.push(y.rows[x][3])}n=v.filter(e.rtOnlyUniqueValues);for(x=0;x<n.length;x++){l[x]={pagepath:n[x],count:e.rtCountSessions(y,n[x])}}l.sort(function(C,B){return B.count-C.count});s="";for(x=0;x<l.length;x++){if(x<gadwpItemData.rtLimitPages){s+='<div class="gadwp-pline"><div class="gadwp-pleft"><a href="#" data-gadwp="'+e.rtPageDetails(y,l[x].pagepath)+'">'+l[x].pagepath.substring(0,70)+'</a></div><div class="gadwp-pright">'+l[x].count+"</div></div>"}}document.getElementById("gadwp-pages").innerHTML='<br /><div class="gadwp-pg">'+s+"</div>";o=z.filter(e.rtOnlyUniqueValues);for(x=0;x<o.length;x++){o[x]={value:o[x],count:e.rtCountSessions(y,o[x])}}o.sort(function(C,B){return B.count-C.count});w=p.filter(e.rtOnlyUniqueValues);for(x=0;x<w.length;x++){w[x]={value:w[x],count:e.rtCountSessions(y,w[x])}}w.sort(function(C,B){return B.count-C.count});t=m.filter(e.rtOnlyUniqueValues);for(x=0;x<t.length;x++){t[x]={value:t[x],count:e.rtCountSessions(y,t[x])}}t.sort(function(C,B){return B.count-C.count});r=k.filter(e.rtOnlyUniqueValues);for(x=0;x<r.length;x++){r[x]={value:r[x],count:e.rtCountSessions(y,r[x])}}r.sort(function(C,B){return B.count-C.count});j='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(o)+'"><div class="gadwp-bleft">'+e.i18n[0]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[0])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(w)+'"><div class="gadwp-bleft">'+e.i18n[1]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[1])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(t)+'"><div class="gadwp-bleft">'+e.i18n[2]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[2])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(r)+'"><div class="gadwp-bleft">'+e.i18n[3]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[3])+"</div></div>";j+='<div class="gadwp-bigtext"><div class="gadwp-bleft">'+e.i18n[4]+'</div><div class="gadwp-bright">'+e.rtCountSessions(y,A[0])+"</div></div>";j+='<div class="gadwp-bigtext"><div class="gadwp-bleft">'+e.i18n[5]+'</div><div class="gadwp-bright">'+e.rtCountSessions(y,A[1])+"</div></div>";document.getElementById("gadwp-tdo-right").innerHTML=j},throwDebug:function(j){jQuery("#gadwp-status"+b).css({"margin-top":"3px","padding-left":"5px",height:"auto",color:"#000","border-left":"5px solid red"});if(j=="-24"){jQuery("#gadwp-status"+b).html(gadwpItemData.i18n[15])}else{jQuery("#gadwp-reports"+b).css({"background-color":"#F7F7F7",height:"auto","margin-top":"10px","padding-top":"50px","padding-bottom":"50px",color:"#000","text-align":"center"});jQuery("#gadwp-reports"+b).html(j);jQuery("#gadwp-reports"+b).show();jQuery("#gadwp-status"+b).html(gadwpItemData.i18n[11]);console.log("\n********************* GADWP Log ********************* \n\n"+j);a={action:"gadwp_set_error",response:j,gadwp_security_set_error:gadwpItemData.security};jQuery.post(gadwpItemData.ajaxurl,a)}},throwError:function(l,j,k){jQuery(l).css({"background-color":"#F7F7F7",height:"auto","padding-top":k,"padding-bottom":k,color:"#000","text-align":"center"});if(j==-21){jQuery(l).html(gadwpItemData.i18n[12])}else{jQuery(l).html(gadwpItemData.i18n[13]+" ("+j+")")}},render:function(j,o,n){var k,q,p,l,m;if(o=="realtime"){jQuery("#gadwp-sel-report"+b).hide()}else{jQuery("#gadwp-sel-report"+b).show();clearInterval(e.rtRuns)}jQuery("#gadwp-status"+b).html("");switch(o){case"today":q="today";p="today";break;case"yesterday":q="yesterday";p="yesterday";break;case"7daysAgo":q="7daysAgo";p="yesterday";break;case"14daysAgo":q="14daysAgo";p="yesterday";break;case"90daysAgo":q="90daysAgo";p="yesterday";break;case"365daysAgo":q="365daysAgo";p="yesterday";break;case"1095daysAgo":q="1095daysAgo";p="yesterday";break;default:q="30daysAgo";p="yesterday";break}d.setCookie("default_metric",n);d.setCookie("default_dimension",o);if(typeof j!=="undefined"){d.setCookie("default_view",j);k=j}else{k=false}if(gadwpItemData.scope=="admin-item"){a={action:"gadwp_backend_item_reports",gadwp_security_backend_item_reports:gadwpItemData.security,from:q,to:p,filter:g}}else{if(gadwpItemData.scope=="front-item"){a={action:"gadwp_frontend_item_reports",gadwp_security_frontend_item_reports:gadwpItemData.security,from:q,to:p,filter:gadwpItemData.filter}}else{a={action:"gadwp_backend_item_reports",gadwp_security_backend_item_reports:gadwpItemData.security,projectId:k,from:q,to:p}}}if(o=="realtime"){e.i18n=gadwpItemData.i18n.slice(20,26);e.render.focusFlag=1;jQuery(window).bind("focus",function(r){e.render.focusFlag=1}).bind("blur",function(r){e.render.focusFlag=0});l='<div id="gadwp-realtime'+b+'">';l+='<div class="gadwp-rt-box">';l+='<div class="gadwp-tdo-left">';l+='<div class="gadwp-online" id="gadwp-online">0</div>';l+="</div>";l+='<div class="gadwp-tdo-right" id="gadwp-tdo-right">';l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[0]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[1]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[2]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[3]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[4]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[5]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+="</div>";l+="</div>";l+="<div>";l+='<div id="gadwp-pages" class="gadwp-pages">&nbsp;</div>';l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);e.rtRefresh(e.render.focusFlag);e.rtRuns=setInterval(e.rtRefresh,55000)}else{if(jQuery.inArray(n,["referrers","contentpages","searches"])>-1){l='<div id="gadwp-orgcharttablechart'+b+'">';l+='<div id="gadwp-orgchart'+b+'"></div>';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query="channelGrouping,"+n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.orgChartTableChart(r)})}else{if(n=="404errors"){l='<div id="gadwp-404tablechart'+b+'">';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query=n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.tableChart(r)})}else{if(n=="trafficdetails"||n=="technologydetails"){l='<div id="gadwp-orgchartpiecharts'+b+'">';l+='<div id="gadwp-orgchart'+b+'"></div>';l+='<div class="gadwp-floatwraper">';l+='<div id="gadwp-piechart-1'+b+'" class="halfsize floatleft"></div>';l+='<div id="gadwp-piechart-2'+b+'" class="halfsize floatright"></div>';l+="</div>";l+='<div class="gadwp-floatwraper">';l+='<div id="gadwp-piechart-3'+b+'" class="halfsize floatleft"></div>';l+='<div id="gadwp-piechart-4'+b+'" class="halfsize floatright"></div>';l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();if(n=="trafficdetails"){a.query="channelGrouping,medium,visitorType,source,socialNetwork";e.i18n=gadwpItemData.i18n.slice(0,5)}else{e.i18n=gadwpItemData.i18n.slice(15,20);a.query="deviceCategory,browser,operatingSystem,screenResolution,mobileDeviceBranding"}a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.orgChartPieCharts(r)})}else{if(n=="locations"){l='<div id="gadwp-geocharttablechart'+b+'">';l+='<div id="gadwp-geochart'+b+'"></div>';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query=n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.geoChartTableChart(r)})}else{l='<div id="gadwp-areachartbottomstats'+b+'">';l+='<div id="gadwp-areachart'+b+'"></div>';l+='<div id="gadwp-bottomstats'+b+'">';l+='<div class="inside">';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[5]+'</h3><p id="gdsessions'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[6]+'</h3><p id="gdusers'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[7]+'</h3><p id="gdpageviews'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[8]+'</h3><p id="gdbouncerate'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[9]+'</h3><p id="gdorganicsearch'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[10]+'</h3><p id="gdpagespervisit'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[26]+'</h3><p id="gdpagetime'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[27]+'</h3><p id="gdpageload'+b+'">&nbsp;</p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[28]+'</h3><p id="gdsessionduration'+b+'">&nbsp;</p></div>';l+="</div>";l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();a.query=n+",bottomstats";jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.areaChartBottomStats(r)})}}}}}},refresh:function(){if(jQuery("#gadwp-areachartbottomstats"+b).length>0&&jQuery.isArray(e.areaChartBottomStatsData)){e.areaChartBottomStats(e.areaChartBottomStatsData)}if(jQuery("#gadwp-orgchartpiecharts"+b).length>0&&jQuery.isArray(e.orgChartPieChartsData)){e.orgChartPieCharts(e.orgChartPieChartsData)}if(jQuery("#gadwp-geocharttablechart"+b).length>0&&jQuery.isArray(e.geoChartTableChartData)){e.geoChartTableChart(e.geoChartTableChartData)}if(jQuery("#gadwp-orgcharttablechart"+b).length>0&&jQuery.isArray(e.orgChartTableChartData)){e.orgChartTableChart(e.orgChartTableChartData)}if(jQuery("#gadwp-404tablechart"+b).length>0&&jQuery.isArray(e.tableChartData)){e.tableChart(e.tableChartData)}},init:function(){if(!jQuery("#gadwp-reports"+b).length){return}if(jQuery("#gadwp-reports"+b).html().length){return}try{NProgress.configure({parent:"#gadwp-progressbar"+b,showSpinner:false});NProgress.start()}catch(j){e.alertMessage(gadwpItemData.i18n[0])}e.render(jQuery("#gadwp-sel-view"+b).val(),jQuery("#gadwp-sel-period"+b).val(),jQuery("#gadwp-sel-report"+b).val());jQuery(window).resize(function(){var k=jQuery(window).width()-e.oldViewPort;if((k<-5)||(k>5)){e.oldViewPort=jQuery(window).width();e.refresh()}})}};h.init();e.init();jQuery("#gadwp-sel-view"+b).change(function(){jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("#gadwp-sel-period"+b).change(function(){jQuery("#gadwp-sel-metric"+b).hide();jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("#gadwp-sel-report"+b).change(function(){jQuery("#gadwp-sel-metric"+b).hide();jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("[id^=gadwp-swmetric-]").click(function(){c=this.id.replace("gadwp-swmetric-","");d.setCookie("default_swmetric",c);jQuery("#gadwp-swmetric-sessions").css("color","#444");jQuery("#gadwp-swmetric-users").css("color","#444");jQuery("#gadwp-swmetric-pageviews").css("color","#444");jQuery("#"+this.id).css("color","#008ec2");jQuery("#gadwp-reports"+b).html("");e.init()});if(gadwpItemData.scope=="admin-widgets"){return}else{return this.dialog({width:"auto",maxWidth:510,height:"auto",modal:true,fluid:true,dialogClass:"gadwp wp-dialog",resizable:false,title:e.getTitle(gadwpItemData.scope),position:{my:"top",at:"top+100",of:window}})}}});function GADWPReportLoad(){if(gadwpItemData.scope=="admin-widgets"){jQuery("#gadwp-window-1").gadwpItemReport(1)}else{jQuery(gadwpItemData.getSelector(gadwpItemData.scope)).click(function(){if(!jQuery("#gadwp-window-"+gadwpItemData.getID(this)).length>0){jQuery("body").append('<div id="gadwp-window-'+gadwpItemData.getID(this)+'"></div>')}jQuery("#gadwp-window-"+gadwpItemData.getID(this)).gadwpItemReport(gadwpItemData.getID(this))})}jQuery(window).resize(function(){gadwpItemData.responsiveDialog()});jQuery(document).on("dialogopen",".ui-dialog",function(a,b){gadwpItemData.responsiveDialog()})};
tags/5.3.1/common/nprogress/nprogress.css ADDED
@@ -0,0 +1 @@
 
1
+ #nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0,-4px);-ms-transform:rotate(3deg) translate(0,-4px);transform:rotate(3deg) translate(0,-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner 400ms linear infinite;animation:nprogress-spinner 400ms linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute}@ -webkit-keyframes nprogress-spinner{0{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@ keyframes nprogress-spinner{0{transform:rotate(0)}100%{transform:rotate(360deg)}}
tags/5.3.1/common/nprogress/nprogress.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(a,b){if(typeof define==="function"&&define.amd){define(b)}else{if(typeof exports==="object"){module.exports=b()}else{a.NProgress=b()}}})(this,function(){var e={};e.version="0.1.6";var b=e.settings={minimum:0.08,easing:"ease",positionUsing:"",speed:200,trickle:true,trickleRate:0.02,trickleSpeed:800,showSpinner:true,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};e.configure=function(m){var n,o;for(n in m){o=m[n];if(o!==undefined&&m.hasOwnProperty(n)){b[n]=o}}return this};e.status=null;e.set=function(s){var m=e.isStarted();s=g(s,b.minimum,1);e.status=(s===1?null:s);var o=e.render(!m),p=o.querySelector(b.barSelector),q=b.speed,r=b.easing;o.offsetWidth;i(function(n){if(b.positionUsing===""){b.positionUsing=e.getPositioningCSS()}h(p,a(s,q,r));if(s===1){h(o,{transition:"none",opacity:1});o.offsetWidth;setTimeout(function(){h(o,{transition:"all "+q+"ms linear",opacity:0});setTimeout(function(){e.remove();n()},q)},q)}else{setTimeout(n,q)}});return this};e.isStarted=function(){return typeof e.status==="number"};e.start=function(){if(!e.status){e.set(0)}var m=function(){setTimeout(function(){if(!e.status){return}e.trickle();m()},b.trickleSpeed)};if(b.trickle){m()}return this};e.done=function(m){if(!m&&!e.status){return this}return e.inc(0.3+0.5*Math.random()).set(1)};e.inc=function(m){var o=e.status;if(!o){return e.start()}else{if(typeof m!=="number"){m=(1-o)*g(Math.random()*o,0.1,0.95)}o=g(o+m,0,0.994);return e.set(o)}};e.trickle=function(){return e.inc(Math.random()*b.trickleRate)};(function(){var m=0,n=0;e.promise=function(o){if(!o||o.state()=="resolved"){return this}if(n==0){e.start()}m++;n++;o.always(function(){n--;if(n==0){m=0;e.done()}else{e.set((m-n)/m)}});return this}})();e.render=function(m){if(e.isRendered()){return document.getElementById("nprogress")}j(document.documentElement,"nprogress-busy");var n=document.createElement("div");n.id="nprogress";n.innerHTML=b.template;var q=n.querySelector(b.barSelector),o=m?"-100":c(e.status||0),p=document.querySelector(b.parent),r;h(q,{transition:"all 0 linear",transform:"translate3d("+o+"%,0,0)"});if(!b.showSpinner){r=n.querySelector(b.spinnerSelector);r&&k(r)}if(p!=document.body){j(p,"nprogress-custom-parent")}p.appendChild(n);return n};e.remove=function(){l(document.documentElement,"nprogress-busy");l(document.querySelector(b.parent),"nprogress-custom-parent");var m=document.getElementById("nprogress");m&&k(m)};e.isRendered=function(){return !!document.getElementById("nprogress")};e.getPositioningCSS=function(){var m=document.body.style;var n=("WebkitTransform" in m)?"Webkit":("MozTransform" in m)?"Moz":("msTransform" in m)?"ms":("OTransform" in m)?"O":"";if(n+"Perspective" in m){return"translate3d"}else{if(n+"Transform" in m){return"translate"}else{return"margin"}}};function g(p,o,m){if(p<o){return o}if(p>m){return m}return p}function c(m){return(-1+m)*100}function a(q,o,p){var m;if(b.positionUsing==="translate3d"){m={transform:"translate3d("+c(q)+"%,0,0)"}}else{if(b.positionUsing==="translate"){m={transform:"translate("+c(q)+"%,0)"}}else{m={"margin-left":c(q)+"%"}}}m.transition="all "+o+"ms "+p;return m}var i=(function(){var n=[];function m(){var o=n.shift();if(o){o(m)}}return function(o){n.push(o);if(n.length==1){m()}}})();var h=(function(){var m=["Webkit","O","Moz","ms"],r={};function o(s){return s.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(t,u){return u.toUpperCase()})}function q(s){var u=document.body.style;if(s in u){return s}var t=m.length,w=s.charAt(0).toUpperCase()+s.slice(1),v;while(t--){v=m[t]+w;if(v in u){return v}}return s}function p(s){s=o(s);return r[s]||(r[s]=q(s))}function n(s,u,t){u=p(u);s.style[u]=t}return function(u,t){var s=arguments,w,v;if(s.length==2){for(w in t){v=t[w];if(v!==undefined&&t.hasOwnProperty(w)){n(u,w,v)}}}else{n(u,s[1],s[2])}}})();function f(n,m){var o=typeof n=="string"?n:d(n);return o.indexOf(" "+m+" ")>=0}function j(n,m){var p=d(n),o=p+m;if(f(p,m)){return}n.className=o.substring(1)}function l(n,m){var p=d(n),o;if(!f(n,m)){return}o=p.replace(" "+m+" "," ");n.className=o.substring(1,o.length-1)}function d(m){return(" "+(m.className||"")+" ").replace(/\s+/gi," ")}function k(m){m&&m.parentNode&&m.parentNode.removeChild(m)}return e});
tags/5.3.1/common/realtime/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-icons_222222_256x240.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-icons_454545_256x240.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-icons_888888_256x240.png ADDED
Binary file
tags/5.3.1/common/realtime/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
tags/5.3.1/common/realtime/jquery.ui.tooltip.html.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! jQuery UI - v1.9.2 - 2013-09-22
2
+ * http://jqueryui.com
3
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */.ui-tooltip.gadwp{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}* html .ui-tooltip.gadwp{background-image:none}body .ui-tooltip.gadwp{border-width:2px}.ui-widget.gadwp{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget.gadwp .ui-widget{font-size:1em}.ui-widget.gadwp input,.ui-widget.gadwp select,.ui-widget.gadwp textarea,.ui-widget.gadwp button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content.gadwp{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content.gadwp a{color:#222}.gadwp .ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.gadwp .ui-widget-header a{color:#222}
tags/5.3.1/common/realtime/jquery.ui.tooltip.html.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(function(){jQuery("#gadwp-widget *").tooltip({items:"[data-gadwp]",content:function(){return jQuery(this).attr("data-gadwp")}})});
tags/5.3.1/config.php ADDED
@@ -0,0 +1,456 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Config' ) ) {
15
+
16
+ final class GADWP_Config {
17
+
18
+ public $options;
19
+
20
+ public function __construct() {
21
+ // Rename old option keys
22
+ $this->option_keys_rename(); // v5.2
23
+ // Get plugin options
24
+ $this->get_plugin_options();
25
+ // Automatic updates
26
+ add_filter( 'auto_update_plugin', array( $this, 'automatic_update' ), 10, 2 );
27
+ // Provide language packs for all available Network languages
28
+ if ( is_multisite() ) {
29
+ add_filter( 'plugins_update_check_locales', array( $this, 'translation_updates' ), 10, 1 );
30
+ }
31
+ }
32
+
33
+ public function get_major_version( $version ) {
34
+ $exploded_version = explode( '.', $version );
35
+ if ( isset( $exploded_version[2] ) ) {
36
+ return $exploded_version[0] . '.' . $exploded_version[1] . '.' . $exploded_version[2];
37
+ } else {
38
+ return $exploded_version[0] . '.' . $exploded_version[1] . '.0';
39
+ }
40
+ }
41
+
42
+ public function automatic_update( $update, $item ) {
43
+ $item = (array) $item;
44
+ if ( is_multisite() && ! is_main_site() ) {
45
+ return;
46
+ }
47
+ if ( ! isset( $item['new_version'] ) || ! isset( $item['plugin'] ) || ! $this->options['automatic_updates_minorversion'] ) {
48
+ return $update;
49
+ }
50
+ if ( isset( $item['slug'] ) && 'google-analytics-dashboard-for-wp' == $item['slug'] ) {
51
+ // Only when a minor update is available
52
+ if ( $this->get_major_version( GADWP_CURRENT_VERSION ) == $this->get_major_version( $item['new_version'] ) ) {
53
+ return ( $this->get_major_version( GADWP_CURRENT_VERSION ) == $this->get_major_version( $item['new_version'] ) );
54
+ }
55
+ }
56
+ return $update;
57
+ }
58
+
59
+ public function translation_updates( $locales ) {
60
+ $languages = get_available_languages();
61
+ return array_values( $languages );
62
+ }
63
+
64
+ // Validates data before storing
65
+ private function validate_data( $options ) {
66
+ /* @formatter:off */
67
+ $numerics = array( 'ga_realtime_pages',
68
+ 'ga_enhanced_links',
69
+ 'ga_crossdomain_tracking',
70
+ 'ga_author_dimindex',
71
+ 'ga_category_dimindex',
72
+ 'ga_tag_dimindex',
73
+ 'ga_user_dimindex',
74
+ 'ga_pubyear_dimindex',
75
+ 'ga_pubyearmonth_dimindex',
76
+ 'tm_author_var',
77
+ 'tm_category_var',
78
+ 'tm_tag_var',
79
+ 'tm_user_var',
80
+ 'tm_pubyear_var',
81
+ 'tm_pubyearmonth_var',
82
+ 'ga_aff_tracking',
83
+ 'amp_tracking_analytics',
84
+ 'amp_tracking_clientidapi',
85
+ 'amp_tracking_tagmanager',
86
+ 'optimize_tracking',
87
+ 'optimize_pagehiding',
88
+ 'trackingcode_infooter',
89
+ 'trackingevents_infooter',
90
+ 'ga_formsubmit_tracking',
91
+ 'superadmin_tracking',
92
+ 'ga_pagescrolldepth_tracking',
93
+ 'tm_pagescrolldepth_tracking',
94
+ 'ga_speed_samplerate',
95
+ 'ga_user_samplerate',
96
+ 'ga_event_precision',
97
+ 'with_endpoint',
98
+ 'backend_realtime_report',
99
+ 'ga_optout',
100
+ 'ga_dnt_optout',
101
+ 'ga_with_gtag',
102
+ );
103
+ foreach ( $numerics as $key ) {
104
+ if ( isset( $options[$key] ) ) {
105
+ $options[$key] = (int) $options[$key];
106
+ }
107
+ }
108
+
109
+ $texts = array( 'ga_crossdomain_list',
110
+ 'client_id',
111
+ 'client_secret',
112
+ 'theme_color',
113
+ 'ga_target_geomap',
114
+ 'ga_cookiedomain',
115
+ 'ga_cookiename',
116
+ 'pagetitle_404',
117
+ 'maps_api_key',
118
+ 'web_containerid',
119
+ 'amp_containerid',
120
+ 'optimize_containerid',
121
+ 'ga_event_downloads',
122
+ 'ga_event_affiliates',
123
+ 'ecommerce_mode',
124
+ 'tracking_type',
125
+ );
126
+ foreach ( $texts as $key ) {
127
+ if ( isset( $options[$key] ) ) {
128
+ $options[$key] = trim (sanitize_text_field( $options[$key] ));
129
+ }
130
+ }
131
+ /* @formatter:on */
132
+
133
+ if ( isset( $options['ga_event_downloads'] ) && empty( $options['ga_event_downloads'] ) ) {
134
+ $options['ga_event_downloads'] = 'zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*';
135
+ }
136
+
137
+ if ( isset( $options['pagetitle_404'] ) && empty( $options['pagetitle_404'] ) ) {
138
+ $options['pagetitle_404'] = 'Page Not Found';
139
+ }
140
+
141
+ if ( isset( $options['ga_event_affiliates'] ) && empty( $options['ga_event_affiliates'] ) ) {
142
+ $options['ga_event_affiliates'] = '/out/';
143
+ }
144
+
145
+ if ( isset( $options['ga_speed_samplerate'] ) && ( $options['ga_speed_samplerate'] < 1 || $options['ga_speed_samplerate'] > 100 ) ) {
146
+ $options['ga_speed_samplerate'] = 1;
147
+ }
148
+
149
+ if ( isset( $options['ga_user_samplerate'] ) && ( $options['ga_user_samplerate'] < 1 || $options['ga_user_samplerate'] > 100 ) ) {
150
+ $options['ga_user_samplerate'] = 100;
151
+ }
152
+
153
+ if ( isset( $options['ga_cookieexpires'] ) && $options['ga_cookieexpires'] ) { // v4.9
154
+ $options['ga_cookieexpires'] = (int) $options['ga_cookieexpires'];
155
+ }
156
+
157
+ return $options;
158
+ }
159
+
160
+ public function set_plugin_options( $network_settings = false ) {
161
+ // Handle Network Mode
162
+ $options = $this->options;
163
+ $get_network_options = get_site_option( 'gadwp_network_options' );
164
+ $old_network_options = (array) json_decode( $get_network_options );
165
+
166
+ if ( is_multisite() ) {
167
+ if ( $network_settings ) { // Retrieve network options, clear blog options, store both to db
168
+ $network_options['token'] = $this->options['token'];
169
+ $options['token'] = '';
170
+ if ( is_network_admin() ) {
171
+ $network_options['ga_profiles_list'] = $this->options['ga_profiles_list'];
172
+ $options['ga_profiles_list'] = array();
173
+ $network_options['client_id'] = $this->options['client_id'];
174
+ $options['client_id'] = '';
175
+ $network_options['client_secret'] = $this->options['client_secret'];
176
+ $options['client_secret'] = '';
177
+ $network_options['user_api'] = $this->options['user_api'];
178
+ $options['user_api'] = 0;
179
+ $network_options['network_mode'] = $this->options['network_mode'];
180
+ $network_options['superadmin_tracking'] = $this->options['superadmin_tracking'];
181
+ $network_options['automatic_updates_minorversion'] = $this->options['automatic_updates_minorversion'];
182
+ unset( $options['network_mode'] );
183
+ if ( isset( $this->options['network_tableid'] ) ) {
184
+ $network_options['network_tableid'] = $this->options['network_tableid'];
185
+ unset( $options['network_tableid'] );
186
+ }
187
+ }
188
+ $merged_options = array_merge( $old_network_options, $network_options );
189
+ update_site_option( 'gadwp_network_options', json_encode( $this->validate_data( $merged_options ) ) );
190
+ }
191
+ }
192
+ update_option( 'gadwp_options', json_encode( $this->validate_data( $options ) ) );
193
+ }
194
+
195
+ private function get_plugin_options() {
196
+ /*
197
+ * Get plugin options
198
+ */
199
+ global $blog_id;
200
+
201
+ if ( ! get_option( 'gadwp_options' ) ) {
202
+ GADWP_Install::install();
203
+ }
204
+ $this->options = (array) json_decode( get_option( 'gadwp_options' ) );
205
+ // Maintain Compatibility
206
+ $this->maintain_compatibility();
207
+ // Handle Network Mode
208
+ if ( is_multisite() ) {
209
+ $get_network_options = get_site_option( 'gadwp_network_options' );
210
+ $network_options = (array) json_decode( $get_network_options );
211
+ if ( isset( $network_options['network_mode'] ) && ( $network_options['network_mode'] ) ) {
212
+ if ( ! is_network_admin() && ! empty( $network_options['ga_profiles_list'] ) && isset( $network_options['network_tableid']->$blog_id ) ) {
213
+ $network_options['ga_profiles_list'] = array( 0 => GADWP_Tools::get_selected_profile( $network_options['ga_profiles_list'], $network_options['network_tableid']->$blog_id ) );
214
+ $network_options['tableid_jail'] = $network_options['ga_profiles_list'][0][1];
215
+ }
216
+ $this->options = array_merge( $this->options, $network_options );
217
+ } else {
218
+ $this->options['network_mode'] = 0;
219
+ }
220
+ }
221
+ }
222
+
223
+ private function maintain_compatibility() {
224
+ $flag = false;
225
+
226
+ $prevver = get_option( 'gadwp_version' );
227
+ if ( $prevver && GADWP_CURRENT_VERSION != $prevver ) {
228
+ $flag = true;
229
+ update_option( 'gadwp_version', GADWP_CURRENT_VERSION );
230
+ update_option( 'gadwp_got_updated', true );
231
+ GADWP_Tools::clear_cache();
232
+ GADWP_Tools::delete_cache( 'last_error' );
233
+ if ( is_multisite() ) { // Cleanup errors and cookies on the entire network
234
+ foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) {
235
+ switch_to_blog( $blog['blog_id'] );
236
+ GADWP_Tools::delete_cache( 'gapi_errors' );
237
+ restore_current_blog();
238
+ }
239
+ } else {
240
+ GADWP_Tools::delete_cache( 'gapi_errors' );
241
+ }
242
+
243
+ // Enable GADWP EndPoint for those updating from a version lower than 5.2, introduced in GADWP v5.3
244
+ if (version_compare( $prevver, '5.2', '<' ) ) {
245
+ $this->options['with_endpoint'] = 2;
246
+ }
247
+ }
248
+
249
+ if ( isset( $this->options['item_reports'] ) ) { // v4.8
250
+ $this->options['backend_item_reports'] = $this->options['item_reports'];
251
+ }
252
+ if ( isset( $this->options['ga_dash_frontend_stats'] ) ) { // v4.8
253
+ $this->options['frontend_item_reports'] = $this->options['ga_dash_frontend_stats'];
254
+ }
255
+
256
+ /* @formatter:off */
257
+ $zeros = array( 'ga_enhanced_links',
258
+ 'network_mode',
259
+ 'ga_enhanced_excludesa',
260
+ 'ga_remarketing',
261
+ 'ga_event_bouncerate',
262
+ 'ga_author_dimindex',
263
+ 'ga_tag_dimindex',
264
+ 'ga_category_dimindex',
265
+ 'ga_user_dimindex',
266
+ 'ga_pubyear_dimindex',
267
+ 'ga_pubyearmonth_dimindex',
268
+ 'tm_author_var', // v5.0
269
+ 'tm_category_var', // v5.0
270
+ 'tm_tag_var', // v5.0
271
+ 'tm_user_var', // v5.0
272
+ 'tm_pubyear_var', // v5.0
273
+ 'tm_pubyearmonth_var', // v5.0
274
+ 'ga_crossdomain_tracking',
275
+ 'api_backoff', // v4.8.1.3
276
+ 'ga_aff_tracking',
277
+ 'ga_hash_tracking',
278
+ 'switch_profile', // V4.7
279
+ 'amp_tracking_analytics', //v5.0
280
+ 'amp_tracking_clientidapi', //v5.1.2
281
+ 'optimize_tracking', //v5.0
282
+ 'optimize_pagehiding', //v5.0
283
+ 'amp_tracking_tagmanager', //v5.0
284
+ 'trackingcode_infooter', //v5.0
285
+ 'trackingevents_infooter', //v5.0
286
+ 'ga_formsubmit_tracking', //v5.0
287
+ 'superadmin_tracking', //v5.0
288
+ 'ga_pagescrolldepth_tracking', //v5.0
289
+ 'tm_pagescrolldepth_tracking', //v5.0
290
+ 'ga_event_precision', //v5.1.1.1
291
+ 'ga_force_ssl', //v5.1.2
292
+ 'with_endpoint', //v5.2
293
+ 'backend_realtime_report', //v5.2
294
+ 'ga_optout', //v5.2.3
295
+ 'ga_dnt_optout', //v5.2.3
296
+ 'ga_with_gtag', //v5.3
297
+ 'frontend_item_reports',
298
+ );
299
+ foreach ( $zeros as $key ) {
300
+ if ( ! isset( $this->options[$key] ) ) {
301
+ $this->options[$key] = 0;
302
+ $flag = true;
303
+ }
304
+ }
305
+
306
+ if ( isset($this->options['ga_dash_tracking']) && 0 == $this->options['ga_dash_tracking'] ) { // v5.0.1
307
+ $this->options['tracking_type'] = 'disabled';
308
+ $flag = true;
309
+ }
310
+
311
+ $unsets = array( 'ga_dash_jailadmins', // v4.7
312
+ 'ga_tracking_code',
313
+ 'ga_dash_tableid', // v4.9
314
+ 'ga_dash_frontend_keywords', // v4.8
315
+ 'ga_dash_apikey', // v4.9.1.3
316
+ 'ga_dash_default_metric', // v4.8.1
317
+ 'ga_dash_default_dimension', // v4.8.1
318
+ 'ga_dash_adsense', // v5.0
319
+ 'ga_dash_frontend_stats', // v4.8
320
+ 'item_reports', // v4.8
321
+ 'ga_dash_tracking', // v5.0
322
+ 'ga_dash_cachetime', // v5.2
323
+ 'ga_dash_default_ua', // v5.2
324
+ 'ga_dash_hidden', // v5.2
325
+ );
326
+ foreach ( $unsets as $key ) {
327
+ if ( isset( $this->options[$key] ) ) {
328
+ unset( $this->options[$key] );
329
+ $flag = true;
330
+ }
331
+ }
332
+
333
+ $empties = array( 'ga_crossdomain_list',
334
+ 'ga_cookiedomain', // v4.9.4
335
+ 'ga_cookiename', // v4.9.4
336
+ 'ga_cookieexpires', // v4.9.4
337
+ 'maps_api_key', // v4.9.4
338
+ 'web_containerid', // v5.0
339
+ 'amp_containerid', // v5.0
340
+ 'optimize_containerid', // v5.0
341
+ );
342
+ foreach ( $empties as $key ) {
343
+ if ( ! isset( $this->options[$key] ) ) {
344
+ $this->options[$key] = '';
345
+ $flag = true;
346
+ }
347
+ }
348
+
349
+ $ones = array( 'ga_speed_samplerate',
350
+ 'automatic_updates_minorversion',
351
+ 'backend_item_reports', // v4.8
352
+ 'dashboard_widget', // v4.7
353
+ );
354
+ foreach ( $ones as $key ) {
355
+ if ( ! isset( $this->options[$key] ) ) {
356
+ $this->options[$key] = 1;
357
+ $flag = true;
358
+ }
359
+ }
360
+
361
+ $arrays = array( 'access_front',
362
+ 'access_back',
363
+ 'ga_profiles_list',
364
+ 'track_exclude',
365
+ );
366
+ foreach ( $arrays as $key ) {
367
+ if ( ! is_array( $this->options[$key] ) ) {
368
+ $this->options[$key] = array();
369
+ $flag = true;
370
+ }
371
+ }
372
+ if ( empty( $this->options['access_front'] ) ) {
373
+ $this->options['access_front'][] = 'administrator';
374
+ }
375
+ if ( empty( $this->options['access_back'] ) ) {
376
+ $this->options['access_back'][] = 'administrator';
377
+ }
378
+ /* @formatter:on */
379
+
380
+ if ( ! isset( $this->options['ga_event_affiliates'] ) ) {
381
+ $this->options['ga_event_affiliates'] = '/out/';
382
+ $flag = true;
383
+ }
384
+
385
+ if ( ! isset( $this->options['ga_user_samplerate'] ) ) {
386
+ $this->options['ga_user_samplerate'] = 100;
387
+ }
388
+
389
+ if ( ! isset( $this->options['ga_event_downloads'] ) ) {
390
+ $this->options['ga_event_downloads'] = 'zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*';
391
+ $flag = true;
392
+ }
393
+
394
+ if ( ! isset( $this->options['pagetitle_404'] ) ) { // v4.9.4
395
+ $this->options['pagetitle_404'] = 'Page Not Found';
396
+ $flag = true;
397
+ }
398
+
399
+ if ( ! isset( $this->options['ecommerce_mode'] ) ) { // v5.0
400
+ $this->options['ecommerce_mode'] = 'disabled';
401
+ $flag = true;
402
+ }
403
+
404
+ if ( isset( $this->options['ga_dash_tracking'] ) && 'classic' == $this->options['ga_dash_tracking'] ) { // v5.0
405
+ $this->options['tracking_type'] = 'universal';
406
+ $flag = true;
407
+ }
408
+
409
+ if ( $flag ) {
410
+ $this->set_plugin_options( false );
411
+ }
412
+ }
413
+
414
+ private function option_keys_rename() {
415
+
416
+ /* @formatter:off */
417
+ $batch = array( 'ga_dash_token' => 'token',
418
+ 'ga_dash_clientid' => 'client_id',
419
+ 'ga_dash_clientsecret' => 'client_secret',
420
+ 'ga_dash_access_front' => 'access_front',
421
+ 'ga_dash_access_back' => 'access_back',
422
+ 'ga_dash_tableid_jail' => 'tableid_jail',
423
+ 'ga_dash_tracking_type' => 'tracking_type',
424
+ 'ga_dash_userapi' => 'user_api',
425
+ 'ga_dash_network' => 'network_mode',
426
+ 'ga_dash_tableid_network' => 'network_tableid',
427
+ 'ga_dash_anonim' => 'ga_anonymize_ip',
428
+ 'ga_dash_profile_list' => 'ga_profiles_list',
429
+ 'ga_dash_remarketing' => 'ga_remarketing',
430
+ 'ga_dash_excludesa' => 'superadmin_tracking',
431
+ 'ga_track_exclude' => 'track_exclude',
432
+ 'ga_dash_style' => 'theme_color',
433
+ );
434
+ /* @formatter:on */
435
+
436
+ if ( is_multisite() ) {
437
+ $options = get_site_option( 'gadash_network_options' );
438
+ if ( $options ) {
439
+ $options = (array) json_decode( $options );
440
+ $options = GADWP_Tools::array_keys_rename( $options, $batch );
441
+ update_site_option( 'gadwp_network_options', json_encode( $this->validate_data( $options ) ) );
442
+ delete_site_option( 'gadash_network_options' );
443
+ }
444
+ }
445
+
446
+ $options = get_option( 'gadash_options' );
447
+ if ( $options ) {
448
+ $options = (array) json_decode( $options );
449
+ $options = GADWP_Tools::array_keys_rename( $options, $batch );
450
+ update_option( 'gadwp_options', json_encode( $this->validate_data( $options ) ) );
451
+ delete_option( 'gadash_options' );
452
+ }
453
+ }
454
+ }
455
+ }
456
+
tags/5.3.1/front/ajax-actions.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Frontend_Ajax' ) ) {
15
+
16
+ final class GADWP_Frontend_Ajax {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
24
+ // Item Reports action
25
+ add_action( 'wp_ajax_gadwp_frontend_item_reports', array( $this, 'ajax_item_reports' ) );
26
+ }
27
+
28
+ // Frontend Widget actions
29
+ add_action( 'wp_ajax_ajax_frontwidget_report', array( $this, 'ajax_frontend_widget' ) );
30
+ add_action( 'wp_ajax_nopriv_ajax_frontwidget_report', array( $this, 'ajax_frontend_widget' ) );
31
+ }
32
+
33
+ /**
34
+ * Ajax handler for Item Reports
35
+ *
36
+ * @return string|int
37
+ */
38
+ public function ajax_item_reports() {
39
+ if ( ! isset( $_POST['gadwp_security_frontend_item_reports'] ) || ! wp_verify_nonce( $_POST['gadwp_security_frontend_item_reports'], 'gadwp_frontend_item_reports' ) ) {
40
+ wp_die( - 30 );
41
+ }
42
+
43
+ $from = $_POST['from'];
44
+ $to = $_POST['to'];
45
+ $query = $_POST['query'];
46
+ $uri = $_POST['filter'];
47
+ if ( isset( $_POST['metric'] ) ) {
48
+ $metric = $_POST['metric'];
49
+ } else {
50
+ $metric = 'pageviews';
51
+ }
52
+
53
+ $query = $_POST['query'];
54
+ if ( ob_get_length() ) {
55
+ ob_clean();
56
+ }
57
+
58
+ if ( ! GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) || 0 == $this->gadwp->config->options['frontend_item_reports'] ) {
59
+ wp_die( - 31 );
60
+ }
61
+
62
+ if ( $this->gadwp->config->options['token'] && $this->gadwp->config->options['tableid_jail'] ) {
63
+ if ( null === $this->gadwp->gapi_controller ) {
64
+ $this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
65
+ }
66
+ } else {
67
+ wp_die( - 24 );
68
+ }
69
+
70
+ if ( $this->gadwp->config->options['tableid_jail'] ) {
71
+ $projectId = $this->gadwp->config->options['tableid_jail'];
72
+ } else {
73
+ wp_die( - 26 );
74
+ }
75
+
76
+ $profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $projectId );
77
+
78
+ if ( isset( $profile_info[4] ) ) {
79
+ $this->gadwp->gapi_controller->timeshift = $profile_info[4];
80
+ } else {
81
+ $this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
82
+ }
83
+
84
+ $uri = '/' . ltrim( $uri, '/' );
85
+
86
+ // allow URL correction before sending an API request
87
+ $filter = apply_filters( 'gadwp_frontenditem_uri', $uri );
88
+
89
+ $lastchar = substr( $filter, - 1 );
90
+
91
+ if ( isset( $profile_info[6] ) && $profile_info[6] && '/' == $lastchar ) {
92
+ $filter = $filter . $profile_info[6];
93
+ }
94
+
95
+ // Encode URL
96
+ $filter = rawurlencode( rawurldecode( $filter ) );
97
+
98
+ $queries = explode( ',', $query );
99
+
100
+ $results = array();
101
+
102
+ foreach ( $queries as $value ) {
103
+ $results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to, $filter, $metric );
104
+ }
105
+
106
+ wp_send_json( $results );
107
+ }
108
+
109
+ /**
110
+ * Ajax handler for getting analytics data for frontend Widget
111
+ *
112
+ * @return string|int
113
+ */
114
+ public function ajax_frontend_widget() {
115
+ if ( ! isset( $_POST['gadwp_number'] ) || ! isset( $_POST['gadwp_optionname'] ) || ! is_active_widget( false, false, 'gadwp-frontwidget-report' ) ) {
116
+ wp_die( - 30 );
117
+ }
118
+ $widget_index = $_POST['gadwp_number'];
119
+ $option_name = $_POST['gadwp_optionname'];
120
+ $options = get_option( $option_name );
121
+ if ( isset( $options[$widget_index] ) ) {
122
+ $instance = $options[$widget_index];
123
+ } else {
124
+ wp_die( - 32 );
125
+ }
126
+ switch ( $instance['period'] ) { // make sure we have a valid request
127
+ case '7daysAgo' :
128
+ $period = '7daysAgo';
129
+ break;
130
+ case '14daysAgo' :
131
+ $period = '14daysAgo';
132
+ break;
133
+ default :
134
+ $period = '30daysAgo';
135
+ break;
136
+ }
137
+ if ( ob_get_length() ) {
138
+ ob_clean();
139
+ }
140
+ if ( $this->gadwp->config->options['token'] && $this->gadwp->config->options['tableid_jail'] ) {
141
+ if ( null === $this->gadwp->gapi_controller ) {
142
+ $this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
143
+ }
144
+ } else {
145
+ wp_die( - 24 );
146
+ }
147
+ $projectId = $this->gadwp->config->options['tableid_jail'];
148
+ $profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $projectId );
149
+ if ( isset( $profile_info[4] ) ) {
150
+ $this->gadwp->gapi_controller->timeshift = $profile_info[4];
151
+ } else {
152
+ $this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
153
+ }
154
+ wp_send_json( $this->gadwp->gapi_controller->frontend_widget_stats( $projectId, $period, (int) $instance['anonim'] ) );
155
+ }
156
+ }
157
+ }
tags/5.3.1/front/css/item-reports.css ADDED
@@ -0,0 +1 @@
 
1
+ .column-gadwp_stats{width:70px}.gadwp-icon{color:#555}.gadwp-icon:hover{color:#2ea2cc}.gadwp-icon-oldwp{padding-top:5px}[id^=gadwp-container-]{width:480px}[id^=gadwp-areachart-]{height:280px}[id^=gadwp-progressbar-]{width:100%;height:3px;margin:5px 0 0 0}[id^=gadwp-bottomstats-]{width:100%}[id^=gadwp-bottomstats-] .inside{display:table;margin:0 auto;padding:0}[id^=gadwp-bottomstats-] .inside .small-box{width:31.2%;float:left;margin:10px 5px 10px 5px;background:#fff;text-align:center;-moz-box-shadow:0 0 7px 0 #BBB;-webkit-box-shadow:0 0 7px 0 #BBB;box-shadow:0 0 7px 0 #BBB}[id^=gadwp-bottomstats-] .inside .small-box h3{font-family:'Open Sans',sans-serif;font-size:1em;color:#777;padding:0 5px 0 5px;margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}[id^=gadwp-bottomstats-] .inside .small-box p{font-size:1.2em;margin:0 0 2px 0}.gadwp-floatwraper{display:table;width:100%;height:100%}[id^=gadwp-piechart-].halfsize{width:47%;margin:10px 0 0 0;height:200px;float:left}[id^=gadwp-piechart-].floatleft{float:left}[id^=gadwp-piechart-].floatright{float:right}[id^=gadwp-tablechart-],[id^=gadwp-tablechart-]{margin:10px 0 0 0}.ui-dialog.gadwp{font-family:'Open Sans',sans-serif;font-size:13px;-webkit-box-sizing:initial;-moz-box-sizing:initial}.ui-dialog.gadwp select{font-family:'Open Sans',sans-serif;border:1px solid #ddd;font-size:14px;background:#fff;padding:2px;color:#333;width:auto}.ui-dialog.gadwp table{margin:auto;width:auto}.gadwp .ui-dialog-titlebar{font-size:1.1em;text-overflow:ellipsis;overflow:hidden}@media screen and (max-width:500px){[id^=gadwp-container-]{width:410px}[id^=gadwp-bottomstats-] .inside .small-box{width:30.8%}}@media screen and (max-width:410px){[id^=gadwp-container-]{width:260px}[id^=gadwp-bottomstats-] .inside .small-box{width:46%}}#wpadminbar #wp-admin-bar-gadwp-1>.ab-item:before{content:'\f239';top:2px}.no-font-face #wpadminbar #wp-admin-bar-gadwp-1>.ab-item{text-indent:0}@media screen and (max-width:782px){#wpadminbar #wp-admin-bar-gadwp-1>.ab-item{text-indent:100%;white-space:nowrap;overflow:hidden;width:52px;padding:0;color:#999;position:relative}#wpadminbar #wp-admin-bar-gadwp-1>.ab-item:before{display:block;text-indent:0;font:normal 32px/1 'dashicons';speak:none;top:7px;width:52px;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#wpadminbar li#wp-admin-bar-gadwp-1{display:block}#wpadminbar #wp-admin-bar-gadwp-1{position:static}}
tags/5.3.1/front/css/widgets.css ADDED
@@ -0,0 +1 @@
 
1
+ #gadwp{font-family:'Open Sans',sans-serif}#gadwp-searches td{line-height:1.5em;padding:2px;font-size:1em}#gadwp-searches{line-height:10px;margin-top:15px}#gadwp-visits{height:200px;margin-top:15px}#gadwp-content{width:100%}#gadwp-title{text-transform:uppercase;font-weight:600;font-size:14px;padding-bottom:2px}#gadwp-widget{padding:0 5px}#gadwp-widgetchart{width:100%}#gadwp-widgettotals{margin:0 0 10px 0;width:100%;display:table;clear:both}#gadwp-widgettotals .gadwp-left{padding:10px 0 0 0;width:45%;float:left;font-weight:600}#gadwp-progressbar{width:100%;height:3px;margin:3px 0}#gadwp-widgettotals .gadwp-right{padding:10px 0 0 0;float:left;font-style:italic}.widget_gadwp-frontwidget-report h2.widget-title{margin-bottom:0}
tags/5.3.1/front/item-reports.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Frontend_Item_Reports' ) ) {
15
+
16
+ final class GADWP_Frontend_Item_Reports {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ add_action( 'admin_bar_menu', array( $this, 'custom_adminbar_node' ), 999 );
24
+ }
25
+
26
+ function custom_adminbar_node( $wp_admin_bar ) {
27
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
28
+ /* @formatter:off */
29
+ $args = array( 'id' => 'gadwp-1',
30
+ 'title' => '<span class="ab-icon"></span><span class="">' . __( "Analytics", 'google-analytics-dashboard-for-wp' ) . '</span>',
31
+ 'href' => '#1',
32
+ );
33
+ /* @formatter:on */
34
+ $wp_admin_bar->add_node( $args );
35
+ }
36
+ }
37
+ }
38
+ }
tags/5.3.1/front/js/tracking-analytics-events.js ADDED
@@ -0,0 +1 @@
 
1
+ "use strict";var gadwpRedirectLink;var gadwpRedirectCalled=false;var gadwpDefaultPrevented=false;function gadwpRedirect(){if(gadwpRedirectCalled){return}gadwpRedirectCalled=true;if(gadwpDefaultPrevented==false){document.location.href=gadwpRedirectLink}else{gadwpDefaultPrevented=false}}function gadwp_send_event(c,d,a,b){if(gadwpUAEventsData.options.ga_with_gtag){if(b){if(gadwpUAEventsData.options.event_bouncerate){gtag("event",d,{event_category:c,event_label:a,non_interaction:1,event_callback:gadwpRedirect})}else{gtag("event",d,{event_category:c,event_label:a,event_callback:gadwpRedirect})}}else{if(gadwpUAEventsData.options.event_bouncerate){gtag("event",d,{event_category:c,event_label:a,non_interaction:1})}else{gtag("event",d,{event_category:c,event_label:a})}}}else{if(b){if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",c,d,a,{nonInteraction:1,hitCallback:gadwpRedirect})}else{ga("send","event",c,d,a,{hitCallback:gadwpRedirect})}}else{if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",c,d,a,{nonInteraction:1})}else{ga("send","event",c,d,a)}}}}jQuery(window).on("load",function(){if(gadwpUAEventsData.options.event_tracking){jQuery("a").filter(function(){if(typeof this.href==="string"){var a=new RegExp(".*\\.("+gadwpUAEventsData.options.event_downloads+")(\\?.*)?$");return this.href.match(a)}}).click(function(d){var b=this.getAttribute("data-vars-ga-category")||"download";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;gadwp_send_event(b,c,a,false)});jQuery('a[href^="mailto"]').click(function(d){var b=this.getAttribute("data-vars-ga-category")||"email";var c=this.getAttribute("data-vars-ga-action")||"send";var a=this.getAttribute("data-vars-ga-label")||this.href;gadwp_send_event(b,c,a,false)});jQuery('a[href^="tel"]').click(function(d){var b=this.getAttribute("data-vars-ga-category")||"telephone";var c=this.getAttribute("data-vars-ga-action")||"call";var a=this.getAttribute("data-vars-ga-label")||this.href;gadwp_send_event(b,c,a,false)});if(gadwpUAEventsData.options.root_domain){jQuery('a[href^="http"]').filter(function(){if(typeof this.href==="string"){var a=new RegExp(".*\\.("+gadwpUAEventsData.options.event_downloads+")(\\?.*)?$")}if(a&&!this.href.match(a)){if(this.href.indexOf(gadwpUAEventsData.options.root_domain)==-1&&this.href.indexOf("://")>-1){return this.href}}}).click(function(d){gadwpRedirectCalled=false;gadwpRedirectLink=this.href;var b=this.getAttribute("data-vars-ga-category")||"outbound";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(this.target!="_blank"&&gadwpUAEventsData.options.event_precision){if(d.isDefaultPrevented()){gadwpDefaultPrevented=true;gadwpRedirectCalled=false}}else{gadwpRedirectCalled=true;gadwpDefaultPrevented=false}if(this.target!="_blank"&&gadwpUAEventsData.options.event_precision){gadwp_send_event(b,c,a,true);setTimeout(gadwpRedirect,gadwpUAEventsData.options.event_timeout);return false}else{gadwp_send_event(b,c,a,false)}})}}if(gadwpUAEventsData.options.event_affiliates&&gadwpUAEventsData.options.aff_tracking){jQuery("a").filter(function(){if(gadwpUAEventsData.options.event_affiliates!=""){if(typeof this.href==="string"){var a=new RegExp("("+gadwpUAEventsData.options.event_affiliates.replace(/\//g,"/")+")");return this.href.match(a)}}}).click(function(d){gadwpRedirectCalled=false;gadwpRedirectLink=this.href;var b=this.getAttribute("data-vars-ga-category")||"affiliates";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(this.target!="_blank"&&gadwpUAEventsData.options.event_precision){if(d.isDefaultPrevented()){gadwpDefaultPrevented=true;gadwpRedirectCalled=false}}else{gadwpRedirectCalled=true;gadwpDefaultPrevented=false}if(this.target!="_blank"&&gadwpUAEventsData.options.event_precision){gadwp_send_event(b,c,a,true);setTimeout(gadwpRedirect,gadwpUAEventsData.options.event_timeout);return false}else{gadwp_send_event(b,c,a,false)}})}if(gadwpUAEventsData.options.root_domain&&gadwpUAEventsData.options.hash_tracking){jQuery("a").filter(function(){if(this.href.indexOf(gadwpUAEventsData.options.root_domain)!=-1||this.href.indexOf("://")==-1){return this.hash}}).click(function(d){var b=this.getAttribute("data-vars-ga-category")||"hashmark";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;gadwp_send_event(b,c,a,false)})}if(gadwpUAEventsData.options.event_formsubmit){jQuery('input[type="submit"], button[type="submit"]').click(function(f){var d=this;var b=d.getAttribute("data-vars-ga-category")||"form";var c=d.getAttribute("data-vars-ga-action")||"submit";var a=d.getAttribute("data-vars-ga-label")||d.name||d.value;gadwp_send_event(b,c,a,false)})}if(gadwpUAEventsData.options.ga_pagescrolldepth_tracking){jQuery.scrollDepth({percentage:true,userTiming:false,pixelDepth:false,gtmOverride:true,nonInteraction:true})}});
tags/5.3.1/front/js/tracking-scrolldepth.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof module==="object"&&module.exports){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(g){var f={minHeight:0,elements:[],percentage:true,userTiming:true,pixelDepth:true,nonInteraction:true,gaGlobal:false,gtmOverride:false,trackerName:false,dataLayer:"dataLayer"};var b=g(window),a=[],h=false,d=0,c,j,e,k,i;g.scrollDepth=function(u){var m=+new Date;u=g.extend({},f,u);if(g(document).height()<u.minHeight){return}if(u.gaGlobal){c=true;e=u.gaGlobal}else{if(typeof gtag==="function"){k=true;e="gtag"}else{if(typeof ga==="function"){c=true;e="ga"}else{if(typeof __gaTracker==="function"){c=true;e="__gaTracker"}}}}if(typeof _gaq!=="undefined"&&typeof _gaq.push==="function"){j=true}if(typeof u.eventHandler==="function"){i=u.eventHandler}else{if(typeof window[u.dataLayer]!=="undefined"&&typeof window[u.dataLayer].push==="function"&&!u.gtmOverride){i=function(v){window[u.dataLayer].push(v)}}}function s(y,w,v,x){var z=u.trackerName?(u.trackerName+".send"):"send";if(i){i({event:"ScrollDistance",eventCategory:"Scroll Depth",eventAction:y,eventLabel:w,eventValue:1,eventNonInteraction:u.nonInteraction});if(u.pixelDepth&&arguments.length>2&&v>d){d=v;i({event:"ScrollDistance",eventCategory:"Scroll Depth",eventAction:"Pixel Depth",eventLabel:n(v),eventValue:1,eventNonInteraction:u.nonInteraction})}if(u.userTiming&&arguments.length>3){i({event:"ScrollTiming",eventCategory:"Scroll Depth",eventAction:y,eventLabel:w,eventTiming:x})}}else{if(k){window[e]("event",y,{event_category:"Scroll Depth",event_label:w,non_interaction:u.nonInteraction})}if(c){window[e](z,"event","Scroll Depth",y,w,1,{nonInteraction:u.nonInteraction});if(u.pixelDepth&&arguments.length>2&&v>d){d=v;window[e](z,"event","Scroll Depth","Pixel Depth",n(v),1,{nonInteraction:u.nonInteraction})}if(u.userTiming&&arguments.length>3){window[e](z,"timing","Scroll Depth",y,x,w)}}if(j){_gaq.push(["_trackEvent","Scroll Depth",y,w,1,u.nonInteraction]);if(u.pixelDepth&&arguments.length>2&&v>d){d=v;_gaq.push(["_trackEvent","Scroll Depth","Pixel Depth",n(v),1,u.nonInteraction])}if(u.userTiming&&arguments.length>3){_gaq.push(["_trackTiming","Scroll Depth",y,x,w,100])}}}}function r(v){return{"25%":parseInt(v*0.25,10),"50%":parseInt(v*0.5,10),"75%":parseInt(v*0.75,10),"100%":v-5}}function p(w,v,x){g.each(w,function(y,z){if(g.inArray(y,a)===-1&&v>=z){s("Percentage",y,v,x);a.push(y)}})}function o(x,v,w){g.each(x,function(y,z){if(g.inArray(z,a)===-1&&g(z).length){if(v>=g(z).offset().top){s("Elements",z,v,w);a.push(z)}}})}function n(v){return(Math.floor(v/250)*250).toString()}function t(){l()}g.scrollDepth.reset=function(){a=[];d=0;b.off("scroll.scrollDepth");l()};g.scrollDepth.addElements=function(v){if(typeof v=="undefined"||!g.isArray(v)){return}g.merge(u.elements,v);if(!h){l()}};g.scrollDepth.removeElements=function(v){if(typeof v=="undefined"||!g.isArray(v)){return}g.each(v,function(x,z){var w=g.inArray(z,u.elements);var y=g.inArray(z,a);if(w!=-1){u.elements.splice(w,1)}if(y!=-1){a.splice(y,1)}})};function q(A,C){var y,x,v;var B=null;var z=0;var w=function(){z=new Date;B=null;v=A.apply(y,x)};return function(){var D=new Date;if(!z){z=D}var E=C-(D-z);y=this;x=arguments;if(E<=0){clearTimeout(B);B=null;z=D;v=A.apply(y,x)}else{if(!B){B=setTimeout(w,E)}}return v}}function l(){h=true;b.on("scroll.scrollDepth",q(function(){var x=g(document).height(),w=window.innerHeight?window.innerHeight:b.height(),v=b.scrollTop()+w,y=r(x),z=+new Date-m;if(a.length>=u.elements.length+(u.percentage?4:0)){b.off("scroll.scrollDepth");h=false;return}if(u.elements){o(u.elements,v,z)}if(u.percentage){p(y,v,z)}},500))}t()};return g.scrollDepth}));
tags/5.3.1/front/js/widgets.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(window).resize(function(){if(typeof gadwp_drawFrontWidgetChart=="function"&&typeof gadwpFrontWidgetData!=="undefined"&&!jQuery.isNumeric(gadwpFrontWidgetData)){gadwp_drawFrontWidgetChart(gadwpFrontWidgetData)}});
tags/5.3.1/front/setup.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Frontend_Setup' ) ) {
15
+
16
+ final class GADWP_Frontend_Setup {
17
+
18
+ private $gadwp;
19
+
20
+ public function __construct() {
21
+ $this->gadwp = GADWP();
22
+
23
+ // Styles & Scripts
24
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
+ }
26
+
27
+ /**
28
+ * Styles & Scripts conditional loading
29
+ *
30
+ * @param
31
+ * $hook
32
+ */
33
+ public function load_styles_scripts() {
34
+ $lang = get_bloginfo( 'language' );
35
+ $lang = explode( '-', $lang );
36
+ $lang = $lang[0];
37
+
38
+ /*
39
+ * Item reports Styles & Scripts
40
+ */
41
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
42
+
43
+ wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
44
+
45
+ wp_enqueue_style( 'gadwp-frontend-item-reports', GADWP_URL . 'front/css/item-reports.css', null, GADWP_CURRENT_VERSION );
46
+
47
+ $country_codes = GADWP_Tools::get_countrycodes();
48
+ if ( $this->gadwp->config->options['ga_target_geomap'] && isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
49
+ $region = $this->gadwp->config->options['ga_target_geomap'];
50
+ } else {
51
+ $region = false;
52
+ }
53
+
54
+ wp_enqueue_style( "wp-jquery-ui-dialog" );
55
+
56
+ wp_register_script( 'googlecharts', 'https://www.gstatic.com/charts/loader.js', array(), null );
57
+
58
+ wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
59
+
60
+ wp_enqueue_script( 'gadwp-frontend-item-reports', GADWP_URL . 'common/js/reports5.js', array( 'gadwp-nprogress', 'googlecharts', 'jquery', 'jquery-ui-dialog' ), GADWP_CURRENT_VERSION, true );
61
+
62
+ /* @formatter:off */
63
+ wp_localize_script( 'gadwp-frontend-item-reports', 'gadwpItemData', array(
64
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
65
+ 'security' => wp_create_nonce( 'gadwp_frontend_item_reports' ),
66
+ 'dateList' => array(
67
+ 'today' => __( "Today", 'google-analytics-dashboard-for-wp' ),
68
+ 'yesterday' => __( "Yesterday", 'google-analytics-dashboard-for-wp' ),
69
+ '7daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 7 ),
70
+ '14daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 14 ),
71
+ '30daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 30 ),
72
+ '90daysAgo' => sprintf( __( "Last %d Days", 'google-analytics-dashboard-for-wp' ), 90 ),
73
+ '365daysAgo' => sprintf( _n( "%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp' ), __('One', 'google-analytics-dashboard-for-wp') ),
74
+ '1095daysAgo' => sprintf( _n( "%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp' ), __('Three', 'google-analytics-dashboard-for-wp') ),
75
+ ),
76
+ 'reportList' => array(
77
+ 'uniquePageviews' => __( "Unique Views", 'google-analytics-dashboard-for-wp' ),
78
+ 'users' => __( "Users", 'google-analytics-dashboard-for-wp' ),
79
+ 'organicSearches' => __( "Organic", 'google-analytics-dashboard-for-wp' ),
80
+ 'pageviews' => __( "Page Views", 'google-analytics-dashboard-for-wp' ),
81
+ 'visitBounceRate' => __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
82
+ 'locations' => __( "Location", 'google-analytics-dashboard-for-wp' ),
83
+ 'referrers' => __( "Referrers", 'google-analytics-dashboard-for-wp' ),
84
+ 'searches' => __( "Searches", 'google-analytics-dashboard-for-wp' ),
85
+ 'trafficdetails' => __( "Traffic", 'google-analytics-dashboard-for-wp' ),
86
+ 'technologydetails' => __( "Technology", 'google-analytics-dashboard-for-wp' ),
87
+ ),
88
+ 'i18n' => array(
89
+ __( "A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp' ), //0
90
+ __( "Traffic Mediums", 'google-analytics-dashboard-for-wp' ),
91
+ __( "Visitor Type", 'google-analytics-dashboard-for-wp' ),
92
+ __( "Search Engines", 'google-analytics-dashboard-for-wp' ),
93
+ __( "Social Networks", 'google-analytics-dashboard-for-wp' ),
94
+ __( "Unique Views", 'google-analytics-dashboard-for-wp' ),
95
+ __( "Users", 'google-analytics-dashboard-for-wp' ),
96
+ __( "Page Views", 'google-analytics-dashboard-for-wp' ),
97
+ __( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
98
+ __( "Organic Search", 'google-analytics-dashboard-for-wp' ),
99
+ __( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
100
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
101
+ __( "No Data", 'google-analytics-dashboard-for-wp' ),
102
+ __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
103
+ __( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
104
+ __( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <strong>' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</strong>!',
105
+ __( "Browser", 'google-analytics-dashboard-for-wp' ), //16
106
+ __( "Operating System", 'google-analytics-dashboard-for-wp' ),
107
+ __( "Screen Resolution", 'google-analytics-dashboard-for-wp' ),
108
+ __( "Mobile Brand", 'google-analytics-dashboard-for-wp' ),
109
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
110
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
111
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
112
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
113
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ),
114
+ __( "Future Use", 'google-analytics-dashboard-for-wp' ), //25
115
+ __( "Time on Page", 'google-analytics-dashboard-for-wp' ),
116
+ __( "Page Load Time", 'google-analytics-dashboard-for-wp' ),
117
+ __( "Exit Rate", 'google-analytics-dashboard-for-wp' ),
118
+ __( "Precision: ", 'google-analytics-dashboard-for-wp' ), //29
119
+ ),
120
+ 'colorVariations' => GADWP_Tools::variations( $this->gadwp->config->options['theme_color'] ),
121
+ 'region' => $region,
122
+ 'mapsApiKey' => apply_filters( 'gadwp_maps_api_key', $this->gadwp->config->options['maps_api_key'] ),
123
+ 'language' => get_bloginfo( 'language' ),
124
+ 'filter' => $_SERVER["REQUEST_URI"],
125
+ 'viewList' => false,
126
+ 'scope' => 'front-item',
127
+ )
128
+ );
129
+ /* @formatter:on */
130
+ }
131
+ }
132
+ }
133
+ }
tags/5.3.1/front/tracking-analytics.php ADDED
@@ -0,0 +1,775 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2017 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Tracking_Analytics_Base' ) ) {
15
+
16
+ class GADWP_Tracking_Analytics_Base {
17
+
18
+ protected $gadwp;
19
+
20
+ protected $uaid;
21
+
22
+ public function __construct() {
23
+ $this->gadwp = GADWP();
24
+
25
+ $profile = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $this->gadwp->config->options['tableid_jail'] );
26
+
27
+ $this->uaid = esc_html( $profile[2] );
28
+ }
29
+
30
+ protected function build_custom_dimensions() {
31
+ $custom_dimensions = array();
32
+
33
+ if ( $this->gadwp->config->options['ga_author_dimindex'] && ( is_single() || is_page() ) ) {
34
+ global $post;
35
+ $author_id = $post->post_author;
36
+ $author_name = get_the_author_meta( 'display_name', $author_id );
37
+ $index = (int) $this->gadwp->config->options['ga_author_dimindex'];
38
+ $custom_dimensions[$index] = esc_attr( $author_name );
39
+ }
40
+
41
+ if ( $this->gadwp->config->options['ga_pubyear_dimindex'] && is_single() ) {
42
+ global $post;
43
+ $date = get_the_date( 'Y', $post->ID );
44
+ $index = (int) $this->gadwp->config->options['ga_pubyear_dimindex'];
45
+ $custom_dimensions[$index] = (int) $date;
46
+ }
47
+
48
+ if ( $this->gadwp->config->options['ga_pubyearmonth_dimindex'] && is_single() ) {
49
+ global $post;
50
+ $date = get_the_date( 'Y-m', $post->ID );
51
+ $index = (int) $this->gadwp->config->options['ga_pubyearmonth_dimindex'];
52
+ $custom_dimensions[$index] = esc_attr( $date );
53
+ }
54
+
55
+ if ( $this->gadwp->config->options['ga_category_dimindex'] && is_category() ) {
56
+ $fields = array();
57
+ $index = (int) $this->gadwp->config->options['ga_category_dimindex'];
58
+ $custom_dimensions[$index] = esc_attr( single_tag_title( '', false ) );
59
+ }
60
+
61
+ if ( $this->gadwp->config->options['ga_category_dimindex'] && is_single() ) {
62
+ global $post;
63
+ $categories = get_the_category( $post->ID );
64
+ foreach ( $categories as $category ) {
65
+ $index = (int) $this->gadwp->config->options['ga_category_dimindex'];
66
+ $custom_dimensions[$index] = esc_attr( $category->name );
67
+ break;
68
+ }
69
+ }
70
+
71
+ if ( $this->gadwp->config->options['ga_tag_dimindex'] && is_single() ) {
72
+ global $post;
73
+ $fields = array();
74
+ $post_tags_list = '';
75
+ $post_tags_array = get_the_tags( $post->ID );
76
+ if ( $post_tags_array ) {
77
+ foreach ( $post_tags_array as $tag ) {
78
+ $post_tags_list .= $tag->name . ', ';
79
+ }
80
+ }
81
+ $post_tags_list = rtrim( $post_tags_list, ', ' );
82
+ if ( $post_tags_list ) {
83
+ $index = (int) $this->gadwp->config->options['ga_tag_dimindex'];
84
+ $custom_dimensions[$index] = esc_attr( $post_tags_list );
85
+ }
86
+ }
87
+
88
+ if ( $this->gadwp->config->options['ga_user_dimindex'] ) {
89
+ $fields = array();
90
+ $index = (int) $this->gadwp->config->options['ga_user_dimindex'];
91
+ $custom_dimensions[$index] = is_user_logged_in() ? 'registered' : 'guest';
92
+ }
93
+
94
+ return $custom_dimensions;
95
+ }
96
+
97
+ protected function is_event_tracking( $opt, $with_pagescrolldepth = true ) {
98
+ if ( $this->gadwp->config->options['ga_event_tracking'] || $this->gadwp->config->options['ga_aff_tracking'] || $this->gadwp->config->options['ga_hash_tracking'] || $this->gadwp->config->options['ga_formsubmit_tracking'] ) {
99
+ return true;
100
+ }
101
+
102
+ if ( $this->gadwp->config->options['ga_pagescrolldepth_tracking'] && $with_pagescrolldepth ) {
103
+ return true;
104
+ }
105
+ return false;
106
+ }
107
+ }
108
+ }
109
+
110
+ if ( ! class_exists( 'GADWP_Tracking_Analytics_Common' ) ) {
111
+
112
+ class GADWP_Tracking_Analytics_Common extends GADWP_Tracking_Analytics_Base {
113
+
114
+ protected $commands;
115
+
116
+ public function __construct() {
117
+ parent::__construct();
118
+
119
+ $this->load_scripts();
120
+
121
+ if ( $this->gadwp->config->options['optimize_tracking'] && $this->gadwp->config->options['optimize_pagehiding'] && $this->gadwp->config->options['optimize_containerid'] ) {
122
+ add_action( 'wp_head', array( $this, 'optimize_output' ), 99 );
123
+ }
124
+ }
125
+
126
+ /**
127
+ * Styles & Scripts load
128
+ */
129
+ private function load_scripts() {
130
+ if ( $this->is_event_tracking( true ) ) {
131
+
132
+ $root_domain = GADWP_Tools::get_root_domain();
133
+
134
+ wp_enqueue_script( 'gadwp-tracking-analytics-events', GADWP_URL . 'front/js/tracking-analytics-events.js', array( 'jquery' ), GADWP_CURRENT_VERSION, $this->gadwp->config->options['trackingevents_infooter'] );
135
+
136
+ if ( $this->gadwp->config->options['ga_pagescrolldepth_tracking'] ) {
137
+ wp_enqueue_script( 'gadwp-pagescrolldepth-tracking', GADWP_URL . 'front/js/tracking-scrolldepth.js', array( 'jquery' ), GADWP_CURRENT_VERSION, $this->gadwp->config->options['trackingevents_infooter'] );
138
+ }
139
+
140
+ /* @formatter:off */
141
+ wp_localize_script( 'gadwp-tracking-analytics-events', 'gadwpUAEventsData', array(
142
+ 'options' => array(
143
+ 'event_tracking' => $this->gadwp->config->options['ga_event_tracking'],
144
+ 'event_downloads' => esc_js($this->gadwp->config->options['ga_event_downloads']),
145
+ 'event_bouncerate' => $this->gadwp->config->options['ga_event_bouncerate'],
146
+ 'aff_tracking' => $this->gadwp->config->options['ga_aff_tracking'],
147
+ 'event_affiliates' => esc_js($this->gadwp->config->options['ga_event_affiliates']),
148
+ 'hash_tracking' => $this->gadwp->config->options ['ga_hash_tracking'],
149
+ 'root_domain' => $root_domain,
150
+ 'event_timeout' => apply_filters( 'gadwp_analyticsevents_timeout', 100 ),
151
+ 'event_precision' => $this->gadwp->config->options['ga_event_precision'],
152
+ 'event_formsubmit' => $this->gadwp->config->options ['ga_formsubmit_tracking'],
153
+ 'ga_pagescrolldepth_tracking' => $this->gadwp->config->options['ga_pagescrolldepth_tracking'],
154
+ 'ga_with_gtag' => $this->gadwp->config->options ['ga_with_gtag'],
155
+ ),
156
+ )
157
+ );
158
+ /* @formatter:on */
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Outputs the Google Optimize tracking code
164
+ */
165
+ public function optimize_output() {
166
+ GADWP_Tools::load_view( 'front/views/optimize-code.php', array( 'containerid' => $this->gadwp->config->options['optimize_containerid'] ) );
167
+ }
168
+
169
+ /**
170
+ * Sanitizes the output of commands in the tracking code
171
+ * @param string $value
172
+ * @return string
173
+ */
174
+ protected function filter( $value, $is_dim = false ) {
175
+ if ( 'true' == $value || 'false' == $value || ( is_numeric( $value ) && ! $is_dim ) ) {
176
+ return $value;
177
+ }
178
+
179
+ if ( substr( $value, 0, 1 ) == '[' && substr( $value, - 1 ) == ']' || substr( $value, 0, 1 ) == '{' && substr( $value, - 1 ) == '}' ) {
180
+ return $value;
181
+ }
182
+
183
+ return "'" . $value . "'";
184
+ }
185
+
186
+ /**
187
+ * Retrieves the commands
188
+ */
189
+ public function get() {
190
+ return $this->commands;
191
+ }
192
+
193
+ /**
194
+ * Stores the commands
195
+ * @param array $commands
196
+ */
197
+ public function set( $commands ) {
198
+ $this->commands = $commands;
199
+ }
200
+
201
+ /**
202
+ * Formats the command before being added to the commands
203
+ * @param string $command
204
+ * @param array $fields
205
+ * @param string $fieldsobject
206
+ * @return array
207
+ */
208
+ public function prepare( $command, $fields, $fieldsobject = null ) {
209
+ return array( 'command' => $command, 'fields' => $fields, 'fieldsobject' => $fieldsobject );
210
+ }
211
+
212
+ /**
213
+ * Adds a formatted command to commands
214
+ * @param string $command
215
+ * @param array $fields
216
+ * @param string $fieldsobject
217
+ */
218
+ protected function add( $command, $fields, $fieldsobject = null ) {
219
+ $this->commands[] = $this->prepare( $command, $fields, $fieldsobject );
220
+ }
221
+ }
222
+ }
223
+
224
+ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
225
+
226
+ class GADWP_Tracking_Analytics extends GADWP_Tracking_Analytics_Common {
227
+
228
+ public function __construct() {
229
+ parent::__construct();
230
+
231
+ if ( $this->gadwp->config->options['trackingcode_infooter'] ) {
232
+ add_action( 'wp_footer', array( $this, 'output' ), 99 );
233
+ } else {
234
+ add_action( 'wp_head', array( $this, 'output' ), 99 );
235
+ }
236
+ }
237
+
238
+ /**
239
+ * Builds the commands based on user's options
240
+ */
241
+ private function build_commands() {
242
+ $fields = array();
243
+ $fieldsobject = array();
244
+ $fields['trackingId'] = $this->uaid;
245
+ if ( 1 != $this->gadwp->config->options['ga_speed_samplerate'] ) {
246
+ $fieldsobject['siteSpeedSampleRate'] = (int) $this->gadwp->config->options['ga_speed_samplerate'];
247
+ }
248
+ if ( 100 != $this->gadwp->config->options['ga_user_samplerate'] ) {
249
+ $fieldsobject['sampleRate'] = (int) $this->gadwp->config->options['ga_user_samplerate'];
250
+ }
251
+ if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
252
+ $fieldsobject['allowLinker'] = 'true';
253
+ }
254
+ if ( ! empty( $this->gadwp->config->options['ga_cookiedomain'] ) ) {
255
+ $fieldsobject['cookieDomain'] = $this->gadwp->config->options['ga_cookiedomain'];
256
+ } else {
257
+ $fields['cookieDomain'] = 'auto';
258
+ }
259
+ if ( ! empty( $this->gadwp->config->options['ga_cookiename'] ) ) {
260
+ $fieldsobject['cookieName'] = $this->gadwp->config->options['ga_cookiename'];
261
+ }
262
+ if ( ! empty( $this->gadwp->config->options['ga_cookieexpires'] ) ) {
263
+ $fieldsobject['cookieExpires'] = (int) $this->gadwp->config->options['ga_cookieexpires'];
264
+ }
265
+ if ( $this->gadwp->config->options['amp_tracking_clientidapi'] ) {
266
+ $fieldsobject['useAmpClientId'] = 'true';
267
+ }
268
+ $this->add( 'create', $fields, $fieldsobject );
269
+
270
+ if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
271
+ $fields = array();
272
+ $fields['plugin'] = 'linker';
273
+ $this->add( 'require', $fields );
274
+
275
+ $fields = array();
276
+ $domains = '';
277
+ $domains = explode( ',', $this->gadwp->config->options['ga_crossdomain_list'] );
278
+ $domains = array_map( 'trim', $domains );
279
+ $domains = strip_tags( implode( "','", $domains ) );
280
+ $domains = "['" . $domains . "']";
281
+ $fields['domains'] = $domains;
282
+ $this->add( 'linker:autoLink', $fields );
283
+ }
284
+
285
+ if ( $this->gadwp->config->options['ga_remarketing'] ) {
286
+ $fields = array();
287
+ $fields['plugin'] = 'displayfeatures';
288
+ $this->add( 'require', $fields );
289
+ }
290
+
291
+ if ( $this->gadwp->config->options['ga_enhanced_links'] ) {
292
+ $fields = array();
293
+ $fields['plugin'] = 'linkid';
294
+ $this->add( 'require', $fields );
295
+ }
296
+
297
+ if ( $this->gadwp->config->options['ga_force_ssl'] ) {
298
+ $fields = array();
299
+ $fields['option'] = 'forceSSL';
300
+ $fields['value'] = 'true';
301
+ $this->add( 'set', $fields );
302
+ }
303
+
304
+ $custom_dimensions = $this->build_custom_dimensions();
305
+ if ( ! empty( $custom_dimensions ) ) {
306
+ foreach ( $custom_dimensions as $index => $value ) {
307
+ $fields = array();
308
+ $fields['gadwp_dimension'] = 'dimension' . $index;
309
+ $fields['gadwp_dim_value'] = $value;
310
+ $this->add( 'set', $fields );
311
+ }
312
+ }
313
+
314
+ if ( $this->gadwp->config->options['ga_anonymize_ip'] ) {
315
+ $fields = array();
316
+ $fields['option'] = 'anonymizeIp';
317
+ $fields['value'] = 'true';
318
+ $this->add( 'set', $fields );
319
+ }
320
+
321
+ if ( 'enhanced' == $this->gadwp->config->options['ecommerce_mode'] ) {
322
+ $fields = array();
323
+ $fields['plugin'] = 'ec';
324
+ $this->add( 'require', $fields );
325
+ } else if ( 'standard' == $this->gadwp->config->options['ecommerce_mode'] ) {
326
+ $fields = array();
327
+ $fields['plugin'] = 'ecommerce';
328
+ $this->add( 'require', $fields );
329
+ }
330
+
331
+ if ( $this->gadwp->config->options['optimize_tracking'] && $this->gadwp->config->options['optimize_containerid'] ) {
332
+ $fields = array();
333
+ $fields['plugin'] = esc_attr( $this->gadwp->config->options['optimize_containerid'] );
334
+ $this->add( 'require', $fields );
335
+ }
336
+
337
+ $fields = array();
338
+ $fields['hitType'] = 'pageview';
339
+ $this->add( 'send', $fields );
340
+
341
+ do_action( 'gadwp_analytics_commands', $this );
342
+ }
343
+
344
+ /**
345
+ * Outputs the Google Analytics tracking code
346
+ */
347
+ public function output() {
348
+ $this->commands = array();
349
+
350
+ $this->build_commands();
351
+
352
+ $trackingcode = '';
353
+
354
+ foreach ( $this->commands as $set ) {
355
+ $command = $set['command'];
356
+
357
+ $fields = '';
358
+ foreach ( $set['fields'] as $fieldkey => $fieldvalue ) {
359
+ if ( false === strpos( $fieldkey, 'gadwp_dim_value' ) ) {
360
+ $fieldvalue = $this->filter( $fieldvalue );
361
+ } else {
362
+ $fieldvalue = $this->filter( $fieldvalue, true );
363
+ }
364
+ $fields .= ", " . $fieldvalue;
365
+ }
366
+
367
+ if ( $set['fieldsobject'] ) {
368
+ $fieldsobject = ", {";
369
+ foreach ( $set['fieldsobject'] as $fieldkey => $fieldvalue ) {
370
+ $fieldvalue = $this->filter( $fieldvalue );
371
+ $fieldkey = $this->filter( $fieldkey );
372
+ $fieldsobject .= $fieldkey . ": " . $fieldvalue . ", ";
373
+ }
374
+ $fieldsobject = rtrim( $fieldsobject, ", " );
375
+ $fieldsobject .= "}";
376
+ $trackingcode .= " ga('" . $command . "'" . $fields . $fieldsobject . ");\n";
377
+ } else {
378
+ $trackingcode .= " ga('" . $command . "'" . $fields . ");\n";
379
+ }
380
+ }
381
+
382
+ $tracking_script_path = apply_filters( 'gadwp_analytics_script_path', 'https://www.google-analytics.com/analytics.js' );
383
+
384
+ if ( $this->gadwp->config->options['ga_optout'] || $this->gadwp->config->options['ga_dnt_optout'] ) {
385
+ GADWP_Tools::load_view( 'front/views/analytics-optout-code.php', array( 'uaid' => $this->uaid, 'gaDntOptout' => $this->gadwp->config->options['ga_dnt_optout'], 'gaOptout' => $this->gadwp->config->options['ga_optout'] ) );
386
+ }
387
+
388
+ GADWP_Tools::load_view( 'front/views/analytics-code.php', array( 'trackingcode' => $trackingcode, 'tracking_script_path' => $tracking_script_path, 'ga_with_gtag' => $this->gadwp->config->options['ga_with_gtag'] , 'uaid' => $this->uaid ) );
389
+ }
390
+ }
391
+ }
392
+
393
+
394
+ if ( ! class_exists( 'GADWP_Tracking_GlobalSiteTag' ) ) {
395
+
396
+ class GADWP_Tracking_GlobalSiteTag extends GADWP_Tracking_Analytics_Common {
397
+
398
+ public function __construct() {
399
+ parent::__construct();
400
+
401
+ if ( $this->gadwp->config->options['trackingcode_infooter'] ) {
402
+ add_action( 'wp_footer', array( $this, 'output' ), 99 );
403
+ } else {
404
+ add_action( 'wp_head', array( $this, 'output' ), 99 );
405
+ }
406
+ }
407
+
408
+ /**
409
+ * Builds the commands based on user's options
410
+ */
411
+ private function build_commands() {
412
+ $fields = array();
413
+ $fieldsobject = array();
414
+ $fields['trackingId'] = $this->uaid;
415
+ $custom_dimensions = $this->build_custom_dimensions();
416
+ /*
417
+ * if ( 1 != $this->gadwp->config->options['ga_speed_samplerate'] ) {
418
+ * $fieldsobject['siteSpeedSampleRate'] = (int) $this->gadwp->config->options['ga_speed_samplerate'];
419
+ * }
420
+ */
421
+ if ( ! empty( $this->gadwp->config->options['ga_cookiedomain'] ) ) {
422
+ $fieldsobject['cookie_domain'] = $this->gadwp->config->options['ga_cookiedomain'];
423
+ }
424
+ if ( ! empty( $this->gadwp->config->options['ga_cookiename'] ) ) {
425
+ $fieldsobject['cookie_name'] = $this->gadwp->config->options['ga_cookiename'];
426
+ }
427
+ if ( ! empty( $this->gadwp->config->options['ga_cookieexpires'] ) ) {
428
+ $fieldsobject['cookie_expires'] = (int) $this->gadwp->config->options['ga_cookieexpires'];
429
+ }
430
+ /*
431
+ * if ( $this->gadwp->config->options['amp_tracking_clientidapi'] ) {
432
+ * $fieldsobject['useAmpClientId'] = 'true';
433
+ * }
434
+ */
435
+ if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
436
+ $domains = '';
437
+ $domains = explode( ',', $this->gadwp->config->options['ga_crossdomain_list'] );
438
+ $domains = array_map( 'trim', $domains );
439
+ $domains = strip_tags( implode( "','", $domains ) );
440
+ $domains = "['" . $domains . "']";
441
+ $fieldsobject['linker'] = "{ 'domains' : " . $domains . " }";
442
+ }
443
+ if ( ! $this->gadwp->config->options['ga_remarketing'] ) {
444
+ $fieldsobject['allow_display_features'] = 'false';
445
+ }
446
+ if ( $this->gadwp->config->options['ga_enhanced_links'] ) {
447
+ $fieldsobject['link_attribution'] = 'true';
448
+ }
449
+ if ( $this->gadwp->config->options['ga_anonymize_ip'] ) {
450
+ $fieldsobject['anonymize_ip'] = 'true';
451
+ }
452
+ if ( $this->gadwp->config->options['optimize_tracking'] && $this->gadwp->config->options['optimize_containerid'] ) {
453
+ $fieldsobject['optimize_id'] = esc_attr( $this->gadwp->config->options['optimize_containerid'] );
454
+ }
455
+ if ( 100 != $this->gadwp->config->options['ga_user_samplerate'] ) {
456
+ $fieldsobject['sample_rate'] = (int) $this->gadwp->config->options['ga_user_samplerate'];
457
+ }
458
+ if ( ! empty( $custom_dimensions ) ) {
459
+ $fieldsobject['custom_map'] = "{\n\t\t";
460
+ foreach ( $custom_dimensions as $index => $value ) {
461
+ $fieldsobject['custom_map'] .= "'dimension" . $index . "': '" . "gadwp_dim_" . $index . "', \n\t\t";
462
+ }
463
+ $fieldsobject['custom_map'] = rtrim( $fieldsobject['custom_map'], ", \n\t\t" );
464
+ $fieldsobject['custom_map'] .= "\n\t}";
465
+ }
466
+ $this->add( 'config', $fields, $fieldsobject );
467
+
468
+ if ( ! empty( $custom_dimensions ) ) {
469
+ $fields = array();
470
+ $fieldsobject = array();
471
+ $fields['event_name'] = 'gadwp_dimensions';
472
+ foreach ( $custom_dimensions as $index => $value ) {
473
+ $fieldsobject['gadwp_dim_' . $index] = $value;
474
+ }
475
+ $this->add( 'event', $fields, $fieldsobject );
476
+ }
477
+
478
+ do_action( 'gadwp_analytics_commands', $this );
479
+ }
480
+
481
+ /**
482
+ * Outputs the Google Analytics tracking code
483
+ */
484
+ public function output() {
485
+ $this->commands = array();
486
+
487
+ $this->build_commands();
488
+
489
+ $trackingcode = '';
490
+
491
+ foreach ( $this->commands as $set ) {
492
+ $command = $set['command'];
493
+
494
+ $fields = '';
495
+ foreach ( $set['fields'] as $fieldkey => $fieldvalue ) {
496
+ $fieldvalue = $this->filter( $fieldvalue );
497
+ $fields .= ", " . $fieldvalue;
498
+ }
499
+
500
+ if ( $set['fieldsobject'] ) {
501
+ $fieldsobject = ", {\n\t";
502
+ foreach ( $set['fieldsobject'] as $fieldkey => $fieldvalue ) {
503
+ if ( false === strpos( $fieldkey, 'gadwp_' ) ) {
504
+ $fieldvalue = $this->filter( $fieldvalue );
505
+ } else {
506
+ $fieldvalue = $this->filter( $fieldvalue, true );
507
+ }
508
+ $fieldkey = $this->filter( $fieldkey );
509
+ $fieldsobject .= $fieldkey . ": " . $fieldvalue . ", \n\t";
510
+ }
511
+ $fieldsobject = rtrim( $fieldsobject, ", \n\t" );
512
+ $fieldsobject .= "\n }";
513
+ $trackingcode .= " gtag('" . $command . "'" . $fields . $fieldsobject . ");\n";
514
+ } else {
515
+ $trackingcode .= " gtag('" . $command . "'" . $fields . ");\n";
516
+ }
517
+ }
518
+
519
+ $tracking_script_path = apply_filters( 'gadwp_analytics_script_path', 'https://www.googletagmanager.com/gtag/js' );
520
+
521
+ if ( $this->gadwp->config->options['ga_optout'] || $this->gadwp->config->options['ga_dnt_optout'] ) {
522
+ GADWP_Tools::load_view( 'front/views/analytics-optout-code.php', array( 'uaid' => $this->uaid, 'gaDntOptout' => $this->gadwp->config->options['ga_dnt_optout'], 'gaOptout' => $this->gadwp->config->options['ga_optout'] ) );
523
+ }
524
+
525
+ GADWP_Tools::load_view( 'front/views/analytics-code.php', array( 'trackingcode' => $trackingcode, 'tracking_script_path' => $tracking_script_path, 'ga_with_gtag' => $this->gadwp->config->options['ga_with_gtag'] , 'uaid' => $this->uaid ) );
526
+ }
527
+ }
528
+ }
529
+
530
+ if ( ! class_exists( 'GADWP_Tracking_Analytics_AMP' ) ) {
531
+
532
+ class GADWP_Tracking_Analytics_AMP extends GADWP_Tracking_Analytics_Base {
533
+
534
+ private $config;
535
+
536
+ public function __construct() {
537
+ parent::__construct();
538
+
539
+ add_filter( 'amp_post_template_data', array( $this, 'load_scripts' ) );
540
+ add_action( 'amp_post_template_footer', array( $this, 'output' ) );
541
+ add_filter( 'the_content', array( $this, 'add_data_attributes' ), 999, 1 );
542
+ if ( $this->gadwp->config->options['amp_tracking_clientidapi'] ) {
543
+ add_action( 'amp_post_template_head', array( $this, 'add_amp_client_id' ) );
544
+ }
545
+ }
546
+
547
+ private function get_link_event_data( $link ) {
548
+ if ( empty( $link ) ) {
549
+ return false;
550
+ }
551
+ if ( $this->gadwp->config->options['ga_event_tracking'] ) {
552
+ // on changes adjust the substr() length parameter
553
+ if ( substr( $link, 0, 7 ) === "mailto:" ) {
554
+ return array( 'email', 'send', $link );
555
+ }
556
+
557
+ // on changes adjust the substr() length parameter
558
+ if ( substr( $link, 0, 4 ) === "tel:" ) {
559
+ return array( 'telephone', 'call', $link );
560
+ }
561
+
562
+ // Add download data-vars
563
+ if ( $this->gadwp->config->options['ga_event_downloads'] && preg_match( '/.*\.(' . $this->gadwp->config->options['ga_event_downloads'] . ')(\?.*)?$/i', $link, $matches ) ) {
564
+ return array( 'download', 'click', $link );
565
+ }
566
+ }
567
+ if ( $this->gadwp->config->options['ga_hash_tracking'] ) {
568
+ // Add hashmark data-vars
569
+ $root_domain = GADWP_Tools::get_root_domain();
570
+ if ( $root_domain && ( strpos( $link, $root_domain ) > - 1 || strpos( $link, '://' ) === false ) && strpos( $link, '#' ) > - 1 ) {
571
+ return array( 'hashmark', 'click', $link );
572
+ }
573
+ }
574
+ if ( $this->gadwp->config->options['ga_aff_tracking'] ) {
575
+ // Add affiliate data-vars
576
+ if ( strpos( $link, $this->gadwp->config->options['ga_event_affiliates'] ) > - 1 ) {
577
+ return array( 'affiliates', 'click', $link );
578
+ }
579
+ }
580
+ if ( $this->gadwp->config->options['ga_event_tracking'] ) {
581
+ // Add outbound data-vars
582
+ $root_domain = GADWP_Tools::get_root_domain();
583
+ if ( $root_domain && strpos( $link, $root_domain ) === false && strpos( $link, '://' ) > - 1 ) {
584
+ return array( 'outbound', 'click', $link );
585
+ }
586
+ }
587
+ return false;
588
+ }
589
+
590
+ public function add_data_attributes( $content ) {
591
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && $this->is_event_tracking( false ) ) {
592
+
593
+ $dom = GADWP_Tools::get_dom_from_content( $content );
594
+
595
+ if ( $dom ) {
596
+
597
+ $links = $dom->getElementsByTagName( 'a' );
598
+
599
+ foreach ( $links as $item ) {
600
+
601
+ $data_attributes = $this->get_link_event_data( $item->getAttribute( 'href' ) );
602
+
603
+ if ( $data_attributes ) {
604
+ if ( ! $item->hasAttribute( 'data-vars-ga-category' ) ) {
605
+ $item->setAttribute( 'data-vars-ga-category', $data_attributes[0] );
606
+ }
607
+ if ( ! $item->hasAttribute( 'data-vars-ga-action' ) ) {
608
+ $item->setAttribute( 'data-vars-ga-action', $data_attributes[1] );
609
+ }
610
+ if ( ! $item->hasAttribute( 'data-vars-ga-label' ) ) {
611
+ $item->setAttribute( 'data-vars-ga-label', $data_attributes[2] );
612
+ }
613
+ }
614
+ }
615
+
616
+ if ( $this->gadwp->config->options['ga_formsubmit_tracking'] ) {
617
+ $form_submits = $dom->getElementsByTagName( 'input' );
618
+ foreach ( $form_submits as $item ) {
619
+ if ( $item->getAttribute( 'type' ) == 'submit' ) {
620
+ if ( ! $item->hasAttribute( 'data-vars-ga-category' ) ) {
621
+ $item->setAttribute( 'data-vars-ga-category', 'form' );
622
+ }
623
+ if ( ! $item->hasAttribute( 'data-vars-ga-action' ) ) {
624
+ $item->setAttribute( 'data-vars-ga-action', 'submit' );
625
+ }
626
+ if ( ! $item->hasAttribute( 'data-vars-ga-label' ) ) {
627
+ if ( $item->getAttribute( 'value' ) ) {
628
+ $label = $item->getAttribute( 'value' );
629
+ }
630
+ if ( $item->getAttribute( 'name' ) ) {
631
+ $label = $item->getAttribute( 'name' );
632
+ }
633
+ $item->setAttribute( 'data-vars-ga-label', $label );
634
+ }
635
+ }
636
+ }
637
+ }
638
+ return GADWP_Tools::get_content_from_dom( $dom );
639
+ }
640
+ }
641
+
642
+ return $content;
643
+ }
644
+
645
+ /**
646
+ * Inserts the Analytics AMP script in the head section
647
+ */
648
+ public function load_scripts( $data ) {
649
+ if ( ! isset( $data['amp_component_scripts'] ) ) {
650
+ $data['amp_component_scripts'] = array();
651
+ }
652
+
653
+ $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
654
+
655
+ return $data;
656
+ }
657
+
658
+ /**
659
+ * Retrieves the AMP config array
660
+ */
661
+ public function get() {
662
+ return $this->config;
663
+ }
664
+
665
+ /**
666
+ * Stores the AMP config array
667
+ * @param array $config
668
+ */
669
+ public function set( $config ) {
670
+ $this->config = $config;
671
+ }
672
+
673
+ private function build_json() {
674
+ $this->config = array();
675
+
676
+ // Set the Tracking ID
677
+ /* @formatter:off */
678
+ $this->config['vars'] = array(
679
+ 'account' => $this->uaid,
680
+ 'documentLocation' => '${canonicalUrl}',
681
+ );
682
+ /* @formatter:on */
683
+
684
+ // Set Custom Dimensions as extraUrlParams
685
+ $custom_dimensions = $this->build_custom_dimensions();
686
+
687
+ if ( ! empty( $custom_dimensions ) ) {
688
+ foreach ( $custom_dimensions as $index => $value ) {
689
+ $dimension = 'cd' . $index;
690
+ $this->config['extraUrlParams'][$dimension] = $value;
691
+ }
692
+ }
693
+
694
+ // Set Triggers
695
+ /* @formatter:off */
696
+ $this->config['triggers']['gadwpTrackPageview'] = array(
697
+ 'on' => 'visible',
698
+ 'request' => 'pageview',
699
+ );
700
+ /* @formatter:on */
701
+
702
+ // Set Sampling Rate only if lower than 100%
703
+ if ( 100 != $this->gadwp->config->options['ga_user_samplerate'] ) {
704
+ /* @formatter:off */
705
+ $this->config['triggers']['gadwpTrackPageview']['sampleSpec'] = array(
706
+ 'sampleOn' => '${clientId}',
707
+ 'threshold' => (int) $this->gadwp->config->options['ga_user_samplerate'],
708
+ );
709
+ /* @formatter:on */
710
+ }
711
+
712
+ // Set Scroll events
713
+ if ( $this->gadwp->config->options['ga_pagescrolldepth_tracking'] ) {
714
+ /* @formatter:off */
715
+ $this->config['triggers']['gadwpScrollPings'] = array (
716
+ 'on' => 'scroll',
717
+ 'scrollSpec' => array(
718
+ 'verticalBoundaries' => '&#91;25, 50, 75, 100&#93;',
719
+ ),
720
+ 'request' => 'event',
721
+ 'vars' => array(
722
+ 'eventCategory' => 'Scroll Depth',
723
+ 'eventAction' => 'Percentage',
724
+ 'eventLabel' => '${verticalScrollBoundary}%',
725
+ ),
726
+ );
727
+ /* @formatter:on */
728
+ $this->config['triggers']['gadwpScrollPings']['extraUrlParams'] = array( 'ni' => true );
729
+ }
730
+
731
+ if ( $this->is_event_tracking( false ) ) {
732
+ // Set downloads, outbound links, affiliate links, hashmarks, e-mails, telephones, form submits events
733
+ /* @formatter:off */
734
+ $this->config['triggers']['gadwpEventTracking'] = array (
735
+ 'on' => 'click',
736
+ 'selector' => '[data-vars-ga-category][data-vars-ga-action][data-vars-ga-label]',
737
+ 'request' => 'event',
738
+ 'vars' => array(
739
+ 'eventCategory' => '${gaCategory}',
740
+ 'eventAction' => '${gaAction}',
741
+ 'eventLabel' => '${gaLabel}',
742
+ ),
743
+ );
744
+ /* @formatter:on */
745
+ if ( $this->gadwp->config->options['ga_event_bouncerate'] ) {
746
+ $this->config['triggers']['gadwpEventTracking']['extraUrlParams'] = array( 'ni' => (bool) $this->gadwp->config->options['ga_event_bouncerate'] );
747
+ }
748
+ }
749
+ do_action( 'gadwp_analytics_amp_config', $this );
750
+ }
751
+
752
+ public function add_amp_client_id() {
753
+ GADWP_Tools::load_view( 'front/views/analytics-amp-clientidapi.php' );
754
+ }
755
+
756
+ /**
757
+ * Outputs the Google Analytics tracking code for AMP
758
+ */
759
+ public function output() {
760
+ $this->build_json();
761
+
762
+ if ( version_compare( phpversion(), '5.4.0', '<' ) ) {
763
+ $json = json_encode( $this->config );
764
+ } else {
765
+ $json = json_encode( $this->config, JSON_PRETTY_PRINT );
766
+ }
767
+
768
+ $json = str_replace( array( '"&#91;', '&#93;"' ), array( '[', ']' ), $json ); // make verticalBoundaries a JavaScript array
769
+
770
+ $data = array( 'json' => $json );
771
+
772
+ GADWP_Tools::load_view( 'front/views/analytics-amp-code.php', $data );
773
+ }
774
+ }
775
+ }
tags/5.3.1/front/tracking-tagmanager.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2017 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Tracking_TagManager' ) ) {
15
+
16
+ class GADWP_Tracking_TagManager {
17
+
18
+ private $gadwp;
19
+
20
+ private $datalayer;
21
+
22
+ public function __construct() {
23
+ $this->gadwp = GADWP();
24
+
25
+ if ( $this->gadwp->config->options['trackingcode_infooter'] ) {
26
+ add_action( 'wp_footer', array( $this, 'output' ), 99 );
27
+ } else {
28
+ add_action( 'wp_head', array( $this, 'output' ), 99 );
29
+ }
30
+
31
+ if ( $this->gadwp->config->options['amp_tracking_tagmanager'] && $this->gadwp->config->options['amp_containerid'] ) {
32
+ add_filter( 'amp_post_template_data', array( $this, 'amp_add_analytics_script' ) );
33
+ add_action( 'amp_post_template_footer', array( $this, 'amp_output' ) );
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Retrieves the datalayer variables
39
+ */
40
+ public function get() {
41
+ return $this->datalayer;
42
+ }
43
+
44
+ /**
45
+ * Stores the datalayer variables
46
+ * @param array $datalayer
47
+ */
48
+ public function set( $datalayer ) {
49
+ $this->datalayer = $datalayer;
50
+ }
51
+
52
+ /**
53
+ * Adds a variable to the datalayer
54
+ * @param string $name
55
+ * @param string $value
56
+ */
57
+ private function add_var( $name, $value ) {
58
+ $this->datalayer[$name] = $value;
59
+ }
60
+
61
+ /**
62
+ * Builds the datalayer based on user's options
63
+ */
64
+ private function build_custom_dimensions() {
65
+ global $post;
66
+
67
+ if ( $this->gadwp->config->options['tm_author_var'] && ( is_single() || is_page() ) ) {
68
+ global $post;
69
+ $author_id = $post->post_author;
70
+ $author_name = get_the_author_meta( 'display_name', $author_id );
71
+ $this->add_var( 'gadwpAuthor', esc_attr( $author_name ) );
72
+ }
73
+
74
+ if ( $this->gadwp->config->options['tm_pubyear_var'] && is_single() ) {
75
+ global $post;
76
+ $date = get_the_date( 'Y', $post->ID );
77
+ $this->add_var( 'gadwpPublicationYear', (int) $date );
78
+ }
79
+
80
+ if ( $this->gadwp->config->options['tm_pubyearmonth_var'] && is_single() ) {
81
+ global $post;
82
+ $date = get_the_date( 'Y-m', $post->ID );
83
+ $this->add_var( 'gadwpPublicationYearMonth', esc_attr( $date ) );
84
+ }
85
+
86
+ if ( $this->gadwp->config->options['tm_category_var'] && is_category() ) {
87
+ $this->add_var( 'gadwpCategory', esc_attr( single_tag_title( '', false ) ) );
88
+ }
89
+ if ( $this->gadwp->config->options['tm_category_var'] && is_single() ) {
90
+ global $post;
91
+ $categories = get_the_category( $post->ID );
92
+ foreach ( $categories as $category ) {
93
+ $this->add_var( 'gadwpCategory', esc_attr( $category->name ) );
94
+ break;
95
+ }
96
+ }
97
+
98
+ if ( $this->gadwp->config->options['tm_tag_var'] && is_single() ) {
99
+ global $post;
100
+ $post_tags_list = '';
101
+ $post_tags_array = get_the_tags( $post->ID );
102
+ if ( $post_tags_array ) {
103
+ foreach ( $post_tags_array as $tag ) {
104
+ $post_tags_list .= $tag->name . ', ';
105
+ }
106
+ }
107
+ $post_tags_list = rtrim( $post_tags_list, ', ' );
108
+ if ( $post_tags_list ) {
109
+ $this->add_var( 'gadwpTag', esc_attr( $post_tags_list ) );
110
+ }
111
+ }
112
+
113
+ if ( $this->gadwp->config->options['tm_user_var'] ) {
114
+ $usertype = is_user_logged_in() ? 'registered' : 'guest';
115
+ $this->add_var( 'gadwpUser', $usertype );
116
+ }
117
+
118
+ do_action( 'gadwp_tagmanager_datalayer', $this );
119
+ }
120
+
121
+ /**
122
+ * Outputs the Google Tag Manager tracking code
123
+ */
124
+ public function output() {
125
+ $this->build_custom_dimensions();
126
+
127
+ if ( is_array( $this->datalayer ) ) {
128
+ $vars = "{";
129
+ foreach ( $this->datalayer as $var => $value ) {
130
+ $vars .= "'" . $var . "': '" . $value . "', ";
131
+ }
132
+ $vars = rtrim( $vars, ", " );
133
+ $vars .= "}";
134
+ } else {
135
+ $vars = "{}";
136
+ }
137
+
138
+ GADWP_Tools::load_view( 'front/views/tagmanager-code.php', array( 'containerid' => $this->gadwp->config->options['web_containerid'], 'vars' => $vars ) );
139
+ }
140
+
141
+ /**
142
+ * Inserts the Analytics AMP script in the head section
143
+ */
144
+ public function amp_add_analytics_script( $data ) {
145
+ if ( ! isset( $data['amp_component_scripts'] ) ) {
146
+ $data['amp_component_scripts'] = array();
147
+ }
148
+
149
+ $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
150
+
151
+ return $data;
152
+ }
153
+
154
+ /**
155
+ * Outputs the Tag Manager code for AMP
156
+ */
157
+ public function amp_output() {
158
+
159
+ $this->build_custom_dimensions();
160
+
161
+ $vars = array( 'vars' => $this->datalayer );
162
+
163
+ if ( version_compare( phpversion(), '5.4.0', '<' ) ) {
164
+ $json = json_encode( $vars );
165
+ } else {
166
+ $json = json_encode( $vars, JSON_PRETTY_PRINT );
167
+ }
168
+
169
+ $amp_containerid = $this->gadwp->config->options['amp_containerid'];
170
+
171
+ $json = str_replace( array( '"&#91;', '&#93;"' ), array( '[', ']' ), $json ); // make verticalBoundaries a JavaScript array
172
+
173
+ GADWP_Tools::load_view( 'front/views/tagmanager-amp-code.php', array ( 'json' => $json, 'containerid' => $amp_containerid ) );
174
+
175
+ }
176
+ }
177
+ }
tags/5.3.1/front/tracking.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2017 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_Tracking' ) ) {
15
+
16
+ class GADWP_Tracking {
17
+
18
+ private $gadwp;
19
+
20
+ public $analytics;
21
+
22
+ public $analytics_amp;
23
+
24
+ public $tagmanager;
25
+
26
+ public function __construct() {
27
+ $this->gadwp = GADWP();
28
+
29
+ $this->init();
30
+ }
31
+
32
+ public function tracking_code() { // Removed since 5.0
33
+ GADWP_Tools::doing_it_wrong( __METHOD__, __( "This method is deprecated, read the documentation!", 'google-analytics-dashboard-for-wp' ), '5.0' );
34
+ }
35
+
36
+ public function init() {
37
+ // excluded roles
38
+ if ( GADWP_Tools::check_roles( $this->gadwp->config->options['track_exclude'], true ) || ( $this->gadwp->config->options['superadmin_tracking'] && current_user_can( 'manage_network' ) ) ) {
39
+ return;
40
+ }
41
+
42
+ if ( 'universal' == $this->gadwp->config->options['tracking_type'] && $this->gadwp->config->options['tableid_jail'] ) {
43
+
44
+ // Analytics
45
+ require_once 'tracking-analytics.php';
46
+
47
+ if ( 1 == $this->gadwp->config->options['ga_with_gtag'] ) {
48
+ $this->analytics = new GADWP_Tracking_GlobalSiteTag();
49
+ } else {
50
+ $this->analytics = new GADWP_Tracking_Analytics();
51
+ }
52
+
53
+ if ( $this->gadwp->config->options['amp_tracking_analytics'] ) {
54
+ $this->analytics_amp = new GADWP_Tracking_Analytics_AMP();
55
+ }
56
+ }
57
+
58
+ if ( 'tagmanager' == $this->gadwp->config->options['tracking_type'] && $this->gadwp->config->options['web_containerid'] ) {
59
+
60
+ // Tag Manager
61
+ require_once 'tracking-tagmanager.php';
62
+ $this->tagmanager = new GADWP_Tracking_TagManager();
63
+ }
64
+ }
65
+ }
66
+ }
tags/5.3.1/front/views/analytics-amp-clientidapi.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+
11
+ <meta name="amp-google-client-id-api" content="googleanalytics">
tags/5.3.1/front/views/analytics-amp-code.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <amp-analytics type="googleanalytics" id="gadwp-googleanalytics">
11
+ <script type="application/json">
12
+ <?php echo $data['json']; ?>
13
+ </script>
14
+ </amp-analytics>
tags/5.3.1/front/views/analytics-code.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+
11
+ <?php if ( 0 == $data['ga_with_gtag'] ):?>
12
+ <!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Universal Analytics - https://deconf.com/google-analytics-dashboard-wordpress/ -->
13
+ <script>
14
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
15
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
16
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
17
+ })(window,document,'script','<?php echo $data['tracking_script_path']?>','ga');
18
+ <?php echo $data['trackingcode']?>
19
+ </script>
20
+ <!-- END GADWP Universal Analytics -->
21
+ <?php else:?>
22
+ <!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Global Site Tag - https://deconf.com/google-analytics-dashboard-wordpress/ -->
23
+ <script async src="<?php echo $data['tracking_script_path']?>?id=<?php echo $data['uaid']?>"></script>
24
+ <script>
25
+ window.dataLayer = window.dataLayer || [];
26
+ function gtag(){dataLayer.push(arguments);}
27
+ gtag('js', new Date());
28
+ <?php echo $data['trackingcode']?>
29
+
30
+ if (window.performance) {
31
+ var timeSincePageLoad = Math.round(performance.now());
32
+ gtag('event', 'timing_complete', {
33
+ 'name': 'load',
34
+ 'value': timeSincePageLoad,
35
+ 'event_category': 'JS Dependencies'
36
+ });
37
+ }
38
+ </script>
39
+ <!-- END GADWP Global Site Tag -->
40
+ <?php endif;?>
tags/5.3.1/front/views/analytics-optout-code.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2018 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <script>
11
+ var dnt = false;
12
+ var gaProperty = '<?php echo $data['uaid']?>';
13
+ var gaDntOptout = '<?php echo $data['gaDntOptout']?>';
14
+ var gaOptout = '<?php echo $data['gaOptout']?>';
15
+ var disableStr = 'ga-disable-' + gaProperty;
16
+ if(gaDntOptout && (window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1")) {
17
+ dnt = true;
18
+ }
19
+ if (dnt || (document.cookie.indexOf(disableStr + '=true') > -1 && gaOptout)) {
20
+ window[disableStr] = true;
21
+ }
22
+ function gaOptout() {
23
+ document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
24
+ window[disableStr] = true;
25
+ }
26
+ </script>
tags/5.3.1/front/views/optimize-code.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <style>
11
+ .async-hide {
12
+ opacity: 0 !important
13
+ }
14
+ </style>
15
+ <script>
16
+ (function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
17
+ h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
18
+ (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
19
+ })(window,document.documentElement,'async-hide','dataLayer',4000,
20
+ {'<?php echo $data['containerid']; ?>':true});
21
+ </script>
tags/5.3.1/front/views/tagmanager-amp-code.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2018 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <amp-analytics config="https://www.googletagmanager.com/amp.json?id=<?php echo $data['containerid']; ?>&gtm.url=SOURCE_URL" data-credentials="include">
11
+ <script type="application/json">
12
+ <?php echo $data['json']; ?>
13
+ </script>
14
+ </amp-analytics>
tags/5.3.1/front/views/tagmanager-code.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Copyright 2017 Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+ ?>
10
+ <!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Tag Manager - https://deconf.com/google-analytics-dashboard-wordpress/ -->
11
+ <script>
12
+ window.dataLayer = window.dataLayer || [];
13
+ window.dataLayer.push(<?php echo $data['vars']; ?>);
14
+ </script>
15
+
16
+ <script>
17
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
18
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
19
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
20
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
21
+ })(window,document,'script','dataLayer','<?php echo $data['containerid']; ?>');
22
+ </script>
23
+ <!-- END GADWP Tag Manager -->
24
+
tags/5.3.1/front/widgets.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ final class GADWP_Frontend_Widget extends WP_Widget {
15
+
16
+ private $gadwp;
17
+
18
+ public function __construct() {
19
+ $this->gadwp = GADWP();
20
+
21
+ parent::__construct( 'gadwp-frontwidget-report', __( 'Google Analytics Dashboard', 'google-analytics-dashboard-for-wp' ), array( 'description' => __( "Will display your google analytics stats in a widget", 'google-analytics-dashboard-for-wp' ) ) );
22
+ // Frontend Styles
23
+ if ( is_active_widget( false, false, $this->id_base, true ) ) {
24
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
+ }
26
+ }
27
+
28
+ public function load_styles_scripts() {
29
+ $lang = get_bloginfo( 'language' );
30
+ $lang = explode( '-', $lang );
31
+ $lang = $lang[0];
32
+
33
+ wp_enqueue_style( 'gadwp-front-widget', GADWP_URL . 'front/css/widgets.css', null, GADWP_CURRENT_VERSION );
34
+ wp_enqueue_script( 'gadwp-front-widget', GADWP_URL . 'front/js/widgets.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
35
+ wp_enqueue_script( 'googlecharts', 'https://www.gstatic.com/charts/loader.js', array(), null );
36
+ }
37
+
38
+ public function widget( $args, $instance ) {
39
+ $widget_title = apply_filters( 'widget_title', $instance['title'] );
40
+ $title = __( "Sessions", 'google-analytics-dashboard-for-wp' );
41
+ echo "\n<!-- BEGIN GADWP v" . GADWP_CURRENT_VERSION . " Widget - https://deconf.com/google-analytics-dashboard-wordpress/ -->\n";
42
+ echo $args['before_widget'];
43
+ if ( ! empty( $widget_title ) ) {
44
+ echo $args['before_title'] . $widget_title . $args['after_title'];
45
+ }
46
+
47
+ if ( isset( $this->gadwp->config->options['theme_color'] ) ) {
48
+ $css = "colors:['" . $this->gadwp->config->options['theme_color'] . "','" . GADWP_Tools::colourVariator( $this->gadwp->config->options['theme_color'], - 20 ) . "'],";
49
+ $color = $this->gadwp->config->options['theme_color'];
50
+ } else {
51
+ $css = "";
52
+ $color = "#3366CC";
53
+ }
54
+ ob_start();
55
+ if ( $instance['anonim'] ) {
56
+ $formater = "var formatter = new google.visualization.NumberFormat({
57
+ suffix: '%',
58
+ fractionDigits: 2
59
+ });
60
+
61
+ formatter.format(data, 1);";
62
+ } else {
63
+ $formater = '';
64
+ }
65
+ $periodtext = "";
66
+ switch ( $instance['period'] ) {
67
+ case '7daysAgo' :
68
+ $periodtext = sprintf( __( 'Last %d Days', 'google-analytics-dashboard-for-wp' ), 7 );
69
+ break;
70
+ case '14daysAgo' :
71
+ $periodtext = sprintf( __( 'Last %d Days', 'google-analytics-dashboard-for-wp' ), 14 );
72
+ break;
73
+ case '30daysAgo' :
74
+ $periodtext = sprintf( __( 'Last %d Days', 'google-analytics-dashboard-for-wp' ), 30 );
75
+ break;
76
+ default :
77
+ $periodtext = "";
78
+ break;
79
+ }
80
+ switch ( $instance['display'] ) {
81
+ case '1' :
82
+ echo '<div id="gadwp-widget"><div id="gadwp-widgetchart"></div><div id="gadwp-widgettotals"></div></div>';
83
+ break;
84
+ case '2' :
85
+ echo '<div id="gadwp-widget"><div id="gadwp-widgetchart"></div></div>';
86
+ break;
87
+ case '3' :
88
+ echo '<div id="gadwp-widget"><div id="gadwp-widgettotals"></div></div>';
89
+ break;
90
+ }
91
+ ?>
92
+ <script type="text/javascript">
93
+ google.charts.load('current', {'packages':['corechart']});
94
+ google.charts.setOnLoadCallback( GADWPWidgetLoad );
95
+ function GADWPWidgetLoad (){
96
+ jQuery.post("<?php echo admin_url( 'admin-ajax.php' ); ?>", {action: "ajax_frontwidget_report", gadwp_number: "<?php echo $this->number; ?>", gadwp_optionname: "<?php echo $this->option_name; ?>" }, function(response){
97
+ if (!jQuery.isNumeric(response) && jQuery.isArray(response)){
98
+ if (jQuery("#gadwp-widgetchart")[0]){
99
+ gadwpFrontWidgetData = response[0];
100
+ gadwp_drawFrontWidgetChart(gadwpFrontWidgetData);
101
+ }
102
+ if (jQuery("#gadwp-widgettotals")[0]){
103
+ gadwp_drawFrontWidgetTotals(response[1]);
104
+ }
105
+ }else{
106
+ jQuery("#gadwp-widgetchart").css({"background-color":"#F7F7F7","height":"auto","padding-top":"50px","padding-bottom":"50px","color":"#000","text-align":"center"});
107
+ jQuery("#gadwp-widgetchart").html("<?php __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ); ?> ("+response+")");
108
+ }
109
+ });
110
+ }
111
+ function gadwp_drawFrontWidgetChart(response) {
112
+ var data = google.visualization.arrayToDataTable(response);
113
+ var options = {
114
+ legend: { position: "none" },
115
+ pointSize: "3",
116
+ <?php echo $css; ?>
117
+ title: "<?php echo $title; ?>",
118
+ titlePosition: "in",
119
+ chartArea: { width: "95%", height: "75%" },
120
+ hAxis: { textPosition: "none"},
121
+ vAxis: { textPosition: "none", minValue: 0, gridlines: { color: "transparent" }, baselineColor: "transparent"}
122
+ }
123
+ var chart = new google.visualization.AreaChart(document.getElementById("gadwp-widgetchart"));
124
+ <?php echo $formater; ?>
125
+ chart.draw(data, options);
126
+ }
127
+ function gadwp_drawFrontWidgetTotals(response) {
128
+ if ( null == response ){
129
+ response = 0;
130
+ }
131
+ jQuery("#gadwp-widgettotals").html('<div class="gadwp-left"><?php _e( "Period:", 'google-analytics-dashboard-for-wp' ); ?></div> <div class="gadwp-right"><?php echo $periodtext; ?> </div><div class="gadwp-left"><?php _e( "Sessions:", 'google-analytics-dashboard-for-wp' ); ?></div> <div class="gadwp-right">'+response+'</div>');
132
+ }
133
+ </script>
134
+ <?php
135
+ if ( 1 == $instance['give_credits'] ) :
136
+ ?>
137
+ <div style="text-align: right; width: 100%; font-size: 0.8em; clear: both; margin-right: 5px;"><?php _e( 'generated by', 'google-analytics-dashboard-for-wp' ); ?> <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_report&utm_medium=link&utm_content=front_widget&utm_campaign=gadwp" rel="nofollow" style="text-decoration: none; font-size: 1em;">GADWP</a>&nbsp;
138
+ </div>
139
+
140
+ <?php
141
+ endif;
142
+ $widget_content = ob_get_contents();
143
+ if ( ob_get_length() ) {
144
+ ob_end_clean();
145
+ }
146
+ echo $widget_content;
147
+ echo $args['after_widget'];
148
+ echo "\n<!-- END GADWP Widget -->\n";
149
+ }
150
+
151
+ public function form( $instance ) {
152
+ $widget_title = ( isset( $instance['title'] ) ? $instance['title'] : __( "Google Analytics Stats", 'google-analytics-dashboard-for-wp' ) );
153
+ $period = ( isset( $instance['period'] ) ? $instance['period'] : '7daysAgo' );
154
+ $display = ( isset( $instance['display'] ) ? $instance['display'] : 1 );
155
+ $give_credits = ( isset( $instance['give_credits'] ) ? $instance['give_credits'] : 1 );
156
+ $anonim = ( isset( $instance['anonim'] ) ? $instance['anonim'] : 0 );
157
+ /* @formatter:off */
158
+ ?>
159
+ <p>
160
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( "Title:",'google-analytics-dashboard-for-wp' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $widget_title ); ?>">
161
+ </p>
162
+ <p>
163
+ <label for="<?php echo $this->get_field_id( 'display' ); ?>"><?php _e( "Display:",'google-analytics-dashboard-for-wp' ); ?></label> <select id="<?php echo $this->get_field_id('display'); ?>" class="widefat" name="<?php echo $this->get_field_name( 'display' ); ?>">
164
+ <option value="1" <?php selected( $display, 1 ); ?>><?php _e('Chart & Totals', 'google-analytics-dashboard-for-wp');?></option>
165
+ <option value="2" <?php selected( $display, 2 ); ?>><?php _e('Chart', 'google-analytics-dashboard-for-wp');?></option>
166
+ <option value="3" <?php selected( $display, 3 ); ?>><?php _e('Totals', 'google-analytics-dashboard-for-wp');?></option>
167
+ </select>
168
+ </p>
169
+ <p>
170
+ <label for="<?php echo $this->get_field_id( 'anonim' ); ?>"><?php _e( "Anonymize stats:",'google-analytics-dashboard-for-wp' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'anonim' ); ?>" name="<?php echo $this->get_field_name( 'anonim' ); ?>" type="checkbox" <?php checked( $anonim, 1 ); ?> value="1">
171
+ </p>
172
+ <p>
173
+ <label for="<?php echo $this->get_field_id( 'period' ); ?>"><?php _e( "Stats for:",'google-analytics-dashboard-for-wp' ); ?></label> <select id="<?php echo $this->get_field_id('period'); ?>" class="widefat" name="<?php echo $this->get_field_name( 'period' ); ?>">
174
+ <option value="7daysAgo" <?php selected( $period, '7daysAgo' ); ?>><?php printf( __('Last %d Days', 'google-analytics-dashboard-for-wp'), 7 );?></option>
175
+ <option value="14daysAgo" <?php selected( $period, '14daysAgo' ); ?>><?php printf( __('Last %d Days', 'google-analytics-dashboard-for-wp'), 14 );?></option>
176
+ <option value="30daysAgo" <?php selected( $period, '30daysAgo' ); ?>><?php printf( __('Last %d Days', 'google-analytics-dashboard-for-wp'), 30 );?></option>
177
+ </select>
178
+ </p>
179
+ <p>
180
+ <label for="<?php echo $this->get_field_id( 'give_credits' ); ?>"><?php _e( "Give credits:",'google-analytics-dashboard-for-wp' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'give_credits' ); ?>" name="<?php echo $this->get_field_name( 'give_credits' ); ?>" type="checkbox" <?php checked( $give_credits, 1 ); ?> value="1">
181
+ </p>
182
+ <?php
183
+ /* @formatter:on */
184
+ }
185
+
186
+ public function update( $new_instance, $old_instance ) {
187
+ $instance = array();
188
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : 'Analytics Stats';
189
+ $instance['period'] = ( ! empty( $new_instance['period'] ) ) ? strip_tags( $new_instance['period'] ) : '7daysAgo';
190
+ $instance['display'] = ( ! empty( $new_instance['display'] ) ) ? strip_tags( $new_instance['display'] ) : 1;
191
+ $instance['give_credits'] = ( ! empty( $new_instance['give_credits'] ) ) ? strip_tags( $new_instance['give_credits'] ) : 0;
192
+ $instance['anonim'] = ( ! empty( $new_instance['anonim'] ) ) ? strip_tags( $new_instance['anonim'] ) : 0;
193
+ return $instance;
194
+ }
195
+ }
tags/5.3.1/gadwp.php ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Google Analytics Dashboard for WP (GADWP)
4
+ * Plugin URI: https://deconf.com
5
+ * Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
6
+ * Author: Alin Marcu
7
+ * Version: 5.3.1
8
+ * Author URI: https://deconf.com
9
+ * Text Domain: google-analytics-dashboard-for-wp
10
+ * Domain Path: /languages
11
+ */
12
+
13
+ // Exit if accessed directly
14
+ if ( ! defined( 'ABSPATH' ) )
15
+ exit();
16
+
17
+ // Plugin Version
18
+ if ( ! defined( 'GADWP_CURRENT_VERSION' ) ) {
19
+ define( 'GADWP_CURRENT_VERSION', '5.3.1' );
20
+ }
21
+
22
+ if ( ! defined( 'GADWP_ENDPOINT_URL' ) ) {
23
+ define( 'GADWP_ENDPOINT_URL', 'https://gadwp.deconf.com/' );
24
+ }
25
+
26
+
27
+ if ( ! class_exists( 'GADWP_Manager' ) ) {
28
+
29
+ final class GADWP_Manager {
30
+
31
+ private static $instance = null;
32
+
33
+ public $config = null;
34
+
35
+ public $frontend_actions = null;
36
+
37
+ public $common_actions = null;
38
+
39
+ public $backend_actions = null;
40
+
41
+ public $tracking = null;
42
+
43
+ public $frontend_item_reports = null;
44
+
45
+ public $backend_setup = null;
46
+
47
+ public $frontend_setup = null;
48
+
49
+ public $backend_widgets = null;
50
+
51
+ public $backend_item_reports = null;
52
+
53
+ public $gapi_controller = null;
54
+
55
+ /**
56
+ * Construct forbidden
57
+ */
58
+ private function __construct() {
59
+ if ( null !== self::$instance ) {
60
+ _doing_it_wrong( __FUNCTION__, __( "This is not allowed, read the documentation!", 'google-analytics-dashboard-for-wp' ), '4.6' );
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Clone warning
66
+ */
67
+ private function __clone() {
68
+ _doing_it_wrong( __FUNCTION__, __( "This is not allowed, read the documentation!", 'google-analytics-dashboard-for-wp' ), '4.6' );
69
+ }
70
+
71
+ /**
72
+ * Wakeup warning
73
+ */
74
+ private function __wakeup() {
75
+ _doing_it_wrong( __FUNCTION__, __( "This is not allowed, read the documentation!", 'google-analytics-dashboard-for-wp' ), '4.6' );
76
+ }
77
+
78
+ /**
79
+ * Creates a single instance for GADWP and makes sure only one instance is present in memory.
80
+ *
81
+ * @return GADWP_Manager
82
+ */
83
+ public static function instance() {
84
+ if ( null === self::$instance ) {
85
+ self::$instance = new self();
86
+ self::$instance->setup();
87
+ self::$instance->config = new GADWP_Config();
88
+ }
89
+ return self::$instance;
90
+ }
91
+
92
+ /**
93
+ * Defines constants and loads required resources
94
+ */
95
+ private function setup() {
96
+
97
+ // Plugin Path
98
+ if ( ! defined( 'GADWP_DIR' ) ) {
99
+ define( 'GADWP_DIR', plugin_dir_path( __FILE__ ) );
100
+ }
101
+
102
+ // Plugin URL
103
+ if ( ! defined( 'GADWP_URL' ) ) {
104
+ define( 'GADWP_URL', plugin_dir_url( __FILE__ ) );
105
+ }
106
+
107
+ // Plugin main File
108
+ if ( ! defined( 'GADWP_FILE' ) ) {
109
+ define( 'GADWP_FILE', __FILE__ );
110
+ }
111
+
112
+ /*
113
+ * Load Tools class
114
+ */
115
+ include_once ( GADWP_DIR . 'tools/tools.php' );
116
+
117
+ /*
118
+ * Load Config class
119
+ */
120
+ include_once ( GADWP_DIR . 'config.php' );
121
+
122
+ /*
123
+ * Load GAPI Controller class
124
+ */
125
+ include_once ( GADWP_DIR . 'tools/gapi.php' );
126
+
127
+ /*
128
+ * Plugin i18n
129
+ */
130
+ add_action( 'init', array( self::$instance, 'load_i18n' ) );
131
+
132
+ /*
133
+ * Plugin Init
134
+ */
135
+ add_action( 'init', array( self::$instance, 'load' ) );
136
+
137
+ /*
138
+ * Include Install
139
+ */
140
+ include_once ( GADWP_DIR . 'install/install.php' );
141
+ register_activation_hook( GADWP_FILE, array( 'GADWP_Install', 'install' ) );
142
+
143
+ /*
144
+ * Include Uninstall
145
+ */
146
+ include_once ( GADWP_DIR . 'install/uninstall.php' );
147
+ register_uninstall_hook( GADWP_FILE, array( 'GADWP_Uninstall', 'uninstall' ) );
148
+
149
+ /*
150
+ * Load Frontend Widgets
151
+ * (needed during ajax)
152
+ */
153
+ include_once ( GADWP_DIR . 'front/widgets.php' );
154
+
155
+ /*
156
+ * Add Frontend Widgets
157
+ * (needed during ajax)
158
+ */
159
+ add_action( 'widgets_init', array( self::$instance, 'add_frontend_widget' ) );
160
+ }
161
+
162
+ /**
163
+ * Load i18n
164
+ */
165
+ public function load_i18n() {
166
+ load_plugin_textdomain( 'google-analytics-dashboard-for-wp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
167
+ }
168
+
169
+ /**
170
+ * Register Frontend Widgets
171
+ */
172
+ public function add_frontend_widget() {
173
+ register_widget( 'GADWP_Frontend_Widget' );
174
+ }
175
+
176
+ /**
177
+ * Conditional load
178
+ */
179
+ public function load() {
180
+ if ( is_admin() ) {
181
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
182
+ if ( GADWP_Tools::check_roles( self::$instance->config->options['access_back'] ) ) {
183
+ /*
184
+ * Load Backend ajax actions
185
+ */
186
+ include_once ( GADWP_DIR . 'admin/ajax-actions.php' );
187
+ self::$instance->backend_actions = new GADWP_Backend_Ajax();
188
+ }
189
+
190
+ /*
191
+ * Load Frontend ajax actions
192
+ */
193
+ include_once ( GADWP_DIR . 'front/ajax-actions.php' );
194
+ self::$instance->frontend_actions = new GADWP_Frontend_Ajax();
195
+
196
+ /*
197
+ * Load Common ajax actions
198
+ */
199
+ include_once ( GADWP_DIR . 'common/ajax-actions.php' );
200
+ self::$instance->common_actions = new GADWP_Common_Ajax();
201
+
202
+ if ( self::$instance->config->options['backend_item_reports'] ) {
203
+ /*
204
+ * Load Backend Item Reports for Quick Edit
205
+ */
206
+ include_once ( GADWP_DIR . 'admin/item-reports.php' );
207
+ self::$instance->backend_item_reports = new GADWP_Backend_Item_Reports();
208
+ }
209
+ } else if ( GADWP_Tools::check_roles( self::$instance->config->options['access_back'] ) ) {
210
+
211
+ /*
212
+ * Load Backend Setup
213
+ */
214
+ include_once ( GADWP_DIR . 'admin/setup.php' );
215
+ self::$instance->backend_setup = new GADWP_Backend_Setup();
216
+
217
+ if ( self::$instance->config->options['dashboard_widget'] ) {
218
+ /*
219
+ * Load Backend Widget
220
+ */
221
+ include_once ( GADWP_DIR . 'admin/widgets.php' );
222
+ self::$instance->backend_widgets = new GADWP_Backend_Widgets();
223
+ }
224
+
225
+ if ( self::$instance->config->options['backend_item_reports'] ) {
226
+ /*
227
+ * Load Backend Item Reports
228
+ */
229
+ include_once ( GADWP_DIR . 'admin/item-reports.php' );
230
+ self::$instance->backend_item_reports = new GADWP_Backend_Item_Reports();
231
+ }
232
+ }
233
+ } else {
234
+ if ( GADWP_Tools::check_roles( self::$instance->config->options['access_front'] ) ) {
235
+ /*
236
+ * Load Frontend Setup
237
+ */
238
+ include_once ( GADWP_DIR . 'front/setup.php' );
239
+ self::$instance->frontend_setup = new GADWP_Frontend_Setup();
240
+
241
+ if ( self::$instance->config->options['frontend_item_reports'] ) {
242
+ /*
243
+ * Load Frontend Item Reports
244
+ */
245
+ include_once ( GADWP_DIR . 'front/item-reports.php' );
246
+ self::$instance->frontend_item_reports = new GADWP_Frontend_Item_Reports();
247
+ }
248
+ }
249
+
250
+ if ( ! GADWP_Tools::check_roles( self::$instance->config->options['track_exclude'], true ) && 'disabled' != self::$instance->config->options['tracking_type'] ) {
251
+ /*
252
+ * Load tracking class
253
+ */
254
+ include_once ( GADWP_DIR . 'front/tracking.php' );
255
+ self::$instance->tracking = new GADWP_Tracking();
256
+ }
257
+ }
258
+ }
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Returns a unique instance of GADWP
264
+ */
265
+ function GADWP() {
266
+ return GADWP_Manager::instance();
267
+ }
268
+
269
+ /*
270
+ * Start GADWP
271
+ */
272
+ GADWP();
tags/5.3.1/install/install.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ class GADWP_Install {
15
+
16
+ public static function install() {
17
+ if ( ! get_option( 'ga_dash_token' ) ) {
18
+ $options = array();
19
+ $options['client_id'] = '';
20
+ $options['client_secret'] = '';
21
+ $options['access_front'][] = 'administrator';
22
+ $options['access_back'][] = 'administrator';
23
+ $options['tableid_jail'] = '';
24
+ $options['theme_color'] = '#1e73be';
25
+ $options['switch_profile'] = 0;
26
+ $options['tracking_type'] = 'universal';
27
+ $options['ga_anonymize_ip'] = 0;
28
+ $options['user_api'] = 0;
29
+ $options['ga_event_tracking'] = 0;
30
+ $options['ga_event_downloads'] = 'zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*';
31
+ $options['track_exclude'] = array();
32
+ $options['ga_target_geomap'] = '';
33
+ $options['ga_realtime_pages'] = 10;
34
+ $options['token'] = '';
35
+ $options['ga_profiles_list'] = array();
36
+ $options['ga_tracking_code'] = '';
37
+ $options['ga_enhanced_links'] = 0;
38
+ $options['ga_remarketing'] = 0;
39
+ $options['network_mode'] = 0;
40
+ $options['ga_speed_samplerate'] = 1;
41
+ $options['ga_user_samplerate'] = 100;
42
+ $options['ga_event_bouncerate'] = 0;
43
+ $options['ga_crossdomain_tracking'] = 0;
44
+ $options['ga_crossdomain_list'] = '';
45
+ $options['ga_author_dimindex'] = 0;
46
+ $options['ga_category_dimindex'] = 0;
47
+ $options['ga_tag_dimindex'] = 0;
48
+ $options['ga_user_dimindex'] = 0;
49
+ $options['ga_pubyear_dimindex'] = 0;
50
+ $options['ga_pubyearmonth_dimindex'] = 0;
51
+ $options['ga_aff_tracking'] = 0;
52
+ $options['ga_event_affiliates'] = '/out/';
53
+ $options['automatic_updates_minorversion'] = 1;
54
+ $options['backend_item_reports'] = 1;
55
+ $options['backend_realtime_report'] = 0;
56
+ $options['frontend_item_reports'] = 0;
57
+ $options['dashboard_widget'] = 1;
58
+ $options['api_backoff'] = 0;
59
+ $options['ga_cookiedomain'] = '';
60
+ $options['ga_cookiename'] = '';
61
+ $options['ga_cookieexpires'] = '';
62
+ $options['pagetitle_404'] = 'Page Not Found';
63
+ $options['maps_api_key'] = '';
64
+ $options['tm_author_var'] = 0;
65
+ $options['tm_category_var'] = 0;
66
+ $options['tm_tag_var'] = 0;
67
+ $options['tm_user_var'] = 0;
68
+ $options['tm_pubyear_var'] = 0;
69
+ $options['tm_pubyearmonth_var'] = 0;
70
+ $options['web_containerid'] = '';
71
+ $options['amp_containerid'] = '';
72
+ $options['amp_tracking_tagmanager'] = 0;
73
+ $options['amp_tracking_analytics'] = 0;
74
+ $options['amp_tracking_clientidapi'] = 0;
75
+ $options['trackingcode_infooter'] = 0;
76
+ $options['trackingevents_infooter'] = 0;
77
+ $options['ecommerce_mode'] = 'disabled';
78
+ $options['ga_formsubmit_tracking'] = 0;
79
+ $options['optimize_tracking'] = 0;
80
+ $options['optimize_containerid'] = '';
81
+ $options['optimize_pagehiding'] = '';
82
+ $options['superadmin_tracking'] = 0;
83
+ $options['ga_pagescrolldepth_tracking'] = 0;
84
+ $options['tm_pagescrolldepth_tracking'] = 0;
85
+ $options['ga_event_precision'] = 0;
86
+ $options['ga_force_ssl'] = 0;
87
+ $options['with_endpoint'] = 1;
88
+ $options['ga_optout'] = 0;
89
+ $options['ga_dnt_optout'] = 0;
90
+ $options['ga_with_gtag'] = 0;
91
+ } else {
92
+ $options = array();
93
+ $options['client_id'] = get_option( 'ga_dash_clientid' );
94
+ $options['client_secret'] = get_option( 'ga_dash_clientsecret' );
95
+ $options['access_front'][] = 'administrator';
96
+ $options['access_back'][] = 'administrator';
97
+ $options['tableid_jail'] = get_option( 'ga_dash_tableid_jail' );
98
+ $options['frontend_item_reports'] = get_option( 'ga_dash_frontend' );
99
+ $options['theme_color'] = '#1e73be';
100
+ $options['switch_profile'] = get_option( 'ga_dash_jailadmins' );
101
+ $options['tracking_type'] = get_option( 'ga_dash_tracking_type' );
102
+ $options['ga_anonymize_ip'] = get_option( 'ga_dash_anonim' );
103
+ $options['user_api'] = get_option( 'ga_dash_userapi' );
104
+ $options['ga_event_tracking'] = get_option( 'ga_event_tracking' );
105
+ $options['ga_event_downloads'] = get_option( 'ga_event_downloads' );
106
+ $options['track_exclude'] = array();
107
+ $options['ga_target_geomap'] = get_option( 'ga_target_geomap' );
108
+ $options['ga_realtime_pages'] = get_option( 'ga_realtime_pages' );
109
+ $options['token'] = get_option( 'ga_dash_token' );
110
+ $options['ga_profiles_list'] = get_option( 'ga_dash_profile_list' );
111
+ $options['ga_enhanced_links'] = 0;
112
+ $options['ga_remarketing'] = 0;
113
+ $options['network_mode'] = 0;
114
+ $options['ga_event_bouncerate'] = 0;
115
+ $options['ga_crossdomain_tracking'] = 0;
116
+ $options['ga_crossdomain_list'] = '';
117
+ $options['ga_author_dimindex'] = 0;
118
+ $options['ga_category_dimindex'] = 0;
119
+ $options['ga_tag_dimindex'] = 0;
120
+ $options['ga_user_dimindex'] = 0;
121
+ $options['ga_pubyear_dimindex'] = 0;
122
+ $options['ga_pubyearmonth_dimindex'] = 0;
123
+ $options['ga_event_affiliates'] = '/out/';
124
+ $options['ga_aff_tracking'] = 0;
125
+ $options['automatic_updates_minorversion'] = 1;
126
+ $options['backend_item_reports'] = 1;
127
+ $options['backend_realtime_report'] = 0;
128
+ $options['dashboard_widget'] = 1;
129
+ $options['api_backoff'] = 0;
130
+ $options['ga_cookiedomain'] = '';
131
+ $options['ga_cookiename'] = '';
132
+ $options['ga_cookieexpires'] = '';
133
+ $options['pagetitle_404'] = 'Page Not Found';
134
+ $options['maps_api_key'] = '';
135
+ $options['tm_author_var'] = 0;
136
+ $options['tm_category_var'] = 0;
137
+ $options['tm_tag_var'] = 0;
138
+ $options['tm_user_var'] = 0;
139
+ $options['tm_pubyear_var'] = 0;
140
+ $options['tm_pubyearmonth_var'] = 0;
141
+ $options['web_containerid'] = '';
142
+ $options['amp_containerid'] = '';
143
+ $options['amp_tracking_tagmanager'] = 0;
144
+ $options['amp_tracking_analytics'] = 0;
145
+ $options['amp_tracking_clientidapi'] = 0;
146
+ $options['trackingcode_infooter'] = 0;
147
+ $options['trackingevents_infooter'] = 0;
148
+ $options['ecommerce_mode'] = 'disabled';
149
+ $options['ga_formsubmit_tracking'] = 0;
150
+ $options['optimize_tracking'] = 0;
151
+ $options['optimize_containerid'] = '';
152
+ $options['optimize_pagehiding'] = '';
153
+ $options['superadmin_tracking'] = 0;
154
+ $options['ga_pagescrolldepth_tracking'] = 0;
155
+ $options['tm_pagescrolldepth_tracking'] = 0;
156
+ $options['ga_speed_samplerate'] = 1;
157
+ $options['ga_user_samplerate'] = 100;
158
+ $options['ga_event_precision'] = 0;
159
+ $options['ga_force_ssl'] = 0;
160
+ $options['with_endpoint'] = 1;
161
+ $options['ga_optout'] = 0;
162
+ $options['ga_dnt_optout'] = 0;
163
+ $options['ga_with_gtag'] = 0;
164
+
165
+ delete_option( 'ga_dash_clientid' );
166
+ delete_option( 'ga_dash_clientsecret' );
167
+ delete_option( 'ga_dash_access' );
168
+ delete_option( 'ga_dash_access_front' );
169
+ delete_option( 'ga_dash_access_back' );
170
+ delete_option( 'ga_dash_tableid_jail' );
171
+ delete_option( 'ga_dash_frontend' );
172
+ delete_option( 'ga_dash_style' );
173
+ delete_option( 'ga_dash_jailadmins' );
174
+
175
+ delete_option( 'ga_dash_tracking' );
176
+ delete_option( 'ga_dash_tracking_type' );
177
+ delete_option( 'ga_dash_anonim' );
178
+ delete_option( 'ga_dash_userapi' );
179
+ delete_option( 'ga_event_tracking' );
180
+ delete_option( 'ga_event_downloads' );
181
+ delete_option( 'track_exclude' );
182
+ delete_option( 'ga_target_geomap' );
183
+ delete_option( 'ga_realtime_pages' );
184
+ delete_option( 'ga_dash_token' );
185
+ delete_option( 'ga_dash_refresh_token' );
186
+ delete_option( 'ga_dash_profile_list' );
187
+ }
188
+ add_option( 'gadwp_options', json_encode( $options ) );
189
+ }
190
+ }
tags/5.3.1/install/uninstall.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ class GADWP_Uninstall {
15
+
16
+ public static function uninstall() {
17
+ global $wpdb;
18
+ if ( is_multisite() ) { // Cleanup Network install
19
+ foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) {
20
+ switch_to_blog( $blog['blog_id'] );
21
+ $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'gadwp_cache_%%'" );
22
+ delete_option( 'gadwp_options' );
23
+ restore_current_blog();
24
+ }
25
+ delete_site_option( 'gadwp_network_options' );
26
+ } else { // Cleanup Single install
27
+ $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'gadwp_cache_%%'" );
28
+ delete_option( 'gadwp_options' );
29
+ }
30
+ GADWP_Tools::unset_cookie( 'default_metric' );
31
+ GADWP_Tools::unset_cookie( 'default_dimension' );
32
+ GADWP_Tools::unset_cookie( 'default_view' );
33
+ }
34
+ }
tags/5.3.1/readme.txt ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Google Analytics Dashboard for WP (GADWP) ===
2
+ Contributors: deconf
3
+ Donate link: https://deconf.com/donate/
4
+ Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
5
+ Requires at least: 3.5
6
+ Tested up to: 4.9.4
7
+ Stable tag: 5.3.1
8
+ Requires PHP: 5.2.4
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ Connects Google Analytics with your WordPress site. Displays stats to help you understand your users and site content on a whole new level!
13
+
14
+ == Description ==
15
+ This Google Analytics for WordPress plugin enables you to track your site using the latest Google Analytics tracking code and allows you to view key Google Analytics stats in your WordPress install.
16
+
17
+ In addition to a set of general Google Analytics stats, in-depth Page reports and in-depth Post reports allow further segmentation of your analytics data, providing performance details for each post or page from your website.
18
+
19
+ The Google Analytics tracking code is fully customizable through options and hooks, allowing advanced data collection like custom dimensions and events.
20
+
21
+ = Google Analytics Real-Time Stats =
22
+
23
+ Google Analytics reports, in real-time, in your dashboard screen:
24
+
25
+ - Real-time number of visitors
26
+ - Real-time acquisition channels
27
+ - Real-time traffic sources details
28
+
29
+ = Google Analytics Reports =
30
+
31
+ The Google Analytics reports you need, on your dashboard, in your All Posts and All Pages screens, and on site's frontend:
32
+
33
+ - Sessions, organic searches, page views, bounce rate analytics stats
34
+ - Locations, pages, referrers, keywords, 404 errors analytics stats
35
+ - Traffic channels, social networks, traffic mediums, search engines analytics stats
36
+ - Device categories, browsers, operating systems, screen resolutions, mobile brands analytics stats
37
+
38
+ In addition, you can control who can view specific Google Analytics reports by setting permissions based on user roles.
39
+
40
+ = Google Analytics Tracking =
41
+
42
+ Installs the latest Google Analytics tracking code and allows full code customization:
43
+
44
+ - Universal Google Analytics (analytics.js) tracking code
45
+ - Global Site Tag (gtag.js) tracking code
46
+ - Enhanced link attribution
47
+ - Remarketing, demographics and interests tracking
48
+ - Page Speed sampling rate control
49
+ - User sampling rate control
50
+ - Cross domain tracking
51
+ - Exclude user roles from tracking
52
+ - Accelerated Mobile Pages (AMP) support for Google Analytics
53
+ - Ecommerce support for Google Analytics
54
+
55
+ User privacy oriented features:
56
+
57
+ - IP address anonymization
58
+ - option to follow Do Not Track (DNT) sent by browsers
59
+ - support for user tracking opt-out
60
+
61
+ Google Analytics Dashboard for WP enables you to easily track events like:
62
+
63
+ - Downloads
64
+ - Emails
65
+ - Outbound links
66
+ - Affiliate links
67
+ - Fragment identifiers
68
+ - Telephone
69
+ - Page Scrolling Depth
70
+ - Custom event categories, actions and labels using annotated HTML elements
71
+
72
+ With Google Analytics Dashboard for WP you can use custom dimensions to track:
73
+
74
+ - Authors
75
+ - Publication year
76
+ - Publication month
77
+ - Categories
78
+ - Tags
79
+ - User engagement
80
+
81
+ Actions and filters are available for further Google Analytics tracking code customization.
82
+
83
+ = Google Tag Manager Tracking =
84
+
85
+ As an alternative to Google Analytics tracking code, you can use Google Tag Manager for tracking:
86
+
87
+ - Google Tag Manager code
88
+ - Data Layer variables: authors, publication year, publication month, categories, tags, user type
89
+ - Exclude user roles from tracking
90
+ - Accelerated Mobile Pages (AMP) support for Google Tag Manager
91
+
92
+ = Accelerated Mobile Pages (AMP) features =
93
+
94
+ - Google Tag Manager basic tracking
95
+ - Google Analytics basic tracking
96
+ - Automatically removes <em>amp/</em> from Google Analytics tracking page URL
97
+ - Scrolling depth tracking
98
+ - Custom dimensions tracking
99
+ - User sampling rate control
100
+ - Form submit tracking
101
+ - File downloads tracking
102
+ - Affiliate links tracking
103
+ - Hashmarks, outbound links, telephones and e-mails tracking
104
+ - Custom event categories, actions and labels using annotated HTML elements
105
+
106
+ = Google Analytics Dashboard for WP on Multisite =
107
+
108
+ This plugin is fully compatible with multisite network installs, allowing three setup modes:
109
+
110
+ - Mode 1: network activated using multiple Google Analytics accounts
111
+ - Mode 2: network activated using a single Google Analytics account
112
+ - Mode 3: network deactivated using multiple Google Analytics accounts
113
+
114
+ > <strong>Google Analytics Dashboard for WP on GitHub</strong><br>
115
+ > You can submit feature requests or bugs on [Google Analytics Dashboard for WP](https://github.com/deconf/Google-Analytics-Dashboard-for-WP) repository.
116
+
117
+ = Further reading =
118
+
119
+ * Homepage of [Google Analytics Dashboard for WP](https://deconf.com/google-analytics-dashboard-wordpress/)
120
+ * Other [WordPress Plugins](https://deconf.com/wordpress/) by same author
121
+ * [Google Analytics | Partners](https://www.google.com/analytics/partners/company/5127525902581760/gadp/5629499534213120/app/5707702298738688/listing/5639274879778816) Gallery
122
+
123
+ == Installation ==
124
+
125
+ 1. Upload the full google-analytics-dashboard-for-wp directory into your wp-content/plugins directory.
126
+ 2. In WordPress select Plugins from your sidebar menu and activate the Google Analytics Dashboard for WP plugin.
127
+ 3. Open the plugin configuration page, which is located under Google Analytics menu.
128
+ 4. Authorize the plugin to connect to Google Analytics using the Authorize Plugin button.
129
+ 5. Go back to the plugin configuration page, which is located under Google Analytics menu to update/set your settings.
130
+ 6. Go to Google Analytics -> Tracking Code to configure/enable/disable tracking.
131
+
132
+ == Frequently Asked Questions ==
133
+
134
+ = Do I have to insert the Google Analytics tracking code manually? =
135
+
136
+ No, once the plugin is authorized and a default domain is selected the Google Analytics tracking code is automatically inserted in all webpages.
137
+
138
+ = Some settings are missing in the video tutorial =
139
+
140
+ We are constantly improving Google Analytics Dashboard for WP, sometimes the video tutorial may be a little outdated.
141
+
142
+ = How can I suggest a new feature, contribute or report a bug? =
143
+
144
+ You can submit pull requests, feature requests and bug reports on [our GitHub repository](https://github.com/deconf/Google-Analytics-Dashboard-for-WP).
145
+
146
+ = Documentation, Tutorials and FAQ =
147
+
148
+ For documentation, tutorials, FAQ and videos check out: [Google Analytics Dashboard for WP documentation](https://deconf.com/google-analytics-dashboard-wordpress/).
149
+
150
+ == Screenshots ==
151
+
152
+ 1. Google Analytics Dashboard for WP Blue Color
153
+ 2. Google Analytics Dashboard for WP Real-Time
154
+ 3. Google Analytics Dashboard for WP reports per Posts/Pages
155
+ 4. Google Analytics Dashboard for WP Geo Map
156
+ 5. Google Analytics Dashboard for WP Top Pages, Top Referrers and Top Searches
157
+ 6. Google Analytics Dashboard for WP Traffic Overview
158
+ 7. Google Analytics Dashboard for WP statistics per page on Frontend
159
+ 8. Google Analytics Dashboard for WP cities on region map
160
+ 9. Google Analytics Dashboard for WP Widget
161
+
162
+ == Localization ==
163
+
164
+ You can translate Google Analytics Dashboard for WP on [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/google-analytics-dashboard-for-wp).
165
+
166
+ == License ==
167
+
168
+ Google Analytics Dashboard for WP it's released under the GPLv2, you can use it free of charge on your personal or commercial website.
169
+
170
+ == Upgrade Notice ==
171
+
172
+ == Changelog ==
173
+
174
+ [GADWP v5.3 release notes](https://deconf.com/adding-gtag-js-to-your-site/)
175
+
176
+ = 5.3.1 =
177
+ * Bug Fixes:
178
+ * frontend_item_reports PHP notice when upgrading from a version lower than v4.8.0.1
179
+
180
+ = 5.3 =
181
+ * Enhancements:
182
+ * adds full support for Global Site Tag (gtag.js)
183
+ * remove Scroll Depth functionality, since this is now available as a trigger on Google Tag Manager
184
+ * adds custom dimensions support for AMP pages with Google Tag Manager tracking
185
+ * adds support for button submits
186
+ * Bug Fixes:
187
+ * form submit events were not following the non-interaction settings
188
+
189
+ = 5.2.3.1 =
190
+ * Bug Fixes:
191
+ * fixing a small reporting issue
192
+
193
+ = 5.2.3 =
194
+ * Enhancements:
195
+ * add Google Analytics user opt-out support
196
+ * add option to exclude tracking for users sending the <em>Do Not Track</em> header
197
+ * add System tab to Errors & Debug screen
198
+ * check to avoid using a redeemed access code
199
+ * Bug Fixes:
200
+ * remove a debugging message
201
+ * cURL options were overwritten during regular API calls
202
+
203
+ = 5.2.2 =
204
+ * Enhancements:
205
+ * more informative alerts and suggestions on the authorization screen
206
+ * disable autocomplete for the access code input field to avoid reuse of the same unique authorization code
207
+ * GADWP Endpoint improvements
208
+ * Error reporting improvements
209
+ * introducing the gadwp_maps_api_key filter
210
+ * Bug Fixes:
211
+ * use the theme color palette for the frontend widget
212
+
213
+ = 5.2.1 =
214
+ * Enhancements:
215
+ * avoid submitting empty error reports
216
+ * Bug Fixes:
217
+ * fixes a bug for custom PHP cURL options
218
+
219
+ = 5.2 =
220
+ * Enhancements:
221
+ * improvements on exponential backoff system
222
+ * introduces a new authentication method with endpoints
223
+ * multiple updates of plugin's options
224
+ * code cleanup
225
+ * improvements on error reporting system
226
+ * option to report errors to developer
227
+ * move the upgrade notice from the Dashboard to plugin's settings page
228
+ * enable PHP cURL proxy support using WordPress settings, props by [Joe Hobson](https://github.com/joehobson)
229
+ * hide unusable options based on plugin's settings
230
+ * Bug Fixes:
231
+ * some thrown errors were not displayed on Errors & Debug screen
232
+ * analytics icon disappears from post list after quick edit, props by [karex](https://github.com/karex)
233
+ * fix for inline SVG links, props by [Andrew Minion](https://github.com/macbookandrew)
234
+ * fixes a bug on affiliate events tracking
235
+
236
+ The full changelog is [available here](https://deconf.com/changelog-google-analytics-dashboard-for-wp/).
tags/5.3.1/realtime/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-icons_222222_256x240.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-icons_454545_256x240.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-icons_888888_256x240.png ADDED
Binary file
tags/5.3.1/realtime/jquery/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
tags/5.3.1/realtime/jquery/jquery.ui.tooltip.html.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! jQuery UI - v1.9.2 - 2013-09-22
2
+ * http://jqueryui.com
3
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}* html .ui-tooltip{background-image:none}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}
tags/5.3.1/realtime/jquery/jquery.ui.tooltip.html.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(function(){jQuery("#gadwp-widget *").tooltip({items:"[data-tooltip]",content:function(){return jQuery(this).attr("data-tooltip")}})});
tags/5.3.1/tools/gapi.php ADDED
@@ -0,0 +1,961 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
15
+
16
+ final class GADWP_GAPI_Controller {
17
+
18
+ public $client;
19
+
20
+ public $service;
21
+
22
+ public $timeshift;
23
+
24
+ public $managequota;
25
+
26
+ private $gadwp;
27
+
28
+ private $access = array( '65556128672.apps.googleusercontent.com', 'Kc7888wgbc_JbeCmApbFjnYpwE' );
29
+
30
+ public function __construct() {
31
+ $this->gadwp = GADWP();
32
+
33
+ include_once ( GADWP_DIR . 'tools/src/Deconf/autoload.php' );
34
+ $config = new Deconf_Config();
35
+ $config->setCacheClass( 'Deconf_Cache_Null' );
36
+ if ( function_exists( 'curl_version' ) ) {
37
+ $curlversion = curl_version();
38
+ $curl_options = array();
39
+ if ( isset( $curlversion['version'] ) ) {
40
+ $rightversion = ( version_compare( PHP_VERSION, '5.3.0' ) >= 0 ) && version_compare( $curlversion['version'], '7.10.8' ) >= 0;
41
+ } else {
42
+ $rightversion = false;
43
+ }
44
+
45
+ if ( $rightversion && defined( 'GADWP_IP_VERSION' ) && GADWP_IP_VERSION ) {
46
+ $curl_options[CURLOPT_IPRESOLVE] = GADWP_IP_VERSION; // Force CURL_IPRESOLVE_V4 or CURL_IPRESOLVE_V6
47
+ }
48
+
49
+ // add Proxy server settings to curl, if defined
50
+ if ( defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' ) ) {
51
+ $curl_options[CURLOPT_PROXY] = WP_PROXY_HOST;
52
+ $curl_options[CURLOPT_PROXYPORT] = WP_PROXY_PORT;
53
+ }
54
+
55
+ if ( defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' ) ) {
56
+ $curl_options[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;
57
+ $curl_options[CURLOPT_PROXYUSERPWD] = WP_PROXY_USERNAME . ':' . WP_PROXY_PASSWORD;
58
+ }
59
+
60
+ $curl_options = apply_filters( 'gadwp_curl_options', $curl_options );
61
+ if ( ! empty( $curl_options ) ) {
62
+ $config->setClassConfig( 'Deconf_IO_Curl', 'options', $curl_options );
63
+ }
64
+ }
65
+ $this->client = new Deconf_Client( $config );
66
+ $this->client->setScopes( array( 'https://www.googleapis.com/auth/analytics.readonly' ) );
67
+ $this->client->setAccessType( 'offline' );
68
+ $this->client->setApplicationName( 'GADWP ' . GADWP_CURRENT_VERSION );
69
+ $this->client->setRedirectUri( 'urn:ietf:wg:oauth:2.0:oob' );
70
+ $this->managequota = 'u' . get_current_user_id() . 's' . get_current_blog_id();
71
+ $this->access = array_map( array( $this, 'map' ), $this->access );
72
+ if ( $this->gadwp->config->options['user_api'] ) {
73
+ $this->client->setClientId( $this->gadwp->config->options['client_id'] );
74
+ $this->client->setClientSecret( $this->gadwp->config->options['client_secret'] );
75
+ } else {
76
+ $this->client->setClientId( $this->access[0] );
77
+ $this->client->setClientSecret( $this->access[1] );
78
+ }
79
+
80
+ /**
81
+ * GADWP Endpoint support
82
+ */
83
+ add_action( 'gadwp_endpoint_support', array( $this, 'add_endpoint_support' ) );
84
+
85
+ $this->service = new Deconf_Service_Analytics( $this->client );
86
+ if ( $this->gadwp->config->options['token'] ) {
87
+ $token = $this->gadwp->config->options['token'];
88
+ if ( $token ) {
89
+ try {
90
+ $this->client->setAccessToken( $token );
91
+ if ( $this->client->isAccessTokenExpired() ) {
92
+ $refreshtoken = $this->client->getRefreshToken();
93
+ $this->client->refreshToken( $refreshtoken );
94
+ }
95
+ $this->gadwp->config->options['token'] = $this->client->getAccessToken();
96
+ } catch ( Deconf_IO_Exception $e ) {
97
+ $timeout = $this->get_timeouts( 'midnight' );
98
+ GADWP_Tools::set_error( $e, $timeout );
99
+ } catch ( Deconf_Service_Exception $e ) {
100
+ $timeout = $this->get_timeouts( 'midnight' );
101
+ GADWP_Tools::set_error( $e, $timeout );
102
+ $this->reset_token();
103
+ } catch ( Exception $e ) {
104
+ $timeout = $this->get_timeouts( 'midnight' );
105
+ GADWP_Tools::set_error( $e, $timeout );
106
+ $this->reset_token();
107
+ }
108
+ if ( is_multisite() && $this->gadwp->config->options['network_mode'] ) {
109
+ $this->gadwp->config->set_plugin_options( true );
110
+ } else {
111
+ $this->gadwp->config->set_plugin_options();
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ public function add_endpoint_support( $request ) {
118
+ if ( $this->gadwp->config->options['with_endpoint'] && ! $this->gadwp->config->options['user_api'] ) {
119
+
120
+ $url = $request->getUrl();
121
+
122
+ if ( in_array( $url, array( 'https://accounts.google.com/o/oauth2/token', 'https://accounts.google.com/o/oauth2/revoke' ) ) ) {
123
+ if ( get_class( $this->client->getIo() ) != 'Deconf_IO_Stream' ) {
124
+ $curl_old_options = $this->client->getClassConfig( 'Deconf_IO_Curl' );
125
+ $curl_options = $curl_old_options['options'];
126
+ $curl_options[CURLOPT_SSL_VERIFYPEER] = 0;
127
+ $this->client->setClassConfig( 'Deconf_IO_Curl', 'options', $curl_options );
128
+ } else {
129
+ add_filter( 'gadwp_endpoint_stream_options', array( $this, 'add_endpoint_stream_ssl' ), 10 );
130
+ }
131
+ } else {
132
+ if ( get_class( $this->client->getIo() ) != 'Deconf_IO_Stream' ) {
133
+ $curl_old_options = $this->client->getClassConfig( 'Deconf_IO_Curl' );
134
+ $curl_options = $curl_old_options['options'];
135
+ if ( isset( $curl_options[CURLOPT_SSL_VERIFYPEER] ) ) {
136
+ unset( $curl_options[CURLOPT_SSL_VERIFYPEER] );
137
+ if ( empty( $curl_options ) ) {
138
+ $this->client->setClassConfig( 'Deconf_IO_Curl', 'options', '' );
139
+ } else {
140
+ $this->client->setClassConfig( 'Deconf_IO_Curl', 'options', $curl_options );
141
+ }
142
+ }
143
+ }
144
+ }
145
+
146
+ $url = str_replace( 'https://accounts.google.com/o/oauth2/token', GADWP_ENDPOINT_URL . 'gadwp-token.php', $url );
147
+
148
+ $url = str_replace( 'https://accounts.google.com/o/oauth2/revoke', GADWP_ENDPOINT_URL . 'gadwp-revoke.php', $url );
149
+
150
+ $request->setUrl( $url );
151
+
152
+ if ( ! $request->getUserAgent() ) {
153
+ $request->setUserAgent( $this->client->getApplicationName() );
154
+ }
155
+ }
156
+ }
157
+
158
+ public function add_endpoint_stream_ssl( $requestSslContext ) {
159
+ return array( "verify_peer" => false );
160
+ }
161
+
162
+ /**
163
+ * Handles errors returned by GAPI Library
164
+ *
165
+ * @return boolean
166
+ */
167
+ public function gapi_errors_handler() {
168
+ $errors = GADWP_Tools::get_cache( 'gapi_errors' );
169
+
170
+ if ( false === $errors || ! isset( $errors[0] ) ) { // invalid error
171
+ return false;
172
+ }
173
+
174
+ if ( isset( $errors[1][0]['reason'] ) && ( 'invalidParameter' == $errors[1][0]['reason'] || 'badRequest' == $errors[1][0]['reason'] || 'invalidCredentials' == $errors[1][0]['reason'] || 'insufficientPermissions' == $errors[1][0]['reason'] || 'required' == $errors[1][0]['reason'] ) ) {
175
+ $this->reset_token();
176
+ return true;
177
+ }
178
+
179
+ /** Back-off system for subsequent requests - an Auth error generated after a Service request
180
+ * The native back-off system for Service requests is covered by the GAPI PHP Client
181
+ */
182
+ if ( isset( $errors[1][0]['reason'] ) && ( 'authError' == $errors[1][0]['reason'] ) ) {
183
+ if ( $this->gadwp->config->options['api_backoff'] <= 5 ) {
184
+ usleep( $this->gadwp->config->options['api_backoff'] * 1000000 + rand( 100000, 1000000 ) );
185
+ $this->gadwp->config->options['api_backoff'] = $this->gadwp->config->options['api_backoff'] + 1;
186
+ $this->gadwp->config->set_plugin_options();
187
+ return false;
188
+ } else {
189
+ return true;
190
+ }
191
+ }
192
+
193
+ if ( 500 == $errors[0] || 503 == $errors[0] || 400 == $errors[0] || 401 == $errors[0] || 403 == $errors[0] || $errors[0] < - 50 ) {
194
+ return true;
195
+ }
196
+
197
+ return false;
198
+ }
199
+
200
+ /**
201
+ * Calculates proper timeouts for each GAPI query
202
+ *
203
+ * @param
204
+ * $interval
205
+ * @return number
206
+ */
207
+ public function get_timeouts( $interval = '' ) {
208
+ $local_time = time() + $this->timeshift;
209
+ if ( 'daily' == $interval ) {
210
+ $nextday = explode( '-', date( 'n-j-Y', strtotime( ' +1 day', $local_time ) ) );
211
+ $midnight = mktime( 0, 0, 0, $nextday[0], $nextday[1], $nextday[2] );
212
+ return $midnight - $local_time;
213
+ } else if ( 'midnight' == $interval ) {
214
+ $midnight = strtotime( "tomorrow 00:00:00" ); // UTC midnight
215
+ $midnight = $midnight + 8 * 3600; // UTC 8 AM
216
+ return $midnight - time();
217
+ } else if ( 'hourly' == $interval ) {
218
+ $nexthour = explode( '-', date( 'H-n-j-Y', strtotime( ' +1 hour', $local_time ) ) );
219
+ $newhour = mktime( $nexthour[0], 0, 0, $nexthour[1], $nexthour[2], $nexthour[3] );
220
+ return $newhour - $local_time;
221
+ } else {
222
+ $newtime = strtotime( ' +5 minutes', $local_time );
223
+ return $newtime - $local_time;
224
+ }
225
+ }
226
+
227
+ /**
228
+ * Generates and retrieves the Access Code
229
+ */
230
+ public function token_request() {
231
+ $data['authUrl'] = $this->client->createAuthUrl();
232
+ GADWP_Tools::load_view( 'admin/views/access-code.php', $data );
233
+ }
234
+
235
+ /**
236
+ * Retrieves all Google Analytics Views with details
237
+ *
238
+ * @return array
239
+ */
240
+ public function refresh_profiles() {
241
+ try {
242
+
243
+ $ga_profiles_list = array();
244
+ $startindex = 1;
245
+ $totalresults = 65535; // use something big
246
+
247
+ while ( $startindex < $totalresults ) {
248
+
249
+ $profiles = $this->service->management_profiles->listManagementProfiles( '~all', '~all', array( 'start-index' => $startindex ) );
250
+
251
+ $items = $profiles->getItems();
252
+
253
+ $totalresults = $profiles->getTotalResults();
254
+
255
+ if ( $totalresults > 0 ) {
256
+
257
+ foreach ( $items as $profile ) {
258
+ $timetz = new DateTimeZone( $profile->getTimezone() );
259
+ $localtime = new DateTime( 'now', $timetz );
260
+ $timeshift = strtotime( $localtime->format( 'Y-m-d H:i:s' ) ) - time();
261
+ $ga_profiles_list[] = array( $profile->getName(), $profile->getId(), $profile->getwebPropertyId(), $profile->getwebsiteUrl(), $timeshift, $profile->getTimezone(), $profile->getDefaultPage() );
262
+ $startindex++;
263
+ }
264
+ }
265
+ }
266
+
267
+ if ( empty( $ga_profiles_list ) ) {
268
+ $timeout = $this->get_timeouts( 'midnight' );
269
+ GADWP_Tools::set_error( 'No properties were found in this account!', $timeout );
270
+ } else {
271
+ GADWP_Tools::delete_cache( 'last_error' );
272
+ }
273
+ return $ga_profiles_list;
274
+ } catch ( Deconf_IO_Exception $e ) {
275
+ $timeout = $this->get_timeouts( 'midnight' );
276
+ GADWP_Tools::set_error( $e, $timeout );
277
+ return $ga_profiles_list;
278
+ } catch ( Deconf_Service_Exception $e ) {
279
+ $timeout = $this->get_timeouts( 'midnight' );
280
+ GADWP_Tools::set_error( $e, $timeout );
281
+ } catch ( Exception $e ) {
282
+ $timeout = $this->get_timeouts( 'midnight' );
283
+ GADWP_Tools::set_error( $e, $timeout );
284
+ }
285
+ }
286
+
287
+ /**
288
+ * Handles the token reset process
289
+ *
290
+ * @param
291
+ * $all
292
+ */
293
+ public function reset_token( $all = true ) {
294
+ $this->gadwp->config->options['token'] = "";
295
+ if ( $all ) {
296
+ $this->gadwp->config->options['tableid_jail'] = "";
297
+ $this->gadwp->config->options['ga_profiles_list'] = array();
298
+ try {
299
+ $this->client->revokeToken();
300
+ } catch ( Exception $e ) {
301
+ if ( is_multisite() && $this->gadwp->config->options['network_mode'] ) {
302
+ $this->gadwp->config->set_plugin_options( true );
303
+ } else {
304
+ $this->gadwp->config->set_plugin_options();
305
+ }
306
+ }
307
+ }
308
+ if ( is_multisite() && $this->gadwp->config->options['network_mode'] ) {
309
+ $this->gadwp->config->set_plugin_options( true );
310
+ } else {
311
+ $this->gadwp->config->set_plugin_options();
312
+ }
313
+ }
314
+
315
+ /**
316
+ * Get and cache Core Reports
317
+ *
318
+ * @param
319
+ * $projecId
320
+ * @param
321
+ * $from
322
+ * @param
323
+ * $to
324
+ * @param
325
+ * $metrics
326
+ * @param
327
+ * $options
328
+ * @param
329
+ * $serial
330
+ * @return int|Deconf_Service_Analytics_GaData
331
+ */
332
+ private function handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ) {
333
+ try {
334
+ if ( 'today' == $from ) {
335
+ $interval = 'hourly';
336
+ } else {
337
+ $interval = 'daily';
338
+ }
339
+ $transient = GADWP_Tools::get_cache( $serial );
340
+ if ( false === $transient ) {
341
+ if ( $this->gapi_errors_handler() ) {
342
+ return - 23;
343
+ }
344
+ $options['samplingLevel'] = 'HIGHER_PRECISION';
345
+ $data = $this->service->data_ga->get( 'ga:' . $projectId, $from, $to, $metrics, $options );
346
+ if ( method_exists( $data, 'getContainsSampledData' ) && $data->getContainsSampledData() ) {
347
+ $sampling['date'] = date( 'Y-m-d H:i:s' );
348
+ $sampling['percent'] = number_format( ( $data->getSampleSize() / $data->getSampleSpace() ) * 100, 2 ) . '%';
349
+ $sampling['sessions'] = $data->getSampleSize() . ' / ' . $data->getSampleSpace();
350
+ GADWP_Tools::set_cache( 'sampleddata', $sampling, 30 * 24 * 3600 );
351
+ GADWP_Tools::set_cache( $serial, $data, $this->get_timeouts( 'hourly' ) ); // refresh every hour if data is sampled
352
+ } else {
353
+ GADWP_Tools::set_cache( $serial, $data, $this->get_timeouts( $interval ) );
354
+ }
355
+ } else {
356
+ $data = $transient;
357
+ }
358
+ } catch ( Deconf_Service_Exception $e ) {
359
+ $timeout = $this->get_timeouts( 'midnight' );
360
+ GADWP_Tools::set_error( $e, $timeout );
361
+ return $e->getCode();
362
+ } catch ( Exception $e ) {
363
+ $timeout = $this->get_timeouts( 'midnight' );
364
+ GADWP_Tools::set_error( $e, $timeout );
365
+ return $e->getCode();
366
+ }
367
+
368
+ $this->gadwp->config->options['api_backoff'] = 0;
369
+ $this->gadwp->config->set_plugin_options();
370
+
371
+ if ( $data->getRows() > 0 ) {
372
+ return $data;
373
+ } else {
374
+ $data->rows = array();
375
+ return $data;
376
+ }
377
+ }
378
+
379
+ /**
380
+ * Generates serials for transients
381
+ *
382
+ * @param
383
+ * $serial
384
+ * @return string
385
+ */
386
+ public function get_serial( $serial ) {
387
+ return sprintf( "%u", crc32( $serial ) );
388
+ }
389
+
390
+ /**
391
+ * Analytics data for Area Charts (Admin Dashboard Widget report)
392
+ *
393
+ * @param
394
+ * $projectId
395
+ * @param
396
+ * $from
397
+ * @param
398
+ * $to
399
+ * @param
400
+ * $query
401
+ * @param
402
+ * $filter
403
+ * @return array|int
404
+ */
405
+ private function get_areachart_data( $projectId, $from, $to, $query, $filter = '' ) {
406
+ switch ( $query ) {
407
+ case 'users' :
408
+ $title = __( "Users", 'google-analytics-dashboard-for-wp' );
409
+ break;
410
+ case 'pageviews' :
411
+ $title = __( "Page Views", 'google-analytics-dashboard-for-wp' );
412
+ break;
413
+ case 'visitBounceRate' :
414
+ $title = __( "Bounce Rate", 'google-analytics-dashboard-for-wp' );
415
+ break;
416
+ case 'organicSearches' :
417
+ $title = __( "Organic Searches", 'google-analytics-dashboard-for-wp' );
418
+ break;
419
+ case 'uniquePageviews' :
420
+ $title = __( "Unique Page Views", 'google-analytics-dashboard-for-wp' );
421
+ break;
422
+ default :
423
+ $title = __( "Sessions", 'google-analytics-dashboard-for-wp' );
424
+ }
425
+ $metrics = 'ga:' . $query;
426
+ if ( 'today' == $from || 'yesterday' == $from ) {
427
+ $dimensions = 'ga:hour';
428
+ $dayorhour = __( "Hour", 'google-analytics-dashboard-for-wp' );
429
+ } else if ( '365daysAgo' == $from || '1095daysAgo' == $from ) {
430
+ $dimensions = 'ga:yearMonth, ga:month';
431
+ $dayorhour = __( "Date", 'google-analytics-dashboard-for-wp' );
432
+ } else {
433
+ $dimensions = 'ga:date,ga:dayOfWeekName';
434
+ $dayorhour = __( "Date", 'google-analytics-dashboard-for-wp' );
435
+ }
436
+ $options = array( 'dimensions' => $dimensions, 'quotaUser' => $this->managequota . 'p' . $projectId );
437
+ if ( $filter ) {
438
+ $options['filters'] = 'ga:pagePath==' . $filter;
439
+ }
440
+ $serial = 'qr2_' . $this->get_serial( $projectId . $from . $metrics . $filter );
441
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
442
+ if ( is_numeric( $data ) ) {
443
+ return $data;
444
+ }
445
+ if ( empty( $data->rows ) ) {
446
+ // unable to render it as an Area Chart, returns a numeric value to be handled by reportsx.js
447
+ return - 21;
448
+ }
449
+ $gadwp_data = array( array( $dayorhour, $title ) );
450
+ if ( 'today' == $from || 'yesterday' == $from ) {
451
+ foreach ( $data->getRows() as $row ) {
452
+ $gadwp_data[] = array( (int) $row[0] . ':00', round( $row[1], 2 ) );
453
+ }
454
+ } else if ( '365daysAgo' == $from || '1095daysAgo' == $from ) {
455
+ foreach ( $data->getRows() as $row ) {
456
+ /*
457
+ * translators:
458
+ * Example: 'F, Y' will become 'November, 2015'
459
+ * For details see: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters
460
+ */
461
+ $gadwp_data[] = array( date_i18n( __( 'F, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] . '01' ) ), round( $row[2], 2 ) );
462
+ }
463
+ } else {
464
+ foreach ( $data->getRows() as $row ) {
465
+ /*
466
+ * translators:
467
+ * Example: 'l, F j, Y' will become 'Thusday, November 17, 2015'
468
+ * For details see: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters
469
+ */
470
+ $gadwp_data[] = array( date_i18n( __( 'l, F j, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] ) ), round( $row[2], 2 ) );
471
+ }
472
+ }
473
+
474
+ return $gadwp_data;
475
+ }
476
+
477
+ /**
478
+ * Analytics data for Bottom Stats (bottom stats on main report)
479
+ *
480
+ * @param
481
+ * $projectId
482
+ * @param
483
+ * $from
484
+ * @param
485
+ * $to
486
+ * @param
487
+ * $filter
488
+ * @return array|int
489
+ */
490
+ private function get_bottomstats( $projectId, $from, $to, $filter = '' ) {
491
+ $options = array( 'dimensions' => null, 'quotaUser' => $this->managequota . 'p' . $projectId );
492
+ if ( $filter ) {
493
+ $options['filters'] = 'ga:pagePath==' . $filter;
494
+ $metrics = 'ga:uniquePageviews,ga:users,ga:pageviews,ga:BounceRate,ga:organicSearches,ga:pageviewsPerSession,ga:avgTimeOnPage,ga:avgPageLoadTime,ga:exitRate';
495
+ } else {
496
+ $metrics = 'ga:sessions,ga:users,ga:pageviews,ga:BounceRate,ga:organicSearches,ga:pageviewsPerSession,ga:avgTimeOnPage,ga:avgPageLoadTime,ga:avgSessionDuration';
497
+ }
498
+ $serial = 'qr3_' . $this->get_serial( $projectId . $from . $filter );
499
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
500
+ if ( is_numeric( $data ) ) {
501
+ return $data;
502
+ }
503
+ $gadwp_data = array();
504
+ foreach ( $data->getRows() as $row ) {
505
+ $gadwp_data = array_map( 'floatval', $row );
506
+ }
507
+
508
+ // i18n support
509
+ $gadwp_data[0] = isset( $gadwp_data[0] ) ? number_format_i18n( $gadwp_data[0] ) : 0;
510
+ $gadwp_data[1] = isset( $gadwp_data[1] ) ? number_format_i18n( $gadwp_data[1] ) : 0;
511
+ $gadwp_data[2] = isset( $gadwp_data[2] ) ? number_format_i18n( $gadwp_data[2] ) : 0;
512
+ $gadwp_data[3] = isset( $gadwp_data[3] ) ? number_format_i18n( $gadwp_data[3], 2 ) . '%' : '0%';
513
+ $gadwp_data[4] = isset( $gadwp_data[4] ) ? number_format_i18n( $gadwp_data[4] ) : 0;
514
+ $gadwp_data[5] = isset( $gadwp_data[5] ) ? number_format_i18n( $gadwp_data[5], 2 ) : 0;
515
+ $gadwp_data[6] = isset( $gadwp_data[6] ) ? gmdate( "H:i:s", $gadwp_data[6] ) : '00:00:00';
516
+ $gadwp_data[7] = isset( $gadwp_data[7] ) ? number_format_i18n( $gadwp_data[7], 2 ) : 0;
517
+ if ( $filter ) {
518
+ $gadwp_data[8] = isset( $gadwp_data[8] ) ? number_format_i18n( $gadwp_data[8], 2 ) . '%' : '0%';
519
+ } else {
520
+ $gadwp_data[8] = isset( $gadwp_data[8] ) ? gmdate( "H:i:s", $gadwp_data[8] ) : '00:00:00';
521
+ }
522
+
523
+ return $gadwp_data;
524
+ }
525
+
526
+ /**
527
+ * Analytics data for Table Charts (content pages)
528
+ *
529
+ * @param
530
+ * $projectId
531
+ * @param
532
+ * $from
533
+ * @param
534
+ * $to
535
+ * @param
536
+ * $filter
537
+ * @return array|int
538
+ */
539
+ private function get_contentpages( $projectId, $from, $to, $filter = '', $metric ) {
540
+ $metrics = 'ga:' . $metric;
541
+ $dimensions = 'ga:pageTitle';
542
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
543
+ if ( $filter ) {
544
+ $options['filters'] = 'ga:pagePath==' . $filter;
545
+ }
546
+ $serial = 'qr4_' . $this->get_serial( $projectId . $from . $filter . $metric );
547
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
548
+ if ( is_numeric( $data ) ) {
549
+ return $data;
550
+ }
551
+ $gadwp_data = array( array( __( "Pages", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
552
+ foreach ( $data->getRows() as $row ) {
553
+ $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] );
554
+ }
555
+ return $gadwp_data;
556
+ }
557
+
558
+ /**
559
+ * Analytics data for 404 Errors
560
+ *
561
+ * @param
562
+ * $projectId
563
+ * @param
564
+ * $from
565
+ * @param
566
+ * $to
567
+ * @return array|int
568
+ */
569
+ private function get_404errors( $projectId, $from, $to, $filter = "Page Not Found", $metric ) {
570
+ $metrics = 'ga:' . $metric;
571
+ $dimensions = 'ga:pagePath,ga:fullReferrer';
572
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
573
+ $options['filters'] = 'ga:pageTitle=@' . $filter;
574
+ $serial = 'qr4_' . $this->get_serial( $projectId . $from . $filter . $metric );
575
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
576
+ if ( is_numeric( $data ) ) {
577
+ return $data;
578
+ }
579
+ $gadwp_data = array( array( __( "404 Errors", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
580
+ foreach ( $data->getRows() as $row ) {
581
+ $path = esc_html( $row[0] );
582
+ $source = esc_html( $row[1] );
583
+ $gadwp_data[] = array( "<strong>" . __( "URI:", 'google-analytics-dashboard-for-wp' ) . "</strong> " . $path . "<br><strong>" . __( "Source:", 'google-analytics-dashboard-for-wp' ) . "</strong> " . $source, (int) $row[2] );
584
+ }
585
+ return $gadwp_data;
586
+ }
587
+
588
+ /**
589
+ * Analytics data for Table Charts (referrers)
590
+ *
591
+ * @param
592
+ * $projectId
593
+ * @param
594
+ * $from
595
+ * @param
596
+ * $to
597
+ * @param
598
+ * $filter
599
+ * @return array|int
600
+ */
601
+ private function get_referrers( $projectId, $from, $to, $filter = '', $metric ) {
602
+ $metrics = 'ga:' . $metric;
603
+ $dimensions = 'ga:source';
604
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
605
+ if ( $filter ) {
606
+ $options['filters'] = 'ga:medium==referral;ga:pagePath==' . $filter;
607
+ } else {
608
+ $options['filters'] = 'ga:medium==referral';
609
+ }
610
+ $serial = 'qr5_' . $this->get_serial( $projectId . $from . $filter . $metric );
611
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
612
+ if ( is_numeric( $data ) ) {
613
+ return $data;
614
+ }
615
+ $gadwp_data = array( array( __( "Referrers", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
616
+ foreach ( $data->getRows() as $row ) {
617
+ $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] );
618
+ }
619
+ return $gadwp_data;
620
+ }
621
+
622
+ /**
623
+ * Analytics data for Table Charts (searches)
624
+ *
625
+ * @param
626
+ * $projectId
627
+ * @param
628
+ * $from
629
+ * @param
630
+ * $to
631
+ * @param
632
+ * $filter
633
+ * @return array|int
634
+ */
635
+ private function get_searches( $projectId, $from, $to, $filter = '', $metric ) {
636
+ $metrics = 'ga:' . $metric;
637
+ $dimensions = 'ga:keyword';
638
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
639
+ if ( $filter ) {
640
+ $options['filters'] = 'ga:keyword!=(not set);ga:pagePath==' . $filter;
641
+ } else {
642
+ $options['filters'] = 'ga:keyword!=(not set)';
643
+ }
644
+ $serial = 'qr6_' . $this->get_serial( $projectId . $from . $filter . $metric );
645
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
646
+ if ( is_numeric( $data ) ) {
647
+ return $data;
648
+ }
649
+
650
+ $gadwp_data = array( array( __( "Searches", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
651
+ foreach ( $data->getRows() as $row ) {
652
+ $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] );
653
+ }
654
+ return $gadwp_data;
655
+ }
656
+
657
+ /**
658
+ * Analytics data for Table Charts (location reports)
659
+ *
660
+ * @param
661
+ * $projectId
662
+ * @param
663
+ * $from
664
+ * @param
665
+ * $to
666
+ * @param
667
+ * $filter
668
+ * @return array|int
669
+ */
670
+ private function get_locations( $projectId, $from, $to, $filter = '', $metric ) {
671
+ $metrics = 'ga:' . $metric;
672
+ $options = "";
673
+ $title = __( "Countries", 'google-analytics-dashboard-for-wp' );
674
+ $serial = 'qr7_' . $this->get_serial( $projectId . $from . $filter . $metric );
675
+ $dimensions = 'ga:country';
676
+ $local_filter = '';
677
+ if ( $this->gadwp->config->options['ga_target_geomap'] ) {
678
+ $dimensions = 'ga:city, ga:region';
679
+
680
+ $country_codes = GADWP_Tools::get_countrycodes();
681
+ if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
682
+ $local_filter = 'ga:country==' . ( $country_codes[$this->gadwp->config->options['ga_target_geomap']] );
683
+ $title = __( "Cities from", 'google-analytics-dashboard-for-wp' ) . ' ' . __( $country_codes[$this->gadwp->config->options['ga_target_geomap']] );
684
+ $serial = 'qr7_' . $this->get_serial( $projectId . $from . $this->gadwp->config->options['ga_target_geomap'] . $filter . $metric );
685
+ }
686
+ }
687
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
688
+ if ( $filter ) {
689
+ $options['filters'] = 'ga:pagePath==' . $filter;
690
+ if ( $local_filter ) {
691
+ $options['filters'] .= ';' . $local_filter;
692
+ }
693
+ } else {
694
+ if ( $local_filter ) {
695
+ $options['filters'] = $local_filter;
696
+ }
697
+ }
698
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
699
+ if ( is_numeric( $data ) ) {
700
+ return $data;
701
+ }
702
+
703
+ $gadwp_data = array( array( $title, __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
704
+ foreach ( $data->getRows() as $row ) {
705
+ if ( isset( $row[2] ) ) {
706
+ $gadwp_data[] = array( esc_html( $row[0] ) . ', ' . esc_html( $row[1] ), (int) $row[2] );
707
+ } else {
708
+ $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] );
709
+ }
710
+ }
711
+ return $gadwp_data;
712
+ }
713
+
714
+ /**
715
+ * Analytics data for Org Charts (traffic channels, device categories)
716
+ *
717
+ * @param
718
+ * $projectId
719
+ * @param
720
+ * $from
721
+ * @param
722
+ * $to
723
+ * @param
724
+ * $query
725
+ * @param
726
+ * $filter
727
+ * @return array|int
728
+ */
729
+ private function get_orgchart_data( $projectId, $from, $to, $query, $filter = '', $metric ) {
730
+ $metrics = 'ga:' . $metric;
731
+ $dimensions = 'ga:' . $query;
732
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
733
+ if ( $filter ) {
734
+ $options['filters'] = 'ga:pagePath==' . $filter;
735
+ }
736
+ $serial = 'qr8_' . $this->get_serial( $projectId . $from . $query . $filter . $metric );
737
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
738
+ if ( is_numeric( $data ) ) {
739
+ return $data;
740
+ }
741
+ if ( empty( $data->rows ) ) {
742
+ // unable to render as an Org Chart, returns a numeric value to be handled by reportsx.js
743
+ return - 21;
744
+ }
745
+ $block = ( 'channelGrouping' == $query ) ? __( "Channels", 'google-analytics-dashboard-for-wp' ) : __( "Devices", 'google-analytics-dashboard-for-wp' );
746
+ $gadwp_data = array( array( '<div style="color:black; font-size:1.1em">' . $block . '</div><div style="color:darkblue; font-size:1.2em">' . (int) $data['totalsForAllResults'][$metrics] . '</div>', "" ) );
747
+ foreach ( $data->getRows() as $row ) {
748
+ $shrink = explode( " ", $row[0] );
749
+ $gadwp_data[] = array( '<div style="color:black; font-size:1.1em">' . esc_html( $shrink[0] ) . '</div><div style="color:darkblue; font-size:1.2em">' . (int) $row[1] . '</div>', '<div style="color:black; font-size:1.1em">' . $block . '</div><div style="color:darkblue; font-size:1.2em">' . (int) $data['totalsForAllResults'][$metrics] . '</div>' );
750
+ }
751
+ return $gadwp_data;
752
+ }
753
+
754
+ /**
755
+ * Analytics data for Pie Charts (traffic mediums, serach engines, social networks, browsers, screen rsolutions, etc.)
756
+ *
757
+ * @param
758
+ * $projectId
759
+ * @param
760
+ * $from
761
+ * @param
762
+ * $to
763
+ * @param
764
+ * $query
765
+ * @param
766
+ * $filter
767
+ * @return array|int
768
+ */
769
+ private function get_piechart_data( $projectId, $from, $to, $query, $filter = '', $metric ) {
770
+ $metrics = 'ga:' . $metric;
771
+ $dimensions = 'ga:' . $query;
772
+
773
+ if ( 'source' == $query ) {
774
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
775
+ if ( $filter ) {
776
+ $options['filters'] = 'ga:medium==organic;ga:keyword!=(not set);ga:pagePath==' . $filter;
777
+ } else {
778
+ $options['filters'] = 'ga:medium==organic;ga:keyword!=(not set)';
779
+ }
780
+ } else {
781
+ $options = array( 'dimensions' => $dimensions, 'sort' => '-' . $metrics, 'quotaUser' => $this->managequota . 'p' . $projectId );
782
+ if ( $filter ) {
783
+ $options['filters'] = 'ga:' . $query . '!=(not set);ga:pagePath==' . $filter;
784
+ } else {
785
+ $options['filters'] = 'ga:' . $query . '!=(not set)';
786
+ }
787
+ }
788
+ $serial = 'qr10_' . $this->get_serial( $projectId . $from . $query . $filter . $metric );
789
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
790
+ if ( is_numeric( $data ) ) {
791
+ return $data;
792
+ }
793
+ $gadwp_data = array( array( __( "Type", 'google-analytics-dashboard-for-wp' ), __( ucfirst( $metric ), 'google-analytics-dashboard-for-wp' ) ) );
794
+ $i = 0;
795
+ $included = 0;
796
+ foreach ( $data->getRows() as $row ) {
797
+ if ( $i < 20 ) {
798
+ $gadwp_data[] = array( str_replace( "(none)", "direct", esc_html( $row[0] ) ), (int) $row[1] );
799
+ $included += $row[1];
800
+ $i++;
801
+ } else {
802
+ break;
803
+ }
804
+ }
805
+ $totals = $data->getTotalsForAllResults();
806
+ $others = $totals[$metrics] - $included;
807
+ if ( $others > 0 ) {
808
+ $gadwp_data[] = array( __( 'Other', 'google-analytics-dashboard-for-wp' ), $others );
809
+ }
810
+
811
+ return $gadwp_data;
812
+ }
813
+
814
+ /**
815
+ * Analytics data for Frontend Widget (chart data and totals)
816
+ *
817
+ * @param
818
+ * $projectId
819
+ * @param
820
+ * $period
821
+ * @param
822
+ * $anonim
823
+ * @return array|int
824
+ */
825
+ public function frontend_widget_stats( $projectId, $from, $anonim ) {
826
+ $content = '';
827
+ $to = 'yesterday';
828
+ $metrics = 'ga:sessions';
829
+ $dimensions = 'ga:date,ga:dayOfWeekName';
830
+ $options = array( 'dimensions' => $dimensions, 'quotaUser' => $this->managequota . 'p' . $projectId );
831
+ $serial = 'qr2_' . $this->get_serial( $projectId . $from . $metrics );
832
+ $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
833
+ if ( is_numeric( $data ) ) {
834
+ return $data;
835
+ }
836
+ $gadwp_data = array( array( __( "Date", 'google-analytics-dashboard-for-wp' ), __( "Sessions", 'google-analytics-dashboard-for-wp' ) ) );
837
+ if ( $anonim ) {
838
+ $max_array = array();
839
+ foreach ( $data->getRows() as $item ) {
840
+ $max_array[] = $item[2];
841
+ }
842
+ $max = max( $max_array ) ? max( $max_array ) : 1;
843
+ }
844
+ foreach ( $data->getRows() as $row ) {
845
+ $gadwp_data[] = array( date_i18n( __( 'l, F j, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] ) ), ( $anonim ? round( $row[2] * 100 / $max, 2 ) : (int) $row[2] ) );
846
+ }
847
+ $totals = $data->getTotalsForAllResults();
848
+ return array( $gadwp_data, $anonim ? 0 : number_format_i18n( $totals['ga:sessions'] ) );
849
+ }
850
+
851
+ /**
852
+ * Analytics data for Realtime component (the real-time report)
853
+ *
854
+ * @param
855
+ * $projectId
856
+ * @return array|int
857
+ */
858
+ private function get_realtime( $projectId ) {
859
+ $metrics = 'rt:activeUsers';
860
+ $dimensions = 'rt:pagePath,rt:source,rt:keyword,rt:trafficType,rt:visitorType,rt:pageTitle';
861
+ try {
862
+ $serial = 'qr_realtimecache_' . $this->get_serial( $projectId );
863
+ $transient = GADWP_Tools::get_cache( $serial );
864
+ if ( false === $transient ) {
865
+ if ( $this->gapi_errors_handler() ) {
866
+ return - 23;
867
+ }
868
+ $data = $this->service->data_realtime->get( 'ga:' . $projectId, $metrics, array( 'dimensions' => $dimensions, 'quotaUser' => $this->managequota . 'p' . $projectId ) );
869
+ GADWP_Tools::set_cache( $serial, $data, 55 );
870
+ } else {
871
+ $data = $transient;
872
+ }
873
+ } catch ( Deconf_Service_Exception $e ) {
874
+ $timeout = $this->get_timeouts( 'midnight' );
875
+ GADWP_Tools::set_error( $e, $timeout );
876
+ return $e->getCode();
877
+ } catch ( Exception $e ) {
878
+ $timeout = $this->get_timeouts( 'midnight' );
879
+ GADWP_Tools::set_error( $e, $timeout );
880
+ return $e->getCode();
881
+ }
882
+ if ( $data->getRows() < 1 ) {
883
+ return - 21;
884
+ }
885
+ $i = 0;
886
+ $gadwp_data = $data;
887
+ foreach ( $data->getRows() as $row ) {
888
+ $strip = array_map( 'wp_kses_data', $row );
889
+ $gadwp_data->rows[$i] = array_map( 'esc_html', $strip );
890
+ $i++;
891
+ }
892
+
893
+ $this->gadwp->config->options['api_backoff'] = 0;
894
+ $this->gadwp->config->set_plugin_options();
895
+
896
+ return array( $gadwp_data );
897
+ }
898
+
899
+ private function map( $map ) {
900
+ $map = explode( '.', $map );
901
+ if ( isset( $map[1] ) ) {
902
+ $map[0] += ord( 'map' );
903
+ return implode( '.', $map );
904
+ } else {
905
+ return str_ireplace( 'map', chr( 112 ), $map[0] );
906
+ }
907
+ }
908
+
909
+ /**
910
+ * Handles ajax requests and calls the needed methods
911
+ * @param
912
+ * $projectId
913
+ * @param
914
+ * $query
915
+ * @param
916
+ * $from
917
+ * @param
918
+ * $to
919
+ * @param
920
+ * $filter
921
+ * @return number|Deconf_Service_Analytics_GaData
922
+ */
923
+ public function get( $projectId, $query, $from = false, $to = false, $filter = '', $metric = 'sessions' ) {
924
+ if ( empty( $projectId ) || ! is_numeric( $projectId ) ) {
925
+ wp_die( - 26 );
926
+ }
927
+ if ( in_array( $query, array( 'sessions', 'users', 'organicSearches', 'visitBounceRate', 'pageviews', 'uniquePageviews' ) ) ) {
928
+ return $this->get_areachart_data( $projectId, $from, $to, $query, $filter );
929
+ }
930
+ if ( 'bottomstats' == $query ) {
931
+ return $this->get_bottomstats( $projectId, $from, $to, $filter );
932
+ }
933
+ if ( 'locations' == $query ) {
934
+ return $this->get_locations( $projectId, $from, $to, $filter, $metric );
935
+ }
936
+ if ( 'referrers' == $query ) {
937
+ return $this->get_referrers( $projectId, $from, $to, $filter, $metric );
938
+ }
939
+ if ( 'contentpages' == $query ) {
940
+ return $this->get_contentpages( $projectId, $from, $to, $filter, $metric );
941
+ }
942
+ if ( '404errors' == $query ) {
943
+ $filter = $this->gadwp->config->options['pagetitle_404'];
944
+ return $this->get_404errors( $projectId, $from, $to, $filter, $metric );
945
+ }
946
+ if ( 'searches' == $query ) {
947
+ return $this->get_searches( $projectId, $from, $to, $filter, $metric );
948
+ }
949
+ if ( 'realtime' == $query ) {
950
+ return $this->get_realtime( $projectId );
951
+ }
952
+ if ( 'channelGrouping' == $query || 'deviceCategory' == $query ) {
953
+ return $this->get_orgchart_data( $projectId, $from, $to, $query, $filter, $metric );
954
+ }
955
+ if ( in_array( $query, array( 'medium', 'visitorType', 'socialNetwork', 'source', 'browser', 'operatingSystem', 'screenResolution', 'mobileDeviceBranding' ) ) ) {
956
+ return $this->get_piechart_data( $projectId, $from, $to, $query, $filter, $metric );
957
+ }
958
+ wp_die( - 27 );
959
+ }
960
+ }
961
+ }
tags/5.3.1/tools/iso3166.php ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit();
13
+
14
+ /* @formatter:off */
15
+ $country_codes = array(
16
+ 'AD' => 'Andorra',
17
+ 'AE' => 'United Arab Emirates',
18
+ 'AF' => 'Afghanistan',
19
+ 'AG' => 'Antigua and Barbuda',
20
+ 'AI' => 'Anguilla',
21
+ 'AL' => 'Albania',
22
+ 'AM' => 'Armenia',
23
+ 'AN' => 'Netherlands Antilles',
24
+ 'AO' => 'Angola',
25
+ 'AQ' => 'Antarctica',
26
+ 'AR' => 'Argentina',
27
+ 'AS' => 'American Samoa',
28
+ 'AT' => 'Austria',
29
+ 'AU' => 'Australia',
30
+ 'AW' => 'Aruba',
31
+ 'AZ' => 'Azerbaijan',
32
+ 'BA' => 'Bosnia and Herzegovina',
33
+ 'BB' => 'Barbados',
34
+ 'BD' => 'Bangladesh',
35
+ 'BE' => 'Belgium',
36
+ 'BF' => 'Burkina Faso',
37
+ 'BG' => 'Bulgaria',
38
+ 'BH' => 'Bahrain',
39
+ 'BI' => 'Burundi',
40
+ 'BJ' => 'Benin',
41
+ 'BM' => 'Bermuda',
42
+ 'BN' => 'Brunei',
43
+ 'BO' => 'Bolivia',
44
+ 'BR' => 'Brazil',
45
+ 'BS' => 'Bahamas',
46
+ 'BT' => 'Bhutan',
47
+ 'BV' => 'Bouvet Island',
48
+ 'BW' => 'Botswana',
49
+ 'BY' => 'Belarus',
50
+ 'BZ' => 'Belize',
51
+ 'CA' => 'Canada',
52
+ 'CC' => 'Cocos (Keeling) Islands',
53
+ 'CD' => 'Congo, The Democratic Republic of the',
54
+ 'CF' => 'Central African Republic',
55
+ 'CG' => 'Congo',
56
+ 'CH' => 'Switzerland',
57
+ 'CI' => 'C�te d?Ivoire',
58
+ 'CK' => 'Cook Islands',
59
+ 'CL' => 'Chile',
60
+ 'CM' => 'Cameroon',
61
+ 'CN' => 'China',
62
+ 'CO' => 'Colombia',
63
+ 'CR' => 'Costa Rica',
64
+ 'CU' => 'Cuba',
65
+ 'CV' => 'Cape Verde',
66
+ 'CX' => 'Christmas Island',
67
+ 'CY' => 'Cyprus',
68
+ 'CZ' => 'Czech Republic',
69
+ 'DE' => 'Germany',
70
+ 'DJ' => 'Djibouti',
71
+ 'DK' => 'Denmark',
72
+ 'DM' => 'Dominica',
73
+ 'DO' => 'Dominican Republic',
74
+ 'DZ' => 'Algeria',
75
+ 'EC' => 'Ecuador',
76
+ 'EE' => 'Estonia',
77
+ 'EG' => 'Egypt',
78
+ 'EH' => 'Western Sahara',
79
+ 'ER' => 'Eritrea',
80
+ 'ES' => 'Spain',
81
+ 'ET' => 'Ethiopia',
82
+ 'FI' => 'Finland',
83
+ 'FJ' => 'Fiji Islands',
84
+ 'FK' => 'Falkland Islands',
85
+ 'FM' => 'Micronesia, Federated States of',
86
+ 'FO' => 'Faroe Islands',
87
+ 'FR' => 'France',
88
+ 'GA' => 'Gabon',
89
+ 'GB' => 'United Kingdom',
90
+ 'GD' => 'Grenada',
91
+ 'GE' => 'Georgia',
92
+ 'GF' => 'French Guiana',
93
+ 'GH' => 'Ghana',
94
+ 'GI' => 'Gibraltar',
95
+ 'GL' => 'Greenland',
96
+ 'GM' => 'Gambia',
97
+ 'GN' => 'Guinea',
98
+ 'GP' => 'Guadeloupe',
99
+ 'GQ' => 'Equatorial Guinea',
100
+ 'GR' => 'Greece',
101
+ 'GS' => 'South Georgia and the South Sandwich Islands',
102
+ 'GT' => 'Guatemala',
103
+ 'GU' => 'Guam',
104
+ 'GW' => 'Guinea-Bissau',
105
+ 'GY' => 'Guyana',
106
+ 'HK' => 'Hong Kong',
107
+ 'HM' => 'Heard Island and McDonald Islands',
108
+ 'HN' => 'Honduras',
109
+ 'HR' => 'Croatia',
110
+ 'HT' => 'Haiti',
111
+ 'HU' => 'Hungary',
112
+ 'ID' => 'Indonesia',
113
+ 'IE' => 'Ireland',
114
+ 'IL' => 'Israel',
115
+ 'IN' => 'India',
116
+ 'IO' => 'British Indian Ocean Territory',
117
+ 'IQ' => 'Iraq',
118
+ 'IR' => 'Iran',
119
+ 'IS' => 'Iceland',
120
+ 'IT' => 'Italy',
121
+ 'JM' => 'Jamaica',
122
+ 'JO' => 'Jordan',
123
+ 'JP' => 'Japan',
124
+ 'KE' => 'Kenya',
125
+ 'KG' => 'Kyrgyzstan',
126
+ 'KH' => 'Cambodia',
127
+ 'KI' => 'Kiribati',
128
+ 'KM' => 'Comoros',
129
+ 'KN' => 'Saint Kitts and Nevis',
130
+ 'KP' => 'North Korea',
131
+ 'KR' => 'South Korea',
132
+ 'KW' => 'Kuwait',
133
+ 'KY' => 'Cayman Islands',
134
+ 'KZ' => 'Kazakstan',
135
+ 'LA' => 'Laos',
136
+ 'LB' => 'Lebanon',
137
+ 'LC' => 'Saint Lucia',
138
+ 'LI' => 'Liechtenstein',
139
+ 'LK' => 'Sri Lanka',
140
+ 'LR' => 'Liberia',
141
+ 'LS' => 'Lesotho',
142
+ 'LT' => 'Lithuania',
143
+ 'LU' => 'Luxembourg',
144
+ 'LV' => 'Latvia',
145
+ 'LY' => 'Libyan Arab Jamahiriya',
146
+ 'MA' => 'Morocco',
147
+ 'MC' => 'Monaco',
148
+ 'MD' => 'Moldova',
149
+ 'MG' => 'Madagascar',
150
+ 'MH' => 'Marshall Islands',
151
+ 'MK' => 'Macedonia',
152
+ 'ML' => 'Mali',
153
+ 'MM' => 'Myanmar',
154
+ 'MN' => 'Mongolia',
155
+ 'MO' => 'Macao',
156
+ 'MP' => 'Northern Mariana Islands',
157
+ 'MQ' => 'Martinique',
158
+ 'MR' => 'Mauritania',
159
+ 'MS' => 'Montserrat',
160
+ 'MT' => 'Malta',
161
+ 'MU' => 'Mauritius',
162
+ 'MV' => 'Maldives',
163
+ 'MW' => 'Malawi',
164
+ 'MX' => 'Mexico',
165
+ 'MY' => 'Malaysia',
166
+ 'MZ' => 'Mozambique',
167
+ 'NA' => 'Namibia',
168
+ 'NC' => 'New Caledonia',
169
+ 'NE' => 'Niger',
170
+ 'NF' => 'Norfolk Island',
171
+ 'NG' => 'Nigeria',
172
+ 'NI' => 'Nicaragua',
173
+ 'NL' => 'Netherlands',
174
+ 'NO' => 'Norway',
175
+ 'NP' => 'Nepal',
176
+ 'NR' => 'Nauru',
177
+ 'NU' => 'Niue',
178
+ 'NZ' => 'New Zealand',
179
+ 'OM' => 'Oman',
180
+ 'PA' => 'Panama',
181
+ 'PE' => 'Peru',
182
+ 'PF' => 'French Polynesia',
183
+ 'PG' => 'Papua New Guinea',
184
+ 'PH' => 'Philippines',
185
+ 'PK' => 'Pakistan',
186
+ 'PL' => 'Poland',
187
+ 'PM' => 'Saint Pierre and Miquelon',
188
+ 'PN' => 'Pitcairn',
189
+ 'PR' => 'Puerto Rico',
190
+ 'PS' => 'Palestine',
191
+ 'PT' => 'Portugal',
192
+ 'PW' => 'Palau',
193
+ 'PY' => 'Paraguay',
194
+ 'QA' => 'Qatar',
195
+ 'RE' => 'Reunion',
196
+ 'RO' => 'Romania',
197
+ 'RU' => 'Russia',
198
+ 'RW' => 'Rwanda',
199
+ 'SA' => 'Saudi Arabia',
200
+ 'SB' => 'Solomon Islands',
201
+ 'SC' => 'Seychelles',
202
+ 'SD' => 'Sudan',
203
+ 'SE' => 'Sweden',
204
+ 'SG' => 'Singapore',
205
+ 'SH' => 'Saint Helena',
206
+ 'SI' => 'Slovenia',
207
+ 'SJ' => 'Svalbard and Jan Mayen',
208
+ 'SK' => 'Slovakia',
209
+ 'SL' => 'Sierra Leone',
210
+ 'SM' => 'San Marino',
211
+ 'SN' => 'Senegal',
212
+ 'SO' => 'Somalia',
213
+ 'SR' => 'Suriname',
214
+ 'ST' => 'Sao Tome and Principe',
215
+ 'SV' => 'El Salvador',
216
+ 'SY' => 'Syria',
217
+ 'SZ' => 'Swaziland',
218
+ 'TC' => 'Turks and Caicos Islands',
219
+ 'TD' => 'Chad',
220
+ 'TF' => 'French Southern territories',
221
+ 'TG' => 'Togo',
222
+ 'TH' => 'Thailand',
223
+ 'TJ' => 'Tajikistan',
224
+ 'TK' => 'Tokelau',
225
+ 'TM' => 'Turkmenistan',
226
+ 'TN' => 'Tunisia',
227
+ 'TO' => 'Tonga',
228
+ 'TP' => 'East Timor',
229
+ 'TR' => 'Turkey',
230
+ 'TT' => 'Trinidad and Tobago',
231
+ 'TV' => 'Tuvalu',
232
+ 'TW' => 'Taiwan',
233
+ 'TZ' => 'Tanzania',
234
+ 'UA' => 'Ukraine',
235
+ 'UG' => 'Uganda',
236
+ 'UM' => 'United States Minor Outlying Islands',
237
+ 'US' => 'United States',
238
+ 'UY' => 'Uruguay',
239
+ 'UZ' => 'Uzbekistan',
240
+ 'VA' => 'Holy See (Vatican City State)',
241
+ 'VC' => 'Saint Vincent and the Grenadines',
242
+ 'VE' => 'Venezuela',
243
+ 'VG' => 'Virgin Islands, British',
244
+ 'VI' => 'Virgin Islands, U.S.',
245
+ 'VN' => 'Vietnam',
246
+ 'VU' => 'Vanuatu',
247
+ 'WF' => 'Wallis and Futuna',
248
+ 'WS' => 'Samoa',
249
+ 'YE' => 'Yemen',
250
+ 'YT' => 'Mayotte',
251
+ 'YU' => 'Yugoslavia',
252
+ 'ZA' => 'South Africa',
253
+ 'ZM' => 'Zambia',
254
+ 'ZW' => 'Zimbabwe' );
255
+ /* @formatter:on */
tags/5.3.1/tools/src/Deconf/Auth/Abstract.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2010 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Abstract class for the Authentication in the API client
24
+ * @author Chris Chabot <chabotc@google.com>
25
+ *
26
+ */
27
+ abstract class Deconf_Auth_Abstract
28
+ {
29
+ /**
30
+ * An utility function that first calls $this->auth->sign($request) and then
31
+ * executes makeRequest() on that signed request. Used for when a request
32
+ * should be authenticated
33
+ * @param Deconf_Http_Request $request
34
+ * @return Deconf_Http_Request $request
35
+ */
36
+ abstract public function authenticatedRequest(Deconf_Http_Request $request);
37
+ abstract public function sign(Deconf_Http_Request $request);
38
+ }
tags/5.3.1/tools/src/Deconf/Auth/AppIdentity.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /*
19
+ * WARNING - this class depends on the Google App Engine PHP library
20
+ * which is 5.3 and above only, so if you include this in a PHP 5.2
21
+ * setup or one without 5.3 things will blow up.
22
+ */
23
+ use google\appengine\api\app_identity\AppIdentityService;
24
+
25
+ if (!class_exists('Deconf_Client')) {
26
+ require_once dirname(__FILE__) . '/../autoload.php';
27
+ }
28
+
29
+ /**
30
+ * Authentication via the Google App Engine App Identity service.
31
+ */
32
+ class Deconf_Auth_AppIdentity extends Deconf_Auth_Abstract
33
+ {
34
+ const CACHE_PREFIX = "Deconf_Auth_AppIdentity::";
35
+ private $client;
36
+ private $token = false;
37
+ private $tokenScopes = false;
38
+
39
+ public function __construct(Deconf_Client $client, $config = null)
40
+ {
41
+ $this->client = $client;
42
+ }
43
+
44
+ /**
45
+ * Retrieve an access token for the scopes supplied.
46
+ */
47
+ public function authenticateForScope($scopes)
48
+ {
49
+ if ($this->token && $this->tokenScopes == $scopes) {
50
+ return $this->token;
51
+ }
52
+
53
+ $cacheKey = self::CACHE_PREFIX;
54
+ if (is_string($scopes)) {
55
+ $cacheKey .= $scopes;
56
+ } else if (is_array($scopes)) {
57
+ $cacheKey .= implode(":", $scopes);
58
+ }
59
+
60
+ $this->token = $this->client->getCache()->get($cacheKey);
61
+ if (!$this->token) {
62
+ $this->retrieveToken($scopes, $cacheKey);
63
+ } else if ($this->token['expiration_time'] < time()) {
64
+ $this->client->getCache()->delete($cacheKey);
65
+ $this->retrieveToken($scopes, $cacheKey);
66
+ }
67
+
68
+ $this->tokenScopes = $scopes;
69
+ return $this->token;
70
+ }
71
+
72
+ /**
73
+ * Retrieve a new access token and store it in cache
74
+ * @param mixed $scopes
75
+ * @param string $cacheKey
76
+ */
77
+ private function retrieveToken($scopes, $cacheKey)
78
+ {
79
+ $this->token = AppIdentityService::getAccessToken($scopes);
80
+ if ($this->token) {
81
+ $this->client->getCache()->set(
82
+ $cacheKey,
83
+ $this->token
84
+ );
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Perform an authenticated / signed apiHttpRequest.
90
+ * This function takes the apiHttpRequest, calls apiAuth->sign on it
91
+ * (which can modify the request in what ever way fits the auth mechanism)
92
+ * and then calls apiCurlIO::makeRequest on the signed request
93
+ *
94
+ * @param Deconf_Http_Request $request
95
+ * @return Deconf_Http_Request The resulting HTTP response including the
96
+ * responseHttpCode, responseHeaders and responseBody.
97
+ */
98
+ public function authenticatedRequest(Deconf_Http_Request $request)
99
+ {
100
+ $request = $this->sign($request);
101
+ return $this->client->getIo()->makeRequest($request);
102
+ }
103
+
104
+ public function sign(Deconf_Http_Request $request)
105
+ {
106
+ if (!$this->token) {
107
+ // No token, so nothing to do.
108
+ return $request;
109
+ }
110
+
111
+ $this->client->getLogger()->debug('App Identity authentication');
112
+
113
+ // Add the OAuth2 header to the request
114
+ $request->setRequestHeaders(
115
+ array('Authorization' => 'Bearer ' . $this->token['access_token'])
116
+ );
117
+
118
+ return $request;
119
+ }
120
+ }
tags/5.3.1/tools/src/Deconf/Auth/AssertionCredentials.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2012 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Credentials object used for OAuth 2.0 Signed JWT assertion grants.
24
+ */
25
+ class Deconf_Auth_AssertionCredentials
26
+ {
27
+ const MAX_TOKEN_LIFETIME_SECS = 3600;
28
+
29
+ public $serviceAccountName;
30
+ public $scopes;
31
+ public $privateKey;
32
+ public $privateKeyPassword;
33
+ public $assertionType;
34
+ public $sub;
35
+ /**
36
+ * @deprecated
37
+ * @link http://tools.ietf.org/html/draft-ietf-oauth-json-web-token-06
38
+ */
39
+ public $prn;
40
+ private $useCache;
41
+
42
+ /**
43
+ * @param $serviceAccountName
44
+ * @param $scopes array List of scopes
45
+ * @param $privateKey
46
+ * @param string $privateKeyPassword
47
+ * @param string $assertionType
48
+ * @param bool|string $sub The email address of the user for which the
49
+ * application is requesting delegated access.
50
+ * @param bool useCache Whether to generate a cache key and allow
51
+ * automatic caching of the generated token.
52
+ */
53
+ public function __construct(
54
+ $serviceAccountName,
55
+ $scopes,
56
+ $privateKey,
57
+ $privateKeyPassword = 'notasecret',
58
+ $assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer',
59
+ $sub = false,
60
+ $useCache = true
61
+ ) {
62
+ $this->serviceAccountName = $serviceAccountName;
63
+ $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes);
64
+ $this->privateKey = $privateKey;
65
+ $this->privateKeyPassword = $privateKeyPassword;
66
+ $this->assertionType = $assertionType;
67
+ $this->sub = $sub;
68
+ $this->prn = $sub;
69
+ $this->useCache = $useCache;
70
+ }
71
+
72
+ /**
73
+ * Generate a unique key to represent this credential.
74
+ * @return string
75
+ */
76
+ public function getCacheKey()
77
+ {
78
+ if (!$this->useCache) {
79
+ return false;
80
+ }
81
+ $h = $this->sub;
82
+ $h .= $this->assertionType;
83
+ $h .= $this->privateKey;
84
+ $h .= $this->scopes;
85
+ $h .= $this->serviceAccountName;
86
+ return md5($h);
87
+ }
88
+
89
+ public function generateAssertion()
90
+ {
91
+ $now = time();
92
+
93
+ $jwtParams = array(
94
+ 'aud' => Deconf_Auth_OAuth2::OAUTH2_TOKEN_URI,
95
+ 'scope' => $this->scopes,
96
+ 'iat' => $now,
97
+ 'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS,
98
+ 'iss' => $this->serviceAccountName,
99
+ );
100
+
101
+ if ($this->sub !== false) {
102
+ $jwtParams['sub'] = $this->sub;
103
+ } else if ($this->prn !== false) {
104
+ $jwtParams['prn'] = $this->prn;
105
+ }
106
+
107
+ return $this->makeSignedJwt($jwtParams);
108
+ }
109
+
110
+ /**
111
+ * Creates a signed JWT.
112
+ * @param array $payload
113
+ * @return string The signed JWT.
114
+ */
115
+ private function makeSignedJwt($payload)
116
+ {
117
+ $header = array('typ' => 'JWT', 'alg' => 'RS256');
118
+
119
+ $payload = json_encode($payload);
120
+ // Handle some overzealous escaping in PHP json that seemed to cause some errors
121
+ // with claimsets.
122
+ $payload = str_replace('\/', '/', $payload);
123
+
124
+ $segments = array(
125
+ Deconf_Utils::urlSafeB64Encode(json_encode($header)),
126
+ Deconf_Utils::urlSafeB64Encode($payload)
127
+ );
128
+
129
+ $signingInput = implode('.', $segments);
130
+ $signer = new Deconf_Signer_P12($this->privateKey, $this->privateKeyPassword);
131
+ $signature = $signer->sign($signingInput);
132
+ $segments[] = Deconf_Utils::urlSafeB64Encode($signature);
133
+
134
+ return implode(".", $segments);
135
+ }
136
+ }
tags/5.3.1/tools/src/Deconf/Auth/ComputeEngine.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Authentication via built-in Compute Engine service accounts.
24
+ * The instance must be pre-configured with a service account
25
+ * and the appropriate scopes.
26
+ * @author Jonathan Parrott <jon.wayne.parrott@gmail.com>
27
+ */
28
+ class Deconf_Auth_ComputeEngine extends Deconf_Auth_Abstract
29
+ {
30
+ const METADATA_AUTH_URL =
31
+ 'http://metadata/computeMetadata/v1/instance/service-accounts/default/token';
32
+ private $client;
33
+ private $token;
34
+
35
+ public function __construct(Deconf_Client $client, $config = null)
36
+ {
37
+ $this->client = $client;
38
+ }
39
+
40
+ /**
41
+ * Perform an authenticated / signed apiHttpRequest.
42
+ * This function takes the apiHttpRequest, calls apiAuth->sign on it
43
+ * (which can modify the request in what ever way fits the auth mechanism)
44
+ * and then calls apiCurlIO::makeRequest on the signed request
45
+ *
46
+ * @param Deconf_Http_Request $request
47
+ * @return Deconf_Http_Request The resulting HTTP response including the
48
+ * responseHttpCode, responseHeaders and responseBody.
49
+ */
50
+ public function authenticatedRequest(Deconf_Http_Request $request)
51
+ {
52
+ $request = $this->sign($request);
53
+ return $this->client->getIo()->makeRequest($request);
54
+ }
55
+
56
+ /**
57
+ * @param string $token
58
+ * @throws Deconf_Auth_Exception
59
+ */
60
+ public function setAccessToken($token)
61
+ {
62
+ $token = json_decode($token, true);
63
+ if ($token == null) {
64
+ throw new Deconf_Auth_Exception('Could not json decode the token');
65
+ }
66
+ if (! isset($token['access_token'])) {
67
+ throw new Deconf_Auth_Exception("Invalid token format");
68
+ }
69
+ $token['created'] = time();
70
+ $this->token = $token;
71
+ }
72
+
73
+ public function getAccessToken()
74
+ {
75
+ return json_encode($this->token);
76
+ }
77
+
78
+ /**
79
+ * Acquires a new access token from the compute engine metadata server.
80
+ * @throws Deconf_Auth_Exception
81
+ */
82
+ public function acquireAccessToken()
83
+ {
84
+ $request = new Deconf_Http_Request(
85
+ self::METADATA_AUTH_URL,
86
+ 'GET',
87
+ array(
88
+ 'Metadata-Flavor' => 'Deconf'
89
+ )
90
+ );
91
+ $request->disableGzip();
92
+ $response = $this->client->getIo()->makeRequest($request);
93
+
94
+ if ($response->getResponseHttpCode() == 200) {
95
+ $this->setAccessToken($response->getResponseBody());
96
+ $this->token['created'] = time();
97
+ return $this->getAccessToken();
98
+ } else {
99
+ throw new Deconf_Auth_Exception(
100
+ sprintf(
101
+ "Error fetching service account access token, message: '%s'",
102
+ $response->getResponseBody()
103
+ ),
104
+ $response->getResponseHttpCode()
105
+ );
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Include an accessToken in a given apiHttpRequest.
111
+ * @param Deconf_Http_Request $request
112
+ * @return Deconf_Http_Request
113
+ * @throws Deconf_Auth_Exception
114
+ */
115
+ public function sign(Deconf_Http_Request $request)
116
+ {
117
+ if ($this->isAccessTokenExpired()) {
118
+ $this->acquireAccessToken();
119
+ }
120
+
121
+ $this->client->getLogger()->debug('Compute engine service account authentication');
122
+
123
+ $request->setRequestHeaders(
124
+ array('Authorization' => 'Bearer ' . $this->token['access_token'])
125
+ );
126
+
127
+ return $request;
128
+ }
129
+
130
+ /**
131
+ * Returns if the access_token is expired.
132
+ * @return bool Returns True if the access_token is expired.
133
+ */
134
+ public function isAccessTokenExpired()
135
+ {
136
+ if (!$this->token || !isset($this->token['created'])) {
137
+ return true;
138
+ }
139
+
140
+ // If the token is set to expire in the next 30 seconds.
141
+ $expired = ($this->token['created']
142
+ + ($this->token['expires_in'] - 30)) < time();
143
+
144
+ return $expired;
145
+ }
146
+ }
tags/5.3.1/tools/src/Deconf/Auth/Exception.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ class Deconf_Auth_Exception extends Deconf_Exception
23
+ {
24
+ }
tags/5.3.1/tools/src/Deconf/Auth/LoginTicket.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2011 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Class to hold information about an authenticated login.
24
+ *
25
+ * @author Brian Eaton <beaton@google.com>
26
+ */
27
+ class Deconf_Auth_LoginTicket
28
+ {
29
+ const USER_ATTR = "sub";
30
+
31
+ // Information from id token envelope.
32
+ private $envelope;
33
+
34
+ // Information from id token payload.
35
+ private $payload;
36
+
37
+ /**
38
+ * Creates a user based on the supplied token.
39
+ *
40
+ * @param string $envelope Header from a verified authentication token.
41
+ * @param string $payload Information from a verified authentication token.
42
+ */
43
+ public function __construct($envelope, $payload)
44
+ {
45
+ $this->envelope = $envelope;
46
+ $this->payload = $payload;
47
+ }
48
+
49
+ /**
50
+ * Returns the numeric identifier for the user.
51
+ * @throws Deconf_Auth_Exception
52
+ * @return
53
+ */
54
+ public function getUserId()
55
+ {
56
+ if (array_key_exists(self::USER_ATTR, $this->payload)) {
57
+ return $this->payload[self::USER_ATTR];
58
+ }
59
+ throw new Deconf_Auth_Exception("No user_id in token");
60
+ }
61
+
62
+ /**
63
+ * Returns attributes from the login ticket. This can contain
64
+ * various information about the user session.
65
+ * @return array
66
+ */
67
+ public function getAttributes()
68
+ {
69
+ return array("envelope" => $this->envelope, "payload" => $this->payload);
70
+ }
71
+ }
tags/5.3.1/tools/src/Deconf/Auth/OAuth2.php ADDED
@@ -0,0 +1,646 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2008 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Authentication class that deals with the OAuth 2 web-server authentication flow
24
+ *
25
+ */
26
+ class Deconf_Auth_OAuth2 extends Deconf_Auth_Abstract
27
+ {
28
+ const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
29
+ const OAUTH2_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token';
30
+ const OAUTH2_AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
31
+ const CLOCK_SKEW_SECS = 300; // five minutes in seconds
32
+ const AUTH_TOKEN_LIFETIME_SECS = 300; // five minutes in seconds
33
+ const MAX_TOKEN_LIFETIME_SECS = 86400; // one day in seconds
34
+ const OAUTH2_ISSUER = 'accounts.google.com';
35
+ const OAUTH2_ISSUER_HTTPS = 'https://accounts.google.com';
36
+
37
+ /** @var Deconf_Auth_AssertionCredentials $assertionCredentials */
38
+ private $assertionCredentials;
39
+
40
+ /**
41
+ * @var string The state parameters for CSRF and other forgery protection.
42
+ */
43
+ private $state;
44
+
45
+ /**
46
+ * @var array The token bundle.
47
+ */
48
+ private $token = array();
49
+
50
+ /**
51
+ * @var Deconf_Client the base client
52
+ */
53
+ private $client;
54
+
55
+ /**
56
+ * Instantiates the class, but does not initiate the login flow, leaving it
57
+ * to the discretion of the caller.
58
+ */
59
+ public function __construct(Deconf_Client $client)
60
+ {
61
+ $this->client = $client;
62
+ }
63
+
64
+ /**
65
+ * Perform an authenticated / signed apiHttpRequest.
66
+ * This function takes the apiHttpRequest, calls apiAuth->sign on it
67
+ * (which can modify the request in what ever way fits the auth mechanism)
68
+ * and then calls apiCurlIO::makeRequest on the signed request
69
+ *
70
+ * @param Deconf_Http_Request $request
71
+ * @return Deconf_Http_Request The resulting HTTP response including the
72
+ * responseHttpCode, responseHeaders and responseBody.
73
+ */
74
+ public function authenticatedRequest(Deconf_Http_Request $request)
75
+ {
76
+ $request = $this->sign($request);
77
+ return $this->client->getIo()->makeRequest($request);
78
+ }
79
+
80
+ /**
81
+ * @param string $code
82
+ * @param boolean $crossClient
83
+ * @throws Deconf_Auth_Exception
84
+ * @return string
85
+ */
86
+ public function authenticate($code, $crossClient = false)
87
+ {
88
+ if (strlen($code) == 0) {
89
+ throw new Deconf_Auth_Exception("Invalid code");
90
+ }
91
+
92
+ $arguments = array(
93
+ 'code' => $code,
94
+ 'grant_type' => 'authorization_code',
95
+ 'client_id' => $this->client->getClassConfig($this, 'client_id'),
96
+ 'client_secret' => $this->client->getClassConfig($this, 'client_secret')
97
+ );
98
+
99
+ if ($crossClient !== true) {
100
+ $arguments['redirect_uri'] = $this->client->getClassConfig($this, 'redirect_uri');
101
+ }
102
+
103
+ // We got here from the redirect from a successful authorization grant,
104
+ // fetch the access token
105
+ $request = new Deconf_Http_Request(
106
+ self::OAUTH2_TOKEN_URI,
107
+ 'POST',
108
+ array(),
109
+ $arguments
110
+ );
111
+ $request->disableGzip();
112
+ $response = $this->client->getIo()->makeRequest($request);
113
+
114
+ if ($response->getResponseHttpCode() == 200) {
115
+ $this->setAccessToken($response->getResponseBody());
116
+ $this->token['created'] = time();
117
+ return $this->getAccessToken();
118
+ } else {
119
+ $decodedResponse = json_decode($response->getResponseBody(), true);
120
+ if ($decodedResponse != null && $decodedResponse['error']) {
121
+ $errorText = $decodedResponse['error'];
122
+ if (isset($decodedResponse['error_description'])) {
123
+ $errorText .= ": " . $decodedResponse['error_description'];
124
+ }
125
+ }
126
+ throw new Deconf_Auth_Exception(
127
+ sprintf(
128
+ "Error fetching OAuth2 access token, message: '%s'",
129
+ $errorText
130
+ ),
131
+ $response->getResponseHttpCode()
132
+ );
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Create a URL to obtain user authorization.
138
+ * The authorization endpoint allows the user to first
139
+ * authenticate, and then grant/deny the access request.
140
+ * @param string $scope The scope is expressed as a list of space-delimited strings.
141
+ * @return string
142
+ */
143
+ public function createAuthUrl($scope)
144
+ {
145
+ $params = array(
146
+ 'response_type' => 'code',
147
+ 'redirect_uri' => $this->client->getClassConfig($this, 'redirect_uri'),
148
+ 'client_id' => $this->client->getClassConfig($this, 'client_id'),
149
+ 'scope' => $scope,
150
+ 'access_type' => $this->client->getClassConfig($this, 'access_type'),
151
+ );
152
+
153
+ // Prefer prompt to approval prompt.
154
+ if ($this->client->getClassConfig($this, 'prompt')) {
155
+ $params = $this->maybeAddParam($params, 'prompt');
156
+ } else {
157
+ $params = $this->maybeAddParam($params, 'approval_prompt');
158
+ }
159
+ $params = $this->maybeAddParam($params, 'login_hint');
160
+ $params = $this->maybeAddParam($params, 'hd');
161
+ $params = $this->maybeAddParam($params, 'openid.realm');
162
+ $params = $this->maybeAddParam($params, 'include_granted_scopes');
163
+
164
+ // If the list of scopes contains plus.login, add request_visible_actions
165
+ // to auth URL.
166
+ $rva = $this->client->getClassConfig($this, 'request_visible_actions');
167
+ if (strpos($scope, 'plus.login') && strlen($rva) > 0) {
168
+ $params['request_visible_actions'] = $rva;
169
+ }
170
+
171
+ if (isset($this->state)) {
172
+ $params['state'] = $this->state;
173
+ }
174
+
175
+ return self::OAUTH2_AUTH_URL . "?" . http_build_query($params, '', '&');
176
+ }
177
+
178
+ /**
179
+ * @param string $token
180
+ * @throws Deconf_Auth_Exception
181
+ */
182
+ public function setAccessToken($token)
183
+ {
184
+ $token = json_decode($token, true);
185
+ if ($token == null) {
186
+ throw new Deconf_Auth_Exception('Could not json decode the token');
187
+ }
188
+ if (! isset($token['access_token'])) {
189
+ throw new Deconf_Auth_Exception("Invalid token format");
190
+ }
191
+ $this->token = $token;
192
+ }
193
+
194
+ public function getAccessToken()
195
+ {
196
+ return json_encode($this->token);
197
+ }
198
+
199
+ public function getRefreshToken()
200
+ {
201
+ if (array_key_exists('refresh_token', $this->token)) {
202
+ return $this->token['refresh_token'];
203
+ } else {
204
+ return null;
205
+ }
206
+ }
207
+
208
+ public function setState($state)
209
+ {
210
+ $this->state = $state;
211
+ }
212
+
213
+ public function setAssertionCredentials(Deconf_Auth_AssertionCredentials $creds)
214
+ {
215
+ $this->assertionCredentials = $creds;
216
+ }
217
+
218
+ /**
219
+ * Include an accessToken in a given apiHttpRequest.
220
+ * @param Deconf_Http_Request $request
221
+ * @return Deconf_Http_Request
222
+ * @throws Deconf_Auth_Exception
223
+ */
224
+ public function sign(Deconf_Http_Request $request)
225
+ {
226
+ // add the developer key to the request before signing it
227
+ if ($this->client->getClassConfig($this, 'developer_key')) {
228
+ $request->setQueryParam('key', $this->client->getClassConfig($this, 'developer_key'));
229
+ }
230
+
231
+ // Cannot sign the request without an OAuth access token.
232
+ if (null == $this->token && null == $this->assertionCredentials) {
233
+ return $request;
234
+ }
235
+
236
+ // Check if the token is set to expire in the next 30 seconds
237
+ // (or has already expired).
238
+ if ($this->isAccessTokenExpired()) {
239
+ if ($this->assertionCredentials) {
240
+ $this->refreshTokenWithAssertion();
241
+ } else {
242
+ $this->client->getLogger()->debug('OAuth2 access token expired');
243
+ if (! array_key_exists('refresh_token', $this->token)) {
244
+ $error = "The OAuth 2.0 access token has expired,"
245
+ ." and a refresh token is not available. Refresh tokens"
246
+ ." are not returned for responses that were auto-approved.";
247
+
248
+ $this->client->getLogger()->error($error);
249
+ throw new Deconf_Auth_Exception($error);
250
+ }
251
+ $this->refreshToken($this->token['refresh_token']);
252
+ }
253
+ }
254
+
255
+ $this->client->getLogger()->debug('OAuth2 authentication');
256
+
257
+ // Add the OAuth2 header to the request
258
+ $request->setRequestHeaders(
259
+ array('Authorization' => 'Bearer ' . $this->token['access_token'])
260
+ );
261
+
262
+ return $request;
263
+ }
264
+
265
+ /**
266
+ * Fetches a fresh access token with the given refresh token.
267
+ * @param string $refreshToken
268
+ * @return void
269
+ */
270
+ public function refreshToken($refreshToken)
271
+ {
272
+ $this->refreshTokenRequest(
273
+ array(
274
+ 'client_id' => $this->client->getClassConfig($this, 'client_id'),
275
+ 'client_secret' => $this->client->getClassConfig($this, 'client_secret'),
276
+ 'refresh_token' => $refreshToken,
277
+ 'grant_type' => 'refresh_token'
278
+ )
279
+ );
280
+ }
281
+
282
+ /**
283
+ * Fetches a fresh access token with a given assertion token.
284
+ * @param Deconf_Auth_AssertionCredentials $assertionCredentials optional.
285
+ * @return void
286
+ */
287
+ public function refreshTokenWithAssertion($assertionCredentials = null)
288
+ {
289
+ if (!$assertionCredentials) {
290
+ $assertionCredentials = $this->assertionCredentials;
291
+ }
292
+
293
+ $cacheKey = $assertionCredentials->getCacheKey();
294
+
295
+ if ($cacheKey) {
296
+ // We can check whether we have a token available in the
297
+ // cache. If it is expired, we can retrieve a new one from
298
+ // the assertion.
299
+ $token = $this->client->getCache()->get($cacheKey);
300
+ if ($token) {
301
+ $this->setAccessToken($token);
302
+ }
303
+ if (!$this->isAccessTokenExpired()) {
304
+ return;
305
+ }
306
+ }
307
+
308
+ $this->client->getLogger()->debug('OAuth2 access token expired');
309
+ $this->refreshTokenRequest(
310
+ array(
311
+ 'grant_type' => 'assertion',
312
+ 'assertion_type' => $assertionCredentials->assertionType,
313
+ 'assertion' => $assertionCredentials->generateAssertion(),
314
+ )
315
+ );
316
+
317
+ if ($cacheKey) {
318
+ // Attempt to cache the token.
319
+ $this->client->getCache()->set(
320
+ $cacheKey,
321
+ $this->getAccessToken()
322
+ );
323
+ }
324
+ }
325
+
326
+ private function refreshTokenRequest($params)
327
+ {
328
+ if (isset($params['assertion'])) {
329
+ $this->client->getLogger()->info(
330
+ 'OAuth2 access token refresh with Signed JWT assertion grants.'
331
+ );
332
+ } else {
333
+ $this->client->getLogger()->info('OAuth2 access token refresh');
334
+ }
335
+
336
+ $http = new Deconf_Http_Request(
337
+ self::OAUTH2_TOKEN_URI,
338
+ 'POST',
339
+ array(),
340
+ $params
341
+ );
342
+ $http->disableGzip();
343
+ $request = $this->client->getIo()->makeRequest($http);
344
+
345
+ $code = $request->getResponseHttpCode();
346
+ $body = $request->getResponseBody();
347
+ if (200 == $code) {
348
+ $token = json_decode($body, true);
349
+ if ($token == null) {
350
+ throw new Deconf_Auth_Exception("Could not json decode the access token");
351
+ }
352
+
353
+ if (! isset($token['access_token']) || ! isset($token['expires_in'])) {
354
+ throw new Deconf_Auth_Exception("Invalid token format");
355
+ }
356
+
357
+ if (isset($token['id_token'])) {
358
+ $this->token['id_token'] = $token['id_token'];
359
+ }
360
+ $this->token['access_token'] = $token['access_token'];
361
+ $this->token['expires_in'] = $token['expires_in'];
362
+ $this->token['created'] = time();
363
+ } else {
364
+ throw new Deconf_Auth_Exception("Error refreshing the OAuth2 token, message: '$body'", $code);
365
+ }
366
+ }
367
+
368
+ /**
369
+ * Revoke an OAuth2 access token or refresh token. This method will revoke the current access
370
+ * token, if a token isn't provided.
371
+ * @throws Deconf_Auth_Exception
372
+ * @param string|null $token The token (access token or a refresh token) that should be revoked.
373
+ * @return boolean Returns True if the revocation was successful, otherwise False.
374
+ */
375
+ public function revokeToken($token = null)
376
+ {
377
+ if (!$token) {
378
+ if (!$this->token) {
379
+ // Not initialized, no token to actually revoke
380
+ return false;
381
+ } elseif (array_key_exists('refresh_token', $this->token)) {
382
+ $token = $this->token['refresh_token'];
383
+ } else {
384
+ $token = $this->token['access_token'];
385
+ }
386
+ }
387
+ $request = new Deconf_Http_Request(
388
+ self::OAUTH2_REVOKE_URI,
389
+ 'POST',
390
+ array(),
391
+ "token=$token"
392
+ );
393
+ $request->disableGzip();
394
+ $response = $this->client->getIo()->makeRequest($request);
395
+ $code = $response->getResponseHttpCode();
396
+ if ($code == 200) {
397
+ $this->token = null;
398
+ return true;
399
+ }
400
+
401
+ return false;
402
+ }
403
+
404
+ /**
405
+ * Returns if the access_token is expired.
406
+ * @return bool Returns True if the access_token is expired.
407
+ */
408
+ public function isAccessTokenExpired()
409
+ {
410
+ if (!$this->token || !isset($this->token['created'])) {
411
+ return true;
412
+ }
413
+
414
+ // If the token is set to expire in the next 30 seconds.
415
+ $expired = ($this->token['created']
416
+ + ($this->token['expires_in'] - 30)) < time();
417
+
418
+ return $expired;
419
+ }
420
+
421
+ // Gets federated sign-on certificates to use for verifying identity tokens.
422
+ // Returns certs as array structure, where keys are key ids, and values
423
+ // are PEM encoded certificates.
424
+ private function getFederatedSignOnCerts()
425
+ {
426
+ return $this->retrieveCertsFromLocation(
427
+ $this->client->getClassConfig($this, 'federated_signon_certs_url')
428
+ );
429
+ }
430
+
431
+ /**
432
+ * Retrieve and cache a certificates file.
433
+ *
434
+ * @param $url string location
435
+ * @throws Deconf_Auth_Exception
436
+ * @return array certificates
437
+ */
438
+ public function retrieveCertsFromLocation($url)
439
+ {
440
+ // If we're retrieving a local file, just grab it.
441
+ if ("http" != substr($url, 0, 4)) {
442
+ $file = file_get_contents($url);
443
+ if ($file) {
444
+ return json_decode($file, true);
445
+ } else {
446
+ throw new Deconf_Auth_Exception(
447
+ "Failed to retrieve verification certificates: '" .
448
+ $url . "'."
449
+ );
450
+ }
451
+ }
452
+
453
+ // This relies on makeRequest caching certificate responses.
454
+ $request = $this->client->getIo()->makeRequest(
455
+ new Deconf_Http_Request(
456
+ $url
457
+ )
458
+ );
459
+ if ($request->getResponseHttpCode() == 200) {
460
+ $certs = json_decode($request->getResponseBody(), true);
461
+ if ($certs) {
462
+ return $certs;
463
+ }
464
+ }
465
+ throw new Deconf_Auth_Exception(
466
+ "Failed to retrieve verification certificates: '" .
467
+ $request->getResponseBody() . "'.",
468
+ $request->getResponseHttpCode()
469
+ );
470
+ }
471
+
472
+ /**
473
+ * Verifies an id token and returns the authenticated apiLoginTicket.
474
+ * Throws an exception if the id token is not valid.
475
+ * The audience parameter can be used to control which id tokens are
476
+ * accepted. By default, the id token must have been issued to this OAuth2 client.
477
+ *
478
+ * @param $id_token
479
+ * @param $audience
480
+ * @return Deconf_Auth_LoginTicket
481
+ */
482
+ public function verifyIdToken($id_token = null, $audience = null)
483
+ {
484
+ if (!$id_token) {
485
+ $id_token = $this->token['id_token'];
486
+ }
487
+ $certs = $this->getFederatedSignonCerts();
488
+ if (!$audience) {
489
+ $audience = $this->client->getClassConfig($this, 'client_id');
490
+ }
491
+
492
+ return $this->verifySignedJwtWithCerts(
493
+ $id_token,
494
+ $certs,
495
+ $audience,
496
+ array(self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS)
497
+ );
498
+ }
499
+
500
+ /**
501
+ * Verifies the id token, returns the verified token contents.
502
+ *
503
+ * @param $jwt string the token
504
+ * @param $certs array of certificates
505
+ * @param $required_audience string the expected consumer of the token
506
+ * @param [$issuer] the expected issues, defaults to Google
507
+ * @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS
508
+ * @throws Deconf_Auth_Exception
509
+ * @return mixed token information if valid, false if not
510
+ */
511
+ public function verifySignedJwtWithCerts(
512
+ $jwt,
513
+ $certs,
514
+ $required_audience,
515
+ $issuer = null,
516
+ $max_expiry = null
517
+ ) {
518
+ if (!$max_expiry) {
519
+ // Set the maximum time we will accept a token for.
520
+ $max_expiry = self::MAX_TOKEN_LIFETIME_SECS;
521
+ }
522
+
523
+ $segments = explode(".", $jwt);
524
+ if (count($segments) != 3) {
525
+ throw new Deconf_Auth_Exception("Wrong number of segments in token: $jwt");
526
+ }
527
+ $signed = $segments[0] . "." . $segments[1];
528
+ $signature = Deconf_Utils::urlSafeB64Decode($segments[2]);
529
+
530
+ // Parse envelope.
531
+ $envelope = json_decode(Deconf_Utils::urlSafeB64Decode($segments[0]), true);
532
+ if (!$envelope) {
533
+ throw new Deconf_Auth_Exception("Can't parse token envelope: " . $segments[0]);
534
+ }
535
+
536
+ // Parse token
537
+ $json_body = Deconf_Utils::urlSafeB64Decode($segments[1]);
538
+ $payload = json_decode($json_body, true);
539
+ if (!$payload) {
540
+ throw new Deconf_Auth_Exception("Can't parse token payload: " . $segments[1]);
541
+ }
542
+
543
+ // Check signature
544
+ $verified = false;
545
+ foreach ($certs as $keyName => $pem) {
546
+ $public_key = new Deconf_Verifier_Pem($pem);
547
+ if ($public_key->verify($signed, $signature)) {
548
+ $verified = true;
549
+ break;
550
+ }
551
+ }
552
+
553
+ if (!$verified) {
554
+ throw new Deconf_Auth_Exception("Invalid token signature: $jwt");
555
+ }
556
+
557
+ // Check issued-at timestamp
558
+ $iat = 0;
559
+ if (array_key_exists("iat", $payload)) {
560
+ $iat = $payload["iat"];
561
+ }
562
+ if (!$iat) {
563
+ throw new Deconf_Auth_Exception("No issue time in token: $json_body");
564
+ }
565
+ $earliest = $iat - self::CLOCK_SKEW_SECS;
566
+
567
+ // Check expiration timestamp
568
+ $now = time();
569
+ $exp = 0;
570
+ if (array_key_exists("exp", $payload)) {
571
+ $exp = $payload["exp"];
572
+ }
573
+ if (!$exp) {
574
+ throw new Deconf_Auth_Exception("No expiration time in token: $json_body");
575
+ }
576
+ if ($exp >= $now + $max_expiry) {
577
+ throw new Deconf_Auth_Exception(
578
+ sprintf("Expiration time too far in future: %s", $json_body)
579
+ );
580
+ }
581
+
582
+ $latest = $exp + self::CLOCK_SKEW_SECS;
583
+ if ($now < $earliest) {
584
+ throw new Deconf_Auth_Exception(
585
+ sprintf(
586
+ "Token used too early, %s < %s: %s",
587
+ $now,
588
+ $earliest,
589
+ $json_body
590
+ )
591
+ );
592
+ }
593
+ if ($now > $latest) {
594
+ throw new Deconf_Auth_Exception(
595
+ sprintf(
596
+ "Token used too late, %s > %s: %s",
597
+ $now,
598
+ $latest,
599
+ $json_body
600
+ )
601
+ );
602
+ }
603
+
604
+ // support HTTP and HTTPS issuers
605
+ // @see https://developers.google.com/identity/sign-in/web/backend-auth
606
+ $iss = $payload['iss'];
607
+ if ($issuer && !in_array($iss, (array) $issuer)) {
608
+ throw new Deconf_Auth_Exception(
609
+ sprintf(
610
+ "Invalid issuer, %s not in %s: %s",
611
+ $iss,
612
+ "[".implode(",", (array) $issuer)."]",
613
+ $json_body
614
+ )
615
+ );
616
+ }
617
+
618
+ // Check audience
619
+ $aud = $payload["aud"];
620
+ if ($aud != $required_audience) {
621
+ throw new Deconf_Auth_Exception(
622
+ sprintf(
623
+ "Wrong recipient, %s != %s:",
624
+ $aud,
625
+ $required_audience,
626
+ $json_body
627
+ )
628
+ );
629
+ }
630
+
631
+ // All good.
632
+ return new Deconf_Auth_LoginTicket($envelope, $payload);
633
+ }
634
+
635
+ /**
636
+ * Add a parameter to the auth params if not empty string.
637
+ */
638
+ private function maybeAddParam($params, $name)
639
+ {
640
+ $param = $this->client->getClassConfig($this, $name);
641
+ if ($param != '') {
642
+ $params[$name] = $param;
643
+ }
644
+ return $params;
645
+ }
646
+ }
tags/5.3.1/tools/src/Deconf/Auth/Simple.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2010 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Simple API access implementation. Can either be used to make requests
24
+ * completely unauthenticated, or by using a Simple API Access developer
25
+ * key.
26
+ */
27
+ class Deconf_Auth_Simple extends Deconf_Auth_Abstract
28
+ {
29
+ private $client;
30
+
31
+ public function __construct(Deconf_Client $client, $config = null)
32
+ {
33
+ $this->client = $client;
34
+ }
35
+
36
+ /**
37
+ * Perform an authenticated / signed apiHttpRequest.
38
+ * This function takes the apiHttpRequest, calls apiAuth->sign on it
39
+ * (which can modify the request in what ever way fits the auth mechanism)
40
+ * and then calls apiCurlIO::makeRequest on the signed request
41
+ *
42
+ * @param Deconf_Http_Request $request
43
+ * @return Deconf_Http_Request The resulting HTTP response including the
44
+ * responseHttpCode, responseHeaders and responseBody.
45
+ */
46
+ public function authenticatedRequest(Deconf_Http_Request $request)
47
+ {
48
+ $request = $this->sign($request);
49
+ return $this->io->makeRequest($request);
50
+ }
51
+
52
+ public function sign(Deconf_Http_Request $request)
53
+ {
54
+ $key = $this->client->getClassConfig($this, 'developer_key');
55
+ if ($key) {
56
+ $this->client->getLogger()->debug(
57
+ 'Simple API Access developer key authentication'
58
+ );
59
+ $request->setQueryParam('key', $key);
60
+ }
61
+ return $request;
62
+ }
63
+ }
tags/5.3.1/tools/src/Deconf/Cache/Abstract.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2008 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Abstract storage class
20
+ *
21
+ * @author Chris Chabot <chabotc@google.com>
22
+ */
23
+ abstract class Deconf_Cache_Abstract
24
+ {
25
+
26
+ abstract public function __construct(Deconf_Client $client);
27
+
28
+ /**
29
+ * Retrieves the data for the given key, or false if they
30
+ * key is unknown or expired
31
+ *
32
+ * @param String $key The key who's data to retrieve
33
+ * @param boolean|int $expiration Expiration time in seconds
34
+ *
35
+ */
36
+ abstract public function get($key, $expiration = false);
37
+
38
+ /**
39
+ * Store the key => $value set. The $value is serialized
40
+ * by this function so can be of any type
41
+ *
42
+ * @param string $key Key of the data
43
+ * @param string $value data
44
+ */
45
+ abstract public function set($key, $value);
46
+
47
+ /**
48
+ * Removes the key/data pair for the given $key
49
+ *
50
+ * @param String $key
51
+ */
52
+ abstract public function delete($key);
53
+ }
tags/5.3.1/tools/src/Deconf/Cache/Apc.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2010 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * A persistent storage class based on the APC cache, which is not
24
+ * really very persistent, as soon as you restart your web server
25
+ * the storage will be wiped, however for debugging and/or speed
26
+ * it can be useful, and cache is a lot cheaper then storage.
27
+ *
28
+ * @author Chris Chabot <chabotc@google.com>
29
+ */
30
+ class Deconf_Cache_Apc extends Deconf_Cache_Abstract
31
+ {
32
+ /**
33
+ * @var Deconf_Client the current client
34
+ */
35
+ private $client;
36
+
37
+ public function __construct(Deconf_Client $client)
38
+ {
39
+ if (! function_exists('apc_add') ) {
40
+ $error = "Apc functions not available";
41
+
42
+ $client->getLogger()->error($error);
43
+ throw new Deconf_Cache_Exception($error);
44
+ }
45
+
46
+ $this->client = $client;
47
+ }
48
+
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ public function get($key, $expiration = false)
53
+ {
54
+ $ret = apc_fetch($key);
55
+ if ($ret === false) {
56
+ $this->client->getLogger()->debug(
57
+ 'APC cache miss',
58
+ array('key' => $key)
59
+ );
60
+ return false;
61
+ }
62
+ if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) {
63
+ $this->client->getLogger()->debug(
64
+ 'APC cache miss (expired)',
65
+ array('key' => $key, 'var' => $ret)
66
+ );
67
+ $this->delete($key);
68
+ return false;
69
+ }
70
+
71
+ $this->client->getLogger()->debug(
72
+ 'APC cache hit',
73
+ array('key' => $key, 'var' => $ret)
74
+ );
75
+
76
+ return $ret['data'];
77
+ }
78
+
79
+ /**
80
+ * @inheritDoc
81
+ */
82
+ public function set($key, $value)
83
+ {
84
+ $var = array('time' => time(), 'data' => $value);
85
+ $rc = apc_store($key, $var);
86
+
87
+ if ($rc == false) {
88
+ $this->client->getLogger()->error(
89
+ 'APC cache set failed',
90
+ array('key' => $key, 'var' => $var)
91
+ );
92
+ throw new Deconf_Cache_Exception("Couldn't store data");
93
+ }
94
+
95
+ $this->client->getLogger()->debug(
96
+ 'APC cache set',
97
+ array('key' => $key, 'var' => $var)
98
+ );
99
+ }
100
+
101
+ /**
102
+ * @inheritDoc
103
+ * @param String $key
104
+ */
105
+ public function delete($key)
106
+ {
107
+ $this->client->getLogger()->debug(
108
+ 'APC cache delete',
109
+ array('key' => $key)
110
+ );
111
+ apc_delete($key);
112
+ }
113
+ }
tags/5.3.1/tools/src/Deconf/Cache/Exception.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ class Deconf_Cache_Exception extends Deconf_Exception
23
+ {
24
+ }
tags/5.3.1/tools/src/Deconf/Cache/File.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2008 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /*
23
+ * This class implements a basic on disk storage. While that does
24
+ * work quite well it's not the most elegant and scalable solution.
25
+ * It will also get you into a heap of trouble when you try to run
26
+ * this in a clustered environment.
27
+ *
28
+ * @author Chris Chabot <chabotc@google.com>
29
+ */
30
+ class Deconf_Cache_File extends Deconf_Cache_Abstract
31
+ {
32
+ const MAX_LOCK_RETRIES = 10;
33
+ private $path;
34
+ private $fh;
35
+
36
+ /**
37
+ * @var Deconf_Client the current client
38
+ */
39
+ private $client;
40
+
41
+ public function __construct(Deconf_Client $client)
42
+ {
43
+ $this->client = $client;
44
+ $this->path = $this->client->getClassConfig($this, 'directory');
45
+ }
46
+
47
+ public function get($key, $expiration = false)
48
+ {
49
+ $storageFile = $this->getCacheFile($key);
50
+ $data = false;
51
+
52
+ if (!file_exists($storageFile)) {
53
+ $this->client->getLogger()->debug(
54
+ 'File cache miss',
55
+ array('key' => $key, 'file' => $storageFile)
56
+ );
57
+ return false;
58
+ }
59
+
60
+ if ($expiration) {
61
+ $mtime = filemtime($storageFile);
62
+ if ((time() - $mtime) >= $expiration) {
63
+ $this->client->getLogger()->debug(
64
+ 'File cache miss (expired)',
65
+ array('key' => $key, 'file' => $storageFile)
66
+ );
67
+ $this->delete($key);
68
+ return false;
69
+ }
70
+ }
71
+
72
+ if ($this->acquireReadLock($storageFile)) {
73
+ if (filesize($storageFile) > 0) {
74
+ $data = fread($this->fh, filesize($storageFile));
75
+ $data = unserialize($data);
76
+ } else {
77
+ $this->client->getLogger()->debug(
78
+ 'Cache file was empty',
79
+ array('file' => $storageFile)
80
+ );
81
+ }
82
+ $this->unlock($storageFile);
83
+ }
84
+
85
+ $this->client->getLogger()->debug(
86
+ 'File cache hit',
87
+ array('key' => $key, 'file' => $storageFile, 'var' => $data)
88
+ );
89
+
90
+ return $data;
91
+ }
92
+
93
+ public function set($key, $value)
94
+ {
95
+ $storageFile = $this->getWriteableCacheFile($key);
96
+ if ($this->acquireWriteLock($storageFile)) {
97
+ // We serialize the whole request object, since we don't only want the
98
+ // responseContent but also the postBody used, headers, size, etc.
99
+ $data = serialize($value);
100
+ $result = fwrite($this->fh, $data);
101
+ $this->unlock($storageFile);
102
+
103
+ $this->client->getLogger()->debug(
104
+ 'File cache set',
105
+ array('key' => $key, 'file' => $storageFile, 'var' => $value)
106
+ );
107
+ } else {
108
+ $this->client->getLogger()->notice(
109
+ 'File cache set failed',
110
+ array('key' => $key, 'file' => $storageFile)
111
+ );
112
+ }
113
+ }
114
+
115
+ public function delete($key)
116
+ {
117
+ $file = $this->getCacheFile($key);
118
+ if (file_exists($file) && !unlink($file)) {
119
+ $this->client->getLogger()->error(
120
+ 'File cache delete failed',
121
+ array('key' => $key, 'file' => $file)
122
+ );
123
+ throw new Deconf_Cache_Exception("Cache file could not be deleted");
124
+ }
125
+
126
+ $this->client->getLogger()->debug(
127
+ 'File cache delete',
128
+ array('key' => $key, 'file' => $file)
129
+ );
130
+ }
131
+
132
+ private function getWriteableCacheFile($file)
133
+ {
134
+ return $this->getCacheFile($file, true);
135
+ }
136
+
137
+ private function getCacheFile($file, $forWrite = false)
138
+ {
139
+ return $this->getCacheDir($file, $forWrite) . '/' . md5($file);
140
+ }
141
+
142
+ private function getCacheDir($file, $forWrite)
143
+ {
144
+ // use the first 2 characters of the hash as a directory prefix
145
+ // this should prevent slowdowns due to huge directory listings
146
+ // and thus give some basic amount of scalability
147
+ $storageDir = $this->path . '/' . substr(md5($file), 0, 2);
148
+ if ($forWrite && ! is_dir($storageDir)) {
149
+ if (! mkdir($storageDir, 0700, true)) {
150
+ $this->client->getLogger()->error(
151
+ 'File cache creation failed',
152
+ array('dir' => $storageDir)
153
+ );
154
+ throw new Deconf_Cache_Exception("Could not create storage directory: $storageDir");
155
+ }
156
+ }
157
+ return $storageDir;
158
+ }
159
+
160
+ private function acquireReadLock($storageFile)
161
+ {
162
+ return $this->acquireLock(LOCK_SH, $storageFile);
163
+ }
164
+
165
+ private function acquireWriteLock($storageFile)
166
+ {
167
+ $rc = $this->acquireLock(LOCK_EX, $storageFile);
168
+ if (!$rc) {
169
+ $this->client->getLogger()->notice(
170
+ 'File cache write lock failed',
171
+ array('file' => $storageFile)
172
+ );
173
+ $this->delete($storageFile);
174
+ }
175
+ return $rc;
176
+ }
177
+
178
+ private function acquireLock($type, $storageFile)
179
+ {
180
+ $mode = $type == LOCK_EX ? "w" : "r";
181
+ $this->fh = fopen($storageFile, $mode);
182
+ if (!$this->fh) {
183
+ $this->client->getLogger()->error(
184
+ 'Failed to open file during lock acquisition',
185
+ array('file' => $storageFile)
186
+ );
187
+ return false;
188
+ }
189
+ if ($type == LOCK_EX) {
190
+ chmod($storageFile, 0600);
191
+ }
192
+ $count = 0;
193
+ while (!flock($this->fh, $type | LOCK_NB)) {
194
+ // Sleep for 10ms.
195
+ usleep(10000);
196
+ if (++$count < self::MAX_LOCK_RETRIES) {
197
+ return false;
198
+ }
199
+ }
200
+ return true;
201
+ }
202
+
203
+ public function unlock($storageFile)
204
+ {
205
+ if ($this->fh) {
206
+ flock($this->fh, LOCK_UN);
207
+ }
208
+ }
209
+ }
tags/5.3.1/tools/src/Deconf/Cache/Memcache.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2008 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * A persistent storage class based on the memcache, which is not
24
+ * really very persistent, as soon as you restart your memcache daemon
25
+ * the storage will be wiped.
26
+ *
27
+ * Will use either the memcache or memcached extensions, preferring
28
+ * memcached.
29
+ *
30
+ * @author Chris Chabot <chabotc@google.com>
31
+ */
32
+ class Deconf_Cache_Memcache extends Deconf_Cache_Abstract
33
+ {
34
+ private $connection = false;
35
+ private $mc = false;
36
+ private $host;
37
+ private $port;
38
+
39
+ /**
40
+ * @var Deconf_Client the current client
41
+ */
42
+ private $client;
43
+
44
+ public function __construct(Deconf_Client $client)
45
+ {
46
+ if (!function_exists('memcache_connect') && !class_exists("Memcached")) {
47
+ $error = "Memcache functions not available";
48
+
49
+ $client->getLogger()->error($error);
50
+ throw new Deconf_Cache_Exception($error);
51
+ }
52
+
53
+ $this->client = $client;
54
+
55
+ if ($client->isAppEngine()) {
56
+ // No credentials needed for GAE.
57
+ $this->mc = new Memcached();
58
+ $this->connection = true;
59
+ } else {
60
+ $this->host = $client->getClassConfig($this, 'host');
61
+ $this->port = $client->getClassConfig($this, 'port');
62
+ if (empty($this->host) || (empty($this->port) && (string) $this->port != "0")) {
63
+ $error = "You need to supply a valid memcache host and port";
64
+
65
+ $client->getLogger()->error($error);
66
+ throw new Deconf_Cache_Exception($error);
67
+ }
68
+ }
69
+ }
70
+
71
+ /**
72
+ * @inheritDoc
73
+ */
74
+ public function get($key, $expiration = false)
75
+ {
76
+ $this->connect();
77
+ $ret = false;
78
+ if ($this->mc) {
79
+ $ret = $this->mc->get($key);
80
+ } else {
81
+ $ret = memcache_get($this->connection, $key);
82
+ }
83
+ if ($ret === false) {
84
+ $this->client->getLogger()->debug(
85
+ 'Memcache cache miss',
86
+ array('key' => $key)
87
+ );
88
+ return false;
89
+ }
90
+ if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) {
91
+ $this->client->getLogger()->debug(
92
+ 'Memcache cache miss (expired)',
93
+ array('key' => $key, 'var' => $ret)
94
+ );
95
+ $this->delete($key);
96
+ return false;
97
+ }
98
+
99
+ $this->client->getLogger()->debug(
100
+ 'Memcache cache hit',
101
+ array('key' => $key, 'var' => $ret)
102
+ );
103
+
104
+ return $ret['data'];
105
+ }
106
+
107
+ /**
108
+ * @inheritDoc
109
+ * @param string $key
110
+ * @param string $value
111
+ * @throws Deconf_Cache_Exception
112
+ */
113
+ public function set($key, $value)
114
+ {
115
+ $this->connect();
116
+ // we store it with the cache_time default expiration so objects will at
117
+ // least get cleaned eventually.
118
+ $data = array('time' => time(), 'data' => $value);
119
+ $rc = false;
120
+ if ($this->mc) {
121
+ $rc = $this->mc->set($key, $data);
122
+ } else {
123
+ $rc = memcache_set($this->connection, $key, $data, false);
124
+ }
125
+ if ($rc == false) {
126
+ $this->client->getLogger()->error(
127
+ 'Memcache cache set failed',
128
+ array('key' => $key, 'var' => $data)
129
+ );
130
+
131
+ throw new Deconf_Cache_Exception("Couldn't store data in cache");
132
+ }
133
+
134
+ $this->client->getLogger()->debug(
135
+ 'Memcache cache set',
136
+ array('key' => $key, 'var' => $data)
137
+ );
138
+ }
139
+
140
+ /**
141
+ * @inheritDoc
142
+ * @param String $key
143
+ */
144
+ public function delete($key)
145
+ {
146
+ $this->connect();
147
+ if ($this->mc) {
148
+ $this->mc->delete($key, 0);
149
+ } else {
150
+ memcache_delete($this->connection, $key, 0);
151
+ }
152
+
153
+ $this->client->getLogger()->debug(
154
+ 'Memcache cache delete',
155
+ array('key' => $key)
156
+ );
157
+ }
158
+
159
+ /**
160
+ * Lazy initialiser for memcache connection. Uses pconnect for to take
161
+ * advantage of the persistence pool where possible.
162
+ */
163
+ private function connect()
164
+ {
165
+ if ($this->connection) {
166
+ return;
167
+ }
168
+
169
+ if (class_exists("Memcached")) {
170
+ $this->mc = new Memcached();
171
+ $this->mc->addServer($this->host, $this->port);
172
+ $this->connection = true;
173
+ } else {
174
+ $this->connection = memcache_pconnect($this->host, $this->port);
175
+ }
176
+
177
+ if (! $this->connection) {
178
+ $error = "Couldn't connect to memcache server";
179
+
180
+ $this->client->getLogger()->error($error);
181
+ throw new Deconf_Cache_Exception($error);
182
+ }
183
+ }
184
+ }
tags/5.3.1/tools/src/Deconf/Cache/Null.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * A blank storage class, for cases where caching is not
24
+ * required.
25
+ */
26
+ class Deconf_Cache_Null extends Deconf_Cache_Abstract
27
+ {
28
+ public function __construct(Deconf_Client $client)
29
+ {
30
+
31
+ }
32
+
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ public function get($key, $expiration = false)
37
+ {
38
+ return false;
39
+ }
40
+
41
+ /**
42
+ * @inheritDoc
43
+ */
44
+ public function set($key, $value)
45
+ {
46
+ // Nop.
47
+ }
48
+
49
+ /**
50
+ * @inheritDoc
51
+ * @param String $key
52
+ */
53
+ public function delete($key)
54
+ {
55
+ // Nop.
56
+ }
57
+ }
tags/5.3.1/tools/src/Deconf/Client.php ADDED
@@ -0,0 +1,715 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2010 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/autoload.php';
20
+ }
21
+
22
+ /**
23
+ * The Google API Client
24
+ * https://github.com/google/google-api-php-client
25
+ */
26
+ class Deconf_Client
27
+ {
28
+ const LIBVER = "1.1.5";
29
+ const USER_AGENT_SUFFIX = "google-api-php-client/";
30
+ /**
31
+ * @var Deconf_Auth_Abstract $auth
32
+ */
33
+ private $auth;
34
+
35
+ /**
36
+ * @var Deconf_IO_Abstract $io
37
+ */
38
+ private $io;
39
+
40
+ /**
41
+ * @var Deconf_Cache_Abstract $cache
42
+ */
43
+ private $cache;
44
+
45
+ /**
46
+ * @var Deconf_Config $config
47
+ */
48
+ private $config;
49
+
50
+ /**
51
+ * @var Deconf_Logger_Abstract $logger
52
+ */
53
+ private $logger;
54
+
55
+ /**
56
+ * @var boolean $deferExecution
57
+ */
58
+ private $deferExecution = false;
59
+
60
+ /** @var array $scopes */
61
+ // Scopes requested by the client
62
+ protected $requestedScopes = array();
63
+
64
+ // definitions of services that are discovered.
65
+ protected $services = array();
66
+
67
+ // Used to track authenticated state, can't discover services after doing authenticate()
68
+ private $authenticated = false;
69
+
70
+ /**
71
+ * Construct the Google Client.
72
+ *
73
+ * @param $config Deconf_Config or string for the ini file to load
74
+ */
75
+ public function __construct($config = null)
76
+ {
77
+ if (is_string($config) && strlen($config)) {
78
+ $config = new Deconf_Config($config);
79
+ } else if ( !($config instanceof Deconf_Config)) {
80
+ $config = new Deconf_Config();
81
+
82
+ if ($this->isAppEngine()) {
83
+ // Automatically use Memcache if we're in AppEngine.
84
+ $config->setCacheClass('Deconf_Cache_Memcache');
85
+ }
86
+
87
+ if (version_compare(phpversion(), "5.3.4", "<=") || $this->isAppEngine()) {
88
+ // Automatically disable compress.zlib, as currently unsupported.
89
+ $config->setClassConfig('Deconf_Http_Request', 'disable_gzip', true);
90
+ }
91
+ }
92
+
93
+ if ($config->getIoClass() == Deconf_Config::USE_AUTO_IO_SELECTION) {
94
+ if (function_exists('curl_version') && function_exists('curl_exec')
95
+ && !$this->isAppEngine()) {
96
+ $config->setIoClass("Deconf_IO_Curl");
97
+ } else {
98
+ $config->setIoClass("Deconf_IO_Stream");
99
+ }
100
+ }
101
+
102
+ $this->config = $config;
103
+ }
104
+
105
+ /**
106
+ * Get a string containing the version of the library.
107
+ *
108
+ * @return string
109
+ */
110
+ public function getLibraryVersion()
111
+ {
112
+ return self::LIBVER;
113
+ }
114
+
115
+ /**
116
+ * Attempt to exchange a code for an valid authentication token.
117
+ * If $crossClient is set to true, the request body will not include
118
+ * the request_uri argument
119
+ * Helper wrapped around the OAuth 2.0 implementation.
120
+ *
121
+ * @param $code string code from accounts.google.com
122
+ * @param $crossClient boolean, whether this is a cross-client authentication
123
+ * @return string token
124
+ */
125
+ public function authenticate($code, $crossClient = false)
126
+ {
127
+ $this->authenticated = true;
128
+ return $this->getAuth()->authenticate($code, $crossClient);
129
+ }
130
+
131
+ /**
132
+ * Loads a service account key and parameters from a JSON
133
+ * file from the Google Developer Console. Uses that and the
134
+ * given array of scopes to return an assertion credential for
135
+ * use with refreshTokenWithAssertionCredential.
136
+ *
137
+ * @param string $jsonLocation File location of the project-key.json.
138
+ * @param array $scopes The scopes to assert.
139
+ * @return Deconf_Auth_AssertionCredentials.
140
+ * @
141
+ */
142
+ public function loadServiceAccountJson($jsonLocation, $scopes)
143
+ {
144
+ $data = json_decode(file_get_contents($jsonLocation));
145
+ if (isset($data->type) && $data->type == 'service_account') {
146
+ // Service Account format.
147
+ $cred = new Deconf_Auth_AssertionCredentials(
148
+ $data->client_email,
149
+ $scopes,
150
+ $data->private_key
151
+ );
152
+ return $cred;
153
+ } else {
154
+ throw new Deconf_Exception("Invalid service account JSON file.");
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Set the auth config from the JSON string provided.
160
+ * This structure should match the file downloaded from
161
+ * the "Download JSON" button on in the Google Developer
162
+ * Console.
163
+ * @param string $json the configuration json
164
+ * @throws Deconf_Exception
165
+ */
166
+ public function setAuthConfig($json)
167
+ {
168
+ $data = json_decode($json);
169
+ $key = isset($data->installed) ? 'installed' : 'web';
170
+ if (!isset($data->$key)) {
171
+ throw new Deconf_Exception("Invalid client secret JSON file.");
172
+ }
173
+ $this->setClientId($data->$key->client_id);
174
+ $this->setClientSecret($data->$key->client_secret);
175
+ if (isset($data->$key->redirect_uris)) {
176
+ $this->setRedirectUri($data->$key->redirect_uris[0]);
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Set the auth config from the JSON file in the path
182
+ * provided. This should match the file downloaded from
183
+ * the "Download JSON" button on in the Google Developer
184
+ * Console.
185
+ * @param string $file the file location of the client json
186
+ */
187
+ public function setAuthConfigFile($file)
188
+ {
189
+ $this->setAuthConfig(file_get_contents($file));
190
+ }
191
+
192
+ /**
193
+ * @throws Deconf_Auth_Exception
194
+ * @return array
195
+ * @visible For Testing
196
+ */
197
+ public function prepareScopes()
198
+ {
199
+ if (empty($this->requestedScopes)) {
200
+ throw new Deconf_Auth_Exception("No scopes specified");
201
+ }
202
+ $scopes = implode(' ', $this->requestedScopes);
203
+ return $scopes;
204
+ }
205
+
206
+ /**
207
+ * Set the OAuth 2.0 access token using the string that resulted from calling createAuthUrl()
208
+ * or Deconf_Client#getAccessToken().
209
+ * @param string $accessToken JSON encoded string containing in the following format:
210
+ * {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
211
+ * "expires_in":3600, "id_token":"TOKEN", "created":1320790426}
212
+ */
213
+ public function setAccessToken($accessToken)
214
+ {
215
+ if ($accessToken == 'null') {
216
+ $accessToken = null;
217
+ }
218
+ $this->getAuth()->setAccessToken($accessToken);
219
+ }
220
+
221
+
222
+
223
+ /**
224
+ * Set the authenticator object
225
+ * @param Deconf_Auth_Abstract $auth
226
+ */
227
+ public function setAuth(Deconf_Auth_Abstract $auth)
228
+ {
229
+ $this->config->setAuthClass(get_class($auth));
230
+ $this->auth = $auth;
231
+ }
232
+
233
+ /**
234
+ * Set the IO object
235
+ * @param Deconf_IO_Abstract $io
236
+ */
237
+ public function setIo(Deconf_IO_Abstract $io)
238
+ {
239
+ $this->config->setIoClass(get_class($io));
240
+ $this->io = $io;
241
+ }
242
+
243
+ /**
244
+ * Set the Cache object
245
+ * @param Deconf_Cache_Abstract $cache
246
+ */
247
+ public function setCache(Deconf_Cache_Abstract $cache)
248
+ {
249
+ $this->config->setCacheClass(get_class($cache));
250
+ $this->cache = $cache;
251
+ }
252
+
253
+ /**
254
+ * Set the Logger object
255
+ * @param Deconf_Logger_Abstract $logger
256
+ */
257
+ public function setLogger(Deconf_Logger_Abstract $logger)
258
+ {
259
+ $this->config->setLoggerClass(get_class($logger));
260
+ $this->logger = $logger;
261
+ }
262
+
263
+ /**
264
+ * Construct the OAuth 2.0 authorization request URI.
265
+ * @return string
266
+ */
267
+ public function createAuthUrl()
268
+ {
269
+ $scopes = $this->prepareScopes();
270
+ return $this->getAuth()->createAuthUrl($scopes);
271
+ }
272
+
273
+ /**
274
+ * Get the OAuth 2.0 access token.
275
+ * @return string $accessToken JSON encoded string in the following format:
276
+ * {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
277
+ * "expires_in":3600,"id_token":"TOKEN", "created":1320790426}
278
+ */
279
+ public function getAccessToken()
280
+ {
281
+ $token = $this->getAuth()->getAccessToken();
282
+ // The response is json encoded, so could be the string null.
283
+ // It is arguable whether this check should be here or lower
284
+ // in the library.
285
+ return (null == $token || 'null' == $token || '[]' == $token) ? null : $token;
286
+ }
287
+
288
+ /**
289
+ * Get the OAuth 2.0 refresh token.
290
+ * @return string $refreshToken refresh token or null if not available
291
+ */
292
+ public function getRefreshToken()
293
+ {
294
+ return $this->getAuth()->getRefreshToken();
295
+ }
296
+
297
+ /**
298
+ * Returns if the access_token is expired.
299
+ * @return bool Returns True if the access_token is expired.
300
+ */
301
+ public function isAccessTokenExpired()
302
+ {
303
+ return $this->getAuth()->isAccessTokenExpired();
304
+ }
305
+
306
+ /**
307
+ * Set OAuth 2.0 "state" parameter to achieve per-request customization.
308
+ * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2
309
+ * @param string $state
310
+ */
311
+ public function setState($state)
312
+ {
313
+ $this->getAuth()->setState($state);
314
+ }
315
+
316
+ /**
317
+ * @param string $accessType Possible values for access_type include:
318
+ * {@code "offline"} to request offline access from the user.
319
+ * {@code "online"} to request online access from the user.
320
+ */
321
+ public function setAccessType($accessType)
322
+ {
323
+ $this->config->setAccessType($accessType);
324
+ }
325
+
326
+ /**
327
+ * @param string $approvalPrompt Possible values for approval_prompt include:
328
+ * {@code "force"} to force the approval UI to appear. (This is the default value)
329
+ * {@code "auto"} to request auto-approval when possible.
330
+ */
331
+ public function setApprovalPrompt($approvalPrompt)
332
+ {
333
+ $this->config->setApprovalPrompt($approvalPrompt);
334
+ }
335
+
336
+ /**
337
+ * Set the login hint, email address or sub id.
338
+ * @param string $loginHint
339
+ */
340
+ public function setLoginHint($loginHint)
341
+ {
342
+ $this->config->setLoginHint($loginHint);
343
+ }
344
+
345
+ /**
346
+ * Set the application name, this is included in the User-Agent HTTP header.
347
+ * @param string $applicationName
348
+ */
349
+ public function setApplicationName($applicationName)
350
+ {
351
+ $this->config->setApplicationName($applicationName);
352
+ }
353
+
354
+ /**
355
+ * Set the OAuth 2.0 Client ID.
356
+ * @param string $clientId
357
+ */
358
+ public function setClientId($clientId)
359
+ {
360
+ $this->config->setClientId($clientId);
361
+ }
362
+
363
+ /**
364
+ * Set the OAuth 2.0 Client Secret.
365
+ * @param string $clientSecret
366
+ */
367
+ public function setClientSecret($clientSecret)
368
+ {
369
+ $this->config->setClientSecret($clientSecret);
370
+ }
371
+
372
+ /**
373
+ * Set the OAuth 2.0 Redirect URI.
374
+ * @param string $redirectUri
375
+ */
376
+ public function setRedirectUri($redirectUri)
377
+ {
378
+ $this->config->setRedirectUri($redirectUri);
379
+ }
380
+
381
+ /**
382
+ * If 'plus.login' is included in the list of requested scopes, you can use
383
+ * this method to define types of app activities that your app will write.
384
+ * You can find a list of available types here:
385
+ * @link https://developers.google.com/+/api/moment-types
386
+ *
387
+ * @param array $requestVisibleActions Array of app activity types
388
+ */
389
+ public function setRequestVisibleActions($requestVisibleActions)
390
+ {
391
+ if (is_array($requestVisibleActions)) {
392
+ $requestVisibleActions = join(" ", $requestVisibleActions);
393
+ }
394
+ $this->config->setRequestVisibleActions($requestVisibleActions);
395
+ }
396
+
397
+ /**
398
+ * Set the developer key to use, these are obtained through the API Console.
399
+ * @see http://code.google.com/apis/console-help/#generatingdevkeys
400
+ * @param string $developerKey
401
+ */
402
+ public function setDeveloperKey($developerKey)
403
+ {
404
+ $this->config->setDeveloperKey($developerKey);
405
+ }
406
+
407
+ /**
408
+ * Set the hd (hosted domain) parameter streamlines the login process for
409
+ * Google Apps hosted accounts. By including the domain of the user, you
410
+ * restrict sign-in to accounts at that domain.
411
+ * @param $hd string - the domain to use.
412
+ */
413
+ public function setHostedDomain($hd)
414
+ {
415
+ $this->config->setHostedDomain($hd);
416
+ }
417
+
418
+ /**
419
+ * Set the prompt hint. Valid values are none, consent and select_account.
420
+ * If no value is specified and the user has not previously authorized
421
+ * access, then the user is shown a consent screen.
422
+ * @param $prompt string
423
+ */
424
+ public function setPrompt($prompt)
425
+ {
426
+ $this->config->setPrompt($prompt);
427
+ }
428
+
429
+ /**
430
+ * openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth
431
+ * 2.0. It is used in OpenID 2.0 requests to signify the URL-space for which
432
+ * an authentication request is valid.
433
+ * @param $realm string - the URL-space to use.
434
+ */
435
+ public function setOpenidRealm($realm)
436
+ {
437
+ $this->config->setOpenidRealm($realm);
438
+ }
439
+
440
+ /**
441
+ * If this is provided with the value true, and the authorization request is
442
+ * granted, the authorization will include any previous authorizations
443
+ * granted to this user/application combination for other scopes.
444
+ * @param $include boolean - the URL-space to use.
445
+ */
446
+ public function setIncludeGrantedScopes($include)
447
+ {
448
+ $this->config->setIncludeGrantedScopes($include);
449
+ }
450
+
451
+ /**
452
+ * Fetches a fresh OAuth 2.0 access token with the given refresh token.
453
+ * @param string $refreshToken
454
+ */
455
+ public function refreshToken($refreshToken)
456
+ {
457
+ $this->getAuth()->refreshToken($refreshToken);
458
+ }
459
+
460
+ /**
461
+ * Revoke an OAuth2 access token or refresh token. This method will revoke the current access
462
+ * token, if a token isn't provided.
463
+ * @throws Deconf_Auth_Exception
464
+ * @param string|null $token The token (access token or a refresh token) that should be revoked.
465
+ * @return boolean Returns True if the revocation was successful, otherwise False.
466
+ */
467
+ public function revokeToken($token = null)
468
+ {
469
+ return $this->getAuth()->revokeToken($token);
470
+ }
471
+
472
+ /**
473
+ * Verify an id_token. This method will verify the current id_token, if one
474
+ * isn't provided.
475
+ * @throws Deconf_Auth_Exception
476
+ * @param string|null $token The token (id_token) that should be verified.
477
+ * @return Deconf_Auth_LoginTicket Returns an apiLoginTicket if the verification was
478
+ * successful.
479
+ */
480
+ public function verifyIdToken($token = null)
481
+ {
482
+ return $this->getAuth()->verifyIdToken($token);
483
+ }
484
+
485
+ /**
486
+ * Verify a JWT that was signed with your own certificates.
487
+ *
488
+ * @param $id_token string The JWT token
489
+ * @param $cert_location array of certificates
490
+ * @param $audience string the expected consumer of the token
491
+ * @param $issuer string the expected issuer, defaults to Google
492
+ * @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS
493
+ * @return mixed token information if valid, false if not
494
+ */
495
+ public function verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null)
496
+ {
497
+ $auth = new Deconf_Auth_OAuth2($this);
498
+ $certs = $auth->retrieveCertsFromLocation($cert_location);
499
+ return $auth->verifySignedJwtWithCerts($id_token, $certs, $audience, $issuer, $max_expiry);
500
+ }
501
+
502
+ /**
503
+ * @param $creds Deconf_Auth_AssertionCredentials
504
+ */
505
+ public function setAssertionCredentials(Deconf_Auth_AssertionCredentials $creds)
506
+ {
507
+ $this->getAuth()->setAssertionCredentials($creds);
508
+ }
509
+
510
+ /**
511
+ * Set the scopes to be requested. Must be called before createAuthUrl().
512
+ * Will remove any previously configured scopes.
513
+ * @param array $scopes, ie: array('https://www.googleapis.com/auth/plus.login',
514
+ * 'https://www.googleapis.com/auth/moderator')
515
+ */
516
+ public function setScopes($scopes)
517
+ {
518
+ $this->requestedScopes = array();
519
+ $this->addScope($scopes);
520
+ }
521
+
522
+ /**
523
+ * This functions adds a scope to be requested as part of the OAuth2.0 flow.
524
+ * Will append any scopes not previously requested to the scope parameter.
525
+ * A single string will be treated as a scope to request. An array of strings
526
+ * will each be appended.
527
+ * @param $scope_or_scopes string|array e.g. "profile"
528
+ */
529
+ public function addScope($scope_or_scopes)
530
+ {
531
+ if (is_string($scope_or_scopes) && !in_array($scope_or_scopes, $this->requestedScopes)) {
532
+ $this->requestedScopes[] = $scope_or_scopes;
533
+ } else if (is_array($scope_or_scopes)) {
534
+ foreach ($scope_or_scopes as $scope) {
535
+ $this->addScope($scope);
536
+ }
537
+ }
538
+ }
539
+
540
+ /**
541
+ * Returns the list of scopes requested by the client
542
+ * @return array the list of scopes
543
+ *
544
+ */
545
+ public function getScopes()
546
+ {
547
+ return $this->requestedScopes;
548
+ }
549
+
550
+ /**
551
+ * Declare whether batch calls should be used. This may increase throughput
552
+ * by making multiple requests in one connection.
553
+ *
554
+ * @param boolean $useBatch True if the batch support should
555
+ * be enabled. Defaults to False.
556
+ */
557
+ public function setUseBatch($useBatch)
558
+ {
559
+ // This is actually an alias for setDefer.
560
+ $this->setDefer($useBatch);
561
+ }
562
+
563
+ /**
564
+ * Declare whether making API calls should make the call immediately, or
565
+ * return a request which can be called with ->execute();
566
+ *
567
+ * @param boolean $defer True if calls should not be executed right away.
568
+ */
569
+ public function setDefer($defer)
570
+ {
571
+ $this->deferExecution = $defer;
572
+ }
573
+
574
+ /**
575
+ * Helper method to execute deferred HTTP requests.
576
+ *
577
+ * @param $request Deconf_Http_Request|Deconf_Http_Batch
578
+ * @throws Deconf_Exception
579
+ * @return object of the type of the expected class or array.
580
+ */
581
+ public function execute($request)
582
+ {
583
+ if ($request instanceof Deconf_Http_Request) {
584
+ $request->setUserAgent(
585
+ $this->getApplicationName()
586
+ . " " . self::USER_AGENT_SUFFIX
587
+ . $this->getLibraryVersion()
588
+ );
589
+ if (!$this->getClassConfig("Deconf_Http_Request", "disable_gzip")) {
590
+ $request->enableGzip();
591
+ }
592
+ $request->maybeMoveParametersToBody();
593
+ return Deconf_Http_REST::execute($this, $request);
594
+ } else if ($request instanceof Deconf_Http_Batch) {
595
+ return $request->execute();
596
+ } else {
597
+ throw new Deconf_Exception("Do not know how to execute this type of object.");
598
+ }
599
+ }
600
+
601
+ /**
602
+ * Whether or not to return raw requests
603
+ * @return boolean
604
+ */
605
+ public function shouldDefer()
606
+ {
607
+ return $this->deferExecution;
608
+ }
609
+
610
+ /**
611
+ * @return Deconf_Auth_Abstract Authentication implementation
612
+ */
613
+ public function getAuth()
614
+ {
615
+ if (!isset($this->auth)) {
616
+ $class = $this->config->getAuthClass();
617
+ $this->auth = new $class($this);
618
+ }
619
+ return $this->auth;
620
+ }
621
+
622
+ /**
623
+ * @return Deconf_IO_Abstract IO implementation
624
+ */
625
+ public function getIo()
626
+ {
627
+ if (!isset($this->io)) {
628
+ $class = $this->config->getIoClass();
629
+ $this->io = new $class($this);
630
+ }
631
+ return $this->io;
632
+ }
633
+
634
+ /**
635
+ * @return Deconf_Cache_Abstract Cache implementation
636
+ */
637
+ public function getCache()
638
+ {
639
+ if (!isset($this->cache)) {
640
+ $class = $this->config->getCacheClass();
641
+ $this->cache = new $class($this);
642
+ }
643
+ return $this->cache;
644
+ }
645
+
646
+ /**
647
+ * @return Deconf_Logger_Abstract Logger implementation
648
+ */
649
+ public function getLogger()
650
+ {
651
+ if (!isset($this->logger)) {
652
+ $class = $this->config->getLoggerClass();
653
+ $this->logger = new $class($this);
654
+ }
655
+ return $this->logger;
656
+ }
657
+
658
+ /**
659
+ * Retrieve custom configuration for a specific class.
660
+ * @param $class string|object - class or instance of class to retrieve
661
+ * @param $key string optional - key to retrieve
662
+ * @return array
663
+ */
664
+ public function getClassConfig($class, $key = null)
665
+ {
666
+ if (!is_string($class)) {
667
+ $class = get_class($class);
668
+ }
669
+ return $this->config->getClassConfig($class, $key);
670
+ }
671
+
672
+ /**
673
+ * Set configuration specific to a given class.
674
+ * $config->setClassConfig('Deconf_Cache_File',
675
+ * array('directory' => '/tmp/cache'));
676
+ * @param $class string|object - The class name for the configuration
677
+ * @param $config string key or an array of configuration values
678
+ * @param $value string optional - if $config is a key, the value
679
+ *
680
+ */
681
+ public function setClassConfig($class, $config, $value = null)
682
+ {
683
+ if (!is_string($class)) {
684
+ $class = get_class($class);
685
+ }
686
+ $this->config->setClassConfig($class, $config, $value);
687
+
688
+ }
689
+
690
+ /**
691
+ * @return string the base URL to use for calls to the APIs
692
+ */
693
+ public function getBasePath()
694
+ {
695
+ return $this->config->getBasePath();
696
+ }
697
+
698
+ /**
699
+ * @return string the name of the application
700
+ */
701
+ public function getApplicationName()
702
+ {
703
+ return $this->config->getApplicationName();
704
+ }
705
+
706
+ /**
707
+ * Are we running in Google AppEngine?
708
+ * return bool
709
+ */
710
+ public function isAppEngine()
711
+ {
712
+ return (isset($_SERVER['SERVER_SOFTWARE']) &&
713
+ strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine') !== false);
714
+ }
715
+ }
tags/5.3.1/tools/src/Deconf/Collection.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('Deconf_Client')) {
4
+ require_once dirname(__FILE__) . '/autoload.php';
5
+ }
6
+
7
+ /**
8
+ * Extension to the regular Deconf_Model that automatically
9
+ * exposes the items array for iteration, so you can just
10
+ * iterate over the object rather than a reference inside.
11
+ */
12
+ class Deconf_Collection extends Deconf_Model implements Iterator, Countable
13
+ {
14
+ protected $collection_key = 'items';
15
+
16
+ public function rewind()
17
+ {
18
+ if (isset($this->modelData[$this->collection_key])
19
+ && is_array($this->modelData[$this->collection_key])) {
20
+ reset($this->modelData[$this->collection_key]);
21
+ }
22
+ }
23
+
24
+ public function current()
25
+ {
26
+ $this->coerceType($this->key());
27
+ if (is_array($this->modelData[$this->collection_key])) {
28
+ return current($this->modelData[$this->collection_key]);
29
+ }
30
+ }
31
+
32
+ public function key()
33
+ {
34
+ if (isset($this->modelData[$this->collection_key])
35
+ && is_array($this->modelData[$this->collection_key])) {
36
+ return key($this->modelData[$this->collection_key]);
37
+ }
38
+ }
39
+
40
+ public function next()
41
+ {
42
+ return next($this->modelData[$this->collection_key]);
43
+ }
44
+
45
+ public function valid()
46
+ {
47
+ $key = $this->key();
48
+ return $key !== null && $key !== false;
49
+ }
50
+
51
+ public function count()
52
+ {
53
+ if (!isset($this->modelData[$this->collection_key])) {
54
+ return 0;
55
+ }
56
+ return count($this->modelData[$this->collection_key]);
57
+ }
58
+
59
+ public function offsetExists($offset)
60
+ {
61
+ if (!is_numeric($offset)) {
62
+ return parent::offsetExists($offset);
63
+ }
64
+ return isset($this->modelData[$this->collection_key][$offset]);
65
+ }
66
+
67
+ public function offsetGet($offset)
68
+ {
69
+ if (!is_numeric($offset)) {
70
+ return parent::offsetGet($offset);
71
+ }
72
+ $this->coerceType($offset);
73
+ return $this->modelData[$this->collection_key][$offset];
74
+ }
75
+
76
+ public function offsetSet($offset, $value)
77
+ {
78
+ if (!is_numeric($offset)) {
79
+ return parent::offsetSet($offset, $value);
80
+ }
81
+ $this->modelData[$this->collection_key][$offset] = $value;
82
+ }
83
+
84
+ public function offsetUnset($offset)
85
+ {
86
+ if (!is_numeric($offset)) {
87
+ return parent::offsetUnset($offset);
88
+ }
89
+ unset($this->modelData[$this->collection_key][$offset]);
90
+ }
91
+
92
+ private function coerceType($offset)
93
+ {
94
+ $typeKey = $this->keyType($this->collection_key);
95
+ if (isset($this->$typeKey) && !is_object($this->modelData[$this->collection_key][$offset])) {
96
+ $type = $this->$typeKey;
97
+ $this->modelData[$this->collection_key][$offset] =
98
+ new $type($this->modelData[$this->collection_key][$offset]);
99
+ }
100
+ }
101
+ }
tags/5.3.1/tools/src/Deconf/Config.php ADDED
@@ -0,0 +1,456 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2010 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * A class to contain the library configuration for the Google API client.
20
+ */
21
+ class Deconf_Config
22
+ {
23
+ const GZIP_DISABLED = true;
24
+ const GZIP_ENABLED = false;
25
+ const GZIP_UPLOADS_ENABLED = true;
26
+ const GZIP_UPLOADS_DISABLED = false;
27
+ const USE_AUTO_IO_SELECTION = "auto";
28
+ const TASK_RETRY_NEVER = 0;
29
+ const TASK_RETRY_ONCE = 1;
30
+ const TASK_RETRY_ALWAYS = -1;
31
+ protected $configuration;
32
+
33
+ /**
34
+ * Create a new Deconf_Config. Can accept an ini file location with the
35
+ * local configuration. For example:
36
+ * application_name="My App"
37
+ *
38
+ * @param [$ini_file_location] - optional - The location of the ini file to load
39
+ */
40
+ public function __construct($ini_file_location = null)
41
+ {
42
+ $this->configuration = array(
43
+ // The application_name is included in the User-Agent HTTP header.
44
+ 'application_name' => '',
45
+
46
+ // Which Authentication, Storage and HTTP IO classes to use.
47
+ 'auth_class' => 'Deconf_Auth_OAuth2',
48
+ 'io_class' => self::USE_AUTO_IO_SELECTION,
49
+ 'cache_class' => 'Deconf_Cache_File',
50
+ 'logger_class' => 'Deconf_Logger_Null',
51
+
52
+ // Don't change these unless you're working against a special development
53
+ // or testing environment.
54
+ 'base_path' => 'https://www.googleapis.com',
55
+
56
+ // Definition of class specific values, like file paths and so on.
57
+ 'classes' => array(
58
+ 'Deconf_IO_Abstract' => array(
59
+ 'request_timeout_seconds' => 100,
60
+ ),
61
+ 'Deconf_IO_Curl' => array(
62
+ 'disable_proxy_workaround' => false,
63
+ 'options' => null,
64
+ ),
65
+ 'Deconf_Logger_Abstract' => array(
66
+ 'level' => 'debug',
67
+ 'log_format' => "[%datetime%] %level%: %message% %context%\n",
68
+ 'date_format' => 'd/M/Y:H:i:s O',
69
+ 'allow_newlines' => true
70
+ ),
71
+ 'Deconf_Logger_File' => array(
72
+ 'file' => 'php://stdout',
73
+ 'mode' => 0640,
74
+ 'lock' => false,
75
+ ),
76
+ 'Deconf_Http_Request' => array(
77
+ // Disable the use of gzip on calls if set to true. Defaults to false.
78
+ 'disable_gzip' => self::GZIP_ENABLED,
79
+
80
+ // We default gzip to disabled on uploads even if gzip is otherwise
81
+ // enabled, due to some issues seen with small packet sizes for uploads.
82
+ // Please test with this option before enabling gzip for uploads in
83
+ // a production environment.
84
+ 'enable_gzip_for_uploads' => self::GZIP_UPLOADS_DISABLED,
85
+ ),
86
+ // If you want to pass in OAuth 2.0 settings, they will need to be
87
+ // structured like this.
88
+ 'Deconf_Auth_OAuth2' => array(
89
+ // Keys for OAuth 2.0 access, see the API console at
90
+ // https://developers.google.com/console
91
+ 'client_id' => '',
92
+ 'client_secret' => '',
93
+ 'redirect_uri' => '',
94
+
95
+ // Simple API access key, also from the API console. Ensure you get
96
+ // a Server key, and not a Browser key.
97
+ 'developer_key' => '',
98
+
99
+ // Other parameters.
100
+ 'hd' => '',
101
+ 'prompt' => '',
102
+ 'openid.realm' => '',
103
+ 'include_granted_scopes' => '',
104
+ 'login_hint' => '',
105
+ 'request_visible_actions' => '',
106
+ 'access_type' => 'online',
107
+ 'approval_prompt' => 'auto',
108
+ 'federated_signon_certs_url' =>
109
+ 'https://www.googleapis.com/oauth2/v1/certs',
110
+ ),
111
+ 'Deconf_Task_Runner' => array(
112
+ // Delays are specified in seconds
113
+ 'initial_delay' => 1,
114
+ 'max_delay' => 60,
115
+ // Base number for exponential backoff
116
+ 'factor' => 2,
117
+ // A random number between -jitter and jitter will be added to the
118
+ // factor on each iteration to allow for better distribution of
119
+ // retries.
120
+ 'jitter' => .5,
121
+ // Maximum number of retries allowed
122
+ 'retries' => 0
123
+ ),
124
+ 'Deconf_Service_Exception' => array(
125
+ 'retry_map' => array(
126
+ '500' => self::TASK_RETRY_ALWAYS,
127
+ '503' => self::TASK_RETRY_ALWAYS,
128
+ 'rateLimitExceeded' => self::TASK_RETRY_ALWAYS,
129
+ 'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS
130
+ )
131
+ ),
132
+ 'Deconf_IO_Exception' => array(
133
+ 'retry_map' => !extension_loaded('curl') ? array() : array(
134
+ CURLE_COULDNT_RESOLVE_HOST => self::TASK_RETRY_ALWAYS,
135
+ CURLE_COULDNT_CONNECT => self::TASK_RETRY_ALWAYS,
136
+ CURLE_OPERATION_TIMEOUTED => self::TASK_RETRY_ALWAYS,
137
+ CURLE_SSL_CONNECT_ERROR => self::TASK_RETRY_ALWAYS,
138
+ CURLE_GOT_NOTHING => self::TASK_RETRY_ALWAYS
139
+ )
140
+ ),
141
+ // Set a default directory for the file cache.
142
+ 'Deconf_Cache_File' => array(
143
+ 'directory' => sys_get_temp_dir() . '/Deconf_Client'
144
+ )
145
+ ),
146
+ );
147
+ if ($ini_file_location) {
148
+ $ini = parse_ini_file($ini_file_location, true);
149
+ if (is_array($ini) && count($ini)) {
150
+ $merged_configuration = $ini + $this->configuration;
151
+ if (isset($ini['classes']) && isset($this->configuration['classes'])) {
152
+ $merged_configuration['classes'] = $ini['classes'] + $this->configuration['classes'];
153
+ }
154
+ $this->configuration = $merged_configuration;
155
+ }
156
+ }
157
+ }
158
+
159
+ /**
160
+ * Set configuration specific to a given class.
161
+ * $config->setClassConfig('Deconf_Cache_File',
162
+ * array('directory' => '/tmp/cache'));
163
+ * @param $class string The class name for the configuration
164
+ * @param $config string key or an array of configuration values
165
+ * @param $value string optional - if $config is a key, the value
166
+ */
167
+ public function setClassConfig($class, $config, $value = null)
168
+ {
169
+ if (!is_array($config)) {
170
+ if (!isset($this->configuration['classes'][$class])) {
171
+ $this->configuration['classes'][$class] = array();
172
+ }
173
+ $this->configuration['classes'][$class][$config] = $value;
174
+ } else {
175
+ $this->configuration['classes'][$class] = $config;
176
+ }
177
+ }
178
+
179
+ public function getClassConfig($class, $key = null)
180
+ {
181
+ if (!isset($this->configuration['classes'][$class])) {
182
+ return null;
183
+ }
184
+ if ($key === null) {
185
+ return $this->configuration['classes'][$class];
186
+ } else {
187
+ return $this->configuration['classes'][$class][$key];
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Return the configured cache class.
193
+ * @return string
194
+ */
195
+ public function getCacheClass()
196
+ {
197
+ return $this->configuration['cache_class'];
198
+ }
199
+
200
+ /**
201
+ * Return the configured logger class.
202
+ * @return string
203
+ */
204
+ public function getLoggerClass()
205
+ {
206
+ return $this->configuration['logger_class'];
207
+ }
208
+
209
+ /**
210
+ * Return the configured Auth class.
211
+ * @return string
212
+ */
213
+ public function getAuthClass()
214
+ {
215
+ return $this->configuration['auth_class'];
216
+ }
217
+
218
+ /**
219
+ * Set the auth class.
220
+ *
221
+ * @param $class string the class name to set
222
+ */
223
+ public function setAuthClass($class)
224
+ {
225
+ $prev = $this->configuration['auth_class'];
226
+ if (!isset($this->configuration['classes'][$class]) &&
227
+ isset($this->configuration['classes'][$prev])) {
228
+ $this->configuration['classes'][$class] =
229
+ $this->configuration['classes'][$prev];
230
+ }
231
+ $this->configuration['auth_class'] = $class;
232
+ }
233
+
234
+ /**
235
+ * Set the IO class.
236
+ *
237
+ * @param $class string the class name to set
238
+ */
239
+ public function setIoClass($class)
240
+ {
241
+ $prev = $this->configuration['io_class'];
242
+ if (!isset($this->configuration['classes'][$class]) &&
243
+ isset($this->configuration['classes'][$prev])) {
244
+ $this->configuration['classes'][$class] =
245
+ $this->configuration['classes'][$prev];
246
+ }
247
+ $this->configuration['io_class'] = $class;
248
+ }
249
+
250
+ /**
251
+ * Set the cache class.
252
+ *
253
+ * @param $class string the class name to set
254
+ */
255
+ public function setCacheClass($class)
256
+ {
257
+ $prev = $this->configuration['cache_class'];
258
+ if (!isset($this->configuration['classes'][$class]) &&
259
+ isset($this->configuration['classes'][$prev])) {
260
+ $this->configuration['classes'][$class] =
261
+ $this->configuration['classes'][$prev];
262
+ }
263
+ $this->configuration['cache_class'] = $class;
264
+ }
265
+
266
+ /**
267
+ * Set the logger class.
268
+ *
269
+ * @param $class string the class name to set
270
+ */
271
+ public function setLoggerClass($class)
272
+ {
273
+ $prev = $this->configuration['logger_class'];
274
+ if (!isset($this->configuration['classes'][$class]) &&
275
+ isset($this->configuration['classes'][$prev])) {
276
+ $this->configuration['classes'][$class] =
277
+ $this->configuration['classes'][$prev];
278
+ }
279
+ $this->configuration['logger_class'] = $class;
280
+ }
281
+
282
+ /**
283
+ * Return the configured IO class.
284
+ *
285
+ * @return string
286
+ */
287
+ public function getIoClass()
288
+ {
289
+ return $this->configuration['io_class'];
290
+ }
291
+
292
+ /**
293
+ * Set the application name, this is included in the User-Agent HTTP header.
294
+ * @param string $name
295
+ */
296
+ public function setApplicationName($name)
297
+ {
298
+ $this->configuration['application_name'] = $name;
299
+ }
300
+
301
+ /**
302
+ * @return string the name of the application
303
+ */
304
+ public function getApplicationName()
305
+ {
306
+ return $this->configuration['application_name'];
307
+ }
308
+
309
+ /**
310
+ * Set the client ID for the auth class.
311
+ * @param $clientId string - the API console client ID
312
+ */
313
+ public function setClientId($clientId)
314
+ {
315
+ $this->setAuthConfig('client_id', $clientId);
316
+ }
317
+
318
+ /**
319
+ * Set the client secret for the auth class.
320
+ * @param $secret string - the API console client secret
321
+ */
322
+ public function setClientSecret($secret)
323
+ {
324
+ $this->setAuthConfig('client_secret', $secret);
325
+ }
326
+
327
+ /**
328
+ * Set the redirect uri for the auth class. Note that if using the
329
+ * Javascript based sign in flow, this should be the string 'postmessage'.
330
+ *
331
+ * @param $uri string - the URI that users should be redirected to
332
+ */
333
+ public function setRedirectUri($uri)
334
+ {
335
+ $this->setAuthConfig('redirect_uri', $uri);
336
+ }
337
+
338
+ /**
339
+ * Set the app activities for the auth class.
340
+ * @param $rva string a space separated list of app activity types
341
+ */
342
+ public function setRequestVisibleActions($rva)
343
+ {
344
+ $this->setAuthConfig('request_visible_actions', $rva);
345
+ }
346
+
347
+ /**
348
+ * Set the the access type requested (offline or online.)
349
+ * @param $access string - the access type
350
+ */
351
+ public function setAccessType($access)
352
+ {
353
+ $this->setAuthConfig('access_type', $access);
354
+ }
355
+
356
+ /**
357
+ * Set when to show the approval prompt (auto or force)
358
+ * @param $approval string - the approval request
359
+ */
360
+ public function setApprovalPrompt($approval)
361
+ {
362
+ $this->setAuthConfig('approval_prompt', $approval);
363
+ }
364
+
365
+ /**
366
+ * Set the login hint (email address or sub identifier)
367
+ * @param $hint string
368
+ */
369
+ public function setLoginHint($hint)
370
+ {
371
+ $this->setAuthConfig('login_hint', $hint);
372
+ }
373
+
374
+ /**
375
+ * Set the developer key for the auth class. Note that this is separate value
376
+ * from the client ID - if it looks like a URL, its a client ID!
377
+ * @param $key string - the API console developer key
378
+ */
379
+ public function setDeveloperKey($key)
380
+ {
381
+ $this->setAuthConfig('developer_key', $key);
382
+ }
383
+
384
+ /**
385
+ * Set the hd (hosted domain) parameter streamlines the login process for
386
+ * Google Apps hosted accounts. By including the domain of the user, you
387
+ * restrict sign-in to accounts at that domain.
388
+ *
389
+ * This should not be used to ensure security on your application - check
390
+ * the hd values within an id token (@see Deconf_Auth_LoginTicket) after sign
391
+ * in to ensure that the user is from the domain you were expecting.
392
+ *
393
+ * @param $hd string - the domain to use.
394
+ */
395
+ public function setHostedDomain($hd)
396
+ {
397
+ $this->setAuthConfig('hd', $hd);
398
+ }
399
+
400
+ /**
401
+ * Set the prompt hint. Valid values are none, consent and select_account.
402
+ * If no value is specified and the user has not previously authorized
403
+ * access, then the user is shown a consent screen.
404
+ * @param $prompt string
405
+ */
406
+ public function setPrompt($prompt)
407
+ {
408
+ $this->setAuthConfig('prompt', $prompt);
409
+ }
410
+
411
+ /**
412
+ * openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth
413
+ * 2.0. It is used in OpenID 2.0 requests to signify the URL-space for which
414
+ * an authentication request is valid.
415
+ * @param $realm string - the URL-space to use.
416
+ */
417
+ public function setOpenidRealm($realm)
418
+ {
419
+ $this->setAuthConfig('openid.realm', $realm);
420
+ }
421
+
422
+ /**
423
+ * If this is provided with the value true, and the authorization request is
424
+ * granted, the authorization will include any previous authorizations
425
+ * granted to this user/application combination for other scopes.
426
+ * @param $include boolean - the URL-space to use.
427
+ */
428
+ public function setIncludeGrantedScopes($include)
429
+ {
430
+ $this->setAuthConfig(
431
+ 'include_granted_scopes',
432
+ $include ? "true" : "false"
433
+ );
434
+ }
435
+
436
+ /**
437
+ * @return string the base URL to use for API calls
438
+ */
439
+ public function getBasePath()
440
+ {
441
+ return $this->configuration['base_path'];
442
+ }
443
+
444
+ /**
445
+ * Set the auth configuration for the current auth class.
446
+ * @param $key - the key to set
447
+ * @param $value - the parameter value
448
+ */
449
+ private function setAuthConfig($key, $value)
450
+ {
451
+ if (!isset($this->configuration['classes'][$this->getAuthClass()])) {
452
+ $this->configuration['classes'][$this->getAuthClass()] = array();
453
+ }
454
+ $this->configuration['classes'][$this->getAuthClass()][$key] = $value;
455
+ }
456
+ }
tags/5.3.1/tools/src/Deconf/Exception.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ class Deconf_Exception extends Exception
19
+ {
20
+ }
tags/5.3.1/tools/src/Deconf/Http/Batch.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2012 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Class to handle batched requests to the Google API service.
24
+ */
25
+ class Deconf_Http_Batch
26
+ {
27
+ /** @var string Multipart Boundary. */
28
+ private $boundary;
29
+
30
+ /** @var array service requests to be executed. */
31
+ private $requests = array();
32
+
33
+ /** @var Deconf_Client */
34
+ private $client;
35
+
36
+ private $expected_classes = array();
37
+
38
+ private $root_url;
39
+
40
+ private $batch_path;
41
+
42
+ public function __construct(Deconf_Client $client, $boundary = false, $rootUrl = '', $batchPath = '')
43
+ {
44
+ $this->client = $client;
45
+ $this->root_url = rtrim($rootUrl ? $rootUrl : $this->client->getBasePath(), '/');
46
+ $this->batch_path = $batchPath ? $batchPath : 'batch';
47
+ $this->expected_classes = array();
48
+ $boundary = (false == $boundary) ? mt_rand() : $boundary;
49
+ $this->boundary = str_replace('"', '', $boundary);
50
+ }
51
+
52
+ public function add(Deconf_Http_Request $request, $key = false)
53
+ {
54
+ if (false == $key) {
55
+ $key = mt_rand();
56
+ }
57
+
58
+ $this->requests[$key] = $request;
59
+ }
60
+
61
+ public function execute()
62
+ {
63
+ $body = '';
64
+
65
+ /** @var Deconf_Http_Request $req */
66
+ foreach ($this->requests as $key => $req) {
67
+ $body .= "--{$this->boundary}\n";
68
+ $body .= $req->toBatchString($key) . "\n\n";
69
+ $this->expected_classes["response-" . $key] = $req->getExpectedClass();
70
+ }
71
+
72
+ $body .= "--{$this->boundary}--";
73
+
74
+ $url = $this->root_url . '/' . $this->batch_path;
75
+ $httpRequest = new Deconf_Http_Request($url, 'POST');
76
+ $httpRequest->setRequestHeaders(
77
+ array('Content-Type' => 'multipart/mixed; boundary=' . $this->boundary)
78
+ );
79
+
80
+ $httpRequest->setPostBody($body);
81
+ $response = $this->client->getIo()->makeRequest($httpRequest);
82
+
83
+ return $this->parseResponse($response);
84
+ }
85
+
86
+ public function parseResponse(Deconf_Http_Request $response)
87
+ {
88
+ $contentType = $response->getResponseHeader('content-type');
89
+ $contentType = explode(';', $contentType);
90
+ $boundary = false;
91
+ foreach ($contentType as $part) {
92
+ $part = (explode('=', $part, 2));
93
+ if (isset($part[0]) && 'boundary' == trim($part[0])) {
94
+ $boundary = $part[1];
95
+ }
96
+ }
97
+
98
+ $body = $response->getResponseBody();
99
+ if ($body) {
100
+ $body = str_replace("--$boundary--", "--$boundary", $body);
101
+ $parts = explode("--$boundary", $body);
102
+ $responses = array();
103
+
104
+ foreach ($parts as $part) {
105
+ $part = trim($part);
106
+ if (!empty($part)) {
107
+ list($metaHeaders, $part) = explode("\r\n\r\n", $part, 2);
108
+ $metaHeaders = $this->client->getIo()->getHttpResponseHeaders($metaHeaders);
109
+
110
+ $status = substr($part, 0, strpos($part, "\n"));
111
+ $status = explode(" ", $status);
112
+ $status = $status[1];
113
+
114
+ list($partHeaders, $partBody) = $this->client->getIo()->ParseHttpResponse($part, false);
115
+ $response = new Deconf_Http_Request("");
116
+ $response->setResponseHttpCode($status);
117
+ $response->setResponseHeaders($partHeaders);
118
+ $response->setResponseBody($partBody);
119
+
120
+ // Need content id.
121
+ $key = $metaHeaders['content-id'];
122
+
123
+ if (isset($this->expected_classes[$key]) &&
124
+ strlen($this->expected_classes[$key]) > 0) {
125
+ $class = $this->expected_classes[$key];
126
+ $response->setExpectedClass($class);
127
+ }
128
+
129
+ try {
130
+ $response = Deconf_Http_REST::decodeHttpResponse($response, $this->client);
131
+ $responses[$key] = $response;
132
+ } catch (Deconf_Service_Exception $e) {
133
+ // Store the exception as the response, so successful responses
134
+ // can be processed.
135
+ $responses[$key] = $e;
136
+ }
137
+ }
138
+ }
139
+
140
+ return $responses;
141
+ }
142
+
143
+ return null;
144
+ }
145
+ }
tags/5.3.1/tools/src/Deconf/Http/CacheParser.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2012 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Implement the caching directives specified in rfc2616. This
24
+ * implementation is guided by the guidance offered in rfc2616-sec13.
25
+ */
26
+ class Deconf_Http_CacheParser
27
+ {
28
+ public static $CACHEABLE_HTTP_METHODS = array('GET', 'HEAD');
29
+ public static $CACHEABLE_STATUS_CODES = array('200', '203', '300', '301');
30
+
31
+ /**
32
+ * Check if an HTTP request can be cached by a private local cache.
33
+ *
34
+ * @static
35
+ * @param Deconf_Http_Request $resp
36
+ * @return bool True if the request is cacheable.
37
+ * False if the request is uncacheable.
38
+ */
39
+ public static function isRequestCacheable(Deconf_Http_Request $resp)
40
+ {
41
+ $method = $resp->getRequestMethod();
42
+ if (! in_array($method, self::$CACHEABLE_HTTP_METHODS)) {
43
+ return false;
44
+ }
45
+
46
+ // Don't cache authorized requests/responses.
47
+ // [rfc2616-14.8] When a shared cache receives a request containing an
48
+ // Authorization field, it MUST NOT return the corresponding response
49
+ // as a reply to any other request...
50
+ if ($resp->getRequestHeader("authorization")) {
51
+ return false;
52
+ }
53
+
54
+ return true;
55
+ }
56
+
57
+ /**
58
+ * Check if an HTTP response can be cached by a private local cache.
59
+ *
60
+ * @static
61
+ * @param Deconf_Http_Request $resp
62
+ * @return bool True if the response is cacheable.
63
+ * False if the response is un-cacheable.
64
+ */
65
+ public static function isResponseCacheable(Deconf_Http_Request $resp)
66
+ {
67
+ // First, check if the HTTP request was cacheable before inspecting the
68
+ // HTTP response.
69
+ if (false == self::isRequestCacheable($resp)) {
70
+ return false;
71
+ }
72
+
73
+ $code = $resp->getResponseHttpCode();
74
+ if (! in_array($code, self::$CACHEABLE_STATUS_CODES)) {
75
+ return false;
76
+ }
77
+
78
+ // The resource is uncacheable if the resource is already expired and
79
+ // the resource doesn't have an ETag for revalidation.
80
+ $etag = $resp->getResponseHeader("etag");
81
+ if (self::isExpired($resp) && $etag == false) {
82
+ return false;
83
+ }
84
+
85
+ // [rfc2616-14.9.2] If [no-store is] sent in a response, a cache MUST NOT
86
+ // store any part of either this response or the request that elicited it.
87
+ $cacheControl = $resp->getParsedCacheControl();
88
+ if (isset($cacheControl['no-store'])) {
89
+ return false;
90
+ }
91
+
92
+ // Pragma: no-cache is an http request directive, but is occasionally
93
+ // used as a response header incorrectly.
94
+ $pragma = $resp->getResponseHeader('pragma');
95
+ if ($pragma == 'no-cache' || strpos($pragma, 'no-cache') !== false) {
96
+ return false;
97
+ }
98
+
99
+ // [rfc2616-14.44] Vary: * is extremely difficult to cache. "It implies that
100
+ // a cache cannot determine from the request headers of a subsequent request
101
+ // whether this response is the appropriate representation."
102
+ // Given this, we deem responses with the Vary header as uncacheable.
103
+ $vary = $resp->getResponseHeader('vary');
104
+ if ($vary) {
105
+ return false;
106
+ }
107
+
108
+ return true;
109
+ }
110
+
111
+ /**
112
+ * @static
113
+ * @param Deconf_Http_Request $resp
114
+ * @return bool True if the HTTP response is considered to be expired.
115
+ * False if it is considered to be fresh.
116
+ */
117
+ public static function isExpired(Deconf_Http_Request $resp)
118
+ {
119
+ // HTTP/1.1 clients and caches MUST treat other invalid date formats,
120
+ // especially including the value “0”, as in the past.
121
+ $parsedExpires = false;
122
+ $responseHeaders = $resp->getResponseHeaders();
123
+
124
+ if (isset($responseHeaders['expires'])) {
125
+ $rawExpires = $responseHeaders['expires'];
126
+ // Check for a malformed expires header first.
127
+ if (empty($rawExpires) || (is_numeric($rawExpires) && $rawExpires <= 0)) {
128
+ return true;
129
+ }
130
+
131
+ // See if we can parse the expires header.
132
+ $parsedExpires = strtotime($rawExpires);
133
+ if (false == $parsedExpires || $parsedExpires <= 0) {
134
+ return true;
135
+ }
136
+ }
137
+
138
+ // Calculate the freshness of an http response.
139
+ $freshnessLifetime = false;
140
+ $cacheControl = $resp->getParsedCacheControl();
141
+ if (isset($cacheControl['max-age'])) {
142
+ $freshnessLifetime = $cacheControl['max-age'];
143
+ }
144
+
145
+ $rawDate = $resp->getResponseHeader('date');
146
+ $parsedDate = strtotime($rawDate);
147
+
148
+ if (empty($rawDate) || false == $parsedDate) {
149
+ // We can't default this to now, as that means future cache reads
150
+ // will always pass with the logic below, so we will require a
151
+ // date be injected if not supplied.
152
+ throw new Deconf_Exception("All cacheable requests must have creation dates.");
153
+ }
154
+
155
+ if (false == $freshnessLifetime && isset($responseHeaders['expires'])) {
156
+ $freshnessLifetime = $parsedExpires - $parsedDate;
157
+ }
158
+
159
+ if (false == $freshnessLifetime) {
160
+ return true;
161
+ }
162
+
163
+ // Calculate the age of an http response.
164
+ $age = max(0, time() - $parsedDate);
165
+ if (isset($responseHeaders['age'])) {
166
+ $age = max($age, strtotime($responseHeaders['age']));
167
+ }
168
+
169
+ return $freshnessLifetime <= $age;
170
+ }
171
+
172
+ /**
173
+ * Determine if a cache entry should be revalidated with by the origin.
174
+ *
175
+ * @param Deconf_Http_Request $response
176
+ * @return bool True if the entry is expired, else return false.
177
+ */
178
+ public static function mustRevalidate(Deconf_Http_Request $response)
179
+ {
180
+ // [13.3] When a cache has a stale entry that it would like to use as a
181
+ // response to a client's request, it first has to check with the origin
182
+ // server to see if its cached entry is still usable.
183
+ return self::isExpired($response);
184
+ }
185
+ }
tags/5.3.1/tools/src/Deconf/Http/MediaFileUpload.php ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2012 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Manage large file uploads, which may be media but can be any type
24
+ * of sizable data.
25
+ */
26
+ class Deconf_Http_MediaFileUpload
27
+ {
28
+ const UPLOAD_MEDIA_TYPE = 'media';
29
+ const UPLOAD_MULTIPART_TYPE = 'multipart';
30
+ const UPLOAD_RESUMABLE_TYPE = 'resumable';
31
+
32
+ /** @var string $mimeType */
33
+ private $mimeType;
34
+
35
+ /** @var string $data */
36
+ private $data;
37
+
38
+ /** @var bool $resumable */
39
+ private $resumable;
40
+
41
+ /** @var int $chunkSize */
42
+ private $chunkSize;
43
+
44
+ /** @var int $size */
45
+ private $size;
46
+
47
+ /** @var string $resumeUri */
48
+ private $resumeUri;
49
+
50
+ /** @var int $progress */
51
+ private $progress;
52
+
53
+ /** @var Deconf_Client */
54
+ private $client;
55
+
56
+ /** @var Deconf_Http_Request */
57
+ private $request;
58
+
59
+ /** @var string */
60
+ private $boundary;
61
+
62
+ /**
63
+ * Result code from last HTTP call
64
+ * @var int
65
+ */
66
+ private $httpResultCode;
67
+
68
+ /**
69
+ * @param $mimeType string
70
+ * @param $data string The bytes you want to upload.
71
+ * @param $resumable bool
72
+ * @param bool $chunkSize File will be uploaded in chunks of this many bytes.
73
+ * only used if resumable=True
74
+ */
75
+ public function __construct(
76
+ Deconf_Client $client,
77
+ Deconf_Http_Request $request,
78
+ $mimeType,
79
+ $data,
80
+ $resumable = false,
81
+ $chunkSize = false,
82
+ $boundary = false
83
+ ) {
84
+ $this->client = $client;
85
+ $this->request = $request;
86
+ $this->mimeType = $mimeType;
87
+ $this->data = $data;
88
+ $this->size = strlen($this->data);
89
+ $this->resumable = $resumable;
90
+ if (!$chunkSize) {
91
+ $chunkSize = 256 * 1024;
92
+ }
93
+ $this->chunkSize = $chunkSize;
94
+ $this->progress = 0;
95
+ $this->boundary = $boundary;
96
+
97
+ // Process Media Request
98
+ $this->process();
99
+ }
100
+
101
+ /**
102
+ * Set the size of the file that is being uploaded.
103
+ * @param $size - int file size in bytes
104
+ */
105
+ public function setFileSize($size)
106
+ {
107
+ $this->size = $size;
108
+ }
109
+
110
+ /**
111
+ * Return the progress on the upload
112
+ * @return int progress in bytes uploaded.
113
+ */
114
+ public function getProgress()
115
+ {
116
+ return $this->progress;
117
+ }
118
+
119
+ /**
120
+ * Return the HTTP result code from the last call made.
121
+ * @return int code
122
+ */
123
+ public function getHttpResultCode()
124
+ {
125
+ return $this->httpResultCode;
126
+ }
127
+
128
+ /**
129
+ * Sends a PUT-Request to google drive and parses the response,
130
+ * setting the appropiate variables from the response()
131
+ *
132
+ * @param Deconf_Http_Request $httpRequest the Reuqest which will be send
133
+ *
134
+ * @return false|mixed false when the upload is unfinished or the decoded http response
135
+ *
136
+ */
137
+ private function makePutRequest(Deconf_Http_Request $httpRequest)
138
+ {
139
+ if ($this->client->getClassConfig("Deconf_Http_Request", "enable_gzip_for_uploads")) {
140
+ $httpRequest->enableGzip();
141
+ } else {
142
+ $httpRequest->disableGzip();
143
+ }
144
+
145
+ $response = $this->client->getIo()->makeRequest($httpRequest);
146
+ $response->setExpectedClass($this->request->getExpectedClass());
147
+ $code = $response->getResponseHttpCode();
148
+ $this->httpResultCode = $code;
149
+
150
+ if (308 == $code) {
151
+ // Track the amount uploaded.
152
+ $range = explode('-', $response->getResponseHeader('range'));
153
+ $this->progress = $range[1] + 1;
154
+
155
+ // Allow for changing upload URLs.
156
+ $location = $response->getResponseHeader('location');
157
+ if ($location) {
158
+ $this->resumeUri = $location;
159
+ }
160
+
161
+ // No problems, but upload not complete.
162
+ return false;
163
+ } else {
164
+ return Deconf_Http_REST::decodeHttpResponse($response, $this->client);
165
+ }
166
+ }
167
+
168
+ /**
169
+ * Send the next part of the file to upload.
170
+ * @param [$chunk] the next set of bytes to send. If false will used $data passed
171
+ * at construct time.
172
+ */
173
+ public function nextChunk($chunk = false)
174
+ {
175
+ if (false == $this->resumeUri) {
176
+ $this->resumeUri = $this->fetchResumeUri();
177
+ }
178
+
179
+ if (false == $chunk) {
180
+ $chunk = substr($this->data, $this->progress, $this->chunkSize);
181
+ }
182
+ $lastBytePos = $this->progress + strlen($chunk) - 1;
183
+ $headers = array(
184
+ 'content-range' => "bytes $this->progress-$lastBytePos/$this->size",
185
+ 'content-type' => $this->request->getRequestHeader('content-type'),
186
+ 'content-length' => $this->chunkSize,
187
+ 'expect' => '',
188
+ );
189
+
190
+ $httpRequest = new Deconf_Http_Request(
191
+ $this->resumeUri,
192
+ 'PUT',
193
+ $headers,
194
+ $chunk
195
+ );
196
+ return $this->makePutRequest($httpRequest);
197
+ }
198
+
199
+ /**
200
+ * Resume a previously unfinished upload
201
+ * @param $resumeUri the resume-URI of the unfinished, resumable upload.
202
+ */
203
+ public function resume($resumeUri)
204
+ {
205
+ $this->resumeUri = $resumeUri;
206
+ $headers = array(
207
+ 'content-range' => "bytes */$this->size",
208
+ 'content-length' => 0,
209
+ );
210
+ $httpRequest = new Deconf_Http_Request(
211
+ $this->resumeUri,
212
+ 'PUT',
213
+ $headers
214
+ );
215
+ return $this->makePutRequest($httpRequest);
216
+ }
217
+
218
+ /**
219
+ * @return array|bool
220
+ * @visible for testing
221
+ */
222
+ private function process()
223
+ {
224
+ $postBody = false;
225
+ $contentType = false;
226
+
227
+ $meta = $this->request->getPostBody();
228
+ $meta = is_string($meta) ? json_decode($meta, true) : $meta;
229
+
230
+ $uploadType = $this->getUploadType($meta);
231
+ $this->request->setQueryParam('uploadType', $uploadType);
232
+ $this->transformToUploadUrl();
233
+ $mimeType = $this->mimeType ?
234
+ $this->mimeType :
235
+ $this->request->getRequestHeader('content-type');
236
+
237
+ if (self::UPLOAD_RESUMABLE_TYPE == $uploadType) {
238
+ $contentType = $mimeType;
239
+ $postBody = is_string($meta) ? $meta : json_encode($meta);
240
+ } else if (self::UPLOAD_MEDIA_TYPE == $uploadType) {
241
+ $contentType = $mimeType;
242
+ $postBody = $this->data;
243
+ } else if (self::UPLOAD_MULTIPART_TYPE == $uploadType) {
244
+ // This is a multipart/related upload.
245
+ $boundary = $this->boundary ? $this->boundary : mt_rand();
246
+ $boundary = str_replace('"', '', $boundary);
247
+ $contentType = 'multipart/related; boundary=' . $boundary;
248
+ $related = "--$boundary\r\n";
249
+ $related .= "Content-Type: application/json; charset=UTF-8\r\n";
250
+ $related .= "\r\n" . json_encode($meta) . "\r\n";
251
+ $related .= "--$boundary\r\n";
252
+ $related .= "Content-Type: $mimeType\r\n";
253
+ $related .= "Content-Transfer-Encoding: base64\r\n";
254
+ $related .= "\r\n" . base64_encode($this->data) . "\r\n";
255
+ $related .= "--$boundary--";
256
+ $postBody = $related;
257
+ }
258
+
259
+ $this->request->setPostBody($postBody);
260
+
261
+ if (isset($contentType) && $contentType) {
262
+ $contentTypeHeader['content-type'] = $contentType;
263
+ $this->request->setRequestHeaders($contentTypeHeader);
264
+ }
265
+ }
266
+
267
+ private function transformToUploadUrl()
268
+ {
269
+ $base = $this->request->getBaseComponent();
270
+ $this->request->setBaseComponent($base . '/upload');
271
+ }
272
+
273
+ /**
274
+ * Valid upload types:
275
+ * - resumable (UPLOAD_RESUMABLE_TYPE)
276
+ * - media (UPLOAD_MEDIA_TYPE)
277
+ * - multipart (UPLOAD_MULTIPART_TYPE)
278
+ * @param $meta
279
+ * @return string
280
+ * @visible for testing
281
+ */
282
+ public function getUploadType($meta)
283
+ {
284
+ if ($this->resumable) {
285
+ return self::UPLOAD_RESUMABLE_TYPE;
286
+ }
287
+
288
+ if (false == $meta && $this->data) {
289
+ return self::UPLOAD_MEDIA_TYPE;
290
+ }
291
+
292
+ return self::UPLOAD_MULTIPART_TYPE;
293
+ }
294
+
295
+ public function getResumeUri()
296
+ {
297
+ return ( $this->resumeUri !== null ? $this->resumeUri : $this->fetchResumeUri() );
298
+ }
299
+
300
+ private function fetchResumeUri()
301
+ {
302
+ $result = null;
303
+ $body = $this->request->getPostBody();
304
+ if ($body) {
305
+ $headers = array(
306
+ 'content-type' => 'application/json; charset=UTF-8',
307
+ 'content-length' => Deconf_Utils::getStrLen($body),
308
+ 'x-upload-content-type' => $this->mimeType,
309
+ 'x-upload-content-length' => $this->size,
310
+ 'expect' => '',
311
+ );
312
+ $this->request->setRequestHeaders($headers);
313
+ }
314
+
315
+ $response = $this->client->getIo()->makeRequest($this->request);
316
+ $location = $response->getResponseHeader('location');
317
+ $code = $response->getResponseHttpCode();
318
+
319
+ if (200 == $code && true == $location) {
320
+ return $location;
321
+ }
322
+ $message = $code;
323
+ $body = @json_decode($response->getResponseBody());
324
+ if (!empty($body->error->errors) ) {
325
+ $message .= ': ';
326
+ foreach ($body->error->errors as $error) {
327
+ $message .= "{$error->domain}, {$error->message};";
328
+ }
329
+ $message = rtrim($message, ';');
330
+ }
331
+
332
+ $error = "Failed to start the resumable upload (HTTP {$message})";
333
+ $this->client->getLogger()->error($error);
334
+ throw new Deconf_Exception($error);
335
+ }
336
+
337
+ public function setChunkSize($chunkSize)
338
+ {
339
+ $this->chunkSize = $chunkSize;
340
+ }
341
+ }
tags/5.3.1/tools/src/Deconf/Http/REST.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2010 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * This class implements the RESTful transport of apiServiceRequest()'s
24
+ */
25
+ class Deconf_Http_REST
26
+ {
27
+ /**
28
+ * Executes a Deconf_Http_Request and (if applicable) automatically retries
29
+ * when errors occur.
30
+ *
31
+ * @param Deconf_Client $client
32
+ * @param Deconf_Http_Request $req
33
+ * @return array decoded result
34
+ * @throws Deconf_Service_Exception on server side error (ie: not authenticated,
35
+ * invalid or malformed post body, invalid url)
36
+ */
37
+ public static function execute(Deconf_Client $client, Deconf_Http_Request $req)
38
+ {
39
+ $runner = new Deconf_Task_Runner(
40
+ $client,
41
+ sprintf('%s %s', $req->getRequestMethod(), $req->getUrl()),
42
+ array(get_class(), 'doExecute'),
43
+ array($client, $req)
44
+ );
45
+
46
+ return $runner->run();
47
+ }
48
+
49
+ /**
50
+ * Executes a Deconf_Http_Request
51
+ *
52
+ * @param Deconf_Client $client
53
+ * @param Deconf_Http_Request $req
54
+ * @return array decoded result
55
+ * @throws Deconf_Service_Exception on server side error (ie: not authenticated,
56
+ * invalid or malformed post body, invalid url)
57
+ */
58
+ public static function doExecute(Deconf_Client $client, Deconf_Http_Request $req)
59
+ {
60
+ $httpRequest = $client->getIo()->makeRequest($req);
61
+ $httpRequest->setExpectedClass($req->getExpectedClass());
62
+ return self::decodeHttpResponse($httpRequest, $client);
63
+ }
64
+
65
+ /**
66
+ * Decode an HTTP Response.
67
+ * @static
68
+ * @throws Deconf_Service_Exception
69
+ * @param Deconf_Http_Request $response The http response to be decoded.
70
+ * @param Deconf_Client $client
71
+ * @return mixed|null
72
+ */
73
+ public static function decodeHttpResponse($response, Deconf_Client $client = null)
74
+ {
75
+ $code = $response->getResponseHttpCode();
76
+ $body = $response->getResponseBody();
77
+ $decoded = null;
78
+
79
+ if ((intVal($code)) >= 300) {
80
+ $decoded = json_decode($body, true);
81
+ $err = 'Error calling ' . $response->getRequestMethod() . ' ' . $response->getUrl();
82
+ if (isset($decoded['error']) &&
83
+ isset($decoded['error']['message']) &&
84
+ isset($decoded['error']['code'])) {
85
+ // if we're getting a json encoded error definition, use that instead of the raw response
86
+ // body for improved readability
87
+ $err .= ": ({$decoded['error']['code']}) {$decoded['error']['message']}";
88
+ } else {
89
+ $err .= ": ($code) $body";
90
+ }
91
+
92
+ $errors = null;
93
+ // Specific check for APIs which don't return error details, such as Blogger.
94
+ if (isset($decoded['error']) && isset($decoded['error']['errors'])) {
95
+ $errors = $decoded['error']['errors'];
96
+ }
97
+
98
+ $map = null;
99
+ if ($client) {
100
+ $client->getLogger()->error(
101
+ $err,
102
+ array('code' => $code, 'errors' => $errors)
103
+ );
104
+
105
+ $map = $client->getClassConfig(
106
+ 'Deconf_Service_Exception',
107
+ 'retry_map'
108
+ );
109
+ }
110
+ throw new Deconf_Service_Exception($err, $code, null, $errors, $map);
111
+ }
112
+
113
+ // Only attempt to decode the response, if the response code wasn't (204) 'no content'
114
+ if ($code != '204') {
115
+ if ($response->getExpectedRaw()) {
116
+ return $body;
117
+ }
118
+
119
+ $decoded = json_decode($body, true);
120
+ if ($decoded === null || $decoded === "") {
121
+ $error = "Invalid json in service response: $body";
122
+ if ($client) {
123
+ $client->getLogger()->error($error);
124
+ }
125
+ throw new Deconf_Service_Exception($error);
126
+ }
127
+
128
+ if ($response->getExpectedClass()) {
129
+ $class = $response->getExpectedClass();
130
+ $decoded = new $class($decoded);
131
+ }
132
+ }
133
+ return $decoded;
134
+ }
135
+
136
+ /**
137
+ * Parse/expand request parameters and create a fully qualified
138
+ * request uri.
139
+ * @static
140
+ * @param string $servicePath
141
+ * @param string $restPath
142
+ * @param array $params
143
+ * @return string $requestUrl
144
+ */
145
+ public static function createRequestUri($servicePath, $restPath, $params)
146
+ {
147
+ $requestUrl = $servicePath . $restPath;
148
+ $uriTemplateVars = array();
149
+ $queryVars = array();
150
+ foreach ($params as $paramName => $paramSpec) {
151
+ if ($paramSpec['type'] == 'boolean') {
152
+ $paramSpec['value'] = ($paramSpec['value']) ? 'true' : 'false';
153
+ }
154
+ if ($paramSpec['location'] == 'path') {
155
+ $uriTemplateVars[$paramName] = $paramSpec['value'];
156
+ } else if ($paramSpec['location'] == 'query') {
157
+ if (isset($paramSpec['repeated']) && is_array($paramSpec['value'])) {
158
+ foreach ($paramSpec['value'] as $value) {
159
+ $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value));
160
+ }
161
+ } else {
162
+ $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($paramSpec['value']));
163
+ }
164
+ }
165
+ }
166
+
167
+ if (count($uriTemplateVars)) {
168
+ $uriTemplateParser = new Deconf_Utils_URITemplate();
169
+ $requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars);
170
+ }
171
+
172
+ if (count($queryVars)) {
173
+ $requestUrl .= '?' . implode($queryVars, '&');
174
+ }
175
+
176
+ return $requestUrl;
177
+ }
178
+ }
tags/5.3.1/tools/src/Deconf/Http/Request.php ADDED
@@ -0,0 +1,504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2010 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * HTTP Request to be executed by IO classes. Upon execution, the
24
+ * responseHttpCode, responseHeaders and responseBody will be filled in.
25
+ *
26
+ * @author Chris Chabot <chabotc@google.com>
27
+ * @author Chirag Shah <chirags@google.com>
28
+ *
29
+ */
30
+ class Deconf_Http_Request
31
+ {
32
+ const GZIP_UA = " (gzip)";
33
+
34
+ private $batchHeaders = array(
35
+ 'Content-Type' => 'application/http',
36
+ 'Content-Transfer-Encoding' => 'binary',
37
+ 'MIME-Version' => '1.0',
38
+ );
39
+
40
+ protected $queryParams;
41
+ protected $requestMethod;
42
+ protected $requestHeaders;
43
+ protected $baseComponent = null;
44
+ protected $path;
45
+ protected $postBody;
46
+ protected $userAgent;
47
+ protected $canGzip = null;
48
+
49
+ protected $responseHttpCode;
50
+ protected $responseHeaders;
51
+ protected $responseBody;
52
+
53
+ protected $expectedClass;
54
+ protected $expectedRaw = false;
55
+
56
+ public $accessKey;
57
+
58
+ public function __construct(
59
+ $url,
60
+ $method = 'GET',
61
+ $headers = array(),
62
+ $postBody = null
63
+ ) {
64
+ $this->setUrl($url);
65
+ $this->setRequestMethod($method);
66
+ $this->setRequestHeaders($headers);
67
+ $this->setPostBody($postBody);
68
+ }
69
+
70
+ /**
71
+ * Misc function that returns the base url component of the $url
72
+ * used by the OAuth signing class to calculate the base string
73
+ * @return string The base url component of the $url.
74
+ */
75
+ public function getBaseComponent()
76
+ {
77
+ return $this->baseComponent;
78
+ }
79
+
80
+ /**
81
+ * Set the base URL that path and query parameters will be added to.
82
+ * @param $baseComponent string
83
+ */
84
+ public function setBaseComponent($baseComponent)
85
+ {
86
+ $this->baseComponent = rtrim($baseComponent, '/');
87
+ }
88
+
89
+ /**
90
+ * Enable support for gzipped responses with this request.
91
+ */
92
+ public function enableGzip()
93
+ {
94
+ $this->setRequestHeaders(array("Accept-Encoding" => "gzip"));
95
+ $this->canGzip = true;
96
+ $this->setUserAgent($this->userAgent);
97
+ }
98
+
99
+ /**
100
+ * Disable support for gzip responses with this request.
101
+ */
102
+ public function disableGzip()
103
+ {
104
+ if (
105
+ isset($this->requestHeaders['accept-encoding']) &&
106
+ $this->requestHeaders['accept-encoding'] == "gzip"
107
+ ) {
108
+ unset($this->requestHeaders['accept-encoding']);
109
+ }
110
+ $this->canGzip = false;
111
+ $this->userAgent = str_replace(self::GZIP_UA, "", $this->userAgent);
112
+ }
113
+
114
+ /**
115
+ * Can this request accept a gzip response?
116
+ * @return bool
117
+ */
118
+ public function canGzip()
119
+ {
120
+ return $this->canGzip;
121
+ }
122
+
123
+ /**
124
+ * Misc function that returns an array of the query parameters of the current
125
+ * url used by the OAuth signing class to calculate the signature
126
+ * @return array Query parameters in the query string.
127
+ */
128
+ public function getQueryParams()
129
+ {
130
+ return $this->queryParams;
131
+ }
132
+
133
+ /**
134
+ * Set a new query parameter.
135
+ * @param $key - string to set, does not need to be URL encoded
136
+ * @param $value - string to set, does not need to be URL encoded
137
+ */
138
+ public function setQueryParam($key, $value)
139
+ {
140
+ $this->queryParams[$key] = $value;
141
+ }
142
+
143
+ /**
144
+ * @return string HTTP Response Code.
145
+ */
146
+ public function getResponseHttpCode()
147
+ {
148
+ return (int) $this->responseHttpCode;
149
+ }
150
+
151
+ /**
152
+ * @param int $responseHttpCode HTTP Response Code.
153
+ */
154
+ public function setResponseHttpCode($responseHttpCode)
155
+ {
156
+ $this->responseHttpCode = $responseHttpCode;
157
+ }
158
+
159
+ /**
160
+ * @return $responseHeaders (array) HTTP Response Headers.
161
+ */
162
+ public function getResponseHeaders()
163
+ {
164
+ return $this->responseHeaders;
165
+ }
166
+
167
+ /**
168
+ * @return string HTTP Response Body
169
+ */
170
+ public function getResponseBody()
171
+ {
172
+ return $this->responseBody;
173
+ }
174
+
175
+ /**
176
+ * Set the class the response to this request should expect.
177
+ *
178
+ * @param $class string the class name
179
+ */
180
+ public function setExpectedClass($class)
181
+ {
182
+ $this->expectedClass = $class;
183
+ }
184
+
185
+ /**
186
+ * Retrieve the expected class the response should expect.
187
+ * @return string class name
188
+ */
189
+ public function getExpectedClass()
190
+ {
191
+ return $this->expectedClass;
192
+ }
193
+
194
+ /**
195
+ * Enable expected raw response
196
+ */
197
+ public function enableExpectedRaw()
198
+ {
199
+ $this->expectedRaw = true;
200
+ }
201
+
202
+ /**
203
+ * Disable expected raw response
204
+ */
205
+ public function disableExpectedRaw()
206
+ {
207
+ $this->expectedRaw = false;
208
+ }
209
+
210
+ /**
211
+ * Expected raw response or not.
212
+ * @return boolean expected raw response
213
+ */
214
+ public function getExpectedRaw()
215
+ {
216
+ return $this->expectedRaw;
217
+ }
218
+
219
+ /**
220
+ * @param array $headers The HTTP response headers
221
+ * to be normalized.
222
+ */
223
+ public function setResponseHeaders($headers)
224
+ {
225
+ $headers = Deconf_Utils::normalize($headers);
226
+ if ($this->responseHeaders) {
227
+ $headers = array_merge($this->responseHeaders, $headers);
228
+ }
229
+
230
+ $this->responseHeaders = $headers;
231
+ }
232
+
233
+ /**
234
+ * @param string $key
235
+ * @return array|boolean Returns the requested HTTP header or
236
+ * false if unavailable.
237
+ */
238
+ public function getResponseHeader($key)
239
+ {
240
+ return isset($this->responseHeaders[$key])
241
+ ? $this->responseHeaders[$key]
242
+ : false;
243
+ }
244
+
245
+ /**
246
+ * @param string $responseBody The HTTP response body.
247
+ */
248
+ public function setResponseBody($responseBody)
249
+ {
250
+ $this->responseBody = $responseBody;
251
+ }
252
+
253
+ /**
254
+ * @return string $url The request URL.
255
+ */
256
+ public function getUrl()
257
+ {
258
+ return $this->baseComponent . $this->path .
259
+ (count($this->queryParams) ?
260
+ "?" . $this->buildQuery($this->queryParams) :
261
+ '');
262
+ }
263
+
264
+ /**
265
+ * @return string $method HTTP Request Method.
266
+ */
267
+ public function getRequestMethod()
268
+ {
269
+ return $this->requestMethod;
270
+ }
271
+
272
+ /**
273
+ * @return array $headers HTTP Request Headers.
274
+ */
275
+ public function getRequestHeaders()
276
+ {
277
+ return $this->requestHeaders;
278
+ }
279
+
280
+ /**
281
+ * @param string $key
282
+ * @return array|boolean Returns the requested HTTP header or
283
+ * false if unavailable.
284
+ */
285
+ public function getRequestHeader($key)
286
+ {
287
+ return isset($this->requestHeaders[$key])
288
+ ? $this->requestHeaders[$key]
289
+ : false;
290
+ }
291
+
292
+ /**
293
+ * @return string $postBody HTTP Request Body.
294
+ */
295
+ public function getPostBody()
296
+ {
297
+ return $this->postBody;
298
+ }
299
+
300
+ /**
301
+ * @param string $url the url to set
302
+ */
303
+ public function setUrl($url)
304
+ {
305
+ if (substr($url, 0, 4) != 'http') {
306
+ // Force the path become relative.
307
+ if (substr($url, 0, 1) !== '/') {
308
+ $url = '/' . $url;
309
+ }
310
+ }
311
+ $parts = parse_url($url);
312
+ if (isset($parts['host'])) {
313
+ $this->baseComponent = sprintf(
314
+ "%s%s%s",
315
+ isset($parts['scheme']) ? $parts['scheme'] . "://" : '',
316
+ isset($parts['host']) ? $parts['host'] : '',
317
+ isset($parts['port']) ? ":" . $parts['port'] : ''
318
+ );
319
+ }
320
+ $this->path = isset($parts['path']) ? $parts['path'] : '';
321
+ $this->queryParams = array();
322
+ if (isset($parts['query'])) {
323
+ $this->queryParams = $this->parseQuery($parts['query']);
324
+ }
325
+ }
326
+
327
+ /**
328
+ * @param string $method Set he HTTP Method and normalize
329
+ * it to upper-case, as required by HTTP.
330
+ *
331
+ */
332
+ public function setRequestMethod($method)
333
+ {
334
+ $this->requestMethod = strtoupper($method);
335
+ }
336
+
337
+ /**
338
+ * @param array $headers The HTTP request headers
339
+ * to be set and normalized.
340
+ */
341
+ public function setRequestHeaders($headers)
342
+ {
343
+ $headers = Deconf_Utils::normalize($headers);
344
+ if ($this->requestHeaders) {
345
+ $headers = array_merge($this->requestHeaders, $headers);
346
+ }
347
+ $this->requestHeaders = $headers;
348
+ }
349
+
350
+ /**
351
+ * @param string $postBody the postBody to set
352
+ */
353
+ public function setPostBody($postBody)
354
+ {
355
+ $this->postBody = $postBody;
356
+ }
357
+
358
+ /**
359
+ * Set the User-Agent Header.
360
+ * @param string $userAgent The User-Agent.
361
+ */
362
+ public function setUserAgent($userAgent)
363
+ {
364
+ $this->userAgent = $userAgent;
365
+ if ($this->canGzip) {
366
+ $this->userAgent = $userAgent . self::GZIP_UA;
367
+ }
368
+ }
369
+
370
+ /**
371
+ * @return string The User-Agent.
372
+ */
373
+ public function getUserAgent()
374
+ {
375
+ return $this->userAgent;
376
+ }
377
+
378
+ /**
379
+ * Returns a cache key depending on if this was an OAuth signed request
380
+ * in which case it will use the non-signed url and access key to make this
381
+ * cache key unique per authenticated user, else use the plain request url
382
+ * @return string The md5 hash of the request cache key.
383
+ */
384
+ public function getCacheKey()
385
+ {
386
+ $key = $this->getUrl();
387
+
388
+ if (isset($this->accessKey)) {
389
+ $key .= $this->accessKey;
390
+ }
391
+
392
+ if (isset($this->requestHeaders['authorization'])) {
393
+ $key .= $this->requestHeaders['authorization'];
394
+ }
395
+
396
+ return md5($key);
397
+ }
398
+
399
+ public function getParsedCacheControl()
400
+ {
401
+ $parsed = array();
402
+ $rawCacheControl = $this->getResponseHeader('cache-control');
403
+ if ($rawCacheControl) {
404
+ $rawCacheControl = str_replace(', ', '&', $rawCacheControl);
405
+ parse_str($rawCacheControl, $parsed);
406
+ }
407
+
408
+ return $parsed;
409
+ }
410
+
411
+ /**
412
+ * @param string $id
413
+ * @return string A string representation of the HTTP Request.
414
+ */
415
+ public function toBatchString($id)
416
+ {
417
+ $str = '';
418
+ $path = parse_url($this->getUrl(), PHP_URL_PATH) . "?" .
419
+ http_build_query($this->queryParams, '', '&');
420
+ $str .= $this->getRequestMethod() . ' ' . $path . " HTTP/1.1\n";
421
+
422
+ foreach ($this->getRequestHeaders() as $key => $val) {
423
+ $str .= $key . ': ' . $val . "\n";
424
+ }
425
+
426
+ if ($this->getPostBody()) {
427
+ $str .= "\n";
428
+ $str .= $this->getPostBody();
429
+ }
430
+
431
+ $headers = '';
432
+ foreach ($this->batchHeaders as $key => $val) {
433
+ $headers .= $key . ': ' . $val . "\n";
434
+ }
435
+
436
+ $headers .= "Content-ID: $id\n";
437
+ $str = $headers . "\n" . $str;
438
+
439
+ return $str;
440
+ }
441
+
442
+ /**
443
+ * Our own version of parse_str that allows for multiple variables
444
+ * with the same name.
445
+ * @param $string - the query string to parse
446
+ */
447
+ private function parseQuery($string)
448
+ {
449
+ $return = array();
450
+ $parts = explode("&", $string);
451
+ foreach ($parts as $part) {
452
+ list($key, $value) = explode('=', $part, 2);
453
+ $value = urldecode($value);
454
+ if (isset($return[$key])) {
455
+ if (!is_array($return[$key])) {
456
+ $return[$key] = array($return[$key]);
457
+ }
458
+ $return[$key][] = $value;
459
+ } else {
460
+ $return[$key] = $value;
461
+ }
462
+ }
463
+ return $return;
464
+ }
465
+
466
+ /**
467
+ * A version of build query that allows for multiple
468
+ * duplicate keys.
469
+ * @param $parts array of key value pairs
470
+ */
471
+ private function buildQuery($parts)
472
+ {
473
+ $return = array();
474
+ foreach ($parts as $key => $value) {
475
+ if (is_array($value)) {
476
+ foreach ($value as $v) {
477
+ $return[] = urlencode($key) . "=" . urlencode($v);
478
+ }
479
+ } else {
480
+ $return[] = urlencode($key) . "=" . urlencode($value);
481
+ }
482
+ }
483
+ return implode('&', $return);
484
+ }
485
+
486
+ /**
487
+ * If we're POSTing and have no body to send, we can send the query
488
+ * parameters in there, which avoids length issues with longer query
489
+ * params.
490
+ */
491
+ public function maybeMoveParametersToBody()
492
+ {
493
+ if ($this->getRequestMethod() == "POST" && empty($this->postBody)) {
494
+ $this->setRequestHeaders(
495
+ array(
496
+ "content-type" =>
497
+ "application/x-www-form-urlencoded; charset=UTF-8"
498
+ )
499
+ );
500
+ $this->setPostBody($this->buildQuery($this->queryParams));
501
+ $this->queryParams = array();
502
+ }
503
+ }
504
+ }
tags/5.3.1/tools/src/Deconf/IO/Abstract.php ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Abstract IO base class
20
+ */
21
+
22
+ if (!class_exists('Deconf_Client')) {
23
+ require_once dirname(__FILE__) . '/../autoload.php';
24
+ }
25
+
26
+ abstract class Deconf_IO_Abstract
27
+ {
28
+ const UNKNOWN_CODE = 0;
29
+ const FORM_URLENCODED = 'application/x-www-form-urlencoded';
30
+ private static $CONNECTION_ESTABLISHED_HEADERS = array(
31
+ "HTTP/1.0 200 Connection established\r\n\r\n",
32
+ "HTTP/1.1 200 Connection established\r\n\r\n",
33
+ );
34
+ private static $ENTITY_HTTP_METHODS = array("POST" => null, "PUT" => null);
35
+ private static $HOP_BY_HOP = array(
36
+ 'connection' => true,
37
+ 'keep-alive' => true,
38
+ 'proxy-authenticate' => true,
39
+ 'proxy-authorization' => true,
40
+ 'te' => true,
41
+ 'trailers' => true,
42
+ 'transfer-encoding' => true,
43
+ 'upgrade' => true
44
+ );
45
+
46
+
47
+ /** @var Deconf_Client */
48
+ protected $client;
49
+
50
+ public function __construct(Deconf_Client $client)
51
+ {
52
+ $this->client = $client;
53
+ $timeout = $client->getClassConfig('Deconf_IO_Abstract', 'request_timeout_seconds');
54
+ if ($timeout > 0) {
55
+ $this->setTimeout($timeout);
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Executes a Deconf_Http_Request
61
+ * @param Deconf_Http_Request $request the http request to be executed
62
+ * @return array containing response headers, body, and http code
63
+ * @throws Deconf_IO_Exception on curl or IO error
64
+ */
65
+ abstract public function executeRequest(Deconf_Http_Request $request);
66
+
67
+ /**
68
+ * Set options that update the transport implementation's behavior.
69
+ * @param $options
70
+ */
71
+ abstract public function setOptions($options);
72
+
73
+ /**
74
+ * Set the maximum request time in seconds.
75
+ * @param $timeout in seconds
76
+ */
77
+ abstract public function setTimeout($timeout);
78
+
79
+ /**
80
+ * Get the maximum request time in seconds.
81
+ * @return timeout in seconds
82
+ */
83
+ abstract public function getTimeout();
84
+
85
+ /**
86
+ * Test for the presence of a cURL header processing bug
87
+ *
88
+ * The cURL bug was present in versions prior to 7.30.0 and caused the header
89
+ * length to be miscalculated when a "Connection established" header added by
90
+ * some proxies was present.
91
+ *
92
+ * @return boolean
93
+ */
94
+ abstract protected function needsQuirk();
95
+
96
+ /**
97
+ * @visible for testing.
98
+ * Cache the response to an HTTP request if it is cacheable.
99
+ * @param Deconf_Http_Request $request
100
+ * @return bool Returns true if the insertion was successful.
101
+ * Otherwise, return false.
102
+ */
103
+ public function setCachedRequest(Deconf_Http_Request $request)
104
+ {
105
+ // Determine if the request is cacheable.
106
+ if (Deconf_Http_CacheParser::isResponseCacheable($request)) {
107
+ $this->client->getCache()->set($request->getCacheKey(), $request);
108
+ return true;
109
+ }
110
+
111
+ return false;
112
+ }
113
+
114
+ /**
115
+ * Execute an HTTP Request
116
+ *
117
+ * @param Deconf_Http_Request $request the http request to be executed
118
+ * @return Deconf_Http_Request http request with the response http code,
119
+ * response headers and response body filled in
120
+ * @throws Deconf_IO_Exception on curl or IO error
121
+ */
122
+ public function makeRequest(Deconf_Http_Request $request)
123
+ {
124
+
125
+ // Add support for GADWP Endpoint
126
+ do_action('gadwp_endpoint_support', $request);
127
+
128
+ // First, check to see if we have a valid cached version.
129
+ $cached = $this->getCachedRequest($request);
130
+ if ($cached !== false && $cached instanceof Deconf_Http_Request) {
131
+ if (!$this->checkMustRevalidateCachedRequest($cached, $request)) {
132
+ return $cached;
133
+ }
134
+ }
135
+
136
+ if (array_key_exists($request->getRequestMethod(), self::$ENTITY_HTTP_METHODS)) {
137
+ $request = $this->processEntityRequest($request);
138
+ }
139
+
140
+ list($responseData, $responseHeaders, $respHttpCode) = $this->executeRequest($request);
141
+
142
+ if ($respHttpCode == 304 && $cached) {
143
+ // If the server responded NOT_MODIFIED, return the cached request.
144
+ $this->updateCachedRequest($cached, $responseHeaders);
145
+ return $cached;
146
+ }
147
+
148
+ if (!isset($responseHeaders['Date']) && !isset($responseHeaders['date'])) {
149
+ $responseHeaders['date'] = date("r");
150
+ }
151
+
152
+ $request->setResponseHttpCode($respHttpCode);
153
+ $request->setResponseHeaders($responseHeaders);
154
+ $request->setResponseBody($responseData);
155
+ // Store the request in cache (the function checks to see if the request
156
+ // can actually be cached)
157
+ $this->setCachedRequest($request);
158
+ return $request;
159
+ }
160
+
161
+ /**
162
+ * @visible for testing.
163
+ * @param Deconf_Http_Request $request
164
+ * @return Deconf_Http_Request|bool Returns the cached object or
165
+ * false if the operation was unsuccessful.
166
+ */
167
+ public function getCachedRequest(Deconf_Http_Request $request)
168
+ {
169
+ if (false === Deconf_Http_CacheParser::isRequestCacheable($request)) {
170
+ return false;
171
+ }
172
+
173
+ return $this->client->getCache()->get($request->getCacheKey());
174
+ }
175
+
176
+ /**
177
+ * @visible for testing
178
+ * Process an http request that contains an enclosed entity.
179
+ * @param Deconf_Http_Request $request
180
+ * @return Deconf_Http_Request Processed request with the enclosed entity.
181
+ */
182
+ public function processEntityRequest(Deconf_Http_Request $request)
183
+ {
184
+ $postBody = $request->getPostBody();
185
+ $contentType = $request->getRequestHeader("content-type");
186
+
187
+ // Set the default content-type as application/x-www-form-urlencoded.
188
+ if (false == $contentType) {
189
+ $contentType = self::FORM_URLENCODED;
190
+ $request->setRequestHeaders(array('content-type' => $contentType));
191
+ }
192
+
193
+ // Force the payload to match the content-type asserted in the header.
194
+ if ($contentType == self::FORM_URLENCODED && is_array($postBody)) {
195
+ $postBody = http_build_query($postBody, '', '&');
196
+ $request->setPostBody($postBody);
197
+ }
198
+
199
+ // Make sure the content-length header is set.
200
+ if (!$postBody || is_string($postBody)) {
201
+ $postsLength = strlen($postBody);
202
+ $request->setRequestHeaders(array('content-length' => $postsLength));
203
+ }
204
+
205
+ return $request;
206
+ }
207
+
208
+ /**
209
+ * Check if an already cached request must be revalidated, and if so update
210
+ * the request with the correct ETag headers.
211
+ * @param Deconf_Http_Request $cached A previously cached response.
212
+ * @param Deconf_Http_Request $request The outbound request.
213
+ * return bool If the cached object needs to be revalidated, false if it is
214
+ * still current and can be re-used.
215
+ */
216
+ protected function checkMustRevalidateCachedRequest($cached, $request)
217
+ {
218
+ if (Deconf_Http_CacheParser::mustRevalidate($cached)) {
219
+ $addHeaders = array();
220
+ if ($cached->getResponseHeader('etag')) {
221
+ // [13.3.4] If an entity tag has been provided by the origin server,
222
+ // we must use that entity tag in any cache-conditional request.
223
+ $addHeaders['If-None-Match'] = $cached->getResponseHeader('etag');
224
+ } elseif ($cached->getResponseHeader('date')) {
225
+ $addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date');
226
+ }
227
+
228
+ $request->setRequestHeaders($addHeaders);
229
+ return true;
230
+ } else {
231
+ return false;
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Update a cached request, using the headers from the last response.
237
+ * @param Deconf_Http_Request $cached A previously cached response.
238
+ * @param mixed Associative array of response headers from the last request.
239
+ */
240
+ protected function updateCachedRequest($cached, $responseHeaders)
241
+ {
242
+ $hopByHop = self::$HOP_BY_HOP;
243
+ if (!empty($responseHeaders['connection'])) {
244
+ $connectionHeaders = array_map(
245
+ 'strtolower',
246
+ array_filter(
247
+ array_map('trim', explode(',', $responseHeaders['connection']))
248
+ )
249
+ );
250
+ $hopByHop += array_fill_keys($connectionHeaders, true);
251
+ }
252
+
253
+ $endToEnd = array_diff_key($responseHeaders, $hopByHop);
254
+ $cached->setResponseHeaders($endToEnd);
255
+ }
256
+
257
+ /**
258
+ * Used by the IO lib and also the batch processing.
259
+ *
260
+ * @param $respData
261
+ * @param $headerSize
262
+ * @return array
263
+ */
264
+ public function parseHttpResponse($respData, $headerSize)
265
+ {
266
+ // check proxy header
267
+ foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) {
268
+ if (stripos($respData, $established_header) !== false) {
269
+ // existed, remove it
270
+ $respData = str_ireplace($established_header, '', $respData);
271
+ // Subtract the proxy header size unless the cURL bug prior to 7.30.0
272
+ // is present which prevented the proxy header size from being taken into
273
+ // account.
274
+ if (!$this->needsQuirk()) {
275
+ $headerSize -= strlen($established_header);
276
+ }
277
+ break;
278
+ }
279
+ }
280
+
281
+ if ($headerSize) {
282
+ $responseBody = substr($respData, $headerSize);
283
+ $responseHeaders = substr($respData, 0, $headerSize);
284
+ } else {
285
+ $responseSegments = explode("\r\n\r\n", $respData, 2);
286
+ $responseHeaders = $responseSegments[0];
287
+ $responseBody = isset($responseSegments[1]) ? $responseSegments[1] :
288
+ null;
289
+ }
290
+
291
+ $responseHeaders = $this->getHttpResponseHeaders($responseHeaders);
292
+ return array($responseHeaders, $responseBody);
293
+ }
294
+
295
+ /**
296
+ * Parse out headers from raw headers
297
+ * @param rawHeaders array or string
298
+ * @return array
299
+ */
300
+ public function getHttpResponseHeaders($rawHeaders)
301
+ {
302
+ if (is_array($rawHeaders)) {
303
+ return $this->parseArrayHeaders($rawHeaders);
304
+ } else {
305
+ return $this->parseStringHeaders($rawHeaders);
306
+ }
307
+ }
308
+
309
+ private function parseStringHeaders($rawHeaders)
310
+ {
311
+ $headers = array();
312
+ $responseHeaderLines = explode("\r\n", $rawHeaders);
313
+ foreach ($responseHeaderLines as $headerLine) {
314
+ if ($headerLine && strpos($headerLine, ':') !== false) {
315
+ list($header, $value) = explode(': ', $headerLine, 2);
316
+ $header = strtolower($header);
317
+ if (isset($headers[$header])) {
318
+ $headers[$header] .= "\n" . $value;
319
+ } else {
320
+ $headers[$header] = $value;
321
+ }
322
+ }
323
+ }
324
+ return $headers;
325
+ }
326
+
327
+ private function parseArrayHeaders($rawHeaders)
328
+ {
329
+ $header_count = count($rawHeaders);
330
+ $headers = array();
331
+
332
+ for ($i = 0; $i < $header_count; $i++) {
333
+ $header = $rawHeaders[$i];
334
+ // Times will have colons in - so we just want the first match.
335
+ $header_parts = explode(': ', $header, 2);
336
+ if (count($header_parts) == 2) {
337
+ $headers[strtolower($header_parts[0])] = $header_parts[1];
338
+ }
339
+ }
340
+
341
+ return $headers;
342
+ }
343
+ }
tags/5.3.1/tools/src/Deconf/IO/Curl.php ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Curl based implementation of Deconf_IO.
20
+ *
21
+ * @author Stuart Langley <slangley@google.com>
22
+ */
23
+
24
+ if (!class_exists('Deconf_Client')) {
25
+ require_once dirname(__FILE__) . '/../autoload.php';
26
+ }
27
+
28
+ class Deconf_IO_Curl extends Deconf_IO_Abstract
29
+ {
30
+ // cURL hex representation of version 7.30.0
31
+ const NO_QUIRK_VERSION = 0x071E00;
32
+
33
+ private $options = array();
34
+
35
+ /** @var bool $disableProxyWorkaround */
36
+ private $disableProxyWorkaround;
37
+
38
+ public function __construct(Deconf_Client $client)
39
+ {
40
+ if (!extension_loaded('curl')) {
41
+ $error = 'The cURL IO handler requires the cURL extension to be enabled';
42
+ $client->getLogger()->critical($error);
43
+ throw new Deconf_IO_Exception($error);
44
+ }
45
+
46
+ parent::__construct($client);
47
+
48
+ $this->disableProxyWorkaround = $this->client->getClassConfig(
49
+ 'Deconf_IO_Curl',
50
+ 'disable_proxy_workaround'
51
+ );
52
+ }
53
+
54
+ /**
55
+ * Execute an HTTP Request
56
+ *
57
+ * @param Deconf_Http_Request $request the http request to be executed
58
+ * @return array containing response headers, body, and http code
59
+ * @throws Deconf_IO_Exception on curl or IO error
60
+ */
61
+ public function executeRequest(Deconf_Http_Request $request)
62
+ {
63
+ $curl = curl_init();
64
+
65
+ if ($request->getPostBody()) {
66
+ curl_setopt($curl, CURLOPT_POSTFIELDS, $request->getPostBody());
67
+ }
68
+
69
+ $requestHeaders = $request->getRequestHeaders();
70
+ if ($requestHeaders && is_array($requestHeaders)) {
71
+ $curlHeaders = array();
72
+ foreach ($requestHeaders as $k => $v) {
73
+ $curlHeaders[] = "$k: $v";
74
+ }
75
+ curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaders);
76
+ }
77
+ curl_setopt($curl, CURLOPT_URL, $request->getUrl());
78
+
79
+ curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $request->getRequestMethod());
80
+ curl_setopt($curl, CURLOPT_USERAGENT, $request->getUserAgent());
81
+
82
+ curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);
83
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
84
+
85
+ // The SSL version will be determined by the underlying library
86
+ // @see https://github.com/google/google-api-php-client/pull/644
87
+ //curl_setopt($curl, CURLOPT_SSLVERSION, 1);
88
+
89
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
90
+ curl_setopt($curl, CURLOPT_HEADER, true);
91
+
92
+ if ($request->canGzip()) {
93
+ curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
94
+ }
95
+
96
+ $options = $this->client->getClassConfig('Deconf_IO_Curl', 'options');
97
+ if (is_array($options)) {
98
+ $this->setOptions($options);
99
+ }
100
+
101
+ foreach ($this->options as $key => $var) {
102
+ curl_setopt($curl, $key, $var);
103
+ }
104
+
105
+ if (!isset($this->options[CURLOPT_CAINFO])) {
106
+ curl_setopt($curl, CURLOPT_CAINFO, dirname(__FILE__) . '/cacerts.pem');
107
+ }
108
+
109
+ $this->client->getLogger()->debug(
110
+ 'cURL request',
111
+ array(
112
+ 'url' => $request->getUrl(),
113
+ 'method' => $request->getRequestMethod(),
114
+ 'headers' => $requestHeaders,
115
+ 'body' => $request->getPostBody()
116
+ )
117
+ );
118
+
119
+ $response = curl_exec($curl);
120
+ if ($response === false) {
121
+ $error = curl_error($curl);
122
+ $code = curl_errno($curl);
123
+ $map = $this->client->getClassConfig('Deconf_IO_Exception', 'retry_map');
124
+
125
+ $this->client->getLogger()->error('cURL ' . $error);
126
+ throw new Deconf_IO_Exception($error, $code, null, $map);
127
+ }
128
+ $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
129
+
130
+ list($responseHeaders, $responseBody) = $this->parseHttpResponse($response, $headerSize);
131
+ $responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
132
+
133
+ $this->client->getLogger()->debug(
134
+ 'cURL response',
135
+ array(
136
+ 'code' => $responseCode,
137
+ 'headers' => $responseHeaders,
138
+ 'body' => $responseBody,
139
+ )
140
+ );
141
+
142
+ return array($responseBody, $responseHeaders, $responseCode);
143
+ }
144
+
145
+ /**
146
+ * Set options that update the transport implementation's behavior.
147
+ * @param $options
148
+ */
149
+ public function setOptions($options)
150
+ {
151
+ $this->options = $options + $this->options;
152
+ }
153
+
154
+ /**
155
+ * Set the maximum request time in seconds.
156
+ * @param $timeout in seconds
157
+ */
158
+ public function setTimeout($timeout)
159
+ {
160
+ // Since this timeout is really for putting a bound on the time
161
+ // we'll set them both to the same. If you need to specify a longer
162
+ // CURLOPT_TIMEOUT, or a higher CONNECTTIMEOUT, the best thing to
163
+ // do is use the setOptions method for the values individually.
164
+ $this->options[CURLOPT_CONNECTTIMEOUT] = $timeout;
165
+ $this->options[CURLOPT_TIMEOUT] = $timeout;
166
+ }
167
+
168
+ /**
169
+ * Get the maximum request time in seconds.
170
+ * @return timeout in seconds
171
+ */
172
+ public function getTimeout()
173
+ {
174
+ return $this->options[CURLOPT_TIMEOUT];
175
+ }
176
+
177
+ /**
178
+ * Test for the presence of a cURL header processing bug
179
+ *
180
+ * {@inheritDoc}
181
+ *
182
+ * @return boolean
183
+ */
184
+ protected function needsQuirk()
185
+ {
186
+ if ($this->disableProxyWorkaround) {
187
+ return false;
188
+ }
189
+
190
+ $ver = curl_version();
191
+ $versionNum = $ver['version_number'];
192
+ return $versionNum < Deconf_IO_Curl::NO_QUIRK_VERSION;
193
+ }
194
+ }
tags/5.3.1/tools/src/Deconf/IO/Exception.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ class Deconf_IO_Exception extends Deconf_Exception implements Deconf_Task_Retryable
23
+ {
24
+ /**
25
+ * @var array $retryMap Map of errors with retry counts.
26
+ */
27
+ private $retryMap = array();
28
+
29
+ /**
30
+ * Creates a new IO exception with an optional retry map.
31
+ *
32
+ * @param string $message
33
+ * @param int $code
34
+ * @param Exception|null $previous
35
+ * @param array|null $retryMap Map of errors with retry counts.
36
+ */
37
+ public function __construct(
38
+ $message,
39
+ $code = 0,
40
+ Exception $previous = null,
41
+ array $retryMap = null
42
+ ) {
43
+ if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
44
+ parent::__construct($message, $code, $previous);
45
+ } else {
46
+ parent::__construct($message, $code);
47
+ }
48
+
49
+ if (is_array($retryMap)) {
50
+ $this->retryMap = $retryMap;
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Gets the number of times the associated task can be retried.
56
+ *
57
+ * NOTE: -1 is returned if the task can be retried indefinitely
58
+ *
59
+ * @return integer
60
+ */
61
+ public function allowedRetries()
62
+ {
63
+ if (isset($this->retryMap[$this->code])) {
64
+ return $this->retryMap[$this->code];
65
+ }
66
+
67
+ return 0;
68
+ }
69
+ }
tags/5.3.1/tools/src/Deconf/IO/Stream.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2013 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Http Streams based implementation of Deconf_IO.
20
+ *
21
+ * @author Stuart Langley <slangley@google.com>
22
+ */
23
+
24
+ if (!class_exists('Deconf_Client')) {
25
+ require_once dirname(__FILE__) . '/../autoload.php';
26
+ }
27
+
28
+ class Deconf_IO_Stream extends Deconf_IO_Abstract
29
+ {
30
+ const TIMEOUT = "timeout";
31
+ const ZLIB = "compress.zlib://";
32
+ private $options = array();
33
+ private $trappedErrorNumber;
34
+ private $trappedErrorString;
35
+
36
+ private static $DEFAULT_HTTP_CONTEXT = array(
37
+ "follow_location" => 0,
38
+ "ignore_errors" => 1,
39
+ );
40
+
41
+ private static $DEFAULT_SSL_CONTEXT = array(
42
+ "verify_peer" => true,
43
+ );
44
+
45
+ public function __construct(Deconf_Client $client)
46
+ {
47
+ if (!ini_get('allow_url_fopen')) {
48
+ $error = 'The stream IO handler requires the allow_url_fopen runtime ' .
49
+ 'configuration to be enabled';
50
+ $client->getLogger()->critical($error);
51
+ throw new Deconf_IO_Exception($error);
52
+ }
53
+
54
+ parent::__construct($client);
55
+ }
56
+
57
+ /**
58
+ * Execute an HTTP Request
59
+ *
60
+ * @param Deconf_Http_Request $request the http request to be executed
61
+ * @return array containing response headers, body, and http code
62
+ * @throws Deconf_IO_Exception on curl or IO error
63
+ */
64
+ public function executeRequest(Deconf_Http_Request $request)
65
+ {
66
+ $default_options = stream_context_get_options(stream_context_get_default());
67
+
68
+ $requestHttpContext = array_key_exists('http', $default_options) ?
69
+ $default_options['http'] : array();
70
+
71
+ if ($request->getPostBody()) {
72
+ $requestHttpContext["content"] = $request->getPostBody();
73
+ }
74
+
75
+ $requestHeaders = $request->getRequestHeaders();
76
+ if ($requestHeaders && is_array($requestHeaders)) {
77
+ $headers = "";
78
+ foreach ($requestHeaders as $k => $v) {
79
+ $headers .= "$k: $v\r\n";
80
+ }
81
+ $requestHttpContext["header"] = $headers;
82
+ }
83
+
84
+ $requestHttpContext["method"] = $request->getRequestMethod();
85
+ $requestHttpContext["user_agent"] = $request->getUserAgent();
86
+
87
+ $requestSslContext = array_key_exists('ssl', $default_options) ?
88
+ $default_options['ssl'] : array();
89
+
90
+ // Add support for GADWP Endpoint
91
+ $requestSslContext = apply_filters('gadwp_endpoint_stream_options', $requestSslContext, $request);
92
+
93
+ if (!$this->client->isAppEngine() && !array_key_exists("cafile", $requestSslContext)) {
94
+ $requestSslContext["cafile"] = dirname(__FILE__) . '/cacerts.pem';
95
+ }
96
+
97
+ $options = array(
98
+ "http" => array_merge(
99
+ self::$DEFAULT_HTTP_CONTEXT,
100
+ $requestHttpContext
101
+ ),
102
+ "ssl" => array_merge(
103
+ self::$DEFAULT_SSL_CONTEXT,
104
+ $requestSslContext
105
+ )
106
+ );
107
+
108
+ $context = stream_context_create($options);
109
+
110
+ $url = $request->getUrl();
111
+
112
+ if ($request->canGzip()) {
113
+ $url = self::ZLIB . $url;
114
+ }
115
+
116
+ $this->client->getLogger()->debug(
117
+ 'Stream request',
118
+ array(
119
+ 'url' => $url,
120
+ 'method' => $request->getRequestMethod(),
121
+ 'headers' => $requestHeaders,
122
+ 'body' => $request->getPostBody()
123
+ )
124
+ );
125
+
126
+ // We are trapping any thrown errors in this method only and
127
+ // throwing an exception.
128
+ $this->trappedErrorNumber = null;
129
+ $this->trappedErrorString = null;
130
+
131
+ // START - error trap.
132
+ set_error_handler(array($this, 'trapError'));
133
+ $fh = fopen($url, 'r', false, $context);
134
+ restore_error_handler();
135
+ // END - error trap.
136
+
137
+ if ($this->trappedErrorNumber) {
138
+ $error = sprintf(
139
+ "HTTP Error: Unable to connect: '%s'",
140
+ $this->trappedErrorString
141
+ );
142
+
143
+ $this->client->getLogger()->error('Stream ' . $error);
144
+ throw new Deconf_IO_Exception($error, $this->trappedErrorNumber);
145
+ }
146
+
147
+ $response_data = false;
148
+ $respHttpCode = self::UNKNOWN_CODE;
149
+ if ($fh) {
150
+ if (isset($this->options[self::TIMEOUT])) {
151
+ stream_set_timeout($fh, $this->options[self::TIMEOUT]);
152
+ }
153
+
154
+ $response_data = stream_get_contents($fh);
155
+ fclose($fh);
156
+
157
+ $respHttpCode = $this->getHttpResponseCode($http_response_header);
158
+ }
159
+
160
+ if (false === $response_data) {
161
+ $error = sprintf(
162
+ "HTTP Error: Unable to connect: '%s'",
163
+ $respHttpCode
164
+ );
165
+
166
+ $this->client->getLogger()->error('Stream ' . $error);
167
+ throw new Deconf_IO_Exception($error, $respHttpCode);
168
+ }
169
+
170
+ $responseHeaders = $this->getHttpResponseHeaders($http_response_header);
171
+
172
+ $this->client->getLogger()->debug(
173
+ 'Stream response',
174
+ array(
175
+ 'code' => $respHttpCode,
176
+ 'headers' => $responseHeaders,
177
+ 'body' => $response_data,
178
+ )
179
+ );
180
+
181
+ return array($response_data, $responseHeaders, $respHttpCode);
182
+ }
183
+
184
+ /**
185
+ * Set options that update the transport implementation's behavior.
186
+ * @param $options
187
+ */
188
+ public function setOptions($options)
189
+ {
190
+ $this->options = $options + $this->options;
191
+ }
192
+
193
+ /**
194
+ * Method to handle errors, used for error handling around
195
+ * stream connection methods.
196
+ */
197
+ public function trapError($errno, $errstr)
198
+ {
199
+ $this->trappedErrorNumber = $errno;
200
+ $this->trappedErrorString = $errstr;
201
+ }
202
+
203
+ /**
204
+ * Set the maximum request time in seconds.
205
+ * @param $timeout in seconds
206
+ */
207
+ public function setTimeout($timeout)
208
+ {
209
+ $this->options[self::TIMEOUT] = $timeout;
210
+ }
211
+
212
+ /**
213
+ * Get the maximum request time in seconds.
214
+ * @return timeout in seconds
215
+ */
216
+ public function getTimeout()
217
+ {
218
+ return $this->options[self::TIMEOUT];
219
+ }
220
+
221
+ /**
222
+ * Test for the presence of a cURL header processing bug
223
+ *
224
+ * {@inheritDoc}
225
+ *
226
+ * @return boolean
227
+ */
228
+ protected function needsQuirk()
229
+ {
230
+ return false;
231
+ }
232
+
233
+ protected function getHttpResponseCode($response_headers)
234
+ {
235
+ $header_count = count($response_headers);
236
+
237
+ for ($i = 0; $i < $header_count; $i++) {
238
+ $header = $response_headers[$i];
239
+ if (strncasecmp("HTTP", $header, strlen("HTTP")) == 0) {
240
+ $response = explode(' ', $header);
241
+ return $response[1];
242
+ }
243
+ }
244
+ return self::UNKNOWN_CODE;
245
+ }
246
+ }
tags/5.3.1/tools/src/Deconf/IO/cacerts.pem ADDED
@@ -0,0 +1,2233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Issuer: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc.
2
+ # Subject: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc.
3
+ # Label: "GTE CyberTrust Global Root"
4
+ # Serial: 421
5
+ # MD5 Fingerprint: ca:3d:d3:68:f1:03:5c:d0:32:fa:b8:2b:59:e8:5a:db
6
+ # SHA1 Fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74
7
+ # SHA256 Fingerprint: a5:31:25:18:8d:21:10:aa:96:4b:02:c7:b7:c6:da:32:03:17:08:94:e5:fb:71:ff:fb:66:67:d5:e6:81:0a:36
8
+ -----BEGIN CERTIFICATE-----
9
+ MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD
10
+ VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
11
+ bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv
12
+ b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV
13
+ UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU
14
+ cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds
15
+ b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH
16
+ iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS
17
+ r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4
18
+ 04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r
19
+ GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9
20
+ 3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P
21
+ lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/
22
+ -----END CERTIFICATE-----
23
+
24
+ # Issuer: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division
25
+ # Subject: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division
26
+ # Label: "Thawte Server CA"
27
+ # Serial: 1
28
+ # MD5 Fingerprint: c5:70:c4:a2:ed:53:78:0c:c8:10:53:81:64:cb:d0:1d
29
+ # SHA1 Fingerprint: 23:e5:94:94:51:95:f2:41:48:03:b4:d5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 EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG
46
+ 7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e
47
+ QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ
48
+ qdq5snUb9kLy78fyGPmJvKP/iiMucEc=
49
+ -----END CERTIFICATE-----
50
+
51
+ # Issuer: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division
52
+ # Subject: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division
53
+ # Label: "Thawte Premium Server CA"
54
+ # Serial: 1
55
+ # MD5 Fingerprint: 06:9f:69:79:16:66:90:02:1b:8c:8c:a2:c3:07:6f:3a
56
+ # SHA1 Fingerprint: 62:7f:8d:78:27:65:63:99:d2:7d:7f:90:44:c9:fe:b3:f3:3e:fa:9a
57
+ # SHA256 Fingerprint: ab:70:36:36:5c:71:54:aa:29:c2:c2:9f:5d:41:91:16:3b:16:2a:22:25:01:13:57:d5:6d:07:ff:a7:bc:1f:72
58
+ -----BEGIN CERTIFICATE-----
59
+ MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx
60
+ FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD
61
+ VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv
62
+ biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy
63
+ dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
64
+ MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB
65
+ MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG
66
+ A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp
67
+ b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl
68
+ cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
69
+ bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE
70
+ VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ
71
+ ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR
72
+ uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG
73
+ 9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI
74
+ hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM
75
+ pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg==
76
+ -----END CERTIFICATE-----
77
+
78
+ # Issuer: O=Equifax OU=Equifax Secure Certificate Authority
79
+ # Subject: O=Equifax OU=Equifax Secure Certificate Authority
80
+ # Label: "Equifax Secure CA"
81
+ # Serial: 903804111
82
+ # MD5 Fingerprint: 67:cb:9d:c0:13:24:8a:82:9b:b2:17:1e:d1:1b:ec:d4
83
+ # SHA1 Fingerprint: d2:32:09:ad:23:d3:14:23:21:74:e4:0d:7f:9d:62:13:97:86:63:3a
84
+ # SHA256 Fingerprint: 08:29:7a:40:47:db:a2:36:80:c7:31:db:6e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961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y
101
+ 7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh
102
+ 1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4
103
+ -----END CERTIFICATE-----
104
+
105
+ # Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
106
+ # Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
107
+ # Label: "Verisign Class 3 Public Primary Certification Authority"
108
+ # Serial: 149843929435818692848040365716851702463
109
+ # MD5 Fingerprint: 10:fc:63:5d:f6:26:3e:0d:f3:25:be:5f:79:cd:67:67
110
+ # SHA1 Fingerprint: 74:2c:31:92:e6:07:e4:24:eb:45:49:54:2b:e1:bb:c5:3e:61:74:e2
111
+ # SHA256 Fingerprint: e7:68:56:34:ef:ac:f6:9a:ce:93:9a:6b:25:5b:7b:4f:ab:ef:42:93:5b:50:a2:65:ac:b5:cb:60:27:e4:4e:70
112
+ -----BEGIN CERTIFICATE-----
113
+ MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
114
+ A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
115
+ cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
116
+ MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
117
+ BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
118
+ YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
119
+ ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
120
+ BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
121
+ I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
122
+ CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
123
+ lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
124
+ AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
125
+ -----END CERTIFICATE-----
126
+
127
+ # Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network
128
+ # Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network
129
+ # Label: "Verisign Class 3 Public Primary Certification Authority - G2"
130
+ # Serial: 167285380242319648451154478808036881606
131
+ # MD5 Fingerprint: a2:33:9b:4c:74:78:73:d4:6c:e7:c1:f3:8d:cb:5c:e9
132
+ # SHA1 Fingerprint: 85:37:1c:a6:e5:50:14:3d:ce:28:03:47:1b:de:3a:09:e8:f8:77:0f
133
+ # SHA256 Fingerprint: 83:ce:3c:12:29:68:8a:59:3d:48:5f:81:97:3c:0f:91:95:43:1e:da:37:cc:5e:36:43:0e:79:c7:a8:88:63:8b
134
+ -----BEGIN CERTIFICATE-----
135
+ MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ
136
+ BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh
137
+ c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy
138
+ MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp
139
+ emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X
140
+ DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw
141
+ FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg
142
+ UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo
143
+ YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5
144
+ MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB
145
+ AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4
146
+ pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0
147
+ 13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID
148
+ AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk
149
+ U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i
150
+ F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY
151
+ oJ2daZH9
152
+ -----END CERTIFICATE-----
153
+
154
+ # Issuer: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA
155
+ # Subject: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA
156
+ # Label: "GlobalSign Root CA"
157
+ # Serial: 4835703278459707669005204
158
+ # MD5 Fingerprint: 3e:45:52:15:09:51:92:e1:b7:5d:37:9f:b1:87:29:8a
159
+ # SHA1 Fingerprint: b1:bc:96:8b:d4:f4:9d:62:2a:a8:9a:81:f2:15:01:52:a4:1d:82:9c
160
+ # SHA256 Fingerprint: eb:d4:10:40:e4:bb:3e:c7:42:c9:e3:81:d3:1e:f2:a4:1a:48:b6:68:5c:96:e7:ce:f3:c1:df:6c:d4:33:1c:99
161
+ -----BEGIN CERTIFICATE-----
162
+ MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
163
+ A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
164
+ b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
165
+ MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
166
+ YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
167
+ aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
168
+ jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
169
+ xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
170
+ 1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
171
+ snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
172
+ U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
173
+ 9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
174
+ BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
175
+ AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
176
+ yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
177
+ 38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
178
+ AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
179
+ DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
180
+ HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
181
+ -----END CERTIFICATE-----
182
+
183
+ # Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2
184
+ # Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2
185
+ # Label: "GlobalSign Root CA - R2"
186
+ # Serial: 4835703278459682885658125
187
+ # MD5 Fingerprint: 94:14:77:7e:3e:5e:fd:8f:30:bd:41:b0:cf:e7:d0:30
188
+ # SHA1 Fingerprint: 75:e0:ab:b6:13:85:12:27:1c:04:f8:5f:dd:de:38:e4:b7:24:2e:fe
189
+ # SHA256 Fingerprint: ca:42:dd:41:74:5f:d0:b8:1e:b9:02:36:2c:f9:d8:bf:71:9d:a1:bd:1b:1e:fc:94:6f:5b:4c:99:f4:2c:1b:9e
190
+ -----BEGIN CERTIFICATE-----
191
+ MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G
192
+ A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp
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5uRHg5h6h+u/N5GJG79G+dwfCMNYxd
209
+ AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
210
+ TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
211
+ -----END CERTIFICATE-----
212
+
213
+ # Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority
214
+ # Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority
215
+ # Label: "ValiCert Class 1 VA"
216
+ # Serial: 1
217
+ # MD5 Fingerprint: 65:58:ab:15:ad:57:6c:1e:a8:a7:b5:69:ac:bf:ff:eb
218
+ # SHA1 Fingerprint: e5:df:74:3c:b6:01:c4:9b:98:43:dc:ab:8c:e8:6a:81:10:9f:e4:8e
219
+ # SHA256 Fingerprint: f4:c1:49:55:1a:30:13:a3:5b:c7:bf:fe:17:a7:f3:44:9b:c1:ab:5b:5a:0a:e7:4b:06:c2:3b:90:00:4c:01:04
220
+ -----BEGIN CERTIFICATE-----
221
+ MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
222
+ IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
223
+ BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
224
+ aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
225
+ 9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy
226
+ NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
227
+ azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
228
+ YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
229
+ Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
230
+ cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y
231
+ LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+
232
+ TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y
233
+ TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0
234
+ LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW
235
+ I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw
236
+ nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI
237
+ -----END CERTIFICATE-----
238
+
239
+ # Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority
240
+ # Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority
241
+ # Label: "ValiCert Class 2 VA"
242
+ # Serial: 1
243
+ # MD5 Fingerprint: a9:23:75:9b:ba:49:36:6e:31:c2:db:f2:e7:66:ba:87
244
+ # SHA1 Fingerprint: 31:7a:2a:d0:7f:2b:33:5e:f5:a1:c3:4e:4b:57:e8:b7:d8:f1:fc:a6
245
+ # SHA256 Fingerprint: 58:d0:17:27:9c:d4:dc:63:ab:dd:b1:96:a6:c9:90:6c:30:c4:e0:87:83:ea:e8:c1:60:99:54:d6:93:55:59:6b
246
+ -----BEGIN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lcg5Ktz885hZo+L7tdEy8W9ViH0Pd
263
+ -----END CERTIFICATE-----
264
+
265
+ # Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority
266
+ # Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority
267
+ # Label: "RSA Root Certificate 1"
268
+ # Serial: 1
269
+ # MD5 Fingerprint: a2:6f:53:b7:ee:40:db:4a:68:e7:fa:18:d9:10:4b:72
270
+ # SHA1 Fingerprint: 69:bd:8c:f4:9c:d3:00:fb:59:2e:17:93:ca:55:6a:f3:ec:aa:35:fb
271
+ # SHA256 Fingerprint: bc:23:f9:8a:31:3c:b9:2d:e3:bb:fc:3a:5a:9f:44:61:ac:39:49:4c:4a:e1:5a:9e:9d:f1:31:e9:9b:73:01:9a
272
+ -----BEGIN CERTIFICATE-----
273
+ MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
274
+ IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
275
+ BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
276
+ aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
277
+ 9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy
278
+ NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
279
+ azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
280
+ YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
281
+ Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
282
+ cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD
283
+ cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs
284
+ 2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY
285
+ JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE
286
+ Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ
287
+ n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A
288
+ PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu
289
+ -----END CERTIFICATE-----
290
+
291
+ # Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only
292
+ # Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only
293
+ # Label: "Verisign Class 3 Public Primary Certification Authority - G3"
294
+ # Serial: 206684696279472310254277870180966723415
295
+ # MD5 Fingerprint: cd:68:b6:a7:c7:c4:ce:75:e0:1d:4f:57:44:61:92:09
296
+ # SHA1 Fingerprint: 13:2d:0d:45:53:4b:69:97:cd:b2:d5:c3:39:e2:55:76:60:9b:5c:c6
297
+ # SHA256 Fingerprint: eb:04:cf:5e:b1:f3:9a:fa:76:2f:2b:b1:20:f2:96:cb:a5:20:c1:b9:7d:b1:58:95:65:b8:1c:b9:a1:7b:72:44
298
+ -----BEGIN CERTIFICATE-----
299
+ MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA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u
315
+ imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te
316
+ 2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe
317
+ DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
318
+ /Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p
319
+ F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt
320
+ TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
321
+ -----END CERTIFICATE-----
322
+
323
+ # Issuer: CN=VeriSign Class 4 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only
324
+ # Subject: CN=VeriSign Class 4 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only
325
+ # Label: "Verisign Class 4 Public Primary Certification Authority - G3"
326
+ # Serial: 314531972711909413743075096039378935511
327
+ # MD5 Fingerprint: db:c8:f2:27:2e:b1:ea:6a:29:23:5d:fe:56:3e:33:df
328
+ # SHA1 Fingerprint: c8:ec:8c:87:92:69:cb:4b:ab:39:e9:8d:7e:57:67:f3:14:95:73:9d
329
+ # SHA256 Fingerprint: e3:89:36:0d:0f:db:ae:b3:d2:50:58:4b:47:30:31:4e:22:2f:39:c1:56:a0:20:14:4e:8d:96:05:61:79:15:06
330
+ -----BEGIN CERTIFICATE-----
331
+ MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw
332
+ CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl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v8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq
349
+ g6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm
350
+ fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c
351
+ 2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/
352
+ bLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==
353
+ -----END CERTIFICATE-----
354
+
355
+ # Issuer: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
356
+ # Subject: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
357
+ # Label: "Entrust.net Secure Server CA"
358
+ # Serial: 927650371
359
+ # MD5 Fingerprint: df:f2:80:73:cc:f1:e6:61:73:fc:f5:42:e9:c5:7c:ee
360
+ # SHA1 Fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39
361
+ # SHA256 Fingerprint: 62:f2:40:27:8c:56:4c:4d:d8:bf:7d:9d:4f:6f:36:6e:a8:94:d2:2f:5f:34:d9:89:a9:83:ac:ec:2f:ff:ed:50
362
+ -----BEGIN CERTIFICATE-----
363
+ MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
364
+ VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
365
+ ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
366
+ KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MD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 dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0
383
+ MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
384
+ E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
385
+ MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
386
+ hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
387
+ 95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
388
+ 2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
389
+ -----END CERTIFICATE-----
390
+
391
+ # Issuer: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
392
+ # Subject: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
393
+ # Label: "Entrust.net Premium 2048 Secure Server CA"
394
+ # Serial: 946059622
395
+ # MD5 Fingerprint: ba:21:ea:20:d6:dd:db:8f:c1:57:8b:40:ad:a1:fc:fc
396
+ # SHA1 Fingerprint: 80:1d:62:d0:7b:44:9d:5c:5c:03:5c:98:ea:61:fa:44:3c:2a:58:fe
397
+ # SHA256 Fingerprint: d1:c3:39:ea:27:84:eb:87:0f:93:4f:c5:63:4e:4a:a9:ad:55:05:01:64:01:f2:64:65:d3:7a:57:46:63:35:9f
398
+ -----BEGIN CERTIFICATE-----
399
+ MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML
400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R0OBBYEFFXkgdERgL7YibkIozH5oSQJFrlwMB0G
416
+ CSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEA
417
+ WUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo
418
+ oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQ
419
+ h7A6tcOdBTcSo8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18
420
+ f3v/rxzP5tsHrV7bhZ3QKw0z2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfN
421
+ B/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjXOP/swNlQ8C5LWK5Gb9Auw2DaclVy
422
+ vUxFnmG6v4SBkgPR0ml8xQ==
423
+ -----END CERTIFICATE-----
424
+
425
+ # Issuer: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust
426
+ # Subject: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust
427
+ # Label: "Baltimore CyberTrust Root"
428
+ # Serial: 33554617
429
+ # MD5 Fingerprint: ac:b6:94:a5:9c:17:e0:d7:91:52:9b:b1:97:06:a6:e4
430
+ # SHA1 Fingerprint: d4:de:20:d0:5e:66:fc:53:fe:1a:50:88:2c:78:db:28:52:ca:e4:74
431
+ # SHA256 Fingerprint: 16:af:57:a9:f6:76:b0:ab:12:60:95:aa:5e:ba:de:f2:2a:b3:11:19:d6:44:ac:95:cd:4b:93:db:f3:f2:6a:eb
432
+ -----BEGIN CERTIFICATE-----
433
+ MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
434
+ RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD
435
+ VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzd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I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
452
+ -----END CERTIFICATE-----
453
+
454
+ # Issuer: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc.
455
+ # Subject: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc.
456
+ # Label: "Equifax Secure Global eBusiness CA"
457
+ # Serial: 1
458
+ # MD5 Fingerprint: 8f:5d:77:06:27:c4:98:3c:5b:93:78:e7:d7:7d:9b:cc
459
+ # SHA1 Fingerprint: 7e:78:4a:10:1c:82:65:cc:2d:e1:f1:6d:47:b4:40:ca:d9:0a:19:45
460
+ # SHA256 Fingerprint: 5f:0b:62:ea:b5:e3:53:ea:65:21:65:16:58:fb:b6:53:59:f4:43:28:0a:4a:fb:d1:04:d7:7d:10:f9:f0:4c:07
461
+ -----BEGIN CERTIFICATE-----
462
+ MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc
463
+ MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT
464
+ ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw
465
+ MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj
466
+ dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l
467
+ c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC
468
+ UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc
469
+ 58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/
470
+ o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH
471
+ MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr
472
+ aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA
473
+ A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA
474
+ Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
475
+ 8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV
476
+ -----END CERTIFICATE-----
477
+
478
+ # Issuer: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc.
479
+ # Subject: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc.
480
+ # Label: "Equifax Secure eBusiness CA 1"
481
+ # Serial: 4
482
+ # MD5 Fingerprint: 64:9c:ef:2e:44:fc:c6:8f:52:07:d0:51:73:8f:cb:3d
483
+ # SHA1 Fingerprint: da:40:18:8b:91:89:a3:ed:ee:ae:da:97:fe:2f:9d:f5:b7:d1:8a:41
484
+ # SHA256 Fingerprint: cf:56:ff:46:a4:a1:86:10:9d:d9:65:84:b5:ee:b5:8a:51:0c:42:75:b0:e5:f9:4f:40:bb:ae:86:5e:19:f6:73
485
+ -----BEGIN CERTIFICATE-----
486
+ MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc
487
+ MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT
488
+ ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw
489
+ MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j
490
+ LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ
491
+ KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo
492
+ RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu
493
+ WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw
494
+ Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD
495
+ AQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK
496
+ eDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM
497
+ zfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+
498
+ WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN
499
+ /Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ==
500
+ -----END CERTIFICATE-----
501
+
502
+ # Issuer: O=Equifax Secure OU=Equifax Secure eBusiness CA-2
503
+ # Subject: O=Equifax Secure OU=Equifax Secure eBusiness CA-2
504
+ # Label: "Equifax Secure eBusiness CA 2"
505
+ # Serial: 930140085
506
+ # MD5 Fingerprint: aa:bf:bf:64:97:da:98:1d:6f:c6:08:3a:95:70:33:ca
507
+ # SHA1 Fingerprint: 39:4f:f6:85:0b:06:be:52:e5:18:56:cc:10:e1:80:e8:82:b3:85:cc
508
+ # SHA256 Fingerprint: 2f:27:4e:48:ab:a4:ac:7b:76:59:33:10:17:75:50:6d:c3:0e:e3:8e:f6:ac:d5:c0:49:32:cf:e0:41:23:42:20
509
+ -----BEGIN CERTIFICATE-----
510
+ MIIDIDCCAomgAwIBAgIEN3DPtTAN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3ijtM2vE1Nc9ElirfQkty3D1
526
+ E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUmV+GRMOrN
527
+ -----END CERTIFICATE-----
528
+
529
+ # Issuer: CN=AddTrust Class 1 CA Root O=AddTrust AB OU=AddTrust TTP Network
530
+ # Subject: CN=AddTrust Class 1 CA Root O=AddTrust AB OU=AddTrust TTP Network
531
+ # Label: "AddTrust Low-Value Services Root"
532
+ # Serial: 1
533
+ # MD5 Fingerprint: 1e:42:95:02:33:92:6b:b9:5f:c0:7f:da:d6:b2:4b:fc
534
+ # SHA1 Fingerprint: cc:ab:0e:a0:4c:23:01:d6:69:7b:dd:37:9f:cd:12:eb:24:e3:94:9d
535
+ # SHA256 Fingerprint: 8c:72:09:27:9a:c0:4e:27:5e:16:d0:7f:d3:b7:75:e8:01:54:b5:96:80:46:e3:1f:52:dd:25:76:63:24:e9:a7
536
+ -----BEGIN CERTIFICATE-----
537
+ MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU
538
+ MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3
539
+ b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw
540
+ MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
541
+ QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD
542
+ VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA
543
+ A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul
544
+ CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n
545
+ tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl
546
+ dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch
547
+ PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC
548
+ +Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O
549
+ BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E
550
+ BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl
551
+ MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk
552
+ ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB
553
+ IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X
554
+ 7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz
555
+ 43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY
556
+ eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl
557
+ pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA
558
+ WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk=
559
+ -----END CERTIFICATE-----
560
+
561
+ # Issuer: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network
562
+ # Subject: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network
563
+ # Label: "AddTrust External Root"
564
+ # Serial: 1
565
+ # MD5 Fingerprint: 1d:35:54:04:85:78:b0:3f:42:42:4d:bf:20:73:0a:3f
566
+ # SHA1 Fingerprint: 02:fa:f3:e2:91:43:54:68:60:78:57:69:4d:f5:e4:5b:68:85:18:68
567
+ # SHA256 Fingerprint: 68:7f:a4:51:38:22:78:ff:f0:c8:b1:1f:8d:43:d5:76:67:1c:6e:b2:bc:ea:b4:13:fb:83:d9:65:d0:6d:2f:f2
568
+ -----BEGIN CERTIFICATE-----
569
+ MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
570
+ MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
571
+ IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
572
+ MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
573
+ FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
574
+ bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
575
+ dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
576
+ H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
577
+ uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
578
+ mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
579
+ a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
580
+ E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
581
+ WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
582
+ VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
583
+ Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
584
+ cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
585
+ IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
586
+ AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
587
+ YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
588
+ 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
589
+ Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
590
+ c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
591
+ mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
592
+ -----END CERTIFICATE-----
593
+
594
+ # Issuer: CN=AddTrust Public CA Root O=AddTrust AB OU=AddTrust TTP Network
595
+ # Subject: CN=AddTrust Public CA Root O=AddTrust AB OU=AddTrust TTP Network
596
+ # Label: "AddTrust Public Services Root"
597
+ # Serial: 1
598
+ # MD5 Fingerprint: c1:62:3e:23:c5:82:73:9c:03:59:4b:2b:e9:77:49:7f
599
+ # SHA1 Fingerprint: 2a:b6:28:48:5e:78:fb:f3:ad:9e:79:10:dd:6b:df:99:72:2c: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BSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL
616
+ MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU
617
+ cnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv
618
+ b3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6
619
+ IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/
620
+ iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao
621
+ GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh
622
+ 4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm
623
+ XiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY=
624
+ -----END CERTIFICATE-----
625
+
626
+ # Issuer: CN=AddTrust Qualified CA Root O=AddTrust AB OU=AddTrust TTP Network
627
+ # Subject: CN=AddTrust Qualified CA Root O=AddTrust AB OU=AddTrust TTP Network
628
+ # Label: "AddTrust Qualified Certificates Root"
629
+ # Serial: 1
630
+ # MD5 Fingerprint: 27:ec:39:47:cd:da:5a:af:e2:9a:01:65:21:a9:4c:bb
631
+ # SHA1 Fingerprint: 4d:23:78:ec:91:95:39:b5:00:7f:75:8f:03:3b:21:1e:c5:4d:8b:cf
632
+ # SHA256 Fingerprint: 80:95:21:08:05:db:4b:bc:35:5e:44:28:d8:fd:6e:c2:cd:e3:ab:5f:b9:7a:99:42:98:8e:b8:f4:dc:d0:60:16
633
+ -----BEGIN CERTIFICATE-----
634
+ MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEw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VhbGlm
650
+ aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv
651
+ hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm
652
+ hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X
653
+ dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3
654
+ P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y
655
+ iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no
656
+ xqE=
657
+ -----END CERTIFICATE-----
658
+
659
+ # Issuer: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc.
660
+ # Subject: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc.
661
+ # Label: "Entrust Root Certification Authority"
662
+ # Serial: 1164660820
663
+ # MD5 Fingerprint: d6:a5:c3:ed:5d:dd:3e:00:c1:3d:87:92:1f:1d:3f:e4
664
+ # SHA1 Fingerprint: b3:1e:b1:b7:40:e3:6c:84:02:da:dc:37:d4:4d:f5:d4:67:49:52:f9
665
+ # SHA256 Fingerprint: 73:c1:76:43:4f:1b:c6:d5:ad:f4:5b:0e:76:e7:27:28:7c:8d:e5:76:16:c1:e6:e6:14:1a:2b:2c:bc:7d:8e:4c
666
+ -----BEGIN CERTIFICATE-----
667
+ MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC
668
+ VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0
669
+ Lm5ldC9DUFM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gNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE
685
+ vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA
686
+ A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t
687
+ O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua
688
+ AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP
689
+ 9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/
690
+ eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m
691
+ 0vdXcDazv/wor3ElhVsT/h5/WrQ8
692
+ -----END CERTIFICATE-----
693
+
694
+ # Issuer: CN=GeoTrust Global CA O=GeoTrust Inc.
695
+ # Subject: CN=GeoTrust Global CA O=GeoTrust Inc.
696
+ # Label: "GeoTrust Global CA"
697
+ # Serial: 144470
698
+ # MD5 Fingerprint: f7:75:ab:29:fb:51:4e:b7:77:5e:ff:05:3c:99:8e:f5
699
+ # SHA1 Fingerprint: de:28:f4:a4:ff:e5:b9:2f:a3:c5:03:d1:a3:49:a7:f9:96:2a:82:12
700
+ # SHA256 Fingerprint: ff:85:6a:2d:25:1d:cd:88:d3:66:56:f4:50:12:67:98:cf:ab:aa:de:40:79:9c:72:2d:e4:d2:b5:db:36:a7:3a
701
+ -----BEGIN CERTIFICATE-----
702
+ MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
703
+ MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
704
+ YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMj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ATE-----
721
+
722
+ # Issuer: CN=GeoTrust Global CA 2 O=GeoTrust Inc.
723
+ # Subject: CN=GeoTrust Global CA 2 O=GeoTrust Inc.
724
+ # Label: "GeoTrust Global CA 2"
725
+ # Serial: 1
726
+ # MD5 Fingerprint: 0e:40:a7:6c:de:03:5d:8f:d1:0f:e4:d1:8d:f9:6c:a9
727
+ # SHA1 Fingerprint: a9:e9:78:08:14:37:58:88:f2:05:19:b0:6d:2b:0d:2b:60:16:90:7d
728
+ # SHA256 Fingerprint: ca:2d:82:a0:86:77:07:2f:8a:b6:76:4f:f0:35:67:6c:fe:3e:5e:32:5e:01:21:72:df:3f:92:09:6d:b7:9b:85
729
+ -----BEGIN CERTIFICATE-----
730
+ MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEW
731
+ MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFs
732
+ IENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQG
733
+ EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3Qg
734
+ R2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvPE1A
735
+ PRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/NTL8
736
+ Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hL
737
+ TytCOb1kLUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL
738
+ 5mkWRxHCJ1kDs6ZgwiFAVvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7
739
+ S4wMcoKK+xfNAGw6EzywhIdLFnopsk/bHdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe
740
+ 2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
741
+ FHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNHK266ZUap
742
+ EBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6td
743
+ EPx7srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv
744
+ /NgdRN3ggX+d6YvhZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywN
745
+ A0ZF66D0f0hExghAzN4bcLUprbqLOzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0
746
+ abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkCx1YAzUm5s2x7UwQa4qjJqhIF
747
+ I8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqFH4z1Ir+rzoPz
748
+ 4iIprn2DQKi6bA==
749
+ -----END CERTIFICATE-----
750
+
751
+ # Issuer: CN=GeoTrust Universal CA O=GeoTrust Inc.
752
+ # Subject: CN=GeoTrust Universal CA O=GeoTrust Inc.
753
+ # Label: "GeoTrust Universal CA"
754
+ # Serial: 1
755
+ # MD5 Fingerprint: 92:65:58:8b:a2:1a:31:72:73:68:5c:b4:a5:7a:07:48
756
+ # SHA1 Fingerprint: e6:21:f3:35:43:79:05:9a:4b:68:30:9d:8a:2f:74:22:15:87:ec:79
757
+ # SHA256 Fingerprint: a0:45:9b:9f:63:b2:25:59:f5:fa:5d:4c:6d:b3:f9:f7:2f:f1:93:42:03:35:78:f0:73:bf:1d:1b:46:cb:b9:12
758
+ -----BEGIN CERTIFICATE-----
759
+ MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW
760
+ MBQGA1UEChMNR2VvVH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j3rWMB8GA1UdIwQY
776
+ MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG
777
+ 9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc
778
+ aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX
779
+ IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn
780
+ ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z
781
+ uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN
782
+ Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja
783
+ QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW
784
+ koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9
785
+ ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt
786
+ DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm
787
+ bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw=
788
+ -----END CERTIFICATE-----
789
+
790
+ # Issuer: CN=GeoTrust Universal CA 2 O=GeoTrust Inc.
791
+ # Subject: CN=GeoTrust Universal CA 2 O=GeoTrust Inc.
792
+ # Label: "GeoTrust Universal CA 2"
793
+ # Serial: 1
794
+ # MD5 Fingerprint: 34:fc:b8:d0:36:db:9e:14:b3:c2:f2:db:8f:e4:94:c7
795
+ # SHA1 Fingerprint: 37:9a:19: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MAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS
827
+ -----END CERTIFICATE-----
828
+
829
+ # Issuer: CN=America Online Root Certification Authority 1 O=America Online Inc.
830
+ # Subject: CN=America Online Root Certification Authority 1 O=America Online Inc.
831
+ # Label: "America Online Root Certification Authority 1"
832
+ # Serial: 1
833
+ # MD5 Fingerprint: 14:f1:08:ad:9d:fa:64:e2:89:e7:1c:cf:a8:ad:7d:5e
834
+ # SHA1 Fingerprint: 39:21:c1:15:c1:5d:0e:ca:5c:cb:5b:c4:f0:7d:21:d8:05:0b:56:6a
835
+ # SHA256 Fingerprint: 77:40:73:12:c6:3a:15:3d:5b:c0:0b:4e:51:75:9c:df:da:c2:37:dc:2a:33:b6:79:46:e9:8e:9b:fa:68:0a:e3
836
+ -----BEGIN CERTIFICATE-----
837
+ MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc
838
+ MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP
839
+ bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2
840
+ MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft
841
+ ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg
842
+ Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP
843
+ ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk
844
+ hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym
845
+ 1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW
846
+ OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb
847
+ 2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko
848
+ O3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw
849
+ AwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU
850
+ AK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB
851
+ BQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF
852
+ Zu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb
853
+ LjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir
854
+ oQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C
855
+ MMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds
856
+ sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7
857
+ -----END CERTIFICATE-----
858
+
859
+ # Issuer: CN=America Online Root Certification Authority 2 O=America Online Inc.
860
+ # Subject: CN=America Online Root Certification Authority 2 O=America Online Inc.
861
+ # Label: "America Online Root Certification Authority 2"
862
+ # Serial: 1
863
+ # MD5 Fingerprint: d6:ed:3c:ca:e2:66:0f:af:10:43:0d:77:9b:04:09:bf
864
+ # SHA1 Fingerprint: 85:b5:ff:67:9b:0c:79:96:1f:c8:6e:44:22:00:46:13:db:17:92:84
865
+ # SHA256 Fingerprint: 7d:3b:46:5a:60:14:e5:26:c0:af:fc:ee:21:27:d2:31:17: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UvAaw
897
+ RY8mkaKO/qk=
898
+ -----END CERTIFICATE-----
899
+
900
+ # Issuer: CN=AAA Certificate Services O=Comodo CA Limited
901
+ # Subject: CN=AAA Certificate Services O=Comodo CA Limited
902
+ # Label: "Comodo AAA Services root"
903
+ # Serial: 1
904
+ # MD5 Fingerprint: 49:79:04:b0:eb:87:19:ac:47:b0:bc:11:51:9b:74:d0
905
+ # SHA1 Fingerprint: d1:eb:23:a4:6d:17:d6:8f:d9:25:64:c2:f1:f1:60:17:64:d8:e3:49
906
+ # SHA256 Fingerprint: d7:a7:a0:fb:5d:7e:27:31:d7:71:e9:48:4e:bc:de:f7:1d:5f:0c:3e:0a:29:48:78:2b:c8:3e:e0:ea:69:9e:f4
907
+ -----BEGIN CERTIFICATE-----
908
+ MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
909
+ MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
910
+ GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
911
+ YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
912
+ MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
913
+ BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM
914
+ GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
915
+ ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua
916
+ BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe
917
+ 3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4
918
+ YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR
919
+ rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm
920
+ ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU
921
+ oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
922
+ MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v
923
+ QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t
924
+ b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF
925
+ AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q
926
+ GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
927
+ Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2
928
+ G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi
929
+ l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
930
+ smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
931
+ -----END CERTIFICATE-----
932
+
933
+ # Issuer: CN=Secure Certificate Services O=Comodo CA Limited
934
+ # Subject: CN=Secure Certificate Services O=Comodo CA Limited
935
+ # Label: "Comodo Secure Services root"
936
+ # Serial: 1
937
+ # MD5 Fingerprint: d3:d9:bd:ae:9f:ac:67:24:b3:c8:1b:52:e1:b9:a9:bd
938
+ # SHA1 Fingerprint: 4a:65:d5:f4:1d:ef:39:b8:b8:90:4a:4a:d3:64:81:33:cf:c7:a1:d1
939
+ # SHA256 Fingerprint: bd:81:ce:3b:4f:65:91:d1:1a:67:b5:fc:7a:47:fd:ef:25:52:1b:f9:aa:4e:18:b9:e3:df:2e:34:a7:80:3b:e8
940
+ -----BEGIN CERTIFICATE-----
941
+ MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb
942
+ MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
943
+ GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp
944
+ ZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow
945
+ fjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
946
+ A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV
947
+ BAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB
948
+ BQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM
949
+ cm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S
950
+ HpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996
951
+ CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk
952
+ 3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz
953
+ 6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV
954
+ HQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud
955
+ EwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv
956
+ Y2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw
957
+ Oi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww
958
+ DQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0
959
+ 5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj
960
+ Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI
961
+ gKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ
962
+ aD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl
963
+ izeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk=
964
+ -----END CERTIFICATE-----
965
+
966
+ # Issuer: CN=Trusted Certificate Services O=Comodo CA Limited
967
+ # Subject: CN=Trusted Certificate Services O=Comodo CA Limited
968
+ # Label: "Comodo Trusted Services root"
969
+ # Serial: 1
970
+ # MD5 Fingerprint: 91:1b:3f:6e:cd:9e:ab:ee:07:fe:1f:71:d2:b3:61:27
971
+ # SHA1 Fingerprint: e1:9f:e3:0e:8b:84:60:9e:80:9b:17:0d:72:a8:c5:ba:6e:14:09:bd
972
+ # SHA256 Fingerprint: 3f:06:e5:56:81:d4:96:f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AwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v
989
+ ZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo
990
+ dHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu
991
+ Y3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/
992
+ HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32
993
+ pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS
994
+ jBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+
995
+ xqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn
996
+ dBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi
997
+ -----END CERTIFICATE-----
998
+
999
+ # Issuer: CN=UTN - DATACorp SGC O=The USERTRUST Network OU=http://www.usertrust.com
1000
+ # Subject: CN=UTN - DATACorp SGC O=The USERTRUST Network OU=http://www.usertrust.com
1001
+ # Label: "UTN DATACorp SGC Root CA"
1002
+ # Serial: 91374294542884689855167577680241077609
1003
+ # MD5 Fingerprint: b3:a5:3e:77:21:6d:ac:4a:c0:c9:fb:d5:41:3d:ca:06
1004
+ # SHA1 Fingerprint: 58:11:9f:0e:12:82:87:ea:50:fd:d9:87:45:6f:4f:78:dc:fa:d6:d4
1005
+ # SHA256 Fingerprint: 85:fb:2f:91:dd:12:27:5a:01:45:b6:36:53:4f:84:02:4a:d6:8b:69:b8:ee:88:68:4f:f7:11:37:58:05:b3:48
1006
+ -----BEGIN CERTIFICATE-----
1007
+ MIIEXjCCA0agAwIBA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NVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js
1023
+ LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr
1024
+ BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB
1025
+ AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft
1026
+ Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj
1027
+ j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH
1028
+ KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv
1029
+ 2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3
1030
+ mfnGV/TJVTl4uix5yaaIK/QI
1031
+ -----END CERTIFICATE-----
1032
+
1033
+ # Issuer: CN=UTN-USERFirst-Hardware O=The USERTRUST Network OU=http://www.usertrust.com
1034
+ # Subject: CN=UTN-USERFirst-Hardware O=The USERTRUST Network OU=http://www.usertrust.com
1035
+ # Label: "UTN USERFirst Hardware Root CA"
1036
+ # Serial: 91374294542884704022267039221184531197
1037
+ # MD5 Fingerprint: 4c:56:41:e5:0d:bb:2b:e8:ca:a3:ed:18:08:ad:43:39
1038
+ # SHA1 Fingerprint: 04:83:ed:33:99:ac:36:08:05:87:22:ed:bc:5e:46:00:e3:be:f9:d7
1039
+ # SHA256 Fingerprint: 6e:a5:47:41:d0:04:66:7e:ed:1b:48:16:63:4a:a3:a7:9e:6e:4b:96:95:0f:82:79:da:fc:8d:9b:d8:81:21:37
1040
+ -----BEGIN CERTIFICATE-----
1041
+ MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhki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MDswOaA3oDWGM2h0
1057
+ dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy
1058
+ bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF
1059
+ BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM
1060
+ //bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli
1061
+ CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE
1062
+ CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t
1063
+ 3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS
1064
+ KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA==
1065
+ -----END CERTIFICATE-----
1066
+
1067
+ # Issuer: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com
1068
+ # Subject: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com
1069
+ # Label: "XRamp Global CA Root"
1070
+ # Serial: 107108908803651509692980124233745014957
1071
+ # MD5 Fingerprint: a1:0b:44:b3:ca:10:d8:00:6e:9d:0f:d8:0f:92:0a:d1
1072
+ # SHA1 Fingerprint: b8:01:86:d1:eb:9c:86:a5:41:04:cf:30:54:f3:4c:52:b7:e5:58:c6
1073
+ # SHA256 Fingerprint: ce:cd:dc:90:50:99:d8:da:df:c5:b1:d2:09:b7:37:cb:e2:c1:8c:fb:2c:10:c0:ff:0b:cf:0d:32:86:fc:1a:a2
1074
+ -----BEGIN CERTIFICATE-----
1075
+ MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgk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ueHJhbXBzZWN1cml0
1091
+ eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD
1092
+ ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR
1093
+ vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt
1094
+ qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa
1095
+ IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy
1096
+ i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ
1097
+ O+7ETPTsJ3xCwnR8gooJybQDJbw=
1098
+ -----END CERTIFICATE-----
1099
+
1100
+ # Issuer: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority
1101
+ # Subject: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority
1102
+ # Label: "Go Daddy Class 2 CA"
1103
+ # Serial: 0
1104
+ # MD5 Fingerprint: 91:de:06:25:ab:da:fd:32:17:0c:bb:25:17:2a:84:67
1105
+ # SHA1 Fingerprint: 27:96:ba:e6:3f:18:01:e2:77:26:1b:a0:d7:77:70:02:8f:20:ee:e4
1106
+ # SHA256 Fingerprint: c3:84:6b:f2:4b:9e:93:ca:64:27:4c:0e:c6:7c:1e:cc:5e:02:4f:fc:ac:d2:d7:40:19:35:0e:81:fe:54:6a:e4
1107
+ -----BEGIN CERTIFICATE-----
1108
+ MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh
1109
+ MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE
1110
+ YWRkeSBDbGFzcyAy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YtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P
1126
+ TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
1127
+ HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
1128
+ dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
1129
+ ReYNnyicsbkqWletNw+vHX/bvZ8=
1130
+ -----END CERTIFICATE-----
1131
+
1132
+ # Issuer: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority
1133
+ # Subject: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority
1134
+ # Label: "Starfield Class 2 CA"
1135
+ # Serial: 0
1136
+ # MD5 Fingerprint: 32:4a:4b:bb:c8:63:69:9b:be:74:9a:c6:dd:1d:46:24
1137
+ # SHA1 Fingerprint: ad:7e:1c:28:b0:64:ef:8f:60:03:40:20:14:c3:d0:e3:37:0e:b5:8a
1138
+ # SHA256 Fingerprint: 14:65:fa:20:53:97:b8:76:fa:a6:f0:a9:95:8e:55:90:e4:0f:cc:7f:aa:4f:b7:c2:c8:67:75:21:fb:5f:b6:58
1139
+ -----BEGIN CERTIFICATE-----
1140
+ MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl
1141
+ MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp
1142
+ U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw
1143
+ NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE
1144
+ ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp
1145
+ ZWxkIENsYXNzIDIgQ2VydGl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
1161
+ WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q=
1162
+ -----END CERTIFICATE-----
1163
+
1164
+ # Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
1165
+ # Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
1166
+ # Label: "StartCom Certification Authority"
1167
+ # Serial: 1
1168
+ # MD5 Fingerprint: 22:4d:8f:8a:fc:f7:35:c2:bb:57:34:90:7b:8b:22:16
1169
+ # SHA1 Fingerprint: 3e:2b:f7:f2:03:1b:96:f3:8c:e6:c4:d8:a8:5d:3e:2d:58:47:6a:0f
1170
+ # SHA256 Fingerprint: c7:66:a9:be:f2:d4:07:1c:86:3a:31:aa:49:20:e8:13:b2:d1:98:60:8c:b7:b7:cf:e2:11:43:b8:36:df:09:ea
1171
+ -----BEGIN CERTIFICATE-----
1172
+ MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW
1173
+ MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg
1174
+ Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh
1175
+ dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9
1176
+ MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi
1177
+ U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh
1178
+ cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA
1179
+ A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk
1180
+ pMyONvg45iPwbm2xP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KGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC
1211
+ O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V
1212
+ um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh
1213
+ NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14=
1214
+ -----END CERTIFICATE-----
1215
+
1216
+ # Issuer: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com
1217
+ # Subject: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com
1218
+ # Label: "DigiCert Assured ID Root CA"
1219
+ # Serial: 17154717934120587862167794914071425081
1220
+ # MD5 Fingerprint: 87:ce:0b:7b:2a:0e:49:00:e1:58:71:9b:37:a8:93:72
1221
+ # SHA1 Fingerprint: 05:63:b8:63:0d:62:d7:5a:bb:c8:ab:1e:4b:df:b5:a8:99:b2:4d:43
1222
+ # SHA256 Fingerprint: 3e:90:99:b5:01:5e:8f:48:6c:00:bc:ea:9d:11:1e:e7:21:fa:ba:35:5a:89:bc:f1:df:69:56:1e:3d:c6:32:5c
1223
+ -----BEGIN CERTIFICATE-----
1224
+ MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl
1225
+ MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
1226
+ d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv
1227
+ b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG
1228
+ EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl
1229
+ cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi
1230
+ MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c
1231
+ JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP
1232
+ mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+
1233
+ wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4
1234
+ VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/
1235
+ AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB
1236
+ AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW
1237
+ BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun
1238
+ pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC
1239
+ dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf
1240
+ fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm
1241
+ NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx
1242
+ H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
1243
+ +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
1244
+ -----END CERTIFICATE-----
1245
+
1246
+ # Issuer: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com
1247
+ # Subject: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com
1248
+ # Label: "DigiCert Global Root CA"
1249
+ # Serial: 10944719598952040374951832963794454346
1250
+ # MD5 Fingerprint: 79:e4:a9:84:0d:7d:3a:96:d7:c0:4f:e2:43:4c:89:2e
1251
+ # SHA1 Fingerprint: a8:98:5d:3a:65:e5:e5:c4:b2:d7:d6:6d:40:c6:dd:2f:b1:9c:54:36
1252
+ # SHA256 Fingerprint: 43:48:a0:e9:44:4c:78:cb:26:5e:05:8d:5e:89:44:b4:d8:4f:96:62:bd:26:db:25:7f:89:34:a4:43:c7:01:61
1253
+ -----BEGIN CERTIFICATE-----
1254
+ MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
1255
+ MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
1256
+ d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
1257
+ QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
1258
+ MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
1259
+ b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
1260
+ 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
1261
+ CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
1262
+ nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
1263
+ 43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
1264
+ T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
1265
+ gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
1266
+ BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
1267
+ TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
1268
+ DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
1269
+ hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
1270
+ 06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
1271
+ PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
1272
+ YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
1273
+ CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
1274
+ -----END CERTIFICATE-----
1275
+
1276
+ # Issuer: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com
1277
+ # Subject: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com
1278
+ # Label: "DigiCert High Assurance EV Root CA"
1279
+ # Serial: 3553400076410547919724730734378100087
1280
+ # MD5 Fingerprint: d4:74:de:57:5c:39:b2:d3:9c:85:83:c5:c0:65:49:8a
1281
+ # SHA1 Fingerprint: 5f:b7:ee:06:33:e2:59:db:ad:0c:4c:9a:e6:d3:8f:1a:61:c7:dc:25
1282
+ # SHA256 Fingerprint: 74:31:e5:f4:c3:c1:ce:46:90:77:4f:0b:61:e0:54:40:88:3b:a9:a0:1e:d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oIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
1299
+ nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
1300
+ eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
1301
+ hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
1302
+ Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
1303
+ vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
1304
+ +OkuE6N36B9K
1305
+ -----END CERTIFICATE-----
1306
+
1307
+ # Issuer: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc.
1308
+ # Subject: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc.
1309
+ # Label: "GeoTrust Primary Certification Authority"
1310
+ # Serial: 32798226551256963324313806436981982369
1311
+ # MD5 Fingerprint: 02:26:c3:01:5e:08:30:37:43:a9:d0:7d:cf:37:e6:bf
1312
+ # SHA1 Fingerprint: 32:3c:11:8e:1b:f7:b8:b6:52:54:e2:e2:10:0d:d6:02:90:37:f0:96
1313
+ # SHA256 Fingerprint: 37:d5:10:06:c5:12:ea:ab:62:64:21:f1:ec:8c:92:01:3f:c5:f8:2a:e9:8e:e5:33:eb:46:19:b8:de:b4:d0:6c
1314
+ -----BEGIN CERTIFICATE-----
1315
+ MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY
1316
+ MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo
1317
+ R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx
1318
+ M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debc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=
1334
+ -----END CERTIFICATE-----
1335
+
1336
+ # Issuer: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only
1337
+ # Subject: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only
1338
+ # Label: "thawte Primary Root CA"
1339
+ # Serial: 69529181992039203566298953787712940909
1340
+ # MD5 Fingerprint: 8c:ca:dc:0b:22:ce:f5:be:72:ac:41:1a:11:a8:d8:12
1341
+ # SHA1 Fingerprint: 91:c6:d6:ee:3e:8a:c8:63:84:e5:48:c2:99:29:5c:75:6c:81:7b:81
1342
+ # SHA256 Fingerprint: 8d:72:2f:81:a9:c1:13:c0:79:1d:f1:36:a2:96:6d:b2:6c:95:0a:97:1d:b4:6b:41:99:f4:ea:54:b7:8b:fb:9f
1343
+ -----BEGIN CERTIFICATE-----
1344
+ MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB
1345
+ qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf
1346
+ Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw
1347
+ MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV
1348
+ BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw
1349
+ NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j
1350
+ LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG
1351
+ A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC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ign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only
1370
+ # Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only
1371
+ # Label: "VeriSign Class 3 Public Primary Certification Authority - G5"
1372
+ # Serial: 33037644167568058970164719475676101450
1373
+ # MD5 Fingerprint: cb:17:e4:31:67:3e:e2:09:fe:45:57:93:f3:0a:fa:1c
1374
+ # SHA1 Fingerprint: 4e:b6:d5:78:49:9b:1c:cf:5f:58:1e:ad:56:be:3d:9b:67:44:a5:e5
1375
+ # SHA256 Fingerprint: 9a:cf:ab:7e:43:c8:d8:80:d0:6b:26:2a:94:de:ee:e4:b4:65:99:89:c3:d0:ca:f1:9b:af:64:05:e4:1a:b7:df
1376
+ -----BEGIN CERTIFICATE-----
1377
+ MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB
1378
+ yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
1379
+ ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp
1380
+ U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW
1381
+ ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0
1382
+ aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL
1383
+ MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW
1384
+ ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln
1385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gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ
1401
+ 4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N
1402
+ hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
1403
+ -----END CERTIFICATE-----
1404
+
1405
+ # Issuer: CN=COMODO Certification Authority O=COMODO CA Limited
1406
+ # Subject: CN=COMODO Certification Authority O=COMODO CA Limited
1407
+ # Label: "COMODO Certification Authority"
1408
+ # Serial: 104350513648249232941998508985834464573
1409
+ # MD5 Fingerprint: 5c:48:dc:f7:42:72:ec:56:94:6d:1c:cc:71:35:80:75
1410
+ # SHA1 Fingerprint: 66:31:bf:9e:f7:4f:9e:b6:c9:d5:a6:0c:ba:6a:be:d1:f7:bd:ef:7b
1411
+ # SHA256 Fingerprint: 0c:2c:d6:3d:f7:80:6f:a3:99:ed:e8:09:11:6b:57:5b:f8:79:89:f0:65:18:f9:80:8c:86:05:03:17:8b:af:66
1412
+ -----BEGIN CERTIFICATE-----
1413
+ MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB
1414
+ gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
1415
+ A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV
1416
+ BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw
1417
+ MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl
1418
+ YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P
1419
+ RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09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jBFMR7HeL5YYTisO+IB
1435
+ ZQ==
1436
+ -----END CERTIFICATE-----
1437
+
1438
+ # Issuer: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C.
1439
+ # Subject: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C.
1440
+ # Label: "Network Solutions Certificate Authority"
1441
+ # Serial: 116697915152937497490437556386812487904
1442
+ # MD5 Fingerprint: d3:f3:a6:16:c0:fa:6b:1d:59:b1:2d:96:4d:0e:11:2e
1443
+ # SHA1 Fingerprint: 74:f8:a3:c3:ef:e7:b3:90:06:4b:83:90:3c:21:64:60:20:e5:df:ce
1444
+ # SHA256 Fingerprint: 15:f0:ba:00:a3:ac:7a:f3:ac:88:4c:07:2b:10:11:a0:77:bd:77:c0:97:f4:01:64:b2:f8:59:8a:bd:83:86:0c
1445
+ -----BEGIN CERTIFICATE-----
1446
+ MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi
1447
+ MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu
1448
+ MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp
1449
+ dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV
1450
+ UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO
1451
+ ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG
1452
+ SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz
1453
+ c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP
1454
+ OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl
1455
+ mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF
1456
+ BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4
1457
+ qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw
1458
+ gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB
1459
+ BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu
1460
+ bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp
1461
+ dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8
1462
+ 6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/
1463
+ h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH
1464
+ /nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv
1465
+ wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN
1466
+ pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
1467
+ -----END CERTIFICATE-----
1468
+
1469
+ # Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited
1470
+ # Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited
1471
+ # Label: "COMODO ECC Certification Authority"
1472
+ # Serial: 41578283867086692638256921589707938090
1473
+ # MD5 Fingerprint: 7c:62:ff:74:9d:31:53:5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4jf/7VGFAkK+qDm
1489
+ fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv
1490
+ GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
1491
+ -----END CERTIFICATE-----
1492
+
1493
+ # Issuer: CN=TC TrustCenter Class 2 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 2 CA
1494
+ # Subject: CN=TC TrustCenter Class 2 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 2 CA
1495
+ # Label: "TC TrustCenter Class 2 CA II"
1496
+ # Serial: 941389028203453866782103406992443
1497
+ # MD5 Fingerprint: ce:78:33:5c:59:78:01:6e:18:ea:b9:36:a0:b9:2e:23
1498
+ # SHA1 Fingerprint: ae:50:83:ed:7c:f4:5c:bc:8f:61:c6:21:fe:68:5d:79:42:21:15:6e
1499
+ # SHA256 Fingerprint: e6:b8:f8:76:64:85:f8:07:ae:7f:8d:ac:16:70:46:1f:07:c0:a1:3e:ef:3a:1f:f7:17:53:8d:7a:ba:d3:91:b4
1500
+ -----BEGIN CERTIFICATE-----
1501
+ MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjEL
1502
+ MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV
1503
+ BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0
1504
+ Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYwMTEyMTQzODQzWhcNMjUxMjMxMjI1
1505
+ OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i
1506
+ SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UEAxMc
1507
+ VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgM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nS7Yblok2+XnR8
1523
+ au0WOB9/WIFaGusyiC2y8zl3gK9etmF1KdsjTYjKUCjLhdLTEKJZbtOTVAB6okaV
1524
+ hgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kPJOzHdiEoZa5X6AeI
1525
+ dUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfkvQ==
1526
+ -----END CERTIFICATE-----
1527
+
1528
+ # Issuer: CN=TC TrustCenter Class 3 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 3 CA
1529
+ # Subject: CN=TC TrustCenter Class 3 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 3 CA
1530
+ # Label: "TC TrustCenter Class 3 CA II"
1531
+ # Serial: 1506523511417715638772220530020799
1532
+ # MD5 Fingerprint: 56:5f:aa:80:61:12:17:f6:67:21:e6:2b:6d:61:56:8e
1533
+ # SHA1 Fingerprint: 80:25:ef:f4:6e:70:c8:d4:72:24:65:84:fe:40:3b:8a:8d:6a:db:f5
1534
+ # SHA256 Fingerprint: 8d:a0:84:fc:f9:9c:e0:77:22:f8:9b:32:05:93:98:06:fa:5c:b8:11:e1:c8:13:f6:a1:08:c7:d3:36:b3:40:8e
1535
+ -----BEGIN CERTIFICATE-----
1536
+ MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjEL
1537
+ MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV
1538
+ BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0
1539
+ Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYwMTEyMTQ0MTU3WhcNMjUxMjMxMjI1
1540
+ OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i
1541
+ SDEiMCAGA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NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8
1557
+ TtXqluJucsG7Kv5sbviRmEb8yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6
1558
+ g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9IJqDnxrcOfHFcqMRA/07QlIp2+gB
1559
+ 95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal092Y+tTmBvTwtiBj
1560
+ S+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc5A==
1561
+ -----END CERTIFICATE-----
1562
+
1563
+ # Issuer: CN=TC TrustCenter Universal CA I O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA
1564
+ # Subject: CN=TC TrustCenter Universal CA I O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA
1565
+ # Label: "TC TrustCenter Universal CA I"
1566
+ # Serial: 601024842042189035295619584734726
1567
+ # MD5 Fingerprint: 45:e1:a5:72:c5:a9:36:64:40:9e:f5:e4:58:84:67:8c
1568
+ # SHA1 Fingerprint: 6b:2f:34:ad:89:58:be:62:fd:b0:6b:5c:ce:bb:9d:d9:4f:4e:39:f3
1569
+ # SHA256 Fingerprint: eb:f3:c0:2a:87:89:b1:fb:7d:51:19:95:d6:63:b7:29:06:d9:13:ce:0d:5e:10:56:8a:8a:77:e2:58:61:67:e7
1570
+ -----BEGIN CERTIFICATE-----
1571
+ MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTEL
1572
+ MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV
1573
+ BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1
1574
+ c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcNMDYwMzIyMTU1NDI4WhcNMjU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G5wALPT
1590
+ ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/
1591
+ 2TYcuiUaUj0a7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY
1592
+ -----END CERTIFICATE-----
1593
+
1594
+ # Issuer: CN=Cybertrust Global Root O=Cybertrust, Inc
1595
+ # Subject: CN=Cybertrust Global Root O=Cybertrust, Inc
1596
+ # Label: "Cybertrust Global Root"
1597
+ # Serial: 4835703278459682877484360
1598
+ # MD5 Fingerprint: 72:e4:4a:87:e3:69:40:80:77:ea:bc:e3:f4:ff:f0:e1
1599
+ # SHA1 Fingerprint: 5f:43:e5:b1:bf:f8:78:8c:ac:1c:c7:ca:4a:9a:c6:22:2b:cc:34:c6
1600
+ # SHA256 Fingerprint: 96:0a:df:00:63:e9:63:56:75:0c:29:65:dd:0a:08:67:da:0b:9c:bd:6e:77:71:4a:ea:fb:23:49:ab:39:3d:a3
1601
+ -----BEGIN CERTIFICATE-----
1602
+ MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG
1603
+ A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh
1604
+ bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE
1605
+ ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS
1606
+ b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5
1607
+ 7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS
1608
+ J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y
1609
+ HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP
1610
+ t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz
1611
+ FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY
1612
+ XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/
1613
+ MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw
1614
+ hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js
1615
+ MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA
1616
+ A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj
1617
+ Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx
1618
+ XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o
1619
+ omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc
1620
+ A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW
1621
+ WL1WMRJOEcgh4LMRkWXbtKaIOM5V
1622
+ -----END CERTIFICATE-----
1623
+
1624
+ # Issuer: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only
1625
+ # Subject: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only
1626
+ # Label: "GeoTrust Primary Certification Authority - G3"
1627
+ # Serial: 28809105769928564313984085209975885599
1628
+ # MD5 Fingerprint: b5:e8:34:36:c9:10:44:58:48:70:6d:2e:83:d4:b8:05
1629
+ # SHA1 Fingerprint: 03:9e:ed:b8:0b:e7:a0:3c:69:53:89:3b:20:d2:d9:32:3a:4c:2a:fd
1630
+ # SHA256 Fingerprint: b4:78:b8:12:25:0d:f8:78:63:5c:2a:a7:ec:7d:15:5e:aa:62:5e:e8:29:16:e2:cd:29:43:61:88:6c:d1:fb:d4
1631
+ -----BEGIN CERTIFICATE-----
1632
+ MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB
1633
+ mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT
1634
+ MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s
1635
+ eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv
1636
+ cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ
1637
+ BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg
1638
+ MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0
1639
+ BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
1640
+ LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz
1641
+ +uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm
1642
+ hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn
1643
+ 5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W
1644
+ JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL
1645
+ DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC
1646
+ huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw
1647
+ HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB
1648
+ AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB
1649
+ zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN
1650
+ kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD
1651
+ AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH
1652
+ SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G
1653
+ spki4cErx5z481+oghLrGREt
1654
+ -----END CERTIFICATE-----
1655
+
1656
+ # Issuer: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only
1657
+ # Subject: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only
1658
+ # Label: "thawte Primary Root CA - G2"
1659
+ # Serial: 71758320672825410020661621085256472406
1660
+ # MD5 Fingerprint: 74:9d:ea:60:24:c4:fd:22:53:3e:cc:3a:72:d9:29:4f
1661
+ # SHA1 Fingerprint: aa:db:bc:22:23:8f:c4:01:a1:27:bb:38:dd:f4:1d:db:08:9e:f0:12
1662
+ # SHA256 Fingerprint: a4:31:0d:50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FICATE-----
1679
+
1680
+ # Issuer: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only
1681
+ # Subject: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only
1682
+ # Label: "thawte Primary Root CA - G3"
1683
+ # Serial: 127614157056681299805556476275995414779
1684
+ # MD5 Fingerprint: fb:1b:5d:43:8a:94:cd:44:c6:76:f2:43:4b:47:e7:31
1685
+ # SHA1 Fingerprint: f1:8b:53:8d:1b:e9:03:b6:a6:f0:56:43:5b:17:15:89:ca:f3:6b:f2
1686
+ # SHA256 Fingerprint: 4b:03:f4:58:07:ad:70:f2:1b:fc:2c:ae:71:c9:fd:e4:60:4c:06:4c:f5:ff:b6:86:ba:e5:db:aa:d7:fd:d3:4c
1687
+ -----BEGIN CERTIFICATE-----
1688
+ MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB
1689
+ rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf
1690
+ Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw
1691
+ MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV
1692
+ BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa
1693
+ Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl
1694
+ LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u
1695
+ MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl
1696
+ ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz
1697
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm
1698
+ gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8
1699
+ YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf
1700
+ b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9
1701
+ 9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S
1702
+ zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk
1703
+ OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV
1704
+ HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA
1705
+ 2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW
1706
+ oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu
1707
+ t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c
1708
+ KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM
1709
+ m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu
1710
+ MdRAGmI0Nj81Aa6sY6A=
1711
+ -----END CERTIFICATE-----
1712
+
1713
+ # Issuer: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only
1714
+ # Subject: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only
1715
+ # Label: "GeoTrust Primary Certification Authority - G2"
1716
+ # Serial: 80682863203381065782177908751794619243
1717
+ # MD5 Fingerprint: 01:5e:d8:6b:bd:6f:3d:8e:a1:31:f8:12:e0:98:73:6a
1718
+ # SHA1 Fingerprint: 8d:17:84:d5:37:f3:03:7d:ec:70:fe:57:8b:51:9a:99:e6:10:d7:b0
1719
+ # SHA256 Fingerprint: 5e:db:7a:c4:3b:82:a0:6a:87:61:e8:d7:be:49:79:eb:f2:61:1f:7d:d7:9b:f9:1c:1c:6b:56:6a:21:9e:d7:66
1720
+ -----BEGIN CERTIFICATE-----
1721
+ MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL
1722
+ MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj
1723
+ KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2
1724
+ MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
1725
+ eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV
1726
+ BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw
1727
+ NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV
1728
+ BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH
1729
+ MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL
1730
+ So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal
1731
+ tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO
1732
+ BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG
1733
+ CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT
1734
+ qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz
1735
+ rD6ogRLQy7rQkgu2npaqBA+K
1736
+ -----END CERTIFICATE-----
1737
+
1738
+ # Issuer: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only
1739
+ # Subject: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only
1740
+ # Label: "VeriSign Universal Root Certification Authority"
1741
+ # Serial: 85209574734084581917763752644031726877
1742
+ # MD5 Fingerprint: 8e:ad:b5:01:aa:4d:81:e4:8c:1d:d1:e1:14:00:95:19
1743
+ # SHA1 Fingerprint: 36:79:ca:35:66:87:72:30:4d:30:a5:fb:87:3b:0f:a7:7b:b7:0d:54
1744
+ # SHA256 Fingerprint: 23:99:56:11:27:a5:71:25:de:8c:ef:ea:61:0d:df:2f:a0:78:b5:c8:06:7f:4e:82:82:90:bf:b8:60:e8:4b:3c
1745
+ -----BEGIN CERTIFICATE-----
1746
+ MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB
1747
+ vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
1748
+ ExZWZXJpU2lnbiBUcnVzdC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YFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs
1764
+ exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
1765
+ DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4
1766
+ sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+
1767
+ seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz
1768
+ 4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+
1769
+ BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR
1770
+ lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3
1771
+ 7M2CYfE45k+XmCpajQ==
1772
+ -----END CERTIFICATE-----
1773
+
1774
+ # Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only
1775
+ # Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only
1776
+ # Label: "VeriSign Class 3 Public Primary Certification Authority - G4"
1777
+ # Serial: 63143484348153506665311985501458640051
1778
+ # MD5 Fingerprint: 3a:52:e1:e7:fd:6f:3a:e3:6f:f3:6f:99:1b:f9:22:41
1779
+ # SHA1 Fingerprint: 22:d5:d8:df:8f:02:31:d1:8d:f7:9d:b7:cf:8a:2d:64:c9:3f:6c:3a
1780
+ # SHA256 Fingerprint: 69:dd:d7:ea:90:bb:57:c9:3e:13:5d:c8:5e:a6:fc:d5:48:0b:60:32:39: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BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj
1797
+ aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW
1798
+ kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC
1799
+ 4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga
1800
+ FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
1801
+ -----END CERTIFICATE-----
1802
+
1803
+ # Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
1804
+ # Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
1805
+ # Label: "Verisign Class 3 Public Primary Certification Authority"
1806
+ # Serial: 80507572722862485515306429940691309246
1807
+ # MD5 Fingerprint: ef:5a:f1:33:ef:f1:cd:bb:51:02:ee:12:14:4b:96:c4
1808
+ # SHA1 Fingerprint: a1:db:63:93:91:6f:17:e4:18:55:09:40:04:15:c7:02:40:b0:ae:6b
1809
+ # SHA256 Fingerprint: a4:b6:b3:99:6f:c2:f3:06:b3:fd:86:81:bd:63:41:3d:8c:50:09:cc:4f:a3:29:c2:cc:f0:e2:fa:1b:14:03:05
1810
+ -----BEGIN CERTIFICATE-----
1811
+ MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG
1812
+ A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
1813
+ cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
1814
+ MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
1815
+ BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
1816
+ YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
1817
+ ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
1818
+ BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
1819
+ I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
1820
+ CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i
1821
+ 2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ
1822
+ 2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ
1823
+ -----END CERTIFICATE-----
1824
+
1825
+ # Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3
1826
+ # Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3
1827
+ # Label: "GlobalSign Root CA - R3"
1828
+ # Serial: 4835703278459759426209954
1829
+ # MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28
1830
+ # SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad
1831
+ # SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b
1832
+ -----BEGIN CERTIFICATE-----
1833
+ MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
1834
+ A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxE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Gomecs
1850
+ Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
1851
+ WD9f
1852
+ -----END CERTIFICATE-----
1853
+
1854
+ # Issuer: CN=TC TrustCenter Universal CA III O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA
1855
+ # Subject: CN=TC TrustCenter Universal CA III O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA
1856
+ # Label: "TC TrustCenter Universal CA III"
1857
+ # Serial: 2010889993983507346460533407902964
1858
+ # MD5 Fingerprint: 9f:dd:db:ab:ff:8e:ff:45:21:5f:f0:6c:9d:8f:fe:2b
1859
+ # SHA1 Fingerprint: 96:56:cd:7b:57:96:98:95:d0:e1:41:46:68:06:fb:b8:c6:11:06:87
1860
+ # SHA256 Fingerprint: 30:9b:4a:87:f6:ca:56:c9:31:69:aa:a9:9c:6d:98:88:54:d7:89:2b:d5:43:7e:2d:07:b2:9c:be:da:55:d3:5d
1861
+ -----BEGIN CERTIFICATE-----
1862
+ MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezEL
1863
+ MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV
1864
+ BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1
1865
+ c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAeFw0wOTA5MDkwODE1MjdaFw0yOTEy
1866
+ MzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNUQyBUcnVzdENlbnRl
1867
+ ciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0ExKDAm
1868
+ BgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqG
1869
+ SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF
1870
+ 5+cvAqBNLaT6hdqbJYUtQCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYv
1871
+ DIRlzg9uwliT6CwLOunBjvvya8o84pxOjuT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8v
1872
+ zArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+EutCHnNaYlAJ/Uqwa1D7KRT
1873
+ yGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1M4BDj5yj
1874
+ dipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBh
1875
+ MB8GA1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMB
1876
+ Af8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI
1877
+ 4jANBgkqhkiG9w0BAQUFAAOCAQEAg8ev6n9NCjw5sWi+e22JLumzCecYV42Fmhfz
1878
+ dkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+KGwWaODIl0YgoGhnYIg5IFHY
1879
+ aAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhKBgePxLcHsU0G
1880
+ DeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV
1881
+ CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPH
1882
+ LQNjO9Po5KIqwoIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg==
1883
+ -----END CERTIFICATE-----
1884
+
1885
+ # Issuer: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc.
1886
+ # Subject: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc.
1887
+ # Label: "Go Daddy Root Certificate Authority - G2"
1888
+ # Serial: 0
1889
+ # MD5 Fingerprint: 80:3a:bc:22:c1:e6:fb:8d:9b:3b:27:4a:32:1b:9a:01
1890
+ # SHA1 Fingerprint: 47:be:ab:c9:22:ea:e8:0e:78:78:34:62:a7:9f:45:c2:54:fd:e6:8b
1891
+ # SHA256 Fingerprint: 45:14:0b:32:47:eb:9c:c8:c5:b4:f0:d7:b5:30:91:f7:32:92:08:9e:6e:5a:63:e2:74:9d:d3:ac:a9:19:8e:da
1892
+ -----BEGIN CERTIFICATE-----
1893
+ MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx
1894
+ EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT
1895
+ EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp
1896
+ ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz
1897
+ NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH
1898
+ EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE
1899
+ AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw
1900
+ DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD
1901
+ E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH
1902
+ /PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy
1903
+ DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh
1904
+ GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR
1905
+ tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA
1906
+ AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE
1907
+ FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX
1908
+ WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu
1909
+ 9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr
1910
+ gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo
1911
+ 2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO
1912
+ LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI
1913
+ 4uJEvlz36hz1
1914
+ -----END CERTIFICATE-----
1915
+
1916
+ # Issuer: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc.
1917
+ # Subject: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc.
1918
+ # Label: "Starfield Root Certificate Authority - G2"
1919
+ # Serial: 0
1920
+ # MD5 Fingerprint: d6:39:81:c6:52:7e:96:69:fc:fc:ca:66:ed:05:f2:96
1921
+ # SHA1 Fingerprint: b5:1c:06:7c:ee:2b:0c:3d:f8:55:ab:2d:92:f4:fe:39:d4:e7:0f:0e
1922
+ # SHA256 Fingerprint: 2c:e1:cb:0b:f9:d2:f9:e1:02:99:3f:be:21:51:52:c3:b2:dd:0c:ab:de:1c:68:e5:31:9b:83:91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oo2Kooc6rB1snMA0G
1939
+ CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU
1940
+ sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3
1941
+ 4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg
1942
+ 8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K
1943
+ pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1
1944
+ mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0
1945
+ -----END CERTIFICATE-----
1946
+
1947
+ # Issuer: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc.
1948
+ # Subject: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc.
1949
+ # Label: "Starfield Services Root Certificate Authority - G2"
1950
+ # Serial: 0
1951
+ # MD5 Fingerprint: 17:35:74:af:7b:61:1c:eb:f4:f9:3c:e2:ee:40:f9:a2
1952
+ # SHA1 Fingerprint: 92:5a:8f:8d:2c:6d:04:e0:66:5f:59:6a:ff:22:d8:63:e8:25:6f:3f
1953
+ # SHA256 Fingerprint: 56:8d:69:05:a2:c8:87:08:a4:b3:02:51:90:ed:cf:ed:b1:97:4a:60:6a:13:c6:e5:29:0f:cb:2a:e6:3e:da:b5
1954
+ -----BEGIN CERTIFICATE-----
1955
+ MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx
1956
+ EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT
1957
+ HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs
1958
+ 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WN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd
1974
+ iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn
1975
+ 0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN
1976
+ sSi6
1977
+ -----END CERTIFICATE-----
1978
+
1979
+ # Issuer: CN=AffirmTrust Commercial O=AffirmTrust
1980
+ # Subject: CN=AffirmTrust Commercial O=AffirmTrust
1981
+ # Label: "AffirmTrust Commercial"
1982
+ # Serial: 8608355977964138876
1983
+ # MD5 Fingerprint: 82:92:ba:5b:ef:cd:8a:6f:a6:3d:55:f9:84:f6:d6:b7
1984
+ # SHA1 Fingerprint: f9:b5:b6:32:45:5f:9c:be:ec:57:5f:80:dc:e9:6e:2c:c7:b2:78:b7
1985
+ # SHA256 Fingerprint: 03:76:ab:1d:54:c5:f9:80:3c:e4:b2:e2:01:a0:ee:7e:ef:7b:57:b6:36:e8:a9:3c:9b:8d:48:60:c9:6f:5f:a7
1986
+ -----BEGIN CERTIFICATE-----
1987
+ MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE
1988
+ BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz
1989
+ dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL
1990
+ MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp
1991
+ cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
1992
+ AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP
1993
+ Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr
1994
+ ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL
1995
+ MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1
1996
+ yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr
1997
+ VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/
1998
+ nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ
1999
+ KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG
2000
+ XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj
2001
+ vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt
2002
+ Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g
2003
+ N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC
2004
+ nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8=
2005
+ -----END CERTIFICATE-----
2006
+
2007
+ # Issuer: CN=AffirmTrust Networking O=AffirmTrust
2008
+ # Subject: CN=AffirmTrust Networking O=AffirmTrust
2009
+ # Label: "AffirmTrust Networking"
2010
+ # Serial: 8957382827206547757
2011
+ # MD5 Fingerprint: 42:65:ca:be:01:9a:9a:4c:a9:8c:41:49:cd:c0:d5:7f
2012
+ # SHA1 Fingerprint: 29:36:21:02:8b:20:ed:02:f5:66:c5:32:d1:d6:ed:90:9f:45:00:2f
2013
+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ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu
2029
+ QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ
2030
+ Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u
2031
+ olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48
2032
+ x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s=
2033
+ -----END CERTIFICATE-----
2034
+
2035
+ # Issuer: CN=AffirmTrust Premium O=AffirmTrust
2036
+ # Subject: CN=AffirmTrust Premium O=AffirmTrust
2037
+ # Label: "AffirmTrust Premium"
2038
+ # Serial: 7893706540734352110
2039
+ # MD5 Fingerprint: c4:5d:0e:48:b6:ac:28:30:4e:0a:bc:f9:38:16:87:57
2040
+ # SHA1 Fingerprint: d8:a6:33:2c:e0:03:6f:b1:85:f6:63:4f:7d:6a:06:65:26:32:28:27
2041
+ # SHA256 Fingerprint: 70:a7:3f:7f:37:6b:60:07:42:48:90:45:34:b1:14:82:d5:bf:0e:69:8e:cc:49:8d:f5:25:77:eb:f2:e9:3b:9a
2042
+ -----BEGIN CERTIFICATE-----
2043
+ MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE
2044
+ BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz
2045
+ dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG
2046
+ A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U
2047
+ cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf
2048
+ qV/+Qd3d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1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ
2064
+ MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc
2065
+ 0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ
2066
+ u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF
2067
+ u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH
2068
+ YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8
2069
+ GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO
2070
+ RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e
2071
+ KeC2uAloGRwYQw==
2072
+ -----END CERTIFICATE-----
2073
+
2074
+ # Issuer: CN=AffirmTrust Premium ECC O=AffirmTrust
2075
+ # Subject: CN=AffirmTrust Premium ECC O=AffirmTrust
2076
+ # Label: "AffirmTrust Premium ECC"
2077
+ # Serial: 8401224907861490260
2078
+ # MD5 Fingerprint: 64:b0:09:55:cf:b1:d5:99:e2:be:13:ab:a6:5d:ea:4d
2079
+ # SHA1 Fingerprint: b8:23:6b:00:2f:1d:16:86:53:01:55:6c:11:a4:37:ca:eb:ff:c3:bb
2080
+ # SHA256 Fingerprint: bd:71:fd:f6:da:97:e4:cf:62:d1:64:7a:dd:25:81:b0:7d:79:ad:f8:39:7e:b4:ec:ba:9c:5e:84:88:82:14:23
2081
+ -----BEGIN CERTIFICATE-----
2082
+ MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC
2083
+ VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ
2084
+ cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ
2085
+ BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt
2086
+ VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D
2087
+ 0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9
2088
+ ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G
2089
+ A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G
2090
+ A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs
2091
+ aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I
2092
+ flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==
2093
+ -----END CERTIFICATE-----
2094
+
2095
+ # Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
2096
+ # Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
2097
+ # Label: "StartCom Certification Authority"
2098
+ # Serial: 45
2099
+ # MD5 Fingerprint: c9:3b:0d:84:41:fc:a4:76:79:23:08:57:de:10:19:16
2100
+ # SHA1 Fingerprint: a3:f1:33:3f:e2:42:bf:cf:c5:d1:4e:8f:39:42:98:40:68:10:d1:a0
2101
+ # SHA256 Fingerprint: e1:78:90:ee:09:a3:fb:f4:f4:8b:9c:41:4a:17:d6:37:b7:a5:06:47:e9:bc:75:23:22:72:7f:cc:17:42:a9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M/gTF
2133
+ wWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS
2134
+ Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst
2135
+ 0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc
2136
+ pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl
2137
+ CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF
2138
+ P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK
2139
+ 1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm
2140
+ KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE
2141
+ JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ
2142
+ 8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm
2143
+ fyWl8kgAwKQB2j8=
2144
+ -----END CERTIFICATE-----
2145
+
2146
+ # Issuer: CN=StartCom Certification Authority G2 O=StartCom Ltd.
2147
+ # Subject: CN=StartCom Certification Authority G2 O=StartCom Ltd.
2148
+ # Label: "StartCom Certification Authority G2"
2149
+ # Serial: 59
2150
+ # MD5 Fingerprint: 78:4b:fb:9e:64:82:0a:d3:b8:4c:62:f3:64:f2:90:64
2151
+ # SHA1 Fingerprint: 31:f1:fd:68:22:63:20:ee:c6:3b:3f:9d:ea:4a:3e:53:7c:7c:39:17
2152
+ # SHA256 Fingerprint: c7:ba:65:67:de:93:a7:98:ae:1f:aa:79:1e:71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srzJmwN0jP41ZL9c8PDHIyh8bw
2201
+ RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS
2202
+ fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
2203
+ -----END CERTIFICATE-----
2204
+
2205
+ ISRG Root X1
2206
+ ============
2207
+ -----BEGIN CERTIFICATE-----
2208
+ MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAwTzELMAkGA1UE
2209
+ BhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2VhcmNoIEdyb3VwMRUwEwYDVQQD
2210
+ EwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQG
2211
+ EwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMT
2212
+ DElTUkcgUm9vdCBYMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54r
2213
+ Vygch77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+0TM8ukj1
2214
+ 3Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6UA5/TR5d8mUgjU+g4rk8K
2215
+ b4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sWT8KOEUt+zwvo/7V3LvSye0rgTBIlDHCN
2216
+ Aymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyHB5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ
2217
+ 4Q7e2RCOFvu396j3x+UCB5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6aw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HBcnWEvgJBQl9n
2231
+ JEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57demyPxgcYxn/eR44/KJ4EBs+lVDR3veyJ
2232
+ m+kXQ99b21/+jh5Xos1AnX5iItreGCc=
2233
+ -----END CERTIFICATE-----
tags/5.3.1/tools/src/Deconf/Logger/Abstract.php ADDED
@@ -0,0 +1,408 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ if (!class_exists('Deconf_Client')) {
19
+ require_once dirname(__FILE__) . '/../autoload.php';
20
+ }
21
+
22
+ /**
23
+ * Abstract logging class based on the PSR-3 standard.
24
+ *
25
+ * NOTE: We don't implement `Psr\Log\LoggerInterface` because we need to
26
+ * maintain PHP 5.2 support.
27
+ *
28
+ * @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
29
+ */
30
+ abstract class Deconf_Logger_Abstract
31
+ {
32
+ /**
33
+ * Default log format
34
+ */
35
+ const DEFAULT_LOG_FORMAT = "[%datetime%] %level%: %message% %context%\n";
36
+ /**
37
+ * Default date format
38
+ *
39
+ * Example: 16/Nov/2014:03:26:16 -0500
40
+ */
41
+ const DEFAULT_DATE_FORMAT = 'd/M/Y:H:i:s O';
42
+
43
+ /**
44
+ * System is unusable
45
+ */
46
+ const EMERGENCY = 'emergency';
47
+ /**
48
+ * Action must be taken immediately
49
+ *
50
+ * Example: Entire website down, database unavailable, etc. This should
51
+ * trigger the SMS alerts and wake you up.
52
+ */
53
+ const ALERT = 'alert';
54
+ /**
55
+ * Critical conditions
56
+ *
57
+ * Example: Application component unavailable, unexpected exception.
58
+ */
59
+ const CRITICAL = 'critical';
60
+ /**
61
+ * Runtime errors that do not require immediate action but should typically
62
+ * be logged and monitored.
63
+ */
64
+ const ERROR = 'error';
65
+ /**
66
+ * Exceptional occurrences that are not errors.
67
+ *
68
+ * Example: Use of deprecated APIs, poor use of an API, undesirable things
69
+ * that are not necessarily wrong.
70
+ */
71
+ const WARNING = 'warning';
72
+ /**
73
+ * Normal but significant events.
74
+ */
75
+ const NOTICE = 'notice';
76
+ /**
77
+ * Interesting events.
78
+ *
79
+ * Example: User logs in, SQL logs.
80
+ */
81
+ const INFO = 'info';
82
+ /**
83
+ * Detailed debug information.
84
+ */
85
+ const DEBUG = 'debug';
86
+
87
+ /**
88
+ * @var array $levels Logging levels
89
+ */
90
+ protected static $levels = array(
91
+ self::EMERGENCY => 600,
92
+ self::ALERT => 550,
93
+ self::CRITICAL => 500,
94
+ self::ERROR => 400,
95
+ self::WARNING => 300,
96
+ self::NOTICE => 250,
97
+ self::INFO => 200,
98
+ self::DEBUG => 100,
99
+ );
100
+
101
+ /**
102
+ * @var integer $level The minimum logging level
103
+ */
104
+ protected $level = self::DEBUG;
105
+
106
+ /**
107
+ * @var string $logFormat The current log format
108
+ */
109
+ protected $logFormat = self::DEFAULT_LOG_FORMAT;
110
+ /**
111
+ * @var string $dateFormat The current date format
112
+ */
113
+ protected $dateFormat = self::DEFAULT_DATE_FORMAT;
114
+
115
+ /**
116
+ * @var boolean $allowNewLines If newlines are allowed
117
+ */
118
+ protected $allowNewLines = false;
119
+
120
+ /**
121
+ * @param Deconf_Client $client The current Google client
122
+ */
123
+ public function __construct(Deconf_Client $client)
124
+ {
125
+ $this->setLevel(
126
+ $client->getClassConfig('Deconf_Logger_Abstract', 'level')
127
+ );
128
+
129
+ $format = $client->getClassConfig('Deconf_Logger_Abstract', 'log_format');
130
+ $this->logFormat = $format ? $format : self::DEFAULT_LOG_FORMAT;
131
+
132
+ $format = $client->getClassConfig('Deconf_Logger_Abstract', 'date_format');
133
+ $this->dateFormat = $format ? $format : self::DEFAULT_DATE_FORMAT;
134
+
135
+ $this->allowNewLines = (bool) $client->getClassConfig(
136
+ 'Deconf_Logger_Abstract',
137
+ 'allow_newlines'
138
+ );
139
+ }
140
+
141
+ /**
142
+ * Sets the minimum logging level that this logger handles.
143
+ *
144
+ * @param integer $level
145
+ */
146
+ public function setLevel($level)
147
+ {
148
+ $this->level = $this->normalizeLevel($level);
149
+ }
150
+
151
+ /**
152
+ * Checks if the logger should handle messages at the provided level.
153
+ *
154
+ * @param integer $level
155
+ * @return boolean
156
+ */
157
+ public function shouldHandle($level)
158
+ {
159
+ return $this->normalizeLevel($level) >= $this->level;
160
+ }
161
+
162
+ /**
163
+ * System is unusable.
164
+ *
165
+ * @param string $message The log message
166
+ * @param array $context The log context
167
+ */
168
+ public function emergency($message, array $context = array())
169
+ {
170
+ $this->log(self::EMERGENCY, $message, $context);
171
+ }
172
+
173
+ /**
174
+ * Action must be taken immediately.
175
+ *
176
+ * Example: Entire website down, database unavailable, etc. This should
177
+ * trigger the SMS alerts and wake you up.
178
+ *
179
+ * @param string $message The log message
180
+ * @param array $context The log context
181
+ */
182
+ public function alert($message, array $context = array())
183
+ {
184
+ $this->log(self::ALERT, $message, $context);
185
+ }
186
+
187
+ /**
188
+ * Critical conditions.
189
+ *
190
+ * Example: Application component unavailable, unexpected exception.
191
+ *
192
+ * @param string $message The log message
193
+ * @param array $context The log context
194
+ */
195
+ public function critical($message, array $context = array())
196
+ {
197
+ $this->log(self::CRITICAL, $message, $context);
198
+ }
199
+
200
+ /**
201
+ * Runtime errors that do not require immediate action but should typically
202
+ * be logged and monitored.
203
+ *
204
+ * @param string $message The log message
205
+ * @param array $context The log context
206
+ */
207
+ public function error($message, array $context = array())
208
+ {
209
+ $this->log(self::ERROR, $message, $context);
210
+ }
211
+
212
+ /**
213
+ * Exceptional occurrences that are not errors.
214
+ *
215
+ * Example: Use of deprecated APIs, poor use of an API, undesirable things
216
+ * that are not necessarily wrong.
217
+ *
218
+ * @param string $message The log message
219
+ * @param array $context The log context
220
+ */
221
+ public function warning($message, array $context = array