WordPress Social Sharing Plugin – Social Warfare - Version 3.3.0

Version Description

(11 SEP 2018) = * Added CSS to hide buttons on print views. * Added Mix to the Social Networks. * Added "url" paramter to the shortcode. * Fixed plugin compatability issue with BuddyPress. * Fixed the decimal separator for share counts. * Updated the option-getting mechanism (global $swp_user_options is now deprecated). * Updated the sidebar in the Social Warfare settings page. * Updated the plugin file structure and organization.

Download this release

Release Info

Developer WarfarePlugins
Plugin Icon 128x128 WordPress Social Sharing Plugin – Social Warfare
Version 3.3.0
Comparing to
See all releases

Code changes from version 3.2.2 to 3.3.0

Files changed (198) hide show
  1. .gitignore +7 -0
  2. README.md +0 -0
  3. {css → assets/css}/admin-options-page.css +5 -5
  4. {css → assets/css}/admin-options-page.min.css +1 -1
  5. {css → assets/css}/admin-options.min.css +0 -0
  6. {css → assets/css}/admin.css +59 -3
  7. assets/css/admin.min.css +1 -0
  8. {css → assets/css}/style.css +35 -23
  9. assets/css/style.min.css +1 -0
  10. assets/fonts/sw-icon-font.eot +0 -0
  11. {fonts → assets/fonts}/sw-icon-font.svg +3 -4
  12. assets/fonts/sw-icon-font.ttf +0 -0
  13. assets/fonts/sw-icon-font.woff +0 -0
  14. {images → assets/images}/admin-options-page/Thumbs.db +0 -0
  15. {images → assets/images}/admin-options-page/affiliate-300x150.jpg +0 -0
  16. {images → assets/images}/admin-options-page/measure-roi-300x150.jpg +0 -0
  17. {images → assets/images}/admin-options-page/new_share_counts.png +0 -0
  18. {images → assets/images}/admin-options-page/social-warfare-light.png +0 -0
  19. {images → assets/images}/admin-options-page/social-warfare-pro-light.png +0 -0
  20. {images → assets/images}/admin-options-page/socialwarfare-20x20.png +0 -0
  21. {images → assets/images}/admin-options-page/starter-guide-300x150.jpg +0 -0
  22. {images → assets/images}/img-placeholder-og.jpg +0 -0
  23. {images → assets/images}/img-placeholder-pin.jpg +0 -0
  24. {js → assets/js}/admin-options-page.js +0 -0
  25. {js → assets/js}/admin-options-page.min.js +0 -0
  26. {js → assets/js}/admin.js +356 -356
  27. {js → assets/js}/admin.min.js +0 -0
  28. {js → assets/js}/script.js +29 -27
  29. assets/js/script.min.js +1 -0
  30. {js → assets/js}/sw-shortcode-generator.js +0 -0
  31. {js → assets/js}/sw-shortcode-generator.min.js +0 -0
  32. css/admin.min.css +0 -1
  33. css/style.min.css +0 -1
  34. fonts/sw-icon-font.eot +0 -0
  35. fonts/sw-icon-font.ttf +0 -0
  36. fonts/sw-icon-font.woff +0 -0
  37. functions/admin/options-fetch.php +0 -156
  38. functions/admin/options-registration.php +0 -87
  39. functions/admin/registration.php +0 -347
  40. functions/includes/SWP_Addon.php +0 -271
  41. functions/includes/registration.php +0 -59
  42. functions/options/SWP_User_Options.php +0 -34
  43. functions/utilities/utility.php +0 -564
  44. js/script.min.js +0 -0
  45. languages/social-warfare-da-DK.mo +0 -0
  46. languages/social-warfare-de_DE.mo +0 -0
  47. languages/social-warfare-en_US.mo +0 -0
  48. languages/social-warfare-es_ES.mo +0 -0
  49. languages/social-warfare-fr_FR.mo +0 -0
  50. languages/social-warfare-hy.mo +0 -0
  51. languages/social-warfare-it_IT.mo +0 -0
  52. languages/social-warfare-pt_BR.mo +0 -0
  53. languages/social-warfare-pt_PT.mo +0 -0
  54. languages/social-warfare-ru_RU.mo +0 -0
  55. languages/social-warfare-uk.mo +0 -0
  56. languages/social-warfare.pot +2 -2
  57. languages/social_warfare-el_EL.mo +0 -0
  58. languages/social_warfare-nl_NL.mo +0 -0
  59. {functions → lib}/Social_Warfare.php +123 -81
  60. lib/Social_Warfare_Addon.php +300 -0
  61. {functions → lib}/admin/SWP_Click_To_Tweet.php +0 -0
  62. {functions → lib}/admin/SWP_Column.php +1 -1
  63. {functions → lib}/admin/SWP_Settings_Link.php +0 -0
  64. {functions → lib}/admin/SWP_Shortcode_Generator.php +1 -1
  65. lib/admin/SWP_Sidebar_Loader.php +75 -0
  66. {functions → lib}/admin/SWP_User_Profile.php +0 -0
  67. {functions → lib}/admin/assets/css/admin.css +0 -0
  68. {functions → lib}/admin/assets/css/style1.css +0 -0
  69. {functions → lib}/admin/assets/css/style2.css +0 -0
  70. {functions → lib}/admin/assets/css/style3.css +0 -0
  71. {functions → lib}/admin/assets/css/style4.css +0 -0
  72. {functions → lib}/admin/assets/css/styles.css +0 -0
  73. {functions → lib}/admin/assets/img/twitter-little-bird-button.png +0 -0
  74. {functions → lib}/admin/assets/img/twitter-little-bird-white.png +0 -0
  75. {functions → lib}/admin/assets/img/twitter-little-bird.png +0 -0
  76. {functions → lib}/admin/assets/js/clickToTweet.js +0 -0
  77. {functions → lib}/admin/assets/js/clickToTweet.min.js +0 -0
  78. {functions → lib}/admin/assets/js/tmclicktotweet_plugin.js +0 -0
  79. {functions → lib}/admin/swp_system_checker.php +0 -0
  80. {functions → lib}/frontend-output/SWP_Buttons_Panel.php +179 -141
  81. {functions → lib}/frontend-output/SWP_Display.php +9 -7
  82. {functions → lib}/frontend-output/SWP_Header_Output.php +2 -2
  83. {functions → lib}/frontend-output/SWP_Option_Page_Registration.php +0 -0
  84. {functions → lib}/frontend-output/SWP_Script.php +12 -12
  85. {functions → lib}/frontend-output/SWP_Shortcode.php +36 -30
  86. {functions → lib}/options/SWP_Option.php +19 -3
  87. {functions → lib}/options/SWP_Option_Icons.php +57 -25
  88. {functions → lib}/options/SWP_Option_Select.php +12 -0
  89. {functions → lib}/options/SWP_Option_Text.php +9 -0
  90. {functions → lib}/options/SWP_Option_Textarea.php +0 -0
  91. {functions → lib}/options/SWP_Option_Toggle.php +10 -0
  92. {functions → lib}/options/SWP_Options_Page.php +27 -30
  93. {functions → lib}/options/SWP_Options_Page_Section.php +1 -1
  94. {functions → lib}/options/SWP_Options_Page_Tab.php +0 -0
  95. functions/options/SWP_Addon_Registration.php → lib/options/SWP_Registration_Tab_Template.php +50 -1
  96. {functions → lib}/options/SWP_Section_HTML.php +105 -43
  97. lib/options/SWP_User_Options.php +226 -0
  98. {functions → lib}/social-networks/SWP_Facebook.php +2 -3
  99. {functions → lib}/social-networks/SWP_Google_Plus.php +0 -0
  100. {functions → lib}/social-networks/SWP_Linkedin.php +0 -0
  101. lib/social-networks/SWP_Mix.php +68 -0
  102. {functions → lib}/social-networks/SWP_Pinterest.php +1 -1
  103. {functions → lib}/social-networks/SWP_Social_Network.php +12 -11
  104. {functions → lib}/social-networks/SWP_Social_Networks_Loader.php +0 -0
  105. {functions → lib}/social-networks/SWP_Stumble_Upon.php +0 -0
  106. {functions → lib}/social-networks/SWP_Twitter.php +42 -22
  107. {functions/plugin-update-checker → lib/update-checker}/.editorconfig +0 -0
  108. {functions/plugin-update-checker → lib/update-checker}/Puc/v4/Factory.php +0 -0
  109. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Autoloader.php +0 -0
  110. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/Extension.php +1 -1
  111. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/Panel.php +0 -0
  112. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/PluginExtension.php +0 -0
  113. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/PluginPanel.php +0 -0
  114. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/ThemePanel.php +0 -0
  115. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Factory.php +0 -0
  116. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/InstalledPackage.php +1 -1
  117. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Metadata.php +0 -0
  118. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/OAuthSignature.php +0 -0
  119. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/Info.php +0 -0
  120. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/Package.php +0 -0
  121. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/Ui.php +0 -0
  122. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/Update.php +0 -0
  123. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/UpdateChecker.php +0 -0
  124. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Scheduler.php +0 -0
  125. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/StateStore.php +0 -0
  126. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Theme/Package.php +0 -0
  127. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Theme/Update.php +0 -0
  128. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Theme/UpdateChecker.php +0 -0
  129. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Update.php +0 -0
  130. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/UpdateChecker.php +0 -0
  131. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/UpgraderStatus.php +0 -0
  132. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Utils.php +0 -0
  133. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/Api.php +0 -0
  134. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/BaseChecker.php +0 -0
  135. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/BitBucketApi.php +0 -0
  136. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/GitHubApi.php +0 -0
  137. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/GitLabApi.php +0 -0
  138. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/PluginUpdateChecker.php +0 -0
  139. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/Reference.php +0 -0
  140. {functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/ThemeUpdateChecker.php +0 -0
  141. {functions/plugin-update-checker → lib/update-checker}/README.md +0 -0
  142. {functions/plugin-update-checker → lib/update-checker}/composer.json +21 -21
  143. {functions/plugin-update-checker → lib/update-checker}/css/puc-debug-bar.css +0 -0
  144. {functions/plugin-update-checker → lib/update-checker}/examples/plugin.json +51 -51
  145. {functions/plugin-update-checker → lib/update-checker}/examples/theme.json +4 -4
  146. {functions/plugin-update-checker → lib/update-checker}/js/debug-bar.js +0 -0
  147. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-cs_CZ.mo +0 -0
  148. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-cs_CZ.po +45 -45
  149. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-da_DK.mo +0 -0
  150. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-da_DK.po +0 -0
  151. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-de_DE.mo +0 -0
  152. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-de_DE.po +0 -0
  153. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fa_IR.mo +0 -0
  154. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fa_IR.po +0 -0
  155. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fr_CA.mo +0 -0
  156. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fr_CA.po +0 -0
  157. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fr_FR.mo +0 -0
  158. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fr_FR.po +0 -0
  159. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-hu_HU.mo +0 -0
  160. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-hu_HU.po +0 -0
  161. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-it_IT.mo +0 -0
  162. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-it_IT.po +0 -0
  163. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-ja.mo +0 -0
  164. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-ja.po +0 -0
  165. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-nl_BE.mo +0 -0
  166. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-nl_BE.po +0 -0
  167. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-nl_NL.mo +0 -0
  168. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-nl_NL.po +0 -0
  169. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-pt_BR.mo +0 -0
  170. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-pt_BR.po +0 -0
  171. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-sv_SE.mo +0 -0
  172. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-sv_SE.po +0 -0
  173. {functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker.pot +0 -0
  174. {functions/plugin-update-checker → lib/update-checker}/license.txt +0 -0
  175. {functions/plugin-update-checker → lib/update-checker}/plugin-update-checker.php +0 -0
  176. {functions/plugin-update-checker → lib/update-checker}/vendor/Parsedown.php +0 -0
  177. {functions/plugin-update-checker → lib/update-checker}/vendor/ParsedownLegacy.php +0 -0
  178. {functions/plugin-update-checker → lib/update-checker}/vendor/readme-parser.php +0 -0
  179. {functions → lib}/utilities/SWP_Abstract.php +13 -17
  180. {functions → lib}/utilities/SWP_CURL.php +1 -1
  181. {functions → lib}/utilities/SWP_Compatibility.php +2 -2
  182. {functions → lib}/utilities/SWP_Database_Migration.php +37 -49
  183. {functions → lib}/utilities/SWP_JSON_Cache_Handler.php +2 -2
  184. {functions → lib}/utilities/SWP_Localization.php +0 -0
  185. {functions → lib}/utilities/SWP_Notice.php +6 -6
  186. {functions → lib}/utilities/SWP_Notice_Loader.php +1 -1
  187. {functions → lib}/utilities/SWP_Permalink.php +0 -0
  188. {functions → lib}/utilities/SWP_Plugin_Updater.php +1 -1
  189. {functions → lib}/utilities/SWP_Post_Cache.php +21 -10
  190. {functions → lib}/utilities/SWP_Post_Cache_Loader.php +0 -0
  191. {functions → lib}/utilities/SWP_URL_Management.php +75 -148
  192. lib/utilities/SWP_Utility.php +291 -0
  193. {functions → lib}/utilities/SWP_Utility_Trait.php +0 -0
  194. lib/utilities/functions.php +24 -0
  195. {functions → lib}/widgets/SWP_Popular_Posts_Widget.php +2 -2
  196. {functions → lib}/widgets/SWP_Widget.php +0 -0
  197. readme.txt +10 -4
  198. social-warfare.php +5 -5
.gitignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ functions/admin/SWP_Options_Pseudo_Code.php
2
+ functions/options/options-page-working.php
3
+ functions/options/options.txt
4
+ remote-sync.json
5
+ .remote-sync.json
6
+ .DS_Store
7
+ functions/utilities/testing.php
README.md CHANGED
File without changes
{css → assets/css}/admin-options-page.css RENAMED
@@ -657,13 +657,13 @@ p.sw-subtitle.sw-registration-text {
657
  border-color: #27313f;
658
  }
659
 
660
- .sw-stumbleupon-icon:before {
661
- content: 'q';
662
  }
663
 
664
- .sw-s.sw-stumbleupon-icon {
665
- background-color: #ef5025;
666
- border-color: #d34427;
667
  }
668
 
669
  .sw-reddit-icon:before {
657
  border-color: #27313f;
658
  }
659
 
660
+ .sw-mix-icon:before {
661
+ content: 'g';
662
  }
663
 
664
+ .sw-s.sw-mix-icon {
665
+ background-color: #f4812c;
666
+ border-color: #c96a29;
667
  }
668
 
669
  .sw-reddit-icon:before {
{css → assets/css}/admin-options-page.min.css RENAMED
@@ -1 +1 @@
1
- .sw-grid{float:left;margin-bottom:2.127659574468%;padding-top:0}.sw-grid-right{float:right;margin-bottom:2.127659574468%;padding-top:0}.sw-col-60,.sw-col-140,.sw-col-220,.sw-col-300,.sw-col-380,.sw-col-460,.sw-col-540,.sw-col-620,.sw-col-700,.sw-col-780,.sw-col-860{margin-right:2.127659574468%}.sw-col-60{width:6.382978723404%}.sw-col-140{width:14.893617021277%}.sw-col-220{width:23.404255319149%}.sw-col-300{width:31.914893617021%}.sw-col-380{width:40.425531914894%}.sw-col-460{width:48.936170212766%}.sw-col-540{width:57.446808510638%}.sw-col-620{width:65.957446808511%}.sw-col-700{width:74.468085106383%}.sw-col-780{width:82.978723404255%}.sw-col-860{width:91.489361702128%}.sw-col-940{width:100%}.sw-fit{margin-left:0!important;margin-right:0!important}.sw-option-container *:last-child{margin-left:0!important;margin-right:0!important}.sw-clearfix:after,.sw-clearfix:before{content:' ';display:table}.sw-clearfix:after{clear:both}.sw-clearfix{clear:both;width:100%}img{-ms-interpolation-mode:bicubic;border:0;height:auto;max-width:100%;vertical-align:middle}.sw-admin-divider{width:100%;height:1px;border-bottom:1px solid #CED3DC;margin:20px 0 40px 0}.sw-hidden{display:none!important}.swp_support_link{border:1px solid #ccc;font-size:18px;line-height:20px;text-decoration:none;-webkit-border-radius:50%;border-radius:50%;width:20px;display:block;float:right;text-align:center;color:#ccc;margin-right:20px;margin-top:4px;padding:2px;font-weight:bold}.swp_support_link:hover{color:#6BCCE9;border-color:#6BCCE9}.swp_support_link.swp_four_fourths{margin-left:20px;margin-top:13px}#screen-meta-links .screen-meta-toggle{display:none!important}#wpwrap,#wpcontent{background:#fff;padding-left:0}.sw-top-menu{border-bottom:1px solid #CED3DC;float:none;background:#fff;z-index:5;margin:0}.sw-top-menu[sw-registered="0"] .sw-header-logo{height:75px;float:left}.sw-top-menu[sw-registered="1"] .sw-header-logo-pro{height:75px;float:left}.sw-top-menu[sw-registered="1"] .sw-header-logo{display:none}.sw-top-menu[sw-registered="0"] .sw-header-logo-pro{display:none}.sw-header-menu{height:75px;margin:0}.sw-header-menu li{float:left;margin:0 15px;font-size:16px;display:table;height:75px}.sw-header-menu li:focus,.sw-header-menu li a:focus{outline:none;-webkit-box-shadow:none;box-shadow:none}.sw-header-menu li span{padding:0 5px 5px 5px}.sw-header-menu li.sw-active-tab span,.sw-header-menu li:hover span{border-bottom:4px solid #30394f}.sw-header-menu li a{color:#30394f;text-decoration:none;display:table-cell;vertical-align:middle}.sw-top-menu .sw-grid{margin-bottom:0}.sw-admin-wrapper,.sw-header-wrapper{clear:both;margin:20px auto 20px auto;padding:0 40px 20px 40px;position:relative}.sw-header-wrapper{margin:0}.sw-tabs-container .sw-admin-tab{display:none}.sw-tabs-container .sw-admin-tab:nth-child(1){display:block}.sw-admin-tab h2{font-size:26px;line-height:1.2;margin:0}.sw-admin-tab h2.sw-h-label{line-height:56px}p.sw-subtitle{font-size:16px;line-height:1.2;margin:10px 0 30px 0}p.sw-checkbox-label,p.sw-input-label,p.sw-select-label,p.sw-authenticate-label{font-size:16px;font-weight:bold;padding-left:10%}.sw-select-label.sw-no-padding{padding-left:0}p.sw-short{margin:1em 0 0 0}p.sw-subtext-label{margin-top:-10px}.sw-admin-sidebar img{margin:5px 0 10px 0}.system-status-wrapper{display:none}.system-status-container{width:90%;height:250px;overflow:hidden;border:1px solid #CED3DC;padding:5%}h3.sw-buttons-toggle{width:100px;float:left;clear:left;margin:15px 0 30px 0;padding-left:10%}.sw-checkbox-toggle{width:150px;height:46px;background-color:#30394f;float:right;margin:5px 0;cursor:pointer;-webkit-border-radius:4px;border-radius:4px;overflow:hidden;position:relative}.sw-checkbox-on,.sw-checkbox-off{color:white;font-size:15px;text-align:center;line-height:46px;position:absolute;top:0;width:50%;height:100%}.sw-checkbox-toggle[status="on"] .sw-checkbox-on{left:0;background-color:#71C069}.sw-checkbox-toggle[status="on"] .sw-checkbox-off,.sw-checkbox-toggle[status="off"] .sw-checkbox-on{display:none}.sw-admin-wrapper[sw-registered="0"] .sw-option-container[premium="1"] .sw-checkbox-toggle[status="on"] .sw-checkbox-on{display:none}.sw-admin-wrapper[sw-registered="0"] .sw-option-container[premium="1"] .sw-checkbox-toggle[status="on"] .sw-checkbox-off{right:0;background-color:#ee464f;display:block}.sw-checkbox-toggle[status="off"] .sw-checkbox-off{right:0;background-color:#ee464f}input.sw-admin-input{padding:15px;border:1px solid #ced3cd;-webkit-border-radius:4px;border-radius:4px;float:right;-webkit-box-shadow:none;box-shadow:none;margin:2px 0 1px 0;width:100%}.sw-grid select{width:100%;-webkit-box-shadow:none;box-shadow:none;border:1px solid #ced3cd;height:51px;padding:15px;margin:2px 1px 3px 0;-webkit-border-radius:4px;border-radius:4px}a.button.sw-navy-button,a.button.sw-blue-button,a.button.sw-green-button,a.button.sw-red-button{padding:15px 30px;height:auto;line-height:1;-webkit-border-radius:4px;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;float:right;margin:15px 0}a.button.sw-navy-button,a.button.sw-navy-button:focus{background:#30394f;color:#fff;border-color:#2a2d34;-webkit-box-shadow:none;box-shadow:none}a.button.sw-navy-button:hover,a.button.sw-blue-button:hover{background:#2a2d34;border-color:#2a2d34;color:#fff;-webkit-box-shadow:none;box-shadow:none}a.button.sw-blue-button,a.button.sw-blue-button:focus{background:#6bcce9;border-color:#6bcce9;color:#fff;-webkit-box-shadow:none;box-shadow:none}a.button.sw-green-button,a.button.sw-green-button:focus{background:#71C069;color:#fff;border-color:#71C069;-webkit-box-shadow:none;box-shadow:none}a.button.sw-red-button,a.button.sw-red-button:focus,a.button.sw-red-button:hover{background:#ee464f;color:#fff;border-color:#ee464f;-webkit-box-shadow:none;box-shadow:none}.sw-admin-tab a.button{margin:5px 0 15px 0}.sw-save-settings{width:100%;text-align:center}.sw-red-notice,.sw-green-notice{color:#fff;padding:15px;-webkit-border-radius:2px;border-radius:2px;margin:15px 0}.sw-red-notice,.sw-loading-message{background:#ee464f}.sw-green-notice,.sw-loading-complete{background:#71C069}.sw-loading-bg{width:100%;position:fixed;top:0;left:0;height:100%;background:rgba(0,0,0,0.8);z-index:999999999999}.sw-loading-message:before,.sw-green-notice:before,.sw-loading-complete:before{font-family:'Dashicons';font-size:26px;margin:0 15px 0 0;vertical-align:middle}.sw-red-notice:before,.sw-red-notice:before{font-family:'sw-icon-font';font-size:26px;margin:0 15px 0 0;vertical-align:middle;content:'E'}.sw-red-notice a{color:#fff;font-weight:bold;text-decoration:none;border-bottom:2px solid #fff}.sw-red-notice a:hover{color:#30394f;border-bottom:2px solid #30394f}.sw-loading-message:before{content:"\f158"}.sw-green-notice:before,.sw-loading-complete:before{content:"\f147"}.sw-admin-tab .two-thirds-advanced h2.sw-h-label{line-height:1.2;margin-bottom:15px}.sw-italic{font-style:italic}p.sw-subtitle.sw-registration-text{padding:20px 0 0 0;font-size:120%;line-height:175%}.registration-wrapper[registration="1"] .swp_is_not_registered{display:none}.registration-wrapper[registration="0"] .swp_is_registered{display:none}.tweet-count-wrapper[registration="true"] .swp_tweets_not_activated{display:none}.sw-tweet-count-demo{margin:20px 0}.sw-loading-message,.sw-loading-complete{position:fixed;top:50%;left:50%;-webkit-border-radius:3px;border-radius:3px;padding:25px;text-align:center;font-size:20px;color:white;width:240px;margin-top:-46px;margin-left:-120px}.sw-grid textarea{width:100%;height:120px}.sw-active,.sw-inactive{margin:0 0 5px 0;min-width:50px;min-height:40px;border:1px dashed #ced3dc;padding:0;-webkit-border-radius:4px;border-radius:4px;width:auto;height:auto;display:inline-block;max-width:520px}.sw-s{font-family:'sw-icon-font';color:#fff;padding:5px 30px 4px;margin:7px 5px 7px;-webkit-border-radius:2px;border-radius:2px;display:inline-block;font-style:normal;font-size:15px;line-height:15px;cursor:pointer}.sw-twitter-icon:before{content:'s'}.sw-s.sw-twitter-icon{background-color:#429cd6;border-color:#3c87b2}.sw-google_plus-icon:before{content:'h'}.sw-s.sw-google_plus-icon{background-color:#df4b37;border-color:#c44133}.sw-facebook-icon:before{content:'j'}.sw-s.sw-facebook-icon{background-color:#3a589e;border-color:#2e4675}.sw-pinterest-icon:before{content:'b'}.sw-s.sw-pinterest-icon{background-color:#cd2029;border-color:#aa1b29}.sw-linkedin-icon:before{content:'f'}.sw-s.sw-linkedin-icon{background-color:#0d77b7;border-color:#0c6591}.sw-tumblr-icon:before{content:'r'}.sw-s.sw-tumblr-icon{background-color:#39475d;border-color:#27313f}.sw-stumbleupon-icon:before{content:'q'}.sw-s.sw-stumbleupon-icon{background-color:#ef5025;border-color:#d34427}.sw-reddit-icon:before{content:'a'}.sw-s.sw-reddit-icon{background-color:#f04b23;border-color:#d33f27}.sw-yummly-icon:before{content:'x'}.sw-s.sw-yummly-icon{background-color:#e26426;border-color:#b65027}.sw-whatsapp-icon:before{content:'y'}.sw-s.sw-whatsapp-icon{background-color:#71c169;border-color:#28b04b}.sw-pocket-icon:before{content:'B'}.sw-s.sw-pocket-icon{background-color:#ef4056;border-color:#ce3d55}.sw-buffer-icon:before{content:'z'}.sw-s.sw-buffer-icon{background-color:#323b43;border-color:#59626a}.sw-email-icon:before{content:'k'}.sw-s.sw-email-icon{background-color:#6bcce9;border-color:#6bcce9}.sw-hacker_news-icon:before{content:'D'}.sw-s.sw-hacker_news-icon{background-color:#f16522;border-color:#d85623}.sw-flipboard-icon:before{content:'C'}.sw-s.sw-flipboard-icon{background-color:#e02828;border-color:#bf2626}@media screen and (max-width:1350px){.sw-header-menu li{font-size:12px;margin:0 10px}}@media screen and (max-width:1080px){.sw-header-logo{display:none}}.sw-admin-wrapper[sw-registered="0"] [premium="1"]{display:none!important}.sw-admin-wrapper[sw-registered="0"] .sw-option-container{position:relative}.sw-admin-wrapper[sw-registered="0"] [premium="1"] .sw-premium-blocker{display:none}.sw-admin-wrapper[sw-registered="0"] [premium="1"] .sw-premium-blocker:not(.no-icon):before{font-family:'sw-icon-font';content:'E';font-size:24px;float:right;margin:20px 20px 0 0}.sw-admin-wrapper[sw-registered="0"] i[premium-button="1"]{display:none}.sw-admin-wrapper[sw-registered="1"] .sw-premium-buttons{display:none}.sw-admin-wrapper[swp-addons*="pro"] [premium],.sw-admin-wrapper[swp-addons*="affiliatewp"] [premium],.sw-admin-wrapper[swp-addons*="enhanced_shortcodes"] [premium],.sw-admin-wrapper[swp-addons*="advanced_display"] [premium]{display:none}.sw-admin-wrapper[swp-addons*="pro"][swp-registrations*="pro"] [premium],.sw-admin-wrapper[swp-addons*="affiliatewp"][swp-registrations*="affiliatewp"] [premium],.sw-admin-wrapper[swp-addons*="enhanced_shortcodes"][swp-registrations*="enhanced_shortcodes"] [premium],.sw-admin-wrapper[swp-addons*="advanced_display"][swp-registrations*="advanced_display"] [premium]{display:inherit}.ui-tooltip.sw-admin-hover-notice{background:#ee464f;color:#fff;padding:15px;-webkit-border-radius:2px;border-radius:2px;margin:15px 0;border:0;-webkit-box-shadow:none;box-shadow:none;max-width:none;padding:20px}.sw-admin-hover-notice i:before{font-family:'sw-icon-font';font-size:26px;margin:0 15px 0 0;vertical-align:middle;content:'E';float:left;font-style:normal}.swp_upload_image_field{display:none}.sw-admin-image-preview{max-height:50px;float:right}.toplevel_page_social-warfare .notice-error,.toplevel_page_social-warfare .notice-warning,.toplevel_page_social-warfare .notice-success,.toplevel_page_social-warfare .notice-info,.toplevel_page_social-warfare .is-dismissible,.toplevel_page_social-warfare .update-nag,.toplevel_page_social-warfare #notice-error,.toplevel_page_social-warfare #notice-warning,.toplevel_page_social-warfare #notice-success,.toplevel_page_social-warfare #notice-info,.toplevel_page_social-warfare #is-dismissible,.toplevel_page_social-warfare #update-nag,div.error{display:none}.toplevel_page_social-warfare .sw-admin-wrapper .notice-error,.toplevel_page_social-warfare .sw-admin-wrapper .notice-warning,.toplevel_page_social-warfare .sw-admin-wrapper .notice-success,.toplevel_page_social-warfare .sw-admin-wrapper .notice-info,.toplevel_page_social-warfare .sw-admin-wrapper .is-dismissible,.toplevel_page_social-warfare .sw-admin-wrapper .update-nag,.toplevel_page_social-warfare .sw-admin-wrapper #notice-error,.toplevel_page_social-warfare .sw-admin-wrapper #notice-warning,.toplevel_page_social-warfare .sw-admin-wrapper #notice-success,.toplevel_page_social-warfare .sw-admin-wrapper #notice-info,.toplevel_page_social-warfare .sw-admin-wrapper #is-dismissible,.toplevel_page_social-warfare .sw-admin-wrapper #update-nag,div.error{display:block}.sw-grid-textarea{border:rgb(221,221,221);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);height:120px;width:97%}#color-notice{position:fixed;bottom:15px;margin:0 auto;left:25%;right:25%;background:rgba( 255,225,255,.37 );background-color:#ced3dc;color:#30394f;padding:20px;border-radius:4px;text-align:left;width:650px}#color-notice p{font-size:16px;padding:0;margin:0}#color-notice .color-dismiss{float:right;color:#fff;font-weight:600}#color-notice .color-dismiss:before{content:'x';background:#30394f;border-radius:50%;width:26px;display:block;text-align:center;height:26px;line-height:22px;font-size:22px;cursor:pointer;padding:0;opacity:.4}
1
+ .sw-grid{float:left;margin-bottom:2.127659574468%;padding-top:0}.sw-grid-right{float:right;margin-bottom:2.127659574468%;padding-top:0}.sw-col-60,.sw-col-140,.sw-col-220,.sw-col-300,.sw-col-380,.sw-col-460,.sw-col-540,.sw-col-620,.sw-col-700,.sw-col-780,.sw-col-860{margin-right:2.127659574468%}.sw-col-60{width:6.382978723404%}.sw-col-140{width:14.893617021277%}.sw-col-220{width:23.404255319149%}.sw-col-300{width:31.914893617021%}.sw-col-380{width:40.425531914894%}.sw-col-460{width:48.936170212766%}.sw-col-540{width:57.446808510638%}.sw-col-620{width:65.957446808511%}.sw-col-700{width:74.468085106383%}.sw-col-780{width:82.978723404255%}.sw-col-860{width:91.489361702128%}.sw-col-940{width:100%}.sw-fit{margin-left:0!important;margin-right:0!important}.sw-option-container *:last-child{margin-left:0!important;margin-right:0!important}.sw-clearfix:after,.sw-clearfix:before{content:' ';display:table}.sw-clearfix:after{clear:both}.sw-clearfix{clear:both;width:100%}img{-ms-interpolation-mode:bicubic;border:0;height:auto;max-width:100%;vertical-align:middle}.sw-admin-divider{width:100%;height:1px;border-bottom:1px solid #CED3DC;margin:20px 0 40px 0}.sw-hidden{display:none!important}.swp_support_link{border:1px solid #ccc;font-size:18px;line-height:20px;text-decoration:none;-webkit-border-radius:50%;border-radius:50%;width:20px;display:block;float:right;text-align:center;color:#ccc;margin-right:20px;margin-top:4px;padding:2px;font-weight:bold}.swp_support_link:hover{color:#6BCCE9;border-color:#6BCCE9}.swp_support_link.swp_four_fourths{margin-left:20px;margin-top:13px}#screen-meta-links .screen-meta-toggle{display:none!important}#wpwrap,#wpcontent{background:#fff;padding-left:0}.sw-top-menu{border-bottom:1px solid #CED3DC;float:none;background:#fff;z-index:5;margin:0}.sw-top-menu[sw-registered="0"] .sw-header-logo{height:75px;float:left}.sw-top-menu[sw-registered="1"] .sw-header-logo-pro{height:75px;float:left}.sw-top-menu[sw-registered="1"] .sw-header-logo{display:none}.sw-top-menu[sw-registered="0"] .sw-header-logo-pro{display:none}.sw-header-menu{height:75px;margin:0}.sw-header-menu li{float:left;margin:0 15px;font-size:16px;display:table;height:75px}.sw-header-menu li:focus,.sw-header-menu li a:focus{outline:none;-webkit-box-shadow:none;box-shadow:none}.sw-header-menu li span{padding:0 5px 5px 5px}.sw-header-menu li.sw-active-tab span,.sw-header-menu li:hover span{border-bottom:4px solid #30394f}.sw-header-menu li a{color:#30394f;text-decoration:none;display:table-cell;vertical-align:middle}.sw-top-menu .sw-grid{margin-bottom:0}.sw-admin-wrapper,.sw-header-wrapper{clear:both;margin:20px auto 20px auto;padding:0 40px 20px 40px;position:relative}.sw-header-wrapper{margin:0}.sw-tabs-container .sw-admin-tab{display:none}.sw-tabs-container .sw-admin-tab:nth-child(1){display:block}.sw-admin-tab h2{font-size:26px;line-height:1.2;margin:0}.sw-admin-tab h2.sw-h-label{line-height:56px}p.sw-subtitle{font-size:16px;line-height:1.2;margin:10px 0 30px 0}p.sw-checkbox-label,p.sw-input-label,p.sw-select-label,p.sw-authenticate-label{font-size:16px;font-weight:bold;padding-left:10%}.sw-select-label.sw-no-padding{padding-left:0}p.sw-short{margin:1em 0 0 0}p.sw-subtext-label{margin-top:-10px}.sw-admin-sidebar img{margin:5px 0 10px 0}.system-status-wrapper{display:none}.system-status-container{width:90%;height:250px;overflow:hidden;border:1px solid #CED3DC;padding:5%}h3.sw-buttons-toggle{width:100px;float:left;clear:left;margin:15px 0 30px 0;padding-left:10%}.sw-checkbox-toggle{width:150px;height:46px;background-color:#30394f;float:right;margin:5px 0;cursor:pointer;-webkit-border-radius:4px;border-radius:4px;overflow:hidden;position:relative}.sw-checkbox-on,.sw-checkbox-off{color:white;font-size:15px;text-align:center;line-height:46px;position:absolute;top:0;width:50%;height:100%}.sw-checkbox-toggle[status="on"] .sw-checkbox-on{left:0;background-color:#71C069}.sw-checkbox-toggle[status="on"] .sw-checkbox-off,.sw-checkbox-toggle[status="off"] .sw-checkbox-on{display:none}.sw-admin-wrapper[sw-registered="0"] .sw-option-container[premium="1"] .sw-checkbox-toggle[status="on"] .sw-checkbox-on{display:none}.sw-admin-wrapper[sw-registered="0"] .sw-option-container[premium="1"] .sw-checkbox-toggle[status="on"] .sw-checkbox-off{right:0;background-color:#ee464f;display:block}.sw-checkbox-toggle[status="off"] .sw-checkbox-off{right:0;background-color:#ee464f}input.sw-admin-input{padding:15px;border:1px solid #ced3cd;-webkit-border-radius:4px;border-radius:4px;float:right;-webkit-box-shadow:none;box-shadow:none;margin:2px 0 1px 0;width:100%}.sw-grid select{width:100%;-webkit-box-shadow:none;box-shadow:none;border:1px solid #ced3cd;height:51px;padding:15px;margin:2px 1px 3px 0;-webkit-border-radius:4px;border-radius:4px}a.button.sw-navy-button,a.button.sw-blue-button,a.button.sw-green-button,a.button.sw-red-button{padding:15px 30px;height:auto;line-height:1;-webkit-border-radius:4px;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;float:right;margin:15px 0}a.button.sw-navy-button,a.button.sw-navy-button:focus{background:#30394f;color:#fff;border-color:#2a2d34;-webkit-box-shadow:none;box-shadow:none}a.button.sw-navy-button:hover,a.button.sw-blue-button:hover{background:#2a2d34;border-color:#2a2d34;color:#fff;-webkit-box-shadow:none;box-shadow:none}a.button.sw-blue-button,a.button.sw-blue-button:focus{background:#6bcce9;border-color:#6bcce9;color:#fff;-webkit-box-shadow:none;box-shadow:none}a.button.sw-green-button,a.button.sw-green-button:focus{background:#71C069;color:#fff;border-color:#71C069;-webkit-box-shadow:none;box-shadow:none}a.button.sw-red-button,a.button.sw-red-button:focus,a.button.sw-red-button:hover{background:#ee464f;color:#fff;border-color:#ee464f;-webkit-box-shadow:none;box-shadow:none}.sw-admin-tab a.button{margin:5px 0 15px 0}.sw-save-settings{width:100%;text-align:center}.sw-red-notice,.sw-green-notice{color:#fff;padding:15px;-webkit-border-radius:2px;border-radius:2px;margin:15px 0}.sw-red-notice,.sw-loading-message{background:#ee464f}.sw-green-notice,.sw-loading-complete{background:#71C069}.sw-loading-bg{width:100%;position:fixed;top:0;left:0;height:100%;background:rgba(0,0,0,0.8);z-index:999999999999}.sw-loading-message:before,.sw-green-notice:before,.sw-loading-complete:before{font-family:'Dashicons';font-size:26px;margin:0 15px 0 0;vertical-align:middle}.sw-red-notice:before,.sw-red-notice:before{font-family:'sw-icon-font';font-size:26px;margin:0 15px 0 0;vertical-align:middle;content:'E'}.sw-red-notice a{color:#fff;font-weight:bold;text-decoration:none;border-bottom:2px solid #fff}.sw-red-notice a:hover{color:#30394f;border-bottom:2px solid #30394f}.sw-loading-message:before{content:"\f158"}.sw-green-notice:before,.sw-loading-complete:before{content:"\f147"}.sw-admin-tab .two-thirds-advanced h2.sw-h-label{line-height:1.2;margin-bottom:15px}.sw-italic{font-style:italic}p.sw-subtitle.sw-registration-text{padding:20px 0 0 0;font-size:120%;line-height:175%}.registration-wrapper[registration="1"] .swp_is_not_registered{display:none}.registration-wrapper[registration="0"] .swp_is_registered{display:none}.tweet-count-wrapper[registration="true"] .swp_tweets_not_activated{display:none}.sw-tweet-count-demo{margin:20px 0}.sw-loading-message,.sw-loading-complete{position:fixed;top:50%;left:50%;-webkit-border-radius:3px;border-radius:3px;padding:25px;text-align:center;font-size:20px;color:white;width:240px;margin-top:-46px;margin-left:-120px}.sw-grid textarea{width:100%;height:120px}.sw-active,.sw-inactive{margin:0 0 5px 0;min-width:50px;min-height:40px;border:1px dashed #ced3dc;padding:0;-webkit-border-radius:4px;border-radius:4px;width:auto;height:auto;display:inline-block;max-width:520px}.sw-s{font-family:'sw-icon-font';color:#fff;padding:5px 30px 4px;margin:7px 5px 7px;-webkit-border-radius:2px;border-radius:2px;display:inline-block;font-style:normal;font-size:15px;line-height:15px;cursor:pointer}.sw-twitter-icon:before{content:'s'}.sw-s.sw-twitter-icon{background-color:#429cd6;border-color:#3c87b2}.sw-google_plus-icon:before{content:'h'}.sw-s.sw-google_plus-icon{background-color:#df4b37;border-color:#c44133}.sw-facebook-icon:before{content:'j'}.sw-s.sw-facebook-icon{background-color:#3a589e;border-color:#2e4675}.sw-pinterest-icon:before{content:'b'}.sw-s.sw-pinterest-icon{background-color:#cd2029;border-color:#aa1b29}.sw-linkedin-icon:before{content:'f'}.sw-s.sw-linkedin-icon{background-color:#0d77b7;border-color:#0c6591}.sw-tumblr-icon:before{content:'r'}.sw-s.sw-tumblr-icon{background-color:#39475d;border-color:#27313f}.sw-mix-icon:before{content:'g'}.sw-s.sw-mix-icon{background-color:#f4812c;border-color:#c96a29}.sw-reddit-icon:before{content:'a'}.sw-s.sw-reddit-icon{background-color:#f04b23;border-color:#d33f27}.sw-yummly-icon:before{content:'x'}.sw-s.sw-yummly-icon{background-color:#e26426;border-color:#b65027}.sw-whatsapp-icon:before{content:'y'}.sw-s.sw-whatsapp-icon{background-color:#71c169;border-color:#28b04b}.sw-pocket-icon:before{content:'B'}.sw-s.sw-pocket-icon{background-color:#ef4056;border-color:#ce3d55}.sw-buffer-icon:before{content:'z'}.sw-s.sw-buffer-icon{background-color:#323b43;border-color:#59626a}.sw-email-icon:before{content:'k'}.sw-s.sw-email-icon{background-color:#6bcce9;border-color:#6bcce9}.sw-hacker_news-icon:before{content:'D'}.sw-s.sw-hacker_news-icon{background-color:#f16522;border-color:#d85623}.sw-flipboard-icon:before{content:'C'}.sw-s.sw-flipboard-icon{background-color:#e02828;border-color:#bf2626}@media screen and (max-width:1350px){.sw-header-menu li{font-size:12px;margin:0 10px}}@media screen and (max-width:1080px){.sw-header-logo{display:none}}.sw-admin-wrapper[sw-registered="0"] [premium="1"]{display:none!important}.sw-admin-wrapper[sw-registered="0"] .sw-option-container{position:relative}.sw-admin-wrapper[sw-registered="0"] [premium="1"] .sw-premium-blocker{display:none}.sw-admin-wrapper[sw-registered="0"] [premium="1"] .sw-premium-blocker:not(.no-icon):before{font-family:'sw-icon-font';content:'E';font-size:24px;float:right;margin:20px 20px 0 0}.sw-admin-wrapper[sw-registered="0"] i[premium-button="1"]{display:none}.sw-admin-wrapper[sw-registered="1"] .sw-premium-buttons{display:none}.sw-admin-wrapper[swp-addons*="pro"] [premium],.sw-admin-wrapper[swp-addons*="affiliatewp"] [premium],.sw-admin-wrapper[swp-addons*="enhanced_shortcodes"] [premium],.sw-admin-wrapper[swp-addons*="advanced_display"] [premium]{display:none}.sw-admin-wrapper[swp-addons*="pro"][swp-registrations*="pro"] [premium],.sw-admin-wrapper[swp-addons*="affiliatewp"][swp-registrations*="affiliatewp"] [premium],.sw-admin-wrapper[swp-addons*="enhanced_shortcodes"][swp-registrations*="enhanced_shortcodes"] [premium],.sw-admin-wrapper[swp-addons*="advanced_display"][swp-registrations*="advanced_display"] [premium]{display:inherit}.ui-tooltip.sw-admin-hover-notice{background:#ee464f;color:#fff;padding:15px;-webkit-border-radius:2px;border-radius:2px;margin:15px 0;border:0;-webkit-box-shadow:none;box-shadow:none;max-width:none;padding:20px}.sw-admin-hover-notice i:before{font-family:'sw-icon-font';font-size:26px;margin:0 15px 0 0;vertical-align:middle;content:'E';float:left;font-style:normal}.swp_upload_image_field{display:none}.sw-admin-image-preview{max-height:50px;float:right}.toplevel_page_social-warfare .notice-error,.toplevel_page_social-warfare .notice-warning,.toplevel_page_social-warfare .notice-success,.toplevel_page_social-warfare .notice-info,.toplevel_page_social-warfare .is-dismissible,.toplevel_page_social-warfare .update-nag,.toplevel_page_social-warfare #notice-error,.toplevel_page_social-warfare #notice-warning,.toplevel_page_social-warfare #notice-success,.toplevel_page_social-warfare #notice-info,.toplevel_page_social-warfare #is-dismissible,.toplevel_page_social-warfare #update-nag,div.error{display:none}.toplevel_page_social-warfare .sw-admin-wrapper .notice-error,.toplevel_page_social-warfare .sw-admin-wrapper .notice-warning,.toplevel_page_social-warfare .sw-admin-wrapper .notice-success,.toplevel_page_social-warfare .sw-admin-wrapper .notice-info,.toplevel_page_social-warfare .sw-admin-wrapper .is-dismissible,.toplevel_page_social-warfare .sw-admin-wrapper .update-nag,.toplevel_page_social-warfare .sw-admin-wrapper #notice-error,.toplevel_page_social-warfare .sw-admin-wrapper #notice-warning,.toplevel_page_social-warfare .sw-admin-wrapper #notice-success,.toplevel_page_social-warfare .sw-admin-wrapper #notice-info,.toplevel_page_social-warfare .sw-admin-wrapper #is-dismissible,.toplevel_page_social-warfare .sw-admin-wrapper #update-nag,div.error{display:block}.sw-grid-textarea{border:rgb(221,221,221);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);height:120px;width:97%}#color-notice{position:fixed;bottom:15px;margin:0 auto;left:25%;right:25%;background:rgba( 255,225,255,.37 );background-color:#ced3dc;color:#30394f;padding:20px;border-radius:4px;text-align:left;width:650px}#color-notice p{font-size:16px;padding:0;margin:0}#color-notice .color-dismiss{float:right;color:#fff;font-weight:600}#color-notice .color-dismiss:before{content:'x';background:#30394f;border-radius:50%;width:26px;display:block;text-align:center;height:26px;line-height:22px;font-size:22px;cursor:pointer;padding:0;opacity:.4}
{css → assets/css}/admin-options.min.css RENAMED
File without changes
{css → assets/css}/admin.css RENAMED
@@ -40,11 +40,11 @@
40
  }
41
 
42
  #social_warfare .swp_og_imageWrapper ul.swpmb-media-list {
43
- background-image: url('../images/img-placeholder-og.jpg');
44
  }
45
 
46
  #social_warfare .swp_pinterest_imageWrapper ul.swpmb-media-list {
47
- background-image: url('../images/img-placeholder-pin.jpg');
48
  }
49
 
50
  .swpmb-field.swpmb-textarea-wrapper.swp_og_title,
@@ -61,7 +61,7 @@
61
  }
62
 
63
  .swpmb-field.swpmb-text-wrapper.swp_share_recoveryWrapper input {
64
- width: 100%;
65
  }
66
 
67
 
@@ -280,3 +280,59 @@ a.swp-notice-cta {
280
  line-height: 30px;
281
  margin-right: 50px;
282
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
  #social_warfare .swp_og_imageWrapper ul.swpmb-media-list {
43
+ background-image: url('../assets/images/img-placeholder-og.jpg');
44
  }
45
 
46
  #social_warfare .swp_pinterest_imageWrapper ul.swpmb-media-list {
47
+ background-image: url('../assets/images/img-placeholder-pin.jpg');
48
  }
49
 
50
  .swpmb-field.swpmb-textarea-wrapper.swp_og_title,
61
  }
62
 
63
  .swpmb-field.swpmb-text-wrapper.swp_share_recoveryWrapper input {
64
+ width: 100%;
65
  }
66
 
67
 
280
  line-height: 30px;
281
  margin-right: 50px;
282
  }
283
+
284
+ #swp-admin-sidebar .swp-component.dark-text {
285
+ color: #333;
286
+ }
287
+
288
+ #swp-admin-sidebar .swp-component.light-text {
289
+ color: #eee;
290
+ }
291
+
292
+ #swp-admin-sidebar .swp-component {
293
+ font-size: 13px;
294
+ padding: 20px;
295
+ margin: 20px;
296
+ border-radius: 8px;
297
+ }
298
+
299
+ #swp-admin-sidebar .swp-component.text-center {
300
+ text-align: center;
301
+ }
302
+
303
+ #swp-admin-sidebar .swp-component-cta {
304
+ margin: 0 auto;
305
+ display: block;
306
+ padding: 10px 15px;
307
+ border: 0;
308
+ border-radius: 4px;
309
+ text-align: center;
310
+ text-decoration: none;
311
+ color: white;
312
+ text-transform: uppercase;
313
+ letter-spacing: 2px;
314
+ font-weight: bold;
315
+ cursor: pointer;
316
+ width: 90%;
317
+ }
318
+
319
+ #swp-admin-sidebar button.swp-component-cta {
320
+ width: 100%;
321
+ }
322
+
323
+ #swp-admin-sidebar .swp-component-icon {
324
+ text-align: center;
325
+ }
326
+
327
+ #swp-admin-sidebar .swp-component-icon .dashicons {
328
+ font-size: 40px;
329
+ width: 40px;
330
+ height: 40px;
331
+ text-align: center;
332
+ }
333
+
334
+ #swp-admin-sidebar .swp-component .swp-component-title {
335
+ font-size: 26px;
336
+ text-align: center;
337
+ font-weight: bold;
338
+ }
assets/css/admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .notAvailable{opacity:0.3}.swp_CountDown{background-color:#CCC;display:inline-block;float:right;padding:5px 15px;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;color:#FFF;font-weight:bold;margin-top:-27px}.swp_CountDown.swp_blue{background-color:#30394F}.swp_CountDown.swp_red{background-color:#EE464F}#social_warfare textarea.large-text{width:100%}#social_warfare ul.swpmb-media-list.ui-sortable{display:block;width:100%;-webkit-background-size:cover;background-size:cover;background-position-x:center;background-repeat:no-repeat;background-color:#ccc;-webkit-border-radius:4px;border-radius:4px;padding:0}#social_warfare .swp_og_imageWrapper ul.swpmb-media-list{background-image:url('../assets/images/img-placeholder-og.jpg')}#social_warfare .swp_pinterest_imageWrapper ul.swpmb-media-list{background-image:url('../assets/images/img-placeholder-pin.jpg')}.swpmb-field.swpmb-textarea-wrapper.swp_og_title,.swpmb-field.swpmb-textarea-wrapper.swp_og_description,.swpmb-field.swpmb-textarea-wrapper.swp_pinterest_descriptionWrapper,.swpmb-field.swpmb-textarea-wrapper.swp_customTweetWrapper{width:63%;float:left}.swpmb-field.swpmb-text-wrapper.swp_share_recoveryWrapper{width:63%;float:left}.swpmb-field.swpmb-text-wrapper.swp_share_recoveryWrapper input{width:100%}.swpmb-field.swpmb-select-wrapper.swp_pin_browser_extensionWrapper,.swpmb-field.swpmb-select-wrapper.swp_pin_browser_extension_locationWrapper,.swpmb-field.swpmb-select-wrapper.swp_post_locationWrapper,.swpmb-field.swpmb-select-wrapper.swp_float_locationWrapper{width:32%;float:left;min-width:320px}.swpmb-field.swpmb-select-wrapper.swp_pin_browser_extensionWrapper select,.swpmb-field.swpmb-select-wrapper.swp_pin_browser_extension_locationWrapper select,.swpmb-field.swpmb-select-wrapper.swp_post_locationWrapper select,.swpmb-field.swpmb-select-wrapper.swp_float_locationWrapper select{width:90%}.swpmb-field.swpmb-image_advanced-wrapper.swp_og_imageWrapper,.swpmb-field.swpmb-image_advanced-wrapper.swp_pinterest_imageWrapper{width:30%;float:left;margin-right:3%}#social_warfare .swpmb-label,#social_warfare .swpmb-input{width:100%}#social_warfare .swpmb-field{margin-top:10px}#social_warfare .swpmb-image-item,#social_warfare .swpmb-media-preview,#social_warfare .swpmb-media-content .centered,#social_warfare .swpmb-media-content img{width:100%;height:auto;max-height:none;-webkit-transform:none;-ms-transform:none;transform:none}.wp-core-ui #social_warfare a.swpmb-add-media.button{display:block;background:#30394f;color:#fff;font-size:12px;line-height:1;text-align:center;vertical-align:middle;padding:15px 25px;margin:0;-webkit-box-shadow:none;box-shadow:none;border:none;height:auto}.wp-core-ui #social_warfare a.swpmb-add-media.button:hover{background:#EE464F}#social_warfare .swpmb-media-content img{-webkit-transform:translate(0%,0%);-ms-transform:translate(0%,0%);transform:translate(0%,0%)}#social_warfare .swpmb-media-content{overflow:visible}#social_warfare .swpmb-media-preview:before{padding-top:0}#social_warfare .swpmb-media-content{position:inherit}#social_warfare .swpmb-divider-wrapper hr{border:none!important}#social_warfare .swpmb-label label{font-weight:bold;color:#30394f;font-size:18px}#social_warfare .swpmb-divider-wrapper{max-height:1px;clear:both}#social_warfare .swpmb-label{margin-bottom:10px}#social_warfare h2.hndle span:before{content:'p';margin-right:10px;font-family:"sw-icon-font";vertical-align:middle}#social_warfare .dashicons,#social_warfare .sw{vertical-align:middle;margin-right:10px;font-size:18px}#social_warfare .sw-premium-blocker{position:absolute;width:100%;height:100%;top:0;left:0}#social_warfare .sw-premium-blocker:not(.no-icon):before{font-family:'sw-icon-font';content:'E';font-size:24px;float:right;margin:10px 40px 0 0}#social_warfare #swp_recovery_url{}.ui-tooltip.sw-admin-hover-notice{background:#ee464f;color:#fff;padding:15px;-webkit-border-radius:2px;border-radius:2px;margin:15px 0;border:0;-webkit-box-shadow:none;box-shadow:none;max-width:none;padding:20px}.sw-admin-hover-notice i:before{font-family:'sw-icon-font';font-size:26px;margin:0 15px 0 0;vertical-align:middle;content:'E';float:left;font-style:normal}[class$=title_wrapper] ~ [class$=title_wrapper]{border-top:1px solid #CED3DC;padding-top:40px}.swp-notice-wrapper{max-width:73%;margin-top:-15px;margin-bottom:15px}.swp-notice{padding:10px 15px;padding:20px}.swp-actions{display:flex;align-items:center}.swp-notice a{cursor:hover;text-decoration:underline;margin:0 10px}.swp-dismiss-notice.notice.notice-info{font-size:15px;line-height:25px}.swp-dismiss-notice.notice.notice-info{border-left-color:#D34250;padding:20px;margin:15px 0 15px}.swp-dismiss-notice.notice.notice-info p{font-size:15px;line-height:25px;padding:0;margin:0 0 20px}a.swp-notice-cta{cursor:pointer;text-decoration:underline;font-size:15px;line-height:30px;margin-right:50px}#swp-admin-sidebar .swp-component.dark-text{color:#333}#swp-admin-sidebar .swp-component.light-text{color:#eee}#swp-admin-sidebar .swp-component{font-size:13px;padding:20px;margin:20px;border-radius:8px}#swp-admin-sidebar .swp-component.text-center{text-align:center}#swp-admin-sidebar .swp-component-cta{margin:0 auto;display:block;padding:10px 15px;border:0;border-radius:4px;text-align:center;text-decoration:none;color:white;text-transform:uppercase;letter-spacing:2px;font-weight:bold;cursor:pointer;width:90%}#swp-admin-sidebar button.swp-component-cta{width:100%}#swp-admin-sidebar .swp-component-icon{text-align:center}#swp-admin-sidebar .swp-component-icon .dashicons{font-size:40px;width:40px;height:40px;text-align:center}#swp-admin-sidebar .swp-component .swp-component-title{font-size:26px;text-align:center;font-weight:bold}
{css → assets/css}/style.css RENAMED
@@ -29,6 +29,14 @@
29
  justify-content: space-between;
30
  }
31
 
 
 
 
 
 
 
 
 
32
  .swp_social_panel:not(.nc_floater):not(.swp_social_panelSide) {
33
  width: 100%!important;
34
  }
@@ -364,10 +372,10 @@ body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_tumblr:not
364
  border: 1px solid #39475d;
365
  }
366
 
367
- .swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_stumbleupon,
368
- html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_stumbleupon:hover,
369
- body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_stumbleupon:not(:hover) {
370
- border: 1px solid #ef5025;
371
  }
372
 
373
  .swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_yummly,
@@ -460,11 +468,11 @@ body .swp_social_panel.swp_other_full_color:hover .swp_tumblr {
460
  border: 1px solid #27313f;
461
  }
462
 
463
- .swp_social_panel.swp_default_full_color .swp_stumbleupon,
464
- html body .swp_social_panel.swp_individual_full_color .swp_stumbleupon:hover,
465
- body .swp_social_panel.swp_other_full_color:hover .swp_stumbleupon {
466
- background: #ef5025;
467
- border: 1px solid #d34427;
468
  }
469
 
470
  .swp_social_panel.swp_default_full_color .swp_yummly,
@@ -559,10 +567,10 @@ body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_tumblr {
559
  border-bottom: 3px solid #27313f;
560
  }
561
 
562
- .swp_social_panel.swp_three_dee.swp_default_full_color .swp_stumbleupon,
563
- html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_stumbleupon:hover,
564
- body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_stumbleupon {
565
- border-bottom: 3px solid #d34427;
566
  }
567
 
568
  .swp_social_panel.swp_three_dee.swp_default_full_color .swp_yummly,
@@ -721,10 +729,10 @@ body .swp_social_panel.swp_other_color_outlines:hover .swp_tumblr a {
721
  color: #39475d;
722
  }
723
 
724
- .swp_social_panel.swp_default_color_outlines .swp_stumbleupon a,
725
- html body .swp_social_panel.swp_individual_color_outlines .swp_stumbleupon a:hover,
726
- body .swp_social_panel.swp_other_color_outlines:hover .swp_stumbleupon a {
727
- color: #ef5025;
728
  }
729
 
730
  .swp_social_panel.swp_default_color_outlines .swp_yummly a,
@@ -817,11 +825,11 @@ body .swp_social_panel.swp_other_color_outlines:hover .swp_tumblr {
817
  border: 1px solid #39475d;
818
  }
819
 
820
- .swp_social_panel.swp_default_color_outlines .swp_stumbleupon,
821
- html body .swp_social_panel.swp_individual_color_outlines .swp_stumbleupon:hover,
822
- body .swp_social_panel.swp_other_color_outlines:hover .swp_stumbleupon {
823
  background: transparent;
824
- border: 1px solid #ef5025;
825
  }
826
 
827
  .swp_social_panel.swp_default_color_outlines .swp_yummly,
@@ -1269,8 +1277,8 @@ i.swp_tumblr_icon:before {
1269
  content: "r";
1270
  }
1271
 
1272
- i.swp_stumbleupon_icon:before {
1273
- content: "q";
1274
  }
1275
 
1276
  i.swp_reddit_icon:before {
@@ -1846,3 +1854,7 @@ div.swp_social_panel .nc_tweetContainer.swp_emphasize {
1846
  div[class*=custom_color][class^=_wrapper] {
1847
  display: none;
1848
  }
 
 
 
 
29
  justify-content: space-between;
30
  }
31
 
32
+ @media print {
33
+ .swp_social_panel {
34
+ display: none;
35
+ opacity: 0;
36
+ visibility: collapse;
37
+ }
38
+ }
39
+
40
  .swp_social_panel:not(.nc_floater):not(.swp_social_panelSide) {
41
  width: 100%!important;
42
  }
372
  border: 1px solid #39475d;
373
  }
374
 
375
+ .swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_mix,
376
+ html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_mix:hover,
377
+ body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_mix:not(:hover) {
378
+ border: 1px solid #f4812c;
379
  }
380
 
381
  .swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_yummly,
468
  border: 1px solid #27313f;
469
  }
470
 
471
+ .swp_social_panel.swp_default_full_color .swp_mix,
472
+ html body .swp_social_panel.swp_individual_full_color .swp_mix:hover,
473
+ body .swp_social_panel.swp_other_full_color:hover .swp_mix {
474
+ background: #f4812c;
475
+ border: 1px solid #c96a29;
476
  }
477
 
478
  .swp_social_panel.swp_default_full_color .swp_yummly,
567
  border-bottom: 3px solid #27313f;
568
  }
569
 
570
+ .swp_social_panel.swp_three_dee.swp_default_full_color .swp_mix,
571
+ html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_mix:hover,
572
+ body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_mix {
573
+ border-bottom: 3px solid #c96a29;
574
  }
575
 
576
  .swp_social_panel.swp_three_dee.swp_default_full_color .swp_yummly,
729
  color: #39475d;
730
  }
731
 
732
+ .swp_social_panel.swp_default_color_outlines .swp_mix a,
733
+ html body .swp_social_panel.swp_individual_color_outlines .swp_mix a:hover,
734
+ body .swp_social_panel.swp_other_color_outlines:hover .swp_mix a {
735
+ color: #f4812c;
736
  }
737
 
738
  .swp_social_panel.swp_default_color_outlines .swp_yummly a,
825
  border: 1px solid #39475d;
826
  }
827
 
828
+ .swp_social_panel.swp_default_color_outlines .swp_mix,
829
+ html body .swp_social_panel.swp_individual_color_outlines .swp_mix:hover,
830
+ body .swp_social_panel.swp_other_color_outlines:hover .swp_mix {
831
  background: transparent;
832
+ border: 1px solid #f4812c;
833
  }
834
 
835
  .swp_social_panel.swp_default_color_outlines .swp_yummly,
1277
  content: "r";
1278
  }
1279
 
1280
+ i.swp_mix_icon:before {
1281
+ content: "g";
1282
  }
1283
 
1284
  i.swp_reddit_icon:before {
1854
  div[class*=custom_color][class^=_wrapper] {
1855
  display: none;
1856
  }
1857
+
1858
+ .swp-pinterest-image-top {
1859
+ margin-bottom: 20px;
1860
+ }
assets/css/style.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .swp_social_panel{clear:both;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;height:34px;line-height:1;margin-bottom:20px!important;margin-top:20px!important;overflow:hidden;padding:0;-webkit-align-items:stretch;align-items:stretch;-webkit-box-align:stretch;-moz-box-align:stretch;-webkit-box-pack:justify;-moz-box-pack:justify;direction:ltr;-ms-flex-align:stretch;-ms-flex-line-pack:center;-ms-flex-pack:justify;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;justify-content:space-between}@media print{.swp_social_panel{display:none;opacity:0;visibility:collapse}}.swp_social_panel:not(.nc_floater):not(.swp_social_panelSide){width:100%!important}.nc_wrapper .swp_social_panel{margin-bottom:10px!important;margin-top:10px!important}div.swp_social_panel .nc_tweetContainer:not(.total_shares):not(.total_sharesalt){-webkit-border-radius:2px;border-radius:2px;cursor:pointer;float:left;font-family:Lato;height:32px;margin:0 5px 3px;min-width:34px;overflow:hidden;text-align:center;-webkit-transition:all .1s linear;transition:all .1s linear}div.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer{-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.swp_social_panel .nc_tweetContainer a.nc_tweet,.swp_social_panel .total_shares .swp_count{display:block;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;font-family:Lato,sans-serif;font-size:18px!important;font-weight:700;height:30px;text-decoration:none;text-decoration:none!important;text-transform:none;-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap}.swp_social_panel:not(.nc_floater):not(.swp_social_panelSide).swp_shift{padding:0 10px}.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:nth-child(1){margin-left:0}.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:nth-last-child(1){margin-right:0}.swp_social_panel a .swp_count:not(.swp_hide){display:inline-block;line-height:32px;margin:0;padding:0 5px;-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.swp_social_panel .total_shares .swp_count,span.swp_share{line-height:30px}.swp_social_panel a .swp_count.swp_hide{margin:0 auto}.swp_social_panel span:before{content:initial!important}.swp_social_panel span.swp_count{font-size:14px}.swp_social_panel span.iconFiller{font-size:18px;margin:0 auto}.swp_social_panel.notMobile .nc_tweetContainer:nth-child(1){margin-left:0}.swp_social_panel:not(.swp_social_panelSide){-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out}.swp_social_panel:not(.swp_social_panelSide) div.total_shares.total_sharesalt:nth-child(1){margin-left:0;margin-right:15px;padding-left:0}.swp_social_panel:not(.swp_social_panelSide) div.total_shares.total_sharesalt:nth-last-child(1){margin-right:0;padding-right:0}a.swp_CTT{cursor:pointer}span.swp_share{display:block;float:right;float:left;font-size:14px;font-weight:400;height:30px;margin:0 0 0 6px;max-width:none!important;vertical-align:middle}.swp_social_panelSide span.swp_share{margin:0}.swp_social_panel .sw{float:left;height:30px;line-height:32px;margin:0 5px;text-shadow:none!important;width:20px}.iconFiller{display:block;float:left;height:30px;overflow:hidden;-webkit-transition:width .1s linear;transition:width .1s linear}.swp_social_panel .iconFiller{width:30px}span.spaceManWilly{display:block;width:120px}.swp_social_panel .total_shares{background:0 0!important;border:none!important;-webkit-border-radius:2px;border-radius:2px;color:#fff;cursor:default;display:block;font-size:19px;padding:0 10px;-webkit-box-flex:0!important;-moz-box-flex:0!important;-webkit-flex:none!important;-ms-flex:none!important;flex:none!important}.swp_social_panel .total_sharesalt{background:0 0!important;border:none!important}.swp_social_panel div.total_shares.total_sharesalt,.swp_social_panel:hover div.total_shares.total_sharesalt:not(:nth-child(1)){background:0 0!important;border:none;color:#474b4d;margin-left:0!important;margin-bottom:10px!important}div.swp_social_panel:hover div.total_shares.total_sharesalt:not(:nth-child(1)){background:0 0;color:#474b4d;margin-left:10px}.swp_social_panel .total_shares.total_sharesalt .swp_label{color:#474b4d;font-size:10px;letter-spacing:0;min-width:40px;vertical-align:middle}.swp_social_panel .total_shares .swp_label{font-size:10px;vertical-align:middle}.swp_social_panel .total_shares.total_sharesalt .swp_count{color:#474b4d;font-size:24px}.swp_social_panel.swp_customFull:hover div.total_shares,.swp_social_panel.swp_fade .total_shares,.swp_social_panel.swp_full_color .total_shares,.swp_social_panel:hover .total_shares{background:#e08a0f}.swp_social_panel .nc_tweetContainer.total_shares.total_sharesalt:before{content:"o";display:inline-block;font-family:sw-icon-font;margin-top:7px;vertical-align:top}.swp_social_panel:not(.swp_social_panelSide) .total_shares.total_sharesalt .swp_count{display:inline-block;line-height:0;margin-left:8px;margin-top:12px;min-width:45px;position:relative;vertical-align:middle}span.swp_label{display:block;font-size:9px!important;margin-top:13px;position:absolute;text-align:center!important;text-transform:uppercase}.swp_social_panelSide span.swp_label{margin-top:0}.swp_social_panel.swp_leaf .nc_tweetContainer{-webkit-border-radius:15px 0!important;border-radius:15px 0!important;border-width:1px}.swp_social_panel.swp_pill .nc_tweetContainer{-webkit-border-radius:50px!important;border-radius:50px!important;border-width:1px}.swp_social_panel.swp_shift .nc_tweetContainer:not(.total_shares){border-width:1px;-moz-transform:skew(-25deg);-o-transform:skew(-25deg);-webkit-transform:skew(-25deg)}.swp_social_panel.swp_shift .nc_tweetContainer a{-moz-transform:skew(25deg);-o-transform:skew(25deg);-webkit-transform:skew(25deg)}.swp_connected .nc_tweetContainer,.swp_connected .nc_tweetContainer:hover,.swp_connected:hover .nc_tweetContainer{-webkit-border-radius:0!important;border-radius:0!important;border-width:1px;margin:0!important}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_google_plus,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_google_plus:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_google_plus:hover{border:1px solid #df4b37}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_twitter,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_twitter:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_twitter:hover{border:1px solid #429cd6}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_facebook,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_facebook:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_facebook:hover{border:1px solid #3a589e}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_pinterest,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_pinterest:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_pinterest:hover{border:1px solid #cd2029}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_linkedin,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_linkedin:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_linkedin:hover{border:1px solid #0d77b7}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_tumblr,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_tumblr:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_tumblr:hover{border:1px solid #39475d}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_mix,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_mix:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_mix:hover{border:1px solid #f4812c}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_yummly,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_yummly:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_yummly:hover{border:1px solid #e26426}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_reddit,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_reddit:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_reddit:hover{border:1px solid #f04b23}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_email,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_email:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_email:hover{border:1px solid #6bcce9}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_whatsapp,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_whatsapp:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_whatsapp:hover{border:1px solid #71c169}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_pocket,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_pocket:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_pocket:hover{border:1px solid #ef4056}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_buffer,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_buffer:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_buffer:hover{border:1px solid #323b43}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_hacker_news,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_hacker_news:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_hacker_news:hover{border:1px solid #d85623}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_flipboard,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_flipboard:not(:hover),html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_flipboard:hover{border:1px solid #bf2626}.swp_social_panel.swp_default_full_color .swp_google_plus,body .swp_social_panel.swp_other_full_color:hover .swp_google_plus,html body .swp_social_panel.swp_individual_full_color .swp_google_plus:hover{background:#df4b37;border:1px solid #c44133}.swp_social_panel.swp_default_full_color .swp_twitter,body .swp_social_panel.swp_other_full_color:hover .swp_twitter,html body .swp_social_panel.swp_individual_full_color .swp_twitter:hover{background:#429cd6;border:1px solid #3c87b2}.swp_social_panel.swp_default_full_color .swp_facebook,body .swp_social_panel.swp_other_full_color:hover .swp_facebook,html body .swp_social_panel.swp_individual_full_color .swp_facebook:hover{background:#3a589e;border:1px solid #2e4675}.swp_social_panel.swp_default_full_color .swp_pinterest,body .swp_social_panel.swp_other_full_color:hover .swp_pinterest,html body .swp_social_panel.swp_individual_full_color .swp_pinterest:hover{background:#cd2029;border:1px solid #aa1b29}.swp_social_panel.swp_default_full_color .swp_linkedin,body .swp_social_panel.swp_other_full_color:hover .swp_linkedin,html body .swp_social_panel.swp_individual_full_color .swp_linkedin:hover{background:#0d77b7;border:1px solid #0c6591}.swp_social_panel.swp_default_full_color .swp_tumblr,body .swp_social_panel.swp_other_full_color:hover .swp_tumblr,html body .swp_social_panel.swp_individual_full_color .swp_tumblr:hover{background:#39475d;border:1px solid #27313f}.swp_social_panel.swp_default_full_color .swp_mix,body .swp_social_panel.swp_other_full_color:hover .swp_mix,html body .swp_social_panel.swp_individual_full_color .swp_mix:hover{background:#f4812c;border:1px solid #c96a29}.swp_social_panel.swp_default_full_color .swp_yummly,body .swp_social_panel.swp_other_full_color:hover .swp_yummly,html body .swp_social_panel.swp_individual_full_color .swp_yummly:hover{background:#e26426;border:1px solid #b65027}.swp_social_panel.swp_default_full_color .swp_reddit,body .swp_social_panel.swp_other_full_color:hover .swp_reddit,html body .swp_social_panel.swp_individual_full_color .swp_reddit:hover{background:#f04b23;border:1px solid #d33f27}.swp_social_panel.swp_default_full_color .swp_email,body .swp_social_panel.swp_other_full_color:hover .swp_email,html body .swp_social_panel.swp_individual_full_color .swp_email:hover{background:#6bcce9;border:1px solid #61bace}.swp_social_panel.swp_default_full_color .swp_whatsapp,body .swp_social_panel.swp_other_full_color:hover .swp_whatsapp,html body .swp_social_panel.swp_individual_full_color .swp_whatsapp:hover{background:#71c169;border:1px solid #28b04b}.swp_social_panel.swp_default_full_color .swp_pocket,body .swp_social_panel.swp_other_full_color:hover .swp_pocket,html body .swp_social_panel.swp_individual_full_color .swp_pocket:hover{background:#ef4056;border:1px solid #ce3d55}.swp_social_panel.swp_default_full_color .swp_buffer,body .swp_social_panel.swp_other_full_color:hover .swp_buffer,html body .swp_social_panel.swp_individual_full_color .swp_buffer:hover{background:#323b43;border:1px solid #000}.swp_social_panel.swp_default_full_color .swp_hacker_news,body .swp_social_panel.swp_other_full_color:hover .swp_hacker_news,html body .swp_social_panel.swp_individual_full_color .swp_hacker_news:hover{background:#f16522;border:1px solid #d85623}.swp_social_panel.swp_default_full_color .swp_flipboard,body .swp_social_panel.swp_other_full_color:hover .swp_flipboard,html body .swp_social_panel.swp_individual_full_color .swp_flipboard:hover{background:#e02828;border:1px solid #bf2626}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_google_plus,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_google_plus,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_google_plus:hover{border-bottom:3px solid #c44133}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_twitter,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_twitter,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_twitter:hover{border-bottom:3px solid #5595bc}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_facebook,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_facebook,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_facebook:hover{border-bottom:3px solid #2e4675}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_pinterest,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_pinterest,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_pinterest:hover{border-bottom:3px solid #aa1b29}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_linkedin,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_linkedin,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_linkedin:hover{border-bottom:3px solid #0c6591}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_tumblr,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_tumblr,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_tumblr:hover{border-bottom:3px solid #27313f}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_mix,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_mix,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_mix:hover{border-bottom:3px solid #c96a29}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_yummly,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_yummly,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_yummly:hover{border-bottom:3px solid #b65027}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_reddit,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_reddit,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_reddit:hover{border-bottom:3px solid #d33f27}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_email,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_email,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_email:hover{border-bottom:3px solid #61bace}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_whatsapp,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_whatsapp,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_whatsapp:hover{border-bottom:3px solid #28b04b}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_pocket,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_pocket,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_pocket:hover{border-bottom:3px solid #ce3d55}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_buffer,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_buffer,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_buffer:hover{border-bottom:3px solid #000}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_hacker_news,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_hacker_news,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_hacker_news:hover{border-bottom:3px solid #d85623}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_flipboard,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_flipboard,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_flipboard:hover{border-bottom:3px solid #bf2626}.swp_social_panel.swp_default_light_gray .nc_tweetContainer,body .swp_social_panel.swp_other_light_gray:hover .nc_tweetContainer,html body .swp_social_panel.swp_individual_light_gray .nc_tweetContainer:hover{background-color:#ccc;border:1px solid #ccc}.swp_social_panel.swp_three_dee.swp_default_light_gray .nc_tweetContainer:not(.total_sharesalt),body .swp_social_panel.swp_three_dee.swp_other_light_gray:hover .nc_tweetContainer:not(.total_sharesalt),html body .swp_social_panel.swp_three_dee.swp_individual_light_gray .nc_tweetContainer:not(.total_sharesalt):hover{border-bottom:3px solid #999}.swp_social_panel.swp_default_medium_gray .nc_tweetContainer,body .swp_social_panel.swp_other_medium_gray:hover .nc_tweetContainer,html body .swp_social_panel.swp_individual_medium_gray .nc_tweetContainer:hover{background-color:#999;border:1px solid #999}.swp_social_panel.swp_three_dee.swp_default_medium_gray .nc_tweetContainer:not(.total_sharesalt),body .swp_social_panel.swp_three_dee.swp_other_medium_gray:hover .nc_tweetContainer:not(.total_sharesalt),html body .swp_social_panel.swp_three_dee.swp_individual_medium_gray .nc_tweetContainer:not(.total_sharesalt):hover{border-bottom:3px solid #444}.swp_social_panel.swp_default_dark_gray .nc_tweetContainer,body .swp_social_panel.swp_other_dark_gray:hover .nc_tweetContainer,html body .swp_social_panel.swp_individual_dark_gray .nc_tweetContainer:hover{background-color:#444;border:1px solid #444}.swp_social_panel.swp_three_dee.swp_default_dark_gray .nc_tweetContainer:not(.total_sharesalt),body .swp_social_panel.swp_three_dee.swp_other_dark_gray:hover .nc_tweetContainer:not(.total_sharesalt),html body .swp_social_panel.swp_three_dee.swp_individual_dark_gray .nc_tweetContainer:not(.total_sharesalt):hover{border-bottom:3px solid #222}.swp_social_panel.swp_default_light_gray_outlines a,body .swp_social_panel.swp_other_light_gray_outlines:hover a,html body .swp_social_panel.swp_individual_light_gray_outlines a:hover{color:#ccc}.swp_social_panel.swp_default_light_gray_outlines .nc_tweetContainer,body .swp_social_panel.swp_other_light_gray_outlines:hover .nc_tweetContainer,html body .swp_social_panel.swp_individual_light_gray_outlines .nc_tweetContainer:hover{background:0 0;border:1px solid #ccc}.swp_social_panel.swp_default_medium_gray_outlines a,body .swp_social_panel.swp_other_medium_gray_outlines:hover a,html body .swp_social_panel.swp_individual_medium_gray_outlines a:hover{color:#999}.swp_social_panel.swp_default_medium_gray_outlines .nc_tweetContainer,body .swp_social_panel.swp_other_medium_gray_outlines:hover .nc_tweetContainer,html body .swp_social_panel.swp_individual_medium_gray_outlines .nc_tweetContainer:hover{background:0 0;border:1px solid #999}.swp_social_panel.swp_default_dark_gray_outlines a,body .swp_social_panel.swp_other_dark_gray_outlines:hover a,html body .swp_social_panel.swp_individual_dark_gray_outlines a:hover{color:#444}.swp_social_panel.swp_default_dark_gray_outlines .nc_tweetContainer,body .swp_social_panel.swp_other_dark_gray_outlines:hover .nc_tweetContainer,html body .swp_social_panel.swp_individual_dark_gray_outlines .nc_tweetContainer:hover{background:0 0;border:1px solid #444}.swp_social_panel.swp_default_color_outlines .swp_google_plus a,body .swp_social_panel.swp_other_color_outlines:hover .swp_google_plus a,html body .swp_social_panel.swp_individual_color_outlines .swp_google_plus a:hover{color:#df4b37}.swp_social_panel.swp_default_color_outlines .swp_facebook a,body .swp_social_panel.swp_other_color_outlines:hover .swp_facebook a,html body .swp_social_panel.swp_individual_color_outlines .swp_facebook a:hover{color:#3a589e}.swp_social_panel.swp_default_color_outlines .swp_pinterest a,body .swp_social_panel.swp_other_color_outlines:hover .swp_pinterest a,html body .swp_social_panel.swp_individual_color_outlines .swp_pinterest a:hover{color:#cd2029}.swp_social_panel.swp_default_color_outlines .swp_linkedin a,body .swp_social_panel.swp_other_color_outlines:hover .swp_linkedin a,html body .swp_social_panel.swp_individual_color_outlines .swp_linkedin a:hover{color:#0d77b7}.swp_social_panel.swp_default_color_outlines .swp_tumblr a,body .swp_social_panel.swp_other_color_outlines:hover .swp_tumblr a,html body .swp_social_panel.swp_individual_color_outlines .swp_tumblr a:hover{color:#39475d}.swp_social_panel.swp_default_color_outlines .swp_mix a,body .swp_social_panel.swp_other_color_outlines:hover .swp_mix a,html body .swp_social_panel.swp_individual_color_outlines .swp_mix a:hover{color:#f4812c}.swp_social_panel.swp_default_color_outlines .swp_yummly a,body .swp_social_panel.swp_other_color_outlines:hover .swp_yummly a,html body .swp_social_panel.swp_individual_color_outlines .swp_yummly a:hover{color:#e26426}.swp_social_panel.swp_default_color_outlines .swp_whatsapp a,body .swp_social_panel.swp_other_color_outlines:hover .swp_whatsapp a,html body .swp_social_panel.swp_individual_color_outlines .swp_whatsapp a:hover{color:#71c169}.swp_social_panel.swp_default_color_outlines .swp_pocket a,body .swp_social_panel.swp_other_color_outlines:hover .swp_pocket a,html body .swp_social_panel.swp_individual_color_outlines .swp_pocket a:hover{color:#ef4056}.swp_social_panel.swp_default_color_outlines .swp_reddit a,body .swp_social_panel.swp_other_color_outlines:hover .swp_reddit a,html body .swp_social_panel.swp_individual_color_outlines .swp_reddit a:hover{color:#f04b23}.swp_social_panel.swp_default_color_outlines .swp_email a,body .swp_social_panel.swp_other_color_outlines:hover .swp_email a,html body .swp_social_panel.swp_individual_color_outlines .swp_email a:hover{color:#6bcce9}.swp_social_panel.swp_default_color_outlines .swp_buffer a,body .swp_social_panel.swp_other_color_outlines:hover .swp_buffer a,html body .swp_social_panel.swp_individual_color_outlines .swp_buffer a:hover{color:#323b43}.swp_social_panel.swp_default_color_outlines .swp_hacker_news a,body .swp_social_panel.swp_other_color_outlines:hover .swp_hacker_news a,html body .swp_social_panel.swp_individual_color_outlines .swp_hacker_news a:hover{color:#f16522}.swp_social_panel.swp_default_color_outlines .swp_flipboard a,body .swp_social_panel.swp_other_color_outlines:hover .swp_flipboard a,html body .swp_social_panel.swp_individual_color_outlines .swp_flipboard a:hover{color:#e02828}.swp_social_panel.swp_default_color_outlines .swp_google_plus,body .swp_social_panel.swp_other_color_outlines:hover .swp_google_plus,html body .swp_social_panel.swp_individual_color_outlines .swp_google_plus:hover{background:0 0;border:1px solid #df4b37}.swp_social_panel.swp_default_color_outlines .swp_twitter,body .swp_social_panel.swp_other_color_outlines:hover .swp_twitter,html body .swp_social_panel.swp_individual_color_outlines .swp_twitter:hover{background:0 0;border:1px solid #429cd6}.swp_social_panel.swp_default_color_outlines .swp_facebook,body .swp_social_panel.swp_other_color_outlines:hover .swp_facebook,html body .swp_social_panel.swp_individual_color_outlines .swp_facebook:hover{background:0 0;border:1px solid #3a589e}.swp_social_panel.swp_default_color_outlines .swp_pinterest,body .swp_social_panel.swp_other_color_outlines:hover .swp_pinterest,html body .swp_social_panel.swp_individual_color_outlines .swp_pinterest:hover{background:0 0;border:1px solid #cd2029}.swp_social_panel.swp_default_color_outlines .swp_linkedin,body .swp_social_panel.swp_other_color_outlines:hover .swp_linkedin,html body .swp_social_panel.swp_individual_color_outlines .swp_linkedin:hover{background:0 0;border:1px solid #0d77b7}.swp_social_panel.swp_default_color_outlines .swp_tumblr,body .swp_social_panel.swp_other_color_outlines:hover .swp_tumblr,html body .swp_social_panel.swp_individual_color_outlines .swp_tumblr:hover{background:0 0;border:1px solid #39475d}.swp_social_panel.swp_default_color_outlines .swp_mix,body .swp_social_panel.swp_other_color_outlines:hover .swp_mix,html body .swp_social_panel.swp_individual_color_outlines .swp_mix:hover{background:0 0;border:1px solid #f4812c}.swp_social_panel.swp_default_color_outlines .swp_yummly,body .swp_social_panel.swp_other_color_outlines:hover .swp_yummly,html body .swp_social_panel.swp_individual_color_outlines .swp_yummly:hover{background:0 0;border:1px solid #e26426}.swp_social_panel.swp_default_color_outlines .swp_whatsapp,body .swp_social_panel.swp_other_color_outlines:hover .swp_whatsapp,html body .swp_social_panel.swp_individual_color_outlines .swp_whatsapp:hover{background:0 0;border:1px solid #71c169}.swp_social_panel.swp_default_color_outlines .swp_reddit,body .swp_social_panel.swp_other_color_outlines:hover .swp_reddit,html body .swp_social_panel.swp_individual_color_outlines .swp_reddit:hover{background:0 0;border:1px solid #f04b23}.swp_social_panel.swp_default_color_outlines .swp_email,body .swp_social_panel.swp_other_color_outlines:hover .swp_email,html body .swp_social_panel.swp_individual_color_outlines .swp_email:hover{background:0 0;border:1px solid #6bcce9}.swp_social_panel.swp_default_color_outlines .swp_pocket,body .swp_social_panel.swp_other_color_outlines:hover .swp_pocket,html body .swp_social_panel.swp_individual_color_outlines .swp_pocket:hover{background:0 0;border:1px solid #ef4056}.swp_social_panel.swp_default_color_outlines .swp_buffer,body .swp_social_panel.swp_other_color_outlines:hover .swp_buffer,html body .swp_social_panel.swp_individual_color_outlines .swp_buffer:hover{background:0 0;border:1px solid #323b43}.swp_social_panel.swp_default_color_outlines .swp_hacker_news,body .swp_social_panel.swp_other_color_outlines:hover .swp_hacker_news,html body .swp_social_panel.swp_individual_color_outlines .swp_hacker_news:hover{background:0 0;border:1px solid #f16522}.swp_social_panel.swp_default_color_outlines .swp_flipboard,body .swp_social_panel.swp_other_color_outlines:hover .swp_flipboard,html body .swp_social_panel.swp_individual_color_outlines .swp_flipboard:hover{background:0 0;border:1px solid #bf2626}.swp_social_panelSide{flex-direction:column;height:auto;overflow:visible;-webkit-transition:all .2s linear;transition:all .2s linear;z-index:9998;margin:10px 5px!important;padding:0;-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column}.swp_social_panelSide.fade,.swp_social_panelSide.slide{position:fixed;-webkit-transition:all .2s linear;transition:all .2s linear}.swp_social_panelSide.fade.swp_float_left{left:5px}.swp_social_panelSide.fade.swp_float_right{right:5px}.swp_social_panelSide[class*=swp_side]{height:auto;display:flex;position:fixed;padding:30px 0}.swp_social_panelSide.fade{display:none}.swp_social_panelSide.swp_float_right{align-content:flex-end}.swp_social_panelSide.swp_side_top{top:15px}.swp_social_panelSide.swp_side_bottom{bottom:15px}.swp_social_panelSide .nc_tweetContainer{-webkit-border-radius:3px;border-radius:3px;clear:both;display:block;font-family:Lato,sans-serif;height:32px;margin:3px 0!important;overflow:hidden;padding:0;-webkit-transition:all .1s linear;transition:all .1s linear;vertical-align:top;width:90px}.swp_social_panelSide .nc_tweetContainer .iconFiller{display:inline-block;height:40px;margin:0 6px;padding:0;-webkit-transition:all .1s linear;transition:all .1s linear;vertical-align:middle;width:21px}.swp_social_panelSide .nc_tweetContainer .swp_count{display:inline-block;font-size:14px;height:32px;line-height:16px;margin:0;overflow:hidden;padding:0;text-align:right;-webkit-transition:all .1s linear;transition:all .1s linear;vertical-align:top;width:0}.swp_social_panelSide .nc_tweetContainer a{cursor:pointer;display:block;font-weight:500;height:36px;margin:0;padding:0;text-decoration:none;-webkit-transition:all .1s linear;transition:all .1s linear;vertical-align:top}.swp_social_panelSide .nc_tweetContainer .sw,.swp_social_panelSide .nc_tweetContainer .swp_share{float:left;line-height:34px}.swp_social_panelSide.swp_default .nc_tweetContainer .sw{line-height:32px}.swp_social_panelSide.swp_default .nc_tweetContainer .swp_share{line-height:30px}.swp_social_panelSide .nc_tweetContainer .swp_share{font-size:13px}.swp_social_panelSide .nc_tweetContainer:hover,.swp_social_panelSide .nc_tweetContainer:hover .iconFiller,.swp_social_panelSide .nc_tweetContainer:hover .swp_count{-webkit-transition:all .1s linear;transition:all .1s linear}.swp_social_panelSide.swp_boxed .nc_tweetContainer,.swp_social_panelSide.swp_circles .nc_tweetContainer{margin-bottom:5px;width:67.5px!important}.swp_social_panelSide.swp_boxed .nc_tweetContainer,.swp_social_panelSide.swp_boxed .nc_tweetContainer a,.swp_social_panelSide.swp_circles .nc_tweetContainer,.swp_social_panelSide.swp_circles .nc_tweetContainer a{width:67.5px;height:67.5px!important;position:relative}.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares),.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) a{border-radius:50%!important}.swp_social_panelSide.swp_boxed .nc_tweetContainer i.sw,.swp_social_panelSide.swp_circles .nc_tweetContainer i.sw{font-size:27px;height:40px;margin:0;padding-top:10px;text-align:center;width:100%}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) span.swp_share,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) span.swp_share{height:35px;opacity:0;position:absolute;bottom:0;left:0;text-align:center;width:67.5px}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) span.swp_count,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) span.swp_count{height:35px;margin:0;padding:0;position:absolute;bottom:0;left:0;text-align:center;-webkit-transition:padding .1s linear;transition:padding .1s linear;width:100%}.swp_social_panelSide.swp_boxed .nc_tweetContainer span.swp_hide .iconFiller,.swp_social_panelSide.swp_boxed .nc_tweetContainer span.swp_hide .spaceManWilly,.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) span.swp_count.swp_hide,.swp_social_panelSide.swp_circles .nc_tweetContainer span.swp_hide .iconFiller,.swp_social_panelSide.swp_circles .nc_tweetContainer span.swp_hide .spaceManWilly,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) span.swp_count.swp_hide{height:67.5px;opacity:1}.swp_social_panelSide.swp_boxed .nc_tweetContainer span.iconFiller,.swp_social_panelSide.swp_circles .nc_tweetContainer span.iconFiller{height:40px;width:67.5px}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares):hover span.swp_count:not(.swp_hide),.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares):hover span.swp_count:not(.swp_hide){opacity:0}.swp_social_panelSide.swp_boxed .total_shares,.swp_social_panelSide.swp_circles .total_shares{padding:0;width:67.5px!important}.swp_social_panelSide .nc_tweetContainer:not(.total_shares){line-height:34px}.swp_social_panelSide:not(.swp_boxed):not(.swp_circles) .nc_tweetContainer:not(.total_shares) .iconFiller{margin-left:2px;width:30px}.swp_social_panelSide .nc_tweetContainer:not(.total_shares) .swp_count{padding:0 8px;width:48px}.swp_social_panelSide .nc_tweetContainer:not(.total_shares) .swp_count.swp_hide{padding:0;width:100%}.swp_social_panelSide .nc_tweetContainer:not(.total_shares) .swp_count.swp_hide .iconFiller{display:block;float:none;margin:0 auto}.swp_social_panelSide:not(.swp_boxed):not(.swp_circles) .nc_tweetContainer:not(.total_shares):hover{width:150px}.swp_social_panelSide .nc_tweetContainer:not(.total_shares) .spaceManWilly,.swp_social_panelSide .nc_tweetContainer[data-network]:not(.total_shares):hover .iconFiller{width:90px}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) .spaceManWilly,.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares):hover .iconFiller,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) .spaceManWilly,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares):hover .iconFiller{width:100%}.swp_social_panelSide .nc_tweetContainer.total_shares{background:rgba(0,0,0,0);border:0!important;font-weight:800;height:55px;margin:0;padding:0;text-align:center;width:90px;order:-100}.swp_social_panelSide .nc_tweetContainer.total_shares .swp_count{color:#444;display:block;font-family:Lato,sans-serif;height:28px;text-align:center;width:100%}.swp_social_panelSide .nc_tweetContainer.total_shares .swp_label{color:#444;display:block;font-family:Lato,sans-serif;font-size:50%;position:relative;text-align:center;width:100%}.nc_wrapper{background:#fff;position:fixed;-webkit-transition:top .5s bottom .5s;transition:top .5s bottom .5s;width:100%;z-index:99999}.nc_wrapper.bottom{bottom:0;left:0}.nc_wrapper.top{top:0;left:0}.nc_floater{margin:10px 0;position:relative;left:304px;width:740px}.swp_social_panelSide.hideCounts a{text-align:center}.swp_social_panelSide.hideCounts .iconFiller{float:none;text-align:left}.sw{display:inline-block;font-family:sw-icon-font!important;font-size:inherit;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;text-rendering:auto;text-transform:none!important;-ms-transform:translate(0,0);-webkit-transform:translate(0,0);transform:translate(0,0)}.sw:before{display:block!important}.wp-editor-container .sw:before{font-size:18px;line-height:22px}.wp-editor-container .sw-social-warfare:before{color:#ee464f}.mce-container .sw-social-warfare{color:#ee464f;font-size:20px;margin-right:15px;vertical-align:middle}i.swp_google_plus_icon:before{content:"h"}i.swp_pinterest_icon:before{content:"b"}i.swp_twitter_icon:before{content:"s"}i.swp_facebook_icon:before{content:"j"}i.swp_linkedin_icon:before{content:"f"}i.swp_tumblr_icon:before{content:"r"}i.swp_mix_icon:before{content:"g"}i.swp_reddit_icon:before{content:"a"}i.swp_email_icon:before{content:"k"}i.swp_yummly_icon:before{content:"x"}i.swp_whatsapp_icon:before{content:"y"}i.swp_pocket_icon:before{content:"B"}i.swp_buffer_icon:before{content:"z"}i.swp_hacker_news_icon:before{content:"D"}i.swp_flipboard_icon:before{content:"C"}.sw-social-warfare:before{content:"p"}.sw-click-to-tweet:after,.sw-tweet-clear:after{content:".";height:0;clear:both;visibility:hidden;display:block}.swp_CTT{text-decoration:none!important}.sw-tweet-clear{zoom:1}.sw-click-to-tweet{display:block;margin:15px 0;padding:15px 30px;position:relative}.sw-click-to-tweet:after{line-height:0}.sw-click-to-tweet .sw-ctt-text{margin:0 0 10px;padding:0;position:relative;word-wrap:break-word}a .sw-click-to-tweet .sw-ctt-text{display:block;font-size:24px;font-weight:500;line-height:140%;margin:0;padding:0;position:relative;text-decoration:none;text-transform:none}.sw-click-to-tweet .sw-ctt-btn{display:block;float:right;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:700;line-height:100%;margin:10px 0 0;padding:3px 5px 3px 3px;position:relative;text-decoration:none;text-transform:uppercase}.sw-click-to-tweet i.swp_twitter_icon{float:right;font-size:21px;margin-left:15px!important;margin-top:2px;text-transform:none}a.swp_CTT.style1 .sw-click-to-tweet{background-color:#fff;border:1px solid #ddd;-webkit-border-radius:4px;border-radius:4px}a.swp_CTT.style2 .sw-click-to-tweet{background-color:#fff;border:4px double #ddd;-webkit-border-radius:0;border-radius:0}a.style2 .sw-click-to-tweet .sw-ctt-text{color:#666;font-style:italic;text-decoration:none}a.swp_CTT.style3:hover .sw-click-to-tweet{border-left:10px solid #3c87b2;padding-right:20px;-webkit-transition:all .25s linear;transition:all .25s linear}a.swp_CTT.style3 .sw-click-to-tweet{background-color:#429cd6;border:none;border-left:10px solid #429cd6;-webkit-border-radius:0;border-radius:0;padding-right:20px;-webkit-transition:all .25s linear;transition:all .25s linear}a.style3 .sw-click-to-tweet .sw-ctt-text{color:#fff;font-style:italic;text-decoration:none}a.swp_CTT.style4:hover .sw-click-to-tweet{border-left:10px solid #3c87b2;-webkit-transition:all .25s linear;transition:all .25s linear}a.swp_CTT.style4 .sw-click-to-tweet{background-color:#333;border-left:10px solid #c33;-webkit-border-radius:0;border-radius:0;-webkit-transition:all .25s linear;transition:all .25s linear}a.swp_CTT.style5:hover .sw-click-to-tweet{background-color:#d34250;border-left:10px solid #30394f;-webkit-transition:all .25s linear;transition:all .25s linear}a.swp_CTT.style5 .sw-click-to-tweet{background-color:#30394f;border-left:10px solid #d34250;-webkit-border-radius:0;border-radius:0;-webkit-transition:all .25s linear;transition:all .25s linear}a.swp_CTT.style6:hover .sw-click-to-tweet{background-color:#ced3dc;border-left:10px solid #d34250;-webkit-transition:all .25s linear;transition:all .25s linear}a.swp_CTT.style6 .sw-click-to-tweet{background-color:#eee;border-left:10px solid #d34250;-webkit-border-radius:0;border-radius:0;-webkit-transition:all .25s linear;transition:all .25s linear}a.style6 .sw-click-to-tweet i.swp_twitter{color:#30394f}.swp_pop_thumb{-webkit-border-radius:3px;border-radius:3px;float:left;height:100px;margin:5px 25px 5px 0;width:100px}.swp_popular_post{clear:both}.swp_clearfix:after{clear:both;content:" ";display:block;height:0;visibility:hidden}.swp_popular_post a.swp_popularity{border:none;display:block;line-height:1.5;margin:20px 0}span.swp_pop_count{display:block;font-size:70%}.swp_widget_box{-webkit-border-radius:3px;border-radius:3px}div.sw-pinit{display:table!important;line-height:0;position:relative!important}div.sw-pinit a.sw-pinit-button,div.sw-pinit a.sw-pinit-button:visited{background:#cd2029;border:1px solid #aa1b29;border:0;border-bottom:none;-webkit-border-radius:4px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:#fff;font-family:Lato,sans-serif;font-size:20px;font-size:15px;height:32px;line-height:32px;opacity:0;padding:0 20px;position:absolute;text-decoration:none;-webkit-transition:opacity .5s;transition:opacity .5s;z-index:200}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) .swp_hide span.swp_share,.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares):hover span.swp_share:not(.swp_hide),.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) .swp_hide span.swp_share,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares):hover span.swp_share:not(.swp_hide),div.sw-pinit:focus a.sw-pinit-button,div.sw-pinit:hover a.sw-pinit-button{opacity:1}div.sw-pinit a.sw-pinit-button::before{color:#fff;content:"b";float:left;font-family:sw-icon-font;font-size:20px;font-weight:400;line-height:36px;margin-left:-5px;margin-right:10px}div.sw-pinit a.sw-pinit-button:hover::before{content:"F"}div.sw-pinit a.sw-pinit-button:focus,div.sw-pinit a.sw-pinit-button:hover{background:#aa1b29;color:#fff;text-decoration:none}div.sw-pinit .sw-pinit-left{left:30px}div.sw-pinit .sw-pinit-center{margin-left:-60px;left:50%}div.sw-pinit .sw-pinit-right{right:30px}div.sw-pinit .sw-pinit-top{top:30px}div.sw-pinit .sw-pinit-middle{margin-top:-25px;top:50%}div.sw-pinit .sw-pinit-bottom{bottom:30px}.mobile .nc_tweetContainer:nth-last-child(2),.nc_tweetContainer.total_shares:nth-last-child(1),.swp_social_panel.notMobile .nc_tweetContainer:nth-last-child(1){margin-right:0}.swp_social_panel.swp_default_dark_gray a,.swp_social_panel.swp_default_full_color a,.swp_social_panel.swp_default_light_gray a,.swp_social_panel.swp_default_medium_gray a,body .swp_social_panel.swp_other_dark_gray:hover a,body .swp_social_panel.swp_other_full_color:hover a,body .swp_social_panel.swp_other_light_gray:hover a,body .swp_social_panel.swp_other_medium_gray:hover a,html body .swp_social_panel.swp_individual_dark_gray a:hover,html body .swp_social_panel.swp_individual_full_color .nc_tweetContainer:hover a,html body .swp_social_panel.swp_individual_light_gray .nc_tweetContainer:hover a,html body .swp_social_panel.swp_individual_medium_gray a:hover{color:#fff}.swp_social_panel.swp_default_color_outlines .swp_twitter a,.wp-editor-container .swp_twitter:before,a.style1 .sw-click-to-tweet i.swp_twitter,a.style2 .sw-click-to-tweet i.swp_twitter,body .swp_social_panel.swp_other_color_outlines:hover .swp_twitter a,html body .swp_social_panel.swp_individual_color_outlines .swp_twitter a:hover{color:#429cd6}.sw-content-locator,.swp_social_panel.mobile .iconFiller~.swp_count{display:none}a.style1 .sw-click-to-tweet .sw-ctt-btn,a.style1 .sw-click-to-tweet .sw-ctt-text{color:#999;text-decoration:none}a.style1:hover .sw-click-to-tweet .sw-ctt-btn,a.style1:hover .sw-click-to-tweet .sw-ctt-text,a.style2 .sw-click-to-tweet .sw-ctt-btn,a.style2:hover .sw-click-to-tweet .sw-ctt-btn,a.style2:hover .sw-click-to-tweet .sw-ctt-text{color:#666;text-decoration:none}a.style3 .sw-click-to-tweet .sw-ctt-btn,a.style3 .sw-click-to-tweet i.swp_twitter,a.style3:hover .sw-click-to-tweet .sw-ctt-btn,a.style3:hover .sw-click-to-tweet .sw-ctt-text,a.style4 .sw-click-to-tweet .sw-ctt-btn,a.style4 .sw-click-to-tweet .sw-ctt-text,a.style4:hover .sw-click-to-tweet .sw-ctt-btn,a.style4:hover .sw-click-to-tweet .sw-ctt-text,a.style5 .sw-click-to-tweet .sw-ctt-btn,a.style5 .sw-click-to-tweet .sw-ctt-text,a.style5:hover .sw-click-to-tweet .sw-ctt-btn,a.style5:hover .sw-click-to-tweet .sw-ctt-text{color:#fff;text-decoration:none}a.style4 .sw-click-to-tweet i.swp_twitter,a.style5 .sw-click-to-tweet i.swp_twitter{color:#fff}a.style6 .sw-click-to-tweet .sw-ctt-btn,a.style6 .sw-click-to-tweet .sw-ctt-text{color:#30394f;text-decoration:none}a.style6:hover .sw-click-to-tweet .sw-ctt-btn,a.style6:hover .sw-click-to-tweet .sw-ctt-text,a.style6:hover .sw-click-to-tweet i.swp_twitter{color:#2a2d34;text-decoration:none}.scale-70{-ms-transform:scale(.7);-webkit-transform:scale(.7);transform:scale(.7)}.swp_social_panel:not(.nc_floater).scale-70.scale-full_width{width:142.8571428571429%!important}.scale-80{-ms-transform:scale(.8);-webkit-transform:scale(.8);transform:scale(.8)}.swp_social_panel:not(.nc_floater).scale-80.scale-full_width{width:125%!important}.scale-90{-ms-transform:scale(.9);-webkit-transform:scale(.9);transform:scale(.9)}.swp_social_panel:not(.nc_floater).scale-90.scale-full_width{width:111.111111111111%!important}.scale-110{-ms-transform:scale(1.1);-webkit-transform:scale(1.1);transform:scale(1.1)}.swp_social_panel:not(.nc_floater).scale-110.scale-full_width{width:90.90909090909091%!important}.scale-120{-ms-transform:scale(1.2);-webkit-transform:scale(1.2);transform:scale(1.2)}.swp_social_panel:not(.nc_floater).scale-120.scale-full_width{width:83.33333333333333%!important}.scale-130{-ms-transform:scale(1.3);-webkit-transform:scale(1.3);transform:scale(1.3)}.swp_social_panel:not(.nc_floater).scale-130.scale-full_width{width:76.92307692307692%!important}.scale-140{-ms-transform:scale(1.4);-webkit-transform:scale(1.4);transform:scale(1.4)}.swp_social_panel:not(.nc_floater).scale-140.scale-full_width{width:71.42857142857143%!important}.nc_floater.scale-center,.nc_floater.scale-right,.scale-full_width,.scale-left{-ms-transform-origin:left;-webkit-transform-origin:left;transform-origin:left}.scale-right{-ms-transform-origin:right;-webkit-transform-origin:right;transform-origin:right}.scale-center{-ms-transform-origin:center;-webkit-transform-origin:center;transform-origin:center}div.swp_social_panel .nc_tweetContainer.swp_emphasize{-webkit-box-flex:2;-moz-box-flex:2;-webkit-flex:2;-ms-flex:2;flex:2}.sw-pinit.aligncenter{margin:0 auto}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){div.sw-pinit{display:inline-block!important;max-width:100%}}.swp_hidden_pin_image{height:0;opacity:0;position:absolute;top:0;width:0;z-index:-10}.fl-module-content .uabb-blog-posts .uabb-post-thumbnail .sw-pinit.lazyloaded{display:block!important}.swp-content-locator{display:none!important;margin:0!important}.float-position-top-left{transform-origin:top left}.float-position-center-left{transform-origin:center left}.float-position-bottom-left{transform-origin:bottom left}.float-position-top-right{transform-origin:top right}.float-position-center-right{transform-origin:center right}.float-position-bottom-right{transform-origin:bottom right}div[class*=custom_color][class^=_wrapper]{display:none}.swp-pinterest-image-top{margin-bottom:20px}
assets/fonts/sw-icon-font.eot ADDED
Binary file
{fonts → assets/fonts}/sw-icon-font.svg RENAMED
@@ -10,9 +10,7 @@
10
  <glyph glyph-name="reddit" unicode="&#97;" d="M448 338c-19 0-38-10-51-26l-3-3c-31 21-72 33-117 37l21 64 56-13c3-27 25-48 54-48 30 0 54 24 54 54 0 31-24 55-54 55-21 0-38-12-48-29l-69 16c-8 1-16-3-19-11l-27-87c-50-1-95-16-128-37l-3 5c-13 15-31 24-50 24-35 0-64-29-64-64 0-27 18-51 43-61l11-4 0 3c0 0 0-2 0-2 0-75 90-136 202-136 110 0 200 61 202 136l11 3c27 8 45 34 45 61-2 34-31 63-66 63z m-40 86c11 0 19-10 19-19 0-11-9-21-19-21-11 0-19 10-19 21 0 9 8 19 19 19z m-355-178c-11 5-18 16-18 28 0 17 13 30 29 30 8 0 16-3 22-10l4-4c-15-13-24-29-31-45z m201-139c-92 0-168 47-168 104 0 58 76 104 168 104 93 0 168-46 168-104 0-57-75-104-168-104z m204 139l-8-3c-7 16-16 32-29 45l5 6c6 7 14 10 22 10 16 0 30-13 30-30-1-12-9-23-20-28z m-237-4c0 16-13 30-31 30-17 0-30-14-30-30 0-16 14-31 30-31 16 0 31 15 31 31z m101 30c-16 0-31-14-31-30 0-16 15-31 31-31 16 0 30 13 30 31-2 17-14 30-30 30z m-2-93c-5 0-8-1-11-5-10-9-27-14-53-14-26 0-42 5-53 14-6 7-17 7-22 0-3-3-5-6-5-11 0-5 2-8 5-11 16-16 40-24 75-24 34 0 59 8 75 24 3 3 5 6 5 11 0 5-2 8-5 11-3 4-6 5-11 5z"/>
11
  <glyph glyph-name="pinterest" unicode="&#98;" d="M256 450c-107 0-194-87-194-194 0-78 48-147 116-178 0 13 0 31 3 45 3 16 25 106 25 106 0 0-6 13-6 30 0 29 16 50 37 50 17 0 25-13 25-29 0-18-11-45-17-69-5-21 9-37 30-37 37 0 61 47 61 103 0 41-29 73-80 73-59 0-94-43-94-92 0-18 4-29 12-39 4-5 5-6 4-11-2-3-4-13-4-16-1-5-4-6-9-5-27 11-40 40-40 74 0 54 46 120 137 120 74 0 122-53 122-111 0-75-42-132-104-132-21 0-40 11-46 24 0 0-12-45-15-53-5-15-13-31-19-42 18-5 35-8 54-8 108 0 194 87 194 194 2 110-85 197-192 197z"/>
12
  <glyph glyph-name="periscope" unicode="&#99;" d="M258 464c-93 0-167-77-167-171 0-98 130-245 167-245 32 0 161 147 161 245 2 94-72 171-161 171z m1-261c-57 0-102 45-102 96 0 24 8 47 21 63 0-21 17-39 40-39 22 0 38 18 38 39 0 16-10 28-24 35 8 1 18 3 26 3 52 0 97-45 97-102 0-50-45-95-96-95z"/>
13
- <glyph glyph-name="medium" unicode="&#101;" d="M493 389l-19 0c-7 0-16-10-16-16l0-232c0-7 9-15 16-15l19 0 0-54-170 0 0 54 35 0 0 242-1 0-83-299-64 0-82 299-2 0 0-245 36 0 0-54-143 0 0 54 18 0c8 0 17 8 17 15l0 233c0 7-9 16-17 16l-18 0 0 56 178 0 57-217 2 0 59 217 178 0z"/>
14
  <glyph glyph-name="linkedin" unicode="&#102;" d="M115 443c-25 0-46-21-46-46 0-26 21-47 46-47 26 2 45 23 45 47 0 25-19 46-45 46z m-40-374l79 0 0 249-79 0z m282 257c0 0-63 5-77-41l0 33-78 0 0-249 78 0 0 133c0 4 2 54 48 54 43 0 40-58 40-58l0-128 77 0 0 144c-2-1 8 112-88 112z"/>
15
- <glyph glyph-name="instagram" unicode="&#103;" d="M400 285l-32 0c2-10 3-19 3-29 0-64-51-115-115-115-64 0-115 51-115 115 0 10 1 19 3 29l-32 0 0-159c0-8 6-14 14-14l260 0c8 0 14 6 14 14z m0 101c0 8-6 14-14 14l-44 0c-8 0-14-6-14-14l0-44c0-8 6-14 14-14l44 0c8 0 14 6 14 14z m-144-58c-40 0-72-32-72-72 0-40 32-72 72-72 40 0 72 32 72 72 0 40-32 72-72 72m144-259l-288 0c-24 0-43 19-43 43l0 288c0 24 19 43 43 43l288 0c24 0 43-19 43-43l0-288c0-24-19-43-43-43"/>
16
  <glyph glyph-name="google-plus" unicode="&#104;" d="M168 280l0-58 96 0c-5-24-29-72-96-72-58 0-102 48-102 106 0 58 44 106 102 106 34 0 54-15 67-26l45 43c-29 29-67 45-112 45-94 0-168-75-168-168 0-93 74-168 168-168 96 0 160 67 160 163 0 11 0 19-2 29z m344 0l-48 0 0 48-48 0 0-48-48 0 0-48 48 0 0-48 48 0 0 48 48 0"/>
17
  <glyph glyph-name="flickr" unicode="&#105;" d="M510 256c0-66-52-118-118-118-66 0-118 52-118 118 0 66 52 118 118 118 66 0 118-52 118-118z m-270 0c0-66-53-118-118-118-66 0-120 52-120 118 0 66 52 118 118 118 66 0 120-52 120-118z"/>
18
  <glyph glyph-name="facebook" unicode="&#106;" d="M288 48l0 190 64 0 10 74-74 0 0 48c0 21 6 37 37 37l40 0 0 64c-8 1-31 3-58 3-56 0-96-35-96-98l0-54-64 0 0-74 64 0 0-190z"/>
@@ -26,17 +24,18 @@
26
  <glyph glyph-name="tumblr" unicode="&#114;" d="M355 133c-65-29-73 24-73 24l0 131 78 0 0 70-78 0 0 106-64 0c0 0-8-94-82-115l0-61 46 0 0-136c0-67 56-104 116-104 59 0 78 26 78 26z"/>
27
  <glyph glyph-name="twitter" unicode="&#115;" d="M491 402c-17-8-35-13-56-15 19 11 35 31 43 53-19-11-40-19-60-24-18 19-44 30-71 30-62 0-109-57-94-118-80 5-152 43-199 101-25-43-12-101 31-130-16 0-31 5-43 13-2-45 30-86 76-96-12-3-28-5-43-2 13-38 48-65 90-67-40-32-91-46-143-40 44-27 93-43 148-43 179 0 280 152 273 286 19 15 35 32 48 52z"/>
28
  <glyph glyph-name="vimeo" unicode="&#116;" d="M11 354l19-26c0 0 42 32 55 16 14-16 65-211 83-248 16-32 58-74 104-43 46 30 198 160 227 315 27 154-184 122-206-13 56 34 86-14 57-67-28-53-54-88-68-88-15 0-24 35-40 98-16 64-16 180-84 168-64-13-147-112-147-112z"/>
29
- <glyph glyph-name="vine" unicode="&#117;" d="M438 258c-11-4-20-4-30-4-53 0-93 37-93 101 0 32 13 48 29 48 16 0 27-14 27-45 0-17-5-35-8-46 0 0 16-29 61-19 10 21 14 48 14 72 0 64-32 101-92 101-61 0-98-48-98-109 0-63 29-115 77-139-21-40-45-76-72-103-48 58-91 136-109 288l-70 0c33-253 131-333 156-349 15-8 28-8 40-1 21 11 85 75 119 149 14 0 32 1 49 6z"/>
30
  <glyph glyph-name="warfare-plugins" unicode="&#118;" d="M424 365l-32-163c-2-7 3-7 6 0l52 104c-4 20-13 41-26 59z m-155 86l-55-249c-1-7 4-7 7 0l120 233c-23 10-47 16-74 18 2 0 2 0 2-2z m38-240l-85-147c0 0-1-2-1-2 13-1 25-3 38-3 13 0 24 2 37 3 0 0 0 2 0 2l19 147c0 5-5 5-8 0z m-246 45c0-50 17-94 48-130l48 300c-58-34-96-98-96-170z"/>
31
  <glyph glyph-name="youtube" unicode="&#119;" d="M365 437l-218 0c-123 0-142-7-142-127l0-108c0-120 19-127 142-127l216 0c123 0 143 7 143 127l0 108c1 120-18 127-141 127z m-160-271l0 188 142-95z"/>
32
  <glyph glyph-name="yummly" unicode="&#120;" d="M91 430c2 7 8 12 13 15 19 13 42 21 64 19 19-2 34-11 37-34 3-14 0-28-3-43-8-30-16-61-24-91-2-6-2-11-2-18 0-8 5-12 13-12 9-2 17 0 25 3 15 3 28 9 40 16 2 1 4 3 4 5 3 19 6 36 9 56 3 19 7 36 10 56 1 12 5 24 6 36 0 4 0 8-1 13-2 5 0 7 3 8 9 5 21 7 32 3 9-1 14-8 14-17 0-10-1-19-3-31-3-20-6-40-11-60-3-21-8-44-11-64-4-21-8-44-12-64-1-8-3-18-4-26 0-2 0-3 1-3 35-5 71-15 103-29 4-3 11-3 17-5 5-1 7-3 7-6 0-8-2-15-7-23-8-11-21-16-35-11-10 3-18 8-26 13-19 11-38 18-60 21-2 0-5 0-7 0-1 0-3 0-3-3-3-20-10-37-18-53-6-13-16-26-27-35-11-10-24-15-38-16-3 0-7-2-10-2-3 0-6 0-9 0-2 0-4 0-4 0-14 2-28 8-38 19-11 15-13 31-10 47 5 27 21 48 45 62 21 11 43 18 66 21 1 0 3 0 3 3 2 5 2 10 3 14 2 7 2 12 3 18-3-2-4-3-6-3-26-15-53-21-83-18-15 2-26 8-32 21-7 13-8 26-5 38 6 28 14 56 22 84 8 16 12 30 15 44 1 12-2 20-16 15-10-2-18-8-24-15-2-3-5-3-8 0-7 5-10 10-13 16-2 4-3 7-5 12 0 1 0 3 0 4z m144-273c-17-3-32-8-45-21-6-6-9-14-9-24 0-10 8-16 17-13 8 2 15 7 20 13 6 10 9 19 12 30 4 4 4 10 5 15z"/>
33
  <glyph glyph-name="whatsapp" unicode="&#121;" d="M400 402c-38 38-90 59-144 59-112 0-203-91-203-203 0-36 9-71 27-101l-29-106 109 29c29-16 62-24 98-24 112 0 203 91 203 203-2 53-23 104-61 143z m-142-312c-31 0-60 8-87 24l-6 3-64-16 17 62-4 7c-18 27-26 57-26 89 0 93 75 168 168 168 45 0 88-17 118-49 32-32 50-74 50-119 2-94-74-169-166-169z m91 126c-5 3-31 14-35 16-5 2-8 3-12-3-3-5-12-16-16-19-3-4-6-4-11-2-5 3-21 8-40 26-14 12-25 30-29 35-3 5 0 8 2 9 2 2 5 7 8 10 3 3 3 5 5 8 1 3 1 6 0 10-2 3-11 27-16 36-3 8-8 8-11 8-4 0-7 0-10 0-3 0-10-1-13-6-5-5-17-18-17-42 0-25 17-49 20-52 4-4 36-56 87-77 43-18 51-13 61-13 9 2 30 13 33 24 5 11 5 22 3 24 0 3-4 5-9 8z"/>
34
  <glyph glyph-name="buffer" unicode="&#122;" d="M72 357l170-80c9-5 20-5 28 0l170 80c3 1 3 6 0 8l-168 80c-10 5-22 5-32 0l-170-80c-1-3-1-7 2-8z m368-98l-35 16c-7 3-15 3-23 0l-112-53c-9-4-20-4-28 0l-112 53c-7 3-15 3-21 0l-37-17c-3-2-3-7 0-8l170-80c9-5 20-5 28 0l170 80c3 3 3 8 0 9z m0-102l-35 16c-7 3-15 3-23 0l-112-53c-9-5-20-5-28 0l-112 53c-7 3-15 3-21 0l-37-18c-3-1-3-6 0-8l170-80c9-5 20-5 28 0l170 80c3 2 3 8 0 10z"/>
35
  <glyph glyph-name="print" unicode="&#65;" d="M378 326l0 106-244 0 0-106-44 0 0-180 40 0 0-66 252 0 0 66 40 0 0 180z m-26-216l-192 0 0 36 192 0z m5 133l-202 0 0 168 202 0z m25-77c-3 0-4 0-8 2-1 0-3 2-3 2-1 0-1 1-3 1-2 2-2 2-3 3 0 0 0 2-2 2-1 2-1 3-3 5 0 1-2 5-2 6 0 13 10 23 23 23 13 0 22-10 22-23 0-13-8-21-21-21z m-44 204l-164 0 0-21 164 0z m0-37l-164 0 0-21 164 0z m0-39l-164 0 0-20 164 0z"/>
36
- <glyph glyph-name="meerkat" unicode="&#100;" d="M205 384c-11 10-24 13-39 8-9-2-17-8-24-14-9-10-14-21-14-34 0-3 0-5 0-8 2-5 3-10 5-14 3-8 8-13 14-18 3-3 7-5 10-6 1-2 5-2 6 0 3 1 3 6 0 8-3 1-6 4-8 8-3 3-5 6-8 11-1 3-3 9-3 16 0 3 0 5 2 8 0 3 1 8 4 11 5 5 10 11 16 14 4 2 7 4 10 4 5 1 11 0 16-4 8-3 14-8 19-16 2-3 3-4 7-8 0 0 0-1 0-1 0-2 1-3 3-5 1-2 3 0 5 2 1 1 1 3 1 4 0 4-1 7-1 10-7 10-13 18-21 24z m219-26c-8 5-16 8-24 10-6 2-14 3-19 6-5 4-10 7-15 10-8 6-16 14-24 22-11 12-24 23-36 34-15 13-32 19-52 22-16 2-30 0-46-3-21-5-40-11-58-19-16-5-28-11-41-21-23-17-35-41-35-70 0-11 1-24 4-35 4-18 8-36 10-55 3-22 3-43 3-65 0-21 0-40-1-61 0-18-2-37-4-55 0-11-1-20-3-32l226 0c-2 4-3 7-5 10-10 19-19 40-29 59-6 13-11 27-13 42-1 11-1 22-1 32 0 14 1 29 5 43 1 6 4 10 9 10 5 0 10 1 15 1 11 2 22 2 33 2 24 1 48 9 69 24 6 5 13 9 19 14 5 3 10 8 13 13 6 11 10 22 10 35 4 13 0 23-10 27z m-24-52c-10-7-19-13-30-18-2 0-2 0-4 0-16 5-30 11-44 21-2 0-4 1-5 1-2 0-3-1-3-3 0-1 0-5 1-5 3-3 8-4 11-8 8-3 16-8 24-11 0 0 2 0 2 0-6-1-13-3-19-5-10-1-21-1-31-3-11-1-22-1-32-5-12-3-20-11-24-24-3-11-4-22-6-35 0-16 0-33 2-49 1-18 6-34 12-52 7-14 13-28 21-43l-163 0c0 2 0 2 0 3 2 26 3 53 5 79 0 13 0 25 1 37 0 19 0 38-1 56-2 16-3 32-7 48-1 12-4 24-6 36-3 10-5 20-5 29 0 18 8 32 21 43 10 8 22 15 34 20 16 8 33 14 51 19 11 3 21 5 32 5 19 0 37-7 53-20 14-11 27-24 41-38 11-11 23-21 35-29 5-3 12-6 18-8 0 0 2-1 2-1 4-13 11-26 17-37 0-2-1-2-3-3z m-94 80c-12 0-21-10-21-21 0-2 0-5 0-8-3 0-7 1-10 1-1 0-5 0-5-1 0-2 0-5 2-5 2-2 5-2 6-3 8-3 18-5 26-5 11 0 21 10 21 21 1 11-8 21-19 21z"/>
37
  <glyph glyph-name="pocket" unicode="&#66;" d="M462 418c-4 14-19 25-35 25l-342 0c-16 0-31-9-35-24-2-5-4-9-4-14l0-127 2-25c6-58 35-107 82-141 1 0 1-2 3-2 24-17 53-30 81-36 15-4 28-5 42-5 13 0 26 1 38 3 2 0 4 0 5 2 0 0 2 0 2 0 29 6 54 17 78 35 2 0 2 1 3 1 47 36 76 85 82 141l2 26 0 128c0 5-2 8-4 13z m-88-132l-97-94c-5-5-13-8-19-8-7 0-15 3-20 8l-97 94c-11 12-11 29-2 40 11 12 29 12 40 2l79-75 78 75c11 11 29 11 40-2 10-11 10-28-2-40z"/>
38
  <glyph glyph-name="flipboard" unicode="&#67;" d="M69 443l0-374 125 0 0 125 124 0 0 124 125 0 0 125z"/>
39
  <glyph glyph-name="hacker-news" unicode="&#68;" d="M96 464l61 0 78-160c11-24 21-46 21-46 0 0 10 22 22 46l80 160 58 0-136-254 0-162-51 0 0 165z"/>
40
  <glyph glyph-name="upgrade" unicode="&#69;" d="M376 298l0 40c0 62-46 118-109 123-64 5-118-40-128-99 5 0 45 0 48 0 10 35 47 60 87 49 32-8 52-38 52-72l0-40c0-1 0-1 0-1l-190 0c-26-2-45-23-45-48l0-152c0-28 23-48 48-48l231 0c27 0 48 22 48 48l0 152c1 25-18 46-42 48z m-35-159c-7-6-18-6-26 0l-59 59-61-60c-3-4-8-5-13-5-4 0-9 1-12 5-7 6-7 17 0 25l73 74c7 6 18 6 26 0l72-72c8-8 8-19 0-26z"/>
41
  <glyph glyph-name="pin" unicode="&#70;" d="M366 222c-1 39-20 71-49 90l0 112c24 18 37 40 37 40l-196 0c0 0 13-24 39-42l0-110c-31-19-50-53-50-90l90 0 0-112c0-11 9-62 21-62 11 0 20 51 20 62l0 112z"/>
 
 
 
42
  </font></defs></svg>
10
  <glyph glyph-name="reddit" unicode="&#97;" d="M448 338c-19 0-38-10-51-26l-3-3c-31 21-72 33-117 37l21 64 56-13c3-27 25-48 54-48 30 0 54 24 54 54 0 31-24 55-54 55-21 0-38-12-48-29l-69 16c-8 1-16-3-19-11l-27-87c-50-1-95-16-128-37l-3 5c-13 15-31 24-50 24-35 0-64-29-64-64 0-27 18-51 43-61l11-4 0 3c0 0 0-2 0-2 0-75 90-136 202-136 110 0 200 61 202 136l11 3c27 8 45 34 45 61-2 34-31 63-66 63z m-40 86c11 0 19-10 19-19 0-11-9-21-19-21-11 0-19 10-19 21 0 9 8 19 19 19z m-355-178c-11 5-18 16-18 28 0 17 13 30 29 30 8 0 16-3 22-10l4-4c-15-13-24-29-31-45z m201-139c-92 0-168 47-168 104 0 58 76 104 168 104 93 0 168-46 168-104 0-57-75-104-168-104z m204 139l-8-3c-7 16-16 32-29 45l5 6c6 7 14 10 22 10 16 0 30-13 30-30-1-12-9-23-20-28z m-237-4c0 16-13 30-31 30-17 0-30-14-30-30 0-16 14-31 30-31 16 0 31 15 31 31z m101 30c-16 0-31-14-31-30 0-16 15-31 31-31 16 0 30 13 30 31-2 17-14 30-30 30z m-2-93c-5 0-8-1-11-5-10-9-27-14-53-14-26 0-42 5-53 14-6 7-17 7-22 0-3-3-5-6-5-11 0-5 2-8 5-11 16-16 40-24 75-24 34 0 59 8 75 24 3 3 5 6 5 11 0 5-2 8-5 11-3 4-6 5-11 5z"/>
11
  <glyph glyph-name="pinterest" unicode="&#98;" d="M256 450c-107 0-194-87-194-194 0-78 48-147 116-178 0 13 0 31 3 45 3 16 25 106 25 106 0 0-6 13-6 30 0 29 16 50 37 50 17 0 25-13 25-29 0-18-11-45-17-69-5-21 9-37 30-37 37 0 61 47 61 103 0 41-29 73-80 73-59 0-94-43-94-92 0-18 4-29 12-39 4-5 5-6 4-11-2-3-4-13-4-16-1-5-4-6-9-5-27 11-40 40-40 74 0 54 46 120 137 120 74 0 122-53 122-111 0-75-42-132-104-132-21 0-40 11-46 24 0 0-12-45-15-53-5-15-13-31-19-42 18-5 35-8 54-8 108 0 194 87 194 194 2 110-85 197-192 197z"/>
12
  <glyph glyph-name="periscope" unicode="&#99;" d="M258 464c-93 0-167-77-167-171 0-98 130-245 167-245 32 0 161 147 161 245 2 94-72 171-161 171z m1-261c-57 0-102 45-102 96 0 24 8 47 21 63 0-21 17-39 40-39 22 0 38 18 38 39 0 16-10 28-24 35 8 1 18 3 26 3 52 0 97-45 97-102 0-50-45-95-96-95z"/>
 
13
  <glyph glyph-name="linkedin" unicode="&#102;" d="M115 443c-25 0-46-21-46-46 0-26 21-47 46-47 26 2 45 23 45 47 0 25-19 46-45 46z m-40-374l79 0 0 249-79 0z m282 257c0 0-63 5-77-41l0 33-78 0 0-249 78 0 0 133c0 4 2 54 48 54 43 0 40-58 40-58l0-128 77 0 0 144c-2-1 8 112-88 112z"/>
 
14
  <glyph glyph-name="google-plus" unicode="&#104;" d="M168 280l0-58 96 0c-5-24-29-72-96-72-58 0-102 48-102 106 0 58 44 106 102 106 34 0 54-15 67-26l45 43c-29 29-67 45-112 45-94 0-168-75-168-168 0-93 74-168 168-168 96 0 160 67 160 163 0 11 0 19-2 29z m344 0l-48 0 0 48-48 0 0-48-48 0 0-48 48 0 0-48 48 0 0 48 48 0"/>
15
  <glyph glyph-name="flickr" unicode="&#105;" d="M510 256c0-66-52-118-118-118-66 0-118 52-118 118 0 66 52 118 118 118 66 0 118-52 118-118z m-270 0c0-66-53-118-118-118-66 0-120 52-120 118 0 66 52 118 118 118 66 0 120-52 120-118z"/>
16
  <glyph glyph-name="facebook" unicode="&#106;" d="M288 48l0 190 64 0 10 74-74 0 0 48c0 21 6 37 37 37l40 0 0 64c-8 1-31 3-58 3-56 0-96-35-96-98l0-54-64 0 0-74 64 0 0-190z"/>
24
  <glyph glyph-name="tumblr" unicode="&#114;" d="M355 133c-65-29-73 24-73 24l0 131 78 0 0 70-78 0 0 106-64 0c0 0-8-94-82-115l0-61 46 0 0-136c0-67 56-104 116-104 59 0 78 26 78 26z"/>
25
  <glyph glyph-name="twitter" unicode="&#115;" d="M491 402c-17-8-35-13-56-15 19 11 35 31 43 53-19-11-40-19-60-24-18 19-44 30-71 30-62 0-109-57-94-118-80 5-152 43-199 101-25-43-12-101 31-130-16 0-31 5-43 13-2-45 30-86 76-96-12-3-28-5-43-2 13-38 48-65 90-67-40-32-91-46-143-40 44-27 93-43 148-43 179 0 280 152 273 286 19 15 35 32 48 52z"/>
26
  <glyph glyph-name="vimeo" unicode="&#116;" d="M11 354l19-26c0 0 42 32 55 16 14-16 65-211 83-248 16-32 58-74 104-43 46 30 198 160 227 315 27 154-184 122-206-13 56 34 86-14 57-67-28-53-54-88-68-88-15 0-24 35-40 98-16 64-16 180-84 168-64-13-147-112-147-112z"/>
 
27
  <glyph glyph-name="warfare-plugins" unicode="&#118;" d="M424 365l-32-163c-2-7 3-7 6 0l52 104c-4 20-13 41-26 59z m-155 86l-55-249c-1-7 4-7 7 0l120 233c-23 10-47 16-74 18 2 0 2 0 2-2z m38-240l-85-147c0 0-1-2-1-2 13-1 25-3 38-3 13 0 24 2 37 3 0 0 0 2 0 2l19 147c0 5-5 5-8 0z m-246 45c0-50 17-94 48-130l48 300c-58-34-96-98-96-170z"/>
28
  <glyph glyph-name="youtube" unicode="&#119;" d="M365 437l-218 0c-123 0-142-7-142-127l0-108c0-120 19-127 142-127l216 0c123 0 143 7 143 127l0 108c1 120-18 127-141 127z m-160-271l0 188 142-95z"/>
29
  <glyph glyph-name="yummly" unicode="&#120;" d="M91 430c2 7 8 12 13 15 19 13 42 21 64 19 19-2 34-11 37-34 3-14 0-28-3-43-8-30-16-61-24-91-2-6-2-11-2-18 0-8 5-12 13-12 9-2 17 0 25 3 15 3 28 9 40 16 2 1 4 3 4 5 3 19 6 36 9 56 3 19 7 36 10 56 1 12 5 24 6 36 0 4 0 8-1 13-2 5 0 7 3 8 9 5 21 7 32 3 9-1 14-8 14-17 0-10-1-19-3-31-3-20-6-40-11-60-3-21-8-44-11-64-4-21-8-44-12-64-1-8-3-18-4-26 0-2 0-3 1-3 35-5 71-15 103-29 4-3 11-3 17-5 5-1 7-3 7-6 0-8-2-15-7-23-8-11-21-16-35-11-10 3-18 8-26 13-19 11-38 18-60 21-2 0-5 0-7 0-1 0-3 0-3-3-3-20-10-37-18-53-6-13-16-26-27-35-11-10-24-15-38-16-3 0-7-2-10-2-3 0-6 0-9 0-2 0-4 0-4 0-14 2-28 8-38 19-11 15-13 31-10 47 5 27 21 48 45 62 21 11 43 18 66 21 1 0 3 0 3 3 2 5 2 10 3 14 2 7 2 12 3 18-3-2-4-3-6-3-26-15-53-21-83-18-15 2-26 8-32 21-7 13-8 26-5 38 6 28 14 56 22 84 8 16 12 30 15 44 1 12-2 20-16 15-10-2-18-8-24-15-2-3-5-3-8 0-7 5-10 10-13 16-2 4-3 7-5 12 0 1 0 3 0 4z m144-273c-17-3-32-8-45-21-6-6-9-14-9-24 0-10 8-16 17-13 8 2 15 7 20 13 6 10 9 19 12 30 4 4 4 10 5 15z"/>
30
  <glyph glyph-name="whatsapp" unicode="&#121;" d="M400 402c-38 38-90 59-144 59-112 0-203-91-203-203 0-36 9-71 27-101l-29-106 109 29c29-16 62-24 98-24 112 0 203 91 203 203-2 53-23 104-61 143z m-142-312c-31 0-60 8-87 24l-6 3-64-16 17 62-4 7c-18 27-26 57-26 89 0 93 75 168 168 168 45 0 88-17 118-49 32-32 50-74 50-119 2-94-74-169-166-169z m91 126c-5 3-31 14-35 16-5 2-8 3-12-3-3-5-12-16-16-19-3-4-6-4-11-2-5 3-21 8-40 26-14 12-25 30-29 35-3 5 0 8 2 9 2 2 5 7 8 10 3 3 3 5 5 8 1 3 1 6 0 10-2 3-11 27-16 36-3 8-8 8-11 8-4 0-7 0-10 0-3 0-10-1-13-6-5-5-17-18-17-42 0-25 17-49 20-52 4-4 36-56 87-77 43-18 51-13 61-13 9 2 30 13 33 24 5 11 5 22 3 24 0 3-4 5-9 8z"/>
31
  <glyph glyph-name="buffer" unicode="&#122;" d="M72 357l170-80c9-5 20-5 28 0l170 80c3 1 3 6 0 8l-168 80c-10 5-22 5-32 0l-170-80c-1-3-1-7 2-8z m368-98l-35 16c-7 3-15 3-23 0l-112-53c-9-4-20-4-28 0l-112 53c-7 3-15 3-21 0l-37-17c-3-2-3-7 0-8l170-80c9-5 20-5 28 0l170 80c3 3 3 8 0 9z m0-102l-35 16c-7 3-15 3-23 0l-112-53c-9-5-20-5-28 0l-112 53c-7 3-15 3-21 0l-37-18c-3-1-3-6 0-8l170-80c9-5 20-5 28 0l170 80c3 2 3 8 0 10z"/>
32
  <glyph glyph-name="print" unicode="&#65;" d="M378 326l0 106-244 0 0-106-44 0 0-180 40 0 0-66 252 0 0 66 40 0 0 180z m-26-216l-192 0 0 36 192 0z m5 133l-202 0 0 168 202 0z m25-77c-3 0-4 0-8 2-1 0-3 2-3 2-1 0-1 1-3 1-2 2-2 2-3 3 0 0 0 2-2 2-1 2-1 3-3 5 0 1-2 5-2 6 0 13 10 23 23 23 13 0 22-10 22-23 0-13-8-21-21-21z m-44 204l-164 0 0-21 164 0z m0-37l-164 0 0-21 164 0z m0-39l-164 0 0-20 164 0z"/>
 
33
  <glyph glyph-name="pocket" unicode="&#66;" d="M462 418c-4 14-19 25-35 25l-342 0c-16 0-31-9-35-24-2-5-4-9-4-14l0-127 2-25c6-58 35-107 82-141 1 0 1-2 3-2 24-17 53-30 81-36 15-4 28-5 42-5 13 0 26 1 38 3 2 0 4 0 5 2 0 0 2 0 2 0 29 6 54 17 78 35 2 0 2 1 3 1 47 36 76 85 82 141l2 26 0 128c0 5-2 8-4 13z m-88-132l-97-94c-5-5-13-8-19-8-7 0-15 3-20 8l-97 94c-11 12-11 29-2 40 11 12 29 12 40 2l79-75 78 75c11 11 29 11 40-2 10-11 10-28-2-40z"/>
34
  <glyph glyph-name="flipboard" unicode="&#67;" d="M69 443l0-374 125 0 0 125 124 0 0 124 125 0 0 125z"/>
35
  <glyph glyph-name="hacker-news" unicode="&#68;" d="M96 464l61 0 78-160c11-24 21-46 21-46 0 0 10 22 22 46l80 160 58 0-136-254 0-162-51 0 0 165z"/>
36
  <glyph glyph-name="upgrade" unicode="&#69;" d="M376 298l0 40c0 62-46 118-109 123-64 5-118-40-128-99 5 0 45 0 48 0 10 35 47 60 87 49 32-8 52-38 52-72l0-40c0-1 0-1 0-1l-190 0c-26-2-45-23-45-48l0-152c0-28 23-48 48-48l231 0c27 0 48 22 48 48l0 152c1 25-18 46-42 48z m-35-159c-7-6-18-6-26 0l-59 59-61-60c-3-4-8-5-13-5-4 0-9 1-12 5-7 6-7 17 0 25l73 74c7 6 18 6 26 0l72-72c8-8 8-19 0-26z"/>
37
  <glyph glyph-name="pin" unicode="&#70;" d="M366 222c-1 39-20 71-49 90l0 112c24 18 37 40 37 40l-196 0c0 0 13-24 39-42l0-110c-31-19-50-53-50-90l90 0 0-112c0-11 9-62 21-62 11 0 20 51 20 62l0 112z"/>
38
+ <glyph glyph-name="medium" unicode="&#101;" d="M109 347c0 5-2 10-5 13l-35 43 0 7 112 0 86-189 75 189 106 0 0-7-30-29c-2-3-4-6-4-9l0-216c0-3 0-7 4-8l30-29 0-6-150 0 0 6 30 30c3 4 3 4 3 8l0 173-86-219-11 0-101 219 0-147c-2-6 1-13 5-18l40-49 0-7-114 0 0 7 40 51c5 5 6 11 5 18z"/>
39
+ <glyph glyph-name="mix" unicode="&#103;" d="M70 418l0-288c0-47 72-48 72 0l0 196c7 44 72 42 72-4l0-144c0-48 80-48 80 0l0 96c5 44 72 43 72-4l0-19c0-49 72-46 72 0l0 167z"/>
40
+ <glyph glyph-name="instagram" unicode="&#100;" d="M448 333c-2 19-3 33-10 48-4 14-11 24-22 35-11 11-21 18-35 22-15 7-29 10-48 10-21 2-27 2-77 2-51 0-58 0-77-2-19 0-33-3-48-10-14-4-24-11-35-22-11-11-18-21-22-35-7-15-10-29-10-48-2-21-2-27-2-77 0-51 0-58 2-77 2-19 3-33 10-48 4-14 11-24 22-35 11-11 21-18 35-22 15-5 29-8 48-10 19-2 27-2 77-2 51 0 58 0 77 2 19 2 33 3 48 10 14 4 24 12 35 22 11 11 18 21 22 35 5 15 8 29 10 48 2 19 2 27 2 77 0 51 0 58-2 77z m-45-152c0-18-3-27-6-34-3-8-7-13-13-19-6-6-11-10-19-13-7-1-16-5-34-6-19-2-25-2-75-2-50 0-56 0-75 2-18 0-27 3-34 6-8 3-13 7-19 13-6 6-10 11-13 19-1 7-5 16-6 34-2 19-2 25-2 75 0 50 0 56 2 75 0 18 3 27 6 34 3 8 7 13 13 19 6 6 11 10 19 13 7 1 16 5 34 6 19 2 25 2 75 2 50 0 56 0 75-2 18 0 27-3 34-6 8-3 13-7 19-13 6-6 10-11 13-19 1-7 5-16 6-34 2-19 2-25 2-75-2-50-2-56-2-75z m-147 177c-56 0-102-46-102-102 0-56 46-102 102-102 56 0 102 46 102 102 0 56-46 102-102 102z m0-158c-30 0-56 26-56 56 0 30 26 56 56 56 30 0 56-26 56-56 0-30-26-56-56-56z m99 184c-16 0-29-13-29-29 0-16 13-29 29-29 16 0 29 15 29 29 0 15-13 29-29 29z"/>
41
  </font></defs></svg>
assets/fonts/sw-icon-font.ttf ADDED
Binary file
assets/fonts/sw-icon-font.woff ADDED
Binary file
{images → assets/images}/admin-options-page/Thumbs.db RENAMED
File without changes
{images → assets/images}/admin-options-page/affiliate-300x150.jpg RENAMED
File without changes
{images → assets/images}/admin-options-page/measure-roi-300x150.jpg RENAMED
File without changes
{images → assets/images}/admin-options-page/new_share_counts.png RENAMED
File without changes
{images → assets/images}/admin-options-page/social-warfare-light.png RENAMED
File without changes
{images → assets/images}/admin-options-page/social-warfare-pro-light.png RENAMED
File without changes
{images → assets/images}/admin-options-page/socialwarfare-20x20.png RENAMED
File without changes
{images → assets/images}/admin-options-page/starter-guide-300x150.jpg RENAMED
File without changes
{images → assets/images}/img-placeholder-og.jpg RENAMED
File without changes
{images → assets/images}/img-placeholder-pin.jpg RENAMED
File without changes
{js → assets/js}/admin-options-page.js RENAMED
File without changes
{js → assets/js}/admin-options-page.min.js RENAMED
File without changes
{js → assets/js}/admin.js RENAMED
@@ -1,356 +1,356 @@
1
- /**
2
- *
3
- * Functions for widgets and global utility functions.
4
- *
5
- * @since 1.0.0
6
- * @package SocialWarfare\Admin\Functions
7
- * @copyright Copyright (c) 2018, Warfare Plugins, LLC
8
- * @license GPL-3.0+
9
- */
10
-
11
- var socialWarfareAdmin = socialWarfareAdmin || {};
12
- var swpWidget, widgetSubmit;
13
-
14
- /**
15
- * Show and hide input fields based on conditional values.
16
- *
17
- * This function iterates over each element with the "dep" data attribute. For each
18
- * such dependant element, its parent element controls whether the dependant is shown or hidden
19
- * if the parent's value matches the condition.
20
- *
21
- * @since 3.0.0 Feb 12 2018 | Brought func in from admin-options-page.js and set to global scope; Updated variable names for semantics, switched to Yoda condietionals.
22
- * @since 3.0.0 Feb 14 2018 | Mapped the required array from variable types to string.
23
- *
24
- * @see admin-options-page.js
25
- * @return none
26
- */
27
- function swpConditionalFields() {
28
-
29
- function swp_selected(name) {
30
- return jQuery('select[name="' + name + '"]').val();
31
- }
32
-
33
- function swp_checked(name) {
34
- return jQuery( '[name="' + name + '"]' ).prop( 'checked' );
35
- }
36
-
37
- function string_to_bool(string) {
38
- if( string === 'true') { string = true };
39
- if( string === 'false') { string = false };
40
- return string;
41
- }
42
-
43
- // Loop through all the fields that have dependancies
44
- jQuery( '[data-dep]' ).each( function() {
45
-
46
- // Fetch the conditional values
47
- var condition = jQuery(this).data( 'dep' );
48
- var required = JSON.parse( JSON.stringify( jQuery(this).data( 'dep_val' ) ) );
49
-
50
- // Check if we're on the options page or somewhere else
51
- if (window.location.href.indexOf("page=social-warfare") === -1) {
52
- var conditionEl = jQuery(this).parents('.widgets-holder-wrap').find( '[data-swp-name="' + condition + '"]' );
53
- } else {
54
- var conditionEl = jQuery( '[name="' + condition + '"]' )[0];
55
- }
56
-
57
- var value;
58
-
59
- if (typeof conditionEl === 'undefined') {
60
- conditionEl = jQuery( '[name="' + condition + '"]' )[0];
61
-
62
- if (typeof conditionEl === 'undefined') {
63
- conditionEl = jQuery( '[fieldjQuery=' + condition + ']' )[0];
64
- }
65
- }
66
-
67
- // Fetch the value of checkboxes or other input types
68
- if ( jQuery( conditionEl ).attr( 'type' ) == 'checkbox' ) {
69
- value = jQuery( conditionEl ).prop( 'checked' );
70
- } else {
71
- value = jQuery( conditionEl ).val();
72
- }
73
- value = string_to_bool(value);
74
-
75
- //* Options page uses parent visibilty to check. Widget page does not. This could definiitely look better.
76
- // Show or hide based on the conditional values (and the dependancy must be visible in case it is dependant)
77
-
78
- if (window.location.href.indexOf("page=social-warfare") !== -1) {
79
-
80
- // If the required value matches and it's parent is also being shown, show this conditional field
81
- if (jQuery.inArray( value, required ) !== -1 && jQuery( conditionEl ).parent( '.sw-grid' ).is( ':visible' ) ) {
82
- jQuery(this).show();
83
- } else {
84
- jQuery(this).hide();
85
- }
86
- } else {
87
-
88
- // If the required value matches, show this conditional field
89
- if (jQuery.inArray( value, required ) !== -1 || value === required ) {
90
- jQuery(this).show();
91
- } else {
92
- jQuery(this).hide();
93
- }
94
- }
95
- });
96
-
97
- if ( false === swp_checked('float_style_source') &&
98
- 'custom_color' === swp_selected('float_default_colors')
99
- || 'custom_color_outlines' === swp_selected('float_default_colors')
100
- || 'custom_color' === swp_selected('float_single_colors')
101
- || 'custom_color_outlines' === swp_selected('float_single_colors')
102
- || 'custom_color' === swp_selected('float_hover_colors')
103
- || 'custom_color_outlines' === swp_selected('float_hover_colors') ) {
104
- jQuery( '.sideCustomColor_wrapper' ).slideDown();
105
-
106
- } else {
107
- jQuery( '.sideCustomColor_wrapper' ).slideUp();
108
- }
109
- }
110
-
111
- //* Only run on widgets.php
112
- if (window.location.href.indexOf("widgets.php") > -1 ) {
113
-
114
- //* Make sure the elements exist before trying to read them.
115
- var widgetFinder = setInterval(function() {
116
- if (typeof swpWidget !== 'undefined') clearInterval(widgetFinder);
117
-
118
- swpWidget = jQuery("#widgets-right [id*=_swp_popular_posts_widget], [id*=_swp_popular_posts_widget].open")[0];
119
- widgetSubmit = jQuery(swpWidget).find("[idjQuery=savewidget]")[0];
120
-
121
- //* Force swpConditionalFields to run when the widget is opened or saved.
122
- jQuery(swpWidget).on("click", swpConditionalFields);
123
- jQuery(widgetSubmit).on("click", function() {
124
- setTimeout(swpConditionalFields, 600);
125
- });
126
-
127
- }, 50);
128
- }
129
-
130
- (function( window, jQuery, undefined ) {
131
- 'use strict';
132
-
133
- socialWarfareAdmin.linkLength = function( input ) {
134
- var tmp = '';
135
-
136
- for ( var i = 0; i < 23; i++ ) {
137
- tmp += 'o';
138
- }
139
-
140
- return input.replace( /(http:\/\/[\S]*)/g, tmp ).length;
141
- };
142
-
143
- // Function for SM Title Counting
144
- function smTitleRemaining() {
145
- var smTitle = jQuery( '#social_warfare textarea#swp_og_title' ).val();
146
- var remaining = 60 - smTitle.length;
147
- if ( smTitle.length > 0 && remaining >= 0 ) {
148
- jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
149
- } else if ( smTitle.length > 0 && remaining < 0 ) {
150
- jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
151
- } else {
152
- jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
153
- }
154
- jQuery( '#social_warfare .swp_og_title .counterNumber' ).html( remaining );
155
- }
156
-
157
- // Function for SM Description Counting
158
- function smDescriptionRemaining() {
159
- var smDescription = jQuery( '#social_warfare textarea#swp_og_description' ).val();
160
- var remaining = 160 - smDescription.length;
161
- if ( smDescription.length > 0 && remaining >= 0 ) {
162
- jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
163
- } else if ( smDescription.length > 0 && remaining < 0 ) {
164
- jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
165
- } else {
166
- jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
167
- }
168
- jQuery( '#social_warfare .swp_og_description .counterNumber' ).html( remaining );
169
- }
170
-
171
- // Function for SM Description Counting
172
- function swpPinterestRemaining() {
173
- var pinterestDescription = jQuery( '#social_warfare textarea#swp_pinterest_description' ).val();
174
- if (!pinterestDescription) {
175
- pinterestDescription = '';
176
- }
177
- var remaining = 500 - pinterestDescription.length;
178
- if ( pinterestDescription.length > 0 && remaining >= 0 ) {
179
- jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
180
- } else if ( pinterestDescription.length > 0 && remaining < 0 ) {
181
- jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
182
- } else {
183
- jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
184
- }
185
- jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .counterNumber' ).html( remaining );
186
- }
187
-
188
- // Function for Twitter Box Counting
189
- function twitterRemaining() {
190
- var smTwitter = jQuery( '#social_warfare textarea#swp_custom_tweet' ).val();
191
- var handle = jQuery( '#social_warfare .twitterIDWrapper label' ).html();
192
- var linkSpace;
193
-
194
- if ( smTwitter.indexOf( 'http' ) > -1 || smTwitter.indexOf( 'https' ) > -1 ) {
195
- linkSpace = 0;
196
- jQuery( '.tweetLinkSection' ).css({ 'text-decoration': 'line-through' });
197
- } else {
198
- linkSpace = 23;
199
- jQuery( '.tweetLinkSection' ).css({ 'text-decoration': 'none' });
200
- }
201
-
202
- var remaining;
203
- if ( 'undefined' === typeof handle ) {
204
- remaining = 280 - socialWarfareAdmin.linkLength( smTwitter ) - linkSpace;
205
- } else {
206
- remaining = 280 - socialWarfareAdmin.linkLength( smTwitter ) - linkSpace - handle.length - 6;
207
- }
208
-
209
- if ( smTwitter.length > 0 && remaining >= 0 ) {
210
- jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
211
- } else if ( smTwitter.length > 0 && remaining < 0 ) {
212
- jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
213
- } else {
214
- jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
215
- }
216
-
217
- jQuery( '#social_warfare .swp_customTweetWrapper .counterNumber' ).html( remaining );
218
- }
219
-
220
- function toggleCustomThumbnailFields(show) {
221
- if (typeof show === 'undefined') show = true;
222
-
223
- if (show) {
224
- jQuery(".custom_thumb_size").show();
225
- }
226
- else {
227
- jQuery(".custom_thumb_size").hide();
228
- }
229
- }
230
-
231
- function noticeClickHandlers() {
232
- jQuery(".swp-notice-cta").on("click", function(e) {
233
- e.preventDefault();
234
- //* Do not use jQuery to get href.
235
- var link = e.target.getAttribute("href");
236
-
237
- if (typeof link == 'string' && link.length) {
238
- window.open(link);
239
- }
240
-
241
- var parent = jQuery(this).parents(".swp-dismiss-notice");
242
-
243
- jQuery.post({
244
- url: ajaxurl,
245
- data: {
246
- action: 'dismiss',
247
- key: parent.data("key"),
248
- timeframe: this.dataset.timeframe
249
- },
250
- success: function(result) {
251
- result = JSON.parse(result)
252
- if (result) {
253
- parent.slideUp(500);
254
- }
255
- }
256
- });
257
- });
258
- }
259
-
260
- jQuery( document ).ready( function() {
261
- noticeClickHandlers();
262
-
263
- if ( jQuery( '#social_warfare.postbox' ).length ) {
264
-
265
- // Add the CountDown Box for the Social Media Title
266
- jQuery( '#social_warfare #swp_og_title' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">60</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
267
-
268
- // Add the CountDown Box for the Social Media Description
269
- jQuery( '#social_warfare #swp_og_description' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">150</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
270
-
271
- // Add the CountDown Box for the Twitter Box
272
- jQuery( '#social_warfare #swp_customTweet' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">118</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
273
-
274
- // Add the CountDown Box for the Pinterest Box
275
- jQuery( '#social_warfare #swp_pinterest_description' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">140</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
276
-
277
- smTitleRemaining();
278
- jQuery( '#social_warfare textarea#swp_og_title' ).on( 'input', function() {
279
- smTitleRemaining();
280
- });
281
-
282
- smDescriptionRemaining();
283
- jQuery( '#social_warfare textarea#swp_og_description' ).on( 'input', function() {
284
- smDescriptionRemaining();
285
- });
286
-
287
- twitterRemaining();
288
- jQuery( '#social_warfare textarea#swp_customTweet' ).on( 'input', function() {
289
- twitterRemaining();
290
- });
291
-
292
- swpPinterestRemaining();
293
- jQuery( '#social_warfare textarea#swp_pinterest_description' ).on( 'input', function() {
294
- swpPinterestRemaining();
295
- });
296
-
297
- // Setup an initilazation loop
298
- var swpPostInit = setInterval( function() {
299
-
300
- var swpOgImage = jQuery( '.swp_og_imageWrapper ul.swpmb-media-list' );
301
- var swpPinImage = jQuery( '.swp_pinterest_imageWrapper ul.swpmb-media-list' );
302
-
303
- var smWidth, smHeight;
304
-
305
- // Check if the media list has been created yet
306
- if ( swpOgImage.length && swpOgImage.is( ':empty' ) ) {
307
- // Setup the Open Graph Image Placeholder
308
- smWidth = swpOgImage.width();
309
- smHeight = smWidth * ( 9 / 16 );
310
- swpOgImage.css({ height: smHeight + 'px' });
311
- } else {
312
- smHeight = swpOgImage.find( 'img' ).height();
313
- swpOgImage.css({ height: smHeight + 'px' });
314
- }
315
-
316
- var pinWidth, pinHeight;
317
-
318
- if ( swpPinImage.length && swpPinImage.is( ':empty' ) ) {
319
- // Setup the Open Graph Image Placeholder
320
- pinWidth = swpPinImage.width();
321
- pinHeight = pinWidth * ( 3 / 2 );
322
- swpPinImage.css({ height: pinHeight + 'px' });
323
- } else {
324
- pinHeight = swpPinImage.find( 'img' ).height();
325
- swpPinImage.css({
326
- height: pinHeight + 'px'
327
- });
328
- }
329
- }, 1000 );
330
- }
331
-
332
- swpConditionalFields();
333
- jQuery( '.swp_popular_post_options select' ).on( 'change', function() {
334
- swpConditionalFields();
335
- });
336
-
337
-
338
- /*
339
- var customThumbnailSelect = jQuery("#widget-swp_popular_posts_widget-2-thumb_size");
340
-
341
- if (customThumbnailSelect.value === 'custom') {
342
- toggleCustomThumbnailFields();
343
- }
344
-
345
- jQuery(customThumbnailSelect).on("change", function(e) {
346
- console.log("changing");
347
- console.log(e.target.value);
348
- if (e.target.value === 'custom') {
349
- toggleCustomThumbnailFields();
350
- } else {
351
- toggleCustomThumbnailFields(false);
352
- }
353
- });
354
- */
355
- });
356
- })( this, jQuery );
1
+ /**
2
+ *
3
+ * Functions for widgets and global utility functions.
4
+ *
5
+ * @since 1.0.0
6
+ * @package SocialWarfare\Admin\Functions
7
+ * @copyright Copyright (c) 2018, Warfare Plugins, LLC
8
+ * @license GPL-3.0+
9
+ */
10
+
11
+ var socialWarfareAdmin = socialWarfareAdmin || {};
12
+ var swpWidget, widgetSubmit;
13
+
14
+ /**
15
+ * Show and hide input fields based on conditional values.
16
+ *
17
+ * This function iterates over each element with the "dep" data attribute. For each
18
+ * such dependant element, its parent element controls whether the dependant is shown or hidden
19
+ * if the parent's value matches the condition.
20
+ *
21
+ * @since 3.0.0 Feb 12 2018 | Brought func in from admin-options-page.js and set to global scope; Updated variable names for semantics, switched to Yoda condietionals.
22
+ * @since 3.0.0 Feb 14 2018 | Mapped the required array from variable types to string.
23
+ *
24
+ * @see admin-options-page.js
25
+ * @return none
26
+ */
27
+ function swpConditionalFields() {
28
+
29
+ function swp_selected(name) {
30
+ return jQuery('select[name="' + name + '"]').val();
31
+ }
32
+
33
+ function swp_checked(name) {
34
+ return jQuery( '[name="' + name + '"]' ).prop( 'checked' );
35
+ }
36
+
37
+ function string_to_bool(string) {
38
+ if( string === 'true') { string = true };
39
+ if( string === 'false') { string = false };
40
+ return string;
41
+ }
42
+
43
+ // Loop through all the fields that have dependancies
44
+ jQuery( '[data-dep]' ).each( function() {
45
+
46
+ // Fetch the conditional values
47
+ var condition = jQuery(this).data( 'dep' );
48
+ var required = JSON.parse( JSON.stringify( jQuery(this).data( 'dep_val' ) ) );
49
+
50
+ // Check if we're on the options page or somewhere else
51
+ if (window.location.href.indexOf("page=social-warfare") === -1) {
52
+ var conditionEl = jQuery(this).parents('.widgets-holder-wrap').find( '[data-swp-name="' + condition + '"]' );
53
+ } else {
54
+ var conditionEl = jQuery( '[name="' + condition + '"]' )[0];
55
+ }
56
+
57
+ var value;
58
+
59
+ if (typeof conditionEl === 'undefined') {
60
+ conditionEl = jQuery( '[name="' + condition + '"]' )[0];
61
+
62
+ if (typeof conditionEl === 'undefined') {
63
+ conditionEl = jQuery( '[fieldjQuery=' + condition + ']' )[0];
64
+ }
65
+ }
66
+
67
+ // Fetch the value of checkboxes or other input types
68
+ if ( jQuery( conditionEl ).attr( 'type' ) == 'checkbox' ) {
69
+ value = jQuery( conditionEl ).prop( 'checked' );
70
+ } else {
71
+ value = jQuery( conditionEl ).val();
72
+ }
73
+ value = string_to_bool(value);
74
+
75
+ //* Options page uses parent visibilty to check. Widget page does not. This could definiitely look better.
76
+ // Show or hide based on the conditional values (and the dependancy must be visible in case it is dependant)
77
+
78
+ if (window.location.href.indexOf("page=social-warfare") !== -1) {
79
+
80
+ // If the required value matches and it's parent is also being shown, show this conditional field
81
+ if (jQuery.inArray( value, required ) !== -1 && jQuery( conditionEl ).parent( '.sw-grid' ).is( ':visible' ) ) {
82
+ jQuery(this).show();
83
+ } else {
84
+ jQuery(this).hide();
85
+ }
86
+ } else {
87
+
88
+ // If the required value matches, show this conditional field
89
+ if (jQuery.inArray( value, required ) !== -1 || value === required ) {
90
+ jQuery(this).show();
91
+ } else {
92
+ jQuery(this).hide();
93
+ }
94
+ }
95
+ });
96
+
97
+ if ( false === swp_checked('float_style_source') &&
98
+ 'custom_color' === swp_selected('float_default_colors')
99
+ || 'custom_color_outlines' === swp_selected('float_default_colors')
100
+ || 'custom_color' === swp_selected('float_single_colors')
101
+ || 'custom_color_outlines' === swp_selected('float_single_colors')
102
+ || 'custom_color' === swp_selected('float_hover_colors')
103
+ || 'custom_color_outlines' === swp_selected('float_hover_colors') ) {
104
+ jQuery( '.sideCustomColor_wrapper' ).slideDown();
105
+
106
+ } else {
107
+ jQuery( '.sideCustomColor_wrapper' ).slideUp();
108
+ }
109
+ }
110
+
111
+ //* Only run on widgets.php
112
+ if (window.location.href.indexOf("widgets.php") > -1 ) {
113
+
114
+ //* Make sure the elements exist before trying to read them.
115
+ var widgetFinder = setInterval(function() {
116
+ if (typeof swpWidget !== 'undefined') clearInterval(widgetFinder);
117
+
118
+ swpWidget = jQuery("#widgets-right [id*=_swp_popular_posts_widget], [id*=_swp_popular_posts_widget].open")[0];
119
+ widgetSubmit = jQuery(swpWidget).find("[idjQuery=savewidget]")[0];
120
+
121
+ //* Force swpConditionalFields to run when the widget is opened or saved.
122
+ jQuery(swpWidget).on("click", swpConditionalFields);
123
+ jQuery(widgetSubmit).on("click", function() {
124
+ setTimeout(swpConditionalFields, 600);
125
+ });
126
+
127
+ }, 50);
128
+ }
129
+
130
+ (function( window, jQuery, undefined ) {
131
+ 'use strict';
132
+
133
+ socialWarfareAdmin.linkLength = function( input ) {
134
+ var tmp = '';
135
+
136
+ for ( var i = 0; i < 23; i++ ) {
137
+ tmp += 'o';
138
+ }
139
+
140
+ return input.replace( /(http:\/\/[\S]*)/g, tmp ).length;
141
+ };
142
+
143
+ // Function for SM Title Counting
144
+ function smTitleRemaining() {
145
+ var smTitle = jQuery( '#social_warfare textarea#swp_og_title' ).val();
146
+ var remaining = 60 - smTitle.length;
147
+ if ( smTitle.length > 0 && remaining >= 0 ) {
148
+ jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
149
+ } else if ( smTitle.length > 0 && remaining < 0 ) {
150
+ jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
151
+ } else {
152
+ jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
153
+ }
154
+ jQuery( '#social_warfare .swp_og_title .counterNumber' ).html( remaining );
155
+ }
156
+
157
+ // Function for SM Description Counting
158
+ function smDescriptionRemaining() {
159
+ var smDescription = jQuery( '#social_warfare textarea#swp_og_description' ).val();
160
+ var remaining = 160 - smDescription.length;
161
+ if ( smDescription.length > 0 && remaining >= 0 ) {
162
+ jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
163
+ } else if ( smDescription.length > 0 && remaining < 0 ) {
164
+ jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
165
+ } else {
166
+ jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
167
+ }
168
+ jQuery( '#social_warfare .swp_og_description .counterNumber' ).html( remaining );
169
+ }
170
+
171
+ // Function for SM Description Counting
172
+ function swpPinterestRemaining() {
173
+ var pinterestDescription = jQuery( '#social_warfare textarea#swp_pinterest_description' ).val();
174
+ if (!pinterestDescription) {
175
+ pinterestDescription = '';
176
+ }
177
+ var remaining = 500 - pinterestDescription.length;
178
+ if ( pinterestDescription.length > 0 && remaining >= 0 ) {
179
+ jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
180
+ } else if ( pinterestDescription.length > 0 && remaining < 0 ) {
181
+ jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
182
+ } else {
183
+ jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
184
+ }
185
+ jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .counterNumber' ).html( remaining );
186
+ }
187
+
188
+ // Function for Twitter Box Counting
189
+ function twitterRemaining() {
190
+ var smTwitter = jQuery( '#social_warfare textarea#swp_custom_tweet' ).val();
191
+ var handle = jQuery( '#social_warfare .twitterIDWrapper label' ).html();
192
+ var linkSpace;
193
+
194
+ if ( smTwitter.indexOf( 'http' ) > -1 || smTwitter.indexOf( 'https' ) > -1 ) {
195
+ linkSpace = 0;
196
+ jQuery( '.tweetLinkSection' ).css({ 'text-decoration': 'line-through' });
197
+ } else {
198
+ linkSpace = 23;
199
+ jQuery( '.tweetLinkSection' ).css({ 'text-decoration': 'none' });
200
+ }
201
+
202
+ var remaining;
203
+ if ( 'undefined' === typeof handle ) {
204
+ remaining = 280 - socialWarfareAdmin.linkLength( smTwitter ) - linkSpace;
205
+ } else {
206
+ remaining = 280 - socialWarfareAdmin.linkLength( smTwitter ) - linkSpace - handle.length - 6;
207
+ }
208
+
209
+ if ( smTwitter.length > 0 && remaining >= 0 ) {
210
+ jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
211
+ } else if ( smTwitter.length > 0 && remaining < 0 ) {
212
+ jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
213
+ } else {
214
+ jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
215
+ }
216
+
217
+ jQuery( '#social_warfare .swp_customTweetWrapper .counterNumber' ).html( remaining );
218
+ }
219
+
220
+ function toggleCustomThumbnailFields(show) {
221
+ if (typeof show === 'undefined') show = true;
222
+
223
+ if (show) {
224
+ jQuery(".custom_thumb_size").show();
225
+ }
226
+ else {
227
+ jQuery(".custom_thumb_size").hide();
228
+ }
229
+ }
230
+
231
+ function noticeClickHandlers() {
232
+ jQuery(".swp-notice-cta").on("click", function(e) {
233
+ e.preventDefault();
234
+ //* Do not use jQuery to get href.
235
+ var link = e.target.getAttribute("href");
236
+
237
+ if (typeof link == 'string' && link.length) {
238
+ window.open(link);
239
+ }
240
+
241
+ var parent = jQuery(this).parents(".swp-dismiss-notice");
242
+
243
+ jQuery.post({
244
+ url: ajaxurl,
245
+ data: {
246
+ action: 'dismiss',
247
+ key: parent.data("key"),
248
+ timeframe: this.dataset.timeframe
249
+ },
250
+ success: function(result) {
251
+ result = JSON.parse(result)
252
+ if (result) {
253
+ parent.slideUp(500);
254
+ }
255
+ }
256
+ });
257
+ });
258
+ }
259
+
260
+ jQuery( document ).ready( function() {
261
+ noticeClickHandlers();
262
+
263
+ if ( jQuery( '#social_warfare.postbox' ).length ) {
264
+
265
+ // Add the CountDown Box for the Social Media Title
266
+ jQuery( '#social_warfare #swp_og_title' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">60</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
267
+
268
+ // Add the CountDown Box for the Social Media Description
269
+ jQuery( '#social_warfare #swp_og_description' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">150</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
270
+
271
+ // Add the CountDown Box for the Twitter Box
272
+ jQuery( '#social_warfare #swp_customTweet' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">118</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
273
+
274
+ // Add the CountDown Box for the Pinterest Box
275
+ jQuery( '#social_warfare #swp_pinterest_description' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">140</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
276
+
277
+ smTitleRemaining();
278
+ jQuery( '#social_warfare textarea#swp_og_title' ).on( 'input', function() {
279
+ smTitleRemaining();
280
+ });
281
+
282
+ smDescriptionRemaining();
283
+ jQuery( '#social_warfare textarea#swp_og_description' ).on( 'input', function() {
284
+ smDescriptionRemaining();
285
+ });
286
+
287
+ twitterRemaining();
288
+ jQuery( '#social_warfare textarea#swp_customTweet' ).on( 'input', function() {
289
+ twitterRemaining();
290
+ });
291
+
292
+ swpPinterestRemaining();
293
+ jQuery( '#social_warfare textarea#swp_pinterest_description' ).on( 'input', function() {
294
+ swpPinterestRemaining();
295
+ });
296
+
297
+ // Setup an initilazation loop
298
+ var swpPostInit = setInterval( function() {
299
+
300
+ var swpOgImage = jQuery( '.swp_og_imageWrapper ul.swpmb-media-list' );
301
+ var swpPinImage = jQuery( '.swp_pinterest_imageWrapper ul.swpmb-media-list' );
302
+
303
+ var smWidth, smHeight;
304
+
305
+ // Check if the media list has been created yet
306
+ if ( swpOgImage.length && swpOgImage.is( ':empty' ) ) {
307
+ // Setup the Open Graph Image Placeholder
308
+ smWidth = swpOgImage.width();
309
+ smHeight = smWidth * ( 9 / 16 );
310
+ swpOgImage.css({ height: smHeight + 'px' });
311
+ } else {
312
+ smHeight = swpOgImage.find( 'img' ).height();
313
+ swpOgImage.css({ height: smHeight + 'px' });
314
+ }
315
+
316
+ var pinWidth, pinHeight;
317
+
318
+ if ( swpPinImage.length && swpPinImage.is( ':empty' ) ) {
319
+ // Setup the Open Graph Image Placeholder
320
+ pinWidth = swpPinImage.width();
321
+ pinHeight = pinWidth * ( 3 / 2 );
322
+ swpPinImage.css({ height: pinHeight + 'px' });
323
+ } else {
324
+ pinHeight = swpPinImage.find( 'img' ).height();
325
+ swpPinImage.css({
326
+ height: pinHeight + 'px'
327
+ });
328
+ }
329
+ }, 1000 );
330
+ }
331
+
332
+ swpConditionalFields();
333
+ jQuery( '.swp_popular_post_options select' ).on( 'change', function() {
334
+ swpConditionalFields();
335
+ });
336
+
337
+
338
+ /*
339
+ var customThumbnailSelect = jQuery("#widget-swp_popular_posts_widget-2-thumb_size");
340
+
341
+ if (customThumbnailSelect.value === 'custom') {
342
+ toggleCustomThumbnailFields();
343
+ }
344
+
345
+ jQuery(customThumbnailSelect).on("change", function(e) {
346
+ console.log("changing");
347
+ console.log(e.target.value);
348
+ if (e.target.value === 'custom') {
349
+ toggleCustomThumbnailFields();
350
+ } else {
351
+ toggleCustomThumbnailFields(false);
352
+ }
353
+ });
354
+ */
355
+ });
356
+ })( this, jQuery );
{js → assets/js}/admin.min.js RENAMED
File without changes
{js → assets/js}/script.js RENAMED
@@ -350,9 +350,15 @@ var socialWarfarePlugin = socialWarfarePlugin || {};
350
  //* Otherwise, it added the padding every time this was called.
351
  function toggleFloatingBar() {
352
  var panel = $(".swp_social_panel").first();
353
- var location = panel.data("float");
354
  var newPadding = 0;
355
 
 
 
 
 
 
 
 
356
  if (panelIsVisible()) {
357
  $(".nc_wrapper").hide();
358
 
@@ -432,15 +438,19 @@ var socialWarfarePlugin = socialWarfarePlugin || {};
432
 
433
  // Iterate over the current set of matched elements.
434
  $('.swp-content-locator').parent().find('img').each(function() {
435
- var $image = $(this);
436
 
437
  if (typeof swpPinIt.disableOnAnchors != undefined && swpPinIt.disableOnAnchors) {
438
- if (jQuery($image).parents().filter("a").length) {
439
  return;
440
  }
441
  }
442
 
443
- if ($image.outerHeight() < swpPinIt.minHeight || $image.outerWidth() < swpPinIt.minWidth) {
 
 
 
 
444
  return;
445
  }
446
 
@@ -451,16 +461,12 @@ var socialWarfarePlugin = socialWarfarePlugin || {};
451
  var i = new Image();
452
  i.src = swpPinIt.image_source;
453
  pinMedia = jQuery(i).src;
454
-
455
- if (typeof pinMedia == 'undefined') {
456
- pinMedia = jQuery(i).attr('src')
457
- }
458
- } else if ($image.data('media')) {
459
- pinMedia = $image.data('media');
460
  } else if ($(this).data('lazy-src')) {
461
  pinMedia = $(this).data('lazy-src');
462
- } else if ($image[0].src) {
463
- pinMedia = $image[0].src;
464
  }
465
 
466
  // Bail if we don't have any media to pin.
@@ -468,31 +474,27 @@ var socialWarfarePlugin = socialWarfarePlugin || {};
468
  return;
469
  }
470
 
471
- if ($image.hasClass('no_pin')) {
472
- return;
473
- }
474
-
475
  var pinDesc = '';
476
 
477
- if (typeof $image.data("pin-description") != 'undefined') {
478
- pinDesc = $image.data("pin-description");
479
  } else if ('undefined' !== typeof swpPinIt.image_description){
480
  pinDesc = swpPinIt.image_description;
481
- } else if ($image.attr('title')) {
482
- pinDesc = $image.attr('title');
483
- } else if ($image.attr('alt')) {
484
- pinDesc = $image.attr('alt');
485
  }
486
 
487
  var bookmark = 'http://pinterest.com/pin/create/bookmarklet/?media=' + encodeURI(pinMedia) + '&url=' + encodeURI(options.pageURL) + '&is_video=false' + '&description=' + encodeURIComponent(pinDesc);
488
- var imageClasses = $image.attr('class');
489
- var imageStyle = $image.attr('style');
490
 
491
- $image.removeClass().attr('style', '').wrap(options.wrap);
492
 
493
- $image.after('<a href="' + bookmark + '" class="sw-pinit-button sw-pinit-' + swpPinIt.vLocation + ' sw-pinit-' + swpPinIt.hLocation + '">Save</a>');
494
 
495
- $image.parent('.sw-pinit').addClass(imageClasses).attr('style', imageStyle);
496
 
497
  $('.sw-pinit .sw-pinit-button').on('click', function() {
498
  window.open($(this).attr('href'), 'Pinterest', 'width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1');
350
  //* Otherwise, it added the padding every time this was called.
351
  function toggleFloatingBar() {
352
  var panel = $(".swp_social_panel").first();
 
353
  var newPadding = 0;
354
 
355
+ //* Are we on desktop or mobile?
356
+ if ($(window).width() > $(panel).data("min-width")) {
357
+ var location = $(panel).data("float");
358
+ } else {
359
+ var location = $(panel).data("float-mobile")
360
+ }
361
+
362
  if (panelIsVisible()) {
363
  $(".nc_wrapper").hide();
364
 
438
 
439
  // Iterate over the current set of matched elements.
440
  $('.swp-content-locator').parent().find('img').each(function() {
441
+ var image = $(this);
442
 
443
  if (typeof swpPinIt.disableOnAnchors != undefined && swpPinIt.disableOnAnchors) {
444
+ if (jQuery(image).parents().filter("a").length) {
445
  return;
446
  }
447
  }
448
 
449
+ if (image.outerHeight() < swpPinIt.minHeight || image.outerWidth() < swpPinIt.minWidth) {
450
+ return;
451
+ }
452
+
453
+ if (image.hasClass('no_pin') || image.hasClass('no-pin')) {
454
  return;
455
  }
456
 
461
  var i = new Image();
462
  i.src = swpPinIt.image_source;
463
  pinMedia = jQuery(i).src;
464
+ } else if (image.data('media')) {
465
+ pinMedia = image.data('media');
 
 
 
 
466
  } else if ($(this).data('lazy-src')) {
467
  pinMedia = $(this).data('lazy-src');
468
+ } else if (image[0].src) {
469
+ pinMedia = image[0].src;
470
  }
471
 
472
  // Bail if we don't have any media to pin.
474
  return;
475
  }
476
 
 
 
 
 
477
  var pinDesc = '';
478
 
479
+ if (typeof image.data("pin-description") != 'undefined') {
480
+ pinDesc = image.data("pin-description");
481
  } else if ('undefined' !== typeof swpPinIt.image_description){
482
  pinDesc = swpPinIt.image_description;
483
+ } else if (image.attr('title')) {
484
+ pinDesc = image.attr('title');
485
+ } else if (image.attr('alt')) {
486
+ pinDesc = image.attr('alt');
487
  }
488
 
489
  var bookmark = 'http://pinterest.com/pin/create/bookmarklet/?media=' + encodeURI(pinMedia) + '&url=' + encodeURI(options.pageURL) + '&is_video=false' + '&description=' + encodeURIComponent(pinDesc);
490
+ var imageClasses = image.attr('class');
491
+ var imageStyle = image.attr('style');
492
 
493
+ image.removeClass().attr('style', '').wrap(options.wrap);
494
 
495
+ image.after('<a href="' + bookmark + '" class="sw-pinit-button sw-pinit-' + swpPinIt.vLocation + ' sw-pinit-' + swpPinIt.hLocation + '">Save</a>');
496
 
497
+ image.parent('.sw-pinit').addClass(imageClasses).attr('style', imageStyle);
498
 
499
  $('.sw-pinit .sw-pinit-button').on('click', function() {
500
  window.open($(this).attr('href'), 'Pinterest', 'width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1');
assets/js/script.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var socialWarfarePlugin=socialWarfarePlugin||{};!function(e,t){var i,a=e.socialWarfarePlugin;a.throttle=i=function(e,i,n,o){function s(){function a(){p=+new Date,n.apply(l,d)}function s(){r=t}var l=this,c=+new Date-p,d=arguments;o&&!r&&a(),r&&clearTimeout(r),o===t&&c>e?a():!0!==i&&(r=setTimeout(o?s:a,o===t?e-c:e))}var r,p=0;return"boolean"!=typeof i&&(o=n,n=i,i=t),a.guid&&(s.guid=n.guid=n.guid||a.guid++),s},a.debounce=function(e,a,n){return n===t?i(e,a,!1):i(e,n,!1!==a)}}(this),function(e,t,i){"use strict";function a(e){return parseInt(e,10)}function n(i){var a=t.Event(i);t(e).trigger(a)}function o(){t(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover) .iconFiller").removeAttr("style"),t(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover)").removeAttr("style")}function s(){var i=(t(".swp_social_panel").not(".swp_social_panelSide").first(),!1),a=t(e).scrollTop();return t(".swp_social_panel").not(".swp_social_panelSide, .nc_floater").each(function(n){var o=t(this).offset();if("undefined"!=typeof swpFloatBeforeContent&&!1===swpFloatBeforeContent){var s=jQuery(".swp-content-locator").parent();0===n&&s.offset().top>a+jQuery(e).height()&&(i=!0)}o.top+t(this).height()>a&&o.top<a+t(e).height()&&(i=!0)}),i}function r(){t(".nc_wrapper").length&&t(".nc_wrapper").remove();var i=t(".swp_social_panel"),a=i.data("float");if(void 0!==i&&!(t(e).width()>i.data("min-width")&&"top"!=a&&"bottom"!=a)){var n=i.data("float-color"),o="center"==i.data("align")?0:i.offset().left,s=t('<div class="nc_wrapper" style="background-color:'+n+'"></div>');if("left"==a||"right"==a)var r=i.data("float-mobile");else var r=a;s.addClass(r).hide().appendTo("body");i.first().clone().addClass("nc_floater").css({width:i.outerWidth(!0),left:o}).appendTo(s),t(".swp_social_panel .swp_count").css({transition:"padding .1s linear"})}}function p(){var i=t(".swp_social_panel").first(),a=i.data("float");if("none"==a)return void jQuery(".nc_wrapper, .swp_social_panelSide").hide();t(e).width()<i.data("min-width")&&(r(),l(),d()),"right"!=a&&"left"!=a||c(),"bottom"!=a&&"top"!=a||d()}function l(){var e=(t(".swp_social_panel").first(),s()?"collapse":"visible");t(".swp_social_panelSide").hide(),t(".nc_wrapper").css("visibility",e)}function c(){var i=t(".swp_social_panel").not(".swp_social_panelSide").first(),a=t(".swp_social_panelSide"),n=a.data("float"),o=s();if(t(e).width()<i.data("min-width")&&t(".nc_wrapper").length)return void a.hide();if(i.length||(o=!(t(e).width()>a.data("min-width"))),"slide"==a.data("transition")){var r=-1!==n.indexOf("left")?"left":"right";o?a.css(r,"-150px"):a.css(r,"5px")}else o?a.css("opacity",1).fadeOut(300).css("opacity",0):a.css("opacity",0).fadeIn(300).css({opacity:1,display:"flex"})}function d(){var i=t(".swp_social_panel").first(),a=0;if(t(e).width()>t(i).data("min-width"))var n=t(i).data("float");else var n=t(i).data("float-mobile");s()?(t(".nc_wrapper").hide(),a="bottom"==n?m:g):(t(".nc_wrapper").show(),jQuery(".swp_social_panel.nc_floater").css("opacity",1),"bottom"==n?a=m+50:i.offset().top>t(e).scrollTop()+t(e).height()&&(a=g+50,t("body").animate({"padding-top":a+"px"},0)));t("body").animate({paddingProp:a},0)}function h(){var t=jQuery("[class*=float-position-center]");if(t.length){var i=t.outerHeight(),a=e.innerHeight;if(i>a)return void t.css("top",0);var n=(a-i)/2;t.css("top",n)}}function f(){0!==t(".swp_social_panel").length&&(r(),h(),b.activateHoverStates(),_(),t(e).scroll(b.throttle(50,function(){p()})),t(e).trigger("scroll"))}function u(){var a={wrap:'<div class="sw-pinit" />',pageURL:document.URL},n=t.extend(a,n);t(".swp-content-locator").parent().find("img").each(function(){var a=t(this);if(!(typeof swpPinIt.disableOnAnchors!=i&&swpPinIt.disableOnAnchors&&jQuery(a).parents().filter("a").length||a.outerHeight()<swpPinIt.minHeight||a.outerWidth()<swpPinIt.minWidth||a.hasClass("no_pin")||a.hasClass("no-pin"))){var o=!1;if(void 0!==swpPinIt.image_source){var s=new Image;s.src=swpPinIt.image_source,o=jQuery(s).src}else a.data("media")?o=a.data("media"):t(this).data("lazy-src")?o=t(this).data("lazy-src"):a[0].src&&(o=a[0].src);if(!1!==o){var r="";void 0!==a.data("pin-description")?r=a.data("pin-description"):void 0!==swpPinIt.image_description?r=swpPinIt.image_description:a.attr("title")?r=a.attr("title"):a.attr("alt")&&(r=a.attr("alt"));var p="http://pinterest.com/pin/create/bookmarklet/?media="+encodeURI(o)+"&url="+encodeURI(n.pageURL)+"&is_video=false&description="+encodeURIComponent(r),l=a.attr("class"),c=a.attr("style");a.removeClass().attr("style","").wrap(n.wrap),a.after('<a href="'+p+'" class="sw-pinit-button sw-pinit-'+swpPinIt.vLocation+" sw-pinit-"+swpPinIt.hLocation+'">Save</a>'),a.parent(".sw-pinit").addClass(l).attr("style",c),t(".sw-pinit .sw-pinit-button").on("click",function(){if(e.open(t(this).attr("href"),"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"),!0===swpClickTracking){"function"==typeof ga&&ga("send","event","social_media","swp_pin_image_share"),"object"==typeof dataLayer&&dataLayer.push({event:"swp_pin_image_share"})}return!1})}}});var o=w();void 0!==o&&o&&v(o)}function _(){t(".nc_tweet, a.swp_CTT").off("click"),t(".nc_tweet, a.swp_CTT").on("click",function(i){if(t(this).hasClass("noPop"))return!1;if(t(this).data("link")){i.preventDefault();var a,n,o,s,r=t(this).data("link");r=r.replace("’","'"),t(this).hasClass("pinterest")||t(this).hasClass("buffer_link")||t(this).hasClass("flipboard")?(a=550,n=775):(a=270,n=500),o=e.screenY+(e.innerHeight-a)/2,s=e.screenX+(e.innerWidth-n)/2;var p="height="+a+",width="+n+",top="+o+",left="+s;e.open(r,"_blank",p);if(1==swpClickTracking){if(t(this).hasClass("nc_tweet"))var l=t(this).parents(".nc_tweetContainer").attr("data-network");else if(t(this).hasClass("swp_CTT"))var l="ctt";"function"==typeof ga&&ga("send","event","social_media","swp_"+l+"_share"),"object"==typeof dataLayer&&dataLayer.push({event:"swp_"+l+"_share"})}return!1}})}function w(){var t=null;return document.querySelectorAll("span").forEach(function(i,a){var n=e.getComputedStyle(i);"rgb(189, 8, 28)"==n.backgroundColor&&"14px 14px"==n.backgroundSize&&"8675309"==n.zIndex&&(t=i)}),t}function v(t){var i=t.nextSibling;if(void 0!==i&&"SPAN"==i.nodeName){var a=e.getComputedStyle(i);0===a.width.indexOf("24px")&&0===a.height.indexOf("24px")&&i.remove()}t.remove()}var b=e.socialWarfarePlugin,g=a(t("body").css("padding-top").replace("px","")),m=a(t("body").css("padding-bottom").replace("px","")),y={};socialWarfarePlugin.fetchFacebookShares=function(){t.when(t.get("https://graph.facebook.com/?fields=og_object{likes.summary(true).limit(0)},share&id="+swp_post_url),swp_post_recovery_url?t.get("https://graph.facebook.com/?fields=og_object{likes.summary(true).limit(0)},share&id="+swp_post_recovery_url):"").then(function(e,i){if(void 0!==e[0].share){var n=a(e[0].share.share_count),o=a(e[0].share.comment_count);if(void 0!==e[0].og_object)var s=a(e[0].og_object.likes.summary.total_count);else var s=0;var r=n+o+s;if(swp_post_recovery_url){if(void 0!==i[0].share)var p=a(i[0].share.share_count),l=a(i[0].share.comment_count);else var p=0,l=0;if(void 0!==i[0].og_object)var c=a(i[0].og_object.likes.summary.total_count);else var c=0;var d=p+l+c;r!==d&&(r+=d)}y={action:"swp_facebook_shares_update",post_id:swp_post_id,share_counts:r},t.post(swp_admin_ajax,y)}})},b.activateHoverStates=function(){n("pre_activate_buttons"),t(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer").on("mouseenter",function(){if(!t(this).hasClass("swp_nohover")){o();var e=t(this).find(".swp_share").outerWidth(),i=t(this).find("i.sw").outerWidth(),a=t(this).width(),n=1+(e+35)/a;t(this).find(".iconFiller").width(e+i+25+"px"),t(this).css({flex:n+" 1 0%"})}}),t(".swp_social_panel:not(.swp_social_panelSide)").on("mouseleave",function(){o()})},t(e).on("load",function(){"undefined"!=typeof swpPinIt&&swpPinIt.enabled&&u()}),t(document).ready(function(){_(),f();var i=t(".swp_social_panelSide"),n=!1;if(t(".swp_social_panel").hover(function(){n=!0},function(){n=!1}),t(e).resize(b.debounce(250,function(){t(".swp_social_panel").length&&!1!==n||(e.swpAdjust=1,f())})),t(document.body).on("post-load",function(){f()}),0!==i.length){if(-1!==t(i).attr("class").indexOf("swp_side"))return;var o=t(i).height(),s=t(e).height(),r=a(s/2-o/2);setTimeout(function(){t(i).animate({top:r},0)},105)}1===t(".swp-content-locator").parent().children().length&&t(".swp-content-locator").parent().hide()})}(this,jQuery),function(e){var t=/iPhone/i,i=/iPod/i,a=/iPad/i,n=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,o=/Android/i,s=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,r=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,p=/Windows Phone/i,l=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,c=/BlackBerry/i,d=/BB10/i,h=/Opera Mini/i,f=/(CriOS|Chrome)(?=.*\bMobile\b)/i,u=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,_=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),w=function(e,t){return e.test(t)},v=function(e){var v=e||navigator.userAgent,b=v.split("[FBAN");if(void 0!==b[1]&&(v=b[0]),b=v.split("Twitter"),void 0!==b[1]&&(v=b[0]),this.apple={phone:w(t,v),ipod:w(i,v),tablet:!w(t,v)&&w(a,v),device:w(t,v)||w(i,v)||w(a,v)},this.amazon={phone:w(s,v),tablet:!w(s,v)&&w(r,v),device:w(s,v)||w(r,v)},this.android={phone:w(s,v)||w(n,v),tablet:!w(s,v)&&!w(n,v)&&(w(r,v)||w(o,v)),device:w(s,v)||w(r,v)||w(n,v)||w(o,v)},this.windows={phone:w(p,v),tablet:w(l,v),device:w(p,v)||w(l,v)},this.other={blackberry:w(c,v),blackberry10:w(d,v),opera:w(h,v),firefox:w(u,v),chrome:w(f,v),device:w(c,v)||w(d,v)||w(h,v)||w(u,v)||w(f,v)},this.seven_inch=w(_,v),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window)return this},b=function(){var e=new v;return e.Class=v,e};"undefined"!=typeof module&&module.exports&&"undefined"==typeof window?module.exports=v:"undefined"!=typeof module&&module.exports&&"undefined"!=typeof window?module.exports=b():"function"==typeof define&&define.amd?define("swp_isMobile",[],e.swp_isMobile=b()):e.swp_isMobile=b()}(this);
{js → assets/js}/sw-shortcode-generator.js RENAMED
File without changes
{js → assets/js}/sw-shortcode-generator.min.js RENAMED
File without changes
css/admin.min.css DELETED
@@ -1 +0,0 @@
1
- .notAvailable{opacity:0.3}.swp_CountDown{background-color:#CCC;display:inline-block;float:right;padding:5px 15px;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;color:#FFF;font-weight:bold;margin-top:-27px}.swp_CountDown.swp_blue{background-color:#30394F}.swp_CountDown.swp_red{background-color:#EE464F}#social_warfare textarea.large-text{width:100%}#social_warfare ul.swpmb-media-list.ui-sortable{display:block;width:100%;-webkit-background-size:cover;background-size:cover;background-position-x:center;background-repeat:no-repeat;background-color:#ccc;-webkit-border-radius:4px;border-radius:4px;padding:0}#social_warfare .swp_og_imageWrapper ul.swpmb-media-list{background-image:url('../images/img-placeholder-og.jpg')}#social_warfare .swp_pinterest_imageWrapper ul.swpmb-media-list{background-image:url('../images/img-placeholder-pin.jpg')}.swpmb-field.swpmb-textarea-wrapper.swp_og_title,.swpmb-field.swpmb-textarea-wrapper.swp_og_description,.swpmb-field.swpmb-textarea-wrapper.swp_pinterest_descriptionWrapper,.swpmb-field.swpmb-textarea-wrapper.swp_customTweetWrapper{width:63%;float:left}.swpmb-field.swpmb-text-wrapper.swp_share_recoveryWrapper{width:63%;float:left}.swpmb-field.swpmb-text-wrapper.swp_share_recoveryWrapper input{width:100%}.swpmb-field.swpmb-select-wrapper.swp_pin_browser_extensionWrapper,.swpmb-field.swpmb-select-wrapper.swp_pin_browser_extension_locationWrapper,.swpmb-field.swpmb-select-wrapper.swp_post_locationWrapper,.swpmb-field.swpmb-select-wrapper.swp_float_locationWrapper{width:32%;float:left;min-width:320px}.swpmb-field.swpmb-select-wrapper.swp_pin_browser_extensionWrapper select,.swpmb-field.swpmb-select-wrapper.swp_pin_browser_extension_locationWrapper select,.swpmb-field.swpmb-select-wrapper.swp_post_locationWrapper select,.swpmb-field.swpmb-select-wrapper.swp_float_locationWrapper select{width:90%}.swpmb-field.swpmb-image_advanced-wrapper.swp_og_imageWrapper,.swpmb-field.swpmb-image_advanced-wrapper.swp_pinterest_imageWrapper{width:30%;float:left;margin-right:3%}#social_warfare .swpmb-label,#social_warfare .swpmb-input{width:100%}#social_warfare .swpmb-field{margin-top:10px}#social_warfare .swpmb-image-item,#social_warfare .swpmb-media-preview,#social_warfare .swpmb-media-content .centered,#social_warfare .swpmb-media-content img{width:100%;height:auto;max-height:none;-webkit-transform:none;-ms-transform:none;transform:none}.wp-core-ui #social_warfare a.swpmb-add-media.button{display:block;background:#30394f;color:#fff;font-size:12px;line-height:1;text-align:center;vertical-align:middle;padding:15px 25px;margin:0;-webkit-box-shadow:none;box-shadow:none;border:none;height:auto}.wp-core-ui #social_warfare a.swpmb-add-media.button:hover{background:#EE464F}#social_warfare .swpmb-media-content img{-webkit-transform:translate(0%,0%);-ms-transform:translate(0%,0%);transform:translate(0%,0%)}#social_warfare .swpmb-media-content{overflow:visible}#social_warfare .swpmb-media-preview:before{padding-top:0}#social_warfare .swpmb-media-content{position:inherit}#social_warfare .swpmb-divider-wrapper hr{border:none!important}#social_warfare .swpmb-label label{font-weight:bold;color:#30394f;font-size:18px}#social_warfare .swpmb-divider-wrapper{max-height:1px;clear:both}#social_warfare .swpmb-label{margin-bottom:10px}#social_warfare h2.hndle span:before{content:'p';margin-right:10px;font-family:"sw-icon-font";vertical-align:middle}#social_warfare .dashicons,#social_warfare .sw{vertical-align:middle;margin-right:10px;font-size:18px}#social_warfare .sw-premium-blocker{position:absolute;width:100%;height:100%;top:0;left:0}#social_warfare .sw-premium-blocker:not(.no-icon):before{font-family:'sw-icon-font';content:'E';font-size:24px;float:right;margin:10px 40px 0 0}#social_warfare #swp_recovery_url{}.ui-tooltip.sw-admin-hover-notice{background:#ee464f;color:#fff;padding:15px;-webkit-border-radius:2px;border-radius:2px;margin:15px 0;border:0;-webkit-box-shadow:none;box-shadow:none;max-width:none;padding:20px}.sw-admin-hover-notice i:before{font-family:'sw-icon-font';font-size:26px;margin:0 15px 0 0;vertical-align:middle;content:'E';float:left;font-style:normal}[class$=title_wrapper] ~ [class$=title_wrapper]{border-top:1px solid #CED3DC;padding-top:40px}.swp-notice-wrapper{max-width:73%;margin-top:-15px;margin-bottom:15px}.swp-notice{padding:10px 15px;padding:20px}.swp-actions{display:flex;align-items:center}.swp-notice a{cursor:hover;text-decoration:underline;margin:0 10px}.swp-dismiss-notice.notice.notice-info{font-size:15px;line-height:25px}.swp-dismiss-notice.notice.notice-info{border-left-color:#D34250;padding:20px;margin:15px 0 15px}.swp-dismiss-notice.notice.notice-info p{font-size:15px;line-height:25px;padding:0;margin:0 0 20px}a.swp-notice-cta{cursor:pointer;text-decoration:underline;font-size:15px;line-height:30px;margin-right:50px}
 
css/style.min.css DELETED
@@ -1 +0,0 @@
1
- .swp_social_panel{clear:both;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;height:34px;line-height:1;margin-bottom:20px!important;margin-top:20px!important;overflow:hidden;padding:0;-webkit-align-items:stretch;align-items:stretch;-webkit-box-align:stretch;-moz-box-align:stretch;-webkit-box-pack:justify;-moz-box-pack:justify;direction:ltr;-ms-flex-align:stretch;-ms-flex-line-pack:center;-ms-flex-pack:justify;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;justify-content:space-between}.swp_social_panel:not(.nc_floater):not(.swp_social_panelSide){width:100%!important}.nc_wrapper .swp_social_panel{margin-bottom:10px!important;margin-top:10px!important}div.swp_social_panel .nc_tweetContainer:not(.total_shares):not(.total_sharesalt){-webkit-border-radius:2px;border-radius:2px;cursor:pointer;float:left;font-family:Lato;height:32px;margin:0 5px 3px 5px;min-width:34px;overflow:hidden;text-align:center;-webkit-transition:all 0.1s linear;transition:all 0.1s linear}div.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer{-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.swp_social_panel .nc_tweetContainer a.nc_tweet,.swp_social_panel .total_shares .swp_count{display:block;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;font-family:Lato,sans-serif;font-size:18px!important;font-weight:bold;height:30px;text-decoration:none;text-decoration:none!important;text-transform:none;-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap}.swp_social_panel:not(.nc_floater):not(.swp_social_panelSide).swp_shift{padding:0 10px}.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:nth-child(1){margin-left:0}.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:nth-last-child(1){margin-right:0}.swp_social_panel a .swp_count:not(.swp_hide){display:inline-block;line-height:32px;margin:0;padding:0 5px;-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.swp_social_panel a .swp_count.swp_hide{margin:0 auto}.swp_social_panel span:before{content:initial!important}.swp_social_panel .total_shares .swp_count{line-height:30px}.swp_social_panel span.swp_count{font-size:14px}.swp_social_panel span.iconFiller{font-size:18px;margin:0 auto}.swp_social_panel.notMobile .nc_tweetContainer:nth-child(1){margin-left:0}.swp_social_panel:not(.swp_social_panelSide){-webkit-transition:opacity 0.2s ease-in-out;transition:opacity 0.2s ease-in-out}.swp_social_panel:not(.swp_social_panelSide) div.total_shares.total_sharesalt:nth-child(1){margin-left:0;margin-right:15px;padding-left:0}.swp_social_panel:not(.swp_social_panelSide) div.total_shares.total_sharesalt:nth-last-child(1){margin-right:0;padding-right:0}a.swp_CTT{cursor:pointer}span.swp_share{display:block;float:right;float:left;font-size:14px;font-weight:normal;height:30px;line-height:30px;margin:0 0 0 6px;max-width:none!important;vertical-align:middle}.swp_social_panelSide span.swp_share{margin:0}.swp_social_panel .sw{float:left;height:30px;line-height:32px;margin:0 5px;text-shadow:none!important;width:20px}.iconFiller{display:block;float:left;height:30px;overflow:hidden;-webkit-transition:width 0.1s linear;transition:width 0.1s linear}.swp_social_panel .iconFiller{width:30px}span.spaceManWilly{display:block;width:120px}.swp_social_panel .total_shares{background:transparent!important;;border:none!important;-webkit-border-radius:2px;border-radius:2px;color:white;cursor:default;display:block;font-size:19px;padding:0 10px;-webkit-box-flex:0!important;-moz-box-flex:0!important;-webkit-flex:none!important;-ms-flex:none!important;flex:none!important}.swp_social_panel .total_sharesalt{background:transparent!important;border:none!important}.swp_social_panel div.total_shares.total_sharesalt,.swp_social_panel:hover div.total_shares.total_sharesalt:not(:nth-child(1)){background:transparent!important;border:none;color:#474b4d;margin-left:0!important;margin-bottom:10px!important}div.swp_social_panel:hover div.total_shares.total_sharesalt:not(:nth-child(1)){background:transparent;color:#474b4d;margin-left:10px}.swp_social_panel .total_shares.total_sharesalt .swp_label{color:#474b4d;font-size:10px;letter-spacing:0;min-width:40px;vertical-align:middle}.swp_social_panel .total_shares .swp_label{font-size:10px;vertical-align:middle}.swp_social_panel .total_shares.total_sharesalt .swp_count{color:#474b4d;font-size:24px}.swp_social_panel:hover .total_shares,.swp_social_panel.swp_full_color .total_shares,.swp_social_panel.swp_fade .total_shares,.swp_social_panel.swp_customFull:hover div.total_shares{background:#e08a0f}.swp_social_panel .nc_tweetContainer.total_shares.total_sharesalt:before{content:"o";display:inline-block;font-family:sw-icon-font;margin-top:7px;vertical-align:top}.swp_social_panel:not(.swp_social_panelSide) .total_shares.total_sharesalt .swp_count{display:inline-block;line-height:0;margin-left:8px;margin-top:12px;min-width:45px;position:relative;vertical-align:middle}span.swp_label{display:block;font-size:9px!important;margin-top:13px;position:absolute;text-align:center!important;text-transform:uppercase}.swp_social_panelSide span.swp_label{margin-top:0}.swp_social_panel.swp_leaf .nc_tweetContainer{-webkit-border-radius:15px 0!important;border-radius:15px 0!important;border-width:1px}.swp_social_panel.swp_pill .nc_tweetContainer{-webkit-border-radius:50px!important;border-radius:50px!important;border-width:1px}.swp_social_panel.swp_shift .nc_tweetContainer:not(.total_shares){border-width:1px;-moz-transform:skew(-25deg);-o-transform:skew(-25deg);-webkit-transform:skew(-25deg)}.swp_social_panel.swp_shift .nc_tweetContainer a{-moz-transform:skew(25deg);-o-transform:skew(25deg);-webkit-transform:skew(25deg)}.swp_connected .nc_tweetContainer,.swp_connected:hover .nc_tweetContainer,.swp_connected .nc_tweetContainer:hover{-webkit-border-radius:0!important;border-radius:0!important;border-width:1px;margin:0!important}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_google_plus,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_google_plus:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_google_plus:not(:hover){border:1px solid #df4b37}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_twitter,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_twitter:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_twitter:not(:hover){border:1px solid #429cd6}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_facebook,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_facebook:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_facebook:not(:hover){border:1px solid #3a589e}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_pinterest,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_pinterest:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_pinterest:not(:hover){border:1px solid #cd2029}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_linkedin,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_linkedin:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_linkedin:not(:hover){border:1px solid #0d77b7}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_tumblr,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_tumblr:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_tumblr:not(:hover){border:1px solid #39475d}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_stumbleupon,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_stumbleupon:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_stumbleupon:not(:hover){border:1px solid #ef5025}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_yummly,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_yummly:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_yummly:not(:hover){border:1px solid #e26426}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_reddit,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_reddit:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_reddit:not(:hover){border:1px solid #f04b23}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_email,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_email:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_email:not(:hover){border:1px solid #6bcce9}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_whatsapp,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_whatsapp:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_whatsapp:not(:hover){border:1px solid #71c169}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_pocket,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_pocket:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_pocket:not(:hover){border:1px solid #ef4056}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_buffer,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_buffer:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_buffer:not(:hover){border:1px solid #323b43}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_hacker_news,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_hacker_news:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_hacker_news:not(:hover){border:1px solid #d85623}.swp_social_panel.swp_flat_fresh.swp_default_full_color .swp_flipboard,html body .swp_social_panel.swp_flat_fresh.swp_individual_full_color .swp_flipboard:hover,body .swp_social_panel.swp_flat_fresh.swp_other_full_color:hover .swp_flipboard:not(:hover){border:1px solid #bf2626}.swp_social_panel.swp_default_full_color .swp_google_plus,html body .swp_social_panel.swp_individual_full_color .swp_google_plus:hover,body .swp_social_panel.swp_other_full_color:hover .swp_google_plus{background:#df4b37;border:1px solid #c44133}.swp_social_panel.swp_default_full_color .swp_twitter,html body .swp_social_panel.swp_individual_full_color .swp_twitter:hover,body .swp_social_panel.swp_other_full_color:hover .swp_twitter{background:#429cd6;border:1px solid #3c87b2}.swp_social_panel.swp_default_full_color .swp_facebook,html body .swp_social_panel.swp_individual_full_color .swp_facebook:hover,body .swp_social_panel.swp_other_full_color:hover .swp_facebook{background:#3a589e;border:1px solid #2e4675}.swp_social_panel.swp_default_full_color .swp_pinterest,html body .swp_social_panel.swp_individual_full_color .swp_pinterest:hover,body .swp_social_panel.swp_other_full_color:hover .swp_pinterest{background:#cd2029;border:1px solid #aa1b29}.swp_social_panel.swp_default_full_color .swp_linkedin,html body .swp_social_panel.swp_individual_full_color .swp_linkedin:hover,body .swp_social_panel.swp_other_full_color:hover .swp_linkedin{background:#0d77b7;border:1px solid #0c6591}.swp_social_panel.swp_default_full_color .swp_tumblr,html body .swp_social_panel.swp_individual_full_color .swp_tumblr:hover,body .swp_social_panel.swp_other_full_color:hover .swp_tumblr{background:#39475d;border:1px solid #27313f}.swp_social_panel.swp_default_full_color .swp_stumbleupon,html body .swp_social_panel.swp_individual_full_color .swp_stumbleupon:hover,body .swp_social_panel.swp_other_full_color:hover .swp_stumbleupon{background:#ef5025;border:1px solid #d34427}.swp_social_panel.swp_default_full_color .swp_yummly,html body .swp_social_panel.swp_individual_full_color .swp_yummly:hover,body .swp_social_panel.swp_other_full_color:hover .swp_yummly{background:#e26426;border:1px solid #b65027}.swp_social_panel.swp_default_full_color .swp_reddit,html body .swp_social_panel.swp_individual_full_color .swp_reddit:hover,body .swp_social_panel.swp_other_full_color:hover .swp_reddit{background:#f04b23;border:1px solid #d33f27}.swp_social_panel.swp_default_full_color .swp_email,html body .swp_social_panel.swp_individual_full_color .swp_email:hover,body .swp_social_panel.swp_other_full_color:hover .swp_email{background:#6bcce9;border:1px solid #61bace}.swp_social_panel.swp_default_full_color .swp_whatsapp,html body .swp_social_panel.swp_individual_full_color .swp_whatsapp:hover,body .swp_social_panel.swp_other_full_color:hover .swp_whatsapp{background:#71c169;border:1px solid #28b04b}.swp_social_panel.swp_default_full_color .swp_pocket,html body .swp_social_panel.swp_individual_full_color .swp_pocket:hover,body .swp_social_panel.swp_other_full_color:hover .swp_pocket{background:#ef4056;border:1px solid #ce3d55}.swp_social_panel.swp_default_full_color .swp_buffer,html body .swp_social_panel.swp_individual_full_color .swp_buffer:hover,body .swp_social_panel.swp_other_full_color:hover .swp_buffer{background:#323b43;border:1px solid #000}.swp_social_panel.swp_default_full_color .swp_hacker_news,html body .swp_social_panel.swp_individual_full_color .swp_hacker_news:hover,body .swp_social_panel.swp_other_full_color:hover .swp_hacker_news{background:#f16522;border:1px solid #d85623}.swp_social_panel.swp_default_full_color .swp_flipboard,html body .swp_social_panel.swp_individual_full_color .swp_flipboard:hover,body .swp_social_panel.swp_other_full_color:hover .swp_flipboard{background:#e02828;border:1px solid #bf2626}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_google_plus,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_google_plus:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_google_plus{border-bottom:3px solid #c44133}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_twitter,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_twitter:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_twitter{border-bottom:3px solid #5595bc}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_facebook,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_facebook:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_facebook{border-bottom:3px solid #2e4675}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_pinterest,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_pinterest:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_pinterest{border-bottom:3px solid #aa1b29}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_linkedin,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_linkedin:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_linkedin{border-bottom:3px solid #0c6591}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_tumblr,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_tumblr:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_tumblr{border-bottom:3px solid #27313f}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_stumbleupon,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_stumbleupon:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_stumbleupon{border-bottom:3px solid #d34427}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_yummly,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_yummly:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_yummly{border-bottom:3px solid #b65027}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_reddit,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_reddit:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_reddit{border-bottom:3px solid #d33f27}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_email,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_email:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_email{border-bottom:3px solid #61bace}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_whatsapp,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_whatsapp:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_whatsapp{border-bottom:3px solid #28b04b}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_pocket,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_pocket:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_pocket{border-bottom:3px solid #ce3d55}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_buffer,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_buffer:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_buffer{border-bottom:3px solid #000}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_hacker_news,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_hacker_news:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_hacker_news{border-bottom:3px solid #d85623}.swp_social_panel.swp_three_dee.swp_default_full_color .swp_flipboard,html body .swp_social_panel.swp_three_dee.swp_individual_full_color .swp_flipboard:hover,body .swp_social_panel.swp_three_dee.swp_other_full_color:hover .swp_flipboard{border-bottom:3px solid #bf2626}.swp_social_panel.swp_default_light_gray .nc_tweetContainer,html body .swp_social_panel.swp_individual_light_gray .nc_tweetContainer:hover,body .swp_social_panel.swp_other_light_gray:hover .nc_tweetContainer{background-color:#ccc;border:1px solid #ccc}.swp_social_panel.swp_three_dee.swp_default_light_gray .nc_tweetContainer:not(.total_sharesalt),html body .swp_social_panel.swp_three_dee.swp_individual_light_gray .nc_tweetContainer:not(.total_sharesalt):hover,body .swp_social_panel.swp_three_dee.swp_other_light_gray:hover .nc_tweetContainer:not(.total_sharesalt){border-bottom:3px solid #999}.swp_social_panel.swp_default_medium_gray .nc_tweetContainer,html body .swp_social_panel.swp_individual_medium_gray .nc_tweetContainer:hover,body .swp_social_panel.swp_other_medium_gray:hover .nc_tweetContainer{background-color:#999;border:1px solid #999}.swp_social_panel.swp_three_dee.swp_default_medium_gray .nc_tweetContainer:not(.total_sharesalt),html body .swp_social_panel.swp_three_dee.swp_individual_medium_gray .nc_tweetContainer:not(.total_sharesalt):hover,body .swp_social_panel.swp_three_dee.swp_other_medium_gray:hover .nc_tweetContainer:not(.total_sharesalt){border-bottom:3px solid #444}.swp_social_panel.swp_default_dark_gray .nc_tweetContainer,html body .swp_social_panel.swp_individual_dark_gray .nc_tweetContainer:hover,body .swp_social_panel.swp_other_dark_gray:hover .nc_tweetContainer{background-color:#444;border:1px solid #444}.swp_social_panel.swp_three_dee.swp_default_dark_gray .nc_tweetContainer:not(.total_sharesalt),html body .swp_social_panel.swp_three_dee.swp_individual_dark_gray .nc_tweetContainer:not(.total_sharesalt):hover,body .swp_social_panel.swp_three_dee.swp_other_dark_gray:hover .nc_tweetContainer:not(.total_sharesalt){border-bottom:3px solid #222}.swp_social_panel.swp_default_light_gray_outlines a,html body .swp_social_panel.swp_individual_light_gray_outlines a:hover,body .swp_social_panel.swp_other_light_gray_outlines:hover a{color:#ccc}.swp_social_panel.swp_default_light_gray_outlines .nc_tweetContainer,html body .swp_social_panel.swp_individual_light_gray_outlines .nc_tweetContainer:hover,body .swp_social_panel.swp_other_light_gray_outlines:hover .nc_tweetContainer{background:transparent;border:1px solid #ccc}.swp_social_panel.swp_default_medium_gray_outlines a,html body .swp_social_panel.swp_individual_medium_gray_outlines a:hover,body .swp_social_panel.swp_other_medium_gray_outlines:hover a{color:#999}.swp_social_panel.swp_default_medium_gray_outlines .nc_tweetContainer,html body .swp_social_panel.swp_individual_medium_gray_outlines .nc_tweetContainer:hover,body .swp_social_panel.swp_other_medium_gray_outlines:hover .nc_tweetContainer{background:transparent;border:1px solid #999}.swp_social_panel.swp_default_dark_gray_outlines a,html body .swp_social_panel.swp_individual_dark_gray_outlines a:hover,body .swp_social_panel.swp_other_dark_gray_outlines:hover a{color:#444}.swp_social_panel.swp_default_dark_gray_outlines .nc_tweetContainer,html body .swp_social_panel.swp_individual_dark_gray_outlines .nc_tweetContainer:hover,body .swp_social_panel.swp_other_dark_gray_outlines:hover .nc_tweetContainer{background:transparent;border:1px solid #444}.swp_social_panel.swp_default_color_outlines .swp_google_plus a,html body .swp_social_panel.swp_individual_color_outlines .swp_google_plus a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_google_plus a{color:#df4b37}.swp_social_panel.swp_default_color_outlines .swp_facebook a,html body .swp_social_panel.swp_individual_color_outlines .swp_facebook a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_facebook a{color:#3a589e}.swp_social_panel.swp_default_color_outlines .swp_pinterest a,html body .swp_social_panel.swp_individual_color_outlines .swp_pinterest a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_pinterest a{color:#cd2029}.swp_social_panel.swp_default_color_outlines .swp_linkedin a,html body .swp_social_panel.swp_individual_color_outlines .swp_linkedin a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_linkedin a{color:#0d77b7}.swp_social_panel.swp_default_color_outlines .swp_tumblr a,html body .swp_social_panel.swp_individual_color_outlines .swp_tumblr a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_tumblr a{color:#39475d}.swp_social_panel.swp_default_color_outlines .swp_stumbleupon a,html body .swp_social_panel.swp_individual_color_outlines .swp_stumbleupon a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_stumbleupon a{color:#ef5025}.swp_social_panel.swp_default_color_outlines .swp_yummly a,html body .swp_social_panel.swp_individual_color_outlines .swp_yummly a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_yummly a{color:#e26426}.swp_social_panel.swp_default_color_outlines .swp_whatsapp a,html body .swp_social_panel.swp_individual_color_outlines .swp_whatsapp a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_whatsapp a{color:#71c169}.swp_social_panel.swp_default_color_outlines .swp_pocket a,html body .swp_social_panel.swp_individual_color_outlines .swp_pocket a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_pocket a{color:#ef4056}.swp_social_panel.swp_default_color_outlines .swp_reddit a,html body .swp_social_panel.swp_individual_color_outlines .swp_reddit a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_reddit a{color:#f04b23}.swp_social_panel.swp_default_color_outlines .swp_email a,html body .swp_social_panel.swp_individual_color_outlines .swp_email a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_email a{color:#6bcce9}.swp_social_panel.swp_default_color_outlines .swp_buffer a,html body .swp_social_panel.swp_individual_color_outlines .swp_buffer a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_buffer a{color:#323b43}.swp_social_panel.swp_default_color_outlines .swp_hacker_news a,html body .swp_social_panel.swp_individual_color_outlines .swp_hacker_news a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_hacker_news a{color:#f16522}.swp_social_panel.swp_default_color_outlines .swp_flipboard a,html body .swp_social_panel.swp_individual_color_outlines .swp_flipboard a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_flipboard a{color:#e02828}.swp_social_panel.swp_default_color_outlines .swp_google_plus,html body .swp_social_panel.swp_individual_color_outlines .swp_google_plus:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_google_plus{background:transparent;border:1px solid #df4b37}.swp_social_panel.swp_default_color_outlines .swp_twitter,html body .swp_social_panel.swp_individual_color_outlines .swp_twitter:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_twitter{background:transparent;border:1px solid #429cd6}.swp_social_panel.swp_default_color_outlines .swp_facebook,html body .swp_social_panel.swp_individual_color_outlines .swp_facebook:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_facebook{background:transparent;border:1px solid #3a589e}.swp_social_panel.swp_default_color_outlines .swp_pinterest,html body .swp_social_panel.swp_individual_color_outlines .swp_pinterest:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_pinterest{background:transparent;border:1px solid #cd2029}.swp_social_panel.swp_default_color_outlines .swp_linkedin,html body .swp_social_panel.swp_individual_color_outlines .swp_linkedin:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_linkedin{background:transparent;border:1px solid #0d77b7}.swp_social_panel.swp_default_color_outlines .swp_tumblr,html body .swp_social_panel.swp_individual_color_outlines .swp_tumblr:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_tumblr{background:transparent;border:1px solid #39475d}.swp_social_panel.swp_default_color_outlines .swp_stumbleupon,html body .swp_social_panel.swp_individual_color_outlines .swp_stumbleupon:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_stumbleupon{background:transparent;border:1px solid #ef5025}.swp_social_panel.swp_default_color_outlines .swp_yummly,html body .swp_social_panel.swp_individual_color_outlines .swp_yummly:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_yummly{background:transparent;border:1px solid #e26426}.swp_social_panel.swp_default_color_outlines .swp_whatsapp,html body .swp_social_panel.swp_individual_color_outlines .swp_whatsapp:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_whatsapp{background:transparent;border:1px solid #71c169}.swp_social_panel.swp_default_color_outlines .swp_reddit,html body .swp_social_panel.swp_individual_color_outlines .swp_reddit:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_reddit{background:transparent;border:1px solid #f04b23}.swp_social_panel.swp_default_color_outlines .swp_email,html body .swp_social_panel.swp_individual_color_outlines .swp_email:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_email{background:transparent;border:1px solid #6bcce9}.swp_social_panel.swp_default_color_outlines .swp_pocket,html body .swp_social_panel.swp_individual_color_outlines .swp_pocket:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_pocket{background:transparent;border:1px solid #ef4056}.swp_social_panel.swp_default_color_outlines .swp_buffer,html body .swp_social_panel.swp_individual_color_outlines .swp_buffer:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_buffer{background:transparent;border:1px solid #323b43}.swp_social_panel.swp_default_color_outlines .swp_hacker_news,html body .swp_social_panel.swp_individual_color_outlines .swp_hacker_news:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_hacker_news{background:transparent;border:1px solid #f16522}.swp_social_panel.swp_default_color_outlines .swp_flipboard,html body .swp_social_panel.swp_individual_color_outlines .swp_flipboard:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_flipboard{background:transparent;border:1px solid #bf2626}.swp_social_panelSide{flex-direction:column;height:auto;overflow:visible;-webkit-transition:all 0.2s linear;transition:all 0.2s linear;z-index:9998;margin:10px 5px!important;padding:0;-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column}.swp_social_panelSide.slide,.swp_social_panelSide.fade{position:fixed;-webkit-transition:all 0.2s linear;transition:all 0.2s linear}.swp_social_panelSide.fade.swp_float_left{left:5px}.swp_social_panelSide.fade.swp_float_right{right:5px}.swp_social_panelSide[class*=swp_side]{height:auto;display:flex;position:fixed;padding:30px 0}.swp_social_panelSide.fade{display:none}.swp_social_panelSide.swp_float_right{align-content:flex-end}.swp_social_panelSide.swp_side_top{top:15px}.swp_social_panelSide.swp_side_bottom{bottom:15px}.swp_social_panelSide.swp_side_center{}.swp_social_panelSide .nc_tweetContainer{-webkit-border-radius:3px;border-radius:3px;clear:both;display:block;font-family:Lato,sans-serif;height:32px;margin:3px 0!important;overflow:hidden;padding:0;-webkit-transition:all 0.1s linear;transition:all 0.1s linear;vertical-align:top;width:90px}.swp_social_panelSide .nc_tweetContainer .iconFiller{display:inline-block;height:40px;margin:0 6px;padding:0;-webkit-transition:all 0.1s linear;transition:all 0.1s linear;vertical-align:middle;width:21px}.swp_social_panelSide .nc_tweetContainer .swp_count{display:inline-block;font-size:14px;height:32px;line-height:16px;margin:0;overflow:hidden;padding:0;text-align:right;-webkit-transition:all 0.1s linear;transition:all 0.1s linear;vertical-align:top;width:0}.swp_social_panelSide .nc_tweetContainer a{cursor:pointer;display:block;font-weight:500;height:36px;margin:0;padding:0;text-decoration:none;-webkit-transition:all 0.1s linear;transition:all 0.1s linear;vertical-align:top}.swp_social_panelSide .nc_tweetContainer .sw,.swp_social_panelSide .nc_tweetContainer .swp_share{float:left;line-height:34px}.swp_social_panelSide.swp_default .nc_tweetContainer .sw{line-height:32px}.swp_social_panelSide.swp_default .nc_tweetContainer .swp_share{line-height:30px}.swp_social_panelSide .nc_tweetContainer .swp_share{font-size:13px}.swp_social_panelSide .nc_tweetContainer:hover,.swp_social_panelSide .nc_tweetContainer:hover .iconFiller,.swp_social_panelSide .nc_tweetContainer:hover .swp_count{-webkit-transition:all 0.1s linear;transition:all 0.1s linear}.swp_social_panelSide.swp_boxed .nc_tweetContainer,.swp_social_panelSide.swp_circles .nc_tweetContainer{margin-bottom:5px;width:67.5px!important}.swp_social_panelSide.swp_boxed .nc_tweetContainer,.swp_social_panelSide.swp_boxed .nc_tweetContainer a,.swp_social_panelSide.swp_circles .nc_tweetContainer,.swp_social_panelSide.swp_circles .nc_tweetContainer a{width:67.5px;height:67.5px!important;position:relative}.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares),.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) a{border-radius:50%!important}.swp_social_panelSide.swp_boxed .nc_tweetContainer i.sw,.swp_social_panelSide.swp_circles .nc_tweetContainer i.sw{font-size:27px;height:40px;margin:0;padding-top:10px;text-align:center;width:100%}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) span.swp_share,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) span.swp_share{height:35px;opacity:0;position:absolute;bottom:0;left:0;text-align:center;width:67.5px}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) span.swp_count,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) span.swp_count{height:35px;margin:0;padding:0;position:absolute;bottom:0;left:0;text-align:center;-webkit-transition:padding 0.1s linear;transition:padding 0.1s linear;width:100%}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) span.swp_count.swp_hide,.swp_social_panelSide.swp_boxed .nc_tweetContainer span.swp_hide .iconFiller,.swp_social_panelSide.swp_boxed .nc_tweetContainer span.swp_hide .spaceManWilly,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) span.swp_count.swp_hide,.swp_social_panelSide.swp_circles .nc_tweetContainer span.swp_hide .iconFiller,.swp_social_panelSide.swp_circles .nc_tweetContainer span.swp_hide .spaceManWilly{height:67.5px;opacity:1}.swp_social_panelSide.swp_boxed .nc_tweetContainer span.iconFiller,.swp_social_panelSide.swp_circles .nc_tweetContainer span.iconFiller{height:40px;width:67.5px}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares):hover span.swp_count:not(.swp_hide),.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares):hover span.swp_count:not(.swp_hide){opacity:0}.swp_social_panelSide.swp_boxed .total_shares,.swp_social_panelSide.swp_circles .total_shares{padding:0;width:67.5px!important}.swp_social_panelSide .nc_tweetContainer:not(.total_shares){line-height:34px}.swp_social_panelSide:not(.swp_boxed):not(.swp_circles) .nc_tweetContainer:not(.total_shares) .iconFiller{margin-left:2px;width:30px}.swp_social_panelSide .nc_tweetContainer:not(.total_shares) .swp_count{padding:0 8px;width:48px}.swp_social_panelSide .nc_tweetContainer:not(.total_shares) .swp_count.swp_hide{padding:0;width:100%}.swp_social_panelSide .nc_tweetContainer:not(.total_shares) .swp_count.swp_hide .iconFiller{display:block;float:none;margin:0 auto}.swp_social_panelSide:not(.swp_boxed):not(.swp_circles) .nc_tweetContainer:not(.total_shares):hover{width:150px}.swp_social_panelSide .nc_tweetContainer[data-network]:not(.total_shares):hover .iconFiller,.swp_social_panelSide .nc_tweetContainer:not(.total_shares) .spaceManWilly{width:90px}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares):hover .iconFiller,.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) .spaceManWilly,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares):hover .iconFiller,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) .spaceManWilly{width:100%}.swp_social_panelSide .nc_tweetContainer.total_shares{background:rgba(0,0,0,0);border:0!important;font-weight:800;height:55px;margin:0;padding:0;text-align:center;width:90px;order:-100}.swp_social_panelSide .nc_tweetContainer.total_shares .swp_count{color:#444;display:block;font-family:Lato,sans-serif;height:28px;text-align:center;width:100%}.swp_social_panelSide .nc_tweetContainer.total_shares .swp_label{color:#444;display:block;font-family:Lato,sans-serif;font-size:50%;position:relative;text-align:center;width:100%}.nc_wrapper{background:white;position:fixed;-webkit-transition:top 0.5s bottom 0.5s;transition:top 0.5s bottom 0.5s;width:100%;z-index:99999}.nc_wrapper.bottom{bottom:0;left:0}.nc_wrapper.top{top:0;left:0}.nc_floater{margin:10px 0;position:relative;left:304px;width:740px}.swp_social_panelSide.hideCounts a{text-align:center}.swp_social_panelSide.hideCounts .iconFiller{float:none;text-align:left}.sw{display:inline-block;font-family:sw-icon-font!important;font-size:inherit;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-weight:normal;text-rendering:auto;text-transform:none!important;-ms-transform:translate(0,0);-webkit-transform:translate(0,0);transform:translate(0,0)}.sw:before{display:block!important}.wp-editor-container .sw:before{font-size:18px;line-height:22px}.wp-editor-container .sw-social-warfare:before{color:#ee464f}.mce-container .sw-social-warfare{color:#ee464f;font-size:20px;margin-right:15px;vertical-align:middle}i.swp_google_plus_icon:before{content:"h"}i.swp_pinterest_icon:before{content:"b"}i.swp_twitter_icon:before{content:"s"}i.swp_facebook_icon:before{content:"j"}i.swp_linkedin_icon:before{content:"f"}i.swp_tumblr_icon:before{content:"r"}i.swp_stumbleupon_icon:before{content:"q"}i.swp_reddit_icon:before{content:"a"}i.swp_email_icon:before{content:"k"}i.swp_yummly_icon:before{content:"x"}i.swp_whatsapp_icon:before{content:"y"}i.swp_pocket_icon:before{content:"B"}i.swp_buffer_icon:before{content:"z"}i.swp_hacker_news_icon:before{content:"D"}i.swp_flipboard_icon:before{content:"C"}.sw-social-warfare:before{content:"p"}.swp_CTT{text-decoration:none!important}.sw-tweet-clear{zoom:1}.sw-tweet-clear:after{clear:both;content:".";display:block;height:0;visibility:hidden}.sw-click-to-tweet{display:block;margin:15px 0;padding:15px 30px;position:relative}.sw-click-to-tweet:after{clear:both;content:".";display:block;height:0;line-height:0;visibility:hidden}.sw-click-to-tweet .sw-ctt-text{margin:0 0 10px;padding:0;position:relative;word-wrap:break-word}a .sw-click-to-tweet .sw-ctt-text{display:block;font-size:24px;font-weight:500;line-height:140%;margin:0;padding:0;position:relative;text-decoration:none;text-transform:none}.sw-click-to-tweet .sw-ctt-btn{display:block;float:right;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:bold;line-height:100%;margin:10px 0 0;padding:3px 5px 3px 3px;position:relative;text-decoration:none;text-transform:uppercase}.sw-click-to-tweet i.swp_twitter_icon{float:right;font-size:21px;margin-left:15px!important;margin-top:2px;text-transform:none}a.swp_CTT.style1 .sw-click-to-tweet{background-color:#fff;border:1px solid #ddd;-webkit-border-radius:4px;border-radius:4px}a.swp_CTT.style2 .sw-click-to-tweet{background-color:#fff;border:4px double #ddd;-webkit-border-radius:0;border-radius:0}a.style2 .sw-click-to-tweet .sw-ctt-text{color:#666;font-style:italic;text-decoration:none}a.swp_CTT.style3:hover .sw-click-to-tweet{border-left:10px solid #3c87b2;padding-right:20px;-webkit-transition:all 0.25s linear;transition:all 0.25s linear}a.swp_CTT.style3 .sw-click-to-tweet{background-color:#429cd6;border:none;border-left:10px solid #429cd6;-webkit-border-radius:0;border-radius:0;padding-right:20px;-webkit-transition:all 0.25s linear;transition:all 0.25s linear}a.style3 .sw-click-to-tweet .sw-ctt-text{color:#fff;font-style:italic;text-decoration:none}a.swp_CTT.style4:hover .sw-click-to-tweet{border-left:10px solid #3c87b2;-webkit-transition:all 0.25s linear;transition:all 0.25s linear}a.swp_CTT.style4 .sw-click-to-tweet{background-color:#333;border-left:10px solid #c33;-webkit-border-radius:0;border-radius:0;-webkit-transition:all 0.25s linear;transition:all 0.25s linear}a.swp_CTT.style5:hover .sw-click-to-tweet{background-color:#d34250;border-left:10px solid #30394f;-webkit-transition:all 0.25s linear;transition:all 0.25s linear}a.swp_CTT.style5 .sw-click-to-tweet{background-color:#30394f;border-left:10px solid #d34250;-webkit-border-radius:0;border-radius:0;-webkit-transition:all 0.25s linear;transition:all 0.25s linear}a.swp_CTT.style6:hover .sw-click-to-tweet{background-color:#ced3dc;border-left:10px solid #d34250;-webkit-transition:all 0.25s linear;transition:all 0.25s linear}a.swp_CTT.style6 .sw-click-to-tweet{background-color:#eee;border-left:10px solid #d34250;-webkit-border-radius:0;border-radius:0;-webkit-transition:all 0.25s linear;transition:all 0.25s linear}a.style6 .sw-click-to-tweet i.swp_twitter{color:#30394f}.swp_pop_thumb{-webkit-border-radius:3px;border-radius:3px;float:left;height:100px;margin:5px 25px 5px 0;width:100px}.swp_popular_post{clear:both}.swp_clearfix:after{clear:both;content:" ";display:block;height:0;visibility:hidden}.swp_popular_post a.swp_popularity{border:none;display:block;line-height:1.5;margin:20px 0}span.swp_pop_count{display:block;font-size:70%}.swp_widget_box{-webkit-border-radius:3px;border-radius:3px}div.sw-pinit{display:table!important;line-height:0;position:relative!important}div.sw-pinit a.sw-pinit-button,div.sw-pinit a.sw-pinit-button:visited{background:#cd2029;border:1px solid #aa1b29;border:0;border-bottom:none;-webkit-border-radius:4px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:#fff;font-family:Lato,sans-serif;font-size:20px;font-size:15px;height:32px;line-height:32px;opacity:0;padding:0 20px;position:absolute;text-decoration:none;text-decoration:none;-webkit-transition:opacity 0.5s;transition:opacity 0.5s;z-index:200}div.sw-pinit:hover a.sw-pinit-button,div.sw-pinit:focus a.sw-pinit-button{opacity:1}div.sw-pinit a.sw-pinit-button::before{color:#fff;content:"b";float:left;font-family:sw-icon-font;font-size:20px;font-weight:400;line-height:36px;margin-left:-5px;margin-right:10px}div.sw-pinit a.sw-pinit-button:hover::before{content:"F"}div.sw-pinit a.sw-pinit-button:hover,div.sw-pinit a.sw-pinit-button:focus{background:#aa1b29;color:#fff;text-decoration:none}div.sw-pinit .sw-pinit-left{left:30px}div.sw-pinit .sw-pinit-center{margin-left:-60px;left:50%}div.sw-pinit .sw-pinit-right{right:30px}div.sw-pinit .sw-pinit-top{top:30px}div.sw-pinit .sw-pinit-middle{margin-top:-25px;top:50%}div.sw-pinit .sw-pinit-bottom{bottom:30px}.swp_social_panel.notMobile .nc_tweetContainer:nth-last-child(1),.mobile .nc_tweetContainer:nth-last-child(2),.nc_tweetContainer.total_shares:nth-last-child(1){margin-right:0}.swp_social_panel.swp_default_full_color a,html body .swp_social_panel.swp_individual_full_color .nc_tweetContainer:hover a,body .swp_social_panel.swp_other_full_color:hover a,.swp_social_panel.swp_default_light_gray a,html body .swp_social_panel.swp_individual_light_gray .nc_tweetContainer:hover a,body .swp_social_panel.swp_other_light_gray:hover a,.swp_social_panel.swp_default_medium_gray a,html body .swp_social_panel.swp_individual_medium_gray a:hover,body .swp_social_panel.swp_other_medium_gray:hover a,.swp_social_panel.swp_default_dark_gray a,html body .swp_social_panel.swp_individual_dark_gray a:hover,body .swp_social_panel.swp_other_dark_gray:hover a{color:white}.swp_social_panel.swp_default_color_outlines .swp_twitter a,html body .swp_social_panel.swp_individual_color_outlines .swp_twitter a:hover,body .swp_social_panel.swp_other_color_outlines:hover .swp_twitter a,.wp-editor-container .swp_twitter:before,a.style1 .sw-click-to-tweet i.swp_twitter,a.style2 .sw-click-to-tweet i.swp_twitter{color:#429cd6}.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares) .swp_hide span.swp_share,.swp_social_panelSide.swp_boxed .nc_tweetContainer:not(.total_shares):hover span.swp_share:not(.swp_hide),.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares) .swp_hide span.swp_share,.swp_social_panelSide.swp_circles .nc_tweetContainer:not(.total_shares):hover span.swp_share:not(.swp_hide){opacity:1}.swp_social_panel.mobile .iconFiller ~ .swp_count,.sw-content-locator{display:none}a.style1 .sw-click-to-tweet .sw-ctt-text,a.style1 .sw-click-to-tweet .sw-ctt-btn{color:#999;text-decoration:none}a.style1:hover .sw-click-to-tweet .sw-ctt-text,a.style1:hover .sw-click-to-tweet .sw-ctt-btn,a.style2:hover .sw-click-to-tweet .sw-ctt-text,a.style2 .sw-click-to-tweet .sw-ctt-btn,a.style2:hover .sw-click-to-tweet .sw-ctt-btn{color:#666;text-decoration:none}a.style3:hover .sw-click-to-tweet .sw-ctt-text,a.style3 .sw-click-to-tweet .sw-ctt-btn,a.style3:hover .sw-click-to-tweet .sw-ctt-btn,a.style3 .sw-click-to-tweet i.swp_twitter,a.style4 .sw-click-to-tweet .sw-ctt-text,a.style4:hover .sw-click-to-tweet .sw-ctt-text,a.style4 .sw-click-to-tweet .sw-ctt-btn,a.style4:hover .sw-click-to-tweet .sw-ctt-btn,a.style5 .sw-click-to-tweet .sw-ctt-text,a.style5:hover .sw-click-to-tweet .sw-ctt-text,a.style5 .sw-click-to-tweet .sw-ctt-btn,a.style5:hover .sw-click-to-tweet .sw-ctt-btn{color:#fff;text-decoration:none}a.style4 .sw-click-to-tweet i.swp_twitter,a.style5 .sw-click-to-tweet i.swp_twitter{color:#fff}a.style6 .sw-click-to-tweet .sw-ctt-text,a.style6 .sw-click-to-tweet .sw-ctt-btn{color:#30394f;text-decoration:none}a.style6:hover .sw-click-to-tweet .sw-ctt-text,a.style6:hover .sw-click-to-tweet .sw-ctt-btn,a.style6:hover .sw-click-to-tweet i.swp_twitter{color:#2a2d34;text-decoration:none}.scale-70{-ms-transform:scale(0.7);-webkit-transform:scale(0.7);transform:scale(0.7)}.swp_social_panel:not(.nc_floater).scale-70.scale-full_width{width:142.8571428571429%!important}.scale-80{-ms-transform:scale(0.8);-webkit-transform:scale(0.8);transform:scale(0.8)}.swp_social_panel:not(.nc_floater).scale-80.scale-full_width{width:125%!important}.scale-90{-ms-transform:scale(0.9);-webkit-transform:scale(0.9);transform:scale(0.9)}.swp_social_panel:not(.nc_floater).scale-90.scale-full_width{width:111.111111111111%!important}.scale-110{-ms-transform:scale(1.1);-webkit-transform:scale(1.1);transform:scale(1.1)}.swp_social_panel:not(.nc_floater).scale-110.scale-full_width{width:90.90909090909091%!important}.scale-120{-ms-transform:scale(1.2);-webkit-transform:scale(1.2);transform:scale(1.2)}.swp_social_panel:not(.nc_floater).scale-120.scale-full_width{width:83.33333333333333%!important}.scale-130{-ms-transform:scale(1.3);-webkit-transform:scale(1.3);transform:scale(1.3)}.swp_social_panel:not(.nc_floater).scale-130.scale-full_width{width:76.92307692307692%!important}.scale-140{-ms-transform:scale(1.4);-webkit-transform:scale(1.4);transform:scale(1.4)}.swp_social_panel:not(.nc_floater).scale-140.scale-full_width{width:71.42857142857143%!important}.scale-full_width,.scale-left,.nc_floater.scale-center,.nc_floater.scale-right{-ms-transform-origin:left;-webkit-transform-origin:left;transform-origin:left}.scale-right{-ms-transform-origin:right;-webkit-transform-origin:right;transform-origin:right}.scale-center{-ms-transform-origin:center;-webkit-transform-origin:center;transform-origin:center}div.swp_social_panel .nc_tweetContainer.swp_emphasize{-webkit-box-flex:2;-moz-box-flex:2;-webkit-flex:2;-ms-flex:2;flex:2}.sw-pinit.aligncenter{margin:0 auto}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){div.sw-pinit{display:inline-block!important;max-width:100%}}.swp_hidden_pin_image{height:0;opacity:0;position:absolute;top:0;width:0;z-index:-10}.fl-module-content .uabb-blog-posts .uabb-post-thumbnail .sw-pinit.lazyloaded{display:block!important}.swp-content-locator{display:none!important;margin:0!important}.float-position-top-left{transform-origin:top left}.float-position-center-left{transform-origin:center left}.float-position-bottom-left{transform-origin:bottom left}.float-position-top-right{transform-origin:top right}.float-position-center-right{transform-origin:center right}.float-position-bottom-right{transform-origin:bottom right}div[class*=custom_color][class^=_wrapper]{display:none}
 
fonts/sw-icon-font.eot DELETED
Binary file
fonts/sw-icon-font.ttf DELETED
Binary file
fonts/sw-icon-font.woff DELETED
Binary file
functions/admin/options-fetch.php DELETED
@@ -1,156 +0,0 @@
1
- <?php
2
- /**
3
- * Functions for getting and setting the plugin's options.
4
- *
5
- * @package SocialWarfare\Functions
6
- * @copyright Copyright (c) 2018, Warfare Plugins, LLC
7
- * @license GPL-3.0+
8
- * @since 1.0.0
9
- */
10
-
11
- defined( 'WPINC' ) || die;
12
-
13
- // Set the global options variable
14
- global $swp_user_options;
15
-
16
- /**
17
- * $swp_user_options Fetch the available options that the user has set
18
- * @var array An array of available options from the options page
19
- */
20
- $swp_user_options = swp_get_user_options( is_admin() );
21
-
22
- /**
23
- * A function to adjust the options and ensure that defaults are set
24
- *
25
- * @param boolean $admin A boolean value to determine if it's being called in the admin or elsewhere
26
- * @return array $options The modified options array
27
- */
28
- function swp_get_user_options( $admin = false ) {
29
- $options = get_option( 'social_warfare_settings', array() );
30
- return $options;
31
-
32
-
33
- if(isset($options['activate_tweet_counts']) && true == $options['activate_tweet_counts'] && !isset($options['tweet_count_source']) ) {
34
- $options['tweet_count_source'] = 'newsharecounts';
35
- }
36
-
37
- /**
38
- * Set the default og:type values for each post type
39
- *
40
- */
41
- $swp_post_types = swp_get_post_types();
42
-
43
- // Make the side custom absorb the main custom color if they haven't set one yet.
44
- if(empty($options['single_custom_color']) ):
45
- $options['single_custom_color'] = $options['custom_color'];
46
- endif;
47
-
48
- // Force the plugin off on certain post types.
49
- $options['locationattachment'] = 'none';
50
- $options['locationrevision'] = 'none';
51
- $options['nav_menu_item'] = 'none';
52
- $options['shop_order'] = 'none';
53
- $options['shop_order_refund'] = 'none';
54
- $options['shop_coupon'] = 'none';
55
- $options['shop_webhook'] = 'none';
56
-
57
- if( function_exists('is_swp_registered') ):
58
- $swp_registration = is_swp_addon_registered('pro');
59
- else:
60
- $swp_registration = false;
61
- endif;
62
-
63
- if ( $admin || true === $swp_registration ) :
64
- if ( 'total_shares' === $options['totals_alignment'] ) :
65
- $options['totals_alignment'] = 'totals_right';
66
- endif;
67
- else:
68
- $options['twitter_cards'] = false;
69
- $options['button_shape'] = 'flat_fresh';
70
- $options['default_colors'] = 'full_color';
71
- $options['single_colors'] = 'full_color';
72
- $options['hover_colors'] = 'full_color';
73
- $options['float_default_colors'] = 'full_color';
74
- $options['float_single_colors'] = 'full_color';
75
- $options['float_hover_colors'] = 'full_color';
76
- $options['float_style_source'] = true;
77
- $options['button_size'] = 1;
78
- $options['button_alignment'] = 'full_width';
79
- $options['ctt_theme'] = 'style1';
80
- $options['ctt_css'] = "";
81
- $options['twitter_shares'] = false;
82
- $options['recover_shares'] = false;
83
- $options['google_analtyics'] = false;
84
- $options['bitly_authentication'] = false;
85
- $options['minimum_shares'] = 0;
86
- $options['swp_click_tracking'] = false;
87
- $options['order_of_icons'] = 'manual';
88
- $options['pinit_toggle'] = false;
89
- $options['pinit_location_horizontal'] = 'center';
90
- $options['pinit_location_vertical'] = 'top';
91
- $options['emphasize_icons'] = 0;
92
- $options['float_mobile'] = 'off';
93
- $options['pin_browser_extension'] = false;
94
- $options['pinterest_image_location'] = 'hidden';
95
- $options['pinterest_fallback'] = 'all';
96
- endif;
97
-
98
- if(isset($options['order_of_icons']['active'])) {
99
- unset($options['order_of_icons']['active']);
100
- }
101
-
102
- /**
103
- * Unset any buttons that may have been put into the options but are no longer actually available
104
- *
105
- */
106
- }
107
-
108
- /**
109
- * Fetch a single option
110
- *
111
- * @since unknown
112
- * @param string $key The key to pull from the array of options.
113
- * @return mixed $options The value of the desired option
114
- */
115
- function swp_get_single_option( $key ) {
116
- global $swp_user_options;
117
-
118
- if ( isset( $swp_user_options[ $key ] ) ) {
119
- return $swp_user_options[ $key ];
120
- }
121
-
122
- return false;
123
- }
124
-
125
- /**
126
- * Update the main plugin options.
127
- *
128
- * @since 2.1.0
129
- * @param array $options The option values to be set.
130
- * @return bool True if the option has been updated.
131
- */
132
- function swp_update_options( $options ) {
133
- if ( ! is_array( $options ) ) {
134
- return false;
135
- }
136
-
137
- unset( $options['orderOfIcons'] );
138
-
139
- return update_option( 'social_warfare_settings', $options );
140
- }
141
-
142
- /**
143
- * Update a single option.
144
- *
145
- * @since 2.1.0
146
- * @param string $key The key to set in the array of options.
147
- * @param mixed $value The option value to be set.
148
- * @return bool True if the option has been updated.
149
- */
150
- function swp_update_option( $key, $value ) {
151
- $options = get_option( 'social_warfare_settings', array() );
152
-
153
- $options[ $key ] = $value;
154
-
155
- return swp_update_options( $options );
156
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
functions/admin/options-registration.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- /**
3
- * Functions for loading the admin options page.
4
- *
5
- * @package SocialWarfare\Admin\Functions
6
- * @copyright Copyright (c) 2018, Warfare Plugins, LLC
7
- * @license GPL-3.0+
8
- * @since 1.0.0
9
- */
10
-
11
- $premium_code = '';
12
- $email = '';
13
-
14
- // Fetch the registration keys from pro and all other addons
15
- $array = array();
16
- $registrations = apply_filters('swp_registrations' , $array);
17
-
18
- foreach($registrations as $registration):
19
- if ( ! empty( $swp_user_options[$registration['key'].'_license_key'] ) ) {
20
- $license_key = $swp_user_options[$registration['key'].'_license_key'];
21
- $registered = 1;
22
- } else {
23
- $license_key = '';
24
- $registered = 0;
25
- }
26
- ?>
27
-
28
- <div class="registration-wrapper <?php echo $registration['key'] ?>" registration="<?php echo $registered; ?>">
29
-
30
- <h2><?php esc_html_e( $registration['plugin_name'].' Registration' , 'social-warfare' ); ?></h2>
31
-
32
- <div class="sw-grid sw-col-940 swp_is_not_registered">
33
-
34
- <div class="sw-red-notice">
35
- <?php _e( 'This copy of '.$registration['plugin_name'].' is NOT registered. <a target="_blank" href="https://warfareplugins.com">Click here</a> to purchase a license or add your account info below.' , 'social-warfare' ); ?>
36
- </div>
37
-
38
- <p class="sw-subtitle sw-registration-text">
39
- <?php esc_html_e( 'Enter your registration key for '.$registration['plugin_name'] .' and then click Register Plugin.' , 'social-warfare' ); ?>
40
- </p>
41
-
42
- <div class="sw-grid sw-col-300">
43
- <p class="sw-input-label">
44
- <?php esc_html_e( $registration['plugin_name'].' License Key' , 'social-warfare' ); ?>
45
- </p>
46
- </div>
47
-
48
- <div class="sw-grid sw-col-300">
49
- <input name="<?php echo $registration['key'] ?>_license_key" type="text" class="sw-admin-input" placeholder="License Key" value="<?php echo $license_key; ?>" />
50
- </div>
51
-
52
- <div class="sw-grid sw-col-300 sw-fit register_button_grid">
53
- <a href="#" class="register-plugin button sw-navy-button" swp-addon="<?php echo $registration['key']; ?>" swp-item-id="<?php echo $registration["product_id"]; ?>">
54
- <?php esc_html_e( 'Register Plugin' , 'social-warfare' ); ?>
55
- </a>
56
- </div>
57
-
58
- <div class="sw-clearfix"></div>
59
- </div>
60
-
61
- <div class="sw-grid sw-col-940 swp_is_registered">
62
-
63
- <div class="sw-green-notice">
64
- <?php esc_html_e( 'This copy of '.$registration['plugin_name'].' is registered. Wah-hoo!', 'social-warfare' ); ?>
65
- </div>
66
-
67
- <p class="sw-subtitle sw-registration-text">
68
- <?php esc_html_e( 'To unregister your license click the button below to free it up for use on another domain.' , 'social-warfare' ); ?>
69
- </p>
70
-
71
- <div class="sw-grid sw-col-300">
72
- <p class="sw-authenticate-label">
73
- <?php esc_html_e( 'Deactivate Registration' , 'social-warfare' ); ?>
74
- </p>
75
- </div>
76
-
77
- <div class="sw-grid sw-col-300">
78
- <a href="#" class="unregister-plugin button sw-navy-button" swp-addon="<?php echo $registration['key']; ?>" swp-item-id="<?php echo $registration["product_id"]; ?>">
79
- <?php esc_html_e( 'Unregister Plugin' , 'social-warfare' ); ?>
80
- </a>
81
- </div>
82
- <div class="sw-grid sw-col-300 sw-fit"></div>
83
-
84
- </div>
85
-
86
- </div>
87
- <?php endforeach; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
functions/admin/registration.php DELETED
@@ -1,347 +0,0 @@
1
- <?php
2
- /**
3
- * Functions for getting and setting the plugin's registration status.
4
- *
5
- * @package SocialWarfare\Functions
6
- * @copyright Copyright (c) 2018, Warfare Plugins, LLC
7
- * @license GPL-3.0+
8
- * @since 1.0.0
9
- */
10
-
11
- /**
12
- * A function to be used to make cURL requests
13
- * @param string $url The URL to be fetched
14
- * @return string The response from the server
15
- *
16
- */
17
- function swpp_file_get_contents_curl( $url ) {
18
- $ch = curl_init();
19
- curl_setopt( $ch, CURLOPT_URL, $url );
20
- curl_setopt( $ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );
21
- curl_setopt( $ch, CURLOPT_FAILONERROR, 0 );
22
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0 );
23
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER,1 );
24
- curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
25
- curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
26
- curl_setopt( $ch, CURLOPT_TIMEOUT, 5 );
27
- curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
28
- curl_setopt( $ch, CURLOPT_NOSIGNAL, 1 );
29
- curl_setopt( $ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
30
- $cont = @curl_exec( $ch );
31
- $curl_errno = curl_errno( $ch );
32
- curl_close( $ch );
33
- if ( $curl_errno > 0 ) {
34
- return false;
35
- }
36
- return $cont;
37
- }
38
-
39
- /**
40
- * Check to see if the plugin has been registered once per page load.
41
- *
42
- * @since 2.1.0
43
- * @param string $domain The current site's domain.
44
- * @param string $context The context where the key will be used.
45
- * @return string A registration key based on the site's domain.
46
- */
47
- function swp_get_registration_key( $domain, $context = 'api' ) {
48
- $key = md5( $domain );
49
-
50
- if ( 'db' === $context ) {
51
- $key = md5( $key );
52
- }
53
-
54
- return $key;
55
- }
56
-
57
- /**
58
- * Check to see if an addon has been registered once per page load.
59
- * Once per week, we'll ping our server to ask if the license key is still valid.
60
- *
61
- * @since 2.3.3 - Created the function to work for all addons, not just the pro addon
62
- * @since 3.0.6 | 14 MAY 2018 | Added check for array key to prevent undefined index notice.
63
- * @param string The unique key for the addon
64
- * @return bool True if the plugin is registered, false otherwise.
65
- */
66
- function is_swp_addon_registered($key) {
67
-
68
- // Get the plugin options from the database
69
- $options = get_option( 'social_warfare_settings' );
70
- $is_registered = false;
71
-
72
- // Get the timestamps setup for comparison to see if a week has passed since our last check
73
- $current_time = time();
74
- if(!isset($options[$key.'_license_key_timestamp'])):
75
- $timestamp = 0;
76
- else:
77
- $timestamp = $options[$key.'_license_key_timestamp'];
78
- endif;
79
- $time_to_recheck = $timestamp + 604800;
80
-
81
- // If they have a key and a week hasn't passed since the last check, just return true...the plugin is registered.
82
- if( !empty($options[$key.'_license_key']) && $current_time < $time_to_recheck ) {
83
-
84
- $is_registered = true;
85
-
86
- // If a week has indeed passed since the last check, ping our API to check the validity of the license key
87
- } elseif( !empty($options[$key.'_license_key']) ){
88
-
89
- // Setup the API parameters
90
- $license = $options[$key.'_license_key'];
91
- $site_url = swp_get_site_url();
92
- $store_url = 'https://warfareplugins.com';
93
- $registration_array = array();
94
- $registration_array = apply_filters( 'swp_registrations' , $registration_array );
95
-
96
- if ( !array_key_exists( $key, $registration_array ) ) :
97
- return $is_registered;
98
- endif;
99
-
100
- $item_id = $registration_array[$key]['product_id'];
101
-
102
-
103
- $api_params = array(
104
- 'edd_action' => 'check_license',
105
- 'item_id' => $item_id,
106
- 'license' => $license,
107
- 'url' => $site_url,
108
- );
109
-
110
- $response = wp_remote_retrieve_body( wp_remote_post( $store_url , array('body' => $api_params, 'timeout' => 10 ) ) );
111
-
112
- if( false != $response ) {
113
-
114
- // Parse the response into an object
115
- $license_data = json_decode( $response );
116
-
117
- // If the license was invalid
118
- if( isset($license_data->license) && 'invalid' == $license_data->license) {
119
- $is_registered = false;
120
- $options[$key.'_license_key'] = '';
121
- $options[$key.'_license_key_timestamp'] = $current_time;
122
- update_option( 'social_warfare_settings' , $options );
123
-
124
- // If the property is some other status, just go with it.
125
- } else {
126
- $options[$key.'_license_key_timestamp'] = $current_time;
127
- update_option( 'social_warfare_settings' , $options );
128
- $is_registered = true;
129
- }
130
-
131
- // If we recieved no response from the server, we'll just check again next week
132
- } else {
133
- $options[$key.'_license_key_timestamp'] = $current_time;
134
- update_option( 'social_warfare_settings' , $options );
135
- $is_registered = true;
136
- }
137
- }
138
-
139
- // Return the registration value true/false
140
- return $is_registered;
141
- }
142
-
143
- /**
144
- * Check to see if the plugin has been registered once per page load.
145
- * Once per week, we'll ping our server to ask if the license key is still valid.
146
- *
147
- * @since unknown
148
- * @since 2.3.3 Forward the request to the is_swp_addon_registered() function.
149
- * @return bool True if the plugin is registered, false otherwise.
150
- */
151
- function is_swp_registered($timeline = false) {
152
-
153
- return is_swp_addon_registered('pro');
154
-
155
- }
156
-
157
- /**
158
- * Attempt to register the plugin.
159
- *
160
- * @since 2.1.0
161
- * @since 2.3.0 Hooked registration into the new EDD Software Licensing API
162
- * @param none
163
- * @return JSON Encoded Array (Echoed) - The Response from the EDD API
164
- *
165
- */
166
- add_action( 'wp_ajax_swp_register_plugin', 'swp_register_plugin' );
167
- function swp_register_plugin() {
168
-
169
- // Check to ensure that license key was passed into the function
170
- if(!empty($_POST['license_key'])) {
171
-
172
- // Grab the license key so we can use it below
173
- $name_key = $_POST['name_key'];
174
- $license = $_POST['license_key'];
175
- $item_id = $_POST['item_id'];
176
- $site_url = swp_get_site_url();
177
- $store_url = 'https://warfareplugins.com';
178
-
179
- $api_params = array(
180
- 'edd_action' => 'activate_license',
181
- 'item_id' => $item_id,
182
- 'license' => $license,
183
- 'url' => $site_url
184
- );
185
-
186
- $response = wp_remote_retrieve_body( wp_remote_post( $store_url, array( 'body' => $api_params, 'timeout' => 10 ) ) );
187
-
188
- // $url ='https://warfareplugins.com/?edd_action=activate_license&item_id='.$item_id.'&license='.$license.'&url='.swp_get_site_url();
189
- // $response = swpp_file_get_contents_curl( $url );
190
-
191
- if(false != $response){
192
-
193
- // Parse the response into an object
194
- $license_data = json_decode( $response );
195
-
196
- // If the license is valid store it in the database
197
- if( isset($license_data->license) && 'valid' == $license_data->license ) {
198
-
199
- $current_time = time();
200
- $options = get_option( 'social_warfare_settings' );
201
- $options[$name_key.'_license_key'] = $license;
202
- $options[$name_key.'_license_key_timestamp'] = $current_time;
203
- update_option( 'social_warfare_settings' , $options );
204
-
205
- echo json_encode($license_data);
206
- wp_die();
207
-
208
- // If the license is not valid
209
- } elseif( isset($license_data->license) && 'invalid' == $license_data->license ) {
210
- echo json_encode($license_data);
211
- wp_die();
212
-
213
- // If some other status was returned
214
- } else {
215
- $license_data['success'] = false;
216
- $license_data['data'] = 'Invaid response from the registration server.';
217
- echo json_encode($license_data);
218
- wp_die();
219
- }
220
-
221
- // If we didn't get a response from the registration server
222
- } else {
223
- $license_data['success'] = false;
224
- $license_data['data'] = 'Failed to connect to registration server.';
225
- echo json_encode($license_data);
226
- wp_die();
227
- }
228
- } else {
229
- $license_data['success'] = false;
230
- $license_data['data'] = 'Admin Ajax did not receive valid POST data.';
231
- echo json_encode($license_data);
232
- wp_die();
233
- }
234
-
235
- wp_die();
236
-
237
- }
238
-
239
- /**
240
- * Attempt to unregister the plugin.
241
- *
242
- * @since 2.1.0
243
- * @since 2.3.0 Hooked into the EDD Software Licensing API
244
- * @param none
245
- * @return JSON Encoded Array (Echoed) - The Response from the EDD API
246
- */
247
- add_action( 'wp_ajax_swp_unregister_plugin', 'swp_unregister_plugin' );
248
- function swp_unregister_plugin() {
249
-
250
- // Setup the variables needed for processing
251
- $options = get_option( 'social_warfare_settings' );
252
- $name_key = $_POST['name_key'];
253
- $item_id = $_POST['item_id'];
254
- $site_url = swp_get_site_url();
255
- $store_url = 'https://warfareplugins.com';
256
-
257
- // Check to see if the license key is even in the options
258
- if(empty($options[$name_key.'_license_key'])) {
259
- $response['success'] = true;
260
- echo json_encode($response);
261
- } else {
262
-
263
- // Grab the license key so we can use it below
264
- $license = $options[$name_key.'_license_key'];
265
-
266
- // Setup the API request parameters
267
- $api_params = array(
268
- 'edd_action' => 'deactivate_license',
269
- 'item_id' => $item_id,
270
- 'license' => $license,
271
- 'url' => $site_url,
272
- );
273
-
274
- $response = wp_remote_retrieve_body( wp_remote_post( $store_url, array( 'body' => $api_params, 'timeout' => 10 ) ) );
275
-
276
- // Parse the response into an object
277
- $license_data = json_decode( $response );
278
-
279
- // If the deactivation was valid update the database
280
- if( isset($license_data->license) && $license_data->license == 'valid' ) {
281
-
282
- $options = get_option( 'social_warfare_settings' );
283
- $options[$name_key.'_license_key'] = '';
284
- update_option( 'social_warfare_settings' , $options );
285
- echo json_encode($license_data);
286
- wp_die();
287
-
288
- // If the API request didn't work, just deactivate locally anyways
289
- } else {
290
-
291
- $options = get_option( 'social_warfare_settings' );
292
- $options[$name_key.'_license_key'] = '';
293
- update_option( 'social_warfare_settings' , $options );
294
- echo json_encode($license_data);
295
- wp_die();
296
- }
297
- }
298
-
299
- wp_die();
300
- }
301
-
302
- add_action( 'wp_ajax_swp_ajax_passthrough', 'swp_ajax_passthrough' );
303
- /**
304
- * Pass ajax responses to a remote HTTP request.
305
- *
306
- * @since 2.0.0
307
- * @return void
308
- */
309
- function swp_ajax_passthrough() {
310
- if ( ! check_ajax_referer( 'swp_plugin_registration', 'security', false ) ) {
311
- wp_send_json_error( esc_html__( 'Security failed.', 'social-warfare' ) );
312
- die;
313
- }
314
-
315
- $data = wp_unslash( $_POST ); // Input var okay.
316
-
317
- if ( ! isset( $data['activity'], $data['email'] ) ) {
318
- wp_send_json_error( esc_html__( 'Required fields missing.', 'social-warfare' ) );
319
- die;
320
- }
321
-
322
- if ( 'register' === $data['activity'] ) {
323
- $response = swp_register_plugin( $data['email'], swp_get_site_url() );
324
-
325
- if ( ! $response ) {
326
- wp_send_json_error( esc_html__( 'Plugin could not be registered.', 'social-warfare' ) );
327
- die;
328
- }
329
-
330
- $response['message'] = esc_html__( 'Plugin successfully registered!', 'social-warfare' );
331
- }
332
-
333
- if ( 'unregister' === $data['activity'] && isset( $data['key'] ) ) {
334
- $response = swp_unregister_plugin( $data['email'], $data['key'] );
335
-
336
- if ( ! $response ) {
337
- wp_send_json_error( esc_html__( 'Plugin could not be unregistered.', 'social-warfare' ) );
338
- die;
339
- }
340
-
341
- $response['message'] = esc_html__( 'Plugin successfully unregistered!', 'social-warfare' );
342
- }
343
-
344
- wp_send_json_success( $response );
345
-
346
- die;
347
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
functions/includes/SWP_Addon.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
-
3
- class SWP_Addon extends Social_Warfare {
4
- public function __construct() {
5
- parent::__construct();
6
- $this->name = '';
7
- $this->product_id = 0;
8
- $this->key = '';
9
- $this->version = '';
10
- $this->core_required = '3.0.0';
11
- $this->store_url = 'https://warfareplugins.com';
12
- $this->site_url = swp_get_site_url();
13
- add_action( 'wp_ajax_swp_register_plugin', [$this, 'register_plugin'] );
14
- add_action( 'wp_ajax_swp_unregister_plugin', [$this, 'unregister_plugin'] );
15
- add_action( 'wp_ajax_swp_ajax_passthrough', [$this, 'ajax_passthrough'] );
16
- }
17
-
18
-
19
- /**
20
- * The callback function used to add a new instance of this /**
21
- * to our swp_registrations filter.
22
- *
23
- * This should be the last item called in an addon's main file.
24
- *
25
- * @param array $addons The array of addons currently activated.
26
- */
27
- public function add_self( $addons ) {
28
- $this->establish_license_key();
29
- $this->registered = $this->is_registered();
30
-
31
- $addons[] = $this;
32
-
33
- return $addons;
34
- }
35
-
36
- public function register_plugin() {
37
- // Check to ensure that license key was passed into the function
38
- if ( !empty( $_POST['license_key'] ) ) :
39
-
40
- // Grab the license key so we can use it below
41
- $key = $_POST['name_key'];
42
- $license = $_POST['license_key'];
43
- $item_id = $_POST['item_id'];
44
- $this->store_url = 'https://warfareplugins.com';
45
-
46
- $api_params = array(
47
- 'edd_action' => 'activate_license',
48
- 'item_id' => $item_id,
49
- 'license' => $license,
50
- 'url' => $this->site_url
51
- );
52
-
53
- $response = wp_remote_retrieve_body( wp_remote_post( $this->store_url, array( 'body' => $api_params, 'timeout' => 10 ) ) );
54
-
55
- if ( false != $response ) :
56
-
57
- // Parse the response into an object
58
- $license_data = json_decode( $response );
59
-
60
- // If the license is valid store it in the database
61
- if( isset($license_data->license) && 'valid' == $license_data->license ) :
62
-
63
- $current_time = time();
64
- $options = get_option( 'social_warfare_settings' );
65
- $options[$key.'_license_key'] = $license;
66
- $options[$key.'_license_key_timestamp'] = $current_time;
67
- update_option( 'social_warfare_settings' , $options );
68
-
69
- echo json_encode($license_data);
70
- wp_die();
71
-
72
- // If the license is not valid
73
- elseif( isset($license_data->license) && 'invalid' == $license_data->license ) :
74
- echo json_encode($license_data);
75
- wp_die();
76
-
77
- // If some other status was returned
78
- else :
79
- $license_data['success'] = false;
80
- $license_data['data'] = 'Invaid response from the registration server.';
81
- echo json_encode($license_data);
82
- wp_die();
83
- endif;
84
-
85
- // If we didn't get a response from the registration server
86
- else :
87
- $license_data['success'] = false;
88
- $license_data['data'] = 'Failed to connect to registration server.';
89
- echo json_encode($license_data);
90
- wp_die();
91
- endif;
92
- endif;
93
-
94
- $license_data['success'] = false;
95
- $license_data['data'] = 'Admin Ajax did not receive valid POST data.';
96
- echo json_encode($license_data);
97
- wp_die();
98
-
99
- }
100
-
101
- public function establish_license_key() {
102
- $options = get_option( 'social_warfare_settings' );
103
-
104
- if ( isset ( $options[ $this->key . '_license_key'] ) ) :
105
- $this->license_key = $options[ $this->key . '_license_key'];
106
- endif;
107
-
108
- $this->license_key = '';
109
- }
110
-
111
- public function is_registered() {
112
- // Get the plugin options from the database
113
- $options = get_option( 'social_warfare_settings', false );
114
- $old_options = get_option( 'socialWarfareOptions', false );
115
-
116
- if ( isset( $options[$this->key . '_license_key'] ) ) :
117
- $this->license_key = $options[$this->key . '_license_key'];
118
- elseif ( isset( $old_options[$this->key . '_license_key'] ) ) :
119
- $this->license_key = $old_options[$this->key . '_license_key'];
120
- else:
121
- $this->license_key = '';
122
- endif;
123
-
124
-
125
- // Get the timestamps setup for comparison to see if a week has passed since our last check
126
- $current_time = time();
127
-
128
- if ( isset($options[$this->key.'_license_key_timestamp'] ) ) {
129
- $timestamp = $options[$this->key . '_license_key_timestamp'];
130
- }
131
-
132
- $timestamp = isset ( $timestamp ) ? $timestamp : 0;
133
-
134
- $time_to_recheck = $timestamp + 604800;
135
-
136
- // If they have a key and a week hasn't passed since the last check, just return true...the plugin is registered.
137
- if( !empty( $this->license_key) && $current_time < $time_to_recheck ) :
138
- return true;
139
- endif;
140
-
141
- // If a week has passed since the last check, ping our API to check the validity of the license key
142
- if ( !empty( $this->license_key) ) :
143
-
144
- $data = array(
145
- 'edd_action' => 'check_license',
146
- 'item_id' => $this->product_id,
147
- 'license' => $this->license_key,
148
- 'url' => $this->site_url,
149
- );
150
-
151
- $response = wp_remote_retrieve_body( wp_remote_post( $this->store_url , array('body' => $data, 'timeout' => 10 ) ) );
152
-
153
- if( false !== $response ) :
154
-
155
- // Parse the response into an object
156
- $license_data = json_decode( $response );
157
-
158
- $options[$this->key . '_license_key_timestamp'] = $current_time;
159
-
160
- // If the license was invalid
161
- if ( isset( $license_data->license ) && 'invalid' === $license_data->license ) :
162
- $is_registered = false;
163
- $this->license_key = '';
164
-
165
- $options[$this->key . '_license_key'] = '';
166
-
167
- update_option( 'social_warfare_settings' , $options );
168
-
169
- return false;
170
-
171
- // If the property is some other status, just go with it.
172
- else :
173
- $is_registered = true;
174
- update_option( 'social_warfare_settings' , $options );
175
-
176
- return true;
177
-
178
- endif;
179
-
180
- // If we recieved no response from the server, we'll just check again next week
181
- else :
182
- $options[$key.'_license_key_timestamp'] = $current_time;
183
- update_option( 'social_warfare_settings' , $options );
184
-
185
- return true;
186
- endif;
187
- endif;
188
-
189
-
190
- return false;
191
- }
192
-
193
- public function check_for_updates() {
194
- if ( version_compare(SWP_VERSION, $this->core_required) >= 0 ) :
195
-
196
- endif;
197
- }
198
-
199
- public function unregister_plugin() {
200
- // Setup the variables needed for processing
201
- $options = get_option( 'social_warfare_settings' );
202
- $key = $_POST['name_key'];
203
- $item_id = $_POST['item_id'];
204
-
205
- // Check to see if the license key is even in the options
206
- if ( empty( $options[$key.'_license_key'] ) ) :
207
- $response['success'] = true;
208
- echo json_encode($response);
209
- else :
210
- // Grab the license key so we can use it below
211
- $license = $options[$key.'_license_key'];
212
-
213
- // Setup the API request parameters
214
- $api_params = array(
215
- 'edd_action' => 'deactivate_license',
216
- 'item_id' => $item_id,
217
- 'license' => $license,
218
- 'url' => $this->site_url,
219
- );
220
-
221
- $response = wp_remote_retrieve_body( wp_remote_post( $this->store_url, array( 'body' => $api_params, 'timeout' => 10 ) ) );
222
-
223
- $options = get_option( 'social_warfare_settings' );
224
- $options[$key.'_license_key'] = '';
225
- update_option( 'social_warfare_settings' , $options );
226
- echo json_encode($license_data);
227
- endif;
228
-
229
- wp_die();
230
- }
231
-
232
- public function ajax_passthrough() {
233
- if ( ! check_ajax_referer( 'swp_plugin_registration', 'security', false ) ) {
234
- wp_send_json_error( esc_html__( 'Security failed.', 'social-warfare' ) );
235
- die;
236
- }
237
-
238
- $data = wp_unslash( $_POST ); // Input var okay.
239
-
240
- if ( ! isset( $data['activity'], $data['email'] ) ) {
241
- wp_send_json_error( esc_html__( 'Required fields missing.', 'social-warfare' ) );
242
- die;
243
- }
244
-
245
- if ( 'register' === $data['activity'] ) {
246
- $response = swp_register_plugin( $data['email'], swp_get_site_url() );
247
-
248
- if ( ! $response ) {
249
- wp_send_json_error( esc_html__( 'Plugin could not be registered.', 'social-warfare' ) );
250
- die;
251
- }
252
-
253
- $response['message'] = esc_html__( 'Plugin successfully registered!', 'social-warfare' );
254
- }
255
-
256
- if ( 'unregister' === $data['activity'] && isset( $data['key'] ) ) {
257
- $response = swp_unregister_plugin( $data['email'], $data['key'] );
258
-
259
- if ( ! $response ) {
260
- wp_send_json_error( esc_html__( 'Plugin could not be unregistered.', 'social-warfare' ) );
261
- die;
262
- }
263
-
264
- $response['message'] = esc_html__( 'Plugin successfully unregistered!', 'social-warfare' );
265
- }
266
-
267
- wp_send_json_success( $response );
268
-
269
- die;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
functions/includes/registration.php DELETED
@@ -1,59 +0,0 @@
1
- <div class="registration-wrapper <?php echo $registration['key'] ?>" registration="<?php echo $registered; ?>">
2
-
3
- <h2><?php esc_html_e( $registration['plugin_name'].' Registration' , 'social-warfare' ); ?></h2>
4
-
5
- <div class="sw-grid sw-col-940 swp_is_not_registered">
6
-
7
- <div class="sw-red-notice">
8
- <?php _e( 'This copy of '.$registration['plugin_name'].' is NOT registered. <a target="_blank" href="https://warfareplugins.com">Click here</a> to purchase a license or add your account info below.' , 'social-warfare' ); ?>
9
- </div>
10
-
11
- <p class="sw-subtitle sw-registration-text">
12
- <?php esc_html_e( 'Enter your registration key for '.$registration['plugin_name'] .' and then click Register Plugin.' , 'social-warfare' ); ?>
13
- </p>
14
-
15
- <div class="sw-grid sw-col-300">
16
- <p class="sw-input-label">
17
- <?php esc_html_e( $registration['plugin_name'].' License Key' , 'social-warfare' ); ?>
18
- </p>
19
- </div>
20
-
21
- <div class="sw-grid sw-col-300">
22
- <input name="<?php echo $registration['key'] ?>_license_key" type="text" class="sw-admin-input" placeholder="License Key" value="<?php echo $license_key; ?>" />
23
- </div>
24
-
25
- <div class="sw-grid sw-col-300 sw-fit register_button_grid">
26
- <a href="#" class="register-plugin button sw-navy-button" swp-addon="<?php echo $registration['key']; ?>" swp-item-id="<?php echo $registration["product_id"]; ?>">
27
- <?php esc_html_e( 'Register Plugin' , 'social-warfare' ); ?>
28
- </a>
29
- </div>
30
-
31
- <div class="sw-clearfix"></div>
32
- </div>
33
-
34
- <div class="sw-grid sw-col-940 swp_is_registered">
35
-
36
- <div class="sw-green-notice">
37
- <?php esc_html_e( 'This copy of '.$registration['plugin_name'].' is registered. Wah-hoo!', 'social-warfare' ); ?>
38
- </div>
39
-
40
- <p class="sw-subtitle sw-registration-text">
41
- <?php esc_html_e( 'To unregister your license click the button below to free it up for use on another domain.' , 'social-warfare' ); ?>
42
- </p>
43
-
44
- <div class="sw-grid sw-col-300">
45
- <p class="sw-authenticate-label">
46
- <?php esc_html_e( 'Deactivate Registration' , 'social-warfare' ); ?>
47
- </p>
48
- </div>
49
-
50
- <div class="sw-grid sw-col-300">
51
- <a href="#" class="unregister-plugin button sw-navy-button" swp-addon="<?php echo $registration['key']; ?>" swp-item-id="<?php echo $registration["product_id"]; ?>">
52
- <?php esc_html_e( 'Unregister Plugin' , 'social-warfare' ); ?>
53
- </a>
54
- </div>
55
- <div class="sw-grid sw-col-300 sw-fit"></div>
56
-
57
- </div>
58
-
59
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
functions/options/SWP_User_Options.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
-
3
- class SWP_User_options {
4
-
5
-
6
- public function __construct() {
7
- get_option('Our_Options_In_The_Database');
8
- $this->remove_unavailable_options();
9
- $this->set_defaults();
10
- }
11
-
12
- /**
13
- * This will compare the User Options in the database against the SWP_Options_Page object. If it does
14
- * not exist in the SWP_Options_Page object, that means that the addon that offered this option is not
15
- * active or not registered so delete it from SWP_User_Options.
16
- *
17
- * But DO NOT remove registration keys or registration timestamps.
18
- *
19
- */
20
- public function remove_unavailable_options() {
21
-
22
- }
23
-
24
- /**
25
- * Instead of a giant array of defaults like we have now, have it sort the options against the SWP_Options_Page object.
26
- * Any User Option that isn't set, simply set it to it's default value.
27
- *
28
- */
29
- public function set_defaults() {
30
-
31
- }
32
-
33
-
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
functions/utilities/utility.php DELETED
@@ -1,564 +0,0 @@
1
- <?php
2
- /**
3
- * General utility helper functions.
4
- *
5
- * @package SocialWarfare\Functions
6
- * @copyright Copyright (c) 2018, Warfare Plugins, LLC
7
- * @license GPL-3.0+
8
- * @since 2.1.0
9
- */
10
-
11
-
12
- /**
13
- * Writes data to the wordpress log.
14
- *
15
- * @var mixed $log The data you want to print.
16
- * @var string optional $context Context about the data you are writing.
17
- */
18
- if ( ! function_exists('write_log')) {
19
- function write_log ( $log, $context = '' ) {
20
- error_log( "Context: " . $context );
21
- if ( is_array( $log ) || is_object( $log ) ) {
22
- error_log( print_r( $log, true ) );
23
- } else {
24
- error_log( $log );
25
- }
26
- }
27
- }
28
-
29
-
30
- /**
31
- * A global function to ensure that we always have a value for
32
- * every option. Grab and use the default value if it hasn't been
33
- * set.
34
- *
35
- * @since 3.0.0 | 24 APR 2018 | Created
36
- * @since 3.0.8 | 16 MAY 2018 | Added $options parameter.
37
- * @param string $key The key associated with the option we want.
38
- * @param optional array $optoins A set of options to read from.
39
- * @return mixed $value The value of the option.
40
- *
41
- */
42
- function swp_get_option( $key, $options = null ){
43
- global $swp_user_options;
44
-
45
- if ( null === $options ) {
46
- $options = $swp_user_options;
47
- }
48
-
49
- $defaults = array();
50
- $defaults = apply_filters('swp_options_page_defaults' , $defaults );
51
-
52
- // If the options exists, return it.
53
- if( !empty( $options[$key] ) ):
54
- return $options[$key];
55
-
56
- // Else check if we have a default to use:
57
- elseif( !empty($defaults[$key]) ):
58
- // init_default( $key );
59
- return $defaults[$key];
60
-
61
- // If neither, just return false.
62
- else:
63
- return false;
64
- endif;
65
- }
66
-
67
- add_action( 'wp_ajax_swp_store_settings', 'swp_store_the_settings' );
68
- /**
69
- * Handle the options save request inside of admin-ajax.php
70
- *
71
- * @since unknown
72
- * @return void
73
- * @since 3.0.9 | 31 MAY 2018 | Added call to wp_cache_delete to make sure settings save
74
- */
75
- function swp_store_the_settings() {
76
- global $swp_user_options;
77
-
78
- if ( ! check_ajax_referer( 'swp_plugin_options_save', 'security', false ) ) {
79
- wp_send_json_error( esc_html__( 'Security failed.', 'social-warfare' ) );
80
- die;
81
- }
82
-
83
- $data = wp_unslash( $_POST );
84
-
85
- if ( empty( $data['settings'] ) ) {
86
- wp_send_json_error( esc_html__( 'No settings to save.', 'social-warfare' ) );
87
- die;
88
- }
89
-
90
- $settings = $data['settings'];
91
- $options = $swp_user_options;
92
-
93
- unset( $options['order_of_icons']['active'] );
94
- unset( $options['order_of_icons']['inactive'] );
95
-
96
- // Loop and check for checkbox values, convert them to boolean.
97
- foreach ( $settings as $key => $value ) {
98
- if ( 'true' == $value ) {
99
- $options[ $key ] = true;
100
- } elseif ( 'false' == $value ) {
101
- $options[ $key ] = false;
102
- } else {
103
- $options[ $key ] = $value;
104
- }
105
- }
106
-
107
- wp_cache_delete ( 'social_warfare_settings', 'options' );
108
- echo json_encode(swp_update_options( $options ));
109
-
110
- die;
111
- }
112
-
113
-
114
- /**
115
- * A wrapper for the legacy version of the function
116
- *
117
- * This version accepted 3 parameters, but was scrapped for a
118
- * new version that now accepts an array of unlimited parameters
119
- *
120
- * @since 1.4.0
121
- * @access public
122
- * @param boolean $content The content to which the buttons will be added
123
- * @param string $where Where the buttons should appear (above, below, both, none)
124
- * @param boolean $echo Echo the content or return it
125
- * @return string Returns the modified content
126
- */
127
- function socialWarfare( $content = false, $where = 'default', $echo = true ) {
128
-
129
- // Collect the deprecated fields and place them into an array
130
- $array['content'] = $content;
131
- $array['where'] = $where;
132
- $array['echo'] = $echo;
133
- $array['devs'] = true;
134
-
135
- // Pass the array into the new function
136
- return social_warfare( $array );
137
- }
138
-
139
-
140
- /**
141
- * The primary social_warfare function
142
- *
143
- * This is the function that we encourage users to use in their themes and whatnot
144
- * if they want to be able to directly output the buttons in their theme. It accepts
145
- * an array of arguments that correspond to the arguments that the SWP_Buttons_Panel
146
- * accepts.
147
- *
148
- * @since 1.0.0 | Unknown | Created
149
- * @since 3.0.0 | 08 MAY 2018 | Converted to a passthrough function that calls
150
- * the buttons panel class.
151
- * @param array $args An array of arguments to manipulate the output of the buttons.
152
- * @return none The html of the buttons will be output to the screen.
153
- *
154
- */
155
- function social_warfare( $args = array() ) {
156
-
157
- if( !is_array($args) ):
158
- $args = array();
159
- endif;
160
-
161
- $buttons_panel = new SWP_Buttons_Panel( $args );
162
- echo $buttons_panel->render_HTML();
163
- }
164
-
165
-
166
- /**
167
- * Round a number to the appropriate thousands.
168
- *
169
- * @since unknown
170
- * @access public
171
- * @param float $val The float to be rounded.
172
- * @return float A rounded number.
173
- */
174
- function swp_kilomega( $val ) {
175
- global $swp_user_options;
176
-
177
- // Fetch the user assigned options
178
- $options = $swp_user_options;
179
-
180
- // Check if we even have a value to format
181
- if ( $val ) :
182
-
183
- // Check if the value is less than 1,000....
184
- if ( $val < 1000 ) :
185
-
186
- // If less than 1,000 just format and kick it back
187
- return number_format( $val );
188
-
189
- // Check if the value is greater than 1,000 and less than 1,000,000....
190
- elseif ( $val < 1000000 ) :
191
-
192
- // Start by deviding the value by 1,000
193
- $val = intval( $val ) / 1000;
194
-
195
- // If the decimal separator is a period
196
- if ( $options['decimal_separator'] == 'period' ) :
197
-
198
- // Then format the number to the appropriate number of decimals
199
- return number_format( $val,$options['decimals'],'.',',' ) . 'K';
200
-
201
- // If the decimal separator is a comma
202
- else :
203
-
204
- // Then format the number to the appropriate number of decimals
205
- return number_format( $val,$options['decimals'],',','.' ) . 'K';
206
-
207
- endif;
208
-
209
- // Check if the value is greater than 1,000,000....
210
- else :
211
-
212
- // Start by deviding the value by 1,000,000
213
- $val = intval( $val ) / 1000000;
214
-
215
- // If the decimal separator is a period
216
- if ( $options['decimal_separator'] == 'period' ) :
217
-
218
- // Then format the number to the appropriate number of decimals
219
- return number_format( $val,$options['decimals'],'.',',' ) . 'M';
220
-
221
- // If the decimal separator is a comma
222
- else :
223
-
224
- // Then format the number to the appropriate number of decimals
225
- return number_format( $val,$options['decimals'],',','.' ) . 'M';
226
-
227
- endif;
228
-
229
- endif;
230
-
231
- endif;
232
-
233
- return 0;
234
- }
235
- /**
236
- * This is a function for removing tags and all of their containing html like inline style or script tags in the excerpt.
237
- * @since 2.2.4 | Created | 6 March 2017
238
- * @access public
239
- * @param string $tag_name The name of the tag to search and destroy
240
- * @param object $document The HTML dom object
241
- * @return none
242
- */
243
- function swp_remove_elements_by_tag_name($tag_name, $document) {
244
- $nodeList = $document->getElementsByTagName($tag_name);
245
- for ($nodeIdx = $nodeList->length; --$nodeIdx >= 0; ) {
246
- $node = $nodeList->item($nodeIdx);
247
- $node->parentNode->removeChild($node);
248
- }
249
- }
250
-
251
- /**
252
- * Process the excerpts for descriptions
253
- *
254
- * @since 1.0.0 | Created | Unknown
255
- * @since 2.2.4 | Updated | 6 March 2017 | Added the filter to remove the script and style tags
256
- * @access public
257
- * @param int $post_id The post ID to use when getting an exceprt.
258
- * @return string The excerpt.
259
- */
260
- function swp_get_excerpt_by_id( $post_id ) {
261
-
262
- // Check if the post has an excerpt
263
- if ( has_excerpt() ) :
264
- $the_post = get_post( $post_id ); // Gets post ID
265
- $the_excerpt = $the_post->post_excerpt;
266
-
267
- // If not, let's create an excerpt
268
- else :
269
- $the_post = get_post( $post_id ); // Gets post ID
270
- $the_excerpt = $the_post->post_content; // Gets post_content to be used as a basis for the excerpt
271
- endif;
272
-
273
- $excerpt_length = 100; // Sets excerpt length by word count
274
-
275
- // Filter out any inline script or style tags as well as their content
276
- if( !empty( $the_excerpt ) ):
277
- $the_excerpt = preg_replace('/(<script[^>]*>.+?<\/script>|<style[^>]*>.+?<\/style>)/s', '', $the_excerpt);
278
- endif;
279
-
280
- $the_excerpt = strip_tags( strip_shortcodes( $the_excerpt ) ); // Strips tags and images
281
- $the_excerpt = preg_replace( '/\[[^\]]+\]/', '', $the_excerpt );
282
- $the_excerpt = str_replace( ']]>', ']]&gt;', $the_excerpt );
283
- $the_excerpt = strip_tags( $the_excerpt );
284
- $excerpt_length = apply_filters( 'excerpt_length', 100 );
285
- $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[...]' );
286
- $words = preg_split( "/[\n\r\t ]+/", $the_excerpt, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY );
287
-
288
- if ( count( $words ) > $excerpt_length ) :
289
- array_pop( $words );
290
- // array_push($words, '…');
291
- $the_excerpt = implode( ' ', $words );
292
- endif;
293
-
294
- $the_excerpt = preg_replace( "/\r|\n/", '', $the_excerpt );
295
-
296
- return $the_excerpt;
297
- }
298
-
299
- if ( ! function_exists( 'swp_mobile_detection' ) ) {
300
- /**
301
- * Check to see if the user is using a mobile device.
302
- *
303
- * @since unknown
304
- * @access public
305
- * @todo Replace this with a more reliable method, probably client-side.
306
- * @return bool true if a mobile user agent.
307
- */
308
- function swp_mobile_detection() {
309
- return preg_match( '/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $_SERVER['HTTP_USER_AGENT'] );
310
- }
311
- }
312
-
313
- /**
314
- * Check to see if debugging has been enabled.
315
- *
316
- * @since 2.1.0
317
- * @access private
318
- * @param string $type The type of debugging to check for.
319
- * @return bool true if debugging is enabled.
320
- */
321
- function _swp_is_debug( $type = 'all' ) {
322
- $debug = false;
323
-
324
- if ( ! empty( $_GET['swp_debug'] ) ) {
325
- $debug = sanitize_key( $_GET['swp_debug'] );
326
- }
327
-
328
- if ( ( $debug && 'all' === $type ) || $debug === $type ) {
329
- $debug = true;
330
- } else {
331
- $debug = false;
332
- }
333
-
334
- return (bool) apply_filters( 'swp_is_debug', $debug );
335
- }
336
-
337
- /**
338
- * A function to clean up the available buttons Array
339
- *
340
- * @since 2.1.4
341
- * @param Array $options The options Array
342
- * @return Array $options The modified options array
343
- */
344
- // DEPRECATED
345
- // function swp_buttons_cleanup( $options ) {
346
- // if(isset($options['icons']['active'])) {
347
- // unset($options['icons']['active']);
348
- // }
349
- // return $options;
350
- // }
351
- // add_filter( 'swp_button_options', 'swp_buttons_cleanup', 999 );
352
-
353
- /**
354
- * A function to recursively search arrays
355
- *
356
- * @since 1.0.0
357
- * @access public
358
- * @param string $needle The needle
359
- * @param string $haystack The haystack
360
- * @return string/bool Return the key if found or false if nothing is found
361
- */
362
- function swp_recursive_array_search( $needle, $haystack ) {
363
- foreach ( $haystack as $key => $value ) {
364
- $current_key = $key;
365
- if ( $needle === $value or (is_array( $value ) && swp_recursive_array_search( $needle,$value ) !== false) ) {
366
- return $current_key;
367
- }
368
- }
369
- return false;
370
- }
371
-
372
- /**
373
- * A function to gethe current URL of a page
374
- *
375
- * @since 1.0.0
376
- * @return string The URL of the current page
377
- */
378
- function swp_get_current_url() {
379
- $page_url = 'http';
380
- if ( $_SERVER['HTTPS'] == 'on' ) {$page_url .= 's';}
381
- $page_url .= '://';
382
- $page_url .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
383
- $page_url = strtok( $page_url, '?' );
384
-
385
- return $page_url;
386
- }
387
- /**
388
- * A function to disable the buttons on subtitles
389
- *
390
- * @return bool false
391
- */
392
- function swp_disable_subs() {
393
- return false;
394
- }
395
-
396
- /**
397
- * Convert curly quotes to straight quotes
398
- *
399
- * @since 1.4.0
400
- * @param string $content A string of text to be filtered
401
- * @return string $content The modified string of text
402
- */
403
- function convert_smart_quotes( $content ) {
404
- $content = str_replace( '"', '\'', $content );
405
- $content = str_replace( '&#8220;', '\'', $content );
406
- $content = str_replace( '&#8221;', '\'', $content );
407
- $content = str_replace( '&#8216;', '\'', $content );
408
- $content = str_replace( '&#8217;', '\'', $content );
409
- return $content;
410
- }
411
-
412
- /**
413
- * A function to make removing hooks easier
414
- *
415
- * @since 1.4.0
416
- * @access public
417
- * @param string $hook_name The name of the hook
418
- * @param string $method_name The name of the method
419
- * @param integer $priority The hook priority
420
- * @return boolean false
421
- */
422
- function swp_remove_filter( $hook_name = '', $method_name = '', $priority = 0 ) {
423
- global $wp_filter;
424
-
425
- // Take only filters on right hook name and priority
426
- if ( ! isset( $wp_filter[ $hook_name ][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][ $priority ] ) ) {
427
- return false;
428
- }
429
-
430
- // Loop on filters registered
431
- foreach ( (array) $wp_filter[ $hook_name ][ $priority ] as $unique_id => $filter_array ) {
432
- // Test if filter is an array ! (always for class/method)
433
- if ( isset( $filter_array['function'] ) && is_array( $filter_array['function'] ) ) {
434
- // Test if object is a class and method is equal to param !
435
- if ( is_object( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) && $filter_array['function'][1] == $method_name ) {
436
- unset( $wp_filter[ $hook_name ][ $priority ][ $unique_id ] );
437
- }
438
- }
439
- }
440
-
441
- return false;
442
- }
443
-
444
- /**
445
- * Get the SWP supported post types.
446
- *
447
- * @return array $types A list of post type names.
448
- */
449
- function swp_get_post_types() {
450
- $types = get_post_types(
451
- array(
452
- 'public' => true,
453
- '_builtin' => false,
454
- ),
455
- 'names'
456
- );
457
-
458
- $types[] = 'page';
459
- $types[] = 'post';
460
-
461
- return (array) apply_filters( 'swp_post_types', $types );
462
- }
463
-
464
- /**
465
- * A function to add options to the admin options page
466
- *
467
- * @since 2.1.4
468
- * @access public
469
- * @param array $sw_options The array of current options
470
- * @param string $tabName The name of the tab being modified
471
- * @param string $optionName The name of the option that the new option will be inserted next to.
472
- * @param array $option The array of information about the new option being added
473
- * @param string $position Add the new option 'before' or 'after' the needle. Default => 'after'
474
- * @return array $sw_options The modified array of options
475
- */
476
- function swp_insert_option( $sw_options , $tabName , $optionName , $newOptionArray , $position = 'after' ) {
477
-
478
- // Locate the index of the option you want to insert next to
479
- $keyIndex = array_search( $optionName, array_keys( $sw_options['options'][$tabName] ) );
480
-
481
- if('after' === $position) {
482
- ++$keyIndex;
483
- }
484
-
485
- // Split the array at the location of the option above
486
- $first_array = array_splice ( $sw_options['options'][$tabName] , 0 , $keyIndex );
487
-
488
- // Merge the two parts of the split array with your option added in the middle
489
- $sw_options['options'][$tabName] = array_merge (
490
- $first_array,
491
- $newOptionArray,
492
- $sw_options['options'][$tabName]
493
- );
494
-
495
- // Return the option array or the world will explode
496
- return $sw_options;
497
-
498
- }
499
-
500
- /**
501
- * A function to remove the screen options tab from our admin page
502
- * @since 2.2.1
503
- */
504
- function swp_remove_screen_options( $display_boolean, $wp_screen_object ){
505
- $blacklist = array('admin.php?page=social-warfare');
506
- if ( in_array( $GLOBALS['pagenow'], $blacklist ) ) {
507
- $wp_screen_object->render_screen_layout();
508
- $wp_screen_object->render_per_page_options();
509
- return false;
510
- }
511
- return $display_boolean;
512
- }
513
- add_filter( 'screen_options_show_screen', 'swp_remove_screen_options', 10, 2 );
514
-
515
-
516
- function swp_get_license_key($key) {
517
-
518
- if(is_swp_addon_registered($key)):
519
-
520
- $options = get_option( 'social_warfare_settings' );
521
- $license = $options[$key.'_license_key'];
522
- return $license;
523
-
524
- else:
525
-
526
- return false;
527
-
528
- endif;
529
- }
530
-
531
- /**
532
- * A function to return the URL of the website or network
533
- *
534
- * @since 2.3.3 | 25 SEP 2017 | Created
535
- * @return String The URL of the site
536
- *
537
- */
538
- function swp_get_site_url() {
539
- if( true == is_multisite() ) {
540
- return network_site_url();
541
- } else {
542
- return get_site_url();
543
- }
544
- }
545
-
546
-
547
- /**
548
- * A function to convert strings into snake_case
549
- *
550
- * @since 3.0.0 | 02 MAY 2018 | Created
551
- * @param string $string The string to be modified.
552
- * @return string The snake_case modified string.
553
- *
554
- */
555
- function swp_snake_case( $string ) {
556
- $snake_case = str_replace( ' ' , '_' , strtolower($string) );
557
- return $snake_case;
558
- }
559
-
560
- add_action( 'wp_ajax_swp_fetch_user_options', 'swp_fetch_user_options' );
561
- function swp_fetch_user_options() {
562
- echo json_encode( get_option( 'social_warfare_settings', [] ) );
563
- wp_die();
564
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/script.min.js CHANGED
File without changes
languages/social-warfare-da-DK.mo CHANGED
File without changes
languages/social-warfare-de_DE.mo CHANGED
File without changes
languages/social-warfare-en_US.mo CHANGED
File without changes
languages/social-warfare-es_ES.mo CHANGED
File without changes
languages/social-warfare-fr_FR.mo CHANGED
File without changes
languages/social-warfare-hy.mo CHANGED
File without changes
languages/social-warfare-it_IT.mo CHANGED
File without changes
languages/social-warfare-pt_BR.mo CHANGED
File without changes
languages/social-warfare-pt_PT.mo CHANGED
File without changes
languages/social-warfare-ru_RU.mo CHANGED
File without changes
languages/social-warfare-uk.mo CHANGED
File without changes
languages/social-warfare.pot CHANGED
@@ -402,8 +402,8 @@ msgstr ""
402
  msgid "Pin"
403
  msgstr ""
404
 
405
- #: functions/social-networks/stumbleupon.php:100
406
- #: functions/social-networks/stumbleupon.php:104
407
  msgid "Stumble"
408
  msgstr ""
409
 
402
  msgid "Pin"
403
  msgstr ""
404
 
405
+ #: functions/social-networks/mix.php:100
406
+ #: functions/social-networks/mix.php:104
407
  msgid "Stumble"
408
  msgstr ""
409
 
languages/social_warfare-el_EL.mo CHANGED
File without changes
languages/social_warfare-nl_NL.mo CHANGED
File without changes
{functions → lib}/Social_Warfare.php RENAMED
@@ -19,7 +19,6 @@
19
  */
20
  class Social_Warfare {
21
 
22
-
23
  /**
24
  * The magic method used to instantiate this class.
25
  *
@@ -34,31 +33,25 @@ class Social_Warfare {
34
  *
35
  */
36
  public function __construct() {
 
 
 
37
 
38
- // Block these classes from being loaded again if a child class attempts
39
- // to run the parent::__construct() method.
40
- if ( get_class($this) === 'Social_Warfare' ) {
41
-
42
- // Loads the files for each class.
43
- $this->load_classes();
44
-
45
- // Instantiate all the core classes
46
- $this->instantiate_classes();
47
-
48
- // Instantiate the admin-only classes.
49
- if( true === is_admin() ) {
50
- $this->instantiate_admin_classes();
51
- }
52
 
53
- // Instantiate the frontend-only classes.
54
- if( false === is_admin() ) {
55
- $this->instantiate_frontend_classes();
56
- }
57
 
 
 
 
58
  }
59
 
60
- $this->core_version = SWP_VERSION;
61
- }
 
62
 
63
 
64
  /**
@@ -74,6 +67,23 @@ class Social_Warfare {
74
  *
75
  */
76
  private function instantiate_classes() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  global $SWP_Options_Page;
78
 
79
 
@@ -198,22 +208,21 @@ class Social_Warfare {
198
  global $SWP_Post_Caches;
199
  $SWP_Post_Caches = new SWP_Post_Cache_Loader();
200
 
201
- }
202
-
203
 
204
- /**
205
- * This method will load up all of the frontend-only classes.
206
- *
207
- * @since 3.1.0 | 20 JUNE 2018 | Created
208
- * @param void
209
- * @return void
210
- * @access private
211
- */
212
- private function instantiate_frontend_classes() {
213
 
 
214
 
215
  }
216
 
 
217
  /**
218
  * This method will load up all of the admin-only classes.
219
  *
@@ -284,17 +293,43 @@ class Social_Warfare {
284
  */
285
  new SWP_User_Profile();
286
 
 
 
 
 
 
 
 
 
 
287
  new SWP_JSON_Cache_Handler();
288
 
289
- add_action('plugins_loaded', function() {
290
- /**
291
- * Instantiates all of our notices.
292
- *
293
- */
294
- new SWP_Notice_Loader();
295
- }, 50);
296
 
297
- require_once SWP_PLUGIN_DIR . '/functions/utilities/SWP_Plugin_Updater.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  }
299
 
300
 
@@ -333,9 +368,11 @@ class Social_Warfare {
333
  'Notice_Loader',
334
  'Post_Cache_Loader',
335
  'Post_Cache',
336
- 'JSON_Cache_Handler'
 
 
337
  );
338
- $this->load_files( '/functions/utilities/', $utilities);
339
 
340
 
341
  /**
@@ -355,24 +392,11 @@ class Social_Warfare {
355
  'Twitter',
356
  'Linkedin',
357
  'Pinterest',
358
- 'Stumble_Upon'
359
  );
360
- $this->load_files( '/functions/social-networks/', $social_networks);
361
 
362
 
363
- /**
364
- * The Addon Classes
365
- *
366
- * This family of classes provide for the management of addons. These
367
- * control the framework for registering addons, checking for updates
368
- * for the addons, and other addon specific tasks.
369
- *
370
- */
371
- $includes = array(
372
- 'Addon'
373
- );
374
- $this->load_files( '/functions/includes/', $includes);
375
-
376
 
377
  /**
378
  * The Frontend Output Classes
@@ -390,11 +414,11 @@ class Social_Warfare {
390
  'Script',
391
  'Shortcode',
392
  );
393
- $this->load_files( '/functions/frontend-output/', $frontends );
394
 
395
 
396
  /**
397
- * The Widget Classes
398
  *
399
  * These are the classes that create the widgets available for output in
400
  * WordPress. Built in is the Popular Posts widget, but these also
@@ -406,7 +430,7 @@ class Social_Warfare {
406
  'Popular_Posts_Widget',
407
  'Widget',
408
  );
409
- $this->load_files( '/functions/widgets/', $widgets );
410
 
411
 
412
  /**
@@ -427,8 +451,9 @@ class Social_Warfare {
427
  'Settings_Link',
428
  'Shortcode_Generator',
429
  'User_Profile',
 
430
  );
431
- $this->load_files( '/functions/admin/', $admins );
432
 
433
 
434
  /**
@@ -440,6 +465,7 @@ class Social_Warfare {
440
  *
441
  */
442
  $options = array(
 
443
  'Option',
444
  'Options_Page',
445
  'Options_Page_Tab',
@@ -450,9 +476,9 @@ class Social_Warfare {
450
  'Option_Textarea',
451
  'Section_HTML',
452
  'Option_Icons',
453
- 'Addon_Registration',
454
  );
455
- $this->load_files( '/functions/options/', $options );
456
 
457
 
458
  /**
@@ -462,7 +488,7 @@ class Social_Warfare {
462
  * needed in order to properly check for updates for addons.
463
  *
464
  */
465
- require_once SWP_PLUGIN_DIR . '/functions/plugin-update-checker/plugin-update-checker.php';
466
 
467
 
468
  }
@@ -484,31 +510,47 @@ class Social_Warfare {
484
  require_once SWP_PLUGIN_DIR . $path . $file . '.php';
485
  }
486
  }
487
- }
488
 
489
 
490
- /*******************************************************************************
491
- *
492
- *
493
- * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
494
- *
495
- * EVERY FILE BELOW THIS POINT NEEDS TO BE REFACTORED. IT'S "REQUIRE_ONCE" THEN
496
- * NEEDS TO BE MIGRATED INTO THE CLASS ABOVE.
497
- *
498
- *
499
- * *****************************************************************************/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
500
 
 
 
 
 
501
 
502
- // TODO: These files need refactored into classes and to the appropriate sections above.
503
- require_once SWP_PLUGIN_DIR . '/functions/admin/registration.php';
504
- require_once SWP_PLUGIN_DIR . '/functions/admin/options-fetch.php';
505
- require_once SWP_PLUGIN_DIR . '/functions/utilities/utility.php';
506
 
507
  /**
508
  * Include the plugin's admin files.
509
  *
510
  */
511
  if ( is_admin() ) {
512
- require_once SWP_PLUGIN_DIR . '/functions/admin/swp_system_checker.php';
513
- // require_once SWP_PLUGIN_DIR . '/functions/admin/options-page.php';
514
  }
19
  */
20
  class Social_Warfare {
21
 
 
22
  /**
23
  * The magic method used to instantiate this class.
24
  *
33
  *
34
  */
35
  public function __construct() {
36
+ $this->core_version = SWP_VERSION;
37
+ add_action('plugins_loaded', array($this, 'init'));
38
+ }
39
 
40
+ public function init() {
41
+ // Loads the files for each class.
42
+ $this->load_classes();
 
 
 
 
 
 
 
 
 
 
 
43
 
44
+ // Instantiate all the core classes
45
+ $this->instantiate_classes();
 
 
46
 
47
+ // Instantiate the admin-only classes.
48
+ if( true === is_admin() ) {
49
+ $this->instantiate_admin_classes();
50
  }
51
 
52
+ // Instatiate classes that need to be defered.
53
+ add_action('plugins_loaded' , array( $this, 'instantiate_deferred_classes' ) , 100 );
54
+ }
55
 
56
 
57
  /**
67
  *
68
  */
69
  private function instantiate_classes() {
70
+
71
+
72
+ /**
73
+ * The Global $swp_user_options Loader
74
+ *
75
+ * This creates and filters and manages the user options array.
76
+ *
77
+ */
78
+ new SWP_User_Options();
79
+
80
+
81
+ /**
82
+ * The Global Options Page Object
83
+ *
84
+ * This is created as a global so that all addons can modify it.
85
+ *
86
+ */
87
  global $SWP_Options_Page;
88
 
89
 
208
  global $SWP_Post_Caches;
209
  $SWP_Post_Caches = new SWP_Post_Cache_Loader();
210
 
 
 
211
 
212
+ /**
213
+ * The Utility Class
214
+ *
215
+ * While the methods are all static functions that do not require
216
+ * a class instance to use, there are hooks that need to be set up
217
+ * in the class __construct() method.
218
+ *
219
+ */
 
220
 
221
+ new SWP_Utility();
222
 
223
  }
224
 
225
+
226
  /**
227
  * This method will load up all of the admin-only classes.
228
  *
293
  */
294
  new SWP_User_Profile();
295
 
296
+
297
+ /**
298
+ * The JSON Cache Handler
299
+ *
300
+ * This class fetches the JSON data from our home server and makes it
301
+ * available to the plugin for important information like adding
302
+ * dashboard notices or updating the sidebar in the admin settings page.
303
+ *
304
+ */
305
  new SWP_JSON_Cache_Handler();
306
 
 
 
 
 
 
 
 
307
 
308
+ /**
309
+ * The Settings Page Sidebar Loader
310
+ *
311
+ * This class controls the sidebar on the settings page.
312
+ *
313
+ */
314
+ new SWP_Sidebar_Loader();
315
+
316
+ }
317
+
318
+
319
+ /**
320
+ * Instatiate the classes that we want to load in a deferred manner.
321
+ *
322
+ * @since 3.3.0 | 06 AUG 2018 | Created
323
+ * @param void
324
+ * @return void
325
+ *
326
+ */
327
+ public function instantiate_deferred_classes() {
328
+ /**
329
+ * Instantiates all of our notices.
330
+ *
331
+ */
332
+ new SWP_Notice_Loader();
333
  }
334
 
335
 
368
  'Notice_Loader',
369
  'Post_Cache_Loader',
370
  'Post_Cache',
371
+ 'JSON_Cache_Handler',
372
+ 'Plugin_Updater',
373
+ 'Utility'
374
  );
375
+ $this->load_files( '/lib/utilities/', $utilities);
376
 
377
 
378
  /**
392
  'Twitter',
393
  'Linkedin',
394
  'Pinterest',
395
+ 'Mix'
396
  );
397
+ $this->load_files( '/lib/social-networks/', $social_networks);
398
 
399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
 
401
  /**
402
  * The Frontend Output Classes
414
  'Script',
415
  'Shortcode',
416
  );
417
+ $this->load_files( '/lib/frontend-output/', $frontends );
418
 
419
 
420
  /**
421
+ * The Widget ClassesMa
422
  *
423
  * These are the classes that create the widgets available for output in
424
  * WordPress. Built in is the Popular Posts widget, but these also
430
  'Popular_Posts_Widget',
431
  'Widget',
432
  );
433
+ $this->load_files( '/lib/widgets/', $widgets );
434
 
435
 
436
  /**
451
  'Settings_Link',
452
  'Shortcode_Generator',
453
  'User_Profile',
454
+ 'Sidebar_Loader'
455
  );
456
+ $this->load_files( '/lib/admin/', $admins );
457
 
458
 
459
  /**
465
  *
466
  */
467
  $options = array(
468
+ 'User_Options',
469
  'Option',
470
  'Options_Page',
471
  'Options_Page_Tab',
476
  'Option_Textarea',
477
  'Section_HTML',
478
  'Option_Icons',
479
+ 'Registration_Tab_Template',
480
  );
481
+ $this->load_files( '/lib/options/', $options );
482
 
483
 
484
  /**
488
  * needed in order to properly check for updates for addons.
489
  *
490
  */
491
+ require_once SWP_PLUGIN_DIR . '/lib/update-checker/plugin-update-checker.php';
492
 
493
 
494
  }
510
  require_once SWP_PLUGIN_DIR . $path . $file . '.php';
511
  }
512
  }
 
513
 
514
 
515
+ /**
516
+ *
517
+ * When we have known incompatability with other themes/plugins,
518
+ * we can put those checks in here.
519
+ *
520
+ * Checks for known conflicts with other plugins and themes.
521
+ *
522
+ * If there is a fatal conflict, returns true and exits printing.
523
+ * If there are other conflicts, they are silently handled and can still
524
+ * print.
525
+ *
526
+ * @since 3.0.0 | 01 MAR 2018 | Created
527
+ * @since 3.3.0 | 30 AUG 2018 | Moved from SWP_Buttons_Panel to Social_Warfare.
528
+ * @param void
529
+ *
530
+ * @return bool True iff the conflict is fatal, else false.
531
+ *
532
+ */
533
+ public static function has_plugin_conflict() {
534
+
535
+ // Disable subtitles plugin to prevent it from injecting subtitles
536
+ // into our share titles.
537
+ if ( function_exists( 'is_plugin_active' ) && is_plugin_active( 'subtitles/subtitles.php' ) && class_exists( 'Subtitles' ) ) :
538
+ remove_filter( 'the_title', array( Subtitles::getinstance(), 'the_subtitle' ), 10, 2 );
539
+ endif;
540
 
541
+ //* Disable on BuddyPress pages.
542
+ if ( function_exists( 'is_buddypress' ) && is_buddypress() ) :
543
+ return true;
544
+ endif;
545
 
546
+ return false;
547
+ }
548
+ }
 
549
 
550
  /**
551
  * Include the plugin's admin files.
552
  *
553
  */
554
  if ( is_admin() ) {
555
+ require_once SWP_PLUGIN_DIR . '/lib/admin/swp_system_checker.php';
 
556
  }
lib/Social_Warfare_Addon.php ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Social_Warfare_Addon {
4
+ public function __construct( $args = array() ) {
5
+ $this->establish_class_properties( $args );
6
+ $this->establish_license_key();
7
+ $this->is_registered = $this->establish_resgistration();
8
+
9
+ add_action( 'wp_ajax_swp_register_plugin', [$this, 'register_plugin'] );
10
+ add_action( 'wp_ajax_swp_unregister_plugin', [$this, 'unregister_plugin'] );
11
+ add_action( 'wp_ajax_swp_ajax_passthrough', [$this, 'ajax_passthrough'] );
12
+
13
+ add_filter( 'swp_registrations', array( $this, 'add_self' ) );
14
+ }
15
+
16
+ private function establish_class_properties( $args = array () ) {
17
+ $required= ['name', 'key', 'product_id', 'version', 'core_required'];
18
+
19
+ foreach($args as $key => $value) {
20
+ $this->$key = $value;
21
+ }
22
+
23
+ foreach($required as $key) {
24
+ if ( !isset( $this->$key ) ) :
25
+ $message = "Hey developer, you must provide us this information for your class: $key => \$value";
26
+ throw new Exception($message);
27
+ endif;
28
+
29
+ }
30
+
31
+ $this->store_url = 'https://warfareplugins.com';
32
+ $this->site_url = SWP_Utility::get_site_url();
33
+ }
34
+
35
+
36
+ /**
37
+ * The callback function used to add a new instance of this
38
+ * to our swp_registrations filter.
39
+ *
40
+ * This should be the last item called in an addon's main file.
41
+ *
42
+ * @param array $addons The array of addons currently activated.
43
+ */
44
+ public function add_self( $addons ) {
45
+ if ( $this->key == 'affiliatewp') return;
46
+
47
+ $addons[] = $this;
48
+
49
+ return $addons;
50
+ }
51
+
52
+
53
+ public function establish_license_key() {
54
+ $key = SWP_Utility::get_option( $this->key . '_license_key' );
55
+
56
+ if ( !$key ) :
57
+ $old_options = get_option( 'socialWarfareOptions', false );
58
+
59
+ if ( isset( $old_options[$this->key . '_license_key']) ) :
60
+ $key = isset( $old_options[$this->key . '_license_key']);
61
+ endif;
62
+
63
+ endif;
64
+
65
+ $this->license_key = $key ? $key : '';
66
+ }
67
+
68
+ public function establish_resgistration() {
69
+ // Get the timestamps setup for comparison to see if a week has passed since our last check
70
+ $current_time = time();
71
+
72
+ if ( SWP_Utility::get_option( $this->key. '_license_key_timestamp' ) ) :
73
+ $timestamp = SWP_Utility::get_option( $this->key.'_license_key_timestamp' );
74
+ else:
75
+ $timestamp = 0;
76
+ endif;
77
+ $time_to_recheck = $timestamp + 604800;
78
+
79
+ // If they have a key and a week hasn't passed since the last check, just return true...the plugin is registered.
80
+ if( !empty( $this->license_key) && $current_time < $time_to_recheck ) :
81
+ return true;
82
+ endif;
83
+
84
+ // If a week has passed since the last check, ping our API to check the validity of the license key
85
+ if ( !empty( $this->license_key) ) :
86
+ global $swp_user_options;
87
+
88
+ $data = array(
89
+ 'edd_action' => 'check_license',
90
+ 'item_id' => $this->product_id,
91
+ 'license' => $this->license_key,
92
+ 'url' => $this->site_url,
93
+ );
94
+
95
+
96
+ $response = wp_remote_retrieve_body( wp_remote_post( $this->store_url , array('body' => $data, 'timeout' => 10 ) ) );
97
+
98
+ if( false !== $response ) :
99
+ $license_data = json_decode( $response );
100
+
101
+ $swp_user_options[$this->key . '_license_key_timestamp'] = $current_time;
102
+
103
+ // If the license was invalid
104
+ if ( isset( $license_data->license ) && 'invalid' === $license_data->license ) :
105
+ $this->license_key = '';
106
+
107
+ $swp_user_options[$this->key . '_license_key'] = '';
108
+
109
+ update_option( 'social_warfare_settings' , $swp_user_options );
110
+
111
+ return false;
112
+
113
+ // If the property is some other status, just go with it.
114
+ else :
115
+ update_option( 'social_warfare_settings' , $swp_user_options );
116
+
117
+ return true;
118
+ endif;
119
+
120
+ // If we recieved no response from the server, we'll just check again next week
121
+ else :
122
+ $swp_user_options[$key.'_license_key_timestamp'] = $current_time;
123
+ update_option( 'social_warfare_settings' , $swp_user_options );
124
+
125
+ return true;
126
+ endif;
127
+ endif;
128
+
129
+ return false;
130
+ }
131
+
132
+ public function check_for_updates() {
133
+ if ( version_compare(SWP_VERSION, $this->core_required) >= 0 ) :
134
+
135
+ endif;
136
+ }
137
+
138
+ /**
139
+ * Request to EDD to activate the licence.
140
+ *
141
+ * @since 2.1.0
142
+ * @since 2.3.0 Hooked registration into the new EDD Software Licensing API
143
+ * @param none
144
+ * @return JSON Encoded Array (Echoed) - The Response from the EDD API
145
+ *
146
+ */
147
+ public function register_plugin() {
148
+ // Check to ensure that license key was passed into the function
149
+ if ( !empty( $_POST['license_key'] ) ) :
150
+
151
+ // Grab the license key so we can use it below
152
+ $key = $_POST['name_key'];
153
+ $license = $_POST['license_key'];
154
+ $item_id = $_POST['item_id'];
155
+ $this->store_url = 'https://warfareplugins.com';
156
+
157
+ $api_params = array(
158
+ 'edd_action' => 'activate_license',
159
+ 'item_id' => $item_id,
160
+ 'license' => $license,
161
+ 'url' => $this->site_url
162
+ );
163
+
164
+ $response = wp_remote_retrieve_body( wp_remote_post( $this->store_url, array( 'body' => $api_params, 'timeout' => 10 ) ) );
165
+
166
+ if ( false != $response ) :
167
+
168
+ // Parse the response into an object
169
+ $license_data = json_decode( $response );
170
+
171
+ // If the license is valid store it in the database
172
+ if( isset($license_data->license) && 'valid' == $license_data->license ) :
173
+
174
+ $current_time = time();
175
+ $options = get_option( 'social_warfare_settings' );
176
+ $options[$key.'_license_key'] = $license;
177
+ $options[$key.'_license_key_timestamp'] = $current_time;
178
+ update_option( 'social_warfare_settings' , $options );
179
+
180
+ echo json_encode($license_data);
181
+ wp_die();
182
+
183
+ // If the license is not valid
184
+ elseif( isset($license_data->license) && 'invalid' == $license_data->license ) :
185
+ echo json_encode($license_data);
186
+ wp_die();
187
+
188
+ // If some other status was returned
189
+ else :
190
+ $license_data['success'] = false;
191
+ $license_data['data'] = 'Invaid response from the registration server.';
192
+ echo json_encode($license_data);
193
+ wp_die();
194
+ endif;
195
+
196
+ // If we didn't get a response from the registration server
197
+ else :
198
+ $license_data['success'] = false;
199
+ $license_data['data'] = 'Failed to connect to registration server.';
200
+ echo json_encode($license_data);
201
+ wp_die();
202
+ endif;
203
+ endif;
204
+
205
+ $license_data['success'] = false;
206
+ $license_data['data'] = 'Admin Ajax did not receive valid POST data.';
207
+ echo json_encode($license_data);
208
+ wp_die();
209
+
210
+ }
211
+
212
+
213
+ /**
214
+ * Request to EDD to deactivate the licence.
215
+ *
216
+ * @since 2.1.0
217
+ * @since 2.3.0 Hooked into the EDD Software Licensing API
218
+ * @param none
219
+ * @return JSON Encoded Array (Echoed) - The Response from the EDD API
220
+ *
221
+ */
222
+ public function unregister_plugin() {
223
+ // Setup the variables needed for processing
224
+ $options = get_option( 'social_warfare_settings' );
225
+ $key = $_POST['name_key'];
226
+ $item_id = $_POST['item_id'];
227
+ $response = array();
228
+
229
+ // Check to see if the license key is even in the options
230
+ if ( !SWP_Utility::get_option( $key . '_license_key' ) ) :
231
+
232
+ $response['success'] = true;
233
+ echo json_encode($response);
234
+ wp_die();
235
+
236
+ endif;
237
+
238
+ // Grab the license key so we can use it below
239
+ $license = $options[$key.'_license_key'];
240
+
241
+ // Setup the API request parameters
242
+ $api_params = array(
243
+ 'edd_action' => 'deactivate_license',
244
+ 'item_id' => $item_id,
245
+ 'license' => $license,
246
+ 'url' => $this->site_url,
247
+ );
248
+
249
+ //* wp_remote_retrieve_body encodes to JSON for us.
250
+ $response = wp_remote_retrieve_body( wp_remote_post( $this->store_url, array( 'body' => $api_params, 'timeout' => 10 ) ) );
251
+
252
+ $options = get_option( 'social_warfare_settings' );
253
+ $options[$key.'_license_key'] = '';
254
+ update_option( 'social_warfare_settings' , $options );
255
+
256
+ echo $response;
257
+
258
+ wp_die();
259
+ }
260
+
261
+ public function ajax_passthrough() {
262
+ if ( ! check_ajax_referer( 'swp_plugin_registration', 'security', false ) ) {
263
+ wp_send_json_error( esc_html__( 'Security failed.', 'social-warfare' ) );
264
+ die;
265
+ }
266
+
267
+ $data = wp_unslash( $_POST ); // Input var okay.
268
+
269
+ if ( ! isset( $data['activity'], $data['email'] ) ) {
270
+ wp_send_json_error( esc_html__( 'Required fields missing.', 'social-warfare' ) );
271
+ die;
272
+ }
273
+
274
+ if ( 'register' === $data['activity'] ) {
275
+ $response = swp_register_plugin( $data['email'], SWP_Utility::get_site_url() );
276
+
277
+ if ( ! $response ) {
278
+ wp_send_json_error( esc_html__( 'Plugin could not be registered.', 'social-warfare' ) );
279
+ die;
280
+ }
281
+
282
+ $response['message'] = esc_html__( 'Plugin successfully registered!', 'social-warfare' );
283
+ }
284
+
285
+ if ( 'unregister' === $data['activity'] && isset( $data['key'] ) ) {
286
+ $response = swp_unregister_plugin( $data['email'], $data['key'] );
287
+
288
+ if ( ! $response ) {
289
+ wp_send_json_error( esc_html__( 'Plugin could not be unregistered.', 'social-warfare' ) );
290
+ die;
291
+ }
292
+
293
+ $response['message'] = esc_html__( 'Plugin successfully unregistered!', 'social-warfare' );
294
+ }
295
+
296
+ wp_send_json_success( $response );
297
+
298
+ die;
299
+ }
300
+ }
{functions → lib}/admin/SWP_Click_To_Tweet.php RENAMED
File without changes
{functions → lib}/admin/SWP_Column.php RENAMED
@@ -22,7 +22,7 @@ class SWP_Column {
22
  * will queue up all the other methods by adding them to the necessary
23
  * WordPress action and filter hooks.
24
  *
25
- * NOTE: These "duplicate" hooks/functions are to cover both posts and pages.
26
  *
27
  * @since 3.0.0 | 01 MAR 2018 | Created
28
  * @param void
22
  * will queue up all the other methods by adding them to the necessary
23
  * WordPress action and filter hooks.
24
  *
25
+ * NOTE: These "duplicate" hooks/lib are to cover both posts and pages.
26
  *
27
  * @since 3.0.0 | 01 MAR 2018 | Created
28
  * @param void
{functions → lib}/admin/SWP_Settings_Link.php RENAMED
File without changes
{functions → lib}/admin/SWP_Shortcode_Generator.php RENAMED
@@ -106,7 +106,7 @@ class SWP_Shortcode_Generator {
106
  *
107
  */
108
  public function tinymce_register_plugin( $plugin_array ) {
109
- $plugin_array['swp_shortcode_generator'] = SWP_PLUGIN_URL . '/js/sw-shortcode-generator.js';
110
  return $plugin_array;
111
  }
112
 
106
  *
107
  */
108
  public function tinymce_register_plugin( $plugin_array ) {
109
+ $plugin_array['swp_shortcode_generator'] = SWP_PLUGIN_URL . '/assets/js/sw-shortcode-generator.js';
110
  return $plugin_array;
111
  }
112
 
lib/admin/SWP_Sidebar_Loader.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * SWP_Sidebar_Loader
5
+ *
6
+ * This pulls in the sidebar component JSON from our server and displays it as HTML.
7
+ *
8
+ * We can cachce the HTML so as not to make an excessive number of ajax calls.
9
+ *
10
+ * @package SocialWarfare\Functions\Social-Networks
11
+ * @copyright Copyright (c) 2018, Warfare Plugins, LLC
12
+ * @license GPL-3.0+
13
+ * @since 3.3.0 | 03 AUG 2018 | Created.
14
+ *
15
+ */
16
+ class SWP_Sidebar_Loader {
17
+
18
+
19
+ /**
20
+ * Instantiate the class.
21
+ *
22
+ * @since 3.3.0 | 03 AUG 2018 | Created.
23
+ * @param void
24
+ * @return void
25
+ *
26
+ */
27
+ public function __construct() {
28
+ $this->load_components();
29
+ }
30
+
31
+
32
+ /**
33
+ * Activate notices created via our remote JSON file.
34
+ *
35
+ * @since 3.1.0 | 27 JUN 2018 | Created
36
+ * @param void
37
+ * @return void
38
+ *
39
+ */
40
+ private function load_components() {
41
+ $cache_data = get_option('swp_json_cache');
42
+
43
+ if( false === $cache_data ):
44
+ return;
45
+ endif;
46
+
47
+ if( !is_array( $cache_data ) || empty($cache_data['sidebar']) ):
48
+ return;
49
+ endif;
50
+
51
+ add_filter( 'swp_admin_sidebar', function( $components ) {
52
+ return array_merge( $components, $cache_data['sidebar'] );
53
+ });
54
+ }
55
+
56
+
57
+ /**
58
+ * A function for debugging this class.
59
+ *
60
+ * All notices are stored in the $this->notices as an array of notice
61
+ * objects. Since this is the last method called, all notices should be
62
+ * present in the $this object for review.
63
+ *
64
+ * @since 3.1.0 | 28 JUN 2018 | Created
65
+ * @param void
66
+ * @return void
67
+ *
68
+ */
69
+ private function debug() {
70
+ if( true === SWP_Utility::debug( 'notices' ) ):
71
+ var_dump($this);
72
+ endif;
73
+ }
74
+
75
+ }
{functions → lib}/admin/SWP_User_Profile.php RENAMED
File without changes
{functions → lib}/admin/assets/css/admin.css RENAMED
File without changes
{functions → lib}/admin/assets/css/style1.css RENAMED
File without changes
{functions → lib}/admin/assets/css/style2.css RENAMED
File without changes
{functions → lib}/admin/assets/css/style3.css RENAMED
File without changes
{functions → lib}/admin/assets/css/style4.css RENAMED
File without changes
{functions → lib}/admin/assets/css/styles.css RENAMED
File without changes
{functions → lib}/admin/assets/img/twitter-little-bird-button.png RENAMED
File without changes
{functions → lib}/admin/assets/img/twitter-little-bird-white.png RENAMED
File without changes
{functions → lib}/admin/assets/img/twitter-little-bird.png RENAMED
File without changes
{functions → lib}/admin/assets/js/clickToTweet.js RENAMED
File without changes
{functions → lib}/admin/assets/js/clickToTweet.min.js RENAMED
File without changes
{functions → lib}/admin/assets/js/tmclicktotweet_plugin.js RENAMED
File without changes
{functions → lib}/admin/swp_system_checker.php RENAMED
File without changes
{functions → lib}/frontend-output/SWP_Buttons_Panel.php RENAMED
@@ -136,9 +136,8 @@ class SWP_Buttons_Panel {
136
  *
137
  */
138
  private function localize_options() {
139
- global $swp_user_options;
140
- $this->options = array_merge( $swp_user_options, $this->args );
141
- $this->post_data['options'] = $swp_user_options;
142
  }
143
 
144
 
@@ -154,7 +153,15 @@ class SWP_Buttons_Panel {
154
  * @access public
155
  *
156
  */
157
- public function set_option( $option , $value ) {
 
 
 
 
 
 
 
 
158
  $this->options[$this->options] = $value;
159
  return $this;
160
  }
@@ -171,7 +178,12 @@ class SWP_Buttons_Panel {
171
  * @access public
172
  *
173
  */
174
- public function set_options( $options ) {
 
 
 
 
 
175
  array_merge( $this->options , $options );
176
  return $this;
177
  }
@@ -189,30 +201,32 @@ class SWP_Buttons_Panel {
189
  * @access public
190
  *
191
  */
192
- public function establish_post_id() {
193
- // Legacy support.
194
- if ( isset( $this->args['postID'] ) ) :
195
- $this->post_id = $this->args['postID'];
196
- return;
197
- endif;
198
 
199
- // Current argument.
200
- if ( isset( $this->args['post_id'] ) ) :
201
- $this->post_id = $this->args['post_id'];
202
- return;
203
- endif;
204
 
205
- if ( isset ( $this->args['id'] ) ) :
206
- $this->post_id = $this->args['id'];
207
- return;
 
 
 
 
 
 
 
208
  endif;
209
 
210
- global $post;
211
-
212
  if ( is_object( $post ) ) :
213
  $this->post_id = $post->ID;
214
  endif;
215
- }
216
 
217
 
218
  /**
@@ -256,7 +270,7 @@ class SWP_Buttons_Panel {
256
  public function establish_share_data() {
257
  global $SWP_Post_Caches;
258
  $this->shares = $SWP_Post_Caches->get_post_cache( $this->post_id )->get_shares();
259
- // echo "The post cache", var_dump($SWP_Post_Caches->get_post_cache( $this->post_id ));
260
  return $this;
261
  }
262
 
@@ -338,19 +352,25 @@ class SWP_Buttons_Panel {
338
  *
339
  */
340
  // If we are on the home page
341
- if( is_front_page() ):
342
  $home = $this->options['location_home'];
343
  $this->location = isset( $home ) ? $home : 'none';
 
 
344
  endif;
345
 
 
346
  // If we are on a singular page
347
- if ( is_singular() && !is_front_page() ) :
348
  $location = $this->options[ 'location_' . $this->post_data['post_type'] ];
 
349
  if ( isset( $location ) ) :
350
  $this->location = $location;
351
  endif;
 
352
  endif;
353
 
 
354
  if ( is_archive() || is_home() ) :
355
  $this->location = $this->options['location_archive_categories'];
356
  endif;
@@ -378,38 +398,6 @@ class SWP_Buttons_Panel {
378
  }
379
 
380
 
381
- /**
382
- * When we have known incompatability with other themes/plugins,
383
- * we can put those checks in here.
384
- *
385
- * Checks for known conflicts with other plugins and themes.
386
- *
387
- * If there is a fatal conflict, returns true and exits printing.
388
- * If there are other conflicts, they are silently handled and can still
389
- * print.
390
- *
391
- * @since 3.0.0 | 01 MAR 2018 | Created
392
- * @param void
393
- * @return bool $conflict True iff the conflict is fatal.
394
- *
395
- */
396
- protected function has_plugin_conflict() {
397
-
398
- // Disable subtitles plugin to prevent it from injecting subtitles
399
- // into our share titles.
400
- if ( is_plugin_active( 'subtitles/subtitles.php' ) && class_exists( 'Subtitles' ) ) :
401
- remove_filter( 'the_title', array( Subtitles::getinstance(), 'the_subtitle' ), 10, 2 );
402
- endif;
403
-
404
- //* Disable on BuddyPress pages.
405
- if ( function_exists( 'is_buddypress' ) && is_buddypress() ) :
406
- return true;
407
- endif;
408
-
409
- return false;
410
- }
411
-
412
-
413
  /**
414
  * Tells you true/false if the buttons should print on this page.
415
  *
@@ -437,7 +425,7 @@ class SWP_Buttons_Panel {
437
 
438
  $user_settings = $this->location !== 'none';
439
 
440
- $desired_conditions = is_main_query() && in_the_loop() && get_post_status( $this->post_id ) === 'publish';
441
 
442
  $undesired_conditions = is_admin() || is_feed() || is_search() || is_attachment();
443
 
@@ -462,51 +450,43 @@ class SWP_Buttons_Panel {
462
  endif;
463
 
464
  $style = "";
 
465
 
466
- if ( !$this->should_print() ) :
467
- //* Top and bottom floating buttons require a button panel present on the page.
468
- $float_location = $this->get_float_location();
 
469
 
470
- if ( true === $this->option( 'floating_panel' ) && 'top' == $float_location || 'bottom' == $float_location ) :
471
- //* Using display: none interfere's with the element's position,
472
- //* Which we need to be calculated correctly.
473
- $style = 'opacity: 0;';
474
- else :
475
- return $this->content;
476
- endif;
477
- endif;
478
 
479
  // Create the HTML Buttons panel wrapper
480
- $container = '<div class="swp_social_panel swp_' . $this->option('button_shape') .
481
- ' swp_default_' . $this->option('default_colors') .
482
- ' swp_individual_' . $this->option('single_colors') .
483
- ' swp_other_' . $this->option('hover_colors') .
484
- ' scale-' . $this->option('button_size') * 100 .
485
- ' scale-' . $this->option('button_alignment') .
486
- '" style="' . $style .
487
- '" data-min-width="' . $this->option('float_screen_width') .
488
- '" data-panel-position="' . $this->option('location_post') .
489
  '" data-float="' . $this->get_float_location() .
490
  '" data-float-mobile="' . $this->get_mobile_float_location() .
491
- '" data-count="' . $this->total_shares .
492
- '" data-float-color="' . $this->option('float_background_color') . '
493
- ">';
494
- //* This should be inserted via addon, not here.
495
- //'" data-emphasize="'.$this->option('emphasize_icons').'
496
-
497
- $total_shares_html = $this->render_total_shares_html();
498
- $buttons = $this->render_buttons_html();
499
-
500
- if ($this->option('totals_alignment') === 'totals_left') :
501
- $buttons = $total_shares_html . $buttons;
502
- else:
503
- $buttons .= $total_shares_html;
504
- endif;
505
 
506
  $html = $container . $buttons . '</div>';
507
  $this->html = $html;
508
  if ( $echo ) :
509
- if( true == _swp_is_debug('buttons_output')):
510
  echo 'Echoing, not returning. In SWP_Buttons_Panel on line '.__LINE__;
511
  endif;
512
  echo $html;
@@ -516,6 +496,69 @@ class SWP_Buttons_Panel {
516
  }
517
 
518
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
  /**
520
  * A function to avoid getting undefined index notices.
521
  *
@@ -525,16 +568,10 @@ class SWP_Buttons_Panel {
525
  *
526
  */
527
  private function option($key) {
528
-
529
- $defaults = array();
530
- $defaults = apply_filters('swp_options_page_defaults' , $defaults );
531
-
532
  if( isset( $this->options[$key] ) ):
533
  return $this->options[$key];
534
- elseif( isset( $defaults[$key] ) ):
535
- return $defaults[$key];
536
  else:
537
- return false;
538
  endif;
539
  }
540
 
@@ -564,7 +601,7 @@ class SWP_Buttons_Panel {
564
 
565
  if( is_array( $post_setting ) ) :
566
  $post_setting = $post_setting[0];
567
- endif;
568
 
569
  // If the location is set in the post options, use that.
570
  if ( !empty( $post_setting ) && 'default' != $post_setting ) {
@@ -598,13 +635,11 @@ class SWP_Buttons_Panel {
598
  *
599
  */
600
  public function get_mobile_float_location() {
601
- if( is_home() || is_front_page() ):
602
- return 'none';
603
- elseif( is_single() && true == $this->option('floating_panel') && 'on' == $this->option('float_location_' . $this->post_data['post_type'] ) ):
604
  return $this->option('float_mobile');
605
- else:
606
- return 'none';
607
  endif;
 
 
608
  }
609
 
610
 
@@ -636,21 +671,13 @@ class SWP_Buttons_Panel {
636
  $max_buttons = 5;
637
  endif;
638
 
639
- // Acquire the social stats from the networks
640
- if ( isset( $array['url'] ) ) :
641
- $buttonsArray['url'] = $array['url'];
642
- else :
643
- $buttonsArray['url'] = get_permalink( $this->post_id );
644
- endif;
645
 
646
  if ( 'none' != $this->get_float_location() ) :
647
  $float_location = $this->option('float_location');
648
  $class = "swp_float_" . $this->option('float_location');
649
- else :
650
- // $float_location = 'ignore';
651
  endif;
652
 
653
- if ( $this->options['float_style_source'] == true ) :
654
  $this->options['float_default_colors'] = $this->option('default_colors');
655
  $this->options['float_single_colors'] = $this->option('single_colors');
656
  $this->options['float_hover_colors'] = $this->option('hover_colors');
@@ -672,11 +699,9 @@ class SWP_Buttons_Panel {
672
  $share_counts = $this->render_total_shares_HTML();
673
  $buttons = $this->render_buttons_HTML( (int) $max_buttons );
674
 
675
- $container = '<div class="swp_social_panelSide swp_social_panel swp_'. $this->option('float_button_shape') .
676
- ' swp_default_' . $this->option('float_default_colors') .
677
- ' swp_individual_' . $this->option('float_single_colors') .
678
- ' swp_other_' . $this->option('float_hover_colors') . '
679
- ' . $this->option('transition') . '
680
  ' . $class . '
681
  ' . '" data-panel-position="' . $this->option('location_post') .
682
  ' scale-' . $this->option('float_size') * 100 .
@@ -742,17 +767,16 @@ class SWP_Buttons_Panel {
742
 
743
  //* Use global button settings.
744
  else :
745
-
746
  // Order manually using the user's specified order.
747
- if ( $this->options['order_of_icons_method'] === 'manual' ) :
748
- $order = $this->options['order_of_icons'];
749
 
750
  // Order them dynamically according to share counts.
751
  else :
752
  $order = $this->get_dynamic_buttons_order();
753
  endif;
754
 
755
- $network_objects = $this->order_network_objects($order);
756
  endif;
757
 
758
  $this->networks = $network_objects;
@@ -790,15 +814,21 @@ class SWP_Buttons_Panel {
790
 
791
 
792
  /**
793
- * A method to shuffle the array of network objects.
794
  *
795
  * @since 3.0.0 | 04 MAY 2018 | Created
 
796
  * @param array $order An ordered array of network keys.
797
  * @return array An ordered array of network objects.
798
  *
799
  */
800
- public function order_network_objects( $order ) {
801
  $network_objects = array();
 
 
 
 
 
802
  foreach( $order as $network_key ) {
803
  foreach( $this->networks as $key => $network ) :
804
  if ( $key === $network_key ) :
@@ -806,6 +836,7 @@ class SWP_Buttons_Panel {
806
  endif;
807
  endforeach;
808
  }
 
809
  return $network_objects;
810
  }
811
 
@@ -837,12 +868,12 @@ class SWP_Buttons_Panel {
837
  *
838
  * @since 3.0.0 | 18 APR 2018 | Created
839
  * @param none
 
840
  * @return string $html The fully qualified HTML to display share counts.
841
- * @todo Simplify that conditional. Maybe break it into another method.
842
  *
843
  */
844
  public function render_total_shares_html() {
845
- $buttons = isset( $this->args['buttons'] ) ? $this->args['buttons'] : array();
846
 
847
  if ( false == $this->option('total_shares') ) {
848
  return '';
@@ -859,7 +890,7 @@ class SWP_Buttons_Panel {
859
  }
860
 
861
  $html = '<div class="nc_tweetContainer total_shares total_sharesalt" >';
862
- $html .= '<span class="swp_count ">' . swp_kilomega( $this->shares['total_shares'] ) . ' <span class="swp_label">' . __( 'Shares','social-warfare' ) . '</span></span>';
863
  $html .= '</div>';
864
 
865
  return $html;
@@ -875,17 +906,26 @@ class SWP_Buttons_Panel {
875
  *
876
  */
877
  public function do_print() {
878
-
879
  $this->render_HTML();
880
 
881
  //* Add the Panel markup based on the location.
882
- if ( $this->location === 'both' ) :
883
- $content = $this->html . $this->content . $this->html;
884
- elseif ( $this->location === 'above' ) :
885
- $content = $this->html . $this->content;
886
- else :
887
- $content = $this->content . $this->html;
888
- endif;
 
 
 
 
 
 
 
 
 
 
889
 
890
  $this->content = $content;
891
 
@@ -919,9 +959,7 @@ class SWP_Buttons_Panel {
919
  $this->args['content'] = $content;
920
  endif;
921
 
922
- if ( $this->has_plugin_conflict() ) {
923
- return;
924
- }
925
 
926
  return $this->do_print();
927
  }
@@ -936,7 +974,7 @@ class SWP_Buttons_Panel {
936
  *
937
  */
938
  public function debug() {
939
- if ( true === _swp_is_debug( 'buttons_panel' ) ) :
940
  echo "<pre>";
941
  var_dump($this);
942
  echo "</pre>";
136
  *
137
  */
138
  private function localize_options() {
139
+ global $swp_user_options;
140
+ $this->options = array_merge( $swp_user_options, $this->args);
 
141
  }
142
 
143
 
153
  * @access public
154
  *
155
  */
156
+ public function set_option( $option = '', $value = null ) {
157
+ if ( empty( $option ) ) :
158
+ $message = "Hey developer, " . __CLASS__ . __METHOD__ . " a first paramter $option (string) and \$value (mixed). You provided " . gettype($value) . ".";
159
+ throw new Exception($message);
160
+ elseif ( null == $value ) :
161
+ $message = "Hey developer, " . __CLASS__ . __METHOD__ . " a second paramter: \$value (mixed type). You provided " . gettype($value) . ".";
162
+ throw new Exception($message);
163
+ endif;
164
+
165
  $this->options[$this->options] = $value;
166
  return $this;
167
  }
178
  * @access public
179
  *
180
  */
181
+ public function set_options( $options = array() ) {
182
+ if ( !is_array( $options) ) :
183
+ $message = "Hey developer, " . __CLASS__ . __METHOD__ . " requires an arry of options. You provided " . gettype($options) . ".";
184
+ throw new Exception($message);
185
+ endif;
186
+
187
  array_merge( $this->options , $options );
188
  return $this;
189
  }
201
  * @access public
202
  *
203
  */
204
+ public function establish_post_id() {
205
+ global $post;
 
 
 
 
206
 
207
+ if ( isset( $this->args['url'] ) ) :
208
+ if ( $id = url_to_postid( $this->args['url'] ) ) :
209
+ return $this->post_id = $id;
210
+ endif;
211
+ endif;
212
 
213
+ // Legacy support.
214
+ if ( isset( $this->args['postid'] ) ) :
215
+ return $this->post_id = $this->args['postid'];
216
+ endif;
217
+ // Current argument.
218
+ if ( isset( $this->args['post_id'] ) && is_numeric( $this->args['post_id'] ) ) :
219
+ return $this->post_id = $this->args['post_id'];
220
+ endif;
221
+ if ( isset( $this->args['id'] ) && is_numeric( $this->args['id'] ) ) :
222
+ return $this->post_id = $this->args['id'];
223
  endif;
224
 
225
+ //* We weren't provided any context for an ID, so default to the post.
 
226
  if ( is_object( $post ) ) :
227
  $this->post_id = $post->ID;
228
  endif;
229
+ }
230
 
231
 
232
  /**
270
  public function establish_share_data() {
271
  global $SWP_Post_Caches;
272
  $this->shares = $SWP_Post_Caches->get_post_cache( $this->post_id )->get_shares();
273
+
274
  return $this;
275
  }
276
 
352
  *
353
  */
354
  // If we are on the home page
355
+ if( is_front_page() ) :
356
  $home = $this->options['location_home'];
357
  $this->location = isset( $home ) ? $home : 'none';
358
+
359
+ return;
360
  endif;
361
 
362
+
363
  // If we are on a singular page
364
+ if ( is_singular() ) :
365
  $location = $this->options[ 'location_' . $this->post_data['post_type'] ];
366
+
367
  if ( isset( $location ) ) :
368
  $this->location = $location;
369
  endif;
370
+
371
  endif;
372
 
373
+
374
  if ( is_archive() || is_home() ) :
375
  $this->location = $this->options['location_archive_categories'];
376
  endif;
398
  }
399
 
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  /**
402
  * Tells you true/false if the buttons should print on this page.
403
  *
425
 
426
  $user_settings = $this->location !== 'none';
427
 
428
+ $desired_conditions = is_main_query() && get_post_status( $this->post_id ) === 'publish';
429
 
430
  $undesired_conditions = is_admin() || is_feed() || is_search() || is_attachment();
431
 
450
  endif;
451
 
452
  $style = "";
453
+ $float_mobile = SWP_Utility::get_option( 'float_mobile');
454
 
455
+ if ( !$this->should_print() && ( 'top' == $float_mobile || 'bottom' == $float_mobile ) ) :
456
+ if ( true !== $this->option( 'floating_panel' ) ) :
457
+ return $this->content;
458
+ endif;
459
 
460
+ $style = ' opacity: 0; ';
461
+ endif;
 
 
 
 
 
 
462
 
463
  // Create the HTML Buttons panel wrapper
464
+ $container = '<div class="swp_social_panel swp_horizontal_panel ' .
465
+ $this->get_shape() .
466
+ $this->get_colors() .
467
+ $this->get_scale() .
468
+ '" ' . // end CSS classes
469
+ $this->get_min_width() .
470
+ $this->get_float_background() .
471
+ //* These below two data-attribute methods are inconsistent. But they
472
+ //* already existed and are used elsewhere, so I'm not touching them.
473
  '" data-float="' . $this->get_float_location() .
474
  '" data-float-mobile="' . $this->get_mobile_float_location() .
475
+ '" style="' . $style . '" >';
476
+
477
+ $total_shares_html = $this->render_total_shares_html();
478
+ $buttons = $this->render_buttons_html();
479
+
480
+ if ($this->option('totals_alignment') === 'totals_left') :
481
+ $buttons = $total_shares_html . $buttons;
482
+ else:
483
+ $buttons .= $total_shares_html;
484
+ endif;
 
 
 
 
485
 
486
  $html = $container . $buttons . '</div>';
487
  $this->html = $html;
488
  if ( $echo ) :
489
+ if( true == SWP_Utility::debug('buttons_output')):
490
  echo 'Echoing, not returning. In SWP_Buttons_Panel on line '.__LINE__;
491
  endif;
492
  echo $html;
496
  }
497
 
498
 
499
+ protected function get_colors() {
500
+ $default_colors = $this->option( 'default_colors' );
501
+
502
+ //* They have gone from an Addon to Core.
503
+ if ( false === $default_colors ) :
504
+ return " swp_default_full_color
505
+ swp_individual_full_color
506
+ swp_other_full_color ";
507
+ endif;
508
+
509
+
510
+ return " swp_default_{$default_colors}
511
+ swp_individual_{$this->option( 'single_colors' )}
512
+ swp_other_{$this->option( 'hover_colors' )} ";
513
+ }
514
+
515
+
516
+ protected function get_shape() {
517
+ $button_shape = $this->option( 'button_shape' );
518
+
519
+ //* They have gone from an Addon to Core.
520
+ if ( false === $button_shape ) :
521
+ return " swp_flat_fresh ";
522
+ endif;
523
+
524
+ return " swp_{$button_shape} ";
525
+ }
526
+
527
+ protected function get_scale() {
528
+ $button_size = $this->option( 'button_size' );
529
+
530
+ //* They have gone from an Addon to Core.
531
+ if ( false === $button_size ) :
532
+ return " scale-100 ";
533
+ endif;
534
+
535
+ return ' scale-' . $button_size * 100;
536
+ }
537
+
538
+ protected function get_min_width() {
539
+ $min_width = $this->option( 'float_screen_width' );
540
+
541
+ //* They have gone from an Addon to Core.
542
+ if ( false === $min_width ) :
543
+ return 'data-min-width="1100" ';
544
+ endif;
545
+
546
+ return " data-min-width='{$min_width}' ";
547
+ }
548
+
549
+ protected function get_float_background() {
550
+ $float_background_color = $this->option( 'float_background_color' );
551
+
552
+ //* They have gone from an Addon to Core.
553
+ if ( false === $float_background_color ) :
554
+ return " ";
555
+ endif;
556
+
557
+ return '" data-float-color="' . $float_background_color;
558
+ }
559
+
560
+
561
+
562
  /**
563
  * A function to avoid getting undefined index notices.
564
  *
568
  *
569
  */
570
  private function option($key) {
 
 
 
 
571
  if( isset( $this->options[$key] ) ):
572
  return $this->options[$key];
 
 
573
  else:
574
+ return SWP_Utility::get_option( $key );
575
  endif;
576
  }
577
 
601
 
602
  if( is_array( $post_setting ) ) :
603
  $post_setting = $post_setting[0];
604
+ endif;
605
 
606
  // If the location is set in the post options, use that.
607
  if ( !empty( $post_setting ) && 'default' != $post_setting ) {
635
  *
636
  */
637
  public function get_mobile_float_location() {
638
+ if( is_single() && true == $this->option('floating_panel') && 'on' == $this->option('float_location_' . $this->post_data['post_type'] ) ):
 
 
639
  return $this->option('float_mobile');
 
 
640
  endif;
641
+
642
+ return 'none';
643
  }
644
 
645
 
671
  $max_buttons = 5;
672
  endif;
673
 
 
 
 
 
 
 
674
 
675
  if ( 'none' != $this->get_float_location() ) :
676
  $float_location = $this->option('float_location');
677
  $class = "swp_float_" . $this->option('float_location');
 
 
678
  endif;
679
 
680
+ if ( isset( $this->options['float_style_source'] ) && true == $this->options['float_style_source'] ) :
681
  $this->options['float_default_colors'] = $this->option('default_colors');
682
  $this->options['float_single_colors'] = $this->option('single_colors');
683
  $this->options['float_hover_colors'] = $this->option('hover_colors');
699
  $share_counts = $this->render_total_shares_HTML();
700
  $buttons = $this->render_buttons_HTML( (int) $max_buttons );
701
 
702
+ $container = '<div class="swp_social_panelSide swp_floating_panel swp_social_panel swp_' . $this->option('float_button_shape') .
703
+ $this->get_colors() .
704
+ $this->option('transition') . '
 
 
705
  ' . $class . '
706
  ' . '" data-panel-position="' . $this->option('location_post') .
707
  ' scale-' . $this->option('float_size') * 100 .
767
 
768
  //* Use global button settings.
769
  else :
 
770
  // Order manually using the user's specified order.
771
+ if ( !isset( $this->options['order_of_icons_method'] ) || $this->options['order_of_icons_method'] === 'manual' ) :
772
+ $order = SWP_Utility::get_option( 'order_of_icons' );
773
 
774
  // Order them dynamically according to share counts.
775
  else :
776
  $order = $this->get_dynamic_buttons_order();
777
  endif;
778
 
779
+ $network_objects = $this->get_ordered_network_objects( $order );
780
  endif;
781
 
782
  $this->networks = $network_objects;
814
 
815
 
816
  /**
817
+ * A method to arrange the array of network objects in proper order.
818
  *
819
  * @since 3.0.0 | 04 MAY 2018 | Created
820
+ * @since 3.3.0 | 30 AUG 2018 | Renamed from 'order_network_objects' to 'get_ordered_network_objects'
821
  * @param array $order An ordered array of network keys.
822
  * @return array An ordered array of network objects.
823
  *
824
  */
825
+ public function get_ordered_network_objects( $order ) {
826
  $network_objects = array();
827
+
828
+ if ( empty( $order ) ) :
829
+ $order = SWP_Utility::get_option( 'order_of_icons' );
830
+ endif;
831
+
832
  foreach( $order as $network_key ) {
833
  foreach( $this->networks as $key => $network ) :
834
  if ( $key === $network_key ) :
836
  endif;
837
  endforeach;
838
  }
839
+
840
  return $network_objects;
841
  }
842
 
868
  *
869
  * @since 3.0.0 | 18 APR 2018 | Created
870
  * @param none
871
+ *
872
  * @return string $html The fully qualified HTML to display share counts.
 
873
  *
874
  */
875
  public function render_total_shares_html() {
876
+ $buttons = isset( $this->args['buttons'] ) ? strtolower( $this->args['buttons'] ) : array();
877
 
878
  if ( false == $this->option('total_shares') ) {
879
  return '';
890
  }
891
 
892
  $html = '<div class="nc_tweetContainer total_shares total_sharesalt" >';
893
+ $html .= '<span class="swp_count ">' . SWP_Utility::kilomega( $this->shares['total_shares'] ) . ' <span class="swp_label">' . __( 'Shares','social-warfare' ) . '</span></span>';
894
  $html .= '</div>';
895
 
896
  return $html;
906
  *
907
  */
908
  public function do_print() {
 
909
  $this->render_HTML();
910
 
911
  //* Add the Panel markup based on the location.
912
+ switch ($this->location) {
913
+ case 'both' :
914
+ $content = $this->html . $this->content . $this->html;
915
+ break;
916
+ case 'above' :
917
+ $content = $this->html . $this->content;
918
+ break;
919
+ case 'below' :
920
+ $content = $this->content . $this->html;
921
+ break;
922
+
923
+ case 'none' :
924
+ $content = $this->content;
925
+ default :
926
+ $content = $this->content;
927
+ break;
928
+ }
929
 
930
  $this->content = $content;
931
 
959
  $this->args['content'] = $content;
960
  endif;
961
 
962
+
 
 
963
 
964
  return $this->do_print();
965
  }
974
  *
975
  */
976
  public function debug() {
977
+ if ( true === SWP_Utility::debug( 'buttons_panel' ) ) :
978
  echo "<pre>";
979
  var_dump($this);
980
  echo "</pre>";
{functions → lib}/frontend-output/SWP_Display.php RENAMED
@@ -45,8 +45,6 @@ class SWP_Display {
45
  *
46
  */
47
  public function __construct() {
48
-
49
-
50
  // The global array of posts that have already been processed.
51
  global $swp_already_print;
52
 
@@ -78,18 +76,19 @@ class SWP_Display {
78
  *
79
  */
80
  public function activate_buttons() {
81
- // Fetch the user's settings
82
- global $swp_user_options;
 
83
 
84
  // Only hook into the_content filter if is_singular() is true or
85
  // they don't use excerpts on the archive pages.
86
- if( true === is_singular() || true === $swp_user_options['full_content'] ):
87
  add_filter( 'the_content', array( $this, 'social_warfare_wrapper' ) , 20 );
88
  add_filter( 'the_content', array( $this, 'add_content_locator' ), 20);
89
  endif;
90
 
91
  // If we're not on is_singlular, we'll hook into the excerpt.
92
- if (false === is_singular() && false === $swp_user_options['full_content']) {
93
  // Add the buttons to the excerpts
94
  add_filter( 'the_excerpt', array( $this, 'social_warfare_wrapper' ) );
95
  }
@@ -119,7 +118,6 @@ class SWP_Display {
119
  *
120
  */
121
  public function social_warfare_wrapper( $content ) {
122
-
123
  // The global WordPress post object.
124
  global $post;
125
 
@@ -130,6 +128,7 @@ class SWP_Display {
130
 
131
  // Pass the content to the buttons constructor to place them inside.
132
  $buttons_panel = new SWP_Buttons_Panel( array( 'content' => $content ) );
 
133
  return $buttons_panel->the_buttons( $content );
134
  }
135
 
@@ -143,6 +142,9 @@ class SWP_Display {
143
  *
144
  */
145
  function floating_buttons() {
 
 
 
146
 
147
  // Instantiate a new Buttons Panel.
148
  $side_panel = new SWP_Buttons_Panel( array( 'content' => "" ) );
45
  *
46
  */
47
  public function __construct() {
 
 
48
  // The global array of posts that have already been processed.
49
  global $swp_already_print;
50
 
76
  *
77
  */
78
  public function activate_buttons() {
79
+ if ( Social_Warfare::has_plugin_conflict() ) :
80
+ return;
81
+ endif;
82
 
83
  // Only hook into the_content filter if is_singular() is true or
84
  // they don't use excerpts on the archive pages.
85
+ if( true === is_singular() || true === SWP_Utility::get_option( 'full_content' ) ):
86
  add_filter( 'the_content', array( $this, 'social_warfare_wrapper' ) , 20 );
87
  add_filter( 'the_content', array( $this, 'add_content_locator' ), 20);
88
  endif;
89
 
90
  // If we're not on is_singlular, we'll hook into the excerpt.
91
+ if (false === is_singular() && false === SWP_Utility::get_option( 'full_content' ) ) {
92
  // Add the buttons to the excerpts
93
  add_filter( 'the_excerpt', array( $this, 'social_warfare_wrapper' ) );
94
  }
118
  *
119
  */
120
  public function social_warfare_wrapper( $content ) {
 
121
  // The global WordPress post object.
122
  global $post;
123
 
128
 
129
  // Pass the content to the buttons constructor to place them inside.
130
  $buttons_panel = new SWP_Buttons_Panel( array( 'content' => $content ) );
131
+
132
  return $buttons_panel->the_buttons( $content );
133
  }
134
 
142
  *
143
  */
144
  function floating_buttons() {
145
+ if ( Social_Warfare::has_plugin_conflict() ) :
146
+ return;
147
+ endif;
148
 
149
  // Instantiate a new Buttons Panel.
150
  $side_panel = new SWP_Buttons_Panel( array( 'content' => "" ) );
{functions → lib}/frontend-output/SWP_Header_Output.php RENAMED
@@ -134,8 +134,8 @@ class SWP_Header_Output {
134
  return $info;
135
  endif;
136
 
137
- $style = '<style>@font-face {font-family: "sw-icon-font";src:url("' . SWP_PLUGIN_URL . '/fonts/sw-icon-font.eot?ver=' . SWP_VERSION . '");src:url("' . SWP_PLUGIN_URL . '/fonts/sw-icon-font.eot?ver=' . SWP_VERSION . '#iefix") format("embedded-opentype"),url("' . SWP_PLUGIN_URL . '/fonts/sw-icon-font.woff?ver=' . SWP_VERSION . '") format("woff"),
138
- url("' . SWP_PLUGIN_URL . '/fonts/sw-icon-font.ttf?ver=' . SWP_VERSION . '") format("truetype"),url("' . SWP_PLUGIN_URL . '/fonts/sw-icon-font.svg?ver=' . SWP_VERSION . '#1445203416") format("svg");font-weight: normal;font-style: normal;}</style>';
139
 
140
  if ( true === is_admin() ) {
141
  echo $style;
134
  return $info;
135
  endif;
136
 
137
+ $style = '<style>@font-face {font-family: "sw-icon-font";src:url("' . SWP_PLUGIN_URL . '/assets/fonts/sw-icon-font.eot?ver=' . SWP_VERSION . '");src:url("' . SWP_PLUGIN_URL . '/assets/fonts/sw-icon-font.eot?ver=' . SWP_VERSION . '#iefix") format("embedded-opentype"),url("' . SWP_PLUGIN_URL . '/assets/fonts/sw-icon-font.woff?ver=' . SWP_VERSION . '") format("woff"),
138
+ url("' . SWP_PLUGIN_URL . '/assets/fonts/sw-icon-font.ttf?ver=' . SWP_VERSION . '") format("truetype"),url("' . SWP_PLUGIN_URL . '/assets/fonts/sw-icon-font.svg?ver=' . SWP_VERSION . '#1445203416") format("svg");font-weight: normal;font-style: normal;}</style>';
139
 
140
  if ( true === is_admin() ) {
141
  echo $style;
{functions → lib}/frontend-output/SWP_Option_Page_Registration.php RENAMED
File without changes
{functions → lib}/frontend-output/SWP_Script.php RENAMED
@@ -67,7 +67,7 @@ class SWP_Script {
67
  public static function get_suffix() {
68
  $debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
69
 
70
- if ( _swp_is_debug( 'script' ) ) {
71
  $debug = true;
72
  }
73
 
@@ -86,20 +86,18 @@ class SWP_Script {
86
  * @return void
87
  */
88
  public function enqueue_scripts() {
89
- $options = get_option( 'social_warfare_settings ', array() );
90
-
91
  $suffix = SWP_Script::get_suffix();
92
 
93
  wp_enqueue_style(
94
  'social_warfare',
95
- SWP_PLUGIN_URL . "/css/style{$suffix}.css",
96
  array(),
97
  SWP_VERSION
98
  );
99
 
100
  wp_enqueue_script(
101
  'social_warfare_script',
102
- SWP_PLUGIN_URL . "/js/script{$suffix}.js",
103
  array( 'jquery' ),
104
  SWP_VERSION,
105
  true
@@ -124,14 +122,14 @@ class SWP_Script {
124
 
125
  wp_enqueue_style(
126
  'social_warfare_admin',
127
- SWP_PLUGIN_URL . "/css/admin{$suffix}.css",
128
  array(),
129
  SWP_VERSION
130
  );
131
 
132
  wp_enqueue_script(
133
  'social_warfare_admin_script',
134
- SWP_PLUGIN_URL . "/js/admin{$suffix}.js",
135
  array( 'jquery' ),
136
  SWP_VERSION
137
  );
@@ -153,8 +151,6 @@ class SWP_Script {
153
  *
154
  */
155
  public function footer_functions() {
156
- $options = get_option( 'social_warfare_settings ', array() );
157
-
158
  // Fetch a few variables.
159
  $info['postID'] = get_the_ID();
160
  $info['footer_output'] = '';
@@ -181,7 +177,8 @@ class SWP_Script {
181
  *
182
  */
183
  public function click_tracking( $info ) {
184
- $options = get_option( 'social_warfare_settings', array() );
 
185
 
186
  // Output the JS variable for click tracking if it is turned on.
187
  if ( isset( $options['click_tracking'] ) && true === $options['click_tracking'] ) {
@@ -204,7 +201,8 @@ class SWP_Script {
204
  *
205
  */
206
  public function frame_buster( $info ) {
207
- $options = get_option( 'social_warfare_settings ', array() );
 
208
 
209
  if ( true === $options['frame_buster'] ) :
210
  $info['footer_output'] .= PHP_EOL . 'function parentIsEvil() { var html = null; try { var doc = top.location.pathname; } catch(err){ }; if(typeof doc === "undefined") { return true } else { return false }; }; if (parentIsEvil()) { top.location = self.location.href; };var url = "' . get_permalink() . '";if(url.indexOf("stfi.re") != -1) { var canonical = ""; var links = document.getElementsByTagName("link"); for (var i = 0; i < links.length; i ++) { if (links[i].getAttribute("rel") === "canonical") { canonical = links[i].getAttribute("href")}}; canonical = canonical.replace("?sfr=1", "");top.location = canonical; console.log(canonical);};';
@@ -265,7 +263,9 @@ class SWP_Script {
265
  *
266
  */
267
  public function float_before_content( $vars ) {
268
- $options = get_option( 'social_warfare_settings ', array() );
 
 
269
  $float_before_content = $options['float_before_content'];
270
 
271
  $vars['footer_output'] = "var swpFloatBeforeContent = " . json_encode($float_before_content) . ";";
67
  public static function get_suffix() {
68
  $debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
69
 
70
+ if ( SWP_Utility::debug( 'script' ) ) {
71
  $debug = true;
72
  }
73
 
86
  * @return void
87
  */
88
  public function enqueue_scripts() {
 
 
89
  $suffix = SWP_Script::get_suffix();
90
 
91
  wp_enqueue_style(
92
  'social_warfare',
93
+ SWP_PLUGIN_URL . "/assets/css/style{$suffix}.css",
94
  array(),
95
  SWP_VERSION
96
  );
97
 
98
  wp_enqueue_script(
99
  'social_warfare_script',
100
+ SWP_PLUGIN_URL . "/assets/js/script{$suffix}.js",
101
  array( 'jquery' ),
102
  SWP_VERSION,
103
  true
122
 
123
  wp_enqueue_style(
124
  'social_warfare_admin',
125
+ SWP_PLUGIN_URL . "/assets/css/admin{$suffix}.css",
126
  array(),
127
  SWP_VERSION
128
  );
129
 
130
  wp_enqueue_script(
131
  'social_warfare_admin_script',
132
+ SWP_PLUGIN_URL . "/assets/js/admin{$suffix}.js",
133
  array( 'jquery' ),
134
  SWP_VERSION
135
  );
151
  *
152
  */
153
  public function footer_functions() {
 
 
154
  // Fetch a few variables.
155
  $info['postID'] = get_the_ID();
156
  $info['footer_output'] = '';
177
  *
178
  */
179
  public function click_tracking( $info ) {
180
+ global $swp_user_options;
181
+ $options = $swp_user_options;
182
 
183
  // Output the JS variable for click tracking if it is turned on.
184
  if ( isset( $options['click_tracking'] ) && true === $options['click_tracking'] ) {
201
  *
202
  */
203
  public function frame_buster( $info ) {
204
+ global $swp_user_options;
205
+ $options = $swp_user_options;
206
 
207
  if ( true === $options['frame_buster'] ) :
208
  $info['footer_output'] .= PHP_EOL . 'function parentIsEvil() { var html = null; try { var doc = top.location.pathname; } catch(err){ }; if(typeof doc === "undefined") { return true } else { return false }; }; if (parentIsEvil()) { top.location = self.location.href; };var url = "' . get_permalink() . '";if(url.indexOf("stfi.re") != -1) { var canonical = ""; var links = document.getElementsByTagName("link"); for (var i = 0; i < links.length; i ++) { if (links[i].getAttribute("rel") === "canonical") { canonical = links[i].getAttribute("href")}}; canonical = canonical.replace("?sfr=1", "");top.location = canonical; console.log(canonical);};';
263
  *
264
  */
265
  public function float_before_content( $vars ) {
266
+ global $swp_user_options;
267
+ $options = $swp_user_options;
268
+
269
  $float_before_content = $options['float_before_content'];
270
 
271
  $vars['footer_output'] = "var swpFloatBeforeContent = " . json_encode($float_before_content) . ";";
{functions → lib}/frontend-output/SWP_Shortcode.php RENAMED
@@ -38,7 +38,7 @@ class SWP_Shortcode {
38
  *
39
  */
40
  add_shortcode( 'clickToTweet', array($this, 'click_to_tweet' ) );
41
- add_shortcode( 'socialWarfare', array($this, 'buttons_shortcode_legacy' ) );
42
 
43
  }
44
 
@@ -78,25 +78,6 @@ class SWP_Shortcode {
78
  }
79
 
80
 
81
- /**
82
- * This is the legacy version of the social warfare button
83
- * shortcodes. It is used for nothing more than to call the
84
- * new version of the function. See above: $this->buttons_shortcode().
85
- *
86
- * This function will accept an array of arguments which WordPress
87
- * will create from the shortcode attributes.
88
- *
89
- * @since 3.0.0
90
- * @param $atts Array An array converted from shortcode attributes.
91
- * @return string The HTML of the Social Warfare buttons.
92
- *
93
- */
94
- public function buttons_shortcode_legacy( $settings ) {
95
-
96
- return $this->buttons_shortcode( array() );
97
- }
98
-
99
-
100
  /**
101
  * This is used to process the total shares across all tracked
102
  * social networks for any given WordPress post.
@@ -113,7 +94,7 @@ class SWP_Shortcode {
113
  */
114
  public function post_total_shares( $settings ) {
115
  $total_shares = get_post_meta( get_the_ID() , '_total_shares', true );
116
- $total_shares = swp_kilomega( $total_shares );
117
  return $total_shares;
118
  }
119
 
@@ -135,7 +116,7 @@ class SWP_Shortcode {
135
  public function sitewide_total_shares( $settings ) {
136
  global $wpdb;
137
  $sum = $wpdb->get_results( "SELECT SUM(meta_value) AS total FROM $wpdb->postmeta WHERE meta_key = '_total_shares'" );
138
- return swp_kilomega( $sum[0]->total );
139
  }
140
 
141
  /**
@@ -145,33 +126,34 @@ class SWP_Shortcode {
145
  * @return string The html of a click to tweet
146
  */
147
  function click_to_tweet( $atts ) {
148
- global $swp_user_options;
149
- $this->options = $swp_user_options;
150
 
151
  $url = SWP_URL_Management::process_url( get_permalink() , 'twitter' , get_the_ID() );
152
  (strpos( $atts['tweet'],'http' ) !== false ? $urlParam = '&url=/' : $urlParam = '&url=' . $url );
153
  $atts['tweet'] = rtrim( $atts['tweet'] );
154
 
 
 
155
  $user_twitter_handle = get_post_meta( get_the_ID() , 'swp_twitter_username' , true );
156
 
157
  if ( ! $user_twitter_handle ) :
158
- $user_twitter_handle = $this->options['twitter_id'];
159
  endif;
160
 
161
  if ( isset( $atts['theme'] ) && $atts['theme'] != 'default' ) :
162
  $theme = $atts['theme'];
163
  else :
164
- $theme = $this->options['ctt_theme'];
165
  endif;
166
 
167
- $text = urlencode( html_entity_decode( $atts['tweet'], ENT_COMPAT, 'UTF-8' ) ) . $urlParam ;
168
- $via = ($user_twitter_handle ? '&via=' . str_replace( '@','',$user_twitter_handle ) : '');
169
 
 
170
 
171
  $html = '<div class="sw-tweet-clear"></div>';
172
  $html .= '<a class="swp_CTT ' . $theme;
173
- $html .= '" href="https://twitter.com/share?text=' . $text . $via;
174
- $html .= '" data-link="https://twitter.com/share?text=' . $text . $via;
175
  $html .= '" rel="nofollow noreferrer noopener" target="_blank">';
176
  $html .= '<span class="sw-click-to-tweet">';
177
  $html .= '<span class="sw-ctt-text">';
@@ -186,4 +168,28 @@ class SWP_Shortcode {
186
 
187
  return $html;
188
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  }
38
  *
39
  */
40
  add_shortcode( 'clickToTweet', array($this, 'click_to_tweet' ) );
41
+ add_shortcode( 'socialWarfare', array($this, 'buttons_shortcode' ) );
42
 
43
  }
44
 
78
  }
79
 
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  /**
82
  * This is used to process the total shares across all tracked
83
  * social networks for any given WordPress post.
94
  */
95
  public function post_total_shares( $settings ) {
96
  $total_shares = get_post_meta( get_the_ID() , '_total_shares', true );
97
+ $total_shares = SWP_Utility::kilomega( $total_shares );
98
  return $total_shares;
99
  }
100
 
116
  public function sitewide_total_shares( $settings ) {
117
  global $wpdb;
118
  $sum = $wpdb->get_results( "SELECT SUM(meta_value) AS total FROM $wpdb->postmeta WHERE meta_key = '_total_shares'" );
119
+ return SWP_Utility::kilomega( $sum[0]->total );
120
  }
121
 
122
  /**
126
  * @return string The html of a click to tweet
127
  */
128
  function click_to_tweet( $atts ) {
129
+ global $post;
 
130
 
131
  $url = SWP_URL_Management::process_url( get_permalink() , 'twitter' , get_the_ID() );
132
  (strpos( $atts['tweet'],'http' ) !== false ? $urlParam = '&url=/' : $urlParam = '&url=' . $url );
133
  $atts['tweet'] = rtrim( $atts['tweet'] );
134
 
135
+ // die(var_dump($atts['tweet']));
136
+
137
  $user_twitter_handle = get_post_meta( get_the_ID() , 'swp_twitter_username' , true );
138
 
139
  if ( ! $user_twitter_handle ) :
140
+ $user_twitter_handle = SWP_Utility::get_option( 'twitter_id' );
141
  endif;
142
 
143
  if ( isset( $atts['theme'] ) && $atts['theme'] != 'default' ) :
144
  $theme = $atts['theme'];
145
  else :
146
+ $theme = SWP_Utility::get_option( 'ctt_theme' );
147
  endif;
148
 
149
+ $tweet = $this->get_tweet( $atts );
 
150
 
151
+ $via = ($user_twitter_handle ? '&via=' . str_replace( '@','',$user_twitter_handle ) : '');
152
 
153
  $html = '<div class="sw-tweet-clear"></div>';
154
  $html .= '<a class="swp_CTT ' . $theme;
155
+ $html .= '" href="https://twitter.com/share?text=' . $tweet . $via;
156
+ $html .= '" data-link="https://twitter.com/share?text=' . $tweet . $via;
157
  $html .= '" rel="nofollow noreferrer noopener" target="_blank">';
158
  $html .= '<span class="sw-click-to-tweet">';
159
  $html .= '<span class="sw-ctt-text">';
168
 
169
  return $html;
170
  }
171
+
172
+ /**
173
+ *
174
+ * Retrieves tweet from database and converts to UTF-8 for Twitter.
175
+ *
176
+ * @since 3.3.0 | 16 AUG 2018 | Created. Ported code from $this->generate_share_link.
177
+ * @param array $atts Shortcode attributes.
178
+ *
179
+ * @return string $tweet The encoded tweet text.
180
+ *
181
+ */
182
+ protected function get_tweet( $atts ) {
183
+ $max_tweet_length = 240;
184
+
185
+ // Check for a custom tweet from the post options.
186
+ $tweet = $atts['tweet'];
187
+
188
+ $converted_tweet = mb_convert_encoding( $tweet, 'UTF-8', get_bloginfo( "charset" ) );
189
+ $html_safe_tweet = htmlentities( $converted_tweet, ENT_COMPAT, 'UTF-8' );
190
+
191
+ $tweet = utf8_uri_encode( $converted_tweet, $max_tweet_length );
192
+
193
+ return $tweet;
194
+ }
195
  }
{functions → lib}/options/SWP_Option.php RENAMED
@@ -93,6 +93,20 @@ class SWP_Option extends SWP_Abstract {
93
  $this->parent_size = ' sw-col-940 ';
94
  }
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
 
97
  /**
98
  * Fetches the css class to match a given size given as a string.
@@ -132,8 +146,8 @@ class SWP_Option extends SWP_Abstract {
132
  return $this->value;
133
  }
134
 
135
- if ( isset( $this->user_options[$this->key] ) ) {
136
- return $this->user_options[$this->key];
137
  }
138
 
139
  return $this->default;
@@ -169,7 +183,8 @@ class SWP_Option extends SWP_Abstract {
169
  $this->default = $value;
170
 
171
  // Add this to our global list of defaults
172
- add_filter('swp_options_page_defaults' , array( $this , 'register_default' ) );
 
173
 
174
  return $this;
175
  }
@@ -306,4 +321,5 @@ class SWP_Option extends SWP_Abstract {
306
  return ' placeholder="' . $this->placeholder . '"';
307
 
308
  }
 
309
  }
93
  $this->parent_size = ' sw-col-940 ';
94
  }
95
 
96
+ /**
97
+ * Child classes will add a call to apply_filters( 'swp_options_page_values')
98
+ * to add their own values as valid options.
99
+ *
100
+ */
101
+ public function register_available_values( $values ) {
102
+ $values[$this->key] = array(
103
+ 'type' => 'none',
104
+ 'values' => array()
105
+ );
106
+
107
+ return $values;
108
+ }
109
+
110
 
111
  /**
112
  * Fetches the css class to match a given size given as a string.
146
  return $this->value;
147
  }
148
 
149
+ if ( false != SWP_Utility::get_option( $this->key ) ) {
150
+ return SWP_Utility::get_option( $this->key );
151
  }
152
 
153
  return $this->default;
183
  $this->default = $value;
184
 
185
  // Add this to our global list of defaults
186
+ add_filter( 'swp_options_page_defaults', array( $this , 'register_default' ) );
187
+ add_filter( 'swp_options_page_values', array( $this, 'register_available_values' ) );
188
 
189
  return $this;
190
  }
321
  return ' placeholder="' . $this->placeholder . '"';
322
 
323
  }
324
+
325
  }
{functions → lib}/options/SWP_Option_Icons.php RENAMED
@@ -43,10 +43,49 @@ class SWP_Option_Icons extends SWP_Option {
43
  global $swp_user_options;
44
 
45
  parent::__construct( $name, $key );
 
 
 
46
  $this->user_options = $swp_user_options;
47
  }
48
 
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  /**
51
  * A method to output the currently active icons.
52
  *
@@ -84,11 +123,10 @@ class SWP_Option_Icons extends SWP_Option {
84
  *
85
  */
86
  public function render_active_icons() {
87
- $all_icons = $this->get_all_icons();
88
- $user_icons = $this->get_user_icons();
89
- if ( empty($user_icons) ) :
90
- $user_icons = array();
91
- endif;
92
 
93
  $html = '<div class="sw-grid sw-col-300">';
94
  $html .= '<h3 class="sw-buttons-toggle">' . __( 'Active' , 'social-warfare' ) . '</h3>';
@@ -110,8 +148,8 @@ class SWP_Option_Icons extends SWP_Option {
110
  return;
111
  endif;
112
 
113
- if ( array_key_exists( $network_key, $all_icons ) && isset( $all_icons[$network_key]) ) :
114
- $network = $all_icons[$network_key];
115
 
116
  $html .= $this->render_icon_HTML( $network );
117
  endif;
@@ -137,27 +175,21 @@ class SWP_Option_Icons extends SWP_Option {
137
  *
138
  */
139
  public function render_inactive_icons() {
140
- $all_icons = $this->get_all_icons();
141
- $user_icons = $this->get_user_icons();
142
 
143
- if ( empty( $user_icons ) ) :
144
- return $this;
145
- endif;
146
 
147
- $first = reset( $all_icons );
148
 
149
- if ( gettype( $first ) === 'object' ) :
150
 
151
  //* Get the keys first, then diff the array.
152
- $keys = array();
153
-
154
- foreach( $all_icons as $object) {
155
- $keys[] = $object->key;
156
- }
157
 
158
- $first = reset( $user_icons );
159
 
160
- if ( gettype( $first ) === 'object' ) :
161
  $temp = array();
162
 
163
  foreach( $user_icons as $object ) {
@@ -170,10 +202,10 @@ class SWP_Option_Icons extends SWP_Option {
170
 
171
  $inactive_icons = array_diff( $keys, $user_icons );
172
 
173
- elseif ( array_key_exists( 0, $all_icons) ) :
174
 
175
- //* If $all_icons is numerically indexed, just diff the array.
176
- $inactive_icons = array_diff( $all_icons, $user_icons );
177
 
178
  endif;
179
 
@@ -185,7 +217,7 @@ class SWP_Option_Icons extends SWP_Option {
185
  $html .= '<div class="sw-inactive sw-buttons-sort">';
186
  if ( count( $inactive_icons) > 0 ) :
187
  foreach( $inactive_icons as $network_key) {
188
- $network = $all_icons[$network_key];
189
 
190
  $html .= $this->render_icon_HTML( $network );
191
  }
43
  global $swp_user_options;
44
 
45
  parent::__construct( $name, $key );
46
+ add_filter( 'swp_options_page_defaults', array( $this , 'register_default' ) );
47
+ add_filter( 'swp_options_page_values', array( $this, 'register_available_values' ) );
48
+
49
  $this->user_options = $swp_user_options;
50
  }
51
 
52
 
53
+ public function register_default( $defaults = array() ) {
54
+ if ( !array_key_exists( 'order_of_icons', $defaults ) ) :
55
+ $defaults['order_of_icons'] = array(
56
+ 'google_plus' => 'google_plus',
57
+ 'twitter' => 'twitter',
58
+ 'facebook' => 'facebook',
59
+ 'linkedin' => 'linkedin',
60
+ 'pinterest' => 'pinterest'
61
+ );
62
+ endif;
63
+
64
+ return $defaults;
65
+ }
66
+
67
+
68
+ public function register_available_values( $values ) {
69
+ global $swp_social_networks;
70
+ $networks = array();
71
+
72
+ /* order_of_icons is an array of $network_key => $network_key
73
+ * So we need to create an array in that form.
74
+ * Yes, it is redundant, but that's how it is.
75
+ */
76
+ foreach( $swp_social_networks as $key => $object ) {
77
+ $networks[$key] = $key;
78
+ }
79
+
80
+ $values['order_of_icons'] = array(
81
+ 'type' => 'none',
82
+ 'values' => $networks
83
+ );
84
+
85
+ return $values;
86
+ }
87
+
88
+
89
  /**
90
  * A method to output the currently active icons.
91
  *
123
  *
124
  */
125
  public function render_active_icons() {
126
+ global $swp_user_options;
127
+
128
+ $all_networks = $this->get_all_networks();
129
+ $user_icons = $swp_user_options['order_of_icons'];
 
130
 
131
  $html = '<div class="sw-grid sw-col-300">';
132
  $html .= '<h3 class="sw-buttons-toggle">' . __( 'Active' , 'social-warfare' ) . '</h3>';
148
  return;
149
  endif;
150
 
151
+ if ( array_key_exists( $network_key, $all_networks ) && isset( $all_networks[$network_key]) ) :
152
+ $network = $all_networks[$network_key];
153
 
154
  $html .= $this->render_icon_HTML( $network );
155
  endif;
175
  *
176
  */
177
  public function render_inactive_icons() {
178
+ global $swp_user_options;
 
179
 
180
+ $all_networks = $this->get_all_networks();
181
+ $user_icons = $swp_user_options['order_of_icons'];
 
182
 
183
+ $first_all = reset( $all_networks );
184
 
185
+ if ( gettype( $first_all ) === 'object' ) :
186
 
187
  //* Get the keys first, then diff the array.
188
+ $keys = array_keys( $all_networks );
 
 
 
 
189
 
190
+ $first_user = reset( $user_icons );
191
 
192
+ if ( gettype( $first_user ) === 'object' ) :
193
  $temp = array();
194
 
195
  foreach( $user_icons as $object ) {
202
 
203
  $inactive_icons = array_diff( $keys, $user_icons );
204
 
205
+ elseif ( array_key_exists( 0, $all_networks) ) :
206
 
207
+ //* If $all_networks is numerically indexed, just diff the array.
208
+ $inactive_icons = array_diff( $all_networks, $user_icons );
209
 
210
  endif;
211
 
217
  $html .= '<div class="sw-inactive sw-buttons-sort">';
218
  if ( count( $inactive_icons) > 0 ) :
219
  foreach( $inactive_icons as $network_key) {
220
+ $network = $all_networks[$network_key];
221
 
222
  $html .= $this->render_icon_HTML( $network );
223
  }
{functions → lib}/options/SWP_Option_Select.php RENAMED
@@ -35,10 +35,21 @@ class SWP_Option_Select extends SWP_Option {
35
  public function __construct( $name, $key ) {
36
  parent::__construct( $name, $key );
37
 
 
38
  $this->choices = array();
39
  }
40
 
41
 
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Add an option to the select.
44
  *
@@ -190,4 +201,5 @@ class SWP_Option_Select extends SWP_Option {
190
 
191
  return parent::set_default( $value );
192
  }
 
193
  }
35
  public function __construct( $name, $key ) {
36
  parent::__construct( $name, $key );
37
 
38
+
39
  $this->choices = array();
40
  }
41
 
42
 
43
+ public function register_available_values( $values ) {
44
+ $values[$this->key] = array(
45
+ 'type' => 'select',
46
+ 'values' => $this->choices
47
+ );
48
+
49
+ return $values;
50
+ }
51
+
52
+
53
  /**
54
  * Add an option to the select.
55
  *
201
 
202
  return parent::set_default( $value );
203
  }
204
+
205
  }
{functions → lib}/options/SWP_Option_Text.php RENAMED
@@ -36,6 +36,15 @@ class SWP_Option_Text extends SWP_Option {
36
  }
37
 
38
 
 
 
 
 
 
 
 
 
 
39
  /**
40
  * Renders the HTML to create the <input type="text" /> element.
41
  *
36
  }
37
 
38
 
39
+ public function register_available_values( $values ) {
40
+ $values[$this->key] = array(
41
+ 'type' => 'text'
42
+ );
43
+
44
+ return $values;
45
+ }
46
+
47
+
48
  /**
49
  * Renders the HTML to create the <input type="text" /> element.
50
  *
{functions → lib}/options/SWP_Option_Textarea.php RENAMED
File without changes
{functions → lib}/options/SWP_Option_Toggle.php RENAMED
@@ -26,6 +26,16 @@ class SWP_Option_Toggle extends SWP_Option {
26
  }
27
 
28
 
 
 
 
 
 
 
 
 
 
 
29
  /**
30
  * Creates the fully qulaified HTML for the checkbox/toggle module.
31
  *
26
  }
27
 
28
 
29
+ public function register_available_values( $values ) {
30
+ $values[$this->key] = array(
31
+ 'type' => 'boolean',
32
+ 'values' => array( true, false )
33
+ );
34
+
35
+ return $values;
36
+ }
37
+
38
+
39
  /**
40
  * Creates the fully qulaified HTML for the checkbox/toggle module.
41
  *
{functions → lib}/options/SWP_Options_Page.php RENAMED
@@ -67,10 +67,6 @@ class SWP_Options_Page extends SWP_Abstract {
67
  *
68
  */
69
  public function __construct() {
70
-
71
- // Fetch the initial user-set options.
72
- $swp_user_options = swp_get_user_options( true );
73
-
74
  // Create a 'tabs' object to which we can begin adding tabs.
75
  $this->tabs = new stdClass();
76
 
@@ -141,7 +137,7 @@ class SWP_Options_Page extends SWP_Abstract {
141
  'manage_options',
142
  'social-warfare',
143
  array( $this, 'render_HTML'),
144
- SWP_PLUGIN_URL . '/images/admin-options-page/socialwarfare-20x20.png'
145
  );
146
 
147
  // Hook into the CSS and Javascript Enqueue process for this specific page
@@ -188,7 +184,7 @@ class SWP_Options_Page extends SWP_Abstract {
188
 
189
  wp_enqueue_style(
190
  'swp_admin_options_css',
191
- SWP_PLUGIN_URL . "/css/admin-options-page{$suffix}.css",
192
  array(),
193
  SWP_VERSION
194
  );
@@ -216,7 +212,7 @@ class SWP_Options_Page extends SWP_Abstract {
216
  wp_enqueue_media();
217
  wp_enqueue_script(
218
  'swp_admin_options_js',
219
- SWP_PLUGIN_URL . "/js/admin-options-page{$suffix}.js",
220
  array( 'jquery' ),
221
  SWP_VERSION
222
  );
@@ -261,34 +257,35 @@ class SWP_Options_Page extends SWP_Abstract {
261
  *
262
  */
263
  public function render_HTML() {
264
- $swp_user_options = swp_get_user_options( true );
265
-
266
  //* Fetch all the addons the user has installed,
267
  //* whether or not they are actively registered.
268
- $addons = apply_filters( 'swp_registrations', [] );
269
- $registrations = array();
270
- $registered = 0;
271
  $active_addons = '';
272
  $registered_addons = '';
273
 
274
- foreach( $addons as $addon ) {
275
- if ( gettype($addon) !== 'object' ) :
276
- continue;
277
- endif;
278
- $registrations[] = new SWP_Addon_Registration( $addon );
279
- $active_addons .= " $addon->key ";
280
 
281
- if ( true === $addon->registered ) :
282
- $registered_addons .= " $addon->key ";
283
- $registered = 1;
284
- endif;
285
- }
286
 
287
- $this->registered = $registered;
288
 
289
- $this->init_registration_tab( $registrations );
 
 
 
 
 
 
 
 
 
290
 
291
- $menu = $this->create_menu( $registrations );
 
292
  $tabs = $this->create_tabs( $active_addons, $registered_addons );
293
 
294
  $html = $menu . $tabs;
@@ -708,12 +705,12 @@ class SWP_Options_Page extends SWP_Abstract {
708
  private function create_menu( $addons ) {
709
  //* Open the admin top menu wrapper.
710
  $html = '<div class="sw-header-wrapper">';
711
- $html .= '<div class="sw-grid sw-col-940 sw-top-menu" sw-registered="' . $this->registered . '">';
712
 
713
  //* Menu wrapper and tabs.
714
  $html .= '<div class="sw-grid sw-col-700">';
715
- $html .= '<img class="sw-header-logo" src="' . SWP_PLUGIN_URL . '/images/admin-options-page/social-warfare-light.png" />';
716
- $html .= '<img class="sw-header-logo-pro" src="' . SWP_PLUGIN_URL . '/images/admin-options-page/social-warfare-pro-light.png" />';
717
  $html .= '<ul class="sw-header-menu">';
718
 
719
  $tab_map = $this->sort_by_priority( $this->tabs );
@@ -780,7 +777,7 @@ class SWP_Options_Page extends SWP_Abstract {
780
  $registered = false;
781
  $notices = apply_filters( 'swp_admin_notices', '' );
782
 
783
- $container = '<div class="sw-admin-wrapper" sw-registered="'. $this->registered .'" swp-addons="' . $active_addons . '" swp-registrations="' . $registered_addons . '">';
784
  $container .= '<div class="swp-notice-wrapper">';
785
  $container .= $notices;
786
  $container .= '</div>';
67
  *
68
  */
69
  public function __construct() {
 
 
 
 
70
  // Create a 'tabs' object to which we can begin adding tabs.
71
  $this->tabs = new stdClass();
72
 
137
  'manage_options',
138
  'social-warfare',
139
  array( $this, 'render_HTML'),
140
+ SWP_PLUGIN_URL . '/assets/images/admin-options-page/socialwarfare-20x20.png'
141
  );
142
 
143
  // Hook into the CSS and Javascript Enqueue process for this specific page
184
 
185
  wp_enqueue_style(
186
  'swp_admin_options_css',
187
+ SWP_PLUGIN_URL . "/assets/css/admin-options-page{$suffix}.css",
188
  array(),
189
  SWP_VERSION
190
  );
212
  wp_enqueue_media();
213
  wp_enqueue_script(
214
  'swp_admin_options_js',
215
+ SWP_PLUGIN_URL . "/assets/js/admin-options-page{$suffix}.js",
216
  array( 'jquery' ),
217
  SWP_VERSION
218
  );
257
  *
258
  */
259
  public function render_HTML() {
 
 
260
  //* Fetch all the addons the user has installed,
261
  //* whether or not they are actively registered.
262
+ $addons = apply_filters( 'swp_registrations', array() );
263
+ $this->is_registered = 0;
264
+ $addon_templates = array();
265
  $active_addons = '';
266
  $registered_addons = '';
267
 
268
+ if ( !empty( $addons ) ) :
 
 
 
 
 
269
 
270
+ foreach( $addons as $addon ) {
271
+ if ( gettype($addon) !== 'object' ) :
272
+ continue;
273
+ endif;
 
274
 
 
275
 
276
+ $addon_templates[] = new SWP_Registration_Tab_Template( $addon );
277
+ $active_addons .= " $addon->key ";
278
+
279
+ if ( true === $addon->is_registered ) :
280
+ $registered_addons .= " $addon->key ";
281
+ $this->is_registered = 1;
282
+ endif;
283
+ }
284
+
285
+ endif;
286
 
287
+ $this->init_registration_tab( $addon_templates );
288
+ $menu = $this->create_menu( $addon_templates );
289
  $tabs = $this->create_tabs( $active_addons, $registered_addons );
290
 
291
  $html = $menu . $tabs;
705
  private function create_menu( $addons ) {
706
  //* Open the admin top menu wrapper.
707
  $html = '<div class="sw-header-wrapper">';
708
+ $html .= '<div class="sw-grid sw-col-940 sw-top-menu" sw-registered="' . $this->is_registered . '">';
709
 
710
  //* Menu wrapper and tabs.
711
  $html .= '<div class="sw-grid sw-col-700">';
712
+ $html .= '<img class="sw-header-logo" src="' . SWP_PLUGIN_URL . '/assets/images/admin-options-page/social-warfare-light.png" />';
713
+ $html .= '<img class="sw-header-logo-pro" src="' . SWP_PLUGIN_URL . '/assets/images/admin-options-page/social-warfare-pro-light.png" />';
714
  $html .= '<ul class="sw-header-menu">';
715
 
716
  $tab_map = $this->sort_by_priority( $this->tabs );
777
  $registered = false;
778
  $notices = apply_filters( 'swp_admin_notices', '' );
779
 
780
+ $container = '<div class="sw-admin-wrapper" sw-registered="'. $this->is_registered .'" swp-addons="' . $active_addons . '" swp-registrations="' . $registered_addons . '">';
781
  $container .= '<div class="swp-notice-wrapper">';
782
  $container .= $notices;
783
  $container .= '</div>';
{functions → lib}/options/SWP_Options_Page_Section.php RENAMED
@@ -119,7 +119,7 @@ class SWP_Options_Page_Section extends SWP_Abstract {
119
  *
120
  */
121
  public function add_option( $option ) {
122
- $types = ['SWP_Addon_Registration', 'SWP_Option_Toggle', 'SWP_Option_Select', 'SWP_Option_Text', 'SWP_Option_Textarea'];
123
 
124
  $type = get_class( $option );
125
 
119
  *
120
  */
121
  public function add_option( $option ) {
122
+ $types = ['SWP_Registration_Tab_Templates', 'SWP_Option_Toggle', 'SWP_Option_Select', 'SWP_Option_Text', 'SWP_Option_Textarea'];
123
 
124
  $type = get_class( $option );
125
 
{functions → lib}/options/SWP_Options_Page_Tab.php RENAMED
File without changes
functions/options/SWP_Addon_Registration.php → lib/options/SWP_Registration_Tab_Template.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SWP_Addon_Registration extends SWP_Option {
4
  public $key = '';
5
  public $license_key = '';
6
  public $product_id = 0;
@@ -15,6 +15,7 @@ class SWP_Addon_Registration extends SWP_Option {
15
  $this->version = $addon->version;
16
  }
17
 
 
18
  public function render_HTML() {
19
  if ( !empty( $this->license_key ) ) :
20
  $this->registered = 1;
@@ -44,6 +45,54 @@ class SWP_Addon_Registration extends SWP_Option {
44
  return '';
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  protected function not_registered_HTML() {
48
  $html = '<div class="sw-grid sw-col-940 swp_is_not_registered">';
49
 
1
  <?php
2
 
3
+ class SWP_Registration_Tab_Template extends SWP_Option {
4
  public $key = '';
5
  public $license_key = '';
6
  public $product_id = 0;
15
  $this->version = $addon->version;
16
  }
17
 
18
+
19
  public function render_HTML() {
20
  if ( !empty( $this->license_key ) ) :
21
  $this->registered = 1;
45
  return '';
46
  }
47
 
48
+
49
+ /**
50
+ * Pass ajax responses to a remote HTTP request.
51
+ *
52
+ * @since 2.0.0
53
+ * @return void
54
+ */
55
+ function ajax_passthrough() {
56
+ if ( ! check_ajax_referer( 'swp_plugin_registration', 'security', false ) ) {
57
+ wp_send_json_error( esc_html__( 'Security failed.', 'social-warfare' ) );
58
+ die;
59
+ }
60
+
61
+ $data = wp_unslash( $_POST ); // Input var okay.
62
+
63
+ if ( ! isset( $data['activity'], $data['email'] ) ) {
64
+ wp_send_json_error( esc_html__( 'Required fields missing.', 'social-warfare' ) );
65
+ die;
66
+ }
67
+
68
+ if ( 'register' === $data['activity'] ) {
69
+ $response = $this->register_plugin( $data['email'], SWP_Utility::get_site_url() );
70
+
71
+ if ( ! $response ) {
72
+ wp_send_json_error( esc_html__( 'Plugin could not be registered.', 'social-warfare' ) );
73
+ die;
74
+ }
75
+
76
+ $response['message'] = esc_html__( 'Plugin successfully registered!', 'social-warfare' );
77
+ }
78
+
79
+ if ( 'unregister' === $data['activity'] && isset( $data['key'] ) ) {
80
+ $response = $this->unregister_plugin( $data['email'], $data['key'] );
81
+
82
+ if ( ! $response ) {
83
+ wp_send_json_error( esc_html__( 'Plugin could not be unregistered.', 'social-warfare' ) );
84
+ die;
85
+ }
86
+
87
+ $response['message'] = esc_html__( 'Plugin successfully unregistered!', 'social-warfare' );
88
+ }
89
+
90
+ wp_send_json_success( $response );
91
+
92
+ die;
93
+ }
94
+
95
+
96
  protected function not_registered_HTML() {
97
  $html = '<div class="sw-grid sw-col-940 swp_is_not_registered">';
98
 
{functions → lib}/options/SWP_Section_HTML.php RENAMED
@@ -47,6 +47,10 @@ class SWP_Section_HTML extends SWP_Option {
47
 
48
  parent::__construct( $name, $key );
49
 
 
 
 
 
50
  $this->html = '';
51
  }
52
 
@@ -80,34 +84,25 @@ class SWP_Section_HTML extends SWP_Option {
80
  */
81
  public function do_admin_sidebar() {
82
  $status_title = __( 'Press Ctrl+C to Copy this information.' , 'social-warfare' );
83
- $support_link = __( 'Need help? Check out our <a href="https://warfareplugins.com/support/" target="_blank">Knowledgebase.' , 'social-warfare' );
84
- $support_status = __( 'Opening a support ticket? Copy your System Status by clicking the button below.' , 'social-warfare' );
85
- $get_status = __( 'Get System Status' , 'social-warfare' );
86
- ob_start();
87
- ?>
88
-
89
- <div class="sw-admin-sidebar sw-grid sw-col-220 sw-fit">
90
- <a href="https://warfareplugins.com/affiliates/" target="_blank"><img src="<?= SWP_PLUGIN_URL ?>/images/admin-options-page/affiliate-300x150.jpg"></a>
91
- <a href="https://warfareplugins.com/support-categories/getting-started/" target="_blank"><img src="<?= SWP_PLUGIN_URL ?>/images/admin-options-page/starter-guide-300x150.jpg"></a>
92
- <a href="https://warfareplugins.com/how-to-measure-social-media-roi-using-google-analytics/" target="_blank"><img src="<?= SWP_PLUGIN_URL ?>/images/admin-options-page/measure-roi-300x150.jpg"></a>
93
- <p class="sw-support-notice sw-italic"><?= $support_link ?></a></p>
94
- <p class="sw-support-notice sw-italic"><?= $support_status ?></p>
95
- <a href="#" class="button sw-blue-button sw-system-status"><?= $get_status ?></a>
96
-
97
- <!-- Sytem Status Container -->
98
- <div class="sw-clearfix"></div>
99
- <div class="system-status-wrapper">
100
- <h4><?= $status_title ?></h4>
101
- <div class="system-status-container"><?= $this->system_status() ?></div>
102
- </div>
103
- </div>
104
 
105
- <?php
 
 
 
106
 
107
- $this->html = ob_get_contents();
108
- ob_end_clean();
 
 
 
 
109
 
110
- return $this->html;
 
 
 
 
 
111
  }
112
 
113
 
@@ -123,8 +118,6 @@ class SWP_Section_HTML extends SWP_Option {
123
  /**
124
  * System Status Generator
125
  */
126
- global $swp_user_options;
127
-
128
  if ( ! function_exists( 'get_plugins' ) ) {
129
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
130
  }
@@ -166,7 +159,6 @@ class SWP_Section_HTML extends SWP_Option {
166
  <tr><td><h2>Plugin Statuses</h2></td><td></td></tr>
167
  <tr><td><b>Theme Name</b></td><td>' . $theme['Name'] . '</td></tr>
168
  <tr><td><b>Theme Version</b></td><td>' . $theme['Version'] . '</td></tr>
169
- <tr><td><b>Caching Method</b></td><td>' . ucfirst($swp_user_options['cache_method']) . '</td></tr>
170
  <tr><td><b>Active Plugins</b></td><td></td></tr>
171
  <tr><td><b>Number of Active Plugins</b></td><td>' . count( $plugins ) . '</td></tr>
172
  ' . $pluginList . '
@@ -186,16 +178,11 @@ class SWP_Section_HTML extends SWP_Option {
186
  *
187
  */
188
  public function do_tweet_count_registration() {
189
- global $swp_user_options;
190
-
191
  // Check for a default value
192
- if ( isset( $swp_user_options['twitter_shares'] ) && $swp_user_options['twitter_shares'] == true ) :
193
  $status = 'on';
194
  $selected = 'checked';
195
- elseif ( isset( $swp_user_options['twitter_shares'] ) && $swp_user_options['twitter_shares'] == false ) :
196
- $status = 'off';
197
- $selected = '';
198
- else :
199
  $status = 'off';
200
  $selected = '';
201
  endif;
@@ -245,7 +232,7 @@ class SWP_Section_HTML extends SWP_Option {
245
  public function do_bitly_authentication_button() {
246
  $link = "https://bitly.com/oauth/authorize?client_id=96c9b292c5503211b68cf4ab53f6e2f4b6d0defb&state=" . admin_url( 'admin-ajax.php' ) . "&redirect_uri=https://warfareplugins.com/bitly_oauth.php";
247
 
248
- if ( swp_get_option('bitly_access_token') ):
249
  $text = __( 'Connected', 'social-warfare' );
250
  $color = 'sw-green-button';
251
  else:
@@ -369,10 +356,7 @@ class SWP_Section_HTML extends SWP_Option {
369
  *
370
  */
371
  public function do_button_position_table() {
372
- $default_types = ['page', 'post', 'home', 'archive_categories'];
373
- $other_types = get_post_types( ['public' => true, '_builtin' => false ], 'names' );
374
-
375
- $post_types = array_merge( $default_types, $other_types );
376
 
377
  $panel_locations = [
378
  'above' => __( 'Above the Content', 'social-warfare' ),
@@ -401,10 +385,11 @@ class SWP_Section_HTML extends SWP_Option {
401
  $html .= '<p class="sw-select-label sw-short sw-no-padding">' . __( 'Floating Buttons (If Activated)' ,'social-warfare' ) . '</p>';
402
  $html .= '</div>';
403
 
404
- $i = 0;
 
405
  foreach( $post_types as $index => $post ) {
406
-
407
- $priority = ($i + 1) * 10; $i++;
408
 
409
  $html .= '<div class="sw-grid sw-col-940 sw-fit sw-option-container ' . $post . '_wrapper">';
410
 
@@ -543,6 +528,83 @@ class SWP_Section_HTML extends SWP_Option {
543
  }
544
 
545
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
  /**
547
  * The rendering method common to all classes.
548
  *
47
 
48
  parent::__construct( $name, $key );
49
 
50
+ if (empty( $this->default ) ) :
51
+ $this->set_default( ' ');
52
+ endif;
53
+
54
  $this->html = '';
55
  }
56
 
84
  */
85
  public function do_admin_sidebar() {
86
  $status_title = __( 'Press Ctrl+C to Copy this information.' , 'social-warfare' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
+ //* This is an array of fully qualified HTML strings, ready to print.
89
+ $cache = get_option( 'swp_json_cache' );
90
+ $html = '<div class="sw-admin-sidebar sw-grid sw-col-220 sw-fit">';
91
+ $html .= '<div id="swp-admin-sidebar">';
92
 
93
+ if ( $components = $cache['sidebar'] ) :
94
+ foreach( $components as $component ) {
95
+ $component = html_entity_decode ( $component );
96
+ $html .= html_entity_decode( $component);
97
+ }
98
+ endif;
99
 
100
+ $html .= '<div class="system-status-wrapper">';
101
+ $html .= '<h4><?= $status_title ?></h4>';
102
+ $html .= '<div class="system-status-container"> '. $this->system_status() . '</div>';
103
+ $html .= '</div></div>';
104
+
105
+ return $this->html = $html;
106
  }
107
 
108
 
118
  /**
119
  * System Status Generator
120
  */
 
 
121
  if ( ! function_exists( 'get_plugins' ) ) {
122
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
123
  }
159
  <tr><td><h2>Plugin Statuses</h2></td><td></td></tr>
160
  <tr><td><b>Theme Name</b></td><td>' . $theme['Name'] . '</td></tr>
161
  <tr><td><b>Theme Version</b></td><td>' . $theme['Version'] . '</td></tr>
 
162
  <tr><td><b>Active Plugins</b></td><td></td></tr>
163
  <tr><td><b>Number of Active Plugins</b></td><td>' . count( $plugins ) . '</td></tr>
164
  ' . $pluginList . '
178
  *
179
  */
180
  public function do_tweet_count_registration() {
 
 
181
  // Check for a default value
182
+ if ( true == SWP_Utility::get_option( 'twitter_shares' ) ) :
183
  $status = 'on';
184
  $selected = 'checked';
185
+ else:
 
 
 
186
  $status = 'off';
187
  $selected = '';
188
  endif;
232
  public function do_bitly_authentication_button() {
233
  $link = "https://bitly.com/oauth/authorize?client_id=96c9b292c5503211b68cf4ab53f6e2f4b6d0defb&state=" . admin_url( 'admin-ajax.php' ) . "&redirect_uri=https://warfareplugins.com/bitly_oauth.php";
234
 
235
+ if ( SWP_Utility::get_option('bitly_access_token') ):
236
  $text = __( 'Connected', 'social-warfare' );
237
  $color = 'sw-green-button';
238
  else:
356
  *
357
  */
358
  public function do_button_position_table() {
359
+ $post_types = SWP_Utility::get_post_types();
 
 
 
360
 
361
  $panel_locations = [
362
  'above' => __( 'Above the Content', 'social-warfare' ),
385
  $html .= '<p class="sw-select-label sw-short sw-no-padding">' . __( 'Floating Buttons (If Activated)' ,'social-warfare' ) . '</p>';
386
  $html .= '</div>';
387
 
388
+ //* Some indices are numeric, others are strings.
389
+ $i = 0;
390
  foreach( $post_types as $index => $post ) {
391
+ $i++;
392
+ $priority = $i * 10;
393
 
394
  $html .= '<div class="sw-grid sw-col-940 sw-fit sw-option-container ' . $post . '_wrapper">';
395
 
528
  }
529
 
530
 
531
+ public function do_bitly_start_date() {
532
+ $post_types = SWP_Utility::get_post_types();
533
+
534
+ $booleans = [
535
+ 'on' => __( 'On','social_warfare'),
536
+ 'off' => __( 'Off', 'social_warfare')
537
+ ];
538
+
539
+ $html = '<div class="sw-grid sw-col-940 sw-fit sw-option-container ' . $this->key . '_wrapper" ';
540
+ $html .= $this->render_dependency();
541
+ $html .= $this->render_premium();
542
+ $html .= '>';
543
+
544
+ $start_date = SWP_Utility::get_option( 'bitly_start_date' );
545
+
546
+ if ( !$start_date ) {
547
+ // die(var_dump($start_date));
548
+ $start_date = '';
549
+ }
550
+
551
+
552
+ $html .= '<p class="sw-subtitle sw-col-620" style="margin: 5px 0 15px">I would like to generate bitly links for content created <b>on or after</b>&nbsp;';
553
+ $html .= '<input
554
+ style="float: right;"
555
+ type="text"
556
+ id="' . $this->key . '"
557
+ name="' . $this->key . '"
558
+ value="' . $start_date . '"
559
+ />
560
+ </p>';
561
+ $html .= '<p class="sw-subtitle sw-col-620">Please enter start the date in the following format: <code style="float: right;">YYYY-MM-DD</code></p>';
562
+
563
+ $html .= '<div class="sw-grid sw-col-300">';
564
+ $html .= '<p class="sw-select-label sw-short sw-no-padding">' . __( 'Post Type' ,'social-warfare' ) . '</p>';
565
+ $html .= '</div>';
566
+
567
+ $html .= '<div class="sw-grid sw-col-300 sw-fit">';
568
+ $html .= '<p class="sw-select-label sw-short sw-no-padding">' . __( 'Create Bitly Links?' ,'social-warfare' ) . '</p>';
569
+ $html .= '</div>';
570
+
571
+ //* Some indices are numeric, others are strings.
572
+ $i = 0;
573
+ foreach( $post_types as $index => $post ) {
574
+ $i++;
575
+ $priority = $i * 10;
576
+
577
+ $html .= '<div class="sw-grid sw-col-940 sw-fit sw-option-container ' . $post . '_wrapper">';
578
+
579
+ $html .= '<div class="sw-grid sw-col-300">';
580
+ $html .= '<p class="sw-input-label">' . str_replace('_', ' & ', ucfirst($post)) . '</p>';
581
+ $html .= '</div>';
582
+
583
+ $html .= '<div class="sw-grid sw-col-300 sw-fit">';
584
+
585
+ $float = new SWP_Option_Select( ucfirst( $post ), 'bitly_links_' . $post );
586
+ $float->set_priority( $priority )
587
+ ->set_size( 'sw-col-300' )
588
+ ->set_choices( $booleans )
589
+ ->set_default( 'on' );
590
+
591
+ $html .= $float->render_HTML_element();
592
+
593
+ $html .= '</div>';
594
+
595
+ $html .= '</div>';
596
+
597
+ }
598
+
599
+ $html .= '</div>';
600
+
601
+ $this->html = $html;
602
+
603
+ return $this;
604
+
605
+ }
606
+
607
+
608
  /**
609
  * The rendering method common to all classes.
610
  *
lib/options/SWP_User_Options.php ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * A Class to create and filter the global $swp_user_options;
5
+ *
6
+ * This class ensures that if options have been added via updates or by installing
7
+ * new addons that they are added to the user options array. Conversely, if
8
+ * available options have disappeared from deactivating an addon, those options
9
+ * will be removed from the global user options array.
10
+ *
11
+ * @package SocialWarfare\Functions\Options
12
+ * @copyright Copyright (c) 2018, Warfare Plugins, LLC
13
+ * @license GPL-3.0+
14
+ * @since 3.3.0 | Created | 06 AUG 2018
15
+ * @access public
16
+ *
17
+ */
18
+ class SWP_User_options {
19
+
20
+
21
+ public function __construct() {
22
+ $this->unfiltered_options = get_option( 'social_warfare_settings', false );
23
+ // Fetch the current options and the available options data.
24
+ $this->registered_options = get_option( 'swp_registered_options', false );
25
+ $this->user_options = $this->unfiltered_options;
26
+
27
+ // Filter the options.
28
+ $this->filter_options();
29
+
30
+ // Assign the options to the global.
31
+ global $swp_user_options;
32
+ $swp_user_options = $this->user_options;
33
+
34
+ // Defered to End of Cycle: Add all relevant option info to the database.
35
+ add_action( 'wp_loaded', array( $this , 'store_registered_options_data' ), 10000 );
36
+
37
+ // Debug
38
+ add_action( 'admin_footer', array( $this, 'debug' ) );
39
+ }
40
+
41
+
42
+ /**
43
+ * Compares what the admin wants to what is available to the admin.
44
+ *
45
+ * @return void
46
+ *
47
+ */
48
+ public function filter_options() {
49
+ if( false !== $this->registered_options ) :
50
+ $this->remove_unavailable_options();
51
+ $this->correct_invalid_values();
52
+ $this->add_option_defaults();
53
+ endif;
54
+ }
55
+
56
+
57
+ /**
58
+ * A function for debugging this class.
59
+ *
60
+ * @since 3.3.0 | 07 AUG 2018 | Created
61
+ * @param void
62
+ * @return void
63
+ *
64
+ */
65
+ public function debug() {
66
+ if( true === SWP_Utility::debug( 'swp_user_options' ) ) {
67
+ echo "<pre>", var_export($this), "</pre>";
68
+ }
69
+ }
70
+
71
+
72
+ /**
73
+ * Store the options data in the database.
74
+ *
75
+ * This will be an array of all available options, all of their available
76
+ * values, and all of their defaults.
77
+ *
78
+ * This is loaded super late to ensure that all available options will have
79
+ * already been added to the filter so that we can access them here.
80
+ *
81
+ * By loading late, it will not be available on this same page load for use
82
+ * by the filters. It will be available on the next available page load.
83
+ * However, this should only have to run on the page load when an addon is
84
+ * activated or deactivated as they won't change any other time so this won't
85
+ * be an issue.
86
+ *
87
+ * @since 3.3.0 | 06 AUG 2018 | Created
88
+ * @param void
89
+ * @return void
90
+ *
91
+ */
92
+ public function store_registered_options_data() {
93
+ $whitelist = $this->generate_whitelist();
94
+
95
+ $new_registered_options = array(
96
+ 'defaults' => apply_filters( 'swp_options_page_defaults', array() ),
97
+ 'values' => apply_filters( 'swp_options_page_values', array() )
98
+ );
99
+ $registrations = apply_filters('swp_registrations', []);
100
+
101
+ foreach($whitelist as $key) {
102
+ if (isset( $this->unfiltered_options[$key] ) ) :
103
+ $new_registered_options["defaults"][$key] = $this->unfiltered_options[$key];
104
+ $new_registered_options["values"][$key]["type"] = "none";
105
+ $new_registered_options["values"][$key]["values"] = $this->unfiltered_options[$key];
106
+ endif;
107
+ }
108
+
109
+ if( $new_registered_options != $this->registered_options ) {
110
+ update_option( 'swp_registered_options', $new_registered_options );
111
+ }
112
+ }
113
+
114
+
115
+ public function generate_whitelist() {
116
+ $addons = apply_filters( 'swp_registrations', array() );
117
+ $whitelist = array('last_migrated');
118
+
119
+ if ( empty( $addons) ) {
120
+ return $whitelist;
121
+ }
122
+
123
+ foreach( $addons as $addon ) {
124
+ $whitelist[] = $addon->key . '_license_key';
125
+ $whitelist[] = $addon->key . '_license_key_timestamp';
126
+ }
127
+
128
+ return $whitelist;
129
+ }
130
+
131
+
132
+ /**
133
+ * Filter out non-existent options.
134
+ *
135
+ * This checks if an option is still registered and removes it from the user
136
+ * options if it does not exist.
137
+ *
138
+ * @since 3.3.0 | 06 AUG 2018 | Created
139
+ * @param void
140
+ * @return void
141
+ *
142
+ */
143
+ private function remove_unavailable_options() {
144
+ $defaults = array_keys( $this->registered_options['defaults'] );
145
+ $options = array_keys ( $this->user_options );
146
+
147
+
148
+
149
+ $available_options = array_intersect( $defaults, $options );
150
+
151
+ foreach( $this->user_options as $key => $value ) {
152
+
153
+ //* Manually filter the order of icons.
154
+ if ( $key == 'order_of_icons' ) :
155
+ $value = $this->filter_order_of_icons( $value );
156
+ $this->user_icons[$key] = $value;
157
+ continue;
158
+ endif;
159
+
160
+ if ( !in_array( $key, $available_options ) ) :
161
+ unset( $this->user_options[$key] );
162
+ endif;
163
+ }
164
+ }
165
+
166
+
167
+ private function filter_order_of_icons( $user_icons = array() ) {
168
+ $networks = $this->registered_options['values']['order_of_icons']['values'];
169
+ $user_icons = $this->user_options['order_of_icons'];
170
+
171
+ foreach( $user_icons as $network_key ) {
172
+ if ( !array_key_exists( $network_key, $networks ) ) :
173
+ unset( $user_icons[$network_key] );
174
+ endif;
175
+ }
176
+
177
+ //* They did not have any Core icons set. Return to default icons.
178
+ if ( empty ( $user_icons ) ) :
179
+ $user_icons = $this->registered_options['defaults']['order_of_icons'];
180
+ endif;
181
+
182
+ return $user_icons;
183
+ }
184
+
185
+
186
+ /**
187
+ * Correct any values that may be invalid.
188
+ *
189
+ * @since 3.3.0 | 06 AUG 2018 | Created
190
+ * @param void
191
+ * @return void
192
+ *
193
+ */
194
+ private function correct_invalid_values() {
195
+ $defaults = $this->registered_options['defaults'];
196
+ $values = $this->registered_options['values'];
197
+
198
+ foreach( $this->user_options as $key => $value ) {
199
+ if( $values[$key]['type'] == 'select' && !array_key_exists( $value, $values[$key]['values']) ) {
200
+ $this->user_options[$key] = $defaults[$key];
201
+ }
202
+ }
203
+ }
204
+
205
+
206
+ /**
207
+ * Creates the default value for any new keys.
208
+ *
209
+ * @since 3.0.8 | 16 MAY 2018 | Created the method.
210
+ * @since 3.0.8 | 24 MAY 2018 | Added check for order_of_icons
211
+ * @since 3.1.0 | 13 JUN 2018 | Replaced array bracket notation.
212
+ * @since 3.3.0 | 06 AUG 2018 | Moved from database migration class.
213
+ * @param void
214
+ * @return void
215
+ *
216
+ */
217
+ private function add_option_defaults() {
218
+ $defaults = $this->registered_options['defaults'];
219
+
220
+ foreach ( $defaults as $key => $value ) {
221
+ if ( !array_key_exists( $key, $this->user_options ) ) :
222
+ $this->user_options[$key] = $value;
223
+ endif;
224
+ }
225
+ }
226
+ }
{functions → lib}/social-networks/SWP_Facebook.php RENAMED
@@ -141,9 +141,8 @@ class SWP_Facebook extends SWP_Social_Network {
141
  *
142
  */
143
  public function print_facebook_script() {
144
- global $swp_user_options;
145
 
146
- if ( $swp_user_options['recover_shares'] == true ) {
147
  $alternateURL = SWP_Permalink::get_alt_permalink( $this->post_id );
148
  } else {
149
  $alternateURL = false;
@@ -184,7 +183,7 @@ class SWP_Facebook extends SWP_Social_Network {
184
 
185
  $previous_activity = get_post_meta( $post_id, '_facebook_shares', true );
186
 
187
- if ( $activity > $previous_activity || true === _swp_is_debug('force_new_shares') ) :
188
  delete_post_meta( $post_id, '_facebook_shares' );
189
  update_post_meta( $post_id, '_facebook_shares', $activity );
190
  endif;
141
  *
142
  */
143
  public function print_facebook_script() {
 
144
 
145
+ if ( true === SWP_Utility::get_option( 'recover_shares' ) ) {
146
  $alternateURL = SWP_Permalink::get_alt_permalink( $this->post_id );
147
  } else {
148
  $alternateURL = false;
183
 
184
  $previous_activity = get_post_meta( $post_id, '_facebook_shares', true );
185
 
186
+ if ( $activity > $previous_activity || true === SWP_Utility::debug('force_new_shares') ) :
187
  delete_post_meta( $post_id, '_facebook_shares' );
188
  update_post_meta( $post_id, '_facebook_shares', $activity );
189
  endif;
{functions → lib}/social-networks/SWP_Google_Plus.php RENAMED
File without changes
{functions → lib}/social-networks/SWP_Linkedin.php RENAMED
File without changes
lib/social-networks/SWP_Mix.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Mix
5
+ *
6
+ * Class to add a StumbleUpon share button to the available buttons
7
+ *
8
+ * @package SocialWarfare\Functions\Social-Networks
9
+ * @copyright Copyright (c) 2018, Warfare Plugins, LLC
10
+ * @license GPL-3.0+
11
+ * @since 1.0.0 | Unknown | CREATED
12
+ * @since 2.2.4 | 02 MAY 2017 | Refactored functions & updated docblocking
13
+ * @since 3.0.0 | 05 APR 2018 | Rebuilt into a class-based system.
14
+ *
15
+ */
16
+ class SWP_Mix extends SWP_Social_Network {
17
+
18
+
19
+ /**
20
+ * The Magic __construct Method
21
+ *
22
+ * This method is used to instantiate the social network object. It does three things.
23
+ * First it sets the object properties for each network. Then it adds this object to
24
+ * the globally accessible swp_social_networks array. Finally, it fetches the active
25
+ * state (does the user have this button turned on?) so that it can be accessed directly
26
+ * within the object.
27
+ *
28
+ * @since 3.0.0 | 06 APR 2018 | Created
29
+ * @param none
30
+ * @return none
31
+ * @access public
32
+ *
33
+ */
34
+ public function __construct() {
35
+
36
+ // Update the class properties for this network
37
+ $this->name = __( 'Mix','social-warfare' );
38
+ $this->cta = __( 'Share','social-warfare' );
39
+ $this->key = 'mix';
40
+ $this->default = 'false';
41
+ $this->base_share_url = 'https://mix.com/mixit?url=';
42
+
43
+ $today = date("Y-m-d H:i:s");
44
+
45
+ $this->check_stumble_upon_shares();
46
+ $this->init_social_network();
47
+ }
48
+
49
+
50
+ public function check_stumble_upon_shares() {
51
+ global $post;
52
+
53
+ if ( !is_object( $post ) || empty( $post->ID ) ) :
54
+ return;
55
+ endif;
56
+
57
+ $stumble_shares = get_post_meta( $post->ID, '_stumbleupon_shares', true );
58
+
59
+ if ( !is_numeric( $stumble_shares ) ) :
60
+ return;
61
+ endif;
62
+
63
+ if ( update_post_meta( $post->ID, '_mix_shares', (int) $stumble_shares ) ) :
64
+ delete_post_meta( $post->ID, '_stumbleupon_shares' );
65
+ endif;
66
+ }
67
+
68
+ }
{functions → lib}/social-networks/SWP_Pinterest.php RENAMED
@@ -156,7 +156,7 @@ class SWP_Pinterest extends SWP_Social_Network {
156
  $icon .= '</span>';
157
 
158
  if ( true === $this->are_shares_shown( $share_counts , $options ) ) :
159
- $icon .= '<span class="swp_count">' . swp_kilomega( $share_counts[$this->key] ) . '</span>';
160
  else :
161
  $icon = '<span class="swp_count swp_hide">' . $icon . '</span>';
162
  endif;
156
  $icon .= '</span>';
157
 
158
  if ( true === $this->are_shares_shown( $share_counts , $options ) ) :
159
+ $icon .= '<span class="swp_count">' . SWP_Utility::kilomega( $share_counts[$this->key] ) . '</span>';
160
  else :
161
  $icon = '<span class="swp_count swp_hide">' . $icon . '</span>';
162
  endif;
{functions → lib}/social-networks/SWP_Social_Network.php RENAMED
@@ -352,7 +352,7 @@ class SWP_Social_Network {
352
 
353
  $post_data = $panel_context['post_data'];
354
  $share_counts = $panel_context['shares'];
355
- $options = $panel_context['options'];
356
 
357
  $share_link = $this->generate_share_link( $post_data );
358
 
@@ -364,8 +364,8 @@ class SWP_Social_Network {
364
  $icon .= '</span>';
365
  $icon .= '</span>';
366
 
367
- if ( true === $this->are_shares_shown( $share_counts , $options ) ) :
368
- $icon .= '<span class="swp_count">' . swp_kilomega( $share_counts[$this->key] ) . '</span>';
369
  else :
370
  $icon = '<span class="swp_count swp_hide">' . $icon . '</span>';
371
  endif;
@@ -391,25 +391,26 @@ class SWP_Social_Network {
391
 
392
 
393
  /**
394
- * Are Shares Shown?
395
  *
396
- * This function returns a boolean letting the render_html method know
397
- * if we are supposed to be showing the share count or not.
398
  *
399
  * @since 3.0.0 | 18 APR 2018 | Created
 
 
400
  * @param array $share_counts The array of share counts
401
- * @param array $options The array of options from the button panel object.
402
- * @return bool Do we show the share counts?
 
403
  *
404
  */
405
- public function are_shares_shown( $share_counts , $options ) {
406
 
407
  // False if the share count is empty
408
  if ( empty( $share_counts[$this->key] ) ) :
409
  return false;
410
 
411
  // False if the total share count is below the minimum
412
- elseif( $share_counts['total_shares'] < $options['minimum_shares'] ):
413
  return false;
414
 
415
  // False if the share count is zero.
@@ -417,7 +418,7 @@ class SWP_Social_Network {
417
  return false;
418
 
419
  // False if network shares are turned off in the options.
420
- elseif( false == $options['network_shares'] ):
421
  return false;
422
 
423
  else :
352
 
353
  $post_data = $panel_context['post_data'];
354
  $share_counts = $panel_context['shares'];
355
+ $post_data['options'] = $panel_context['options'];
356
 
357
  $share_link = $this->generate_share_link( $post_data );
358
 
364
  $icon .= '</span>';
365
  $icon .= '</span>';
366
 
367
+ if ( true === $this->are_shares_shown( $share_counts , $panel_context['options'] ) ) :
368
+ $icon .= '<span class="swp_count">' . SWP_Utility::kilomega( $share_counts[$this->key] ) . '</span>';
369
  else :
370
  $icon = '<span class="swp_count swp_hide">' . $icon . '</span>';
371
  endif;
391
 
392
 
393
  /**
 
394
  *
395
+ * Returns a boolean indicateding whether or not to display share counts.
 
396
  *
397
  * @since 3.0.0 | 18 APR 2018 | Created
398
+ * @since 3.3.0 | 24 AUG 2018 | Removed use of $options, calls SWP::Utility instead.
399
+ *
400
  * @param array $share_counts The array of share counts
401
+ * @param array $options DEPRECATED The array of options from the button panel object.
402
+ *
403
+ * @return bool True if share counts should be displayed, else false.
404
  *
405
  */
406
+ public function are_shares_shown( $share_counts , $options = array()) {
407
 
408
  // False if the share count is empty
409
  if ( empty( $share_counts[$this->key] ) ) :
410
  return false;
411
 
412
  // False if the total share count is below the minimum
413
+ elseif( $share_counts['total_shares'] < SWP_Utility::get_option( 'minimum_shares' ) ):
414
  return false;
415
 
416
  // False if the share count is zero.
418
  return false;
419
 
420
  // False if network shares are turned off in the options.
421
+ elseif( false == SWP_Utility::get_option( 'network_shares' ) ):
422
  return false;
423
 
424
  else :
{functions → lib}/social-networks/SWP_Social_Networks_Loader.php RENAMED
File without changes
{functions → lib}/social-networks/SWP_Stumble_Upon.php RENAMED
File without changes
{functions → lib}/social-networks/SWP_Twitter.php RENAMED
@@ -71,7 +71,7 @@ class SWP_Twitter extends SWP_Social_Network {
71
  }
72
 
73
  // Debugging
74
- if ( _swp_is_debug( 'twitter' ) ) {
75
  echo '<b>Request URL:</b> ' . $request_url . '<br />';
76
  }
77
 
@@ -96,10 +96,10 @@ class SWP_Twitter extends SWP_Social_Network {
96
  global $swp_user_options;
97
 
98
  // If the user has enabled Twitter shares....
99
- if ( swp_get_option('twitter_shares') ) :
100
 
101
  // Debugging
102
- if ( _swp_is_debug( 'twitter' ) ) :
103
  echo '<b>Response:</b> ' . $response . '<br />';
104
  endif;
105
 
@@ -131,21 +131,7 @@ class SWP_Twitter extends SWP_Social_Network {
131
  *
132
  */
133
  public function generate_share_link( $post_data ) {
134
-
135
- // Generate a title for the share.
136
- $title = str_replace( '|', '', strip_tags( $post_data['post_title'] ) );
137
-
138
- // Check for a custom tweet from the post options.
139
- $custom_tweet = get_post_meta( $post_data['ID'] , 'swp_custom_tweet' , true );
140
-
141
- $tweet = empty( $custom_tweet ) ? $title : $custom_tweet;
142
- $tweet = is_array( $tweet ) ? $tweet[0] : $tweet;
143
-
144
- if ( function_exists( 'normalizer_normalize' ) ) :
145
- $tweet = urlencode( normalizer_normalize( html_entity_decode( $tweet, ENT_COMPAT, 'UTF-8' ) ) );
146
- else :
147
- $tweet = urlencode( html_entity_decode( $tweet, ENT_COMPAT, 'UTF-8' ) );
148
- endif;
149
 
150
  $twitter_link = $this->get_shareable_permalink( $post_data );
151
 
@@ -162,7 +148,9 @@ class SWP_Twitter extends SWP_Social_Network {
162
  $tweet .= ' @'.str_replace('@','',$twitter_mention);
163
  endif;
164
 
165
- $user_twitter_handle = get_the_author_meta( 'swp_twitter' , SWP_User_Profile::get_author( $post_data['ID'] ) );
 
 
166
 
167
  if ( $user_twitter_handle ) :
168
  $via_parameter = '&via=' . str_replace( '@','',$user_twitter_handle );
@@ -177,7 +165,6 @@ class SWP_Twitter extends SWP_Social_Network {
177
  $intent_link = "https://twitter.com/intent/tweet?text=$parameters";
178
 
179
  return $intent_link;
180
-
181
  }
182
 
183
 
@@ -191,7 +178,8 @@ class SWP_Twitter extends SWP_Social_Network {
191
  *
192
  */
193
  public function reset_share_count_source() {
194
- $options = get_option( 'social_warfare_settings' );
 
195
 
196
  if( !empty( $options['tweet_count_source']) && 'newsharecounts' == $options['tweet_count_source'] ) {
197
 
@@ -203,10 +191,11 @@ class SWP_Twitter extends SWP_Social_Network {
203
  }
204
  }
205
 
 
206
  /**
207
  * Displays the admin notice about New Share Counts.
208
  *
209
- * @since 3.2.0 | Created
210
  * @param array $notices All admin notices passed in the 'swp_admin_notices' hook.
211
  * @return array $notices The updated notice array.
212
  */
@@ -225,4 +214,35 @@ class SWP_Twitter extends SWP_Social_Network {
225
  return $notices;
226
  }
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  }
71
  }
72
 
73
  // Debugging
74
+ if ( SWP_Utility::debug( 'twitter' ) ) {
75
  echo '<b>Request URL:</b> ' . $request_url . '<br />';
76
  }
77
 
96
  global $swp_user_options;
97
 
98
  // If the user has enabled Twitter shares....
99
+ if ( SWP_Utility::get_option('twitter_shares') ) :
100
 
101
  // Debugging
102
+ if ( SWP_Utility::debug( 'twitter' ) ) :
103
  echo '<b>Response:</b> ' . $response . '<br />';
104
  endif;
105
 
131
  *
132
  */
133
  public function generate_share_link( $post_data ) {
134
+ $tweet = $this->get_tweet( $post_data );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
  $twitter_link = $this->get_shareable_permalink( $post_data );
137
 
148
  $tweet .= ' @'.str_replace('@','',$twitter_mention);
149
  endif;
150
 
151
+ $author = SWP_User_Profile::get_author( $post_data['ID'] );
152
+
153
+ $user_twitter_handle = get_the_author_meta( 'swp_twitter' , $author );
154
 
155
  if ( $user_twitter_handle ) :
156
  $via_parameter = '&via=' . str_replace( '@','',$user_twitter_handle );
165
  $intent_link = "https://twitter.com/intent/tweet?text=$parameters";
166
 
167
  return $intent_link;
 
168
  }
169
 
170
 
178
  *
179
  */
180
  public function reset_share_count_source() {
181
+ global $swp_user_options;
182
+ $options = $swp_user_options;
183
 
184
  if( !empty( $options['tweet_count_source']) && 'newsharecounts' == $options['tweet_count_source'] ) {
185
 
191
  }
192
  }
193
 
194
+
195
  /**
196
  * Displays the admin notice about New Share Counts.
197
  *
198
+ * @since 3.2.0 | Created
199
  * @param array $notices All admin notices passed in the 'swp_admin_notices' hook.
200
  * @return array $notices The updated notice array.
201
  */
214
  return $notices;
215
  }
216
 
217
+
218
+ /**
219
+ *
220
+ * Retrieves tweet from database and converts to UTF-8 for Twitter.
221
+ *
222
+ * @since 3.3.0 | 16 AUG 2018 | Created. Ported code from $this->generate_share_link.
223
+ * @param array $post_data WordPress post data, such as 'ID' and 'post_content'.
224
+ *
225
+ * @return string $tweet The encoded tweet text.
226
+ *
227
+ */
228
+ protected function get_tweet( $post_data ) {
229
+ $max_tweet_length = 240;
230
+
231
+ // Check for a custom tweet from the post options.
232
+ $tweet = get_post_meta( $post_data['ID'] , 'swp_custom_tweet' , true );
233
+
234
+ if ( empty( $tweet ) ) :
235
+ //* Use the post title.
236
+ $tweet = str_replace( '|', '', strip_tags( $post_data['post_title'] ) );
237
+ elseif ( is_array( $tweet ) ) :
238
+ $tweet = $tweet[0];
239
+ endif;
240
+
241
+ $converted_tweet = mb_convert_encoding( $tweet, 'UTF-8', get_bloginfo( "charset" ) );
242
+ $html_safe_tweet = html_entity_decode( $converted_tweet, ENT_COMPAT, 'UTF-8' );
243
+
244
+ $tweet = utf8_uri_encode( $html_safe_tweet, $max_tweet_length );
245
+
246
+ return $tweet;
247
+ }
248
  }
{functions/plugin-update-checker → lib/update-checker}/.editorconfig RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4/Factory.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Autoloader.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/Extension.php RENAMED
@@ -39,7 +39,7 @@ if ( !class_exists('Puc_v4p4_DebugBar_Extension', false) ):
39
  public function enqueuePanelDependencies() {
40
  wp_enqueue_style(
41
  'puc-debug-bar-style-v4',
42
- $this->getLibraryUrl("/css/puc-debug-bar.css"),
43
  array('debug-bar'),
44
  '20171124'
45
  );
39
  public function enqueuePanelDependencies() {
40
  wp_enqueue_style(
41
  'puc-debug-bar-style-v4',
42
+ $this->getLibraryUrl("/assets/css/puc-debug-bar.css"),
43
  array('debug-bar'),
44
  '20171124'
45
  );
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/Panel.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/PluginExtension.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/PluginPanel.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/DebugBar/ThemePanel.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Factory.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/InstalledPackage.php RENAMED
@@ -53,7 +53,7 @@ if ( !class_exists('Puc_v4p4_InstalledPackage', false) ):
53
  /**
54
  * Parse plugin or theme metadata from the header comment.
55
  *
56
- * This is basically a simplified version of the get_file_data() function from /wp-includes/functions.php.
57
  * It's intended as a utility for subclasses that detect updates by parsing files in a VCS.
58
  *
59
  * @param string|null $content File contents.
53
  /**
54
  * Parse plugin or theme metadata from the header comment.
55
  *
56
+ * This is basically a simplified version of the get_file_data() function from /wp-includes/lib.php.
57
  * It's intended as a utility for subclasses that detect updates by parsing files in a VCS.
58
  *
59
  * @param string|null $content File contents.
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Metadata.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/OAuthSignature.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/Info.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/Package.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/Ui.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/Update.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Plugin/UpdateChecker.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Scheduler.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/StateStore.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Theme/Package.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Theme/Update.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Theme/UpdateChecker.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Update.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/UpdateChecker.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/UpgraderStatus.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Utils.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/Api.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/BaseChecker.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/BitBucketApi.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/GitHubApi.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/GitLabApi.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/PluginUpdateChecker.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/Reference.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/Puc/v4p4/Vcs/ThemeUpdateChecker.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/README.md RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/composer.json RENAMED
@@ -1,22 +1,22 @@
1
- {
2
- "name": "yahnis-elsts/plugin-update-checker",
3
- "type": "library",
4
- "description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.",
5
- "keywords": ["wordpress", "plugin updates", "automatic updates", "theme updates"],
6
- "homepage": "https://github.com/YahnisElsts/plugin-update-checker/",
7
- "license": "MIT",
8
- "authors": [
9
- {
10
- "name": "Yahnis Elsts",
11
- "email": "whiteshadow@w-shadow.com",
12
- "homepage": "http://w-shadow.com/",
13
- "role": "Developer"
14
- }
15
- ],
16
- "require": {
17
- "php": ">=5.2.0"
18
- },
19
- "autoload": {
20
- "files": ["plugin-update-checker.php"]
21
- }
22
  }
1
+ {
2
+ "name": "yahnis-elsts/plugin-update-checker",
3
+ "type": "library",
4
+ "description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.",
5
+ "keywords": ["wordpress", "plugin updates", "automatic updates", "theme updates"],
6
+ "homepage": "https://github.com/YahnisElsts/plugin-update-checker/",
7
+ "license": "MIT",
8
+ "authors": [
9
+ {
10
+ "name": "Yahnis Elsts",
11
+ "email": "whiteshadow@w-shadow.com",
12
+ "homepage": "http://w-shadow.com/",
13
+ "role": "Developer"
14
+ }
15
+ ],
16
+ "require": {
17
+ "php": ">=5.2.0"
18
+ },
19
+ "autoload": {
20
+ "files": ["plugin-update-checker.php"]
21
+ }
22
  }
{functions/plugin-update-checker → lib/update-checker}/css/puc-debug-bar.css RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/examples/plugin.json RENAMED
@@ -1,52 +1,52 @@
1
- {
2
- "name": "My Example Plugin",
3
- "version": "2.0",
4
- "download_url": "http://example.com/updates/example-plugin.zip",
5
-
6
- "homepage": "http://example.com/",
7
- "requires": "4.5",
8
- "tested": "4.8",
9
- "last_updated": "2017-01-01 16:17:00",
10
- "upgrade_notice": "Here's why you should upgrade...",
11
-
12
- "author": "Janis Elsts",
13
- "author_homepage": "http://example.com/",
14
-
15
- "sections": {
16
- "description": "(Required) Plugin description. Basic HTML can be used in all sections.",
17
- "installation": "(Recommended) Installation instructions.",
18
- "changelog": "(Recommended) Changelog. <p>This section will be displayed by default when the user clicks 'View version x.y.z details'.</p>",
19
- "custom_section": "This is a custom section labeled 'Custom Section'."
20
- },
21
-
22
- "icons" : {
23
- "1x" : "http://w-shadow.com/files/external-update-example/assets/icon-128x128.png",
24
- "2x" : "http://w-shadow.com/files/external-update-example/assets/icon-256x256.png"
25
- },
26
-
27
- "banners": {
28
- "low": "http://w-shadow.com/files/external-update-example/assets/banner-772x250.png",
29
- "high": "http://w-shadow.com/files/external-update-example/assets/banner-1544x500.png"
30
- },
31
-
32
- "translations": [
33
- {
34
- "language": "fr_FR",
35
- "version": "4.0",
36
- "updated": "2016-04-22 23:22:42",
37
- "package": "http://example.com/updates/translations/french-language-pack.zip"
38
- },
39
- {
40
- "language": "de_DE",
41
- "version": "5.0",
42
- "updated": "2016-04-22 23:22:42",
43
- "package": "http://example.com/updates/translations/german-language-pack.zip"
44
- }
45
- ],
46
-
47
- "rating": 90,
48
- "num_ratings": 123,
49
-
50
- "downloaded": 1234,
51
- "active_installs": 12345
52
  }
1
+ {
2
+ "name": "My Example Plugin",
3
+ "version": "2.0",
4
+ "download_url": "http://example.com/updates/example-plugin.zip",
5
+
6
+ "homepage": "http://example.com/",
7
+ "requires": "4.5",
8
+ "tested": "4.8",
9
+ "last_updated": "2017-01-01 16:17:00",
10
+ "upgrade_notice": "Here's why you should upgrade...",
11
+
12
+ "author": "Janis Elsts",
13
+ "author_homepage": "http://example.com/",
14
+
15
+ "sections": {
16
+ "description": "(Required) Plugin description. Basic HTML can be used in all sections.",
17
+ "installation": "(Recommended) Installation instructions.",
18
+ "changelog": "(Recommended) Changelog. <p>This section will be displayed by default when the user clicks 'View version x.y.z details'.</p>",
19
+ "custom_section": "This is a custom section labeled 'Custom Section'."
20
+ },
21
+
22
+ "icons" : {
23
+ "1x" : "http://w-shadow.com/files/external-update-example/assets/icon-128x128.png",
24
+ "2x" : "http://w-shadow.com/files/external-update-example/assets/icon-256x256.png"
25
+ },
26
+
27
+ "banners": {
28
+ "low": "http://w-shadow.com/files/external-update-example/assets/banner-772x250.png",
29
+ "high": "http://w-shadow.com/files/external-update-example/assets/banner-1544x500.png"
30
+ },
31
+
32
+ "translations": [
33
+ {
34
+ "language": "fr_FR",
35
+ "version": "4.0",
36
+ "updated": "2016-04-22 23:22:42",
37
+ "package": "http://example.com/updates/translations/french-language-pack.zip"
38
+ },
39
+ {
40
+ "language": "de_DE",
41
+ "version": "5.0",
42
+ "updated": "2016-04-22 23:22:42",
43
+ "package": "http://example.com/updates/translations/german-language-pack.zip"
44
+ }
45
+ ],
46
+
47
+ "rating": 90,
48
+ "num_ratings": 123,
49
+
50
+ "downloaded": 1234,
51
+ "active_installs": 12345
52
  }
{functions/plugin-update-checker → lib/update-checker}/examples/theme.json RENAMED
@@ -1,5 +1,5 @@
1
- {
2
- "version": "2.0",
3
- "details_url": "http://example.com/version-2.0-details.html",
4
- "download_url": "http://example.com/example-theme-2.0.zip"
5
  }
1
+ {
2
+ "version": "2.0",
3
+ "details_url": "http://example.com/version-2.0-details.html",
4
+ "download_url": "http://example.com/example-theme-2.0.zip"
5
  }
{functions/plugin-update-checker → lib/update-checker}/js/debug-bar.js RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-cs_CZ.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-cs_CZ.po RENAMED
@@ -1,45 +1,45 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: plugin-update-checker\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2017-05-20 10:53+0300\n"
6
- "PO-Revision-Date: 2017-07-05 15:39+0000\n"
7
- "Last-Translator: Vojtěch Sajdl <vojtech@sajdl.com>\n"
8
- "Language-Team: Czech (Czech Republic)\n"
9
- "Language: cs-CZ\n"
10
- "Plural-Forms: nplurals=2; plural=(n != 1)\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "X-Loco-Source-Locale: cs_CZ\n"
15
- "X-Generator: Loco - https://localise.biz/\n"
16
- "X-Poedit-Basepath: ..\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Loco-Parser: loco_parse_po"
21
-
22
- #: Puc/v4p1/Plugin/UpdateChecker.php:358
23
- msgid "Check for updates"
24
- msgstr "Zkontrolovat aktualizace"
25
-
26
- #: Puc/v4p1/Plugin/UpdateChecker.php:405
27
- #, php-format
28
- msgctxt "the plugin title"
29
- msgid "The %s plugin is up to date."
30
- msgstr "Plugin %s je aktuální."
31
-
32
- #: Puc/v4p1/Plugin/UpdateChecker.php:407
33
- #, php-format
34
- msgctxt "the plugin title"
35
- msgid "A new version of the %s plugin is available."
36
- msgstr "Nová verze pluginu %s je dostupná."
37
-
38
- #: Puc/v4p1/Plugin/UpdateChecker.php:409
39
- #, php-format
40
- msgid "Unknown update checker status \"%s\""
41
- msgstr "Neznámý status kontroly aktualizací \"%s\""
42
-
43
- #: Puc/v4p1/Vcs/PluginUpdateChecker.php:83
44
- msgid "There is no changelog available."
45
- msgstr "Changelog není dostupný."
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: plugin-update-checker\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2017-05-20 10:53+0300\n"
6
+ "PO-Revision-Date: 2017-07-05 15:39+0000\n"
7
+ "Last-Translator: Vojtěch Sajdl <vojtech@sajdl.com>\n"
8
+ "Language-Team: Czech (Czech Republic)\n"
9
+ "Language: cs-CZ\n"
10
+ "Plural-Forms: nplurals=2; plural=(n != 1)\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Loco-Source-Locale: cs_CZ\n"
15
+ "X-Generator: Loco - https://localise.biz/\n"
16
+ "X-Poedit-Basepath: ..\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+ "X-Loco-Parser: loco_parse_po"
21
+
22
+ #: Puc/v4p1/Plugin/UpdateChecker.php:358
23
+ msgid "Check for updates"
24
+ msgstr "Zkontrolovat aktualizace"
25
+
26
+ #: Puc/v4p1/Plugin/UpdateChecker.php:405
27
+ #, php-format
28
+ msgctxt "the plugin title"
29
+ msgid "The %s plugin is up to date."
30
+ msgstr "Plugin %s je aktuální."
31
+
32
+ #: Puc/v4p1/Plugin/UpdateChecker.php:407
33
+ #, php-format
34
+ msgctxt "the plugin title"
35
+ msgid "A new version of the %s plugin is available."
36
+ msgstr "Nová verze pluginu %s je dostupná."
37
+
38
+ #: Puc/v4p1/Plugin/UpdateChecker.php:409
39
+ #, php-format
40
+ msgid "Unknown update checker status \"%s\""
41
+ msgstr "Neznámý status kontroly aktualizací \"%s\""
42
+
43
+ #: Puc/v4p1/Vcs/PluginUpdateChecker.php:83
44
+ msgid "There is no changelog available."
45
+ msgstr "Changelog není dostupný."
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-da_DK.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-da_DK.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-de_DE.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-de_DE.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fa_IR.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fa_IR.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fr_CA.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fr_CA.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fr_FR.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-fr_FR.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-hu_HU.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-hu_HU.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-it_IT.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-it_IT.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-ja.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-ja.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-nl_BE.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-nl_BE.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-nl_NL.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-nl_NL.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-pt_BR.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-pt_BR.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-sv_SE.mo RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker-sv_SE.po RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/languages/plugin-update-checker.pot RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/license.txt RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/plugin-update-checker.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/vendor/Parsedown.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/vendor/ParsedownLegacy.php RENAMED
File without changes
{functions/plugin-update-checker → lib/update-checker}/vendor/readme-parser.php RENAMED
File without changes
{functions → lib}/utilities/SWP_Abstract.php RENAMED
@@ -114,7 +114,6 @@ class SWP_Abstract {
114
  $this->user_options = get_option( 'social_warfare_settings' );
115
 
116
  add_action('plugins_loaded', array( $this , 'load_social_networks' ) , 1000 );
117
-
118
  }
119
 
120
 
@@ -131,6 +130,7 @@ class SWP_Abstract {
131
  $this->networks = $swp_social_networks;
132
  }
133
 
 
134
  public function get_property( $property ) {
135
  if ( property_exists( __CLASS__, $property ) ) {
136
  return $this->$property;
@@ -140,13 +140,16 @@ class SWP_Abstract {
140
  }
141
 
142
 
143
- public function get_all_icons() {
144
  return $this->networks;
145
  }
146
 
 
147
  public function get_user_icons() {
148
- if ( isset( $this->user_options['order_of_icons'] ) ) :
149
- $user_icons = $this->user_options['order_of_icons'];
 
 
150
  else:
151
  $user_icons = [
152
  'google_plus' => 'google_plus',
@@ -157,18 +160,6 @@ class SWP_Abstract {
157
  ];
158
  endif;
159
 
160
- if ( empty( $user_icons ) ):
161
- $all_icons = $this->get_all_icons();
162
- $defaults = array();
163
-
164
- foreach( $all_icons as $network_key => $network_obj ) {
165
- $defaults[$network_key] = $network_obj;
166
- }
167
-
168
- return $defaults;
169
-
170
- endif;
171
-
172
  if ( is_array( $user_icons ) && array_key_exists( 'active', $user_icons) ) :
173
  return $user_icons['active'];
174
  endif;
@@ -195,6 +186,7 @@ class SWP_Abstract {
195
  return $this;
196
  }
197
 
 
198
  public function set_priority( $priority ) {
199
  if ( ! intval( $priority ) || $priority < 1) {
200
  $this->_throw("Requires an integer greater than 0.");
@@ -205,6 +197,7 @@ class SWP_Abstract {
205
  return $this;
206
  }
207
 
 
208
  /**
209
  * Creates a Javscript selector keyname based on the object's name.
210
  *
@@ -226,6 +219,7 @@ class SWP_Abstract {
226
  return strtolower( $key );
227
  }
228
 
 
229
  /**
230
  * Set the premium status of the object.
231
  *
@@ -258,11 +252,13 @@ class SWP_Abstract {
258
  return $this;
259
  }
260
 
 
261
  public function get_priority_map( $object) {
262
 
263
  return array_values( $this->object_to_array( $object ) );
264
  }
265
 
 
266
  public function object_to_array ( $object ) {
267
  if(!is_object($object) && !is_array($object)):
268
  return $object;
@@ -271,6 +267,7 @@ class SWP_Abstract {
271
  return array_map( [$this, 'object_to_array'], (array) $object);
272
  }
273
 
 
274
  /**
275
  * Sorts all core, premium, and third-party items by their designated priority.
276
  *
@@ -334,7 +331,6 @@ class SWP_Abstract {
334
  }
335
 
336
 
337
-
338
  /**
339
  * Adds the SWP dependency attributes, if this object has a dependency set.
340
  *
114
  $this->user_options = get_option( 'social_warfare_settings' );
115
 
116
  add_action('plugins_loaded', array( $this , 'load_social_networks' ) , 1000 );
 
117
  }
118
 
119
 
130
  $this->networks = $swp_social_networks;
131
  }
132
 
133
+
134
  public function get_property( $property ) {
135
  if ( property_exists( __CLASS__, $property ) ) {
136
  return $this->$property;
140
  }
141
 
142
 
143
+ public function get_all_networks() {
144
  return $this->networks;
145
  }
146
 
147
+
148
  public function get_user_icons() {
149
+ $options = get_option( 'social_warfare_settings' );
150
+
151
+ if ( isset( $options['order_of_icons'] ) ) :
152
+ $user_icons = $options['order_of_icons'];
153
  else:
154
  $user_icons = [
155
  'google_plus' => 'google_plus',
160
  ];
161
  endif;
162
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  if ( is_array( $user_icons ) && array_key_exists( 'active', $user_icons) ) :
164
  return $user_icons['active'];
165
  endif;
186
  return $this;
187
  }
188
 
189
+
190
  public function set_priority( $priority ) {
191
  if ( ! intval( $priority ) || $priority < 1) {
192
  $this->_throw("Requires an integer greater than 0.");
197
  return $this;
198
  }
199
 
200
+
201
  /**
202
  * Creates a Javscript selector keyname based on the object's name.
203
  *
219
  return strtolower( $key );
220
  }
221
 
222
+
223
  /**
224
  * Set the premium status of the object.
225
  *
252
  return $this;
253
  }
254
 
255
+
256
  public function get_priority_map( $object) {
257
 
258
  return array_values( $this->object_to_array( $object ) );
259
  }
260
 
261
+
262
  public function object_to_array ( $object ) {
263
  if(!is_object($object) && !is_array($object)):
264
  return $object;
267
  return array_map( [$this, 'object_to_array'], (array) $object);
268
  }
269
 
270
+
271
  /**
272
  * Sorts all core, premium, and third-party items by their designated priority.
273
  *
331
  }
332
 
333
 
 
334
  /**
335
  * Adds the SWP dependency attributes, if this object has a dependency set.
336
  *
{functions → lib}/utilities/SWP_CURL.php RENAMED
@@ -14,7 +14,7 @@ class SWP_CURL {
14
 
15
  public static function fetch_shares_via_curl_multi( $links ) {
16
 
17
- if ( _swp_is_debug( 'is_cache_fresh' ) ) :
18
  $started = time();
19
  echo "Starting multi curl request at : " . $started;
20
  endif;
14
 
15
  public static function fetch_shares_via_curl_multi( $links ) {
16
 
17
+ if ( SWP_Utility::debug( 'is_cache_fresh' ) ) :
18
  $started = time();
19
  echo "Starting multi curl request at : " . $started;
20
  endif;
{functions → lib}/utilities/SWP_Compatibility.php RENAMED
@@ -63,7 +63,7 @@ class SWP_Compatibility {
63
  delete_post_meta( $id , '_pinterest_shares' );
64
  delete_post_meta( $id , '_pocket_shares' );
65
  delete_post_meta( $id , '_reddit_shares' );
66
- delete_post_meta( $id , '_stumbleupon_shares' );
67
  delete_post_meta( $id , '_tumblr_shares' );
68
  delete_post_meta( $id , '_twitter_shares' );
69
  delete_post_meta( $id , '_whatsapp_shares' );
@@ -80,7 +80,7 @@ class SWP_Compatibility {
80
  delete_post_meta( $id , 'bitly_link_pinterest' );
81
  delete_post_meta( $id , 'bitly_link_pocket' );
82
  delete_post_meta( $id , 'bitly_link_reddit' );
83
- delete_post_meta( $id , 'bitly_link_stumbleupon' );
84
  delete_post_meta( $id , 'bitly_link_tumblr' );
85
  delete_post_meta( $id , 'bitly_link_twitter' );
86
  delete_post_meta( $id , 'bitly_link_whatsapp' );
63
  delete_post_meta( $id , '_pinterest_shares' );
64
  delete_post_meta( $id , '_pocket_shares' );
65
  delete_post_meta( $id , '_reddit_shares' );
66
+ delete_post_meta( $id , '_mix_shares' );
67
  delete_post_meta( $id , '_tumblr_shares' );
68
  delete_post_meta( $id , '_twitter_shares' );
69
  delete_post_meta( $id , '_whatsapp_shares' );
80
  delete_post_meta( $id , 'bitly_link_pinterest' );
81
  delete_post_meta( $id , 'bitly_link_pocket' );
82
  delete_post_meta( $id , 'bitly_link_reddit' );
83
+ delete_post_meta( $id , 'bitly_link_mix' );
84
  delete_post_meta( $id , 'bitly_link_tumblr' );
85
  delete_post_meta( $id , 'bitly_link_twitter' );
86
  delete_post_meta( $id , 'bitly_link_whatsapp' );
{functions → lib}/utilities/SWP_Database_Migration.php RENAMED
@@ -34,12 +34,8 @@ class SWP_Database_Migration {
34
  *
35
  */
36
  public function __construct() {
37
-
38
- // Set up the defaults before directing into the template functions.
39
- add_action( 'template_redirect' , array( $this , 'scan_for_new_defaults' ) );
40
-
41
  // Queue up the migrate features to run after plugins are loaded.
42
- add_action( 'plugins_loaded', array( $this, 'init' ) );
43
  }
44
 
45
 
@@ -71,8 +67,6 @@ class SWP_Database_Migration {
71
  }
72
 
73
  $this->debug_parameters();
74
-
75
-
76
  }
77
 
78
 
@@ -92,38 +86,68 @@ class SWP_Database_Migration {
92
  * @return void
93
  */
94
  public function debug_parameters() {
 
95
 
96
  // Output an array of user options if called via a debugging parameter.
97
- if ( true === _swp_is_debug('get_user_options') ) :
98
  echo "<pre>";
99
  var_export( get_option( 'social_warfare_settings', array() ) );
100
  echo "</pre>";
101
  wp_die();
102
  endif;
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  // Migrate settings page if explicitly being called via a debugging parameter.
105
- if ( true === _swp_is_debug('migrate_db') ) {
106
  $this->migrate();
107
  }
108
 
109
  // Initialize database if explicitly being called via a debugging parameter.
110
- if ( true === _swp_is_debug('initialize_db') ) {
111
  $this->initialize_db();
112
  }
113
 
114
  // Update post meta if explicitly being called via a debugging parameter.
115
- if ( true === _swp_is_debug('migrate_post_meta') ) {
116
  $this->update_post_meta();
117
  $this->update_hidden_post_meta();
118
  }
119
 
120
  // Output the last_migrated status if called via a debugging parameter.
121
- if ( true === _swp_is_Debug('get_last_migrated') ) {
122
  $this->get_last_migrated( true );
123
  }
124
 
125
  // Update the last migrated status if called via a debugging parameter.
126
- if ( true === _swp_is_Debug('update_last_migrated') ) {
127
  $this->update_last_migrated();
128
  }
129
  }
@@ -181,43 +205,7 @@ class SWP_Database_Migration {
181
  return count( $old_metadata ) === 0;
182
  }
183
 
184
- /**
185
- * Creates the default value for any new keys.
186
- *
187
- * @since 3.0.8 | 16 MAY 2018 | Created the method.
188
- * @since 3.0.8 | 24 MAY 2018 | Added check for order_of_icons
189
- * @since 3.1.0 | 13 JUN 2018 | Replaced array bracket notation.
190
- * @param void
191
- * @return void
192
- *
193
- */
194
- public function scan_for_new_defaults() {
195
- global $swp_user_options;
196
-
197
- $updated = false;
198
- $defaults = apply_filters( 'swp_options_page_defaults', array() );
199
-
200
- // Manually set the order_of_icons default.
201
- $defaults['order_of_icons'] = array(
202
- 'google_plus' => 'google_plus',
203
- 'twitter' => 'twitter',
204
- 'facebook' => 'facebook',
205
- 'linkedin' => 'linkedin',
206
- 'pinterest' => 'pinterest'
207
- );
208
-
209
- foreach ($defaults as $key => $value ) {
210
- if ( !array_key_exists( $key, $swp_user_options) ) :
211
- $swp_user_options[$key] = $value;
212
- $updated = true;
213
- endif;
214
- }
215
-
216
- if ( $updated ) {
217
- update_option( 'social_warfare_settings', $swp_user_options );
218
- }
219
 
220
- }
221
 
222
 
223
  /**
34
  *
35
  */
36
  public function __construct() {
 
 
 
 
37
  // Queue up the migrate features to run after plugins are loaded.
38
+ add_action( 'plugins_loaded', array( $this, 'init' ), 100 );
39
  }
40
 
41
 
67
  }
68
 
69
  $this->debug_parameters();
 
 
70
  }
71
 
72
 
86
  * @return void
87
  */
88
  public function debug_parameters() {
89
+ global $post, $swp_user_options;
90
 
91
  // Output an array of user options if called via a debugging parameter.
92
+ if ( true === SWP_Utility::debug('get_user_options') ) :
93
  echo "<pre>";
94
  var_export( get_option( 'social_warfare_settings', array() ) );
95
  echo "</pre>";
96
  wp_die();
97
  endif;
98
 
99
+ if ( true === SWP_Utility::debug('get_filtered_options') ) :
100
+ global $swp_user_options;
101
+ echo "<pre>";
102
+ var_export( $swp_user_options );
103
+ echo "</pre>";
104
+ wp_die();
105
+ endif;
106
+
107
+ if ( true == SWP_Utility::debug('get_post_meta') ) :
108
+ if ( !is_object( $post ) ) :
109
+ wp_die( "There is no post object for this url." );
110
+ endif;
111
+
112
+ $meta = get_post_meta( $post->ID );
113
+
114
+ if ($meta) :
115
+
116
+ echo "<pre>";
117
+ var_export( $meta );
118
+ echo "</pre>";
119
+ wp_die();
120
+
121
+ else :
122
+ wp_die( "No post meta for " . $post->post_title );
123
+ endif;
124
+
125
+ endif;
126
+
127
+
128
  // Migrate settings page if explicitly being called via a debugging parameter.
129
+ if ( true === SWP_Utility::debug('migrate_db') ) {
130
  $this->migrate();
131
  }
132
 
133
  // Initialize database if explicitly being called via a debugging parameter.
134
+ if ( true === SWP_Utility::debug('initialize_db') ) {
135
  $this->initialize_db();
136
  }
137
 
138
  // Update post meta if explicitly being called via a debugging parameter.
139
+ if ( true === SWP_Utility::debug('migrate_post_meta') ) {
140
  $this->update_post_meta();
141
  $this->update_hidden_post_meta();
142
  }
143
 
144
  // Output the last_migrated status if called via a debugging parameter.
145
+ if ( true === SWP_Utility::debug('get_last_migrated') ) {
146
  $this->get_last_migrated( true );
147
  }
148
 
149
  // Update the last migrated status if called via a debugging parameter.
150
+ if ( true === SWP_Utility::debug('update_last_migrated') ) {
151
  $this->update_last_migrated();
152
  }
153
  }
205
  return count( $old_metadata ) === 0;
206
  }
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
 
209
 
210
 
211
  /**
{functions → lib}/utilities/SWP_JSON_Cache_Handler.php RENAMED
@@ -104,7 +104,7 @@ class SWP_JSON_Cache_Handler {
104
  private function is_cache_fresh() {
105
 
106
  // If we're debugging, the cache is expired and needs to fetch.
107
- if( true == _swp_is_debug( 'json_fetch' ) ):
108
  return false;
109
  endif;
110
 
@@ -139,7 +139,7 @@ class SWP_JSON_Cache_Handler {
139
  *
140
  */
141
  private function debug() {
142
- if( true === _swp_is_debug( 'json_fetch') ):
143
  var_dump($this);
144
  endif;
145
  }
104
  private function is_cache_fresh() {
105
 
106
  // If we're debugging, the cache is expired and needs to fetch.
107
+ if( true == SWP_Utility::debug( 'json_fetch' ) ):
108
  return false;
109
  endif;
110
 
139
  *
140
  */
141
  private function debug() {
142
+ if( true === SWP_Utility::debug( 'json_fetch') ):
143
  var_dump($this);
144
  endif;
145
  }
{functions → lib}/utilities/SWP_Localization.php RENAMED
File without changes
{functions → lib}/utilities/SWP_Notice.php RENAMED
@@ -298,7 +298,11 @@ class SWP_Notice {
298
  $html .= '<div class="swp-actions">';
299
 
300
  foreach( $this->actions as $cta) {
301
- $html .= '<a class="swp-notice-cta ' . $cta['class'] . '" href="' . $cta['href'] . '" target="' . $cta['target'] . '" data-timeframe="' . $cta['timeframe'].'">';
 
 
 
 
302
  $html .= $cta['action'];
303
  $html .= "</a>";
304
  }
@@ -330,11 +334,7 @@ class SWP_Notice {
330
  return $notices;
331
  endif;
332
 
333
- if ( empty( $this->html ) ) :
334
- $this->render_HTML();
335
- endif;
336
-
337
- return $notices .= $this->html;
338
  }
339
 
340
 
298
  $html .= '<div class="swp-actions">';
299
 
300
  foreach( $this->actions as $cta) {
301
+ $class = isset( $cta['class'] ) ? $cta['class'] : '';
302
+ $href = isset( $cta['href'] ) ? $cta['href'] : '';
303
+ $target = isset( $cta['target'] ) ? $cta['target'] : '';
304
+ $timeframe = isset( $cta['timeframe'] ) ? $cta['timeframe'] : 0;
305
+ $html .= '<a class="swp-notice-cta ' . $class . '" href="' . $href . '" target="' . $target . '" data-timeframe="' . $timeframe .'">';
306
  $html .= $cta['action'];
307
  $html .= "</a>";
308
  }
334
  return $notices;
335
  endif;
336
 
337
+ return $this->html;
 
 
 
 
338
  }
339
 
340
 
{functions → lib}/utilities/SWP_Notice_Loader.php RENAMED
@@ -96,7 +96,7 @@ class SWP_Notice_Loader {
96
  *
97
  */
98
  private function debug() {
99
- if( true === _swp_is_debug( 'notices' ) ):
100
  var_dump($this);
101
  endif;
102
  }
96
  *
97
  */
98
  private function debug() {
99
+ if( true === SWP_Utility::debug( 'notices' ) ):
100
  var_dump($this);
101
  endif;
102
  }
{functions → lib}/utilities/SWP_Permalink.php RENAMED
File without changes
{functions → lib}/utilities/SWP_Plugin_Updater.php RENAMED
@@ -510,7 +510,7 @@ class SWP_Plugin_Updater {
510
  }
511
 
512
  private function debug() {
513
- if ( true === _swp_is_debug( 'remove_plugin_transient' ) ) :
514
  add_filter('site_transient_update_plugins', function($transient_data) {
515
  unset($transient_data->response['social-warfare-pro/social-warfare-pro.php']);
516
  unset($transient_data->response['social-warfare-affiliatewp/social-warfare-affiliatewp.php']);
510
  }
511
 
512
  private function debug() {
513
+ if ( true === SWP_Utility::debug( 'remove_plugin_transient' ) ) :
514
  add_filter('site_transient_update_plugins', function($transient_data) {
515
  unset($transient_data->response['social-warfare-pro/social-warfare-pro.php']);
516
  unset($transient_data->response['social-warfare-affiliatewp/social-warfare-affiliatewp.php']);
{functions → lib}/utilities/SWP_Post_Cache.php RENAMED
@@ -98,7 +98,7 @@ class SWP_Post_Cache {
98
  *
99
  */
100
  private function debug() {
101
- if( true === _swp_is_debug('swp_share_cache') ):
102
  echo "<pre>", var_dump( $this ), "</pre>";
103
  endif;
104
  }
@@ -297,6 +297,7 @@ class SWP_Post_Cache {
297
  public function rebuild_cached_data() {
298
 
299
  if( true === $this->should_shares_be_fetched() ):
 
300
  $this->rebuild_share_counts();
301
  endif;
302
 
@@ -322,9 +323,11 @@ class SWP_Post_Cache {
322
  *
323
  */
324
  private function should_shares_be_fetched() {
 
 
325
 
326
  // Don't fetch if all share counts are disabled.
327
- if( false == swp_get_option( 'network_shares' ) && false == swp_get_option( 'total_shares' ) ) {
328
  $this->debug_message( 'No Shares Fetched. Share counts are disabled in the settings.' );
329
  return false;
330
  }
@@ -478,14 +481,9 @@ class SWP_Post_Cache {
478
  *
479
  */
480
  protected function rebuild_share_counts() {
481
- global $swp_social_networks, $swp_user_options;
482
 
483
  $this->establish_permalinks();
484
- $this->establish_api_request_urls();
485
- $this->fetch_api_responses();
486
- $this->parse_api_responses();
487
- $this->calculate_network_shares();
488
- $this->cache_share_counts();
489
  }
490
 
491
 
@@ -525,6 +523,9 @@ class SWP_Post_Cache {
525
  $this->permalinks = apply_filters( 'swp_recovery_filter', $this->permalinks );
526
  endforeach;
527
 
 
 
 
528
  }
529
 
530
 
@@ -549,6 +550,9 @@ class SWP_Post_Cache {
549
  ++$current_request;
550
  }
551
  }
 
 
 
552
  }
553
 
554
 
@@ -571,6 +575,9 @@ class SWP_Post_Cache {
571
  $this->raw_api_responses[$current_request] = SWP_CURL::fetch_shares_via_curl_multi( $networks );
572
  $current_request++;
573
  }
 
 
 
574
  }
575
 
576
 
@@ -604,6 +611,9 @@ class SWP_Post_Cache {
604
  $current_request++;
605
  }
606
  }
 
 
 
607
  }
608
 
609
 
@@ -626,7 +636,6 @@ class SWP_Post_Cache {
626
  global $swp_social_networks, $swp_user_options;
627
 
628
  $share_counts = array();
629
-
630
  $checked_networks = array();
631
 
632
  foreach ( $this->parsed_api_responses as $request => $networks ) {
@@ -656,6 +665,8 @@ class SWP_Post_Cache {
656
  endif;
657
 
658
  $this->share_counts = $share_counts;
 
 
659
  }
660
 
661
 
@@ -693,7 +704,7 @@ class SWP_Post_Cache {
693
 
694
  // We only update to newly fetched numbers if they're bigger than
695
  // the old ones unless the url parameter is forcing it to take.
696
- if ( $count <= $previous_count && false === _swp_is_debug( 'force_new_shares' ) ) {
697
  $this->share_counts[$key] = $previous_count;
698
  $this->share_counts['total_shares'] += $previous_count;
699
  } else {
98
  *
99
  */
100
  private function debug() {
101
+ if( true === SWP_Utility::debug('swp_share_cache') ):
102
  echo "<pre>", var_dump( $this ), "</pre>";
103
  endif;
104
  }
297
  public function rebuild_cached_data() {
298
 
299
  if( true === $this->should_shares_be_fetched() ):
300
+
301
  $this->rebuild_share_counts();
302
  endif;
303
 
323
  *
324
  */
325
  private function should_shares_be_fetched() {
326
+ global $swp_user_options;
327
+ // Don't fetch if all share counts are disabled.
328
 
329
  // Don't fetch if all share counts are disabled.
330
+ if( false == SWP_Utility::get_option( 'network_shares' ) && false == SWP_Utility::get_option( 'total_shares' ) ) {
331
  $this->debug_message( 'No Shares Fetched. Share counts are disabled in the settings.' );
332
  return false;
333
  }
481
  *
482
  */
483
  protected function rebuild_share_counts() {
 
484
 
485
  $this->establish_permalinks();
486
+
 
 
 
 
487
  }
488
 
489
 
523
  $this->permalinks = apply_filters( 'swp_recovery_filter', $this->permalinks );
524
  endforeach;
525
 
526
+ $this->establish_api_request_urls();
527
+
528
+
529
  }
530
 
531
 
550
  ++$current_request;
551
  }
552
  }
553
+
554
+ $this->fetch_api_responses();
555
+
556
  }
557
 
558
 
575
  $this->raw_api_responses[$current_request] = SWP_CURL::fetch_shares_via_curl_multi( $networks );
576
  $current_request++;
577
  }
578
+
579
+ $this->parse_api_responses();
580
+
581
  }
582
 
583
 
611
  $current_request++;
612
  }
613
  }
614
+
615
+ $this->calculate_network_shares();
616
+
617
  }
618
 
619
 
636
  global $swp_social_networks, $swp_user_options;
637
 
638
  $share_counts = array();
 
639
  $checked_networks = array();
640
 
641
  foreach ( $this->parsed_api_responses as $request => $networks ) {
665
  endif;
666
 
667
  $this->share_counts = $share_counts;
668
+
669
+ $this->cache_share_counts();
670
  }
671
 
672
 
704
 
705
  // We only update to newly fetched numbers if they're bigger than
706
  // the old ones unless the url parameter is forcing it to take.
707
+ if ( $count <= $previous_count && false === SWP_Utility::debug( 'force_new_shares' ) ) {
708
  $this->share_counts[$key] = $previous_count;
709
  $this->share_counts['total_shares'] += $previous_count;
710
  } else {
{functions → lib}/utilities/SWP_Post_Cache_Loader.php RENAMED
File without changes
{functions → lib}/utilities/SWP_URL_Management.php RENAMED
@@ -63,7 +63,7 @@ class SWP_URL_Management {
63
  endif;
64
 
65
  // Check if Analytics have been enabled or not
66
- if ( true == swp_get_option('google_analytics') ) :
67
  $url_string = 'utm_source=' . $network . '&utm_medium=' . $options['analytics_medium'] . '&utm_campaign=' . $options['analytics_campaign'] . '';
68
 
69
  if ( strpos( $url,'?' ) !== false ) :
@@ -93,181 +93,107 @@ class SWP_URL_Management {
93
  *
94
  */
95
  public function link_shortener( $array ) {
96
- global $swp_user_options;
97
-
98
- if ( $array['network'] == 'total_shares' || $array['network'] == 'pinterest') :
99
- return $array;
100
- endif;
101
-
102
- $url = $array['url'];
103
- $network = $array['network'];
104
- $postID = $array['postID'];
105
-
106
- // Fetch the User's Options
107
- $options = $swp_user_options;
108
-
109
- // If Link shortening is activated....
110
- if ( $options['bitly_authentication'] == true ) :
111
-
112
- // If Bitly is activated and we have all the appropriate credentials....
113
- if ( isset( $options['bitly_access_token'] ) ) :
114
-
115
- // Collect our bitly login information
116
- $access_token = $options['bitly_access_token'];
117
-
118
- // If Google Analytics is Activated....
119
- if ( swp_get_option('google_analytics') == true ) :
120
-
121
- // If the link has already been shortened....
122
- $existingURL = get_post_meta( $postID,'bitly_link_' . $network,true );
123
-
124
- // If the Cache is still fresh or a previous API request failed....
125
- if ( ( true === $array['fresh_cache'] && $existingURL) || (isset( $_GLOBALS['bitly_status'] ) && $_GLOBALS['bitly_status'] == 'failure') ) :
126
-
127
- if ( $existingURL ) :
128
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
129
- $array['url'] = $existingURL;
130
- return $array;
131
-
132
- // If the link has NOT already been shortened
133
- else :
134
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
135
- // ....Return the normal URL
136
- return $array;
137
-
138
- endif;
139
 
140
- // If the Cache is NOT fresh....
141
- else :
 
 
142
 
143
- // If the API provides a shortened URL...
144
- $shortURL = $this->make_bitly_url( urldecode( $url ) , $network , $access_token );
145
- if ( $shortURL ) :
146
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
147
 
148
- // Store the link in the cache and return it to the buttons
149
- delete_post_meta( $postID,'bitly_link_' . $network );
150
- update_post_meta( $postID,'bitly_link_' . $network,$shortURL );
151
- $array['url'] = $shortURL;
152
- return $array;
153
 
154
- // If the API does not provide a shortened URL....
155
- else :
156
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
 
157
 
158
- // Set a variable we'll check to avoid multiple calls to bitly upon the first failure
159
- $_GLOBALS['sw']['bitly_status'] = 'failure';
 
 
 
160
 
161
- // Return the normal URL
162
- return $array;
163
 
164
- // End the check for a shortneing link from the API
165
- endif;
166
 
167
- // End the check for the cache being fresh
168
- endif;
 
169
 
170
- // If Google Analytics is NOT activated....
171
- else :
172
 
173
- $existingURL = get_post_meta( $postID,'bitly_link',true );
 
 
 
174
 
175
- // If the cache is fresh or if the API has failed already....
176
- if ( ( true === $array['fresh_cache'] && $existingURL) || (isset( $_GLOBALS['bitly_status'] ) && $_GLOBALS['bitly_status'] == 'failure') ) :
177
 
178
- // If we have a shortened URL in the cache....
179
- if ( $existingURL ) :
180
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
 
 
181
 
182
- // Save the link in a constant for use in other parts of the loops
183
- $_GLOBALS['sw']['links'][ $postID ] = $existingURL;
184
 
185
- // Return the shortened URL
186
- $array['url'] = $existingURL;
187
- return $array;
 
188
 
189
- // If we don't have a shortlink in the cache....
190
- else :
191
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
192
 
193
- // Return the normal URL
194
- return $array;
 
 
 
195
 
196
- endif;
197
 
198
- // If the cache is expired and needs to be rebuilt....
199
- else :
 
 
200
 
201
- // If we've already generated this link....
202
- if ( isset( $_GLOBALS['sw']['links'][ $postID ] ) ) :
203
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
204
 
205
- $array['url'] = $_GLOBALS['sw']['links'][ $postID ];
206
- return $array;
207
 
208
- // If we've don't already have a generated link....
209
- else :
210
 
211
- // Use the bitly function to construct a shortened link
212
- $shortURL = $this->make_bitly_url( urldecode( $url ) , $network , $access_token );
213
 
214
- // If we got a shortened URL from their API....
215
- if ( $shortURL ) :
 
216
 
217
- // Save the link in a global so we can skip this part next time
218
- $_GLOBALS['sw']['links'][ $postID ] = $shortURL;
 
219
 
220
- // Delete the meta fields and then update to keep the database clean and up to date.
221
- delete_post_meta( $postID,'bitly_link_' . $network );
222
- delete_post_meta( $postID,'bitly_link' );
223
- update_post_meta( $postID,'bitly_link',$shortURL );
224
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
225
 
226
- // Return the short URL
227
- $array['url'] = $shortURL;
228
- return $array;
229
 
230
- // If didn't get a shortened URL from their API....
231
- else :
232
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
233
 
234
- // Set a variable we'll check to avoid multiple calls to bitly upon the first failure
235
- $_GLOBALS['sw']['bitly_status'] = 'failure';
236
 
237
- // Return the normal URL
238
- return $array;
239
-
240
- // End check for shorte URL from the API
241
- endif;
242
-
243
- // End check for link in the Global Variable
244
- endif;
245
-
246
- // End check for the cache freshness
247
- endif;
248
-
249
- // End check for Analytics
250
- endif;
251
-
252
- // If Bitly is not activated or we don't have the credentials provided....
253
- else :
254
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
255
-
256
- // Return the normal URL
257
- return $array;
258
-
259
- // End the check for bitly activation and credentials
260
- endif;
261
-
262
- // If link shortening is not activated....
263
- else :
264
- if( true === _swp_is_debug('bitly') ){ echo 'Bitly: '. __LINE__; }
265
-
266
- // Return the normal URL
267
- return $array;
268
-
269
- // End the check for link shortening being activated
270
- endif;
271
 
272
  return $array;
273
  }
@@ -293,7 +219,7 @@ class SWP_URL_Management {
293
  // Fetch the user's options
294
  $options = $swp_user_options;
295
 
296
- if ( isset( $bitly_lookup_response['data']['link_lookup'][0]['link'] ) && true == false ) :
297
 
298
  // Store the short url to return to the plugin
299
  $short_url = $bitly_lookup_response['data']['link_lookup'][0]['link'];
@@ -351,6 +277,7 @@ class SWP_URL_Management {
351
  public static function process_url( $url, $network, $postID, $is_cache_fresh = true ) {
352
  global $swp_user_options;
353
 
 
354
  if ( isset( $_GLOBALS['sw']['links'][ $postID ] ) ) :
355
  return $_GLOBALS['sw']['links'][ $postID ];
356
  else :
63
  endif;
64
 
65
  // Check if Analytics have been enabled or not
66
+ if ( true == SWP_Utility::get_option('google_analytics') ) :
67
  $url_string = 'utm_source=' . $network . '&utm_medium=' . $options['analytics_medium'] . '&utm_campaign=' . $options['analytics_campaign'] . '';
68
 
69
  if ( strpos( $url,'?' ) !== false ) :
93
  *
94
  */
95
  public function link_shortener( $array ) {
96
+ global $post;
97
+ $postID = $array['postID'];
98
+ $google_analytics = SWP_Utility::get_option('google_analytics');
99
+ $access_token = SWP_Utility::get_option( 'bitly_access_token' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
+ // Recently done.
102
+ if ( true == $array['fresh_cache'] ) :
103
+ return $array;
104
+ endif;
105
 
106
+ // We need this information to make a bitly request.
107
+ if ( false == $access_token || true !== SWP_Utility::get_option( 'bitly_authentication' ) ) :
108
+ return $array;
109
+ endif;
110
 
111
+ // These can not have bitly urls created.
112
+ if ( $array['network'] == 'total_shares' || $array['network'] == 'pinterest' ) :
113
+ return $array;
114
+ endif;
 
115
 
116
+ // We tried making a bitly request and it did not work.
117
+ if ( isset( $_GLOBALS['bitly_status'] ) && $_GLOBALS['bitly_status'] == 'failure' ) :
118
+ return $array;
119
+ endif;
120
 
121
+ // Only one bitly url is needed for this post, and it exists.
122
+ if ( !$google_analytics && isset( $_GLOBALS['sw']['links'][ $postID ] ) ) :
123
+ $array['url'] = $_GLOBALS['sw']['links'][ $postID ];
124
+ return $array;
125
+ endif;
126
 
127
+ $start_date = trim( SWP_Utility::get_option( 'bitly_start_date' ) );
 
128
 
129
+ //* They have decided to only allow posts after a certain date.
130
+ if ( $start_date ) :
131
 
132
+ if ( !is_object( $post ) || empty( $post->post_date ) ) :
133
+ return $array;
134
+ endif;
135
 
136
+ $start_date = DateTime::createFromFormat( 'Y-m-d', $start_date );
 
137
 
138
+ //* They did not format the date correctly.
139
+ if ( false == $start_date ) :
140
+ return $array;
141
+ endif;
142
 
143
+ $post_date = new DateTime( $post->post_date );
 
144
 
145
+ //* The post is
146
+ if ( $start_date > $post_date ) :
147
+ return $array;
148
+ endif;
149
+ endif;
150
 
151
+ $links_enabled = SWP_Utility::get_option( "bitly_links_{$post->post_type}" );
 
152
 
153
+ //* They have disabled bitly links on this post type.
154
+ if ( false == $links_enabled || 'off' == $links_enabled ) :
155
+ return $array;
156
+ endif;
157
 
158
+ $network = $array['network'];
 
 
159
 
160
+ if ( true == $google_analytics ) :
161
+ $prior_bitly_url = get_post_meta( $postID, 'bitly_link_' . $network, true );
162
+ else :
163
+ $prior_bitly_url = get_post_meta( $postID, 'bitly_link', true );
164
+ endif;
165
 
 
166
 
167
+ if ( $prior_bitly_url ) :
168
+ $array['url'] = $prior_bitly_url;
169
+ return $array;
170
+ endif;
171
 
 
 
 
172
 
173
+ $url = urldecode( $array['url'] );
174
+ $new_bitly_url = $this->make_bitly_url( $url , $network , $access_token );
175
 
 
 
176
 
177
+ if ( $new_bitly_url ) :
 
178
 
179
+ delete_post_meta( $postID,'bitly_link_' . $network );
180
+ update_post_meta( $postID,'bitly_link_' . $network, $new_bitly_url );
181
+ $array['url'] = $bitly_url;
182
 
183
+ else :
184
+ $_GLOBALS['sw']['bitly_status'] = 'failure';
185
+ endif;
186
 
 
 
 
 
 
187
 
188
+ if ( false == $google_analytics ) :
 
 
189
 
190
+ // Delete the meta fields and then update to keep the database clean and up to date.
191
+ delete_post_meta( $postID,'bitly_link_' . $network );
 
192
 
193
+ // Save the link in a global so we can skip this part next time
194
+ $_GLOBALS['sw']['links'][ $postID ] = $bitly_url;
195
 
196
+ endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
  return $array;
199
  }
219
  // Fetch the user's options
220
  $options = $swp_user_options;
221
 
222
+ if ( isset( $bitly_lookup_response['data']['link_lookup'][0]['link'] ) ) :
223
 
224
  // Store the short url to return to the plugin
225
  $short_url = $bitly_lookup_response['data']['link_lookup'][0]['link'];
277
  public static function process_url( $url, $network, $postID, $is_cache_fresh = true ) {
278
  global $swp_user_options;
279
 
280
+
281
  if ( isset( $_GLOBALS['sw']['links'][ $postID ] ) ) :
282
  return $_GLOBALS['sw']['links'][ $postID ];
283
  else :
lib/utilities/SWP_Utility.php ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * SWP_Utility
5
+ *
6
+ * A collection of utility functions.
7
+ *
8
+ * All of the methods should be static. The class serves as tidy container
9
+ * for various utility functions.
10
+ *
11
+ * The constructor serves only to set up hooks and filters.
12
+ *
13
+ * @package SocialWarfare\Utilities
14
+ * @copyright Copyright (c) 2018, Warfare Plugins, LLC
15
+ * @license GPL-3.0+
16
+ * @since 3.3.0 | 14 AUG 2018 | Created.
17
+ * @access public
18
+ *
19
+ */
20
+ class SWP_Utility {
21
+
22
+
23
+ /**
24
+ * Insantiates filterss and hooks, for admin and ajax.
25
+ *
26
+ * @since 3.3.0 \ 14 AUG 2018 | Created.
27
+ *
28
+ */
29
+ public function __construct() {
30
+ add_action( 'wp_ajax_swp_store_settings', array( 'SWP_Utility', 'store_settings' ) );
31
+ add_filter( 'screen_options_show_screen', array( 'SWP_Utility', 'remove_screen_options' ), 10, 2 );
32
+ }
33
+
34
+
35
+ /**
36
+ *
37
+ * Fetches a key from our filtered $swp_user_options.
38
+ *
39
+ * @since 3.0.0 | 24 APR 2018 | Created.
40
+ * @since 3.0.8 | 16 MAY 2018 | Added $options parameter.
41
+ * @since 3.3.0 | 14 AUG 2018 | Added $key validation, refactored method body.
42
+ * @param string $key The key associated with the option we want.
43
+ *
44
+ * @return mixed $value The value of the option if set, or false.
45
+ *
46
+ */
47
+ public static function get_option( $key = '' ) {
48
+ if ( !isset( $key ) || !is_string( $key ) ) :
49
+ return false;
50
+ endif;
51
+
52
+ global $swp_user_options;
53
+
54
+ if ( !is_array( $swp_user_options ) ) :
55
+ return false;
56
+ endif;
57
+
58
+ if ( array_key_exists( $key, $swp_user_options ) ) :
59
+ return $swp_user_options[$key];
60
+ endif;
61
+
62
+ return false;
63
+ }
64
+
65
+
66
+ /**
67
+ * Handle the options save request inside of admin-ajax.php
68
+ *
69
+ * @since 2.x.x | Unknown | Created.
70
+ * @since 3.0.9 | 31 MAY 2018 | Added call to wp_cache_delete to make sure settings save
71
+ * @since 3.3.0 | 14 AUG 2018 | Removed deprecated code.
72
+ *
73
+ * @return bool Whether or not the options were updated in the database.
74
+ */
75
+ public static function store_settings() {
76
+ if ( !check_ajax_referer( 'swp_plugin_options_save', 'security', false ) ) {
77
+ wp_send_json_error( esc_html__( 'Security failed.', 'social-warfare' ) );
78
+ die;
79
+ }
80
+
81
+ $data = wp_unslash( $_POST );
82
+
83
+ if ( empty( $data['settings'] ) ) {
84
+ wp_send_json_error( esc_html__( 'No settings to save.', 'social-warfare' ) );
85
+ die;
86
+ }
87
+
88
+ $settings = $data['settings'];
89
+
90
+ // Loop and check for checkbox values, convert them to boolean.
91
+ foreach ( $data['settings'] as $key => $value ) {
92
+ if ( 'true' == $value ) {
93
+ $settings[$key] = true;
94
+ } elseif ( 'false' == $value ) {
95
+ $settings[$key] = false;
96
+ } else {
97
+ $settings[$key] = $value;
98
+ }
99
+ }
100
+
101
+ echo json_encode( update_option( 'social_warfare_settings', $settings ) );
102
+
103
+ wp_die();
104
+ }
105
+
106
+
107
+ /**
108
+ * Rounds a number to the appropriate thousands.
109
+ *
110
+ * @since 2.x.x | Unknown | Created.
111
+ * @access public
112
+ * @param float $number The float to be rounded.
113
+ *
114
+ * @return float A rounded number.
115
+ *
116
+ */
117
+ public static function kilomega( $number = 0) {
118
+ if ( empty( $number ) ) :
119
+ return 0;
120
+ endif;
121
+
122
+
123
+ if ( $number < 1000 ) :
124
+ return $number;
125
+ endif;
126
+
127
+ if ( $number < 1000000 ) {
128
+ $suffix = 'K';
129
+ $value = $number / 1000;
130
+ } else {
131
+ $suffix = 'M';
132
+ $value = $number / 1000000;
133
+ }
134
+
135
+ if ( 'period' == SWP_Utility::get_option( 'decimal_separator' ) ) :
136
+ $decimal_point = '.';
137
+ $thousands_separator = ',';
138
+ else :
139
+ $decimal_point = ',';
140
+ $thousands_separator = '.';
141
+ endif;
142
+
143
+ $decimals = SWP_Utility::get_option( 'decimals' );
144
+ $display_number = number_format( $value, $decimals, $decimal_point, $thousands_separator ) . $suffix;
145
+
146
+ return $display_number;
147
+ }
148
+
149
+
150
+ /**
151
+ * Process the excerpts for descriptions.
152
+ *
153
+ * While similar to WordPress's own get_the_excerpt, ours prevents
154
+ * infinite recursion from Social Warfare code.
155
+ *
156
+ * @since 1.0.0 | Created | Unknown.
157
+ * @since 2.2.4 | Updated | 6 March 2017 | Added the filter to remove the script and style tags.
158
+ * @access public
159
+ * @param int $post_id The post ID to use when getting an exceprt.
160
+ *
161
+ * @return string The excerpt.
162
+ *
163
+ */
164
+ public static function get_the_excerpt( $post_id ) {
165
+ // Check if the post has an excerpt
166
+ if ( has_excerpt() ) :
167
+ $the_post = get_post( $post_id ); // Gets post ID
168
+ $the_excerpt = $the_post->post_excerpt;
169
+
170
+ // If not, let's create an excerpt
171
+ else :
172
+ $the_post = get_post( $post_id ); // Gets post ID
173
+ $the_excerpt = $the_post->post_content; // Gets post_content to be used as a basis for the excerpt
174
+ endif;
175
+
176
+ $excerpt_length = 100; // Sets excerpt length by word count
177
+
178
+ // Filter out any inline script or style tags as well as their content
179
+ if( !empty( $the_excerpt ) ):
180
+ $the_excerpt = preg_replace('/(<script[^>]*>.+?<\/script>|<style[^>]*>.+?<\/style>)/s', '', $the_excerpt);
181
+ endif;
182
+
183
+ $the_excerpt = strip_tags( strip_shortcodes( $the_excerpt ) ); // Strips tags and images
184
+ $the_excerpt = preg_replace( '/\[[^\]]+\]/', '', $the_excerpt );
185
+ $the_excerpt = str_replace( ']]>', ']]&gt;', $the_excerpt );
186
+ $the_excerpt = strip_tags( $the_excerpt );
187
+ $excerpt_length = apply_filters( 'excerpt_length', 100 );
188
+ $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[...]' );
189
+ $words = preg_split( "/[\n\r\t ]+/", $the_excerpt, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY );
190
+
191
+ if ( count( $words ) > $excerpt_length ) :
192
+ array_pop( $words );
193
+ // array_push($words, '…');
194
+ $the_excerpt = implode( ' ', $words );
195
+ endif;
196
+
197
+ $the_excerpt = preg_replace( "/\r|\n/", '', $the_excerpt );
198
+
199
+ return $the_excerpt;
200
+ }
201
+
202
+
203
+ /**
204
+ * Checks to see if a debugging query paramter has been set.
205
+ *
206
+ * @since 2.1.0
207
+ * @since 3.3.0 | 14 AUG 2018 | Refactored to a one-liner.
208
+ * @access public
209
+ * @param string $type The query paramter to check for.
210
+ *
211
+ * @return bool True if the specified key is set for debugging, else false.
212
+ *
213
+ */
214
+ public static function debug( $key = '' ) {
215
+ return !empty( $_GET['swp_debug'] ) && ( strtolower( $_GET['swp_debug'] ) == strtolower( $key ) );
216
+ }
217
+
218
+ /**
219
+ * Converts curly quotes to straight quotes.
220
+ *
221
+ * @since 1.4.0
222
+ * @param string $content The text to be filtered.
223
+ *
224
+ * @return string $content The filtered text.
225
+ *
226
+ */
227
+ public static function convert_smart_quotes( $content ) {
228
+ $content = str_replace( '"', "'", $content );
229
+ $content = str_replace( '&#8220;', "'", $content );
230
+ $content = str_replace( '&#8221;', "'", $content );
231
+ $content = str_replace( '&#8216;', "'", $content );
232
+ $content = str_replace( '&#8217;', "'", $content );
233
+ return $content;
234
+ }
235
+
236
+
237
+ /**
238
+ * Returns post types supported by Social Warfare. Includes Custom Post Types.
239
+ *
240
+ * @since 2.x.x | Unknown | Created.
241
+ * @return array The names of registered post types.
242
+ *
243
+ */
244
+ public static function get_post_types() {
245
+ $types = get_post_types( array( 'public' => true, '_builtin' => false ), 'names' );
246
+
247
+ $types = array_merge( array( 'home', 'archive_categories', 'post', 'page' ), $types );
248
+
249
+ return apply_filters( 'swp_post_types', $types );
250
+ }
251
+
252
+
253
+ /**
254
+ * A function to remove the screen options tab from our admin page
255
+ *
256
+ * @since 2.2.1 | Unknown | Created.
257
+ * @param bool Whether to show Screen Options tab. Default true.
258
+ * @param WP_Screen $wp_screen Current WP_Screen instance.
259
+ *
260
+ * @return boolean $display or false.
261
+ *
262
+ */
263
+ public static function remove_screen_options( $show_screen, $wp_screen ){
264
+ $blacklist = array('admin.php?page=social-warfare');
265
+
266
+ if ( in_array( $GLOBALS['pagenow'], $blacklist ) ) {
267
+ $wp_screen->render_screen_layout();
268
+ $wp_screen->render_per_page_options();
269
+ return false;
270
+ }
271
+
272
+ return $show_screen;
273
+ }
274
+
275
+
276
+ /**
277
+ * Returns the URL of current website or network.
278
+ *
279
+ * @since 2.3.3 | 25 SEP 2017 | Created.
280
+ *
281
+ * @return string The URL of the site.
282
+ *
283
+ */
284
+ public static function get_site_url() {
285
+ if( true == is_multisite() ) {
286
+ return network_site_url();
287
+ } else {
288
+ return get_site_url();
289
+ }
290
+ }
291
+ }
{functions → lib}/utilities/SWP_Utility_Trait.php RENAMED
File without changes
lib/utilities/functions.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * This file serves to hold global functions made available to developers
5
+ * by Social Warfare.
6
+ *
7
+ * Any actual plugin functionality needs to exist as a class method somewhere else.
8
+ *
9
+ * @since 3.3.0 | 14 AUG 2018 | Created file.
10
+ *
11
+ */
12
+
13
+ function socialWarfare( $content = false, $where = 'default', $echo = true ) {
14
+ social_warfare( array( 'content' => $content, 'where' => $where, 'echo' => $echo ) );
15
+ }
16
+
17
+ function social_warfare( $args = array() ) {
18
+ $buttons_panel = new SWP_Buttons_Panel( $args );
19
+ return $buttons_panel->render_HTML();
20
+ }
21
+
22
+ function swp_kilomega( $number ) {
23
+ return SWP_Utiltiy::kilomega( $number );
24
+ }
{functions → lib}/widgets/SWP_Popular_Posts_Widget.php RENAMED
@@ -178,7 +178,7 @@ class SWP_Popular_Posts_Widget extends WP_Widget {
178
  $form .= '</p>';
179
 
180
  // Get the public post Types
181
- $post_types = swp_get_post_types();
182
 
183
  if( !empty( $post_types ) ):
184
 
@@ -536,7 +536,7 @@ class SWP_Popular_Posts_Widget extends WP_Widget {
536
  if ( $showCount == 'true' ) :
537
  $postID = get_the_ID();
538
  $shares = get_post_meta( $postID,'_' . $network,true );
539
- $share_html = '<span class="swp_pop_count">' . swp_kilomega( $shares ) . ' ' . $countLabel . '</span>';
540
 
541
  // If we are not supposed to show count numbers
542
  else :
178
  $form .= '</p>';
179
 
180
  // Get the public post Types
181
+ $post_types = SWP_Utility::get_post_types();
182
 
183
  if( !empty( $post_types ) ):
184
 
536
  if ( $showCount == 'true' ) :
537
  $postID = get_the_ID();
538
  $shares = get_post_meta( $postID,'_' . $network,true );
539
+ $share_html = '<span class="swp_pop_count">' . SWP_Utility::kilomega( $shares ) . ' ' . $countLabel . '</span>';
540
 
541
  // If we are not supposed to show count numbers
542
  else :
{functions → lib}/widgets/SWP_Widget.php RENAMED
File without changes
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: holas84, dustinwstout, webinator, warfareplugins, nutsandboltsmedi
3
  Tags: sharing buttons, social media share, floating share buttons, facebook share, google plus share, linkedin share, pin it, pinterest save, mix button, tweet button, twitter share, click to tweet, social sharing buttons, social share, social sharing, social media sharing, wordpress social sharing plugin, social sharing plugin, share buttons, share counts
4
  Requires at least: 3.5.1
5
  Tested up to: 4.9
6
- Stable tag: 3.2.2
7
  License: GNU General Public License v2.0 or later
8
 
9
  The most beautiful, responsive, lightning fast social share buttons built to boost shares and drive more traffic without slowing down your site.
@@ -193,9 +193,15 @@ We have a growing archive of <a href="https://warfareplugins.com/support/" rel="
193
 
194
  == Changelog ==
195
 
196
- = 3.2.2 (21 AUG 2018) =
197
- * Rebuilt and fully rectified the automatic updates processes.
198
- * Fixed javascript error that broke images when pinning from Pin On Hover button.
 
 
 
 
 
 
199
 
200
  = 3.2.1 (16 AUG 2018) =
201
  * Fixed a minor DOMDocument warning that was appearing when data-pin-description was ON
3
  Tags: sharing buttons, social media share, floating share buttons, facebook share, google plus share, linkedin share, pin it, pinterest save, mix button, tweet button, twitter share, click to tweet, social sharing buttons, social share, social sharing, social media sharing, wordpress social sharing plugin, social sharing plugin, share buttons, share counts
4
  Requires at least: 3.5.1
5
  Tested up to: 4.9
6
+ Stable tag: 3.3.0
7
  License: GNU General Public License v2.0 or later
8
 
9
  The most beautiful, responsive, lightning fast social share buttons built to boost shares and drive more traffic without slowing down your site.
193
 
194
  == Changelog ==
195
 
196
+ = 3.3.0 (11 SEP 2018) =
197
+ * Added CSS to hide buttons on print views.
198
+ * Added Mix to the Social Networks.
199
+ * Added "url" paramter to the shortcode.
200
+ * Fixed plugin compatability issue with BuddyPress.
201
+ * Fixed the decimal separator for share counts.
202
+ * Updated the option-getting mechanism (`global $swp_user_options` is now deprecated).
203
+ * Updated the sidebar in the Social Warfare settings page.
204
+ * Updated the plugin file structure and organization.
205
 
206
  = 3.2.1 (16 AUG 2018) =
207
  * Fixed a minor DOMDocument warning that was appearing when data-pin-description was ON
social-warfare.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Social Warfare
4
  * Plugin URI: https://warfareplugins.com
5
  * Description: A plugin to maximize social shares and drive more traffic using the fastest and most intelligent share buttons on the market, calls to action via in-post click-to-tweets, popular posts widgets based on share popularity, link-shortening, Google Analytics and much, much more!
6
- * Version: 3.2.2
7
  * Author: Warfare Plugins
8
  * Author URI: https://warfareplugins.com
9
  * Text Domain: social-warfare
@@ -16,7 +16,7 @@ defined( 'WPINC' ) || die;
16
  * Define plugin constants for use throughout the plugin (Version and Directories)
17
  *
18
  */
19
- define( 'SWP_VERSION' , '3.2.2' );
20
  define( 'SWP_PLUGIN_FILE', __FILE__ );
21
  define( 'SWP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
22
  define( 'SWP_PLUGIN_DIR', dirname( __FILE__ ) );
@@ -29,11 +29,11 @@ define( 'SWP_STORE_URL', 'https://warfareplugins.com' );
29
  * @TODO THis should be removed after 31 DEC 2018.
30
  *
31
  */
32
- if ( file_exists( SWP_PLUGIN_DIR . '/functions/legacy/update-checker.php') ) :
33
- require_once SWP_PLUGIN_DIR . '/functions/legacy/update-checker.php';
34
  endif;
35
  add_filter('the_excerpt', 'do_shortcode', 1);
36
 
37
  // Load the main Social_Warfare class and fire up the plugin.
38
- require_once SWP_PLUGIN_DIR . '/functions/Social_Warfare.php';
39
  new Social_Warfare();
3
  * Plugin Name: Social Warfare
4
  * Plugin URI: https://warfareplugins.com
5
  * Description: A plugin to maximize social shares and drive more traffic using the fastest and most intelligent share buttons on the market, calls to action via in-post click-to-tweets, popular posts widgets based on share popularity, link-shortening, Google Analytics and much, much more!
6
+ * Version: 3.3.0
7
  * Author: Warfare Plugins
8
  * Author URI: https://warfareplugins.com
9
  * Text Domain: social-warfare
16
  * Define plugin constants for use throughout the plugin (Version and Directories)
17
  *
18
  */
19
+ define( 'SWP_VERSION' , '3.3.0' );
20
  define( 'SWP_PLUGIN_FILE', __FILE__ );
21
  define( 'SWP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
22
  define( 'SWP_PLUGIN_DIR', dirname( __FILE__ ) );
29
  * @TODO THis should be removed after 31 DEC 2018.
30
  *
31
  */
32
+ if ( file_exists( SWP_PLUGIN_DIR . '/lib/legacy/update-checker.php') ) :
33
+ require_once SWP_PLUGIN_DIR . '/lib/legacy/update-checker.php';
34
  endif;
35
  add_filter('the_excerpt', 'do_shortcode', 1);
36
 
37
  // Load the main Social_Warfare class and fire up the plugin.
38
+ require_once SWP_PLUGIN_DIR . '/lib/Social_Warfare.php';
39
  new Social_Warfare();