SmartCrawl SEO - Version 3.1.0

Version Description

( 2022-08-18 ) =

  • Improvement: Code improvements.
  • Improvement: Upgrade Shared UI.
  • Fix: Unable to enable Media indexing.
  • Fix: Schema types cannot have more than 10 in Schema of the same type.
Download this release

Release Info

Developer joelcj91
Plugin Icon 128x128 SmartCrawl SEO
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0.1 to 3.1.0

Files changed (260) hide show
  1. autoloader.php +32 -0
  2. changelog.txt +8 -0
  3. class-mappings.php +40 -34
  4. constants.php +14 -7
  5. includes/admin/admin.php +98 -67
  6. includes/admin/class-wds-autolinks-ui.php +24 -26
  7. includes/admin/class-wds-onpage-ui.php +17 -21
  8. includes/admin/class-wds-readability-analysis-ui.php +19 -16
  9. includes/admin/class-wds-seo-analysis-ui.php +19 -16
  10. includes/admin/class-wds-sitemap-ui.php +18 -23
  11. includes/admin/class-wds-social-ui.php +16 -20
  12. includes/admin/metabox.php +196 -103
  13. includes/admin/settings.php +46 -29
  14. includes/admin/settings/autolinks.php +100 -79
  15. includes/admin/settings/dashboard.php +116 -44
  16. includes/admin/settings/health.php +62 -30
  17. includes/admin/settings/onpage.php +332 -242
  18. includes/admin/settings/schema.php +119 -72
  19. includes/admin/settings/settings.php +126 -99
  20. includes/admin/settings/sitemap.php +107 -98
  21. includes/admin/settings/social.php +31 -33
  22. includes/admin/taxonomy.php +44 -52
  23. includes/admin/templates/advanced-tools/advanced-automatic-linking-types.php +29 -22
  24. includes/admin/templates/advanced-tools/advanced-redirect-image-attachments.php +4 -4
  25. includes/admin/templates/advanced-tools/advanced-robots-custom-sitemap-url-setting.php +35 -24
  26. includes/admin/templates/advanced-tools/advanced-robots-disabled.php +24 -16
  27. includes/admin/templates/advanced-tools/advanced-robots-settings.php +56 -38
  28. includes/admin/templates/advanced-tools/advanced-section-automatic-linking-main.php +16 -9
  29. includes/admin/templates/advanced-tools/advanced-section-automatic-linking-settings.php +37 -25
  30. includes/admin/templates/advanced-tools/advanced-section-automatic-linking.php +46 -40
  31. includes/admin/templates/advanced-tools/advanced-section-moz.php +43 -29
  32. includes/admin/templates/advanced-tools/advanced-section-redirect-settings.php +21 -17
  33. includes/admin/templates/advanced-tools/advanced-section-redirects.php +4 -2
  34. includes/admin/templates/advanced-tools/advanced-section-woo-settings.php +6 -3
  35. includes/admin/templates/advanced-tools/advanced-side-nav.php +30 -27
  36. includes/admin/templates/advanced-tools/advanced-tab-robots.php +7 -7
  37. includes/admin/templates/advanced-tools/advanced-tools-redirect-item.php +28 -23
  38. includes/admin/templates/advanced-tools/advanced-tools-settings.php +102 -66
  39. includes/admin/templates/advanced-tools/advanced-tools-title-pro-tag.php +4 -2
  40. includes/admin/templates/dashboard/dashboard-box-title-url-crawl-stats.php +4 -4
  41. includes/admin/templates/dashboard/dashboard-content-analysis-readability-overview.php +30 -28
  42. includes/admin/templates/dashboard/dashboard-content-analysis-seo-overview.php +26 -24
  43. includes/admin/templates/dashboard/dashboard-cross-sell-footer.php +19 -14
  44. includes/admin/templates/dashboard/dashboard-mini-lighthouse-report.php +31 -20
  45. includes/admin/templates/dashboard/dashboard-reports-free.php +25 -17
  46. includes/admin/templates/dashboard/dashboard-reports-full.php +33 -28
  47. includes/admin/templates/dashboard/dashboard-top-lighthouse.php +37 -28
  48. includes/admin/templates/dashboard/dashboard-top-sitemap-list-item.php +19 -15
  49. includes/admin/templates/dashboard/dashboard-url-crawl-in-progress.php +13 -7
  50. includes/admin/templates/dashboard/dashboard-url-crawl-stats.php +9 -7
  51. includes/admin/templates/dashboard/dashboard-welcome-modal.php +32 -24
  52. includes/admin/templates/dashboard/dashboard-widget-advanced-tools.php +65 -51
  53. includes/admin/templates/dashboard/dashboard-widget-configs.php +1 -1
  54. includes/admin/templates/dashboard/dashboard-widget-content-analysis.php +32 -26
  55. includes/admin/templates/dashboard/dashboard-widget-lighthouse.php +40 -35
  56. includes/admin/templates/dashboard/dashboard-widget-onpage.php +20 -18
  57. includes/admin/templates/dashboard/dashboard-widget-reports.php +4 -6
  58. includes/admin/templates/dashboard/dashboard-widget-schema.php +39 -30
  59. includes/admin/templates/dashboard/dashboard-widget-sitemap.php +92 -61
  60. includes/admin/templates/dashboard/dashboard-widget-social.php +41 -35
  61. includes/admin/templates/dashboard/dashboard-widget-upgrade.php +10 -7
  62. includes/admin/templates/dashboard/dashboard.php +32 -23
  63. includes/admin/templates/dashboard/onboard-modal-body.php +62 -47
  64. includes/admin/templates/dashboard/onboard-modal-footer.php +4 -3
  65. includes/admin/templates/dashboard/onboard-progress.php +6 -3
  66. includes/admin/templates/dashboard/onboarding.php +11 -8
  67. includes/admin/templates/disabled-component-inner.php +31 -22
  68. includes/admin/templates/disabled-component.php +12 -9
  69. includes/admin/templates/dismissable-notice.php +11 -7
  70. includes/admin/templates/emails/email-body.php +16 -14
  71. includes/admin/templates/emails/email-footer.php +62 -37
  72. includes/admin/templates/emails/email-header.php +27 -17
  73. includes/admin/templates/emails/lighthouse-email.php +146 -100
  74. includes/admin/templates/floating-notice.php +20 -16
  75. includes/admin/templates/floating-notices.php +30 -21
  76. includes/admin/templates/footer.php +79 -35
  77. includes/admin/templates/health/health-section-settings.php +13 -10
  78. includes/admin/templates/health/health-test-mode-lighthouse.php +24 -20
  79. includes/admin/templates/lighthouse/lighthouse-check-item.php +38 -24
  80. includes/admin/templates/lighthouse/lighthouse-error.php +18 -13
  81. includes/admin/templates/lighthouse/lighthouse-extra-actions.php +14 -8
  82. includes/admin/templates/lighthouse/lighthouse-header-actions.php +14 -12
  83. includes/admin/templates/lighthouse/lighthouse-no-data.php +24 -21
  84. includes/admin/templates/lighthouse/lighthouse-progress-modal-body.php +19 -13
  85. includes/admin/templates/lighthouse/lighthouse-progress-modal.php +11 -7
  86. includes/admin/templates/lighthouse/lighthouse-recipients.php +51 -39
  87. includes/admin/templates/lighthouse/lighthouse-report-group.php +13 -7
  88. includes/admin/templates/lighthouse/lighthouse-report.php +62 -40
  89. includes/admin/templates/lighthouse/lighthouse-reporting-tab.php +15 -12
  90. includes/admin/templates/lighthouse/lighthouse-reporting-title-tag.php +1 -1
  91. includes/admin/templates/lighthouse/lighthouse-reporting.php +60 -47
  92. includes/admin/templates/lighthouse/lighthouse-screenshot-zoom-modal.php +7 -4
  93. includes/admin/templates/lighthouse/lighthouse-settings.php +38 -23
  94. includes/admin/templates/lighthouse/lighthouse-side-nav.php +13 -10
  95. includes/admin/templates/lighthouse/lighthouse-summary.php +23 -16
  96. includes/admin/templates/lighthouse/lighthouse-tab.php +6 -4
  97. includes/admin/templates/macros-dropdown.php +5 -3
  98. includes/admin/templates/mascot-message.php +9 -7
  99. includes/admin/templates/media-item-selector.php +19 -15
  100. includes/admin/templates/metabox/analysis-readability.php +50 -36
  101. includes/admin/templates/metabox/analysis-seo-analysis.php +60 -37
  102. includes/admin/templates/metabox/horizontal-tab-nav.php +7 -9
  103. includes/admin/templates/metabox/horizontal-tab.php +4 -4
  104. includes/admin/templates/metabox/metabox-advanced-autolinks.php +9 -6
  105. includes/admin/templates/metabox/metabox-advanced-canonical.php +9 -6
  106. includes/admin/templates/metabox/metabox-advanced-indexing.php +73 -55
  107. includes/admin/templates/metabox/metabox-advanced-redirect.php +14 -8
  108. includes/admin/templates/metabox/metabox-advanced-sitemap-priority.php +12 -9
  109. includes/admin/templates/metabox/metabox-dummy-preview.php +4 -5
  110. includes/admin/templates/metabox/metabox-main.php +62 -43
  111. includes/admin/templates/metabox/metabox-meta-edit-form.php +20 -17
  112. includes/admin/templates/metabox/metabox-readability-report-inner.php +19 -13
  113. includes/admin/templates/metabox/metabox-readability.php +2 -2
  114. includes/admin/templates/metabox/metabox-seo-analysis-container.php +26 -19
  115. includes/admin/templates/metabox/metabox-seo-meta.php +10 -5
  116. includes/admin/templates/metabox/metabox-social-meta-tags-sub-settings.php +53 -35
  117. includes/admin/templates/metabox/metabox-social-meta-tags.php +34 -31
  118. includes/admin/templates/metabox/metabox-social-opengraph.php +25 -19
  119. includes/admin/templates/metabox/metabox-social-twitter.php +25 -19
  120. includes/admin/templates/metabox/metabox-tab-advanced.php +5 -3
  121. includes/admin/templates/metabox/metabox-tab-readability.php +5 -3
  122. includes/admin/templates/metabox/metabox-tab-seo.php +5 -3
  123. includes/admin/templates/metabox/metabox-tab-social.php +6 -4
  124. includes/admin/templates/metabox/underscore-google-preview.php +11 -6
  125. includes/admin/templates/metabox/underscore-link-rel-attribute.php +1 -1
  126. includes/admin/templates/modal.php +51 -38
  127. includes/admin/templates/network-settings.php +70 -47
  128. includes/admin/templates/notice.php +1 -1
  129. includes/admin/templates/onpage/onpage-disabled.php +12 -9
  130. includes/admin/templates/onpage/onpage-general-settings-inner.php +39 -31
  131. includes/admin/templates/onpage/onpage-general-settings.php +19 -18
  132. includes/admin/templates/onpage/onpage-header-actions.php +7 -5
  133. includes/admin/templates/onpage/onpage-list-homepage.php +32 -23
  134. includes/admin/templates/onpage/onpage-macros-modal.php +5 -5
  135. includes/admin/templates/onpage/onpage-meta-character-lengths.php +48 -28
  136. includes/admin/templates/onpage/onpage-meta-robots.php +9 -6
  137. includes/admin/templates/onpage/onpage-og-disabled.php +8 -5
  138. includes/admin/templates/onpage/onpage-og-settings.php +34 -34
  139. includes/admin/templates/onpage/onpage-og-twitter.php +28 -19
  140. includes/admin/templates/onpage/onpage-preview.php +4 -4
  141. includes/admin/templates/onpage/onpage-section-404.php +9 -6
  142. includes/admin/templates/onpage/onpage-section-author-archive.php +23 -14
  143. includes/admin/templates/onpage/onpage-section-buddypress-groups.php +25 -16
  144. includes/admin/templates/onpage/onpage-section-buddypress-profile.php +25 -16
  145. includes/admin/templates/onpage/onpage-section-date-archive.php +23 -14
  146. includes/admin/templates/onpage/onpage-section-post-type-archive.php +24 -15
  147. includes/admin/templates/onpage/onpage-section-post-type.php +29 -21
  148. includes/admin/templates/onpage/onpage-section-search.php +23 -14
  149. includes/admin/templates/onpage/onpage-section-settings.php +60 -50
  150. includes/admin/templates/onpage/onpage-section-taxonomy.php +29 -21
  151. includes/admin/templates/onpage/onpage-settings.php +156 -113
  152. includes/admin/templates/onpage/onpage-sidenav.php +11 -8
  153. includes/admin/templates/onpage/onpage-social-meta-tags-sub-settings.php +66 -47
  154. includes/admin/templates/onpage/onpage-social-meta-tags.php +51 -45
  155. includes/admin/templates/onpage/onpage-static-homepage.php +47 -37
  156. includes/admin/templates/onpage/onpage-twitter-disabled.php +8 -5
  157. includes/admin/templates/onpage/onpage-twitter-settings.php +35 -33
  158. includes/admin/templates/onpage/underscore-onpage-preview.php +8 -5
  159. includes/admin/templates/page-header.php +14 -12
  160. includes/admin/templates/post-list/meta-details.php +12 -14
  161. includes/admin/templates/post-list/post-seo-analysis-errors.php +7 -5
  162. includes/admin/templates/post-list/quick-edit-onpage.php +5 -3
  163. includes/admin/templates/post-list/quick-edit-seo-analysis.php +5 -3
  164. includes/admin/templates/post-search-dropdown-form-field.php +21 -19
  165. includes/admin/templates/progress-bar.php +1 -1
  166. includes/admin/templates/progress-notice.php +5 -3
  167. includes/admin/templates/report-vertical-tab.php +19 -16
  168. includes/admin/templates/reporting-dow-select.php +19 -16
  169. includes/admin/templates/reporting-schedule.php +40 -23
  170. includes/admin/templates/reporting-tod-select.php +14 -11
  171. includes/admin/templates/schema/schema-disabled.php +13 -10
  172. includes/admin/templates/schema/schema-nav-menus-dropdown-form-field.php +13 -10
  173. includes/admin/templates/schema/schema-organization-settings.php +68 -46
  174. includes/admin/templates/schema/schema-organization-types-dropdown.php +19 -12
  175. includes/admin/templates/schema/schema-person-settings.php +78 -56
  176. includes/admin/templates/schema/schema-section-advanced.php +212 -140
  177. includes/admin/templates/schema/schema-section-general.php +83 -60
  178. includes/admin/templates/schema/schema-section-settings.php +18 -11
  179. includes/admin/templates/schema/schema-settings.php +114 -85
  180. includes/admin/templates/schema/schema-sidenav.php +23 -20
  181. includes/admin/templates/schema/schema-social-accounts.php +48 -32
  182. includes/admin/templates/schema/schema-youtube-api-key-field.php +11 -7
  183. includes/admin/templates/schema/schema-youtube-api-key.php +22 -19
  184. includes/admin/templates/seomoz-dashboard-widget.php +33 -17
  185. includes/admin/templates/settings/settings-analysis.php +86 -57
  186. includes/admin/templates/settings/settings-custom-meta-tag.php +10 -6
  187. includes/admin/templates/settings/settings-import-notice.php +19 -14
  188. includes/admin/templates/settings/settings-section-accessibility.php +11 -8
  189. includes/admin/templates/settings/settings-section-configs.php +5 -2
  190. includes/admin/templates/settings/settings-section-data.php +32 -21
  191. includes/admin/templates/settings/settings-section-general.php +100 -72
  192. includes/admin/templates/settings/settings-section-user-roles.php +42 -30
  193. includes/admin/templates/settings/settings-sidenav.php +11 -8
  194. includes/admin/templates/settings/settings.php +133 -94
  195. includes/admin/templates/side-tabs.php +21 -17
  196. includes/admin/templates/sitemap/sitemap-buddypress-settings.php +49 -31
  197. includes/admin/templates/sitemap/sitemap-common-settings.php +62 -42
  198. includes/admin/templates/sitemap/sitemap-crawl-content.php +20 -11
  199. includes/admin/templates/sitemap/sitemap-crawl-results.php +7 -4
  200. includes/admin/templates/sitemap/sitemap-crawl-stats.php +22 -16
  201. includes/admin/templates/sitemap/sitemap-deactivate-button.php +8 -6
  202. includes/admin/templates/sitemap/sitemap-disabled.php +13 -10
  203. includes/admin/templates/sitemap/sitemap-extra-actions.php +12 -6
  204. includes/admin/templates/sitemap/sitemap-general-xml.php +13 -10
  205. includes/admin/templates/sitemap/sitemap-index-xml.php +10 -9
  206. includes/admin/templates/sitemap/sitemap-manual-update-button.php +6 -2
  207. includes/admin/templates/sitemap/sitemap-manually-notify-search-engines.php +6 -2
  208. includes/admin/templates/sitemap/sitemap-native.php +56 -43
  209. includes/admin/templates/sitemap/sitemap-news-xml.php +10 -8
  210. includes/admin/templates/sitemap/sitemap-no-crawler-data.php +15 -12
  211. includes/admin/templates/sitemap/sitemap-notices.php +40 -31
  212. includes/admin/templates/sitemap/sitemap-part.php +21 -15
  213. includes/admin/templates/sitemap/sitemap-progress-bar.php +16 -10
  214. includes/admin/templates/sitemap/sitemap-reporting-title-pro-tag.php +7 -5
  215. includes/admin/templates/sitemap/sitemap-reporting-toggle-sub-settings.php +10 -7
  216. includes/admin/templates/sitemap/sitemap-section-advanced.php +76 -61
  217. includes/admin/templates/sitemap/sitemap-section-news.php +9 -4
  218. includes/admin/templates/sitemap/sitemap-section-reporting.php +50 -37
  219. includes/admin/templates/sitemap/sitemap-section-settings.php +9 -8
  220. includes/admin/templates/sitemap/sitemap-section-url-crawler.php +9 -3
  221. includes/admin/templates/sitemap/sitemap-settings.php +122 -91
  222. includes/admin/templates/sitemap/sitemap-side-nav.php +21 -15
  223. includes/admin/templates/sitemap/sitemap-smartcrawl.php +45 -35
  224. includes/admin/templates/sitemap/sitemap-split-setting.php +13 -9
  225. includes/admin/templates/sitemap/sitemap-switch-to-native-modal-body.php +10 -8
  226. includes/admin/templates/sitemap/sitemap-switch-to-native-modal.php +10 -7
  227. includes/admin/templates/sitemap/sitemap-switch-to-smartcrawl-modal-body.php +10 -9
  228. includes/admin/templates/sitemap/sitemap-switch-to-smartcrawl-modal.php +10 -7
  229. includes/admin/templates/sitemap/sitemap-url-crawler-tab-title-left.php +18 -11
  230. includes/admin/templates/sitemap/sitemap-xsl.php +10 -10
  231. includes/admin/templates/social-image-item.php +6 -4
  232. includes/admin/templates/social/social-disabled.php +12 -9
  233. includes/admin/templates/social/social-section-open-graph.php +12 -9
  234. includes/admin/templates/social/social-section-pinterest-verification.php +24 -14
  235. includes/admin/templates/social/social-section-twitter-cards.php +10 -7
  236. includes/admin/templates/social/social-settings.php +69 -50
  237. includes/admin/templates/social/social-sidenav.php +19 -16
  238. includes/admin/templates/social/social-twitter-cards-toggle-sub-settings.php +27 -20
  239. includes/admin/templates/social/social-twitter-embed.php +10 -6
  240. includes/admin/templates/term/term-advanced-tab.php +55 -41
  241. includes/admin/templates/term/term-form.php +49 -38
  242. includes/admin/templates/term/term-google-preview.php +11 -8
  243. includes/admin/templates/term/term-meta-edit-form.php +17 -13
  244. includes/admin/templates/term/term-nav.php +7 -7
  245. includes/admin/templates/term/term-seo-tab.php +12 -7
  246. includes/admin/templates/term/term-social-tab.php +65 -50
  247. includes/admin/templates/toggle-group.php +25 -22
  248. includes/admin/templates/toggle-item.php +46 -38
  249. includes/admin/templates/upgrade-page.php +27 -16
  250. includes/admin/templates/url-crawl-master.php +21 -13
  251. includes/admin/templates/urlmetrics-metabox.php +21 -11
  252. includes/admin/templates/vertical-tab-section-accordion.php +35 -24
  253. includes/admin/templates/vertical-tab-section.php +4 -4
  254. includes/admin/templates/vertical-tab-upsell.php +20 -18
  255. includes/admin/templates/vertical-tab.php +24 -21
  256. includes/admin/templates/vertical-tabs-side-nav.php +28 -18
  257. includes/admin/templates/wp-dashboard/sitemaps-widget-js.php +3 -3
  258. includes/admin/templates/wp-dashboard/sitemaps-widget.php +7 -7
  259. includes/assets/css/admin.css +0 -0
  260. includes/assets/css/app.css +0 -1
autoloader.php CHANGED
@@ -1,9 +1,29 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  if ( ! class_exists( 'Smartcrawl_Autoloader' ) ) {
 
 
 
4
  class Smartcrawl_Autoloader {
 
 
 
 
 
 
5
  private static $class_mappings = array();
6
 
 
 
 
 
 
7
  private static function load_from_file() {
8
  $mappings_file = dirname( __FILE__ ) . '/class-mappings.php';
9
  if ( file_exists( $mappings_file ) ) {
@@ -13,6 +33,11 @@ if ( ! class_exists( 'Smartcrawl_Autoloader' ) ) {
13
  return array();
14
  }
15
 
 
 
 
 
 
16
  private static function get_class_mappings() {
17
  if ( empty( self::$class_mappings ) ) {
18
  self::$class_mappings = self::load_from_file();
@@ -21,6 +46,13 @@ if ( ! class_exists( 'Smartcrawl_Autoloader' ) ) {
21
  return self::$class_mappings;
22
  }
23
 
 
 
 
 
 
 
 
24
  public static function autoload( $class ) {
25
  $class_mappings = self::get_class_mappings();
26
  if ( ! isset( $class_mappings[ $class ] ) ) {
1
  <?php
2
+ /**
3
+ * The autoloader class.
4
+ *
5
+ * @package Smartcrawl
6
+ * @subpackage Autoloader
7
+ */
8
 
9
  if ( ! class_exists( 'Smartcrawl_Autoloader' ) ) {
10
+ /**
11
+ * Class Smartcrawl_Autoloader
12
+ */
13
  class Smartcrawl_Autoloader {
14
+
15
+ /**
16
+ * Class mappings.
17
+ *
18
+ * @var array $class_mappings
19
+ */
20
  private static $class_mappings = array();
21
 
22
+ /**
23
+ * Load file.
24
+ *
25
+ * @return array|mixed
26
+ */
27
  private static function load_from_file() {
28
  $mappings_file = dirname( __FILE__ ) . '/class-mappings.php';
29
  if ( file_exists( $mappings_file ) ) {
33
  return array();
34
  }
35
 
36
+ /**
37
+ * Get class mapping list.
38
+ *
39
+ * @return array|mixed
40
+ */
41
  private static function get_class_mappings() {
42
  if ( empty( self::$class_mappings ) ) {
43
  self::$class_mappings = self::load_from_file();
46
  return self::$class_mappings;
47
  }
48
 
49
+ /**
50
+ * Autoload files.
51
+ *
52
+ * @param string $class Class name.
53
+ *
54
+ * @return void
55
+ */
56
  public static function autoload( $class ) {
57
  $class_mappings = self::get_class_mappings();
58
  if ( ! isset( $class_mappings[ $class ] ) ) {
changelog.txt CHANGED
@@ -1,6 +1,14 @@
1
  Plugin Name: SmartCrawl SEO
2
 
3
  Change Log:
 
 
 
 
 
 
 
 
4
  ----------------------------------------------------------------------
5
  3.0.1 - 2022-06-28
6
  ----------------------------------------------------------------------
1
  Plugin Name: SmartCrawl SEO
2
 
3
  Change Log:
4
+ ----------------------------------------------------------------------
5
+ 3.1.0 - 2022-08-10
6
+ ----------------------------------------------------------------------
7
+ Improvement: Code improvements.
8
+ Improvement: Upgrade Shared UI.
9
+ Fix: Unable to enable Media indexing.
10
+ Fix: Schema types cannot have more than 10 in Schema of same type.
11
+
12
  ----------------------------------------------------------------------
13
  3.0.1 - 2022-06-28
14
  ----------------------------------------------------------------------
class-mappings.php CHANGED
@@ -1,7 +1,13 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  return array(
4
- // Classes in includes/core/
5
  'Smartcrawl_Base_Controller' => '/core/class-wds-base-controller.php',
6
  'Smartcrawl_Checks' => '/core/class-wds-checks.php',
7
  'Smartcrawl_Compatibility' => '/core/class-wds-compatibility.php',
@@ -42,23 +48,23 @@ return array(
42
  'Smartcrawl_Report_Permalinks_Controller' => '/core/class-wds-report-permalinks.php',
43
  'Smartcrawl_Recommended_Plugins' => '/core/class-wds-recommended-plugins.php',
44
  'Smartcrawl_Dashboard_Notices' => '/core/class-wds-dashboard-notices.php',
45
- // Classes in includes/core/service/
46
  'Smartcrawl_Lighthouse_Service' => '/core/service/class-wds-lighthouse-service.php',
47
  'Smartcrawl_Seo_Service' => '/core/service/class-wds-seo-service.php',
48
  'Smartcrawl_Site_Service' => '/core/service/class-wds-site-service.php',
49
  'Smartcrawl_Uptime_Service' => '/core/service/class-wds-uptime-service.php',
50
- // Classes in includes/core/admin-page/
51
  'Smartcrawl_Admin_Page' => '/core/admin-page/class-wds-admin-page.php',
52
  'Smartcrawl_Controller_Upgrade_Page' => '/core/admin-page/class-wds-controller-upgrade-page.php',
53
  'Smartcrawl_Network_Settings_Page_Controller' => '/core/admin-page/class-wds-network-settings-page-controller.php',
54
- // Classes in includes/core/buddypress/
55
  'Smartcrawl_Buddypress_Api' => '/core/buddypress/class-wds-buddypress-api.php',
56
- // Classes in includes/core/cache/
57
  'Smartcrawl_Cache_Manager' => '/core/cache/class-wds-cache-manager.php',
58
  'Smartcrawl_Post_Cache' => '/core/cache/class-wds-post-cache.php',
59
  'Smartcrawl_Term_Cache' => '/core/cache/class-wds-term-cache.php',
60
  'Smartcrawl_String_Cache' => '/core/cache/class-wds-string-cache.php',
61
- // Classes in includes/core/checks/
62
  'Smartcrawl_Check_Post_Abstract' => '/core/checks/class-wds-check-post-abstract.php',
63
  'Smartcrawl_Check_Abstract' => '/core/checks/class-wds-check-abstract.php',
64
  'Smartcrawl_Check_Content_Length' => '/core/checks/class-wds-check-content-length.php',
@@ -75,7 +81,7 @@ return array(
75
  'Smartcrawl_Check_Subheadings_Keywords' => '/core/checks/class-wds-check-subheadings-keywords.php',
76
  'Smartcrawl_Check_Title_Keywords' => '/core/checks/class-wds-check-title-keywords.php',
77
  'Smartcrawl_Check_Title_Length' => '/core/checks/class-wds-check-title-length.php',
78
- // Classes in includes/core/configs
79
  'Smartcrawl_Config_Collection' => '/core/configs/class-wds-config-collection.php',
80
  'Smartcrawl_Configs_Service' => '/core/configs/class-wds-configs-service.php',
81
  'Smartcrawl_Controller_Configs' => '/core/configs/class-wds-controller-configs.php',
@@ -83,16 +89,16 @@ return array(
83
  'Smartcrawl_Export' => '/core/configs/class-wds-export.php',
84
  'Smartcrawl_Import' => '/core/configs/class-wds-import.php',
85
  'Smartcrawl_Model_IO' => '/core/configs/class-wds-model-io.php',
86
- // Classes in includes/core/crawler
87
  'Smartcrawl_Controller_Crawler' => '/core/crawler/class-wds-controller-crawler.php',
88
- // Classes in includes/core/lighthouse/
89
  'Smartcrawl_Controller_Lighthouse' => '/core/lighthouse/class-wds-controller-lighthouse.php',
90
  'Smartcrawl_Lighthouse_Dashboard_Renderer' => '/core/lighthouse/class-wds-lighthouse-dashboard-renderer.php',
91
  'Smartcrawl_Lighthouse_Group' => '/core/lighthouse/class-wds-lighthouse-group.php',
92
  'Smartcrawl_Lighthouse_Options' => '/core/lighthouse/class-wds-lighthouse-options.php',
93
  'Smartcrawl_Lighthouse_Renderer' => '/core/lighthouse/class-wds-lighthouse-renderer.php',
94
  'Smartcrawl_Lighthouse_Report' => '/core/lighthouse/class-wds-lighthouse-report.php',
95
- // Classes in includes/core/entities/
96
  'Smartcrawl_404_Page' => '/core/entities/class-wds-404-page.php',
97
  'Smartcrawl_Blog_Home' => '/core/entities/class-wds-blog-home.php',
98
  'Smartcrawl_Buddypress_Group' => '/core/entities/class-wds-buddypress-group.php',
@@ -108,23 +114,23 @@ return array(
108
  'Smartcrawl_Static_Home' => '/core/entities/class-wds-static-home.php',
109
  'Smartcrawl_Taxonomy_Term' => '/core/entities/class-wds-taxonomy-term.php',
110
  'Smartcrawl_Woo_Shop_Page' => '/core/entities/class-wds-woo-shop-page.php',
111
- // Classes in includes/core/multisite
112
  'Smartcrawl_Subsite_Process_Runner' => '/core/multisite/class-wds-subsite-process-runner.php',
113
  'Smartcrawl_Network_Configs_Controller' => '/core/multisite/class-wds-network-configs-controller.php',
114
  'Smartcrawl_Sitewide_Deprecation_Controller' => '/core/multisite/class-wds-sitewide-deprecation-controller.php',
115
- // Classes in includes/core/readability-analysis/formulas/
116
  'Smartcrawl_Readability_Formula' => '/core/readability-analysis/formulas/class-wds-readability-formula.php',
117
  'Smartcrawl_Readability_Formula_Flesch' => '/core/readability-analysis/formulas/class-wds-readability-formula-flesch.php',
118
- // Classes in includes/core/readability-analysis/
119
  'Smartcrawl_Controller_Readability' => '/core/readability-analysis/class-wds-controller-readability.php',
120
- // Classes in includes/core/redirects
121
  'Smartcrawl_217_Redirect_Upgrade' => '/core/redirects/class-wds-217-redirect-upgrade.php',
122
  'Smartcrawl_Controller_Redirection' => '/core/redirects/class-wds-controller-redirection.php',
123
  'Smartcrawl_Model_Redirection' => '/core/redirects/class-wds-model-redirection.php',
124
  'Smartcrawl_Redirect_Item' => '/core/redirects/class-wds-redirect-item.php',
125
  'Smartcrawl_Redirect_Utils' => '/core/redirects/class-wds-redirect-utils.php',
126
  'Smartcrawl_Redirects_Database_Table' => '/core/redirects/class-wds-redirects-database-table.php',
127
- // Classes in includes/core/lighthouse/checks/
128
  'Smartcrawl_Lighthouse_Canonical_Check' => '/core/lighthouse/checks/class-wds-lighthouse-canonical-check.php',
129
  'Smartcrawl_Lighthouse_Check' => '/core/lighthouse/checks/class-wds-lighthouse-check.php',
130
  'Smartcrawl_Lighthouse_Crawlable_Anchors_Check' => '/core/lighthouse/checks/class-wds-lighthouse-crawlable-anchors-check.php',
@@ -141,10 +147,10 @@ return array(
141
  'Smartcrawl_Lighthouse_Structured_Data_Check' => '/core/lighthouse/checks/class-wds-lighthouse-structured-data-check.php',
142
  'Smartcrawl_Lighthouse_Tap_Targets_Check' => '/core/lighthouse/checks/class-wds-lighthouse-tap-targets-check.php',
143
  'Smartcrawl_Lighthouse_Viewport_Check' => '/core/lighthouse/checks/class-wds-lighthouse-viewport-check.php',
144
- // Classes in includes/core/lighthouse/tables/
145
  'Smartcrawl_Lighthouse_Table' => '/core/lighthouse/tables/class-wds-lighthouse-table.php',
146
  'Smartcrawl_Lighthouse_Tap_Targets_Table' => '/core/lighthouse/tables/class-wds-lighthouse-tap-targets-table.php',
147
- // Classes in includes/core/schema/fragments/
148
  'Smartcrawl_Schema_Fragment' => '/core/schema/fragments/class-wds-schema-fragment.php',
149
  'Smartcrawl_Schema_Fragment_Archive' => '/core/schema/fragments/class-wds-schema-fragment-archive.php',
150
  'Smartcrawl_Schema_Fragment_Article' => '/core/schema/fragments/class-wds-schema-fragment-article.php',
@@ -170,11 +176,11 @@ return array(
170
  'Smartcrawl_Schema_Fragment_Webpage' => '/core/schema/fragments/class-wds-schema-fragment-webpage.php',
171
  'Smartcrawl_Schema_Fragment_Website' => '/core/schema/fragments/class-wds-schema-fragment-website.php',
172
  'Smartcrawl_Schema_Fragment_Woo_Shop' => '/core/schema/fragments/class-wds-schema-fragment-woo-shop.php',
173
- // Classes in includes/core/schema/loops/
174
  'Smartcrawl_Schema_Loop' => '/core/schema/loops/class-wds-schema-loop.php',
175
  'Smartcrawl_Schema_Loop_Comments' => '/core/schema/loops/class-wds-schema-loop-comments.php',
176
  'Smartcrawl_Schema_Loop_Woocommerce_Reviews' => '/core/schema/loops/class-wds-schema-loop-woocommerce-reviews.php',
177
- // Classes in includes/core/schema/sources/
178
  'Smartcrawl_Schema_Property_Source' => '/core/schema/sources/class-wds-schema-property-source.php',
179
  'Smartcrawl_Schema_Source_Author' => '/core/schema/sources/class-wds-schema-source-author.php',
180
  'Smartcrawl_Schema_Source_Comment' => '/core/schema/sources/class-wds-schema-source-comment.php',
@@ -191,10 +197,10 @@ return array(
191
  'Smartcrawl_Schema_Source_Woocommerce' => '/core/schema/sources/class-wds-schema-source-woocommerce.php',
192
  'Smartcrawl_Schema_Source_Woocommerce_Review' => '/core/schema/sources/class-wds-schema-source-woocommerce-review.php',
193
  'Smartcrawl_Schema_Source_Woocommerce_Review_Factory' => '/core/schema/sources/class-wds-schema-source-woocommerce-review-factory.php',
194
- // Classes in includes/core/schema/types
195
  'Smartcrawl_Schema_Type' => '/core/schema/types/class-wds-schema-type.php',
196
  'Smartcrawl_Schema_Type_Woo_Product' => '/core/schema/types/class-wds-schema-type-woo-product.php',
197
- // Classes in includes/core/schema/
198
  'Smartcrawl_Controller_Media_Schema_Data' => '/core/schema/class-wds-controller-media-schema-data.php',
199
  'Smartcrawl_Controller_Schema_Types' => '/core/schema/class-wds-controller-schema-types.php',
200
  'Smartcrawl_Schema_Printer' => '/core/schema/class-wds-schema-printer.php',
@@ -202,21 +208,21 @@ return array(
202
  'Smartcrawl_Schema_Type_Conditions' => '/core/schema/class-wds-schema-type-conditions.php',
203
  'Smartcrawl_Schema_Type_Constants' => '/core/schema/class-wds-schema-type-constants.php',
204
  'Smartcrawl_Schema_Utils' => '/core/schema/class-wds-schema-utils.php',
205
- // Classes in includes/core/sitemaps/general/query/
206
  'Smartcrawl_Sitemap_BP_Groups_Query' => '/core/sitemaps/general/query/class-wds-sitemap-bp-groups-query.php',
207
  'Smartcrawl_Sitemap_BP_Profile_Query' => '/core/sitemaps/general/query/class-wds-sitemap-bp-profile-query.php',
208
  'Smartcrawl_Sitemap_Extras_Query' => '/core/sitemaps/general/query/class-wds-sitemap-extras-query.php',
209
  'Smartcrawl_Sitemap_Posts_Query' => '/core/sitemaps/general/query/class-wds-sitemap-posts-query.php',
210
  'Smartcrawl_Sitemap_Terms_Query' => '/core/sitemaps/general/query/class-wds-sitemap-terms-query.php',
211
- // Classes in includes/core/sitemaps/general/
212
  'Smartcrawl_General_Sitemap' => '/core/sitemaps/general/class-wds-general-sitemap.php',
213
  'Smartcrawl_Sitemap_Item' => '/core/sitemaps/general/class-wds-sitemap-item.php',
214
- // Classes in includes/core/sitemaps/news/
215
  'Smartcrawl_News_Sitemap' => '/core/sitemaps/news/class-wds-news-sitemap.php',
216
  'Smartcrawl_News_Sitemap_Data' => '/core/sitemaps/news/class-wds-news-sitemap-data.php',
217
  'Smartcrawl_Sitemap_News_Item' => '/core/sitemaps/news/class-wds-sitemap-news-item.php',
218
  'Smartcrawl_Sitemap_News_Query' => '/core/sitemaps/news/class-wds-sitemap-news-query.php',
219
- // Classes in includes/core/sitemaps/
220
  'Smartcrawl_Controller_Sitemap' => '/core/sitemaps/class-wds-controller-sitemap.php',
221
  'Smartcrawl_Controller_Sitemap_Front' => '/core/sitemaps/class-wds-controller-sitemap-front.php',
222
  'Smartcrawl_Controller_Sitemap_Native' => '/core/sitemaps/class-wds-controller-sitemap-native.php',
@@ -228,20 +234,20 @@ return array(
228
  'Smartcrawl_Sitemap_Query' => '/core/sitemaps/class-wds-sitemap-query.php',
229
  'Smartcrawl_Sitemap_Utils' => '/core/sitemaps/class-wds-sitemap-utils.php',
230
  'Smartcrawl_Sitemaps_Provider' => '/core/sitemaps/class-wds-sitemaps-provider.php',
231
- // Classes in includes/core/third-party-import/
232
  'Smartcrawl_Controller_Third_Party_Import' => '/core/third-party-import/class-wds-controller-third-party-import.php',
233
  'Smartcrawl_Importer' => '/core/third-party-import/class-wds-importer.php',
234
  'Smartcrawl_AIOSEOP_Importer' => '/core/third-party-import/class-wds-aioseop-importer.php',
235
  'Smartcrawl_Yoast_Importer' => '/core/third-party-import/class-wds-yoast-importer.php',
236
- // Classes in includes/core/woocommerce/
237
  'Smartcrawl_Controller_Woo_Global_Id' => '/core/woocommerce/class-wds-controller-woo-global-id.php',
238
  'Smartcrawl_Controller_Woocommerce' => '/core/woocommerce/class-wds-controller-woocommerce.php',
239
  'Smartcrawl_Woocommerce_Data' => '/core/woocommerce/class-wds-woocommerce-data.php',
240
  'Smartcrawl_Woocommerce_Api' => '/core/woocommerce/class-wds-woocommerce-api.php',
241
- // Classes in includes/core/wpml/
242
  'Smartcrawl_Controller_Wpml' => '/core/wpml/class-wds-controller-wpml.php',
243
  'Smartcrawl_Wpml_Api' => '/core/wpml/class-wds-wpml-api.php',
244
- // Classes in includes/admin/
245
  'Smartcrawl_Admin' => '/admin/admin.php',
246
  'Smartcrawl_Metabox' => '/admin/metabox.php',
247
  'Smartcrawl_Settings_Admin' => '/admin/settings.php',
@@ -252,7 +258,7 @@ return array(
252
  'Smartcrawl_Readability_Analysis_UI' => '/admin/class-wds-readability-analysis-ui.php',
253
  'Smartcrawl_Social_UI' => '/admin/class-wds-social-ui.php',
254
  'Smartcrawl_Sitemap_UI' => '/admin/class-wds-sitemap-ui.php',
255
- // Classes in includes/admin/settings/
256
  'Smartcrawl_Autolinks_Settings' => '/admin/settings/autolinks.php',
257
  'Smartcrawl_Settings_Dashboard' => '/admin/settings/dashboard.php',
258
  'Smartcrawl_Health_Settings' => '/admin/settings/health.php',
@@ -261,7 +267,7 @@ return array(
261
  'Smartcrawl_Settings_Settings' => '/admin/settings/settings.php',
262
  'Smartcrawl_Sitemap_Settings' => '/admin/settings/sitemap.php',
263
  'Smartcrawl_Social_Settings' => '/admin/settings/social.php',
264
- // Classes in includes/tools/
265
  'Smartcrawl_Autolinks' => '/tools/autolinks.php',
266
  'Smartcrawl_OpenGraph_Printer' => '/tools/class-wds-opengraph-printer.php',
267
  'Smartcrawl_Pinterest_Printer' => '/tools/class-wds-pinterest-printer.php',
@@ -270,15 +276,15 @@ return array(
270
  'Smartcrawl_OnPage' => '/tools/onpage.php',
271
  'Smartcrawl_Sitemaps_Dashboard_Widget' => '/tools/sitemaps-dashboard-widget.php',
272
  'Smartcrawl_Xml_VideoSitemap' => '/tools/video-sitemaps.php',
273
- // Classes in includes/tools/seomoz/
274
  'Smartcrawl_Controller_Moz_Cron' => '/tools/seomoz/class-wds-controller-moz-cron.php',
275
  'Smartcrawl_Moz_API' => '/tools/seomoz/class-wds-moz-api.php',
276
  'Smartcrawl_Moz_Dashboard_Widget' => '/tools/seomoz/class-wds-moz-dashboard-widget.php',
277
  'Smartcrawl_Moz_Results_Renderer' => '/tools/seomoz/class-wds-moz-results-renderer.php',
278
  'Smartcrawl_Moz_Metabox' => '/tools/seomoz/class-wds-moz-metabox.php',
279
- // Classes in includes/
280
  'Smartcrawl_Front' => '/front.php',
281
- // Deprecated classes
282
  'Smartcrawl_Canonical_Value_Helper' => '/deprecated/class-wds-canonical-value-helper.php',
283
  'Smartcrawl_Meta_Value_Helper' => '/deprecated/class-wds-meta-value-helper.php',
284
  'Smartcrawl_OpenGraph_Value_Helper' => '/deprecated/class-wds-opengraph-value-helper.php',
1
  <?php
2
+ /**
3
+ * The autoloader class mappings.
4
+ *
5
+ * @package Smartcrawl
6
+ * @subpackage Class mappings.
7
+ */
8
 
9
  return array(
10
+ // Classes in includes/core/.
11
  'Smartcrawl_Base_Controller' => '/core/class-wds-base-controller.php',
12
  'Smartcrawl_Checks' => '/core/class-wds-checks.php',
13
  'Smartcrawl_Compatibility' => '/core/class-wds-compatibility.php',
48
  'Smartcrawl_Report_Permalinks_Controller' => '/core/class-wds-report-permalinks.php',
49
  'Smartcrawl_Recommended_Plugins' => '/core/class-wds-recommended-plugins.php',
50
  'Smartcrawl_Dashboard_Notices' => '/core/class-wds-dashboard-notices.php',
51
+ // Classes in includes/core/service/.
52
  'Smartcrawl_Lighthouse_Service' => '/core/service/class-wds-lighthouse-service.php',
53
  'Smartcrawl_Seo_Service' => '/core/service/class-wds-seo-service.php',
54
  'Smartcrawl_Site_Service' => '/core/service/class-wds-site-service.php',
55
  'Smartcrawl_Uptime_Service' => '/core/service/class-wds-uptime-service.php',
56
+ // Classes in includes/core/admin-page/.
57
  'Smartcrawl_Admin_Page' => '/core/admin-page/class-wds-admin-page.php',
58
  'Smartcrawl_Controller_Upgrade_Page' => '/core/admin-page/class-wds-controller-upgrade-page.php',
59
  'Smartcrawl_Network_Settings_Page_Controller' => '/core/admin-page/class-wds-network-settings-page-controller.php',
60
+ // Classes in includes/core/buddypress/.
61
  'Smartcrawl_Buddypress_Api' => '/core/buddypress/class-wds-buddypress-api.php',
62
+ // Classes in includes/core/cache/.
63
  'Smartcrawl_Cache_Manager' => '/core/cache/class-wds-cache-manager.php',
64
  'Smartcrawl_Post_Cache' => '/core/cache/class-wds-post-cache.php',
65
  'Smartcrawl_Term_Cache' => '/core/cache/class-wds-term-cache.php',
66
  'Smartcrawl_String_Cache' => '/core/cache/class-wds-string-cache.php',
67
+ // Classes in includes/core/checks/.
68
  'Smartcrawl_Check_Post_Abstract' => '/core/checks/class-wds-check-post-abstract.php',
69
  'Smartcrawl_Check_Abstract' => '/core/checks/class-wds-check-abstract.php',
70
  'Smartcrawl_Check_Content_Length' => '/core/checks/class-wds-check-content-length.php',
81
  'Smartcrawl_Check_Subheadings_Keywords' => '/core/checks/class-wds-check-subheadings-keywords.php',
82
  'Smartcrawl_Check_Title_Keywords' => '/core/checks/class-wds-check-title-keywords.php',
83
  'Smartcrawl_Check_Title_Length' => '/core/checks/class-wds-check-title-length.php',
84
+ // Classes in includes/core/configs.
85
  'Smartcrawl_Config_Collection' => '/core/configs/class-wds-config-collection.php',
86
  'Smartcrawl_Configs_Service' => '/core/configs/class-wds-configs-service.php',
87
  'Smartcrawl_Controller_Configs' => '/core/configs/class-wds-controller-configs.php',
89
  'Smartcrawl_Export' => '/core/configs/class-wds-export.php',
90
  'Smartcrawl_Import' => '/core/configs/class-wds-import.php',
91
  'Smartcrawl_Model_IO' => '/core/configs/class-wds-model-io.php',
92
+ // Classes in includes/core/crawler.
93
  'Smartcrawl_Controller_Crawler' => '/core/crawler/class-wds-controller-crawler.php',
94
+ // Classes in includes/core/lighthouse/.
95
  'Smartcrawl_Controller_Lighthouse' => '/core/lighthouse/class-wds-controller-lighthouse.php',
96
  'Smartcrawl_Lighthouse_Dashboard_Renderer' => '/core/lighthouse/class-wds-lighthouse-dashboard-renderer.php',
97
  'Smartcrawl_Lighthouse_Group' => '/core/lighthouse/class-wds-lighthouse-group.php',
98
  'Smartcrawl_Lighthouse_Options' => '/core/lighthouse/class-wds-lighthouse-options.php',
99
  'Smartcrawl_Lighthouse_Renderer' => '/core/lighthouse/class-wds-lighthouse-renderer.php',
100
  'Smartcrawl_Lighthouse_Report' => '/core/lighthouse/class-wds-lighthouse-report.php',
101
+ // Classes in includes/core/entities/.
102
  'Smartcrawl_404_Page' => '/core/entities/class-wds-404-page.php',
103
  'Smartcrawl_Blog_Home' => '/core/entities/class-wds-blog-home.php',
104
  'Smartcrawl_Buddypress_Group' => '/core/entities/class-wds-buddypress-group.php',
114
  'Smartcrawl_Static_Home' => '/core/entities/class-wds-static-home.php',
115
  'Smartcrawl_Taxonomy_Term' => '/core/entities/class-wds-taxonomy-term.php',
116
  'Smartcrawl_Woo_Shop_Page' => '/core/entities/class-wds-woo-shop-page.php',
117
+ // Classes in includes/core/multisite.
118
  'Smartcrawl_Subsite_Process_Runner' => '/core/multisite/class-wds-subsite-process-runner.php',
119
  'Smartcrawl_Network_Configs_Controller' => '/core/multisite/class-wds-network-configs-controller.php',
120
  'Smartcrawl_Sitewide_Deprecation_Controller' => '/core/multisite/class-wds-sitewide-deprecation-controller.php',
121
+ // Classes in includes/core/readability-analysis/formulas/.
122
  'Smartcrawl_Readability_Formula' => '/core/readability-analysis/formulas/class-wds-readability-formula.php',
123
  'Smartcrawl_Readability_Formula_Flesch' => '/core/readability-analysis/formulas/class-wds-readability-formula-flesch.php',
124
+ // Classes in includes/core/readability-analysis/.
125
  'Smartcrawl_Controller_Readability' => '/core/readability-analysis/class-wds-controller-readability.php',
126
+ // Classes in includes/core/redirects.
127
  'Smartcrawl_217_Redirect_Upgrade' => '/core/redirects/class-wds-217-redirect-upgrade.php',
128
  'Smartcrawl_Controller_Redirection' => '/core/redirects/class-wds-controller-redirection.php',
129
  'Smartcrawl_Model_Redirection' => '/core/redirects/class-wds-model-redirection.php',
130
  'Smartcrawl_Redirect_Item' => '/core/redirects/class-wds-redirect-item.php',
131
  'Smartcrawl_Redirect_Utils' => '/core/redirects/class-wds-redirect-utils.php',
132
  'Smartcrawl_Redirects_Database_Table' => '/core/redirects/class-wds-redirects-database-table.php',
133
+ // Classes in includes/core/lighthouse/checks/.
134
  'Smartcrawl_Lighthouse_Canonical_Check' => '/core/lighthouse/checks/class-wds-lighthouse-canonical-check.php',
135
  'Smartcrawl_Lighthouse_Check' => '/core/lighthouse/checks/class-wds-lighthouse-check.php',
136
  'Smartcrawl_Lighthouse_Crawlable_Anchors_Check' => '/core/lighthouse/checks/class-wds-lighthouse-crawlable-anchors-check.php',
147
  'Smartcrawl_Lighthouse_Structured_Data_Check' => '/core/lighthouse/checks/class-wds-lighthouse-structured-data-check.php',
148
  'Smartcrawl_Lighthouse_Tap_Targets_Check' => '/core/lighthouse/checks/class-wds-lighthouse-tap-targets-check.php',
149
  'Smartcrawl_Lighthouse_Viewport_Check' => '/core/lighthouse/checks/class-wds-lighthouse-viewport-check.php',
150
+ // Classes in includes/core/lighthouse/tables/.
151
  'Smartcrawl_Lighthouse_Table' => '/core/lighthouse/tables/class-wds-lighthouse-table.php',
152
  'Smartcrawl_Lighthouse_Tap_Targets_Table' => '/core/lighthouse/tables/class-wds-lighthouse-tap-targets-table.php',
153
+ // Classes in includes/core/schema/fragments/.
154
  'Smartcrawl_Schema_Fragment' => '/core/schema/fragments/class-wds-schema-fragment.php',
155
  'Smartcrawl_Schema_Fragment_Archive' => '/core/schema/fragments/class-wds-schema-fragment-archive.php',
156
  'Smartcrawl_Schema_Fragment_Article' => '/core/schema/fragments/class-wds-schema-fragment-article.php',
176
  'Smartcrawl_Schema_Fragment_Webpage' => '/core/schema/fragments/class-wds-schema-fragment-webpage.php',
177
  'Smartcrawl_Schema_Fragment_Website' => '/core/schema/fragments/class-wds-schema-fragment-website.php',
178
  'Smartcrawl_Schema_Fragment_Woo_Shop' => '/core/schema/fragments/class-wds-schema-fragment-woo-shop.php',
179
+ // Classes in includes/core/schema/loops/.
180
  'Smartcrawl_Schema_Loop' => '/core/schema/loops/class-wds-schema-loop.php',
181
  'Smartcrawl_Schema_Loop_Comments' => '/core/schema/loops/class-wds-schema-loop-comments.php',
182
  'Smartcrawl_Schema_Loop_Woocommerce_Reviews' => '/core/schema/loops/class-wds-schema-loop-woocommerce-reviews.php',
183
+ // Classes in includes/core/schema/sources/.
184
  'Smartcrawl_Schema_Property_Source' => '/core/schema/sources/class-wds-schema-property-source.php',
185
  'Smartcrawl_Schema_Source_Author' => '/core/schema/sources/class-wds-schema-source-author.php',
186
  'Smartcrawl_Schema_Source_Comment' => '/core/schema/sources/class-wds-schema-source-comment.php',
197
  'Smartcrawl_Schema_Source_Woocommerce' => '/core/schema/sources/class-wds-schema-source-woocommerce.php',
198
  'Smartcrawl_Schema_Source_Woocommerce_Review' => '/core/schema/sources/class-wds-schema-source-woocommerce-review.php',
199
  'Smartcrawl_Schema_Source_Woocommerce_Review_Factory' => '/core/schema/sources/class-wds-schema-source-woocommerce-review-factory.php',
200
+ // Classes in includes/core/schema/types.
201
  'Smartcrawl_Schema_Type' => '/core/schema/types/class-wds-schema-type.php',
202
  'Smartcrawl_Schema_Type_Woo_Product' => '/core/schema/types/class-wds-schema-type-woo-product.php',
203
+ // Classes in includes/core/schema/.
204
  'Smartcrawl_Controller_Media_Schema_Data' => '/core/schema/class-wds-controller-media-schema-data.php',
205
  'Smartcrawl_Controller_Schema_Types' => '/core/schema/class-wds-controller-schema-types.php',
206
  'Smartcrawl_Schema_Printer' => '/core/schema/class-wds-schema-printer.php',
208
  'Smartcrawl_Schema_Type_Conditions' => '/core/schema/class-wds-schema-type-conditions.php',
209
  'Smartcrawl_Schema_Type_Constants' => '/core/schema/class-wds-schema-type-constants.php',
210
  'Smartcrawl_Schema_Utils' => '/core/schema/class-wds-schema-utils.php',
211
+ // Classes in includes/core/sitemaps/general/query/.
212
  'Smartcrawl_Sitemap_BP_Groups_Query' => '/core/sitemaps/general/query/class-wds-sitemap-bp-groups-query.php',
213
  'Smartcrawl_Sitemap_BP_Profile_Query' => '/core/sitemaps/general/query/class-wds-sitemap-bp-profile-query.php',
214
  'Smartcrawl_Sitemap_Extras_Query' => '/core/sitemaps/general/query/class-wds-sitemap-extras-query.php',
215
  'Smartcrawl_Sitemap_Posts_Query' => '/core/sitemaps/general/query/class-wds-sitemap-posts-query.php',
216
  'Smartcrawl_Sitemap_Terms_Query' => '/core/sitemaps/general/query/class-wds-sitemap-terms-query.php',
217
+ // Classes in includes/core/sitemaps/general/.
218
  'Smartcrawl_General_Sitemap' => '/core/sitemaps/general/class-wds-general-sitemap.php',
219
  'Smartcrawl_Sitemap_Item' => '/core/sitemaps/general/class-wds-sitemap-item.php',
220
+ // Classes in includes/core/sitemaps/news/.
221
  'Smartcrawl_News_Sitemap' => '/core/sitemaps/news/class-wds-news-sitemap.php',
222
  'Smartcrawl_News_Sitemap_Data' => '/core/sitemaps/news/class-wds-news-sitemap-data.php',
223
  'Smartcrawl_Sitemap_News_Item' => '/core/sitemaps/news/class-wds-sitemap-news-item.php',
224
  'Smartcrawl_Sitemap_News_Query' => '/core/sitemaps/news/class-wds-sitemap-news-query.php',
225
+ // Classes in includes/core/sitemaps/.
226
  'Smartcrawl_Controller_Sitemap' => '/core/sitemaps/class-wds-controller-sitemap.php',
227
  'Smartcrawl_Controller_Sitemap_Front' => '/core/sitemaps/class-wds-controller-sitemap-front.php',
228
  'Smartcrawl_Controller_Sitemap_Native' => '/core/sitemaps/class-wds-controller-sitemap-native.php',
234
  'Smartcrawl_Sitemap_Query' => '/core/sitemaps/class-wds-sitemap-query.php',
235
  'Smartcrawl_Sitemap_Utils' => '/core/sitemaps/class-wds-sitemap-utils.php',
236
  'Smartcrawl_Sitemaps_Provider' => '/core/sitemaps/class-wds-sitemaps-provider.php',
237
+ // Classes in includes/core/third-party-import/.
238
  'Smartcrawl_Controller_Third_Party_Import' => '/core/third-party-import/class-wds-controller-third-party-import.php',
239
  'Smartcrawl_Importer' => '/core/third-party-import/class-wds-importer.php',
240
  'Smartcrawl_AIOSEOP_Importer' => '/core/third-party-import/class-wds-aioseop-importer.php',
241
  'Smartcrawl_Yoast_Importer' => '/core/third-party-import/class-wds-yoast-importer.php',
242
+ // Classes in includes/core/woocommerce/.
243
  'Smartcrawl_Controller_Woo_Global_Id' => '/core/woocommerce/class-wds-controller-woo-global-id.php',
244
  'Smartcrawl_Controller_Woocommerce' => '/core/woocommerce/class-wds-controller-woocommerce.php',
245
  'Smartcrawl_Woocommerce_Data' => '/core/woocommerce/class-wds-woocommerce-data.php',
246
  'Smartcrawl_Woocommerce_Api' => '/core/woocommerce/class-wds-woocommerce-api.php',
247
+ // Classes in includes/core/wpml/.
248
  'Smartcrawl_Controller_Wpml' => '/core/wpml/class-wds-controller-wpml.php',
249
  'Smartcrawl_Wpml_Api' => '/core/wpml/class-wds-wpml-api.php',
250
+ // Classes in includes/admin/.
251
  'Smartcrawl_Admin' => '/admin/admin.php',
252
  'Smartcrawl_Metabox' => '/admin/metabox.php',
253
  'Smartcrawl_Settings_Admin' => '/admin/settings.php',
258
  'Smartcrawl_Readability_Analysis_UI' => '/admin/class-wds-readability-analysis-ui.php',
259
  'Smartcrawl_Social_UI' => '/admin/class-wds-social-ui.php',
260
  'Smartcrawl_Sitemap_UI' => '/admin/class-wds-sitemap-ui.php',
261
+ // Classes in includes/admin/settings/.
262
  'Smartcrawl_Autolinks_Settings' => '/admin/settings/autolinks.php',
263
  'Smartcrawl_Settings_Dashboard' => '/admin/settings/dashboard.php',
264
  'Smartcrawl_Health_Settings' => '/admin/settings/health.php',
267
  'Smartcrawl_Settings_Settings' => '/admin/settings/settings.php',
268
  'Smartcrawl_Sitemap_Settings' => '/admin/settings/sitemap.php',
269
  'Smartcrawl_Social_Settings' => '/admin/settings/social.php',
270
+ // Classes in includes/tools/.
271
  'Smartcrawl_Autolinks' => '/tools/autolinks.php',
272
  'Smartcrawl_OpenGraph_Printer' => '/tools/class-wds-opengraph-printer.php',
273
  'Smartcrawl_Pinterest_Printer' => '/tools/class-wds-pinterest-printer.php',
276
  'Smartcrawl_OnPage' => '/tools/onpage.php',
277
  'Smartcrawl_Sitemaps_Dashboard_Widget' => '/tools/sitemaps-dashboard-widget.php',
278
  'Smartcrawl_Xml_VideoSitemap' => '/tools/video-sitemaps.php',
279
+ // Classes in includes/tools/seomoz/.
280
  'Smartcrawl_Controller_Moz_Cron' => '/tools/seomoz/class-wds-controller-moz-cron.php',
281
  'Smartcrawl_Moz_API' => '/tools/seomoz/class-wds-moz-api.php',
282
  'Smartcrawl_Moz_Dashboard_Widget' => '/tools/seomoz/class-wds-moz-dashboard-widget.php',
283
  'Smartcrawl_Moz_Results_Renderer' => '/tools/seomoz/class-wds-moz-results-renderer.php',
284
  'Smartcrawl_Moz_Metabox' => '/tools/seomoz/class-wds-moz-metabox.php',
285
+ // Classes in includes/.
286
  'Smartcrawl_Front' => '/front.php',
287
+ // Deprecated classes.
288
  'Smartcrawl_Canonical_Value_Helper' => '/deprecated/class-wds-canonical-value-helper.php',
289
  'Smartcrawl_Meta_Value_Helper' => '/deprecated/class-wds-meta-value-helper.php',
290
  'Smartcrawl_OpenGraph_Value_Helper' => '/deprecated/class-wds-opengraph-value-helper.php',
constants.php CHANGED
@@ -1,11 +1,18 @@
1
  <?php
 
 
 
 
 
 
 
2
  /**
3
  * Internal constants, not to be overridden
4
  */
5
- define( 'SMARTCRAWL_VERSION', '3.0.1' );
6
- define( 'SMARTCRAWL_BUILD', '1657771279772' );
7
  define( 'SMARTCRAWL_BUILD_TYPE', 'free' );
8
- define( 'SMARTCRAWL_SUI_VERSION', '2.10.9' );
9
  define( 'SMARTCRAWL_PACKAGE_ID', 167 );
10
  define( 'SMARTCRAWL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) . 'includes/' );
11
  define( 'SMARTCRAWL_PLUGIN_URL', plugin_dir_url( __FILE__ ) . 'includes/' );
@@ -21,10 +28,10 @@ if ( ! defined( 'SMARTCRAWL_EXPIRE_TRANSIENT_TIMEOUT' ) ) {
21
  if ( ! defined( 'SMARTCRAWL_AUTOLINKS_DEFAULT_CHAR_LIMIT' ) ) {
22
  define( 'SMARTCRAWL_AUTOLINKS_DEFAULT_CHAR_LIMIT', 3 );
23
  }
24
- // Suppress redundant canonicals?
25
- //if ( ! defined( 'SMARTCRAWL_SUPPRESS_REDUNDANT_CANONICAL' ) ) {
26
- // define( 'SMARTCRAWL_SUPPRESS_REDUNDANT_CANONICAL', false );
27
- //}
28
  if ( ! defined( 'SMARTCRAWL_SITEMAP_SKIP_IMAGES' ) ) {
29
  define( 'SMARTCRAWL_SITEMAP_SKIP_IMAGES', false );
30
  }
1
  <?php
2
+ /**
3
+ * The plugin constants.
4
+ *
5
+ * @package Smartcrawl
6
+ * @subpackage Constants
7
+ */
8
+
9
  /**
10
  * Internal constants, not to be overridden
11
  */
12
+ define( 'SMARTCRAWL_VERSION', '3.1.0' );
13
+ define( 'SMARTCRAWL_BUILD', '1660801869112' );
14
  define( 'SMARTCRAWL_BUILD_TYPE', 'free' );
15
+ define( 'SMARTCRAWL_SUI_VERSION', '2.12.10' );
16
  define( 'SMARTCRAWL_PACKAGE_ID', 167 );
17
  define( 'SMARTCRAWL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) . 'includes/' );
18
  define( 'SMARTCRAWL_PLUGIN_URL', plugin_dir_url( __FILE__ ) . 'includes/' );
28
  if ( ! defined( 'SMARTCRAWL_AUTOLINKS_DEFAULT_CHAR_LIMIT' ) ) {
29
  define( 'SMARTCRAWL_AUTOLINKS_DEFAULT_CHAR_LIMIT', 3 );
30
  }
31
+ // Suppress redundant canonicals?.
32
+ // if ( ! defined( 'SMARTCRAWL_SUPPRESS_REDUNDANT_CANONICAL' ) ) {
33
+ // define( 'SMARTCRAWL_SUPPRESS_REDUNDANT_CANONICAL', false );
34
+ // }.
35
  if ( ! defined( 'SMARTCRAWL_SITEMAP_SKIP_IMAGES' ) ) {
36
  define( 'SMARTCRAWL_SITEMAP_SKIP_IMAGES', false );
37
  }
includes/admin/admin.php CHANGED
@@ -9,37 +9,22 @@
9
  * Admin handling root class
10
  */
11
  class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
12
- /**
13
- * Static instance
14
- *
15
- * @var self
16
- */
17
- private static $_instance;
18
 
19
  /**
20
  * Admin page handlers
21
  *
22
  * @var array
23
  */
24
- private $_handlers = array();
25
-
26
- /**
27
- * Static instance getter
28
- */
29
- public static function get() {
30
- if ( empty( self::$_instance ) ) {
31
- self::$_instance = new self();
32
- }
33
-
34
- return self::$_instance;
35
- }
36
 
37
  /**
38
  * Initializing method
39
  */
40
  protected function init() {
41
  // Set up dash.
42
- // TODO: dash setup probably needs its own controller
43
  if ( file_exists( SMARTCRAWL_PLUGIN_DIR . 'external/dash/wpmudev-dash-notification.php' ) ) {
44
  global $wpmudev_notices;
45
  if ( ! is_array( $wpmudev_notices ) ) {
@@ -84,14 +69,14 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
84
  add_action( 'admin_notices', array( $this, 'blog_not_public_notice' ) );
85
  }
86
 
87
- $this->_handlers['dashboard'] = Smartcrawl_Settings_Dashboard::get_instance();
88
- $this->_handlers['health'] = Smartcrawl_Health_Settings::get_instance();
89
- $this->_handlers['onpage'] = Smartcrawl_Onpage_Settings::get_instance();
90
- $this->_handlers['schema'] = Smartcrawl_Schema_Settings::get_instance();
91
- $this->_handlers['social'] = Smartcrawl_Social_Settings::get_instance();
92
- $this->_handlers['sitemap'] = Smartcrawl_Sitemap_Settings::get_instance();
93
- $this->_handlers['autolinks'] = Smartcrawl_Autolinks_Settings::get_instance();
94
- $this->_handlers['settings'] = Smartcrawl_Settings_Settings::get_instance();
95
  }
96
 
97
  /**
@@ -103,34 +88,62 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
103
  * In response to "Unable to save options multiple times" bug.
104
  */
105
  public function register_setting() {
106
- register_setting( 'wds_settings_options', 'wds_settings_options', array(
107
- $this->get_handler( 'settings' ),
108
- 'validate',
109
- ) );
110
- register_setting( 'wds_sitemap_options', 'wds_sitemap_options', array(
111
- $this->get_handler( 'sitemap' ),
112
- 'validate',
113
- ) );
114
- register_setting( 'wds_onpage_options', 'wds_onpage_options', array(
115
- $this->get_handler( 'onpage' ),
116
- 'validate',
117
- ) );
118
- register_setting( 'wds_social_options', 'wds_social_options', array(
119
- $this->get_handler( 'social' ),
120
- 'validate',
121
- ) );
122
- register_setting( 'wds_schema_options', 'wds_schema_options', array(
123
- $this->get_handler( 'schema' ),
124
- 'validate',
125
- ) );
126
- register_setting( 'wds_autolinks_options', 'wds_autolinks_options', array(
127
- $this->get_handler( 'autolinks' ),
128
- 'validate',
129
- ) );
130
- register_setting( 'wds_redirections_options', 'wds_redirections_options', array(
131
- $this->get_handler( 'redirections' ),
132
- 'validate',
133
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  }
135
 
136
  /**
@@ -141,8 +154,8 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
141
  * @return object Handler
142
  */
143
  public function get_handler( $hndl ) {
144
- return isset( $this->_handlers[ $hndl ] )
145
- ? $this->_handlers[ $hndl ]
146
  : $this;
147
  }
148
 
@@ -160,7 +173,7 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
160
  if ( ! is_admin_bar_showing() ) {
161
  return false;
162
  }
163
- if ( ! apply_filters( 'wds-admin-ui-show_bar', true ) ) {
164
  return false;
165
  }
166
  // Do not show if only superadmin can view settings and the current user is not super admin.
@@ -172,13 +185,13 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
172
  return false;
173
  }
174
 
175
- // On single site don't show for non-admins
176
  if ( ! current_user_can( 'manage_options' ) ) {
177
  return false;
178
  }
179
 
180
  $optional_nodes = array();
181
- foreach ( $this->_handlers as $handler ) {
182
  if ( empty( $handler ) || empty( $handler->slug ) ) {
183
  continue;
184
  }
@@ -201,6 +214,11 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
201
  return true;
202
  }
203
 
 
 
 
 
 
204
  private function is_admin_bar_node_allowed( $slug ) {
205
  if ( is_multisite() ) {
206
  return Smartcrawl_Settings_Admin::is_tab_allowed( $slug );
@@ -209,6 +227,13 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
209
  return true;
210
  }
211
 
 
 
 
 
 
 
 
212
  private function create_admin_bar_node( $id, $title, $slug = '' ) {
213
  $node = array(
214
  'id' => $id,
@@ -245,7 +270,7 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
245
  */
246
  public function blog_not_public_notice() {
247
  if ( ! current_user_can( 'manage_options' ) ) {
248
- return false;
249
  }
250
 
251
  $message = sprintf(
@@ -262,7 +287,7 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
262
  * Process message dismissal request
263
  */
264
  public function smartcrawl_dismiss_message() {
265
- $data = $this->get_request_data();
266
  $message = sanitize_key( smartcrawl_get_array_value( $data, 'message' ) );
267
  if ( null === $message ) {
268
  wp_send_json_error();
@@ -270,25 +295,31 @@ class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
270
  return;
271
  }
272
 
273
- $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
274
- $dismissed_messages = '' === $dismissed_messages ? array() : $dismissed_messages;
275
  $dismissed_messages[ $message ] = true;
276
  update_user_meta( get_current_user_id(), 'wds_dismissed_messages', $dismissed_messages );
277
  wp_send_json_success();
278
  }
279
 
280
  /**
281
- * TODO: we should remove widgets from the wordpress dashboard making dashboard resources unnecessary
282
  */
283
  public function enqueue_dashboard_resources() {
284
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_dashboard_css' ) );
285
  }
286
 
287
- function enqueue_dashboard_css() {
 
 
 
288
  wp_enqueue_style( Smartcrawl_Controller_Assets::WP_DASHBOARD_CSS );
289
  }
290
 
 
 
 
291
  private function get_request_data() {
292
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-admin-nonce' ) ? stripslashes_deep( $_POST ) : array();
293
  }
294
  }
9
  * Admin handling root class
10
  */
11
  class Smartcrawl_Admin extends Smartcrawl_Base_Controller {
12
+
13
+ use Smartcrawl_Singleton;
 
 
 
 
14
 
15
  /**
16
  * Admin page handlers
17
  *
18
  * @var array
19
  */
20
+ private $handlers = array();
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  /**
23
  * Initializing method
24
  */
25
  protected function init() {
26
  // Set up dash.
27
+ // TODO: dash setup probably needs its own controller.
28
  if ( file_exists( SMARTCRAWL_PLUGIN_DIR . 'external/dash/wpmudev-dash-notification.php' ) ) {
29
  global $wpmudev_notices;
30
  if ( ! is_array( $wpmudev_notices ) ) {
69
  add_action( 'admin_notices', array( $this, 'blog_not_public_notice' ) );
70
  }
71
 
72
+ $this->handlers['dashboard'] = Smartcrawl_Settings_Dashboard::get();
73
+ $this->handlers['health'] = Smartcrawl_Health_Settings::get();
74
+ $this->handlers['onpage'] = Smartcrawl_Onpage_Settings::get();
75
+ $this->handlers['schema'] = Smartcrawl_Schema_Settings::get();
76
+ $this->handlers['social'] = Smartcrawl_Social_Settings::get();
77
+ $this->handlers['sitemap'] = Smartcrawl_Sitemap_Settings::get();
78
+ $this->handlers['autolinks'] = Smartcrawl_Autolinks_Settings::get();
79
+ $this->handlers['settings'] = Smartcrawl_Settings_Settings::get();
80
  }
81
 
82
  /**
88
  * In response to "Unable to save options multiple times" bug.
89
  */
90
  public function register_setting() {
91
+ register_setting(
92
+ 'wds_settings_options',
93
+ 'wds_settings_options',
94
+ array(
95
+ $this->get_handler( 'settings' ),
96
+ 'validate',
97
+ )
98
+ );
99
+ register_setting(
100
+ 'wds_sitemap_options',
101
+ 'wds_sitemap_options',
102
+ array(
103
+ $this->get_handler( 'sitemap' ),
104
+ 'validate',
105
+ )
106
+ );
107
+ register_setting(
108
+ 'wds_onpage_options',
109
+ 'wds_onpage_options',
110
+ array(
111
+ $this->get_handler( 'onpage' ),
112
+ 'validate',
113
+ )
114
+ );
115
+ register_setting(
116
+ 'wds_social_options',
117
+ 'wds_social_options',
118
+ array(
119
+ $this->get_handler( 'social' ),
120
+ 'validate',
121
+ )
122
+ );
123
+ register_setting(
124
+ 'wds_schema_options',
125
+ 'wds_schema_options',
126
+ array(
127
+ $this->get_handler( 'schema' ),
128
+ 'validate',
129
+ )
130
+ );
131
+ register_setting(
132
+ 'wds_autolinks_options',
133
+ 'wds_autolinks_options',
134
+ array(
135
+ $this->get_handler( 'autolinks' ),
136
+ 'validate',
137
+ )
138
+ );
139
+ register_setting(
140
+ 'wds_redirections_options',
141
+ 'wds_redirections_options',
142
+ array(
143
+ $this->get_handler( 'redirections' ),
144
+ 'validate',
145
+ )
146
+ );
147
  }
148
 
149
  /**
154
  * @return object Handler
155
  */
156
  public function get_handler( $hndl ) {
157
+ return isset( $this->handlers[ $hndl ] )
158
+ ? $this->handlers[ $hndl ]
159
  : $this;
160
  }
161
 
173
  if ( ! is_admin_bar_showing() ) {
174
  return false;
175
  }
176
+ if ( ! apply_filters( 'wds-admin-ui-show_bar', true ) ) { // phpcs:ignore
177
  return false;
178
  }
179
  // Do not show if only superadmin can view settings and the current user is not super admin.
185
  return false;
186
  }
187
 
188
+ // On single site don't show for non-admins.
189
  if ( ! current_user_can( 'manage_options' ) ) {
190
  return false;
191
  }
192
 
193
  $optional_nodes = array();
194
+ foreach ( $this->handlers as $handler ) {
195
  if ( empty( $handler ) || empty( $handler->slug ) ) {
196
  continue;
197
  }
214
  return true;
215
  }
216
 
217
+ /**
218
+ * @param $slug
219
+ *
220
+ * @return bool
221
+ */
222
  private function is_admin_bar_node_allowed( $slug ) {
223
  if ( is_multisite() ) {
224
  return Smartcrawl_Settings_Admin::is_tab_allowed( $slug );
227
  return true;
228
  }
229
 
230
+ /**
231
+ * @param $id
232
+ * @param $title
233
+ * @param $slug
234
+ *
235
+ * @return array
236
+ */
237
  private function create_admin_bar_node( $id, $title, $slug = '' ) {
238
  $node = array(
239
  'id' => $id,
270
  */
271
  public function blog_not_public_notice() {
272
  if ( ! current_user_can( 'manage_options' ) ) {
273
+ return;
274
  }
275
 
276
  $message = sprintf(
287
  * Process message dismissal request
288
  */
289
  public function smartcrawl_dismiss_message() {
290
+ $data = $this->get_request_data();
291
  $message = sanitize_key( smartcrawl_get_array_value( $data, 'message' ) );
292
  if ( null === $message ) {
293
  wp_send_json_error();
295
  return;
296
  }
297
 
298
+ $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
299
+ $dismissed_messages = '' === $dismissed_messages ? array() : $dismissed_messages;
300
  $dismissed_messages[ $message ] = true;
301
  update_user_meta( get_current_user_id(), 'wds_dismissed_messages', $dismissed_messages );
302
  wp_send_json_success();
303
  }
304
 
305
  /**
306
+ * TODO: we should remove widgets from the WordPress dashboard making dashboard resources unnecessary.
307
  */
308
  public function enqueue_dashboard_resources() {
309
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_dashboard_css' ) );
310
  }
311
 
312
+ /**
313
+ * @return void
314
+ */
315
+ public function enqueue_dashboard_css() {
316
  wp_enqueue_style( Smartcrawl_Controller_Assets::WP_DASHBOARD_CSS );
317
  }
318
 
319
+ /**
320
+ * @return array|mixed
321
+ */
322
  private function get_request_data() {
323
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wds_nonce'] ), 'wds-admin-nonce' ) ? stripslashes_deep( $_POST ) : array(); // phpcs:ignore
324
  }
325
  }
includes/admin/class-wds-autolinks-ui.php CHANGED
@@ -2,24 +2,13 @@
2
 
3
  class Smartcrawl_Autolinks_UI extends Smartcrawl_Base_Controller {
4
 
5
- /**
6
- * Static instance
7
- *
8
- * @var Smartcrawl_OnPage
9
- */
10
- private static $_instance;
11
 
12
  /**
13
- * Static instance getter
 
 
14
  */
15
- public static function get() {
16
- if ( empty( self::$_instance ) ) {
17
- self::$_instance = new self();
18
- }
19
-
20
- return self::$_instance;
21
- }
22
-
23
  public function should_run() {
24
  return Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_AUTOLINKS );
25
  }
@@ -27,31 +16,38 @@ class Smartcrawl_Autolinks_UI extends Smartcrawl_Base_Controller {
27
  /**
28
  * Child controllers can use this method to initialize.
29
  *
30
- * @return mixed
31
  */
32
  protected function init() {
33
  add_filter( 'wds-sections-metabox-advanced', array( $this, 'add_advanced_metabox_redirects_section' ), 20, 2 );
34
 
35
  if ( Smartcrawl_Settings::get_setting( 'autolinks' ) ) {
36
- add_filter( 'wds-sections-metabox-advanced', array(
37
- $this,
38
- 'add_advanced_metabox_autolinks_section',
39
- ), 40, 2 );
 
 
 
 
 
40
  }
41
 
42
  return true;
43
  }
44
 
45
  /**
46
- * @param $sections
47
- * @param WP_Post $post
 
 
48
  */
49
  public function add_advanced_metabox_redirects_section( $sections, $post = null ) {
50
  if ( empty( $post ) ) {
51
  return $sections;
52
  }
53
 
54
- $post_id = $post->ID;
55
  $sections['metabox/metabox-advanced-redirect'] = array(
56
  'redirect_url' => smartcrawl_get_value( 'redirect', $post_id ),
57
  'has_permission' => user_can_see_seo_metabox_301_redirect(),
@@ -61,15 +57,17 @@ class Smartcrawl_Autolinks_UI extends Smartcrawl_Base_Controller {
61
  }
62
 
63
  /**
64
- * @param $sections
65
- * @param WP_Post $post
 
 
66
  */
67
  public function add_advanced_metabox_autolinks_section( $sections, $post = null ) {
68
  if ( empty( $post ) ) {
69
  return $sections;
70
  }
71
 
72
- $post_id = $post->ID;
73
  $sections['metabox/metabox-advanced-autolinks'] = array(
74
  'autolinks_exclude' => smartcrawl_get_value( 'autolinks-exclude', $post_id ),
75
  );
2
 
3
  class Smartcrawl_Autolinks_UI extends Smartcrawl_Base_Controller {
4
 
5
+ use Smartcrawl_Singleton;
 
 
 
 
 
6
 
7
  /**
8
+ * Should run?.
9
+ *
10
+ * @return bool
11
  */
 
 
 
 
 
 
 
 
12
  public function should_run() {
13
  return Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_AUTOLINKS );
14
  }
16
  /**
17
  * Child controllers can use this method to initialize.
18
  *
19
+ * @return bool
20
  */
21
  protected function init() {
22
  add_filter( 'wds-sections-metabox-advanced', array( $this, 'add_advanced_metabox_redirects_section' ), 20, 2 );
23
 
24
  if ( Smartcrawl_Settings::get_setting( 'autolinks' ) ) {
25
+ add_filter(
26
+ 'wds-sections-metabox-advanced',
27
+ array(
28
+ $this,
29
+ 'add_advanced_metabox_autolinks_section',
30
+ ),
31
+ 40,
32
+ 2
33
+ );
34
  }
35
 
36
  return true;
37
  }
38
 
39
  /**
40
+ * Add advanced mextabox for redirects.
41
+ *
42
+ * @param array $sections Sections.
43
+ * @param WP_Post $post Post object.
44
  */
45
  public function add_advanced_metabox_redirects_section( $sections, $post = null ) {
46
  if ( empty( $post ) ) {
47
  return $sections;
48
  }
49
 
50
+ $post_id = $post->ID;
51
  $sections['metabox/metabox-advanced-redirect'] = array(
52
  'redirect_url' => smartcrawl_get_value( 'redirect', $post_id ),
53
  'has_permission' => user_can_see_seo_metabox_301_redirect(),
57
  }
58
 
59
  /**
60
+ * Add advanced metabox for auto links.
61
+ *
62
+ * @param array $sections Sections.
63
+ * @param WP_Post $post Post object.
64
  */
65
  public function add_advanced_metabox_autolinks_section( $sections, $post = null ) {
66
  if ( empty( $post ) ) {
67
  return $sections;
68
  }
69
 
70
+ $post_id = $post->ID;
71
  $sections['metabox/metabox-advanced-autolinks'] = array(
72
  'autolinks_exclude' => smartcrawl_get_value( 'autolinks-exclude', $post_id ),
73
  );
includes/admin/class-wds-onpage-ui.php CHANGED
@@ -2,27 +2,15 @@
2
 
3
  class Smartcrawl_OnPage_UI extends Smartcrawl_Base_Controller {
4
 
5
- /**
6
- * Static instance
7
- *
8
- * @var self
9
- */
10
- private static $_instance;
11
 
12
  /**
13
- * Static instance getter
 
 
14
  */
15
- public static function get() {
16
- if ( empty( self::$_instance ) ) {
17
- self::$_instance = new self();
18
- }
19
-
20
- return self::$_instance;
21
- }
22
-
23
  public function should_run() {
24
- return Smartcrawl_Settings::get_setting( 'onpage' )
25
- && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_ONPAGE );
26
  }
27
 
28
  /**
@@ -37,6 +25,12 @@ class Smartcrawl_OnPage_UI extends Smartcrawl_Base_Controller {
37
  return true;
38
  }
39
 
 
 
 
 
 
 
40
  public function add_seo_meta_fields( $sections, $post = null ) {
41
  if ( empty( $post ) ) {
42
  return $sections;
@@ -50,16 +44,18 @@ class Smartcrawl_OnPage_UI extends Smartcrawl_Base_Controller {
50
  }
51
 
52
  /**
53
- * @param $sections
54
- * @param WP_Post $post
 
 
55
  */
56
  public function add_advanced_metabox_settings_section( $sections, $post = null ) {
57
  if ( empty( $post ) ) {
58
  return $sections;
59
  }
60
 
61
- $all_options = Smartcrawl_Settings::get_options();
62
- $post_id = $post->ID;
63
  $sections['metabox/metabox-advanced-indexing'] = array(
64
  'robots_noindex_value' => (int) smartcrawl_get_value( 'meta-robots-noindex', $post_id ),
65
  'robots_nofollow_value' => (int) smartcrawl_get_value( 'meta-robots-nofollow', $post_id ),
2
 
3
  class Smartcrawl_OnPage_UI extends Smartcrawl_Base_Controller {
4
 
5
+ use Smartcrawl_Singleton;
 
 
 
 
 
6
 
7
  /**
8
+ * Should run?.
9
+ *
10
+ * @return bool
11
  */
 
 
 
 
 
 
 
 
12
  public function should_run() {
13
+ return Smartcrawl_Settings::get_setting( 'onpage' ) && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_ONPAGE );
 
14
  }
15
 
16
  /**
25
  return true;
26
  }
27
 
28
+ /**
29
+ * @param $sections
30
+ * @param $post
31
+ *
32
+ * @return mixed
33
+ */
34
  public function add_seo_meta_fields( $sections, $post = null ) {
35
  if ( empty( $post ) ) {
36
  return $sections;
44
  }
45
 
46
  /**
47
+ * Add advanced metabox for settings sections.
48
+ *
49
+ * @param array $sections Sections.
50
+ * @param WP_Post $post Post object.
51
  */
52
  public function add_advanced_metabox_settings_section( $sections, $post = null ) {
53
  if ( empty( $post ) ) {
54
  return $sections;
55
  }
56
 
57
+ $all_options = Smartcrawl_Settings::get_options();
58
+ $post_id = $post->ID;
59
  $sections['metabox/metabox-advanced-indexing'] = array(
60
  'robots_noindex_value' => (int) smartcrawl_get_value( 'meta-robots-noindex', $post_id ),
61
  'robots_nofollow_value' => (int) smartcrawl_get_value( 'meta-robots-nofollow', $post_id ),
includes/admin/class-wds-readability-analysis-ui.php CHANGED
@@ -1,33 +1,30 @@
1
  <?php
2
 
3
  class Smartcrawl_Readability_Analysis_UI extends Smartcrawl_Base_Controller {
4
- /**
5
- * Static instance
6
- *
7
- * @var self
8
- */
9
- private static $_instance;
10
 
11
  /**
12
- * Static instance getter
13
  */
14
- public static function get() {
15
- if ( empty( self::$_instance ) ) {
16
- self::$_instance = new self();
17
- }
18
-
19
- return self::$_instance;
20
- }
21
-
22
  public function should_run() {
23
  return Smartcrawl_Settings::get_setting( 'analysis-readability' );
24
  }
25
 
 
 
 
26
  protected function init() {
27
  add_filter( 'wds-sections-metabox-readability', array( $this, 'add_analysis_section' ), 10, 2 );
28
  add_filter( 'wds-metabox-nav-item', array( $this, 'add_issue_count' ), 10, 2 );
29
  }
30
 
 
 
 
 
 
 
31
  public function add_analysis_section( $sections, $post = null ) {
32
  if ( empty( $post ) ) {
33
  return $sections;
@@ -40,8 +37,14 @@ class Smartcrawl_Readability_Analysis_UI extends Smartcrawl_Base_Controller {
40
  return $sections;
41
  }
42
 
 
 
 
 
 
 
43
  public function add_issue_count( $tab_name, $tab_id ) {
44
- return $tab_id === 'wds_readability'
45
  ? $tab_name . '<span class="wds-issues"><span></span></span>'
46
  : $tab_name;
47
  }
1
  <?php
2
 
3
  class Smartcrawl_Readability_Analysis_UI extends Smartcrawl_Base_Controller {
4
+
5
+ use Smartcrawl_Singleton;
 
 
 
 
6
 
7
  /**
8
+ * @return bool|mixed
9
  */
 
 
 
 
 
 
 
 
10
  public function should_run() {
11
  return Smartcrawl_Settings::get_setting( 'analysis-readability' );
12
  }
13
 
14
+ /**
15
+ * @return void
16
+ */
17
  protected function init() {
18
  add_filter( 'wds-sections-metabox-readability', array( $this, 'add_analysis_section' ), 10, 2 );
19
  add_filter( 'wds-metabox-nav-item', array( $this, 'add_issue_count' ), 10, 2 );
20
  }
21
 
22
+ /**
23
+ * @param $sections
24
+ * @param $post
25
+ *
26
+ * @return array
27
+ */
28
  public function add_analysis_section( $sections, $post = null ) {
29
  if ( empty( $post ) ) {
30
  return $sections;
37
  return $sections;
38
  }
39
 
40
+ /**
41
+ * @param $tab_name
42
+ * @param $tab_id
43
+ *
44
+ * @return string
45
+ */
46
  public function add_issue_count( $tab_name, $tab_id ) {
47
+ return 'wds_readability' === $tab_id
48
  ? $tab_name . '<span class="wds-issues"><span></span></span>'
49
  : $tab_name;
50
  }
includes/admin/class-wds-seo-analysis-ui.php CHANGED
@@ -1,33 +1,30 @@
1
  <?php
2
 
3
  class Smartcrawl_SEO_Analysis_UI extends Smartcrawl_Base_Controller {
4
- /**
5
- * Static instance
6
- *
7
- * @var self
8
- */
9
- private static $_instance;
10
 
11
  /**
12
- * Static instance getter
13
  */
14
- public static function get() {
15
- if ( empty( self::$_instance ) ) {
16
- self::$_instance = new self();
17
- }
18
-
19
- return self::$_instance;
20
- }
21
-
22
  public function should_run() {
23
  return Smartcrawl_Settings::get_setting( 'analysis-seo' );
24
  }
25
 
 
 
 
26
  protected function init() {
27
  add_filter( 'wds-sections-metabox-seo', array( $this, 'add_analysis_section' ), 10, 2 );
28
  add_filter( 'wds-metabox-nav-item', array( $this, 'add_issue_count' ), 10, 2 );
29
  }
30
 
 
 
 
 
 
 
31
  public function add_analysis_section( $sections, $post = null ) {
32
  if ( empty( $post ) ) {
33
  return $sections;
@@ -40,8 +37,14 @@ class Smartcrawl_SEO_Analysis_UI extends Smartcrawl_Base_Controller {
40
  return $sections;
41
  }
42
 
 
 
 
 
 
 
43
  public function add_issue_count( $tab_name, $tab_id ) {
44
- return $tab_id === 'wds_seo'
45
  ? $tab_name . '<span class="wds-issues"><span></span></span>'
46
  : $tab_name;
47
  }
1
  <?php
2
 
3
  class Smartcrawl_SEO_Analysis_UI extends Smartcrawl_Base_Controller {
4
+
5
+ use Smartcrawl_Singleton;
 
 
 
 
6
 
7
  /**
8
+ * @return bool
9
  */
 
 
 
 
 
 
 
 
10
  public function should_run() {
11
  return Smartcrawl_Settings::get_setting( 'analysis-seo' );
12
  }
13
 
14
+ /**
15
+ * @return void
16
+ */
17
  protected function init() {
18
  add_filter( 'wds-sections-metabox-seo', array( $this, 'add_analysis_section' ), 10, 2 );
19
  add_filter( 'wds-metabox-nav-item', array( $this, 'add_issue_count' ), 10, 2 );
20
  }
21
 
22
+ /**
23
+ * @param $sections
24
+ * @param $post
25
+ *
26
+ * @return array
27
+ */
28
  public function add_analysis_section( $sections, $post = null ) {
29
  if ( empty( $post ) ) {
30
  return $sections;
37
  return $sections;
38
  }
39
 
40
+ /**
41
+ * @param $tab_name
42
+ * @param $tab_id
43
+ *
44
+ * @return string
45
+ */
46
  public function add_issue_count( $tab_name, $tab_id ) {
47
+ return 'wds_seo' === $tab_id
48
  ? $tab_name . '<span class="wds-issues"><span></span></span>'
49
  : $tab_name;
50
  }
includes/admin/class-wds-sitemap-ui.php CHANGED
@@ -1,27 +1,14 @@
1
  <?php
2
 
3
  class Smartcrawl_Sitemap_UI extends Smartcrawl_Base_Controller {
4
- /**
5
- * Static instance
6
- *
7
- * @var Smartcrawl_OnPage
8
- */
9
- private static $_instance;
10
 
11
  /**
12
- * Static instance getter
13
  */
14
- public static function get() {
15
- if ( empty( self::$_instance ) ) {
16
- self::$_instance = new self();
17
- }
18
-
19
- return self::$_instance;
20
- }
21
-
22
  public function should_run() {
23
- return Smartcrawl_Settings::get_setting( 'sitemap' )
24
- && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SITEMAP );
25
  }
26
 
27
  /**
@@ -31,18 +18,25 @@ class Smartcrawl_Sitemap_UI extends Smartcrawl_Base_Controller {
31
  */
32
  protected function init() {
33
  if ( Smartcrawl_Settings::get_setting( 'sitemap' ) ) {
34
- add_filter( 'wds-sections-metabox-advanced', array(
35
- $this,
36
- 'add_advanced_metabox_settings_section',
37
- ), 30, 2 );
 
 
 
 
 
38
  }
39
 
40
  return true;
41
  }
42
 
43
  /**
44
- * @param $sections
45
- * @param WP_Post $post
 
 
46
  */
47
  public function add_advanced_metabox_settings_section( $sections, $post = null ) {
48
  if ( empty( $post ) ) {
@@ -50,6 +44,7 @@ class Smartcrawl_Sitemap_UI extends Smartcrawl_Base_Controller {
50
  }
51
 
52
  $post_id = $post->ID;
 
53
  $sections['metabox/metabox-advanced-sitemap-priority'] = array(
54
  'sitemap_priority_options' => array(
55
  '' => __( 'Automatic prioritization', 'wds' ),
1
  <?php
2
 
3
  class Smartcrawl_Sitemap_UI extends Smartcrawl_Base_Controller {
4
+
5
+ use Smartcrawl_Singleton;
 
 
 
 
6
 
7
  /**
8
+ * @return bool
9
  */
 
 
 
 
 
 
 
 
10
  public function should_run() {
11
+ return Smartcrawl_Settings::get_setting( 'sitemap' ) && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SITEMAP );
 
12
  }
13
 
14
  /**
18
  */
19
  protected function init() {
20
  if ( Smartcrawl_Settings::get_setting( 'sitemap' ) ) {
21
+ add_filter(
22
+ 'wds-sections-metabox-advanced',
23
+ array(
24
+ $this,
25
+ 'add_advanced_metabox_settings_section',
26
+ ),
27
+ 30,
28
+ 2
29
+ );
30
  }
31
 
32
  return true;
33
  }
34
 
35
  /**
36
+ * Add advanced metabox for settings section.
37
+ *
38
+ * @param array $sections Sections.
39
+ * @param WP_Post $post Post object.
40
  */
41
  public function add_advanced_metabox_settings_section( $sections, $post = null ) {
42
  if ( empty( $post ) ) {
44
  }
45
 
46
  $post_id = $post->ID;
47
+
48
  $sections['metabox/metabox-advanced-sitemap-priority'] = array(
49
  'sitemap_priority_options' => array(
50
  '' => __( 'Automatic prioritization', 'wds' ),
includes/admin/class-wds-social-ui.php CHANGED
@@ -1,40 +1,36 @@
1
  <?php
2
 
3
  class Smartcrawl_Social_UI extends Smartcrawl_Base_Controller {
4
- /**
5
- * Static instance
6
- *
7
- * @var self
8
- */
9
- private static $_instance;
10
 
11
  /**
12
- * Static instance getter
13
  */
14
- public static function get() {
15
- if ( empty( self::$_instance ) ) {
16
- self::$_instance = new self();
17
- }
18
-
19
- return self::$_instance;
20
- }
21
-
22
  public function should_run() {
23
- return Smartcrawl_Settings::get_setting( 'social' )
24
- && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL );
25
  }
26
 
 
 
 
27
  protected function init() {
28
  add_filter( 'wds-sections-metabox-social', array( $this, 'add_social_sections' ), 10, 2 );
29
  }
30
 
 
 
 
 
 
 
31
  public function add_social_sections( $sections, $post = null ) {
32
  if ( empty( $post ) ) {
33
  return $sections;
34
  }
35
 
36
- $all_options = Smartcrawl_Settings::get_options();
37
- $og_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-enable' );
38
  $og_post_type_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-active-' . get_post_type( $post ) );
39
  if ( $og_setting_enabled && $og_post_type_enabled ) {
40
  $sections['metabox/metabox-social-opengraph'] = array(
@@ -43,7 +39,7 @@ class Smartcrawl_Social_UI extends Smartcrawl_Base_Controller {
43
  }
44
 
45
  $twitter_post_type_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-active-' . get_post_type( $post ) );
46
- $twitter_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-card-enable' );
47
  if ( $twitter_post_type_enabled && $twitter_setting_enabled ) {
48
  $sections['metabox/metabox-social-twitter'] = array(
49
  'post' => $post,
1
  <?php
2
 
3
  class Smartcrawl_Social_UI extends Smartcrawl_Base_Controller {
4
+
5
+ use Smartcrawl_Singleton;
 
 
 
 
6
 
7
  /**
8
+ * @return bool
9
  */
 
 
 
 
 
 
 
 
10
  public function should_run() {
11
+ return Smartcrawl_Settings::get_setting( 'social' ) && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL );
 
12
  }
13
 
14
+ /**
15
+ * @return mixed|void
16
+ */
17
  protected function init() {
18
  add_filter( 'wds-sections-metabox-social', array( $this, 'add_social_sections' ), 10, 2 );
19
  }
20
 
21
+ /**
22
+ * @param array $sections Sections.
23
+ * @param WP_Post $post Post object.
24
+ *
25
+ * @return array
26
+ */
27
  public function add_social_sections( $sections, $post = null ) {
28
  if ( empty( $post ) ) {
29
  return $sections;
30
  }
31
 
32
+ $all_options = Smartcrawl_Settings::get_options();
33
+ $og_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-enable' );
34
  $og_post_type_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-active-' . get_post_type( $post ) );
35
  if ( $og_setting_enabled && $og_post_type_enabled ) {
36
  $sections['metabox/metabox-social-opengraph'] = array(
39
  }
40
 
41
  $twitter_post_type_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-active-' . get_post_type( $post ) );
42
+ $twitter_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-card-enable' );
43
  if ( $twitter_post_type_enabled && $twitter_setting_enabled ) {
44
  $sections['metabox/metabox-social-twitter'] = array(
45
  'post' => $post,
includes/admin/metabox.php CHANGED
@@ -10,23 +10,23 @@
10
  */
11
  class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
12
 
13
- /**
14
- * Static instance
15
- *
16
- * @var Smartcrawl_Metabox
17
- */
18
- private static $_instance;
19
 
20
  /**
 
 
21
  * @var Smartcrawl_Post_Cache
22
  */
23
  private $post_cache;
 
24
  /**
 
 
25
  * @var Smartcrawl_Term_Cache
26
  */
27
  private $term_cache;
28
 
29
- public function __construct() {
30
  parent::__construct();
31
 
32
  $this->post_cache = Smartcrawl_Post_Cache::get();
@@ -34,8 +34,10 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
34
  }
35
 
36
  /**
37
- * @param $post_id
38
- * @param $input
 
 
39
  */
40
  public function save_opengraph_meta( $post_id, $input ) {
41
  $result = array();
@@ -65,8 +67,10 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
65
  }
66
 
67
  /**
68
- * @param $post_id
69
- * @param $input
 
 
70
  */
71
  public function save_twitter_post_meta( $post_id, $input ) {
72
  $twitter = array();
@@ -96,18 +100,20 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
96
  }
97
 
98
  /**
99
- * @param $post WP_Post
100
- * @param $request_data
 
 
101
  */
102
  public function save_robots_meta( $post, $request_data ) {
103
- $all_options = Smartcrawl_Settings::get_options();
104
- $post_type_noindexed = (bool) smartcrawl_get_array_value( $all_options, sprintf( 'meta_robots-noindex-%s', get_post_type( $post ) ) );
105
  $post_type_nofollowed = (bool) smartcrawl_get_array_value( $all_options, sprintf( 'meta_robots-nofollow-%s', get_post_type( $post ) ) );
106
  /**
107
  * If the user un-checks a checkbox and saves the post, the value for that checkbox will not be included inside $_POST array
108
  * so we may have to delete the corresponding meta value manually.
109
  */
110
- $checkbox_meta_items = array( 'wds_meta-robots-adv' );
111
  $checkbox_meta_items[] = $post_type_nofollowed ? 'wds_meta-robots-follow' : 'wds_meta-robots-nofollow';
112
  $checkbox_meta_items[] = $post_type_noindexed ? 'wds_meta-robots-index' : 'wds_meta-robots-noindex';
113
 
@@ -125,56 +131,77 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
125
  }
126
  }
127
 
 
 
 
 
 
 
128
  public function get_length_warnings( $title, $description ) {
129
  $warnings_markup = '';
130
 
131
- $title_length = mb_strlen( $title );
132
  $title_min_length = smartcrawl_title_min_length();
133
  if ( $title_length < $title_min_length ) {
134
- $warnings_markup .= Smartcrawl_Simple_Renderer::load( 'notice', array(
135
- 'message' => sprintf(
136
- esc_html__( 'Your title is %d characters in length. The recommended minimum length is %d characters so you may want to consider adding a few words.', 'wds' ),
137
- $title_length,
138
- $title_min_length
139
- ),
140
- ) );
 
 
 
141
  }
142
  $title_max_length = smartcrawl_title_max_length();
143
  if ( $title_length > $title_max_length ) {
144
- $warnings_markup .= Smartcrawl_Simple_Renderer::load( 'notice', array(
145
- 'message' => sprintf(
146
- esc_html__( 'Your title is %d characters in length. The recommended max length is %d characters so you may want to consider trimming a few words.', 'wds' ),
147
- $title_length,
148
- $title_max_length
149
- ),
150
- ) );
 
 
 
151
  }
152
 
153
- $desc_length = mb_strlen( $description );
154
  $desc_min_length = smartcrawl_metadesc_min_length();
155
  if ( $desc_length < $desc_min_length ) {
156
- $warnings_markup .= Smartcrawl_Simple_Renderer::load( 'notice', array(
157
- 'message' => sprintf(
158
- esc_html__( 'Your description is %d characters in length. The recommended minimum length is %d characters so you may want to consider adding a few words.', 'wds' ),
159
- $desc_length,
160
- $desc_min_length
161
- ),
162
- ) );
 
 
 
163
  }
164
  $desc_max_length = smartcrawl_metadesc_max_length();
165
  if ( $desc_length > $desc_max_length ) {
166
- $warnings_markup .= Smartcrawl_Simple_Renderer::load( 'notice', array(
167
- 'message' => sprintf(
168
- esc_html__( 'Your description is %d characters in length. The recommended max length is %d characters so you may want to consider trimming a few words.', 'wds' ),
169
- $desc_length,
170
- $desc_max_length
171
- ),
172
- ) );
 
 
 
173
  }
174
 
175
  return $warnings_markup;
176
  }
177
 
 
 
 
178
  protected function init() {
179
  // WPSC integration.
180
  add_action( 'wpsc_edit_product', array( $this, 'rebuild_sitemap' ) );
@@ -198,9 +225,9 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
198
  */
199
 
200
  /*
201
- * When running analysis in metabox, or rendering metabox preview,
202
  * always use overriding values passed in the request before values saved in the DB.
203
- *
204
  * This is done by filtering the metadata.
205
  */
206
  add_filter( 'get_post_metadata', array( $this, 'filter_meta_title' ), 10, 4 );
@@ -218,6 +245,9 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
218
  add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
219
  }
220
 
 
 
 
221
  public function init_post_columns() {
222
  foreach ( smartcrawl_frontend_post_types() as $type ) {
223
  add_filter( "manage_{$type}_posts_columns", array( $this, 'smartcrawl_meta_column_heading' ), 20 );
@@ -225,38 +255,41 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
225
  }
226
  }
227
 
 
 
 
 
 
 
228
  public function post_row_actions( $actions, $post ) {
229
  $onpage_active = Smartcrawl_Settings::get_setting( 'onpage' );
230
  if (
231
  $onpage_active
232
  && ! empty( $actions )
233
- && in_array( $post->post_type, smartcrawl_frontend_post_types() )
234
  ) {
235
- Smartcrawl_Simple_Renderer::render( 'post-list/meta-details', array(
236
- 'post' => $post,
237
- ) );
 
 
 
238
  }
239
 
240
  return $actions;
241
  }
242
 
 
 
 
 
 
243
  public function hide_robots_column_by_default( $hidden ) {
244
  $hidden[] = 'smartcrawl-robots';
245
 
246
  return $hidden;
247
  }
248
 
249
- /**
250
- * Static instance getter
251
- */
252
- public static function get() {
253
- if ( empty( self::$_instance ) ) {
254
- self::$_instance = new self();
255
- }
256
-
257
- return self::$_instance;
258
- }
259
-
260
  /**
261
  * Enqueues frontend dependencies
262
  */
@@ -284,14 +317,17 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
284
  }
285
 
286
  /**
287
- * Handles actual metabox rendering
288
  *
289
- * @param $post
290
  */
291
  public function smartcrawl_meta_boxes( $post ) {
292
- Smartcrawl_Simple_Renderer::render( 'metabox/metabox-main', array(
293
- 'post' => $post,
294
- ) );
 
 
 
295
  }
296
 
297
  /**
@@ -302,19 +338,28 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
302
  if ( function_exists( 'add_meta_box' ) ) {
303
  // Show branding for singular installs.
304
  $metabox_title = $this->get_metabox_title();
305
- $post_types = get_post_types( array(
306
- 'show_ui' => true, // Only if it actually supports WP UI.
307
- 'public' => true, // ... and is public
308
- ) );
 
 
309
  foreach ( $post_types as $posttype ) {
310
  if ( $this->is_private_post_type( $posttype ) ) {
311
  continue;
312
  }
313
  if ( $show ) {
314
- add_meta_box( 'wds-wds-meta-box', $metabox_title, array(
315
- &$this,
316
- 'smartcrawl_meta_boxes',
317
- ), $posttype, 'normal', 'high' );
 
 
 
 
 
 
 
318
  }
319
  }
320
  }
@@ -337,6 +382,9 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
337
  return $data;
338
  }
339
 
 
 
 
340
  private function get_post() {
341
  global $post;
342
 
@@ -408,7 +456,7 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
408
  continue;
409
  }
410
 
411
- $id = "_{$key}";
412
  $data = $value;
413
  if ( is_array( $value ) ) {
414
  $data = join( ',', $value );
@@ -427,13 +475,17 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
427
  $this->save_robots_meta( $post, $request_data );
428
 
429
  if ( ! isset( $request_data['wds_autolinks-exclude'] ) ) {
430
- delete_post_meta( $post_id, "_wds_autolinks-exclude" );
431
  }
432
 
433
- update_post_meta( $post->ID, '_wds_trimmed_excerpt', smartcrawl_get_trimmed_excerpt(
434
- $post->post_excerpt,
435
- $post->post_content
436
- ) );
 
 
 
 
437
 
438
  do_action( 'wds_saved_postdata' );
439
  }
@@ -453,12 +505,12 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
453
  * @return array
454
  */
455
  public function smartcrawl_meta_column_heading( $columns ) {
456
- $onpage_allowed = Smartcrawl_Settings::get_setting( Smartcrawl_Settings::COMP_ONPAGE )
457
- && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_ONPAGE );
458
 
459
  if ( $onpage_allowed ) {
460
  $columns['smartcrawl-robots'] = __( 'Robots Meta', 'wds' );
461
  }
 
462
  return $columns;
463
  }
464
 
@@ -466,7 +518,7 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
466
  * Puts out actual column bodies
467
  *
468
  * @param string $column_name Column ID.
469
- * @param int $id Post ID.
470
  *
471
  * @return void
472
  */
@@ -476,7 +528,7 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
476
  ( smartcrawl_get_value( 'meta-robots-noindex', $id ) ? 'noindex' : 'index' ),
477
  ( smartcrawl_get_value( 'meta-robots-nofollow', $id ) ? 'nofollow' : 'follow' ),
478
  );
479
- $meta_robots = join( ',', $meta_robots_arr );
480
  if ( empty( $meta_robots ) ) {
481
  $meta_robots = 'index,follow';
482
  }
@@ -485,7 +537,7 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
485
  // Show additional robots data.
486
  $advanced = array_filter( array_map( 'trim', explode( ',', smartcrawl_get_value( 'meta-robots-adv', $id ) ) ) );
487
  if ( ! empty( $advanced ) && 'none' !== $advanced ) {
488
- $adv_map = array(
489
  'noodp' => __( 'No ODP', 'wds' ),
490
  'noydir' => __( 'No YDIR', 'wds' ),
491
  'noarchive' => __( 'No Archive', 'wds' ),
@@ -510,7 +562,7 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
510
  * @param string $column Column ID.
511
  */
512
  public function smartcrawl_quick_edit_dispatch( $column ) {
513
- if ( $column === 'smartcrawl-robots' ) {
514
  Smartcrawl_Simple_Renderer::render( 'post-list/quick-edit-onpage', array() );
515
  }
516
  }
@@ -520,13 +572,17 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
520
  */
521
  public function json_wds_postmeta() {
522
  $data = $this->get_request_data();
523
- $id = (int) $data['id'];
524
- $post = get_post( $id );
525
- die( wp_json_encode( array(
526
- 'title' => smartcrawl_get_value( 'title', $id ),
527
- 'description' => smartcrawl_get_value( 'metadesc', $id ),
528
- 'focus' => smartcrawl_get_value( 'focus-keywords', $id ),
529
- ) ) );
 
 
 
 
530
  }
531
 
532
  /**
@@ -541,7 +597,7 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
541
  * @return array|string|null
542
  */
543
  public function filter_meta_title( $original, $post_id, $meta_key, $single ) {
544
- if ( $meta_key !== '_wds_title' ) {
545
  return $original;
546
  }
547
 
@@ -550,8 +606,16 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
550
  return $this->use_request_param_value( 'wds_title', $original, $single, $post );
551
  }
552
 
 
 
 
 
 
 
 
 
553
  public function filter_meta_desc( $original, $post_id, $meta_key, $single ) {
554
- if ( $meta_key !== '_wds_metadesc' ) {
555
  return $original;
556
  }
557
 
@@ -560,8 +624,16 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
560
  return $this->use_request_param_value( 'wds_description', $original, $single, $post );
561
  }
562
 
 
 
 
 
 
 
 
 
563
  public function filter_focus_keyword( $original, $post_id, $meta_key, $single ) {
564
- if ( $meta_key !== '_wds_focus-keywords' ) {
565
  return $original;
566
  }
567
 
@@ -570,12 +642,24 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
570
  return $this->use_request_param_value( 'wds_focus_keywords', $original, $single, $post );
571
  }
572
 
 
 
 
 
 
 
573
  public function filter_term_meta_title( $original, $term_id ) {
574
  $term = $this->term_cache->get_term( $term_id );
575
 
576
  return $this->use_request_param_value( 'wds_title', $original, true, $term );
577
  }
578
 
 
 
 
 
 
 
579
  public function filter_term_meta_desc( $original, $term_id ) {
580
  $term = $this->term_cache->get_term( $term_id );
581
 
@@ -612,18 +696,27 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
612
  }
613
  }
614
 
 
 
 
615
  private function get_request_data() {
616
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-metabox-nonce' ) ? stripslashes_deep( $_POST ) : array();
617
  }
618
 
 
 
 
 
 
619
  private function is_private_post_type( $post_type_name ) {
620
  $post_type = get_post_type_object( $post_type_name );
621
 
622
- return $post_type->name === 'attachment'
623
- || ! $post_type->show_ui
624
- || ! $post_type->public;
625
  }
626
 
 
 
 
627
  private function is_editing_private_post_type() {
628
  $current_screen = get_current_screen();
629
  if ( empty( $current_screen->post_type ) ) {
@@ -634,7 +727,7 @@ class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
634
  }
635
 
636
  /**
637
- * @return string|void
638
  */
639
  private function get_metabox_title() {
640
  return __( 'SmartCrawl', 'wds' );
10
  */
11
  class Smartcrawl_Metabox extends Smartcrawl_Base_Controller {
12
 
13
+ use Smartcrawl_Singleton;
 
 
 
 
 
14
 
15
  /**
16
+ * Post cache.
17
+ *
18
  * @var Smartcrawl_Post_Cache
19
  */
20
  private $post_cache;
21
+
22
  /**
23
+ * Term cache.
24
+ *
25
  * @var Smartcrawl_Term_Cache
26
  */
27
  private $term_cache;
28
 
29
+ protected function __construct() {
30
  parent::__construct();
31
 
32
  $this->post_cache = Smartcrawl_Post_Cache::get();
34
  }
35
 
36
  /**
37
+ * Save opengraph meta.
38
+ *
39
+ * @param int $post_id Post ID.
40
+ * @param array $input Input.
41
  */
42
  public function save_opengraph_meta( $post_id, $input ) {
43
  $result = array();
67
  }
68
 
69
  /**
70
+ * Save twitter meta.
71
+ *
72
+ * @param int $post_id Post ID.
73
+ * @param array $input Input.
74
  */
75
  public function save_twitter_post_meta( $post_id, $input ) {
76
  $twitter = array();
100
  }
101
 
102
  /**
103
+ * Save robots meta data.
104
+ *
105
+ * @param WP_Post $post Post object.
106
+ * @param array $request_data Request data.
107
  */
108
  public function save_robots_meta( $post, $request_data ) {
109
+ $all_options = Smartcrawl_Settings::get_options();
110
+ $post_type_noindexed = (bool) smartcrawl_get_array_value( $all_options, sprintf( 'meta_robots-noindex-%s', get_post_type( $post ) ) );
111
  $post_type_nofollowed = (bool) smartcrawl_get_array_value( $all_options, sprintf( 'meta_robots-nofollow-%s', get_post_type( $post ) ) );
112
  /**
113
  * If the user un-checks a checkbox and saves the post, the value for that checkbox will not be included inside $_POST array
114
  * so we may have to delete the corresponding meta value manually.
115
  */
116
+ $checkbox_meta_items = array( 'wds_meta-robots-adv' );
117
  $checkbox_meta_items[] = $post_type_nofollowed ? 'wds_meta-robots-follow' : 'wds_meta-robots-nofollow';
118
  $checkbox_meta_items[] = $post_type_noindexed ? 'wds_meta-robots-index' : 'wds_meta-robots-noindex';
119
 
131
  }
132
  }
133
 
134
+ /**
135
+ * @param $title
136
+ * @param $description
137
+ *
138
+ * @return string
139
+ */
140
  public function get_length_warnings( $title, $description ) {
141
  $warnings_markup = '';
142
 
143
+ $title_length = mb_strlen( $title );
144
  $title_min_length = smartcrawl_title_min_length();
145
  if ( $title_length < $title_min_length ) {
146
+ $warnings_markup .= Smartcrawl_Simple_Renderer::load(
147
+ 'notice',
148
+ array(
149
+ 'message' => sprintf(
150
+ esc_html__( 'Your title is %1$d characters in length. The recommended minimum length is %2$d characters so you may want to consider adding a few words.', 'wds' ),
151
+ $title_length,
152
+ $title_min_length
153
+ ),
154
+ )
155
+ );
156
  }
157
  $title_max_length = smartcrawl_title_max_length();
158
  if ( $title_length > $title_max_length ) {
159
+ $warnings_markup .= Smartcrawl_Simple_Renderer::load(
160
+ 'notice',
161
+ array(
162
+ 'message' => sprintf(
163
+ esc_html__( 'Your title is %1$d characters in length. The recommended max length is %2$d characters so you may want to consider trimming a few words.', 'wds' ),
164
+ $title_length,
165
+ $title_max_length
166
+ ),
167
+ )
168
+ );
169
  }
170
 
171
+ $desc_length = mb_strlen( $description );
172
  $desc_min_length = smartcrawl_metadesc_min_length();
173
  if ( $desc_length < $desc_min_length ) {
174
+ $warnings_markup .= Smartcrawl_Simple_Renderer::load(
175
+ 'notice',
176
+ array(
177
+ 'message' => sprintf(
178
+ esc_html__( 'Your description is %1$d characters in length. The recommended minimum length is %2$d characters so you may want to consider adding a few words.', 'wds' ),
179
+ $desc_length,
180
+ $desc_min_length
181
+ ),
182
+ )
183
+ );
184
  }
185
  $desc_max_length = smartcrawl_metadesc_max_length();
186
  if ( $desc_length > $desc_max_length ) {
187
+ $warnings_markup .= Smartcrawl_Simple_Renderer::load(
188
+ 'notice',
189
+ array(
190
+ 'message' => sprintf(
191
+ esc_html__( 'Your description is %1$d characters in length. The recommended max length is %2$d characters so you may want to consider trimming a few words.', 'wds' ),
192
+ $desc_length,
193
+ $desc_max_length
194
+ ),
195
+ )
196
+ );
197
  }
198
 
199
  return $warnings_markup;
200
  }
201
 
202
+ /**
203
+ * @return void
204
+ */
205
  protected function init() {
206
  // WPSC integration.
207
  add_action( 'wpsc_edit_product', array( $this, 'rebuild_sitemap' ) );
225
  */
226
 
227
  /*
228
+ * When running analysis in metabox, or rendering metabox preview,
229
  * always use overriding values passed in the request before values saved in the DB.
230
+ *
231
  * This is done by filtering the metadata.
232
  */
233
  add_filter( 'get_post_metadata', array( $this, 'filter_meta_title' ), 10, 4 );
245
  add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
246
  }
247
 
248
+ /**
249
+ * @return void
250
+ */
251
  public function init_post_columns() {
252
  foreach ( smartcrawl_frontend_post_types() as $type ) {
253
  add_filter( "manage_{$type}_posts_columns", array( $this, 'smartcrawl_meta_column_heading' ), 20 );
255
  }
256
  }
257
 
258
+ /**
259
+ * @param $actions
260
+ * @param $post
261
+ *
262
+ * @return array
263
+ */
264
  public function post_row_actions( $actions, $post ) {
265
  $onpage_active = Smartcrawl_Settings::get_setting( 'onpage' );
266
  if (
267
  $onpage_active
268
  && ! empty( $actions )
269
+ && in_array( $post->post_type, smartcrawl_frontend_post_types(), true )
270
  ) {
271
+ Smartcrawl_Simple_Renderer::render(
272
+ 'post-list/meta-details',
273
+ array(
274
+ 'post' => $post,
275
+ )
276
+ );
277
  }
278
 
279
  return $actions;
280
  }
281
 
282
+ /**
283
+ * @param $hidden
284
+ *
285
+ * @return array
286
+ */
287
  public function hide_robots_column_by_default( $hidden ) {
288
  $hidden[] = 'smartcrawl-robots';
289
 
290
  return $hidden;
291
  }
292
 
 
 
 
 
 
 
 
 
 
 
 
293
  /**
294
  * Enqueues frontend dependencies
295
  */
317
  }
318
 
319
  /**
320
+ * Handles actual metabox rendering.
321
  *
322
+ * @param WP_Post $post Post object.
323
  */
324
  public function smartcrawl_meta_boxes( $post ) {
325
+ Smartcrawl_Simple_Renderer::render(
326
+ 'metabox/metabox-main',
327
+ array(
328
+ 'post' => $post,
329
+ )
330
+ );
331
  }
332
 
333
  /**
338
  if ( function_exists( 'add_meta_box' ) ) {
339
  // Show branding for singular installs.
340
  $metabox_title = $this->get_metabox_title();
341
+ $post_types = get_post_types(
342
+ array(
343
+ 'show_ui' => true, // Only if it actually supports WP UI.
344
+ 'public' => true, // ... and is public.
345
+ )
346
+ );
347
  foreach ( $post_types as $posttype ) {
348
  if ( $this->is_private_post_type( $posttype ) ) {
349
  continue;
350
  }
351
  if ( $show ) {
352
+ add_meta_box(
353
+ 'wds-wds-meta-box',
354
+ $metabox_title,
355
+ array(
356
+ &$this,
357
+ 'smartcrawl_meta_boxes',
358
+ ),
359
+ $posttype,
360
+ 'normal',
361
+ 'high'
362
+ );
363
  }
364
  }
365
  }
382
  return $data;
383
  }
384
 
385
+ /**
386
+ * @return array|WP_Post|null
387
+ */
388
  private function get_post() {
389
  global $post;
390
 
456
  continue;
457
  }
458
 
459
+ $id = "_{$key}";
460
  $data = $value;
461
  if ( is_array( $value ) ) {
462
  $data = join( ',', $value );
475
  $this->save_robots_meta( $post, $request_data );
476
 
477
  if ( ! isset( $request_data['wds_autolinks-exclude'] ) ) {
478
+ delete_post_meta( $post_id, '_wds_autolinks-exclude' );
479
  }
480
 
481
+ update_post_meta(
482
+ $post->ID,
483
+ '_wds_trimmed_excerpt',
484
+ smartcrawl_get_trimmed_excerpt(
485
+ $post->post_excerpt,
486
+ $post->post_content
487
+ )
488
+ );
489
 
490
  do_action( 'wds_saved_postdata' );
491
  }
505
  * @return array
506
  */
507
  public function smartcrawl_meta_column_heading( $columns ) {
508
+ $onpage_allowed = Smartcrawl_Settings::get_setting( Smartcrawl_Settings::COMP_ONPAGE ) && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_ONPAGE );
 
509
 
510
  if ( $onpage_allowed ) {
511
  $columns['smartcrawl-robots'] = __( 'Robots Meta', 'wds' );
512
  }
513
+
514
  return $columns;
515
  }
516
 
518
  * Puts out actual column bodies
519
  *
520
  * @param string $column_name Column ID.
521
+ * @param int $id Post ID.
522
  *
523
  * @return void
524
  */
528
  ( smartcrawl_get_value( 'meta-robots-noindex', $id ) ? 'noindex' : 'index' ),
529
  ( smartcrawl_get_value( 'meta-robots-nofollow', $id ) ? 'nofollow' : 'follow' ),
530
  );
531
+ $meta_robots = join( ',', $meta_robots_arr );
532
  if ( empty( $meta_robots ) ) {
533
  $meta_robots = 'index,follow';
534
  }
537
  // Show additional robots data.
538
  $advanced = array_filter( array_map( 'trim', explode( ',', smartcrawl_get_value( 'meta-robots-adv', $id ) ) ) );
539
  if ( ! empty( $advanced ) && 'none' !== $advanced ) {
540
+ $adv_map = array(
541
  'noodp' => __( 'No ODP', 'wds' ),
542
  'noydir' => __( 'No YDIR', 'wds' ),
543
  'noarchive' => __( 'No Archive', 'wds' ),
562
  * @param string $column Column ID.
563
  */
564
  public function smartcrawl_quick_edit_dispatch( $column ) {
565
+ if ( 'smartcrawl-robots' === $column ) {
566
  Smartcrawl_Simple_Renderer::render( 'post-list/quick-edit-onpage', array() );
567
  }
568
  }
572
  */
573
  public function json_wds_postmeta() {
574
  $data = $this->get_request_data();
575
+ $id = (int) $data['id'];
576
+
577
+ die(
578
+ wp_json_encode(
579
+ array(
580
+ 'title' => smartcrawl_get_value( 'title', $id ),
581
+ 'description' => smartcrawl_get_value( 'metadesc', $id ),
582
+ 'focus' => smartcrawl_get_value( 'focus-keywords', $id ),
583
+ )
584
+ )
585
+ );
586
  }
587
 
588
  /**
597
  * @return array|string|null
598
  */
599
  public function filter_meta_title( $original, $post_id, $meta_key, $single ) {
600
+ if ( '_wds_title' !== $meta_key ) {
601
  return $original;
602
  }
603
 
606
  return $this->use_request_param_value( 'wds_title', $original, $single, $post );
607
  }
608
 
609
+ /**
610
+ * @param $original
611
+ * @param $post_id
612
+ * @param $meta_key
613
+ * @param $single
614
+ *
615
+ * @return array|string|string[]|null
616
+ */
617
  public function filter_meta_desc( $original, $post_id, $meta_key, $single ) {
618
+ if ( '_wds_metadesc' !== $meta_key ) {
619
  return $original;
620
  }
621
 
624
  return $this->use_request_param_value( 'wds_description', $original, $single, $post );
625
  }
626
 
627
+ /**
628
+ * @param $original
629
+ * @param $post_id
630
+ * @param $meta_key
631
+ * @param $single
632
+ *
633
+ * @return array|string|string[]|null
634
+ */
635
  public function filter_focus_keyword( $original, $post_id, $meta_key, $single ) {
636
+ if ( '_wds_focus-keywords' !== $meta_key ) {
637
  return $original;
638
  }
639
 
642
  return $this->use_request_param_value( 'wds_focus_keywords', $original, $single, $post );
643
  }
644
 
645
+ /**
646
+ * @param $original
647
+ * @param $term_id
648
+ *
649
+ * @return array|string|string[]|null
650
+ */
651
  public function filter_term_meta_title( $original, $term_id ) {
652
  $term = $this->term_cache->get_term( $term_id );
653
 
654
  return $this->use_request_param_value( 'wds_title', $original, true, $term );
655
  }
656
 
657
+ /**
658
+ * @param $original
659
+ * @param $term_id
660
+ *
661
+ * @return array|string|string[]|null
662
+ */
663
  public function filter_term_meta_desc( $original, $term_id ) {
664
  $term = $this->term_cache->get_term( $term_id );
665
 
696
  }
697
  }
698
 
699
+ /**
700
+ * @return array|mixed
701
+ */
702
  private function get_request_data() {
703
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wds_nonce'] ), 'wds-metabox-nonce' ) ? stripslashes_deep( $_POST ) : array(); // phpcs:ignore
704
  }
705
 
706
+ /**
707
+ * @param $post_type_name
708
+ *
709
+ * @return bool
710
+ */
711
  private function is_private_post_type( $post_type_name ) {
712
  $post_type = get_post_type_object( $post_type_name );
713
 
714
+ return 'attachment' === $post_type->name || ! $post_type->show_ui || ! $post_type->public;
 
 
715
  }
716
 
717
+ /**
718
+ * @return bool
719
+ */
720
  private function is_editing_private_post_type() {
721
  $current_screen = get_current_screen();
722
  if ( empty( $current_screen->post_type ) ) {
727
  }
728
 
729
  /**
730
+ * @return string
731
  */
732
  private function get_metabox_title() {
733
  return __( 'SmartCrawl', 'wds' );
includes/admin/settings.php CHANGED
@@ -101,11 +101,19 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
101
  add_action( 'admin_menu', array( $this, 'add_page' ) );
102
  }
103
 
 
 
 
 
 
104
  private function is_current_screen() {
105
  $screen = get_current_screen();
106
- return ! empty( $screen->id )
107
- && ! empty( $this->smartcrawl_page_hook )
108
- && strpos( $screen->id, $this->smartcrawl_page_hook ) === 0;
 
 
 
109
  }
110
 
111
  /**
@@ -134,8 +142,8 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
134
  * Add sub page to the Settings Menu
135
  */
136
  public function add_page() {
137
- if ( ! $this->_is_current_tab_allowed() ) {
138
- return false;
139
  }
140
 
141
  $this->smartcrawl_page_hook = add_submenu_page(
@@ -155,6 +163,11 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
155
  add_action( "admin_print_styles-{$this->smartcrawl_page_hook}", array( $this, 'admin_styles' ) );
156
  }
157
 
 
 
 
 
 
158
  abstract public function get_title();
159
 
160
  /**
@@ -162,10 +175,8 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
162
  *
163
  * @return bool
164
  */
165
- protected function _is_current_tab_allowed() {
166
- return ! empty( $this->slug )
167
- ? self::is_tab_allowed( $this->slug )
168
- : false;
169
  }
170
 
171
  /**
@@ -178,36 +189,37 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
178
  * @return bool
179
  */
180
  public static function is_tab_allowed( $tab ) {
181
- // On single installs, everything is good
182
  if ( ! is_multisite() ) {
183
  return true;
184
  }
185
 
186
- // SEO health not supported on sub-sites
187
- if ( $tab === self::TAB_HEALTH ) {
188
  return is_main_site();
189
  }
190
 
191
- // Dashboard shown on all sub-sites
192
- if ( $tab === self::TAB_DASHBOARD ) {
193
  return true;
194
  }
195
 
196
- // Check whether the tab is blocked on network level
197
  $allowed = Smartcrawl_Settings_Settings::get_blog_tabs();
198
  $allowed = empty( $allowed ) ? array() : $allowed;
 
199
  return in_array( $tab, array_keys( $allowed ), true ) && ! empty( $allowed[ $tab ] );
200
  }
201
 
202
  /**
203
- * Enqueue styles
204
  */
205
  public function admin_styles() {
206
  wp_enqueue_style( Smartcrawl_Controller_Assets::APP_CSS );
207
  }
208
 
209
  /**
210
- * Display the admin options page
211
  */
212
  public function options_page() {
213
  // phpcs:disable -- $_GET values need to be used without nonces
@@ -261,7 +273,7 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
261
 
262
  $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
263
  if ( $service->is_member() ) {
264
- $classes .= " wds-is-member";
265
  }
266
  }
267
 
@@ -274,20 +286,27 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
274
  * As a side-effect, also calls `WDEV_Plugin_Ui::output()`
275
  *
276
  * @param string $view View file to load.
277
- * @param array $args Optional array of arguments to pass to view.
278
  *
279
  * @return bool
280
  */
281
- protected function _render_page( $view, $args = array() ) {
282
- $this->_render( $view, $args );
283
 
284
  return true;
285
  }
286
 
 
 
 
 
 
 
 
287
  protected function settings_fields( $option_group ) {
288
  echo "<input type='hidden' name='option_page' value='" . esc_attr( $option_group ) . "' />";
289
  echo '<input type="hidden" name="action" value="update" />';
290
- wp_nonce_field( "$option_group-options", "_wpnonce", false );
291
  }
292
 
293
  /**
@@ -295,9 +314,9 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
295
  *
296
  * @return array Defaults
297
  */
298
- protected function _get_view_defaults() {
299
- $errors = get_transient( 'wds-settings-save-errors' );
300
- $errors = ! empty( $errors ) ? $errors : array();
301
  $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
302
 
303
  return array(
@@ -321,9 +340,7 @@ abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
321
  *
322
  * @return string The last active tab.
323
  */
324
- protected function _get_active_tab( $default = '' ) {
325
- return empty( $_GET['tab'] )
326
- ? $default
327
- : $_GET['tab'];
328
  }
329
  }
101
  add_action( 'admin_menu', array( $this, 'add_page' ) );
102
  }
103
 
104
+ /**
105
+ * Is current screen SmartCrawl.
106
+ *
107
+ * @return bool
108
+ */
109
  private function is_current_screen() {
110
  $screen = get_current_screen();
111
+
112
+ return (
113
+ ! empty( $screen->id ) &&
114
+ ! empty( $this->smartcrawl_page_hook ) &&
115
+ strpos( $screen->id, $this->smartcrawl_page_hook ) === 0
116
+ );
117
  }
118
 
119
  /**
142
  * Add sub page to the Settings Menu
143
  */
144
  public function add_page() {
145
+ if ( ! $this->is_current_tab_allowed() ) {
146
+ return;
147
  }
148
 
149
  $this->smartcrawl_page_hook = add_submenu_page(
163
  add_action( "admin_print_styles-{$this->smartcrawl_page_hook}", array( $this, 'admin_styles' ) );
164
  }
165
 
166
+ /**
167
+ * Get title.
168
+ *
169
+ * @return mixed
170
+ */
171
  abstract public function get_title();
172
 
173
  /**
175
  *
176
  * @return bool
177
  */
178
+ protected function is_current_tab_allowed() {
179
+ return ! empty( $this->slug ) && self::is_tab_allowed( $this->slug );
 
 
180
  }
181
 
182
  /**
189
  * @return bool
190
  */
191
  public static function is_tab_allowed( $tab ) {
192
+ // On single installs, everything is good.
193
  if ( ! is_multisite() ) {
194
  return true;
195
  }
196
 
197
+ // SEO health not supported on sub-sites.
198
+ if ( self::TAB_HEALTH === $tab ) {
199
  return is_main_site();
200
  }
201
 
202
+ // Dashboard shown on all sub-sites.
203
+ if ( self::TAB_DASHBOARD === $tab ) {
204
  return true;
205
  }
206
 
207
+ // Check whether the tab is blocked on network level.
208
  $allowed = Smartcrawl_Settings_Settings::get_blog_tabs();
209
  $allowed = empty( $allowed ) ? array() : $allowed;
210
+
211
  return in_array( $tab, array_keys( $allowed ), true ) && ! empty( $allowed[ $tab ] );
212
  }
213
 
214
  /**
215
+ * Enqueue styles.
216
  */
217
  public function admin_styles() {
218
  wp_enqueue_style( Smartcrawl_Controller_Assets::APP_CSS );
219
  }
220
 
221
  /**
222
+ * Display the admin options page.
223
  */
224
  public function options_page() {
225
  // phpcs:disable -- $_GET values need to be used without nonces
273
 
274
  $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
275
  if ( $service->is_member() ) {
276
+ $classes .= ' wds-is-member';
277
  }
278
  }
279
 
286
  * As a side-effect, also calls `WDEV_Plugin_Ui::output()`
287
  *
288
  * @param string $view View file to load.
289
+ * @param array $args Optional array of arguments to pass to view.
290
  *
291
  * @return bool
292
  */
293
+ protected function render_page( $view, $args = array() ) {
294
+ $this->render_view( $view, $args );
295
 
296
  return true;
297
  }
298
 
299
+ /**
300
+ * Render settings fields.
301
+ *
302
+ * @param string $option_group Option group.
303
+ *
304
+ * @return void
305
+ */
306
  protected function settings_fields( $option_group ) {
307
  echo "<input type='hidden' name='option_page' value='" . esc_attr( $option_group ) . "' />";
308
  echo '<input type="hidden" name="action" value="update" />';
309
+ wp_nonce_field( "$option_group-options", '_wpnonce', false );
310
  }
311
 
312
  /**
314
  *
315
  * @return array Defaults
316
  */
317
+ protected function get_view_defaults() {
318
+ $errors = get_transient( 'wds-settings-save-errors' );
319
+ $errors = ! empty( $errors ) ? $errors : array();
320
  $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
321
 
322
  return array(
340
  *
341
  * @return string The last active tab.
342
  */
343
+ protected function get_active_tab( $default = '' ) {
344
+ return empty( $_GET['tab'] ) ? $default : esc_html( $_GET['tab'] ); // phpcs:ignore
 
 
345
  }
346
  }
includes/admin/settings/autolinks.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Autolinks module settings
4
  *
5
- * @package wpmu-dev-seo
6
  */
7
 
8
  /**
@@ -10,25 +10,7 @@
10
  */
11
  class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
12
 
13
- /**
14
- * Holds singleton instance
15
- *
16
- * @var Smartcrawl_Autolinks_Settings
17
- */
18
- private static $_instance;
19
-
20
- /**
21
- * Singleton instance getter
22
- *
23
- * @return Smartcrawl_Autolinks_Settings instance
24
- */
25
- public static function get_instance() {
26
- if ( empty( self::$_instance ) ) {
27
- self::$_instance = new self();
28
- }
29
-
30
- return self::$_instance;
31
- }
32
 
33
  /**
34
  * Validate submitted options
@@ -38,7 +20,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
38
  * @return array Validated input
39
  */
40
  public function validate( $input ) {
41
- // Start with old values for all the options
42
  $result = self::get_specific_options( $this->option_name );
43
 
44
  $save_woo = smartcrawl_get_array_value( $input, 'save_woo' );
@@ -47,13 +29,14 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
47
  if ( $woo_input ) {
48
  $woo_data = new Smartcrawl_Woocommerce_Data();
49
  $woo_data->save_data( json_decode( $woo_input, true ) );
 
50
  return $result;
51
  }
52
  }
53
 
54
  $save_redirects = isset( $input['save_redirects'] ) && $input['save_redirects'];
55
  if ( $save_redirects ) {
56
- $result['redirect-attachments'] = ! empty( $input['redirect-attachments'] );
57
  $result['redirect-attachments-images_only'] = ! empty( $input['redirect-attachments-images_only'] );
58
 
59
  if ( isset( $input['redirections-code'] ) ) {
@@ -65,6 +48,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
65
 
66
  if ( ! empty( $input['save_robots'] ) ) {
67
  $this->validate_and_save_robots_options( $input );
 
68
  return $result;
69
  }
70
 
@@ -95,15 +79,15 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
95
  // Boolean Arrays.
96
  $post_type_names = array_keys( self::get_post_types() );
97
  foreach ( array_merge( $post_type_names, array( 'comment' ) ) as $post_type ) {
98
- $result[ $post_type ] = (boolean) smartcrawl_get_array_value( $input, $post_type );
99
  }
100
  foreach ( $post_type_names as $post_type ) {
101
- $result["l{$post_type}"] = (boolean) smartcrawl_get_array_value( $input, "l{$post_type}" );
102
  }
103
  foreach ( get_taxonomies() as $taxonomy ) {
104
- $tax = get_taxonomy( $taxonomy );
105
- $key = strtolower( $tax->labels->name );
106
- $result["l{$key}"] = (boolean) smartcrawl_get_array_value( $input, "l{$key}" );
107
  }
108
 
109
  // Numerics.
@@ -138,14 +122,14 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
138
 
139
  // Custom keywords, they need newlines.
140
  if ( isset( $input['customkey'] ) ) {
141
- $str = wp_check_invalid_utf8( $input['customkey'] );
142
- $str = wp_pre_kses_less_than( $str );
143
- $str = wp_strip_all_tags( $str );
144
  $result['customkey'] = $str;
145
 
146
  $found = false;
147
  while ( preg_match( '/%[a-f0-9]{2}/i', $str, $match ) ) {
148
- $str = str_replace( $match[0], '', $str );
149
  $found = true;
150
  }
151
  if ( $found ) {
@@ -163,30 +147,35 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
163
  * @param array $input Raw input.
164
  */
165
  private function validate_and_save_redirection_options( $input ) {
166
- $settings = Smartcrawl_Settings::get_specific_options( 'wds_settings_options' );
167
  $settings['redirections-code'] = (int) $input['redirections-code'];
168
  Smartcrawl_Settings::update_specific_options( 'wds_settings_options', $settings );
169
  }
170
 
 
 
 
 
 
 
 
171
  private function validate_and_save_robots_options( $input ) {
172
  $robots_options = Smartcrawl_Settings::get_specific_options( 'wds_robots_options' );
173
 
174
  $robots_options['sitemap_directive_disabled'] = ! empty( $input['sitemap_directive_disabled'] );
175
- $robots_options['custom_sitemap_url'] = esc_url_raw( $input['custom_sitemap_url'] );
176
- $robots_options['custom_directives'] = sanitize_textarea_field( $input['custom_directives'] );
177
 
178
  Smartcrawl_Settings::update_specific_options( 'wds_robots_options', $robots_options );
179
  }
180
 
181
  /**
182
- * Gets site service instance
183
  *
184
  * @return object
185
  */
186
  private function get_site_service() {
187
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
188
-
189
- return $service;
190
  }
191
 
192
  /**
@@ -203,9 +192,10 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
203
  'nav_menu_item',
204
  'attachment',
205
  );
206
- $raw = get_post_types( array(
207
- 'public' => true,
208
- ), 'objects' );
 
209
  foreach ( $raw as $pt => $pto ) {
210
  if ( in_array( $pt, $exclusions, true ) ) {
211
  continue;
@@ -220,20 +210,17 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
220
  }
221
 
222
  /**
223
- * Initializes the admin pane
224
  */
225
  public function init() {
226
  $this->option_name = 'wds_autolinks_options';
227
- $this->name = Smartcrawl_Settings::COMP_AUTOLINKS;
228
- $this->slug = Smartcrawl_Settings::TAB_AUTOLINKS;
229
- $this->action_url = admin_url( 'options.php' );
230
- $this->page_title = __( 'SmartCrawl Wizard: Advanced Tools', 'wds' );
231
 
232
  add_action( 'wp_ajax_wds-load_exclusion-post_data', array( $this, 'json_load_post' ) );
233
- add_action( 'wp_ajax_wds-load_exclusion_posts-posts_data-specific', array(
234
- $this,
235
- 'json_load_posts_specific',
236
- ) );
237
  add_action( 'wp_ajax_wds-load_exclusion_posts-posts_data-paged', array( $this, 'json_load_posts_paged' ) );
238
  add_action( 'admin_init', array( $this, 'reset_moz_api_credentials' ) );
239
  add_action( 'admin_init', array( $this, 'deactivate_components' ) );
@@ -241,20 +228,25 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
241
  parent::init();
242
  }
243
 
 
 
 
 
 
244
  public function get_title() {
245
  return __( 'Advanced Tools', 'wds' );
246
  }
247
 
248
  /**
249
- * Resets Moz API creds
250
  *
251
  * TODO: probably need to move this to the same location as save_moz_api_credentials
252
  */
253
  public function reset_moz_api_credentials() {
254
  $post_data = $this->get_request_data();
255
  if ( isset( $post_data['reset-moz-credentials'] ) ) { // Just a presence flag.
256
- $options = self::get_specific_options( 'wds_settings_options' );
257
- $options['access-id'] = '';
258
  $options['secret-key'] = '';
259
  self::update_specific_options( 'wds_settings_options', $options );
260
 
@@ -263,8 +255,13 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
263
  }
264
  }
265
 
 
 
 
 
 
266
  public function deactivate_components() {
267
- $data = isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], $this->option_name . '-options' )
268
  ? stripslashes_deep( $_POST )
269
  : array();
270
 
@@ -289,7 +286,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
289
  */
290
  public function json_load_post() {
291
  $post_data = $this->get_request_data();
292
- $result = array(
293
  'id' => 0,
294
  'title' => '',
295
  'type' => '',
@@ -310,7 +307,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
310
  wp_send_json( $result );
311
  }
312
 
313
- wp_send_json( $this->_post_to_response_data( $post ) );
314
  }
315
 
316
  /**
@@ -320,7 +317,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
320
  *
321
  * @return array Post response hash
322
  */
323
- private function _post_to_response_data( $post ) {
324
  $result = array(
325
  'id' => 0,
326
  'title' => '',
@@ -336,11 +333,11 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
336
  $date_format = get_option( 'date_format' );
337
  }
338
 
339
- $post_id = $post->ID;
340
- $result['id'] = $post_id;
341
  $result['title'] = get_the_title( $post_id );
342
- $result['type'] = get_post_type( $post_id );
343
- $result['date'] = get_post_time( $date_format, false, $post_id );
344
 
345
  return $result;
346
  }
@@ -352,7 +349,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
352
  */
353
  public function json_load_posts_specific() {
354
  $post_data = $this->get_request_data();
355
- $result = array(
356
  'meta' => array(),
357
  'posts' => array(),
358
  );
@@ -384,7 +381,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
384
  );
385
 
386
  foreach ( $query->posts as $post ) {
387
- $result['posts'][] = $this->_post_to_response_data( $post );
388
  }
389
 
390
  wp_send_json_success( $result );
@@ -396,8 +393,8 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
396
  * Outputs AJAX response
397
  */
398
  public function json_load_posts_paged() {
399
- $request_data = isset( $_GET['_wds_nonce'] ) && wp_verify_nonce( $_GET['_wds_nonce'], 'wds-autolinks-nonce' ) ? $_GET : array();
400
- $result = array(
401
  'meta' => array(),
402
  'posts' => array(),
403
  );
@@ -418,7 +415,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
418
  }
419
  if ( ! empty( $request_data['page'] ) && is_numeric( $request_data['page'] ) ) {
420
  $args['paged'] = (int) $request_data['page'];
421
- $page = $args['paged'];
422
  }
423
 
424
  $query = new WP_Query( $args );
@@ -429,7 +426,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
429
  );
430
 
431
  foreach ( $query->posts as $post ) {
432
- $result['posts'][] = $this->_post_to_response_data( $post );
433
  }
434
 
435
  wp_send_json( $result );
@@ -445,14 +442,14 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
445
  $arguments['linkto'] = $this->get_linkto_keys();
446
  $arguments['insert'] = $this->get_insert_keys();
447
 
448
- $arguments['active_tab'] = $this->_get_active_tab( 'tab_automatic_linking' );
449
 
450
  wp_enqueue_script( Smartcrawl_Controller_Assets::AUTOLINKS_PAGE_JS );
451
 
452
- $arguments['already_exists'] = Smartcrawl_Controller_Robots::get()->file_exists();
453
  $arguments['rootdir_install'] = Smartcrawl_Controller_Robots::get()->is_rootdir_install();
454
 
455
- $this->_render_page( 'advanced-tools/advanced-tools-settings', $arguments );
456
  }
457
 
458
  /**
@@ -493,55 +490,79 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
493
  }
494
 
495
  /**
 
 
496
  * @return array
497
  */
498
  private function get_request_data() {
499
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-autolinks-nonce' ) ? $_POST : array();
 
 
500
  }
501
 
 
 
 
 
 
502
  public function get_insert_options() {
503
  $options = Smartcrawl_Settings::get_component_options( self::COMP_AUTOLINKS );
504
- $result = array();
505
  foreach ( $this->get_insert_keys() as $key => $label ) {
506
  $result[ $key ] = array(
507
  'label' => $label,
508
- 'value' => empty( $options[ $key ] ) ? false : true,
509
  );
510
  }
511
 
512
  return $result;
513
  }
514
 
 
 
 
 
 
515
  private function get_insert_keys() {
516
  foreach ( self::get_post_types() as $post_type => $pt ) {
517
  $key = strtolower( $pt->name );
518
 
519
- $insert["{$key}"] = $pt->labels->name;
520
  }
521
  $insert['comment'] = __( 'Comments', 'wds' );
522
 
523
  return $insert;
524
  }
525
 
 
 
 
 
 
526
  public function get_linkto_options() {
527
  $options = Smartcrawl_Settings::get_component_options( self::COMP_AUTOLINKS );
528
- $result = array();
529
 
530
  foreach ( $this->get_linkto_keys() as $key => $label ) {
531
  $result[ $key ] = array(
532
  'label' => $label,
533
- 'value' => empty( $options[ $key ] ) ? false : true,
534
  );
535
  }
536
 
537
  return $result;
538
  }
539
 
 
 
 
 
 
540
  private function get_linkto_keys() {
541
  $post_types = array();
542
  foreach ( self::get_post_types() as $post_type => $pt ) {
543
- $key = strtolower( $pt->name );
544
- $post_types["l{$key}"] = $pt->labels->name;
545
  }
546
 
547
  $taxonomies = array();
@@ -550,7 +571,7 @@ class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
550
  $tax = get_taxonomy( $taxonomy );
551
  $key = strtolower( $tax->labels->name );
552
 
553
- $taxonomies["l{$key}"] = $tax->labels->name;
554
  }
555
  }
556
 
2
  /**
3
  * Autolinks module settings
4
  *
5
+ * @package Smartcrawl
6
  */
7
 
8
  /**
10
  */
11
  class Smartcrawl_Autolinks_Settings extends Smartcrawl_Settings_Admin {
12
 
13
+ use Smartcrawl_Singleton;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  /**
16
  * Validate submitted options
20
  * @return array Validated input
21
  */
22
  public function validate( $input ) {
23
+ // Start with old values for all the options.
24
  $result = self::get_specific_options( $this->option_name );
25
 
26
  $save_woo = smartcrawl_get_array_value( $input, 'save_woo' );
29
  if ( $woo_input ) {
30
  $woo_data = new Smartcrawl_Woocommerce_Data();
31
  $woo_data->save_data( json_decode( $woo_input, true ) );
32
+
33
  return $result;
34
  }
35
  }
36
 
37
  $save_redirects = isset( $input['save_redirects'] ) && $input['save_redirects'];
38
  if ( $save_redirects ) {
39
+ $result['redirect-attachments'] = ! empty( $input['redirect-attachments'] );
40
  $result['redirect-attachments-images_only'] = ! empty( $input['redirect-attachments-images_only'] );
41
 
42
  if ( isset( $input['redirections-code'] ) ) {
48
 
49
  if ( ! empty( $input['save_robots'] ) ) {
50
  $this->validate_and_save_robots_options( $input );
51
+
52
  return $result;
53
  }
54
 
79
  // Boolean Arrays.
80
  $post_type_names = array_keys( self::get_post_types() );
81
  foreach ( array_merge( $post_type_names, array( 'comment' ) ) as $post_type ) {
82
+ $result[ $post_type ] = (bool) smartcrawl_get_array_value( $input, $post_type );
83
  }
84
  foreach ( $post_type_names as $post_type ) {
85
+ $result[ 'l' . $post_type ] = (bool) smartcrawl_get_array_value( $input, "l{$post_type}" );
86
  }
87
  foreach ( get_taxonomies() as $taxonomy ) {
88
+ $tax = get_taxonomy( $taxonomy );
89
+ $key = strtolower( $tax->labels->name );
90
+ $result[ 'l' . $key ] = (bool) smartcrawl_get_array_value( $input, "l{$key}" );
91
  }
92
 
93
  // Numerics.
122
 
123
  // Custom keywords, they need newlines.
124
  if ( isset( $input['customkey'] ) ) {
125
+ $str = wp_check_invalid_utf8( $input['customkey'] );
126
+ $str = wp_pre_kses_less_than( $str );
127
+ $str = wp_strip_all_tags( $str );
128
  $result['customkey'] = $str;
129
 
130
  $found = false;
131
  while ( preg_match( '/%[a-f0-9]{2}/i', $str, $match ) ) {
132
+ $str = str_replace( $match[0], '', $str );
133
  $found = true;
134
  }
135
  if ( $found ) {
147
  * @param array $input Raw input.
148
  */
149
  private function validate_and_save_redirection_options( $input ) {
150
+ $settings = Smartcrawl_Settings::get_specific_options( 'wds_settings_options' );
151
  $settings['redirections-code'] = (int) $input['redirections-code'];
152
  Smartcrawl_Settings::update_specific_options( 'wds_settings_options', $settings );
153
  }
154
 
155
+ /**
156
+ * Validate and save robots options.
157
+ *
158
+ * @param array $input Input.
159
+ *
160
+ * @return void
161
+ */
162
  private function validate_and_save_robots_options( $input ) {
163
  $robots_options = Smartcrawl_Settings::get_specific_options( 'wds_robots_options' );
164
 
165
  $robots_options['sitemap_directive_disabled'] = ! empty( $input['sitemap_directive_disabled'] );
166
+ $robots_options['custom_sitemap_url'] = esc_url_raw( $input['custom_sitemap_url'] );
167
+ $robots_options['custom_directives'] = sanitize_textarea_field( $input['custom_directives'] );
168
 
169
  Smartcrawl_Settings::update_specific_options( 'wds_robots_options', $robots_options );
170
  }
171
 
172
  /**
173
+ * Gets site service instance.
174
  *
175
  * @return object
176
  */
177
  private function get_site_service() {
178
+ return Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
 
 
179
  }
180
 
181
  /**
192
  'nav_menu_item',
193
  'attachment',
194
  );
195
+ $raw = get_post_types(
196
+ array( 'public' => true ),
197
+ 'objects'
198
+ );
199
  foreach ( $raw as $pt => $pto ) {
200
  if ( in_array( $pt, $exclusions, true ) ) {
201
  continue;
210
  }
211
 
212
  /**
213
+ * Initializes the admin pane.
214
  */
215
  public function init() {
216
  $this->option_name = 'wds_autolinks_options';
217
+ $this->name = Smartcrawl_Settings::COMP_AUTOLINKS;
218
+ $this->slug = Smartcrawl_Settings::TAB_AUTOLINKS;
219
+ $this->action_url = admin_url( 'options.php' );
220
+ $this->page_title = __( 'SmartCrawl Wizard: Advanced Tools', 'wds' );
221
 
222
  add_action( 'wp_ajax_wds-load_exclusion-post_data', array( $this, 'json_load_post' ) );
223
+ add_action( 'wp_ajax_wds-load_exclusion_posts-posts_data-specific', array( $this, 'json_load_posts_specific' ) );
 
 
 
224
  add_action( 'wp_ajax_wds-load_exclusion_posts-posts_data-paged', array( $this, 'json_load_posts_paged' ) );
225
  add_action( 'admin_init', array( $this, 'reset_moz_api_credentials' ) );
226
  add_action( 'admin_init', array( $this, 'deactivate_components' ) );
228
  parent::init();
229
  }
230
 
231
+ /**
232
+ * Get the title.
233
+ *
234
+ * @return string
235
+ */
236
  public function get_title() {
237
  return __( 'Advanced Tools', 'wds' );
238
  }
239
 
240
  /**
241
+ * Resets Moz API creds.
242
  *
243
  * TODO: probably need to move this to the same location as save_moz_api_credentials
244
  */
245
  public function reset_moz_api_credentials() {
246
  $post_data = $this->get_request_data();
247
  if ( isset( $post_data['reset-moz-credentials'] ) ) { // Just a presence flag.
248
+ $options = self::get_specific_options( 'wds_settings_options' );
249
+ $options['access-id'] = '';
250
  $options['secret-key'] = '';
251
  self::update_specific_options( 'wds_settings_options', $options );
252
 
255
  }
256
  }
257
 
258
+ /**
259
+ * Deactivate components.
260
+ *
261
+ * @return void
262
+ */
263
  public function deactivate_components() {
264
+ $data = isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], $this->option_name . '-options' ) // phpcs:ignore
265
  ? stripslashes_deep( $_POST )
266
  : array();
267
 
286
  */
287
  public function json_load_post() {
288
  $post_data = $this->get_request_data();
289
+ $result = array(
290
  'id' => 0,
291
  'title' => '',
292
  'type' => '',
307
  wp_send_json( $result );
308
  }
309
 
310
+ wp_send_json( $this->post_to_response_data( $post ) );
311
  }
312
 
313
  /**
317
  *
318
  * @return array Post response hash
319
  */
320
+ private function post_to_response_data( $post ) {
321
  $result = array(
322
  'id' => 0,
323
  'title' => '',
333
  $date_format = get_option( 'date_format' );
334
  }
335
 
336
+ $post_id = $post->ID;
337
+ $result['id'] = $post_id;
338
  $result['title'] = get_the_title( $post_id );
339
+ $result['type'] = get_post_type( $post_id );
340
+ $result['date'] = get_post_time( $date_format, false, $post_id );
341
 
342
  return $result;
343
  }
349
  */
350
  public function json_load_posts_specific() {
351
  $post_data = $this->get_request_data();
352
+ $result = array(
353
  'meta' => array(),
354
  'posts' => array(),
355
  );
381
  );
382
 
383
  foreach ( $query->posts as $post ) {
384
+ $result['posts'][] = $this->post_to_response_data( $post );
385
  }
386
 
387
  wp_send_json_success( $result );
393
  * Outputs AJAX response
394
  */
395
  public function json_load_posts_paged() {
396
+ $request_data = isset( $_GET['_wds_nonce'] ) && wp_verify_nonce( $_GET['_wds_nonce'], 'wds-autolinks-nonce' ) ? $_GET : array(); // phpcs:ignore
397
+ $result = array(
398
  'meta' => array(),
399
  'posts' => array(),
400
  );
415
  }
416
  if ( ! empty( $request_data['page'] ) && is_numeric( $request_data['page'] ) ) {
417
  $args['paged'] = (int) $request_data['page'];
418
+ $page = $args['paged'];
419
  }
420
 
421
  $query = new WP_Query( $args );
426
  );
427
 
428
  foreach ( $query->posts as $post ) {
429
+ $result['posts'][] = $this->post_to_response_data( $post );
430
  }
431
 
432
  wp_send_json( $result );
442
  $arguments['linkto'] = $this->get_linkto_keys();
443
  $arguments['insert'] = $this->get_insert_keys();
444
 
445
+ $arguments['active_tab'] = $this->get_active_tab( 'tab_automatic_linking' );
446
 
447
  wp_enqueue_script( Smartcrawl_Controller_Assets::AUTOLINKS_PAGE_JS );
448
 
449
+ $arguments['already_exists'] = Smartcrawl_Controller_Robots::get()->file_exists();
450
  $arguments['rootdir_install'] = Smartcrawl_Controller_Robots::get()->is_rootdir_install();
451
 
452
+ $this->render_page( 'advanced-tools/advanced-tools-settings', $arguments );
453
  }
454
 
455
  /**
490
  }
491
 
492
  /**
493
+ * Get the request data.
494
+ *
495
  * @return array
496
  */
497
  private function get_request_data() {
498
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-autolinks-nonce' ) // phpcs:ignore
499
+ ? $_POST :
500
+ array();
501
  }
502
 
503
+ /**
504
+ * Get the insert options.
505
+ *
506
+ * @return array
507
+ */
508
  public function get_insert_options() {
509
  $options = Smartcrawl_Settings::get_component_options( self::COMP_AUTOLINKS );
510
+ $result = array();
511
  foreach ( $this->get_insert_keys() as $key => $label ) {
512
  $result[ $key ] = array(
513
  'label' => $label,
514
+ 'value' => ! empty( $options[ $key ] ),
515
  );
516
  }
517
 
518
  return $result;
519
  }
520
 
521
+ /**
522
+ * Get the insert keys.
523
+ *
524
+ * @return array
525
+ */
526
  private function get_insert_keys() {
527
  foreach ( self::get_post_types() as $post_type => $pt ) {
528
  $key = strtolower( $pt->name );
529
 
530
+ $insert[ $key ] = $pt->labels->name;
531
  }
532
  $insert['comment'] = __( 'Comments', 'wds' );
533
 
534
  return $insert;
535
  }
536
 
537
+ /**
538
+ * Get link to options.
539
+ *
540
+ * @return array
541
+ */
542
  public function get_linkto_options() {
543
  $options = Smartcrawl_Settings::get_component_options( self::COMP_AUTOLINKS );
544
+ $result = array();
545
 
546
  foreach ( $this->get_linkto_keys() as $key => $label ) {
547
  $result[ $key ] = array(
548
  'label' => $label,
549
+ 'value' => ! empty( $options[ $key ] ),
550
  );
551
  }
552
 
553
  return $result;
554
  }
555
 
556
+ /**
557
+ * Get link to keys.
558
+ *
559
+ * @return array
560
+ */
561
  private function get_linkto_keys() {
562
  $post_types = array();
563
  foreach ( self::get_post_types() as $post_type => $pt ) {
564
+ $key = strtolower( $pt->name );
565
+ $post_types[ 'l' . $key ] = $pt->labels->name;
566
  }
567
 
568
  $taxonomies = array();
571
  $tax = get_taxonomy( $taxonomy );
572
  $key = strtolower( $tax->labels->name );
573
 
574
+ $taxonomies[ 'l' . $key ] = $tax->labels->name;
575
  }
576
  }
577
 
includes/admin/settings/dashboard.php CHANGED
@@ -1,36 +1,69 @@
1
  <?php
2
-
 
 
 
 
 
 
 
 
3
  class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
4
 
5
- const CRAWL_TIMEOUT_CODE = 'crawl_timeout';
 
6
  const BOX_SOCIAL = 'wds-social-dashboard-box';
 
7
  const BOX_ADVANCED_TOOLS = 'wds-advanced-tools-dashboard-box';
 
8
  const BOX_ONPAGE = 'wds-title-and-meta-dashboard-box';
 
9
  const BOX_CONTENT_ANALYSIS = 'wds-content-analysis-box';
 
10
  const BOX_SITEMAP = 'wds-sitemap-box';
 
11
  const BOX_LIGHTHOUSE = 'wds-lighthouse';
 
12
  const BOX_TOP_STATS = 'wds-dashboard-stats';
 
13
  const BOX_REPORTS = 'wds-reports-box';
 
14
  const BOX_UPGRADE = 'wds-upgrade';
 
15
  const BOX_SCHEMA = 'wds-schema-box';
16
- private static $_instance;
17
- protected $_seo_service;
18
- protected $_uptime_service;
19
 
20
- public static function get_instance() {
21
- if ( empty( self::$_instance ) ) {
22
- self::$_instance = new self();
23
- }
 
 
24
 
25
- return self::$_instance;
26
- }
 
 
 
 
27
 
 
 
 
 
 
 
 
28
  public function validate( $input ) {
29
  return $input;
30
  }
31
 
 
 
 
 
 
32
  public function init() {
33
- $this->slug = Smartcrawl_Settings::TAB_DASHBOARD;
34
  $this->page_title = __( 'SmartCrawl Wizard: Dashboard', 'wds' );
35
 
36
  add_action( 'wp_ajax_wds-activate-component', array( $this, 'json_activate_component' ) );
@@ -39,13 +72,18 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
39
  parent::init();
40
  }
41
 
 
 
 
 
 
42
  public function json_activate_component() {
43
  $result = array( 'success' => false );
44
- $data = $this->get_request_data();
45
 
46
  $option_id = sanitize_key( smartcrawl_get_array_value( $data, 'option' ) );
47
- $flag = sanitize_key( smartcrawl_get_array_value( $data, 'flag' ) );
48
- $value = (bool) smartcrawl_get_array_value( $data, 'value' );
49
 
50
  if ( is_null( $option_id ) || is_null( $flag ) ) {
51
  wp_send_json( $result );
@@ -53,7 +91,7 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
53
  return;
54
  }
55
 
56
- $options = self::get_specific_options( $option_id );
57
  $options[ $flag ] = $value;
58
  self::update_specific_options( $option_id, $options );
59
 
@@ -61,9 +99,14 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
61
  wp_send_json( $result );
62
  }
63
 
 
 
 
 
 
64
  public function json_reload_component() {
65
  $result = array( 'success' => false );
66
- $data = $this->get_request_data();
67
 
68
  $box_id = smartcrawl_get_array_value( $data, 'box_id' );
69
 
@@ -88,22 +131,29 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
88
  wp_send_json( $result );
89
  }
90
 
 
 
 
 
 
 
 
91
  private function load_box_markup( $box_id ) {
92
  switch ( $box_id ) {
93
  case self::BOX_SOCIAL:
94
- return $this->_load( 'dashboard/dashboard-widget-social' );
95
 
96
  case self::BOX_ADVANCED_TOOLS:
97
- return $this->_load( 'dashboard/dashboard-widget-advanced-tools' );
98
 
99
  case self::BOX_ONPAGE:
100
- return $this->_load( 'dashboard/dashboard-widget-onpage' );
101
 
102
  case self::BOX_CONTENT_ANALYSIS:
103
- return $this->_load( 'dashboard/dashboard-widget-content-analysis' );
104
 
105
  case self::BOX_SITEMAP:
106
- return $this->_load( 'dashboard/dashboard-widget-sitemap' );
107
 
108
  case self::BOX_LIGHTHOUSE:
109
  return Smartcrawl_Lighthouse_Dashboard_Renderer::load( 'dashboard/dashboard-widget-lighthouse' );
@@ -112,7 +162,7 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
112
  return Smartcrawl_Lighthouse_Dashboard_Renderer::load( 'dashboard/dashboard-top-lighthouse' );
113
 
114
  case self::BOX_SCHEMA:
115
- return $this->_load( 'dashboard/dashboard-widget-schema' );
116
  };
117
 
118
  return null;
@@ -124,27 +174,32 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
124
  public function options_page() {
125
  wp_enqueue_script( Smartcrawl_Controller_Assets::DASHBOARD_PAGE_JS );
126
 
127
- $uptime = $this->_get_uptime_service();
128
 
129
- $this->_render_page( 'dashboard/dashboard', array() );
130
  }
131
 
132
- protected function _get_uptime_service() {
133
- if ( ! empty( $this->_uptime_service ) ) {
134
- return $this->_uptime_service;
 
 
 
 
 
135
  }
136
 
137
- $this->_uptime_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_UPTIME );
138
 
139
- return $this->_uptime_service;
140
  }
141
 
142
  /**
143
  * Add sub page to the Settings Menu
144
  */
145
  public function add_page() {
146
- if ( ! $this->_is_current_tab_allowed() ) {
147
- return false;
148
  }
149
 
150
  $this->smartcrawl_page_hook = add_menu_page(
@@ -168,12 +223,22 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
168
  add_action( "admin_print_styles-{$this->smartcrawl_page_hook}", array( &$this, 'admin_styles' ) );
169
  }
170
 
 
 
 
 
 
171
  public function get_title() {
172
  return smartcrawl_is_build_type_full()
173
  ? __( 'SmartCrawl Pro', 'wds' )
174
  : __( 'SmartCrawl', 'wds' );
175
  }
176
 
 
 
 
 
 
177
  public function get_sub_title() {
178
  return __( 'Dashboard', 'wds' );
179
  }
@@ -181,15 +246,15 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
181
  /**
182
  * Always allow dashboard tab if there's more than one tab allowed
183
  *
184
- * Overrides Smartcrawl_Settings::_is_current_tab_allowed
185
  *
186
  * @return bool
187
  */
188
- protected function _is_current_tab_allowed() {
189
- if ( parent::_is_current_tab_allowed() ) {
190
  return true;
191
  }
192
- // Else we always add dashboard if there are other pages
193
  $all_tabs = Smartcrawl_Settings_Settings::get_blog_tabs();
194
 
195
  return ! empty( $all_tabs );
@@ -203,28 +268,35 @@ class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
203
  }
204
 
205
  /**
 
 
206
  * @return string
207
  */
208
  public function get_icon() {
209
  $svg = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4446 3.34827C13.129 2.46922 11.5823 2 10 2C7.87827 2 5.84343 2.84285 4.34314 4.34314C2.84285 5.84343 2 7.87827 2 10C2 11.0501 2.20668 12.0846 2.60267 13.0462L10.6489 5H8.99999V4H12H13V8H12V6.3359L3.57263 14.7633C4.1858 15.5907 4.9514 16.2898 5.82541 16.8244L10.6499 12H8.99997V11H12H13V15H12V13.3369L7.68051 17.6564C8.9348 18.0364 10.2675 18.1035 11.5607 17.8463C13.1126 17.5376 14.538 16.7757 15.6569 15.6569C16.7757 14.538 17.5376 13.1126 17.8463 11.5607C18.1549 10.0089 17.9966 8.40035 17.3911 6.93854C16.7856 5.47673 15.7602 4.22732 14.4446 3.34827ZM12 5.00006V5H11.9999L12 5.00006ZM4.44428 1.6853C6.08877 0.586489 8.02219 0 10 0C12.6522 0 15.1957 1.05359 17.071 2.92895C18.9464 4.80432 20 7.34783 20 10C20 11.9778 19.4135 13.9112 18.3147 15.5557C17.2159 17.2002 15.6541 18.4819 13.8268 19.2388C11.9996 19.9956 9.98888 20.1937 8.04908 19.8079C6.10927 19.422 4.32748 18.4696 2.92896 17.071C1.53043 15.6725 0.577995 13.8907 0.192143 11.9509C-0.193709 10.0111 0.00435805 8.00042 0.761235 6.17316C1.51811 4.3459 2.79979 2.78412 4.44428 1.6853Z" fill="#F0F6FC"/></svg>';
210
- $icon = 'data:image/svg+xml;base64,' . base64_encode( $svg );
211
- return $icon; // phpcs:ignore -- base64_encode is harmless here
212
  }
213
 
214
- protected function _get_seo_service() {
215
- if ( ! empty( $this->_seo_service ) ) {
216
- return $this->_seo_service;
 
 
 
 
 
217
  }
218
 
219
- $this->_seo_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
220
 
221
- return $this->_seo_service;
222
  }
223
 
224
  /**
225
  * TODO: replace with check_ajax_referer
226
  */
227
  private function get_request_data() {
228
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-nonce' ) ? stripslashes_deep( $_POST ) : array();
229
  }
230
  }
1
  <?php
2
+ /**
3
+ * Dashboard settings
4
+ *
5
+ * @package Smartcrawl
6
+ */
7
+
8
+ /**
9
+ * Class Smartcrawl_Settings_Dashboard
10
+ */
11
  class Smartcrawl_Settings_Dashboard extends Smartcrawl_Settings_Admin {
12
 
13
+ use Smartcrawl_Singleton;
14
+
15
  const BOX_SOCIAL = 'wds-social-dashboard-box';
16
+
17
  const BOX_ADVANCED_TOOLS = 'wds-advanced-tools-dashboard-box';
18
+
19
  const BOX_ONPAGE = 'wds-title-and-meta-dashboard-box';
20
+
21
  const BOX_CONTENT_ANALYSIS = 'wds-content-analysis-box';
22
+
23
  const BOX_SITEMAP = 'wds-sitemap-box';
24
+
25
  const BOX_LIGHTHOUSE = 'wds-lighthouse';
26
+
27
  const BOX_TOP_STATS = 'wds-dashboard-stats';
28
+
29
  const BOX_REPORTS = 'wds-reports-box';
30
+
31
  const BOX_UPGRADE = 'wds-upgrade';
32
+
33
  const BOX_SCHEMA = 'wds-schema-box';
 
 
 
34
 
35
+ /**
36
+ * Service instance.
37
+ *
38
+ * @var Smartcrawl_Service
39
+ */
40
+ protected $seo_service;
41
 
42
+ /**
43
+ * Uptime service instance.
44
+ *
45
+ * @var Smartcrawl_Service
46
+ */
47
+ protected $uptime_service;
48
 
49
+ /**
50
+ * Validate input.
51
+ *
52
+ * @param array $input Input.
53
+ *
54
+ * @return array
55
+ */
56
  public function validate( $input ) {
57
  return $input;
58
  }
59
 
60
+ /**
61
+ * Init module.
62
+ *
63
+ * @return void
64
+ */
65
  public function init() {
66
+ $this->slug = Smartcrawl_Settings::TAB_DASHBOARD;
67
  $this->page_title = __( 'SmartCrawl Wizard: Dashboard', 'wds' );
68
 
69
  add_action( 'wp_ajax_wds-activate-component', array( $this, 'json_activate_component' ) );
72
  parent::init();
73
  }
74
 
75
+ /**
76
+ * Activate component.
77
+ *
78
+ * @return void
79
+ */
80
  public function json_activate_component() {
81
  $result = array( 'success' => false );
82
+ $data = $this->get_request_data();
83
 
84
  $option_id = sanitize_key( smartcrawl_get_array_value( $data, 'option' ) );
85
+ $flag = sanitize_key( smartcrawl_get_array_value( $data, 'flag' ) );
86
+ $value = (bool) smartcrawl_get_array_value( $data, 'value' );
87
 
88
  if ( is_null( $option_id ) || is_null( $flag ) ) {
89
  wp_send_json( $result );
91
  return;
92
  }
93
 
94
+ $options = self::get_specific_options( $option_id );
95
  $options[ $flag ] = $value;
96
  self::update_specific_options( $option_id, $options );
97
 
99
  wp_send_json( $result );
100
  }
101
 
102
+ /**
103
+ * Reload component.
104
+ *
105
+ * @return void
106
+ */
107
  public function json_reload_component() {
108
  $result = array( 'success' => false );
109
+ $data = $this->get_request_data();
110
 
111
  $box_id = smartcrawl_get_array_value( $data, 'box_id' );
112
 
131
  wp_send_json( $result );
132
  }
133
 
134
+ /**
135
+ * Load box markup.
136
+ *
137
+ * @param string $box_id Box ID.
138
+ *
139
+ * @return false|mixed|null
140
+ */
141
  private function load_box_markup( $box_id ) {
142
  switch ( $box_id ) {
143
  case self::BOX_SOCIAL:
144
+ return $this->load_view( 'dashboard/dashboard-widget-social' );
145
 
146
  case self::BOX_ADVANCED_TOOLS:
147
+ return $this->load_view( 'dashboard/dashboard-widget-advanced-tools' );
148
 
149
  case self::BOX_ONPAGE:
150
+ return $this->load_view( 'dashboard/dashboard-widget-onpage' );
151
 
152
  case self::BOX_CONTENT_ANALYSIS:
153
+ return $this->load_view( 'dashboard/dashboard-widget-content-analysis' );
154
 
155
  case self::BOX_SITEMAP:
156
+ return $this->load_view( 'dashboard/dashboard-widget-sitemap' );
157
 
158
  case self::BOX_LIGHTHOUSE:
159
  return Smartcrawl_Lighthouse_Dashboard_Renderer::load( 'dashboard/dashboard-widget-lighthouse' );
162
  return Smartcrawl_Lighthouse_Dashboard_Renderer::load( 'dashboard/dashboard-top-lighthouse' );
163
 
164
  case self::BOX_SCHEMA:
165
+ return $this->load_view( 'dashboard/dashboard-widget-schema' );
166
  };
167
 
168
  return null;
174
  public function options_page() {
175
  wp_enqueue_script( Smartcrawl_Controller_Assets::DASHBOARD_PAGE_JS );
176
 
177
+ $uptime = $this->get_uptime_service();
178
 
179
+ $this->render_page( 'dashboard/dashboard', array() );
180
  }
181
 
182
+ /**
183
+ * Get uptime service.
184
+ *
185
+ * @return Smartcrawl_Service
186
+ */
187
+ protected function get_uptime_service() {
188
+ if ( ! empty( $this->uptime_service ) ) {
189
+ return $this->uptime_service;
190
  }
191
 
192
+ $this->uptime_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_UPTIME );
193
 
194
+ return $this->uptime_service;
195
  }
196
 
197
  /**
198
  * Add sub page to the Settings Menu
199
  */
200
  public function add_page() {
201
+ if ( ! $this->is_current_tab_allowed() ) {
202
+ return;
203
  }
204
 
205
  $this->smartcrawl_page_hook = add_menu_page(
223
  add_action( "admin_print_styles-{$this->smartcrawl_page_hook}", array( &$this, 'admin_styles' ) );
224
  }
225
 
226
+ /**
227
+ * Get title.
228
+ *
229
+ * @return string|void
230
+ */
231
  public function get_title() {
232
  return smartcrawl_is_build_type_full()
233
  ? __( 'SmartCrawl Pro', 'wds' )
234
  : __( 'SmartCrawl', 'wds' );
235
  }
236
 
237
+ /**
238
+ * Get sub title.
239
+ *
240
+ * @return string|void
241
+ */
242
  public function get_sub_title() {
243
  return __( 'Dashboard', 'wds' );
244
  }
246
  /**
247
  * Always allow dashboard tab if there's more than one tab allowed
248
  *
249
+ * Overrides Smartcrawl_Settings::is_current_tab_allowed
250
  *
251
  * @return bool
252
  */
253
+ protected function is_current_tab_allowed() {
254
+ if ( parent::is_current_tab_allowed() ) {
255
  return true;
256
  }
257
+ // Else we always add dashboard if there are other pages.
258
  $all_tabs = Smartcrawl_Settings_Settings::get_blog_tabs();
259
 
260
  return ! empty( $all_tabs );
268
  }
269
 
270
  /**
271
+ * Get the icon svg.
272
+ *
273
  * @return string
274
  */
275
  public function get_icon() {
276
  $svg = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4446 3.34827C13.129 2.46922 11.5823 2 10 2C7.87827 2 5.84343 2.84285 4.34314 4.34314C2.84285 5.84343 2 7.87827 2 10C2 11.0501 2.20668 12.0846 2.60267 13.0462L10.6489 5H8.99999V4H12H13V8H12V6.3359L3.57263 14.7633C4.1858 15.5907 4.9514 16.2898 5.82541 16.8244L10.6499 12H8.99997V11H12H13V15H12V13.3369L7.68051 17.6564C8.9348 18.0364 10.2675 18.1035 11.5607 17.8463C13.1126 17.5376 14.538 16.7757 15.6569 15.6569C16.7757 14.538 17.5376 13.1126 17.8463 11.5607C18.1549 10.0089 17.9966 8.40035 17.3911 6.93854C16.7856 5.47673 15.7602 4.22732 14.4446 3.34827ZM12 5.00006V5H11.9999L12 5.00006ZM4.44428 1.6853C6.08877 0.586489 8.02219 0 10 0C12.6522 0 15.1957 1.05359 17.071 2.92895C18.9464 4.80432 20 7.34783 20 10C20 11.9778 19.4135 13.9112 18.3147 15.5557C17.2159 17.2002 15.6541 18.4819 13.8268 19.2388C11.9996 19.9956 9.98888 20.1937 8.04908 19.8079C6.10927 19.422 4.32748 18.4696 2.92896 17.071C1.53043 15.6725 0.577995 13.8907 0.192143 11.9509C-0.193709 10.0111 0.00435805 8.00042 0.761235 6.17316C1.51811 4.3459 2.79979 2.78412 4.44428 1.6853Z" fill="#F0F6FC"/></svg>';
277
+
278
+ return 'data:image/svg+xml;base64,' . base64_encode( $svg ); // phpcs:ignore -- base64_encode is harmless here
279
  }
280
 
281
+ /**
282
+ * Get SEO service instance.
283
+ *
284
+ * @return Smartcrawl_Lighthouse_Service|Smartcrawl_Seo_Service|Smartcrawl_Service|Smartcrawl_Site_Service|Smartcrawl_Uptime_Service
285
+ */
286
+ protected function get_seo_service() {
287
+ if ( ! empty( $this->seo_service ) ) {
288
+ return $this->seo_service;
289
  }
290
 
291
+ $this->seo_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
292
 
293
+ return $this->seo_service;
294
  }
295
 
296
  /**
297
  * TODO: replace with check_ajax_referer
298
  */
299
  private function get_request_data() {
300
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wds_nonce'] ), 'wds-nonce' ) ? stripslashes_deep( $_POST ) : array(); // phpcs:ignore
301
  }
302
  }
includes/admin/settings/health.php CHANGED
@@ -1,82 +1,114 @@
1
  <?php
2
-
 
 
 
 
 
 
 
 
3
  class Smartcrawl_Health_Settings extends Smartcrawl_Settings_Admin {
4
- /**
5
- * Singleton instance
6
- *
7
- * @var self
8
- */
9
- private static $_instance;
10
 
11
  /**
12
- * Singleton instance getter
13
  *
14
- * @return self instance
 
 
15
  */
16
- public static function get_instance() {
17
- if ( empty( self::$_instance ) ) {
18
- self::$_instance = new self();
19
- }
20
-
21
- return self::$_instance;
22
- }
23
-
24
  public function validate( $input ) {
25
  return array();
26
  }
27
 
 
 
 
 
 
28
  public function init() {
29
  $this->option_name = 'wds_health_options';
30
- $this->name = Smartcrawl_Settings::COMP_HEALTH;
31
- $this->slug = Smartcrawl_Settings::TAB_HEALTH;
32
- $this->action_url = admin_url( 'options.php' );
33
- $this->page_title = __( 'SmartCrawl Wizard: SEO Health', 'wds' );
34
 
35
  add_action( 'wp_ajax_wds-save-health-settings', array( $this, 'save_health_settings' ) );
36
 
37
  parent::init();
38
  }
39
 
 
 
 
 
 
40
  public function save_health_settings() {
41
  $data = $this->get_request_data();
42
  if ( empty( $data ) ) {
43
  wp_send_json_error();
44
  }
45
 
46
- Smartcrawl_Lighthouse_Options::save_form_data( $_GET['wds_health_options'] );
47
 
48
  wp_send_json_success();
49
  }
50
 
 
 
 
 
 
51
  public function get_title() {
52
  return __( 'SEO Health', 'wds' );
53
  }
54
 
 
 
 
 
 
55
  public function options_page() {
56
  wp_enqueue_script( Smartcrawl_Controller_Assets::LIGHTHOUSE_JS );
57
 
58
- $this->_render( 'lighthouse/lighthouse-settings' );
59
  }
60
 
 
 
 
 
 
61
  public function defaults() {
62
  Smartcrawl_Lighthouse_Options::save_defaults();
63
  }
64
 
65
- protected function _get_view_defaults() {
66
- $mode_defaults = Smartcrawl_Lighthouse_Renderer::get_instance()->get_view_defaults();
 
 
 
 
 
67
 
68
  return array_merge(
69
  array(
70
- 'active_tab' => $this->_get_active_tab( 'tab_lighthouse' ),
71
  ),
72
  $mode_defaults,
73
- parent::_get_view_defaults()
74
  );
75
  }
76
 
 
 
 
 
 
77
  private function get_request_data() {
78
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-health-nonce' )
79
- ? $_POST
80
- : array();
81
  }
82
  }
1
  <?php
2
+ /**
3
+ * Health settings
4
+ *
5
+ * @package Smartcrawl
6
+ */
7
+
8
+ /**
9
+ * Smartcrawl_Health_Settings
10
+ */
11
  class Smartcrawl_Health_Settings extends Smartcrawl_Settings_Admin {
12
+
13
+ use Smartcrawl_Singleton;
14
+
 
 
 
15
 
16
  /**
17
+ * Validate.
18
  *
19
+ * @param array $input Input.
20
+ *
21
+ * @return array
22
  */
 
 
 
 
 
 
 
 
23
  public function validate( $input ) {
24
  return array();
25
  }
26
 
27
+ /**
28
+ * Initialize.
29
+ *
30
+ * @return void
31
+ */
32
  public function init() {
33
  $this->option_name = 'wds_health_options';
34
+ $this->name = Smartcrawl_Settings::COMP_HEALTH;
35
+ $this->slug = Smartcrawl_Settings::TAB_HEALTH;
36
+ $this->action_url = admin_url( 'options.php' );
37
+ $this->page_title = __( 'SmartCrawl Wizard: SEO Health', 'wds' );
38
 
39
  add_action( 'wp_ajax_wds-save-health-settings', array( $this, 'save_health_settings' ) );
40
 
41
  parent::init();
42
  }
43
 
44
+ /**
45
+ * Save health settings.
46
+ *
47
+ * @return void
48
+ */
49
  public function save_health_settings() {
50
  $data = $this->get_request_data();
51
  if ( empty( $data ) ) {
52
  wp_send_json_error();
53
  }
54
 
55
+ Smartcrawl_Lighthouse_Options::save_form_data( $_GET['wds_health_options'] ); // phpcs:ignore -- Sanitized on usage later.
56
 
57
  wp_send_json_success();
58
  }
59
 
60
+ /**
61
+ * Get the title.
62
+ *
63
+ * @return string
64
+ */
65
  public function get_title() {
66
  return __( 'SEO Health', 'wds' );
67
  }
68
 
69
+ /**
70
+ * Render the page content.
71
+ *
72
+ * @return void
73
+ */
74
  public function options_page() {
75
  wp_enqueue_script( Smartcrawl_Controller_Assets::LIGHTHOUSE_JS );
76
 
77
+ $this->render_view( 'lighthouse/lighthouse-settings' );
78
  }
79
 
80
+ /**
81
+ * Save defaults.
82
+ *
83
+ * @return void
84
+ */
85
  public function defaults() {
86
  Smartcrawl_Lighthouse_Options::save_defaults();
87
  }
88
 
89
+ /**
90
+ * Get view defaults.
91
+ *
92
+ * @return array|array[]|string[]
93
+ */
94
+ protected function get_view_defaults() {
95
+ $mode_defaults = Smartcrawl_Lighthouse_Renderer::get()->view_defaults();
96
 
97
  return array_merge(
98
  array(
99
+ 'active_tab' => $this->get_active_tab( 'tab_lighthouse' ),
100
  ),
101
  $mode_defaults,
102
+ parent::get_view_defaults()
103
  );
104
  }
105
 
106
+ /**
107
+ * Get request data.
108
+ *
109
+ * @return array
110
+ */
111
  private function get_request_data() {
112
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wds_nonce'] ), 'wds-health-nonce' ) ? $_POST : array(); // phpcs:ignore
 
 
113
  }
114
  }
includes/admin/settings/onpage.php CHANGED
@@ -1,47 +1,48 @@
1
  <?php
2
-
 
 
 
 
 
 
 
 
3
  class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
4
 
5
- const PT_ARCHIVE_PREFIX = 'pt-archive-';
6
- private static $_instance;
7
-
8
- public static function get_instance() {
9
- if ( empty( self::$_instance ) ) {
10
- self::$_instance = new self();
11
- }
12
 
13
- return self::$_instance;
14
- }
15
 
16
  /**
17
  * Validate submitted options
18
  *
19
- * @param array $input Raw input
20
  *
21
  * @return array Validated input
22
  */
23
  public function validate( $input ) {
24
  $result = array();
25
 
26
- // Setup
27
  if ( ! empty( $input['wds_onpage-setup'] ) ) {
28
  $result['wds_onpage-setup'] = true;
29
  }
30
 
31
  foreach ( array( 'main_blog_archive', 'search', 'bp_groups', 'bp_profile' ) as $type ) {
32
- // Meta robots
33
- if ( ! empty( $input["meta_robots-noindex-$type"] ) ) {
34
- $result["meta_robots-noindex-$type"] = true;
35
  }
36
- if ( ! empty( $input["meta_robots-nofollow-$type"] ) ) {
37
- $result["meta_robots-nofollow-$type"] = true;
38
  }
39
- if ( ! empty( $input["meta_robots-$type-subsequent_pages"] ) ) {
40
- $result["meta_robots-$type-subsequent_pages"] = true;
41
  }
42
  }
43
 
44
- $tax_options = $this->_get_tax_options( '' );
45
  foreach ( $tax_options as $option => $_tax ) {
46
  $rbts = $this->get_robots_options_for( $option );
47
  if ( ! empty( $rbts ) && is_array( $rbts ) ) {
@@ -52,7 +53,7 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
52
  }
53
  }
54
  }
55
- $other_options = $this->_get_other_types_options( '' );
56
  foreach ( $other_options as $option => $_tax ) {
57
  $rbts = $this->get_robots_options_for( $option );
58
  if ( ! empty( $rbts ) && is_array( $rbts ) ) {
@@ -75,7 +76,7 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
75
  }
76
  }
77
 
78
- // String values
79
  $strings = array(
80
  'home',
81
  'search',
@@ -85,12 +86,12 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
85
  );
86
  foreach ( get_post_types( array( 'public' => true ) ) as $pt ) {
87
  $strings[] = $pt;
88
- // Allow post types robots noindex/nofollow
89
- if ( ! empty( $input["meta_robots-noindex-{$pt}"] ) ) {
90
- $result["meta_robots-noindex-{$pt}"] = true;
91
  }
92
- if ( ! empty( $input["meta_robots-nofollow-{$pt}"] ) ) {
93
- $result["meta_robots-nofollow-{$pt}"] = true;
94
  }
95
  }
96
  $strings = array_merge( $strings, array_values( $tax_options ) );
@@ -98,64 +99,60 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
98
  $strings = array_merge( $strings, $archive_post_types );
99
 
100
  foreach ( $strings as $str ) {
101
- if ( isset( $input["title-{$str}"] ) ) {
102
- $result["title-{$str}"] = smartcrawl_sanitize_preserve_macros( $input["title-{$str}"] );
103
  }
104
- if ( isset( $input["metadesc-{$str}"] ) ) {
105
- $result["metadesc-{$str}"] = smartcrawl_sanitize_preserve_macros( $input["metadesc-{$str}"] );
106
  }
107
 
108
- // OpenGraph
109
- if ( isset( $input["og-active-{$str}"] ) ) {
110
- $result["og-active-{$str}"] = (boolean) $input["og-active-{$str}"];
111
  }
112
- if ( isset( $input["og-title-{$str}"] ) ) {
113
- $result["og-title-{$str}"] = smartcrawl_sanitize_preserve_macros( $input["og-title-{$str}"] );
114
  }
115
- if ( isset( $input["og-description-{$str}"] ) ) {
116
- $result["og-description-{$str}"] = smartcrawl_sanitize_preserve_macros( $input["og-description-{$str}"] );
117
  }
118
 
119
- $result["og-images-{$str}"] = array();
120
- if ( ! empty( $input["og-images-{$str}"] ) && is_array( $input["og-images-{$str}"] ) ) {
121
- foreach ( $input["og-images-{$str}"] as $img ) {
122
- $result["og-images-{$str}"][] = is_numeric( $img ) ? intval( $img ) : esc_url( $img );
123
  }
124
  }
125
- $result["og-images-{$str}"] = array_values( array_filter( array_unique( $result["og-images-{$str}"] ) ) );
126
- if ( isset( $input["og-disable-first-image-{$str}"] ) ) {
127
- $result["og-disable-first-image-{$str}"] = (boolean) $input["og-disable-first-image-{$str}"];
128
  }
129
 
130
- // Twitter cards
131
- if ( isset( $input["twitter-active-{$str}"] ) ) {
132
- $result["twitter-active-{$str}"] = (boolean) $input["twitter-active-{$str}"];
133
  }
134
- if ( isset( $input["twitter-title-{$str}"] ) ) {
135
- $result["twitter-title-{$str}"] = smartcrawl_sanitize_preserve_macros( $input["twitter-title-{$str}"] );
136
  }
137
- if ( isset( $input["twitter-description-{$str}"] ) ) {
138
- $result["twitter-description-{$str}"] = smartcrawl_sanitize_preserve_macros( $input["twitter-description-{$str}"] );
139
  }
140
 
141
- $result["twitter-images-{$str}"] = array();
142
- if ( ! empty( $input["twitter-images-{$str}"] ) && is_array( $input["twitter-images-{$str}"] ) ) {
143
- foreach ( $input["twitter-images-{$str}"] as $img ) {
144
- $result["twitter-images-{$str}"][] = is_numeric( $img ) ? intval( $img ) : esc_url( $img );
145
  }
146
  }
147
- $result["twitter-images-{$str}"] = array_values( array_filter( array_unique( $result["twitter-images-{$str}"] ) ) );
148
- if ( isset( $input["twitter-disable-first-image-{$str}"] ) ) {
149
- $result["twitter-disable-first-image-{$str}"] = (boolean) $input["twitter-disable-first-image-{$str}"];
150
  }
151
  }
152
 
153
- $result['enable-author-archive'] = isset( $input['enable-author-archive'] )
154
- ? (boolean) $input['enable-author-archive']
155
- : false;
156
- $result['enable-date-archive'] = isset( $input['enable-date-archive'] )
157
- ? (boolean) $input['enable-date-archive']
158
- : false;
159
 
160
  if ( isset( $input['preset-separator'] ) ) {
161
  $result['preset-separator'] = sanitize_text_field( $input['preset-separator'] );
@@ -188,8 +185,21 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
188
  return $result;
189
  }
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  private function sanitize_and_include_char_lengths( $result, $input, $toggle_name, $min_field_name, $max_field_name, $default_min, $default_max ) {
192
- $result[ $toggle_name ] = ! empty( $input[ $toggle_name ] );
193
  $custom_title_min_length = (int) smartcrawl_get_array_value( $input, $min_field_name );
194
  if ( $custom_title_min_length > 0 ) {
195
  $result[ $min_field_name ] = $custom_title_min_length;
@@ -211,15 +221,15 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
211
  /**
212
  * Spawn taxonomy options and names, indexed by taxonomy option names
213
  *
214
- * @param string $pfx Prefix options with this
215
  *
216
  * @return array
217
  */
218
- protected function _get_tax_options( $pfx = '' ) {
219
- $pfx = ! empty( $pfx ) ? rtrim( $pfx, '_' ) . '_' : $pfx;
220
  $opts = array();
221
  foreach ( get_taxonomies( array( '_builtin' => false ), 'objects' ) as $taxonomy ) {
222
- $name = $pfx . str_replace( '-', '_', $taxonomy->name );
223
  $opts[ $name ] = $taxonomy->name;
224
  }
225
 
@@ -227,12 +237,13 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
227
  }
228
 
229
  /**
230
- * Spawns a set of robots options for a given type
231
  *
232
- * @param string $type Archives type to generate the robots options for
233
- * @param bool $include_subsequent_pages_option Whether to include the subsequent pages option.
 
234
  *
235
- * @return array Generated meta robots option array
236
  */
237
  public static function get_robots_options_for( $type, $include_subsequent_pages_option = true, $context = '' ) {
238
  $options = array(
@@ -250,7 +261,7 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
250
  );
251
 
252
  if ( $include_subsequent_pages_option ) {
253
- $options["meta_robots-{$type}-subsequent_pages"] = array(
254
  'label' => esc_html__( 'Apply to all pages except the first', 'wds' ),
255
  'description' => esc_html__( 'If you select this option, the first page will be left alone, but the indexing settings will be applied to subsequent pages.', 'wds' ),
256
  );
@@ -259,6 +270,13 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
259
  return $options;
260
  }
261
 
 
 
 
 
 
 
 
262
  private static function sitemap_notice( $type ) {
263
  $sitemap_enabled = Smartcrawl_Sitemap_Utils::sitemap_enabled();
264
  if ( ! $sitemap_enabled ) {
@@ -266,33 +284,37 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
266
  }
267
 
268
  $message = smartcrawl_format_link(
 
269
  esc_html__( 'You might want to exclude this type from the %s as well.', 'wds' ),
270
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP ),
271
  esc_html__( 'sitemap', 'wds' )
272
  );
273
  $options = Smartcrawl_Settings::get_options();
274
- $indexed = empty( $options["meta_robots-noindex-{$type}"] );
275
- $class = 'sui-notice-info';
276
  if ( $indexed ) {
277
  $class .= ' hidden';
278
  }
279
 
280
- return Smartcrawl_Simple_Renderer::load( 'notice', array(
281
- 'class' => $class,
282
- 'message' => $message,
283
- ) );
 
 
 
284
  }
285
 
286
  /**
287
  * Spawn taxonomy options and names, indexed by taxonomy option names
288
  *
289
- * @param string $pfx Prefix options with this
290
  *
291
  * @return array
292
  */
293
- protected function _get_other_types_options( $pfx = '' ) {
294
- $pfx = ! empty( $pfx ) ? rtrim( $pfx, '_' ) . '_' : $pfx;
295
- $opts = array();
296
  $other_types = array(
297
  'category',
298
  'post_tag',
@@ -300,53 +322,74 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
300
  'date',
301
  );
302
  foreach ( $other_types as $value ) {
303
- $name = $pfx . $value;
304
  $opts[ $name ] = $value;
305
  }
306
 
307
  return $opts;
308
  }
309
 
310
- protected function _get_other_types_options_context( $pfx = '' ) {
 
 
 
 
 
 
 
311
  $context_strings = array();
312
- foreach ( $this->_get_other_types_options( '' ) as $option ) {
313
  $context = '';
314
 
315
  if ( in_array( $option, array( 'category', 'post_tag' ), true ) ) {
316
  $tax_object = get_taxonomy( $option );
317
- $context = strtolower( $tax_object->label );
318
  } elseif ( 'author' === $option ) {
319
  $context = esc_html__( 'author archives', 'wds' );
320
  } elseif ( 'date' === $option ) {
321
  $context = esc_html__( 'date archives', 'wds' );
322
  }
323
 
324
- $context_strings[ $pfx . $option ] = $context;
325
  }
326
 
327
  return $context_strings;
328
  }
329
 
 
 
 
 
 
330
  public function init() {
331
  $this->option_name = 'wds_onpage_options';
332
- $this->name = Smartcrawl_Settings::COMP_ONPAGE;
333
- $this->slug = Smartcrawl_Settings::TAB_ONPAGE;
334
- $this->action_url = admin_url( 'options.php' );
335
- $this->page_title = __( 'SmartCrawl Wizard: Title & Meta', 'wds' );
336
 
337
  add_action( 'wp_ajax_wds-onpage-save-static-home', array( $this, 'json_save_static_homepage_meta' ) );
338
 
339
  parent::init();
340
-
341
  }
342
 
 
 
 
 
 
343
  public function get_title() {
344
  return __( 'Title & Meta', 'wds' );
345
  }
346
 
 
 
 
 
 
347
  public function json_save_static_homepage_meta() {
348
  $request_data = $this->get_request_data();
349
- $front_page = get_post( (int) get_option( 'page_on_front' ) );
350
 
351
  $title = smartcrawl_get_array_value( $request_data, array( 'wds_onpage_options', 'title-static-home' ) );
352
  if ( $title ) {
@@ -355,10 +398,13 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
355
  delete_post_meta( $front_page->ID, '_wds_title' );
356
  }
357
 
358
- $description = smartcrawl_get_array_value( $request_data, array(
359
- 'wds_onpage_options',
360
- 'metadesc-static-home',
361
- ) );
 
 
 
362
  if ( $description ) {
363
  update_post_meta( $front_page->ID, '_wds_metadesc', smartcrawl_sanitize_preserve_macros( $description ) );
364
  } else {
@@ -366,100 +412,34 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
366
  }
367
 
368
  $metabox = Smartcrawl_Metabox::get();
369
- $metabox->save_opengraph_meta(
370
- $front_page->ID,
371
- stripslashes_deep( $request_data['wds-opengraph'] )
372
- );
373
- $metabox->save_twitter_post_meta(
374
- $front_page->ID,
375
- stripslashes_deep( $request_data['wds-twitter'] )
376
- );
377
  $metabox->save_robots_meta( $front_page, $request_data );
378
 
379
  wp_send_json( array( 'success' => true ) );
380
  }
381
 
382
- private function _get_random_bp_group() {
383
- $groups = groups_get_groups( array(
384
- 'orderby' => 'random',
385
- 'per_page' => 1,
386
- ) );
387
-
388
- $total = isset( $groups['total'] ) ? $groups['total'] : 0;
389
- $groups = isset( $groups['groups'] ) ? $groups['groups'] : array();
390
-
391
- return $total > 0 ? $groups[0] : null;
392
- }
393
-
394
- /**
395
- * Randomly spawns a post of certain post type
396
- *
397
- * @param string $type Post type
398
- *
399
- * @return WP_Post
400
- */
401
- private function _get_random_post( $type = 'post' ) {
402
- $args = array(
403
- 'posts_per_page' => 1,
404
- 'post_type' => $type,
405
- 'orderby' => 'random',
406
- );
407
- if ( 'attachment' === $type ) {
408
- $args['post_status'] = 'any';
409
- }
410
- $q = new WP_Query( $args );
411
-
412
- return ! empty( $q->post )
413
- ? $q->post
414
- : null;
415
- }
416
-
417
- /**
418
- * Spawn a random taxonomy term for a tax type
419
- *
420
- * @param string $type Taxonomy type
421
- *
422
- * @return WP_Term
423
- */
424
- private function _get_random_term( $type = 'category' ) {
425
- $terms = get_terms(
426
- array(
427
- 'taxonomy' => $type,
428
- 'hide_empty' => 0,
429
- )
430
- );
431
- if ( empty( $terms ) ) {
432
- return null;
433
- }
434
-
435
- shuffle( $terms );
436
-
437
- return $terms[0];
438
- }
439
-
440
  /**
441
  * Add admin settings page
442
  */
443
  public function options_page() {
444
  parent::options_page();
445
 
446
- $smartcrawl_options = Smartcrawl_Settings::get_options();
447
-
448
  $arguments = array(
449
  'meta_robots_main_blog_archive' => self::get_robots_options_for( 'main_blog_archive', true, esc_html__( 'this website', 'wds' ) ),
450
  );
451
 
452
- foreach ( $this->_get_tax_options( 'meta_robots_' ) as $option => $tax ) {
453
- $tax = str_replace( '-', '_', $tax );
454
  $tax_object = get_taxonomy( $tax );
455
  if ( empty( $arguments[ $option ] ) ) {
456
- $tax_label = empty( $tax_object->label ) ? '' : $tax_object->label;
457
  $arguments[ $option ] = self::get_robots_options_for( $tax, true, strtolower( $tax_label ) );
458
  }
459
  }
460
 
461
- foreach ( $this->_get_other_types_options( 'meta_robots_' ) as $option => $value ) {
462
- $context_strings = $this->_get_other_types_options_context( 'meta_robots_' );
463
  if ( empty( $arguments[ $option ] ) ) {
464
  $arguments[ $option ] = self::get_robots_options_for( $value, true, smartcrawl_get_array_value( $context_strings, $option ) );
465
  }
@@ -467,7 +447,9 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
467
 
468
  $archive_post_types = smartcrawl_get_archive_post_type_labels();
469
  foreach ( $archive_post_types as $archive_post_type => $archive_post_type_label ) {
 
470
  $pt_archive_context = sprintf( esc_html__( '%s archive', 'wds' ), strtolower( $archive_post_type_label ) );
 
471
  $arguments['archive_post_type_robots'][ $archive_post_type ] = self::get_robots_options_for( $archive_post_type, true, $pt_archive_context );
472
  }
473
  $arguments['archive_post_types'] = $archive_post_types;
@@ -478,9 +460,11 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
478
  esc_html__( 'search page', 'wds' )
479
  );
480
 
481
- // Allow for post type options
482
  foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $post_type ) {
483
  /**
 
 
484
  * @var $post_type WP_Post_Type
485
  */
486
  $arguments['post_robots'][ $post_type->name ] = self::get_robots_options_for( $post_type->name, false, strtolower( $post_type->label ) );
@@ -498,16 +482,16 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
498
 
499
  $arguments['separators'] = smartcrawl_get_separators();
500
 
501
- $static_homepage = 'page' === get_option( 'show_on_front' );
502
- $front_page = get_post( (int) get_option( 'page_on_front' ) );
503
  $show_static_home_settings = $static_homepage && $front_page;
504
 
505
- $arguments['front_page'] = $front_page;
506
- $arguments['front_page_notice'] = $this->static_frontpage_notice( $front_page );
507
  $arguments['show_static_home_settings'] = $show_static_home_settings;
508
- $default_tab = $show_static_home_settings ? 'tab_static_homepage' : 'tab_homepage';
509
 
510
- $arguments['active_tab'] = $this->_get_active_tab( $default_tab );
511
 
512
  $arguments['meta_robots_bp_groups'] = self::get_robots_options_for(
513
  'bp_groups',
@@ -522,28 +506,47 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
522
  );
523
 
524
  wp_enqueue_script( Smartcrawl_Controller_Assets::ONPAGE_JS );
525
- $this->_render_page( 'onpage/onpage-settings', $arguments );
526
  }
527
 
 
 
 
 
 
 
 
528
  private function static_frontpage_notice( $front_page ) {
529
  ob_start();
530
  esc_html_e( 'Your homepage is set to a static page, Homepage. You can edit your homepage meta from here, as well as in the WordPress editor for that page.', 'wds' );
531
  if ( $front_page ) {
532
  ?>
533
  <br/>
534
- <a type="button"
535
- href="<?php echo esc_attr( get_edit_post_link( $front_page ) ); ?>"
536
- class="sui-button" style="margin-top: 10px">
 
 
537
  <?php esc_html_e( 'Go To Homepage', 'wds' ); ?></a>
538
  <?php
539
  }
540
 
541
- return $this->_load( 'notice', array(
542
- 'message' => ob_get_clean(),
543
- 'class' => 'sui-notice-info',
544
- ) );
 
 
 
545
  }
546
 
 
 
 
 
 
 
 
547
  public static function get_singular_macros( $post_type = '' ) {
548
  $singular_macros = array(
549
  '%%id%%' => __( 'Post/page ID', 'wds' ),
@@ -557,20 +560,22 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
557
  '%%user_description%%' => __( "Post/page author's description", 'wds' ),
558
  );
559
 
560
- if ( empty( $post_type ) || $post_type === 'attachment' ) {
561
  $singular_macros['%%caption%%'] = __( 'Attachment caption', 'wds' );
562
  }
563
 
564
- if ( empty( $post_type ) || $post_type === 'post' ) {
565
  $singular_macros['%%category%%'] = __( 'Post categories (comma separated)', 'wds' );
566
- $singular_macros['%%tag%%'] = __( 'Current tag/tags', 'wds' );
567
  }
568
 
569
  return $singular_macros;
570
  }
571
 
572
  /**
573
- * @param string $taxonomy
 
 
574
  *
575
  * @return array
576
  */
@@ -581,19 +586,24 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
581
  '%%term_description%%' => __( 'Term description', 'wds' ),
582
  );
583
 
584
- if ( empty( $taxonomy ) || $taxonomy === 'category' ) {
585
- $term_macros['%%category%%'] = __( 'Category name', 'wds' );
586
  $term_macros['%%category_description%%'] = __( 'Category description', 'wds' );
587
  }
588
 
589
- if ( empty( $taxonomy ) || $taxonomy === 'post_tag' ) {
590
- $term_macros['%%tag%%'] = __( 'Tag name', 'wds' );
591
  $term_macros['%%tag_description%%'] = __( 'Tag description', 'wds' );
592
  }
593
 
594
  return $term_macros;
595
  }
596
 
 
 
 
 
 
597
  public static function get_general_macros() {
598
  return array(
599
  '%%sep%%' => __( 'Separator', 'wds' ),
@@ -612,24 +622,33 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
612
  );
613
  }
614
 
 
 
 
 
 
615
  public static function get_bp_profile_macros() {
616
- $bp_macros = array(
617
  '%%bp_user_username%%' => __( 'BuddyPress username', 'wds' ),
618
  '%%bp_user_full_name%%' => __( "BuddyPress user's full name", 'wds' ),
619
  );
620
-
621
- return $bp_macros;
622
  }
623
 
 
 
 
 
 
624
  public static function get_bp_group_macros() {
625
- $bp_macros = array(
626
  '%%bp_group_name%%' => __( 'BuddyPress group name', 'wds' ),
627
  '%%bp_group_description%%' => __( 'BuddyPress group description', 'wds' ),
628
  );
629
-
630
- return $bp_macros;
631
  }
632
 
 
 
 
633
  public static function get_pt_archive_macros() {
634
  return array(
635
  '%%pt_plural%%' => __( 'Post type label plural', 'wds' ),
@@ -637,12 +656,22 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
637
  );
638
  }
639
 
 
 
 
 
 
640
  public static function get_search_macros() {
641
  return array(
642
  '%%searchphrase%%' => __( 'Current search phrase', 'wds' ),
643
  );
644
  }
645
 
 
 
 
 
 
646
  public static function get_author_macros() {
647
  return array(
648
  '%%name%%' => __( "Author's 'nicename'", 'wds' ),
@@ -651,6 +680,11 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
651
  );
652
  }
653
 
 
 
 
 
 
654
  public static function get_date_macros() {
655
  return array(
656
  '%%date%%' => __( 'Date of the archive', 'wds' ),
@@ -658,7 +692,7 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
658
  }
659
 
660
  /**
661
- * Default settings
662
  */
663
  public function defaults() {
664
  $this->options = get_option( $this->option_name );
@@ -683,14 +717,6 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
683
  $this->options['onpage-disable-automatic-regeneration'] = 0;
684
  }
685
 
686
- if ( empty( $this->options['meta_robots-noindex-attachment'] ) ) {
687
- $this->options['meta_robots-noindex-attachment'] = true;
688
- }
689
-
690
- if ( empty( $this->options['meta_robots-nofollow-attachment'] ) ) {
691
- $this->options['meta_robots-nofollow-attachment'] = true;
692
- }
693
-
694
  foreach ( get_post_types( array( 'public' => true ) ) as $posttype ) {
695
  if ( in_array( $posttype, array( 'revision', 'nav_menu_item' ), true ) ) {
696
  continue;
@@ -794,30 +820,44 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
794
  }
795
 
796
  /**
 
 
797
  * @return array
798
  */
799
  private function get_request_data() {
800
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-onpage-nonce' ) ? $_POST : array();
801
  }
802
 
 
 
 
 
 
803
  public static function get_random_post_data() {
804
  /**
 
 
805
  * @var $post_types WP_Post_Type
806
  */
807
- $post_types = get_post_types( array(
808
- 'public' => true,
809
- 'show_ui' => true,
810
- ), 'objects' );
 
 
 
811
 
812
  $data = array();
813
  foreach ( $post_types as $post_type ) {
814
- $posts = get_posts( array(
815
- 'post_status' => array( 'publish', 'inherit' ),
816
- 'order' => 'DESC',
817
- 'orderby' => 'ID',
818
- 'posts_per_page' => 1,
819
- 'post_type' => $post_type->name,
820
- ) );
 
 
821
 
822
  if ( ! empty( $posts ) ) {
823
  $data[ $post_type->name ] = self::get_post_data( $posts[0] );
@@ -825,7 +865,7 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
825
  }
826
 
827
  $show_static_page = get_option( 'show_on_front' ) === 'page';
828
- $static_page = get_post( (int) get_option( 'page_on_front' ) );
829
  if ( $show_static_page && $static_page ) {
830
  $data['static-home'] = self::get_post_data( get_post( (int) get_option( 'page_on_front' ) ) );
831
  }
@@ -834,40 +874,49 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
834
  }
835
 
836
  /**
837
- * @param $post WP_Post
 
 
838
  *
839
  * @return array
840
  */
841
  public static function get_post_data( $post ) {
842
  $post_data = $post->to_array();
843
 
844
- $terms = wp_get_object_terms( $post->ID, get_post_taxonomies( $post ) );
845
  $taxonomy_terms = array();
846
  foreach ( $terms as $term ) {
847
  $taxonomy_terms[ $term->taxonomy ][] = $term->term_id;
848
  }
849
 
850
  $post_data['taxonomy_terms'] = $taxonomy_terms;
851
- $post_data['permalink'] = get_permalink( $post );
852
 
853
  return $post_data;
854
  }
855
 
 
 
 
 
 
856
  public static function get_random_terms() {
857
- $data = array();
858
  $taxonomies = get_taxonomies( array(), 'objects' );
859
  foreach ( $taxonomies as $taxonomy ) {
860
- $terms = get_terms( array(
861
- 'orderby' => 'term_id',
862
- 'order' => 'DESC',
863
- 'number' => 1,
864
- 'taxonomy' => $taxonomy->name,
865
- 'hide_empty' => false,
866
- ) );
 
 
867
 
868
  if ( ! empty( $terms ) ) {
869
- $term = array_shift( $terms );
870
- $data[ $taxonomy->name ] = $term->to_array();
871
  $data[ $taxonomy->name ]['permalink'] = get_term_link( $term );
872
  }
873
  }
@@ -875,13 +924,18 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
875
  return $data;
876
  }
877
 
 
 
 
 
 
878
  public static function get_random_buddypress() {
879
  $buddypress_api = new Smartcrawl_Buddypress_Api();
880
  if ( ! $buddypress_api->buddypress() ) {
881
  return array();
882
  }
883
 
884
- $data = array();
885
  $buddypress_profile = new Smartcrawl_Buddypress_Profile( wp_get_current_user() );
886
  $data['bp_profile'] = array(
887
  'replacements' => $buddypress_profile->get_resolved_macros(),
@@ -901,6 +955,11 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
901
  return $data;
902
  }
903
 
 
 
 
 
 
904
  public static function get_random_archives() {
905
  $archives = array(
906
  'author' => self::get_author_archive_data(),
@@ -917,14 +976,25 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
917
  return $archives;
918
  }
919
 
 
 
 
 
 
920
  private static function get_author_archive_data() {
921
  $author = new Smartcrawl_Post_Author( wp_get_current_user() );
 
922
  return array(
923
  'replacements' => $author->get_resolved_macros(),
924
  'url' => $author->get_canonical_url(),
925
  );
926
  }
927
 
 
 
 
 
 
928
  private static function get_404_archive_data() {
929
  return array(
930
  'replacements' => array(),
@@ -932,27 +1002,47 @@ class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
932
  );
933
  }
934
 
 
 
 
 
 
935
  private static function get_search_archive_data() {
936
  $search_query = esc_html__( 'Example search query', 'wds' );
937
- $search = new Smartcrawl_Search_Page( $search_query );
 
938
  return array(
939
  'replacements' => $search->get_resolved_macros(),
940
  'url' => get_search_link( $search_query ),
941
  );
942
  }
943
 
 
 
 
 
 
944
  private static function get_date_archive_data() {
945
- $month = date( 'n' );
946
- $year = date( 'Y' );
947
- $date = new Smartcrawl_Date_Archive( $year, $month );
 
948
  return array(
949
  'replacements' => $date->get_resolved_macros(),
950
  'url' => $date->get_canonical_url(),
951
  );
952
  }
953
 
 
 
 
 
 
 
 
954
  private static function get_pt_archive_data( $post_type_object ) {
955
  $post_type = new Smartcrawl_Post_Type( $post_type_object );
 
956
  return array(
957
  'replacements' => $post_type->get_resolved_macros(),
958
  'url' => $post_type->get_canonical_url(),
1
  <?php
2
+ /**
3
+ * On page settings
4
+ *
5
+ * @package Smartcrawl
6
+ */
7
+
8
+ /**
9
+ * Class Smartcrawl_Onpage_Settings
10
+ */
11
  class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
12
 
13
+ use Smartcrawl_Singleton;
 
 
 
 
 
 
14
 
15
+ const PT_ARCHIVE_PREFIX = 'pt-archive-';
 
16
 
17
  /**
18
  * Validate submitted options
19
  *
20
+ * @param array $input Raw input.
21
  *
22
  * @return array Validated input
23
  */
24
  public function validate( $input ) {
25
  $result = array();
26
 
27
+ // Setup.
28
  if ( ! empty( $input['wds_onpage-setup'] ) ) {
29
  $result['wds_onpage-setup'] = true;
30
  }
31
 
32
  foreach ( array( 'main_blog_archive', 'search', 'bp_groups', 'bp_profile' ) as $type ) {
33
+ // Meta robots.
34
+ if ( ! empty( $input[ "meta_robots-noindex-$type" ] ) ) {
35
+ $result[ "meta_robots-noindex-$type" ] = true;
36
  }
37
+ if ( ! empty( $input[ "meta_robots-nofollow-$type" ] ) ) {
38
+ $result[ "meta_robots-nofollow-$type" ] = true;
39
  }
40
+ if ( ! empty( $input[ "meta_robots-$type-subsequent_pages" ] ) ) {
41
+ $result[ "meta_robots-$type-subsequent_pages" ] = true;
42
  }
43
  }
44
 
45
+ $tax_options = $this->get_tax_options( '' );
46
  foreach ( $tax_options as $option => $_tax ) {
47
  $rbts = $this->get_robots_options_for( $option );
48
  if ( ! empty( $rbts ) && is_array( $rbts ) ) {
53
  }
54
  }
55
  }
56
+ $other_options = $this->get_other_types_options( '' );
57
  foreach ( $other_options as $option => $_tax ) {
58
  $rbts = $this->get_robots_options_for( $option );
59
  if ( ! empty( $rbts ) && is_array( $rbts ) ) {
76
  }
77
  }
78
 
79
+ // String values.
80
  $strings = array(
81
  'home',
82
  'search',
86
  );
87
  foreach ( get_post_types( array( 'public' => true ) ) as $pt ) {
88
  $strings[] = $pt;
89
+ // Allow post types robots noindex/nofollow.
90
+ if ( ! empty( $input[ "meta_robots-noindex-{$pt}" ] ) ) {
91
+ $result[ "meta_robots-noindex-{$pt}" ] = true;
92
  }
93
+ if ( ! empty( $input[ "meta_robots-nofollow-{$pt}" ] ) ) {
94
+ $result[ "meta_robots-nofollow-{$pt}" ] = true;
95
  }
96
  }
97
  $strings = array_merge( $strings, array_values( $tax_options ) );
99
  $strings = array_merge( $strings, $archive_post_types );
100
 
101
  foreach ( $strings as $str ) {
102
+ if ( isset( $input[ "title-{$str}" ] ) ) {
103
+ $result[ "title-{$str}" ] = smartcrawl_sanitize_preserve_macros( $input[ "title-{$str}" ] );
104
  }
105
+ if ( isset( $input[ "metadesc-{$str}" ] ) ) {
106
+ $result[ "metadesc-{$str}" ] = smartcrawl_sanitize_preserve_macros( $input[ "metadesc-{$str}" ] );
107
  }
108
 
109
+ // OpenGraph.
110
+ if ( isset( $input[ "og-active-{$str}" ] ) ) {
111
+ $result[ "og-active-{$str}" ] = (bool) $input[ "og-active-{$str}" ];
112
  }
113
+ if ( isset( $input[ "og-title-{$str}" ] ) ) {
114
+ $result[ "og-title-{$str}" ] = smartcrawl_sanitize_preserve_macros( $input[ "og-title-{$str}" ] );
115
  }
116
+ if ( isset( $input[ "og-description-{$str}" ] ) ) {
117
+ $result[ "og-description-{$str}" ] = smartcrawl_sanitize_preserve_macros( $input[ "og-description-{$str}" ] );
118
  }
119
 
120
+ $result[ "og-images-{$str}" ] = array();
121
+ if ( ! empty( $input[ "og-images-{$str}" ] ) && is_array( $input[ "og-images-{$str}" ] ) ) {
122
+ foreach ( $input[ "og-images-{$str}" ] as $img ) {
123
+ $result[ "og-images-{$str}" ][] = is_numeric( $img ) ? intval( $img ) : esc_url( $img );
124
  }
125
  }
126
+ $result[ "og-images-{$str}" ] = array_values( array_filter( array_unique( $result[ "og-images-{$str}" ] ) ) );
127
+ if ( isset( $input[ "og-disable-first-image-{$str}" ] ) ) {
128
+ $result[ "og-disable-first-image-{$str}" ] = (bool) $input[ "og-disable-first-image-{$str}" ];
129
  }
130
 
131
+ // Twitter cards.
132
+ if ( isset( $input[ "twitter-active-{$str}" ] ) ) {
133
+ $result[ "twitter-active-{$str}" ] = (bool) $input[ "twitter-active-{$str}" ];
134
  }
135
+ if ( isset( $input[ "twitter-title-{$str}" ] ) ) {
136
+ $result[ "twitter-title-{$str}" ] = smartcrawl_sanitize_preserve_macros( $input[ "twitter-title-{$str}" ] );
137
  }
138
+ if ( isset( $input[ "twitter-description-{$str}" ] ) ) {
139
+ $result[ "twitter-description-{$str}" ] = smartcrawl_sanitize_preserve_macros( $input[ "twitter-description-{$str}" ] );
140
  }
141
 
142
+ $result[ "twitter-images-{$str}" ] = array();
143
+ if ( ! empty( $input[ "twitter-images-{$str}" ] ) && is_array( $input[ "twitter-images-{$str}" ] ) ) {
144
+ foreach ( $input[ "twitter-images-{$str}" ] as $img ) {
145
+ $result[ "twitter-images-{$str}" ][] = is_numeric( $img ) ? intval( $img ) : esc_url( $img );
146
  }
147
  }
148
+ $result[ "twitter-images-{$str}" ] = array_values( array_filter( array_unique( $result[ "twitter-images-{$str}" ] ) ) );
149
+ if ( isset( $input[ "twitter-disable-first-image-{$str}" ] ) ) {
150
+ $result[ "twitter-disable-first-image-{$str}" ] = (bool) $input[ "twitter-disable-first-image-{$str}" ];
151
  }
152
  }
153
 
154
+ $result['enable-author-archive'] = isset( $input['enable-author-archive'] ) && (bool) $input['enable-author-archive'];
155
+ $result['enable-date-archive'] = isset( $input['enable-date-archive'] ) && (bool) $input['enable-date-archive'];
 
 
 
 
156
 
157
  if ( isset( $input['preset-separator'] ) ) {
158
  $result['preset-separator'] = sanitize_text_field( $input['preset-separator'] );
185
  return $result;
186
  }
187
 
188
+ /**
189
+ * Sanitize and include character lengths.
190
+ *
191
+ * @param array $result Result data.
192
+ * @param array $input Input data.
193
+ * @param string $toggle_name Toggle name.
194
+ * @param string $min_field_name Min field name.
195
+ * @param string $max_field_name Max field name.
196
+ * @param int $default_min Default min value.
197
+ * @param int $default_max Default max value.
198
+ *
199
+ * @return array
200
+ */
201
  private function sanitize_and_include_char_lengths( $result, $input, $toggle_name, $min_field_name, $max_field_name, $default_min, $default_max ) {
202
+ $result[ $toggle_name ] = ! empty( $input[ $toggle_name ] );
203
  $custom_title_min_length = (int) smartcrawl_get_array_value( $input, $min_field_name );
204
  if ( $custom_title_min_length > 0 ) {
205
  $result[ $min_field_name ] = $custom_title_min_length;
221
  /**
222
  * Spawn taxonomy options and names, indexed by taxonomy option names
223
  *
224
+ * @param string $pfx Prefix options with this.
225
  *
226
  * @return array
227
  */
228
+ protected function get_tax_options( $pfx = '' ) {
229
+ $pfx = ! empty( $pfx ) ? rtrim( $pfx, '_' ) . '_' : $pfx;
230
  $opts = array();
231
  foreach ( get_taxonomies( array( '_builtin' => false ), 'objects' ) as $taxonomy ) {
232
+ $name = $pfx . str_replace( '-', '_', $taxonomy->name );
233
  $opts[ $name ] = $taxonomy->name;
234
  }
235
 
237
  }
238
 
239
  /**
240
+ * Spawns a set of robots options for a given type.
241
  *
242
+ * @param string $type Archives type to generate the robots options for.
243
+ * @param bool $include_subsequent_pages_option Whether to include the subsequent pages option.
244
+ * @param string $context Context.
245
  *
246
+ * @return array Generated meta robots option array.
247
  */
248
  public static function get_robots_options_for( $type, $include_subsequent_pages_option = true, $context = '' ) {
249
  $options = array(
261
  );
262
 
263
  if ( $include_subsequent_pages_option ) {
264
+ $options[ 'meta_robots-' . $type . '-subsequent_pages' ] = array(
265
  'label' => esc_html__( 'Apply to all pages except the first', 'wds' ),
266
  'description' => esc_html__( 'If you select this option, the first page will be left alone, but the indexing settings will be applied to subsequent pages.', 'wds' ),
267
  );
270
  return $options;
271
  }
272
 
273
+ /**
274
+ * Sitemap notice render.
275
+ *
276
+ * @param string $type Notice type.
277
+ *
278
+ * @return false|mixed|string
279
+ */
280
  private static function sitemap_notice( $type ) {
281
  $sitemap_enabled = Smartcrawl_Sitemap_Utils::sitemap_enabled();
282
  if ( ! $sitemap_enabled ) {
284
  }
285
 
286
  $message = smartcrawl_format_link(
287
+ // translators: %s target.
288
  esc_html__( 'You might want to exclude this type from the %s as well.', 'wds' ),
289
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP ),
290
  esc_html__( 'sitemap', 'wds' )
291
  );
292
  $options = Smartcrawl_Settings::get_options();
293
+ $indexed = empty( $options[ 'meta_robots-noindex-' . $type ] );
294
+ $class = 'sui-notice-info';
295
  if ( $indexed ) {
296
  $class .= ' hidden';
297
  }
298
 
299
+ return Smartcrawl_Simple_Renderer::load(
300
+ 'notice',
301
+ array(
302
+ 'class' => $class,
303
+ 'message' => $message,
304
+ )
305
+ );
306
  }
307
 
308
  /**
309
  * Spawn taxonomy options and names, indexed by taxonomy option names
310
  *
311
+ * @param string $pfx Prefix options with this.
312
  *
313
  * @return array
314
  */
315
+ protected function get_other_types_options( $pfx = '' ) {
316
+ $pfx = ! empty( $pfx ) ? rtrim( $pfx, '_' ) . '_' : $pfx;
317
+ $opts = array();
318
  $other_types = array(
319
  'category',
320
  'post_tag',
322
  'date',
323
  );
324
  foreach ( $other_types as $value ) {
325
+ $name = $pfx . $value;
326
  $opts[ $name ] = $value;
327
  }
328
 
329
  return $opts;
330
  }
331
 
332
+ /**
333
+ * Get other type context.
334
+ *
335
+ * @param string $prefix Prefix.
336
+ *
337
+ * @return array
338
+ */
339
+ protected function get_other_types_options_context( $prefix = '' ) {
340
  $context_strings = array();
341
+ foreach ( $this->get_other_types_options( '' ) as $option ) {
342
  $context = '';
343
 
344
  if ( in_array( $option, array( 'category', 'post_tag' ), true ) ) {
345
  $tax_object = get_taxonomy( $option );
346
+ $context = strtolower( $tax_object->label );
347
  } elseif ( 'author' === $option ) {
348
  $context = esc_html__( 'author archives', 'wds' );
349
  } elseif ( 'date' === $option ) {
350
  $context = esc_html__( 'date archives', 'wds' );
351
  }
352
 
353
+ $context_strings[ $prefix . $option ] = $context;
354
  }
355
 
356
  return $context_strings;
357
  }
358
 
359
+ /**
360
+ * Init the module.
361
+ *
362
+ * @return void
363
+ */
364
  public function init() {
365
  $this->option_name = 'wds_onpage_options';
366
+ $this->name = Smartcrawl_Settings::COMP_ONPAGE;
367
+ $this->slug = Smartcrawl_Settings::TAB_ONPAGE;
368
+ $this->action_url = admin_url( 'options.php' );
369
+ $this->page_title = __( 'SmartCrawl Wizard: Title & Meta', 'wds' );
370
 
371
  add_action( 'wp_ajax_wds-onpage-save-static-home', array( $this, 'json_save_static_homepage_meta' ) );
372
 
373
  parent::init();
 
374
  }
375
 
376
+ /**
377
+ * Get the title.
378
+ *
379
+ * @return string
380
+ */
381
  public function get_title() {
382
  return __( 'Title & Meta', 'wds' );
383
  }
384
 
385
+ /**
386
+ * Save home page meta data.
387
+ *
388
+ * @return void
389
+ */
390
  public function json_save_static_homepage_meta() {
391
  $request_data = $this->get_request_data();
392
+ $front_page = get_post( (int) get_option( 'page_on_front' ) );
393
 
394
  $title = smartcrawl_get_array_value( $request_data, array( 'wds_onpage_options', 'title-static-home' ) );
395
  if ( $title ) {
398
  delete_post_meta( $front_page->ID, '_wds_title' );
399
  }
400
 
401
+ $description = smartcrawl_get_array_value(
402
+ $request_data,
403
+ array(
404
+ 'wds_onpage_options',
405
+ 'metadesc-static-home',
406
+ )
407
+ );
408
  if ( $description ) {
409
  update_post_meta( $front_page->ID, '_wds_metadesc', smartcrawl_sanitize_preserve_macros( $description ) );
410
  } else {
412
  }
413
 
414
  $metabox = Smartcrawl_Metabox::get();
415
+ $metabox->save_opengraph_meta( $front_page->ID, stripslashes_deep( $request_data['wds-opengraph'] ) );
416
+ $metabox->save_twitter_post_meta( $front_page->ID, stripslashes_deep( $request_data['wds-twitter'] ) );
 
 
 
 
 
 
417
  $metabox->save_robots_meta( $front_page, $request_data );
418
 
419
  wp_send_json( array( 'success' => true ) );
420
  }
421
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
  /**
423
  * Add admin settings page
424
  */
425
  public function options_page() {
426
  parent::options_page();
427
 
 
 
428
  $arguments = array(
429
  'meta_robots_main_blog_archive' => self::get_robots_options_for( 'main_blog_archive', true, esc_html__( 'this website', 'wds' ) ),
430
  );
431
 
432
+ foreach ( $this->get_tax_options( 'meta_robots_' ) as $option => $tax ) {
433
+ $tax = str_replace( '-', '_', $tax );
434
  $tax_object = get_taxonomy( $tax );
435
  if ( empty( $arguments[ $option ] ) ) {
436
+ $tax_label = empty( $tax_object->label ) ? '' : $tax_object->label;
437
  $arguments[ $option ] = self::get_robots_options_for( $tax, true, strtolower( $tax_label ) );
438
  }
439
  }
440
 
441
+ foreach ( $this->get_other_types_options( 'meta_robots_' ) as $option => $value ) {
442
+ $context_strings = $this->get_other_types_options_context( 'meta_robots_' );
443
  if ( empty( $arguments[ $option ] ) ) {
444
  $arguments[ $option ] = self::get_robots_options_for( $value, true, smartcrawl_get_array_value( $context_strings, $option ) );
445
  }
447
 
448
  $archive_post_types = smartcrawl_get_archive_post_type_labels();
449
  foreach ( $archive_post_types as $archive_post_type => $archive_post_type_label ) {
450
+ // translators: %s post type.
451
  $pt_archive_context = sprintf( esc_html__( '%s archive', 'wds' ), strtolower( $archive_post_type_label ) );
452
+
453
  $arguments['archive_post_type_robots'][ $archive_post_type ] = self::get_robots_options_for( $archive_post_type, true, $pt_archive_context );
454
  }
455
  $arguments['archive_post_types'] = $archive_post_types;
460
  esc_html__( 'search page', 'wds' )
461
  );
462
 
463
+ // Allow for post type options.
464
  foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $post_type ) {
465
  /**
466
+ * Post type.
467
+ *
468
  * @var $post_type WP_Post_Type
469
  */
470
  $arguments['post_robots'][ $post_type->name ] = self::get_robots_options_for( $post_type->name, false, strtolower( $post_type->label ) );
482
 
483
  $arguments['separators'] = smartcrawl_get_separators();
484
 
485
+ $static_homepage = 'page' === get_option( 'show_on_front' );
486
+ $front_page = get_post( (int) get_option( 'page_on_front' ) );
487
  $show_static_home_settings = $static_homepage && $front_page;
488
 
489
+ $arguments['front_page'] = $front_page;
490
+ $arguments['front_page_notice'] = $this->static_frontpage_notice( $front_page );
491
  $arguments['show_static_home_settings'] = $show_static_home_settings;
492
+ $default_tab = $show_static_home_settings ? 'tab_static_homepage' : 'tab_homepage';
493
 
494
+ $arguments['active_tab'] = $this->get_active_tab( $default_tab );
495
 
496
  $arguments['meta_robots_bp_groups'] = self::get_robots_options_for(
497
  'bp_groups',
506
  );
507
 
508
  wp_enqueue_script( Smartcrawl_Controller_Assets::ONPAGE_JS );
509
+ $this->render_page( 'onpage/onpage-settings', $arguments );
510
  }
511
 
512
+ /**
513
+ * Static front page notice.
514
+ *
515
+ * @param int $front_page Page ID.
516
+ *
517
+ * @return false|mixed
518
+ */
519
  private function static_frontpage_notice( $front_page ) {
520
  ob_start();
521
  esc_html_e( 'Your homepage is set to a static page, Homepage. You can edit your homepage meta from here, as well as in the WordPress editor for that page.', 'wds' );
522
  if ( $front_page ) {
523
  ?>
524
  <br/>
525
+ <a
526
+ type="button"
527
+ href="<?php echo esc_attr( get_edit_post_link( $front_page ) ); ?>"
528
+ class="sui-button" style="margin-top: 10px"
529
+ >
530
  <?php esc_html_e( 'Go To Homepage', 'wds' ); ?></a>
531
  <?php
532
  }
533
 
534
+ return $this->load_view(
535
+ 'notice',
536
+ array(
537
+ 'message' => ob_get_clean(),
538
+ 'class' => 'sui-notice-info',
539
+ )
540
+ );
541
  }
542
 
543
+ /**
544
+ * Get singular macros.
545
+ *
546
+ * @param string $post_type Post type.
547
+ *
548
+ * @return array
549
+ */
550
  public static function get_singular_macros( $post_type = '' ) {
551
  $singular_macros = array(
552
  '%%id%%' => __( 'Post/page ID', 'wds' ),
560
  '%%user_description%%' => __( "Post/page author's description", 'wds' ),
561
  );
562
 
563
+ if ( empty( $post_type ) || 'attachment' === $post_type ) {
564
  $singular_macros['%%caption%%'] = __( 'Attachment caption', 'wds' );
565
  }
566
 
567
+ if ( empty( $post_type ) || 'post' === $post_type ) {
568
  $singular_macros['%%category%%'] = __( 'Post categories (comma separated)', 'wds' );
569
+ $singular_macros['%%tag%%'] = __( 'Current tag/tags', 'wds' );
570
  }
571
 
572
  return $singular_macros;
573
  }
574
 
575
  /**
576
+ * Get term macros.
577
+ *
578
+ * @param string $taxonomy Taxonomy.
579
  *
580
  * @return array
581
  */
586
  '%%term_description%%' => __( 'Term description', 'wds' ),
587
  );
588
 
589
+ if ( empty( $taxonomy ) || 'category' === $taxonomy ) {
590
+ $term_macros['%%category%%'] = __( 'Category name', 'wds' );
591
  $term_macros['%%category_description%%'] = __( 'Category description', 'wds' );
592
  }
593
 
594
+ if ( empty( $taxonomy ) || 'post_tag' === $taxonomy ) {
595
+ $term_macros['%%tag%%'] = __( 'Tag name', 'wds' );
596
  $term_macros['%%tag_description%%'] = __( 'Tag description', 'wds' );
597
  }
598
 
599
  return $term_macros;
600
  }
601
 
602
+ /**
603
+ * Get general macros.
604
+ *
605
+ * @return array
606
+ */
607
  public static function get_general_macros() {
608
  return array(
609
  '%%sep%%' => __( 'Separator', 'wds' ),
622
  );
623
  }
624
 
625
+ /**
626
+ * Get BP profile macros.
627
+ *
628
+ * @return array
629
+ */
630
  public static function get_bp_profile_macros() {
631
+ return array(
632
  '%%bp_user_username%%' => __( 'BuddyPress username', 'wds' ),
633
  '%%bp_user_full_name%%' => __( "BuddyPress user's full name", 'wds' ),
634
  );
 
 
635
  }
636
 
637
+ /**
638
+ * Get BP group macros.
639
+ *
640
+ * @return array
641
+ */
642
  public static function get_bp_group_macros() {
643
+ return array(
644
  '%%bp_group_name%%' => __( 'BuddyPress group name', 'wds' ),
645
  '%%bp_group_description%%' => __( 'BuddyPress group description', 'wds' ),
646
  );
 
 
647
  }
648
 
649
+ /**
650
+ * @return array
651
+ */
652
  public static function get_pt_archive_macros() {
653
  return array(
654
  '%%pt_plural%%' => __( 'Post type label plural', 'wds' ),
656
  );
657
  }
658
 
659
+ /**
660
+ * Get search macros.
661
+ *
662
+ * @return array
663
+ */
664
  public static function get_search_macros() {
665
  return array(
666
  '%%searchphrase%%' => __( 'Current search phrase', 'wds' ),
667
  );
668
  }
669
 
670
+ /**
671
+ * Get author macros.
672
+ *
673
+ * @return array
674
+ */
675
  public static function get_author_macros() {
676
  return array(
677
  '%%name%%' => __( "Author's 'nicename'", 'wds' ),
680
  );
681
  }
682
 
683
+ /**
684
+ * Get date macros.
685
+ *
686
+ * @return array
687
+ */
688
  public static function get_date_macros() {
689
  return array(
690
  '%%date%%' => __( 'Date of the archive', 'wds' ),
692
  }
693
 
694
  /**
695
+ * Default settings.
696
  */
697
  public function defaults() {
698
  $this->options = get_option( $this->option_name );
717
  $this->options['onpage-disable-automatic-regeneration'] = 0;
718
  }
719
 
 
 
 
 
 
 
 
 
720
  foreach ( get_post_types( array( 'public' => true ) ) as $posttype ) {
721
  if ( in_array( $posttype, array( 'revision', 'nav_menu_item' ), true ) ) {
722
  continue;
820
  }
821
 
822
  /**
823
+ * Get request data.
824
+ *
825
  * @return array
826
  */
827
  private function get_request_data() {
828
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wds_nonce'] ), 'wds-onpage-nonce' ) ? $_POST : array(); // phpcs:ignore
829
  }
830
 
831
+ /**
832
+ * Get random post data.
833
+ *
834
+ * @return array
835
+ */
836
  public static function get_random_post_data() {
837
  /**
838
+ * Post type.
839
+ *
840
  * @var $post_types WP_Post_Type
841
  */
842
+ $post_types = get_post_types(
843
+ array(
844
+ 'public' => true,
845
+ 'show_ui' => true,
846
+ ),
847
+ 'objects'
848
+ );
849
 
850
  $data = array();
851
  foreach ( $post_types as $post_type ) {
852
+ $posts = get_posts(
853
+ array(
854
+ 'post_status' => array( 'publish', 'inherit' ),
855
+ 'order' => 'DESC',
856
+ 'orderby' => 'ID',
857
+ 'posts_per_page' => 1,
858
+ 'post_type' => $post_type->name,
859
+ )
860
+ );
861
 
862
  if ( ! empty( $posts ) ) {
863
  $data[ $post_type->name ] = self::get_post_data( $posts[0] );
865
  }
866
 
867
  $show_static_page = get_option( 'show_on_front' ) === 'page';
868
+ $static_page = get_post( (int) get_option( 'page_on_front' ) );
869
  if ( $show_static_page && $static_page ) {
870
  $data['static-home'] = self::get_post_data( get_post( (int) get_option( 'page_on_front' ) ) );
871
  }
874
  }
875
 
876
  /**
877
+ * Get post data.
878
+ *
879
+ * @param WP_Post $post Post data.
880
  *
881
  * @return array
882
  */
883
  public static function get_post_data( $post ) {
884
  $post_data = $post->to_array();
885
 
886
+ $terms = wp_get_object_terms( $post->ID, get_post_taxonomies( $post ) );
887
  $taxonomy_terms = array();
888
  foreach ( $terms as $term ) {
889
  $taxonomy_terms[ $term->taxonomy ][] = $term->term_id;
890
  }
891
 
892
  $post_data['taxonomy_terms'] = $taxonomy_terms;
893
+ $post_data['permalink'] = get_permalink( $post );
894
 
895
  return $post_data;
896
  }
897
 
898
+ /**
899
+ * Get random terms.
900
+ *
901
+ * @return array
902
+ */
903
  public static function get_random_terms() {
904
+ $data = array();
905
  $taxonomies = get_taxonomies( array(), 'objects' );
906
  foreach ( $taxonomies as $taxonomy ) {
907
+ $terms = get_terms(
908
+ array(
909
+ 'orderby' => 'term_id',
910
+ 'order' => 'DESC',
911
+ 'number' => 1,
912
+ 'taxonomy' => $taxonomy->name,
913
+ 'hide_empty' => false,
914
+ )
915
+ );
916
 
917
  if ( ! empty( $terms ) ) {
918
+ $term = array_shift( $terms );
919
+ $data[ $taxonomy->name ] = $term->to_array();
920
  $data[ $taxonomy->name ]['permalink'] = get_term_link( $term );
921
  }
922
  }
924
  return $data;
925
  }
926
 
927
+ /**
928
+ * Get random BuddyPress data.
929
+ *
930
+ * @return array
931
+ */
932
  public static function get_random_buddypress() {
933
  $buddypress_api = new Smartcrawl_Buddypress_Api();
934
  if ( ! $buddypress_api->buddypress() ) {
935
  return array();
936
  }
937
 
938
+ $data = array();
939
  $buddypress_profile = new Smartcrawl_Buddypress_Profile( wp_get_current_user() );
940
  $data['bp_profile'] = array(
941
  'replacements' => $buddypress_profile->get_resolved_macros(),
955
  return $data;
956
  }
957
 
958
+ /**
959
+ * Get random archives.
960
+ *
961
+ * @return array
962
+ */
963
  public static function get_random_archives() {
964
  $archives = array(
965
  'author' => self::get_author_archive_data(),
976
  return $archives;
977
  }
978
 
979
+ /**
980
+ * Get author archive data.
981
+ *
982
+ * @return array
983
+ */
984
  private static function get_author_archive_data() {
985
  $author = new Smartcrawl_Post_Author( wp_get_current_user() );
986
+
987
  return array(
988
  'replacements' => $author->get_resolved_macros(),
989
  'url' => $author->get_canonical_url(),
990
  );
991
  }
992
 
993
+ /**
994
+ * Get 404 archive data.
995
+ *
996
+ * @return array
997
+ */
998
  private static function get_404_archive_data() {
999
  return array(
1000
  'replacements' => array(),
1002
  );
1003
  }
1004
 
1005
+ /**
1006
+ * Get search archive data.
1007
+ *
1008
+ * @return array
1009
+ */
1010
  private static function get_search_archive_data() {
1011
  $search_query = esc_html__( 'Example search query', 'wds' );
1012
+ $search = new Smartcrawl_Search_Page( $search_query );
1013
+
1014
  return array(
1015
  'replacements' => $search->get_resolved_macros(),
1016
  'url' => get_search_link( $search_query ),
1017
  );
1018
  }
1019
 
1020
+ /**
1021
+ * Get date archive data.
1022
+ *
1023
+ * @return array
1024
+ */
1025
  private static function get_date_archive_data() {
1026
+ $month = date( 'n' ); // phpcs:ignore
1027
+ $year = date( 'Y' ); // phpcs:ignore
1028
+ $date = new Smartcrawl_Date_Archive( $year, $month );
1029
+
1030
  return array(
1031
  'replacements' => $date->get_resolved_macros(),
1032
  'url' => $date->get_canonical_url(),
1033
  );
1034
  }
1035
 
1036
+ /**
1037
+ * Get post type archive data.
1038
+ *
1039
+ * @param WP_Post_Type $post_type_object Post type.
1040
+ *
1041
+ * @return array
1042
+ */
1043
  private static function get_pt_archive_data( $post_type_object ) {
1044
  $post_type = new Smartcrawl_Post_Type( $post_type_object );
1045
+
1046
  return array(
1047
  'replacements' => $post_type->get_resolved_macros(),
1048
  'url' => $post_type->get_canonical_url(),
includes/admin/settings/schema.php CHANGED
@@ -1,15 +1,8 @@
1
  <?php
2
 
3
  class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
4
- private static $_instance;
5
 
6
- public static function get_instance() {
7
- if ( empty( self::$_instance ) ) {
8
- self::$_instance = new self();
9
- }
10
-
11
- return self::$_instance;
12
- }
13
 
14
  public function validate( $input ) {
15
  $input = $this->validate_and_save_social_options( $input );
@@ -28,10 +21,16 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
28
  return $validated;
29
  }
30
 
 
 
 
31
  public function get_title() {
32
  return __( 'Schema', 'wds' );
33
  }
34
 
 
 
 
35
  public function defaults() {
36
  $options = Smartcrawl_Settings::get_component_options( $this->name );
37
  $options = is_array( $options ) ? $options : array();
@@ -45,12 +44,15 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
45
  Smartcrawl_Settings::update_component_options( $this->name, $options );
46
  }
47
 
 
 
 
48
  public function init() {
49
  $this->option_name = 'wds_schema_options';
50
- $this->name = Smartcrawl_Settings::COMP_SCHEMA;
51
- $this->slug = Smartcrawl_Settings::TAB_SCHEMA;
52
- $this->action_url = admin_url( 'options.php' );
53
- $this->page_title = __( 'SmartCrawl Wizard: Schema', 'wds' );
54
 
55
  add_action( 'wp_ajax_wds-change-schema-status', array( $this, 'change_schema_component_status' ) );
56
  add_action( 'wp_ajax_wds-authorize-yt-api-key', array( $this, 'authorize_youtube_api_key' ) );
@@ -60,55 +62,67 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
60
  parent::init();
61
  }
62
 
 
 
 
63
  public function format_schema_location() {
64
- $conditions = $_GET['conditions'];
65
 
66
- $count = - 1;
67
  $summary_item = false;
68
- $or_texts = array();
69
  foreach ( $conditions as $condition_group ) {
70
  $and_texts = array();
71
  foreach ( $condition_group as $condition ) {
72
  $count ++;
73
 
74
- $lhs = smartcrawl_get_array_value( $condition, 'lhs' );
75
  $lhs_text = $this->get_lhs_text( $lhs );
76
 
77
- $operator = smartcrawl_get_array_value( $condition, 'operator' );
78
- $operator_text = $operator === '=' ? '=' : '≠';
79
 
80
- $rhs = smartcrawl_get_array_value( $condition, 'rhs' );
81
  $rhs_text = $this->get_rhs_text( $lhs, $rhs );
82
 
83
- if ( $lhs === 'show_globally' || $lhs === 'homepage' ) {
84
  $and_texts[] = $lhs_text;
85
  if ( ! $summary_item ) {
86
  $summary_item = $lhs_text;
87
  }
88
  } else {
89
- $and_texts[] = sprintf( "%s %s %s", $lhs_text, $operator_text, $rhs_text );
90
  if ( ! $summary_item ) {
91
  $summary_item = $rhs_text;
92
  }
93
  }
94
  }
95
 
96
- $and_text = implode( ' & ', $and_texts );
97
  $or_texts[] = $and_text;
98
  }
99
 
100
- $full_text = join( ' OR ', $or_texts );
101
  $summary_text = $summary_item;
102
  if ( $count ) {
103
  $summary_text = sprintf( '%s, +%d more', $summary_text, $count );
104
  }
105
 
106
- wp_send_json( array(
107
- 'full' => $full_text,
108
- 'summary' => $summary_text,
109
- ) );
 
 
110
  }
111
 
 
 
 
 
 
 
 
112
  private function get_lhs_text( $lhs ) {
113
  $texts = array(
114
  'post_type' => __( 'Post type', 'wds' ),
@@ -123,9 +137,12 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
123
  return $texts[ $lhs ];
124
  }
125
 
126
- $post_types = array_map( function ( $post_type ) {
127
- return get_post_type_object( $post_type )->labels->singular_name;
128
- }, smartcrawl_frontend_post_types() );
 
 
 
129
  if ( isset( $post_types[ $lhs ] ) ) {
130
  return $post_types[ $lhs ];
131
  }
@@ -138,6 +155,14 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
138
  return '';
139
  }
140
 
 
 
 
 
 
 
 
 
141
  private function get_rhs_text( $lhs, $rhs ) {
142
  $product_types = array(
143
  'WC_Product_Variable' => __( 'Variable Product', 'wds' ),
@@ -148,6 +173,7 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
148
  switch ( $lhs ) {
149
  case 'post_type':
150
  $post_type = get_post_type_object( $rhs );
 
151
  return $post_type ? $post_type->labels->singular_name : '';
152
 
153
  case 'show_globally':
@@ -164,6 +190,7 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
164
 
165
  case 'page_template':
166
  $page_templates = wp_get_theme()->get_page_templates();
 
167
  return isset( $page_templates[ $rhs ] )
168
  ? $page_templates[ $rhs ]
169
  : '';
@@ -172,14 +199,16 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
172
  return (string) smartcrawl_get_array_value( $product_types, $rhs );
173
  }
174
 
175
- if ( in_array( $lhs, smartcrawl_frontend_post_types() ) ) {
176
  $post = get_post( $rhs );
 
177
  return $post ? $post->post_title : '';
178
  }
179
 
180
  $taxonomies = $this->get_taxonomies_singular();
181
  if ( isset( $taxonomies[ $lhs ] ) ) {
182
  $taxonomy_term = get_term( $rhs, $lhs );
 
183
  return $taxonomy_term && ! is_wp_error( $taxonomy_term )
184
  ? $taxonomy_term->name
185
  : '';
@@ -189,15 +218,16 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
189
  }
190
 
191
  public function search_schema_post_meta() {
192
- $search_query = smartcrawl_get_array_value( $_GET, 'term' );
193
- $results = array();
194
  if ( empty( $search_query ) ) {
195
  wp_send_json( array( 'results' => $results ) );
 
196
  return;
197
  }
198
 
199
  global $wpdb;
200
- $meta_keys = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT meta_key from {$wpdb->postmeta} WHERE meta_key LIKE %s", '%' . $wpdb->esc_like( $search_query ) . '%' ) );
201
  foreach ( $meta_keys as $meta_key ) {
202
  $results[] = array(
203
  'id' => $meta_key,
@@ -213,8 +243,8 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
213
  return;
214
  }
215
 
216
- $status = (bool) smartcrawl_get_array_value( $request_data, 'status' );
217
- $social_options = self::get_component_options( self::COMP_SOCIAL );
218
  $social_options['disable-schema'] = ! $status;
219
  self::update_component_options( self::COMP_SOCIAL, $social_options );
220
  }
@@ -225,7 +255,7 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
225
  exit();
226
  }
227
 
228
- $key = smartcrawl_get_array_value( $request_data, 'key' );
229
  $video_info = Smartcrawl_Youtube_Data_Fetcher::get_video_info( 'https://www.youtube.com/watch?v=FfgT6zx4k3Q', $key );
230
  if ( $video_info ) {
231
  wp_send_json_success();
@@ -242,10 +272,10 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
242
  );
243
 
244
  $social_options = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SOCIAL );
245
- $arguments = array(
246
  'options' => $options,
247
  'social_options' => $social_options,
248
- 'active_tab' => $this->_get_active_tab( 'tab_general' ),
249
  'post_types' => $this->get_post_types(),
250
  'taxonomies' => $this->get_taxonomies(),
251
  'pages' => $this->get_pages(),
@@ -255,21 +285,25 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
255
  wp_enqueue_script( Smartcrawl_Controller_Assets::SCHEMA_TYPES_JS );
256
  wp_enqueue_media();
257
 
258
- $this->_render_page( 'schema/schema-settings', $arguments );
259
  }
260
 
261
  private function get_pages() {
262
- $pages = array();
263
- $wp_posts = get_posts( array(
264
- 'post_type' => 'page',
265
- 'post_status' => 'publish',
266
- 'posts_per_page' => - 1,
267
- 'order' => 'ASC',
268
- 'orderby' => 'title',
269
- ) );
 
 
270
 
271
  foreach ( $wp_posts as $page ) {
272
  /**
 
 
273
  * @var $page \WP_Post
274
  */
275
  $pages[ $page->ID ] = $page->post_title;
@@ -279,36 +313,45 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
279
  }
280
 
281
  private function get_taxonomies_singular() {
282
- return array_map( function ( $taxonomy ) {
283
- return isset( $taxonomy->labels->singular_name )
284
- ? $taxonomy->labels->singular_name
285
- : $taxonomy->label;
286
- }, smartcrawl_frontend_taxonomies() );
 
 
 
287
  }
288
 
289
  private function get_taxonomies() {
290
- return array_map( function ( $taxonomy ) {
291
- return $taxonomy->label;
292
- }, smartcrawl_frontend_taxonomies() );
 
 
 
293
  }
294
 
295
  private function get_post_types() {
296
  $post_types = array();
297
  foreach (
298
- get_post_types( array(
299
- 'public' => true,
300
- 'show_ui' => true,
301
- 'has_archive' => true,
302
- ) ) as $post_type
 
 
303
  ) {
304
  if ( in_array( $post_type, array( 'revision', 'nav_menu_item', 'attachment' ), true ) ) {
305
  continue;
306
  }
307
- $pt = get_post_type_object( $post_type );
308
  $post_types[ $post_type ] = isset( $pt->labels->archives ) && $pt->labels->archives !== $pt->label
309
  ? $pt->labels->archives
310
  : $pt->label . ' ' . esc_html__( 'Archive', 'wds' );
311
  }
 
312
  return $post_types;
313
  }
314
 
@@ -363,7 +406,7 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
363
  }
364
 
365
  private function get_validation_method( $setting ) {
366
- $text = array(
367
  'sitename',
368
  'schema_type',
369
  'override_name',
@@ -384,7 +427,7 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
384
  'person_bio',
385
  'organization_description',
386
  );
387
- $int = array(
388
  'schema_website_logo',
389
  'person_portrait',
390
  'person_contact_page',
@@ -395,7 +438,7 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
395
  'schema_default_image',
396
  'person_brand_logo',
397
  );
398
- $url = array(
399
  'organization_logo',
400
  'facebook_url',
401
  'instagram_url',
@@ -404,15 +447,15 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
404
  'youtube_url',
405
  );
406
 
407
- if ( in_array( $setting, $text ) ) {
408
  return 'sanitize_text_field';
409
- } else if ( in_array( $setting, $textarea ) ) {
410
  return 'sanitize_textarea_field';
411
- } else if ( in_array( $setting, $url ) ) {
412
  return 'esc_url_raw';
413
- } else if ( in_array( $setting, $int ) ) {
414
  return 'intval';
415
- } else if ( in_array( $setting, $this->get_toggle_settings() ) ) {
416
  return function ( $value ) {
417
  return ! ! $value;
418
  };
@@ -447,11 +490,12 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
447
  }
448
 
449
  Smartcrawl_Settings::update_specific_options( 'wds_social_options', $settings );
 
450
  return $input;
451
  }
452
 
453
  /**
454
- * @return array
455
  */
456
  private function get_toggle_settings() {
457
  return array(
@@ -474,8 +518,11 @@ class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
474
  );
475
  }
476
 
 
 
 
477
  private function get_request_data() {
478
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-schema-nonce' )
479
  ? $_POST
480
  : array();
481
  }
1
  <?php
2
 
3
  class Smartcrawl_Schema_Settings extends Smartcrawl_Settings_Admin {
 
4
 
5
+ use Smartcrawl_Singleton;
 
 
 
 
 
 
6
 
7
  public function validate( $input ) {
8
  $input = $this->validate_and_save_social_options( $input );
21
  return $validated;
22
  }
23
 
24
+ /**
25
+ * @return string
26
+ */
27
  public function get_title() {
28
  return __( 'Schema', 'wds' );
29
  }
30
 
31
+ /**
32
+ * @return void
33
+ */
34
  public function defaults() {
35
  $options = Smartcrawl_Settings::get_component_options( $this->name );
36
  $options = is_array( $options ) ? $options : array();
44
  Smartcrawl_Settings::update_component_options( $this->name, $options );
45
  }
46
 
47
+ /**
48
+ * @return void
49
+ */
50
  public function init() {
51
  $this->option_name = 'wds_schema_options';
52
+ $this->name = Smartcrawl_Settings::COMP_SCHEMA;
53
+ $this->slug = Smartcrawl_Settings::TAB_SCHEMA;
54
+ $this->action_url = admin_url( 'options.php' );
55
+ $this->page_title = __( 'SmartCrawl Wizard: Schema', 'wds' );
56
 
57
  add_action( 'wp_ajax_wds-change-schema-status', array( $this, 'change_schema_component_status' ) );
58
  add_action( 'wp_ajax_wds-authorize-yt-api-key', array( $this, 'authorize_youtube_api_key' ) );
62
  parent::init();
63
  }
64
 
65
+ /**
66
+ * @return void
67
+ */
68
  public function format_schema_location() {
69
+ $conditions = $_GET['conditions']; // phpcs:ignore -- Values are not used directly.
70
 
71
+ $count = - 1;
72
  $summary_item = false;
73
+ $or_texts = array();
74
  foreach ( $conditions as $condition_group ) {
75
  $and_texts = array();
76
  foreach ( $condition_group as $condition ) {
77
  $count ++;
78
 
79
+ $lhs = smartcrawl_get_array_value( $condition, 'lhs' );
80
  $lhs_text = $this->get_lhs_text( $lhs );
81
 
82
+ $operator = smartcrawl_get_array_value( $condition, 'operator' );
83
+ $operator_text = '=' === $operator ? '=' : '≠';
84
 
85
+ $rhs = smartcrawl_get_array_value( $condition, 'rhs' );
86
  $rhs_text = $this->get_rhs_text( $lhs, $rhs );
87
 
88
+ if ( 'show_globally' === $lhs || 'homepage' === $lhs ) {
89
  $and_texts[] = $lhs_text;
90
  if ( ! $summary_item ) {
91
  $summary_item = $lhs_text;
92
  }
93
  } else {
94
+ $and_texts[] = sprintf( '%s %s %s', $lhs_text, $operator_text, $rhs_text );
95
  if ( ! $summary_item ) {
96
  $summary_item = $rhs_text;
97
  }
98
  }
99
  }
100
 
101
+ $and_text = implode( ' & ', $and_texts );
102
  $or_texts[] = $and_text;
103
  }
104
 
105
+ $full_text = join( ' OR ', $or_texts );
106
  $summary_text = $summary_item;
107
  if ( $count ) {
108
  $summary_text = sprintf( '%s, +%d more', $summary_text, $count );
109
  }
110
 
111
+ wp_send_json(
112
+ array(
113
+ 'full' => $full_text,
114
+ 'summary' => $summary_text,
115
+ )
116
+ );
117
  }
118
 
119
+ /**
120
+ * Get LHS text.
121
+ *
122
+ * @param string $lhs Lhs.
123
+ *
124
+ * @return mixed|string
125
+ */
126
  private function get_lhs_text( $lhs ) {
127
  $texts = array(
128
  'post_type' => __( 'Post type', 'wds' ),
137
  return $texts[ $lhs ];
138
  }
139
 
140
+ $post_types = array_map(
141
+ function ( $post_type ) {
142
+ return get_post_type_object( $post_type )->labels->singular_name;
143
+ },
144
+ smartcrawl_frontend_post_types()
145
+ );
146
  if ( isset( $post_types[ $lhs ] ) ) {
147
  return $post_types[ $lhs ];
148
  }
155
  return '';
156
  }
157
 
158
+ /**
159
+ * GFet RHS text.
160
+ *
161
+ * @param string $lhs LHS.
162
+ * @param string $rhs RHS.
163
+ *
164
+ * @return string
165
+ */
166
  private function get_rhs_text( $lhs, $rhs ) {
167
  $product_types = array(
168
  'WC_Product_Variable' => __( 'Variable Product', 'wds' ),
173
  switch ( $lhs ) {
174
  case 'post_type':
175
  $post_type = get_post_type_object( $rhs );
176
+
177
  return $post_type ? $post_type->labels->singular_name : '';
178
 
179
  case 'show_globally':
190
 
191
  case 'page_template':
192
  $page_templates = wp_get_theme()->get_page_templates();
193
+
194
  return isset( $page_templates[ $rhs ] )
195
  ? $page_templates[ $rhs ]
196
  : '';
199
  return (string) smartcrawl_get_array_value( $product_types, $rhs );
200
  }
201
 
202
+ if ( in_array( $lhs, smartcrawl_frontend_post_types(), true ) ) {
203
  $post = get_post( $rhs );
204
+
205
  return $post ? $post->post_title : '';
206
  }
207
 
208
  $taxonomies = $this->get_taxonomies_singular();
209
  if ( isset( $taxonomies[ $lhs ] ) ) {
210
  $taxonomy_term = get_term( $rhs, $lhs );
211
+
212
  return $taxonomy_term && ! is_wp_error( $taxonomy_term )
213
  ? $taxonomy_term->name
214
  : '';
218
  }
219
 
220
  public function search_schema_post_meta() {
221
+ $search_query = smartcrawl_get_array_value( $_GET, 'term' ); // phpcs:ignore -- Escaped in query.
222
+ $results = array();
223
  if ( empty( $search_query ) ) {
224
  wp_send_json( array( 'results' => $results ) );
225
+
226
  return;
227
  }
228
 
229
  global $wpdb;
230
+ $meta_keys = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT meta_key from {$wpdb->postmeta} WHERE meta_key LIKE %s", '%' . $wpdb->esc_like( $search_query ) . '%' ) ); // phpcs:ignore -- Caching not needed.
231
  foreach ( $meta_keys as $meta_key ) {
232
  $results[] = array(
233
  'id' => $meta_key,
243
  return;
244
  }
245
 
246
+ $status = (bool) smartcrawl_get_array_value( $request_data, 'status' );
247
+ $social_options = self::get_component_options( self::COMP_SOCIAL );
248
  $social_options['disable-schema'] = ! $status;
249
  self::update_component_options( self::COMP_SOCIAL, $social_options );
250
  }
255
  exit();
256
  }
257
 
258
+ $key = smartcrawl_get_array_value( $request_data, 'key' );
259
  $video_info = Smartcrawl_Youtube_Data_Fetcher::get_video_info( 'https://www.youtube.com/watch?v=FfgT6zx4k3Q', $key );
260
  if ( $video_info ) {
261
  wp_send_json_success();
272
  );
273
 
274
  $social_options = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SOCIAL );
275
+ $arguments = array(
276
  'options' => $options,
277
  'social_options' => $social_options,
278
+ 'active_tab' => $this->get_active_tab( 'tab_general' ),
279
  'post_types' => $this->get_post_types(),
280
  'taxonomies' => $this->get_taxonomies(),
281
  'pages' => $this->get_pages(),
285
  wp_enqueue_script( Smartcrawl_Controller_Assets::SCHEMA_TYPES_JS );
286
  wp_enqueue_media();
287
 
288
+ $this->render_page( 'schema/schema-settings', $arguments );
289
  }
290
 
291
  private function get_pages() {
292
+ $pages = array();
293
+ $wp_posts = get_posts(
294
+ array(
295
+ 'post_type' => 'page',
296
+ 'post_status' => 'publish',
297
+ 'posts_per_page' => - 1,
298
+ 'order' => 'ASC',
299
+ 'orderby' => 'title',
300
+ )
301
+ );
302
 
303
  foreach ( $wp_posts as $page ) {
304
  /**
305
+ * Post object.
306
+ *
307
  * @var $page \WP_Post
308
  */
309
  $pages[ $page->ID ] = $page->post_title;
313
  }
314
 
315
  private function get_taxonomies_singular() {
316
+ return array_map(
317
+ function ( $taxonomy ) {
318
+ return isset( $taxonomy->labels->singular_name )
319
+ ? $taxonomy->labels->singular_name
320
+ : $taxonomy->label;
321
+ },
322
+ smartcrawl_frontend_taxonomies()
323
+ );
324
  }
325
 
326
  private function get_taxonomies() {
327
+ return array_map(
328
+ function ( $taxonomy ) {
329
+ return $taxonomy->label;
330
+ },
331
+ smartcrawl_frontend_taxonomies()
332
+ );
333
  }
334
 
335
  private function get_post_types() {
336
  $post_types = array();
337
  foreach (
338
+ get_post_types(
339
+ array(
340
+ 'public' => true,
341
+ 'show_ui' => true,
342
+ 'has_archive' => true,
343
+ )
344
+ ) as $post_type
345
  ) {
346
  if ( in_array( $post_type, array( 'revision', 'nav_menu_item', 'attachment' ), true ) ) {
347
  continue;
348
  }
349
+ $pt = get_post_type_object( $post_type );
350
  $post_types[ $post_type ] = isset( $pt->labels->archives ) && $pt->labels->archives !== $pt->label
351
  ? $pt->labels->archives
352
  : $pt->label . ' ' . esc_html__( 'Archive', 'wds' );
353
  }
354
+
355
  return $post_types;
356
  }
357
 
406
  }
407
 
408
  private function get_validation_method( $setting ) {
409
+ $text = array(
410
  'sitename',
411
  'schema_type',
412
  'override_name',
427
  'person_bio',
428
  'organization_description',
429
  );
430
+ $int = array(
431
  'schema_website_logo',
432
  'person_portrait',
433
  'person_contact_page',
438
  'schema_default_image',
439
  'person_brand_logo',
440
  );
441
+ $url = array(
442
  'organization_logo',
443
  'facebook_url',
444
  'instagram_url',
447
  'youtube_url',
448
  );
449
 
450
+ if ( in_array( $setting, $text, true ) ) {
451
  return 'sanitize_text_field';
452
+ } elseif ( in_array( $setting, $textarea, true ) ) {
453
  return 'sanitize_textarea_field';
454
+ } elseif ( in_array( $setting, $url, true ) ) {
455
  return 'esc_url_raw';
456
+ } elseif ( in_array( $setting, $int, true ) ) {
457
  return 'intval';
458
+ } elseif ( in_array( $setting, $this->get_toggle_settings(), true ) ) {
459
  return function ( $value ) {
460
  return ! ! $value;
461
  };
490
  }
491
 
492
  Smartcrawl_Settings::update_specific_options( 'wds_social_options', $settings );
493
+
494
  return $input;
495
  }
496
 
497
  /**
498
+ * @return string[]
499
  */
500
  private function get_toggle_settings() {
501
  return array(
518
  );
519
  }
520
 
521
+ /**
522
+ * @return array
523
+ */
524
  private function get_request_data() {
525
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wds_nonce'] ), 'wds-schema-nonce' ) // phpcs:ignore -- Sanitization not required for nonce verification.
526
  ? $_POST
527
  : array();
528
  }
includes/admin/settings/settings.php CHANGED
@@ -2,21 +2,12 @@
2
 
3
  class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
4
 
5
-
6
- private static $_instance;
7
-
8
- public static function get_instance() {
9
- if ( empty( self::$_instance ) ) {
10
- self::$_instance = new self();
11
- }
12
-
13
- return self::$_instance;
14
- }
15
 
16
  /**
17
  * Validate submitted options
18
  *
19
- * @param array $input Raw input
20
  *
21
  * @return array Validated input
22
  */
@@ -25,18 +16,18 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
25
 
26
  $disable_schema_key = 'disable-schema';
27
  if ( isset( $input[ $disable_schema_key ] ) ) {
28
- $social_options = self::get_component_options( self::COMP_SOCIAL );
29
  $social_options[ $disable_schema_key ] = ! empty( $input[ $disable_schema_key ] );
30
  self::update_component_options( self::COMP_SOCIAL, $social_options );
31
  unset( $social_options[ $disable_schema_key ] );
32
  }
33
 
34
- // Accessibility
35
  $result['high-contrast'] = ! empty( $input['high-contrast'] );
36
 
37
- // Data settings
38
  $result['keep_settings_on_uninstall'] = ! empty( $input['keep_settings_on_uninstall'] );
39
- $result['keep_data_on_uninstall'] = ! empty( $input['keep_data_on_uninstall'] );
40
 
41
  if ( ! empty( $input['wds_settings-setup'] ) ) {
42
  $result['wds_settings-setup'] = true;
@@ -47,17 +38,17 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
47
  $result[ $bool ] = ! empty( $input[ $bool ] );
48
  }
49
 
50
- // Robots.txt file
51
  if ( isset( $input['robots-txt'] ) ) {
52
  $result['robots-txt'] = ! empty( $input['robots-txt'] );
53
  }
54
- // Analysis/readability
55
- $result['analysis-seo'] = ! empty( $input['analysis-seo'] );
56
  $result['analysis-readability'] = ! empty( $input['analysis-readability'] );
57
- $result['analysis_strategy'] = ! empty( $input['analysis_strategy'] )
58
  ? sanitize_text_field( $input['analysis_strategy'] )
59
  : Smartcrawl_Controller_Analysis_Content::STRATEGY_STRICT;
60
- $result['extras-admin_bar'] = ! empty( $input['extras-admin_bar'] );
61
 
62
  if ( ! empty( $input['redirections-code'] ) && is_numeric( $input['redirections-code'] ) ) {
63
  $code = (int) $input['redirections-code'];
@@ -91,13 +82,13 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
91
  }
92
  }
93
 
94
- // Roles
95
- foreach ( $this->_get_permission_contexts() as $ctx ) {
96
  if ( empty( $input[ $ctx ] ) ) {
97
  continue;
98
  }
99
- $roles = array_keys( $this->_get_filtered_roles( "wds-{$ctx}" ) );
100
- $check_context = is_array( $input[ $ctx ] )
101
  ? $input[ $ctx ]
102
  : array( $input[ $ctx ] );
103
  $result[ $ctx ] = array();
@@ -109,7 +100,7 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
109
  }
110
 
111
  if ( isset( $input['verification-google-meta'] ) ) {
112
- $this->_validate_and_save_extra_options( $input );
113
  }
114
 
115
  return $result;
@@ -120,7 +111,7 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
120
  *
121
  * @return array
122
  */
123
- protected function _get_permission_contexts() {
124
  return array(
125
  'seo_metabox_permission_level',
126
  'seo_metabox_301_permission_level',
@@ -131,11 +122,11 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
131
  /**
132
  * Get (optionally filtered) default roles
133
  *
134
- * @param string $context_filter Optional filter to pass the roles through first
135
  *
136
  * @return array List of roles
137
  */
138
- protected function _get_filtered_roles( $context_filter = false ) {
139
  $default_roles = array(
140
  'manage_network' => __( 'Super Admin', 'wds' ),
141
  'list_users' => sprintf( __( '%s (and up)', 'wds' ), __( 'Site Admin', 'wds' ) ),
@@ -158,11 +149,11 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
158
  * This is a side-effect method - the extra options don't update
159
  * the tab option key, but go to an extternal location
160
  *
161
- * @param array $input Raw form input
162
  */
163
- private function _validate_and_save_extra_options( $input ) {
164
- // Sitemaps validation/save
165
- $sitemaps = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SITEMAP );
166
  $sitemaps_updated = false;
167
  if ( isset( $input['verification-pages'] ) ) {
168
  $pages = $input['verification-pages'];
@@ -172,38 +163,41 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
172
  $sitemaps_updated = true;
173
  }
174
 
175
- // Meta tags
176
  if ( isset( $input['verification-google-meta'] ) ) {
177
  $sitemaps['verification-google-meta'] = smartcrawl_is_valid_meta_tag( $input['verification-google-meta'] ) ? $input['verification-google-meta'] : '';
178
- $sitemaps_updated = true;
179
  }
180
  if ( isset( $input['verification-bing-meta'] ) ) {
181
  $sitemaps['verification-bing-meta'] = smartcrawl_is_valid_meta_tag( $input['verification-bing-meta'] ) ? $input['verification-bing-meta'] : '';
182
- $sitemaps_updated = true;
183
  }
184
 
185
  $custom_values_key = 'additional-metas';
186
  if ( ! empty( $input[ $custom_values_key ] ) && is_array( $input[ $custom_values_key ] ) ) {
187
- $custom_values = $input[ $custom_values_key ];
188
  $sanitized_custom_values = array();
189
  foreach ( $custom_values as $index => $custom_value ) {
190
  if ( trim( $custom_value ) ) {
191
- $sanitized = wp_kses( $custom_value, array(
192
- 'meta' => array(
193
- 'charset' => array(),
194
- 'content' => array(),
195
- 'http-equiv' => array(),
196
- 'name' => array(),
197
- 'scheme' => array(),
198
- ),
199
- ) );
 
 
 
200
  if ( preg_match( '/<meta\b/', trim( $sanitized ) ) ) {
201
  $sanitized_custom_values[] = $sanitized;
202
  }
203
  }
204
  }
205
  $sitemaps[ $custom_values_key ] = $sanitized_custom_values;
206
- $sitemaps_updated = true;
207
  }
208
 
209
  if ( $sitemaps_updated ) {
@@ -211,18 +205,21 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
211
  }
212
  }
213
 
 
 
 
214
  public function init() {
215
  $this->option_name = 'wds_settings_options';
216
- $this->name = 'settings';
217
- $this->slug = Smartcrawl_Settings::TAB_SETTINGS;
218
- $this->action_url = admin_url( 'options.php' );
219
- $this->page_title = __( 'SmartCrawl Wizard: Settings', 'wds' );
220
 
221
  add_action( 'admin_init', array( $this, 'activate_component' ) );
222
  add_action( 'admin_init', array( $this, 'save_moz_api_credentials' ) );
223
  add_action( 'admin_footer', array( $this, 'add_native_dismissible_notice_javascript' ) );
224
- add_action( 'network_admin_notices', array( $this, 'wp_org_rating_request' ) );
225
- add_action( 'admin_notices', array( $this, 'wp_org_rating_request' ) );
226
  add_action( 'network_admin_notices', array( $this, 'import_notice' ) );
227
 
228
  if ( $this->display_single_site_import_notice() ) {
@@ -232,15 +229,21 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
232
  parent::init();
233
  }
234
 
 
 
 
 
 
235
  public function get_title() {
236
  return __( 'Settings', 'wds' );
237
  }
238
 
 
 
 
239
  private function display_single_site_import_notice() {
240
- // Always display on non-multisite
241
- return ! is_multisite()
242
- // or when the current site is the main network site
243
- || is_main_site();
244
  }
245
 
246
  /**
@@ -249,28 +252,31 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
249
  public function activate_component() {
250
  $data = $this->get_request_data();
251
  if ( isset( $data['wds-activate-component'] ) ) {
252
- $component = sanitize_key( $data['wds-activate-component'] );
253
- $options = self::get_specific_options( $this->option_name );
254
  $options[ $component ] = 1;
255
 
256
  self::update_specific_options( $this->option_name, $options );
257
 
258
- do_action( "wds-component-activated-$component" );
259
 
260
- wp_redirect( esc_url_raw( add_query_arg( array() ) ) );
261
  }
262
  }
263
 
 
 
 
264
  public function save_moz_api_credentials() {
265
  $data = $this->get_request_data();
266
  if ( isset( $data['wds-moz-access-id'] ) || isset( $data['wds-moz-secret-key'] ) ) {
267
- $options = self::get_specific_options( $this->option_name );
268
- $options['access-id'] = sanitize_text_field( $data['wds-moz-access-id'] );
269
  $options['secret-key'] = sanitize_text_field( $data['wds-moz-secret-key'] );
270
 
271
  self::update_specific_options( $this->option_name, $options );
272
 
273
- wp_redirect( esc_url_raw( add_query_arg( array() ) ) );
274
  }
275
  }
276
 
@@ -280,15 +286,15 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
280
  public function options_page() {
281
  parent::options_page();
282
 
283
- $arguments['default_roles'] = $this->_get_filtered_roles();
284
 
285
  $arguments['plugin_modules'] = $this->get_plugin_modules();
286
 
287
- foreach ( $this->_get_permission_contexts() as $ctx ) {
288
- $arguments[ $ctx ] = $this->_get_filtered_roles( "wds-{$ctx}" );
289
  }
290
 
291
- $sitemap_settings = Smartcrawl_Sitemap_Settings::get_instance();
292
  $arguments['sitemap_option_name'] = $sitemap_settings->option_name;
293
 
294
  $arguments['verification_pages'] = array(
@@ -296,23 +302,29 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
296
  'home' => __( 'Home page', 'wds' ),
297
  );
298
 
299
- $arguments['active_tab'] = $this->_get_active_tab( 'tab_general_settings' );
300
 
301
  wp_enqueue_script( Smartcrawl_Controller_Assets::SETTINGS_PAGE_JS );
302
- $this->_render_page( 'settings/settings', $arguments );
303
  }
304
 
 
 
 
305
  private function get_plugin_modules() {
306
  $disable_schema = (bool) smartcrawl_get_array_value(
307
  self::get_component_options( Smartcrawl_Settings::COMP_SOCIAL ),
308
  'disable-schema'
309
  );
310
 
311
- // All available modules:
312
  $all_plugin_modules = array(
313
  'onpage' => $this->plugin_module_args( __( 'Title & Meta', 'wds' ), 'onpage' ),
314
  'schema' => $this->plugin_module_args(
315
- __( 'Schema', 'wds' ), 'disable-schema', true, $disable_schema
 
 
 
316
  ),
317
  'social' => $this->plugin_module_args( __( 'Social', 'wds' ), 'social' ),
318
  'sitemap' => $this->plugin_module_args( __( 'Sitemaps', 'wds' ), 'sitemap' ),
@@ -323,7 +335,7 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
323
  return $all_plugin_modules;
324
  }
325
 
326
- // The modules that are to be shown in the sub-site settings:
327
  $sub_site_modules = array();
328
  $active_blog_tabs = self::get_blog_tabs();
329
  foreach ( $all_plugin_modules as $plugin_module => $label ) {
@@ -432,11 +444,14 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
432
  self::update_specific_options( $this->option_name, $this->options );
433
 
434
  $blog_tabs = get_site_option( 'wds_blog_tabs', false );
435
- if ( $blog_tabs === false ) {
436
  smartcrawl_activate_all_blog_tabs();
437
  }
438
  }
439
 
 
 
 
440
  public function import_notice() {
441
  if ( ! current_user_can( 'manage_options' ) ) {
442
  return;
@@ -455,29 +470,23 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
455
  );
456
  }
457
 
458
- /**
459
- * @param $importer Smartcrawl_Importer
460
- * @param $plugin_key
461
- * @param $plugin_name string
462
- * @param $plugin
463
- */
464
  private function show_import_notice( $importer, $plugin_key, $plugin_name ) {
465
  if ( ! $importer->data_exists() ) {
466
  return;
467
  }
468
 
469
- $auto_import_url = sprintf(
470
  '<a href="%s">%s</a>',
471
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SETTINGS ) . '&tab=tab_import_export',
472
  esc_html__( 'auto-import', 'wds' )
473
  );
474
- $message = sprintf(
475
  esc_html__( "We've detected you have %1\$s settings. Do you want to %2\$s your configuration into SmartCrawl?", 'wds' ),
476
  $plugin_name,
477
  $auto_import_url
478
  );
479
- $message_key = sprintf( '%s-import', $plugin_key );
480
- $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
481
  $is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $message_key ) === true;
482
 
483
  if ( $is_message_dismissed ) {
@@ -485,19 +494,28 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
485
  }
486
 
487
  ?>
488
- <div class="notice-warning notice is-dismissible wds-native-dismissible-notice"
489
- data-message-key="<?php echo esc_attr( $message_key ); ?>">
 
 
490
  <p><?php echo wp_kses_post( $message ); ?></p>
491
  </div>
492
  <?php
493
  }
494
 
 
 
 
495
  public function add_native_dismissible_notice_javascript() {
496
- $this->_render( 'native-dismissible-notice-javascript' );
497
  }
498
 
 
 
 
 
 
499
  public function wp_org_rating_request() {
500
- return;
501
  $service = $this->get_service();
502
  if ( $service->is_member() || ! current_user_can( 'manage_options' ) ) {
503
  return;
@@ -507,26 +525,30 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
507
  return;
508
  }
509
 
510
- $days = 7;
511
- $now = current_time( 'timestamp' );
512
  $free_install_date = get_site_option( 'wds-free-install-date' );
513
  if ( ( $now - (int) $free_install_date ) < ( $days * 24 * 60 * 60 ) ) {
514
  return;
515
  }
516
 
517
- $key = 'wp-org-rating-request';
518
- $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
519
  $is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $key ) === true;
520
  if ( $is_message_dismissed ) {
521
  return;
522
  }
523
 
524
  ?>
525
- <div class="notice-info notice is-dismissible wds-native-dismissible-notice"
526
- data-message-key="<?php echo esc_attr( $key ); ?>">
 
 
527
  <p><?php esc_html_e( "Excellent! You've been using SmartCrawl for over a week. Hope you are enjoying it so far. We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.", 'wds' ); ?></p>
528
- <a target="_blank" href="https://wordpress.org/plugins/smartcrawl-seo#reviews"
529
- class="button button-primary">
 
 
530
  <?php esc_html_e( 'Rate SmartCrawl', 'wds' ); ?>
531
  </a>
532
  <a href="#" class="wds-native-dismiss">No Thanks</a>
@@ -536,16 +558,21 @@ class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
536
  }
537
 
538
  /**
 
 
539
  * @return Smartcrawl_Site_Service
540
  */
541
  private static function get_service() {
542
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
543
-
544
- return $service;
545
  }
546
 
 
 
 
 
 
547
  private function get_request_data() {
548
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-settings-nonce' ) ? $_POST : array();
549
  }
550
  }
551
 
2
 
3
  class Smartcrawl_Settings_Settings extends Smartcrawl_Settings_Admin {
4
 
5
+ use Smartcrawl_Singleton;
 
 
 
 
 
 
 
 
 
6
 
7
  /**
8
  * Validate submitted options
9
  *
10
+ * @param array $input Raw input.
11
  *
12
  * @return array Validated input
13
  */
16
 
17
  $disable_schema_key = 'disable-schema';
18
  if ( isset( $input[ $disable_schema_key ] ) ) {
19
+ $social_options = self::get_component_options( self::COMP_SOCIAL );
20
  $social_options[ $disable_schema_key ] = ! empty( $input[ $disable_schema_key ] );
21
  self::update_component_options( self::COMP_SOCIAL, $social_options );
22
  unset( $social_options[ $disable_schema_key ] );
23
  }
24
 
25
+ // Accessibility.
26
  $result['high-contrast'] = ! empty( $input['high-contrast'] );
27
 
28
+ // Data settings.
29
  $result['keep_settings_on_uninstall'] = ! empty( $input['keep_settings_on_uninstall'] );
30
+ $result['keep_data_on_uninstall'] = ! empty( $input['keep_data_on_uninstall'] );
31
 
32
  if ( ! empty( $input['wds_settings-setup'] ) ) {
33
  $result['wds_settings-setup'] = true;
38
  $result[ $bool ] = ! empty( $input[ $bool ] );
39
  }
40
 
41
+ // Robots.txt file.
42
  if ( isset( $input['robots-txt'] ) ) {
43
  $result['robots-txt'] = ! empty( $input['robots-txt'] );
44
  }
45
+ // Analysis/readability.
46
+ $result['analysis-seo'] = ! empty( $input['analysis-seo'] );
47
  $result['analysis-readability'] = ! empty( $input['analysis-readability'] );
48
+ $result['analysis_strategy'] = ! empty( $input['analysis_strategy'] )
49
  ? sanitize_text_field( $input['analysis_strategy'] )
50
  : Smartcrawl_Controller_Analysis_Content::STRATEGY_STRICT;
51
+ $result['extras-admin_bar'] = ! empty( $input['extras-admin_bar'] );
52
 
53
  if ( ! empty( $input['redirections-code'] ) && is_numeric( $input['redirections-code'] ) ) {
54
  $code = (int) $input['redirections-code'];
82
  }
83
  }
84
 
85
+ // Roles.
86
+ foreach ( $this->get_permission_contexts() as $ctx ) {
87
  if ( empty( $input[ $ctx ] ) ) {
88
  continue;
89
  }
90
+ $roles = array_keys( $this->get_filtered_roles( "wds-{$ctx}" ) );
91
+ $check_context = is_array( $input[ $ctx ] )
92
  ? $input[ $ctx ]
93
  : array( $input[ $ctx ] );
94
  $result[ $ctx ] = array();
100
  }
101
 
102
  if ( isset( $input['verification-google-meta'] ) ) {
103
+ $this->validate_and_save_extra_options( $input );
104
  }
105
 
106
  return $result;
111
  *
112
  * @return array
113
  */
114
+ protected function get_permission_contexts() {
115
  return array(
116
  'seo_metabox_permission_level',
117
  'seo_metabox_301_permission_level',
122
  /**
123
  * Get (optionally filtered) default roles
124
  *
125
+ * @param string $context_filter Optional filter to pass the roles through first.
126
  *
127
  * @return array List of roles
128
  */
129
+ protected function get_filtered_roles( $context_filter = false ) {
130
  $default_roles = array(
131
  'manage_network' => __( 'Super Admin', 'wds' ),
132
  'list_users' => sprintf( __( '%s (and up)', 'wds' ), __( 'Site Admin', 'wds' ) ),
149
  * This is a side-effect method - the extra options don't update
150
  * the tab option key, but go to an extternal location
151
  *
152
+ * @param array $input Raw form input.
153
  */
154
+ private function validate_and_save_extra_options( $input ) {
155
+ // Sitemaps validation/save.
156
+ $sitemaps = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SITEMAP );
157
  $sitemaps_updated = false;
158
  if ( isset( $input['verification-pages'] ) ) {
159
  $pages = $input['verification-pages'];
163
  $sitemaps_updated = true;
164
  }
165
 
166
+ // Meta tags.
167
  if ( isset( $input['verification-google-meta'] ) ) {
168
  $sitemaps['verification-google-meta'] = smartcrawl_is_valid_meta_tag( $input['verification-google-meta'] ) ? $input['verification-google-meta'] : '';
169
+ $sitemaps_updated = true;
170
  }
171
  if ( isset( $input['verification-bing-meta'] ) ) {
172
  $sitemaps['verification-bing-meta'] = smartcrawl_is_valid_meta_tag( $input['verification-bing-meta'] ) ? $input['verification-bing-meta'] : '';
173
+ $sitemaps_updated = true;
174
  }
175
 
176
  $custom_values_key = 'additional-metas';
177
  if ( ! empty( $input[ $custom_values_key ] ) && is_array( $input[ $custom_values_key ] ) ) {
178
+ $custom_values = $input[ $custom_values_key ];
179
  $sanitized_custom_values = array();
180
  foreach ( $custom_values as $index => $custom_value ) {
181
  if ( trim( $custom_value ) ) {
182
+ $sanitized = wp_kses(
183
+ $custom_value,
184
+ array(
185
+ 'meta' => array(
186
+ 'charset' => array(),
187
+ 'content' => array(),
188
+ 'http-equiv' => array(),
189
+ 'name' => array(),
190
+ 'scheme' => array(),
191
+ ),
192
+ )
193
+ );
194
  if ( preg_match( '/<meta\b/', trim( $sanitized ) ) ) {
195
  $sanitized_custom_values[] = $sanitized;
196
  }
197
  }
198
  }
199
  $sitemaps[ $custom_values_key ] = $sanitized_custom_values;
200
+ $sitemaps_updated = true;
201
  }
202
 
203
  if ( $sitemaps_updated ) {
205
  }
206
  }
207
 
208
+ /**
209
+ * @return void
210
+ */
211
  public function init() {
212
  $this->option_name = 'wds_settings_options';
213
+ $this->name = 'settings';
214
+ $this->slug = Smartcrawl_Settings::TAB_SETTINGS;
215
+ $this->action_url = admin_url( 'options.php' );
216
+ $this->page_title = __( 'SmartCrawl Wizard: Settings', 'wds' );
217
 
218
  add_action( 'admin_init', array( $this, 'activate_component' ) );
219
  add_action( 'admin_init', array( $this, 'save_moz_api_credentials' ) );
220
  add_action( 'admin_footer', array( $this, 'add_native_dismissible_notice_javascript' ) );
221
+ // add_action( 'network_admin_notices', array( $this, 'wp_org_rating_request' ) );.
222
+ // add_action( 'admin_notices', array( $this, 'wp_org_rating_request' ) );.
223
  add_action( 'network_admin_notices', array( $this, 'import_notice' ) );
224
 
225
  if ( $this->display_single_site_import_notice() ) {
229
  parent::init();
230
  }
231
 
232
+ /**
233
+ * Get title.
234
+ *
235
+ * @return string
236
+ */
237
  public function get_title() {
238
  return __( 'Settings', 'wds' );
239
  }
240
 
241
+ /**
242
+ * @return bool
243
+ */
244
  private function display_single_site_import_notice() {
245
+ // Always display on non-multisite or when the current site is the main network site.
246
+ return ! is_multisite() || is_main_site();
 
 
247
  }
248
 
249
  /**
252
  public function activate_component() {
253
  $data = $this->get_request_data();
254
  if ( isset( $data['wds-activate-component'] ) ) {
255
+ $component = sanitize_key( $data['wds-activate-component'] );
256
+ $options = self::get_specific_options( $this->option_name );
257
  $options[ $component ] = 1;
258
 
259
  self::update_specific_options( $this->option_name, $options );
260
 
261
+ do_action( "wds-component-activated-$component" ); // phpcs:ignore
262
 
263
+ wp_redirect( esc_url_raw( add_query_arg( array() ) ) ); // phpcs:ignore
264
  }
265
  }
266
 
267
+ /**
268
+ * @return void
269
+ */
270
  public function save_moz_api_credentials() {
271
  $data = $this->get_request_data();
272
  if ( isset( $data['wds-moz-access-id'] ) || isset( $data['wds-moz-secret-key'] ) ) {
273
+ $options = self::get_specific_options( $this->option_name );
274
+ $options['access-id'] = sanitize_text_field( $data['wds-moz-access-id'] );
275
  $options['secret-key'] = sanitize_text_field( $data['wds-moz-secret-key'] );
276
 
277
  self::update_specific_options( $this->option_name, $options );
278
 
279
+ wp_redirect( esc_url_raw( add_query_arg( array() ) ) ); // phpcs:ignore
280
  }
281
  }
282
 
286
  public function options_page() {
287
  parent::options_page();
288
 
289
+ $arguments['default_roles'] = $this->get_filtered_roles();
290
 
291
  $arguments['plugin_modules'] = $this->get_plugin_modules();
292
 
293
+ foreach ( $this->get_permission_contexts() as $ctx ) {
294
+ $arguments[ $ctx ] = $this->get_filtered_roles( "wds-{$ctx}" );
295
  }
296
 
297
+ $sitemap_settings = Smartcrawl_Sitemap_Settings::get();
298
  $arguments['sitemap_option_name'] = $sitemap_settings->option_name;
299
 
300
  $arguments['verification_pages'] = array(
302
  'home' => __( 'Home page', 'wds' ),
303
  );
304
 
305
+ $arguments['active_tab'] = $this->get_active_tab( 'tab_general_settings' );
306
 
307
  wp_enqueue_script( Smartcrawl_Controller_Assets::SETTINGS_PAGE_JS );
308
+ $this->render_page( 'settings/settings', $arguments );
309
  }
310
 
311
+ /**
312
+ * @return array
313
+ */
314
  private function get_plugin_modules() {
315
  $disable_schema = (bool) smartcrawl_get_array_value(
316
  self::get_component_options( Smartcrawl_Settings::COMP_SOCIAL ),
317
  'disable-schema'
318
  );
319
 
320
+ // All available modules.
321
  $all_plugin_modules = array(
322
  'onpage' => $this->plugin_module_args( __( 'Title & Meta', 'wds' ), 'onpage' ),
323
  'schema' => $this->plugin_module_args(
324
+ __( 'Schema', 'wds' ),
325
+ 'disable-schema',
326
+ true,
327
+ $disable_schema
328
  ),
329
  'social' => $this->plugin_module_args( __( 'Social', 'wds' ), 'social' ),
330
  'sitemap' => $this->plugin_module_args( __( 'Sitemaps', 'wds' ), 'sitemap' ),
335
  return $all_plugin_modules;
336
  }
337
 
338
+ // The modules that are to be shown in the sub-site settings.
339
  $sub_site_modules = array();
340
  $active_blog_tabs = self::get_blog_tabs();
341
  foreach ( $all_plugin_modules as $plugin_module => $label ) {
444
  self::update_specific_options( $this->option_name, $this->options );
445
 
446
  $blog_tabs = get_site_option( 'wds_blog_tabs', false );
447
+ if ( false === $blog_tabs ) {
448
  smartcrawl_activate_all_blog_tabs();
449
  }
450
  }
451
 
452
+ /**
453
+ * @return void
454
+ */
455
  public function import_notice() {
456
  if ( ! current_user_can( 'manage_options' ) ) {
457
  return;
470
  );
471
  }
472
 
 
 
 
 
 
 
473
  private function show_import_notice( $importer, $plugin_key, $plugin_name ) {
474
  if ( ! $importer->data_exists() ) {
475
  return;
476
  }
477
 
478
+ $auto_import_url = sprintf(
479
  '<a href="%s">%s</a>',
480
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SETTINGS ) . '&tab=tab_import_export',
481
  esc_html__( 'auto-import', 'wds' )
482
  );
483
+ $message = sprintf(
484
  esc_html__( "We've detected you have %1\$s settings. Do you want to %2\$s your configuration into SmartCrawl?", 'wds' ),
485
  $plugin_name,
486
  $auto_import_url
487
  );
488
+ $message_key = sprintf( '%s-import', $plugin_key );
489
+ $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
490
  $is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $message_key ) === true;
491
 
492
  if ( $is_message_dismissed ) {
494
  }
495
 
496
  ?>
497
+ <div
498
+ class="notice-warning notice is-dismissible wds-native-dismissible-notice"
499
+ data-message-key="<?php echo esc_attr( $message_key ); ?>"
500
+ >
501
  <p><?php echo wp_kses_post( $message ); ?></p>
502
  </div>
503
  <?php
504
  }
505
 
506
+ /**
507
+ * @return void
508
+ */
509
  public function add_native_dismissible_notice_javascript() {
510
+ $this->render_view( 'native-dismissible-notice-javascript' );
511
  }
512
 
513
+ /**
514
+ * Not being used as of now.
515
+ *
516
+ * @return void
517
+ */
518
  public function wp_org_rating_request() {
 
519
  $service = $this->get_service();
520
  if ( $service->is_member() || ! current_user_can( 'manage_options' ) ) {
521
  return;
525
  return;
526
  }
527
 
528
+ $days = 7;
529
+ $now = current_time( 'timestamp' ); // phpcs:ignore
530
  $free_install_date = get_site_option( 'wds-free-install-date' );
531
  if ( ( $now - (int) $free_install_date ) < ( $days * 24 * 60 * 60 ) ) {
532
  return;
533
  }
534
 
535
+ $key = 'wp-org-rating-request';
536
+ $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
537
  $is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $key ) === true;
538
  if ( $is_message_dismissed ) {
539
  return;
540
  }
541
 
542
  ?>
543
+ <div
544
+ class="notice-info notice is-dismissible wds-native-dismissible-notice"
545
+ data-message-key="<?php echo esc_attr( $key ); ?>"
546
+ >
547
  <p><?php esc_html_e( "Excellent! You've been using SmartCrawl for over a week. Hope you are enjoying it so far. We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.", 'wds' ); ?></p>
548
+ <a
549
+ target="_blank" href="https://wordpress.org/plugins/smartcrawl-seo#reviews"
550
+ class="button button-primary"
551
+ >
552
  <?php esc_html_e( 'Rate SmartCrawl', 'wds' ); ?>
553
  </a>
554
  <a href="#" class="wds-native-dismiss">No Thanks</a>
558
  }
559
 
560
  /**
561
+ * Get service.
562
+ *
563
  * @return Smartcrawl_Site_Service
564
  */
565
  private static function get_service() {
566
+ return Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
 
 
567
  }
568
 
569
+ /**
570
+ * Get request data.
571
+ *
572
+ * @return array
573
+ */
574
  private function get_request_data() {
575
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wds_nonce'] ), 'wds-settings-nonce' ) ? $_POST : array(); // phpcs:ignore
576
  }
577
  }
578
 
includes/admin/settings/sitemap.php CHANGED
@@ -10,27 +10,7 @@
10
  */
11
  class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
12
 
13
- /**
14
- * Singleton instance
15
- *
16
- * @var Smartcrawl_Sitemap_Settings
17
- */
18
- private static $_instance;
19
-
20
- private $view_defaults = array();
21
-
22
- /**
23
- * Singleton instance getter
24
- *
25
- * @return Smartcrawl_Sitemap_Settings instance
26
- */
27
- public static function get_instance() {
28
- if ( empty( self::$_instance ) ) {
29
- self::$_instance = new self();
30
- }
31
-
32
- return self::$_instance;
33
- }
34
 
35
  /**
36
  * Validate submitted options
@@ -40,12 +20,12 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
40
  * @return array Validated input
41
  */
42
  public function validate( $input ) {
43
- $result = array();
44
  $previous_values = self::get_specific_options( $this->option_name );
45
 
46
  if ( isset( $input['override-native'] ) ) {
47
  $result['override-native'] = ! empty( $input['override-native'] );
48
- } else if ( isset( $previous_values['override-native'] ) ) {
49
  $result['override-native'] = ! empty( $previous_values['override-native'] );
50
  }
51
 
@@ -81,28 +61,28 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
81
  }
82
 
83
  $result['ping-google'] = ! empty( $input['auto-notify-search-engines'] );
84
- $result['ping-bing'] = ! empty( $input['auto-notify-search-engines'] );
85
 
86
  // Array Booleans.
87
- foreach ( array_keys( $this->_get_post_types_options() ) as $post_type ) {
88
  $result[ $post_type ] = ! empty( $input[ $post_type ] );
89
  }
90
- foreach ( array_keys( $this->_get_taxonomies_options() ) as $tax ) {
91
  $result[ $tax ] = ! empty( $input[ $tax ] );
92
  }
93
 
94
  // BuddyPress-specific.
95
- $bpo = $this->_get_buddyress_template_values();
96
  if ( ! empty( $bpo['exclude_groups'] ) && is_array( $bpo['exclude_groups'] ) ) {
97
  foreach ( $bpo['exclude_groups'] as $slug => $name ) {
98
- $key = "sitemap-buddypress-{$slug}";
99
  $result[ $key ] = ! empty( $input[ $key ] );
100
  }
101
  }
102
 
103
  if ( ! empty( $bpo['exclude_roles'] ) && is_array( $bpo['exclude_roles'] ) ) {
104
  foreach ( $bpo['exclude_roles'] as $slug => $name ) {
105
- $key = "sitemap-buddypress-roles-{$slug}";
106
  $result[ $key ] = ! empty( $input[ $key ] );
107
  }
108
  }
@@ -122,10 +102,10 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
122
  $result[ $custom_values_key ] = smartcrawl_get_array_value( $previous_values, $custom_values_key );
123
  }
124
 
125
- $result = $this->_validate_crawler_settings( $input, $result );
126
 
127
  if ( isset( $input['extra_sitemap_urls'] ) ) {
128
- $extra_urls = explode( "\n", $input['extra_sitemap_urls'] );
129
  $sanitized_extra_urls = array();
130
  foreach ( $extra_urls as $extra_url ) {
131
  if ( trim( $extra_url ) ) {
@@ -138,7 +118,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
138
  }
139
 
140
  if ( isset( $input['sitemap_ignore_urls'] ) ) {
141
- $ignore_urls = explode( "\n", $input['sitemap_ignore_urls'] );
142
  $sanitized_ignore_urls = array();
143
  foreach ( $ignore_urls as $ignore_url ) {
144
  if ( trim( $ignore_url ) ) {
@@ -151,7 +131,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
151
  }
152
 
153
  if ( isset( $input['sitemap_ignore_post_ids'] ) ) {
154
- $ignore_post_ids = explode( ',', $input['sitemap_ignore_post_ids'] );
155
  $sanitized_ignore_post_ids = array();
156
  foreach ( $ignore_post_ids as $pid ) {
157
  if ( trim( $pid ) && (int) $pid ) {
@@ -179,6 +159,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
179
  add_settings_error(
180
  $this->option_name,
181
  'max-items-per-sitemap',
 
182
  sprintf( esc_html__( 'The maximum number allowed for "Items Per Sitemap" setting is %d', 'wds' ), $max_per_sitemap )
183
  );
184
  }
@@ -200,6 +181,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
200
  }
201
 
202
  $to_settings = new Smartcrawl_News_Sitemap_Data();
 
203
  return $to_settings->data_to_settings( $data );
204
  }
205
 
@@ -208,19 +190,22 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
208
  *
209
  * @return array
210
  */
211
- protected function _get_post_types_options() {
212
  $options = array();
213
 
214
  foreach (
215
- get_post_types( array(
216
- 'public' => true,
217
- 'show_ui' => true,
218
- ) ) as $post_type
 
 
219
  ) {
220
  if ( in_array( $post_type, array( 'revision', 'nav_menu_item', 'attachment' ), true ) ) {
221
  continue;
222
  }
223
  $pt = get_post_type_object( $post_type );
 
224
  $options[ 'post_types-' . $post_type . '-not_in_sitemap' ] = $pt;
225
  }
226
 
@@ -232,19 +217,22 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
232
  *
233
  * @return array
234
  */
235
- protected function _get_taxonomies_options() {
236
  $options = array();
237
 
238
  foreach (
239
- get_taxonomies( array(
240
- 'public' => true,
241
- 'show_ui' => true,
242
- ) ) as $taxonomy
 
 
243
  ) {
244
  if ( in_array( $taxonomy, array( 'nav_menu', 'link_category', 'post_format' ), true ) ) {
245
  continue;
246
  }
247
  $tax = get_taxonomy( $taxonomy );
 
248
  $options[ 'taxonomies-' . $taxonomy . '-not_in_sitemap' ] = $tax;
249
  }
250
 
@@ -256,7 +244,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
256
  *
257
  * @return array BuddyPress values for the template
258
  */
259
- private function _get_buddyress_template_values() {
260
  $arguments = array();
261
  if ( ! defined( 'BP_VERSION' ) ) {
262
  return $arguments;
@@ -267,20 +255,20 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
267
  );
268
 
269
  if ( function_exists( 'groups_get_groups' ) ) { // We have BuddyPress groups, so let's get some settings.
270
- $groups = groups_get_groups();
271
- $arguments['groups'] = ! empty( $groups['groups'] ) ? $groups['groups'] : array();
272
  $arguments['exclude_groups'] = array();
273
  foreach ( $arguments['groups'] as $group ) {
274
- $arguments['exclude_groups']["exclude-buddypress-group-{$group->slug}"] = $group->name;
275
  }
276
  }
277
 
278
- $wp_roles = new WP_Roles();
279
- $wp_roles = $wp_roles->get_names();
280
- $wp_roles = $wp_roles ? $wp_roles : array();
281
  $arguments['exclude_roles'] = array();
282
  foreach ( $wp_roles as $key => $label ) {
283
- $arguments['exclude_roles']["exclude-profile-role-{$key}"] = $label;
284
  }
285
 
286
  return $arguments;
@@ -289,12 +277,12 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
289
  /**
290
  * Crawler settings validation
291
  *
292
- * @param array $input Raw input.
293
  * @param array $result Result this far.
294
  *
295
  * @return array
296
  */
297
- private function _validate_crawler_settings( $input, $result ) {
298
  $result = $this->sanitize_crawler_emails( $input, $result );
299
 
300
  if ( empty( $input['crawler-cron-enable'] ) || empty( $result['sitemap-email-recipients'] ) ) {
@@ -305,7 +293,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
305
  $result['crawler-cron-enable'] = true;
306
  }
307
 
308
- $frequency = ! empty( $input['crawler-frequency'] )
309
  ? Smartcrawl_Controller_Cron::get()->get_valid_frequency( $input['crawler-frequency'] )
310
  : Smartcrawl_Controller_Cron::get()->get_default_frequency();
311
  $result['crawler-frequency'] = $frequency;
@@ -315,7 +303,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
315
  (int) smartcrawl_get_array_value( $input, 'crawler-dow' )
316
  );
317
 
318
- $tod = isset( $input['crawler-tod'] ) && is_numeric( $input['crawler-tod'] )
319
  ? (int) $input['crawler-tod']
320
  : 0;
321
  $result['crawler-tod'] = in_array( $tod, range( 0, 23 ), true ) ? $tod : 0;
@@ -328,10 +316,10 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
328
  */
329
  public function init() {
330
  $this->option_name = 'wds_sitemap_options';
331
- $this->name = Smartcrawl_Settings::COMP_SITEMAP;
332
- $this->slug = Smartcrawl_Settings::TAB_SITEMAP;
333
- $this->action_url = admin_url( 'options.php' );
334
- $this->page_title = __( 'SmartCrawl Wizard: Sitemap', 'wds' );
335
 
336
  add_action( 'wds-component-activated-sitemap', array( $this, 'trigger_crawl_after_activation' ) );
337
  add_action( 'all_admin_notices', array( $this, 'add_crawl_status_message' ), 10 );
@@ -339,41 +327,48 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
339
  parent::init();
340
  }
341
 
 
 
 
342
  public function get_title() {
343
  return __( 'Sitemaps', 'wds' );
344
  }
345
 
 
 
 
346
  public function trigger_crawl_after_activation() {
347
  $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
348
  $service->start();
349
  }
350
 
351
- private function get_request_data() {
352
- return isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], $this->option_name . '-options' )
353
- ? stripslashes_deep( $_POST )
354
- : array();
355
- }
356
-
357
  /**
358
- * Process run action
359
- *
360
- * @return bool
361
  */
362
  public function process_run_action() {
363
- if ( isset( $_GET['_wds_nonce'], $_GET['run-crawl'] ) && wp_verify_nonce( $_GET['_wds_nonce'], 'wds-crawl-nonce' ) ) { // Simple presence switch, no value.
 
364
  return $this->run_crawl();
365
  }
366
 
367
  return false;
368
  }
369
 
 
 
 
370
  public static function crawl_url() {
371
  $crawl_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP );
372
 
373
- return esc_url_raw( add_query_arg( array(
374
- 'run-crawl' => 'yes',
375
- '_wds_nonce' => wp_create_nonce( 'wds-crawl-nonce' ),
376
- ), $crawl_url ) );
 
 
 
 
 
377
  }
378
 
379
  /**
@@ -382,9 +377,9 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
382
  public function run_crawl() {
383
  $error = '';
384
  if ( current_user_can( 'manage_options' ) ) {
385
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
386
  $response = $service->start();
387
- $error = is_wp_error( $response )
388
  ? $response->get_error_message()
389
  : '';
390
  }
@@ -400,15 +395,18 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
400
  die;
401
  }
402
 
 
 
 
403
  public function add_crawl_status_message() {
404
- $crawl_in_progress = smartcrawl_get_array_value( $_GET, 'crawl-in-progress' );
405
  if ( is_null( $crawl_in_progress ) ) {
406
  return;
407
  }
408
 
409
- $crawl_in_progress = (boolean) $crawl_in_progress;
410
  if ( ! $crawl_in_progress ) {
411
- $message = (string) smartcrawl_get_array_value( $_GET, 'message' );
412
  add_settings_error( $this->option_name, 'wds-crawl-not-started', wp_strip_all_tags( $message ) );
413
  }
414
  }
@@ -419,7 +417,6 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
419
  public function options_page() {
420
  parent::options_page();
421
 
422
- $smartcrawl_options = Smartcrawl_Settings::get_options();
423
  $arguments = array(
424
  'post_types' => array(),
425
  'taxonomies' => array(),
@@ -432,16 +429,16 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
432
  ),
433
  );
434
 
435
- foreach ( $this->_get_post_types_options() as $opt => $post_type ) {
436
  $arguments['post_types'][ $opt ] = $post_type;
437
  }
438
- foreach ( $this->_get_taxonomies_options() as $opt => $taxonomy ) {
439
  $arguments['taxonomies'][ $opt ] = $taxonomy;
440
  }
441
 
442
- $arguments['smartcrawl_buddypress'] = $this->_get_buddyress_template_values();
443
 
444
- $arguments['active_tab'] = $this->_get_active_tab( 'tab_sitemap' );
445
 
446
  $extra_urls = Smartcrawl_Sitemap_Utils::get_extra_urls();
447
  if ( is_array( $extra_urls ) ) {
@@ -467,7 +464,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
467
 
468
  wp_enqueue_script( Smartcrawl_Controller_Assets::SITEMAPS_PAGE_JS );
469
 
470
- $this->_render_page( 'sitemap/sitemap-settings', $arguments );
471
  }
472
 
473
  /**
@@ -476,7 +473,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
476
  public function defaults() {
477
  $this->options = get_option( $this->option_name );
478
 
479
- $dir = wp_upload_dir();
480
  $path = trailingslashit( $dir['basedir'] );
481
 
482
  if ( empty( $this->options['wds_sitemap-setup'] ) ) {
@@ -538,10 +535,10 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
538
  $this->options['crawler-frequency'] = Smartcrawl_Controller_Cron::get()->get_default_frequency();
539
  }
540
  if ( ! isset( $this->options['crawler-dow'] ) ) {
541
- $this->options['crawler-dow'] = rand( 0, 6 );
542
  }
543
  if ( ! isset( $this->options['crawler-tod'] ) ) {
544
- $this->options['crawler-tod'] = rand( 0, 23 );
545
  }
546
  if ( ! isset( $this->options['items-per-sitemap'] ) ) {
547
  $this->options['items-per-sitemap'] = Smartcrawl_Sitemap_Utils::DEFAULT_ITEMS_PER_SITEMAP;
@@ -565,32 +562,41 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
565
  update_option( $this->option_name, $this->options );
566
  }
567
 
568
- protected function _get_view_defaults() {
 
 
 
569
  return $this->populate_view_defaults();
570
  }
571
 
 
 
 
572
  protected function populate_view_defaults() {
573
- $args = parent::_get_view_defaults();
574
 
575
- $view = smartcrawl_get_array_value( $args, '_view' );
576
- $view = empty( $view ) ? array() : $view;
577
- $seo_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
578
  $view['crawl_report'] = $seo_service->get_report();
579
 
580
  return array( '_view' => $view );
581
  }
582
 
583
  private function validate_dow( $frequency, $dow ) {
584
- if ( $frequency === 'monthly' ) {
585
  return in_array( $dow, range( 1, 28 ), true ) ? $dow : 1;
586
  } else {
587
  return in_array( $dow, range( 0, 6 ), true ) ? $dow : 0;
588
  }
589
  }
590
 
 
 
 
591
  public static function get_email_recipients() {
592
- $options = Smartcrawl_Settings::get_component_options( self::COMP_SITEMAP );
593
- $recipients = smartcrawl_get_array_value( $options, 'sitemap-email-recipients' );
594
  $dash_profile_data = smartcrawl_get_dash_profile_data();
595
  if ( is_null( $recipients ) && $dash_profile_data ) {
596
  return array(
@@ -612,8 +618,10 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
612
  }
613
 
614
  /**
615
- * @param array $input
616
- * @param array $result
 
 
617
  *
618
  * @return array
619
  */
@@ -623,7 +631,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
623
  if ( ! empty( $email_recipients ) ) {
624
  $sanitized_recipients = array();
625
  foreach ( $email_recipients as $recipient ) {
626
- $recipient_name = smartcrawl_get_array_value( $recipient, 'name' );
627
  $recipient_email = smartcrawl_get_array_value( $recipient, 'email' );
628
 
629
  if (
@@ -643,6 +651,7 @@ class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
643
  }
644
  $result['sitemap-email-recipients'] = $sanitized_recipients;
645
  }
 
646
  return $result;
647
  }
648
  }
10
  */
11
  class Smartcrawl_Sitemap_Settings extends Smartcrawl_Settings_Admin {
12
 
13
+ use Smartcrawl_Singleton;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  /**
16
  * Validate submitted options
20
  * @return array Validated input
21
  */
22
  public function validate( $input ) {
23
+ $result = array();
24
  $previous_values = self::get_specific_options( $this->option_name );
25
 
26
  if ( isset( $input['override-native'] ) ) {
27
  $result['override-native'] = ! empty( $input['override-native'] );
28
+ } elseif ( isset( $previous_values['override-native'] ) ) {
29
  $result['override-native'] = ! empty( $previous_values['override-native'] );
30
  }
31
 
61
  }
62
 
63
  $result['ping-google'] = ! empty( $input['auto-notify-search-engines'] );
64
+ $result['ping-bing'] = ! empty( $input['auto-notify-search-engines'] );
65
 
66
  // Array Booleans.
67
+ foreach ( array_keys( $this->get_post_types_options() ) as $post_type ) {
68
  $result[ $post_type ] = ! empty( $input[ $post_type ] );
69
  }
70
+ foreach ( array_keys( $this->get_taxonomies_options() ) as $tax ) {
71
  $result[ $tax ] = ! empty( $input[ $tax ] );
72
  }
73
 
74
  // BuddyPress-specific.
75
+ $bpo = $this->get_buddyress_template_values();
76
  if ( ! empty( $bpo['exclude_groups'] ) && is_array( $bpo['exclude_groups'] ) ) {
77
  foreach ( $bpo['exclude_groups'] as $slug => $name ) {
78
+ $key = "sitemap-buddypress-{$slug}";
79
  $result[ $key ] = ! empty( $input[ $key ] );
80
  }
81
  }
82
 
83
  if ( ! empty( $bpo['exclude_roles'] ) && is_array( $bpo['exclude_roles'] ) ) {
84
  foreach ( $bpo['exclude_roles'] as $slug => $name ) {
85
+ $key = "sitemap-buddypress-roles-{$slug}";
86
  $result[ $key ] = ! empty( $input[ $key ] );
87
  }
88
  }
102
  $result[ $custom_values_key ] = smartcrawl_get_array_value( $previous_values, $custom_values_key );
103
  }
104
 
105
+ $result = $this->validate_crawler_settings( $input, $result );
106
 
107
  if ( isset( $input['extra_sitemap_urls'] ) ) {
108
+ $extra_urls = explode( "\n", $input['extra_sitemap_urls'] );
109
  $sanitized_extra_urls = array();
110
  foreach ( $extra_urls as $extra_url ) {
111
  if ( trim( $extra_url ) ) {
118
  }
119
 
120
  if ( isset( $input['sitemap_ignore_urls'] ) ) {
121
+ $ignore_urls = explode( "\n", $input['sitemap_ignore_urls'] );
122
  $sanitized_ignore_urls = array();
123
  foreach ( $ignore_urls as $ignore_url ) {
124
  if ( trim( $ignore_url ) ) {
131
  }
132
 
133
  if ( isset( $input['sitemap_ignore_post_ids'] ) ) {
134
+ $ignore_post_ids = explode( ',', $input['sitemap_ignore_post_ids'] );
135
  $sanitized_ignore_post_ids = array();
136
  foreach ( $ignore_post_ids as $pid ) {
137
  if ( trim( $pid ) && (int) $pid ) {
159
  add_settings_error(
160
  $this->option_name,
161
  'max-items-per-sitemap',
162
+ // translators: %s max items per sitemap.
163
  sprintf( esc_html__( 'The maximum number allowed for "Items Per Sitemap" setting is %d', 'wds' ), $max_per_sitemap )
164
  );
165
  }
181
  }
182
 
183
  $to_settings = new Smartcrawl_News_Sitemap_Data();
184
+
185
  return $to_settings->data_to_settings( $data );
186
  }
187
 
190
  *
191
  * @return array
192
  */
193
+ protected function get_post_types_options() {
194
  $options = array();
195
 
196
  foreach (
197
+ get_post_types(
198
+ array(
199
+ 'public' => true,
200
+ 'show_ui' => true,
201
+ )
202
+ ) as $post_type
203
  ) {
204
  if ( in_array( $post_type, array( 'revision', 'nav_menu_item', 'attachment' ), true ) ) {
205
  continue;
206
  }
207
  $pt = get_post_type_object( $post_type );
208
+
209
  $options[ 'post_types-' . $post_type . '-not_in_sitemap' ] = $pt;
210
  }
211
 
217
  *
218
  * @return array
219
  */
220
+ protected function get_taxonomies_options() {
221
  $options = array();
222
 
223
  foreach (
224
+ get_taxonomies(
225
+ array(
226
+ 'public' => true,
227
+ 'show_ui' => true,
228
+ )
229
+ ) as $taxonomy
230
  ) {
231
  if ( in_array( $taxonomy, array( 'nav_menu', 'link_category', 'post_format' ), true ) ) {
232
  continue;
233
  }
234
  $tax = get_taxonomy( $taxonomy );
235
+
236
  $options[ 'taxonomies-' . $taxonomy . '-not_in_sitemap' ] = $tax;
237
  }
238
 
244
  *
245
  * @return array BuddyPress values for the template
246
  */
247
+ private function get_buddyress_template_values() {
248
  $arguments = array();
249
  if ( ! defined( 'BP_VERSION' ) ) {
250
  return $arguments;
255
  );
256
 
257
  if ( function_exists( 'groups_get_groups' ) ) { // We have BuddyPress groups, so let's get some settings.
258
+ $groups = groups_get_groups();
259
+ $arguments['groups'] = ! empty( $groups['groups'] ) ? $groups['groups'] : array();
260
  $arguments['exclude_groups'] = array();
261
  foreach ( $arguments['groups'] as $group ) {
262
+ $arguments['exclude_groups'][ 'exclude-buddypress-group-' . $group->slug ] = $group->name;
263
  }
264
  }
265
 
266
+ $wp_roles = new WP_Roles();
267
+ $wp_roles = $wp_roles->get_names();
268
+ $wp_roles = $wp_roles ? $wp_roles : array();
269
  $arguments['exclude_roles'] = array();
270
  foreach ( $wp_roles as $key => $label ) {
271
+ $arguments['exclude_roles'][ 'exclude-profile-role-' . $key ] = $label;
272
  }
273
 
274
  return $arguments;
277
  /**
278
  * Crawler settings validation
279
  *
280
+ * @param array $input Raw input.
281
  * @param array $result Result this far.
282
  *
283
  * @return array
284
  */
285
+ private function validate_crawler_settings( $input, $result ) {
286
  $result = $this->sanitize_crawler_emails( $input, $result );
287
 
288
  if ( empty( $input['crawler-cron-enable'] ) || empty( $result['sitemap-email-recipients'] ) ) {
293
  $result['crawler-cron-enable'] = true;
294
  }
295
 
296
+ $frequency = ! empty( $input['crawler-frequency'] )
297
  ? Smartcrawl_Controller_Cron::get()->get_valid_frequency( $input['crawler-frequency'] )
298
  : Smartcrawl_Controller_Cron::get()->get_default_frequency();
299
  $result['crawler-frequency'] = $frequency;
303
  (int) smartcrawl_get_array_value( $input, 'crawler-dow' )
304
  );
305
 
306
+ $tod = isset( $input['crawler-tod'] ) && is_numeric( $input['crawler-tod'] )
307
  ? (int) $input['crawler-tod']
308
  : 0;
309
  $result['crawler-tod'] = in_array( $tod, range( 0, 23 ), true ) ? $tod : 0;
316
  */
317
  public function init() {
318
  $this->option_name = 'wds_sitemap_options';
319
+ $this->name = Smartcrawl_Settings::COMP_SITEMAP;
320
+ $this->slug = Smartcrawl_Settings::TAB_SITEMAP;
321
+ $this->action_url = admin_url( 'options.php' );
322
+ $this->page_title = __( 'SmartCrawl Wizard: Sitemap', 'wds' );
323
 
324
  add_action( 'wds-component-activated-sitemap', array( $this, 'trigger_crawl_after_activation' ) );
325
  add_action( 'all_admin_notices', array( $this, 'add_crawl_status_message' ), 10 );
327
  parent::init();
328
  }
329
 
330
+ /**
331
+ * @return string
332
+ */
333
  public function get_title() {
334
  return __( 'Sitemaps', 'wds' );
335
  }
336
 
337
+ /**
338
+ * @return void
339
+ */
340
  public function trigger_crawl_after_activation() {
341
  $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
342
  $service->start();
343
  }
344
 
 
 
 
 
 
 
345
  /**
346
+ * @return false|void
 
 
347
  */
348
  public function process_run_action() {
349
+ if ( isset( $_GET['_wds_nonce'], $_GET['run-crawl'] ) && wp_verify_nonce( wp_unslash( $_GET['_wds_nonce'] ), 'wds-crawl-nonce' ) ) { // phpcs:ignore -- No need of sanitization for nonce.
350
+ // Simple presence switch, no value.
351
  return $this->run_crawl();
352
  }
353
 
354
  return false;
355
  }
356
 
357
+ /**
358
+ * @return string
359
+ */
360
  public static function crawl_url() {
361
  $crawl_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP );
362
 
363
+ return esc_url_raw(
364
+ add_query_arg(
365
+ array(
366
+ 'run-crawl' => 'yes',
367
+ '_wds_nonce' => wp_create_nonce( 'wds-crawl-nonce' ),
368
+ ),
369
+ $crawl_url
370
+ )
371
+ );
372
  }
373
 
374
  /**
377
  public function run_crawl() {
378
  $error = '';
379
  if ( current_user_can( 'manage_options' ) ) {
380
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
381
  $response = $service->start();
382
+ $error = is_wp_error( $response )
383
  ? $response->get_error_message()
384
  : '';
385
  }
395
  die;
396
  }
397
 
398
+ /**
399
+ * @return void
400
+ */
401
  public function add_crawl_status_message() {
402
+ $crawl_in_progress = smartcrawl_get_array_value( $_GET, 'crawl-in-progress' ); // phpcs:ignore -- Not needed.
403
  if ( is_null( $crawl_in_progress ) ) {
404
  return;
405
  }
406
 
407
+ $crawl_in_progress = (bool) $crawl_in_progress;
408
  if ( ! $crawl_in_progress ) {
409
+ $message = (string) smartcrawl_get_array_value( $_GET, 'message' ); // phpcs:ignore -- Sanitized below.
410
  add_settings_error( $this->option_name, 'wds-crawl-not-started', wp_strip_all_tags( $message ) );
411
  }
412
  }
417
  public function options_page() {
418
  parent::options_page();
419
 
 
420
  $arguments = array(
421
  'post_types' => array(),
422
  'taxonomies' => array(),
429
  ),
430
  );
431
 
432
+ foreach ( $this->get_post_types_options() as $opt => $post_type ) {
433
  $arguments['post_types'][ $opt ] = $post_type;
434
  }
435
+ foreach ( $this->get_taxonomies_options() as $opt => $taxonomy ) {
436
  $arguments['taxonomies'][ $opt ] = $taxonomy;
437
  }
438
 
439
+ $arguments['smartcrawl_buddypress'] = $this->get_buddyress_template_values();
440
 
441
+ $arguments['active_tab'] = $this->get_active_tab( 'tab_sitemap' );
442
 
443
  $extra_urls = Smartcrawl_Sitemap_Utils::get_extra_urls();
444
  if ( is_array( $extra_urls ) ) {
464
 
465
  wp_enqueue_script( Smartcrawl_Controller_Assets::SITEMAPS_PAGE_JS );
466
 
467
+ $this->render_page( 'sitemap/sitemap-settings', $arguments );
468
  }
469
 
470
  /**
473
  public function defaults() {
474
  $this->options = get_option( $this->option_name );
475
 
476
+ $dir = wp_upload_dir();
477
  $path = trailingslashit( $dir['basedir'] );
478
 
479
  if ( empty( $this->options['wds_sitemap-setup'] ) ) {
535
  $this->options['crawler-frequency'] = Smartcrawl_Controller_Cron::get()->get_default_frequency();
536
  }
537
  if ( ! isset( $this->options['crawler-dow'] ) ) {
538
+ $this->options['crawler-dow'] = wp_rand( 0, 6 );
539
  }
540
  if ( ! isset( $this->options['crawler-tod'] ) ) {
541
+ $this->options['crawler-tod'] = wp_rand( 0, 23 );
542
  }
543
  if ( ! isset( $this->options['items-per-sitemap'] ) ) {
544
  $this->options['items-per-sitemap'] = Smartcrawl_Sitemap_Utils::DEFAULT_ITEMS_PER_SITEMAP;
562
  update_option( $this->option_name, $this->options );
563
  }
564
 
565
+ /**
566
+ * @return array|array[]
567
+ */
568
+ protected function get_view_defaults() {
569
  return $this->populate_view_defaults();
570
  }
571
 
572
+ /**
573
+ * @return array[]
574
+ */
575
  protected function populate_view_defaults() {
576
+ $args = parent::get_view_defaults();
577
 
578
+ $view = smartcrawl_get_array_value( $args, '_view' );
579
+ $view = empty( $view ) ? array() : $view;
580
+ $seo_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
581
  $view['crawl_report'] = $seo_service->get_report();
582
 
583
  return array( '_view' => $view );
584
  }
585
 
586
  private function validate_dow( $frequency, $dow ) {
587
+ if ( 'monthly' === $frequency ) {
588
  return in_array( $dow, range( 1, 28 ), true ) ? $dow : 1;
589
  } else {
590
  return in_array( $dow, range( 0, 6 ), true ) ? $dow : 0;
591
  }
592
  }
593
 
594
+ /**
595
+ * @return array|array[]|mixed
596
+ */
597
  public static function get_email_recipients() {
598
+ $options = Smartcrawl_Settings::get_component_options( self::COMP_SITEMAP );
599
+ $recipients = smartcrawl_get_array_value( $options, 'sitemap-email-recipients' );
600
  $dash_profile_data = smartcrawl_get_dash_profile_data();
601
  if ( is_null( $recipients ) && $dash_profile_data ) {
602
  return array(
618
  }
619
 
620
  /**
621
+ * Sanitize crawler emails.
622
+ *
623
+ * @param array $input Input.
624
+ * @param array $result Result.
625
  *
626
  * @return array
627
  */
631
  if ( ! empty( $email_recipients ) ) {
632
  $sanitized_recipients = array();
633
  foreach ( $email_recipients as $recipient ) {
634
+ $recipient_name = smartcrawl_get_array_value( $recipient, 'name' );
635
  $recipient_email = smartcrawl_get_array_value( $recipient, 'email' );
636
 
637
  if (
651
  }
652
  $result['sitemap-email-recipients'] = $sanitized_recipients;
653
  }
654
+
655
  return $result;
656
  }
657
  }
includes/admin/settings/social.php CHANGED
@@ -2,21 +2,12 @@
2
 
3
  class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
4
 
5
-
6
- private static $_instance;
7
-
8
- public static function get_instance() {
9
- if ( empty( self::$_instance ) ) {
10
- self::$_instance = new self();
11
- }
12
-
13
- return self::$_instance;
14
- }
15
 
16
  /**
17
  * Validate submitted options
18
  *
19
- * @param array $input Raw input
20
  *
21
  * @return array Validated input
22
  */
@@ -77,22 +68,22 @@ class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
77
  $result['fb-app-id'] = sanitize_text_field( $input['fb-app-id'] );
78
  }
79
 
80
- $result['og-enable'] = ! empty( $input['og-enable'] );
81
  $result['twitter-card-enable'] = ! empty( $input['twitter-card-enable'] );
82
 
83
- $this->_toggle_og_globally(
84
  $result['og-enable']
85
  );
86
 
87
- $this->_toggle_twitter_cards_globally(
88
  $result['twitter-card-enable']
89
  );
90
 
91
  if ( ! empty( $input['pinterest-verify'] ) ) {
92
- $pin = Smartcrawl_Pinterest_Printer::get();
93
- $raw = trim( $input['pinterest-verify'] );
94
- $tag = $pin->get_verified_tag( $raw );
95
- $result['pinterest-verify'] = str_replace( ' ', '', $raw ) === str_replace( ' ', '', $tag ) ? $tag : false;
96
  $result['pinterest-verification-status'] = str_replace( ' ', '', $raw ) === str_replace( ' ', '', $tag ) ? '' : 'fail';
97
  } else {
98
  $result['pinterest-verification-status'] = false;
@@ -101,13 +92,13 @@ class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
101
  return $result;
102
  }
103
 
104
- private function _toggle_og_globally( $new_value ) {
105
  $this->toggle_setting_globally( 'og-active', $new_value );
106
  }
107
 
108
  private function toggle_setting_globally( $prefix, $new_value ) {
109
  $existing_settings = Smartcrawl_Settings::get_specific_options( 'wds_onpage_options' );
110
- $strings = array(
111
  'home',
112
  'author',
113
  'date',
@@ -138,20 +129,26 @@ class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
138
  Smartcrawl_Settings::update_specific_options( 'wds_onpage_options', $existing_settings );
139
  }
140
 
141
- private function _toggle_twitter_cards_globally( $new_value ) {
142
  $this->toggle_setting_globally( 'twitter-active', $new_value );
143
  }
144
 
 
 
 
145
  public function init() {
146
  $this->option_name = 'wds_social_options';
147
- $this->name = Smartcrawl_Settings::COMP_SOCIAL;
148
- $this->slug = Smartcrawl_Settings::TAB_SOCIAL;
149
- $this->action_url = admin_url( 'options.php' );
150
- $this->page_title = __( 'SmartCrawl Wizard: Social', 'wds' );
151
 
152
  parent::init();
153
  }
154
 
 
 
 
155
  public function get_title() {
156
  return __( 'Social', 'wds' );
157
  }
@@ -168,14 +165,14 @@ class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
168
  $this->get_default_options()
169
  );
170
 
171
- $arguments = array(
172
  'options' => $options,
173
  );
174
- $arguments['active_tab'] = $this->_get_active_tab( 'tab_open_graph' );
175
  wp_enqueue_script( Smartcrawl_Controller_Assets::SOCIAL_PAGE_JS );
176
  wp_enqueue_media();
177
 
178
- $this->_render_page( 'social/social-settings', $arguments );
179
  }
180
 
181
  /**
@@ -185,7 +182,7 @@ class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
185
  */
186
  public function get_default_options() {
187
  return array(
188
- // Accounts
189
  'sitename' => get_bloginfo( 'name' ),
190
  'disable-schema' => false,
191
  'schema_type' => Smartcrawl_Schema_Type_Constants::TYPE_ORGANIZATION,
@@ -198,14 +195,14 @@ class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
198
  'linkedin_url' => '',
199
  'pinterest_url' => '',
200
  'youtube_url' => '',
201
- // Twitter
202
  'twitter-card-enable' => true,
203
  'twitter-card-type' => '',
204
- // Pinterest
205
  'pinterest-verify' => '',
206
- // OpenGraph
207
  'og-enable' => true,
208
- // Facebook-specific
209
  'fb-app-id' => '',
210
  );
211
  }
@@ -231,6 +228,7 @@ class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
231
  return ! empty( $input['disable-schema'] );
232
  } else {
233
  $previous = Smartcrawl_Settings::get_component_options( $this->name );
 
234
  return (bool) smartcrawl_get_array_value( $previous, 'disable-schema' );
235
  }
236
  }
2
 
3
  class Smartcrawl_Social_Settings extends Smartcrawl_Settings_Admin {
4
 
5
+ use Smartcrawl_Singleton;
 
 
 
 
 
 
 
 
 
6
 
7
  /**
8
  * Validate submitted options
9
  *
10
+ * @param array $input Raw input.
11
  *
12
  * @return array Validated input
13
  */
68
  $result['fb-app-id'] = sanitize_text_field( $input['fb-app-id'] );
69
  }
70
 
71
+ $result['og-enable'] = ! empty( $input['og-enable'] );
72
  $result['twitter-card-enable'] = ! empty( $input['twitter-card-enable'] );
73
 
74
+ $this->toggle_og_globally(
75
  $result['og-enable']
76
  );
77
 
78
+ $this->toggle_twitter_cards_globally(
79
  $result['twitter-card-enable']
80
  );
81
 
82
  if ( ! empty( $input['pinterest-verify'] ) ) {
83
+ $pin = Smartcrawl_Pinterest_Printer::get();
84
+ $raw = trim( $input['pinterest-verify'] );
85
+ $tag = $pin->get_verified_tag( $raw );
86
+ $result['pinterest-verify'] = str_replace( ' ', '', $raw ) === str_replace( ' ', '', $tag ) ? $tag : false;
87
  $result['pinterest-verification-status'] = str_replace( ' ', '', $raw ) === str_replace( ' ', '', $tag ) ? '' : 'fail';
88
  } else {
89
  $result['pinterest-verification-status'] = false;
92
  return $result;
93
  }
94
 
95
+ private function toggle_og_globally( $new_value ) {
96
  $this->toggle_setting_globally( 'og-active', $new_value );
97
  }
98
 
99
  private function toggle_setting_globally( $prefix, $new_value ) {
100
  $existing_settings = Smartcrawl_Settings::get_specific_options( 'wds_onpage_options' );
101
+ $strings = array(
102
  'home',
103
  'author',
104
  'date',
129
  Smartcrawl_Settings::update_specific_options( 'wds_onpage_options', $existing_settings );
130
  }
131
 
132
+ private function toggle_twitter_cards_globally( $new_value ) {
133
  $this->toggle_setting_globally( 'twitter-active', $new_value );
134
  }
135
 
136
+ /**
137
+ * @return void
138
+ */
139
  public function init() {
140
  $this->option_name = 'wds_social_options';
141
+ $this->name = Smartcrawl_Settings::COMP_SOCIAL;
142
+ $this->slug = Smartcrawl_Settings::TAB_SOCIAL;
143
+ $this->action_url = admin_url( 'options.php' );
144
+ $this->page_title = __( 'SmartCrawl Wizard: Social', 'wds' );
145
 
146
  parent::init();
147
  }
148
 
149
+ /**
150
+ * @return string
151
+ */
152
  public function get_title() {
153
  return __( 'Social', 'wds' );
154
  }
165
  $this->get_default_options()
166
  );
167
 
168
+ $arguments = array(
169
  'options' => $options,
170
  );
171
+ $arguments['active_tab'] = $this->get_active_tab( 'tab_open_graph' );
172
  wp_enqueue_script( Smartcrawl_Controller_Assets::SOCIAL_PAGE_JS );
173
  wp_enqueue_media();
174
 
175
+ $this->render_page( 'social/social-settings', $arguments );
176
  }
177
 
178
  /**
182
  */
183
  public function get_default_options() {
184
  return array(
185
+ // Accounts.
186
  'sitename' => get_bloginfo( 'name' ),
187
  'disable-schema' => false,
188
  'schema_type' => Smartcrawl_Schema_Type_Constants::TYPE_ORGANIZATION,
195
  'linkedin_url' => '',
196
  'pinterest_url' => '',
197
  'youtube_url' => '',
198
+ // Twitter.
199
  'twitter-card-enable' => true,
200
  'twitter-card-type' => '',
201
+ // Pinterest.
202
  'pinterest-verify' => '',
203
+ // OpenGraph.
204
  'og-enable' => true,
205
+ // Facebook-specific.
206
  'fb-app-id' => '',
207
  );
208
  }
228
  return ! empty( $input['disable-schema'] );
229
  } else {
230
  $previous = Smartcrawl_Settings::get_component_options( $this->name );
231
+
232
  return (bool) smartcrawl_get_array_value( $previous, 'disable-schema' );
233
  }
234
  }
includes/admin/taxonomy.php CHANGED
@@ -1,20 +1,21 @@
1
  <?php
2
 
3
  class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
4
- /**
5
- * Static instance
6
- *
7
- * @var self
8
- */
9
- private static $_instance;
10
 
11
  protected function init() {
12
  $taxonomy = smartcrawl_get_array_value( $_GET, 'taxonomy' ); // phpcs:ignore -- Can't add nonce to the request
13
  if ( is_admin() && ! empty( $taxonomy ) ) {
14
- add_action( sanitize_key( $taxonomy ) . '_edit_form', array(
15
- &$this,
16
- 'term_additions_form',
17
- ), 10, 2 );
 
 
 
 
 
18
  }
19
 
20
  add_action( 'edit_term', array( &$this, 'update_term' ), 10, 3 );
@@ -22,9 +23,9 @@ class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
22
  }
23
 
24
  public function json_create_preview() {
25
- $data = $this->get_request_data();
26
  $term_id = (int) smartcrawl_get_array_value( $data, 'term_id' );
27
- $result = array( 'success' => false );
28
 
29
  if ( empty( $term_id ) ) {
30
  wp_send_json( $result );
@@ -33,26 +34,18 @@ class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
33
  }
34
 
35
  $result['success'] = true;
36
- $result['markup'] = Smartcrawl_Simple_Renderer::load( 'term/term-google-preview', array(
37
- 'term' => get_term( $term_id ),
38
- ) );
 
 
 
39
 
40
  wp_send_json( $result );
41
  }
42
 
43
  private function get_request_data() {
44
- return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-metabox-nonce' ) ? stripslashes_deep( $_POST ) : array();
45
- }
46
-
47
- /**
48
- * Static instance getter
49
- */
50
- public static function get() {
51
- if ( empty( self::$_instance ) ) {
52
- self::$_instance = new self();
53
- }
54
-
55
- return self::$_instance;
56
  }
57
 
58
  public function term_additions_form( $term, $taxonomy ) {
@@ -62,7 +55,7 @@ class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
62
  }
63
 
64
  $smartcrawl_options = Smartcrawl_Settings::get_options();
65
- $tax_meta = get_option( 'wds_taxonomy_meta' );
66
 
67
  if ( isset( $tax_meta[ $taxonomy ][ $term->term_id ] ) ) {
68
  $tax_meta = $tax_meta[ $taxonomy ][ $term->term_id ];
@@ -70,7 +63,7 @@ class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
70
 
71
  $taxonomy_labels = $taxonomy_object->labels;
72
 
73
- $global_noindex = ! empty( $smartcrawl_options[ 'meta_robots-noindex-' . $term->taxonomy ] )
74
  ? $smartcrawl_options[ 'meta_robots-noindex-' . $term->taxonomy ]
75
  : false;
76
  $global_nofollow = ! empty( $smartcrawl_options[ 'meta_robots-nofollow-' . $term->taxonomy ] )
@@ -81,14 +74,17 @@ class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
81
  wp_enqueue_script( Smartcrawl_Controller_Assets::TERM_FORM_JS );
82
  wp_enqueue_media();
83
 
84
- Smartcrawl_Simple_Renderer::render( 'term/term-form', array(
85
- 'taxonomy_object' => $taxonomy_object,
86
- 'taxonomy_labels' => $taxonomy_labels,
87
- 'term' => $term,
88
- 'global_noindex' => $global_noindex,
89
- 'global_nofollow' => $global_nofollow,
90
- 'tax_meta' => $tax_meta,
91
- ) );
 
 
 
92
  }
93
 
94
  public function update_term( $term_id, $tt_id, $taxonomy ) {
@@ -99,39 +95,34 @@ class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
99
 
100
  $smartcrawl_options = Smartcrawl_Settings::get_options();
101
 
102
- $tax_meta = get_option( 'wds_taxonomy_meta' );
103
- $post_data = isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'update-tag_' . $term_id )
104
  ? stripslashes_deep( $_POST )
105
  : array();
106
 
107
  foreach ( array( 'title', 'desc', 'bctitle', 'canonical' ) as $key ) {
108
- $value = isset( $post_data["wds_{$key}"] )
109
- ? $post_data["wds_{$key}"]
110
- : '';
111
  if ( 'canonical' === $key ) {
112
  $value = esc_url_raw( $value );
113
  } else {
114
  $value = smartcrawl_sanitize_preserve_macros( $value );
115
  }
116
- $tax_meta[ $taxonomy ][ $term_id ]["wds_{$key}"] = $value;
117
  }
118
 
119
  foreach ( array( 'noindex', 'nofollow' ) as $key ) {
120
- $global = ! empty( $smartcrawl_options["meta_robots-{$key}-{$taxonomy}"] ) ? (bool) $smartcrawl_options["meta_robots-{$key}-{$taxonomy}"] : false;
121
 
122
  if ( ! $global ) {
123
- $tax_meta[ $taxonomy ][ $term_id ][ 'wds_' . $key ] = isset( $post_data["wds_{$key}"] )
124
- ? (bool) $post_data["wds_{$key}"]
125
- : false;
126
  } else {
127
- $tax_meta[ $taxonomy ][ $term_id ]["wds_override_{$key}"] = isset( $post_data["wds_override_{$key}"] )
128
- ? (bool) $post_data["wds_override_{$key}"]
129
- : false;
130
  }
131
  }
132
 
133
  if ( ! empty( $post_data['wds-opengraph'] ) ) {
134
  $data = is_array( $post_data['wds-opengraph'] ) ? stripslashes_deep( $post_data['wds-opengraph'] ) : array();
 
135
  $tax_meta[ $taxonomy ][ $term_id ]['opengraph'] = array();
136
  if ( ! empty( $data['title'] ) ) {
137
  $tax_meta[ $taxonomy ][ $term_id ]['opengraph']['title'] = smartcrawl_sanitize_preserve_macros( $data['title'] );
@@ -150,6 +141,7 @@ class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
150
 
151
  if ( ! empty( $post_data['wds-twitter'] ) ) {
152
  $data = is_array( $post_data['wds-twitter'] ) ? stripslashes_deep( $post_data['wds-twitter'] ) : array();
 
153
  $tax_meta[ $taxonomy ][ $term_id ]['twitter'] = array();
154
  if ( ! empty( $data['title'] ) ) {
155
  $tax_meta[ $taxonomy ][ $term_id ]['twitter']['title'] = smartcrawl_sanitize_preserve_macros( $data['title'] );
@@ -169,10 +161,10 @@ class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
169
  update_option( 'wds_taxonomy_meta', $tax_meta );
170
 
171
  if ( function_exists( 'w3tc_flush_all' ) ) {
172
- // Use W3TC API v0.9.5+
173
  w3tc_flush_all();
174
  } elseif ( defined( 'W3TC_DIR' ) && is_readable( W3TC_DIR . '/lib/W3/ObjectCache.php' ) ) {
175
- // Old (very old) API
176
  require_once W3TC_DIR . '/lib/W3/ObjectCache.php';
177
  $w3_objectcache = &W3_ObjectCache::instance();
178
 
1
  <?php
2
 
3
  class Smartcrawl_Taxonomy extends Smartcrawl_Base_Controller {
4
+
5
+ use Smartcrawl_Singleton;
 
 
 
 
6
 
7
  protected function init() {
8
  $taxonomy = smartcrawl_get_array_value( $_GET, 'taxonomy' ); // phpcs:ignore -- Can't add nonce to the request
9
  if ( is_admin() && ! empty( $taxonomy ) ) {
10
+ add_action(
11
+ sanitize_key( $taxonomy ) . '_edit_form',
12
+ array(
13
+ &$this,
14
+ 'term_additions_form',
15
+ ),
16
+ 10,
17
+ 2
18
+ );
19
  }
20
 
21
  add_action( 'edit_term', array( &$this, 'update_term' ), 10, 3 );
23
  }
24
 
25
  public function json_create_preview() {
26
+ $data = $this->get_request_data();
27
  $term_id = (int) smartcrawl_get_array_value( $data, 'term_id' );
28
+ $result = array( 'success' => false );
29
 
30
  if ( empty( $term_id ) ) {
31
  wp_send_json( $result );
34
  }
35
 
36
  $result['success'] = true;
37
+ $result['markup'] = Smartcrawl_Simple_Renderer::load(
38
+ 'term/term-google-preview',
39
+ array(
40
+ 'term' => get_term( $term_id ),
41
+ )
42
+ );
43
 
44
  wp_send_json( $result );
45
  }
46
 
47
  private function get_request_data() {
48
+ return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wds_nonce'] ), 'wds-metabox-nonce' ) ? stripslashes_deep( $_POST ) : array(); // phpcs:ignore
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
 
51
  public function term_additions_form( $term, $taxonomy ) {
55
  }
56
 
57
  $smartcrawl_options = Smartcrawl_Settings::get_options();
58
+ $tax_meta = get_option( 'wds_taxonomy_meta' );
59
 
60
  if ( isset( $tax_meta[ $taxonomy ][ $term->term_id ] ) ) {
61
  $tax_meta = $tax_meta[ $taxonomy ][ $term->term_id ];
63
 
64
  $taxonomy_labels = $taxonomy_object->labels;
65
 
66
+ $global_noindex = ! empty( $smartcrawl_options[ 'meta_robots-noindex-' . $term->taxonomy ] )
67
  ? $smartcrawl_options[ 'meta_robots-noindex-' . $term->taxonomy ]
68
  : false;
69
  $global_nofollow = ! empty( $smartcrawl_options[ 'meta_robots-nofollow-' . $term->taxonomy ] )
74
  wp_enqueue_script( Smartcrawl_Controller_Assets::TERM_FORM_JS );
75
  wp_enqueue_media();
76
 
77
+ Smartcrawl_Simple_Renderer::render(
78
+ 'term/term-form',
79
+ array(
80
+ 'taxonomy_object' => $taxonomy_object,
81
+ 'taxonomy_labels' => $taxonomy_labels,
82
+ 'term' => $term,
83
+ 'global_noindex' => $global_noindex,
84
+ 'global_nofollow' => $global_nofollow,
85
+ 'tax_meta' => $tax_meta,
86
+ )
87
+ );
88
  }
89
 
90
  public function update_term( $term_id, $tt_id, $taxonomy ) {
95
 
96
  $smartcrawl_options = Smartcrawl_Settings::get_options();
97
 
98
+ $tax_meta = get_option( 'wds_taxonomy_meta' );
99
+ $post_data = isset( $_POST['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_POST['_wpnonce'] ), 'update-tag_' . $term_id ) // phpcs:ignore
100
  ? stripslashes_deep( $_POST )
101
  : array();
102
 
103
  foreach ( array( 'title', 'desc', 'bctitle', 'canonical' ) as $key ) {
104
+ $value = isset( $post_data[ 'wds_' . $key ] ) ? $post_data[ 'wds_' . $key ] : '';
 
 
105
  if ( 'canonical' === $key ) {
106
  $value = esc_url_raw( $value );
107
  } else {
108
  $value = smartcrawl_sanitize_preserve_macros( $value );
109
  }
110
+ $tax_meta[ $taxonomy ][ $term_id ][ 'wds_' . $key ] = $value;
111
  }
112
 
113
  foreach ( array( 'noindex', 'nofollow' ) as $key ) {
114
+ $global = ! empty( $smartcrawl_options[ 'meta_robots-' . $key . '-' . $taxonomy ] ) && (bool) $smartcrawl_options[ 'meta_robots-' . $key . '-' . $taxonomy ];
115
 
116
  if ( ! $global ) {
117
+ $tax_meta[ $taxonomy ][ $term_id ][ 'wds_' . $key ] = isset( $post_data[ 'wds_' . $key ] ) && (bool) $post_data[ 'wds_' . $key ];
 
 
118
  } else {
119
+ $tax_meta[ $taxonomy ][ $term_id ][ 'wds_override_' . $key ] = isset( $post_data[ 'wds_override_' . $key ] ) && (bool) $post_data[ 'wds_override_' . $key ];
 
 
120
  }
121
  }
122
 
123
  if ( ! empty( $post_data['wds-opengraph'] ) ) {
124
  $data = is_array( $post_data['wds-opengraph'] ) ? stripslashes_deep( $post_data['wds-opengraph'] ) : array();
125
+
126
  $tax_meta[ $taxonomy ][ $term_id ]['opengraph'] = array();
127
  if ( ! empty( $data['title'] ) ) {
128
  $tax_meta[ $taxonomy ][ $term_id ]['opengraph']['title'] = smartcrawl_sanitize_preserve_macros( $data['title'] );
141
 
142
  if ( ! empty( $post_data['wds-twitter'] ) ) {
143
  $data = is_array( $post_data['wds-twitter'] ) ? stripslashes_deep( $post_data['wds-twitter'] ) : array();
144
+
145
  $tax_meta[ $taxonomy ][ $term_id ]['twitter'] = array();
146
  if ( ! empty( $data['title'] ) ) {
147
  $tax_meta[ $taxonomy ][ $term_id ]['twitter']['title'] = smartcrawl_sanitize_preserve_macros( $data['title'] );
161
  update_option( 'wds_taxonomy_meta', $tax_meta );
162
 
163
  if ( function_exists( 'w3tc_flush_all' ) ) {
164
+ // Use W3TC API v0.9.5+.
165
  w3tc_flush_all();
166
  } elseif ( defined( 'W3TC_DIR' ) && is_readable( W3TC_DIR . '/lib/W3/ObjectCache.php' ) ) {
167
+ // Old (very old) API.
168
  require_once W3TC_DIR . '/lib/W3/ObjectCache.php';
169
  $w3_objectcache = &W3_ObjectCache::instance();
170
 
includes/admin/templates/advanced-tools/advanced-automatic-linking-types.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $insert = empty( $insert ) ? array() : $insert;
4
- $linkto = empty( $linkto ) ? array() : $linkto;
5
  ?>
6
 
7
  <div class="sui-row wds-autolink-types">
@@ -10,24 +10,29 @@ $linkto = empty( $linkto ) ? array() : $linkto;
10
 
11
  <div class="sui-field-list-header">
12
  <h3 class="sui-field-list-title"><?php esc_html_e( 'Insert Links', 'wds' ); ?></h3>
13
- <p id="link-to-description"
14
- class="sui-description"><?php esc_html_e( 'Choose what post types to allow.', 'wds' ); ?></p>
 
 
15
  </div>
16
 
17
  <div class="sui-field-list-body">
18
- <?php foreach ( $insert as $insert_key => $insert_label ): ?>
19
- <?php $checked = ( ! empty( $_view['options'][ $insert_key ] ) ) ? "checked" : ''; ?>
20
  <div class="sui-field-list-item">
21
- <label class="sui-field-list-item-label"
22
- for="<?php echo esc_attr( $option_name ); ?>-<?php echo esc_attr( $insert_key ); ?>">
 
23
  <small><strong><?php echo esc_html( $insert_label ); ?></strong></small>
24
  </label>
25
  <label class="sui-toggle">
26
- <input type="checkbox" <?php echo esc_attr( $checked ); ?>
27
- aria-describedby="link-to-description"
28
- value="<?php echo esc_attr( $insert_key ); ?>"
29
- name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $insert_key ); ?>]"
30
- id="<?php echo esc_attr( $option_name ); ?>-<?php echo esc_attr( $insert_key ); ?>">
 
 
31
  <span aria-hidden="true" class="sui-toggle-slider"></span>
32
  </label>
33
  </div>
@@ -47,20 +52,22 @@ $linkto = empty( $linkto ) ? array() : $linkto;
47
  </div>
48
 
49
  <div class="sui-field-list-body">
50
- <?php foreach ( $linkto as $linkto_key => $linkto_label ): ?>
51
- <?php $checked = ( ! empty( $_view['options'][ $linkto_key ] ) ) ? "checked" : ''; ?>
52
 
53
  <div class="sui-field-list-item">
54
- <label class="sui-field-list-item-label"
55
- for="<?php echo esc_attr( $option_name ); ?>-<?php echo esc_attr( $linkto_key ); ?>">
 
56
  <small><strong><?php echo esc_html( $linkto_label ); ?></strong></small>
57
  </label>
58
  <label class="sui-toggle">
59
- <input type="checkbox" <?php echo esc_attr( $checked ); ?>
60
- aria-describedby="insert-list-description"
61
- value="<?php echo esc_attr( $linkto_key ); ?>"
62
- name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $linkto_key ); ?>]"
63
- id="<?php echo esc_attr( $option_name ); ?>-<?php echo esc_attr( $linkto_key ); ?>">
 
64
  <span aria-hidden="true" class="sui-toggle-slider"></span>
65
  </label>
66
  </div>
1
  <?php
2
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $insert = empty( $insert ) ? array() : $insert;
4
+ $linkto = empty( $linkto ) ? array() : $linkto;
5
  ?>
6
 
7
  <div class="sui-row wds-autolink-types">
10
 
11
  <div class="sui-field-list-header">
12
  <h3 class="sui-field-list-title"><?php esc_html_e( 'Insert Links', 'wds' ); ?></h3>
13
+ <p
14
+ id="link-to-description"
15
+ class="sui-description"
16
+ ><?php esc_html_e( 'Choose what post types to allow.', 'wds' ); ?></p>
17
  </div>
18
 
19
  <div class="sui-field-list-body">
20
+ <?php foreach ( $insert as $insert_key => $insert_label ) : ?>
21
+ <?php $checked = ( ! empty( $_view['options'][ $insert_key ] ) ) ? 'checked' : ''; ?>
22
  <div class="sui-field-list-item">
23
+ <label
24
+ class="sui-field-list-item-label"
25
+ for="<?php echo esc_attr( $option_name ); ?>-<?php echo esc_attr( $insert_key ); ?>">
26
  <small><strong><?php echo esc_html( $insert_label ); ?></strong></small>
27
  </label>
28
  <label class="sui-toggle">
29
+ <input
30
+ type="checkbox" <?php echo esc_attr( $checked ); ?>
31
+ aria-describedby="link-to-description"
32
+ value="<?php echo esc_attr( $insert_key ); ?>"
33
+ name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $insert_key ); ?>]"
34
+ id="<?php echo esc_attr( $option_name ); ?>-<?php echo esc_attr( $insert_key ); ?>"
35
+ >
36
  <span aria-hidden="true" class="sui-toggle-slider"></span>
37
  </label>
38
  </div>
52
  </div>
53
 
54
  <div class="sui-field-list-body">
55
+ <?php foreach ( $linkto as $linkto_key => $linkto_label ) : ?>
56
+ <?php $checked = ( ! empty( $_view['options'][ $linkto_key ] ) ) ? 'checked' : ''; ?>
57
 
58
  <div class="sui-field-list-item">
59
+ <label
60
+ class="sui-field-list-item-label"
61
+ for="<?php echo esc_attr( $option_name ); ?>-<?php echo esc_attr( $linkto_key ); ?>">
62
  <small><strong><?php echo esc_html( $linkto_label ); ?></strong></small>
63
  </label>
64
  <label class="sui-toggle">
65
+ <input
66
+ type="checkbox" <?php echo esc_attr( $checked ); ?>
67
+ aria-describedby="insert-list-description"
68
+ value="<?php echo esc_attr( $linkto_key ); ?>"
69
+ name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $linkto_key ); ?>]"
70
+ id="<?php echo esc_attr( $option_name ); ?>-<?php echo esc_attr( $linkto_key ); ?>">
71
  <span aria-hidden="true" class="sui-toggle-slider"></span>
72
  </label>
73
  </div>
includes/admin/templates/advanced-tools/advanced-redirect-image-attachments.php CHANGED
@@ -5,10 +5,10 @@ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
5
  <div class="sui-form-field">
6
  <label for="redirect-attachments-images_only" class="sui-checkbox">
7
  <input
8
- type="checkbox"
9
- id="redirect-attachments-images_only"
10
- aria-labelledby="label-redirect-attachments-images_only"
11
- name="<?php echo esc_html( $option_name ); ?>[redirect-attachments-images_only]"
12
  <?php checked( ! empty( $_view['options']['redirect-attachments-images_only'] ) ); ?>
13
  />
14
  <span aria-hidden="true"></span>
5
  <div class="sui-form-field">
6
  <label for="redirect-attachments-images_only" class="sui-checkbox">
7
  <input
8
+ type="checkbox"
9
+ id="redirect-attachments-images_only"
10
+ aria-labelledby="label-redirect-attachments-images_only"
11
+ name="<?php echo esc_html( $option_name ); ?>[redirect-attachments-images_only]"
12
  <?php checked( ! empty( $_view['options']['redirect-attachments-images_only'] ) ); ?>
13
  />
14
  <span aria-hidden="true"></span>
includes/admin/templates/advanced-tools/advanced-robots-custom-sitemap-url-setting.php CHANGED
@@ -1,36 +1,47 @@
1
  <?php
2
- $sitemap_enabled = empty( $sitemap_enabled ) ? false : $sitemap_enabled;
3
  $custom_sitemap_url = empty( $custom_sitemap_url ) ? '' : $custom_sitemap_url;
4
- $option_name = empty( $option_name ) ? '' : $option_name;
5
  ?>
6
 
7
- <label for="custom_sitemap_url"
8
- class="sui-label"><?php esc_html_e( 'Sitemap URL', 'wds' ); ?></label>
9
- <?php if ( $sitemap_enabled ): ?>
10
- <input id="custom_sitemap_url" type="hidden"
11
- name="<?php echo esc_attr( $option_name ); ?>[custom_sitemap_url]"
12
- value="<?php echo esc_attr( $custom_sitemap_url ); ?>"/>
 
 
13
  <label>
14
- <input type="text"
15
- class="sui-form-control"
16
- readonly
17
- value="<?php echo esc_attr( smartcrawl_get_sitemap_url() ) ?>"/>
 
18
  </label>
19
- <?php $this->_render( 'notice', array(
20
- 'class' => 'wds-auto-sitemap-addition',
21
- 'message' => esc_html__( "We've detected you're using SmartCrawl's built in sitemap and will output this for you automatically.", 'wds' ),
22
- ) ); ?>
23
- <?php else: ?>
24
- <input id="custom_sitemap_url" type="text"
25
- class="sui-form-control"
26
- name="<?php echo esc_attr( $option_name ); ?>[custom_sitemap_url]"
27
- value="<?php echo esc_attr( $custom_sitemap_url ); ?>"/>
 
 
 
 
 
 
28
 
29
  <p class="sui-description">
30
- <?php printf(
31
- esc_html__( 'Copy and paste the URL to your sitemap. E.g %s or %s', 'wds' ),
 
32
  '<strong>/sitemap.xml</strong>',
33
  '<strong>https://example.com/sitemap.xml</strong>'
34
- ) ?>
 
35
  </p>
36
  <?php endif; ?>
1
  <?php
2
+ $sitemap_enabled = ! empty( $sitemap_enabled );
3
  $custom_sitemap_url = empty( $custom_sitemap_url ) ? '' : $custom_sitemap_url;
4
+ $option_name = empty( $option_name ) ? '' : $option_name;
5
  ?>
6
 
7
+ <label
8
+ for="custom_sitemap_url"
9
+ class="sui-label"><?php esc_html_e( 'Sitemap URL', 'wds' ); ?></label>
10
+ <?php if ( $sitemap_enabled ) : ?>
11
+ <input
12
+ id="custom_sitemap_url" type="hidden"
13
+ name="<?php echo esc_attr( $option_name ); ?>[custom_sitemap_url]"
14
+ value="<?php echo esc_attr( $custom_sitemap_url ); ?>"/>
15
  <label>
16
+ <input
17
+ type="text"
18
+ class="sui-form-control"
19
+ readonly
20
+ value="<?php echo esc_attr( smartcrawl_get_sitemap_url() ); ?>"/>
21
  </label>
22
+ <?php
23
+ $this->render_view(
24
+ 'notice',
25
+ array(
26
+ 'class' => 'wds-auto-sitemap-addition',
27
+ 'message' => esc_html__( "We've detected you're using SmartCrawl's built in sitemap and will output this for you automatically.", 'wds' ),
28
+ )
29
+ );
30
+ ?>
31
+ <?php else : ?>
32
+ <input
33
+ id="custom_sitemap_url" type="text"
34
+ class="sui-form-control"
35
+ name="<?php echo esc_attr( $option_name ); ?>[custom_sitemap_url]"
36
+ value="<?php echo esc_attr( $custom_sitemap_url ); ?>"/>
37
 
38
  <p class="sui-description">
39
+ <?php
40
+ printf(
41
+ esc_html__( 'Copy and paste the URL to your sitemap. E.g %1$s or %2$s', 'wds' ),
42
  '<strong>/sitemap.xml</strong>',
43
  '<strong>https://example.com/sitemap.xml</strong>'
44
+ )
45
+ ?>
46
  </p>
47
  <?php endif; ?>
includes/admin/templates/advanced-tools/advanced-robots-disabled.php CHANGED
@@ -2,10 +2,10 @@
2
  $image_url = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'graphic-autolinking-disabled.svg' );
3
  $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url );
4
 
5
- $content = esc_html__( "Search engines use web crawlers (bots) to explore and index the internet. A robots.txt file is a critical text file that tells those bots what they can and can’t index, and where things are.", 'wds' );
6
- $already_exists = empty( $already_exists ) ? false : true;
7
- $rootdir_install = empty( $rootdir_install ) ? false : true;
8
- $notice = smartcrawl_format_link(
9
  esc_html__( "We've detected an existing %s file that we are unable to edit. You will need to remove it before you can enable this feature.", 'wds' ),
10
  smartcrawl_get_robots_url(),
11
  'robots.txt',
@@ -16,8 +16,9 @@ $notice = smartcrawl_format_link(
16
  <form method="post" class="wds-form">
17
  <div class="wds-disabled-component">
18
  <p>
19
- <img src="<?php echo esc_attr( $image_url ); ?>"
20
- alt="<?php esc_attr_e( 'Disabled', 'wds' ); ?>" class="wds-disabled-image"/>
 
21
  </p>
22
 
23
  <p><?php echo wp_kses_post( $content ); ?></p>
@@ -26,20 +27,27 @@ $notice = smartcrawl_format_link(
26
  <?php wp_nonce_field( 'wds-settings-nonce', '_wds_nonce' ); ?>
27
 
28
  <?php if ( ! $already_exists && $rootdir_install ) : ?>
29
- <input name="submit" class="sui-button sui-button-blue"
30
- value="<?php echo esc_attr__( 'Activate', 'wds' ); ?>"
31
- type="submit"/>
 
32
  <?php endif; ?>
33
 
34
  <?php
35
  if ( $already_exists ) {
36
- $this->_render( 'notice', array(
37
- 'message' => $notice,
38
- ) );
39
- } else if ( ! $rootdir_install ) {
40
- $this->_render( 'notice', array(
41
- 'message' => esc_html__( "We've detected your site is installed on a sub-directory. Robots.txt files only work when added to the root directory of a domain, so you'll need to change how your WordPress installation is set up to use this feature.", 'wds' ),
42
- ) );
 
 
 
 
 
 
43
  }
44
  ?>
45
  </div>
2
  $image_url = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'graphic-autolinking-disabled.svg' );
3
  $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url );
4
 
5
+ $content = esc_html__( 'Search engines use web crawlers (bots) to explore and index the internet. A robots.txt file is a critical text file that tells those bots what they can and can’t index, and where things are.', 'wds' );
6
+ $already_exists = ! empty( $already_exists );
7
+ $rootdir_install = ! empty( $rootdir_install );
8
+ $notice = smartcrawl_format_link(
9
  esc_html__( "We've detected an existing %s file that we are unable to edit. You will need to remove it before you can enable this feature.", 'wds' ),
10
  smartcrawl_get_robots_url(),
11
  'robots.txt',
16
  <form method="post" class="wds-form">
17
  <div class="wds-disabled-component">
18
  <p>
19
+ <img
20
+ src="<?php echo esc_attr( $image_url ); ?>"
21
+ alt="<?php esc_attr_e( 'Disabled', 'wds' ); ?>" class="wds-disabled-image"/>
22
  </p>
23
 
24
  <p><?php echo wp_kses_post( $content ); ?></p>
27
  <?php wp_nonce_field( 'wds-settings-nonce', '_wds_nonce' ); ?>
28
 
29
  <?php if ( ! $already_exists && $rootdir_install ) : ?>
30
+ <input
31
+ name="submit" class="sui-button sui-button-blue"
32
+ value="<?php echo esc_attr__( 'Activate', 'wds' ); ?>"
33
+ type="submit"/>
34
  <?php endif; ?>
35
 
36
  <?php
37
  if ( $already_exists ) {
38
+ $this->render_view(
39
+ 'notice',
40
+ array(
41
+ 'message' => $notice,
42
+ )
43
+ );
44
+ } elseif ( ! $rootdir_install ) {
45
+ $this->render_view(
46
+ 'notice',
47
+ array(
48
+ 'message' => esc_html__( "We've detected your site is installed on a sub-directory. Robots.txt files only work when added to the root directory of a domain, so you'll need to change how your WordPress installation is set up to use this feature.", 'wds' ),
49
+ )
50
+ );
51
  }
52
  ?>
53
  </div>
includes/admin/templates/advanced-tools/advanced-robots-settings.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
- $sitemap_enabled = Smartcrawl_Sitemap_Utils::sitemap_enabled();
3
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
- $options = Smartcrawl_Settings::get_specific_options( 'wds_robots_options' );
5
  $sitemap_directive_disabled = smartcrawl_get_array_value( $options, 'sitemap_directive_disabled' );
6
- $custom_sitemap_url = smartcrawl_get_array_value( $options, 'custom_sitemap_url' );
7
- $custom_directives = Smartcrawl_Controller_Robots::get()->get_custom_directives();
8
- $robots_output = Smartcrawl_Controller_Robots::get()->get_robot_file_contents();
9
  ?>
10
 
11
  <form action="<?php echo esc_attr( $_view['action_url'] ); ?>" method="post" class="wds-form">
@@ -16,13 +16,20 @@ $robots_output = Smartcrawl_Controller_Robots::get()->get_robot_file_contents();
16
  <?php esc_html_e( 'Search engines use web crawlers (bots) to explore and index the internet. A robots.txt file is a critical text file that tells those bots what they can and can’t index, and where things are.', 'wds' ); ?>
17
  </p>
18
 
19
- <?php $this->_render( 'notice', array(
20
- 'class' => 'sui-notice-info',
21
- 'message' => smartcrawl_format_link(
22
- esc_html__( 'Your robots.txt is active and visible to bots. You can view it at %s', 'wds' ),
23
- smartcrawl_get_robots_url(), smartcrawl_get_robots_url(), '_blank'
24
- ),
25
- ) ); ?>
 
 
 
 
 
 
 
26
 
27
  <div class="sui-box-settings-row">
28
  <div class="sui-box-settings-col-1">
@@ -32,9 +39,10 @@ $robots_output = Smartcrawl_Controller_Robots::get()->get_robot_file_contents();
32
 
33
  <div class="sui-box-settings-col-2">
34
  <label for="robots-preview" class="sui-label"><?php esc_html_e( 'Robots.txt preview', 'wds' ); ?></label>
35
- <textarea id="robots-preview"
36
- readonly="readonly"
37
- class="sui-form-control"><?php echo esc_textarea( $robots_output ); ?></textarea>
 
38
  </div>
39
  </div>
40
 
@@ -45,19 +53,24 @@ $robots_output = Smartcrawl_Controller_Robots::get()->get_robot_file_contents();
45
  </div>
46
 
47
  <div class="sui-box-settings-col-2">
48
- <?php $this->_render( 'toggle-item', array(
49
- 'field_name' => sprintf( '%s[%s]', $option_name, 'sitemap_directive_disabled' ),
50
- 'field_id' => 'sitemap_directive_disabled',
51
- 'checked' => $sitemap_directive_disabled,
52
- 'item_label' => esc_html__( 'Link to my Sitemap', 'wds' ),
53
- 'inverted' => true,
54
- 'sub_settings_template' => 'advanced-tools/advanced-robots-custom-sitemap-url-setting',
55
- 'sub_settings_template_args' => array(
56
- 'option_name' => $option_name,
57
- 'sitemap_enabled' => $sitemap_enabled,
58
- 'custom_sitemap_url' => $custom_sitemap_url,
59
- ),
60
- ) ); ?>
 
 
 
 
 
61
  </div>
62
  </div>
63
 
@@ -65,21 +78,25 @@ $robots_output = Smartcrawl_Controller_Robots::get()->get_robot_file_contents();
65
  <div class="sui-box-settings-col-1">
66
  <label class="sui-settings-label"><?php esc_html_e( 'Customize', 'wds' ); ?></label>
67
  <p class="sui-description wds-documentation-link">
68
- <?php echo smartcrawl_format_link(
 
69
  esc_html__( 'Customize the robots.txt output here. We have %s on a range of examples and options for your robots.txt file.', 'wds' ),
70
  'https://wpmudev.com/docs/wpmu-dev-plugins/smartcrawl/#robots-txt-editor',
71
  esc_html__( 'full documentation', 'wds' ),
72
  '_blank'
73
- ); ?>
 
74
  </p>
75
  </div>
76
 
77
  <div class="sui-box-settings-col-2">
78
- <label for="robots-file-contents"
79
- class="sui-label"><?php esc_html_e( 'Edit your robots.txt file', 'wds' ); ?></label>
80
- <textarea id="robots-file-contents"
81
- name="<?php echo esc_attr( $option_name ); ?>[custom_directives]"
82
- class="sui-form-control"><?php echo esc_textarea( $custom_directives ); ?></textarea>
 
 
83
  </div>
84
  </div>
85
 
@@ -93,8 +110,9 @@ $robots_output = Smartcrawl_Controller_Robots::get()->get_robot_file_contents();
93
  </p>
94
  </div>
95
  <div class="sui-box-settings-col-2">
96
- <button type="submit" name="deactivate-robots-component"
97
- class="sui-button sui-button-ghost">
 
98
  <span class="sui-icon-power-on-off" aria-hidden="true"></span>
99
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
100
  </button>
1
  <?php
2
+ $sitemap_enabled = Smartcrawl_Sitemap_Utils::sitemap_enabled();
3
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
+ $options = Smartcrawl_Settings::get_specific_options( 'wds_robots_options' );
5
  $sitemap_directive_disabled = smartcrawl_get_array_value( $options, 'sitemap_directive_disabled' );
6
+ $custom_sitemap_url = smartcrawl_get_array_value( $options, 'custom_sitemap_url' );
7
+ $custom_directives = Smartcrawl_Controller_Robots::get()->get_custom_directives();
8
+ $robots_output = Smartcrawl_Controller_Robots::get()->get_robot_file_contents();
9
  ?>
10
 
11
  <form action="<?php echo esc_attr( $_view['action_url'] ); ?>" method="post" class="wds-form">
16
  <?php esc_html_e( 'Search engines use web crawlers (bots) to explore and index the internet. A robots.txt file is a critical text file that tells those bots what they can and can’t index, and where things are.', 'wds' ); ?>
17
  </p>
18
 
19
+ <?php
20
+ $this->render_view(
21
+ 'notice',
22
+ array(
23
+ 'class' => 'sui-notice-info',
24
+ 'message' => smartcrawl_format_link(
25
+ esc_html__( 'Your robots.txt is active and visible to bots. You can view it at %s', 'wds' ),
26
+ smartcrawl_get_robots_url(),
27
+ smartcrawl_get_robots_url(),
28
+ '_blank'
29
+ ),
30
+ )
31
+ );
32
+ ?>
33
 
34
  <div class="sui-box-settings-row">
35
  <div class="sui-box-settings-col-1">
39
 
40
  <div class="sui-box-settings-col-2">
41
  <label for="robots-preview" class="sui-label"><?php esc_html_e( 'Robots.txt preview', 'wds' ); ?></label>
42
+ <textarea
43
+ id="robots-preview"
44
+ readonly="readonly"
45
+ class="sui-form-control"><?php echo esc_textarea( $robots_output ); ?></textarea>
46
  </div>
47
  </div>
48
 
53
  </div>
54
 
55
  <div class="sui-box-settings-col-2">
56
+ <?php
57
+ $this->render_view(
58
+ 'toggle-item',
59
+ array(
60
+ 'field_name' => sprintf( '%s[%s]', $option_name, 'sitemap_directive_disabled' ),
61
+ 'field_id' => 'sitemap_directive_disabled',
62
+ 'checked' => $sitemap_directive_disabled,
63
+ 'item_label' => esc_html__( 'Link to my Sitemap', 'wds' ),
64
+ 'inverted' => true,
65
+ 'sub_settings_template' => 'advanced-tools/advanced-robots-custom-sitemap-url-setting',
66
+ 'sub_settings_template_args' => array(
67
+ 'option_name' => $option_name,
68
+ 'sitemap_enabled' => $sitemap_enabled,
69
+ 'custom_sitemap_url' => $custom_sitemap_url,
70
+ ),
71
+ )
72
+ );
73
+ ?>
74
  </div>
75
  </div>
76
 
78
  <div class="sui-box-settings-col-1">
79
  <label class="sui-settings-label"><?php esc_html_e( 'Customize', 'wds' ); ?></label>
80
  <p class="sui-description wds-documentation-link">
81
+ <?php
82
+ echo smartcrawl_format_link( // phpcs:ignore -- escaped inside.
83
  esc_html__( 'Customize the robots.txt output here. We have %s on a range of examples and options for your robots.txt file.', 'wds' ),
84
  'https://wpmudev.com/docs/wpmu-dev-plugins/smartcrawl/#robots-txt-editor',
85
  esc_html__( 'full documentation', 'wds' ),
86
  '_blank'
87
+ );
88
+ ?>
89
  </p>
90
  </div>
91
 
92
  <div class="sui-box-settings-col-2">
93
+ <label
94
+ for="robots-file-contents"
95
+ class="sui-label"><?php esc_html_e( 'Edit your robots.txt file', 'wds' ); ?></label>
96
+ <textarea
97
+ id="robots-file-contents"
98
+ name="<?php echo esc_attr( $option_name ); ?>[custom_directives]"
99
+ class="sui-form-control"><?php echo esc_textarea( $custom_directives ); ?></textarea>
100
  </div>
101
  </div>
102
 
110
  </p>
111
  </div>
112
  <div class="sui-box-settings-col-2">
113
+ <button
114
+ type="submit" name="deactivate-robots-component"
115
+ class="sui-button sui-button-ghost">
116
  <span class="sui-icon-power-on-off" aria-hidden="true"></span>
117
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
118
  </button>
includes/admin/templates/advanced-tools/advanced-section-automatic-linking-main.php CHANGED
@@ -1,12 +1,15 @@
1
  <?php
2
- $insert = empty( $insert ) ? array() : $insert;
3
- $linkto = empty( $linkto ) ? array() : $linkto;
4
  $custom_keywords = empty( $_view['options']['customkey'] ) ? '' : $_view['options']['customkey'];
5
 
6
- $this->_render( 'advanced-tools/advanced-automatic-linking-types', array(
7
- 'insert' => $insert,
8
- 'linkto' => $linkto,
9
- ) );
 
 
 
10
  ?>
11
 
12
  <div class="sui-box-settings-row">
@@ -27,11 +30,15 @@ $this->_render( 'advanced-tools/advanced-automatic-linking-types', array(
27
  <p class="sui-description"><?php esc_html_e( 'Provide a comma-separated list of keywords that you would like to exclude. You can also select individual posts for exclusion.', 'wds' ); ?></p>
28
 
29
  <label for="ignore" class="sui-label"><?php esc_html_e( 'Excluded Keywords', 'wds' ); ?></label>
30
- <input id='ignore' name='<?php echo esc_attr( $_view['option_name'] ); ?>[ignore]' size='' type='text'
31
- class='sui-form-control' value='<?php echo esc_attr( $_view['options']['ignore'] ); ?>'>
 
 
 
 
32
  </div>
33
  <div class="sui-form-field">
34
- <div id="wds-excluded-posts"></div>
35
  </div>
36
  </div>
37
  </div>
1
  <?php
2
+ $insert = empty( $insert ) ? array() : $insert;
3
+ $linkto = empty( $linkto ) ? array() : $linkto;
4
  $custom_keywords = empty( $_view['options']['customkey'] ) ? '' : $_view['options']['customkey'];
5
 
6
+ $this->render_view(
7
+ 'advanced-tools/advanced-automatic-linking-types',
8
+ array(
9
+ 'insert' => $insert,
10
+ 'linkto' => $linkto,
11
+ )
12
+ );
13
  ?>
14
 
15
  <div class="sui-box-settings-row">
30
  <p class="sui-description"><?php esc_html_e( 'Provide a comma-separated list of keywords that you would like to exclude. You can also select individual posts for exclusion.', 'wds' ); ?></p>
31
 
32
  <label for="ignore" class="sui-label"><?php esc_html_e( 'Excluded Keywords', 'wds' ); ?></label>
33
+ <input
34
+ id='ignore'
35
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[ignore]'
36
+ size=''
37
+ type='text'
38
+ class='sui-form-control' value='<?php echo esc_attr( $_view['options']['ignore'] ); ?>'>
39
  </div>
40
  <div class="sui-form-field">
41
+ <div id="wds-excluded-posts"></div>
42
  </div>
43
  </div>
44
  </div>
includes/admin/templates/advanced-tools/advanced-section-automatic-linking-settings.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
 
8
  $additional_settings = empty( $additional_settings ) ? array() : $additional_settings;
9
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
10
  ?>
11
 
12
  <div class="sui-box-settings-row">
@@ -19,17 +19,22 @@ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
19
  <div class="sui-row">
20
  <div class="sui-form-field sui-col">
21
  <label for="cpt_char_limit" class="sui-label"><?php esc_html_e( 'Posts & pages', 'wds' ); ?></label>
22
- <input id='cpt_char_limit' name='<?php echo esc_attr( $option_name ); ?>[cpt_char_limit]'
23
- type='text' class='sui-form-control sui-input-sm'
24
- value='<?php echo esc_attr( $_view['options']['cpt_char_limit'] ); ?>'>
 
 
 
25
  </div>
26
 
27
  <div class="sui-form-field sui-col">
28
- <label for="tax_char_limit"
29
- class="sui-label"><?php esc_html_e( 'Archives & taxonomies', 'wds' ); ?></label>
30
- <input id='tax_char_limit' name='<?php echo esc_attr( $option_name ); ?>[tax_char_limit]'
31
- type='text' class='sui-form-control sui-input-sm'
32
- value='<?php echo esc_attr( $_view['options']['tax_char_limit'] ); ?>'>
 
 
33
  </div>
34
  </div>
35
  <p class="sui-description"><?php esc_html_e( 'We recommend a minimum of 10 chars for each type.', 'wds' ); ?></p>
@@ -46,17 +51,20 @@ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
46
  <div class="sui-row">
47
  <div class="sui-form-field sui-col">
48
  <label for="link_limit" class="sui-label"><?php esc_html_e( 'Per post total', 'wds' ); ?></label>
49
- <input id='link_limit' name='<?php echo esc_attr( $option_name ); ?>[link_limit]' type='text'
50
- class='sui-form-control sui-input-sm'
51
- value='<?php echo esc_attr( $_view['options']['link_limit'] ); ?>'>
 
52
  </div>
53
 
54
  <div class="sui-form-field sui-col">
55
- <label for="single_link_limit"
56
- class="sui-label"><?php esc_html_e( 'Per keyword group', 'wds' ); ?></label>
57
- <input id='single_link_limit' name='<?php echo esc_attr( $option_name ); ?>[single_link_limit]'
58
- type='text' class='sui-form-control sui-input-sm'
59
- value='<?php echo esc_attr( $_view['options']['single_link_limit'] ); ?>'>
 
 
60
  </div>
61
  </div>
62
  <p class="sui-description"><?php esc_html_e( 'Use 0 to allow unlimited automatic links.', 'wds' ); ?></p>
@@ -64,12 +72,15 @@ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
64
  </div>
65
 
66
  <?php
67
- $this->_render( 'toggle-group', array(
68
- 'label' => __( 'Optional Settings', 'wds' ),
69
- 'description' => __( 'Configure extra settings for absolute control over autolinking.', 'wds' ),
70
- 'items' => $additional_settings,
71
- 'separator' => true,
72
- ) );
 
 
 
73
  ?>
74
 
75
  <div class="sui-box-settings-row">
@@ -82,8 +93,9 @@ $this->_render( 'toggle-group', array(
82
  </p>
83
  </div>
84
  <div class="sui-box-settings-col-2">
85
- <button type="submit" name="deactivate-autolinks-component"
86
- class="sui-button sui-button-ghost">
 
87
  <span class="sui-icon-power-on-off" aria-hidden="true"></span>
88
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
89
  </button>
6
  */
7
 
8
  $additional_settings = empty( $additional_settings ) ? array() : $additional_settings;
9
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
10
  ?>
11
 
12
  <div class="sui-box-settings-row">
19
  <div class="sui-row">
20
  <div class="sui-form-field sui-col">
21
  <label for="cpt_char_limit" class="sui-label"><?php esc_html_e( 'Posts & pages', 'wds' ); ?></label>
22
+ <input
23
+ id='cpt_char_limit'
24
+ name='<?php echo esc_attr( $option_name ); ?>[cpt_char_limit]'
25
+ type='text' class='sui-form-control sui-input-sm'
26
+ value='<?php echo esc_attr( $_view['options']['cpt_char_limit'] ); ?>'
27
+ >
28
  </div>
29
 
30
  <div class="sui-form-field sui-col">
31
+ <label
32
+ for="tax_char_limit"
33
+ class="sui-label"><?php esc_html_e( 'Archives & taxonomies', 'wds' ); ?></label>
34
+ <input
35
+ id='tax_char_limit' name='<?php echo esc_attr( $option_name ); ?>[tax_char_limit]'
36
+ type='text' class='sui-form-control sui-input-sm'
37
+ value='<?php echo esc_attr( $_view['options']['tax_char_limit'] ); ?>'>
38
  </div>
39
  </div>
40
  <p class="sui-description"><?php esc_html_e( 'We recommend a minimum of 10 chars for each type.', 'wds' ); ?></p>
51
  <div class="sui-row">
52
  <div class="sui-form-field sui-col">
53
  <label for="link_limit" class="sui-label"><?php esc_html_e( 'Per post total', 'wds' ); ?></label>
54
+ <input
55
+ id='link_limit' name='<?php echo esc_attr( $option_name ); ?>[link_limit]' type='text'
56
+ class='sui-form-control sui-input-sm'
57
+ value='<?php echo esc_attr( $_view['options']['link_limit'] ); ?>'>
58
  </div>
59
 
60
  <div class="sui-form-field sui-col">
61
+ <label
62
+ for="single_link_limit"
63
+ class="sui-label"><?php esc_html_e( 'Per keyword group', 'wds' ); ?></label>
64
+ <input
65
+ id='single_link_limit' name='<?php echo esc_attr( $option_name ); ?>[single_link_limit]'
66
+ type='text' class='sui-form-control sui-input-sm'
67
+ value='<?php echo esc_attr( $_view['options']['single_link_limit'] ); ?>'>
68
  </div>
69
  </div>
70
  <p class="sui-description"><?php esc_html_e( 'Use 0 to allow unlimited automatic links.', 'wds' ); ?></p>
72
  </div>
73
 
74
  <?php
75
+ $this->render_view(
76
+ 'toggle-group',
77
+ array(
78
+ 'label' => __( 'Optional Settings', 'wds' ),
79
+ 'description' => __( 'Configure extra settings for absolute control over autolinking.', 'wds' ),
80
+ 'items' => $additional_settings,
81
+ 'separator' => true,
82
+ )
83
+ );
84
  ?>
85
 
86
  <div class="sui-box-settings-row">
93
  </p>
94
  </div>
95
  <div class="sui-box-settings-col-2">
96
+ <button
97
+ type="submit" name="deactivate-autolinks-component"
98
+ class="sui-button sui-button-ghost">
99
  <span class="sui-icon-power-on-off" aria-hidden="true"></span>
100
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
101
  </button>
includes/admin/templates/advanced-tools/advanced-section-automatic-linking.php CHANGED
@@ -1,44 +1,50 @@
1
  <?php
2
  $insert = empty( $insert ) ? array() : $insert;
3
  $linkto = empty( $linkto ) ? array() : $linkto;
4
- $this->_render( 'advanced-tools/advanced-section-automatic-linking-main', array(
5
- 'insert' => $insert,
6
- 'linkto' => $linkto,
7
- ) );
 
 
 
8
 
9
- $this->_render( 'advanced-tools/advanced-section-automatic-linking-settings', array(
10
- 'additional_settings' => array(
11
- 'allow_empty_tax' => array(
12
- 'label' => esc_html__( 'Allow autolinks to empty taxonomies', 'wds' ),
13
- 'description' => esc_html__( 'Allows autolinking to taxonomies that have no posts assigned to them.', 'wds' ),
14
- ),
15
- 'excludeheading' => array(
16
- 'label' => esc_html__( 'Prevent linking in heading tags', 'wds' ),
17
- 'description' => esc_html__( 'Excludes headings from autolinking.', 'wds' ),
18
- ),
19
- 'onlysingle' => array(
20
- 'label' => esc_html__( 'Process only single posts and pages', 'wds' ),
21
- 'description' => esc_html__( 'Process only single posts and pages', 'wds' ),
22
- ),
23
- 'allowfeed' => array(
24
- 'label' => esc_html__( 'Process RSS feeds', 'wds' ),
25
- 'description' => esc_html__( 'Autolinking will also occur in RSS feeds.', 'wds' ),
26
- ),
27
- 'casesens' => array(
28
- 'label' => esc_html__( 'Case sensitive matching', 'wds' ),
29
- 'description' => esc_html__( 'Only autolink the exact string match.', 'wds' ),
30
- ),
31
- 'customkey_preventduplicatelink' => array(
32
- 'label' => esc_html__( 'Prevent duplicate links', 'wds' ),
33
- 'description' => esc_html__( 'Only link to a specific URL once per page/post.', 'wds' ),
34
- ),
35
- 'target_blank' => array(
36
- 'label' => esc_html__( 'Open links in new tab', 'wds' ),
37
- 'description' => esc_html__( 'Adds the target=“_blank” tag to links to open a new tab when clicked.', 'wds' ),
38
- ),
39
- 'rel_nofollow' => array(
40
- 'label' => esc_html__( 'Nofollow autolinks', 'wds' ),
41
- 'description' => esc_html__( 'Adds the nofollow meta tag to autolinks to prevent search engines following those URLs when crawling your website.', 'wds' ),
42
- ),
43
- ),
44
- ) );
 
 
 
1
  <?php
2
  $insert = empty( $insert ) ? array() : $insert;
3
  $linkto = empty( $linkto ) ? array() : $linkto;
4
+ $this->render_view(
5
+ 'advanced-tools/advanced-section-automatic-linking-main',
6
+ array(
7
+ 'insert' => $insert,
8
+ 'linkto' => $linkto,
9
+ )
10
+ );
11
 
12
+ $this->render_view(
13
+ 'advanced-tools/advanced-section-automatic-linking-settings',
14
+ array(
15
+ 'additional_settings' => array(
16
+ 'allow_empty_tax' => array(
17
+ 'label' => esc_html__( 'Allow autolinks to empty taxonomies', 'wds' ),
18
+ 'description' => esc_html__( 'Allows autolinking to taxonomies that have no posts assigned to them.', 'wds' ),
19
+ ),
20
+ 'excludeheading' => array(
21
+ 'label' => esc_html__( 'Prevent linking in heading tags', 'wds' ),
22
+ 'description' => esc_html__( 'Excludes headings from autolinking.', 'wds' ),
23
+ ),
24
+ 'onlysingle' => array(
25
+ 'label' => esc_html__( 'Process only single posts and pages', 'wds' ),
26
+ 'description' => esc_html__( 'Process only single posts and pages', 'wds' ),
27
+ ),
28
+ 'allowfeed' => array(
29
+ 'label' => esc_html__( 'Process RSS feeds', 'wds' ),
30
+ 'description' => esc_html__( 'Autolinking will also occur in RSS feeds.', 'wds' ),
31
+ ),
32
+ 'casesens' => array(
33
+ 'label' => esc_html__( 'Case sensitive matching', 'wds' ),
34
+ 'description' => esc_html__( 'Only autolink the exact string match.', 'wds' ),
35
+ ),
36
+ 'customkey_preventduplicatelink' => array(
37
+ 'label' => esc_html__( 'Prevent duplicate links', 'wds' ),
38
+ 'description' => esc_html__( 'Only link to a specific URL once per page/post.', 'wds' ),
39
+ ),
40
+ 'target_blank' => array(
41
+ 'label' => esc_html__( 'Open links in new tab', 'wds' ),
42
+ 'description' => esc_html__( 'Adds the target=“_blank” tag to links to open a new tab when clicked.', 'wds' ),
43
+ ),
44
+ 'rel_nofollow' => array(
45
+ 'label' => esc_html__( 'Nofollow autolinks', 'wds' ),
46
+ 'description' => esc_html__( 'Adds the nofollow meta tag to autolinks to prevent search engines following those URLs when crawling your website.', 'wds' ),
47
+ ),
48
+ ),
49
+ )
50
+ );
includes/admin/templates/advanced-tools/advanced-section-moz.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $smartcrawl_options = Smartcrawl_Settings::get_options();
3
- $access_id = Smartcrawl_Settings::get_setting( 'access-id' );
4
- $secret_key = Smartcrawl_Settings::get_setting( 'secret-key' );
5
 
6
  $image_url = sprintf( '%s/assets/images/graphic-moz-disabled.svg', SMARTCRAWL_PLUGIN_URL );
7
  $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url );
@@ -9,10 +9,13 @@ $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url )
9
 
10
  <?php if ( empty( $access_id ) || empty( $secret_key ) ) : ?>
11
  <div class="wds-disabled-component">
12
- <?php if ( $image_url ): ?>
13
  <p>
14
- <img src="<?php echo esc_attr( $image_url ); ?>"
15
- alt="<?php esc_attr_e( 'MOZ Disabled', 'wds' ); ?>" class="wds-disabled-image"/>
 
 
 
16
  </p>
17
  <?php endif; ?>
18
  <p>
@@ -25,37 +28,44 @@ $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url )
25
  <div class="wds-moz-fields">
26
  <div class="wds-moz-fields-inner">
27
  <p class="sui-p-small">
28
- <?php printf(
 
29
  esc_html__( 'Connect your Moz account. You can get the API credentials %s.', 'wds' ),
30
  sprintf( '<a href="https://moz.com/products/mozscape/access" target="_blank">%s</a>', esc_html__( 'here', 'wds' ) )
31
- ); ?>
 
32
  </p>
33
 
34
  <div class="sui-form-field">
35
- <label class="sui-label"
36
- for="wds-moz-access-id"><?php esc_html_e( 'Access ID', 'wds' ); ?></label>
37
- <input type="text"
38
- id="wds-moz-access-id"
39
- name="wds-moz-access-id"
40
- class="sui-form-control"
41
- placeholder="<?php esc_attr_e( 'Enter your Moz Access ID', 'wds' ); ?>"
42
- value="<?php echo esc_attr( $access_id ); ?>"/>
 
 
43
  <span class="sui-error-message"><?php esc_html_e( 'Please enter a valid Moz Access ID', 'wds' ); ?></span>
44
  </div>
45
 
46
  <div class="sui-form-field">
47
- <label class="sui-label"
48
- for="wds-moz-secret-key"><?php esc_html_e( 'Secret Key', 'wds' ); ?></label>
49
- <input type="text"
50
- id="wds-moz-secret-key"
51
- name="wds-moz-secret-key"
52
- class="sui-form-control"
53
- placeholder="<?php esc_attr_e( 'Enter your Moz Secret Key', 'wds' ); ?>"
54
- value="<?php echo esc_attr( $secret_key ); ?>"/>
 
 
55
  <span class="sui-error-message"><?php esc_html_e( 'Please enter a valid Moz Secret Key', 'wds' ); ?></span>
56
  </div>
57
- <button type="submit"
58
- class="sui-button sui-button-blue">
 
59
 
60
  <span class="sui-loading-text"><?php esc_html_e( 'Connect', 'wds' ); ?></span>
61
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
@@ -66,10 +76,12 @@ $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url )
66
 
67
  <p class="wds-moz-signup-notice">
68
  <small>
69
- <?php printf(
 
70
  esc_html__( "Don't have an account yet? %s.", 'wds' ),
71
  sprintf( '<a href="https://moz.com/community/join" target="_blank">%s</a>', esc_html__( 'Sign up free', 'wds' ) )
72
- ); ?>
 
73
  </small>
74
  </p>
75
  </form>
@@ -77,8 +89,10 @@ $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url )
77
  <?php else : ?>
78
  <p><?php esc_html_e( 'Here’s how your site stacks up against the competition as defined by Moz. You can also see individual stats per post in the post editor under the Moz module.', 'wds' ); ?></p>
79
 
80
- <button type="submit" class="sui-button" name="reset-moz-credentials"
81
- value="1"><?php esc_html_e( 'Reset API Credentials', 'wds' ); ?></button>
 
 
82
  <?php wp_nonce_field( 'wds-autolinks-nonce', '_wds_nonce' ); ?>
83
  <?php Smartcrawl_Moz_Dashboard_Widget::widget(); ?>
84
  <?php endif; ?>
1
  <?php
2
  $smartcrawl_options = Smartcrawl_Settings::get_options();
3
+ $access_id = Smartcrawl_Settings::get_setting( 'access-id' );
4
+ $secret_key = Smartcrawl_Settings::get_setting( 'secret-key' );
5
 
6
  $image_url = sprintf( '%s/assets/images/graphic-moz-disabled.svg', SMARTCRAWL_PLUGIN_URL );
7
  $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url );
9
 
10
  <?php if ( empty( $access_id ) || empty( $secret_key ) ) : ?>
11
  <div class="wds-disabled-component">
12
+ <?php if ( $image_url ) : ?>
13
  <p>
14
+ <img
15
+ src="<?php echo esc_attr( $image_url ); ?>"
16
+ alt="<?php esc_attr_e( 'MOZ Disabled', 'wds' ); ?>"
17
+ class="wds-disabled-image"
18
+ />
19
  </p>
20
  <?php endif; ?>
21
  <p>
28
  <div class="wds-moz-fields">
29
  <div class="wds-moz-fields-inner">
30
  <p class="sui-p-small">
31
+ <?php
32
+ printf(
33
  esc_html__( 'Connect your Moz account. You can get the API credentials %s.', 'wds' ),
34
  sprintf( '<a href="https://moz.com/products/mozscape/access" target="_blank">%s</a>', esc_html__( 'here', 'wds' ) )
35
+ );
36
+ ?>
37
  </p>
38
 
39
  <div class="sui-form-field">
40
+ <label
41
+ class="sui-label"
42
+ for="wds-moz-access-id"><?php esc_html_e( 'Access ID', 'wds' ); ?></label>
43
+ <input
44
+ type="text"
45
+ id="wds-moz-access-id"
46
+ name="wds-moz-access-id"
47
+ class="sui-form-control"
48
+ placeholder="<?php esc_attr_e( 'Enter your Moz Access ID', 'wds' ); ?>"
49
+ value="<?php echo esc_attr( $access_id ); ?>"/>
50
  <span class="sui-error-message"><?php esc_html_e( 'Please enter a valid Moz Access ID', 'wds' ); ?></span>
51
  </div>
52
 
53
  <div class="sui-form-field">
54
+ <label
55
+ class="sui-label"
56
+ for="wds-moz-secret-key"><?php esc_html_e( 'Secret Key', 'wds' ); ?></label>
57
+ <input
58
+ type="text"
59
+ id="wds-moz-secret-key"
60
+ name="wds-moz-secret-key"
61
+ class="sui-form-control"
62
+ placeholder="<?php esc_attr_e( 'Enter your Moz Secret Key', 'wds' ); ?>"
63
+ value="<?php echo esc_attr( $secret_key ); ?>"/>
64
  <span class="sui-error-message"><?php esc_html_e( 'Please enter a valid Moz Secret Key', 'wds' ); ?></span>
65
  </div>
66
+ <button
67
+ type="submit"
68
+ class="sui-button sui-button-blue">
69
 
70
  <span class="sui-loading-text"><?php esc_html_e( 'Connect', 'wds' ); ?></span>
71
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
76
 
77
  <p class="wds-moz-signup-notice">
78
  <small>
79
+ <?php
80
+ printf(
81
  esc_html__( "Don't have an account yet? %s.", 'wds' ),
82
  sprintf( '<a href="https://moz.com/community/join" target="_blank">%s</a>', esc_html__( 'Sign up free', 'wds' ) )
83
+ );
84
+ ?>
85
  </small>
86
  </p>
87
  </form>
89
  <?php else : ?>
90
  <p><?php esc_html_e( 'Here’s how your site stacks up against the competition as defined by Moz. You can also see individual stats per post in the post editor under the Moz module.', 'wds' ); ?></p>
91
 
92
+ <button
93
+ type="submit" class="sui-button"
94
+ name="reset-moz-credentials"
95
+ value="1"><?php esc_html_e( 'Reset API Credentials', 'wds' ); ?></button>
96
  <?php wp_nonce_field( 'wds-autolinks-nonce', '_wds_nonce' ); ?>
97
  <?php Smartcrawl_Moz_Dashboard_Widget::widget(); ?>
98
  <?php endif; ?>
includes/admin/templates/advanced-tools/advanced-section-redirect-settings.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $plugin_settings = Smartcrawl_Settings::get_specific_options( 'wds_settings_options' );
4
  $current_redirection_code = Smartcrawl_Redirect_Utils::get()->get_default_type();
5
- $redirection_types = array(
6
  301 => __( 'Permanent (301)', 'wds' ),
7
  302 => __( 'Temporary (302)', 'wds' ),
8
  );
@@ -20,14 +20,17 @@ $redirection_types = array(
20
 
21
  <div class="sui-box-settings-col-2">
22
  <?php
23
- $this->_render( 'toggle-item', array(
24
- 'field_name' => "{$option_name}[redirect-attachments]",
25
- 'field_id' => "{$option_name}[redirect-attachments]",
26
- 'checked' => ! empty( $_view['options']['redirect-attachments'] ),
27
- 'item_label' => esc_html__( 'Redirect attachments', 'wds' ),
28
- 'sub_settings_template' => 'advanced-tools/advanced-redirect-image-attachments',
29
- 'sub_settings_template_args' => array(),
30
- ) );
 
 
 
31
  ?>
32
  </div>
33
  </div>
@@ -43,12 +46,13 @@ $redirection_types = array(
43
  </div>
44
 
45
  <div class="sui-box-settings-col-2">
46
- <select id="wds-default-redirection-type"
47
- name="<?php echo esc_attr( $option_name ); ?>[redirections-code]"
48
- autocomplete="off"
49
- data-minimum-results-for-search="-1"
50
- class="sui-select">
51
- <?php foreach ( $redirection_types as $redirection_type => $redirection_type_label ): ?>
 
52
  <option value="<?php echo esc_attr( $redirection_type ); ?>"
53
  <?php echo selected( $redirection_type, $current_redirection_code, false ); ?>>
54
  <?php echo esc_html( $redirection_type_label ); ?>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $plugin_settings = Smartcrawl_Settings::get_specific_options( 'wds_settings_options' );
4
  $current_redirection_code = Smartcrawl_Redirect_Utils::get()->get_default_type();
5
+ $redirection_types = array(
6
  301 => __( 'Permanent (301)', 'wds' ),
7
  302 => __( 'Temporary (302)', 'wds' ),
8
  );
20
 
21
  <div class="sui-box-settings-col-2">
22
  <?php
23
+ $this->render_view(
24
+ 'toggle-item',
25
+ array(
26
+ 'field_name' => "{$option_name}[redirect-attachments]",
27
+ 'field_id' => "{$option_name}[redirect-attachments]",
28
+ 'checked' => ! empty( $_view['options']['redirect-attachments'] ),
29
+ 'item_label' => esc_html__( 'Redirect attachments', 'wds' ),
30
+ 'sub_settings_template' => 'advanced-tools/advanced-redirect-image-attachments',
31
+ 'sub_settings_template_args' => array(),
32
+ )
33
+ );
34
  ?>
35
  </div>
36
  </div>
46
  </div>
47
 
48
  <div class="sui-box-settings-col-2">
49
+ <select
50
+ id="wds-default-redirection-type"
51
+ name="<?php echo esc_attr( $option_name ); ?>[redirections-code]"
52
+ autocomplete="off"
53
+ data-minimum-results-for-search="-1"
54
+ class="sui-select">
55
+ <?php foreach ( $redirection_types as $redirection_type => $redirection_type_label ) : ?>
56
  <option value="<?php echo esc_attr( $redirection_type ); ?>"
57
  <?php echo selected( $redirection_type, $current_redirection_code, false ); ?>>
58
  <?php echo esc_html( $redirection_type_label ); ?>
includes/admin/templates/advanced-tools/advanced-section-redirects.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php
2
  $is_active = ! empty( $is_active );
3
  ?>
4
- <div class="wds-vertical-tab-section tab_url_redirection_main <?php echo $is_active ? '' : 'hidden'; ?>"
5
- id="tab_url_redirection_main">
 
 
6
  <div id="wds-redirects-container"></div>
7
  </div>
1
  <?php
2
  $is_active = ! empty( $is_active );
3
  ?>
4
+ <div
5
+ class="wds-vertical-tab-section tab_url_redirection_main <?php echo $is_active ? '' : 'hidden'; ?>"
6
+ id="tab_url_redirection_main"
7
+ >
8
  <div id="wds-redirects-container"></div>
9
  </div>
includes/admin/templates/advanced-tools/advanced-section-woo-settings.php CHANGED
@@ -1,9 +1,12 @@
1
- <?php $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name']; ?>
 
2
 
3
  <input type="hidden" value="1" name="<?php echo esc_attr( $option_name ); ?>[save_woo]"/>
4
 
5
- <div class="wds-vertical-tab-section sui-box tab_woo <?php echo $is_active ? '' : 'hidden'; ?>"
6
- id="tab_woo">
 
 
7
  <div id="wds-woo-settings-tab">
8
  <div class="sui-box">
9
  <div class="sui-box-header">
1
+ <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name']; ?>
3
 
4
  <input type="hidden" value="1" name="<?php echo esc_attr( $option_name ); ?>[save_woo]"/>
5
 
6
+ <div
7
+ class="wds-vertical-tab-section sui-box tab_woo <?php echo $is_active ? '' : 'hidden'; ?>"
8
+ id="tab_woo"
9
+ >
10
  <div id="wds-woo-settings-tab">
11
  <div class="sui-box">
12
  <div class="sui-box-header">
includes/admin/templates/advanced-tools/advanced-side-nav.php CHANGED
@@ -1,34 +1,37 @@
1
  <?php
2
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
 
4
- $this->_render( 'vertical-tabs-side-nav', array(
5
- 'active_tab' => $active_tab,
6
- 'tabs' => array_merge(
7
- array(
 
8
  array(
9
- 'id' => 'tab_automatic_linking',
10
- 'name' => esc_html__( 'Automatic Links', 'wds' ),
 
 
 
 
 
 
11
  ),
 
 
 
 
 
 
12
  array(
13
- 'id' => 'tab_url_redirection',
14
- 'name' => esc_html__( 'URL Redirection', 'wds' ),
15
- ),
 
 
 
 
 
 
16
  ),
17
- smartcrawl_woocommerce_active() ? array(
18
- array(
19
- 'id' => 'tab_woo',
20
- 'name' => esc_html__( 'WooCommerce SEO', 'wds' ),
21
- ),
22
- ) : array(),
23
- array(
24
- array(
25
- 'id' => 'tab_moz',
26
- 'name' => esc_html__( 'Moz', 'wds' ),
27
- ),
28
- array(
29
- 'id' => 'tab_robots_editor',
30
- 'name' => esc_html__( 'Robots.txt Editor', 'wds' ),
31
- ),
32
- )
33
- ),
34
- ) );
1
  <?php
2
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
 
4
+ $this->render_view(
5
+ 'vertical-tabs-side-nav',
6
+ array(
7
+ 'active_tab' => $active_tab,
8
+ 'tabs' => array_merge(
9
  array(
10
+ array(
11
+ 'id' => 'tab_automatic_linking',
12
+ 'name' => esc_html__( 'Automatic Links', 'wds' ),
13
+ ),
14
+ array(
15
+ 'id' => 'tab_url_redirection',
16
+ 'name' => esc_html__( 'URL Redirection', 'wds' ),
17
+ ),
18
  ),
19
+ smartcrawl_woocommerce_active() ? array(
20
+ array(
21
+ 'id' => 'tab_woo',
22
+ 'name' => esc_html__( 'WooCommerce SEO', 'wds' ),
23
+ ),
24
+ ) : array(),
25
  array(
26
+ array(
27
+ 'id' => 'tab_moz',
28
+ 'name' => esc_html__( 'Moz', 'wds' ),
29
+ ),
30
+ array(
31
+ 'id' => 'tab_robots_editor',
32
+ 'name' => esc_html__( 'Robots.txt Editor', 'wds' ),
33
+ ),
34
+ )
35
  ),
36
+ )
37
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/templates/advanced-tools/advanced-tab-robots.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
- $active_tab = empty( $active_tab ) ? false : $active_tab;
3
- $already_exists = empty( $already_exists ) ? false : $already_exists;
4
- $rootdir_install = empty( $rootdir_install ) ? false : true;
5
 
6
- $robots_enabled = (boolean) Smartcrawl_Settings::get_setting( 'robots-txt' );
7
- $show_settings = $robots_enabled && $rootdir_install && ! $already_exists;
8
 
9
  $section_template = $show_settings
10
  ? 'advanced-tools/advanced-robots-settings'
11
  : 'advanced-tools/advanced-robots-disabled';
12
- $section_args = $show_settings
13
  ? array()
14
  : array(
15
  'already_exists' => $already_exists,
@@ -29,4 +29,4 @@ $tab_args = array(
29
  ),
30
  ),
31
  );
32
- $this->_render( 'vertical-tab', $tab_args );
1
  <?php
2
+ $active_tab = empty( $active_tab ) ? false : $active_tab;
3
+ $already_exists = empty( $already_exists ) ? false : $already_exists;
4
+ $rootdir_install = ! empty( $rootdir_install );
5
 
6
+ $robots_enabled = (bool) Smartcrawl_Settings::get_setting( 'robots-txt' );
7
+ $show_settings = $robots_enabled && $rootdir_install && ! $already_exists;
8
 
9
  $section_template = $show_settings
10
  ? 'advanced-tools/advanced-robots-settings'
11
  : 'advanced-tools/advanced-robots-disabled';
12
+ $section_args = $show_settings
13
  ? array()
14
  : array(
15
  'already_exists' => $already_exists,
29
  ),
30
  ),
31
  );
32
+ $this->render_view( 'vertical-tab', $tab_args );
includes/admin/templates/advanced-tools/advanced-tools-redirect-item.php CHANGED
@@ -1,21 +1,23 @@
1
  <?php
2
  // All values passed to this template are expected to be escaped already so phpcs is disabled
3
  // phpcs:ignoreFile
4
- $source = empty( $source ) ? '' : $source;
5
- $destination = empty( $destination ) ? '' : $destination;
6
  $selected_type = empty( $selected_type ) ? '' : $selected_type;
7
- $index = empty( $index ) ? 0 : $index;
8
 
9
  $option_name = 'wds_autolinks_options';
10
  ?>
11
 
12
- <div data-index="<?php echo esc_attr( $index ); ?>"
13
- class="sui-builder-field wds-redirect-item">
 
14
 
15
  <label class="sui-checkbox">
16
- <input type="checkbox"
17
- name="<?php echo esc_attr( $option_name ); ?>[bulk][]"
18
- value="<?php echo esc_attr( $index ); ?>"/>
 
19
  <span aria-hidden="true"></span>
20
  </label>
21
 
@@ -29,7 +31,7 @@ $option_name = 'wds_autolinks_options';
29
  <small><?php esc_html_e( 'Temporary', 'wds' ); ?></small>
30
  </span>
31
 
32
- <?php $this->_render( 'links-dropdown', array(
33
  'label' => esc_html__( 'Options', 'wds' ),
34
  'links' => array(
35
  '#edit' => '<span class="sui-icon-pencil" aria-hidden="true"></span> ' . esc_html__( 'Edit', 'wds' ),
@@ -37,18 +39,21 @@ $option_name = 'wds_autolinks_options';
37
  ),
38
  ) ); ?>
39
 
40
- <input value="<?php echo esc_attr( $source ); ?>"
41
- type="hidden"
42
- class="wds-source-url"
43
- name="<?php echo esc_attr( $option_name ); ?>[urls][<?php echo esc_attr( $index ); ?>][source]"/>
44
-
45
- <input value="<?php echo esc_attr( $destination ); ?>"
46
- type="hidden"
47
- class="wds-destination-url"
48
- name="<?php echo esc_attr( $option_name ); ?>[urls][<?php echo esc_attr( $index ); ?>][destination]"/>
49
-
50
- <input value="<?php echo esc_attr( $selected_type ); ?>"
51
- type="hidden"
52
- class="wds-redirect-type"
53
- name="<?php echo esc_attr( $option_name ); ?>[urls][<?php echo esc_attr( $index ); ?>][type]"/>
 
 
 
54
  </div>
1
  <?php
2
  // All values passed to this template are expected to be escaped already so phpcs is disabled
3
  // phpcs:ignoreFile
4
+ $source = empty( $source ) ? '' : $source;
5
+ $destination = empty( $destination ) ? '' : $destination;
6
  $selected_type = empty( $selected_type ) ? '' : $selected_type;
7
+ $index = empty( $index ) ? 0 : $index;
8
 
9
  $option_name = 'wds_autolinks_options';
10
  ?>
11
 
12
+ <div
13
+ data-index="<?php echo esc_attr( $index ); ?>"
14
+ class="sui-builder-field wds-redirect-item">
15
 
16
  <label class="sui-checkbox">
17
+ <input
18
+ type="checkbox"
19
+ name="<?php echo esc_attr( $option_name ); ?>[bulk][]"
20
+ value="<?php echo esc_attr( $index ); ?>"/>
21
  <span aria-hidden="true"></span>
22
  </label>
23
 
31
  <small><?php esc_html_e( 'Temporary', 'wds' ); ?></small>
32
  </span>
33
 
34
+ <?php $this->render_view( 'links-dropdown', array(
35
  'label' => esc_html__( 'Options', 'wds' ),
36
  'links' => array(
37
  '#edit' => '<span class="sui-icon-pencil" aria-hidden="true"></span> ' . esc_html__( 'Edit', 'wds' ),
39
  ),
40
  ) ); ?>
41
 
42
+ <input
43
+ value="<?php echo esc_attr( $source ); ?>"
44
+ type="hidden"
45
+ class="wds-source-url"
46
+ name="<?php echo esc_attr( $option_name ); ?>[urls][<?php echo esc_attr( $index ); ?>][source]"/>
47
+
48
+ <input
49
+ value="<?php echo esc_attr( $destination ); ?>"
50
+ type="hidden"
51
+ class="wds-destination-url"
52
+ name="<?php echo esc_attr( $option_name ); ?>[urls][<?php echo esc_attr( $index ); ?>][destination]"/>
53
+
54
+ <input
55
+ value="<?php echo esc_attr( $selected_type ); ?>"
56
+ type="hidden"
57
+ class="wds-redirect-type"
58
+ name="<?php echo esc_attr( $option_name ); ?>[urls][<?php echo esc_attr( $index ); ?>][type]"/>
59
  </div>
includes/admin/templates/advanced-tools/advanced-tools-settings.php CHANGED
@@ -1,38 +1,54 @@
1
  <?php
2
- $is_member = empty( $_view['is_member'] ) ? false : true;
3
  $autolinks_enabled = Smartcrawl_Settings::get_setting( 'autolinks' ) && $is_member;
4
- $form_action = $autolinks_enabled ? $_view['action_url'] : '';
5
- $already_exists = empty( $already_exists ) ? false : true;
6
- $rootdir_install = empty( $rootdir_install ) ? false : true;
7
  ?>
8
 
9
- <?php $this->_render( 'before-page-container' ); ?>
10
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-autolinks' ); ?>">
11
 
12
- <?php $this->_render( 'page-header', array(
13
- 'title' => esc_html__( 'Advanced Tools', 'wds' ),
14
- 'documentation_chapter' => 'advanced-tools',
15
- 'utm_campaign' => 'smartcrawl_advanced-tools_docs',
16
- ) ); ?>
17
-
18
- <?php $this->_render( 'floating-notices', array(
19
- 'keys' => array(
20
- 'wds-redirect-notice',
21
- ),
22
- ) ); ?>
 
 
 
 
 
 
 
 
 
 
23
 
24
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
25
- <?php $this->_render( 'advanced-tools/advanced-side-nav', array(
26
- 'active_tab' => $active_tab,
27
- ) ); ?>
 
 
 
 
 
28
 
29
  <form action='<?php echo esc_attr( $form_action ); ?>' method='post' class="wds-form">
30
  <?php if ( $autolinks_enabled ) : ?>
31
  <?php $this->settings_fields( $_view['option_name'] ); ?>
32
 
33
- <input type="hidden"
34
- name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
35
- value="1">
 
36
  <?php endif; ?>
37
  <?php
38
  $autolinks_disabled_section = array(
@@ -80,75 +96,95 @@ $rootdir_install = empty( $rootdir_install ) ? false : true;
80
  $autolinks_tab['button_text'] = false;
81
  }
82
 
83
- $this->_render( 'vertical-tab', $autolinks_tab );
84
  ?>
85
  </form>
86
 
87
- <form action='<?php echo esc_attr( $_view['action_url'] ); ?>'
88
- method='post'
89
- class="wds-form">
 
90
  <?php $this->settings_fields( $_view['option_name'] ); ?>
91
 
92
  <?php
93
  if ( smartcrawl_woocommerce_active() ) {
94
- $this->_render( 'advanced-tools/advanced-section-woo-settings', array(
95
- 'is_active' => $active_tab === 'tab_woo',
96
- ) );
 
 
 
97
  }
98
  ?>
99
  </form>
100
 
101
- <form action='<?php echo esc_attr( $_view['action_url'] ); ?>'
102
- method='post'
103
- class="wds-form">
 
104
  <?php $this->settings_fields( $_view['option_name'] ); ?>
105
 
106
- <div id="tab_url_redirection"
107
- class="wds-vertical-tab-section">
108
-
 
109
  <?php
110
- $this->_render( 'advanced-tools/advanced-section-redirects', array(
111
- 'is_active' => 'tab_url_redirection' === $active_tab,
112
- ) );
113
-
114
- $this->_render( 'vertical-tab', array(
115
- 'tab_id' => 'tab_url_redirection_settings',
116
- 'tab_name' => esc_html__( 'Settings', 'wds' ),
117
- 'is_active' => 'tab_url_redirection' === $active_tab,
118
- 'tab_sections' => array(
119
- array(
120
- 'section_template' => 'advanced-tools/advanced-section-redirect-settings',
 
 
 
 
 
 
121
  ),
122
- ),
123
- ) );
124
  ?>
125
  </div>
126
  </form>
127
 
128
  <form method="post" class="wds-moz-form wds-form">
129
  <?php
130
- $this->_render( 'vertical-tab', array(
131
- 'tab_id' => 'tab_moz',
132
- 'tab_name' => __( 'Moz', 'wds' ),
133
- 'is_active' => 'tab_moz' === $active_tab,
134
- 'button_text' => false,
135
- 'tab_sections' => array(
136
- array(
137
- 'section_template' => 'advanced-tools/advanced-section-moz',
138
- 'section_args' => array(),
 
 
 
139
  ),
140
- ),
141
- ) );
142
  ?>
143
  </form>
144
 
145
- <?php $this->_render( 'advanced-tools/advanced-tab-robots', array(
146
- 'active_tab' => $active_tab,
147
- 'already_exists' => $already_exists,
148
- 'rootdir_install' => $rootdir_install,
149
- ) ); ?>
 
 
 
 
 
150
  </div>
151
- <?php $this->_render( 'footer' ); ?>
152
- <?php $this->_render( 'upsell-modal' ); ?>
153
 
154
  </div><!-- end wds-page-autolinks -->
1
  <?php
2
+ $is_member = empty( $_view['is_member'] ) ? false : true;
3
  $autolinks_enabled = Smartcrawl_Settings::get_setting( 'autolinks' ) && $is_member;
4
+ $form_action = $autolinks_enabled ? $_view['action_url'] : '';
5
+ $already_exists = empty( $already_exists ) ? false : true;
6
+ $rootdir_install = empty( $rootdir_install ) ? false : true;
7
  ?>
8
 
9
+ <?php $this->render_view( 'before-page-container' ); ?>
10
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-autolinks' ); ?>">
11
 
12
+ <?php
13
+ $this->render_view(
14
+ 'page-header',
15
+ array(
16
+ 'title' => esc_html__( 'Advanced Tools', 'wds' ),
17
+ 'documentation_chapter' => 'advanced-tools',
18
+ 'utm_campaign' => 'smartcrawl_advanced-tools_docs',
19
+ )
20
+ );
21
+ ?>
22
+
23
+ <?php
24
+ $this->render_view(
25
+ 'floating-notices',
26
+ array(
27
+ 'keys' => array(
28
+ 'wds-redirect-notice',
29
+ ),
30
+ )
31
+ );
32
+ ?>
33
 
34
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
35
+ <?php
36
+ $this->render_view(
37
+ 'advanced-tools/advanced-side-nav',
38
+ array(
39
+ 'active_tab' => $active_tab,
40
+ )
41
+ );
42
+ ?>
43
 
44
  <form action='<?php echo esc_attr( $form_action ); ?>' method='post' class="wds-form">
45
  <?php if ( $autolinks_enabled ) : ?>
46
  <?php $this->settings_fields( $_view['option_name'] ); ?>
47
 
48
+ <input
49
+ type="hidden"
50
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
51
+ value="1">
52
  <?php endif; ?>
53
  <?php
54
  $autolinks_disabled_section = array(
96
  $autolinks_tab['button_text'] = false;
97
  }
98
 
99
+ $this->render_view( 'vertical-tab', $autolinks_tab );
100
  ?>
101
  </form>
102
 
103
+ <form
104
+ action='<?php echo esc_attr( $_view['action_url'] ); ?>'
105
+ method='post'
106
+ class="wds-form">
107
  <?php $this->settings_fields( $_view['option_name'] ); ?>
108
 
109
  <?php
110
  if ( smartcrawl_woocommerce_active() ) {
111
+ $this->render_view(
112
+ 'advanced-tools/advanced-section-woo-settings',
113
+ array(
114
+ 'is_active' => 'tab_woo' === $active_tab,
115
+ )
116
+ );
117
  }
118
  ?>
119
  </form>
120
 
121
+ <form
122
+ action='<?php echo esc_attr( $_view['action_url'] ); ?>'
123
+ method='post'
124
+ class="wds-form">
125
  <?php $this->settings_fields( $_view['option_name'] ); ?>
126
 
127
+ <div
128
+ id="tab_url_redirection"
129
+ class="wds-vertical-tab-section"
130
+ >
131
  <?php
132
+ $this->render_view(
133
+ 'advanced-tools/advanced-section-redirects',
134
+ array(
135
+ 'is_active' => 'tab_url_redirection' === $active_tab,
136
+ )
137
+ );
138
+
139
+ $this->render_view(
140
+ 'vertical-tab',
141
+ array(
142
+ 'tab_id' => 'tab_url_redirection_settings',
143
+ 'tab_name' => esc_html__( 'Settings', 'wds' ),
144
+ 'is_active' => 'tab_url_redirection' === $active_tab,
145
+ 'tab_sections' => array(
146
+ array(
147
+ 'section_template' => 'advanced-tools/advanced-section-redirect-settings',
148
+ ),
149
  ),
150
+ )
151
+ );
152
  ?>
153
  </div>
154
  </form>
155
 
156
  <form method="post" class="wds-moz-form wds-form">
157
  <?php
158
+ $this->render_view(
159
+ 'vertical-tab',
160
+ array(
161
+ 'tab_id' => 'tab_moz',
162
+ 'tab_name' => __( 'Moz', 'wds' ),
163
+ 'is_active' => 'tab_moz' === $active_tab,
164
+ 'button_text' => false,
165
+ 'tab_sections' => array(
166
+ array(
167
+ 'section_template' => 'advanced-tools/advanced-section-moz',
168
+ 'section_args' => array(),
169
+ ),
170
  ),
171
+ )
172
+ );
173
  ?>
174
  </form>
175
 
176
+ <?php
177
+ $this->render_view(
178
+ 'advanced-tools/advanced-tab-robots',
179
+ array(
180
+ 'active_tab' => $active_tab,
181
+ 'already_exists' => $already_exists,
182
+ 'rootdir_install' => $rootdir_install,
183
+ )
184
+ );
185
+ ?>
186
  </div>
187
+ <?php $this->render_view( 'footer' ); ?>
188
+ <?php $this->render_view( 'upsell-modal' ); ?>
189
 
190
  </div><!-- end wds-page-autolinks -->
includes/admin/templates/advanced-tools/advanced-tools-title-pro-tag.php CHANGED
@@ -6,8 +6,10 @@ if ( $is_member ) {
6
  $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_autolinking_pro_tag';
7
  ?>
8
  <a target="_blank" href="<?php echo esc_attr( $upgrade_url ); ?>">
9
- <span class="sui-tag sui-tag-pro sui-tooltip"
10
- data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>">
 
 
11
  <?php esc_html_e( 'Pro', 'wds' ); ?>
12
  </span>
13
  </a>
6
  $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_autolinking_pro_tag';
7
  ?>
8
  <a target="_blank" href="<?php echo esc_attr( $upgrade_url ); ?>">
9
+ <span
10
+ class="sui-tag sui-tag-pro sui-tooltip"
11
+ data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>"
12
+ >
13
  <?php esc_html_e( 'Pro', 'wds' ); ?>
14
  </span>
15
  </a>
includes/admin/templates/dashboard/dashboard-box-title-url-crawl-stats.php CHANGED
@@ -5,7 +5,7 @@ if ( is_null( $report ) ) {
5
  return;
6
  }
7
 
8
- $active_issues = intval( $report->get_issues_count() );
9
  $sitemap_issues_tooltip = _n(
10
  'You have %s sitemap issue',
11
  'You have %s sitemap issues',
@@ -16,9 +16,9 @@ $sitemap_issues_tooltip = _n(
16
 
17
  <?php if ( $active_issues > 0 ) : ?>
18
  <div class="sui-actions-left">
19
- <span class="sui-tag sui-tag-warning sui-tooltip"
20
- data-tooltip="<?php echo esc_attr( sprintf( $sitemap_issues_tooltip, $active_issues ) ); ?>">
21
-
22
  <?php echo intval( $active_issues ); ?>
23
  </span>
24
  </div>
5
  return;
6
  }
7
 
8
+ $active_issues = intval( $report->get_issues_count() );
9
  $sitemap_issues_tooltip = _n(
10
  'You have %s sitemap issue',
11
  'You have %s sitemap issues',
16
 
17
  <?php if ( $active_issues > 0 ) : ?>
18
  <div class="sui-actions-left">
19
+ <span
20
+ class="sui-tag sui-tag-warning sui-tooltip"
21
+ data-tooltip="<?php echo esc_attr( sprintf( $sitemap_issues_tooltip, $active_issues ) ); ?>">
22
  <?php echo intval( $active_issues ); ?>
23
  </span>
24
  </div>
includes/admin/templates/dashboard/dashboard-content-analysis-readability-overview.php CHANGED
@@ -6,14 +6,14 @@
6
  */
7
 
8
  $analysis_model = new Smartcrawl_Model_Analysis();
9
- $overview = $analysis_model->get_overall_readability_analysis();
10
 
11
  if ( ! $overview ) {
12
  return;
13
  }
14
 
15
- $total = smartcrawl_get_array_value( $overview, 'total' );
16
- $passed = smartcrawl_get_array_value( $overview, 'passed' );
17
  $type_breakdown = smartcrawl_get_array_value( $overview, 'post-types' );
18
 
19
  if ( is_null( $total ) || is_null( $passed ) || is_null( $type_breakdown ) ) {
@@ -25,21 +25,21 @@ $percentage = ! empty( $total )
25
  : 0;
26
 
27
  if ( 0 === $passed && 0 === $total ) {
28
- $class = 'wds-check-invalid';
29
  $indicator_class = 'sui-tag-inactive';
30
- $indicator = esc_html__( 'No data yet', 'wds' );
31
  } elseif ( $percentage > 79 ) {
32
- $class = 'wds-check-success sui-success';
33
  $indicator_class = 'sui-tag-success';
34
- $indicator = esc_html__( 'Easy', 'wds' );
35
  } elseif ( $percentage > 59 ) {
36
- $class = 'wds-check-warning sui-warning';
37
  $indicator_class = 'sui-tag-warning';
38
- $indicator = esc_html__( 'Difficult', 'wds' );
39
  } else {
40
- $class = 'wds-check-error sui-error';
41
  $indicator_class = 'sui-tag-error';
42
- $indicator = esc_html__( 'Difficult', 'wds' );
43
  }
44
  ?>
45
  <section class="wds-accordion wds-draw-left sui-accordion wds-readability-analysis-overview">
@@ -56,9 +56,11 @@ if ( 0 === $passed && 0 === $total ) {
56
  <div class="sui-accordion-col-1">
57
  <span class="sui-accordion-open-indicator">
58
  <span aria-hidden="true" class="sui-icon-chevron-down"></span>
59
- <button type="button"
60
- aria-label="<?php esc_html_e( 'Expand overall readability analysis', 'wds' ); ?>"
61
- class="sui-screen-reader-text"><?php esc_html_e( 'Expand', 'wds' ); ?></button>
 
 
62
  </span>
63
  </div>
64
  </div>
@@ -78,45 +80,45 @@ if ( 0 === $passed && 0 === $total ) {
78
  <th><?php esc_html_e( 'Easy', 'wds' ); ?></th>
79
  </tr>
80
  </thead>
81
- <?php foreach ( $type_breakdown as $post_type => $type_overview ) : ?>
82
  <?php
83
- $difficult = intval( smartcrawl_get_array_value( $type_overview, 'error' ) );
84
- $okay = intval( smartcrawl_get_array_value( $type_overview, 'warning' ) );
85
- $easy = intval( smartcrawl_get_array_value( $type_overview, 'success' ) );
86
- $post_type_object = get_post_type_object( $post_type );
87
 
88
  $edit_url = admin_url( 'edit.php?wds_readability_threshold=' );
89
  ?>
90
  <tr>
91
- <th><?php echo esc_html( $post_type_object->label ); ?></th>
92
  <td>
93
- <?php if ( $difficult > 0 ): ?>
94
- <a href="<?php echo esc_url( add_query_arg( 'post_type', $post_type, "{$edit_url}0" ) ); ?>">
95
  <span class="wds-readability-difficult sui-tag sui-tag-error">
96
  <?php echo intval( $difficult ); ?>
97
  </span>
98
  </a>
99
- <?php else: ?>
100
  <?php esc_html_e( 'None', 'wds' ); ?>
101
  <?php endif; ?>
102
  </td>
103
  <td>
104
- <?php if ( $okay > 0 ): ?>
105
- <a href="<?php echo esc_url( add_query_arg( 'post_type', $post_type, "{$edit_url}1" ) ); ?>">
106
  <span class="wds-readability-okay sui-tag sui-tag-warning">
107
  <?php echo intval( $okay ); ?>
108
  </span>
109
  </a>
110
- <?php else: ?>
111
  <?php esc_html_e( 'None', 'wds' ); ?>
112
  <?php endif; ?>
113
  </td>
114
  <td>
115
- <?php if ( $easy > 0 ): ?>
116
  <span class="wds-readability-easy sui-tag sui-tag-success">
117
  <?php echo intval( $easy ); ?>
118
  </span>
119
- <?php else: ?>
120
  <?php esc_html_e( 'None', 'wds' ); ?>
121
  <?php endif; ?>
122
  </td>
6
  */
7
 
8
  $analysis_model = new Smartcrawl_Model_Analysis();
9
+ $overview = $analysis_model->get_overall_readability_analysis();
10
 
11
  if ( ! $overview ) {
12
  return;
13
  }
14
 
15
+ $total = smartcrawl_get_array_value( $overview, 'total' );
16
+ $passed = smartcrawl_get_array_value( $overview, 'passed' );
17
  $type_breakdown = smartcrawl_get_array_value( $overview, 'post-types' );
18
 
19
  if ( is_null( $total ) || is_null( $passed ) || is_null( $type_breakdown ) ) {
25
  : 0;
26
 
27
  if ( 0 === $passed && 0 === $total ) {
28
+ $class = 'wds-check-invalid';
29
  $indicator_class = 'sui-tag-inactive';
30
+ $indicator = esc_html__( 'No data yet', 'wds' );
31
  } elseif ( $percentage > 79 ) {
32
+ $class = 'wds-check-success sui-success';
33
  $indicator_class = 'sui-tag-success';
34
+ $indicator = esc_html__( 'Easy', 'wds' );
35
  } elseif ( $percentage > 59 ) {
36
+ $class = 'wds-check-warning sui-warning';
37
  $indicator_class = 'sui-tag-warning';
38
+ $indicator = esc_html__( 'Difficult', 'wds' );
39
  } else {
40
+ $class = 'wds-check-error sui-error';
41
  $indicator_class = 'sui-tag-error';
42
+ $indicator = esc_html__( 'Difficult', 'wds' );
43
  }
44
  ?>
45
  <section class="wds-accordion wds-draw-left sui-accordion wds-readability-analysis-overview">
56
  <div class="sui-accordion-col-1">
57
  <span class="sui-accordion-open-indicator">
58
  <span aria-hidden="true" class="sui-icon-chevron-down"></span>
59
+ <button
60
+ type="button"
61
+ aria-label="<?php esc_html_e( 'Expand overall readability analysis', 'wds' ); ?>"
62
+ class="sui-screen-reader-text"
63
+ ><?php esc_html_e( 'Expand', 'wds' ); ?></button>
64
  </span>
65
  </div>
66
  </div>
80
  <th><?php esc_html_e( 'Easy', 'wds' ); ?></th>
81
  </tr>
82
  </thead>
83
+ <?php foreach ( $type_breakdown as $post_type_name => $type_overview ) : ?>
84
  <?php
85
+ $difficult = intval( smartcrawl_get_array_value( $type_overview, 'error' ) );
86
+ $okay = intval( smartcrawl_get_array_value( $type_overview, 'warning' ) );
87
+ $easy = intval( smartcrawl_get_array_value( $type_overview, 'success' ) );
88
+ $wp_post_type_object = get_post_type_object( $post_type_name );
89
 
90
  $edit_url = admin_url( 'edit.php?wds_readability_threshold=' );
91
  ?>
92
  <tr>
93
+ <th><?php echo esc_html( $wp_post_type_object->label ); ?></th>
94
  <td>
95
+ <?php if ( $difficult > 0 ) : ?>
96
+ <a href="<?php echo esc_url( add_query_arg( 'post_type', $post_type_name, "{$edit_url}0" ) ); ?>">
97
  <span class="wds-readability-difficult sui-tag sui-tag-error">
98
  <?php echo intval( $difficult ); ?>
99
  </span>
100
  </a>
101
+ <?php else : ?>
102
  <?php esc_html_e( 'None', 'wds' ); ?>
103
  <?php endif; ?>
104
  </td>
105
  <td>
106
+ <?php if ( $okay > 0 ) : ?>
107
+ <a href="<?php echo esc_url( add_query_arg( 'post_type', $post_type_name, "{$edit_url}1" ) ); ?>">
108
  <span class="wds-readability-okay sui-tag sui-tag-warning">
109
  <?php echo intval( $okay ); ?>
110
  </span>
111
  </a>
112
+ <?php else : ?>
113
  <?php esc_html_e( 'None', 'wds' ); ?>
114
  <?php endif; ?>
115
  </td>
116
  <td>
117
+ <?php if ( $easy > 0 ) : ?>
118
  <span class="wds-readability-easy sui-tag sui-tag-success">
119
  <?php echo intval( $easy ); ?>
120
  </span>
121
+ <?php else : ?>
122
  <?php esc_html_e( 'None', 'wds' ); ?>
123
  <?php endif; ?>
124
  </td>
includes/admin/templates/dashboard/dashboard-content-analysis-seo-overview.php CHANGED
@@ -6,14 +6,14 @@
6
  */
7
 
8
  $analysis_model = new Smartcrawl_Model_Analysis();
9
- $overview = $analysis_model->get_overall_seo_analysis();
10
 
11
  if ( ! $overview ) {
12
  return;
13
  }
14
 
15
- $total = smartcrawl_get_array_value( $overview, 'total' );
16
- $passed = smartcrawl_get_array_value( $overview, 'passed' );
17
  $type_breakdown = smartcrawl_get_array_value( $overview, 'post-types' );
18
 
19
  if ( is_null( $total ) || is_null( $passed ) || is_null( $type_breakdown ) ) {
@@ -25,17 +25,17 @@ $percentage = ! empty( $total )
25
  : 0;
26
 
27
  if ( 0 === $passed && 0 === $total ) {
28
- $class = 'wds-check-invalid';
29
  $indicator_class = 'sui-tag-inactive';
30
- $indicator = esc_html__( 'No data yet', 'wds' );
31
  } elseif ( $percentage > 60 ) {
32
- $class = 'wds-check-success sui-success';
33
  $indicator_class = 'sui-tag-success';
34
- $indicator = esc_html__( 'Good', 'wds' );
35
  } else {
36
- $class = 'wds-check-warning sui-warning';
37
  $indicator_class = 'sui-tag-warning';
38
- $indicator = esc_html__( 'Poor', 'wds' );
39
  }
40
  ?>
41
  <section class="wds-accordion wds-draw-left sui-accordion wds-seo-analysis-overview">
@@ -50,9 +50,11 @@ if ( 0 === $passed && 0 === $total ) {
50
  <div class="sui-accordion-col-1">
51
  <span class="sui-accordion-open-indicator">
52
  <span aria-hidden="true" class="sui-icon-chevron-down"></span>
53
- <button type="button"
54
- aria-label="<?php esc_html_e( 'Expand overall SEO analysis', 'wds' ); ?>"
55
- class="sui-screen-reader-text"><?php esc_html_e( 'Expand', 'wds' ); ?></button>
 
 
56
  </span>
57
  </div>
58
  </div>
@@ -70,33 +72,33 @@ if ( 0 === $passed && 0 === $total ) {
70
  <th><?php esc_html_e( 'Good', 'wds' ); ?></th>
71
  </tr>
72
  </thead>
73
- <?php foreach ( $type_breakdown as $post_type => $type_overview ) : ?>
74
  <?php
75
- $total_for_type = intval( smartcrawl_get_array_value( $type_overview, 'total' ) );
76
- $passed_for_type = intval( smartcrawl_get_array_value( $type_overview, 'passed' ) );
77
- $failed_for_type = $total_for_type - $passed_for_type;
78
- $post_type_object = get_post_type_object( $post_type );
79
 
80
- $fail_url = admin_url( "edit.php?post_type={$post_type}&wds_analysis_threshold=99" );
81
- $success_url = admin_url( "edit.php?post_type={$post_type}&wds_analysis_threshold=100" );
82
  ?>
83
  <tr>
84
- <th><?php echo esc_html( $post_type_object->label ); ?></th>
85
  <td>
86
- <?php if ( $failed_for_type > 0 ): ?>
87
  <a href="<?php echo esc_url( $fail_url ); ?>">
88
  <span class="wds-seo-analysis-poor sui-tag sui-tag-warning"><?php echo intval( $failed_for_type ); ?></span>
89
  </a>
90
- <?php else: ?>
91
  <?php esc_html_e( 'None', 'wds' ); ?>
92
  <?php endif; ?>
93
  </td>
94
  <td>
95
- <?php if ( $passed_for_type > 0 ): ?>
96
  <a href="<?php echo esc_url( $success_url ); ?>">
97
  <span class="wds-seo-analysis-good sui-tag sui-tag-success"><?php echo intval( $passed_for_type ); ?></span>
98
  </a>
99
- <?php else: ?>
100
  <?php esc_html_e( 'None', 'wds' ); ?>
101
  <?php endif; ?>
102
  </td>
6
  */
7
 
8
  $analysis_model = new Smartcrawl_Model_Analysis();
9
+ $overview = $analysis_model->get_overall_seo_analysis();
10
 
11
  if ( ! $overview ) {
12
  return;
13
  }
14
 
15
+ $total = smartcrawl_get_array_value( $overview, 'total' );
16
+ $passed = smartcrawl_get_array_value( $overview, 'passed' );
17
  $type_breakdown = smartcrawl_get_array_value( $overview, 'post-types' );
18
 
19
  if ( is_null( $total ) || is_null( $passed ) || is_null( $type_breakdown ) ) {
25
  : 0;
26
 
27
  if ( 0 === $passed && 0 === $total ) {
28
+ $class = 'wds-check-invalid';
29
  $indicator_class = 'sui-tag-inactive';
30
+ $indicator = esc_html__( 'No data yet', 'wds' );
31
  } elseif ( $percentage > 60 ) {
32
+ $class = 'wds-check-success sui-success';
33
  $indicator_class = 'sui-tag-success';
34
+ $indicator = esc_html__( 'Good', 'wds' );
35
  } else {
36
+ $class = 'wds-check-warning sui-warning';
37
  $indicator_class = 'sui-tag-warning';
38
+ $indicator = esc_html__( 'Poor', 'wds' );
39
  }
40
  ?>
41
  <section class="wds-accordion wds-draw-left sui-accordion wds-seo-analysis-overview">
50
  <div class="sui-accordion-col-1">
51
  <span class="sui-accordion-open-indicator">
52
  <span aria-hidden="true" class="sui-icon-chevron-down"></span>
53
+ <button
54
+ type="button"
55
+ aria-label="<?php esc_html_e( 'Expand overall SEO analysis', 'wds' ); ?>"
56
+ class="sui-screen-reader-text"
57
+ ><?php esc_html_e( 'Expand', 'wds' ); ?></button>
58
  </span>
59
  </div>
60
  </div>
72
  <th><?php esc_html_e( 'Good', 'wds' ); ?></th>
73
  </tr>
74
  </thead>
75
+ <?php foreach ( $type_breakdown as $post_type_name => $type_overview ) : ?>
76
  <?php
77
+ $total_for_type = intval( smartcrawl_get_array_value( $type_overview, 'total' ) );
78
+ $passed_for_type = intval( smartcrawl_get_array_value( $type_overview, 'passed' ) );
79
+ $failed_for_type = $total_for_type - $passed_for_type;
80
+ $wp_post_type_object = get_post_type_object( $post_type_name );
81
 
82
+ $fail_url = admin_url( "edit.php?post_type={$post_type_name}&wds_analysis_threshold=99" );
83
+ $success_url = admin_url( "edit.php?post_type={$post_type_name}&wds_analysis_threshold=100" );
84
  ?>
85
  <tr>
86
+ <th><?php echo esc_html( $wp_post_type_object->label ); ?></th>
87
  <td>
88
+ <?php if ( $failed_for_type > 0 ) : ?>
89
  <a href="<?php echo esc_url( $fail_url ); ?>">
90
  <span class="wds-seo-analysis-poor sui-tag sui-tag-warning"><?php echo intval( $failed_for_type ); ?></span>
91
  </a>
92
+ <?php else : ?>
93
  <?php esc_html_e( 'None', 'wds' ); ?>
94
  <?php endif; ?>
95
  </td>
96
  <td>
97
+ <?php if ( $passed_for_type > 0 ) : ?>
98
  <a href="<?php echo esc_url( $success_url ); ?>">
99
  <span class="wds-seo-analysis-good sui-tag sui-tag-success"><?php echo intval( $passed_for_type ); ?></span>
100
  </a>
101
+ <?php else : ?>
102
  <?php esc_html_e( 'None', 'wds' ); ?>
103
  <?php endif; ?>
104
  </td>
includes/admin/templates/dashboard/dashboard-cross-sell-footer.php CHANGED
@@ -16,8 +16,9 @@ if ( Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member() )
16
  <div class="sui-box-body">
17
  <h3><?php esc_html_e( 'Smush Image Compression and Optimization', 'wds' ); ?></h3>
18
  <p><?php esc_html_e( 'Resize, optimize and compress all of your images with the incredibly powerful and award-winning, 100% free WordPress image optimizer.', 'wds' ); ?></p>
19
- <a href="https://wordpress.org/plugins/wp-smushit/" class="sui-button sui-button-ghost"
20
- target="_blank">
 
21
  <?php esc_html_e( 'View features', 'wds' ); ?> <span class="sui-icon-arrow-right"></span>
22
  </a>
23
  </div>
@@ -30,8 +31,9 @@ if ( Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member() )
30
  <div class="sui-box-body">
31
  <h3><?php esc_html_e( 'Defender Security, Monitoring, and Hack Protection', 'wds' ); ?></h3>
32
  <p><?php esc_html_e( 'Security Tweaks & Recommendations, File & Malware Scanning, Login & 404 Lockout Protection, Two-Factor Authentication & more.', 'wds' ); ?></p>
33
- <a href="https://wordpress.org/plugins/defender-security/"
34
- class="sui-button sui-button-ghost" target="_blank">
 
35
  <?php esc_html_e( 'View features', 'wds' ); ?> <span class="sui-icon-arrow-right"></span>
36
  </a>
37
  </div>
@@ -44,8 +46,9 @@ if ( Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member() )
44
  <div class="sui-box-body">
45
  <h3><?php esc_html_e( 'Hummingbird Page Speed Optimization', 'wds' ); ?></h3>
46
  <p><?php esc_html_e( 'Performance Tests, File Optimization & Compression, Page, Browser & Gravatar Caching, GZIP Compression, CloudFlare Integration & more.', 'wds' ); ?></p>
47
- <a href="https://wordpress.org/plugins/hummingbird-performance/"
48
- class="sui-button sui-button-ghost" target="_blank">
 
49
  <?php esc_html_e( 'View features', 'wds' ); ?> <span class="sui-icon-arrow-right"></span>
50
  </a>
51
  </div>
@@ -57,15 +60,17 @@ if ( Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member() )
57
  <h3><?php esc_html_e( 'Your All-in-One WordPress Platform', 'wds' ); ?></h3>
58
  <p><?php esc_html_e( 'Pretty much everything you need for developing and managing WordPress based websites, and then some.', 'wds' ); ?></p>
59
 
60
- <a class="sui-button sui-button-green"
61
- target="_blank"
62
- href="https://wpmudev.com/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_footer_upsell_notice"
63
- id="dash-uptime-update-membership" rel="dialog">
 
64
  <?php esc_html_e( 'Learn more', 'wds' ); ?>
65
  </a>
66
 
67
- <img class="sui-image"
68
- src="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>/assets/shared-ui/images/dev-team.png"
69
- srcset="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>/assets/shared-ui/images/dev-team@2x.png 2x"
70
- alt="<?php esc_html_e( 'Try pro features for free!', 'wds' ); ?>">
 
71
  </div>
16
  <div class="sui-box-body">
17
  <h3><?php esc_html_e( 'Smush Image Compression and Optimization', 'wds' ); ?></h3>
18
  <p><?php esc_html_e( 'Resize, optimize and compress all of your images with the incredibly powerful and award-winning, 100% free WordPress image optimizer.', 'wds' ); ?></p>
19
+ <a
20
+ href="https://wordpress.org/plugins/wp-smushit/" class="sui-button sui-button-ghost"
21
+ target="_blank">
22
  <?php esc_html_e( 'View features', 'wds' ); ?> <span class="sui-icon-arrow-right"></span>
23
  </a>
24
  </div>
31
  <div class="sui-box-body">
32
  <h3><?php esc_html_e( 'Defender Security, Monitoring, and Hack Protection', 'wds' ); ?></h3>
33
  <p><?php esc_html_e( 'Security Tweaks & Recommendations, File & Malware Scanning, Login & 404 Lockout Protection, Two-Factor Authentication & more.', 'wds' ); ?></p>
34
+ <a
35
+ href="https://wordpress.org/plugins/defender-security/"
36
+ class="sui-button sui-button-ghost" target="_blank">
37
  <?php esc_html_e( 'View features', 'wds' ); ?> <span class="sui-icon-arrow-right"></span>
38
  </a>
39
  </div>
46
  <div class="sui-box-body">
47
  <h3><?php esc_html_e( 'Hummingbird Page Speed Optimization', 'wds' ); ?></h3>
48
  <p><?php esc_html_e( 'Performance Tests, File Optimization & Compression, Page, Browser & Gravatar Caching, GZIP Compression, CloudFlare Integration & more.', 'wds' ); ?></p>
49
+ <a
50
+ href="https://wordpress.org/plugins/hummingbird-performance/"
51
+ class="sui-button sui-button-ghost" target="_blank">
52
  <?php esc_html_e( 'View features', 'wds' ); ?> <span class="sui-icon-arrow-right"></span>
53
  </a>
54
  </div>
60
  <h3><?php esc_html_e( 'Your All-in-One WordPress Platform', 'wds' ); ?></h3>
61
  <p><?php esc_html_e( 'Pretty much everything you need for developing and managing WordPress based websites, and then some.', 'wds' ); ?></p>
62
 
63
+ <a
64
+ class="sui-button sui-button-green"
65
+ target="_blank"
66
+ href="https://wpmudev.com/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_footer_upsell_notice"
67
+ id="dash-uptime-update-membership" rel="dialog">
68
  <?php esc_html_e( 'Learn more', 'wds' ); ?>
69
  </a>
70
 
71
+ <img
72
+ class="sui-image"
73
+ src="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>/assets/shared-ui/images/dev-team.png"
74
+ srcset="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>/assets/shared-ui/images/dev-team@2x.png 2x"
75
+ alt="<?php esc_html_e( 'Try pro features for free!', 'wds' ); ?>">
76
  </div>
includes/admin/templates/dashboard/dashboard-mini-lighthouse-report.php CHANGED
@@ -6,30 +6,38 @@ $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
6
  if ( ! $lighthouse_report ) {
7
  return;
8
  }
9
- $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH );
10
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
11
- $is_member = $service->is_member();
12
  $reporting_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_member;
13
  ?>
14
 
15
- <?php if ( ! $lighthouse_report->get_failed_audits_count() ): ?>
16
- <?php $this->_render( 'notice', array(
17
- 'message' => esc_html__( 'You have no failed SEO audits. Awesome work!', 'wds' ),
18
- 'class' => 'sui-notice-success',
19
- ) ); ?>
20
- <?php else: ?>
 
 
 
 
 
21
  <div class="sui-accordion sui-accordion-flushed">
22
- <?php foreach ( $lighthouse_report->get_groups() as $group ): ?>
23
- <?php foreach ( $group->get_checks() as $check ): ?>
24
- <?php if ( $check->is_passed() ) {
 
25
  continue;
26
- } ?>
 
27
 
28
  <div id="<?php echo esc_attr( $check->get_id() ); ?>" class="sui-accordion-item sui-warning">
29
  <div class="sui-accordion-item-header">
30
  <div class="sui-accordion-item-title sui-accordion-col-4">
31
- <span aria-hidden="true"
32
- class="sui-warning sui-icon-info"></span>
 
33
  <?php echo esc_html( $check->get_title() ); ?>
34
  </div>
35
  </div>
@@ -40,15 +48,18 @@ $reporting_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_mem
40
  <?php endif; ?>
41
 
42
  <div class="wds-view-report wds-space-between">
43
- <a href="<?php echo esc_attr( $page_url ); ?>"
44
- aria-label="<?php esc_html_e( 'View report', 'wds' ); ?>"
45
- class="sui-button sui-button-ghost">
 
46
 
47
  <span class="sui-icon-eye" aria-hidden="true"></span> <?php esc_html_e( 'View Report', 'wds' ); ?>
48
  </a>
49
  <small>
50
- <?php echo empty( $reporting_enabled )
 
51
  ? esc_html__( 'Automatic audits are disabled', 'wds' )
52
- : esc_html__( 'Automatic audits are enabled', 'wds' ); ?>
 
53
  </small>
54
  </div>
6
  if ( ! $lighthouse_report ) {
7
  return;
8
  }
9
+ $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH );
10
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
11
+ $is_member = $service->is_member();
12
  $reporting_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_member;
13
  ?>
14
 
15
+ <?php if ( ! $lighthouse_report->get_failed_audits_count() ) : ?>
16
+ <?php
17
+ $this->render_view(
18
+ 'notice',
19
+ array(
20
+ 'message' => esc_html__( 'You have no failed SEO audits. Awesome work!', 'wds' ),
21
+ 'class' => 'sui-notice-success',
22
+ )
23
+ );
24
+ ?>
25
+ <?php else : ?>
26
  <div class="sui-accordion sui-accordion-flushed">
27
+ <?php foreach ( $lighthouse_report->get_groups() as $group ) : ?>
28
+ <?php foreach ( $group->get_checks() as $check ) : ?>
29
+ <?php
30
+ if ( $check->is_passed() ) {
31
  continue;
32
+ }
33
+ ?>
34
 
35
  <div id="<?php echo esc_attr( $check->get_id() ); ?>" class="sui-accordion-item sui-warning">
36
  <div class="sui-accordion-item-header">
37
  <div class="sui-accordion-item-title sui-accordion-col-4">
38
+ <span
39
+ aria-hidden="true"
40
+ class="sui-warning sui-icon-info"></span>
41
  <?php echo esc_html( $check->get_title() ); ?>
42
  </div>
43
  </div>
48
  <?php endif; ?>
49
 
50
  <div class="wds-view-report wds-space-between">
51
+ <a
52
+ href="<?php echo esc_attr( $page_url ); ?>"
53
+ aria-label="<?php esc_html_e( 'View report', 'wds' ); ?>"
54
+ class="sui-button sui-button-ghost">
55
 
56
  <span class="sui-icon-eye" aria-hidden="true"></span> <?php esc_html_e( 'View Report', 'wds' ); ?>
57
  </a>
58
  <small>
59
+ <?php
60
+ echo empty( $reporting_enabled )
61
  ? esc_html__( 'Automatic audits are disabled', 'wds' )
62
+ : esc_html__( 'Automatic audits are enabled', 'wds' );
63
+ ?>
64
  </small>
65
  </div>
includes/admin/templates/dashboard/dashboard-reports-free.php CHANGED
@@ -1,9 +1,11 @@
1
- <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_REPORTS ); ?>"
2
- data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_REPORTS ); ?>"
3
- class="sui-box wds-dashboard-widget">
 
4
 
5
  <div class="sui-box-header">
6
- <h2 class="sui-box-title">
 
7
  <span class="sui-icon-graph-bar" aria-hidden="true"></span><?php esc_html_e( 'Emails & Report', 'wds' ); ?>
8
  </h2>
9
 
@@ -12,9 +14,10 @@
12
  </div>
13
 
14
  <div class="sui-actions-right">
15
- <a class="sui-button sui-button-purple"
16
- target="_blank"
17
- href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_reports_upsell_notice">
 
18
  <?php esc_html_e( 'Upgrade to Pro', 'wds' ); ?>
19
  </a>
20
  </div>
@@ -42,16 +45,21 @@
42
  </div>
43
 
44
  <div class="wds-separator-top wds-draw-left-padded">
45
- <?php $this->_render( 'mascot-message', array(
46
- 'key' => 'seo-checkup-upsell',
47
- 'dismissible' => false,
48
- 'image_name' => 'graphic-dashboard-reports',
49
- 'message' => sprintf(
50
- '%s <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_reports_upsell_notice">%s</a>',
51
- esc_html__( 'Schedule automatic reports and get them emailed direct to your inbox to stay on top of potential SEO issues. Get Reports as part of a WPMU DEV membership.', 'wds' ),
52
- esc_html__( 'Try Pro Free Today', 'wds' )
53
- ),
54
- ) ); ?>
 
 
 
 
 
55
  </div>
56
  </div>
57
  </section>
1
+ <section
2
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_REPORTS ); ?>"
3
+ data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_REPORTS ); ?>"
4
+ class="sui-box wds-dashboard-widget">
5
 
6
  <div class="sui-box-header">
7
+ <h2
8
+ class="sui-box-title">
9
  <span class="sui-icon-graph-bar" aria-hidden="true"></span><?php esc_html_e( 'Emails & Report', 'wds' ); ?>
10
  </h2>
11
 
14
  </div>
15
 
16
  <div class="sui-actions-right">
17
+ <a
18
+ class="sui-button sui-button-purple"
19
+ target="_blank"
20
+ href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_reports_upsell_notice">
21
  <?php esc_html_e( 'Upgrade to Pro', 'wds' ); ?>
22
  </a>
23
  </div>
45
  </div>
46
 
47
  <div class="wds-separator-top wds-draw-left-padded">
48
+ <?php
49
+ $this->render_view(
50
+ 'mascot-message',
51
+ array(
52
+ 'key' => 'seo-checkup-upsell',
53
+ 'dismissible' => false,
54
+ 'image_name' => 'graphic-dashboard-reports',
55
+ 'message' => sprintf(
56
+ '%s <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_reports_upsell_notice">%s</a>',
57
+ esc_html__( 'Schedule automatic reports and get them emailed direct to your inbox to stay on top of potential SEO issues. Get Reports as part of a WPMU DEV membership.', 'wds' ),
58
+ esc_html__( 'Try Pro Free Today', 'wds' )
59
+ ),
60
+ )
61
+ );
62
+ ?>
63
  </div>
64
  </div>
65
  </section>
includes/admin/templates/dashboard/dashboard-reports-full.php CHANGED
@@ -1,26 +1,27 @@
1
  <?php
2
- $options = empty( $_view['options'] ) ? array() : $_view['options'];
3
- $cron = Smartcrawl_Controller_Cron::get();
4
  $frequencies = $cron->get_frequencies();
5
 
6
  $health_reporting_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH ) . '&tab=tab_reporting';
7
- $health_available = is_main_site();
8
 
9
- $lighthouse_cron_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled();
10
- $lighthouse_freq = Smartcrawl_Lighthouse_Options::reporting_frequency();
11
  $lighthouse_freq_readable = smartcrawl_get_array_value( $frequencies, $lighthouse_freq );
12
 
13
- $crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
14
- $sitemap_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
15
- $crawler_cron_enabled = ! empty( $_view['options']['crawler-cron-enable'] );
16
  $crawler_reporting_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP ) . '&tab=tab_url_crawler_reporting';
17
- $crawler_freq = empty( $_view['options']['crawler-frequency'] ) ? false : $_view['options']['crawler-frequency'];
18
  $crawler_freq_readable = smartcrawl_get_array_value( $frequencies, $crawler_freq );
19
  ?>
20
 
21
- <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_REPORTS ); ?>"
22
- data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_REPORTS ); ?>"
23
- class="sui-box wds-dashboard-widget">
 
24
 
25
  <div class="sui-box-header">
26
  <h2 class="sui-box-title">
@@ -33,7 +34,7 @@ $crawler_freq_readable = smartcrawl_get_array_value( $frequencies, $crawler_freq
33
 
34
  <table class="sui-table wds-draw-left">
35
  <tbody>
36
- <?php if ( $health_available ): ?>
37
  <tr>
38
  <td>
39
  <span class="wds-lighthouse-icon" aria-hidden="true"></span>
@@ -41,19 +42,20 @@ $crawler_freq_readable = smartcrawl_get_array_value( $frequencies, $crawler_freq
41
  </td>
42
 
43
  <td>
44
- <?php if ( $lighthouse_cron_enabled ): ?>
45
  <span class="sui-tag sui-tag-sm sui-tag-blue"><?php echo esc_html( $lighthouse_freq_readable ); ?></span>
46
- <?php else: ?>
47
  <span class="sui-tag sui-tag-sm sui-tag-disabled"><?php esc_html_e( 'Inactive', 'wds' ); ?></span>
48
  <?php endif; ?>
49
  </td>
50
 
51
  <td>
52
- <a href="<?php echo esc_attr( $health_reporting_url ); ?>"
53
- aria-label="<?php esc_html_e( 'Configure SEO audit reports', 'wds' ); ?>">
54
- <?php if ( $lighthouse_cron_enabled ): ?>
 
55
  <span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
56
- <?php else: ?>
57
  <span class="sui-icon-plus" aria-hidden="true"></span>
58
  <?php endif; ?>
59
  </a>
@@ -61,7 +63,7 @@ $crawler_freq_readable = smartcrawl_get_array_value( $frequencies, $crawler_freq
61
  </tr>
62
  <?php endif; ?>
63
 
64
- <?php if ( $crawler_available ): ?>
65
  <tr>
66
  <td>
67
  <span class="sui-icon-web-globe-world" aria-hidden="true"></span>
@@ -69,19 +71,20 @@ $crawler_freq_readable = smartcrawl_get_array_value( $frequencies, $crawler_freq
69
  </td>
70
 
71
  <td>
72
- <?php if ( $sitemap_enabled && $crawler_cron_enabled ): ?>
73
  <span class="sui-tag sui-tag-sm sui-tag-blue"><?php echo esc_html( $crawler_freq_readable ); ?></span>
74
- <?php else: ?>
75
  <span class="sui-tag sui-tag-sm sui-tag-disabled"><?php esc_html_e( 'Inactive', 'wds' ); ?></span>
76
  <?php endif; ?>
77
  </td>
78
 
79
  <td>
80
- <a href="<?php echo esc_attr( $crawler_reporting_url ); ?>"
81
- aria-label="<?php esc_html_e( 'Configure crawler reports', 'wds' ); ?>">
82
- <?php if ( $crawler_cron_enabled ): ?>
 
83
  <span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
84
- <?php else: ?>
85
  <span class="sui-icon-plus" aria-hidden="true"></span>
86
  <?php endif; ?>
87
  </a>
@@ -92,12 +95,14 @@ $crawler_freq_readable = smartcrawl_get_array_value( $frequencies, $crawler_freq
92
  </table>
93
 
94
  <p class="sui-description wds-documentation-link">
95
- <?php echo smartcrawl_format_link(
 
96
  esc_html__( 'You can also set up scheduled PDF reports for your clients via %s.', 'wds' ),
97
  'https://wpmudev.com/hub2/',
98
  esc_html__( 'The Hub', 'wds' ),
99
  '_blank'
100
- ); ?>
 
101
  </p>
102
  </div>
103
  </section>
1
  <?php
2
+ $options = empty( $_view['options'] ) ? array() : $_view['options'];
3
+ $cron = Smartcrawl_Controller_Cron::get();
4
  $frequencies = $cron->get_frequencies();
5
 
6
  $health_reporting_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH ) . '&tab=tab_reporting';
7
+ $health_available = is_main_site();
8
 
9
+ $lighthouse_cron_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled();
10
+ $lighthouse_freq = Smartcrawl_Lighthouse_Options::reporting_frequency();
11
  $lighthouse_freq_readable = smartcrawl_get_array_value( $frequencies, $lighthouse_freq );
12
 
13
+ $crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
14
+ $sitemap_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
15
+ $crawler_cron_enabled = ! empty( $_view['options']['crawler-cron-enable'] );
16
  $crawler_reporting_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP ) . '&tab=tab_url_crawler_reporting';
17
+ $crawler_freq = empty( $_view['options']['crawler-frequency'] ) ? false : $_view['options']['crawler-frequency'];
18
  $crawler_freq_readable = smartcrawl_get_array_value( $frequencies, $crawler_freq );
19
  ?>
20
 
21
+ <section
22
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_REPORTS ); ?>"
23
+ data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_REPORTS ); ?>"
24
+ class="sui-box wds-dashboard-widget">
25
 
26
  <div class="sui-box-header">
27
  <h2 class="sui-box-title">
34
 
35
  <table class="sui-table wds-draw-left">
36
  <tbody>
37
+ <?php if ( $health_available ) : ?>
38
  <tr>
39
  <td>
40
  <span class="wds-lighthouse-icon" aria-hidden="true"></span>
42
  </td>
43
 
44
  <td>
45
+ <?php if ( $lighthouse_cron_enabled ) : ?>
46
  <span class="sui-tag sui-tag-sm sui-tag-blue"><?php echo esc_html( $lighthouse_freq_readable ); ?></span>
47
+ <?php else : ?>
48
  <span class="sui-tag sui-tag-sm sui-tag-disabled"><?php esc_html_e( 'Inactive', 'wds' ); ?></span>
49
  <?php endif; ?>
50
  </td>
51
 
52
  <td>
53
+ <a
54
+ href="<?php echo esc_attr( $health_reporting_url ); ?>"
55
+ aria-label="<?php esc_html_e( 'Configure SEO audit reports', 'wds' ); ?>">
56
+ <?php if ( $lighthouse_cron_enabled ) : ?>
57
  <span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
58
+ <?php else : ?>
59
  <span class="sui-icon-plus" aria-hidden="true"></span>
60
  <?php endif; ?>
61
  </a>
63
  </tr>
64
  <?php endif; ?>
65
 
66
+ <?php if ( $crawler_available ) : ?>
67
  <tr>
68
  <td>
69
  <span class="sui-icon-web-globe-world" aria-hidden="true"></span>
71
  </td>
72
 
73
  <td>
74
+ <?php if ( $sitemap_enabled && $crawler_cron_enabled ) : ?>
75
  <span class="sui-tag sui-tag-sm sui-tag-blue"><?php echo esc_html( $crawler_freq_readable ); ?></span>
76
+ <?php else : ?>
77
  <span class="sui-tag sui-tag-sm sui-tag-disabled"><?php esc_html_e( 'Inactive', 'wds' ); ?></span>
78
  <?php endif; ?>
79
  </td>
80
 
81
  <td>
82
+ <a
83
+ href="<?php echo esc_attr( $crawler_reporting_url ); ?>"
84
+ aria-label="<?php esc_html_e( 'Configure crawler reports', 'wds' ); ?>">
85
+ <?php if ( $crawler_cron_enabled ) : ?>
86
  <span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
87
+ <?php else : ?>
88
  <span class="sui-icon-plus" aria-hidden="true"></span>
89
  <?php endif; ?>
90
  </a>
95
  </table>
96
 
97
  <p class="sui-description wds-documentation-link">
98
+ <?php
99
+ echo smartcrawl_format_link( // phpcs:ignore -- escaped inside.
100
  esc_html__( 'You can also set up scheduled PDF reports for your clients via %s.', 'wds' ),
101
  'https://wpmudev.com/hub2/',
102
  esc_html__( 'The Hub', 'wds' ),
103
  '_blank'
104
+ );
105
+ ?>
106
  </p>
107
  </div>
108
  </section>
includes/admin/templates/dashboard/dashboard-top-lighthouse.php CHANGED
@@ -1,49 +1,55 @@
1
  <?php
2
- $lighthouse_available = is_main_site();
3
  $sitemap_crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
4
 
5
  if ( ! $lighthouse_available && ! $sitemap_crawler_available ) {
6
  return;
7
  }
8
 
9
- $lighthouse_start_time = empty( $lighthouse_start_time ) ? false : $lighthouse_start_time;
10
  /**
 
 
11
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report|WP_Error|false
12
  */
13
  $lighthouse_report = empty( $lighthouse_report ) || ! $lighthouse_report->has_data() || $lighthouse_report->has_errors()
14
  ? false
15
  : $lighthouse_report;
16
- $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
17
  ?>
18
 
19
- <div id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>"
20
- class="sui-box sui-summary sui-summary-sm wds-dashboard-widget <?php echo esc_attr( $whitelabel_class ); ?>"
21
- data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SITEMAP ); ?>">
 
22
 
23
  <div class="sui-summary-image-space">
24
  </div>
25
 
26
  <div class="sui-summary-segment">
27
- <?php if ( $lighthouse_report || $lighthouse_start_time ): ?>
28
  <div class="sui-summary-details">
29
  <div id="wds-lighthouse-summary">
30
  <div class="wds-lighthouse-score">
31
- <?php if ( $lighthouse_start_time ): ?>
32
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
33
- <?php else: ?>
34
- <div class="sui-tooltip sui-tooltip-constrained"
35
- style="--tooltip-width: 240px;"
36
- data-tooltip="<?php echo esc_attr( $lighthouse_report->get_status_message() ); ?>">
 
37
 
38
- <div class="sui-circle-score sui-circle-score-lg sui-grade-<?php echo esc_attr( $lighthouse_report->get_score_grade() ); ?>"
39
- data-score="<?php echo esc_attr( $lighthouse_report->get_score() ); ?>"></div>
 
40
  </div>
41
  <?php endif; ?>
42
 
43
  <div>
44
  <strong><?php esc_html_e( 'SEO', 'wds' ); ?></strong>
45
- <span class="wds-lighthouse-tooltip sui-tooltip sui-tooltip-constrained"
46
- data-tooltip="<?php esc_html_e( 'Google Lighthouse SEO audits ensure that your page is optimized for search engine results ranking. Fix as many as possible to ensure your site is discoverable.', 'wds' ); ?>">
 
47
  <span class="sui-notice-icon sui-icon-info sui-sm" aria-hidden="true"></span>
48
  </span>
49
  <p class="sui-description">
@@ -58,7 +64,7 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
58
  </div>
59
  </div>
60
  </div>
61
- <?php else: ?>
62
  <div class="wds-summary-message">
63
  <strong><?php esc_html_e( 'Welcome!', 'wds' ); ?></strong>
64
  <p>
@@ -81,25 +87,28 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
81
  <li>
82
  <span class="sui-list-label"><?php esc_html_e( 'SEO Audits', 'wds' ); ?></span>
83
  <span class="sui-list-detail">
84
- <?php if ( $lighthouse_start_time ): ?>
85
- <p><span class="sui-icon-loader sui-loading"
86
- aria-hidden="true"></span> <small><?php echo esc_html__( 'SEO Test in progress ...', 'wds' ); ?></small></p>
87
- <?php elseif ( $lighthouse_report ): ?>
88
- <?php if ( $lighthouse_report->get_failed_audits_count() > 0 ): ?>
 
 
89
  <span class="sui-tag sui-tag-yellow">
90
- <?php echo $lighthouse_report->get_failed_audits_count(); ?>
91
  </span>
92
- <?php else: ?>
93
- <span class="sui-icon-check-tick sui-success sui-md"
94
- aria-hidden="true"></span> <small><?php esc_html_e( 'No audits', 'wds' ); ?></small>
 
95
  <?php endif; ?>
96
- <?php else: ?>
97
  -
98
  <?php endif; ?>
99
  </span>
100
  </li>
101
 
102
- <?php $this->_render( 'dashboard/dashboard-top-sitemap-list-item' ); ?>
103
  </ul>
104
  </div>
105
  </div>
1
  <?php
2
+ $lighthouse_available = is_main_site();
3
  $sitemap_crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
4
 
5
  if ( ! $lighthouse_available && ! $sitemap_crawler_available ) {
6
  return;
7
  }
8
 
9
+ $lighthouse_start_time = ! empty( $lighthouse_start_time ) && $lighthouse_start_time;
10
  /**
11
+ * Report.
12
+ *
13
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report|WP_Error|false
14
  */
15
  $lighthouse_report = empty( $lighthouse_report ) || ! $lighthouse_report->has_data() || $lighthouse_report->has_errors()
16
  ? false
17
  : $lighthouse_report;
18
+ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
19
  ?>
20
 
21
+ <div
22
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>"
23
+ class="sui-box sui-summary sui-summary-sm wds-dashboard-widget <?php echo esc_attr( $whitelabel_class ); ?>"
24
+ data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SITEMAP ); ?>">
25
 
26
  <div class="sui-summary-image-space">
27
  </div>
28
 
29
  <div class="sui-summary-segment">
30
+ <?php if ( $lighthouse_report || $lighthouse_start_time ) : ?>
31
  <div class="sui-summary-details">
32
  <div id="wds-lighthouse-summary">
33
  <div class="wds-lighthouse-score">
34
+ <?php if ( $lighthouse_start_time ) : ?>
35
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
36
+ <?php else : ?>
37
+ <div
38
+ class="sui-tooltip sui-tooltip-constrained"
39
+ style="--tooltip-width: 240px;"
40
+ data-tooltip="<?php echo esc_attr( $lighthouse_report->get_status_message() ); ?>">
41
 
42
+ <div
43
+ class="sui-circle-score sui-circle-score-lg sui-grade-<?php echo esc_attr( $lighthouse_report->get_score_grade() ); ?>"
44
+ data-score="<?php echo esc_attr( $lighthouse_report->get_score() ); ?>"></div>
45
  </div>
46
  <?php endif; ?>
47
 
48
  <div>
49
  <strong><?php esc_html_e( 'SEO', 'wds' ); ?></strong>
50
+ <span
51
+ class="wds-lighthouse-tooltip sui-tooltip sui-tooltip-constrained"
52
+ data-tooltip="<?php esc_html_e( 'Google Lighthouse SEO audits ensure that your page is optimized for search engine results ranking. Fix as many as possible to ensure your site is discoverable.', 'wds' ); ?>">
53
  <span class="sui-notice-icon sui-icon-info sui-sm" aria-hidden="true"></span>
54
  </span>
55
  <p class="sui-description">
64
  </div>
65
  </div>
66
  </div>
67
+ <?php else : ?>
68
  <div class="wds-summary-message">
69
  <strong><?php esc_html_e( 'Welcome!', 'wds' ); ?></strong>
70
  <p>
87
  <li>
88
  <span class="sui-list-label"><?php esc_html_e( 'SEO Audits', 'wds' ); ?></span>
89
  <span class="sui-list-detail">
90
+ <?php if ( $lighthouse_start_time ) : ?>
91
+ <p>
92
+ <span
93
+ class="sui-icon-loader sui-loading"
94
+ aria-hidden="true"></span> <small><?php echo esc_html__( 'SEO Test in progress ...', 'wds' ); ?></small></p>
95
+ <?php elseif ( $lighthouse_report ) : ?>
96
+ <?php if ( $lighthouse_report->get_failed_audits_count() > 0 ) : ?>
97
  <span class="sui-tag sui-tag-yellow">
98
+ <?php echo esc_html( $lighthouse_report->get_failed_audits_count() ); ?>
99
  </span>
100
+ <?php else : ?>
101
+ <span
102
+ class="sui-icon-check-tick sui-success sui-md"
103
+ aria-hidden="true"></span> <small><?php esc_html_e( 'No audits', 'wds' ); ?></small>
104
  <?php endif; ?>
105
+ <?php else : ?>
106
  -
107
  <?php endif; ?>
108
  </span>
109
  </li>
110
 
111
+ <?php $this->render_view( 'dashboard/dashboard-top-sitemap-list-item' ); ?>
112
  </ul>
113
  </div>
114
  </div>
includes/admin/templates/dashboard/dashboard-top-sitemap-list-item.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
- $lighthouse = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_LIGHTHOUSE );
3
- $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
4
- $sitemap_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
5
- $is_member = $lighthouse->is_member();
6
  $sitemap_crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
7
 
8
  if ( ! $sitemap_crawler_available ) {
@@ -17,21 +17,25 @@ if ( ! $sitemap_crawler_available ) {
17
  <?php elseif ( $sitemap_enabled ) : ?>
18
 
19
  <?php
20
- $this->_render( 'url-crawl-master', array(
21
- 'ready_template' => 'dashboard/dashboard-url-crawl-stats',
22
- 'progress_template' => 'dashboard/dashboard-url-crawl-in-progress-small',
23
- 'no_data_template' => 'dashboard/dashboard-url-crawl-no-data-small',
24
- ) );
 
 
 
25
  ?>
26
 
27
  <?php else : ?>
28
 
29
- <button type="button"
30
- data-option-id="<?php echo esc_attr( $option_name ); ?>"
31
- data-flag="<?php echo 'sitemap'; ?>"
32
- aria-label="<?php esc_html_e( 'Activate sitemap component', 'wds' ); ?>"
33
- class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
34
-
 
35
  <span class="sui-loading-text"><?php esc_html_e( 'Activate Sitemap', 'wds' ); ?></span>
36
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
37
  </button>
1
  <?php
2
+ $lighthouse = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_LIGHTHOUSE );
3
+ $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
4
+ $sitemap_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
5
+ $is_member = $lighthouse->is_member();
6
  $sitemap_crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
7
 
8
  if ( ! $sitemap_crawler_available ) {
17
  <?php elseif ( $sitemap_enabled ) : ?>
18
 
19
  <?php
20
+ $this->render_view(
21
+ 'url-crawl-master',
22
+ array(
23
+ 'ready_template' => 'dashboard/dashboard-url-crawl-stats',
24
+ 'progress_template' => 'dashboard/dashboard-url-crawl-in-progress-small',
25
+ 'no_data_template' => 'dashboard/dashboard-url-crawl-no-data-small',
26
+ )
27
+ );
28
  ?>
29
 
30
  <?php else : ?>
31
 
32
+ <button
33
+ type="button"
34
+ data-option-id="<?php echo esc_attr( $option_name ); ?>"
35
+ data-flag="<?php echo 'sitemap'; ?>"
36
+ aria-label="<?php esc_html_e( 'Activate sitemap component', 'wds' ); ?>"
37
+ class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue"
38
+ >
39
  <span class="sui-loading-text"><?php esc_html_e( 'Activate Sitemap', 'wds' ); ?></span>
40
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
41
  </button>
includes/admin/templates/dashboard/dashboard-url-crawl-in-progress.php CHANGED
@@ -7,12 +7,18 @@ $progress = empty( $progress ) ? 0 : $progress;
7
  </p>
8
 
9
  <?php
10
- $this->_render( 'progress-bar', array(
11
- 'progress' => $progress,
12
- 'progress_state' => esc_html__( 'Crawl in progress...', 'wds' ),
13
- ) );
 
 
 
14
 
15
- $this->_render( 'progress-notice', array(
16
- 'message' => 'You can always come back later. SmartCrawl will send you an email to %s with the results of the crawl.',
17
- ) );
 
 
 
18
  ?>
7
  </p>
8
 
9
  <?php
10
+ $this->render_view(
11
+ 'progress-bar',
12
+ array(
13
+ 'progress' => $progress,
14
+ 'progress_state' => esc_html__( 'Crawl in progress...', 'wds' ),
15
+ )
16
+ );
17
 
18
+ $this->render_view(
19
+ 'progress-notice',
20
+ array(
21
+ 'message' => 'You can always come back later. SmartCrawl will send you an email to %s with the results of the crawl.',
22
+ )
23
+ );
24
  ?>
includes/admin/templates/dashboard/dashboard-url-crawl-stats.php CHANGED
@@ -5,8 +5,8 @@ if ( is_null( $report ) ) {
5
  return;
6
  }
7
 
8
- $active_issues = $report->get_issues_count();
9
- $missing_urls = $report->get_issues_count( 'sitemap' );
10
  $active_issues_tooltip = _n( 'You have %s sitemap issue', 'You have %s sitemap issues', $active_issues, 'wds' );
11
  $active_issues_tooltip = sprintf( $active_issues_tooltip, $active_issues );
12
 
@@ -19,16 +19,18 @@ $missing_urls_tag = sprintf( $missing_urls_tag, $missing_urls );
19
 
20
  <?php if ( $active_issues > 0 ) : ?>
21
  <div class="wds-right">
22
- <span class="sui-tag sui-tag-warning sui-tooltip"
23
- data-tooltip="<?php echo esc_attr( $active_issues_tooltip ); ?>">
 
24
 
25
  <?php echo esc_html( $active_issues_tag ); ?>
26
  </span>
27
  <span class="sui-tag sui-tag-inactive"><?php echo esc_html( $missing_urls_tag ); ?></span>
28
  </div>
29
- <?php else: ?>
30
  <div class="wds-right">
31
- <span class="sui-icon-check-tick sui-success sui-md"
32
- aria-hidden="true"></span> <small><?php esc_html_e( 'No issues', 'wds' ); ?></small>
 
33
  </div>
34
  <?php endif; ?>
5
  return;
6
  }
7
 
8
+ $active_issues = $report->get_issues_count();
9
+ $missing_urls = $report->get_issues_count( 'sitemap' );
10
  $active_issues_tooltip = _n( 'You have %s sitemap issue', 'You have %s sitemap issues', $active_issues, 'wds' );
11
  $active_issues_tooltip = sprintf( $active_issues_tooltip, $active_issues );
12
 
19
 
20
  <?php if ( $active_issues > 0 ) : ?>
21
  <div class="wds-right">
22
+ <span
23
+ class="sui-tag sui-tag-warning sui-tooltip"
24
+ data-tooltip="<?php echo esc_attr( $active_issues_tooltip ); ?>">
25
 
26
  <?php echo esc_html( $active_issues_tag ); ?>
27
  </span>
28
  <span class="sui-tag sui-tag-inactive"><?php echo esc_html( $missing_urls_tag ); ?></span>
29
  </div>
30
+ <?php else : ?>
31
  <div class="wds-right">
32
+ <span
33
+ class="sui-icon-check-tick sui-success sui-md"
34
+ aria-hidden="true"></span> <small><?php esc_html_e( 'No issues', 'wds' ); ?></small>
35
  </div>
36
  <?php endif; ?>
includes/admin/templates/dashboard/dashboard-welcome-modal.php CHANGED
@@ -1,15 +1,16 @@
1
  <?php
2
- $id = 'wds-welcome-modal';
3
  $current_user = Smartcrawl_Model_User::get( get_current_user_id() );
4
  ?>
5
 
6
  <div class="sui-modal sui-modal-md">
7
- <div role="dialog"
8
- id="<?php echo esc_attr( $id ); ?>"
9
- class="sui-modal-content <?php echo esc_attr( $id ); ?>-dialog"
10
- aria-modal="true"
11
- aria-labelledby="<?php echo esc_attr( $id ); ?>-dialog-title"
12
- aria-describedby="<?php echo esc_attr( $id ); ?>-dialog-description">
 
13
 
14
  <div class="sui-box" role="document">
15
  <div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--40">
@@ -17,27 +18,32 @@ $current_user = Smartcrawl_Model_User::get( get_current_user_id() );
17
  <img src="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>assets/images/graphic-upgrade-header.svg"/>
18
  </div>
19
 
20
- <button class="sui-button-icon sui-button-float--right" data-modal-close
21
- id="<?php echo esc_attr( $id ); ?>-close-button"
22
- type="button">
 
23
  <span class="sui-icon-close sui-md" aria-hidden="true"></span>
24
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'wds' ); ?></span>
25
  </button>
26
 
27
- <h3 class="sui-box-title sui-lg"
28
- id="<?php echo esc_attr( $id ); ?>-dialog-title">
 
29
 
30
  <?php esc_html_e( 'New: Add Custom Schema Types with Ease!', 'wds' ); ?>
31
  </h3>
32
 
33
  <div class="sui-box-body">
34
- <p class="sui-description"
35
- id="<?php echo esc_attr( $id ); ?>-dialog-description">
 
36
  <span>
37
- <?php printf(
38
- esc_html__( "You are no longer limited to the default schema type presets. With SmartCrawl 3.0.0 schema types builder, you can add your custom schema types and properties to help improve your site search engine ranking.", 'wds' ),
39
- $current_user->get_first_name()
40
- ); ?>
 
 
41
  </span>
42
  </p>
43
 
@@ -52,11 +58,12 @@ $current_user = Smartcrawl_Model_User::get( get_current_user_id() );
52
  <span></span>
53
  </div>
54
 
55
- <button id="<?php echo esc_attr( $id ); ?>-get-started"
56
- type="button"
57
- class="sui-button">
 
58
  <span class="sui-loading-text">
59
- <?php esc_html_e( "Awesome, let's go!", 'wds' ); ?>
60
  </span>
61
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
62
  </button>
@@ -64,8 +71,9 @@ $current_user = Smartcrawl_Model_User::get( get_current_user_id() );
64
  </div>
65
  </div>
66
 
67
- <a id="<?php echo esc_attr( $id ); ?>-skip"
68
- href="#">
 
69
 
70
  <?php esc_html_e( 'Skip this', 'wds' ); ?>
71
  </a>
1
  <?php
2
+ $id = 'wds-welcome-modal';
3
  $current_user = Smartcrawl_Model_User::get( get_current_user_id() );
4
  ?>
5
 
6
  <div class="sui-modal sui-modal-md">
7
+ <div
8
+ role="dialog"
9
+ id="<?php echo esc_attr( $id ); ?>"
10
+ class="sui-modal-content <?php echo esc_attr( $id ); ?>-dialog"
11
+ aria-modal="true"
12
+ aria-labelledby="<?php echo esc_attr( $id ); ?>-dialog-title"
13
+ aria-describedby="<?php echo esc_attr( $id ); ?>-dialog-description">
14
 
15
  <div class="sui-box" role="document">
16
  <div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--40">
18
  <img src="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>assets/images/graphic-upgrade-header.svg"/>
19
  </div>
20
 
21
+ <button
22
+ class="sui-button-icon sui-button-float--right" data-modal-close
23
+ id="<?php echo esc_attr( $id ); ?>-close-button"
24
+ type="button">
25
  <span class="sui-icon-close sui-md" aria-hidden="true"></span>
26
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'wds' ); ?></span>
27
  </button>
28
 
29
+ <h3
30
+ class="sui-box-title sui-lg"
31
+ id="<?php echo esc_attr( $id ); ?>-dialog-title">
32
 
33
  <?php esc_html_e( 'New: Add Custom Schema Types with Ease!', 'wds' ); ?>
34
  </h3>
35
 
36
  <div class="sui-box-body">
37
+ <p
38
+ class="sui-description"
39
+ id="<?php echo esc_attr( $id ); ?>-dialog-description">
40
  <span>
41
+ <?php
42
+ printf(
43
+ esc_html__( 'You are no longer limited to the default schema type presets. With SmartCrawl 3.0.0 schema types builder, you can add your custom schema types and properties to help improve your site search engine ranking.', 'wds' ),
44
+ esc_html( $current_user->get_first_name() )
45
+ );
46
+ ?>
47
  </span>
48
  </p>
49
 
58
  <span></span>
59
  </div>
60
 
61
+ <button
62
+ id="<?php echo esc_attr( $id ); ?>-get-started"
63
+ type="button"
64
+ class="sui-button">
65
  <span class="sui-loading-text">
66
+ <?php esc_html_e( "Awesome, let's go!", 'wds' ); ?>
67
  </span>
68
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
69
  </button>
71
  </div>
72
  </div>
73
 
74
+ <a
75
+ id="<?php echo esc_attr( $id ); ?>-skip"
76
+ href="#">
77
 
78
  <?php esc_html_e( 'Skip this', 'wds' ); ?>
79
  </a>
includes/admin/templates/dashboard/dashboard-widget-advanced-tools.php CHANGED
@@ -8,24 +8,23 @@ $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_AUTOL
8
  $redirection_table = Smartcrawl_Redirects_Database_Table::get();
9
  $redirection_count = $redirection_table->get_count();
10
 
11
- $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
12
- $options = $_view['options'];
13
  $autolinking_enabled = Smartcrawl_Settings::get_setting( 'autolinks' );
14
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
15
- $is_member = $service->is_member();
16
- $moz_connected = Smartcrawl_Settings::get_setting( 'access-id' )
17
- && Smartcrawl_Settings::get_setting( 'secret-key' );
18
- $footer_class = $is_member ? 'sui-box-footer' : 'sui-box-body'; // Because the mascot message needs to be inside box body
19
 
20
  $robots_file_exists = Smartcrawl_Controller_Robots::get()->file_exists();
21
  $is_rootdir_install = Smartcrawl_Controller_Robots::get()->is_rootdir_install();
22
- $robots_enabled = (boolean) Smartcrawl_Settings::get_setting( 'robots-txt' )
23
- && ! $robots_file_exists
24
- && $is_rootdir_install;
25
  ?>
26
 
27
- <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_ADVANCED_TOOLS ); ?>"
28
- class="sui-box wds-dashboard-widget">
 
 
29
  <div class="sui-box-header">
30
  <h2 class="sui-box-title">
31
  <span class="sui-icon-wand-magic" aria-hidden="true"></span> <?php esc_html_e( 'Advanced Tools', 'wds' ); ?>
@@ -37,15 +36,17 @@ $robots_enabled = (boolean) Smartcrawl_Settings::get_setting( 'robots-txt' )
37
 
38
  <div class="wds-separator-top wds-draw-left-padded">
39
  <small><strong><?php esc_html_e( 'URL Redirects', 'wds' ); ?></strong></small>
40
- <?php if ( empty( $redirection_count ) ): ?>
41
  <p>
42
  <small><?php esc_html_e( 'Automatically redirect traffic from one URL to another.', 'wds' ); ?></small>
43
  </p>
44
- <a href="<?php echo esc_attr( $page_url ); ?>&tab=tab_url_redirection&add_redirect=1"
45
- class="sui-button sui-button-blue">
 
 
46
  <?php esc_html_e( 'Add Redirect', 'wds' ); ?>
47
  </a>
48
- <?php else: ?>
49
  <span class="wds-right"><small><?php echo esc_html( $redirection_count ); ?></small></span>
50
  <?php endif; ?>
51
  </div>
@@ -54,19 +55,21 @@ $robots_enabled = (boolean) Smartcrawl_Settings::get_setting( 'robots-txt' )
54
  <small><strong><?php esc_html_e( 'Moz Integration', 'wds' ); ?></strong></small>
55
 
56
  <?php if ( $moz_connected ) : ?>
57
- <a href="<?php echo esc_attr( $page_url ); ?>&tab=tab_moz"
58
- class="sui-button sui-button-ghost">
59
-
 
60
  <span class="sui-icon-eye" aria-hidden="true"></span> <?php esc_html_e( 'View Report', 'wds' ); ?>
61
  </a>
62
  <?php else : ?>
63
  <p>
64
  <small><?php esc_html_e( 'Moz provides reports that tell you how your site stacks up against the competition with all of the important SEO measurement tools.', 'wds' ); ?></small>
65
  </p>
66
- <a href="<?php echo esc_attr( $page_url ); ?>&tab=tab_moz"
67
- aria-label="<?php esc_html_e( 'Connect your Moz account', 'wds' ); ?>"
68
- class="sui-button sui-button-blue">
69
-
 
70
  <?php esc_html_e( 'Connect', 'wds' ); ?>
71
  </a>
72
  <?php endif; ?>
@@ -85,9 +88,10 @@ $robots_enabled = (boolean) Smartcrawl_Settings::get_setting( 'robots-txt' )
85
  <p>
86
  <small><?php esc_html_e( 'Add a robots.txt file to tell search engines what they can and can’t index, and where things are.', 'wds' ); ?></small>
87
  </p>
88
- <a href="<?php echo esc_attr( $page_url ); ?>&tab=tab_robots_editor"
89
- aria-label="<?php esc_html_e( 'Activate Robots.txt file', 'wds' ); ?>"
90
- class="sui-button sui-button-blue">
 
91
  <?php esc_html_e( 'Activate', 'wds' ); ?>
92
  </a>
93
  <?php endif; ?>
@@ -96,10 +100,14 @@ $robots_enabled = (boolean) Smartcrawl_Settings::get_setting( 'robots-txt' )
96
  <div class="wds-separator-top <?php echo ! $is_member ? 'wds-box-blocked-area wds-draw-down wds-draw-left' : 'wds-draw-left-padded'; ?>">
97
  <small><strong><?php esc_html_e( 'Automatic Linking', 'wds' ); ?></strong></small>
98
  <?php if ( ! $is_member ) : ?>
99
- <a href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_autolinking_pro_tag"
100
- target="_blank">
101
- <span class="sui-tag sui-tag-pro sui-tooltip"
102
- data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>">
 
 
 
 
103
  <?php esc_html_e( 'Pro', 'wds' ); ?>
104
  </span>
105
  </a>
@@ -112,11 +120,12 @@ $robots_enabled = (boolean) Smartcrawl_Settings::get_setting( 'robots-txt' )
112
  <p>
113
  <small><?php esc_html_e( 'Configure SmartCrawl to automatically link certain key words to a page on your blog or even a whole new site all together.', 'wds' ); ?></small>
114
  </p>
115
- <button type="button"
116
- data-option-id="<?php echo esc_attr( $option_name ); ?>"
117
- data-flag="<?php echo 'autolinks'; ?>"
118
- aria-label="<?php esc_html_e( 'Activate autolinks component', 'wds' ); ?>"
119
- class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
 
120
 
121
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
122
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
@@ -127,28 +136,33 @@ $robots_enabled = (boolean) Smartcrawl_Settings::get_setting( 'robots-txt' )
127
 
128
  <div class="<?php echo esc_attr( $footer_class ); ?>">
129
  <div>
130
- <a href="<?php echo esc_attr( $page_url ); ?>"
131
- aria-label="<?php esc_html_e( 'Configure advanced tools', 'wds' ); ?>"
132
- class="sui-button sui-button-ghost">
133
-
134
- <span class="sui-icon-wrench-tool"
135
- aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
 
 
136
  </a>
137
  </div>
138
 
139
  <?php
140
  if ( ! $is_member ) {
141
 
142
- $this->_render( 'mascot-message', array(
143
- 'key' => 'seo-checkup-upsell',
144
- 'dismissible' => false,
145
- 'image_name' => 'mascot-message-advanced-tools',
146
- 'message' => sprintf(
147
- '%s <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_reports_upsell_notice">%s</a>',
148
- esc_html__( 'Upgrade to Pro and automatically link your articles both internally and externally with automatic linking - a favourite among SEO pros.', 'wds' ),
149
- esc_html__( 'Try it for FREE today', 'wds' )
150
- ),
151
- ) );
 
 
 
152
  }
153
  ?>
154
  </div>
8
  $redirection_table = Smartcrawl_Redirects_Database_Table::get();
9
  $redirection_count = $redirection_table->get_count();
10
 
11
+ $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
12
+ $options = $_view['options'];
13
  $autolinking_enabled = Smartcrawl_Settings::get_setting( 'autolinks' );
14
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
15
+ $is_member = $service->is_member();
16
+ $moz_connected = Smartcrawl_Settings::get_setting( 'access-id' ) && Smartcrawl_Settings::get_setting( 'secret-key' );
17
+ $footer_class = $is_member ? 'sui-box-footer' : 'sui-box-body'; // Because the mascot message needs to be inside box body.
 
18
 
19
  $robots_file_exists = Smartcrawl_Controller_Robots::get()->file_exists();
20
  $is_rootdir_install = Smartcrawl_Controller_Robots::get()->is_rootdir_install();
21
+ $robots_enabled = (bool) Smartcrawl_Settings::get_setting( 'robots-txt' ) && ! $robots_file_exists && $is_rootdir_install;
 
 
22
  ?>
23
 
24
+ <section
25
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_ADVANCED_TOOLS ); ?>"
26
+ class="sui-box wds-dashboard-widget"
27
+ >
28
  <div class="sui-box-header">
29
  <h2 class="sui-box-title">
30
  <span class="sui-icon-wand-magic" aria-hidden="true"></span> <?php esc_html_e( 'Advanced Tools', 'wds' ); ?>
36
 
37
  <div class="wds-separator-top wds-draw-left-padded">
38
  <small><strong><?php esc_html_e( 'URL Redirects', 'wds' ); ?></strong></small>
39
+ <?php if ( empty( $redirection_count ) ) : ?>
40
  <p>
41
  <small><?php esc_html_e( 'Automatically redirect traffic from one URL to another.', 'wds' ); ?></small>
42
  </p>
43
+ <a
44
+ href="<?php echo esc_attr( $page_url ); ?>&tab=tab_url_redirection&add_redirect=1"
45
+ class="sui-button sui-button-blue"
46
+ >
47
  <?php esc_html_e( 'Add Redirect', 'wds' ); ?>
48
  </a>
49
+ <?php else : ?>
50
  <span class="wds-right"><small><?php echo esc_html( $redirection_count ); ?></small></span>
51
  <?php endif; ?>
52
  </div>
55
  <small><strong><?php esc_html_e( 'Moz Integration', 'wds' ); ?></strong></small>
56
 
57
  <?php if ( $moz_connected ) : ?>
58
+ <a
59
+ href="<?php echo esc_attr( $page_url ); ?>&tab=tab_moz"
60
+ class="sui-button sui-button-ghost"
61
+ >
62
  <span class="sui-icon-eye" aria-hidden="true"></span> <?php esc_html_e( 'View Report', 'wds' ); ?>
63
  </a>
64
  <?php else : ?>
65
  <p>
66
  <small><?php esc_html_e( 'Moz provides reports that tell you how your site stacks up against the competition with all of the important SEO measurement tools.', 'wds' ); ?></small>
67
  </p>
68
+ <a
69
+ href="<?php echo esc_attr( $page_url ); ?>&tab=tab_moz"
70
+ aria-label="<?php esc_html_e( 'Connect your Moz account', 'wds' ); ?>"
71
+ class="sui-button sui-button-blue"
72
+ >
73
  <?php esc_html_e( 'Connect', 'wds' ); ?>
74
  </a>
75
  <?php endif; ?>
88
  <p>
89
  <small><?php esc_html_e( 'Add a robots.txt file to tell search engines what they can and can’t index, and where things are.', 'wds' ); ?></small>
90
  </p>
91
+ <a
92
+ href="<?php echo esc_attr( $page_url ); ?>&tab=tab_robots_editor"
93
+ aria-label="<?php esc_html_e( 'Activate Robots.txt file', 'wds' ); ?>"
94
+ class="sui-button sui-button-blue">
95
  <?php esc_html_e( 'Activate', 'wds' ); ?>
96
  </a>
97
  <?php endif; ?>
100
  <div class="wds-separator-top <?php echo ! $is_member ? 'wds-box-blocked-area wds-draw-down wds-draw-left' : 'wds-draw-left-padded'; ?>">
101
  <small><strong><?php esc_html_e( 'Automatic Linking', 'wds' ); ?></strong></small>
102
  <?php if ( ! $is_member ) : ?>
103
+ <a
104
+ href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_autolinking_pro_tag"
105
+ target="_blank"
106
+ >
107
+ <span
108
+ class="sui-tag sui-tag-pro sui-tooltip"
109
+ data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>"
110
+ >
111
  <?php esc_html_e( 'Pro', 'wds' ); ?>
112
  </span>
113
  </a>
120
  <p>
121
  <small><?php esc_html_e( 'Configure SmartCrawl to automatically link certain key words to a page on your blog or even a whole new site all together.', 'wds' ); ?></small>
122
  </p>
123
+ <button
124
+ type="button"
125
+ data-option-id="<?php echo esc_attr( $option_name ); ?>"
126
+ data-flag="<?php echo 'autolinks'; ?>"
127
+ aria-label="<?php esc_html_e( 'Activate autolinks component', 'wds' ); ?>"
128
+ class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
129
 
130
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
131
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
136
 
137
  <div class="<?php echo esc_attr( $footer_class ); ?>">
138
  <div>
139
+ <a
140
+ href="<?php echo esc_attr( $page_url ); ?>"
141
+ aria-label="<?php esc_html_e( 'Configure advanced tools', 'wds' ); ?>"
142
+ class="sui-button sui-button-ghost"
143
+ >
144
+ <span
145
+ class="sui-icon-wrench-tool"
146
+ aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
147
  </a>
148
  </div>
149
 
150
  <?php
151
  if ( ! $is_member ) {
152
 
153
+ $this->render_view(
154
+ 'mascot-message',
155
+ array(
156
+ 'key' => 'seo-checkup-upsell',
157
+ 'dismissible' => false,
158
+ 'image_name' => 'mascot-message-advanced-tools',
159
+ 'message' => sprintf(
160
+ '%s <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_reports_upsell_notice">%s</a>',
161
+ esc_html__( 'Upgrade to Pro and automatically link your articles both internally and externally with automatic linking - a favourite among SEO pros.', 'wds' ),
162
+ esc_html__( 'Try it for FREE today', 'wds' )
163
+ ),
164
+ )
165
+ );
166
  }
167
  ?>
168
  </div>
includes/admin/templates/dashboard/dashboard-widget-configs.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- // Rendered through react
3
  wp_enqueue_script( Smartcrawl_Controller_Assets::CONFIGS_JS );
4
  ?>
5
  <div id="wds-config-widget" class="wds-configs-container"></div>
1
  <?php
2
+ // Rendered through react.
3
  wp_enqueue_script( Smartcrawl_Controller_Assets::CONFIGS_JS );
4
  ?>
5
  <div id="wds-config-widget" class="wds-configs-container"></div>
includes/admin/templates/dashboard/dashboard-widget-content-analysis.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
- $seo_analysis_enabled = Smartcrawl_Settings::get_setting( 'analysis-seo' );
3
  $readability_analysis_enabled = Smartcrawl_Settings::get_setting( 'analysis-readability' );
4
- $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
5
- $is_ajax_request = defined( 'DOING_AJAX' ) && DOING_AJAX;
6
- $refresh_required = ! $is_ajax_request && ( $seo_analysis_enabled || $readability_analysis_enabled );
7
 
8
  $classes = array();
9
  if ( $refresh_required ) {
@@ -17,13 +17,15 @@ if ( $readability_analysis_enabled ) {
17
  }
18
  ?>
19
 
20
- <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_CONTENT_ANALYSIS ); ?>"
21
- class="sui-box wds-dashboard-widget <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
 
22
 
23
  <div class="sui-box-header">
24
  <h2 class="sui-box-title">
25
- <span class="sui-icon-magnifying-glass-search"
26
- aria-hidden="true"></span> <?php esc_html_e( 'Content Analysis', 'wds' ); ?>
 
27
  </h2>
28
  </div>
29
 
@@ -33,7 +35,7 @@ if ( $readability_analysis_enabled ) {
33
  <div class="wds-report">
34
  <?php if ( $seo_analysis_enabled ) : ?>
35
  <?php if ( $is_ajax_request ) : ?>
36
- <?php $this->_render( 'dashboard/dashboard-content-analysis-seo-overview' ); ?>
37
  <?php endif; ?>
38
  <?php else : ?>
39
  <div class="wds-separator-top wds-draw-left-padded <?php echo ! $readability_analysis_enabled ? 'wds-separator-bottom' : ''; ?>">
@@ -41,12 +43,13 @@ if ( $readability_analysis_enabled ) {
41
  <p>
42
  <small><?php esc_html_e( 'Analyses your content against recommend SEO practice and gives recommendations for improvement to make sure content is as optimized as possible.', 'wds' ); ?></small>
43
  </p>
44
- <button type="button"
45
- id="wds-activate-analysis-seo"
46
- aria-label="<?php esc_html_e( 'Activate SEO analysis', 'wds' ); ?>"
47
- data-option-id="<?php echo esc_attr( $option_name ); ?>"
48
- data-flag="analysis-seo"
49
- class="wds-activate-component sui-button sui-button-blue wds-disabled-during-request">
 
50
 
51
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
52
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
@@ -56,7 +59,7 @@ if ( $readability_analysis_enabled ) {
56
 
57
  <?php if ( $readability_analysis_enabled ) : ?>
58
  <?php if ( $is_ajax_request ) : ?>
59
- <?php $this->_render( 'dashboard/dashboard-content-analysis-readability-overview' ); ?>
60
  <?php endif; ?>
61
  <?php else : ?>
62
  <div>
@@ -64,12 +67,13 @@ if ( $readability_analysis_enabled ) {
64
  <p>
65
  <small><?php esc_html_e( 'Benchmarks the readability of your content for the average visitor and gives recommendations for improvement.', 'wds' ); ?></small>
66
  </p>
67
- <button type="button"
68
- id="wds-activate-analysis-readability"
69
- data-option-id="<?php echo esc_attr( $option_name ); ?>"
70
- aria-label="<?php esc_html_e( 'Activate readability analysis', 'wds' ); ?>"
71
- data-flag="analysis-readability"
72
- class="wds-activate-component sui-button sui-button-blue wds-disabled-during-request">
 
73
 
74
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
75
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
@@ -80,11 +84,13 @@ if ( $readability_analysis_enabled ) {
80
  </div>
81
 
82
  <div class="<?php echo $readability_analysis_enabled ? 'sui-box-body' : 'sui-box-footer'; ?>">
83
- <a href="<?php echo esc_attr( admin_url( 'edit.php' ) ); ?>"
84
- class="sui-button sui-button-ghost">
 
85
 
86
- <span class="sui-icon-pencil"
87
- aria-hidden="true"></span> <?php esc_html_e( 'Edit Posts', 'wds' ); ?>
 
88
  </a>
89
  </div>
90
  </section>
1
  <?php
2
+ $seo_analysis_enabled = Smartcrawl_Settings::get_setting( 'analysis-seo' );
3
  $readability_analysis_enabled = Smartcrawl_Settings::get_setting( 'analysis-readability' );
4
+ $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
5
+ $is_ajax_request = defined( 'DOING_AJAX' ) && DOING_AJAX;
6
+ $refresh_required = ! $is_ajax_request && ( $seo_analysis_enabled || $readability_analysis_enabled );
7
 
8
  $classes = array();
9
  if ( $refresh_required ) {
17
  }
18
  ?>
19
 
20
+ <section
21
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_CONTENT_ANALYSIS ); ?>"
22
+ class="sui-box wds-dashboard-widget <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
23
 
24
  <div class="sui-box-header">
25
  <h2 class="sui-box-title">
26
+ <span
27
+ class="sui-icon-magnifying-glass-search"
28
+ aria-hidden="true"></span> <?php esc_html_e( 'Content Analysis', 'wds' ); ?>
29
  </h2>
30
  </div>
31
 
35
  <div class="wds-report">
36
  <?php if ( $seo_analysis_enabled ) : ?>
37
  <?php if ( $is_ajax_request ) : ?>
38
+ <?php $this->render_view( 'dashboard/dashboard-content-analysis-seo-overview' ); ?>
39
  <?php endif; ?>
40
  <?php else : ?>
41
  <div class="wds-separator-top wds-draw-left-padded <?php echo ! $readability_analysis_enabled ? 'wds-separator-bottom' : ''; ?>">
43
  <p>
44
  <small><?php esc_html_e( 'Analyses your content against recommend SEO practice and gives recommendations for improvement to make sure content is as optimized as possible.', 'wds' ); ?></small>
45
  </p>
46
+ <button
47
+ type="button"
48
+ id="wds-activate-analysis-seo"
49
+ aria-label="<?php esc_html_e( 'Activate SEO analysis', 'wds' ); ?>"
50
+ data-option-id="<?php echo esc_attr( $option_name ); ?>"
51
+ data-flag="analysis-seo"
52
+ class="wds-activate-component sui-button sui-button-blue wds-disabled-during-request">
53
 
54
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
55
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
59
 
60
  <?php if ( $readability_analysis_enabled ) : ?>
61
  <?php if ( $is_ajax_request ) : ?>
62
+ <?php $this->render_view( 'dashboard/dashboard-content-analysis-readability-overview' ); ?>
63
  <?php endif; ?>
64
  <?php else : ?>
65
  <div>
67
  <p>
68
  <small><?php esc_html_e( 'Benchmarks the readability of your content for the average visitor and gives recommendations for improvement.', 'wds' ); ?></small>
69
  </p>
70
+ <button
71
+ type="button"
72
+ id="wds-activate-analysis-readability"
73
+ data-option-id="<?php echo esc_attr( $option_name ); ?>"
74
+ aria-label="<?php esc_html_e( 'Activate readability analysis', 'wds' ); ?>"
75
+ data-flag="analysis-readability"
76
+ class="wds-activate-component sui-button sui-button-blue wds-disabled-during-request">
77
 
78
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
79
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
84
  </div>
85
 
86
  <div class="<?php echo $readability_analysis_enabled ? 'sui-box-body' : 'sui-box-footer'; ?>">
87
+ <a
88
+ href="<?php echo esc_attr( admin_url( 'edit.php' ) ); ?>"
89
+ class="sui-button sui-button-ghost">
90
 
91
+ <span
92
+ class="sui-icon-pencil"
93
+ aria-hidden="true"></span> <?php esc_html_e( 'Edit Posts', 'wds' ); ?>
94
  </a>
95
  </div>
96
  </section>
includes/admin/templates/dashboard/dashboard-widget-lighthouse.php CHANGED
@@ -5,28 +5,29 @@ if ( ! $lighthouse_available ) {
5
  }
6
 
7
  $lighthouse_start_time = empty( $lighthouse_start_time ) ? false : $lighthouse_start_time;
8
- $error = $lighthouse_report->has_errors() ? $lighthouse_report->get_error_message() : '';
9
  /**
10
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report|WP_Error|false
11
  */
12
  $lighthouse_report = empty( $lighthouse_report ) || ! $lighthouse_report->has_data() || $lighthouse_report->has_errors()
13
  ? false
14
  : $lighthouse_report;
15
- $issue_count = $lighthouse_report ? $lighthouse_report->get_failed_audits_count() : 0;
16
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
17
- $is_member = $service->is_member();
18
  $reporting_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_member;
19
- $tooltip_text = $lighthouse_report && $lighthouse_report->is_cooling_down()
20
  ? sprintf(
21
  esc_attr__( 'SmartCrawl is just catching her breath, you can run another test in %s minutes.', 'wds' ),
22
  $lighthouse_report->get_remaining_cooldown_minutes()
23
  )
24
  : '';
25
  ?>
26
- <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_LIGHTHOUSE ); ?>"
27
- data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>"
28
- class="sui-box wds-dashboard-widget">
29
-
 
30
  <div class="sui-box-header">
31
  <h2 class="sui-box-title">
32
  <span class="wds-lighthouse-icon" aria-hidden="true"></span><?php esc_html_e( 'SEO Audits', 'wds' ); ?>
@@ -41,36 +42,33 @@ $tooltip_text = $lighthouse_report && $lighthouse_report->is_cooling_down()
41
  ?>
42
  </span>
43
 
44
- <?php if ( $issue_count > 0 ): ?>
45
- <span class="sui-tag sui-tag-warning sui-tooltip"
46
- data-tooltip="<?php echo esc_attr( sprintf( _n(
47
- 'You have %d outstanding SEO audit',
48
- 'You have %d outstanding SEO audits',
49
- $issue_count,
50
- 'wds'
51
- ), $issue_count ) ); ?>">
52
  <?php echo intval( $issue_count ); ?>
53
  </span>
54
  <?php endif; ?>
55
  </div>
56
 
57
- <?php if ( ! $lighthouse_start_time && $lighthouse_report ): ?>
58
  <div class="sui-actions-right">
59
- <span class="<?php echo $lighthouse_report->is_cooling_down() ? 'sui-tooltip sui-tooltip-constrained' : ''; ?>"
60
- style="--tooltip-width: 240px;"
61
- data-tooltip="<?php echo esc_attr( $tooltip_text ); ?>">
 
62
  <button class="sui-button sui-button-blue wds-lighthouse-start-test <?php echo $lighthouse_report->is_cooling_down() ? 'disabled' : ''; ?>">
63
  <span class="sui-loading-text">
64
  <span class="sui-icon-plus" aria-hidden="true"></span>
65
  <?php esc_html_e( 'Run Test', 'wds' ); ?>
66
  </span>
67
-
68
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
69
  </button>
70
  </span>
71
 
72
  </div>
73
- <?php elseif ( $lighthouse_start_time && ! $lighthouse_report ): ?>
74
  <div class="sui-actions-right">
75
  <button class="sui-button sui-button-blue wds-lighthouse-start-test disabled wds-run-test-onload">
76
  <span class="sui-loading-text">
@@ -85,23 +83,28 @@ $tooltip_text = $lighthouse_report && $lighthouse_report->is_cooling_down()
85
  </div>
86
 
87
  <div class="sui-box-body">
88
- <?php if ( $lighthouse_start_time ): ?>
89
  <p><?php esc_html_e( 'Lighthouse is generating a full SEO report of your Homepage, please be patient…', 'wds' ); ?></p>
90
- <?php elseif ( $lighthouse_report ): ?>
91
  <p><?php esc_html_e( 'Ensure that your page is optimized for search engine results ranking. We recommend actioning as many checks as possible.', 'wds' ); ?></p>
92
 
93
- <?php $this->_render( 'dashboard/dashboard-mini-lighthouse-report' ); ?>
94
- <?php elseif ( $error ): ?>
95
- <?php $this->_render( 'notice', array(
96
- 'message' => $error,
97
- 'class' => 'sui-notice-error',
98
- ) ); ?>
99
- <?php else: ?>
 
 
 
 
 
100
  <p><?php esc_html_e( 'Lighthouse will run a SEO test against your Homepage, and then it generates a report on how well the page did. From there, use the failing audits as indicators on how to improve your SEO.', 'wds' ); ?></p>
101
  <?php endif; ?>
102
  </div>
103
 
104
- <?php if ( ! $lighthouse_report && ! $lighthouse_start_time ): ?>
105
  <div class="sui-box-footer wds-space-between">
106
  <button class="sui-button sui-button-blue wds-lighthouse-start-test">
107
  <span class="sui-loading-text">
@@ -114,9 +117,11 @@ $tooltip_text = $lighthouse_report && $lighthouse_report->is_cooling_down()
114
 
115
  <span>
116
  <small>
117
- <?php echo empty( $reporting_enabled )
 
118
  ? esc_html__( 'Automatic SEO Reports are disabled', 'wds' )
119
- : esc_html__( 'Automatic SEO Reports are enabled', 'wds' ); ?>
 
120
  </small>
121
  </span>
122
  </div>
5
  }
6
 
7
  $lighthouse_start_time = empty( $lighthouse_start_time ) ? false : $lighthouse_start_time;
8
+ $error = $lighthouse_report->has_errors() ? $lighthouse_report->get_error_message() : '';
9
  /**
10
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report|WP_Error|false
11
  */
12
  $lighthouse_report = empty( $lighthouse_report ) || ! $lighthouse_report->has_data() || $lighthouse_report->has_errors()
13
  ? false
14
  : $lighthouse_report;
15
+ $issue_count = $lighthouse_report ? $lighthouse_report->get_failed_audits_count() : 0;
16
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
17
+ $is_member = $service->is_member();
18
  $reporting_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_member;
19
+ $tooltip_text = $lighthouse_report && $lighthouse_report->is_cooling_down()
20
  ? sprintf(
21
  esc_attr__( 'SmartCrawl is just catching her breath, you can run another test in %s minutes.', 'wds' ),
22
  $lighthouse_report->get_remaining_cooldown_minutes()
23
  )
24
  : '';
25
  ?>
26
+ <section
27
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_LIGHTHOUSE ); ?>"
28
+ data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>"
29
+ class="sui-box wds-dashboard-widget"
30
+ >
31
  <div class="sui-box-header">
32
  <h2 class="sui-box-title">
33
  <span class="wds-lighthouse-icon" aria-hidden="true"></span><?php esc_html_e( 'SEO Audits', 'wds' ); ?>
42
  ?>
43
  </span>
44
 
45
+ <?php if ( $issue_count > 0 ) : ?>
46
+ <span
47
+ class="sui-tag sui-tag-warning sui-tooltip"
48
+ data-tooltip="<?php echo esc_attr( sprintf( _n( 'You have %d outstanding SEO audit', 'You have %d outstanding SEO audits', $issue_count, 'wds' ), $issue_count ) ); ?>"
49
+ >
 
 
 
50
  <?php echo intval( $issue_count ); ?>
51
  </span>
52
  <?php endif; ?>
53
  </div>
54
 
55
+ <?php if ( ! $lighthouse_start_time && $lighthouse_report ) : ?>
56
  <div class="sui-actions-right">
57
+ <span
58
+ class="<?php echo $lighthouse_report->is_cooling_down() ? 'sui-tooltip sui-tooltip-constrained' : ''; ?>"
59
+ style="--tooltip-width: 240px;"
60
+ data-tooltip="<?php echo esc_attr( $tooltip_text ); ?>">
61
  <button class="sui-button sui-button-blue wds-lighthouse-start-test <?php echo $lighthouse_report->is_cooling_down() ? 'disabled' : ''; ?>">
62
  <span class="sui-loading-text">
63
  <span class="sui-icon-plus" aria-hidden="true"></span>
64
  <?php esc_html_e( 'Run Test', 'wds' ); ?>
65
  </span>
 
66
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
67
  </button>
68
  </span>
69
 
70
  </div>
71
+ <?php elseif ( $lighthouse_start_time && ! $lighthouse_report ) : ?>
72
  <div class="sui-actions-right">
73
  <button class="sui-button sui-button-blue wds-lighthouse-start-test disabled wds-run-test-onload">
74
  <span class="sui-loading-text">
83
  </div>
84
 
85
  <div class="sui-box-body">
86
+ <?php if ( $lighthouse_start_time ) : ?>
87
  <p><?php esc_html_e( 'Lighthouse is generating a full SEO report of your Homepage, please be patient…', 'wds' ); ?></p>
88
+ <?php elseif ( $lighthouse_report ) : ?>
89
  <p><?php esc_html_e( 'Ensure that your page is optimized for search engine results ranking. We recommend actioning as many checks as possible.', 'wds' ); ?></p>
90
 
91
+ <?php $this->render_view( 'dashboard/dashboard-mini-lighthouse-report' ); ?>
92
+ <?php elseif ( $error ) : ?>
93
+ <?php
94
+ $this->render_view(
95
+ 'notice',
96
+ array(
97
+ 'message' => $error,
98
+ 'class' => 'sui-notice-error',
99
+ )
100
+ );
101
+ ?>
102
+ <?php else : ?>
103
  <p><?php esc_html_e( 'Lighthouse will run a SEO test against your Homepage, and then it generates a report on how well the page did. From there, use the failing audits as indicators on how to improve your SEO.', 'wds' ); ?></p>
104
  <?php endif; ?>
105
  </div>
106
 
107
+ <?php if ( ! $lighthouse_report && ! $lighthouse_start_time ) : ?>
108
  <div class="sui-box-footer wds-space-between">
109
  <button class="sui-button sui-button-blue wds-lighthouse-start-test">
110
  <span class="sui-loading-text">
117
 
118
  <span>
119
  <small>
120
+ <?php
121
+ echo empty( $reporting_enabled )
122
  ? esc_html__( 'Automatic SEO Reports are disabled', 'wds' )
123
+ : esc_html__( 'Automatic SEO Reports are enabled', 'wds' );
124
+ ?>
125
  </small>
126
  </span>
127
  </div>
includes/admin/templates/dashboard/dashboard-widget-onpage.php CHANGED
@@ -3,12 +3,12 @@ if ( ! Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_ONPAG
3
  return;
4
  }
5
 
6
- $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE );
7
  $public_post_types = get_post_types( array( 'public' => true ) );
8
- $show_on_front = get_option( 'show_on_front' );
9
- $options = $_view['options'];
10
- $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
11
- $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
12
  ?>
13
  <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_ONPAGE ); ?>" class="sui-box wds-dashboard-widget">
14
  <div class="sui-box-header">
@@ -37,21 +37,23 @@ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
37
  <?php endif; ?>
38
  </div>
39
  <div class="sui-box-footer">
40
- <?php if ( $onpage_enabled ): ?>
41
- <a href="<?php echo esc_attr( $page_url ); ?>"
42
- aria-label="<?php esc_html_e( 'Configure titles and meta component', 'wds' ); ?>"
43
- class="sui-button sui-button-ghost">
44
-
45
- <span class="sui-icon-wrench-tool"
46
- aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
 
 
47
  </a>
48
  <?php else : ?>
49
- <button type="button"
50
- data-option-id="<?php echo esc_attr( $option_name ); ?>"
51
- data-flag="<?php echo esc_attr( 'onpage' ); ?>"
52
- aria-label="<?php esc_html_e( 'Activate title and meta component', 'wds' ); ?>"
53
- class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
54
-
55
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
56
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
57
  </button>
3
  return;
4
  }
5
 
6
+ $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE );
7
  $public_post_types = get_post_types( array( 'public' => true ) );
8
+ $show_on_front = get_option( 'show_on_front' );
9
+ $options = $_view['options'];
10
+ $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
11
+ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
12
  ?>
13
  <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_ONPAGE ); ?>" class="sui-box wds-dashboard-widget">
14
  <div class="sui-box-header">
37
  <?php endif; ?>
38
  </div>
39
  <div class="sui-box-footer">
40
+ <?php if ( $onpage_enabled ) : ?>
41
+ <a
42
+ href="<?php echo esc_attr( $page_url ); ?>"
43
+ aria-label="<?php esc_html_e( 'Configure titles and meta component', 'wds' ); ?>"
44
+ class="sui-button sui-button-ghost"
45
+ >
46
+ <span
47
+ class="sui-icon-wrench-tool"
48
+ aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
49
  </a>
50
  <?php else : ?>
51
+ <button
52
+ type="button"
53
+ data-option-id="<?php echo esc_attr( $option_name ); ?>"
54
+ data-flag="<?php echo esc_attr( 'onpage' ); ?>"
55
+ aria-label="<?php esc_html_e( 'Activate title and meta component', 'wds' ); ?>"
56
+ class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
57
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
58
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
59
  </button>
includes/admin/templates/dashboard/dashboard-widget-reports.php CHANGED
@@ -1,11 +1,9 @@
1
  <?php
2
- $health_available = is_main_site();
3
  $crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
4
  if ( ! $health_available && ! $crawler_available ) {
5
  return;
6
  }
7
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
8
- $template = $service->is_member()
9
- ? 'dashboard/dashboard-reports-full'
10
- : 'dashboard/dashboard-reports-free';
11
- $this->_render( $template );
1
  <?php
2
+ $health_available = is_main_site();
3
  $crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
4
  if ( ! $health_available && ! $crawler_available ) {
5
  return;
6
  }
7
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
8
+ $template = $service->is_member() ? 'dashboard/dashboard-reports-full' : 'dashboard/dashboard-reports-free';
9
+ $this->render_view( $template );
 
 
includes/admin/templates/dashboard/dashboard-widget-schema.php CHANGED
@@ -3,15 +3,16 @@ if ( ! Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SCHEM
3
  return;
4
  }
5
 
6
- $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SCHEMA );
7
  $social_option_name = Smartcrawl_Settings::TAB_SOCIAL . '_options';
8
- $social_options = Smartcrawl_Settings::get_specific_options( $social_option_name );
9
- $schema_enabled = ! smartcrawl_get_array_value( $social_options, 'disable-schema' );
10
- $schema_types = Smartcrawl_Controller_Schema_Types::get()->get_schema_types();
11
  ?>
12
 
13
- <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SCHEMA ); ?>"
14
- class="sui-box wds-dashboard-widget">
 
15
 
16
  <div class="sui-box-header">
17
  <h2 class="sui-box-title">
@@ -22,11 +23,12 @@ $schema_types = Smartcrawl_Controller_Schema_Types::get()->get_schema_types();
22
  <div class="sui-box-body">
23
  <p><?php esc_html_e( 'Quickly add Schema to your pages to help Search Engines understand and show your content better.', 'wds' ); ?></p>
24
 
25
- <?php if ( $schema_enabled ): ?>
26
  <div class="wds-default-schema wds-separator-top wds-draw-left-padded">
27
  <small><strong><?php esc_html_e( 'Default Markup', 'wds' ); ?></strong></small>
28
- <span class="sui-tooltip sui-tooltip-constrained"
29
- data-tooltip="<?php esc_html_e( 'SmartCrawl automatically computes a schema structure for your pages based on your schema settings. By default, Article type is printed for all post types. You can replace this automatically-generated schema type by configuring types in the schema type builder.', 'wds' ); ?>">
 
30
  <span class="sui-notice-icon sui-icon-info sui-sm" aria-hidden="true"></span>
31
  </span>
32
  <span class="sui-tag wds-right sui-tag-sm sui-tag-blue">
@@ -34,46 +36,53 @@ $schema_types = Smartcrawl_Controller_Schema_Types::get()->get_schema_types();
34
  </span>
35
  </div>
36
 
37
- <?php foreach ( $schema_types as $schema_type ): ?>
38
  <?php
39
- $schema_type_label = smartcrawl_get_array_value( $schema_type, 'label' );
40
  $schema_type_disabled = smartcrawl_get_array_value( $schema_type, 'disabled' );
41
  ?>
42
 
43
  <div class="wds-separator-top wds-draw-left-padded">
44
  <small><strong><?php echo esc_html( $schema_type_label ); ?></strong></small>
45
  <span class="sui-tag wds-right sui-tag-sm <?php echo $schema_type_disabled ? 'sui-tag-disabled' : 'sui-tag-blue'; ?>">
46
- <?php echo $schema_type_disabled
 
47
  ? esc_html__( 'Inactive', 'wds' )
48
- : esc_html__( 'Active', 'wds' ); ?>
 
49
  </span>
50
  </div>
51
  <?php endforeach; ?>
52
 
53
- <div class="wds-separator-top wds-draw-left-padded"
54
- style="display: flex; justify-content: space-between;">
55
- <a href="<?php echo esc_attr( $page_url ); ?>"
56
- aria-label="<?php esc_html_e( 'Configure schema component', 'wds' ); ?>"
57
- class="sui-button sui-button-ghost">
58
- <span class="sui-icon-wrench-tool"
59
- aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
 
 
 
60
  </a>
61
 
62
- <a href="<?php echo esc_attr( $page_url . '&tab=tab_types&add_type=1' ); ?>"
63
- aria-label="<?php esc_html_e( 'Add new schema type', 'wds' ); ?>"
64
- class="sui-button sui-button-blue">
 
65
  <span class="sui-icon-plus" aria-hidden="true"></span>
66
  <?php echo esc_html__( 'Add Type', 'wds' ); ?>
67
  </a>
68
  </div>
69
- <?php else: ?>
70
  <br/>
71
- <button type="button"
72
- data-option-id="<?php echo esc_attr( $social_option_name ); ?>"
73
- data-flag="disable-schema"
74
- data-value="0"
75
- aria-label="<?php esc_html_e( 'Activate schema component', 'wds' ); ?>"
76
- class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
 
77
 
78
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
79
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
3
  return;
4
  }
5
 
6
+ $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SCHEMA );
7
  $social_option_name = Smartcrawl_Settings::TAB_SOCIAL . '_options';
8
+ $social_options = Smartcrawl_Settings::get_specific_options( $social_option_name );
9
+ $schema_enabled = ! smartcrawl_get_array_value( $social_options, 'disable-schema' );
10
+ $schema_types = Smartcrawl_Controller_Schema_Types::get()->get_schema_types();
11
  ?>
12
 
13
+ <section
14
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SCHEMA ); ?>"
15
+ class="sui-box wds-dashboard-widget">
16
 
17
  <div class="sui-box-header">
18
  <h2 class="sui-box-title">
23
  <div class="sui-box-body">
24
  <p><?php esc_html_e( 'Quickly add Schema to your pages to help Search Engines understand and show your content better.', 'wds' ); ?></p>
25
 
26
+ <?php if ( $schema_enabled ) : ?>
27
  <div class="wds-default-schema wds-separator-top wds-draw-left-padded">
28
  <small><strong><?php esc_html_e( 'Default Markup', 'wds' ); ?></strong></small>
29
+ <span
30
+ class="sui-tooltip sui-tooltip-constrained"
31
+ data-tooltip="<?php esc_html_e( 'SmartCrawl automatically computes a schema structure for your pages based on your schema settings. By default, Article type is printed for all post types. You can replace this automatically-generated schema type by configuring types in the schema type builder.', 'wds' ); ?>">
32
  <span class="sui-notice-icon sui-icon-info sui-sm" aria-hidden="true"></span>
33
  </span>
34
  <span class="sui-tag wds-right sui-tag-sm sui-tag-blue">
36
  </span>
37
  </div>
38
 
39
+ <?php foreach ( $schema_types as $schema_type ) : ?>
40
  <?php
41
+ $schema_type_label = smartcrawl_get_array_value( $schema_type, 'label' );
42
  $schema_type_disabled = smartcrawl_get_array_value( $schema_type, 'disabled' );
43
  ?>
44
 
45
  <div class="wds-separator-top wds-draw-left-padded">
46
  <small><strong><?php echo esc_html( $schema_type_label ); ?></strong></small>
47
  <span class="sui-tag wds-right sui-tag-sm <?php echo $schema_type_disabled ? 'sui-tag-disabled' : 'sui-tag-blue'; ?>">
48
+ <?php
49
+ echo $schema_type_disabled
50
  ? esc_html__( 'Inactive', 'wds' )
51
+ : esc_html__( 'Active', 'wds' );
52
+ ?>
53
  </span>
54
  </div>
55
  <?php endforeach; ?>
56
 
57
+ <div
58
+ class="wds-separator-top wds-draw-left-padded"
59
+ style="display: flex; justify-content: space-between;">
60
+ <a
61
+ href="<?php echo esc_attr( $page_url ); ?>"
62
+ aria-label="<?php esc_html_e( 'Configure schema component', 'wds' ); ?>"
63
+ class="sui-button sui-button-ghost">
64
+ <span
65
+ class="sui-icon-wrench-tool"
66
+ aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
67
  </a>
68
 
69
+ <a
70
+ href="<?php echo esc_attr( $page_url . '&tab=tab_types&add_type=1' ); ?>"
71
+ aria-label="<?php esc_html_e( 'Add new schema type', 'wds' ); ?>"
72
+ class="sui-button sui-button-blue">
73
  <span class="sui-icon-plus" aria-hidden="true"></span>
74
  <?php echo esc_html__( 'Add Type', 'wds' ); ?>
75
  </a>
76
  </div>
77
+ <?php else : ?>
78
  <br/>
79
+ <button
80
+ type="button"
81
+ data-option-id="<?php echo esc_attr( $social_option_name ); ?>"
82
+ data-flag="disable-schema"
83
+ data-value="0"
84
+ aria-label="<?php esc_html_e( 'Activate schema component', 'wds' ); ?>"
85
+ class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
86
 
87
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
88
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
includes/admin/templates/dashboard/dashboard-widget-sitemap.php CHANGED
@@ -1,37 +1,44 @@
1
  <?php
2
- $sitemap_available = Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SITEMAP );
3
  $sitemap_crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
4
  if ( ! $sitemap_available ) {
5
  return;
6
  }
7
 
8
- $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP );
9
- $options = $_view['options'];
10
- $sitemap_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
11
- $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
12
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
13
- $is_member = $service->is_member();
14
- $override_native = Smartcrawl_Sitemap_Utils::override_native();
15
- $tooltip_text = $override_native
16
- ? esc_html__( "You can switch to the WordPress core sitemap through the configure button.", 'wds' )
17
  : esc_html__( "You're using the default WordPress sitemap. You can switch to SmartCrawl's advanced sitemaps at any time.", 'wds' );
18
- $sitemap_notice_text = smartcrawl_format_link(
19
  esc_html__( 'Your sitemap is available at %s', 'wds' ),
20
- smartcrawl_get_sitemap_url(), '/sitemap.xml', '_blank'
 
 
21
  );
22
  $core_sitemap_notice_text = smartcrawl_format_link(
23
  esc_html__( 'Your WordPress core sitemap is available at %s', 'wds' ),
24
- home_url( '/wp-sitemap.xml' ), '/wp-sitemap.xml', '_blank'
 
 
25
  );
26
  $news_sitemap_notice_text = smartcrawl_format_link(
27
  esc_html__( 'Your news sitemap is available at %s', 'wds' ),
28
- smartcrawl_get_news_sitemap_url(), '/news-sitemap.xml', '_blank'
 
 
29
  );
30
- $news_sitemap_enabled = smartcrawl_get_array_value( $options, 'enable-news-sitemap' );
31
  ?>
32
- <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SITEMAP ); ?>"
33
- class="sui-box wds-dashboard-widget"
34
- data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>">
 
35
 
36
  <div class="sui-box-header">
37
  <h2 class="sui-box-title">
@@ -39,10 +46,13 @@ $news_sitemap_enabled = smartcrawl_get_array_value( $options, 'enable-news-sitem
39
  </h2>
40
  <?php
41
  if ( $sitemap_enabled && $is_member && $sitemap_crawler_available ) {
42
- $this->_render( 'url-crawl-master', array(
43
- 'progress_template' => 'dashboard/dashboard-box-title-url-crawl-in-progress',
44
- 'ready_template' => 'dashboard/dashboard-box-title-url-crawl-stats',
45
- ) );
 
 
 
46
  }
47
  ?>
48
  </div>
@@ -52,18 +62,24 @@ $news_sitemap_enabled = smartcrawl_get_array_value( $options, 'enable-news-sitem
52
  <div class="wds-separator-top wds-draw-left-padded">
53
  <small><strong><?php esc_html_e( 'XML Sitemap', 'wds' ); ?></strong></small>
54
  <?php if ( $sitemap_enabled ) : ?>
55
- <span class="wds-sitemap-type-tag sui-tag sui-tooltip sui-tooltip-constrained"
56
- data-tooltip="<?php echo esc_attr( $tooltip_text ); ?>">
57
- <?php $override_native
 
 
58
  ? esc_html_e( 'SmartCrawl Sitemap', 'wds' )
59
- : esc_html_e( 'WP Core Sitemap', 'wds' ); ?>
 
60
  </span>
61
 
62
  <?php
63
- $this->_render( 'notice', array(
64
- 'class' => 'sui-notice-info',
65
- 'message' => $override_native ? $sitemap_notice_text : $core_sitemap_notice_text,
66
- ) );
 
 
 
67
  ?>
68
 
69
  <?php else : ?>
@@ -72,17 +88,21 @@ $news_sitemap_enabled = smartcrawl_get_array_value( $options, 'enable-news-sitem
72
  </p>
73
 
74
  <?php
75
- $this->_render( 'dismissable-notice', array(
76
- 'key' => 'dashboard-sitemap-disabled-warning',
77
- 'message' => __( 'Your sitemap is currently disabled. We highly recommend you enable this feature if you don’t already have a sitemap.', 'wds' ),
78
- 'class' => 'sui-notice-warning',
79
- ) );
 
 
 
80
  ?>
81
- <button type="button"
82
- data-option-id="<?php echo esc_attr( $option_name ); ?>"
83
- data-flag="<?php echo 'sitemap'; ?>"
84
- aria-label="<?php esc_html_e( 'Activate sitemap component', 'wds' ); ?>"
85
- class="wds-activate-component sui-button sui-button-blue wds-disabled-during-request">
 
86
 
87
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
88
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
@@ -90,28 +110,36 @@ $news_sitemap_enabled = smartcrawl_get_array_value( $options, 'enable-news-sitem
90
  <?php endif; ?>
91
  </div>
92
 
93
- <?php if ( $news_sitemap_enabled ): ?>
94
  <div class="wds-separator-top wds-draw-left-padded">
95
  <small><strong><?php esc_html_e( 'News Sitemap', 'wds' ); ?></strong></small>
96
 
97
- <?php $this->_render( 'notice', array(
98
- 'class' => 'sui-notice-info',
99
- 'message' => $news_sitemap_notice_text,
100
- ) ); ?>
 
 
 
 
 
101
  </div>
102
  <?php endif; ?>
103
 
104
- <?php if ( $sitemap_crawler_available ): ?>
105
  <div class="wds-separator-top cf <?php echo $is_member ? 'wds-draw-left-padded' : 'wds-box-blocked-area wds-draw-down wds-draw-left'; ?>">
106
  <small><strong><?php esc_html_e( 'URL Crawler', 'wds' ); ?></strong></small>
107
  <?php if ( $is_member ) : ?>
108
  <?php if ( $sitemap_enabled ) : ?>
109
  <?php
110
- $this->_render( 'url-crawl-master', array(
111
- 'ready_template' => 'dashboard/dashboard-url-crawl-stats',
112
- 'progress_template' => 'dashboard/dashboard-url-crawl-in-progress',
113
- 'no_data_template' => 'dashboard/dashboard-url-crawl-no-data-small',
114
- ) );
 
 
 
115
  ?>
116
  <?php else : ?>
117
  <p>
@@ -122,10 +150,12 @@ $news_sitemap_enabled = smartcrawl_get_array_value( $options, 'enable-news-sitem
122
  </span></div>
123
  <?php endif; ?>
124
  <?php else : ?>
125
- <a href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_crawl_pro_tag"
126
- target="_blank">
127
- <span class="sui-tag sui-tag-pro sui-tooltip"
128
- data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>">
 
 
129
  <?php esc_html_e( 'Pro', 'wds' ); ?>
130
  </span>
131
  </a>
@@ -138,12 +168,13 @@ $news_sitemap_enabled = smartcrawl_get_array_value( $options, 'enable-news-sitem
138
  </div>
139
 
140
  <div class="sui-box-footer">
141
- <a href="<?php echo esc_attr( $page_url ); ?>"
142
- aria-label="<?php esc_html_e( 'Configure sitemap component', 'wds' ); ?>"
143
- class="sui-button sui-button-ghost">
144
-
145
- <span class="sui-icon-wrench-tool"
146
- aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
 
147
  </a>
148
  </div>
149
  </section>
1
  <?php
2
+ $sitemap_available = Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SITEMAP );
3
  $sitemap_crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
4
  if ( ! $sitemap_available ) {
5
  return;
6
  }
7
 
8
+ $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP );
9
+ $options = $_view['options'];
10
+ $sitemap_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
11
+ $option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
12
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
13
+ $is_member = $service->is_member();
14
+ $override_native = Smartcrawl_Sitemap_Utils::override_native();
15
+ $tooltip_text = $override_native
16
+ ? esc_html__( 'You can switch to the WordPress core sitemap through the configure button.', 'wds' )
17
  : esc_html__( "You're using the default WordPress sitemap. You can switch to SmartCrawl's advanced sitemaps at any time.", 'wds' );
18
+ $sitemap_notice_text = smartcrawl_format_link(
19
  esc_html__( 'Your sitemap is available at %s', 'wds' ),
20
+ smartcrawl_get_sitemap_url(),
21
+ '/sitemap.xml',
22
+ '_blank'
23
  );
24
  $core_sitemap_notice_text = smartcrawl_format_link(
25
  esc_html__( 'Your WordPress core sitemap is available at %s', 'wds' ),
26
+ home_url( '/wp-sitemap.xml' ),
27
+ '/wp-sitemap.xml',
28
+ '_blank'
29
  );
30
  $news_sitemap_notice_text = smartcrawl_format_link(
31
  esc_html__( 'Your news sitemap is available at %s', 'wds' ),
32
+ smartcrawl_get_news_sitemap_url(),
33
+ '/news-sitemap.xml',
34
+ '_blank'
35
  );
36
+ $news_sitemap_enabled = smartcrawl_get_array_value( $options, 'enable-news-sitemap' );
37
  ?>
38
+ <section
39
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SITEMAP ); ?>"
40
+ class="sui-box wds-dashboard-widget"
41
+ data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>">
42
 
43
  <div class="sui-box-header">
44
  <h2 class="sui-box-title">
46
  </h2>
47
  <?php
48
  if ( $sitemap_enabled && $is_member && $sitemap_crawler_available ) {
49
+ $this->render_view(
50
+ 'url-crawl-master',
51
+ array(
52
+ 'progress_template' => 'dashboard/dashboard-box-title-url-crawl-in-progress',
53
+ 'ready_template' => 'dashboard/dashboard-box-title-url-crawl-stats',
54
+ )
55
+ );
56
  }
57
  ?>
58
  </div>
62
  <div class="wds-separator-top wds-draw-left-padded">
63
  <small><strong><?php esc_html_e( 'XML Sitemap', 'wds' ); ?></strong></small>
64
  <?php if ( $sitemap_enabled ) : ?>
65
+ <span
66
+ class="wds-sitemap-type-tag sui-tag sui-tooltip sui-tooltip-constrained"
67
+ data-tooltip="<?php echo esc_attr( $tooltip_text ); ?>">
68
+ <?php
69
+ $override_native
70
  ? esc_html_e( 'SmartCrawl Sitemap', 'wds' )
71
+ : esc_html_e( 'WP Core Sitemap', 'wds' );
72
+ ?>
73
  </span>
74
 
75
  <?php
76
+ $this->render_view(
77
+ 'notice',
78
+ array(
79
+ 'class' => 'sui-notice-info',
80
+ 'message' => $override_native ? $sitemap_notice_text : $core_sitemap_notice_text,
81
+ )
82
+ );
83
  ?>
84
 
85
  <?php else : ?>
88
  </p>
89
 
90
  <?php
91
+ $this->render_view(
92
+ 'dismissable-notice',
93
+ array(
94
+ 'key' => 'dashboard-sitemap-disabled-warning',
95
+ 'message' => __( 'Your sitemap is currently disabled. We highly recommend you enable this feature if you don’t already have a sitemap.', 'wds' ),
96
+ 'class' => 'sui-notice-warning',
97
+ )
98
+ );
99
  ?>
100
+ <button
101
+ type="button"
102
+ data-option-id="<?php echo esc_attr( $option_name ); ?>"
103
+ data-flag="<?php echo 'sitemap'; ?>"
104
+ aria-label="<?php esc_html_e( 'Activate sitemap component', 'wds' ); ?>"
105
+ class="wds-activate-component sui-button sui-button-blue wds-disabled-during-request">
106
 
107
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
108
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
110
  <?php endif; ?>
111
  </div>
112
 
113
+ <?php if ( $news_sitemap_enabled ) : ?>
114
  <div class="wds-separator-top wds-draw-left-padded">
115
  <small><strong><?php esc_html_e( 'News Sitemap', 'wds' ); ?></strong></small>
116
 
117
+ <?php
118
+ $this->render_view(
119
+ 'notice',
120
+ array(
121
+ 'class' => 'sui-notice-info',
122
+ 'message' => $news_sitemap_notice_text,
123
+ )
124
+ );
125
+ ?>
126
  </div>
127
  <?php endif; ?>
128
 
129
+ <?php if ( $sitemap_crawler_available ) : ?>
130
  <div class="wds-separator-top cf <?php echo $is_member ? 'wds-draw-left-padded' : 'wds-box-blocked-area wds-draw-down wds-draw-left'; ?>">
131
  <small><strong><?php esc_html_e( 'URL Crawler', 'wds' ); ?></strong></small>
132
  <?php if ( $is_member ) : ?>
133
  <?php if ( $sitemap_enabled ) : ?>
134
  <?php
135
+ $this->render_view(
136
+ 'url-crawl-master',
137
+ array(
138
+ 'ready_template' => 'dashboard/dashboard-url-crawl-stats',
139
+ 'progress_template' => 'dashboard/dashboard-url-crawl-in-progress',
140
+ 'no_data_template' => 'dashboard/dashboard-url-crawl-no-data-small',
141
+ )
142
+ );
143
  ?>
144
  <?php else : ?>
145
  <p>
150
  </span></div>
151
  <?php endif; ?>
152
  <?php else : ?>
153
+ <a
154
+ href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dash_crawl_pro_tag"
155
+ target="_blank">
156
+ <span
157
+ class="sui-tag sui-tag-pro sui-tooltip"
158
+ data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>">
159
  <?php esc_html_e( 'Pro', 'wds' ); ?>
160
  </span>
161
  </a>
168
  </div>
169
 
170
  <div class="sui-box-footer">
171
+ <a
172
+ href="<?php echo esc_attr( $page_url ); ?>"
173
+ aria-label="<?php esc_html_e( 'Configure sitemap component', 'wds' ); ?>"
174
+ class="sui-button sui-button-ghost">
175
+ <span
176
+ class="sui-icon-wrench-tool"
177
+ aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
178
  </a>
179
  </div>
180
  </section>
includes/admin/templates/dashboard/dashboard-widget-social.php CHANGED
@@ -3,18 +3,18 @@ if ( ! Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIA
3
  return;
4
  }
5
 
6
- $options = $_view['options'];
7
- $og_enabled = smartcrawl_get_array_value( $options, 'og-enable' );
8
- $twitter_card_enabled = smartcrawl_get_array_value( $options, 'twitter-card-enable' );
9
- $twitter_card_type = smartcrawl_get_array_value( $options, 'twitter-card-type' );
10
- $twitter_card_status_text = Smartcrawl_Twitter_Printer::CARD_IMAGE === $twitter_card_type ? esc_html__( 'Summary Card with Large Image', 'wds' ) : esc_html__( 'Summary Card', 'wds' );
11
  $pinterest_verification_status = smartcrawl_get_array_value( $options, 'pinterest-verification-status' );
12
- $pinterest_tag = smartcrawl_get_array_value( $options, 'pinterest-verify' );
13
 
14
- $social_page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SOCIAL );
15
- $social_option_name = Smartcrawl_Settings::TAB_SOCIAL . '_options';
16
  $settings_option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
17
- $social_enabled = Smartcrawl_Settings::get_setting( 'social' );
18
  ?>
19
  <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SOCIAL ); ?>" class="sui-box wds-dashboard-widget">
20
  <div class="sui-box-header">
@@ -34,12 +34,11 @@ $social_enabled = Smartcrawl_Settings::get_setting( 'social' );
34
  <small><?php esc_html_e( 'Add meta data to your pages to make them look great when shared platforms such as Facebook and other popular social networks.', 'wds' ); ?></small>
35
  </p>
36
  <button
37
- type="button"
38
- data-option-id="<?php echo esc_attr( $social_option_name ); ?>"
39
- data-flag="<?php echo 'og-enable'; ?>"
40
- aria-label="<?php esc_html_e( 'Activate OpenGraph', 'wds' ); ?>"
41
- class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
42
-
43
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
44
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
45
  </button>
@@ -56,12 +55,13 @@ $social_enabled = Smartcrawl_Settings::get_setting( 'social' );
56
  <p>
57
  <small><?php esc_attr_e( 'With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping to drive traffic to your website.', 'wds' ); ?></small>
58
  </p>
59
- <button type="button"
60
- data-option-id="<?php echo esc_attr( $social_option_name ); ?>"
61
- data-flag="<?php echo 'twitter-card-enable'; ?>"
62
- aria-label="<?php esc_html_e( 'Activate twitter cards', 'wds' ); ?>"
63
- class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
64
-
 
65
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
66
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
67
  </button>
@@ -80,9 +80,11 @@ $social_enabled = Smartcrawl_Settings::get_setting( 'social' );
80
  <p>
81
  <small><?php esc_html_e( 'Verify your website with Pinterest to attribute your website when your website content is pinned to the platform.', 'wds' ); ?></small>
82
  </p>
83
- <a href="<?php echo esc_attr( $social_page_url ); ?>&tab=tab_pinterest_verification"
84
- aria-label="<?php esc_html_e( 'Connect to pinterest', 'wds' ); ?>"
85
- class="sui-button sui-button-blue">
 
 
86
  <span class="sui-icon-plus" aria-hidden="true"></span>
87
 
88
  <?php esc_html_e( 'Connect', 'wds' ); ?>
@@ -98,19 +100,23 @@ $social_enabled = Smartcrawl_Settings::get_setting( 'social' );
98
 
99
  <div class="sui-box-footer">
100
  <?php if ( $social_enabled ) : ?>
101
- <a href="<?php echo esc_attr( $social_page_url ); ?>"
102
- aria-label="<?php esc_html_e( 'Configure social component', 'wds' ); ?>"
103
- class="sui-button sui-button-ghost">
104
- <span class="sui-icon-wrench-tool"
105
- aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
 
 
 
106
  </a>
107
  <?php else : ?>
108
- <button type="button"
109
- data-option-id="<?php echo esc_attr( $settings_option_name ); ?>"
110
- data-flag="<?php echo esc_attr( 'social' ); ?>"
111
- aria-label="<?php esc_html_e( 'Activate social component', 'wds' ); ?>"
112
- class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
113
-
 
114
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
115
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
116
  </button>
3
  return;
4
  }
5
 
6
+ $options = $_view['options'];
7
+ $og_enabled = smartcrawl_get_array_value( $options, 'og-enable' );
8
+ $twitter_card_enabled = smartcrawl_get_array_value( $options, 'twitter-card-enable' );
9
+ $twitter_card_type = smartcrawl_get_array_value( $options, 'twitter-card-type' );
10
+ $twitter_card_status_text = Smartcrawl_Twitter_Printer::CARD_IMAGE === $twitter_card_type ? esc_html__( 'Summary Card with Large Image', 'wds' ) : esc_html__( 'Summary Card', 'wds' );
11
  $pinterest_verification_status = smartcrawl_get_array_value( $options, 'pinterest-verification-status' );
12
+ $pinterest_tag = smartcrawl_get_array_value( $options, 'pinterest-verify' );
13
 
14
+ $social_page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SOCIAL );
15
+ $social_option_name = Smartcrawl_Settings::TAB_SOCIAL . '_options';
16
  $settings_option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
17
+ $social_enabled = Smartcrawl_Settings::get_setting( 'social' );
18
  ?>
19
  <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SOCIAL ); ?>" class="sui-box wds-dashboard-widget">
20
  <div class="sui-box-header">
34
  <small><?php esc_html_e( 'Add meta data to your pages to make them look great when shared platforms such as Facebook and other popular social networks.', 'wds' ); ?></small>
35
  </p>
36
  <button
37
+ type="button"
38
+ data-option-id="<?php echo esc_attr( $social_option_name ); ?>"
39
+ data-flag="<?php echo 'og-enable'; ?>"
40
+ aria-label="<?php esc_html_e( 'Activate OpenGraph', 'wds' ); ?>"
41
+ class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue">
 
42
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
43
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
44
  </button>
55
  <p>
56
  <small><?php esc_attr_e( 'With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping to drive traffic to your website.', 'wds' ); ?></small>
57
  </p>
58
+ <button
59
+ type="button"
60
+ data-option-id="<?php echo esc_attr( $social_option_name ); ?>"
61
+ data-flag="<?php echo 'twitter-card-enable'; ?>"
62
+ aria-label="<?php esc_html_e( 'Activate twitter cards', 'wds' ); ?>"
63
+ class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue"
64
+ >
65
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
66
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
67
  </button>
80
  <p>
81
  <small><?php esc_html_e( 'Verify your website with Pinterest to attribute your website when your website content is pinned to the platform.', 'wds' ); ?></small>
82
  </p>
83
+ <a
84
+ href="<?php echo esc_attr( $social_page_url ); ?>&tab=tab_pinterest_verification"
85
+ aria-label="<?php esc_html_e( 'Connect to pinterest', 'wds' ); ?>"
86
+ class="sui-button sui-button-blue"
87
+ >
88
  <span class="sui-icon-plus" aria-hidden="true"></span>
89
 
90
  <?php esc_html_e( 'Connect', 'wds' ); ?>
100
 
101
  <div class="sui-box-footer">
102
  <?php if ( $social_enabled ) : ?>
103
+ <a
104
+ href="<?php echo esc_attr( $social_page_url ); ?>"
105
+ aria-label="<?php esc_html_e( 'Configure social component', 'wds' ); ?>"
106
+ class="sui-button sui-button-ghost"
107
+ >
108
+ <span
109
+ class="sui-icon-wrench-tool"
110
+ aria-hidden="true"></span> <?php esc_html_e( 'Configure', 'wds' ); ?>
111
  </a>
112
  <?php else : ?>
113
+ <button
114
+ type="button"
115
+ data-option-id="<?php echo esc_attr( $settings_option_name ); ?>"
116
+ data-flag="<?php echo esc_attr( 'social' ); ?>"
117
+ aria-label="<?php esc_html_e( 'Activate social component', 'wds' ); ?>"
118
+ class="wds-activate-component wds-disabled-during-request sui-button sui-button-blue"
119
+ >
120
  <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wds' ); ?></span>
121
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
122
  </button>
includes/admin/templates/dashboard/dashboard-widget-upgrade.php CHANGED
@@ -1,13 +1,14 @@
1
  <?php
2
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
3
  $is_member = $service->is_member();
4
  if ( $is_member ) {
5
  return;
6
  }
7
  ?>
8
 
9
- <section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_UPGRADE ); ?>"
10
- class="sui-box wds-dashboard-widget">
 
11
 
12
  <div class="sui-box-header">
13
  <h2 class="sui-box-title">
@@ -15,8 +16,9 @@ if ( $is_member ) {
15
  <?php esc_html_e( 'SmartCrawl Pro', 'wds' ); ?>
16
  </h2>
17
 
18
- <span class="sui-tag sui-tag-pro sui-tooltip"
19
- data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>">
 
20
  <?php esc_html_e( 'Pro', 'wds' ); ?>
21
  </span>
22
  </div>
@@ -34,8 +36,9 @@ if ( $is_member ) {
34
  <li><?php esc_html_e( 'The WPMU DEV guarantee', 'wds' ); ?></li>
35
  </ul>
36
 
37
- <a target="_blank" class="sui-button sui-button-purple"
38
- href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dashboard_upsellwidget_button">
 
39
  <?php esc_html_e( 'Try Pro Free Today!', 'wds' ); ?>
40
  </a>
41
  </div>
1
  <?php
2
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
3
  $is_member = $service->is_member();
4
  if ( $is_member ) {
5
  return;
6
  }
7
  ?>
8
 
9
+ <section
10
+ id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_UPGRADE ); ?>"
11
+ class="sui-box wds-dashboard-widget">
12
 
13
  <div class="sui-box-header">
14
  <h2 class="sui-box-title">
16
  <?php esc_html_e( 'SmartCrawl Pro', 'wds' ); ?>
17
  </h2>
18
 
19
+ <span
20
+ class="sui-tag sui-tag-pro sui-tooltip"
21
+ data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>">
22
  <?php esc_html_e( 'Pro', 'wds' ); ?>
23
  </span>
24
  </div>
36
  <li><?php esc_html_e( 'The WPMU DEV guarantee', 'wds' ); ?></li>
37
  </ul>
38
 
39
+ <a
40
+ target="_blank" class="sui-button sui-button-purple"
41
+ href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_dashboard_upsellwidget_button">
42
  <?php esc_html_e( 'Try Pro Free Today!', 'wds' ); ?>
43
  </a>
44
  </div>
includes/admin/templates/dashboard/dashboard.php CHANGED
@@ -7,18 +7,28 @@
7
 
8
  $configs_available = is_main_site();
9
  ?>
10
- <?php $this->_render( 'before-page-container' ); ?>
11
 
12
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-dashboard' ); ?>">
13
- <?php $this->_render( 'page-header', array(
14
- 'title' => esc_html__( 'Dashboard', 'wds' ),
15
- 'documentation_chapter' => 'dashboard',
16
- 'utm_campaign' => 'smartcrawl_dashboard_docs',
17
- ) ); ?>
 
 
 
 
 
18
 
19
- <?php $this->_render( 'floating-notices', array(
20
- 'keys' => array( 'wds-config-notice' ),
21
- ) ); ?>
 
 
 
 
 
22
 
23
  <div class="sui-row">
24
  <div class="sui-col-md-12">
@@ -30,29 +40,28 @@ $configs_available = is_main_site();
30
  <div class="sui-col">
31
  <?php
32
  Smartcrawl_Lighthouse_Dashboard_Renderer::render( 'dashboard/dashboard-widget-lighthouse' );
33
- $this->_render( 'dashboard/dashboard-widget-content-analysis' );
34
- $this->_render( 'dashboard/dashboard-widget-social' );
35
- $this->_render( 'dashboard/dashboard-widget-schema' );
36
- if ( Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SETTINGS )
37
- && $configs_available ) {
38
- $this->_render( 'dashboard/dashboard-widget-configs' );
39
  }
40
  ?>
41
  </div>
42
 
43
  <div class="sui-col">
44
  <?php
45
- $this->_render( 'dashboard/dashboard-widget-upgrade' );
46
- $this->_render( 'dashboard/dashboard-widget-onpage' );
47
- $this->_render( 'dashboard/dashboard-widget-sitemap' );
48
- $this->_render( 'dashboard/dashboard-widget-advanced-tools' );
49
- $this->_render( 'dashboard/dashboard-widget-reports' );
50
  ?>
51
  </div>
52
  </div>
53
 
54
- <?php do_action( 'wds-dshboard-after_settings' ); ?>
55
 
56
- <?php $this->_render( 'dashboard/dashboard-cross-sell-footer' ); ?>
57
- <?php $this->_render( 'footer' ); ?>
58
  </div>
7
 
8
  $configs_available = is_main_site();
9
  ?>
10
+ <?php $this->render_view( 'before-page-container' ); ?>
11
 
12
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-dashboard' ); ?>">
13
+ <?php
14
+ $this->render_view(
15
+ 'page-header',
16
+ array(
17
+ 'title' => esc_html__( 'Dashboard', 'wds' ),
18
+ 'documentation_chapter' => 'dashboard',
19
+ 'utm_campaign' => 'smartcrawl_dashboard_docs',
20
+ )
21
+ );
22
+ ?>
23
 
24
+ <?php
25
+ $this->render_view(
26
+ 'floating-notices',
27
+ array(
28
+ 'keys' => array( 'wds-config-notice' ),
29
+ )
30
+ );
31
+ ?>
32
 
33
  <div class="sui-row">
34
  <div class="sui-col-md-12">
40
  <div class="sui-col">
41
  <?php
42
  Smartcrawl_Lighthouse_Dashboard_Renderer::render( 'dashboard/dashboard-widget-lighthouse' );
43
+ $this->render_view( 'dashboard/dashboard-widget-content-analysis' );
44
+ $this->render_view( 'dashboard/dashboard-widget-social' );
45
+ $this->render_view( 'dashboard/dashboard-widget-schema' );
46
+ if ( Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SETTINGS ) && $configs_available ) {
47
+ $this->render_view( 'dashboard/dashboard-widget-configs' );
 
48
  }
49
  ?>
50
  </div>
51
 
52
  <div class="sui-col">
53
  <?php
54
+ $this->render_view( 'dashboard/dashboard-widget-upgrade' );
55
+ $this->render_view( 'dashboard/dashboard-widget-onpage' );
56
+ $this->render_view( 'dashboard/dashboard-widget-sitemap' );
57
+ $this->render_view( 'dashboard/dashboard-widget-advanced-tools' );
58
+ $this->render_view( 'dashboard/dashboard-widget-reports' );
59
  ?>
60
  </div>
61
  </div>
62
 
63
+ <?php do_action( 'wds-dshboard-after_settings' ); // phpcs:ignore ?>
64
 
65
+ <?php $this->render_view( 'dashboard/dashboard-cross-sell-footer' ); ?>
66
+ <?php $this->render_view( 'footer' ); ?>
67
  </div>
includes/admin/templates/dashboard/onboard-modal-body.php CHANGED
@@ -1,36 +1,42 @@
1
  <?php
2
- $sitemap_available = Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SITEMAP );
3
- $social_available = Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL );
4
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
5
  $robots_file_exists = Smartcrawl_Controller_Robots::get()->file_exists();
6
  ?>
7
 
8
  <div class="wds-separator-top">
9
  <?php
10
- $this->_render( 'toggle-item', array(
11
- 'field_name' => 'analysis-enable',
12
- 'item_label' => esc_html__( 'SEO & Readability Analysis', 'wds' ),
13
- 'item_description' => esc_html__( 'Have your pages and posts analyzed for SEO and readability improvements to improve your search ranking', 'wds' ),
14
- 'checked' => true,
15
- 'attributes' => array(
16
- 'data-processing' => esc_attr__( 'Activating SEO & Readability Analysis', 'wds' ),
17
- ),
18
- ) );
 
 
 
19
  ?>
20
  </div>
21
 
22
- <?php if ( $sitemap_available ): ?>
23
  <div class="wds-separator-top">
24
  <?php
25
- $this->_render( 'toggle-item', array(
26
- 'field_name' => 'sitemaps-enable',
27
- 'item_label' => esc_html__( 'Sitemaps', 'wds' ),
28
- 'item_description' => esc_html__( 'Sitemaps expose your site content to search engines and allow them to discover it more easily.', 'wds' ),
29
- 'checked' => true,
30
- 'attributes' => array(
31
- 'data-processing' => esc_attr__( 'Activating Sitemaps', 'wds' ),
32
- ),
33
- ) );
 
 
 
34
  ?>
35
  </div>
36
  <?php endif; ?>
@@ -43,38 +49,47 @@ $robots_file_exists = Smartcrawl_Controller_Robots::get()->file_exists();
43
  if ( $robots_file_exists ) {
44
  $robots_attributes['disabled'] = 'disabled';
45
  }
46
- $this->_render( 'toggle-item', array(
47
- 'field_name' => 'robots-txt-enable',
48
- 'item_label' => esc_html__( 'Robots.txt File', 'wds' ),
49
- 'item_description' => esc_html__( 'All sites are recommended to have a robots.txt file that instructs search engines what they can and can’t crawl. We will create a default robots.txt file which you can customize later.', 'wds' ),
50
- 'checked' => ! $robots_file_exists,
51
- 'attributes' => $robots_attributes,
52
- ) );
 
 
 
53
  if ( $robots_file_exists ) {
54
- $this->_render( 'notice', array(
55
- 'message' => smartcrawl_format_link(
56
- esc_html__( "We've detected an existing %s file that we are unable to edit. You will need to remove it before you can enable this feature.", 'wds' ),
57
- smartcrawl_get_robots_url(),
58
- 'robots.txt',
59
- '_blank'
60
- ),
61
- ) );
 
 
 
62
  }
63
  ?>
64
  </div>
65
 
66
- <?php if ( $social_available ): ?>
67
  <div class="wds-separator-top">
68
  <?php
69
- $this->_render( 'toggle-item', array(
70
- 'field_name' => 'opengraph-twitter-enable',
71
- 'item_label' => esc_html__( 'OpenGraph & Twitter Cards', 'wds' ),
72
- 'item_description' => esc_html__( 'Enhance how your posts and pages look when shared on Twitter and Facebook by adding extra meta tags to your page output.', 'wds' ),
73
- 'checked' => true,
74
- 'attributes' => array(
75
- 'data-processing' => esc_attr__( 'Activating OpenGraph & Twitter Cards', 'wds' ),
76
- ),
77
- ) );
 
 
 
78
  ?>
79
  </div>
80
  <?php endif; ?>
1
  <?php
2
+ $sitemap_available = Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SITEMAP );
3
+ $social_available = Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL );
4
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
5
  $robots_file_exists = Smartcrawl_Controller_Robots::get()->file_exists();
6
  ?>
7
 
8
  <div class="wds-separator-top">
9
  <?php
10
+ $this->render_view(
11
+ 'toggle-item',
12
+ array(
13
+ 'field_name' => 'analysis-enable',
14
+ 'item_label' => esc_html__( 'SEO & Readability Analysis', 'wds' ),
15
+ 'item_description' => esc_html__( 'Have your pages and posts analyzed for SEO and readability improvements to improve your search ranking', 'wds' ),
16
+ 'checked' => true,
17
+ 'attributes' => array(
18
+ 'data-processing' => esc_attr__( 'Activating SEO & Readability Analysis', 'wds' ),
19
+ ),
20
+ )
21
+ );
22
  ?>
23
  </div>
24
 
25
+ <?php if ( $sitemap_available ) : ?>
26
  <div class="wds-separator-top">
27
  <?php
28
+ $this->render_view(
29
+ 'toggle-item',
30
+ array(
31
+ 'field_name' => 'sitemaps-enable',
32
+ 'item_label' => esc_html__( 'Sitemaps', 'wds' ),
33
+ 'item_description' => esc_html__( 'Sitemaps expose your site content to search engines and allow them to discover it more easily.', 'wds' ),
34
+ 'checked' => true,
35
+ 'attributes' => array(
36
+ 'data-processing' => esc_attr__( 'Activating Sitemaps', 'wds' ),
37
+ ),
38
+ )
39
+ );
40
  ?>
41
  </div>
42
  <?php endif; ?>
49
  if ( $robots_file_exists ) {
50
  $robots_attributes['disabled'] = 'disabled';
51
  }
52
+ $this->render_view(
53
+ 'toggle-item',
54
+ array(
55
+ 'field_name' => 'robots-txt-enable',
56
+ 'item_label' => esc_html__( 'Robots.txt File', 'wds' ),
57
+ 'item_description' => esc_html__( 'All sites are recommended to have a robots.txt file that instructs search engines what they can and can’t crawl. We will create a default robots.txt file which you can customize later.', 'wds' ),
58
+ 'checked' => ! $robots_file_exists,
59
+ 'attributes' => $robots_attributes,
60
+ )
61
+ );
62
  if ( $robots_file_exists ) {
63
+ $this->render_view(
64
+ 'notice',
65
+ array(
66
+ 'message' => smartcrawl_format_link(
67
+ esc_html__( "We've detected an existing %s file that we are unable to edit. You will need to remove it before you can enable this feature.", 'wds' ),
68
+ smartcrawl_get_robots_url(),
69
+ 'robots.txt',
70
+ '_blank'
71
+ ),
72
+ )
73
+ );
74
  }
75
  ?>
76
  </div>
77
 
78
+ <?php if ( $social_available ) : ?>
79
  <div class="wds-separator-top">
80
  <?php
81
+ $this->render_view(
82
+ 'toggle-item',
83
+ array(
84
+ 'field_name' => 'opengraph-twitter-enable',
85
+ 'item_label' => esc_html__( 'OpenGraph & Twitter Cards', 'wds' ),
86
+ 'item_description' => esc_html__( 'Enhance how your posts and pages look when shared on Twitter and Facebook by adding extra meta tags to your page output.', 'wds' ),
87
+ 'checked' => true,
88
+ 'attributes' => array(
89
+ 'data-processing' => esc_attr__( 'Activating OpenGraph & Twitter Cards', 'wds' ),
90
+ ),
91
+ )
92
+ );
93
  ?>
94
  </div>
95
  <?php endif; ?>
includes/admin/templates/dashboard/onboard-modal-footer.php CHANGED
@@ -5,9 +5,10 @@
5
  </div>
6
 
7
  <div class="wds-onboard-footer-skip">
8
- <a class="onboard-skip"
9
- href="#"
10
- aria-label="<?php esc_html_e( 'Close this dialog window and skip onboarding', 'wds' ); ?>">
 
11
  <?php esc_html_e( 'Skip', 'wds' ); ?>
12
  </a>
13
  </div>
5
  </div>
6
 
7
  <div class="wds-onboard-footer-skip">
8
+ <a
9
+ class="onboard-skip"
10
+ href="#"
11
+ aria-label="<?php esc_html_e( 'Close this dialog window and skip onboarding', 'wds' ); ?>">
12
  <?php esc_html_e( 'Skip', 'wds' ); ?>
13
  </a>
14
  </div>
includes/admin/templates/dashboard/onboard-progress.php CHANGED
@@ -1,6 +1,9 @@
1
  <p><?php esc_html_e( 'Please wait a few moments while we activate those services', 'wds' ); ?></p>
2
  <?php
3
- $this->_render( 'progress-bar', array(
4
- 'progress' => 0,
5
- ) );
 
 
 
6
  ?>
1
  <p><?php esc_html_e( 'Please wait a few moments while we activate those services', 'wds' ); ?></p>
2
  <?php
3
+ $this->render_view(
4
+ 'progress-bar',
5
+ array(
6
+ 'progress' => 0,
7
+ )
8
+ );
9
  ?>
includes/admin/templates/dashboard/onboarding.php CHANGED
@@ -1,9 +1,12 @@
1
  <?php
2
- $this->_render( 'modal', array(
3
- 'id' => 'wds-onboarding',
4
- 'title' => esc_html__( 'Quick setup', 'wds' ),
5
- 'description' => esc_html__( "Welcome to SmartCrawl, the hottest SEO plugin for WordPress! Let's quickly set up the basics for you, then you can fine tune each setting as you go - our recommendations are on by default.", 'wds' ),
6
- 'header_actions_template' => 'dashboard/onboard-modal-header-button',
7
- 'body_template' => 'dashboard/onboard-modal-body',
8
- 'footer_template' => 'dashboard/onboard-modal-footer',
9
- ) );
 
 
 
1
  <?php
2
+ $this->render_view(
3
+ 'modal',
4
+ array(
5
+ 'id' => 'wds-onboarding',
6
+ 'title' => esc_html__( 'Quick setup', 'wds' ),
7
+ 'description' => esc_html__( "Welcome to SmartCrawl, the hottest SEO plugin for WordPress! Let's quickly set up the basics for you, then you can fine tune each setting as you go - our recommendations are on by default.", 'wds' ),
8
+ 'header_actions_template' => 'dashboard/onboard-modal-header-button',
9
+ 'body_template' => 'dashboard/onboard-modal-body',
10
+ 'footer_template' => 'dashboard/onboard-modal-footer',
11
+ )
12
+ );
includes/admin/templates/disabled-component-inner.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
- $content = empty( $content ) ? '' : $content;
3
- $image = empty( $image ) ? '' : $image;
4
- $component = empty( $component ) ? '' : $component;
5
- $button_text = empty( $button_text ) ? '' : $button_text;
6
- $is_member = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member();
7
- $upgrade_tag = empty( $upgrade_tag ) ? '' : $upgrade_tag;
8
- $premium_feature = empty( $premium_feature ) ? false : $premium_feature;
9
- $notice = empty( $notice ) ? '' : $notice;
10
- $button_url = empty( $button_url ) ? '' : $button_url;
11
- $button_icon = empty( $button_icon ) ? '' : $button_icon;
12
  $button_disabled = empty( $button_disabled ) ? false : $button_disabled;
13
 
14
  $image_url = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, $image );
@@ -17,10 +17,13 @@ $image_url = Smartcrawl_White_Label::get()->get_wpmudev_hero_image( $image_url )
17
  $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=' . $upgrade_tag;
18
  ?>
19
  <div class="wds-disabled-component">
20
- <?php if ( $image_url ): ?>
21
  <p>
22
- <img src="<?php echo esc_attr( $image_url ); ?>"
23
- alt="<?php esc_attr_e( 'Disabled', 'wds' ); ?>" class="wds-disabled-image"/>
 
 
 
24
  </p>
25
  <?php endif; ?>
26
 
@@ -38,24 +41,30 @@ $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source
38
  <?php endif; ?>
39
 
40
  <?php if ( $premium_feature && ! $is_member ) : ?>
41
- <a class="sui-button sui-button-purple"
42
- target="_blank"
43
- href="<?php echo esc_attr( $upgrade_url ); ?>">
 
 
44
  <?php esc_html_e( 'Upgrade to Pro', 'wds' ); ?>
45
  </a>
46
  <?php else : ?>
47
  <?php if ( $button_url ) : ?>
48
- <a class="sui-button sui-button-blue <?php echo $button_disabled ? 'disabled' : ''; ?>"
49
- href="<?php echo esc_attr( $button_url ); ?>">
50
- <?php if ( $button_icon ): ?>
 
 
51
  <span class="<?php echo esc_attr( $button_icon ); ?>" aria-hidden="true"></span>
52
  <?php endif; ?>
53
  <?php echo esc_html( $button_text ); ?>
54
  </a>
55
  <?php else : ?>
56
- <input name="submit" class="sui-button sui-button-blue <?php echo $button_disabled ? 'disabled' : ''; ?>"
57
- value="<?php echo esc_attr( $button_text ); ?>"
58
- type="submit"/>
 
 
59
  <?php endif; ?>
60
  <?php endif; ?>
61
  </div>
1
  <?php
2
+ $content = empty( $content ) ? '' : $content;
3
+ $image = empty( $image ) ? '' : $image;
4
+ $component = empty( $component ) ? '' : $component;
5
+ $button_text = empty( $button_text ) ? '' : $button_text;
6
+ $is_member = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member();
7
+ $upgrade_tag = empty( $upgrade_tag ) ? '' : $upgrade_tag;
8
+ $premium_feature = ! empty( $premium_feature );
9
+ $notice = empty( $notice ) ? '' : $notice;
10
+ $button_url = empty( $button_url ) ? '' : $button_url;
11
+ $button_icon = empty( $button_icon ) ? '' : $button_icon;
12
  $button_disabled = empty( $button_disabled ) ? false : $button_disabled;
13
 
14
  $image_url = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, $image );
17
  $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=' . $upgrade_tag;
18
  ?>
19
  <div class="wds-disabled-component">
20
+ <?php if ( $image_url ) : ?>
21
  <p>
22
+ <img
23
+ src="<?php echo esc_attr( $image_url ); ?>"
24
+ alt="<?php esc_attr_e( 'Disabled', 'wds' ); ?>"
25
+ class="wds-disabled-image"
26
+ />
27
  </p>
28
  <?php endif; ?>
29
 
41
  <?php endif; ?>
42
 
43
  <?php if ( $premium_feature && ! $is_member ) : ?>
44
+ <a
45
+ class="sui-button sui-button-purple"
46
+ target="_blank"
47
+ href="<?php echo esc_attr( $upgrade_url ); ?>"
48
+ >
49
  <?php esc_html_e( 'Upgrade to Pro', 'wds' ); ?>
50
  </a>
51
  <?php else : ?>
52
  <?php if ( $button_url ) : ?>
53
+ <a
54
+ class="sui-button sui-button-blue <?php echo $button_disabled ? 'disabled' : ''; ?>"
55
+ href="<?php echo esc_attr( $button_url ); ?>"
56
+ >
57
+ <?php if ( $button_icon ) : ?>
58
  <span class="<?php echo esc_attr( $button_icon ); ?>" aria-hidden="true"></span>
59
  <?php endif; ?>
60
  <?php echo esc_html( $button_text ); ?>
61
  </a>
62
  <?php else : ?>
63
+ <input
64
+ name="submit" class="sui-button sui-button-blue <?php echo $button_disabled ? 'disabled' : ''; ?>"
65
+ value="<?php echo esc_attr( $button_text ); ?>"
66
+ type="submit"
67
+ />
68
  <?php endif; ?>
69
  <?php endif; ?>
70
  </div>
includes/admin/templates/disabled-component.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
- $content = empty( $content ) ? '' : $content;
3
- $image = empty( $image ) ? '' : $image;
4
- $component = empty( $component ) ? '' : $component;
5
  $button_text = empty( $button_text ) ? '' : $button_text;
6
  ?>
7
  <form method='post'>
@@ -11,12 +11,15 @@ $button_text = empty( $button_text ) ? '' : $button_text;
11
  </div>
12
  <div class="sui-box-body">
13
  <?php
14
- $this->_render( 'disabled-component-inner', array(
15
- 'content' => $content,
16
- 'image' => $image,
17
- 'component' => $component,
18
- 'button_text' => $button_text,
19
- ) );
 
 
 
20
  ?>
21
  </div>
22
  </div>
1
  <?php
2
+ $content = empty( $content ) ? '' : $content;
3
+ $image = empty( $image ) ? '' : $image;
4
+ $component = empty( $component ) ? '' : $component;
5
  $button_text = empty( $button_text ) ? '' : $button_text;
6
  ?>
7
  <form method='post'>
11
  </div>
12
  <div class="sui-box-body">
13
  <?php
14
+ $this->render_view(
15
+ 'disabled-component-inner',
16
+ array(
17
+ 'content' => $content,
18
+ 'image' => $image,
19
+ 'component' => $component,
20
+ 'button_text' => $button_text,
21
+ )
22
+ );
23
  ?>
24
  </div>
25
  </div>
includes/admin/templates/dismissable-notice.php CHANGED
@@ -1,26 +1,30 @@
1
  <?php
2
  $message = empty( $message ) ? '' : $message;
3
- $class = empty( $class ) ? 'sui-notice-warning' : $class;
4
- $key = empty( $key ) ? '' : $key;
5
 
6
  if ( ! $message ) {
7
  return;
8
  }
9
 
10
- $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
11
  $is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $key ) === true;
12
  ?>
13
  <?php if ( ! $is_message_dismissed ) : ?>
14
- <div class="wds-notice sui-notice <?php echo esc_attr( $class ); ?> <?php echo esc_attr( $key ); ?>"
15
- data-key="<?php echo esc_attr( $key ); ?>">
 
 
16
  <div class="sui-notice-content">
17
  <div class="sui-notice-message">
18
  <span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
19
  <p>
20
  <?php echo wp_kses_post( $message ); ?>
21
  <span class="wds-notice-wrap">
22
- <a href="#" class="wds-notice-dismiss"
23
- aria-label="<?php esc_html_e( 'Dismiss notice', 'wds' ); ?>">
 
 
24
  <?php esc_html_e( 'Dismiss', 'wds' ); ?>
25
  </a>
26
  </span>
1
  <?php
2
  $message = empty( $message ) ? '' : $message;
3
+ $class = empty( $class ) ? 'sui-notice-warning' : $class;
4
+ $key = empty( $key ) ? '' : $key;
5
 
6
  if ( ! $message ) {
7
  return;
8
  }
9
 
10
+ $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
11
  $is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $key ) === true;
12
  ?>
13
  <?php if ( ! $is_message_dismissed ) : ?>
14
+ <div
15
+ class="wds-notice sui-notice <?php echo esc_attr( $class ); ?> <?php echo esc_attr( $key ); ?>"
16
+ data-key="<?php echo esc_attr( $key ); ?>"
17
+ >
18
  <div class="sui-notice-content">
19
  <div class="sui-notice-message">
20
  <span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
21
  <p>
22
  <?php echo wp_kses_post( $message ); ?>
23
  <span class="wds-notice-wrap">
24
+ <a
25
+ href="#" class="wds-notice-dismiss"
26
+ aria-label="<?php esc_html_e( 'Dismiss notice', 'wds' ); ?>"
27
+ >
28
  <?php esc_html_e( 'Dismiss', 'wds' ); ?>
29
  </a>
30
  </span>
includes/admin/templates/emails/email-body.php CHANGED
@@ -2,35 +2,37 @@
2
  if ( ! defined( 'WPINC' ) ) {
3
  die;
4
  }
5
- $email_template = empty( $email_template ) ? '' : $email_template;
6
  $email_template_args = empty( $email_template_args ) ? array() : $email_template_args;
7
  ?>
8
 
9
  <body style="-moz-box-sizing: border-box; -ms-text-size-adjust: 100%; -webkit-box-sizing: border-box; -webkit-text-size-adjust: 100%; background-color: #F6F6F6; box-sizing: border-box; color: #1A1A1A; color: #1A1A1A'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; line-height: 26px; margin: 0; min-width: 100%; padding: 0; text-align: left; width: 100% !important;">
10
- <table class="body"
11
- style="background-color: #F6F6F6; border-collapse: collapse; border-spacing: 0; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; height: 100%; line-height: 26px; margin: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
 
 
12
  <tbody>
13
  <tr style="padding: 0; text-align: left; vertical-align: top;">
14
- <td class="center" align="center" valign="top"
15
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
16
-
 
17
  <center style="min-width: 600px; width: 100%;">
18
-
19
- <table class="container"
20
- style="background-color: #fff; border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: inherit; vertical-align: top; width: 600px;">
 
21
  <tbody>
22
  <tr style="padding: 0; text-align: left; vertical-align: top;">
23
  <td style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
24
- <?php $this->_render( 'emails/email-header' ); ?>
25
- <?php $this->_render( $email_template, $email_template_args ); ?>
26
- <?php $this->_render( 'emails/email-footer' ); ?>
27
  </td>
28
  </tr>
29
  </tbody>
30
  </table>
31
-
32
  </center>
33
-
34
  </td>
35
  </tr>
36
  </tbody>
2
  if ( ! defined( 'WPINC' ) ) {
3
  die;
4
  }
5
+ $email_template = empty( $email_template ) ? '' : $email_template;
6
  $email_template_args = empty( $email_template_args ) ? array() : $email_template_args;
7
  ?>
8
 
9
  <body style="-moz-box-sizing: border-box; -ms-text-size-adjust: 100%; -webkit-box-sizing: border-box; -webkit-text-size-adjust: 100%; background-color: #F6F6F6; box-sizing: border-box; color: #1A1A1A; color: #1A1A1A'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; line-height: 26px; margin: 0; min-width: 100%; padding: 0; text-align: left; width: 100% !important;">
10
+ <table
11
+ class="body"
12
+ style="background-color: #F6F6F6; border-collapse: collapse; border-spacing: 0; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; height: 100%; line-height: 26px; margin: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"
13
+ >
14
  <tbody>
15
  <tr style="padding: 0; text-align: left; vertical-align: top;">
16
+ <td
17
+ class="center" align="center" valign="top"
18
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;"
19
+ >
20
  <center style="min-width: 600px; width: 100%;">
21
+ <table
22
+ class="container"
23
+ style="background-color: #fff; border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: inherit; vertical-align: top; width: 600px;"
24
+ >
25
  <tbody>
26
  <tr style="padding: 0; text-align: left; vertical-align: top;">
27
  <td style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
28
+ <?php $this->render_view( 'emails/email-header' ); ?>
29
+ <?php $this->render_view( $email_template, $email_template_args ); ?>
30
+ <?php $this->render_view( 'emails/email-footer' ); ?>
31
  </td>
32
  </tr>
33
  </tbody>
34
  </table>
 
35
  </center>
 
36
  </td>
37
  </tr>
38
  </tbody>
includes/admin/templates/emails/email-footer.php CHANGED
@@ -9,43 +9,52 @@ if ( ! defined( 'ABSPATH' ) ) {
9
  exit;
10
  }
11
 
12
- $logo_url = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'graphic-email-footer.png' );
13
- $icon_fb = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-facebook.png' );
14
- $icon_tw = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-twitter.png' );
15
- $icon_ig = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-instagram.png' );
16
  $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
17
  ?>
18
 
19
- <table class="wrapper logo-bottom" align="center"
20
- style="background-color: #F6F6F6; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
 
 
21
  <tbody>
22
- <?php if ( $hide_branding ): ?>
23
  <tr>
24
  <td style="padding: 30px;"></td>
25
  </tr>
26
- <?php else: ?>
27
  <tr style="padding: 0; text-align: left; vertical-align: top;">
28
- <td class="wrapper-inner logo-bottom-inner" align="center"
29
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 1em; margin: 0; padding: 29px 0; text-align: center; vertical-align: top; word-wrap: break-word;background: #E7F1FB;border-radius: 0 0 15px 15px;">
30
- <a href="https://premium.wpmudev.org" target="_blank" class="logo-link"
31
- style="color: #1A1A1A; display: inline-block; font-family: 'Roboto', Arial, sans-serif; font-weight: normal; line-height: 1.3; margin: 0; padding: 0; text-align: left; text-decoration: none;">
32
- <img src="<?php echo esc_url( $logo_url ); ?>"
33
- alt="<?php esc_attr_e( 'WPMU DEV', 'wphb' ); ?>"
34
- style="-ms-interpolation-mode: bicubic; border: none; clear: both; display: block; max-width: 100%; outline: none; text-decoration: none; width: 168px; height: auto;" width="168" height="auto"/>
 
 
 
35
  </a>
36
  </td>
37
  </tr>
38
  <tr style="padding: 0; text-align: left; vertical-align: top;">
39
- <td class="wrapper-inner footer-inner"
40
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 25px 20px 15px; text-align: center; vertical-align: top; word-wrap: break-word;">
 
41
 
42
- <table class="footer-content" align="center"
43
- style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
 
44
  <tbody>
45
  <tr style="padding: 0; text-align: left; vertical-align: top;">
46
- <td class="footer-content-inner"
47
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; hyphens: auto; font-size: 0; line-height: 0; margin: 0; padding: 0; text-align: center; vertical-align: top; word-wrap: break-word;" align="center">
48
- <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation"
 
 
49
  style="float:none;display:inline-table;">
50
  <tbody>
51
  <tr>
@@ -56,18 +65,21 @@ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
56
  </tr>
57
  </tbody>
58
  </table>
59
- <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation"
 
60
  style="float:none;display:inline-table;">
61
  <tbody>
62
  <tr>
63
  <td style="padding:1px;vertical-align:middle;">
64
- <table border="0" cellpadding="0" cellspacing="0" role="presentation"
 
65
  style="background:transparent;border-radius:3px;width:25px;">
66
  <tbody>
67
  <tr>
68
  <td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
69
  <a href="https://www.facebook.com/wpmudev" target="_blank">
70
- <img height="25" src="<?php echo esc_url( $icon_fb ); ?>"
 
71
  style="border-radius:3px;display:block;" width="25">
72
  </a>
73
  </td>
@@ -78,18 +90,25 @@ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
78
  </tr>
79
  </tbody>
80
  </table>
81
- <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation"
 
 
 
 
 
82
  style="float:none;display:inline-table;">
83
  <tbody>
84
  <tr>
85
  <td style="padding:1px;vertical-align:middle;">
86
- <table border="0" cellpadding="0" cellspacing="0" role="presentation"
 
87
  style="background:transparent;border-radius:3px;width:25px;">
88
  <tbody>
89
  <tr>
90
  <td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
91
  <a href="https://www.instagram.com/wpmu_dev/" target="_blank">
92
- <img height="25" src="<?php echo esc_url( $icon_ig ); ?>"
 
93
  style="border-radius:3px;display:block;" width="25">
94
  </a>
95
  </td>
@@ -100,18 +119,21 @@ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
100
  </tr>
101
  </tbody>
102
  </table>
103
- <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation"
 
104
  style="float:none;display:inline-table;">
105
  <tbody>
106
  <tr>
107
  <td style="padding:1px;vertical-align:middle;">
108
- <table border="0" cellpadding="0" cellspacing="0" role="presentation"
 
109
  style="background:transparent;border-radius:3px;width:25px;">
110
  <tbody>
111
  <tr>
112
  <td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
113
  <a href="https://twitter.com/wpmudev" target="_blank">
114
- <img height="25" src="<?php echo esc_url( $icon_tw ); ?>"
 
115
  style="border-radius:3px;display:block;" width="25">
116
  </a>
117
  </td>
@@ -130,15 +152,18 @@ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
130
  </td>
131
  </tr>
132
  <tr style="padding: 0; text-align: left; vertical-align: top;">
133
- <td class="wrapper-inner address-inner"
134
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 0 20px 40px; text-align: center; vertical-align: top; word-wrap: break-word;">
 
135
 
136
- <table class="address-content" align="center"
137
- style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
 
138
  <tbody>
139
  <tr style="padding: 0; text-align: left; vertical-align: top;">
140
- <td class="address-content-inner"
141
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #AAAAAA; font-family: 'Roboto', Arial, sans-serif; font-size: 10px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
 
142
  <p style="color: #505050; font-family: 'Roboto', Arial, sans-serif; font-size: 10px; font-weight: normal; letter-spacing: -0.25px; line-height: 30px; margin: 0; padding: 0; text-align: center; text-transform: uppercase;"><?php esc_html_e( 'Incsub, PO Box 163 Albert Park, Victoria, 3206, Australia.', 'wphb' ); ?></p>
143
  </td>
144
  </tr>
9
  exit;
10
  }
11
 
12
+ $logo_url = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'graphic-email-footer.png' );
13
+ $icon_fb = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-facebook.png' );
14
+ $icon_tw = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-twitter.png' );
15
+ $icon_ig = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-instagram.png' );
16
  $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
17
  ?>
18
 
19
+ <table
20
+ class="wrapper logo-bottom" align="center"
21
+ style="background-color: #F6F6F6; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"
22
+ >
23
  <tbody>
24
+ <?php if ( $hide_branding ) : ?>
25
  <tr>
26
  <td style="padding: 30px;"></td>
27
  </tr>
28
+ <?php else : ?>
29
  <tr style="padding: 0; text-align: left; vertical-align: top;">
30
+ <td
31
+ class="wrapper-inner logo-bottom-inner" align="center"
32
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 1em; margin: 0; padding: 29px 0; text-align: center; vertical-align: top; word-wrap: break-word;background: #E7F1FB;border-radius: 0 0 15px 15px;">
33
+ <a
34
+ href="https://premium.wpmudev.org" target="_blank" class="logo-link"
35
+ style="color: #1A1A1A; display: inline-block; font-family: 'Roboto', Arial, sans-serif; font-weight: normal; line-height: 1.3; margin: 0; padding: 0; text-align: left; text-decoration: none;">
36
+ <img
37
+ src="<?php echo esc_url( $logo_url ); ?>"
38
+ alt="<?php esc_attr_e( 'WPMU DEV', 'wphb' ); ?>"
39
+ style="-ms-interpolation-mode: bicubic; border: none; clear: both; display: block; max-width: 100%; outline: none; text-decoration: none; width: 168px; height: auto;" width="168" height="auto"/>
40
  </a>
41
  </td>
42
  </tr>
43
  <tr style="padding: 0; text-align: left; vertical-align: top;">
44
+ <td
45
+ class="wrapper-inner footer-inner"
46
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 25px 20px 15px; text-align: center; vertical-align: top; word-wrap: break-word;">
47
 
48
+ <table
49
+ class="footer-content" align="center"
50
+ style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
51
  <tbody>
52
  <tr style="padding: 0; text-align: left; vertical-align: top;">
53
+ <td
54
+ class="footer-content-inner"
55
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; hyphens: auto; font-size: 0; line-height: 0; margin: 0; padding: 0; text-align: center; vertical-align: top; word-wrap: break-word;" align="center">
56
+ <table
57
+ align="center" border="0" cellpadding="0" cellspacing="0" role="presentation"
58
  style="float:none;display:inline-table;">
59
  <tbody>
60
  <tr>
65
  </tr>
66
  </tbody>
67
  </table>
68
+ <table
69
+ align="center" border="0" cellpadding="0" cellspacing="0" role="presentation"
70
  style="float:none;display:inline-table;">
71
  <tbody>
72
  <tr>
73
  <td style="padding:1px;vertical-align:middle;">
74
+ <table
75
+ border="0" cellpadding="0" cellspacing="0" role="presentation"
76
  style="background:transparent;border-radius:3px;width:25px;">
77
  <tbody>
78
  <tr>
79
  <td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
80
  <a href="https://www.facebook.com/wpmudev" target="_blank">
81
+ <img
82
+ height="25" src="<?php echo esc_url( $icon_fb ); ?>"
83
  style="border-radius:3px;display:block;" width="25">
84
  </a>
85
  </td>
90
  </tr>
91
  </tbody>
92
  </table>
93
+ <table
94
+ align="center"
95
+ border="0"
96
+ cellpadding="0"
97
+ cellspacing="0"
98
+ role="presentation"
99
  style="float:none;display:inline-table;">
100
  <tbody>
101
  <tr>
102
  <td style="padding:1px;vertical-align:middle;">
103
+ <table
104
+ border="0" cellpadding="0" cellspacing="0" role="presentation"
105
  style="background:transparent;border-radius:3px;width:25px;">
106
  <tbody>
107
  <tr>
108
  <td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
109
  <a href="https://www.instagram.com/wpmu_dev/" target="_blank">
110
+ <img
111
+ height="25" src="<?php echo esc_url( $icon_ig ); ?>"
112
  style="border-radius:3px;display:block;" width="25">
113
  </a>
114
  </td>
119
  </tr>
120
  </tbody>
121
  </table>
122
+ <table
123
+ align="center" border="0" cellpadding="0" cellspacing="0" role="presentation"
124
  style="float:none;display:inline-table;">
125
  <tbody>
126
  <tr>
127
  <td style="padding:1px;vertical-align:middle;">
128
+ <table
129
+ border="0" cellpadding="0" cellspacing="0" role="presentation"
130
  style="background:transparent;border-radius:3px;width:25px;">
131
  <tbody>
132
  <tr>
133
  <td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
134
  <a href="https://twitter.com/wpmudev" target="_blank">
135
+ <img
136
+ height="25" src="<?php echo esc_url( $icon_tw ); ?>"
137
  style="border-radius:3px;display:block;" width="25">
138
  </a>
139
  </td>
152
  </td>
153
  </tr>
154
  <tr style="padding: 0; text-align: left; vertical-align: top;">
155
+ <td
156
+ class="wrapper-inner address-inner"
157
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 0 20px 40px; text-align: center; vertical-align: top; word-wrap: break-word;">
158
 
159
+ <table
160
+ class="address-content" align="center"
161
+ style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
162
  <tbody>
163
  <tr style="padding: 0; text-align: left; vertical-align: top;">
164
+ <td
165
+ class="address-content-inner"
166
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #AAAAAA; font-family: 'Roboto', Arial, sans-serif; font-size: 10px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
167
  <p style="color: #505050; font-family: 'Roboto', Arial, sans-serif; font-size: 10px; font-weight: normal; letter-spacing: -0.25px; line-height: 30px; margin: 0; padding: 0; text-align: center; text-transform: uppercase;"><?php esc_html_e( 'Incsub, PO Box 163 Albert Park, Victoria, 3206, Australia.', 'wphb' ); ?></p>
168
  </td>
169
  </tr>
includes/admin/templates/emails/email-header.php CHANGED
@@ -4,30 +4,40 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
6
 
7
- $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
8
- $header_image_url = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'graphic-seo-report.png' );
9
  $header_image_url_2x = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'graphic-seo-report@2x.png' );
10
- $alt_text = esc_html__( 'Smartcrawl Report', 'wphb' );
11
  ?>
12
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&amp;display=swap" rel="stylesheet" type="text/css">
13
- <table class="wrapper hero" align="left"
14
- style="background-color: #F6F6F6; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
 
 
15
  <tbody>
16
  <tr style="padding: 0; text-align: left; vertical-align: top;">
17
- <td class="wrapper-inner hero-inner"
18
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 20px 0 0; text-align: left; vertical-align: top; word-wrap: break-word;">
19
-
20
- <table class="hero-content" align="left"
21
- style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
 
 
 
22
  <tbody>
23
  <tr style="padding: 0; text-align: center; vertical-align: bottom;">
24
- <?php if ( ! $hide_branding ): ?>
25
- <td class="hero-image"
26
- style="background-color: #de240a; border-radius: 15px 15px 0 0; height: 100px; border-collapse: collapse !important; margin: 0; padding: 0; text-align: center; vertical-align: middle;">
27
- <img src="<?php echo esc_url( $header_image_url_2x ); ?>"
28
- srcset="<?php echo esc_url( $header_image_url ); ?>, <?php echo esc_url( $header_image_url_2x ); ?> 2x"
29
- alt="<?php echo esc_attr( $alt_text ); ?>"
30
- style="-ms-interpolation-mode: bicubic; border: none; vertical-align:bottom; clear: both; display: inline-block; outline: none; text-decoration: none; width: 141px; height: auto" width="141">
 
 
 
 
 
31
  </td>
32
  <?php endif; ?>
33
  </tr>
4
  exit;
5
  }
6
 
7
+ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
8
+ $header_image_url = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'graphic-seo-report.png' );
9
  $header_image_url_2x = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'graphic-seo-report@2x.png' );
10
+ $alt_text = esc_html__( 'Smartcrawl Report', 'wphb' );
11
  ?>
12
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&amp;display=swap" rel="stylesheet" type="text/css">
13
+ <table
14
+ class="wrapper hero" align="left"
15
+ style="background-color: #F6F6F6; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"
16
+ >
17
  <tbody>
18
  <tr style="padding: 0; text-align: left; vertical-align: top;">
19
+ <td
20
+ class="wrapper-inner hero-inner"
21
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 20px 0 0; text-align: left; vertical-align: top; word-wrap: break-word;"
22
+ >
23
+ <table
24
+ class="hero-content" align="left"
25
+ style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"
26
+ >
27
  <tbody>
28
  <tr style="padding: 0; text-align: center; vertical-align: bottom;">
29
+ <?php if ( ! $hide_branding ) : ?>
30
+ <td
31
+ class="hero-image"
32
+ style="background-color: #de240a; border-radius: 15px 15px 0 0; height: 100px; border-collapse: collapse !important; margin: 0; padding: 0; text-align: center; vertical-align: middle;"
33
+ >
34
+ <img
35
+ src="<?php echo esc_url( $header_image_url_2x ); ?>"
36
+ srcset="<?php echo esc_url( $header_image_url ); ?>, <?php echo esc_url( $header_image_url_2x ); ?> 2x"
37
+ alt="<?php echo esc_attr( $alt_text ); ?>"
38
+ style="-ms-interpolation-mode: bicubic; border: none; vertical-align:bottom; clear: both; display: inline-block; outline: none; text-decoration: none; width: 141px; height: auto"
39
+ width="141"
40
+ >
41
  </td>
42
  <?php endif; ?>
43
  </tr>
includes/admin/templates/emails/lighthouse-email.php CHANGED
@@ -4,48 +4,56 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  }
5
 
6
  /**
 
 
7
  * @var $desktop_report Smartcrawl_Lighthouse_Report
8
- * @var $mobile_report Smartcrawl_Lighthouse_Report
9
  */
10
  $desktop_report = empty( $desktop_report ) ? false : $desktop_report;
11
- $mobile_report = empty( $mobile_report ) ? false : $mobile_report;
12
  if ( ! $desktop_report || ! $mobile_report ) {
13
  return;
14
  }
15
  $username = empty( $username ) ? '' : $username;
16
- $device = empty( $device ) ? '' : $device;
17
 
18
- $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
19
- $lighthouse_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH ) . '&tab=tab_lighthouse';
20
- $reporting_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH ) . '&tab=tab_reporting';
21
- $time_string = $desktop_report->get_last_checked();
22
  $desktop_icon_2x = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-desktop@2x.png' );
23
- $desktop_icon = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-desktop.png' );
24
- $mobile_icon_2x = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-mobile@2x.png' );
25
- $mobile_icon = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-mobile.png' );
26
- $icon_success = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-success.png' );
27
- $icon_warning = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-warning.png' );
28
- $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error.png' );
29
  ?>
30
 
31
- <table class="wrapper main" align="center"
32
- style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
 
 
33
  <tbody>
34
  <tr style="padding: 0; text-align: left; vertical-align: top;">
35
- <td class="wrapper-inner main-inner"
36
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 40px 60px; text-align: left; vertical-align: top; word-wrap: break-word;">
 
37
 
38
- <table class="main-content"
39
- style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
 
 
40
  <tbody>
41
  <tr style="padding: 0; text-align: left; vertical-align: top;">
42
- <td class="main-content-text"
43
- style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1a1a1a; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
 
44
  <p style="color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 25px;font-weight: 700;line-height: 34px;margin: 0 0 5px;padding: 0;text-align: left;">
45
  <?php
46
  printf( /* translators: %s - tested on */
47
- __( 'SEO test summary for <br/>%s', 'wds' ),
48
- '<a class="brand" href="' . esc_attr( $lighthouse_url ) . '" target="_blank" style="color: #286EFA;font-family: \'Roboto\', Arial, sans-serif;font-weight: inherit;line-height: 30px;margin: 0;padding: 0;text-align: left;text-decoration: none">' . esc_html( site_url() ) . '</a>'
49
  );
50
  ?>
51
  </p>
@@ -56,7 +64,7 @@ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error
56
  <?php
57
  printf( /* translators: %s - tested on */
58
  __( 'Here’s your latest SEO test summary generated on %s.', 'wds' ),
59
- $time_string
60
  );
61
  ?>
62
  </p>
@@ -69,25 +77,28 @@ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error
69
  <?php esc_html_e( 'Here are your latest SEO test results.', 'wds' ); ?>
70
  </p>
71
 
72
- <table class="reports-list" align="center"
73
- style="border-collapse: collapse;border-spacing: 0;margin: 0 0 30px;padding: 0;text-align: left;vertical-align: top;width: 100%">
 
74
  <thead>
75
  <tr style="background-color: #F2F2F2">
76
  <?php if ( 'both' === $device || 'desktop' === $device ) : ?>
77
  <td style="border-radius: 4px 0 0 0;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: center">
78
- <img alt=""
79
- src="<?php echo esc_url( $desktop_icon_2x ); ?>"
80
- srcset="<?php echo esc_url( $desktop_icon ); ?>, <?php echo esc_url( $desktop_icon_2x ); ?> 2x"
81
- style="height: 16px;vertical-align: middle;">
 
82
  <span style="margin-left: 5px"><?php esc_html_e( 'Desktop', 'wds' ); ?></span>
83
  </td>
84
  <?php endif; ?>
85
  <?php if ( 'both' === $device || 'mobile' === $device ) : ?>
86
  <td style="border-radius: 0 4px 0 0;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: center">
87
- <img alt=""
88
- src="<?php echo esc_url( $mobile_icon_2x ); ?>"
89
- srcset="<?php echo esc_url( $mobile_icon ); ?>, <?php echo esc_url( $mobile_icon_2x ); ?> 2x"
90
- style="height: 16px;vertical-align: middle;">
 
91
  <span style="margin-left: 5px"><?php esc_html_e( 'Mobile', 'wds' ); ?></span>
92
  </td>
93
  <?php endif; ?>
@@ -96,26 +107,31 @@ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error
96
  <tbody>
97
  <tr class="report-list-item" style="height: 95px;">
98
  <?php if ( 'both' === $device || 'desktop' === $device ) : ?>
99
- <td class="report-list-item-result" align="center"
100
- style="border: 1px solid #F2F2F2;color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;">
 
101
  <table>
102
  <tr>
103
- <td rowspan="2"
104
- style="font-size: 50px;font-weight: 600"><?php echo absint( $desktop_report->get_score() ); ?></td>
 
105
  <td style="text-align: left">
106
  <?php if ( 'a' === $desktop_report->get_score_grade() ) : ?>
107
- <img src="<?php echo esc_url( $icon_success ); ?>"
108
- alt="<?php esc_attr_e( 'Ok', 'wds' ); ?>"
109
- style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"/>
 
110
  <?php elseif ( 'c' === $desktop_report->get_score_grade() ) : ?>
111
- <img src="<?php echo esc_url( $icon_warning ); ?>"
112
- alt="<?php esc_attr_e( 'Warning', 'wds' ); ?>"
113
- style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"/>
 
114
  <?php elseif ( 'f' === $desktop_report->get_score_grade() ) : ?>
115
- <img src="<?php
116
- echo esc_url( $icon_error ); ?>"
117
- alt="<?php esc_attr_e( 'Critical', 'wds' ); ?>"
118
- style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"/>
 
119
  <?php endif; ?>
120
  </td>
121
  </tr>
@@ -129,26 +145,33 @@ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error
129
  <?php endif; ?>
130
 
131
  <?php if ( 'both' === $device || 'mobile' === $device ) : ?>
132
- <td class="report-list-item-result" align="center"
133
- style="border: 1px solid #F2F2F2;color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;">
 
134
  <table>
135
  <tr>
136
- <td rowspan="2"
137
- style="font-size: 50px;font-weight: 600"><?php echo absint( $mobile_report->get_score() ); ?></td>
 
138
  <td style="text-align: left">
139
  <?php if ( 'a' === $mobile_report->get_score_grade() ) : ?>
140
- <img src="<?php echo esc_url( $icon_success ); ?>"
141
- alt="<?php esc_attr_e( 'Ok', 'wds' ); ?>"
142
- style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"/>
 
 
143
  <?php elseif ( 'c' === $mobile_report->get_score_grade() ) : ?>
144
- <img src="<?php echo esc_url( $icon_warning ); ?>"
145
- alt="<?php esc_attr_e( 'Warning', 'wds' ); ?>"
146
- style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"/>
 
 
147
  <?php elseif ( 'f' === $mobile_report->get_score_grade() ) : ?>
148
- <img src="<?php
149
- echo esc_url( $icon_error ); ?>"
150
- alt="<?php esc_attr_e( 'Critical', 'wds' ); ?>"
151
- style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"/>
 
152
  <?php endif; ?>
153
  </td>
154
  </tr>
@@ -172,12 +195,17 @@ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error
172
  <?php esc_html_e( 'These SEO audits ensure that your page is optimized for search engine results ranking. We recommend actioning as many as possible.', 'wds' ); ?>
173
  </p>
174
 
175
- <?php foreach ( $desktop_report->get_groups() as $group_id => $group ): ?>
176
- <?php if ( Smartcrawl_Lighthouse_Report::GROUP_MANUAL === $group_id ) {
 
177
  continue;
178
- } ?>
179
- <table class="reports-list" align="center"
180
- style="border-collapse: collapse;border-spacing: 0;margin: 0 0 30px;padding: 0;text-align: left;vertical-align: top;width: 100%">
 
 
 
 
181
  <thead>
182
  <tr style="background-color: #F2F2F2">
183
  <td style="padding-left: 20px;border-radius: 4px 0 0 0;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: left">
@@ -186,20 +214,24 @@ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error
186
 
187
  <?php if ( 'both' === $device || 'desktop' === $device ) : ?>
188
  <td style="padding: 0 10px;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: center; width:75px;">
189
- <img alt=""
190
- src="<?php echo esc_url( $desktop_icon_2x ); ?>"
191
- srcset="<?php echo esc_url( $desktop_icon ); ?>, <?php echo esc_url( $desktop_icon_2x ); ?> 2x"
192
- style="height: 16px;vertical-align: middle;">
 
 
193
  <span style="margin-left: 5px; vertical-align: top;"><?php esc_html_e( 'Desktop', 'wds' ); ?></span>
194
  </td>
195
  <?php endif; ?>
196
 
197
  <?php if ( 'both' === $device || 'mobile' === $device ) : ?>
198
  <td style="padding: 0 10px;border-radius: 0 4px 0 0;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: center; width: 70px">
199
- <img alt=""
200
- src="<?php echo esc_url( $mobile_icon_2x ); ?>"
201
- srcset="<?php echo esc_url( $mobile_icon ); ?>, <?php echo esc_url( $mobile_icon_2x ); ?> 2x"
202
- style="height: 16px;vertical-align: middle;">
 
 
203
  <span style="margin-left: 5px; vertical-align: top;"><?php esc_html_e( 'Mobile', 'wds' ); ?></span>
204
  </td>
205
  <?php endif; ?>
@@ -207,36 +239,46 @@ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error
207
  </thead>
208
 
209
  <tbody>
210
- <?php foreach ( $group->get_checks() as $check_id => $check ): ?>
211
- <tr class="report-list-item"
212
- style="border: 1px solid #F2F2F2;padding: 0;text-align: left;vertical-align: top">
213
-
214
- <td class="report-list-item-info"
215
- style="border-collapse: collapse !important;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 500;letter-spacing: -0.23px;line-height: 22px;margin: 0;padding: 18px 0 18px 20px;text-align: left;vertical-align: top">
 
 
 
216
  <span style="color: inherit; display: inline; font-size: inherit; font-family: inherit; line-height: inherit; vertical-align: middle; letter-spacing: -0.25px;">
217
  <?php echo esc_html( $check->get_title() ); ?>
218
  </span>
219
  </td>
220
  <?php if ( 'both' === $device || 'desktop' === $device ) : ?>
221
- <td class="report-list-item-info"
222
- style="border-collapse: collapse !important;color: #666666;font-family: 'Roboto', Arial, sans-serif;font-size: 13px;font-weight: 500;letter-spacing: -0.25px;line-height: 21px;margin: 0;padding: 18px 0;text-align: center;vertical-align: top">
223
- <?php if ( $check->get_weight() ): ?>
224
- <img src="<?php echo esc_url( $check->is_passed() ? $icon_success : $icon_warning ); ?>"
225
- style="-ms-interpolation-mode: bicubic; border: none; clear: both; display: inline-block; height: 16px; outline: none; text-decoration: none; width: auto; vertical-align: middle;">
226
- <?php else: ?>
 
 
 
 
227
  <span>-</span>
228
  <?php endif; ?>
229
  </td>
230
  <?php endif; ?>
231
 
232
  <?php if ( 'both' === $device || 'mobile' === $device ) : ?>
233
- <td class="report-list-item-result"
234
- style="border-collapse: collapse !important;color: #666666;font-family: 'Roboto', Arial, sans-serif;font-size: 13px;font-weight: 500;letter-spacing: -0.25px;line-height: 21px;margin: 0;min-width: 65px;padding: 18px 0;text-align: center;vertical-align: top">
235
-
236
- <?php if ( $mobile_report->get_group( $group_id )->get_check( $check_id )->get_weight() ): ?>
237
- <img src="<?php echo esc_url( $mobile_report->get_group( $group_id )->get_check( $check_id )->is_passed() ? $icon_success : $icon_warning ); ?>"
238
- style="-ms-interpolation-mode: bicubic; border: none; clear: both; display: inline-block; height: 16px; outline: none; text-decoration: none; width: auto; vertical-align: middle;">
239
- <?php else: ?>
 
 
 
240
  <span>-</span>
241
  <?php endif; ?>
242
  </td>
@@ -248,21 +290,25 @@ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error
248
  <?php endforeach; ?>
249
 
250
  <p style="color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;font-size: 16px;font-weight: normal;line-height: 20px;margin: 0 0 20px;padding: 0;text-align: center">
251
- <a href="<?php echo esc_url( $lighthouse_url ); ?>" class="brand-button"
252
- style="background: #286EFA;color: #ffffff;font-family: 'Roboto', Arial, sans-serif;font-size: 13px;font-weight: 500;line-height: 20px;margin: 0;padding: 8px 15px;text-align: center;text-decoration: none;display: inline-block;border-radius: 6px;text-transform: capitalize;">
 
 
253
  <?php esc_html_e( 'View full report', 'wds' ); ?>
254
  </a>
255
  </p>
256
 
257
  <p style="margin: 0 0 30px;padding: 0;text-align: center">
258
- <a style="color: #286EFA;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 500;letter-spacing: -0.25px;line-height: 16px;text-decoration: none"
259
- href="<?php echo esc_url( $reporting_url ); ?>"
260
- class="brand-link" target="_blank">
 
 
261
  <?php esc_html_e( 'Customize email report', 'wds' ); ?>
262
  </a>
263
  </p>
264
 
265
- <?php if ( ! $hide_branding ): ?>
266
  <p style="color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;font-size: 15px;font-weight: normal;line-height: 20px;margin: 0 0 20px;padding: 0;text-align: left;clear: both"><?php esc_html_e( 'Stay optimized.', 'wds' ); ?></p>
267
  <strong><?php esc_html_e( 'Smartcrawl', 'wds' ); ?></strong>
268
  <p style="color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;font-size: 15px;font-weight: normal;line-height: 15px;margin: 10px 0 15px;padding: 0;text-align: left"><?php esc_html_e( 'WPMU DEV SEO Hero', 'wds' ); ?></p>
4
  }
5
 
6
  /**
7
+ * Available vars.
8
+ *
9
  * @var $desktop_report Smartcrawl_Lighthouse_Report
10
+ * @var $mobile_report Smartcrawl_Lighthouse_Report
11
  */
12
  $desktop_report = empty( $desktop_report ) ? false : $desktop_report;
13
+ $mobile_report = empty( $mobile_report ) ? false : $mobile_report;
14
  if ( ! $desktop_report || ! $mobile_report ) {
15
  return;
16
  }
17
  $username = empty( $username ) ? '' : $username;
18
+ $device = empty( $device ) ? '' : $device;
19
 
20
+ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
21
+ $lighthouse_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH ) . '&tab=tab_lighthouse';
22
+ $reporting_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH ) . '&tab=tab_reporting';
23
+ $time_string = $desktop_report->get_last_checked();
24
  $desktop_icon_2x = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-desktop@2x.png' );
25
+ $desktop_icon = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-desktop.png' );
26
+ $mobile_icon_2x = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-mobile@2x.png' );
27
+ $mobile_icon = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-mobile.png' );
28
+ $icon_success = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-success.png' );
29
+ $icon_warning = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-warning.png' );
30
+ $icon_error = sprintf( '%s/assets/images/%s', SMARTCRAWL_PLUGIN_URL, 'icon-error.png' );
31
  ?>
32
 
33
+ <table
34
+ class="wrapper main" align="center"
35
+ style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"
36
+ >
37
  <tbody>
38
  <tr style="padding: 0; text-align: left; vertical-align: top;">
39
+ <td
40
+ class="wrapper-inner main-inner"
41
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1A1A1A; font-family: 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 40px 60px; text-align: left; vertical-align: top; word-wrap: break-word;">
42
 
43
+ <table
44
+ class="main-content"
45
+ style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"
46
+ >
47
  <tbody>
48
  <tr style="padding: 0; text-align: left; vertical-align: top;">
49
+ <td
50
+ class="main-content-text"
51
+ style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse !important; color: #1a1a1a; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 30px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
52
  <p style="color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 25px;font-weight: 700;line-height: 34px;margin: 0 0 5px;padding: 0;text-align: left;">
53
  <?php
54
  printf( /* translators: %s - tested on */
55
+ __( 'SEO test summary for <br/>%s', 'wds' ), // phpcs:ignore
56
+ '<a class="brand" href="' . esc_attr( $lighthouse_url ) . '" target="_blank" style="color: #286EFA;font-family: \'Roboto\', Arial, sans-serif;font-weight: inherit;line-height: 30px;margin: 0;padding: 0;text-align: left;text-decoration: none">' . esc_html( site_url() ) . '</a>'
57
  );
58
  ?>
59
  </p>
64
  <?php
65
  printf( /* translators: %s - tested on */
66
  __( 'Here’s your latest SEO test summary generated on %s.', 'wds' ),
67
+ esc_html( $time_string )
68
  );
69
  ?>
70
  </p>
77
  <?php esc_html_e( 'Here are your latest SEO test results.', 'wds' ); ?>
78
  </p>
79
 
80
+ <table
81
+ class="reports-list" align="center"
82
+ style="border-collapse: collapse;border-spacing: 0;margin: 0 0 30px;padding: 0;text-align: left;vertical-align: top;width: 100%">
83
  <thead>
84
  <tr style="background-color: #F2F2F2">
85
  <?php if ( 'both' === $device || 'desktop' === $device ) : ?>
86
  <td style="border-radius: 4px 0 0 0;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: center">
87
+ <img
88
+ alt=""
89
+ src="<?php echo esc_url( $desktop_icon_2x ); ?>"
90
+ srcset="<?php echo esc_url( $desktop_icon ); ?>, <?php echo esc_url( $desktop_icon_2x ); ?> 2x"
91
+ style="height: 16px;vertical-align: middle;">
92
  <span style="margin-left: 5px"><?php esc_html_e( 'Desktop', 'wds' ); ?></span>
93
  </td>
94
  <?php endif; ?>
95
  <?php if ( 'both' === $device || 'mobile' === $device ) : ?>
96
  <td style="border-radius: 0 4px 0 0;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: center">
97
+ <img
98
+ alt=""
99
+ src="<?php echo esc_url( $mobile_icon_2x ); ?>"
100
+ srcset="<?php echo esc_url( $mobile_icon ); ?>, <?php echo esc_url( $mobile_icon_2x ); ?> 2x"
101
+ style="height: 16px;vertical-align: middle;">
102
  <span style="margin-left: 5px"><?php esc_html_e( 'Mobile', 'wds' ); ?></span>
103
  </td>
104
  <?php endif; ?>
107
  <tbody>
108
  <tr class="report-list-item" style="height: 95px;">
109
  <?php if ( 'both' === $device || 'desktop' === $device ) : ?>
110
+ <td
111
+ class="report-list-item-result" align="center"
112
+ style="border: 1px solid #F2F2F2;color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;">
113
  <table>
114
  <tr>
115
+ <td
116
+ rowspan="2"
117
+ style="font-size: 50px;font-weight: 600"><?php echo absint( $desktop_report->get_score() ); ?></td>
118
  <td style="text-align: left">
119
  <?php if ( 'a' === $desktop_report->get_score_grade() ) : ?>
120
+ <img
121
+ src="<?php echo esc_url( $icon_success ); ?>"
122
+ alt="<?php esc_attr_e( 'Ok', 'wds' ); ?>"
123
+ style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"/>
124
  <?php elseif ( 'c' === $desktop_report->get_score_grade() ) : ?>
125
+ <img
126
+ src="<?php echo esc_url( $icon_warning ); ?>"
127
+ alt="<?php esc_attr_e( 'Warning', 'wds' ); ?>"
128
+ style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"/>
129
  <?php elseif ( 'f' === $desktop_report->get_score_grade() ) : ?>
130
+ <img
131
+ src="<?php echo esc_url( $icon_error ); ?>"
132
+ alt="<?php esc_attr_e( 'Critical', 'wds' ); ?>"
133
+ style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"
134
+ />
135
  <?php endif; ?>
136
  </td>
137
  </tr>
145
  <?php endif; ?>
146
 
147
  <?php if ( 'both' === $device || 'mobile' === $device ) : ?>
148
+ <td
149
+ class="report-list-item-result" align="center"
150
+ style="border: 1px solid #F2F2F2;color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;">
151
  <table>
152
  <tr>
153
+ <td
154
+ rowspan="2"
155
+ style="font-size: 50px;font-weight: 600"><?php echo absint( $mobile_report->get_score() ); ?></td>
156
  <td style="text-align: left">
157
  <?php if ( 'a' === $mobile_report->get_score_grade() ) : ?>
158
+ <img
159
+ src="<?php echo esc_url( $icon_success ); ?>"
160
+ alt="<?php esc_attr_e( 'Ok', 'wds' ); ?>"
161
+ style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"
162
+ />
163
  <?php elseif ( 'c' === $mobile_report->get_score_grade() ) : ?>
164
+ <img
165
+ src="<?php echo esc_url( $icon_warning ); ?>"
166
+ alt="<?php esc_attr_e( 'Warning', 'wds' ); ?>"
167
+ style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"
168
+ />
169
  <?php elseif ( 'f' === $mobile_report->get_score_grade() ) : ?>
170
+ <img
171
+ src="<?php echo esc_url( $icon_error ); ?>"
172
+ alt="<?php esc_attr_e( 'Critical', 'wds' ); ?>"
173
+ style="-ms-interpolation-mode: bicubic; border: none; height: 16px; outline: none; text-decoration: none; width: auto;"
174
+ />
175
  <?php endif; ?>
176
  </td>
177
  </tr>
195
  <?php esc_html_e( 'These SEO audits ensure that your page is optimized for search engine results ranking. We recommend actioning as many as possible.', 'wds' ); ?>
196
  </p>
197
 
198
+ <?php foreach ( $desktop_report->get_groups() as $group_id => $group ) : ?>
199
+ <?php
200
+ if ( Smartcrawl_Lighthouse_Report::GROUP_MANUAL === $group_id ) {
201
  continue;
202
+ }
203
+ ?>
204
+ <table
205
+ class="reports-list"
206
+ align="center"
207
+ style="border-collapse: collapse;border-spacing: 0;margin: 0 0 30px;padding: 0;text-align: left;vertical-align: top;width: 100%"
208
+ >
209
  <thead>
210
  <tr style="background-color: #F2F2F2">
211
  <td style="padding-left: 20px;border-radius: 4px 0 0 0;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: left">
214
 
215
  <?php if ( 'both' === $device || 'desktop' === $device ) : ?>
216
  <td style="padding: 0 10px;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: center; width:75px;">
217
+ <img
218
+ alt=""
219
+ src="<?php echo esc_url( $desktop_icon_2x ); ?>"
220
+ srcset="<?php echo esc_url( $desktop_icon ); ?>, <?php echo esc_url( $desktop_icon_2x ); ?> 2x"
221
+ style="height: 16px;vertical-align: middle;"
222
+ >
223
  <span style="margin-left: 5px; vertical-align: top;"><?php esc_html_e( 'Desktop', 'wds' ); ?></span>
224
  </td>
225
  <?php endif; ?>
226
 
227
  <?php if ( 'both' === $device || 'mobile' === $device ) : ?>
228
  <td style="padding: 0 10px;border-radius: 0 4px 0 0;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 700;line-height: 27px; letter-spacing: -0.23px; text-align: center; width: 70px">
229
+ <img
230
+ alt=""
231
+ src="<?php echo esc_url( $mobile_icon_2x ); ?>"
232
+ srcset="<?php echo esc_url( $mobile_icon ); ?>, <?php echo esc_url( $mobile_icon_2x ); ?> 2x"
233
+ style="height: 16px;vertical-align: middle;"
234
+ >
235
  <span style="margin-left: 5px; vertical-align: top;"><?php esc_html_e( 'Mobile', 'wds' ); ?></span>
236
  </td>
237
  <?php endif; ?>
239
  </thead>
240
 
241
  <tbody>
242
+ <?php foreach ( $group->get_checks() as $check_id => $check ) : ?>
243
+ <tr
244
+ class="report-list-item"
245
+ style="border: 1px solid #F2F2F2;padding: 0;text-align: left;vertical-align: top"
246
+ >
247
+ <td
248
+ class="report-list-item-info"
249
+ style="border-collapse: collapse !important;color: #333333;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 500;letter-spacing: -0.23px;line-height: 22px;margin: 0;padding: 18px 0 18px 20px;text-align: left;vertical-align: top"
250
+ >
251
  <span style="color: inherit; display: inline; font-size: inherit; font-family: inherit; line-height: inherit; vertical-align: middle; letter-spacing: -0.25px;">
252
  <?php echo esc_html( $check->get_title() ); ?>
253
  </span>
254
  </td>
255
  <?php if ( 'both' === $device || 'desktop' === $device ) : ?>
256
+ <td
257
+ class="report-list-item-info"
258
+ style="border-collapse: collapse !important;color: #666666;font-family: 'Roboto', Arial, sans-serif;font-size: 13px;font-weight: 500;letter-spacing: -0.25px;line-height: 21px;margin: 0;padding: 18px 0;text-align: center;vertical-align: top"
259
+ >
260
+ <?php if ( $check->get_weight() ) : ?>
261
+ <img
262
+ src="<?php echo esc_url( $check->is_passed() ? $icon_success : $icon_warning ); ?>"
263
+ style="-ms-interpolation-mode: bicubic; border: none; clear: both; display: inline-block; height: 16px; outline: none; text-decoration: none; width: auto; vertical-align: middle;"
264
+ >
265
+ <?php else : ?>
266
  <span>-</span>
267
  <?php endif; ?>
268
  </td>
269
  <?php endif; ?>
270
 
271
  <?php if ( 'both' === $device || 'mobile' === $device ) : ?>
272
+ <td
273
+ class="report-list-item-result"
274
+ style="border-collapse: collapse !important;color: #666666;font-family: 'Roboto', Arial, sans-serif;font-size: 13px;font-weight: 500;letter-spacing: -0.25px;line-height: 21px;margin: 0;min-width: 65px;padding: 18px 0;text-align: center;vertical-align: top"
275
+ >
276
+ <?php if ( $mobile_report->get_group( $group_id )->get_check( $check_id )->get_weight() ) : ?>
277
+ <img
278
+ src="<?php echo esc_url( $mobile_report->get_group( $group_id )->get_check( $check_id )->is_passed() ? $icon_success : $icon_warning ); ?>"
279
+ style="-ms-interpolation-mode: bicubic; border: none; clear: both; display: inline-block; height: 16px; outline: none; text-decoration: none; width: auto; vertical-align: middle;"
280
+ >
281
+ <?php else : ?>
282
  <span>-</span>
283
  <?php endif; ?>
284
  </td>
290
  <?php endforeach; ?>
291
 
292
  <p style="color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;font-size: 16px;font-weight: normal;line-height: 20px;margin: 0 0 20px;padding: 0;text-align: center">
293
+ <a
294
+ href="<?php echo esc_url( $lighthouse_url ); ?>" class="brand-button"
295
+ style="background: #286EFA;color: #ffffff;font-family: 'Roboto', Arial, sans-serif;font-size: 13px;font-weight: 500;line-height: 20px;margin: 0;padding: 8px 15px;text-align: center;text-decoration: none;display: inline-block;border-radius: 6px;text-transform: capitalize;"
296
+ >
297
  <?php esc_html_e( 'View full report', 'wds' ); ?>
298
  </a>
299
  </p>
300
 
301
  <p style="margin: 0 0 30px;padding: 0;text-align: center">
302
+ <a
303
+ style="color: #286EFA;font-family: 'Roboto', Arial, sans-serif;font-size: 12px;font-weight: 500;letter-spacing: -0.25px;line-height: 16px;text-decoration: none"
304
+ href="<?php echo esc_url( $reporting_url ); ?>"
305
+ class="brand-link" target="_blank"
306
+ >
307
  <?php esc_html_e( 'Customize email report', 'wds' ); ?>
308
  </a>
309
  </p>
310
 
311
+ <?php if ( ! $hide_branding ) : ?>
312
  <p style="color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;font-size: 15px;font-weight: normal;line-height: 20px;margin: 0 0 20px;padding: 0;text-align: left;clear: both"><?php esc_html_e( 'Stay optimized.', 'wds' ); ?></p>
313
  <strong><?php esc_html_e( 'Smartcrawl', 'wds' ); ?></strong>
314
  <p style="color: #1A1A1A;font-family: 'Roboto', Arial, sans-serif;font-size: 15px;font-weight: normal;line-height: 15px;margin: 10px 0 15px;padding: 0;text-align: left"><?php esc_html_e( 'WPMU DEV SEO Hero', 'wds' ); ?></p>
includes/admin/templates/floating-notice.php CHANGED
@@ -1,23 +1,27 @@
1
  <?php
2
- $code = empty( $code ) ? '' : $code;
3
- $message = empty( $message ) ? '' : $message;
4
- $type = empty( $type ) ? 'error' : $type;
5
  $autoclose = empty( $autoclose ) ? false : $autoclose;
6
- $dismiss = ! $autoclose;
7
  ?>
8
 
9
- <div role="alert"
10
- id="<?php echo esc_attr( $code ); ?>"
11
- class="sui-notice"
12
- aria-live="assertive">
 
 
13
  </div>
14
 
15
- <button class="wds-floating-notice-trigger"
16
- data-notice-type="<?php echo esc_attr( $type ); ?>"
17
- data-notice-open="<?php echo esc_attr( $code ); ?>"
18
- data-notice-message="<p><?php echo esc_attr( $message ); ?></p>"
19
- data-notice-icon="info"
20
- data-notice-dismiss="<?php echo $dismiss ? 'true' : 'false'; ?>"
21
- data-notice-autoclose="<?php echo $autoclose ? 'true' : 'false'; ?>"
22
- data-notice-autoclose-timeout="5000">
 
 
23
  </button>
1
  <?php
2
+ $code = empty( $code ) ? '' : $code;
3
+ $message = empty( $message ) ? '' : $message;
4
+ $type = empty( $type ) ? 'error' : $type; // phpcs:ignore
5
  $autoclose = empty( $autoclose ) ? false : $autoclose;
6
+ $dismiss = ! $autoclose;
7
  ?>
8
 
9
+ <div
10
+ role="alert"
11
+ id="<?php echo esc_attr( $code ); ?>"
12
+ class="sui-notice"
13
+ aria-live="assertive"
14
+ >
15
  </div>
16
 
17
+ <button
18
+ class="wds-floating-notice-trigger"
19
+ data-notice-type="<?php echo esc_attr( $type ); ?>"
20
+ data-notice-open="<?php echo esc_attr( $code ); ?>"
21
+ data-notice-message="<p><?php echo esc_attr( $message ); ?></p>"
22
+ data-notice-icon="info"
23
+ data-notice-dismiss="<?php echo $dismiss ? 'true' : 'false'; ?>"
24
+ data-notice-autoclose="<?php echo $autoclose ? 'true' : 'false'; ?>"
25
+ data-notice-autoclose-timeout="5000"
26
+ >
27
  </button>
includes/admin/templates/floating-notices.php CHANGED
@@ -1,40 +1,49 @@
1
  <?php
2
- $keys = empty( $keys ) ? array() : $keys;
3
  $settings_errors = empty( $this->option_name ) ? array() : get_settings_errors( $this->option_name );
4
- $errors = array();
5
  foreach ( $settings_errors as $settings_error ) {
6
  $code = smartcrawl_get_array_value( $settings_error, 'code' );
7
  if ( $code ) {
8
- $errors[ $code ] = smartcrawl_get_array_value( $settings_error, 'message' );
9
  }
10
  }
11
  $message = empty( $message ) ? esc_html__( 'Settings updated', 'wds' ) : $message;
12
  ?>
13
  <div class="sui-floating-notices">
14
  <?php
15
- if ( isset( $_GET['settings-updated'] ) ) {
16
- $this->_render( 'floating-notice', array(
17
- 'code' => 'wds-success-message',
18
- 'type' => 'success',
19
- 'message' => $message,
20
- 'autoclose' => true,
21
- ) );
 
 
 
22
  }
23
 
24
  foreach ( $errors as $code => $message ) {
25
- $this->_render( 'floating-notice', array(
26
- 'code' => $code,
27
- 'type' => 'error',
28
- 'message' => $message,
29
- 'autoclose' => false,
30
- ) );
 
 
 
31
  }
32
 
33
- foreach ( $keys as $key ): ?>
34
- <div role="alert"
35
- id="<?php echo esc_attr( $key ); ?>"
36
- class="sui-notice"
37
- aria-live="assertive">
 
 
 
38
  </div>
39
  <?php endforeach; ?>
40
  </div>
1
  <?php
2
+ $keys = empty( $keys ) ? array() : $keys;
3
  $settings_errors = empty( $this->option_name ) ? array() : get_settings_errors( $this->option_name );
4
+ $errors = array(); // phpcs:ignore
5
  foreach ( $settings_errors as $settings_error ) {
6
  $code = smartcrawl_get_array_value( $settings_error, 'code' );
7
  if ( $code ) {
8
+ $errors[ $code ] = smartcrawl_get_array_value( $settings_error, 'message' ); // phpcs:ignore
9
  }
10
  }
11
  $message = empty( $message ) ? esc_html__( 'Settings updated', 'wds' ) : $message;
12
  ?>
13
  <div class="sui-floating-notices">
14
  <?php
15
+ if ( isset( $_GET['settings-updated'] ) ) { // phpcs:ignore
16
+ $this->render_view(
17
+ 'floating-notice',
18
+ array(
19
+ 'code' => 'wds-success-message',
20
+ 'type' => 'success',
21
+ 'message' => $message,
22
+ 'autoclose' => true,
23
+ )
24
+ );
25
  }
26
 
27
  foreach ( $errors as $code => $message ) {
28
+ $this->render_view(
29
+ 'floating-notice',
30
+ array(
31
+ 'code' => $code,
32
+ 'type' => 'error',
33
+ 'message' => $message,
34
+ 'autoclose' => false,
35
+ )
36
+ );
37
  }
38
 
39
+ foreach ( $keys as $key ) :
40
+ ?>
41
+ <div
42
+ role="alert"
43
+ id="<?php echo esc_attr( $key ); ?>"
44
+ class="sui-notice"
45
+ aria-live="assertive"
46
+ >
47
  </div>
48
  <?php endforeach; ?>
49
  </div>
includes/admin/templates/footer.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
- $is_member = (boolean) smartcrawl_get_array_value( $_view, 'is_member' );
3
- $footer_text = sprintf( esc_html__( 'Made with %s by WPMU DEV', 'wds' ), '<span class="sui-icon-heart" aria-hidden="true" aria-label="love"></span>' );
4
  $filtered_footer_text = Smartcrawl_White_Label::get()->get_wpmudev_footer_text( $footer_text );
5
  ?>
6
 
@@ -9,54 +9,96 @@ $filtered_footer_text = Smartcrawl_White_Label::get()->get_wpmudev_footer_text(
9
  <?php echo wp_kses_post( $filtered_footer_text ); ?>
10
  </div>
11
 
12
- <?php if ( $filtered_footer_text !== $footer_text ) {
13
- // If the user has added custom footer text, don't show anything except that text
 
14
  return;
15
- } ?>
 
16
 
17
- <?php if ( $is_member ): ?>
18
  <!-- PRO Navigation -->
19
  <ul class="sui-footer-nav">
20
  <li><a href="https://wpmudev.com/hub2/" target="_blank"><?php esc_html_e( 'The Hub', 'wds' ); ?></a>
21
  </li>
22
- <li><a href="https://wpmudev.com/projects/category/plugins/"
23
- target="_blank"><?php esc_html_e( 'Plugins', 'wds' ); ?></a></li>
24
- <li><a href="https://wpmudev.com/roadmap/"
25
- target="_blank"><?php esc_html_e( 'Roadmap', 'wds' ); ?></a>
 
26
  </li>
27
- <li><a href="https://wpmudev.com/hub2/support"
28
- target="_blank"><?php esc_html_e( 'Support', 'wds' ); ?></a>
 
 
 
 
 
 
 
 
 
29
  </li>
30
  <li><a href="https://wpmudev.com/docs/" target="_blank"><?php esc_html_e( 'Docs', 'wds' ); ?></a>
31
  </li>
32
- <li><a href="https://wpmudev.com/hub2/community/"
33
- target="_blank"><?php esc_html_e( 'Community', 'wds' ); ?></a></li>
34
- <li><a href="https://wpmudev.com/terms-of-service/"
35
- target="_blank"><?php esc_html_e( 'Terms of Service', 'wds' ); ?></a></li>
36
- <li><a href="https://incsub.com/privacy-policy/"
37
- target="_blank"><?php esc_html_e( 'Privacy Policy', 'wds' ); ?></a>
 
 
 
 
 
 
 
 
 
38
  </li>
39
  </ul>
40
- <?php else: ?>
41
  <ul class="sui-footer-nav">
42
- <li><a href="https://profiles.wordpress.org/wpmudev#content-plugins"
43
- target="_blank"><?php esc_html_e( 'Free Plugins', 'wds' ); ?></a></li>
44
- <li><a href="https://wpmudev.com/features/"
45
- target="_blank"><?php esc_html_e( 'Membership', 'wds' ); ?></a>
 
 
 
 
 
 
46
  </li>
47
- <li><a href="https://wpmudev.com/roadmap/"
48
- target="_blank"><?php esc_html_e( 'Roadmap', 'wds' ); ?></a>
 
 
 
49
  </li>
50
- <li><a href="https://wordpress.org/support/plugin/smartcrawl-seo"
51
- target="_blank"><?php esc_html_e( 'Support', 'wds' ); ?></a></li>
 
 
 
52
  <li><a href="https://wpmudev.com/docs/" target="_blank"><?php esc_html_e( 'Docs', 'wds' ); ?></a>
53
  </li>
54
- <li><a href="https://wpmudev.com/hub-welcome/"
55
- target="_blank"><?php esc_html_e( 'The Hub', 'wds' ); ?></a></li>
56
- <li><a href="https://wpmudev.com/terms-of-service/"
57
- target="_blank"><?php esc_html_e( 'Terms of Service', 'wds' ); ?></a></li>
58
- <li><a href="https://incsub.com/privacy-policy/"
59
- target="_blank"><?php esc_html_e( 'Privacy Policy', 'wds' ); ?></a>
 
 
 
 
 
 
 
 
 
60
  </li>
61
  </ul>
62
  <?php endif; ?>
@@ -65,7 +107,8 @@ $filtered_footer_text = Smartcrawl_White_Label::get()->get_wpmudev_footer_text(
65
  <li><a href="https://www.facebook.com/wpmudev" target="_blank">
66
  <span class="sui-icon-social-facebook" aria-hidden="true"></span>
67
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Facebook', 'wds' ); ?></span>
68
- </a></li>
 
69
  <li><a href="https://twitter.com/wpmudev" target="_blank">
70
  <span class="sui-icon-social-twitter" aria-hidden="true"></span>
71
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Twitter', 'wds' ); ?></span>
@@ -74,6 +117,7 @@ $filtered_footer_text = Smartcrawl_White_Label::get()->get_wpmudev_footer_text(
74
  <li><a href="https://www.instagram.com/wpmu_dev/" target="_blank">
75
  <span class="sui-icon-instagram" aria-hidden="true"></span>
76
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Instagram', 'wds' ); ?></span>
77
- </a></li>
 
78
  </ul>
79
  </div>
1
  <?php
2
+ $is_member = (bool) smartcrawl_get_array_value( $_view, 'is_member' );
3
+ $footer_text = sprintf( esc_html__( 'Made with %s by WPMU DEV', 'wds' ), '<span class="sui-icon-heart" aria-hidden="true" aria-label="love"></span>' );
4
  $filtered_footer_text = Smartcrawl_White_Label::get()->get_wpmudev_footer_text( $footer_text );
5
  ?>
6
 
9
  <?php echo wp_kses_post( $filtered_footer_text ); ?>
10
  </div>
11
 
12
+ <?php
13
+ if ( $filtered_footer_text !== $footer_text ) {
14
+ // If the user has added custom footer text, don't show anything except that text.
15
  return;
16
+ }
17
+ ?>
18
 
19
+ <?php if ( $is_member ) : ?>
20
  <!-- PRO Navigation -->
21
  <ul class="sui-footer-nav">
22
  <li><a href="https://wpmudev.com/hub2/" target="_blank"><?php esc_html_e( 'The Hub', 'wds' ); ?></a>
23
  </li>
24
+ <li>
25
+ <a
26
+ href="https://wpmudev.com/projects/category/plugins/"
27
+ target="_blank"
28
+ ><?php esc_html_e( 'Plugins', 'wds' ); ?></a>
29
  </li>
30
+ <li>
31
+ <a
32
+ href="https://wpmudev.com/roadmap/"
33
+ target="_blank"
34
+ ><?php esc_html_e( 'Roadmap', 'wds' ); ?></a>
35
+ </li>
36
+ <li>
37
+ <a
38
+ href="https://wpmudev.com/hub2/support"
39
+ target="_blank"
40
+ ><?php esc_html_e( 'Support', 'wds' ); ?></a>
41
  </li>
42
  <li><a href="https://wpmudev.com/docs/" target="_blank"><?php esc_html_e( 'Docs', 'wds' ); ?></a>
43
  </li>
44
+ <li>
45
+ <a
46
+ href="https://wpmudev.com/hub2/community/"
47
+ target="_blank"
48
+ ><?php esc_html_e( 'Community', 'wds' ); ?></a></li>
49
+ <li>
50
+ <a
51
+ href="https://wpmudev.com/terms-of-service/"
52
+ target="_blank"
53
+ ><?php esc_html_e( 'Terms of Service', 'wds' ); ?></a></li>
54
+ <li>
55
+ <a
56
+ href="https://incsub.com/privacy-policy/"
57
+ target="_blank"
58
+ ><?php esc_html_e( 'Privacy Policy', 'wds' ); ?></a>
59
  </li>
60
  </ul>
61
+ <?php else : ?>
62
  <ul class="sui-footer-nav">
63
+ <li>
64
+ <a
65
+ href="https://profiles.wordpress.org/wpmudev#content-plugins"
66
+ target="_blank"
67
+ ><?php esc_html_e( 'Free Plugins', 'wds' ); ?></a></li>
68
+ <li>
69
+ <a
70
+ href="https://wpmudev.com/features/"
71
+ target="_blank"
72
+ ><?php esc_html_e( 'Membership', 'wds' ); ?></a>
73
  </li>
74
+ <li>
75
+ <a
76
+ href="https://wpmudev.com/roadmap/"
77
+ target="_blank"
78
+ ><?php esc_html_e( 'Roadmap', 'wds' ); ?></a>
79
  </li>
80
+ <li>
81
+ <a
82
+ href="https://wordpress.org/support/plugin/smartcrawl-seo"
83
+ target="_blank"
84
+ ><?php esc_html_e( 'Support', 'wds' ); ?></a></li>
85
  <li><a href="https://wpmudev.com/docs/" target="_blank"><?php esc_html_e( 'Docs', 'wds' ); ?></a>
86
  </li>
87
+ <li>
88
+ <a
89
+ href="https://wpmudev.com/hub-welcome/"
90
+ target="_blank"
91
+ ><?php esc_html_e( 'The Hub', 'wds' ); ?></a></li>
92
+ <li>
93
+ <a
94
+ href="https://wpmudev.com/terms-of-service/"
95
+ target="_blank"
96
+ ><?php esc_html_e( 'Terms of Service', 'wds' ); ?></a></li>
97
+ <li>
98
+ <a
99
+ href="https://incsub.com/privacy-policy/"
100
+ target="_blank"
101
+ ><?php esc_html_e( 'Privacy Policy', 'wds' ); ?></a>
102
  </li>
103
  </ul>
104
  <?php endif; ?>
107
  <li><a href="https://www.facebook.com/wpmudev" target="_blank">
108
  <span class="sui-icon-social-facebook" aria-hidden="true"></span>
109
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Facebook', 'wds' ); ?></span>
110
+ </a>
111
+ </li>
112
  <li><a href="https://twitter.com/wpmudev" target="_blank">
113
  <span class="sui-icon-social-twitter" aria-hidden="true"></span>
114
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Twitter', 'wds' ); ?></span>
117
  <li><a href="https://www.instagram.com/wpmu_dev/" target="_blank">
118
  <span class="sui-icon-instagram" aria-hidden="true"></span>
119
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Instagram', 'wds' ); ?></span>
120
+ </a>
121
+ </li>
122
  </ul>
123
  </div>
includes/admin/templates/health/health-section-settings.php CHANGED
@@ -3,16 +3,19 @@ $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
  ?>
4
  <form id="wds-settings-form">
5
  <?php
6
- $this->_render( 'vertical-tab', array(
7
- 'tab_id' => 'tab_settings',
8
- 'tab_name' => esc_html__( 'Settings', 'wds' ),
9
- 'is_active' => 'tab_settings' === $active_tab,
10
- 'button_text' => false,
11
- 'tab_sections' => array(
12
- array(
13
- 'section_template' => 'health/health-test-mode-lighthouse',
 
 
 
14
  ),
15
- ),
16
- ) );
17
  ?>
18
  </form>
3
  ?>
4
  <form id="wds-settings-form">
5
  <?php
6
+ $this->render_view(
7
+ 'vertical-tab',
8
+ array(
9
+ 'tab_id' => 'tab_settings',
10
+ 'tab_name' => esc_html__( 'Settings', 'wds' ),
11
+ 'is_active' => 'tab_settings' === $active_tab,
12
+ 'button_text' => false,
13
+ 'tab_sections' => array(
14
+ array(
15
+ 'section_template' => 'health/health-test-mode-lighthouse',
16
+ ),
17
  ),
18
+ )
19
+ );
20
  ?>
21
  </form>
includes/admin/templates/health/health-test-mode-lighthouse.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $dashboard_device = Smartcrawl_Lighthouse_Options::dashboard_widget_device();
4
  ?>
5
  <div class="sui-box-settings-row">
@@ -13,31 +13,35 @@ $dashboard_device = Smartcrawl_Lighthouse_Options::dashboard_widget_device();
13
  </div>
14
 
15
  <div class="sui-box-settings-col-2">
16
- <?php $this->_render( 'side-tabs', array(
17
- 'id' => 'wds-lighthouse-dashboard-widget-device',
18
- 'name' => "{$option_name}[lighthouse-dashboard-widget-device]",
19
- 'value' => $dashboard_device,
20
- 'tabs' => array(
21
- array(
22
- 'label' => esc_html__( 'Desktop', 'wds' ),
23
- 'value' => 'desktop',
 
 
 
 
 
 
 
 
24
  ),
25
- array(
26
- 'label' => esc_html__( 'Mobile', 'wds' ),
27
- 'value' => 'mobile',
28
- ),
29
- ),
30
- ) );
31
  ?>
32
  </div>
33
  </div>
34
 
35
  <div class="sui-box-footer">
36
  <button class="sui-button sui-button-blue">
37
- <span class="sui-loading-text">
38
- <span class="sui-icon-save" aria-hidden="true"></span>
39
- <?php esc_html_e( 'Save Settings', 'wds' ); ?>
40
- </span>
41
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
42
  </button>
43
- </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $dashboard_device = Smartcrawl_Lighthouse_Options::dashboard_widget_device();
4
  ?>
5
  <div class="sui-box-settings-row">
13
  </div>
14
 
15
  <div class="sui-box-settings-col-2">
16
+ <?php
17
+ $this->render_view(
18
+ 'side-tabs',
19
+ array(
20
+ 'id' => 'wds-lighthouse-dashboard-widget-device',
21
+ 'name' => "{$option_name}[lighthouse-dashboard-widget-device]",
22
+ 'value' => $dashboard_device,
23
+ 'tabs' => array(
24
+ array(
25
+ 'label' => esc_html__( 'Desktop', 'wds' ),
26
+ 'value' => 'desktop',
27
+ ),
28
+ array(
29
+ 'label' => esc_html__( 'Mobile', 'wds' ),
30
+ 'value' => 'mobile',
31
+ ),
32
  ),
33
+ )
34
+ );
 
 
 
 
35
  ?>
36
  </div>
37
  </div>
38
 
39
  <div class="sui-box-footer">
40
  <button class="sui-button sui-button-blue">
41
+ <span class="sui-loading-text">
42
+ <span class="sui-icon-save" aria-hidden="true"></span>
43
+ <?php esc_html_e( 'Save Settings', 'wds' ); ?>
44
+ </span>
45
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
46
  </button>
47
+ </div>
includes/admin/templates/lighthouse/lighthouse-check-item.php CHANGED
@@ -1,19 +1,23 @@
1
  <?php
2
  /**
 
 
3
  * @var $check Smartcrawl_Lighthouse_Check
 
 
4
  */
5
  $check = empty( $check ) ? false : $check;
6
  if ( ! $check ) {
7
  return;
8
  }
9
- $testing_tool = sprintf( 'https://search.google.com/test/rich-results?url=%s&user_agent=2', urlencode( home_url() ) );
10
  $is_structured_data_check = $check->get_id() === Smartcrawl_Lighthouse_Structured_Data_Check::ID;
11
  if ( $is_structured_data_check ) {
12
  $check_style_class = 'sui-default wds-structured-data-check';
13
- $check_icon_class = 'sui-icon-info';
14
  } else {
15
  $check_style_class = $check->is_passed() ? 'sui-success' : 'sui-warning';
16
- $check_icon_class = $check->is_passed() ? 'sui-icon-check-tick' : 'sui-icon-warning-alert';
17
  }
18
 
19
  if ( ! $check->get_weight() && ! $is_structured_data_check ) {
@@ -22,20 +26,23 @@ if ( ! $check->get_weight() && ! $is_structured_data_check ) {
22
  $action_button = $check->get_action_button();
23
  ?>
24
 
25
- <div id="<?php echo esc_attr( $check->get_id() ); ?>"
26
- class="sui-accordion-item <?php echo esc_attr( $check_style_class ); ?>">
 
27
  <div class="sui-accordion-item-header">
28
  <div class="sui-accordion-item-title sui-accordion-col-4">
29
- <span aria-hidden="true"
30
- class="<?php echo esc_attr( $check_style_class ); ?> <?php echo esc_attr( $check_icon_class ); ?>"></span>
 
31
  <?php echo esc_html( $check->get_title() ); ?>
32
  </div>
33
 
34
  <div class="sui-accordion-col-4">
35
- <?php if ( $is_structured_data_check ): ?>
36
- <a href="<?php echo esc_attr( $testing_tool ); ?>"
37
- target="_blank"
38
- class="sui-button sui-button-ghost">
 
39
  <span class="sui-icon-target" aria-hidden="true"></span>
40
  <?php esc_html_e( 'Testing Tool', 'wds' ); ?>
41
  </a>
@@ -43,13 +50,16 @@ $action_button = $check->get_action_button();
43
 
44
  <span class="sui-accordion-open-indicator">
45
  <span aria-hidden="true" class="sui-icon-chevron-down"></span>
46
- <button type="button"
47
- class="sui-screen-reader-text">
48
-
49
- <?php printf(
 
 
50
  esc_html__( 'Expand %s check', 'wds' ),
51
  esc_html( $check->get_title() )
52
- ); ?>
 
53
  </button>
54
  </span>
55
  </div>
@@ -58,23 +68,27 @@ $action_button = $check->get_action_button();
58
  <div class="sui-accordion-item-body">
59
  <div class="sui-box">
60
  <div class="sui-box-body">
61
- <?php echo $check->get_description(); ?>
62
  <label>
63
- <textarea style="display: none;"><?php
64
- echo esc_textarea( $check->get_copy_description() );
65
- ?></textarea>
 
 
66
  </label>
67
  </div>
68
 
69
- <?php if ( ! $check->is_passed() ): ?>
70
  <div class="sui-box-footer">
71
- <button class="sui-button sui-button-ghost sui-tooltip wds-copy-audit"
72
- data-tooltip="<?php esc_html_e( 'Copy audit details', 'wds' ); ?>">
 
 
73
  <?php esc_html_e( 'Copy Audit', 'wds' ); ?>
74
  </button>
75
 
76
  <div class="sui-actions-right">
77
- <?php if ( $action_button ): ?>
78
  <?php echo wp_kses_post( $action_button ); ?>
79
  <?php endif; ?>
80
  </div>
1
  <?php
2
  /**
3
+ * Check.
4
+ *
5
  * @var $check Smartcrawl_Lighthouse_Check
6
+ *
7
+ * @package SmartCrawl.
8
  */
9
  $check = empty( $check ) ? false : $check;
10
  if ( ! $check ) {
11
  return;
12
  }
13
+ $testing_tool = sprintf( 'https://search.google.com/test/rich-results?url=%s&user_agent=2', urlencode( home_url() ) );
14
  $is_structured_data_check = $check->get_id() === Smartcrawl_Lighthouse_Structured_Data_Check::ID;
15
  if ( $is_structured_data_check ) {
16
  $check_style_class = 'sui-default wds-structured-data-check';
17
+ $check_icon_class = 'sui-icon-info';
18
  } else {
19
  $check_style_class = $check->is_passed() ? 'sui-success' : 'sui-warning';
20
+ $check_icon_class = $check->is_passed() ? 'sui-icon-check-tick' : 'sui-icon-warning-alert';
21
  }
22
 
23
  if ( ! $check->get_weight() && ! $is_structured_data_check ) {
26
  $action_button = $check->get_action_button();
27
  ?>
28
 
29
+ <div
30
+ id="<?php echo esc_attr( $check->get_id() ); ?>"
31
+ class="sui-accordion-item <?php echo esc_attr( $check_style_class ); ?>">
32
  <div class="sui-accordion-item-header">
33
  <div class="sui-accordion-item-title sui-accordion-col-4">
34
+ <span
35
+ aria-hidden="true"
36
+ class="<?php echo esc_attr( $check_style_class ); ?> <?php echo esc_attr( $check_icon_class ); ?>"></span>
37
  <?php echo esc_html( $check->get_title() ); ?>
38
  </div>
39
 
40
  <div class="sui-accordion-col-4">
41
+ <?php if ( $is_structured_data_check ) : ?>
42
+ <a
43
+ href="<?php echo esc_attr( $testing_tool ); ?>"
44
+ target="_blank"
45
+ class="sui-button sui-button-ghost">
46
  <span class="sui-icon-target" aria-hidden="true"></span>
47
  <?php esc_html_e( 'Testing Tool', 'wds' ); ?>
48
  </a>
50
 
51
  <span class="sui-accordion-open-indicator">
52
  <span aria-hidden="true" class="sui-icon-chevron-down"></span>
53
+ <button
54
+ type="button"
55
+ class="sui-screen-reader-text"
56
+ >
57
+ <?php
58
+ printf(
59
  esc_html__( 'Expand %s check', 'wds' ),
60
  esc_html( $check->get_title() )
61
+ );
62
+ ?>
63
  </button>
64
  </span>
65
  </div>
68
  <div class="sui-accordion-item-body">
69
  <div class="sui-box">
70
  <div class="sui-box-body">
71
+ <?php echo $check->get_description(); // phpcs:ignore ?>
72
  <label>
73
+ <textarea style="display: none;">
74
+ <?php
75
+ echo esc_textarea( $check->get_copy_description() );
76
+ ?>
77
+ </textarea>
78
  </label>
79
  </div>
80
 
81
+ <?php if ( ! $check->is_passed() ) : ?>
82
  <div class="sui-box-footer">
83
+ <button
84
+ class="sui-button sui-button-ghost sui-tooltip wds-copy-audit"
85
+ data-tooltip="<?php esc_html_e( 'Copy audit details', 'wds' ); ?>"
86
+ >
87
  <?php esc_html_e( 'Copy Audit', 'wds' ); ?>
88
  </button>
89
 
90
  <div class="sui-actions-right">
91
+ <?php if ( $action_button ) : ?>
92
  <?php echo wp_kses_post( $action_button ); ?>
93
  <?php endif; ?>
94
  </div>
includes/admin/templates/lighthouse/lighthouse-error.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  /**
3
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
 
 
4
  */
5
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
6
  if ( ! $lighthouse_report ) {
@@ -8,18 +10,21 @@ if ( ! $lighthouse_report ) {
8
  }
9
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
10
 
11
- $this->_render( 'vertical-tab', array(
12
- 'tab_id' => 'tab_lighthouse',
13
- 'tab_name' => esc_html__( 'SEO audits', 'wds' ),
14
- 'is_active' => 'tab_lighthouse' === $active_tab,
15
- 'button_text' => false,
16
- 'tab_sections' => array(
17
- array(
18
- 'section_template' => 'notice',
19
- 'section_args' => array(
20
- 'class' => 'sui-notice-error',
21
- 'message' => $lighthouse_report->get_error_message(),
 
 
 
22
  ),
23
  ),
24
- ),
25
- ) );
1
  <?php
2
  /**
3
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
4
+ *
5
+ * @package SmartCrawl
6
  */
7
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
8
  if ( ! $lighthouse_report ) {
10
  }
11
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
12
 
13
+ $this->render_view(
14
+ 'vertical-tab',
15
+ array(
16
+ 'tab_id' => 'tab_lighthouse',
17
+ 'tab_name' => esc_html__( 'SEO audits', 'wds' ),
18
+ 'is_active' => 'tab_lighthouse' === $active_tab,
19
+ 'button_text' => false,
20
+ 'tab_sections' => array(
21
+ array(
22
+ 'section_template' => 'notice',
23
+ 'section_args' => array(
24
+ 'class' => 'sui-notice-error',
25
+ 'message' => $lighthouse_report->get_error_message(),
26
+ ),
27
  ),
28
  ),
29
+ )
30
+ );
includes/admin/templates/lighthouse/lighthouse-extra-actions.php CHANGED
@@ -3,10 +3,12 @@ $device = smartcrawl_get_array_value( $_GET, 'device' );
3
  if ( ! in_array( $device, array( 'desktop', 'mobile' ), true ) ) {
4
  $device = 'desktop';
5
  }
6
- $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH );
7
  $desktop_url = $page_url . '&device=desktop';
8
- $mobile_url = $page_url . '&device=mobile';
9
  /**
 
 
10
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
11
  */
12
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
@@ -15,14 +17,18 @@ if ( ! $lighthouse_report || ! $lighthouse_report->has_data() || $lighthouse_rep
15
  }
16
  ?>
17
  <div class="wds-lh-device">
18
- <a class="<?php echo $device === 'desktop' ? 'active' : 'sui-tooltip'; ?>"
19
- data-tooltip="<?php esc_html_e( 'Apply desktop simulation' ); ?>"
20
- href="<?php echo esc_attr( $desktop_url ); ?>">
 
 
21
  <span class="sui-icon-monitor" aria-hidden="true"></span> <?php esc_html_e( 'Desktop', 'wds' ); ?>
22
  </a>
23
- <a class="<?php echo $device === 'mobile' ? 'active' : 'sui-tooltip'; ?>"
24
- data-tooltip="<?php esc_html_e( 'Apply mobile simulation' ); ?>"
25
- href="<?php echo esc_attr( $mobile_url ); ?>">
 
 
26
  <span class="sui-icon-tablet-portrait" aria-hidden="true"></span> <?php esc_html_e( 'Mobile', 'wds' ); ?>
27
  </a>
28
  </div>
3
  if ( ! in_array( $device, array( 'desktop', 'mobile' ), true ) ) {
4
  $device = 'desktop';
5
  }
6
+ $page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_HEALTH );
7
  $desktop_url = $page_url . '&device=desktop';
8
+ $mobile_url = $page_url . '&device=mobile';
9
  /**
10
+ * Report.
11
+ *
12
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
13
  */
14
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
17
  }
18
  ?>
19
  <div class="wds-lh-device">
20
+ <a
21
+ class="<?php echo 'desktop' === $device ? 'active' : 'sui-tooltip'; ?>"
22
+ data-tooltip="<?php esc_html_e( 'Apply desktop simulation' ); ?>"
23
+ href="<?php echo esc_attr( $desktop_url ); ?>"
24
+ >
25
  <span class="sui-icon-monitor" aria-hidden="true"></span> <?php esc_html_e( 'Desktop', 'wds' ); ?>
26
  </a>
27
+ <a
28
+ class="<?php echo 'mobile' === $device ? 'active' : 'sui-tooltip'; ?>"
29
+ data-tooltip="<?php esc_html_e( 'Apply mobile simulation' ); ?>"
30
+ href="<?php echo esc_attr( $mobile_url ); ?>"
31
+ >
32
  <span class="sui-icon-tablet-portrait" aria-hidden="true"></span> <?php esc_html_e( 'Mobile', 'wds' ); ?>
33
  </a>
34
  </div>
includes/admin/templates/lighthouse/lighthouse-header-actions.php CHANGED
@@ -5,26 +5,28 @@ if ( ! $lighthouse_report ) {
5
  }
6
 
7
  if ( $lighthouse_report->has_data() && ! $lighthouse_report->has_errors() ) {
8
- $disabled = $lighthouse_report->is_cooling_down();
9
  $remaining_minutes = $lighthouse_report->get_remaining_cooldown_minutes();
10
- $tooltip = $lighthouse_report->is_cooling_down()
11
  ? sprintf( esc_html__( 'SmartCrawl is just catching her breath, you can run another test in %s minutes.', 'wds' ), $remaining_minutes )
12
  : false;
13
  } else {
14
  $disabled = false;
15
- $tooltip = false;
16
  }
17
  ?>
18
 
19
- <?php if ( $lighthouse_report->has_data() || $lighthouse_report->has_errors() ): ?>
20
- <span class="<?php echo $tooltip ? 'sui-tooltip sui-tooltip-constrained' : ''; ?>"
21
- style="--tooltip-width: 240px;"
22
- data-tooltip="<?php echo esc_attr( $tooltip ); ?>">
23
-
24
- <button type="submit" <?php disabled( $disabled ); ?>
25
- id="wds-new-lighthouse-test-button"
26
- class="sui-button sui-button-blue">
27
-
 
 
28
  <span class="sui-loading-text"><?php esc_html_e( 'New Test', 'wds' ); ?></span>
29
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
30
  </button>
5
  }
6
 
7
  if ( $lighthouse_report->has_data() && ! $lighthouse_report->has_errors() ) {
8
+ $disabled = $lighthouse_report->is_cooling_down();
9
  $remaining_minutes = $lighthouse_report->get_remaining_cooldown_minutes();
10
+ $tooltip = $lighthouse_report->is_cooling_down()
11
  ? sprintf( esc_html__( 'SmartCrawl is just catching her breath, you can run another test in %s minutes.', 'wds' ), $remaining_minutes )
12
  : false;
13
  } else {
14
  $disabled = false;
15
+ $tooltip = false;
16
  }
17
  ?>
18
 
19
+ <?php if ( $lighthouse_report->has_data() || $lighthouse_report->has_errors() ) : ?>
20
+ <span
21
+ class="<?php echo $tooltip ? 'sui-tooltip sui-tooltip-constrained' : ''; ?>"
22
+ style="--tooltip-width: 240px;"
23
+ data-tooltip="<?php echo esc_attr( $tooltip ); ?>"
24
+ >
25
+ <button
26
+ type="submit" <?php disabled( $disabled ); ?>
27
+ id="wds-new-lighthouse-test-button"
28
+ class="sui-button sui-button-blue"
29
+ >
30
  <span class="sui-loading-text"><?php esc_html_e( 'New Test', 'wds' ); ?></span>
31
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
32
  </button>
includes/admin/templates/lighthouse/lighthouse-no-data.php CHANGED
@@ -1,30 +1,33 @@
1
  <?php
2
  $lighthouse_start_time = empty( $lighthouse_start_time ) ? false : $lighthouse_start_time;
3
- $active_tab = empty( $active_tab ) ? '' : $active_tab;
4
  ?>
5
  <div>
6
- <?php $this->_render( 'lighthouse/lighthouse-progress-modal' ); ?>
7
  </div>
8
  <?php
9
- $this->_render( 'vertical-tab', array(
10
- 'tab_id' => 'tab_lighthouse',
11
- 'tab_name' => esc_html__( 'Get Started', 'wds' ),
12
- 'is_active' => 'tab_lighthouse' === $active_tab,
13
- 'button_text' => false,
14
- 'tab_sections' => array(
15
- array(
16
- 'section_template' => 'disabled-component-inner',
17
- 'section_args' => array(
18
- 'content' => sprintf(
19
- '%s<br/>%s',
20
- esc_html__( 'Let’s find out what can be improved!', 'wds' ),
21
- esc_html__( 'Smartcrawl will run a quick SEO test against your Homepage, and then give you the tools to drastically improve your SEO.', 'wds' )
 
 
 
 
 
 
 
22
  ),
23
- 'image' => 'graphic-lighthouse-disabled.svg',
24
- 'component' => 'lighthouse',
25
- 'button_text' => esc_html__( 'Test My Homepage', 'wds' ),
26
- 'button_disabled' => $lighthouse_start_time,
27
  ),
28
  ),
29
- ),
30
- ) );
1
  <?php
2
  $lighthouse_start_time = empty( $lighthouse_start_time ) ? false : $lighthouse_start_time;
3
+ $active_tab = empty( $active_tab ) ? '' : $active_tab;
4
  ?>
5
  <div>
6
+ <?php $this->render_view( 'lighthouse/lighthouse-progress-modal' ); ?>
7
  </div>
8
  <?php
9
+ $this->render_view(
10
+ 'vertical-tab',
11
+ array(
12
+ 'tab_id' => 'tab_lighthouse',
13
+ 'tab_name' => esc_html__( 'Get Started', 'wds' ),
14
+ 'is_active' => 'tab_lighthouse' === $active_tab,
15
+ 'button_text' => false,
16
+ 'tab_sections' => array(
17
+ array(
18
+ 'section_template' => 'disabled-component-inner',
19
+ 'section_args' => array(
20
+ 'content' => sprintf(
21
+ '%s<br/>%s',
22
+ esc_html__( 'Let’s find out what can be improved!', 'wds' ),
23
+ esc_html__( 'Smartcrawl will run a quick SEO test against your Homepage, and then give you the tools to drastically improve your SEO.', 'wds' )
24
+ ),
25
+ 'image' => 'graphic-lighthouse-disabled.svg',
26
+ 'component' => 'lighthouse',
27
+ 'button_text' => esc_html__( 'Test My Homepage', 'wds' ),
28
+ 'button_disabled' => $lighthouse_start_time,
29
  ),
 
 
 
 
30
  ),
31
  ),
32
+ )
33
+ );
includes/admin/templates/lighthouse/lighthouse-progress-modal-body.php CHANGED
@@ -1,18 +1,24 @@
1
  <?php
2
- $is_member = empty( $_view['is_member'] ) ? false : true;
3
 
4
- $this->_render( 'progress-bar', array(
5
- 'progress' => 0,
6
- 'progress_state' => esc_html__( 'Initializing engines...', 'wds' ),
7
- ) );
 
 
 
8
 
9
  if ( ! $is_member ) {
10
- $this->_render( 'mascot-message', array(
11
- 'dismissible' => false,
12
- 'message' => sprintf(
13
- '%s <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_lighthouse_modal_upsell_notice">%s</a>',
14
- esc_html__( 'Upgrade to Pro to schedule automated tests and send white label email reports directly to your clients. Never miss a beat with your search engine optimization.', 'wds' ),
15
- esc_html__( 'Try it for FREE today', 'wds' )
16
- ),
17
- ) );
 
 
 
18
  }
1
  <?php
2
+ $is_member = ! empty( $_view['is_member'] );
3
 
4
+ $this->render_view(
5
+ 'progress-bar',
6
+ array(
7
+ 'progress' => 0,
8
+ 'progress_state' => esc_html__( 'Initializing engines...', 'wds' ),
9
+ )
10
+ );
11
 
12
  if ( ! $is_member ) {
13
+ $this->render_view(
14
+ 'mascot-message',
15
+ array(
16
+ 'dismissible' => false,
17
+ 'message' => sprintf(
18
+ '%s <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_lighthouse_modal_upsell_notice">%s</a>',
19
+ esc_html__( 'Upgrade to Pro to schedule automated tests and send white label email reports directly to your clients. Never miss a beat with your search engine optimization.', 'wds' ),
20
+ esc_html__( 'Try it for FREE today', 'wds' )
21
+ ),
22
+ )
23
+ );
24
  }
includes/admin/templates/lighthouse/lighthouse-progress-modal.php CHANGED
@@ -1,7 +1,11 @@
1
- <?php $this->_render( 'modal', array(
2
- 'id' => 'wds-lighthouse-progress-modal',
3
- 'title' => esc_html__( 'SEO Test in progress', 'wds' ),
4
- 'description' => esc_html__( "Your SEO test is in progress, please wait a few moments …", 'wds' ),
5
- 'header_actions_template' => 'noop',
6
- 'body_template' => 'lighthouse/lighthouse-progress-modal-body',
7
- ) );
 
 
 
 
1
+ <?php
2
+ $this->render_view(
3
+ 'modal',
4
+ array(
5
+ 'id' => 'wds-lighthouse-progress-modal',
6
+ 'title' => esc_html__( 'SEO Test in progress', 'wds' ),
7
+ 'description' => esc_html__( 'Your SEO test is in progress, please wait a few moments …', 'wds' ),
8
+ 'header_actions_template' => 'noop',
9
+ 'body_template' => 'lighthouse/lighthouse-progress-modal-body',
10
+ )
11
+ );
includes/admin/templates/lighthouse/lighthouse-recipients.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
4
  $lighthouse_frequency = empty( $lighthouse_frequency ) ? false : $lighthouse_frequency;
5
- $reporting_condition = Smartcrawl_Lighthouse_Options::reporting_condition();
6
- $reporting_device = Smartcrawl_Lighthouse_Options::reporting_device();
7
  ?>
8
 
9
  <small><strong><?php esc_html_e( 'Recipients', 'wds' ); ?></strong></small>
@@ -12,33 +12,40 @@ $reporting_device = Smartcrawl_Lighthouse_Options::reporting_device();
12
 
13
  <p></p>
14
  <small><strong><?php esc_html_e( 'Schedule', 'wds' ); ?></strong></small>
15
- <?php $this->_render( 'reporting-schedule', array(
16
- 'component' => 'lighthouse',
17
- 'frequency' => $lighthouse_frequency,
18
- 'dow_value' => Smartcrawl_Lighthouse_Options::reporting_dow(),
19
- 'tod_value' => Smartcrawl_Lighthouse_Options::reporting_tod(),
20
- ) ); ?>
 
 
 
 
 
21
 
22
  <p></p>
23
  <div class="sui-form-field">
24
  <label for="wds-reporting-condition-checkbox" class="sui-checkbox">
25
- <input type="checkbox" <?php checked( Smartcrawl_Lighthouse_Options::reporting_condition_enabled() ); ?>
26
- id="wds-reporting-condition-checkbox"
27
- name="<?php echo esc_attr( $option_name ); ?>[lighthouse-reporting-condition-enabled]"
28
- aria-labelledby="wds-reporting-condition-label"/>
 
 
29
  <span aria-hidden="true"></span>
30
  <span id="wds-reporting-condition-label"><?php esc_html_e( 'Only send report when your SEO score drops below:', 'wds' ); ?></span>
31
  </label>
32
 
33
  <div id="wds-reporting-condition-container">
34
- <select class="sui-select"
35
- id="wds-reporting-condition"
36
- data-minimum-results-for-search="-1"
37
- data-placeholder="<?php echo esc_attr( 'Select' ); ?>"
38
- name="<?php echo esc_attr( $option_name ); ?>[lighthouse-reporting-condition]">
39
-
 
40
  <option></option>
41
-
42
  <?php foreach ( array( 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ) as $value ) : ?>
43
  <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $reporting_condition ); ?>>
44
  <?php echo esc_html( $value ) . '%'; ?>
@@ -52,23 +59,28 @@ $reporting_device = Smartcrawl_Lighthouse_Options::reporting_device();
52
  <strong><?php esc_html_e( 'Device', 'wds' ); ?></strong>
53
  <p class="sui-description"><?php esc_html_e( 'Choose the device type you want to show the SEO test results for in your scheduled reports.', 'wds' ); ?></p>
54
 
55
- <?php $this->_render( 'side-tabs', array(
56
- 'id' => 'wds-lighthouse-reporting-device',
57
- 'name' => "{$option_name}[lighthouse-reporting-device]",
58
- 'value' => $reporting_device,
59
- 'tabs' => array(
60
- array(
61
- 'value' => 'both',
62
- 'label' => esc_html__( 'Both', 'wds' ),
63
- ),
64
- array(
65
- 'value' => 'desktop',
66
- 'label' => esc_html__( 'Desktop', 'wds' ),
67
- ),
68
- array(
69
- 'value' => 'mobile',
70
- 'label' => esc_html__( 'Mobile', 'wds' ),
 
 
 
 
71
  ),
72
- ),
73
- ) ); ?>
 
74
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
4
  $lighthouse_frequency = empty( $lighthouse_frequency ) ? false : $lighthouse_frequency;
5
+ $reporting_condition = Smartcrawl_Lighthouse_Options::reporting_condition();
6
+ $reporting_device = Smartcrawl_Lighthouse_Options::reporting_device();
7
  ?>
8
 
9
  <small><strong><?php esc_html_e( 'Recipients', 'wds' ); ?></strong></small>
12
 
13
  <p></p>
14
  <small><strong><?php esc_html_e( 'Schedule', 'wds' ); ?></strong></small>
15
+ <?php
16
+ $this->render_view(
17
+ 'reporting-schedule',
18
+ array(
19
+ 'component' => 'lighthouse',
20
+ 'frequency' => $lighthouse_frequency,
21
+ 'dow_value' => Smartcrawl_Lighthouse_Options::reporting_dow(),
22
+ 'tod_value' => Smartcrawl_Lighthouse_Options::reporting_tod(),
23
+ )
24
+ );
25
+ ?>
26
 
27
  <p></p>
28
  <div class="sui-form-field">
29
  <label for="wds-reporting-condition-checkbox" class="sui-checkbox">
30
+ <input
31
+ type="checkbox" <?php checked( Smartcrawl_Lighthouse_Options::reporting_condition_enabled() ); ?>
32
+ id="wds-reporting-condition-checkbox"
33
+ name="<?php echo esc_attr( $option_name ); ?>[lighthouse-reporting-condition-enabled]"
34
+ aria-labelledby="wds-reporting-condition-label"
35
+ />
36
  <span aria-hidden="true"></span>
37
  <span id="wds-reporting-condition-label"><?php esc_html_e( 'Only send report when your SEO score drops below:', 'wds' ); ?></span>
38
  </label>
39
 
40
  <div id="wds-reporting-condition-container">
41
+ <select
42
+ class="sui-select"
43
+ id="wds-reporting-condition"
44
+ data-minimum-results-for-search="-1"
45
+ data-placeholder="<?php echo esc_attr( 'Select' ); ?>"
46
+ name="<?php echo esc_attr( $option_name ); ?>[lighthouse-reporting-condition]"
47
+ >
48
  <option></option>
 
49
  <?php foreach ( array( 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ) as $value ) : ?>
50
  <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $reporting_condition ); ?>>
51
  <?php echo esc_html( $value ) . '%'; ?>
59
  <strong><?php esc_html_e( 'Device', 'wds' ); ?></strong>
60
  <p class="sui-description"><?php esc_html_e( 'Choose the device type you want to show the SEO test results for in your scheduled reports.', 'wds' ); ?></p>
61
 
62
+ <?php
63
+ $this->render_view(
64
+ 'side-tabs',
65
+ array(
66
+ 'id' => 'wds-lighthouse-reporting-device',
67
+ 'name' => "{$option_name}[lighthouse-reporting-device]",
68
+ 'value' => $reporting_device,
69
+ 'tabs' => array(
70
+ array(
71
+ 'value' => 'both',
72
+ 'label' => esc_html__( 'Both', 'wds' ),
73
+ ),
74
+ array(
75
+ 'value' => 'desktop',
76
+ 'label' => esc_html__( 'Desktop', 'wds' ),
77
+ ),
78
+ array(
79
+ 'value' => 'mobile',
80
+ 'label' => esc_html__( 'Mobile', 'wds' ),
81
+ ),
82
  ),
83
+ )
84
+ );
85
+ ?>
86
  </div>
includes/admin/templates/lighthouse/lighthouse-report-group.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
  /**
3
  * @var $lighthouse_group Smartcrawl_Lighthouse_Group
 
 
4
  */
 
5
  $lighthouse_group = empty( $lighthouse_group ) ? false : $lighthouse_group;
6
  if ( ! $lighthouse_group ) {
7
  return;
@@ -13,18 +16,21 @@ $notices = array(
13
  );
14
  ?>
15
 
16
- <p><?php echo esc_html( $lighthouse_group->get_description() ) ?></p>
17
 
18
- <?php foreach ( $notices as $notice_group => $notice ): ?>
19
  <?php
20
  if (
21
  $lighthouse_group->get_id() === $notice_group
22
  && $lighthouse_group->get_failing_count() === 0
23
  ) {
24
- Smartcrawl_Simple_Renderer::render( 'notice', array(
25
- 'class' => 'sui-notice-success',
26
- 'message' => $notice,
27
- ) );
 
 
 
28
  }
29
  ?>
30
  <?php endforeach; ?>
@@ -32,7 +38,7 @@ $notices = array(
32
  <div class="sui-accordion sui-accordion-flushed">
33
  <?php
34
  foreach ( $lighthouse_group->get_checks() as $check ) {
35
- $this->_render( 'lighthouse/lighthouse-check-item', array( 'check' => $check ) );
36
  }
37
  ?>
38
  </div>
1
  <?php
2
  /**
3
  * @var $lighthouse_group Smartcrawl_Lighthouse_Group
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
  $lighthouse_group = empty( $lighthouse_group ) ? false : $lighthouse_group;
9
  if ( ! $lighthouse_group ) {
10
  return;
16
  );
17
  ?>
18
 
19
+ <p><?php echo esc_html( $lighthouse_group->get_description() ); ?></p>
20
 
21
+ <?php foreach ( $notices as $notice_group => $notice ) : ?>
22
  <?php
23
  if (
24
  $lighthouse_group->get_id() === $notice_group
25
  && $lighthouse_group->get_failing_count() === 0
26
  ) {
27
+ Smartcrawl_Simple_Renderer::render(
28
+ 'notice',
29
+ array(
30
+ 'class' => 'sui-notice-success',
31
+ 'message' => $notice,
32
+ )
33
+ );
34
  }
35
  ?>
36
  <?php endforeach; ?>
38
  <div class="sui-accordion sui-accordion-flushed">
39
  <?php
40
  foreach ( $lighthouse_group->get_checks() as $check ) {
41
+ $this->render_view( 'lighthouse/lighthouse-check-item', array( 'check' => $check ) );
42
  }
43
  ?>
44
  </div>
includes/admin/templates/lighthouse/lighthouse-report.php CHANGED
@@ -1,65 +1,87 @@
1
  <?php
2
  /**
3
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
 
 
4
  */
 
5
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
6
  if ( ! $lighthouse_report ) {
7
  return;
8
  }
9
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
10
- $is_member = empty( $_view['is_member'] ) ? false : true;
11
  ?>
12
 
13
- <?php if ( $lighthouse_report->is_cooling_down() ) {
14
- $remaining_minutes = $lighthouse_report->get_remaining_cooldown_minutes(); ?>
 
 
15
  <div data-remaining-minutes="<?php echo esc_attr( $remaining_minutes ); ?>">
16
- <?php $this->_render( 'notice', array(
17
- 'class' => 'sui-notice-grey wds-cooldown-notice',
18
- 'message' => sprintf(
19
- _n(
20
- esc_html__( 'SmartCrawl is just catching her breath - you can run another test in %s minute.', 'wds' ),
21
- esc_html__( 'SmartCrawl is just catching her breath - you can run another test in %s minutes.', 'wds' ),
22
- $remaining_minutes
 
 
 
 
 
 
23
  ),
24
- "<span>$remaining_minutes</span>"
25
- ),
26
- ) ); ?>
27
  </div>
28
  <?php } ?>
29
 
30
- <div id="tab_lighthouse"
31
- class="wds-vertical-tab-section wds-lighthouse-device-<?php echo $lighthouse_report->get_device(); ?>">
 
 
 
32
 
33
- <?php $this->_render( 'lighthouse/lighthouse-screenshot-zoom-modal' ); ?>
34
-
35
- <?php foreach ( $lighthouse_report->get_groups() as $group_id => $lighthouse_group ) {
36
- $this->_render( 'vertical-tab', array(
37
- 'tab_id' => $group_id,
38
- 'tab_name' => $lighthouse_group->get_label(),
39
- 'is_active' => 'tab_lighthouse' === $active_tab,
40
- 'button_text' => false,
41
- 'tab_sections' => array(
42
- array(
43
- 'section_template' => 'lighthouse/lighthouse-report-group',
44
- 'section_args' => array(
45
- 'lighthouse_group' => $lighthouse_group,
 
 
46
  ),
47
  ),
48
- ),
49
- ) );
50
- } ?>
 
51
 
52
- <?php if ( ! $is_member ): ?>
53
  <div class="wds-vertical-tab-section <?php echo 'tab_lighthouse' === $active_tab ? '' : 'hidden'; ?>">
54
  <div id="wds-lighthouse-report-upsell-notice">
55
- <?php $this->_render( 'notice', array(
56
- 'class' => 'sui-notice-purple',
57
- 'message' => sprintf(
58
- '%s<br/> <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_lighthouse_report_upsell_notice">%s</a>',
59
- esc_html__( 'Upgrade to Pro to schedule automated tests and send white label email reports directly to your clients. Never miss a beat with your search engine optimization.', 'wds' ),
60
- esc_html__( 'Try it for FREE today', 'wds' )
61
- ),
62
- ) ); ?>
 
 
 
 
 
63
  </div>
64
  </div>
65
  <?php endif; ?>
1
  <?php
2
  /**
3
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
9
  if ( ! $lighthouse_report ) {
10
  return;
11
  }
12
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
13
+ $is_member = ! empty( $_view['is_member'] );
14
  ?>
15
 
16
+ <?php
17
+ if ( $lighthouse_report->is_cooling_down() ) {
18
+ $remaining_minutes = $lighthouse_report->get_remaining_cooldown_minutes();
19
+ ?>
20
  <div data-remaining-minutes="<?php echo esc_attr( $remaining_minutes ); ?>">
21
+ <?php
22
+ $this->render_view(
23
+ 'notice',
24
+ array(
25
+ 'class' => 'sui-notice-grey wds-cooldown-notice',
26
+ 'message' => sprintf(
27
+ _n(
28
+ 'SmartCrawl is just catching her breath - you can run another test in %s minute.',
29
+ 'SmartCrawl is just catching her breath - you can run another test in %s minutes.',
30
+ $remaining_minutes,
31
+ 'wds'
32
+ ),
33
+ "<span>$remaining_minutes</span>"
34
  ),
35
+ )
36
+ );
37
+ ?>
38
  </div>
39
  <?php } ?>
40
 
41
+ <div
42
+ id="tab_lighthouse"
43
+ class="wds-vertical-tab-section wds-lighthouse-device-<?php echo esc_html( $lighthouse_report->get_device() ); ?>"
44
+ >
45
+ <?php $this->render_view( 'lighthouse/lighthouse-screenshot-zoom-modal' ); ?>
46
 
47
+ <?php
48
+ foreach ( $lighthouse_report->get_groups() as $group_id => $lighthouse_group ) {
49
+ $this->render_view(
50
+ 'vertical-tab',
51
+ array(
52
+ 'tab_id' => $group_id,
53
+ 'tab_name' => $lighthouse_group->get_label(),
54
+ 'is_active' => 'tab_lighthouse' === $active_tab,
55
+ 'button_text' => false,
56
+ 'tab_sections' => array(
57
+ array(
58
+ 'section_template' => 'lighthouse/lighthouse-report-group',
59
+ 'section_args' => array(
60
+ 'lighthouse_group' => $lighthouse_group,
61
+ ),
62
  ),
63
  ),
64
+ )
65
+ );
66
+ }
67
+ ?>
68
 
69
+ <?php if ( ! $is_member ) : ?>
70
  <div class="wds-vertical-tab-section <?php echo 'tab_lighthouse' === $active_tab ? '' : 'hidden'; ?>">
71
  <div id="wds-lighthouse-report-upsell-notice">
72
+ <?php
73
+ $this->render_view(
74
+ 'notice',
75
+ array(
76
+ 'class' => 'sui-notice-purple',
77
+ 'message' => sprintf(
78
+ '%s<br/> <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_lighthouse_report_upsell_notice">%s</a>',
79
+ esc_html__( 'Upgrade to Pro to schedule automated tests and send white label email reports directly to your clients. Never miss a beat with your search engine optimization.', 'wds' ),
80
+ esc_html__( 'Try it for FREE today', 'wds' )
81
+ ),
82
+ )
83
+ );
84
+ ?>
85
  </div>
86
  </div>
87
  <?php endif; ?>
includes/admin/templates/lighthouse/lighthouse-reporting-tab.php CHANGED
@@ -1,20 +1,23 @@
1
  <?php
2
- $is_member = empty( $_view['is_member'] ) ? false : true;
3
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
4
  ?>
5
  <form id="wds-reporting-form">
6
  <?php
7
- $this->_render( 'vertical-tab', array(
8
- 'tab_id' => 'tab_reporting',
9
- 'tab_name' => esc_html__( 'Reporting', 'wds' ),
10
- 'is_active' => 'tab_reporting' === $active_tab,
11
- 'title_actions_left' => 'lighthouse/lighthouse-reporting-title-tag',
12
- 'tab_sections' => array(
13
- array(
14
- 'section_template' => 'lighthouse/lighthouse-reporting',
 
 
 
15
  ),
16
- ),
17
- 'button_text' => false,
18
- ) );
19
  ?>
20
  </form>
1
  <?php
2
+ $is_member = ! empty( $_view['is_member'] );
3
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
4
  ?>
5
  <form id="wds-reporting-form">
6
  <?php
7
+ $this->render_view(
8
+ 'vertical-tab',
9
+ array(
10
+ 'tab_id' => 'tab_reporting',
11
+ 'tab_name' => esc_html__( 'Reporting', 'wds' ),
12
+ 'is_active' => 'tab_reporting' === $active_tab,
13
+ 'title_actions_left' => 'lighthouse/lighthouse-reporting-title-tag',
14
+ 'tab_sections' => array(
15
+ array(
16
+ 'section_template' => 'lighthouse/lighthouse-reporting',
17
+ ),
18
  ),
19
+ 'button_text' => false,
20
+ )
21
+ );
22
  ?>
23
  </form>
includes/admin/templates/lighthouse/lighthouse-reporting-title-tag.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $is_member = empty( $_view['is_member'] ) ? false : true;
3
  if ( $is_member ) {
4
  return;
5
  }
1
  <?php
2
+ $is_member = ! empty( $_view['is_member'] );
3
  if ( $is_member ) {
4
  return;
5
  }
includes/admin/templates/lighthouse/lighthouse-reporting.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $toggle_field_name = $option_name . '[lighthouse-cron-enable]';
4
- $is_member = empty( $_view['is_member'] ) ? false : true;
5
  $lighthouse_cron_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_member;
6
- $lighthouse_recipients = Smartcrawl_Lighthouse_Options::email_recipients();
7
- $cron = Smartcrawl_Controller_Cron::get();
8
- $frequencies = $cron->get_frequencies();
9
- $lighthouse_frequency = Smartcrawl_Lighthouse_Options::reporting_frequency();
10
  ?>
11
 
12
  <div>
@@ -15,24 +15,30 @@ $lighthouse_frequency = Smartcrawl_Lighthouse_Options::reporting_frequency();
15
 
16
  <?php
17
  if ( $lighthouse_cron_enabled ) {
18
- $this->_render( 'notice', array(
19
- 'class' => 'sui-notice-info wds-recipient-summary-notice',
20
- 'message' => sprintf(
21
- _n(
22
- 'Automatic Lighthouse reports are enabled and sending %1$s to %2$d recipient.',
23
- 'Automatic Lighthouse reports are enabled and sending %1$s to %2$d recipients.',
24
- count( $lighthouse_recipients ),
25
- 'wds'
 
 
 
 
 
26
  ),
27
- smartcrawl_get_array_value( $frequencies, $lighthouse_frequency ),
28
- count( $lighthouse_recipients )
29
- ),
30
- ) );
31
- } else if ( $is_member ) {
32
- $this->_render( 'notice', array(
33
- 'class' => 'sui-notice-grey wds-recipient-summary-notice',
34
- 'message' => esc_html__( 'Reporting is currently inactive. Activate it and choose your schedule below.', 'wds' ),
35
- ) );
 
36
  }
37
  ?>
38
 
@@ -48,35 +54,42 @@ if ( $lighthouse_cron_enabled ) {
48
 
49
  <div class="sui-box-settings-col-2">
50
  <?php
51
- $this->_render( 'toggle-item', array(
52
- 'field_name' => $toggle_field_name,
53
- 'field_id' => $toggle_field_name,
54
- 'checked' => $lighthouse_cron_enabled,
55
- 'item_label' => esc_html__( 'Send scheduled performance reports', 'wds' ),
56
- 'sub_settings_template' => 'lighthouse/lighthouse-recipients',
57
- 'sub_settings_template_args' => array(
58
- 'option_name' => $option_name,
59
- 'lighthouse_frequency' => $lighthouse_frequency,
60
- 'email_recipients' => $lighthouse_recipients,
61
- ),
62
- ) );
 
 
 
63
  ?>
64
  </div>
65
  </div>
66
 
67
  <?php
68
  if ( ! $is_member ) {
69
- $this->_render( 'mascot-message', array(
70
- 'key' => 'seo-checkup-upsell',
71
- 'dismissible' => false,
72
- 'message' => sprintf(
73
- '%s <strong>%s</strong> <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_lighthouse_reporting_upsell_notice">%s</a>',
74
- esc_html__( 'Upgrade to Pro to unlock unlimited Lighthouse audits with automated scheduled reports to always stay on top of any issues.', 'wds' ),
75
- esc_html__( 'Try it all FREE today!', 'wds' ),
76
- esc_html__( 'Try it FREE today', 'wds' )
77
- ),
78
- ) );
79
- } else { ?>
 
 
 
 
80
  <div class="sui-box-footer">
81
  <button class="sui-button sui-button-blue">
82
  <span class="sui-loading-text">
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $toggle_field_name = $option_name . '[lighthouse-cron-enable]';
4
+ $is_member = ! empty( $_view['is_member'] );
5
  $lighthouse_cron_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_member;
6
+ $lighthouse_recipients = Smartcrawl_Lighthouse_Options::email_recipients();
7
+ $cron = Smartcrawl_Controller_Cron::get();
8
+ $frequencies = $cron->get_frequencies();
9
+ $lighthouse_frequency = Smartcrawl_Lighthouse_Options::reporting_frequency();
10
  ?>
11
 
12
  <div>
15
 
16
  <?php
17
  if ( $lighthouse_cron_enabled ) {
18
+ $this->render_view(
19
+ 'notice',
20
+ array(
21
+ 'class' => 'sui-notice-info wds-recipient-summary-notice',
22
+ 'message' => sprintf(
23
+ _n(
24
+ 'Automatic Lighthouse reports are enabled and sending %1$s to %2$d recipient.',
25
+ 'Automatic Lighthouse reports are enabled and sending %1$s to %2$d recipients.',
26
+ count( $lighthouse_recipients ),
27
+ 'wds'
28
+ ),
29
+ smartcrawl_get_array_value( $frequencies, $lighthouse_frequency ),
30
+ count( $lighthouse_recipients )
31
  ),
32
+ )
33
+ );
34
+ } elseif ( $is_member ) {
35
+ $this->render_view(
36
+ 'notice',
37
+ array(
38
+ 'class' => 'sui-notice-grey wds-recipient-summary-notice',
39
+ 'message' => esc_html__( 'Reporting is currently inactive. Activate it and choose your schedule below.', 'wds' ),
40
+ )
41
+ );
42
  }
43
  ?>
44
 
54
 
55
  <div class="sui-box-settings-col-2">
56
  <?php
57
+ $this->render_view(
58
+ 'toggle-item',
59
+ array(
60
+ 'field_name' => $toggle_field_name,
61
+ 'field_id' => $toggle_field_name,
62
+ 'checked' => $lighthouse_cron_enabled,
63
+ 'item_label' => esc_html__( 'Send scheduled performance reports', 'wds' ),
64
+ 'sub_settings_template' => 'lighthouse/lighthouse-recipients',
65
+ 'sub_settings_template_args' => array(
66
+ 'option_name' => $option_name,
67
+ 'lighthouse_frequency' => $lighthouse_frequency,
68
+ 'email_recipients' => $lighthouse_recipients,
69
+ ),
70
+ )
71
+ );
72
  ?>
73
  </div>
74
  </div>
75
 
76
  <?php
77
  if ( ! $is_member ) {
78
+ $this->render_view(
79
+ 'mascot-message',
80
+ array(
81
+ 'key' => 'seo-checkup-upsell',
82
+ 'dismissible' => false,
83
+ 'message' => sprintf(
84
+ '%s <strong>%s</strong> <a target="_blank" class="sui-button sui-button-purple" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_lighthouse_reporting_upsell_notice">%s</a>',
85
+ esc_html__( 'Upgrade to Pro to unlock unlimited Lighthouse audits with automated scheduled reports to always stay on top of any issues.', 'wds' ),
86
+ esc_html__( 'Try it all FREE today!', 'wds' ),
87
+ esc_html__( 'Try it FREE today', 'wds' )
88
+ ),
89
+ )
90
+ );
91
+ } else {
92
+ ?>
93
  <div class="sui-box-footer">
94
  <button class="sui-button sui-button-blue">
95
  <span class="sui-loading-text">
includes/admin/templates/lighthouse/lighthouse-screenshot-zoom-modal.php CHANGED
@@ -1,5 +1,8 @@
1
  <?php
2
- $this->_render( 'modal', array(
3
- 'id' => 'wds-lighthouse-screenshot-zoom',
4
- 'body_template' => 'noop',
5
- ) );
 
 
 
1
  <?php
2
+ $this->render_view(
3
+ 'modal',
4
+ array(
5
+ 'id' => 'wds-lighthouse-screenshot-zoom',
6
+ 'body_template' => 'noop',
7
+ )
8
+ );
includes/admin/templates/lighthouse/lighthouse-settings.php CHANGED
@@ -1,41 +1,56 @@
1
  <?php
2
- $action_url = empty( $_view['action_url'] ) ? '' : $_view['action_url'];
3
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
 
5
- $this->_render( 'before-page-container' );
6
  $is_reporting_enabled = ! is_multisite() || is_network_admin() || is_main_site();
7
  ?>
8
 
9
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-seo-health-settings wds-lighthouse-settings' ); ?>">
10
- <?php $this->_render( 'page-header', array(
11
- 'title' => esc_html__( 'SEO Health', 'wds' ),
12
- 'documentation_chapter' => 'seo-health',
13
- 'left_actions' => 'lighthouse/lighthouse-header-actions',
14
- 'extra_actions' => 'lighthouse/lighthouse-extra-actions',
15
- 'utm_campaign' => 'smartcrawl_seo-health_docs',
16
- ) ); ?>
 
 
 
 
 
17
 
18
- <?php $this->_render( 'floating-notices', array(
19
- 'keys' => array(
20
- 'wds-email-recipient-notice',
21
- 'wds-lighthouse-audit-copied',
22
- ),
23
- ) ); ?>
 
 
 
 
 
24
 
25
- <?php $this->_render( 'lighthouse/lighthouse-summary' ); ?>
26
 
27
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
28
- <?php $this->_render( 'lighthouse/lighthouse-side-nav', array(
29
- 'is_reporting_enabled' => $is_reporting_enabled,
30
- ) ); ?>
31
- <?php $this->_render( 'lighthouse/lighthouse-tab' ); ?>
 
 
 
 
 
32
  <?php
33
  if ( $is_reporting_enabled ) {
34
- $this->_render( 'lighthouse/lighthouse-reporting-tab' );
35
  }
36
- $this->_render( 'health/health-section-settings' );
37
  ?>
38
  </div>
39
 
40
- <?php $this->_render( 'footer' ); ?>
41
  </div>
1
  <?php
2
+ $action_url = empty( $_view['action_url'] ) ? '' : $_view['action_url'];
3
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
 
5
+ $this->render_view( 'before-page-container' );
6
  $is_reporting_enabled = ! is_multisite() || is_network_admin() || is_main_site();
7
  ?>
8
 
9
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-seo-health-settings wds-lighthouse-settings' ); ?>">
10
+ <?php
11
+ $this->render_view(
12
+ 'page-header',
13
+ array(
14
+ 'title' => esc_html__( 'SEO Health', 'wds' ),
15
+ 'documentation_chapter' => 'seo-health',
16
+ 'left_actions' => 'lighthouse/lighthouse-header-actions',
17
+ 'extra_actions' => 'lighthouse/lighthouse-extra-actions',
18
+ 'utm_campaign' => 'smartcrawl_seo-health_docs',
19
+ )
20
+ );
21
+ ?>
22
 
23
+ <?php
24
+ $this->render_view(
25
+ 'floating-notices',
26
+ array(
27
+ 'keys' => array(
28
+ 'wds-email-recipient-notice',
29
+ 'wds-lighthouse-audit-copied',
30
+ ),
31
+ )
32
+ );
33
+ ?>
34
 
35
+ <?php $this->render_view( 'lighthouse/lighthouse-summary' ); ?>
36
 
37
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
38
+ <?php
39
+ $this->render_view(
40
+ 'lighthouse/lighthouse-side-nav',
41
+ array(
42
+ 'is_reporting_enabled' => $is_reporting_enabled,
43
+ )
44
+ );
45
+ ?>
46
+ <?php $this->render_view( 'lighthouse/lighthouse-tab' ); ?>
47
  <?php
48
  if ( $is_reporting_enabled ) {
49
+ $this->render_view( 'lighthouse/lighthouse-reporting-tab' );
50
  }
51
+ $this->render_view( 'health/health-section-settings' );
52
  ?>
53
  </div>
54
 
55
+ <?php $this->render_view( 'footer' ); ?>
56
  </div>
includes/admin/templates/lighthouse/lighthouse-side-nav.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
- $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
4
  if ( ! $lighthouse_report ) {
5
  return;
6
  }
7
- $is_member = empty( $_view['is_member'] ) ? false : true;
8
  $lighthouse_cron_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_member;
9
- $is_reporting_enabled = empty( $is_reporting_enabled ) ? false : $is_reporting_enabled;
10
 
11
- $tabs = array(
12
  array(
13
  'id' => 'tab_lighthouse',
14
  'name' => esc_html__( 'SEO audits', 'wds' ),
@@ -18,7 +18,7 @@ $tabs = array(
18
  );
19
 
20
  if ( $is_reporting_enabled ) {
21
- $tabs[] = array(
22
  'id' => 'tab_reporting',
23
  'name' => esc_html__( 'Reporting', 'wds' ),
24
  'tag_value' => $is_member ? '' : esc_html__( 'Pro', 'wds' ),
@@ -27,12 +27,15 @@ if ( $is_reporting_enabled ) {
27
  );
28
  }
29
 
30
- $tabs[] = array(
31
  'id' => 'tab_settings',
32
  'name' => esc_html__( 'Settings', 'wds' ),
33
  );
34
 
35
- $this->_render( 'vertical-tabs-side-nav', array(
36
- 'active_tab' => $active_tab,
37
- 'tabs' => $tabs,
38
- ) );
 
 
 
1
  <?php
2
+ $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
4
  if ( ! $lighthouse_report ) {
5
  return;
6
  }
7
+ $is_member = ! empty( $_view['is_member'] );
8
  $lighthouse_cron_enabled = Smartcrawl_Lighthouse_Options::is_cron_enabled() && $is_member;
9
+ $is_reporting_enabled = ! empty( $is_reporting_enabled ) && $is_reporting_enabled;
10
 
11
+ $tab_items = array(
12
  array(
13
  'id' => 'tab_lighthouse',
14
  'name' => esc_html__( 'SEO audits', 'wds' ),
18
  );
19
 
20
  if ( $is_reporting_enabled ) {
21
+ $tab_items[] = array(
22
  'id' => 'tab_reporting',
23
  'name' => esc_html__( 'Reporting', 'wds' ),
24
  'tag_value' => $is_member ? '' : esc_html__( 'Pro', 'wds' ),
27
  );
28
  }
29
 
30
+ $tab_items[] = array(
31
  'id' => 'tab_settings',
32
  'name' => esc_html__( 'Settings', 'wds' ),
33
  );
34
 
35
+ $this->render_view(
36
+ 'vertical-tabs-side-nav',
37
+ array(
38
+ 'active_tab' => $active_tab,
39
+ 'tabs' => $tab_items,
40
+ )
41
+ );
includes/admin/templates/lighthouse/lighthouse-summary.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  $lighthouse_start_time = empty( $lighthouse_start_time ) ? false : $lighthouse_start_time;
3
  /**
 
 
4
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
5
  */
6
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
@@ -8,7 +10,7 @@ if ( ! $lighthouse_report || ! $lighthouse_report->has_data() || $lighthouse_rep
8
  return;
9
  }
10
 
11
- $content_warnings = $lighthouse_report
12
  ->get_group( Smartcrawl_Lighthouse_Report::GROUP_CONTENT )
13
  ->get_failing_count();
14
  $visibility_warnings = $lighthouse_report
@@ -33,18 +35,23 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
33
  <div class="sui-summary-details">
34
  <div id="wds-lighthouse-summary">
35
  <div class="wds-lighthouse-score">
36
- <div class="sui-tooltip sui-tooltip-constrained"
37
- style="--tooltip-width: 240px;"
38
- data-tooltip="<?php echo esc_attr( $lighthouse_report->get_status_message() ); ?>">
39
-
40
- <div class="sui-circle-score sui-circle-score-lg sui-grade-<?php echo esc_attr( $grade ); ?>"
41
- data-score="<?php echo esc_attr( $score ); ?>"></div>
 
 
 
42
  </div>
43
 
44
  <div>
45
  <strong><?php esc_html_e( 'SEO', 'wds' ); ?></strong>
46
- <span class="wds-lighthouse-tooltip sui-tooltip sui-tooltip-constrained"
47
- data-tooltip="<?php esc_html_e( 'Google Lighthouse SEO audits ensure that your page is optimized for search engine results ranking. Fix as many as possible to ensure your site is discoverable.', 'wds' ); ?>">
 
 
48
  <span class="sui-notice-icon sui-icon-info sui-sm" aria-hidden="true"></span>
49
  </span>
50
  <p class="sui-description"><?php esc_html_e( 'Homepage score', 'wds' ); ?></p>
@@ -52,7 +59,7 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
52
  </div>
53
 
54
  <div class="sui-summary-sub">
55
- <strong><?php echo $lighthouse_report->get_last_checked(); ?></strong>
56
  <span><?php esc_html_e( 'Last test date', 'wds' ); ?></span>
57
  </div>
58
  </div>
@@ -64,11 +71,11 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
64
  <li>
65
  <span class="sui-list-label"><?php esc_html_e( 'Content audits', 'wds' ); ?></span>
66
  <span class="sui-list-detail">
67
- <?php if ( $content_warnings ): ?>
68
  <span class="sui-tag sui-tag-warning">
69
  <?php echo esc_html( $content_warnings ); ?>
70
  </span>
71
- <?php else: ?>
72
  <span class="sui-icon-check-tick sui-md sui-success" aria-hidden="true"></span>
73
  <?php endif; ?>
74
  </span>
@@ -77,9 +84,9 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
77
  <li>
78
  <span class="sui-list-label"><?php esc_html_e( 'Indexing audits', 'wds' ); ?></span>
79
  <span class="sui-list-detail">
80
- <?php if ( $visibility_warnings ): ?>
81
  <span class="sui-tag sui-tag-warning"><?php echo esc_html( $visibility_warnings ); ?></span>
82
- <?php else: ?>
83
  <span class="sui-icon-check-tick sui-md sui-success" aria-hidden="true"></span>
84
  <?php endif; ?>
85
  </span>
@@ -90,9 +97,9 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
90
  <?php esc_html_e( 'Responsive audits', 'wds' ); ?>
91
  </span>
92
  <span class="sui-list-detail">
93
- <?php if ( $responsive_warnings ): ?>
94
  <span class="sui-tag sui-tag-warning"><?php echo esc_html( $responsive_warnings ); ?></span>
95
- <?php else: ?>
96
  <span class="sui-icon-check-tick sui-md sui-success" aria-hidden="true"></span>
97
  <?php endif; ?>
98
  </span>
1
  <?php
2
  $lighthouse_start_time = empty( $lighthouse_start_time ) ? false : $lighthouse_start_time;
3
  /**
4
+ * Report.
5
+ *
6
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
7
  */
8
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
10
  return;
11
  }
12
 
13
+ $content_warnings = $lighthouse_report
14
  ->get_group( Smartcrawl_Lighthouse_Report::GROUP_CONTENT )
15
  ->get_failing_count();
16
  $visibility_warnings = $lighthouse_report
35
  <div class="sui-summary-details">
36
  <div id="wds-lighthouse-summary">
37
  <div class="wds-lighthouse-score">
38
+ <div
39
+ class="sui-tooltip sui-tooltip-constrained"
40
+ style="--tooltip-width: 240px;"
41
+ data-tooltip="<?php echo esc_attr( $lighthouse_report->get_status_message() ); ?>"
42
+ >
43
+ <div
44
+ class="sui-circle-score sui-circle-score-lg sui-grade-<?php echo esc_attr( $grade ); ?>"
45
+ data-score="<?php echo esc_attr( $score ); ?>"
46
+ ></div>
47
  </div>
48
 
49
  <div>
50
  <strong><?php esc_html_e( 'SEO', 'wds' ); ?></strong>
51
+ <span
52
+ class="wds-lighthouse-tooltip sui-tooltip sui-tooltip-constrained"
53
+ data-tooltip="<?php esc_html_e( 'Google Lighthouse SEO audits ensure that your page is optimized for search engine results ranking. Fix as many as possible to ensure your site is discoverable.', 'wds' ); ?>"
54
+ >
55
  <span class="sui-notice-icon sui-icon-info sui-sm" aria-hidden="true"></span>
56
  </span>
57
  <p class="sui-description"><?php esc_html_e( 'Homepage score', 'wds' ); ?></p>
59
  </div>
60
 
61
  <div class="sui-summary-sub">
62
+ <strong><?php echo esc_html( $lighthouse_report->get_last_checked() ); ?></strong>
63
  <span><?php esc_html_e( 'Last test date', 'wds' ); ?></span>
64
  </div>
65
  </div>
71
  <li>
72
  <span class="sui-list-label"><?php esc_html_e( 'Content audits', 'wds' ); ?></span>
73
  <span class="sui-list-detail">
74
+ <?php if ( $content_warnings ) : ?>
75
  <span class="sui-tag sui-tag-warning">
76
  <?php echo esc_html( $content_warnings ); ?>
77
  </span>
78
+ <?php else : ?>
79
  <span class="sui-icon-check-tick sui-md sui-success" aria-hidden="true"></span>
80
  <?php endif; ?>
81
  </span>
84
  <li>
85
  <span class="sui-list-label"><?php esc_html_e( 'Indexing audits', 'wds' ); ?></span>
86
  <span class="sui-list-detail">
87
+ <?php if ( $visibility_warnings ) : ?>
88
  <span class="sui-tag sui-tag-warning"><?php echo esc_html( $visibility_warnings ); ?></span>
89
+ <?php else : ?>
90
  <span class="sui-icon-check-tick sui-md sui-success" aria-hidden="true"></span>
91
  <?php endif; ?>
92
  </span>
97
  <?php esc_html_e( 'Responsive audits', 'wds' ); ?>
98
  </span>
99
  <span class="sui-list-detail">
100
+ <?php if ( $responsive_warnings ) : ?>
101
  <span class="sui-tag sui-tag-warning"><?php echo esc_html( $responsive_warnings ); ?></span>
102
+ <?php else : ?>
103
  <span class="sui-icon-check-tick sui-md sui-success" aria-hidden="true"></span>
104
  <?php endif; ?>
105
  </span>
includes/admin/templates/lighthouse/lighthouse-tab.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
- $lighthouse_start_time = empty( $lighthouse_start_time ) ? false : $lighthouse_start_time;
3
  /**
 
 
4
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
5
  */
6
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
@@ -9,9 +11,9 @@ if ( ! $lighthouse_report ) {
9
  }
10
 
11
  if ( $lighthouse_report->has_errors() ) {
12
- $this->_render( 'lighthouse/lighthouse-error' );
13
  } elseif ( ! $lighthouse_report->has_data() || $lighthouse_start_time ) {
14
- $this->_render( 'lighthouse/lighthouse-no-data' );
15
  } else {
16
- $this->_render( 'lighthouse/lighthouse-report' );
17
  }
1
  <?php
2
+ $lighthouse_start_time = ! empty( $lighthouse_start_time );
3
  /**
4
+ * Report.
5
+ *
6
  * @var $lighthouse_report Smartcrawl_Lighthouse_Report
7
  */
8
  $lighthouse_report = empty( $lighthouse_report ) ? false : $lighthouse_report;
11
  }
12
 
13
  if ( $lighthouse_report->has_errors() ) {
14
+ $this->render_view( 'lighthouse/lighthouse-error' );
15
  } elseif ( ! $lighthouse_report->has_data() || $lighthouse_start_time ) {
16
+ $this->render_view( 'lighthouse/lighthouse-no-data' );
17
  } else {
18
+ $this->render_view( 'lighthouse/lighthouse-report' );
19
  }
includes/admin/templates/macros-dropdown.php CHANGED
@@ -3,10 +3,12 @@ $macros = empty( $macros ) ? array() : $macros;
3
  ?>
4
 
5
  <select title="" class="sui-variables">
6
- <?php foreach ( $macros as $macro => $label ): ?>
7
 
8
- <option value="<?php echo esc_attr( $macro ); ?>"
9
- data-content="<?php echo esc_attr( $macro ); ?>">
 
 
10
  <?php echo esc_html( $label ); ?>
11
  </option>
12
  <?php endforeach; ?>
3
  ?>
4
 
5
  <select title="" class="sui-variables">
6
+ <?php foreach ( $macros as $macro => $label ) : ?>
7
 
8
+ <option
9
+ value="<?php echo esc_attr( $macro ); ?>"
10
+ data-content="<?php echo esc_attr( $macro ); ?>"
11
+ >
12
  <?php echo esc_html( $label ); ?>
13
  </option>
14
  <?php endforeach; ?>
includes/admin/templates/mascot-message.php CHANGED
@@ -1,20 +1,22 @@
1
  <?php
2
- $key = empty( $key ) ? '' : $key;
3
- $message = empty( $message ) ? '' : $message;
4
- $dismissible = isset( $dismissible ) ? $dismissible : true;
5
- $image_name = empty( $image_name ) ? 'mascot-message' : $image_name;
6
 
7
  if ( ! $message ) {
8
  return;
9
  }
10
 
11
- $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
12
  $is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $key ) === true;
13
  ?>
14
  <?php if ( ! $is_message_dismissed ) : ?>
15
  <div class="wds-mascot-message sui-box-settings-row sui-upsell-row" data-key="<?php echo esc_attr( $key ); ?>">
16
- <img class="sui-image sui-upsell-image"
17
- src="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>/assets/images/<?php echo esc_attr( $image_name ); ?>.svg"/>
 
 
18
  <div class="sui-upsell-notice">
19
  <p>
20
  <?php if ( $dismissible ) : ?>
1
  <?php
2
+ $key = empty( $key ) ? '' : $key;
3
+ $message = empty( $message ) ? '' : $message;
4
+ $dismissible = ! isset( $dismissible ) || $dismissible;
5
+ $image_name = empty( $image_name ) ? 'mascot-message' : $image_name;
6
 
7
  if ( ! $message ) {
8
  return;
9
  }
10
 
11
+ $dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
12
  $is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $key ) === true;
13
  ?>
14
  <?php if ( ! $is_message_dismissed ) : ?>
15
  <div class="wds-mascot-message sui-box-settings-row sui-upsell-row" data-key="<?php echo esc_attr( $key ); ?>">
16
+ <img
17
+ class="sui-image sui-upsell-image"
18
+ src="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>/assets/images/<?php echo esc_attr( $image_name ); ?>.svg"
19
+ />
20
  <div class="sui-upsell-notice">
21
  <p>
22
  <?php if ( $dismissible ) : ?>
includes/admin/templates/media-item-selector.php CHANGED
@@ -1,18 +1,18 @@
1
  <?php
2
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
 
4
- $id = empty( $id ) ? '' : $id;
5
  $value = empty( $value ) ? '' : $value;
6
- $field = empty( $field ) ? 'id' : $field; // 'url' or 'id'
7
 
8
  $file_name = '';
9
- $url = '';
10
  if ( ! empty( $value ) ) {
11
- if ( $field === 'url' ) {
12
  $url = $value;
13
  } else {
14
  $media_item = wp_get_attachment_image_src( $value, 'full' );
15
- $url = isset( $media_item[0] ) ? $media_item[0] : '';
16
  }
17
 
18
  if ( $url ) {
@@ -22,19 +22,23 @@ if ( ! empty( $value ) ) {
22
  }
23
  ?>
24
 
25
- <div id="<?php echo esc_attr( $id ); ?>"
26
- class="sui-upload <?php echo empty( $url ) ? '' : 'sui-has_file'; ?>"
27
- data-field="<?php echo esc_attr( $field ); ?>">
28
-
29
- <input type="hidden"
30
- name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $id ); ?>]"
31
- value="<?php echo esc_attr( $value ); ?>"
 
 
32
  />
33
  <div class="sui-upload-image" aria-hidden="true">
34
  <div class="sui-image-mask"></div>
35
- <div role="button"
36
- class="sui-image-preview"
37
- style="background-image: url('<?php echo esc_attr( $url ); ?>');">
 
 
38
  </div>
39
  </div>
40
 
1
  <?php
2
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
 
4
+ $id = empty( $id ) ? '' : $id; // phpcs:ignore
5
  $value = empty( $value ) ? '' : $value;
6
+ $field = empty( $field ) ? 'id' : $field;
7
 
8
  $file_name = '';
9
+ $url = '';
10
  if ( ! empty( $value ) ) {
11
+ if ( 'url' === $field ) {
12
  $url = $value;
13
  } else {
14
  $media_item = wp_get_attachment_image_src( $value, 'full' );
15
+ $url = isset( $media_item[0] ) ? $media_item[0] : '';
16
  }
17
 
18
  if ( $url ) {
22
  }
23
  ?>
24
 
25
+ <div
26
+ id="<?php echo esc_attr( $id ); ?>"
27
+ class="sui-upload <?php echo empty( $url ) ? '' : 'sui-has_file'; ?>"
28
+ data-field="<?php echo esc_attr( $field ); ?>"
29
+ >
30
+ <input
31
+ type="hidden"
32
+ name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $id ); ?>]"
33
+ value="<?php echo esc_attr( $value ); ?>"
34
  />
35
  <div class="sui-upload-image" aria-hidden="true">
36
  <div class="sui-image-mask"></div>
37
+ <div
38
+ role="button"
39
+ class="sui-image-preview"
40
+ style="background-image: url('<?php echo esc_attr( $url ); ?>');"
41
+ >
42
  </div>
43
  </div>
44
 
includes/admin/templates/metabox/analysis-readability.php CHANGED
@@ -1,28 +1,31 @@
1
  <?php
2
  /**
3
- * @var $model \Smartcrawl_Model_Analysis
 
 
4
  */
5
- $model = empty( $model ) ? null : $model;
6
- $readability_data = empty( $readability_data ) ? array() : $readability_data;
 
7
  $readability_ignored = empty( $readability_ignored ) ? false : $readability_ignored;
8
- $readability_score = smartcrawl_get_array_value( $readability_data, 'score' );
9
 
10
  if ( null === $model || null === $readability_score ) {
11
  return;
12
  }
13
 
14
- $readability_score = intval( ceil( $readability_score ) );
15
- $readability_level = $model->get_readability_level();
16
  $readability_levels_map = $model->get_readability_levels_map();
17
 
18
  if ( $readability_ignored ) {
19
  $accordion_item_classes_array[] = 'disabled';
20
  }
21
 
22
- $total_possible_score = '100';
23
- $readability_level_description = $model->get_readability_level_description( $readability_level );
24
- $readability_state = $model->get_kincaid_readability_state( $readability_score, $readability_ignored );
25
- $state_class = sprintf(
26
  'sui-%s',
27
  $readability_state
28
  );
@@ -31,21 +34,22 @@ $accordion_item_classes_array[] = sprintf(
31
  'wds-check-%s',
32
  $readability_state
33
  );
34
- $accordion_item_classes = implode( ' ', $accordion_item_classes_array );
35
- $refresh_analysis_disabled = 'auto-draft' === get_post_status() ? 'disabled' : '';
36
- $icon_class = 'success' === $readability_state
37
  ? $state_class . ' sui-icon-check-tick'
38
  : $state_class . ' sui-icon-info';
39
- $tag_class = sprintf(
40
  'sui-tag-%s',
41
  $readability_state
42
  );
43
- $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
44
  ?>
45
 
46
- <div class="wds-readability-report wds-report"
47
- data-readability-state="<?php echo esc_attr( $readability_state ); ?>">
48
-
 
49
  <div id="wds-readability-stats" class="sui-summary sui-summary-sm <?php echo esc_attr( $whitelabel_class ); ?>">
50
  <div class="sui-summary-image-space"></div>
51
 
@@ -53,21 +57,21 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
53
  <div class="sui-summary-details">
54
  <span class="sui-summary-large"><?php echo esc_html( $readability_score ); ?></span>
55
  <span class="<?php echo esc_attr( $icon_class ); ?>"></span>
56
- <?php if ( $total_possible_score ) : ?>
57
- <span class="sui-summary-percent">/<?php echo esc_html( $total_possible_score ); ?></span>
58
- <?php endif; ?>
59
  <span class="sui-summary-sub"><?php esc_html_e( 'Readability score', 'wds' ); ?></span>
60
  </div>
61
  </div>
62
 
63
  <div class="sui-summary-segment">
64
- <?php if ( $readability_level_description ): ?>
65
  <small><?php echo wp_kses( $readability_level_description, array( 'strong' => array() ) ); ?></small>
66
  <br/>
67
  <?php endif; ?>
68
 
69
- <button class="sui-button sui-button-ghost wds-refresh-analysis wds-analysis-readability wds-disabled-during-request"
70
- type="button" <?php echo esc_attr( $refresh_analysis_disabled ); ?>>
 
 
71
  <span class="sui-loading-text">
72
  <span class="sui-icon-update" aria-hidden="true"></span>
73
 
@@ -91,19 +95,29 @@ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
91
  </small>
92
  </p>
93
 
94
- <?php $this->_render( 'notice', array(
95
- 'class' => 'wds-analysis-working',
96
- 'message' => esc_html__( 'Analyzing content, please wait a few moments', 'wds' ),
97
- ) ); ?>
 
 
 
 
 
98
 
99
- <?php $this->_render( 'metabox/metabox-readability-report-inner', array(
100
- 'accordion_item_classes' => $accordion_item_classes,
101
- 'readability_ignored' => $readability_ignored,
102
- 'icon_class' => $icon_class,
103
- 'tag_class' => $tag_class,
104
- 'readability_level' => $readability_level,
105
- 'readability_levels_map' => $readability_levels_map,
106
- ) ); ?>
 
 
 
 
 
107
 
108
  <p class="wds-interstitial-text">
109
  <small><?php esc_html_e( 'More advanced readability tests coming soon.', 'wds' ); ?></small>
1
  <?php
2
  /**
3
+ * @var $model Smartcrawl_Model_Analysis Analysis model.
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
+ $model = empty( $model ) ? null : $model;
9
+ $readability_data = empty( $readability_data ) ? array() : $readability_data;
10
  $readability_ignored = empty( $readability_ignored ) ? false : $readability_ignored;
11
+ $readability_score = smartcrawl_get_array_value( $readability_data, 'score' );
12
 
13
  if ( null === $model || null === $readability_score ) {
14
  return;
15
  }
16
 
17
+ $readability_score = intval( ceil( $readability_score ) );
18
+ $readability_level = $model->get_readability_level();
19
  $readability_levels_map = $model->get_readability_levels_map();
20
 
21
  if ( $readability_ignored ) {
22
  $accordion_item_classes_array[] = 'disabled';
23
  }
24
 
25
+ $total_possible_score = '100';
26
+ $readability_level_description = $model->get_readability_level_description( $readability_level );
27
+ $readability_state = $model->get_kincaid_readability_state( $readability_score, $readability_ignored );
28
+ $state_class = sprintf(
29
  'sui-%s',
30
  $readability_state
31
  );
34
  'wds-check-%s',
35
  $readability_state
36
  );
37
+ $accordion_item_classes = implode( ' ', $accordion_item_classes_array );
38
+ $refresh_analysis_disabled = 'auto-draft' === get_post_status() ? 'disabled' : '';
39
+ $icon_class = 'success' === $readability_state
40
  ? $state_class . ' sui-icon-check-tick'
41
  : $state_class . ' sui-icon-info';
42
+ $tag_class = sprintf(
43
  'sui-tag-%s',
44
  $readability_state
45
  );
46
+ $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
47
  ?>
48
 
49
+ <div
50
+ class="wds-readability-report wds-report"
51
+ data-readability-state="<?php echo esc_attr( $readability_state ); ?>"
52
+ >
53
  <div id="wds-readability-stats" class="sui-summary sui-summary-sm <?php echo esc_attr( $whitelabel_class ); ?>">
54
  <div class="sui-summary-image-space"></div>
55
 
57
  <div class="sui-summary-details">
58
  <span class="sui-summary-large"><?php echo esc_html( $readability_score ); ?></span>
59
  <span class="<?php echo esc_attr( $icon_class ); ?>"></span>
60
+ <span class="sui-summary-percent">/<?php echo esc_html( $total_possible_score ); ?></span>
 
 
61
  <span class="sui-summary-sub"><?php esc_html_e( 'Readability score', 'wds' ); ?></span>
62
  </div>
63
  </div>
64
 
65
  <div class="sui-summary-segment">
66
+ <?php if ( $readability_level_description ) : ?>
67
  <small><?php echo wp_kses( $readability_level_description, array( 'strong' => array() ) ); ?></small>
68
  <br/>
69
  <?php endif; ?>
70
 
71
+ <button
72
+ class="sui-button sui-button-ghost wds-refresh-analysis wds-analysis-readability wds-disabled-during-request"
73
+ type="button" <?php echo esc_attr( $refresh_analysis_disabled ); ?>
74
+ >
75
  <span class="sui-loading-text">
76
  <span class="sui-icon-update" aria-hidden="true"></span>
77
 
95
  </small>
96
  </p>
97
 
98
+ <?php
99
+ $this->render_view(
100
+ 'notice',
101
+ array(
102
+ 'class' => 'wds-analysis-working',
103
+ 'message' => esc_html__( 'Analyzing content, please wait a few moments', 'wds' ),
104
+ )
105
+ );
106
+ ?>
107
 
108
+ <?php
109
+ $this->render_view(
110
+ 'metabox/metabox-readability-report-inner',
111
+ array(
112
+ 'accordion_item_classes' => $accordion_item_classes,
113
+ 'readability_ignored' => $readability_ignored,
114
+ 'icon_class' => $icon_class,
115
+ 'tag_class' => $tag_class,
116
+ 'readability_level' => $readability_level,
117
+ 'readability_levels_map' => $readability_levels_map,
118
+ )
119
+ );
120
+ ?>
121
 
122
  <p class="wds-interstitial-text">
123
  <small><?php esc_html_e( 'More advanced readability tests coming soon.', 'wds' ); ?></small>
includes/admin/templates/metabox/analysis-seo-analysis.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
- $checks = empty( $checks ) ? array() : $checks;
3
- $error_count = empty( $error_count ) ? 0 : $error_count;
4
- $focus_keywords_available = empty( $focus_keywords_available ) ? false : $focus_keywords_available;
5
  $pending_recommendations_message = _n(
6
  'You have %d SEO recommendation. We recommend you satisfy as many improvements as possible to ensure your content gets found.',
7
  'You have %d SEO recommendations. We recommend you satisfy as many improvements as possible to ensure your content gets found.',
@@ -12,44 +12,59 @@ $pending_recommendations_message = _n(
12
 
13
  <?php if ( ! $focus_keywords_available ) : ?>
14
  <div class="wds-seo-analysis wds-no-focus-keywords" data-errors="-1">
15
- <?php $this->_render( 'notice', array(
16
- 'message' => esc_html__( 'You need to add focus keywords to see recommendations for this article.', 'wds' ),
17
- 'class' => 'sui-notice-inactive',
18
- ) ); ?>
 
 
 
 
 
19
  </div>
20
  <?php return; ?>
21
  <?php endif; // phpcs:ignore -- PHPCS misfires here and complains about the return statement above ?>
22
 
23
  <div class="wds-seo-analysis wds-report" data-errors="<?php echo esc_attr( $error_count ); ?>">
24
 
25
- <?php $this->_render( 'notice', array(
26
- 'message' => esc_html__( 'Analyzing content, please wait a few moments', 'wds' ),
27
- 'class' => 'wds-analysis-working',
28
- ) ); ?>
 
 
 
 
 
29
 
30
  <div class="wds-report-inner">
31
- <?php $this->_render( 'notice', array(
32
- 'message' => $error_count > 0
33
- ? sprintf( $pending_recommendations_message, intval( $error_count ) )
34
- : esc_html__( 'All SEO recommendations are met. Your content is as optimized as possible - nice work!', 'wds' ),
35
- 'class' => $error_count > 0 ? 'sui-notice-warning' : 'sui-notice-success',
36
- ) ); ?>
 
 
 
 
 
37
  <div class="wds-accordion sui-accordion">
38
  <?php foreach ( $checks as $check_id => $result ) : ?>
39
  <?php
40
- $passed = $result['status'];
41
- $ignored = $result['ignored'];
42
  $recommendation = $result['recommendation'];
43
- $more_info = $result['more_info'];
44
- $status_msg = $result['status_msg'];
45
 
46
  $classes_array = array();
47
  if ( $ignored ) {
48
  $classes_array[] = 'wds-check-invalid disabled';
49
- $icon_class = 'sui-icon-info';
50
  } else {
51
- $state_class = $passed ? 'sui-success' : 'sui-warning';
52
- $icon_class = $passed
53
  ? $state_class . ' sui-icon-check-tick'
54
  : $state_class . ' sui-icon-info';
55
  $classes_array[] = $state_class;
@@ -57,8 +72,10 @@ $pending_recommendations_message = _n(
57
  }
58
  $classes = implode( ' ', $classes_array );
59
  ?>
60
- <div id="wds-check-<?php echo esc_attr( $check_id ); ?>"
61
- class="wds-check-item sui-accordion-item <?php echo esc_attr( $classes ); ?>">
 
 
62
  <div class="<?php echo $ignored ? 'wds-ignored-item-header' : 'sui-accordion-item-header'; ?>">
63
  <div class="sui-accordion-item-title sui-accordion-col-8">
64
  <span aria-hidden="true" class="<?php echo esc_attr( $icon_class ); ?>"></span>
@@ -66,10 +83,12 @@ $pending_recommendations_message = _n(
66
  </div>
67
  <?php if ( $ignored ) : ?>
68
  <div class="sui-accordion-col-4">
69
- <button type="button"
70
- id="wds-unignore-check-<?php echo esc_attr( $check_id ); ?>"
71
- class="wds-unignore wds-disabled-during-request sui-button sui-button-ghost"
72
- data-check_id="<?php echo esc_attr( $check_id ); ?>">
 
 
73
  <span class="sui-loading-text">
74
  <span class="sui-icon-undo" aria-hidden="true"></span>
75
 
@@ -81,9 +100,11 @@ $pending_recommendations_message = _n(
81
  </div>
82
  <?php else : ?>
83
  <div class="sui-accordion-col-4">
84
- <button class="sui-button-icon sui-accordion-open-indicator"
85
- type="button"
86
- aria-label="<?php esc_html_e( 'Open item', 'wds' ); ?>">
 
 
87
  <span class="sui-icon-chevron-down" aria-hidden="true"></span>
88
  </button>
89
  </div>
@@ -113,10 +134,12 @@ $pending_recommendations_message = _n(
113
 
114
  <?php if ( ! $ignored ) : ?>
115
  <div class="wds-ignore-container">
116
- <button type="button"
117
- id="wds-ignore-check-<?php echo esc_attr( $check_id ); ?>"
118
- class="wds-ignore wds-disabled-during-request sui-button sui-button-ghost"
119
- data-check_id="<?php echo esc_attr( $check_id ); ?>">
 
 
120
  <span class="sui-loading-text">
121
  <span class="sui-icon-eye-hide" aria-hidden="true"></span>
122
 
1
  <?php
2
+ $checks = empty( $checks ) ? array() : $checks;
3
+ $error_count = empty( $error_count ) ? 0 : $error_count;
4
+ $focus_keywords_available = empty( $focus_keywords_available ) ? false : $focus_keywords_available;
5
  $pending_recommendations_message = _n(
6
  'You have %d SEO recommendation. We recommend you satisfy as many improvements as possible to ensure your content gets found.',
7
  'You have %d SEO recommendations. We recommend you satisfy as many improvements as possible to ensure your content gets found.',
12
 
13
  <?php if ( ! $focus_keywords_available ) : ?>
14
  <div class="wds-seo-analysis wds-no-focus-keywords" data-errors="-1">
15
+ <?php
16
+ $this->render_view(
17
+ 'notice',
18
+ array(
19
+ 'message' => esc_html__( 'You need to add focus keywords to see recommendations for this article.', 'wds' ),
20
+ 'class' => 'sui-notice-inactive',
21
+ )
22
+ );
23
+ ?>
24
  </div>
25
  <?php return; ?>
26
  <?php endif; // phpcs:ignore -- PHPCS misfires here and complains about the return statement above ?>
27
 
28
  <div class="wds-seo-analysis wds-report" data-errors="<?php echo esc_attr( $error_count ); ?>">
29
 
30
+ <?php
31
+ $this->render_view(
32
+ 'notice',
33
+ array(
34
+ 'message' => esc_html__( 'Analyzing content, please wait a few moments', 'wds' ),
35
+ 'class' => 'wds-analysis-working',
36
+ )
37
+ );
38
+ ?>
39
 
40
  <div class="wds-report-inner">
41
+ <?php
42
+ $this->render_view(
43
+ 'notice',
44
+ array(
45
+ 'message' => $error_count > 0
46
+ ? sprintf( $pending_recommendations_message, intval( $error_count ) )
47
+ : esc_html__( 'All SEO recommendations are met. Your content is as optimized as possible - nice work!', 'wds' ),
48
+ 'class' => $error_count > 0 ? 'sui-notice-warning' : 'sui-notice-success',
49
+ )
50
+ );
51
+ ?>
52
  <div class="wds-accordion sui-accordion">
53
  <?php foreach ( $checks as $check_id => $result ) : ?>
54
  <?php
55
+ $passed = $result['status'];
56
+ $ignored = $result['ignored'];
57
  $recommendation = $result['recommendation'];
58
+ $more_info = $result['more_info'];
59
+ $status_msg = $result['status_msg'];
60
 
61
  $classes_array = array();
62
  if ( $ignored ) {
63
  $classes_array[] = 'wds-check-invalid disabled';
64
+ $icon_class = 'sui-icon-info';
65
  } else {
66
+ $state_class = $passed ? 'sui-success' : 'sui-warning';
67
+ $icon_class = $passed
68
  ? $state_class . ' sui-icon-check-tick'
69
  : $state_class . ' sui-icon-info';
70
  $classes_array[] = $state_class;
72
  }
73
  $classes = implode( ' ', $classes_array );
74
  ?>
75
+ <div
76
+ id="wds-check-<?php echo esc_attr( $check_id ); ?>"
77
+ class="wds-check-item sui-accordion-item <?php echo esc_attr( $classes ); ?>"
78
+ >
79
  <div class="<?php echo $ignored ? 'wds-ignored-item-header' : 'sui-accordion-item-header'; ?>">
80
  <div class="sui-accordion-item-title sui-accordion-col-8">
81
  <span aria-hidden="true" class="<?php echo esc_attr( $icon_class ); ?>"></span>
83
  </div>
84
  <?php if ( $ignored ) : ?>
85
  <div class="sui-accordion-col-4">
86
+ <button
87
+ type="button"
88
+ id="wds-unignore-check-<?php echo esc_attr( $check_id ); ?>"
89
+ class="wds-unignore wds-disabled-during-request sui-button sui-button-ghost"
90
+ data-check_id="<?php echo esc_attr( $check_id ); ?>"
91
+ >
92
  <span class="sui-loading-text">
93
  <span class="sui-icon-undo" aria-hidden="true"></span>
94
 
100
  </div>
101
  <?php else : ?>
102
  <div class="sui-accordion-col-4">
103
+ <button
104
+ class="sui-button-icon sui-accordion-open-indicator"
105
+ type="button"
106
+ aria-label="<?php esc_html_e( 'Open item', 'wds' ); ?>"
107
+ >
108
  <span class="sui-icon-chevron-down" aria-hidden="true"></span>
109
  </button>
110
  </div>
134
 
135
  <?php if ( ! $ignored ) : ?>
136
  <div class="wds-ignore-container">
137
+ <button
138
+ type="button"
139
+ id="wds-ignore-check-<?php echo esc_attr( $check_id ); ?>"
140
+ class="wds-ignore wds-disabled-during-request sui-button sui-button-ghost"
141
+ data-check_id="<?php echo esc_attr( $check_id ); ?>"
142
+ >
143
  <span class="sui-loading-text">
144
  <span class="sui-icon-eye-hide" aria-hidden="true"></span>
145
 
includes/admin/templates/metabox/horizontal-tab-nav.php CHANGED
@@ -1,33 +1,31 @@
1
  <?php
2
- $tabs = array();
3
  $seo_sections = empty( $seo_sections ) ? array() : $seo_sections;
4
  if ( $seo_sections ) {
5
- $tabs['wds_seo'] = esc_html__( 'SEO', 'wds' );
6
  }
7
 
8
  $readability_sections = empty( $readability_sections ) ? array() : $readability_sections;
9
  if ( $readability_sections ) {
10
- $tabs['wds_readability'] = esc_html__( 'Readability', 'wds' );
11
  }
12
 
13
  $social_sections = empty( $social_sections ) ? array() : $social_sections;
14
  if ( $social_sections ) {
15
- $tabs['wds_social'] = esc_html__( 'Social', 'wds' );
16
  }
17
 
18
  $advanced_sections = empty( $advanced_sections ) ? array() : $advanced_sections;
19
  if ( $advanced_sections ) {
20
- $tabs['wds_advanced'] = esc_html__( 'Advanced', 'wds' );
21
  }
22
  $first_tab = true;
23
  ?>
24
  <div data-tabs>
25
- <?php foreach ( $tabs as $tab_id => $tab_name ) : ?>
26
-
27
  <div class="<?php echo $first_tab ? 'active' : ''; ?> <?php echo esc_attr( $tab_id ); ?>-tab">
28
- <?php echo wp_kses_post( apply_filters( 'wds-metabox-nav-item', $tab_name, $tab_id ) ); ?>
29
  </div>
30
-
31
  <?php $first_tab = false; ?>
32
  <?php endforeach; ?>
33
  </div>
1
  <?php
2
+ $tab_items = array();
3
  $seo_sections = empty( $seo_sections ) ? array() : $seo_sections;
4
  if ( $seo_sections ) {
5
+ $tab_items['wds_seo'] = esc_html__( 'SEO', 'wds' );
6
  }
7
 
8
  $readability_sections = empty( $readability_sections ) ? array() : $readability_sections;
9
  if ( $readability_sections ) {
10
+ $tab_items['wds_readability'] = esc_html__( 'Readability', 'wds' );
11
  }
12
 
13
  $social_sections = empty( $social_sections ) ? array() : $social_sections;
14
  if ( $social_sections ) {
15
+ $tab_items['wds_social'] = esc_html__( 'Social', 'wds' );
16
  }
17
 
18
  $advanced_sections = empty( $advanced_sections ) ? array() : $advanced_sections;
19
  if ( $advanced_sections ) {
20
+ $tab_items['wds_advanced'] = esc_html__( 'Advanced', 'wds' );
21
  }
22
  $first_tab = true;
23
  ?>
24
  <div data-tabs>
25
+ <?php foreach ( $tab_items as $tab_id => $tab_name ) : ?>
 
26
  <div class="<?php echo $first_tab ? 'active' : ''; ?> <?php echo esc_attr( $tab_id ); ?>-tab">
27
+ <?php echo wp_kses_post( apply_filters( 'wds-metabox-nav-item', $tab_name, $tab_id ) ); // phpcs:ignore ?>
28
  </div>
 
29
  <?php $first_tab = false; ?>
30
  <?php endforeach; ?>
31
  </div>
includes/admin/templates/metabox/horizontal-tab.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
- $tab_id = empty( $tab_id ) ? '' : $tab_id;
3
- $is_active = empty( $is_active ) ? false : $is_active;
4
  $content_template = empty( $content_template ) ? '' : $content_template;
5
- $content_args = empty( $content_args ) ? array() : $content_args;
6
  ?>
7
 
8
  <div class="<?php echo esc_attr( $tab_id ); ?> <?php echo $is_active ? 'active' : ''; ?>">
9
- <?php $this->_render( $content_template, $content_args ); ?>
10
  </div>
1
  <?php
2
+ $tab_id = empty( $tab_id ) ? '' : $tab_id;
3
+ $is_active = empty( $is_active ) ? false : $is_active;
4
  $content_template = empty( $content_template ) ? '' : $content_template;
5
+ $content_args = empty( $content_args ) ? array() : $content_args;
6
  ?>
7
 
8
  <div class="<?php echo esc_attr( $tab_id ); ?> <?php echo $is_active ? 'active' : ''; ?>">
9
+ <?php $this->render_view( $content_template, $content_args ); ?>
10
  </div>
includes/admin/templates/metabox/metabox-advanced-autolinks.php CHANGED
@@ -13,12 +13,15 @@ $autolinks_exclude = empty( $autolinks_exclude ) ? false : $autolinks_exclude;
13
  </div>
14
  <div class="sui-box-settings-col-2">
15
  <?php
16
- $this->_render( 'toggle-item', array(
17
- 'inverted' => true,
18
- 'field_name' => 'wds_autolinks-exclude',
19
- 'checked' => $autolinks_exclude,
20
- 'item_label' => esc_html__( 'Enable automatic linking for this post', 'wds' ),
21
- ) );
 
 
 
22
  ?>
23
  </div>
24
  </div>
13
  </div>
14
  <div class="sui-box-settings-col-2">
15
  <?php
16
+ $this->render_view(
17
+ 'toggle-item',
18
+ array(
19
+ 'inverted' => true,
20
+ 'field_name' => 'wds_autolinks-exclude',
21
+ 'checked' => $autolinks_exclude,
22
+ 'item_label' => esc_html__( 'Enable automatic linking for this post', 'wds' ),
23
+ )
24
+ );
25
  ?>
26
  </div>
27
  </div>
includes/admin/templates/metabox/metabox-advanced-canonical.php CHANGED
@@ -2,7 +2,7 @@
2
  $canonical_url = empty( $canonical_url ) ? '' : $canonical_url;
3
  ?>
4
 
5
- <?php if ( apply_filters( 'wds-metabox-visible_parts-canonical_area', true ) ) : ?>
6
  <div class="sui-box-settings-row">
7
  <div class="sui-box-settings-col-1">
8
  <label for="wds_canonical" class="sui-settings-label"><?php esc_html_e( 'Canonical', 'wds' ); ?></label>
@@ -11,11 +11,14 @@ $canonical_url = empty( $canonical_url ) ? '' : $canonical_url;
11
  </p>
12
  </div>
13
  <div class="sui-box-settings-col-2">
14
- <input type='text' id='wds_canonical' name='wds_canonical'
15
- value='<?php echo esc_attr( $canonical_url ); ?>'
16
- class='wds sui-form-control'/>
17
- <span
18
- class="sui-description"><?php esc_html_e( 'Enter the full canonical URL including http:// or https://', 'wds' ); ?></span>
 
 
 
19
  </div>
20
  </div>
21
  <?php endif; ?>
2
  $canonical_url = empty( $canonical_url ) ? '' : $canonical_url;
3
  ?>
4
 
5
+ <?php if ( apply_filters( 'wds-metabox-visible_parts-canonical_area', true ) ) : // phpcs:ignore ?>
6
  <div class="sui-box-settings-row">
7
  <div class="sui-box-settings-col-1">
8
  <label for="wds_canonical" class="sui-settings-label"><?php esc_html_e( 'Canonical', 'wds' ); ?></label>
11
  </p>
12
  </div>
13
  <div class="sui-box-settings-col-2">
14
+ <input
15
+ type="text"
16
+ id="wds_canonical"
17
+ name="wds_canonical"
18
+ value="<?php echo esc_attr( $canonical_url ); ?>"
19
+ class="wds sui-form-control"
20
+ />
21
+ <span class="sui-description"><?php esc_html_e( 'Enter the full canonical URL including http:// or https://', 'wds' ); ?></span>
22
  </div>
23
  </div>
24
  <?php endif; ?>
includes/admin/templates/metabox/metabox-advanced-indexing.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
- $robots_index_value = empty( $robots_index_value ) ? false : true;
3
- $robots_follow_value = empty( $robots_follow_value ) ? false : true;
4
- $robots_noindex_value = empty( $robots_noindex_value ) ? false : $robots_noindex_value;
5
  $robots_nofollow_value = empty( $robots_nofollow_value ) ? false : $robots_nofollow_value;
6
- $advanced_value = empty( $advanced_value ) ? array() : $advanced_value;
7
- $post_type_noindexed = empty( $post_type_noindexed ) ? false : true;
8
- $post_type_nofollowed = empty( $post_type_nofollowed ) ? false : true;
9
  ?>
10
 
11
- <?php if ( apply_filters( 'wds-metabox-visible_parts-robots_area', true ) ) : ?>
12
  <div class="sui-box-settings-row">
13
  <div class="sui-box-settings-col-1">
14
  <label class="sui-settings-label"><?php esc_html_e( 'Indexing', 'wds' ); ?></label>
@@ -19,62 +19,80 @@ $post_type_nofollowed = empty( $post_type_nofollowed ) ? false : true;
19
  <div class="sui-box-settings-col-2">
20
  <?php
21
  if ( $post_type_noindexed ) {
22
- $this->_render( 'toggle-item', array(
23
- 'field_name' => 'wds_meta-robots-index',
24
- 'field_id' => 'wds_meta-robots-index',
25
- 'checked' => $robots_index_value,
26
- 'item_label' => esc_html__( 'Index - Override Post Type Setting', 'wds' ),
27
- 'item_description' => esc_html__( 'Instruct search engines whether or not you want this post to appear in search results.', 'wds' ),
28
- ) );
 
 
 
29
  } else {
30
- $this->_render( 'toggle-item', array(
31
- 'inverted' => true,
32
- 'field_name' => 'wds_meta-robots-noindex',
33
- 'field_id' => 'wds_meta-robots-noindex',
34
- 'checked' => $robots_noindex_value,
35
- 'item_label' => esc_html__( 'Index', 'wds' ),
36
- 'item_description' => esc_html__( 'Instruct search engines whether or not you want this post to appear in search results.', 'wds' ),
37
- ) );
 
 
 
38
  }
39
 
40
  if ( $post_type_nofollowed ) {
41
- $this->_render( 'toggle-item', array(
42
- 'field_name' => 'wds_meta-robots-follow',
43
- 'field_id' => 'wds_meta-robots-follow',
44
- 'checked' => $robots_follow_value,
45
- 'item_label' => esc_html__( 'Follow - Override Post Type Setting', 'wds' ),
46
- 'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your page and crawl them too.', 'wds' ),
47
- ) );
 
 
 
48
  } else {
49
- $this->_render( 'toggle-item', array(
50
- 'inverted' => true,
51
- 'field_name' => 'wds_meta-robots-nofollow',
52
- 'field_id' => 'wds_meta-robots-nofollow',
53
- 'checked' => $robots_nofollow_value,
54
- 'item_label' => esc_html__( 'Follow', 'wds' ),
55
- 'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your page and crawl them too.', 'wds' ),
56
- ) );
 
 
 
57
  }
58
 
59
- $this->_render( 'toggle-item', array(
60
- 'inverted' => true,
61
- 'item_value' => 'noarchive',
62
- 'field_name' => 'wds_meta-robots-adv[noarchive]',
63
- 'field_id' => 'wds_meta-robots-noarchive',
64
- 'checked' => in_array( 'noarchive', $advanced_value, true ),
65
- 'item_label' => esc_html__( 'Archive', 'wds' ),
66
- 'item_description' => esc_html__( 'Instructs search engines to store a cached version of this page.', 'wds' ),
67
- ) );
 
 
 
68
 
69
- $this->_render( 'toggle-item', array(
70
- 'inverted' => true,
71
- 'item_value' => 'nosnippet',
72
- 'field_name' => 'wds_meta-robots-adv[nosnippet]',
73
- 'field_id' => 'wds_meta-robots-nosnippet',
74
- 'checked' => in_array( 'nosnippet', $advanced_value, true ),
75
- 'item_label' => esc_html__( 'Snippet', 'wds' ),
76
- 'item_description' => esc_html__( 'Allows search engines to show a snippet of this page in the search results and prevents them from caching the page.', 'wds' ),
77
- ) );
 
 
 
78
  ?>
79
  </div>
80
  </div>
1
  <?php
2
+ $robots_index_value = ! empty( $robots_index_value );
3
+ $robots_follow_value = ! empty( $robots_follow_value );
4
+ $robots_noindex_value = empty( $robots_noindex_value ) ? false : $robots_noindex_value;
5
  $robots_nofollow_value = empty( $robots_nofollow_value ) ? false : $robots_nofollow_value;
6
+ $advanced_value = empty( $advanced_value ) ? array() : $advanced_value;
7
+ $post_type_noindexed = ! empty( $post_type_noindexed );
8
+ $post_type_nofollowed = ! empty( $post_type_nofollowed );
9
  ?>
10
 
11
+ <?php if ( apply_filters( 'wds-metabox-visible_parts-robots_area', true ) ) : // phpcs:ignore ?>
12
  <div class="sui-box-settings-row">
13
  <div class="sui-box-settings-col-1">
14
  <label class="sui-settings-label"><?php esc_html_e( 'Indexing', 'wds' ); ?></label>
19
  <div class="sui-box-settings-col-2">
20
  <?php
21
  if ( $post_type_noindexed ) {
22
+ $this->render_view(
23
+ 'toggle-item',
24
+ array(
25
+ 'field_name' => 'wds_meta-robots-index',
26
+ 'field_id' => 'wds_meta-robots-index',
27
+ 'checked' => $robots_index_value,
28
+ 'item_label' => esc_html__( 'Index - Override Post Type Setting', 'wds' ),
29
+ 'item_description' => esc_html__( 'Instruct search engines whether or not you want this post to appear in search results.', 'wds' ),
30
+ )
31
+ );
32
  } else {
33
+ $this->render_view(
34
+ 'toggle-item',
35
+ array(
36
+ 'inverted' => true,
37
+ 'field_name' => 'wds_meta-robots-noindex',
38
+ 'field_id' => 'wds_meta-robots-noindex',
39
+ 'checked' => $robots_noindex_value,
40
+ 'item_label' => esc_html__( 'Index', 'wds' ),
41
+ 'item_description' => esc_html__( 'Instruct search engines whether or not you want this post to appear in search results.', 'wds' ),
42
+ )
43
+ );
44
  }
45
 
46
  if ( $post_type_nofollowed ) {
47
+ $this->render_view(
48
+ 'toggle-item',
49
+ array(
50
+ 'field_name' => 'wds_meta-robots-follow',
51
+ 'field_id' => 'wds_meta-robots-follow',
52
+ 'checked' => $robots_follow_value,
53
+ 'item_label' => esc_html__( 'Follow - Override Post Type Setting', 'wds' ),
54
+ 'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your page and crawl them too.', 'wds' ),
55
+ )
56
+ );
57
  } else {
58
+ $this->render_view(
59
+ 'toggle-item',
60
+ array(
61
+ 'inverted' => true,
62
+ 'field_name' => 'wds_meta-robots-nofollow',
63
+ 'field_id' => 'wds_meta-robots-nofollow',
64
+ 'checked' => $robots_nofollow_value,
65
+ 'item_label' => esc_html__( 'Follow', 'wds' ),
66
+ 'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your page and crawl them too.', 'wds' ),
67
+ )
68
+ );
69
  }
70
 
71
+ $this->render_view(
72
+ 'toggle-item',
73
+ array(
74
+ 'inverted' => true,
75
+ 'item_value' => 'noarchive',
76
+ 'field_name' => 'wds_meta-robots-adv[noarchive]',
77
+ 'field_id' => 'wds_meta-robots-noarchive',
78
+ 'checked' => in_array( 'noarchive', $advanced_value, true ),
79
+ 'item_label' => esc_html__( 'Archive', 'wds' ),
80
+ 'item_description' => esc_html__( 'Instructs search engines to store a cached version of this page.', 'wds' ),
81
+ )
82
+ );
83
 
84
+ $this->render_view(
85
+ 'toggle-item',
86
+ array(
87
+ 'inverted' => true,
88
+ 'item_value' => 'nosnippet',
89
+ 'field_name' => 'wds_meta-robots-adv[nosnippet]',
90
+ 'field_id' => 'wds_meta-robots-nosnippet',
91
+ 'checked' => in_array( 'nosnippet', $advanced_value, true ),
92
+ 'item_label' => esc_html__( 'Snippet', 'wds' ),
93
+ 'item_description' => esc_html__( 'Allows search engines to show a snippet of this page in the search results and prevents them from caching the page.', 'wds' ),
94
+ )
95
+ );
96
  ?>
97
  </div>
98
  </div>
includes/admin/templates/metabox/metabox-advanced-redirect.php CHANGED
@@ -1,21 +1,27 @@
1
  <?php
2
- $redirect_url = empty( $redirect_url ) ? '' : $redirect_url;
3
- $has_permission = empty( $has_permission ) ? false : $has_permission;
4
  ?>
5
 
6
- <?php if ( apply_filters( 'wds-metabox-visible_parts-redirect_area', true ) && $has_permission ) : ?>
7
  <div class="sui-box-settings-row">
8
  <div class="sui-box-settings-col-1">
9
- <label for="wds_redirect"
10
- class="sui-settings-label"><?php esc_html_e( '301 Redirect', 'wds' ); ?></label>
 
 
11
  <p class="sui-description">
12
  <?php esc_html_e( 'Send visitors to this URL to another page.', 'wds' ); ?>
13
  </p>
14
  </div>
15
  <div class="sui-box-settings-col-2">
16
- <input type='text' id='wds_redirect' name='wds_redirect'
17
- value='<?php echo esc_attr( $redirect_url ); ?>'
18
- class='wds sui-form-control'/>
 
 
 
 
19
  <span class="sui-description">
20
  <?php esc_html_e( 'Enter the URL to send traffic to including http:// or https://', 'wds' ); ?>
21
  </span>
1
  <?php
2
+ $redirect_url = empty( $redirect_url ) ? '' : $redirect_url;
3
+ $has_permission = ! empty( $has_permission ) && $has_permission;
4
  ?>
5
 
6
+ <?php if ( apply_filters( 'wds-metabox-visible_parts-redirect_area', true ) && $has_permission ) : // phpcs:ignore ?>
7
  <div class="sui-box-settings-row">
8
  <div class="sui-box-settings-col-1">
9
+ <label
10
+ for="wds_redirect"
11
+ class="sui-settings-label"
12
+ ><?php esc_html_e( '301 Redirect', 'wds' ); ?></label>
13
  <p class="sui-description">
14
  <?php esc_html_e( 'Send visitors to this URL to another page.', 'wds' ); ?>
15
  </p>
16
  </div>
17
  <div class="sui-box-settings-col-2">
18
+ <input
19
+ type='text'
20
+ id='wds_redirect'
21
+ name='wds_redirect'
22
+ value='<?php echo esc_attr( $redirect_url ); ?>'
23
+ class='wds sui-form-control'
24
+ />
25
  <span class="sui-description">
26
  <?php esc_html_e( 'Enter the URL to send traffic to including http:// or https://', 'wds' ); ?>
27
  </span>
includes/admin/templates/metabox/metabox-advanced-sitemap-priority.php CHANGED
@@ -1,20 +1,23 @@
1
  <?php
2
  $sitemap_priority_options = empty( $sitemap_priority_options ) ? array() : $sitemap_priority_options;
3
- $sitemap_priority = empty( $sitemap_priority ) ? '' : $sitemap_priority;
4
  ?>
5
 
6
- <?php if ( apply_filters( 'wds-metabox-visible_parts-sitemap_priority_area', true ) ) : ?>
7
  <div class="sui-box-settings-row">
8
  <div class="sui-box-settings-col-1">
9
- <label for='wds_sitemap-priority'
10
- class="sui-settings-label"><?php esc_html_e( 'Sitemap Priority', 'wds' ); ?></label>
 
 
11
  </div>
12
  <div class="sui-box-settings-col-2">
13
- <select name='wds_sitemap-priority'
14
- id='wds_sitemap-priority'
15
- class="sui-select"
16
- data-minimum-results-for-search="-1">
17
-
 
18
  <?php foreach ( $sitemap_priority_options as $key => $label ) : ?>
19
  <option value='<?php echo esc_attr( $key ); ?>' <?php selected( $key, $sitemap_priority ); ?>>
20
  <?php echo esc_html( $label ); ?>
1
  <?php
2
  $sitemap_priority_options = empty( $sitemap_priority_options ) ? array() : $sitemap_priority_options;
3
+ $sitemap_priority = empty( $sitemap_priority ) ? '' : $sitemap_priority;
4
  ?>
5
 
6
+ <?php if ( apply_filters( 'wds-metabox-visible_parts-sitemap_priority_area', true ) ) : // phpcs:ignore ?>
7
  <div class="sui-box-settings-row">
8
  <div class="sui-box-settings-col-1">
9
+ <label
10
+ for='wds_sitemap-priority'
11
+ class="sui-settings-label"
12
+ ><?php esc_html_e( 'Sitemap Priority', 'wds' ); ?></label>
13
  </div>
14
  <div class="sui-box-settings-col-2">
15
+ <select
16
+ name='wds_sitemap-priority'
17
+ id='wds_sitemap-priority'
18
+ class="sui-select"
19
+ data-minimum-results-for-search="-1"
20
+ >
21
  <?php foreach ( $sitemap_priority_options as $key => $label ) : ?>
22
  <option value='<?php echo esc_attr( $key ); ?>' <?php selected( $key, $sitemap_priority ); ?>>
23
  <?php echo esc_html( $label ); ?>
includes/admin/templates/metabox/metabox-dummy-preview.php CHANGED
@@ -1,9 +1,8 @@
1
  <div class="wds-metabox-preview">
2
- <label class="sui-label"><?php esc_html_e( 'Google Preview' ); ?></label>
3
-
4
  <?php
5
- if ( apply_filters( 'wds-metabox-visible_parts-preview_area', true ) ) {
6
- $this->_render( 'onpage/onpage-preview' );
7
- }
8
  ?>
9
  </div>
1
  <div class="wds-metabox-preview">
2
+ <label class="sui-label"><?php esc_html_e( 'Google Preview', 'wds' ); ?></label>
 
3
  <?php
4
+ if ( apply_filters( 'wds-metabox-visible_parts-preview_area', true ) ) : // phpcs:ignore
5
+ $this->render_view( 'onpage/onpage-preview' );
6
+ endif;
7
  ?>
8
  </div>
includes/admin/templates/metabox/metabox-main.php CHANGED
@@ -2,73 +2,92 @@
2
  /**
3
  * Metabox entry point template
4
  *
 
 
5
  * @package wpmu-dev-seo
6
  */
7
 
8
- $post = empty( $post ) ? null : $post;
9
- $seo_sections = apply_filters( 'wds-sections-metabox-seo', array(), $post );
10
  $readability_sections = apply_filters( 'wds-sections-metabox-readability', array(), $post );
11
- $social_sections = apply_filters( 'wds-sections-metabox-social', array(), $post );
12
- $advanced_sections = apply_filters( 'wds-sections-metabox-advanced', array(), $post );
13
- $is_active = true;
14
  ?>
15
  <div class="<?php echo esc_attr( smartcrawl_sui_class() ); ?>">
16
  <div class="<?php smartcrawl_wrap_class( 'wds-metabox' ); ?>">
17
  <div class="sui-tabs">
18
  <?php wp_nonce_field( 'wds-metabox-nonce', '_wds_nonce' ); ?>
19
- <?php $this->_render( 'metabox/horizontal-tab-nav', array(
20
- 'seo_sections' => $seo_sections,
21
- 'readability_sections' => $readability_sections,
22
- 'social_sections' => $social_sections,
23
- 'advanced_sections' => $advanced_sections,
24
- ) ); ?>
 
 
 
 
 
25
  <div data-panes>
26
  <?php
27
  if ( $seo_sections ) {
28
- $this->_render( 'metabox/horizontal-tab', array(
29
- 'tab_id' => 'wds_seo',
30
- 'is_active' => $is_active,
31
- 'content_template' => 'metabox/metabox-tab-seo',
32
- 'content_args' => array(
33
- 'seo_sections' => $seo_sections,
34
- ),
35
- ) );
 
 
 
36
  $is_active = false;
37
  }
38
 
39
  if ( $readability_sections ) {
40
- $this->_render( 'metabox/horizontal-tab', array(
41
- 'tab_id' => 'wds_readability',
42
- 'is_active' => $is_active,
43
- 'content_template' => 'metabox/metabox-tab-readability',
44
- 'content_args' => array(
45
- 'readability_sections' => $readability_sections,
46
- ),
47
- ) );
 
 
 
48
  $is_active = false;
49
  }
50
 
51
  if ( $social_sections ) {
52
- $this->_render( 'metabox/horizontal-tab', array(
53
- 'tab_id' => 'wds_social',
54
- 'is_active' => $is_active,
55
- 'content_template' => 'metabox/metabox-tab-social',
56
- 'content_args' => array(
57
- 'social_sections' => $social_sections,
58
- ),
59
- ) );
 
 
 
60
  $is_active = false;
61
  }
62
 
63
  if ( $advanced_sections ) {
64
- $this->_render( 'metabox/horizontal-tab', array(
65
- 'tab_id' => 'wds_advanced',
66
- 'is_active' => $is_active,
67
- 'content_template' => 'metabox/metabox-tab-advanced',
68
- 'content_args' => array(
69
- 'advanced_sections' => $advanced_sections,
70
- ),
71
- ) );
 
 
 
72
  $is_active = false;
73
  }
74
  ?>
2
  /**
3
  * Metabox entry point template
4
  *
5
+ * phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
6
+ *
7
  * @package wpmu-dev-seo
8
  */
9
 
10
+ $post = empty( $post ) ? null : $post; // phpcs:ignore
11
+ $seo_sections = apply_filters( 'wds-sections-metabox-seo', array(), $post );
12
  $readability_sections = apply_filters( 'wds-sections-metabox-readability', array(), $post );
13
+ $social_sections = apply_filters( 'wds-sections-metabox-social', array(), $post );
14
+ $advanced_sections = apply_filters( 'wds-sections-metabox-advanced', array(), $post );
15
+ $is_active = true;
16
  ?>
17
  <div class="<?php echo esc_attr( smartcrawl_sui_class() ); ?>">
18
  <div class="<?php smartcrawl_wrap_class( 'wds-metabox' ); ?>">
19
  <div class="sui-tabs">
20
  <?php wp_nonce_field( 'wds-metabox-nonce', '_wds_nonce' ); ?>
21
+ <?php
22
+ $this->render_view(
23
+ 'metabox/horizontal-tab-nav',
24
+ array(
25
+ 'seo_sections' => $seo_sections,
26
+ 'readability_sections' => $readability_sections,
27
+ 'social_sections' => $social_sections,
28
+ 'advanced_sections' => $advanced_sections,
29
+ )
30
+ );
31
+ ?>
32
  <div data-panes>
33
  <?php
34
  if ( $seo_sections ) {
35
+ $this->render_view(
36
+ 'metabox/horizontal-tab',
37
+ array(
38
+ 'tab_id' => 'wds_seo',
39
+ 'is_active' => $is_active,
40
+ 'content_template' => 'metabox/metabox-tab-seo',
41
+ 'content_args' => array(
42
+ 'seo_sections' => $seo_sections,
43
+ ),
44
+ )
45
+ );
46
  $is_active = false;
47
  }
48
 
49
  if ( $readability_sections ) {
50
+ $this->render_view(
51
+ 'metabox/horizontal-tab',
52
+ array(
53
+ 'tab_id' => 'wds_readability',
54
+ 'is_active' => $is_active,
55
+ 'content_template' => 'metabox/metabox-tab-readability',
56
+ 'content_args' => array(
57
+ 'readability_sections' => $readability_sections,
58
+ ),
59
+ )
60
+ );
61
  $is_active = false;
62
  }
63
 
64
  if ( $social_sections ) {
65
+ $this->render_view(
66
+ 'metabox/horizontal-tab',
67
+ array(
68
+ 'tab_id' => 'wds_social',
69
+ 'is_active' => $is_active,
70
+ 'content_template' => 'metabox/metabox-tab-social',
71
+ 'content_args' => array(
72
+ 'social_sections' => $social_sections,
73
+ ),
74
+ )
75
+ );
76
  $is_active = false;
77
  }
78
 
79
  if ( $advanced_sections ) {
80
+ $this->render_view(
81
+ 'metabox/horizontal-tab',
82
+ array(
83
+ 'tab_id' => 'wds_advanced',
84
+ 'is_active' => $is_active,
85
+ 'content_template' => 'metabox/metabox-tab-advanced',
86
+ 'content_args' => array(
87
+ 'advanced_sections' => $advanced_sections,
88
+ ),
89
+ )
90
+ );
91
  $is_active = false;
92
  }
93
  ?>
includes/admin/templates/metabox/metabox-meta-edit-form.php CHANGED
@@ -1,7 +1,7 @@
1
- <?php
2
- $post = empty( $post ) ? null : $post;
3
  if ( $post ) {
4
- $post_id = $post->ID;
5
  } else {
6
  return;
7
  }
@@ -22,16 +22,17 @@ $macros = array_merge(
22
  <div class="sui-form-field">
23
  <label class="sui-label" for="wds_title">
24
  <?php esc_html_e( 'SEO Title', 'wds' ); ?>
25
- <span><?php echo esc_html( sprintf( __( '- Include your focus keywords. %d-%d characters recommended.', 'wds' ), smartcrawl_title_min_length(), smartcrawl_title_max_length() ) ); ?></span>
26
  </label>
27
  <div class="sui-insert-variables wds-allow-macros">
28
- <input type='text'
29
- id='wds_title'
30
- name='wds_title'
31
- value='<?php echo esc_html( smartcrawl_get_value( 'title', $post_id ) ); ?>'
32
- class='sui-form-control wds-meta-field'/>
33
-
34
- <?php $this->_render( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
 
35
  </div>
36
  </div>
37
  <?php endif; ?>
@@ -40,15 +41,17 @@ $macros = array_merge(
40
  <div class="sui-form-field">
41
  <label class="sui-label" for="wds_metadesc">
42
  <?php esc_html_e( 'Description', 'wds' ); ?>
43
- <span><?php echo esc_html( sprintf( __( '- Recommended minimum of %d characters, maximum %d.', 'wds' ), smartcrawl_metadesc_min_length(), smartcrawl_metadesc_max_length() ) ); ?></span>
44
  </label>
45
  <div class="sui-insert-variables wds-allow-macros">
46
- <textarea rows='2'
47
- name='wds_metadesc'
48
- id='wds_metadesc'
49
- class='sui-form-control wds-meta-field'><?php echo esc_textarea( smartcrawl_get_value( 'metadesc', $post_id ) ); ?></textarea>
 
 
50
 
51
- <?php $this->_render( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
52
  </div>
53
  </div>
54
  <?php endif; ?>
1
+ <?php // phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
2
+ $post = empty( $post ) ? null : $post; // phpcs:ignore
3
  if ( $post ) {
4
+ $post_id = $post->ID; // phpcs:ignore
5
  } else {
6
  return;
7
  }
22
  <div class="sui-form-field">
23
  <label class="sui-label" for="wds_title">
24
  <?php esc_html_e( 'SEO Title', 'wds' ); ?>
25
+ <span><?php echo esc_html( sprintf( __( '- Include your focus keywords. %1$d-%2$d characters recommended.', 'wds' ), smartcrawl_title_min_length(), smartcrawl_title_max_length() ) ); ?></span>
26
  </label>
27
  <div class="sui-insert-variables wds-allow-macros">
28
+ <input
29
+ type='text'
30
+ id='wds_title'
31
+ name='wds_title'
32
+ value='<?php echo esc_html( smartcrawl_get_value( 'title', $post_id ) ); ?>'
33
+ class='sui-form-control wds-meta-field'
34
+ />
35
+ <?php $this->render_view( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
36
  </div>
37
  </div>
38
  <?php endif; ?>
41
  <div class="sui-form-field">
42
  <label class="sui-label" for="wds_metadesc">
43
  <?php esc_html_e( 'Description', 'wds' ); ?>
44
+ <span><?php echo esc_html( sprintf( __( '- Recommended minimum of %1$d characters, maximum %2$d.', 'wds' ), smartcrawl_metadesc_min_length(), smartcrawl_metadesc_max_length() ) ); ?></span>
45
  </label>
46
  <div class="sui-insert-variables wds-allow-macros">
47
+ <textarea
48
+ rows='2'
49
+ name='wds_metadesc'
50
+ id='wds_metadesc'
51
+ class='sui-form-control wds-meta-field'
52
+ ><?php echo esc_textarea( smartcrawl_get_value( 'metadesc', $post_id ) ); ?></textarea>
53
 
54
+ <?php $this->render_view( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
55
  </div>
56
  </div>
57
  <?php endif; ?>
includes/admin/templates/metabox/metabox-readability-report-inner.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  $accordion_item_classes = empty( $accordion_item_classes ) ? '' : $accordion_item_classes;
3
- $readability_ignored = empty( $readability_ignored ) ? false : $readability_ignored;
4
- $icon_class = empty( $icon_class ) ? '' : $icon_class;
5
- $tag_class = empty( $tag_class ) ? '' : $tag_class;
6
- $readability_level = empty( $readability_level ) ? '' : $readability_level;
7
  $readability_levels_map = empty( $readability_levels_map ) ? array() : $readability_levels_map;
8
  ?>
9
 
@@ -18,9 +18,11 @@ $readability_levels_map = empty( $readability_levels_map ) ? array() : $readabil
18
 
19
  <?php if ( $readability_ignored ) : ?>
20
  <div class="sui-accordion-col-4">
21
- <button type="button"
22
- class="wds-unignore wds-disabled-during-request sui-button sui-button-ghost"
23
- data-check_id="readability">
 
 
24
  <span class="sui-loading-text">
25
  <span class="sui-icon-undo" aria-hidden="true"></span>
26
 
@@ -36,9 +38,11 @@ $readability_levels_map = empty( $readability_levels_map ) ? array() : $readabil
36
  <?php echo esc_html( $readability_level ); ?>
37
  </span>
38
 
39
- <button class="sui-button-icon sui-accordion-open-indicator"
40
- type="button"
41
- aria-label="<?php esc_html_e( 'Open item', 'wds' ); ?>">
 
 
42
  <span class="sui-icon-chevron-down" aria-hidden="true"></span>
43
  </button>
44
  </div>
@@ -82,9 +86,11 @@ $readability_levels_map = empty( $readability_levels_map ) ? array() : $readabil
82
  </p>
83
 
84
  <div class="wds-ignore-container">
85
- <button type="button"
86
- class="wds-ignore wds-disabled-during-request sui-button sui-button-ghost"
87
- data-check_id="readability">
 
 
88
  <span class="sui-loading-text">
89
  <span class="sui-icon-eye-hide" aria-hidden="true"></span>
90
 
1
  <?php
2
  $accordion_item_classes = empty( $accordion_item_classes ) ? '' : $accordion_item_classes;
3
+ $readability_ignored = empty( $readability_ignored ) ? false : $readability_ignored;
4
+ $icon_class = empty( $icon_class ) ? '' : $icon_class;
5
+ $tag_class = empty( $tag_class ) ? '' : $tag_class;
6
+ $readability_level = empty( $readability_level ) ? '' : $readability_level;
7
  $readability_levels_map = empty( $readability_levels_map ) ? array() : $readability_levels_map;
8
  ?>
9
 
18
 
19
  <?php if ( $readability_ignored ) : ?>
20
  <div class="sui-accordion-col-4">
21
+ <button
22
+ type="button"
23
+ class="wds-unignore wds-disabled-during-request sui-button sui-button-ghost"
24
+ data-check_id="readability"
25
+ >
26
  <span class="sui-loading-text">
27
  <span class="sui-icon-undo" aria-hidden="true"></span>
28
 
38
  <?php echo esc_html( $readability_level ); ?>
39
  </span>
40
 
41
+ <button
42
+ class="sui-button-icon sui-accordion-open-indicator"
43
+ type="button"
44
+ aria-label="<?php esc_html_e( 'Open item', 'wds' ); ?>"
45
+ >
46
  <span class="sui-icon-chevron-down" aria-hidden="true"></span>
47
  </button>
48
  </div>
86
  </p>
87
 
88
  <div class="wds-ignore-container">
89
+ <button
90
+ type="button"
91
+ class="wds-ignore wds-disabled-during-request sui-button sui-button-ghost"
92
+ data-check_id="readability"
93
+ >
94
  <span class="sui-loading-text">
95
  <span class="sui-icon-eye-hide" aria-hidden="true"></span>
96
 
includes/admin/templates/metabox/metabox-readability.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
- $post = empty( $post ) ? null : $post;
3
 
4
  if ( ! $post ) {
5
  return false;
6
  }
7
  ?>
8
  <div class="wds-readability-analysis-container">
9
- <?php do_action( 'wds-editor-metabox-readability-analysis', $post ); ?>
10
  </div>
1
  <?php
2
+ $post = empty( $post ) ? null : $post; // phpcs:ignore
3
 
4
  if ( ! $post ) {
5
  return false;
6
  }
7
  ?>
8
  <div class="wds-readability-analysis-container">
9
+ <?php do_action( 'wds-editor-metabox-readability-analysis', $post ); // phpcs:ignore ?>
10
  </div>
includes/admin/templates/metabox/metabox-seo-analysis-container.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
- $post = empty( $post ) ? null : $post;
3
  $refresh_button_disabled = 'auto-draft' === get_post_status() ? 'disabled' : '';
4
  if ( $post ) {
5
- $post_id = $post->ID;
6
  } else {
7
  return;
8
  }
@@ -14,8 +14,8 @@ if ( $post ) {
14
  <strong><?php esc_html_e( 'SEO Analysis', 'wds' ); ?></strong>
15
 
16
  <button <?php esc_attr( $refresh_button_disabled ); ?>
17
- class="sui-button sui-button-ghost wds-refresh-analysis wds-analysis-seo wds-disabled-during-request"
18
- type="button">
19
  <span class="sui-loading-text">
20
  <span class="sui-icon-update" aria-hidden="true"></span>
21
 
@@ -28,36 +28,43 @@ if ( $post ) {
28
 
29
  <div class="sui-box-body">
30
  <?php
31
- $this->_render( 'mascot-message', array(
32
- 'key' => 'metabox-seo-analysis',
33
- 'message' => esc_html__( 'This tool helps you optimize your content to give it the best chance of being found in search engines when people are looking for it. Start by choosing a few focus keywords that best describe your article, then SmartCrawl will give you recommendations to make sure your content is highly optimized.', 'wds' ),
34
- ) );
 
 
 
35
  ?>
36
  </div>
37
 
38
- <?php if ( apply_filters( 'wds-metabox-visible_parts-focus_area', true ) ) : ?>
39
  <div class="wds-focus-keyword sui-border-frame sui-form-field">
40
  <label class="sui-label" for='wds_focus'>
41
  <?php esc_html_e( 'Focus keyword', 'wds' ); ?>
42
  <span>
43
  <?php esc_html_e( '- Choose a single word, phrase or part of a sentence that people will likely search for. You can also use multiple keywords separated by commas.', 'wds' ); ?>
44
- <span class="sui-tooltip sui-tooltip-constrained"
45
- style="--tooltip-width: 250px;"
46
- data-tooltip="<?php esc_html_e( 'As a general rule, using only one keyword per page/post is recommended.', 'wds' ); ?>">
 
 
47
  <span class="sui-icon-info">
48
  </span>
49
  </span>
50
  </span>
51
  </label>
52
- <input type='text'
53
- id='wds_focus'
54
- name='wds_focus'
55
- value='<?php echo esc_html( smartcrawl_get_value( 'focus-keywords', $post_id ) ); ?>'
56
- class='wds-disabled-during-request sui-form-control'
57
- placeholder="<?php esc_html_e( 'E.g. broken iphone screen', 'wds' ); ?>"/>
 
 
58
  </div>
59
  <?php endif; ?>
60
 
61
- <?php do_action( 'wds-editor-metabox-seo-analysis', $post ); ?>
62
  </div>
63
  </div>
1
  <?php
2
+ $post = empty( $post ) ? null : $post; // phpcs:ignore
3
  $refresh_button_disabled = 'auto-draft' === get_post_status() ? 'disabled' : '';
4
  if ( $post ) {
5
+ $post_id = $post->ID; // phpcs:ignore
6
  } else {
7
  return;
8
  }
14
  <strong><?php esc_html_e( 'SEO Analysis', 'wds' ); ?></strong>
15
 
16
  <button <?php esc_attr( $refresh_button_disabled ); ?>
17
+ class="sui-button sui-button-ghost wds-refresh-analysis wds-analysis-seo wds-disabled-during-request"
18
+ type="button">
19
  <span class="sui-loading-text">
20
  <span class="sui-icon-update" aria-hidden="true"></span>
21
 
28
 
29
  <div class="sui-box-body">
30
  <?php
31
+ $this->render_view(
32
+ 'mascot-message',
33
+ array(
34
+ 'key' => 'metabox-seo-analysis',
35
+ 'message' => esc_html__( 'This tool helps you optimize your content to give it the best chance of being found in search engines when people are looking for it. Start by choosing a few focus keywords that best describe your article, then SmartCrawl will give you recommendations to make sure your content is highly optimized.', 'wds' ),
36
+ )
37
+ );
38
  ?>
39
  </div>
40
 
41
+ <?php if ( apply_filters( 'wds-metabox-visible_parts-focus_area', true ) ) : // phpcs:ignore ?>
42
  <div class="wds-focus-keyword sui-border-frame sui-form-field">
43
  <label class="sui-label" for='wds_focus'>
44
  <?php esc_html_e( 'Focus keyword', 'wds' ); ?>
45
  <span>
46
  <?php esc_html_e( '- Choose a single word, phrase or part of a sentence that people will likely search for. You can also use multiple keywords separated by commas.', 'wds' ); ?>
47
+ <span
48
+ class="sui-tooltip sui-tooltip-constrained"
49
+ style="--tooltip-width: 250px;"
50
+ data-tooltip="<?php esc_html_e( 'As a general rule, using only one keyword per page/post is recommended.', 'wds' ); ?>"
51
+ >
52
  <span class="sui-icon-info">
53
  </span>
54
  </span>
55
  </span>
56
  </label>
57
+ <input
58
+ type='text'
59
+ id='wds_focus'
60
+ name='wds_focus'
61
+ value='<?php echo esc_html( smartcrawl_get_value( 'focus-keywords', $post_id ) ); ?>'
62
+ class='wds-disabled-during-request sui-form-control'
63
+ placeholder="<?php esc_html_e( 'E.g. broken iphone screen', 'wds' ); ?>"
64
+ />
65
  </div>
66
  <?php endif; ?>
67
 
68
+ <?php do_action( 'wds-editor-metabox-seo-analysis', $post ); // phpcs:ignore ?>
69
  </div>
70
  </div>
includes/admin/templates/metabox/metabox-seo-meta.php CHANGED
@@ -1,10 +1,15 @@
1
- <?php $post = empty( $post ) ? null : $post; ?>
2
  <div class="wds-metabox-section">
3
  <?php
4
- $this->_render( 'metabox/metabox-dummy-preview' );
5
  ?>
6
 
7
- <?php $this->_render( 'metabox/metabox-meta-edit-form', array(
8
- 'post' => $post,
9
- ) ); ?>
 
 
 
 
 
10
  </div>
1
+ <?php $post = empty( $post ) ? null : $post; // phpcs:ignore ?>
2
  <div class="wds-metabox-section">
3
  <?php
4
+ $this->render_view( 'metabox/metabox-dummy-preview' );
5
  ?>
6
 
7
+ <?php
8
+ $this->render_view(
9
+ 'metabox/metabox-meta-edit-form',
10
+ array(
11
+ 'post' => $post,
12
+ )
13
+ );
14
+ ?>
15
  </div>
includes/admin/templates/metabox/metabox-social-meta-tags-sub-settings.php CHANGED
@@ -1,68 +1,86 @@
1
  <?php
2
- $field_name = empty( $field_name ) ? '' : $field_name;
3
- $current_title = empty( $current_title ) ? '' : $current_title;
4
- $title_placeholder = empty( $title_placeholder ) ? '' : $title_placeholder;
5
- $current_description = empty( $current_description ) ? '' : $current_description;
6
  $description_placeholder = empty( $description_placeholder ) ? '' : $description_placeholder;
7
- $images = empty( $images ) ? array() : $images;
8
- $images_available = ! empty( $images ) && is_array( $images );
9
- $single_image = empty( $single_image ) ? false : true;
10
- $images_description = empty( $images_description ) ? false : $images_description;
11
  ?>
12
 
13
  <div class="<?php echo esc_attr( $field_name ); ?>-meta">
14
  <div class="sui-form-field">
15
- <label for="<?php echo esc_attr( $field_name ); ?>-title"
16
- class="sui-label"><?php esc_html_e( 'Title', 'wds' ); ?></label>
17
- <input type="text"
18
- class="sui-form-control"
19
- id="<?php echo esc_attr( $field_name ); ?>-title"
20
- name="<?php echo esc_attr( $field_name ); ?>[title]"
21
- placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
22
- value="<?php echo esc_attr( $current_title ); ?>"/>
 
 
 
 
23
  </div>
24
 
25
  <div class="sui-form-field">
26
  <label for="<?php echo esc_attr( $field_name ); ?>-description" class="sui-label">
27
  <?php esc_html_e( 'Description', 'wds' ); ?>
28
  </label>
29
- <textarea name="<?php echo esc_attr( $field_name ); ?>[description]"
30
- class="sui-form-control"
31
- placeholder="<?php echo esc_attr( $description_placeholder ); ?>"
32
- id="<?php echo esc_attr( $field_name ); ?>-description"><?php echo esc_textarea( $current_description ); ?></textarea>
 
 
33
  </div>
34
 
35
  <div class="sui-form-field">
36
  <label for="<?php echo esc_attr( $field_name ); ?>-images" class="sui-label">
37
  <?php echo $single_image ? esc_html__( 'Featured Image', 'wds' ) : esc_html__( 'Featured Images', 'wds' ); ?>
38
  </label>
39
- <div class="og-images"
40
- data-singular="<?php echo $single_image ? 'true' : 'false'; ?>"
41
- data-name="<?php echo esc_attr( $field_name ); ?>[images]">
42
- <div class="add-action-wrapper sui-tooltip"
43
- data-tooltip="<?php esc_attr_e( 'Add featured image', 'wds' ); ?>"
44
- style="<?php echo $single_image && $images_available ? 'display:none;' : ''; ?>">
45
- <a href="#add" id="<?php echo esc_attr( $field_name ); ?>-images"
46
- title="<?php esc_attr_e( 'Add image', 'wds' ); ?>">
 
 
 
 
 
 
 
47
  <span class="sui-icon-upload-cloud" aria-hidden="true"></span>
48
  </a>
49
  </div>
50
  <?php if ( $images_available ) : ?>
51
  <?php foreach ( $images as $img ) : ?>
52
- <?php $this->_render( 'social-image-item', array(
53
- 'id' => $img,
54
- 'field_name' => "{$field_name}[images][]",
55
- ) ); ?>
 
 
 
 
 
56
  <?php endforeach; ?>
57
  <?php endif; ?>
58
  </div>
59
 
60
  <p class="sui-description">
61
- <?php if ( $images_description ): ?>
62
  <?php echo esc_html( $images_description ); ?>
63
- <?php elseif ( $single_image ): ?>
64
  <?php esc_html_e( 'This image will be used as the featured image when the post is shared.', 'wds' ); ?>
65
- <?php else: ?>
66
  <?php esc_html_e( 'Each of these images will be available to use as the featured image when the post is shared.', 'wds' ); ?>
67
  <?php endif; ?>
68
  </p>
1
  <?php
2
+ $field_name = empty( $field_name ) ? '' : $field_name;
3
+ $current_title = empty( $current_title ) ? '' : $current_title;
4
+ $title_placeholder = empty( $title_placeholder ) ? '' : $title_placeholder;
5
+ $current_description = empty( $current_description ) ? '' : $current_description;
6
  $description_placeholder = empty( $description_placeholder ) ? '' : $description_placeholder;
7
+ $images = empty( $images ) ? array() : $images;
8
+ $images_available = ! empty( $images ) && is_array( $images );
9
+ $single_image = ! empty( $single_image );
10
+ $images_description = empty( $images_description ) ? false : $images_description;
11
  ?>
12
 
13
  <div class="<?php echo esc_attr( $field_name ); ?>-meta">
14
  <div class="sui-form-field">
15
+ <label
16
+ for="<?php echo esc_attr( $field_name ); ?>-title"
17
+ class="sui-label"
18
+ ><?php esc_html_e( 'Title', 'wds' ); ?></label>
19
+ <input
20
+ type="text"
21
+ class="sui-form-control"
22
+ id="<?php echo esc_attr( $field_name ); ?>-title"
23
+ name="<?php echo esc_attr( $field_name ); ?>[title]"
24
+ placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
25
+ value="<?php echo esc_attr( $current_title ); ?>"
26
+ />
27
  </div>
28
 
29
  <div class="sui-form-field">
30
  <label for="<?php echo esc_attr( $field_name ); ?>-description" class="sui-label">
31
  <?php esc_html_e( 'Description', 'wds' ); ?>
32
  </label>
33
+ <textarea
34
+ name="<?php echo esc_attr( $field_name ); ?>[description]"
35
+ class="sui-form-control"
36
+ placeholder="<?php echo esc_attr( $description_placeholder ); ?>"
37
+ id="<?php echo esc_attr( $field_name ); ?>-description"
38
+ ><?php echo esc_textarea( $current_description ); ?></textarea>
39
  </div>
40
 
41
  <div class="sui-form-field">
42
  <label for="<?php echo esc_attr( $field_name ); ?>-images" class="sui-label">
43
  <?php echo $single_image ? esc_html__( 'Featured Image', 'wds' ) : esc_html__( 'Featured Images', 'wds' ); ?>
44
  </label>
45
+ <div
46
+ class="og-images"
47
+ data-singular="<?php echo $single_image ? 'true' : 'false'; ?>"
48
+ data-name="<?php echo esc_attr( $field_name ); ?>[images]"
49
+ >
50
+ <div
51
+ class="add-action-wrapper sui-tooltip"
52
+ data-tooltip="<?php esc_attr_e( 'Add featured image', 'wds' ); ?>"
53
+ style="<?php echo $single_image && $images_available ? 'display:none;' : ''; ?>"
54
+ >
55
+ <a
56
+ href="#add"
57
+ id="<?php echo esc_attr( $field_name ); ?>-images"
58
+ title="<?php esc_attr_e( 'Add image', 'wds' ); ?>"
59
+ >
60
  <span class="sui-icon-upload-cloud" aria-hidden="true"></span>
61
  </a>
62
  </div>
63
  <?php if ( $images_available ) : ?>
64
  <?php foreach ( $images as $img ) : ?>
65
+ <?php
66
+ $this->render_view(
67
+ 'social-image-item',
68
+ array(
69
+ 'id' => $img,
70
+ 'field_name' => "{$field_name}[images][]",
71
+ )
72
+ );
73
+ ?>
74
  <?php endforeach; ?>
75
  <?php endif; ?>
76
  </div>
77
 
78
  <p class="sui-description">
79
+ <?php if ( $images_description ) : ?>
80
  <?php echo esc_html( $images_description ); ?>
81
+ <?php elseif ( $single_image ) : ?>
82
  <?php esc_html_e( 'This image will be used as the featured image when the post is shared.', 'wds' ); ?>
83
+ <?php else : ?>
84
  <?php esc_html_e( 'Each of these images will be available to use as the featured image when the post is shared.', 'wds' ); ?>
85
  <?php endif; ?>
86
  </p>
includes/admin/templates/metabox/metabox-social-meta-tags.php CHANGED
@@ -1,17 +1,17 @@
1
  <?php
2
- $main_title = empty( $main_title ) ? '' : $main_title;
3
- $main_description = empty( $main_description ) ? '' : $main_description;
4
- $field_name = empty( $field_name ) ? '' : $field_name;
5
- $disabled = empty( $disabled ) ? false : true;
6
- $current_title = empty( $current_title ) ? '' : $current_title;
7
- $title_placeholder = empty( $title_placeholder ) ? '' : $title_placeholder;
8
- $current_description = empty( $current_description ) ? '' : $current_description;
9
  $description_placeholder = empty( $description_placeholder ) ? '' : $description_placeholder;
10
- $images = empty( $images ) ? array() : $images;
11
- $images_available = ! empty( $images ) && is_array( $images );
12
- $single_image = empty( $single_image ) ? false : true;
13
- $images_description = empty( $images_description ) ? false : $images_description;
14
- $toggle_label = empty( $toggle_label ) ? esc_html__( 'Enable for this post', 'wds' ) : $toggle_label;
15
  ?>
16
  <div class="sui-box-settings-row">
17
  <div class="sui-box-settings-col-1">
@@ -20,25 +20,28 @@ $toggle_label = empty( $toggle_label ) ? esc_html__( 'Enable for this post', 'wd
20
  </div>
21
  <div class="sui-box-settings-col-2">
22
  <?php
23
- $this->_render( 'toggle-item', array(
24
- 'inverted' => true,
25
- 'field_name' => $field_name . '[disabled]',
26
- 'field_id' => $field_name . '-disabled',
27
- 'checked' => $disabled,
28
- 'item_label' => $toggle_label,
29
- 'sub_settings_template' => 'metabox/metabox-social-meta-tags-sub-settings',
30
- 'sub_settings_template_args' => array(
31
- 'field_name' => $field_name,
32
- 'current_title' => $current_title,
33
- 'title_placeholder' => $title_placeholder,
34
- 'current_description' => $current_description,
35
- 'description_placeholder' => $description_placeholder,
36
- 'images' => $images,
37
- 'images_available' => $images_available,
38
- 'single_image' => $single_image,
39
- 'images_description' => $images_description,
40
- ),
41
- ) );
 
 
 
42
  ?>
43
  </div>
44
  </div>
1
  <?php
2
+ $main_title = empty( $main_title ) ? '' : $main_title;
3
+ $main_description = empty( $main_description ) ? '' : $main_description;
4
+ $field_name = empty( $field_name ) ? '' : $field_name;
5
+ $disabled = ! empty( $disabled );
6
+ $current_title = empty( $current_title ) ? '' : $current_title;
7
+ $title_placeholder = empty( $title_placeholder ) ? '' : $title_placeholder;
8
+ $current_description = empty( $current_description ) ? '' : $current_description;
9
  $description_placeholder = empty( $description_placeholder ) ? '' : $description_placeholder;
10
+ $images = empty( $images ) ? array() : $images;
11
+ $images_available = ! empty( $images ) && is_array( $images );
12
+ $single_image = ! empty( $single_image );
13
+ $images_description = empty( $images_description ) ? false : $images_description;
14
+ $toggle_label = empty( $toggle_label ) ? esc_html__( 'Enable for this post', 'wds' ) : $toggle_label;
15
  ?>
16
  <div class="sui-box-settings-row">
17
  <div class="sui-box-settings-col-1">
20
  </div>
21
  <div class="sui-box-settings-col-2">
22
  <?php
23
+ $this->render_view(
24
+ 'toggle-item',
25
+ array(
26
+ 'inverted' => true,
27
+ 'field_name' => $field_name . '[disabled]',
28
+ 'field_id' => $field_name . '-disabled',
29
+ 'checked' => $disabled,
30
+ 'item_label' => $toggle_label,
31
+ 'sub_settings_template' => 'metabox/metabox-social-meta-tags-sub-settings',
32
+ 'sub_settings_template_args' => array(
33
+ 'field_name' => $field_name,
34
+ 'current_title' => $current_title,
35
+ 'title_placeholder' => $title_placeholder,
36
+ 'current_description' => $current_description,
37
+ 'description_placeholder' => $description_placeholder,
38
+ 'images' => $images,
39
+ 'images_available' => $images_available,
40
+ 'single_image' => $single_image,
41
+ 'images_description' => $images_description,
42
+ ),
43
+ )
44
+ );
45
  ?>
46
  </div>
47
  </div>
includes/admin/templates/metabox/metabox-social-opengraph.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $post = empty( $post ) ? null : $post;
3
  if ( ! $post ) {
4
  return;
5
  }
@@ -12,22 +12,28 @@ $og = smartcrawl_get_value( 'opengraph', $smartcrawl_post->get_post_id() );
12
  if ( ! is_array( $og ) ) {
13
  $og = array();
14
  }
15
- $og = wp_parse_args( $og, array(
16
- 'title' => false,
17
- 'description' => false,
18
- 'images' => false,
19
- 'disabled' => false,
20
- ) );
 
 
 
21
 
22
- $this->_render( 'metabox/metabox-social-meta-tags', array(
23
- 'main_title' => __( 'OpenGraph', 'wds' ),
24
- 'main_description' => __( 'OpenGraph is used on many social networks such as Facebook.', 'wds' ),
25
- 'field_name' => 'wds-opengraph',
26
- 'disabled' => (bool) smartcrawl_get_array_value( $og, 'disabled' ),
27
- 'current_title' => $og['title'],
28
- 'title_placeholder' => $smartcrawl_post->get_opengraph_title(),
29
- 'current_description' => $og['description'],
30
- 'description_placeholder' => $smartcrawl_post->get_opengraph_description(),
31
- 'images' => $og['images'],
32
- 'single_image' => false,
33
- ) );
 
 
 
1
  <?php
2
+ $post = empty( $post ) ? null : $post; // phpcs:ignore
3
  if ( ! $post ) {
4
  return;
5
  }
12
  if ( ! is_array( $og ) ) {
13
  $og = array();
14
  }
15
+ $og = wp_parse_args(
16
+ $og,
17
+ array(
18
+ 'title' => false,
19
+ 'description' => false,
20
+ 'images' => false,
21
+ 'disabled' => false,
22
+ )
23
+ );
24
 
25
+ $this->render_view(
26
+ 'metabox/metabox-social-meta-tags',
27
+ array(
28
+ 'main_title' => __( 'OpenGraph', 'wds' ),
29
+ 'main_description' => __( 'OpenGraph is used on many social networks such as Facebook.', 'wds' ),
30
+ 'field_name' => 'wds-opengraph',
31
+ 'disabled' => (bool) smartcrawl_get_array_value( $og, 'disabled' ),
32
+ 'current_title' => $og['title'],
33
+ 'title_placeholder' => $smartcrawl_post->get_opengraph_title(),
34
+ 'current_description' => $og['description'],
35
+ 'description_placeholder' => $smartcrawl_post->get_opengraph_description(),
36
+ 'images' => $og['images'],
37
+ 'single_image' => false,
38
+ )
39
+ );
includes/admin/templates/metabox/metabox-social-twitter.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $post = empty( $post ) ? null : $post;
3
  if ( ! $post ) {
4
  return;
5
  }
@@ -12,22 +12,28 @@ $twitter = smartcrawl_get_value( 'twitter', $post->ID );
12
  if ( ! is_array( $twitter ) ) {
13
  $twitter = array();
14
  }
15
- $twitter = wp_parse_args( $twitter, array(
16
- 'title' => false,
17
- 'description' => false,
18
- 'images' => false,
19
- 'disabled' => false,
20
- ) );
 
 
 
21
 
22
- $this->_render( 'metabox/metabox-social-meta-tags', array(
23
- 'main_title' => __( 'Twitter', 'wds' ),
24
- 'main_description' => __( 'These details will be used in Twitter cards.', 'wds' ),
25
- 'field_name' => 'wds-twitter',
26
- 'disabled' => (bool) smartcrawl_get_array_value( $twitter, 'disabled' ),
27
- 'current_title' => $twitter['title'],
28
- 'title_placeholder' => $smartcrawl_post->get_twitter_title(),
29
- 'current_description' => $twitter['description'],
30
- 'description_placeholder' => $smartcrawl_post->get_twitter_description(),
31
- 'images' => $twitter['images'],
32
- 'single_image' => true,
33
- ) );
 
 
 
1
  <?php
2
+ $post = empty( $post ) ? null : $post; // phpcs:ignore
3
  if ( ! $post ) {
4
  return;
5
  }
12
  if ( ! is_array( $twitter ) ) {
13
  $twitter = array();
14
  }
15
+ $twitter = wp_parse_args(
16
+ $twitter,
17
+ array(
18
+ 'title' => false,
19
+ 'description' => false,
20
+ 'images' => false,
21
+ 'disabled' => false,
22
+ )
23
+ );
24
 
25
+ $this->render_view(
26
+ 'metabox/metabox-social-meta-tags',
27
+ array(
28
+ 'main_title' => __( 'Twitter', 'wds' ),
29
+ 'main_description' => __( 'These details will be used in Twitter cards.', 'wds' ),
30
+ 'field_name' => 'wds-twitter',
31
+ 'disabled' => (bool) smartcrawl_get_array_value( $twitter, 'disabled' ),
32
+ 'current_title' => $twitter['title'],
33
+ 'title_placeholder' => $smartcrawl_post->get_twitter_title(),
34
+ 'current_description' => $twitter['description'],
35
+ 'description_placeholder' => $smartcrawl_post->get_twitter_description(),
36
+ 'images' => $twitter['images'],
37
+ 'single_image' => true,
38
+ )
39
+ );
includes/admin/templates/metabox/metabox-tab-advanced.php CHANGED
@@ -8,7 +8,9 @@ if ( empty( $advanced_sections ) ) {
8
  <div class="wds-metabox-section wds-advanced-metabox-section sui-box-body">
9
  <p><?php esc_html_e( 'Configure the advanced settings for this post.', 'wds' ); ?></p>
10
 
11
- <?php foreach ( $advanced_sections as $template => $args ) {
12
- $this->_render( $template, $args );
13
- } ?>
 
 
14
  </div>
8
  <div class="wds-metabox-section wds-advanced-metabox-section sui-box-body">
9
  <p><?php esc_html_e( 'Configure the advanced settings for this post.', 'wds' ); ?></p>
10
 
11
+ <?php
12
+ foreach ( $advanced_sections as $template => $args ) {
13
+ $this->render_view( $template, $args );
14
+ }
15
+ ?>
16
  </div>
includes/admin/templates/metabox/metabox-tab-readability.php CHANGED
@@ -8,7 +8,9 @@ if ( empty( $readability_sections ) ) {
8
  <small><?php esc_html_e( 'We’ve analyzed your content to see how readable it is for the average person. Suggestions are based on best practice, but only you can decide what works for you and your readers.', 'wds' ); ?></small>
9
  </p>
10
 
11
- <?php foreach ( $readability_sections as $template => $args ) {
12
- $this->_render( $template, $args );
13
- } ?>
 
 
14
  </div>
8
  <small><?php esc_html_e( 'We’ve analyzed your content to see how readable it is for the average person. Suggestions are based on best practice, but only you can decide what works for you and your readers.', 'wds' ); ?></small>
9
  </p>
10
 
11
+ <?php
12
+ foreach ( $readability_sections as $template => $args ) {
13
+ $this->render_view( $template, $args );
14
+ }
15
+ ?>
16
  </div>
includes/admin/templates/metabox/metabox-tab-seo.php CHANGED
@@ -6,7 +6,9 @@ if ( empty( $seo_sections ) ) {
6
  ?>
7
 
8
  <div class="wds-form">
9
- <?php foreach ( $seo_sections as $template => $args ) {
10
- $this->_render( $template, $args );
11
- } ?>
 
 
12
  </div>
6
  ?>
7
 
8
  <div class="wds-form">
9
+ <?php
10
+ foreach ( $seo_sections as $template => $args ) {
11
+ $this->render_view( $template, $args );
12
+ }
13
+ ?>
14
  </div>
includes/admin/templates/metabox/metabox-tab-social.php CHANGED
@@ -4,7 +4,7 @@ $default_settings_message = smartcrawl_format_link(
4
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE ),
5
  esc_html__( 'Titles & Meta', 'wds' )
6
  );
7
- $social_sections = empty( $social_sections ) ? array() : $social_sections;
8
  if ( empty( $social_sections ) ) {
9
  return;
10
  }
@@ -12,7 +12,9 @@ if ( empty( $social_sections ) ) {
12
  <div class="wds-metabox-section wds-social-settings-metabox-section sui-box-body">
13
  <p><?php echo wp_kses_post( $default_settings_message ); ?></p>
14
 
15
- <?php foreach ( $social_sections as $template => $args ) {
16
- $this->_render( $template, $args );
17
- } ?>
 
 
18
  </div>
4
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE ),
5
  esc_html__( 'Titles & Meta', 'wds' )
6
  );
7
+ $social_sections = empty( $social_sections ) ? array() : $social_sections;
8
  if ( empty( $social_sections ) ) {
9
  return;
10
  }
12
  <div class="wds-metabox-section wds-social-settings-metabox-section sui-box-body">
13
  <p><?php echo wp_kses_post( $default_settings_message ); ?></p>
14
 
15
+ <?php
16
+ foreach ( $social_sections as $template => $args ) {
17
+ $this->render_view( $template, $args );
18
+ }
19
+ ?>
20
  </div>
includes/admin/templates/metabox/underscore-google-preview.php CHANGED
@@ -1,9 +1,14 @@
1
  <div class="wds-metabox-preview">
2
- <label class="sui-label"><?php esc_html_e( 'Google Preview' ); ?></label>
3
 
4
- <?php $this->_render( 'onpage/onpage-preview', array(
5
- 'link' => '{{- link }}',
6
- 'title' => '{{- title }}',
7
- 'description' => '{{- description }}',
8
- ) ); ?>
 
 
 
 
 
9
  </div>
1
  <div class="wds-metabox-preview">
2
+ <label class="sui-label"><?php esc_html_e( 'Google Preview', 'wds' ); ?></label>
3
 
4
+ <?php
5
+ $this->render_view(
6
+ 'onpage/onpage-preview',
7
+ array(
8
+ 'link' => '{{- link }}',
9
+ 'title' => '{{- title }}',
10
+ 'description' => '{{- description }}',
11
+ )
12
+ );
13
+ ?>
14
  </div>
includes/admin/templates/metabox/underscore-link-rel-attribute.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="wp-link-text-field wp-link-rel-attribute">
2
  <label>
3
- <span><?php _e( 'Rel Attributes' ); ?></span>
4
  <input id="wp-link-rel-attributes" type="text" value=""/>
5
  </label>
6
  <p>
1
  <div class="wp-link-text-field wp-link-rel-attribute">
2
  <label>
3
+ <span><?php esc_html_e( 'Rel Attributes', 'wds' ); ?></span>
4
  <input id="wp-link-rel-attributes" type="text" value=""/>
5
  </label>
6
  <p>
includes/admin/templates/modal.php CHANGED
@@ -1,46 +1,53 @@
1
  <?php
2
- $id = empty( $id ) ? '' : $id;
3
- $title = empty( $title ) ? '' : $title;
4
- $description = empty( $description ) ? '' : $description;
5
  $header_actions_template = empty( $header_actions_template ) ? '' : $header_actions_template;
6
- $body_template = empty( $body_template ) ? '' : $body_template;
7
- $body_template_args = empty( $body_template_args ) ? array() : $body_template_args;
8
- $footer_template = empty( $footer_template ) ? '' : $footer_template;
9
- $footer_template_args = empty( $footer_template_args ) ? array() : $footer_template_args;
10
- $small = empty( $small ) ? false : $small;
11
- $is_member = empty( $_view['is_member'] ) ? false : true;
12
  ?>
13
 
14
  <div class="sui-modal <?php echo $small ? 'sui-modal-sm' : 'sui-modal-lg'; ?>">
15
- <div role="dialog"
16
- id="<?php echo esc_attr( $id ); ?>"
17
- class="sui-modal-content <?php echo esc_attr( $id ); ?>-dialog <?php echo $is_member ? 'is-member' : ''; ?>"
18
- aria-modal="true"
19
- aria-labelledby="<?php echo esc_attr( $id ); ?>-dialog-title"
20
- aria-describedby="<?php echo esc_attr( $id ); ?>-dialog-description">
21
-
 
22
  <div class="sui-box" role="document">
23
  <div class="sui-box-header <?php echo $small ? 'sui-flatten sui-content-center sui-spacing-top--40' : ''; ?>">
24
- <h3 class="sui-box-title <?php echo $small ? 'sui-lg' : ''; ?>"
25
- id="<?php echo esc_attr( $id ); ?>-dialog-title">
 
 
26
  <?php echo esc_html( $title ); ?>
27
  </h3>
28
 
29
- <?php if ( $small ): ?>
30
- <button class="sui-button-icon sui-button-float--right" data-modal-close
31
- id="<?php echo esc_attr( $id ); ?>-close-button"
32
- type="button">
 
 
33
  <span class="sui-icon-close sui-md" aria-hidden="true"></span>
34
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'wds' ); ?></span>
35
  </button>
36
- <?php else: ?>
37
  <div class="sui-actions-right">
38
- <?php if ( $header_actions_template ): ?>
39
- <?php $this->_render( $header_actions_template ); ?>
40
- <?php else: ?>
41
- <button class="sui-button-icon" data-modal-close
42
- id="<?php echo esc_attr( $id ); ?>-close-button"
43
- type="button">
 
 
44
  <span class="sui-icon-close sui-md" aria-hidden="true"></span>
45
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'wds' ); ?></span>
46
  </button>
@@ -50,30 +57,36 @@ $is_member = empty( $_view['is_member'] ) ? false : true;
50
  </div>
51
 
52
  <div class="sui-box-body <?php echo $small ? 'sui-content-center' : ''; ?>">
53
- <?php if ( $description ): ?>
54
- <p class="sui-description"
55
- id="<?php echo esc_attr( $id ); ?>-dialog-description"><?php echo wp_kses_post( $description ); ?></p>
 
 
56
  <?php endif; ?>
57
- <?php if ( $body_template ): ?>
58
- <?php $this->_render(
 
59
  $body_template,
60
  array_merge(
61
  array( 'id' => $id ),
62
  $body_template_args
63
  )
64
- ); ?>
 
65
  <?php endif; ?>
66
  </div>
67
 
68
- <?php if ( $footer_template ): ?>
69
  <div class="sui-box-footer">
70
- <?php $this->_render(
 
71
  $footer_template,
72
  array_merge(
73
  array( 'id' => $id ),
74
  $footer_template_args
75
  )
76
- ); ?>
 
77
  </div>
78
  <?php endif; ?>
79
 
1
  <?php
2
+ $id = empty( $id ) ? '' : $id; // phpcs:ignore
3
+ $title = empty( $title ) ? '' : $title; // phpcs:ignore
4
+ $description = empty( $description ) ? '' : $description;
5
  $header_actions_template = empty( $header_actions_template ) ? '' : $header_actions_template;
6
+ $body_template = empty( $body_template ) ? '' : $body_template;
7
+ $body_template_args = empty( $body_template_args ) ? array() : $body_template_args;
8
+ $footer_template = empty( $footer_template ) ? '' : $footer_template;
9
+ $footer_template_args = empty( $footer_template_args ) ? array() : $footer_template_args;
10
+ $small = empty( $small ) ? false : $small;
11
+ $is_member = ! empty( $_view['is_member'] );
12
  ?>
13
 
14
  <div class="sui-modal <?php echo $small ? 'sui-modal-sm' : 'sui-modal-lg'; ?>">
15
+ <div
16
+ role="dialog"
17
+ id="<?php echo esc_attr( $id ); ?>"
18
+ class="sui-modal-content <?php echo esc_attr( $id ); ?>-dialog <?php echo $is_member ? 'is-member' : ''; ?>"
19
+ aria-modal="true"
20
+ aria-labelledby="<?php echo esc_attr( $id ); ?>-dialog-title"
21
+ aria-describedby="<?php echo esc_attr( $id ); ?>-dialog-description"
22
+ >
23
  <div class="sui-box" role="document">
24
  <div class="sui-box-header <?php echo $small ? 'sui-flatten sui-content-center sui-spacing-top--40' : ''; ?>">
25
+ <h3
26
+ class="sui-box-title <?php echo $small ? 'sui-lg' : ''; ?>"
27
+ id="<?php echo esc_attr( $id ); ?>-dialog-title"
28
+ >
29
  <?php echo esc_html( $title ); ?>
30
  </h3>
31
 
32
+ <?php if ( $small ) : ?>
33
+ <button
34
+ class="sui-button-icon sui-button-float--right" data-modal-close
35
+ id="<?php echo esc_attr( $id ); ?>-close-button"
36
+ type="button"
37
+ >
38
  <span class="sui-icon-close sui-md" aria-hidden="true"></span>
39
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'wds' ); ?></span>
40
  </button>
41
+ <?php else : ?>
42
  <div class="sui-actions-right">
43
+ <?php if ( $header_actions_template ) : ?>
44
+ <?php $this->render_view( $header_actions_template ); ?>
45
+ <?php else : ?>
46
+ <button
47
+ class="sui-button-icon" data-modal-close
48
+ id="<?php echo esc_attr( $id ); ?>-close-button"
49
+ type="button"
50
+ >
51
  <span class="sui-icon-close sui-md" aria-hidden="true"></span>
52
  <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'wds' ); ?></span>
53
  </button>
57
  </div>
58
 
59
  <div class="sui-box-body <?php echo $small ? 'sui-content-center' : ''; ?>">
60
+ <?php if ( $description ) : ?>
61
+ <p
62
+ class="sui-description"
63
+ id="<?php echo esc_attr( $id ); ?>-dialog-description"
64
+ ><?php echo wp_kses_post( $description ); ?></p>
65
  <?php endif; ?>
66
+ <?php if ( $body_template ) : ?>
67
+ <?php
68
+ $this->render_view(
69
  $body_template,
70
  array_merge(
71
  array( 'id' => $id ),
72
  $body_template_args
73
  )
74
+ );
75
+ ?>
76
  <?php endif; ?>
77
  </div>
78
 
79
+ <?php if ( $footer_template ) : ?>
80
  <div class="sui-box-footer">
81
+ <?php
82
+ $this->render_view(
83
  $footer_template,
84
  array_merge(
85
  array( 'id' => $id ),
86
  $footer_template_args
87
  )
88
+ );
89
+ ?>
90
  </div>
91
  <?php endif; ?>
92
 
includes/admin/templates/network-settings.php CHANGED
@@ -1,22 +1,27 @@
1
  <?php
2
- $option_name = empty( $option_name ) ? '' : $option_name;
3
- $slugs = empty( $slugs ) ? array() : $slugs;
4
  $subsite_manager_role = empty( $subsite_manager_role ) ? false : $subsite_manager_role;
5
- $subsite_config_id = empty( $subsite_config_id ) ? '' : $subsite_config_id;
6
- $blog_tabs = empty( $blog_tabs ) ? array() : $blog_tabs;
7
- $dashboard_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings_Admin::TAB_DASHBOARD );
8
- $per_site_notice = empty( $per_site_notice ) ? '' : $per_site_notice;
9
- $collection = Smartcrawl_Config_Collection::get();
10
 
11
- $this->_render( 'before-page-container' );
12
  ?>
13
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-network-settings' ); ?>">
14
 
15
- <?php $this->_render( 'page-header', array(
16
- 'title' => esc_html__( 'Network Settings', 'wds' ),
17
- ) ); ?>
 
 
 
 
 
18
 
19
- <?php $this->_render( 'floating-notices' ); ?>
20
 
21
  <form method="post">
22
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
@@ -47,8 +52,10 @@ $this->_render( 'before-page-container' );
47
  </div>
48
 
49
  <div class="sui-box-settings-col-2">
50
- <label class="sui-settings-label"
51
- for="wds-subsite-access">
 
 
52
  <?php esc_html_e( 'Admin Access', 'wds' ); ?>
53
  </label>
54
  <p class="sui-description">
@@ -56,17 +63,19 @@ $this->_render( 'before-page-container' );
56
  </p>
57
  <div class="sui-row">
58
  <div class="sui-col-md-6">
59
- <select id="wds-subsite-access"
60
- name="<?php echo esc_attr( $option_name ); ?>[wds_subsite_manager_role]"
61
- autocomplete="off"
62
- data-minimum-results-for-search="-1"
63
- class="sui-select">
64
- <option <?php selected( 'admin', $subsite_manager_role ) ?>
65
- value="admin">
 
 
66
  <?php esc_html_e( 'Site Admins', 'wds' ); ?>
67
  </option>
68
- <option <?php selected( 'superadmin', $subsite_manager_role ) ?>
69
- value="superadmin">
70
  <?php esc_html_e( 'Super Admins', 'wds' ); ?>
71
  </option>
72
  </select>
@@ -74,8 +83,10 @@ $this->_render( 'before-page-container' );
74
  </div>
75
 
76
  <div class="wds-separator-top">
77
- <label class="sui-settings-label"
78
- for="wds-subsite-access">
 
 
79
  <?php esc_html_e( 'Modules', 'wds' ); ?>
80
  </label>
81
  <p class="sui-description">
@@ -85,13 +96,17 @@ $this->_render( 'before-page-container' );
85
  foreach ( $slugs as $item => $label ) {
86
  $checkbox_name = sprintf( '%s[wds_blog_tabs][%s]', $option_name, $item );
87
  ?>
88
- <label for="<?php echo esc_attr( $checkbox_name ); ?>"
89
- class="sui-checkbox">
90
- <input type="checkbox" <?php checked( ! empty( $blog_tabs[ $item ] ) ); ?>
91
- name="<?php echo esc_attr( $checkbox_name ); ?>"
92
- value="yes"
93
- id="<?php echo esc_attr( $checkbox_name ); ?>"
94
- aria-labelledby="label-<?php echo esc_attr( $checkbox_name ); ?>"/>
 
 
 
 
95
  <span aria-hidden="true"></span>
96
  <span id="label-<?php echo esc_attr( $checkbox_name ); ?>">
97
  <?php echo esc_html( $label ); ?>
@@ -104,31 +119,37 @@ $this->_render( 'before-page-container' );
104
  <br/>
105
 
106
  <div class="wds-separator-top">
107
- <label class="sui-settings-label"
108
- for="wds-subsite-config-id">
 
 
109
  <?php esc_html_e( 'New Sub-sites', 'wds' ); ?>
110
  </label>
111
  <p class="sui-description">
112
- <?php echo smartcrawl_format_link(
 
113
  esc_html__( 'Select a config that you would like to apply to new sub-sites. Visit the %s page to manage all your configs.', 'wds' ),
114
  admin_url( 'admin.php?page=wds_settings&tab=tab_configs' ),
115
  esc_html__( 'Configs', 'wds' ),
116
  '_blank'
117
- ); ?>
 
118
  </p>
119
 
120
- <select id="wds-subsite-config-id"
121
- name="<?php echo esc_attr( $option_name ); ?>[wds_subsite_config_id]"
122
- data-minimum-results-for-search="-1"
123
- class="sui-select">
 
 
124
  <option <?php selected( ! $subsite_config_id ); ?>
125
- value="">
126
  <?php esc_html_e( 'None', 'wds' ); ?>
127
  </option>
128
 
129
- <?php foreach ( $collection->get_sorted_configs() as $config ): ?>
130
- <option <?php selected( $subsite_config_id, $config->get_id() ) ?>
131
- value="<?php echo esc_attr( $config->get_id() ); ?>">
132
 
133
  <?php echo esc_html( $config->get_name() ); ?>
134
  </option>
@@ -140,9 +161,11 @@ $this->_render( 'before-page-container' );
140
  </div>
141
 
142
  <div class="sui-box-footer">
143
- <button name="submit"
144
- type="submit"
145
- class="sui-button sui-button-blue">
 
 
146
  <span class="sui-icon-save" aria-hidden="true"></span>
147
 
148
  <?php esc_html_e( 'Save Changes', 'wds' ); ?>
1
  <?php
2
+ $option_name = empty( $option_name ) ? '' : $option_name;
3
+ $slugs = empty( $slugs ) ? array() : $slugs;
4
  $subsite_manager_role = empty( $subsite_manager_role ) ? false : $subsite_manager_role;
5
+ $subsite_config_id = empty( $subsite_config_id ) ? '' : $subsite_config_id;
6
+ $blog_tabs = empty( $blog_tabs ) ? array() : $blog_tabs;
7
+ $dashboard_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings_Admin::TAB_DASHBOARD );
8
+ $per_site_notice = empty( $per_site_notice ) ? '' : $per_site_notice;
9
+ $collection = Smartcrawl_Config_Collection::get();
10
 
11
+ $this->render_view( 'before-page-container' );
12
  ?>
13
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-network-settings' ); ?>">
14
 
15
+ <?php
16
+ $this->render_view(
17
+ 'page-header',
18
+ array(
19
+ 'title' => esc_html__( 'Network Settings', 'wds' ),
20
+ )
21
+ );
22
+ ?>
23
 
24
+ <?php $this->render_view( 'floating-notices' ); ?>
25
 
26
  <form method="post">
27
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
52
  </div>
53
 
54
  <div class="sui-box-settings-col-2">
55
+ <label
56
+ class="sui-settings-label"
57
+ for="wds-subsite-access"
58
+ >
59
  <?php esc_html_e( 'Admin Access', 'wds' ); ?>
60
  </label>
61
  <p class="sui-description">
63
  </p>
64
  <div class="sui-row">
65
  <div class="sui-col-md-6">
66
+ <select
67
+ id="wds-subsite-access"
68
+ name="<?php echo esc_attr( $option_name ); ?>[wds_subsite_manager_role]"
69
+ autocomplete="off"
70
+ data-minimum-results-for-search="-1"
71
+ class="sui-select"
72
+ >
73
+ <option <?php selected( 'admin', $subsite_manager_role ); ?>
74
+ value="admin">
75
  <?php esc_html_e( 'Site Admins', 'wds' ); ?>
76
  </option>
77
+ <option <?php selected( 'superadmin', $subsite_manager_role ); ?>
78
+ value="superadmin">
79
  <?php esc_html_e( 'Super Admins', 'wds' ); ?>
80
  </option>
81
  </select>
83
  </div>
84
 
85
  <div class="wds-separator-top">
86
+ <label
87
+ class="sui-settings-label"
88
+ for="wds-subsite-access"
89
+ >
90
  <?php esc_html_e( 'Modules', 'wds' ); ?>
91
  </label>
92
  <p class="sui-description">
96
  foreach ( $slugs as $item => $label ) {
97
  $checkbox_name = sprintf( '%s[wds_blog_tabs][%s]', $option_name, $item );
98
  ?>
99
+ <label
100
+ for="<?php echo esc_attr( $checkbox_name ); ?>"
101
+ class="sui-checkbox"
102
+ >
103
+ <input
104
+ type="checkbox" <?php checked( ! empty( $blog_tabs[ $item ] ) ); ?>
105
+ name="<?php echo esc_attr( $checkbox_name ); ?>"
106
+ value="yes"
107
+ id="<?php echo esc_attr( $checkbox_name ); ?>"
108
+ aria-labelledby="label-<?php echo esc_attr( $checkbox_name ); ?>"
109
+ />
110
  <span aria-hidden="true"></span>
111
  <span id="label-<?php echo esc_attr( $checkbox_name ); ?>">
112
  <?php echo esc_html( $label ); ?>
119
  <br/>
120
 
121
  <div class="wds-separator-top">
122
+ <label
123
+ class="sui-settings-label"
124
+ for="wds-subsite-config-id"
125
+ >
126
  <?php esc_html_e( 'New Sub-sites', 'wds' ); ?>
127
  </label>
128
  <p class="sui-description">
129
+ <?php
130
+ echo smartcrawl_format_link( // phpcs:ignore
131
  esc_html__( 'Select a config that you would like to apply to new sub-sites. Visit the %s page to manage all your configs.', 'wds' ),
132
  admin_url( 'admin.php?page=wds_settings&tab=tab_configs' ),
133
  esc_html__( 'Configs', 'wds' ),
134
  '_blank'
135
+ );
136
+ ?>
137
  </p>
138
 
139
+ <select
140
+ id="wds-subsite-config-id"
141
+ name="<?php echo esc_attr( $option_name ); ?>[wds_subsite_config_id]"
142
+ data-minimum-results-for-search="-1"
143
+ class="sui-select"
144
+ >
145
  <option <?php selected( ! $subsite_config_id ); ?>
146
+ value="">
147
  <?php esc_html_e( 'None', 'wds' ); ?>
148
  </option>
149
 
150
+ <?php foreach ( $collection->get_sorted_configs() as $config ) : ?>
151
+ <option <?php selected( $subsite_config_id, $config->get_id() ); ?>
152
+ value="<?php echo esc_attr( $config->get_id() ); ?>">
153
 
154
  <?php echo esc_html( $config->get_name() ); ?>
155
  </option>
161
  </div>
162
 
163
  <div class="sui-box-footer">
164
+ <button
165
+ name="submit"
166
+ type="submit"
167
+ class="sui-button sui-button-blue"
168
+ >
169
  <span class="sui-icon-save" aria-hidden="true"></span>
170
 
171
  <?php esc_html_e( 'Save Changes', 'wds' ); ?>
includes/admin/templates/notice.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  $message = empty( $message ) ? '' : $message;
3
- $class = empty( $class ) ? 'sui-notice-warning' : $class;
4
  ?>
5
  <div class="wds-notice sui-notice <?php echo esc_attr( $class ); ?>">
6
  <div class="sui-notice-content">
1
  <?php
2
  $message = empty( $message ) ? '' : $message;
3
+ $class = empty( $class ) ? 'sui-notice-warning' : $class;
4
  ?>
5
  <div class="wds-notice sui-notice <?php echo esc_attr( $class ); ?>">
6
  <div class="sui-notice-content">
includes/admin/templates/onpage/onpage-disabled.php CHANGED
@@ -1,10 +1,13 @@
1
  <?php
2
- $this->_render( 'disabled-component', array(
3
- 'content' => sprintf(
4
- '%s<br/>',
5
- esc_html__( 'Change the title and meta settings for your pages.', 'wds' )
6
- ),
7
- 'image' => 'sitemap-disabled.svg',
8
- 'component' => 'onpage',
9
- 'button_text' => esc_html__( 'Activate', 'wds' ),
10
- ) );
 
 
 
1
  <?php
2
+ $this->render_view(
3
+ 'disabled-component',
4
+ array(
5
+ 'content' => sprintf(
6
+ '%s<br/>',
7
+ esc_html__( 'Change the title and meta settings for your pages.', 'wds' )
8
+ ),
9
+ 'image' => 'sitemap-disabled.svg',
10
+ 'component' => 'onpage',
11
+ 'button_text' => esc_html__( 'Activate', 'wds' ),
12
+ )
13
+ );
includes/admin/templates/onpage/onpage-general-settings-inner.php CHANGED
@@ -1,40 +1,44 @@
1
  <?php
2
- $title_key = empty( $title_key ) ? '' : $title_key;
3
- $description_key = empty( $description_key ) ? '' : $description_key;
4
- $title_label_desc = empty( $title_label_desc ) ? '' : $title_label_desc;
5
- $title_field_desc = empty( $title_field_desc ) ? '' : $title_field_desc;
6
- $meta_label_desc = empty( $meta_label_desc ) ? '' : $meta_label_desc;
7
- $meta_field_desc = empty( $meta_field_desc ) ? '' : $meta_field_desc;
8
- $title = empty( $title ) ? '' : $title;
9
- $title_placeholder = empty( $title_placeholder ) ? '' : $title_placeholder;
10
- $description = empty( $description ) ? '' : $description;
11
  $description_placeholder = empty( $description_placeholder ) ? '' : $description_placeholder;
12
 
13
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
14
  $option_name_format = $option_name . '[%s]';
15
- $macros = empty( $macros ) ? array() : $macros;
16
  ?>
17
 
18
- <?php if ( $title_key ): ?>
19
  <div class="sui-box-settings-row wds-title-row">
20
  <div class="sui-box-settings-col-1">
21
- <label for="<?php echo esc_attr( $title_key ); ?>"
22
- class="sui-settings-label"><?php esc_html_e( 'Title', 'wds' ); ?></label>
 
 
23
  <span class="sui-description"><?php echo esc_html( $title_label_desc ); ?></span>
24
  </div>
25
  <div class="sui-box-settings-col-2">
26
  <label class="sui-label" for="<?php echo esc_attr( sprintf( $option_name_format, $title_key ) ); ?>">
27
  <?php esc_html_e( 'SEO Title', 'wds' ); ?>
28
- <span><?php echo esc_html( sprintf( __( '- Minimum of %d characters, max %d.', 'wds' ), smartcrawl_title_min_length(), smartcrawl_title_max_length() ) ); ?></span>
29
  </label>
30
 
31
  <div class="sui-insert-variables wds-allow-macros">
32
- <input id="<?php echo esc_attr( $title_key ); ?>"
33
- name="<?php echo esc_attr( sprintf( $option_name_format, $title_key ) ); ?>"
34
- type="text" class="sui-form-control"
35
- placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
36
- value="<?php echo esc_attr( $title ); ?>">
37
- <?php $this->_render( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
 
 
38
  </div>
39
 
40
  <span class="sui-description"><?php echo esc_html( $title_field_desc ); ?></span>
@@ -42,26 +46,30 @@ $macros = empty( $macros ) ? array() : $macros;
42
  </div>
43
  <?php endif; ?>
44
 
45
- <?php if ( $description_key ): ?>
46
  <div class="sui-box-settings-row wds-description-row">
47
  <div class="sui-box-settings-col-1">
48
- <label for="<?php echo esc_attr( $description_key ); ?>"
49
- class="sui-settings-label"><?php esc_html_e( 'Description', 'wds' ); ?></label>
 
 
50
  <span class="sui-description"><?php echo esc_html( $meta_label_desc ); ?></span>
51
  </div>
52
  <div class="sui-box-settings-col-2">
53
  <label class="sui-label" for="<?php echo esc_attr( sprintf( $option_name_format, $title_key ) ); ?>">
54
  <?php esc_html_e( 'Description', 'wds' ); ?>
55
- <span><?php echo esc_html( sprintf( __( '- Minimum of %d characters, max %d.', 'wds' ), smartcrawl_metadesc_min_length(), smartcrawl_metadesc_max_length() ) ); ?></span>
56
  </label>
57
 
58
  <div class="sui-insert-variables wds-allow-macros">
59
- <textarea id="<?php echo esc_attr( $description_key ); ?>"
60
- name="<?php echo esc_attr( sprintf( $option_name_format, $description_key ) ); ?>"
61
- type="text"
62
- placeholder="<?php echo esc_attr( $description_placeholder ); ?>"
63
- class="sui-form-control"><?php echo esc_textarea( $description ); ?></textarea>
64
- <?php $this->_render( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
 
 
65
  </div>
66
 
67
  <span class="sui-description"><?php echo esc_html( $meta_field_desc ); ?></span>
1
  <?php
2
+ $title_key = empty( $title_key ) ? '' : $title_key;
3
+ $description_key = empty( $description_key ) ? '' : $description_key;
4
+ $title_label_desc = empty( $title_label_desc ) ? '' : $title_label_desc;
5
+ $title_field_desc = empty( $title_field_desc ) ? '' : $title_field_desc;
6
+ $meta_label_desc = empty( $meta_label_desc ) ? '' : $meta_label_desc;
7
+ $meta_field_desc = empty( $meta_field_desc ) ? '' : $meta_field_desc;
8
+ $title = empty( $title ) ? '' : $title; // phpcs:ignore
9
+ $title_placeholder = empty( $title_placeholder ) ? '' : $title_placeholder;
10
+ $description = empty( $description ) ? '' : $description;
11
  $description_placeholder = empty( $description_placeholder ) ? '' : $description_placeholder;
12
 
13
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
14
  $option_name_format = $option_name . '[%s]';
15
+ $macros = empty( $macros ) ? array() : $macros;
16
  ?>
17
 
18
+ <?php if ( $title_key ) : ?>
19
  <div class="sui-box-settings-row wds-title-row">
20
  <div class="sui-box-settings-col-1">
21
+ <label
22
+ for="<?php echo esc_attr( $title_key ); ?>"
23
+ class="sui-settings-label"
24
+ ><?php esc_html_e( 'Title', 'wds' ); ?></label>
25
  <span class="sui-description"><?php echo esc_html( $title_label_desc ); ?></span>
26
  </div>
27
  <div class="sui-box-settings-col-2">
28
  <label class="sui-label" for="<?php echo esc_attr( sprintf( $option_name_format, $title_key ) ); ?>">
29
  <?php esc_html_e( 'SEO Title', 'wds' ); ?>
30
+ <span><?php echo esc_html( sprintf( __( '- Minimum of %1$d characters, max %2$d.', 'wds' ), smartcrawl_title_min_length(), smartcrawl_title_max_length() ) ); ?></span>
31
  </label>
32
 
33
  <div class="sui-insert-variables wds-allow-macros">
34
+ <input
35
+ id="<?php echo esc_attr( $title_key ); ?>"
36
+ name="<?php echo esc_attr( sprintf( $option_name_format, $title_key ) ); ?>"
37
+ type="text" class="sui-form-control"
38
+ placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
39
+ value="<?php echo esc_attr( $title ); ?>"
40
+ >
41
+ <?php $this->render_view( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
42
  </div>
43
 
44
  <span class="sui-description"><?php echo esc_html( $title_field_desc ); ?></span>
46
  </div>
47
  <?php endif; ?>
48
 
49
+ <?php if ( $description_key ) : ?>
50
  <div class="sui-box-settings-row wds-description-row">
51
  <div class="sui-box-settings-col-1">
52
+ <label
53
+ for="<?php echo esc_attr( $description_key ); ?>"
54
+ class="sui-settings-label"
55
+ ><?php esc_html_e( 'Description', 'wds' ); ?></label>
56
  <span class="sui-description"><?php echo esc_html( $meta_label_desc ); ?></span>
57
  </div>
58
  <div class="sui-box-settings-col-2">
59
  <label class="sui-label" for="<?php echo esc_attr( sprintf( $option_name_format, $title_key ) ); ?>">
60
  <?php esc_html_e( 'Description', 'wds' ); ?>
61
+ <span><?php echo esc_html( sprintf( __( '- Minimum of %1$d characters, max %2$d.', 'wds' ), smartcrawl_metadesc_min_length(), smartcrawl_metadesc_max_length() ) ); ?></span>
62
  </label>
63
 
64
  <div class="sui-insert-variables wds-allow-macros">
65
+ <textarea
66
+ id="<?php echo esc_attr( $description_key ); ?>"
67
+ name="<?php echo esc_attr( sprintf( $option_name_format, $description_key ) ); ?>"
68
+ type="text"
69
+ placeholder="<?php echo esc_attr( $description_placeholder ); ?>"
70
+ class="sui-form-control"
71
+ ><?php echo esc_textarea( $description ); ?></textarea>
72
+ <?php $this->render_view( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
73
  </div>
74
 
75
  <span class="sui-description"><?php echo esc_html( $meta_field_desc ); ?></span>
includes/admin/templates/onpage/onpage-general-settings.php CHANGED
@@ -1,34 +1,35 @@
1
  <?php
2
- $title_key = empty( $title_key ) ? '' : $title_key;
3
  $description_key = empty( $description_key ) ? '' : $description_key;
4
 
5
  $title_label_desc = empty( $title_label_desc )
6
  ? esc_html__( 'Choose the variables from which SmartCrawl will automatically generate your SEO title from.', 'wds' ) : $title_label_desc;
7
  $title_field_desc = empty( $title_field_desc )
8
  ? '' : $title_field_desc;
9
- $meta_label_desc = empty( $meta_label_desc )
10
  ? esc_html__( 'A title needs a description. Choose the variables to automatically generate a description from.', 'wds' ) : $meta_label_desc;
11
- $meta_field_desc = empty( $meta_field_desc )
12
  ? '' : $meta_field_desc;
13
 
14
  $options = empty( $_view['options'] ) ? array() : $_view['options'];
15
 
16
- $title = $title_key
17
- ? smartcrawl_get_array_value( $options, $title_key )
18
- : '';
19
  $description = $description_key
20
  ? smartcrawl_get_array_value( $options, $description_key )
21
  : '';
22
- $macros = empty( $macros ) ? array() : $macros;
23
 
24
- $this->_render( 'onpage/onpage-general-settings-inner', array(
25
- 'title_key' => $title_key,
26
- 'description_key' => $description_key,
27
- 'title_label_desc' => $title_label_desc,
28
- 'title_field_desc' => $title_field_desc,
29
- 'meta_label_desc' => $meta_label_desc,
30
- 'meta_field_desc' => $meta_field_desc,
31
- 'title' => $title,
32
- 'description' => $description,
33
- 'macros' => $macros,
34
- ) );
 
 
 
1
  <?php
2
+ $title_key = empty( $title_key ) ? '' : $title_key;
3
  $description_key = empty( $description_key ) ? '' : $description_key;
4
 
5
  $title_label_desc = empty( $title_label_desc )
6
  ? esc_html__( 'Choose the variables from which SmartCrawl will automatically generate your SEO title from.', 'wds' ) : $title_label_desc;
7
  $title_field_desc = empty( $title_field_desc )
8
  ? '' : $title_field_desc;
9
+ $meta_label_desc = empty( $meta_label_desc )
10
  ? esc_html__( 'A title needs a description. Choose the variables to automatically generate a description from.', 'wds' ) : $meta_label_desc;
11
+ $meta_field_desc = empty( $meta_field_desc )
12
  ? '' : $meta_field_desc;
13
 
14
  $options = empty( $_view['options'] ) ? array() : $_view['options'];
15
 
16
+ $title = $title_key ? smartcrawl_get_array_value( $options, $title_key ) : ''; // phpcs:ignore
 
 
17
  $description = $description_key
18
  ? smartcrawl_get_array_value( $options, $description_key )
19
  : '';
20
+ $macros = empty( $macros ) ? array() : $macros;
21
 
22
+ $this->render_view(
23
+ 'onpage/onpage-general-settings-inner',
24
+ array(
25
+ 'title_key' => $title_key,
26
+ 'description_key' => $description_key,
27
+ 'title_label_desc' => $title_label_desc,
28
+ 'title_field_desc' => $title_field_desc,
29
+ 'meta_label_desc' => $meta_label_desc,
30
+ 'meta_field_desc' => $meta_field_desc,
31
+ 'title' => $title,
32
+ 'description' => $description,
33
+ 'macros' => $macros,
34
+ )
35
+ );
includes/admin/templates/onpage/onpage-header-actions.php CHANGED
@@ -1,5 +1,7 @@
1
- <button type="button"
2
- data-modal-open="wds-supported-macros-modal"
3
- data-modal-open-focus="wds-supported-macros-modal-close-button"
4
- data-modal-close-focus="container"
5
- class="sui-button sui-button-ghost"><?php esc_html_e( 'Browse Macros', 'wds' ); ?></button>
 
 
1
+ <button
2
+ type="button"
3
+ data-modal-open="wds-supported-macros-modal"
4
+ data-modal-open-focus="wds-supported-macros-modal-close-button"
5
+ data-modal-close-focus="container"
6
+ class="sui-button sui-button-ghost"
7
+ ><?php esc_html_e( 'Browse Macros', 'wds' ); ?></button>
includes/admin/templates/onpage/onpage-list-homepage.php CHANGED
@@ -1,39 +1,48 @@
1
  <?php
2
  $meta_robots_main_blog_archive = empty( $meta_robots_main_blog_archive ) ? '' : $meta_robots_main_blog_archive;
3
- $macros = Smartcrawl_Onpage_Settings::get_general_macros();
4
  ?>
5
 
6
- <?php $this->_render( 'onpage/onpage-preview' ); ?>
7
 
8
  <?php
9
- $this->_render( 'onpage/onpage-general-settings', array(
10
- 'title_key' => 'title-home',
11
- 'title_label_desc' => esc_html__( 'Define the main title of your website that Google will index.', 'wds' ),
12
- 'title_field_desc' => esc_html__( 'This is generally your brand name, sometimes with a tagline.', 'wds' ),
 
 
 
 
 
 
 
 
13
 
14
- 'description_key' => 'metadesc-home',
15
- 'meta_label_desc' => esc_html__( 'Set the default description that will accompany your SEO title in search engine results.', 'wds' ),
16
- 'meta_field_desc' => esc_html__( 'Remember to keep it simple, to the point, and include a bit about what your website can offer potential visitors.', 'wds' ),
17
- 'macros' => $macros,
18
- ) );
19
-
20
- $this->_render( 'onpage/onpage-og-twitter', array(
21
- 'for_type' => 'home',
22
- 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when your homepage is shared on them.', 'wds' ),
23
  'macros' => $macros,
24
- ) );
 
25
 
26
- $this->_render( 'onpage/onpage-meta-robots', array(
27
- 'items' => $meta_robots_main_blog_archive,
28
- ) );
 
 
 
29
  ?>
30
 
31
  <footer class="sui-box-footer">
32
- <button name="submit"
33
- type="submit"
34
- class="sui-button sui-button-blue">
 
 
35
  <span class="sui-icon-save" aria-hidden="true"></span>
36
-
37
  <?php echo esc_html__( 'Save Settings', 'wds' ); ?>
38
  </button>
39
  </footer>
1
  <?php
2
  $meta_robots_main_blog_archive = empty( $meta_robots_main_blog_archive ) ? '' : $meta_robots_main_blog_archive;
3
+ $macros = Smartcrawl_Onpage_Settings::get_general_macros();
4
  ?>
5
 
6
+ <?php $this->render_view( 'onpage/onpage-preview' ); ?>
7
 
8
  <?php
9
+ $this->render_view(
10
+ 'onpage/onpage-general-settings',
11
+ array(
12
+ 'title_key' => 'title-home',
13
+ 'title_label_desc' => esc_html__( 'Define the main title of your website that Google will index.', 'wds' ),
14
+ 'title_field_desc' => esc_html__( 'This is generally your brand name, sometimes with a tagline.', 'wds' ),
15
+ 'description_key' => 'metadesc-home',
16
+ 'meta_label_desc' => esc_html__( 'Set the default description that will accompany your SEO title in search engine results.', 'wds' ),
17
+ 'meta_field_desc' => esc_html__( 'Remember to keep it simple, to the point, and include a bit about what your website can offer potential visitors.', 'wds' ),
18
+ 'macros' => $macros,
19
+ )
20
+ );
21
 
22
+ $this->render_view(
23
+ 'onpage/onpage-og-twitter',
24
+ array(
25
+ 'for_type' => 'home',
26
+ 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when your homepage is shared on them.', 'wds' ),
 
 
 
 
27
  'macros' => $macros,
28
+ )
29
+ );
30
 
31
+ $this->render_view(
32
+ 'onpage/onpage-meta-robots',
33
+ array(
34
+ 'items' => $meta_robots_main_blog_archive,
35
+ )
36
+ );
37
  ?>
38
 
39
  <footer class="sui-box-footer">
40
+ <button
41
+ name="submit"
42
+ type="submit"
43
+ class="sui-button sui-button-blue"
44
+ >
45
  <span class="sui-icon-save" aria-hidden="true"></span>
 
46
  <?php echo esc_html__( 'Save Settings', 'wds' ); ?>
47
  </button>
48
  </footer>
includes/admin/templates/onpage/onpage-macros-modal.php CHANGED
@@ -14,16 +14,16 @@ $macros = array(
14
  <div class="wds-conditional">
15
  <p>
16
  <select title="">
17
- <?php foreach ( $macros as $type => $type_macros ): ?>
18
- <option value="<?php echo esc_attr( $type ); ?>">
19
- <?php echo esc_html( $type ); ?>
20
  </option>
21
  <?php endforeach; ?>
22
  </select>
23
  </p>
24
 
25
- <?php foreach ( $macros as $type => $type_macros ): ?>
26
- <div class="wds-conditional-inside" data-conditional-val="<?php echo esc_attr( $type ); ?>">
27
  <div id="wds-show-supported-macros">
28
  <table class="sui-table">
29
  <thead>
14
  <div class="wds-conditional">
15
  <p>
16
  <select title="">
17
+ <?php foreach ( $macros as $macro_type => $type_macros ) : ?>
18
+ <option value="<?php echo esc_attr( $macro_type ); ?>">
19
+ <?php echo esc_html( $macro_type ); ?>
20
  </option>
21
  <?php endforeach; ?>
22
  </select>
23
  </p>
24
 
25
+ <?php foreach ( $macros as $macro_type => $type_macros ) : ?>
26
+ <div class="wds-conditional-inside" data-conditional-val="<?php echo esc_attr( $macro_type ); ?>">
27
  <div id="wds-show-supported-macros">
28
  <table class="sui-table">
29
  <thead>
includes/admin/templates/onpage/onpage-meta-character-lengths.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
- $label = empty( $label ) ? '' : $label;
3
- $toggle_name = empty( $toggle_name ) ? '' : $toggle_name;
4
  $min_field_name = empty( $min_field_name ) ? '' : $min_field_name;
5
  $max_field_name = empty( $max_field_name ) ? '' : $max_field_name;
6
- $default_min = empty( $default_min ) ? 0 : $default_min;
7
- $default_max = empty( $default_max ) ? 0 : $default_max;
8
 
9
- $options = empty( $_view['options'] ) ? array() : $_view['options'];
10
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
11
 
12
- $custom_char_lengths = (boolean) smartcrawl_get_array_value( $options, $toggle_name );
13
- $custom_min_limit = (int) smartcrawl_get_array_value( $options, $min_field_name );
14
  if ( $custom_min_limit <= 0 ) {
15
  $custom_min_limit = $default_min;
16
  }
@@ -22,11 +22,13 @@ if ( $custom_max_limit <= 0 ) {
22
 
23
  <strong><?php echo esc_html( $label ); ?></strong>
24
  <span class="sui-description">
25
- <?php printf(
26
- esc_html__( 'Recommended length is between %d and %d characters.', 'wds' ),
27
- $default_min,
28
- $default_max
29
- ); ?>
 
 
30
  </span>
31
 
32
  <div class="sui-side-tabs sui-tabs">
@@ -34,15 +36,23 @@ if ( $custom_max_limit <= 0 ) {
34
  <label class="<?php echo $custom_char_lengths ? '' : 'active'; ?>">
35
  <?php esc_html_e( 'Default', 'wds' ); ?>
36
 
37
- <input name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $toggle_name ); ?>]" <?php checked( $custom_char_lengths, false ); ?>
38
- value="0" type="radio"/>
 
 
 
 
39
  </label>
40
 
41
  <label class="<?php echo $custom_char_lengths ? 'active' : ''; ?>">
42
  <?php esc_html_e( 'Custom', 'wds' ); ?>
43
 
44
- <input name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $toggle_name ); ?>]" <?php checked( $custom_char_lengths ); ?>
45
- value="1" type="radio"/>
 
 
 
 
46
  </label>
47
  </div>
48
 
@@ -54,7 +64,7 @@ if ( $custom_max_limit <= 0 ) {
54
  <td>
55
  <span class="sui-description">
56
  <strong>
57
- <?php printf( esc_html__( '%d characters', 'wds' ), $default_min ); ?>
58
  </strong>
59
  </span>
60
  </td>
@@ -64,7 +74,7 @@ if ( $custom_max_limit <= 0 ) {
64
  <td>
65
  <span class="sui-description">
66
  <strong>
67
- <?php printf( esc_html__( '%d characters', 'wds' ), $default_max ); ?>
68
  </strong>
69
  </span>
70
  </td>
@@ -80,11 +90,15 @@ if ( $custom_max_limit <= 0 ) {
80
  <?php esc_html_e( 'Minimum', 'wds' ); ?>
81
  </label>
82
  </td>
83
- <td><input type="number"
84
- id="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $min_field_name ); ?>]"
85
- name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $min_field_name ); ?>]"
86
- value="<?php echo esc_attr( $custom_min_limit ); ?>"
87
- class="sui-form-control sui-input-sm"/></td>
 
 
 
 
88
  </tr>
89
  <tr>
90
  <td class="sui-table-item-title">
@@ -92,11 +106,17 @@ if ( $custom_max_limit <= 0 ) {
92
  <?php esc_html_e( 'Maximum', 'wds' ); ?>
93
  </label>
94
  </td>
95
- <td><label><input type="number"
96
- id="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $max_field_name ); ?>]"
97
- name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $max_field_name ); ?>]"
98
- value="<?php echo esc_attr( $custom_max_limit ); ?>"
99
- class="sui-form-control sui-input-sm"/></label></td>
 
 
 
 
 
 
100
  </tr>
101
  </table>
102
  </div>
1
  <?php
2
+ $label = empty( $label ) ? '' : $label;
3
+ $toggle_name = empty( $toggle_name ) ? '' : $toggle_name;
4
  $min_field_name = empty( $min_field_name ) ? '' : $min_field_name;
5
  $max_field_name = empty( $max_field_name ) ? '' : $max_field_name;
6
+ $default_min = empty( $default_min ) ? 0 : $default_min;
7
+ $default_max = empty( $default_max ) ? 0 : $default_max;
8
 
9
+ $options = empty( $_view['options'] ) ? array() : $_view['options'];
10
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
11
 
12
+ $custom_char_lengths = (bool) smartcrawl_get_array_value( $options, $toggle_name );
13
+ $custom_min_limit = (int) smartcrawl_get_array_value( $options, $min_field_name );
14
  if ( $custom_min_limit <= 0 ) {
15
  $custom_min_limit = $default_min;
16
  }
22
 
23
  <strong><?php echo esc_html( $label ); ?></strong>
24
  <span class="sui-description">
25
+ <?php
26
+ printf(
27
+ esc_html__( 'Recommended length is between %1$d and %2$d characters.', 'wds' ), // phpcs:ignore
28
+ esc_html( $default_min ),
29
+ esc_html( $default_max )
30
+ );
31
+ ?>
32
  </span>
33
 
34
  <div class="sui-side-tabs sui-tabs">
36
  <label class="<?php echo $custom_char_lengths ? '' : 'active'; ?>">
37
  <?php esc_html_e( 'Default', 'wds' ); ?>
38
 
39
+ <input
40
+ name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $toggle_name ); ?>]"
41
+ <?php checked( $custom_char_lengths, false ); ?>
42
+ value="0"
43
+ type="radio"
44
+ />
45
  </label>
46
 
47
  <label class="<?php echo $custom_char_lengths ? 'active' : ''; ?>">
48
  <?php esc_html_e( 'Custom', 'wds' ); ?>
49
 
50
+ <input
51
+ name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $toggle_name ); ?>]"
52
+ <?php checked( $custom_char_lengths ); ?>
53
+ value="1"
54
+ type="radio"
55
+ />
56
  </label>
57
  </div>
58
 
64
  <td>
65
  <span class="sui-description">
66
  <strong>
67
+ <?php printf( esc_html__( '%d characters', 'wds' ), esc_html( $default_min ) ); ?>
68
  </strong>
69
  </span>
70
  </td>
74
  <td>
75
  <span class="sui-description">
76
  <strong>
77
+ <?php printf( esc_html__( '%d characters', 'wds' ), esc_html( $default_max ) ); ?>
78
  </strong>
79
  </span>
80
  </td>
90
  <?php esc_html_e( 'Minimum', 'wds' ); ?>
91
  </label>
92
  </td>
93
+ <td>
94
+ <input
95
+ type="number"
96
+ id="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $min_field_name ); ?>]"
97
+ name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $min_field_name ); ?>]"
98
+ value="<?php echo esc_attr( $custom_min_limit ); ?>"
99
+ class="sui-form-control sui-input-sm"
100
+ />
101
+ </td>
102
  </tr>
103
  <tr>
104
  <td class="sui-table-item-title">
106
  <?php esc_html_e( 'Maximum', 'wds' ); ?>
107
  </label>
108
  </td>
109
+ <td>
110
+ <label>
111
+ <input
112
+ type="number"
113
+ id="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $max_field_name ); ?>]"
114
+ name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $max_field_name ); ?>]"
115
+ value="<?php echo esc_attr( $custom_max_limit ); ?>"
116
+ class="sui-form-control sui-input-sm"
117
+ />
118
+ </label>
119
+ </td>
120
  </tr>
121
  </table>
122
  </div>
includes/admin/templates/onpage/onpage-meta-robots.php CHANGED
@@ -5,9 +5,12 @@ if ( ! $items ) {
5
  return;
6
  }
7
 
8
- $this->_render( 'toggle-group', array(
9
- 'label' => esc_html__( 'Indexing', 'wds' ),
10
- 'description' => esc_html__( 'Choose whether you want your website to appear in search results.', 'wds' ),
11
- 'separator' => true,
12
- 'items' => $items,
13
- ) );
 
 
 
5
  return;
6
  }
7
 
8
+ $this->render_view(
9
+ 'toggle-group',
10
+ array(
11
+ 'label' => esc_html__( 'Indexing', 'wds' ),
12
+ 'description' => esc_html__( 'Choose whether you want your website to appear in search results.', 'wds' ),
13
+ 'separator' => true,
14
+ 'items' => $items,
15
+ )
16
+ );
includes/admin/templates/onpage/onpage-og-disabled.php CHANGED
@@ -2,7 +2,7 @@
2
  $message = esc_html__( 'OpenGraph is globally disabled.', 'wds' );
3
  if ( Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL ) ) {
4
  $social_page = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SOCIAL );
5
- $message = sprintf(
6
  esc_html__( '%1$s You can enable it %2$s.', 'wds' ),
7
  $message,
8
  sprintf(
@@ -13,7 +13,10 @@ if ( Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL
13
  );
14
  }
15
 
16
- $this->_render( 'notice', array(
17
- 'class' => 'sui-notice-info',
18
- 'message' => $message,
19
- ) );
 
 
 
2
  $message = esc_html__( 'OpenGraph is globally disabled.', 'wds' );
3
  if ( Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL ) ) {
4
  $social_page = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SOCIAL );
5
+ $message = sprintf(
6
  esc_html__( '%1$s You can enable it %2$s.', 'wds' ),
7
  $message,
8
  sprintf(
13
  );
14
  }
15
 
16
+ $this->render_view(
17
+ 'notice',
18
+ array(
19
+ 'class' => 'sui-notice-info',
20
+ 'message' => $message,
21
+ )
22
+ );
includes/admin/templates/onpage/onpage-og-settings.php CHANGED
@@ -1,47 +1,47 @@
1
  <?php
2
  /**
3
- * @var string $for_type
 
 
4
  */
 
5
  $section_enabled_field_id = 'og-active-' . $for_type;
6
- $section_enabled = ! empty( $_view['options'][ $section_enabled_field_id ] ) ? $_view['options'][ $section_enabled_field_id ] : false;
7
- $section_title = __( 'Enable OpenGraph', 'wds' );
8
- $section_description = empty( $section_description )
9
  ? esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook.', 'wds' )
10
  : $section_description;
11
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
12
- $title_field_id = 'og-title-' . $for_type;
13
- $current_title = ! empty( $_view['options']["og-title-{$for_type}"] )
14
- ? $_view['options']["og-title-{$for_type}"]
15
- : '';
16
 
17
  $description_field_id = 'og-description-' . $for_type;
18
- $current_description = ! empty( $_view['options']["og-description-{$for_type}"] )
19
- ? $_view['options']["og-description-{$for_type}"]
20
- : '';
21
 
22
  $images_field_id = 'og-images-' . $for_type;
23
- $current_images = ! empty( $_view['options']["og-images-{$for_type}"] ) && is_array( $_view['options']["og-images-{$for_type}"] )
24
- ? $_view['options']["og-images-{$for_type}"]
25
- : array();
26
- $macros = empty( $macros ) ? array() : $macros;
27
 
28
  $disable_first_image_id = 'og-disable-first-image-' . $for_type;
29
- $disable_first_image = ! empty( $_view['options'][ $disable_first_image_id ] );
30
 
31
- $this->_render( 'onpage/onpage-social-meta-tags', array(
32
- 'for_type' => $for_type,
33
- 'section_enabled_field_id' => $section_enabled_field_id,
34
- 'section_enabled' => $section_enabled,
35
- 'section_title' => $section_title,
36
- 'section_description' => $section_description,
37
- 'option_name' => $option_name,
38
- 'title_field_id' => $title_field_id,
39
- 'current_title' => $current_title,
40
- 'description_field_id' => $description_field_id,
41
- 'current_description' => $current_description,
42
- 'images_field_id' => $images_field_id,
43
- 'current_images' => $current_images,
44
- 'disable_first_image_id' => $disable_first_image_id,
45
- 'disable_first_image' => $disable_first_image,
46
- 'macros' => $macros,
47
- ) );
 
 
 
1
  <?php
2
  /**
3
+ * @var string $for_type Type.
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
  $section_enabled_field_id = 'og-active-' . $for_type;
9
+ $section_enabled = ! empty( $_view['options'][ $section_enabled_field_id ] ) ? $_view['options'][ $section_enabled_field_id ] : false;
10
+ $section_title = __( 'Enable OpenGraph', 'wds' );
11
+ $section_description = empty( $section_description )
12
  ? esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook.', 'wds' )
13
  : $section_description;
14
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
15
+ $title_field_id = 'og-title-' . $for_type;
16
+ $current_title = ! empty( $_view['options'][ "og-title-{$for_type}" ] ) ? $_view['options'][ "og-title-{$for_type}" ] : '';
 
 
17
 
18
  $description_field_id = 'og-description-' . $for_type;
19
+ $current_description = ! empty( $_view['options'][ "og-description-{$for_type}" ] ) ? $_view['options'][ "og-description-{$for_type}" ] : '';
 
 
20
 
21
  $images_field_id = 'og-images-' . $for_type;
22
+ $current_images = ! empty( $_view['options'][ "og-images-{$for_type}" ] ) && is_array( $_view['options'][ "og-images-{$for_type}" ] ) ? $_view['options'][ "og-images-{$for_type}" ] : array();
23
+ $macros = empty( $macros ) ? array() : $macros;
 
 
24
 
25
  $disable_first_image_id = 'og-disable-first-image-' . $for_type;
26
+ $disable_first_image = ! empty( $_view['options'][ $disable_first_image_id ] );
27
 
28
+ $this->render_view(
29
+ 'onpage/onpage-social-meta-tags',
30
+ array(
31
+ 'for_type' => $for_type,
32
+ 'section_enabled_field_id' => $section_enabled_field_id,
33
+ 'section_enabled' => $section_enabled,
34
+ 'section_title' => $section_title,
35
+ 'section_description' => $section_description,
36
+ 'option_name' => $option_name,
37
+ 'title_field_id' => $title_field_id,
38
+ 'current_title' => $current_title,
39
+ 'description_field_id' => $description_field_id,
40
+ 'current_description' => $current_description,
41
+ 'images_field_id' => $images_field_id,
42
+ 'current_images' => $current_images,
43
+ 'disable_first_image_id' => $disable_first_image_id,
44
+ 'disable_first_image' => $disable_first_image,
45
+ 'macros' => $macros,
46
+ )
47
+ );
includes/admin/templates/onpage/onpage-og-twitter.php CHANGED
@@ -1,22 +1,25 @@
1
  <?php
2
  /**
3
  * @var string $for_type
 
 
4
  */
5
- $social_options = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SOCIAL );
6
- $onpage_options = ! empty( $_view['options'] ) ? $_view['options'] : array();
 
7
  $social_label_desc = empty( $social_label_desc )
8
  ? esc_html__( 'Enable or disable support for social platforms when this content is shared on them.', 'wds' ) : $social_label_desc;
9
 
10
  $og_enabled_field_id = 'og-active-' . esc_attr( $for_type );
11
  $og_enabled_globally = smartcrawl_get_array_value( $social_options, 'og-enable' );
12
- $og_enabled_locally = ! empty( $onpage_options[ $og_enabled_field_id ] ) ? $onpage_options[ $og_enabled_field_id ] : false;
13
- $og_description = empty( $og_description ) ? '' : $og_description;
14
 
15
  $twitter_enabled_field_id = 'twitter-active-' . esc_attr( $for_type );
16
  $twitter_enabled_globally = smartcrawl_get_array_value( $social_options, 'twitter-card-enable' );
17
- $twitter_enabled_locally = ! empty( $onpage_options[ $twitter_enabled_field_id ] ) ? $onpage_options[ $twitter_enabled_field_id ] : false;
18
- $twitter_description = empty( $twitter_description ) ? '' : $twitter_description;
19
- $macros = empty( $macros ) ? array() : $macros;
20
  ?>
21
  <div class="sui-box-settings-row wds-social-row">
22
  <div class="sui-box-settings-col-1">
@@ -28,26 +31,32 @@ $macros = empty( $macros ) ? array() : $macros;
28
  <div class="sui-box-settings-col-2">
29
  <?php
30
  if ( ! $og_enabled_globally ) {
31
- $this->_render( 'onpage/onpage-og-disabled' );
32
  } else {
33
- $this->_render( 'onpage/onpage-og-settings', array(
34
- 'for_type' => $for_type,
35
- 'section_description' => $og_description,
36
- 'macros' => $macros,
37
- ) );
 
 
 
38
  }
39
  ?>
40
  <p></p>
41
 
42
  <?php
43
  if ( ! $twitter_enabled_globally ) {
44
- $this->_render( 'onpage/onpage-twitter-disabled' );
45
  } else {
46
- $this->_render( 'onpage/onpage-twitter-settings', array(
47
- 'for_type' => $for_type,
48
- 'section_description' => $twitter_description,
49
- 'macros' => $macros,
50
- ) );
 
 
 
51
  }
52
  ?>
53
  </div>
1
  <?php
2
  /**
3
  * @var string $for_type
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
+ $social_options = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SOCIAL );
9
+ $onpage_options = ! empty( $_view['options'] ) ? $_view['options'] : array();
10
  $social_label_desc = empty( $social_label_desc )
11
  ? esc_html__( 'Enable or disable support for social platforms when this content is shared on them.', 'wds' ) : $social_label_desc;
12
 
13
  $og_enabled_field_id = 'og-active-' . esc_attr( $for_type );
14
  $og_enabled_globally = smartcrawl_get_array_value( $social_options, 'og-enable' );
15
+ $og_enabled_locally = ! empty( $onpage_options[ $og_enabled_field_id ] ) ? $onpage_options[ $og_enabled_field_id ] : false;
16
+ $og_description = empty( $og_description ) ? '' : $og_description;
17
 
18
  $twitter_enabled_field_id = 'twitter-active-' . esc_attr( $for_type );
19
  $twitter_enabled_globally = smartcrawl_get_array_value( $social_options, 'twitter-card-enable' );
20
+ $twitter_enabled_locally = ! empty( $onpage_options[ $twitter_enabled_field_id ] ) ? $onpage_options[ $twitter_enabled_field_id ] : false;
21
+ $twitter_description = empty( $twitter_description ) ? '' : $twitter_description;
22
+ $macros = empty( $macros ) ? array() : $macros;
23
  ?>
24
  <div class="sui-box-settings-row wds-social-row">
25
  <div class="sui-box-settings-col-1">
31
  <div class="sui-box-settings-col-2">
32
  <?php
33
  if ( ! $og_enabled_globally ) {
34
+ $this->render_view( 'onpage/onpage-og-disabled' );
35
  } else {
36
+ $this->render_view(
37
+ 'onpage/onpage-og-settings',
38
+ array(
39
+ 'for_type' => $for_type,
40
+ 'section_description' => $og_description,
41
+ 'macros' => $macros,
42
+ )
43
+ );
44
  }
45
  ?>
46
  <p></p>
47
 
48
  <?php
49
  if ( ! $twitter_enabled_globally ) {
50
+ $this->render_view( 'onpage/onpage-twitter-disabled' );
51
  } else {
52
+ $this->render_view(
53
+ 'onpage/onpage-twitter-settings',
54
+ array(
55
+ 'for_type' => $for_type,
56
+ 'section_description' => $twitter_description,
57
+ 'macros' => $macros,
58
+ )
59
+ );
60
  }
61
  ?>
62
  </div>
includes/admin/templates/onpage/onpage-preview.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  $smartcrawl_options = Smartcrawl_Settings::get_options();
3
- $showing_default = ! isset( $link ) && ! isset( $title ) && ! isset( $description );
4
- $link = ! isset( $link ) ? home_url() : $link;
5
- $title = ! isset( $title ) ? get_bloginfo( 'name' ) : $title;
6
- $description = ! isset( $description ) ? get_bloginfo( 'description' ) : $description;
7
  ?>
8
  <div class="wds-preview-container" data-showing-default="<?php echo empty( $showing_default ) ? 'false' : 'true'; ?>">
9
  <div class="wds-preview">
1
  <?php
2
  $smartcrawl_options = Smartcrawl_Settings::get_options();
3
+ $showing_default = ! isset( $link ) && ! isset( $title ) && ! isset( $description );
4
+ $link = ! isset( $link ) ? home_url() : $link; // phpcs:ignore
5
+ $title = ! isset( $title ) ? get_bloginfo( 'name' ) : $title; // phpcs:ignore
6
+ $description = ! isset( $description ) ? get_bloginfo( 'description' ) : $description;
7
  ?>
8
  <div class="wds-preview-container" data-showing-default="<?php echo empty( $showing_default ) ? 'false' : 'true'; ?>">
9
  <div class="wds-preview">
includes/admin/templates/onpage/onpage-section-404.php CHANGED
@@ -1,9 +1,12 @@
1
  <?php
2
  $macros = Smartcrawl_Onpage_Settings::get_general_macros();
3
- $this->_render( 'onpage/onpage-preview' );
4
 
5
- $this->_render( 'onpage/onpage-general-settings', array(
6
- 'title_key' => 'title-404',
7
- 'description_key' => 'metadesc-404',
8
- 'macros' => $macros,
9
- ) );
 
 
 
1
  <?php
2
  $macros = Smartcrawl_Onpage_Settings::get_general_macros();
3
+ $this->render_view( 'onpage/onpage-preview' );
4
 
5
+ $this->render_view(
6
+ 'onpage/onpage-general-settings',
7
+ array(
8
+ 'title_key' => 'title-404',
9
+ 'description_key' => 'metadesc-404',
10
+ 'macros' => $macros,
11
+ )
12
+ );
includes/admin/templates/onpage/onpage-section-author-archive.php CHANGED
@@ -1,23 +1,32 @@
1
  <?php
2
  $meta_robots_author = empty( $meta_robots_author ) ? '' : $meta_robots_author;
3
- $macros = array_merge(
4
  Smartcrawl_Onpage_Settings::get_author_macros(),
5
  Smartcrawl_Onpage_Settings::get_general_macros()
6
  );
7
 
8
- $this->_render( 'onpage/onpage-preview' );
9
 
10
- $this->_render( 'onpage/onpage-general-settings', array(
11
- 'title_key' => 'title-author',
12
- 'description_key' => 'metadesc-author',
13
- 'macros' => $macros,
14
- ) );
 
 
 
15
 
16
- $this->_render( 'onpage/onpage-og-twitter', array(
17
- 'for_type' => 'author',
18
- 'macros' => $macros,
19
- ) );
 
 
 
20
 
21
- $this->_render( 'onpage/onpage-meta-robots', array(
22
- 'items' => $meta_robots_author,
23
- ) );
 
 
 
1
  <?php
2
  $meta_robots_author = empty( $meta_robots_author ) ? '' : $meta_robots_author;
3
+ $macros = array_merge(
4
  Smartcrawl_Onpage_Settings::get_author_macros(),
5
  Smartcrawl_Onpage_Settings::get_general_macros()
6
  );
7
 
8
+ $this->render_view( 'onpage/onpage-preview' );
9
 
10
+ $this->render_view(
11
+ 'onpage/onpage-general-settings',
12
+ array(
13
+ 'title_key' => 'title-author',
14
+ 'description_key' => 'metadesc-author',
15
+ 'macros' => $macros,
16
+ )
17
+ );
18
 
19
+ $this->render_view(
20
+ 'onpage/onpage-og-twitter',
21
+ array(
22
+ 'for_type' => 'author',
23
+ 'macros' => $macros,
24
+ )
25
+ );
26
 
27
+ $this->render_view(
28
+ 'onpage/onpage-meta-robots',
29
+ array(
30
+ 'items' => $meta_robots_author,
31
+ )
32
+ );
includes/admin/templates/onpage/onpage-section-buddypress-groups.php CHANGED
@@ -1,25 +1,34 @@
1
  <?php
2
  $meta_robots_bp_groups = empty( $meta_robots_bp_groups ) ? array() : $meta_robots_bp_groups;
3
- $this->_render( 'onpage/onpage-preview' );
4
  $macros = array_merge(
5
  Smartcrawl_Onpage_Settings::get_bp_group_macros(),
6
  Smartcrawl_Onpage_Settings::get_general_macros()
7
  );
8
 
9
- $this->_render( 'onpage/onpage-general-settings', array(
10
- 'title_key' => 'title-bp_groups',
11
- 'description_key' => 'metadesc-bp_groups',
12
- 'macros' => $macros,
13
- ) );
 
 
 
14
 
15
- $this->_render( 'onpage/onpage-og-twitter', array(
16
- 'for_type' => 'bp_groups',
17
- 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when a BuddyPress group is shared on them.', 'wds' ),
18
- 'og_description' => esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook.', 'wds' ),
19
- 'twitter_description' => esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter.', 'wds' ),
20
- 'macros' => $macros,
21
- ) );
 
 
 
22
 
23
- $this->_render( 'onpage/onpage-meta-robots', array(
24
- 'items' => $meta_robots_bp_groups,
25
- ) );
 
 
 
1
  <?php
2
  $meta_robots_bp_groups = empty( $meta_robots_bp_groups ) ? array() : $meta_robots_bp_groups;
3
+ $this->render_view( 'onpage/onpage-preview' );
4
  $macros = array_merge(
5
  Smartcrawl_Onpage_Settings::get_bp_group_macros(),
6
  Smartcrawl_Onpage_Settings::get_general_macros()
7
  );
8
 
9
+ $this->render_view(
10
+ 'onpage/onpage-general-settings',
11
+ array(
12
+ 'title_key' => 'title-bp_groups',
13
+ 'description_key' => 'metadesc-bp_groups',
14
+ 'macros' => $macros,
15
+ )
16
+ );
17
 
18
+ $this->render_view(
19
+ 'onpage/onpage-og-twitter',
20
+ array(
21
+ 'for_type' => 'bp_groups',
22
+ 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when a BuddyPress group is shared on them.', 'wds' ),
23
+ 'og_description' => esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook.', 'wds' ),
24
+ 'twitter_description' => esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter.', 'wds' ),
25
+ 'macros' => $macros,
26
+ )
27
+ );
28
 
29
+ $this->render_view(
30
+ 'onpage/onpage-meta-robots',
31
+ array(
32
+ 'items' => $meta_robots_bp_groups,
33
+ )
34
+ );
includes/admin/templates/onpage/onpage-section-buddypress-profile.php CHANGED
@@ -1,25 +1,34 @@
1
  <?php
2
  $meta_robots_bp_profile = empty( $meta_robots_bp_profile ) ? array() : $meta_robots_bp_profile;
3
- $this->_render( 'onpage/onpage-preview' );
4
  $macros = array_merge(
5
  Smartcrawl_Onpage_Settings::get_bp_profile_macros(),
6
  Smartcrawl_Onpage_Settings::get_general_macros()
7
  );
8
 
9
- $this->_render( 'onpage/onpage-general-settings', array(
10
- 'title_key' => 'title-bp_profile',
11
- 'description_key' => 'metadesc-bp_profile',
12
- 'macros' => $macros,
13
- ) );
 
 
 
14
 
15
- $this->_render( 'onpage/onpage-og-twitter', array(
16
- 'for_type' => 'bp_profile',
17
- 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when a BuddyPress profile is shared on them.', 'wds' ),
18
- 'og_description' => esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook.', 'wds' ),
19
- 'twitter_description' => esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter.', 'wds' ),
20
- 'macros' => $macros,
21
- ) );
 
 
 
22
 
23
- $this->_render( 'onpage/onpage-meta-robots', array(
24
- 'items' => $meta_robots_bp_profile,
25
- ) );
 
 
 
1
  <?php
2
  $meta_robots_bp_profile = empty( $meta_robots_bp_profile ) ? array() : $meta_robots_bp_profile;
3
+ $this->render_view( 'onpage/onpage-preview' );
4
  $macros = array_merge(
5
  Smartcrawl_Onpage_Settings::get_bp_profile_macros(),
6
  Smartcrawl_Onpage_Settings::get_general_macros()
7
  );
8
 
9
+ $this->render_view(
10
+ 'onpage/onpage-general-settings',
11
+ array(
12
+ 'title_key' => 'title-bp_profile',
13
+ 'description_key' => 'metadesc-bp_profile',
14
+ 'macros' => $macros,
15
+ )
16
+ );
17
 
18
+ $this->render_view(
19
+ 'onpage/onpage-og-twitter',
20
+ array(
21
+ 'for_type' => 'bp_profile',
22
+ 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when a BuddyPress profile is shared on them.', 'wds' ),
23
+ 'og_description' => esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook.', 'wds' ),
24
+ 'twitter_description' => esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter.', 'wds' ),
25
+ 'macros' => $macros,
26
+ )
27
+ );
28
 
29
+ $this->render_view(
30
+ 'onpage/onpage-meta-robots',
31
+ array(
32
+ 'items' => $meta_robots_bp_profile,
33
+ )
34
+ );
includes/admin/templates/onpage/onpage-section-date-archive.php CHANGED
@@ -1,23 +1,32 @@
1
  <?php
2
  $meta_robots_date = empty( $meta_robots_date ) ? array() : $meta_robots_date;
3
- $macros = array_merge(
4
  Smartcrawl_Onpage_Settings::get_date_macros(),
5
  Smartcrawl_Onpage_Settings::get_general_macros()
6
  );
7
 
8
- $this->_render( 'onpage/onpage-preview' );
9
 
10
- $this->_render( 'onpage/onpage-general-settings', array(
11
- 'title_key' => 'title-date',
12
- 'description_key' => 'metadesc-date',
13
- 'macros' => $macros,
14
- ) );
 
 
 
15
 
16
- $this->_render( 'onpage/onpage-og-twitter', array(
17
- 'for_type' => 'date',
18
- 'macros' => $macros,
19
- ) );
 
 
 
20
 
21
- $this->_render( 'onpage/onpage-meta-robots', array(
22
- 'items' => $meta_robots_date,
23
- ) );
 
 
 
1
  <?php
2
  $meta_robots_date = empty( $meta_robots_date ) ? array() : $meta_robots_date;
3
+ $macros = array_merge(
4
  Smartcrawl_Onpage_Settings::get_date_macros(),
5
  Smartcrawl_Onpage_Settings::get_general_macros()
6
  );
7
 
8
+ $this->render_view( 'onpage/onpage-preview' );
9
 
10
+ $this->render_view(
11
+ 'onpage/onpage-general-settings',
12
+ array(
13
+ 'title_key' => 'title-date',
14
+ 'description_key' => 'metadesc-date',
15
+ 'macros' => $macros,
16
+ )
17
+ );
18
 
19
+ $this->render_view(
20
+ 'onpage/onpage-og-twitter',
21
+ array(
22
+ 'for_type' => 'date',
23
+ 'macros' => $macros,
24
+ )
25
+ );
26
 
27
+ $this->render_view(
28
+ 'onpage/onpage-meta-robots',
29
+ array(
30
+ 'items' => $meta_robots_date,
31
+ )
32
+ );
includes/admin/templates/onpage/onpage-section-post-type-archive.php CHANGED
@@ -1,24 +1,33 @@
1
  <?php
2
- $archive_post_type = empty( $archive_post_type ) ? '' : $archive_post_type;
3
  $archive_post_type_robots = empty( $archive_post_type_robots ) ? '' : $archive_post_type_robots;
4
- $macros = array_merge(
5
  Smartcrawl_Onpage_Settings::get_pt_archive_macros(),
6
  Smartcrawl_Onpage_Settings::get_general_macros()
7
  );
8
 
9
- $this->_render( 'onpage/onpage-preview' );
10
 
11
- $this->_render( 'onpage/onpage-general-settings', array(
12
- 'title_key' => 'title-' . $archive_post_type,
13
- 'description_key' => 'metadesc-' . $archive_post_type,
14
- 'macros' => $macros,
15
- ) );
 
 
 
16
 
17
- $this->_render( 'onpage/onpage-og-twitter', array(
18
- 'for_type' => $archive_post_type,
19
- 'macros' => $macros,
20
- ) );
 
 
 
21
 
22
- $this->_render( 'onpage/onpage-meta-robots', array(
23
- 'items' => $archive_post_type_robots,
24
- ) );
 
 
 
1
  <?php
2
+ $archive_post_type = empty( $archive_post_type ) ? '' : $archive_post_type;
3
  $archive_post_type_robots = empty( $archive_post_type_robots ) ? '' : $archive_post_type_robots;
4
+ $macros = array_merge(
5
  Smartcrawl_Onpage_Settings::get_pt_archive_macros(),
6
  Smartcrawl_Onpage_Settings::get_general_macros()
7
  );
8
 
9
+ $this->render_view( 'onpage/onpage-preview' );
10
 
11
+ $this->render_view(
12
+ 'onpage/onpage-general-settings',
13
+ array(
14
+ 'title_key' => 'title-' . $archive_post_type,
15
+ 'description_key' => 'metadesc-' . $archive_post_type,
16
+ 'macros' => $macros,
17
+ )
18
+ );
19
 
20
+ $this->render_view(
21
+ 'onpage/onpage-og-twitter',
22
+ array(
23
+ 'for_type' => $archive_post_type,
24
+ 'macros' => $macros,
25
+ )
26
+ );
27
 
28
+ $this->render_view(
29
+ 'onpage/onpage-meta-robots',
30
+ array(
31
+ 'items' => $archive_post_type_robots,
32
+ )
33
+ );
includes/admin/templates/onpage/onpage-section-post-type.php CHANGED
@@ -1,36 +1,44 @@
1
  <?php
2
- $post_type = empty( $post_type ) ? '' : $post_type;
3
- $post_type_object = empty( $post_type_object ) ? '' : $post_type_object;
4
  $post_type_robots = empty( $post_type_robots ) ? array() : $post_type_robots;
5
- $singular_name = empty( $post_type_object->labels->singular_name )
6
- ? 'post' : strtolower( $post_type_object->labels->singular_name );
7
 
8
  $og_description = esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook. You can set default values here but also customize this per %s via the post editor.', 'wds' );
9
  $og_description = sprintf( $og_description, $singular_name );
10
 
11
  $twitter_description = esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter. You can set default values here but also customize this per %s via the post editor.', 'wds' );
12
  $twitter_description = sprintf( $twitter_description, $singular_name );
13
- $macros = array_merge(
14
  Smartcrawl_Onpage_Settings::get_singular_macros( $post_type ),
15
  Smartcrawl_Onpage_Settings::get_general_macros()
16
  );
17
 
18
- $this->_render( 'onpage/onpage-preview' );
19
 
20
- $this->_render( 'onpage/onpage-general-settings', array(
21
- 'title_key' => 'title-' . $post_type,
22
- 'description_key' => 'metadesc-' . $post_type,
23
- 'macros' => $macros,
24
- ) );
 
 
 
25
 
26
- $this->_render( 'onpage/onpage-og-twitter', array(
27
- 'for_type' => $post_type,
28
- 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when this post type is shared on them.', 'wds' ),
29
- 'og_description' => $og_description,
30
- 'twitter_description' => $twitter_description,
31
- 'macros' => $macros,
32
- ) );
 
 
 
33
 
34
- $this->_render( 'onpage/onpage-meta-robots', array(
35
- 'items' => $post_type_robots,
36
- ) );
 
 
 
1
  <?php
2
+ $post_type = empty( $post_type ) ? '' : $post_type; // phpcs:ignore
3
+ $post_type_object = empty( $post_type_object ) ? '' : $post_type_object; // phpcs:ignore
4
  $post_type_robots = empty( $post_type_robots ) ? array() : $post_type_robots;
5
+ $singular_name = empty( $post_type_object->labels->singular_name ) ? 'post' : strtolower( $post_type_object->labels->singular_name );
 
6
 
7
  $og_description = esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook. You can set default values here but also customize this per %s via the post editor.', 'wds' );
8
  $og_description = sprintf( $og_description, $singular_name );
9
 
10
  $twitter_description = esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter. You can set default values here but also customize this per %s via the post editor.', 'wds' );
11
  $twitter_description = sprintf( $twitter_description, $singular_name );
12
+ $macros = array_merge(
13
  Smartcrawl_Onpage_Settings::get_singular_macros( $post_type ),
14
  Smartcrawl_Onpage_Settings::get_general_macros()
15
  );
16
 
17
+ $this->render_view( 'onpage/onpage-preview' );
18
 
19
+ $this->render_view(
20
+ 'onpage/onpage-general-settings',
21
+ array(
22
+ 'title_key' => 'title-' . $post_type,
23
+ 'description_key' => 'metadesc-' . $post_type,
24
+ 'macros' => $macros,
25
+ )
26
+ );
27
 
28
+ $this->render_view(
29
+ 'onpage/onpage-og-twitter',
30
+ array(
31
+ 'for_type' => $post_type,
32
+ 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when this post type is shared on them.', 'wds' ),
33
+ 'og_description' => $og_description,
34
+ 'twitter_description' => $twitter_description,
35
+ 'macros' => $macros,
36
+ )
37
+ );
38
 
39
+ $this->render_view(
40
+ 'onpage/onpage-meta-robots',
41
+ array(
42
+ 'items' => $post_type_robots,
43
+ )
44
+ );
includes/admin/templates/onpage/onpage-section-search.php CHANGED
@@ -1,23 +1,32 @@
1
  <?php
2
  $meta_robots_search = empty( $meta_robots_search ) ? array() : $meta_robots_search;
3
- $macros = array_merge(
4
  Smartcrawl_Onpage_Settings::get_search_macros(),
5
  Smartcrawl_Onpage_Settings::get_general_macros()
6
  );
7
 
8
- $this->_render( 'onpage/onpage-preview' );
9
 
10
- $this->_render( 'onpage/onpage-general-settings', array(
11
- 'title_key' => 'title-search',
12
- 'description_key' => 'metadesc-search',
13
- 'macros' => $macros,
14
- ) );
 
 
 
15
 
16
- $this->_render( 'onpage/onpage-og-twitter', array(
17
- 'for_type' => 'search',
18
- 'macros' => $macros,
19
- ) );
 
 
 
20
 
21
- $this->_render( 'onpage/onpage-meta-robots', array(
22
- 'items' => $meta_robots_search,
23
- ) );
 
 
 
1
  <?php
2
  $meta_robots_search = empty( $meta_robots_search ) ? array() : $meta_robots_search;
3
+ $macros = array_merge(
4
  Smartcrawl_Onpage_Settings::get_search_macros(),
5
  Smartcrawl_Onpage_Settings::get_general_macros()
6
  );
7
 
8
+ $this->render_view( 'onpage/onpage-preview' );
9
 
10
+ $this->render_view(
11
+ 'onpage/onpage-general-settings',
12
+ array(
13
+ 'title_key' => 'title-search',
14
+ 'description_key' => 'metadesc-search',
15
+ 'macros' => $macros,
16
+ )
17
+ );
18
 
19
+ $this->render_view(
20
+ 'onpage/onpage-og-twitter',
21
+ array(
22
+ 'for_type' => 'search',
23
+ 'macros' => $macros,
24
+ )
25
+ );
26
 
27
+ $this->render_view(
28
+ 'onpage/onpage-meta-robots',
29
+ array(
30
+ 'items' => $meta_robots_search,
31
+ )
32
+ );
includes/admin/templates/onpage/onpage-section-settings.php CHANGED
@@ -1,39 +1,43 @@
1
- <?php $separators = empty( $separators ) ? array() : $separators; ?>
2
- <div class="sui-box-settings-row">
3
- <div class="sui-box-settings-col-1">
4
- <label for="separator" class="sui-settings-label"><?php esc_html_e( 'Separator', 'wds' ); ?></label>
5
- <p class="sui-description">
6
- <?php echo sprintf(
7
- esc_html__( 'The separator refers to the break between variables which you can use by referencing the %s tag. You can choose a preset one or bake your own.', 'wds' ),
8
- '%%sep%%'
9
- ); ?>
10
- </p>
11
- </div>
12
- <div class="sui-box-settings-col-2">
13
- <div class="wds-preset-separators">
14
- <?php foreach ( $separators as $key => $separator ) : ?>
15
- <input
16
- type="radio"
17
- name="<?php echo esc_attr( $_view['option_name'] ); ?>[preset-separator]"
18
- id="separator-<?php echo esc_attr( $key ); ?>"
19
- value="<?php echo esc_attr( $key ); ?>"
20
- autocomplete="off"
21
- <?php echo $_view['options']['preset-separator'] === $key ? 'checked="checked"' : ''; ?> />
22
- <label class="separator-selector" for="separator-<?php echo esc_attr( $key ); ?>">
23
- <?php echo esc_html( $separator ); ?>
24
- </label>
25
- <?php endforeach; ?>
26
- </div>
27
- <p class="wds-custom-separator-message"><?php esc_html_e( 'Or, choose your own custom separator.', 'wds' ); ?></p>
28
- <input
29
- id='separator'
30
- placeholder="<?php esc_attr_e( 'Enter custom separator', 'wds' ); ?>"
31
- name='<?php echo esc_attr( $_view['option_name'] ); ?>[separator]'
32
- type='text'
33
- class='sui-form-control'
34
- value='<?php echo esc_attr( $_view['options']['separator'] ); ?>'/>
35
  </div>
 
 
 
 
 
 
 
 
36
  </div>
 
37
 
38
  <div class="sui-box-settings-row wds-onpage-character-lengths">
39
  <div class="sui-box-settings-col-1">
@@ -44,23 +48,29 @@
44
  </div>
45
  <div class="sui-box-settings-col-2">
46
  <?php
47
- $this->_render( 'onpage/onpage-meta-character-lengths', array(
48
- 'label' => esc_html__( 'Meta Title', 'wds' ),
49
- 'toggle_name' => 'custom_title_char_lengths',
50
- 'min_field_name' => 'custom_title_min_length',
51
- 'max_field_name' => 'custom_title_max_length',
52
- 'default_min' => SMARTCRAWL_TITLE_DEFAULT_MIN_LENGTH,
53
- 'default_max' => SMARTCRAWL_TITLE_DEFAULT_MAX_LENGTH,
54
- ) );
 
 
 
55
 
56
- $this->_render( 'onpage/onpage-meta-character-lengths', array(
57
- 'label' => esc_html__( 'Meta Description', 'wds' ),
58
- 'toggle_name' => 'custom_metadesc_char_lengths',
59
- 'min_field_name' => 'custom_metadesc_min_length',
60
- 'max_field_name' => 'custom_metadesc_max_length',
61
- 'default_min' => SMARTCRAWL_METADESC_DEFAULT_MIN_LENGTH,
62
- 'default_max' => SMARTCRAWL_METADESC_DEFAULT_MAX_LENGTH,
63
- ) );
 
 
 
64
  ?>
65
  </div>
66
  </div>
1
+ <?php
2
+ $separators = empty( $separators ) ? array() : $separators;
3
+ ?>
4
+ <div class="sui-box-settings-row">
5
+ <div class="sui-box-settings-col-1">
6
+ <label for="separator" class="sui-settings-label"><?php esc_html_e( 'Separator', 'wds' ); ?></label>
7
+ <p class="sui-description">
8
+ <?php
9
+ echo sprintf(
10
+ esc_html__( 'The separator refers to the break between variables which you can use by referencing the %s tag. You can choose a preset one or bake your own.', 'wds' ),
11
+ '%%sep%%'
12
+ );
13
+ ?>
14
+ </p>
15
+ </div>
16
+ <div class="sui-box-settings-col-2">
17
+ <div class="wds-preset-separators">
18
+ <?php foreach ( $separators as $key => $separator ) : ?>
19
+ <input
20
+ type="radio"
21
+ name="<?php echo esc_attr( $_view['option_name'] ); ?>[preset-separator]"
22
+ id="separator-<?php echo esc_attr( $key ); ?>"
23
+ value="<?php echo esc_attr( $key ); ?>"
24
+ autocomplete="off"
25
+ <?php echo $_view['options']['preset-separator'] === $key ? 'checked="checked"' : ''; ?> />
26
+ <label class="separator-selector" for="separator-<?php echo esc_attr( $key ); ?>">
27
+ <?php echo esc_html( $separator ); ?>
28
+ </label>
29
+ <?php endforeach; ?>
 
 
 
 
 
30
  </div>
31
+ <p class="wds-custom-separator-message"><?php esc_html_e( 'Or, choose your own custom separator.', 'wds' ); ?></p>
32
+ <input
33
+ id='separator'
34
+ placeholder="<?php esc_attr_e( 'Enter custom separator', 'wds' ); ?>"
35
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[separator]'
36
+ type='text'
37
+ class='sui-form-control'
38
+ value='<?php echo esc_attr( $_view['options']['separator'] ); ?>'/>
39
  </div>
40
+ </div>
41
 
42
  <div class="sui-box-settings-row wds-onpage-character-lengths">
43
  <div class="sui-box-settings-col-1">
48
  </div>
49
  <div class="sui-box-settings-col-2">
50
  <?php
51
+ $this->render_view(
52
+ 'onpage/onpage-meta-character-lengths',
53
+ array(
54
+ 'label' => esc_html__( 'Meta Title', 'wds' ),
55
+ 'toggle_name' => 'custom_title_char_lengths',
56
+ 'min_field_name' => 'custom_title_min_length',
57
+ 'max_field_name' => 'custom_title_max_length',
58
+ 'default_min' => SMARTCRAWL_TITLE_DEFAULT_MIN_LENGTH,
59
+ 'default_max' => SMARTCRAWL_TITLE_DEFAULT_MAX_LENGTH,
60
+ )
61
+ );
62
 
63
+ $this->render_view(
64
+ 'onpage/onpage-meta-character-lengths',
65
+ array(
66
+ 'label' => esc_html__( 'Meta Description', 'wds' ),
67
+ 'toggle_name' => 'custom_metadesc_char_lengths',
68
+ 'min_field_name' => 'custom_metadesc_min_length',
69
+ 'max_field_name' => 'custom_metadesc_max_length',
70
+ 'default_min' => SMARTCRAWL_METADESC_DEFAULT_MIN_LENGTH,
71
+ 'default_max' => SMARTCRAWL_METADESC_DEFAULT_MAX_LENGTH,
72
+ )
73
+ );
74
  ?>
75
  </div>
76
  </div>
includes/admin/templates/onpage/onpage-section-taxonomy.php CHANGED
@@ -1,35 +1,43 @@
1
  <?php
2
- $taxonomy = empty( $taxonomy ) ? new stdClass() : $taxonomy;
3
- $meta_robots = empty( $meta_robots ) ? array() : $meta_robots;
4
- $singular_name = empty( $taxonomy->labels->singular_name )
5
- ? 'post' : strtolower( $taxonomy->labels->singular_name );
6
 
7
  $og_description = esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook. You can set default values here but also customize this for each %s.', 'wds' );
8
  $og_description = sprintf( $og_description, $singular_name );
9
 
10
  $twitter_description = esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter. You can set default values here but also customize this for each %s.', 'wds' );
11
  $twitter_description = sprintf( $twitter_description, $singular_name );
12
- $macros = array_merge(
13
  Smartcrawl_Onpage_Settings::get_term_macros( $taxonomy->name ),
14
  Smartcrawl_Onpage_Settings::get_general_macros()
15
  );
16
 
17
- $this->_render( 'onpage/onpage-preview' );
18
 
19
- $this->_render( 'onpage/onpage-general-settings', array(
20
- 'title_key' => 'title-' . $taxonomy->name,
21
- 'description_key' => 'metadesc-' . $taxonomy->name,
22
- 'macros' => $macros,
23
- ) );
 
 
 
24
 
25
- $this->_render( 'onpage/onpage-og-twitter', array(
26
- 'for_type' => $taxonomy->name,
27
- 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when this taxonomy is shared on them.', 'wds' ),
28
- 'og_description' => $og_description,
29
- 'twitter_description' => $twitter_description,
30
- 'macros' => $macros,
31
- ) );
 
 
 
32
 
33
- $this->_render( 'onpage/onpage-meta-robots', array(
34
- 'items' => $meta_robots,
35
- ) );
 
 
 
1
  <?php
2
+ $taxonomy = empty( $taxonomy ) ? new stdClass() : $taxonomy; // phpcs:ignore
3
+ $meta_robots = empty( $meta_robots ) ? array() : $meta_robots;
4
+ $singular_name = empty( $taxonomy->labels->singular_name ) ? 'post' : strtolower( $taxonomy->labels->singular_name );
 
5
 
6
  $og_description = esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook. You can set default values here but also customize this for each %s.', 'wds' );
7
  $og_description = sprintf( $og_description, $singular_name );
8
 
9
  $twitter_description = esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter. You can set default values here but also customize this for each %s.', 'wds' );
10
  $twitter_description = sprintf( $twitter_description, $singular_name );
11
+ $macros = array_merge(
12
  Smartcrawl_Onpage_Settings::get_term_macros( $taxonomy->name ),
13
  Smartcrawl_Onpage_Settings::get_general_macros()
14
  );
15
 
16
+ $this->render_view( 'onpage/onpage-preview' );
17
 
18
+ $this->render_view(
19
+ 'onpage/onpage-general-settings',
20
+ array(
21
+ 'title_key' => 'title-' . $taxonomy->name,
22
+ 'description_key' => 'metadesc-' . $taxonomy->name,
23
+ 'macros' => $macros,
24
+ )
25
+ );
26
 
27
+ $this->render_view(
28
+ 'onpage/onpage-og-twitter',
29
+ array(
30
+ 'for_type' => $taxonomy->name,
31
+ 'social_label_desc' => esc_html__( 'Enable or disable support for social platforms when this taxonomy is shared on them.', 'wds' ),
32
+ 'og_description' => $og_description,
33
+ 'twitter_description' => $twitter_description,
34
+ 'macros' => $macros,
35
+ )
36
+ );
37
 
38
+ $this->render_view(
39
+ 'onpage/onpage-meta-robots',
40
+ array(
41
+ 'items' => $meta_robots,
42
+ )
43
+ );
includes/admin/templates/onpage/onpage-settings.php CHANGED
@@ -1,151 +1,183 @@
1
  <?php
2
- $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
- $buddypress_active = defined( 'BP_VERSION' );
4
- $front_page = empty( $front_page ) ? null : $front_page;
5
- $front_page_notice = empty( $front_page_notice ) ? '' : $front_page_notice;
6
  $show_static_home_settings = empty( $show_static_home_settings ) ? false : $show_static_home_settings;
7
- $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
8
  ?>
9
 
10
- <?php $this->_render( 'before-page-container' ); ?>
11
 
12
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-onpage' ); ?>">
13
- <?php $this->_render( 'page-header', array(
14
- 'title' => esc_html__( 'Title & Meta', 'wds' ),
15
- 'documentation_chapter' => 'title-meta',
16
- 'extra_actions' => 'onpage/onpage-header-actions',
17
- 'utm_campaign' => 'smartcrawl_title-meta_docs',
18
- ) ); ?>
 
 
 
 
 
19
 
20
- <?php $this->_render( 'floating-notices' ); ?>
21
 
22
  <?php
23
- $this->_render( 'modal', array(
24
- 'id' => 'wds-supported-macros-modal',
25
- 'title' => esc_html__( 'Supported Macros', 'wds' ),
26
- 'body_template' => 'onpage/onpage-macros-modal',
27
- ) );
 
 
 
28
  ?>
29
 
30
- <?php if ( ! $onpage_enabled ) {
31
- $this->_render( 'onpage/onpage-disabled' );
32
- } else { ?>
 
 
33
  <div class="wds-vertical-tabs-container sui-row-with-sidenav" id="page-title-meta-tabs">
34
- <?php $this->_render( 'onpage/onpage-sidenav', array(
35
- 'active_tab' => $active_tab,
36
- 'show_static_home_settings' => $show_static_home_settings,
37
- ) );
 
 
 
 
38
 
39
- $this->_render( 'vertical-tab', array(
40
- 'tab_id' => 'tab_static_homepage',
41
- 'tab_name' => esc_html__( 'Homepage', 'wds' ),
42
- 'is_active' => 'tab_static_homepage' === $active_tab,
43
- 'button_text' => false,
44
- 'tab_sections' => array(
45
- array(
46
- 'section_description' => esc_html__( 'Customize your homepage title, description and meta options.', 'wds' ),
47
- 'section_type' => 'static-homepage',
48
- 'section_template' => 'onpage/onpage-static-homepage',
49
- 'section_args' => array(
50
- 'front_page' => $front_page,
51
- 'front_page_notice' => $front_page_notice,
 
 
 
52
  ),
53
  ),
54
- ),
55
- ) );
56
  ?>
57
 
58
  <form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
59
  <?php $this->settings_fields( $_view['option_name'] ); ?>
60
 
61
- <input type="hidden"
62
- name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
63
- value="1">
64
-
 
65
  <?php
66
  /*
67
  * Homepage tab
68
  */
69
- $this->_render( 'vertical-tab', array(
70
- 'tab_id' => 'tab_homepage',
71
- 'tab_name' => esc_html__( 'Homepage', 'wds' ),
72
- 'is_active' => 'tab_homepage' === $active_tab,
73
- 'button_text' => false,
74
- 'tab_sections' => array(
75
- array(
76
- 'section_description' => esc_html__( 'Customize your homepage title, description and meta options.', 'wds' ),
77
- 'section_type' => 'home',
78
- 'section_template' => 'onpage/onpage-list-homepage',
79
- 'section_args' => array(
80
- 'meta_robots_main_blog_archive' => $meta_robots_main_blog_archive,
 
 
 
81
  ),
82
  ),
83
- ),
84
- ) );
85
 
86
  /*
87
  * Post types tab
88
  */
89
  $post_type_sections = array();
90
- foreach ( get_post_types( array( 'public' => true ) ) as $post_type ) {
91
  if ( in_array( $post_type, array( 'revision', 'nav_menu_item' ), true ) ) {
92
  continue;
93
  }
94
 
95
- $post_type_object = get_post_type_object( $post_type );
96
 
97
  $post_type_sections[] = array(
98
- 'section_title' => $post_type_object->labels->name,
99
- 'section_description' => sprintf( esc_html__( 'Customize your %s title, description and meta options.', 'wds' ), strtolower( $post_type_object->labels->singular_name ) ),
100
  'section_type' => $post_type,
101
  'section_template' => 'onpage/onpage-section-post-type',
102
  'section_args' => array(
103
  'post_type' => $post_type,
104
- 'post_type_object' => $post_type_object,
105
  'post_type_robots' => ( ! empty( $post_robots[ $post_type ] ) ? $post_robots[ $post_type ] : array() ),
106
  ),
107
  );
108
  }
109
 
110
- $this->_render( 'vertical-tab', array(
111
- 'tab_id' => 'tab_post_types',
112
- 'tab_name' => esc_html__( 'Post Types', 'wds' ),
113
- 'is_active' => 'tab_post_types' === $active_tab,
114
- 'tab_sections' => $post_type_sections,
115
- ) );
 
 
 
116
 
117
  /*
118
  * Other taxonomies
119
  */
120
  $taxonomy_sections = array();
121
- $taxonomies = array_merge(
122
  array( 'post_tag', 'category' ),
123
- get_taxonomies( array( '_builtin' => false, 'public' => true ) )
 
 
 
 
 
124
  );
125
  foreach ( $taxonomies as $taxonomy_name ) {
126
- $taxonomy = get_taxonomy( $taxonomy_name );
127
- $meta_robots_taxonomy_name = 'meta_robots_' . str_replace( '-', '_', $taxonomy->name );
128
- $taxonomy_sections[] = array(
129
- 'section_title' => $taxonomy->label,
130
- 'section_description' => sprintf( esc_html__( 'Customize the title, description and meta options for %s.', 'wds' ), strtolower( $taxonomy->label ) ),
131
- 'section_type' => $taxonomy->name,
132
  'section_template' => 'onpage/onpage-section-taxonomy',
133
  'section_args' => array(
134
- 'taxonomy' => $taxonomy,
135
  'meta_robots' => $$meta_robots_taxonomy_name,
136
  ),
137
  );
138
  }
139
 
140
- $this->_render( 'vertical-tab', array(
141
- 'tab_id' => 'tab_taxonomies',
142
- 'tab_name' => esc_html__( 'Taxonomies', 'wds' ),
143
- 'is_active' => 'tab_taxonomies' === $active_tab,
144
- 'tab_sections' => $taxonomy_sections,
145
- ) );
 
 
 
146
 
147
  $archive_sections = array(
148
- // Author archive
149
  array(
150
  'section_title' => esc_html__( 'Author Archive', 'wds' ),
151
  'section_description' => esc_html__( 'If you are the only author of your website content Google may see your author archives as duplicate content to your Blog Homepage. If this is the case we recommend disabling author archives.', 'wds' ),
@@ -157,7 +189,7 @@ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
157
  'meta_robots_author' => $meta_robots_author,
158
  ),
159
  ),
160
- // Date archive
161
  array(
162
  'section_title' => esc_html__( 'Date Archive', 'wds' ),
163
  'section_description' => esc_html__( 'Google may see your date archives as duplicate content to your Blog Homepage. For this reason we recommend disabling date archives.', 'wds' ),
@@ -169,7 +201,7 @@ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
169
  'meta_robots_date' => $meta_robots_date,
170
  ),
171
  ),
172
- // Search page
173
  array(
174
  'section_title' => esc_html__( 'Search Page', 'wds' ),
175
  'section_description' => esc_html__( 'Customize your search page title, description and meta options.', 'wds' ),
@@ -179,7 +211,7 @@ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
179
  'meta_robots_search' => $meta_robots_search,
180
  ),
181
  ),
182
- // 404 page
183
  array(
184
  'section_title' => esc_html__( '404 Page', 'wds' ),
185
  'section_description' => esc_html__( 'Customize your 404 page title, description and meta options.', 'wds' ),
@@ -190,6 +222,8 @@ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
190
  );
191
 
192
  /**
 
 
193
  * @var $archive_post_types array
194
  */
195
  foreach ( $archive_post_types as $archive_post_type => $archive_post_type_label ) {
@@ -213,12 +247,15 @@ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
213
  /*
214
  * Archives
215
  */
216
- $this->_render( 'vertical-tab', array(
217
- 'tab_id' => 'tab_archives',
218
- 'tab_name' => esc_html__( 'Archives', 'wds' ),
219
- 'is_active' => 'tab_archives' === $active_tab,
220
- 'tab_sections' => $archive_sections,
221
- ) );
 
 
 
222
 
223
  $buddypress_sections = array();
224
 
@@ -247,34 +284,40 @@ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
247
  }
248
 
249
  if ( $buddypress_sections ) {
250
- $this->_render( 'vertical-tab', array(
251
- 'tab_id' => 'tab_buddypress',
252
- 'tab_name' => esc_html__( 'BuddyPress', 'wds' ),
253
- 'is_active' => 'tab_buddypress' === $active_tab,
254
- 'tab_sections' => $buddypress_sections,
255
- ) );
 
 
 
256
  }
257
  ?>
258
 
259
  <?php
260
- $this->_render( 'vertical-tab', array(
261
- 'tab_id' => 'tab_settings',
262
- 'tab_name' => esc_html__( 'Settings', 'wds' ),
263
- 'is_active' => 'tab_settings' === $active_tab,
264
- 'tab_sections' => array(
265
- array(
266
- 'section_type' => '',
267
- 'section_template' => 'onpage/onpage-section-settings',
268
- 'section_args' => array(
269
- 'separators' => $separators,
 
 
 
270
  ),
271
  ),
272
- ),
273
- ) );
274
  ?>
275
  </form>
276
 
277
  </div><!-- end page-title-meta-tabs -->
278
  <?php } ?>
279
- <?php $this->_render( 'footer' ); ?>
280
  </div><!-- end wds-page-onpage -->
1
  <?php
2
+ $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
+ $buddypress_active = defined( 'BP_VERSION' );
4
+ $front_page = empty( $front_page ) ? null : $front_page;
5
+ $front_page_notice = empty( $front_page_notice ) ? '' : $front_page_notice;
6
  $show_static_home_settings = empty( $show_static_home_settings ) ? false : $show_static_home_settings;
7
+ $onpage_enabled = Smartcrawl_Settings::get_setting( 'onpage' );
8
  ?>
9
 
10
+ <?php $this->render_view( 'before-page-container' ); ?>
11
 
12
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-onpage' ); ?>">
13
+ <?php
14
+ $this->render_view(
15
+ 'page-header',
16
+ array(
17
+ 'title' => esc_html__( 'Title & Meta', 'wds' ),
18
+ 'documentation_chapter' => 'title-meta',
19
+ 'extra_actions' => 'onpage/onpage-header-actions',
20
+ 'utm_campaign' => 'smartcrawl_title-meta_docs',
21
+ )
22
+ );
23
+ ?>
24
 
25
+ <?php $this->render_view( 'floating-notices' ); ?>
26
 
27
  <?php
28
+ $this->render_view(
29
+ 'modal',
30
+ array(
31
+ 'id' => 'wds-supported-macros-modal',
32
+ 'title' => esc_html__( 'Supported Macros', 'wds' ),
33
+ 'body_template' => 'onpage/onpage-macros-modal',
34
+ )
35
+ );
36
  ?>
37
 
38
+ <?php
39
+ if ( ! $onpage_enabled ) {
40
+ $this->render_view( 'onpage/onpage-disabled' );
41
+ } else {
42
+ ?>
43
  <div class="wds-vertical-tabs-container sui-row-with-sidenav" id="page-title-meta-tabs">
44
+ <?php
45
+ $this->render_view(
46
+ 'onpage/onpage-sidenav',
47
+ array(
48
+ 'active_tab' => $active_tab,
49
+ 'show_static_home_settings' => $show_static_home_settings,
50
+ )
51
+ );
52
 
53
+ $this->render_view(
54
+ 'vertical-tab',
55
+ array(
56
+ 'tab_id' => 'tab_static_homepage',
57
+ 'tab_name' => esc_html__( 'Homepage', 'wds' ),
58
+ 'is_active' => 'tab_static_homepage' === $active_tab,
59
+ 'button_text' => false,
60
+ 'tab_sections' => array(
61
+ array(
62
+ 'section_description' => esc_html__( 'Customize your homepage title, description and meta options.', 'wds' ),
63
+ 'section_type' => 'static-homepage',
64
+ 'section_template' => 'onpage/onpage-static-homepage',
65
+ 'section_args' => array(
66
+ 'front_page' => $front_page,
67
+ 'front_page_notice' => $front_page_notice,
68
+ ),
69
  ),
70
  ),
71
+ )
72
+ );
73
  ?>
74
 
75
  <form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
76
  <?php $this->settings_fields( $_view['option_name'] ); ?>
77
 
78
+ <input
79
+ type="hidden"
80
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
81
+ value="1"
82
+ >
83
  <?php
84
  /*
85
  * Homepage tab
86
  */
87
+ $this->render_view(
88
+ 'vertical-tab',
89
+ array(
90
+ 'tab_id' => 'tab_homepage',
91
+ 'tab_name' => esc_html__( 'Homepage', 'wds' ),
92
+ 'is_active' => 'tab_homepage' === $active_tab,
93
+ 'button_text' => false,
94
+ 'tab_sections' => array(
95
+ array(
96
+ 'section_description' => esc_html__( 'Customize your homepage title, description and meta options.', 'wds' ),
97
+ 'section_type' => 'home',
98
+ 'section_template' => 'onpage/onpage-list-homepage',
99
+ 'section_args' => array(
100
+ 'meta_robots_main_blog_archive' => $meta_robots_main_blog_archive,
101
+ ),
102
  ),
103
  ),
104
+ )
105
+ );
106
 
107
  /*
108
  * Post types tab
109
  */
110
  $post_type_sections = array();
111
+ foreach ( get_post_types( array( 'public' => true ) ) as $post_type ) { // phpcs:ignore
112
  if ( in_array( $post_type, array( 'revision', 'nav_menu_item' ), true ) ) {
113
  continue;
114
  }
115
 
116
+ $wp_post_type_object = get_post_type_object( $post_type );
117
 
118
  $post_type_sections[] = array(
119
+ 'section_title' => $wp_post_type_object->labels->name,
120
+ 'section_description' => sprintf( esc_html__( 'Customize your %s title, description and meta options.', 'wds' ), strtolower( $wp_post_type_object->labels->singular_name ) ),
121
  'section_type' => $post_type,
122
  'section_template' => 'onpage/onpage-section-post-type',
123
  'section_args' => array(
124
  'post_type' => $post_type,
125
+ 'post_type_object' => $wp_post_type_object,
126
  'post_type_robots' => ( ! empty( $post_robots[ $post_type ] ) ? $post_robots[ $post_type ] : array() ),
127
  ),
128
  );
129
  }
130
 
131
+ $this->render_view(
132
+ 'vertical-tab',
133
+ array(
134
+ 'tab_id' => 'tab_post_types',
135
+ 'tab_name' => esc_html__( 'Post Types', 'wds' ),
136
+ 'is_active' => 'tab_post_types' === $active_tab,
137
+ 'tab_sections' => $post_type_sections,
138
+ )
139
+ );
140
 
141
  /*
142
  * Other taxonomies
143
  */
144
  $taxonomy_sections = array();
145
+ $taxonomies = array_merge(
146
  array( 'post_tag', 'category' ),
147
+ get_taxonomies(
148
+ array(
149
+ '_builtin' => false,
150
+ 'public' => true,
151
+ )
152
+ )
153
  );
154
  foreach ( $taxonomies as $taxonomy_name ) {
155
+ $wp_taxonomy = get_taxonomy( $taxonomy_name );
156
+ $meta_robots_taxonomy_name = 'meta_robots_' . str_replace( '-', '_', $wp_taxonomy->name );
157
+ $taxonomy_sections[] = array(
158
+ 'section_title' => $wp_taxonomy->label,
159
+ 'section_description' => sprintf( esc_html__( 'Customize the title, description and meta options for %s.', 'wds' ), strtolower( $wp_taxonomy->label ) ),
160
+ 'section_type' => $wp_taxonomy->name,
161
  'section_template' => 'onpage/onpage-section-taxonomy',
162
  'section_args' => array(
163
+ 'taxonomy' => $wp_taxonomy,
164
  'meta_robots' => $$meta_robots_taxonomy_name,
165
  ),
166
  );
167
  }
168
 
169
+ $this->render_view(
170
+ 'vertical-tab',
171
+ array(
172
+ 'tab_id' => 'tab_taxonomies',
173
+ 'tab_name' => esc_html__( 'Taxonomies', 'wds' ),
174
+ 'is_active' => 'tab_taxonomies' === $active_tab,
175
+ 'tab_sections' => $taxonomy_sections,
176
+ )
177
+ );
178
 
179
  $archive_sections = array(
180
+ // Author archive.
181
  array(
182
  'section_title' => esc_html__( 'Author Archive', 'wds' ),
183
  'section_description' => esc_html__( 'If you are the only author of your website content Google may see your author archives as duplicate content to your Blog Homepage. If this is the case we recommend disabling author archives.', 'wds' ),
189
  'meta_robots_author' => $meta_robots_author,
190
  ),
191
  ),
192
+ // Date archive.
193
  array(
194
  'section_title' => esc_html__( 'Date Archive', 'wds' ),
195
  'section_description' => esc_html__( 'Google may see your date archives as duplicate content to your Blog Homepage. For this reason we recommend disabling date archives.', 'wds' ),
201
  'meta_robots_date' => $meta_robots_date,
202
  ),
203
  ),
204
+ // Search page.
205
  array(
206
  'section_title' => esc_html__( 'Search Page', 'wds' ),
207
  'section_description' => esc_html__( 'Customize your search page title, description and meta options.', 'wds' ),
211
  'meta_robots_search' => $meta_robots_search,
212
  ),
213
  ),
214
+ // 404 page.
215
  array(
216
  'section_title' => esc_html__( '404 Page', 'wds' ),
217
  'section_description' => esc_html__( 'Customize your 404 page title, description and meta options.', 'wds' ),
222
  );
223
 
224
  /**
225
+ * Post types.
226
+ *
227
  * @var $archive_post_types array
228
  */
229
  foreach ( $archive_post_types as $archive_post_type => $archive_post_type_label ) {
247
  /*
248
  * Archives
249
  */
250
+ $this->render_view(
251
+ 'vertical-tab',
252
+ array(
253
+ 'tab_id' => 'tab_archives',
254
+ 'tab_name' => esc_html__( 'Archives', 'wds' ),
255
+ 'is_active' => 'tab_archives' === $active_tab,
256
+ 'tab_sections' => $archive_sections,
257
+ )
258
+ );
259
 
260
  $buddypress_sections = array();
261
 
284
  }
285
 
286
  if ( $buddypress_sections ) {
287
+ $this->render_view(
288
+ 'vertical-tab',
289
+ array(
290
+ 'tab_id' => 'tab_buddypress',
291
+ 'tab_name' => esc_html__( 'BuddyPress', 'wds' ),
292
+ 'is_active' => 'tab_buddypress' === $active_tab,
293
+ 'tab_sections' => $buddypress_sections,
294
+ )
295
+ );
296
  }
297
  ?>
298
 
299
  <?php
300
+ $this->render_view(
301
+ 'vertical-tab',
302
+ array(
303
+ 'tab_id' => 'tab_settings',
304
+ 'tab_name' => esc_html__( 'Settings', 'wds' ),
305
+ 'is_active' => 'tab_settings' === $active_tab,
306
+ 'tab_sections' => array(
307
+ array(
308
+ 'section_type' => '',
309
+ 'section_template' => 'onpage/onpage-section-settings',
310
+ 'section_args' => array(
311
+ 'separators' => $separators,
312
+ ),
313
  ),
314
  ),
315
+ )
316
+ );
317
  ?>
318
  </form>
319
 
320
  </div><!-- end page-title-meta-tabs -->
321
  <?php } ?>
322
+ <?php $this->render_view( 'footer' ); ?>
323
  </div><!-- end wds-page-onpage -->
includes/admin/templates/onpage/onpage-sidenav.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
- $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
  $show_static_home_settings = empty( $show_static_home_settings ) ? false : $show_static_home_settings;
4
- $buddypress_active = defined( 'BP_VERSION' );
5
- $tabs = array(
6
  array(
7
  'id' => $show_static_home_settings ? 'tab_static_homepage' : 'tab_homepage',
8
  'name' => esc_html__( 'Homepage', 'wds' ),
@@ -25,12 +25,15 @@ $tabs = array(
25
  ),
26
  );
27
  if ( $buddypress_active ) {
28
- $tabs[] = array(
29
  'id' => 'tab_buddypress',
30
  'name' => esc_html__( 'BuddyPress', 'wds' ),
31
  );
32
  }
33
- $this->_render( 'vertical-tabs-side-nav', array(
34
- 'active_tab' => $active_tab,
35
- 'tabs' => $tabs,
36
- ) );
 
 
 
1
  <?php
2
+ $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
  $show_static_home_settings = empty( $show_static_home_settings ) ? false : $show_static_home_settings;
4
+ $buddypress_active = defined( 'BP_VERSION' );
5
+ $tab_items = array(
6
  array(
7
  'id' => $show_static_home_settings ? 'tab_static_homepage' : 'tab_homepage',
8
  'name' => esc_html__( 'Homepage', 'wds' ),
25
  ),
26
  );
27
  if ( $buddypress_active ) {
28
+ $tab_items[] = array(
29
  'id' => 'tab_buddypress',
30
  'name' => esc_html__( 'BuddyPress', 'wds' ),
31
  );
32
  }
33
+ $this->render_view(
34
+ 'vertical-tabs-side-nav',
35
+ array(
36
+ 'active_tab' => $active_tab,
37
+ 'tabs' => $tab_items,
38
+ )
39
+ );
includes/admin/templates/onpage/onpage-social-meta-tags-sub-settings.php CHANGED
@@ -1,38 +1,42 @@
1
  <?php
2
  /**
3
  * @var string $for_type
 
 
4
  */
5
- $option_name = empty( $option_name ) ? '' : $option_name;
 
6
  $title_field_id = empty( $title_field_id ) ? '' : $title_field_id;
7
- $current_title = empty( $current_title ) ? '' : $current_title;
8
 
9
  $description_field_id = empty( $description_field_id ) ? '' : $description_field_id;
10
- $current_description = empty( $current_description ) ? '' : $current_description;
11
 
12
- $images_field_id = empty( $images_field_id ) ? '' : $images_field_id;
13
- $current_images = empty( $current_images ) ? array() : $current_images;
14
  $images_available = ! empty( $current_images ) && is_array( $current_images );
15
- $single_image = empty( $single_image ) ? false : true;
16
 
17
- $title_placeholder = ( ! empty( $_view['options']["title-{$for_type}"] ) ? $_view['options']["title-{$for_type}"] : '' );
18
- $description_placeholder = ( ! empty( $_view['options']["metadesc-{$for_type}"] ) ? $_view['options']["metadesc-{$for_type}"] : '' );
19
 
20
  $disable_first_image_id = empty( $disable_first_image_id ) ? false : $disable_first_image_id;
21
- $disable_first_image = empty( $disable_first_image ) ? false : true;
22
- $macros = empty( $macros ) ? array() : $macros;
23
  ?>
24
  <div class="sui-form-field">
25
  <label for="<?php echo esc_attr( $title_field_id ); ?>" class="sui-label">
26
  <?php esc_html_e( 'Title', 'wds' ); ?>
27
  </label>
28
  <div class="sui-insert-variables wds-allow-macros">
29
- <input id='<?php echo esc_attr( $title_field_id ); ?>'
30
- name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $title_field_id ); ?>]'
31
- size='' type='text' class='sui-form-control'
32
- placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
33
- value='<?php echo esc_attr( $current_title ); ?>'/>
34
-
35
- <?php $this->_render( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
 
36
  </div>
37
  </div>
38
 
@@ -41,59 +45,74 @@ $macros = empty( $macros ) ? array() : $macros;
41
  <?php esc_html_e( 'Description', 'wds' ); ?>
42
  </label>
43
  <div class="sui-insert-variables wds-allow-macros">
44
- <textarea id='<?php echo esc_attr( $description_field_id ); ?>'
45
- name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $description_field_id ); ?>]'
46
- placeholder="<?php echo esc_attr( $description_placeholder ); ?>"
47
- type='text'
48
- class='sui-form-control'><?php echo esc_textarea( $current_description ); ?></textarea>
 
 
49
 
50
- <?php $this->_render( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
51
  </div>
52
  </div>
53
 
54
  <div>
55
  <label for="<?php echo esc_attr( $images_field_id ); ?>" class="sui-label">
56
- <?php if ( $single_image ): ?>
57
  <?php esc_html_e( 'Default Featured Image', 'wds' ); ?>
58
- <?php else: ?>
59
  <?php esc_html_e( 'Default Featured Images', 'wds' ); ?>
60
  <?php endif; ?>
61
  </label>
62
- <div class="og-images <?php echo esc_attr( $images_field_id ); ?>"
63
- data-singular="<?php echo $single_image ? 'true' : 'false'; ?>"
64
- data-name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $images_field_id ); ?>]'>
 
 
65
 
66
- <div class="add-action-wrapper sui-tooltip"
67
- data-tooltip="<?php esc_attr_e( 'Add featured image', 'wds' ); ?>"
68
- style="<?php echo $single_image && $images_available ? 'display:none;' : ''; ?>">
69
- <a href="#add" id="<?php echo esc_attr( $images_field_id ); ?>"
70
- title="<?php esc_attr_e( 'Add image', 'wds' ); ?>">
 
 
 
 
71
  <span class="sui-icon-upload-cloud" aria-hidden="true"></span>
72
  </a>
73
  </div>
74
- <?php foreach ( $current_images as $image ): ?>
75
- <?php $this->_render( 'social-image-item', array(
76
- 'id' => $image,
77
- 'field_name' => "{$option_name}[{$images_field_id}][]",
78
- ) ); ?>
 
 
 
 
 
79
  <?php endforeach; ?>
80
  </div>
81
  <p class="sui-description">
82
- <?php if ( $single_image ): ?>
83
- <?php esc_html_e( "Choose featured image that will be used when sharing on Twitter.", 'wds' ); ?>
84
- <?php else: ?>
85
- <?php esc_html_e( "Choose featured images that will be used when sharing on Facebook or other platforms that support OpenGraph.", 'wds' ); ?>
86
  <?php endif; ?>
87
  </p>
88
  </div>
89
 
90
  <div>
91
  <label class="sui-checkbox wds-inverted-checkbox">
92
- <input <?php checked( $disable_first_image ); ?>
93
- type="checkbox"
94
- value="1"
95
- name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $disable_first_image_id ); ?>]'
96
- aria-label="<?php esc_html_e( 'Disable use of first image in content.', 'wds' ); ?>"/>
 
 
97
 
98
  <span aria-hidden="true"></span>
99
 
1
  <?php
2
  /**
3
  * @var string $for_type
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
+ $option_name = empty( $option_name ) ? '' : $option_name;
9
  $title_field_id = empty( $title_field_id ) ? '' : $title_field_id;
10
+ $current_title = empty( $current_title ) ? '' : $current_title;
11
 
12
  $description_field_id = empty( $description_field_id ) ? '' : $description_field_id;
13
+ $current_description = empty( $current_description ) ? '' : $current_description;
14
 
15
+ $images_field_id = empty( $images_field_id ) ? '' : $images_field_id;
16
+ $current_images = empty( $current_images ) ? array() : $current_images;
17
  $images_available = ! empty( $current_images ) && is_array( $current_images );
18
+ $single_image = empty( $single_image ) ? false : true;
19
 
20
+ $title_placeholder = ( ! empty( $_view['options'][ "title-{$for_type}" ] ) ? $_view['options'][ "title-{$for_type}" ] : '' );
21
+ $description_placeholder = ( ! empty( $_view['options'][ "metadesc-{$for_type}" ] ) ? $_view['options'][ "metadesc-{$for_type}" ] : '' );
22
 
23
  $disable_first_image_id = empty( $disable_first_image_id ) ? false : $disable_first_image_id;
24
+ $disable_first_image = empty( $disable_first_image ) ? false : true;
25
+ $macros = empty( $macros ) ? array() : $macros;
26
  ?>
27
  <div class="sui-form-field">
28
  <label for="<?php echo esc_attr( $title_field_id ); ?>" class="sui-label">
29
  <?php esc_html_e( 'Title', 'wds' ); ?>
30
  </label>
31
  <div class="sui-insert-variables wds-allow-macros">
32
+ <input
33
+ id='<?php echo esc_attr( $title_field_id ); ?>'
34
+ name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $title_field_id ); ?>]'
35
+ size='' type='text' class='sui-form-control'
36
+ placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
37
+ value='<?php echo esc_attr( $current_title ); ?>'
38
+ />
39
+ <?php $this->render_view( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
40
  </div>
41
  </div>
42
 
45
  <?php esc_html_e( 'Description', 'wds' ); ?>
46
  </label>
47
  <div class="sui-insert-variables wds-allow-macros">
48
+ <textarea
49
+ id='<?php echo esc_attr( $description_field_id ); ?>'
50
+ name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $description_field_id ); ?>]'
51
+ placeholder="<?php echo esc_attr( $description_placeholder ); ?>"
52
+ type='text'
53
+ class='sui-form-control'
54
+ ><?php echo esc_textarea( $current_description ); ?></textarea>
55
 
56
+ <?php $this->render_view( 'macros-dropdown', array( 'macros' => $macros ) ); ?>
57
  </div>
58
  </div>
59
 
60
  <div>
61
  <label for="<?php echo esc_attr( $images_field_id ); ?>" class="sui-label">
62
+ <?php if ( $single_image ) : ?>
63
  <?php esc_html_e( 'Default Featured Image', 'wds' ); ?>
64
+ <?php else : ?>
65
  <?php esc_html_e( 'Default Featured Images', 'wds' ); ?>
66
  <?php endif; ?>
67
  </label>
68
+ <div
69
+ class="og-images <?php echo esc_attr( $images_field_id ); ?>"
70
+ data-singular="<?php echo $single_image ? 'true' : 'false'; ?>"
71
+ data-name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $images_field_id ); ?>]'
72
+ >
73
 
74
+ <div
75
+ class="add-action-wrapper sui-tooltip"
76
+ data-tooltip="<?php esc_attr_e( 'Add featured image', 'wds' ); ?>"
77
+ style="<?php echo $single_image && $images_available ? 'display:none;' : ''; ?>"
78
+ >
79
+ <a
80
+ href="#add" id="<?php echo esc_attr( $images_field_id ); ?>"
81
+ title="<?php esc_attr_e( 'Add image', 'wds' ); ?>"
82
+ >
83
  <span class="sui-icon-upload-cloud" aria-hidden="true"></span>
84
  </a>
85
  </div>
86
+ <?php foreach ( $current_images as $image ) : ?>
87
+ <?php
88
+ $this->render_view(
89
+ 'social-image-item',
90
+ array(
91
+ 'id' => $image,
92
+ 'field_name' => "{$option_name}[{$images_field_id}][]",
93
+ )
94
+ );
95
+ ?>
96
  <?php endforeach; ?>
97
  </div>
98
  <p class="sui-description">
99
+ <?php if ( $single_image ) : ?>
100
+ <?php esc_html_e( 'Choose featured image that will be used when sharing on Twitter.', 'wds' ); ?>
101
+ <?php else : ?>
102
+ <?php esc_html_e( 'Choose featured images that will be used when sharing on Facebook or other platforms that support OpenGraph.', 'wds' ); ?>
103
  <?php endif; ?>
104
  </p>
105
  </div>
106
 
107
  <div>
108
  <label class="sui-checkbox wds-inverted-checkbox">
109
+ <input
110
+ <?php checked( $disable_first_image ); ?>
111
+ type="checkbox"
112
+ value="1"
113
+ name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $disable_first_image_id ); ?>]'
114
+ aria-label="<?php esc_html_e( 'Disable use of first image in content.', 'wds' ); ?>"
115
+ />
116
 
117
  <span aria-hidden="true"></span>
118
 
includes/admin/templates/onpage/onpage-social-meta-tags.php CHANGED
@@ -1,57 +1,63 @@
1
  <?php
2
  /**
3
  * @var string $for_type
 
 
4
  */
 
5
  $section_enabled_field_id = empty( $section_enabled_field_id ) ? '' : $section_enabled_field_id;
6
- $section_enabled = empty( $section_enabled ) ? '' : $section_enabled;
7
- $section_title = empty( $section_title ) ? '' : $section_title;
8
- $section_description = empty( $section_description ) ? '' : $section_description;
9
- $option_name = empty( $option_name ) ? '' : $option_name;
10
- $title_field_id = empty( $title_field_id ) ? '' : $title_field_id;
11
- $current_title = empty( $current_title ) ? '' : $current_title;
12
 
13
  $description_field_id = empty( $description_field_id ) ? '' : $description_field_id;
14
- $current_description = empty( $current_description ) ? '' : $current_description;
15
 
16
- $images_field_id = empty( $images_field_id ) ? '' : $images_field_id;
17
- $current_images = empty( $current_images ) ? array() : $current_images;
18
  $images_available = ! empty( $current_images ) && is_array( $current_images );
19
- $single_image = empty( $single_image ) ? false : true;
20
 
21
- $title_placeholder = ( ! empty( $_view['options']["title-{$for_type}"] ) ? $_view['options']["title-{$for_type}"] : '' );
22
- $description_placeholder = ( ! empty( $_view['options']["metadesc-{$for_type}"] ) ? $_view['options']["metadesc-{$for_type}"] : '' );
23
 
24
  $disable_first_image_id = empty( $disable_first_image_id ) ? false : $disable_first_image_id;
25
- $disable_first_image = empty( $disable_first_image ) ? false : true;
26
- $macros = empty( $macros ) ? array() : $macros;
27
-
28
- $this->_render( 'toggle-item', array(
29
- 'field_name' => sprintf( '%s[%s]', $option_name, $section_enabled_field_id ),
30
- 'field_id' => $section_enabled_field_id,
31
- 'checked' => $section_enabled,
32
- 'item_label' => $section_title,
33
- 'item_description' => $section_description,
34
- 'sub_settings_template' => 'onpage/onpage-social-meta-tags-sub-settings',
35
- 'sub_settings_template_args' => array(
36
- 'for_type' => $for_type,
37
-
38
- 'option_name' => $option_name,
39
- 'title_field_id' => $title_field_id,
40
- 'current_title' => $current_title,
41
-
42
- 'description_field_id' => $description_field_id,
43
- 'current_description' => $current_description,
44
-
45
- 'images_field_id' => $images_field_id,
46
- 'current_images' => $current_images,
47
- 'images_available' => $images_available,
48
- 'single_image' => $single_image,
49
-
50
- 'title_placeholder' => $title_placeholder,
51
- 'description_placeholder' => $description_placeholder,
52
-
53
- 'disable_first_image_id' => $disable_first_image_id,
54
- 'disable_first_image' => $disable_first_image,
55
- 'macros' => $macros,
56
- ),
57
- ) );
 
 
 
1
  <?php
2
  /**
3
  * @var string $for_type
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
  $section_enabled_field_id = empty( $section_enabled_field_id ) ? '' : $section_enabled_field_id;
9
+ $section_enabled = empty( $section_enabled ) ? '' : $section_enabled;
10
+ $section_title = empty( $section_title ) ? '' : $section_title;
11
+ $section_description = empty( $section_description ) ? '' : $section_description;
12
+ $option_name = empty( $option_name ) ? '' : $option_name;
13
+ $title_field_id = empty( $title_field_id ) ? '' : $title_field_id;
14
+ $current_title = empty( $current_title ) ? '' : $current_title;
15
 
16
  $description_field_id = empty( $description_field_id ) ? '' : $description_field_id;
17
+ $current_description = empty( $current_description ) ? '' : $current_description;
18
 
19
+ $images_field_id = empty( $images_field_id ) ? '' : $images_field_id;
20
+ $current_images = empty( $current_images ) ? array() : $current_images;
21
  $images_available = ! empty( $current_images ) && is_array( $current_images );
22
+ $single_image = ! empty( $single_image );
23
 
24
+ $title_placeholder = ( ! empty( $_view['options'][ "title-{$for_type}" ] ) ? $_view['options'][ "title-{$for_type}" ] : '' );
25
+ $description_placeholder = ( ! empty( $_view['options'][ "metadesc-{$for_type}" ] ) ? $_view['options'][ "metadesc-{$for_type}" ] : '' );
26
 
27
  $disable_first_image_id = empty( $disable_first_image_id ) ? false : $disable_first_image_id;
28
+ $disable_first_image = empty( $disable_first_image ) ? false : true;
29
+ $macros = empty( $macros ) ? array() : $macros;
30
+
31
+ $this->render_view(
32
+ 'toggle-item',
33
+ array(
34
+ 'field_name' => sprintf( '%s[%s]', $option_name, $section_enabled_field_id ),
35
+ 'field_id' => $section_enabled_field_id,
36
+ 'checked' => $section_enabled,
37
+ 'item_label' => $section_title,
38
+ 'item_description' => $section_description,
39
+ 'sub_settings_template' => 'onpage/onpage-social-meta-tags-sub-settings',
40
+ 'sub_settings_template_args' => array(
41
+ 'for_type' => $for_type,
42
+
43
+ 'option_name' => $option_name,
44
+ 'title_field_id' => $title_field_id,
45
+ 'current_title' => $current_title,
46
+
47
+ 'description_field_id' => $description_field_id,
48
+ 'current_description' => $current_description,
49
+
50
+ 'images_field_id' => $images_field_id,
51
+ 'current_images' => $current_images,
52
+ 'images_available' => $images_available,
53
+ 'single_image' => $single_image,
54
+
55
+ 'title_placeholder' => $title_placeholder,
56
+ 'description_placeholder' => $description_placeholder,
57
+
58
+ 'disable_first_image_id' => $disable_first_image_id,
59
+ 'disable_first_image' => $disable_first_image,
60
+ 'macros' => $macros,
61
+ ),
62
+ )
63
+ );
includes/admin/templates/onpage/onpage-static-homepage.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $front_page = empty( $front_page ) ? null : $front_page;
3
  $front_page_notice = empty( $front_page_notice ) ? '' : $front_page_notice;
4
  if ( ! is_a( $front_page, 'WP_Post' ) ) {
5
  return;
@@ -10,8 +10,8 @@ if ( ! $smartcrawl_post ) {
10
  return;
11
  }
12
  $meta_title_placeholder = $smartcrawl_post->get_meta_title();
13
- $meta_desc_placeholder = $smartcrawl_post->get_meta_description();
14
- $macros = array_merge(
15
  Smartcrawl_Onpage_Settings::get_singular_macros( 'page' ),
16
  Smartcrawl_Onpage_Settings::get_general_macros()
17
  );
@@ -19,52 +19,62 @@ $macros = array_merge(
19
 
20
  <?php echo wp_kses_post( $front_page_notice ); ?>
21
 
22
- <?php $this->_render( 'onpage/onpage-preview' ); ?>
23
 
24
  <?php
25
- $this->_render( 'onpage/onpage-general-settings-inner', array(
26
- 'title' => smartcrawl_get_value( 'title', $front_page->ID ),
27
- 'title_placeholder' => $meta_title_placeholder,
28
- 'title_key' => 'title-static-home',
29
- 'title_label_desc' => esc_html__( 'Define the main title of your website that Google will index.', 'wds' ),
30
- 'title_field_desc' => esc_html__( 'This is generally your brand name, sometimes with a tagline.', 'wds' ),
31
-
32
- 'description' => smartcrawl_get_value( 'metadesc', $front_page->ID ),
33
- 'description_placeholder' => $meta_desc_placeholder,
34
- 'description_key' => 'metadesc-static-home',
35
- 'meta_label_desc' => esc_html__( 'Set the default description that will accompany your SEO title in search engine results.', 'wds' ),
36
- 'meta_field_desc' => esc_html__( 'Remember to keep it simple, to the point, and include a bit about what your website can offer potential visitors.', 'wds' ),
37
- 'macros' => $macros,
38
- ) );
 
 
39
 
40
- $this->_render( 'metabox/metabox-social-opengraph', array(
41
- 'post' => $front_page,
42
- ) );
 
 
 
43
 
44
- $this->_render( 'metabox/metabox-social-twitter', array(
45
- 'post' => $front_page,
46
- ) );
 
 
 
47
 
48
- $this->_render( 'metabox/metabox-advanced-indexing', array(
49
- 'robots_noindex_value' => (int) smartcrawl_get_value( 'meta-robots-noindex', $front_page->ID ),
50
- 'robots_nofollow_value' => (int) smartcrawl_get_value( 'meta-robots-nofollow', $front_page->ID ),
51
- 'robots_index_value' => (int) smartcrawl_get_value( 'meta-robots-index', $front_page->ID ),
52
- 'robots_follow_value' => (int) smartcrawl_get_value( 'meta-robots-follow', $front_page->ID ),
53
- 'advanced_value' => explode( ',', smartcrawl_get_value( 'meta-robots-adv', $front_page->ID ) ),
54
- 'post_type_noindexed' => (bool) smartcrawl_get_array_value( $_view['options'], 'meta_robots-noindex-page' ),
55
- 'post_type_nofollowed' => (bool) smartcrawl_get_array_value( $_view['options'], 'meta_robots-nofollow-page' ),
56
- ) );
 
 
 
57
  ?>
58
 
59
  <footer class="sui-box-footer">
60
- <button type="button"
61
- class="sui-button sui-button-blue wds-save-static-home-settings">
 
62
  <span class="sui-loading-text">
63
  <span class="sui-icon-save" aria-hidden="true"></span>
64
-
65
  <?php echo esc_html__( 'Save Settings', 'wds' ); ?>
66
  </span>
67
-
68
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
69
  </button>
70
  </footer>
1
  <?php
2
+ $front_page = empty( $front_page ) ? null : $front_page;
3
  $front_page_notice = empty( $front_page_notice ) ? '' : $front_page_notice;
4
  if ( ! is_a( $front_page, 'WP_Post' ) ) {
5
  return;
10
  return;
11
  }
12
  $meta_title_placeholder = $smartcrawl_post->get_meta_title();
13
+ $meta_desc_placeholder = $smartcrawl_post->get_meta_description();
14
+ $macros = array_merge(
15
  Smartcrawl_Onpage_Settings::get_singular_macros( 'page' ),
16
  Smartcrawl_Onpage_Settings::get_general_macros()
17
  );
19
 
20
  <?php echo wp_kses_post( $front_page_notice ); ?>
21
 
22
+ <?php $this->render_view( 'onpage/onpage-preview' ); ?>
23
 
24
  <?php
25
+ $this->render_view(
26
+ 'onpage/onpage-general-settings-inner',
27
+ array(
28
+ 'title' => smartcrawl_get_value( 'title', $front_page->ID ),
29
+ 'title_placeholder' => $meta_title_placeholder,
30
+ 'title_key' => 'title-static-home',
31
+ 'title_label_desc' => esc_html__( 'Define the main title of your website that Google will index.', 'wds' ),
32
+ 'title_field_desc' => esc_html__( 'This is generally your brand name, sometimes with a tagline.', 'wds' ),
33
+ 'description' => smartcrawl_get_value( 'metadesc', $front_page->ID ),
34
+ 'description_placeholder' => $meta_desc_placeholder,
35
+ 'description_key' => 'metadesc-static-home',
36
+ 'meta_label_desc' => esc_html__( 'Set the default description that will accompany your SEO title in search engine results.', 'wds' ),
37
+ 'meta_field_desc' => esc_html__( 'Remember to keep it simple, to the point, and include a bit about what your website can offer potential visitors.', 'wds' ),
38
+ 'macros' => $macros,
39
+ )
40
+ );
41
 
42
+ $this->render_view(
43
+ 'metabox/metabox-social-opengraph',
44
+ array(
45
+ 'post' => $front_page,
46
+ )
47
+ );
48
 
49
+ $this->render_view(
50
+ 'metabox/metabox-social-twitter',
51
+ array(
52
+ 'post' => $front_page,
53
+ )
54
+ );
55
 
56
+ $this->render_view(
57
+ 'metabox/metabox-advanced-indexing',
58
+ array(
59
+ 'robots_noindex_value' => (int) smartcrawl_get_value( 'meta-robots-noindex', $front_page->ID ),
60
+ 'robots_nofollow_value' => (int) smartcrawl_get_value( 'meta-robots-nofollow', $front_page->ID ),
61
+ 'robots_index_value' => (int) smartcrawl_get_value( 'meta-robots-index', $front_page->ID ),
62
+ 'robots_follow_value' => (int) smartcrawl_get_value( 'meta-robots-follow', $front_page->ID ),
63
+ 'advanced_value' => explode( ',', smartcrawl_get_value( 'meta-robots-adv', $front_page->ID ) ),
64
+ 'post_type_noindexed' => (bool) smartcrawl_get_array_value( $_view['options'], 'meta_robots-noindex-page' ),
65
+ 'post_type_nofollowed' => (bool) smartcrawl_get_array_value( $_view['options'], 'meta_robots-nofollow-page' ),
66
+ )
67
+ );
68
  ?>
69
 
70
  <footer class="sui-box-footer">
71
+ <button
72
+ type="button"
73
+ class="sui-button sui-button-blue wds-save-static-home-settings">
74
  <span class="sui-loading-text">
75
  <span class="sui-icon-save" aria-hidden="true"></span>
 
76
  <?php echo esc_html__( 'Save Settings', 'wds' ); ?>
77
  </span>
 
78
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
79
  </button>
80
  </footer>
includes/admin/templates/onpage/onpage-twitter-disabled.php CHANGED
@@ -2,7 +2,7 @@
2
  $message = esc_html__( 'Twitter Cards are globally disabled.', 'wds' );
3
  if ( Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL ) ) {
4
  $social_page = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SOCIAL );
5
- $message = sprintf(
6
  esc_html__( '%1$s You can enable them %2$s.', 'wds' ),
7
  $message,
8
  sprintf(
@@ -13,7 +13,10 @@ if ( Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL
13
  );
14
  }
15
 
16
- $this->_render( 'notice', array(
17
- 'class' => 'sui-notice-info',
18
- 'message' => $message,
19
- ) );
 
 
 
2
  $message = esc_html__( 'Twitter Cards are globally disabled.', 'wds' );
3
  if ( Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL ) ) {
4
  $social_page = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SOCIAL );
5
+ $message = sprintf(
6
  esc_html__( '%1$s You can enable them %2$s.', 'wds' ),
7
  $message,
8
  sprintf(
13
  );
14
  }
15
 
16
+ $this->render_view(
17
+ 'notice',
18
+ array(
19
+ 'class' => 'sui-notice-info',
20
+ 'message' => $message,
21
+ )
22
+ );
includes/admin/templates/onpage/onpage-twitter-settings.php CHANGED
@@ -1,48 +1,50 @@
1
  <?php
2
  /**
3
  * @var string $for_type
 
 
4
  */
 
5
  $section_enabled_field_id = 'twitter-active-' . $for_type;
6
- $section_enabled = ! empty( $_view['options'][ $section_enabled_field_id ] ) ? $_view['options'][ $section_enabled_field_id ] : false;
7
- $section_title = __( 'Enable Twitter Cards', 'wds' );
8
- $section_description = empty( $section_description )
9
  ? esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter.', 'wds' )
10
  : $section_description;
11
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
12
- $title_field_id = 'twitter-title-' . $for_type;
13
- $current_title = ! empty( $_view['options']["twitter-title-{$for_type}"] )
14
- ? $_view['options']["twitter-title-{$for_type}"]
15
  : '';
16
 
17
  $description_field_id = 'twitter-description-' . $for_type;
18
- $current_description = ! empty( $_view['options']["twitter-description-{$for_type}"] )
19
- ? $_view['options']["twitter-description-{$for_type}"]
20
- : '';
21
 
22
  $images_field_id = 'twitter-images-' . $for_type;
23
- $current_images = ! empty( $_view['options']["twitter-images-{$for_type}"] ) && is_array( $_view['options']["twitter-images-{$for_type}"] )
24
- ? $_view['options']["twitter-images-{$for_type}"]
25
- : array();
26
- $macros = empty( $macros ) ? array() : $macros;
27
 
28
  $disable_first_image_id = 'twitter-disable-first-image-' . $for_type;
29
- $disable_first_image = ! empty( $_view['options'][ $disable_first_image_id ] );
30
 
31
- $this->_render( 'onpage/onpage-social-meta-tags', array(
32
- 'for_type' => $for_type,
33
- 'section_enabled_field_id' => $section_enabled_field_id,
34
- 'section_enabled' => $section_enabled,
35
- 'section_title' => $section_title,
36
- 'section_description' => $section_description,
37
- 'option_name' => $option_name,
38
- 'title_field_id' => $title_field_id,
39
- 'current_title' => $current_title,
40
- 'description_field_id' => $description_field_id,
41
- 'current_description' => $current_description,
42
- 'images_field_id' => $images_field_id,
43
- 'current_images' => $current_images,
44
- 'single_image' => true,
45
- 'disable_first_image_id' => $disable_first_image_id,
46
- 'disable_first_image' => $disable_first_image,
47
- 'macros' => $macros,
48
- ) );
 
 
 
1
  <?php
2
  /**
3
  * @var string $for_type
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
  $section_enabled_field_id = 'twitter-active-' . $for_type;
9
+ $section_enabled = ! empty( $_view['options'][ $section_enabled_field_id ] ) ? $_view['options'][ $section_enabled_field_id ] : false;
10
+ $section_title = __( 'Enable Twitter Cards', 'wds' );
11
+ $section_description = empty( $section_description )
12
  ? esc_html__( 'Twitter Cards support enhances how your content appears when shared on Twitter.', 'wds' )
13
  : $section_description;
14
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
15
+ $title_field_id = 'twitter-title-' . $for_type;
16
+ $current_title = ! empty( $_view['options'][ "twitter-title-{$for_type}" ] )
17
+ ? $_view['options'][ "twitter-title-{$for_type}" ]
18
  : '';
19
 
20
  $description_field_id = 'twitter-description-' . $for_type;
21
+ $current_description = ! empty( $_view['options'][ "twitter-description-{$for_type}" ] ) ? $_view['options'][ "twitter-description-{$for_type}" ] : '';
 
 
22
 
23
  $images_field_id = 'twitter-images-' . $for_type;
24
+ $current_images = ! empty( $_view['options'][ "twitter-images-{$for_type}" ] ) && is_array( $_view['options'][ "twitter-images-{$for_type}" ] ) ? $_view['options'][ "twitter-images-{$for_type}" ] : array();
25
+ $macros = empty( $macros ) ? array() : $macros;
 
 
26
 
27
  $disable_first_image_id = 'twitter-disable-first-image-' . $for_type;
28
+ $disable_first_image = ! empty( $_view['options'][ $disable_first_image_id ] );
29
 
30
+ $this->render_view(
31
+ 'onpage/onpage-social-meta-tags',
32
+ array(
33
+ 'for_type' => $for_type,
34
+ 'section_enabled_field_id' => $section_enabled_field_id,
35
+ 'section_enabled' => $section_enabled,
36
+ 'section_title' => $section_title,
37
+ 'section_description' => $section_description,
38
+ 'option_name' => $option_name,
39
+ 'title_field_id' => $title_field_id,
40
+ 'current_title' => $current_title,
41
+ 'description_field_id' => $description_field_id,
42
+ 'current_description' => $current_description,
43
+ 'images_field_id' => $images_field_id,
44
+ 'current_images' => $current_images,
45
+ 'single_image' => true,
46
+ 'disable_first_image_id' => $disable_first_image_id,
47
+ 'disable_first_image' => $disable_first_image,
48
+ 'macros' => $macros,
49
+ )
50
+ );
includes/admin/templates/onpage/underscore-onpage-preview.php CHANGED
@@ -1,6 +1,9 @@
1
  <?php
2
- $this->_render( 'onpage/onpage-preview', array(
3
- 'link' => '{{- link }}',
4
- 'title' => '{{- title }}',
5
- 'description' => '{{- description }}',
6
- ) );
 
 
 
1
  <?php
2
+ $this->render_view(
3
+ 'onpage/onpage-preview',
4
+ array(
5
+ 'link' => '{{- link }}',
6
+ 'title' => '{{- title }}',
7
+ 'description' => '{{- description }}',
8
+ )
9
+ );
includes/admin/templates/page-header.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
- $title = empty( $title ) ? '' : $title;
3
  $documentation_chapter = empty( $documentation_chapter ) ? '' : $documentation_chapter;
4
- $utm_campaign = empty( $utm_campaign ) ? '' : $utm_campaign;
5
- $left_actions = empty( $left_actions ) ? '' : $left_actions;
6
- $left_actions_args = empty( $left_actions_args ) ? array() : $left_actions_args;
7
- $extra_actions = empty( $extra_actions ) ? '' : $extra_actions;
8
- $extra_actions_args = empty( $extra_actions_args ) ? array() : $extra_actions_args;
9
  ?>
10
 
11
  <?php do_action( 'wds_admin_notices' ); ?>
@@ -13,18 +13,20 @@ $extra_actions_args = empty( $extra_actions_args ) ? array() : $extra_actions_ar
13
  <div class="sui-header">
14
  <h1 class="sui-header-title"><?php echo esc_html( $title ); ?></h1>
15
 
16
- <?php if ( $left_actions ): ?>
17
  <div class="sui-actions-left">
18
- <?php $this->_render( $left_actions, $left_actions_args ); ?>
19
  </div>
20
  <?php endif; ?>
21
 
22
- <?php if ( $documentation_chapter ): ?>
23
  <div class="sui-actions-right">
24
- <?php $this->_render( $extra_actions, $extra_actions_args ); ?>
25
 
26
- <a target="_blank" class="sui-button sui-button-ghost wds-docs-button"
27
- href="https://wpmudev.com/docs/wpmu-dev-plugins/smartcrawl/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=<?php echo esc_attr( $utm_campaign ); ?>#<?php echo esc_attr( $documentation_chapter ); ?>">
 
 
28
  <span class="sui-icon-academy" aria-hidden="true"></span>
29
  <?php esc_html_e( 'View Documentation', 'wds' ); ?>
30
  </a>
1
  <?php
2
+ $title = empty( $title ) ? '' : $title; // phpcs:ignore
3
  $documentation_chapter = empty( $documentation_chapter ) ? '' : $documentation_chapter;
4
+ $utm_campaign = empty( $utm_campaign ) ? '' : $utm_campaign;
5
+ $left_actions = empty( $left_actions ) ? '' : $left_actions;
6
+ $left_actions_args = empty( $left_actions_args ) ? array() : $left_actions_args;
7
+ $extra_actions = empty( $extra_actions ) ? '' : $extra_actions;
8
+ $extra_actions_args = empty( $extra_actions_args ) ? array() : $extra_actions_args;
9
  ?>
10
 
11
  <?php do_action( 'wds_admin_notices' ); ?>
13
  <div class="sui-header">
14
  <h1 class="sui-header-title"><?php echo esc_html( $title ); ?></h1>
15
 
16
+ <?php if ( $left_actions ) : ?>
17
  <div class="sui-actions-left">
18
+ <?php $this->render_view( $left_actions, $left_actions_args ); ?>
19
  </div>
20
  <?php endif; ?>
21
 
22
+ <?php if ( $documentation_chapter ) : ?>
23
  <div class="sui-actions-right">
24
+ <?php $this->render_view( $extra_actions, $extra_actions_args ); ?>
25
 
26
+ <a
27
+ target="_blank" class="sui-button sui-button-ghost wds-docs-button"
28
+ href="https://wpmudev.com/docs/wpmu-dev-plugins/smartcrawl/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=<?php echo esc_attr( $utm_campaign ); ?>#<?php echo esc_attr( $documentation_chapter ); ?>"
29
+ >
30
  <span class="sui-icon-academy" aria-hidden="true"></span>
31
  <?php esc_html_e( 'View Documentation', 'wds' ); ?>
32
  </a>
includes/admin/templates/post-list/meta-details.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $post = empty( $post ) ? null : $post;
3
  if ( ! $post ) {
4
  return;
5
  }
@@ -8,19 +8,17 @@ if ( ! $smartcrawl_post ) {
8
  return;
9
  }
10
 
11
- $title = $smartcrawl_post->get_meta_title();
12
- $title_length = mb_strlen( trim( $title ) );
13
- $title_tag_class = $title_length >= smartcrawl_title_min_length()
14
- && $title_length <= smartcrawl_title_max_length() ? 'wds-tag-success' : 'wds-tag-warning';
15
 
16
- $metadesc = $smartcrawl_post->get_meta_description();
17
- $metadesc_length = mb_strlen( trim( $metadesc ) );
18
- $metadesc_tag_class = $metadesc_length >= smartcrawl_metadesc_min_length()
19
- && $metadesc_length <= smartcrawl_metadesc_max_length() ? 'wds-tag-success' : 'wds-tag-warning';
20
 
21
- $of = esc_html__( 'of', 'wds' );
22
- $title_min = smartcrawl_title_min_length();
23
- $title_max = smartcrawl_title_max_length();
24
  $metadesc_min = smartcrawl_metadesc_min_length();
25
  $metadesc_max = smartcrawl_metadesc_max_length();
26
  ?>
@@ -35,7 +33,7 @@ $metadesc_max = smartcrawl_metadesc_max_length();
35
  </strong>
36
 
37
  <div class="wds-meta-details-inner hidden">
38
- <?php if ( $title ): ?>
39
  <div>
40
  <strong>
41
  <?php esc_html_e( 'Title', 'wds' ); ?>
@@ -47,7 +45,7 @@ $metadesc_max = smartcrawl_metadesc_max_length();
47
  </div>
48
  <?php endif; ?>
49
 
50
- <?php if ( $metadesc ): ?>
51
  <div>
52
  <strong>
53
  <?php esc_html_e( 'Description', 'wds' ); ?>
1
  <?php
2
+ $post = empty( $post ) ? null : $post; // phpcs:ignore
3
  if ( ! $post ) {
4
  return;
5
  }
8
  return;
9
  }
10
 
11
+ $title = $smartcrawl_post->get_meta_title(); // phpcs:ignore
12
+ $title_length = mb_strlen( trim( $title ) );
13
+ $title_tag_class = $title_length >= smartcrawl_title_min_length() && $title_length <= smartcrawl_title_max_length() ? 'wds-tag-success' : 'wds-tag-warning';
 
14
 
15
+ $metadesc = $smartcrawl_post->get_meta_description();
16
+ $metadesc_length = mb_strlen( trim( $metadesc ) );
17
+ $metadesc_tag_class = $metadesc_length >= smartcrawl_metadesc_min_length() && $metadesc_length <= smartcrawl_metadesc_max_length() ? 'wds-tag-success' : 'wds-tag-warning';
 
18
 
19
+ $of = esc_html__( 'of', 'wds' );
20
+ $title_min = smartcrawl_title_min_length();
21
+ $title_max = smartcrawl_title_max_length();
22
  $metadesc_min = smartcrawl_metadesc_min_length();
23
  $metadesc_max = smartcrawl_metadesc_max_length();
24
  ?>
33
  </strong>
34
 
35
  <div class="wds-meta-details-inner hidden">
36
+ <?php if ( $title ) : ?>
37
  <div>
38
  <strong>
39
  <?php esc_html_e( 'Title', 'wds' ); ?>
45
  </div>
46
  <?php endif; ?>
47
 
48
+ <?php if ( $metadesc ) : ?>
49
  <div>
50
  <strong>
51
  <?php esc_html_e( 'Description', 'wds' ); ?>
includes/admin/templates/post-list/post-seo-analysis-errors.php CHANGED
@@ -1,18 +1,20 @@
1
  <?php
2
  $focus_missing = empty( $focus_missing ) ? false : $focus_missing;
3
- $errors = empty( $errors ) ? array() : $errors;
4
- $status_class = empty( $status_class ) ? 'wds-status-warning' : $status_class;
5
  ?>
6
 
7
  <div class="wds-analysis <?php echo esc_attr( $status_class ); ?>">
8
  <span>
9
- <?php echo $focus_missing
 
10
  ? esc_html__( 'N/A', 'wds' )
11
- : esc_html( count( $errors ) ); ?>
 
12
  </span>
13
  </div>
14
  <div class="wds-analysis-details">
15
- <?php foreach ( $errors as $key => $error ): ?>
16
  <div class="wds-error <?php echo esc_attr( $key ); ?>">
17
  <?php echo esc_html( $error ); ?>
18
  </div>
1
  <?php
2
  $focus_missing = empty( $focus_missing ) ? false : $focus_missing;
3
+ $errors = empty( $errors ) ? array() : $errors; // phpcs:ignore
4
+ $status_class = empty( $status_class ) ? 'wds-status-warning' : $status_class;
5
  ?>
6
 
7
  <div class="wds-analysis <?php echo esc_attr( $status_class ); ?>">
8
  <span>
9
+ <?php
10
+ echo $focus_missing
11
  ? esc_html__( 'N/A', 'wds' )
12
+ : esc_html( count( $errors ) );
13
+ ?>
14
  </span>
15
  </div>
16
  <div class="wds-analysis-details">
17
+ <?php foreach ( $errors as $key => $error ) : // phpcs:ignore ?>
18
  <div class="wds-error <?php echo esc_attr( $key ); ?>">
19
  <?php echo esc_html( $error ); ?>
20
  </div>
includes/admin/templates/post-list/quick-edit-onpage.php CHANGED
@@ -17,9 +17,11 @@
17
  </label>
18
  </div>
19
  </fieldset>
20
- <input type="hidden"
21
- value="<?php echo esc_attr( wp_create_nonce( 'wds-metabox-nonce' ) ); ?>"
22
- name="_wds_nonce"/>
 
 
23
  <style>
24
  .inline-edit-col .title.metadesc {
25
  display: block;
17
  </label>
18
  </div>
19
  </fieldset>
20
+ <input
21
+ type="hidden"
22
+ value="<?php echo esc_attr( wp_create_nonce( 'wds-metabox-nonce' ) ); ?>"
23
+ name="_wds_nonce"
24
+ />
25
  <style>
26
  .inline-edit-col .title.metadesc {
27
  display: block;
includes/admin/templates/post-list/quick-edit-seo-analysis.php CHANGED
@@ -5,9 +5,11 @@
5
  <span class="title"><?php esc_html_e( 'Focus keywords', 'wds' ); ?></span>
6
  <span class="input-text-wrap">
7
  <input class="ptitle smartcrawl_focus" type="text" value="" name="wds_focus"/>
8
- <input type="hidden"
9
- value="<?php echo esc_attr( wp_create_nonce( 'wds-metabox-nonce' ) ); ?>"
10
- name="_wds_nonce"/>
 
 
11
  </span>
12
  </label>
13
  </div>
5
  <span class="title"><?php esc_html_e( 'Focus keywords', 'wds' ); ?></span>
6
  <span class="input-text-wrap">
7
  <input class="ptitle smartcrawl_focus" type="text" value="" name="wds_focus"/>
8
+ <input
9
+ type="hidden"
10
+ value="<?php echo esc_attr( wp_create_nonce( 'wds-metabox-nonce' ) ); ?>"
11
+ name="_wds_nonce"
12
+ />
13
  </span>
14
  </label>
15
  </div>
includes/admin/templates/post-search-dropdown-form-field.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $field_name = empty( $field_name ) ? '' : $field_name;
4
- $field_label = empty( $field_label ) ? '' : $field_label;
5
  $field_description = empty( $field_description ) ? '' : $field_description;
6
- $selected_post_id = empty( $selected_post_id ) ? '' : $selected_post_id;
7
- $post_type = empty( $post_type ) ? '' : $post_type;
8
- $placeholder = empty( $placeholder ) ? '' : $placeholder;
9
- $allow_clear = empty( $allow_clear ) ? false : $allow_clear;
10
- $first_option = empty( $first_option ) ? '' : $first_option;
11
- $pages = empty( $pages ) ? array() : $pages;
12
  ?>
13
 
14
  <div class="sui-form-field">
@@ -17,21 +17,23 @@ $pages = empty( $pages ) ? array() : $pages;
17
  </label>
18
  <div class="sui-row">
19
  <div class="sui-col-md-6">
20
- <select id="<?php echo esc_attr( $field_name ); ?>"
21
- name="<?php echo esc_attr( "{$option_name}[$field_name]" ); ?>"
22
- data-post-type="<?php echo esc_attr( $post_type ); ?>"
23
- class="sui-select"
24
- data-allow-clear="<?php echo intval( $allow_clear ); ?>"
25
- <?php if ( $placeholder ): ?>data-placeholder="<?php echo esc_attr( $placeholder ); ?>"<?php endif; ?>
 
 
 
26
  >
27
-
28
- <?php if ( $placeholder || $first_option ): ?>
29
  <option value=""><?php echo esc_html( $first_option ); ?></option>
30
  <?php endif; ?>
31
 
32
- <?php foreach ( $pages as $page_id => $page_title ): ?>
33
  <option <?php selected( $selected_post_id, $page_id ); ?>
34
- value="<?php echo esc_attr( $page_id ); ?>">
35
  <?php echo esc_html( $page_title ); ?>
36
  </option>
37
  <?php endforeach; ?>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $field_name = empty( $field_name ) ? '' : $field_name;
4
+ $field_label = empty( $field_label ) ? '' : $field_label;
5
  $field_description = empty( $field_description ) ? '' : $field_description;
6
+ $selected_post_id = empty( $selected_post_id ) ? '' : $selected_post_id;
7
+ $post_type = empty( $post_type ) ? '' : $post_type; // phpcs:ignore
8
+ $placeholder = empty( $placeholder ) ? '' : $placeholder;
9
+ $allow_clear = empty( $allow_clear ) ? false : $allow_clear;
10
+ $first_option = empty( $first_option ) ? '' : $first_option;
11
+ $pages = empty( $pages ) ? array() : $pages; // phpcs:ignore
12
  ?>
13
 
14
  <div class="sui-form-field">
17
  </label>
18
  <div class="sui-row">
19
  <div class="sui-col-md-6">
20
+ <select
21
+ id="<?php echo esc_attr( $field_name ); ?>"
22
+ name="<?php echo esc_attr( "{$option_name}[$field_name]" ); ?>"
23
+ data-post-type="<?php echo esc_attr( $post_type ); ?>"
24
+ class="sui-select"
25
+ data-allow-clear="<?php echo intval( $allow_clear ); ?>"
26
+ <?php if ( $placeholder ) : ?>
27
+ data-placeholder="<?php echo esc_attr( $placeholder ); ?>"
28
+ <?php endif; ?>
29
  >
30
+ <?php if ( $placeholder || $first_option ) : ?>
 
31
  <option value=""><?php echo esc_html( $first_option ); ?></option>
32
  <?php endif; ?>
33
 
34
+ <?php foreach ( $pages as $page_id => $page_title ) : ?>
35
  <option <?php selected( $selected_post_id, $page_id ); ?>
36
+ value="<?php echo esc_attr( $page_id ); ?>">
37
  <?php echo esc_html( $page_title ); ?>
38
  </option>
39
  <?php endforeach; ?>
includes/admin/templates/progress-bar.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $progress = empty( $progress ) ? 0 : $progress;
3
  $progress_state = empty( $progress_state ) ? '' : $progress_state;
4
  ?>
5
 
1
  <?php
2
+ $progress = empty( $progress ) ? 0 : $progress;
3
  $progress_state = empty( $progress_state ) ? '' : $progress_state;
4
  ?>
5
 
includes/admin/templates/progress-notice.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  $admin_email = false;
3
- $dash_email = false;
4
  if ( class_exists( 'WPMUDEV_Dashboard' ) && ! empty( WPMUDEV_Dashboard::$site ) ) {
5
  if ( is_callable( array( WPMUDEV_Dashboard::$site, 'get_option' ) ) ) {
6
  $dash_email = WPMUDEV_Dashboard::$site->get_option( 'auth_user' );
@@ -22,9 +22,11 @@ if ( ! $message ) {
22
  <?php $admin_email = sprintf( '<strong>%1$s</strong>', esc_html__( 'your DEV account email', 'wds' ) ); ?>
23
  <?php } ?>
24
 
25
- <?php printf(
 
26
  wp_kses_post( $message ),
27
  wp_kses_post( $admin_email )
28
- ); ?>
 
29
  </small>
30
  </p>
1
  <?php
2
  $admin_email = false;
3
+ $dash_email = false;
4
  if ( class_exists( 'WPMUDEV_Dashboard' ) && ! empty( WPMUDEV_Dashboard::$site ) ) {
5
  if ( is_callable( array( WPMUDEV_Dashboard::$site, 'get_option' ) ) ) {
6
  $dash_email = WPMUDEV_Dashboard::$site->get_option( 'auth_user' );
22
  <?php $admin_email = sprintf( '<strong>%1$s</strong>', esc_html__( 'your DEV account email', 'wds' ) ); ?>
23
  <?php } ?>
24
 
25
+ <?php
26
+ printf(
27
  wp_kses_post( $message ),
28
  wp_kses_post( $admin_email )
29
+ );
30
+ ?>
31
  </small>
32
  </p>
includes/admin/templates/report-vertical-tab.php CHANGED
@@ -1,21 +1,21 @@
1
  <section class="tab wds-report-vertical-tab">
2
  <?php
3
  // TODO: DO we still need a separate report-vertical-tab?
4
- // Required
5
- $tab_id = empty( $tab_id ) ? '' : $tab_id;
6
- $tab_name = empty( $tab_name ) ? '' : $tab_name;
7
- $is_active = empty( $is_active ) ? false : $is_active;
8
  $tab_sections = ! empty( $tab_sections ) && is_array( $tab_sections ) ? $tab_sections : array();
9
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
10
 
11
- // Optional
12
- $button_text = isset( $button_text ) ? $button_text : __( 'Save Settings', 'wds' );
13
  $before_output = isset( $before_output ) ? $before_output : null;
14
- $after_output = isset( $after_output ) ? $after_output : null;
15
- $title_button = isset( $title_button ) ? $title_button : 'ignore';
16
 
17
- // Variables
18
- $is_singular = count( $tab_sections ) === 1;
19
  $smartcrawl_options = Smartcrawl_Settings::get_options();
20
  ?>
21
 
@@ -52,12 +52,15 @@
52
 
53
  <?php foreach ( $tab_sections as $section ) : ?>
54
  <?php
55
- $this->_render( 'vertical-tab-section', array_merge(
56
- $section,
57
- array(
58
- 'show_accordion' => ! $is_singular,
 
 
 
59
  )
60
- ) );
61
  ?>
62
  <?php endforeach; ?>
63
 
1
  <section class="tab wds-report-vertical-tab">
2
  <?php
3
  // TODO: DO we still need a separate report-vertical-tab?
4
+ // Required.
5
+ $tab_id = empty( $tab_id ) ? '' : $tab_id;
6
+ $tab_name = empty( $tab_name ) ? '' : $tab_name;
7
+ $is_active = empty( $is_active ) ? false : $is_active;
8
  $tab_sections = ! empty( $tab_sections ) && is_array( $tab_sections ) ? $tab_sections : array();
9
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
10
 
11
+ // Optional.
12
+ $button_text = isset( $button_text ) ? $button_text : __( 'Save Settings', 'wds' );
13
  $before_output = isset( $before_output ) ? $before_output : null;
14
+ $after_output = isset( $after_output ) ? $after_output : null;
15
+ $title_button = isset( $title_button ) ? $title_button : 'ignore';
16
 
17
+ // Variables.
18
+ $is_singular = count( $tab_sections ) === 1;
19
  $smartcrawl_options = Smartcrawl_Settings::get_options();
20
  ?>
21
 
52
 
53
  <?php foreach ( $tab_sections as $section ) : ?>
54
  <?php
55
+ $this->render_view(
56
+ 'vertical-tab-section',
57
+ array_merge(
58
+ $section,
59
+ array(
60
+ 'show_accordion' => ! $is_singular,
61
+ )
62
  )
63
+ );
64
  ?>
65
  <?php endforeach; ?>
66
 
includes/admin/templates/reporting-dow-select.php CHANGED
@@ -5,12 +5,12 @@ if ( ! $component ) {
5
  }
6
 
7
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
8
- $dow_value = empty( $dow_value ) ? false : $dow_value;
9
- $is_member = empty( $_view['is_member'] ) ? false : true;
10
- $disabled = $is_member ? '' : 'disabled';
11
- $monday = strtotime( 'this Monday' );
12
- $monthly = empty( $monthly ) ? false : true;
13
- $days = array(
14
  esc_html__( 'Sunday', 'wds' ),
15
  esc_html__( 'Monday', 'wds' ),
16
  esc_html__( 'Tuesday', 'wds' ),
@@ -19,14 +19,16 @@ $days = array(
19
  esc_html__( 'Friday', 'wds' ),
20
  esc_html__( 'Saturday', 'wds' ),
21
  );
22
- $dow_range = $monthly ? range( 1, 28 ) : range( 0, 6 );
23
 
24
- $select_id = "wds-{$component}-dow" . ( $monthly ? '-monthly' : '' );
25
  $select_name = "{$option_name}[{$component}-dow]";
26
  ?>
27
 
28
- <label for="<?php echo esc_attr( $select_id ); ?>"
29
- class="sui-label">
 
 
30
  <?php
31
  $monthly
32
  ? esc_html_e( 'Day of the month', 'wds' )
@@ -34,11 +36,12 @@ $select_name = "{$option_name}[{$component}-dow]";
34
  ?>
35
  </label>
36
 
37
- <select class="sui-select" <?php echo esc_attr( $disabled ); ?>
38
- id="<?php echo esc_attr( $select_id ); ?>"
39
- data-minimum-results-for-search="-1"
40
- name="<?php echo esc_attr( $select_name ); ?>">
41
-
 
42
  <?php foreach ( $dow_range as $dow ) : ?>
43
  <option value="<?php echo esc_attr( $dow ); ?>"
44
  <?php selected( $dow, $dow_value ); ?>>
@@ -46,7 +49,7 @@ $select_name = "{$option_name}[{$component}-dow]";
46
  if ( $monthly ) {
47
  echo esc_html( $dow );
48
  } else {
49
- $day_number = date( 'w', $monday + ( $dow * DAY_IN_SECONDS ) );
50
  echo esc_html( $days[ $day_number ] );
51
  }
52
  ?>
5
  }
6
 
7
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
8
+ $dow_value = empty( $dow_value ) ? false : $dow_value;
9
+ $is_member = ! empty( $_view['is_member'] );
10
+ $disabled = $is_member ? '' : 'disabled';
11
+ $monday = strtotime( 'this Monday' );
12
+ $monthly = ! empty( $monthly );
13
+ $days = array(
14
  esc_html__( 'Sunday', 'wds' ),
15
  esc_html__( 'Monday', 'wds' ),
16
  esc_html__( 'Tuesday', 'wds' ),
19
  esc_html__( 'Friday', 'wds' ),
20
  esc_html__( 'Saturday', 'wds' ),
21
  );
22
+ $dow_range = $monthly ? range( 1, 28 ) : range( 0, 6 );
23
 
24
+ $select_id = "wds-{$component}-dow" . ( $monthly ? '-monthly' : '' );
25
  $select_name = "{$option_name}[{$component}-dow]";
26
  ?>
27
 
28
+ <label
29
+ for="<?php echo esc_attr( $select_id ); ?>"
30
+ class="sui-label"
31
+ >
32
  <?php
33
  $monthly
34
  ? esc_html_e( 'Day of the month', 'wds' )
36
  ?>
37
  </label>
38
 
39
+ <select
40
+ class="sui-select" <?php echo esc_attr( $disabled ); ?>
41
+ id="<?php echo esc_attr( $select_id ); ?>"
42
+ data-minimum-results-for-search="-1"
43
+ name="<?php echo esc_attr( $select_name ); ?>"
44
+ >
45
  <?php foreach ( $dow_range as $dow ) : ?>
46
  <option value="<?php echo esc_attr( $dow ); ?>"
47
  <?php selected( $dow, $dow_value ); ?>>
49
  if ( $monthly ) {
50
  echo esc_html( $dow );
51
  } else {
52
+ $day_number = date( 'w', $monday + ( $dow * DAY_IN_SECONDS ) ); // phpcs:ignore
53
  echo esc_html( $days[ $day_number ] );
54
  }
55
  ?>
includes/admin/templates/reporting-schedule.php CHANGED
@@ -8,27 +8,29 @@ if ( ! $component ) {
8
  }
9
 
10
  $cron = Smartcrawl_Controller_Cron::get();
11
- // This does the actual rescheduling
12
  $cron->set_up_schedule();
13
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
14
 
15
  $frequency_radio_name = "{$option_name}[{$component}-frequency]";
16
- $frequency_radio_id = "wds-{$component}-frequency-radio";
17
- $pane_id = "wds-{$component}-frequency-pane";
18
  ?>
19
 
20
- <div id="wds-<?php echo esc_attr( $component ); ?>-frequency-tabs"
21
- class="wds-frequency-tabs sui-side-tabs sui-tabs">
22
-
 
23
  <div class="sui-tabs-menu">
24
  <?php foreach ( $cron->get_frequencies() as $key => $label ) : ?>
25
  <label class="sui-tab-item <?php echo $key === $frequency ? 'active' : ''; ?>">
26
 
27
  <?php echo esc_html( $label ); ?>
28
- <input name="<?php echo esc_attr( $frequency_radio_name ); ?>"
29
- value="<?php echo esc_attr( $key ); ?>"
30
- type="radio" <?php checked( $key, $frequency ); ?>
31
- class="<?php echo esc_attr( $frequency_radio_id ); ?>"
 
32
  />
33
  </label>
34
  <?php endforeach; ?>
@@ -38,29 +40,44 @@ $pane_id = "wds-{$component}-frequency-pane";
38
  <div class="sui-row">
39
  <div class="sui-col wds-dow weekly">
40
  <div class="sui-form-field">
41
- <?php $this->_render( 'reporting-dow-select', array(
42
- 'component' => $component,
43
- 'dow_value' => $dow_value,
44
- ) ); ?>
 
 
 
 
 
45
  </div>
46
  </div>
47
 
48
  <div class="sui-col wds-dow monthly">
49
  <div class="sui-form-field">
50
- <?php $this->_render( 'reporting-dow-select', array(
51
- 'component' => $component,
52
- 'dow_value' => $dow_value,
53
- 'monthly' => true,
54
- ) ); ?>
 
 
 
 
 
55
  </div>
56
  </div>
57
 
58
  <div class="sui-col">
59
  <div class="sui-form-field">
60
- <?php $this->_render( 'reporting-tod-select', array(
61
- 'component' => $component,
62
- 'tod_value' => $tod_value,
63
- ) ); ?>
 
 
 
 
 
64
  </div>
65
  </div>
66
  </div>
8
  }
9
 
10
  $cron = Smartcrawl_Controller_Cron::get();
11
+ // This does the actual rescheduling.
12
  $cron->set_up_schedule();
13
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
14
 
15
  $frequency_radio_name = "{$option_name}[{$component}-frequency]";
16
+ $frequency_radio_id = "wds-{$component}-frequency-radio";
17
+ $pane_id = "wds-{$component}-frequency-pane";
18
  ?>
19
 
20
+ <div
21
+ id="wds-<?php echo esc_attr( $component ); ?>-frequency-tabs"
22
+ class="wds-frequency-tabs sui-side-tabs sui-tabs"
23
+ >
24
  <div class="sui-tabs-menu">
25
  <?php foreach ( $cron->get_frequencies() as $key => $label ) : ?>
26
  <label class="sui-tab-item <?php echo $key === $frequency ? 'active' : ''; ?>">
27
 
28
  <?php echo esc_html( $label ); ?>
29
+ <input
30
+ name="<?php echo esc_attr( $frequency_radio_name ); ?>"
31
+ value="<?php echo esc_attr( $key ); ?>"
32
+ type="radio" <?php checked( $key, $frequency ); ?>
33
+ class="<?php echo esc_attr( $frequency_radio_id ); ?>"
34
  />
35
  </label>
36
  <?php endforeach; ?>
40
  <div class="sui-row">
41
  <div class="sui-col wds-dow weekly">
42
  <div class="sui-form-field">
43
+ <?php
44
+ $this->render_view(
45
+ 'reporting-dow-select',
46
+ array(
47
+ 'component' => $component,
48
+ 'dow_value' => $dow_value,
49
+ )
50
+ );
51
+ ?>
52
  </div>
53
  </div>
54
 
55
  <div class="sui-col wds-dow monthly">
56
  <div class="sui-form-field">
57
+ <?php
58
+ $this->render_view(
59
+ 'reporting-dow-select',
60
+ array(
61
+ 'component' => $component,
62
+ 'dow_value' => $dow_value,
63
+ 'monthly' => true,
64
+ )
65
+ );
66
+ ?>
67
  </div>
68
  </div>
69
 
70
  <div class="sui-col">
71
  <div class="sui-form-field">
72
+ <?php
73
+ $this->render_view(
74
+ 'reporting-tod-select',
75
+ array(
76
+ 'component' => $component,
77
+ 'tod_value' => $tod_value,
78
+ )
79
+ );
80
+ ?>
81
  </div>
82
  </div>
83
  </div>
includes/admin/templates/reporting-tod-select.php CHANGED
@@ -5,25 +5,28 @@ if ( ! $component ) {
5
  }
6
  $tod_value = empty( $tod_value ) ? false : $tod_value;
7
 
8
- $is_member = empty( $_view['is_member'] ) ? false : true;
9
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
10
- $disabled = $is_member ? '' : 'disabled';
11
 
12
  $midnight = strtotime( 'today' );
13
 
14
- $select_id = "wds-{$component}-tod";
15
  $select_name = "{$option_name}[{$component}-tod]";
16
  ?>
17
 
18
- <label for="<?php echo esc_attr( $select_id ); ?>"
19
- class="sui-label"><?php esc_html_e( 'Time of day', 'wds' ); ?></label>
20
-
21
- <select <?php echo esc_attr( $disabled ); ?>
22
- class="sui-select"
23
- id="<?php echo esc_attr( $select_id ); ?>"
24
- data-minimum-results-for-search="-1"
25
- name="<?php echo esc_attr( $select_name ); ?>">
26
 
 
 
 
 
 
 
 
27
  <?php foreach ( range( 0, 23 ) as $tod ) : ?>
28
  <option value="<?php echo esc_attr( $tod ); ?>" <?php selected( $tod, $tod_value ); ?>>
29
  <?php echo esc_html( date_i18n( get_option( 'time_format' ), $midnight + ( $tod * HOUR_IN_SECONDS ) ) ); ?>
5
  }
6
  $tod_value = empty( $tod_value ) ? false : $tod_value;
7
 
8
+ $is_member = ! empty( $_view['is_member'] );
9
  $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
10
+ $disabled = $is_member ? '' : 'disabled';
11
 
12
  $midnight = strtotime( 'today' );
13
 
14
+ $select_id = "wds-{$component}-tod";
15
  $select_name = "{$option_name}[{$component}-tod]";
16
  ?>
17
 
18
+ <label
19
+ for="<?php echo esc_attr( $select_id ); ?>"
20
+ class="sui-label"
21
+ ><?php esc_html_e( 'Time of day', 'wds' ); ?></label>
 
 
 
 
22
 
23
+ <select
24
+ <?php echo esc_attr( $disabled ); ?>
25
+ class="sui-select"
26
+ id="<?php echo esc_attr( $select_id ); ?>"
27
+ data-minimum-results-for-search="-1"
28
+ name="<?php echo esc_attr( $select_name ); ?>"
29
+ >
30
  <?php foreach ( range( 0, 23 ) as $tod ) : ?>
31
  <option value="<?php echo esc_attr( $tod ); ?>" <?php selected( $tod, $tod_value ); ?>>
32
  <?php echo esc_html( date_i18n( get_option( 'time_format' ), $midnight + ( $tod * HOUR_IN_SECONDS ) ) ); ?>
includes/admin/templates/schema/schema-disabled.php CHANGED
@@ -1,11 +1,14 @@
1
  <?php
2
- $this->_render( 'disabled-component', array(
3
- 'content' => sprintf(
4
- '%s<br/>',
5
- esc_html__( 'Quickly add Schema to your pages to help Search Engines understand and show your content better.', 'wds' )
6
- ),
7
- 'image' => 'sitemap-disabled.svg',
8
- 'component' => 'schema',
9
- 'button_text' => esc_html__( 'Activate', 'wds' ),
10
- 'nonce_action' => 'wds-schema-nonce',
11
- ) );
 
 
 
1
  <?php
2
+ $this->render_view(
3
+ 'disabled-component',
4
+ array(
5
+ 'content' => sprintf(
6
+ '%s<br/>',
7
+ esc_html__( 'Quickly add Schema to your pages to help Search Engines understand and show your content better.', 'wds' )
8
+ ),
9
+ 'image' => 'sitemap-disabled.svg',
10
+ 'component' => 'schema',
11
+ 'button_text' => esc_html__( 'Activate', 'wds' ),
12
+ 'nonce_action' => 'wds-schema-nonce',
13
+ )
14
+ );
includes/admin/templates/schema/schema-nav-menus-dropdown-form-field.php CHANGED
@@ -1,8 +1,10 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $schema_main_navigation_menu = empty( $schema_main_navigation_menu ) ? '' : $schema_main_navigation_menu;
4
 
5
  /**
 
 
6
  * @var $nav_menus WP_Term[]
7
  */
8
  $nav_menus = wp_get_nav_menus();
@@ -14,17 +16,18 @@ $nav_menus = wp_get_nav_menus();
14
  </label>
15
  <div class="sui-row">
16
  <div class="sui-col-md-6">
17
- <select id="schema_main_navigation_menu"
18
- name="<?php echo esc_attr( "{$option_name}[schema_main_navigation_menu]" ); ?>"
19
- class="sui-select"
20
- data-allow-clear="0"
21
- data-minimum-results-for-search="-1">
22
-
 
23
  <option value=""><?php esc_html_e( 'Select a Menu', 'wds' ); ?></option>
24
 
25
- <?php foreach ( $nav_menus as $nav_menu ): ?>
26
- <option <?php selected( $schema_main_navigation_menu, $nav_menu->slug ) ?>
27
- value="<?php echo esc_attr( $nav_menu->slug ); ?>">
28
  <?php echo esc_html( $nav_menu->name ); ?>
29
  </option>
30
  <?php endforeach; ?>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $schema_main_navigation_menu = empty( $schema_main_navigation_menu ) ? '' : $schema_main_navigation_menu;
4
 
5
  /**
6
+ * Term.
7
+ *
8
  * @var $nav_menus WP_Term[]
9
  */
10
  $nav_menus = wp_get_nav_menus();
16
  </label>
17
  <div class="sui-row">
18
  <div class="sui-col-md-6">
19
+ <select
20
+ id="schema_main_navigation_menu"
21
+ name="<?php echo esc_attr( "{$option_name}[schema_main_navigation_menu]" ); ?>"
22
+ class="sui-select"
23
+ data-allow-clear="0"
24
+ data-minimum-results-for-search="-1"
25
+ >
26
  <option value=""><?php esc_html_e( 'Select a Menu', 'wds' ); ?></option>
27
 
28
+ <?php foreach ( $nav_menus as $nav_menu ) : ?>
29
+ <option <?php selected( $schema_main_navigation_menu, $nav_menu->slug ); ?>
30
+ value="<?php echo esc_attr( $nav_menu->slug ); ?>">
31
  <?php echo esc_html( $nav_menu->name ); ?>
32
  </option>
33
  <?php endforeach; ?>
includes/admin/templates/schema/schema-organization-settings.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
- $pages = empty( $pages ) ? array() : $pages;
6
 
7
- $organization_type = (string) smartcrawl_get_array_value( $options, 'organization_type' );
8
- $organization_name = (string) smartcrawl_get_array_value( $social_options, 'organization_name' );
9
- $organization_description = (string) smartcrawl_get_array_value( $options, 'organization_description' );
10
- $organization_logo = (string) smartcrawl_get_array_value( $social_options, 'organization_logo' );
11
  $organization_contact_type = (string) smartcrawl_get_array_value( $options, 'organization_contact_type' );
12
  $organization_phone_number = (string) smartcrawl_get_array_value( $options, 'organization_phone_number' );
13
  $organization_contact_page = (string) smartcrawl_get_array_value( $options, 'organization_contact_page' );
@@ -15,31 +15,39 @@ $organization_contact_page = (string) smartcrawl_get_array_value( $options, 'org
15
  ?>
16
  <p class="sui-description"><?php esc_html_e( 'Fill out your organization details.', 'wds' ); ?></p>
17
 
18
- <?php $this->_render( 'schema/schema-organization-types-dropdown', array(
19
- 'organization_type' => $organization_type,
20
- ) ); ?>
 
 
 
 
 
21
 
22
  <div class="sui-form-field">
23
  <label for="organization_name" class="sui-label">
24
  <?php esc_html_e( 'Organization name', 'wds' ); ?>
25
  </label>
26
- <input id="organization_name"
27
- class="sui-form-control"
28
- type="text"
29
- name="<?php echo esc_attr( $option_name ); ?>[organization_name]"
30
- placeholder="<?php echo get_bloginfo( 'name' ); ?>"
31
- value="<?php echo esc_attr( $organization_name ); ?>"/>
 
 
32
  </div>
33
 
34
  <div class="sui-form-field">
35
  <label for="organization_description" class="sui-label">
36
  <?php esc_html_e( 'Description', 'wds' ); ?>
37
  </label>
38
- <textarea id="organization_description"
39
- class="sui-form-control"
40
- type="text"
41
- placeholder="<?php echo get_bloginfo( 'description' ); ?>"
42
- name="<?php echo esc_attr( $option_name ); ?>[organization_description]"
 
43
  ><?php echo esc_textarea( $organization_description ); ?></textarea>
44
  </div>
45
 
@@ -49,11 +57,14 @@ $organization_contact_page = (string) smartcrawl_get_array_value( $options, 'org
49
  </label>
50
 
51
  <?php
52
- $this->_render( 'media-item-selector', array(
53
- 'id' => 'organization_logo',
54
- 'value' => $organization_logo,
55
- 'field' => 'url',
56
- ) );
 
 
 
57
  ?>
58
  <p class="sui-description">
59
  <?php esc_html_e( 'Specify the image of your organization’s logo to be used in Google Search results and in the Knowledge Graph.', 'wds' ); ?>
@@ -71,14 +82,17 @@ $organization_contact_page = (string) smartcrawl_get_array_value( $options, 'org
71
  <?php esc_html_e( 'Contact type', 'wds' ); ?>
72
  </label>
73
 
74
- <select id="organization_contact_type"
75
- name="<?php echo esc_attr( $option_name ); ?>[organization_contact_type]"
76
- data-minimum-results-for-search="-1"
77
- class="sui-select">
 
 
78
  <option value="" <?php selected( empty( $organization_contact_type ) ); ?>>
79
  <?php esc_html_e( 'Select (Optional)', 'wds' ); ?>
80
  </option>
81
- <?php foreach (
 
82
  array(
83
  'customer support' => 'Customer Support',
84
  'technical support' => 'Technical Support',
@@ -92,7 +106,8 @@ $organization_contact_page = (string) smartcrawl_get_array_value( $options, 'org
92
  'roadside assistance' => 'Roadside Assistance',
93
  'package tracking' => 'Package Tracking',
94
  ) as $org_contact_value => $org_contact_label
95
- ): ?>
 
96
  <option value="<?php echo esc_attr( $org_contact_value ); ?>" <?php selected( $organization_contact_type, $org_contact_value ); ?>>
97
  <?php echo esc_html( $org_contact_label ); ?>
98
  </option>
@@ -104,20 +119,27 @@ $organization_contact_page = (string) smartcrawl_get_array_value( $options, 'org
104
  <label for="organization_phone_number" class="sui-label">
105
  <?php esc_html_e( 'Phone Number', 'wds' ); ?>
106
  </label>
107
- <input id="organization_phone_number"
108
- class="sui-form-control"
109
- type="text"
110
- placeholder="E.g. +1 987 654 321"
111
- name="<?php echo esc_attr( $option_name ); ?>[organization_phone_number]"
112
- value="<?php echo esc_attr( $organization_phone_number ); ?>"/>
 
 
113
  </div>
114
 
115
- <?php $this->_render( 'post-search-dropdown-form-field', array(
116
- 'field_name' => 'organization_contact_page',
117
- 'field_label' => esc_html__( 'Contact page', 'wds' ),
118
- 'first_option' => esc_html__( 'Select Page', 'wds' ),
119
- 'post_type' => 'page',
120
- 'selected_post_id' => $organization_contact_page,
121
- 'pages' => $pages,
122
- ) ); ?>
 
 
 
 
 
123
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
+ $pages = empty( $pages ) ? array() : $pages; // phpcs:ignore
6
 
7
+ $organization_type = (string) smartcrawl_get_array_value( $options, 'organization_type' );
8
+ $organization_name = (string) smartcrawl_get_array_value( $social_options, 'organization_name' );
9
+ $organization_description = (string) smartcrawl_get_array_value( $options, 'organization_description' );
10
+ $organization_logo = (string) smartcrawl_get_array_value( $social_options, 'organization_logo' );
11
  $organization_contact_type = (string) smartcrawl_get_array_value( $options, 'organization_contact_type' );
12
  $organization_phone_number = (string) smartcrawl_get_array_value( $options, 'organization_phone_number' );
13
  $organization_contact_page = (string) smartcrawl_get_array_value( $options, 'organization_contact_page' );
15
  ?>
16
  <p class="sui-description"><?php esc_html_e( 'Fill out your organization details.', 'wds' ); ?></p>
17
 
18
+ <?php
19
+ $this->render_view(
20
+ 'schema/schema-organization-types-dropdown',
21
+ array(
22
+ 'organization_type' => $organization_type,
23
+ )
24
+ );
25
+ ?>
26
 
27
  <div class="sui-form-field">
28
  <label for="organization_name" class="sui-label">
29
  <?php esc_html_e( 'Organization name', 'wds' ); ?>
30
  </label>
31
+ <input
32
+ id="organization_name"
33
+ class="sui-form-control"
34
+ type="text"
35
+ name="<?php echo esc_attr( $option_name ); ?>[organization_name]"
36
+ placeholder="<?php echo get_bloginfo( 'name' ); // phpcs:ignore ?>"
37
+ value="<?php echo esc_attr( $organization_name ); ?>"
38
+ />
39
  </div>
40
 
41
  <div class="sui-form-field">
42
  <label for="organization_description" class="sui-label">
43
  <?php esc_html_e( 'Description', 'wds' ); ?>
44
  </label>
45
+ <textarea
46
+ id="organization_description"
47
+ class="sui-form-control"
48
+ type="text"
49
+ placeholder="<?php echo get_bloginfo( 'description' ); // phpcs:ignore ?>"
50
+ name="<?php echo esc_attr( $option_name ); ?>[organization_description]"
51
  ><?php echo esc_textarea( $organization_description ); ?></textarea>
52
  </div>
53
 
57
  </label>
58
 
59
  <?php
60
+ $this->render_view(
61
+ 'media-item-selector',
62
+ array(
63
+ 'id' => 'organization_logo',
64
+ 'value' => $organization_logo,
65
+ 'field' => 'url',
66
+ )
67
+ );
68
  ?>
69
  <p class="sui-description">
70
  <?php esc_html_e( 'Specify the image of your organization’s logo to be used in Google Search results and in the Knowledge Graph.', 'wds' ); ?>
82
  <?php esc_html_e( 'Contact type', 'wds' ); ?>
83
  </label>
84
 
85
+ <select
86
+ id="organization_contact_type"
87
+ name="<?php echo esc_attr( $option_name ); ?>[organization_contact_type]"
88
+ data-minimum-results-for-search="-1"
89
+ class="sui-select"
90
+ >
91
  <option value="" <?php selected( empty( $organization_contact_type ) ); ?>>
92
  <?php esc_html_e( 'Select (Optional)', 'wds' ); ?>
93
  </option>
94
+ <?php
95
+ foreach (
96
  array(
97
  'customer support' => 'Customer Support',
98
  'technical support' => 'Technical Support',
106
  'roadside assistance' => 'Roadside Assistance',
107
  'package tracking' => 'Package Tracking',
108
  ) as $org_contact_value => $org_contact_label
109
+ ) :
110
+ ?>
111
  <option value="<?php echo esc_attr( $org_contact_value ); ?>" <?php selected( $organization_contact_type, $org_contact_value ); ?>>
112
  <?php echo esc_html( $org_contact_label ); ?>
113
  </option>
119
  <label for="organization_phone_number" class="sui-label">
120
  <?php esc_html_e( 'Phone Number', 'wds' ); ?>
121
  </label>
122
+ <input
123
+ id="organization_phone_number"
124
+ class="sui-form-control"
125
+ type="text"
126
+ placeholder="E.g. +1 987 654 321"
127
+ name="<?php echo esc_attr( $option_name ); ?>[organization_phone_number]"
128
+ value="<?php echo esc_attr( $organization_phone_number ); ?>"
129
+ />
130
  </div>
131
 
132
+ <?php
133
+ $this->render_view(
134
+ 'post-search-dropdown-form-field',
135
+ array(
136
+ 'field_name' => 'organization_contact_page',
137
+ 'field_label' => esc_html__( 'Contact page', 'wds' ),
138
+ 'first_option' => esc_html__( 'Select Page', 'wds' ),
139
+ 'post_type' => 'page',
140
+ 'selected_post_id' => $organization_contact_page,
141
+ 'pages' => $pages,
142
+ )
143
+ );
144
+ ?>
145
  </div>
includes/admin/templates/schema/schema-organization-types-dropdown.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $organization_type = empty( $organization_type ) ? '' : $organization_type;
4
  ?>
5
 
@@ -8,13 +8,15 @@ $organization_type = empty( $organization_type ) ? '' : $organization_type;
8
  <?php esc_html_e( 'Organization type', 'wds' ); ?>
9
  </label>
10
 
11
- <select id="organization_type"
12
- name="<?php echo esc_attr( $option_name ); ?>[organization_type]"
13
- data-minimum-results-for-search="-1"
14
- class="sui-select">
 
 
15
  <option value=""><?php esc_html_e( 'Select (Optional)', 'wds' ); ?></option>
16
-
17
- <?php foreach (
18
  array(
19
  Smartcrawl_Schema_Type_Constants::ORGANIZATION_AIRLINE => 'Airline',
20
  Smartcrawl_Schema_Type_Constants::ORGANIZATION_CONSORTIUM => 'Consortium',
@@ -31,9 +33,12 @@ $organization_type = empty( $organization_type ) ? '' : $organization_type;
31
  Smartcrawl_Schema_Type_Constants::ORGANIZATION_SPORTS => 'Sports',
32
  Smartcrawl_Schema_Type_Constants::ORGANIZATION_WORKERS_UNION => 'Workers Union',
33
  ) as $org_type_value => $org_type_label
34
- ): ?>
35
- <option <?php selected( $org_type_value, $organization_type ); ?>
36
- value="<?php echo esc_attr( $org_type_value ); ?>">
 
 
 
37
  <?php echo esc_html( $org_type_label ); ?>
38
  </option>
39
  <?php endforeach; ?>
@@ -43,10 +48,12 @@ $organization_type = empty( $organization_type ) ? '' : $organization_type;
43
  <?php esc_html_e( 'Choose the type that best describes your organization website.', 'wds' ); ?>
44
  </p>
45
  <p class="sui-description">
46
- <?php echo smartcrawl_format_link(
 
47
  esc_html__( 'Note: If you want to add Local Business markup, you can do it by adding a “Local Business” type in the %s.', 'wds' ),
48
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SCHEMA ) . '&tab=tab_types',
49
  esc_html__( 'Types Builder', 'wds' )
50
- ); ?>
 
51
  </p>
52
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $organization_type = empty( $organization_type ) ? '' : $organization_type;
4
  ?>
5
 
8
  <?php esc_html_e( 'Organization type', 'wds' ); ?>
9
  </label>
10
 
11
+ <select
12
+ id="organization_type"
13
+ name="<?php echo esc_attr( $option_name ); ?>[organization_type]"
14
+ data-minimum-results-for-search="-1"
15
+ class="sui-select"
16
+ >
17
  <option value=""><?php esc_html_e( 'Select (Optional)', 'wds' ); ?></option>
18
+ <?php
19
+ foreach (
20
  array(
21
  Smartcrawl_Schema_Type_Constants::ORGANIZATION_AIRLINE => 'Airline',
22
  Smartcrawl_Schema_Type_Constants::ORGANIZATION_CONSORTIUM => 'Consortium',
33
  Smartcrawl_Schema_Type_Constants::ORGANIZATION_SPORTS => 'Sports',
34
  Smartcrawl_Schema_Type_Constants::ORGANIZATION_WORKERS_UNION => 'Workers Union',
35
  ) as $org_type_value => $org_type_label
36
+ ) :
37
+ ?>
38
+ <option
39
+ <?php selected( $org_type_value, $organization_type ); ?>
40
+ value="<?php echo esc_attr( $org_type_value ); ?>"
41
+ >
42
  <?php echo esc_html( $org_type_label ); ?>
43
  </option>
44
  <?php endforeach; ?>
48
  <?php esc_html_e( 'Choose the type that best describes your organization website.', 'wds' ); ?>
49
  </p>
50
  <p class="sui-description">
51
+ <?php
52
+ echo smartcrawl_format_link( // phpcs:ignore
53
  esc_html__( 'Note: If you want to add Local Business markup, you can do it by adding a “Local Business” type in the %s.', 'wds' ),
54
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SCHEMA ) . '&tab=tab_types',
55
  esc_html__( 'Types Builder', 'wds' )
56
+ );
57
+ ?>
58
  </p>
59
  </div>
includes/admin/templates/schema/schema-person-settings.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
- $pages = empty( $pages ) ? array() : $pages;
6
 
7
- $person_name = (string) smartcrawl_get_array_value( $social_options, 'override_name' );
8
- $person_job_title = (string) smartcrawl_get_array_value( $options, 'person_job_title' );
9
- $person_bio = (string) smartcrawl_get_array_value( $options, 'person_bio' );
10
- $person_portrait = (string) smartcrawl_get_array_value( $options, 'person_portrait' );
11
  $person_phone_number = (string) smartcrawl_get_array_value( $options, 'person_phone_number' );
12
- $person_brand_name = (string) smartcrawl_get_array_value( $options, 'person_brand_name' );
13
- $person_brand_logo = (string) smartcrawl_get_array_value( $options, 'person_brand_logo' );
14
  $person_contact_page = (string) smartcrawl_get_array_value( $options, 'person_contact_page' );
15
 
16
  $owner = Smartcrawl_Model_User::owner();
@@ -22,35 +22,40 @@ $owner = Smartcrawl_Model_User::owner();
22
  <label for="person_name" class="sui-label">
23
  <?php esc_html_e( 'Name', 'wds' ); ?>
24
  </label>
25
- <input id="person_name"
26
- class="sui-form-control"
27
- type="text"
28
- name="<?php echo esc_attr( $option_name ); ?>[override_name]"
29
- placeholder="<?php echo $owner->get_full_name(); ?>"
30
- value="<?php echo esc_attr( $person_name ); ?>"/>
 
 
31
  </div>
32
 
33
  <div class="sui-form-field">
34
  <label for="person_job_title" class="sui-label">
35
  <?php esc_html_e( 'Job title', 'wds' ); ?>
36
  </label>
37
- <input id="person_job_title"
38
- class="sui-form-control"
39
- type="text"
40
- name="<?php echo esc_attr( $option_name ); ?>[person_job_title]"
41
- value="<?php echo esc_attr( $person_job_title ); ?>"
42
- placeholder="<?php esc_attr_e( 'E.g. architect', 'wds' ); ?>"/>
 
 
43
  </div>
44
 
45
  <div class="sui-form-field">
46
  <label for="person_bio" class="sui-label">
47
  <?php esc_html_e( 'Bio', 'wds' ); ?>
48
  </label>
49
- <textarea id="person_bio"
50
- class="sui-form-control"
51
- type="text"
52
- name="<?php echo esc_attr( $option_name ); ?>[person_bio]"
53
- placeholder="<?php echo $owner->get_description(); ?>"
 
54
  ><?php echo esc_textarea( $person_bio ); ?></textarea>
55
  </div>
56
 
@@ -60,11 +65,14 @@ $owner = Smartcrawl_Model_User::owner();
60
  </label>
61
 
62
  <?php
63
- $this->_render( 'media-item-selector', array(
64
- 'id' => 'person_portrait',
65
- 'value' => $person_portrait,
66
- 'field' => 'id',
67
- ) );
 
 
 
68
  ?>
69
  </div>
70
 
@@ -78,12 +86,14 @@ $owner = Smartcrawl_Model_User::owner();
78
  <label for="person_brand_name" class="sui-label">
79
  <?php esc_html_e( 'Brand Name', 'wds' ); ?>
80
  </label>
81
- <input id="person_brand_name"
82
- class="sui-form-control"
83
- type="text"
84
- placeholder="<?php echo $owner->get_full_name(); ?>"
85
- name="<?php echo esc_attr( $option_name ); ?>[person_brand_name]"
86
- value="<?php echo esc_attr( $person_brand_name ); ?>"/>
 
 
87
  <span class="sui-description">
88
  <?php esc_html_e( 'In case your Brand name is different from your own name.', 'wds' ); ?>
89
  </span>
@@ -94,11 +104,16 @@ $owner = Smartcrawl_Model_User::owner();
94
  <?php esc_html_e( 'Logo', 'wds' ); ?>
95
  </label>
96
 
97
- <?php $this->_render( 'media-item-selector', array(
98
- 'id' => 'person_brand_logo',
99
- 'value' => $person_brand_logo,
100
- 'field' => 'id',
101
- ) ); ?>
 
 
 
 
 
102
 
103
  <p class="sui-description">
104
  <?php esc_html_e( 'Specify the image of your Brand’s logo to be used in Google Search results and in the Knowledge Graph.', 'wds' ); ?>
@@ -116,20 +131,27 @@ $owner = Smartcrawl_Model_User::owner();
116
  <label for="person_phone_number" class="sui-label">
117
  <?php esc_html_e( 'Phone Number', 'wds' ); ?>
118
  </label>
119
- <input id="person_phone_number"
120
- class="sui-form-control"
121
- type="text"
122
- placeholder="E.g. +1 987 654 321"
123
- name="<?php echo esc_attr( $option_name ); ?>[person_phone_number]"
124
- value="<?php echo esc_attr( $person_phone_number ); ?>"/>
 
 
125
  </div>
126
 
127
- <?php $this->_render( 'post-search-dropdown-form-field', array(
128
- 'field_name' => 'person_contact_page',
129
- 'field_label' => esc_html__( 'Contact page', 'wds' ),
130
- 'first_option' => esc_html__( 'Select Page', 'wds' ),
131
- 'post_type' => 'page',
132
- 'selected_post_id' => $person_contact_page,
133
- 'pages' => $pages,
134
- ) ); ?>
 
 
 
 
 
135
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
+ $pages = empty( $pages ) ? array() : $pages; // phpcs:ignore
6
 
7
+ $person_name = (string) smartcrawl_get_array_value( $social_options, 'override_name' );
8
+ $person_job_title = (string) smartcrawl_get_array_value( $options, 'person_job_title' );
9
+ $person_bio = (string) smartcrawl_get_array_value( $options, 'person_bio' );
10
+ $person_portrait = (string) smartcrawl_get_array_value( $options, 'person_portrait' );
11
  $person_phone_number = (string) smartcrawl_get_array_value( $options, 'person_phone_number' );
12
+ $person_brand_name = (string) smartcrawl_get_array_value( $options, 'person_brand_name' );
13
+ $person_brand_logo = (string) smartcrawl_get_array_value( $options, 'person_brand_logo' );
14
  $person_contact_page = (string) smartcrawl_get_array_value( $options, 'person_contact_page' );
15
 
16
  $owner = Smartcrawl_Model_User::owner();
22
  <label for="person_name" class="sui-label">
23
  <?php esc_html_e( 'Name', 'wds' ); ?>
24
  </label>
25
+ <input
26
+ id="person_name"
27
+ class="sui-form-control"
28
+ type="text"
29
+ name="<?php echo esc_attr( $option_name ); ?>[override_name]"
30
+ placeholder="<?php echo esc_html( $owner->get_full_name() ); ?>"
31
+ value="<?php echo esc_attr( $person_name ); ?>"
32
+ />
33
  </div>
34
 
35
  <div class="sui-form-field">
36
  <label for="person_job_title" class="sui-label">
37
  <?php esc_html_e( 'Job title', 'wds' ); ?>
38
  </label>
39
+ <input
40
+ id="person_job_title"
41
+ class="sui-form-control"
42
+ type="text"
43
+ name="<?php echo esc_attr( $option_name ); ?>[person_job_title]"
44
+ value="<?php echo esc_attr( $person_job_title ); ?>"
45
+ placeholder="<?php esc_attr_e( 'E.g. architect', 'wds' ); ?>"
46
+ />
47
  </div>
48
 
49
  <div class="sui-form-field">
50
  <label for="person_bio" class="sui-label">
51
  <?php esc_html_e( 'Bio', 'wds' ); ?>
52
  </label>
53
+ <textarea
54
+ id="person_bio"
55
+ class="sui-form-control"
56
+ type="text"
57
+ name="<?php echo esc_attr( $option_name ); ?>[person_bio]"
58
+ placeholder="<?php echo $owner->get_description(); // phpcs:ignore ?>"
59
  ><?php echo esc_textarea( $person_bio ); ?></textarea>
60
  </div>
61
 
65
  </label>
66
 
67
  <?php
68
+ $this->render_view(
69
+ 'media-item-selector',
70
+ array(
71
+ 'id' => 'person_portrait',
72
+ 'value' => $person_portrait,
73
+ 'field' => 'id',
74
+ )
75
+ );
76
  ?>
77
  </div>
78
 
86
  <label for="person_brand_name" class="sui-label">
87
  <?php esc_html_e( 'Brand Name', 'wds' ); ?>
88
  </label>
89
+ <input
90
+ id="person_brand_name"
91
+ class="sui-form-control"
92
+ type="text"
93
+ placeholder="<?php echo esc_html( $owner->get_full_name() ); ?>"
94
+ name="<?php echo esc_attr( $option_name ); ?>[person_brand_name]"
95
+ value="<?php echo esc_attr( $person_brand_name ); ?>"
96
+ />
97
  <span class="sui-description">
98
  <?php esc_html_e( 'In case your Brand name is different from your own name.', 'wds' ); ?>
99
  </span>
104
  <?php esc_html_e( 'Logo', 'wds' ); ?>
105
  </label>
106
 
107
+ <?php
108
+ $this->render_view(
109
+ 'media-item-selector',
110
+ array(
111
+ 'id' => 'person_brand_logo',
112
+ 'value' => $person_brand_logo,
113
+ 'field' => 'id',
114
+ )
115
+ );
116
+ ?>
117
 
118
  <p class="sui-description">
119
  <?php esc_html_e( 'Specify the image of your Brand’s logo to be used in Google Search results and in the Knowledge Graph.', 'wds' ); ?>
131
  <label for="person_phone_number" class="sui-label">
132
  <?php esc_html_e( 'Phone Number', 'wds' ); ?>
133
  </label>
134
+ <input
135
+ id="person_phone_number"
136
+ class="sui-form-control"
137
+ type="text"
138
+ placeholder="E.g. +1 987 654 321"
139
+ name="<?php echo esc_attr( $option_name ); ?>[person_phone_number]"
140
+ value="<?php echo esc_attr( $person_phone_number ); ?>"
141
+ />
142
  </div>
143
 
144
+ <?php
145
+ $this->render_view(
146
+ 'post-search-dropdown-form-field',
147
+ array(
148
+ 'field_name' => 'person_contact_page',
149
+ 'field_label' => esc_html__( 'Contact page', 'wds' ),
150
+ 'first_option' => esc_html__( 'Select Page', 'wds' ),
151
+ 'post_type' => 'page',
152
+ 'selected_post_id' => $person_contact_page,
153
+ 'pages' => $pages,
154
+ )
155
+ );
156
+ ?>
157
  </div>
includes/admin/templates/schema/schema-section-advanced.php CHANGED
@@ -1,30 +1,30 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
- $pages = empty( $pages ) ? array() : $pages;
6
 
7
- $schema_about_page = (int) smartcrawl_get_array_value( $options, 'schema_about_page' );
8
- $schema_contact_page = (int) smartcrawl_get_array_value( $options, 'schema_contact_page' );
9
  $schema_main_navigation_menu = (string) smartcrawl_get_array_value( $options, 'schema_main_navigation_menu' );
10
- $schema_wp_header_footer = (bool) smartcrawl_get_array_value( $options, 'schema_wp_header_footer' );
11
- $schema_enable_comments = (bool) smartcrawl_get_array_value( $options, 'schema_enable_comments' );
12
- $schema_default_image = (int) smartcrawl_get_array_value( $options, 'schema_default_image' );
13
 
14
- $schema_enable_author_url = (bool) smartcrawl_get_array_value( $options, 'schema_enable_author_url' );
15
- $schema_enable_author_gravatar = (bool) smartcrawl_get_array_value( $options, 'schema_enable_author_gravatar' );
16
  $schema_archive_main_entity_type = (string) smartcrawl_get_array_value( $options, 'schema_archive_main_entity_type' );
17
 
18
- $schema_enable_author_archives = (bool) smartcrawl_get_array_value( $options, 'schema_enable_author_archives' );
19
- $schema_enable_search = (string) smartcrawl_get_array_value( $options, 'schema_enable_search' );
20
- $schema_enable_date_archives = (string) smartcrawl_get_array_value( $options, 'schema_enable_date_archives' );
21
  $schema_enable_post_type_archives = (string) smartcrawl_get_array_value( $options, 'schema_enable_post_type_archives' );
22
- $schema_enable_taxonomy_archives = (string) smartcrawl_get_array_value( $options, 'schema_enable_taxonomy_archives' );
23
 
24
- $schema_enable_audio = (bool) smartcrawl_get_array_value( $options, 'schema_enable_audio' );
25
- $schema_enable_video = (bool) smartcrawl_get_array_value( $options, 'schema_enable_video' );
26
  $schema_enable_yt_api = (bool) smartcrawl_get_array_value( $options, 'schema_enable_yt_api' );
27
- $schema_yt_api_key = (string) smartcrawl_get_array_value( $options, 'schema_yt_api_key' );
28
 
29
  $post_types = empty( $post_types ) ? array() : $post_types;
30
  $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
@@ -36,32 +36,42 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
36
  <?php esc_html_e( 'Special Pages', 'wds' ); ?>
37
  </label>
38
  <p class="sui-description">
39
- <?php esc_html_e( "Add the structured data of your global schema settings and identify your About Page, Contact Page, and your main navigation menu.", 'wds' ); ?>
40
  </p>
41
  </div>
42
 
43
  <div class="sui-box-settings-col-2">
44
- <?php $this->_render( 'post-search-dropdown-form-field', array(
45
- 'field_name' => 'schema_about_page',
46
- 'field_label' => esc_html__( 'About Page', 'wds' ),
47
- 'field_description' => esc_html__( 'Choose the page that has the most general information about your company or personal brand.', 'wds' ),
48
- 'first_option' => esc_html__( 'Select Page', 'wds' ),
49
- 'selected_post_id' => $schema_about_page,
50
- 'pages' => $pages,
51
- ) );
 
 
 
 
52
 
53
- $this->_render( 'post-search-dropdown-form-field', array(
54
- 'field_name' => 'schema_contact_page',
55
- 'field_label' => esc_html__( 'Contact Page', 'wds' ),
56
- 'field_description' => esc_html__( 'Select the page that contains the best contact information on it.', 'wds' ),
57
- 'first_option' => esc_html__( 'Select Page', 'wds' ),
58
- 'selected_post_id' => $schema_contact_page,
59
- 'pages' => $pages,
60
- ) );
 
 
 
61
 
62
- $this->_render( 'schema/schema-nav-menus-dropdown-form-field', array(
63
- 'schema_main_navigation_menu' => $schema_main_navigation_menu,
64
- ) )
 
 
 
65
  ?>
66
  </div>
67
  </div>
@@ -72,25 +82,31 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
72
  <?php esc_html_e( 'Structured Data', 'wds' ); ?>
73
  </label>
74
  <p class="sui-description">
75
- <?php esc_html_e( "Choose additional schema markup you want to enable for this website.", 'wds' ); ?>
76
  </p>
77
  </div>
78
 
79
  <div class="sui-box-settings-col-2">
80
  <?php
81
- $this->_render( 'toggle-item', array(
82
- 'field_name' => "{$option_name}[schema_wp_header_footer]",
83
- 'item_label' => esc_html__( 'Enable WpHeader and WpFooter', 'wds' ),
84
- 'item_description' => esc_html__( 'Enabling this setting adds markup for the header and footer sections which contain general information about your website. For example: the copyright year, website name, and website tagline.', 'wds' ),
85
- 'checked' => $schema_wp_header_footer,
86
- ) );
 
 
 
87
 
88
- $this->_render( 'toggle-item', array(
89
- 'field_name' => "{$option_name}[schema_enable_comments]",
90
- 'item_label' => esc_html__( 'Enable Comments', 'wds' ),
91
- 'item_description' => esc_html__( 'Enable this setting to include comments in markup. The plugin will add comments that a page has received nested in the output markup using Comment as a value.', 'wds' ),
92
- 'checked' => $schema_enable_comments,
93
- ) );
 
 
 
94
  ?>
95
  </div>
96
  </div>
@@ -101,16 +117,21 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
101
  <?php esc_html_e( 'Default Image', 'wds' ); ?>
102
  </label>
103
  <p class="sui-description">
104
- <?php esc_html_e( "Set a default Featured Image, which will be used if no Featured Image is attached to a post.", 'wds' ); ?>
105
  </p>
106
  </div>
107
 
108
  <div class="sui-box-settings-col-2">
109
- <?php $this->_render( 'media-item-selector', array(
110
- 'id' => 'schema_default_image',
111
- 'value' => $schema_default_image,
112
- 'field' => 'id',
113
- ) ); ?>
 
 
 
 
 
114
 
115
  <p class="sui-description">
116
  <?php esc_html_e( 'Specify a default image to be a fallback for missing Featured Images.', 'wds' ); ?>
@@ -130,20 +151,26 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
130
 
131
  <div class="sui-box-settings-col-2">
132
  <?php
133
- $this->_render( 'toggle-item', array(
134
- 'field_id' => 'schema_enable_author_url',
135
- 'field_name' => "{$option_name}[schema_enable_author_url]",
136
- 'item_label' => esc_html__( 'Enable Author URL', 'wds' ),
137
- 'item_description' => esc_html__( 'Enabling this will add the author page URL in the author markup.', 'wds' ),
138
- 'checked' => $schema_enable_author_url,
139
- ) );
140
- $this->_render( 'toggle-item', array(
141
- 'field_id' => 'schema_enable_author_gravatar',
142
- 'field_name' => "{$option_name}[schema_enable_author_gravatar]",
143
- 'item_label' => esc_html__( 'Enable Gravatar ImageObject ', 'wds' ),
144
- 'item_description' => esc_html__( 'Use gravatar.com image in the author markup.', 'wds' ),
145
- 'checked' => $schema_enable_author_gravatar,
146
- ) );
 
 
 
 
 
 
147
  ?>
148
  </div>
149
  </div>
@@ -164,10 +191,15 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
164
  <tr class="wds-schema-toggleable">
165
  <td><strong><?php esc_html_e( 'Author Archives', 'wds' ); ?></strong></td>
166
  <td>
167
- <?php $this->_render( 'toggle-item', array(
168
- 'checked' => $schema_enable_author_archives,
169
- 'field_name' => "{$option_name}[schema_enable_author_archives]",
170
- ) ); ?>
 
 
 
 
 
171
  </td>
172
  </tr>
173
  <tr style="display: none;"></tr>
@@ -175,10 +207,15 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
175
  <tr class="wds-schema-toggleable">
176
  <td><strong><?php esc_html_e( 'Search Page', 'wds' ); ?></strong></td>
177
  <td>
178
- <?php $this->_render( 'toggle-item', array(
179
- 'checked' => $schema_enable_search,
180
- 'field_name' => "{$option_name}[schema_enable_search]",
181
- ) ); ?>
 
 
 
 
 
182
  </td>
183
  </tr>
184
  <tr style="display: none;"></tr>
@@ -186,10 +223,15 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
186
  <tr class="wds-schema-toggleable">
187
  <td><strong><?php esc_html_e( 'Date Archives', 'wds' ); ?></strong></td>
188
  <td>
189
- <?php $this->_render( 'toggle-item', array(
190
- 'checked' => $schema_enable_date_archives,
191
- 'field_name' => "{$option_name}[schema_enable_date_archives]",
192
- ) ); ?>
 
 
 
 
 
193
  </td>
194
  </tr>
195
  <tr style="display: none;"></tr>
@@ -197,29 +239,39 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
197
  <tr class="wds-schema-toggleable">
198
  <td><strong><?php esc_html_e( 'Post Type Archives', 'wds' ); ?></strong></td>
199
  <td>
200
- <?php $this->_render( 'toggle-item', array(
201
- 'checked' => $schema_enable_post_type_archives,
202
- 'field_name' => "{$option_name}[schema_enable_post_type_archives]",
203
- ) ); ?>
 
 
 
 
 
204
  </td>
205
  </tr>
206
  <tr style="<?php echo $schema_enable_post_type_archives ? '' : 'display:none;'; ?>">
207
- <?php if ( $post_types ): ?>
208
  <td colspan="2">
209
  <table class="sui-table">
210
- <?php foreach ( $post_types as $post_type_name => $post_type_label ): ?>
211
  <tr>
212
  <td><strong><?php echo esc_html( $post_type_label ); ?></strong></td>
213
  <td><?php echo esc_html( $post_type_name ); ?></td>
214
  <td>
215
- <?php $this->_render( 'toggle-item', array(
216
- 'checked' => (bool) smartcrawl_get_array_value(
217
- $options,
218
- array( 'schema_disabled_post_type_archives', $post_type_name )
219
- ),
220
- 'field_name' => "{$option_name}[schema_disabled_post_type_archives][{$post_type_name}]",
221
- 'inverted' => true,
222
- ) ); ?>
 
 
 
 
 
223
  </td>
224
  </tr>
225
  <?php endforeach; ?>
@@ -231,30 +283,37 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
231
  <tr class="wds-schema-toggleable">
232
  <td><strong><?php esc_html_e( 'Taxonomy Archives', 'wds' ); ?></strong></td>
233
  <td>
234
- <?php $this->_render( 'toggle-item', array(
235
- 'checked' => $schema_enable_taxonomy_archives,
236
- 'field_name' => "{$option_name}[schema_enable_taxonomy_archives]",
237
- ) ); ?>
 
 
 
 
 
238
  </td>
239
  </tr>
240
 
241
  <tr style="<?php echo $schema_enable_taxonomy_archives ? '' : 'display:none'; ?>">
242
- <?php if ( $taxonomies ): ?>
243
  <td colspan="2">
244
  <table class="sui-table">
245
- <?php foreach ( $taxonomies as $taxonomy_name => $taxonomy_label ): ?>
246
  <tr>
247
  <td><strong><?php echo esc_html( $taxonomy_label ); ?></strong></td>
248
  <td><?php echo esc_html( $taxonomy_name ); ?></td>
249
  <td>
250
- <?php $this->_render( 'toggle-item', array(
251
- 'checked' => (bool) smartcrawl_get_array_value(
252
- $options,
253
- array( 'schema_disabled_taxonomy_archives', $taxonomy_name )
254
- ),
255
- 'field_name' => "{$option_name}[schema_disabled_taxonomy_archives][{$taxonomy_name}]",
256
- 'inverted' => true,
257
- ) ); ?>
 
 
258
  </td>
259
  </tr>
260
  <?php endforeach; ?>
@@ -271,20 +330,23 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
271
  </label>
272
 
273
  <div class="sui-col-md-6" style="padding: 0">
274
- <select id="schema_archive_main_entity_type"
275
- name="<?php echo esc_attr( "{$option_name}[schema_archive_main_entity_type]" ); ?>"
276
- class="sui-select"
277
- data-allow-clear="0"
278
- data-minimum-results-for-search="-1">
279
-
280
- <?php foreach (
 
 
281
  array(
282
  Smartcrawl_Schema_Type_Constants::TYPE_ITEM_LIST,
283
  'Blog',
284
  ) as $archive_list_type
285
- ): ?>
 
286
  <option <?php selected( $schema_archive_main_entity_type, $archive_list_type ); ?>
287
- value="<?php echo esc_attr( $archive_list_type ); ?>">
288
  <?php echo esc_html( $archive_list_type ); ?>
289
  </option>
290
  <?php endforeach; ?>
@@ -304,31 +366,41 @@ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
304
  <?php esc_html_e( 'Media objects', 'wds' ); ?>
305
  </label>
306
  <p class="sui-description">
307
- <?php esc_html_e( "Make sure that the media you host on your website, such as video or audio, looks attractive and has all the necessary information while being displayed in search engine results.", 'wds' ); ?>
308
  </p>
309
  </div>
310
 
311
  <div class="sui-box-settings-col-2">
312
- <?php $this->_render( 'toggle-item', array(
313
- 'field_id' => 'schema_enable_audio',
314
- 'field_name' => "{$option_name}[schema_enable_audio]",
315
- 'item_label' => esc_html__( 'Enable AudioObject', 'wds' ),
316
- 'item_description' => esc_html__( 'Enable schema.org markup on audio files.', 'wds' ),
317
- 'checked' => $schema_enable_audio,
318
- ) ); ?>
 
 
 
 
 
319
 
320
- <?php $this->_render( 'toggle-item', array(
321
- 'field_id' => 'schema_enable_video',
322
- 'field_name' => "{$option_name}[schema_enable_video]",
323
- 'item_label' => esc_html__( 'Enable VideoObject', 'wds' ),
324
- 'item_description' => esc_html__( 'Enable schema.org markup on video files.', 'wds' ),
325
- 'checked' => $schema_enable_video,
326
- 'sub_settings_template' => 'schema/schema-youtube-api-key',
327
- 'sub_settings_template_args' => array(
328
- 'schema_enable_yt_api' => $schema_enable_yt_api,
329
- 'schema_yt_api_key' => $schema_yt_api_key,
330
- ),
331
- 'sub_settings_border' => false,
332
- ) ); ?>
 
 
 
 
 
333
  </div>
334
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
+ $pages = empty( $pages ) ? array() : $pages; // phpcs:ignore
6
 
7
+ $schema_about_page = (int) smartcrawl_get_array_value( $options, 'schema_about_page' );
8
+ $schema_contact_page = (int) smartcrawl_get_array_value( $options, 'schema_contact_page' );
9
  $schema_main_navigation_menu = (string) smartcrawl_get_array_value( $options, 'schema_main_navigation_menu' );
10
+ $schema_wp_header_footer = (bool) smartcrawl_get_array_value( $options, 'schema_wp_header_footer' );
11
+ $schema_enable_comments = (bool) smartcrawl_get_array_value( $options, 'schema_enable_comments' );
12
+ $schema_default_image = (int) smartcrawl_get_array_value( $options, 'schema_default_image' );
13
 
14
+ $schema_enable_author_url = (bool) smartcrawl_get_array_value( $options, 'schema_enable_author_url' );
15
+ $schema_enable_author_gravatar = (bool) smartcrawl_get_array_value( $options, 'schema_enable_author_gravatar' );
16
  $schema_archive_main_entity_type = (string) smartcrawl_get_array_value( $options, 'schema_archive_main_entity_type' );
17
 
18
+ $schema_enable_author_archives = (bool) smartcrawl_get_array_value( $options, 'schema_enable_author_archives' );
19
+ $schema_enable_search = (string) smartcrawl_get_array_value( $options, 'schema_enable_search' );
20
+ $schema_enable_date_archives = (string) smartcrawl_get_array_value( $options, 'schema_enable_date_archives' );
21
  $schema_enable_post_type_archives = (string) smartcrawl_get_array_value( $options, 'schema_enable_post_type_archives' );
22
+ $schema_enable_taxonomy_archives = (string) smartcrawl_get_array_value( $options, 'schema_enable_taxonomy_archives' );
23
 
24
+ $schema_enable_audio = (bool) smartcrawl_get_array_value( $options, 'schema_enable_audio' );
25
+ $schema_enable_video = (bool) smartcrawl_get_array_value( $options, 'schema_enable_video' );
26
  $schema_enable_yt_api = (bool) smartcrawl_get_array_value( $options, 'schema_enable_yt_api' );
27
+ $schema_yt_api_key = (string) smartcrawl_get_array_value( $options, 'schema_yt_api_key' );
28
 
29
  $post_types = empty( $post_types ) ? array() : $post_types;
30
  $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
36
  <?php esc_html_e( 'Special Pages', 'wds' ); ?>
37
  </label>
38
  <p class="sui-description">
39
+ <?php esc_html_e( 'Add the structured data of your global schema settings and identify your About Page, Contact Page, and your main navigation menu.', 'wds' ); ?>
40
  </p>
41
  </div>
42
 
43
  <div class="sui-box-settings-col-2">
44
+ <?php
45
+ $this->render_view(
46
+ 'post-search-dropdown-form-field',
47
+ array(
48
+ 'field_name' => 'schema_about_page',
49
+ 'field_label' => esc_html__( 'About Page', 'wds' ),
50
+ 'field_description' => esc_html__( 'Choose the page that has the most general information about your company or personal brand.', 'wds' ),
51
+ 'first_option' => esc_html__( 'Select Page', 'wds' ),
52
+ 'selected_post_id' => $schema_about_page,
53
+ 'pages' => $pages,
54
+ )
55
+ );
56
 
57
+ $this->render_view(
58
+ 'post-search-dropdown-form-field',
59
+ array(
60
+ 'field_name' => 'schema_contact_page',
61
+ 'field_label' => esc_html__( 'Contact Page', 'wds' ),
62
+ 'field_description' => esc_html__( 'Select the page that contains the best contact information on it.', 'wds' ),
63
+ 'first_option' => esc_html__( 'Select Page', 'wds' ),
64
+ 'selected_post_id' => $schema_contact_page,
65
+ 'pages' => $pages,
66
+ )
67
+ );
68
 
69
+ $this->render_view(
70
+ 'schema/schema-nav-menus-dropdown-form-field',
71
+ array(
72
+ 'schema_main_navigation_menu' => $schema_main_navigation_menu,
73
+ )
74
+ )
75
  ?>
76
  </div>
77
  </div>
82
  <?php esc_html_e( 'Structured Data', 'wds' ); ?>
83
  </label>
84
  <p class="sui-description">
85
+ <?php esc_html_e( 'Choose additional schema markup you want to enable for this website.', 'wds' ); ?>
86
  </p>
87
  </div>
88
 
89
  <div class="sui-box-settings-col-2">
90
  <?php
91
+ $this->render_view(
92
+ 'toggle-item',
93
+ array(
94
+ 'field_name' => "{$option_name}[schema_wp_header_footer]",
95
+ 'item_label' => esc_html__( 'Enable WpHeader and WpFooter', 'wds' ),
96
+ 'item_description' => esc_html__( 'Enabling this setting adds markup for the header and footer sections which contain general information about your website. For example: the copyright year, website name, and website tagline.', 'wds' ),
97
+ 'checked' => $schema_wp_header_footer,
98
+ )
99
+ );
100
 
101
+ $this->render_view(
102
+ 'toggle-item',
103
+ array(
104
+ 'field_name' => "{$option_name}[schema_enable_comments]",
105
+ 'item_label' => esc_html__( 'Enable Comments', 'wds' ),
106
+ 'item_description' => esc_html__( 'Enable this setting to include comments in markup. The plugin will add comments that a page has received nested in the output markup using Comment as a value.', 'wds' ),
107
+ 'checked' => $schema_enable_comments,
108
+ )
109
+ );
110
  ?>
111
  </div>
112
  </div>
117
  <?php esc_html_e( 'Default Image', 'wds' ); ?>
118
  </label>
119
  <p class="sui-description">
120
+ <?php esc_html_e( 'Set a default Featured Image, which will be used if no Featured Image is attached to a post.', 'wds' ); ?>
121
  </p>
122
  </div>
123
 
124
  <div class="sui-box-settings-col-2">
125
+ <?php
126
+ $this->render_view(
127
+ 'media-item-selector',
128
+ array(
129
+ 'id' => 'schema_default_image',
130
+ 'value' => $schema_default_image,
131
+ 'field' => 'id',
132
+ )
133
+ );
134
+ ?>
135
 
136
  <p class="sui-description">
137
  <?php esc_html_e( 'Specify a default image to be a fallback for missing Featured Images.', 'wds' ); ?>
151
 
152
  <div class="sui-box-settings-col-2">
153
  <?php
154
+ $this->render_view(
155
+ 'toggle-item',
156
+ array(
157
+ 'field_id' => 'schema_enable_author_url',
158
+ 'field_name' => "{$option_name}[schema_enable_author_url]",
159
+ 'item_label' => esc_html__( 'Enable Author URL', 'wds' ),
160
+ 'item_description' => esc_html__( 'Enabling this will add the author page URL in the author markup.', 'wds' ),
161
+ 'checked' => $schema_enable_author_url,
162
+ )
163
+ );
164
+ $this->render_view(
165
+ 'toggle-item',
166
+ array(
167
+ 'field_id' => 'schema_enable_author_gravatar',
168
+ 'field_name' => "{$option_name}[schema_enable_author_gravatar]",
169
+ 'item_label' => esc_html__( 'Enable Gravatar ImageObject ', 'wds' ),
170
+ 'item_description' => esc_html__( 'Use gravatar.com image in the author markup.', 'wds' ),
171
+ 'checked' => $schema_enable_author_gravatar,
172
+ )
173
+ );
174
  ?>
175
  </div>
176
  </div>
191
  <tr class="wds-schema-toggleable">
192
  <td><strong><?php esc_html_e( 'Author Archives', 'wds' ); ?></strong></td>
193
  <td>
194
+ <?php
195
+ $this->render_view(
196
+ 'toggle-item',
197
+ array(
198
+ 'checked' => $schema_enable_author_archives,
199
+ 'field_name' => "{$option_name}[schema_enable_author_archives]",
200
+ )
201
+ );
202
+ ?>
203
  </td>
204
  </tr>
205
  <tr style="display: none;"></tr>
207
  <tr class="wds-schema-toggleable">
208
  <td><strong><?php esc_html_e( 'Search Page', 'wds' ); ?></strong></td>
209
  <td>
210
+ <?php
211
+ $this->render_view(
212
+ 'toggle-item',
213
+ array(
214
+ 'checked' => $schema_enable_search,
215
+ 'field_name' => "{$option_name}[schema_enable_search]",
216
+ )
217
+ );
218
+ ?>
219
  </td>
220
  </tr>
221
  <tr style="display: none;"></tr>
223
  <tr class="wds-schema-toggleable">
224
  <td><strong><?php esc_html_e( 'Date Archives', 'wds' ); ?></strong></td>
225
  <td>
226
+ <?php
227
+ $this->render_view(
228
+ 'toggle-item',
229
+ array(
230
+ 'checked' => $schema_enable_date_archives,
231
+ 'field_name' => "{$option_name}[schema_enable_date_archives]",
232
+ )
233
+ );
234
+ ?>
235
  </td>
236
  </tr>
237
  <tr style="display: none;"></tr>
239
  <tr class="wds-schema-toggleable">
240
  <td><strong><?php esc_html_e( 'Post Type Archives', 'wds' ); ?></strong></td>
241
  <td>
242
+ <?php
243
+ $this->render_view(
244
+ 'toggle-item',
245
+ array(
246
+ 'checked' => $schema_enable_post_type_archives,
247
+ 'field_name' => "{$option_name}[schema_enable_post_type_archives]",
248
+ )
249
+ );
250
+ ?>
251
  </td>
252
  </tr>
253
  <tr style="<?php echo $schema_enable_post_type_archives ? '' : 'display:none;'; ?>">
254
+ <?php if ( $post_types ) : ?>
255
  <td colspan="2">
256
  <table class="sui-table">
257
+ <?php foreach ( $post_types as $post_type_name => $post_type_label ) : ?>
258
  <tr>
259
  <td><strong><?php echo esc_html( $post_type_label ); ?></strong></td>
260
  <td><?php echo esc_html( $post_type_name ); ?></td>
261
  <td>
262
+ <?php
263
+ $this->render_view(
264
+ 'toggle-item',
265
+ array(
266
+ 'checked' => (bool) smartcrawl_get_array_value(
267
+ $options,
268
+ array( 'schema_disabled_post_type_archives', $post_type_name )
269
+ ),
270
+ 'field_name' => "{$option_name}[schema_disabled_post_type_archives][{$post_type_name}]",
271
+ 'inverted' => true,
272
+ )
273
+ );
274
+ ?>
275
  </td>
276
  </tr>
277
  <?php endforeach; ?>
283
  <tr class="wds-schema-toggleable">
284
  <td><strong><?php esc_html_e( 'Taxonomy Archives', 'wds' ); ?></strong></td>
285
  <td>
286
+ <?php
287
+ $this->render_view(
288
+ 'toggle-item',
289
+ array(
290
+ 'checked' => $schema_enable_taxonomy_archives,
291
+ 'field_name' => "{$option_name}[schema_enable_taxonomy_archives]",
292
+ )
293
+ );
294
+ ?>
295
  </td>
296
  </tr>
297
 
298
  <tr style="<?php echo $schema_enable_taxonomy_archives ? '' : 'display:none'; ?>">
299
+ <?php if ( $taxonomies ) : ?>
300
  <td colspan="2">
301
  <table class="sui-table">
302
+ <?php foreach ( $taxonomies as $taxonomy_name => $taxonomy_label ) : ?>
303
  <tr>
304
  <td><strong><?php echo esc_html( $taxonomy_label ); ?></strong></td>
305
  <td><?php echo esc_html( $taxonomy_name ); ?></td>
306
  <td>
307
+ <?php
308
+ $this->render_view(
309
+ 'toggle-item',
310
+ array(
311
+ 'checked' => (bool) smartcrawl_get_array_value( $options, array( 'schema_disabled_taxonomy_archives', $taxonomy_name ) ),
312
+ 'field_name' => "{$option_name}[schema_disabled_taxonomy_archives][{$taxonomy_name}]",
313
+ 'inverted' => true,
314
+ )
315
+ );
316
+ ?>
317
  </td>
318
  </tr>
319
  <?php endforeach; ?>
330
  </label>
331
 
332
  <div class="sui-col-md-6" style="padding: 0">
333
+ <select
334
+ id="schema_archive_main_entity_type"
335
+ name="<?php echo esc_attr( "{$option_name}[schema_archive_main_entity_type]" ); ?>"
336
+ class="sui-select"
337
+ data-allow-clear="0"
338
+ data-minimum-results-for-search="-1"
339
+ >
340
+ <?php
341
+ foreach (
342
  array(
343
  Smartcrawl_Schema_Type_Constants::TYPE_ITEM_LIST,
344
  'Blog',
345
  ) as $archive_list_type
346
+ ) :
347
+ ?>
348
  <option <?php selected( $schema_archive_main_entity_type, $archive_list_type ); ?>
349
+ value="<?php echo esc_attr( $archive_list_type ); ?>">
350
  <?php echo esc_html( $archive_list_type ); ?>
351
  </option>
352
  <?php endforeach; ?>
366
  <?php esc_html_e( 'Media objects', 'wds' ); ?>
367
  </label>
368
  <p class="sui-description">
369
+ <?php esc_html_e( 'Make sure that the media you host on your website, such as video or audio, looks attractive and has all the necessary information while being displayed in search engine results.', 'wds' ); ?>
370
  </p>
371
  </div>
372
 
373
  <div class="sui-box-settings-col-2">
374
+ <?php
375
+ $this->render_view(
376
+ 'toggle-item',
377
+ array(
378
+ 'field_id' => 'schema_enable_audio',
379
+ 'field_name' => "{$option_name}[schema_enable_audio]",
380
+ 'item_label' => esc_html__( 'Enable AudioObject', 'wds' ),
381
+ 'item_description' => esc_html__( 'Enable schema.org markup on audio files.', 'wds' ),
382
+ 'checked' => $schema_enable_audio,
383
+ )
384
+ );
385
+ ?>
386
 
387
+ <?php
388
+ $this->render_view(
389
+ 'toggle-item',
390
+ array(
391
+ 'field_id' => 'schema_enable_video',
392
+ 'field_name' => "{$option_name}[schema_enable_video]",
393
+ 'item_label' => esc_html__( 'Enable VideoObject', 'wds' ),
394
+ 'item_description' => esc_html__( 'Enable schema.org markup on video files.', 'wds' ),
395
+ 'checked' => $schema_enable_video,
396
+ 'sub_settings_template' => 'schema/schema-youtube-api-key',
397
+ 'sub_settings_template_args' => array(
398
+ 'schema_enable_yt_api' => $schema_enable_yt_api,
399
+ 'schema_yt_api_key' => $schema_yt_api_key,
400
+ ),
401
+ 'sub_settings_border' => false,
402
+ )
403
+ );
404
+ ?>
405
  </div>
406
  </div>
includes/admin/templates/schema/schema-section-general.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
- $pages = empty( $pages ) ? array() : $pages;
6
 
7
- $sitename = (string) smartcrawl_get_array_value( $social_options, 'sitename' );
8
- $schema_website_logo = (string) smartcrawl_get_array_value( $options, 'schema_website_logo' );
9
- $schema_type = (string) smartcrawl_get_array_value( $social_options, 'schema_type' );
10
- $schema_output_page = (int) smartcrawl_get_array_value( $options, 'schema_output_page' );
11
  $sitelinks_search_box = (bool) smartcrawl_get_array_value( $options, 'sitelinks_search_box' );
12
  ?>
13
 
@@ -26,12 +26,14 @@ $sitelinks_search_box = (bool) smartcrawl_get_array_value( $options, 'sitelinks_
26
  <label for="sitename" class="sui-label">
27
  <?php esc_html_e( 'Website Name', 'wds' ); ?>
28
  </label>
29
- <input id="sitename"
30
- class="sui-form-control"
31
- type="text"
32
- name="<?php echo esc_attr( "{$option_name}[sitename]" ); ?>"
33
- value="<?php echo esc_attr( $sitename ); ?>"
34
- placeholder="<?php echo get_bloginfo( 'name' ); ?>">
 
 
35
  <span class="sui-description">
36
  <?php esc_html_e( 'Please add the site name you would like to appear in the schema markup.', 'wds' ); ?>
37
  </span>
@@ -43,11 +45,14 @@ $sitelinks_search_box = (bool) smartcrawl_get_array_value( $options, 'sitelinks_
43
  </label>
44
 
45
  <?php
46
- $this->_render( 'media-item-selector', array(
47
- 'id' => 'schema_website_logo',
48
- 'value' => $schema_website_logo,
49
- 'field' => 'id',
50
- ) );
 
 
 
51
  ?>
52
  <p class="sui-description">
53
  <?php esc_html_e( 'Specify the image of your website’s logo.', 'wds' ); ?>
@@ -69,42 +74,50 @@ $sitelinks_search_box = (bool) smartcrawl_get_array_value( $options, 'sitelinks_
69
  <div class="sui-box-settings-col-2">
70
  <div id="wds-site-type">
71
  <?php
72
- $this->_render( 'side-tabs', array(
73
- 'id' => 'wds-site-type-tabs',
74
- 'name' => "{$option_name}[schema_type]",
75
- 'value' => ! empty( $schema_type ) ? $schema_type : Smartcrawl_Schema_Type_Constants::TYPE_ORGANIZATION,
76
- 'tabs' => array(
77
- array(
78
- 'value' => Smartcrawl_Schema_Type_Constants::TYPE_PERSON,
79
- 'label' => esc_html__( 'Person', 'wds' ),
80
- 'template' => 'schema/schema-person-settings',
81
- 'template_args' => array(
82
- 'options' => $options,
83
- 'social_options' => $social_options,
84
- 'pages' => $pages,
 
 
 
85
  ),
86
- ),
87
- array(
88
- 'value' => Smartcrawl_Schema_Type_Constants::TYPE_ORGANIZATION,
89
- 'label' => esc_html__( 'Organization', 'wds' ),
90
- 'template' => 'schema/schema-organization-settings',
91
- 'template_args' => array(
92
- 'options' => $options,
93
- 'social_options' => $social_options,
94
- 'pages' => $pages,
95
  ),
96
  ),
97
- ),
98
- ) );
99
  ?>
100
  </div>
101
  </div>
102
  </div>
103
 
104
- <?php $this->_render( 'schema/schema-social-accounts', array(
105
- 'options' => $options,
106
- 'social_options' => $social_options,
107
- ) ); ?>
 
 
 
 
 
108
 
109
  <div class="sui-box-settings-row">
110
  <div class="sui-box-settings-col-1">
@@ -112,17 +125,22 @@ $sitelinks_search_box = (bool) smartcrawl_get_array_value( $options, 'sitelinks_
112
  <?php esc_html_e( 'Sitelinks Searchbox', 'wds' ); ?>
113
  </label>
114
  <p class="sui-description">
115
- <?php esc_html_e( "When someone searches for your name or brand name in Google, you can enable a mini search box under the main result for users to search your website directly.", 'wds' ); ?>
116
  </p>
117
  </div>
118
 
119
  <div class="sui-box-settings-col-2">
120
- <?php $this->_render( 'toggle-item', array(
121
- 'field_name' => $option_name . "[sitelinks_search_box]",
122
- 'checked' => $sitelinks_search_box,
123
- 'item_label' => esc_html__( 'Enable Google Sitelinks Searchbox', 'wds' ),
124
- 'item_description' => esc_html__( 'Note: WordPress comes with a search component built-in so we just need to link to it to enable this feature.', 'wds' ),
125
- ) ); ?>
 
 
 
 
 
126
  </div>
127
  </div>
128
 
@@ -137,12 +155,17 @@ $sitelinks_search_box = (bool) smartcrawl_get_array_value( $options, 'sitelinks_
137
  </div>
138
 
139
  <div class="sui-box-settings-col-2">
140
- <?php $this->_render( 'post-search-dropdown-form-field', array(
141
- 'field_name' => 'schema_output_page',
142
- 'field_label' => esc_html__( 'Output Page', 'wds' ),
143
- 'first_option' => esc_html__( 'Homepage', 'wds' ),
144
- 'selected_post_id' => $schema_output_page,
145
- 'pages' => $pages,
146
- ) ); ?>
 
 
 
 
 
147
  </div>
148
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
+ $pages = empty( $pages ) ? array() : $pages; // phpcs:ignore
6
 
7
+ $sitename = (string) smartcrawl_get_array_value( $social_options, 'sitename' );
8
+ $schema_website_logo = (string) smartcrawl_get_array_value( $options, 'schema_website_logo' );
9
+ $schema_type = (string) smartcrawl_get_array_value( $social_options, 'schema_type' );
10
+ $schema_output_page = (int) smartcrawl_get_array_value( $options, 'schema_output_page' );
11
  $sitelinks_search_box = (bool) smartcrawl_get_array_value( $options, 'sitelinks_search_box' );
12
  ?>
13
 
26
  <label for="sitename" class="sui-label">
27
  <?php esc_html_e( 'Website Name', 'wds' ); ?>
28
  </label>
29
+ <input
30
+ id="sitename"
31
+ class="sui-form-control"
32
+ type="text"
33
+ name="<?php echo esc_attr( "{$option_name}[sitename]" ); ?>"
34
+ value="<?php echo esc_attr( $sitename ); ?>"
35
+ placeholder="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>"
36
+ >
37
  <span class="sui-description">
38
  <?php esc_html_e( 'Please add the site name you would like to appear in the schema markup.', 'wds' ); ?>
39
  </span>
45
  </label>
46
 
47
  <?php
48
+ $this->render_view(
49
+ 'media-item-selector',
50
+ array(
51
+ 'id' => 'schema_website_logo',
52
+ 'value' => $schema_website_logo,
53
+ 'field' => 'id',
54
+ )
55
+ );
56
  ?>
57
  <p class="sui-description">
58
  <?php esc_html_e( 'Specify the image of your website’s logo.', 'wds' ); ?>
74
  <div class="sui-box-settings-col-2">
75
  <div id="wds-site-type">
76
  <?php
77
+ $this->render_view(
78
+ 'side-tabs',
79
+ array(
80
+ 'id' => 'wds-site-type-tabs',
81
+ 'name' => "{$option_name}[schema_type]",
82
+ 'value' => ! empty( $schema_type ) ? $schema_type : Smartcrawl_Schema_Type_Constants::TYPE_ORGANIZATION,
83
+ 'tabs' => array(
84
+ array(
85
+ 'value' => Smartcrawl_Schema_Type_Constants::TYPE_PERSON,
86
+ 'label' => esc_html__( 'Person', 'wds' ),
87
+ 'template' => 'schema/schema-person-settings',
88
+ 'template_args' => array(
89
+ 'options' => $options,
90
+ 'social_options' => $social_options,
91
+ 'pages' => $pages,
92
+ ),
93
  ),
94
+ array(
95
+ 'value' => Smartcrawl_Schema_Type_Constants::TYPE_ORGANIZATION,
96
+ 'label' => esc_html__( 'Organization', 'wds' ),
97
+ 'template' => 'schema/schema-organization-settings',
98
+ 'template_args' => array(
99
+ 'options' => $options,
100
+ 'social_options' => $social_options,
101
+ 'pages' => $pages,
102
+ ),
103
  ),
104
  ),
105
+ )
106
+ );
107
  ?>
108
  </div>
109
  </div>
110
  </div>
111
 
112
+ <?php
113
+ $this->render_view(
114
+ 'schema/schema-social-accounts',
115
+ array(
116
+ 'options' => $options,
117
+ 'social_options' => $social_options,
118
+ )
119
+ );
120
+ ?>
121
 
122
  <div class="sui-box-settings-row">
123
  <div class="sui-box-settings-col-1">
125
  <?php esc_html_e( 'Sitelinks Searchbox', 'wds' ); ?>
126
  </label>
127
  <p class="sui-description">
128
+ <?php esc_html_e( 'When someone searches for your name or brand name in Google, you can enable a mini search box under the main result for users to search your website directly.', 'wds' ); ?>
129
  </p>
130
  </div>
131
 
132
  <div class="sui-box-settings-col-2">
133
+ <?php
134
+ $this->render_view(
135
+ 'toggle-item',
136
+ array(
137
+ 'field_name' => $option_name . '[sitelinks_search_box]',
138
+ 'checked' => $sitelinks_search_box,
139
+ 'item_label' => esc_html__( 'Enable Google Sitelinks Searchbox', 'wds' ),
140
+ 'item_description' => esc_html__( 'Note: WordPress comes with a search component built-in so we just need to link to it to enable this feature.', 'wds' ),
141
+ )
142
+ );
143
+ ?>
144
  </div>
145
  </div>
146
 
155
  </div>
156
 
157
  <div class="sui-box-settings-col-2">
158
+ <?php
159
+ $this->render_view(
160
+ 'post-search-dropdown-form-field',
161
+ array(
162
+ 'field_name' => 'schema_output_page',
163
+ 'field_label' => esc_html__( 'Output Page', 'wds' ),
164
+ 'first_option' => esc_html__( 'Homepage', 'wds' ),
165
+ 'selected_post_id' => $schema_output_page,
166
+ 'pages' => $pages,
167
+ )
168
+ );
169
+ ?>
170
  </div>
171
  </div>
includes/admin/templates/schema/schema-section-settings.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
 
6
  $schema_enable_test_button = (bool) smartcrawl_get_array_value( $options, 'schema_enable_test_button' );
@@ -17,12 +17,17 @@ $schema_enable_test_button = (bool) smartcrawl_get_array_value( $options, 'schem
17
  </div>
18
 
19
  <div class="sui-box-settings-col-2">
20
- <?php $this->_render( 'toggle-item', array(
21
- 'field_name' => sprintf( '%s[%s]', $option_name, 'schema_enable_test_button' ),
22
- 'field_id' => 'schema_enable_test_button',
23
- 'checked' => $schema_enable_test_button,
24
- 'item_label' => esc_html__( 'Show Test Schema button in admin bar', 'wds' ),
25
- ) ); ?>
 
 
 
 
 
26
  </div>
27
  </div>
28
 
@@ -38,9 +43,11 @@ $schema_enable_test_button = (bool) smartcrawl_get_array_value( $options, 'schem
38
  </div>
39
 
40
  <div class="sui-box-settings-col-2">
41
- <button type="button"
42
- id="wds-deactivate-schema-component"
43
- class="sui-button sui-button-ghost">
 
 
44
  <span class="sui-icon-power-on-off" aria-hidden="true"></span>
45
 
46
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $options = empty( $options ) ? array() : $options;
4
  $social_options = empty( $social_options ) ? array() : $social_options;
5
 
6
  $schema_enable_test_button = (bool) smartcrawl_get_array_value( $options, 'schema_enable_test_button' );
17
  </div>
18
 
19
  <div class="sui-box-settings-col-2">
20
+ <?php
21
+ $this->render_view(
22
+ 'toggle-item',
23
+ array(
24
+ 'field_name' => sprintf( '%s[%s]', $option_name, 'schema_enable_test_button' ),
25
+ 'field_id' => 'schema_enable_test_button',
26
+ 'checked' => $schema_enable_test_button,
27
+ 'item_label' => esc_html__( 'Show Test Schema button in admin bar', 'wds' ),
28
+ )
29
+ );
30
+ ?>
31
  </div>
32
  </div>
33
 
43
  </div>
44
 
45
  <div class="sui-box-settings-col-2">
46
+ <button
47
+ type="button"
48
+ id="wds-deactivate-schema-component"
49
+ class="sui-button sui-button-ghost"
50
+ >
51
  <span class="sui-icon-power-on-off" aria-hidden="true"></span>
52
 
53
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
includes/admin/templates/schema/schema-settings.php CHANGED
@@ -1,113 +1,142 @@
1
  <?php
2
- $action_url = empty( $_view['action_url'] ) ? '' : $_view['action_url'];
3
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
- $options = empty( $options ) ? array() : $options;
5
- $social_options = empty( $social_options ) ? array() : $social_options;
6
- $active_tab = empty( $active_tab ) ? '' : $active_tab;
7
- $post_types = empty( $post_types ) ? array() : $post_types;
8
- $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
9
- $pages = empty( $pages ) ? array() : $pages;
10
- $schema_disabled = empty( $social_options['disable-schema'] ) ? false : true;
11
 
12
- $this->_render( 'before-page-container' );
13
  ?>
14
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-schema' ); ?>">
15
- <?php $this->_render( 'page-header', array(
16
- 'title' => esc_html__( 'Schema', 'wds' ),
17
- 'documentation_chapter' => 'schema',
18
- 'utm_campaign' => 'smartcrawl_schema_docs',
19
- ) ); ?>
 
 
 
 
 
20
 
21
- <?php $this->_render( 'floating-notices', array(
22
- 'keys' => array(
23
- 'wds-youtube-api-key-valid',
24
- 'wds-schema-types-notice',
25
- 'wds-schema-types-after-addition-notice',
26
- 'wds-schema-types-invalid-notice',
27
- ),
28
- ) ); ?>
 
 
 
 
 
29
 
30
- <?php if ( $schema_disabled ) {
31
- $this->_render( 'schema/schema-disabled' );
32
- } else { ?>
 
 
33
  <form action='<?php echo esc_attr( $action_url ); ?>' method='post' class="wds-form">
34
  <?php $this->settings_fields( $option_name ); ?>
35
 
36
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
37
- <?php $this->_render( 'schema/schema-sidenav', array(
38
- 'active_tab' => $active_tab,
39
- ) ); ?>
 
 
 
 
 
40
 
41
  <?php
42
- $this->_render( 'vertical-tab', array(
43
- 'tab_id' => 'tab_general',
44
- 'tab_name' => esc_html__( 'General', 'wds' ),
45
- 'is_active' => 'tab_general' === $active_tab,
46
- 'tab_sections' => array(
47
- array(
48
- 'section_description' => esc_html__( 'Let search engines know whether you’re an organization or a person, then add all your social profiles so search engines know which social profiles to attribute your web content to.', 'wds' ),
49
- 'section_template' => 'schema/schema-section-general',
50
- 'section_args' => array(
51
- 'options' => $options,
52
- 'social_options' => $social_options,
53
- 'pages' => $pages,
 
 
 
54
  ),
55
  ),
56
- ),
57
- ) );
58
 
59
- $this->_render( 'vertical-tab', array(
60
- 'tab_id' => 'tab_advanced',
61
- 'tab_name' => esc_html__( 'Advanced', 'wds' ),
62
- 'is_active' => 'tab_advanced' === $active_tab,
63
- 'tab_sections' => array(
64
- array(
65
- 'section_description' => esc_html__( 'Choose additional schema markup you want to enable for this website.', 'wds' ),
66
- 'section_template' => 'schema/schema-section-advanced',
67
- 'section_args' => array(
68
- 'options' => $options,
69
- 'social_options' => $social_options,
70
- 'pages' => $pages,
71
- 'post_types' => $post_types,
72
- 'taxonomies' => $taxonomies,
 
 
 
73
  ),
74
  ),
75
- ),
76
- ) );
77
 
78
- $this->_render( 'vertical-tab', array(
79
- 'tab_id' => 'tab_types',
80
- 'tab_name' => esc_html__( 'Types Builder', 'wds' ),
81
- 'is_active' => 'tab_types' === $active_tab,
82
- 'tab_sections' => array(
83
- array(
84
- 'section_description' => esc_html__( 'Choose what post types and taxonomies you want to associate with each available schema type. By default we output general markup on key WordPress pages, but you can enhance and tailor this to your specific needs below.', 'wds' ),
85
- 'section_template' => 'schema/schema-section-types',
86
- 'section_args' => array(),
 
 
 
87
  ),
88
- ),
89
- 'button_text' => false,
90
- ) );
91
 
92
- $this->_render( 'vertical-tab', array(
93
- 'tab_id' => 'tab_settings',
94
- 'tab_name' => esc_html__( 'Settings', 'wds' ),
95
- 'is_active' => 'tab_settings' === $active_tab,
96
- 'tab_sections' => array(
97
- array(
98
- 'section_description' => esc_html__( '', 'wds' ),
99
- 'section_template' => 'schema/schema-section-settings',
100
- 'section_args' => array(
101
- 'options' => $options,
102
- 'social_options' => $social_options,
 
 
 
103
  ),
104
  ),
105
- ),
106
- ) );
107
  ?>
108
  </div>
109
  </form>
110
  <?php } ?>
111
 
112
- <?php $this->_render( 'footer' ); ?>
113
  </div>
1
  <?php
2
+ $action_url = empty( $_view['action_url'] ) ? '' : $_view['action_url'];
3
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
+ $options = empty( $options ) ? array() : $options;
5
+ $social_options = empty( $social_options ) ? array() : $social_options;
6
+ $active_tab = empty( $active_tab ) ? '' : $active_tab;
7
+ $post_types = empty( $post_types ) ? array() : $post_types;
8
+ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
9
+ $pages = empty( $pages ) ? array() : $pages; // phpcs:ignore
10
+ $schema_disabled = ! empty( $social_options['disable-schema'] );
11
 
12
+ $this->render_view( 'before-page-container' );
13
  ?>
14
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-schema' ); ?>">
15
+ <?php
16
+ $this->render_view(
17
+ 'page-header',
18
+ array(
19
+ 'title' => esc_html__( 'Schema', 'wds' ),
20
+ 'documentation_chapter' => 'schema',
21
+ 'utm_campaign' => 'smartcrawl_schema_docs',
22
+ )
23
+ );
24
+ ?>
25
 
26
+ <?php
27
+ $this->render_view(
28
+ 'floating-notices',
29
+ array(
30
+ 'keys' => array(
31
+ 'wds-youtube-api-key-valid',
32
+ 'wds-schema-types-notice',
33
+ 'wds-schema-types-after-addition-notice',
34
+ 'wds-schema-types-invalid-notice',
35
+ ),
36
+ )
37
+ );
38
+ ?>
39
 
40
+ <?php
41
+ if ( $schema_disabled ) {
42
+ $this->render_view( 'schema/schema-disabled' );
43
+ } else {
44
+ ?>
45
  <form action='<?php echo esc_attr( $action_url ); ?>' method='post' class="wds-form">
46
  <?php $this->settings_fields( $option_name ); ?>
47
 
48
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
49
+ <?php
50
+ $this->render_view(
51
+ 'schema/schema-sidenav',
52
+ array(
53
+ 'active_tab' => $active_tab,
54
+ )
55
+ );
56
+ ?>
57
 
58
  <?php
59
+ $this->render_view(
60
+ 'vertical-tab',
61
+ array(
62
+ 'tab_id' => 'tab_general',
63
+ 'tab_name' => esc_html__( 'General', 'wds' ),
64
+ 'is_active' => 'tab_general' === $active_tab,
65
+ 'tab_sections' => array(
66
+ array(
67
+ 'section_description' => esc_html__( 'Let search engines know whether you’re an organization or a person, then add all your social profiles so search engines know which social profiles to attribute your web content to.', 'wds' ),
68
+ 'section_template' => 'schema/schema-section-general',
69
+ 'section_args' => array(
70
+ 'options' => $options,
71
+ 'social_options' => $social_options,
72
+ 'pages' => $pages,
73
+ ),
74
  ),
75
  ),
76
+ )
77
+ );
78
 
79
+ $this->render_view(
80
+ 'vertical-tab',
81
+ array(
82
+ 'tab_id' => 'tab_advanced',
83
+ 'tab_name' => esc_html__( 'Advanced', 'wds' ),
84
+ 'is_active' => 'tab_advanced' === $active_tab,
85
+ 'tab_sections' => array(
86
+ array(
87
+ 'section_description' => esc_html__( 'Choose additional schema markup you want to enable for this website.', 'wds' ),
88
+ 'section_template' => 'schema/schema-section-advanced',
89
+ 'section_args' => array(
90
+ 'options' => $options,
91
+ 'social_options' => $social_options,
92
+ 'pages' => $pages,
93
+ 'post_types' => $post_types,
94
+ 'taxonomies' => $taxonomies,
95
+ ),
96
  ),
97
  ),
98
+ )
99
+ );
100
 
101
+ $this->render_view(
102
+ 'vertical-tab',
103
+ array(
104
+ 'tab_id' => 'tab_types',
105
+ 'tab_name' => esc_html__( 'Types Builder', 'wds' ),
106
+ 'is_active' => 'tab_types' === $active_tab,
107
+ 'tab_sections' => array(
108
+ array(
109
+ 'section_description' => esc_html__( 'Choose what post types and taxonomies you want to associate with each available schema type. By default we output general markup on key WordPress pages, but you can enhance and tailor this to your specific needs below.', 'wds' ),
110
+ 'section_template' => 'schema/schema-section-types',
111
+ 'section_args' => array(),
112
+ ),
113
  ),
114
+ 'button_text' => false,
115
+ )
116
+ );
117
 
118
+ $this->render_view(
119
+ 'vertical-tab',
120
+ array(
121
+ 'tab_id' => 'tab_settings',
122
+ 'tab_name' => esc_html__( 'Settings', 'wds' ),
123
+ 'is_active' => 'tab_settings' === $active_tab,
124
+ 'tab_sections' => array(
125
+ array(
126
+ 'section_description' => '',
127
+ 'section_template' => 'schema/schema-section-settings',
128
+ 'section_args' => array(
129
+ 'options' => $options,
130
+ 'social_options' => $social_options,
131
+ ),
132
  ),
133
  ),
134
+ )
135
+ );
136
  ?>
137
  </div>
138
  </form>
139
  <?php } ?>
140
 
141
+ <?php $this->render_view( 'footer' ); ?>
142
  </div>
includes/admin/templates/schema/schema-sidenav.php CHANGED
@@ -1,24 +1,27 @@
1
  <?php
2
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
 
4
- $this->_render( 'vertical-tabs-side-nav', array(
5
- 'active_tab' => $active_tab,
6
- 'tabs' => array(
7
- array(
8
- 'id' => 'tab_general',
9
- 'name' => esc_html__( 'General', 'wds' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ),
11
- array(
12
- 'id' => 'tab_advanced',
13
- 'name' => esc_html__( 'Advanced', 'wds' ),
14
- ),
15
- array(
16
- 'id' => 'tab_types',
17
- 'name' => esc_html__( 'Types Builder', 'wds' ),
18
- ),
19
- array(
20
- 'id' => 'tab_settings',
21
- 'name' => esc_html__( 'Settings', 'wds' ),
22
- ),
23
- ),
24
- ) );
1
  <?php
2
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
 
4
+ $this->render_view(
5
+ 'vertical-tabs-side-nav',
6
+ array(
7
+ 'active_tab' => $active_tab,
8
+ 'tabs' => array(
9
+ array(
10
+ 'id' => 'tab_general',
11
+ 'name' => esc_html__( 'General', 'wds' ),
12
+ ),
13
+ array(
14
+ 'id' => 'tab_advanced',
15
+ 'name' => esc_html__( 'Advanced', 'wds' ),
16
+ ),
17
+ array(
18
+ 'id' => 'tab_types',
19
+ 'name' => esc_html__( 'Types Builder', 'wds' ),
20
+ ),
21
+ array(
22
+ 'id' => 'tab_settings',
23
+ 'name' => esc_html__( 'Settings', 'wds' ),
24
+ ),
25
  ),
26
+ )
27
+ );
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/templates/schema/schema-social-accounts.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $social_options = empty( $social_options ) ? array() : $social_options;
4
  ?>
5
 
@@ -9,22 +9,26 @@ $social_options = empty( $social_options ) ? array() : $social_options;
9
  <?php esc_html_e( 'Social Accounts', 'wds' ); ?>
10
  </label>
11
  <p class="sui-description">
12
- <?php esc_html_e( "Add all your social accounts so search engines know which profiles to attribute your web content to. Specify as many accounts as you can.", 'wds' ); ?>
13
  </p>
14
  </div>
15
 
16
  <div class="sui-box-settings-col-2">
17
  <div class="sui-border-frame">
18
  <div class="sui-form-field">
19
- <label for="twitter_username"
20
- class="sui-label"><?php esc_html_e( 'Twitter Username', 'wds' ); ?></label>
 
 
21
 
22
  <div class="sui-control-with-icon">
23
  <span class="sui-icon-social-twitter" aria-hidden="true"></span>
24
- <input type="text" id="twitter_username" class="sui-form-control"
25
- name="<?php echo esc_attr( $option_name ); ?>[twitter_username]"
26
- value="<?php echo (string) smartcrawl_get_array_value( $social_options, 'twitter_username' ); ?>"
27
- placeholder="<?php echo esc_attr( 'username' ); ?>">
 
 
28
  </div>
29
  </div>
30
 
@@ -33,10 +37,12 @@ $social_options = empty( $social_options ) ? array() : $social_options;
33
 
34
  <div class="sui-control-with-icon">
35
  <span class="sui-icon-social-facebook" aria-hidden="true"></span>
36
- <input type="text" id="fb-app-id" name="<?php echo esc_attr( $option_name ); ?>[fb-app-id]"
37
- class="sui-form-control"
38
- value="<?php echo (string) smartcrawl_get_array_value( $social_options, 'fb-app-id' ); ?>"
39
- placeholder="<?php echo esc_attr( 'App ID' ); ?>">
 
 
40
  </div>
41
  </div>
42
 
@@ -45,10 +51,12 @@ $social_options = empty( $social_options ) ? array() : $social_options;
45
 
46
  <div class="sui-control-with-icon">
47
  <span class="sui-icon-social-facebook" aria-hidden="true"></span>
48
- <input type="text" id="facebook_url" name="<?php echo esc_attr( $option_name ); ?>[facebook_url]"
49
- class="sui-form-control"
50
- value="<?php echo (string) smartcrawl_get_array_value( $social_options, 'facebook_url' ); ?>"
51
- placeholder="<?php echo esc_attr( 'https://facebook.com/pagename' ); ?>">
 
 
52
  </div>
53
  </div>
54
 
@@ -57,10 +65,12 @@ $social_options = empty( $social_options ) ? array() : $social_options;
57
 
58
  <div class="sui-control-with-icon">
59
  <span class="sui-icon-instagram" aria-hidden="true"></span>
60
- <input type="text" id="instagram_url" name="<?php echo esc_attr( $option_name ); ?>[instagram_url]"
61
- class="sui-form-control"
62
- value="<?php echo (string) smartcrawl_get_array_value( $social_options, 'instagram_url' ); ?>"
63
- placeholder="<?php echo esc_attr( 'https://instagram.com/username' ); ?>">
 
 
64
  </div>
65
  </div>
66
 
@@ -69,10 +79,12 @@ $social_options = empty( $social_options ) ? array() : $social_options;
69
 
70
  <div class="sui-control-with-icon">
71
  <span class="sui-icon-social-linkedin" aria-hidden="true"></span>
72
- <input type="text" id="linkedin_url" name="<?php echo esc_attr( $option_name ); ?>[linkedin_url]"
73
- class="sui-form-control"
74
- value="<?php echo (string) smartcrawl_get_array_value( $social_options, 'linkedin_url' ); ?>"
75
- placeholder="<?php echo esc_attr( 'https://linkedin.com/username' ); ?>">
 
 
76
  </div>
77
  </div>
78
 
@@ -81,10 +93,12 @@ $social_options = empty( $social_options ) ? array() : $social_options;
81
 
82
  <div class="sui-control-with-icon">
83
  <span class="sui-icon-pin" aria-hidden="true"></span>
84
- <input type="text" id="pinterest_url" name="<?php echo esc_attr( $option_name ); ?>[pinterest_url]"
85
- class="sui-form-control"
86
- value="<?php echo (string) smartcrawl_get_array_value( $social_options, 'pinterest_url' ); ?>"
87
- placeholder="<?php echo esc_attr( 'https://pinterest.com/username' ); ?>">
 
 
88
  </div>
89
  </div>
90
 
@@ -93,10 +107,12 @@ $social_options = empty( $social_options ) ? array() : $social_options;
93
 
94
  <div class="sui-control-with-icon">
95
  <span class="sui-icon-social-youtube" aria-hidden="true"></span>
96
- <input type="text" id="youtube_url" name="<?php echo esc_attr( $option_name ); ?>[youtube_url]"
97
- class="sui-form-control"
98
- value="<?php echo (string) smartcrawl_get_array_value( $social_options, 'youtube_url' ); ?>"
99
- placeholder="<?php echo esc_attr( 'https://www.youtube.com/user/username' ); ?>">
 
 
100
  </div>
101
  </div>
102
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $social_options = empty( $social_options ) ? array() : $social_options;
4
  ?>
5
 
9
  <?php esc_html_e( 'Social Accounts', 'wds' ); ?>
10
  </label>
11
  <p class="sui-description">
12
+ <?php esc_html_e( 'Add all your social accounts so search engines know which profiles to attribute your web content to. Specify as many accounts as you can.', 'wds' ); ?>
13
  </p>
14
  </div>
15
 
16
  <div class="sui-box-settings-col-2">
17
  <div class="sui-border-frame">
18
  <div class="sui-form-field">
19
+ <label
20
+ for="twitter_username"
21
+ class="sui-label"
22
+ ><?php esc_html_e( 'Twitter Username', 'wds' ); ?></label>
23
 
24
  <div class="sui-control-with-icon">
25
  <span class="sui-icon-social-twitter" aria-hidden="true"></span>
26
+ <input
27
+ type="text" id="twitter_username" class="sui-form-control"
28
+ name="<?php echo esc_attr( $option_name ); ?>[twitter_username]"
29
+ value="<?php echo esc_url_raw( smartcrawl_get_array_value( $social_options, 'twitter_username' ) ); ?>"
30
+ placeholder="<?php echo esc_attr( 'username' ); ?>"
31
+ >
32
  </div>
33
  </div>
34
 
37
 
38
  <div class="sui-control-with-icon">
39
  <span class="sui-icon-social-facebook" aria-hidden="true"></span>
40
+ <input
41
+ type="text" id="fb-app-id" name="<?php echo esc_attr( $option_name ); ?>[fb-app-id]"
42
+ class="sui-form-control"
43
+ value="<?php echo esc_url_raw( smartcrawl_get_array_value( $social_options, 'fb-app-id' ) ); ?>"
44
+ placeholder="<?php echo esc_attr( 'App ID' ); ?>"
45
+ >
46
  </div>
47
  </div>
48
 
51
 
52
  <div class="sui-control-with-icon">
53
  <span class="sui-icon-social-facebook" aria-hidden="true"></span>
54
+ <input
55
+ type="text" id="facebook_url" name="<?php echo esc_attr( $option_name ); ?>[facebook_url]"
56
+ class="sui-form-control"
57
+ value="<?php echo esc_url_raw( smartcrawl_get_array_value( $social_options, 'facebook_url' ) ); ?>"
58
+ placeholder="<?php echo esc_attr( 'https://facebook.com/pagename' ); ?>"
59
+ >
60
  </div>
61
  </div>
62
 
65
 
66
  <div class="sui-control-with-icon">
67
  <span class="sui-icon-instagram" aria-hidden="true"></span>
68
+ <input
69
+ type="text" id="instagram_url" name="<?php echo esc_attr( $option_name ); ?>[instagram_url]"
70
+ class="sui-form-control"
71
+ value="<?php echo esc_url_raw( smartcrawl_get_array_value( $social_options, 'instagram_url' ) ); ?>"
72
+ placeholder="<?php echo esc_attr( 'https://instagram.com/username' ); ?>"
73
+ >
74
  </div>
75
  </div>
76
 
79
 
80
  <div class="sui-control-with-icon">
81
  <span class="sui-icon-social-linkedin" aria-hidden="true"></span>
82
+ <input
83
+ type="text" id="linkedin_url" name="<?php echo esc_attr( $option_name ); ?>[linkedin_url]"
84
+ class="sui-form-control"
85
+ value="<?php echo esc_url_raw( smartcrawl_get_array_value( $social_options, 'linkedin_url' ) ); ?>"
86
+ placeholder="<?php echo esc_attr( 'https://linkedin.com/username' ); ?>"
87
+ >
88
  </div>
89
  </div>
90
 
93
 
94
  <div class="sui-control-with-icon">
95
  <span class="sui-icon-pin" aria-hidden="true"></span>
96
+ <input
97
+ type="text" id="pinterest_url" name="<?php echo esc_attr( $option_name ); ?>[pinterest_url]"
98
+ class="sui-form-control"
99
+ value="<?php echo esc_url_raw( smartcrawl_get_array_value( $social_options, 'pinterest_url' ) ); ?>"
100
+ placeholder="<?php echo esc_attr( 'https://pinterest.com/username' ); ?>"
101
+ >
102
  </div>
103
  </div>
104
 
107
 
108
  <div class="sui-control-with-icon">
109
  <span class="sui-icon-social-youtube" aria-hidden="true"></span>
110
+ <input
111
+ type="text" id="youtube_url" name="<?php echo esc_attr( $option_name ); ?>[youtube_url]"
112
+ class="sui-form-control"
113
+ value="<?php echo esc_url_raw( smartcrawl_get_array_value( $social_options, 'youtube_url' ) ); ?>"
114
+ placeholder="<?php echo esc_attr( 'https://www.youtube.com/user/username' ); ?>"
115
+ >
116
  </div>
117
  </div>
118
  </div>
includes/admin/templates/schema/schema-youtube-api-key-field.php CHANGED
@@ -1,21 +1,25 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $schema_yt_api_key = empty( $schema_yt_api_key ) ? '' : $schema_yt_api_key;
4
  ?>
5
  <div class="sui-form-field">
6
  <p class="sui-description">
7
- <?php echo smartcrawl_format_link(
 
8
  esc_html__( 'To learn more about how to connect to Youtube, see our %s.', 'wds' ),
9
  'https://wpmudev.com/docs/wpmu-dev-plugins/smartcrawl/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=schema-enabling-the-youtube-api#enabling-the-youtube-api',
10
  'Documentation',
11
  '_blank'
12
- ); ?>
 
13
  </p>
14
  <label for="schema_yt_api_key" class="sui-label"><?php esc_html_e( 'Access Code', 'wds' ); ?></label>
15
- <input type="text" id="schema_yt_api_key" class="sui-form-control"
16
- name="<?php echo esc_attr( $option_name ); ?>[schema_yt_api_key]"
17
- value="<?php echo esc_attr( $schema_yt_api_key ); ?>"
18
- placeholder="<?php esc_attr_e( 'API Key', 'wds' ); ?>"/>
 
 
19
  </div>
20
 
21
  <button class="sui-button sui-button-blue" id="wds-authorize-api-key">
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $schema_yt_api_key = empty( $schema_yt_api_key ) ? '' : $schema_yt_api_key;
4
  ?>
5
  <div class="sui-form-field">
6
  <p class="sui-description">
7
+ <?php
8
+ echo smartcrawl_format_link( // phpcs:ignore
9
  esc_html__( 'To learn more about how to connect to Youtube, see our %s.', 'wds' ),
10
  'https://wpmudev.com/docs/wpmu-dev-plugins/smartcrawl/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=schema-enabling-the-youtube-api#enabling-the-youtube-api',
11
  'Documentation',
12
  '_blank'
13
+ );
14
+ ?>
15
  </p>
16
  <label for="schema_yt_api_key" class="sui-label"><?php esc_html_e( 'Access Code', 'wds' ); ?></label>
17
+ <input
18
+ type="text" id="schema_yt_api_key" class="sui-form-control"
19
+ name="<?php echo esc_attr( $option_name ); ?>[schema_yt_api_key]"
20
+ value="<?php echo esc_attr( $schema_yt_api_key ); ?>"
21
+ placeholder="<?php esc_attr_e( 'API Key', 'wds' ); ?>"
22
+ />
23
  </div>
24
 
25
  <button class="sui-button sui-button-blue" id="wds-authorize-api-key">
includes/admin/templates/schema/schema-youtube-api-key.php CHANGED
@@ -1,24 +1,27 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $schema_enable_yt_api = empty( $schema_enable_yt_api ) ? false : $schema_enable_yt_api;
4
- $schema_yt_api_key = empty( $schema_yt_api_key ) ? '' : $schema_yt_api_key;
5
 
6
- $this->_render( 'side-tabs', array(
7
- 'id' => 'wds-yt-api-key-tabs',
8
- 'name' => "{$option_name}[schema_enable_yt_api]",
9
- 'value' => empty( $schema_enable_yt_api ) ? '' : '1',
10
- 'tabs' => array(
11
- array(
12
- 'value' => '',
13
- 'label' => esc_html__( 'Disconnect Youtube', 'wds' ),
14
- ),
15
- array(
16
- 'value' => '1',
17
- 'label' => esc_html__( 'Connect with Youtube', 'wds' ),
18
- 'template' => 'schema/schema-youtube-api-key-field',
19
- 'template_args' => array(
20
- 'schema_yt_api_key' => $schema_yt_api_key,
 
 
 
21
  ),
22
  ),
23
- ),
24
- ) );
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $schema_enable_yt_api = empty( $schema_enable_yt_api ) ? false : $schema_enable_yt_api;
4
+ $schema_yt_api_key = empty( $schema_yt_api_key ) ? '' : $schema_yt_api_key;
5
 
6
+ $this->render_view(
7
+ 'side-tabs',
8
+ array(
9
+ 'id' => 'wds-yt-api-key-tabs',
10
+ 'name' => "{$option_name}[schema_enable_yt_api]",
11
+ 'value' => empty( $schema_enable_yt_api ) ? '' : '1',
12
+ 'tabs' => array(
13
+ array(
14
+ 'value' => '',
15
+ 'label' => esc_html__( 'Disconnect Youtube', 'wds' ),
16
+ ),
17
+ array(
18
+ 'value' => '1',
19
+ 'label' => esc_html__( 'Connect with Youtube', 'wds' ),
20
+ 'template' => 'schema/schema-youtube-api-key-field',
21
+ 'template_args' => array(
22
+ 'schema_yt_api_key' => $schema_yt_api_key,
23
+ ),
24
  ),
25
  ),
26
+ )
27
+ );
includes/admin/templates/seomoz-dashboard-widget.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  $attribution = empty( $attribution ) ? '#' : $attribution;
3
- $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
4
  ?>
5
  <table class="sui-table">
6
  <thead>
@@ -17,12 +17,16 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
17
  </td>
18
  <td>
19
  <?php esc_html_e( '10-point score:', 'wds' ); ?>&nbsp;
20
- <a href="<?php echo esc_attr( $attribution ); ?>"
21
- target="_blank"><?php echo( ! empty( $urlmetrics->fmrp ) ? esc_html( $urlmetrics->fmrp ) : '' ); ?></a>
 
 
22
  <br>
23
  <?php esc_html_e( 'Raw score:', 'wds' ); ?>&nbsp;
24
- <a href="<?php echo esc_attr( $attribution ); ?>"
25
- target="_blank"><?php echo( ! empty( $urlmetrics->fmrr ) ? esc_html( $urlmetrics->fmrr ) : '' ); ?></a>
 
 
26
  </td>
27
  </tr>
28
  <tr>
@@ -31,8 +35,10 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
31
  <a href="https://moz.com/learn/seo/domain-authority" target="_blank">(?)</a>
32
  </td>
33
  <td>
34
- <a href="<?php echo esc_attr( $attribution ); ?>"
35
- target="_blank"><?php echo( ! empty( $urlmetrics->pda ) ? esc_html( $urlmetrics->pda ) : '' ); ?></a>
 
 
36
  </td>
37
  </tr>
38
  <tr>
@@ -41,8 +47,10 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
41
  <?php printf( esc_html__( 'The number of external (from other subdomains), juice passing links %s to the target URL in the Linkscape index', 'wds' ), '<a href="https://moz.com/learn/seo/external-link" target="_blank">(?)</a>' ); ?>
42
  </td>
43
  <td>
44
- <a href="<?php echo esc_attr( $attribution ); ?>"
45
- target="_blank"><?php echo( ! empty( $urlmetrics->ueid ) ? esc_html( $urlmetrics->ueid ) : '' ); ?></a>
 
 
46
  </td>
47
  </tr>
48
  <tr>
@@ -51,8 +59,10 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
51
  <?php printf( esc_html__( 'The number of internal and external, juice and non-juice passing links %s to the target URL in the Linkscape index', 'wds' ), '<a href="https://moz.com/learn/seo/internal-link" target="_blank">(?)</a>' ); ?>
52
  </td>
53
  <td>
54
- <a href="<?php echo esc_attr( $attribution ); ?>"
55
- target="_blank"><?php echo( ! empty( $urlmetrics->uid ) ? esc_html( $urlmetrics->uid ) : '' ); ?></a>
 
 
56
  </td>
57
  </tr>
58
  <tr>
@@ -62,12 +72,16 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
62
  </td>
63
  <td>
64
  <?php esc_html_e( '10-point score:', 'wds' ); ?>&nbsp;
65
- <a href="<?php echo esc_attr( $attribution ); ?>"
66
- target="_blank"><?php echo( ! empty( $urlmetrics->umrp ) ? esc_html( $urlmetrics->umrp ) : '' ); ?></a>
 
 
67
  <br>
68
  <?php esc_html_e( 'Raw score:', 'wds' ); ?>&nbsp;
69
- <a href="<?php echo esc_attr( $attribution ); ?>"
70
- target="_blank"><?php echo( ! empty( $urlmetrics->umrr ) ? esc_html( $urlmetrics->umrr ) : '' ); ?></a>
 
 
71
  </td>
72
  </tr>
73
  <tr>
@@ -76,8 +90,10 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
76
  <a href="https://moz.com/learn/seo/page-authority" target="_blank">(?)</a>
77
  </td>
78
  <td>
79
- <a href="<?php echo esc_attr( $attribution ); ?>"
80
- target="_blank"><?php echo( ! empty( $urlmetrics->upa ) ? esc_html( $urlmetrics->upa ) : '' ); ?></a>
 
 
81
  </td>
82
  </tr>
83
  </tbody>
1
  <?php
2
  $attribution = empty( $attribution ) ? '#' : $attribution;
3
+ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
4
  ?>
5
  <table class="sui-table">
6
  <thead>
17
  </td>
18
  <td>
19
  <?php esc_html_e( '10-point score:', 'wds' ); ?>&nbsp;
20
+ <a
21
+ href="<?php echo esc_attr( $attribution ); ?>"
22
+ target="_blank"
23
+ ><?php echo( ! empty( $urlmetrics->fmrp ) ? esc_html( $urlmetrics->fmrp ) : '' ); ?></a>
24
  <br>
25
  <?php esc_html_e( 'Raw score:', 'wds' ); ?>&nbsp;
26
+ <a
27
+ href="<?php echo esc_attr( $attribution ); ?>"
28
+ target="_blank"
29
+ ><?php echo( ! empty( $urlmetrics->fmrr ) ? esc_html( $urlmetrics->fmrr ) : '' ); ?></a>
30
  </td>
31
  </tr>
32
  <tr>
35
  <a href="https://moz.com/learn/seo/domain-authority" target="_blank">(?)</a>
36
  </td>
37
  <td>
38
+ <a
39
+ href="<?php echo esc_attr( $attribution ); ?>"
40
+ target="_blank"
41
+ ><?php echo( ! empty( $urlmetrics->pda ) ? esc_html( $urlmetrics->pda ) : '' ); ?></a>
42
  </td>
43
  </tr>
44
  <tr>
47
  <?php printf( esc_html__( 'The number of external (from other subdomains), juice passing links %s to the target URL in the Linkscape index', 'wds' ), '<a href="https://moz.com/learn/seo/external-link" target="_blank">(?)</a>' ); ?>
48
  </td>
49
  <td>
50
+ <a
51
+ href="<?php echo esc_attr( $attribution ); ?>"
52
+ target="_blank"
53
+ ><?php echo( ! empty( $urlmetrics->ueid ) ? esc_html( $urlmetrics->ueid ) : '' ); ?></a>
54
  </td>
55
  </tr>
56
  <tr>
59
  <?php printf( esc_html__( 'The number of internal and external, juice and non-juice passing links %s to the target URL in the Linkscape index', 'wds' ), '<a href="https://moz.com/learn/seo/internal-link" target="_blank">(?)</a>' ); ?>
60
  </td>
61
  <td>
62
+ <a
63
+ href="<?php echo esc_attr( $attribution ); ?>"
64
+ target="_blank"
65
+ ><?php echo( ! empty( $urlmetrics->uid ) ? esc_html( $urlmetrics->uid ) : '' ); ?></a>
66
  </td>
67
  </tr>
68
  <tr>
72
  </td>
73
  <td>
74
  <?php esc_html_e( '10-point score:', 'wds' ); ?>&nbsp;
75
+ <a
76
+ href="<?php echo esc_attr( $attribution ); ?>"
77
+ target="_blank"
78
+ ><?php echo( ! empty( $urlmetrics->umrp ) ? esc_html( $urlmetrics->umrp ) : '' ); ?></a>
79
  <br>
80
  <?php esc_html_e( 'Raw score:', 'wds' ); ?>&nbsp;
81
+ <a
82
+ href="<?php echo esc_attr( $attribution ); ?>"
83
+ target="_blank"
84
+ ><?php echo( ! empty( $urlmetrics->umrr ) ? esc_html( $urlmetrics->umrr ) : '' ); ?></a>
85
  </td>
86
  </tr>
87
  <tr>
90
  <a href="https://moz.com/learn/seo/page-authority" target="_blank">(?)</a>
91
  </td>
92
  <td>
93
+ <a
94
+ href="<?php echo esc_attr( $attribution ); ?>"
95
+ target="_blank"
96
+ ><?php echo( ! empty( $urlmetrics->upa ) ? esc_html( $urlmetrics->upa ) : '' ); ?></a>
97
  </td>
98
  </tr>
99
  </tbody>
includes/admin/templates/settings/settings-analysis.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $strong = '<strong>%s</strong>';
4
- $analysis_strategy = Smartcrawl_Controller_Analysis_Content::get()->get_analysis_strategy();
5
- $is_strategy_strict = $analysis_strategy === Smartcrawl_Controller_Analysis_Content::STRATEGY_STRICT;
6
- $is_strategy_moderate = $analysis_strategy === Smartcrawl_Controller_Analysis_Content::STRATEGY_MODERATE;
7
- $is_strategy_manual = $analysis_strategy === Smartcrawl_Controller_Analysis_Content::STRATEGY_MANUAL;
8
- $is_strategy_loose = $analysis_strategy === Smartcrawl_Controller_Analysis_Content::STRATEGY_LOOSE;
9
  ?>
10
 
11
  <div class="sui-box-settings-row">
@@ -20,89 +20,118 @@ $is_strategy_loose = $analysis_strategy === Smartcrawl_Controller_Analysis_Conte
20
  <label class="sui-settings-label"><?php esc_html_e( 'Visibility', 'wds' ); ?></label>
21
  <p class="sui-description"><?php esc_html_e( 'SEO Analysis benchmarks your content against recommend SEO practice and gives recommendations for improvement to make sure content is as optimized as possible. Readibility Analysis uses the Flesch-Kincaid test to determine how easy your content is to read.', 'wds' ); ?></p>
22
  <?php
23
- $this->_render( 'toggle-item', array(
24
- 'item_value' => 'analysis-seo',
25
- 'field_name' => "{$option_name}[analysis-seo]",
26
- 'field_id' => 'analysis-seo',
27
- 'checked' => ! empty( $_view['options']['analysis-seo'] ),
28
- 'item_label' => esc_html__( 'Page Analysis', 'wds' ),
29
- ) );
 
 
 
30
  ?>
31
  <?php
32
- $this->_render( 'toggle-item', array(
33
- 'item_value' => 'analysis-readability',
34
- 'field_name' => "{$option_name}[analysis-readability]",
35
- 'field_id' => 'analysis-readability',
36
- 'checked' => ! empty( $_view['options']['analysis-readability'] ),
37
- 'item_label' => esc_html__( 'Readability Analysis', 'wds' ),
38
- ) );
 
 
 
39
  ?>
40
 
41
  <label class="sui-settings-label"><?php esc_html_e( 'Engine', 'wds' ); ?></label>
42
  <p class="sui-description"><?php esc_html_e( 'Choose how you want SmartCrawl to analyze your content.', 'wds' ); ?></p>
43
  <p class="sui-description">
44
- <?php printf(
 
45
  esc_html__( '%s is recommended for most websites as it only reviews the_content() output.', 'wds' ),
46
- sprintf( $strong, esc_html__( 'Content', 'wds' ) )
47
- ); ?>
 
48
  </p>
49
  <p class="sui-description">
50
- <?php printf(
 
51
  esc_html__( '%s includes everything, except for your header, nav, footer and sidebars. This can be helpful for page builders and themes with custom output.', 'wds' ),
52
- sprintf( $strong, esc_html__( 'Wide', 'wds' ) )
53
- ); ?>
 
54
  </p>
55
- <p class="sui-description"><?php printf(
 
 
56
  esc_html__( '%s checks your entire page’s content including elements like nav and footer. Due to analysing everything you might miss key analysis of your real content so we don’t recommend this approach.', 'wds' ),
57
- sprintf( $strong, esc_html__( 'All', 'wds' ) )
58
- ); ?>
 
59
  </p>
60
- <p class="sui-description"><?php printf(
 
 
61
  esc_html__( '%s only analyzes content you tell it to programmatically. If you have a fully custom setup, this is the option for you. Read the documentation.', 'wds' ),
62
- sprintf( $strong, esc_html__( 'None', 'wds' ) )
63
- ); ?>
 
64
  </p>
65
 
66
  <div class="wds-analysis-strategy-tabs sui-side-tabs sui-tabs">
67
  <div class="sui-tabs-menu">
68
  <label class="wds-strategy-strict sui-tab-item <?php echo $is_strategy_strict ? 'active' : ''; ?>">
69
  <?php esc_html_e( 'Content', 'wds' ); ?>
70
- <input name="<?php echo esc_attr( $option_name ); ?>[analysis_strategy]"
71
- value="<?php echo esc_attr( Smartcrawl_Controller_Analysis_Content::STRATEGY_STRICT ); ?>"
72
- type="radio" <?php checked( $is_strategy_strict ); ?>
73
- class="hidden"/>
 
 
74
  </label>
75
  <label class="wds-strategy-moderate sui-tab-item <?php echo $is_strategy_moderate ? 'active' : ''; ?>">
76
  <?php esc_html_e( 'Wide', 'wds' ); ?>
77
- <input name="<?php echo esc_attr( $option_name ); ?>[analysis_strategy]"
78
- value="<?php echo esc_attr( Smartcrawl_Controller_Analysis_Content::STRATEGY_MODERATE ); ?>"
79
- type="radio" <?php checked( $is_strategy_moderate ); ?>
80
- class="hidden"/>
 
 
81
  </label>
82
  <label class="wds-strategy-loose sui-tab-item <?php echo $is_strategy_loose ? 'active' : ''; ?>">
83
  <?php esc_html_e( 'All', 'wds' ); ?>
84
- <input name="<?php echo esc_attr( $option_name ); ?>[analysis_strategy]"
85
- value="<?php echo esc_attr( Smartcrawl_Controller_Analysis_Content::STRATEGY_LOOSE ); ?>"
86
- type="radio" <?php checked( $is_strategy_loose ); ?>
87
- class="hidden"/>
 
 
88
  </label>
89
  <label class="wds-strategy-manual sui-tab-item <?php echo $is_strategy_manual ? 'active' : ''; ?>">
90
  <?php esc_html_e( 'None', 'wds' ); ?>
91
- <input name="<?php echo esc_attr( $option_name ); ?>[analysis_strategy]"
92
- value="<?php echo esc_attr( Smartcrawl_Controller_Analysis_Content::STRATEGY_MANUAL ); ?>"
93
- type="radio" <?php checked( $is_strategy_manual ); ?>
94
- class="hidden"/>
 
 
95
  </label>
96
  </div>
97
  </div>
98
 
99
- <?php $this->_render( 'notice', array(
100
- 'message' => sprintf(
101
- esc_html__( 'Custom setup? Choose the %s method and add the class %s to container elements you want to include in the SEO and Readability Analysis.', 'wds' ),
102
- '<strong>' . esc_html__( 'None', 'wds' ) . '</strong>',
103
- '<strong>' . esc_html( '.smartcrawl-checkup-included' ) . '</strong>'
104
- ),
105
- 'class' => 'grey',
106
- ) ); ?>
 
 
 
 
 
107
  </div>
108
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $strong = '<strong>%s</strong>';
4
+ $analysis_strategy = Smartcrawl_Controller_Analysis_Content::get()->get_analysis_strategy();
5
+ $is_strategy_strict = Smartcrawl_Controller_Analysis_Content::STRATEGY_STRICT === $analysis_strategy;
6
+ $is_strategy_moderate = Smartcrawl_Controller_Analysis_Content::STRATEGY_MODERATE === $analysis_strategy;
7
+ $is_strategy_manual = Smartcrawl_Controller_Analysis_Content::STRATEGY_MANUAL === $analysis_strategy;
8
+ $is_strategy_loose = Smartcrawl_Controller_Analysis_Content::STRATEGY_LOOSE === $analysis_strategy;
9
  ?>
10
 
11
  <div class="sui-box-settings-row">
20
  <label class="sui-settings-label"><?php esc_html_e( 'Visibility', 'wds' ); ?></label>
21
  <p class="sui-description"><?php esc_html_e( 'SEO Analysis benchmarks your content against recommend SEO practice and gives recommendations for improvement to make sure content is as optimized as possible. Readibility Analysis uses the Flesch-Kincaid test to determine how easy your content is to read.', 'wds' ); ?></p>
22
  <?php
23
+ $this->render_view(
24
+ 'toggle-item',
25
+ array(
26
+ 'item_value' => 'analysis-seo',
27
+ 'field_name' => "{$option_name}[analysis-seo]",
28
+ 'field_id' => 'analysis-seo',
29
+ 'checked' => ! empty( $_view['options']['analysis-seo'] ),
30
+ 'item_label' => esc_html__( 'Page Analysis', 'wds' ),
31
+ )
32
+ );
33
  ?>
34
  <?php
35
+ $this->render_view(
36
+ 'toggle-item',
37
+ array(
38
+ 'item_value' => 'analysis-readability',
39
+ 'field_name' => "{$option_name}[analysis-readability]",
40
+ 'field_id' => 'analysis-readability',
41
+ 'checked' => ! empty( $_view['options']['analysis-readability'] ),
42
+ 'item_label' => esc_html__( 'Readability Analysis', 'wds' ),
43
+ )
44
+ );
45
  ?>
46
 
47
  <label class="sui-settings-label"><?php esc_html_e( 'Engine', 'wds' ); ?></label>
48
  <p class="sui-description"><?php esc_html_e( 'Choose how you want SmartCrawl to analyze your content.', 'wds' ); ?></p>
49
  <p class="sui-description">
50
+ <?php
51
+ printf(
52
  esc_html__( '%s is recommended for most websites as it only reviews the_content() output.', 'wds' ),
53
+ sprintf( $strong, esc_html__( 'Content', 'wds' ) ) // phpcs:ignore
54
+ );
55
+ ?>
56
  </p>
57
  <p class="sui-description">
58
+ <?php
59
+ printf(
60
  esc_html__( '%s includes everything, except for your header, nav, footer and sidebars. This can be helpful for page builders and themes with custom output.', 'wds' ),
61
+ sprintf( $strong, esc_html__( 'Wide', 'wds' ) ) // phpcs:ignore
62
+ );
63
+ ?>
64
  </p>
65
+ <p class="sui-description">
66
+ <?php
67
+ printf(
68
  esc_html__( '%s checks your entire page’s content including elements like nav and footer. Due to analysing everything you might miss key analysis of your real content so we don’t recommend this approach.', 'wds' ),
69
+ sprintf( $strong, esc_html__( 'All', 'wds' ) ) // phpcs:ignore
70
+ );
71
+ ?>
72
  </p>
73
+ <p class="sui-description">
74
+ <?php
75
+ printf(
76
  esc_html__( '%s only analyzes content you tell it to programmatically. If you have a fully custom setup, this is the option for you. Read the documentation.', 'wds' ),
77
+ sprintf( $strong, esc_html__( 'None', 'wds' ) ) // phpcs:ignore
78
+ );
79
+ ?>
80
  </p>
81
 
82
  <div class="wds-analysis-strategy-tabs sui-side-tabs sui-tabs">
83
  <div class="sui-tabs-menu">
84
  <label class="wds-strategy-strict sui-tab-item <?php echo $is_strategy_strict ? 'active' : ''; ?>">
85
  <?php esc_html_e( 'Content', 'wds' ); ?>
86
+ <input
87
+ name="<?php echo esc_attr( $option_name ); ?>[analysis_strategy]"
88
+ value="<?php echo esc_attr( Smartcrawl_Controller_Analysis_Content::STRATEGY_STRICT ); ?>"
89
+ type="radio" <?php checked( $is_strategy_strict ); ?>
90
+ class="hidden"
91
+ />
92
  </label>
93
  <label class="wds-strategy-moderate sui-tab-item <?php echo $is_strategy_moderate ? 'active' : ''; ?>">
94
  <?php esc_html_e( 'Wide', 'wds' ); ?>
95
+ <input
96
+ name="<?php echo esc_attr( $option_name ); ?>[analysis_strategy]"
97
+ value="<?php echo esc_attr( Smartcrawl_Controller_Analysis_Content::STRATEGY_MODERATE ); ?>"
98
+ type="radio" <?php checked( $is_strategy_moderate ); ?>
99
+ class="hidden"
100
+ />
101
  </label>
102
  <label class="wds-strategy-loose sui-tab-item <?php echo $is_strategy_loose ? 'active' : ''; ?>">
103
  <?php esc_html_e( 'All', 'wds' ); ?>
104
+ <input
105
+ name="<?php echo esc_attr( $option_name ); ?>[analysis_strategy]"
106
+ value="<?php echo esc_attr( Smartcrawl_Controller_Analysis_Content::STRATEGY_LOOSE ); ?>"
107
+ type="radio" <?php checked( $is_strategy_loose ); ?>
108
+ class="hidden"
109
+ />
110
  </label>
111
  <label class="wds-strategy-manual sui-tab-item <?php echo $is_strategy_manual ? 'active' : ''; ?>">
112
  <?php esc_html_e( 'None', 'wds' ); ?>
113
+ <input
114
+ name="<?php echo esc_attr( $option_name ); ?>[analysis_strategy]"
115
+ value="<?php echo esc_attr( Smartcrawl_Controller_Analysis_Content::STRATEGY_MANUAL ); ?>"
116
+ type="radio" <?php checked( $is_strategy_manual ); ?>
117
+ class="hidden"
118
+ />
119
  </label>
120
  </div>
121
  </div>
122
 
123
+ <?php
124
+ $this->render_view(
125
+ 'notice',
126
+ array(
127
+ 'message' => sprintf(
128
+ esc_html__( 'Custom setup? Choose the %1$s method and add the class %2$s to container elements you want to include in the SEO and Readability Analysis.', 'wds' ),
129
+ '<strong>' . esc_html__( 'None', 'wds' ) . '</strong>',
130
+ '<strong>' . esc_html( '.smartcrawl-checkup-included' ) . '</strong>'
131
+ ),
132
+ 'class' => 'grey',
133
+ )
134
+ );
135
+ ?>
136
  </div>
137
  </div>
includes/admin/templates/settings/settings-custom-meta-tag.php CHANGED
@@ -1,8 +1,12 @@
1
- <?php $value = empty( $value ) ? '' : $value; ?>
 
 
2
  <div class="wds-custom-meta-tag">
3
- <input type="text"
4
- class="sui-form-control"
5
- value="<?php echo esc_attr( $value ); ?>"
6
- placeholder="<?php esc_html_e( 'Paste your meta tag here', 'wds' ); ?>"
7
- name="<?php echo esc_attr( $_view['option_name'] ); ?>[additional-metas][]"/>
 
 
8
  </div>
1
+ <?php
2
+ $value = empty( $value ) ? '' : $value;
3
+ ?>
4
  <div class="wds-custom-meta-tag">
5
+ <input
6
+ type="text"
7
+ class="sui-form-control"
8
+ value="<?php echo esc_attr( $value ); ?>"
9
+ placeholder="<?php esc_html_e( 'Paste your meta tag here', 'wds' ); ?>"
10
+ name="<?php echo esc_attr( $_view['option_name'] ); ?>[additional-metas][]"
11
+ />
12
  </div>
includes/admin/templates/settings/settings-import-notice.php CHANGED
@@ -1,23 +1,28 @@
1
  <?php
2
  $settings_errors = Smartcrawl_Controller_Third_Party_Import::get()->get_errors();
3
- $import = smartcrawl_get_array_value( $_GET, 'import' );
4
  ?>
5
  <div class="sui-floating-notices">
6
  <?php
7
- if ( $import === 'success' ) {
8
- $this->_render( 'floating-notice', array(
9
- 'code' => 'wds-crawl-started',
10
- 'type' => 'success',
11
- 'message' => esc_html__( 'Settings successfully imported', 'wds' ),
12
- 'autoclose' => true,
13
- ) );
 
 
 
14
  } elseif ( ! empty( $settings_errors ) ) {
15
- $this->_render( 'floating-notice', array(
16
- 'code' => 'wds-import-error',
17
- 'type' => 'error',
18
- 'message' => array_shift( $settings_errors ),
19
- 'autoclose' => false,
20
- ) );
 
 
 
21
  }
22
  ?>
23
  </div>
1
  <?php
2
  $settings_errors = Smartcrawl_Controller_Third_Party_Import::get()->get_errors();
 
3
  ?>
4
  <div class="sui-floating-notices">
5
  <?php
6
+ if ( 'success' === smartcrawl_get_array_value( $_GET, 'import' ) ) { // phpcs:ignore
7
+ $this->render_view(
8
+ 'floating-notice',
9
+ array(
10
+ 'code' => 'wds-crawl-started',
11
+ 'type' => 'success',
12
+ 'message' => esc_html__( 'Settings successfully imported', 'wds' ),
13
+ 'autoclose' => true,
14
+ )
15
+ );
16
  } elseif ( ! empty( $settings_errors ) ) {
17
+ $this->render_view(
18
+ 'floating-notice',
19
+ array(
20
+ 'code' => 'wds-import-error',
21
+ 'type' => 'error',
22
+ 'message' => array_shift( $settings_errors ),
23
+ 'autoclose' => false,
24
+ )
25
+ );
26
  }
27
  ?>
28
  </div>
includes/admin/templates/settings/settings-section-accessibility.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $high_contrast_option = "{$option_name}[high-contrast]";
4
- $enabled = ! empty( $_view['options']['high-contrast'] );
5
  ?>
6
  <div class="sui-box-settings-row">
7
  <div class="sui-box-settings-col-1">
@@ -15,12 +15,15 @@ $enabled = ! empty( $_view['options']['high-contrast'] );
15
  </div>
16
  <div class="sui-box-settings-col-2">
17
  <?php
18
- $this->_render( 'toggle-item', array(
19
- 'field_name' => $high_contrast_option,
20
- 'field_id' => $high_contrast_option,
21
- 'checked' => $enabled,
22
- 'item_label' => esc_html__( 'Enable high contrast mode', 'wds' ),
23
- ) );
 
 
 
24
  ?>
25
  </div>
26
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $high_contrast_option = "{$option_name}[high-contrast]";
4
+ $enabled = ! empty( $_view['options']['high-contrast'] );
5
  ?>
6
  <div class="sui-box-settings-row">
7
  <div class="sui-box-settings-col-1">
15
  </div>
16
  <div class="sui-box-settings-col-2">
17
  <?php
18
+ $this->render_view(
19
+ 'toggle-item',
20
+ array(
21
+ 'field_name' => $high_contrast_option,
22
+ 'field_id' => $high_contrast_option,
23
+ 'checked' => $enabled,
24
+ 'item_label' => esc_html__( 'Enable high contrast mode', 'wds' ),
25
+ )
26
+ );
27
  ?>
28
  </div>
29
  </div>
includes/admin/templates/settings/settings-section-configs.php CHANGED
@@ -2,8 +2,11 @@
2
  $is_active = empty( $is_active ) ? false : $is_active;
3
  wp_enqueue_script( Smartcrawl_Controller_Assets::CONFIGS_JS );
4
  ?>
5
- <div class="wds-vertical-tab-section sui-box tab_configs <?php echo $is_active ? '' : 'hidden'; ?>"
6
- id="tab_configs">
 
 
 
7
  <div id="wds-config-components" class="wds-configs-container">
8
  <div class="sui-box">
9
  <div class="sui-box-header">
2
  $is_active = empty( $is_active ) ? false : $is_active;
3
  wp_enqueue_script( Smartcrawl_Controller_Assets::CONFIGS_JS );
4
  ?>
5
+ <div
6
+ class="wds-vertical-tab-section sui-box tab_configs
7
+ <?php echo $is_active ? '' : 'hidden'; ?>"
8
+ id="tab_configs"
9
+ >
10
  <div id="wds-config-components" class="wds-configs-container">
11
  <div class="sui-box">
12
  <div class="sui-box-header">
includes/admin/templates/settings/settings-section-data.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
- $options = empty( $_view['options'] ) ? array() : $_view['options'];
3
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
- $keep_settings = (boolean) smartcrawl_get_array_value( $options, 'keep_settings_on_uninstall' );
5
- $keep_data = (boolean) smartcrawl_get_array_value( $options, 'keep_data_on_uninstall' );
6
  $show_subsite_controls = is_multisite();
7
  ?>
8
 
@@ -24,15 +24,19 @@ $show_subsite_controls = is_multisite();
24
  <div class="sui-tabs-menu">
25
  <label class="sui-tab-item <?php echo $keep_settings ? 'active' : ''; ?>">
26
  <?php esc_html_e( 'Preserve', 'wds' ); ?>
27
- <input name="<?php echo esc_attr( $option_name ); ?>[keep_settings_on_uninstall]" <?php checked( $keep_settings ); ?>
28
- value="1" type="radio"
29
- class="hidden"/>
 
 
30
  </label>
31
  <label class="sui-tab-item <?php echo $keep_settings ? '' : 'active'; ?>">
32
  <?php esc_html_e( 'Reset', 'wds' ); ?>
33
- <input name="<?php echo esc_attr( $option_name ); ?>[keep_settings_on_uninstall]" <?php checked( $keep_settings, false ); ?>
34
- value="0" type="radio"
35
- class="hidden"/>
 
 
36
  </label>
37
  </div>
38
  </div>
@@ -47,31 +51,38 @@ $show_subsite_controls = is_multisite();
47
  <div class="sui-tabs-menu">
48
  <label class="sui-tab-item <?php echo $keep_data ? 'active' : ''; ?>">
49
  <?php esc_html_e( 'Keep', 'wds' ); ?>
50
- <input name="<?php echo esc_attr( $option_name ); ?>[keep_data_on_uninstall]" <?php checked( $keep_data ); ?>
51
- value="1" type="radio"
52
- class="hidden"/>
 
 
53
  </label>
54
  <label class="sui-tab-item <?php echo $keep_data ? '' : 'active'; ?>">
55
  <?php esc_html_e( 'Reset', 'wds' ); ?>
56
- <input name="<?php echo esc_attr( $option_name ); ?>[keep_data_on_uninstall]" <?php checked( $keep_data, false ); ?>
57
- value="0" type="radio"
58
- class="hidden"/>
 
 
59
  </label>
60
  </div>
61
  </div>
62
 
63
  <?php
64
  if ( $show_subsite_controls ) {
65
- $this->_render( 'notice', array(
66
- 'class' => 'sui-notice-info',
67
- 'message' => esc_html__( 'This option only affects the main site. If you want to delete settings and data for subsites before uninstalling the plugin, please use the setting below.', 'wds' ),
68
- ) );
 
 
 
69
  }
70
  ?>
71
  </div>
72
  </div>
73
 
74
- <?php if ( $show_subsite_controls ): ?>
75
  <div class="sui-box-settings-row">
76
  <div class="sui-box-settings-col-1">
77
  <label class="sui-settings-label"><?php esc_html_e( 'Subsites', 'wds' ); ?></label>
1
  <?php
2
+ $options = empty( $_view['options'] ) ? array() : $_view['options'];
3
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
+ $keep_settings = (bool) smartcrawl_get_array_value( $options, 'keep_settings_on_uninstall' );
5
+ $keep_data = (bool) smartcrawl_get_array_value( $options, 'keep_data_on_uninstall' );
6
  $show_subsite_controls = is_multisite();
7
  ?>
8
 
24
  <div class="sui-tabs-menu">
25
  <label class="sui-tab-item <?php echo $keep_settings ? 'active' : ''; ?>">
26
  <?php esc_html_e( 'Preserve', 'wds' ); ?>
27
+ <input
28
+ name="<?php echo esc_attr( $option_name ); ?>[keep_settings_on_uninstall]" <?php checked( $keep_settings ); ?>
29
+ value="1" type="radio"
30
+ class="hidden"
31
+ />
32
  </label>
33
  <label class="sui-tab-item <?php echo $keep_settings ? '' : 'active'; ?>">
34
  <?php esc_html_e( 'Reset', 'wds' ); ?>
35
+ <input
36
+ name="<?php echo esc_attr( $option_name ); ?>[keep_settings_on_uninstall]" <?php checked( $keep_settings, false ); ?>
37
+ value="0" type="radio"
38
+ class="hidden"
39
+ />
40
  </label>
41
  </div>
42
  </div>
51
  <div class="sui-tabs-menu">
52
  <label class="sui-tab-item <?php echo $keep_data ? 'active' : ''; ?>">
53
  <?php esc_html_e( 'Keep', 'wds' ); ?>
54
+ <input
55
+ name="<?php echo esc_attr( $option_name ); ?>[keep_data_on_uninstall]" <?php checked( $keep_data ); ?>
56
+ value="1" type="radio"
57
+ class="hidden"
58
+ />
59
  </label>
60
  <label class="sui-tab-item <?php echo $keep_data ? '' : 'active'; ?>">
61
  <?php esc_html_e( 'Reset', 'wds' ); ?>
62
+ <input
63
+ name="<?php echo esc_attr( $option_name ); ?>[keep_data_on_uninstall]" <?php checked( $keep_data, false ); ?>
64
+ value="0" type="radio"
65
+ class="hidden"
66
+ />
67
  </label>
68
  </div>
69
  </div>
70
 
71
  <?php
72
  if ( $show_subsite_controls ) {
73
+ $this->render_view(
74
+ 'notice',
75
+ array(
76
+ 'class' => 'sui-notice-info',
77
+ 'message' => esc_html__( 'This option only affects the main site. If you want to delete settings and data for subsites before uninstalling the plugin, please use the setting below.', 'wds' ),
78
+ )
79
+ );
80
  }
81
  ?>
82
  </div>
83
  </div>
84
 
85
+ <?php if ( $show_subsite_controls ) : ?>
86
  <div class="sui-box-settings-row">
87
  <div class="sui-box-settings-col-1">
88
  <label class="sui-settings-label"><?php esc_html_e( 'Subsites', 'wds' ); ?></label>
includes/admin/templates/settings/settings-section-general.php CHANGED
@@ -6,29 +6,33 @@
6
  */
7
 
8
  $sitemap_option_name = empty( $sitemap_option_name ) ? '' : $sitemap_option_name;
9
- $verification_pages = empty( $verification_pages ) ? array() : $verification_pages;
10
- $smartcrawl_options = Smartcrawl_Settings::get_options();
11
- $sitemap_options = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SITEMAP );
12
- $plugin_modules = empty( $plugin_modules ) ? array() : $plugin_modules;
13
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
14
 
15
- $this->_render( 'settings/settings-analysis' );
16
 
17
- $this->_render( 'toggle-group', array(
18
- 'label' => esc_html__( 'Admin Bar', 'wds' ),
19
- 'description' => esc_html__( 'Add a shortcut to SmartCrawl settings in the top WordPress Admin bar.', 'wds' ),
20
- 'separator' => true,
21
- 'items' => array(
22
- 'extras-admin_bar' => array(
23
- 'label' => esc_html__( 'Enable SmartCrawl shortcut', 'wds' ),
24
- 'html_description' => '<span class="sui-description">' . smartcrawl_format_link(
25
- esc_html__( 'Note: Only user roles defined in the %s tab will be able to see this.', 'wds' ),
26
- Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SETTINGS ) . '&tab=tab_user_roles',
27
- esc_html__( 'User Roles', 'wds' )
28
- ) . '</span>',
 
 
 
 
29
  ),
30
- ),
31
- ) );
32
  ?>
33
 
34
  <div class="sui-box-settings-row">
@@ -40,32 +44,37 @@ $this->_render( 'toggle-group', array(
40
  </div>
41
 
42
  <div class="sui-box-settings-col-2">
43
- <?php foreach ( $plugin_modules as $plugin_module ) {
44
- $this->_render( 'toggle-item', $plugin_module );
45
- } ?>
 
 
46
  </div>
47
  </div>
48
 
49
  <?php
50
- $this->_render( 'toggle-group', array(
51
- 'label' => __( 'Meta Tags', 'wds' ),
52
- 'description' => __( 'Choose what SmartCrawl modules you want available to use.', 'wds' ),
53
- 'separator' => true,
54
- 'items' => array(
55
- 'general-suppress-generator' => array(
56
- 'label' => __( 'Hide generator meta tag', 'wds' ),
57
- 'description' => __( 'It can be considered a security risk to have your WordPress version visible to the public, so we recommend you hide it.', 'wds' ),
 
 
 
 
 
 
 
 
 
 
 
58
  ),
59
- 'general-suppress-redundant_canonical' => array(
60
- 'label' => __( 'Hide redundant canonical link tags', 'wds' ),
61
- 'description' => __( 'WordPress automatically generates a canonical tag for your website, but in many cases this isn’t needed so you can turn it off to avoid any potential SEO ‘duplicate content’ backlash from search engines.', 'wds' ),
62
- ),
63
- 'metabox-lax_enforcement' => array(
64
- 'label' => __( 'Enforce meta tag character limits', 'wds' ),
65
- 'description' => __( 'Each meta tag type has recommended maximum characters lengths to follow. Turning this off will remove the enforcement preventing you from adding too many characters.', 'wds' ),
66
- ),
67
- ),
68
- ) );
69
  ?>
70
 
71
  <div class="sui-box-settings-row wds-verification-tags">
@@ -78,49 +87,61 @@ $this->_render( 'toggle-group', array(
78
  <?php
79
  $value = isset( $sitemap_options['verification-google-meta'] ) ? $sitemap_options['verification-google-meta'] : '';
80
  ?>
81
- <label for="verification-google"
82
- class="sui-settings-label"><?php esc_html_e( 'Google Verification', 'wds' ); ?></label>
 
 
83
  <div class="sui-description">
84
  <?php esc_html_e( 'Paste the full meta tag from Google.', 'wds' ); ?>
85
  </div>
86
- <input id='verification-google'
87
- name='<?php echo esc_attr( $_view['option_name'] ); ?>[verification-google-meta]'
88
- type='text'
89
- placeholder="<?php echo esc_attr( 'E.g. <meta name="google-site-verification" content="...' ); ?>"
90
- class='sui-form-control'
91
- value='<?php echo esc_attr( $value ); ?>'>
 
 
92
  </div>
93
 
94
  <div class="sui-form-field">
95
  <?php
96
  $value = isset( $sitemap_options['verification-bing-meta'] ) ? $sitemap_options['verification-bing-meta'] : '';
97
  ?>
98
- <label for="verification-bing"
99
- class="sui-settings-label"><?php esc_html_e( 'Bing Verification', 'wds' ); ?></label>
 
 
100
  <div class="sui-description">
101
  <?php esc_html_e( 'Paste the full meta tag from Bing.', 'wds' ); ?>
102
  </div>
103
- <input id='verification-bing'
104
- name='<?php echo esc_attr( $_view['option_name'] ); ?>[verification-bing-meta]'
105
- type='text'
106
- class='sui-form-control'
107
- placeholder="<?php echo esc_attr( 'E.g. <meta name="msvalidate.01" content="...' ); ?>"
108
- value='<?php echo esc_attr( $value ); ?>'>
 
 
109
  </div>
110
 
111
  <div class="sui-form-field">
112
- <label for="verification-pages"
113
- class="sui-settings-label"><?php esc_html_e( 'Add verification code to', 'wds' ); ?></label>
114
- <select id="verification-pages"
115
- data-minimum-results-for-search="-1"
116
- name="<?php echo esc_attr( $_view['option_name'] ); ?>[verification-pages]"
117
- class="sui-select">
 
 
 
 
118
  <?php foreach ( $verification_pages as $item => $label ) : ?>
119
  <?php
120
  $selected = isset( $sitemap_options['verification-pages'] ) && $sitemap_options['verification-pages'] === $item ? 'selected' : '';
121
  ?>
122
  <option
123
- value="<?php echo esc_attr( $item ); ?>"
124
  <?php echo esc_attr( $selected ); ?>>
125
  <?php echo esc_html( $label ); ?>
126
  </option>
@@ -130,24 +151,31 @@ $this->_render( 'toggle-group', array(
130
 
131
  <div class="sui-form-field">
132
  <div class="wds-custom-meta-tags">
133
- <label for="verification-google"
134
- class="sui-settings-label"><?php esc_html_e( 'Custom meta tags', 'wds' ); ?></label>
 
 
135
  <span class="sui-description"><?php esc_html_e( 'Have more meta tags you want to add? Add as many as you like.', 'wds' ); ?></span>
136
 
137
  <?php if ( ! empty( $sitemap_options['additional-metas'] ) && is_array( $sitemap_options['additional-metas'] ) ) : ?>
138
  <?php
139
  foreach ( $sitemap_options['additional-metas'] as $custom_value ) {
140
- $this->_render( 'settings/settings-custom-meta-tag', array(
141
- 'value' => $custom_value,
142
- ) );
 
 
 
143
  }
144
  ?>
145
  <?php endif; ?>
146
 
147
- <?php $this->_render( 'settings/settings-custom-meta-tag' ); ?>
148
 
149
- <button type="button"
150
- class="sui-button sui-button-ghost">
 
 
151
  <span class="sui-icon-plus" aria-hidden="true"></span>
152
 
153
  <?php esc_html_e( 'Add Another', 'wds' ); ?>
6
  */
7
 
8
  $sitemap_option_name = empty( $sitemap_option_name ) ? '' : $sitemap_option_name;
9
+ $verification_pages = empty( $verification_pages ) ? array() : $verification_pages;
10
+ $smartcrawl_options = Smartcrawl_Settings::get_options();
11
+ $sitemap_options = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SITEMAP );
12
+ $plugin_modules = empty( $plugin_modules ) ? array() : $plugin_modules;
13
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
14
 
15
+ $this->render_view( 'settings/settings-analysis' );
16
 
17
+ $this->render_view(
18
+ 'toggle-group',
19
+ array(
20
+ 'label' => esc_html__( 'Admin Bar', 'wds' ),
21
+ 'description' => esc_html__( 'Add a shortcut to SmartCrawl settings in the top WordPress Admin bar.', 'wds' ),
22
+ 'separator' => true,
23
+ 'items' => array(
24
+ 'extras-admin_bar' => array(
25
+ 'label' => esc_html__( 'Enable SmartCrawl shortcut', 'wds' ),
26
+ 'html_description' =>
27
+ '<span class="sui-description">' . smartcrawl_format_link(
28
+ esc_html__( 'Note: Only user roles defined in the %s tab will be able to see this.', 'wds' ),
29
+ Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SETTINGS ) . '&tab=tab_user_roles',
30
+ esc_html__( 'User Roles', 'wds' )
31
+ ) . '</span>',
32
+ ),
33
  ),
34
+ )
35
+ );
36
  ?>
37
 
38
  <div class="sui-box-settings-row">
44
  </div>
45
 
46
  <div class="sui-box-settings-col-2">
47
+ <?php
48
+ foreach ( $plugin_modules as $plugin_module ) {
49
+ $this->render_view( 'toggle-item', $plugin_module );
50
+ }
51
+ ?>
52
  </div>
53
  </div>
54
 
55
  <?php
56
+ $this->render_view(
57
+ 'toggle-group',
58
+ array(
59
+ 'label' => __( 'Meta Tags', 'wds' ),
60
+ 'description' => __( 'Choose what SmartCrawl modules you want available to use.', 'wds' ),
61
+ 'separator' => true,
62
+ 'items' => array(
63
+ 'general-suppress-generator' => array(
64
+ 'label' => __( 'Hide generator meta tag', 'wds' ),
65
+ 'description' => __( 'It can be considered a security risk to have your WordPress version visible to the public, so we recommend you hide it.', 'wds' ),
66
+ ),
67
+ 'general-suppress-redundant_canonical' => array(
68
+ 'label' => __( 'Hide redundant canonical link tags', 'wds' ),
69
+ 'description' => __( 'WordPress automatically generates a canonical tag for your website, but in many cases this isn’t needed so you can turn it off to avoid any potential SEO ‘duplicate content’ backlash from search engines.', 'wds' ),
70
+ ),
71
+ 'metabox-lax_enforcement' => array(
72
+ 'label' => __( 'Enforce meta tag character limits', 'wds' ),
73
+ 'description' => __( 'Each meta tag type has recommended maximum characters lengths to follow. Turning this off will remove the enforcement preventing you from adding too many characters.', 'wds' ),
74
+ ),
75
  ),
76
+ )
77
+ );
 
 
 
 
 
 
 
 
78
  ?>
79
 
80
  <div class="sui-box-settings-row wds-verification-tags">
87
  <?php
88
  $value = isset( $sitemap_options['verification-google-meta'] ) ? $sitemap_options['verification-google-meta'] : '';
89
  ?>
90
+ <label
91
+ for="verification-google"
92
+ class="sui-settings-label"
93
+ ><?php esc_html_e( 'Google Verification', 'wds' ); ?></label>
94
  <div class="sui-description">
95
  <?php esc_html_e( 'Paste the full meta tag from Google.', 'wds' ); ?>
96
  </div>
97
+ <input
98
+ id='verification-google'
99
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[verification-google-meta]'
100
+ type='text'
101
+ placeholder="<?php echo esc_attr( 'E.g. <meta name="google-site-verification" content="...' ); ?>"
102
+ class='sui-form-control'
103
+ value='<?php echo esc_attr( $value ); ?>'
104
+ >
105
  </div>
106
 
107
  <div class="sui-form-field">
108
  <?php
109
  $value = isset( $sitemap_options['verification-bing-meta'] ) ? $sitemap_options['verification-bing-meta'] : '';
110
  ?>
111
+ <label
112
+ for="verification-bing"
113
+ class="sui-settings-label"
114
+ ><?php esc_html_e( 'Bing Verification', 'wds' ); ?></label>
115
  <div class="sui-description">
116
  <?php esc_html_e( 'Paste the full meta tag from Bing.', 'wds' ); ?>
117
  </div>
118
+ <input
119
+ id='verification-bing'
120
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[verification-bing-meta]'
121
+ type='text'
122
+ class='sui-form-control'
123
+ placeholder="<?php echo esc_attr( 'E.g. <meta name="msvalidate.01" content="...' ); ?>"
124
+ value='<?php echo esc_attr( $value ); ?>'
125
+ >
126
  </div>
127
 
128
  <div class="sui-form-field">
129
+ <label
130
+ for="verification-pages"
131
+ class="sui-settings-label"
132
+ ><?php esc_html_e( 'Add verification code to', 'wds' ); ?></label>
133
+ <select
134
+ id="verification-pages"
135
+ data-minimum-results-for-search="-1"
136
+ name="<?php echo esc_attr( $_view['option_name'] ); ?>[verification-pages]"
137
+ class="sui-select"
138
+ >
139
  <?php foreach ( $verification_pages as $item => $label ) : ?>
140
  <?php
141
  $selected = isset( $sitemap_options['verification-pages'] ) && $sitemap_options['verification-pages'] === $item ? 'selected' : '';
142
  ?>
143
  <option
144
+ value="<?php echo esc_attr( $item ); ?>"
145
  <?php echo esc_attr( $selected ); ?>>
146
  <?php echo esc_html( $label ); ?>
147
  </option>
151
 
152
  <div class="sui-form-field">
153
  <div class="wds-custom-meta-tags">
154
+ <label
155
+ for="verification-google"
156
+ class="sui-settings-label"
157
+ ><?php esc_html_e( 'Custom meta tags', 'wds' ); ?></label>
158
  <span class="sui-description"><?php esc_html_e( 'Have more meta tags you want to add? Add as many as you like.', 'wds' ); ?></span>
159
 
160
  <?php if ( ! empty( $sitemap_options['additional-metas'] ) && is_array( $sitemap_options['additional-metas'] ) ) : ?>
161
  <?php
162
  foreach ( $sitemap_options['additional-metas'] as $custom_value ) {
163
+ $this->render_view(
164
+ 'settings/settings-custom-meta-tag',
165
+ array(
166
+ 'value' => $custom_value,
167
+ )
168
+ );
169
  }
170
  ?>
171
  <?php endif; ?>
172
 
173
+ <?php $this->render_view( 'settings/settings-custom-meta-tag' ); ?>
174
 
175
+ <button
176
+ type="button"
177
+ class="sui-button sui-button-ghost"
178
+ >
179
  <span class="sui-icon-plus" aria-hidden="true"></span>
180
 
181
  <?php esc_html_e( 'Add Another', 'wds' ); ?>
includes/admin/templates/settings/settings-section-user-roles.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
- $seo_metabox_permission_level = empty( $seo_metabox_permission_level ) ? array() : $seo_metabox_permission_level;
3
- $seo_metabox_301_permission_level = empty( $seo_metabox_301_permission_level ) ? array() : $seo_metabox_301_permission_level;
4
  $urlmetrics_metabox_permission_level = empty( $urlmetrics_metabox_permission_level ) ? array() : $urlmetrics_metabox_permission_level;
5
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
6
  ?>
7
  <div class="sui-box-settings-row">
8
  <div class="sui-box-settings-col-1">
@@ -10,67 +10,79 @@ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
10
  </div>
11
  <div class="sui-box-settings-col-2">
12
 
13
- <label for="seo_metabox_permission_level"
14
- class="sui-settings-label"><?php esc_html_e( 'In page SEO meta box', 'wds' ); ?></label>
 
 
15
  <span class="sui-description"><?php esc_html_e( 'Choose what user level you want to be able to edit individual post and page meta tags.', 'wds' ); ?></span>
16
 
17
- <select id="seo_metabox_permission_level"
18
- name="<?php echo esc_attr( $option_name ); ?>[seo_metabox_permission_level][]"
19
- class="sui-select"
20
- data-minimum-results-for-search="-1">
 
 
21
  <?php foreach ( $seo_metabox_permission_level as $item => $label ) : ?>
22
  <?php
23
  $selected = ! empty( $_view['options']['seo_metabox_permission_level'] ) && is_array( $_view['options']['seo_metabox_permission_level'] )
24
- ? ( in_array( $item, $_view['options']['seo_metabox_permission_level'], true ) ? "selected" : '' ) // New
25
- : ( $_view['options']['seo_metabox_permission_level'] === $item ? "selected" : '' );
26
  ?>
27
  <option
28
  <?php echo esc_attr( $selected ); ?>
29
- value="<?php echo esc_attr( $item ); ?>">
30
  <?php echo esc_html( $label ); ?>
31
  </option>
32
  <?php endforeach; ?>
33
  </select>
34
 
35
- <label for="seo_metabox_301_permission_level"
36
- class="sui-settings-label"><?php esc_html_e( '301 Redirections', 'wds' ); ?></label>
 
 
37
  <span class="sui-description"><?php esc_html_e( 'Choose what user level has the ability to add 301 redirects to individual posts and pages.', 'wds' ); ?></span>
38
 
39
- <select id="seo_metabox_301_permission_level"
40
- name="<?php echo esc_attr( $option_name ); ?>[seo_metabox_301_permission_level][]"
41
- class="sui-select"
42
- data-minimum-results-for-search="-1">
 
 
43
  <?php foreach ( $seo_metabox_301_permission_level as $item => $label ) { ?>
44
  <?php
45
  $selected = ! empty( $_view['options']['seo_metabox_301_permission_level'] ) && is_array( $_view['options']['seo_metabox_301_permission_level'] )
46
- ? ( in_array( $item, $_view['options']['seo_metabox_301_permission_level'], true ) ? "selected" : '' ) // New
47
- : ( $_view['options']['seo_metabox_301_permission_level'] === $item ? "selected" : '' );
48
  ?>
49
  <option
50
  <?php echo esc_attr( $selected ); ?>
51
- value="<?php echo esc_attr( $item ); ?>">
52
  <?php echo esc_html( $label ); ?>
53
  </option>
54
  <?php } ?>
55
  </select>
56
 
57
- <label for="urlmetrics_metabox_permission_level"
58
- class="sui-settings-label"><?php esc_html_e( 'Show Moz data to roles', 'wds' ); ?></label>
 
 
59
  <span class="sui-description"><?php esc_html_e( 'Choose what user level gets to view the Moz data.', 'wds' ); ?></span>
60
 
61
- <select id="urlmetrics_metabox_permission_level"
62
- name="<?php echo esc_attr( $option_name ); ?>[urlmetrics_metabox_permission_level][]"
63
- class="sui-select"
64
- data-minimum-results-for-search="-1">
 
 
65
  <?php foreach ( $urlmetrics_metabox_permission_level as $item => $label ) : ?>
66
  <?php
67
  $selected = ! empty( $_view['options']['urlmetrics_metabox_permission_level'] ) && is_array( $_view['options']['urlmetrics_metabox_permission_level'] )
68
- ? ( in_array( $item, $_view['options']['urlmetrics_metabox_permission_level'], true ) ? "selected" : '' ) // New
69
- : ( $_view['options']['urlmetrics_metabox_permission_level'] === $item ? "selected" : '' );
70
  ?>
71
  <option
72
  <?php echo esc_attr( $selected ); ?>
73
- value="<?php echo esc_attr( $item ); ?>">
74
  <?php echo esc_html( $label ); ?>
75
  </option>
76
  <?php endforeach; ?>
1
  <?php
2
+ $seo_metabox_permission_level = empty( $seo_metabox_permission_level ) ? array() : $seo_metabox_permission_level;
3
+ $seo_metabox_301_permission_level = empty( $seo_metabox_301_permission_level ) ? array() : $seo_metabox_301_permission_level;
4
  $urlmetrics_metabox_permission_level = empty( $urlmetrics_metabox_permission_level ) ? array() : $urlmetrics_metabox_permission_level;
5
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
6
  ?>
7
  <div class="sui-box-settings-row">
8
  <div class="sui-box-settings-col-1">
10
  </div>
11
  <div class="sui-box-settings-col-2">
12
 
13
+ <label
14
+ for="seo_metabox_permission_level"
15
+ class="sui-settings-label"
16
+ ><?php esc_html_e( 'In page SEO meta box', 'wds' ); ?></label>
17
  <span class="sui-description"><?php esc_html_e( 'Choose what user level you want to be able to edit individual post and page meta tags.', 'wds' ); ?></span>
18
 
19
+ <select
20
+ id="seo_metabox_permission_level"
21
+ name="<?php echo esc_attr( $option_name ); ?>[seo_metabox_permission_level][]"
22
+ class="sui-select"
23
+ data-minimum-results-for-search="-1"
24
+ >
25
  <?php foreach ( $seo_metabox_permission_level as $item => $label ) : ?>
26
  <?php
27
  $selected = ! empty( $_view['options']['seo_metabox_permission_level'] ) && is_array( $_view['options']['seo_metabox_permission_level'] )
28
+ ? ( in_array( $item, $_view['options']['seo_metabox_permission_level'], true ) ? 'selected' : '' ) // New.
29
+ : ( $_view['options']['seo_metabox_permission_level'] === $item ? 'selected' : '' );
30
  ?>
31
  <option
32
  <?php echo esc_attr( $selected ); ?>
33
+ value="<?php echo esc_attr( $item ); ?>">
34
  <?php echo esc_html( $label ); ?>
35
  </option>
36
  <?php endforeach; ?>
37
  </select>
38
 
39
+ <label
40
+ for="seo_metabox_301_permission_level"
41
+ class="sui-settings-label"
42
+ ><?php esc_html_e( '301 Redirections', 'wds' ); ?></label>
43
  <span class="sui-description"><?php esc_html_e( 'Choose what user level has the ability to add 301 redirects to individual posts and pages.', 'wds' ); ?></span>
44
 
45
+ <select
46
+ id="seo_metabox_301_permission_level"
47
+ name="<?php echo esc_attr( $option_name ); ?>[seo_metabox_301_permission_level][]"
48
+ class="sui-select"
49
+ data-minimum-results-for-search="-1"
50
+ >
51
  <?php foreach ( $seo_metabox_301_permission_level as $item => $label ) { ?>
52
  <?php
53
  $selected = ! empty( $_view['options']['seo_metabox_301_permission_level'] ) && is_array( $_view['options']['seo_metabox_301_permission_level'] )
54
+ ? ( in_array( $item, $_view['options']['seo_metabox_301_permission_level'], true ) ? 'selected' : '' ) // New.
55
+ : ( $_view['options']['seo_metabox_301_permission_level'] === $item ? 'selected' : '' );
56
  ?>
57
  <option
58
  <?php echo esc_attr( $selected ); ?>
59
+ value="<?php echo esc_attr( $item ); ?>">
60
  <?php echo esc_html( $label ); ?>
61
  </option>
62
  <?php } ?>
63
  </select>
64
 
65
+ <label
66
+ for="urlmetrics_metabox_permission_level"
67
+ class="sui-settings-label"
68
+ ><?php esc_html_e( 'Show Moz data to roles', 'wds' ); ?></label>
69
  <span class="sui-description"><?php esc_html_e( 'Choose what user level gets to view the Moz data.', 'wds' ); ?></span>
70
 
71
+ <select
72
+ id="urlmetrics_metabox_permission_level"
73
+ name="<?php echo esc_attr( $option_name ); ?>[urlmetrics_metabox_permission_level][]"
74
+ class="sui-select"
75
+ data-minimum-results-for-search="-1"
76
+ >
77
  <?php foreach ( $urlmetrics_metabox_permission_level as $item => $label ) : ?>
78
  <?php
79
  $selected = ! empty( $_view['options']['urlmetrics_metabox_permission_level'] ) && is_array( $_view['options']['urlmetrics_metabox_permission_level'] )
80
+ ? ( in_array( $item, $_view['options']['urlmetrics_metabox_permission_level'], true ) ? 'selected' : '' ) // New.
81
+ : ( $_view['options']['urlmetrics_metabox_permission_level'] === $item ? 'selected' : '' );
82
  ?>
83
  <option
84
  <?php echo esc_attr( $selected ); ?>
85
+ value="<?php echo esc_attr( $item ); ?>">
86
  <?php echo esc_html( $label ); ?>
87
  </option>
88
  <?php endforeach; ?>
includes/admin/templates/settings/settings-sidenav.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  $show_data_settings = empty( $show_data_settings ) ? false : $show_data_settings;
3
- $active_tab = empty( $active_tab ) ? '' : $active_tab;
4
- $configs_available = empty( $configs_available ) ? false : $configs_available;
5
- $import_available = empty( $import_available ) ? false : $import_available;
6
 
7
- $tabs = array_merge(
8
  array(
9
  array(
10
  'id' => 'tab_general_settings',
@@ -43,7 +43,10 @@ $tabs = array_merge(
43
  )
44
  );
45
 
46
- $this->_render( 'vertical-tabs-side-nav', array(
47
- 'active_tab' => $active_tab,
48
- 'tabs' => $tabs,
49
- ) );
 
 
 
1
  <?php
2
  $show_data_settings = empty( $show_data_settings ) ? false : $show_data_settings;
3
+ $active_tab = empty( $active_tab ) ? '' : $active_tab;
4
+ $configs_available = empty( $configs_available ) ? false : $configs_available;
5
+ $import_available = empty( $import_available ) ? false : $import_available;
6
 
7
+ $tab_items = array_merge(
8
  array(
9
  array(
10
  'id' => 'tab_general_settings',
43
  )
44
  );
45
 
46
+ $this->render_view(
47
+ 'vertical-tabs-side-nav',
48
+ array(
49
+ 'active_tab' => $active_tab,
50
+ 'tabs' => $tab_items,
51
+ )
52
+ );
includes/admin/templates/settings/settings.php CHANGED
@@ -1,138 +1,177 @@
1
  <?php
2
- $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
- $import_available = is_main_site();
4
  $show_data_settings = is_main_site();
5
- $configs_available = is_main_site();
6
 
7
- $this->_render( 'before-page-container' );
8
  ?>
9
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-settings' ); ?>">
10
 
11
- <?php $this->_render( 'page-header', array(
12
- 'title' => esc_html__( 'SmartCrawl Settings', 'wds' ),
13
- 'documentation_chapter' => 'settings',
14
- 'utm_campaign' => 'smartcrawl_settings_docs',
15
- ) ); ?>
 
 
 
 
 
16
 
17
- <?php $this->_render( 'floating-notices', array(
18
- 'keys' => array(
19
- 'wds-data-reset',
20
- 'wds-config-notice',
21
- ),
22
- ) ); ?>
23
- <?php $this->_render( 'settings/settings-import-notice' ); ?>
 
 
 
 
 
24
 
25
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
26
- <?php $this->_render( 'settings/settings-sidenav', array(
27
- 'active_tab' => $active_tab,
28
- 'show_data_settings' => $show_data_settings,
29
- 'configs_available' => $configs_available,
30
- 'import_available' => $import_available,
31
- ) ); ?>
 
 
 
 
 
32
 
33
  <form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
34
  <?php $this->settings_fields( $_view['option_name'] ); ?>
35
 
36
- <input type="hidden"
37
- name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
38
- value="1"/>
 
 
39
 
40
  <?php
41
- $this->_render( 'vertical-tab', array(
42
- 'tab_id' => 'tab_general_settings',
43
- 'tab_name' => __( 'General Settings', 'wds' ),
44
- 'is_active' => 'tab_general_settings' === $active_tab,
45
- 'tab_sections' => array(
46
- array(
47
- 'section_template' => 'settings/settings-section-general',
48
- 'section_args' => array(
49
- 'verification_pages' => $verification_pages,
50
- 'sitemap_option_name' => $sitemap_option_name,
51
- 'plugin_modules' => $plugin_modules,
 
 
 
52
  ),
53
  ),
54
- ),
55
- ) );
56
 
57
  if ( $configs_available ) {
58
- $this->_render( 'settings/settings-section-configs', array(
59
- 'is_active' => 'tab_configs' === $active_tab,
60
- ) );
 
 
 
61
  }
62
 
63
- $this->_render( 'vertical-tab', array(
64
- 'tab_id' => 'tab_user_roles',
65
- 'tab_name' => __( 'User Roles', 'wds' ),
66
- 'is_active' => 'tab_user_roles' === $active_tab,
67
- 'before_output' => $this->_load( '_forms/settings' ),
68
- 'after_output' => '</form>',
69
- 'tab_sections' => array(
70
- array(
71
- 'section_template' => 'settings/settings-section-user-roles',
72
- 'section_args' => array(
73
- 'seo_metabox_permission_level' => $seo_metabox_permission_level,
74
- 'seo_metabox_301_permission_level' => $seo_metabox_301_permission_level,
75
- 'urlmetrics_metabox_permission_level' => $urlmetrics_metabox_permission_level,
 
 
 
76
  ),
77
  ),
78
- ),
79
- ) );
80
  ?>
81
 
82
- <?php if ( $show_data_settings ): ?>
83
- <?php $this->_render( 'vertical-tab', array(
84
- 'tab_id' => 'tab_data',
85
- 'tab_name' => esc_html__( 'Data & Settings', 'wds' ),
86
- 'is_active' => 'tab_data' === $active_tab,
87
- 'tab_sections' => array(
88
- array(
89
- 'section_description' => esc_html__( 'Control what to do with your settings and data. Settings are each module’s configuration options, Data includes the stored information like logs, SEO audit results and other bits of information stored over time.', 'wds' ),
90
- 'section_template' => 'settings/settings-section-data',
91
- 'section_args' => array(),
 
 
 
 
92
  ),
93
- ),
94
- ) ); ?>
 
95
  <?php endif; ?>
96
 
97
  <?php
98
- $this->_render( 'vertical-tab', array(
99
- 'tab_id' => 'tab_accessibility',
100
- 'tab_name' => __( 'Accessibility', 'wds' ),
101
- 'is_active' => 'tab_accessibility' === $active_tab,
102
- 'tab_sections' => array(
103
- array(
104
- 'section_description' => esc_html__( 'Enable support for any accessibility enhancements available in the plugin interface.', 'wds' ),
105
- 'section_template' => 'settings/settings-section-accessibility',
106
- 'section_args' => array(),
 
 
 
107
  ),
108
- ),
109
- ) );
110
  ?>
111
  </form>
112
 
113
- <?php if ( $import_available ): ?>
114
  <form method='post' enctype="multipart/form-data" class="wds-form">
115
  <?php $this->settings_fields( $_view['option_name'] ); ?>
116
 
117
- <input type="hidden"
118
- name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
119
- value="1"/>
 
 
120
  <?php
121
- $this->_render( 'vertical-tab', array(
122
- 'tab_id' => 'tab_import_export',
123
- 'tab_name' => __( 'Import', 'wds' ),
124
- 'is_active' => 'tab_import_export' === $active_tab,
125
- 'button_text' => false,
126
- 'tab_sections' => array(
127
- array(
128
- 'section_template' => 'settings/settings-section-import-export',
 
 
 
129
  ),
130
- ),
131
- ) );
132
  ?>
133
  </form>
134
  <?php endif; ?>
135
  </div>
136
 
137
- <?php $this->_render( 'footer' ); ?>
138
  </div>
1
  <?php
2
+ $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
+ $import_available = is_main_site();
4
  $show_data_settings = is_main_site();
5
+ $configs_available = is_main_site();
6
 
7
+ $this->render_view( 'before-page-container' );
8
  ?>
9
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-settings' ); ?>">
10
 
11
+ <?php
12
+ $this->render_view(
13
+ 'page-header',
14
+ array(
15
+ 'title' => esc_html__( 'SmartCrawl Settings', 'wds' ),
16
+ 'documentation_chapter' => 'settings',
17
+ 'utm_campaign' => 'smartcrawl_settings_docs',
18
+ )
19
+ );
20
+ ?>
21
 
22
+ <?php
23
+ $this->render_view(
24
+ 'floating-notices',
25
+ array(
26
+ 'keys' => array(
27
+ 'wds-data-reset',
28
+ 'wds-config-notice',
29
+ ),
30
+ )
31
+ );
32
+ ?>
33
+ <?php $this->render_view( 'settings/settings-import-notice' ); ?>
34
 
35
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
36
+ <?php
37
+ $this->render_view(
38
+ 'settings/settings-sidenav',
39
+ array(
40
+ 'active_tab' => $active_tab,
41
+ 'show_data_settings' => $show_data_settings,
42
+ 'configs_available' => $configs_available,
43
+ 'import_available' => $import_available,
44
+ )
45
+ );
46
+ ?>
47
 
48
  <form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
49
  <?php $this->settings_fields( $_view['option_name'] ); ?>
50
 
51
+ <input
52
+ type="hidden"
53
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
54
+ value="1"
55
+ />
56
 
57
  <?php
58
+ $this->render_view(
59
+ 'vertical-tab',
60
+ array(
61
+ 'tab_id' => 'tab_general_settings',
62
+ 'tab_name' => __( 'General Settings', 'wds' ),
63
+ 'is_active' => 'tab_general_settings' === $active_tab,
64
+ 'tab_sections' => array(
65
+ array(
66
+ 'section_template' => 'settings/settings-section-general',
67
+ 'section_args' => array(
68
+ 'verification_pages' => $verification_pages,
69
+ 'sitemap_option_name' => $sitemap_option_name,
70
+ 'plugin_modules' => $plugin_modules,
71
+ ),
72
  ),
73
  ),
74
+ )
75
+ );
76
 
77
  if ( $configs_available ) {
78
+ $this->render_view(
79
+ 'settings/settings-section-configs',
80
+ array(
81
+ 'is_active' => 'tab_configs' === $active_tab,
82
+ )
83
+ );
84
  }
85
 
86
+ $this->render_view(
87
+ 'vertical-tab',
88
+ array(
89
+ 'tab_id' => 'tab_user_roles',
90
+ 'tab_name' => __( 'User Roles', 'wds' ),
91
+ 'is_active' => 'tab_user_roles' === $active_tab,
92
+ 'before_output' => $this->load_view( '_forms/settings' ),
93
+ 'after_output' => '</form>',
94
+ 'tab_sections' => array(
95
+ array(
96
+ 'section_template' => 'settings/settings-section-user-roles',
97
+ 'section_args' => array(
98
+ 'seo_metabox_permission_level' => $seo_metabox_permission_level,
99
+ 'seo_metabox_301_permission_level' => $seo_metabox_301_permission_level,
100
+ 'urlmetrics_metabox_permission_level' => $urlmetrics_metabox_permission_level,
101
+ ),
102
  ),
103
  ),
104
+ )
105
+ );
106
  ?>
107
 
108
+ <?php if ( $show_data_settings ) : ?>
109
+ <?php
110
+ $this->render_view(
111
+ 'vertical-tab',
112
+ array(
113
+ 'tab_id' => 'tab_data',
114
+ 'tab_name' => esc_html__( 'Data & Settings', 'wds' ),
115
+ 'is_active' => 'tab_data' === $active_tab,
116
+ 'tab_sections' => array(
117
+ array(
118
+ 'section_description' => esc_html__( 'Control what to do with your settings and data. Settings are each module’s configuration options, Data includes the stored information like logs, SEO audit results and other bits of information stored over time.', 'wds' ),
119
+ 'section_template' => 'settings/settings-section-data',
120
+ 'section_args' => array(),
121
+ ),
122
  ),
123
+ )
124
+ );
125
+ ?>
126
  <?php endif; ?>
127
 
128
  <?php
129
+ $this->render_view(
130
+ 'vertical-tab',
131
+ array(
132
+ 'tab_id' => 'tab_accessibility',
133
+ 'tab_name' => __( 'Accessibility', 'wds' ),
134
+ 'is_active' => 'tab_accessibility' === $active_tab,
135
+ 'tab_sections' => array(
136
+ array(
137
+ 'section_description' => esc_html__( 'Enable support for any accessibility enhancements available in the plugin interface.', 'wds' ),
138
+ 'section_template' => 'settings/settings-section-accessibility',
139
+ 'section_args' => array(),
140
+ ),
141
  ),
142
+ )
143
+ );
144
  ?>
145
  </form>
146
 
147
+ <?php if ( $import_available ) : ?>
148
  <form method='post' enctype="multipart/form-data" class="wds-form">
149
  <?php $this->settings_fields( $_view['option_name'] ); ?>
150
 
151
+ <input
152
+ type="hidden"
153
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
154
+ value="1"
155
+ />
156
  <?php
157
+ $this->render_view(
158
+ 'vertical-tab',
159
+ array(
160
+ 'tab_id' => 'tab_import_export',
161
+ 'tab_name' => __( 'Import', 'wds' ),
162
+ 'is_active' => 'tab_import_export' === $active_tab,
163
+ 'button_text' => false,
164
+ 'tab_sections' => array(
165
+ array(
166
+ 'section_template' => 'settings/settings-section-import-export',
167
+ ),
168
  ),
169
+ )
170
+ );
171
  ?>
172
  </form>
173
  <?php endif; ?>
174
  </div>
175
 
176
+ <?php $this->render_view( 'footer' ); ?>
177
  </div>
includes/admin/templates/side-tabs.php CHANGED
@@ -1,15 +1,16 @@
1
  <?php
2
- $id = empty( $id ) ? '' : $id;
3
- $name = empty( $name ) ? '' : $name;
4
  $value = empty( $value ) ? '' : $value;
5
- $tabs = empty( $tabs ) || ! is_array( $tabs ) ? array() : $tabs;
6
  ?>
7
 
8
- <div id="<?php echo esc_attr( $id ); ?>"
9
- class="sui-side-tabs sui-tabs">
10
-
 
11
  <div data-tabs>
12
- <?php foreach ( $tabs as $tab ): ?>
13
  <?php
14
  $tab_value = smartcrawl_get_array_value( $tab, 'value' );
15
  $tab_label = smartcrawl_get_array_value( $tab, 'label' );
@@ -18,30 +19,33 @@ $tabs = empty( $tabs ) || ! is_array( $tabs ) ? array() : $tabs;
18
  <label class="<?php echo $value === $tab_value ? 'active' : ''; ?>">
19
  <?php echo esc_html( $tab_label ); ?>
20
 
21
- <input name="<?php echo esc_attr( $name ); ?>"
22
- value="<?php echo esc_attr( $tab_value ); ?>" <?php checked( $value === $tab_value ); ?>
23
- type="radio"
24
- class="hidden"
 
25
  />
26
  </label>
27
  <?php endforeach; ?>
28
  </div>
29
 
30
  <div data-panes>
31
- <?php foreach ( $tabs as $tab ): ?>
32
  <?php
33
- $tab_value = smartcrawl_get_array_value( $tab, 'value' );
34
- $tab_template = smartcrawl_get_array_value( $tab, 'template' );
35
  $tab_template_args = smartcrawl_get_array_value( $tab, 'template_args' );
36
  ?>
37
 
38
  <div class="sui-tab-boxed <?php echo $value === $tab_value ? 'active' : ''; ?>">
39
- <?php if ( $tab_template ) {
40
- $this->_render(
 
41
  $tab_template,
42
  empty( $tab_template_args ) ? array() : $tab_template_args
43
  );
44
- } ?>
 
45
  </div>
46
  <?php endforeach; ?>
47
  </div>
1
  <?php
2
+ $id = empty( $id ) ? '' : $id; // phpcs:ignore
3
+ $name = empty( $name ) ? '' : $name;
4
  $value = empty( $value ) ? '' : $value;
5
+ $tabs = empty( $tabs ) || ! is_array( $tabs ) ? array() : $tabs; // phpcs:ignore
6
  ?>
7
 
8
+ <div
9
+ id="<?php echo esc_attr( $id ); ?>"
10
+ class="sui-side-tabs sui-tabs"
11
+ >
12
  <div data-tabs>
13
+ <?php foreach ( $tabs as $tab ) : // phpcs:ignore ?>
14
  <?php
15
  $tab_value = smartcrawl_get_array_value( $tab, 'value' );
16
  $tab_label = smartcrawl_get_array_value( $tab, 'label' );
19
  <label class="<?php echo $value === $tab_value ? 'active' : ''; ?>">
20
  <?php echo esc_html( $tab_label ); ?>
21
 
22
+ <input
23
+ name="<?php echo esc_attr( $name ); ?>"
24
+ value="<?php echo esc_attr( $tab_value ); ?>" <?php checked( $value === $tab_value ); ?>
25
+ type="radio"
26
+ class="hidden"
27
  />
28
  </label>
29
  <?php endforeach; ?>
30
  </div>
31
 
32
  <div data-panes>
33
+ <?php foreach ( $tabs as $tab ) : // phpcs:ignore ?>
34
  <?php
35
+ $tab_value = smartcrawl_get_array_value( $tab, 'value' );
36
+ $tab_template = smartcrawl_get_array_value( $tab, 'template' );
37
  $tab_template_args = smartcrawl_get_array_value( $tab, 'template_args' );
38
  ?>
39
 
40
  <div class="sui-tab-boxed <?php echo $value === $tab_value ? 'active' : ''; ?>">
41
+ <?php
42
+ if ( $tab_template ) {
43
+ $this->render_view(
44
  $tab_template,
45
  empty( $tab_template_args ) ? array() : $tab_template_args
46
  );
47
+ }
48
+ ?>
49
  </div>
50
  <?php endforeach; ?>
51
  </div>
includes/admin/templates/sitemap/sitemap-buddypress-settings.php CHANGED
@@ -1,53 +1,71 @@
1
  <?php
2
- $groups_enabled = ! empty( $_view['options']['sitemap-buddypress-groups'] );
3
  $profiles_enabled = ! empty( $_view['options']['sitemap-buddypress-profiles'] );
4
 
5
- $this->_render( 'sitemap/sitemap-part', array(
6
- 'item' => 'sitemap-buddypress-groups',
7
- 'item_name' => '',
8
- 'item_label' => esc_html__( 'BuddyPress Groups', 'wds' ),
9
- 'option_name' => $_view['option_name'] . '[sitemap-buddypress-groups]',
10
- 'class' => 'wds-sitemap-toggleable wds-sitemap-buddypress-groups',
11
- ) ); ?>
 
 
 
12
 
13
  <tr>
14
  <td colspan="3" class="wds-nested-sitemap-parts">
15
  <table class="sui-table wds-sitemap-parts">
16
- <?php if ( ! empty( $exclude_groups ) ) {
 
17
  foreach ( $exclude_groups as $exclude_bp_group => $exclude_bp_group_label ) {
18
- $this->_render( 'sitemap/sitemap-part', array(
19
- 'item' => 'sitemap-buddypress-' . $exclude_bp_group,
20
- 'item_name' => '',
21
- 'item_label' => $exclude_bp_group_label,
22
- 'inverted' => true,
23
- ) );
 
 
 
24
  }
25
- } ?>
 
26
  </table>
27
  </td>
28
  </tr>
29
 
30
- <?php $this->_render( 'sitemap/sitemap-part', array(
31
- 'item' => 'sitemap-buddypress-profiles',
32
- 'item_name' => '',
33
- 'item_label' => esc_html__( 'BuddyPress Profiles', 'wds' ),
34
- 'option_name' => $_view['option_name'] . '[sitemap-buddypress-profiles]',
35
- 'class' => 'wds-sitemap-toggleable wds-sitemap-buddypress-profiles',
36
- ) ); ?>
 
 
 
 
 
37
 
38
  <tr>
39
  <td colspan="3" class="wds-nested-sitemap-parts">
40
  <table class="sui-table wds-sitemap-parts">
41
- <?php if ( ! empty( $exclude_roles ) ) {
 
42
  foreach ( $exclude_roles as $exclude_bp_role => $exclude_bp_role_label ) {
43
- $this->_render( 'sitemap/sitemap-part', array(
44
- 'item' => 'sitemap-buddypress-roles-' . $exclude_bp_role,
45
- 'item_name' => '',
46
- 'item_label' => $exclude_bp_role_label,
47
- 'inverted' => true,
48
- ) );
 
 
 
49
  }
50
- } ?>
 
51
  </table>
52
  </td>
53
  </tr>
1
  <?php
2
+ $groups_enabled = ! empty( $_view['options']['sitemap-buddypress-groups'] );
3
  $profiles_enabled = ! empty( $_view['options']['sitemap-buddypress-profiles'] );
4
 
5
+ $this->render_view(
6
+ 'sitemap/sitemap-part',
7
+ array(
8
+ 'item' => 'sitemap-buddypress-groups',
9
+ 'item_name' => '',
10
+ 'item_label' => esc_html__( 'BuddyPress Groups', 'wds' ),
11
+ 'option_name' => $_view['option_name'] . '[sitemap-buddypress-groups]',
12
+ 'class' => 'wds-sitemap-toggleable wds-sitemap-buddypress-groups',
13
+ )
14
+ ); ?>
15
 
16
  <tr>
17
  <td colspan="3" class="wds-nested-sitemap-parts">
18
  <table class="sui-table wds-sitemap-parts">
19
+ <?php
20
+ if ( ! empty( $exclude_groups ) ) {
21
  foreach ( $exclude_groups as $exclude_bp_group => $exclude_bp_group_label ) {
22
+ $this->render_view(
23
+ 'sitemap/sitemap-part',
24
+ array(
25
+ 'item' => 'sitemap-buddypress-' . $exclude_bp_group,
26
+ 'item_name' => '',
27
+ 'item_label' => $exclude_bp_group_label,
28
+ 'inverted' => true,
29
+ )
30
+ );
31
  }
32
+ }
33
+ ?>
34
  </table>
35
  </td>
36
  </tr>
37
 
38
+ <?php
39
+ $this->render_view(
40
+ 'sitemap/sitemap-part',
41
+ array(
42
+ 'item' => 'sitemap-buddypress-profiles',
43
+ 'item_name' => '',
44
+ 'item_label' => esc_html__( 'BuddyPress Profiles', 'wds' ),
45
+ 'option_name' => $_view['option_name'] . '[sitemap-buddypress-profiles]',
46
+ 'class' => 'wds-sitemap-toggleable wds-sitemap-buddypress-profiles',
47
+ )
48
+ );
49
+ ?>
50
 
51
  <tr>
52
  <td colspan="3" class="wds-nested-sitemap-parts">
53
  <table class="sui-table wds-sitemap-parts">
54
+ <?php
55
+ if ( ! empty( $exclude_roles ) ) {
56
  foreach ( $exclude_roles as $exclude_bp_role => $exclude_bp_role_label ) {
57
+ $this->render_view(
58
+ 'sitemap/sitemap-part',
59
+ array(
60
+ 'item' => 'sitemap-buddypress-roles-' . $exclude_bp_role,
61
+ 'item_name' => '',
62
+ 'item_label' => $exclude_bp_role_label,
63
+ 'inverted' => true,
64
+ )
65
+ );
66
  }
67
+ }
68
+ ?>
69
  </table>
70
  </td>
71
  </tr>
includes/admin/templates/sitemap/sitemap-common-settings.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
- $post_types = empty( $post_types ) ? array() : $post_types;
3
- $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
4
  $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
5
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
6
- $extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
7
- $ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
8
- $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
9
  ?>
10
  <div class="sui-box-settings-row">
11
  <div class="sui-box-settings-col-1">
@@ -24,31 +24,37 @@ $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
24
  </thead>
25
 
26
  <tbody>
27
- <?php foreach ( $post_types as $item => $post_type ) : ?>
28
  <?php
29
- $this->_render( 'sitemap/sitemap-part', array(
30
- 'item' => $item,
31
- 'item_name' => $post_type->name,
32
- 'item_label' => $post_type->label,
33
- 'inverted' => true,
34
- ) );
 
 
 
35
  ?>
36
  <?php endforeach; ?>
37
 
38
- <?php foreach ( $taxonomies as $item => $taxonomy ) : ?>
39
  <?php
40
- $this->_render( 'sitemap/sitemap-part', array(
41
- 'item' => $item,
42
- 'item_name' => $taxonomy->name,
43
- 'item_label' => $taxonomy->label,
44
- 'inverted' => true,
45
- ) );
 
 
 
46
  ?>
47
  <?php endforeach; ?>
48
 
49
  <?php
50
  if ( $smartcrawl_buddypress ) {
51
- $this->_render( 'sitemap/sitemap-buddypress-settings', $smartcrawl_buddypress );
52
  }
53
  ?>
54
  </tbody>
@@ -58,17 +64,21 @@ $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
58
 
59
  <div class="sui-box-settings-row">
60
  <div class="sui-box-settings-col-1">
61
- <label for="extra-sitemap-urls"
62
- class="sui-settings-label"><?php esc_html_e( 'Inclusions', 'wds' ); ?></label>
 
 
63
  <p class="sui-description">
64
- <?php esc_html_e( "Enter any additional URLs that aren’t part of your default pages, posts or custom post types that you wish to be included in the sitemap.", 'wds' ); ?>
65
  </p>
66
  </div>
67
 
68
  <div class="sui-box-settings-col-2">
69
- <textarea id="extra-sitemap-urls"
70
- class="sui-form-control"
71
- name="<?php echo esc_attr( $option_name ); ?>[extra_sitemap_urls]"><?php echo esc_textarea( $extra_urls ); ?></textarea>
 
 
72
  <p class="sui-description">
73
  <?php esc_html_e( 'Enter one URL per line', 'wds' ); ?>
74
  </p>
@@ -77,8 +87,10 @@ $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
77
 
78
  <div class="sui-box-settings-row">
79
  <div class="sui-box-settings-col-1">
80
- <label for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
81
- class="sui-settings-label"><?php esc_html_e( 'Exclusions', 'wds' ); ?></label>
 
 
82
  <p class="sui-description">
83
  <?php esc_html_e( 'If you have custom URLs you want explicitly excluded from your Sitemap you can do this here.', 'wds' ); ?>
84
  </p>
@@ -86,32 +98,40 @@ $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
86
 
87
  <div class="sui-box-settings-col-2">
88
  <div>
89
- <label for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
90
- class="sui-settings-label"><?php esc_html_e( 'Posts', 'wds' ); ?></label>
 
 
91
  <p class="sui-description">
92
  <?php esc_html_e( 'Enter any particular post IDs you wish to exclude from your sitemap. Note, you can also exclude posts and pages from the post editor page.', 'wds' ); ?>
93
  </p>
94
- <input type="text" id="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
95
- placeholder="<?php echo esc_attr__( 'e.g. 1,5,6,99', 'wds' ); ?>"
96
- name="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
97
- class="sui-form-control"
98
- value="<?php echo esc_attr( $ignore_post_ids ); ?>"/>
 
 
99
  <p class="sui-description">
100
  <?php esc_html_e( 'Enter post IDs separated by commas.', 'wds' ); ?>
101
  </p>
102
  </div>
103
 
104
  <div class="wds-separator-top">
105
- <label for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
106
- class="sui-settings-label"><?php esc_html_e( 'Custom URLs', 'wds' ); ?></label>
 
 
107
  <p class="sui-description">
108
  <?php esc_html_e( 'Enter any custom URLs you want excluded permanently from the sitemap.', 'wds' ); ?>
109
  </p>
110
 
111
- <textarea id="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
112
- class="sui-form-control"
113
- placeholder="<?php echo esc_attr__( 'e.g. /excluded-url', 'wds' ); ?>"
114
- name="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"><?php echo esc_textarea( $ignore_urls ); ?></textarea>
 
 
115
  <p class="sui-description">
116
  <?php esc_html_e( 'Enter one URL per line', 'wds' ); ?>
117
  </p>
1
  <?php
2
+ $post_types = empty( $post_types ) ? array() : $post_types;
3
+ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
4
  $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
5
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
6
+ $extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
7
+ $ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
8
+ $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
9
  ?>
10
  <div class="sui-box-settings-row">
11
  <div class="sui-box-settings-col-1">
24
  </thead>
25
 
26
  <tbody>
27
+ <?php foreach ( $post_types as $item => $post_type ) : // phpcs:ignore ?>
28
  <?php
29
+ $this->render_view(
30
+ 'sitemap/sitemap-part',
31
+ array(
32
+ 'item' => $item,
33
+ 'item_name' => $post_type->name,
34
+ 'item_label' => $post_type->label,
35
+ 'inverted' => true,
36
+ )
37
+ );
38
  ?>
39
  <?php endforeach; ?>
40
 
41
+ <?php foreach ( $taxonomies as $item => $taxonomy ) : // phpcs:ignore ?>
42
  <?php
43
+ $this->render_view(
44
+ 'sitemap/sitemap-part',
45
+ array(
46
+ 'item' => $item,
47
+ 'item_name' => $taxonomy->name,
48
+ 'item_label' => $taxonomy->label,
49
+ 'inverted' => true,
50
+ )
51
+ );
52
  ?>
53
  <?php endforeach; ?>
54
 
55
  <?php
56
  if ( $smartcrawl_buddypress ) {
57
+ $this->render_view( 'sitemap/sitemap-buddypress-settings', $smartcrawl_buddypress );
58
  }
59
  ?>
60
  </tbody>
64
 
65
  <div class="sui-box-settings-row">
66
  <div class="sui-box-settings-col-1">
67
+ <label
68
+ for="extra-sitemap-urls"
69
+ class="sui-settings-label"
70
+ ><?php esc_html_e( 'Inclusions', 'wds' ); ?></label>
71
  <p class="sui-description">
72
+ <?php esc_html_e( 'Enter any additional URLs that aren’t part of your default pages, posts or custom post types that you wish to be included in the sitemap.', 'wds' ); ?>
73
  </p>
74
  </div>
75
 
76
  <div class="sui-box-settings-col-2">
77
+ <textarea
78
+ id="extra-sitemap-urls"
79
+ class="sui-form-control"
80
+ name="<?php echo esc_attr( $option_name ); ?>[extra_sitemap_urls]"
81
+ ><?php echo esc_textarea( $extra_urls ); ?></textarea>
82
  <p class="sui-description">
83
  <?php esc_html_e( 'Enter one URL per line', 'wds' ); ?>
84
  </p>
87
 
88
  <div class="sui-box-settings-row">
89
  <div class="sui-box-settings-col-1">
90
+ <label
91
+ for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
92
+ class="sui-settings-label"
93
+ ><?php esc_html_e( 'Exclusions', 'wds' ); ?></label>
94
  <p class="sui-description">
95
  <?php esc_html_e( 'If you have custom URLs you want explicitly excluded from your Sitemap you can do this here.', 'wds' ); ?>
96
  </p>
98
 
99
  <div class="sui-box-settings-col-2">
100
  <div>
101
+ <label
102
+ for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
103
+ class="sui-settings-label"
104
+ ><?php esc_html_e( 'Posts', 'wds' ); ?></label>
105
  <p class="sui-description">
106
  <?php esc_html_e( 'Enter any particular post IDs you wish to exclude from your sitemap. Note, you can also exclude posts and pages from the post editor page.', 'wds' ); ?>
107
  </p>
108
+ <input
109
+ type="text" id="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
110
+ placeholder="<?php echo esc_attr__( 'e.g. 1,5,6,99', 'wds' ); ?>"
111
+ name="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
112
+ class="sui-form-control"
113
+ value="<?php echo esc_attr( $ignore_post_ids ); ?>"
114
+ />
115
  <p class="sui-description">
116
  <?php esc_html_e( 'Enter post IDs separated by commas.', 'wds' ); ?>
117
  </p>
118
  </div>
119
 
120
  <div class="wds-separator-top">
121
+ <label
122
+ for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
123
+ class="sui-settings-label"
124
+ ><?php esc_html_e( 'Custom URLs', 'wds' ); ?></label>
125
  <p class="sui-description">
126
  <?php esc_html_e( 'Enter any custom URLs you want excluded permanently from the sitemap.', 'wds' ); ?>
127
  </p>
128
 
129
+ <textarea
130
+ id="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
131
+ class="sui-form-control"
132
+ placeholder="<?php echo esc_attr__( 'e.g. /excluded-url', 'wds' ); ?>"
133
+ name="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
134
+ ><?php echo esc_textarea( $ignore_urls ); ?></textarea>
135
  <p class="sui-description">
136
  <?php esc_html_e( 'Enter one URL per line', 'wds' ); ?>
137
  </p>
includes/admin/templates/sitemap/sitemap-crawl-content.php CHANGED
@@ -1,9 +1,12 @@
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
 
 
4
  */
5
- $crawl_report = empty( $crawl_report ) ? null : $crawl_report;
6
- $open_type = empty( $open_type ) ? null : $open_type;
 
7
  $ignored_tab_open = empty( $ignored_tab_open ) ? false : $ignored_tab_open;
8
  if ( ! $crawl_report ) {
9
  return;
@@ -11,22 +14,28 @@ if ( ! $crawl_report ) {
11
 
12
  if ( $crawl_report->has_data() ) {
13
 
14
- $this->_render( 'sitemap/sitemap-crawl-results', array(
15
- 'report' => $crawl_report,
16
- 'open_type' => $open_type,
17
- 'ignored_tab_open' => $ignored_tab_open,
18
- ) );
 
 
 
19
 
20
  } elseif ( $crawl_report->is_in_progress() ) {
21
 
22
  // The URL crawl was started and is in progress at the moment.
23
- $this->_render( 'sitemap/sitemap-progress-bar', array(
24
- 'crawl_report' => $crawl_report,
25
- ) );
 
 
 
26
 
27
  } else {
28
 
29
  // The URL crawl was never started so there is nothing to do.
30
- $this->_render( 'sitemap/sitemap-no-crawler-data' );
31
 
32
  }
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
+ $crawl_report = empty( $crawl_report ) ? null : $crawl_report;
9
+ $open_type = empty( $open_type ) ? null : $open_type;
10
  $ignored_tab_open = empty( $ignored_tab_open ) ? false : $ignored_tab_open;
11
  if ( ! $crawl_report ) {
12
  return;
14
 
15
  if ( $crawl_report->has_data() ) {
16
 
17
+ $this->render_view(
18
+ 'sitemap/sitemap-crawl-results',
19
+ array(
20
+ 'report' => $crawl_report,
21
+ 'open_type' => $open_type,
22
+ 'ignored_tab_open' => $ignored_tab_open,
23
+ )
24
+ );
25
 
26
  } elseif ( $crawl_report->is_in_progress() ) {
27
 
28
  // The URL crawl was started and is in progress at the moment.
29
+ $this->render_view(
30
+ 'sitemap/sitemap-progress-bar',
31
+ array(
32
+ 'crawl_report' => $crawl_report,
33
+ )
34
+ );
35
 
36
  } else {
37
 
38
  // The URL crawl was never started so there is nothing to do.
39
+ $this->render_view( 'sitemap/sitemap-no-crawler-data' );
40
 
41
  }
includes/admin/templates/sitemap/sitemap-crawl-results.php CHANGED
@@ -15,10 +15,13 @@ if ( ! $report ) {
15
  <?php
16
  if ( $report->has_state_messages() ) {
17
  foreach ( $report->get_state_messages() as $state_message ) {
18
- $this->_render( 'notice', array(
19
- 'message' => $state_message,
20
- 'class' => 'sui-notice-error',
21
- ) );
 
 
 
22
  }
23
  }
24
  ?>
15
  <?php
16
  if ( $report->has_state_messages() ) {
17
  foreach ( $report->get_state_messages() as $state_message ) {
18
+ $this->render_view(
19
+ 'notice',
20
+ array(
21
+ 'message' => $state_message,
22
+ 'class' => 'sui-notice-error',
23
+ )
24
+ );
25
  }
26
  }
27
  ?>
includes/admin/templates/sitemap/sitemap-crawl-stats.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
 
 
4
  */
 
5
  $crawl_report = empty( $crawl_report ) ? null : $crawl_report;
6
  if ( ! $crawl_report ) {
7
  return;
@@ -10,10 +13,10 @@ $in_progress = $crawl_report->is_in_progress();
10
  if ( ! $in_progress && ! $crawl_report->has_data() ) {
11
  return;
12
  }
13
- $issue_count = (int) $crawl_report->get_issues_count();
14
- $score_class = $issue_count > 0 ? 'sui-icon-info sui-warning' : 'sui-icon-check-tick sui-success';
15
  $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
16
- $override_native = empty( $override_native ) ? false : $override_native;
17
  ?>
18
 
19
  <div class="sui-box sui-summary <?php echo esc_attr( $whitelabel_class ); ?>">
@@ -23,9 +26,9 @@ $override_native = empty( $override_native ) ? false : $override_native;
23
  <div class="sui-summary-segment">
24
  <div class="sui-summary-details">
25
  <div>
26
- <?php if ( $in_progress ): ?>
27
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
28
- <?php else: ?>
29
  <span class="sui-summary-large"><?php echo esc_html( $issue_count ); ?></span>
30
  <span class="<?php echo esc_attr( $score_class ); ?>"></span>
31
  <?php endif; ?>
@@ -43,7 +46,8 @@ $override_native = empty( $override_native ) ? false : $override_native;
43
 
44
  <span class="sui-list-detail">
45
  <span class="sui-tag">
46
- <?php echo $override_native
 
47
  ? esc_html__( 'Smartcrawl', 'wds' )
48
  : esc_html__( 'WordPress Core', 'wds' );
49
  ?>
@@ -53,29 +57,31 @@ $override_native = empty( $override_native ) ? false : $override_native;
53
  <li>
54
  <span class="sui-list-label"><?php esc_html_e( 'Total URLs Discovered', 'wds' ); ?></span>
55
  <span class="sui-list-detail">
56
- <?php if ( $in_progress ): ?>
57
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
58
  <small><?php esc_html_e( 'Crawl in progress', 'wds' ); ?></small>
59
- <?php else:
60
- echo intval( $crawl_report->get_meta( 'total' ) );
61
- endif; ?>
62
  </span>
63
  </li>
64
  <li>
65
  <span class="sui-list-label">
66
  <?php esc_html_e( 'Invisible URLs', 'wds' ); ?>
67
- <span class="sui-tooltip"
68
- data-tooltip="<?php esc_html_e( 'URLs that are missing from your sitemap', 'wds' ); ?>">
 
 
69
  <span class="sui-icon-info"></span>
70
  </span>
71
  </span>
72
  <span class="sui-list-detail wds-invisible-urls-count">
73
- <?php if ( $in_progress ): ?>
74
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
75
  <small><?php esc_html_e( 'Crawl in progress', 'wds' ); ?></small>
76
- <?php else:
77
- echo intval( $crawl_report->get_issues_count( 'sitemap' ) );
78
- endif; ?>
79
  </span>
80
  </li>
81
  </ul>
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
  $crawl_report = empty( $crawl_report ) ? null : $crawl_report;
9
  if ( ! $crawl_report ) {
10
  return;
13
  if ( ! $in_progress && ! $crawl_report->has_data() ) {
14
  return;
15
  }
16
+ $issue_count = (int) $crawl_report->get_issues_count();
17
+ $score_class = $issue_count > 0 ? 'sui-icon-info sui-warning' : 'sui-icon-check-tick sui-success';
18
  $whitelabel_class = Smartcrawl_White_Label::get()->summary_class();
19
+ $override_native = empty( $override_native ) ? false : $override_native;
20
  ?>
21
 
22
  <div class="sui-box sui-summary <?php echo esc_attr( $whitelabel_class ); ?>">
26
  <div class="sui-summary-segment">
27
  <div class="sui-summary-details">
28
  <div>
29
+ <?php if ( $in_progress ) : ?>
30
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
31
+ <?php else : ?>
32
  <span class="sui-summary-large"><?php echo esc_html( $issue_count ); ?></span>
33
  <span class="<?php echo esc_attr( $score_class ); ?>"></span>
34
  <?php endif; ?>
46
 
47
  <span class="sui-list-detail">
48
  <span class="sui-tag">
49
+ <?php
50
+ echo $override_native
51
  ? esc_html__( 'Smartcrawl', 'wds' )
52
  : esc_html__( 'WordPress Core', 'wds' );
53
  ?>
57
  <li>
58
  <span class="sui-list-label"><?php esc_html_e( 'Total URLs Discovered', 'wds' ); ?></span>
59
  <span class="sui-list-detail">
60
+ <?php if ( $in_progress ) : ?>
61
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
62
  <small><?php esc_html_e( 'Crawl in progress', 'wds' ); ?></small>
63
+ <?php else : ?>
64
+ <?php echo intval( $crawl_report->get_meta( 'total' ) ); ?>
65
+ <?php endif; ?>
66
  </span>
67
  </li>
68
  <li>
69
  <span class="sui-list-label">
70
  <?php esc_html_e( 'Invisible URLs', 'wds' ); ?>
71
+ <span
72
+ class="sui-tooltip"
73
+ data-tooltip="<?php esc_html_e( 'URLs that are missing from your sitemap', 'wds' ); ?>"
74
+ >
75
  <span class="sui-icon-info"></span>
76
  </span>
77
  </span>
78
  <span class="sui-list-detail wds-invisible-urls-count">
79
+ <?php if ( $in_progress ) : ?>
80
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
81
  <small><?php esc_html_e( 'Crawl in progress', 'wds' ); ?></small>
82
+ <?php else : ?>
83
+ <?php echo intval( $crawl_report->get_issues_count( 'sitemap' ) ); ?>
84
+ <?php endif; ?>
85
  </span>
86
  </li>
87
  </ul>
includes/admin/templates/sitemap/sitemap-deactivate-button.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $label_description = empty( $label_description ) ? '' : $label_description;
3
  $button_description = empty( $button_description ) ? '' : $button_description;
4
  ?>
5
  <div class="sui-box-settings-row">
@@ -7,16 +7,18 @@ $button_description = empty( $button_description ) ? '' : $button_description;
7
  <label class="sui-settings-label">
8
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
9
  </label>
10
- <?php if ( $label_description ): ?>
11
  <p class="sui-description">
12
  <?php echo esc_html( $label_description ); ?>
13
  </p>
14
  <?php endif; ?>
15
  </div>
16
  <div class="sui-box-settings-col-2">
17
- <button type="button"
18
- id="wds-deactivate-sitemap-module"
19
- class="sui-button sui-button-ghost">
 
 
20
  <span class="sui-loading-text">
21
  <span class="sui-icon-power-on-off" aria-hidden="true"></span>
22
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
@@ -25,7 +27,7 @@ $button_description = empty( $button_description ) ? '' : $button_description;
25
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
26
  </button>
27
 
28
- <?php if ( $button_description ): ?>
29
  <p class="sui-description">
30
  <?php echo esc_html( $button_description ); ?>
31
  </p>
1
  <?php
2
+ $label_description = empty( $label_description ) ? '' : $label_description;
3
  $button_description = empty( $button_description ) ? '' : $button_description;
4
  ?>
5
  <div class="sui-box-settings-row">
7
  <label class="sui-settings-label">
8
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
9
  </label>
10
+ <?php if ( $label_description ) : ?>
11
  <p class="sui-description">
12
  <?php echo esc_html( $label_description ); ?>
13
  </p>
14
  <?php endif; ?>
15
  </div>
16
  <div class="sui-box-settings-col-2">
17
+ <button
18
+ type="button"
19
+ id="wds-deactivate-sitemap-module"
20
+ class="sui-button sui-button-ghost"
21
+ >
22
  <span class="sui-loading-text">
23
  <span class="sui-icon-power-on-off" aria-hidden="true"></span>
24
  <?php esc_html_e( 'Deactivate', 'wds' ); ?>
27
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
28
  </button>
29
 
30
+ <?php if ( $button_description ) : ?>
31
  <p class="sui-description">
32
  <?php echo esc_html( $button_description ); ?>
33
  </p>
includes/admin/templates/sitemap/sitemap-disabled.php CHANGED
@@ -1,12 +1,15 @@
1
  <?php
2
 
3
- $this->_render( 'disabled-component', array(
4
- 'content' => sprintf(
5
- '%s<br/>%s',
6
- esc_html__( 'Automatically generate a full sitemap, regularly send updates to search engines and set up', 'wds' ),
7
- esc_html__( 'SmartCrawl to automatically check URLs are discoverable by search engines.', 'wds' )
8
- ),
9
- 'image' => 'sitemap-disabled.svg',
10
- 'component' => 'sitemap',
11
- 'button_text' => esc_html__( 'Activate Sitemap', 'wds' ),
12
- ) );
 
 
 
1
  <?php
2
 
3
+ $this->render_view(
4
+ 'disabled-component',
5
+ array(
6
+ 'content' => sprintf(
7
+ '%s<br/>%s',
8
+ esc_html__( 'Automatically generate a full sitemap, regularly send updates to search engines and set up', 'wds' ),
9
+ esc_html__( 'SmartCrawl to automatically check URLs are discoverable by search engines.', 'wds' )
10
+ ),
11
+ 'image' => 'sitemap-disabled.svg',
12
+ 'component' => 'sitemap',
13
+ 'button_text' => esc_html__( 'Activate Sitemap', 'wds' ),
14
+ )
15
+ );
includes/admin/templates/sitemap/sitemap-extra-actions.php CHANGED
@@ -1,17 +1,19 @@
1
  <?php
2
- $is_member = empty( $_view['is_member'] ) ? false : true;
3
  if ( ! $is_member ) {
4
  return;
5
  }
6
  $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
7
  /**
 
 
8
  * @var Smartcrawl_SeoReport $crawl_report
9
  */
10
  $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
11
  if ( ! $crawl_report ) {
12
  return;
13
  }
14
- $crawl_url = Smartcrawl_Sitemap_Settings::crawl_url();
15
  $sitemap_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
16
  if ( ! $sitemap_enabled ) {
17
  return;
@@ -23,13 +25,17 @@ $end = ! empty( $end ) && is_numeric( $end )
23
  ?>
24
 
25
  <span>
26
- <?php printf(
 
27
  esc_html__( 'Last crawl: %s', 'wds' ),
28
  esc_html( $end )
29
- ); ?>
 
30
  </span>
31
 
32
- <a href="<?php echo esc_attr( $crawl_url ); ?>" class="sui-button sui-button-blue wds-new-crawl-button"
33
- style="<?php echo $crawl_report->is_in_progress() ? 'display:none;' : ''; ?>">
 
 
34
  <?php esc_html_e( 'New crawl', 'wds' ); ?>
35
  </a>
1
  <?php
2
+ $is_member = ! empty( $_view['is_member'] );
3
  if ( ! $is_member ) {
4
  return;
5
  }
6
  $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
7
  /**
8
+ * Report.
9
+ *
10
  * @var Smartcrawl_SeoReport $crawl_report
11
  */
12
  $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
13
  if ( ! $crawl_report ) {
14
  return;
15
  }
16
+ $crawl_url = Smartcrawl_Sitemap_Settings::crawl_url();
17
  $sitemap_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
18
  if ( ! $sitemap_enabled ) {
19
  return;
25
  ?>
26
 
27
  <span>
28
+ <?php
29
+ printf(
30
  esc_html__( 'Last crawl: %s', 'wds' ),
31
  esc_html( $end )
32
+ );
33
+ ?>
34
  </span>
35
 
36
+ <a
37
+ href="<?php echo esc_attr( $crawl_url ); ?>" class="sui-button sui-button-blue wds-new-crawl-button"
38
+ style="<?php echo $crawl_report->is_in_progress() ? 'display:none;' : ''; ?>"
39
+ >
40
  <?php esc_html_e( 'New crawl', 'wds' ); ?>
41
  </a>
includes/admin/templates/sitemap/sitemap-general-xml.php CHANGED
@@ -6,19 +6,19 @@ $items = empty( $items ) ? array() : $items;
6
  if ( ! $items ) {
7
  return;
8
  }
9
- $stylesheet_enabled = Smartcrawl_Sitemap_Utils::stylesheet_enabled();
10
  $sitemap_images_enabled = Smartcrawl_Sitemap_Utils::sitemap_images_enabled();
11
- $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
12
- $plugin_dir_url = SMARTCRAWL_PLUGIN_URL;
13
 
14
  echo '<?xml version="1.0" encoding="UTF-8"?>';
15
 
16
  if ( $stylesheet_enabled ) {
17
- $xsl_url = home_url( "?wds_sitemap_styling=1&template=sitemapBody" );
18
  $xsl_url = str_replace( array( 'http:', 'https:' ), '', $xsl_url );
19
 
20
  if ( $hide_branding ) {
21
- $xsl_url .= "&whitelabel=1";
22
  }
23
 
24
  $xsl_url = esc_url( $xsl_url );
@@ -27,12 +27,15 @@ if ( $stylesheet_enabled ) {
27
  }
28
  ?>
29
  <!-- <?php echo Smartcrawl_Sitemap_Utils::SITEMAP_VERIFICATION_TOKEN; ?> -->
30
- <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
31
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 https://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd"
32
- xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
33
- <?php if ( $sitemap_images_enabled ): ?>xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"<?php endif; ?>
 
 
 
34
  >
35
- <?php foreach ( $items as $item ): ?>
36
  <?php echo $item->to_xml(); ?>
37
  <?php endforeach; ?>
38
  </urlset>
6
  if ( ! $items ) {
7
  return;
8
  }
9
+ $stylesheet_enabled = Smartcrawl_Sitemap_Utils::stylesheet_enabled();
10
  $sitemap_images_enabled = Smartcrawl_Sitemap_Utils::sitemap_images_enabled();
11
+ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
12
+ $plugin_dir_url = SMARTCRAWL_PLUGIN_URL;
13
 
14
  echo '<?xml version="1.0" encoding="UTF-8"?>';
15
 
16
  if ( $stylesheet_enabled ) {
17
+ $xsl_url = home_url( '?wds_sitemap_styling=1&template=sitemapBody' );
18
  $xsl_url = str_replace( array( 'http:', 'https:' ), '', $xsl_url );
19
 
20
  if ( $hide_branding ) {
21
+ $xsl_url .= '&whitelabel=1';
22
  }
23
 
24
  $xsl_url = esc_url( $xsl_url );
27
  }
28
  ?>
29
  <!-- <?php echo Smartcrawl_Sitemap_Utils::SITEMAP_VERIFICATION_TOKEN; ?> -->
30
+ <urlset
31
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
32
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 https://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd"
33
+ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
34
+ <?php if ( $sitemap_images_enabled ) : ?>
35
+ xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
36
+ <?php endif; ?>
37
  >
38
+ <?php foreach ( $items as $item ) : ?>
39
  <?php echo $item->to_xml(); ?>
40
  <?php endforeach; ?>
41
  </urlset>
includes/admin/templates/sitemap/sitemap-index-xml.php CHANGED
@@ -2,19 +2,19 @@
2
  /**
3
  * @var $index_items Smartcrawl_Sitemap_Index_Item[]
4
  */
5
- $index_items = empty( $index_items ) ? array() : $index_items;
6
- $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
7
  $stylesheet_enabled = Smartcrawl_Sitemap_Utils::stylesheet_enabled();
8
- $plugin_dir_url = SMARTCRAWL_PLUGIN_URL;
9
 
10
  echo "<?xml version='1.0' encoding='UTF-8'?>";
11
 
12
  if ( $stylesheet_enabled ) {
13
- $xsl_url = home_url( "?wds_sitemap_styling=1&template=sitemapIndexBody" );
14
  $xsl_url = str_replace( array( 'http:', 'https:' ), '', $xsl_url );
15
 
16
  if ( $hide_branding ) {
17
- $xsl_url .= "&whitelabel=1";
18
  }
19
 
20
  $xsl_url = esc_url( $xsl_url );
@@ -23,10 +23,11 @@ if ( $stylesheet_enabled ) {
23
  }
24
  ?>
25
  <!-- <?php echo Smartcrawl_Sitemap_Utils::SITEMAP_VERIFICATION_TOKEN; ?> -->
26
- <sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
27
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd"
28
- xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
29
- <?php foreach ( $index_items as $index_item ): ?>
 
30
  <?php echo $index_item->to_xml(); ?>
31
  <?php endforeach; ?>
32
  </sitemapindex>
2
  /**
3
  * @var $index_items Smartcrawl_Sitemap_Index_Item[]
4
  */
5
+ $index_items = empty( $index_items ) ? array() : $index_items;
6
+ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
7
  $stylesheet_enabled = Smartcrawl_Sitemap_Utils::stylesheet_enabled();
8
+ $plugin_dir_url = SMARTCRAWL_PLUGIN_URL;
9
 
10
  echo "<?xml version='1.0' encoding='UTF-8'?>";
11
 
12
  if ( $stylesheet_enabled ) {
13
+ $xsl_url = home_url( '?wds_sitemap_styling=1&template=sitemapIndexBody' );
14
  $xsl_url = str_replace( array( 'http:', 'https:' ), '', $xsl_url );
15
 
16
  if ( $hide_branding ) {
17
+ $xsl_url .= '&whitelabel=1';
18
  }
19
 
20
  $xsl_url = esc_url( $xsl_url );
23
  }
24
  ?>
25
  <!-- <?php echo Smartcrawl_Sitemap_Utils::SITEMAP_VERIFICATION_TOKEN; ?> -->
26
+ <sitemapindex
27
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
28
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd"
29
+ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
30
+ <?php foreach ( $index_items as $index_item ) : ?>
31
  <?php echo $index_item->to_xml(); ?>
32
  <?php endforeach; ?>
33
  </sitemapindex>
includes/admin/templates/sitemap/sitemap-manual-update-button.php CHANGED
@@ -2,8 +2,12 @@
2
  <?php esc_html_e( "Your sitemap isn't being updated automatically. Click Update Sitemap below to regenerate your sitemap.", 'wds' ); ?>
3
 
4
  <br/>
5
- <button style="margin-top: 15px;" type="button" id="wds-manually-update-sitemap"
6
- class="sui-button sui-button-ghost">
 
 
 
 
7
  <span class="sui-loading-text">
8
  <span class="sui-icon-save" aria-hidden="true"></span>
9
  <?php esc_html_e( 'Update Sitemap', 'wds' ); ?>
2
  <?php esc_html_e( "Your sitemap isn't being updated automatically. Click Update Sitemap below to regenerate your sitemap.", 'wds' ); ?>
3
 
4
  <br/>
5
+ <button
6
+ style="margin-top: 15px;"
7
+ type="button"
8
+ id="wds-manually-update-sitemap"
9
+ class="sui-button sui-button-ghost"
10
+ >
11
  <span class="sui-loading-text">
12
  <span class="sui-icon-save" aria-hidden="true"></span>
13
  <?php esc_html_e( 'Update Sitemap', 'wds' ); ?>
includes/admin/templates/sitemap/sitemap-manually-notify-search-engines.php CHANGED
@@ -2,8 +2,12 @@
2
  <?php esc_html_e( "Search engines aren't being notified automatically. Click the button below to submit your sitemap to search engines.", 'wds' ); ?>
3
 
4
  <br/>
5
- <button style="margin-top: 15px;" type="button" id="wds-manually-notify-search-engines"
6
- class="sui-button sui-button-ghost">
 
 
 
 
7
  <span class="sui-loading-text">
8
  <span class="sui-icon-refresh" aria-hidden="true"></span>
9
  <?php esc_html_e( 'Notify Search Engines', 'wds' ); ?>
2
  <?php esc_html_e( "Search engines aren't being notified automatically. Click the button below to submit your sitemap to search engines.", 'wds' ); ?>
3
 
4
  <br/>
5
+ <button
6
+ style="margin-top: 15px;"
7
+ type="button"
8
+ id="wds-manually-notify-search-engines"
9
+ class="sui-button sui-button-ghost"
10
+ >
11
  <span class="sui-loading-text">
12
  <span class="sui-icon-refresh" aria-hidden="true"></span>
13
  <?php esc_html_e( 'Notify Search Engines', 'wds' ); ?>
includes/admin/templates/sitemap/sitemap-native.php CHANGED
@@ -1,23 +1,26 @@
1
  <?php
2
- $post_types = empty( $post_types ) ? array() : $post_types;
3
- $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
4
  $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
5
- $extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
6
- $ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
7
- $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
8
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
9
- $items_per_sitemap = Smartcrawl_Sitemap_Utils::get_items_per_sitemap();
10
  $max_items_per_sitemap = Smartcrawl_Sitemap_Utils::get_max_items_per_sitemap();
11
 
12
- $this->_render( 'notice', array(
13
- 'message' => smartcrawl_format_link(
14
- esc_html__( "Your sitemap is available at %s. Note that you're using the default WordPress sitemap but can switch to SmartCrawl's advanced sitemaps at any time.", 'wds' ),
15
- home_url( '/wp-sitemap.xml' ),
16
- '/wp-sitemap.xml',
17
- '_blank'
18
- ),
19
- 'class' => 'sui-notice-info',
20
- ) );
 
 
 
21
  ?>
22
  <div class="sui-box-settings-row">
23
  <div class="sui-box-settings-col-1">
@@ -29,16 +32,17 @@ $this->_render( 'notice', array(
29
  </p>
30
  </div>
31
  <div class="sui-box-settings-col-2">
32
- <button type="button"
33
- id="wds-switch-to-smartcrawl-sitemap"
34
- class="sui-button sui-button-ghost">
35
-
 
36
  <span class="sui-icon-defer" aria-hidden="true"></span>
37
  <?php esc_html_e( 'Switch', 'wds' ); ?>
38
  </button>
39
 
40
  <p class="sui-description">
41
- <?php esc_html_e( 'Note: Wordpress core sitemaps will be disabled.', 'wds' ); ?>
42
  </p>
43
  </div>
44
  </div>
@@ -57,34 +61,43 @@ $this->_render( 'notice', array(
57
  <label for="native-items-per-sitemap" class="sui-label">
58
  <?php esc_html_e( 'Number of links per sitemap', 'wds' ); ?>
59
  </label>
60
- <input type="number"
61
- id="native-items-per-sitemap"
62
- class="sui-form-control sui-input-sm"
63
- value="<?php echo esc_attr( $items_per_sitemap ); ?>"
64
- name="<?php echo esc_attr( $option_name ); ?>[items-per-sitemap]">
65
-
 
66
  <p class="sui-description">
67
- <?php printf(
 
68
  esc_html__( 'Choose how many links each sitemap has, up to %d.', 'wds' ),
69
- $max_items_per_sitemap
70
- ); ?>
 
71
  </p>
72
  </div>
73
  </div>
74
  </div>
75
  <?php
76
- $this->_render( 'sitemap/sitemap-switch-to-smartcrawl-modal', array() );
77
 
78
- $this->_render( 'sitemap/sitemap-common-settings', array(
79
- 'post_types' => $post_types,
80
- 'taxonomies' => $taxonomies,
81
- 'smartcrawl_buddypress' => $smartcrawl_buddypress,
82
- 'extra_urls' => $extra_urls,
83
- 'ignore_urls' => $ignore_urls,
84
- 'ignore_post_ids' => $ignore_post_ids,
85
- ) );
 
 
 
86
 
87
- $this->_render( 'sitemap/sitemap-deactivate-button', array(
88
- 'label_description' => esc_html__( 'If you no longer wish to customize the Wordpress core sitemaps you can deactivate it.', 'wds' ),
89
- 'button_description' => esc_html__( 'Note: By clicking this button you are disabling SmartCrawl’s sitemap module. The Wordpress core sitemap will still be available afterwards.', 'wds' ),
90
- ) );
 
 
 
1
  <?php
2
+ $post_types = empty( $post_types ) ? array() : $post_types;
3
+ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
4
  $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
5
+ $extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
6
+ $ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
7
+ $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
8
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
9
+ $items_per_sitemap = Smartcrawl_Sitemap_Utils::get_items_per_sitemap();
10
  $max_items_per_sitemap = Smartcrawl_Sitemap_Utils::get_max_items_per_sitemap();
11
 
12
+ $this->render_view(
13
+ 'notice',
14
+ array(
15
+ 'message' => smartcrawl_format_link(
16
+ esc_html__( "Your sitemap is available at %s. Note that you're using the default WordPress sitemap but can switch to SmartCrawl's advanced sitemaps at any time.", 'wds' ),
17
+ home_url( '/wp-sitemap.xml' ),
18
+ '/wp-sitemap.xml',
19
+ '_blank'
20
+ ),
21
+ 'class' => 'sui-notice-info',
22
+ )
23
+ );
24
  ?>
25
  <div class="sui-box-settings-row">
26
  <div class="sui-box-settings-col-1">
32
  </p>
33
  </div>
34
  <div class="sui-box-settings-col-2">
35
+ <button
36
+ type="button"
37
+ id="wds-switch-to-smartcrawl-sitemap"
38
+ class="sui-button sui-button-ghost"
39
+ >
40
  <span class="sui-icon-defer" aria-hidden="true"></span>
41
  <?php esc_html_e( 'Switch', 'wds' ); ?>
42
  </button>
43
 
44
  <p class="sui-description">
45
+ <?php esc_html_e( 'Note: WordPress core sitemaps will be disabled.', 'wds' ); ?>
46
  </p>
47
  </div>
48
  </div>
61
  <label for="native-items-per-sitemap" class="sui-label">
62
  <?php esc_html_e( 'Number of links per sitemap', 'wds' ); ?>
63
  </label>
64
+ <input
65
+ type="number"
66
+ id="native-items-per-sitemap"
67
+ class="sui-form-control sui-input-sm"
68
+ value="<?php echo esc_attr( $items_per_sitemap ); ?>"
69
+ name="<?php echo esc_attr( $option_name ); ?>[items-per-sitemap]"
70
+ >
71
  <p class="sui-description">
72
+ <?php
73
+ printf(
74
  esc_html__( 'Choose how many links each sitemap has, up to %d.', 'wds' ),
75
+ esc_html( $max_items_per_sitemap )
76
+ );
77
+ ?>
78
  </p>
79
  </div>
80
  </div>
81
  </div>
82
  <?php
83
+ $this->render_view( 'sitemap/sitemap-switch-to-smartcrawl-modal', array() );
84
 
85
+ $this->render_view(
86
+ 'sitemap/sitemap-common-settings',
87
+ array(
88
+ 'post_types' => $post_types,
89
+ 'taxonomies' => $taxonomies,
90
+ 'smartcrawl_buddypress' => $smartcrawl_buddypress,
91
+ 'extra_urls' => $extra_urls,
92
+ 'ignore_urls' => $ignore_urls,
93
+ 'ignore_post_ids' => $ignore_post_ids,
94
+ )
95
+ );
96
 
97
+ $this->render_view(
98
+ 'sitemap/sitemap-deactivate-button',
99
+ array(
100
+ 'label_description' => esc_html__( 'If you no longer wish to customize the Wordpress core sitemaps you can deactivate it.', 'wds' ),
101
+ 'button_description' => esc_html__( 'Note: By clicking this button you are disabling SmartCrawl’s sitemap module. The Wordpress core sitemap will still be available afterwards.', 'wds' ),
102
+ )
103
+ );
includes/admin/templates/sitemap/sitemap-news-xml.php CHANGED
@@ -2,19 +2,19 @@
2
  /**
3
  * @var $news_items Smartcrawl_Sitemap_News_Item[]
4
  */
5
- $news_items = empty( $news_items ) ? array() : $news_items;
6
- $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
7
  $stylesheet_enabled = Smartcrawl_Sitemap_Utils::stylesheet_enabled();
8
- $plugin_dir_url = SMARTCRAWL_PLUGIN_URL;
9
 
10
  echo "<?xml version='1.0' encoding='UTF-8'?>";
11
 
12
  if ( $stylesheet_enabled ) {
13
- $xsl_url = home_url( "?wds_sitemap_styling=1&template=newsSitemapBody" );
14
  $xsl_url = str_replace( array( 'http:', 'https:' ), '', $xsl_url );
15
 
16
  if ( $hide_branding ) {
17
- $xsl_url .= "&whitelabel=1";
18
  }
19
 
20
  $xsl_url = esc_url( $xsl_url );
@@ -23,9 +23,11 @@ if ( $stylesheet_enabled ) {
23
  }
24
  ?>
25
  <!-- <?php echo Smartcrawl_Sitemap_Utils::SITEMAP_VERIFICATION_TOKEN; ?> -->
26
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
27
- xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
28
- <?php foreach ( $news_items as $news_item ): ?>
 
 
29
  <?php echo $news_item->to_xml(); ?>
30
  <?php endforeach; ?>
31
  </urlset>
2
  /**
3
  * @var $news_items Smartcrawl_Sitemap_News_Item[]
4
  */
5
+ $news_items = empty( $news_items ) ? array() : $news_items;
6
+ $hide_branding = Smartcrawl_White_Label::get()->is_hide_wpmudev_branding();
7
  $stylesheet_enabled = Smartcrawl_Sitemap_Utils::stylesheet_enabled();
8
+ $plugin_dir_url = SMARTCRAWL_PLUGIN_URL;
9
 
10
  echo "<?xml version='1.0' encoding='UTF-8'?>";
11
 
12
  if ( $stylesheet_enabled ) {
13
+ $xsl_url = home_url( '?wds_sitemap_styling=1&template=newsSitemapBody' );
14
  $xsl_url = str_replace( array( 'http:', 'https:' ), '', $xsl_url );
15
 
16
  if ( $hide_branding ) {
17
+ $xsl_url .= '&whitelabel=1';
18
  }
19
 
20
  $xsl_url = esc_url( $xsl_url );
23
  }
24
  ?>
25
  <!-- <?php echo Smartcrawl_Sitemap_Utils::SITEMAP_VERIFICATION_TOKEN; ?> -->
26
+ <urlset
27
+ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
28
+ xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
29
+ >
30
+ <?php foreach ( $news_items as $news_item ) : ?>
31
  <?php echo $news_item->to_xml(); ?>
32
  <?php endforeach; ?>
33
  </urlset>
includes/admin/templates/sitemap/sitemap-no-crawler-data.php CHANGED
@@ -1,15 +1,18 @@
1
  <?php
2
  $action_url = Smartcrawl_Sitemap_Settings::crawl_url();
3
 
4
- $this->_render( 'disabled-component-inner', array(
5
- 'content' => sprintf(
6
- '%s<br/>%s',
7
- esc_html__( 'Have SmartCrawl check for broken URLs, 404s, multiple redirections and other harmful', 'wds' ),
8
- esc_html__( 'issues that can reduce your ability to rank in search engines.', 'wds' )
9
- ),
10
- 'image' => 'url-crawler-disabled.svg',
11
- 'button_text' => esc_html__( 'Begin Crawl', 'wds' ),
12
- 'button_url' => $action_url,
13
- 'upgrade_tag' => 'smartcrawl_sitemap_crawler_upgrade_button',
14
- 'premium_feature' => true,
15
- ) );
 
 
 
1
  <?php
2
  $action_url = Smartcrawl_Sitemap_Settings::crawl_url();
3
 
4
+ $this->render_view(
5
+ 'disabled-component-inner',
6
+ array(
7
+ 'content' => sprintf(
8
+ '%s<br/>%s',
9
+ esc_html__( 'Have SmartCrawl check for broken URLs, 404s, multiple redirections and other harmful', 'wds' ),
10
+ esc_html__( 'issues that can reduce your ability to rank in search engines.', 'wds' )
11
+ ),
12
+ 'image' => 'url-crawler-disabled.svg',
13
+ 'button_text' => esc_html__( 'Begin Crawl', 'wds' ),
14
+ 'button_url' => $action_url,
15
+ 'upgrade_tag' => 'smartcrawl_sitemap_crawler_upgrade_button',
16
+ 'premium_feature' => true,
17
+ )
18
+ );
includes/admin/templates/sitemap/sitemap-notices.php CHANGED
@@ -1,38 +1,47 @@
1
  <div class="sui-floating-notices">
2
  <?php
3
- if ( ! empty( $_GET['crawl-in-progress'] ) ) {
4
- $this->_render( 'floating-notice', array(
5
- 'code' => 'wds-crawl-started',
6
- 'type' => 'success',
7
- 'message' => esc_html__( 'Crawl started successfully', 'wds' ),
8
- 'autoclose' => true,
9
- ) );
 
 
 
10
  }
11
- if ( ! empty( $_GET['switched-to-native'] ) ) {
12
- $this->_render( 'floating-notice', array(
13
- 'code' => 'wds-switched-to-native',
14
- 'type' => 'success',
15
- 'message' => smartcrawl_format_link(
16
- esc_html__( 'You have successfully switched to the Wordpress core sitemap. You can find it at %s', 'wds' ),
17
- home_url( '/wp-sitemap.xml' ),
18
- '/wp-sitemap.xml',
19
- '_blank'
20
- ),
21
- 'autoclose' => true,
22
- ) );
 
 
 
23
  }
24
- if ( ! empty( $_GET['switched-to-sc'] ) ) {
25
- $this->_render( 'floating-notice', array(
26
- 'code' => 'wds-switched-to-sc',
27
- 'type' => 'success',
28
- 'message' => smartcrawl_format_link(
29
- esc_html__( 'Well done! You have successfully switched to the SmartCrawl sitemap. You can find it at %s', 'wds' ),
30
- smartcrawl_get_sitemap_url(),
31
- '/sitemap.xml',
32
- '_blank'
33
- ),
34
- 'autoclose' => true,
35
- ) );
 
 
 
36
  }
37
  ?>
38
  </div>
1
  <div class="sui-floating-notices">
2
  <?php
3
+ if ( ! empty( $_GET['crawl-in-progress'] ) ) { // phpcs:ignore
4
+ $this->render_view(
5
+ 'floating-notice',
6
+ array(
7
+ 'code' => 'wds-crawl-started',
8
+ 'type' => 'success',
9
+ 'message' => esc_html__( 'Crawl started successfully', 'wds' ),
10
+ 'autoclose' => true,
11
+ )
12
+ );
13
  }
14
+ if ( ! empty( $_GET['switched-to-native'] ) ) { // phpcs:ignore
15
+ $this->render_view(
16
+ 'floating-notice',
17
+ array(
18
+ 'code' => 'wds-switched-to-native',
19
+ 'type' => 'success',
20
+ 'message' => smartcrawl_format_link(
21
+ esc_html__( 'You have successfully switched to the Wordpress core sitemap. You can find it at %s', 'wds' ),
22
+ home_url( '/wp-sitemap.xml' ),
23
+ '/wp-sitemap.xml',
24
+ '_blank'
25
+ ),
26
+ 'autoclose' => true,
27
+ )
28
+ );
29
  }
30
+ if ( ! empty( $_GET['switched-to-sc'] ) ) { // phpcs:ignore
31
+ $this->render_view(
32
+ 'floating-notice',
33
+ array(
34
+ 'code' => 'wds-switched-to-sc',
35
+ 'type' => 'success',
36
+ 'message' => smartcrawl_format_link(
37
+ esc_html__( 'Well done! You have successfully switched to the SmartCrawl sitemap. You can find it at %s', 'wds' ),
38
+ smartcrawl_get_sitemap_url(),
39
+ '/sitemap.xml',
40
+ '_blank'
41
+ ),
42
+ 'autoclose' => true,
43
+ )
44
+ );
45
  }
46
  ?>
47
  </div>
includes/admin/templates/sitemap/sitemap-part.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
- $item_label = empty( $item_label ) ? '' : $item_label;
4
  $part_excluded = ! empty( $_view['options'][ $item ] );
5
- $part_checked = $part_excluded ? 'checked' : '';
6
- $inverted = empty( $inverted ) ? false : $inverted;
7
- $class = empty( $class ) ? '' : $class;
8
- $tooltip_text = sprintf( esc_html__( 'Include/exclude %s from your sitemap', 'wds' ), strtolower( $item_label ) );
9
  ?>
10
  <tr class="<?php echo esc_attr( $class ); ?>">
11
  <td colspan="<?php echo empty( $item_name ) ? 2 : 1; ?>">
@@ -19,15 +19,21 @@ $tooltip_text = sprintf( esc_html__( 'Include/exclude %s from your sitemap', 'wd
19
  </td>
20
  <?php endif; ?>
21
  <td>
22
- <span class="sui-tooltip sui-tooltip-top-right"
23
- data-tooltip="<?php echo esc_attr( $tooltip_text ); ?>">
24
-
25
- <?php $this->_render( 'toggle-item', array(
26
- 'inverted' => $inverted,
27
- 'checked' => $part_excluded,
28
- 'field_id' => $item,
29
- 'field_name' => "{$option_name}[{$item}]",
30
- ) ) ?>
 
 
 
 
 
 
31
  </span>
32
  </td>
33
  </tr>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
+ $item_label = empty( $item_label ) ? '' : $item_label;
4
  $part_excluded = ! empty( $_view['options'][ $item ] );
5
+ $part_checked = $part_excluded ? 'checked' : '';
6
+ $inverted = empty( $inverted ) ? false : $inverted;
7
+ $class = empty( $class ) ? '' : $class;
8
+ $tooltip_text = sprintf( esc_html__( 'Include/exclude %s from your sitemap', 'wds' ), strtolower( $item_label ) );
9
  ?>
10
  <tr class="<?php echo esc_attr( $class ); ?>">
11
  <td colspan="<?php echo empty( $item_name ) ? 2 : 1; ?>">
19
  </td>
20
  <?php endif; ?>
21
  <td>
22
+ <span
23
+ class="sui-tooltip sui-tooltip-top-right"
24
+ data-tooltip="<?php echo esc_attr( $tooltip_text ); ?>"
25
+ >
26
+ <?php
27
+ $this->render_view(
28
+ 'toggle-item',
29
+ array(
30
+ 'inverted' => $inverted,
31
+ 'checked' => $part_excluded,
32
+ 'field_id' => $item,
33
+ 'field_name' => "{$option_name}[{$item}]",
34
+ )
35
+ )
36
+ ?>
37
  </span>
38
  </td>
39
  </tr>
includes/admin/templates/sitemap/sitemap-progress-bar.php CHANGED
@@ -1,13 +1,16 @@
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
 
 
4
  */
5
- $crawl_report = empty( $crawl_report ) ? null : $crawl_report;
6
- $start_timestamp = $crawl_report->get_start_timestamp();
7
- $start_timestamp = empty( $start_timestamp ) ? time() : $start_timestamp;
8
- $mins_since_start = ( time() - $start_timestamp ) / 60;
 
9
  $dash_profile_data = smartcrawl_get_dash_profile_data();
10
- $user_email = $dash_profile_data ? $dash_profile_data->user_email : false;
11
  if ( $start_timestamp && $user_email && $mins_since_start > 10 ) {
12
  $progress_state = sprintf(
13
  esc_html__( "The crawl is taking longer than expected. We'll email %s when the crawl has completed.", 'wds' ),
@@ -22,11 +25,14 @@ if ( $start_timestamp && $user_email && $mins_since_start > 10 ) {
22
  <p><?php esc_html_e( "We're looking for issues with your sitemap, please wait…", 'wds' ); ?></p>
23
  <div class="wds-url-crawler-progress">
24
  <?php
25
- $this->_render( 'progress-bar', array(
26
- 'progress' => $crawl_report->get_progress(),
27
- 'progress_state' => $progress_state,
28
- ) );
 
 
 
29
  ?>
30
- <?php $this->_render( 'progress-notice' ); ?>
31
  </div>
32
  </div>
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
+ $crawl_report = empty( $crawl_report ) ? null : $crawl_report;
9
+ $start_timestamp = $crawl_report->get_start_timestamp();
10
+ $start_timestamp = empty( $start_timestamp ) ? time() : $start_timestamp;
11
+ $mins_since_start = ( time() - $start_timestamp ) / 60;
12
  $dash_profile_data = smartcrawl_get_dash_profile_data();
13
+ $user_email = $dash_profile_data ? $dash_profile_data->user_email : false; // phpcs:ignore
14
  if ( $start_timestamp && $user_email && $mins_since_start > 10 ) {
15
  $progress_state = sprintf(
16
  esc_html__( "The crawl is taking longer than expected. We'll email %s when the crawl has completed.", 'wds' ),
25
  <p><?php esc_html_e( "We're looking for issues with your sitemap, please wait…", 'wds' ); ?></p>
26
  <div class="wds-url-crawler-progress">
27
  <?php
28
+ $this->render_view(
29
+ 'progress-bar',
30
+ array(
31
+ 'progress' => $crawl_report->get_progress(),
32
+ 'progress_state' => $progress_state,
33
+ )
34
+ );
35
  ?>
36
+ <?php $this->render_view( 'progress-notice' ); ?>
37
  </div>
38
  </div>
includes/admin/templates/sitemap/sitemap-reporting-title-pro-tag.php CHANGED
@@ -1,13 +1,15 @@
1
  <?php
2
- $is_member = empty( $_view['is_member'] ) ? false : true;
3
  if ( $is_member ) {
4
  return;
5
  }
6
  $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_sitemap_reporting_pro_tag';
7
  ?>
8
  <a target="_blank" href="<?php echo esc_attr( $upgrade_url ); ?>">
9
- <span class="sui-tag sui-tag-pro sui-tooltip"
10
- data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>">
11
- <?php esc_html_e( 'Pro', 'wds' ); ?>
12
- </span>
 
 
13
  </a>
1
  <?php
2
+ $is_member = ! empty( $_view['is_member'] );
3
  if ( $is_member ) {
4
  return;
5
  }
6
  $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_sitemap_reporting_pro_tag';
7
  ?>
8
  <a target="_blank" href="<?php echo esc_attr( $upgrade_url ); ?>">
9
+ <span
10
+ class="sui-tag sui-tag-pro sui-tooltip"
11
+ data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>"
12
+ >
13
+ <?php esc_html_e( 'Pro', 'wds' ); ?>
14
+ </span>
15
  </a>
includes/admin/templates/sitemap/sitemap-reporting-toggle-sub-settings.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
4
  ?>
5
  <small><strong><?php esc_html_e( 'Recipients', 'wds' ); ?></strong></small>
@@ -8,9 +8,12 @@ $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
8
 
9
  <small><strong><?php esc_html_e( 'Schedule', 'wds' ); ?></strong></small>
10
 
11
- <?php $this->_render( 'reporting-schedule', array(
12
- 'component' => 'crawler',
13
- 'frequency' => empty( $_view['options']['crawler-frequency'] ) ? false : $_view['options']['crawler-frequency'],
14
- 'dow_value' => isset( $_view['options']['crawler-dow'] ) ? $_view['options']['crawler-dow'] : false,
15
- 'tod_value' => isset( $_view['options']['crawler-tod'] ) ? $_view['options']['crawler-tod'] : false,
16
- ) ); ?>
 
 
 
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
4
  ?>
5
  <small><strong><?php esc_html_e( 'Recipients', 'wds' ); ?></strong></small>
8
 
9
  <small><strong><?php esc_html_e( 'Schedule', 'wds' ); ?></strong></small>
10
 
11
+ <?php $this->render_view(
12
+ 'reporting-schedule',
13
+ array(
14
+ 'component' => 'crawler',
15
+ 'frequency' => empty( $_view['options']['crawler-frequency'] ) ? false : $_view['options']['crawler-frequency'],
16
+ 'dow_value' => isset( $_view['options']['crawler-dow'] ) ? $_view['options']['crawler-dow'] : false,
17
+ 'tod_value' => isset( $_view['options']['crawler-tod'] ) ? $_view['options']['crawler-tod'] : false,
18
+ )
19
+ ); ?>
includes/admin/templates/sitemap/sitemap-section-advanced.php CHANGED
@@ -1,26 +1,29 @@
1
  <?php
2
- $automatically_switched = empty( $automatically_switched ) ? false : $automatically_switched;
3
- $total_post_count = empty( $total_post_count ) ? 0 : $total_post_count;
4
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
5
  $automatic_updates_disabled = ! empty( $_view['options']['sitemap-disable-automatic-regeneration'] );
6
- $ping_google = ! empty( $_view['options']['ping-google'] );
7
- $ping_bing = ! empty( $_view['options']['ping-bing'] );
8
  ?>
9
 
10
- <?php $this->_render( 'sitemap/sitemap-split-setting' ); ?>
11
 
12
  <?php
13
- $this->_render( 'toggle-group', array(
14
- 'label' => esc_html__( 'Include images', 'wds' ),
15
- 'description' => esc_html__( 'If your posts contain imagery you would like others to be able to search, this setting will help Google Images index them correctly.', 'wds' ),
16
- 'items' => array(
17
- 'sitemap-images' => array(
18
- 'label' => esc_html__( 'Include image items with the sitemap', 'wds' ),
19
- 'description' => esc_html__( 'Note: When uploading attachments to posts, be sure to add titles and captions that clearly describe your images.', 'wds' ),
20
- 'value' => '1',
 
 
 
21
  ),
22
- ),
23
- ) );
24
 
25
  ?>
26
  <div class="sui-box-settings-row">
@@ -35,38 +38,44 @@ $this->_render( 'toggle-group', array(
35
  </div>
36
  <div class="sui-box-settings-col-2">
37
  <?php
38
- $this->_render( 'side-tabs', array(
39
- 'id' => 'wds-auto-notify-engines-tabs',
40
- 'name' => "{$option_name}[auto-notify-search-engines]",
41
- 'value' => $ping_google && $ping_bing ? '1' : '',
42
- 'tabs' => array(
43
- array(
44
- 'value' => '1',
45
- 'label' => esc_html__( 'Automatic', 'wds' ),
46
- ),
47
- array(
48
- 'value' => '',
49
- 'label' => esc_html__( 'Manual', 'wds' ),
50
- 'template' => 'sitemap/sitemap-manually-notify-search-engines',
 
 
 
51
  ),
52
- ),
53
- ) );
54
  ?>
55
  </div>
56
  </div>
57
  <?php
58
- $this->_render( 'toggle-group', array(
59
- 'label' => esc_html__( 'Style sitemap', 'wds' ),
60
- 'description' => esc_html__( 'Adds some nice styling to your sitemap.', 'wds' ),
61
- 'separator' => true,
62
- 'items' => array(
63
- 'sitemap-stylesheet' => array(
64
- 'label' => esc_html__( 'Include stylesheet with sitemap', 'wds' ),
65
- 'description' => esc_html__( 'Note: This doesn’t affect your SEO and is purely visual.', 'wds' ),
66
- 'value' => '1',
 
 
 
67
  ),
68
- ),
69
- ) );
70
  ?>
71
 
72
  <div class="sui-box-settings-row">
@@ -81,29 +90,35 @@ $this->_render( 'toggle-group', array(
81
  </div>
82
  <div class="sui-box-settings-col-2">
83
  <?php
84
- $this->_render( 'side-tabs', array(
85
- 'id' => 'wds-automatic-sitemap-updates-tabs',
86
- 'name' => "{$option_name}[sitemap-disable-automatic-regeneration]",
87
- 'value' => empty( $automatic_updates_disabled ) ? '' : '1',
88
- 'tabs' => array(
89
- array(
90
- 'value' => '',
91
- 'label' => esc_html__( 'Automatic', 'wds' ),
92
- ),
93
- array(
94
- 'value' => '1',
95
- 'label' => esc_html__( 'Manual', 'wds' ),
96
- 'template' => 'sitemap/sitemap-manual-update-button',
 
 
 
97
  ),
98
- ),
99
- ) );
100
  ?>
101
  </div>
102
  </div>
103
 
104
  <div id="wds-troubleshooting-sitemap-placeholder"></div>
105
 
106
- <?php $this->_render( 'sitemap/sitemap-deactivate-button', array(
107
- 'label_description' => esc_html__( 'If you no longer wish to use the Sitemap generator, you can deactivate it.', 'wds' ),
108
- 'button_description' => esc_html__( 'Note: Sitemaps are crucial for helping search engines index all of your content effectively. We highly recommend you have a valid sitemap.', 'wds' ),
109
- ) ); ?>
 
 
 
1
  <?php
2
+ $automatically_switched = empty( $automatically_switched ) ? false : $automatically_switched;
3
+ $total_post_count = empty( $total_post_count ) ? 0 : $total_post_count;
4
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
5
  $automatic_updates_disabled = ! empty( $_view['options']['sitemap-disable-automatic-regeneration'] );
6
+ $ping_google = ! empty( $_view['options']['ping-google'] );
7
+ $ping_bing = ! empty( $_view['options']['ping-bing'] );
8
  ?>
9
 
10
+ <?php $this->render_view( 'sitemap/sitemap-split-setting' ); ?>
11
 
12
  <?php
13
+ $this->render_view(
14
+ 'toggle-group',
15
+ array(
16
+ 'label' => esc_html__( 'Include images', 'wds' ),
17
+ 'description' => esc_html__( 'If your posts contain imagery you would like others to be able to search, this setting will help Google Images index them correctly.', 'wds' ),
18
+ 'items' => array(
19
+ 'sitemap-images' => array(
20
+ 'label' => esc_html__( 'Include image items with the sitemap', 'wds' ),
21
+ 'description' => esc_html__( 'Note: When uploading attachments to posts, be sure to add titles and captions that clearly describe your images.', 'wds' ),
22
+ 'value' => '1',
23
+ ),
24
  ),
25
+ )
26
+ );
27
 
28
  ?>
29
  <div class="sui-box-settings-row">
38
  </div>
39
  <div class="sui-box-settings-col-2">
40
  <?php
41
+ $this->render_view(
42
+ 'side-tabs',
43
+ array(
44
+ 'id' => 'wds-auto-notify-engines-tabs',
45
+ 'name' => "{$option_name}[auto-notify-search-engines]",
46
+ 'value' => $ping_google && $ping_bing ? '1' : '',
47
+ 'tabs' => array(
48
+ array(
49
+ 'value' => '1',
50
+ 'label' => esc_html__( 'Automatic', 'wds' ),
51
+ ),
52
+ array(
53
+ 'value' => '',
54
+ 'label' => esc_html__( 'Manual', 'wds' ),
55
+ 'template' => 'sitemap/sitemap-manually-notify-search-engines',
56
+ ),
57
  ),
58
+ )
59
+ );
60
  ?>
61
  </div>
62
  </div>
63
  <?php
64
+ $this->render_view(
65
+ 'toggle-group',
66
+ array(
67
+ 'label' => esc_html__( 'Style sitemap', 'wds' ),
68
+ 'description' => esc_html__( 'Adds some nice styling to your sitemap.', 'wds' ),
69
+ 'separator' => true,
70
+ 'items' => array(
71
+ 'sitemap-stylesheet' => array(
72
+ 'label' => esc_html__( 'Include stylesheet with sitemap', 'wds' ),
73
+ 'description' => esc_html__( 'Note: This doesn’t affect your SEO and is purely visual.', 'wds' ),
74
+ 'value' => '1',
75
+ ),
76
  ),
77
+ )
78
+ );
79
  ?>
80
 
81
  <div class="sui-box-settings-row">
90
  </div>
91
  <div class="sui-box-settings-col-2">
92
  <?php
93
+ $this->render_view(
94
+ 'side-tabs',
95
+ array(
96
+ 'id' => 'wds-automatic-sitemap-updates-tabs',
97
+ 'name' => "{$option_name}[sitemap-disable-automatic-regeneration]",
98
+ 'value' => empty( $automatic_updates_disabled ) ? '' : '1',
99
+ 'tabs' => array(
100
+ array(
101
+ 'value' => '',
102
+ 'label' => esc_html__( 'Automatic', 'wds' ),
103
+ ),
104
+ array(
105
+ 'value' => '1',
106
+ 'label' => esc_html__( 'Manual', 'wds' ),
107
+ 'template' => 'sitemap/sitemap-manual-update-button',
108
+ ),
109
  ),
110
+ )
111
+ );
112
  ?>
113
  </div>
114
  </div>
115
 
116
  <div id="wds-troubleshooting-sitemap-placeholder"></div>
117
 
118
+ <?php $this->render_view(
119
+ 'sitemap/sitemap-deactivate-button',
120
+ array(
121
+ 'label_description' => esc_html__( 'If you no longer wish to use the Sitemap generator, you can deactivate it.', 'wds' ),
122
+ 'button_description' => esc_html__( 'Note: Sitemaps are crucial for helping search engines index all of your content effectively. We highly recommend you have a valid sitemap.', 'wds' ),
123
+ )
124
+ ); ?>
includes/admin/templates/sitemap/sitemap-section-news.php CHANGED
@@ -1,5 +1,8 @@
1
- <div class="wds-vertical-tab-section sui-box tab_news <?php echo $is_active ? '' : 'hidden'; ?>"
2
- id="tab_news">
 
 
 
3
  <div id="wds-news-sitemap-tab">
4
  <div class="sui-box">
5
  <div class="sui-box-header">
@@ -8,11 +11,13 @@
8
 
9
  <div class="sui-box-body">
10
  <p>
11
- <?php echo smartcrawl_format_link(
 
12
  esc_html__( 'Are you publishing newsworthy content? Use the Google News Sitemap to list news articles and posts published in the last 48 hours so that they show up in Google News. %s', 'wds' ),
13
  'https://wpmudev.com/docs/wpmu-dev-plugins/smartcrawl/#news-sitemap',
14
  esc_html__( 'Learn More', 'wds' )
15
- ); ?>
 
16
  </p>
17
  </div>
18
  </div>
1
+ <div
2
+ class="wds-vertical-tab-section sui-box tab_news
3
+ <?php echo $is_active ? '' : 'hidden'; ?>"
4
+ id="tab_news"
5
+ >
6
  <div id="wds-news-sitemap-tab">
7
  <div class="sui-box">
8
  <div class="sui-box-header">
11
 
12
  <div class="sui-box-body">
13
  <p>
14
+ <?php
15
+ echo smartcrawl_format_link( // phpcs:ignore
16
  esc_html__( 'Are you publishing newsworthy content? Use the Google News Sitemap to list news articles and posts published in the last 48 hours so that they show up in Google News. %s', 'wds' ),
17
  'https://wpmudev.com/docs/wpmu-dev-plugins/smartcrawl/#news-sitemap',
18
  esc_html__( 'Learn More', 'wds' )
19
+ );
20
+ ?>
21
  </p>
22
  </div>
23
  </div>
includes/admin/templates/sitemap/sitemap-section-reporting.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
- $cron = Smartcrawl_Controller_Cron::get();
3
  $option_name = $_view['option_name'];
4
 
5
- // This does the actual rescheduling
6
  $cron->set_up_schedule();
7
- $is_member = empty( $_view['is_member'] ) ? false : true;
8
  $crawler_cron_enabled = ! empty( $_view['options']['crawler-cron-enable'] ) && $is_member;
9
- $toggle_field_name = $option_name . '[crawler-cron-enable]';
10
- $dash_profile_data = smartcrawl_get_dash_profile_data();
11
- $crawler_freq = empty( $_view['options']['crawler-frequency'] ) ? false : $_view['options']['crawler-frequency'];
12
- $frequencies = $cron->get_frequencies();
13
- $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
14
  ?>
15
 
16
  <div class="wds-upsell-tab-description">
@@ -18,15 +18,20 @@ $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
18
  <p><?php esc_html_e( 'Set up SmartCrawl to automatically crawl your URLs daily, weekly or monthly and send an email report to your inbox.', 'wds' ); ?></p>
19
  </div>
20
 
21
- <?php if ( $crawler_cron_enabled && $dash_profile_data && $crawler_freq ): ?>
22
- <?php $this->_render( 'notice', array(
23
- 'message' => sprintf(
24
- 'Automatic crawls are enabled and sending %s to %d recipient.',
25
- smartcrawl_get_array_value( $frequencies, $crawler_freq ),
26
- count( $email_recipients )
27
- ),
28
- 'class' => 'sui-notice-info',
29
- ) ); ?>
 
 
 
 
 
30
  <?php endif; ?>
31
  </div>
32
  <div class="sui-box-settings-row <?php echo $is_member ? '' : 'sui-disabled'; ?>">
@@ -42,29 +47,37 @@ $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
42
  </div>
43
  <div class="sui-box-settings-col-2">
44
  <?php
45
- $this->_render( 'toggle-item', array(
46
- 'field_name' => $toggle_field_name,
47
- 'field_id' => $toggle_field_name,
48
- 'checked' => $crawler_cron_enabled,
49
- 'item_label' => esc_html__( 'Run regular URL crawls', 'wds' ),
50
- 'sub_settings_template' => 'sitemap/sitemap-reporting-toggle-sub-settings',
51
- 'sub_settings_template_args' => array(
52
- 'email_recipients' => $email_recipients,
53
- ),
54
- ) );
 
 
 
55
  ?>
56
  </div>
57
 
58
  </div>
59
 
60
- <?php if ( ! $is_member ): ?>
61
- <?php $this->_render( 'mascot-message', array(
62
- 'key' => 'seo-checkup-upsell',
63
- 'dismissible' => false,
64
- 'message' => sprintf(
65
- '%s <a target="_blank" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_sitemap_reporting_upsell_notice">%s</a>',
66
- esc_html__( 'Unlock automated crawls of your URLs to always stay on top of any issues with SmartCrawl Pro. Get Sitemap Reports as part of a WPMU DEV membership along with other pro plugins and services, 24/7 support and much more', 'wds' ),
67
- esc_html__( '- Try it all FREE today', 'wds' )
68
- ),
69
- ) ); ?>
 
 
 
 
 
70
  <?php endif; ?>
1
  <?php
2
+ $cron = Smartcrawl_Controller_Cron::get();
3
  $option_name = $_view['option_name'];
4
 
5
+ // This does the actual rescheduling.
6
  $cron->set_up_schedule();
7
+ $is_member = ! empty( $_view['is_member'] );
8
  $crawler_cron_enabled = ! empty( $_view['options']['crawler-cron-enable'] ) && $is_member;
9
+ $toggle_field_name = $option_name . '[crawler-cron-enable]';
10
+ $dash_profile_data = smartcrawl_get_dash_profile_data();
11
+ $crawler_freq = empty( $_view['options']['crawler-frequency'] ) ? false : $_view['options']['crawler-frequency'];
12
+ $frequencies = $cron->get_frequencies();
13
+ $email_recipients = empty( $email_recipients ) ? array() : $email_recipients;
14
  ?>
15
 
16
  <div class="wds-upsell-tab-description">
18
  <p><?php esc_html_e( 'Set up SmartCrawl to automatically crawl your URLs daily, weekly or monthly and send an email report to your inbox.', 'wds' ); ?></p>
19
  </div>
20
 
21
+ <?php if ( $crawler_cron_enabled && $dash_profile_data && $crawler_freq ) : ?>
22
+ <?php
23
+ $this->render_view(
24
+ 'notice',
25
+ array(
26
+ 'message' => sprintf(
27
+ 'Automatic crawls are enabled and sending %s to %d recipient.',
28
+ smartcrawl_get_array_value( $frequencies, $crawler_freq ),
29
+ count( $email_recipients )
30
+ ),
31
+ 'class' => 'sui-notice-info',
32
+ )
33
+ );
34
+ ?>
35
  <?php endif; ?>
36
  </div>
37
  <div class="sui-box-settings-row <?php echo $is_member ? '' : 'sui-disabled'; ?>">
47
  </div>
48
  <div class="sui-box-settings-col-2">
49
  <?php
50
+ $this->render_view(
51
+ 'toggle-item',
52
+ array(
53
+ 'field_name' => $toggle_field_name,
54
+ 'field_id' => $toggle_field_name,
55
+ 'checked' => $crawler_cron_enabled,
56
+ 'item_label' => esc_html__( 'Run regular URL crawls', 'wds' ),
57
+ 'sub_settings_template' => 'sitemap/sitemap-reporting-toggle-sub-settings',
58
+ 'sub_settings_template_args' => array(
59
+ 'email_recipients' => $email_recipients,
60
+ ),
61
+ )
62
+ );
63
  ?>
64
  </div>
65
 
66
  </div>
67
 
68
+ <?php if ( ! $is_member ) : ?>
69
+ <?php
70
+ $this->render_view(
71
+ 'mascot-message',
72
+ array(
73
+ 'key' => 'seo-checkup-upsell',
74
+ 'dismissible' => false,
75
+ 'message' => sprintf(
76
+ '%s <a target="_blank" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_sitemap_reporting_upsell_notice">%s</a>',
77
+ esc_html__( 'Unlock automated crawls of your URLs to always stay on top of any issues with SmartCrawl Pro. Get Sitemap Reports as part of a WPMU DEV membership along with other pro plugins and services, 24/7 support and much more', 'wds' ),
78
+ esc_html__( '- Try it all FREE today', 'wds' )
79
+ ),
80
+ )
81
+ );
82
+ ?>
83
  <?php endif; ?>
includes/admin/templates/sitemap/sitemap-section-settings.php CHANGED
@@ -4,13 +4,14 @@
4
  *
5
  * @package wpmu-dev-seo
6
  */
7
- $post_types = empty( $post_types ) ? array() : $post_types;
8
- $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
 
9
  $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
10
- $extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
11
- $ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
12
- $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
13
- $override_native = empty( $override_native ) ? false : $override_native;
14
 
15
  $arguments = array(
16
  'post_types' => $post_types,
@@ -22,7 +23,7 @@ $arguments = array(
22
  );
23
 
24
  if ( $override_native ) {
25
- $this->_render( 'sitemap/sitemap-smartcrawl', $arguments );
26
  } else {
27
- $this->_render( 'sitemap/sitemap-native', $arguments );
28
  }
4
  *
5
  * @package wpmu-dev-seo
6
  */
7
+
8
+ $post_types = empty( $post_types ) ? array() : $post_types;
9
+ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
10
  $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
11
+ $extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
12
+ $ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
13
+ $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
14
+ $override_native = ! empty( $override_native ) && $override_native; // phpcs:ignore
15
 
16
  $arguments = array(
17
  'post_types' => $post_types,
23
  );
24
 
25
  if ( $override_native ) {
26
+ $this->render_view( 'sitemap/sitemap-smartcrawl', $arguments );
27
  } else {
28
+ $this->render_view( 'sitemap/sitemap-native', $arguments );
29
  }
includes/admin/templates/sitemap/sitemap-section-url-crawler.php CHANGED
@@ -1,8 +1,14 @@
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
 
 
4
  */
 
5
  $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
6
- $this->_render( 'sitemap/sitemap-crawl-content', array(
7
- 'crawl_report' => $crawl_report,
8
- ) );
 
 
 
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
  $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
9
+ $this->render_view(
10
+ 'sitemap/sitemap-crawl-content',
11
+ array(
12
+ 'crawl_report' => $crawl_report,
13
+ )
14
+ );
includes/admin/templates/sitemap/sitemap-settings.php CHANGED
@@ -1,40 +1,50 @@
1
  <?php
2
- $crawl_url = Smartcrawl_Sitemap_Settings::crawl_url();
3
- $is_member = empty( $_view['is_member'] ) ? false : true;
4
- $active_tab = empty( $active_tab ) ? '' : $active_tab;
5
- $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
6
- $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
7
- $sitemaps_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
8
  $sitemap_crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
9
- $automatically_switched = empty( $automatically_switched ) ? false : $automatically_switched;
10
- $total_post_count = empty( $total_post_count ) ? 0 : $total_post_count;
11
- $email_recipients = Smartcrawl_Sitemap_Settings::get_email_recipients();
12
- $override_native = empty( $override_native ) ? false : $override_native;
13
- $ping_google = ! empty( $_view['options']['ping-google'] );
14
- $ping_bing = ! empty( $_view['options']['ping-bing'] );
15
  ?>
16
 
17
- <?php $this->_render( 'before-page-container' ); ?>
18
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-sitemap-settings' ); ?>">
19
 
20
- <?php $this->_render( 'page-header', array(
21
- 'title' => esc_html__( 'Sitemaps', 'wds' ),
22
- 'documentation_chapter' => 'sitemaps',
23
- 'utm_campaign' => 'smartcrawl_sitemap_docs',
24
- 'extra_actions' => $sitemap_crawler_available ? 'sitemap/sitemap-extra-actions' : '',
25
- ) ); ?>
 
 
 
 
 
26
 
27
- <?php $this->_render( 'floating-notices', array(
28
- 'message' => $ping_google || $ping_bing
29
- ? esc_html__( 'Your Sitemap is updated and Search Engines are being notified with changes.', 'wds' )
30
- : esc_html__( 'Your sitemap has been updated.', 'wds' ),
31
- 'keys' => array(
32
- 'wds-email-recipient-notice',
33
- 'wds-sitemap-manually-updated',
34
- 'wds-sitemap-manually-notify-search-engines',
35
- ),
36
- ) ); ?>
37
- <?php $this->_render( 'sitemap/sitemap-notices' ); ?>
 
 
 
 
 
38
 
39
  <?php
40
  if ( $sitemaps_enabled ) {
@@ -43,79 +53,97 @@ $ping_bing = ! empty( $_view['options']['ping-bing'] );
43
  <form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
44
  <?php $this->settings_fields( $_view['option_name'] ); ?>
45
 
46
- <input type="hidden"
47
- name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
48
- value="1">
49
-
50
- <?php if ( $sitemap_crawler_available ): ?>
 
51
  <div id="wds-crawl-summary-container">
52
- <?php $this->_render( 'sitemap/sitemap-crawl-stats', array(
53
- 'crawl_report' => $crawl_report,
54
- 'override_native' => $override_native,
55
- ) ); ?>
 
 
 
 
 
56
  </div>
57
  <?php endif; ?>
58
 
59
  <div class="wds-vertical-tabs-container sui-row-with-sidenav" id="sitemap-settings-tabs">
60
 
61
- <?php $this->_render( 'sitemap/sitemap-side-nav', array(
62
- 'active_tab' => $active_tab,
63
- 'sitemap_crawler_available' => $sitemap_crawler_available,
64
- 'override_native' => $override_native,
65
- ) ); ?>
 
 
 
 
 
66
 
67
  <?php
68
- // The last tab is on top in the markup because we want the item-per-sitemap setting in the native sitemap tab to override the regular field
69
- $settings_tab = $this->_load( 'vertical-tab', array(
70
- 'tab_id' => 'tab_settings',
71
- 'tab_name' => esc_html__( 'Settings', 'wds' ),
72
- 'is_active' => 'tab_settings' === $active_tab,
73
- 'tab_sections' => array(
74
- array( 'section_template' => 'sitemap/sitemap-section-advanced' ),
75
- ),
76
- ) );
 
 
 
77
  if ( $override_native ) {
78
- echo $settings_tab;
79
  } else {
80
- printf( '<div style="display: none;">%s</div>', $settings_tab );
81
  }
82
  ?>
83
 
84
  <?php
85
- $this->_render( 'sitemap/sitemap-section-news', array(
86
- 'is_active' => 'tab_news' === $active_tab,
87
- ) );
 
 
 
88
 
89
- $this->_render( 'vertical-tab', array(
90
- 'tab_id' => 'tab_sitemap',
91
- 'tab_name' =>
92
- $override_native
93
- ? esc_html__( 'General Sitemap', 'wds' )
94
- : esc_html__( 'WP Core Sitemap', 'wds' ),
95
- 'is_active' => 'tab_sitemap' === $active_tab,
96
- 'tab_sections' => array(
97
- array(
98
- 'section_description' =>
99
- $override_native
100
- ? esc_html__( 'Automatically generate a sitemap and regularly send updates to Google.', 'wds' )
101
- : esc_html__( 'Set up your sitemaps to tell search engines what content you want them to crawl and index.', 'wds' ),
102
- 'section_template' => 'sitemap/sitemap-section-settings',
103
- 'section_args' => array(
104
- 'post_types' => $post_types,
105
- 'taxonomies' => $taxonomies,
106
- 'smartcrawl_buddypress' => $smartcrawl_buddypress,
107
- 'extra_urls' => ! empty( $extra_urls ) ? $extra_urls : '',
108
- 'ignore_urls' => ! empty( $ignore_urls ) ? $ignore_urls : '',
109
- 'ignore_post_ids' => ! empty( $ignore_post_ids ) ? $ignore_post_ids : '',
110
- 'override_native' => $override_native,
111
  ),
112
  ),
113
- ),
114
- ) );
115
  ?>
116
 
117
- <?php if ( $sitemap_crawler_available ) {
118
- $this->_render(
 
119
  'vertical-tab',
120
  array(
121
  'tab_id' => 'tab_url_crawler',
@@ -133,7 +161,7 @@ $ping_bing = ! empty( $_view['options']['ping-bing'] );
133
  )
134
  );
135
 
136
- $this->_render(
137
  'vertical-tab-upsell',
138
  array(
139
  'tab_id' => 'tab_url_crawler_reporting',
@@ -151,13 +179,16 @@ $ping_bing = ! empty( $_view['options']['ping-bing'] );
151
  ),
152
  )
153
  );
154
- } ?>
 
155
  </div>
156
  </form>
157
- <?php } else {
158
- $this->_render( 'sitemap/sitemap-disabled' );
159
- } ?>
160
- <?php $this->_render( 'footer' ); ?>
161
- <?php $this->_render( 'upsell-modal' ); ?>
 
 
162
 
163
  </div><!-- end wds-sitemap-settings -->
1
  <?php
2
+ $crawl_url = Smartcrawl_Sitemap_Settings::crawl_url();
3
+ $is_member = empty( $_view['is_member'] ) ? false : true;
4
+ $active_tab = empty( $active_tab ) ? '' : $active_tab;
5
+ $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
6
+ $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
7
+ $sitemaps_enabled = Smartcrawl_Settings::get_setting( 'sitemap' );
8
  $sitemap_crawler_available = Smartcrawl_Sitemap_Utils::crawler_available();
9
+ $automatically_switched = empty( $automatically_switched ) ? false : $automatically_switched;
10
+ $total_post_count = empty( $total_post_count ) ? 0 : $total_post_count;
11
+ $email_recipients = Smartcrawl_Sitemap_Settings::get_email_recipients();
12
+ $override_native = empty( $override_native ) ? false : $override_native;
13
+ $ping_google = ! empty( $_view['options']['ping-google'] );
14
+ $ping_bing = ! empty( $_view['options']['ping-bing'] );
15
  ?>
16
 
17
+ <?php $this->render_view( 'before-page-container' ); ?>
18
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-sitemap-settings' ); ?>">
19
 
20
+ <?php
21
+ $this->render_view(
22
+ 'page-header',
23
+ array(
24
+ 'title' => esc_html__( 'Sitemaps', 'wds' ),
25
+ 'documentation_chapter' => 'sitemaps',
26
+ 'utm_campaign' => 'smartcrawl_sitemap_docs',
27
+ 'extra_actions' => $sitemap_crawler_available ? 'sitemap/sitemap-extra-actions' : '',
28
+ )
29
+ );
30
+ ?>
31
 
32
+ <?php
33
+ $this->render_view(
34
+ 'floating-notices',
35
+ array(
36
+ 'message' => $ping_google || $ping_bing
37
+ ? esc_html__( 'Your Sitemap is updated and Search Engines are being notified with changes.', 'wds' )
38
+ : esc_html__( 'Your sitemap has been updated.', 'wds' ),
39
+ 'keys' => array(
40
+ 'wds-email-recipient-notice',
41
+ 'wds-sitemap-manually-updated',
42
+ 'wds-sitemap-manually-notify-search-engines',
43
+ ),
44
+ )
45
+ );
46
+ ?>
47
+ <?php $this->render_view( 'sitemap/sitemap-notices' ); ?>
48
 
49
  <?php
50
  if ( $sitemaps_enabled ) {
53
  <form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
54
  <?php $this->settings_fields( $_view['option_name'] ); ?>
55
 
56
+ <input
57
+ type="hidden"
58
+ name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
59
+ value="1"
60
+ >
61
+ <?php if ( $sitemap_crawler_available ) : ?>
62
  <div id="wds-crawl-summary-container">
63
+ <?php
64
+ $this->render_view(
65
+ 'sitemap/sitemap-crawl-stats',
66
+ array(
67
+ 'crawl_report' => $crawl_report,
68
+ 'override_native' => $override_native,
69
+ )
70
+ );
71
+ ?>
72
  </div>
73
  <?php endif; ?>
74
 
75
  <div class="wds-vertical-tabs-container sui-row-with-sidenav" id="sitemap-settings-tabs">
76
 
77
+ <?php
78
+ $this->render_view(
79
+ 'sitemap/sitemap-side-nav',
80
+ array(
81
+ 'active_tab' => $active_tab,
82
+ 'sitemap_crawler_available' => $sitemap_crawler_available,
83
+ 'override_native' => $override_native,
84
+ )
85
+ );
86
+ ?>
87
 
88
  <?php
89
+ // The last tab is on top in the markup because we want the item-per-sitemap setting in the native sitemap tab to override the regular field.
90
+ $settings_tab = $this->load_view(
91
+ 'vertical-tab',
92
+ array(
93
+ 'tab_id' => 'tab_settings',
94
+ 'tab_name' => esc_html__( 'Settings', 'wds' ),
95
+ 'is_active' => 'tab_settings' === $active_tab,
96
+ 'tab_sections' => array(
97
+ array( 'section_template' => 'sitemap/sitemap-section-advanced' ),
98
+ ),
99
+ )
100
+ );
101
  if ( $override_native ) {
102
+ echo $settings_tab; // phpcs:ignore
103
  } else {
104
+ printf( '<div style="display: none;">%s</div>', $settings_tab ); // phpcs:ignore
105
  }
106
  ?>
107
 
108
  <?php
109
+ $this->render_view(
110
+ 'sitemap/sitemap-section-news',
111
+ array(
112
+ 'is_active' => 'tab_news' === $active_tab,
113
+ )
114
+ );
115
 
116
+ $this->render_view(
117
+ 'vertical-tab',
118
+ array(
119
+ 'tab_id' => 'tab_sitemap',
120
+ 'tab_name' =>
121
+ $override_native
122
+ ? esc_html__( 'General Sitemap', 'wds' )
123
+ : esc_html__( 'WP Core Sitemap', 'wds' ),
124
+ 'is_active' => 'tab_sitemap' === $active_tab,
125
+ 'tab_sections' => array(
126
+ array(
127
+ 'section_description' => $override_native ? esc_html__( 'Automatically generate a sitemap and regularly send updates to Google.', 'wds' ) : esc_html__( 'Set up your sitemaps to tell search engines what content you want them to crawl and index.', 'wds' ),
128
+ 'section_template' => 'sitemap/sitemap-section-settings',
129
+ 'section_args' => array(
130
+ 'post_types' => $post_types,
131
+ 'taxonomies' => $taxonomies,
132
+ 'smartcrawl_buddypress' => $smartcrawl_buddypress,
133
+ 'extra_urls' => ! empty( $extra_urls ) ? $extra_urls : '',
134
+ 'ignore_urls' => ! empty( $ignore_urls ) ? $ignore_urls : '',
135
+ 'ignore_post_ids' => ! empty( $ignore_post_ids ) ? $ignore_post_ids : '',
136
+ 'override_native' => $override_native,
137
+ ),
138
  ),
139
  ),
140
+ )
141
+ );
142
  ?>
143
 
144
+ <?php
145
+ if ( $sitemap_crawler_available ) {
146
+ $this->render_view(
147
  'vertical-tab',
148
  array(
149
  'tab_id' => 'tab_url_crawler',
161
  )
162
  );
163
 
164
+ $this->render_view(
165
  'vertical-tab-upsell',
166
  array(
167
  'tab_id' => 'tab_url_crawler_reporting',
179
  ),
180
  )
181
  );
182
+ }
183
+ ?>
184
  </div>
185
  </form>
186
+ <?php
187
+ } else {
188
+ $this->render_view( 'sitemap/sitemap-disabled' );
189
+ }
190
+ ?>
191
+ <?php $this->render_view( 'footer' ); ?>
192
+ <?php $this->render_view( 'upsell-modal' ); ?>
193
 
194
  </div><!-- end wds-sitemap-settings -->
includes/admin/templates/sitemap/sitemap-side-nav.php CHANGED
@@ -1,28 +1,31 @@
1
  <?php
2
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
 
3
  /**
 
 
4
  * @var Smartcrawl_SeoReport $crawl_report
5
  */
6
- $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
7
- $active_issues = empty( $crawl_report ) ? 0 : $crawl_report->get_issues_count();
8
- $is_member = empty( $_view['is_member'] ) ? false : true;
9
- $crawler_cron_enabled = ! empty( $_view['options']['crawler-cron-enable'] ) && $is_member;
10
  $sitemap_crawler_available = empty( $sitemap_crawler_available ) ? false : $sitemap_crawler_available;
11
- $tabs = array();
12
- $override_native = empty( $override_native ) ? false : $override_native;
13
 
14
- $tabs[] = array(
15
  'id' => 'tab_sitemap',
16
  'name' => $override_native
17
  ? esc_html__( 'General Sitemap', 'wds' )
18
  : esc_html__( 'WP Core Sitemap', 'wds' ),
19
  );
20
- $tabs[] = array(
21
  'id' => 'tab_news',
22
  'name' => esc_html__( 'News Sitemap', 'wds' ),
23
  );
24
  if ( $sitemap_crawler_available ) {
25
- $tabs[] = array(
26
  'id' => 'tab_url_crawler',
27
  'name' => esc_html__( 'Crawler', 'wds' ),
28
  'spinner' => $crawl_report && $crawl_report->is_in_progress(),
@@ -32,20 +35,23 @@ if ( $sitemap_crawler_available ) {
32
  'tick_class' => 'sui-success',
33
  );
34
 
35
- $tabs[] = array(
36
  'id' => 'tab_url_crawler_reporting',
37
  'name' => esc_html__( 'Reporting', 'wds' ),
38
  'tick' => $crawler_cron_enabled,
39
  );
40
  }
41
  if ( $override_native ) {
42
- $tabs[] = array(
43
  'id' => 'tab_settings',
44
  'name' => esc_html__( 'Settings', 'wds' ),
45
  );
46
  }
47
 
48
- $this->_render( 'vertical-tabs-side-nav', array(
49
- 'active_tab' => $active_tab,
50
- 'tabs' => $tabs,
51
- ) );
 
 
 
1
  <?php
2
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
+
4
  /**
5
+ * Report.
6
+ *
7
  * @var Smartcrawl_SeoReport $crawl_report
8
  */
9
+ $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
10
+ $active_issues = empty( $crawl_report ) ? 0 : $crawl_report->get_issues_count();
11
+ $is_member = empty( $_view['is_member'] ) ? false : true;
12
+ $crawler_cron_enabled = ! empty( $_view['options']['crawler-cron-enable'] ) && $is_member;
13
  $sitemap_crawler_available = empty( $sitemap_crawler_available ) ? false : $sitemap_crawler_available;
14
+ $tab_items = array();
15
+ $override_native = empty( $override_native ) ? false : $override_native;
16
 
17
+ $tab_items[] = array(
18
  'id' => 'tab_sitemap',
19
  'name' => $override_native
20
  ? esc_html__( 'General Sitemap', 'wds' )
21
  : esc_html__( 'WP Core Sitemap', 'wds' ),
22
  );
23
+ $tab_items[] = array(
24
  'id' => 'tab_news',
25
  'name' => esc_html__( 'News Sitemap', 'wds' ),
26
  );
27
  if ( $sitemap_crawler_available ) {
28
+ $tab_items[] = array(
29
  'id' => 'tab_url_crawler',
30
  'name' => esc_html__( 'Crawler', 'wds' ),
31
  'spinner' => $crawl_report && $crawl_report->is_in_progress(),
35
  'tick_class' => 'sui-success',
36
  );
37
 
38
+ $tab_items[] = array(
39
  'id' => 'tab_url_crawler_reporting',
40
  'name' => esc_html__( 'Reporting', 'wds' ),
41
  'tick' => $crawler_cron_enabled,
42
  );
43
  }
44
  if ( $override_native ) {
45
+ $tab_items[] = array(
46
  'id' => 'tab_settings',
47
  'name' => esc_html__( 'Settings', 'wds' ),
48
  );
49
  }
50
 
51
+ $this->render_view(
52
+ 'vertical-tabs-side-nav',
53
+ array(
54
+ 'active_tab' => $active_tab,
55
+ 'tabs' => $tab_items,
56
+ )
57
+ );
includes/admin/templates/sitemap/sitemap-smartcrawl.php CHANGED
@@ -1,29 +1,35 @@
1
  <?php
2
- $post_types = empty( $post_types ) ? array() : $post_types;
3
- $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
4
- $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
5
- $extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
6
- $ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
7
- $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
8
- $sitemap_cache = Smartcrawl_Sitemap_Cache::get();
9
  $native_sitemap_available = function_exists( 'wp_sitemaps_get_server' );
10
 
11
  if ( $sitemap_cache->is_writable() ) {
12
- $this->_render( 'notice', array(
13
- 'message' => sprintf(
14
- esc_html__( 'Your sitemap is available at %s', 'wds' ),
15
- sprintf( '<a target="_blank" href="%s">/sitemap.xml</a>', esc_attr( smartcrawl_get_sitemap_url() ) )
16
- ),
17
- 'class' => 'sui-notice-info',
18
- ) );
 
 
 
19
  } else {
20
- $this->_render( 'notice', array(
21
- 'message' => sprintf(
22
- esc_html__( 'Unable to write to sitemap file in: %s', 'wds' ),
23
- sprintf( '<code>%s</code>', esc_html( $sitemap_cache->get_cache_dir() ) )
24
- ),
25
- 'class' => 'sui-notice-error',
26
- ) );
 
 
 
27
  }
28
  if ( $native_sitemap_available ) {
29
  ?>
@@ -33,14 +39,15 @@ if ( $native_sitemap_available ) {
33
  <?php esc_html_e( 'Switch to WP core Sitemap', 'wds' ); ?>
34
  </label>
35
  <p class="sui-description">
36
- <?php esc_html_e( 'Switch to customize the native Wordpress core Sitemap.', 'wds' ); ?>
37
  </p>
38
  </div>
39
  <div class="sui-box-settings-col-2">
40
- <button type="button"
41
- id="wds-switch-to-native-sitemap"
42
- class="sui-button sui-button-ghost">
43
-
 
44
  <span class="sui-icon-defer" aria-hidden="true"></span>
45
  <?php esc_html_e( 'Switch', 'wds' ); ?>
46
  </button>
@@ -52,13 +59,16 @@ if ( $native_sitemap_available ) {
52
  </div>
53
  <?php
54
  }
55
- $this->_render( 'sitemap/sitemap-switch-to-native-modal', array() );
56
 
57
- $this->_render( 'sitemap/sitemap-common-settings', array(
58
- 'post_types' => $post_types,
59
- 'taxonomies' => $taxonomies,
60
- 'smartcrawl_buddypress' => $smartcrawl_buddypress,
61
- 'extra_urls' => $extra_urls,
62
- 'ignore_urls' => $ignore_urls,
63
- 'ignore_post_ids' => $ignore_post_ids,
64
- ) );
 
 
 
1
  <?php
2
+ $post_types = empty( $post_types ) ? array() : $post_types;
3
+ $taxonomies = empty( $taxonomies ) ? array() : $taxonomies;
4
+ $smartcrawl_buddypress = empty( $smartcrawl_buddypress ) ? array() : $smartcrawl_buddypress;
5
+ $extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
6
+ $ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
7
+ $ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
8
+ $sitemap_cache = Smartcrawl_Sitemap_Cache::get();
9
  $native_sitemap_available = function_exists( 'wp_sitemaps_get_server' );
10
 
11
  if ( $sitemap_cache->is_writable() ) {
12
+ $this->render_view(
13
+ 'notice',
14
+ array(
15
+ 'message' => sprintf(
16
+ esc_html__( 'Your sitemap is available at %s', 'wds' ),
17
+ sprintf( '<a target="_blank" href="%s">/sitemap.xml</a>', esc_attr( smartcrawl_get_sitemap_url() ) )
18
+ ),
19
+ 'class' => 'sui-notice-info',
20
+ )
21
+ );
22
  } else {
23
+ $this->render_view(
24
+ 'notice',
25
+ array(
26
+ 'message' => sprintf(
27
+ esc_html__( 'Unable to write to sitemap file in: %s', 'wds' ),
28
+ sprintf( '<code>%s</code>', esc_html( $sitemap_cache->get_cache_dir() ) )
29
+ ),
30
+ 'class' => 'sui-notice-error',
31
+ )
32
+ );
33
  }
34
  if ( $native_sitemap_available ) {
35
  ?>
39
  <?php esc_html_e( 'Switch to WP core Sitemap', 'wds' ); ?>
40
  </label>
41
  <p class="sui-description">
42
+ <?php esc_html_e( 'Switch to customize the native WordPress core Sitemap.', 'wds' ); ?>
43
  </p>
44
  </div>
45
  <div class="sui-box-settings-col-2">
46
+ <button
47
+ type="button"
48
+ id="wds-switch-to-native-sitemap"
49
+ class="sui-button sui-button-ghost"
50
+ >
51
  <span class="sui-icon-defer" aria-hidden="true"></span>
52
  <?php esc_html_e( 'Switch', 'wds' ); ?>
53
  </button>
59
  </div>
60
  <?php
61
  }
62
+ $this->render_view( 'sitemap/sitemap-switch-to-native-modal', array() );
63
 
64
+ $this->render_view(
65
+ 'sitemap/sitemap-common-settings',
66
+ array(
67
+ 'post_types' => $post_types,
68
+ 'taxonomies' => $taxonomies,
69
+ 'smartcrawl_buddypress' => $smartcrawl_buddypress,
70
+ 'extra_urls' => $extra_urls,
71
+ 'ignore_urls' => $ignore_urls,
72
+ 'ignore_post_ids' => $ignore_post_ids,
73
+ )
74
+ );
includes/admin/templates/sitemap/sitemap-split-setting.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $items_per_sitemap = Smartcrawl_Sitemap_Utils::get_items_per_sitemap();
4
  ?>
5
  <div class="sui-box-settings-row">
@@ -15,16 +15,20 @@ $items_per_sitemap = Smartcrawl_Sitemap_Utils::get_items_per_sitemap();
15
  <label for="items-per-sitemap" class="sui-label">
16
  <?php echo esc_html__( 'Number of links per sitemap', 'wds' ); ?>
17
  </label>
18
- <input type="number"
19
- id="items-per-sitemap"
20
- class="sui-form-control sui-input-sm"
21
- value="<?php echo esc_attr( $items_per_sitemap ); ?>"
22
- name="<?php echo esc_attr( $option_name ); ?>[items-per-sitemap]"/>
 
 
23
  <p class="sui-description">
24
- <?php printf(
 
25
  esc_html__( 'Choose how many URLs each sitemap has, up to %s. A higher number will use more server resources to generate.', 'wds' ),
26
- Smartcrawl_Sitemap_Utils::get_max_items_per_sitemap()
27
- ); ?>
 
28
  </p>
29
  </div>
30
  </div>
1
  <?php
2
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
3
  $items_per_sitemap = Smartcrawl_Sitemap_Utils::get_items_per_sitemap();
4
  ?>
5
  <div class="sui-box-settings-row">
15
  <label for="items-per-sitemap" class="sui-label">
16
  <?php echo esc_html__( 'Number of links per sitemap', 'wds' ); ?>
17
  </label>
18
+ <input
19
+ type="number"
20
+ id="items-per-sitemap"
21
+ class="sui-form-control sui-input-sm"
22
+ value="<?php echo esc_attr( $items_per_sitemap ); ?>"
23
+ name="<?php echo esc_attr( $option_name ); ?>[items-per-sitemap]"
24
+ />
25
  <p class="sui-description">
26
+ <?php
27
+ printf(
28
  esc_html__( 'Choose how many URLs each sitemap has, up to %s. A higher number will use more server resources to generate.', 'wds' ),
29
+ esc_html( Smartcrawl_Sitemap_Utils::get_max_items_per_sitemap() )
30
+ );
31
+ ?>
32
  </p>
33
  </div>
34
  </div>
includes/admin/templates/sitemap/sitemap-switch-to-native-modal-body.php CHANGED
@@ -1,14 +1,16 @@
1
- <button type="button"
2
- class="sui-button sui-button-ghost wds-cancel-button"
3
- data-modal-close>
4
-
 
5
  <?php esc_html_e( 'Cancel', 'wds' ); ?>
6
  </button>
7
 
8
- <button type="button"
9
- id="wds-switch-to-native-button"
10
- class="sui-button sui-button-blue">
11
-
 
12
  <span class="sui-loading-text">
13
  <span class="sui-icon-defer" aria-hidden="true"></span>
14
  <?php esc_html_e( 'Switch', 'wds' ); ?>
1
+ <button
2
+ type="button"
3
+ class="sui-button sui-button-ghost wds-cancel-button"
4
+ data-modal-close
5
+ >
6
  <?php esc_html_e( 'Cancel', 'wds' ); ?>
7
  </button>
8
 
9
+ <button
10
+ type="button"
11
+ id="wds-switch-to-native-button"
12
+ class="sui-button sui-button-blue"
13
+ >
14
  <span class="sui-loading-text">
15
  <span class="sui-icon-defer" aria-hidden="true"></span>
16
  <?php esc_html_e( 'Switch', 'wds' ); ?>
includes/admin/templates/sitemap/sitemap-switch-to-native-modal.php CHANGED
@@ -1,9 +1,12 @@
1
  <?php
2
 
3
- $this->_render( 'modal', array(
4
- 'id' => 'wds-switch-to-native-modal',
5
- 'title' => esc_html__( 'Are you sure?', 'wds' ),
6
- 'description' => esc_html__( 'The powerful SmartCrawl sitemap ensures search engines index all of your posts and pages. Are you sure you wish to switch to the WordPress core sitemap?', 'wds' ),
7
- 'body_template' => 'sitemap/sitemap-switch-to-native-modal-body',
8
- 'small' => true,
9
- ) );
 
 
 
1
  <?php
2
 
3
+ $this->render_view(
4
+ 'modal',
5
+ array(
6
+ 'id' => 'wds-switch-to-native-modal',
7
+ 'title' => esc_html__( 'Are you sure?', 'wds' ),
8
+ 'description' => esc_html__( 'The powerful SmartCrawl sitemap ensures search engines index all of your posts and pages. Are you sure you wish to switch to the WordPress core sitemap?', 'wds' ),
9
+ 'body_template' => 'sitemap/sitemap-switch-to-native-modal-body',
10
+ 'small' => true,
11
+ )
12
+ );
includes/admin/templates/sitemap/sitemap-switch-to-smartcrawl-modal-body.php CHANGED
@@ -1,18 +1,19 @@
1
- <button type="button"
2
- class="sui-button sui-button-ghost"
3
- data-modal-close>
4
-
 
5
  <?php esc_html_e( 'Cancel', 'wds' ); ?>
6
  </button>
7
 
8
- <button type="button"
9
- id="wds-switch-to-smartcrawl-button"
10
- class="sui-button sui-button-blue">
11
-
 
12
  <span class="sui-loading-text">
13
  <span class="sui-icon-defer" aria-hidden="true"></span>
14
  <?php esc_html_e( 'Switch', 'wds' ); ?>
15
  </span>
16
-
17
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
18
  </button>
1
+ <button
2
+ type="button"
3
+ class="sui-button sui-button-ghost"
4
+ data-modal-close
5
+ >
6
  <?php esc_html_e( 'Cancel', 'wds' ); ?>
7
  </button>
8
 
9
+ <button
10
+ type="button"
11
+ id="wds-switch-to-smartcrawl-button"
12
+ class="sui-button sui-button-blue"
13
+ >
14
  <span class="sui-loading-text">
15
  <span class="sui-icon-defer" aria-hidden="true"></span>
16
  <?php esc_html_e( 'Switch', 'wds' ); ?>
17
  </span>
 
18
  <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
19
  </button>
includes/admin/templates/sitemap/sitemap-switch-to-smartcrawl-modal.php CHANGED
@@ -1,9 +1,12 @@
1
  <?php
2
 
3
- $this->_render( 'modal', array(
4
- 'id' => 'wds-switch-to-smartcrawl-modal',
5
- 'title' => esc_html__( 'Are you sure?', 'wds' ),
6
- 'description' => esc_html__( "Please confirm that you wish to switch to SmartCrawl's powerful sitemap. You can switch back to the WordPress core sitemap at anytime.", 'wds' ),
7
- 'body_template' => 'sitemap/sitemap-switch-to-smartcrawl-modal-body',
8
- 'small' => true,
9
- ) );
 
 
 
1
  <?php
2
 
3
+ $this->render_view(
4
+ 'modal',
5
+ array(
6
+ 'id' => 'wds-switch-to-smartcrawl-modal',
7
+ 'title' => esc_html__( 'Are you sure?', 'wds' ),
8
+ 'description' => esc_html__( "Please confirm that you wish to switch to SmartCrawl's powerful sitemap. You can switch back to the WordPress core sitemap at anytime.", 'wds' ),
9
+ 'body_template' => 'sitemap/sitemap-switch-to-smartcrawl-modal-body',
10
+ 'small' => true,
11
+ )
12
+ );
includes/admin/templates/sitemap/sitemap-url-crawler-tab-title-left.php CHANGED
@@ -1,22 +1,29 @@
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
 
 
4
  */
5
- $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
 
6
  $active_issues = empty( $crawl_report ) ? 0 : (int) $crawl_report->get_issues_count();
7
- $is_member = empty( $_view['is_member'] ) ? false : true;
8
- $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_sitemap_crawler_pro_tag';
9
 
10
- if ( $is_member ): ?>
11
- <span class="sui-tag sui-tag-warning"
12
- style="<?php echo $active_issues ? '' : 'display:none;'; ?>">
 
 
13
  <?php echo esc_html( $active_issues ); ?>
14
  </span>
15
- <?php else: ?>
16
  <a target="_blank" href="<?php echo esc_attr( $upgrade_url ); ?>">
17
- <span class="sui-tag sui-tag-pro sui-tooltip"
18
- data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>">
19
- <?php esc_html_e( 'Pro', 'wds' ); ?>
20
- </span>
 
 
21
  </a>
22
  <?php endif; ?>
1
  <?php
2
  /**
3
  * @var Smartcrawl_SeoReport $crawl_report
4
+ *
5
+ * @package SmartCrawl
6
  */
7
+
8
+ $crawl_report = empty( $_view['crawl_report'] ) ? null : $_view['crawl_report'];
9
  $active_issues = empty( $crawl_report ) ? 0 : (int) $crawl_report->get_issues_count();
10
+ $is_member = ! empty( $_view['is_member'] );
11
+ $upgrade_url = 'https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_sitemap_crawler_pro_tag';
12
 
13
+ if ( $is_member ) : ?>
14
+ <span
15
+ class="sui-tag sui-tag-warning"
16
+ style="<?php echo $active_issues ? '' : 'display:none;'; ?>"
17
+ >
18
  <?php echo esc_html( $active_issues ); ?>
19
  </span>
20
+ <?php else : ?>
21
  <a target="_blank" href="<?php echo esc_attr( $upgrade_url ); ?>">
22
+ <span
23
+ class="sui-tag sui-tag-pro sui-tooltip"
24
+ data-tooltip="<?php esc_attr_e( 'Try SmartCrawl Pro Free', 'wds' ); ?>"
25
+ >
26
+ <?php esc_html_e( 'Pro', 'wds' ); ?>
27
+ </span>
28
  </a>
29
  <?php endif; ?>
includes/admin/templates/sitemap/sitemap-xsl.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
  $whitelabel = ! empty( $whitelabel );
3
- $template = empty( $template ) ? '' : $template;
4
  if ( ! in_array( $template, array( 'sitemapIndexBody', 'sitemapBody', 'newsSitemapBody' ) ) ) {
5
  return;
6
  }
@@ -167,16 +167,16 @@ if ( ! in_array( $template, array( 'sitemapIndexBody', 'sitemapBody', 'newsSitem
167
 
168
  <xsl:template name="sitemapHeader" match="/">
169
  <div class="header">
170
- <span>Powered by
171
- <a target="_blank" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/">SmartCrawl</a>
172
- </span>
173
  </div>
174
  </xsl:template>
175
 
176
  <xsl:template name="sitemapFooter" match="/">
177
  <p class="footer">
178
  This is an XML Sitemap, meant for consumption by search engines. For more info visit <a
179
- href="http://sitemaps.org">sitemaps.org</a>.
180
  </p>
181
  </xsl:template>
182
 
@@ -222,7 +222,7 @@ if ( ! in_array( $template, array( 'sitemapIndexBody', 'sitemapBody', 'newsSitem
222
  </td>
223
  <td>
224
  <xsl:value-of
225
- select="concat(substring(news:news/news:publication_date,0,11),concat(' ', substring(news:news/news:publication_date,12,5)))"/>
226
  </td>
227
  </tr>
228
  </xsl:for-each>
@@ -280,7 +280,7 @@ if ( ! in_array( $template, array( 'sitemapIndexBody', 'sitemapBody', 'newsSitem
280
  </td>
281
  <td>
282
  <xsl:value-of
283
- select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
284
  </td>
285
  </tr>
286
  </xsl:for-each>
@@ -326,7 +326,7 @@ if ( ! in_array( $template, array( 'sitemapIndexBody', 'sitemapBody', 'newsSitem
326
  </td>
327
  <td>
328
  <xsl:value-of
329
- select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
330
  </td>
331
  </tr>
332
  </xsl:for-each>
@@ -341,7 +341,7 @@ if ( ! in_array( $template, array( 'sitemapIndexBody', 'sitemapBody', 'newsSitem
341
  <head>
342
  <xsl:call-template name="sitemapHead"/>
343
 
344
- <?php if ( $whitelabel ): ?>
345
  <style>
346
  .header {
347
  display: none;
1
+ <?php // phpcs:disable
2
  $whitelabel = ! empty( $whitelabel );
3
+ $template = empty( $template ) ? '' : $template;
4
  if ( ! in_array( $template, array( 'sitemapIndexBody', 'sitemapBody', 'newsSitemapBody' ) ) ) {
5
  return;
6
  }
167
 
168
  <xsl:template name="sitemapHeader" match="/">
169
  <div class="header">
170
+ <span>Powered by
171
+ <a target="_blank" href="https://wpmudev.com/project/smartcrawl-wordpress-seo/">SmartCrawl</a>
172
+ </span>
173
  </div>
174
  </xsl:template>
175
 
176
  <xsl:template name="sitemapFooter" match="/">
177
  <p class="footer">
178
  This is an XML Sitemap, meant for consumption by search engines. For more info visit <a
179
+ href="http://sitemaps.org">sitemaps.org</a>.
180
  </p>
181
  </xsl:template>
182
 
222
  </td>
223
  <td>
224
  <xsl:value-of
225
+ select="concat(substring(news:news/news:publication_date,0,11),concat(' ', substring(news:news/news:publication_date,12,5)))"/>
226
  </td>
227
  </tr>
228
  </xsl:for-each>
280
  </td>
281
  <td>
282
  <xsl:value-of
283
+ select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
284
  </td>
285
  </tr>
286
  </xsl:for-each>
326
  </td>
327
  <td>
328
  <xsl:value-of
329
+ select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
330
  </td>
331
  </tr>
332
  </xsl:for-each>
341
  <head>
342
  <xsl:call-template name="sitemapHead"/>
343
 
344
+ <?php if ( $whitelabel ) : ?>
345
  <style>
346
  .header {
347
  display: none;
includes/admin/templates/social-image-item.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $id = empty( $id ) ? '' : $id;
3
  if ( empty( $url ) ) {
4
  $url = is_numeric( $id )
5
  ? smartcrawl_get_array_value( wp_get_attachment_image_src( $id, 'thumbnail' ), 0 )
@@ -9,9 +9,11 @@ $field_name = empty( $field_name ) ? '' : $field_name;
9
  ?>
10
  <div class="og-image item">
11
  <img src="<?php echo esc_attr( $url ); ?>"/>
12
- <input type="hidden"
13
- value="<?php echo esc_attr( $id ); ?>"
14
- name="<?php echo esc_attr( $field_name ); ?>"/>
 
 
15
  <a href="#remove" class="remove-action">
16
  <span class="sui-icon-close" aria-hidden="true"></span>
17
  </a>
1
  <?php
2
+ $id = empty( $id ) ? '' : $id; // phpcs:ignore
3
  if ( empty( $url ) ) {
4
  $url = is_numeric( $id )
5
  ? smartcrawl_get_array_value( wp_get_attachment_image_src( $id, 'thumbnail' ), 0 )
9
  ?>
10
  <div class="og-image item">
11
  <img src="<?php echo esc_attr( $url ); ?>"/>
12
+ <input
13
+ type="hidden"
14
+ value="<?php echo esc_attr( $id ); ?>"
15
+ name="<?php echo esc_attr( $field_name ); ?>"
16
+ />
17
  <a href="#remove" class="remove-action">
18
  <span class="sui-icon-close" aria-hidden="true"></span>
19
  </a>
includes/admin/templates/social/social-disabled.php CHANGED
@@ -1,10 +1,13 @@
1
  <?php
2
- $this->_render( 'disabled-component', array(
3
- 'content' => sprintf(
4
- '%s<br/>',
5
- esc_html__( 'Change how your content looks on popular social media platforms.', 'wds' )
6
- ),
7
- 'image' => 'sitemap-disabled.svg',
8
- 'component' => 'social',
9
- 'button_text' => esc_html__( 'Activate', 'wds' ),
10
- ) );
 
 
 
1
  <?php
2
+ $this->render_view(
3
+ 'disabled-component',
4
+ array(
5
+ 'content' => sprintf(
6
+ '%s<br/>',
7
+ esc_html__( 'Change how your content looks on popular social media platforms.', 'wds' )
8
+ ),
9
+ 'image' => 'sitemap-disabled.svg',
10
+ 'component' => 'social',
11
+ 'button_text' => esc_html__( 'Activate', 'wds' ),
12
+ )
13
+ );
includes/admin/templates/social/social-section-open-graph.php CHANGED
@@ -1,14 +1,17 @@
1
  <div class="wds-separator-top">
2
  <?php
3
- $this->_render( 'toggle-group', array(
4
- 'label' => __( 'OpenGraph Support', 'wds' ),
5
- 'description' => __( 'This will add a few extra meta tags to the head section of your pages.', 'wds' ),
6
- 'items' => array(
7
- 'og-enable' => array(
8
- 'label' => __( 'Enable OpenGraph', 'wds' ),
9
- 'description' => __( 'By default OpenGraph will use your default titles, descriptions and feature images. You can override the default on a per post basis inside the post editor, as well as under Titles & Meta for specific post types.', 'wds' ),
 
 
 
10
  ),
11
- ),
12
- ) );
13
  ?>
14
  </div>
1
  <div class="wds-separator-top">
2
  <?php
3
+ $this->render_view(
4
+ 'toggle-group',
5
+ array(
6
+ 'label' => __( 'OpenGraph Support', 'wds' ),
7
+ 'description' => __( 'This will add a few extra meta tags to the head section of your pages.', 'wds' ),
8
+ 'items' => array(
9
+ 'og-enable' => array(
10
+ 'label' => __( 'Enable OpenGraph', 'wds' ),
11
+ 'description' => __( 'By default OpenGraph will use your default titles, descriptions and feature images. You can override the default on a per post basis inside the post editor, as well as under Titles & Meta for specific post types.', 'wds' ),
12
+ ),
13
  ),
14
+ )
15
+ );
16
  ?>
17
  </div>
includes/admin/templates/social/social-section-pinterest-verification.php CHANGED
@@ -3,31 +3,41 @@ $options = empty( $options ) ? $_view['options'] : $options;
3
 
4
  if ( isset( $options['pinterest-verification-status'] ) ) {
5
  if ( 'fail' === $options['pinterest-verification-status'] ) {
6
- $this->_render( 'notice', array(
7
- 'message' => esc_html__( 'Verification failed', 'wds' ),
8
- 'class' => 'sui-notice-error',
9
- ) );
 
 
 
10
  } elseif ( '' === $options['pinterest-verification-status'] ) {
11
- $this->_render( 'notice', array(
12
- 'message' => esc_html__( 'Your domain verification tag has been added to the <head> of your website.', 'wds' ),
13
- 'class' => 'sui-notice-success',
14
- ) );
 
 
 
15
  }
16
  }
17
  ?>
18
 
19
  <div class="sui-box-settings-row wds-separator-top">
20
  <div class="sui-box-settings-col-1">
21
- <label for="pinterest-verify"
22
- class="sui-settings-label"><?php esc_html_e( 'Pinterest Meta Tag', 'wds' ); ?></label>
 
 
23
  <p class="sui-description"><?php esc_html_e( 'This setting will add the meta tag to verify your website with Pinterest.', 'wds' ); ?></p>
24
  </div>
25
 
26
  <div class="sui-box-settings-col-2">
27
- <textarea id="pinterest-verify"
28
- class="sui-form-control"
29
- name="<?php echo esc_attr( $_view['option_name'] ); ?>[pinterest-verify]"
30
- placeholder="<?php esc_attr_e( 'Enter your Pinterest meta tag here', 'wds' ); ?>"><?php echo esc_textarea( $options['pinterest-verify'] ); ?></textarea>
 
 
31
  <div class="sui-description">
32
  <?php if ( empty( $options['pinterest-verify'] ) ) : ?>
33
  <?php esc_html_e( 'Instructions:', 'wds' ); ?>
3
 
4
  if ( isset( $options['pinterest-verification-status'] ) ) {
5
  if ( 'fail' === $options['pinterest-verification-status'] ) {
6
+ $this->render_view(
7
+ 'notice',
8
+ array(
9
+ 'message' => esc_html__( 'Verification failed', 'wds' ),
10
+ 'class' => 'sui-notice-error',
11
+ )
12
+ );
13
  } elseif ( '' === $options['pinterest-verification-status'] ) {
14
+ $this->render_view(
15
+ 'notice',
16
+ array(
17
+ 'message' => esc_html__( 'Your domain verification tag has been added to the <head> of your website.', 'wds' ),
18
+ 'class' => 'sui-notice-success',
19
+ )
20
+ );
21
  }
22
  }
23
  ?>
24
 
25
  <div class="sui-box-settings-row wds-separator-top">
26
  <div class="sui-box-settings-col-1">
27
+ <label
28
+ for="pinterest-verify"
29
+ class="sui-settings-label"
30
+ ><?php esc_html_e( 'Pinterest Meta Tag', 'wds' ); ?></label>
31
  <p class="sui-description"><?php esc_html_e( 'This setting will add the meta tag to verify your website with Pinterest.', 'wds' ); ?></p>
32
  </div>
33
 
34
  <div class="sui-box-settings-col-2">
35
+ <textarea
36
+ id="pinterest-verify"
37
+ class="sui-form-control"
38
+ name="<?php echo esc_attr( $_view['option_name'] ); ?>[pinterest-verify]"
39
+ placeholder="<?php esc_attr_e( 'Enter your Pinterest meta tag here', 'wds' ); ?>"
40
+ ><?php echo esc_textarea( $options['pinterest-verify'] ); ?></textarea>
41
  <div class="sui-description">
42
  <?php if ( empty( $options['pinterest-verify'] ) ) : ?>
43
  <?php esc_html_e( 'Instructions:', 'wds' ); ?>
includes/admin/templates/social/social-section-twitter-cards.php CHANGED
@@ -11,13 +11,16 @@ $options = empty( $options ) ? $_view['options'] : $options;
11
  <?php $twitter_card_enabled = $options['twitter-card-enable']; ?>
12
  <div class="sui-box-settings-col-2">
13
  <?php
14
- $this->_render( 'toggle-item', array(
15
- 'item_label' => esc_html__( 'Enable Twitter Cards', 'wds' ),
16
- 'checked' => $twitter_card_enabled,
17
- 'field_name' => $_view['option_name'] . '[twitter-card-enable]',
18
- 'sub_settings_template' => 'social/social-twitter-cards-toggle-sub-settings',
19
- 'sub_settings_border' => false,
20
- ) );
 
 
 
21
  ?>
22
  </div>
23
  </div>
11
  <?php $twitter_card_enabled = $options['twitter-card-enable']; ?>
12
  <div class="sui-box-settings-col-2">
13
  <?php
14
+ $this->render_view(
15
+ 'toggle-item',
16
+ array(
17
+ 'item_label' => esc_html__( 'Enable Twitter Cards', 'wds' ),
18
+ 'checked' => $twitter_card_enabled,
19
+ 'field_name' => $_view['option_name'] . '[twitter-card-enable]',
20
+ 'sub_settings_template' => 'social/social-twitter-cards-toggle-sub-settings',
21
+ 'sub_settings_border' => false,
22
+ )
23
+ );
24
  ?>
25
  </div>
26
  </div>
includes/admin/templates/social/social-settings.php CHANGED
@@ -1,81 +1,100 @@
1
  <?php
2
  $social_enabled = Smartcrawl_Settings::get_setting( 'social' );
3
  ?>
4
- <?php $this->_render( 'before-page-container' ); ?>
5
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-social' ); ?>">
6
 
7
- <?php $this->_render( 'page-header', array(
8
- 'title' => esc_html__( 'Social', 'wds' ),
9
- 'documentation_chapter' => 'social',
10
- 'utm_campaign' => 'smartcrawl_social_docs',
11
- ) ); ?>
 
 
 
 
 
12
 
13
- <?php $this->_render( 'floating-notices' ); ?>
14
 
15
- <?php if ( ! $social_enabled ): ?>
16
- <?php $this->_render( 'social/social-disabled' ); ?>
17
- <?php else: ?>
18
  <form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
19
  <?php $this->settings_fields( $_view['option_name'] ); ?>
20
 
21
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
22
- <?php $this->_render( 'social/social-sidenav', array(
23
- 'active_tab' => $active_tab,
24
- ) ); ?>
 
 
 
 
 
25
 
26
  <?php
27
- $this->_render( 'vertical-tab', array(
28
- 'tab_id' => 'tab_open_graph',
29
- 'tab_name' => esc_html__( 'OpenGraph', 'wds' ),
30
- 'is_active' => 'tab_open_graph' === $active_tab,
31
- 'tab_sections' => array(
32
- array(
33
- 'section_description' => esc_html__( 'Add meta data to your pages to make them look great when shared on platforms such as Facebook and other popular social networks.', 'wds' ),
34
- 'section_template' => 'social/social-section-open-graph',
35
- 'section_args' => array(
36
- 'options' => $options,
 
 
 
37
  ),
38
  ),
39
- ),
40
- ) );
41
  ?>
42
 
43
  <?php
44
- $this->_render( 'vertical-tab', array(
45
- 'tab_id' => 'tab_twitter_cards',
46
- 'tab_name' => esc_html__( 'Twitter Cards', 'wds' ),
47
- 'is_active' => 'tab_twitter_cards' === $active_tab,
48
- 'tab_sections' => array(
49
- array(
50
- 'section_description' => esc_html__( 'Add meta data to your pages to make them look great when shared on Twitter.', 'wds' ),
51
- 'section_template' => 'social/social-section-twitter-cards',
52
- 'section_args' => array(
53
- 'options' => $options,
 
 
 
54
  ),
55
  ),
56
- ),
57
- ) );
58
  ?>
59
 
60
  <?php
61
- $this->_render( 'vertical-tab', array(
62
- 'tab_id' => 'tab_pinterest_verification',
63
- 'tab_name' => esc_html__( 'Pinterest Verification', 'wds' ),
64
- 'is_active' => 'tab_pinterest_verification' === $active_tab,
65
- 'tab_sections' => array(
66
- array(
67
- 'section_description' => esc_html__( 'Verify your website with Pinterest to attribute your website when your website content is pinned to the platform.', 'wds' ),
68
- 'section_template' => 'social/social-section-pinterest-verification',
69
- 'section_args' => array(
70
- 'options' => $options,
 
 
 
71
  ),
72
  ),
73
- ),
74
- ) );
75
  ?>
76
  </div>
77
  </form>
78
  <?php endif; ?>
79
 
80
- <?php $this->_render( 'footer' ); ?>
81
  </div>
1
  <?php
2
  $social_enabled = Smartcrawl_Settings::get_setting( 'social' );
3
  ?>
4
+ <?php $this->render_view( 'before-page-container' ); ?>
5
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-page-social' ); ?>">
6
 
7
+ <?php
8
+ $this->render_view(
9
+ 'page-header',
10
+ array(
11
+ 'title' => esc_html__( 'Social', 'wds' ),
12
+ 'documentation_chapter' => 'social',
13
+ 'utm_campaign' => 'smartcrawl_social_docs',
14
+ )
15
+ );
16
+ ?>
17
 
18
+ <?php $this->render_view( 'floating-notices' ); ?>
19
 
20
+ <?php if ( ! $social_enabled ) : ?>
21
+ <?php $this->render_view( 'social/social-disabled' ); ?>
22
+ <?php else : ?>
23
  <form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
24
  <?php $this->settings_fields( $_view['option_name'] ); ?>
25
 
26
  <div class="wds-vertical-tabs-container sui-row-with-sidenav">
27
+ <?php
28
+ $this->render_view(
29
+ 'social/social-sidenav',
30
+ array(
31
+ 'active_tab' => $active_tab,
32
+ )
33
+ );
34
+ ?>
35
 
36
  <?php
37
+ $this->render_view(
38
+ 'vertical-tab',
39
+ array(
40
+ 'tab_id' => 'tab_open_graph',
41
+ 'tab_name' => esc_html__( 'OpenGraph', 'wds' ),
42
+ 'is_active' => 'tab_open_graph' === $active_tab,
43
+ 'tab_sections' => array(
44
+ array(
45
+ 'section_description' => esc_html__( 'Add meta data to your pages to make them look great when shared on platforms such as Facebook and other popular social networks.', 'wds' ),
46
+ 'section_template' => 'social/social-section-open-graph',
47
+ 'section_args' => array(
48
+ 'options' => $options,
49
+ ),
50
  ),
51
  ),
52
+ )
53
+ );
54
  ?>
55
 
56
  <?php
57
+ $this->render_view(
58
+ 'vertical-tab',
59
+ array(
60
+ 'tab_id' => 'tab_twitter_cards',
61
+ 'tab_name' => esc_html__( 'Twitter Cards', 'wds' ),
62
+ 'is_active' => 'tab_twitter_cards' === $active_tab,
63
+ 'tab_sections' => array(
64
+ array(
65
+ 'section_description' => esc_html__( 'Add meta data to your pages to make them look great when shared on Twitter.', 'wds' ),
66
+ 'section_template' => 'social/social-section-twitter-cards',
67
+ 'section_args' => array(
68
+ 'options' => $options,
69
+ ),
70
  ),
71
  ),
72
+ )
73
+ );
74
  ?>
75
 
76
  <?php
77
+ $this->render_view(
78
+ 'vertical-tab',
79
+ array(
80
+ 'tab_id' => 'tab_pinterest_verification',
81
+ 'tab_name' => esc_html__( 'Pinterest Verification', 'wds' ),
82
+ 'is_active' => 'tab_pinterest_verification' === $active_tab,
83
+ 'tab_sections' => array(
84
+ array(
85
+ 'section_description' => esc_html__( 'Verify your website with Pinterest to attribute your website when your website content is pinned to the platform.', 'wds' ),
86
+ 'section_template' => 'social/social-section-pinterest-verification',
87
+ 'section_args' => array(
88
+ 'options' => $options,
89
+ ),
90
  ),
91
  ),
92
+ )
93
+ );
94
  ?>
95
  </div>
96
  </form>
97
  <?php endif; ?>
98
 
99
+ <?php $this->render_view( 'footer' ); ?>
100
  </div>
includes/admin/templates/social/social-sidenav.php CHANGED
@@ -1,20 +1,23 @@
1
  <?php
2
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
 
4
- $this->_render( 'vertical-tabs-side-nav', array(
5
- 'active_tab' => $active_tab,
6
- 'tabs' => array(
7
- array(
8
- 'id' => 'tab_open_graph',
9
- 'name' => esc_html__( 'OpenGraph', 'wds' ),
 
 
 
 
 
 
 
 
 
 
 
10
  ),
11
- array(
12
- 'id' => 'tab_twitter_cards',
13
- 'name' => esc_html__( 'Twitter Cards', 'wds' ),
14
- ),
15
- array(
16
- 'id' => 'tab_pinterest_verification',
17
- 'name' => esc_html__( 'Pinterest Verification', 'wds' ),
18
- ),
19
- ),
20
- ) );
1
  <?php
2
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
3
 
4
+ $this->render_view(
5
+ 'vertical-tabs-side-nav',
6
+ array(
7
+ 'active_tab' => $active_tab,
8
+ 'tabs' => array(
9
+ array(
10
+ 'id' => 'tab_open_graph',
11
+ 'name' => esc_html__( 'OpenGraph', 'wds' ),
12
+ ),
13
+ array(
14
+ 'id' => 'tab_twitter_cards',
15
+ 'name' => esc_html__( 'Twitter Cards', 'wds' ),
16
+ ),
17
+ array(
18
+ 'id' => 'tab_pinterest_verification',
19
+ 'name' => esc_html__( 'Pinterest Verification', 'wds' ),
20
+ ),
21
  ),
22
+ )
23
+ );
 
 
 
 
 
 
 
 
includes/admin/templates/social/social-twitter-cards-toggle-sub-settings.php CHANGED
@@ -1,10 +1,9 @@
1
  <?php
2
- $options = empty( $options ) ? $_view['options'] : $options;
3
- $card_type = smartcrawl_get_array_value( $options, 'twitter-card-type' );
4
  $card_type_summary = Smartcrawl_Twitter_Printer::CARD_SUMMARY === $card_type;
5
- $card_type_image = empty( $card_type ) // Image card used by default in twitter printer
6
- || Smartcrawl_Twitter_Printer::CARD_IMAGE === $card_type;
7
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
8
  ?>
9
  <div>
10
  <p></p>
@@ -14,20 +13,22 @@ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
14
  <label class="<?php echo $card_type_image ? 'active' : ''; ?>">
15
 
16
  <?php esc_html_e( 'Image', 'wds' ); ?>
17
- <input name="<?php echo esc_attr( $option_name ); ?>[twitter-card-type]"
18
- value="<?php echo esc_attr( Smartcrawl_Twitter_Printer::CARD_IMAGE ); ?>"
19
- type="radio" <?php checked( $card_type_image ); ?>
20
- class="hidden"
 
21
  />
22
  </label>
23
 
24
  <label class="<?php echo $card_type_summary ? 'active' : ''; ?>">
25
 
26
  <?php esc_html_e( 'No Image', 'wds' ); ?>
27
- <input name="<?php echo esc_attr( $option_name ); ?>[twitter-card-type]"
28
- value="<?php echo esc_attr( Smartcrawl_Twitter_Printer::CARD_SUMMARY ); ?>"
29
- type="radio" <?php checked( $card_type_summary ); ?>
30
- class="hidden"
 
31
  />
32
  </label>
33
  </div>
@@ -35,18 +36,24 @@ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
35
  <div data-panes>
36
  <div class="<?php echo $card_type_image ? 'active' : ''; ?>">
37
  <?php
38
- $this->_render( 'social/social-twitter-embed', array(
39
- 'tweet_url' => 'https://twitter.com/NatGeo/status/1087380060473049091',
40
- 'large' => true,
41
- ) );
 
 
 
42
  ?>
43
  </div>
44
 
45
  <div class="<?php echo $card_type_summary ? 'active' : ''; ?>">
46
  <?php
47
- $this->_render( 'social/social-twitter-embed', array(
48
- 'tweet_url' => 'https://twitter.com/WordPress/status/1046731890244374528',
49
- ) );
 
 
 
50
  ?>
51
  </div>
52
  </div>
1
  <?php
2
+ $options = empty( $options ) ? $_view['options'] : $options;
3
+ $card_type = smartcrawl_get_array_value( $options, 'twitter-card-type' );
4
  $card_type_summary = Smartcrawl_Twitter_Printer::CARD_SUMMARY === $card_type;
5
+ $card_type_image = empty( $card_type ) || Smartcrawl_Twitter_Printer::CARD_IMAGE === $card_type; // Image card used by default in twitter printer.
6
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
 
7
  ?>
8
  <div>
9
  <p></p>
13
  <label class="<?php echo $card_type_image ? 'active' : ''; ?>">
14
 
15
  <?php esc_html_e( 'Image', 'wds' ); ?>
16
+ <input
17
+ name="<?php echo esc_attr( $option_name ); ?>[twitter-card-type]"
18
+ value="<?php echo esc_attr( Smartcrawl_Twitter_Printer::CARD_IMAGE ); ?>"
19
+ type="radio" <?php checked( $card_type_image ); ?>
20
+ class="hidden"
21
  />
22
  </label>
23
 
24
  <label class="<?php echo $card_type_summary ? 'active' : ''; ?>">
25
 
26
  <?php esc_html_e( 'No Image', 'wds' ); ?>
27
+ <input
28
+ name="<?php echo esc_attr( $option_name ); ?>[twitter-card-type]"
29
+ value="<?php echo esc_attr( Smartcrawl_Twitter_Printer::CARD_SUMMARY ); ?>"
30
+ type="radio" <?php checked( $card_type_summary ); ?>
31
+ class="hidden"
32
  />
33
  </label>
34
  </div>
36
  <div data-panes>
37
  <div class="<?php echo $card_type_image ? 'active' : ''; ?>">
38
  <?php
39
+ $this->render_view(
40
+ 'social/social-twitter-embed',
41
+ array(
42
+ 'tweet_url' => 'https://twitter.com/NatGeo/status/1087380060473049091',
43
+ 'large' => true,
44
+ )
45
+ );
46
  ?>
47
  </div>
48
 
49
  <div class="<?php echo $card_type_summary ? 'active' : ''; ?>">
50
  <?php
51
+ $this->render_view(
52
+ 'social/social-twitter-embed',
53
+ array(
54
+ 'tweet_url' => 'https://twitter.com/WordPress/status/1046731890244374528',
55
+ )
56
+ );
57
  ?>
58
  </div>
59
  </div>
includes/admin/templates/social/social-twitter-embed.php CHANGED
@@ -1,10 +1,12 @@
1
  <?php
2
- $tweet_url = empty( $tweet_url ) ? '' : $tweet_url;
3
- $embed_query = new WP_Query( array(
4
- 'posts_per_page' => 1,
5
- 'post_status' => 'any',
6
- ) );
7
- $large = empty( $large ) ? false : $large;
 
 
8
 
9
  if ( ! $tweet_url ) {
10
  return;
@@ -17,6 +19,8 @@ if ( ! $tweet_url ) {
17
  $embed_query->the_post();
18
  global $wp_embed;
19
  /**
 
 
20
  * @var WP_Embed $wp_embed
21
  */
22
  echo $wp_embed->autoembed( $tweet_url ); // phpcs:ignore -- The embed won't work if escaped
1
  <?php
2
+ $tweet_url = empty( $tweet_url ) ? '' : $tweet_url;
3
+ $embed_query = new WP_Query(
4
+ array(
5
+ 'posts_per_page' => 1,
6
+ 'post_status' => 'any',
7
+ )
8
+ );
9
+ $large = empty( $large ) ? false : $large;
10
 
11
  if ( ! $tweet_url ) {
12
  return;
19
  $embed_query->the_post();
20
  global $wp_embed;
21
  /**
22
+ * Embed.
23
+ *
24
  * @var WP_Embed $wp_embed
25
  */
26
  echo $wp_embed->autoembed( $tweet_url ); // phpcs:ignore -- The embed won't work if escaped
includes/admin/templates/term/term-advanced-tab.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
- $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
3
- $global_noindex = empty( $global_noindex ) ? false : $global_noindex;
4
- $global_nofollow = empty( $global_nofollow ) ? false : $global_nofollow;
5
- $is_active = empty( $is_active ) ? false : $is_active;
6
  ?>
7
  <div class="<?php echo $is_active ? 'active' : ''; ?>">
8
  <div class="wds-metabox-section wds-advanced-metabox-section sui-box-body">
@@ -17,46 +17,58 @@ $is_active = empty( $is_active ) ? false : $is_active;
17
  </div>
18
  <div class="sui-box-settings-col-2">
19
  <?php
20
- $robots_index_value = (boolean) smartcrawl_get_array_value( $tax_meta, 'wds_override_noindex' );
21
- $robots_noindex_value = (boolean) smartcrawl_get_array_value( $tax_meta, 'wds_noindex' );
22
  if ( $global_noindex ) {
23
- $this->_render( 'toggle-item', array(
24
- 'field_name' => 'wds_override_noindex',
25
- 'field_id' => 'wds_override_noindex',
26
- 'checked' => $robots_index_value,
27
- 'item_label' => esc_html__( 'Index - Override Taxonomy Setting', 'wds' ),
28
- 'item_description' => esc_html__( 'Instruct search engines whether or not you want this term archive to appear in search results.', 'wds' ),
29
- ) );
 
 
 
30
  } else {
31
- $this->_render( 'toggle-item', array(
32
- 'inverted' => true,
33
- 'field_name' => 'wds_noindex',
34
- 'field_id' => 'wds_noindex',
35
- 'checked' => $robots_noindex_value,
36
- 'item_label' => esc_html__( 'Index', 'wds' ),
37
- 'item_description' => esc_html__( 'Instruct search engines whether or not you want this term archive to appear in search results.', 'wds' ),
38
- ) );
 
 
 
39
  }
40
 
41
- $robots_follow_value = (boolean) smartcrawl_get_array_value( $tax_meta, 'wds_override_nofollow' );
42
- $robots_nofollow_value = (boolean) smartcrawl_get_array_value( $tax_meta, 'wds_nofollow' );
43
  if ( $global_nofollow ) {
44
- $this->_render( 'toggle-item', array(
45
- 'field_name' => 'wds_override_nofollow',
46
- 'field_id' => 'wds_override_nofollow',
47
- 'checked' => $robots_follow_value,
48
- 'item_label' => esc_html__( 'Follow - Override Taxonomy Setting', 'wds' ),
49
- 'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your term archive and crawl them too.', 'wds' ),
50
- ) );
 
 
 
51
  } else {
52
- $this->_render( 'toggle-item', array(
53
- 'inverted' => true,
54
- 'field_name' => 'wds_nofollow',
55
- 'field_id' => 'wds_nofollow',
56
- 'checked' => $robots_nofollow_value,
57
- 'item_label' => esc_html__( 'Follow', 'wds' ),
58
- 'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your term archive and crawl them too.', 'wds' ),
59
- ) );
 
 
 
60
  }
61
  ?>
62
  </div>
@@ -70,9 +82,11 @@ $is_active = empty( $is_active ) ? false : $is_active;
70
  </p>
71
  </div>
72
  <div class="sui-box-settings-col-2">
73
- <input type='text' id='wds_canonical' name='wds_canonical'
74
- value='<?php echo esc_attr( smartcrawl_get_array_value( $tax_meta, 'wds_canonical' ) ); ?>'
75
- class='wds sui-form-control'/>
 
 
76
  <span class="sui-description">
77
  <?php esc_html_e( 'Enter the full canonical URL including http:// or https://', 'wds' ); ?>
78
  </span>
1
  <?php
2
+ $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
3
+ $global_noindex = ! empty( $global_noindex );
4
+ $global_nofollow = ! empty( $global_nofollow );
5
+ $is_active = empty( $is_active ) ? false : $is_active;
6
  ?>
7
  <div class="<?php echo $is_active ? 'active' : ''; ?>">
8
  <div class="wds-metabox-section wds-advanced-metabox-section sui-box-body">
17
  </div>
18
  <div class="sui-box-settings-col-2">
19
  <?php
20
+ $robots_index_value = (bool) smartcrawl_get_array_value( $tax_meta, 'wds_override_noindex' );
21
+ $robots_noindex_value = (bool) smartcrawl_get_array_value( $tax_meta, 'wds_noindex' );
22
  if ( $global_noindex ) {
23
+ $this->render_view(
24
+ 'toggle-item',
25
+ array(
26
+ 'field_name' => 'wds_override_noindex',
27
+ 'field_id' => 'wds_override_noindex',
28
+ 'checked' => $robots_index_value,
29
+ 'item_label' => esc_html__( 'Index - Override Taxonomy Setting', 'wds' ),
30
+ 'item_description' => esc_html__( 'Instruct search engines whether or not you want this term archive to appear in search results.', 'wds' ),
31
+ )
32
+ );
33
  } else {
34
+ $this->render_view(
35
+ 'toggle-item',
36
+ array(
37
+ 'inverted' => true,
38
+ 'field_name' => 'wds_noindex',
39
+ 'field_id' => 'wds_noindex',
40
+ 'checked' => $robots_noindex_value,
41
+ 'item_label' => esc_html__( 'Index', 'wds' ),
42
+ 'item_description' => esc_html__( 'Instruct search engines whether or not you want this term archive to appear in search results.', 'wds' ),
43
+ )
44
+ );
45
  }
46
 
47
+ $robots_follow_value = (bool) smartcrawl_get_array_value( $tax_meta, 'wds_override_nofollow' );
48
+ $robots_nofollow_value = (bool) smartcrawl_get_array_value( $tax_meta, 'wds_nofollow' );
49
  if ( $global_nofollow ) {
50
+ $this->render_view(
51
+ 'toggle-item',
52
+ array(
53
+ 'field_name' => 'wds_override_nofollow',
54
+ 'field_id' => 'wds_override_nofollow',
55
+ 'checked' => $robots_follow_value,
56
+ 'item_label' => esc_html__( 'Follow - Override Taxonomy Setting', 'wds' ),
57
+ 'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your term archive and crawl them too.', 'wds' ),
58
+ )
59
+ );
60
  } else {
61
+ $this->render_view(
62
+ 'toggle-item',
63
+ array(
64
+ 'inverted' => true,
65
+ 'field_name' => 'wds_nofollow',
66
+ 'field_id' => 'wds_nofollow',
67
+ 'checked' => $robots_nofollow_value,
68
+ 'item_label' => esc_html__( 'Follow', 'wds' ),
69
+ 'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your term archive and crawl them too.', 'wds' ),
70
+ )
71
+ );
72
  }
73
  ?>
74
  </div>
82
  </p>
83
  </div>
84
  <div class="sui-box-settings-col-2">
85
+ <input
86
+ type='text' id='wds_canonical' name='wds_canonical'
87
+ value='<?php echo esc_attr( smartcrawl_get_array_value( $tax_meta, 'wds_canonical' ) ); ?>'
88
+ class='wds sui-form-control'
89
+ />
90
  <span class="sui-description">
91
  <?php esc_html_e( 'Enter the full canonical URL including http:// or https://', 'wds' ); ?>
92
  </span>
includes/admin/templates/term/term-form.php CHANGED
@@ -1,20 +1,17 @@
1
  <?php
2
- $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
3
- $term = empty( $term ) ? null : $term;
4
- $global_noindex = empty( $global_noindex ) ? false : $global_noindex;
5
  $global_nofollow = empty( $global_nofollow ) ? false : $global_nofollow;
6
 
7
- $all_options = Smartcrawl_Settings::get_options();
8
- $og_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-enable' );
9
- $og_taxonomy_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-active-' . $term->taxonomy );
10
- $twitter_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-card-enable' );
11
  $twitter_taxonomy_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-active-' . $term->taxonomy );
12
- $show_social_tab = ( $og_setting_enabled && $og_taxonomy_enabled ) || ( $twitter_setting_enabled && $twitter_taxonomy_enabled );
13
- $show_social_tab = $show_social_tab
14
- && Smartcrawl_Settings::get_setting( 'social' )
15
- && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL );
16
- $show_onpage_tabs = Smartcrawl_Settings::get_setting( 'onpage' )
17
- && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_ONPAGE );
18
  if ( ! $show_social_tab && ! $show_onpage_tabs ) {
19
  return;
20
  }
@@ -33,10 +30,13 @@ if ( ! $show_social_tab && ! $show_onpage_tabs ) {
33
  <div class="sui-tabs">
34
 
35
  <?php
36
- $this->_render( 'term/term-nav', array(
37
- 'show_onpage_tabs' => $show_onpage_tabs,
38
- 'show_social_tab' => $show_social_tab,
39
- ) );
 
 
 
40
  $is_active = true;
41
  ?>
42
 
@@ -44,35 +44,46 @@ if ( ! $show_social_tab && ! $show_onpage_tabs ) {
44
 
45
  <?php
46
  if ( $show_onpage_tabs ) {
47
- $this->_render( 'term/term-seo-tab', array(
48
- 'is_active' => $is_active,
49
- 'tax_meta' => $tax_meta,
50
- 'term' => $term,
51
- ) );
 
 
 
52
  $is_active = false;
53
  }
54
 
55
  if ( $show_social_tab ) {
56
- $this->_render( 'term/term-social-tab', array(
57
- 'is_active' => $is_active,
58
- 'tax_meta' => $tax_meta,
59
- 'term' => $term,
60
- 'og_setting_enabled' => $og_setting_enabled,
61
- 'og_taxonomy_enabled' => $og_taxonomy_enabled,
62
- 'twitter_setting_enabled' => $twitter_setting_enabled,
63
- 'twitter_taxonomy_enabled' => $twitter_taxonomy_enabled,
64
- ) );
 
 
 
 
 
65
  $is_active = false;
66
  }
67
 
68
  if ( $show_onpage_tabs ) {
69
- $this->_render( 'term/term-advanced-tab', array(
70
- 'is_active' => $is_active,
71
- 'tax_meta' => $tax_meta,
72
- 'term' => $term,
73
- 'global_nofollow' => $global_nofollow,
74
- 'global_noindex' => $global_noindex,
75
- ) );
 
 
 
76
  $is_active = false;
77
  }
78
  ?>
1
  <?php
2
+ $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
3
+ $term = empty( $term ) ? null : $term; // phpcs:ignore
4
+ $global_noindex = empty( $global_noindex ) ? false : $global_noindex;
5
  $global_nofollow = empty( $global_nofollow ) ? false : $global_nofollow;
6
 
7
+ $all_options = Smartcrawl_Settings::get_options();
8
+ $og_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-enable' );
9
+ $og_taxonomy_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-active-' . $term->taxonomy );
10
+ $twitter_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-card-enable' );
11
  $twitter_taxonomy_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-active-' . $term->taxonomy );
12
+ $show_social_tab = ( $og_setting_enabled && $og_taxonomy_enabled ) || ( $twitter_setting_enabled && $twitter_taxonomy_enabled );
13
+ $show_social_tab = $show_social_tab && Smartcrawl_Settings::get_setting( 'social' ) && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_SOCIAL );
14
+ $show_onpage_tabs = Smartcrawl_Settings::get_setting( 'onpage' ) && Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_ONPAGE );
 
 
 
15
  if ( ! $show_social_tab && ! $show_onpage_tabs ) {
16
  return;
17
  }
30
  <div class="sui-tabs">
31
 
32
  <?php
33
+ $this->render_view(
34
+ 'term/term-nav',
35
+ array(
36
+ 'show_onpage_tabs' => $show_onpage_tabs,
37
+ 'show_social_tab' => $show_social_tab,
38
+ )
39
+ );
40
  $is_active = true;
41
  ?>
42
 
44
 
45
  <?php
46
  if ( $show_onpage_tabs ) {
47
+ $this->render_view(
48
+ 'term/term-seo-tab',
49
+ array(
50
+ 'is_active' => $is_active,
51
+ 'tax_meta' => $tax_meta,
52
+ 'term' => $term,
53
+ )
54
+ );
55
  $is_active = false;
56
  }
57
 
58
  if ( $show_social_tab ) {
59
+ // phpcs:disable WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned, WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow
60
+ $this->render_view(
61
+ 'term/term-social-tab',
62
+ array(
63
+ 'is_active' => $is_active,
64
+ 'tax_meta' => $tax_meta,
65
+ 'term' => $term,
66
+ 'og_setting_enabled' => $og_setting_enabled,
67
+ 'og_taxonomy_enabled' => $og_taxonomy_enabled,
68
+ 'twitter_setting_enabled' => $twitter_setting_enabled,
69
+ 'twitter_taxonomy_enabled' => $twitter_taxonomy_enabled,
70
+ )
71
+ );
72
+ // phpcs:enable
73
  $is_active = false;
74
  }
75
 
76
  if ( $show_onpage_tabs ) {
77
+ $this->render_view(
78
+ 'term/term-advanced-tab',
79
+ array(
80
+ 'is_active' => $is_active,
81
+ 'tax_meta' => $tax_meta,
82
+ 'term' => $term,
83
+ 'global_nofollow' => $global_nofollow,
84
+ 'global_noindex' => $global_noindex,
85
+ )
86
+ );
87
  $is_active = false;
88
  }
89
  ?>
includes/admin/templates/term/term-google-preview.php CHANGED
@@ -1,26 +1,29 @@
1
  <?php
2
- $term = empty( $term ) ? null : $term;
3
  if ( ! $term ) {
4
  return;
5
  }
6
 
7
- $link = get_term_link( $term );
8
  $smartcrawl_term = Smartcrawl_Term_Cache::get()->get_term( $term->term_id );
9
  if ( ! $smartcrawl_term ) {
10
  return;
11
  }
12
 
13
- $title = $smartcrawl_term->get_meta_title();
14
  $description = $smartcrawl_term->get_meta_description();
15
  ?>
16
  <div class="wds-metabox-preview">
17
  <label class="sui-label"><?php esc_html_e( 'Google Preview' ); ?></label>
18
 
19
  <?php
20
- $this->_render( 'onpage/onpage-preview', array(
21
- 'link' => esc_url( $link ),
22
- 'title' => esc_html( $title ),
23
- 'description' => esc_html( $description ),
24
- ) );
 
 
 
25
  ?>
26
  </div>
1
  <?php
2
+ $term = empty( $term ) ? null : $term; // phpcs:ignore
3
  if ( ! $term ) {
4
  return;
5
  }
6
 
7
+ $link = get_term_link( $term ); // phpcs:ignore
8
  $smartcrawl_term = Smartcrawl_Term_Cache::get()->get_term( $term->term_id );
9
  if ( ! $smartcrawl_term ) {
10
  return;
11
  }
12
 
13
+ $title = $smartcrawl_term->get_meta_title(); // phpcs:ignore
14
  $description = $smartcrawl_term->get_meta_description();
15
  ?>
16
  <div class="wds-metabox-preview">
17
  <label class="sui-label"><?php esc_html_e( 'Google Preview' ); ?></label>
18
 
19
  <?php
20
+ $this->render_view(
21
+ 'onpage/onpage-preview',
22
+ array(
23
+ 'link' => esc_url( $link ),
24
+ 'title' => esc_html( $title ),
25
+ 'description' => esc_html( $description ),
26
+ )
27
+ );
28
  ?>
29
  </div>
includes/admin/templates/term/term-meta-edit-form.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
3
- $term = empty( $term ) ? null : $term;
4
  if ( ! $term ) {
5
  return;
6
  }
@@ -9,10 +9,10 @@ if ( ! $smartcrawl_term ) {
9
  return;
10
  }
11
 
12
- $meta_title = smartcrawl_get_array_value( $tax_meta, 'wds_title' );
13
  $title_placeholder = $smartcrawl_term->get_meta_title();
14
 
15
- $meta_desc = smartcrawl_get_array_value( $tax_meta, 'wds_desc' );
16
  $desc_placeholder = $smartcrawl_term->get_meta_description();
17
  ?>
18
  <div class="wds-edit-meta">
@@ -27,12 +27,14 @@ $desc_placeholder = $smartcrawl_term->get_meta_description();
27
  <label class="sui-label" for="wds_title">
28
  <?php esc_html_e( 'SEO Title', 'wds' ); ?>
29
  </label>
30
- <input type="text"
31
- id="wds_title"
32
- name="wds_title"
33
- placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
34
- value="<?php echo esc_attr( $meta_title ); ?>"
35
- class="sui-form-control wds-meta-field"/>
 
 
36
  <p class="sui-description">
37
  <?php esc_html_e( 'The SEO title is used on the archive page for this term.', 'wds' ); ?>
38
  </p>
@@ -42,10 +44,12 @@ $desc_placeholder = $smartcrawl_term->get_meta_description();
42
  <label class="sui-label" for="wds_metadesc">
43
  <?php esc_html_e( 'Description', 'wds' ); ?>
44
  </label>
45
- <textarea name="wds_desc"
46
- id="wds_metadesc"
47
- placeholder="<?php echo esc_attr( $desc_placeholder ); ?>"
48
- class="sui-form-control wds-meta-field"><?php echo esc_textarea( $meta_desc ); ?></textarea>
 
 
49
  <p class="sui-description">
50
  <?php esc_html_e( 'The SEO description is used for the meta description on the archive page for this term.', 'wds' ); ?>
51
  </p>
1
  <?php
2
  $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
3
+ $term = empty( $term ) ? null : $term; // phpcs:ignore
4
  if ( ! $term ) {
5
  return;
6
  }
9
  return;
10
  }
11
 
12
+ $meta_title = smartcrawl_get_array_value( $tax_meta, 'wds_title' );
13
  $title_placeholder = $smartcrawl_term->get_meta_title();
14
 
15
+ $meta_desc = smartcrawl_get_array_value( $tax_meta, 'wds_desc' );
16
  $desc_placeholder = $smartcrawl_term->get_meta_description();
17
  ?>
18
  <div class="wds-edit-meta">
27
  <label class="sui-label" for="wds_title">
28
  <?php esc_html_e( 'SEO Title', 'wds' ); ?>
29
  </label>
30
+ <input
31
+ type="text"
32
+ id="wds_title"
33
+ name="wds_title"
34
+ placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
35
+ value="<?php echo esc_attr( $meta_title ); ?>"
36
+ class="sui-form-control wds-meta-field"
37
+ />
38
  <p class="sui-description">
39
  <?php esc_html_e( 'The SEO title is used on the archive page for this term.', 'wds' ); ?>
40
  </p>
44
  <label class="sui-label" for="wds_metadesc">
45
  <?php esc_html_e( 'Description', 'wds' ); ?>
46
  </label>
47
+ <textarea
48
+ name="wds_desc"
49
+ id="wds_metadesc"
50
+ placeholder="<?php echo esc_attr( $desc_placeholder ); ?>"
51
+ class="sui-form-control wds-meta-field"
52
+ ><?php echo esc_textarea( $meta_desc ); ?></textarea>
53
  <p class="sui-description">
54
  <?php esc_html_e( 'The SEO description is used for the meta description on the archive page for this term.', 'wds' ); ?>
55
  </p>
includes/admin/templates/term/term-nav.php CHANGED
@@ -1,21 +1,21 @@
1
  <?php
2
- $show_onpage_tabs = empty( $show_onpage_tabs ) ? false : $show_onpage_tabs;
3
- $show_social_tab = empty( $show_social_tab ) ? false : $show_social_tab;
4
 
5
- $tabs = array();
6
  if ( $show_onpage_tabs ) {
7
- $tabs['wds_seo'] = esc_html__( 'SEO', 'wds' );
8
  }
9
  if ( $show_social_tab ) {
10
- $tabs['wds_social'] = esc_html__( 'Social', 'wds' );
11
  }
12
  if ( $show_onpage_tabs ) {
13
- $tabs['wds_advanced'] = esc_html__( 'Advanced', 'wds' );
14
  }
15
  $first_tab = true;
16
  ?>
17
  <div data-tabs>
18
- <?php foreach ( $tabs as $tab_id => $tab_name ) : ?>
19
 
20
  <div class="<?php echo $first_tab ? 'active' : ''; ?> <?php echo esc_attr( $tab_id ); ?>-tab">
21
  <?php echo wp_kses_post( $tab_name ); ?>
1
  <?php
2
+ $show_onpage_tabs = ! empty( $show_onpage_tabs ) && $show_onpage_tabs;
3
+ $show_social_tab = ! empty( $show_social_tab ) && $show_social_tab;
4
 
5
+ $tab_items = array();
6
  if ( $show_onpage_tabs ) {
7
+ $tab_items['wds_seo'] = esc_html__( 'SEO', 'wds' );
8
  }
9
  if ( $show_social_tab ) {
10
+ $tab_items['wds_social'] = esc_html__( 'Social', 'wds' );
11
  }
12
  if ( $show_onpage_tabs ) {
13
+ $tab_items['wds_advanced'] = esc_html__( 'Advanced', 'wds' );
14
  }
15
  $first_tab = true;
16
  ?>
17
  <div data-tabs>
18
+ <?php foreach ( $tab_items as $tab_id => $tab_name ) : ?>
19
 
20
  <div class="<?php echo $first_tab ? 'active' : ''; ?> <?php echo esc_attr( $tab_id ); ?>-tab">
21
  <?php echo wp_kses_post( $tab_name ); ?>
includes/admin/templates/term/term-seo-tab.php CHANGED
@@ -1,14 +1,19 @@
1
  <?php
2
- $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
3
- $term = empty( $term ) ? null : $term;
4
  $is_active = empty( $is_active ) ? false : $is_active;
5
  ?>
6
  <div class="<?php echo $is_active ? 'active' : ''; ?>">
7
  <div class="wds-metabox-section">
8
- <?php $this->_render( 'metabox/metabox-dummy-preview' ); ?>
9
- <?php $this->_render( 'term/term-meta-edit-form', array(
10
- 'tax_meta' => $tax_meta,
11
- 'term' => $term,
12
- ) ); ?>
 
 
 
 
 
13
  </div>
14
  </div>
1
  <?php
2
+ $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
3
+ $term = empty( $term ) ? null : $term; // phpcs:ignore
4
  $is_active = empty( $is_active ) ? false : $is_active;
5
  ?>
6
  <div class="<?php echo $is_active ? 'active' : ''; ?>">
7
  <div class="wds-metabox-section">
8
+ <?php $this->render_view( 'metabox/metabox-dummy-preview' ); ?>
9
+ <?php
10
+ $this->render_view(
11
+ 'term/term-meta-edit-form',
12
+ array(
13
+ 'tax_meta' => $tax_meta,
14
+ 'term' => $term,
15
+ )
16
+ );
17
+ ?>
18
  </div>
19
  </div>
includes/admin/templates/term/term-social-tab.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
- $og_setting_enabled = empty( $og_setting_enabled ) ? false : $og_setting_enabled;
3
- $og_taxonomy_enabled = empty( $og_taxonomy_enabled ) ? false : $og_taxonomy_enabled;
4
 
5
- $twitter_setting_enabled = empty( $twitter_setting_enabled ) ? false : $twitter_setting_enabled;
6
- $twitter_taxonomy_enabled = empty( $twitter_taxonomy_enabled ) ? false : $twitter_taxonomy_enabled;
7
 
8
  $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
9
- $term = empty( $term ) ? null : $term;
10
  if ( ! $term ) {
11
  return;
12
  }
@@ -19,7 +19,7 @@ $default_settings_message = smartcrawl_format_link(
19
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE ),
20
  esc_html__( 'Titles & Meta', 'wds' )
21
  );
22
- $is_active = empty( $is_active ) ? false : $is_active;
23
  ?>
24
  <div class="<?php echo $is_active ? 'active' : ''; ?>">
25
  <div class="wds-metabox-section sui-box-body">
@@ -27,56 +27,71 @@ $is_active = empty( $is_active ) ? false : $is_active;
27
  <?php echo wp_kses_post( $default_settings_message ); ?>
28
  </p>
29
 
30
- <?php if ( $og_setting_enabled && $og_taxonomy_enabled ) :
31
- $og = smartcrawl_get_array_value( $tax_meta, 'opengraph' );
32
- $og = wp_parse_args( ! is_array( $og ) ? array() : $og, array(
33
- 'title' => false,
34
- 'description' => false,
35
- 'images' => false,
36
- 'disabled' => false,
37
- ) );
 
 
 
 
38
  $og_meta_disabled = (bool) smartcrawl_get_array_value( $og, 'disabled' );
39
 
40
- $this->_render( 'metabox/metabox-social-meta-tags', array(
41
- 'toggle_label' => esc_html__( 'Enable for this term', 'wds' ),
42
- 'main_title' => esc_html__( 'OpenGraph', 'wds' ),
43
- 'main_description' => esc_html__( 'OpenGraph is used on many social networks such as Facebook.', 'wds' ),
44
- 'field_name' => 'wds-opengraph',
45
- 'disabled' => $og_meta_disabled,
46
- 'current_title' => $og['title'],
47
- 'title_placeholder' => $smartcrawl_term->get_opengraph_title(),
48
- 'current_description' => $og['description'],
49
- 'description_placeholder' => $smartcrawl_term->get_opengraph_description(),
50
- 'images' => $og['images'],
51
- 'single_image' => false,
52
- 'images_description' => esc_html__( 'Each of these images will be available to use as the featured image when the term archive is shared.', 'wds' ),
53
- ) ); ?>
 
 
 
 
54
  <?php endif; ?>
55
 
56
- <?php if ( $twitter_setting_enabled && $twitter_taxonomy_enabled ) :
57
- $twitter = smartcrawl_get_array_value( $tax_meta, 'twitter' );
58
- $twitter = wp_parse_args( ! is_array( $twitter ) ? array() : $twitter, array(
59
- 'title' => false,
60
- 'description' => false,
61
- 'images' => false,
62
- 'disabled' => false,
63
- ) );
 
 
 
 
64
  $twitter_meta_disabled = smartcrawl_get_array_value( $twitter, 'disabled' );
65
 
66
- $this->_render( 'metabox/metabox-social-meta-tags', array(
67
- 'toggle_label' => esc_html__( 'Enable for this term', 'wds' ),
68
- 'main_title' => esc_html__( 'Twitter', 'wds' ),
69
- 'main_description' => esc_html__( 'These details will be used in Twitter cards.', 'wds' ),
70
- 'field_name' => 'wds-twitter',
71
- 'disabled' => $twitter_meta_disabled,
72
- 'current_title' => $twitter['title'],
73
- 'title_placeholder' => $smartcrawl_term->get_twitter_title(),
74
- 'current_description' => $twitter['description'],
75
- 'description_placeholder' => $smartcrawl_term->get_twitter_description(),
76
- 'images' => $twitter['images'],
77
- 'single_image' => true,
78
- 'images_description' => esc_html__( 'This image will be used as the featured image when the term archive is shared.', 'wds' ),
79
- ) );
 
 
 
80
  ?>
81
  <?php endif; ?>
82
  </div>
1
  <?php
2
+ $og_setting_enabled = ! empty( $og_setting_enabled );
3
+ $og_taxonomy_enabled = ! empty( $og_taxonomy_enabled );
4
 
5
+ $twitter_setting_enabled = ! empty( $twitter_setting_enabled );
6
+ $twitter_taxonomy_enabled = ! empty( $twitter_taxonomy_enabled );
7
 
8
  $tax_meta = empty( $tax_meta ) ? array() : $tax_meta;
9
+ $term = empty( $term ) ? null : $term; // phpcs:ignore
10
  if ( ! $term ) {
11
  return;
12
  }
19
  Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE ),
20
  esc_html__( 'Titles & Meta', 'wds' )
21
  );
22
+ $is_active = empty( $is_active ) ? false : $is_active;
23
  ?>
24
  <div class="<?php echo $is_active ? 'active' : ''; ?>">
25
  <div class="wds-metabox-section sui-box-body">
27
  <?php echo wp_kses_post( $default_settings_message ); ?>
28
  </p>
29
 
30
+ <?php
31
+ if ( $og_setting_enabled && $og_taxonomy_enabled ) :
32
+ $og = smartcrawl_get_array_value( $tax_meta, 'opengraph' );
33
+ $og = wp_parse_args(
34
+ ! is_array( $og ) ? array() : $og,
35
+ array(
36
+ 'title' => false,
37
+ 'description' => false,
38
+ 'images' => false,
39
+ 'disabled' => false,
40
+ )
41
+ );
42
  $og_meta_disabled = (bool) smartcrawl_get_array_value( $og, 'disabled' );
43
 
44
+ $this->render_view(
45
+ 'metabox/metabox-social-meta-tags',
46
+ array(
47
+ 'toggle_label' => esc_html__( 'Enable for this term', 'wds' ),
48
+ 'main_title' => esc_html__( 'OpenGraph', 'wds' ),
49
+ 'main_description' => esc_html__( 'OpenGraph is used on many social networks such as Facebook.', 'wds' ),
50
+ 'field_name' => 'wds-opengraph',
51
+ 'disabled' => $og_meta_disabled,
52
+ 'current_title' => $og['title'],
53
+ 'title_placeholder' => $smartcrawl_term->get_opengraph_title(),
54
+ 'current_description' => $og['description'],
55
+ 'description_placeholder' => $smartcrawl_term->get_opengraph_description(),
56
+ 'images' => $og['images'],
57
+ 'single_image' => false,
58
+ 'images_description' => esc_html__( 'Each of these images will be available to use as the featured image when the term archive is shared.', 'wds' ),
59
+ )
60
+ );
61
+ ?>
62
  <?php endif; ?>
63
 
64
+ <?php
65
+ if ( $twitter_setting_enabled && $twitter_taxonomy_enabled ) :
66
+ $twitter = smartcrawl_get_array_value( $tax_meta, 'twitter' );
67
+ $twitter = wp_parse_args(
68
+ ! is_array( $twitter ) ? array() : $twitter,
69
+ array(
70
+ 'title' => false,
71
+ 'description' => false,
72
+ 'images' => false,
73
+ 'disabled' => false,
74
+ )
75
+ );
76
  $twitter_meta_disabled = smartcrawl_get_array_value( $twitter, 'disabled' );
77
 
78
+ $this->render_view(
79
+ 'metabox/metabox-social-meta-tags',
80
+ array(
81
+ 'toggle_label' => esc_html__( 'Enable for this term', 'wds' ),
82
+ 'main_title' => esc_html__( 'Twitter', 'wds' ),
83
+ 'main_description' => esc_html__( 'These details will be used in Twitter cards.', 'wds' ),
84
+ 'field_name' => 'wds-twitter',
85
+ 'disabled' => $twitter_meta_disabled,
86
+ 'current_title' => $twitter['title'],
87
+ 'title_placeholder' => $smartcrawl_term->get_twitter_title(),
88
+ 'current_description' => $twitter['description'],
89
+ 'description_placeholder' => $smartcrawl_term->get_twitter_description(),
90
+ 'images' => $twitter['images'],
91
+ 'single_image' => true,
92
+ 'images_description' => esc_html__( 'This image will be used as the featured image when the term archive is shared.', 'wds' ),
93
+ )
94
+ );
95
  ?>
96
  <?php endif; ?>
97
  </div>
includes/admin/templates/toggle-group.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
- $label = empty( $label ) ? '' : $label;
3
- $description = empty( $description ) ? '' : $description;
4
- $items = empty( $items ) ? array() : $items;
5
  $view_option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
6
  ?>
7
 
@@ -17,9 +17,9 @@ $view_option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
17
  <?php foreach ( $items as $item => $details ) : ?>
18
  <?php
19
  $option_name = $view_option_name;
20
- $field_id = $option_name . '-' . $item;
21
- $field_name = $option_name . "[$item]";
22
- $checked = ! empty( $_view['options'][ $item ] ) ? true : false;
23
 
24
  if ( is_array( $details ) ) {
25
  $details = wp_parse_args(
@@ -33,31 +33,34 @@ $view_option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
33
  )
34
  );
35
 
36
- $item_label = $details['label'];
37
  $item_description = $details['description'];
38
- $item_value = $details['value'] ? $details['value'] : $item;
39
- $inverted = $details['inverted'];
40
  $html_description = $details['html_description'];
41
  } else {
42
- $item_label = $details;
43
  $item_description = '';
44
- $item_value = $item;
45
- $inverted = false;
46
  $html_description = '';
47
  }
48
  ?>
49
 
50
  <?php
51
- $this->_render( 'toggle-item', array(
52
- 'inverted' => $inverted,
53
- 'item_value' => $item_value,
54
- 'field_name' => $field_name,
55
- 'field_id' => $field_id,
56
- 'checked' => $checked,
57
- 'item_label' => $item_label,
58
- 'item_description' => $item_description,
59
- 'html_description' => $html_description,
60
- ) );
 
 
 
61
  ?>
62
 
63
  <?php endforeach; ?>
1
  <?php
2
+ $label = empty( $label ) ? '' : $label;
3
+ $description = empty( $description ) ? '' : $description;
4
+ $items = empty( $items ) ? array() : $items;
5
  $view_option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
6
  ?>
7
 
17
  <?php foreach ( $items as $item => $details ) : ?>
18
  <?php
19
  $option_name = $view_option_name;
20
+ $field_id = $option_name . '-' . $item;
21
+ $field_name = $option_name . "[$item]";
22
+ $checked = ! empty( $_view['options'][ $item ] );
23
 
24
  if ( is_array( $details ) ) {
25
  $details = wp_parse_args(
33
  )
34
  );
35
 
36
+ $item_label = $details['label'];
37
  $item_description = $details['description'];
38
+ $item_value = $details['value'] ? $details['value'] : $item;
39
+ $inverted = $details['inverted'];
40
  $html_description = $details['html_description'];
41
  } else {
42
+ $item_label = $details;
43
  $item_description = '';
44
+ $item_value = $item;
45
+ $inverted = false;
46
  $html_description = '';
47
  }
48
  ?>
49
 
50
  <?php
51
+ $this->render_view(
52
+ 'toggle-item',
53
+ array(
54
+ 'inverted' => $inverted,
55
+ 'item_value' => $item_value,
56
+ 'field_name' => $field_name,
57
+ 'field_id' => $field_id,
58
+ 'checked' => $checked,
59
+ 'item_label' => $item_label,
60
+ 'item_description' => $item_description,
61
+ 'html_description' => $html_description,
62
+ )
63
+ );
64
  ?>
65
 
66
  <?php endforeach; ?>
includes/admin/templates/toggle-item.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
- $inverted = empty( $inverted ) ? false : $inverted;
3
- $field_name = empty( $field_name ) ? '' : $field_name;
4
- $field_id = empty( $field_id ) ? $field_name : $field_id;
5
- $checked = empty( $checked ) ? '' : $checked;
6
- $item_label = empty( $item_label ) ? '' : $item_label;
7
- $item_value = empty( $item_value ) ? '1' : $item_value;
8
- $item_description = empty( $item_description ) ? '' : $item_description;
9
- $html_description = empty( $html_description ) ? '' : $html_description;
10
- $attributes = empty( $attributes ) ? array() : $attributes;
11
- $sub_settings_template = empty( $sub_settings_template ) ? '' : $sub_settings_template;
12
  $sub_settings_template_args = empty( $sub_settings_template_args ) ? array() : $sub_settings_template_args;
13
- $sub_settings_border = isset( $sub_settings_border ) ? $sub_settings_border : true;
14
 
15
  $attr_string = '';
16
  foreach ( $attributes as $attribute => $attribute_value ) {
@@ -20,21 +20,23 @@ $checkbox_checked = ( $inverted && ! $checked ) || ( ! $inverted && $checked );
20
  ?>
21
 
22
  <div class="sui-form-field <?php echo $inverted ? esc_attr( 'wds-inverted-toggle' ) : ''; ?>">
23
- <label for="<?php echo esc_attr( $field_id ); ?>"
24
- class="wds-toggle sui-toggle">
25
-
26
- <input type="checkbox"
27
- id="<?php echo esc_attr( $field_id ); ?>"
28
- value="<?php echo esc_attr( $item_value ); ?>"
29
- name="<?php echo esc_attr( $field_name ); ?>"
30
- aria-labelledby="label-<?php echo esc_attr( $field_id ); ?>"
 
 
31
  <?php if ( $item_description ) : ?>
32
  aria-describedby="description-<?php echo esc_attr( $field_id ); ?>"
33
  <?php endif; ?>
34
  <?php if ( $checkbox_checked ) : ?>
35
  checked="checked"
36
  <?php endif; ?>
37
- <?php if ( $sub_settings_template ): ?>
38
  aria-controls="sub-settings-<?php echo esc_attr( $field_id ); ?>"
39
  <?php endif; ?>
40
  <?php echo $attr_string; // phpcs:ignore -- Built escaped. ?>
@@ -47,33 +49,39 @@ $checkbox_checked = ( $inverted && ! $checked ) || ( ! $inverted && $checked );
47
  </span>
48
 
49
  <div id="description-<?php echo esc_attr( $field_id ); ?>" class="sui-description">
50
- <?php if ( $item_description ) {
 
51
  echo esc_html( $item_description );
52
- } ?>
 
53
 
54
- <?php if ( $html_description ) {
 
55
  echo wp_kses_post( $html_description );
56
- } ?>
 
57
  </div>
58
  </label>
59
 
60
- <?php if ( $sub_settings_template ): ?>
61
- <div id="sub-settings-<?php echo esc_attr( $field_id ); ?>"
62
- class="sui-toggle-content <?php echo $sub_settings_border ? 'sui-border-frame' : ''; ?>"
63
- aria-label="<?php printf( esc_html__( "Sub-settings of '%s'", 'wds' ), $item_label ); ?>"
64
- style="<?php echo $checkbox_checked ? '' : 'display:none;'; ?>">
65
-
66
- <?php $this->_render( $sub_settings_template, $sub_settings_template_args ); ?>
 
67
  </div>
68
  <?php endif; ?>
69
 
70
- <?php if ( $inverted ): ?>
71
- <input type="hidden"
72
- class="wds-inverted-toggle-value"
73
- data-value="<?php echo esc_attr( $item_value ); ?>"
74
- value="<?php echo $checked ? esc_attr( $item_value ) : ''; ?>"
75
- name="<?php echo esc_attr( $field_name ); ?>"
76
- aria-hidden="true"
 
77
  />
78
  <?php endif; ?>
79
  </div>
1
  <?php
2
+ $inverted = empty( $inverted ) ? false : $inverted;
3
+ $field_name = empty( $field_name ) ? '' : $field_name;
4
+ $field_id = empty( $field_id ) ? $field_name : $field_id;
5
+ $checked = empty( $checked ) ? '' : $checked;
6
+ $item_label = empty( $item_label ) ? '' : $item_label;
7
+ $item_value = empty( $item_value ) ? '1' : $item_value;
8
+ $item_description = empty( $item_description ) ? '' : $item_description;
9
+ $html_description = empty( $html_description ) ? '' : $html_description;
10
+ $attributes = empty( $attributes ) ? array() : $attributes;
11
+ $sub_settings_template = empty( $sub_settings_template ) ? '' : $sub_settings_template;
12
  $sub_settings_template_args = empty( $sub_settings_template_args ) ? array() : $sub_settings_template_args;
13
+ $sub_settings_border = isset( $sub_settings_border ) ? $sub_settings_border : true;
14
 
15
  $attr_string = '';
16
  foreach ( $attributes as $attribute => $attribute_value ) {
20
  ?>
21
 
22
  <div class="sui-form-field <?php echo $inverted ? esc_attr( 'wds-inverted-toggle' ) : ''; ?>">
23
+ <label
24
+ for="<?php echo esc_attr( $field_id ); ?>"
25
+ class="wds-toggle sui-toggle"
26
+ >
27
+ <input
28
+ type="checkbox"
29
+ id="<?php echo esc_attr( $field_id ); ?>"
30
+ value="<?php echo esc_attr( $item_value ); ?>"
31
+ name="<?php echo esc_attr( $field_name ); ?>"
32
+ aria-labelledby="label-<?php echo esc_attr( $field_id ); ?>"
33
  <?php if ( $item_description ) : ?>
34
  aria-describedby="description-<?php echo esc_attr( $field_id ); ?>"
35
  <?php endif; ?>
36
  <?php if ( $checkbox_checked ) : ?>
37
  checked="checked"
38
  <?php endif; ?>
39
+ <?php if ( $sub_settings_template ) : ?>
40
  aria-controls="sub-settings-<?php echo esc_attr( $field_id ); ?>"
41
  <?php endif; ?>
42
  <?php echo $attr_string; // phpcs:ignore -- Built escaped. ?>
49
  </span>
50
 
51
  <div id="description-<?php echo esc_attr( $field_id ); ?>" class="sui-description">
52
+ <?php
53
+ if ( $item_description ) {
54
  echo esc_html( $item_description );
55
+ }
56
+ ?>
57
 
58
+ <?php
59
+ if ( $html_description ) {
60
  echo wp_kses_post( $html_description );
61
+ }
62
+ ?>
63
  </div>
64
  </label>
65
 
66
+ <?php if ( $sub_settings_template ) : ?>
67
+ <div
68
+ id="sub-settings-<?php echo esc_attr( $field_id ); ?>"
69
+ class="sui-toggle-content <?php echo $sub_settings_border ? 'sui-border-frame' : ''; ?>"
70
+ aria-label="<?php printf( esc_html__( "Sub-settings of '%s'", 'wds' ), esc_html( $item_label ) ); ?>"
71
+ style="<?php echo $checkbox_checked ? '' : 'display:none;'; ?>"
72
+ >
73
+ <?php $this->render_view( $sub_settings_template, $sub_settings_template_args ); ?>
74
  </div>
75
  <?php endif; ?>
76
 
77
+ <?php if ( $inverted ) : ?>
78
+ <input
79
+ type="hidden"
80
+ class="wds-inverted-toggle-value"
81
+ data-value="<?php echo esc_attr( $item_value ); ?>"
82
+ value="<?php echo $checked ? esc_attr( $item_value ) : ''; ?>"
83
+ name="<?php echo esc_attr( $field_name ); ?>"
84
+ aria-hidden="true"
85
  />
86
  <?php endif; ?>
87
  </div>
includes/admin/templates/upgrade-page.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php $this->_render( 'before-page-container' ); ?>
2
 
3
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-upgrade-page' ); ?>">
4
  <div class="sui-upgrade-page">
@@ -7,13 +7,15 @@
7
  <div class="sui-upgrade-page-header__content">
8
  <h1><?php esc_html_e( 'Upgrade to SmartCrawl Pro', 'wds' ); ?></h1>
9
 
10
- <p><?php esc_html_e( 'Get SmartCrawl Pro for our full WordPress search engine optimization suite, including scheduled SEO audits and sitemap crawls, automatic linking, and white label reports for clients.', 'wds' ) ?></p>
11
 
12
- <p><?php esc_html_e( 'Plus – you’ll get WPMU DEV membership, which includes our award winning Smush Pro plugin for image optimization, 24/7 live WordPress support, and unlimited usage of all our premium plugins.', 'wds' ) ?></p>
13
 
14
- <a href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_propage_topbutton"
15
- target="_blank"
16
- class="sui-button sui-button-lg sui-button-purple">
 
 
17
  <?php esc_html_e( 'Try SmartCrawl Pro for Free Today', 'wds' ); ?>
18
  </a>
19
 
@@ -24,8 +26,11 @@
24
  <span class="sui-reviews-customer-count">-</span> <?php esc_html_e( 'customers', 'wds' ); ?>
25
  </div>
26
 
27
- <a class="sui-reviews__link" href="https://www.reviews.io/company-reviews/store/wpmudev-org"
28
- target="_blank">Reviews.io<span class="sui-icon-arrow-right" aria-hidden="true"></span></a>
 
 
 
29
  </div>
30
  </div>
31
 
@@ -98,20 +103,26 @@
98
 
99
  <p><?php esc_html_e( "97% of customers are happy with WPMU DEV's service, and it’s a great time to join them: as a SmartCrawl user you’ll get a free trial period, so you can see what all the fuss is about.", 'wds' ); ?></p>
100
 
101
- <a href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_propage_bottombutton"
102
- target="_blank"
103
- class="sui-button sui-button-lg sui-button-purple">
 
 
104
  <?php esc_html_e( 'Get SmartCrawl Pro, and get a better WordPress', 'wds' ); ?>
105
  </a>
106
 
107
- <a href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_propage_bottombutton"
108
- target="_blank"
109
- class="sui-button sui-button-lg sui-button-purple sui-hidden-desktop">
 
 
110
  <?php esc_html_e( 'Get SmartCrawl Pro', 'wds' ); ?>
111
  </a>
112
 
113
- <a href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_propage_bottombutton"
114
- target="_blank">
 
 
115
  <?php esc_html_e( 'Try it free today', 'wds' ); ?>
116
  </a>
117
  </div>
1
+ <?php $this->render_view( 'before-page-container' ); ?>
2
 
3
  <div id="container" class="<?php smartcrawl_wrap_class( 'wds-upgrade-page' ); ?>">
4
  <div class="sui-upgrade-page">
7
  <div class="sui-upgrade-page-header__content">
8
  <h1><?php esc_html_e( 'Upgrade to SmartCrawl Pro', 'wds' ); ?></h1>
9
 
10
+ <p><?php esc_html_e( 'Get SmartCrawl Pro for our full WordPress search engine optimization suite, including scheduled SEO audits and sitemap crawls, automatic linking, and white label reports for clients.', 'wds' ); ?></p>
11
 
12
+ <p><?php esc_html_e( 'Plus – you’ll get WPMU DEV membership, which includes our award winning Smush Pro plugin for image optimization, 24/7 live WordPress support, and unlimited usage of all our premium plugins.', 'wds' ); ?></p>
13
 
14
+ <a
15
+ href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_propage_topbutton"
16
+ target="_blank"
17
+ class="sui-button sui-button-lg sui-button-purple"
18
+ >
19
  <?php esc_html_e( 'Try SmartCrawl Pro for Free Today', 'wds' ); ?>
20
  </a>
21
 
26
  <span class="sui-reviews-customer-count">-</span> <?php esc_html_e( 'customers', 'wds' ); ?>
27
  </div>
28
 
29
+ <a
30
+ class="sui-reviews__link"
31
+ href="https://www.reviews.io/company-reviews/store/wpmudev-org"
32
+ target="_blank"
33
+ >Reviews.io<span class="sui-icon-arrow-right" aria-hidden="true"></span></a>
34
  </div>
35
  </div>
36
 
103
 
104
  <p><?php esc_html_e( "97% of customers are happy with WPMU DEV's service, and it’s a great time to join them: as a SmartCrawl user you’ll get a free trial period, so you can see what all the fuss is about.", 'wds' ); ?></p>
105
 
106
+ <a
107
+ href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_propage_bottombutton"
108
+ target="_blank"
109
+ class="sui-button sui-button-lg sui-button-purple"
110
+ >
111
  <?php esc_html_e( 'Get SmartCrawl Pro, and get a better WordPress', 'wds' ); ?>
112
  </a>
113
 
114
+ <a
115
+ href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_propage_bottombutton"
116
+ target="_blank"
117
+ class="sui-button sui-button-lg sui-button-purple sui-hidden-desktop"
118
+ >
119
  <?php esc_html_e( 'Get SmartCrawl Pro', 'wds' ); ?>
120
  </a>
121
 
122
+ <a
123
+ href="https://wpmudev.com/project/smartcrawl-wordpress-seo/?utm_source=smartcrawl&utm_medium=plugin&utm_campaign=smartcrawl_propage_bottombutton"
124
+ target="_blank"
125
+ >
126
  <?php esc_html_e( 'Try it free today', 'wds' ); ?>
127
  </a>
128
  </div>
includes/admin/templates/url-crawl-master.php CHANGED
@@ -1,35 +1,43 @@
1
  <?php
2
  $ready_template = empty( $ready_template ) ? '' : $ready_template;
3
- $ready_args = empty( $ready_args ) ? array() : $ready_args;
4
 
5
  $no_data_template = empty( $no_data_template ) ? '' : $no_data_template;
6
- $no_data_args = empty( $no_data_args ) ? array() : $no_data_args;
7
 
8
  $progress_template = empty( $progress_template ) ? '' : $progress_template;
9
- $progress_args = empty( $progress_args ) ? array() : $progress_args;
10
 
11
  /**
 
 
12
  * @var Smartcrawl_Seo_Service $service
13
  */
14
- $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
15
  $crawl_report = $service->get_report();
16
 
17
  if ( $crawl_report->has_data() ) {
18
  if ( $ready_template ) {
19
- $this->_render( $ready_template, array_merge(
20
- array( 'report' => $crawl_report ),
21
- $ready_args
22
- ) );
 
 
 
23
  }
24
  } elseif ( $crawl_report->is_in_progress() ) {
25
  if ( $progress_template ) {
26
- $this->_render( $progress_template, array_merge(
27
- array( 'progress' => $crawl_report->get_progress() ),
28
- $progress_args
29
- ) );
 
 
 
30
  }
31
  } else {
32
  if ( $no_data_template ) {
33
- $this->_render( $no_data_template, $no_data_args );
34
  }
35
  }
1
  <?php
2
  $ready_template = empty( $ready_template ) ? '' : $ready_template;
3
+ $ready_args = empty( $ready_args ) ? array() : $ready_args;
4
 
5
  $no_data_template = empty( $no_data_template ) ? '' : $no_data_template;
6
+ $no_data_args = empty( $no_data_args ) ? array() : $no_data_args;
7
 
8
  $progress_template = empty( $progress_template ) ? '' : $progress_template;
9
+ $progress_args = empty( $progress_args ) ? array() : $progress_args;
10
 
11
  /**
12
+ * Service.
13
+ *
14
  * @var Smartcrawl_Seo_Service $service
15
  */
16
+ $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
17
  $crawl_report = $service->get_report();
18
 
19
  if ( $crawl_report->has_data() ) {
20
  if ( $ready_template ) {
21
+ $this->render_view(
22
+ $ready_template,
23
+ array_merge(
24
+ array( 'report' => $crawl_report ),
25
+ $ready_args
26
+ )
27
+ );
28
  }
29
  } elseif ( $crawl_report->is_in_progress() ) {
30
  if ( $progress_template ) {
31
+ $this->render_view(
32
+ $progress_template,
33
+ array_merge(
34
+ array( 'progress' => $crawl_report->get_progress() ),
35
+ $progress_args
36
+ )
37
+ );
38
  }
39
  } else {
40
  if ( $no_data_template ) {
41
+ $this->render_view( $no_data_template, $no_data_args );
42
  }
43
  }
includes/admin/templates/urlmetrics-metabox.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  $attribution = empty( $attribution ) ? '#' : $attribution;
3
- $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
4
  ?>
5
  <table class="sui-table">
6
  <thead>
@@ -17,8 +17,10 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
17
  <a href="https://moz.com/learn/seo/external-link" target="_blank">(?)</a>
18
  </td>
19
  <td>
20
- <a href="<?php echo esc_attr( $attribution ); ?>"
21
- target="_blank">
 
 
22
  <?php echo ! empty( $urlmetrics->ueid ) ? esc_attr( $urlmetrics->ueid ) : '0'; ?>
23
  </a>
24
  </td>
@@ -29,8 +31,10 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
29
  <a href="https://moz.com/learn/seo/internal-link" target="_blank">(?)</a>
30
  </td>
31
  <td>
32
- <a href="<?php echo esc_attr( $attribution ); ?>"
33
- target="_blank">
 
 
34
  <?php echo ! empty( $urlmetrics->uid ) ? esc_attr( $urlmetrics->uid ) : '0'; ?>
35
  </a>
36
  </td>
@@ -42,14 +46,18 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
42
  </td>
43
  <td>
44
  <?php esc_html_e( '10-point score:', 'wds' ); ?>
45
- <a href="<?php echo esc_attr( $attribution ); ?>"
46
- target="_blank">
 
 
47
  <?php echo( ! empty( $urlmetrics->umrp ) ? esc_attr( $urlmetrics->umrp ) : '--' ); ?>
48
  </a>
49
  <br/>
50
  <?php esc_html_e( 'Raw score:', 'wds' ); ?>
51
- <a href="<?php echo esc_attr( $attribution ); ?>"
52
- target="_blank">
 
 
53
  <?php echo ! empty( $urlmetrics->umrr ) ? esc_attr( $urlmetrics->umrr ) : '--'; ?>
54
  </a>
55
  </td>
@@ -60,8 +68,10 @@ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
60
  <a href="https://moz.com/learn/seo/page-authority" target="_blank">(?)</a>
61
  </td>
62
  <td>
63
- <a href="<?php echo esc_attr( $attribution ); ?>"
64
- target="_blank">
 
 
65
  <?php echo ! empty( $urlmetrics->upa ) ? esc_attr( $urlmetrics->upa ) : '0'; ?>
66
  </a>
67
  </td>
1
  <?php
2
  $attribution = empty( $attribution ) ? '#' : $attribution;
3
+ $urlmetrics = empty( $urlmetrics ) ? new stdClass() : $urlmetrics;
4
  ?>
5
  <table class="sui-table">
6
  <thead>
17
  <a href="https://moz.com/learn/seo/external-link" target="_blank">(?)</a>
18
  </td>
19
  <td>
20
+ <a
21
+ href="<?php echo esc_attr( $attribution ); ?>"
22
+ target="_blank"
23
+ >
24
  <?php echo ! empty( $urlmetrics->ueid ) ? esc_attr( $urlmetrics->ueid ) : '0'; ?>
25
  </a>
26
  </td>
31
  <a href="https://moz.com/learn/seo/internal-link" target="_blank">(?)</a>
32
  </td>
33
  <td>
34
+ <a
35
+ href="<?php echo esc_attr( $attribution ); ?>"
36
+ target="_blank"
37
+ >
38
  <?php echo ! empty( $urlmetrics->uid ) ? esc_attr( $urlmetrics->uid ) : '0'; ?>
39
  </a>
40
  </td>
46
  </td>
47
  <td>
48
  <?php esc_html_e( '10-point score:', 'wds' ); ?>
49
+ <a
50
+ href="<?php echo esc_attr( $attribution ); ?>"
51
+ target="_blank"
52
+ >
53
  <?php echo( ! empty( $urlmetrics->umrp ) ? esc_attr( $urlmetrics->umrp ) : '--' ); ?>
54
  </a>
55
  <br/>
56
  <?php esc_html_e( 'Raw score:', 'wds' ); ?>
57
+ <a
58
+ href="<?php echo esc_attr( $attribution ); ?>"
59
+ target="_blank"
60
+ >
61
  <?php echo ! empty( $urlmetrics->umrr ) ? esc_attr( $urlmetrics->umrr ) : '--'; ?>
62
  </a>
63
  </td>
68
  <a href="https://moz.com/learn/seo/page-authority" target="_blank">(?)</a>
69
  </td>
70
  <td>
71
+ <a
72
+ href="<?php echo esc_attr( $attribution ); ?>"
73
+ target="_blank"
74
+ >
75
  <?php echo ! empty( $urlmetrics->upa ) ? esc_attr( $urlmetrics->upa ) : '0'; ?>
76
  </a>
77
  </td>
includes/admin/templates/vertical-tab-section-accordion.php CHANGED
@@ -1,48 +1,59 @@
1
  <?php
2
- $smartcrawl_options = empty( $_view['options'] ) ? array() : $_view['options'];
3
- $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
- $section_title = empty( $section_title ) ? '' : $section_title;
5
  $section_description = empty( $section_description ) ? '' : $section_description;
6
- $section_template = empty( $section_template ) ? '' : $section_template;
7
- $section_args = empty( $section_args ) ? array() : $section_args;
8
- $section_type = empty( $section_type ) ? '' : $section_type;
9
 
10
- $section_enabled_option = empty( $section_enabled_option ) ? '' : $section_enabled_option;
11
- $section_enabled = empty( $section_enabled_option ) || ! empty( $smartcrawl_options[ $section_enabled_option ] );
12
  $section_enabled_option_name = $option_name . '[' . $section_enabled_option . ']';
13
- $section_toggle_tooltip = empty( $section_toggle_tooltip )
14
  ? sprintf( esc_html__( 'Enable/Disable %s', 'wds' ), strtolower( $section_title ) )
15
  : $section_toggle_tooltip;
16
- $accordion_section_open = empty( $accordion_section_open ) ? false : $accordion_section_open;
17
 
18
- $classes = array();
19
  $classes[] = $section_enabled ? '' : 'sui-accordion-item--disabled';
20
  $classes[] = $section_enabled && $accordion_section_open ? 'sui-accordion-item--open' : '';
21
  ?>
22
 
23
- <div data-type="<?php echo esc_attr( $section_type ); ?>"
24
- class="sui-accordion-item <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
 
 
25
  <div class="sui-accordion-item-header">
26
  <div class="sui-accordion-item-title sui-accordion-col-2">
27
  <?php echo esc_html( $section_title ); ?>
28
  </div>
29
 
30
  <div class="sui-accordion-col-2">
31
- <?php if ( $section_enabled_option ): ?>
32
- <span class="sui-tooltip sui-tooltip-top-right"
33
- data-tooltip="<?php echo esc_html( $section_toggle_tooltip ); ?>">
34
- <label for="<?php echo esc_attr( $section_enabled_option_name ); ?>"
35
- class="sui-toggle sui-accordion-item-action">
36
- <input type="checkbox" <?php checked( $section_enabled ); ?>
37
- id="<?php echo esc_attr( $section_enabled_option_name ); ?>"
38
- name="<?php echo esc_attr( $section_enabled_option_name ); ?>">
 
 
 
 
 
 
 
39
  <span aria-hidden="true" class="sui-toggle-slider"></span>
40
  <span class="sui-screen-reader-text">Toggle</span>
41
  </label>
42
  </span>
43
  <?php endif; ?>
44
- <button type="button" class="sui-button-icon sui-accordion-open-indicator"
45
- aria-label="<?php esc_html_e( 'Open item', 'wds' ); ?>">
 
 
46
  <span class="sui-icon-chevron-down" aria-hidden="true"></span>
47
  </button>
48
  </div>
@@ -54,7 +65,7 @@ $classes[] = $section_enabled && $accordion_section_open ? 'sui-accordion-item--
54
  <?php if ( $section_description ) : ?>
55
  <p><?php echo esc_html( $section_description ); ?></p>
56
  <?php endif; ?>
57
- <?php $this->_render( $section_template, $section_args ); ?>
58
  </div>
59
  </div>
60
  </div>
1
  <?php
2
+ $smartcrawl_options = empty( $_view['options'] ) ? array() : $_view['options'];
3
+ $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
4
+ $section_title = empty( $section_title ) ? '' : $section_title;
5
  $section_description = empty( $section_description ) ? '' : $section_description;
6
+ $section_template = empty( $section_template ) ? '' : $section_template;
7
+ $section_args = empty( $section_args ) ? array() : $section_args;
8
+ $section_type = empty( $section_type ) ? '' : $section_type;
9
 
10
+ $section_enabled_option = empty( $section_enabled_option ) ? '' : $section_enabled_option;
11
+ $section_enabled = empty( $section_enabled_option ) || ! empty( $smartcrawl_options[ $section_enabled_option ] );
12
  $section_enabled_option_name = $option_name . '[' . $section_enabled_option . ']';
13
+ $section_toggle_tooltip = empty( $section_toggle_tooltip )
14
  ? sprintf( esc_html__( 'Enable/Disable %s', 'wds' ), strtolower( $section_title ) )
15
  : $section_toggle_tooltip;
16
+ $accordion_section_open = empty( $accordion_section_open ) ? false : $accordion_section_open;
17
 
18
+ $classes = array();
19
  $classes[] = $section_enabled ? '' : 'sui-accordion-item--disabled';
20
  $classes[] = $section_enabled && $accordion_section_open ? 'sui-accordion-item--open' : '';
21
  ?>
22
 
23
+ <div
24
+ data-type="<?php echo esc_attr( $section_type ); ?>"
25
+ class="sui-accordion-item <?php echo esc_attr( implode( ' ', $classes ) ); ?>"
26
+ >
27
  <div class="sui-accordion-item-header">
28
  <div class="sui-accordion-item-title sui-accordion-col-2">
29
  <?php echo esc_html( $section_title ); ?>
30
  </div>
31
 
32
  <div class="sui-accordion-col-2">
33
+ <?php if ( $section_enabled_option ) : ?>
34
+ <span
35
+ class="sui-tooltip sui-tooltip-top-right"
36
+ data-tooltip="<?php echo esc_html( $section_toggle_tooltip ); ?>"
37
+ >
38
+ <label
39
+ for="<?php echo esc_attr( $section_enabled_option_name ); ?>"
40
+ class="sui-toggle sui-accordion-item-action"
41
+ >
42
+ <input
43
+ type="checkbox"
44
+ <?php checked( $section_enabled ); ?>
45
+ id="<?php echo esc_attr( $section_enabled_option_name ); ?>"
46
+ name="<?php echo esc_attr( $section_enabled_option_name ); ?>"
47
+ >
48
  <span aria-hidden="true" class="sui-toggle-slider"></span>
49
  <span class="sui-screen-reader-text">Toggle</span>
50
  </label>
51
  </span>
52
  <?php endif; ?>
53
+ <button
54
+ type="button" class="sui-button-icon sui-accordion-open-indicator"
55
+ aria-label="<?php esc_html_e( 'Open item', 'wds' ); ?>"
56
+ >
57
  <span class="sui-icon-chevron-down" aria-hidden="true"></span>
58
  </button>
59
  </div>
65
  <?php if ( $section_description ) : ?>
66
  <p><?php echo esc_html( $section_description ); ?></p>
67
  <?php endif; ?>
68
+ <?php $this->render_view( $section_template, $section_args ); ?>
69
  </div>
70
  </div>
71
  </div>
includes/admin/templates/vertical-tab-section.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  $section_description = empty( $section_description ) ? '' : $section_description;
3
- $section_template = empty( $section_template ) ? '' : $section_template;
4
- $section_args = empty( $section_args ) ? array() : $section_args;
5
- $section_type = empty( $section_type ) ? '' : $section_type;
6
  ?>
7
 
8
  <div data-type="<?php echo esc_attr( $section_type ); ?>">
@@ -10,5 +10,5 @@ $section_type = empty( $section_type ) ? '' : $section_type;
10
  <p><?php echo esc_html( $section_description ); ?></p>
11
  <?php endif; ?>
12
 
13
- <?php $this->_render( $section_template, $section_args ); ?>
14
  </div>
1
  <?php
2
  $section_description = empty( $section_description ) ? '' : $section_description;
3
+ $section_template = empty( $section_template ) ? '' : $section_template;
4
+ $section_args = empty( $section_args ) ? array() : $section_args;
5
+ $section_type = empty( $section_type ) ? '' : $section_type;
6
  ?>
7
 
8
  <div data-type="<?php echo esc_attr( $section_type ); ?>">
10
  <p><?php echo esc_html( $section_description ); ?></p>
11
  <?php endif; ?>
12
 
13
+ <?php $this->render_view( $section_template, $section_args ); ?>
14
  </div>
includes/admin/templates/vertical-tab-upsell.php CHANGED
@@ -1,44 +1,46 @@
1
  <?php
2
- // Required
3
- $tab_id = empty( $tab_id ) ? '' : $tab_id;
4
- $tab_name = empty( $tab_name ) ? '' : $tab_name;
5
- $is_active = empty( $is_active ) ? false : $is_active;
6
- $tab_sections = ! empty( $tab_sections ) && is_array( $tab_sections ) ? $tab_sections : array();
7
  $title_actions_left = empty( $title_actions_left ) ? false : $title_actions_left;
8
- $is_member = empty( $_view['is_member'] ) ? false : true;
9
 
10
- // Optional
11
  $button_text = isset( $button_text ) ? $button_text : esc_html__( 'Save Settings', 'wds' );
12
 
13
  ?>
14
- <div class="wds-vertical-tab-section sui-box <?php echo esc_attr( $tab_id ); ?> <?php echo $is_active ? '' : 'hidden'; ?>"
15
- id="<?php echo esc_attr( $tab_id ); ?>">
16
-
 
17
  <div class="sui-box-header">
18
  <h2 class="sui-box-title">
19
  <?php echo esc_html( $tab_name ); ?>
20
  </h2>
21
 
22
- <?php if ( $title_actions_left ): ?>
23
  <div class="sui-actions-left">
24
- <?php $this->_render( $title_actions_left ); ?>
25
  </div>
26
  <?php endif; ?>
27
  </div>
28
 
29
  <div class="sui-box-body wds-upsell-items">
30
  <?php foreach ( $tab_sections as $section ) : ?>
31
- <?php $this->_render( 'vertical-tab-section', $section ); ?>
32
  <?php endforeach; ?>
33
  </div>
34
 
35
- <?php if ( $button_text ): ?>
36
  <div class="sui-box-footer">
37
- <button name="submit"
38
- type="submit"
39
- class="sui-button sui-button-blue">
 
 
40
  <span class="sui-icon-save" aria-hidden="true"></span>
41
-
42
  <?php echo esc_html( $button_text ); ?>
43
  </button>
44
  </div>
1
  <?php
2
+ // Required.
3
+ $tab_id = empty( $tab_id ) ? '' : $tab_id;
4
+ $tab_name = empty( $tab_name ) ? '' : $tab_name;
5
+ $is_active = empty( $is_active ) ? false : $is_active;
6
+ $tab_sections = ! empty( $tab_sections ) && is_array( $tab_sections ) ? $tab_sections : array();
7
  $title_actions_left = empty( $title_actions_left ) ? false : $title_actions_left;
8
+ $is_member = ! empty( $_view['is_member'] );
9
 
10
+ // Optional.
11
  $button_text = isset( $button_text ) ? $button_text : esc_html__( 'Save Settings', 'wds' );
12
 
13
  ?>
14
+ <div
15
+ class="wds-vertical-tab-section sui-box <?php echo esc_attr( $tab_id ); ?> <?php echo $is_active ? '' : 'hidden'; ?>"
16
+ id="<?php echo esc_attr( $tab_id ); ?>"
17
+ >
18
  <div class="sui-box-header">
19
  <h2 class="sui-box-title">
20
  <?php echo esc_html( $tab_name ); ?>
21
  </h2>
22
 
23
+ <?php if ( $title_actions_left ) : ?>
24
  <div class="sui-actions-left">
25
+ <?php $this->render_view( $title_actions_left ); ?>
26
  </div>
27
  <?php endif; ?>
28
  </div>
29
 
30
  <div class="sui-box-body wds-upsell-items">
31
  <?php foreach ( $tab_sections as $section ) : ?>
32
+ <?php $this->render_view( 'vertical-tab-section', $section ); ?>
33
  <?php endforeach; ?>
34
  </div>
35
 
36
+ <?php if ( $button_text ) : ?>
37
  <div class="sui-box-footer">
38
+ <button
39
+ name="submit"
40
+ type="submit"
41
+ class="sui-button sui-button-blue"
42
+ >
43
  <span class="sui-icon-save" aria-hidden="true"></span>
 
44
  <?php echo esc_html( $button_text ); ?>
45
  </button>
46
  </div>
includes/admin/templates/vertical-tab.php CHANGED
@@ -1,36 +1,37 @@
1
  <?php
2
- // Required
3
- $tab_id = empty( $tab_id ) ? '' : $tab_id;
4
- $tab_name = empty( $tab_name ) ? '' : $tab_name;
5
- $is_active = empty( $is_active ) ? false : $is_active;
6
- $tab_sections = ! empty( $tab_sections ) && is_array( $tab_sections ) ? $tab_sections : array();
7
- $title_actions_left = empty($title_actions_left) ? false : $title_actions_left;
8
- $title_actions_right = empty($title_actions_right) ? false : $title_actions_right;
9
 
10
- // Optional
11
  $button_text = isset( $button_text ) ? $button_text : esc_html__( 'Save Settings', 'wds' );
12
 
13
- // Variables
14
- $is_singular = count( $tab_sections ) === 1;
15
  $first_section = true;
16
  ?>
17
- <div class="wds-vertical-tab-section sui-box <?php echo esc_attr( $tab_id ); ?> <?php echo $is_active ? '' : 'hidden'; ?>"
18
- id="<?php echo esc_attr( $tab_id ); ?>">
19
-
 
20
  <div class="sui-box-header">
21
  <h2 class="sui-box-title">
22
  <?php echo esc_html( $tab_name ); ?>
23
  </h2>
24
 
25
- <?php if ( $title_actions_left ): ?>
26
  <div class="sui-actions-left">
27
- <?php $this->_render( $title_actions_left ); ?>
28
  </div>
29
  <?php endif; ?>
30
 
31
- <?php if ( $title_actions_right ): ?>
32
  <div class="sui-actions-right">
33
- <?php $this->_render( $title_actions_right ); ?>
34
  </div>
35
  <?php endif; ?>
36
  </div>
@@ -38,7 +39,7 @@ $first_section = true;
38
  <div class="<?php echo $is_singular ? 'sui-box-body' : 'sui-accordion sui-accordion-flushed'; ?>">
39
  <?php foreach ( $tab_sections as $section ) : ?>
40
  <?php
41
- $this->_render(
42
  $is_singular ? 'vertical-tab-section' : 'vertical-tab-section-accordion',
43
  array_merge(
44
  $section,
@@ -56,9 +57,11 @@ $first_section = true;
56
 
57
  <?php if ( $button_text ) : ?>
58
  <div class="sui-box-footer <?php echo $is_singular ? '' : 'wds-no-border'; ?>">
59
- <button name="submit"
60
- type="submit"
61
- class="sui-button sui-button-blue">
 
 
62
  <span class="sui-icon-save" aria-hidden="true"></span>
63
 
64
  <?php echo esc_html( $button_text ); ?>
1
  <?php
2
+ // Required.
3
+ $tab_id = empty( $tab_id ) ? '' : $tab_id;
4
+ $tab_name = empty( $tab_name ) ? '' : $tab_name;
5
+ $is_active = empty( $is_active ) ? false : $is_active;
6
+ $tab_sections = ! empty( $tab_sections ) && is_array( $tab_sections ) ? $tab_sections : array();
7
+ $title_actions_left = empty( $title_actions_left ) ? false : $title_actions_left;
8
+ $title_actions_right = empty( $title_actions_right ) ? false : $title_actions_right;
9
 
10
+ // Optional.
11
  $button_text = isset( $button_text ) ? $button_text : esc_html__( 'Save Settings', 'wds' );
12
 
13
+ // Variables.
14
+ $is_singular = count( $tab_sections ) === 1;
15
  $first_section = true;
16
  ?>
17
+ <div
18
+ class="wds-vertical-tab-section sui-box <?php echo esc_attr( $tab_id ); ?> <?php echo $is_active ? '' : 'hidden'; ?>"
19
+ id="<?php echo esc_attr( $tab_id ); ?>"
20
+ >
21
  <div class="sui-box-header">
22
  <h2 class="sui-box-title">
23
  <?php echo esc_html( $tab_name ); ?>
24
  </h2>
25
 
26
+ <?php if ( $title_actions_left ) : ?>
27
  <div class="sui-actions-left">
28
+ <?php $this->render_view( $title_actions_left ); ?>
29
  </div>
30
  <?php endif; ?>
31
 
32
+ <?php if ( $title_actions_right ) : ?>
33
  <div class="sui-actions-right">
34
+ <?php $this->render_view( $title_actions_right ); ?>
35
  </div>
36
  <?php endif; ?>
37
  </div>
39
  <div class="<?php echo $is_singular ? 'sui-box-body' : 'sui-accordion sui-accordion-flushed'; ?>">
40
  <?php foreach ( $tab_sections as $section ) : ?>
41
  <?php
42
+ $this->render_view(
43
  $is_singular ? 'vertical-tab-section' : 'vertical-tab-section-accordion',
44
  array_merge(
45
  $section,
57
 
58
  <?php if ( $button_text ) : ?>
59
  <div class="sui-box-footer <?php echo $is_singular ? '' : 'wds-no-border'; ?>">
60
+ <button
61
+ name="submit"
62
+ type="submit"
63
+ class="sui-button sui-button-blue"
64
+ >
65
  <span class="sui-icon-save" aria-hidden="true"></span>
66
 
67
  <?php echo esc_html( $button_text ); ?>
includes/admin/templates/vertical-tabs-side-nav.php CHANGED
@@ -1,39 +1,49 @@
1
  <?php
2
- $tabs = empty( $tabs ) || ! is_array( $tabs ) ? array() : $tabs;
3
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
4
  ?>
5
  <div class="wds-vertical-tabs sui-sidenav">
6
  <ul class="sui-vertical-tabs">
7
- <?php foreach ( $tabs as $tab ): ?>
8
  <?php
9
- $tab_id = smartcrawl_get_array_value( $tab, 'id' );
10
- $tab_name = smartcrawl_get_array_value( $tab, 'name' );
11
- $spinner = smartcrawl_get_array_value( $tab, 'spinner' );
12
- $tag_value = smartcrawl_get_array_value( $tab, 'tag_value' );
13
- $tag_class = smartcrawl_get_array_value( $tab, 'tag_class' );
14
- $tick = smartcrawl_get_array_value( $tab, 'tick' );
15
  $tick_class = smartcrawl_get_array_value( $tab, 'tick_class' );
16
  $tick_class = empty( $tick_class ) ? 'sui-success' : $tick_class;
17
  ?>
18
  <li class="sui-vertical-tab <?php echo esc_attr( $tab_id ); ?> <?php echo $active_tab === $tab_id ? esc_attr( 'current' ) : ''; ?>">
19
 
20
- <a role="button" data-target="<?php echo esc_attr( $tab_id ); ?>" href="#"
21
- aria-label="<?php printf( esc_html__( '%s tab', 'wds' ), wp_strip_all_tags( $tab_name ) ) ?>">
 
 
 
 
22
  <?php echo wp_kses_post( $tab_name ); ?>
23
  </a>
24
 
25
- <span class="sui-icon-loader sui-loading"
26
- aria-hidden="true"
27
- style="<?php echo $spinner ? '' : 'display:none;'; ?>"></span>
 
 
28
 
29
- <span class="sui-tag <?php echo esc_attr( $tag_class ); ?>"
30
- style="<?php echo $tag_value ? '' : 'display:none;'; ?>">
 
 
31
  <?php echo esc_html( $tag_value ); ?>
32
  </span>
33
 
34
- <span class="sui-icon-check-tick <?php echo esc_attr( $tick_class ); ?>"
35
- aria-hidden="true"
36
- style="<?php echo $tick ? '' : 'display:none;'; ?>"></span>
 
 
37
  </li>
38
  <?php endforeach; ?>
39
  </ul>
1
  <?php
2
+ $tabs = empty( $tabs ) || ! is_array( $tabs ) ? array() : $tabs; // phpcs:ignore
3
  $active_tab = empty( $active_tab ) ? '' : $active_tab;
4
  ?>
5
  <div class="wds-vertical-tabs sui-sidenav">
6
  <ul class="sui-vertical-tabs">
7
+ <?php foreach ( $tabs as $tab ) : // phpcs:ignore ?>
8
  <?php
9
+ $tab_id = smartcrawl_get_array_value( $tab, 'id' );
10
+ $tab_name = smartcrawl_get_array_value( $tab, 'name' );
11
+ $spinner = smartcrawl_get_array_value( $tab, 'spinner' );
12
+ $tag_value = smartcrawl_get_array_value( $tab, 'tag_value' );
13
+ $tag_class = smartcrawl_get_array_value( $tab, 'tag_class' );
14
+ $tick = smartcrawl_get_array_value( $tab, 'tick' );
15
  $tick_class = smartcrawl_get_array_value( $tab, 'tick_class' );
16
  $tick_class = empty( $tick_class ) ? 'sui-success' : $tick_class;
17
  ?>
18
  <li class="sui-vertical-tab <?php echo esc_attr( $tab_id ); ?> <?php echo $active_tab === $tab_id ? esc_attr( 'current' ) : ''; ?>">
19
 
20
+ <a
21
+ role="button"
22
+ data-target="<?php echo esc_attr( $tab_id ); ?>"
23
+ href="#"
24
+ aria-label="<?php printf( esc_html__( '%s tab', 'wds' ), esc_html( wp_strip_all_tags( $tab_name ) ) ); ?>"
25
+ >
26
  <?php echo wp_kses_post( $tab_name ); ?>
27
  </a>
28
 
29
+ <span
30
+ class="sui-icon-loader sui-loading"
31
+ aria-hidden="true"
32
+ style="<?php echo $spinner ? '' : 'display:none;'; ?>"
33
+ ></span>
34
 
35
+ <span
36
+ class="sui-tag <?php echo esc_attr( $tag_class ); ?>"
37
+ style="<?php echo $tag_value ? '' : 'display:none;'; ?>"
38
+ >
39
  <?php echo esc_html( $tag_value ); ?>
40
  </span>
41
 
42
+ <span
43
+ class="sui-icon-check-tick <?php echo esc_attr( $tick_class ); ?>"
44
+ aria-hidden="true"
45
+ style="<?php echo $tick ? '' : 'display:none;'; ?>"
46
+ ></span>
47
  </li>
48
  <?php endforeach; ?>
49
  </ul>
includes/admin/templates/wp-dashboard/sitemaps-widget-js.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
- $updating = empty( $updating ) ? '' : $updating;
3
- $updated = empty( $updated ) ? '' : $updated;
4
  $notifying = empty( $notifying ) ? '' : $notifying;
5
- $notified = empty( $notified ) ? '' : $notified;
6
  ?>
7
  <script type="text/javascript">
8
  ;(function ($) {
1
  <?php
2
+ $updating = empty( $updating ) ? '' : $updating;
3
+ $updated = empty( $updated ) ? '' : $updated;
4
  $notifying = empty( $notifying ) ? '' : $notifying;
5
+ $notified = empty( $notified ) ? '' : $notified;
6
  ?>
7
  <script type="text/javascript">
8
  ;(function ($) {
includes/admin/templates/wp-dashboard/sitemaps-widget.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
- $last_update_date = empty( $last_update_date ) ? '' : $last_update_date;
3
- $last_update_time = empty( $last_update_time ) ? '' : $last_update_time;
4
  $last_update_timestamp = empty( $last_update_timestamp ) ? '' : $last_update_timestamp;
5
- $engines = empty( $engines ) ? array() : $engines;
6
- $sitemap_stats = empty( $sitemap_stats ) ? array() : $sitemap_stats;
7
  ?>
8
 
9
  <div class="wpmud wds-sitemaps-widget">
@@ -34,9 +34,9 @@ $sitemap_stats = empty( $sitemap_stats ) ? array() : $sitemap_stats;
34
  <ul>
35
  <?php
36
  foreach ( $engines as $key => $engine ) {
37
- $service_name = ucfirst( $key );
38
- $engine_date = ! empty( $engine['time'] ) ? date_i18n( get_option( 'date_format' ), $engine['time'] ) : false;
39
- $engine_time = ! empty( $engine['time'] ) ? date_i18n( get_option( 'time_format' ), $engine['time'] ) : false;
40
  $engine_timestamp = ( $engine_date && $engine_time ) ? sprintf( __( 'Last notified on %1$s, at %2$s.', 'wds' ), $engine_date, $engine_time ) : __( 'Not notified', 'wds' );
41
  ?>
42
  <li>
1
  <?php
2
+ $last_update_date = empty( $last_update_date ) ? '' : $last_update_date;
3
+ $last_update_time = empty( $last_update_time ) ? '' : $last_update_time;
4
  $last_update_timestamp = empty( $last_update_timestamp ) ? '' : $last_update_timestamp;
5
+ $engines = empty( $engines ) ? array() : $engines;
6
+ $sitemap_stats = empty( $sitemap_stats ) ? array() : $sitemap_stats;
7
  ?>
8
 
9
  <div class="wpmud wds-sitemaps-widget">
34
  <ul>
35
  <?php
36
  foreach ( $engines as $key => $engine ) {
37
+ $service_name = ucfirst( $key );
38
+ $engine_date = ! empty( $engine['time'] ) ? date_i18n( get_option( 'date_format' ), $engine['time'] ) : false;
39
+ $engine_time = ! empty( $engine['time'] ) ? date_i18n( get_option( 'time_format' ), $engine['time'] ) : false;
40
  $engine_timestamp = ( $engine_date && $engine_time ) ? sprintf( __( 'Last notified on %1$s, at %2$s.', 'wds' ), $engine_date, $engine_time ) : __( 'Not notified', 'wds' );
41
  ?>
42
  <li>
includes/assets/css/admin.css DELETED
File without changes
includes/assets/css/app.css CHANGED
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css?family=Roboto:400,500,700";.sui-2-10-9 .sui-wrap .sui-multistrings-aria,.sui-2-10-9 .sui-wrap .sui-tree li[role=treeitem]>.sui-tree-node>label.sui-node-checkbox input,.sui-2-10-9 .sui-wrap .sui-tree li[role=treeitem]>.sui-tree-node>label.sui-node-checkbox span:not([aria-hidden]),.sui-2-10-9 .sui-wrap .sui-side-tabs>[data-tabs]>* input,.sui-2-10-9 .sui-wrap .sui-side-tabs>[data-tabs] .sui-tab-item input,.sui-2-10-9 .sui-wrap .sui-side-tabs>.sui-tabs-menu>* input,.sui-2-10-9 .sui-wrap .sui-side-tabs>.sui-tabs-menu .sui-tab-item input,.sui-2-10-9 .sui-wrap .sui-colorpicker-wrap .wp-picker-container .button,.sui-2-10-9 .sui-wrap .sui-upload input[type=file],.sui-2-10-9 .sui-wrap .sui-checkbox input,.sui-2-10-9 .sui-wrap .sui-radio input,.sui-2-10-9 .sui-wrap .sui-multi-checkbox label input,.sui-2-10-9 .sui-wrap .sui-box-selector input,.sui-2-10-9 .sui-wrap .sui-toggle input,.sui-2-10-9 .sui-wrap .sui-screen-reader-text,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds .wds-preset-separators input[type=radio],.sui-2-10-9 .sui-screen-reader-text{width:1px;min-width:1px;height:1px;min-height:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);position:absolute !important;margin:-1px;padding:0;border:0;word-wrap:normal !important}.sui-2-10-9 .sui-wrap .sui-fade-in{animation:fadeIn .3s ease-in forwards}@media screen and (prefers-reduced-motion: reduce){.sui-2-10-9 .sui-wrap .sui-fade-in{opacity:1;animation:none}}.sui-2-10-9 .sui-wrap .sui-fade-out{animation:fadeOut .3s ease-in forwards}@media screen and (prefers-reduced-motion: reduce){.sui-2-10-9 .sui-wrap .sui-fade-out{opacity:0;animation:none}}.sui-2-10-9 .sui-wrap .sui-bounce-in{animation:bounceInJiggle .8s ease-in forwards}@media screen and (prefers-reduced-motion: reduce){.sui-2-10-9 .sui-wrap .sui-bounce-in{opacity:1;animation:none}}.sui-2-10-9 .sui-wrap .sui-bounce-out{animation:bounceOutJiggle .6s ease-out forwards}@media screen and (prefers-reduced-motion: reduce){.sui-2-10-9 .sui-wrap .sui-bounce-out{opacity:0;animation:none}}.sui-2-10-9 .sui-wrap .sui-content-fade-in{animation:fadeScaleIn .5s ease-in forwards}@media screen and (prefers-reduced-motion: reduce){.sui-2-10-9 .sui-wrap .sui-content-fade-in{opacity:1;animation:none}}.sui-2-10-9 .sui-wrap .sui-content-fade-out{animation:fadeScaleOut .9s ease-in forwards}@media screen and (prefers-reduced-motion: reduce){.sui-2-10-9 .sui-wrap .sui-content-fade-out{opacity:0;animation:none}}@keyframes bounceInDown{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}0%{opacity:0;transform:translate3d(0, -3000px, 0)}60%{opacity:1;transform:translate3d(0, 25px, 0)}75%{transform:translate3d(0, -10px, 0)}90%{transform:translate3d(0, 5px, 0)}to{transform:none}}@keyframes bounceInJiggle{0%{transform:translateY(-200%) scale(1.5);opacity:0}30%{opacity:1}58%{transform:translateY(0) rotate(1deg) scale(1);opacity:1}72%{transform:translateY(-30px) rotate(-1deg)}80%{transform:translateY(0) rotate(0.5deg)}100%{transform:translateY(0) rotate(0deg)}}@keyframes bounceOutJiggle{0%{transform:translateY(0)}10%{transform:translateY(-10px) rotate(-0.5deg)}30%{transform:translateY(20px) rotate(8deg)}70%{opacity:1}90%{transform:translateY(300%) translateX(40px) rotate(35deg);opacity:0}100%{display:none}}@keyframes bounceOut{20%{transform:scale3d(0.9, 0.9, 0.9)}50%,55%{opacity:1;transform:scale3d(1.1, 1.1, 1.1)}to{opacity:0;transform:scale3d(0.3, 0.3, 0.3)}}@keyframes fadeIn{0%{opacity:0}25%{opacity:1}}@keyframes fadeScaleIn{0%{opacity:0}25%{opacity:0;transform:translate3d(0, 10px, 0) scale(0.9)}100%{transform:translate3d(0, 0, 0) scale(1)}}@keyframes fadeOut{0%{opacity:1}75%{opacity:1}100%{opacity:0}}@keyframes fadeScaleOut{0%{opacity:1;transform:translate3d(0, 0, 0) scale(1)}25%{opacity:0;transform:translate3d(0, 10px, 0) scale(0.9)}100%{opacity:0}}@keyframes fadeInLeft{from{opacity:0;transform:translate3d(-50px, 0, 0)}to{opacity:1;transform:none}}@keyframes fadeInRight{from{opacity:0;transform:translate3d(50px, 0, 0)}to{opacity:1;transform:none}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.sui-2-10-9 .sui-wrap{font-family:"Roboto",Arial,sans-serif;font-weight:400;font-size:15px;line-height:30px;color:#666;letter-spacing:-0.25px}.sui-2-10-9 .sui-wrap:not(.sui-modal){margin:30px 30px 0 10px}@media(max-width: 782px){.sui-2-10-9 .sui-wrap:not(.sui-modal){margin:20px 10px 0 0px}}.sui-2-10-9 .sui-wrap *{font-variant-ligatures:none;-webkit-font-variant-ligatures:none;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-smoothing:antialiased;-webkit-font-smoothing:antialiased;text-shadow:rgba(0,0,0,.01) 0 0 1px}.sui-2-10-9 .sui-wrap h1,.sui-2-10-9 .sui-wrap h2,.sui-2-10-9 .sui-wrap h3,.sui-2-10-9 .sui-wrap h4,.sui-2-10-9 .sui-wrap h5,.sui-2-10-9 .sui-wrap h6{display:block;margin:.5em auto;padding:0;line-height:30px;color:#333;font-weight:700;font-family:"Roboto",Arial,sans-serif}.sui-2-10-9 .sui-wrap h1{font-size:32px;line-height:40px;color:#333;margin:0}.sui-2-10-9 .sui-wrap h2{font-size:22px;line-height:35px}.sui-2-10-9 .sui-wrap h3{font-size:18px;line-height:40px}.sui-2-10-9 .sui-wrap h4{font-size:15px}.sui-2-10-9 .sui-wrap h5{font-size:15px}.sui-2-10-9 .sui-wrap h6{font-size:15px}.sui-2-10-9 .sui-wrap p{font-family:"Roboto",Arial,sans-serif;font-weight:400;font-size:15px;line-height:30px;color:#666;letter-spacing:-0.25px;text-rendering:optimizeLegibility}.sui-2-10-9 .sui-wrap p.sui-p-small{font-size:13px;line-height:22px;color:#888;margin:5px 0}.sui-2-10-9 .sui-wrap p:first-child{margin-top:0}.sui-2-10-9 .sui-wrap p:last-of-type:not(:last-child){margin-bottom:30px}@media(max-width: 782px){.sui-2-10-9 .sui-wrap p:last-of-type:not(:last-child){margin-bottom:20px}}.sui-2-10-9 .sui-wrap p:last-child{margin-bottom:0}.sui-2-10-9 .sui-wrap small{display:inline-block;font-size:13px;line-height:22px;color:#888;margin-bottom:5px}.sui-2-10-9 .sui-wrap a{text-decoration:none;color:#17a8e3;font-weight:500;outline-color:transparent;outline-style:none;box-shadow:none}.sui-2-10-9 .sui-wrap a:hover:not(.sui-button),.sui-2-10-9 .sui-wrap a:focus:not(.sui-button),.sui-2-10-9 .sui-wrap a:active:not(.sui-button){color:#1286b5}.sui-2-10-9 .sui-wrap a.disabled{pointer-events:none}.sui-2-10-9 .sui-wrap a.disabled:hover,.sui-2-10-9 .sui-wrap a.disabled:focus,.sui-2-10-9 .sui-wrap a.disabled:active{color:#888;cursor:default}.sui-2-10-9 .sui-wrap code,.sui-2-10-9 .sui-wrap pre{font-weight:500;font-size:13px;line-height:18px;color:#333;background-color:#f8f8f8;border:1px solid #e6e6e6;border-radius:4px;margin:0;padding:10px 15px;white-space:pre;overflow:auto;max-width:100%;vertical-align:middle;-moz-tab-size:4;-o-tab-size:4;tab-size:4}.sui-2-10-9 .sui-wrap code{display:inline-block;padding:2px 5px}.sui-2-10-9 .sui-wrap b,.sui-2-10-9 .sui-wrap strong{font-weight:500}.sui-2-10-9 .sui-wrap dfn{font-style:normal;font-weight:normal;border-bottom:1px dotted #888}.sui-2-10-9 .sui-wrap hr{border:none;display:block;height:1px;background:#e6e6e6;margin:30px 0}.wds-post-box-fields .wds-icon-monitor:before,.wds-post-box-fields .wds-icon-magnifying-glass-search:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox .wds_seo .wds-focus-keyword.wds-item-loading:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox .wds_seo .wds-focus-keyword.wds-focus-keyword-loaded:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox .wds_seo .wds-focus-keyword.wds-focus-keyword-invalid:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox [data-tabs] .wds-issues-success:not(.wds-item-loading):before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox [data-tabs] .wds-issues-success.wds-item-loading:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox [data-tabs] .wds-issues-invalid.wds-item-loading:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox [data-tabs] .wds-issues-warning.wds-item-loading:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox [data-tabs] .wds-issues-error.wds-item-loading:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-metabox [data-tabs] .wds-issues.wds-item-loading.wds-item-loading:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-upgrade ul li:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds .wds-optimum-length-indicator-field.resolving+.wds-optimum-length-indicator span:last-child:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds .wds-optimum-length-indicator-field.almost-over+.wds-optimum-length-indicator span:last-child:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds .wds-optimum-length-indicator-field.almost-under+.wds-optimum-length-indicator span:last-child:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds .wds-optimum-length-indicator-field.just-right+.wds-optimum-length-indicator span:last-child:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds .wds-optimum-length-indicator-field.over+.wds-optimum-length-indicator span:last-child:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds .wds-optimum-length-indicator-field.under+.wds-optimum-length-indicator span:last-child:before,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds .wds-report .wds-check-item.wds-check-item .report.status p:before,.sui-2-10-9 .sui-wrap select.sui-search+.select2 .select2-selection--multiple:before,.sui-2-10-9 .sui-wrap .sui-reviews__stars:before,.sui-2-10-9 .sui-wrap .sui-tree div[role=contentinfo] span[role=form] button:before,.sui-2-10-9 .sui-wrap .sui-tree div[role=contentinfo] span[role=form] span[role=button]:before,.sui-2-10-9 .sui-wrap .sui-tree span[role=contentinfo] span[role=form] button:before,.sui-2-10-9 .sui-wrap .sui-tree span[role=contentinfo] span[role=form] span[role=button]:before,.sui-2-10-9 .sui-wrap .sui-tree li[role=treeitem]>.sui-tree-node>span[aria-hidden]:before,.sui-2-10-9 .sui-wrap .sui-tree li[role=treeitem]>.sui-tree-node>label.sui-node-checkbox span[aria-hidden]:before,.sui-2-10-9 .sui-wrap .sui-tree li[role=treeitem]>.sui-tree-node>.sui-node-checkbox[role=checkbox]:before,.sui-2-10-9 .sui-wrap .sui-tree li[role=treeitem] span[role=button]:before,.sui-2-10-9 .sui-wrap .sui-tree li[role=treeitem] button[data-button] span[aria-hidden]:before,.sui-2-10-9 .sui-wrap .sui-tree span[role=contentinfo] span[role=button]:before,.sui-2-10-9 .sui-wrap .sui-tree span[role=contentinfo] button[data-button] span[aria-hidden]:before,.sui-2-10-9 .sui-wrap .sui-tree-fancy[data-tree=directory] ul.ui-fancytree li[role=treeitem]>span.fancytree-node>span.fancytree-icon:before,.sui-2-10-9 .sui-wrap .sui-tree-fancy ul.ui-fancytree li[role=treeitem]>span.fancytree-node>span.fancytree-checkbox:before,.sui-2-10-9 .sui-wrap .sui-tree-fancy ul.ui-fancytree li[role=treeitem]>span.fancytree-node>span.fancytree-expander:before,.sui-2-10-9 .sui-wrap .sui-recipient .sui-recipient-name:before,.sui-2-10-9 .daterangepicker .drp-calendar .table-condensed thead tr th.prev span:before,.sui-2-10-9 .daterangepicker .drp-calendar .table-condensed thead tr th.next span:before,.sui-2-10-9 #ui-datepicker-div.sui-calendar .ui-datepicker-header .ui-corner-all.ui-datepicker-next:before,.sui-2-10-9 #ui-datepicker-div.sui-calendar .ui-datepicker-header .ui-corner-all.ui-datepicker-prev:before,.sui-2-10-9 .sui-select.sui-select-dropdown-container--open .sui-select-dropdown .select2-results .select2-results__options .select2-results__option.select2-results__message:before,.sui-2-10-9 .sui-wrap select.sui-select+.sui-select.sui-select-theme--search .selection span[role=combobox].select2-selection--multiple:before,.sui-2-10-9 .sui-wrap .sui-pagination-active-filters .sui-active-filter .sui-active-filter-remove:before,.sui-2-10-9 .sui-wrap .sui-listing li:before,.sui-2-10-9 .sui-wrap .sui-upload .sui-upload-file:before,.sui-2-10-9 .sui-wrap .sui-upload .sui-upload-image .sui-image-preview:before,.sui-2-10-9 .sui-wrap .sui-checkbox input+span:before,.sui-2-10-9 .sui-wrap .sui-box-selector input:checked+span:before,.sui-2-10-9 .sui-wrap .sui-box-body .sui-upsell-row .sui-upsell-notice p:first-of-type:before,.sui-2-10-9 [class*=sui-icon-]:before,.sui-2-10-9 [class*=sui-icon-]:after{font-family:"wpmudev-plugin-icons" !important;speak:none;font-size:1em;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;text-rendering:auto;display:inline-block;color:#888;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@font-face{font-family:"wpmudev-plugin-icons";src:url("../shared-ui/fonts/wpmudev-plugin-icons.eot?2.10.9");src:url("../shared-ui/fonts/wpmudev-plugin-icons.eot?2.10.9") format("embedded-opentype"),url("../shared-ui/fonts/wpmudev-plugin-icons.ttf?2.10.9") format("truetype"),url("../shared-ui/fonts/wpmudev-plugin-icons.woff?2.10.9") format("woff"),url("../shared-ui/fonts/wpmudev-plugin-icons.woff2?2.10.9") format("woff2"),url("../shared-ui/fonts/wpmudev-plugin-icons.svg?2.10.9") format("svg");font-weight:normal;font-style:normal}.sui-2-10-9 .sui-loading:before{animation:spin 1.3s linear infinite}.sui-2-10-9 [class*=sui-icon-]{display:inline-block}.sui-2-10-9 [class*=sui-icon-].sui-xl:before{font-size:30px}.sui-2-10-9 [class*=sui-icon-].sui-lg:before{font-size:20px}.sui-2-10-9 [class*=sui-icon-].sui-md:before{font-size:16px}.sui-2-10-9 [class*=sui-icon-].sui-sm:before{font-size:12px}.sui-2-10-9 [class*=sui-icon-].sui-success:before{color:inherit}.sui-2-10-9 [class*=sui-icon-].sui-error:before{color:inherit}.sui-2-10-9 [class*=sui-icon-].sui-warning:before{color:inherit}.sui-2-10-9 [class*=sui-icon-].sui-info:before{color:inherit}.sui-2-10-9 [class*=sui-icon-].sui-fw{width:1.8em;text-align:center;min-height:1em}.sui-2-10-9 .sui-icon-check:before{content:"("}.sui-2-10-9 .sui-icon-close:before{content:")"}.sui-2-10-9 .sui-icon-check-tick:before{content:"_"}.sui-2-10-9 .sui-icon-cross-close:before{content:"+"}.sui-2-10-9 .sui-icon-plus-circle:before{content:"@"}.sui-2-10-9 .sui-icon-warning-alert:before{content:"!"}.sui-2-10-9 .sui-icon-info:before{content:"I"}.sui-2-10-9 .sui-icon-question:before{content:"?"}.sui-2-10-9 .sui-icon-trash:before{content:"Q"}.sui-2-10-9 .sui-icon-pencil:before{content:"/"}.sui-2-10-9 .sui-icon-unlock:before{content:"0"}.sui-2-10-9 .sui-icon-lock:before{content:"9"}.sui-2-10-9 .sui-icon-key:before{content:"◊"}.sui-2-10-9 .sui-icon-plus:before{content:"="}.sui-2-10-9 .sui-icon-magnifying-glass-search:before{content:"º"}.sui-2-10-9 .sui-icon-more:before{content:"…"}.sui-2-10-9 .sui-icon-wrench-tool:before{content:"⁄"}.sui-2-10-9 .sui-icon-widget-settings-config:before{content:"x"}.sui-2-10-9 .sui-icon-settings-slider-control:before{content:"œ"}.sui-2-10-9 .sui-icon-loader:before{content:"N"}.sui-2-10-9 .sui-icon-calendar:before{content:"∏"}.sui-2-10-9 .sui-icon-clock:before{content:","}.sui-2-10-9 .sui-icon-speed-optimize:before{content:"ø"}.sui-2-10-9 .sui-icon-stopwatch:before{content:"V"}.sui-2-10-9 .sui-icon-filter:before{content:"z"}.sui-2-10-9 .sui-icon-bookmark:before{content:"√"}.sui-2-10-9 .sui-icon-chevron-up:before{content:"˝"}.sui-2-10-9 .sui-icon-chevron-right:before{content:"˜"}.sui-2-10-9 .sui-icon-chevron-down:before{content:"ı"}.sui-2-10-9 .sui-icon-chevron-left:before{content:"Ó"}.sui-2-10-9 .sui-icon-arrow-up:before{content:"Ô"}.sui-2-10-9 .sui-icon-arrow-right:before{content:"¯"}.sui-2-10-9 .sui-icon-arrow-down:before{content:"Â"}.sui-2-10-9 .sui-icon-arrow-left:before{content:""}.sui-2-10-9 .sui-icon-arrow-skip-back:before{content:"{"}.sui-2-10-9 .sui-icon-arrow-skip-forward:before{content:"}"}.sui-2-10-9 .sui-icon-arrow-skip-start:before{content:":"}.sui-2-10-9 .sui-icon-arrow-skip-end:before{content:'"'}.sui-2-10-9 .sui-icon-play:before{content:"´"}.sui-2-10-9 .sui-icon-pause:before{content:"†"}.sui-2-10-9 .sui-icon-arrows-out:before{content:"˚"}.sui-2-10-9 .sui-icon-arrows-in:before{content:"≤"}.sui-2-10-9 .sui-icon-arrows-expand:before{content:"¬"}.sui-2-10-9 .sui-icon-arrows-compress:before{content:"≥"}.sui-2-10-9 .sui-icon-refresh2:before{content:"Á"}.sui-2-10-9 .sui-icon-zip:before{content:"a"}.sui-2-10-9 .sui-icon-combine:before{content:"o"}.sui-2-10-9 .sui-icon-defer:before{content:"p"}.sui-2-10-9 .sui-icon-inlinecss:before{content:"c"}.sui-2-10-9 .sui-icon-movefooter:before{content:"u"}.sui-2-10-9 .sui-icon-popup:before{content:"1"}.sui-2-10-9 .sui-icon-slide-in:before{content:"2"}.sui-2-10-9 .sui-icon-embed:before{content:"3"}.sui-2-10-9 .sui-icon-list:before{content:"`"}.sui-2-10-9 .sui-icon-layout-grid:before{content:"∞"}.sui-2-10-9 .sui-icon-layout:before{content:"©"}.sui-2-10-9 .sui-icon-thumbnails:before{content:"G"}.sui-2-10-9 .sui-icon-drag:before{content:"„"}.sui-2-10-9 .sui-icon-align-left:before{content:"%"}.sui-2-10-9 .sui-icon-align-center:before{content:"^"}.sui-2-10-9 .sui-icon-align-right:before{content:"&"}.sui-2-10-9 .sui-icon-align-justify:before{content:"#"}.sui-2-10-9 .sui-icon-indent-more:before{content:"’"}.sui-2-10-9 .sui-icon-indent-less:before{content:"”"}.sui-2-10-9 .sui-icon-blog:before{content:"Y"}.sui-2-10-9 .sui-icon-list-number:before{content:"7"}.sui-2-10-9 .sui-icon-list-bullet:before{content:"8"}.sui-2-10-9 .sui-icon-bold:before{content:"B"}.sui-2-10-9 .sui-icon-quote-2:before{content:"'"}.sui-2-10-9 .sui-icon-style-type:before{content:"<"}.sui-2-10-9 .sui-icon-wand-magic:before{content:"Z"}.sui-2-10-9 .sui-icon-link:before{content:"5"}.sui-2-10-9 .sui-icon-unlink:before{content:"6"}.sui-2-10-9 .sui-icon-paperclip:before{content:"A"}.sui-2-10-9 .sui-icon-code:before{content:";"}.sui-2-10-9 .sui-icon-color-pick-eyedropper:before{content:"¥"}.sui-2-10-9 .sui-icon-crop:before{content:"C"}.sui-2-10-9 .sui-icon-paint-bucket:before{content:"∫"}.sui-2-10-9 .sui-icon-camera:before{content:"Ø"}.sui-2-10-9 .sui-icon-photo-picture:before{content:"D"}.sui-2-10-9 .sui-icon-animation-video:before{content:"F"}.sui-2-10-9 .sui-icon-home:before{content:"J"}.sui-2-10-9 .sui-icon-mail:before{content:"m"}.sui-2-10-9 .sui-icon-send:before{content:"“"}.sui-2-10-9 .sui-icon-phone:before{content:">"}.sui-2-10-9 .sui-icon-pin:before{content:"Œ"}.sui-2-10-9 .sui-icon-post-pin:before{content:"ˇ"}.sui-2-10-9 .sui-icon-calculator:before{content:"¨"}.sui-2-10-9 .sui-icon-element-checkbox:before{content:"Å"}.sui-2-10-9 .sui-icon-element-radio:before{content:"Í"}.sui-2-10-9 .sui-icon-element-select:before{content:"Ï"}.sui-2-10-9 .sui-icon-element-number:before{content:"Ú"}.sui-2-10-9 .sui-icon-recaptcha:before{content:"–"}.sui-2-10-9 .sui-icon-folder:before{content:"˘"}.sui-2-10-9 .sui-icon-folder-open:before{content:"»"}.sui-2-10-9 .sui-icon-archive:before{content:"b"}.sui-2-10-9 .sui-icon-book:before{content:"∆"}.sui-2-10-9 .sui-icon-page-multiple:before{content:"ç"}.sui-2-10-9 .sui-icon-layers:before{content:"æ"}.sui-2-10-9 .sui-icon-copy:before{content:"4"}.sui-2-10-9 .sui-icon-graph-bar:before{content:"Ç"}.sui-2-10-9 .sui-icon-graph-bar-2:before{content:"˛"}.sui-2-10-9 .sui-icon-graph-line:before{content:"¡"}.sui-2-10-9 .sui-icon-tracking-disabled:before{content:"€"}.sui-2-10-9 .sui-icon-page:before{content:"Ò"}.sui-2-10-9 .sui-icon-clipboard-notes:before{content:"¿"}.sui-2-10-9 .sui-icon-page-pdf:before{content:"Æ"}.sui-2-10-9 .sui-icon-heart:before{content:"K"}.sui-2-10-9 .sui-icon-star:before{content:"S"}.sui-2-10-9 .sui-icon-plugin-2:before{content:"O"}.sui-2-10-9 .sui-icon-brush:before{content:"~"}.sui-2-10-9 .sui-icon-plug-connected:before{content:"R"}.sui-2-10-9 .sui-icon-plug-disconnected:before{content:"."}.sui-2-10-9 .sui-icon-power-on-off:before{content:"["}.sui-2-10-9 .sui-icon-target:before{content:"≠"}.sui-2-10-9 .sui-icon-upload-cloud:before{content:"¢"}.sui-2-10-9 .sui-icon-download-cloud:before{content:"£"}.sui-2-10-9 .sui-icon-cloud:before{content:"™"}.sui-2-10-9 .sui-icon-cloud-migration:before{content:"l"}.sui-2-10-9 .sui-icon-unpublish:before{content:"ˆ"}.sui-2-10-9 .sui-icon-download:before{content:"X"}.sui-2-10-9 .sui-icon-save:before{content:"ß"}.sui-2-10-9 .sui-icon-lightbulb:before{content:"L"}.sui-2-10-9 .sui-icon-sitemap:before{content:"¸"}.sui-2-10-9 .sui-icon-storage-server-data:before{content:"Î"}.sui-2-10-9 .sui-icon-user-reputation-points:before{content:"E"}.sui-2-10-9 .sui-icon-tablet-portrait:before{content:"]"}.sui-2-10-9 .sui-icon-laptop:before{content:"«"}.sui-2-10-9 .sui-icon-monitor:before{content:"$"}.sui-2-10-9 .sui-icon-eye:before{content:"e"}.sui-2-10-9 .sui-icon-eye-hide:before{content:"q"}.sui-2-10-9 .sui-icon-update:before{content:"®"}.sui-2-10-9 .sui-icon-refresh:before{content:"H"}.sui-2-10-9 .sui-icon-undo:before{content:"‰"}.sui-2-10-9 .sui-icon-web-globe-world:before{content:"W"}.sui-2-10-9 .sui-icon-flag:before{content:"|"}.sui-2-10-9 .sui-icon-academy:before{content:"π"}.sui-2-10-9 .sui-icon-profile-male:before{content:"µ"}.sui-2-10-9 .sui-icon-community-people:before{content:"‘"}.sui-2-10-9 .sui-icon-help-support:before{content:"M"}.sui-2-10-9 .sui-icon-gdpr:before{content:"∑"}.sui-2-10-9 .sui-icon-like:before{content:"j"}.sui-2-10-9 .sui-icon-dislike:before{content:"k"}.sui-2-10-9 .sui-icon-finger-point:before{content:"≈"}.sui-2-10-9 .sui-icon-open-new-window:before{content:"n"}.sui-2-10-9 .sui-icon-reply:before{content:"r"}.sui-2-10-9 .sui-icon-share:before{content:"s"}.sui-2-10-9 .sui-icon-wordpress:before{content:"w"}.sui-2-10-9 .sui-icon-social-facebook:before{content:"f"}.sui-2-10-9 .sui-icon-social-twitter:before{content:"t"}.sui-2-10-9 .sui-icon-social-linkedin:before{content:"i"}.sui-2-10-9 .sui-icon-social-dropbox:before{content:"d"}.sui-2-10-9 .sui-icon-social-drive:before{content:"v"}.sui-2-10-9 .sui-icon-social-google-plus:before{content:"g"}.sui-2-10-9 .sui-icon-social-youtube:before{content:"y"}.sui-2-10-9 .sui-icon-instagram:before{content:"-"}.sui-2-10-9 .sui-icon-cloudflare:before{content:"Ð"}.sui-2-10-9 .sui-icon-social-github:before{content:"h"}.sui-2-10-9 .sui-icon-wpmudev-logo:before{content:"‹"}.sui-2-10-9 .sui-icon-defender:before{content:"·"}.sui-2-10-9 .sui-icon-smush:before{content:"‡"}.sui-2-10-9 .sui-icon-upfront:before{content:"‚"}.sui-2-10-9 .sui-icon-hummingbird:before{content:"°"}.sui-2-10-9 .sui-icon-uptime:before{content:"±"}.sui-2-10-9 .sui-icon-smart-crawl:before{content:"∂"}.sui-2-10-9 .sui-icon-forminator:before{content:"P"}.sui-2-10-9 .sui-icon-shipper-anchor:before{content:"T"}.sui-2-10-9 .sui-icon-snapshot:before{content:"fi"}.sui-2-10-9 .sui-icon-hustle:before{content:"—"}.sui-2-10-9 .sui-icon-performance:before{content:"U"}.sui-2-10-9 .sui-icon-hub:before{content:"fl"}.sui-2-10-9 .sui-icon-automate:before{content:"˙"}.sui-2-10-9 .sui-icon-align-y-center:before{content:"*"}.sui-2-10-9 .sui-icon-align-y-top:before{content:"§"}.sui-2-10-9 .sui-icon-align-y-bottom:before{content:"¶"}.sui-2-10-9 .sui-icon-align-x-center:before{content:"ƒ"}.sui-2-10-9 .sui-icon-align-x-right:before{content:"•"}.sui-2-10-9 .sui-icon-align-x-left:before{content:"å"}.sui-2-10-9 .sui-icon-logout:before{content:"›"}.sui-2-10-9 .sui-icon-branda:before{content:"ª"}.sui-2-10-9 .sui-wrap .sui-button,.sui-2-10-9 .sui-wrap .sui-button-icon,.sui-2-10-9 .sui-wrap a.sui-button,.sui-2-10-9 .sui-wrap a.sui-button-icon,.sui-2-10-9 .sui-wrap button.sui-button,.sui-2-10-9 .sui-wrap button.sui-button-icon{cursor:pointer;display:inline-block;position:relative;margin:0;border-width:2px;border-style:solid;border-color:transparent;border-radius:4px;text-decoration:none;text-align:center;transition:all .3s ease}.sui-2-10-9 .sui-wrap .sui-button .sui-loading,.sui-2-10-9 .sui-wrap .sui-button-icon .sui-loading,.sui-2-10-9 .sui-wrap a.sui-button .sui-loading,.sui-2-10-9 .sui-wrap a.sui-button-icon .sui-loading,.sui-2-10-9 .sui-wrap button.sui-button .sui-loading,.sui-2-10-9 .sui-wrap button.sui-button-icon .sui-loading{width:16px;height:16px;display:none;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;position:absolute;margin:0}.sui-2-10-9 .sui-wrap .sui-button .sui-loading:before,.sui-2-10-9 .sui-wrap .sui-button-icon .sui-loading:before,.sui-2-10-9 .sui-wrap a.sui-button .sui-loading:before,.sui-2-10-9 .sui-wrap a.sui-button-icon .sui-loading:before,.sui-2-10-9 .sui-wrap button.sui-button .sui-loading:before,.sui-2-10-9 .sui-wrap button.sui-button-icon .sui-loading:before{display:block}.sui-2-10-9 .sui-wrap .sui-button .sui-loading-text,.sui-2-10-9 .sui-wrap .sui-button .sui-button-text-default,.sui-2-10-9 .sui-wrap .sui-button-icon .sui-loading-text,.sui-2-10-9 .sui-wrap .sui-button-icon .sui-button-text-default,.sui-2-10-9 .sui-wrap a.sui-button .sui-loading-text,.sui-2-10-9 .sui-wrap a.sui-button .sui-button-text-default,.sui-2-10-9 .sui-wrap a.sui-button-icon .sui-loading-text,.sui-2-10-9 .sui-wrap a.sui-button-icon .sui-button-text-default,.sui-2-10-9 .sui-wrap button.sui-button .sui-loading-text,.sui-2-10-9 .sui-wrap button.sui-button .sui-button-text-default,.sui-2-10-9 .sui-wrap button.sui-button-icon .sui-loading-text,.sui-2-10-9 .sui-wrap button.sui-button-icon .sui-button-text-default{display:block;pointer-events:none}@media(max-width: 782px){.sui-2-10-9 .sui-wrap .sui-button .sui-loading-text .sui-loading-text,.sui-2-10-9 .sui-wrap .sui-button .sui-button-text-default .sui-loading-text,.sui-2-10-9 .sui-wrap .sui-button-icon .sui-loading-text .sui-loading-text,.sui-2-10-9 .sui-wrap .sui-button-icon .sui-button-text-default .sui-loading-text,.sui-2-10-9 .sui-wrap a.sui-button .sui-loading-text .sui-loading-text,.sui-2-10-9 .sui-wrap a.sui-button .sui-button-text-default .sui-loading-text,.sui-2-10-9 .sui-wrap a.sui-button-icon .sui-loading-text .sui-loading-text,.sui-2-10-9 .sui-wrap a.sui-button-icon .sui-button-text-default .sui-loading-text,.sui-2-10-9 .sui-wrap button.sui-button .sui-loading-text .sui-loading-text,.sui-2-10-9 .sui-wrap button.sui-button .sui-button-text-default .sui-loading-text,.sui-2-10-9 .sui-wrap button.sui-button-icon .sui-loading-text .sui-loading-text,.sui-2-10-9 .sui-wrap button.sui-button-icon .sui-button-text-default .sui-loading-text{overflow:hidden;text-overflow:ellipsis}}.sui-2-10-9 .sui-wrap .sui-button .sui-button-text-onload,.sui-2-10-9 .sui-wrap .sui-button-icon .sui-button-text-onload,.sui-2-10-9 .sui-wrap a.sui-button .sui-button-text-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon .sui-button-text-onload,.sui-2-10-9 .sui-wrap button.sui-button .sui-button-text-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon .sui-button-text-onload{display:none}.sui-2-10-9 .sui-wrap .sui-button [class*=sui-icon-],.sui-2-10-9 .sui-wrap .sui-button-icon [class*=sui-icon-],.sui-2-10-9 .sui-wrap a.sui-button [class*=sui-icon-],.sui-2-10-9 .sui-wrap a.sui-button-icon [class*=sui-icon-],.sui-2-10-9 .sui-wrap button.sui-button [class*=sui-icon-],.sui-2-10-9 .sui-wrap button.sui-button-icon [class*=sui-icon-]{font-size:12px}.sui-2-10-9 .sui-wrap .sui-button [class*=sui-icon-]:before,.sui-2-10-9 .sui-wrap .sui-button-icon [class*=sui-icon-]:before,.sui-2-10-9 .sui-wrap a.sui-button [class*=sui-icon-]:before,.sui-2-10-9 .sui-wrap a.sui-button-icon [class*=sui-icon-]:before,.sui-2-10-9 .sui-wrap button.sui-button [class*=sui-icon-]:before,.sui-2-10-9 .sui-wrap button.sui-button-icon [class*=sui-icon-]:before{display:block;color:inherit}.sui-2-10-9 .sui-wrap .sui-button:hover,.sui-2-10-9 .sui-wrap .sui-button-icon:hover,.sui-2-10-9 .sui-wrap a.sui-button:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon:hover,.sui-2-10-9 .sui-wrap button.sui-button:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon:hover{outline:none;box-shadow:none}.sui-2-10-9 .sui-wrap .sui-button:focus,.sui-2-10-9 .sui-wrap .sui-button-icon:focus,.sui-2-10-9 .sui-wrap a.sui-button:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon:focus,.sui-2-10-9 .sui-wrap button.sui-button:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon:focus{outline:none}.sui-2-10-9 .sui-wrap .sui-button.disabled,.sui-2-10-9 .sui-wrap .sui-button:disabled,.sui-2-10-9 .sui-wrap .sui-button[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload-text,.sui-2-10-9 .sui-wrap .sui-button-icon.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.disabled,.sui-2-10-9 .sui-wrap a.sui-button:disabled,.sui-2-10-9 .sui-wrap a.sui-button[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.disabled,.sui-2-10-9 .sui-wrap button.sui-button:disabled,.sui-2-10-9 .sui-wrap button.sui-button[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload-text{cursor:default;pointer-events:none}.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.wds-run-test-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload{pointer-events:none;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload .sui-loading,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.wds-run-test-onload .sui-loading,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.wds-run-test-onload .sui-loading,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload .sui-loading,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.wds-run-test-onload .sui-loading,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.wds-run-test-onload .sui-loading,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload .sui-loading,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload .sui-loading,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload .sui-loading,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload .sui-loading{display:-ms-flexbox;display:flex}.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload .sui-loading-text,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.wds-run-test-onload .sui-loading-text,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.wds-run-test-onload .sui-loading-text,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload .sui-loading-text,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.wds-run-test-onload .sui-loading-text,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.wds-run-test-onload .sui-loading-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload .sui-loading-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload .sui-loading-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload .sui-loading-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload .sui-loading-text{opacity:0}.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload-text,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload-text{pointer-events:none}.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload-text .sui-button-text-default,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload-text .sui-button-text-default,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload-text .sui-button-text-default,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload-text .sui-button-text-default,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload-text .sui-button-text-default,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload-text .sui-button-text-default{display:none}.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload-text .sui-button-text-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload-text .sui-button-text-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload-text .sui-button-text-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload-text .sui-button-text-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload-text .sui-button-text-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload-text .sui-button-text-onload{display:block}.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload-text .sui-button-text-onload .sui-loading,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload-text .sui-button-text-onload .sui-loading,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload-text .sui-button-text-onload .sui-loading,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload-text .sui-button-text-onload .sui-loading,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload-text .sui-button-text-onload .sui-loading,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload-text .sui-button-text-onload .sui-loading{width:auto;height:auto;display:inline-block;position:relative;vertical-align:unset;margin-right:4px}.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload-text .sui-button-text-onload .sui-loading:before,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload-text .sui-button-text-onload .sui-loading:before,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload-text .sui-button-text-onload .sui-loading:before,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload-text .sui-button-text-onload .sui-loading:before,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload-text .sui-button-text-onload .sui-loading:before,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload-text .sui-button-text-onload .sui-loading:before{display:inline-block}.sui-2-10-9 .sui-wrap .sui-button:not(:last-child),.sui-2-10-9 .sui-wrap .sui-button-icon:not(:last-child),.sui-2-10-9 .sui-wrap a.sui-button:not(:last-child),.sui-2-10-9 .sui-wrap a.sui-button-icon:not(:last-child),.sui-2-10-9 .sui-wrap button.sui-button:not(:last-child),.sui-2-10-9 .sui-wrap button.sui-button-icon:not(:last-child){margin-right:10px}.sui-2-10-9 .sui-wrap .sui-button,.sui-2-10-9 .sui-wrap a.sui-button,.sui-2-10-9 .sui-wrap button.sui-button{width:auto;min-width:80px;padding:5px 14px;background-color:#888;color:#fff;font:500 12px/16px "Roboto",Arial,sans-serif;letter-spacing:-0.25px;text-transform:uppercase}.sui-2-10-9 .sui-wrap .sui-button [class*=sui-icon-],.sui-2-10-9 .sui-wrap a.sui-button [class*=sui-icon-],.sui-2-10-9 .sui-wrap button.sui-button [class*=sui-icon-]{vertical-align:middle}.sui-2-10-9 .sui-wrap .sui-button [class*=sui-icon-]:not(.sui-loading),.sui-2-10-9 .sui-wrap a.sui-button [class*=sui-icon-]:not(.sui-loading),.sui-2-10-9 .sui-wrap button.sui-button [class*=sui-icon-]:not(.sui-loading){width:22px;position:relative;top:-1px;margin-left:-7px}.sui-2-10-9 .sui-wrap .sui-button:hover,.sui-2-10-9 .sui-wrap .sui-button:focus,.sui-2-10-9 .sui-wrap a.sui-button:hover,.sui-2-10-9 .sui-wrap a.sui-button:focus,.sui-2-10-9 .sui-wrap button.sui-button:hover,.sui-2-10-9 .sui-wrap button.sui-button:focus{background-color:#6f6f6f}.sui-2-10-9 .sui-wrap .sui-button:focus,.sui-2-10-9 .sui-wrap a.sui-button:focus,.sui-2-10-9 .sui-wrap button.sui-button:focus{outline:none;box-shadow:0 0 0 2px #ddd}.sui-2-10-9 .sui-wrap .sui-button.disabled,.sui-2-10-9 .sui-wrap .sui-button:disabled,.sui-2-10-9 .sui-wrap .sui-button[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.disabled,.sui-2-10-9 .sui-wrap a.sui-button:disabled,.sui-2-10-9 .sui-wrap a.sui-button[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.disabled,.sui-2-10-9 .sui-wrap button.sui-button:disabled,.sui-2-10-9 .sui-wrap button.sui-button[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-icon-right [class*=sui-icon-]:not(.sui-loading),.sui-2-10-9 .sui-wrap a.sui-button.sui-button-icon-right [class*=sui-icon-]:not(.sui-loading),.sui-2-10-9 .sui-wrap button.sui-button.sui-button-icon-right [class*=sui-icon-]:not(.sui-loading){margin-right:-7px;margin-left:0}.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue{background-color:#17a8e3;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue:focus{background-color:#1286b5}.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue:focus{outline:none;box-shadow:0 0 0 2px #e1f6ff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-blue.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-blue.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-blue.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-green,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green{background-color:#1abc9c;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-green:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green:focus{background-color:#148f77}.sui-2-10-9 .sui-wrap .sui-button.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green:focus{outline:none;box-shadow:0 0 0 2px #d1f1ea}.sui-2-10-9 .sui-wrap .sui-button.sui-button-green.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-green:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-green[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-green.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-green.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-green.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-red,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red{background-color:#ff6d6d;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-red:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red:focus{background-color:#ff3a3a}.sui-2-10-9 .sui-wrap .sui-button.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red:focus{outline:none;box-shadow:0 0 0 2px #ffe5e9}.sui-2-10-9 .sui-wrap .sui-button.sui-button-red.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-red:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-red[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-red.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-red.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-red.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange{background-color:#ff7e41;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange:focus{background-color:#ff5b0e}.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange:focus{outline:none;box-shadow:0 0 0 2px #ffe5d9}.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-orange.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-orange.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-orange.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow{background-color:#fecf2f;color:#333}.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow:focus{background-color:#f9c101}.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow:focus{outline:none;box-shadow:0 0 0 2px #fff5d5}.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-yellow.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-yellow.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-yellow.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-yellow.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-yellow.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple{background-color:#8d00b1;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple:focus{background-color:#64007e}.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple:focus{outline:none;box-shadow:0 0 0 2px #f9e1ff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-purple.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-purple.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-purple.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-purple.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-purple.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-white,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white{background-color:#fff;color:#000}.sui-2-10-9 .sui-wrap .sui-button.sui-button-white:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-white:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white:focus{background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button.sui-button-white:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white:focus{outline:none;box-shadow:0 0 0 2px #fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-white.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-white:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-white[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-white.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-white.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-white.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-white.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-white.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-upsell,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-upsell,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-upsell{width:auto;height:26px;padding:4px 14px;border-color:#d1f1ea;border-radius:14px;background-color:transparent;color:#1abc9c;line-height:14px;text-transform:none}.sui-2-10-9 .sui-wrap .sui-button.sui-button-upsell:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-upsell:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-upsell:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-upsell:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-upsell:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-upsell:focus{opacity:1;border-color:#1abc9c;background-color:#1abc9c;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-upsell:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-upsell:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-upsell:focus{outline:none;box-shadow:0 0 0 2px #f9e1ff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-dashed,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-dashed,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-dashed{width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-width:1px;border-style:dashed;border-color:#aaa;background-color:transparent;color:#888;line-height:18px}.sui-2-10-9 .sui-wrap .sui-button.sui-button-dashed.sui-lg,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-dashed.sui-lg,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-dashed.sui-lg{height:70px}@media(max-width: 782px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-dashed.sui-lg,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-dashed.sui-lg,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-dashed.sui-lg{height:50px}}@media(max-width: 782px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-dashed,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-dashed,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-dashed{height:50px}}@media(min-width: 783px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-dashed,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-dashed,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-dashed{height:60px}}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost{border-color:#ddd;background-color:transparent;color:#888}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost:focus{border-color:#888;background-color:#888;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost:focus{outline:none;box-shadow:0 0 0 2px #ddd}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-ghost.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-ghost.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-onload-text{border-color:#e6e6e6;background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-blue,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-blue,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-blue{border-color:#e1f6ff;color:#17a8e3}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-blue:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-blue:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-blue:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-blue:focus{border-color:#17a8e3;background-color:#17a8e3;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-blue:focus{outline:none;box-shadow:0 0 0 2px #e1f6ff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-ghost.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-ghost.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-blue.sui-button-onload{border-color:#e6e6e6;background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-green,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-green,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-green{border-color:#d1f1ea;color:#1abc9c}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-green:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-green:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-green:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-green:focus{border-color:#1abc9c;background-color:#1abc9c;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-green:focus{outline:none;box-shadow:0 0 0 2px #d1f1ea}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-green.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-green:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-green[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-ghost.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-ghost.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-green.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-green:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-green[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-green.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-green:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-green[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-green.sui-button-onload{border-color:#e6e6e6;background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-red,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-red,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-red{border-color:#ffe5e9;color:#ff6d6d}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-red:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-red:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-red:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-red:focus{border-color:#ff6d6d;background-color:#ff6d6d;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-red:focus{outline:none;box-shadow:0 0 0 2px #ffe5e9}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-red.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-red:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-red[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-ghost.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-ghost.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-red.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-red:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-red[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-red.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-red:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-red[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-red.sui-button-onload{border-color:#e6e6e6;background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-orange,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-orange,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-orange{border-color:#ffe5d9;color:#ff7e41}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-orange:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-orange:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-orange:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-orange:focus{border-color:#ff7e41;background-color:#ff7e41;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-orange:focus{outline:none;box-shadow:0 0 0 2px #ffe5d9}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-ghost.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-ghost.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-orange.sui-button-onload{border-color:#e6e6e6;background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-yellow,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-yellow,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-yellow{border-color:#fff5d5;color:#fecf2f}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-yellow:focus{border-color:#fecf2f;background-color:#fecf2f;color:#333}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-yellow:focus{outline:none;box-shadow:0 0 0 2px #fff5d5}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-ghost.sui-button-yellow.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-ghost.sui-button-yellow.wds-run-test-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-yellow.sui-button-onload{border-color:#e6e6e6;background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-purple,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-purple,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-purple{border-color:#f9e1ff;color:#8d00b1}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-purple:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-purple:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-purple:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-purple:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-purple:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-purple:focus{border-color:#8d00b1;background-color:#8d00b1;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-purple:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-purple:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-purple:focus{outline:none;box-shadow:0 0 0 2px #f9e1ff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-ghost.sui-button-purple.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-ghost.sui-button-purple.wds-run-test-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-purple.sui-button-onload{border-color:#e6e6e6;background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-white,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-white,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-white{border-color:#fff;color:#fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-white:hover,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-white:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-white:hover,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-white:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-white:hover,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-white:focus{border-color:#fff;background-color:#fff;color:#000}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-white:focus,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-white:focus,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-white:focus{outline:none;box-shadow:0 0 0 2px #fff}.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-white.disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-white:disabled,.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-white[disabled],.sui-2-10-9 .sui-wrap .sui-button.sui-button-ghost.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button.sui-button-ghost.sui-button-white.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button.sui-button-ghost.sui-button-white.wds-run-test-onload,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-white.disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-white:disabled,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-white[disabled],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-ghost.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-white.disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-white:disabled,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-white[disabled],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-ghost.sui-button-white.sui-button-onload{border-color:#e6e6e6;background-color:#e6e6e6;color:#aaa}@media(max-width: 782px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-compound .sui-compound-desktop,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-compound .sui-compound-desktop,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-compound .sui-compound-desktop{display:none}}@media(min-width: 783px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-compound .sui-compound-desktop,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-compound .sui-compound-desktop,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-compound .sui-compound-desktop{display:block}}@media(max-width: 782px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-compound .sui-compound-mobile [class*=sui-icon-],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-compound .sui-compound-mobile [class*=sui-icon-],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-compound .sui-compound-mobile [class*=sui-icon-]{margin-right:0;margin-left:0}}@media(max-width: 782px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-compound .sui-compound-mobile,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-compound .sui-compound-mobile,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-compound .sui-compound-mobile{display:block}}@media(min-width: 783px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-compound .sui-compound-mobile,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-compound .sui-compound-mobile,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-compound .sui-compound-mobile{display:none}}@media(max-width: 782px){.sui-2-10-9 .sui-wrap .sui-button.sui-button-compound,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-compound,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-compound{min-width:44px;padding-right:5px;padding-left:5px}}.sui-2-10-9 .sui-wrap .sui-button.sui-button-lg,.sui-2-10-9 .sui-wrap a.sui-button.sui-button-lg,.sui-2-10-9 .sui-wrap button.sui-button.sui-button-lg{padding:8px 20px;font-size:15px;line-height:20px}.sui-2-10-9 .sui-wrap .sui-button.sui-button-lg [class*=sui-icon-],.sui-2-10-9 .sui-wrap a.sui-button.sui-button-lg [class*=sui-icon-],.sui-2-10-9 .sui-wrap button.sui-button.sui-button-lg [class*=sui-icon-]{font-size:16px}.sui-2-10-9 .sui-wrap .sui-button-icon,.sui-2-10-9 .sui-wrap a.sui-button-icon,.sui-2-10-9 .sui-wrap button.sui-button-icon{width:30px;height:30px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:0 4px;border-width:1px;background-color:transparent;color:#888;text-align:center;white-space:nowrap}.sui-2-10-9 .sui-wrap .sui-button-icon [class*=sui-icon-]:not(.sui-loading),.sui-2-10-9 .sui-wrap a.sui-button-icon [class*=sui-icon-]:not(.sui-loading),.sui-2-10-9 .sui-wrap button.sui-button-icon [class*=sui-icon-]:not(.sui-loading){display:block}.sui-2-10-9 .sui-wrap .sui-button-icon:hover,.sui-2-10-9 .sui-wrap .sui-button-icon:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-active{background-color:#f2f2f2;color:#333}.sui-2-10-9 .sui-wrap .sui-button-icon:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon:focus{outline:none;box-shadow:0 0 0 2px #ddd}.sui-2-10-9 .sui-wrap .sui-button-icon.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-onload-text{color:#aaa;background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue{color:#17a8e3}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue.sui-active{background-color:#e1f6ff;color:#17a8e3}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue:focus{outline:none;box-shadow:0 0 0 2px #e1f6ff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-blue.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-blue.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-blue.sui-button-onload-text{color:#aaa;background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green{color:#1abc9c}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green.sui-active{background-color:#d1f1ea;color:#1abc9c}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green:focus{outline:none;box-shadow:0 0 0 2px #d1f1ea}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-green.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-green.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-green.sui-button-onload-text{color:#aaa;background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red{color:#ff6d6d}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red.sui-active{background-color:#ffe5e9;color:#ff6d6d}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red:focus{outline:none;box-shadow:0 0 0 2px #ffe5e9}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-red.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-red.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-red.sui-button-onload-text{color:#aaa;background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange{color:#ff7e41}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange.sui-active{background-color:#ffe5d9;color:#ff7e41}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange:focus{outline:none;box-shadow:0 0 0 2px #ffe5d9}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-orange.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-orange.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-orange.sui-button-onload-text{color:#aaa;background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow{color:#fecf2f}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow.sui-active{background-color:#fff5d5;color:#fecf2f}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow:focus{outline:none;box-shadow:0 0 0 2px #fff5d5}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-yellow.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-yellow.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-yellow.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-yellow.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-yellow.sui-button-onload-text{color:#aaa;background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple{color:#8d00b1}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple.sui-active{background-color:#f9e1ff;color:#8d00b1}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple:focus{outline:none;box-shadow:0 0 0 2px #f9e1ff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-purple.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-purple.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-purple.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-purple.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-purple.sui-button-onload-text{color:#aaa;background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white{color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white.sui-active{background-color:rgba(0,0,0,.2);color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white:focus{outline:none;box-shadow:0 0 0 2px #fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-white.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-white.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-white.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-white.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-white.sui-button-onload-text{color:#aaa;background-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined{width:44px;border-color:#ddd}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-active{border-color:#888;background-color:#888;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined:focus{outline:none;box-shadow:0 0 0 2px #ddd}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-outlined.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-outlined.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-onload-text{border-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue{border-color:#e1f6ff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue.sui-active{border-color:#17a8e3;background-color:#17a8e3;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue:focus{outline:none;box-shadow:0 0 0 2px #e1f6ff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-outlined.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-outlined.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-blue.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-blue.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-blue.sui-button-onload-text{border-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green{border-color:#d1f1ea}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green.sui-active{border-color:#1abc9c;background-color:#1abc9c;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green:focus{outline:none;box-shadow:0 0 0 2px #d1f1ea}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-outlined.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-outlined.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-green.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-green.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-green.sui-button-onload-text{border-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red{border-color:#ffe5e9}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red.sui-active{border-color:#ff6d6d;background-color:#ff6d6d;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red:focus{outline:none;box-shadow:0 0 0 2px #ffe5e9}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-outlined.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-outlined.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-red.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-red.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-red.sui-button-onload-text{border-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange{border-color:#ffe5d9}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange.sui-active{border-color:#ff7e41;background-color:#ff7e41;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange:focus{outline:none;box-shadow:0 0 0 2px #ffe5d9}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-outlined.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-outlined.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-orange.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-orange.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-orange.sui-button-onload-text{border-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow{border-color:#fff5d5}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow.sui-active{border-color:#fecf2f;background-color:#fecf2f;color:#333}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow:focus{outline:none;box-shadow:0 0 0 2px #fff5d5}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-outlined.sui-button-yellow.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-outlined.sui-button-yellow.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-yellow.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-yellow.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-yellow.sui-button-onload-text{border-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple{border-color:#f9e1ff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple.sui-active{border-color:#8d00b1;background-color:#8d00b1;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple:focus{outline:none;box-shadow:0 0 0 2px #f9e1ff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-outlined.sui-button-purple.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-outlined.sui-button-purple.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-purple.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-purple.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-purple.sui-button-onload-text{border-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white{border-color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white.sui-active{border-color:#fff;background-color:#fff;color:#000}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white:focus{outline:none;box-shadow:0 0 0 2px #fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-outlined.sui-button-white.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-outlined.sui-button-white.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-outlined.sui-button-white.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-outlined.sui-button-white.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-outlined.sui-button-white.sui-button-onload-text{border-color:#e6e6e6}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-active{background-color:#d2d2d2}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled:focus{outline:none;box-shadow:0 0 0 2px #ddd}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-filled.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-filled.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue{background-color:#17a8e3;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue.sui-active{background-color:#1286b5}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue:focus{outline:none;box-shadow:0 0 0 2px #e1f6ff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-filled.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-filled.sui-button-blue.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-blue.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-blue.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-blue.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green{background-color:#1abc9c;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green.sui-active{background-color:#148f77}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green:focus{outline:none;box-shadow:0 0 0 2px #d1f1ea}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-filled.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-filled.sui-button-green.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-green.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-green.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-green.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red{background-color:#ff6d6d;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red.sui-active{background-color:#ff3a3a}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red:focus{outline:none;box-shadow:0 0 0 2px #ffe5e9}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-filled.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-filled.sui-button-red.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-red.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red.disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red:disabled,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red[disabled],.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-red.sui-button-onload-text,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red.disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red:disabled,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red[disabled],.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red.sui-button-onload,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-red.sui-button-onload-text{background-color:#e6e6e6;color:#aaa}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-orange,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-orange{background-color:#ff7e41;color:#fff}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange:hover,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange:focus,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange.sui-active,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-orange:hover,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-orange.sui-active,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-orange:hover,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-orange.sui-active{background-color:#ff5b0e}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange:focus,.sui-2-10-9 .sui-wrap a.sui-button-icon.sui-button-filled.sui-button-orange:focus,.sui-2-10-9 .sui-wrap button.sui-button-icon.sui-button-filled.sui-button-orange:focus{outline:none;box-shadow:0 0 0 2px #ffe5d9}.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange.disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange:disabled,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange[disabled],.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange.sui-button-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-dashboard-stats .sui-button-icon.sui-button-filled.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap.wds-page.wrap.wrap-wds.wds-dashboard #wds-lighthouse .sui-button-icon.sui-button-filled.sui-button-orange.wds-run-test-onload,.sui-2-10-9 .sui-wrap .sui-button-icon.sui-button-filled.sui-button-orange.sui-button-onload-text,.sui-2-10-9 .sui-wrap a.sui-but