Version Description
- Fix: Allow data import from Yoast 8.x
- Fix: Updated plugin version constant to latest version for cache busting
Download this release
Release Info
| Developer | khaxan |
| Plugin | |
| Version | 2.2.2.1 |
| Comparing to | |
| See all releases | |
Code changes from version 2.2.1 to 2.2.2.1
- autoloader.php +10 -0
- changelog.txt +513 -444
- class-mappings.php +91 -0
- config.php +90 -58
- includes/admin/admin.php +508 -441
- includes/admin/index.php +1 -0
- includes/admin/metabox.php +571 -478
- includes/admin/settings.php +710 -664
- includes/admin/settings/autolinks.php +526 -492
- includes/admin/settings/checkup.php +196 -175
- includes/admin/settings/dashboard.php +442 -604
- includes/admin/settings/index.php +1 -0
- includes/admin/settings/onpage.php +798 -660
- includes/admin/settings/redirections.php +0 -125
- includes/admin/settings/seomoz.php +0 -65
- includes/admin/settings/settings.php +569 -492
- includes/admin/settings/sitemap.php +506 -472
- includes/admin/settings/social.php +227 -203
- includes/admin/taxonomy.php +193 -137
- includes/admin/templates/_forms/autolinks.php +12 -10
- includes/admin/templates/_forms/import-export.php +6 -4
- includes/admin/templates/_forms/settings.php +6 -4
- includes/admin/templates/advanced-tools/advanced-section-automatic-linking-settings.php +88 -79
- includes/admin/templates/advanced-tools/advanced-section-automatic-linking.php +64 -57
- includes/admin/templates/advanced-tools/advanced-section-moz.php +69 -62
- includes/admin/templates/advanced-tools/advanced-section-redirects.php +109 -106
- includes/admin/templates/advanced-tools/advanced-tools-redirect-item.php +71 -69
- includes/admin/templates/advanced-tools/advanced-tools-settings.php +157 -149
- includes/admin/templates/{underscore-keywords-custom.php → advanced-tools/underscore-keywords-custom.php} +18 -17
- includes/admin/templates/{underscore-keywords-form.php → advanced-tools/underscore-keywords-form.php} +32 -31
- includes/admin/templates/{underscore-keywords-pairs.php → advanced-tools/underscore-keywords-pairs.php} +21 -21
- includes/admin/templates/{underscore-postlist-exclusion-item.php → advanced-tools/underscore-postlist-exclusion-item.php} +10 -9
- includes/admin/templates/{underscore-postlist-exclusion.php → advanced-tools/underscore-postlist-exclusion.php} +17 -16
- includes/admin/templates/{underscore-postlist-selector-list-item.php → advanced-tools/underscore-postlist-selector-list-item.php} +21 -20
- includes/admin/templates/{underscore-postlist-selector-list.php → advanced-tools/underscore-postlist-selector-list.php} +45 -44
- includes/admin/templates/{underscore-postlist-selector.php → advanced-tools/underscore-postlist-selector.php} +14 -14
- includes/admin/templates/checkup/checkup-checkup-results.php +83 -82
- includes/admin/templates/checkup/checkup-checkup-running.php +18 -16
- includes/admin/templates/checkup/checkup-checkup.php +13 -13
- includes/admin/templates/checkup/checkup-reporting.php +131 -129
- includes/admin/templates/checkup/checkup-settings.php +78 -89
- includes/admin/templates/checkup/checkup-top.php +98 -96
- includes/admin/templates/dashboard-dialog-has_dashboard-service_seo.php +0 -231
- includes/admin/templates/dashboard-dialog-has_dashboard-service_uptime.php +0 -30
- includes/admin/templates/dashboard-dialog-not_installed-service_seo.php +0 -22
- includes/admin/templates/dashboard-dialog-not_installed-service_uptime.php +0 -11
- includes/admin/templates/dashboard-dialog-not_logged_in-service_seo.php +0 -28
- includes/admin/templates/dashboard-dialog-seo_service-run.php +0 -49
- includes/admin/templates/dashboard-report-issue.php +0 -114
- includes/admin/templates/dashboard-settings.php +0 -237
- includes/admin/templates/dashboard/dashboard-box-title-url-crawl-stats.php +17 -17
- includes/admin/templates/dashboard/dashboard-checkup-progress.php +29 -27
- includes/admin/templates/dashboard/dashboard-content-analysis-readability-overview.php +88 -89
- includes/admin/templates/dashboard/dashboard-content-analysis-seo-overview.php +82 -83
- includes/admin/templates/dashboard/dashboard-mini-checkup-report.php +31 -30
- includes/admin/templates/dashboard/dashboard-top.php +113 -85
- includes/admin/templates/dashboard/dashboard-url-crawl-in-progress.php +11 -11
- includes/admin/templates/dashboard/dashboard-url-crawl-no-data-small.php +5 -5
- includes/admin/templates/dashboard/dashboard-url-crawl-stats.php +24 -23
- includes/admin/templates/dashboard/dashboard-widget-advanced-tools.php +112 -106
- includes/admin/templates/dashboard/dashboard-widget-content-analysis.php +85 -79
- includes/admin/templates/dashboard/dashboard-widget-onpage.php +60 -54
- includes/admin/templates/dashboard/dashboard-widget-seo-checkup.php +78 -72
- includes/admin/templates/dashboard/dashboard-widget-sitemap.php +111 -105
- includes/admin/templates/dashboard/dashboard-widget-social.php +113 -105
- includes/admin/templates/dashboard/dashboard.php +61 -53
- includes/admin/templates/dashboard/onboard-progress.php +7 -7
- includes/admin/templates/dashboard/onboarding.php +113 -112
- includes/admin/templates/disabled-component-inner.php +38 -36
- includes/admin/templates/disabled-component.php +23 -23
- includes/admin/templates/dismissable-notice.php +21 -20
- includes/admin/templates/index.php +1 -0
- includes/admin/templates/links-dropdown.php +18 -17
- includes/admin/templates/mascot-message.php +25 -25
- includes/admin/templates/media-url-field.php +14 -14
- includes/admin/templates/metabox.php +0 -294
- includes/admin/templates/metabox/analysis-readability.php +124 -115
- includes/admin/templates/metabox/analysis-seo-analysis.php +94 -0
- includes/admin/templates/metabox/analysis-seo_analysis.php +0 -86
- includes/admin/templates/metabox/analysis.php +5 -5
- includes/admin/templates/metabox/horizontal-tab-nav.php +16 -16
- includes/admin/templates/metabox/horizontal-tab.php +19 -19
- includes/admin/templates/metabox/metabox-main.php +99 -88
- includes/admin/templates/metabox/metabox-meta-edit-form.php +98 -94
- includes/admin/templates/metabox/metabox-preview.php +63 -59
- includes/admin/templates/metabox/metabox-seo-analysis-container.php +45 -39
- includes/admin/templates/metabox/metabox-social-meta-tags.php +97 -93
- includes/admin/templates/metabox/metabox-tab-advanced.php +166 -136
- includes/admin/templates/metabox/metabox-tab-readability.php +15 -13
- includes/admin/templates/metabox/metabox-tab-seo.php +25 -25
- includes/admin/templates/metabox/metabox-tab-social.php +98 -99
- includes/admin/templates/native-dismissible-notice-javascript.php +16 -0
- includes/admin/templates/notice.php +7 -7
- includes/admin/templates/onpage/onpage-marketpress-tabs.php +0 -83
- includes/admin/templates/onpage/onpage-meta-robots.php +16 -16
- includes/admin/templates/onpage/onpage-og-disabled.php +18 -14
- includes/admin/templates/onpage/onpage-og-settings.php +38 -38
- includes/admin/templates/onpage/onpage-og-twitter.php +50 -50
- includes/admin/templates/onpage/onpage-preview.php +26 -26
- includes/admin/templates/onpage/onpage-section-404.php +27 -25
- includes/admin/templates/onpage/onpage-section-author-archive.php +43 -40
- includes/admin/templates/onpage/onpage-section-buddypress-groups.php +31 -25
- includes/admin/templates/onpage/onpage-section-buddypress-profile.php +31 -25
- includes/admin/templates/onpage/onpage-section-date-archive.php +43 -40
- includes/admin/templates/onpage/onpage-section-homepage.php +99 -91
- includes/admin/templates/onpage/onpage-section-post-type-archive.php +57 -0
- includes/admin/templates/onpage/onpage-section-post-type.php +50 -41
- includes/admin/templates/onpage/onpage-section-search.php +43 -40
- includes/admin/templates/onpage/onpage-section-settings.php +35 -35
- includes/admin/templates/onpage/onpage-section-taxonomy.php +49 -41
- includes/admin/templates/onpage/onpage-settings.php +263 -257
- includes/admin/templates/onpage/onpage-social-meta-tags.php +116 -115
- includes/admin/templates/onpage/onpage-twitter-disabled.php +18 -14
- includes/admin/templates/onpage/onpage-twitter-settings.php +39 -39
- includes/admin/templates/{underscore-macros-list.php → onpage/underscore-macros-list.php} +13 -12
- includes/admin/templates/post-list/post-seo-analysis-errors.php +18 -0
- includes/admin/templates/post-list/post-seo-analysis-good.php +3 -0
- includes/admin/templates/progress-bar.php +10 -10
- includes/admin/templates/progress-notice.php +28 -26
- includes/admin/templates/quick-edit-javascript.php +45 -41
- includes/admin/templates/quick-edit-robots.php +39 -38
- includes/admin/templates/quick-edit-title.php +14 -12
- includes/admin/templates/redirections-settings.php +0 -123
- includes/admin/templates/report-vertical-tab.php +84 -81
- includes/admin/templates/seomoz-dashboard-widget.php +88 -71
- includes/admin/templates/seomoz-settings.php +0 -28
- includes/admin/templates/settings-message-top.php +55 -49
- includes/admin/templates/settings/settings-custom-meta-tag.php +7 -7
- includes/admin/templates/settings/settings-section-general.php +202 -203
- includes/admin/templates/settings/settings-section-import-export.php +66 -61
- includes/admin/templates/settings/settings-section-user-roles.php +85 -82
- includes/admin/templates/settings/settings.php +75 -81
- includes/admin/templates/sitemap/sitemap-buddypress-settings.php +53 -53
- includes/admin/templates/sitemap/sitemap-crawl-content.php +14 -14
- includes/admin/templates/sitemap/sitemap-crawl-issue-generic.php +58 -57
- includes/admin/templates/sitemap/sitemap-crawl-issue-ignored.php +26 -24
- includes/admin/templates/sitemap/sitemap-crawl-issue-sitemap.php +34 -33
- includes/admin/templates/sitemap/sitemap-crawl-issues-3xx.php +18 -18
- includes/admin/templates/sitemap/sitemap-crawl-issues-4xx.php +18 -18
- includes/admin/templates/sitemap/sitemap-crawl-issues-5xx.php +18 -18
- includes/admin/templates/sitemap/sitemap-crawl-issues-generic-controls.php +6 -5
- includes/admin/templates/sitemap/sitemap-crawl-issues-group.php +96 -95
- includes/admin/templates/sitemap/sitemap-crawl-issues-inaccessible.php +18 -18
- includes/admin/templates/sitemap/sitemap-crawl-issues-sitemap-controls.php +10 -8
- includes/admin/templates/sitemap/sitemap-crawl-issues-sitemap.php +19 -19
- includes/admin/templates/sitemap/sitemap-crawl-results.php +60 -60
- includes/admin/templates/sitemap/sitemap-crawl-stats.php +31 -31
- includes/admin/templates/sitemap/sitemap-no-crawler-data.php +15 -15
- includes/admin/templates/sitemap/sitemap-occurrences-overlay.php +42 -41
- includes/admin/templates/sitemap/sitemap-part.php +32 -32
- includes/admin/templates/sitemap/sitemap-progress-bar.php +12 -12
- includes/admin/templates/sitemap/sitemap-redirect-overlay.php +64 -61
- includes/admin/templates/sitemap/sitemap-section-advanced.php +58 -58
- includes/admin/templates/sitemap/sitemap-section-reporting.php +103 -100
- includes/admin/templates/sitemap/sitemap-section-settings.php +144 -139
- includes/admin/templates/sitemap/sitemap-settings.php +203 -195
- includes/admin/templates/sitemaps-dashboard-widget.php +71 -59
- includes/admin/templates/social/social-section-accounts.php +168 -163
- includes/admin/templates/social/social-section-open-graph.php +14 -14
- includes/admin/templates/social/social-section-pinterest-verification.php +40 -40
- includes/admin/templates/social/social-section-twitter-cards.php +71 -67
- includes/admin/templates/social/social-settings.php +89 -81
- includes/admin/templates/social/social-twitter-embed.php +27 -23
- includes/admin/templates/taxonomy-form-row.php +30 -24
- includes/admin/templates/term-additions-form.php +184 -206
autoloader.php
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
function smartcrawl_autoload( $class ) {
|
| 4 |
+
$class_mappings = include 'class-mappings.php';
|
| 5 |
+
if ( isset( $class_mappings[ $class ] ) && file_exists( SMARTCRAWL_PLUGIN_DIR . $class_mappings[ $class ] ) ) {
|
| 6 |
+
include SMARTCRAWL_PLUGIN_DIR . $class_mappings[ $class ];
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
spl_autoload_register( 'smartcrawl_autoload' );
|
changelog.txt
CHANGED
|
@@ -1,444 +1,513 @@
|
|
| 1 |
-
Plugin Name: SmartCrawl SEO
|
| 2 |
-
|
| 3 |
-
Change Log:
|
| 4 |
-
----------------------------------------------------------------------
|
| 5 |
-
----------------------------------------------------------------------
|
| 6 |
-
|
| 7 |
-
2.2.1 - 2018-
|
| 8 |
-
----------------------------------------------------------------------
|
| 9 |
-
- Fix:
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
- New:
|
| 15 |
-
- New:
|
| 16 |
-
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
-
-
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
-
-
|
| 23 |
-
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
-
|
| 29 |
-
-
|
| 30 |
-
-
|
| 31 |
-
-
|
| 32 |
-
-
|
| 33 |
-
|
| 34 |
-
- Fix:
|
| 35 |
-
- Fix:
|
| 36 |
-
- Fix:
|
| 37 |
-
- Fix:
|
| 38 |
-
- Fix:
|
| 39 |
-
- Fix:
|
| 40 |
-
- Fix:
|
| 41 |
-
- Fix:
|
| 42 |
-
- Fix:
|
| 43 |
-
- Fix:
|
| 44 |
-
- Fix:
|
| 45 |
-
- Fix:
|
| 46 |
-
- Fix:
|
| 47 |
-
- Fix:
|
| 48 |
-
- Fix:
|
| 49 |
-
- Fix:
|
| 50 |
-
- Fix:
|
| 51 |
-
- Fix:
|
| 52 |
-
- Fix:
|
| 53 |
-
- Fix:
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
- Fix:
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
-
|
| 62 |
-
-
|
| 63 |
-
-
|
| 64 |
-
-
|
| 65 |
-
-
|
| 66 |
-
-
|
| 67 |
-
-
|
| 68 |
-
-
|
| 69 |
-
-
|
| 70 |
-
-
|
| 71 |
-
-
|
| 72 |
-
-
|
| 73 |
-
-
|
| 74 |
-
-
|
| 75 |
-
|
| 76 |
-
-
|
| 77 |
-
|
| 78 |
-
-
|
| 79 |
-
|
| 80 |
-
-
|
| 81 |
-
|
| 82 |
-
-
|
| 83 |
-
-
|
| 84 |
-
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
-
|
| 90 |
-
-
|
| 91 |
-
-
|
| 92 |
-
- Fix:
|
| 93 |
-
- Fix:
|
| 94 |
-
|
| 95 |
-
-
|
| 96 |
-
|
| 97 |
-
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
- New:
|
| 102 |
-
|
| 103 |
-
-
|
| 104 |
-
|
| 105 |
-
- Fix:
|
| 106 |
-
- Fix:
|
| 107 |
-
- Fix:
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
-
|
| 112 |
-
-
|
| 113 |
-
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
-
|
| 118 |
-
- Fix
|
| 119 |
-
- Fix
|
| 120 |
-
- Fix
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
-
|
| 125 |
-
|
| 126 |
-
- Fix
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
-
|
| 132 |
-
-
|
| 133 |
-
-
|
| 134 |
-
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
-
|
| 139 |
-
-
|
| 140 |
-
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
-
|
| 145 |
-
-
|
| 146 |
-
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
-
|
| 151 |
-
- Fix
|
| 152 |
-
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
-
|
| 162 |
-
-
|
| 163 |
-
- Fix
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
-
|
| 169 |
-
|
| 170 |
-
-
|
| 171 |
-
-
|
| 172 |
-
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
-
|
| 188 |
-
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
-
|
| 194 |
-
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
-
|
| 199 |
-
|
| 200 |
-
-
|
| 201 |
-
- Fix for
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
-
|
| 212 |
-
|
| 213 |
-
-
|
| 214 |
-
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
-
|
| 220 |
-
- Fix for
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
-
|
| 235 |
-
|
| 236 |
-
-
|
| 237 |
-
-
|
| 238 |
-
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
-
|
| 245 |
-
|
| 246 |
-
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
-
|
| 252 |
-
-
|
| 253 |
-
|
| 254 |
-
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
-
|
| 269 |
-
-
|
| 270 |
-
-
|
| 271 |
-
|
| 272 |
-
1.
|
| 273 |
-
----------------------------------------------------------------------
|
| 274 |
-
- Fix for
|
| 275 |
-
-
|
| 276 |
-
|
| 277 |
-
-
|
| 278 |
-
|
| 279 |
-
- Added
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
-
|
| 284 |
-
|
| 285 |
-
1.
|
| 286 |
-
----------------------------------------------------------------------
|
| 287 |
-
- Added
|
| 288 |
-
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
-
|
| 314 |
-
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
-
|
| 320 |
-
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
- Added
|
| 330 |
-
|
| 331 |
-
-
|
| 332 |
-
|
| 333 |
-
-
|
| 334 |
-
|
| 335 |
-
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
-
|
| 351 |
-
|
| 352 |
-
- Fix for
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
-
|
| 358 |
-
|
| 359 |
-
1.
|
| 360 |
-
----------------------------------------------------------------------
|
| 361 |
-
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
-
|
| 370 |
-
|
| 371 |
-
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
-
|
| 389 |
-
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
-
|
| 397 |
-
|
| 398 |
-
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
- Fix for
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
-
|
| 412 |
-
|
| 413 |
-
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
-
|
| 419 |
-
- Added
|
| 420 |
-
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
1.0.
|
| 433 |
-
----------------------------------------------------------------------
|
| 434 |
-
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
1.0 -
|
| 443 |
-
----------------------------------------------------------------------
|
| 444 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Plugin Name: SmartCrawl SEO
|
| 2 |
+
|
| 3 |
+
Change Log:
|
| 4 |
+
----------------------------------------------------------------------
|
| 5 |
+
----------------------------------------------------------------------
|
| 6 |
+
|
| 7 |
+
2.2.2.1 - 2018-08-20
|
| 8 |
+
----------------------------------------------------------------------
|
| 9 |
+
- Fix: Allow data import from Yoast 8.x
|
| 10 |
+
- Fix: Updated plugin version constant to latest version for cache busting
|
| 11 |
+
|
| 12 |
+
2.2.2 - 2018-07-13
|
| 13 |
+
----------------------------------------------------------------------
|
| 14 |
+
- New: support for custom post type archives
|
| 15 |
+
- New: noindex/nofollow for post types
|
| 16 |
+
- New: new OpenGraph tags og:url, og:type, og:image:width and og:image:height
|
| 17 |
+
- New: code optimization
|
| 18 |
+
- New: integration test suite for quality assurance
|
| 19 |
+
- New: link each page to the relevant documentation section on the plugin website
|
| 20 |
+
- New: import social profile links from AIOSEOP
|
| 21 |
+
- New: dynamically adjust the toggles under "Site Owner Permissions"
|
| 22 |
+
- New: update Google result preview when content is changed
|
| 23 |
+
- New: prompt requesting reviews on WP.org
|
| 24 |
+
|
| 25 |
+
- Fix: hide settings for disabled modules from plugin dashboard
|
| 26 |
+
- Fix: BuddyPress group titles missing
|
| 27 |
+
- Fix: links to enable OpenGraph and Twitter settings pointing to inaccessible pages
|
| 28 |
+
- Fix: duplicate text in SEO Checkup section of metabox
|
| 29 |
+
- Fix: plugin css conflicting with some WP admin components
|
| 30 |
+
- Fix: analysis indicators not displaying correct colors in WP post list
|
| 31 |
+
- Fix: settings need to be saved before reports for SEO Checkup are sent
|
| 32 |
+
- Fix: on WP dashboard, 'update sitemap' link in the sitemap widget not working
|
| 33 |
+
- Fix: typo in opengraph settings
|
| 34 |
+
- Fix: when new URL scan is run, the URL Crawler section not loaded automatically
|
| 35 |
+
- Fix: google/bing verification codes from yoast not imported correctly
|
| 36 |
+
- Fix: columns in the post tables take more space then they should
|
| 37 |
+
- Fix: google verification meta can't be removed once added
|
| 38 |
+
- Fix: meta description not working on WooCommerce shop page
|
| 39 |
+
- Fix: redundant save settings button under URL Crawler report
|
| 40 |
+
- Fix: typo in the upgrade popup
|
| 41 |
+
- Fix: when import from yoast notice dismissed, it comes back on page load
|
| 42 |
+
- Fix: seo column in post list shows wrong color indicator when focus keyword missing
|
| 43 |
+
- Fix: google/bing verification tags disappear when sitemap settings saved
|
| 44 |
+
- Fix: XML sitemap opened in the current tab
|
| 45 |
+
- Fix: when "Upgrade to Pro" clicked, pro version details opened in the current tab
|
| 46 |
+
- Fix: values under "Site Owner Permissions" not saved when everything turned off
|
| 47 |
+
- Fix: last checked time on SEO Checkup inconsistent
|
| 48 |
+
- Fix: if modules disabled by network admin, site admin can still see them in settings
|
| 49 |
+
- Fix: autolinks page has "TBC" as the description of a setting
|
| 50 |
+
- Fix: author archive meta description not saved
|
| 51 |
+
- Fix: dashboard sections display number of issues even if the corresponding module is disabled
|
| 52 |
+
- Fix: on network sub-sites, disabled modules not behaving properly
|
| 53 |
+
- Fix: previews are not refreshing on title and meta admin page
|
| 54 |
+
- Fix: url crawler not always listing the URLs resulting in errors
|
| 55 |
+
- Fix: hide SEO Checkup on network sub-sites
|
| 56 |
+
- Fix: remove code for old google site verification settings
|
| 57 |
+
- Fix: date archive settings not respected
|
| 58 |
+
- Fix: admin bar menu should always match the admin menu
|
| 59 |
+
- Fix: in url crawler, no message is shown when all missing urls added to sitemap
|
| 60 |
+
- Fix: MOZ metabox not styled
|
| 61 |
+
- Fix: Redirect Attachments options in Advanced Tools not saved when in off state
|
| 62 |
+
- Fix: automatic linking toggle in post metabox displays wrong state
|
| 63 |
+
- Fix: redundant MarketPress options
|
| 64 |
+
- Fix: autolinks "Exclusions" don't work when "Case Sensitive Matching" is off
|
| 65 |
+
- Fix: autolinks "Min Lengths" setting not working consistently
|
| 66 |
+
- Fix: twitter settings for date archives not working consistently
|
| 67 |
+
- Fix: meta description settings for search and 404 pages not working consistently
|
| 68 |
+
- Fix: google verification meta settings not working consistently
|
| 69 |
+
- Fix: quick edit fields not loading values
|
| 70 |
+
- Fix: unwanted space before date archive title
|
| 71 |
+
- Fix: minor inconsistencies in SEO analysis
|
| 72 |
+
- Fix: no error message displayed when default user removed in reporting section under SEO Checkup
|
| 73 |
+
- Fix: statistics on dashboard not refreshed when checkup completes in SEO Checkup section
|
| 74 |
+
- Fix: MOZ data displayed even when wrong credentials added
|
| 75 |
+
|
| 76 |
+
2.2.1 - 2018-03-31
|
| 77 |
+
----------------------------------------------------------------------
|
| 78 |
+
- Fix: post list pages performance issue.
|
| 79 |
+
|
| 80 |
+
2.2 - 2018-03-28
|
| 81 |
+
----------------------------------------------------------------------
|
| 82 |
+
- New: Yoast & All-In-One SEO importers.
|
| 83 |
+
- New: 'Refresh' button for content & readability analysis modules.
|
| 84 |
+
- New: ability to set twitter cards details on post and type level.
|
| 85 |
+
|
| 86 |
+
- Fix: compatibility with New Blog Templates plugin.
|
| 87 |
+
- Fix: spelling and grammar issues.
|
| 88 |
+
- Fix: duplicate info text in "No Image Alts" section of seo analysis.
|
| 89 |
+
- Fix: support for Themify themes.
|
| 90 |
+
- Fix: readability analysis summary outputting html tags.
|
| 91 |
+
- Fix: saving draft or publishing posts closes the smartcrawl module.
|
| 92 |
+
- Fix: problems in "Add All to Sitemap" button.
|
| 93 |
+
- Fix: incorrect number of missing url's on main dashboard.
|
| 94 |
+
|
| 95 |
+
2.1.1 - 2017-02-07
|
| 96 |
+
----------------------------------------------------------------------
|
| 97 |
+
- New: make Analysis dash widget results numeric and items clickable.
|
| 98 |
+
- New: add OpenGraph and Twitter options for taxonomies.
|
| 99 |
+
- New: exclude full URLs from sitemap.
|
| 100 |
+
- New: grey out deactivated modules in site owner permissions.
|
| 101 |
+
- New: enable styled sitemap on fresh setups.
|
| 102 |
+
|
| 103 |
+
- Fix: increase recommended description length from 160 to 230 chars.
|
| 104 |
+
- Fix: redirection resolution on archive pages.
|
| 105 |
+
- Fix: spelling and grammar issues.
|
| 106 |
+
- Fix: UI and styling issues.
|
| 107 |
+
- Fix: checkup scan tracking auto-update.
|
| 108 |
+
- Fix: update option label copies.
|
| 109 |
+
- Fix: update info links.
|
| 110 |
+
- Fix: admin menu style issues in Firefox.
|
| 111 |
+
- Fix: background color style issues.
|
| 112 |
+
- Fix: conflict with Divi theme.
|
| 113 |
+
- Fix: configuring links destinations when sitewide mode is active.
|
| 114 |
+
- Fix: unifiy analysis status results.
|
| 115 |
+
- Fix: BBPress compatibility issue with generated URLs.
|
| 116 |
+
- Fix: update error strings on import/export issues.
|
| 117 |
+
- Fix: sitemap items listed twice in audit report.
|
| 118 |
+
- Fix: title tag on custom post type archives issue.
|
| 119 |
+
- Fix: conflict with Movedo theme.
|
| 120 |
+
- Fix: do not calculate disabled analysis results.
|
| 121 |
+
- Fix: empty ignore URLs list clears sitemaps.
|
| 122 |
+
- Fix: user name not shown for reporting.
|
| 123 |
+
|
| 124 |
+
2.1.0.1 - 2017-12-18
|
| 125 |
+
----------------------------------------------------------------------
|
| 126 |
+
- Fix: Jetpack compatibility issue
|
| 127 |
+
|
| 128 |
+
2.1 - 2017-12-18
|
| 129 |
+
----------------------------------------------------------------------
|
| 130 |
+
- Add: complete redesign
|
| 131 |
+
- Add: macros separator support
|
| 132 |
+
- Add: getting started wizard
|
| 133 |
+
- Add: improved OpenGraph controls
|
| 134 |
+
- Add: Twitter cards support
|
| 135 |
+
- Add: schema support
|
| 136 |
+
- Add: Pinterest verification support
|
| 137 |
+
- Add: custom meta elements support
|
| 138 |
+
- Add: linked social accounts support
|
| 139 |
+
- Add: WP Checkup service integration
|
| 140 |
+
- Add: scheduled crawl and checkup support
|
| 141 |
+
- Add: SEO analysis check per post
|
| 142 |
+
- Add: per post readability analysis
|
| 143 |
+
- Add: per post autolinks toggle
|
| 144 |
+
- Add: improved keywords handling with focus keywords
|
| 145 |
+
- Add: ability to import and export settings
|
| 146 |
+
- Add: allow sitemode switching in admin area on network setups
|
| 147 |
+
- Add: attachment page noindex/redirection
|
| 148 |
+
|
| 149 |
+
- Fix: improved previews
|
| 150 |
+
- Fix: OpenGraph compatibility issue with Jetpack
|
| 151 |
+
- Fix: sitemaps issue with alternate cron
|
| 152 |
+
- Fix: additional checks for sitemaps read/write
|
| 153 |
+
- Fix: HHVM compatibility
|
| 154 |
+
- Fix: improve site owner permissions on network setups
|
| 155 |
+
|
| 156 |
+
2.0.1 - 2017-06-07
|
| 157 |
+
----------------------------------------------------------------------
|
| 158 |
+
- Add: ability to ignore issues
|
| 159 |
+
- Add: ability to add custom sitemap URLs
|
| 160 |
+
- Add: option to skip strict description check
|
| 161 |
+
- Fix: homepage keywords saving issue
|
| 162 |
+
- Fix: MarketPress coupons conflict
|
| 163 |
+
- Fix: typos
|
| 164 |
+
- Fix: improve admin toolbar item and allow suppression
|
| 165 |
+
- Fix: front-end templating deprecated tags conflict
|
| 166 |
+
- Fix: WooCommerce shop page empty SEO details overrides
|
| 167 |
+
|
| 168 |
+
2.0 - 2017-02-23
|
| 169 |
+
----------------------------------------------------------------------
|
| 170 |
+
- New: whole new interface
|
| 171 |
+
- Add: OpenGraph support
|
| 172 |
+
- Add: SEO Audit service support
|
| 173 |
+
|
| 174 |
+
- Fix: deprecated constructors usage
|
| 175 |
+
- Fix: W3TC object cache conflict issue
|
| 176 |
+
- Fix: multiple anonymous post types rendering issue
|
| 177 |
+
|
| 178 |
+
1.7.6 - 2015-08-25
|
| 179 |
+
----------------------------------------------------------------------
|
| 180 |
+
- Add advanced robots options info on listing pages.
|
| 181 |
+
- Add redirections info on listing pages.
|
| 182 |
+
- Project name update.
|
| 183 |
+
|
| 184 |
+
1.7.5 - 2015-08-15
|
| 185 |
+
----------------------------------------------------------------------
|
| 186 |
+
- Add 301 redirection box permission level to the defaults list.
|
| 187 |
+
- Fix for titles processing in feeds output.
|
| 188 |
+
- Fix and cleanup for post type checks conditionals.
|
| 189 |
+
- Fix for duplicated static front page in sitemaps.
|
| 190 |
+
|
| 191 |
+
1.7.4 - 2014-12-28
|
| 192 |
+
----------------------------------------------------------------------
|
| 193 |
+
- Fix duplicates prevention stopping the post autolink expansion.
|
| 194 |
+
- Fix keyword tag detection in autolink expansion replacement.
|
| 195 |
+
- Fix extra whitespaces in autolink replacement expansion.
|
| 196 |
+
- Fix for `set_time_limits` limitations.
|
| 197 |
+
|
| 198 |
+
1.7.3 - 2014-11-11
|
| 199 |
+
----------------------------------------------------------------------
|
| 200 |
+
- Fix for some PHP notices.
|
| 201 |
+
- Fix for regex matching points in autolinks detection.
|
| 202 |
+
- Fix for link counts in autolinks matching to prevent clearing results.
|
| 203 |
+
- Fix for maximum single link replacement in post title matching.
|
| 204 |
+
|
| 205 |
+
1.7.2 - 2014-10-21
|
| 206 |
+
----------------------------------------------------------------------
|
| 207 |
+
- Fix for boundary matching in an unicode-safe way.
|
| 208 |
+
- Fix for sitemap stylesheet path with SSL enabled.
|
| 209 |
+
- Improved per-site settings mode.
|
| 210 |
+
|
| 211 |
+
1.7.1 - 2014-07-08
|
| 212 |
+
----------------------------------------------------------------------
|
| 213 |
+
- Fix for attachment metadata handling.
|
| 214 |
+
- Fix for showing network management level options.
|
| 215 |
+
- Allowing optional partial on-page optimization.
|
| 216 |
+
|
| 217 |
+
1.7 - 2014-05-22
|
| 218 |
+
----------------------------------------------------------------------
|
| 219 |
+
- Some typo fixes.
|
| 220 |
+
- Fix for posts with invalid modified dates by forcing timestamps.
|
| 221 |
+
- Added support for global marketplace pages.
|
| 222 |
+
|
| 223 |
+
1.6.8.1 - 2014-05-10
|
| 224 |
+
----------------------------------------------------------------------
|
| 225 |
+
- Improving data validation.
|
| 226 |
+
- Fix for BuddyPress pages recognition.
|
| 227 |
+
|
| 228 |
+
1.6.8 - 2014-02-02
|
| 229 |
+
----------------------------------------------------------------------
|
| 230 |
+
- Added verification code options.
|
| 231 |
+
- Added experimental features flag.
|
| 232 |
+
- Fix for the settings binding by pushing it up the queue.
|
| 233 |
+
|
| 234 |
+
1.6.7 - 2013-12-20
|
| 235 |
+
----------------------------------------------------------------------
|
| 236 |
+
- Exposed the meta description for filtering.
|
| 237 |
+
- Adding in the `nofollow` rel attribute option.
|
| 238 |
+
- Exposing the arguments building for filtering from central location.
|
| 239 |
+
- Exposing the post/term priority filters.
|
| 240 |
+
- Adding separate role settings for 301 redirection box selection.
|
| 241 |
+
- Fix for title length replacement.
|
| 242 |
+
- Fix for default BuddyPress canonicals.
|
| 243 |
+
|
| 244 |
+
1.6.6 - 2013-08-11
|
| 245 |
+
----------------------------------------------------------------------
|
| 246 |
+
- Fix for quickedit boxes.
|
| 247 |
+
- Strings update.
|
| 248 |
+
|
| 249 |
+
1.6.5 - 2013-08-02
|
| 250 |
+
----------------------------------------------------------------------
|
| 251 |
+
- Converting robots multiple selection box into checbox array.
|
| 252 |
+
- Time-limit skipping switch updated.
|
| 253 |
+
|
| 254 |
+
1.6.4 - 2013-07-07
|
| 255 |
+
----------------------------------------------------------------------
|
| 256 |
+
- Postponing the capability checks.
|
| 257 |
+
- Allowing for timeout prevention override.
|
| 258 |
+
|
| 259 |
+
1.6.3 - 2013-07-06
|
| 260 |
+
----------------------------------------------------------------------
|
| 261 |
+
- Exposing title for additional filtering.
|
| 262 |
+
- Added blog public sanity check.
|
| 263 |
+
- Counters update.
|
| 264 |
+
|
| 265 |
+
1.6.2 - 2013-04-14
|
| 266 |
+
----------------------------------------------------------------------
|
| 267 |
+
- Added subsequent pages robots meta rule.
|
| 268 |
+
- Added meta robots options to search results page.
|
| 269 |
+
- Event delegation update.
|
| 270 |
+
- Fix for SeoMOZ calls bit flags.
|
| 271 |
+
|
| 272 |
+
1.6.1 - 2013-03-20
|
| 273 |
+
----------------------------------------------------------------------
|
| 274 |
+
- Fix for metabox access privileges.
|
| 275 |
+
- Better date archives optimization.
|
| 276 |
+
|
| 277 |
+
1.6 - 2013-02-02
|
| 278 |
+
----------------------------------------------------------------------
|
| 279 |
+
- Added global meta robots settings for taxonomies.
|
| 280 |
+
- Added conditional unhooking possibility.
|
| 281 |
+
- Allowing per-post sitemap inclusion filtering.
|
| 282 |
+
- Better post types handling.
|
| 283 |
+
- Allowed linking to empty taxonomies.
|
| 284 |
+
|
| 285 |
+
1.5.4 - 2013-01-13
|
| 286 |
+
----------------------------------------------------------------------
|
| 287 |
+
- Added custom columns to custom post types list views.
|
| 288 |
+
- Allowing quick edit on custom post types lists.
|
| 289 |
+
- Fix for WooCommerce main shop on-page settings.
|
| 290 |
+
|
| 291 |
+
1.5.3 - 2013-01-08
|
| 292 |
+
----------------------------------------------------------------------
|
| 293 |
+
- Fix for BuddyPress installs outside the main site.
|
| 294 |
+
- News keywords support.
|
| 295 |
+
|
| 296 |
+
1.5.2 - 2012-12-30
|
| 297 |
+
----------------------------------------------------------------------
|
| 298 |
+
- Fix for autolinks being recognized in shortcodes.
|
| 299 |
+
- Updated the project link.
|
| 300 |
+
|
| 301 |
+
1.5.1 - 2012-11-02
|
| 302 |
+
----------------------------------------------------------------------
|
| 303 |
+
- Adding link target options for auto-generated links.
|
| 304 |
+
- Allowed define override for metabox role settings.
|
| 305 |
+
- Propagating autolink fixes by Daniel Speichert (thank you!).
|
| 306 |
+
- Fix for BuddyPress groups page titles.
|
| 307 |
+
- Fix for link in titles insertion issue and safer regex.
|
| 308 |
+
|
| 309 |
+
|
| 310 |
+
1.5 - 2012-09-08
|
| 311 |
+
----------------------------------------------------------------------
|
| 312 |
+
- Exposing more hooks.
|
| 313 |
+
- Making admin sitemap auto-update optional.
|
| 314 |
+
- URL differentiation for domain mapped sites.
|
| 315 |
+
- Disabling dashboard widgets for roles below contributor.
|
| 316 |
+
|
| 317 |
+
1.4.4 - 2012-07-20
|
| 318 |
+
----------------------------------------------------------------------
|
| 319 |
+
- Fix for special characters in titles.
|
| 320 |
+
- Fix for taxonomies autolinking.
|
| 321 |
+
- Fix for post self-linking.
|
| 322 |
+
- Added maximum autolinks number limit setting.
|
| 323 |
+
- Added quick edit fields.
|
| 324 |
+
|
| 325 |
+
1.4.3 - 2012-07-08
|
| 326 |
+
----------------------------------------------------------------------
|
| 327 |
+
- Improved paged output handling.
|
| 328 |
+
- More robust post error handling.
|
| 329 |
+
- Added boolean debug switches.
|
| 330 |
+
|
| 331 |
+
1.4.2 - 05/26/2012
|
| 332 |
+
----------------------------------------------------------------------
|
| 333 |
+
- Fix for sitemaps URL resolution on domain-mapped sites
|
| 334 |
+
|
| 335 |
+
1.4.1 - 05/07/2012
|
| 336 |
+
----------------------------------------------------------------------
|
| 337 |
+
- Fix for contextual help trigger.
|
| 338 |
+
- Fix for full word auto-linking.
|
| 339 |
+
- Added home page keywords settings.
|
| 340 |
+
|
| 341 |
+
1.4 - 03/22/2012 Vladislav Bailovic
|
| 342 |
+
----------------------------------------------------------------------
|
| 343 |
+
- Fix for sitemap path finding.
|
| 344 |
+
- Fix for BuddyPress Groups paging.
|
| 345 |
+
- Improved taxonomies admin output.
|
| 346 |
+
- Improved excerpt generation.
|
| 347 |
+
- Added title and meta rewriting for BuddyPress Groups.
|
| 348 |
+
- Added title and meta rewriting for BuddyPress Profiles.
|
| 349 |
+
|
| 350 |
+
1.3.7 - 01/20/2012 Vladislav Bailovic
|
| 351 |
+
----------------------------------------------------------------------
|
| 352 |
+
- Fix for issue with BuddyPress documents plugin.
|
| 353 |
+
|
| 354 |
+
1.3.6 - 12/22/2011 Vladislav Bailovic
|
| 355 |
+
----------------------------------------------------------------------
|
| 356 |
+
- Added options for duplicate link prevention.
|
| 357 |
+
- Applied better contextual help trigger.
|
| 358 |
+
|
| 359 |
+
1.3.5 - 11/29/2011 Vladislav Bailovic
|
| 360 |
+
----------------------------------------------------------------------
|
| 361 |
+
- Fix for robots meta output interaction with privacy settings.
|
| 362 |
+
- Additional BuddyPress items check.
|
| 363 |
+
|
| 364 |
+
1.3.4 - 11/24/2011 Vladislav Bailovic
|
| 365 |
+
----------------------------------------------------------------------
|
| 366 |
+
- Fix for BuddyPress groups support with no groups set up.
|
| 367 |
+
- Added WPML config file.
|
| 368 |
+
|
| 369 |
+
1.3.3 - 11/17/2011 Vladislav Bailovic
|
| 370 |
+
----------------------------------------------------------------------
|
| 371 |
+
- Fix for updated SEOMoz links.
|
| 372 |
+
- Fix for BuddyPress groups priority calculation.
|
| 373 |
+
|
| 374 |
+
1.3.2 - 11/10/2011 Vladislav Bailovic
|
| 375 |
+
----------------------------------------------------------------------
|
| 376 |
+
- Added BuddyPress groups and profiles in sitemaps.
|
| 377 |
+
- Fixed site validation META headers.
|
| 378 |
+
- Fixed sitemap path finding.
|
| 379 |
+
|
| 380 |
+
1.3.1 - 11/05/2011 Vladislav Bailovic
|
| 381 |
+
----------------------------------------------------------------------
|
| 382 |
+
- Fix for sitemap path options.
|
| 383 |
+
- Fix for autolinks issue with titles.
|
| 384 |
+
|
| 385 |
+
1.3 - 10/25/2011 Vladislav Bailovic
|
| 386 |
+
----------------------------------------------------------------------
|
| 387 |
+
- Sitemap module rewrite, new sitemap options and dashboard widget.
|
| 388 |
+
- Changed title limit to soft limit.
|
| 389 |
+
- Added priority options for posts.
|
| 390 |
+
|
| 391 |
+
1.2.1 - 07/16/2011 Vladislav Bailovic
|
| 392 |
+
----------------------------------------------------------------------
|
| 393 |
+
- Fixed autolink detection for strings that start with an
|
| 394 |
+
non-ascii letter.
|
| 395 |
+
|
| 396 |
+
1.2 - 07/15/2011 Vladislav Bailovic
|
| 397 |
+
----------------------------------------------------------------------
|
| 398 |
+
- Added "show tab" option to Network Admin while in sitewide, to apply
|
| 399 |
+
tab permissions once the plugin goes in per-blog mode
|
| 400 |
+
- Added "tags as keywords" checkbox.
|
| 401 |
+
- Keywords as tags working.
|
| 402 |
+
- Fixed issue with SEOmoz dashboard widget not getting the required info.
|
| 403 |
+
- Fixed SEOmoz results caching in transients.
|
| 404 |
+
- Changed sitemap path box to actual input box.
|
| 405 |
+
|
| 406 |
+
1.1.2 - 06/15/2011 Vladislav Bailovic
|
| 407 |
+
----------------------------------------------------------------------
|
| 408 |
+
- Fix for issue with apostrophe (and other html special chars)
|
| 409 |
+
in SEO metabox.
|
| 410 |
+
|
| 411 |
+
1.1.1 - 06/14/2011 Vladislav Bailovic
|
| 412 |
+
----------------------------------------------------------------------
|
| 413 |
+
- Add htmlemtities and wordpress texturizer alternations for custom
|
| 414 |
+
keywords in Autolinks.
|
| 415 |
+
|
| 416 |
+
1.1 - 06/13/2011 Vladislav Bailovic
|
| 417 |
+
----------------------------------------------------------------------
|
| 418 |
+
- Added SEOmoz dashboard widget.
|
| 419 |
+
- Added character couter and limits for SEO metabox.
|
| 420 |
+
- Added meta keywords field to SEO metabox.
|
| 421 |
+
- Fix for WPMU DEV SEO metabox using fixed width.
|
| 422 |
+
- Fix for WDS_SITEWIDE define to toggle per-blog settings availability.
|
| 423 |
+
|
| 424 |
+
1.0.9.7 - 06/02/2011 Vladislav Bailovic
|
| 425 |
+
----------------------------------------------------------------------
|
| 426 |
+
- Re-wrote some of the code.
|
| 427 |
+
|
| 428 |
+
1.0.9.6 - 05/21/2011 Vladislav Bailovic
|
| 429 |
+
----------------------------------------------------------------------
|
| 430 |
+
- Fixed the the SimplePress incompatibility issue.
|
| 431 |
+
|
| 432 |
+
1.0.9.5 - 05/15/2011 Vladislav Bailovic
|
| 433 |
+
----------------------------------------------------------------------
|
| 434 |
+
- Fixed the robots settings display on Page/Post list page.
|
| 435 |
+
|
| 436 |
+
1.0.9.4 - 05/10/2011 Vladislav Bailovic
|
| 437 |
+
----------------------------------------------------------------------
|
| 438 |
+
- Normalizing newlines for title rewriting in head buffer.
|
| 439 |
+
- Allowed matching title tags with arguments.
|
| 440 |
+
- Re-introduced `wp_title` filter.
|
| 441 |
+
|
| 442 |
+
1.0.9.3 - 05/02/2011 Vladislav Bailovic
|
| 443 |
+
----------------------------------------------------------------------
|
| 444 |
+
- Fixed header detection regular expression.
|
| 445 |
+
- Removed HTML comments.
|
| 446 |
+
|
| 447 |
+
1.0.9.2 - 05/01/2011 Vladislav Bailovic
|
| 448 |
+
----------------------------------------------------------------------
|
| 449 |
+
- Added Contributors to both metabox allowed lists.
|
| 450 |
+
|
| 451 |
+
1.0.9.1 - 04/28/2011 Vladislav Bailovic
|
| 452 |
+
----------------------------------------------------------------------
|
| 453 |
+
- Fixed title rewriting in feeds
|
| 454 |
+
|
| 455 |
+
1.0.9 - 04/23/2011 Vladislav Bailovic
|
| 456 |
+
----------------------------------------------------------------------
|
| 457 |
+
- Forced collapsed state on WDS metaboxes.
|
| 458 |
+
- Deprecated default metabox hiding.
|
| 459 |
+
- Fixed default permission level for showing metaboxes on singular installs.
|
| 460 |
+
- Added WPMU DEV SEO metabox title l10n for Network installs. Singular installs will still see the branding.
|
| 461 |
+
|
| 462 |
+
|
| 463 |
+
1.0.8 - 04/22/2011 Vladislav Bailovic
|
| 464 |
+
----------------------------------------------------------------------
|
| 465 |
+
- Fix for relative stylesheet URLs in sitemaps.
|
| 466 |
+
- Fix for generating AND outputing sitemaps, without rebuilding on refresh.
|
| 467 |
+
- Fix for auto-populating settings without admin having to visit the dashboard.
|
| 468 |
+
- Added SEO and SEOmoz metabox toggling options and user displaying permission.
|
| 469 |
+
|
| 470 |
+
1.0.7 - 04/20/2011 Vladislav Bailovic
|
| 471 |
+
----------------------------------------------------------------------
|
| 472 |
+
- Fix for title rewriting issues.
|
| 473 |
+
|
| 474 |
+
1.0.6 - 04/16/2011 Vladislav Bailovic
|
| 475 |
+
----------------------------------------------------------------------
|
| 476 |
+
- Fix for SEOMoz API data fetching bug (transient data being stuck).
|
| 477 |
+
- Fix for "Error: options page not found" message on multiple options step saves.
|
| 478 |
+
- Updated Title SEO tweak to work with BuddyPress as well.
|
| 479 |
+
- Fix for Sitemaps: using a regex match to determine if the sitemap was requested. Using a relative path to link the XSL stylesheet to it.
|
| 480 |
+
- Added some error checking with is_wp_error
|
| 481 |
+
- Some naming convention consistency fixes for option names.
|
| 482 |
+
- Some PHP fixes.
|
| 483 |
+
|
| 484 |
+
1.0.5 - 03/25/2011 Aaron Edwards
|
| 485 |
+
----------------------------------------------------------------------
|
| 486 |
+
- Fixes for PHP 4 incompatibilities
|
| 487 |
+
- Limited posts in sitemap to 1000 most recent to prevent memory errors.
|
| 488 |
+
- Added WDS_SITEMAP_POST_LIMIT define to be able to adjust limit in wp-config
|
| 489 |
+
- Bug fix: Was killing admin help content
|
| 490 |
+
|
| 491 |
+
1.0.4 - 03/24/2011 Aaron Edwards
|
| 492 |
+
----------------------------------------------------------------------
|
| 493 |
+
- Fixes to various php errors
|
| 494 |
+
- Increase the time-limit for sitemap creation to work with big blogs
|
| 495 |
+
|
| 496 |
+
1.0.3 - 03/07/2011
|
| 497 |
+
----------------------------------------------------------------------
|
| 498 |
+
- Enhancement: store sitemap in wp-content/uploads for main site on
|
| 499 |
+
multisite
|
| 500 |
+
|
| 501 |
+
1.0.2 - 03/05/2011
|
| 502 |
+
----------------------------------------------------------------------
|
| 503 |
+
- Bug fix: remove fields added to quick edit which where triggering a
|
| 504 |
+
fatal error
|
| 505 |
+
|
| 506 |
+
1.0.1 - 03/02/2011
|
| 507 |
+
----------------------------------------------------------------------
|
| 508 |
+
- Bug fix: sitemap not created on Multisite when blog upload dir doesn't
|
| 509 |
+
exist yet
|
| 510 |
+
|
| 511 |
+
1.0 - 01/08/2010
|
| 512 |
+
----------------------------------------------------------------------
|
| 513 |
+
- Initial Release.
|
class-mappings.php
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
return array(
|
| 4 |
+
// Classes in includes/core/
|
| 5 |
+
'Smartcrawl_AIOSEOP_Importer' => '/core/class-wds-aioseop-importer.php',
|
| 6 |
+
'Smartcrawl_Checks' => '/core/class-wds-checks.php',
|
| 7 |
+
'Smartcrawl_Controller_Analysis' => '/core/class-wds-controller-analysis.php',
|
| 8 |
+
'Smartcrawl_Controller_Cron' => '/core/class-wds-controller-cron.php',
|
| 9 |
+
'Smartcrawl_Controller_Hub' => '/core/class-wds-controller-hub.php',
|
| 10 |
+
'Smartcrawl_Controller_IO' => '/core/class-wds-controller-io.php',
|
| 11 |
+
'Smartcrawl_Controller_Onboard' => '/core/class-wds-controller-onboard.php',
|
| 12 |
+
'Smartcrawl_Controller_Sitemap' => '/core/class-wds-controller-sitemap.php',
|
| 13 |
+
'Smartcrawl_Core_Request' => '/core/class-wds-core-request.php',
|
| 14 |
+
'Smartcrawl_Endpoint_Resolver' => '/core/class-wds-endpoint-resolver.php',
|
| 15 |
+
'Smartcrawl_Export' => '/core/class-wds-export.php',
|
| 16 |
+
'Smartcrawl_Html' => '/core/class-wds-html.php',
|
| 17 |
+
'Smartcrawl_Import' => '/core/class-wds-import.php',
|
| 18 |
+
'Smartcrawl_Importer' => '/core/class-wds-importer.php',
|
| 19 |
+
'Smartcrawl_Logger' => '/core/class-wds-logger.php',
|
| 20 |
+
'Smartcrawl_Macro' => '/core/class-wds-macro.php',
|
| 21 |
+
'Smartcrawl_Model' => '/core/class-wds-model.php',
|
| 22 |
+
'Smartcrawl_Model_Analysis' => '/core/class-wds-model-analysis.php',
|
| 23 |
+
'Smartcrawl_Model_Ignores' => '/core/class-wds-model-ignores.php',
|
| 24 |
+
'Smartcrawl_Model_IO' => '/core/class-wds-model-io.php',
|
| 25 |
+
'Smartcrawl_Model_Redirection' => '/core/class-wds-model-redirection.php',
|
| 26 |
+
'Smartcrawl_Model_User' => '/core/class-wds-model-user.php',
|
| 27 |
+
'Smartcrawl_Renderable' => '/core/class-wds-renderable.php',
|
| 28 |
+
'Smartcrawl_Reset' => '/core/class-wds-reset.php',
|
| 29 |
+
'Smartcrawl_Robots_Value_Helper' => '/core/class-wds-robots-value-helper.php',
|
| 30 |
+
'Smartcrawl_SeoReport' => '/core/class-wds-seo-report.php',
|
| 31 |
+
'Smartcrawl_Service' => '/core/class-wds-service.php',
|
| 32 |
+
'Smartcrawl_Settings' => '/core/class-wds-settings.php',
|
| 33 |
+
'Smartcrawl_String' => '/core/class-wds-string.php',
|
| 34 |
+
'Smartcrawl_Type_Traverser' => '/core/class-wds-type-traverser.php',
|
| 35 |
+
'Smartcrawl_WorkUnit' => '/core/class-wds-work-unit.php',
|
| 36 |
+
'Smartcrawl_Yoast_Importer' => '/core/class-wds-yoast-importer.php',
|
| 37 |
+
// Classes in includes/core/service/
|
| 38 |
+
'Smartcrawl_Checkup_Ajax_Service' => '/core/service/class-wds-checkup-ajax-service.php',
|
| 39 |
+
'Smartcrawl_Checkup_Rest_Service' => '/core/service/class-wds-checkup-rest-service.php',
|
| 40 |
+
'Smartcrawl_Checkup_Service_Implementation' => '/core/service/class-wds-checkup-service-implementation.php',
|
| 41 |
+
'Smartcrawl_Checkup_Service' => '/core/service/class-wds-checkup-service.php',
|
| 42 |
+
'Smartcrawl_Seo_Service' => '/core/service/class-wds-seo-service.php',
|
| 43 |
+
'Smartcrawl_Site_Service' => '/core/service/class-wds-site-service.php',
|
| 44 |
+
'Smartcrawl_Uptime_Service' => '/core/service/class-wds-uptime-service.php',
|
| 45 |
+
// Classes in includes/core/checks/
|
| 46 |
+
'Smartcrawl_Check_Post_Abstract' => '/core/checks/class-wds-check-post-abstract.php',
|
| 47 |
+
'Smartcrawl_Check_Abstract' => '/core/checks/class-wds-check-abstract.php',
|
| 48 |
+
'Smartcrawl_Check_Content_Length' => '/core/checks/class-wds-check-content-length.php',
|
| 49 |
+
'Smartcrawl_Check_Focus' => '/core/checks/class-wds-check-focus.php',
|
| 50 |
+
'Smartcrawl_Check_Focus_Stopwords' => '/core/checks/class-wds-check-focus-stopwords.php',
|
| 51 |
+
'Smartcrawl_Check_Imgalts_Keywords' => '/core/checks/class-wds-check-imgalts-keywords.php',
|
| 52 |
+
'Smartcrawl_Check_Keyword_Density' => '/core/checks/class-wds-check-keyword-density.php',
|
| 53 |
+
'Smartcrawl_Check_Keywords_Used' => '/core/checks/class-wds-check-keywords-used.php',
|
| 54 |
+
'Smartcrawl_Check_Links_Count' => '/core/checks/class-wds-check-links-count.php',
|
| 55 |
+
'Smartcrawl_Check_Metadesc_Keywords' => '/core/checks/class-wds-check-metadesc-keywords.php',
|
| 56 |
+
'Smartcrawl_Check_Metadesc_Length' => '/core/checks/class-wds-check-metadesc-length.php',
|
| 57 |
+
'Smartcrawl_Check_Para_Keywords' => '/core/checks/class-wds-check-para-keywords.php',
|
| 58 |
+
'Smartcrawl_Check_Slug_Keywords' => '/core/checks/class-wds-check-slug-keywords.php',
|
| 59 |
+
'Smartcrawl_Check_Subheadings_Keywords' => '/core/checks/class-wds-check-subheadings-keywords.php',
|
| 60 |
+
'Smartcrawl_Check_Title_Keywords' => '/core/checks/class-wds-check-title-keywords.php',
|
| 61 |
+
'Smartcrawl_Check_Title_Length' => '/core/checks/class-wds-check-title-length.php',
|
| 62 |
+
// Classes in includes/admin/
|
| 63 |
+
'Smartcrawl_Admin' => '/admin/admin.php',
|
| 64 |
+
'Smartcrawl_Metabox' => '/admin/metabox.php',
|
| 65 |
+
'Smartcrawl_Settings_Admin' => '/admin/settings.php',
|
| 66 |
+
'Smartcrawl_Taxonomy' => '/admin/taxonomy.php',
|
| 67 |
+
// Classes in includes/admin/settings/
|
| 68 |
+
'Smartcrawl_Autolinks_Settings' => '/admin/settings/autolinks.php',
|
| 69 |
+
'Smartcrawl_Checkup_Settings' => '/admin/settings/checkup.php',
|
| 70 |
+
'Smartcrawl_Settings_Dashboard' => '/admin/settings/dashboard.php',
|
| 71 |
+
'Smartcrawl_Onpage_Settings' => '/admin/settings/onpage.php',
|
| 72 |
+
'Smartcrawl_Settings_Settings' => '/admin/settings/settings.php',
|
| 73 |
+
'Smartcrawl_Sitemap_Settings' => '/admin/settings/sitemap.php',
|
| 74 |
+
'Smartcrawl_Social_Settings' => '/admin/settings/social.php',
|
| 75 |
+
// Classes in includes/tools/
|
| 76 |
+
'Smartcrawl_Autolinks' => '/tools/autolinks.php',
|
| 77 |
+
'Smartcrawl_OpenGraph_Printer' => '/tools/class-wds-opengraph-printer.php',
|
| 78 |
+
'Smartcrawl_Pinterest_Printer' => '/tools/class-wds-pinterest-printer.php',
|
| 79 |
+
'Smartcrawl_Schema_Printer' => '/tools/class-wds-schema-printer.php',
|
| 80 |
+
'Smartcrawl_Twitter_Printer' => '/tools/class-wds-twitter-printer.php',
|
| 81 |
+
'Smartcrawl_OnPage' => '/tools/onpage.php',
|
| 82 |
+
'Smartcrawl_Redirection_Front' => '/tools/redirect.php',
|
| 83 |
+
'Smartcrawl_Xml_Sitemap' => '/tools/sitemaps.php',
|
| 84 |
+
'Smartcrawl_Sitemaps_Dashboard_Widget' => '/tools/sitemaps-dashboard-widget.php',
|
| 85 |
+
'Smartcrawl_Xml_VideoSitemap' => '/tools/video-sitemaps.php',
|
| 86 |
+
// Classes in includes/tools/seomoz/
|
| 87 |
+
'SEOMozAPI' => '/tools/seomoz/api.php',
|
| 88 |
+
'Smartcrawl_Seomoz_Dashboard_Widget' => '/tools/seomoz/dashboard-widget.php',
|
| 89 |
+
'Smartcrawl_Seomoz_Dashboard_Widget_Renderer' => '/tools/seomoz/widget-renderer.php',
|
| 90 |
+
'Smartcrawl_Seomoz_Results' => '/tools/seomoz/results.php',
|
| 91 |
+
);
|
config.php
CHANGED
|
@@ -1,58 +1,90 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Plugin configuration constants
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
// First up, try to inherit define flags named with legacy prefix.
|
| 9 |
-
if ( file_exists( dirname( __FILE__ ) . '/config-pro.php' ) ) {
|
| 10 |
-
require_once
|
| 11 |
-
}
|
| 12 |
-
|
| 13 |
-
/*
|
| 14 |
-
By this time, any legacy defines are re-defined with new prefix.
|
| 15 |
-
We can carry on as if the new defines have been used all along.
|
| 16 |
-
*/
|
| 17 |
-
|
| 18 |
-
// you can override this in wp-config.php to enable blog-by-blog settings in multisite.
|
| 19 |
-
if ( ! defined( 'SMARTCRAWL_SITEWIDE' ) ) {
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
//
|
| 34 |
-
if ( ! defined( '
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
//
|
| 39 |
-
if ( ! defined( '
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
if ( ! defined( '
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
if ( ! defined( '
|
| 50 |
-
|
| 51 |
-
if ( ! defined( '
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Plugin configuration constants
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
// First up, try to inherit define flags named with legacy prefix.
|
| 9 |
+
if ( file_exists( dirname( __FILE__ ) . '/config-pro.php' ) ) {
|
| 10 |
+
require_once dirname( __FILE__ ) . '/config-pro.php';
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
/*
|
| 14 |
+
By this time, any legacy defines are re-defined with new prefix.
|
| 15 |
+
We can carry on as if the new defines have been used all along.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
// you can override this in wp-config.php to enable blog-by-blog settings in multisite.
|
| 19 |
+
if ( ! defined( 'SMARTCRAWL_SITEWIDE' ) ) {
|
| 20 |
+
define( 'SMARTCRAWL_SITEWIDE', get_site_option( 'wds_sitewide_mode', true ) );
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
// you can override this in wp-config.php to enable more posts in the sitemap, but you may need alot of memory.
|
| 24 |
+
if ( ! defined( 'SMARTCRAWL_SITEMAP_POST_LIMIT' ) ) {
|
| 25 |
+
define( 'SMARTCRAWL_SITEMAP_POST_LIMIT', 1000 );
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
// you can override this in wp-config.php to enable more BuddyPress groups in the sitemap, but you may need alot of memory.
|
| 29 |
+
if ( ! defined( 'SMARTCRAWL_BP_GROUPS_LIMIT' ) ) {
|
| 30 |
+
define( 'SMARTCRAWL_BP_GROUPS_LIMIT', 200 );
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
// you can override this in wp-config.php to enable more BuddyPress profiles in the sitemap, but you may need alot of memory.
|
| 34 |
+
if ( ! defined( 'SMARTCRAWL_BP_PROFILES_LIMIT' ) ) {
|
| 35 |
+
define( 'SMARTCRAWL_BP_PROFILES_LIMIT', 200 );
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
// You can override this value in wp-config.php to allow more or less time for caching SEOmoz results.
|
| 39 |
+
if ( ! defined( 'SMARTCRAWL_EXPIRE_TRANSIENT_TIMEOUT' ) ) {
|
| 40 |
+
define( 'SMARTCRAWL_EXPIRE_TRANSIENT_TIMEOUT', 3600 );
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
// You can override this value in wp-config.php to allow for longer or shorter minimum autolink requirement.
|
| 44 |
+
if ( ! defined( 'SMARTCRAWL_AUTOLINKS_DEFAULT_CHAR_LIMIT' ) ) {
|
| 45 |
+
define( 'SMARTCRAWL_AUTOLINKS_DEFAULT_CHAR_LIMIT', 3 );
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
// Suppress redundant canonicals?
|
| 49 |
+
// if ( ! defined( 'SMARTCRAWL_SUPPRESS_REDUNDANT_CANONICAL' ) ) define( 'SMARTCRAWL_SUPPRESS_REDUNDANT_CANONICAL', false );
|
| 50 |
+
// Char counting defines.
|
| 51 |
+
if ( ! defined( 'SMARTCRAWL_TITLE_LENGTH_CHAR_COUNT_LIMIT' ) ) {
|
| 52 |
+
define( 'SMARTCRAWL_TITLE_LENGTH_CHAR_COUNT_LIMIT', 70 );
|
| 53 |
+
}
|
| 54 |
+
if ( ! defined( 'SMARTCRAWL_METADESC_LENGTH_CHAR_COUNT_LIMIT' ) ) {
|
| 55 |
+
define( 'SMARTCRAWL_METADESC_LENGTH_CHAR_COUNT_LIMIT', 230 );
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
// Debugging defines.
|
| 59 |
+
if ( ! defined( 'SMARTCRAWL_SITEMAP_SKIP_IMAGES' ) ) {
|
| 60 |
+
define( 'SMARTCRAWL_SITEMAP_SKIP_IMAGES', false );
|
| 61 |
+
}
|
| 62 |
+
if ( ! defined( 'SMARTCRAWL_SITEMAP_SKIP_TAXONOMIES' ) ) {
|
| 63 |
+
define( 'SMARTCRAWL_SITEMAP_SKIP_TAXONOMIES', false );
|
| 64 |
+
}
|
| 65 |
+
if ( ! defined( 'SMARTCRAWL_SITEMAP_SKIP_SE_NOTIFICATION' ) ) {
|
| 66 |
+
define( 'SMARTCRAWL_SITEMAP_SKIP_SE_NOTIFICATION', false );
|
| 67 |
+
}
|
| 68 |
+
if ( ! defined( 'SMARTCRAWL_SITEMAP_SKIP_ADMIN_UPDATE' ) ) {
|
| 69 |
+
define( 'SMARTCRAWL_SITEMAP_SKIP_ADMIN_UPDATE', false );
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
if ( ! defined( 'SMARTCRAWL_EXPERIMENTAL_FEATURES_ON' ) ) {
|
| 73 |
+
define( 'SMARTCRAWL_EXPERIMENTAL_FEATURES_ON', false );
|
| 74 |
+
}
|
| 75 |
+
if ( ! defined( 'SMARTCRAWL_ENABLE_LOGGING' ) ) {
|
| 76 |
+
define( 'SMARTCRAWL_ENABLE_LOGGING', false );
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
if ( ! defined( 'SMARTCRAWL_WHITELABEL_ON' ) ) {
|
| 80 |
+
define( 'SMARTCRAWL_WHITELABEL_ON', false );
|
| 81 |
+
}
|
| 82 |
+
if ( ! defined( 'SMARTCRAWL_OMIT_PORT_MATCHES' ) ) {
|
| 83 |
+
define( 'SMARTCRAWL_OMIT_PORT_MATCHES', false );
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
/**
|
| 87 |
+
* Setup plugin path and url.
|
| 88 |
+
*/
|
| 89 |
+
define( 'SMARTCRAWL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) . 'includes/' );
|
| 90 |
+
define( 'SMARTCRAWL_PLUGIN_URL', plugin_dir_url( __FILE__ ) . 'includes/' );
|
includes/admin/admin.php
CHANGED
|
@@ -1,441 +1,508 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Admin side handling
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
/**
|
| 9 |
-
* Admin handling root class
|
| 10 |
-
*/
|
| 11 |
-
class Smartcrawl_Admin extends Smartcrawl_Renderable {
|
| 12 |
-
|
| 13 |
-
/**
|
| 14 |
-
* Admin page handlers
|
| 15 |
-
*
|
| 16 |
-
* @var array
|
| 17 |
-
*/
|
| 18 |
-
private $_handlers = array();
|
| 19 |
-
|
| 20 |
-
/**
|
| 21 |
-
* Constructor
|
| 22 |
-
*/
|
| 23 |
-
public function __construct() {
|
| 24 |
-
$this->init();
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
* Initializing method
|
| 29 |
-
*/
|
| 30 |
-
private function init() {
|
| 31 |
-
// Set up dash.
|
| 32 |
-
if ( file_exists( SMARTCRAWL_PLUGIN_DIR . 'external/dash/wpmudev-dash-notification.php' ) ) {
|
| 33 |
-
global $wpmudev_notices;
|
| 34 |
-
if ( ! is_array( $wpmudev_notices ) ) {
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
'
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
'smartcrawl_page_wds_onpage-network',
|
| 42 |
-
'smartcrawl_page_wds_onpage',
|
| 43 |
-
'smartcrawl_page_wds_sitemap-network',
|
| 44 |
-
'smartcrawl_page_wds_sitemap',
|
| 45 |
-
'smartcrawl_page_wds_settings-network',
|
| 46 |
-
'smartcrawl_page_wds_settings',
|
| 47 |
-
'smartcrawl_page_wds_autolinks-network',
|
| 48 |
-
'smartcrawl_page_wds_autolinks',
|
| 49 |
-
'smartcrawl_page_wds_social-network',
|
| 50 |
-
'smartcrawl_page_wds_social',
|
| 51 |
-
),
|
| 52 |
-
);
|
| 53 |
-
require_once
|
| 54 |
-
}
|
| 55 |
-
|
| 56 |
-
add_action( 'admin_init', array( $this, 'register_setting' ) );
|
| 57 |
-
add_action( 'admin_init', array( $this, 'admin_master_reset' ) );
|
| 58 |
-
add_filter( 'whitelist_options', array( $this, 'save_options' ), 20 );
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
add_action( '
|
| 62 |
-
add_action( 'wp_ajax_wds-user-search
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
if ( Smartcrawl_Settings::get_setting( '
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
*
|
| 141 |
-
*
|
| 142 |
-
* @
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
'
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
return
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
*
|
| 234 |
-
*
|
| 235 |
-
*
|
| 236 |
-
*/
|
| 237 |
-
public function
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
'
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
$
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
if (
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
$
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
$
|
| 401 |
-
$
|
| 402 |
-
$
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Admin side handling
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* Admin handling root class
|
| 10 |
+
*/
|
| 11 |
+
class Smartcrawl_Admin extends Smartcrawl_Renderable {
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* Admin page handlers
|
| 15 |
+
*
|
| 16 |
+
* @var array
|
| 17 |
+
*/
|
| 18 |
+
private $_handlers = array();
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Constructor
|
| 22 |
+
*/
|
| 23 |
+
public function __construct() {
|
| 24 |
+
$this->init();
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Initializing method
|
| 29 |
+
*/
|
| 30 |
+
private function init() {
|
| 31 |
+
// Set up dash.
|
| 32 |
+
if ( file_exists( SMARTCRAWL_PLUGIN_DIR . 'external/dash/wpmudev-dash-notification.php' ) ) {
|
| 33 |
+
global $wpmudev_notices;
|
| 34 |
+
if ( ! is_array( $wpmudev_notices ) ) {
|
| 35 |
+
$wpmudev_notices = array();
|
| 36 |
+
}
|
| 37 |
+
$wpmudev_notices[] = array(
|
| 38 |
+
'id' => 167,
|
| 39 |
+
'name' => 'SmartCrawl',
|
| 40 |
+
'screens' => array(
|
| 41 |
+
'smartcrawl_page_wds_onpage-network',
|
| 42 |
+
'smartcrawl_page_wds_onpage',
|
| 43 |
+
'smartcrawl_page_wds_sitemap-network',
|
| 44 |
+
'smartcrawl_page_wds_sitemap',
|
| 45 |
+
'smartcrawl_page_wds_settings-network',
|
| 46 |
+
'smartcrawl_page_wds_settings',
|
| 47 |
+
'smartcrawl_page_wds_autolinks-network',
|
| 48 |
+
'smartcrawl_page_wds_autolinks',
|
| 49 |
+
'smartcrawl_page_wds_social-network',
|
| 50 |
+
'smartcrawl_page_wds_social',
|
| 51 |
+
),
|
| 52 |
+
);
|
| 53 |
+
require_once SMARTCRAWL_PLUGIN_DIR . 'external/dash/wpmudev-dash-notification.php';
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
add_action( 'admin_init', array( $this, 'register_setting' ) );
|
| 57 |
+
add_action( 'admin_init', array( $this, 'admin_master_reset' ) );
|
| 58 |
+
add_filter( 'whitelist_options', array( $this, 'save_options' ), 20 );
|
| 59 |
+
add_filter( 'load-index.php', array( $this, 'enqueue_dashboard_resources' ), 20 );
|
| 60 |
+
|
| 61 |
+
add_action( 'wp_ajax_wds_dismiss_message', array( $this, 'smartcrawl_dismiss_message' ) );
|
| 62 |
+
add_action( 'wp_ajax_wds-user-search', array( $this, 'json_user_search' ) );
|
| 63 |
+
add_action( 'wp_ajax_wds-user-search-add-user', array( $this, 'json_user_search_add_user' ) );
|
| 64 |
+
|
| 65 |
+
if ( Smartcrawl_Settings::get_setting( 'extras-admin_bar' ) ) {
|
| 66 |
+
add_action( 'admin_bar_menu', array( $this, 'add_toolbar_items' ), 99 );
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
add_filter( 'plugin_action_links_' . SMARTCRAWL_PLUGIN_BASENAME, array( $this, 'add_settings_link' ) );
|
| 70 |
+
|
| 71 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 72 |
+
|
| 73 |
+
// Sanity check first!
|
| 74 |
+
if ( ! get_option( 'blog_public' ) ) {
|
| 75 |
+
add_action( 'admin_notices', array( $this, 'blog_not_public_notice' ) );
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
if ( ! empty( $smartcrawl_options['access-id'] ) && ! empty( $smartcrawl_options['secret-key'] ) ) {
|
| 79 |
+
Smartcrawl_Seomoz_Results::run();
|
| 80 |
+
Smartcrawl_Seomoz_Dashboard_Widget::run();
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
$this->_handlers['dashboard'] = Smartcrawl_Settings_Dashboard::get_instance();
|
| 84 |
+
|
| 85 |
+
if ( Smartcrawl_Settings::get_setting( 'checkup' ) ) {
|
| 86 |
+
$this->_handlers['checkup'] = Smartcrawl_Checkup_Settings::get_instance();
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
if ( Smartcrawl_Settings::get_setting( 'onpage' ) ) {
|
| 90 |
+
$this->_handlers['onpage'] = Smartcrawl_Onpage_Settings::get_instance();
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
if ( Smartcrawl_Settings::get_setting( 'social' ) ) {
|
| 94 |
+
$this->_handlers['social'] = Smartcrawl_Social_Settings::get_instance();
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
$this->_handlers['sitemap'] = Smartcrawl_Sitemap_Settings::get_instance();
|
| 98 |
+
if ( Smartcrawl_Settings::get_setting( 'sitemap' ) ) {
|
| 99 |
+
Smartcrawl_Xml_Sitemap::run();
|
| 100 |
+
Smartcrawl_Sitemaps_Dashboard_Widget::run();
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
$this->_handlers['autolinks'] = Smartcrawl_Autolinks_Settings::get_instance();
|
| 104 |
+
|
| 105 |
+
$this->_handlers['settings'] = Smartcrawl_Settings_Settings::get_instance();
|
| 106 |
+
|
| 107 |
+
Smartcrawl_Controller_Onboard::serve();
|
| 108 |
+
Smartcrawl_Controller_Analysis::serve();
|
| 109 |
+
|
| 110 |
+
if ( Smartcrawl_Settings::get_setting( 'onpage' ) ) {
|
| 111 |
+
Smartcrawl_Metabox::run();
|
| 112 |
+
Smartcrawl_Taxonomy::run();
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
/**
|
| 117 |
+
* Adds settings plugin action link
|
| 118 |
+
*
|
| 119 |
+
* @param array $links Action links list.
|
| 120 |
+
*
|
| 121 |
+
* @return array Augmented action links
|
| 122 |
+
*/
|
| 123 |
+
public function add_settings_link( $links ) {
|
| 124 |
+
if ( ! is_array( $links ) ) {
|
| 125 |
+
return $links;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
$links[] = sprintf(
|
| 129 |
+
'<a href="%s">%s</a>',
|
| 130 |
+
esc_url( add_query_arg( 'page', Smartcrawl_Settings::TAB_DASHBOARD, admin_url( 'admin.php' ) ) ),
|
| 131 |
+
esc_html( __( 'Settings', 'wds' ) )
|
| 132 |
+
);
|
| 133 |
+
|
| 134 |
+
return $links;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
/**
|
| 138 |
+
* Saves the submitted options
|
| 139 |
+
*
|
| 140 |
+
* @param mixed $whitelist_options Options.
|
| 141 |
+
*
|
| 142 |
+
* @return array
|
| 143 |
+
*/
|
| 144 |
+
public function save_options( $whitelist_options ) {
|
| 145 |
+
global $action;
|
| 146 |
+
|
| 147 |
+
$smartcrawl_pages = array(
|
| 148 |
+
'wds_settings_options',
|
| 149 |
+
'wds_autolinks_options',
|
| 150 |
+
'wds_onpage_options',
|
| 151 |
+
'wds_sitemap_options',
|
| 152 |
+
'wds_social_options',
|
| 153 |
+
'wds_redirections_options',
|
| 154 |
+
'wds_checkup_options',
|
| 155 |
+
);
|
| 156 |
+
$data = isset( $_POST['_wpnonce'], $_POST['option_page'] ) && wp_verify_nonce( $_POST['_wpnonce'], $_POST['option_page'] . '-options' )
|
| 157 |
+
? stripslashes_deep( $_POST )
|
| 158 |
+
: array();
|
| 159 |
+
|
| 160 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE && 'update' === $action && in_array( $data['option_page'], $smartcrawl_pages, true ) ) {
|
| 161 |
+
global $option_page;
|
| 162 |
+
|
| 163 |
+
check_admin_referer( $option_page . '-options' );
|
| 164 |
+
|
| 165 |
+
if ( ! isset( $whitelist_options[ $option_page ] ) ) {
|
| 166 |
+
wp_die( esc_html__( 'Error: options page not found.', 'wds' ) );
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
$options = $whitelist_options[ $option_page ];
|
| 170 |
+
|
| 171 |
+
if ( $options && is_array( $options ) ) {
|
| 172 |
+
foreach ( $options as $option ) {
|
| 173 |
+
$option = trim( $option );
|
| 174 |
+
$value = null;
|
| 175 |
+
if ( isset( $data[ $option ] ) ) {
|
| 176 |
+
$value = $data[ $option ];
|
| 177 |
+
}
|
| 178 |
+
if ( ! is_array( $value ) ) {
|
| 179 |
+
$value = trim( $value );
|
| 180 |
+
}
|
| 181 |
+
$value = stripslashes_deep( $value );
|
| 182 |
+
|
| 183 |
+
// Sanitized/validated via sanitize_option_<option_page>.
|
| 184 |
+
// See each of the admin classes validate method.
|
| 185 |
+
update_site_option( $option, $value );
|
| 186 |
+
}
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
$errors = get_settings_errors();
|
| 190 |
+
set_transient( 'wds-settings-save-errors', $errors, 30 );
|
| 191 |
+
|
| 192 |
+
$goback = add_query_arg( 'updated', 'true', wp_get_referer() );
|
| 193 |
+
wp_safe_redirect( $goback );
|
| 194 |
+
die;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
return $whitelist_options;
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
/**
|
| 201 |
+
* Admin reset options switch processing
|
| 202 |
+
*
|
| 203 |
+
* @return bool|void
|
| 204 |
+
*/
|
| 205 |
+
public function admin_master_reset() {
|
| 206 |
+
if ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) {
|
| 207 |
+
return false;
|
| 208 |
+
}
|
| 209 |
+
if ( ! is_multisite() && ! current_user_can( 'manage_options' ) ) {
|
| 210 |
+
return false;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
// phpcs:ignore
|
| 214 |
+
if ( isset( $_GET['wds-reset'] ) ) { // Simple presence switch, no value needed.
|
| 215 |
+
Smartcrawl_Reset::reset();
|
| 216 |
+
wp_safe_redirect( add_query_arg( 'wds-reset-reload', 'true', remove_query_arg( 'wds-reset' ) ) );
|
| 217 |
+
die;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
// phpcs:ignore
|
| 221 |
+
if ( isset( $_GET['wds-reset-reload'] ) ) { // Simple presence switch, no value needed.
|
| 222 |
+
wp_safe_redirect( remove_query_arg( 'wds-reset-reload' ) );
|
| 223 |
+
die;
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
return false;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
/**
|
| 230 |
+
* Brute-register all the settings.
|
| 231 |
+
*
|
| 232 |
+
* If we got this far, this is a sane thing to do.
|
| 233 |
+
* This overrides the `Smartcrawl_Core_Admin::register_setting()`.
|
| 234 |
+
*
|
| 235 |
+
* In response to "Unable to save options multiple times" bug.
|
| 236 |
+
*/
|
| 237 |
+
public function register_setting() {
|
| 238 |
+
register_setting( 'wds_settings_options', 'wds_settings_options', array(
|
| 239 |
+
$this->get_handler( 'settings' ),
|
| 240 |
+
'validate',
|
| 241 |
+
) );
|
| 242 |
+
register_setting( 'wds_sitemap_options', 'wds_sitemap_options', array(
|
| 243 |
+
$this->get_handler( 'sitemap' ),
|
| 244 |
+
'validate',
|
| 245 |
+
) );
|
| 246 |
+
register_setting( 'wds_onpage_options', 'wds_onpage_options', array(
|
| 247 |
+
$this->get_handler( 'onpage' ),
|
| 248 |
+
'validate',
|
| 249 |
+
) );
|
| 250 |
+
register_setting( 'wds_social_options', 'wds_social_options', array(
|
| 251 |
+
$this->get_handler( 'social' ),
|
| 252 |
+
'validate',
|
| 253 |
+
) );
|
| 254 |
+
register_setting( 'wds_autolinks_options', 'wds_autolinks_options', array(
|
| 255 |
+
$this->get_handler( 'autolinks' ),
|
| 256 |
+
'validate',
|
| 257 |
+
) );
|
| 258 |
+
register_setting( 'wds_redirections_options', 'wds_redirections_options', array(
|
| 259 |
+
$this->get_handler( 'redirections' ),
|
| 260 |
+
'validate',
|
| 261 |
+
) );
|
| 262 |
+
register_setting( 'wds_checkup_options', 'wds_checkup_options', array(
|
| 263 |
+
$this->get_handler( 'checkup' ),
|
| 264 |
+
'validate',
|
| 265 |
+
) );
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
/**
|
| 269 |
+
* Admin page handler getter
|
| 270 |
+
*
|
| 271 |
+
* @param string $hndl Handler to get.
|
| 272 |
+
*
|
| 273 |
+
* @return object Handler
|
| 274 |
+
*/
|
| 275 |
+
public function get_handler( $hndl ) {
|
| 276 |
+
return isset( $this->_handlers[ $hndl ] )
|
| 277 |
+
? $this->_handlers[ $hndl ]
|
| 278 |
+
: $this;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
/**
|
| 282 |
+
* Adds admin toolbar items
|
| 283 |
+
*
|
| 284 |
+
* @param object $admin_bar Admin toolbar object.
|
| 285 |
+
*
|
| 286 |
+
* @return bool
|
| 287 |
+
*/
|
| 288 |
+
public function add_toolbar_items( $admin_bar ) {
|
| 289 |
+
if ( empty( $admin_bar ) || ! function_exists( 'is_admin_bar_showing' ) ) {
|
| 290 |
+
return false;
|
| 291 |
+
}
|
| 292 |
+
if ( ! is_admin_bar_showing() ) {
|
| 293 |
+
return false;
|
| 294 |
+
}
|
| 295 |
+
if ( ! apply_filters( 'wds-admin-ui-show_bar', true ) ) {
|
| 296 |
+
return false;
|
| 297 |
+
}
|
| 298 |
+
// Do not show if sitewide and we're not super admin.
|
| 299 |
+
if ( smartcrawl_is_switch_active( 'SMARTCRAWL_SITEWIDE' ) && ! is_super_admin() ) {
|
| 300 |
+
return false;
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
$optional_nodes = array();
|
| 304 |
+
foreach ( $this->_handlers as $handler ) {
|
| 305 |
+
if ( empty( $handler ) || empty( $handler->slug ) ) {
|
| 306 |
+
continue;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
if ( ! $this->is_admin_bar_node_allowed( $handler->slug ) ) {
|
| 310 |
+
continue;
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
$optional_nodes[] = $this->create_admin_bar_node( $handler->slug, $handler->title );
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
if ( ! empty( $optional_nodes ) ) {
|
| 317 |
+
$admin_bar->add_node( $this->create_admin_bar_node( Smartcrawl_Settings::TAB_DASHBOARD, __( 'SmartCrawl', 'wds' ) ) );
|
| 318 |
+
$admin_bar->add_node( $this->create_admin_bar_node( Smartcrawl_Settings::TAB_DASHBOARD . '_dashboard', __( 'Dashboard', 'wds' ), Smartcrawl_Settings::TAB_DASHBOARD ) );
|
| 319 |
+
foreach ( $optional_nodes as $optional_node ) {
|
| 320 |
+
$admin_bar->add_node( $optional_node );
|
| 321 |
+
}
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
return true;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
private function is_admin_bar_node_allowed( $slug ) {
|
| 328 |
+
// If sitewide is off
|
| 329 |
+
if ( ! smartcrawl_is_switch_active( 'SMARTCRAWL_SITEWIDE' ) && is_multisite() ) {
|
| 330 |
+
if (
|
| 331 |
+
// and this is network admin then pages other than the settings page are not allowed
|
| 332 |
+
( is_network_admin() && Smartcrawl_Settings::TAB_SETTINGS !== $slug )
|
| 333 |
+
// if this is a sub-site then the page is not allowed if it is disabled in the settings
|
| 334 |
+
|| ( ! is_network_admin() && ! Smartcrawl_Settings_Admin::is_tab_allowed( $slug ) )
|
| 335 |
+
) {
|
| 336 |
+
return false;
|
| 337 |
+
}
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
return true;
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
private function create_admin_bar_node( $id, $title, $slug = '' ) {
|
| 344 |
+
$node = array(
|
| 345 |
+
'id' => $id,
|
| 346 |
+
'title' => $title,
|
| 347 |
+
'href' => sprintf(
|
| 348 |
+
'%s?page=%s',
|
| 349 |
+
smartcrawl_is_switch_active( 'SMARTCRAWL_SITEWIDE' ) ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ),
|
| 350 |
+
empty( $slug ) ? $id : $slug
|
| 351 |
+
),
|
| 352 |
+
);
|
| 353 |
+
|
| 354 |
+
if ( Smartcrawl_Settings::TAB_DASHBOARD !== $id ) {
|
| 355 |
+
$node['parent'] = Smartcrawl_Settings::TAB_DASHBOARD;
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
return $node;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
/**
|
| 362 |
+
* Validate user data for some/all of your input fields
|
| 363 |
+
*
|
| 364 |
+
* @param mixed $input Raw input.
|
| 365 |
+
*/
|
| 366 |
+
public function validate( $input ) {
|
| 367 |
+
return $input; // return validated input.
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
/**
|
| 371 |
+
* Shows blog not being public notice.
|
| 372 |
+
*/
|
| 373 |
+
public function blog_not_public_notice() {
|
| 374 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
| 375 |
+
return false;
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
$message = sprintf(
|
| 379 |
+
'%1$s <a href="%3$s">%2$s</a>',
|
| 380 |
+
esc_html__( 'This site discourages search engines from indexing the pages, which will affect your SEO efforts.', 'wds' ),
|
| 381 |
+
esc_html__( 'You can fix this here', 'wds' ),
|
| 382 |
+
admin_url( '/options-reading.php' )
|
| 383 |
+
);
|
| 384 |
+
|
| 385 |
+
echo '<div class="notice-error notice is-dismissible"><p>' . wp_kses_post( $message ) . '</p></div>';
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
/**
|
| 389 |
+
* Process message dismissal request
|
| 390 |
+
*/
|
| 391 |
+
public function smartcrawl_dismiss_message() {
|
| 392 |
+
$data = $this->get_request_data();
|
| 393 |
+
$message = sanitize_key( smartcrawl_get_array_value( $data, 'message' ) );
|
| 394 |
+
if ( null === $message ) {
|
| 395 |
+
wp_send_json_error();
|
| 396 |
+
|
| 397 |
+
return;
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
$dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
|
| 401 |
+
$dismissed_messages = '' === $dismissed_messages ? array() : $dismissed_messages;
|
| 402 |
+
$dismissed_messages[ $message ] = true;
|
| 403 |
+
update_user_meta( get_current_user_id(), 'wds_dismissed_messages', $dismissed_messages );
|
| 404 |
+
wp_send_json_success();
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
/**
|
| 408 |
+
* Process user search requests
|
| 409 |
+
*/
|
| 410 |
+
public function json_user_search() {
|
| 411 |
+
$result = array( 'success' => false );
|
| 412 |
+
if ( ! current_user_can( 'edit_users' ) ) {
|
| 413 |
+
wp_send_json( $result );
|
| 414 |
+
die;
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
$params = $this->get_request_data();
|
| 418 |
+
$query = sanitize_text_field( smartcrawl_get_array_value( $params, 'query' ) );
|
| 419 |
+
|
| 420 |
+
if ( ! $query ) {
|
| 421 |
+
wp_send_json( $result );
|
| 422 |
+
die();
|
| 423 |
+
}
|
| 424 |
+
|
| 425 |
+
$users = get_users( array(
|
| 426 |
+
'search' => '*' . $params['query'] . '*',
|
| 427 |
+
'fields' => 'all_with_meta',
|
| 428 |
+
) );
|
| 429 |
+
|
| 430 |
+
$return_users = array();
|
| 431 |
+
foreach ( $users as $user ) {
|
| 432 |
+
$return_users[] = array(
|
| 433 |
+
'id' => $user->get( 'ID' ),
|
| 434 |
+
'text' => $user->get( 'display_name' ),
|
| 435 |
+
);
|
| 436 |
+
}
|
| 437 |
+
$result['items'] = $return_users;
|
| 438 |
+
|
| 439 |
+
wp_send_json( $result );
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
/**
|
| 443 |
+
* Handles user search requests
|
| 444 |
+
*/
|
| 445 |
+
public function json_user_search_add_user() {
|
| 446 |
+
$result = array( 'success' => false );
|
| 447 |
+
if ( ! current_user_can( 'edit_users' ) ) {
|
| 448 |
+
wp_send_json( $result );
|
| 449 |
+
die;
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
$params = $this->get_request_data();
|
| 453 |
+
|
| 454 |
+
$option_name = sanitize_key( smartcrawl_get_array_value( $params, 'option_name' ) );
|
| 455 |
+
$users_key = sanitize_key( smartcrawl_get_array_value( $params, 'users_key' ) );
|
| 456 |
+
$new_user_key = sanitize_key( smartcrawl_get_array_value( $params, 'new_user_key' ) );
|
| 457 |
+
|
| 458 |
+
$user_search_options = smartcrawl_get_array_value( $params, $option_name );
|
| 459 |
+
$email_recipients = smartcrawl_get_array_value( $user_search_options, $users_key );
|
| 460 |
+
$new_user = sanitize_text_field( smartcrawl_get_array_value( $user_search_options, $new_user_key ) );
|
| 461 |
+
|
| 462 |
+
if ( null === $new_user ) {
|
| 463 |
+
wp_send_json( $result );
|
| 464 |
+
|
| 465 |
+
return;
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
if ( ! is_array( $email_recipients ) ) {
|
| 469 |
+
$email_recipients = array();
|
| 470 |
+
} else {
|
| 471 |
+
$email_recipients = array_filter( array_map( 'sanitize_text_field', $email_recipients ) );
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
if ( ! in_array( $new_user, $email_recipients, true ) ) {
|
| 475 |
+
$email_recipients[] = $new_user;
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
$new_markup = $this->_load( 'user-search', array(
|
| 479 |
+
'users' => $email_recipients,
|
| 480 |
+
'option_name' => $option_name,
|
| 481 |
+
'users_key' => $users_key,
|
| 482 |
+
'new_user_key' => $new_user_key,
|
| 483 |
+
) );
|
| 484 |
+
|
| 485 |
+
$result['user_search'] = $new_markup;
|
| 486 |
+
$result['success'] = true;
|
| 487 |
+
|
| 488 |
+
wp_send_json( $result );
|
| 489 |
+
}
|
| 490 |
+
|
| 491 |
+
public function enqueue_dashboard_resources() {
|
| 492 |
+
wp_enqueue_style( 'wds-wp-dashboard', SMARTCRAWL_PLUGIN_URL . 'css/wp-dashboard.css', array(), Smartcrawl_Loader::get_version() );
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
/**
|
| 496 |
+
* Gets inherited view defaults
|
| 497 |
+
*/
|
| 498 |
+
protected function _get_view_defaults() {
|
| 499 |
+
return array();
|
| 500 |
+
}
|
| 501 |
+
|
| 502 |
+
private function get_request_data() {
|
| 503 |
+
return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-admin-nonce' ) ? stripslashes_deep( $_POST ) : array();
|
| 504 |
+
}
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
$smartcrawl_admin = new Smartcrawl_Admin();
|
| 508 |
+
|
includes/admin/index.php
CHANGED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile
|
includes/admin/metabox.php
CHANGED
|
@@ -1,478 +1,571 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Metabox main class
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
*
|
| 17 |
-
*/
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
)
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
'
|
| 124 |
-
'
|
| 125 |
-
'
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
'
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
'
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
);
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
$
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
}
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
$
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
'
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
$
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
$
|
| 341 |
-
if (
|
| 342 |
-
$
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
*
|
| 387 |
-
*
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
}
|
| 397 |
-
|
| 398 |
-
/**
|
| 399 |
-
*
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
'
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Metabox main class
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* Metabox rendering / handling class
|
| 10 |
+
*/
|
| 11 |
+
class Smartcrawl_Metabox extends Smartcrawl_Renderable {
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* Static instance
|
| 15 |
+
*
|
| 16 |
+
* @var Smartcrawl_Metabox
|
| 17 |
+
*/
|
| 18 |
+
private static $_instance;
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* State flag
|
| 22 |
+
*
|
| 23 |
+
* @var bool
|
| 24 |
+
*/
|
| 25 |
+
private $_is_running = false;
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Constructor
|
| 29 |
+
*/
|
| 30 |
+
public function __construct() {
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Boot the hooking part
|
| 35 |
+
*/
|
| 36 |
+
public static function run() {
|
| 37 |
+
self::get()->_add_hooks();
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
public function _add_hooks() {
|
| 41 |
+
if ( $this->_is_running ) {
|
| 42 |
+
return false;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
// WPSC integration.
|
| 46 |
+
add_action( 'wpsc_edit_product', array( $this, 'rebuild_sitemap' ) );
|
| 47 |
+
add_action( 'wpsc_rate_product', array( $this, 'rebuild_sitemap' ) );
|
| 48 |
+
|
| 49 |
+
add_action( 'admin_menu', array( $this, 'smartcrawl_create_meta_box' ) );
|
| 50 |
+
|
| 51 |
+
add_action( 'save_post', array( $this, 'smartcrawl_save_postdata' ) );
|
| 52 |
+
add_filter( 'attachment_fields_to_save', array( $this, 'smartcrawl_save_attachment_postdata' ) );
|
| 53 |
+
|
| 54 |
+
add_filter( 'manage_pages_columns', array( $this, 'smartcrawl_page_title_column_heading' ), 10, 1 );
|
| 55 |
+
add_filter( 'manage_posts_columns', array( $this, 'smartcrawl_page_title_column_heading' ), 10, 1 );
|
| 56 |
+
|
| 57 |
+
add_action( 'manage_pages_custom_column', array( $this, 'smartcrawl_page_title_column_content' ), 10, 2 );
|
| 58 |
+
add_action( 'manage_posts_custom_column', array( $this, 'smartcrawl_page_title_column_content' ), 10, 2 );
|
| 59 |
+
|
| 60 |
+
add_action( 'quick_edit_custom_box', array( $this, 'smartcrawl_quick_edit_dispatch' ), 10, 2 );
|
| 61 |
+
add_action( 'admin_footer-edit.php', array( $this, 'smartcrawl_quick_edit_javascript' ) );
|
| 62 |
+
add_action( 'wp_ajax_wds_get_meta_fields', array( $this, 'json_wds_postmeta' ) );
|
| 63 |
+
add_action( 'wp_ajax_wds_metabox_update', array( $this, 'smartcrawl_metabox_live_update' ) );
|
| 64 |
+
|
| 65 |
+
add_action( 'admin_print_scripts-post.php', array( $this, 'js_load_scripts' ) );
|
| 66 |
+
add_action( 'admin_print_scripts-post-new.php', array( $this, 'js_load_scripts' ) );
|
| 67 |
+
add_action( 'wp_ajax_wds-metabox-preview', array( $this, 'json_create_preview' ) );
|
| 68 |
+
|
| 69 |
+
$this->_is_running = true;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
/**
|
| 73 |
+
* Static instance getter
|
| 74 |
+
*/
|
| 75 |
+
public static function get() {
|
| 76 |
+
if ( empty( self::$_instance ) ) {
|
| 77 |
+
self::$_instance = new self();
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
return self::$_instance;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* Handles preview asking requests
|
| 85 |
+
*/
|
| 86 |
+
public function json_create_preview() {
|
| 87 |
+
$data = $this->get_request_data();
|
| 88 |
+
$title = sanitize_text_field( smartcrawl_get_array_value( $data, 'title' ) );
|
| 89 |
+
$description = sanitize_text_field( smartcrawl_get_array_value( $data, 'description' ) );
|
| 90 |
+
$post_id = (int) smartcrawl_get_array_value( $data, 'post_id' );
|
| 91 |
+
$result = array( 'success' => false );
|
| 92 |
+
|
| 93 |
+
if ( is_null( $title ) || is_null( $description ) || empty( $post_id ) ) {
|
| 94 |
+
wp_send_json( $result );
|
| 95 |
+
|
| 96 |
+
return;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
$latest_post_version = smartcrawl_get_latest_post_version( $post_id );
|
| 100 |
+
$result['success'] = true;
|
| 101 |
+
$result['markup'] = $this->_load( 'metabox/metabox-preview', array(
|
| 102 |
+
'post' => $latest_post_version,
|
| 103 |
+
'title' => $title,
|
| 104 |
+
'description' => $description,
|
| 105 |
+
) );
|
| 106 |
+
|
| 107 |
+
wp_send_json( $result );
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
/**
|
| 111 |
+
* Enqueues frontend dependencies
|
| 112 |
+
*/
|
| 113 |
+
public function js_load_scripts() {
|
| 114 |
+
$options = Smartcrawl_Settings::get_options();
|
| 115 |
+
$version = Smartcrawl_Loader::get_version();
|
| 116 |
+
|
| 117 |
+
wp_enqueue_script( 'wds_metabox_counter', SMARTCRAWL_PLUGIN_URL . '/js/wds-metabox-counter.js', array(), $version );
|
| 118 |
+
wp_localize_script( 'wds_metabox_counter', 'l10nWdsCounters', array(
|
| 119 |
+
'title_length' => __( '{TOTAL_LEFT} characters left', 'wds' ),
|
| 120 |
+
'title_longer' => __( 'Over {MAX_COUNT} characters ({CURRENT_COUNT})', 'wds' ),
|
| 121 |
+
'main_title_longer' => __( 'Over {MAX_COUNT} characters ({CURRENT_COUNT}) - make sure your SEO title is shorter', 'wds' ),
|
| 122 |
+
|
| 123 |
+
'title_limit' => SMARTCRAWL_TITLE_LENGTH_CHAR_COUNT_LIMIT,
|
| 124 |
+
'metad_limit' => SMARTCRAWL_METADESC_LENGTH_CHAR_COUNT_LIMIT,
|
| 125 |
+
'main_title_warning' => ! ( defined( 'SMARTCRAWL_MAIN_TITLE_LENGTH_WARNING_HIDE' ) && SMARTCRAWL_MAIN_TITLE_LENGTH_WARNING_HIDE ),
|
| 126 |
+
'lax_enforcement' => ( isset( $options['metabox-lax_enforcement'] ) ? ! ! $options['metabox-lax_enforcement'] : false ),
|
| 127 |
+
) );
|
| 128 |
+
Smartcrawl_Settings_Admin::register_global_admin_scripts();
|
| 129 |
+
wp_enqueue_script( 'wds_metabox_onpage', SMARTCRAWL_PLUGIN_URL . '/js/wds-metabox.js', array( 'wds-select2' ), $version );
|
| 130 |
+
wp_localize_script( 'wds_metabox_onpage', '_wds_metabox', array(
|
| 131 |
+
'nonce' => wp_create_nonce( 'wds-metabox-nonce' ),
|
| 132 |
+
) );
|
| 133 |
+
wp_localize_script( 'wds_metabox_onpage', 'l10nWdsMetabox', array(
|
| 134 |
+
'content_analysis_working' => __( 'Analyzing content, please wait a few moments', 'wds' ),
|
| 135 |
+
) );
|
| 136 |
+
|
| 137 |
+
Smartcrawl_Settings_Admin::enqueue_shared_ui( false );
|
| 138 |
+
|
| 139 |
+
wp_enqueue_script( 'wds-admin-opengraph' );
|
| 140 |
+
wp_enqueue_style( 'wds-admin-opengraph' );
|
| 141 |
+
wp_enqueue_style( 'wds-select2' );
|
| 142 |
+
wp_enqueue_style( 'wds-app' );
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
/**
|
| 146 |
+
* Handles page body class
|
| 147 |
+
*
|
| 148 |
+
* @param string $string Body classes this far.
|
| 149 |
+
*
|
| 150 |
+
* @return string
|
| 151 |
+
*/
|
| 152 |
+
public function admin_body_class( $string ) {
|
| 153 |
+
return str_replace( 'wpmud', '', $string );
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* Handles actual metabox rendering
|
| 158 |
+
*/
|
| 159 |
+
public function smartcrawl_meta_boxes() {
|
| 160 |
+
global $post;
|
| 161 |
+
|
| 162 |
+
$robots_noindex_value = (int) smartcrawl_get_value( 'meta-robots-noindex' );
|
| 163 |
+
$robots_nofollow_value = (int) smartcrawl_get_value( 'meta-robots-nofollow' );
|
| 164 |
+
$robots_index_value = (int) smartcrawl_get_value( 'meta-robots-index' );
|
| 165 |
+
$robots_follow_value = (int) smartcrawl_get_value( 'meta-robots-follow' );
|
| 166 |
+
$advanced_value = explode( ',', smartcrawl_get_value( 'meta-robots-adv' ) );
|
| 167 |
+
$advanced_options = array(
|
| 168 |
+
'noodp' => __( 'NO ODP (Block Open Directory Project description of the page)', 'wds' ),
|
| 169 |
+
'noydir' => __( 'NO YDIR (Don\'t display the Yahoo! Directory titles and abstracts)', 'wds' ),
|
| 170 |
+
'noarchive' => __( 'No Archive', 'wds' ),
|
| 171 |
+
'nosnippet' => __( 'No Snippet', 'wds' ),
|
| 172 |
+
);
|
| 173 |
+
$sitemap_priority_options = array(
|
| 174 |
+
'' => __( 'Automatic prioritization', 'wds' ),
|
| 175 |
+
'1' => __( '1 - Highest priority', 'wds' ),
|
| 176 |
+
'0.9' => '0.9',
|
| 177 |
+
'0.8' => '0.8 - ' . __( 'High priority (root pages default)', 'wds' ),
|
| 178 |
+
'0.7' => '0.7',
|
| 179 |
+
'0.6' => '0.6 - ' . __( 'Secondary priority (subpages default)', 'wds' ),
|
| 180 |
+
'0.5' => '0.5 - ' . __( 'Medium priority', 'wds' ),
|
| 181 |
+
'0.4' => '0.4',
|
| 182 |
+
'0.3' => '0.3',
|
| 183 |
+
'0.2' => '0.2',
|
| 184 |
+
'0.1' => '0.1 - ' . __( 'Lowest priority', 'wds' ),
|
| 185 |
+
);
|
| 186 |
+
|
| 187 |
+
$this->_render( 'metabox/metabox-main', array(
|
| 188 |
+
'post' => $post,
|
| 189 |
+
'robots_noindex_value' => $robots_noindex_value,
|
| 190 |
+
'robots_nofollow_value' => $robots_nofollow_value,
|
| 191 |
+
'robots_index_value' => $robots_index_value,
|
| 192 |
+
'robots_follow_value' => $robots_follow_value,
|
| 193 |
+
'advanced_value' => $advanced_value,
|
| 194 |
+
'advanced_options' => $advanced_options,
|
| 195 |
+
'sitemap_priority_options' => $sitemap_priority_options,
|
| 196 |
+
) );
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
/**
|
| 200 |
+
* Adds the metabox to the queue
|
| 201 |
+
*/
|
| 202 |
+
public function smartcrawl_create_meta_box() {
|
| 203 |
+
$show = user_can_see_seo_metabox();
|
| 204 |
+
if ( function_exists( 'add_meta_box' ) ) {
|
| 205 |
+
$metabox_title = is_multisite() ? __( 'SmartCrawl', 'wds' ) : 'SmartCrawl'; // Show branding for singular installs.
|
| 206 |
+
foreach ( get_post_types() as $posttype ) {
|
| 207 |
+
if ( $show ) {
|
| 208 |
+
add_meta_box( 'wds-wds-meta-box', $metabox_title, array(
|
| 209 |
+
&$this,
|
| 210 |
+
'smartcrawl_meta_boxes',
|
| 211 |
+
), $posttype, 'normal', 'high' );
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
/**
|
| 218 |
+
* Handles attachment metadata saving
|
| 219 |
+
*
|
| 220 |
+
* @param array $data Data to save.
|
| 221 |
+
*
|
| 222 |
+
* @return array
|
| 223 |
+
*/
|
| 224 |
+
public function smartcrawl_save_attachment_postdata( $data ) {
|
| 225 |
+
$request_data = $this->get_request_data();
|
| 226 |
+
if ( empty( $request_data ) || empty( $data['post_ID'] ) || ! is_numeric( $data['post_ID'] ) ) {
|
| 227 |
+
return $data;
|
| 228 |
+
}
|
| 229 |
+
$this->smartcrawl_save_postdata( (int) $data['post_ID'] );
|
| 230 |
+
|
| 231 |
+
return $data;
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
private function get_post() {
|
| 235 |
+
global $post;
|
| 236 |
+
|
| 237 |
+
return $post;
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
/**
|
| 241 |
+
* Saves submitted metabox POST data
|
| 242 |
+
*
|
| 243 |
+
* @param int $post_id Post ID.
|
| 244 |
+
*
|
| 245 |
+
* @return bool
|
| 246 |
+
*/
|
| 247 |
+
public function smartcrawl_save_postdata( $post_id ) {
|
| 248 |
+
$request_data = $this->get_request_data();
|
| 249 |
+
if ( ! $post_id || empty( $request_data ) ) {
|
| 250 |
+
return;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
$post = $this->get_post();
|
| 254 |
+
if ( empty( $post ) ) {
|
| 255 |
+
$post = get_post( $post_id );
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
$all_options = Smartcrawl_Settings::get_options();
|
| 259 |
+
$post_type_noindexed = (bool) smartcrawl_get_array_value( $all_options, sprintf( 'meta_robots-noindex-%s', get_post_type( $post ) ) );
|
| 260 |
+
$post_type_nofollowed = (bool) smartcrawl_get_array_value( $all_options, sprintf( 'meta_robots-nofollow-%s', get_post_type( $post ) ) );
|
| 261 |
+
|
| 262 |
+
// Determine posted type.
|
| 263 |
+
$post_type_rq = ! empty( $request_data['post_type'] ) ? sanitize_key( $request_data['post_type'] ) : false;
|
| 264 |
+
if ( 'page' === $post_type_rq && ! current_user_can( 'edit_page', $post_id ) ) {
|
| 265 |
+
return $post_id;
|
| 266 |
+
} elseif ( ! current_user_can( 'edit_post', $post_id ) ) {
|
| 267 |
+
return $post_id;
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
$ptype = ! empty( $post_type_rq )
|
| 271 |
+
? $post_type_rq
|
| 272 |
+
: ( ! empty( $post->post_type ) ? $post->post_type : false );
|
| 273 |
+
// Do not process post stuff for non-public post types.
|
| 274 |
+
if ( ! in_array( $ptype, get_post_types( array( 'public' => true ) ), true ) ) {
|
| 275 |
+
return $post_id;
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
if ( ! empty( $request_data['wds-opengraph'] ) ) {
|
| 279 |
+
$input = stripslashes_deep( $request_data['wds-opengraph'] );
|
| 280 |
+
$result = array();
|
| 281 |
+
|
| 282 |
+
$result['disabled'] = ! empty( $input['disabled'] );
|
| 283 |
+
if ( ! empty( $input['title'] ) ) {
|
| 284 |
+
$result['title'] = sanitize_text_field( $input['title'] );
|
| 285 |
+
}
|
| 286 |
+
if ( ! empty( $input['description'] ) ) {
|
| 287 |
+
$result['description'] = sanitize_text_field( $input['description'] );
|
| 288 |
+
}
|
| 289 |
+
if ( ! empty( $input['images'] ) && is_array( $input['images'] ) ) {
|
| 290 |
+
$result['images'] = array();
|
| 291 |
+
foreach ( $input['images'] as $img ) {
|
| 292 |
+
$img = esc_url_raw( $img );
|
| 293 |
+
$result['images'][] = $img;
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
if ( ! empty( $result ) ) {
|
| 298 |
+
update_post_meta( $post_id, '_wds_opengraph', $result );
|
| 299 |
+
}
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
if ( ! empty( $request_data['wds-twitter'] ) ) {
|
| 303 |
+
$input = stripslashes_deep( $request_data['wds-twitter'] );
|
| 304 |
+
$twitter = array();
|
| 305 |
+
|
| 306 |
+
$twitter['disabled'] = ! empty( $input['disabled'] );
|
| 307 |
+
if ( ! empty( $input['title'] ) ) {
|
| 308 |
+
$twitter['title'] = sanitize_text_field( $input['title'] );
|
| 309 |
+
}
|
| 310 |
+
if ( ! empty( $input['description'] ) ) {
|
| 311 |
+
$twitter['description'] = sanitize_text_field( $input['description'] );
|
| 312 |
+
}
|
| 313 |
+
if ( ! empty( $input['images'] ) && is_array( $input['images'] ) ) {
|
| 314 |
+
$twitter['images'] = array();
|
| 315 |
+
foreach ( $input['images'] as $img ) {
|
| 316 |
+
$img = esc_url_raw( $img );
|
| 317 |
+
$twitter['images'][] = $img;
|
| 318 |
+
}
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
if ( ! empty( $twitter ) ) {
|
| 322 |
+
update_post_meta( $post_id, '_wds_twitter', $twitter );
|
| 323 |
+
}
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
if ( isset( $request_data['wds_focus'] ) ) {
|
| 327 |
+
$focus = stripslashes_deep( $request_data['wds_focus'] );
|
| 328 |
+
update_post_meta( $post_id, '_wds_focus-keywords', sanitize_text_field( $focus ) );
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
foreach ( $request_data as $key => $value ) {
|
| 332 |
+
if ( in_array( $key, array( 'wds-opengraph', 'wds_focus', 'wds-twitter' ), true ) ) {
|
| 333 |
+
continue;
|
| 334 |
+
} // We already handled those.
|
| 335 |
+
if ( ! preg_match( '/^wds_/', $key ) ) {
|
| 336 |
+
continue;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
$id = "_{$key}";
|
| 340 |
+
$data = $value;
|
| 341 |
+
if ( is_array( $value ) ) {
|
| 342 |
+
$data = join( ',', $value );
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
if ( $data ) {
|
| 346 |
+
$value = in_array( $key, array( 'wds_canonical', 'wds_redirect' ), true )
|
| 347 |
+
? esc_url_raw( $data )
|
| 348 |
+
: sanitize_text_field( $data );
|
| 349 |
+
update_post_meta( $post_id, $id, $value );
|
| 350 |
+
} else {
|
| 351 |
+
delete_post_meta( $post_id, $id );
|
| 352 |
+
}
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
/**
|
| 356 |
+
* If the user un-checks a checkbox and saves the post, the value for that checkbox will not be included inside $_POST array
|
| 357 |
+
* so we may have to delete the corresponding meta value manually.
|
| 358 |
+
*/
|
| 359 |
+
$checkbox_meta_items = array(
|
| 360 |
+
'wds_tags_to_keywords',
|
| 361 |
+
'wds_meta-robots-adv',
|
| 362 |
+
'wds_autolinks-exclude',
|
| 363 |
+
);
|
| 364 |
+
$checkbox_meta_items[] = $post_type_nofollowed ? 'wds_meta-robots-follow' : 'wds_meta-robots-nofollow';
|
| 365 |
+
$checkbox_meta_items[] = $post_type_noindexed ? 'wds_meta-robots-index' : 'wds_meta-robots-noindex';
|
| 366 |
+
foreach ( $checkbox_meta_items as $item ) {
|
| 367 |
+
if ( ! isset( $request_data[ $item ] ) ) {
|
| 368 |
+
delete_post_meta( $post_id, "_{$item}" );
|
| 369 |
+
}
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
do_action( 'wds_saved_postdata' );
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
/**
|
| 376 |
+
* Handles sitemap rebuilding
|
| 377 |
+
*/
|
| 378 |
+
public function rebuild_sitemap() {
|
| 379 |
+
Smartcrawl_Xml_Sitemap::get()->generate_sitemap();
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
/**
|
| 383 |
+
* Adds title and robots columns to post listing page
|
| 384 |
+
*
|
| 385 |
+
* @param array $columns Post list columns.
|
| 386 |
+
*
|
| 387 |
+
* @return array
|
| 388 |
+
*/
|
| 389 |
+
public function smartcrawl_page_title_column_heading( $columns ) {
|
| 390 |
+
return array_merge(
|
| 391 |
+
array_slice( $columns, 0, 2 ),
|
| 392 |
+
array( 'page-title' => __( 'Title Tag', 'wds' ) ),
|
| 393 |
+
array_slice( $columns, 2, 6 ),
|
| 394 |
+
array( 'page-meta-robots' => __( 'Robots Meta', 'wds' ) )
|
| 395 |
+
);
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
/**
|
| 399 |
+
* Puts out actual column bodies
|
| 400 |
+
*
|
| 401 |
+
* @param string $column_name Column ID.
|
| 402 |
+
* @param int $id Post ID.
|
| 403 |
+
*
|
| 404 |
+
* @return void
|
| 405 |
+
*/
|
| 406 |
+
public function smartcrawl_page_title_column_content( $column_name, $id ) {
|
| 407 |
+
if ( 'page-title' === $column_name ) {
|
| 408 |
+
echo esc_html( $this->smartcrawl_page_title( $id ) );
|
| 409 |
+
|
| 410 |
+
// Show any 301 redirects.
|
| 411 |
+
$redirect = smartcrawl_get_value( 'redirect', $id );
|
| 412 |
+
if ( ! empty( $redirect ) ) {
|
| 413 |
+
$href = $redirect;
|
| 414 |
+
$link = "<a href='{$href}' target='_blank'>{$href}</a>";
|
| 415 |
+
echo '<br /><em>' . sprintf( esc_html( __( 'Redirects to %s', 'wds' ) ), esc_url( $href ) ) . '</em>';
|
| 416 |
+
}
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
if ( 'page-meta-robots' === $column_name ) {
|
| 420 |
+
$meta_robots_arr = array(
|
| 421 |
+
( smartcrawl_get_value( 'meta-robots-noindex', $id ) ? 'noindex' : 'index' ),
|
| 422 |
+
( smartcrawl_get_value( 'meta-robots-nofollow', $id ) ? 'nofollow' : 'follow' ),
|
| 423 |
+
);
|
| 424 |
+
$meta_robots = join( ',', $meta_robots_arr );
|
| 425 |
+
if ( empty( $meta_robots ) ) {
|
| 426 |
+
$meta_robots = 'index,follow';
|
| 427 |
+
}
|
| 428 |
+
echo esc_html( ucwords( str_replace( ',', ', ', $meta_robots ) ) );
|
| 429 |
+
|
| 430 |
+
// Show additional robots data.
|
| 431 |
+
$advanced = array_filter( array_map( 'trim', explode( ',', smartcrawl_get_value( 'meta-robots-adv', $id ) ) ) );
|
| 432 |
+
if ( ! empty( $advanced ) && 'none' !== $advanced ) {
|
| 433 |
+
$adv_map = array(
|
| 434 |
+
'noodp' => __( 'No ODP', 'wds' ),
|
| 435 |
+
'noydir' => __( 'No YDIR', 'wds' ),
|
| 436 |
+
'noarchive' => __( 'No Archive', 'wds' ),
|
| 437 |
+
'nosnippet' => __( 'No Snippet', 'wds' ),
|
| 438 |
+
);
|
| 439 |
+
$additional = array();
|
| 440 |
+
foreach ( $advanced as $key ) {
|
| 441 |
+
if ( ! empty( $adv_map[ $key ] ) ) {
|
| 442 |
+
$additional[] = $adv_map[ $key ];
|
| 443 |
+
}
|
| 444 |
+
}
|
| 445 |
+
if ( ! empty( $additional ) ) {
|
| 446 |
+
echo '<br /><small>' . esc_html( join( ', ', $additional ) ) . '</small>';
|
| 447 |
+
}
|
| 448 |
+
}
|
| 449 |
+
}
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
/**
|
| 453 |
+
* Gets SEO title (with expanded macro replacements)
|
| 454 |
+
*
|
| 455 |
+
* @param int $postid Post ID.
|
| 456 |
+
*
|
| 457 |
+
* @return string
|
| 458 |
+
*/
|
| 459 |
+
public function smartcrawl_page_title( $postid ) {
|
| 460 |
+
$post = get_post( $postid );
|
| 461 |
+
$fixed_title = smartcrawl_get_value( 'title', $post->ID );
|
| 462 |
+
if ( $fixed_title ) {
|
| 463 |
+
return smartcrawl_replace_vars( $fixed_title, (array) $post );
|
| 464 |
+
} else {
|
| 465 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 466 |
+
if ( ! empty( $smartcrawl_options[ 'title-' . $post->post_type ] ) ) {
|
| 467 |
+
return smartcrawl_replace_vars( $smartcrawl_options[ 'title-' . $post->post_type ], (array) $post );
|
| 468 |
+
} else {
|
| 469 |
+
return '';
|
| 470 |
+
}
|
| 471 |
+
}
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
/**
|
| 475 |
+
* Dispatch quick edit areas
|
| 476 |
+
*
|
| 477 |
+
* @param string $column Column ID.
|
| 478 |
+
* @param string $type Passthrough.
|
| 479 |
+
*/
|
| 480 |
+
public function smartcrawl_quick_edit_dispatch( $column, $type ) {
|
| 481 |
+
switch ( $column ) {
|
| 482 |
+
case 'page-title':
|
| 483 |
+
return $this->_title_qe_box( $type );
|
| 484 |
+
case 'page-meta-robots':
|
| 485 |
+
return $this->_robots_qe_box();
|
| 486 |
+
}
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
/**
|
| 490 |
+
* Renders title quick edit box
|
| 491 |
+
*/
|
| 492 |
+
private function _title_qe_box() {
|
| 493 |
+
global $post;
|
| 494 |
+
$this->_render( 'quick-edit-title', array(
|
| 495 |
+
'post' => $post,
|
| 496 |
+
) );
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
/**
|
| 500 |
+
* Renders robots quick edit box
|
| 501 |
+
*/
|
| 502 |
+
private function _robots_qe_box() {
|
| 503 |
+
global $post;
|
| 504 |
+
$this->_render( 'quick-edit-robots', array(
|
| 505 |
+
'post' => $post,
|
| 506 |
+
) );
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
/**
|
| 510 |
+
* Inject the quick editing javascript
|
| 511 |
+
*/
|
| 512 |
+
public function smartcrawl_quick_edit_javascript() {
|
| 513 |
+
$this->_render( 'quick-edit-javascript' );
|
| 514 |
+
}
|
| 515 |
+
|
| 516 |
+
/**
|
| 517 |
+
* Handle postmeta getting requests
|
| 518 |
+
*/
|
| 519 |
+
public function json_wds_postmeta() {
|
| 520 |
+
$data = $this->get_request_data();
|
| 521 |
+
$id = (int) $data['id'];
|
| 522 |
+
$post = get_post( $id );
|
| 523 |
+
die( wp_json_encode( array(
|
| 524 |
+
'title' => smartcrawl_replace_vars( smartcrawl_get_value( 'title', $id ), (array) $post ),
|
| 525 |
+
'description' => smartcrawl_replace_vars( smartcrawl_get_value( 'metadesc', $id ), (array) $post ),
|
| 526 |
+
'focus' => smartcrawl_get_value( 'focus-keywords', $id ),
|
| 527 |
+
'keywords' => smartcrawl_get_value( 'keywords', $id ),
|
| 528 |
+
) ) );
|
| 529 |
+
}
|
| 530 |
+
|
| 531 |
+
/**
|
| 532 |
+
* Handle metabox live update requests
|
| 533 |
+
*/
|
| 534 |
+
public function smartcrawl_metabox_live_update() {
|
| 535 |
+
$data = $this->get_request_data();
|
| 536 |
+
$id = (int) $data['id'];
|
| 537 |
+
$post = get_post( $id );
|
| 538 |
+
|
| 539 |
+
$post_data = sanitize_post( $data['post'] );
|
| 540 |
+
|
| 541 |
+
/* Merge live post data with currently saved post data */
|
| 542 |
+
$post->post_author = $post_data['post_author'];
|
| 543 |
+
$post->post_title = $post_data['post_title'];
|
| 544 |
+
$post->post_excerpt = $post_data['excerpt'];
|
| 545 |
+
$post->post_content = $post_data['content'];
|
| 546 |
+
$post->post_type = $post_data['post_type'];
|
| 547 |
+
|
| 548 |
+
$title = smartcrawl_get_seo_title( $post );
|
| 549 |
+
$description = smartcrawl_get_seo_desc( $post );
|
| 550 |
+
|
| 551 |
+
wp_send_json( array(
|
| 552 |
+
'title' => $title,
|
| 553 |
+
'description' => $description,
|
| 554 |
+
'focus' => smartcrawl_get_value( 'focus-keywords', $id ),
|
| 555 |
+
'keywords' => smartcrawl_get_value( 'keywords', $id ),
|
| 556 |
+
) );
|
| 557 |
+
|
| 558 |
+
die();
|
| 559 |
+
}
|
| 560 |
+
|
| 561 |
+
/**
|
| 562 |
+
* Sattisfy interface
|
| 563 |
+
*/
|
| 564 |
+
protected function _get_view_defaults() {
|
| 565 |
+
return array();
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
private function get_request_data() {
|
| 569 |
+
return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-metabox-nonce' ) ? stripslashes_deep( $_POST ) : array();
|
| 570 |
+
}
|
| 571 |
+
}
|
includes/admin/settings.php
CHANGED
|
@@ -1,664 +1,710 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Admin area setup stuff
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
/**
|
| 9 |
-
* Admin area instance page abstraction
|
| 10 |
-
*/
|
| 11 |
-
abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
|
| 12 |
-
|
| 13 |
-
/**
|
| 14 |
-
* Sections
|
| 15 |
-
*
|
| 16 |
-
* @var array
|
| 17 |
-
*/
|
| 18 |
-
public $sections = array();
|
| 19 |
-
|
| 20 |
-
/**
|
| 21 |
-
* Settings corresponding to this page
|
| 22 |
-
*
|
| 23 |
-
* @var array
|
| 24 |
-
*/
|
| 25 |
-
public $options = array();
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
* Capability required for this page
|
| 29 |
-
*
|
| 30 |
-
* @var string
|
| 31 |
-
*/
|
| 32 |
-
public $capability = 'list_users';
|
| 33 |
-
|
| 34 |
-
/**
|
| 35 |
-
* Name of the options corresponding to this page
|
| 36 |
-
*
|
| 37 |
-
* @var string
|
| 38 |
-
*/
|
| 39 |
-
public $option_name = '';
|
| 40 |
-
|
| 41 |
-
/**
|
| 42 |
-
* Page name
|
| 43 |
-
*
|
| 44 |
-
* @var string
|
| 45 |
-
*/
|
| 46 |
-
public $name = '';
|
| 47 |
-
|
| 48 |
-
/**
|
| 49 |
-
* Page slug
|
| 50 |
-
*
|
| 51 |
-
* @var string
|
| 52 |
-
*/
|
| 53 |
-
public $slug = '';
|
| 54 |
-
|
| 55 |
-
/**
|
| 56 |
-
* Action URL
|
| 57 |
-
*
|
| 58 |
-
* @var string
|
| 59 |
-
*/
|
| 60 |
-
public $action_url = '';
|
| 61 |
-
|
| 62 |
-
/**
|
| 63 |
-
* Action message
|
| 64 |
-
*
|
| 65 |
-
* @var string
|
| 66 |
-
*/
|
| 67 |
-
public $msg = '';
|
| 68 |
-
|
| 69 |
-
/**
|
| 70 |
-
* Current page hook
|
| 71 |
-
*
|
| 72 |
-
* @var string
|
| 73 |
-
*/
|
| 74 |
-
public $smartcrawl_page_hook
|
| 75 |
-
|
| 76 |
-
/**
|
| 77 |
-
* Blog tabs
|
| 78 |
-
*
|
| 79 |
-
* @var array
|
| 80 |
-
*/
|
| 81 |
-
public $blog_tabs = array();
|
| 82 |
-
|
| 83 |
-
/**
|
| 84 |
-
*
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
if ( is_multisite()
|
| 110 |
-
$this
|
| 111 |
-
}
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
*
|
| 149 |
-
*
|
| 150 |
-
* @
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
if (
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
if (
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
if (
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
if ( ! wp_script_is( 'wds-admin-
|
| 250 |
-
wp_register_script( 'wds-admin-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
'
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
'
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
'
|
| 296 |
-
'
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
'
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
));
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
'
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
'
|
| 319 |
-
'
|
| 320 |
-
'
|
| 321 |
-
'
|
| 322 |
-
'
|
| 323 |
-
'
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
'
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
'
|
| 352 |
-
'
|
| 353 |
-
'
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
'
|
| 357 |
-
'
|
| 358 |
-
'
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
'wds-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
'
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
'
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
'
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
'
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
'
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
'wds-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
));
|
| 458 |
-
}
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
if ( file_exists( SMARTCRAWL_PLUGIN_DIR . '
|
| 490 |
-
|
| 491 |
-
}
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
*
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
$
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
*
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
'
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
if (
|
| 605 |
-
set_transient( 'wds-
|
| 606 |
-
}
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
*
|
| 612 |
-
*
|
| 613 |
-
*
|
| 614 |
-
*
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
$
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Admin area setup stuff
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* Admin area instance page abstraction
|
| 10 |
+
*/
|
| 11 |
+
abstract class Smartcrawl_Settings_Admin extends Smartcrawl_Settings {
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* Sections
|
| 15 |
+
*
|
| 16 |
+
* @var array
|
| 17 |
+
*/
|
| 18 |
+
public $sections = array();
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Settings corresponding to this page
|
| 22 |
+
*
|
| 23 |
+
* @var array
|
| 24 |
+
*/
|
| 25 |
+
public $options = array();
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Capability required for this page
|
| 29 |
+
*
|
| 30 |
+
* @var string
|
| 31 |
+
*/
|
| 32 |
+
public $capability = 'list_users';
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* Name of the options corresponding to this page
|
| 36 |
+
*
|
| 37 |
+
* @var string
|
| 38 |
+
*/
|
| 39 |
+
public $option_name = '';
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* Page name
|
| 43 |
+
*
|
| 44 |
+
* @var string
|
| 45 |
+
*/
|
| 46 |
+
public $name = '';
|
| 47 |
+
|
| 48 |
+
/**
|
| 49 |
+
* Page slug
|
| 50 |
+
*
|
| 51 |
+
* @var string
|
| 52 |
+
*/
|
| 53 |
+
public $slug = '';
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* Action URL
|
| 57 |
+
*
|
| 58 |
+
* @var string
|
| 59 |
+
*/
|
| 60 |
+
public $action_url = '';
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* Action message
|
| 64 |
+
*
|
| 65 |
+
* @var string
|
| 66 |
+
*/
|
| 67 |
+
public $msg = '';
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* Current page hook
|
| 71 |
+
*
|
| 72 |
+
* @var string
|
| 73 |
+
*/
|
| 74 |
+
public $smartcrawl_page_hook = '';
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* Blog tabs
|
| 78 |
+
*
|
| 79 |
+
* @var array
|
| 80 |
+
*/
|
| 81 |
+
public $blog_tabs = array();
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* Constructor
|
| 85 |
+
*/
|
| 86 |
+
protected function __construct() {
|
| 87 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 88 |
+
$this->capability = 'manage_network_options';
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
$this->init();
|
| 92 |
+
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* Initializes the interface and binds hooks
|
| 97 |
+
*/
|
| 98 |
+
public function init() {
|
| 99 |
+
$this->options = self::get_specific_options( $this->option_name );
|
| 100 |
+
if ( is_multisite() && defined( 'SMARTCRAWL_SITEWIDE' ) && SMARTCRAWL_SITEWIDE ) {
|
| 101 |
+
$this->capability = 'manage_network_options';
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
add_action( 'init', array( $this, 'defaults' ), 999 );
|
| 105 |
+
add_action( 'admin_body_class', array( $this, 'add_body_class' ), 20 );
|
| 106 |
+
|
| 107 |
+
add_action( 'admin_init', array( $this, 'save_last_active_tab' ) );
|
| 108 |
+
|
| 109 |
+
if ( is_multisite() ) {
|
| 110 |
+
add_action( 'network_admin_menu', array( $this, 'add_page' ) );
|
| 111 |
+
}
|
| 112 |
+
if ( ! is_multisite() || ! ( defined( 'SMARTCRAWL_SITEWIDE' ) && SMARTCRAWL_SITEWIDE ) ) {
|
| 113 |
+
add_action( 'admin_menu', array( $this, 'add_page' ) );
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* Unified admin tab URL getter
|
| 120 |
+
*
|
| 121 |
+
* Also takes into account whether the tab is allowed or not
|
| 122 |
+
*
|
| 123 |
+
* @param string $tab Tab to check.
|
| 124 |
+
*
|
| 125 |
+
* @return string Unescaped admin URL, or tab anchor on failure
|
| 126 |
+
*/
|
| 127 |
+
public static function admin_url( $tab ) {
|
| 128 |
+
$fallback = '#' . esc_attr( $tab );
|
| 129 |
+
|
| 130 |
+
if ( empty( $tab ) ) {
|
| 131 |
+
return $fallback;
|
| 132 |
+
}
|
| 133 |
+
if ( ! self::is_tab_allowed( $tab ) ) {
|
| 134 |
+
return $fallback;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
$use_network_url = false;
|
| 138 |
+
if ( is_multisite() && smartcrawl_is_switch_active( 'SMARTCRAWL_SITEWIDE' ) ) {
|
| 139 |
+
$use_network_url = is_network_admin() || smartcrawl_is_switch_active( 'DOING_AJAX' );
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
return ! empty( $use_network_url )
|
| 143 |
+
? add_query_arg( 'page', $tab, network_admin_url( 'admin.php' ) )
|
| 144 |
+
: add_query_arg( 'page', $tab, admin_url( 'admin.php' ) );
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
/**
|
| 148 |
+
* Validation abstraction
|
| 149 |
+
*
|
| 150 |
+
* @param array $input Raw input to validate.
|
| 151 |
+
*
|
| 152 |
+
* @return array
|
| 153 |
+
*/
|
| 154 |
+
abstract public function validate( $input );
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* Add sub page to the Settings Menu
|
| 158 |
+
*/
|
| 159 |
+
public function add_page() {
|
| 160 |
+
$allowed = true;
|
| 161 |
+
|
| 162 |
+
if ( ! $this->_is_current_tab_allowed() ) {
|
| 163 |
+
$allowed = false;
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
// Only allow network settings page on multisite when sitewide mode is off.
|
| 167 |
+
if ( is_multisite() && ! smartcrawl_is_switch_active( 'SMARTCRAWL_SITEWIDE' ) && is_network_admin() ) {
|
| 168 |
+
$allowed = Smartcrawl_Settings::TAB_SETTINGS === $this->slug;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
if ( ! $allowed ) {
|
| 172 |
+
return false;
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
$this->smartcrawl_page_hook = add_submenu_page(
|
| 176 |
+
'wds_wizard',
|
| 177 |
+
$this->page_title,
|
| 178 |
+
$this->title,
|
| 179 |
+
$this->capability,
|
| 180 |
+
$this->slug,
|
| 181 |
+
array( $this, 'options_page' )
|
| 182 |
+
);
|
| 183 |
+
|
| 184 |
+
// For pages that can deal with run requests, let's make sure they actually do that early enough.
|
| 185 |
+
if ( is_callable( array( $this, 'process_run_action' ) ) ) {
|
| 186 |
+
add_action( 'load-' . $this->smartcrawl_page_hook, array( $this, 'process_run_action' ) );
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
|
| 190 |
+
|
| 191 |
+
add_action( "admin_print_styles-{$this->smartcrawl_page_hook}", array( $this, 'admin_styles' ) );
|
| 192 |
+
add_action( "admin_print_scripts-{$this->smartcrawl_page_hook}", array( $this, 'admin_scripts' ) );
|
| 193 |
+
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
/**
|
| 197 |
+
* Check if the current tab (settings page) is allowed for access
|
| 198 |
+
*
|
| 199 |
+
* @return bool
|
| 200 |
+
*/
|
| 201 |
+
protected function _is_current_tab_allowed() {
|
| 202 |
+
return ! empty( $this->slug )
|
| 203 |
+
? self::is_tab_allowed( $this->slug )
|
| 204 |
+
: false;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
/**
|
| 208 |
+
* Check if a tab (settings page) is allowed for access
|
| 209 |
+
*
|
| 210 |
+
* It can be not allowed for access to site admins
|
| 211 |
+
*
|
| 212 |
+
* @param string $tab Tab to check.
|
| 213 |
+
*
|
| 214 |
+
* @return bool
|
| 215 |
+
*/
|
| 216 |
+
public static function is_tab_allowed( $tab ) {
|
| 217 |
+
if ( empty( $tab ) ) {
|
| 218 |
+
return false;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
if ( ! is_multisite() ) {
|
| 222 |
+
return true;
|
| 223 |
+
} // On single installs, everything is good
|
| 224 |
+
if ( is_network_admin() ) {
|
| 225 |
+
return true;
|
| 226 |
+
} // Always good in network
|
| 227 |
+
if ( smartcrawl_is_switch_active( 'SMARTCRAWL_SITEWIDE' ) ) {
|
| 228 |
+
return smartcrawl_is_switch_active( 'DOING_AJAX' ) ? true : is_network_admin();
|
| 229 |
+
} // If we're sitewide, we're good *in network admin* pages
|
| 230 |
+
|
| 231 |
+
// We're network install, not sitewide now.
|
| 232 |
+
// Let's see what's up.
|
| 233 |
+
$allowed = Smartcrawl_Settings_Settings::get_blog_tabs();
|
| 234 |
+
if ( empty( $allowed ) ) {
|
| 235 |
+
return false;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
return in_array( $tab, array_keys( $allowed ), true ) && ! empty( $allowed[ $tab ] );
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
/**
|
| 242 |
+
* Registers the known scripts on admin side.
|
| 243 |
+
*/
|
| 244 |
+
public function register_admin_scripts() {
|
| 245 |
+
// Do the globals first.
|
| 246 |
+
self::register_global_admin_scripts();
|
| 247 |
+
|
| 248 |
+
$version = Smartcrawl_Loader::get_version();
|
| 249 |
+
if ( class_exists( 'Smartcrawl_Onpage_Settings' ) && ! wp_script_is( 'wds-admin-macros', 'registered' ) ) {
|
| 250 |
+
wp_register_script( 'wds-admin-macros', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-macros.js', array(
|
| 251 |
+
'underscore',
|
| 252 |
+
'jquery',
|
| 253 |
+
'wds-admin',
|
| 254 |
+
), $version );
|
| 255 |
+
wp_localize_script( 'wds-admin-macros', '_wds_macros', array(
|
| 256 |
+
'macros' => Smartcrawl_Onpage_Settings::get_macros(),
|
| 257 |
+
'templates' => array(
|
| 258 |
+
'list' => $this->_load( 'onpage/underscore-macros-list' ),
|
| 259 |
+
),
|
| 260 |
+
'strings' => array(
|
| 261 |
+
'Insert dynamic macro' => __( 'Insert dynamic macro', 'wds' ),
|
| 262 |
+
),
|
| 263 |
+
) );
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
if ( ! wp_script_is( 'wds-admin-keywords', 'registered' ) ) {
|
| 267 |
+
wp_register_script( 'wds-admin-keywords', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-keywords.js', array(
|
| 268 |
+
'underscore',
|
| 269 |
+
'jquery',
|
| 270 |
+
'wds-admin',
|
| 271 |
+
), $version );
|
| 272 |
+
wp_localize_script( 'wds-admin-keywords', '_wds_keywords', array(
|
| 273 |
+
'templates' => array(
|
| 274 |
+
'custom' => $this->_load( 'advanced-tools/underscore-keywords-custom' ),
|
| 275 |
+
'pairs' => $this->_load( 'advanced-tools/underscore-keywords-pairs' ),
|
| 276 |
+
'form' => $this->_load( 'advanced-tools/underscore-keywords-form' ),
|
| 277 |
+
),
|
| 278 |
+
'strings' => array(
|
| 279 |
+
'Keyword' => __( 'Keyword', 'wds' ),
|
| 280 |
+
'Auto-Linked URL' => __( 'Auto-Linked URL', 'wds' ),
|
| 281 |
+
'Add New' => __( 'Add New', 'wds' ),
|
| 282 |
+
'Add Custom Keywords' => __( 'Add Custom Keywords', 'wds' ),
|
| 283 |
+
'Update Custom Keywords' => __( 'Update Custom Keywords', 'wds' ),
|
| 284 |
+
'Add' => __( 'Add', 'wds' ),
|
| 285 |
+
'Update' => __( 'Update', 'wds' ),
|
| 286 |
+
'Edit' => __( 'Edit', 'wds' ),
|
| 287 |
+
'Remove' => __( 'Remove', 'wds' ),
|
| 288 |
+
'E.g. Cats, Kittens, Felines' => __( 'E.g. Cats, Kittens, Felines', 'wds' ),
|
| 289 |
+
'E.g. /cats' => __( 'E.g. /cats', 'wds' ),
|
| 290 |
+
'Keyword group' => __( 'Keyword group', 'wds' ),
|
| 291 |
+
'- Usually related terms' => __( '- Usually related terms', 'wds' ),
|
| 292 |
+
'Link URL' => __( 'Link URL', 'wds' ),
|
| 293 |
+
'internal-external-links-supported' => __( '- Both internal and external links are supported', 'wds' ),
|
| 294 |
+
'choose-your-keywords-and-url' => __( 'Choose your keywords, and then specify the URL to auto-link to.', 'wds' ),
|
| 295 |
+
'url-formats-explanation' => __( 'Formats include relative (E.g. <b>/cats</b>) or absolute URLs (E.g. <b>www.website.com/cats</b> or <b>https://website.com/cats</b>).', 'wds' ),
|
| 296 |
+
'Cancel' => __( 'Cancel', 'wds' ),
|
| 297 |
+
),
|
| 298 |
+
) );
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
if ( class_exists( 'Smartcrawl_Autolinks_Settings' ) && ! wp_script_is( 'wds-admin-postlist', 'registered' ) ) {
|
| 302 |
+
wp_register_script( 'wds-admin-postlist', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-postlist.js', array(
|
| 303 |
+
'underscore',
|
| 304 |
+
'jquery',
|
| 305 |
+
'wds-admin',
|
| 306 |
+
), $version );
|
| 307 |
+
wp_localize_script( 'wds-admin-postlist', '_wds_postlist', array(
|
| 308 |
+
'templates' => array(
|
| 309 |
+
'exclude' => $this->_load( 'advanced-tools/underscore-postlist-exclusion' ),
|
| 310 |
+
'exclude-item' => $this->_load( 'advanced-tools/underscore-postlist-exclusion-item' ),
|
| 311 |
+
'selector' => $this->_load( 'advanced-tools/underscore-postlist-selector' ),
|
| 312 |
+
'selector-list' => $this->_load( 'advanced-tools/underscore-postlist-selector-list' ),
|
| 313 |
+
'selector-list-item' => $this->_load( 'advanced-tools/underscore-postlist-selector-list-item' ),
|
| 314 |
+
),
|
| 315 |
+
'post_types' => Smartcrawl_Autolinks_Settings::get_post_types(),
|
| 316 |
+
'strings' => array(
|
| 317 |
+
'Add Posts' => __( 'Add Posts', 'wds' ),
|
| 318 |
+
'Remove' => __( 'Remove', 'wds' ),
|
| 319 |
+
'Post' => __( 'Post', 'wds' ),
|
| 320 |
+
'Post Type' => __( 'Post Type', 'wds' ),
|
| 321 |
+
'Loading post items, please hold on' => __( 'Loading post items, please hold on...', 'wds' ),
|
| 322 |
+
'Jump to page' => __( 'Jump to page:', 'wds' ),
|
| 323 |
+
'Total Pages' => __( 'Total Pages:', 'wds' ),
|
| 324 |
+
),
|
| 325 |
+
'nonce' => wp_create_nonce( 'wds-autolinks-nonce' ),
|
| 326 |
+
) );
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
if ( class_exists( 'Smartcrawl_Autolinks_Settings' ) && ! wp_script_is( 'wds-admin-autolinks', 'registered' ) ) {
|
| 330 |
+
wp_register_script( 'wds-admin-autolinks', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-autolinks.js', array(
|
| 331 |
+
'underscore',
|
| 332 |
+
'jquery',
|
| 333 |
+
'wds-admin',
|
| 334 |
+
'wds-select2',
|
| 335 |
+
'wds-select2-admin',
|
| 336 |
+
'wds-admin-keywords',
|
| 337 |
+
'wds-admin-postlist',
|
| 338 |
+
), $version );
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
if ( 'Smartcrawl_Autolinks_Settings' === get_class( $this ) && ! wp_script_is( 'wds-admin-redirects', 'registered' ) ) {
|
| 342 |
+
wp_register_script( 'wds-admin-redirects', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-redirects.js', array(
|
| 343 |
+
'underscore',
|
| 344 |
+
'jquery',
|
| 345 |
+
'wds-admin',
|
| 346 |
+
'wds-select2',
|
| 347 |
+
'wds-select2-admin',
|
| 348 |
+
), $version );
|
| 349 |
+
|
| 350 |
+
wp_localize_script( 'wds-admin-redirects', '_wds_redirects', array(
|
| 351 |
+
'templates' => array(
|
| 352 |
+
'redirect-item' => $this->_load( 'advanced-tools/underscore-redirect-item' ),
|
| 353 |
+
'update-form' => $this->_load( 'advanced-tools/underscore-bulk-update-form' ),
|
| 354 |
+
),
|
| 355 |
+
'strings' => array(
|
| 356 |
+
'Permanent (301)' => __( 'Permanent (301)', 'wds' ),
|
| 357 |
+
'Temporary (302)' => __( 'Temporary (302)', 'wds' ),
|
| 358 |
+
'Options' => __( 'Options', 'wds' ),
|
| 359 |
+
'Remove' => __( 'Remove', 'wds' ),
|
| 360 |
+
'Cancel' => __( 'Cancel', 'wds' ),
|
| 361 |
+
'Update' => __( 'Update', 'wds' ),
|
| 362 |
+
'Redirect Type' => __( 'Redirect Type', 'wds' ),
|
| 363 |
+
'New URL' => __( 'New URL', 'wds' ),
|
| 364 |
+
'Bulk Update' => __( 'Bulk Update', 'wds' ),
|
| 365 |
+
'Please select some items to edit them.' => __( 'Please select some items to edit them.', 'wds' ),
|
| 366 |
+
),
|
| 367 |
+
) );
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
if ( class_exists( 'Smartcrawl_Onpage_Settings' ) && ! wp_script_is( 'wds-admin-onpage', 'registered' ) ) {
|
| 371 |
+
wp_register_script( 'wds-admin-onpage', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-onpage.js', array(
|
| 372 |
+
'wds-admin-macros',
|
| 373 |
+
'wds-admin-opengraph',
|
| 374 |
+
'wds-qtip2-script',
|
| 375 |
+
'jquery',
|
| 376 |
+
), $version );
|
| 377 |
+
|
| 378 |
+
wp_localize_script( 'wds-admin-onpage', '_wds_onpage', array(
|
| 379 |
+
'nonce' => wp_create_nonce( 'wds-onpage-nonce' ),
|
| 380 |
+
) );
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
if ( class_exists( 'Smartcrawl_Sitemap_Settings' ) && ! wp_script_is( 'wds-admin-sitemaps', 'registered' ) ) {
|
| 384 |
+
wp_register_script( 'wds-admin-sitemaps', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-sitemaps.js', array(
|
| 385 |
+
'wds-admin',
|
| 386 |
+
'wds-qtip2-script',
|
| 387 |
+
'jquery',
|
| 388 |
+
), $version );
|
| 389 |
+
|
| 390 |
+
wp_localize_script( 'wds-admin-sitemaps', '_wds_sitemaps', array(
|
| 391 |
+
'nonce' => wp_create_nonce( 'wds-nonce' ),
|
| 392 |
+
) );
|
| 393 |
+
};
|
| 394 |
+
|
| 395 |
+
if ( class_exists( 'Smartcrawl_Settings_Dashboard' ) && ! wp_script_is( 'wds-admin-dashboard', 'registered' ) ) {
|
| 396 |
+
wp_register_script( 'wds-admin-dashboard', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-dashboard.js', array(
|
| 397 |
+
'wds-admin',
|
| 398 |
+
'wds-qtip2-script',
|
| 399 |
+
'jquery',
|
| 400 |
+
), $version );
|
| 401 |
+
|
| 402 |
+
wp_localize_script( 'wds-admin-dashboard', '_wds_dashboard', array(
|
| 403 |
+
'nonce' => wp_create_nonce( 'wds-nonce' ),
|
| 404 |
+
) );
|
| 405 |
+
};
|
| 406 |
+
|
| 407 |
+
if ( class_exists( 'Smartcrawl_Checkup_Settings' ) && ! wp_script_is( 'wds-admin-checkup', 'registered' ) ) {
|
| 408 |
+
wp_register_script( 'wds-admin-checkup', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-checkup.js', array(
|
| 409 |
+
'wds-admin',
|
| 410 |
+
'wds-qtip2-script',
|
| 411 |
+
'jquery',
|
| 412 |
+
), $version );
|
| 413 |
+
};
|
| 414 |
+
|
| 415 |
+
if ( class_exists( 'Smartcrawl_Social_Settings' ) && ! wp_script_is( 'wds-admin-social', 'registered' ) ) {
|
| 416 |
+
wp_register_script( 'wds-admin-social', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-social.js', array(
|
| 417 |
+
'wds-admin',
|
| 418 |
+
'wds-qtip2-script',
|
| 419 |
+
'jquery',
|
| 420 |
+
), $version );
|
| 421 |
+
};
|
| 422 |
+
|
| 423 |
+
if ( class_exists( 'Smartcrawl_Settings_Settings' ) && ! wp_script_is( 'wds-admin-settings', 'registered' ) ) {
|
| 424 |
+
wp_register_script( 'wds-admin-settings', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-settings.js', array(
|
| 425 |
+
'wds-admin',
|
| 426 |
+
'wds-qtip2-script',
|
| 427 |
+
'jquery',
|
| 428 |
+
), $version );
|
| 429 |
+
|
| 430 |
+
wp_localize_script( 'wds-admin-settings', '_wds_setting', array(
|
| 431 |
+
'strings' => array(
|
| 432 |
+
'importing' => esc_html__( 'Importing', 'wds' ),
|
| 433 |
+
'import' => esc_html__( 'Import', 'wds' ),
|
| 434 |
+
),
|
| 435 |
+
) );
|
| 436 |
+
};
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
/**
|
| 440 |
+
* Registers the scripts with global admin functionality
|
| 441 |
+
*/
|
| 442 |
+
public static function register_global_admin_scripts() {
|
| 443 |
+
$version = Smartcrawl_Loader::get_version();
|
| 444 |
+
if ( ! wp_script_is( 'wds-admin', 'registered' ) ) {
|
| 445 |
+
wp_register_script( 'wds-admin', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin.js', array( 'jquery' ), $version );
|
| 446 |
+
|
| 447 |
+
wp_localize_script( 'wds-admin', '_wds_admin', array(
|
| 448 |
+
'nonce' => wp_create_nonce( 'wds-admin-nonce' ),
|
| 449 |
+
) );
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
if ( ! wp_script_is( 'wds-admin-opengraph', 'registered' ) ) {
|
| 453 |
+
wp_register_script( 'wds-admin-opengraph', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-opengraph.js', array(
|
| 454 |
+
'underscore',
|
| 455 |
+
'jquery',
|
| 456 |
+
'wds-admin',
|
| 457 |
+
), $version );
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
if ( ! wp_script_is( 'wds-select2', 'registered' ) ) {
|
| 461 |
+
wp_register_script( 'wds-select2', SMARTCRAWL_PLUGIN_URL . 'js/external/select2.min.js', array( 'jquery' ), $version );
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
if ( ! wp_script_is( 'wds-qtip2-script', 'registered' ) ) {
|
| 465 |
+
wp_register_script( 'wds-qtip2-script', SMARTCRAWL_PLUGIN_URL . 'js/external/jquery.qtip.min.js', array( 'jquery' ), $version );
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
wp_register_style( 'wds-admin-opengraph', SMARTCRAWL_PLUGIN_URL . '/css/wds-opengraph.css', null, $version );
|
| 469 |
+
|
| 470 |
+
wp_register_style( 'wds-qtip2-style', SMARTCRAWL_PLUGIN_URL . '/css/external/jquery.qtip.min.css', null, $version );
|
| 471 |
+
|
| 472 |
+
wp_register_style( 'wds-select2', SMARTCRAWL_PLUGIN_URL . 'css/external/select2.min.css', null, $version );
|
| 473 |
+
|
| 474 |
+
wp_register_style( 'wds-app', SMARTCRAWL_PLUGIN_URL . 'css/app.css', array( 'wds-qtip2-style' ), $version );
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
/**
|
| 478 |
+
* Enqueue styles
|
| 479 |
+
*/
|
| 480 |
+
public function admin_styles() {
|
| 481 |
+
$version = Smartcrawl_Loader::get_version();
|
| 482 |
+
|
| 483 |
+
$this->enqueue_shared_ui();
|
| 484 |
+
|
| 485 |
+
wp_enqueue_style( 'wds-qtip2-style' );
|
| 486 |
+
wp_enqueue_style( 'wds-select2' );
|
| 487 |
+
wp_enqueue_style( 'wds-app' );
|
| 488 |
+
|
| 489 |
+
if ( file_exists( SMARTCRAWL_PLUGIN_DIR . 'css/' . $this->name . '.css' ) ) {
|
| 490 |
+
wp_enqueue_style( $this->slug, SMARTCRAWL_PLUGIN_URL . 'css/' . $this->name . '.css', array( 'wds' ), $version );
|
| 491 |
+
}
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
/**
|
| 495 |
+
* Sets up and enqueues shared UI library
|
| 496 |
+
*
|
| 497 |
+
* @param bool $add_class Whether to add admin body class to the current page.
|
| 498 |
+
*/
|
| 499 |
+
public static function enqueue_shared_ui( $add_class = true ) {
|
| 500 |
+
$version = Smartcrawl_Loader::get_version();
|
| 501 |
+
if ( $add_class ) {
|
| 502 |
+
add_filter(
|
| 503 |
+
'admin_body_class',
|
| 504 |
+
array( 'WDEV_Plugin_Ui', 'admin_body_class' )
|
| 505 |
+
);
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
/**
|
| 509 |
+
* Enqueue Dashboard UI Shared Lib.
|
| 510 |
+
* We are doing it this way instead of calling WDEV_Plugin_Ui::load because we want to clear out the cache
|
| 511 |
+
* by changing the version.
|
| 512 |
+
*/
|
| 513 |
+
$shared_ui_url = SMARTCRAWL_PLUGIN_URL . 'admin/shared-ui';
|
| 514 |
+
wp_enqueue_style(
|
| 515 |
+
'wdev-plugin-google_fonts',
|
| 516 |
+
'https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700|Roboto:400,500,300,300italic',
|
| 517 |
+
false,
|
| 518 |
+
$version
|
| 519 |
+
);
|
| 520 |
+
|
| 521 |
+
wp_enqueue_style(
|
| 522 |
+
'wdev-plugin-ui',
|
| 523 |
+
$shared_ui_url . '/wdev-ui.css',
|
| 524 |
+
array( 'wdev-plugin-google_fonts' ),
|
| 525 |
+
$version
|
| 526 |
+
);
|
| 527 |
+
|
| 528 |
+
wp_enqueue_script(
|
| 529 |
+
'wdev-plugin-ui',
|
| 530 |
+
$shared_ui_url . '/wdev-ui.js',
|
| 531 |
+
array( 'jquery' ),
|
| 532 |
+
$version
|
| 533 |
+
);
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
/**
|
| 537 |
+
* Enqueue scripts
|
| 538 |
+
*/
|
| 539 |
+
public function admin_scripts() {
|
| 540 |
+
$version = Smartcrawl_Loader::get_version();
|
| 541 |
+
|
| 542 |
+
wp_enqueue_script( 'wds' );
|
| 543 |
+
|
| 544 |
+
wp_enqueue_script( 'wds-select2' );
|
| 545 |
+
wp_enqueue_script( 'wds-select2-admin', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-select2.js', array( 'wds-select2' ), $version );
|
| 546 |
+
|
| 547 |
+
if ( file_exists( SMARTCRAWL_PLUGIN_DIR . 'js/' . $this->name . '.js' ) ) {
|
| 548 |
+
wp_enqueue_script( $this->slug, SMARTCRAWL_PLUGIN_URL . 'js/' . $this->name . '.js', array( 'wds' ), $version );
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
/**
|
| 554 |
+
* Initiates a checkup run
|
| 555 |
+
*/
|
| 556 |
+
public function run_checkup() {
|
| 557 |
+
if ( current_user_can( 'manage_options' ) ) {
|
| 558 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 559 |
+
$service->start();
|
| 560 |
+
}
|
| 561 |
+
wp_safe_redirect( esc_url( remove_query_arg( array( 'run-checkup', '_wds_nonce' ) ) ) );
|
| 562 |
+
die;
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
/**
|
| 566 |
+
* Display the admin options page
|
| 567 |
+
*/
|
| 568 |
+
public function options_page() {
|
| 569 |
+
// phpcs:disable -- $_GET values need to be used without nonces
|
| 570 |
+
$this->msg = '';
|
| 571 |
+
if ( ! empty( $_GET['updated'] ) || ! empty( $_GET['settings-updated'] ) ) {
|
| 572 |
+
$this->msg = __( 'Settings updated', 'wds' );
|
| 573 |
+
|
| 574 |
+
if ( function_exists( 'w3tc_pgcache_flush' ) ) {
|
| 575 |
+
w3tc_pgcache_flush();
|
| 576 |
+
$this->msg .= __( ' & W3 Total Cache Page Cache flushed', 'wds' );
|
| 577 |
+
} elseif ( function_exists( 'wp_cache_clear_cache' ) ) {
|
| 578 |
+
wp_cache_clear_cache();
|
| 579 |
+
$this->msg .= __( ' & WP Super Cache flushed', 'wds' );
|
| 580 |
+
}
|
| 581 |
+
}
|
| 582 |
+
|
| 583 |
+
if ( ! empty( $_GET['imported'] ) ) {
|
| 584 |
+
$plugin = smartcrawl_get_array_value( $_GET, 'plugin' );
|
| 585 |
+
$plugin_label = 'yoast' === $plugin ? __( 'Yoast SEO', 'wds' ) : __( 'All In One SEO', 'wds' );
|
| 586 |
+
|
| 587 |
+
$plugins_link = sprintf(
|
| 588 |
+
'<a href="%s">%s</a>',
|
| 589 |
+
admin_url( 'plugins.php' ),
|
| 590 |
+
sprintf(
|
| 591 |
+
__( 'deactivate %s', 'wds' ),
|
| 592 |
+
$plugin_label
|
| 593 |
+
)
|
| 594 |
+
);
|
| 595 |
+
|
| 596 |
+
$this->msg = sprintf(
|
| 597 |
+
__( 'Your %1$s configuration has been successfully imported! We recommend you %2$s to avoid any potential conflicts.', 'wds' ),
|
| 598 |
+
$plugin_label,
|
| 599 |
+
$plugins_link
|
| 600 |
+
);
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
$errors = get_settings_errors( $this->option_name );
|
| 604 |
+
if ( $errors ) {
|
| 605 |
+
set_transient( 'wds-settings-save-errors', $errors, 3 );
|
| 606 |
+
}
|
| 607 |
+
// phpcs:enable
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
/**
|
| 611 |
+
* Sets up contextual help
|
| 612 |
+
*
|
| 613 |
+
* @param string $contextual_help Help.
|
| 614 |
+
*
|
| 615 |
+
* @return string
|
| 616 |
+
*/
|
| 617 |
+
public function contextual_help( $contextual_help ) {
|
| 618 |
+
$page = smartcrawl_get_array_value( $_GET, 'page' ); // phpcs:ignore -- Can't add nonce to the request
|
| 619 |
+
if ( ! empty( $page ) && $page === $this->slug && ! empty( $this->contextual_help ) ) {
|
| 620 |
+
$contextual_help = $this->contextual_help;
|
| 621 |
+
}
|
| 622 |
+
|
| 623 |
+
return $contextual_help;
|
| 624 |
+
}
|
| 625 |
+
|
| 626 |
+
/**
|
| 627 |
+
* Adds body class
|
| 628 |
+
*
|
| 629 |
+
* @TODO: Apparently a no-op?
|
| 630 |
+
*
|
| 631 |
+
* @param string $class Class that's being processed.
|
| 632 |
+
*
|
| 633 |
+
* @return string
|
| 634 |
+
*/
|
| 635 |
+
public function add_body_class( $class ) {
|
| 636 |
+
global $current_screen;
|
| 637 |
+
|
| 638 |
+
if ( str_replace( '-network', '', $current_screen->id ) === $this->smartcrawl_page_hook ) {
|
| 639 |
+
return $class;
|
| 640 |
+
} else {
|
| 641 |
+
return $class;
|
| 642 |
+
}
|
| 643 |
+
}
|
| 644 |
+
|
| 645 |
+
/**
|
| 646 |
+
* On form submission, this method saves the last active tab in a transient so that it can be opened when the page is refreshed.
|
| 647 |
+
*/
|
| 648 |
+
public function save_last_active_tab() {
|
| 649 |
+
$data = isset( $_POST['_wpnonce'], $_POST['option_page'] ) && wp_verify_nonce( $_POST['_wpnonce'], $_POST['option_page'] . '-options' )
|
| 650 |
+
? stripslashes_deep( $_POST )
|
| 651 |
+
: array();
|
| 652 |
+
|
| 653 |
+
if ( isset( $data['wds-admin-active-tab'] ) ) {
|
| 654 |
+
set_transient( 'wds-admin-active-tab', sanitize_key( $data['wds-admin-active-tab'] ), 10 );
|
| 655 |
+
}
|
| 656 |
+
}
|
| 657 |
+
|
| 658 |
+
/**
|
| 659 |
+
* Renders the whole page view by calling `_render`
|
| 660 |
+
*
|
| 661 |
+
* As a side-effect, also calls `WDEV_Plugin_Ui::output()`
|
| 662 |
+
*
|
| 663 |
+
* @param string $view View file to load.
|
| 664 |
+
* @param array $args Optional array of arguments to pass to view.
|
| 665 |
+
*
|
| 666 |
+
* @return bool
|
| 667 |
+
*/
|
| 668 |
+
protected function _render_page( $view, $args = array() ) {
|
| 669 |
+
WDEV_Plugin_Ui::output();
|
| 670 |
+
$this->_render( $view, $args );
|
| 671 |
+
|
| 672 |
+
return true;
|
| 673 |
+
}
|
| 674 |
+
|
| 675 |
+
/**
|
| 676 |
+
* Populates view defaults with view meta information
|
| 677 |
+
*
|
| 678 |
+
* @return array Defaults
|
| 679 |
+
*/
|
| 680 |
+
protected function _get_view_defaults() {
|
| 681 |
+
$errors = get_transient( 'wds-settings-save-errors' );
|
| 682 |
+
$errors = ! empty( $errors ) ? $errors : array();
|
| 683 |
+
|
| 684 |
+
return array(
|
| 685 |
+
'_view' => array(
|
| 686 |
+
'slug' => $this->slug,
|
| 687 |
+
'name' => $this->name,
|
| 688 |
+
'option_name' => $this->option_name,
|
| 689 |
+
'options' => $this->options,
|
| 690 |
+
'action_url' => $this->action_url,
|
| 691 |
+
'msg' => $this->msg,
|
| 692 |
+
'errors' => $errors,
|
| 693 |
+
),
|
| 694 |
+
);
|
| 695 |
+
}
|
| 696 |
+
|
| 697 |
+
/**
|
| 698 |
+
* Checks if the last active tab is stored in the transient and returns its value. If nothing is available then it returns the default value.
|
| 699 |
+
*
|
| 700 |
+
* @param string $default Fallback value.
|
| 701 |
+
*
|
| 702 |
+
* @return string The last active tab.
|
| 703 |
+
*/
|
| 704 |
+
protected function _get_last_active_tab( $default = '' ) {
|
| 705 |
+
$active_tab = get_transient( 'wds-admin-active-tab' );
|
| 706 |
+
delete_transient( 'wds-admin-active-tab' );
|
| 707 |
+
|
| 708 |
+
return $active_tab ? $active_tab : $default;
|
| 709 |
+
}
|
| 710 |
+
}
|
includes/admin/settings/autolinks.php
CHANGED
|
@@ -1,492 +1,526 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Autolinks module settings
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
/**
|
| 9 |
-
* Init WDS Autolinks Settings
|
| 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 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
*
|
| 35 |
-
*
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
);
|
| 46 |
-
$
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
;
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
'
|
| 101 |
-
'
|
| 102 |
-
'
|
| 103 |
-
'
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
'
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
'
|
| 255 |
-
);
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
'
|
| 269 |
-
'
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
'
|
| 300 |
-
|
| 301 |
-
)
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
if ( !
|
| 307 |
-
$
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
);
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
$
|
| 361 |
-
'
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
$
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
if (
|
| 401 |
-
|
| 402 |
-
}
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
$
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
if (
|
| 485 |
-
|
| 486 |
-
}
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Autolinks module settings
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* Init WDS Autolinks Settings
|
| 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
|
| 35 |
+
*
|
| 36 |
+
* @param array $input Raw input.
|
| 37 |
+
*
|
| 38 |
+
* @return array Validated input
|
| 39 |
+
*/
|
| 40 |
+
public function validate( $input ) {
|
| 41 |
+
$save_redirects = isset( $input['save_redirects'] ) && $input['save_redirects'];
|
| 42 |
+
if ( $save_redirects ) {
|
| 43 |
+
$this->save_redirects( $input );
|
| 44 |
+
|
| 45 |
+
$result = self::get_specific_options( $this->option_name );
|
| 46 |
+
$result['redirect-attachments'] = ! empty( $input['redirect-attachments'] );
|
| 47 |
+
$result['redirect-attachments-images_only'] = ! empty( $input['redirect-attachments-images_only'] );
|
| 48 |
+
|
| 49 |
+
if ( isset( $input['redirections-code'] ) ) {
|
| 50 |
+
$this->_validate_and_save_extra_options( $input );
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
return $result;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
$service = $this->get_site_service();
|
| 57 |
+
|
| 58 |
+
$result = array();
|
| 59 |
+
|
| 60 |
+
if ( ! empty( $input['wds_autolinks-setup'] ) ) {
|
| 61 |
+
$result['wds_autolinks-setup'] = true;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
if ( $service->is_member() ) {
|
| 65 |
+
// Booleans.
|
| 66 |
+
$booleans = array(
|
| 67 |
+
'comment',
|
| 68 |
+
'onlysingle',
|
| 69 |
+
'allowfeed',
|
| 70 |
+
'casesens',
|
| 71 |
+
'customkey_preventduplicatelink',
|
| 72 |
+
'target_blank',
|
| 73 |
+
'rel_nofollow',
|
| 74 |
+
'allow_empty_tax',
|
| 75 |
+
'excludeheading',
|
| 76 |
+
);
|
| 77 |
+
|
| 78 |
+
foreach ( $booleans as $bool ) {
|
| 79 |
+
if ( ! empty( $input[ $bool ] ) ) {
|
| 80 |
+
$result[ $bool ] = true;
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
// Boolean Arrays.
|
| 85 |
+
$post_type_names = array_keys( self::get_post_types() );
|
| 86 |
+
foreach ( array_merge( $post_type_names, array( 'comment' ) ) as $post_type ) {
|
| 87 |
+
$result[ $post_type ] = in_array( $post_type, $input, true );
|
| 88 |
+
}
|
| 89 |
+
foreach ( $post_type_names as $post_type ) {
|
| 90 |
+
$result["l{$post_type}"] = in_array( "l{$post_type}", $input, true );
|
| 91 |
+
}
|
| 92 |
+
foreach ( get_taxonomies() as $taxonomy ) {
|
| 93 |
+
$tax = get_taxonomy( $taxonomy );
|
| 94 |
+
$key = strtolower( $tax->labels->name );
|
| 95 |
+
$result["l{$key}"] = in_array( "l{$key}", $input, true );
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
// Numerics.
|
| 99 |
+
$numeric = array(
|
| 100 |
+
'cpt_char_limit',
|
| 101 |
+
'tax_char_limit',
|
| 102 |
+
'link_limit',
|
| 103 |
+
'single_link_limit',
|
| 104 |
+
);
|
| 105 |
+
foreach ( $numeric as $num ) {
|
| 106 |
+
if ( isset( $input[ $num ] ) ) {
|
| 107 |
+
if ( is_numeric( $input[ $num ] ) ) {
|
| 108 |
+
$result[ $num ] = (int) $input[ $num ];
|
| 109 |
+
} elseif ( ! empty( $input[ $num ] ) ) {
|
| 110 |
+
add_settings_error( $this->option_name, 'numeric-limits', __( 'Limit values must be numeric' ) );
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
// Strings.
|
| 116 |
+
$strings = array(
|
| 117 |
+
'ignore',
|
| 118 |
+
'ignorepost',
|
| 119 |
+
);
|
| 120 |
+
foreach ( $strings as $str ) {
|
| 121 |
+
if ( isset( $input[ $str ] ) ) {
|
| 122 |
+
$result[ $str ] = sanitize_text_field( $input[ $str ] );
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
// Custom keywords, they need newlines.
|
| 127 |
+
if ( isset( $input['customkey'] ) ) {
|
| 128 |
+
$str = wp_check_invalid_utf8( $input['customkey'] );
|
| 129 |
+
$str = wp_pre_kses_less_than( $str );
|
| 130 |
+
$str = wp_strip_all_tags( $str );
|
| 131 |
+
$result['customkey'] = $str;
|
| 132 |
+
|
| 133 |
+
$found = false;
|
| 134 |
+
while ( preg_match( '/%[a-f0-9]{2}/i', $str, $match ) ) {
|
| 135 |
+
$str = str_replace( $match[0], '', $str );
|
| 136 |
+
$found = true;
|
| 137 |
+
}
|
| 138 |
+
if ( $found ) {
|
| 139 |
+
$str = trim( preg_replace( '/ +/', ' ', $str ) );
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
return $result;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
/**
|
| 148 |
+
* Saves redirects part of the input
|
| 149 |
+
*
|
| 150 |
+
* @param array $input Raw input.
|
| 151 |
+
*/
|
| 152 |
+
public function save_redirects( $input ) {
|
| 153 |
+
$urls = ! empty( $input['urls'] ) && is_array( $input['urls'] )
|
| 154 |
+
? $input['urls']
|
| 155 |
+
: array();
|
| 156 |
+
$redirection_model = new Smartcrawl_Model_Redirection();
|
| 157 |
+
|
| 158 |
+
$new_urls = array();
|
| 159 |
+
$new_types = array();
|
| 160 |
+
foreach ( $urls as $index => $url_details ) {
|
| 161 |
+
$source = smartcrawl_get_array_value( $url_details, 'source' );
|
| 162 |
+
$source = trim( esc_url( $source ) );
|
| 163 |
+
|
| 164 |
+
$destination = smartcrawl_get_array_value( $url_details, 'destination' );
|
| 165 |
+
$destination = trim( esc_url( $destination ) );
|
| 166 |
+
|
| 167 |
+
if ( ! trim( $source ) || ! trim( $destination ) ) {
|
| 168 |
+
continue;
|
| 169 |
+
}
|
| 170 |
+
if ( ! preg_match( '/^https?:\/\//', $source ) ) {
|
| 171 |
+
$source = home_url( $source );
|
| 172 |
+
}
|
| 173 |
+
if ( ! preg_match( '/^https?:\/\//', $destination ) ) {
|
| 174 |
+
$destination = home_url( $destination );
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
$new_urls[ $source ] = $destination;
|
| 178 |
+
|
| 179 |
+
$type = smartcrawl_get_array_value( $url_details, 'type' );
|
| 180 |
+
$status = $redirection_model->get_valid_redirection_status_type( $type );
|
| 181 |
+
|
| 182 |
+
$new_types[ $source ] = $status;
|
| 183 |
+
}
|
| 184 |
+
$redirection_model->set_all_redirections( $new_urls );
|
| 185 |
+
$redirection_model->set_all_redirection_types( $new_types );
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
/**
|
| 189 |
+
* Process extra options
|
| 190 |
+
*
|
| 191 |
+
* @param array $input Raw input.
|
| 192 |
+
*/
|
| 193 |
+
private function _validate_and_save_extra_options( $input ) {
|
| 194 |
+
$settings = Smartcrawl_Settings::get_specific_options( 'wds_settings_options' );
|
| 195 |
+
$settings['redirections-code'] = (int) $input['redirections-code'];
|
| 196 |
+
Smartcrawl_Settings::update_specific_options( 'wds_settings_options', $settings );
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
/**
|
| 200 |
+
* Gets site service instance
|
| 201 |
+
*
|
| 202 |
+
* @return object
|
| 203 |
+
*/
|
| 204 |
+
private function get_site_service() {
|
| 205 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );
|
| 206 |
+
|
| 207 |
+
return $service;
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
/**
|
| 211 |
+
* Static known public post types getter
|
| 212 |
+
*
|
| 213 |
+
* @return array A list of known post type *objects* keyed by name
|
| 214 |
+
*/
|
| 215 |
+
public static function get_post_types() {
|
| 216 |
+
static $post_types;
|
| 217 |
+
|
| 218 |
+
if ( empty( $post_types ) ) {
|
| 219 |
+
$exclusions = array(
|
| 220 |
+
'revision',
|
| 221 |
+
'nav_menu_item',
|
| 222 |
+
'attachment',
|
| 223 |
+
);
|
| 224 |
+
$raw = get_post_types( array(
|
| 225 |
+
'public' => true,
|
| 226 |
+
), 'objects' );
|
| 227 |
+
foreach ( $raw as $pt => $pto ) {
|
| 228 |
+
if ( in_array( $pt, $exclusions, true ) ) {
|
| 229 |
+
continue;
|
| 230 |
+
}
|
| 231 |
+
$post_types[ $pt ] = $pto;
|
| 232 |
+
}
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
return is_array( $post_types )
|
| 236 |
+
? $post_types
|
| 237 |
+
: array();
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
/**
|
| 241 |
+
* Initializes the admin pane
|
| 242 |
+
*/
|
| 243 |
+
public function init() {
|
| 244 |
+
$this->option_name = 'wds_autolinks_options';
|
| 245 |
+
$this->name = Smartcrawl_Settings::COMP_AUTOLINKS;
|
| 246 |
+
$this->slug = Smartcrawl_Settings::TAB_AUTOLINKS;
|
| 247 |
+
$this->action_url = admin_url( 'options.php' );
|
| 248 |
+
$this->title = __( 'Advanced Tools', 'wds' );
|
| 249 |
+
$this->page_title = __( 'SmartCrawl Wizard: Advanced Tools', 'wds' );
|
| 250 |
+
|
| 251 |
+
add_action( 'wp_ajax_wds-load_exclusion-post_data', array( $this, 'json_load_post' ) );
|
| 252 |
+
add_action( 'wp_ajax_wds-load_exclusion_posts-posts_data-specific', array(
|
| 253 |
+
$this,
|
| 254 |
+
'json_load_posts_specific',
|
| 255 |
+
) );
|
| 256 |
+
add_action( 'wp_ajax_wds-load_exclusion_posts-posts_data-paged', array( $this, 'json_load_posts_paged' ) );
|
| 257 |
+
add_action( 'admin_init', array( $this, 'reset_moz_api_credentials' ) );
|
| 258 |
+
|
| 259 |
+
parent::init();
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
/**
|
| 263 |
+
* Resets Moz API creds
|
| 264 |
+
*/
|
| 265 |
+
public function reset_moz_api_credentials() {
|
| 266 |
+
$post_data = $this->get_request_data();
|
| 267 |
+
if ( isset( $post_data['reset-moz-credentials'] ) ) { // Just a presence flag.
|
| 268 |
+
$options = self::get_specific_options( 'wds_settings_options' );
|
| 269 |
+
unset( $options['access-id'] );
|
| 270 |
+
unset( $options['secret-key'] );
|
| 271 |
+
self::update_specific_options( 'wds_settings_options', $options );
|
| 272 |
+
|
| 273 |
+
$ref = wp_get_referer();
|
| 274 |
+
$ref = ! empty( $ref )
|
| 275 |
+
? $ref
|
| 276 |
+
: Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_AUTOLINKS );
|
| 277 |
+
wp_safe_redirect( esc_url_raw( $ref ) );
|
| 278 |
+
die;
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
/**
|
| 283 |
+
* Loads Individual post data
|
| 284 |
+
*
|
| 285 |
+
* Outputs AJAX response
|
| 286 |
+
*/
|
| 287 |
+
public function json_load_post() {
|
| 288 |
+
$post_data = $this->get_request_data();
|
| 289 |
+
$result = array(
|
| 290 |
+
'id' => 0,
|
| 291 |
+
'title' => '',
|
| 292 |
+
'type' => '',
|
| 293 |
+
);
|
| 294 |
+
if ( ! current_user_can( 'edit_others_posts' ) || empty( $post_data ) ) {
|
| 295 |
+
wp_send_json( $result );
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
$post_id = ! empty( $post_data['id'] ) && is_numeric( $post_data['id'] )
|
| 299 |
+
? (int) $post_data['id']
|
| 300 |
+
: false;
|
| 301 |
+
if ( empty( $post_id ) ) {
|
| 302 |
+
wp_send_json( $result );
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
$post = get_post( $post_id );
|
| 306 |
+
if ( ! $post ) {
|
| 307 |
+
wp_send_json( $result );
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
wp_send_json( $this->_post_to_response_data( $post ) );
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
/**
|
| 314 |
+
* Makes the post response format uniform
|
| 315 |
+
*
|
| 316 |
+
* @param object $post WP_Post instance.
|
| 317 |
+
*
|
| 318 |
+
* @return array Post response hash
|
| 319 |
+
*/
|
| 320 |
+
private function _post_to_response_data( $post ) {
|
| 321 |
+
$result = array(
|
| 322 |
+
'id' => 0,
|
| 323 |
+
'title' => '',
|
| 324 |
+
'type' => '',
|
| 325 |
+
'date' => '',
|
| 326 |
+
);
|
| 327 |
+
if ( empty( $post ) || empty( $post->ID ) ) {
|
| 328 |
+
return $result;
|
| 329 |
+
}
|
| 330 |
+
static $date_format;
|
| 331 |
+
|
| 332 |
+
if ( empty( $date_format ) ) {
|
| 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 |
+
}
|
| 344 |
+
|
| 345 |
+
/**
|
| 346 |
+
* Loads posts by specific IDs
|
| 347 |
+
*
|
| 348 |
+
* Outputs AJAX response
|
| 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 |
+
);
|
| 356 |
+
if ( ! current_user_can( 'edit_others_posts' ) || empty( $post_data ) ) {
|
| 357 |
+
wp_send_json( $result );
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
$post_ids = ! empty( $post_data['posts'] ) && is_array( $post_data['posts'] )
|
| 361 |
+
? array_values( array_filter( array_map( 'intval', $post_data['posts'] ) ) )
|
| 362 |
+
: array();
|
| 363 |
+
if ( empty( $post_ids ) ) {
|
| 364 |
+
wp_send_json( $result );
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
$args = array(
|
| 368 |
+
'post_status' => 'publish',
|
| 369 |
+
'posts_per_page' => - 1,
|
| 370 |
+
'post__in' => $post_ids,
|
| 371 |
+
'ignore_sticky_posts' => true,
|
| 372 |
+
'post_type' => 'any',
|
| 373 |
+
);
|
| 374 |
+
|
| 375 |
+
$query = new WP_Query( $args );
|
| 376 |
+
|
| 377 |
+
$result['meta'] = array(
|
| 378 |
+
'total' => $query->max_num_pages,
|
| 379 |
+
'page' => 1,
|
| 380 |
+
);
|
| 381 |
+
|
| 382 |
+
foreach ( $query->posts as $post ) {
|
| 383 |
+
$result['posts'][] = $this->_post_to_response_data( $post );
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
wp_send_json( $result );
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
/**
|
| 390 |
+
* Loads paged posts of certain type
|
| 391 |
+
*
|
| 392 |
+
* Outputs AJAX response
|
| 393 |
+
*/
|
| 394 |
+
public function json_load_posts_paged() {
|
| 395 |
+
$post_data = $this->get_request_data();
|
| 396 |
+
$result = array(
|
| 397 |
+
'meta' => array(),
|
| 398 |
+
'posts' => array(),
|
| 399 |
+
);
|
| 400 |
+
if ( ! current_user_can( 'edit_others_posts' ) || empty( $post_data ) ) {
|
| 401 |
+
wp_send_json( $result );
|
| 402 |
+
}
|
| 403 |
+
$args = array(
|
| 404 |
+
'post_status' => 'publish',
|
| 405 |
+
'posts_per_page' => 10,
|
| 406 |
+
'ignore_sticky_posts' => true,
|
| 407 |
+
);
|
| 408 |
+
$page = 1;
|
| 409 |
+
if ( ! empty( $post_data['type'] ) && in_array( $post_data['type'], array_keys( self::get_post_types() ), true ) ) {
|
| 410 |
+
$args['post_type'] = sanitize_key( $post_data['type'] );
|
| 411 |
+
}
|
| 412 |
+
if ( ! empty( $post_data['page'] ) && is_numeric( $post_data['page'] ) ) {
|
| 413 |
+
$args['paged'] = (int) $post_data['page'];
|
| 414 |
+
$page = $args['paged'];
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
$query = new WP_Query( $args );
|
| 418 |
+
|
| 419 |
+
$result['meta'] = array(
|
| 420 |
+
'total' => $query->max_num_pages,
|
| 421 |
+
'page' => $page,
|
| 422 |
+
);
|
| 423 |
+
|
| 424 |
+
foreach ( $query->posts as $post ) {
|
| 425 |
+
$result['posts'][] = $this->_post_to_response_data( $post );
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
wp_send_json( $result );
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
/**
|
| 432 |
+
* Add admin settings page
|
| 433 |
+
*/
|
| 434 |
+
public function options_page() {
|
| 435 |
+
parent::options_page();
|
| 436 |
+
|
| 437 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 438 |
+
$arguments = array(
|
| 439 |
+
'insert' => array(),
|
| 440 |
+
);
|
| 441 |
+
|
| 442 |
+
$post_types = array();
|
| 443 |
+
foreach ( self::get_post_types() as $post_type => $pt ) {
|
| 444 |
+
$key = strtolower( $pt->name );
|
| 445 |
+
$post_types["l{$key}"] = $pt->labels->name;
|
| 446 |
+
|
| 447 |
+
$arguments['insert']["{$key}"] = $pt->labels->name;
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
$taxonomies = array();
|
| 451 |
+
foreach ( get_taxonomies() as $taxonomy ) {
|
| 452 |
+
if ( ! in_array( $taxonomy, array( 'nav_menu', 'link_category', 'post_format' ), true ) ) {
|
| 453 |
+
$tax = get_taxonomy( $taxonomy );
|
| 454 |
+
$key = strtolower( $tax->labels->name );
|
| 455 |
+
|
| 456 |
+
$taxonomies["l{$key}"] = $tax->labels->name;
|
| 457 |
+
}
|
| 458 |
+
}
|
| 459 |
+
$redirection_model = new Smartcrawl_Model_Redirection();
|
| 460 |
+
$arguments['redirections'] = $redirection_model->get_all_redirections();
|
| 461 |
+
$arguments['redirection_types'] = $redirection_model->get_all_redirection_types();
|
| 462 |
+
|
| 463 |
+
$arguments['linkto'] = array_merge( $post_types, $taxonomies );
|
| 464 |
+
$arguments['insert']['comment'] = __( 'Comments', 'wds' );
|
| 465 |
+
|
| 466 |
+
$arguments['active_tab'] = $this->_get_last_active_tab( 'tab_automatic_linking' );
|
| 467 |
+
|
| 468 |
+
wp_enqueue_script( 'wds-admin-autolinks' );
|
| 469 |
+
wp_enqueue_script( 'wds-admin-redirects' );
|
| 470 |
+
$this->_render_page( 'advanced-tools/advanced-tools-settings', $arguments );
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
/**
|
| 474 |
+
* Default settings
|
| 475 |
+
*/
|
| 476 |
+
public function defaults() {
|
| 477 |
+
|
| 478 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 479 |
+
$this->options = get_site_option( $this->option_name );
|
| 480 |
+
} else {
|
| 481 |
+
$this->options = get_option( $this->option_name );
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
if ( empty( $this->options['ignorepost'] ) ) {
|
| 485 |
+
$this->options['ignorepost'] = '';
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
if ( empty( $this->options['ignore'] ) ) {
|
| 489 |
+
$this->options['ignore'] = '';
|
| 490 |
+
}
|
| 491 |
+
|
| 492 |
+
if ( empty( $this->options['customkey'] ) ) {
|
| 493 |
+
$this->options['customkey'] = '';
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
if ( empty( $this->options['cpt_char_limit'] ) ) {
|
| 497 |
+
$this->options['cpt_char_limit'] = '';
|
| 498 |
+
}
|
| 499 |
+
|
| 500 |
+
if ( empty( $this->options['tax_char_limit'] ) ) {
|
| 501 |
+
$this->options['tax_char_limit'] = '';
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
if ( ! isset( $this->options['link_limit'] ) ) {
|
| 505 |
+
$this->options['link_limit'] = '';
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
if ( ! isset( $this->options['single_link_limit'] ) ) {
|
| 509 |
+
$this->options['single_link_limit'] = '';
|
| 510 |
+
}
|
| 511 |
+
|
| 512 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 513 |
+
update_site_option( $this->option_name, $this->options );
|
| 514 |
+
} else {
|
| 515 |
+
update_option( $this->option_name, $this->options );
|
| 516 |
+
}
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
/**
|
| 520 |
+
* @return array
|
| 521 |
+
*/
|
| 522 |
+
private function get_request_data() {
|
| 523 |
+
return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-autolinks-nonce' ) ? $_POST : array();
|
| 524 |
+
}
|
| 525 |
+
}
|
| 526 |
+
|
includes/admin/settings/checkup.php
CHANGED
|
@@ -1,175 +1,196 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Checkup service
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
/**
|
| 9 |
-
* Checkup service admin handler class
|
| 10 |
-
*/
|
| 11 |
-
class Smartcrawl_Checkup_Settings extends Smartcrawl_Settings_Admin {
|
| 12 |
-
|
| 13 |
-
/**
|
| 14 |
-
* Singleton instance
|
| 15 |
-
*
|
| 16 |
-
* @var Smartcrawl_Checkup_Settings
|
| 17 |
-
*/
|
| 18 |
-
private static $_instance;
|
| 19 |
-
|
| 20 |
-
/**
|
| 21 |
-
* Singleton instance getter
|
| 22 |
-
*
|
| 23 |
-
* @return Smartcrawl_Checkup_Settings instance
|
| 24 |
-
*/
|
| 25 |
-
public static function get_instance() {
|
| 26 |
-
if ( empty( self::$_instance ) ) {
|
| 27 |
-
self::$_instance = new self;
|
| 28 |
-
}
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
*
|
| 35 |
-
*
|
| 36 |
-
*
|
| 37 |
-
*
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
$
|
| 88 |
-
|
| 89 |
-
$
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
);
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
$
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
'checkup-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Checkup service
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* Checkup service admin handler class
|
| 10 |
+
*/
|
| 11 |
+
class Smartcrawl_Checkup_Settings extends Smartcrawl_Settings_Admin {
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* Singleton instance
|
| 15 |
+
*
|
| 16 |
+
* @var Smartcrawl_Checkup_Settings
|
| 17 |
+
*/
|
| 18 |
+
private static $_instance;
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Singleton instance getter
|
| 22 |
+
*
|
| 23 |
+
* @return Smartcrawl_Checkup_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
|
| 35 |
+
*
|
| 36 |
+
* @param array $input Raw input.
|
| 37 |
+
*
|
| 38 |
+
* @return array Validated input
|
| 39 |
+
*/
|
| 40 |
+
public function validate( $input ) {
|
| 41 |
+
if ( ! empty( $input['email-recipients'] ) && is_array( $input['email-recipients'] ) ) {
|
| 42 |
+
$result['email-recipients'] = array();
|
| 43 |
+
foreach ( $input['email-recipients'] as $user ) {
|
| 44 |
+
if ( ! is_numeric( $user ) ) {
|
| 45 |
+
$user_obj = get_user_by( 'login', $user );
|
| 46 |
+
$user = $user_obj->ID;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
if ( is_numeric( $user ) ) {
|
| 50 |
+
$result['email-recipients'][] = (int) $user;
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
$result['email-recipients'] = array_values( array_filter( array_unique( $result['email-recipients'] ) ) );
|
| 54 |
+
}
|
| 55 |
+
if ( empty( $result['email-recipients'] ) ) {
|
| 56 |
+
$defaults = $this->get_default_options();
|
| 57 |
+
$result['email-recipients'] = $defaults['email-recipients'];
|
| 58 |
+
|
| 59 |
+
add_settings_error(
|
| 60 |
+
$this->option_name,
|
| 61 |
+
'email-recipients-required',
|
| 62 |
+
esc_html__( 'There has to be at least one email recipient. The default recipient has been added back.', 'wds' )
|
| 63 |
+
);
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
if ( empty( $input['checkup-cron-enable'] ) ) {
|
| 67 |
+
$result['checkup-cron-enable'] = false;
|
| 68 |
+
|
| 69 |
+
return $result;
|
| 70 |
+
} else {
|
| 71 |
+
$result['checkup-cron-enable'] = true;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
$frequency = ! empty( $input['checkup-frequency'] )
|
| 75 |
+
? Smartcrawl_Controller_Cron::get()->get_valid_frequency( $input['checkup-frequency'] )
|
| 76 |
+
: Smartcrawl_Controller_Cron::get()->get_default_frequency();
|
| 77 |
+
$result['checkup-frequency'] = $frequency;
|
| 78 |
+
|
| 79 |
+
$dow = isset( $input['checkup-dow'] ) && is_numeric( $input['checkup-dow'] )
|
| 80 |
+
? (int) $input['checkup-dow']
|
| 81 |
+
: 0;
|
| 82 |
+
$result['checkup-dow'] = in_array( $dow, range( 0, 6 ), true ) ? $dow : 0;
|
| 83 |
+
|
| 84 |
+
$tod = isset( $input['checkup-tod'] ) && is_numeric( $input['checkup-tod'] )
|
| 85 |
+
? (int) $input['checkup-tod']
|
| 86 |
+
: 0;
|
| 87 |
+
$result['checkup-tod'] = in_array( $tod, range( 0, 23 ), true ) ? $tod : 0;
|
| 88 |
+
|
| 89 |
+
return $result;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* Gets default options set and their initial values
|
| 94 |
+
*
|
| 95 |
+
* @return array
|
| 96 |
+
*/
|
| 97 |
+
public function get_default_options() {
|
| 98 |
+
return array(
|
| 99 |
+
'checkup-cron-enable' => false,
|
| 100 |
+
'checkup-frequency' => 'weekly',
|
| 101 |
+
'checkup-dow' => rand( 0, 6 ),
|
| 102 |
+
'checkup-tod' => rand( 0, 23 ),
|
| 103 |
+
'email-recipients' => array( get_current_user_id() ),
|
| 104 |
+
);
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
/**
|
| 108 |
+
* Initialize admin pane
|
| 109 |
+
*/
|
| 110 |
+
public function init() {
|
| 111 |
+
$this->option_name = 'wds_checkup_options';
|
| 112 |
+
$this->name = Smartcrawl_Settings::COMP_CHECKUP;
|
| 113 |
+
$this->slug = Smartcrawl_Settings::TAB_CHECKUP;
|
| 114 |
+
$this->action_url = admin_url( 'options.php' );
|
| 115 |
+
$this->title = __( 'SEO Checkup', 'wds' );
|
| 116 |
+
$this->page_title = __( 'SmartCrawl Wizard: SEO Checkup', 'wds' );
|
| 117 |
+
|
| 118 |
+
parent::init();
|
| 119 |
+
|
| 120 |
+
add_action( 'wp_ajax_wds-checkup-status', array( $this, 'ajax_checkup_status' ) );
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
/**
|
| 124 |
+
* Checks checkup service status and sends back percentage.
|
| 125 |
+
*/
|
| 126 |
+
public function ajax_checkup_status() {
|
| 127 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 128 |
+
$percentage = $service->status();
|
| 129 |
+
wp_send_json_success( array(
|
| 130 |
+
'percentage' => $percentage,
|
| 131 |
+
) );
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* Process run action
|
| 136 |
+
*/
|
| 137 |
+
public function process_run_action() {
|
| 138 |
+
if ( isset( $_GET['_wds_nonce'], $_GET['run-checkup'] ) && wp_verify_nonce( $_GET['_wds_nonce'], 'wds-checkup-nonce' ) ) { // Simple presence switch, no value.
|
| 139 |
+
return $this->run_checkup();
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
public static function checkup_url() {
|
| 144 |
+
$checkup_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_CHECKUP );
|
| 145 |
+
|
| 146 |
+
return esc_url_raw( add_query_arg( array(
|
| 147 |
+
'run-checkup' => 'yes',
|
| 148 |
+
'_wds_nonce' => wp_create_nonce( 'wds-checkup-nonce' ),
|
| 149 |
+
), $checkup_url ) );
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
/**
|
| 153 |
+
* Add admin settings page
|
| 154 |
+
*/
|
| 155 |
+
public function options_page() {
|
| 156 |
+
parent::options_page();
|
| 157 |
+
|
| 158 |
+
$options = Smartcrawl_Settings::get_component_options( $this->name );
|
| 159 |
+
$options = wp_parse_args(
|
| 160 |
+
( is_array( $options ) ? $options : array() ),
|
| 161 |
+
$this->get_default_options()
|
| 162 |
+
);
|
| 163 |
+
|
| 164 |
+
$arguments = array(
|
| 165 |
+
'options' => $options,
|
| 166 |
+
'active_tab' => $this->_get_last_active_tab( 'tab_checkup' ),
|
| 167 |
+
);
|
| 168 |
+
|
| 169 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 170 |
+
wp_enqueue_script( 'wds-admin-checkup' );
|
| 171 |
+
|
| 172 |
+
$this->_render_page( 'checkup/checkup-settings', $arguments );
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
/**
|
| 176 |
+
* Default settings
|
| 177 |
+
*/
|
| 178 |
+
public function defaults() {
|
| 179 |
+
$options = Smartcrawl_Settings::get_component_options( $this->name );
|
| 180 |
+
$options = is_array( $options ) ? $options : array();
|
| 181 |
+
|
| 182 |
+
foreach ( $this->get_default_options() as $opt => $default ) {
|
| 183 |
+
if ( ! isset( $options[ $opt ] ) ) {
|
| 184 |
+
$options[ $opt ] = $default;
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 189 |
+
update_site_option( $this->option_name, $options );
|
| 190 |
+
} else {
|
| 191 |
+
update_option( $this->option_name, $options );
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
}
|
| 196 |
+
|
includes/admin/settings/dashboard.php
CHANGED
|
@@ -1,604 +1,442 @@
|
|
| 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_SEO_CHECKUP = 'wds-seo-checkup';
|
| 12 |
-
const BOX_TOP_STATS = 'wds-dashboard-stats';
|
| 13 |
-
|
| 14 |
-
protected $_seo_service;
|
| 15 |
-
protected $_uptime_service;
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
public function init() {
|
| 30 |
-
$this->slug = Smartcrawl_Settings::TAB_DASHBOARD;
|
| 31 |
-
$this->title = __( 'SmartCrawl', 'wds' );
|
| 32 |
-
$this->sub_title = __( 'Dashboard', 'wds' );
|
| 33 |
-
$this->page_title = __( 'SmartCrawl Wizard: Dashboard', 'wds' );
|
| 34 |
-
|
| 35 |
-
add_action( 'wp_ajax_wds-service-
|
| 36 |
-
add_action( 'wp_ajax_wds-service-
|
| 37 |
-
add_action( 'wp_ajax_wds-service-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
add_action( 'wp_ajax_wds-service-
|
| 41 |
-
add_action( 'wp_ajax_wds-
|
| 42 |
-
add_action( 'wp_ajax_wds-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
$
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
$
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
$result
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
return;
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
return;
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
-
$issue_id = $data['issue_id'];
|
| 104 |
-
$issue_ids = is_array( $issue_id )
|
| 105 |
-
? array_map( 'sanitize_text_field', $issue_id )
|
| 106 |
-
: array( sanitize_text_field( $issue_id ) )
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
$service
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
$result
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
$ignores = new Smartcrawl_Model_Ignores;
|
| 132 |
-
|
| 133 |
-
if ( $ignores->clear() ) {
|
| 134 |
-
// Send updated list to Hub
|
| 135 |
-
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 136 |
-
if ( ! $service->sync_ignores() ) {
|
| 137 |
-
Smartcrawl_Logger::debug( 'We encountered an error syncing ignores with Hub' );
|
| 138 |
-
}
|
| 139 |
-
|
| 140 |
-
$result['status'] = 1;
|
| 141 |
-
}
|
| 142 |
-
|
| 143 |
-
return wp_send_json( $result );
|
| 144 |
-
}
|
| 145 |
-
|
| 146 |
-
/**
|
| 147 |
-
* Handles sitemap updating requests
|
| 148 |
-
*/
|
| 149 |
-
public function json_service_update_sitemap() {
|
| 150 |
-
$result = array();
|
| 151 |
-
$controller = Smartcrawl_Controller_Sitemap::get();
|
| 152 |
-
|
| 153 |
-
// First up, find out how much stuff we got in the sitemap
|
| 154 |
-
$data = $controller->get_sitemap_stats();
|
| 155 |
-
$previous_count = ! empty( $data['items'] ) && is_numeric( $data['items'] )
|
| 156 |
-
? (int) $data['items']
|
| 157 |
-
: 0
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
$
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
;
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
;
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
$service->set_result( $cres );
|
| 203 |
-
}
|
| 204 |
-
|
| 205 |
-
$result = array(
|
| 206 |
-
'previous' => $previous_count,
|
| 207 |
-
'current'
|
| 208 |
-
'diff'
|
| 209 |
-
);
|
| 210 |
-
|
| 211 |
-
wp_send_json( $result );
|
| 212 |
-
}
|
| 213 |
-
|
| 214 |
-
/**
|
| 215 |
-
* Handles service redirect requests
|
| 216 |
-
*/
|
| 217 |
-
public function json_service_redirect() {
|
| 218 |
-
$data =
|
| 219 |
-
$result = array();
|
| 220 |
-
|
| 221 |
-
if (
|
| 222 |
-
empty( $data['source'] ) ||
|
| 223 |
-
empty( $data['redirect'] ) ||
|
| 224 |
-
empty( $data['wds-redirect'] )
|
| 225 |
-
) {
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
$
|
| 236 |
-
$
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
$
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
$
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
$
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
'
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
;
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
$
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
$
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
$
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
$
|
| 376 |
-
|
| 377 |
-
$
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
$
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
* @return string
|
| 444 |
-
*/
|
| 445 |
-
private function _get_seo_service_message() {
|
| 446 |
-
$service = $this->_get_seo_service();
|
| 447 |
-
$msg = '';
|
| 448 |
-
|
| 449 |
-
// First up, can we access this at all?
|
| 450 |
-
if ( $service->can_access() ) {
|
| 451 |
-
|
| 452 |
-
// Okay, we can
|
| 453 |
-
if ( $service->has_dashboard() ) {
|
| 454 |
-
$result = $service->get_result();
|
| 455 |
-
$status = false;
|
| 456 |
-
|
| 457 |
-
// If we don't have perma-cached result,
|
| 458 |
-
// we issued a re-crawl. So, let's check where we're at
|
| 459 |
-
if ( empty( $result ) ) {
|
| 460 |
-
$status = $service->status();
|
| 461 |
-
$result = ! empty( $status['end'] )
|
| 462 |
-
? $service->result()
|
| 463 |
-
: array()
|
| 464 |
-
;
|
| 465 |
-
} else { $status = $result; }
|
| 466 |
-
|
| 467 |
-
if ( ! class_exists( 'Smartcrawl_SeoReport' ) ) { require_once( SMARTCRAWL_PLUGIN_DIR . 'core/class_wds_seo_report.php' ); }
|
| 468 |
-
$report = Smartcrawl_SeoReport::build( $result );
|
| 469 |
-
|
| 470 |
-
$rmodel = new Smartcrawl_Model_Redirection;
|
| 471 |
-
|
| 472 |
-
// We have Dashboard ready to go, we're connected and all
|
| 473 |
-
$msg = $this->_load('dashboard-dialog-has_dashboard-service_seo', array(
|
| 474 |
-
'status' => $status,
|
| 475 |
-
'has_result' => ! empty( $result ),
|
| 476 |
-
'report' => $report,
|
| 477 |
-
'redirections' => $rmodel->get_all_redirections(),
|
| 478 |
-
'errors' => $service->get_errors(),
|
| 479 |
-
));
|
| 480 |
-
} elseif ( $service->is_dahsboard_active() ) {
|
| 481 |
-
// Dashboard is active, but we're not connected
|
| 482 |
-
$msg = $this->_load( 'dashboard-dialog-not_logged_in-service_seo' );
|
| 483 |
-
} else {
|
| 484 |
-
// Dashboard not installed
|
| 485 |
-
// Can we even install?
|
| 486 |
-
if ( $service->can_install() ) { $msg = $this->_load( 'dashboard-dialog-not_installed-service_seo' ); }
|
| 487 |
-
}
|
| 488 |
-
}
|
| 489 |
-
|
| 490 |
-
return $msg;
|
| 491 |
-
}
|
| 492 |
-
|
| 493 |
-
/**
|
| 494 |
-
* Gets the Uptime service box part
|
| 495 |
-
*
|
| 496 |
-
* Temporarily disabled
|
| 497 |
-
*
|
| 498 |
-
* @return string
|
| 499 |
-
*/
|
| 500 |
-
private function _get_uptime_service_message() {
|
| 501 |
-
// As per Asana task, temporarily disable uptime report
|
| 502 |
-
// See: https://app.asana.com/0/345574004857/277849197601097/
|
| 503 |
-
return false;
|
| 504 |
-
|
| 505 |
-
$service = $this->_get_uptime_service();
|
| 506 |
-
$msg = '';
|
| 507 |
-
|
| 508 |
-
// First up, can we access this at all?
|
| 509 |
-
if ( $service->can_access() ) {
|
| 510 |
-
|
| 511 |
-
// Okay, we can
|
| 512 |
-
if ( $service->is_dahsboard_active() ) {
|
| 513 |
-
// We have Dashboard active, good enough
|
| 514 |
-
$response = $service->request( 'day' );
|
| 515 |
-
$msg = $this->_load('dashboard-dialog-has_dashboard-service_uptime', array(
|
| 516 |
-
'data' => $response,
|
| 517 |
-
'errors' => $service->get_errors(),
|
| 518 |
-
));
|
| 519 |
-
} else {
|
| 520 |
-
// Dashboard not installed
|
| 521 |
-
// Can we even install?
|
| 522 |
-
if ( $service->can_install() ) { $msg = $this->_load( 'dashboard-dialog-not_installed-service_uptime' ); }
|
| 523 |
-
}
|
| 524 |
-
}
|
| 525 |
-
|
| 526 |
-
return $msg;
|
| 527 |
-
}
|
| 528 |
-
|
| 529 |
-
/**
|
| 530 |
-
* Add sub page to the Settings Menu
|
| 531 |
-
*/
|
| 532 |
-
public function add_page() {
|
| 533 |
-
if ( ! $this->_is_current_tab_allowed() ) { return false; }
|
| 534 |
-
|
| 535 |
-
$svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="18px" height="18px" xmlns="http://www.w3.org/2000/svg"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Artboard" fill-rule="nonzero" fill="#FFFFFF"><path d="M0.558,12.1008055 L17.445,12.1008055 C16.1402452,15.6456454 12.7704642,18 9.0015,18 C5.23253577,18 1.86275481,15.6456454 0.558,12.1008055 Z M17.442,5.89919449 L0.555,5.89919449 C1.85975481,2.35435463 5.22953577,4.81675263e-16 8.9985,7.11236625e-16 C12.7674642,9.40797988e-16 16.1372452,2.35435463 17.442,5.89919449 Z M0.042,8 L17.958,8 C17.985,8.32740214 18,8.66192171 18,9 C18,9.33807829 17.985,9.66903915 17.958,10 L0.042,10 C0.018,9.66903915 0,9.33807829 0,9 C0,8.66192171 0.018,8.32740214 0.042,8 Z" id="smartcrawl"></path></g></g></svg>';
|
| 536 |
-
$icon = 'data:image/svg+xml;base64,' . base64_encode( $svg );
|
| 537 |
-
|
| 538 |
-
$this->smartcrawl_page_hook = add_menu_page(
|
| 539 |
-
$this->page_title,
|
| 540 |
-
$this->title,
|
| 541 |
-
$this->capability,
|
| 542 |
-
$this->slug,
|
| 543 |
-
array( &$this, 'options_page' ),
|
| 544 |
-
$icon
|
| 545 |
-
);
|
| 546 |
-
|
| 547 |
-
$this->smartcrawl_page_hook = add_submenu_page(
|
| 548 |
-
$this->slug,
|
| 549 |
-
$this->page_title,
|
| 550 |
-
$this->sub_title,
|
| 551 |
-
$this->capability,
|
| 552 |
-
$this->slug,
|
| 553 |
-
array( &$this, 'options_page' )
|
| 554 |
-
);
|
| 555 |
-
|
| 556 |
-
// For pages that can deal with run requests, let's make sure they
|
| 557 |
-
// actually do that early enough
|
| 558 |
-
if ( is_callable( array( $this, 'process_run_action' ) ) ) {
|
| 559 |
-
add_action( 'load-' . $this->smartcrawl_page_hook, array( $this, 'process_run_action' ) );
|
| 560 |
-
}
|
| 561 |
-
|
| 562 |
-
add_action( "admin_print_styles-{$this->smartcrawl_page_hook}", array( &$this, 'admin_styles' ) );
|
| 563 |
-
add_action( "admin_print_scripts-{$this->smartcrawl_page_hook}", array( &$this, 'admin_scripts' ) );
|
| 564 |
-
}
|
| 565 |
-
|
| 566 |
-
/**
|
| 567 |
-
* Default settings
|
| 568 |
-
*/
|
| 569 |
-
public function defaults() {
|
| 570 |
-
$this->options = Smartcrawl_Settings::get_options();
|
| 571 |
-
}
|
| 572 |
-
|
| 573 |
-
/**
|
| 574 |
-
* Always allow dashboard tab if there's more than one tab allowed
|
| 575 |
-
*
|
| 576 |
-
* Overrides Smartcrawl_Settings::_is_current_tab_allowed
|
| 577 |
-
*
|
| 578 |
-
* @return bool
|
| 579 |
-
*/
|
| 580 |
-
protected function _is_current_tab_allowed() {
|
| 581 |
-
if ( parent::_is_current_tab_allowed() ) { return true; }
|
| 582 |
-
// Else we always add dashboard if there are other pages
|
| 583 |
-
$all_tabs = Smartcrawl_Settings_Settings::get_blog_tabs();
|
| 584 |
-
|
| 585 |
-
return ! empty( $all_tabs );
|
| 586 |
-
}
|
| 587 |
-
|
| 588 |
-
protected function _get_seo_service() {
|
| 589 |
-
if ( ! empty( $this->_seo_service ) ) { return $this->_seo_service; }
|
| 590 |
-
|
| 591 |
-
$this->_seo_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 592 |
-
|
| 593 |
-
return $this->_seo_service;
|
| 594 |
-
}
|
| 595 |
-
|
| 596 |
-
protected function _get_uptime_service() {
|
| 597 |
-
if ( ! empty( $this->_uptime_service ) ) { return $this->_uptime_service; }
|
| 598 |
-
|
| 599 |
-
$this->_uptime_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_UPTIME );
|
| 600 |
-
|
| 601 |
-
return $this->_uptime_service;
|
| 602 |
-
}
|
| 603 |
-
|
| 604 |
-
}
|
| 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_SEO_CHECKUP = 'wds-seo-checkup';
|
| 12 |
+
const BOX_TOP_STATS = 'wds-dashboard-stats';
|
| 13 |
+
private static $_instance;
|
| 14 |
+
protected $_seo_service;
|
| 15 |
+
protected $_uptime_service;
|
| 16 |
+
|
| 17 |
+
public static function get_instance() {
|
| 18 |
+
if ( empty( self::$_instance ) ) {
|
| 19 |
+
self::$_instance = new self();
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
return self::$_instance;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function validate( $input ) {
|
| 26 |
+
return $input;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
public function init() {
|
| 30 |
+
$this->slug = Smartcrawl_Settings::TAB_DASHBOARD;
|
| 31 |
+
$this->title = __( 'SmartCrawl', 'wds' );
|
| 32 |
+
$this->sub_title = __( 'Dashboard', 'wds' );
|
| 33 |
+
$this->page_title = __( 'SmartCrawl Wizard: Dashboard', 'wds' );
|
| 34 |
+
|
| 35 |
+
add_action( 'wp_ajax_wds-service-redirect', array( $this, 'json_service_redirect' ) );
|
| 36 |
+
add_action( 'wp_ajax_wds-service-ignore', array( $this, 'json_service_ignore' ) );
|
| 37 |
+
add_action( 'wp_ajax_wds-service-unignore', array( $this, 'json_service_unignore' ) );
|
| 38 |
+
add_action( 'wp_ajax_wds-service-ignores-purge', array( $this, 'json_service_ignores_purge' ) );
|
| 39 |
+
|
| 40 |
+
add_action( 'wp_ajax_wds-service-update_sitemap', array( $this, 'json_service_update_sitemap' ) );
|
| 41 |
+
add_action( 'wp_ajax_wds-activate-component', array( $this, 'json_activate_component' ) );
|
| 42 |
+
add_action( 'wp_ajax_wds-reload-box', array( $this, 'json_reload_component' ) );
|
| 43 |
+
|
| 44 |
+
parent::init();
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* Handles service ignores addition
|
| 49 |
+
*/
|
| 50 |
+
public function json_service_ignore() {
|
| 51 |
+
$result = array( 'status' => 0 );
|
| 52 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
| 53 |
+
wp_send_json( $result );
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
$ignores = new Smartcrawl_Model_Ignores();
|
| 57 |
+
|
| 58 |
+
$data = $this->get_request_data();
|
| 59 |
+
if ( empty( $data['issue_id'] ) ) {
|
| 60 |
+
wp_send_json( $result );
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
$issue_id = $data['issue_id'];
|
| 64 |
+
$issue_ids = is_array( $issue_id )
|
| 65 |
+
? array_map( 'sanitize_text_field', $issue_id )
|
| 66 |
+
: array( sanitize_text_field( $issue_id ) );
|
| 67 |
+
|
| 68 |
+
foreach ( $issue_ids as $issue ) {
|
| 69 |
+
$ignores->set_ignore( $issue );
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
// Send updated list to Hub
|
| 73 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 74 |
+
if ( ! $service->sync_ignores() ) {
|
| 75 |
+
Smartcrawl_Logger::debug( 'We encountered an error syncing ignores with Hub' );
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
$result['status'] = 1;
|
| 79 |
+
|
| 80 |
+
wp_send_json( $result );
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* Handles service un-ignores addition
|
| 85 |
+
*/
|
| 86 |
+
public function json_service_unignore() {
|
| 87 |
+
$result = array( 'status' => 0 );
|
| 88 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
| 89 |
+
wp_send_json( $result );
|
| 90 |
+
|
| 91 |
+
return;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
$ignores = new Smartcrawl_Model_Ignores();
|
| 95 |
+
|
| 96 |
+
$data = $this->get_request_data();
|
| 97 |
+
if ( empty( $data['issue_id'] ) ) {
|
| 98 |
+
wp_send_json( $result );
|
| 99 |
+
|
| 100 |
+
return;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
$issue_id = $data['issue_id'];
|
| 104 |
+
$issue_ids = is_array( $issue_id )
|
| 105 |
+
? array_map( 'sanitize_text_field', $issue_id )
|
| 106 |
+
: array( sanitize_text_field( $issue_id ) );
|
| 107 |
+
|
| 108 |
+
foreach ( $issue_ids as $issue ) {
|
| 109 |
+
$ignores->unset_ignore( $issue );
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
// Send updated list to Hub
|
| 113 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 114 |
+
if ( ! $service->sync_ignores() ) {
|
| 115 |
+
Smartcrawl_Logger::debug( 'We encountered an error syncing ignores with Hub' );
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
$result['status'] = 1;
|
| 119 |
+
wp_send_json( $result );
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
/**
|
| 123 |
+
* Handles service ignores purging
|
| 124 |
+
*/
|
| 125 |
+
public function json_service_ignores_purge() {
|
| 126 |
+
$result = array( 'status' => 0 );
|
| 127 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
| 128 |
+
return wp_send_json( $result );
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
$ignores = new Smartcrawl_Model_Ignores();
|
| 132 |
+
|
| 133 |
+
if ( $ignores->clear() ) {
|
| 134 |
+
// Send updated list to Hub
|
| 135 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 136 |
+
if ( ! $service->sync_ignores() ) {
|
| 137 |
+
Smartcrawl_Logger::debug( 'We encountered an error syncing ignores with Hub' );
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
$result['status'] = 1;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
return wp_send_json( $result );
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* Handles sitemap updating requests
|
| 148 |
+
*/
|
| 149 |
+
public function json_service_update_sitemap() {
|
| 150 |
+
$result = array();
|
| 151 |
+
$controller = Smartcrawl_Controller_Sitemap::get();
|
| 152 |
+
|
| 153 |
+
// First up, find out how much stuff we got in the sitemap
|
| 154 |
+
$data = $controller->get_sitemap_stats();
|
| 155 |
+
$previous_count = ! empty( $data['items'] ) && is_numeric( $data['items'] )
|
| 156 |
+
? (int) $data['items']
|
| 157 |
+
: 0;
|
| 158 |
+
|
| 159 |
+
// Update sitemap
|
| 160 |
+
$controller->update_sitemap();
|
| 161 |
+
|
| 162 |
+
// Get fresh count
|
| 163 |
+
$data = $controller->get_sitemap_stats();
|
| 164 |
+
$current_count = ! empty( $data['items'] ) && is_numeric( $data['items'] )
|
| 165 |
+
? (int) $data['items']
|
| 166 |
+
: 0;
|
| 167 |
+
|
| 168 |
+
$diff = (int) ( $current_count - $previous_count );
|
| 169 |
+
|
| 170 |
+
// Let's clear up the sitemap service results
|
| 171 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 172 |
+
$cres = $service->get_result();
|
| 173 |
+
if ( isset( $cres['issues'] ) ) {
|
| 174 |
+
$cres['issues']['sitemap'] = ! empty( $cres['issues']['sitemap'] )
|
| 175 |
+
? $cres['issues']['sitemap']
|
| 176 |
+
: 0;
|
| 177 |
+
$cres['issues']['sitemap'] = 0;
|
| 178 |
+
if ( isset( $cres['issues']['issues'] ) ) {
|
| 179 |
+
$cres['issues']['issues']['sitemap'] = 0; // Fix data model deviation
|
| 180 |
+
}
|
| 181 |
+
$cres['issues']['messages'] = ! empty( $cres['issues']['messages'] )
|
| 182 |
+
? $cres['issues']['messages']
|
| 183 |
+
: array();
|
| 184 |
+
// Start with a generic message
|
| 185 |
+
$msg = __( 'Sitemap updated. Please, re-crawl your site', 'wds' );
|
| 186 |
+
if ( $diff > 0 ) {
|
| 187 |
+
sprintf(
|
| 188 |
+
__( 'We just updated your sitemap adding %1$d new items, for a total of %2$d. Please, re-crawl your site', 'wds' ),
|
| 189 |
+
$diff,
|
| 190 |
+
$current_count
|
| 191 |
+
);
|
| 192 |
+
} elseif ( $diff < 0 ) {
|
| 193 |
+
sprintf(
|
| 194 |
+
__( 'No new items were added to your sitemap, but we did detect a change (for %1$d items total). Please, re-crawl your site.', 'wds' ),
|
| 195 |
+
$current_count
|
| 196 |
+
);
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
if ( ! in_array( $msg, $cres['issues']['messages'], true ) ) {
|
| 200 |
+
$cres['issues']['messages'][] = $msg;
|
| 201 |
+
}
|
| 202 |
+
$service->set_result( $cres );
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
$result = array(
|
| 206 |
+
'previous' => $previous_count,
|
| 207 |
+
'current' => $current_count,
|
| 208 |
+
'diff' => $diff,
|
| 209 |
+
);
|
| 210 |
+
|
| 211 |
+
wp_send_json( $result );
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
/**
|
| 215 |
+
* Handles service redirect requests
|
| 216 |
+
*/
|
| 217 |
+
public function json_service_redirect() {
|
| 218 |
+
$data = $this->get_request_data();
|
| 219 |
+
$result = array();
|
| 220 |
+
|
| 221 |
+
if (
|
| 222 |
+
empty( $data['source'] ) ||
|
| 223 |
+
empty( $data['redirect'] ) ||
|
| 224 |
+
empty( $data['wds-redirect'] )
|
| 225 |
+
) {
|
| 226 |
+
wp_send_json_error( $result );
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
if ( ! wp_verify_nonce( $_POST['wds-redirect'], 'wds-redirect' ) ) {
|
| 230 |
+
wp_send_json_error( $result );
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
$is_sitewide = is_multisite() && defined( 'SMARTCRAWL_SITEWIDE' ) && SMARTCRAWL_SITEWIDE;
|
| 234 |
+
|
| 235 |
+
$permissions = $is_sitewide ? 'manage_network_options' : 'manage_options';
|
| 236 |
+
if ( ! current_user_can( $permissions ) ) {
|
| 237 |
+
wp_send_json_error( $result );
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
$source = esc_url( $data['source'] );
|
| 241 |
+
$redirect = esc_url( $data['redirect'] );
|
| 242 |
+
$rmodel = new Smartcrawl_Model_Redirection();
|
| 243 |
+
|
| 244 |
+
$status_code = $rmodel->get_default_redirection_status_type();
|
| 245 |
+
|
| 246 |
+
// Set both redirection and default status code
|
| 247 |
+
$result['status'] = $rmodel->set_redirection( $source, $redirect ) && $rmodel->set_redirection_type( $source, $status_code );
|
| 248 |
+
|
| 249 |
+
wp_send_json( $result );
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
public function json_activate_component() {
|
| 253 |
+
$result = array( 'success' => false );
|
| 254 |
+
$data = $this->get_request_data();
|
| 255 |
+
|
| 256 |
+
$option_id = sanitize_key( smartcrawl_get_array_value( $data, 'option' ) );
|
| 257 |
+
$flag = sanitize_key( smartcrawl_get_array_value( $data, 'flag' ) );
|
| 258 |
+
|
| 259 |
+
if ( is_null( $option_id ) || is_null( $flag ) ) {
|
| 260 |
+
wp_send_json( $result );
|
| 261 |
+
|
| 262 |
+
return;
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
$options = self::get_specific_options( $option_id );
|
| 266 |
+
$options[ $flag ] = true;
|
| 267 |
+
self::update_specific_options( $option_id, $options );
|
| 268 |
+
|
| 269 |
+
$result['success'] = true;
|
| 270 |
+
wp_send_json( $result );
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
public function json_reload_component() {
|
| 274 |
+
$result = array( 'success' => false );
|
| 275 |
+
$data = $this->get_request_data();
|
| 276 |
+
|
| 277 |
+
$box_id = smartcrawl_get_array_value( $data, 'box_id' );
|
| 278 |
+
|
| 279 |
+
if ( is_null( $box_id ) ) {
|
| 280 |
+
wp_send_json( $result );
|
| 281 |
+
|
| 282 |
+
return;
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
if ( ! is_array( $box_id ) ) {
|
| 286 |
+
$box_id = array( $box_id );
|
| 287 |
+
}
|
| 288 |
+
$box_id = array_map( 'sanitize_key', $box_id );
|
| 289 |
+
|
| 290 |
+
$box_id = array_unique( $box_id );
|
| 291 |
+
|
| 292 |
+
foreach ( $box_id as $id ) {
|
| 293 |
+
$result[ $id ] = $this->load_box_markup( $id );
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
$result['success'] = true;
|
| 297 |
+
wp_send_json( $result );
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
private function load_box_markup( $box_id ) {
|
| 301 |
+
switch ( $box_id ) {
|
| 302 |
+
case self::BOX_SOCIAL:
|
| 303 |
+
return $this->_load( 'dashboard/dashboard-widget-social' );
|
| 304 |
+
|
| 305 |
+
case self::BOX_ADVANCED_TOOLS:
|
| 306 |
+
return $this->_load( 'dashboard/dashboard-widget-advanced-tools' );
|
| 307 |
+
|
| 308 |
+
case self::BOX_ONPAGE:
|
| 309 |
+
return $this->_load( 'dashboard/dashboard-widget-onpage' );
|
| 310 |
+
|
| 311 |
+
case self::BOX_CONTENT_ANALYSIS:
|
| 312 |
+
return $this->_load( 'dashboard/dashboard-widget-content-analysis' );
|
| 313 |
+
|
| 314 |
+
case self::BOX_SITEMAP:
|
| 315 |
+
return $this->_load( 'dashboard/dashboard-widget-sitemap' );
|
| 316 |
+
|
| 317 |
+
case self::BOX_SEO_CHECKUP:
|
| 318 |
+
return $this->_load( 'dashboard/dashboard-widget-seo-checkup' );
|
| 319 |
+
|
| 320 |
+
case self::BOX_TOP_STATS:
|
| 321 |
+
return $this->_load( 'dashboard/dashboard-top' );
|
| 322 |
+
};
|
| 323 |
+
|
| 324 |
+
return null;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
/**
|
| 328 |
+
* Process run action
|
| 329 |
+
*/
|
| 330 |
+
public function process_run_action() {
|
| 331 |
+
if ( isset( $_GET['_wds_nonce'], $_GET['run-checkup'] ) && wp_verify_nonce( $_GET['_wds_nonce'], 'wds-checkup-nonce' ) ) { // Simple presence switch, no value.
|
| 332 |
+
return $this->run_checkup();
|
| 333 |
+
}
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
public static function checkup_url() {
|
| 337 |
+
$checkup_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_DASHBOARD );
|
| 338 |
+
|
| 339 |
+
return esc_url_raw( add_query_arg( array(
|
| 340 |
+
'run-checkup' => 'yes',
|
| 341 |
+
'_wds_nonce' => wp_create_nonce( 'wds-checkup-nonce' ),
|
| 342 |
+
), $checkup_url ) );
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
/**
|
| 346 |
+
* Add admin settings page
|
| 347 |
+
*/
|
| 348 |
+
public function options_page() {
|
| 349 |
+
wp_enqueue_script( 'wds-admin-dashboard' );
|
| 350 |
+
|
| 351 |
+
$uptime = $this->_get_uptime_service();
|
| 352 |
+
|
| 353 |
+
$this->_render_page( 'dashboard/dashboard', array() );
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
protected function _get_uptime_service() {
|
| 357 |
+
if ( ! empty( $this->_uptime_service ) ) {
|
| 358 |
+
return $this->_uptime_service;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
$this->_uptime_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_UPTIME );
|
| 362 |
+
|
| 363 |
+
return $this->_uptime_service;
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
/**
|
| 367 |
+
* Add sub page to the Settings Menu
|
| 368 |
+
*/
|
| 369 |
+
public function add_page() {
|
| 370 |
+
if ( ! $this->_is_current_tab_allowed() ) {
|
| 371 |
+
return false;
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
$svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="18px" height="18px" xmlns="http://www.w3.org/2000/svg"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Artboard" fill-rule="nonzero" fill="#FFFFFF"><path d="M0.558,12.1008055 L17.445,12.1008055 C16.1402452,15.6456454 12.7704642,18 9.0015,18 C5.23253577,18 1.86275481,15.6456454 0.558,12.1008055 Z M17.442,5.89919449 L0.555,5.89919449 C1.85975481,2.35435463 5.22953577,4.81675263e-16 8.9985,7.11236625e-16 C12.7674642,9.40797988e-16 16.1372452,2.35435463 17.442,5.89919449 Z M0.042,8 L17.958,8 C17.985,8.32740214 18,8.66192171 18,9 C18,9.33807829 17.985,9.66903915 17.958,10 L0.042,10 C0.018,9.66903915 0,9.33807829 0,9 C0,8.66192171 0.018,8.32740214 0.042,8 Z" id="smartcrawl"></path></g></g></svg>';
|
| 375 |
+
$icon = 'data:image/svg+xml;base64,' . base64_encode( $svg ); // phpcs:ignore -- base64_encode is harmless here
|
| 376 |
+
|
| 377 |
+
$this->smartcrawl_page_hook = add_menu_page(
|
| 378 |
+
$this->page_title,
|
| 379 |
+
$this->title,
|
| 380 |
+
$this->capability,
|
| 381 |
+
$this->slug,
|
| 382 |
+
array( &$this, 'options_page' ),
|
| 383 |
+
$icon
|
| 384 |
+
);
|
| 385 |
+
|
| 386 |
+
$this->smartcrawl_page_hook = add_submenu_page(
|
| 387 |
+
$this->slug,
|
| 388 |
+
$this->page_title,
|
| 389 |
+
$this->sub_title,
|
| 390 |
+
$this->capability,
|
| 391 |
+
$this->slug,
|
| 392 |
+
array( &$this, 'options_page' )
|
| 393 |
+
);
|
| 394 |
+
|
| 395 |
+
// For pages that can deal with run requests, let's make sure they
|
| 396 |
+
// actually do that early enough
|
| 397 |
+
if ( is_callable( array( $this, 'process_run_action' ) ) ) {
|
| 398 |
+
add_action( 'load-' . $this->smartcrawl_page_hook, array( $this, 'process_run_action' ) );
|
| 399 |
+
}
|
| 400 |
+
|
| 401 |
+
add_action( "admin_print_styles-{$this->smartcrawl_page_hook}", array( &$this, 'admin_styles' ) );
|
| 402 |
+
add_action( "admin_print_scripts-{$this->smartcrawl_page_hook}", array( &$this, 'admin_scripts' ) );
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
/**
|
| 406 |
+
* Always allow dashboard tab if there's more than one tab allowed
|
| 407 |
+
*
|
| 408 |
+
* Overrides Smartcrawl_Settings::_is_current_tab_allowed
|
| 409 |
+
*
|
| 410 |
+
* @return bool
|
| 411 |
+
*/
|
| 412 |
+
protected function _is_current_tab_allowed() {
|
| 413 |
+
if ( parent::_is_current_tab_allowed() ) {
|
| 414 |
+
return true;
|
| 415 |
+
}
|
| 416 |
+
// Else we always add dashboard if there are other pages
|
| 417 |
+
$all_tabs = Smartcrawl_Settings_Settings::get_blog_tabs();
|
| 418 |
+
|
| 419 |
+
return ! empty( $all_tabs );
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
/**
|
| 423 |
+
* Default settings
|
| 424 |
+
*/
|
| 425 |
+
public function defaults() {
|
| 426 |
+
$this->options = Smartcrawl_Settings::get_options();
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
protected function _get_seo_service() {
|
| 430 |
+
if ( ! empty( $this->_seo_service ) ) {
|
| 431 |
+
return $this->_seo_service;
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
$this->_seo_service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 435 |
+
|
| 436 |
+
return $this->_seo_service;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
private function get_request_data() {
|
| 440 |
+
return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-nonce' ) ? stripslashes_deep( $_POST ) : array();
|
| 441 |
+
}
|
| 442 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/settings/index.php
CHANGED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile
|
includes/admin/settings/onpage.php
CHANGED
|
@@ -1,660 +1,798 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Smartcrawl_Onpage_Settings extends Smartcrawl_Settings_Admin {
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
*
|
| 18 |
-
*
|
| 19 |
-
* @
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
if ( ! empty( $input['meta_robots-noindex-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
}
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
if (isset($input["
|
| 98 |
-
$result["
|
| 99 |
-
}
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
}
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
$
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
$
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
)
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
);
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
'
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
$
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
);
|
| 478 |
-
|
| 479 |
-
$
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
$this->
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
'
|
| 559 |
-
'
|
| 560 |
-
'
|
| 561 |
-
'
|
| 562 |
-
'
|
| 563 |
-
'
|
| 564 |
-
'
|
| 565 |
-
'
|
| 566 |
-
'
|
| 567 |
-
'
|
| 568 |
-
'
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
}
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
if (
|
| 586 |
-
$
|
| 587 |
-
}
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
if (
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
$
|
| 608 |
-
}
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
'
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
// Meta robots
|
| 32 |
+
if ( ! empty( $input['meta_robots-noindex-main_blog_archive'] ) ) {
|
| 33 |
+
$result['meta_robots-noindex-main_blog_archive'] = true;
|
| 34 |
+
}
|
| 35 |
+
if ( ! empty( $input['meta_robots-nofollow-main_blog_archive'] ) ) {
|
| 36 |
+
$result['meta_robots-nofollow-main_blog_archive'] = true;
|
| 37 |
+
}
|
| 38 |
+
if ( ! empty( $input['meta_robots-main_blog_archive-subsequent_pages'] ) ) {
|
| 39 |
+
$result['meta_robots-main_blog_archive-subsequent_pages'] = true;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
if ( ! empty( $input['meta_robots-noindex-search'] ) ) {
|
| 43 |
+
$result['meta_robots-noindex-search'] = true;
|
| 44 |
+
}
|
| 45 |
+
if ( ! empty( $input['meta_robots-nofollow-search'] ) ) {
|
| 46 |
+
$result['meta_robots-nofollow-search'] = true;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
$tax_options = $this->_get_tax_options( '' );
|
| 50 |
+
foreach ( $tax_options as $option => $_tax ) {
|
| 51 |
+
$rbts = $this->get_robots_options_for( $option );
|
| 52 |
+
if ( ! empty( $rbts ) && is_array( $rbts ) ) {
|
| 53 |
+
foreach ( array_keys( $rbts ) as $item ) {
|
| 54 |
+
if ( ! empty( $input[ $item ] ) ) {
|
| 55 |
+
$result[ $item ] = true;
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
$other_options = $this->_get_other_types_options( '' );
|
| 61 |
+
foreach ( $other_options as $option => $_tax ) {
|
| 62 |
+
$rbts = $this->get_robots_options_for( $option );
|
| 63 |
+
if ( ! empty( $rbts ) && is_array( $rbts ) ) {
|
| 64 |
+
foreach ( array_keys( $rbts ) as $item ) {
|
| 65 |
+
if ( ! empty( $input[ $item ] ) ) {
|
| 66 |
+
$result[ $item ] = true;
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
$archive_post_types = smartcrawl_get_archive_post_types();
|
| 73 |
+
foreach ( $archive_post_types as $archive_post_type ) {
|
| 74 |
+
$archive_pt_robot_options = $this->get_robots_options_for( $archive_post_type );
|
| 75 |
+
|
| 76 |
+
foreach ( array_keys( $archive_pt_robot_options ) as $archive_pt_robot_option ) {
|
| 77 |
+
if ( ! empty( $input[ $archive_pt_robot_option ] ) ) {
|
| 78 |
+
$result[ $archive_pt_robot_option ] = true;
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
// String values
|
| 84 |
+
$strings = array(
|
| 85 |
+
'home',
|
| 86 |
+
'search',
|
| 87 |
+
'404',
|
| 88 |
+
'bp_groups',
|
| 89 |
+
'bp_profile',
|
| 90 |
+
);
|
| 91 |
+
foreach ( get_post_types( array( 'public' => true ) ) as $pt ) {
|
| 92 |
+
$strings[] = $pt;
|
| 93 |
+
// Allow post types robots noindex/nofollow
|
| 94 |
+
if ( isset( $input["meta_robots-noindex-{$pt}"] ) ) {
|
| 95 |
+
$result["meta_robots-noindex-{$pt}"] = true;
|
| 96 |
+
}
|
| 97 |
+
if ( isset( $input["meta_robots-nofollow-{$pt}"] ) ) {
|
| 98 |
+
$result["meta_robots-nofollow-{$pt}"] = true;
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
$strings = array_merge( $strings, array_values( $tax_options ) );
|
| 102 |
+
$strings = array_merge( $strings, array_values( $other_options ) );
|
| 103 |
+
$strings = array_merge( $strings, $archive_post_types );
|
| 104 |
+
|
| 105 |
+
foreach ( $strings as $str ) {
|
| 106 |
+
if ( isset( $input["title-{$str}"] ) ) {
|
| 107 |
+
$result["title-{$str}"] = $this->_sanitize_preserve_macros( $input["title-{$str}"] );
|
| 108 |
+
}
|
| 109 |
+
if ( isset( $input["metadesc-{$str}"] ) ) {
|
| 110 |
+
$result["metadesc-{$str}"] = $this->_sanitize_preserve_macros( $input["metadesc-{$str}"] );
|
| 111 |
+
}
|
| 112 |
+
if ( isset( $input["metakeywords-{$str}"] ) ) {
|
| 113 |
+
$result["metakeywords-{$str}"] = $this->_sanitize_preserve_macros( $input["metakeywords-{$str}"] );
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
// OpenGraph
|
| 117 |
+
if ( isset( $input["og-active-{$str}"] ) ) {
|
| 118 |
+
$result["og-active-{$str}"] = (boolean) $input["og-active-{$str}"];
|
| 119 |
+
}
|
| 120 |
+
if ( isset( $input["og-title-{$str}"] ) ) {
|
| 121 |
+
$result["og-title-{$str}"] = $this->_sanitize_preserve_macros( $input["og-title-{$str}"] );
|
| 122 |
+
}
|
| 123 |
+
if ( isset( $input["og-description-{$str}"] ) ) {
|
| 124 |
+
$result["og-description-{$str}"] = $this->_sanitize_preserve_macros( $input["og-description-{$str}"] );
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
$result["og-images-{$str}"] = array();
|
| 128 |
+
if ( ! empty( $input["og-images-{$str}"] ) && is_array( $input["og-images-{$str}"] ) ) {
|
| 129 |
+
foreach ( $input["og-images-{$str}"] as $img ) {
|
| 130 |
+
$result["og-images-{$str}"][] = esc_url( $img );
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
$result["og-images-{$str}"] = array_values( array_filter( array_unique( $result["og-images-{$str}"] ) ) );
|
| 134 |
+
|
| 135 |
+
// Twitter cards
|
| 136 |
+
if ( isset( $input["twitter-active-{$str}"] ) ) {
|
| 137 |
+
$result["twitter-active-{$str}"] = (boolean) $input["twitter-active-{$str}"];
|
| 138 |
+
}
|
| 139 |
+
if ( isset( $input["twitter-title-{$str}"] ) ) {
|
| 140 |
+
$result["twitter-title-{$str}"] = $this->_sanitize_preserve_macros( $input["twitter-title-{$str}"] );
|
| 141 |
+
}
|
| 142 |
+
if ( isset( $input["twitter-description-{$str}"] ) ) {
|
| 143 |
+
$result["twitter-description-{$str}"] = $this->_sanitize_preserve_macros( $input["twitter-description-{$str}"] );
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
$result["twitter-images-{$str}"] = array();
|
| 147 |
+
if ( ! empty( $input["twitter-images-{$str}"] ) && is_array( $input["twitter-images-{$str}"] ) ) {
|
| 148 |
+
foreach ( $input["twitter-images-{$str}"] as $img ) {
|
| 149 |
+
$result["twitter-images-{$str}"][] = esc_url( $img );
|
| 150 |
+
}
|
| 151 |
+
}
|
| 152 |
+
$result["twitter-images-{$str}"] = array_values( array_filter( array_unique( $result["twitter-images-{$str}"] ) ) );
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
// Special case handling for home page keywords
|
| 156 |
+
// because the legacy one doesn't follow the naming convention
|
| 157 |
+
if ( isset( $input['keywords-home'] ) ) {
|
| 158 |
+
$result['keywords-home'] = $this->_sanitize_preserve_macros( $input['keywords-home'] );
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
$result['enable-author-archive'] = isset( $input['enable-author-archive'] )
|
| 162 |
+
? (boolean) $input['enable-author-archive']
|
| 163 |
+
: false;
|
| 164 |
+
$result['enable-date-archive'] = isset( $input['enable-date-archive'] )
|
| 165 |
+
? (boolean) $input['enable-date-archive']
|
| 166 |
+
: false;
|
| 167 |
+
|
| 168 |
+
if ( isset( $input['preset-separator'] ) ) {
|
| 169 |
+
$result['preset-separator'] = sanitize_text_field( $input['preset-separator'] );
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
if ( isset( $input['separator'] ) ) {
|
| 173 |
+
$result['separator'] = sanitize_text_field( $input['separator'] );
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
return $result;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
/**
|
| 180 |
+
* Spawn taxonomy options and names, indexed by taxonomy option names
|
| 181 |
+
*
|
| 182 |
+
* @param string $pfx Prefix options with this
|
| 183 |
+
*
|
| 184 |
+
* @return array
|
| 185 |
+
*/
|
| 186 |
+
protected function _get_tax_options( $pfx = '' ) {
|
| 187 |
+
$pfx = ! empty( $pfx ) ? rtrim( $pfx, '_' ) . '_' : $pfx;
|
| 188 |
+
$opts = array();
|
| 189 |
+
foreach ( get_taxonomies( array( '_builtin' => false ), 'objects' ) as $taxonomy ) {
|
| 190 |
+
$name = $pfx . str_replace( '-', '_', $taxonomy->name );
|
| 191 |
+
$opts[ $name ] = $taxonomy->name;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
return $opts;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
/**
|
| 198 |
+
* Spawns a set of robots options for a given type
|
| 199 |
+
*
|
| 200 |
+
* @param string $type Archives type to generate the robots options for
|
| 201 |
+
* @param bool $include_subsequent_pages_option Whether to include the subsequent pages option.
|
| 202 |
+
*
|
| 203 |
+
* @return array Generated meta robots option array
|
| 204 |
+
*/
|
| 205 |
+
public static function get_robots_options_for( $type, $include_subsequent_pages_option = true ) {
|
| 206 |
+
$options = array(
|
| 207 |
+
"meta_robots-noindex-{$type}" => array(
|
| 208 |
+
'label' => __( 'Noindex', 'wds' ),
|
| 209 |
+
'description' => __( 'Disabling indexing means that this content will not be indexed and searchable in search engines.', 'wds' ),
|
| 210 |
+
),
|
| 211 |
+
"meta_robots-nofollow-{$type}" => array(
|
| 212 |
+
'label' => __( 'Nofollow', 'wds' ),
|
| 213 |
+
'description' => __( 'Disabling following means search engines will not follow and crawl links it finds in this content.', 'wds' ),
|
| 214 |
+
),
|
| 215 |
+
);
|
| 216 |
+
|
| 217 |
+
if ( $include_subsequent_pages_option ) {
|
| 218 |
+
$options["meta_robots-{$type}-subsequent_pages"] = array(
|
| 219 |
+
'label' => __( 'Apply to all pages except the first', 'wds' ),
|
| 220 |
+
'description' => __( 'If you select this option, the first page will be left alone, but the indexing settings will be applied to subsequent pages.', 'wds' ),
|
| 221 |
+
);
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
return $options;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
/**
|
| 228 |
+
* Spawn taxonomy options and names, indexed by taxonomy option names
|
| 229 |
+
*
|
| 230 |
+
* @param string $pfx Prefix options with this
|
| 231 |
+
*
|
| 232 |
+
* @return array
|
| 233 |
+
*/
|
| 234 |
+
protected function _get_other_types_options( $pfx = '' ) {
|
| 235 |
+
$pfx = ! empty( $pfx ) ? rtrim( $pfx, '_' ) . '_' : $pfx;
|
| 236 |
+
$opts = array();
|
| 237 |
+
$other_types = array(
|
| 238 |
+
'category',
|
| 239 |
+
'post_tag',
|
| 240 |
+
'author',
|
| 241 |
+
'date',
|
| 242 |
+
);
|
| 243 |
+
foreach ( $other_types as $value ) {
|
| 244 |
+
$name = $pfx . $value;
|
| 245 |
+
$opts[ $name ] = $value;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
return $opts;
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
/**
|
| 252 |
+
* Preserve macros in sanitization
|
| 253 |
+
*
|
| 254 |
+
* @param string $str String to sanitize
|
| 255 |
+
*
|
| 256 |
+
* @return string Sanitized string
|
| 257 |
+
*/
|
| 258 |
+
private function _sanitize_preserve_macros( $str ) {
|
| 259 |
+
if ( empty( $str ) ) {
|
| 260 |
+
return $str;
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
$rpl = '__SMARTCRAWL_MACRO_QUOTES_REPLACEMENT__';
|
| 264 |
+
$str = preg_replace( '/%%/', $rpl, $str );
|
| 265 |
+
|
| 266 |
+
$str = sanitize_text_field( $str );
|
| 267 |
+
|
| 268 |
+
$str = preg_replace( '/' . preg_quote( $rpl, '/' ) . '/', '%%', $str );
|
| 269 |
+
|
| 270 |
+
return $str;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
public function init() {
|
| 274 |
+
$this->option_name = 'wds_onpage_options';
|
| 275 |
+
$this->name = Smartcrawl_Settings::COMP_ONPAGE;
|
| 276 |
+
$this->slug = Smartcrawl_Settings::TAB_ONPAGE;
|
| 277 |
+
$this->action_url = admin_url( 'options.php' );
|
| 278 |
+
$this->title = __( 'Title & Meta', 'wds' );
|
| 279 |
+
$this->page_title = __( 'SmartCrawl Wizard: Title & Meta', 'wds' );
|
| 280 |
+
|
| 281 |
+
add_action( 'wp_ajax_wds-onpage-preview', array( $this, 'json_create_preview' ) );
|
| 282 |
+
|
| 283 |
+
parent::init();
|
| 284 |
+
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
/**
|
| 288 |
+
* Preview building handler
|
| 289 |
+
*/
|
| 290 |
+
public function json_create_preview() {
|
| 291 |
+
$data = $this->get_request_data();
|
| 292 |
+
|
| 293 |
+
$src_type = ! empty( $data['type'] ) ? sanitize_text_field( $data['type'] ) : false;
|
| 294 |
+
$src_title = ! empty( $data['title'] ) ? $this->_sanitize_preserve_macros( $data['title'] ) : false;
|
| 295 |
+
$src_meta = ! empty( $data['description'] ) ? $this->_sanitize_preserve_macros( $data['description'] ) : false;
|
| 296 |
+
|
| 297 |
+
$updated = false;
|
| 298 |
+
|
| 299 |
+
$link = home_url();
|
| 300 |
+
$title = get_bloginfo( 'name' );
|
| 301 |
+
$description = get_bloginfo( 'description' );
|
| 302 |
+
|
| 303 |
+
$warnings = array();
|
| 304 |
+
|
| 305 |
+
switch ( $src_type ) {
|
| 306 |
+
case 'search-page':
|
| 307 |
+
set_query_var( 's', 'Example search phrase' );
|
| 308 |
+
// Handled the same way as homepage so fall-through intentional
|
| 309 |
+
case 'author-archive':
|
| 310 |
+
set_query_var( 'author', get_current_user_id() );
|
| 311 |
+
// Handled the same way as homepage so fall-through intentional
|
| 312 |
+
case 'date-archive':
|
| 313 |
+
set_query_var( 'monthnum', 3 );
|
| 314 |
+
set_query_var( 'year', 2018 );
|
| 315 |
+
// Handled the same way as homepage so fall-through intentional
|
| 316 |
+
|
| 317 |
+
case 'homepage':
|
| 318 |
+
case '404-page':
|
| 319 |
+
$title = smartcrawl_replace_vars( $src_title );
|
| 320 |
+
$description = smartcrawl_replace_vars( $src_meta );
|
| 321 |
+
$updated = true;
|
| 322 |
+
|
| 323 |
+
if ( strlen( $title ) > SMARTCRAWL_TITLE_LENGTH_CHAR_COUNT_LIMIT ) {
|
| 324 |
+
$warnings['title'] = __( 'Your title seems to be a bit on the long side, consider trimming it', 'wds' );
|
| 325 |
+
}
|
| 326 |
+
if ( strlen( $description ) > SMARTCRAWL_METADESC_LENGTH_CHAR_COUNT_LIMIT ) {
|
| 327 |
+
$warnings['description'] = __( 'Your description seems to be a bit on the long side, consider trimming it', 'wds' );
|
| 328 |
+
}
|
| 329 |
+
break;
|
| 330 |
+
|
| 331 |
+
case 'bp-group':
|
| 332 |
+
$group = $this->_get_random_bp_group();
|
| 333 |
+
if ( ! empty( $group ) ) {
|
| 334 |
+
$title = smartcrawl_replace_vars( $src_title, (array) $group );
|
| 335 |
+
$description = smartcrawl_replace_vars( $src_meta, (array) $group );
|
| 336 |
+
$link = bp_get_group_permalink( $group );
|
| 337 |
+
}
|
| 338 |
+
$updated = true;
|
| 339 |
+
break;
|
| 340 |
+
|
| 341 |
+
case 'bp-profile':
|
| 342 |
+
$bp_profile_args = array(
|
| 343 |
+
'full_name' => bp_get_loggedin_user_fullname(),
|
| 344 |
+
'username' => bp_get_loggedin_user_username(),
|
| 345 |
+
);
|
| 346 |
+
|
| 347 |
+
$title = smartcrawl_replace_vars( $src_title, $bp_profile_args );
|
| 348 |
+
$description = smartcrawl_replace_vars( $src_meta, $bp_profile_args );
|
| 349 |
+
$link = bp_loggedin_user_domain();
|
| 350 |
+
$updated = true;
|
| 351 |
+
break;
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
// Custom post type?
|
| 355 |
+
if ( ! $updated ) {
|
| 356 |
+
foreach ( get_post_types( array( 'public' => true ) ) as $type ) {
|
| 357 |
+
if ( $type !== $src_type ) {
|
| 358 |
+
continue;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
$updated = true;
|
| 362 |
+
$post = $this->_get_random_post( $type );
|
| 363 |
+
if ( ! empty( $post ) ) {
|
| 364 |
+
$title = smartcrawl_replace_vars( $src_title, $post );
|
| 365 |
+
$description = smartcrawl_replace_vars( $src_meta, $post );
|
| 366 |
+
$link = get_permalink( $post['ID'] );
|
| 367 |
+
}
|
| 368 |
+
}
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
if ( ! $updated ) {
|
| 372 |
+
$archive_post_type_prefix = self::PT_ARCHIVE_PREFIX;
|
| 373 |
+
foreach ( smartcrawl_get_archive_post_types() as $archive_post_type ) {
|
| 374 |
+
if ( $archive_post_type !== $src_type ) {
|
| 375 |
+
continue;
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
$updated = true;
|
| 379 |
+
$archive_pt = str_replace( $archive_post_type_prefix, '', $archive_post_type );
|
| 380 |
+
|
| 381 |
+
$title = smartcrawl_replace_vars( $src_title, get_post_type_object( $archive_pt ) );
|
| 382 |
+
$description = smartcrawl_replace_vars( $src_meta, get_post_type_object( $archive_pt ) );
|
| 383 |
+
$link = get_post_type_archive_link( $archive_pt );
|
| 384 |
+
}
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
// Custom taxonomy?
|
| 388 |
+
if ( ! $updated ) {
|
| 389 |
+
foreach ( get_taxonomies() as $tax ) {
|
| 390 |
+
if ( $tax !== $src_type ) {
|
| 391 |
+
continue;
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
$updated = true;
|
| 395 |
+
$term = $this->_get_random_term( $tax );
|
| 396 |
+
if ( ! empty( $term ) ) {
|
| 397 |
+
$title = smartcrawl_replace_vars( $src_title, $term );
|
| 398 |
+
$description = smartcrawl_replace_vars( $src_meta, $term );
|
| 399 |
+
$link = get_term_link( $term['term_id'], $tax );
|
| 400 |
+
}
|
| 401 |
+
}
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
wp_send_json( array(
|
| 405 |
+
'status' => $updated,
|
| 406 |
+
'markup' => $this->_load( 'onpage/onpage-preview', array(
|
| 407 |
+
'link' => $link,
|
| 408 |
+
'title' => $title,
|
| 409 |
+
'description' => $description,
|
| 410 |
+
) ),
|
| 411 |
+
'warnings' => $warnings,
|
| 412 |
+
) );
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
private function _get_random_bp_group() {
|
| 416 |
+
$groups = groups_get_groups( array(
|
| 417 |
+
'orderby' => 'random',
|
| 418 |
+
'per_page' => 1,
|
| 419 |
+
) );
|
| 420 |
+
|
| 421 |
+
$total = isset( $groups['total'] ) ? $groups['total'] : 0;
|
| 422 |
+
$groups = isset( $groups['groups'] ) ? $groups['groups'] : array();
|
| 423 |
+
|
| 424 |
+
return $total > 0 ? $groups[0] : null;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
/**
|
| 428 |
+
* Randomly spawns a post of certain post type
|
| 429 |
+
*
|
| 430 |
+
* @param string $type Post type
|
| 431 |
+
*
|
| 432 |
+
* @return array
|
| 433 |
+
*/
|
| 434 |
+
private function _get_random_post( $type = 'post' ) {
|
| 435 |
+
$args = array(
|
| 436 |
+
'posts_per_page' => 1,
|
| 437 |
+
'post_type' => $type,
|
| 438 |
+
'orderby' => 'random',
|
| 439 |
+
);
|
| 440 |
+
if ( 'attachment' === $type ) {
|
| 441 |
+
$args['post_status'] = 'any';
|
| 442 |
+
}
|
| 443 |
+
$q = new WP_Query( $args );
|
| 444 |
+
|
| 445 |
+
return ! empty( $q->post )
|
| 446 |
+
? (array) $q->post
|
| 447 |
+
: array();
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
/**
|
| 451 |
+
* Spawn a random taxonomy term for a tax type
|
| 452 |
+
*
|
| 453 |
+
* @param string $type Taxonomy type
|
| 454 |
+
*
|
| 455 |
+
* @return array
|
| 456 |
+
*/
|
| 457 |
+
private function _get_random_term( $type = 'category' ) {
|
| 458 |
+
$terms = get_terms(
|
| 459 |
+
array(
|
| 460 |
+
'taxonomy' => $type,
|
| 461 |
+
'hide_empty' => 0,
|
| 462 |
+
)
|
| 463 |
+
);
|
| 464 |
+
if ( empty( $terms ) ) {
|
| 465 |
+
return array();
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
shuffle( $terms );
|
| 469 |
+
|
| 470 |
+
return (array) $terms[0];
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
/**
|
| 474 |
+
* Add admin settings page
|
| 475 |
+
*/
|
| 476 |
+
public function options_page() {
|
| 477 |
+
parent::options_page();
|
| 478 |
+
|
| 479 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 480 |
+
|
| 481 |
+
$arguments = array(
|
| 482 |
+
'macros' => self::get_macros(),
|
| 483 |
+
'meta_robots_main_blog_archive' => self::get_robots_options_for( 'main_blog_archive' ),
|
| 484 |
+
);
|
| 485 |
+
|
| 486 |
+
foreach ( $this->_get_tax_options( 'meta_robots_' ) as $option => $tax ) {
|
| 487 |
+
$tax = str_replace( '-', '_', $tax );
|
| 488 |
+
if ( empty( $arguments[ $option ] ) ) {
|
| 489 |
+
$arguments[ $option ] = self::get_robots_options_for( $tax );
|
| 490 |
+
}
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
foreach ( $this->_get_other_types_options( 'meta_robots_' ) as $option => $value ) {
|
| 494 |
+
if ( empty( $arguments[ $option ] ) ) {
|
| 495 |
+
$arguments[ $option ] = self::get_robots_options_for( $value );
|
| 496 |
+
}
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
$archive_post_types = smartcrawl_get_archive_post_type_labels();
|
| 500 |
+
foreach ( $archive_post_types as $archive_post_type => $archive_post_type_label ) {
|
| 501 |
+
$arguments['archive_post_type_robots'][ $archive_post_type ] = self::get_robots_options_for( $archive_post_type );
|
| 502 |
+
}
|
| 503 |
+
$arguments['archive_post_types'] = $archive_post_types;
|
| 504 |
+
|
| 505 |
+
$arguments['meta_robots_search'] = self::get_robots_options_for( 'search', false );
|
| 506 |
+
|
| 507 |
+
// Allow for post type options
|
| 508 |
+
foreach ( get_post_types( array( 'public' => true ) ) as $post_type ) {
|
| 509 |
+
$arguments['post_robots'][ $post_type ] = self::get_robots_options_for( $post_type, false );
|
| 510 |
+
}
|
| 511 |
+
|
| 512 |
+
$arguments['radio_options'] = array(
|
| 513 |
+
__( 'No', 'wds' ),
|
| 514 |
+
__( 'Yes', 'wds' ),
|
| 515 |
+
);
|
| 516 |
+
|
| 517 |
+
$arguments['engines'] = array(
|
| 518 |
+
'ping-google' => __( 'Google', 'wds' ),
|
| 519 |
+
'ping-bing' => __( 'Bing', 'wds' ),
|
| 520 |
+
);
|
| 521 |
+
|
| 522 |
+
$arguments['separators'] = smartcrawl_get_separators();
|
| 523 |
+
|
| 524 |
+
$arguments['show_homepage_options'] = $this->_show_homepage_options();
|
| 525 |
+
$arguments['homepage_title'] = $this->_get_homepage_title( $smartcrawl_options );
|
| 526 |
+
$arguments['homepage_description'] = $this->_get_homepage_description( $smartcrawl_options );
|
| 527 |
+
|
| 528 |
+
$arguments['active_tab'] = $this->_get_last_active_tab( 'tab_homepage' );
|
| 529 |
+
|
| 530 |
+
wp_enqueue_script( 'wds-admin-onpage' );
|
| 531 |
+
$this->_render_page( 'onpage/onpage-settings', $arguments );
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
/**
|
| 535 |
+
* Returns a set of known macros, as macro => description pairs
|
| 536 |
+
*
|
| 537 |
+
* @return array List of known macros
|
| 538 |
+
*/
|
| 539 |
+
public static function get_macros() {
|
| 540 |
+
$macros = array(
|
| 541 |
+
'%%sep%%' => __( 'Separator', 'wds' ),
|
| 542 |
+
'%%date%%' => __( 'Date of the post/page', 'wds' ),
|
| 543 |
+
'%%title%%' => __( 'Title of the post/page', 'wds' ),
|
| 544 |
+
'%%sitename%%' => __( 'Site\'s name', 'wds' ),
|
| 545 |
+
'%%sitedesc%%' => __( 'Site\'s tagline / description', 'wds' ),
|
| 546 |
+
'%%excerpt%%' => __( 'Post/page excerpt (or auto-generated if it does not exist)', 'wds' ),
|
| 547 |
+
'%%excerpt_only%%' => __( 'Post/page excerpt (without auto-generation)', 'wds' ),
|
| 548 |
+
'%%tag%%' => __( 'Current tag/tags', 'wds' ),
|
| 549 |
+
'%%category%%' => __( 'Post categories (comma separated)', 'wds' ),
|
| 550 |
+
'%%category_description%%' => __( 'Category description', 'wds' ),
|
| 551 |
+
'%%tag_description%%' => __( 'Tag description', 'wds' ),
|
| 552 |
+
'%%term_description%%' => __( 'Term description', 'wds' ),
|
| 553 |
+
'%%term_title%%' => __( 'Term name', 'wds' ),
|
| 554 |
+
'%%modified%%' => __( 'Post/page modified time', 'wds' ),
|
| 555 |
+
'%%id%%' => __( 'Post/page ID', 'wds' ),
|
| 556 |
+
'%%name%%' => __( 'Post/page author\'s \'nicename\'', 'wds' ),
|
| 557 |
+
'%%userid%%' => __( 'Post/page author\'s userid', 'wds' ),
|
| 558 |
+
'%%searchphrase%%' => __( 'Current search phrase', 'wds' ),
|
| 559 |
+
'%%currenttime%%' => __( 'Current time', 'wds' ),
|
| 560 |
+
'%%currentdate%%' => __( 'Current date', 'wds' ),
|
| 561 |
+
'%%currentmonth%%' => __( 'Current month', 'wds' ),
|
| 562 |
+
'%%currentyear%%' => __( 'Current year', 'wds' ),
|
| 563 |
+
'%%page%%' => __( 'Current page number (i.e. page 2 of 4)', 'wds' ),
|
| 564 |
+
'%%pagetotal%%' => __( 'Current page total', 'wds' ),
|
| 565 |
+
'%%pagenumber%%' => __( 'Current page number', 'wds' ),
|
| 566 |
+
'%%caption%%' => __( 'Attachment caption', 'wds' ),
|
| 567 |
+
'%%spell_pagenumber%%' => __( 'Current page number, spelled out as numeral in English', 'wds' ),
|
| 568 |
+
'%%spell_pagetotal%%' => __( 'Current page total, spelled out as numeral in English', 'wds' ),
|
| 569 |
+
'%%spell_page%%' => __( 'Current page number, spelled out as numeral in English', 'wds' ),
|
| 570 |
+
'%%pt_plural%%' => __( 'Post type label plural' ),
|
| 571 |
+
'%%pt_single%%' => __( 'Post type label singular' ),
|
| 572 |
+
);
|
| 573 |
+
|
| 574 |
+
if ( defined( 'BP_VERSION' ) ) {
|
| 575 |
+
$macros['%%bp_group_name%%'] = __( 'BuddyPress group name', 'wds' );
|
| 576 |
+
$macros['%%bp_group_description%%'] = __( 'BuddyPress group description', 'wds' );
|
| 577 |
+
$macros['%%bp_user_username%%'] = __( 'BuddyPress username', 'wds' );
|
| 578 |
+
$macros['%%bp_user_full_name%%'] = __( "BuddyPress user's full name", 'wds' );
|
| 579 |
+
}
|
| 580 |
+
|
| 581 |
+
return $macros;
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
private function _show_homepage_options() {
|
| 585 |
+
if ( is_multisite() ) {
|
| 586 |
+
$show_homepage_options = SMARTCRAWL_SITEWIDE || 'posts' === get_site_option( 'show_on_front' );
|
| 587 |
+
} else {
|
| 588 |
+
$show_homepage_options = 'posts' === get_option( 'show_on_front' );
|
| 589 |
+
}
|
| 590 |
+
|
| 591 |
+
return $show_homepage_options;
|
| 592 |
+
}
|
| 593 |
+
|
| 594 |
+
private function _get_homepage_title( $options ) {
|
| 595 |
+
$front_page_id = (int) get_option( 'page_on_front' );
|
| 596 |
+
|
| 597 |
+
if ( ! $this->_show_homepage_options() && $front_page_id ) {
|
| 598 |
+
|
| 599 |
+
$homepage_title = smartcrawl_get_value( 'title', $front_page_id );
|
| 600 |
+
if ( empty( $homepage_title ) ) {
|
| 601 |
+
$front_page = get_post( $front_page_id );
|
| 602 |
+
$homepage_title = $front_page->post_title;
|
| 603 |
+
}
|
| 604 |
+
|
| 605 |
+
return $homepage_title;
|
| 606 |
+
} else {
|
| 607 |
+
return $options['title-home'];
|
| 608 |
+
}
|
| 609 |
+
}
|
| 610 |
+
|
| 611 |
+
private function _get_homepage_description( $options ) {
|
| 612 |
+
$front_page_id = (int) get_option( 'page_on_front' );
|
| 613 |
+
|
| 614 |
+
if ( ! $this->_show_homepage_options() && $front_page_id ) {
|
| 615 |
+
$homepage_description = smartcrawl_get_value( 'metadesc', $front_page_id );
|
| 616 |
+
if ( empty( $homepage_description ) ) {
|
| 617 |
+
$front_page = get_post( $front_page_id );
|
| 618 |
+
$homepage_description = substr( strip_tags( $front_page->post_content ), 0, 130 );
|
| 619 |
+
}
|
| 620 |
+
|
| 621 |
+
return $homepage_description;
|
| 622 |
+
} else {
|
| 623 |
+
return $options['metadesc-home'];
|
| 624 |
+
}
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
/**
|
| 628 |
+
* Default settings
|
| 629 |
+
*/
|
| 630 |
+
public function defaults() {
|
| 631 |
+
|
| 632 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 633 |
+
$this->options = get_site_option( $this->option_name );
|
| 634 |
+
} else {
|
| 635 |
+
$this->options = get_option( $this->option_name );
|
| 636 |
+
}
|
| 637 |
+
|
| 638 |
+
if ( empty( $this->options['title-home'] ) ) {
|
| 639 |
+
$this->options['title-home'] = '%%sitename%%';
|
| 640 |
+
}
|
| 641 |
+
|
| 642 |
+
if ( empty( $this->options['metadesc-home'] ) ) {
|
| 643 |
+
$this->options['metadesc-home'] = '%%sitedesc%%';
|
| 644 |
+
}
|
| 645 |
+
|
| 646 |
+
if ( empty( $this->options['keywords-home'] ) ) {
|
| 647 |
+
$this->options['keywords-home'] = '';
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
if ( empty( $this->options['onpage-stylesheet'] ) ) {
|
| 651 |
+
$this->options['onpage-stylesheet'] = 0;
|
| 652 |
+
}
|
| 653 |
+
|
| 654 |
+
if ( empty( $this->options['onpage-dashboard-widget'] ) ) {
|
| 655 |
+
$this->options['onpage-dashboard-widget'] = 1;
|
| 656 |
+
}
|
| 657 |
+
|
| 658 |
+
if ( empty( $this->options['onpage-disable-automatic-regeneration'] ) ) {
|
| 659 |
+
$this->options['onpage-disable-automatic-regeneration'] = 0;
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
foreach ( get_post_types( array( 'public' => true ) ) as $posttype ) {
|
| 663 |
+
if ( in_array( $posttype, array( 'revision', 'nav_menu_item' ), true ) ) {
|
| 664 |
+
continue;
|
| 665 |
+
}
|
| 666 |
+
if ( preg_match( '/^upfront_/', $posttype ) ) {
|
| 667 |
+
continue;
|
| 668 |
+
}
|
| 669 |
+
|
| 670 |
+
$type_obj = get_post_type_object( $posttype );
|
| 671 |
+
if ( ! is_object( $type_obj ) ) {
|
| 672 |
+
continue;
|
| 673 |
+
}
|
| 674 |
+
|
| 675 |
+
if ( empty( $this->options[ 'title-' . $posttype ] ) ) {
|
| 676 |
+
$this->options[ 'title-' . $posttype ] = '%%title%% %%sep%% %%sitename%%';
|
| 677 |
+
}
|
| 678 |
+
|
| 679 |
+
if ( empty( $this->options[ 'metadesc-' . $posttype ] ) ) {
|
| 680 |
+
$this->options[ 'metadesc-' . $posttype ] = '%%excerpt%%';
|
| 681 |
+
}
|
| 682 |
+
}
|
| 683 |
+
|
| 684 |
+
foreach ( smartcrawl_get_archive_post_types() as $archive_post_type ) {
|
| 685 |
+
if ( empty( $this->options[ 'title-' . $archive_post_type ] ) ) {
|
| 686 |
+
$this->options[ 'title-' . $archive_post_type ] = '%%pt_plural%% %%sep%% %%sitename%%';
|
| 687 |
+
}
|
| 688 |
+
}
|
| 689 |
+
|
| 690 |
+
foreach ( get_taxonomies( array( '_builtin' => false ), 'objects' ) as $taxonomy ) {
|
| 691 |
+
if ( empty( $this->options[ 'title-' . $taxonomy->name ] ) ) {
|
| 692 |
+
$this->options[ 'title-' . $taxonomy->name ] = '';
|
| 693 |
+
}
|
| 694 |
+
|
| 695 |
+
if ( empty( $this->options[ 'metadesc-' . $taxonomy->name ] ) ) {
|
| 696 |
+
$this->options[ 'metadesc-' . $taxonomy->name ] = '';
|
| 697 |
+
}
|
| 698 |
+
}
|
| 699 |
+
|
| 700 |
+
$other_types = array(
|
| 701 |
+
'category' => array(
|
| 702 |
+
'title' => '%%category%% %%sep%% %%sitename%%',
|
| 703 |
+
'desc' => '%%category_description%%',
|
| 704 |
+
),
|
| 705 |
+
'post_tag' => array(
|
| 706 |
+
'title' => '%%tag%% %%sep%% %%sitename%%',
|
| 707 |
+
'desc' => '%%tag_description%%',
|
| 708 |
+
),
|
| 709 |
+
'author' => array(
|
| 710 |
+
'title' => '%%name%% %%sep%% %%sitename%%',
|
| 711 |
+
'desc' => '',
|
| 712 |
+
),
|
| 713 |
+
'date' => array(
|
| 714 |
+
'title' => '%%currentdate%% %%sep%% %%sitename%%',
|
| 715 |
+
'desc' => '',
|
| 716 |
+
),
|
| 717 |
+
'search' => array(
|
| 718 |
+
'title' => '%%searchphrase%% %%sep%% %%sitename%%',
|
| 719 |
+
'desc' => '',
|
| 720 |
+
),
|
| 721 |
+
'404' => array(
|
| 722 |
+
'title' => 'Page not found %%sep%% %%sitename%%',
|
| 723 |
+
'desc' => '',
|
| 724 |
+
),
|
| 725 |
+
'bp_groups' => array(
|
| 726 |
+
'title' => '%%bp_group_name%% %%sep%% %%sitename%%',
|
| 727 |
+
'desc' => '%%bp_group_description%%',
|
| 728 |
+
),
|
| 729 |
+
'bp_profile' => array(
|
| 730 |
+
'title' => '%%bp_user_username%% %%sep%% %%sitename%%',
|
| 731 |
+
'desc' => '%%bp_user_full_name%%',
|
| 732 |
+
),
|
| 733 |
+
);
|
| 734 |
+
|
| 735 |
+
foreach ( $other_types as $key => $value ) {
|
| 736 |
+
if ( empty( $this->options[ 'title-' . $key ] ) ) {
|
| 737 |
+
$this->options[ 'title-' . $key ] = $value['title'];
|
| 738 |
+
}
|
| 739 |
+
|
| 740 |
+
if ( empty( $this->options[ 'metadesc-' . $key ] ) ) {
|
| 741 |
+
$this->options[ 'metadesc-' . $key ] = $value['desc'];
|
| 742 |
+
}
|
| 743 |
+
}
|
| 744 |
+
|
| 745 |
+
if ( ! isset( $this->options['preset-separator'] ) ) {
|
| 746 |
+
$this->options['preset-separator'] = 'pipe';
|
| 747 |
+
}
|
| 748 |
+
|
| 749 |
+
if ( ! isset( $this->options['separator'] ) ) {
|
| 750 |
+
$this->options['separator'] = '';
|
| 751 |
+
}
|
| 752 |
+
|
| 753 |
+
if ( ! isset( $this->options['enable-author-archive'] ) ) {
|
| 754 |
+
$this->options['enable-author-archive'] = true;
|
| 755 |
+
}
|
| 756 |
+
|
| 757 |
+
if ( ! isset( $this->options['enable-date-archive'] ) ) {
|
| 758 |
+
$this->options['enable-date-archive'] = true;
|
| 759 |
+
}
|
| 760 |
+
|
| 761 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 762 |
+
update_site_option( $this->option_name, $this->options );
|
| 763 |
+
} else {
|
| 764 |
+
update_option( $this->option_name, $this->options );
|
| 765 |
+
}
|
| 766 |
+
|
| 767 |
+
}
|
| 768 |
+
|
| 769 |
+
/**
|
| 770 |
+
* @return array
|
| 771 |
+
*/
|
| 772 |
+
private function get_archive_post_types( $prefix = '' ) {
|
| 773 |
+
$archive_post_types = array();
|
| 774 |
+
$post_type_args = array(
|
| 775 |
+
'public' => true,
|
| 776 |
+
'has_archive' => true,
|
| 777 |
+
);
|
| 778 |
+
|
| 779 |
+
foreach ( get_post_types( $post_type_args ) as $post_type ) {
|
| 780 |
+
if ( in_array( $post_type, array( 'revision', 'nav_menu_item' ), true ) ) {
|
| 781 |
+
continue;
|
| 782 |
+
}
|
| 783 |
+
|
| 784 |
+
$post_type_object = get_post_type_object( $post_type );
|
| 785 |
+
$archive_post_types[ $prefix . $post_type ] = $post_type_object->labels->name;
|
| 786 |
+
}
|
| 787 |
+
|
| 788 |
+
return $archive_post_types;
|
| 789 |
+
}
|
| 790 |
+
|
| 791 |
+
/**
|
| 792 |
+
* @return array
|
| 793 |
+
*/
|
| 794 |
+
private function get_request_data() {
|
| 795 |
+
return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-onpage-nonce' ) ? $_POST : array();
|
| 796 |
+
}
|
| 797 |
+
}
|
| 798 |
+
|
includes/admin/settings/redirections.php
DELETED
|
@@ -1,125 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Smartcrawl_Settings_Redirections 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 |
-
return self::$_instance;
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
public function validate( $input ) {
|
| 16 |
-
$result = array();
|
| 17 |
-
$urls = ! empty( $input['urls'] ) && is_array( $input['urls'] )
|
| 18 |
-
? $input['urls']
|
| 19 |
-
: array()
|
| 20 |
-
;
|
| 21 |
-
$bulk_action = ! empty( $input['bulk_action'] ) && in_array( $input['bulk_action'], array( 'delete', 'redirect_301', 'redirect_302' ) )
|
| 22 |
-
? $input['bulk_action']
|
| 23 |
-
: false
|
| 24 |
-
;
|
| 25 |
-
$bulk = array();
|
| 26 |
-
if ( ! empty( $bulk_action ) ) {
|
| 27 |
-
$bulk = ! empty( $input['bulk'] ) && is_array( $input['bulk'] )
|
| 28 |
-
? $input['bulk']
|
| 29 |
-
: array()
|
| 30 |
-
;
|
| 31 |
-
}
|
| 32 |
-
$types = ! empty( $input['types'] ) && is_array( $input['types'] )
|
| 33 |
-
? $input['types']
|
| 34 |
-
: array()
|
| 35 |
-
;
|
| 36 |
-
$rmodel = new Smartcrawl_Model_Redirection;
|
| 37 |
-
|
| 38 |
-
$raw = $rmodel->get_all_redirections();
|
| 39 |
-
$rtypes = $rmodel->get_all_redirection_types();
|
| 40 |
-
foreach ( $urls as $source => $redir ) {
|
| 41 |
-
$source = esc_url( $source );
|
| 42 |
-
$redir = esc_url( $redir );
|
| 43 |
-
if ( 'delete' === $bulk_action ) {
|
| 44 |
-
if ( in_array( $source, $bulk ) ) {
|
| 45 |
-
if ( ! empty( $raw[ $source ] ) ) { unset( $raw[ $source ] ); }
|
| 46 |
-
if ( ! empty( $type[ $source ] ) ) { unset( $rtypes[ $source ] ); }
|
| 47 |
-
continue;
|
| 48 |
-
}
|
| 49 |
-
}
|
| 50 |
-
if ( ! preg_match( '/^https?:\/\//', $source ) ) { $source = home_url( $source ); }
|
| 51 |
-
if ( ! preg_match( '/^https?:\/\//', $redir ) ) { $redir = home_url( $redir ); }
|
| 52 |
-
$raw[ $source ] = $redir;
|
| 53 |
-
}
|
| 54 |
-
$rmodel->set_all_redirections( $raw );
|
| 55 |
-
if ( 'delete' === $bulk_action ) { $rmodel->set_all_redirection_types( $rtypes ); }
|
| 56 |
-
|
| 57 |
-
if ( in_array( $bulk_action, array( 'redirect_301', 'redirect_302' ) ) ) {
|
| 58 |
-
$new_status = 'redirect_301' === $bulk_action
|
| 59 |
-
? Smartcrawl_Model_Redirection::TYPE_301
|
| 60 |
-
: Smartcrawl_Model_Redirection::TYPE_302
|
| 61 |
-
;
|
| 62 |
-
$default_status = $rmodel->get_default_redirection_status_type();
|
| 63 |
-
$raw = $rmodel->get_all_redirection_types();
|
| 64 |
-
foreach ( $urls as $source => $redir ) {
|
| 65 |
-
$source = esc_url( $source );
|
| 66 |
-
$old_status = ! empty( $raw[ $source ] )
|
| 67 |
-
? $raw[ $source ]
|
| 68 |
-
: $default_status
|
| 69 |
-
;
|
| 70 |
-
$raw[ $source ] = in_array( $source, $bulk )
|
| 71 |
-
? $new_status
|
| 72 |
-
: $rmodel->get_valid_redirection_status_type( $old_status );
|
| 73 |
-
}
|
| 74 |
-
|
| 75 |
-
$rmodel->set_all_redirection_types( $raw );
|
| 76 |
-
} else {
|
| 77 |
-
$new_types = array();
|
| 78 |
-
foreach ( $types as $source => $redir ) {
|
| 79 |
-
if ( ! empty( $bulk_action ) && ! empty( $bulk ) && in_array( $source, $bulk ) ) { continue; }
|
| 80 |
-
$status = $rmodel->get_valid_redirection_status_type( $redir );
|
| 81 |
-
if ( empty( $status ) ) { continue; }
|
| 82 |
-
$source = esc_url( $source );
|
| 83 |
-
$new_types[ $source ] = $status;
|
| 84 |
-
}
|
| 85 |
-
$rmodel->set_all_redirection_types( $new_types );
|
| 86 |
-
}
|
| 87 |
-
|
| 88 |
-
return $result;
|
| 89 |
-
}
|
| 90 |
-
|
| 91 |
-
public function init() {
|
| 92 |
-
$this->option_name = 'wds_redirections_options';
|
| 93 |
-
$this->name = 'redirections';
|
| 94 |
-
$this->slug = Smartcrawl_Settings::TAB_REDIRECTIONS;
|
| 95 |
-
$this->action_url = admin_url( 'options.php' );
|
| 96 |
-
$this->title = __( 'Redirections', 'wds' );
|
| 97 |
-
$this->page_title = __( 'SmartCrawl Wizard: Redirections', 'wds' );
|
| 98 |
-
|
| 99 |
-
parent::init();
|
| 100 |
-
}
|
| 101 |
-
|
| 102 |
-
public function options_page() {
|
| 103 |
-
$rmodel = new Smartcrawl_Model_Redirection;
|
| 104 |
-
$arguments = array(
|
| 105 |
-
'redirections' => $rmodel->get_all_redirections(),
|
| 106 |
-
'types' => $rmodel->get_all_redirection_types(),
|
| 107 |
-
);
|
| 108 |
-
wp_enqueue_script( 'wds-admin-redirections' );
|
| 109 |
-
$this->_render_page( 'redirections-settings', $arguments );
|
| 110 |
-
}
|
| 111 |
-
|
| 112 |
-
public function defaults() {
|
| 113 |
-
if ( ! is_array( $this->options ) ) { $this->options = array(); }
|
| 114 |
-
if ( empty( $this->options['redirections-code'] ) ) {
|
| 115 |
-
$this->options['redirections-code'] = 301;
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 119 |
-
update_site_option( $this->option_name, $this->options );
|
| 120 |
-
} else {
|
| 121 |
-
update_option( $this->option_name, $this->options );
|
| 122 |
-
}
|
| 123 |
-
}
|
| 124 |
-
|
| 125 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/settings/seomoz.php
DELETED
|
@@ -1,65 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Smartcrawl_Seomoz_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 |
-
return self::$_instance;
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
public function validate( $input ) {
|
| 16 |
-
return $inpt; }
|
| 17 |
-
|
| 18 |
-
public function init() {
|
| 19 |
-
require_once( SMARTCRAWL_PLUGIN_DIR . 'tools/seomoz/api.php' );
|
| 20 |
-
|
| 21 |
-
$this->option_name = 'wds_seomoz_options';
|
| 22 |
-
$this->name = Smartcrawl_Settings::COMP_SEOMOZ;
|
| 23 |
-
$this->slug = Smartcrawl_Settings::TAB_SEOMOZ;
|
| 24 |
-
$this->action_url = admin_url( 'options.php' );
|
| 25 |
-
$this->title = __( 'Moz', 'wds' );
|
| 26 |
-
$this->page_title = __( 'SmartCrawl Wizard: Moz', 'wds' );
|
| 27 |
-
|
| 28 |
-
parent::init();
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
/**
|
| 32 |
-
* Add admin settings page
|
| 33 |
-
*/
|
| 34 |
-
public function options_page() {
|
| 35 |
-
parent::options_page();
|
| 36 |
-
$this->_render_page( 'seomoz-settings' );
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
-
/**
|
| 40 |
-
* Default settings
|
| 41 |
-
*/
|
| 42 |
-
public function defaults() {
|
| 43 |
-
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 44 |
-
$this->options = get_site_option( $this->option_name );
|
| 45 |
-
} else {
|
| 46 |
-
$this->options = get_option( $this->option_name );
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
if ( empty( $this->options['access-id'] ) ) {
|
| 50 |
-
$this->options['access-id'] = '';
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
if ( empty( $this->options['secret-key'] ) ) {
|
| 54 |
-
$this->options['secret-key'] = '';
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 58 |
-
update_site_option( $this->option_name, $this->options );
|
| 59 |
-
} else {
|
| 60 |
-
update_option( $this->option_name, $this->options );
|
| 61 |
-
}
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
}
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/settings/settings.php
CHANGED
|
@@ -1,492 +1,569 @@
|
|
| 1 |
-
<?php
|
| 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 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
*
|
| 18 |
-
*
|
| 19 |
-
*
|
| 20 |
-
*
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
$
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
$
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
$
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
}
|
| 60 |
-
if ( ! empty( $input['
|
| 61 |
-
$result['
|
| 62 |
-
} else {
|
| 63 |
-
$result['
|
| 64 |
-
}
|
| 65 |
-
if ( ! empty( $input['general-suppress-
|
| 66 |
-
$result['general-suppress-
|
| 67 |
-
} else {
|
| 68 |
-
$result['general-suppress-
|
| 69 |
-
}
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
'
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
foreach ( $
|
| 81 |
-
if ( empty( $input[ $
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
}
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
}
|
| 125 |
-
}
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
$
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
$
|
| 217 |
-
$
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
;
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
$
|
| 259 |
-
'
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
);
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
*
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
'
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
$
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
'
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
$
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
if (
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
}
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
'
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
if (
|
| 442 |
-
|
| 443 |
-
}
|
| 444 |
-
|
| 445 |
-
$this->
|
| 446 |
-
$this->
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
$this->
|
| 452 |
-
$this->
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
);
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
'
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
);
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 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 |
+
*/
|
| 23 |
+
public function validate( $input ) {
|
| 24 |
+
$result = array();
|
| 25 |
+
$saving_user_roles = isset( $input['saving_user_roles'] ) && $input['saving_user_roles'];
|
| 26 |
+
|
| 27 |
+
// The options page is broken down into two parts. The following operation fills in option values from the missing part.
|
| 28 |
+
if ( $saving_user_roles ) {
|
| 29 |
+
$input = wp_parse_args(
|
| 30 |
+
$input,
|
| 31 |
+
self::get_specific_options( $this->option_name )
|
| 32 |
+
);
|
| 33 |
+
} else {
|
| 34 |
+
$input = wp_parse_args(
|
| 35 |
+
$input,
|
| 36 |
+
$this->get_old_user_role_options()
|
| 37 |
+
);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
if ( ! empty( $input['wds_settings-setup'] ) ) {
|
| 41 |
+
$result['wds_settings-setup'] = true;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
$booleans = array_keys( Smartcrawl_Settings::get_known_components() );
|
| 45 |
+
foreach ( $booleans as $bool ) {
|
| 46 |
+
$result[ $bool ] = ! empty( $input[ $bool ] );
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
// Analysis/readability
|
| 50 |
+
$result['analysis-seo'] = ! empty( $input['analysis-seo'] );
|
| 51 |
+
$result['analysis-readability'] = ! empty( $input['analysis-readability'] );
|
| 52 |
+
$result['extras-admin_bar'] = ! empty( $input['extras-admin_bar'] );
|
| 53 |
+
|
| 54 |
+
if ( ! empty( $input['redirections-code'] ) && is_numeric( $input['redirections-code'] ) ) {
|
| 55 |
+
$code = (int) $input['redirections-code'];
|
| 56 |
+
if ( in_array( $code, array( 301, 302 ), true ) ) {
|
| 57 |
+
$result['redirections-code'] = $code;
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
if ( ! empty( $input['metabox-lax_enforcement'] ) ) {
|
| 61 |
+
$result['metabox-lax_enforcement'] = true;
|
| 62 |
+
} else {
|
| 63 |
+
$result['metabox-lax_enforcement'] = false;
|
| 64 |
+
}
|
| 65 |
+
if ( ! empty( $input['general-suppress-generator'] ) ) {
|
| 66 |
+
$result['general-suppress-generator'] = true;
|
| 67 |
+
} else {
|
| 68 |
+
$result['general-suppress-generator'] = false;
|
| 69 |
+
}
|
| 70 |
+
if ( ! empty( $input['general-suppress-redundant_canonical'] ) ) {
|
| 71 |
+
$result['general-suppress-redundant_canonical'] = true;
|
| 72 |
+
} else {
|
| 73 |
+
$result['general-suppress-redundant_canonical'] = false;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
$strings = array(
|
| 77 |
+
'access-id',
|
| 78 |
+
'secret-key',
|
| 79 |
+
);
|
| 80 |
+
foreach ( $strings as $str ) {
|
| 81 |
+
if ( ! empty( $input[ $str ] ) ) {
|
| 82 |
+
$result[ $str ] = sanitize_text_field( $input[ $str ] );
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
// Roles
|
| 87 |
+
foreach ( $this->_get_permission_contexts() as $ctx ) {
|
| 88 |
+
if ( empty( $input[ $ctx ] ) ) {
|
| 89 |
+
continue;
|
| 90 |
+
}
|
| 91 |
+
$roles = array_keys( $this->_get_filtered_roles( "wds-{$ctx}" ) );
|
| 92 |
+
$check_context = is_array( $input[ $ctx ] )
|
| 93 |
+
? $input[ $ctx ]
|
| 94 |
+
: array( $input[ $ctx ] );
|
| 95 |
+
$result[ $ctx ] = array();
|
| 96 |
+
foreach ( $check_context as $ctx_item ) {
|
| 97 |
+
if ( in_array( $ctx_item, $roles, true ) ) {
|
| 98 |
+
$result[ $ctx ][] = $ctx_item;
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
if ( isset( $input['verification-google-meta'] ) ) {
|
| 104 |
+
$this->_validate_and_save_extra_options( $input );
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
return $result;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
private function get_old_user_role_options() {
|
| 111 |
+
$option_keys = array(
|
| 112 |
+
'seo_metabox_permission_level',
|
| 113 |
+
'seo_metabox_301_permission_level',
|
| 114 |
+
'urlmetrics_metabox_permission_level',
|
| 115 |
+
);
|
| 116 |
+
|
| 117 |
+
$old_options = self::get_specific_options( $this->option_name );
|
| 118 |
+
|
| 119 |
+
$user_role_options = array();
|
| 120 |
+
foreach ( $option_keys as $option_key ) {
|
| 121 |
+
$option_value = smartcrawl_get_array_value( $old_options, $option_key );
|
| 122 |
+
if ( $option_value ) {
|
| 123 |
+
$user_role_options[ $option_key ] = $option_value;
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
return $user_role_options;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
/**
|
| 131 |
+
* Get a list of permission contexts used for roles filtering
|
| 132 |
+
*
|
| 133 |
+
* @return array
|
| 134 |
+
*/
|
| 135 |
+
protected function _get_permission_contexts() {
|
| 136 |
+
return array(
|
| 137 |
+
'seo_metabox_permission_level',
|
| 138 |
+
'seo_metabox_301_permission_level',
|
| 139 |
+
'urlmetrics_metabox_permission_level',
|
| 140 |
+
);
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
/**
|
| 144 |
+
* Get (optionally filtered) default roles
|
| 145 |
+
*
|
| 146 |
+
* @param string $context_filter Optional filter to pass the roles through first
|
| 147 |
+
*
|
| 148 |
+
* @return array List of roles
|
| 149 |
+
*/
|
| 150 |
+
protected function _get_filtered_roles( $context_filter = false ) {
|
| 151 |
+
$default_roles = array(
|
| 152 |
+
'manage_network' => __( 'Super Admin' ),
|
| 153 |
+
'list_users' => sprintf( __( '%s (and up)', 'wds' ), __( 'Site Admin' ) ),
|
| 154 |
+
'moderate_comments' => sprintf( __( '%s (and up)', 'wds' ), __( 'Editor' ) ),
|
| 155 |
+
'edit_published_posts' => sprintf( __( '%s (and up)', 'wds' ), __( 'Author' ) ),
|
| 156 |
+
'edit_posts' => sprintf( __( '%s (and up)', 'wds' ), __( 'Contributor' ) ),
|
| 157 |
+
);
|
| 158 |
+
if ( ! is_multisite() ) {
|
| 159 |
+
unset( $default_roles['manage_network'] );
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
return ! empty( $context_filter )
|
| 163 |
+
? (array) apply_filters( $context_filter, $default_roles )
|
| 164 |
+
: $default_roles;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
/**
|
| 168 |
+
* Processes extra options passed on from the main form
|
| 169 |
+
*
|
| 170 |
+
* This is a side-effect method - the extra options don't update
|
| 171 |
+
* the tab option key, but go to an extternal location
|
| 172 |
+
*
|
| 173 |
+
* @param array $input Raw form input
|
| 174 |
+
*/
|
| 175 |
+
private function _validate_and_save_extra_options( $input ) {
|
| 176 |
+
// Blog tabs
|
| 177 |
+
if ( is_multisite() && ! empty( $input['save_blog_tabs'] ) && current_user_can( 'manage_network_options' ) ) {
|
| 178 |
+
$raw = ! empty( $input['wds_blog_tabs'] ) && is_array( $input['wds_blog_tabs'] )
|
| 179 |
+
? $input['wds_blog_tabs']
|
| 180 |
+
: array();
|
| 181 |
+
$tabs = array();
|
| 182 |
+
foreach ( $raw as $key => $tab ) {
|
| 183 |
+
if ( ! empty( $tab ) ) {
|
| 184 |
+
$tabs[ $key ] = true;
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
update_site_option( 'wds_blog_tabs', $tabs );
|
| 189 |
+
|
| 190 |
+
update_site_option( 'wds_sitewide_mode', (int) ! empty( $input['wds_sitewide_mode'] ) );
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
// Sitemaps validation/save
|
| 194 |
+
$sitemaps = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_SITEMAP );
|
| 195 |
+
$sitemaps_updated = false;
|
| 196 |
+
if ( isset( $input['verification-pages'] ) ) {
|
| 197 |
+
$pages = $input['verification-pages'];
|
| 198 |
+
if ( in_array( $pages, array( '', 'home' ), true ) ) {
|
| 199 |
+
$sitemaps['verification-pages'] = $pages;
|
| 200 |
+
}
|
| 201 |
+
$sitemaps_updated = true;
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
// Meta tags
|
| 205 |
+
if ( isset( $input['verification-google-meta'] ) ) {
|
| 206 |
+
$sitemaps['verification-google-meta'] = smartcrawl_is_valid_meta_tag( $input['verification-google-meta'] ) ? $input['verification-google-meta'] : '';
|
| 207 |
+
$sitemaps_updated = true;
|
| 208 |
+
}
|
| 209 |
+
if ( isset( $input['verification-bing-meta'] ) ) {
|
| 210 |
+
$sitemaps['verification-bing-meta'] = smartcrawl_is_valid_meta_tag( $input['verification-bing-meta'] ) ? $input['verification-bing-meta'] : '';
|
| 211 |
+
$sitemaps_updated = true;
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
$custom_values_key = 'additional-metas';
|
| 215 |
+
if ( ! empty( $input[ $custom_values_key ] ) && is_array( $input[ $custom_values_key ] ) ) {
|
| 216 |
+
$custom_values = $input[ $custom_values_key ];
|
| 217 |
+
$sanitized_custom_values = array();
|
| 218 |
+
foreach ( $custom_values as $index => $custom_value ) {
|
| 219 |
+
if ( trim( $custom_value ) ) {
|
| 220 |
+
$sanitized = wp_kses( $custom_value, array(
|
| 221 |
+
'meta' => array(
|
| 222 |
+
'charset' => array(),
|
| 223 |
+
'content' => array(),
|
| 224 |
+
'http-equiv' => array(),
|
| 225 |
+
'name' => array(),
|
| 226 |
+
'scheme' => array(),
|
| 227 |
+
),
|
| 228 |
+
) );
|
| 229 |
+
if ( preg_match( '/<meta\b/', trim( $sanitized ) ) ) {
|
| 230 |
+
$sanitized_custom_values[] = $sanitized;
|
| 231 |
+
}
|
| 232 |
+
}
|
| 233 |
+
}
|
| 234 |
+
$sitemaps[ $custom_values_key ] = $sanitized_custom_values;
|
| 235 |
+
$sitemaps_updated = true;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
if ( $sitemaps_updated ) {
|
| 239 |
+
Smartcrawl_Settings::update_component_options( Smartcrawl_Settings::COMP_SITEMAP, $sitemaps );
|
| 240 |
+
}
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
public function init() {
|
| 244 |
+
$this->option_name = 'wds_settings_options';
|
| 245 |
+
$this->name = 'settings';
|
| 246 |
+
$this->slug = Smartcrawl_Settings::TAB_SETTINGS;
|
| 247 |
+
$this->action_url = admin_url( 'options.php' );
|
| 248 |
+
$this->title = __( 'Settings', 'wds' );
|
| 249 |
+
$this->page_title = __( 'SmartCrawl Wizard: Settings', 'wds' );
|
| 250 |
+
|
| 251 |
+
add_action( 'admin_init', array( $this, 'activate_component' ) );
|
| 252 |
+
add_action( 'admin_init', array( $this, 'save_moz_api_credentials' ) );
|
| 253 |
+
add_action( 'admin_footer', array( $this, 'add_native_dismissible_notice_javascript' ) );
|
| 254 |
+
add_action( 'network_admin_notices', array( $this, 'wp_org_rating_request' ) );
|
| 255 |
+
add_action( 'admin_notices', array( $this, 'wp_org_rating_request' ) );
|
| 256 |
+
add_action( 'network_admin_notices', array( $this, 'import_notice' ) );
|
| 257 |
+
|
| 258 |
+
if ( $this->display_single_site_import_notice() ) {
|
| 259 |
+
add_action( 'admin_notices', array( $this, 'import_notice' ) );
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
Smartcrawl_Controller_IO::serve();
|
| 263 |
+
|
| 264 |
+
parent::init();
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
private function display_single_site_import_notice() {
|
| 268 |
+
// Always display on non-multisite
|
| 269 |
+
return ! is_multisite()
|
| 270 |
+
// or when site-wide flag is off and the current site is the main network site
|
| 271 |
+
|| ( is_main_site() && ! smartcrawl_is_switch_active( 'SMARTCRAWL_SITEWIDE' ) );
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
/**
|
| 275 |
+
* Updates the options to activate a component.
|
| 276 |
+
*/
|
| 277 |
+
public function activate_component() {
|
| 278 |
+
$data = $this->get_request_data();
|
| 279 |
+
if ( isset( $data['wds-activate-component'] ) ) {
|
| 280 |
+
$component = sanitize_key( $data['wds-activate-component'] );
|
| 281 |
+
$options = self::get_specific_options( $this->option_name );
|
| 282 |
+
$options[ $component ] = 1;
|
| 283 |
+
|
| 284 |
+
self::update_specific_options( $this->option_name, $options );
|
| 285 |
+
|
| 286 |
+
wp_redirect( esc_url_raw( add_query_arg( array() ) ) );
|
| 287 |
+
}
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
public function save_moz_api_credentials() {
|
| 291 |
+
$data = $this->get_request_data();
|
| 292 |
+
if ( isset( $data['wds-moz-access-id'] ) || isset( $data['wds-moz-secret-key'] ) ) {
|
| 293 |
+
$options = self::get_specific_options( $this->option_name );
|
| 294 |
+
$options['access-id'] = sanitize_text_field( $data['wds-moz-access-id'] );
|
| 295 |
+
$options['secret-key'] = sanitize_text_field( $data['wds-moz-secret-key'] );
|
| 296 |
+
|
| 297 |
+
self::update_specific_options( $this->option_name, $options );
|
| 298 |
+
|
| 299 |
+
wp_redirect( esc_url_raw( add_query_arg( array() ) ) );
|
| 300 |
+
}
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
/**
|
| 304 |
+
* Add admin settings page
|
| 305 |
+
*/
|
| 306 |
+
public function options_page() {
|
| 307 |
+
parent::options_page();
|
| 308 |
+
|
| 309 |
+
$arguments['default_roles'] = $this->_get_filtered_roles();
|
| 310 |
+
|
| 311 |
+
$arguments['active_components'] = Smartcrawl_Settings::get_known_components();
|
| 312 |
+
|
| 313 |
+
$arguments['slugs'] = array(
|
| 314 |
+
Smartcrawl_Settings::TAB_CHECKUP => __( 'SEO Checkup', 'wds' ),
|
| 315 |
+
Smartcrawl_Settings::TAB_ONPAGE => __( 'Title & Meta', 'wds' ),
|
| 316 |
+
Smartcrawl_Settings::TAB_SOCIAL => __( 'Social', 'wds' ),
|
| 317 |
+
Smartcrawl_Settings::TAB_SITEMAP => __( 'Sitemap', 'wds' ),
|
| 318 |
+
Smartcrawl_Settings::TAB_AUTOLINKS => __( 'Advanced Tools', 'wds' ),
|
| 319 |
+
Smartcrawl_Settings::TAB_SETTINGS => __( 'Settings', 'wds' ),
|
| 320 |
+
);
|
| 321 |
+
$arguments['plugin_modules'] = $this->get_plugin_modules();
|
| 322 |
+
|
| 323 |
+
if ( is_multisite() ) {
|
| 324 |
+
$arguments['blog_tabs'] = self::get_blog_tabs();
|
| 325 |
+
} else {
|
| 326 |
+
$arguments['blog_tabs'] = array();
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
foreach ( $this->_get_permission_contexts() as $ctx ) {
|
| 330 |
+
$arguments[ $ctx ] = $this->_get_filtered_roles( "wds-{$ctx}" );
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
$arguments['wds_sitewide_mode'] = smartcrawl_is_switch_active( 'SMARTCRAWL_SITEWIDE' ) || (bool) get_site_option( 'wds_sitewide_mode' );
|
| 334 |
+
|
| 335 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 336 |
+
$sitemap_settings = Smartcrawl_Sitemap_Settings::get_instance();
|
| 337 |
+
$arguments['sitemap_option_name'] = $sitemap_settings->option_name;
|
| 338 |
+
|
| 339 |
+
$arguments['verification_pages'] = array(
|
| 340 |
+
'' => __( 'All pages', 'wds' ),
|
| 341 |
+
'home' => __( 'Home page', 'wds' ),
|
| 342 |
+
);
|
| 343 |
+
|
| 344 |
+
$arguments['active_tab'] = $this->_get_last_active_tab( 'tab_general_settings' );
|
| 345 |
+
|
| 346 |
+
wp_enqueue_script( 'wds-admin-settings' );
|
| 347 |
+
$this->_render_page( 'settings/settings', $arguments );
|
| 348 |
+
}
|
| 349 |
+
|
| 350 |
+
private function get_plugin_modules() {
|
| 351 |
+
// All available modules:
|
| 352 |
+
$all_plugin_modules = array(
|
| 353 |
+
'checkup' => __( 'SEO Checkup', 'wds' ),
|
| 354 |
+
'onpage' => __( 'Title & Meta', 'wds' ),
|
| 355 |
+
'social' => __( 'Social', 'wds' ),
|
| 356 |
+
'sitemap' => __( 'Sitemap', 'wds' ),
|
| 357 |
+
'autolinks' => __( 'Advanced Tools', 'wds' ),
|
| 358 |
+
);
|
| 359 |
+
|
| 360 |
+
if ( ! is_multisite() || is_network_admin() ) {
|
| 361 |
+
return $all_plugin_modules;
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
// The modules that are to be shown in the sub-site settings:
|
| 365 |
+
$sub_site_modules = array();
|
| 366 |
+
$active_blog_tabs = self::get_blog_tabs();
|
| 367 |
+
foreach ( $all_plugin_modules as $plugin_module => $label ) {
|
| 368 |
+
if (
|
| 369 |
+
array_key_exists( 'wds_' . $plugin_module, $active_blog_tabs )
|
| 370 |
+
// Only display the checkup option on the main site or network admin (handled above)
|
| 371 |
+
&& ( 'checkup' !== $plugin_module || is_main_site() )
|
| 372 |
+
) {
|
| 373 |
+
$sub_site_modules[ $plugin_module ] = $label;
|
| 374 |
+
}
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
return $sub_site_modules;
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
/**
|
| 381 |
+
* Get allowed blog tabs
|
| 382 |
+
*
|
| 383 |
+
* @return array
|
| 384 |
+
*/
|
| 385 |
+
public static function get_blog_tabs() {
|
| 386 |
+
$blog_tabs = get_site_option( 'wds_blog_tabs' );
|
| 387 |
+
|
| 388 |
+
return is_array( $blog_tabs )
|
| 389 |
+
? $blog_tabs
|
| 390 |
+
: array();
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
/**
|
| 394 |
+
* Default settings
|
| 395 |
+
*/
|
| 396 |
+
public function defaults() {
|
| 397 |
+
$this->options = self::get_specific_options( $this->option_name );
|
| 398 |
+
|
| 399 |
+
if ( empty( $this->options ) ) {
|
| 400 |
+
if ( empty( $this->options['onpage'] ) ) {
|
| 401 |
+
$this->options['onpage'] = 1;
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
if ( empty( $this->options['autolinks'] ) ) {
|
| 405 |
+
$this->options['autolinks'] = 0;
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
if ( empty( $this->options['seomoz'] ) ) {
|
| 409 |
+
$this->options['seomoz'] = 0;
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
if ( empty( $this->options['sitemap'] ) ) {
|
| 413 |
+
$this->options['sitemap'] = 0;
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
if ( empty( $this->options['social'] ) ) {
|
| 417 |
+
$this->options['social'] = 1;
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
if ( empty( $this->options['checkup'] ) ) {
|
| 421 |
+
$this->options['checkup'] = 0;
|
| 422 |
+
}
|
| 423 |
+
}
|
| 424 |
+
|
| 425 |
+
if ( empty( $this->options['seo_metabox_permission_level'] ) ) {
|
| 426 |
+
$this->options['seo_metabox_permission_level'] = ( is_multisite() ? 'manage_network' : 'list_users' );
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
if ( empty( $this->options['urlmetrics_metabox_permission_level'] ) ) {
|
| 430 |
+
$this->options['urlmetrics_metabox_permission_level'] = ( is_multisite() ? 'manage_network' : 'list_users' );
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
if ( empty( $this->options['seo_metabox_301_permission_level'] ) ) {
|
| 434 |
+
$this->options['seo_metabox_301_permission_level'] = ( is_multisite() ? 'manage_network' : 'list_users' );
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
if ( empty( $this->options['access-id'] ) ) {
|
| 438 |
+
$this->options['access-id'] = '';
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
if ( empty( $this->options['secret-key'] ) ) {
|
| 442 |
+
$this->options['secret-key'] = '';
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
if ( ! isset( $this->options['analysis-seo'] ) ) {
|
| 446 |
+
$this->options['analysis-seo'] = false;
|
| 447 |
+
}
|
| 448 |
+
if ( ! isset( $this->options['analysis-readability'] ) ) {
|
| 449 |
+
$this->options['analysis-readability'] = false;
|
| 450 |
+
}
|
| 451 |
+
if ( ! isset( $this->options['extras-admin_bar'] ) ) {
|
| 452 |
+
$this->options['extras-admin_bar'] = true;
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
apply_filters( 'wds_defaults', $this->options );
|
| 456 |
+
|
| 457 |
+
self::update_specific_options( $this->option_name, $this->options );
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
public function import_notice() {
|
| 461 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
| 462 |
+
return;
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
$this->show_import_notice(
|
| 466 |
+
new Smartcrawl_Yoast_Importer(),
|
| 467 |
+
'yoast-seo',
|
| 468 |
+
esc_html__( 'Yoast SEO', 'wds' ),
|
| 469 |
+
'wordpress-seo/wp-seo.php'
|
| 470 |
+
);
|
| 471 |
+
|
| 472 |
+
$this->show_import_notice(
|
| 473 |
+
new Smartcrawl_AIOSEOP_Importer(),
|
| 474 |
+
'all-in-one-seo',
|
| 475 |
+
esc_html__( 'All In One SEO', 'wds' ),
|
| 476 |
+
'all-in-one-seo-pack/all_in_one_seo_pack.php'
|
| 477 |
+
);
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
/**
|
| 481 |
+
* @param $importer Smartcrawl_Importer
|
| 482 |
+
* @param $plugin_key
|
| 483 |
+
* @param $plugin_name string
|
| 484 |
+
* @param $plugin
|
| 485 |
+
*/
|
| 486 |
+
private function show_import_notice( $importer, $plugin_key, $plugin_name, $plugin ) {
|
| 487 |
+
if ( ! $importer->data_exists() || ! is_plugin_active( $plugin ) ) {
|
| 488 |
+
return;
|
| 489 |
+
}
|
| 490 |
+
|
| 491 |
+
$auto_import_url = sprintf(
|
| 492 |
+
'<a href="%s">%s</a>',
|
| 493 |
+
Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SETTINGS ) . '#tab_import_export',
|
| 494 |
+
esc_html__( 'auto-import', 'wds' )
|
| 495 |
+
);
|
| 496 |
+
$message = sprintf(
|
| 497 |
+
esc_html__( "We've detected you have %1\$s, installed. Do you want to %2\$s your configuration into SmartCrawl?" ),
|
| 498 |
+
$plugin_name,
|
| 499 |
+
$auto_import_url
|
| 500 |
+
);
|
| 501 |
+
$message_key = sprintf( '%s-import', $plugin_key );
|
| 502 |
+
$dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
|
| 503 |
+
$is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $message_key ) === true;
|
| 504 |
+
|
| 505 |
+
if ( $is_message_dismissed ) {
|
| 506 |
+
return;
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
?>
|
| 510 |
+
<div class="notice-warning notice is-dismissible wds-native-dismissible-notice"
|
| 511 |
+
data-message-key="<?php echo esc_attr( $message_key ); ?>">
|
| 512 |
+
<p><?php echo wp_kses_post($message); ?></p>
|
| 513 |
+
</div>
|
| 514 |
+
<?php
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
public function add_native_dismissible_notice_javascript() {
|
| 518 |
+
$this->_render( 'native-dismissible-notice-javascript' );
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
public function wp_org_rating_request() {
|
| 522 |
+
$service = $this->get_service();
|
| 523 |
+
if ( $service->is_member() ) {
|
| 524 |
+
return;
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
if ( is_multisite() && ! is_network_admin() ) {
|
| 528 |
+
return;
|
| 529 |
+
}
|
| 530 |
+
|
| 531 |
+
$now = current_time( 'timestamp' );
|
| 532 |
+
$free_install_date = get_site_option( 'wds-free-install-date' );
|
| 533 |
+
if ( ( $now - (int) $free_install_date ) < 604800 ) {
|
| 534 |
+
return;
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
+
$key = 'wp-org-rating-request';
|
| 538 |
+
$dismissed_messages = get_user_meta( get_current_user_id(), 'wds_dismissed_messages', true );
|
| 539 |
+
$is_message_dismissed = smartcrawl_get_array_value( $dismissed_messages, $key ) === true;
|
| 540 |
+
if ( $is_message_dismissed ) {
|
| 541 |
+
return;
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
?>
|
| 545 |
+
<div class="notice-info notice is-dismissible wds-native-dismissible-notice"
|
| 546 |
+
data-message-key="<?php echo esc_attr( $key ); ?>">
|
| 547 |
+
<p><?php esc_html_e( 'We have spent countless hours developing this free plugin for you, and we would really appreciate it if you dropped us a quick rating.', 'wds' ); ?></p>
|
| 548 |
+
<a target="_blank" href="https://wordpress.org/plugins/smartcrawl-seo#reviews" class="button button-small">
|
| 549 |
+
<?php esc_html_e( 'Rate SmartCrawl', 'wds' ); ?>
|
| 550 |
+
</a>
|
| 551 |
+
<p></p>
|
| 552 |
+
</div>
|
| 553 |
+
<?php
|
| 554 |
+
}
|
| 555 |
+
|
| 556 |
+
/**
|
| 557 |
+
* @return Smartcrawl_Checkup_Service
|
| 558 |
+
*/
|
| 559 |
+
private static function get_service() {
|
| 560 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 561 |
+
|
| 562 |
+
return $service;
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
private function get_request_data() {
|
| 566 |
+
return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-settings-nonce' ) ? $_POST : array();
|
| 567 |
+
}
|
| 568 |
+
}
|
| 569 |
+
|
includes/admin/settings/sitemap.php
CHANGED
|
@@ -1,472 +1,506 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Sitemap settings admin page
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
/**
|
| 9 |
-
* Sitemap settings admin page class
|
| 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 |
-
/**
|
| 21 |
-
* Singleton instance getter
|
| 22 |
-
*
|
| 23 |
-
* @return Smartcrawl_Sitemap_Settings instance
|
| 24 |
-
*/
|
| 25 |
-
public static function get_instance() {
|
| 26 |
-
if ( empty( self::$_instance ) ) {
|
| 27 |
-
self::$_instance = new self;
|
| 28 |
-
}
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
*
|
| 35 |
-
*
|
| 36 |
-
*
|
| 37 |
-
*
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
$
|
| 45 |
-
'
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
$
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
}
|
| 76 |
-
|
| 77 |
-
//
|
| 78 |
-
$
|
| 79 |
-
|
| 80 |
-
$
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
}
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
$
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
}
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
if ( ! empty( $input[
|
| 107 |
-
$result[
|
| 108 |
-
}
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
return $
|
| 186 |
-
}
|
| 187 |
-
|
| 188 |
-
/**
|
| 189 |
-
*
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
$
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
$
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
);
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
$
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
if (
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
}
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
if (
|
| 400 |
-
$this->options
|
| 401 |
-
}
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
if (
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
}
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
}
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
}
|
| 472 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Sitemap settings admin page
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* Sitemap settings admin page class
|
| 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 |
+
/**
|
| 21 |
+
* Singleton instance getter
|
| 22 |
+
*
|
| 23 |
+
* @return Smartcrawl_Sitemap_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
|
| 35 |
+
*
|
| 36 |
+
* @param array $input Raw input.
|
| 37 |
+
*
|
| 38 |
+
* @return array Validated input
|
| 39 |
+
*/
|
| 40 |
+
public function validate( $input ) {
|
| 41 |
+
$result = array();
|
| 42 |
+
$previous_values = self::get_specific_options( $this->option_name );
|
| 43 |
+
|
| 44 |
+
if ( ! empty( $input['wds_sitemap-setup'] ) ) {
|
| 45 |
+
$result['wds_sitemap-setup'] = true;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
$strings = array(
|
| 49 |
+
'verification-google-meta',
|
| 50 |
+
'verification-bing-meta',
|
| 51 |
+
'verification-pages',
|
| 52 |
+
);
|
| 53 |
+
foreach ( $strings as $str ) {
|
| 54 |
+
if ( isset( $input[ $str ] ) ) {
|
| 55 |
+
$result[ $str ] = sanitize_text_field( $input[ $str ] );
|
| 56 |
+
} else {
|
| 57 |
+
$result[ $str ] = smartcrawl_get_array_value( $previous_values, $str );
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
$booleans = array(
|
| 62 |
+
'ping-google',
|
| 63 |
+
'ping-bing',
|
| 64 |
+
'sitemap-images',
|
| 65 |
+
'sitemap-stylesheet',
|
| 66 |
+
'sitemap-dashboard-widget',
|
| 67 |
+
'sitemap-disable-automatic-regeneration',
|
| 68 |
+
'sitemap-buddypress-groups',
|
| 69 |
+
'sitemap-buddypress-profiles',
|
| 70 |
+
);
|
| 71 |
+
foreach ( $booleans as $bool ) {
|
| 72 |
+
if ( ! empty( $input[ $bool ] ) ) {
|
| 73 |
+
$result[ $bool ] = true;
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
// Array Booleans.
|
| 78 |
+
$input['exclude_post_types'] = ! empty( $input['exclude_post_types'] ) && is_array( $input['exclude_post_types'] ) ? $input['exclude_post_types'] : array();
|
| 79 |
+
foreach ( array_keys( $this->_get_post_types_options() ) as $post_type ) {
|
| 80 |
+
$result[ $post_type ] = in_array( $post_type, $input['exclude_post_types'], true );
|
| 81 |
+
}
|
| 82 |
+
$input['exclude_taxonomies'] = ! empty( $input['exclude_taxonomies'] ) && is_array( $input['exclude_taxonomies'] ) ? $input['exclude_taxonomies'] : array();
|
| 83 |
+
foreach ( array_keys( $this->_get_taxonomies_options() ) as $tax ) {
|
| 84 |
+
$result[ $tax ] = in_array( $tax, $input['exclude_taxonomies'], true );
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
// BuddyPress-specific.
|
| 88 |
+
$bpo = $this->_get_buddyress_template_values();
|
| 89 |
+
if ( ! empty( $bpo['exclude_groups'] ) && is_array( $bpo['exclude_groups'] ) ) {
|
| 90 |
+
$input['exclude_bp_groups'] = ! empty( $input['exclude_bp_groups'] ) && is_array( $input['exclude_bp_groups'] ) ? $input['exclude_bp_groups'] : array();
|
| 91 |
+
foreach ( $bpo['exclude_groups'] as $slug => $name ) {
|
| 92 |
+
$key = "sitemap-buddypress-{$slug}";
|
| 93 |
+
$result[ $key ] = in_array( $key, $input['exclude_bp_groups'], true );
|
| 94 |
+
}
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
if ( ! empty( $bpo['exclude_roles'] ) && is_array( $bpo['exclude_roles'] ) ) {
|
| 98 |
+
$input['exclude_bp_roles'] = isset( $input['exclude_bp_roles'] ) && is_array( $input['exclude_bp_roles'] ) ? $input['exclude_bp_roles'] : array();
|
| 99 |
+
foreach ( $bpo['exclude_roles'] as $slug => $name ) {
|
| 100 |
+
$key = "sitemap-buddypress-roles-{$slug}";
|
| 101 |
+
$result[ $key ] = in_array( $key, $input['exclude_bp_roles'], true );
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
// Meta tags.
|
| 106 |
+
if ( ! empty( $input['verification-google-meta'] ) ) {
|
| 107 |
+
$result['verification-google-meta'] = smartcrawl_is_valid_meta_tag($input['verification-google-meta']) ? $input['verification-google-meta'] : '';
|
| 108 |
+
}
|
| 109 |
+
if ( ! empty( $input['verification-bing-meta'] ) ) {
|
| 110 |
+
$result['verification-bing-meta'] = smartcrawl_is_valid_meta_tag($input['verification-bing-meta']) ? $input['verification-bing-meta'] : '';
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
$custom_values_key = 'additional-metas';
|
| 114 |
+
if ( ! empty( $input[ $custom_values_key ] ) && is_array( $input[ $custom_values_key ] ) ) {
|
| 115 |
+
$result[ $custom_values_key ] = $input[ $custom_values_key ];
|
| 116 |
+
} else {
|
| 117 |
+
$result[ $custom_values_key ] = smartcrawl_get_array_value( $previous_values, $custom_values_key );
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
$result = $this->_validate_crawler_settings( $input, $result );
|
| 121 |
+
|
| 122 |
+
if ( isset( $input['extra_sitemap_urls'] ) ) {
|
| 123 |
+
$extra_urls = explode( "\n", $input['extra_sitemap_urls'] );
|
| 124 |
+
$sanitized_extra_urls = array();
|
| 125 |
+
foreach ( $extra_urls as $extra_url ) {
|
| 126 |
+
if ( trim( $extra_url ) ) {
|
| 127 |
+
$sanitized_extra_urls[] = esc_url( $extra_url );
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
Smartcrawl_Xml_Sitemap::set_extra_urls( $sanitized_extra_urls );
|
| 131 |
+
|
| 132 |
+
unset( $input['extra_sitemap_urls'] );
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
if ( isset( $input['sitemap_ignore_urls'] ) ) {
|
| 136 |
+
$ignore_urls = explode( "\n", $input['sitemap_ignore_urls'] );
|
| 137 |
+
$sanitized_ignore_urls = array();
|
| 138 |
+
foreach ( $ignore_urls as $ignore_url ) {
|
| 139 |
+
if ( trim( $ignore_url ) ) {
|
| 140 |
+
$sanitized_ignore_urls[] = smartcrawl_sanitize_relative_url( $ignore_url );
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
Smartcrawl_Xml_Sitemap::set_ignore_urls( $sanitized_ignore_urls );
|
| 144 |
+
|
| 145 |
+
unset( $input['sitemap_ignore_urls'] );
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
if ( isset( $input['sitemap_ignore_post_ids'] ) ) {
|
| 149 |
+
$ignore_post_ids = explode( ',', $input['sitemap_ignore_post_ids'] );
|
| 150 |
+
$sanitized_ignore_post_ids = array();
|
| 151 |
+
foreach ( $ignore_post_ids as $pid ) {
|
| 152 |
+
if ( trim( $pid ) && (int) $pid ) {
|
| 153 |
+
$sanitized_ignore_post_ids[] = (int) $pid;
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
Smartcrawl_Xml_Sitemap::set_ignore_ids( $sanitized_ignore_post_ids );
|
| 157 |
+
|
| 158 |
+
unset( $input['sitemap_ignore_post_ids'] );
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
return $result;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
/**
|
| 165 |
+
* Get a list of post type based options
|
| 166 |
+
*
|
| 167 |
+
* @return array
|
| 168 |
+
*/
|
| 169 |
+
protected function _get_post_types_options() {
|
| 170 |
+
$options = array();
|
| 171 |
+
|
| 172 |
+
foreach (
|
| 173 |
+
get_post_types( array(
|
| 174 |
+
'public' => true,
|
| 175 |
+
'show_ui' => true,
|
| 176 |
+
) ) as $post_type
|
| 177 |
+
) {
|
| 178 |
+
if ( in_array( $post_type, array( 'revision', 'nav_menu_item', 'attachment' ), true ) ) {
|
| 179 |
+
continue;
|
| 180 |
+
}
|
| 181 |
+
$pt = get_post_type_object( $post_type );
|
| 182 |
+
$options[ 'post_types-' . $post_type . '-not_in_sitemap' ] = $pt;
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
return $options;
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
/**
|
| 189 |
+
* Get a list of taxonomy based options
|
| 190 |
+
*
|
| 191 |
+
* @return array
|
| 192 |
+
*/
|
| 193 |
+
protected function _get_taxonomies_options() {
|
| 194 |
+
$options = array();
|
| 195 |
+
|
| 196 |
+
foreach (
|
| 197 |
+
get_taxonomies( array(
|
| 198 |
+
'public' => true,
|
| 199 |
+
'show_ui' => true,
|
| 200 |
+
) ) as $taxonomy
|
| 201 |
+
) {
|
| 202 |
+
if ( in_array( $taxonomy, array( 'nav_menu', 'link_category', 'post_format' ), true ) ) {
|
| 203 |
+
continue;
|
| 204 |
+
}
|
| 205 |
+
$tax = get_taxonomy( $taxonomy );
|
| 206 |
+
$options[ 'taxonomies-' . $taxonomy . '-not_in_sitemap' ] = $tax;
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
return $options;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
/**
|
| 213 |
+
* BuddyPress settings fields helper.
|
| 214 |
+
*
|
| 215 |
+
* @return array BuddyPress values for the template
|
| 216 |
+
*/
|
| 217 |
+
private function _get_buddyress_template_values() {
|
| 218 |
+
$arguments = array();
|
| 219 |
+
if ( ! defined( 'BP_VERSION' ) ) {
|
| 220 |
+
return $arguments;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
$arguments['checkbox_options'] = array(
|
| 224 |
+
'yes' => __( 'Yes', 'wds' ),
|
| 225 |
+
);
|
| 226 |
+
|
| 227 |
+
if ( function_exists( 'groups_get_groups' ) ) { // We have BuddyPress groups, so let's get some settings.
|
| 228 |
+
$groups = groups_get_groups( array( 'per_page' => SMARTCRAWL_BP_GROUPS_LIMIT ) );
|
| 229 |
+
$arguments['groups'] = ! empty( $groups['groups'] ) ? $groups['groups'] : array();
|
| 230 |
+
$arguments['exclude_groups'] = array();
|
| 231 |
+
foreach ( $arguments['groups'] as $group ) {
|
| 232 |
+
$arguments['exclude_groups']["exclude-buddypress-group-{$group->slug}"] = $group->name;
|
| 233 |
+
}
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
$wp_roles = new WP_Roles();
|
| 237 |
+
$wp_roles = $wp_roles->get_names();
|
| 238 |
+
$wp_roles = $wp_roles ? $wp_roles : array();
|
| 239 |
+
$arguments['exclude_roles'] = array();
|
| 240 |
+
foreach ( $wp_roles as $key => $label ) {
|
| 241 |
+
$arguments['exclude_roles']["exclude-profile-role-{$key}"] = $label;
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
return $arguments;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
/**
|
| 248 |
+
* Crawler settings validation
|
| 249 |
+
*
|
| 250 |
+
* @param array $input Raw input.
|
| 251 |
+
* @param array $result Result this far.
|
| 252 |
+
*
|
| 253 |
+
* @return array
|
| 254 |
+
*/
|
| 255 |
+
private function _validate_crawler_settings( $input, $result ) {
|
| 256 |
+
if ( empty( $input['crawler-cron-enable'] ) ) {
|
| 257 |
+
$result['crawler-cron-enable'] = false;
|
| 258 |
+
|
| 259 |
+
return $result;
|
| 260 |
+
} else {
|
| 261 |
+
$result['crawler-cron-enable'] = true;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
$frequency = ! empty( $input['crawler-frequency'] )
|
| 265 |
+
? Smartcrawl_Controller_Cron::get()->get_valid_frequency( $input['crawler-frequency'] )
|
| 266 |
+
: Smartcrawl_Controller_Cron::get()->get_default_frequency();
|
| 267 |
+
$result['crawler-frequency'] = $frequency;
|
| 268 |
+
|
| 269 |
+
$dow = isset( $input['crawler-dow'] ) && is_numeric( $input['crawler-dow'] )
|
| 270 |
+
? (int) $input['crawler-dow']
|
| 271 |
+
: 0;
|
| 272 |
+
$result['crawler-dow'] = in_array( $dow, range( 0, 6 ), true ) ? $dow : 0;
|
| 273 |
+
|
| 274 |
+
$tod = isset( $input['crawler-tod'] ) && is_numeric( $input['crawler-tod'] )
|
| 275 |
+
? (int) $input['crawler-tod']
|
| 276 |
+
: 0;
|
| 277 |
+
$result['crawler-tod'] = in_array( $tod, range( 0, 23 ), true ) ? $tod : 0;
|
| 278 |
+
|
| 279 |
+
return $result;
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
/**
|
| 283 |
+
* Initialize the handler
|
| 284 |
+
*/
|
| 285 |
+
public function init() {
|
| 286 |
+
$this->option_name = 'wds_sitemap_options';
|
| 287 |
+
$this->name = Smartcrawl_Settings::COMP_SITEMAP;
|
| 288 |
+
$this->slug = Smartcrawl_Settings::TAB_SITEMAP;
|
| 289 |
+
$this->action_url = admin_url( 'options.php' );
|
| 290 |
+
$this->title = __( 'Sitemap', 'wds' );
|
| 291 |
+
$this->page_title = __( 'SmartCrawl Wizard: Sitemap', 'wds' );
|
| 292 |
+
|
| 293 |
+
add_action( 'wp_ajax_wds-toggle-sitemap-status', array( $this, 'json_toggle_sitemap_status' ) );
|
| 294 |
+
|
| 295 |
+
parent::init();
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
/**
|
| 299 |
+
* Process run action
|
| 300 |
+
*
|
| 301 |
+
* @return bool
|
| 302 |
+
*/
|
| 303 |
+
public function process_run_action() {
|
| 304 |
+
if ( isset( $_GET['_wds_nonce'], $_GET['run-crawl'] ) && wp_verify_nonce( $_GET['_wds_nonce'], 'wds-crawl-nonce' ) ) { // Simple presence switch, no value.
|
| 305 |
+
return $this->run_crawl();
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
return false;
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
public static function crawl_url() {
|
| 312 |
+
$crawl_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP );
|
| 313 |
+
|
| 314 |
+
return esc_url_raw( add_query_arg( array(
|
| 315 |
+
'run-crawl' => 'yes',
|
| 316 |
+
'_wds_nonce' => wp_create_nonce( 'wds-crawl-nonce' ),
|
| 317 |
+
), $crawl_url ) );
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
/**
|
| 321 |
+
* Runs SEO Audit crawl
|
| 322 |
+
*/
|
| 323 |
+
public function run_crawl() {
|
| 324 |
+
if ( current_user_can( 'manage_options' ) ) {
|
| 325 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 326 |
+
$service->start();
|
| 327 |
+
}
|
| 328 |
+
$url = remove_query_arg( array( 'run-crawl', '_wds_nonce' ) );
|
| 329 |
+
if ( preg_match( '/page=wds_sitemap/', $url ) && ! preg_match( '/#tab_url_crawler/', $url ) ) {
|
| 330 |
+
$url .= '#tab_url_crawler';
|
| 331 |
+
}
|
| 332 |
+
wp_safe_redirect( esc_url( $url ) );
|
| 333 |
+
die;
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
/**
|
| 337 |
+
* Add admin settings page
|
| 338 |
+
*/
|
| 339 |
+
public function options_page() {
|
| 340 |
+
parent::options_page();
|
| 341 |
+
|
| 342 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 343 |
+
$arguments = array(
|
| 344 |
+
'post_types' => array(),
|
| 345 |
+
'taxonomies' => array(),
|
| 346 |
+
'engines' => array(
|
| 347 |
+
'ping-google' => __( 'Google', 'wds' ),
|
| 348 |
+
'ping-bing' => __( 'Bing', 'wds' ),
|
| 349 |
+
),
|
| 350 |
+
'checkbox_options' => array(
|
| 351 |
+
'yes' => __( 'Yes', 'wds' ),
|
| 352 |
+
),
|
| 353 |
+
'verification_pages' => array(
|
| 354 |
+
'' => __( 'All pages', 'wds' ),
|
| 355 |
+
'home' => __( 'Home page', 'wds' ),
|
| 356 |
+
),
|
| 357 |
+
);
|
| 358 |
+
|
| 359 |
+
foreach ( $this->_get_post_types_options() as $opt => $post_type ) {
|
| 360 |
+
$arguments['post_types'][ $opt ] = $post_type;
|
| 361 |
+
}
|
| 362 |
+
foreach ( $this->_get_taxonomies_options() as $opt => $taxonomy ) {
|
| 363 |
+
$arguments['taxonomies'][ $opt ] = $taxonomy;
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
$arguments['wds_buddypress'] = $this->_get_buddyress_template_values();
|
| 367 |
+
|
| 368 |
+
$arguments['active_tab'] = $this->_get_last_active_tab( 'tab_sitemap' );
|
| 369 |
+
|
| 370 |
+
$extra_urls = Smartcrawl_Xml_Sitemap::get_extra_urls();
|
| 371 |
+
if ( is_array( $extra_urls ) ) {
|
| 372 |
+
$arguments['extra_urls'] = ! empty( $extra_urls )
|
| 373 |
+
? implode( "\n", $extra_urls )
|
| 374 |
+
: '';
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
$ignore_urls = Smartcrawl_Xml_Sitemap::get_ignore_urls();
|
| 378 |
+
if ( is_array( $ignore_urls ) ) {
|
| 379 |
+
$arguments['ignore_urls'] = ! empty( $ignore_urls )
|
| 380 |
+
? implode( "\n", $ignore_urls )
|
| 381 |
+
: '';
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
$ignore_post_ids = Smartcrawl_Xml_Sitemap::get_ignore_ids();
|
| 385 |
+
if ( is_array( $ignore_post_ids ) ) {
|
| 386 |
+
$arguments['ignore_post_ids'] = ! empty( $ignore_post_ids )
|
| 387 |
+
? implode( ',', $ignore_post_ids )
|
| 388 |
+
: '';
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
wp_enqueue_script( 'wds-admin-sitemaps' );
|
| 392 |
+
$this->_render_page( 'sitemap/sitemap-settings', $arguments );
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
/**
|
| 396 |
+
* Default settings
|
| 397 |
+
*/
|
| 398 |
+
public function defaults() {
|
| 399 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 400 |
+
$this->options = get_site_option( $this->option_name );
|
| 401 |
+
} else {
|
| 402 |
+
$this->options = get_option( $this->option_name );
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
$dir = wp_upload_dir();
|
| 406 |
+
$path = trailingslashit( $dir['basedir'] );
|
| 407 |
+
|
| 408 |
+
if ( empty( $this->options['wds_sitemap-setup'] ) ) {
|
| 409 |
+
if ( ! isset( $this->options['sitemap-stylesheet'] ) ) {
|
| 410 |
+
$this->options['sitemap-stylesheet'] = 1;
|
| 411 |
+
}
|
| 412 |
+
}
|
| 413 |
+
|
| 414 |
+
if ( empty( $this->options['sitemappath'] ) ) {
|
| 415 |
+
$this->options['sitemappath'] = $path . 'sitemap.xml';
|
| 416 |
+
}
|
| 417 |
+
|
| 418 |
+
if ( empty( $this->options['sitemapurl'] ) ) {
|
| 419 |
+
$this->options['sitemapurl'] = get_bloginfo( 'url' ) . '/sitemap.xml';
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
if ( empty( $this->options['sitemap-images'] ) ) {
|
| 423 |
+
$this->options['sitemap-images'] = 0;
|
| 424 |
+
}
|
| 425 |
+
|
| 426 |
+
if ( empty( $this->options['sitemap-stylesheet'] ) ) {
|
| 427 |
+
$this->options['sitemap-stylesheet'] = 0;
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
if ( empty( $this->options['sitemap-dashboard-widget'] ) ) {
|
| 431 |
+
$this->options['sitemap-dashboard-widget'] = 0;
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
if ( empty( $this->options['sitemap-disable-automatic-regeneration'] ) ) {
|
| 435 |
+
$this->options['sitemap-disable-automatic-regeneration'] = 0;
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
if ( empty( $this->options['verification-pages'] ) ) {
|
| 439 |
+
$this->options['verification-pages'] = '';
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
if ( empty( $this->options['sitemap-buddypress-groups'] ) ) {
|
| 443 |
+
$this->options['sitemap-buddypress-groups'] = 0;
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
if ( empty( $this->options['sitemap-buddypress-profiles'] ) ) {
|
| 447 |
+
$this->options['sitemap-buddypress-profiles'] = 0;
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
if ( empty( $this->options['verification-google-meta'] ) ) {
|
| 451 |
+
$this->options['verification-google-meta'] = '';
|
| 452 |
+
}
|
| 453 |
+
if ( empty( $this->options['verification-bing-meta'] ) ) {
|
| 454 |
+
$this->options['verification-bing-meta'] = '';
|
| 455 |
+
}
|
| 456 |
+
if ( empty( $this->options['additional-metas'] ) ) {
|
| 457 |
+
$this->options['additiona-metas'] = array();
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
if ( ! isset( $this->options['crawler-cron-enable'] ) ) {
|
| 461 |
+
$this->options['crawler-cron-enable'] = false;
|
| 462 |
+
}
|
| 463 |
+
if ( ! isset( $this->options['crawler-frequency'] ) ) {
|
| 464 |
+
$this->options['crawler-frequency'] = Smartcrawl_Controller_Cron::get()->get_default_frequency();
|
| 465 |
+
}
|
| 466 |
+
if ( ! isset( $this->options['crawler-dow'] ) ) {
|
| 467 |
+
$this->options['crawler-dow'] = rand( 0, 6 );
|
| 468 |
+
}
|
| 469 |
+
if ( ! isset( $this->options['crawler-tod'] ) ) {
|
| 470 |
+
$this->options['crawler-tod'] = rand( 0, 23 );
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 474 |
+
update_site_option( $this->option_name, $this->options );
|
| 475 |
+
} else {
|
| 476 |
+
update_option( $this->option_name, $this->options );
|
| 477 |
+
}
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
/**
|
| 481 |
+
* Handles sitemap active toggle request
|
| 482 |
+
*/
|
| 483 |
+
public function json_toggle_sitemap_status() {
|
| 484 |
+
$data = $this->get_request_data();
|
| 485 |
+
$status = (bool) smartcrawl_get_array_value( $data, 'sitemap_active' );
|
| 486 |
+
$return = array( 'success' => false );
|
| 487 |
+
|
| 488 |
+
if ( null === $status ) {
|
| 489 |
+
wp_send_json( $return );
|
| 490 |
+
|
| 491 |
+
return;
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
$options = self::get_specific_options( 'wds_settings_options' );
|
| 495 |
+
$options['sitemap'] = $status;
|
| 496 |
+
self::update_specific_options( 'wds_settings_options', $options );
|
| 497 |
+
|
| 498 |
+
$return['success'] = true;
|
| 499 |
+
wp_send_json( $return );
|
| 500 |
+
}
|
| 501 |
+
|
| 502 |
+
private function get_request_data() {
|
| 503 |
+
return isset( $_POST['_wds_nonce'] ) && wp_verify_nonce( $_POST['_wds_nonce'], 'wds-nonce' ) ? stripslashes_deep( $_POST ) : array();
|
| 504 |
+
}
|
| 505 |
+
}
|
| 506 |
+
|
includes/admin/settings/social.php
CHANGED
|
@@ -1,203 +1,227 @@
|
|
| 1 |
-
<?php
|
| 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 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
*
|
| 18 |
-
*
|
| 19 |
-
*
|
| 20 |
-
*
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
'
|
| 34 |
-
'
|
| 35 |
-
'
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
if ( ! empty( $input['
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
$
|
| 60 |
-
$result['
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
$
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
$result['
|
| 70 |
-
}
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
$
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
'
|
| 89 |
-
|
| 90 |
-
'
|
| 91 |
-
'
|
| 92 |
-
|
| 93 |
-
'
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
$
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
$
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
$
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
}
|
| 150 |
-
|
| 151 |
-
/**
|
| 152 |
-
*
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
'
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 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 |
+
*/
|
| 23 |
+
public function validate( $input ) {
|
| 24 |
+
$result = array();
|
| 25 |
+
|
| 26 |
+
if ( ! empty( $input['wds_social-setup'] ) ) {
|
| 27 |
+
$result['wds_social-setup'] = true;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
$result['disable-schema'] = ! empty( $input['disable-schema'] );
|
| 31 |
+
|
| 32 |
+
$urls = array(
|
| 33 |
+
'facebook_url',
|
| 34 |
+
'instagram_url',
|
| 35 |
+
'linkedin_url',
|
| 36 |
+
'pinterest_url',
|
| 37 |
+
'gplus_url',
|
| 38 |
+
'youtube_url',
|
| 39 |
+
);
|
| 40 |
+
foreach ( $urls as $type ) {
|
| 41 |
+
if ( empty( $input[ $type ] ) ) {
|
| 42 |
+
continue;
|
| 43 |
+
}
|
| 44 |
+
if ( ! preg_match( '/^https?:\/\//', $input[ $type ] ) ) {
|
| 45 |
+
continue;
|
| 46 |
+
}
|
| 47 |
+
$result[ $type ] = $input[ $type ];
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
if ( ! empty( $input['sitename'] ) ) {
|
| 51 |
+
$result['sitename'] = sanitize_text_field( $input['sitename'] );
|
| 52 |
+
}
|
| 53 |
+
if ( ! empty( $input['override_name'] ) ) {
|
| 54 |
+
$result['override_name'] = sanitize_text_field( $input['override_name'] );
|
| 55 |
+
}
|
| 56 |
+
if ( ! empty( $input['organization_name'] ) ) {
|
| 57 |
+
$result['organization_name'] = sanitize_text_field( $input['organization_name'] );
|
| 58 |
+
}
|
| 59 |
+
if ( ! empty( $input['organization_logo'] ) ) {
|
| 60 |
+
$result['organization_logo'] = sanitize_text_field( $input['organization_logo'] );
|
| 61 |
+
}
|
| 62 |
+
if ( ! empty( $input['schema_type'] ) ) {
|
| 63 |
+
$result['schema_type'] = sanitize_text_field( $input['schema_type'] );
|
| 64 |
+
}
|
| 65 |
+
if ( ! empty( $input['twitter_username'] ) ) {
|
| 66 |
+
$result['twitter_username'] = sanitize_text_field( $input['twitter_username'] );
|
| 67 |
+
}
|
| 68 |
+
if ( ! empty( $input['twitter-card-type'] ) ) {
|
| 69 |
+
$result['twitter-card-type'] = sanitize_text_field( $input['twitter-card-type'] );
|
| 70 |
+
}
|
| 71 |
+
if ( ! empty( $input['fb-app-id'] ) ) {
|
| 72 |
+
$result['fb-app-id'] = sanitize_text_field( $input['fb-app-id'] );
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
$result['og-enable'] = ! empty( $input['og-enable'] );
|
| 76 |
+
$result['twitter-card-enable'] = ! empty( $input['twitter-card-enable'] );
|
| 77 |
+
|
| 78 |
+
$this->_toggle_og_globally(
|
| 79 |
+
$result['og-enable']
|
| 80 |
+
);
|
| 81 |
+
|
| 82 |
+
$this->_toggle_twitter_cards_globally(
|
| 83 |
+
$result['twitter-card-enable']
|
| 84 |
+
);
|
| 85 |
+
|
| 86 |
+
if ( ! empty( $input['pinterest-verify'] ) ) {
|
| 87 |
+
$pin = Smartcrawl_Pinterest_Printer::get();
|
| 88 |
+
$raw = trim( $input['pinterest-verify'] );
|
| 89 |
+
$tag = $pin->get_verified_tag( $raw );
|
| 90 |
+
$result['pinterest-verify'] = str_replace( ' ', '', $raw ) === str_replace( ' ', '', $tag ) ? $tag : false;
|
| 91 |
+
$result['pinterest-verification-status'] = str_replace( ' ', '', $raw ) === str_replace( ' ', '', $tag ) ? '' : 'fail';
|
| 92 |
+
} else {
|
| 93 |
+
$result['pinterest-verification-status'] = false;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
return $result;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
private function _toggle_og_globally( $new_value ) {
|
| 100 |
+
$this->toggle_setting_globally( 'og-active', $new_value );
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
private function toggle_setting_globally( $prefix, $new_value ) {
|
| 104 |
+
$existing_settings = Smartcrawl_Settings::get_specific_options( 'wds_onpage_options' );
|
| 105 |
+
$strings = array(
|
| 106 |
+
'home',
|
| 107 |
+
'author',
|
| 108 |
+
'date',
|
| 109 |
+
'search',
|
| 110 |
+
'404',
|
| 111 |
+
'category',
|
| 112 |
+
'post_tag',
|
| 113 |
+
'bp_groups',
|
| 114 |
+
'bp_profile',
|
| 115 |
+
);
|
| 116 |
+
|
| 117 |
+
foreach ( get_taxonomies( array( '_builtin' => false ), 'objects' ) as $taxonomy ) {
|
| 118 |
+
$strings[] = $taxonomy->name;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
foreach ( get_post_types( array( 'public' => true ) ) as $post_type ) {
|
| 122 |
+
$strings[] = $post_type;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
foreach ( smartcrawl_get_archive_post_types() as $archive_post_type ) {
|
| 126 |
+
$strings[] = $archive_post_type;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
foreach ( $strings as $string ) {
|
| 130 |
+
$existing_settings[ sprintf( '%s-%s', $prefix, $string ) ] = $new_value;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
Smartcrawl_Settings::update_specific_options( 'wds_onpage_options', $existing_settings );
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
private function _toggle_twitter_cards_globally( $new_value ) {
|
| 137 |
+
$this->toggle_setting_globally( 'twitter-active', $new_value );
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
public function init() {
|
| 141 |
+
$this->option_name = 'wds_social_options';
|
| 142 |
+
$this->name = Smartcrawl_Settings::COMP_SOCIAL;
|
| 143 |
+
$this->slug = Smartcrawl_Settings::TAB_SOCIAL;
|
| 144 |
+
$this->action_url = admin_url( 'options.php' );
|
| 145 |
+
$this->title = __( 'Social', 'wds' );
|
| 146 |
+
$this->page_title = __( 'SmartCrawl Wizard: Social', 'wds' );
|
| 147 |
+
|
| 148 |
+
parent::init();
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
/**
|
| 152 |
+
* Add admin settings page
|
| 153 |
+
*/
|
| 154 |
+
public function options_page() {
|
| 155 |
+
parent::options_page();
|
| 156 |
+
|
| 157 |
+
$options = Smartcrawl_Settings::get_component_options( $this->name );
|
| 158 |
+
$options = wp_parse_args(
|
| 159 |
+
( is_array( $options ) ? $options : array() ),
|
| 160 |
+
$this->get_default_options()
|
| 161 |
+
);
|
| 162 |
+
|
| 163 |
+
$arguments = array(
|
| 164 |
+
'options' => $options,
|
| 165 |
+
);
|
| 166 |
+
$arguments['active_tab'] = $this->_get_last_active_tab( 'tab_accounts' );
|
| 167 |
+
wp_enqueue_script( 'wds-admin-social' );
|
| 168 |
+
wp_enqueue_media();
|
| 169 |
+
|
| 170 |
+
$this->_render_page( 'social/social-settings', $arguments );
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
/**
|
| 174 |
+
* Gets default options set and their initial values
|
| 175 |
+
*
|
| 176 |
+
* @return array
|
| 177 |
+
*/
|
| 178 |
+
public function get_default_options() {
|
| 179 |
+
return array(
|
| 180 |
+
// Accounts
|
| 181 |
+
'sitename' => get_bloginfo( 'name' ),
|
| 182 |
+
'disable-schema' => false,
|
| 183 |
+
'schema_type' => '',
|
| 184 |
+
'override_name' => '',
|
| 185 |
+
'organization_name' => '',
|
| 186 |
+
'organization_logo' => '',
|
| 187 |
+
'twitter_username' => '',
|
| 188 |
+
'facebook_url' => '',
|
| 189 |
+
'instagram_url' => '',
|
| 190 |
+
'linkedin_url' => '',
|
| 191 |
+
'pinterest_url' => '',
|
| 192 |
+
'gplus_url' => '',
|
| 193 |
+
'youtube_url' => '',
|
| 194 |
+
// Twitter
|
| 195 |
+
'twitter-card-enable' => false,
|
| 196 |
+
'twitter-card-type' => '',
|
| 197 |
+
// Pinterest
|
| 198 |
+
'pinterest-verify' => '',
|
| 199 |
+
// OpenGraph
|
| 200 |
+
'og-enable' => true,
|
| 201 |
+
// Facebook-specific
|
| 202 |
+
'fb-app-id' => '',
|
| 203 |
+
);
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
/**
|
| 207 |
+
* Default settings
|
| 208 |
+
*/
|
| 209 |
+
public function defaults() {
|
| 210 |
+
$options = Smartcrawl_Settings::get_component_options( $this->name );
|
| 211 |
+
$options = is_array( $options ) ? $options : array();
|
| 212 |
+
|
| 213 |
+
foreach ( $this->get_default_options() as $opt => $default ) {
|
| 214 |
+
if ( ! isset( $options[ $opt ] ) ) {
|
| 215 |
+
$options[ $opt ] = $default;
|
| 216 |
+
}
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
if ( is_multisite() && SMARTCRAWL_SITEWIDE ) {
|
| 220 |
+
update_site_option( $this->option_name, $options );
|
| 221 |
+
} else {
|
| 222 |
+
update_option( $this->option_name, $options );
|
| 223 |
+
}
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
}
|
| 227 |
+
|
includes/admin/taxonomy.php
CHANGED
|
@@ -1,137 +1,193 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Smartcrawl_Taxonomy extends Smartcrawl_Renderable {
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
public function
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
$
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
;
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Smartcrawl_Taxonomy extends Smartcrawl_Renderable {
|
| 4 |
+
/**
|
| 5 |
+
* Static instance
|
| 6 |
+
*
|
| 7 |
+
* @var Smartcrawl_Taxonomy
|
| 8 |
+
*/
|
| 9 |
+
private static $_instance;
|
| 10 |
+
/**
|
| 11 |
+
* State flag
|
| 12 |
+
*
|
| 13 |
+
* @var bool
|
| 14 |
+
*/
|
| 15 |
+
private $_is_running = false;
|
| 16 |
+
|
| 17 |
+
public function __construct() {
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Boot the hooking part
|
| 22 |
+
*/
|
| 23 |
+
public static function run() {
|
| 24 |
+
self::get()->_add_hooks();
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
public function _add_hooks() {
|
| 28 |
+
if ( $this->_is_running ) {
|
| 29 |
+
return false;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
$taxonomy = smartcrawl_get_array_value( $_GET, 'taxonomy' ); // phpcs:ignore -- Can't add nonce to the request
|
| 33 |
+
if ( is_admin() && ! empty( $taxonomy ) ) {
|
| 34 |
+
add_action( sanitize_key( $taxonomy ) . '_edit_form', array(
|
| 35 |
+
&$this,
|
| 36 |
+
'term_additions_form',
|
| 37 |
+
), 10, 2 );
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
add_action( 'edit_term', array( &$this, 'update_term' ), 10, 3 );
|
| 41 |
+
|
| 42 |
+
$this->_is_running = true;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
/**
|
| 46 |
+
* Static instance getter
|
| 47 |
+
*/
|
| 48 |
+
public static function get() {
|
| 49 |
+
if ( empty( self::$_instance ) ) {
|
| 50 |
+
self::$_instance = new self();
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
return self::$_instance;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
public function form_row( $id, $label, $desc, $tax_meta, $type = 'text' ) {
|
| 57 |
+
$val = ! empty( $tax_meta[ $id ] ) ? stripslashes( $tax_meta[ $id ] ) : '';
|
| 58 |
+
|
| 59 |
+
include SMARTCRAWL_PLUGIN_DIR . 'admin/templates/taxonomy-form-row.php';
|
| 60 |
+
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
public function term_additions_form( $term, $taxonomy ) {
|
| 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 ];
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
$taxonomy_object = get_taxonomy( $taxonomy );
|
| 72 |
+
$taxonomy_labels = $taxonomy_object->labels;
|
| 73 |
+
|
| 74 |
+
$global_noindex = ! empty( $smartcrawl_options[ 'meta_robots-noindex-' . $term->taxonomy ] )
|
| 75 |
+
? $smartcrawl_options[ 'meta_robots-noindex-' . $term->taxonomy ]
|
| 76 |
+
: false;
|
| 77 |
+
$global_nofollow = ! empty( $smartcrawl_options[ 'meta_robots-nofollow-' . $term->taxonomy ] )
|
| 78 |
+
? $smartcrawl_options[ 'meta_robots-nofollow-' . $term->taxonomy ]
|
| 79 |
+
: false;
|
| 80 |
+
|
| 81 |
+
$version = Smartcrawl_Loader::get_version();
|
| 82 |
+
Smartcrawl_Settings_Admin::enqueue_shared_ui( false );
|
| 83 |
+
|
| 84 |
+
wp_enqueue_style( 'wds-admin-opengraph', SMARTCRAWL_PLUGIN_URL . '/css/wds-opengraph.css', null, $version );
|
| 85 |
+
wp_enqueue_style( 'wds-qtip2-style', SMARTCRAWL_PLUGIN_URL . '/css/external/jquery.qtip.min.css', null, $version );
|
| 86 |
+
wp_enqueue_style( 'wds-app', SMARTCRAWL_PLUGIN_URL . 'css/app.css', array( 'wds-qtip2-style' ), $version );
|
| 87 |
+
|
| 88 |
+
wp_enqueue_media();
|
| 89 |
+
|
| 90 |
+
wp_enqueue_script( 'wds-admin', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin.js', array( 'jquery' ), $version );
|
| 91 |
+
|
| 92 |
+
wp_localize_script( 'wds-admin', '_wds_admin', array(
|
| 93 |
+
'nonce' => wp_create_nonce( 'wds-admin-nonce' ),
|
| 94 |
+
) );
|
| 95 |
+
wp_enqueue_script( 'wds-admin-opengraph', SMARTCRAWL_PLUGIN_URL . 'js/wds-admin-opengraph.js', array(
|
| 96 |
+
'underscore',
|
| 97 |
+
'jquery',
|
| 98 |
+
'wds-admin',
|
| 99 |
+
), $version );
|
| 100 |
+
|
| 101 |
+
include SMARTCRAWL_PLUGIN_DIR . 'admin/templates/term-additions-form.php';
|
| 102 |
+
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
public function update_term( $term_id, $tt_id, $taxonomy ) {
|
| 106 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 107 |
+
|
| 108 |
+
$tax_meta = get_option( 'wds_taxonomy_meta' );
|
| 109 |
+
$post_data = isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'update-tag_' . $term_id )
|
| 110 |
+
? stripslashes_deep( $_POST )
|
| 111 |
+
: array();
|
| 112 |
+
|
| 113 |
+
foreach ( array( 'title', 'desc', 'bctitle', 'canonical' ) as $key ) {
|
| 114 |
+
$value = isset( $post_data["wds_{$key}"] )
|
| 115 |
+
? $post_data["wds_{$key}"]
|
| 116 |
+
: '';
|
| 117 |
+
if ( 'canonical' === $key ) {
|
| 118 |
+
$value = esc_url_raw( $value );
|
| 119 |
+
} else {
|
| 120 |
+
$value = sanitize_text_field( $value );
|
| 121 |
+
}
|
| 122 |
+
$tax_meta[ $taxonomy ][ $term_id ]["wds_{$key}"] = $value;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
foreach ( array( 'noindex', 'nofollow' ) as $key ) {
|
| 126 |
+
$global = ! empty( $smartcrawl_options["meta_robots-{$key}-{$taxonomy}"] ) ? (bool) $smartcrawl_options["meta_robots-{$key}-{$taxonomy}"] : false;
|
| 127 |
+
|
| 128 |
+
if ( ! $global ) {
|
| 129 |
+
$tax_meta[ $taxonomy ][ $term_id ][ 'wds_' . $key ] = isset( $post_data["wds_{$key}"] )
|
| 130 |
+
? (bool) $post_data["wds_{$key}"]
|
| 131 |
+
: false;
|
| 132 |
+
} else {
|
| 133 |
+
$tax_meta[ $taxonomy ][ $term_id ]["wds_override_{$key}"] = isset( $post_data["wds_override_{$key}"] )
|
| 134 |
+
? (bool) $post_data["wds_override_{$key}"]
|
| 135 |
+
: false;
|
| 136 |
+
}
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
if ( ! empty( $post_data['wds-opengraph'] ) ) {
|
| 140 |
+
$data = is_array( $post_data['wds-opengraph'] ) ? stripslashes_deep( $post_data['wds-opengraph'] ) : array();
|
| 141 |
+
$tax_meta[ $taxonomy ][ $term_id ]['opengraph'] = array();
|
| 142 |
+
if ( ! empty( $data['title'] ) ) {
|
| 143 |
+
$tax_meta[ $taxonomy ][ $term_id ]['opengraph']['title'] = sanitize_text_field( $data['title'] );
|
| 144 |
+
}
|
| 145 |
+
if ( ! empty( $data['description'] ) ) {
|
| 146 |
+
$tax_meta[ $taxonomy ][ $term_id ]['opengraph']['description'] = sanitize_text_field( $data['description'] );
|
| 147 |
+
}
|
| 148 |
+
if ( ! empty( $data['images'] ) && is_array( $data['images'] ) ) {
|
| 149 |
+
$tax_meta[ $taxonomy ][ $term_id ]['opengraph']['images'] = array();
|
| 150 |
+
foreach ( $data['images'] as $img ) {
|
| 151 |
+
$img = esc_url_raw( $img );
|
| 152 |
+
$tax_meta[ $taxonomy ][ $term_id ]['opengraph']['images'][] = $img;
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
if ( ! empty( $post_data['wds-twitter'] ) ) {
|
| 158 |
+
$data = is_array( $post_data['wds-twitter'] ) ? stripslashes_deep( $post_data['wds-twitter'] ) : array();
|
| 159 |
+
$tax_meta[ $taxonomy ][ $term_id ]['twitter'] = array();
|
| 160 |
+
if ( ! empty( $data['title'] ) ) {
|
| 161 |
+
$tax_meta[ $taxonomy ][ $term_id ]['twitter']['title'] = sanitize_text_field( $data['title'] );
|
| 162 |
+
}
|
| 163 |
+
if ( ! empty( $data['description'] ) ) {
|
| 164 |
+
$tax_meta[ $taxonomy ][ $term_id ]['twitter']['description'] = sanitize_text_field( $data['description'] );
|
| 165 |
+
}
|
| 166 |
+
if ( ! empty( $data['images'] ) && is_array( $data['images'] ) ) {
|
| 167 |
+
$tax_meta[ $taxonomy ][ $term_id ]['twitter']['images'] = array();
|
| 168 |
+
foreach ( $data['images'] as $img ) {
|
| 169 |
+
$img = esc_url_raw( $img );
|
| 170 |
+
$tax_meta[ $taxonomy ][ $term_id ]['twitter']['images'][] = $img;
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
update_option( 'wds_taxonomy_meta', $tax_meta );
|
| 176 |
+
|
| 177 |
+
if ( function_exists( 'w3tc_flush_all' ) ) {
|
| 178 |
+
// Use W3TC API v0.9.5+
|
| 179 |
+
w3tc_flush_all();
|
| 180 |
+
} elseif ( defined( 'W3TC_DIR' ) && is_readable( W3TC_DIR . '/lib/W3/ObjectCache.php' ) ) {
|
| 181 |
+
// Old (very old) API
|
| 182 |
+
require_once W3TC_DIR . '/lib/W3/ObjectCache.php';
|
| 183 |
+
$w3_objectcache = &W3_ObjectCache::instance();
|
| 184 |
+
|
| 185 |
+
$w3_objectcache->flush();
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
protected function _get_view_defaults() {
|
| 191 |
+
return array();
|
| 192 |
+
}
|
| 193 |
+
}
|
includes/admin/templates/_forms/autolinks.php
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
$autolinks_enabled = $autolinks_network_enabled && $autolinks_locally_enabled;
|
| 3 |
-
$form_action = $autolinks_enabled ? $_view['action_url'] : '';
|
| 4 |
-
?>
|
| 5 |
-
|
| 6 |
-
<?php if ( $autolinks_enabled ) :
|
| 7 |
-
<?php settings_fields( $_view['option_name'] ); ?>
|
| 8 |
-
|
| 9 |
-
<input type="hidden"
|
| 10 |
-
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$autolinks_enabled = $autolinks_network_enabled && $autolinks_locally_enabled;
|
| 3 |
+
$form_action = $autolinks_enabled ? $_view['action_url'] : '';
|
| 4 |
+
?>
|
| 5 |
+
<form action='<?php echo esc_attr( $form_action ); ?>' method='post' class="wds-form">
|
| 6 |
+
<?php if ( $autolinks_enabled ) : ?>
|
| 7 |
+
<?php settings_fields( $_view['option_name'] ); ?>
|
| 8 |
+
|
| 9 |
+
<input type="hidden"
|
| 10 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
|
| 11 |
+
value="1">
|
| 12 |
+
<?php endif; ?>
|
includes/admin/templates/_forms/import-export.php
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
-
<form method='post' enctype="multipart/form-data" class="wds-form">
|
| 2 |
-
<?php settings_fields( $_view['option_name'] ); ?>
|
| 3 |
-
|
| 4 |
-
<input type="hidden"
|
|
|
|
|
|
| 1 |
+
<form method='post' enctype="multipart/form-data" class="wds-form">
|
| 2 |
+
<?php settings_fields( $_view['option_name'] ); ?>
|
| 3 |
+
|
| 4 |
+
<input type="hidden"
|
| 5 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
|
| 6 |
+
value="1"/>
|
includes/admin/templates/_forms/settings.php
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
-
<form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
|
| 2 |
-
<?php settings_fields( $_view['option_name'] ); ?>
|
| 3 |
-
|
| 4 |
-
<input type="hidden"
|
|
|
|
|
|
| 1 |
+
<form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
|
| 2 |
+
<?php settings_fields( $_view['option_name'] ); ?>
|
| 3 |
+
|
| 4 |
+
<input type="hidden"
|
| 5 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
|
| 6 |
+
value="1"/>
|
includes/admin/templates/advanced-tools/advanced-section-automatic-linking-settings.php
CHANGED
|
@@ -1,79 +1,88 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Automatic links settings template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
?>
|
| 11 |
-
|
| 12 |
-
<div class="wds-table-fields wds-separator-top">
|
| 13 |
-
<div class="label">
|
| 14 |
-
<label class="wds-label"><?php
|
| 15 |
-
<p class="wds-label-description"><?php
|
| 16 |
-
</div>
|
| 17 |
-
|
| 18 |
-
<div class="fields">
|
| 19 |
-
<div class="row">
|
| 20 |
-
<div class="wds-table-fields wds-table-fields-stacked col-half">
|
| 21 |
-
<div class="label">
|
| 22 |
-
<label for="cpt_char_limit" class="wds-label"><?php esc_html_e( 'Posts & pages'
|
| 23 |
-
</div>
|
| 24 |
-
<div class="fields wds-allow-macros">
|
| 25 |
-
<input id='cpt_char_limit' name='<?php echo esc_attr( $option_name ); ?>[cpt_char_limit]'
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
</div>
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
</div>
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
<div class="
|
| 49 |
-
<
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
</div>
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
'
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Automatic links settings template
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 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="wds-table-fields wds-separator-top">
|
| 13 |
+
<div class="label">
|
| 14 |
+
<label class="wds-label"><?php esc_html_e( 'Min lengths', 'wds' ); ?></label>
|
| 15 |
+
<p class="wds-label-description"><?php esc_html_e( 'Define the shortest title and taxonomy length to autolink. Smaller titles will be ignored.', 'wds' ); ?></p>
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
<div class="fields">
|
| 19 |
+
<div class="row">
|
| 20 |
+
<div class="wds-table-fields wds-table-fields-stacked col-half">
|
| 21 |
+
<div class="label">
|
| 22 |
+
<label for="cpt_char_limit" class="wds-label"><?php esc_html_e( 'Posts & pages', 'wds' ); ?></label>
|
| 23 |
+
</div>
|
| 24 |
+
<div class="fields wds-allow-macros">
|
| 25 |
+
<input id='cpt_char_limit' name='<?php echo esc_attr( $option_name ); ?>[cpt_char_limit]'
|
| 26 |
+
type='text' class='wds-field'
|
| 27 |
+
value='<?php echo esc_attr( $_view['options']['cpt_char_limit'] ); ?>'>
|
| 28 |
+
</div>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
<div class="wds-table-fields wds-table-fields-stacked col-half">
|
| 32 |
+
<div class="label">
|
| 33 |
+
<label for="tax_char_limit"
|
| 34 |
+
class="wds-label"><?php esc_html_e( 'Archives & taxonomies', 'wds' ); ?></label>
|
| 35 |
+
</div>
|
| 36 |
+
<div class="fields wds-allow-macros">
|
| 37 |
+
<input id='tax_char_limit' name='<?php echo esc_attr( $option_name ); ?>[tax_char_limit]'
|
| 38 |
+
type='text' class='wds-field'
|
| 39 |
+
value='<?php echo esc_attr( $_view['options']['tax_char_limit'] ); ?>'>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
</div>
|
| 43 |
+
<p class="wds-label-description"><?php esc_html_e( 'We recommend a minimum of 10 chars for each type.', 'wds' ); ?></p>
|
| 44 |
+
</div>
|
| 45 |
+
</div>
|
| 46 |
+
|
| 47 |
+
<div class="wds-table-fields wds-separator-top">
|
| 48 |
+
<div class="label">
|
| 49 |
+
<label class="wds-label"><?php esc_html_e( 'Max limits', 'wds' ); ?></label>
|
| 50 |
+
<p class="wds-label-description"><?php esc_html_e( 'Set the max amount of links you want to appear per post.', 'wds' ); ?></p>
|
| 51 |
+
</div>
|
| 52 |
+
|
| 53 |
+
<div class="fields">
|
| 54 |
+
<div class="row">
|
| 55 |
+
<div class="wds-table-fields wds-table-fields-stacked col-half">
|
| 56 |
+
<div class="label">
|
| 57 |
+
<label for="link_limit" class="wds-label"><?php esc_html_e( 'Per post total', 'wds' ); ?></label>
|
| 58 |
+
</div>
|
| 59 |
+
<div class="fields wds-allow-macros">
|
| 60 |
+
<input id='link_limit' name='<?php echo esc_attr( $option_name ); ?>[link_limit]' type='text'
|
| 61 |
+
class='wds-field' value='<?php echo esc_attr( $_view['options']['link_limit'] ); ?>'>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<div class="wds-table-fields wds-table-fields-stacked col-half">
|
| 66 |
+
<div class="label">
|
| 67 |
+
<label for="single_link_limit"
|
| 68 |
+
class="wds-label"><?php esc_html_e( 'Per keyword group', 'wds' ); ?></label>
|
| 69 |
+
</div>
|
| 70 |
+
<div class="fields wds-allow-macros">
|
| 71 |
+
<input id='single_link_limit' name='<?php echo esc_attr( $option_name ); ?>[single_link_limit]'
|
| 72 |
+
type='text' class='wds-field'
|
| 73 |
+
value='<?php echo esc_attr( $_view['options']['single_link_limit'] ); ?>'>
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
<p class="wds-label-description"><?php esc_html_e( 'Use 0 to allow unlimited automatic links.', 'wds' ); ?></p>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
|
| 81 |
+
<?php
|
| 82 |
+
$this->_render( 'toggle-group', array(
|
| 83 |
+
'label' => __( 'Optional Settings', 'wds' ),
|
| 84 |
+
'description' => __( 'Configure extra settings for absolute control over autolinking.', 'wds' ),
|
| 85 |
+
'items' => $additional_settings,
|
| 86 |
+
'separator' => true,
|
| 87 |
+
) );
|
| 88 |
+
?>
|
includes/admin/templates/advanced-tools/advanced-section-automatic-linking.php
CHANGED
|
@@ -1,57 +1,64 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
?>
|
| 5 |
-
|
| 6 |
-
<div class="wds-automatic-linking">
|
| 7 |
-
<div class="cf">
|
| 8 |
-
<div class="wds-automatic-linking-insert-links">
|
| 9 |
-
<?php
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
?>
|
| 16 |
-
</div>
|
| 17 |
-
|
| 18 |
-
<div class="wds-automatic-linking-link-to">
|
| 19 |
-
<?php
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
?>
|
| 26 |
-
</div>
|
| 27 |
-
</div>
|
| 28 |
-
|
| 29 |
-
<div class="wds-table-fields wds-separator-top">
|
| 30 |
-
<label class="wds-label"><?php
|
| 31 |
-
<p class="wds-label-description"><?php
|
| 32 |
-
</div>
|
| 33 |
-
|
| 34 |
-
<div class="box-autolinks-custom-keywords-settings">
|
| 35 |
-
<div class="wds-replaceable">
|
| 36 |
-
<div class="group wds-group wds-group-field">
|
| 37 |
-
<label for="customkey" class="wds-label"><?php esc_html_e( 'Custom Keywords'
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
<
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$insert = empty( $insert ) ? array() : $insert;
|
| 3 |
+
$linkto = empty( $linkto ) ? array() : $linkto;
|
| 4 |
+
?>
|
| 5 |
+
|
| 6 |
+
<div class="wds-automatic-linking">
|
| 7 |
+
<div class="cf">
|
| 8 |
+
<div class="wds-automatic-linking-insert-links">
|
| 9 |
+
<?php
|
| 10 |
+
$this->_render( 'toggle-group', array(
|
| 11 |
+
'label' => __( 'Insert Links', 'wds' ),
|
| 12 |
+
'description' => __( 'Specify what post types to insert links into.', 'wds' ),
|
| 13 |
+
'items' => $insert,
|
| 14 |
+
) );
|
| 15 |
+
?>
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
<div class="wds-automatic-linking-link-to">
|
| 19 |
+
<?php
|
| 20 |
+
$this->_render( 'toggle-group', array(
|
| 21 |
+
'label' => __( 'Link to', 'wds' ),
|
| 22 |
+
'description' => __( 'Choose content you want to convert to links.', 'wds' ),
|
| 23 |
+
'items' => $linkto,
|
| 24 |
+
) );
|
| 25 |
+
?>
|
| 26 |
+
</div>
|
| 27 |
+
</div>
|
| 28 |
+
|
| 29 |
+
<div class="wds-table-fields wds-separator-top">
|
| 30 |
+
<label class="wds-label"><?php esc_html_e( 'Custom keywords', 'wds' ); ?></label>
|
| 31 |
+
<p class="wds-label-description"><?php esc_html_e( 'Choose additional keywords you want to auto-link and tell SmartCrawl where to link to. Add as many as you like.', 'wds' ); ?></p>
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
<div class="box-autolinks-custom-keywords-settings">
|
| 35 |
+
<div class="wds-replaceable">
|
| 36 |
+
<div class="group wds-group wds-group-field">
|
| 37 |
+
<label for="customkey" class="wds-label"><?php esc_html_e( 'Custom Keywords', 'wds' ); ?></label>
|
| 38 |
+
<?php // phpcs:disable ?>
|
| 39 |
+
<textarea id='customkey' name='<?php echo esc_attr( $_view['option_name'] ); ?>[customkey]'
|
| 40 |
+
class='wds-textarea'><?php
|
| 41 |
+
echo esc_textarea( $_view['options']['customkey'] );
|
| 42 |
+
?></textarea>
|
| 43 |
+
<?php // phpcs:enable ?>
|
| 44 |
+
</div>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<div class="wds-table-fields wds-separator-top">
|
| 49 |
+
<label for="ignore" class="wds-label"><?php esc_html_e( 'Exclusions', 'wds' ); ?></label>
|
| 50 |
+
<p class="wds-label-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>
|
| 51 |
+
<input id='ignore' name='<?php echo esc_attr( $_view['option_name'] ); ?>[ignore]' size='' type='text'
|
| 52 |
+
class='wds-field' value='<?php echo esc_attr( $_view['options']['ignore'] ); ?>'>
|
| 53 |
+
</div>
|
| 54 |
+
<div class="group wds-group wds-group-field">
|
| 55 |
+
<div class="wds-replaceable">
|
| 56 |
+
<label for="ignorepost"
|
| 57 |
+
class="wds-label"><?php esc_html_e( 'Exclude Posts, Pages & CPTs', 'wds' ); ?></label>
|
| 58 |
+
<input id='ignorepost' name='<?php echo esc_attr( $_view['option_name'] ); ?>[ignorepost]' size=''
|
| 59 |
+
type='text' class='wds-field' value='<?php echo esc_attr( $_view['options']['ignorepost'] ); ?>'>
|
| 60 |
+
<span
|
| 61 |
+
class="wds-field-legend"><?php esc_html_e( 'Paste in the IDs, slugs or titles for the post/pages you wish to exclude and separate them by commas', 'wds' ); ?></span>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
</div>
|
includes/admin/templates/advanced-tools/advanced-section-moz.php
CHANGED
|
@@ -1,62 +1,69 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
?>
|
| 6 |
-
|
| 7 |
-
<?php if ( empty( $access_id ) || empty( $secret_key ) ) :
|
| 8 |
-
<div class="wds-disabled-component">
|
| 9 |
-
<p>
|
| 10 |
-
<img
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
)
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
<div class="
|
| 44 |
-
<
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
<?php
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 3 |
+
$access_id = empty( $smartcrawl_options['access-id'] ) ? '' : $smartcrawl_options['access-id'];
|
| 4 |
+
$secret_key = empty( $smartcrawl_options['secret-key'] ) ? '' : $smartcrawl_options['secret-key'];
|
| 5 |
+
?>
|
| 6 |
+
|
| 7 |
+
<?php if ( empty( $access_id ) || empty( $secret_key ) ) : ?>
|
| 8 |
+
<div class="wds-disabled-component">
|
| 9 |
+
<p>
|
| 10 |
+
<img
|
| 11 |
+
src="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>/images/<?php echo esc_attr( 'moz-disabled.png' ); ?>"
|
| 12 |
+
alt="<?php esc_attr_e( 'MOZ Disabled', 'wds' ); ?>" class="wds-disabled-image"/>
|
| 13 |
+
</p>
|
| 14 |
+
<p><?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 - ranking, links, and much more.', 'wds' ); ?></p>
|
| 15 |
+
</div>
|
| 16 |
+
<div class="wds-moz-api-credentials">
|
| 17 |
+
<p>
|
| 18 |
+
<?php
|
| 19 |
+
printf(
|
| 20 |
+
esc_html__( 'Connect your Moz account. You can get the API credentials %s.', 'wds' ),
|
| 21 |
+
sprintf( '<a href="https://moz.com/products/api" target="_blank">%s</a>', esc_html__( 'here', 'wds' ) )
|
| 22 |
+
);
|
| 23 |
+
?>
|
| 24 |
+
</p>
|
| 25 |
+
<form method="POST" class="wds-form">
|
| 26 |
+
<div class="row">
|
| 27 |
+
<div class="col-half wds-table-fields wds-table-fields-stacked">
|
| 28 |
+
<div class="label">
|
| 29 |
+
<label class="wds-label"
|
| 30 |
+
for="wds-moz-access-id"><?php esc_html_e( 'Access ID', 'wds' ); ?></label>
|
| 31 |
+
</div>
|
| 32 |
+
<div class="fields">
|
| 33 |
+
<input
|
| 34 |
+
type="text"
|
| 35 |
+
id="wds-moz-access-id"
|
| 36 |
+
name="wds-moz-access-id"
|
| 37 |
+
placeholder="<?php esc_attr_e( 'Enter your Moz Access ID', 'wds' ); ?>"
|
| 38 |
+
value="<?php echo esc_attr( $access_id ); ?>"/>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
|
| 42 |
+
<div class="col-half wds-table-fields wds-table-fields-stacked">
|
| 43 |
+
<div class="label">
|
| 44 |
+
<label class="wds-label"
|
| 45 |
+
for="wds-moz-secret-key"><?php esc_html_e( 'Secret Key', 'wds' ); ?></label>
|
| 46 |
+
</div>
|
| 47 |
+
<div class="fields">
|
| 48 |
+
<input
|
| 49 |
+
type="text"
|
| 50 |
+
id="wds-moz-secret-key"
|
| 51 |
+
name="wds-moz-secret-key"
|
| 52 |
+
placeholder="<?php esc_attr_e( 'Enter your Moz Secret Key', 'wds' ); ?>"
|
| 53 |
+
value="<?php echo esc_attr( $secret_key ); ?>"/>
|
| 54 |
+
</div>
|
| 55 |
+
</div>
|
| 56 |
+
<?php wp_nonce_field( 'wds-settings-nonce', '_wds_nonce' ); ?>
|
| 57 |
+
</div>
|
| 58 |
+
<input name='submit' type='submit' class='button' value='<?php esc_attr_e( 'Connect', 'wds' ); ?>'/>
|
| 59 |
+
</form>
|
| 60 |
+
</div>
|
| 61 |
+
<?php else : ?>
|
| 62 |
+
<p class="wds-content-tabs-description">
|
| 63 |
+
<?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' ); ?>
|
| 64 |
+
</p>
|
| 65 |
+
<button type="submit" class="button button-small button-dark button-dark-o" name="reset-moz-credentials"
|
| 66 |
+
value="1"><?php esc_html_e( 'Reset API Credentials', 'wds' ); ?></button>
|
| 67 |
+
<?php wp_nonce_field( 'wds-autolinks-nonce', '_wds_nonce' ); ?>
|
| 68 |
+
<?php Smartcrawl_Seomoz_Dashboard_Widget::widget(); ?>
|
| 69 |
+
<?php endif; ?>
|
includes/admin/templates/advanced-tools/advanced-section-redirects.php
CHANGED
|
@@ -1,106 +1,109 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
),
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
<
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
<option value="<?php echo esc_attr( $redirection_type ); ?>"
|
| 43 |
-
<?php echo
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
</div>
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
<
|
| 52 |
-
|
| 53 |
-
<
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
<button
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
</div>
|
| 66 |
-
<
|
| 67 |
-
<
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
</
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$redirections = empty( $redirections ) ? array() : $redirections;
|
| 3 |
+
$types = empty( $types ) ? array() : $types;
|
| 4 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 5 |
+
$plugin_settings = Smartcrawl_Settings::get_specific_options( 'wds_settings_options' );
|
| 6 |
+
$current_redirection_code = smartcrawl_get_array_value( $plugin_settings, 'redirections-code' );
|
| 7 |
+
$redirection_types = array(
|
| 8 |
+
301 => __( 'Permanent (301)', 'wds' ),
|
| 9 |
+
302 => __( 'Temporary (302)', 'wds' ),
|
| 10 |
+
);
|
| 11 |
+
?>
|
| 12 |
+
|
| 13 |
+
<div class="wds-redirect-attachments wds-separator-top">
|
| 14 |
+
<?php
|
| 15 |
+
$this->_render( 'toggle-group', array(
|
| 16 |
+
'label' => __( 'Redirect attachments', 'wds' ),
|
| 17 |
+
'description' => __( 'Redirect attachments to their parent post, preventing them from appearing in SERPs.', 'wds' ),
|
| 18 |
+
'items' => array(
|
| 19 |
+
'redirect-attachments' => __( 'Redirect attachments', 'wds' ),
|
| 20 |
+
'redirect-attachments-images_only' => __( '... but only if the attachment is image', 'wds' ),
|
| 21 |
+
),
|
| 22 |
+
) );
|
| 23 |
+
?>
|
| 24 |
+
</div>
|
| 25 |
+
|
| 26 |
+
<div class="wds-table-fields wds-separator-top">
|
| 27 |
+
<div class="label">
|
| 28 |
+
<label class="wds-label" for="wds-default-redirection-type">
|
| 29 |
+
<?php esc_html_e( 'Default Redirection Type', 'wds' ); ?>
|
| 30 |
+
</label>
|
| 31 |
+
<p class="wds-label-description">
|
| 32 |
+
<?php esc_html_e( 'Select the redirection type that you would like to be used as default.', 'wds' ); ?>
|
| 33 |
+
</p>
|
| 34 |
+
</div>
|
| 35 |
+
<div class="fields">
|
| 36 |
+
<select id="wds-default-redirection-type"
|
| 37 |
+
name="<?php echo esc_attr( $option_name ); ?>[redirections-code]"
|
| 38 |
+
autocomplete="off"
|
| 39 |
+
class="select-container"
|
| 40 |
+
style="width: 100%">
|
| 41 |
+
<?php foreach ( $redirection_types as $redirection_type => $redirection_type_label ): ?>
|
| 42 |
+
<option value="<?php echo esc_attr( $redirection_type ); ?>"
|
| 43 |
+
<?php echo selected( $redirection_type, $current_redirection_code, false ); ?>>
|
| 44 |
+
<?php echo esc_html( $redirection_type_label ); ?>
|
| 45 |
+
</option>
|
| 46 |
+
<?php endforeach; ?>
|
| 47 |
+
</select>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
|
| 51 |
+
<input type="hidden" value="1" name="<?php echo esc_attr( $option_name ); ?>[save_redirects]"/>
|
| 52 |
+
<div class="wds-redirects wds-separator-top">
|
| 53 |
+
<label class="wds-label"><?php esc_html_e( 'Redirects', 'wds' ); ?></label>
|
| 54 |
+
<p class="wds-small-text">
|
| 55 |
+
<?php esc_html_e( 'Adding entries here will set up a redirect from one URL to another.', 'wds' ); ?>
|
| 56 |
+
</p>
|
| 57 |
+
<p class="wds-small-text">
|
| 58 |
+
<?php esc_html_e( 'Formats include relative (E.g. /cats) or absolute URLs (E.g. www.website.com/cats or https://website.com/cats).', 'wds' ); ?>
|
| 59 |
+
</p>
|
| 60 |
+
<div class="wds-redirects-buttons-top">
|
| 61 |
+
<button
|
| 62 |
+
class="wds-bulk-update button button-small button-dark"><?php esc_html_e( 'Bulk Update', 'wds' ); ?></button>
|
| 63 |
+
<button
|
| 64 |
+
class="wds-bulk-remove button button-small button-dark-o"><?php esc_html_e( 'Remove Redirects', 'wds' ); ?></button>
|
| 65 |
+
</div>
|
| 66 |
+
<div class="wds-notice wds-notice-warning wds-redirects-unsaved-notice">
|
| 67 |
+
<p><?php esc_html_e( "You've made changes to your Sitemap structure. You need to save the changes to make them live.", 'wds' ); ?></p>
|
| 68 |
+
</div>
|
| 69 |
+
<table class="wds-redirects-table wds-list-table">
|
| 70 |
+
<thead>
|
| 71 |
+
<tr>
|
| 72 |
+
<th class="selector"><input type="checkbox" class="wds-checkbox" autocomplete="off" title=""/></th>
|
| 73 |
+
<th class="source"><?php esc_html_e( 'Old URL', 'wds' ); ?></th>
|
| 74 |
+
<th class="destination"><?php esc_html_e( 'New URL', 'wds' ); ?></th>
|
| 75 |
+
<th class="type" colspan="2"><?php esc_html_e( 'Redirect Type', 'wds' ); ?></th>
|
| 76 |
+
</tr>
|
| 77 |
+
</thead>
|
| 78 |
+
<tbody>
|
| 79 |
+
<?php
|
| 80 |
+
$redirection_index = 0;
|
| 81 |
+
?>
|
| 82 |
+
<?php foreach ( $redirections as $source => $destination ) : ?>
|
| 83 |
+
<?php
|
| 84 |
+
$type = ! empty( $types[ $source ] ) ? $types[ $source ] : '';
|
| 85 |
+
|
| 86 |
+
$this->_render( 'advanced-tools/advanced-tools-redirect-item', array(
|
| 87 |
+
'source' => esc_attr( $source ),
|
| 88 |
+
'destination' => esc_attr( $destination ),
|
| 89 |
+
'index' => esc_attr( $redirection_index ),
|
| 90 |
+
'string_permanent' => esc_html__( 'Permanent (301)', 'wds' ),
|
| 91 |
+
'string_temporary' => esc_html__( 'Temporary (302)', 'wds' ),
|
| 92 |
+
'string_options' => esc_html__( 'Options', 'wds' ),
|
| 93 |
+
'string_remove' => esc_html__( 'Remove', 'wds' ),
|
| 94 |
+
'maybe_permanent_selected' => selected( $type, 301, false ),
|
| 95 |
+
'maybe_temporary_selected' => selected( $type, 302, false ),
|
| 96 |
+
) );
|
| 97 |
+
?>
|
| 98 |
+
<?php $redirection_index ++; ?>
|
| 99 |
+
<?php endforeach; ?>
|
| 100 |
+
</tbody>
|
| 101 |
+
<tfoot>
|
| 102 |
+
<tr class="wds-redirects-buttons-bottom">
|
| 103 |
+
<td colspan="5">
|
| 104 |
+
<button class="wds-add-redirect button button-dark"><?php esc_html_e( 'Add New', 'wds' ); ?></button>
|
| 105 |
+
</td>
|
| 106 |
+
</tr>
|
| 107 |
+
</tfoot>
|
| 108 |
+
</table>
|
| 109 |
+
</div>
|
includes/admin/templates/advanced-tools/advanced-tools-redirect-item.php
CHANGED
|
@@ -1,69 +1,71 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
| 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 |
+
$index = empty( $index ) ? 0 : $index;
|
| 7 |
+
$maybe_permanent_selected = empty( $maybe_permanent_selected ) ? '' : $maybe_permanent_selected;
|
| 8 |
+
$maybe_temporary_selected = empty( $maybe_temporary_selected ) ? '' : $maybe_temporary_selected;
|
| 9 |
+
|
| 10 |
+
$string_permanent = empty( $string_permanent ) ? '' : $string_permanent;
|
| 11 |
+
$string_temporary = empty( $string_temporary ) ? '' : $string_temporary;
|
| 12 |
+
$string_options = empty( $string_options ) ? '' : $string_options;
|
| 13 |
+
$string_remove = empty( $string_remove ) ? '' : $string_remove;
|
| 14 |
+
|
| 15 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 16 |
+
?>
|
| 17 |
+
|
| 18 |
+
<tr data-index="<?php echo $index; ?>">
|
| 19 |
+
<td>
|
| 20 |
+
<input type="checkbox"
|
| 21 |
+
autocomplete="off"
|
| 22 |
+
class="wds-checkbox"
|
| 23 |
+
name="<?php echo $option_name; ?>[bulk][]"
|
| 24 |
+
value="<?php echo $index; ?>" title=""/>
|
| 25 |
+
</td>
|
| 26 |
+
|
| 27 |
+
<td>
|
| 28 |
+
<div class="wds-redirection_item-source">
|
| 29 |
+
<input type="text"
|
| 30 |
+
class="wds-field"
|
| 31 |
+
placeholder="<?php esc_html_e( 'E.g. /cats', 'wds' ); ?>"
|
| 32 |
+
value="<?php echo $source; ?>"
|
| 33 |
+
name="<?php echo $option_name; ?>[urls][<?php echo $index; ?>][source]"
|
| 34 |
+
title=""/>
|
| 35 |
+
</div>
|
| 36 |
+
</td>
|
| 37 |
+
|
| 38 |
+
<td>
|
| 39 |
+
<div class="wds-redirection_item-destination">
|
| 40 |
+
<input id="<?php echo $option_name; ?>"
|
| 41 |
+
name="<?php echo $option_name; ?>[urls][<?php echo $index; ?>][destination]"
|
| 42 |
+
type="text"
|
| 43 |
+
placeholder="<?php esc_html_e( 'E.g. /cats-new', 'wds' ); ?>"
|
| 44 |
+
class="wds-field"
|
| 45 |
+
value="<?php echo $destination; ?>"
|
| 46 |
+
title=""/>
|
| 47 |
+
</div>
|
| 48 |
+
</td>
|
| 49 |
+
|
| 50 |
+
<td>
|
| 51 |
+
<div class="wds-redirection_item-type select-container select-container-no-style">
|
| 52 |
+
<select title=""
|
| 53 |
+
style="width: 100%;"
|
| 54 |
+
name="<?php echo $option_name; ?>[urls][<?php echo $index; ?>][type]">
|
| 55 |
+
<option <?php echo $maybe_permanent_selected; ?> value="301"><?php echo $string_permanent; ?></option>
|
| 56 |
+
<option <?php echo $maybe_temporary_selected; ?> value="302"><?php echo $string_temporary; ?></option>
|
| 57 |
+
</select>
|
| 58 |
+
</div>
|
| 59 |
+
</td>
|
| 60 |
+
|
| 61 |
+
<td>
|
| 62 |
+
<?php
|
| 63 |
+
$this->_render( 'links-dropdown', array(
|
| 64 |
+
'label' => $string_options,
|
| 65 |
+
'links' => array(
|
| 66 |
+
'#remove' => $string_remove,
|
| 67 |
+
),
|
| 68 |
+
) );
|
| 69 |
+
?>
|
| 70 |
+
</td>
|
| 71 |
+
</tr>
|
includes/admin/templates/advanced-tools/advanced-tools-settings.php
CHANGED
|
@@ -1,149 +1,157 @@
|
|
| 1 |
-
<div id="container" class="wrap wrap-wds wds-page wds-page-autolinks">
|
| 2 |
-
|
| 3 |
-
<section id="header">
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
'
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
'
|
| 33 |
-
'
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
'
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
)
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div id="container" class="wrap wrap-wds wds-page wds-page-autolinks">
|
| 2 |
+
|
| 3 |
+
<section id="header">
|
| 4 |
+
<div class="actions">
|
| 5 |
+
<a target="_blank" class="button button-small button-light actions-button"
|
| 6 |
+
href="https://premium.wpmudev.org/docs/wpmu-dev-plugins/smartcrawl/#chapter-5">
|
| 7 |
+
<i class="wds-icon-academy"></i>
|
| 8 |
+
<?php esc_html_e( 'View Documentation', 'wds' ); ?>
|
| 9 |
+
</a>
|
| 10 |
+
</div>
|
| 11 |
+
|
| 12 |
+
<?php $this->_render( 'settings-message-top' ); ?>
|
| 13 |
+
<h1><?php esc_html_e( 'Advanced Tools', 'wds' ); ?></h1>
|
| 14 |
+
</section><!-- end header -->
|
| 15 |
+
|
| 16 |
+
<div>
|
| 17 |
+
<div class="cf"></div>
|
| 18 |
+
<div class="vertical-tabs">
|
| 19 |
+
<?php
|
| 20 |
+
$autolinks_disabled_section = array(
|
| 21 |
+
array(
|
| 22 |
+
'section_template' => 'disabled-component-inner',
|
| 23 |
+
'section_args' => array(
|
| 24 |
+
'content' => sprintf(
|
| 25 |
+
'%s<br/>%s<br/>%s',
|
| 26 |
+
__( 'Configure SmartCrawl to automatically link certain key words to a page on your blog or even', 'wds' ),
|
| 27 |
+
__( 'a whole new site all together. Internal linking can help boost SEO but giving search engines', 'wds' ),
|
| 28 |
+
__( 'ample ways to index your site.', 'wds' )
|
| 29 |
+
),
|
| 30 |
+
'image' => 'autolinking-disabled.png',
|
| 31 |
+
'component' => 'autolinks',
|
| 32 |
+
'premium_feature' => true,
|
| 33 |
+
'button_text' => __( 'Activate Keyword Linking', 'wds' ),
|
| 34 |
+
),
|
| 35 |
+
),
|
| 36 |
+
);
|
| 37 |
+
|
| 38 |
+
$autolinks_sections = array(
|
| 39 |
+
array(
|
| 40 |
+
'section_title' => __( 'Automatic Links', 'wds' ),
|
| 41 |
+
'section_description' => __( 'SmartCrawl will look for keywords that match posts/pages around your website and automatically link them. Specify what post types you want to include in this tool, and what post types you want those to automatically link to.', 'wds' ),
|
| 42 |
+
'section_template' => 'advanced-tools/advanced-section-automatic-linking',
|
| 43 |
+
'section_args' => array(
|
| 44 |
+
'insert' => $insert,
|
| 45 |
+
'linkto' => $linkto,
|
| 46 |
+
),
|
| 47 |
+
),
|
| 48 |
+
array(
|
| 49 |
+
'section_title' => __( 'Settings', 'wds' ),
|
| 50 |
+
'section_description' => __( 'Control the overall linking engine to work how you want it to.', 'wds' ),
|
| 51 |
+
'section_template' => 'advanced-tools/advanced-section-automatic-linking-settings',
|
| 52 |
+
'section_args' => array(
|
| 53 |
+
'additional_settings' => array(
|
| 54 |
+
'allow_empty_tax' => array(
|
| 55 |
+
'label' => __( 'Allow autolinks to empty taxonomies', 'wds' ),
|
| 56 |
+
'description' => __( 'Allows autolinking to taxonomies that have no posts assigned to them.', 'wds' ),
|
| 57 |
+
),
|
| 58 |
+
'excludeheading' => array(
|
| 59 |
+
'label' => __( 'Prevent linking in heading tags', 'wds' ),
|
| 60 |
+
'description' => __( 'Excludes headings from autolinking.', 'wds' ),
|
| 61 |
+
),
|
| 62 |
+
'onlysingle' => array(
|
| 63 |
+
'label' => __( 'Process only single posts and pages', 'wds' ),
|
| 64 |
+
'description' => __( 'Process only single posts and pages', 'wds' ),
|
| 65 |
+
),
|
| 66 |
+
'allowfeed' => array(
|
| 67 |
+
'label' => __( 'Process RSS feeds', 'wds' ),
|
| 68 |
+
'description' => __( 'Autolinking will also occur in RSS feeds.', 'wds' ),
|
| 69 |
+
),
|
| 70 |
+
'casesens' => array(
|
| 71 |
+
'label' => __( 'Case sensitive matching', 'wds' ),
|
| 72 |
+
'description' => __( 'Only autolink the exact string match.', 'wds' ),
|
| 73 |
+
),
|
| 74 |
+
'customkey_preventduplicatelink' => array(
|
| 75 |
+
'label' => __( 'Prevent duplicate links', 'wds' ),
|
| 76 |
+
'description' => __( 'Only link to a specific URL once per page/post.', 'wds' ),
|
| 77 |
+
),
|
| 78 |
+
'target_blank' => array(
|
| 79 |
+
'label' => __( 'Open links in new tab', 'wds' ),
|
| 80 |
+
'description' => __( 'Adds the target=“_blank” tag to links to open a new tab when clicked.', 'wds' ),
|
| 81 |
+
),
|
| 82 |
+
'rel_nofollow' => array(
|
| 83 |
+
'label' => __( 'Nofollow autolinks', 'wds' ),
|
| 84 |
+
'description' => __( 'Adds the nofollow meta tag to autolinks to prevent search engines following those URLs when crawling your website.', 'wds' ),
|
| 85 |
+
),
|
| 86 |
+
),
|
| 87 |
+
),
|
| 88 |
+
),
|
| 89 |
+
);
|
| 90 |
+
|
| 91 |
+
$autolinks_network_enabled = smartcrawl_is_allowed_tab( $_view['slug'] );
|
| 92 |
+
$autolinks_locally_enabled = 'settings' === $_view['name'] || Smartcrawl_Settings::get_setting( $_view['name'] );
|
| 93 |
+
$is_member = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member();
|
| 94 |
+
|
| 95 |
+
if ( $autolinks_network_enabled ) {
|
| 96 |
+
|
| 97 |
+
$autolinks_tab = array(
|
| 98 |
+
'tab_id' => 'tab_automatic_linking',
|
| 99 |
+
'tab_name' => __( 'Automatic Linking', 'wds' ),
|
| 100 |
+
'is_active' => 'tab_automatic_linking' === $active_tab,
|
| 101 |
+
'tab_sections' => $autolinks_locally_enabled && $is_member ? $autolinks_sections : $autolinks_disabled_section,
|
| 102 |
+
'before_output' => $this->_load( '_forms/autolinks', array(
|
| 103 |
+
'autolinks_network_enabled' => $autolinks_network_enabled,
|
| 104 |
+
'autolinks_locally_enabled' => $autolinks_locally_enabled,
|
| 105 |
+
) ),
|
| 106 |
+
'after_output' => '</form>',
|
| 107 |
+
);
|
| 108 |
+
|
| 109 |
+
if ( ! $autolinks_locally_enabled || ! $is_member ) {
|
| 110 |
+
$autolinks_tab['button_text'] = false;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
$this->_render( 'vertical-tab', $autolinks_tab );
|
| 114 |
+
}
|
| 115 |
+
?>
|
| 116 |
+
|
| 117 |
+
<?php
|
| 118 |
+
$this->_render( 'vertical-tab', array(
|
| 119 |
+
'tab_id' => 'tab_url_redirection',
|
| 120 |
+
'tab_name' => __( 'URL Redirection', 'wds' ),
|
| 121 |
+
'is_active' => 'tab_url_redirection' === $active_tab,
|
| 122 |
+
'tab_sections' => array(
|
| 123 |
+
array(
|
| 124 |
+
'section_description' => __( 'Automatically redirect traffic from one URL to another. Use this tool if you have changed a page’s URL and wish to keep traffic flowing to the new page.', 'wds' ),
|
| 125 |
+
'section_template' => 'advanced-tools/advanced-section-redirects',
|
| 126 |
+
'section_args' => array(
|
| 127 |
+
'redirections' => $redirections,
|
| 128 |
+
'types' => $redirection_types,
|
| 129 |
+
),
|
| 130 |
+
),
|
| 131 |
+
),
|
| 132 |
+
'before_output' => $this->_load( '_forms/redirections' ),
|
| 133 |
+
'after_output' => '</form>',
|
| 134 |
+
) );
|
| 135 |
+
?>
|
| 136 |
+
|
| 137 |
+
<?php
|
| 138 |
+
$this->_render( 'vertical-tab', array(
|
| 139 |
+
'tab_id' => 'tab_moz',
|
| 140 |
+
'tab_name' => __( 'Moz', 'wds' ),
|
| 141 |
+
'is_active' => 'tab_moz' === $active_tab,
|
| 142 |
+
'button_text' => false,
|
| 143 |
+
'tab_sections' => array(
|
| 144 |
+
array(
|
| 145 |
+
'section_template' => 'advanced-tools/advanced-section-moz',
|
| 146 |
+
'section_args' => array(),
|
| 147 |
+
),
|
| 148 |
+
),
|
| 149 |
+
'before_output' => '<form method="post" class="wds-form">',
|
| 150 |
+
'after_output' => '</form>',
|
| 151 |
+
) );
|
| 152 |
+
?>
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
<?php $this->_render( 'upsell-modal' ); ?>
|
| 156 |
+
|
| 157 |
+
</div><!-- end wds-page-autolinks -->
|
includes/admin/templates/{underscore-keywords-custom.php → advanced-tools/underscore-keywords-custom.php}
RENAMED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
<th
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile -- underscore template ?>
|
| 2 |
+
<div class="wds-keyword-pairs">
|
| 3 |
+
|
| 4 |
+
{{ if (pairs) { }}
|
| 5 |
+
<table class="wds-keyword-pairs-existing wds-list-table">
|
| 6 |
+
<tr>
|
| 7 |
+
<th>{{- Wds.l10n('keywords', 'Keyword') }}</th>
|
| 8 |
+
<th colspan="3">{{- Wds.l10n('keywords', 'Auto-Linked URL') }}</th>
|
| 9 |
+
</tr>
|
| 10 |
+
{{= pairs }}
|
| 11 |
+
</table>
|
| 12 |
+
{{ } }}
|
| 13 |
+
|
| 14 |
+
<div class="wds-keyword-pair-new">
|
| 15 |
+
<button type="button" class="button button-dark">{{- Wds.l10n('keywords', 'Add New') }}</button>
|
| 16 |
+
</div><!-- end wds-keyword-pair-new -->
|
| 17 |
+
|
| 18 |
+
</div>
|
includes/admin/templates/{underscore-keywords-form.php → advanced-tools/underscore-keywords-form.php}
RENAMED
|
@@ -1,31 +1,32 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
<
|
| 5 |
-
<
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
<
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
<button type="button" class="wds-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
</
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile -- underscore template ?>
|
| 2 |
+
<dialog class="dev-overlay wds-modal wds-custom-keywords-modal" id="wds-custom-keywords" title="{{- idx == 0 ? Wds.l10n('keywords', 'Add Custom Keywords') : Wds.l10n('keywords', 'Update Custom Keywords') }}">
|
| 3 |
+
<form class="wds-form">
|
| 4 |
+
<input type="hidden" class="wds-custom-idx" value="{{- idx }}"/>
|
| 5 |
+
<label class="wds-label">{{- Wds.l10n('keywords', 'Keyword group') }}</label>
|
| 6 |
+
<p class="wds-label-description">{{- Wds.l10n('keywords', 'choose-your-keywords-and-url') }}</p>
|
| 7 |
+
|
| 8 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 9 |
+
<div class="label">
|
| 10 |
+
<label class="wds-label">{{- Wds.l10n('keywords', 'Keyword group') }} <span>{{- Wds.l10n('keywords', '- Usually related terms') }}</span></label>
|
| 11 |
+
</div>
|
| 12 |
+
<div class="fields">
|
| 13 |
+
<input type="text" class="wds-field wds-custom-keywords" value="{{- keywords }}" placeholder="{{- Wds.l10n('keywords', 'E.g. Cats, Kittens, Felines') }}"/>
|
| 14 |
+
</div>
|
| 15 |
+
</div>
|
| 16 |
+
|
| 17 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 18 |
+
<div class="label">
|
| 19 |
+
<label class="wds-label">{{- Wds.l10n('keywords', 'Link URL') }} <span>{{- Wds.l10n('keywords', 'internal-external-links-supported') }}</span></label>
|
| 20 |
+
</div>
|
| 21 |
+
<div class="fields">
|
| 22 |
+
<input type="text" class="wds-custom-url" value="{{- url }}" placeholder="{{- Wds.l10n('keywords', 'E.g. /cats') }}"/>
|
| 23 |
+
<p class="wds-field-legend">{{= Wds.l10n('keywords', 'url-formats-explanation') }}</p>
|
| 24 |
+
</div>
|
| 25 |
+
</div>
|
| 26 |
+
|
| 27 |
+
<div class="wds-box-footer">
|
| 28 |
+
<button type="button" class="wds-cancel-button button button-dark-o">{{- Wds.l10n('keywords', 'Cancel') }}</button>
|
| 29 |
+
<button type="button" class="wds-action-button button">{{- idx == 0 ? Wds.l10n('keywords', 'Add') : Wds.l10n('keywords', 'Update') }}</button>
|
| 30 |
+
</div>
|
| 31 |
+
</form>
|
| 32 |
+
</dialog>
|
includes/admin/templates/{underscore-keywords-pairs.php → advanced-tools/underscore-keywords-pairs.php}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
-
<tr class="wds-keyword-pair" data-idx="{{- idx }}">
|
| 2 |
-
<td class="wds-pair-keyword">{{- keywords }}</td>
|
| 3 |
-
<td class="wds-pair-url">{{- url }}</td>
|
| 4 |
-
<td class="wds-pair-actions">
|
| 5 |
-
{{ if (idx) { }}
|
| 6 |
-
<?php
|
| 7 |
-
$this->_render('links-dropdown', array(
|
| 8 |
-
'label' => "{{- Wds.l10n('keywords', 'Options') }}",
|
| 9 |
-
'links' => array(
|
| 10 |
-
'#edit' => "{{- Wds.l10n('keywords', 'Edit') }}",
|
| 11 |
-
'#remove' => "{{- Wds.l10n('keywords', 'Remove') }}",
|
| 12 |
-
),
|
| 13 |
-
));
|
| 14 |
-
?>
|
| 15 |
-
{{ } }}
|
| 16 |
-
</td>
|
| 17 |
-
<td class="wds-pair-hidden-fields">
|
| 18 |
-
<input type="hidden" class="wds-pair-keyword-field" value="{{- keywords }}" />
|
| 19 |
-
<input type="hidden" class="wds-pair-url-field" value="{{- url }}" />
|
| 20 |
-
</td>
|
| 21 |
-
</tr>
|
| 1 |
+
<tr class="wds-keyword-pair" data-idx="{{- idx }}">
|
| 2 |
+
<td class="wds-pair-keyword">{{- keywords }}</td>
|
| 3 |
+
<td class="wds-pair-url">{{- url }}</td>
|
| 4 |
+
<td class="wds-pair-actions">
|
| 5 |
+
{{ if (idx) { }}
|
| 6 |
+
<?php
|
| 7 |
+
$this->_render('links-dropdown', array(
|
| 8 |
+
'label' => "{{- Wds.l10n('keywords', 'Options') }}",
|
| 9 |
+
'links' => array(
|
| 10 |
+
'#edit' => "{{- Wds.l10n('keywords', 'Edit') }}",
|
| 11 |
+
'#remove' => "{{- Wds.l10n('keywords', 'Remove') }}",
|
| 12 |
+
),
|
| 13 |
+
));
|
| 14 |
+
?>
|
| 15 |
+
{{ } }}
|
| 16 |
+
</td>
|
| 17 |
+
<td class="wds-pair-hidden-fields">
|
| 18 |
+
<input type="hidden" class="wds-pair-keyword-field" value="{{- keywords }}" />
|
| 19 |
+
<input type="hidden" class="wds-pair-url-field" value="{{- url }}" />
|
| 20 |
+
</td>
|
| 21 |
+
</tr>
|
includes/admin/templates/{underscore-postlist-exclusion-item.php → advanced-tools/underscore-postlist-exclusion-item.php}
RENAMED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
<td class="wds-postlist-item-
|
| 5 |
-
<td class="wds-postlist-item-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile -- underscore template ?>
|
| 2 |
+
<tr data-id="{{- id }}">
|
| 3 |
+
{{ if (is_loaded) { }}
|
| 4 |
+
<td class="wds-postlist-item-title">{{= title }}</td>
|
| 5 |
+
<td class="wds-postlist-item-type">{{= type }}</td>
|
| 6 |
+
<td class="wds-postlist-item-remove"><a href="#remove" class="wds-postlist-list-item-remove button button-dark-o button-small">{{= Wds.l10n('postlist', 'Remove') }}</a></td>
|
| 7 |
+
{{ } else { }}
|
| 8 |
+
<td colspan="3">Loading post {{= id }}...</td>
|
| 9 |
+
{{ } }}
|
| 10 |
+
</tr>
|
includes/admin/templates/{underscore-postlist-exclusion.php → advanced-tools/underscore-postlist-exclusion.php}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
<th
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
</div>
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile -- underscore template ?>
|
| 2 |
+
<div class="wds-postlist-list wds-postlist-list-exclude">
|
| 3 |
+
{{ if (loaded) { }}
|
| 4 |
+
<table class="wds-postlist wds-list-table {{= (!!posts ? '' : 'wds-postlist-empty_list') }}">
|
| 5 |
+
<tr>
|
| 6 |
+
<th>{{= Wds.l10n('postlist', 'Post') }}</th>
|
| 7 |
+
<th colspan="2">{{= Wds.l10n('postlist', 'Post Type') }}</th>
|
| 8 |
+
</tr>
|
| 9 |
+
{{= posts }}
|
| 10 |
+
</table>
|
| 11 |
+
{{ } else { }}
|
| 12 |
+
<p><i>Loading posts, please hold on</i></p>
|
| 13 |
+
{{ } }}
|
| 14 |
+
<div class="wds-postlist-add-post">
|
| 15 |
+
<a href="#wds-postlist-selector" rel="dialog" class="button button-dark">{{= Wds.l10n('postlist', 'Add Posts') }}</a>
|
| 16 |
+
</div>
|
| 17 |
+
</div>
|
includes/admin/templates/{underscore-postlist-selector-list-item.php → advanced-tools/underscore-postlist-selector-list-item.php}
RENAMED
|
@@ -1,20 +1,21 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
data-
|
| 9 |
-
data-
|
| 10 |
-
data-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
</
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile -- underscore template ?>
|
| 2 |
+
<li class="wds-postlist-list-item">
|
| 3 |
+
<p class="group">
|
| 4 |
+
<input
|
| 5 |
+
id="{{- type }}-{{- id }}"
|
| 6 |
+
class="wds-checkbox wds-checkbox-with-label wds-postlist-selector-list-item"
|
| 7 |
+
value='{{- id }}'
|
| 8 |
+
data-id="{{- id }}"
|
| 9 |
+
data-title="{{- title }}"
|
| 10 |
+
data-type="{{- type }}"
|
| 11 |
+
data-date="{{- date }}"
|
| 12 |
+
type='checkbox'
|
| 13 |
+
{{ if (existing) { }}
|
| 14 |
+
checked
|
| 15 |
+
readonly
|
| 16 |
+
disabled
|
| 17 |
+
{{ } }}
|
| 18 |
+
/>
|
| 19 |
+
<label for="{{- type }}-{{- id }}" class="wds-label wds-label-radio wds-label-inline wds-label-inline-right">{{= title }} ({{= date }})</label>
|
| 20 |
+
</p>
|
| 21 |
+
</li>
|
includes/admin/templates/{underscore-postlist-selector-list.php → advanced-tools/underscore-postlist-selector-list.php}
RENAMED
|
@@ -1,44 +1,45 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
<
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
<
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile -- underscore template ?>
|
| 2 |
+
<section class="tab wds-postlist-list">
|
| 3 |
+
|
| 4 |
+
<input type="radio" name="tab_postlist_group" id="tab_{{- tab }}" {{= checked }} value="{{-tab }}">
|
| 5 |
+
<label for="tab_{{- tab }}">{{- tab_label }}</label>
|
| 6 |
+
|
| 7 |
+
<div class="content wds-content-tabs">
|
| 8 |
+
|
| 9 |
+
<h2 class="tab-title">{{= tab }}</h2>
|
| 10 |
+
|
| 11 |
+
<div class="wds-content-tabs-inner">
|
| 12 |
+
{{ if (is_loading) { }}
|
| 13 |
+
<p>{{= Wds.l10n('postlist', 'Loading post items, please hold on') }}</p>
|
| 14 |
+
{{ } else { }}
|
| 15 |
+
<ul class="wds-postlist-list-items">
|
| 16 |
+
{{= posts }}
|
| 17 |
+
</ul>
|
| 18 |
+
{{ } }}
|
| 19 |
+
|
| 20 |
+
{{ if (meta.total > 1) { }}
|
| 21 |
+
<div class="wds-postslist-list-pagination">
|
| 22 |
+
<p class="group wds-group wds-group-field">
|
| 23 |
+
<label for="wds-postslist-list-pagination-select" class="wds-label">{{= Wds.l10n('postlist', 'Jump to page') }}</label>
|
| 24 |
+
<select id='wds-postslist-list-pagination-select' class="wds-select">
|
| 25 |
+
{{ _.each(_.range(1, meta.total+1), function (idx) { }}
|
| 26 |
+
<option
|
| 27 |
+
value="{{- idx }}"
|
| 28 |
+
{{ if (meta.page === idx) { }}
|
| 29 |
+
selected="selected"
|
| 30 |
+
{{ } }}
|
| 31 |
+
>
|
| 32 |
+
{{= idx }}
|
| 33 |
+
</option>
|
| 34 |
+
{{ }) }}
|
| 35 |
+
</select>
|
| 36 |
+
<span class="wds-field-legend">{{= Wds.l10n('postlist', 'Total Pages') }} {{= meta.total }}</span>
|
| 37 |
+
</p>
|
| 38 |
+
</div>
|
| 39 |
+
{{ } }}
|
| 40 |
+
|
| 41 |
+
</div><!-- end wds-content-tabs-inner -->
|
| 42 |
+
|
| 43 |
+
</div><!-- end wds-content-tabs -->
|
| 44 |
+
|
| 45 |
+
</section><!-- end wds-postlist-list -->
|
includes/admin/templates/{underscore-postlist-selector.php → advanced-tools/underscore-postlist-selector.php}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<dialog class="dev-overlay wds-modal wds-postlist-selector-modal" id="wds-postlist-selector" title="<?php esc_html_e( 'Choose Posts, Pages & Custom Post Types to exclude', 'wds' ); ?>">
|
| 2 |
-
<div class="box-content wds-postlist-selector">
|
| 3 |
-
|
| 4 |
-
<div class="vertical-tabs" id="content-type-excludes">
|
| 5 |
-
{{= lists }}
|
| 6 |
-
</div>
|
| 7 |
-
|
| 8 |
-
</div>
|
| 9 |
-
|
| 10 |
-
<div class="box-footer buttons">
|
| 11 |
-
<button type="button" class="button button-cta-dark">Add to Excludes</button>
|
| 12 |
-
</div>
|
| 13 |
-
|
| 14 |
-
</dialog>
|
| 1 |
+
<dialog class="dev-overlay wds-modal wds-postlist-selector-modal" id="wds-postlist-selector" title="<?php esc_html_e( 'Choose Posts, Pages & Custom Post Types to exclude', 'wds' ); ?>">
|
| 2 |
+
<div class="box-content wds-postlist-selector">
|
| 3 |
+
|
| 4 |
+
<div class="vertical-tabs" id="content-type-excludes">
|
| 5 |
+
{{= lists }}
|
| 6 |
+
</div>
|
| 7 |
+
|
| 8 |
+
</div>
|
| 9 |
+
|
| 10 |
+
<div class="box-footer buttons">
|
| 11 |
+
<button type="button" class="button button-cta-dark">Add to Excludes</button>
|
| 12 |
+
</div>
|
| 13 |
+
|
| 14 |
+
</dialog>
|
includes/admin/templates/checkup/checkup-checkup-results.php
CHANGED
|
@@ -1,82 +1,83 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
?>
|
| 6 |
-
|
| 7 |
-
<?php if ( ! empty( $results['error'] ) ) :
|
| 8 |
-
<!--
|
| 9 |
-
We have encountered an error. So let's show that.
|
| 10 |
-
-->
|
| 11 |
-
<div class="wds-notice wds-notice-error">
|
| 12 |
-
<p><?php echo esc_html( $results['error'] ); ?></p>
|
| 13 |
-
</div>
|
| 14 |
-
<?php endif; ?>
|
| 15 |
-
|
| 16 |
-
<?php if ( ! empty( $results['items'] ) ) { ?>
|
| 17 |
-
<p><?php esc_html_e( 'Here are your outstanding SEO issues. We recommend actioning as many as possible to ensure your site is as search engine and social media friendly as possible.', 'wds' ); ?></p>
|
| 18 |
-
<!--
|
| 19 |
-
This is where we store the actual result items.
|
| 20 |
-
Let's iterate through them.
|
| 21 |
-
-->
|
| 22 |
-
<div class="wds-accordion">
|
| 23 |
-
<?php foreach ( $results['items'] as $idx => $item ) :
|
| 24 |
-
<?php
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
?>
|
| 44 |
-
<div
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
<?php echo
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
<
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
'
|
| 74 |
-
'
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
esc_html__( '
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
<?php } ?>
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 3 |
+
$results = $service->result();
|
| 4 |
+
$show_upsell_message = isset( $show_upsell_message ) ? $show_upsell_message : true;
|
| 5 |
+
?>
|
| 6 |
+
|
| 7 |
+
<?php if ( ! empty( $results['error'] ) ) : ?>
|
| 8 |
+
<!--
|
| 9 |
+
We have encountered an error. So let's show that.
|
| 10 |
+
-->
|
| 11 |
+
<div class="wds-notice wds-notice-error">
|
| 12 |
+
<p><?php echo esc_html( $results['error'] ); ?></p>
|
| 13 |
+
</div>
|
| 14 |
+
<?php endif; ?>
|
| 15 |
+
|
| 16 |
+
<?php if ( ! empty( $results['items'] ) ) { ?>
|
| 17 |
+
<p><?php esc_html_e( 'Here are your outstanding SEO issues. We recommend actioning as many as possible to ensure your site is as search engine and social media friendly as possible.', 'wds' ); ?></p>
|
| 18 |
+
<!--
|
| 19 |
+
This is where we store the actual result items.
|
| 20 |
+
Let's iterate through them.
|
| 21 |
+
-->
|
| 22 |
+
<div class="wds-accordion">
|
| 23 |
+
<?php foreach ( $results['items'] as $idx => $item ) : ?>
|
| 24 |
+
<?php
|
| 25 |
+
$item_id = "wds-checkup-item-{$idx}";
|
| 26 |
+
$type_class = ! empty( $item['type'] )
|
| 27 |
+
? sanitize_html_class( $item['type'] )
|
| 28 |
+
: '';
|
| 29 |
+
$custom_class = ! empty( $item['class'] )
|
| 30 |
+
? sanitize_html_class( $item['class'] )
|
| 31 |
+
: '';
|
| 32 |
+
$style_class_map = array(
|
| 33 |
+
'ok' => 'wds-check-success',
|
| 34 |
+
'info' => 'wds-check-invalid',
|
| 35 |
+
'warning' => 'wds-check-warning',
|
| 36 |
+
'critical' => 'wds-check-error',
|
| 37 |
+
);
|
| 38 |
+
$style_class = isset( $style_class_map[ $item['type'] ] ) ? $style_class_map[ $item['type'] ] : '';
|
| 39 |
+
$details = ! empty( $item['tooltip'] ) ? $item['tooltip'] : '';
|
| 40 |
+
$title = ! empty( $item['title'] ) ? $item['title'] : '';
|
| 41 |
+
$body = ! empty( $item['body'] ) ? $item['body'] : '';
|
| 42 |
+
$fix = ! empty( $item['fix'] ) ? $item['fix'] : '';
|
| 43 |
+
?>
|
| 44 |
+
<div
|
| 45 |
+
class="wds-accordion-section wds-check-item <?php echo esc_attr( $type_class ); ?> <?php echo esc_attr( $custom_class ); ?> <?php echo esc_attr( $style_class ); ?>"
|
| 46 |
+
id="<?php echo esc_attr( $item_id ); ?>">
|
| 47 |
+
<div class="wds-accordion-handle">
|
| 48 |
+
<?php echo esc_html( $title ); ?>
|
| 49 |
+
</div>
|
| 50 |
+
<div class="wds-accordion-content">
|
| 51 |
+
<?php if ( $body || $fix ) : ?>
|
| 52 |
+
<div class="wds-recommendation">
|
| 53 |
+
<strong><?php esc_html_e( 'Recommendation', 'wds' ); ?></strong>
|
| 54 |
+
|
| 55 |
+
<?php echo wp_kses_post( $body ); ?>
|
| 56 |
+
<?php echo wp_kses_post( $fix ); ?>
|
| 57 |
+
</div>
|
| 58 |
+
<?php endif; ?>
|
| 59 |
+
|
| 60 |
+
<?php if ( $details ) : ?>
|
| 61 |
+
<div class="wds-more-info">
|
| 62 |
+
<strong><?php esc_html_e( 'More Info', 'wds' ); ?></strong>
|
| 63 |
+
<p><?php echo esc_html( $details ); ?></p>
|
| 64 |
+
</div>
|
| 65 |
+
<?php endif; ?>
|
| 66 |
+
</div>
|
| 67 |
+
</div>
|
| 68 |
+
<?php endforeach; ?>
|
| 69 |
+
</div>
|
| 70 |
+
<?php if ( ! $service->is_member() && $show_upsell_message ) { ?>
|
| 71 |
+
<?php
|
| 72 |
+
$this->_render( 'mascot-message', array(
|
| 73 |
+
'key' => 'seo-checkup-upsell',
|
| 74 |
+
'dismissible' => false,
|
| 75 |
+
'message' => sprintf(
|
| 76 |
+
'%s <a href="#upgrade-to-pro">%s</a>',
|
| 77 |
+
esc_html__( 'Grab the Pro version of SmartCrawl to unlock unlimited SEO Checkups plus automated scheduled reports to always stay on top of any issues.. These features are included in a WPMU DEV membership along with 100+ plugins & themes, 24/7 support and lots of handy site management tools.', 'wds' ),
|
| 78 |
+
esc_html__( '- Try it all FREE today', 'wds' )
|
| 79 |
+
),
|
| 80 |
+
) );
|
| 81 |
+
?>
|
| 82 |
+
<?php } ?>
|
| 83 |
+
<?php } ?>
|
includes/admin/templates/checkup/checkup-checkup-running.php
CHANGED
|
@@ -1,16 +1,18 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
if ( $progress > 100 ) {
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 4 |
+
$percentage = $service->status();
|
| 5 |
+
$progress = (int) $percentage;
|
| 6 |
+
|
| 7 |
+
if ( $progress > 100 ) {
|
| 8 |
+
$progress = 100;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
$this->_render( 'progress-bar', array(
|
| 12 |
+
'progress' => $progress,
|
| 13 |
+
) );
|
| 14 |
+
?>
|
| 15 |
+
|
| 16 |
+
<div class="wds-checkup-progress-notice">
|
| 17 |
+
<?php $this->_render( 'progress-notice' ); ?>
|
| 18 |
+
</div>
|
includes/admin/templates/checkup/checkup-checkup.php
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-report">
|
| 6 |
-
<?php
|
| 7 |
-
if ( $service->in_progress() ) {
|
| 8 |
-
$this->_render( 'checkup/checkup-checkup-running' );
|
| 9 |
-
} else {
|
| 10 |
-
$this->_render( 'checkup/checkup-checkup-results' );
|
| 11 |
-
}
|
| 12 |
-
?>
|
| 13 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 3 |
+
?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-report">
|
| 6 |
+
<?php
|
| 7 |
+
if ( $service->in_progress() ) {
|
| 8 |
+
$this->_render( 'checkup/checkup-checkup-running' );
|
| 9 |
+
} else {
|
| 10 |
+
$this->_render( 'checkup/checkup-checkup-results' );
|
| 11 |
+
}
|
| 12 |
+
?>
|
| 13 |
+
</div>
|
includes/admin/templates/checkup/checkup-reporting.php
CHANGED
|
@@ -1,129 +1,131 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
?>
|
| 13 |
-
|
| 14 |
-
<?php if ( ! $service->is_member() ) :
|
| 15 |
-
<div class="wds-obfuscate-section"></div>
|
| 16 |
-
<?php endif; ?>
|
| 17 |
-
|
| 18 |
-
<div class="wds-table-fields wds-toggleable">
|
| 19 |
-
<div class="label">
|
| 20 |
-
<label class="wds-label"
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
<?php esc_html_e( 'Schedule automatic checkups', 'wds' ); ?>
|
| 24 |
-
</label>
|
| 25 |
-
<p class="wds-label-description">
|
| 26 |
-
<?php esc_html_e( 'Configure SmartCrawl to automatically email you a comprehensive SEO report for this website.', 'wds' ); ?>
|
| 27 |
-
</p>
|
| 28 |
-
</div>
|
| 29 |
-
<div class="fields wds-toggleable <?php echo $checkup_cron_enabled ? '' : 'inactive'; ?>">
|
| 30 |
-
<?php
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
?>
|
| 38 |
-
<div class="wds-toggleable-inside wds-toggleable-inside-box">
|
| 39 |
-
<div class="wds-table-fields wds-table-fields-stacked">
|
| 40 |
-
<div class="label">
|
| 41 |
-
<label for="wds-checkup-frequency"
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
<?php
|
| 76 |
-
|
| 77 |
-
<?php
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
<?php
|
| 99 |
-
|
| 100 |
-
<?php
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
</div>
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$cron = Smartcrawl_Controller_Cron::get();
|
| 3 |
+
|
| 4 |
+
// This does the actual rescheduling
|
| 5 |
+
$cron->set_up_schedule();
|
| 6 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 7 |
+
|
| 8 |
+
$disabled = ! $service->is_member() ? 'disabled' : '';
|
| 9 |
+
$option_name = $_view['option_name'];
|
| 10 |
+
$toggle_field_name = $option_name . '[checkup-cron-enable]';
|
| 11 |
+
$checkup_cron_enabled = $_view['options']['checkup-cron-enable'];
|
| 12 |
+
?>
|
| 13 |
+
|
| 14 |
+
<?php if ( ! $service->is_member() ) : ?>
|
| 15 |
+
<div class="wds-obfuscate-section"></div>
|
| 16 |
+
<?php endif; ?>
|
| 17 |
+
|
| 18 |
+
<div class="wds-table-fields wds-toggleable">
|
| 19 |
+
<div class="label">
|
| 20 |
+
<label class="wds-label"
|
| 21 |
+
for="<?php echo esc_attr( $toggle_field_name ); ?>">
|
| 22 |
+
|
| 23 |
+
<?php esc_html_e( 'Schedule automatic checkups', 'wds' ); ?>
|
| 24 |
+
</label>
|
| 25 |
+
<p class="wds-label-description">
|
| 26 |
+
<?php esc_html_e( 'Configure SmartCrawl to automatically email you a comprehensive SEO report for this website.', 'wds' ); ?>
|
| 27 |
+
</p>
|
| 28 |
+
</div>
|
| 29 |
+
<div class="fields wds-toggleable <?php echo $checkup_cron_enabled ? '' : 'inactive'; ?>">
|
| 30 |
+
<?php
|
| 31 |
+
$this->_render( 'toggle-item', array(
|
| 32 |
+
'field_name' => $toggle_field_name,
|
| 33 |
+
'field_id' => $toggle_field_name,
|
| 34 |
+
'checked' => checked( $checkup_cron_enabled, true, false ),
|
| 35 |
+
'item_label' => esc_html__( 'Enable regular checkups', 'wds' ),
|
| 36 |
+
) );
|
| 37 |
+
?>
|
| 38 |
+
<div class="wds-toggleable-inside wds-toggleable-inside-box">
|
| 39 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 40 |
+
<div class="label">
|
| 41 |
+
<label for="wds-checkup-frequency"
|
| 42 |
+
class="wds-label"><?php esc_html_e( 'Frequency', 'wds' ); ?></label>
|
| 43 |
+
</div>
|
| 44 |
+
<div class="fields">
|
| 45 |
+
<select <?php echo esc_attr($disabled); ?>
|
| 46 |
+
style="width: 100%"
|
| 47 |
+
class="select-container wds-conditional-parent"
|
| 48 |
+
id="wds-checkup-frequency"
|
| 49 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[checkup-frequency]">
|
| 50 |
+
|
| 51 |
+
<?php $checkup_freq = isset( $_view['options']['checkup-frequency'] ) ? $_view['options']['checkup-frequency'] : false; ?>
|
| 52 |
+
|
| 53 |
+
<?php foreach ( $cron->get_frequencies() as $key => $label ) : ?>
|
| 54 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $checkup_freq ); ?>>
|
| 55 |
+
<?php echo esc_html( $label ); ?>
|
| 56 |
+
</option>
|
| 57 |
+
<?php endforeach; ?>
|
| 58 |
+
</select>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
<div class="wds-table-fields wds-table-fields-stacked wds-conditional-child"
|
| 63 |
+
data-parent="wds-checkup-frequency"
|
| 64 |
+
data-parent-val="weekly,monthly">
|
| 65 |
+
|
| 66 |
+
<div class="label">
|
| 67 |
+
<label for="wds-checkup-dow"
|
| 68 |
+
class="wds-label"><?php esc_html_e( 'Day of the week', 'wds' ); ?></label>
|
| 69 |
+
</div>
|
| 70 |
+
<div class="fields">
|
| 71 |
+
<select <?php echo esc_attr($disabled); ?>
|
| 72 |
+
style="width: 100%"
|
| 73 |
+
class="select-container"
|
| 74 |
+
id="wds-checkup-dow"
|
| 75 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[checkup-dow]">
|
| 76 |
+
|
| 77 |
+
<?php $monday = strtotime( 'this Monday' ); ?>
|
| 78 |
+
<?php $checkup_dow = isset( $_view['options']['checkup-dow'] ) ? $_view['options']['checkup-dow'] : false; ?>
|
| 79 |
+
<?php foreach ( range( 0, 6 ) as $dow ) : ?>
|
| 80 |
+
<option value="<?php echo esc_attr( $dow ); ?>" <?php selected( $dow, $checkup_dow ); ?>>
|
| 81 |
+
<?php echo esc_html( date_i18n( 'l', $monday + ( $dow * DAY_IN_SECONDS ) ) ); ?>
|
| 82 |
+
</option>
|
| 83 |
+
<?php endforeach; ?>
|
| 84 |
+
</select>
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 89 |
+
<div class="label">
|
| 90 |
+
<label for="wds-checkup-tod" class="wds-label"><?php esc_html_e( 'Time of day', 'wds' ); ?></label>
|
| 91 |
+
</div>
|
| 92 |
+
<div class="fields">
|
| 93 |
+
|
| 94 |
+
<select <?php echo esc_attr($disabled); ?>
|
| 95 |
+
style="width: 100%"
|
| 96 |
+
class="select-container"
|
| 97 |
+
id="wds-checkup-tod"
|
| 98 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[checkup-tod]">
|
| 99 |
+
|
| 100 |
+
<?php $midnight = strtotime( 'today' ); ?>
|
| 101 |
+
<?php $checkup_tod = isset( $_view['options']['checkup-tod'] ) ? $_view['options']['checkup-tod'] : false; ?>
|
| 102 |
+
<?php foreach ( range( 0, 23 ) as $tod ) : ?>
|
| 103 |
+
<option value="<?php echo esc_attr( $tod ); ?>" <?php selected( $tod, $checkup_tod ); ?>>
|
| 104 |
+
<?php echo esc_html( date_i18n( get_option( 'time_format' ), $midnight + ( $tod * HOUR_IN_SECONDS ) ) ); ?>
|
| 105 |
+
</option>
|
| 106 |
+
<?php endforeach; ?>
|
| 107 |
+
</select>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
|
| 114 |
+
<div class="wds-table-fields wds-separator-top">
|
| 115 |
+
<div class="label">
|
| 116 |
+
<label class="wds-label"><?php esc_html_e( 'Email recipients', 'wds' ); ?></label>
|
| 117 |
+
<p class="wds-label-description">
|
| 118 |
+
<?php esc_html_e( 'Choose which of your website’s users will receive the SEO report.', 'wds' ); ?>
|
| 119 |
+
</p>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="fields">
|
| 122 |
+
<?php
|
| 123 |
+
$this->_render( 'user-search', array(
|
| 124 |
+
'users' => ( isset( $_view['options']['email-recipients'] ) ? $_view['options']['email-recipients'] : array() ),
|
| 125 |
+
'option_name' => $option_name,
|
| 126 |
+
'users_key' => 'email-recipients',
|
| 127 |
+
'new_user_key' => 'new-user',
|
| 128 |
+
) );
|
| 129 |
+
?>
|
| 130 |
+
</div>
|
| 131 |
+
</div>
|
includes/admin/templates/checkup/checkup-settings.php
CHANGED
|
@@ -1,89 +1,78 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
<?php
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
__( 'SmartCrawl to automatically check URLs are discoverable by search engines.', 'wds' )
|
| 80 |
-
),
|
| 81 |
-
'image' => 'sitemap-disabled.png',
|
| 82 |
-
'component' => 'sitemap',
|
| 83 |
-
'button_text' => __( 'Activate Sitemap', 'wds' ),
|
| 84 |
-
));
|
| 85 |
-
}
|
| 86 |
-
?>
|
| 87 |
-
<?php $this->_render( 'upsell-modal' ); ?>
|
| 88 |
-
</div>
|
| 89 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 3 |
+
$checkup_url = Smartcrawl_Checkup_Settings::checkup_url();
|
| 4 |
+
$last_checked = $service->get_last_checked( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) );
|
| 5 |
+
?>
|
| 6 |
+
<div id="container"
|
| 7 |
+
class="wrap wrap-wds wds-page wds-checkup-settings <?php echo $service->is_member() ? 'wds-is-member' : 'wds-is-not-member'; ?>">
|
| 8 |
+
|
| 9 |
+
<section id="header">
|
| 10 |
+
<?php $this->_render( 'settings-message-top' ); ?>
|
| 11 |
+
<div class="actions">
|
| 12 |
+
<?php
|
| 13 |
+
printf(
|
| 14 |
+
esc_html__( 'Last checked: %s', 'wds' ),
|
| 15 |
+
esc_html( $last_checked )
|
| 16 |
+
);
|
| 17 |
+
?>
|
| 18 |
+
<a href="<?php echo esc_attr( $checkup_url ); ?>" class="button button-small">
|
| 19 |
+
<?php esc_html_e( 'Run checkup', 'wds' ); ?>
|
| 20 |
+
</a>
|
| 21 |
+
<a target="_blank" class="button button-small button-light actions-button"
|
| 22 |
+
href="https://premium.wpmudev.org/docs/wpmu-dev-plugins/smartcrawl/#chapter-1">
|
| 23 |
+
<i class="wds-icon-academy"></i>
|
| 24 |
+
<?php esc_html_e( 'View Documentation', 'wds' ); ?>
|
| 25 |
+
</a>
|
| 26 |
+
</div>
|
| 27 |
+
<h1><?php esc_html_e( 'SEO Checkup', 'wds' ); ?></h1>
|
| 28 |
+
</section><!-- end header -->
|
| 29 |
+
|
| 30 |
+
<div class="wds-seo-checkup-stats-container">
|
| 31 |
+
<?php $this->_render( 'checkup/checkup-top' ); ?>
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
<form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
|
| 35 |
+
<?php settings_fields( $_view['option_name'] ); ?>
|
| 36 |
+
|
| 37 |
+
<input type="hidden"
|
| 38 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
|
| 39 |
+
value="1">
|
| 40 |
+
|
| 41 |
+
<div class="vertical-tabs" id="checkup-settings-tabs">
|
| 42 |
+
<?php
|
| 43 |
+
$this->_render( 'report-vertical-tab', array(
|
| 44 |
+
'tab_id' => 'tab_checkup',
|
| 45 |
+
'tab_name' => __( 'Checkup', 'wds' ),
|
| 46 |
+
'is_active' => 'tab_checkup' === $active_tab,
|
| 47 |
+
'tab_sections' => array(
|
| 48 |
+
array(
|
| 49 |
+
'section_template' => 'checkup/checkup-checkup',
|
| 50 |
+
),
|
| 51 |
+
),
|
| 52 |
+
) );
|
| 53 |
+
?>
|
| 54 |
+
<?php
|
| 55 |
+
$is_member = $service->is_member();
|
| 56 |
+
$this->_render(
|
| 57 |
+
$is_member ? 'vertical-tab' : 'report-vertical-tab',
|
| 58 |
+
array(
|
| 59 |
+
'tab_id' => 'tab_settings',
|
| 60 |
+
'tab_name' => __( 'Reporting', 'wds' ),
|
| 61 |
+
'is_active' => 'tab_settings' === $active_tab,
|
| 62 |
+
'title_button' => 'upgrade',
|
| 63 |
+
'tab_sections' => array(
|
| 64 |
+
array(
|
| 65 |
+
'section_description' => esc_html__( 'Set up SmartCrawl to automatically run a comprehensive checkup daily, weekly or monthly and receive an email report.', 'wds' ),
|
| 66 |
+
'section_template' => 'checkup/checkup-reporting',
|
| 67 |
+
),
|
| 68 |
+
),
|
| 69 |
+
)
|
| 70 |
+
);
|
| 71 |
+
?>
|
| 72 |
+
|
| 73 |
+
</div>
|
| 74 |
+
</form>
|
| 75 |
+
|
| 76 |
+
<?php $this->_render( 'upsell-modal' ); ?>
|
| 77 |
+
</div>
|
| 78 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/checkup/checkup-top.php
CHANGED
|
@@ -1,96 +1,98 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
if ( $service->in_progress() ) {
|
| 4 |
-
return;
|
| 5 |
-
}
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
if ( $counts
|
| 12 |
-
return;
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
?>
|
| 20 |
-
<div class="wds-seo-checkup-stats wds-report-stats" data-issue-count="<?php echo esc_attr( $issue_count ); ?>">
|
| 21 |
-
<div class="wds-report-score">
|
| 22 |
-
<div class="wds-score <?php echo esc_attr( $score_class ); ?>">
|
| 23 |
-
<?php echo esc_html( $score ); ?><span class="wds-total"><?php esc_html_e( '/100', 'wds' ); ?></span>
|
| 24 |
-
</div>
|
| 25 |
-
<div class="wds-small-text"><?php esc_html_e( 'Current SEO Score', 'wds' ); ?></div>
|
| 26 |
-
</div>
|
| 27 |
-
|
| 28 |
-
<div>
|
| 29 |
-
<div class="wds-stacked-stats">
|
| 30 |
-
<div>
|
| 31 |
-
<div class="wds-stat-name"><?php esc_html_e( 'Last checked:', 'wds' ); ?></div>
|
| 32 |
-
<div
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
<div class="wds-stat-
|
| 38 |
-
<
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
</
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
<div class="wds-stat-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
<span class="wds-checkup-frequency
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
</div>
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 3 |
+
if ( $service->in_progress() ) {
|
| 4 |
+
return;
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
$results = $service->result();
|
| 8 |
+
$counts = smartcrawl_get_array_value( $results, 'counts' );
|
| 9 |
+
$score = smartcrawl_get_array_value( $results, 'score' );
|
| 10 |
+
|
| 11 |
+
if ( null === $counts || null === $score || false === $score ) {
|
| 12 |
+
return;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
$issue_count = intval( smartcrawl_get_array_value( $counts, 'warning' ) ) + intval( smartcrawl_get_array_value( $counts, 'critical' ) );
|
| 16 |
+
$score_class = $issue_count > 0 ? 'wds-score-warning' : 'wds-score-success';
|
| 17 |
+
$opts = Smartcrawl_Settings::get_component_options( Smartcrawl_Settings::COMP_CHECKUP );
|
| 18 |
+
$reporting_enabled = ! empty( $opts['checkup-cron-enable'] );
|
| 19 |
+
?>
|
| 20 |
+
<div class="wds-seo-checkup-stats wds-report-stats" data-issue-count="<?php echo esc_attr( $issue_count ); ?>">
|
| 21 |
+
<div class="wds-report-score">
|
| 22 |
+
<div class="wds-score <?php echo esc_attr( $score_class ); ?>">
|
| 23 |
+
<?php echo esc_html( $score ); ?><span class="wds-total"><?php esc_html_e( '/100', 'wds' ); ?></span>
|
| 24 |
+
</div>
|
| 25 |
+
<div class="wds-small-text"><?php esc_html_e( 'Current SEO Score', 'wds' ); ?></div>
|
| 26 |
+
</div>
|
| 27 |
+
|
| 28 |
+
<div>
|
| 29 |
+
<div class="wds-stacked-stats">
|
| 30 |
+
<div>
|
| 31 |
+
<div class="wds-stat-name"><?php esc_html_e( 'Last checked:', 'wds' ); ?></div>
|
| 32 |
+
<div
|
| 33 |
+
class="wds-stat-value"><?php echo esc_html( $service->get_last_checked( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ) ); ?></div>
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<div>
|
| 37 |
+
<div class="wds-stat-name"><?php esc_html_e( 'SEO Issues', 'wds' ); ?></div>
|
| 38 |
+
<div class="wds-stat-value">
|
| 39 |
+
<span class="wds-issues <?php echo $issue_count > 0 ? esc_attr( 'wds-issues-warning' ) : ''; ?>">
|
| 40 |
+
<span><?php echo esc_html( $issue_count ); ?></span>
|
| 41 |
+
</span>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
|
| 45 |
+
<div>
|
| 46 |
+
<div class="wds-stat-name"><?php esc_html_e( 'Scheduled reports', 'wds' ); ?></div>
|
| 47 |
+
<div class="wds-stat-value" style="line-height: 1">
|
| 48 |
+
<?php if ( $service->is_member() ) : ?>
|
| 49 |
+
<?php if ( $reporting_enabled ) : ?>
|
| 50 |
+
|
| 51 |
+
<?php
|
| 52 |
+
$monday = strtotime( 'this Monday' );
|
| 53 |
+
$midnight = strtotime( 'today' );
|
| 54 |
+
$checkup_frequency = smartcrawl_get_array_value( $opts, 'checkup-frequency' );
|
| 55 |
+
$checkup_dow = smartcrawl_get_array_value( $opts, 'checkup-dow' );
|
| 56 |
+
$checkup_tod = smartcrawl_get_array_value( $opts, 'checkup-tod' );
|
| 57 |
+
?>
|
| 58 |
+
|
| 59 |
+
<span class="wds-checkup-frequency"><?php echo esc_html( $checkup_frequency ); ?></span>
|
| 60 |
+
<br/>
|
| 61 |
+
<span class="wds-checkup-frequency-details">
|
| 62 |
+
<?php
|
| 63 |
+
if ( 'daily' === $checkup_frequency ) {
|
| 64 |
+
printf(
|
| 65 |
+
esc_html__( 'at %s' ),
|
| 66 |
+
esc_html( date_i18n( get_option( 'time_format' ), $midnight + ( $checkup_tod * HOUR_IN_SECONDS ) ) )
|
| 67 |
+
);
|
| 68 |
+
} else {
|
| 69 |
+
printf(
|
| 70 |
+
esc_html__( 'Every %1$s at %2$s' ),
|
| 71 |
+
esc_html( date_i18n( 'l', $monday + ( $checkup_dow * DAY_IN_SECONDS ) ) ),
|
| 72 |
+
esc_html( date_i18n( get_option( 'time_format' ), $midnight + ( $checkup_tod * HOUR_IN_SECONDS ) ) )
|
| 73 |
+
);
|
| 74 |
+
}
|
| 75 |
+
?>
|
| 76 |
+
</span>
|
| 77 |
+
|
| 78 |
+
<?php else : ?>
|
| 79 |
+
<button class="button button-small wds-enable-reporting">
|
| 80 |
+
<?php esc_html_e( 'Enable', 'wds' ); ?>
|
| 81 |
+
</button>
|
| 82 |
+
<button class="button button-small wds-disable-reporting"
|
| 83 |
+
style="display: none;">
|
| 84 |
+
<?php esc_html_e( 'Disable', 'wds' ); ?>
|
| 85 |
+
</button>
|
| 86 |
+
<?php endif; ?>
|
| 87 |
+
<?php else : /* Not a member, this is a pro feature */ ?>
|
| 88 |
+
<button class="wds-upgrade-button button-pro wds-has-tooltip"
|
| 89 |
+
data-content="<?php esc_attr_e( 'Get SmartCrawl Pro today Free', 'wds' ); ?>"
|
| 90 |
+
type="button">
|
| 91 |
+
<?php esc_html_e( 'Pro feature', 'wds' ); ?>
|
| 92 |
+
</button>
|
| 93 |
+
<?php endif; ?>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
includes/admin/templates/dashboard-dialog-has_dashboard-service_seo.php
DELETED
|
@@ -1,231 +0,0 @@
|
|
| 1 |
-
<?php do_action( 'wds-template-seo_service-box-full-before' ); ?>
|
| 2 |
-
|
| 3 |
-
<?php
|
| 4 |
-
// We have Dashboard installed and set up, we're ready to go
|
| 5 |
-
?>
|
| 6 |
-
<?php if ( empty( $status['start'] ) /*&& empty($status['end'])*/ ) { ?>
|
| 7 |
-
<section class="box-dashboard-run-seo-anaysis dev-box">
|
| 8 |
-
<div class="box-title">
|
| 9 |
-
<h3><span class="dashicons dashicons-dashboard wds-dashicons wds-dashicons-box-title"></span><?php esc_html_e( 'Run SEO analysis of your site', 'wds' ); ?></h3>
|
| 10 |
-
</div>
|
| 11 |
-
<?php if ( ! empty( $errors ) ) { ?>
|
| 12 |
-
<div class="box-content">
|
| 13 |
-
<?php foreach ( $errors as $error ) { ?>
|
| 14 |
-
<div class="wds-notice wds-notice-error">
|
| 15 |
-
<p><?php echo $error; ?></p>
|
| 16 |
-
</div>
|
| 17 |
-
<?php } ?>
|
| 18 |
-
</div>
|
| 19 |
-
<?php } ?>
|
| 20 |
-
|
| 21 |
-
<div class="box-content wds-seo_service-results-parent">
|
| 22 |
-
<?php do_action( 'wds-template-seo_service-box-full-before_body' ); ?>
|
| 23 |
-
<p><?php esc_html_e( 'Let our servers run a comprehensive scan of your entire website & compile a list of suggestions on how you can improve the SEO of your website.', 'wds' ); ?></p>
|
| 24 |
-
</div>
|
| 25 |
-
<div class="box-footer buttons">
|
| 26 |
-
<a href="#run-seo-analysis-modal" rel="dialog" class="button button-cta-alt"><?php esc_html_e( 'Run SEO analysis', 'wds' ); ?></a>
|
| 27 |
-
</div>
|
| 28 |
-
|
| 29 |
-
</section><!-- end box-dashboard-run-seo-anaysis -->
|
| 30 |
-
<?php } ?>
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
<?php
|
| 34 |
-
// SEO Report Test still on progress
|
| 35 |
-
?>
|
| 36 |
-
<?php if ( ! empty( $status['start'] ) ) { ?>
|
| 37 |
-
<section class="box-dashboard-run-seo-anaysis dev-box">
|
| 38 |
-
<div class="box-title">
|
| 39 |
-
<h3><span class="dashicons dashicons-dashboard wds-dashicons wds-dashicons-box-title"></span><?php esc_html_e( 'Run SEO analysis of your site', 'wds' ); ?></h3>
|
| 40 |
-
</div>
|
| 41 |
-
|
| 42 |
-
<div class="box-content">
|
| 43 |
-
<?php if ( ! empty( $errors ) ) { foreach ( $errors as $error ) { ?>
|
| 44 |
-
<div class="wds-notice wds-notice-error">
|
| 45 |
-
<p><?php echo $error; ?></p>
|
| 46 |
-
</div>
|
| 47 |
-
<?php }
|
| 48 |
-
} ?>
|
| 49 |
-
|
| 50 |
-
<?php if ( $report->has_state_messages() ) { ?>
|
| 51 |
-
<div class="result state-messages">
|
| 52 |
-
<?php foreach ( $report->get_state_messages() as $message ) { ?>
|
| 53 |
-
<div class="wds-notice wds-notice-error">
|
| 54 |
-
<p><?php echo esc_html( $message ); ?></p>
|
| 55 |
-
</div>
|
| 56 |
-
<?php } ?>
|
| 57 |
-
</div>
|
| 58 |
-
</div>
|
| 59 |
-
<?php } ?>
|
| 60 |
-
|
| 61 |
-
<?php if ( empty( $status['end'] ) ) { ?>
|
| 62 |
-
<?php $this->_render( 'dashboard-dialog-seo_service-run', array( 'status' => $status ) ); ?>
|
| 63 |
-
<?php } elseif ( ! empty( $has_result ) ) { ?>
|
| 64 |
-
<?php
|
| 65 |
-
// --- SEO check is done, let's go for results ---
|
| 66 |
-
?>
|
| 67 |
-
<div class="box-content no-padding wds-seo_service-results-parent">
|
| 68 |
-
<?php do_action( 'wds-template-seo_service-box-full-before_body' ); ?>
|
| 69 |
-
<div class="wds-seo_service-results">
|
| 70 |
-
|
| 71 |
-
<div class="wds-overview">
|
| 72 |
-
<?php if ( $report->has_meta( 'total' ) ) { ?>
|
| 73 |
-
<div class="wds-overview-item">
|
| 74 |
-
<strong><?php echo (int) $report->get_meta( 'total' ); ?></strong>
|
| 75 |
-
<span><?php esc_html_e( 'Total Discovered URLs', 'wds' ); ?></span>
|
| 76 |
-
</div>
|
| 77 |
-
<?php } ?>
|
| 78 |
-
<?php if ( $report->has_meta( 'discovered' ) ) { ?>
|
| 79 |
-
<div class="wds-overview-item">
|
| 80 |
-
<strong><?php echo (int) $report->get_meta( 'discovered' ); ?></strong>
|
| 81 |
-
<span><?php esc_html_e( 'Newly Discovered URLs', 'wds' ); ?></span>
|
| 82 |
-
</div>
|
| 83 |
-
<?php } ?>
|
| 84 |
-
<?php if ( $report->has_issues( 'inaccessible' ) ) { ?>
|
| 85 |
-
<div class="wds-overview-item">
|
| 86 |
-
<strong><?php echo (int) $report->get_issues_count( 'inaccessible' ); ?></strong>
|
| 87 |
-
<span><?php esc_html_e( 'Invisible URLs', 'wds' ); ?></span>
|
| 88 |
-
</div>
|
| 89 |
-
<?php } ?>
|
| 90 |
-
<?php if ( $report->has_meta( 'sitemap_total' ) ) { ?>
|
| 91 |
-
<div class="wds-overview-item">
|
| 92 |
-
<strong><?php echo (int) $report->get_meta( 'sitemap_total' ); ?></strong>
|
| 93 |
-
<span><?php esc_html_e( 'URLs in the Sitemap', 'wds' ); ?></span>
|
| 94 |
-
</div>
|
| 95 |
-
<?php } ?>
|
| 96 |
-
</div>
|
| 97 |
-
|
| 98 |
-
<?php /* "Not processed" notice, displayed as warning, outside the main report */ ?>
|
| 99 |
-
<?php if ( $report->get_issues_count( 'not_processed' ) ) { ?>
|
| 100 |
-
<div class="result not-processed">
|
| 101 |
-
<div class="wds-notice wds-notice-warning">
|
| 102 |
-
<p><?php esc_html_e( 'Some parts of your site were too slow to respond and were not included in our crawl.', 'wds' ); ?></p>
|
| 103 |
-
</div>
|
| 104 |
-
</div>
|
| 105 |
-
<?php } ?>
|
| 106 |
-
|
| 107 |
-
<?php if ( $report->has_issues() ) { ?>
|
| 108 |
-
<div class="wds-breakdown">
|
| 109 |
-
<h4><?php echo esc_html_e( 'We have found a few issues with URLs:', 'wds' ); ?></h4>
|
| 110 |
-
<?php
|
| 111 |
-
if ( $report->has_issues( '5xx' ) ) {
|
| 112 |
-
$this->_render('dashboard-report-issue', array(
|
| 113 |
-
'type' => '5xx',
|
| 114 |
-
'msg' => __( 'URLs that result in server error (500 etc)', 'wds' ),
|
| 115 |
-
'report' => $report,
|
| 116 |
-
'issues' => $report->get_issues_by_type( '5xx' ),
|
| 117 |
-
'redirections' => $redirections,
|
| 118 |
-
));
|
| 119 |
-
}
|
| 120 |
-
if ( $report->has_issues( '4xx' ) ) {
|
| 121 |
-
$this->_render('dashboard-report-issue', array(
|
| 122 |
-
'type' => '4xx',
|
| 123 |
-
'msg' => __( 'URLs that result in soft error (404 etc)', 'wds' ),
|
| 124 |
-
'report' => $report,
|
| 125 |
-
'issues' => $report->get_issues_by_type( '4xx' ),
|
| 126 |
-
'redirections' => $redirections,
|
| 127 |
-
));
|
| 128 |
-
}
|
| 129 |
-
if ( $report->has_issues( '3xx' ) ) {
|
| 130 |
-
$this->_render('dashboard-report-issue', array(
|
| 131 |
-
'type' => '3xx',
|
| 132 |
-
'msg' => __( 'URLs that have multiple re-directs', 'wds' ),
|
| 133 |
-
'report' => $report,
|
| 134 |
-
'issues' => $report->get_issues_by_type( '3xx' ),
|
| 135 |
-
'redirections' => $redirections,
|
| 136 |
-
));
|
| 137 |
-
}
|
| 138 |
-
?>
|
| 139 |
-
</div>
|
| 140 |
-
<?php } else { // if issues count ?>
|
| 141 |
-
<div class="wds-breakdown">
|
| 142 |
-
<div class="wds-service-no_issue">
|
| 143 |
-
<?php if ( ! $report->has_state_messages() ) { ?>
|
| 144 |
-
<div class="wds-crawl-result wds-crawl-success">
|
| 145 |
-
<p><?php esc_html_e( 'Your latest crawl revealed no SEO issues, well done!', 'wds' ); ?></p>
|
| 146 |
-
<?php if ( $report->has_ignored_issues() ) { ?>
|
| 147 |
-
<p>
|
| 148 |
-
<em><small><?php esc_html_e( 'Well, that\'s not entirely true, but you opted to ignore a couple of them ;)', 'wds' ); ?></small></em>
|
| 149 |
-
<a href="#purge-ignores"><?php esc_html_e( 'Purge ignored list', 'wds' ); ?></a>
|
| 150 |
-
</p>
|
| 151 |
-
<?php } ?>
|
| 152 |
-
</div>
|
| 153 |
-
<?php } else { ?>
|
| 154 |
-
<p><?php
|
| 155 |
-
esc_html_e( 'Please, have a look into the displayed messages and re-crawl your site.', 'wds' );
|
| 156 |
-
?></p>
|
| 157 |
-
<?php } ?>
|
| 158 |
-
</div>
|
| 159 |
-
</div>
|
| 160 |
-
<?php } // if issues count ?>
|
| 161 |
-
|
| 162 |
-
<?php if ( $report->get_sitemap_misses() ) { ?>
|
| 163 |
-
<div class="wds-sitemap">
|
| 164 |
-
<div class="wds-seo_service-warning wds-seo_service-warning-sitemap">
|
| 165 |
-
<p>
|
| 166 |
-
<?php printf( __( '%d URLs are not in the Sitemap', 'wds' ), ($report->get_sitemap_misses()) ); ?>
|
| 167 |
-
<button
|
| 168 |
-
class="wds-update-sitemap button button-yellow-alt"
|
| 169 |
-
data-working="<?php esc_attr_e( 'Updating...', 'wds' ); ?>"
|
| 170 |
-
data-static="<?php esc_attr_e( 'Update Sitemap', 'wds' ); ?>"
|
| 171 |
-
data-done="<?php esc_attr_e( 'Sitemap updated, please hold on...', 'wds' ); ?>"
|
| 172 |
-
type="button" >
|
| 173 |
-
<?php esc_html_e( 'Update Sitemap', 'wds' ); ?>
|
| 174 |
-
</button>
|
| 175 |
-
<span class="info">
|
| 176 |
-
<small><i>
|
| 177 |
-
<?php esc_html_e( 'This number might not be indicative of an actual issue on your site. These URLs could also be things that don\'t make sense to be found in the sitemap, such as date archives.', 'wds' ); ?>
|
| 178 |
-
<?php if ( $report->has_issues( 'sitemap' ) ) { ?>
|
| 179 |
-
<a href="#toggle-sitemap-urls"><?php esc_html_e( 'Show', 'wds' ); ?></a>
|
| 180 |
-
<?php } ?>
|
| 181 |
-
</i></small>
|
| 182 |
-
</span>
|
| 183 |
-
</p>
|
| 184 |
-
<?php if ( $report->has_issues( 'sitemap' ) ) { ?>
|
| 185 |
-
<div class="wds-sitemap-issues_list" style="display:none">
|
| 186 |
-
<ul>
|
| 187 |
-
<?php foreach ( $report->get_issues_by_type( 'sitemap' ) as $key ) { ?>
|
| 188 |
-
<?php $info = $report->get_issue( $key ); ?>
|
| 189 |
-
<?php if ( empty( $info['path'] ) ) { continue; } ?>
|
| 190 |
-
<li
|
| 191 |
-
data-issue_id="<?php echo esc_attr( $key ); ?>"
|
| 192 |
-
data-path="<?php echo esc_attr( $info['path'] ); ?>"
|
| 193 |
-
>
|
| 194 |
-
<a href="<?php echo esc_url( $info['path'] ); ?>">
|
| 195 |
-
<?php echo esc_html( $info['path'] ); ?>
|
| 196 |
-
</a>
|
| 197 |
-
<a class="wds-sitemap-action wds-sitemap-ignore" href="#ignore"><?php esc_html_e( 'Ignore', 'wds' ); ?></a>
|
| 198 |
-
<a class="wds-sitemap-action wds-sitemap-add" href="#add"><?php esc_html_e( 'Add to sitemap', 'wds' ); ?></a>
|
| 199 |
-
</li>
|
| 200 |
-
<?php } ?>
|
| 201 |
-
</ul>
|
| 202 |
-
</div>
|
| 203 |
-
<?php } ?>
|
| 204 |
-
</div>
|
| 205 |
-
</div>
|
| 206 |
-
<?php } ?>
|
| 207 |
-
|
| 208 |
-
<?php if ( $report->has_ignored_issues() ) { ?>
|
| 209 |
-
<p class="wds-crawl-result wds-action-purge_ignored">
|
| 210 |
-
<a href="#purge-ignores">
|
| 211 |
-
<?php echo esc_html(sprintf(
|
| 212 |
-
_n( 'Purge %d ignored issue', 'Purge %d ignored issues', $report->get_ignored_issues_count(), 'wds' ),
|
| 213 |
-
$report->get_ignored_issues_count()
|
| 214 |
-
)); ?>
|
| 215 |
-
</a>
|
| 216 |
-
</p>
|
| 217 |
-
<?php } ?>
|
| 218 |
-
|
| 219 |
-
</div>
|
| 220 |
-
</div><!-- end box-content -->
|
| 221 |
-
|
| 222 |
-
<div class="box-footer buttons bordered-top">
|
| 223 |
-
<a href="#run-seo-analysis-modal" rel="dialog" class="button button-cta-alt"><?php esc_html_e( 'Run SEO analysis', 'wds' ); ?></a>
|
| 224 |
-
</div>
|
| 225 |
-
|
| 226 |
-
<?php } ?>
|
| 227 |
-
|
| 228 |
-
</section><!-- end box-dashboard-run-seo-anaysis -->
|
| 229 |
-
<?php } ?>
|
| 230 |
-
|
| 231 |
-
<?php do_action( 'wds-template-seo_service-box-full-after' ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/dashboard-dialog-has_dashboard-service_uptime.php
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
<section class="box-dashboard-performance-info dev-box">
|
| 2 |
-
<div class="box-content">
|
| 3 |
-
<p class="uptime-message">
|
| 4 |
-
<span class="dashicons dashicons-chart-line wds-dashicons wds-dashicons-box-title"></span>
|
| 5 |
-
<?php if ( ! empty( $data['availability'] ) ) { ?>
|
| 6 |
-
<span class="uptime">
|
| 7 |
-
<span class="uptime-result"><?php echo esc_html( $data['availability'] ); ?></span>
|
| 8 |
-
<span class="uptime-label"><?php esc_html_e( 'Uptime', 'wds' ); ?></span>
|
| 9 |
-
</span>
|
| 10 |
-
<?php } ?>
|
| 11 |
-
<?php if ( ! class_exists( 'WP_Hummingbird' ) ) { ?>
|
| 12 |
-
<span class="content">
|
| 13 |
-
<?php printf( __( 'Install %s for more info.' , 'wds' ), sprintf( '<a href="https://premium.wpmudev.org/project/wp-hummingbird/">%s</a>', __( 'Hummingbird', 'wds' ) ) ); ?>
|
| 14 |
-
</span>
|
| 15 |
-
<?php } ?>
|
| 16 |
-
</p>
|
| 17 |
-
|
| 18 |
-
<?php
|
| 19 |
-
if ( ! empty( $errors ) ) { foreach ( $errors as $error ) {
|
| 20 |
-
?>
|
| 21 |
-
<div class="wds-notice wds-notice-error">
|
| 22 |
-
<p><?php echo esc_html( $error ); ?></p>
|
| 23 |
-
</div>
|
| 24 |
-
<?php
|
| 25 |
-
}
|
| 26 |
-
}
|
| 27 |
-
?>
|
| 28 |
-
|
| 29 |
-
</div>
|
| 30 |
-
</section><!-- end box-dashboard-performance-info -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/dashboard-dialog-not_installed-service_seo.php
DELETED
|
@@ -1,22 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// We don't have Dashboard installed
|
| 3 |
-
$dashboardLoginLink = admin_url( 'admin.php?page=wpmudev' );
|
| 4 |
-
$dashboardDownloadLink = 'https://premium.wpmudev.org/api/dashboard/v1/download-dashboard';
|
| 5 |
-
$dashboardHubLink = 'https://premium.wpmudev.org/membership/#profile-menu-tabs';
|
| 6 |
-
?>
|
| 7 |
-
<section class="box-dashboard-install-dashboard-plugin dev-box">
|
| 8 |
-
<div class="box-title">
|
| 9 |
-
<h3><?php esc_html_e( 'Install WPMU DEV Dashboard', 'wds' ); ?></h3>
|
| 10 |
-
</div>
|
| 11 |
-
<div class="box-content">
|
| 12 |
-
<p>
|
| 13 |
-
<?php echo sprintf(
|
| 14 |
-
esc_html( '%s, WPMU DEV Dashboard Plugin is required in order to make advantage of SEO Analysus & Reporting. Once you Install, Activate & Login, you will be able to preform SEO Analysis sancs of your entire website, receive tips about improving your SEO Rankings.', 'wds' ),
|
| 15 |
-
Smartcrawl_Model_User::current()->get_first_name()
|
| 16 |
-
); ?>
|
| 17 |
-
</p>
|
| 18 |
-
</div>
|
| 19 |
-
<div class="box-footer buttons">
|
| 20 |
-
<a href="<?php echo esc_url( $dashboardDownloadLink ); ?>" class="button block button-cta-alt large"><?php esc_html_e( 'Download WPMU DEV Dashboard', 'wds' ); ?></a>
|
| 21 |
-
</div>
|
| 22 |
-
</section><!-- end box-dashboard-install-dashboard-plugin -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/dashboard-dialog-not_installed-service_uptime.php
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
<section class="box-dashboard-performance-info dev-box">
|
| 2 |
-
<div class="box-title">
|
| 3 |
-
<h3><span class="dashicons dashicons-chart-line wds-dashicons wds-dashicons-box-title"></span><?php esc_html_e( 'Quickly check your site performance', 'wds' ); ?></h3>
|
| 4 |
-
</div>
|
| 5 |
-
<div class="box-content">
|
| 6 |
-
<p><?php esc_html_e( 'This service requires an active WPMU DEV Membership, get one today!', 'wds' ); ?></p>
|
| 7 |
-
</div>
|
| 8 |
-
<div class="box-footer buttons">
|
| 9 |
-
<a href="https://premium.wpmudev.org/membership/#profile-menu-tabs" target="_blank" class="button button-cta"><?php esc_html_e( 'Update Membership', 'wds' ); ?></a>
|
| 10 |
-
</div>
|
| 11 |
-
</section><!-- end box-dashboard-performance-info -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/dashboard-dialog-not_logged_in-service_seo.php
DELETED
|
@@ -1,28 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// We have Dashboard installed, but the user didn't log in yet
|
| 3 |
-
$dashboardLoginLink = admin_url( 'admin.php?page=wpmudev' );
|
| 4 |
-
$dashboardDownloadLink = 'https://premium.wpmudev.org/api/dashboard/v1/download-dashboard';
|
| 5 |
-
$dashboardHubLink = 'https://premium.wpmudev.org/membership/#profile-menu-tabs';
|
| 6 |
-
?>
|
| 7 |
-
<section class="box-dashboard-upgrade-membership dev-box">
|
| 8 |
-
<div class="box-title">
|
| 9 |
-
<h3><?php esc_html_e( 'Upgrade Membership', 'wds' ); ?></h3>
|
| 10 |
-
</div>
|
| 11 |
-
<div class="box-content">
|
| 12 |
-
<p>
|
| 13 |
-
<?php echo sprintf(
|
| 14 |
-
esc_html( '%s SEO Analysis & Reporting is a feature available to people with active WPMU DEV memberships. Get access to all of our Premium Plugins and Themes as well as 24/7 Support today. It´s easy to join and only takes a few minutes!', 'wds' ),
|
| 15 |
-
Smartcrawl_Model_User::current()->get_first_name()
|
| 16 |
-
); ?>
|
| 17 |
-
</p>
|
| 18 |
-
<ul class="listing bold wds-listing">
|
| 19 |
-
<li class="cta-alt"><?php _e( 'Access to 140+ plugins & Upfront themes', 'wds' ); ?></li>
|
| 20 |
-
<li class="cta-alt"><?php _e( 'Access to security, backups, SEO and performance services', 'wds' ); ?></li>
|
| 21 |
-
<li class="cta-alt"><?php _e( '24/7 expert WordPress support', 'wds' ); ?></li>
|
| 22 |
-
</ul>
|
| 23 |
-
</div>
|
| 24 |
-
<div class="box-footer buttons">
|
| 25 |
-
<a href="<?php echo $dashboardHubLink; ?>" class="button block button-cta-alt large"><?php esc_html_e( 'Upgrade Membership', 'wds' ); ?></a>
|
| 26 |
-
<p class="wds-footer-text"><?php echo sprintf( __( 'Already a member? You need to <a href="%1$s">download</a> the WPMU DEV Plugin & <a href="%1$s">login</a>!', 'wds' ), $dashboardDownloadLink, $dashboardLoginLink ); ?></p>
|
| 27 |
-
</div>
|
| 28 |
-
</section><!-- end box-dashboard-upgrade-membership -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/dashboard-dialog-seo_service-run.php
DELETED
|
@@ -1,49 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
$progress = isset( $status ) && ! empty( $status['percentage'] ) && is_numeric( $status['percentage'] )
|
| 3 |
-
? (int) $status['percentage']
|
| 4 |
-
: 0
|
| 5 |
-
;
|
| 6 |
-
if ( $progress > 100 ) { $progress = 100; }
|
| 7 |
-
?>
|
| 8 |
-
<div class="box-content wds-seo_service-run">
|
| 9 |
-
<div class="wds-block-test wds-block-test-standalone">
|
| 10 |
-
<h4 class="wds-block-test-sub-title"><?php _e( 'SEO analysis in progress', 'wds' ); ?></h4>
|
| 11 |
-
<div class="wds-progress">
|
| 12 |
-
<div class="wds-progress-bar wds-progress-bar-with-percent wds-progress-bar-animated" role="progressbar" aria-valuenow="<?php echo (int) $progress; ?>" aria-valuemin="0" aria-valuemax="100" style="width:<?php echo (int) $progress; ?>%;">
|
| 13 |
-
<span class="wds-progress-bar-current-percent"><?php echo (int) $progress; ?>%</span>
|
| 14 |
-
</div>
|
| 15 |
-
</div><!-- end wds-progress -->
|
| 16 |
-
<div class="wds-progress-state">
|
| 17 |
-
<span class="wds-progress-state-text"><?php _e( 'Checking the site ...', 'wds' ); ?></span>
|
| 18 |
-
</div><!-- end wds-progress-state -->
|
| 19 |
-
<div class="wds-progress-note">
|
| 20 |
-
<?php
|
| 21 |
-
$admin_email = false;
|
| 22 |
-
$dash_email = false;
|
| 23 |
-
if ( class_exists( 'WPMUDEV_Dashboard' ) && ! empty( WPMUDEV_Dashboard::$site ) ) {
|
| 24 |
-
if ( is_callable( array( WPMUDEV_Dashboard::$site, 'get_option' ) ) ) {
|
| 25 |
-
$dash_email = WPMUDEV_Dashboard::$site->get_option( 'auth_user' );
|
| 26 |
-
if ( false !== strpos( $dash_email, '@' ) ) { $admin_email = $dash_email; }
|
| 27 |
-
}
|
| 28 |
-
}
|
| 29 |
-
$scan_msg = __( "A full scan can take quite a while, especially if you have a large site!<br>Feel free to close this page; we'll send an e-mail to %s once the results are in.", 'wds' );
|
| 30 |
-
?>
|
| 31 |
-
<p>
|
| 32 |
-
<?php if ( ! empty( $dash_email ) && ! empty( $admin_email ) ) { ?>
|
| 33 |
-
<?php $admin_email = sprintf( '<a href="mailto: %1$s">%1$s</a>', $admin_email ); ?>
|
| 34 |
-
<?php } else { ?>
|
| 35 |
-
<?php $admin_email = __( 'your DEV account email', 'wds' ); ?>
|
| 36 |
-
<?php } ?>
|
| 37 |
-
<?php
|
| 38 |
-
printf(
|
| 39 |
-
$scan_msg,
|
| 40 |
-
$admin_email
|
| 41 |
-
);
|
| 42 |
-
?>
|
| 43 |
-
<br>
|
| 44 |
-
<?php esc_html_e( 'You can change that e-mail address if you want, on your DEV account page', 'wds' ); ?>
|
| 45 |
-
<a href="https://premium.wpmudev.org/hub/account" target="_blank"><?php esc_html_e( 'here', 'wds' ); ?></a>
|
| 46 |
-
</p>
|
| 47 |
-
</div>
|
| 48 |
-
</div><!-- end wds-block-test -->
|
| 49 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/dashboard-report-issue.php
DELETED
|
@@ -1,114 +0,0 @@
|
|
| 1 |
-
<div class="wds-service-issue wds-seo_service-issue wds-seo_service-issue-<?php echo esc_attr( $type ); ?>">
|
| 2 |
-
<p>
|
| 3 |
-
<strong><?php echo (int) count( $issues ); ?></strong>
|
| 4 |
-
<?php echo esc_html( $msg ); ?>
|
| 5 |
-
<button type="button" class="wds-fix button button-white"><?php esc_html_e( 'Fix', 'wds' ); ?></button>
|
| 6 |
-
</p>
|
| 7 |
-
|
| 8 |
-
<?php if ( ! empty( $issues ) ) { ?>
|
| 9 |
-
<div class="wds-issue-items">
|
| 10 |
-
<header>
|
| 11 |
-
<div class="wds-issue-item-part wds-issue-occurences">
|
| 12 |
-
Occurences
|
| 13 |
-
</div>
|
| 14 |
-
<div class="wds-issue-item-part wds-issue-path">
|
| 15 |
-
URL
|
| 16 |
-
</div>
|
| 17 |
-
</header>
|
| 18 |
-
<?php foreach ( $issues as $issue_id ) { ?>
|
| 19 |
-
<?php $issue = $report->get_issue( $issue_id ); ?>
|
| 20 |
-
<div class="wds-issue-item" data-issue_id="<?php echo esc_attr( $issue_id ); ?>" >
|
| 21 |
-
|
| 22 |
-
<!-- Occurences list modal for this URL -->
|
| 23 |
-
<dialog class="dev-overlay wds-modal wds-occurences" id="wds-issue-occurences-<?php echo esc_attr( $issue_id ); ?>" title="<?php echo esc_attr( $issue['path'] ); ?>">
|
| 24 |
-
<div class="box-content">
|
| 25 |
-
<div class="wds-issue-occurences-list">
|
| 26 |
-
<ul class="wds-listing wds-path-occurences">
|
| 27 |
-
<li class="wds-listing-label"><?php esc_html_e( 'Link Location', 'wds' ); ?></li>
|
| 28 |
-
<?php if ( ! empty( $issue['origin'] ) ) { foreach ( $issue['origin'] as $origin ) { ?>
|
| 29 |
-
<li>
|
| 30 |
-
<?php
|
| 31 |
-
$origin = is_array( $origin ) && ! empty( $origin[0] ) ? $origin[0] : $origin;
|
| 32 |
-
?>
|
| 33 |
-
<a href="<?php echo is_string( $origin ) ? esc_url( $origin ) : esc_url( $origin[0] ); ?>">
|
| 34 |
-
<?php echo is_string( $origin ) ? esc_html( $origin ) : esc_html( $origin[0] ); ?>
|
| 35 |
-
</a>
|
| 36 |
-
</li>
|
| 37 |
-
<?php }
|
| 38 |
-
} ?>
|
| 39 |
-
</ul>
|
| 40 |
-
</div>
|
| 41 |
-
</div>
|
| 42 |
-
</dialog>
|
| 43 |
-
|
| 44 |
-
<!-- Redirection modal for this URL -->
|
| 45 |
-
<dialog class="dev-overlay wds-modal wds-redirect" id="wds-issue-redirect-<?php echo esc_attr( $issue_id ); ?>" title="<?php echo esc_attr( $issue['path'] ); ?>">
|
| 46 |
-
<div class="box-content modal">
|
| 47 |
-
<p class="group wds-group">
|
| 48 |
-
<label for="" class="wds-label"><?php esc_html_e( 'Enter re-direct URL', 'wds' ); ?></label>
|
| 49 |
-
<input type="url" name="redirect" value="<?php echo (
|
| 50 |
-
! empty( $redirections[ $issue['path'] ] )
|
| 51 |
-
? esc_url( $redirections[ $issue['path'] ] )
|
| 52 |
-
: ''
|
| 53 |
-
); ?>" class="wds-field">
|
| 54 |
-
</p>
|
| 55 |
-
</div>
|
| 56 |
-
|
| 57 |
-
<div class="box-footer buttons modal">
|
| 58 |
-
<input type="hidden" name="source" value="<?php echo esc_url( $issue['path'] ); ?>" />
|
| 59 |
-
<?php wp_nonce_field( 'wds-redirect', 'wds-redirect' ); ?>
|
| 60 |
-
<button type="button" class="button button-cta-alt wds-submit-redirect"><?php echo esc_html_e( 'Save', 'wds' ); ?></button>
|
| 61 |
-
</div>
|
| 62 |
-
</dialog>
|
| 63 |
-
|
| 64 |
-
<!-- Occurences count part -->
|
| 65 |
-
<div class="wds-issue-item-part wds-issue-occurences">
|
| 66 |
-
<span><?php echo count( $issue['origin'] ); ?></span>
|
| 67 |
-
</div>
|
| 68 |
-
|
| 69 |
-
<!-- Issue URL part -->
|
| 70 |
-
<div class="wds-issue-item-part wds-issue-path">
|
| 71 |
-
<a href="<?php echo esc_url( $issue['path'] ); ?>">
|
| 72 |
-
<?php echo esc_html( $issue['path'] ); ?>
|
| 73 |
-
<?php if ( in_array( $issue['path'], array_keys( $redirections ) ) ) { ?>
|
| 74 |
-
[redirected]
|
| 75 |
-
<?php } ?>
|
| 76 |
-
</a>
|
| 77 |
-
</div>
|
| 78 |
-
|
| 79 |
-
<!-- Actions list dropdown -->
|
| 80 |
-
<div class="wds-issue-item-part wds-issue-actions">
|
| 81 |
-
<a href="#actions">
|
| 82 |
-
…
|
| 83 |
-
</a>
|
| 84 |
-
<div class="wds-issue-actions-options">
|
| 85 |
-
<ul>
|
| 86 |
-
<li class="heading">Options <i class="wdv-icon wdv-icon-fw wdv-icon-remove"></i></li>
|
| 87 |
-
<li>
|
| 88 |
-
<a href="#list">
|
| 89 |
-
<i class="wds-icon wds-icon-inline wds-icon-inline-left wds-icon-list"></i>
|
| 90 |
-
<?php esc_html_e( 'List occurences', 'wds' ); ?>
|
| 91 |
-
</a>
|
| 92 |
-
</li>
|
| 93 |
-
<li>
|
| 94 |
-
<a href="#redirect">
|
| 95 |
-
<i class="wds-icon wds-icon-inline wds-icon-inline-left wds-icon-redirect"></i>
|
| 96 |
-
<?php esc_html_e( 'Re-direct', 'wds' ); ?>
|
| 97 |
-
</a>
|
| 98 |
-
</li>
|
| 99 |
-
<li>
|
| 100 |
-
<a href="#ignore" data-issue_id="<?php echo esc_attr( $issue_id ); ?>">
|
| 101 |
-
<i class="wds-icon wds-icon-inline wds-icon-inline-left wds-icon-ignore"></i>
|
| 102 |
-
<?php esc_html_e( 'Ignore', 'wds' ); ?>
|
| 103 |
-
</a>
|
| 104 |
-
</li>
|
| 105 |
-
</ul>
|
| 106 |
-
</div>
|
| 107 |
-
</div>
|
| 108 |
-
|
| 109 |
-
</div> <!-- .wds-issue-item -->
|
| 110 |
-
<?php } ?>
|
| 111 |
-
</div> <!-- .wds-issue-items -->
|
| 112 |
-
<?php } ?>
|
| 113 |
-
|
| 114 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/dashboard-settings.php
DELETED
|
@@ -1,237 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 3 |
-
?>
|
| 4 |
-
<div id="container" class="wrap wrap-wds wds-page wds-page-dashboard">
|
| 5 |
-
<!--
|
| 6 |
-
<div class="wds-notice wds-notice-success">
|
| 7 |
-
<p><?php esc_html_e( 'Settings Updated', 'wds' ); ?></p>
|
| 8 |
-
</div>
|
| 9 |
-
|
| 10 |
-
<div class="wds-notice wds-notice-error can-close">
|
| 11 |
-
<span class="close"></span>
|
| 12 |
-
<p><?php esc_html_e( 'Settings Updated', 'wds' ); ?></p>
|
| 13 |
-
</div>
|
| 14 |
-
|
| 15 |
-
<div class="wds-notice wds-notice-warning">
|
| 16 |
-
<p><?php esc_html_e( 'Settings Updated', 'wds' ); ?></p>
|
| 17 |
-
</div>
|
| 18 |
-
|
| 19 |
-
<div class="wds-notice wds-notice-success wds-notice-box">
|
| 20 |
-
<p><?php esc_html_e( 'Settings Updated', 'wds' ); ?></p>
|
| 21 |
-
</div>
|
| 22 |
-
|
| 23 |
-
<div class="wds-notice wds-notice-error wds-notice-box can-close">
|
| 24 |
-
<span class="close"></span>
|
| 25 |
-
<p><?php esc_html_e( 'Settings Updated', 'wds' ); ?></p>
|
| 26 |
-
</div>
|
| 27 |
-
-->
|
| 28 |
-
<section id="page-header">
|
| 29 |
-
<h1 class="wds-title-alt"><?php esc_html_e( 'Welcome to SmartCrawl' , 'wds' ); ?></h1>
|
| 30 |
-
<p class="wds-page-desc">
|
| 31 |
-
<?php esc_html_e( 'Ahoy Cap\'n! Welcome to SmartCrawl. This plugin will help you improve the SEO of your website and get better', 'wds' ); ?>
|
| 32 |
-
<br>
|
| 33 |
-
<?php esc_html_e( 'Search Results Rankings across various search engines.', 'wds' ); ?>
|
| 34 |
-
</p>
|
| 35 |
-
</section><!-- end page-header -->
|
| 36 |
-
|
| 37 |
-
<?php
|
| 38 |
-
$dashboardLoginLink = admin_url( 'admin.php?page=wpmudev' );
|
| 39 |
-
$dashboardDownloadLink = 'https://premium.wpmudev.org/api/dashboard/v1/download-dashboard';
|
| 40 |
-
$dashboardHubLink = 'https://premium.wpmudev.org/membership/#profile-menu-tabs';
|
| 41 |
-
?>
|
| 42 |
-
|
| 43 |
-
<div class="row">
|
| 44 |
-
|
| 45 |
-
<div class="col-half col-half-dashboard col-half-dashboard-left">
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
<?php
|
| 52 |
-
/**
|
| 53 |
-
* Pre-built Uptime service dashboard box
|
| 54 |
-
*/
|
| 55 |
-
if ( ! empty( $uptime_message_box ) ) { echo $uptime_message_box; }
|
| 56 |
-
?>
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
<?php
|
| 60 |
-
/**
|
| 61 |
-
* Pre-built SEO service dashboard box
|
| 62 |
-
*/
|
| 63 |
-
if ( ! empty( $seo_message_box ) ) { echo $seo_message_box; }
|
| 64 |
-
?>
|
| 65 |
-
|
| 66 |
-
<?php if ( ! empty( $smartcrawl_options['sitemap'] ) && ! empty( $smartcrawl_options['wds_sitemap-setup'] ) ) { ?>
|
| 67 |
-
<section class="box-dashboard-sitemap-settings dev-box">
|
| 68 |
-
<div class="box-title">
|
| 69 |
-
<div class="buttons buttons-icon">
|
| 70 |
-
<a href="<?php echo $current_admin_url; ?>?page=wds_sitemap" class="edit"><span class="dashicons dashicons-admin-generic wds-dashicons wds-dashicons-link"></span></a>
|
| 71 |
-
</div>
|
| 72 |
-
<h3><span class="dashicons dashicons-networking wds-dashicons wds-dashicons-box-title"></span><?php esc_html_e( 'Sitemaps', 'wds' ); ?></h3>
|
| 73 |
-
</div>
|
| 74 |
-
<div class="box-content">
|
| 75 |
-
<?php if ( ! empty( $smartcrawl_options['sitemappath'] ) ) { ?>
|
| 76 |
-
<p><?php esc_html_e( 'Path to the XML Sitemap', 'wds' ); ?></p>
|
| 77 |
-
<div class="wds-block-content wds-block-content-grey">
|
| 78 |
-
<pre><?php echo esc_html( $smartcrawl_options['sitemappath'] ); ?></pre>
|
| 79 |
-
</div>
|
| 80 |
-
<?php } ?>
|
| 81 |
-
<?php if ( function_exists( 'wds_get_sitemap_url' ) ) { ?>
|
| 82 |
-
<p><?php esc_html_e( 'URL to the XML Sitemap', 'wds' ); ?>: <a target="_blank" href="<?php echo smartcrawl_get_sitemap_url(); ?>"><?php echo smartcrawl_get_sitemap_url(); ?></a></p>
|
| 83 |
-
<?php } ?>
|
| 84 |
-
</div>
|
| 85 |
-
</section><!-- end box-dashboard-sitemap-settings -->
|
| 86 |
-
<?php } ?>
|
| 87 |
-
|
| 88 |
-
</div><!-- end col-half-dashboard-left -->
|
| 89 |
-
|
| 90 |
-
<div class="col-half col-half-dashboard col-half-dashboard-right">
|
| 91 |
-
|
| 92 |
-
<?php if ( ! empty( $smartcrawl_options['onpage'] ) && (is_network_admin() || Smartcrawl_Settings_Admin::is_tab_allowed( Smartcrawl_Settings::TAB_ONPAGE )) ) { ?>
|
| 93 |
-
<?php if ( empty( $smartcrawl_options['wds_onpage-setup'] ) ) { ?>
|
| 94 |
-
|
| 95 |
-
<section class="box-dashboard-improve-seo dev-box">
|
| 96 |
-
<div class="box-title">
|
| 97 |
-
<h3><span class="dashicons dashicons-admin-settings wds-dashicons wds-dashicons-box-title"></span><?php esc_html_e( 'Manually improve SEO', 'wds' ); ?></h3>
|
| 98 |
-
</div>
|
| 99 |
-
<div class="box-content">
|
| 100 |
-
<p>
|
| 101 |
-
<?php esc_html_e( 'Manually improve your site\'s SEO by configuring various settings.', 'wds' ); ?>
|
| 102 |
-
<br />
|
| 103 |
-
<?php esc_html_e( 'We recommend by starting with Title & Meta as it is generally considered the most valuable area and most likely to be indexed.', 'wds' ); ?></p>
|
| 104 |
-
</div>
|
| 105 |
-
<div class="box-footer buttons">
|
| 106 |
-
<a href="<?php echo esc_url( Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE ) ); ?>" class="button button-cta-dark button-configure-seo"><?php esc_html_e( 'Configure SEO', 'wds' ); ?></a>
|
| 107 |
-
</div>
|
| 108 |
-
</section><!-- end box-dashboard-performance-info -->
|
| 109 |
-
|
| 110 |
-
<?php } else { ?>
|
| 111 |
-
|
| 112 |
-
<section class="box-dashboard-titles-and-meta dev-box">
|
| 113 |
-
<div class="box-title">
|
| 114 |
-
<div class="buttons buttons-icon">
|
| 115 |
-
<a href="<?php echo esc_url( Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE ) ); ?>" class="edit"><span class="dashicons dashicons-admin-generic wds-dashicons wds-dashicons-link"></span></a>
|
| 116 |
-
</div>
|
| 117 |
-
<h3><span class="dashicons dashicons-edit wds-dashicons wds-dashicons-box-title"></span><?php esc_html_e( 'Titles & Meta', 'wds' ); ?></h3>
|
| 118 |
-
</div>
|
| 119 |
-
<div class="box-content">
|
| 120 |
-
<div class="wds-links-list-group">
|
| 121 |
-
<ul class="wds-links-list">
|
| 122 |
-
<li class="wds-links-list-item">
|
| 123 |
-
<a class="wds-links-list-item-link" href="<?php echo $current_admin_url; ?>?page=wds_onpage#tab_homepage">
|
| 124 |
-
<span class="wds-links-list-item-label"><?php esc_html_e( 'Homepage', 'wds' ) ?></span>
|
| 125 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 126 |
-
</a>
|
| 127 |
-
</li><!-- end wds-links-list-item -->
|
| 128 |
-
|
| 129 |
-
<?php
|
| 130 |
-
foreach ( get_post_types( array( 'public' => true ) ) as $posttype ) {
|
| 131 |
-
if ( in_array( $posttype, array( 'revision', 'nav_menu_item' ) ) ) { continue; }
|
| 132 |
-
|
| 133 |
-
$type_obj = get_post_type_object( $posttype );
|
| 134 |
-
if ( ! is_object( $type_obj ) ) { continue; }
|
| 135 |
-
|
| 136 |
-
?>
|
| 137 |
-
|
| 138 |
-
<li class="wds-links-list-item">
|
| 139 |
-
<a class="wds-links-list-item-link" href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_onpage#tab_<?php echo esc_attr( $posttype ); ?>">
|
| 140 |
-
<span class="wds-links-list-item-label"><?php echo esc_html( $type_obj->labels->name ); ?></span>
|
| 141 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 142 |
-
</a>
|
| 143 |
-
</li><!-- end wds-links-list-item -->
|
| 144 |
-
|
| 145 |
-
<?php
|
| 146 |
-
}
|
| 147 |
-
?>
|
| 148 |
-
<li class="wds-links-list-item">
|
| 149 |
-
<a class="wds-links-list-item-link" href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_onpage#tab_post-categories">
|
| 150 |
-
<span class="wds-links-list-item-label"><?php esc_html_e( 'Post Categories', 'wds' ) ?></span>
|
| 151 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 152 |
-
</a>
|
| 153 |
-
</li>
|
| 154 |
-
|
| 155 |
-
</ul><!-- end wds-links-list -->
|
| 156 |
-
|
| 157 |
-
<ul class="wds-links-list">
|
| 158 |
-
<?php
|
| 159 |
-
foreach ( get_taxonomies( array( '_builtin' => false ), 'objects' ) as $taxonomy ) {
|
| 160 |
-
?>
|
| 161 |
-
|
| 162 |
-
<li class="wds-links-list-item">
|
| 163 |
-
<a class="wds-links-list-item-link" href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_onpage#tab_<<?php echo esc_attr( $taxonomy->name ); ?>">
|
| 164 |
-
<span class="wds-links-list-item-label"><?php echo esc_html( ucfirst( $taxonomy->label ) ); ?></span>
|
| 165 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 166 |
-
</a>
|
| 167 |
-
</li><!-- end wds-links-list-item -->
|
| 168 |
-
|
| 169 |
-
<?php
|
| 170 |
-
}
|
| 171 |
-
?>
|
| 172 |
-
|
| 173 |
-
<li class="wds-links-list-item">
|
| 174 |
-
<a class="wds-links-list-item-link" href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_onpage#tab_post-tags">
|
| 175 |
-
<span class="wds-links-list-item-label"><?php esc_html_e( 'Post Tags', 'wds' ) ?></span>
|
| 176 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 177 |
-
</a>
|
| 178 |
-
</li>
|
| 179 |
-
|
| 180 |
-
<li class="wds-links-list-item">
|
| 181 |
-
<a class="wds-links-list-item-link" href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_onpage#tab_author-archive">
|
| 182 |
-
<span class="wds-links-list-item-label"><?php esc_html_e( 'Author Archive', 'wds' ) ?></span>
|
| 183 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 184 |
-
</a>
|
| 185 |
-
</li>
|
| 186 |
-
|
| 187 |
-
<li class="wds-links-list-item">
|
| 188 |
-
<a class="wds-links-list-item-link" href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_onpage#tab_date-archive">
|
| 189 |
-
<span class="wds-links-list-item-label"><?php esc_html_e( 'Date Archive', 'wds' ) ?></span>
|
| 190 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 191 |
-
</a>
|
| 192 |
-
</li>
|
| 193 |
-
|
| 194 |
-
<li class="wds-links-list-item">
|
| 195 |
-
<a class="wds-links-list-item-link" href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_onpage#tab_search-page">
|
| 196 |
-
<span class="wds-links-list-item-label"><?php esc_html_e( 'Search Page', 'wds' ) ?></span>
|
| 197 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 198 |
-
</a>
|
| 199 |
-
</li>
|
| 200 |
-
|
| 201 |
-
<li class="wds-links-list-item">
|
| 202 |
-
<a class="wds-links-list-item-link" href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_onpage#tab_404-page">
|
| 203 |
-
<span class="wds-links-list-item-label"><?php esc_html_e( '404 Page', 'wds' ) ?></span>
|
| 204 |
-
<span class="wds-links-list-item-edit"><?php esc_html_e( 'Edit', 'wds' ) ?></span>
|
| 205 |
-
</a>
|
| 206 |
-
</li>
|
| 207 |
-
|
| 208 |
-
</ul><!-- end wds-links-list -->
|
| 209 |
-
|
| 210 |
-
</div>
|
| 211 |
-
</div>
|
| 212 |
-
</section><!-- end box-dashboard-titles-and-meta -->
|
| 213 |
-
|
| 214 |
-
<?php } ?>
|
| 215 |
-
|
| 216 |
-
<?php } // end if tab is allowed ?>
|
| 217 |
-
|
| 218 |
-
<?php if ( ! empty( $smartcrawl_options['access-id'] ) && ! empty( $smartcrawl_options['secret-key'] ) ) { ?>
|
| 219 |
-
<section class="box-dashboard-seo-moz-stats dev-box">
|
| 220 |
-
<div class="box-title">
|
| 221 |
-
<div class="buttons buttons-icon">
|
| 222 |
-
<a href="<?php echo esc_attr( $current_admin_url ); ?>?page=wds_settings" class="edit"><span class="dashicons dashicons-admin-generic wds-dashicons wds-dashicons-link"></span></a>
|
| 223 |
-
</div>
|
| 224 |
-
<h3><span class="dashicons dashicons-chart-area wds-dashicons wds-dashicons-box-title"></span><?php esc_html_e( 'SEO Moz Stats', 'wds' ); ?></h3>
|
| 225 |
-
</div>
|
| 226 |
-
<div class="box-content"><?php Smartcrawl_Seomoz_Dashboard_Widget::widget(); ?></div>
|
| 227 |
-
</section><!-- end box-dashboard-seo-moz-stats -->
|
| 228 |
-
|
| 229 |
-
<?php } ?>
|
| 230 |
-
|
| 231 |
-
</div>
|
| 232 |
-
|
| 233 |
-
</div>
|
| 234 |
-
|
| 235 |
-
</div><!-- end container -->
|
| 236 |
-
|
| 237 |
-
<?php do_action( 'wds-dshboard-after_settings' ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/dashboard/dashboard-box-title-url-crawl-stats.php
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
if ( is_null( $report ) ) {
|
| 5 |
-
return;
|
| 6 |
-
}
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
?>
|
| 10 |
-
|
| 11 |
-
<?php if ( $active_issues > 0 ) :
|
| 12 |
-
<span class="wds-issues wds-issues-warning wds-has-tooltip"
|
| 13 |
-
data-content="<?php printf(
|
| 14 |
-
|
| 15 |
-
<?php echo $active_issues; ?>
|
| 16 |
-
</span>
|
| 17 |
-
<?php endif; ?>
|
| 1 |
+
<?php
|
| 2 |
+
$report = empty( $report ) ? null : $report;
|
| 3 |
+
|
| 4 |
+
if ( is_null( $report ) ) {
|
| 5 |
+
return;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
$active_issues = $report->get_issues_count();
|
| 9 |
+
?>
|
| 10 |
+
|
| 11 |
+
<?php if ( $active_issues > 0 ) : ?>
|
| 12 |
+
<span class="wds-issues wds-issues-warning wds-has-tooltip"
|
| 13 |
+
data-content="<?php printf( esc_attr__( 'You have %s sitemap issues', 'wds' ), intval( $active_issues ) ); ?>">
|
| 14 |
+
|
| 15 |
+
<?php echo intval( $active_issues ); ?>
|
| 16 |
+
</span>
|
| 17 |
+
<?php endif; ?>
|
includes/admin/templates/dashboard/dashboard-checkup-progress.php
CHANGED
|
@@ -1,27 +1,29 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
if ( $progress > 100 ) {
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
'
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 3 |
+
$percentage = $service->status();
|
| 4 |
+
$progress = (int) $percentage;
|
| 5 |
+
if ( $progress > 100 ) {
|
| 6 |
+
$progress = 100;
|
| 7 |
+
}
|
| 8 |
+
?>
|
| 9 |
+
<p><?php esc_html_e( 'SmartCrawl is performing a full SEO checkup which will take a few moments. You can close this page if you need to, we’ll let you know when it’s complete.', 'wds' ); ?></p>
|
| 10 |
+
<div class="wds-box-refresh-required"></div>
|
| 11 |
+
<?php
|
| 12 |
+
$this->_render( 'progress-bar', array(
|
| 13 |
+
'progress' => $progress,
|
| 14 |
+
) );
|
| 15 |
+
?>
|
| 16 |
+
|
| 17 |
+
<?php
|
| 18 |
+
if ( ! Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member() ) {
|
| 19 |
+
$this->_render( 'mascot-message', array(
|
| 20 |
+
'key' => 'dash-seo-checkup-upsell',
|
| 21 |
+
'dismissible' => false,
|
| 22 |
+
'message' => sprintf(
|
| 23 |
+
'%s <a href="#upgrade-to-pro">%s</a>',
|
| 24 |
+
esc_html__( 'Did you know with SmartCrawl Pro you can schedule automated SEO checkups and send whitelabel email reports direct to yours and your clients inboxes?', 'wds' ),
|
| 25 |
+
esc_html__( '- Try it all FREE today', 'wds' )
|
| 26 |
+
),
|
| 27 |
+
) );
|
| 28 |
+
}
|
| 29 |
+
?>
|
includes/admin/templates/dashboard/dashboard-content-analysis-readability-overview.php
CHANGED
|
@@ -1,89 +1,88 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Readability analysis dashboard widget template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
if ( ! $overview ) {
|
| 12 |
-
return;
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
if ( is_null( $total ) || is_null( $passed ) || is_null( $type_breakdown ) ) {
|
| 20 |
-
return;
|
| 21 |
-
}
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
$
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
$
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
$
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
$
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
<div class="wds-accordion">
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
<div class="wds-accordion-handle-part"
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
<th><?php esc_html_e( '
|
| 60 |
-
<th><?php esc_html_e( '
|
| 61 |
-
<th><?php esc_html_e( '
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
$
|
| 67 |
-
$
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
<td
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Readability analysis dashboard widget template
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 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 ) ) {
|
| 20 |
+
return;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
$percentage = ! empty( $total )
|
| 24 |
+
? intval( ceil( ( $passed / $total ) * 100 ) )
|
| 25 |
+
: 0;
|
| 26 |
+
|
| 27 |
+
if ( 0 === $passed && 0 === $total ) {
|
| 28 |
+
$class = 'wds-check-invalid';
|
| 29 |
+
$indicator = esc_html__( 'No data yet', 'wds' );
|
| 30 |
+
} elseif ( $percentage > 79 ) {
|
| 31 |
+
$class = 'wds-check-success';
|
| 32 |
+
$indicator = esc_html__( 'Easy', 'wds' );
|
| 33 |
+
} elseif ( $percentage > 59 ) {
|
| 34 |
+
$class = 'wds-check-warning';
|
| 35 |
+
$indicator = esc_html__( 'Difficult', 'wds' );
|
| 36 |
+
} else {
|
| 37 |
+
$class = 'wds-check-error';
|
| 38 |
+
$indicator = esc_html__( 'Difficult', 'wds' );
|
| 39 |
+
}
|
| 40 |
+
?>
|
| 41 |
+
<div class="wds-accordion wds-readability-analysis-overview">
|
| 42 |
+
<div class="wds-accordion-section wds-check-item <?php echo esc_attr( $class ); ?>">
|
| 43 |
+
|
| 44 |
+
<div class="wds-accordion-handle">
|
| 45 |
+
<div class="wds-accordion-handle-part"><?php esc_html_e( 'Overall Readability Analysis', 'wds' ); ?></div>
|
| 46 |
+
<div class="wds-accordion-handle-part">
|
| 47 |
+
<span class="wds-check-item-indicator"><?php echo esc_html( $indicator ); ?></span>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
|
| 51 |
+
<div class="wds-accordion-content">
|
| 52 |
+
<p class="wds-small-text">
|
| 53 |
+
<?php esc_html_e( "Here's a breakdown of where you can make improvements.", 'wds' ); ?>
|
| 54 |
+
</p>
|
| 55 |
+
|
| 56 |
+
<table class="wds-list-table">
|
| 57 |
+
<tr>
|
| 58 |
+
<th><?php esc_html_e( 'Post Type', 'wds' ); ?></th>
|
| 59 |
+
<th><?php esc_html_e( 'Difficult', 'wds' ); ?></th>
|
| 60 |
+
<th><?php esc_html_e( 'Okay', 'wds' ); ?></th>
|
| 61 |
+
<th><?php esc_html_e( 'Easy', 'wds' ); ?></th>
|
| 62 |
+
</tr>
|
| 63 |
+
<?php foreach ( $type_breakdown as $post_type => $type_overview ) : ?>
|
| 64 |
+
<?php
|
| 65 |
+
$difficult = intval( smartcrawl_get_array_value( $type_overview, 'error' ) );
|
| 66 |
+
$okay = intval( smartcrawl_get_array_value( $type_overview, 'warning' ) );
|
| 67 |
+
$easy = intval( smartcrawl_get_array_value( $type_overview, 'success' ) );
|
| 68 |
+
|
| 69 |
+
$edit_url = admin_url( 'edit.php?wds_readability_threshold=' );
|
| 70 |
+
?>
|
| 71 |
+
<tr>
|
| 72 |
+
<td><?php echo esc_html( $post_type ); ?></td>
|
| 73 |
+
<td>
|
| 74 |
+
<?php $difficult > 0 ? printf( '<span class="wds-issues wds-readability-difficult wds-issues-error"><a href="%s">%s</a></span>', esc_url( add_query_arg( 'post_type', $post_type, "{$edit_url}0" ) ), intval( $difficult ) ) : print( 0 ); ?>
|
| 75 |
+
</td>
|
| 76 |
+
<td>
|
| 77 |
+
<?php $okay > 0 ? printf( '<span class="wds-issues wds-readability-okay wds-issues-warning"><a href="%s">%s</a></span>', esc_url( add_query_arg( 'post_type', $post_type, "{$edit_url}1" ) ), intval( $okay ) ) : print( 0 ); ?>
|
| 78 |
+
</td>
|
| 79 |
+
<td>
|
| 80 |
+
<?php $easy > 0 ? printf( '<span class="wds-issues wds-readability-easy wds-issues-success-bg">%s</span>', intval( $easy ) ) : print( 0 ); ?>
|
| 81 |
+
</td>
|
| 82 |
+
</tr>
|
| 83 |
+
<?php endforeach; ?>
|
| 84 |
+
</table>
|
| 85 |
+
</div>
|
| 86 |
+
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
|
|
includes/admin/templates/dashboard/dashboard-content-analysis-seo-overview.php
CHANGED
|
@@ -1,83 +1,82 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* SEO analyis dashboard widget template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
if ( ! $overview ) {
|
| 12 |
-
return;
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
if ( is_null( $total ) || is_null( $passed ) || is_null( $type_breakdown ) ) {
|
| 20 |
-
return;
|
| 21 |
-
}
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
$
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
$
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
$
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
<div class="wds-accordion">
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
<div class="wds-accordion-handle-part"
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
<th><?php esc_html_e( '
|
| 57 |
-
<th><?php esc_html_e( '
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
$
|
| 63 |
-
$
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
$
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
<td
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* SEO analyis dashboard widget template
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 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 ) ) {
|
| 20 |
+
return;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
$percentage = ! empty( $total )
|
| 24 |
+
? intval( ceil( ( $passed / $total ) * 100 ) )
|
| 25 |
+
: 0;
|
| 26 |
+
|
| 27 |
+
if ( 0 === $passed && 0 === $total ) {
|
| 28 |
+
$class = 'wds-check-invalid';
|
| 29 |
+
$indicator = esc_html__( 'No data yet', 'wds' );
|
| 30 |
+
} elseif ( $percentage > 60 ) {
|
| 31 |
+
$class = 'wds-check-success';
|
| 32 |
+
$indicator = esc_html__( 'Good', 'wds' );
|
| 33 |
+
} else {
|
| 34 |
+
$class = 'wds-check-warning';
|
| 35 |
+
$indicator = esc_html__( 'Poor', 'wds' );
|
| 36 |
+
}
|
| 37 |
+
?>
|
| 38 |
+
<div class="wds-accordion wds-seo-analysis-overview">
|
| 39 |
+
<div class="wds-accordion-section wds-check-item <?php echo esc_attr( $class ); ?>">
|
| 40 |
+
|
| 41 |
+
<div class="wds-accordion-handle">
|
| 42 |
+
<div class="wds-accordion-handle-part"><?php esc_html_e( 'Overall SEO Analysis', 'wds' ); ?></div>
|
| 43 |
+
<div class="wds-accordion-handle-part">
|
| 44 |
+
<span class="wds-check-item-indicator"><?php echo esc_html( $indicator ); ?></span>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<div class="wds-accordion-content">
|
| 49 |
+
<p class="wds-small-text">
|
| 50 |
+
<?php esc_html_e( "Here's a breakdown of where you can make improvements.", 'wds' ); ?>
|
| 51 |
+
</p>
|
| 52 |
+
|
| 53 |
+
<table class="wds-list-table">
|
| 54 |
+
<tr>
|
| 55 |
+
<th><?php esc_html_e( 'Post Type', 'wds' ); ?></th>
|
| 56 |
+
<th><?php esc_html_e( 'Poor', 'wds' ); ?></th>
|
| 57 |
+
<th><?php esc_html_e( 'Good', 'wds' ); ?></th>
|
| 58 |
+
</tr>
|
| 59 |
+
<?php foreach ( $type_breakdown as $post_type => $type_overview ) : ?>
|
| 60 |
+
<?php
|
| 61 |
+
$total_for_type = intval( smartcrawl_get_array_value( $type_overview, 'total' ) );
|
| 62 |
+
$passed_for_type = intval( smartcrawl_get_array_value( $type_overview, 'passed' ) );
|
| 63 |
+
$failed_for_type = $total_for_type - $passed_for_type;
|
| 64 |
+
|
| 65 |
+
$fail_url = admin_url( "edit.php?post_type={$post_type}&wds_analysis_threshold=99" );
|
| 66 |
+
$success_url = admin_url( "edit.php?post_type={$post_type}&wds_analysis_threshold=100" );
|
| 67 |
+
?>
|
| 68 |
+
<tr>
|
| 69 |
+
<td><?php echo esc_html( $post_type ); ?></td>
|
| 70 |
+
<td>
|
| 71 |
+
<?php $failed_for_type > 0 ? printf( '<span class="wds-issues wds-seo-analysis-poor wds-issues-warning"><a href="%s">%s</a></span>', esc_url( $fail_url ), intval( $failed_for_type ) ) : print( 0 ); ?>
|
| 72 |
+
</td>
|
| 73 |
+
<td>
|
| 74 |
+
<?php $passed_for_type > 0 ? printf( '<span class="wds-issues wds-seo-analysis-good wds-issues-success-bg"><a href="%s">%s</a></span>', esc_url( $success_url ), intval( $passed_for_type ) ) : print( 0 ); ?>
|
| 75 |
+
</td>
|
| 76 |
+
</tr>
|
| 77 |
+
<?php endforeach; ?>
|
| 78 |
+
</table>
|
| 79 |
+
</div>
|
| 80 |
+
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
|
|
includes/admin/templates/dashboard/dashboard-mini-checkup-report.php
CHANGED
|
@@ -1,30 +1,31 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
?>
|
| 6 |
-
|
| 7 |
-
<?php if ( $issue_count > 0 || ! empty( $results['error'] ) ) :
|
| 8 |
-
<div class="wds-report">
|
| 9 |
-
<?php $this->_render( 'checkup/checkup-checkup-results', array( 'show_upsell_message' => false ) ); ?>
|
| 10 |
-
</div>
|
| 11 |
-
<?php else : ?>
|
| 12 |
-
<p><?php esc_html_e( 'A comprehensive report on how optimized your website is for search engines and social media.', 'wds' ); ?></p>
|
| 13 |
-
<?php
|
| 14 |
-
$this->_render('notice', array(
|
| 15 |
-
'message' => esc_html__( 'You have no outstanding SEO issues. Awesome work!', 'wds' ),
|
| 16 |
-
'class' => 'wds-notice-success',
|
| 17 |
-
));
|
| 18 |
-
?>
|
| 19 |
-
<?php endif; ?>
|
| 20 |
-
|
| 21 |
-
<div class="wds-box-report-details wds-box-footer">
|
| 22 |
-
<a href="<?php echo esc_attr( $page_url ); ?>#tab_checkup"
|
| 23 |
-
class="button button-small button-dark button-dark-o wds-dash-view-report-button">
|
| 24 |
-
|
| 25 |
-
<?php esc_html_e( 'View Report', 'wds' ); ?>
|
| 26 |
-
</a>
|
| 27 |
-
<?php if ( ! empty( $reporting_enabled ) ) :
|
| 28 |
-
<span
|
| 29 |
-
|
| 30 |
-
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$results = empty( $results ) ? null : $results;
|
| 3 |
+
$issue_count = empty( $issue_count ) ? 0 : $issue_count;
|
| 4 |
+
$page_url = ! empty( $page_url ) ? $page_url : Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_CHECKUP );
|
| 5 |
+
?>
|
| 6 |
+
|
| 7 |
+
<?php if ( $issue_count > 0 || ! empty( $results['error'] ) ) : ?>
|
| 8 |
+
<div class="wds-report">
|
| 9 |
+
<?php $this->_render( 'checkup/checkup-checkup-results', array( 'show_upsell_message' => false ) ); ?>
|
| 10 |
+
</div>
|
| 11 |
+
<?php else : ?>
|
| 12 |
+
<p><?php esc_html_e( 'A comprehensive report on how optimized your website is for search engines and social media.', 'wds' ); ?></p>
|
| 13 |
+
<?php
|
| 14 |
+
$this->_render( 'notice', array(
|
| 15 |
+
'message' => esc_html__( 'You have no outstanding SEO issues. Awesome work!', 'wds' ),
|
| 16 |
+
'class' => 'wds-notice-success',
|
| 17 |
+
) );
|
| 18 |
+
?>
|
| 19 |
+
<?php endif; ?>
|
| 20 |
+
|
| 21 |
+
<div class="wds-box-report-details wds-box-footer">
|
| 22 |
+
<a href="<?php echo esc_attr( $page_url ); ?>#tab_checkup"
|
| 23 |
+
class="button button-small button-dark button-dark-o wds-dash-view-report-button">
|
| 24 |
+
|
| 25 |
+
<?php esc_html_e( 'View Report', 'wds' ); ?>
|
| 26 |
+
</a>
|
| 27 |
+
<?php if ( ! empty( $reporting_enabled ) ) : ?>
|
| 28 |
+
<span
|
| 29 |
+
class="wds-box-stat-value wds-box-stat-value-success"><?php esc_html_e( 'Automatic checkups are enabled', 'wds' ); ?></span>
|
| 30 |
+
<?php endif; ?>
|
| 31 |
+
</div>
|
includes/admin/templates/dashboard/dashboard-top.php
CHANGED
|
@@ -1,85 +1,113 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
<?php esc_html_e( '
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
<?php
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
<
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 3 |
+
$last_checked = (boolean) $service->get_last_checked_timestamp();
|
| 4 |
+
$in_progress = $service->in_progress();
|
| 5 |
+
$last_checked_timestamp = $service->get_last_checked( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) );
|
| 6 |
+
$checkup_url = Smartcrawl_Settings_Dashboard::checkup_url();
|
| 7 |
+
$options = $_view['options'];
|
| 8 |
+
$option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
|
| 9 |
+
$sitemap_enabled = smartcrawl_get_array_value( $options, 'sitemap' );
|
| 10 |
+
$results = $last_checked ? $service->result() : array();
|
| 11 |
+
$counts = smartcrawl_get_array_value( $results, 'counts' );
|
| 12 |
+
$score = smartcrawl_get_array_value( $results, 'score' );
|
| 13 |
+
$checkup_enabled = smartcrawl_get_array_value( $options, 'checkup' );
|
| 14 |
+
$dependents = array( Smartcrawl_Settings_Dashboard::BOX_SITEMAP, Smartcrawl_Settings_Dashboard::BOX_SEO_CHECKUP );
|
| 15 |
+
$dependents_attr = implode( ';', $dependents );
|
| 16 |
+
|
| 17 |
+
$issue_count = 0;
|
| 18 |
+
if ( null === $score || false === $score ) {
|
| 19 |
+
$score_class = 'wds-score-invalid';
|
| 20 |
+
} else {
|
| 21 |
+
$issue_count = intval( smartcrawl_get_array_value( $counts, 'warning' ) ) + intval( smartcrawl_get_array_value( $counts, 'critical' ) );
|
| 22 |
+
$score_class = $issue_count > 0 ? 'wds-score-warning' : 'wds-score-success';
|
| 23 |
+
}
|
| 24 |
+
?>
|
| 25 |
+
|
| 26 |
+
<section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>"
|
| 27 |
+
class="wds-seo-checkup-stats wds-report-stats wds-dash-stats dev-box"
|
| 28 |
+
data-issue-count="<?php echo intval( $issue_count ); ?>"
|
| 29 |
+
data-dependent="<?php echo esc_attr( $dependents_attr ); ?>">
|
| 30 |
+
|
| 31 |
+
<div class="wds-report-score">
|
| 32 |
+
<?php if ( ! $checkup_enabled ): ?>
|
| 33 |
+
<div class="wds-last-checkup-never">
|
| 34 |
+
<span class="wds-strong-text"><?php esc_html_e( 'Welcome!', 'wds' ); ?></span>
|
| 35 |
+
<p class="wds-small-text">
|
| 36 |
+
<?php esc_html_e( 'Activate SEO checkup to see what needs improving!', 'wds' ); ?>
|
| 37 |
+
</p>
|
| 38 |
+
<button type="button"
|
| 39 |
+
data-option-id="<?php echo esc_attr( $option_name ); ?>"
|
| 40 |
+
data-flag="<?php echo esc_attr( 'checkup' ); ?>"
|
| 41 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 42 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 43 |
+
</button>
|
| 44 |
+
</div>
|
| 45 |
+
<?php elseif ( $in_progress ) : ?>
|
| 46 |
+
<div class="wds-last-checkup-never">
|
| 47 |
+
<span class="wds-strong-text"><?php esc_html_e( 'Welcome!', 'wds' ); ?></span>
|
| 48 |
+
<p class="wds-small-text">
|
| 49 |
+
<?php esc_html_e( 'Please wait while we finish the checkup ...', 'wds' ); ?>
|
| 50 |
+
</p>
|
| 51 |
+
<div class="wds-box-refresh-required"></div>
|
| 52 |
+
</div>
|
| 53 |
+
<?php elseif ( ! $last_checked ) : ?>
|
| 54 |
+
<div class="wds-last-checkup-never">
|
| 55 |
+
<span class="wds-strong-text"><?php esc_html_e( 'Welcome!', 'wds' ); ?></span>
|
| 56 |
+
<p class="wds-small-text">
|
| 57 |
+
<?php esc_html_e( 'Run your first SEO checkup to see what needs improving!', 'wds' ); ?>
|
| 58 |
+
</p>
|
| 59 |
+
<a href="<?php echo esc_attr( $checkup_url ); ?>"
|
| 60 |
+
class="button button-small">
|
| 61 |
+
|
| 62 |
+
<?php esc_html_e( 'Run checkup', 'wds' ); ?>
|
| 63 |
+
</a>
|
| 64 |
+
</div>
|
| 65 |
+
<?php else : ?>
|
| 66 |
+
<div class="wds-score <?php echo esc_attr( $score_class ); ?>">
|
| 67 |
+
<?php echo esc_html( intval( $score ) ); ?><span
|
| 68 |
+
class="wds-total"><?php esc_html_e( '/100', 'wds' ); ?></span>
|
| 69 |
+
</div>
|
| 70 |
+
<div class="wds-small-text"><?php esc_html_e( 'Current SEO Score', 'wds' ); ?></div>
|
| 71 |
+
<?php endif; ?>
|
| 72 |
+
</div>
|
| 73 |
+
|
| 74 |
+
<div>
|
| 75 |
+
<div class="wds-stacked-stats">
|
| 76 |
+
<div>
|
| 77 |
+
<div class="wds-stat-name"><?php esc_html_e( 'Last checkup:', 'wds' ); ?></div>
|
| 78 |
+
<div class="wds-stat-value">
|
| 79 |
+
<?php echo $in_progress ? esc_html__( 'In Progress', 'wds' ) : esc_html( $last_checked_timestamp ); ?>
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
|
| 83 |
+
<div>
|
| 84 |
+
<div class="wds-stat-name"><?php esc_html_e( 'Sitemap:', 'wds' ); ?></div>
|
| 85 |
+
<div class="wds-stat-value">
|
| 86 |
+
<?php if ( $sitemap_enabled ) : ?>
|
| 87 |
+
|
| 88 |
+
<?php
|
| 89 |
+
$this->_render( 'url-crawl-master', array(
|
| 90 |
+
'ready_template' => 'dashboard/dashboard-url-crawl-stats',
|
| 91 |
+
'progress_template' => 'dashboard/dashboard-url-crawl-in-progress-small',
|
| 92 |
+
'no_data_template' => 'dashboard/dashboard-url-crawl-no-data-small',
|
| 93 |
+
) );
|
| 94 |
+
?>
|
| 95 |
+
|
| 96 |
+
<?php else : ?>
|
| 97 |
+
|
| 98 |
+
<button type="button"
|
| 99 |
+
data-option-id="<?php echo esc_attr( $option_name ); ?>"
|
| 100 |
+
data-flag="<?php echo 'sitemap'; ?>"
|
| 101 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-left-loader wds-disabled-during-request">
|
| 102 |
+
|
| 103 |
+
<?php esc_html_e( 'Activate Sitemap', 'wds' ); ?>
|
| 104 |
+
</button>
|
| 105 |
+
|
| 106 |
+
<?php endif; ?>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
</section>
|
includes/admin/templates/dashboard/dashboard-url-crawl-in-progress.php
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
?>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
<?php
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
?>
|
| 1 |
+
<?php
|
| 2 |
+
$progress = empty( $progress ) ? 0 : $progress;
|
| 3 |
+
?>
|
| 4 |
+
<div class="wds-box-refresh-required"></div>
|
| 5 |
+
<p class="wds-small-text"><?php esc_html_e( 'SmartCrawl is performing a URL crawl, please wait…', 'wds' ); ?></p>
|
| 6 |
+
|
| 7 |
+
<?php
|
| 8 |
+
$this->_render( 'progress-bar', array(
|
| 9 |
+
'progress' => $progress,
|
| 10 |
+
) );
|
| 11 |
+
?>
|
includes/admin/templates/dashboard/dashboard-url-crawl-no-data-small.php
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
<div class="wds-box-crawl-stats">
|
| 2 |
-
<span class="wds-issues wds-issues-invalid">
|
| 3 |
-
<?php esc_html_e( 'No Data Available', 'wds' ) ?>
|
| 4 |
-
</span>
|
| 5 |
-
</div>
|
| 1 |
+
<div class="wds-box-crawl-stats">
|
| 2 |
+
<span class="wds-issues wds-issues-invalid">
|
| 3 |
+
<?php esc_html_e( 'No Data Available', 'wds' ); ?>
|
| 4 |
+
</span>
|
| 5 |
+
</div>
|
includes/admin/templates/dashboard/dashboard-url-crawl-stats.php
CHANGED
|
@@ -1,23 +1,24 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
if ( is_null( $report ) ) {
|
| 5 |
-
return;
|
| 6 |
-
}
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
?>
|
| 11 |
-
|
| 12 |
-
<?php if ( $active_issues > 0 ) :
|
| 13 |
-
<div class="wds-box-crawl-stats">
|
| 14 |
-
<span class="wds-issues wds-issues-warning wds-has-tooltip"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
<?php echo $active_issues; ?><?php esc_html_e( ' issues', 'wds' ); ?>
|
| 18 |
-
</span>
|
| 19 |
-
<span
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$report = empty( $report ) ? null : $report;
|
| 3 |
+
|
| 4 |
+
if ( is_null( $report ) ) {
|
| 5 |
+
return;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
$active_issues = $report->get_issues_count();
|
| 9 |
+
$missing_urls = $report->get_issues_count( 'sitemap' );
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<?php if ( $active_issues > 0 ) : ?>
|
| 13 |
+
<div class="wds-box-crawl-stats">
|
| 14 |
+
<span class="wds-issues wds-issues-warning wds-has-tooltip"
|
| 15 |
+
data-content="<?php printf( esc_attr__( 'You have %s sitemap issues', 'wds' ), intval( $active_issues ) ); ?>">
|
| 16 |
+
|
| 17 |
+
<?php echo intval( $active_issues ); ?><?php esc_html_e( ' issues', 'wds' ); ?>
|
| 18 |
+
</span>
|
| 19 |
+
<span
|
| 20 |
+
class="wds-issues wds-issues-invalid"><?php echo intval( $missing_urls ); ?><?php esc_html_e( ' missing URLs', 'wds' ); ?></span>
|
| 21 |
+
</div>
|
| 22 |
+
<?php else : ?>
|
| 23 |
+
<span class="wds-box-stat-value wds-box-stat-value-success"><?php esc_html_e( 'No issues', 'wds' ); ?></span>
|
| 24 |
+
<?php endif; ?>
|
includes/admin/templates/dashboard/dashboard-widget-advanced-tools.php
CHANGED
|
@@ -1,106 +1,112 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
<span class="wds-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
</
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
<
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
<?php
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
<?php
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
if ( ! smartcrawl_subsite_setting_page_enabled( 'wds_autolinks' ) ) {
|
| 3 |
+
return;
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
$page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_AUTOLINKS );
|
| 7 |
+
|
| 8 |
+
$redirection_model = new Smartcrawl_Model_Redirection();
|
| 9 |
+
$redirection_count = count( $redirection_model->get_all_redirections() );
|
| 10 |
+
|
| 11 |
+
$option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
|
| 12 |
+
$options = $_view['options'];
|
| 13 |
+
$autolinking_enabled = smartcrawl_get_array_value( $options, 'autolinks' );
|
| 14 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 15 |
+
$is_member = $service->is_member();
|
| 16 |
+
$moz_connected = ! empty( $options['access-id'] ) && ! empty( $options['secret-key'] );
|
| 17 |
+
?>
|
| 18 |
+
|
| 19 |
+
<section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_ADVANCED_TOOLS ); ?>" class="dev-box">
|
| 20 |
+
<div class="box-title">
|
| 21 |
+
<div class="buttons buttons-icon">
|
| 22 |
+
<a href="<?php echo esc_attr( $page_url ); ?>" class="wds-settings-link">
|
| 23 |
+
<i class="wds-icon-arrow-right-carats"></i>
|
| 24 |
+
</a>
|
| 25 |
+
</div>
|
| 26 |
+
<h3>
|
| 27 |
+
<i class="wds-icon-wand-magic"></i> <?php esc_html_e( 'Advanced Tools', 'wds' ); ?>
|
| 28 |
+
</h3>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
<div class="box-content">
|
| 32 |
+
<p><?php esc_html_e( 'Advanced tools focus on the finer details of SEO including internal linking, redirections and Moz analysis.', 'wds' ); ?></p>
|
| 33 |
+
|
| 34 |
+
<div class="wds-separator-top">
|
| 35 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'URL Redirects', 'wds' ); ?></strong></span>
|
| 36 |
+
<span class="wds-box-stat-value"><?php echo esc_html( $redirection_count ); ?>
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
<div class="wds-separator-top cf">
|
| 40 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'Moz Integration', 'wds' ); ?></strong></span>
|
| 41 |
+
|
| 42 |
+
<?php if ( $moz_connected ) : ?>
|
| 43 |
+
<span class="wds-box-stat-value">
|
| 44 |
+
<a href="<?php echo esc_attr( $page_url ); ?>#tab_moz"
|
| 45 |
+
class="button button-small button-dark button-dark-o">
|
| 46 |
+
|
| 47 |
+
<?php esc_html_e( 'View Report', 'wds' ); ?>
|
| 48 |
+
</a>
|
| 49 |
+
</span>
|
| 50 |
+
<?php else : ?>
|
| 51 |
+
<p class="wds-small-text">
|
| 52 |
+
<?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' ); ?>
|
| 53 |
+
</p>
|
| 54 |
+
<a href="<?php echo esc_attr( $page_url ); ?>#tab_moz"
|
| 55 |
+
class="button button-small">
|
| 56 |
+
|
| 57 |
+
<?php esc_html_e( 'Connect', 'wds' ); ?>
|
| 58 |
+
</a>
|
| 59 |
+
<?php endif; ?>
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
<div
|
| 63 |
+
class="wds-separator-top wds-autolinking-section <?php echo ! $is_member ? 'wds-box-blocked-area' : ''; ?>">
|
| 64 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'Automatic Linking', 'wds' ); ?></strong></span>
|
| 65 |
+
<?php if ( $autolinking_enabled && $is_member ) : ?>
|
| 66 |
+
<span
|
| 67 |
+
class="wds-box-stat-value wds-box-stat-value-success"><?php esc_html_e( 'Active', 'wds' ); ?></span>
|
| 68 |
+
<?php else : ?>
|
| 69 |
+
<p class="wds-small-text">
|
| 70 |
+
<?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' ); ?>
|
| 71 |
+
</p>
|
| 72 |
+
<button type="button"
|
| 73 |
+
data-option-id="<?php echo esc_attr( $option_name ); ?>"
|
| 74 |
+
data-flag="<?php echo 'autolinks'; ?>"
|
| 75 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 76 |
+
|
| 77 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 78 |
+
</button>
|
| 79 |
+
<?php if ( ! $is_member ) : ?>
|
| 80 |
+
<button class="wds-upgrade-button button-pro wds-has-tooltip"
|
| 81 |
+
data-content="<?php esc_attr_e( 'Get SmartCrawl Pro today Free', 'wds' ); ?>"
|
| 82 |
+
type="button">
|
| 83 |
+
<?php esc_html_e( 'Pro feature', 'wds' ); ?>
|
| 84 |
+
</button>
|
| 85 |
+
<?php endif; ?>
|
| 86 |
+
<?php endif; ?>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
<div class="wds-box-footer" style="margin-top: 0;">
|
| 90 |
+
<a href="<?php echo esc_attr( $page_url ); ?>"
|
| 91 |
+
class="button button-small button-dark button-dark-o wds-dash-configure-button">
|
| 92 |
+
|
| 93 |
+
<?php esc_html_e( 'Configure', 'wds' ); ?>
|
| 94 |
+
</a>
|
| 95 |
+
|
| 96 |
+
<?php
|
| 97 |
+
if ( ! $is_member ) {
|
| 98 |
+
|
| 99 |
+
$this->_render( 'mascot-message', array(
|
| 100 |
+
'key' => 'seo-checkup-upsell',
|
| 101 |
+
'dismissible' => false,
|
| 102 |
+
'message' => sprintf(
|
| 103 |
+
'%s <a href="#upgrade-to-pro">%s</a>',
|
| 104 |
+
esc_html__( 'Upgrade to Pro and automatically link your articles both internally and externally with automatic linking - a favourite among SEO pros.', 'wds' ),
|
| 105 |
+
esc_html__( '- Try SmartCrawl Pro FREE today!', 'wds' )
|
| 106 |
+
),
|
| 107 |
+
) );
|
| 108 |
+
}
|
| 109 |
+
?>
|
| 110 |
+
</div>
|
| 111 |
+
</div>
|
| 112 |
+
</section>
|
includes/admin/templates/dashboard/dashboard-widget-content-analysis.php
CHANGED
|
@@ -1,79 +1,85 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
if ( $refresh_required ) {
|
| 11 |
-
$classes[] = 'wds-box-refresh-required';
|
| 12 |
-
}
|
| 13 |
-
if ( $seo_analysis_enabled ) {
|
| 14 |
-
$classes[] = 'wds-seo-analysis-enabled';
|
| 15 |
-
}
|
| 16 |
-
if ( $readability_analysis_enabled ) {
|
| 17 |
-
$classes[] = 'wds-readability-analysis-enabled';
|
| 18 |
-
}
|
| 19 |
-
?>
|
| 20 |
-
|
| 21 |
-
<section id="<?php echo Smartcrawl_Settings_Dashboard::BOX_CONTENT_ANALYSIS; ?>"
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
<div class="box-title">
|
| 25 |
-
<h3>
|
| 26 |
-
<i class="wds-icon-magnifying-glass-search"></i> <?php esc_html_e( 'Content Analysis', 'wds' ); ?>
|
| 27 |
-
</h3>
|
| 28 |
-
</div>
|
| 29 |
-
|
| 30 |
-
<div class="box-content">
|
| 31 |
-
<p><?php esc_html_e( 'SEO and Readability Analysis recommend improvements to your content to give it the best chance of ranking highly, as well as being easy for average person to read.', 'wds' ); ?></p>
|
| 32 |
-
|
| 33 |
-
<div class="wds-report">
|
| 34 |
-
<?php if ( $seo_analysis_enabled ) :
|
| 35 |
-
<?php if ( $is_ajax_request )
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$options = $_view['options'];
|
| 3 |
+
$seo_analysis_enabled = smartcrawl_get_array_value( $options, 'analysis-seo' );
|
| 4 |
+
$readability_analysis_enabled = smartcrawl_get_array_value( $options, 'analysis-readability' );
|
| 5 |
+
$option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
|
| 6 |
+
$is_ajax_request = defined( 'DOING_AJAX' ) && DOING_AJAX;
|
| 7 |
+
$refresh_required = ! $is_ajax_request && ( $seo_analysis_enabled || $readability_analysis_enabled );
|
| 8 |
+
|
| 9 |
+
$classes = array();
|
| 10 |
+
if ( $refresh_required ) {
|
| 11 |
+
$classes[] = 'wds-box-refresh-required';
|
| 12 |
+
}
|
| 13 |
+
if ( $seo_analysis_enabled ) {
|
| 14 |
+
$classes[] = 'wds-seo-analysis-enabled';
|
| 15 |
+
}
|
| 16 |
+
if ( $readability_analysis_enabled ) {
|
| 17 |
+
$classes[] = 'wds-readability-analysis-enabled';
|
| 18 |
+
}
|
| 19 |
+
?>
|
| 20 |
+
|
| 21 |
+
<section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_CONTENT_ANALYSIS ); ?>"
|
| 22 |
+
class="dev-box <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
|
| 23 |
+
|
| 24 |
+
<div class="box-title">
|
| 25 |
+
<h3>
|
| 26 |
+
<i class="wds-icon-magnifying-glass-search"></i> <?php esc_html_e( 'Content Analysis', 'wds' ); ?>
|
| 27 |
+
</h3>
|
| 28 |
+
</div>
|
| 29 |
+
|
| 30 |
+
<div class="box-content">
|
| 31 |
+
<p><?php esc_html_e( 'SEO and Readability Analysis recommend improvements to your content to give it the best chance of ranking highly, as well as being easy for average person to read.', 'wds' ); ?></p>
|
| 32 |
+
|
| 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">
|
| 40 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'SEO Analysis', 'wds' ); ?></strong></span>
|
| 41 |
+
<p class="wds-small-text">
|
| 42 |
+
<?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' ); ?>
|
| 43 |
+
</p>
|
| 44 |
+
<button type="button"
|
| 45 |
+
id="wds-activate-analysis-seo"
|
| 46 |
+
data-option-id="<?php echo esc_attr( $option_name ); ?>"
|
| 47 |
+
data-flag="analysis-seo"
|
| 48 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 49 |
+
|
| 50 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 51 |
+
</button>
|
| 52 |
+
</div>
|
| 53 |
+
<?php endif; ?>
|
| 54 |
+
|
| 55 |
+
<?php if ( $readability_analysis_enabled ) : ?>
|
| 56 |
+
<?php if ( $is_ajax_request ) : ?>
|
| 57 |
+
<?php $this->_render( 'dashboard/dashboard-content-analysis-readability-overview' ); ?>
|
| 58 |
+
<?php endif; ?>
|
| 59 |
+
<?php else : ?>
|
| 60 |
+
<div class="wds-separator-top">
|
| 61 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'Readability Analysis', 'wds' ); ?></strong></span>
|
| 62 |
+
<p class="wds-small-text">
|
| 63 |
+
<?php esc_html_e( 'Benchmarks the readability of your content for the average visitor and gives recommendations for improvement.', 'wds' ); ?>
|
| 64 |
+
</p>
|
| 65 |
+
<button type="button"
|
| 66 |
+
id="wds-activate-analysis-readability"
|
| 67 |
+
data-option-id="<?php echo esc_attr( $option_name ); ?>"
|
| 68 |
+
data-flag="analysis-readability"
|
| 69 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 70 |
+
|
| 71 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 72 |
+
</button>
|
| 73 |
+
</div>
|
| 74 |
+
<?php endif; ?>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<div class="wds-box-footer">
|
| 78 |
+
<a href="<?php echo esc_attr( admin_url( 'edit.php' ) ); ?>"
|
| 79 |
+
class="button button-small button-dark button-dark-o wds-dash-edit-posts-button">
|
| 80 |
+
|
| 81 |
+
<?php esc_html_e( 'Edit Posts', 'wds' ); ?>
|
| 82 |
+
</a>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
</section>
|
includes/admin/templates/dashboard/dashboard-widget-onpage.php
CHANGED
|
@@ -1,54 +1,60 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
<span class="wds-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
if ( ! smartcrawl_subsite_setting_page_enabled( 'wds_onpage' ) ) {
|
| 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_get_array_value( $options, 'onpage' );
|
| 12 |
+
?>
|
| 13 |
+
<section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_ONPAGE ); ?>" class="dev-box">
|
| 14 |
+
<div class="box-title">
|
| 15 |
+
<?php if ( $onpage_enabled ) : ?>
|
| 16 |
+
<div class="buttons buttons-icon">
|
| 17 |
+
<a href="<?php echo esc_attr( $page_url ); ?>">
|
| 18 |
+
<i class="wds-icon-arrow-right-carats"></i>
|
| 19 |
+
</a>
|
| 20 |
+
</div>
|
| 21 |
+
<?php endif; ?>
|
| 22 |
+
<h3>
|
| 23 |
+
<i class="wds-icon-pencil"></i> <?php esc_html_e( 'Titles & Meta', 'wds' ); ?>
|
| 24 |
+
</h3>
|
| 25 |
+
</div>
|
| 26 |
+
|
| 27 |
+
<div class="box-content">
|
| 28 |
+
<p><?php esc_html_e( 'Control how your website’s pages, posts and custom post types appear in search engines like Google and Bing.', 'wds' ); ?></p>
|
| 29 |
+
|
| 30 |
+
<?php if ( $onpage_enabled ) : ?>
|
| 31 |
+
<div class="wds-separator-top">
|
| 32 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'Homepage', 'wds' ); ?></strong></span>
|
| 33 |
+
<span class="wds-box-stat-value">
|
| 34 |
+
<?php 'page' === $show_on_front ? esc_html_e( 'A Static Page', 'wds' ) : esc_html_e( 'Latest Posts', 'wds' ); ?>
|
| 35 |
+
</span>
|
| 36 |
+
</div>
|
| 37 |
+
|
| 38 |
+
<div class="wds-separator-top">
|
| 39 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'Public post types', 'wds' ); ?></strong></span>
|
| 40 |
+
<span class="wds-box-stat-value"><?php echo esc_html( count( $public_post_types ) ); ?></span>
|
| 41 |
+
</div>
|
| 42 |
+
|
| 43 |
+
<div class="wds-box-footer">
|
| 44 |
+
<a href="<?php echo esc_attr( $page_url ); ?>"
|
| 45 |
+
class="button button-small button-dark button-dark-o wds-dash-configure-button">
|
| 46 |
+
|
| 47 |
+
<?php esc_html_e( 'Configure', 'wds' ); ?>
|
| 48 |
+
</a>
|
| 49 |
+
</div>
|
| 50 |
+
<?php else : ?>
|
| 51 |
+
<button type="button"
|
| 52 |
+
data-option-id="<?php echo esc_attr( $option_name ); ?>"
|
| 53 |
+
data-flag="<?php echo esc_attr( 'onpage' ); ?>"
|
| 54 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 55 |
+
|
| 56 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 57 |
+
</button>
|
| 58 |
+
<?php endif; ?>
|
| 59 |
+
</div>
|
| 60 |
+
</section>
|
includes/admin/templates/dashboard/dashboard-widget-seo-checkup.php
CHANGED
|
@@ -1,72 +1,78 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
<?php
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
<?php
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
if ( ! smartcrawl_subsite_setting_page_enabled( 'wds_checkup' ) ) {
|
| 3 |
+
return;
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
$page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_CHECKUP );
|
| 7 |
+
$checkup_url = Smartcrawl_Settings_Dashboard::checkup_url();
|
| 8 |
+
/**
|
| 9 |
+
* @var $service Smartcrawl_Checkup_Service
|
| 10 |
+
*/
|
| 11 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 12 |
+
$options = $_view['options'];
|
| 13 |
+
$reporting_enabled = smartcrawl_get_array_value( $options, 'checkup-cron-enable' );
|
| 14 |
+
$last_checked = (boolean) $service->get_last_checked_timestamp();
|
| 15 |
+
$in_progress = $last_checked ? false : $service->in_progress();
|
| 16 |
+
$option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
|
| 17 |
+
$checkup_enabled = smartcrawl_get_array_value( $options, 'checkup' );
|
| 18 |
+
$checkup_text = esc_html__( 'Get a comprehensive report on how optimized your website is for search engines and social media. We recommend running this checkup first to see what needs improving.', 'wds' );
|
| 19 |
+
$results = $in_progress ? array() : $service->result();
|
| 20 |
+
$counts = smartcrawl_get_array_value( $results, 'counts' );
|
| 21 |
+
$issue_count = intval( smartcrawl_get_array_value( $counts, 'warning' ) ) + intval( smartcrawl_get_array_value( $counts, 'critical' ) );
|
| 22 |
+
?>
|
| 23 |
+
<section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SEO_CHECKUP ); ?>"
|
| 24 |
+
data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>"
|
| 25 |
+
class="dev-box">
|
| 26 |
+
<div class="box-title">
|
| 27 |
+
<?php if ( $checkup_enabled ) : ?>
|
| 28 |
+
<div class="buttons buttons-icon">
|
| 29 |
+
<a href="<?php echo esc_attr( $page_url ); ?>">
|
| 30 |
+
<i class="wds-icon-arrow-right-carats"></i>
|
| 31 |
+
</a>
|
| 32 |
+
</div>
|
| 33 |
+
<?php endif; ?>
|
| 34 |
+
<h3>
|
| 35 |
+
<i class="wds-icon-icon-smart-crawl"></i> <?php esc_html_e( 'SEO Checkup', 'wds' ); ?>
|
| 36 |
+
<?php if ( $issue_count > 0 && $checkup_enabled ) : ?>
|
| 37 |
+
<span class="wds-issues wds-issues-warning wds-has-tooltip"
|
| 38 |
+
data-content="<?php printf( esc_attr__( 'You have %s outstanding SEO issues to fix up', 'wds' ), intval( $issue_count ) ); ?>">
|
| 39 |
+
<?php echo intval( $issue_count ); ?>
|
| 40 |
+
</span>
|
| 41 |
+
<?php endif; ?>
|
| 42 |
+
</h3>
|
| 43 |
+
</div>
|
| 44 |
+
<div class="box-content">
|
| 45 |
+
<?php if ( $checkup_enabled ) : ?>
|
| 46 |
+
<?php
|
| 47 |
+
if ( ! $last_checked && ! $in_progress ) {
|
| 48 |
+
?>
|
| 49 |
+
<p><?php echo esc_html( $checkup_text ); ?></p>
|
| 50 |
+
|
| 51 |
+
<div class="wds-box-footer">
|
| 52 |
+
<a href="<?php echo esc_attr( $checkup_url ); ?>"
|
| 53 |
+
class="button button-small">
|
| 54 |
+
<?php esc_html_e( 'Run checkup', 'wds' ); ?>
|
| 55 |
+
</a>
|
| 56 |
+
</div>
|
| 57 |
+
<?php
|
| 58 |
+
} elseif ( $service->in_progress() ) {
|
| 59 |
+
$this->_render( 'dashboard/dashboard-checkup-progress' );
|
| 60 |
+
} else {
|
| 61 |
+
$this->_render( 'dashboard/dashboard-mini-checkup-report', array(
|
| 62 |
+
'results' => $results,
|
| 63 |
+
'issue_count' => $issue_count,
|
| 64 |
+
) );
|
| 65 |
+
}
|
| 66 |
+
?>
|
| 67 |
+
<?php else : ?>
|
| 68 |
+
<p><?php echo esc_html( $checkup_text ); ?></p>
|
| 69 |
+
<button type="button"
|
| 70 |
+
data-option-id="<?php echo esc_attr( $option_name ); ?>"
|
| 71 |
+
data-flag="<?php echo esc_attr( 'checkup' ); ?>"
|
| 72 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 73 |
+
|
| 74 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 75 |
+
</button>
|
| 76 |
+
<?php endif; ?>
|
| 77 |
+
</div>
|
| 78 |
+
</section>
|
includes/admin/templates/dashboard/dashboard-widget-sitemap.php
CHANGED
|
@@ -1,105 +1,111 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
<?php
|
| 85 |
-
<
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
if ( ! smartcrawl_subsite_setting_page_enabled( 'wds_sitemap' ) ) {
|
| 3 |
+
return;
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
$page_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SITEMAP );
|
| 7 |
+
$options = $_view['options'];
|
| 8 |
+
$sitemap_enabled = smartcrawl_get_array_value( $options, 'sitemap' );
|
| 9 |
+
$option_name = Smartcrawl_Settings::TAB_SETTINGS . '_options';
|
| 10 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_CHECKUP );
|
| 11 |
+
$is_member = $service->is_member();
|
| 12 |
+
?>
|
| 13 |
+
<section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SITEMAP ); ?>"
|
| 14 |
+
class="dev-box"
|
| 15 |
+
data-dependent="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_TOP_STATS ); ?>">
|
| 16 |
+
|
| 17 |
+
<div class="box-title">
|
| 18 |
+
<div class="buttons buttons-icon">
|
| 19 |
+
<a href="<?php echo esc_attr( $page_url ); ?>">
|
| 20 |
+
<i class="wds-icon-arrow-right-carats"></i>
|
| 21 |
+
</a>
|
| 22 |
+
</div>
|
| 23 |
+
<h3>
|
| 24 |
+
<i class="wds-icon-web-globe-world"></i> <?php esc_html_e( 'Sitemap', 'wds' ); ?>
|
| 25 |
+
<?php
|
| 26 |
+
if ( $sitemap_enabled ) {
|
| 27 |
+
$this->_render( 'url-crawl-master', array(
|
| 28 |
+
'ready_template' => 'dashboard/dashboard-box-title-url-crawl-stats',
|
| 29 |
+
) );
|
| 30 |
+
}
|
| 31 |
+
?>
|
| 32 |
+
</h3>
|
| 33 |
+
</div>
|
| 34 |
+
<div class="box-content">
|
| 35 |
+
<p><?php esc_html_e( 'Automatically generate detailed sitemaps to tell search engines what content you want them to crawl and index.', 'wds' ); ?></p>
|
| 36 |
+
|
| 37 |
+
<div class="wds-separator-top">
|
| 38 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'XML Sitemap', 'wds' ); ?></strong></span>
|
| 39 |
+
<?php if ( $sitemap_enabled ) : ?>
|
| 40 |
+
|
| 41 |
+
<?php
|
| 42 |
+
$this->_render( 'notice', array(
|
| 43 |
+
'class' => 'wds-notice-success',
|
| 44 |
+
'message' => sprintf(
|
| 45 |
+
__( 'Your sitemap is available at %s', 'wds' ),
|
| 46 |
+
sprintf( '<a target="_blank" href="%s">/sitemap.xml</a>', esc_attr( smartcrawl_get_sitemap_url() ) )
|
| 47 |
+
),
|
| 48 |
+
) );
|
| 49 |
+
?>
|
| 50 |
+
|
| 51 |
+
<?php else : ?>
|
| 52 |
+
<p class="wds-small-text">
|
| 53 |
+
<?php esc_html_e( 'Enables an XML page that search engines will use to crawl and index your website pages.', 'wds' ); ?>
|
| 54 |
+
</p>
|
| 55 |
+
|
| 56 |
+
<?php
|
| 57 |
+
$this->_render( 'dismissable-notice', array(
|
| 58 |
+
'key' => 'dashboard-sitemap-disabled-warning',
|
| 59 |
+
'message' => __( 'Your sitemap is currently disabled. We highly recommend you enable this feature if you don’t already have a sitemap.', 'wds' ),
|
| 60 |
+
'class' => 'wds-notice-warning',
|
| 61 |
+
) );
|
| 62 |
+
?>
|
| 63 |
+
<button type="button"
|
| 64 |
+
data-option-id="<?php echo esc_attr( $option_name ); ?>"
|
| 65 |
+
data-flag="<?php echo 'sitemap'; ?>"
|
| 66 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 67 |
+
|
| 68 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 69 |
+
</button>
|
| 70 |
+
<?php endif; ?>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<div class="wds-separator-top <?php echo $is_member ? '' : 'wds-box-blocked-area'; ?>">
|
| 74 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'URL Crawler', 'wds' ); ?></strong></span>
|
| 75 |
+
<?php if ( $sitemap_enabled ) : ?>
|
| 76 |
+
<?php
|
| 77 |
+
$this->_render( 'url-crawl-master', array(
|
| 78 |
+
'ready_template' => 'dashboard/dashboard-url-crawl-stats',
|
| 79 |
+
'progress_template' => 'dashboard/dashboard-url-crawl-in-progress',
|
| 80 |
+
'no_data_template' => 'dashboard/dashboard-url-crawl-no-data-small',
|
| 81 |
+
) );
|
| 82 |
+
?>
|
| 83 |
+
<?php else : ?>
|
| 84 |
+
<?php if ( $is_member ) : ?>
|
| 85 |
+
<div class="wds-box-crawl-stats">
|
| 86 |
+
<span class="wds-issues wds-issues-invalid">
|
| 87 |
+
<?php esc_html_e( 'Sitemaps must be activated', 'wds' ); ?>
|
| 88 |
+
</span>
|
| 89 |
+
</div>
|
| 90 |
+
<?php else : ?>
|
| 91 |
+
<p class="wds-small-text">
|
| 92 |
+
<?php esc_html_e( 'Automatically schedule SmartCrawl to run check for URLs that are missing from your Sitemap.', 'wds' ); ?>
|
| 93 |
+
</p>
|
| 94 |
+
<button class="wds-upgrade-button button-pro wds-has-tooltip"
|
| 95 |
+
data-content="<?php esc_attr_e( 'Get SmartCrawl Pro today Free', 'wds' ); ?>"
|
| 96 |
+
type="button">
|
| 97 |
+
<?php esc_html_e( 'Pro feature', 'wds' ); ?>
|
| 98 |
+
</button>
|
| 99 |
+
<?php endif; ?>
|
| 100 |
+
<?php endif; ?>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<div class="wds-box-footer" style="<?php echo $is_member ? '' : 'margin-top:0;'; ?>">
|
| 104 |
+
<a href="<?php echo esc_attr( $page_url ); ?>"
|
| 105 |
+
class="button button-small button-dark button-dark-o wds-dash-configure-button">
|
| 106 |
+
|
| 107 |
+
<?php esc_html_e( 'Configure', 'wds' ); ?>
|
| 108 |
+
</a>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
</section>
|
includes/admin/templates/dashboard/dashboard-widget-social.php
CHANGED
|
@@ -1,105 +1,113 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
if ( !
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
<?php
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
<
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
<?php
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
</div>
|
| 95 |
-
|
| 96 |
-
<
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
</
|
| 103 |
-
<?php
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
if ( ! smartcrawl_subsite_setting_page_enabled( 'wds_social' ) ) {
|
| 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_get_array_value( $options, 'social' );
|
| 18 |
+
?>
|
| 19 |
+
<section id="<?php echo esc_attr( Smartcrawl_Settings_Dashboard::BOX_SOCIAL ); ?>" class="dev-box">
|
| 20 |
+
<div class="box-title">
|
| 21 |
+
<?php if ( $social_enabled ) : ?>
|
| 22 |
+
<div class="buttons buttons-icon">
|
| 23 |
+
<a href="<?php echo esc_attr( $social_page_url ); ?>" class="wds-settings-link">
|
| 24 |
+
<i class="wds-icon-arrow-right-carats"></i>
|
| 25 |
+
</a>
|
| 26 |
+
</div>
|
| 27 |
+
<?php endif; ?>
|
| 28 |
+
<h3>
|
| 29 |
+
<i class="wds-icon-social-twitter"></i> <?php esc_html_e( 'Social', 'wds' ); ?>
|
| 30 |
+
</h3>
|
| 31 |
+
</div>
|
| 32 |
+
|
| 33 |
+
<div class="box-content">
|
| 34 |
+
<p><?php esc_html_e( 'Control and optimize how your website appears when shared on social platforms like Facebook and Twitter.', 'wds' ); ?></p>
|
| 35 |
+
|
| 36 |
+
<?php if ( $social_enabled ) : ?>
|
| 37 |
+
<div class="wds-separator-top">
|
| 38 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'OpenGraph', 'wds' ); ?></strong></span>
|
| 39 |
+
<?php if ( ! $og_enabled ) : ?>
|
| 40 |
+
<p class="wds-small-text">
|
| 41 |
+
<?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' ); ?>
|
| 42 |
+
</p>
|
| 43 |
+
<button
|
| 44 |
+
type="button"
|
| 45 |
+
data-option-id="<?php echo esc_attr( $social_option_name ); ?>"
|
| 46 |
+
data-flag="<?php echo 'og-enable'; ?>"
|
| 47 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 48 |
+
|
| 49 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 50 |
+
</button>
|
| 51 |
+
<?php else : ?>
|
| 52 |
+
<span
|
| 53 |
+
class="wds-box-stat-value wds-box-stat-value-success"><?php esc_html_e( 'Active', 'wds' ); ?></span>
|
| 54 |
+
<?php endif; ?>
|
| 55 |
+
</div>
|
| 56 |
+
|
| 57 |
+
<div class="wds-separator-top">
|
| 58 |
+
<span class="wds-small-text"><strong><?php esc_html_e( 'Twitter Cards', 'wds' ); ?></strong></span>
|
| 59 |
+
<?php if ( ! $twitter_card_enabled ) : ?>
|
| 60 |
+
<p class="wds-small-text">
|
| 61 |
+
<?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' ); ?>
|
| 62 |
+
</p>
|
| 63 |
+
<button type="button"
|
| 64 |
+
data-option-id="<?php echo esc_attr( $social_option_name ); ?>"
|
| 65 |
+
data-flag="<?php echo 'twitter-card-enable'; ?>"
|
| 66 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 67 |
+
|
| 68 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 69 |
+
</button>
|
| 70 |
+
<?php else : ?>
|
| 71 |
+
<span class="wds-box-stat-value wds-box-stat-value-success">
|
| 72 |
+
<?php echo esc_html( $twitter_card_status_text ); ?>
|
| 73 |
+
</span>
|
| 74 |
+
<?php endif; ?>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<div class="wds-separator-top">
|
| 78 |
+
<span class="wds-small-text">
|
| 79 |
+
<strong><?php esc_html_e( 'Pinterest Verification', 'wds' ); ?></strong>
|
| 80 |
+
</span>
|
| 81 |
+
<?php if ( ! $pinterest_tag || 'fail' === $pinterest_verification_status ) : ?>
|
| 82 |
+
<p class="wds-small-text">
|
| 83 |
+
<?php esc_html_e( 'Verify your website with Pinterest to attribute your website when your website content is pinned to the platform.', 'wds' ); ?>
|
| 84 |
+
</p>
|
| 85 |
+
<a href="<?php echo esc_attr( $social_page_url ); ?>#tab_pinterest_verification"
|
| 86 |
+
class="button button-small">
|
| 87 |
+
|
| 88 |
+
<?php esc_html_e( 'Connect', 'wds' ); ?>
|
| 89 |
+
</a>
|
| 90 |
+
<?php else : ?>
|
| 91 |
+
<span
|
| 92 |
+
class="wds-box-stat-value wds-box-stat-value-success"><?php esc_html_e( 'Verification tag added' ); ?></span>
|
| 93 |
+
<?php endif; ?>
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
<div class="wds-box-footer">
|
| 97 |
+
<a href="<?php echo esc_attr( $social_page_url ); ?>"
|
| 98 |
+
class="button button-small button-dark button-dark-o wds-dash-configure-button">
|
| 99 |
+
|
| 100 |
+
<?php esc_html_e( 'Configure', 'wds' ); ?>
|
| 101 |
+
</a>
|
| 102 |
+
</div>
|
| 103 |
+
<?php else : ?>
|
| 104 |
+
<button type="button"
|
| 105 |
+
data-option-id="<?php echo esc_attr( $settings_option_name ); ?>"
|
| 106 |
+
data-flag="<?php echo esc_attr( 'social' ); ?>"
|
| 107 |
+
class="wds-activate-component button button-small wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request">
|
| 108 |
+
|
| 109 |
+
<?php esc_html_e( 'Activate', 'wds' ); ?>
|
| 110 |
+
</button>
|
| 111 |
+
<?php endif; ?>
|
| 112 |
+
</div>
|
| 113 |
+
</section>
|
includes/admin/templates/dashboard/dashboard.php
CHANGED
|
@@ -1,53 +1,61 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Dashboard root template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
?>
|
| 8 |
-
<div id="container" class="wrap wrap-wds wds-page wds-dashboard">
|
| 9 |
-
<section id="header">
|
| 10 |
-
<
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
<
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
<?php
|
| 34 |
-
if ( smartcrawl_can_show_dash_widget_for( Smartcrawl_Settings_Settings::
|
| 35 |
-
$this->_render( 'dashboard/dashboard-widget-
|
| 36 |
-
}
|
| 37 |
-
?>
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Dashboard root template
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
?>
|
| 8 |
+
<div id="container" class="wrap wrap-wds wds-page wds-dashboard">
|
| 9 |
+
<section id="header">
|
| 10 |
+
<div class="actions">
|
| 11 |
+
<a target="_blank" class="button button-small button-light actions-button"
|
| 12 |
+
href="https://premium.wpmudev.org/docs/wpmu-dev-plugins/smartcrawl/#chapter-7">
|
| 13 |
+
<i class="wds-icon-academy"></i>
|
| 14 |
+
<?php esc_html_e( 'View Documentation', 'wds' ); ?>
|
| 15 |
+
</a>
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
<h1><?php esc_html_e( 'Dashboard', 'wds' ); ?></h1>
|
| 19 |
+
</section>
|
| 20 |
+
|
| 21 |
+
<div class="row">
|
| 22 |
+
<?php $this->_render( 'dashboard/dashboard-top' ); ?>
|
| 23 |
+
</div>
|
| 24 |
+
|
| 25 |
+
<div class="row">
|
| 26 |
+
<div class="col-half col-half-dashboard col-half-dashboard-left">
|
| 27 |
+
<?php
|
| 28 |
+
if ( smartcrawl_can_show_dash_widget_for( Smartcrawl_Settings_Settings::TAB_CHECKUP ) ) {
|
| 29 |
+
$this->_render( 'dashboard/dashboard-widget-seo-checkup' );
|
| 30 |
+
}
|
| 31 |
+
?>
|
| 32 |
+
<?php $this->_render( 'dashboard/dashboard-widget-content-analysis' ); ?>
|
| 33 |
+
<?php
|
| 34 |
+
if ( smartcrawl_can_show_dash_widget_for( Smartcrawl_Settings_Settings::TAB_SOCIAL ) ) {
|
| 35 |
+
$this->_render( 'dashboard/dashboard-widget-social' );
|
| 36 |
+
}
|
| 37 |
+
?>
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
<div class="col-half col-half-dashboard col-half-dashboard-right">
|
| 41 |
+
<?php
|
| 42 |
+
if ( smartcrawl_can_show_dash_widget_for( Smartcrawl_Settings_Settings::TAB_ONPAGE ) ) {
|
| 43 |
+
$this->_render( 'dashboard/dashboard-widget-onpage' );
|
| 44 |
+
}
|
| 45 |
+
?>
|
| 46 |
+
<?php
|
| 47 |
+
if ( smartcrawl_can_show_dash_widget_for( Smartcrawl_Settings_Settings::TAB_SITEMAP ) ) {
|
| 48 |
+
$this->_render( 'dashboard/dashboard-widget-sitemap' );
|
| 49 |
+
}
|
| 50 |
+
?>
|
| 51 |
+
<?php
|
| 52 |
+
if ( smartcrawl_can_show_dash_widget_for( Smartcrawl_Settings_Settings::TAB_AUTOLINKS ) ) {
|
| 53 |
+
$this->_render( 'dashboard/dashboard-widget-advanced-tools' );
|
| 54 |
+
}
|
| 55 |
+
?>
|
| 56 |
+
</div>
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<?php $this->_render( 'upsell-modal' ); ?>
|
| 60 |
+
</div>
|
| 61 |
+
<?php do_action( 'wds-dshboard-after_settings' ); ?>
|
includes/admin/templates/dashboard/onboard-progress.php
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
<p><?php esc_html_e( 'Please wait a few moments while we activate those services', 'wds' ); ?></p>
|
| 2 |
-
<?php
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
?>
|
| 7 |
-
<div class="processing-item-desc"></div>
|
| 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 |
+
?>
|
| 7 |
+
<div class="processing-item-desc"></div>
|
includes/admin/templates/dashboard/onboarding.php
CHANGED
|
@@ -1,112 +1,113 @@
|
|
| 1 |
-
<dialog class="auto-show wds-modal wds-onboard-dialog" id="wds-onboarding"
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
'
|
| 16 |
-
'
|
| 17 |
-
'
|
| 18 |
-
|
| 19 |
-
'
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
'
|
| 28 |
-
'
|
| 29 |
-
'
|
| 30 |
-
|
| 31 |
-
'
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
)
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
)
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
)
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
)
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
<?php esc_html_e( '
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
</
|
|
|
| 1 |
+
<dialog class="auto-show wds-modal wds-onboard-dialog" id="wds-onboarding"
|
| 2 |
+
data-title="<?php esc_attr_e( 'Quick setup', 'wds' ); ?>">
|
| 3 |
+
<div class="intro">
|
| 4 |
+
<p>
|
| 5 |
+
<?php esc_html_e( "Welcome to SmartCrawl, the hottest SEO plugin for WordPress! Let's quickly set up the basics for you, then you can fine tweak each setting as you go - our recommendations are on by default.", 'wds' ); ?>
|
| 6 |
+
</p>
|
| 7 |
+
</div>
|
| 8 |
+
|
| 9 |
+
<?php $service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE ); ?>
|
| 10 |
+
|
| 11 |
+
<div class="wds-separator-top wds-onboarding-item">
|
| 12 |
+
<?php if ( $service->is_member() ) : ?>
|
| 13 |
+
<?php
|
| 14 |
+
$this->_render( 'toggle-item', array(
|
| 15 |
+
'field_name' => 'checkup-enable',
|
| 16 |
+
'item_label' => esc_html__( 'Automatic SEO Checkups & Reporting', 'wds' ),
|
| 17 |
+
'item_description' => esc_html__( 'Schedule daily, weekly or monthly comprehensive checkups of your homepage SEO and have the results emailed to your inbox', 'wds' ),
|
| 18 |
+
'attributes' => array(
|
| 19 |
+
'data-processing' => esc_attr__( 'Activating Automatic SEO Checkups & Reporting', 'wds' ),
|
| 20 |
+
'checked' => true,
|
| 21 |
+
),
|
| 22 |
+
) );
|
| 23 |
+
?>
|
| 24 |
+
<?php else : ?>
|
| 25 |
+
<?php
|
| 26 |
+
$this->_render( 'toggle-item', array(
|
| 27 |
+
'field_name' => 'checkup-run',
|
| 28 |
+
'item_label' => esc_html__( 'Run a full SEO Checkup', 'wds' ),
|
| 29 |
+
'item_description' => esc_html__( 'Get a comprehensive checkup of your homepage and have the results emailed to your inbox.', 'wds' ),
|
| 30 |
+
'attributes' => array(
|
| 31 |
+
'data-processing' => esc_attr__( 'Running a full SEO Checkup', 'wds' ),
|
| 32 |
+
'checked' => true,
|
| 33 |
+
),
|
| 34 |
+
) );
|
| 35 |
+
?>
|
| 36 |
+
<?php endif; ?>
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
<div class="wds-separator-top wds-onboarding-item">
|
| 40 |
+
<?php
|
| 41 |
+
$this->_render( 'toggle-item', array(
|
| 42 |
+
'field_name' => 'analysis-enable',
|
| 43 |
+
'item_label' => esc_html__( 'SEO & Readability Analysis', 'wds' ),
|
| 44 |
+
'item_description' => esc_html__( 'Have your pages and posts analyzed for SEO and readability improvements to improve your search ranking', 'wds' ),
|
| 45 |
+
'attributes' => array(
|
| 46 |
+
'data-processing' => esc_attr__( 'Activating SEO & Readability Analysis', 'wds' ),
|
| 47 |
+
'checked' => true,
|
| 48 |
+
),
|
| 49 |
+
) );
|
| 50 |
+
?>
|
| 51 |
+
</div>
|
| 52 |
+
|
| 53 |
+
<div class="wds-separator-top wds-onboarding-item">
|
| 54 |
+
<?php
|
| 55 |
+
$this->_render( 'toggle-item', array(
|
| 56 |
+
'field_name' => 'opengraph-enable',
|
| 57 |
+
'item_label' => esc_html__( 'OpenGraph', 'wds' ),
|
| 58 |
+
'item_description' => esc_html__( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook', 'wds' ),
|
| 59 |
+
'attributes' => array(
|
| 60 |
+
'data-processing' => esc_attr__( 'Activating OpenGraph', 'wds' ),
|
| 61 |
+
'checked' => true,
|
| 62 |
+
),
|
| 63 |
+
) );
|
| 64 |
+
?>
|
| 65 |
+
</div>
|
| 66 |
+
|
| 67 |
+
<div class="wds-separator-top wds-onboarding-item">
|
| 68 |
+
<?php
|
| 69 |
+
$this->_render( 'toggle-item', array(
|
| 70 |
+
'field_name' => 'sitemaps-enable',
|
| 71 |
+
'item_label' => esc_html__( 'Sitemaps', 'wds' ),
|
| 72 |
+
'item_description' => esc_html__( 'Sitemaps expose your site content to search engines and allow them to discover it more easily.', 'wds' ),
|
| 73 |
+
'attributes' => array(
|
| 74 |
+
'data-processing' => esc_attr__( 'Activating Sitemaps', 'wds' ),
|
| 75 |
+
'checked' => true,
|
| 76 |
+
),
|
| 77 |
+
) );
|
| 78 |
+
?>
|
| 79 |
+
</div>
|
| 80 |
+
|
| 81 |
+
<div class="wds-separator-top wds-onboarding-item">
|
| 82 |
+
<?php
|
| 83 |
+
$this->_render( 'toggle-item', array(
|
| 84 |
+
'field_name' => 'twitter-enable',
|
| 85 |
+
'item_label' => esc_html__( 'Twitter Cards', 'wds' ),
|
| 86 |
+
'item_description' => esc_html__( 'With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping drive traffic to your site.', 'wds' ),
|
| 87 |
+
'attributes' => array(
|
| 88 |
+
'data-processing' => esc_attr__( 'Activating Twitter Cards', 'wds' ),
|
| 89 |
+
'checked' => true,
|
| 90 |
+
),
|
| 91 |
+
) );
|
| 92 |
+
?>
|
| 93 |
+
</div>
|
| 94 |
+
|
| 95 |
+
<div class="wds-separator-top">
|
| 96 |
+
<div class="wds-notice wds-notice-info">
|
| 97 |
+
<p class="wds-small-text">
|
| 98 |
+
<?php esc_html_e( 'These services will be configured with recommended settings.', 'wds' ); ?>
|
| 99 |
+
<?php esc_html_e( 'You can change these at any time.', 'wds' ); ?>
|
| 100 |
+
</p>
|
| 101 |
+
</div>
|
| 102 |
+
</div>
|
| 103 |
+
|
| 104 |
+
<div class="action wds-box-footer">
|
| 105 |
+
<button class="button button-dark button-dark-o onboard-skip" type="button">
|
| 106 |
+
<?php esc_html_e( 'Skip', 'wds' ); ?>
|
| 107 |
+
</button>
|
| 108 |
+
|
| 109 |
+
<button type="button" class="button wds-onboarding-setup">
|
| 110 |
+
<?php esc_html_e( 'Get started', 'wds' ); ?>
|
| 111 |
+
</button>
|
| 112 |
+
</div>
|
| 113 |
+
</dialog>
|
includes/admin/templates/disabled-component-inner.php
CHANGED
|
@@ -1,36 +1,38 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
?>
|
| 11 |
-
<div class="wds-disabled-component">
|
| 12 |
-
<p>
|
| 13 |
-
<img src="<?php echo SMARTCRAWL_PLUGIN_URL; ?>/images/<?php echo esc_attr( $image ); ?>"
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
<?php
|
| 28 |
-
|
| 29 |
-
<?php
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
<?php
|
| 33 |
-
<
|
| 34 |
-
<?php
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
| 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 |
+
$premium_feature = empty( $premium_feature ) ? false : $premium_feature;
|
| 8 |
+
$notice = empty( $notice ) ? '' : $notice;
|
| 9 |
+
$button_url = empty( $button_url ) ? '' : $button_url;
|
| 10 |
+
?>
|
| 11 |
+
<div class="wds-disabled-component">
|
| 12 |
+
<p>
|
| 13 |
+
<img src="<?php echo esc_attr( SMARTCRAWL_PLUGIN_URL ); ?>/images/<?php echo esc_attr( $image ); ?>"
|
| 14 |
+
alt="<?php esc_attr_e( 'Disabled', 'wds' ); ?>" class="wds-disabled-image"/>
|
| 15 |
+
</p>
|
| 16 |
+
<p><?php echo wp_kses_post( $content ); ?></p>
|
| 17 |
+
|
| 18 |
+
<?php if ( $notice ) : ?>
|
| 19 |
+
<div class="wds-notice wds-notice-warning">
|
| 20 |
+
<p><?php echo esc_html( $notice ); ?></p>
|
| 21 |
+
</div>
|
| 22 |
+
<?php endif; ?>
|
| 23 |
+
|
| 24 |
+
<?php if ( $component ) : ?>
|
| 25 |
+
<input type="hidden" name="wds-activate-component" value="<?php echo esc_attr( $component ); ?>"/>
|
| 26 |
+
<?php wp_nonce_field( 'wds-settings-nonce', '_wds_nonce' ); ?>
|
| 27 |
+
<?php endif; ?>
|
| 28 |
+
|
| 29 |
+
<?php if ( $premium_feature && ! $is_member ) : ?>
|
| 30 |
+
<button class="wds-upgrade-button button-green"><?php esc_html_e( 'Upgrade to Pro', 'wds' ); ?></button>
|
| 31 |
+
<?php else : ?>
|
| 32 |
+
<?php if ( $button_url ) : ?>
|
| 33 |
+
<a class="button" href="<?php echo esc_attr( $button_url ); ?>"><?php echo esc_html( $button_text ); ?></a>
|
| 34 |
+
<?php else : ?>
|
| 35 |
+
<input name="submit" class="button" value="<?php echo esc_attr( $button_text ); ?>" type="submit"/>
|
| 36 |
+
<?php endif; ?>
|
| 37 |
+
<?php endif; ?>
|
| 38 |
+
</div>
|
includes/admin/templates/disabled-component.php
CHANGED
|
@@ -1,23 +1,23 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
?>
|
| 7 |
-
<form method='post'>
|
| 8 |
-
<section class="dev-box">
|
| 9 |
-
<div class="box-title">
|
| 10 |
-
<h3><?php
|
| 11 |
-
</div>
|
| 12 |
-
<div class="box-content">
|
| 13 |
-
<?php
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
?>
|
| 21 |
-
</div>
|
| 22 |
-
</section>
|
| 23 |
-
</form>
|
| 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'>
|
| 8 |
+
<section class="dev-box">
|
| 9 |
+
<div class="box-title">
|
| 10 |
+
<h3><?php esc_html_e( 'Get Started', 'wds' ); ?></h3>
|
| 11 |
+
</div>
|
| 12 |
+
<div class="box-content">
|
| 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 |
+
</section>
|
| 23 |
+
</form>
|
includes/admin/templates/dismissable-notice.php
CHANGED
|
@@ -1,20 +1,21 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
if ( ! $
|
| 7 |
-
return;
|
| 8 |
-
}
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
?>
|
| 13 |
-
<?php if ( ! $is_message_dismissed ) :
|
| 14 |
-
<div class="wds-notice <?php echo esc_attr( $class ); ?>"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$message = empty( $message ) ? '' : $message;
|
| 3 |
+
$class = empty( $class ) ? 'wds-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 <?php echo esc_attr( $class ); ?> <?php echo esc_attr( $key ); ?>"
|
| 15 |
+
data-key="<?php echo esc_attr( $key ); ?>">
|
| 16 |
+
<p>
|
| 17 |
+
<?php echo wp_kses_post( $message ); ?>
|
| 18 |
+
<a href="#" class="wds-notice-dismiss"><?php esc_html_e( 'Dismiss', 'wds' ); ?></a>
|
| 19 |
+
</p>
|
| 20 |
+
</div>
|
| 21 |
+
<?php endif; ?>
|
includes/admin/templates/index.php
CHANGED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile
|
includes/admin/templates/links-dropdown.php
CHANGED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
<
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
</
|
|
|
| 1 |
+
<?php
|
| 2 |
+
// phpcs:ignoreFile -- All values passed to this template are expected to be escaped already
|
| 3 |
+
$label = empty( $label ) ? '' : $label;
|
| 4 |
+
$links = empty( $links ) ? array() : $links;
|
| 5 |
+
?>
|
| 6 |
+
|
| 7 |
+
<div class="wds-links-dropdown">
|
| 8 |
+
<a class="wds-links-dropdown-anchor" href="#">…</a>
|
| 9 |
+
<ul>
|
| 10 |
+
<?php if ( $label ) : ?>
|
| 11 |
+
<li class="wds-links-dropdown-label"><?php echo $label; ?></li>
|
| 12 |
+
<?php endif; ?>
|
| 13 |
+
|
| 14 |
+
<?php foreach ( $links as $href => $text ) : ?>
|
| 15 |
+
<li><a href="<?php echo esc_attr( $href ); ?>"><?php echo $text; ?></a></li>
|
| 16 |
+
<?php endforeach; ?>
|
| 17 |
+
</ul>
|
| 18 |
+
</div>
|
includes/admin/templates/mascot-message.php
CHANGED
|
@@ -1,25 +1,25 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
if (
|
| 7 |
-
return;
|
| 8 |
-
}
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
?>
|
| 13 |
-
<?php if ( ! $is_message_dismissed ) :
|
| 14 |
-
<div class="wds-mascot-message <?php echo esc_attr( $key ); ?>">
|
| 15 |
-
<div class="wds-mascot"></div>
|
| 16 |
-
<div class="wds-mascot-bubble-container">
|
| 17 |
-
<div class="wds-mascot-bubble">
|
| 18 |
-
<?php if ( $dismissible ) :
|
| 19 |
-
<span class="wds-mascot-bubble-dismiss"><i class="wds-icon-close"></i></span>
|
| 20 |
-
<?php endif; ?>
|
| 21 |
-
<p class="wds-small-text"><?php echo $message; ?></p>
|
| 22 |
-
</div>
|
| 23 |
-
</div>
|
| 24 |
-
</div>
|
| 25 |
-
<?php endif; ?>
|
| 1 |
+
<?php
|
| 2 |
+
$key = empty( $key ) ? '' : $key;
|
| 3 |
+
$message = empty( $message ) ? '' : $message;
|
| 4 |
+
$dismissible = isset( $dismissible ) ? $dismissible : true;
|
| 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-mascot-message <?php echo esc_attr( $key ); ?>" data-key="<?php echo esc_attr( $key ); ?>">
|
| 15 |
+
<div class="wds-mascot"></div>
|
| 16 |
+
<div class="wds-mascot-bubble-container">
|
| 17 |
+
<div class="wds-mascot-bubble">
|
| 18 |
+
<?php if ( $dismissible ) : ?>
|
| 19 |
+
<span class="wds-mascot-bubble-dismiss"><i class="wds-icon-close"></i></span>
|
| 20 |
+
<?php endif; ?>
|
| 21 |
+
<p class="wds-small-text"><?php echo wp_kses_post( $message ); ?></p>
|
| 22 |
+
</div>
|
| 23 |
+
</div>
|
| 24 |
+
</div>
|
| 25 |
+
<?php endif; ?>
|
includes/admin/templates/media-url-field.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
?>
|
| 7 |
-
<div class="wds-media-url" data-name="<?php echo esc_attr( $item ); ?>">
|
| 8 |
-
<input class="wds-media-url-field" id="<?php echo esc_attr( $item ); ?>" type="text"
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
<button type="button" class="wds-media-url-button button button-dark-o">
|
| 12 |
-
<?php
|
| 13 |
-
</button>
|
| 14 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$options = empty( $options ) ? $_view['options'] : $options;
|
| 3 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 4 |
+
$item = empty( $item ) ? '' : $item;
|
| 5 |
+
$value = isset( $options[ $item ] ) ? $options[ $item ] : '';
|
| 6 |
+
?>
|
| 7 |
+
<div class="wds-media-url" data-name="<?php echo esc_attr( $item ); ?>">
|
| 8 |
+
<input class="wds-media-url-field" id="<?php echo esc_attr( $item ); ?>" type="text"
|
| 9 |
+
name="<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $item ); ?>]"
|
| 10 |
+
value="<?php echo esc_attr( $value ); ?>"/>
|
| 11 |
+
<button type="button" class="wds-media-url-button button button-dark-o">
|
| 12 |
+
<?php esc_html_e( 'Select', 'wds' ); ?>
|
| 13 |
+
</button>
|
| 14 |
+
</div>
|
includes/admin/templates/metabox.php
DELETED
|
@@ -1,294 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
$date = '';
|
| 4 |
-
if ( $post->post_type == 'post' ) {
|
| 5 |
-
if ( isset( $post->post_date ) ) {
|
| 6 |
-
$date = date( 'M j, Y', strtotime( $post->post_date ) ); } else { $date = date( 'M j, Y' ); }
|
| 7 |
-
}
|
| 8 |
-
|
| 9 |
-
?>
|
| 10 |
-
|
| 11 |
-
<table class="widefat">
|
| 12 |
-
|
| 13 |
-
<?php
|
| 14 |
-
|
| 15 |
-
$title = smartcrawl_get_value( 'title' );
|
| 16 |
-
if ( empty( $title ) ) {
|
| 17 |
-
$title = $post->post_title; }
|
| 18 |
-
if ( empty( $title ) ) {
|
| 19 |
-
$title = __( 'temp title', 'wds' ); }
|
| 20 |
-
|
| 21 |
-
$desc = smartcrawl_get_value( 'metadesc' );
|
| 22 |
-
if ( empty( $desc ) ) {
|
| 23 |
-
$desc = substr( strip_tags( $post->post_content ), 0, 130 ); }
|
| 24 |
-
if ( empty( $desc ) ) {
|
| 25 |
-
$desc = __( 'temp description', 'wds' ); }
|
| 26 |
-
|
| 27 |
-
$slug = $post->post_name;
|
| 28 |
-
if ( empty( $slug ) ) {
|
| 29 |
-
$slug = sanitize_title( $title ); }
|
| 30 |
-
|
| 31 |
-
?>
|
| 32 |
-
|
| 33 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-preview_area', true ) ) { ?>
|
| 34 |
-
<tr>
|
| 35 |
-
<th><label><?php esc_html_e( 'Preview:', 'wds' ); ?></label></th>
|
| 36 |
-
<td>
|
| 37 |
-
<?php
|
| 38 |
-
$video = smartcrawl_get_value( 'video_meta',$post->ID );
|
| 39 |
-
if ( $video && $video != 'none' ) {
|
| 40 |
-
?>
|
| 41 |
-
<div id="snippet" class="video">
|
| 42 |
-
<h4 style="margin:0;font-weight:normal;"><a class="title" href="#"><?php echo esc_html( $title ); ?></a></h4>
|
| 43 |
-
<div style="margin:5px 10px 10px 0;width:82px;height:62px;float:left;">
|
| 44 |
-
<img style="border: 1px solid blue;padding: 1px;width:80px;height:60px;" src="<?php echo esc_url( $video['thumbnail_loc'] ); ?>"/>
|
| 45 |
-
<div style="margin-top:-23px;margin-right:4px;text-align:right"><img src="http://www.google.com/images/icons/sectionized_ui/play_c.gif" alt="" border="0" height="20" style="-moz-opacity:.88;filter:alpha(opacity=88);opacity:.88" width="20"></div>
|
| 46 |
-
</div>
|
| 47 |
-
<div style="float:left;width:440px;">
|
| 48 |
-
<p style="color:#767676;font-size:13px;line-height:15px;"><?php echo esc_html( number_format( $video['duration'] / 60 ) ); ?> <?php esc_html_e( 'mins', 'wds' ); ?> - <?php echo esc_html( $date ); ?></p>
|
| 49 |
-
<p style="color:#000;font-size:13px;line-height:15px;" class="desc"><span><?php echo esc_html( $desc ); ?></span></p>
|
| 50 |
-
<a href="#" class="url"><?php echo esc_html( str_replace( 'http://','',get_bloginfo( 'url' ) ) ); ?>/<?php echo esc_html( $slug ); ?>/</a> - <a href="#" class="util"><?php esc_html_e( 'More videos »', 'wds' ); ?></a>
|
| 51 |
-
</div>
|
| 52 |
-
</div>
|
| 53 |
-
|
| 54 |
-
<?php
|
| 55 |
-
} else {
|
| 56 |
-
|
| 57 |
-
if ( ! empty( $date ) ) {
|
| 58 |
-
$date .= ' ... ';
|
| 59 |
-
}
|
| 60 |
-
|
| 61 |
-
?>
|
| 62 |
-
<div id="snippet">
|
| 63 |
-
<p><a style="color:#2200C1;font-weight:medium;font-size:16px;text-decoration:underline;" href="#"><?php echo esc_html( $title ); ?></a></p>
|
| 64 |
-
<p style="font-size: 12px; color: #000; line-height: 15px;"><?php echo esc_html( $date ); ?><span><?php echo esc_html( $desc ); ?></span></p>
|
| 65 |
-
<p>
|
| 66 |
-
<a href="#" style="font-size: 13px; color: #282; line-height: 15px;" class="url"><?php echo esc_html( str_replace( 'http://','',get_bloginfo( 'url' ) ) ); ?>/<?php echo esc_html( $slug ); ?>/</a> - <a href="#" class="util"><?php esc_html_e( 'Cached', 'wds' ); ?></a> - <a href="#" class="util"><?php esc_html_e( 'Similar', 'wds' ); ?></a>
|
| 67 |
-
<?php if ( is_multisite() && (is_admin() || is_network_admin()) && class_exists( 'domain_map' ) ) { ?>
|
| 68 |
-
<small style="opacity:.5"><i><?php esc_html_e( __( 'The URL preview may be thwarted by domain mapping', 'wds' ) ); ?></i></small>
|
| 69 |
-
<?php } ?>
|
| 70 |
-
</p>
|
| 71 |
-
</div>
|
| 72 |
-
<?php
|
| 73 |
-
}
|
| 74 |
-
?>
|
| 75 |
-
|
| 76 |
-
</td>
|
| 77 |
-
</tr>
|
| 78 |
-
<?php } ?>
|
| 79 |
-
|
| 80 |
-
<?php
|
| 81 |
-
$title_placeholder = smartcrawl_get_seo_title();
|
| 82 |
-
if ( ! $title_placeholder ) { $title_placeholder = ''; }
|
| 83 |
-
|
| 84 |
-
$desc_placeholder = smartcrawl_get_seo_desc();
|
| 85 |
-
if ( ! $desc_placeholder ) { $desc_placeholder = ''; }
|
| 86 |
-
?>
|
| 87 |
-
|
| 88 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-focus_area', true ) ) { ?>
|
| 89 |
-
<tr>
|
| 90 |
-
<th valign='top'><label for='wds_focus'><?php esc_html_e( 'Focus keywords' , 'wds' ); ?></label></th>
|
| 91 |
-
<td valign='top'>
|
| 92 |
-
<input type='text' class='widefat' id='wds_focus' name='wds_focus' value='<?php echo esc_html( smartcrawl_get_value( 'focus-keywords' ) ); ?>' class='wds' /><br />
|
| 93 |
-
</td>
|
| 94 |
-
</tr>
|
| 95 |
-
<?php } ?>
|
| 96 |
-
|
| 97 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-title_area', true ) ) { ?>
|
| 98 |
-
<tr>
|
| 99 |
-
<th valign='top'><label for='wds_title'><?php esc_html_e( 'Title Tag' , 'wds' ); ?></label></th>
|
| 100 |
-
<td valign='top'>
|
| 101 |
-
<input type='text' class='widefat' id='wds_title' placeholder='<?php echo esc_html( $title_placeholder ); ?>' name='wds_title' value='<?php echo esc_html( smartcrawl_get_value( 'title' ) ); ?>' class='wds' />
|
| 102 |
-
<p>
|
| 103 |
-
<?php printf( esc_html( __( 'Up to %d characters recommended' , 'wds' ) ), SMARTCRAWL_TITLE_LENGTH_CHAR_COUNT_LIMIT ); ?>
|
| 104 |
-
</p>
|
| 105 |
-
</td>
|
| 106 |
-
</tr>
|
| 107 |
-
<?php } ?>
|
| 108 |
-
|
| 109 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-description_area', true ) ) { ?>
|
| 110 |
-
<tr>
|
| 111 |
-
<th valign='top'><label for='wds_metadesc'><?php esc_html_e( 'Meta Description' , 'wds' ); ?></label></th>
|
| 112 |
-
<td valign='top'>
|
| 113 |
-
<textarea rows='2' class='widefat' name='wds_metadesc' placeholder='<?php echo esc_html( $desc_placeholder ); ?>' id='wds_metadesc' class='wds'><?php echo esc_html( smartcrawl_get_value( 'metadesc' ) ); ?></textarea>
|
| 114 |
-
<p>
|
| 115 |
-
<?php printf( esc_html( __( '%d characters maximum' , 'wds' ) ), SMARTCRAWL_METADESC_LENGTH_CHAR_COUNT_LIMIT ); ?>
|
| 116 |
-
</p>
|
| 117 |
-
</td>
|
| 118 |
-
</tr>
|
| 119 |
-
<?php } ?>
|
| 120 |
-
|
| 121 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-keywords_area', true ) ) { ?>
|
| 122 |
-
<tr>
|
| 123 |
-
<th valign='top'><label for='wds_keywords'><?php esc_html_e( 'Meta keywords' , 'wds' ); ?></label></th>
|
| 124 |
-
<td valign='top'>
|
| 125 |
-
<input type='text' class='widefat' id='wds_keywords' name='wds_keywords' value='<?php echo esc_html( smartcrawl_get_value( 'keywords' ) ); ?>' class='wds' /><br />
|
| 126 |
-
<label for="wds_tags_to_keywords"><?php esc_html_e( 'I want to use post tags in addition to my keywords', 'wds' ); ?></label>
|
| 127 |
-
<input type='checkbox' name='wds_tags_to_keywords' id='wds_tags_to_keywords' value='1' <?php echo esc_attr( smartcrawl_get_value( 'tags_to_keywords' ) ) ? 'checked="checked"' : ''; ?> />
|
| 128 |
-
<div>
|
| 129 |
-
<b><?php esc_html_e( 'News Keywords', 'wds' ); ?></b> <a href="http://support.google.com/news/publisher/bin/answer.py?hl=en&answer=68297" target="_blank">(?)</a>
|
| 130 |
-
</div>
|
| 131 |
-
<input type='text' class='widefat' id='wds_news_keywords' name='wds_news_keywords' value='<?php echo esc_attr( smartcrawl_get_value( 'news_keywords' ) ); ?>' class='wds' />
|
| 132 |
-
<p>
|
| 133 |
-
<?php esc_html_e( 'Separate keywords with commas' , 'wds' ); ?><br />
|
| 134 |
-
<?php esc_html_e( 'If you enable using tags, post tags will be merged in with any other keywords you enter in the text box.', 'wds' ); ?>
|
| 135 |
-
</p>
|
| 136 |
-
</td>
|
| 137 |
-
</tr>
|
| 138 |
-
<?php } ?>
|
| 139 |
-
|
| 140 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-robots_area', true ) ) { ?>
|
| 141 |
-
<tr>
|
| 142 |
-
<th valign='top'><label for='wds_robots_follow'><?php esc_html_e( 'Meta Robots' , 'wds' ); ?></label></th>
|
| 143 |
-
<td>
|
| 144 |
-
<table class='wds_subtable' broder='0'>
|
| 145 |
-
<tr>
|
| 146 |
-
<th valign='top'><label for='wds_robots_follow'><?php esc_html_e( 'Index' , 'wds' ); ?></label></th>
|
| 147 |
-
<td valign='top'>
|
| 148 |
-
<input type="radio" name="wds_meta-robots-noindex" id="wds_meta-robots-noindex-index" <?php echo ( ! $ri_value ? 'checked="checked"' : ''); ?> value="0" />
|
| 149 |
-
<label for="wds_meta-robots-noindex-index"><?php esc_html_e( 'Index' , 'wds' ); ?></label><br />
|
| 150 |
-
<input type="radio" name="wds_meta-robots-noindex" id="wds_meta-robots-noindex-noindex" <?php echo ($ri_value ? 'checked="checked"' : ''); ?> value="1" />
|
| 151 |
-
<label for="wds_meta-robots-noindex-noindex"><?php esc_html_e( 'Noindex' , 'wds' ); ?></label>
|
| 152 |
-
</td>
|
| 153 |
-
</tr>
|
| 154 |
-
<tr>
|
| 155 |
-
<th valign='top'><label for='wds_robots_follow'><?php esc_html_e( 'Follow' , 'wds' ); ?></label></th>
|
| 156 |
-
<td valign='top'>
|
| 157 |
-
<input type="radio" name="wds_meta-robots-nofollow" id="wds_meta-robots-nofollow-follow" <?php echo ( ! $rf_value ? 'checked="checked"' : ''); ?> value="0" />
|
| 158 |
-
<label for="wds_meta-robots-nofollow-follow"><?php esc_html_e( 'Follow' , 'wds' ); ?></label><br />
|
| 159 |
-
<input type="radio" name="wds_meta-robots-nofollow" id="wds_meta-robots-nofollow-nofollow" <?php echo ($rf_value ? 'checked="checked"' : ''); ?> value="1" />
|
| 160 |
-
<label for="wds_meta-robots-nofollow-nofollow"><?php esc_html_e( 'Nofollow' , 'wds' ); ?></label>
|
| 161 |
-
</td>
|
| 162 |
-
</tr>
|
| 163 |
-
<tr>
|
| 164 |
-
<th valign='top'><label for='wds_meta-robots-adv'><?php esc_html_e( 'Advanced' , 'wds' ); ?></label></th>
|
| 165 |
-
<td valign='top'>
|
| 166 |
-
<?php
|
| 167 |
-
|
| 168 |
-
foreach ( $advanced as $rkey => $rlbl ) {
|
| 169 |
-
$checked = in_array( $rkey, $adv_value ) ? 'checked="checked"' : '';
|
| 170 |
-
?>
|
| 171 |
-
<input type='hidden' name='wds_meta-robots-adv[<?php echo esc_attr( $rkey ); ?>]' value='' />
|
| 172 |
-
<input type='checkbox' name='wds_meta-robots-adv[<?php echo esc_attr( $rkey ); ?>]' value='<?php echo esc_attr( $rkey ); ?>' id='wds_meta-robots-adv-<?php echo esc_attr( $rkey ); ?>' <?php echo $checked; ?> />
|
| 173 |
-
<label for="wds_meta-robots-adv-<?php echo esc_attr( $rkey ); ?>"><?php echo esc_html( $rlbl ); ?></label><br />
|
| 174 |
-
<?php
|
| 175 |
-
}
|
| 176 |
-
|
| 177 |
-
?>
|
| 178 |
-
</td>
|
| 179 |
-
</tr>
|
| 180 |
-
</table>
|
| 181 |
-
<p>
|
| 182 |
-
<?php _e( '<code>meta</code> robots settings for this page.', 'wds' ); ?>
|
| 183 |
-
</p>
|
| 184 |
-
</td>
|
| 185 |
-
</tr>
|
| 186 |
-
<?php } ?>
|
| 187 |
-
|
| 188 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-canonical_area', true ) ) { ?>
|
| 189 |
-
<tr>
|
| 190 |
-
<th valign='top'><label for='wds_canonical'><?php esc_html_e( 'Canonical URL' , 'wds' ); ?></label></th>
|
| 191 |
-
<td valign='top'>
|
| 192 |
-
<input type='text' id='wds_canonical' name='wds_canonical' value='<?php echo esc_attr( smartcrawl_get_value( 'canonical' ) ); ?>' class='wds' />
|
| 193 |
-
</td>
|
| 194 |
-
</tr>
|
| 195 |
-
<?php } ?>
|
| 196 |
-
|
| 197 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-redirect_area', true ) ) { ?>
|
| 198 |
-
<?php
|
| 199 |
-
|
| 200 |
-
if ( user_can_see_seo_metabox_301_redirect() ) {
|
| 201 |
-
?>
|
| 202 |
-
|
| 203 |
-
<tr>
|
| 204 |
-
<th valign='top'><label for='wds_redirect'><?php esc_html_e( '301 Redirect' , 'wds' ); ?></label></th>
|
| 205 |
-
<td valign='top'>
|
| 206 |
-
<input type='text' id='wds_redirect' name='wds_redirect' value='<?php echo esc_attr( smartcrawl_get_value( 'redirect' ) ); ?>' class='wds' />
|
| 207 |
-
</td>
|
| 208 |
-
</tr>
|
| 209 |
-
|
| 210 |
-
<?php
|
| 211 |
-
}
|
| 212 |
-
|
| 213 |
-
?>
|
| 214 |
-
<?php } ?>
|
| 215 |
-
|
| 216 |
-
<?php if ( apply_filters( 'wds-metabox-visible_parts-sitemap_priority_area', true ) ) { ?>
|
| 217 |
-
<tr>
|
| 218 |
-
<th valign='top'><label for='wds_sitemap-priority'><?php esc_html_e( 'Sitemap Priority' , 'wds' ); ?></label></th>
|
| 219 |
-
<td valign='top'>
|
| 220 |
-
<select name='wds_sitemap-priority' id='wds_sitemap-priority'>
|
| 221 |
-
|
| 222 |
-
<?php
|
| 223 |
-
$value = smartcrawl_get_value( 'sitemap-priority' );
|
| 224 |
-
|
| 225 |
-
foreach ( $options as $key => $label ) {
|
| 226 |
-
?>
|
| 227 |
-
|
| 228 |
-
<option value='<?php echo esc_attr( $key ); ?>' <?php echo (($key == $value) ? 'selected="selected"' : ''); ?>><?php echo esc_html( $label ); ?></option>
|
| 229 |
-
|
| 230 |
-
<?php
|
| 231 |
-
|
| 232 |
-
}
|
| 233 |
-
?>
|
| 234 |
-
|
| 235 |
-
</select>
|
| 236 |
-
<p>
|
| 237 |
-
<?php esc_html_e( 'The priority given to this page in the XML sitemap.', 'wds' ); ?>
|
| 238 |
-
</p>
|
| 239 |
-
</td>
|
| 240 |
-
</tr>
|
| 241 |
-
<?php } ?>
|
| 242 |
-
|
| 243 |
-
<?php
|
| 244 |
-
$og = smartcrawl_get_value( 'opengraph' );
|
| 245 |
-
if ( ! is_array( $og ) ) { $og = array(); }
|
| 246 |
-
|
| 247 |
-
$og = wp_parse_args($og, array(
|
| 248 |
-
'title' => false,
|
| 249 |
-
'description' => false,
|
| 250 |
-
'images' => false,
|
| 251 |
-
));
|
| 252 |
-
?>
|
| 253 |
-
<tr>
|
| 254 |
-
<th>
|
| 255 |
-
<label for="og-title"><?php esc_html_e( 'OpenGraph Title', 'wds' ); ?></label>
|
| 256 |
-
</th>
|
| 257 |
-
<td>
|
| 258 |
-
<input type="text" class="widefat"
|
| 259 |
-
id="og-title" name="wds-opengraph[title]"
|
| 260 |
-
value="<?php echo esc_attr( $og['title'] ); ?>" />
|
| 261 |
-
</td>
|
| 262 |
-
</tr>
|
| 263 |
-
<tr>
|
| 264 |
-
<th>
|
| 265 |
-
<label for="og-description"><?php esc_html_e( 'OpenGraph Description', 'wds' ); ?></label>
|
| 266 |
-
</th>
|
| 267 |
-
<td>
|
| 268 |
-
<textarea class="widefat" name="wds-opengraph[description]"
|
| 269 |
-
id="og-description"><?php echo esc_textarea( $og['description'] ); ?></textarea>
|
| 270 |
-
</td>
|
| 271 |
-
</tr>
|
| 272 |
-
<tr>
|
| 273 |
-
<th>
|
| 274 |
-
<label for="og-images"><?php esc_html_e( 'OpenGraph Images', 'wds' ); ?></label>
|
| 275 |
-
</th>
|
| 276 |
-
<td
|
| 277 |
-
class="fields og-images"
|
| 278 |
-
data-name='wds-opengraph[og-images]'
|
| 279 |
-
>
|
| 280 |
-
<div class="add-action-wrapper item">
|
| 281 |
-
<a href="#add" title="<?php esc_attr_e( 'Add image', 'wds' ); ?>">+</a>
|
| 282 |
-
</div>
|
| 283 |
-
<?php if ( ! empty( $og['images'] ) && is_array( $og['images'] ) ) { foreach ( $og['images'] as $img ) { ?>
|
| 284 |
-
<input type="text" class="widefat"
|
| 285 |
-
name="wds-opengraph[images][]"
|
| 286 |
-
value="<?php echo esc_attr( $img ); ?>" />
|
| 287 |
-
<?php }
|
| 288 |
-
} ?>
|
| 289 |
-
</td>
|
| 290 |
-
</tr>
|
| 291 |
-
|
| 292 |
-
</table>
|
| 293 |
-
|
| 294 |
-
<?php do_action( 'wds-editor-metabox-after', $post ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/metabox/analysis-readability.php
CHANGED
|
@@ -1,115 +1,124 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
if ( ! Smartcrawl_Settings::get_setting( 'analysis-seo' ) ) {
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
$
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
$
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
<
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
if ( ! Smartcrawl_Settings::get_setting( 'analysis-seo' ) ) {
|
| 3 |
+
return false;
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
/**
|
| 7 |
+
* @var $model \Smartcrawl_Model_Analysis
|
| 8 |
+
*/
|
| 9 |
+
$model = empty( $model ) ? null : $model;
|
| 10 |
+
$readability_data = empty( $readability_data ) ? array() : $readability_data;
|
| 11 |
+
$readability_ignored = empty( $readability_ignored ) ? false : $readability_ignored;
|
| 12 |
+
$readability_score = smartcrawl_get_array_value( $readability_data, 'score' );
|
| 13 |
+
|
| 14 |
+
if ( null === $model || null === $readability_score ) {
|
| 15 |
+
return;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
$readability_score = intval( ceil( $readability_score ) );
|
| 19 |
+
$readability_level = $model->get_readability_level();
|
| 20 |
+
$readability_levels_map = $model->get_readability_levels_map();
|
| 21 |
+
$readability_strategy = Smartcrawl_String::get_readability_strategy();
|
| 22 |
+
|
| 23 |
+
if ( $readability_ignored ) {
|
| 24 |
+
$classes_array[] = 'disabled';
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
$total_possible_score = Smartcrawl_String::READABILITY_KINCAID === $readability_strategy ? '100' : '';
|
| 28 |
+
$readability_level_description = $model->get_readability_level_description( $readability_level );
|
| 29 |
+
$readability_state = $model->get_kincaid_readability_state( $readability_score, $readability_ignored );
|
| 30 |
+
$classes_array[] = sprintf(
|
| 31 |
+
'wds-check-%s',
|
| 32 |
+
$readability_state
|
| 33 |
+
);
|
| 34 |
+
$score_class = sprintf(
|
| 35 |
+
'wds-score-%s',
|
| 36 |
+
$readability_state
|
| 37 |
+
);
|
| 38 |
+
$classes = implode( ' ', $classes_array );
|
| 39 |
+
$refresh_analysis_disabled = 'auto-draft' === get_post_status() ? 'disabled' : '';
|
| 40 |
+
?>
|
| 41 |
+
|
| 42 |
+
<div class="wds-readability-report wds-report"
|
| 43 |
+
data-readability-state="<?php echo esc_attr( $readability_state ); ?>">
|
| 44 |
+
|
| 45 |
+
<div class="wds-readability-stats wds-report-stats">
|
| 46 |
+
<div class="wds-report-score">
|
| 47 |
+
<div class="wds-score <?php echo esc_attr( $score_class ); ?>">
|
| 48 |
+
<span><?php echo esc_html( $readability_score ); ?></span><?php if ( $total_possible_score ) : ?><span
|
| 49 |
+
class="wds-total">/<?php echo esc_html( $total_possible_score ); ?></span><?php endif; ?>
|
| 50 |
+
</div>
|
| 51 |
+
<span class="wds-small-text"><?php esc_html_e( 'Readability score', 'wds' ); ?></span>
|
| 52 |
+
</div>
|
| 53 |
+
|
| 54 |
+
<div class="wds-readability-level-description wds-small-text">
|
| 55 |
+
<?php echo wp_kses( $readability_level_description, array( 'strong' => array() ) ); ?>
|
| 56 |
+
|
| 57 |
+
<br/>
|
| 58 |
+
<button class="button button-small button-dark button-dark-o wds-refresh-analysis wds-analysis-readability wds-disabled-during-request"
|
| 59 |
+
<?php echo esc_attr( $refresh_analysis_disabled ); ?> type="button">
|
| 60 |
+
<span><?php esc_html_e( 'Refresh', 'wds' ); ?></span>
|
| 61 |
+
</button>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<div class="wds-accordion">
|
| 66 |
+
<div class="wds-check-item wds-accordion-section <?php echo esc_attr( $classes ); ?>">
|
| 67 |
+
<div class="wds-accordion-handle">
|
| 68 |
+
<div class="wds-accordion-handle-part">
|
| 69 |
+
<?php esc_html_e( 'Flesch-Kincaid Test', 'wds' ); ?>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<?php if ( $readability_ignored ) : ?>
|
| 73 |
+
<div class="wds-unignore-container wds-accordion-handle-part">
|
| 74 |
+
<button type="button"
|
| 75 |
+
class="wds-unignore wds-button-with-loader wds-button-with-left-loader wds-disabled-during-request button button-small button-dark-o"
|
| 76 |
+
data-check_id="readability">
|
| 77 |
+
<?php esc_html_e( 'Restore', 'wds' ); ?>
|
| 78 |
+
</button>
|
| 79 |
+
</div>
|
| 80 |
+
<?php else : ?>
|
| 81 |
+
<div class="wds-readability-level wds-accordion-handle-part">
|
| 82 |
+
<span class="wds-check-item-indicator"><?php echo esc_html( $readability_level ); ?></span>
|
| 83 |
+
</div>
|
| 84 |
+
<?php endif; ?>
|
| 85 |
+
</div>
|
| 86 |
+
<div class="wds-accordion-content">
|
| 87 |
+
<div class="wds-small-text"><strong><?php esc_html_e( 'Overview', 'wds' ); ?></strong></div>
|
| 88 |
+
<p class="wds-small-text"><?php esc_html_e( 'The Flesch-Kincaid readability tests are readability tests designed to indicate how difficult a passage in English is to understand. Here are the benchmarks.', 'wds' ); ?></p>
|
| 89 |
+
<table class="wds-list-table">
|
| 90 |
+
<tbody>
|
| 91 |
+
<tr>
|
| 92 |
+
<th><?php esc_html_e( 'Score', 'wds' ); ?></th>
|
| 93 |
+
<th><?php esc_html_e( 'Description', 'wds' ); ?></th>
|
| 94 |
+
</tr>
|
| 95 |
+
|
| 96 |
+
<?php foreach ( $readability_levels_map as $label => $level ) : ?>
|
| 97 |
+
<tr>
|
| 98 |
+
<?php
|
| 99 |
+
if ( ! is_array( $level ) || ! isset( $level['max'] ) || ! isset( $level['min'] ) ) {
|
| 100 |
+
continue;
|
| 101 |
+
}
|
| 102 |
+
?>
|
| 103 |
+
<td><?php echo esc_html( (int) ceil( $level['min'] ) ); ?>
|
| 104 |
+
- <?php echo esc_html( (int) ceil( $level['max'] ) ); ?></td>
|
| 105 |
+
<td><?php echo esc_html( $label ); ?></td>
|
| 106 |
+
</tr>
|
| 107 |
+
<?php endforeach; ?>
|
| 108 |
+
</tbody>
|
| 109 |
+
</table>
|
| 110 |
+
|
| 111 |
+
<div class="wds-small-text"><strong><?php esc_html_e( 'How to fix', 'wds' ); ?></strong></div>
|
| 112 |
+
<p class="wds-small-text"><?php esc_html_e( 'Try to use shorter sentences, with less difficult words to improve readability.', 'wds' ); ?></p>
|
| 113 |
+
|
| 114 |
+
<div class="wds-ignore-container">
|
| 115 |
+
<button type="button"
|
| 116 |
+
class="wds-ignore wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request button button-small button-dark button-dark-o"
|
| 117 |
+
data-check_id="readability">
|
| 118 |
+
<?php esc_html_e( 'Ignore', 'wds' ); ?>
|
| 119 |
+
</button>
|
| 120 |
+
</div>
|
| 121 |
+
</div>
|
| 122 |
+
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
includes/admin/templates/metabox/analysis-seo-analysis.php
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
if ( ! Smartcrawl_Settings::get_setting( 'analysis-seo' ) ) {
|
| 3 |
+
return false;
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
$checks = empty( $checks ) ? array() : $checks;
|
| 7 |
+
$error_count = empty( $error_count ) ? 0 : $error_count;
|
| 8 |
+
$focus_keywords_available = empty( $focus_keywords_available ) ? false : $focus_keywords_available;
|
| 9 |
+
?>
|
| 10 |
+
|
| 11 |
+
<?php if ( ! $focus_keywords_available ) : ?>
|
| 12 |
+
<div class="wds-seo-analysis wds-no-focus-keywords">
|
| 13 |
+
<div class="wds-notice wds-notice-warning">
|
| 14 |
+
<p><?php esc_html_e( 'You need to add focus keywords to see recommendations for this article.', 'wds' ); ?></p>
|
| 15 |
+
</div>
|
| 16 |
+
</div>
|
| 17 |
+
<?php return; ?>
|
| 18 |
+
<?php endif; // phpcs:ignore -- PHPCS misfires here and complains about the return statement above ?>
|
| 19 |
+
|
| 20 |
+
<div class="wds-seo-analysis wds-report" data-errors="<?php echo esc_attr( $error_count ); ?>">
|
| 21 |
+
|
| 22 |
+
<div class="wds-notice <?php echo $error_count > 0 ? 'wds-notice-warning' : 'wds-notice-success'; ?>">
|
| 23 |
+
<p>
|
| 24 |
+
<?php if ( $error_count > 0 ) : ?>
|
| 25 |
+
<?php printf( esc_html__( 'You have %d SEO recommendations. We recommend you satisfy as many improvements as possible to ensure your content gets found.', 'wds' ), intval( $error_count ) ); ?>
|
| 26 |
+
<?php else : ?>
|
| 27 |
+
<?php esc_html_e( 'You have optimized your SEO to the max. Bravo!', 'wds' ); ?>
|
| 28 |
+
<?php endif; ?>
|
| 29 |
+
</p>
|
| 30 |
+
</div>
|
| 31 |
+
<div class="wds-accordion">
|
| 32 |
+
<?php foreach ( $checks as $check_id => $result ) : ?>
|
| 33 |
+
<?php
|
| 34 |
+
$passed = $result['status'];
|
| 35 |
+
$ignored = $result['ignored'];
|
| 36 |
+
$recommendation = $result['recommendation'];
|
| 37 |
+
$more_info = $result['more_info'];
|
| 38 |
+
$status_msg = $result['status_msg'];
|
| 39 |
+
|
| 40 |
+
$classes_array = array();
|
| 41 |
+
$classes_array[] = $passed ? 'wds-check-success' : 'wds-check-warning';
|
| 42 |
+
$classes_array[] = $ignored ? 'wds-check-invalid disabled' : '';
|
| 43 |
+
$classes = implode( ' ', $classes_array );
|
| 44 |
+
?>
|
| 45 |
+
<div id="wds-check-<?php echo esc_attr( $check_id ); ?>"
|
| 46 |
+
class="wds-check-item wds-accordion-section <?php echo esc_attr( $classes ); ?>">
|
| 47 |
+
<div class="wds-accordion-handle">
|
| 48 |
+
<div class="wds-accordion-handle-part">
|
| 49 |
+
<?php echo wp_kses_post( $status_msg ); ?>
|
| 50 |
+
</div>
|
| 51 |
+
<?php if ( $ignored ) : ?>
|
| 52 |
+
<div class="wds-unignore-container wds-accordion-handle-part">
|
| 53 |
+
<button type="button"
|
| 54 |
+
id="wds-unignore-check-<?php echo esc_attr( $check_id ); ?>"
|
| 55 |
+
class="wds-unignore wds-button-with-loader wds-button-with-left-loader wds-disabled-during-request button button-small button-dark-o"
|
| 56 |
+
data-check_id="<?php echo esc_attr( $check_id ); ?>">
|
| 57 |
+
<?php esc_html_e( 'Restore', 'wds' ); ?>
|
| 58 |
+
</button>
|
| 59 |
+
</div>
|
| 60 |
+
<?php endif; ?>
|
| 61 |
+
</div>
|
| 62 |
+
<div class="wds-accordion-content">
|
| 63 |
+
<?php if ( $recommendation ) : ?>
|
| 64 |
+
<div class="wds-recommendation">
|
| 65 |
+
<div class="wds-small-text"><strong><?php esc_html_e( 'Recommendation', 'wds' ); ?></strong>
|
| 66 |
+
</div>
|
| 67 |
+
<p class="wds-small-text"><?php echo wp_kses_post( $recommendation ); ?></p>
|
| 68 |
+
</div>
|
| 69 |
+
<?php endif; ?>
|
| 70 |
+
|
| 71 |
+
<?php if ( $more_info ) : ?>
|
| 72 |
+
<div class="wds-more-info">
|
| 73 |
+
<div class="wds-small-text"><strong><?php esc_html_e( 'More Info', 'wds' ); ?></strong>
|
| 74 |
+
</div>
|
| 75 |
+
<p class="wds-small-text"><?php echo wp_kses_post( $more_info ); ?></p>
|
| 76 |
+
</div>
|
| 77 |
+
<?php endif; ?>
|
| 78 |
+
|
| 79 |
+
<?php if ( ! $ignored ) : ?>
|
| 80 |
+
<div class="wds-ignore-container">
|
| 81 |
+
<button type="button"
|
| 82 |
+
id="wds-ignore-check-<?php echo esc_attr( $check_id ); ?>"
|
| 83 |
+
class="wds-ignore wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request button button-small button-dark-o"
|
| 84 |
+
data-check_id="<?php echo esc_attr( $check_id ); ?>">
|
| 85 |
+
<?php esc_html_e( 'Ignore', 'wds' ); ?>
|
| 86 |
+
</button>
|
| 87 |
+
</div>
|
| 88 |
+
<?php endif; ?>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
<?php endforeach; ?>
|
| 92 |
+
<div class="cf"></div>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
includes/admin/templates/metabox/analysis-seo_analysis.php
DELETED
|
@@ -1,86 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
if ( ! Smartcrawl_Settings::get_setting( 'analysis-seo' ) ) { return false; }
|
| 3 |
-
|
| 4 |
-
$checks = empty( $checks ) ? array() : $checks;
|
| 5 |
-
$error_count = empty( $error_count ) ? 0 : $error_count;
|
| 6 |
-
$focus_keywords_available = empty( $focus_keywords_available ) ? false : $focus_keywords_available;
|
| 7 |
-
?>
|
| 8 |
-
|
| 9 |
-
<?php if ( ! $focus_keywords_available ) : ?>
|
| 10 |
-
<div class="wds-seo-analysis wds-no-focus-keywords">
|
| 11 |
-
<div class="wds-notice wds-notice-warning">
|
| 12 |
-
<p><?php esc_html_e( 'You need to add focus keywords to see recommendations for this article.', 'wds' ); ?></p>
|
| 13 |
-
</div>
|
| 14 |
-
</div>
|
| 15 |
-
<?php return; ?>
|
| 16 |
-
<?php endif; ?>
|
| 17 |
-
|
| 18 |
-
<div class="wds-seo-analysis wds-report" data-errors="<?php echo esc_attr( $error_count ); ?>">
|
| 19 |
-
|
| 20 |
-
<div class="wds-notice <?php echo $error_count > 0 ? 'wds-notice-warning' : 'wds-notice-success'; ?>">
|
| 21 |
-
<p>
|
| 22 |
-
<?php if ( $error_count > 0 ) : ?>
|
| 23 |
-
<?php esc_html_e( sprintf( 'You have %d SEO recommendations. We recommend you satisfy as many improvements as possible to ensure your content gets found.', $error_count ), 'wds' ); ?>
|
| 24 |
-
<?php else : ?>
|
| 25 |
-
<?php esc_html_e( 'You have optimized your SEO to the max. Bravo!', 'wds' ); ?>
|
| 26 |
-
<?php endif; ?>
|
| 27 |
-
</p>
|
| 28 |
-
</div>
|
| 29 |
-
<div class="wds-accordion">
|
| 30 |
-
<?php foreach ( $checks as $check_id => $result ) : ?>
|
| 31 |
-
<?php
|
| 32 |
-
/**
|
| 33 |
-
* @var $current_check Smartcrawl_Check_Abstract
|
| 34 |
-
*/
|
| 35 |
-
$current_check = $result['check'];
|
| 36 |
-
$passed = $result['status'];
|
| 37 |
-
$ignored = $result['ignored'];
|
| 38 |
-
$recommendation = $current_check->get_recommendation();
|
| 39 |
-
$more_info = $current_check->get_more_info();
|
| 40 |
-
|
| 41 |
-
$classes_array = array();
|
| 42 |
-
$classes_array[] = $passed ? 'wds-check-success' : 'wds-check-warning';
|
| 43 |
-
$classes_array[] = $ignored ? 'wds-check-invalid disabled' : '';
|
| 44 |
-
$classes = implode( ' ', $classes_array );
|
| 45 |
-
?>
|
| 46 |
-
<div class="wds-check-item wds-accordion-section <?php echo esc_attr( $classes ); ?>">
|
| 47 |
-
<div class="wds-accordion-handle">
|
| 48 |
-
<div class="wds-accordion-handle-part">
|
| 49 |
-
<?php echo wp_kses( $current_check->get_status_msg(), 'post' ); ?>
|
| 50 |
-
</div>
|
| 51 |
-
<?php if ( $ignored ) : ?>
|
| 52 |
-
<div class="wds-unignore-container wds-accordion-handle-part">
|
| 53 |
-
<button type="button" class="wds-unignore wds-button-with-loader wds-button-with-left-loader wds-disabled-during-request button button-small button-dark-o" data-check_id="<?php echo esc_attr( $check_id ); ?>">
|
| 54 |
-
<?php esc_html_e( 'Restore', 'wds' ); ?>
|
| 55 |
-
</button>
|
| 56 |
-
</div>
|
| 57 |
-
<?php endif; ?>
|
| 58 |
-
</div>
|
| 59 |
-
<div class="wds-accordion-content">
|
| 60 |
-
<?php if ( $recommendation ) : ?>
|
| 61 |
-
<div class="wds-recommendation">
|
| 62 |
-
<div class="wds-small-text"><strong><?php esc_html_e( 'Recommendation', 'wds' ); ?></strong></div>
|
| 63 |
-
<p class="wds-small-text"><?php echo wp_kses( $recommendation, 'post' ); ?></p>
|
| 64 |
-
</div>
|
| 65 |
-
<?php endif; ?>
|
| 66 |
-
|
| 67 |
-
<?php if ( $more_info ) : ?>
|
| 68 |
-
<div class="wds-more-info">
|
| 69 |
-
<div class="wds-small-text"><strong><?php esc_html_e( 'More Info', 'wds' ); ?></strong></div>
|
| 70 |
-
<p class="wds-small-text"><?php echo wp_kses( $more_info, 'post' ); ?></p>
|
| 71 |
-
</div>
|
| 72 |
-
<?php endif; ?>
|
| 73 |
-
|
| 74 |
-
<?php if ( ! $ignored ) : ?>
|
| 75 |
-
<div class="wds-ignore-container">
|
| 76 |
-
<button type="button" class="wds-ignore wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request button button-small button-dark-o" data-check_id="<?php echo esc_attr( $check_id ); ?>">
|
| 77 |
-
<?php esc_html_e( 'Ignore', 'wds' ); ?>
|
| 78 |
-
</button>
|
| 79 |
-
</div>
|
| 80 |
-
<?php endif; ?>
|
| 81 |
-
</div>
|
| 82 |
-
</div>
|
| 83 |
-
<?php endforeach; ?>
|
| 84 |
-
<div class="cf"></div>
|
| 85 |
-
</div>
|
| 86 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/metabox/analysis.php
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
<div class="wds-report">
|
| 2 |
-
<p><a href="#reload"><?php esc_html_e( 'Reload', 'wds' ); ?></a></p>
|
| 3 |
-
<?php
|
| 4 |
-
<?php
|
| 5 |
-
</div>
|
| 1 |
+
<div class="wds-report">
|
| 2 |
+
<p><a href="#reload"><?php esc_html_e( 'Reload', 'wds' ); ?></a></p>
|
| 3 |
+
<?php require_once SMARTCRAWL_PLUGIN_DIR . 'admin/templates/metabox/analysis-seo-analysis.php'; ?>
|
| 4 |
+
<?php require_once SMARTCRAWL_PLUGIN_DIR . 'admin/templates/metabox/analysis-readability.php'; ?>
|
| 5 |
+
</div>
|
includes/admin/templates/metabox/horizontal-tab-nav.php
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
?>
|
| 5 |
-
<div class="wds-horizontal-tab-nav">
|
| 6 |
-
<?php foreach ( $tabs as $tab_id => $tab_name ) :
|
| 7 |
-
|
| 8 |
-
<div class="wds-nav-item <?php echo $first_tab ? 'active' : ''; ?>">
|
| 9 |
-
<label for="<?php echo esc_attr( $tab_id ); ?>">
|
| 10 |
-
<?php echo
|
| 11 |
-
</label>
|
| 12 |
-
</div>
|
| 13 |
-
|
| 14 |
-
<?php $first_tab = false; ?>
|
| 15 |
-
<?php endforeach; ?>
|
| 16 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$tabs = empty( $tabs ) ? array() : $tabs;
|
| 3 |
+
$first_tab = true;
|
| 4 |
+
?>
|
| 5 |
+
<div class="wds-horizontal-tab-nav">
|
| 6 |
+
<?php foreach ( $tabs as $tab_id => $tab_name ) : ?>
|
| 7 |
+
|
| 8 |
+
<div class="wds-nav-item <?php echo $first_tab ? 'active' : ''; ?>">
|
| 9 |
+
<label for="<?php echo esc_attr( $tab_id ); ?>">
|
| 10 |
+
<?php echo wp_kses_post( $tab_name ); ?>
|
| 11 |
+
</label>
|
| 12 |
+
</div>
|
| 13 |
+
|
| 14 |
+
<?php $first_tab = false; ?>
|
| 15 |
+
<?php endforeach; ?>
|
| 16 |
+
</div>
|
includes/admin/templates/metabox/horizontal-tab.php
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
-
<section class="wds-horizontal-tab">
|
| 2 |
-
<?php
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
?>
|
| 8 |
-
<input
|
| 9 |
-
type="radio"
|
| 10 |
-
name="wds-horizontal-tab"
|
| 11 |
-
autocomplete="off"
|
| 12 |
-
id="<?php echo esc_attr( $tab_id ); ?>"
|
| 13 |
-
value="<?php echo esc_attr( $tab_id ); ?>"
|
| 14 |
-
<?php checked( $is_active ); ?> />
|
| 15 |
-
|
| 16 |
-
<div class="wds-horizontal-tab-content <?php echo esc_attr( $tab_id ); ?>">
|
| 17 |
-
<?php $this->_render( $content_template, $content_args ); ?>
|
| 18 |
-
</div>
|
| 19 |
-
</section>
|
| 1 |
+
<section class="wds-horizontal-tab">
|
| 2 |
+
<?php
|
| 3 |
+
$tab_id = empty( $tab_id ) ? '' : $tab_id;
|
| 4 |
+
$is_active = empty( $is_active ) ? false : $is_active;
|
| 5 |
+
$content_template = empty( $content_template ) ? '' : $content_template;
|
| 6 |
+
$content_args = empty( $content_args ) ? array() : $content_args;
|
| 7 |
+
?>
|
| 8 |
+
<input
|
| 9 |
+
type="radio"
|
| 10 |
+
name="wds-horizontal-tab"
|
| 11 |
+
autocomplete="off"
|
| 12 |
+
id="<?php echo esc_attr( $tab_id ); ?>"
|
| 13 |
+
value="<?php echo esc_attr( $tab_id ); ?>"
|
| 14 |
+
<?php checked( $is_active ); ?> />
|
| 15 |
+
|
| 16 |
+
<div class="wds-horizontal-tab-content <?php echo esc_attr( $tab_id ); ?>">
|
| 17 |
+
<?php $this->_render( $content_template, $content_args ); ?>
|
| 18 |
+
</div>
|
| 19 |
+
</section>
|
includes/admin/templates/metabox/metabox-main.php
CHANGED
|
@@ -1,88 +1,99 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Metabox entry point template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Metabox entry point template
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
$post = empty( $post ) ? null : $post;
|
| 9 |
+
$robots_noindex_value = empty( $robots_noindex_value ) ? false : $robots_noindex_value;
|
| 10 |
+
$robots_nofollow_value = empty( $robots_nofollow_value ) ? false : $robots_nofollow_value;
|
| 11 |
+
$robots_index_value = empty( $robots_index_value ) ? false : $robots_index_value;
|
| 12 |
+
$robots_follow_value = empty( $robots_follow_value ) ? false : $robots_follow_value;
|
| 13 |
+
$advanced_value = empty( $advanced_value ) ? array() : $advanced_value;
|
| 14 |
+
$advanced_options = empty( $advanced_options ) ? array() : $advanced_options;
|
| 15 |
+
$sitemap_priority_options = empty( $sitemap_priority_options ) ? array() : $sitemap_priority_options;
|
| 16 |
+
$all_options = Smartcrawl_Settings::get_options();
|
| 17 |
+
$og_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-enable' );
|
| 18 |
+
$og_post_type_enabled = (bool) smartcrawl_get_array_value( $all_options, 'og-active-' . get_post_type( $post ) );
|
| 19 |
+
$twitter_post_type_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-active-' . get_post_type( $post ) );
|
| 20 |
+
$twitter_setting_enabled = (bool) smartcrawl_get_array_value( $all_options, 'twitter-card-enable' );
|
| 21 |
+
$post_type_noindexed = (bool) smartcrawl_get_array_value( $all_options, sprintf( 'meta_robots-noindex-%s', get_post_type( $post ) ) );
|
| 22 |
+
$post_type_nofollowed = (bool) smartcrawl_get_array_value( $all_options, sprintf( 'meta_robots-nofollow-%s', get_post_type( $post ) ) );
|
| 23 |
+
$show_social_tab = ( $og_setting_enabled && $og_post_type_enabled ) || ( $twitter_setting_enabled && $twitter_post_type_enabled );
|
| 24 |
+
|
| 25 |
+
$tabs['wds_seo'] = esc_html__( 'SEO', 'wds' ) . '<span class="wds-issues"><span></span></span>';
|
| 26 |
+
$tabs['wds_readability'] = esc_html__( 'Readability', 'wds' ) . '<span class="wds-issues"><span></span></span>';
|
| 27 |
+
if ( $show_social_tab ) {
|
| 28 |
+
$tabs['wds_social'] = esc_html__( 'Social', 'wds' );
|
| 29 |
+
}
|
| 30 |
+
$tabs['wds_advanced'] = esc_html__( 'Advanced', 'wds' );
|
| 31 |
+
|
| 32 |
+
if ( ! Smartcrawl_Settings::get_setting( 'analysis-readability' ) ) {
|
| 33 |
+
unset( $tabs['wds_readability'] );
|
| 34 |
+
}
|
| 35 |
+
?>
|
| 36 |
+
<div class="wpmud wds-metabox">
|
| 37 |
+
<div id="container" class="wds-horizontal-tabs">
|
| 38 |
+
<?php wp_nonce_field( 'wds-metabox-nonce', '_wds_nonce' ); ?>
|
| 39 |
+
<?php
|
| 40 |
+
$this->_render( 'metabox/horizontal-tab-nav', array( 'tabs' => $tabs ) );
|
| 41 |
+
?>
|
| 42 |
+
<?php
|
| 43 |
+
$this->_render( 'metabox/horizontal-tab', array(
|
| 44 |
+
'tab_id' => 'wds_seo',
|
| 45 |
+
'is_active' => true,
|
| 46 |
+
'content_template' => 'metabox/metabox-tab-seo',
|
| 47 |
+
'content_args' => array(
|
| 48 |
+
'post' => $post,
|
| 49 |
+
),
|
| 50 |
+
) );
|
| 51 |
+
?>
|
| 52 |
+
|
| 53 |
+
<?php
|
| 54 |
+
if ( Smartcrawl_Settings::get_setting( 'analysis-readability' ) ) {
|
| 55 |
+
$this->_render( 'metabox/horizontal-tab', array(
|
| 56 |
+
'tab_id' => 'wds_readability',
|
| 57 |
+
'content_template' => 'metabox/metabox-tab-readability',
|
| 58 |
+
'content_args' => array(
|
| 59 |
+
'post' => $post,
|
| 60 |
+
),
|
| 61 |
+
) );
|
| 62 |
+
}
|
| 63 |
+
?>
|
| 64 |
+
|
| 65 |
+
<?php
|
| 66 |
+
if ( $show_social_tab ) {
|
| 67 |
+
$this->_render( 'metabox/horizontal-tab', array(
|
| 68 |
+
'tab_id' => 'wds_social',
|
| 69 |
+
'content_template' => 'metabox/metabox-tab-social',
|
| 70 |
+
'content_args' => array(
|
| 71 |
+
'post' => $post,
|
| 72 |
+
'og_setting_enabled' => $og_setting_enabled,
|
| 73 |
+
'og_post_type_enabled' => $og_post_type_enabled,
|
| 74 |
+
'twitter_setting_enabled' => $twitter_setting_enabled,
|
| 75 |
+
'twitter_post_type_enabled' => $twitter_post_type_enabled,
|
| 76 |
+
),
|
| 77 |
+
) );
|
| 78 |
+
}
|
| 79 |
+
?>
|
| 80 |
+
|
| 81 |
+
<?php
|
| 82 |
+
$this->_render( 'metabox/horizontal-tab', array(
|
| 83 |
+
'tab_id' => 'wds_advanced',
|
| 84 |
+
'content_template' => 'metabox/metabox-tab-advanced',
|
| 85 |
+
'content_args' => array(
|
| 86 |
+
'robots_noindex_value' => $robots_noindex_value,
|
| 87 |
+
'robots_nofollow_value' => $robots_nofollow_value,
|
| 88 |
+
'robots_index_value' => $robots_index_value,
|
| 89 |
+
'robots_follow_value' => $robots_follow_value,
|
| 90 |
+
'advanced_value' => $advanced_value,
|
| 91 |
+
'advanced_options' => $advanced_options,
|
| 92 |
+
'sitemap_priority_options' => $sitemap_priority_options,
|
| 93 |
+
'post_type_noindexed' => $post_type_noindexed,
|
| 94 |
+
'post_type_nofollowed' => $post_type_nofollowed,
|
| 95 |
+
),
|
| 96 |
+
) );
|
| 97 |
+
?>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
includes/admin/templates/metabox/metabox-meta-edit-form.php
CHANGED
|
@@ -1,94 +1,98 @@
|
|
| 1 |
-
<div class="wds-toggleable inactive wds-edit-meta-toggleable">
|
| 2 |
-
<label>
|
| 3 |
-
<a class="button button-dark button-small"><?php esc_html_e( 'Edit Meta', 'wds' ); ?></a>
|
| 4 |
-
<input type="checkbox" class="toggle-checkbox"/>
|
| 5 |
-
</label>
|
| 6 |
-
|
| 7 |
-
<div class="wds-toggleable-inside wds-toggleable-inside-box">
|
| 8 |
-
<div class="wds-table-fields wds-table-fields-stacked">
|
| 9 |
-
<?php
|
| 10 |
-
|
| 11 |
-
if ( ! $title_placeholder ) {
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="wds-toggleable inactive wds-edit-meta-toggleable">
|
| 2 |
+
<label>
|
| 3 |
+
<a class="button button-dark button-small"><?php esc_html_e( 'Edit Meta', 'wds' ); ?></a>
|
| 4 |
+
<input type="checkbox" class="toggle-checkbox"/>
|
| 5 |
+
</label>
|
| 6 |
+
|
| 7 |
+
<div class="wds-toggleable-inside wds-toggleable-inside-box">
|
| 8 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 9 |
+
<?php
|
| 10 |
+
$title_placeholder = smartcrawl_get_seo_title();
|
| 11 |
+
if ( ! $title_placeholder ) {
|
| 12 |
+
$title_placeholder = '';
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
$desc_placeholder = smartcrawl_get_seo_desc();
|
| 16 |
+
if ( ! $desc_placeholder ) {
|
| 17 |
+
$desc_placeholder = '';
|
| 18 |
+
}
|
| 19 |
+
?>
|
| 20 |
+
|
| 21 |
+
<?php if ( apply_filters( 'wds-metabox-visible_parts-title_area', true ) ) : ?>
|
| 22 |
+
<div class="label">
|
| 23 |
+
<label class="wds-label" for="wds_title">
|
| 24 |
+
<?php esc_html_e( 'SEO Title', 'wds' ); ?>
|
| 25 |
+
<span><?php echo esc_html( sprintf( __( '- Include your focus keywords. 50-%d characters recommended.', 'wds' ), SMARTCRAWL_TITLE_LENGTH_CHAR_COUNT_LIMIT ) ); ?></span>
|
| 26 |
+
</label>
|
| 27 |
+
</div>
|
| 28 |
+
<div class="fields">
|
| 29 |
+
<input type='text'
|
| 30 |
+
id='wds_title'
|
| 31 |
+
placeholder='<?php echo esc_html( $title_placeholder ); ?>'
|
| 32 |
+
name='wds_title'
|
| 33 |
+
value='<?php echo esc_html( smartcrawl_get_value( 'title' ) ); ?>'
|
| 34 |
+
class='wds wds-meta-field'/>
|
| 35 |
+
</div>
|
| 36 |
+
<?php endif; ?>
|
| 37 |
+
|
| 38 |
+
<?php if ( apply_filters( 'wds-metabox-visible_parts-description_area', true ) ) : ?>
|
| 39 |
+
<div class="label">
|
| 40 |
+
<label class="wds-label" for="wds_metadesc">
|
| 41 |
+
<?php esc_html_e( 'Description', 'wds' ); ?>
|
| 42 |
+
<span><?php echo esc_html( sprintf( __( '- Recommended minimum of 135 characters, maximum %d.', 'wds' ), SMARTCRAWL_METADESC_LENGTH_CHAR_COUNT_LIMIT ) ); ?></span>
|
| 43 |
+
</label>
|
| 44 |
+
</div>
|
| 45 |
+
<div class="fields">
|
| 46 |
+
<textarea rows='2'
|
| 47 |
+
name='wds_metadesc'
|
| 48 |
+
placeholder='<?php echo esc_html( $desc_placeholder ); ?>'
|
| 49 |
+
id='wds_metadesc'
|
| 50 |
+
class='wds wds-meta-field'><?php echo esc_html( smartcrawl_get_value( 'metadesc' ) ); ?></textarea>
|
| 51 |
+
</div>
|
| 52 |
+
<?php endif; ?>
|
| 53 |
+
|
| 54 |
+
<?php if ( apply_filters( 'wds-metabox-visible_parts-keywords_area', true ) ) : ?>
|
| 55 |
+
<div class="label">
|
| 56 |
+
<label class="wds-label" for="wds_keywords">
|
| 57 |
+
<?php esc_html_e( 'Keywords', 'wds' ); ?>
|
| 58 |
+
<span><?php esc_html_e( '- Try to avoid stop words like ‘and’ and ‘the’ which search engines ignore.', 'wds' ); ?></span>
|
| 59 |
+
</label>
|
| 60 |
+
</div>
|
| 61 |
+
<div class="fields">
|
| 62 |
+
<input type='text'
|
| 63 |
+
id='wds_keywords'
|
| 64 |
+
name='wds_keywords'
|
| 65 |
+
value='<?php echo esc_html( smartcrawl_get_value( 'keywords' ) ); ?>'
|
| 66 |
+
class='wds'/>
|
| 67 |
+
</div>
|
| 68 |
+
|
| 69 |
+
<div class="wds-extra-keyword-options">
|
| 70 |
+
<div class="label">
|
| 71 |
+
<label class="wds-label" for="wds_news_keywords">
|
| 72 |
+
<?php esc_html_e( 'News Keywords', 'wds' ); ?>
|
| 73 |
+
<span><?php esc_html_e( '- Try to avoid stop words like ‘and’ and ‘the’ which search engines ignore.', 'wds' ); ?></span>
|
| 74 |
+
</label>
|
| 75 |
+
</div>
|
| 76 |
+
<div class="fields">
|
| 77 |
+
<input type='text'
|
| 78 |
+
id='wds_news_keywords'
|
| 79 |
+
name='wds_news_keywords'
|
| 80 |
+
value='<?php echo esc_attr( smartcrawl_get_value( 'news_keywords' ) ); ?>'
|
| 81 |
+
class='wds'/>
|
| 82 |
+
</div>
|
| 83 |
+
|
| 84 |
+
<div class="wds-tags-as-keyword">
|
| 85 |
+
<?php
|
| 86 |
+
$this->_render( 'toggle-item', array(
|
| 87 |
+
'field_name' => 'wds_tags_to_keywords',
|
| 88 |
+
'checked' => smartcrawl_get_value( 'tags_to_keywords' ) ? 'checked="checked"' : '',
|
| 89 |
+
'item_label' => esc_html__( 'Tags As Keywords' ),
|
| 90 |
+
'item_description' => esc_html__( 'If you enable using tags, post tags will be merged in with any other keywords you enter in the text box.' ),
|
| 91 |
+
) );
|
| 92 |
+
?>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
<?php endif; ?>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
includes/admin/templates/metabox/metabox-preview.php
CHANGED
|
@@ -1,59 +1,63 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Metabox preview template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
if ( empty( $title ) && $post ) {
|
| 15 |
-
$title = $post->post_title;
|
| 16 |
-
}
|
| 17 |
-
if ( empty( $title ) ) {
|
| 18 |
-
$title = esc_html__( 'Dummy Title', 'wds' );
|
| 19 |
-
}
|
| 20 |
-
if ( is_object( $post ) ) {
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
$
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Metabox preview template
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
$post = empty( $post ) ? null : $post;
|
| 9 |
+
|
| 10 |
+
// Date.
|
| 11 |
+
$date = $post ? date( 'M j, Y', strtotime( $post->post_date ) ) : date( 'M j, Y' );
|
| 12 |
+
// Title.
|
| 13 |
+
$title = empty( $title ) ? smartcrawl_get_value( 'title' ) : $title;
|
| 14 |
+
if ( empty( $title ) && $post ) {
|
| 15 |
+
$title = $post->post_title;
|
| 16 |
+
}
|
| 17 |
+
if ( empty( $title ) ) {
|
| 18 |
+
$title = esc_html__( 'Dummy Title', 'wds' );
|
| 19 |
+
}
|
| 20 |
+
if ( is_object( $post ) ) {
|
| 21 |
+
$title = smartcrawl_replace_vars( $title, (array) $post );
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
// Description.
|
| 25 |
+
$description = empty( $description ) ? smartcrawl_get_value( 'metadesc' ) : $description;
|
| 26 |
+
if ( empty( $description ) && $post ) {
|
| 27 |
+
$description = $post->post_excerpt;
|
| 28 |
+
}
|
| 29 |
+
if ( empty( $description ) && $post ) {
|
| 30 |
+
$description = substr( strip_tags( $post->post_content ), 0, 130 );
|
| 31 |
+
}
|
| 32 |
+
if ( empty( $description ) ) {
|
| 33 |
+
$description = __( 'Dummy description', 'wds' );
|
| 34 |
+
}
|
| 35 |
+
if ( is_object( $post ) ) {
|
| 36 |
+
$description = smartcrawl_replace_vars( $description, (array) $post );
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
// Slug.
|
| 40 |
+
$slug = ! empty( $post->post_name ) ? $post->post_name : sanitize_title( $title );
|
| 41 |
+
?>
|
| 42 |
+
<div class="wds-metabox-preview">
|
| 43 |
+
<label class="wds-label"><?php esc_html_e( 'Google Preview' ); ?></label>
|
| 44 |
+
|
| 45 |
+
<?php
|
| 46 |
+
if ( apply_filters( 'wds-metabox-visible_parts-preview_area', true ) ) {
|
| 47 |
+
$link = sprintf(
|
| 48 |
+
'%s/%s/',
|
| 49 |
+
str_replace( 'http://', '', get_bloginfo( 'url' ) ),
|
| 50 |
+
$slug
|
| 51 |
+
);
|
| 52 |
+
if ( ! empty( $post ) && is_object( $post ) && ! empty( $post->ID ) ) {
|
| 53 |
+
$link = get_permalink( $post->ID );
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
$this->_render( 'onpage/onpage-preview', array(
|
| 57 |
+
'link' => esc_url( $link ),
|
| 58 |
+
'title' => esc_html( $title ),
|
| 59 |
+
'description' => esc_html( $description ),
|
| 60 |
+
) );
|
| 61 |
+
}
|
| 62 |
+
?>
|
| 63 |
+
</div>
|
includes/admin/templates/metabox/metabox-seo-analysis-container.php
CHANGED
|
@@ -1,39 +1,45 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$post = empty( $post ) ? null : $post;
|
| 3 |
+
$refresh_button_disabled = 'auto-draft' === get_post_status() ? 'disabled' : '';
|
| 4 |
+
?>
|
| 5 |
+
|
| 6 |
+
<div class="wds-seo-analysis-container">
|
| 7 |
+
<div class="cf wds-seo-analysis-label">
|
| 8 |
+
<label class="wds-label"><?php esc_html_e( 'SEO Analysis', 'wds' ); ?></label>
|
| 9 |
+
|
| 10 |
+
<button <?php esc_attr( $refresh_button_disabled ); ?>
|
| 11 |
+
class="button button-small button-dark button-dark-o wds-refresh-analysis wds-analysis-seo wds-disabled-during-request"
|
| 12 |
+
type="button">
|
| 13 |
+
<span><?php esc_html_e( 'Refresh', 'wds' ); ?></span>
|
| 14 |
+
</button>
|
| 15 |
+
</div>
|
| 16 |
+
|
| 17 |
+
<?php
|
| 18 |
+
$this->_render( 'mascot-message', array(
|
| 19 |
+
'key' => 'metabox-seo-analysis',
|
| 20 |
+
'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' ),
|
| 21 |
+
) );
|
| 22 |
+
?>
|
| 23 |
+
|
| 24 |
+
<?php if ( apply_filters( 'wds-metabox-visible_parts-focus_area', true ) ) : ?>
|
| 25 |
+
<div class="wds-focus-keyword wds-table-fields wds-table-fields-stacked">
|
| 26 |
+
<div class="label">
|
| 27 |
+
<label class="wds-label" for='wds_focus'>
|
| 28 |
+
<?php esc_html_e( 'Focus keyword', 'wds' ); ?>
|
| 29 |
+
<span><?php esc_html_e( '- Choose a single word, phrase or part of a sentence that people will likely search for.', 'wds' ); ?></span>
|
| 30 |
+
</label>
|
| 31 |
+
</div>
|
| 32 |
+
<div class="fields">
|
| 33 |
+
<input type='text'
|
| 34 |
+
id='wds_focus'
|
| 35 |
+
name='wds_focus'
|
| 36 |
+
value='<?php echo esc_html( smartcrawl_get_value( 'focus-keywords' ) ); ?>'
|
| 37 |
+
class='wds wds-disabled-during-request'
|
| 38 |
+
placeholder="<?php esc_html_e( 'E.g. broken iphone screen', 'wds' ); ?>"/>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
<?php endif; ?>
|
| 42 |
+
|
| 43 |
+
<a href="#reload"><?php esc_html_e( 'Reload', 'wds' ); ?></a>
|
| 44 |
+
<?php do_action( 'wds-editor-metabox-seo-analysis', $post ); ?>
|
| 45 |
+
</div>
|
includes/admin/templates/metabox/metabox-social-meta-tags.php
CHANGED
|
@@ -1,93 +1,97 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
?>
|
| 15 |
-
<div class="wds-table-fields-group wds-separator-top">
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
<?php
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
)
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
<?php
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
<?php
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$post = empty( $post ) ? null : $post;
|
| 3 |
+
$main_title = empty( $main_title ) ? '' : $main_title;
|
| 4 |
+
$main_description = empty( $main_description ) ? '' : $main_description;
|
| 5 |
+
$field_name = empty( $field_name ) ? '' : $field_name;
|
| 6 |
+
$disabled = empty( $disabled ) ? false : true;
|
| 7 |
+
$current_title = empty( $current_title ) ? '' : $current_title;
|
| 8 |
+
$title_placeholder = empty( $title_placeholder ) ? '' : $title_placeholder;
|
| 9 |
+
$current_description = empty( $current_description ) ? '' : $current_description;
|
| 10 |
+
$description_placeholder = empty( $description_placeholder ) ? '' : $description_placeholder;
|
| 11 |
+
$images = empty( $images ) ? array() : $images;
|
| 12 |
+
$images_available = ! empty( $images ) && is_array( $images );
|
| 13 |
+
$single_image = empty( $single_image ) ? false : true;
|
| 14 |
+
?>
|
| 15 |
+
<div class="wds-table-fields-group wds-separator-top">
|
| 16 |
+
<div class="wds-table-fields">
|
| 17 |
+
<div class="label">
|
| 18 |
+
<label class="wds-label"><?php echo esc_html( $main_title ); ?></label>
|
| 19 |
+
<p class="wds-label-description"><?php echo esc_html( $main_description ); ?></p>
|
| 20 |
+
</div>
|
| 21 |
+
<div class="fields">
|
| 22 |
+
<div class="wds-toggleable inverted <?php echo $disabled ? 'inactive' : ''; ?>">
|
| 23 |
+
<?php
|
| 24 |
+
$this->_render( 'toggle-item', array(
|
| 25 |
+
'inverted' => true,
|
| 26 |
+
'field_name' => $field_name . '[disabled]',
|
| 27 |
+
'field_id' => $field_name . '-disabled',
|
| 28 |
+
'checked' => checked( $disabled, true, false ),
|
| 29 |
+
'item_label' => esc_html__( 'Enable for this post', 'wds' ),
|
| 30 |
+
) );
|
| 31 |
+
?>
|
| 32 |
+
<div
|
| 33 |
+
class="wds-toggleable-inside wds-toggleable-inside-box wds-table-fields-group <?php echo esc_attr( $field_name ); ?>-meta">
|
| 34 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 35 |
+
<div class="label">
|
| 36 |
+
<label for="<?php echo esc_attr( $field_name ); ?>-title"
|
| 37 |
+
class="wds-label"><?php esc_html_e( 'Title', 'wds' ); ?></label>
|
| 38 |
+
</div>
|
| 39 |
+
<div class="fields">
|
| 40 |
+
<input type="text"
|
| 41 |
+
id="<?php echo esc_attr( $field_name ); ?>-title"
|
| 42 |
+
name="<?php echo esc_attr( $field_name ); ?>[title]"
|
| 43 |
+
placeholder="<?php echo esc_attr( smartcrawl_replace_vars( $title_placeholder, $post ) ); ?>"
|
| 44 |
+
value="<?php echo esc_attr( $current_title ); ?>"/>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 49 |
+
<div class="label">
|
| 50 |
+
<label for="<?php echo esc_attr( $field_name ); ?>-description" class="wds-label">
|
| 51 |
+
<?php esc_html_e( 'Description', 'wds' ); ?>
|
| 52 |
+
</label>
|
| 53 |
+
</div>
|
| 54 |
+
<div class="fields">
|
| 55 |
+
<textarea name="<?php echo esc_attr( $field_name ); ?>[description]"
|
| 56 |
+
placeholder="<?php echo esc_attr( smartcrawl_replace_vars( $description_placeholder, $post ) ); ?>"
|
| 57 |
+
id="<?php echo esc_attr( $field_name ); ?>-description"><?php echo esc_textarea( $current_description ); ?></textarea>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 62 |
+
<div class="label">
|
| 63 |
+
<label for="<?php echo esc_attr( $field_name ); ?>-images" class="wds-label">
|
| 64 |
+
<?php echo $single_image ? esc_html__( 'Featured Image', 'wds' ) : esc_html__( 'Featured Images', 'wds' ); ?>
|
| 65 |
+
</label>
|
| 66 |
+
</div>
|
| 67 |
+
<div class="fields og-images"
|
| 68 |
+
data-singular="<?php echo $single_image ? 'true' : 'false'; ?>"
|
| 69 |
+
data-name="<?php echo esc_attr( $field_name ); ?>[images]">
|
| 70 |
+
<div class="add-action-wrapper item"
|
| 71 |
+
style="<?php echo $single_image && $images_available ? 'display:none;' : ''; ?>">
|
| 72 |
+
<a id="<?php echo esc_attr( $field_name ); ?>-images" href="#add" title="<?php esc_attr_e( 'Add image', 'wds' ); ?>">
|
| 73 |
+
<i class="wds-icon-plus"></i>
|
| 74 |
+
</a>
|
| 75 |
+
</div>
|
| 76 |
+
<?php if ( $images_available ) : ?>
|
| 77 |
+
<?php foreach ( $images as $img ) : ?>
|
| 78 |
+
<input type="text" class="widefat"
|
| 79 |
+
name="<?php echo esc_attr( $field_name ); ?>[images][]"
|
| 80 |
+
value="<?php echo esc_attr( $img ); ?>"/>
|
| 81 |
+
<?php endforeach; ?>
|
| 82 |
+
<?php endif; ?>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<p class="wds-label-description">
|
| 87 |
+
<?php if ( $single_image ): ?>
|
| 88 |
+
<?php esc_html_e( 'This image will be used as the featured image when the post is shared.', 'wds' ); ?>
|
| 89 |
+
<?php else: ?>
|
| 90 |
+
<?php esc_html_e( 'Each of these images will be available to use as the featured image when the post is shared.', 'wds' ); ?>
|
| 91 |
+
<?php endif; ?>
|
| 92 |
+
</p>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
includes/admin/templates/metabox/metabox-tab-advanced.php
CHANGED
|
@@ -1,136 +1,166 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
'
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
'
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
'
|
| 36 |
-
'
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
'
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
'
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
'
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
'
|
| 55 |
-
'
|
| 56 |
-
'
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
<div class="
|
| 96 |
-
<
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$robots_noindex_value = empty( $robots_noindex_value ) ? false : $robots_noindex_value;
|
| 3 |
+
$robots_nofollow_value = empty( $robots_nofollow_value ) ? false : $robots_nofollow_value;
|
| 4 |
+
$robots_index_value = empty( $robots_index_value ) ? false : true;
|
| 5 |
+
$robots_follow_value = empty( $robots_follow_value ) ? false : true;
|
| 6 |
+
$advanced_value = empty( $advanced_value ) ? array() : $advanced_value;
|
| 7 |
+
$advanced_options = empty( $advanced_options ) ? array() : $advanced_options;
|
| 8 |
+
$sitemap_priority_options = empty( $sitemap_priority_options ) ? array() : $sitemap_priority_options;
|
| 9 |
+
$post_type_noindexed = empty( $post_type_noindexed ) ? false : true;
|
| 10 |
+
$post_type_nofollowed = empty( $post_type_nofollowed ) ? false : true;
|
| 11 |
+
?>
|
| 12 |
+
|
| 13 |
+
<div class="wds-metabox-section wds-advanced-metabox-section wds-form">
|
| 14 |
+
<div class="wds-table-fields-group">
|
| 15 |
+
<?php if ( apply_filters( 'wds-metabox-visible_parts-robots_area', true ) ) : ?>
|
| 16 |
+
<div class="wds-table-fields">
|
| 17 |
+
<div class="label">
|
| 18 |
+
<label class="wds-label"><?php esc_html_e( 'Indexing', 'wds' ); ?></label>
|
| 19 |
+
<p class="wds-label-description">
|
| 20 |
+
<?php esc_html_e( 'Choose how search engines will index this particular page.', 'wds' ); ?>
|
| 21 |
+
</p>
|
| 22 |
+
</div>
|
| 23 |
+
<div class="fields">
|
| 24 |
+
<?php
|
| 25 |
+
if ( $post_type_noindexed ) {
|
| 26 |
+
$this->_render( 'toggle-item', array(
|
| 27 |
+
'field_name' => 'wds_meta-robots-index',
|
| 28 |
+
'field_id' => 'wds_meta-robots-index',
|
| 29 |
+
'checked' => $robots_index_value ? 'checked="checked"' : '',
|
| 30 |
+
'item_label' => esc_html__( 'Index - Override Post Type Setting', 'wds' ),
|
| 31 |
+
'item_description' => esc_html__( 'Instruct search engines whether or not you want this post to appear in search results.', 'wds' ),
|
| 32 |
+
) );
|
| 33 |
+
} else {
|
| 34 |
+
$this->_render( 'toggle-item', array(
|
| 35 |
+
'inverted' => true,
|
| 36 |
+
'field_name' => 'wds_meta-robots-noindex',
|
| 37 |
+
'field_id' => 'wds_meta-robots-noindex',
|
| 38 |
+
'checked' => $robots_noindex_value ? 'checked="checked"' : '',
|
| 39 |
+
'item_label' => esc_html__( 'Index', 'wds' ),
|
| 40 |
+
'item_description' => esc_html__( 'Instruct search engines whether or not you want this post to appear in search results.', 'wds' ),
|
| 41 |
+
) );
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
if ( $post_type_nofollowed ) {
|
| 45 |
+
$this->_render( 'toggle-item', array(
|
| 46 |
+
'field_name' => 'wds_meta-robots-follow',
|
| 47 |
+
'field_id' => 'wds_meta-robots-follow',
|
| 48 |
+
'checked' => $robots_follow_value ? 'checked="checked"' : '',
|
| 49 |
+
'item_label' => esc_html__( 'Follow - Override Post Type Setting', 'wds' ),
|
| 50 |
+
'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your page and crawl them too.', 'wds' ),
|
| 51 |
+
) );
|
| 52 |
+
} else {
|
| 53 |
+
$this->_render( 'toggle-item', array(
|
| 54 |
+
'inverted' => true,
|
| 55 |
+
'field_name' => 'wds_meta-robots-nofollow',
|
| 56 |
+
'field_id' => 'wds_meta-robots-nofollow',
|
| 57 |
+
'checked' => $robots_nofollow_value ? 'checked="checked"' : '',
|
| 58 |
+
'item_label' => esc_html__( 'Follow', 'wds' ),
|
| 59 |
+
'item_description' => esc_html__( 'Tells search engines whether or not to follow the links on your page and crawl them too.', 'wds' ),
|
| 60 |
+
) );
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
$this->_render( 'toggle-item', array(
|
| 64 |
+
'inverted' => true,
|
| 65 |
+
'item_value' => 'noarchive',
|
| 66 |
+
'field_name' => 'wds_meta-robots-adv[noarchive]',
|
| 67 |
+
'field_id' => 'wds_meta-robots-noarchive',
|
| 68 |
+
'checked' => in_array( 'noarchive', $advanced_value, true ) ? 'checked="checked"' : '',
|
| 69 |
+
'item_label' => esc_html__( 'Archive', 'wds' ),
|
| 70 |
+
'item_description' => esc_html__( 'Instructs search engines to store a cached version of this page.', 'wds' ),
|
| 71 |
+
) );
|
| 72 |
+
|
| 73 |
+
$this->_render( 'toggle-item', array(
|
| 74 |
+
'inverted' => true,
|
| 75 |
+
'item_value' => 'nosnippet',
|
| 76 |
+
'field_name' => 'wds_meta-robots-adv[nosnippet]',
|
| 77 |
+
'field_id' => 'wds_meta-robots-nosnippet',
|
| 78 |
+
'checked' => in_array( 'nosnippet', $advanced_value, true ) ? 'checked="checked"' : '',
|
| 79 |
+
'item_label' => esc_html__( 'Snippet', 'wds' ),
|
| 80 |
+
'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' ),
|
| 81 |
+
) );
|
| 82 |
+
?>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
<?php endif; ?>
|
| 86 |
+
|
| 87 |
+
<?php if ( apply_filters( 'wds-metabox-visible_parts-canonical_area', true ) ) : ?>
|
| 88 |
+
<div class="wds-table-fields wds-separator-top">
|
| 89 |
+
<div class="label">
|
| 90 |
+
<label for="wds_canonical" class="wds-label"><?php esc_html_e( 'Canonical', 'wds' ); ?></label>
|
| 91 |
+
<p class="wds-label-description">
|
| 92 |
+
<?php esc_html_e( 'If you have several similar versions of this page you can point search engines to the canonical or "genuine" version to avoid duplicate content issues.', 'wds' ); ?>
|
| 93 |
+
</p>
|
| 94 |
+
</div>
|
| 95 |
+
<div class="fields">
|
| 96 |
+
<input type='text' id='wds_canonical' name='wds_canonical'
|
| 97 |
+
value='<?php echo esc_attr( smartcrawl_get_value( 'canonical' ) ); ?>' class='wds'/>
|
| 98 |
+
<span
|
| 99 |
+
class="wds-field-legend"><?php esc_html_e( 'Enter the full canonical URL including http:// or https://', 'wds' ); ?></span>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
<?php endif; ?>
|
| 103 |
+
|
| 104 |
+
<?php if ( apply_filters( 'wds-metabox-visible_parts-redirect_area', true ) && user_can_see_seo_metabox_301_redirect() ) : ?>
|
| 105 |
+
<div class="wds-table-fields wds-separator-top">
|
| 106 |
+
<div class="label">
|
| 107 |
+
<label for="wds_redirect" class="wds-label"><?php esc_html_e( '301 Redirect', 'wds' ); ?></label>
|
| 108 |
+
<p class="wds-label-description">
|
| 109 |
+
<?php esc_html_e( 'Send visitors to this URL to another page.', 'wds' ); ?>
|
| 110 |
+
</p>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="fields">
|
| 113 |
+
<input type='text' id='wds_redirect' name='wds_redirect'
|
| 114 |
+
value='<?php echo esc_attr( smartcrawl_get_value( 'redirect' ) ); ?>' class='wds'/>
|
| 115 |
+
<span
|
| 116 |
+
class="wds-field-legend"><?php esc_html_e( 'Enter the URL to send traffic to including http:// or https://', 'wds' ); ?></span>
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
+
<?php endif; ?>
|
| 120 |
+
|
| 121 |
+
<?php if ( apply_filters( 'wds-metabox-visible_parts-sitemap_priority_area', true ) ) : ?>
|
| 122 |
+
<div class="wds-table-fields wds-separator-top">
|
| 123 |
+
<div class="label">
|
| 124 |
+
<label for='wds_sitemap-priority'
|
| 125 |
+
class="wds-label"><?php esc_html_e( 'Sitemap Priority', 'wds' ); ?></label>
|
| 126 |
+
</div>
|
| 127 |
+
<div class="fields">
|
| 128 |
+
<select name='wds_sitemap-priority'
|
| 129 |
+
id='wds_sitemap-priority'
|
| 130 |
+
class="select-container"
|
| 131 |
+
style="width: 100%">
|
| 132 |
+
|
| 133 |
+
<?php $priority_value = smartcrawl_get_value( 'sitemap-priority' ); ?>
|
| 134 |
+
|
| 135 |
+
<?php foreach ( $sitemap_priority_options as $key => $label ) : ?>
|
| 136 |
+
<option value='<?php echo esc_attr( $key ); ?>' <?php selected( $key, $priority_value ); ?>>
|
| 137 |
+
<?php echo esc_html( $label ); ?>
|
| 138 |
+
</option>
|
| 139 |
+
<?php endforeach; ?>
|
| 140 |
+
</select>
|
| 141 |
+
</div>
|
| 142 |
+
</div>
|
| 143 |
+
<?php endif; ?>
|
| 144 |
+
|
| 145 |
+
<div class="wds-table-fields wds-separator-top">
|
| 146 |
+
<div class="label">
|
| 147 |
+
<label class="wds-label" for="wds_autolinks-exclude">
|
| 148 |
+
<?php esc_html_e( 'Automatic Linking', 'wds' ); ?>
|
| 149 |
+
</label>
|
| 150 |
+
<p class="wds-label-description">
|
| 151 |
+
<?php esc_html_e( 'You can prevent this particular post from being auto-linked', 'wds' ); ?>
|
| 152 |
+
</p>
|
| 153 |
+
</div>
|
| 154 |
+
<div class="fields">
|
| 155 |
+
<?php
|
| 156 |
+
$this->_render( 'toggle-item', array(
|
| 157 |
+
'inverted' => true,
|
| 158 |
+
'field_name' => 'wds_autolinks-exclude',
|
| 159 |
+
'checked' => smartcrawl_get_value( 'autolinks-exclude' ) ? 'checked="checked"' : '',
|
| 160 |
+
'item_label' => esc_html__( 'Enable automatic linking for this post', 'wds' ),
|
| 161 |
+
) );
|
| 162 |
+
?>
|
| 163 |
+
</div>
|
| 164 |
+
</div>
|
| 165 |
+
</div>
|
| 166 |
+
</div>
|
includes/admin/templates/metabox/metabox-tab-readability.php
CHANGED
|
@@ -1,13 +1,15 @@
|
|
| 1 |
-
<?php if ( ! Smartcrawl_Settings::get_setting( 'analysis-readability' ) ) {
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
<
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
<span><strong><?php esc_html_e( '
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
| 1 |
+
<?php if ( ! Smartcrawl_Settings::get_setting( 'analysis-readability' ) ) {
|
| 2 |
+
return false;
|
| 3 |
+
} ?>
|
| 4 |
+
<div class="wds-metabox-section">
|
| 5 |
+
<p><?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' ); ?></p>
|
| 6 |
+
<a href="#reload"><?php esc_html_e( 'Reload', 'wds' ); ?></a>
|
| 7 |
+
|
| 8 |
+
<p class="wds-readability-legend wds-small-text">
|
| 9 |
+
<span><strong><?php esc_html_e( 'Difficult', 'wds' ); ?></strong> <?php esc_html_e( '= Less than 60', 'wds' ); ?></span>
|
| 10 |
+
<span><strong><?php esc_html_e( 'OK', 'wds' ); ?></strong> <?php esc_html_e( '= 60 to 70', 'wds' ); ?></span>
|
| 11 |
+
<span><strong><?php esc_html_e( 'Easy', 'wds' ); ?></strong> <?php esc_html_e( '= 70+', 'wds' ); ?></span>
|
| 12 |
+
</p>
|
| 13 |
+
|
| 14 |
+
<?php do_action( 'wds-editor-metabox-readability-analysis', $post ); ?>
|
| 15 |
+
</div>
|
includes/admin/templates/metabox/metabox-tab-seo.php
CHANGED
|
@@ -1,25 +1,25 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-form">
|
| 6 |
-
<div class="wds-metabox-section">
|
| 7 |
-
<?php
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
?>
|
| 12 |
-
|
| 13 |
-
<?php $this->_render( 'metabox/metabox-meta-edit-form' ); ?>
|
| 14 |
-
</div>
|
| 15 |
-
|
| 16 |
-
<?php if ( Smartcrawl_Settings::get_setting( 'analysis-seo' ) ) { ?>
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
$this->_render('metabox/metabox-seo-analysis-container', array(
|
| 20 |
-
'post' => $post,
|
| 21 |
-
));
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
<?php } ?>
|
| 25 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$post = empty( $post ) ? null : $post;
|
| 3 |
+
?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-form">
|
| 6 |
+
<div class="wds-metabox-section">
|
| 7 |
+
<?php
|
| 8 |
+
$this->_render( 'metabox/metabox-preview', array(
|
| 9 |
+
'post' => $post,
|
| 10 |
+
) );
|
| 11 |
+
?>
|
| 12 |
+
|
| 13 |
+
<?php $this->_render( 'metabox/metabox-meta-edit-form' ); ?>
|
| 14 |
+
</div>
|
| 15 |
+
|
| 16 |
+
<?php if ( Smartcrawl_Settings::get_setting( 'analysis-seo' ) ) { ?>
|
| 17 |
+
<div class="wds-metabox-section">
|
| 18 |
+
<?php
|
| 19 |
+
$this->_render( 'metabox/metabox-seo-analysis-container', array(
|
| 20 |
+
'post' => $post,
|
| 21 |
+
) );
|
| 22 |
+
?>
|
| 23 |
+
</div>
|
| 24 |
+
<?php } ?>
|
| 25 |
+
</div>
|
includes/admin/templates/metabox/metabox-tab-social.php
CHANGED
|
@@ -1,99 +1,98 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
<
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$post = empty( $post ) ? null : $post;
|
| 3 |
+
$og_setting_enabled = empty( $og_setting_enabled ) ? false : $og_setting_enabled;
|
| 4 |
+
$og_post_type_enabled = empty( $og_post_type_enabled ) ? false : $og_post_type_enabled;
|
| 5 |
+
$twitter_setting_enabled = empty( $twitter_setting_enabled ) ? false : $twitter_setting_enabled;
|
| 6 |
+
$twitter_post_type_enabled = empty( $twitter_post_type_enabled ) ? false : $twitter_post_type_enabled;
|
| 7 |
+
$onpage_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_ONPAGE );
|
| 8 |
+
|
| 9 |
+
if ( ! is_a( $post, 'WP_Post' ) ) {
|
| 10 |
+
return;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
$og = smartcrawl_get_value( 'opengraph' );
|
| 14 |
+
if ( ! is_array( $og ) ) {
|
| 15 |
+
$og = array();
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
$og = wp_parse_args( $og, array(
|
| 19 |
+
'title' => false,
|
| 20 |
+
'description' => false,
|
| 21 |
+
'images' => false,
|
| 22 |
+
'disabled' => false,
|
| 23 |
+
) );
|
| 24 |
+
|
| 25 |
+
$og_printer = Smartcrawl_OpenGraph_Printer::get();
|
| 26 |
+
$og_meta_disabled = (bool) smartcrawl_get_array_value( $og, 'disabled' );
|
| 27 |
+
|
| 28 |
+
$twitter = smartcrawl_get_value( 'twitter' );
|
| 29 |
+
if ( ! is_array( $twitter ) ) {
|
| 30 |
+
$twitter = array();
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
$twitter = wp_parse_args( $twitter, array(
|
| 34 |
+
'title' => false,
|
| 35 |
+
'description' => false,
|
| 36 |
+
'images' => false,
|
| 37 |
+
'disabled' => false,
|
| 38 |
+
) );
|
| 39 |
+
|
| 40 |
+
$twitter_printer = Smartcrawl_Twitter_Printer::get();
|
| 41 |
+
$twitter_meta_disabled = smartcrawl_get_array_value( $twitter, 'disabled' );
|
| 42 |
+
|
| 43 |
+
$resolver = Smartcrawl_Endpoint_Resolver::resolve();
|
| 44 |
+
$resolver->simulate_post( $post->ID );
|
| 45 |
+
?>
|
| 46 |
+
<div class="wds-metabox-section wds-social-settings-metabox-section wds-form">
|
| 47 |
+
<p>
|
| 48 |
+
<?php
|
| 49 |
+
printf(
|
| 50 |
+
esc_html__( "Customize this posts title, description and featured images for social shares. You can also configure the default settings for this post type in SmartCrawl's %s area.", 'wds' ),
|
| 51 |
+
sprintf(
|
| 52 |
+
'<a href="%s">%s</a>',
|
| 53 |
+
esc_url_raw( $onpage_url ),
|
| 54 |
+
esc_html__( 'Titles & Meta', 'wds' )
|
| 55 |
+
)
|
| 56 |
+
);
|
| 57 |
+
?>
|
| 58 |
+
</p>
|
| 59 |
+
<?php if ( $og_setting_enabled && $og_post_type_enabled ) : ?>
|
| 60 |
+
<?php
|
| 61 |
+
$this->_render( 'metabox/metabox-social-meta-tags', array(
|
| 62 |
+
'post' => $post,
|
| 63 |
+
'main_title' => __( 'OpenGraph', 'wds' ),
|
| 64 |
+
'main_description' => __( 'OpenGraph is used on many social networks such as Facebook.', 'wds' ),
|
| 65 |
+
'field_name' => 'wds-opengraph',
|
| 66 |
+
'disabled' => $og_meta_disabled,
|
| 67 |
+
'current_title' => $og['title'],
|
| 68 |
+
'title_placeholder' => $og_printer->get_tag_value( 'title' ),
|
| 69 |
+
'current_description' => $og['description'],
|
| 70 |
+
'description_placeholder' => $og_printer->get_tag_value( 'description' ),
|
| 71 |
+
'images' => $og['images'],
|
| 72 |
+
'single_image' => false,
|
| 73 |
+
) );
|
| 74 |
+
?>
|
| 75 |
+
<?php endif; ?>
|
| 76 |
+
|
| 77 |
+
<?php if ( $twitter_setting_enabled && $twitter_post_type_enabled ) : ?>
|
| 78 |
+
<?php
|
| 79 |
+
$this->_render( 'metabox/metabox-social-meta-tags', array(
|
| 80 |
+
'post' => $post,
|
| 81 |
+
'main_title' => __( 'Twitter', 'wds' ),
|
| 82 |
+
'main_description' => __( 'These details will be used in Twitter cards.', 'wds' ),
|
| 83 |
+
'field_name' => 'wds-twitter',
|
| 84 |
+
'disabled' => $twitter_meta_disabled,
|
| 85 |
+
'current_title' => $twitter['title'],
|
| 86 |
+
'title_placeholder' => $twitter_printer->get_title_content(),
|
| 87 |
+
'current_description' => $twitter['description'],
|
| 88 |
+
'description_placeholder' => $twitter_printer->get_description_content(),
|
| 89 |
+
'images' => $twitter['images'],
|
| 90 |
+
'single_image' => true,
|
| 91 |
+
) );
|
| 92 |
+
?>
|
| 93 |
+
<?php endif; ?>
|
| 94 |
+
|
| 95 |
+
<?php
|
| 96 |
+
$resolver->stop_simulation();
|
| 97 |
+
?>
|
| 98 |
+
</div>
|
|
|
includes/admin/templates/native-dismissible-notice-javascript.php
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script type="application/javascript">
|
| 2 |
+
jQuery(function ($) {
|
| 3 |
+
$(document).on('click', '.wds-native-dismissible-notice .notice-dismiss', function () {
|
| 4 |
+
var message_key = $(this).closest('.wds-native-dismissible-notice').data('messageKey');
|
| 5 |
+
$.post(
|
| 6 |
+
ajaxurl,
|
| 7 |
+
{
|
| 8 |
+
action: 'wds_dismiss_message',
|
| 9 |
+
message: message_key,
|
| 10 |
+
_wds_nonce: '<?php echo esc_js( wp_create_nonce( 'wds-admin-nonce' ) ); ?>'
|
| 11 |
+
},
|
| 12 |
+
'json'
|
| 13 |
+
);
|
| 14 |
+
});
|
| 15 |
+
});
|
| 16 |
+
</script>
|
includes/admin/templates/notice.php
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
?>
|
| 5 |
-
<div class="wds-notice <?php echo esc_attr( $class ); ?>">
|
| 6 |
-
<p><?php echo
|
| 7 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$message = empty( $message ) ? '' : $message;
|
| 3 |
+
$class = empty( $class ) ? 'wds-notice-warning' : $class;
|
| 4 |
+
?>
|
| 5 |
+
<div class="wds-notice <?php echo esc_attr( $class ); ?>">
|
| 6 |
+
<p><?php echo wp_kses_post( $message ); ?></p>
|
| 7 |
+
</div>
|
includes/admin/templates/onpage/onpage-marketpress-tabs.php
DELETED
|
@@ -1,83 +0,0 @@
|
|
| 1 |
-
<?php if ( class_exists( 'MarketPress_MS' ) && ( is_network_admin() || is_main_site() ) ) { ?>
|
| 2 |
-
<section class="tab">
|
| 3 |
-
<input type="radio" name="wds-admin-active-tab" id="tab-marketpress" value="tab-marketpress" <?php checked( $active_tab, 'tab-marketpress' ); ?>>
|
| 4 |
-
<label for="tab-marketpress"><?php esc_html_e( 'MarketPress', 'wds' ); ?></label>
|
| 5 |
-
<div class="content wds-content-tabs">
|
| 6 |
-
<h2 class="tab-title"><?php esc_html_e( 'MarketPress', 'wds' ); ?></h2>
|
| 7 |
-
|
| 8 |
-
<div class="wds-content-tabs-inner">
|
| 9 |
-
|
| 10 |
-
<div class="wds-table-fields-group">
|
| 11 |
-
<div class="wds-table-fields">
|
| 12 |
-
<div class="label">
|
| 13 |
-
<label for="title-mp_marketplace-base" class="wds-label"><?php esc_html_e( 'Marketplace Base Title' , 'wds' ); ?></label>
|
| 14 |
-
</div>
|
| 15 |
-
<div class="fields wds-allow-macros">
|
| 16 |
-
<input id='title-mp_marketplace-base' name='<?php echo esc_attr( $_view['option_name'] ); ?>[title-mp_marketplace-base]' type='text' class='wds-field' value='<?php echo esc_attr( $_view['options']['title-mp_marketplace-base'] ); ?>'>
|
| 17 |
-
</div>
|
| 18 |
-
</div>
|
| 19 |
-
</div>
|
| 20 |
-
|
| 21 |
-
<div class="wds-table-fields-group">
|
| 22 |
-
<div class="wds-table-fields">
|
| 23 |
-
<div class="label label-long">
|
| 24 |
-
<label for="metadesc-mp_marketplace-base" class="wds-label"><?php _e( 'Marketplace Base<br> Meta Description' , 'wds' ); ?></label>
|
| 25 |
-
</div>
|
| 26 |
-
<div class="fields wds-allow-macros">
|
| 27 |
-
<textarea id='metadesc-mp_marketplace-base' name='<?php echo esc_attr( $_view['option_name'] ); ?>[metadesc-mp_marketplace-base]' type='text' class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-mp_marketplace-base'] ); ?></textarea>
|
| 28 |
-
</div>
|
| 29 |
-
</div>
|
| 30 |
-
</div>
|
| 31 |
-
|
| 32 |
-
<div class="wds-table-fields-group">
|
| 33 |
-
<div class="wds-table-fields">
|
| 34 |
-
<div class="label label-long">
|
| 35 |
-
<label for="title-mp_marketplace-categories" class="wds-label"><?php _e( 'Marketplace Categories<br> Title' , 'wds' ); ?></label>
|
| 36 |
-
</div>
|
| 37 |
-
<div class="fields wds-allow-macros">
|
| 38 |
-
<input id='title-mp_marketplace-categories' name='<?php echo esc_attr( $_view['option_name'] ); ?>[title-mp_marketplace-categories]' type='text' class='wds-field' value='<?php echo esc_attr( $_view['options']['title-mp_marketplace-categories'] ); ?>'>
|
| 39 |
-
</div>
|
| 40 |
-
</div>
|
| 41 |
-
</div>
|
| 42 |
-
|
| 43 |
-
<div class="wds-table-fields-group">
|
| 44 |
-
<div class="wds-table-fields">
|
| 45 |
-
<div class="label">
|
| 46 |
-
<label for="metadesc-mp_marketplace-categories" class="wds-label"><?php _e( 'Marketplace Categories<br> Meta Description' , 'wds' ); ?></label>
|
| 47 |
-
</div>
|
| 48 |
-
<div class="fields wds-allow-macros">
|
| 49 |
-
<textarea id='metadesc-mp_marketplace-categories' name='<?php echo esc_attr( $_view['option_name'] ); ?>[metadesc-mp_marketplace-categories]' type='text' class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-mp_marketplace-categories'] ); ?></textarea>
|
| 50 |
-
</div>
|
| 51 |
-
</div>
|
| 52 |
-
</div>
|
| 53 |
-
|
| 54 |
-
<div class="wds-table-fields-group">
|
| 55 |
-
<div class="wds-table-fields">
|
| 56 |
-
<div class="label label-long">
|
| 57 |
-
<label for="title-mp_marketplace-tags" class="wds-label"><?php _e( 'Marketplace Tags<br> Title' , 'wds' ); ?></label>
|
| 58 |
-
</div>
|
| 59 |
-
<div class="fields wds-allow-macros">
|
| 60 |
-
<input id='title-mp_marketplace-tags' name='<?php echo esc_attr( $_view['option_name'] ); ?>[title-mp_marketplace-tags]' type='text' class='wds-field' value='<?php echo esc_attr( $_view['options']['title-mp_marketplace-tags'] ); ?>'>
|
| 61 |
-
</div>
|
| 62 |
-
</div>
|
| 63 |
-
</div>
|
| 64 |
-
|
| 65 |
-
<div class="wds-table-fields-group">
|
| 66 |
-
<div class="wds-table-fields">
|
| 67 |
-
<div class="label">
|
| 68 |
-
<label for="metadesc-mp_marketplace-tags" class="wds-label"><?php _e( 'Marketplace Tags<br> Meta Description' , 'wds' ); ?></label>
|
| 69 |
-
</div>
|
| 70 |
-
<div class="fields wds-allow-macros">
|
| 71 |
-
<textarea id='metadesc-mp_marketplace-tags' name='<?php echo esc_attr( $_view['option_name'] ); ?>[metadesc-mp_marketplace-tags]' type='text' class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-mp_marketplace-tags'] ); ?></textarea>
|
| 72 |
-
</div>
|
| 73 |
-
</div>
|
| 74 |
-
</div>
|
| 75 |
-
|
| 76 |
-
</div><!-- end wds-content-tabs-inner -->
|
| 77 |
-
<div class="wds-seamless-footer">
|
| 78 |
-
<input name='submit' type='submit' class='button' value='<?php echo esc_attr( __( 'Save Settings' , 'wds' ) ); ?>'>
|
| 79 |
-
</div>
|
| 80 |
-
|
| 81 |
-
</div>
|
| 82 |
-
</section>
|
| 83 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/onpage/onpage-meta-robots.php
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
if ( ! $items ) {
|
| 5 |
-
return;
|
| 6 |
-
}
|
| 7 |
-
?>
|
| 8 |
-
|
| 9 |
-
<?php
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$items = empty( $items ) ? array() : $items;
|
| 3 |
+
|
| 4 |
+
if ( ! $items ) {
|
| 5 |
+
return;
|
| 6 |
+
}
|
| 7 |
+
?>
|
| 8 |
+
|
| 9 |
+
<?php
|
| 10 |
+
$this->_render( 'toggle-group', array(
|
| 11 |
+
'label' => __( 'Indexing', 'wds' ),
|
| 12 |
+
'description' => __( '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
|
@@ -1,14 +1,18 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$message = esc_html__( 'OpenGraph is globally disabled.', 'wds' );
|
| 3 |
+
if ( smartcrawl_subsite_setting_page_enabled( 'wds_social' ) ) {
|
| 4 |
+
$message = sprintf(
|
| 5 |
+
esc_html__( '%1$s You can enable it %2$s.', 'wds' ),
|
| 6 |
+
$message,
|
| 7 |
+
sprintf(
|
| 8 |
+
'<a href="%s">%s</a>',
|
| 9 |
+
Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SOCIAL ),
|
| 10 |
+
esc_html__( 'here', 'wds' )
|
| 11 |
+
)
|
| 12 |
+
);
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
$this->_render( 'notice', array(
|
| 16 |
+
'class' => 'wds-notice-info',
|
| 17 |
+
'message' => $message,
|
| 18 |
+
) );
|
includes/admin/templates/onpage/onpage-og-settings.php
CHANGED
|
@@ -1,38 +1,38 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 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 = __( 'OpenGraph support enhances how your content appears when shared on social networks such as Facebook.', 'wds' );
|
| 9 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 10 |
+
$title_field_id = 'og-title-' . $for_type;
|
| 11 |
+
$current_title = ! empty( $_view['options']["og-title-{$for_type}"] )
|
| 12 |
+
? $_view['options']["og-title-{$for_type}"]
|
| 13 |
+
: '';
|
| 14 |
+
|
| 15 |
+
$description_field_id = 'og-description-' . $for_type;
|
| 16 |
+
$current_description = ! empty( $_view['options']["og-description-{$for_type}"] )
|
| 17 |
+
? $_view['options']["og-description-{$for_type}"]
|
| 18 |
+
: '';
|
| 19 |
+
|
| 20 |
+
$images_field_id = 'og-images-' . $for_type;
|
| 21 |
+
$current_images = ! empty( $_view['options']["og-images-{$for_type}"] ) && is_array( $_view['options']["og-images-{$for_type}"] )
|
| 22 |
+
? $_view['options']["og-images-{$for_type}"]
|
| 23 |
+
: array();
|
| 24 |
+
|
| 25 |
+
$this->_render( 'onpage/onpage-social-meta-tags', array(
|
| 26 |
+
'for_type' => $for_type,
|
| 27 |
+
'section_enabled_field_id' => $section_enabled_field_id,
|
| 28 |
+
'section_enabled' => $section_enabled,
|
| 29 |
+
'section_title' => $section_title,
|
| 30 |
+
'section_description' => $section_description,
|
| 31 |
+
'option_name' => $option_name,
|
| 32 |
+
'title_field_id' => $title_field_id,
|
| 33 |
+
'current_title' => $current_title,
|
| 34 |
+
'description_field_id' => $description_field_id,
|
| 35 |
+
'current_description' => $current_description,
|
| 36 |
+
'images_field_id' => $images_field_id,
|
| 37 |
+
'current_images' => $current_images,
|
| 38 |
+
) );
|
includes/admin/templates/onpage/onpage-og-twitter.php
CHANGED
|
@@ -1,50 +1,50 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
?>
|
| 16 |
-
<fieldset class="wds-table-fields-group wds-separator-top">
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
<?php esc_html_e('Options', 'wds'); ?>
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
<?php
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
?>
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
<?php
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
?>
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
</fieldset>
|
| 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 |
+
|
| 8 |
+
$og_enabled_field_id = 'og-active-' . esc_attr( $for_type );
|
| 9 |
+
$og_enabled_globally = smartcrawl_get_array_value( $social_options, 'og-enable' );
|
| 10 |
+
$og_enabled_locally = ! empty( $onpage_options[ $og_enabled_field_id ] ) ? $onpage_options[ $og_enabled_field_id ] : false;
|
| 11 |
+
|
| 12 |
+
$twitter_enabled_field_id = 'twitter-active-' . esc_attr( $for_type );
|
| 13 |
+
$twitter_enabled_globally = smartcrawl_get_array_value( $social_options, 'twitter-card-enable' );
|
| 14 |
+
$twitter_enabled_locally = ! empty( $onpage_options[ $twitter_enabled_field_id ] ) ? $onpage_options[ $twitter_enabled_field_id ] : false;
|
| 15 |
+
?>
|
| 16 |
+
<fieldset class="wds-table-fields-group wds-separator-top">
|
| 17 |
+
<div class="wds-table-fields">
|
| 18 |
+
<div class="label">
|
| 19 |
+
<label class="wds-label">
|
| 20 |
+
<?php esc_html_e( 'Options', 'wds' ); ?>
|
| 21 |
+
</label>
|
| 22 |
+
</div>
|
| 23 |
+
<div class="fields">
|
| 24 |
+
<div class="wds-toggleable <?php echo $og_enabled_locally ? '' : 'inactive'; ?>">
|
| 25 |
+
<?php
|
| 26 |
+
if ( ! $og_enabled_globally ) {
|
| 27 |
+
$this->_render( 'onpage/onpage-og-disabled' );
|
| 28 |
+
} else {
|
| 29 |
+
$this->_render( 'onpage/onpage-og-settings', array(
|
| 30 |
+
'for_type' => $for_type,
|
| 31 |
+
) );
|
| 32 |
+
}
|
| 33 |
+
?>
|
| 34 |
+
</div>
|
| 35 |
+
<p></p>
|
| 36 |
+
|
| 37 |
+
<div class="wds-toggleable <?php echo $twitter_enabled_locally ? '' : 'inactive'; ?>">
|
| 38 |
+
<?php
|
| 39 |
+
if ( ! $twitter_enabled_globally ) {
|
| 40 |
+
$this->_render( 'onpage/onpage-twitter-disabled' );
|
| 41 |
+
} else {
|
| 42 |
+
$this->_render( 'onpage/onpage-twitter-settings', array(
|
| 43 |
+
'for_type' => $for_type,
|
| 44 |
+
) );
|
| 45 |
+
}
|
| 46 |
+
?>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
</fieldset>
|
includes/admin/templates/onpage/onpage-preview.php
CHANGED
|
@@ -1,26 +1,26 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
?>
|
| 7 |
-
<div class="wds-preview-container">
|
| 8 |
-
<div class="wds-preview">
|
| 9 |
-
<div class="wds-preview-title">
|
| 10 |
-
<h3>
|
| 11 |
-
<a href="<?php echo esc_url( $link ); ?>">
|
| 12 |
-
<?php echo esc_html( $title ); ?>
|
| 13 |
-
</a>
|
| 14 |
-
</h3>
|
| 15 |
-
</div>
|
| 16 |
-
<div class="wds-preview-url">
|
| 17 |
-
<a href="<?php echo esc_url( $link ); ?>">
|
| 18 |
-
<?php echo esc_url( $link ); ?>
|
| 19 |
-
</a>
|
| 20 |
-
</div>
|
| 21 |
-
<div class="wds-preview-meta">
|
| 22 |
-
<?php echo esc_html( $description ); ?>
|
| 23 |
-
</div>
|
| 24 |
-
</div>
|
| 25 |
-
<p class="wds-preview-description"><?php
|
| 26 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 3 |
+
$link = ! isset( $link ) ? home_url() : $link;
|
| 4 |
+
$title = ! isset( $title ) ? smartcrawl_replace_vars( $smartcrawl_options['title-home'] ) : $title;
|
| 5 |
+
$description = ! isset( $description ) ? smartcrawl_replace_vars( $smartcrawl_options['metadesc-home'] ) : $description;
|
| 6 |
+
?>
|
| 7 |
+
<div class="wds-preview-container">
|
| 8 |
+
<div class="wds-preview">
|
| 9 |
+
<div class="wds-preview-title">
|
| 10 |
+
<h3>
|
| 11 |
+
<a href="<?php echo esc_url( $link ); ?>">
|
| 12 |
+
<?php echo esc_html( $title ); ?>
|
| 13 |
+
</a>
|
| 14 |
+
</h3>
|
| 15 |
+
</div>
|
| 16 |
+
<div class="wds-preview-url">
|
| 17 |
+
<a href="<?php echo esc_url( $link ); ?>">
|
| 18 |
+
<?php echo esc_url( $link ); ?>
|
| 19 |
+
</a>
|
| 20 |
+
</div>
|
| 21 |
+
<div class="wds-preview-meta">
|
| 22 |
+
<?php echo esc_html( $description ); ?>
|
| 23 |
+
</div>
|
| 24 |
+
</div>
|
| 25 |
+
<p class="wds-preview-description"><?php esc_html_e( 'A preview of how your title and meta will appear in Google Search.', 'wds' ); ?></p>
|
| 26 |
+
</div>
|
includes/admin/templates/onpage/onpage-section-404.php
CHANGED
|
@@ -1,25 +1,27 @@
|
|
| 1 |
-
<?php $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name']; ?>
|
| 2 |
-
|
| 3 |
-
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-table-fields-group">
|
| 6 |
-
<div class="wds-table-fields">
|
| 7 |
-
<div class="label">
|
| 8 |
-
<label for="title-404" class="wds-label"><?php esc_html_e( '404 Page Title'
|
| 9 |
-
</div>
|
| 10 |
-
<div class="fields wds-allow-macros">
|
| 11 |
-
<input id='title-404' name='<?php echo esc_attr( $option_name ); ?>[title-404]' type='text'
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
</div>
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
</div>
|
|
|
|
|
|
| 1 |
+
<?php $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name']; ?>
|
| 2 |
+
|
| 3 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-table-fields-group">
|
| 6 |
+
<div class="wds-table-fields">
|
| 7 |
+
<div class="label">
|
| 8 |
+
<label for="title-404" class="wds-label"><?php esc_html_e( '404 Page Title', 'wds' ); ?></label>
|
| 9 |
+
</div>
|
| 10 |
+
<div class="fields wds-allow-macros">
|
| 11 |
+
<input id='title-404' name='<?php echo esc_attr( $option_name ); ?>[title-404]' type='text'
|
| 12 |
+
class='wds-field' value='<?php echo esc_attr( $_view['options']['title-404'] ); ?>'>
|
| 13 |
+
</div>
|
| 14 |
+
</div>
|
| 15 |
+
</div>
|
| 16 |
+
|
| 17 |
+
<div class="wds-table-fields-group">
|
| 18 |
+
<div class="wds-table-fields">
|
| 19 |
+
<div class="label">
|
| 20 |
+
<label for="metadesc-404" class="wds-label"><?php esc_html_e( '404 Page Description', 'wds' ); ?></label>
|
| 21 |
+
</div>
|
| 22 |
+
<div class="fields wds-allow-macros">
|
| 23 |
+
<textarea id='metadesc-404' name='<?php echo esc_attr( $option_name ); ?>[metadesc-404]' type='text'
|
| 24 |
+
class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-404'] ); ?></textarea>
|
| 25 |
+
</div>
|
| 26 |
+
</div>
|
| 27 |
+
</div>
|
includes/admin/templates/onpage/onpage-section-author-archive.php
CHANGED
|
@@ -1,40 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
?>
|
| 5 |
-
|
| 6 |
-
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 7 |
-
|
| 8 |
-
<div class="wds-table-fields-group">
|
| 9 |
-
<div class="wds-table-fields">
|
| 10 |
-
<div class="label">
|
| 11 |
-
<label for="title-author" class="wds-label"><?php esc_html_e( 'Author Archive Title'
|
| 12 |
-
</div>
|
| 13 |
-
<div class="fields wds-allow-macros">
|
| 14 |
-
<input id='title-author' name='<?php echo esc_attr( $option_name ); ?>[title-author]' type='text'
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
</div>
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 3 |
+
$meta_robots_author = empty( $meta_robots_author ) ? '' : $meta_robots_author;
|
| 4 |
+
?>
|
| 5 |
+
|
| 6 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 7 |
+
|
| 8 |
+
<div class="wds-table-fields-group">
|
| 9 |
+
<div class="wds-table-fields">
|
| 10 |
+
<div class="label">
|
| 11 |
+
<label for="title-author" class="wds-label"><?php esc_html_e( 'Author Archive Title', 'wds' ); ?></label>
|
| 12 |
+
</div>
|
| 13 |
+
<div class="fields wds-allow-macros">
|
| 14 |
+
<input id='title-author' name='<?php echo esc_attr( $option_name ); ?>[title-author]' type='text'
|
| 15 |
+
class='wds-field' value='<?php echo esc_attr( $_view['options']['title-author'] ); ?>'>
|
| 16 |
+
</div>
|
| 17 |
+
</div>
|
| 18 |
+
</div>
|
| 19 |
+
|
| 20 |
+
<div class="wds-table-fields-group">
|
| 21 |
+
<div class="wds-table-fields">
|
| 22 |
+
<div class="label">
|
| 23 |
+
<label for="metadesc-author"
|
| 24 |
+
class="wds-label"><?php esc_html_e( 'Author Archive Meta Description', 'wds' ); ?></label>
|
| 25 |
+
</div>
|
| 26 |
+
<div class="fields wds-allow-macros">
|
| 27 |
+
<textarea id='metadesc-author' name='<?php echo esc_attr( $option_name ); ?>[metadesc-author]' type='text'
|
| 28 |
+
class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-author'] ); ?></textarea>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
|
| 33 |
+
<?php
|
| 34 |
+
$this->_render( 'onpage/onpage-og-twitter', array(
|
| 35 |
+
'for_type' => 'author',
|
| 36 |
+
) );
|
| 37 |
+
?>
|
| 38 |
+
|
| 39 |
+
<?php
|
| 40 |
+
$this->_render( 'onpage/onpage-meta-robots', array(
|
| 41 |
+
'items' => $meta_robots_author,
|
| 42 |
+
) );
|
| 43 |
+
?>
|
includes/admin/templates/onpage/onpage-section-buddypress-groups.php
CHANGED
|
@@ -1,25 +1,31 @@
|
|
| 1 |
-
<?php $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name']; ?>
|
| 2 |
-
|
| 3 |
-
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-table-fields-group">
|
| 6 |
-
<div class="wds-table-fields">
|
| 7 |
-
<div class="label">
|
| 8 |
-
<label for="title-bp_groups"
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
<div class="
|
| 22 |
-
<
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name']; ?>
|
| 2 |
+
|
| 3 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-table-fields-group">
|
| 6 |
+
<div class="wds-table-fields">
|
| 7 |
+
<div class="label">
|
| 8 |
+
<label for="title-bp_groups"
|
| 9 |
+
class="wds-label"><?php esc_html_e( 'BuddyPress Group Title', 'wds' ); ?></label>
|
| 10 |
+
</div>
|
| 11 |
+
<div class="fields wds-allow-macros">
|
| 12 |
+
<input id='title-bp_groups' name='<?php echo esc_attr( $option_name ); ?>[title-bp_groups]' size=''
|
| 13 |
+
type='text' class='wds-field'
|
| 14 |
+
value='<?php echo esc_attr( $_view['options']['title-bp_groups'] ); ?>'>
|
| 15 |
+
</div>
|
| 16 |
+
</div>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<div class="wds-table-fields-group">
|
| 20 |
+
<div class="wds-table-fields">
|
| 21 |
+
<div class="label">
|
| 22 |
+
<label for="metadesc-bp_groups"
|
| 23 |
+
class="wds-label"><?php esc_html_e( 'BuddyPress Group Meta Description', 'wds' ); ?></label>
|
| 24 |
+
</div>
|
| 25 |
+
<div class="fields wds-allow-macros">
|
| 26 |
+
<textarea id='metadesc-bp_groups' name='<?php echo esc_attr( $option_name ); ?>[metadesc-bp_groups]'
|
| 27 |
+
type='text'
|
| 28 |
+
class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-bp_groups'] ); ?></textarea>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
includes/admin/templates/onpage/onpage-section-buddypress-profile.php
CHANGED
|
@@ -1,25 +1,31 @@
|
|
| 1 |
-
<?php $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name']; ?>
|
| 2 |
-
|
| 3 |
-
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-table-fields-group">
|
| 6 |
-
<div class="wds-table-fields">
|
| 7 |
-
<div class="label">
|
| 8 |
-
<label for="title-bp_profile"
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
<div class="
|
| 22 |
-
<
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php $option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name']; ?>
|
| 2 |
+
|
| 3 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-table-fields-group">
|
| 6 |
+
<div class="wds-table-fields">
|
| 7 |
+
<div class="label">
|
| 8 |
+
<label for="title-bp_profile"
|
| 9 |
+
class="wds-label"><?php esc_html_e( 'BuddyPress Profile Title', 'wds' ); ?></label>
|
| 10 |
+
</div>
|
| 11 |
+
<div class="fields wds-allow-macros">
|
| 12 |
+
<input id='title-bp_profile' name='<?php echo esc_attr( $option_name ); ?>[title-bp_profile]' size=''
|
| 13 |
+
type='text' class='wds-field'
|
| 14 |
+
value='<?php echo esc_attr( $_view['options']['title-bp_profile'] ); ?>'>
|
| 15 |
+
</div>
|
| 16 |
+
</div>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<div class="wds-table-fields-group">
|
| 20 |
+
<div class="wds-table-fields">
|
| 21 |
+
<div class="label">
|
| 22 |
+
<label for="metadesc-bp_profile"
|
| 23 |
+
class="wds-label"><?php esc_html_e( 'BuddyPress Profile Meta Description', 'wds' ); ?></label>
|
| 24 |
+
</div>
|
| 25 |
+
<div class="fields wds-allow-macros">
|
| 26 |
+
<textarea id='metadesc-bp_profile' name='<?php echo esc_attr( $option_name ); ?>[metadesc-bp_profile]'
|
| 27 |
+
type='text'
|
| 28 |
+
class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-bp_profile'] ); ?></textarea>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
includes/admin/templates/onpage/onpage-section-date-archive.php
CHANGED
|
@@ -1,40 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
?>
|
| 5 |
-
|
| 6 |
-
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 7 |
-
|
| 8 |
-
<div class="wds-table-fields-group">
|
| 9 |
-
<div class="wds-table-fields">
|
| 10 |
-
<div class="label">
|
| 11 |
-
<label for="title-date" class="wds-label"><?php esc_html_e( 'Date Archives Title'
|
| 12 |
-
</div>
|
| 13 |
-
<div class="fields wds-allow-macros">
|
| 14 |
-
<input id='title-date' name='<?php echo esc_attr( $option_name ); ?>[title-date]' type='text'
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
</div>
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 3 |
+
$meta_robots_date = empty( $meta_robots_date ) ? array() : $meta_robots_date;
|
| 4 |
+
?>
|
| 5 |
+
|
| 6 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 7 |
+
|
| 8 |
+
<div class="wds-table-fields-group">
|
| 9 |
+
<div class="wds-table-fields">
|
| 10 |
+
<div class="label">
|
| 11 |
+
<label for="title-date" class="wds-label"><?php esc_html_e( 'Date Archives Title', 'wds' ); ?></label>
|
| 12 |
+
</div>
|
| 13 |
+
<div class="fields wds-allow-macros">
|
| 14 |
+
<input id='title-date' name='<?php echo esc_attr( $option_name ); ?>[title-date]' type='text'
|
| 15 |
+
class='wds-field' value='<?php echo esc_attr( $_view['options']['title-date'] ); ?>'>
|
| 16 |
+
</div>
|
| 17 |
+
</div>
|
| 18 |
+
</div>
|
| 19 |
+
|
| 20 |
+
<div class="wds-table-fields-group">
|
| 21 |
+
<div class="wds-table-fields">
|
| 22 |
+
<div class="label">
|
| 23 |
+
<label for="metadesc-date"
|
| 24 |
+
class="wds-label"><?php esc_html_e( 'Date Archives Meta Description', 'wds' ); ?></label>
|
| 25 |
+
</div>
|
| 26 |
+
<div class="fields wds-allow-macros">
|
| 27 |
+
<textarea id='metadesc-date' name='<?php echo esc_attr( $option_name ); ?>[metadesc-date]' type='text'
|
| 28 |
+
class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-date'] ); ?></textarea>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
|
| 33 |
+
<?php
|
| 34 |
+
$this->_render( 'onpage/onpage-og-twitter', array(
|
| 35 |
+
'for_type' => 'date',
|
| 36 |
+
) );
|
| 37 |
+
?>
|
| 38 |
+
|
| 39 |
+
<?php
|
| 40 |
+
$this->_render( 'onpage/onpage-meta-robots', array(
|
| 41 |
+
'items' => $meta_robots_date,
|
| 42 |
+
) );
|
| 43 |
+
?>
|
includes/admin/templates/onpage/onpage-section-homepage.php
CHANGED
|
@@ -1,91 +1,99 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
?>
|
| 8 |
-
|
| 9 |
-
<?php
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
?>
|
| 19 |
-
|
| 20 |
-
<?php if ( $show_homepage_options ) :
|
| 21 |
-
|
| 22 |
-
<div class="wds-table-fields-group">
|
| 23 |
-
<div class="wds-table-fields">
|
| 24 |
-
<div class="label">
|
| 25 |
-
<label for="title-homepage" class="wds-label"><?php esc_html_e( 'Page Title'
|
| 26 |
-
</div>
|
| 27 |
-
<div class="fields wds-allow-macros">
|
| 28 |
-
<input id='title-homepage' name='<?php echo esc_attr( $_view['option_name'] ); ?>[title-home]'
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
<
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
<?php
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$homepage_title = empty( $homepage_title ) ? '' : $homepage_title;
|
| 3 |
+
$homepage_description = empty( $homepage_description ) ? '' : $homepage_description;
|
| 4 |
+
$show_homepage_options = empty( $show_homepage_options ) ? '' : $show_homepage_options;
|
| 5 |
+
$meta_robots_main_blog_archive = empty( $meta_robots_main_blog_archive ) ? '' : $meta_robots_main_blog_archive;
|
| 6 |
+
$option_name = empty( $_view['option_name'] ) ? '' : '';
|
| 7 |
+
?>
|
| 8 |
+
|
| 9 |
+
<?php
|
| 10 |
+
$this->_render(
|
| 11 |
+
'onpage/onpage-preview',
|
| 12 |
+
array(
|
| 13 |
+
'link' => home_url(),
|
| 14 |
+
'title' => smartcrawl_replace_vars( $homepage_title, array() ),
|
| 15 |
+
'description' => smartcrawl_replace_vars( $homepage_description, array() ),
|
| 16 |
+
)
|
| 17 |
+
);
|
| 18 |
+
?>
|
| 19 |
+
|
| 20 |
+
<?php if ( $show_homepage_options ) : ?>
|
| 21 |
+
|
| 22 |
+
<div class="wds-table-fields-group">
|
| 23 |
+
<div class="wds-table-fields">
|
| 24 |
+
<div class="label">
|
| 25 |
+
<label for="title-homepage" class="wds-label"><?php esc_html_e( 'Page Title', 'wds' ); ?></label>
|
| 26 |
+
</div>
|
| 27 |
+
<div class="fields wds-allow-macros">
|
| 28 |
+
<input id='title-homepage' name='<?php echo esc_attr( $_view['option_name'] ); ?>[title-home]'
|
| 29 |
+
type='text' class='wds-field' value='<?php echo esc_attr( $_view['options']['title-home'] ); ?>'>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
<div class="wds-table-fields-group">
|
| 35 |
+
<div class="wds-table-fields">
|
| 36 |
+
<div class="label">
|
| 37 |
+
<label for="metadesc-homepage"
|
| 38 |
+
class="wds-label"><?php esc_html_e( 'Page Description', 'wds' ); ?></label>
|
| 39 |
+
</div>
|
| 40 |
+
<div class="fields wds-allow-macros">
|
| 41 |
+
<textarea id='metadesc-homepage' name='<?php echo esc_attr( $_view['option_name'] ); ?>[metadesc-home]'
|
| 42 |
+
type='text'
|
| 43 |
+
class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-home'] ); ?></textarea>
|
| 44 |
+
</div>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<div class="wds-table-fields-group">
|
| 49 |
+
<div class="wds-table-fields">
|
| 50 |
+
<div class="label">
|
| 51 |
+
<label for="metakeywords-homepage"
|
| 52 |
+
class="wds-label"><?php esc_html_e( 'Page Keywords', 'wds' ); ?></label>
|
| 53 |
+
</div>
|
| 54 |
+
<div class="fields fields-with-legend">
|
| 55 |
+
<input id='metakeywords-homepage' name='<?php echo esc_attr( $_view['option_name'] ); ?>[keywords-home]'
|
| 56 |
+
type='text' class='wds-field'
|
| 57 |
+
value='<?php echo esc_attr( $_view['options']['keywords-home'] ); ?>'>
|
| 58 |
+
<span
|
| 59 |
+
class="wds-field-legend"><?php echo sprintf( '%s <pre class="wds-pre wds-pre-inline">%s</pre>', esc_html__( 'Comma-separated keywords, e.g.', 'wds' ), esc_html__( 'word1, word2', 'wds' ) ); ?></span>
|
| 60 |
+
</div>
|
| 61 |
+
</div>
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
<?php
|
| 65 |
+
$this->_render( 'onpage/onpage-og-twitter', array(
|
| 66 |
+
'for_type' => 'home',
|
| 67 |
+
) );
|
| 68 |
+
?>
|
| 69 |
+
|
| 70 |
+
<?php
|
| 71 |
+
$this->_render( 'onpage/onpage-meta-robots', array(
|
| 72 |
+
'items' => $meta_robots_main_blog_archive,
|
| 73 |
+
) );
|
| 74 |
+
?>
|
| 75 |
+
|
| 76 |
+
<?php else : ?>
|
| 77 |
+
|
| 78 |
+
<?php
|
| 79 |
+
$front_page = (int) get_option( 'page_on_front' );
|
| 80 |
+
$edit_link = sprintf(
|
| 81 |
+
'<a href="' . get_edit_post_link( $front_page ) . '">%s</a>',
|
| 82 |
+
__( 'here', 'wds' )
|
| 83 |
+
);
|
| 84 |
+
?>
|
| 85 |
+
<div class="wds-notice wds-notice-info">
|
| 86 |
+
<p>
|
| 87 |
+
<?php
|
| 88 |
+
if ( $front_page ) {
|
| 89 |
+
printf(
|
| 90 |
+
esc_html__( 'Your homepage is set to a static page. Configure your homepage SEO via the page itself %s.', 'wds' ),
|
| 91 |
+
wp_kses_post( $edit_link )
|
| 92 |
+
);
|
| 93 |
+
} else {
|
| 94 |
+
esc_html_e( 'Your homepage is set to a static page. Configure your homepage SEO via the page itself.', 'wds' );
|
| 95 |
+
}
|
| 96 |
+
?>
|
| 97 |
+
</p>
|
| 98 |
+
</div>
|
| 99 |
+
<?php endif; ?>
|
includes/admin/templates/onpage/onpage-section-post-type-archive.php
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 3 |
+
$archive_post_type = empty( $archive_post_type ) ? '' : $archive_post_type;
|
| 4 |
+
$archive_post_type_label = empty( $archive_post_type_label ) ? '' : $archive_post_type_label;
|
| 5 |
+
$archive_post_type_robots = empty( $archive_post_type_robots ) ? '' : $archive_post_type_robots;
|
| 6 |
+
|
| 7 |
+
$title_key = 'title-' . $archive_post_type;
|
| 8 |
+
$title_value = smartcrawl_get_array_value( $_view['options'], $title_key );
|
| 9 |
+
|
| 10 |
+
$metadesc_key = 'metadesc-' . $archive_post_type;
|
| 11 |
+
$metadesc_value = smartcrawl_get_array_value( $_view['options'], $metadesc_key );
|
| 12 |
+
?>
|
| 13 |
+
|
| 14 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 15 |
+
|
| 16 |
+
<div class="wds-table-fields-group">
|
| 17 |
+
<div class="wds-table-fields">
|
| 18 |
+
<div class="label">
|
| 19 |
+
<label for="<?php echo esc_attr( $title_key ); ?>" class="wds-label">
|
| 20 |
+
<?php echo esc_html( $archive_post_type_label ) . esc_html__( ' Archive Title', 'wds' ); ?>
|
| 21 |
+
</label>
|
| 22 |
+
</div>
|
| 23 |
+
<div class="fields wds-allow-macros">
|
| 24 |
+
<input id='<?php echo esc_attr( $title_key ); ?>'
|
| 25 |
+
name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $title_key ); ?>]'
|
| 26 |
+
type='text' class='wds-field'
|
| 27 |
+
value='<?php echo esc_attr( $title_value ); ?>'>
|
| 28 |
+
</div>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
|
| 32 |
+
<div class="wds-table-fields-group">
|
| 33 |
+
<div class="wds-table-fields">
|
| 34 |
+
<div class="label">
|
| 35 |
+
<label for="<?php echo esc_attr( $metadesc_key ); ?>" class="wds-label">
|
| 36 |
+
<?php echo esc_html( $archive_post_type_label ) . esc_html__( ' Archive Meta Description', 'wds' ); ?>
|
| 37 |
+
</label>
|
| 38 |
+
</div>
|
| 39 |
+
<div class="fields wds-allow-macros">
|
| 40 |
+
<textarea id='<?php echo esc_attr( $metadesc_key ); ?>'
|
| 41 |
+
name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $metadesc_key ); ?>]'
|
| 42 |
+
type='text' class='wds-field'><?php echo esc_textarea( $metadesc_value ); ?></textarea>
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
</div>
|
| 46 |
+
|
| 47 |
+
<?php
|
| 48 |
+
$this->_render( 'onpage/onpage-og-twitter', array(
|
| 49 |
+
'for_type' => $archive_post_type,
|
| 50 |
+
) );
|
| 51 |
+
?>
|
| 52 |
+
|
| 53 |
+
<?php
|
| 54 |
+
$this->_render( 'onpage/onpage-meta-robots', array(
|
| 55 |
+
'items' => $archive_post_type_robots,
|
| 56 |
+
) );
|
| 57 |
+
?>
|
includes/admin/templates/onpage/onpage-section-post-type.php
CHANGED
|
@@ -1,41 +1,50 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
?>
|
| 6 |
-
|
| 7 |
-
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 8 |
-
|
| 9 |
-
<div class="wds-table-fields-group">
|
| 10 |
-
<div class="wds-table-fields">
|
| 11 |
-
<div class="label">
|
| 12 |
-
<label for="title-<?php echo
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
'
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$post_type = empty( $post_type ) ? '' : $post_type;
|
| 3 |
+
$post_type_object = empty( $post_type_object ) ? '' : $post_type_object;
|
| 4 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 5 |
+
?>
|
| 6 |
+
|
| 7 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 8 |
+
|
| 9 |
+
<div class="wds-table-fields-group">
|
| 10 |
+
<div class="wds-table-fields">
|
| 11 |
+
<div class="label">
|
| 12 |
+
<label for="title-<?php echo esc_attr( $post_type ); ?>"
|
| 13 |
+
class="wds-label"><?php printf( esc_html( __( '%s Title', 'wds' ) ), esc_html( $post_type_object->labels->singular_name ) ); ?></label>
|
| 14 |
+
</div>
|
| 15 |
+
<div class="fields wds-allow-macros">
|
| 16 |
+
<input id='title-<?php echo esc_attr( $post_type ); ?>'
|
| 17 |
+
name='<?php echo esc_attr( $option_name ); ?>[title-<?php echo esc_attr( $post_type ); ?>]'
|
| 18 |
+
type='text'
|
| 19 |
+
class='wds-field'
|
| 20 |
+
value='<?php echo esc_attr( $_view['options'][ 'title-' . $post_type ] ); ?>'>
|
| 21 |
+
</div>
|
| 22 |
+
</div>
|
| 23 |
+
</div>
|
| 24 |
+
|
| 25 |
+
<div class="wds-table-fields-group">
|
| 26 |
+
<div class="wds-table-fields">
|
| 27 |
+
<div class="label">
|
| 28 |
+
<label for="metadesc-<?php echo esc_attr( $post_type ); ?>"
|
| 29 |
+
class="wds-label"><?php printf( esc_html( __( '%s Meta Description', 'wds' ) ), esc_html( $post_type_object->labels->singular_name ) ); ?></label>
|
| 30 |
+
</div>
|
| 31 |
+
<div class="fields wds-allow-macros">
|
| 32 |
+
<textarea id='metadesc-<?php echo esc_attr( $post_type ); ?>'
|
| 33 |
+
name='<?php echo esc_attr( $option_name ); ?>[metadesc-<?php echo esc_attr( $post_type ); ?>]'
|
| 34 |
+
type='text'
|
| 35 |
+
class='wds-field'><?php echo esc_textarea( $_view['options'][ 'metadesc-' . $post_type ] ); ?></textarea>
|
| 36 |
+
</div>
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
<?php
|
| 40 |
+
$this->_render( 'onpage/onpage-og-twitter', array(
|
| 41 |
+
'for_type' => $post_type,
|
| 42 |
+
) );
|
| 43 |
+
?>
|
| 44 |
+
|
| 45 |
+
<?php
|
| 46 |
+
$this->_render( 'onpage/onpage-meta-robots', array(
|
| 47 |
+
'items' => $post_type_robots,
|
| 48 |
+
) );
|
| 49 |
+
?>
|
| 50 |
+
</div>
|
includes/admin/templates/onpage/onpage-section-search.php
CHANGED
|
@@ -1,40 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
?>
|
| 5 |
-
|
| 6 |
-
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 7 |
-
|
| 8 |
-
<div class="wds-table-fields-group">
|
| 9 |
-
<div class="wds-table-fields">
|
| 10 |
-
<div class="label">
|
| 11 |
-
<label for="title-search" class="wds-label"><?php esc_html_e( 'Search Page Title'
|
| 12 |
-
</div>
|
| 13 |
-
<div class="fields wds-allow-macros">
|
| 14 |
-
<input id='title-search' name='<?php echo esc_attr( $option_name ); ?>[title-search]' type='text'
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
</div>
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 3 |
+
$meta_robots_search = empty( $meta_robots_search ) ? array() : $meta_robots_search;
|
| 4 |
+
?>
|
| 5 |
+
|
| 6 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 7 |
+
|
| 8 |
+
<div class="wds-table-fields-group">
|
| 9 |
+
<div class="wds-table-fields">
|
| 10 |
+
<div class="label">
|
| 11 |
+
<label for="title-search" class="wds-label"><?php esc_html_e( 'Search Page Title', 'wds' ); ?></label>
|
| 12 |
+
</div>
|
| 13 |
+
<div class="fields wds-allow-macros">
|
| 14 |
+
<input id='title-search' name='<?php echo esc_attr( $option_name ); ?>[title-search]' type='text'
|
| 15 |
+
class='wds-field' value='<?php echo esc_attr( $_view['options']['title-search'] ); ?>'>
|
| 16 |
+
</div>
|
| 17 |
+
</div>
|
| 18 |
+
</div>
|
| 19 |
+
|
| 20 |
+
<div class="wds-table-fields-group">
|
| 21 |
+
<div class="wds-table-fields">
|
| 22 |
+
<div class="label">
|
| 23 |
+
<label for="metadesc-search"
|
| 24 |
+
class="wds-label"><?php esc_html_e( 'Search Page Meta Description', 'wds' ); ?></label>
|
| 25 |
+
</div>
|
| 26 |
+
<div class="fields wds-allow-macros">
|
| 27 |
+
<textarea id='metadesc-search' name='<?php echo esc_attr( $option_name ); ?>[metadesc-search]' type='text'
|
| 28 |
+
class='wds-field'><?php echo esc_textarea( $_view['options']['metadesc-search'] ); ?></textarea>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
|
| 33 |
+
<?php
|
| 34 |
+
$this->_render( 'onpage/onpage-og-twitter', array(
|
| 35 |
+
'for_type' => 'search',
|
| 36 |
+
) );
|
| 37 |
+
?>
|
| 38 |
+
|
| 39 |
+
<?php
|
| 40 |
+
$this->_render( 'onpage/onpage-meta-robots', array(
|
| 41 |
+
'items' => $meta_robots_search,
|
| 42 |
+
) );
|
| 43 |
+
?>
|
includes/admin/templates/onpage/onpage-section-settings.php
CHANGED
|
@@ -1,35 +1,35 @@
|
|
| 1 |
-
<?php $separators = empty( $separators ) ? array() : $separators; ?>
|
| 2 |
-
<div class="wds-table-fields-group">
|
| 3 |
-
<div class="wds-table-fields">
|
| 4 |
-
<div class="label">
|
| 5 |
-
<label for="separator" class="wds-label"><?php esc_html_e( 'Separator'
|
| 6 |
-
<p class="wds-label-description">
|
| 7 |
-
<?php
|
| 8 |
-
</p>
|
| 9 |
-
</div>
|
| 10 |
-
<div class="fields">
|
| 11 |
-
<div class="wds-preset-separators">
|
| 12 |
-
<?php foreach ( $separators as $key => $separator ) :
|
| 13 |
-
<input
|
| 14 |
-
type="radio"
|
| 15 |
-
name="<?php echo esc_attr( $_view['option_name'] ); ?>[preset-separator]"
|
| 16 |
-
id="separator-<?php echo esc_attr( $key ); ?>"
|
| 17 |
-
value="<?php echo esc_attr( $key ); ?>"
|
| 18 |
-
autocomplete="off"
|
| 19 |
-
<?php echo $_view['options']['preset-separator']
|
| 20 |
-
<label class="separator-selector" for="separator-<?php echo esc_attr( $key ); ?>">
|
| 21 |
-
|
| 22 |
-
</label>
|
| 23 |
-
<?php endforeach; ?>
|
| 24 |
-
</div>
|
| 25 |
-
<p class="wds-custom-separator-message"><?php
|
| 26 |
-
<input
|
| 27 |
-
id='separator'
|
| 28 |
-
placeholder="<?php
|
| 29 |
-
name='<?php echo esc_attr( $_view['option_name'] ); ?>[separator]'
|
| 30 |
-
type='text'
|
| 31 |
-
class='wds-field'
|
| 32 |
-
value='<?php echo esc_attr( $_view['options']['separator'] ); ?>'
|
| 33 |
-
</div>
|
| 34 |
-
</div>
|
| 35 |
-
</div>
|
| 1 |
+
<?php $separators = empty( $separators ) ? array() : $separators; ?>
|
| 2 |
+
<div class="wds-table-fields-group">
|
| 3 |
+
<div class="wds-table-fields">
|
| 4 |
+
<div class="label">
|
| 5 |
+
<label for="separator" class="wds-label"><?php esc_html_e( 'Separator', 'wds' ); ?></label>
|
| 6 |
+
<p class="wds-label-description">
|
| 7 |
+
<?php esc_html_e( 'The separator refers to the break between variables which you can use by referencing the %%sep%% tag. You can choose a preset one or bake your own.', 'wds' ); ?>
|
| 8 |
+
</p>
|
| 9 |
+
</div>
|
| 10 |
+
<div class="fields">
|
| 11 |
+
<div class="wds-preset-separators">
|
| 12 |
+
<?php foreach ( $separators as $key => $separator ) : ?>
|
| 13 |
+
<input
|
| 14 |
+
type="radio"
|
| 15 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[preset-separator]"
|
| 16 |
+
id="separator-<?php echo esc_attr( $key ); ?>"
|
| 17 |
+
value="<?php echo esc_attr( $key ); ?>"
|
| 18 |
+
autocomplete="off"
|
| 19 |
+
<?php echo $_view['options']['preset-separator'] === $key ? 'checked="checked"' : ''; ?> />
|
| 20 |
+
<label class="separator-selector" for="separator-<?php echo esc_attr( $key ); ?>">
|
| 21 |
+
<?php echo esc_html( $separator ); ?>
|
| 22 |
+
</label>
|
| 23 |
+
<?php endforeach; ?>
|
| 24 |
+
</div>
|
| 25 |
+
<p class="wds-custom-separator-message"><?php esc_html_e( 'Or, choose your own custom separator.', 'wds' ); ?></p>
|
| 26 |
+
<input
|
| 27 |
+
id='separator'
|
| 28 |
+
placeholder="<?php esc_attr_e( 'Enter custom separator', 'wds' ); ?>"
|
| 29 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[separator]'
|
| 30 |
+
type='text'
|
| 31 |
+
class='wds-field'
|
| 32 |
+
value='<?php echo esc_attr( $_view['options']['separator'] ); ?>'/>
|
| 33 |
+
</div>
|
| 34 |
+
</div>
|
| 35 |
+
</div>
|
includes/admin/templates/onpage/onpage-section-taxonomy.php
CHANGED
|
@@ -1,41 +1,49 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
?>
|
| 6 |
-
|
| 7 |
-
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 8 |
-
|
| 9 |
-
<div class="wds-table-fields-group">
|
| 10 |
-
<div class="wds-table-fields">
|
| 11 |
-
<div class="label">
|
| 12 |
-
<label for="title-<?php echo
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
</div>
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$taxonomy = empty( $taxonomy ) ? new stdClass() : $taxonomy;
|
| 3 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 4 |
+
$meta_robots = empty( $meta_robots ) ? array() : $meta_robots;
|
| 5 |
+
?>
|
| 6 |
+
|
| 7 |
+
<?php $this->_render( 'onpage/onpage-preview' ); ?>
|
| 8 |
+
|
| 9 |
+
<div class="wds-table-fields-group">
|
| 10 |
+
<div class="wds-table-fields">
|
| 11 |
+
<div class="label">
|
| 12 |
+
<label for="title-<?php echo esc_attr( $taxonomy->name ); ?>"
|
| 13 |
+
class="wds-label"><?php printf( esc_html( __( '%s Title', 'wds' ) ), esc_html( ucfirst( $taxonomy->label ) ) ); ?></label>
|
| 14 |
+
</div>
|
| 15 |
+
<div class="fields wds-allow-macros">
|
| 16 |
+
<input id='title-<?php echo esc_attr( $taxonomy->name ); ?>'
|
| 17 |
+
name='<?php echo esc_attr( $option_name ); ?>[title-<?php echo esc_attr( $taxonomy->name ); ?>]'
|
| 18 |
+
type='text'
|
| 19 |
+
class='wds-field' value='<?php echo esc_attr( $_view['options'][ 'title-' . $taxonomy->name ] ); ?>'>
|
| 20 |
+
</div>
|
| 21 |
+
</div>
|
| 22 |
+
</div>
|
| 23 |
+
|
| 24 |
+
<div class="wds-table-fields-group">
|
| 25 |
+
<div class="wds-table-fields">
|
| 26 |
+
<div class="label">
|
| 27 |
+
<label for="metadesc-<?php echo esc_attr( $taxonomy->name ); ?>"
|
| 28 |
+
class="wds-label"><?php printf( esc_html( __( '%s Meta Description', 'wds' ) ), esc_html( ucfirst( $taxonomy->label ) ) ); ?></label>
|
| 29 |
+
</div>
|
| 30 |
+
<div class="fields wds-allow-macros">
|
| 31 |
+
<textarea id='metadesc-<?php echo esc_attr( $taxonomy->name ); ?>'
|
| 32 |
+
name='<?php echo esc_attr( $option_name ); ?>[metadesc-<?php echo esc_attr( $taxonomy->name ); ?>]'
|
| 33 |
+
type='text'
|
| 34 |
+
class='wds-field'><?php echo esc_textarea( $_view['options'][ 'metadesc-' . $taxonomy->name ] ); ?></textarea>
|
| 35 |
+
</div>
|
| 36 |
+
</div>
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
<?php
|
| 40 |
+
$this->_render( 'onpage/onpage-og-twitter', array(
|
| 41 |
+
'for_type' => $taxonomy->name,
|
| 42 |
+
) );
|
| 43 |
+
?>
|
| 44 |
+
|
| 45 |
+
<?php
|
| 46 |
+
$this->_render( 'onpage/onpage-meta-robots', array(
|
| 47 |
+
'items' => $meta_robots,
|
| 48 |
+
) );
|
| 49 |
+
?>
|
includes/admin/templates/onpage/onpage-settings.php
CHANGED
|
@@ -1,257 +1,263 @@
|
|
| 1 |
-
<div id="container" class="wrap wrap-wds wds-page wds-page-autolinks">
|
| 2 |
-
<section id="header">
|
| 3 |
-
<?php $this->_render( 'settings-message-top' ); ?>
|
| 4 |
-
<div class="actions">
|
| 5 |
-
<a href="#show-supported-macros-modal" rel="dialog"
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
</
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
<?php
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
?>
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
array(
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
'
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
'
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
'
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
'
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
'
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
'
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
'
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div id="container" class="wrap wrap-wds wds-page wds-page-autolinks">
|
| 2 |
+
<section id="header">
|
| 3 |
+
<?php $this->_render( 'settings-message-top' ); ?>
|
| 4 |
+
<div class="actions">
|
| 5 |
+
<a href="#show-supported-macros-modal" rel="dialog"
|
| 6 |
+
class="button button-small button-light actions-button"><?php esc_html_e( 'Browse Macros', 'wds' ); ?></a>
|
| 7 |
+
<a target="_blank" class="button button-small button-light actions-button"
|
| 8 |
+
href="https://premium.wpmudev.org/docs/wpmu-dev-plugins/smartcrawl/#chapter-2">
|
| 9 |
+
<i class="wds-icon-academy"></i>
|
| 10 |
+
<?php esc_html_e( 'View Documentation', 'wds' ); ?>
|
| 11 |
+
</a>
|
| 12 |
+
</div>
|
| 13 |
+
<h1><?php esc_html_e( 'Title & Meta', 'wds' ); ?></h1>
|
| 14 |
+
</section><!-- end header -->
|
| 15 |
+
|
| 16 |
+
<dialog class="wds-modal" id="show-supported-macros-modal"
|
| 17 |
+
title="<?php esc_html_e( 'Supported Macros', 'wds' ); ?>">
|
| 18 |
+
<div id="wds-show-supported-macros">
|
| 19 |
+
<table class="wds-data-table wds-data-table-inverse-large">
|
| 20 |
+
<thead>
|
| 21 |
+
<tr>
|
| 22 |
+
<th class="label"><?php esc_html_e( 'Title', 'wds' ); ?></th>
|
| 23 |
+
<th class="result"><?php esc_html_e( 'Gets Replaced By', 'wds' ); ?></th>
|
| 24 |
+
</tr>
|
| 25 |
+
</thead>
|
| 26 |
+
<tfoot>
|
| 27 |
+
<tr>
|
| 28 |
+
<th class="label"><?php esc_html_e( 'Title', 'wds' ); ?></th>
|
| 29 |
+
<th class="result"><?php esc_html_e( 'Gets Replaced By', 'wds' ); ?></th>
|
| 30 |
+
</tr>
|
| 31 |
+
</tfoot>
|
| 32 |
+
<tbody>
|
| 33 |
+
|
| 34 |
+
<?php foreach ( $macros as $macro => $label ) { ?>
|
| 35 |
+
<tr>
|
| 36 |
+
<td class="data data-small"><?php echo esc_html( $macro ); ?></td>
|
| 37 |
+
<td class="data data-small"><?php echo esc_html( $label ); ?></td>
|
| 38 |
+
</tr>
|
| 39 |
+
<?php } ?>
|
| 40 |
+
|
| 41 |
+
</tbody>
|
| 42 |
+
</table>
|
| 43 |
+
</div>
|
| 44 |
+
</dialog>
|
| 45 |
+
<form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
|
| 46 |
+
<?php settings_fields( $_view['option_name'] ); ?>
|
| 47 |
+
|
| 48 |
+
<input type="hidden"
|
| 49 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
|
| 50 |
+
value="1">
|
| 51 |
+
|
| 52 |
+
<div class="vertical-tabs" id="page-title-meta-tabs">
|
| 53 |
+
<?php
|
| 54 |
+
/*
|
| 55 |
+
* Homepage tab
|
| 56 |
+
*/
|
| 57 |
+
$this->_render( 'vertical-tab', array(
|
| 58 |
+
'tab_id' => 'tab_homepage',
|
| 59 |
+
'tab_name' => __( 'Homepage', 'wds' ),
|
| 60 |
+
'is_active' => 'tab_homepage' === $active_tab,
|
| 61 |
+
'tab_sections' => array(
|
| 62 |
+
array(
|
| 63 |
+
'section_description' => __( 'Customize your homepage title, description and meta.', 'wds' ),
|
| 64 |
+
'section_type' => 'homepage',
|
| 65 |
+
'section_template' => 'onpage/onpage-section-homepage',
|
| 66 |
+
'section_args' => array(
|
| 67 |
+
'homepage_title' => $homepage_title,
|
| 68 |
+
'homepage_description' => $homepage_description,
|
| 69 |
+
'show_homepage_options' => $show_homepage_options,
|
| 70 |
+
'meta_robots_main_blog_archive' => $meta_robots_main_blog_archive,
|
| 71 |
+
),
|
| 72 |
+
),
|
| 73 |
+
),
|
| 74 |
+
) );
|
| 75 |
+
|
| 76 |
+
/*
|
| 77 |
+
* Post types tab
|
| 78 |
+
*/
|
| 79 |
+
$post_type_sections = array();
|
| 80 |
+
foreach ( get_post_types( array( 'public' => true ) ) as $post_type ) {
|
| 81 |
+
if ( in_array( $post_type, array( 'revision', 'nav_menu_item' ), true ) ) {
|
| 82 |
+
continue;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
$post_type_object = get_post_type_object( $post_type );
|
| 86 |
+
|
| 87 |
+
$post_type_sections[] = array(
|
| 88 |
+
'section_title' => $post_type_object->labels->name,
|
| 89 |
+
'section_description' => sprintf( esc_html__( 'Customize your %s title, description and meta.', 'wds' ), $post_type_object->labels->singular_name ),
|
| 90 |
+
'section_type' => $post_type,
|
| 91 |
+
'section_template' => 'onpage/onpage-section-post-type',
|
| 92 |
+
'section_args' => array(
|
| 93 |
+
'post_type' => $post_type,
|
| 94 |
+
'post_type_object' => $post_type_object,
|
| 95 |
+
'post_type_robots' => ( ! empty( $post_robots[ $post_type ] ) ? $post_robots[ $post_type ] : array() ),
|
| 96 |
+
),
|
| 97 |
+
);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
$this->_render( 'vertical-tab', array(
|
| 101 |
+
'tab_id' => 'tab_post_types',
|
| 102 |
+
'tab_name' => __( 'Post Types', 'wds' ),
|
| 103 |
+
'is_active' => 'tab_post_types' === $active_tab,
|
| 104 |
+
'tab_sections' => $post_type_sections,
|
| 105 |
+
) );
|
| 106 |
+
|
| 107 |
+
/*
|
| 108 |
+
* Other taxonomies
|
| 109 |
+
*/
|
| 110 |
+
$taxonomy_sections = array();
|
| 111 |
+
$taxonomies = array_merge(
|
| 112 |
+
array( 'post_tag', 'category' ),
|
| 113 |
+
get_taxonomies( array( '_builtin' => false ) )
|
| 114 |
+
);
|
| 115 |
+
foreach ( $taxonomies as $taxonomy_name ) {
|
| 116 |
+
$taxonomy = get_taxonomy( $taxonomy_name );
|
| 117 |
+
$meta_robots_taxonomy_name = 'meta_robots_' . str_replace( '-', '_', $taxonomy->name );
|
| 118 |
+
$taxonomy_sections[] = array(
|
| 119 |
+
'section_title' => $taxonomy->label,
|
| 120 |
+
'section_description' => sprintf( __( 'Customize the title, description and meta of %s.', 'wds' ), $taxonomy->label ),
|
| 121 |
+
'section_type' => $taxonomy->name,
|
| 122 |
+
'section_template' => 'onpage/onpage-section-taxonomy',
|
| 123 |
+
'section_args' => array(
|
| 124 |
+
'taxonomy' => $taxonomy,
|
| 125 |
+
'meta_robots' => $$meta_robots_taxonomy_name,
|
| 126 |
+
),
|
| 127 |
+
);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
$this->_render( 'vertical-tab', array(
|
| 131 |
+
'tab_id' => 'tab_taxonomies',
|
| 132 |
+
'tab_name' => __( 'Taxonomies', 'wds' ),
|
| 133 |
+
'is_active' => 'tab_taxonomies' === $active_tab,
|
| 134 |
+
'tab_sections' => $taxonomy_sections,
|
| 135 |
+
) );
|
| 136 |
+
|
| 137 |
+
$archive_sections = array(
|
| 138 |
+
// Author archive
|
| 139 |
+
array(
|
| 140 |
+
'section_title' => __( 'Author Archive', 'wds' ),
|
| 141 |
+
'section_description' => __( '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' ),
|
| 142 |
+
'section_type' => 'author-archive',
|
| 143 |
+
'section_template' => 'onpage/onpage-section-author-archive',
|
| 144 |
+
'section_enabled_option' => 'enable-author-archive',
|
| 145 |
+
'section_args' => array(
|
| 146 |
+
'meta_robots_author' => $meta_robots_author,
|
| 147 |
+
),
|
| 148 |
+
),
|
| 149 |
+
// Date archive
|
| 150 |
+
array(
|
| 151 |
+
'section_title' => __( 'Date Archive', 'wds' ),
|
| 152 |
+
'section_description' => __( 'Google may see your date archives as duplicate content to your Blog Homepage. For this reason we recommend disabling date archives.', 'wds' ),
|
| 153 |
+
'section_type' => 'date-archive',
|
| 154 |
+
'section_template' => 'onpage/onpage-section-date-archive',
|
| 155 |
+
'section_enabled_option' => 'enable-date-archive',
|
| 156 |
+
'section_args' => array(
|
| 157 |
+
'meta_robots_date' => $meta_robots_date,
|
| 158 |
+
),
|
| 159 |
+
),
|
| 160 |
+
// Search page
|
| 161 |
+
array(
|
| 162 |
+
'section_title' => __( 'Search Page', 'wds' ),
|
| 163 |
+
'section_description' => __( 'Customize your search page title, description and meta.', 'wds' ),
|
| 164 |
+
'section_type' => 'search-page',
|
| 165 |
+
'section_template' => 'onpage/onpage-section-search',
|
| 166 |
+
'section_args' => array(
|
| 167 |
+
'meta_robots_search' => $meta_robots_search,
|
| 168 |
+
),
|
| 169 |
+
),
|
| 170 |
+
// 404 page
|
| 171 |
+
array(
|
| 172 |
+
'section_title' => __( '404 Page', 'wds' ),
|
| 173 |
+
'section_description' => __( 'Customize your 404 page title, description and meta.', 'wds' ),
|
| 174 |
+
'section_type' => '404-page',
|
| 175 |
+
'section_template' => 'onpage/onpage-section-404',
|
| 176 |
+
'section_args' => array(),
|
| 177 |
+
),
|
| 178 |
+
);
|
| 179 |
+
|
| 180 |
+
/**
|
| 181 |
+
* @var $archive_post_types array
|
| 182 |
+
*/
|
| 183 |
+
foreach ( $archive_post_types as $archive_post_type => $archive_post_type_label ) {
|
| 184 |
+
|
| 185 |
+
$archive_sections[] = array(
|
| 186 |
+
'section_title' => $archive_post_type_label . esc_html__( ' Archive Title', 'wds' ),
|
| 187 |
+
'section_description' => sprintf(
|
| 188 |
+
esc_html__( 'Customize title, description and meta for the archive page of custom post type %s.', 'wds' ),
|
| 189 |
+
$archive_post_type_label
|
| 190 |
+
),
|
| 191 |
+
'section_type' => $archive_post_type,
|
| 192 |
+
'section_template' => 'onpage/onpage-section-post-type-archive',
|
| 193 |
+
'section_args' => array(
|
| 194 |
+
'archive_post_type' => $archive_post_type,
|
| 195 |
+
'archive_post_type_label' => $archive_post_type_label,
|
| 196 |
+
'archive_post_type_robots' => ( ! empty( $archive_post_type_robots[ $archive_post_type ] ) ? $archive_post_type_robots[ $archive_post_type ] : array() ),
|
| 197 |
+
),
|
| 198 |
+
);
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
/*
|
| 202 |
+
* Archives
|
| 203 |
+
*/
|
| 204 |
+
$this->_render( 'vertical-tab', array(
|
| 205 |
+
'tab_id' => 'tab_archives',
|
| 206 |
+
'tab_name' => __( 'Archives', 'wds' ),
|
| 207 |
+
'is_active' => 'tab_archives' === $active_tab,
|
| 208 |
+
'tab_sections' => $archive_sections,
|
| 209 |
+
) );
|
| 210 |
+
|
| 211 |
+
$buddypress_sections = array();
|
| 212 |
+
|
| 213 |
+
if ( function_exists( 'groups_get_groups' ) && ( is_network_admin() || is_main_site() ) ) {
|
| 214 |
+
$buddypress_sections[] = array(
|
| 215 |
+
'section_title' => __( 'BuddyPress Groups', 'wds' ),
|
| 216 |
+
'section_description' => __( 'Customize your BuddyPress group title, description and meta options.', 'wds' ),
|
| 217 |
+
'section_type' => 'bp-group',
|
| 218 |
+
'section_template' => 'onpage/onpage-section-buddypress-groups',
|
| 219 |
+
'section_args' => array(),
|
| 220 |
+
);
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
if ( defined( 'BP_VERSION' ) && ( is_network_admin() || is_main_site() ) ) {
|
| 224 |
+
$buddypress_sections[] = array(
|
| 225 |
+
'section_title' => __( 'BuddyPress Profile', 'wds' ),
|
| 226 |
+
'section_description' => __( 'Customize your BuddyPress profile title, description and meta options.', 'wds' ),
|
| 227 |
+
'section_type' => 'bp-profile',
|
| 228 |
+
'section_template' => 'onpage/onpage-section-buddypress-profile',
|
| 229 |
+
'section_args' => array(),
|
| 230 |
+
);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
if ( $buddypress_sections ) {
|
| 234 |
+
$this->_render( 'vertical-tab', array(
|
| 235 |
+
'tab_id' => 'tab_buddypress',
|
| 236 |
+
'tab_name' => __( 'BuddyPress', 'wds' ),
|
| 237 |
+
'is_active' => 'tab_buddypress' === $active_tab,
|
| 238 |
+
'tab_sections' => $buddypress_sections,
|
| 239 |
+
) );
|
| 240 |
+
}
|
| 241 |
+
?>
|
| 242 |
+
|
| 243 |
+
<?php
|
| 244 |
+
$this->_render( 'vertical-tab', array(
|
| 245 |
+
'tab_id' => 'tab_settings',
|
| 246 |
+
'tab_name' => __( 'Settings', 'wds' ),
|
| 247 |
+
'is_active' => 'tab_settings' === $active_tab,
|
| 248 |
+
'tab_sections' => array(
|
| 249 |
+
array(
|
| 250 |
+
'section_type' => '',
|
| 251 |
+
'section_template' => 'onpage/onpage-section-settings',
|
| 252 |
+
'section_args' => array(
|
| 253 |
+
'separators' => $separators,
|
| 254 |
+
),
|
| 255 |
+
),
|
| 256 |
+
),
|
| 257 |
+
) );
|
| 258 |
+
?>
|
| 259 |
+
|
| 260 |
+
</div><!-- end page-title-meta-tabs -->
|
| 261 |
+
|
| 262 |
+
</form>
|
| 263 |
+
</div><!-- end wds-page-onpage -->
|
includes/admin/templates/onpage/onpage-social-meta-tags.php
CHANGED
|
@@ -1,115 +1,116 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
?>
|
| 24 |
-
<div class="wds-toggle-table">
|
| 25 |
-
<span class="toggle wds-toggle">
|
| 26 |
-
<input
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
</div>
|
|
|
| 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 |
+
<div class="wds-toggle-table">
|
| 25 |
+
<span class="toggle wds-toggle">
|
| 26 |
+
<input
|
| 27 |
+
class="toggle-checkbox"
|
| 28 |
+
value='1' <?php checked( $section_enabled, true ); ?>
|
| 29 |
+
id='<?php echo esc_attr( $section_enabled_field_id ); ?>'
|
| 30 |
+
name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $section_enabled_field_id ); ?>]'
|
| 31 |
+
type='checkbox' autocomplete="off"/>
|
| 32 |
+
<label class="toggle-label" for="<?php echo esc_attr( $section_enabled_field_id ); ?>"></label>
|
| 33 |
+
</span>
|
| 34 |
+
|
| 35 |
+
<div class="wds-toggle-description">
|
| 36 |
+
<label class="wds-label" for="<?php echo esc_attr( $section_enabled_field_id ); ?>">
|
| 37 |
+
<?php echo esc_html( $section_title ); ?>
|
| 38 |
+
</label>
|
| 39 |
+
<p class="wds-label-description">
|
| 40 |
+
<?php echo esc_html( $section_description ); ?>
|
| 41 |
+
</p>
|
| 42 |
+
|
| 43 |
+
<div class="wds-table-fields-group wds-toggleable-inside-box">
|
| 44 |
+
|
| 45 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 46 |
+
<div class="label">
|
| 47 |
+
<label for="<?php echo esc_attr( $title_field_id ); ?>" class="wds-label">
|
| 48 |
+
<?php esc_html_e( 'Title', 'wds' ); ?>
|
| 49 |
+
</label>
|
| 50 |
+
</div>
|
| 51 |
+
<div class="fields wds-allow-macros">
|
| 52 |
+
<input
|
| 53 |
+
id='<?php echo esc_attr( $title_field_id ); ?>'
|
| 54 |
+
name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $title_field_id ); ?>]'
|
| 55 |
+
size='' type='text' class='wds-field'
|
| 56 |
+
placeholder="<?php echo esc_attr( $title_placeholder ); ?>"
|
| 57 |
+
value='<?php echo esc_attr( $current_title ); ?>'/>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 62 |
+
<div class="label">
|
| 63 |
+
<label for="<?php echo esc_attr( $description_field_id ); ?>" class="wds-label">
|
| 64 |
+
<?php esc_html_e( 'Description', 'wds' ); ?>
|
| 65 |
+
</label>
|
| 66 |
+
</div>
|
| 67 |
+
<div class="fields wds-allow-macros">
|
| 68 |
+
<textarea
|
| 69 |
+
id='<?php echo esc_attr( $description_field_id ); ?>'
|
| 70 |
+
name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $description_field_id ); ?>]'
|
| 71 |
+
placeholder="<?php echo esc_attr( $description_placeholder ); ?>"
|
| 72 |
+
type='text' class='wds-field'><?php echo esc_textarea( $current_description ); ?></textarea>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
|
| 76 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 77 |
+
<div class="label">
|
| 78 |
+
<label for="<?php echo esc_attr( $images_field_id ); ?>" class="wds-label">
|
| 79 |
+
<?php if ( $single_image ): ?>
|
| 80 |
+
<?php esc_html_e( 'Default Featured Image', 'wds' ); ?>
|
| 81 |
+
<?php else: ?>
|
| 82 |
+
<?php esc_html_e( 'Default Featured Images', 'wds' ); ?>
|
| 83 |
+
<?php endif; ?>
|
| 84 |
+
</label>
|
| 85 |
+
</div>
|
| 86 |
+
<div
|
| 87 |
+
class="fields og-images <?php echo esc_attr( $images_field_id ); ?>"
|
| 88 |
+
data-singular="<?php echo $single_image ? 'true' : 'false'; ?>"
|
| 89 |
+
data-name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $images_field_id ); ?>]'>
|
| 90 |
+
|
| 91 |
+
<div class="wds-has-tooltip add-action-wrapper item"
|
| 92 |
+
data-content="<?php esc_attr_e( 'Add featured image', 'wds' ); ?>"
|
| 93 |
+
style="<?php echo $single_image && $images_available ? 'display:none;' : ''; ?>">
|
| 94 |
+
<a href="#add" id="<?php echo esc_attr( $images_field_id ); ?>" title="<?php esc_attr_e( 'Add image', 'wds' ); ?>"><i class="wds-icon-plus"></i></a>
|
| 95 |
+
</div>
|
| 96 |
+
<?php foreach ( $current_images as $image ): ?>
|
| 97 |
+
<input
|
| 98 |
+
name='<?php echo esc_attr( $option_name ); ?>[<?php echo esc_attr( $images_field_id ); ?>][]'
|
| 99 |
+
type='text'
|
| 100 |
+
value='<?php echo esc_attr( $image ); ?>'/>
|
| 101 |
+
<?php endforeach; ?>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
<p class="wds-label-description">
|
| 105 |
+
<?php if ( $single_image ): ?>
|
| 106 |
+
<?php esc_html_e( "This image will be available to use if the post or page being shared doesn't contain an image.", 'wds' ); ?>
|
| 107 |
+
<?php else: ?>
|
| 108 |
+
<?php esc_html_e( "These images will be available to use if the post or page being shared doesn't contain any images.", 'wds' ); ?>
|
| 109 |
+
<?php endif; ?>
|
| 110 |
+
</p>
|
| 111 |
+
|
| 112 |
+
<?php wp_enqueue_media(); ?>
|
| 113 |
+
<?php wp_enqueue_style( 'wds-admin-opengraph' ); ?>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
</div>
|
includes/admin/templates/onpage/onpage-twitter-disabled.php
CHANGED
|
@@ -1,14 +1,18 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$message = esc_html__( 'Twitter Cards are globally disabled.', 'wds' );
|
| 3 |
+
if ( smartcrawl_subsite_setting_page_enabled( 'wds_social' ) ) {
|
| 4 |
+
$message = sprintf(
|
| 5 |
+
esc_html__( '%1$s You can enable them %2$s.', 'wds' ),
|
| 6 |
+
$message,
|
| 7 |
+
sprintf(
|
| 8 |
+
'<a href="%s">%s</a>',
|
| 9 |
+
Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_SOCIAL ),
|
| 10 |
+
esc_html__( 'here', 'wds' )
|
| 11 |
+
)
|
| 12 |
+
);
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
$this->_render( 'notice', array(
|
| 16 |
+
'class' => 'wds-notice-info',
|
| 17 |
+
'message' => $message,
|
| 18 |
+
) );
|
includes/admin/templates/onpage/onpage-twitter-settings.php
CHANGED
|
@@ -1,39 +1,39 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 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 = __( 'Twitter Cards support enhances how your content appears when shared on Twitter.', 'wds' );
|
| 9 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 10 |
+
$title_field_id = 'twitter-title-' . $for_type;
|
| 11 |
+
$current_title = ! empty( $_view['options']["twitter-title-{$for_type}"] )
|
| 12 |
+
? $_view['options']["twitter-title-{$for_type}"]
|
| 13 |
+
: '';
|
| 14 |
+
|
| 15 |
+
$description_field_id = 'twitter-description-' . $for_type;
|
| 16 |
+
$current_description = ! empty( $_view['options']["twitter-description-{$for_type}"] )
|
| 17 |
+
? $_view['options']["twitter-description-{$for_type}"]
|
| 18 |
+
: '';
|
| 19 |
+
|
| 20 |
+
$images_field_id = 'twitter-images-' . $for_type;
|
| 21 |
+
$current_images = ! empty( $_view['options']["twitter-images-{$for_type}"] ) && is_array( $_view['options']["twitter-images-{$for_type}"] )
|
| 22 |
+
? $_view['options']["twitter-images-{$for_type}"]
|
| 23 |
+
: array();
|
| 24 |
+
|
| 25 |
+
$this->_render( 'onpage/onpage-social-meta-tags', array(
|
| 26 |
+
'for_type' => $for_type,
|
| 27 |
+
'section_enabled_field_id' => $section_enabled_field_id,
|
| 28 |
+
'section_enabled' => $section_enabled,
|
| 29 |
+
'section_title' => $section_title,
|
| 30 |
+
'section_description' => $section_description,
|
| 31 |
+
'option_name' => $option_name,
|
| 32 |
+
'title_field_id' => $title_field_id,
|
| 33 |
+
'current_title' => $current_title,
|
| 34 |
+
'description_field_id' => $description_field_id,
|
| 35 |
+
'current_description' => $current_description,
|
| 36 |
+
'images_field_id' => $images_field_id,
|
| 37 |
+
'current_images' => $current_images,
|
| 38 |
+
'single_image' => true,
|
| 39 |
+
) );
|
includes/admin/templates/{underscore-macros-list.php → onpage/underscore-macros-list.php}
RENAMED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
</div>
|
|
|
| 1 |
+
<?php // phpcs:ignoreFile -- underscore template ?>
|
| 2 |
+
<div class="insert-macro">
|
| 3 |
+
<button class="button-fields-trigger" data-content="{{- Wds.l10n('macros', 'Insert dynamic macro') }}" id="toogle-macro-list-"><i class="wds-icon-plus"></i></button>
|
| 4 |
+
<div class="macro-list" style="display: none">
|
| 5 |
+
<ul>
|
| 6 |
+
{{ _.each(macros, function (desc, macro) { }}
|
| 7 |
+
<li data-macro="{{- macro }}">
|
| 8 |
+
{{- desc }}
|
| 9 |
+
</li>
|
| 10 |
+
{{ }); }}
|
| 11 |
+
</ul>
|
| 12 |
+
</div>
|
| 13 |
+
</div>
|
includes/admin/templates/post-list/post-seo-analysis-errors.php
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$errors = empty( $errors ) ? array() : $errors;
|
| 3 |
+
$status_class = empty( $status_class ) ? 'wds-status-warning' : $status_class;
|
| 4 |
+
$percentage = ! empty( $percentage )
|
| 5 |
+
? intval( $percentage ) . '%'
|
| 6 |
+
: esc_html__( 'Errors:', 'wds' );
|
| 7 |
+
?>
|
| 8 |
+
|
| 9 |
+
<div class="wds-analysis <?php echo esc_attr( $status_class ); ?>" title="<?php esc_attr( $percentage ); ?>">
|
| 10 |
+
<span><?php echo esc_html( $percentage ); ?></span>
|
| 11 |
+
</div>
|
| 12 |
+
<div class="wds-analysis-details">
|
| 13 |
+
<?php foreach ( $errors as $key => $error ): ?>
|
| 14 |
+
<div class="wds-error <?php echo esc_attr( $key ); ?>">
|
| 15 |
+
<?php echo esc_html( $error ); ?>
|
| 16 |
+
</div>
|
| 17 |
+
<?php endforeach; ?>
|
| 18 |
+
</div>
|
includes/admin/templates/post-list/post-seo-analysis-good.php
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="wds-analysis wds-status-success">
|
| 2 |
+
<span><?php esc_html( __( 'Good', 'wds' ) ); ?></span>
|
| 3 |
+
</div>
|
includes/admin/templates/progress-bar.php
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-progress">
|
| 6 |
-
<span class="wds-progress-bar-current-percent"><?php echo (int) $progress; ?>%</span>
|
| 7 |
-
<div class="wds-progress-bar">
|
| 8 |
-
<div class="wds-progress-bar-inside" style="width:<?php echo (int) $progress; ?>%;"></div>
|
| 9 |
-
</div>
|
| 10 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$progress = empty( $progress ) ? 0 : $progress;
|
| 3 |
+
?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-progress">
|
| 6 |
+
<span class="wds-progress-bar-current-percent"><?php echo (int) $progress; ?>%</span>
|
| 7 |
+
<div class="wds-progress-bar">
|
| 8 |
+
<div class="wds-progress-bar-inside" style="width:<?php echo (int) $progress; ?>%;"></div>
|
| 9 |
+
</div>
|
| 10 |
+
</div>
|
includes/admin/templates/progress-notice.php
CHANGED
|
@@ -1,26 +1,28 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 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' );
|
| 7 |
-
if ( false !== strpos( $dash_email, '@' ) ) {
|
| 8 |
-
|
| 9 |
-
}
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
<?php
|
| 16 |
-
<?php $admin_email =
|
| 17 |
-
<?php } ?>
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
)
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
| 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' );
|
| 7 |
+
if ( false !== strpos( $dash_email, '@' ) ) {
|
| 8 |
+
$admin_email = $dash_email;
|
| 9 |
+
}
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
$scan_msg = __( "A full scan can take quite a while, especially if you have a large site! Feel free to close this page; we'll send an e-mail to %s once the results are in.", 'wds' );
|
| 13 |
+
?>
|
| 14 |
+
<p class="wds-small-text">
|
| 15 |
+
<?php if ( ! empty( $dash_email ) && ! empty( $admin_email ) ) { ?>
|
| 16 |
+
<?php $admin_email = sprintf( '<a href="mailto: %1$s">%1$s</a>', $admin_email ); ?>
|
| 17 |
+
<?php } else { ?>
|
| 18 |
+
<?php $admin_email = __( 'your DEV account email', 'wds' ); ?>
|
| 19 |
+
<?php } ?>
|
| 20 |
+
<?php
|
| 21 |
+
printf(
|
| 22 |
+
esc_html( $scan_msg ),
|
| 23 |
+
wp_kses_post( $admin_email )
|
| 24 |
+
);
|
| 25 |
+
?>
|
| 26 |
+
<?php esc_html_e( 'You can change that e-mail address if you want, on your DEV account page', 'wds' ); ?>
|
| 27 |
+
<a href="https://premium.wpmudev.org/hub/account" target="_blank"><?php esc_html_e( 'here', 'wds' ); ?></a>
|
| 28 |
+
</p>
|
includes/admin/templates/quick-edit-javascript.php
CHANGED
|
@@ -1,41 +1,45 @@
|
|
| 1 |
-
<script type="text/javascript">
|
| 2 |
-
(function ($) {
|
| 3 |
-
|
| 4 |
-
$(
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
}
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script type="text/javascript">
|
| 2 |
+
(function ($) {
|
| 3 |
+
|
| 4 |
+
$('body').on('click', 'td.column-title', '.editinline', function () {
|
| 5 |
+
var id = inlineEditPost.getId(this),
|
| 6 |
+
loading = "<?php echo esc_js( __( 'Loading, please hold on...', 'wds' ) ); ?>"
|
| 7 |
+
;
|
| 8 |
+
setTimeout(function () {
|
| 9 |
+
$(".smartcrawl_title:visible").attr("placeholder", loading);
|
| 10 |
+
$(".smartcrawl_metadesc:visible").attr("placeholder", loading);
|
| 11 |
+
$(".smartcrawl_focus:visible").attr("placeholder", loading);
|
| 12 |
+
$(".smartcrawl_keywords:visible").attr("placeholder", loading);
|
| 13 |
+
}); // Just move off stack
|
| 14 |
+
$.post(ajaxurl, {
|
| 15 |
+
"action": "wds_get_meta_fields",
|
| 16 |
+
"id": id,
|
| 17 |
+
"_wds_nonce": '<?php echo esc_js(wp_create_nonce( 'wds-metabox-nonce' )); ?>'
|
| 18 |
+
}, function (data) {
|
| 19 |
+
$(".smartcrawl_title:visible, .smartcrawl_metadesc:visible, .smartcrawl_focus:visible, .smartcrawl_keywords:visible").attr("placeholder", "");
|
| 20 |
+
if (!data) return false;
|
| 21 |
+
if ("title" in data && data.title) {
|
| 22 |
+
$(".smartcrawl_title:visible")
|
| 23 |
+
.val(data.title)
|
| 24 |
+
;
|
| 25 |
+
}
|
| 26 |
+
if ("description" in data && data.description) {
|
| 27 |
+
$(".smartcrawl_metadesc:visible")
|
| 28 |
+
.val(data.description)
|
| 29 |
+
;
|
| 30 |
+
}
|
| 31 |
+
if ("keywords" in data && data.keywords) {
|
| 32 |
+
$(".smartcrawl_keywords:visible")
|
| 33 |
+
.val(data.keywords)
|
| 34 |
+
;
|
| 35 |
+
}
|
| 36 |
+
if ("focus" in data && data.focus) {
|
| 37 |
+
$(".smartcrawl_focus:visible")
|
| 38 |
+
.val(data.focus)
|
| 39 |
+
;
|
| 40 |
+
}
|
| 41 |
+
}, "json");
|
| 42 |
+
});
|
| 43 |
+
|
| 44 |
+
})(jQuery);
|
| 45 |
+
</script>
|
includes/admin/templates/quick-edit-robots.php
CHANGED
|
@@ -1,38 +1,39 @@
|
|
| 1 |
-
|
| 2 |
-
<
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
<
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
<span class="
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
<span class="
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
.inline-edit-col.long-label .title {
|
| 33 |
-
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
|
|
| 1 |
+
<fieldset class="inline-edit-col-left">
|
| 2 |
+
<div class="inline-edit-col">
|
| 3 |
+
<label>
|
| 4 |
+
<span class="title metadesc"><?php esc_html_e( 'Meta Description', 'wds' ); ?></span>
|
| 5 |
+
<textarea class="ptitle smartcrawl_metadesc" name="wds_metadesc"></textarea>
|
| 6 |
+
</label>
|
| 7 |
+
</div>
|
| 8 |
+
<div class="inline-edit-col long-label">
|
| 9 |
+
<label>
|
| 10 |
+
<span class="title"><?php esc_html_e( 'Focus keywords', 'wds' ); ?></span>
|
| 11 |
+
<span class="input-text-wrap">
|
| 12 |
+
<input class="ptitle smartcrawl_focus" type="text" value="" name="wds_focus"/>
|
| 13 |
+
</span>
|
| 14 |
+
</label>
|
| 15 |
+
</div>
|
| 16 |
+
<div class="inline-edit-col long-label">
|
| 17 |
+
<label>
|
| 18 |
+
<span class="title"><?php esc_html_e( 'Other Keywords', 'wds' ); ?></span>
|
| 19 |
+
<span class="input-text-wrap">
|
| 20 |
+
<input class="ptitle smartcrawl_keywords" type="text" value="" name="wds_keywords"/>
|
| 21 |
+
</span>
|
| 22 |
+
</label>
|
| 23 |
+
</div>
|
| 24 |
+
</fieldset>
|
| 25 |
+
<style>
|
| 26 |
+
.inline-edit-col .title.metadesc {
|
| 27 |
+
display: block;
|
| 28 |
+
margin-top: 20px;
|
| 29 |
+
width: 100%;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.inline-edit-col.long-label .title {
|
| 33 |
+
width: 10em;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.inline-edit-col.long-label .input-text-wrap {
|
| 37 |
+
margin-left: 10em;
|
| 38 |
+
}
|
| 39 |
+
</style>
|
includes/admin/templates/quick-edit-title.php
CHANGED
|
@@ -1,12 +1,14 @@
|
|
| 1 |
-
|
| 2 |
-
<
|
| 3 |
-
|
| 4 |
-
<
|
| 5 |
-
|
| 6 |
-
<span class="
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
</
|
|
|
|
|
|
| 1 |
+
<fieldset class="inline-edit-col-left" style="clear:left">
|
| 2 |
+
<div class="inline-edit-col">
|
| 3 |
+
<h4><?php esc_html_e( 'SmartCrawl', 'wds' ); ?></h4>
|
| 4 |
+
<label>
|
| 5 |
+
<span class="title"><?php esc_html_e( 'Title Tag', 'wds' ); ?></span>
|
| 6 |
+
<span class="input-text-wrap">
|
| 7 |
+
<input class="ptitle smartcrawl_title" type="text" value="" name="wds_title"/>
|
| 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>
|
| 14 |
+
</fieldset>
|
includes/admin/templates/redirections-settings.php
DELETED
|
@@ -1,123 +0,0 @@
|
|
| 1 |
-
<div id="container" class="wrap wrap-wds wds-page wds-redirections-settings">
|
| 2 |
-
|
| 3 |
-
<dialog class="dev-overlay wds-modal wds-redirect" id="wds-new-redirect" title="<?php echo esc_attr( __( 'Add new redirection', 'wds' ) ); ?>">
|
| 4 |
-
<div class="box-content modal">
|
| 5 |
-
<p class="group wds-group">
|
| 6 |
-
<label for="" class="wds-label"><?php esc_html_e( 'Enter old URL', 'wds' ); ?></label>
|
| 7 |
-
<input type="url" name="source" value="" class="wds-field">
|
| 8 |
-
</p>
|
| 9 |
-
<p class="group wds-group">
|
| 10 |
-
<label for="" class="wds-label"><?php esc_html_e( 'Enter re-direct URL', 'wds' ); ?></label>
|
| 11 |
-
<input type="url" name="redirect" value="" class="wds-field">
|
| 12 |
-
</p>
|
| 13 |
-
</div>
|
| 14 |
-
|
| 15 |
-
<div class="box-footer buttons modal">
|
| 16 |
-
<?php wp_nonce_field( 'wds-redirect', 'wds-redirect' ); ?>
|
| 17 |
-
<button type="button" class="button button-cta-alt wds-submit-redirect"><?php echo esc_html_e( 'Save', 'wds' ); ?></button>
|
| 18 |
-
</div>
|
| 19 |
-
|
| 20 |
-
</dialog>
|
| 21 |
-
|
| 22 |
-
<section id="header">
|
| 23 |
-
<?php $this->_render( 'settings-message-top' ); ?>
|
| 24 |
-
<h1><?php esc_html_e( 'Redirections' , 'wds' ); ?></h1>
|
| 25 |
-
</section><!-- end header -->
|
| 26 |
-
|
| 27 |
-
<div class="row sub-header">
|
| 28 |
-
<div class="wds-block-section">
|
| 29 |
-
<p class="wds-page-desc"><?php esc_html_e( 'Here you will find a list of active redirections on your site.' , 'wds' ); ?></p>
|
| 30 |
-
</div>
|
| 31 |
-
</div><!-- end sub-header -->
|
| 32 |
-
|
| 33 |
-
<form action='<?php echo esc_url( $_view['action_url'] ); ?>' method='post' class="wds-form">
|
| 34 |
-
<?php settings_fields( $_view['option_name'] ); ?>
|
| 35 |
-
|
| 36 |
-
<input type="hidden" name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]' value="1">
|
| 37 |
-
|
| 38 |
-
<div class="row">
|
| 39 |
-
|
| 40 |
-
<div class="wds-redirections-list">
|
| 41 |
-
<section class="box-settings-redirections-list dev-box">
|
| 42 |
-
<div class="box-title">
|
| 43 |
-
<h3><?php esc_html_e( 'Active Redirections', 'wds' ); ?></h3>
|
| 44 |
-
<div class="buttons left">
|
| 45 |
-
<button type="button" class="button button-light wds-add_new">
|
| 46 |
-
<?php esc_html_e( 'Add new', 'wds' ); ?>
|
| 47 |
-
</button>
|
| 48 |
-
</div>
|
| 49 |
-
</div>
|
| 50 |
-
<div class="box-content no-padding">
|
| 51 |
-
<?php if ( $redirections ) { ?>
|
| 52 |
-
<div class="wds-redirections">
|
| 53 |
-
<table class="wds-table wds-redirections-table">
|
| 54 |
-
<thead>
|
| 55 |
-
<tr>
|
| 56 |
-
<th class="selector"><input type="checkbox" class="wds-checkbox"></th>
|
| 57 |
-
<th class="source"><?php esc_html_e( 'Old URL', 'wds' ); ?></th>
|
| 58 |
-
<th class="destination"><?php esc_html_e( 'Redirect URL', 'wds' ); ?></th>
|
| 59 |
-
<th class="type"><?php esc_html_e( 'Type', 'wds' ); ?></th>
|
| 60 |
-
</tr>
|
| 61 |
-
</thead>
|
| 62 |
-
<tbody>
|
| 63 |
-
<?php foreach ( $redirections as $source => $redirection ) { ?>
|
| 64 |
-
<tr>
|
| 65 |
-
<td>
|
| 66 |
-
<input type="checkbox" class="wds-checkbox" name="<?php echo esc_attr( $_view['option_name'] ); ?>[bulk][]" value="<?php echo esc_attr( $source ); ?>">
|
| 67 |
-
</td>
|
| 68 |
-
|
| 69 |
-
<td>
|
| 70 |
-
<div class="wds-redirection_item-source">
|
| 71 |
-
<a href="<?php echo esc_url( $source ); ?>" class="wds-label link"><?php echo esc_html( $source ); ?></a>
|
| 72 |
-
</div>
|
| 73 |
-
<div class="wds-redirection_item-separator"><i class="wdv-icon wdv-icon-fw wdv-icon-arrow-right"></i></div>
|
| 74 |
-
</td>
|
| 75 |
-
|
| 76 |
-
<td>
|
| 77 |
-
<div class="wds-redirection_item-destination">
|
| 78 |
-
<input id="<?php echo esc_attr( $_view['option_name'] ); ?>" name="<?php echo esc_attr( $_view['option_name'] ); ?>[urls][<?php echo esc_attr( $source ); ?>]" type="text" class="wds-field" value="<?php echo esc_attr( $redirection ); ?>">
|
| 79 |
-
</div>
|
| 80 |
-
</td>
|
| 81 |
-
|
| 82 |
-
<td>
|
| 83 |
-
<div class="wds-redirection_item-type">
|
| 84 |
-
<select name="<?php echo esc_attr( $_view['option_name'] ); ?>[types][<?php echo esc_attr( $source ); ?>]">
|
| 85 |
-
<option <?php if ( ! empty( $types[ $source ] ) && 301 == $types[ $source ] ) { echo 'selected'; } ?> value="301"><?php esc_html_e( 'Permanent (301)', 'wds' ); ?></option>
|
| 86 |
-
<option <?php if ( ! empty( $types[ $source ] ) && 302 == $types[ $source ] ) { echo 'selected'; } ?> value="302"><?php esc_html_e( 'Temporary (302)', 'wds' ); ?></option>
|
| 87 |
-
</select>
|
| 88 |
-
</div>
|
| 89 |
-
</td>
|
| 90 |
-
</tr>
|
| 91 |
-
<?php } ?>
|
| 92 |
-
</tbody>
|
| 93 |
-
</table>
|
| 94 |
-
</div>
|
| 95 |
-
<?php } else { ?>
|
| 96 |
-
<p><?php esc_html_e( 'No active redirections', 'wds' ); ?></p>
|
| 97 |
-
<?php } ?>
|
| 98 |
-
<div class="box-footer buttons">
|
| 99 |
-
<div class="select-wrapper">
|
| 100 |
-
<label><?php esc_html_e( 'Action:', 'wds' ); ?></label>
|
| 101 |
-
<div class="wds-redirections-actions">
|
| 102 |
-
<select name="<?php echo esc_attr( $_view['option_name'] ); ?>[bulk_action]">
|
| 103 |
-
<option><?php esc_html_e( 'No action selected', 'wds' ); ?></option>
|
| 104 |
-
<option value="delete"><?php esc_html_e( 'Delete', 'wds' ); ?></option>
|
| 105 |
-
<option value="redirect_301"><?php esc_html_e( 'Change to 301', 'wds' ); ?></option>
|
| 106 |
-
<option value="redirect_302"><?php esc_html_e( 'Change to 302', 'wds' ); ?></option>
|
| 107 |
-
</select>
|
| 108 |
-
</div>
|
| 109 |
-
</div>
|
| 110 |
-
<input name='submit' type='submit' class='button button-cta-alt' value='<?php echo esc_attr( __( 'Apply Action' , 'wds' ) ); ?>'>
|
| 111 |
-
</div>
|
| 112 |
-
</div>
|
| 113 |
-
</section><!-- end box-sitemaps-xml-sitemap-settings -->
|
| 114 |
-
</div>
|
| 115 |
-
</div>
|
| 116 |
-
|
| 117 |
-
<div class="block-section-footer buttons">
|
| 118 |
-
<input name='submit' type='submit' class='button button-cta-alt' value='<?php echo esc_attr( __( 'Save Settings' , 'wds' ) ); ?>'>
|
| 119 |
-
</div>
|
| 120 |
-
|
| 121 |
-
</form>
|
| 122 |
-
|
| 123 |
-
</div><!-- end wds-sitemap-settings -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/report-vertical-tab.php
CHANGED
|
@@ -1,81 +1,84 @@
|
|
| 1 |
-
<section class="tab wds-report-vertical-tab">
|
| 2 |
-
<?php
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
?>
|
| 20 |
-
<input
|
| 21 |
-
type="radio"
|
| 22 |
-
name="wds-admin-active-tab"
|
| 23 |
-
id="<?php echo esc_attr( $tab_id ); ?>"
|
| 24 |
-
value="<?php echo esc_attr( $tab_id ); ?>"
|
| 25 |
-
<?php checked( $is_active ); ?> />
|
| 26 |
-
|
| 27 |
-
<label for="<?php echo esc_attr( $tab_id ); ?>">
|
| 28 |
-
<?php echo esc_html( $tab_name ); ?>
|
| 29 |
-
<span class="wds-issues wds-issues-warning"><span></span></span>
|
| 30 |
-
</label>
|
| 31 |
-
|
| 32 |
-
<div
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
<?php
|
| 46 |
-
|
| 47 |
-
<?php
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
<section class="tab wds-report-vertical-tab">
|
| 2 |
+
<?php
|
| 3 |
+
// Required
|
| 4 |
+
$tab_id = empty( $tab_id ) ? '' : $tab_id;
|
| 5 |
+
$tab_name = empty( $tab_name ) ? '' : $tab_name;
|
| 6 |
+
$is_active = empty( $is_active ) ? false : $is_active;
|
| 7 |
+
$tab_sections = ! empty( $tab_sections ) && is_array( $tab_sections ) ? $tab_sections : array();
|
| 8 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 9 |
+
|
| 10 |
+
// Optional
|
| 11 |
+
$button_text = isset( $button_text ) ? $button_text : __( 'Save Settings', 'wds' );
|
| 12 |
+
$before_output = isset( $before_output ) ? $before_output : null;
|
| 13 |
+
$after_output = isset( $after_output ) ? $after_output : null;
|
| 14 |
+
$title_button = isset( $title_button ) ? $title_button : 'ignore';
|
| 15 |
+
|
| 16 |
+
// Variables
|
| 17 |
+
$is_singular = count( $tab_sections ) === 1;
|
| 18 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 19 |
+
?>
|
| 20 |
+
<input
|
| 21 |
+
type="radio"
|
| 22 |
+
name="wds-admin-active-tab"
|
| 23 |
+
id="<?php echo esc_attr( $tab_id ); ?>"
|
| 24 |
+
value="<?php echo esc_attr( $tab_id ); ?>"
|
| 25 |
+
<?php checked( $is_active ); ?> />
|
| 26 |
+
|
| 27 |
+
<label for="<?php echo esc_attr( $tab_id ); ?>">
|
| 28 |
+
<?php echo esc_html( $tab_name ); ?>
|
| 29 |
+
<span class="wds-issues wds-issues-warning"><span></span></span>
|
| 30 |
+
</label>
|
| 31 |
+
|
| 32 |
+
<div
|
| 33 |
+
class="content wds-content-tabs <?php echo esc_attr( $tab_id ); ?> <?php echo $is_singular ? '' : 'wds-accordion'; ?>">
|
| 34 |
+
<h2 class="tab-title">
|
| 35 |
+
<span class="wds-tab-title-part">
|
| 36 |
+
<?php echo esc_html( $tab_name ); ?>
|
| 37 |
+
</span>
|
| 38 |
+
<span class="wds-tab-title-part">
|
| 39 |
+
<span class="wds-issues wds-issues-warning"><span></span></span>
|
| 40 |
+
</span>
|
| 41 |
+
<span class="wds-tab-title-part">
|
| 42 |
+
<?php if ( 'ignore' === $title_button ) : ?>
|
| 43 |
+
<button
|
| 44 |
+
class="wds-ignore-all wds-button-with-loader wds-button-with-left-loader wds-disabled-during-request button button-small button-dark button-dark-o"><?php esc_html_e( 'Ignore All', 'wds' ); ?></button>
|
| 45 |
+
<?php endif; ?>
|
| 46 |
+
|
| 47 |
+
<?php if ( 'upgrade' === $title_button ) : ?>
|
| 48 |
+
<button
|
| 49 |
+
class="wds-upgrade-button button-green"><?php esc_html_e( 'Upgrade to Pro', 'wds' ); ?></button>
|
| 50 |
+
<?php endif; ?>
|
| 51 |
+
</span>
|
| 52 |
+
</h2>
|
| 53 |
+
|
| 54 |
+
<?php if ( $before_output ) : ?>
|
| 55 |
+
<?php echo wp_kses( $before_output, smartcrawl_get_allowed_html_for_forms() ); ?>
|
| 56 |
+
<input
|
| 57 |
+
type="hidden"
|
| 58 |
+
name="wds-admin-active-tab"
|
| 59 |
+
id="<?php echo esc_attr( $tab_id ); ?>"
|
| 60 |
+
value="<?php echo esc_attr( $tab_id ); ?>"/>
|
| 61 |
+
<?php endif; ?>
|
| 62 |
+
|
| 63 |
+
<?php foreach ( $tab_sections as $section ) : ?>
|
| 64 |
+
<?php
|
| 65 |
+
$this->_render( 'vertical-tab-section', array_merge(
|
| 66 |
+
$section,
|
| 67 |
+
array(
|
| 68 |
+
'show_accordion' => ! $is_singular,
|
| 69 |
+
)
|
| 70 |
+
) );
|
| 71 |
+
?>
|
| 72 |
+
<?php endforeach; ?>
|
| 73 |
+
|
| 74 |
+
<?php if ( $button_text ) : ?>
|
| 75 |
+
<div class="wds-seamless-footer"></div>
|
| 76 |
+
<?php endif; ?>
|
| 77 |
+
|
| 78 |
+
<?php
|
| 79 |
+
if ( $after_output ) {
|
| 80 |
+
echo wp_kses( $after_output, smartcrawl_get_allowed_html_for_forms() );
|
| 81 |
+
}
|
| 82 |
+
?>
|
| 83 |
+
</div>
|
| 84 |
+
</section>
|
includes/admin/templates/seomoz-dashboard-widget.php
CHANGED
|
@@ -1,71 +1,88 @@
|
|
| 1 |
-
<
|
| 2 |
-
<
|
| 3 |
-
<
|
| 4 |
-
|
| 5 |
-
<th class="
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
<
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
<
|
| 18 |
-
|
| 19 |
-
<
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
<td>
|
| 31 |
-
<
|
| 32 |
-
|
| 33 |
-
</td>
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
<
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="wpmud">
|
| 2 |
+
<table class="wds-list-table wds-moz-table">
|
| 3 |
+
<thead>
|
| 4 |
+
<tr>
|
| 5 |
+
<th class="label"><?php esc_html_e( 'Metric', 'wds' ); ?></th>
|
| 6 |
+
<th class="result"><?php esc_html_e( 'Value', 'wds' ); ?></th>
|
| 7 |
+
</tr>
|
| 8 |
+
</thead>
|
| 9 |
+
<tbody>
|
| 10 |
+
<tr>
|
| 11 |
+
<td>
|
| 12 |
+
<strong><?php esc_html_e( 'Domain mozRank', 'wds' ); ?></strong><br>
|
| 13 |
+
<?php printf( esc_html__( 'Measure of the mozRank %s of the domain in the Linkscape index', 'wds' ), '<a href="https://moz.com/learn/seo/mozrank" target="_blank">(?)</a>' ); ?>
|
| 14 |
+
</td>
|
| 15 |
+
<td>
|
| 16 |
+
<?php esc_html_e( '10-point score:', 'wds' ); ?>
|
| 17 |
+
<a href="<?php echo esc_attr( $attribution ); ?>"
|
| 18 |
+
target="_blank"><?php echo( ! empty( $urlmetrics->fmrp ) ? esc_html( $urlmetrics->fmrp ) : '' ); ?></a>
|
| 19 |
+
<br>
|
| 20 |
+
<?php esc_html_e( 'Raw score:', 'wds' ); ?>
|
| 21 |
+
<a href="<?php echo esc_attr( $attribution ); ?>"
|
| 22 |
+
target="_blank"><?php echo( ! empty( $urlmetrics->fmrr ) ? esc_html( $urlmetrics->fmrr ) : '' ); ?></a>
|
| 23 |
+
</td>
|
| 24 |
+
</tr>
|
| 25 |
+
<tr>
|
| 26 |
+
<td>
|
| 27 |
+
<strong><?php esc_html_e( 'Domain Authority', 'wds' ); ?></strong>
|
| 28 |
+
<a href="https://moz.com/learn/seo/domain-authority" target="_blank">(?)</a>
|
| 29 |
+
</td>
|
| 30 |
+
<td>
|
| 31 |
+
<a href="<?php echo esc_attr( $attribution ); ?>"
|
| 32 |
+
target="_blank"><?php echo( ! empty( $urlmetrics->pda ) ? esc_html( $urlmetrics->pda ) : '' ); ?></a>
|
| 33 |
+
</td>
|
| 34 |
+
</tr>
|
| 35 |
+
<tr>
|
| 36 |
+
<td>
|
| 37 |
+
<strong><?php esc_html_e( 'External Links to Homepage', 'wds' ); ?></strong><br>
|
| 38 |
+
<?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>' ); ?>
|
| 39 |
+
</td>
|
| 40 |
+
<td>
|
| 41 |
+
<a href="<?php echo esc_attr( $attribution ); ?>"
|
| 42 |
+
target="_blank"><?php echo( ! empty( $urlmetrics->ueid ) ? esc_html( $urlmetrics->ueid ) : '' ); ?></a>
|
| 43 |
+
</td>
|
| 44 |
+
</tr>
|
| 45 |
+
<tr>
|
| 46 |
+
<td>
|
| 47 |
+
<strong><?php esc_html_e( 'Links to Homepage', 'wds' ); ?></strong><br>
|
| 48 |
+
<?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>' ); ?>
|
| 49 |
+
</td>
|
| 50 |
+
<td>
|
| 51 |
+
<a href="<?php echo esc_attr( $attribution ); ?>"
|
| 52 |
+
target="_blank"><?php echo( ! empty( $urlmetrics->uid ) ? esc_html( $urlmetrics->uid ) : '' ); ?></a>
|
| 53 |
+
</td>
|
| 54 |
+
</tr>
|
| 55 |
+
<tr>
|
| 56 |
+
<td>
|
| 57 |
+
<strong><?php esc_html_e( 'Homepage mozRank', 'wds' ); ?></strong><br>
|
| 58 |
+
<?php printf( esc_html__( 'Measure of the mozRank %s of the homepage URL in the Linkscape index', 'wds' ), '<a href="https://moz.com/learn/seo/mozrank" target="_blank">(?)</a>' ); ?>
|
| 59 |
+
</td>
|
| 60 |
+
<td>
|
| 61 |
+
<?php esc_html_e( '10-point score:', 'wds' ); ?>
|
| 62 |
+
<a href="<?php echo esc_attr( $attribution ); ?>"
|
| 63 |
+
target="_blank"><?php echo( ! empty( $urlmetrics->umrp ) ? esc_html( $urlmetrics->umrp ) : '' ); ?></a>
|
| 64 |
+
<br>
|
| 65 |
+
<?php esc_html_e( 'Raw score:', 'wds' ); ?>
|
| 66 |
+
<a href="<?php echo esc_attr( $attribution ); ?>"
|
| 67 |
+
target="_blank"><?php echo( ! empty( $urlmetrics->umrr ) ? esc_html( $urlmetrics->umrr ) : '' ); ?></a>
|
| 68 |
+
</td>
|
| 69 |
+
</tr>
|
| 70 |
+
<tr>
|
| 71 |
+
<td>
|
| 72 |
+
<strong><?php esc_html_e( 'Homepage Authority', 'wds' ); ?></strong>
|
| 73 |
+
<a href="https://moz.com/learn/seo/page-authority" target="_blank">(?)</a>
|
| 74 |
+
</td>
|
| 75 |
+
<td>
|
| 76 |
+
<a href="<?php echo esc_attr( $attribution ); ?>"
|
| 77 |
+
target="_blank"><?php echo( ! empty( $urlmetrics->upa ) ? esc_html( $urlmetrics->upa ) : '' ); ?></a>
|
| 78 |
+
</td>
|
| 79 |
+
</tr>
|
| 80 |
+
</tbody>
|
| 81 |
+
<tfoot>
|
| 82 |
+
<tr>
|
| 83 |
+
<th class="label"><?php esc_html_e( 'Metric', 'wds' ); ?></th>
|
| 84 |
+
<th class="result"><?php esc_html_e( 'Value', 'wds' ); ?></th>
|
| 85 |
+
</tr>
|
| 86 |
+
</tfoot>
|
| 87 |
+
</table>
|
| 88 |
+
</div>
|
includes/admin/templates/seomoz-settings.php
DELETED
|
@@ -1,28 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Moz settings template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
?>
|
| 9 |
-
<div class='wrap'>
|
| 10 |
-
|
| 11 |
-
<?php $this->_render( 'settings-message-top' ); ?>
|
| 12 |
-
|
| 13 |
-
<h1><?php esc_html_e( 'SmartCrawl Wizard: Moz' , 'wds' ); ?></h1>
|
| 14 |
-
|
| 15 |
-
<?php
|
| 16 |
-
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 17 |
-
if ( ! smartcrawl_is_allowed_tab( $_view['slug'] ) ) {
|
| 18 |
-
printf( __( "Your network admin prevented access to '%s', please move onto next step.", 'wds' ), __( 'Moz' , 'wds' ) );
|
| 19 |
-
} elseif ( 'settings' === $_view['name'] || ( ! empty( $smartcrawl_options[ $_view['name'] ] ) ) ) {
|
| 20 |
-
|
| 21 |
-
echo $additional;
|
| 22 |
-
|
| 23 |
-
} else {
|
| 24 |
-
printf( __( "You've chosen not to set up '%s', please move onto next step.", 'wds' ), __( 'Moz' , 'wds' ) );
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
?>
|
| 28 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/settings-message-top.php
CHANGED
|
@@ -1,49 +1,55 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Messages handling template for settings pages
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
;
|
| 16 |
-
?>
|
| 17 |
-
<?php if ( ! empty( $_view['msg'] ) )
|
| 18 |
-
<div class="wds-notice-floating wds-notice wds-notice-<?php echo esc_attr( $type ); ?>">
|
| 19 |
-
<p><?php echo $_view['msg']; ?></p>
|
| 20 |
-
</div>
|
| 21 |
-
<?php
|
| 22 |
-
|
| 23 |
-
<?php if ( ! empty( $errors ) )
|
| 24 |
-
<?php
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
<?php
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
<?php
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Messages handling template for settings pages
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*
|
| 7 |
+
* phpcs:ignoreFile -- We need to use $_GET without nonces
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
$errors = ! empty( $_view['errors'] ) && is_array( $_view['errors'] )
|
| 11 |
+
? $_view['errors']
|
| 12 |
+
: array();
|
| 13 |
+
$type = ! empty( $errors )
|
| 14 |
+
? 'warning'
|
| 15 |
+
: 'success';
|
| 16 |
+
?>
|
| 17 |
+
<?php if ( ! empty( $_view['msg'] ) ): ?>
|
| 18 |
+
<div class="wds-notice-floating wds-notice wds-notice-<?php echo esc_attr( $type ); ?>">
|
| 19 |
+
<p><?php echo wp_kses_post( $_view['msg'] ); ?></p>
|
| 20 |
+
</div>
|
| 21 |
+
<?php endif; ?>
|
| 22 |
+
|
| 23 |
+
<?php if ( ! empty( $errors ) ): ?>
|
| 24 |
+
<?php foreach ( $errors as $error ): ?>
|
| 25 |
+
<?php
|
| 26 |
+
$msg = ! empty( $error['message'] ) ? $error['message'] : false;
|
| 27 |
+
if ( empty( $msg ) ) {
|
| 28 |
+
continue;
|
| 29 |
+
}
|
| 30 |
+
?>
|
| 31 |
+
<div class="wds-notice-floating wds-notice wds-notice-error">
|
| 32 |
+
<p><?php echo wp_kses_post( $msg ); ?></p>
|
| 33 |
+
</div>
|
| 34 |
+
<?php endforeach; ?>
|
| 35 |
+
<?php endif; ?>
|
| 36 |
+
|
| 37 |
+
<?php
|
| 38 |
+
/**
|
| 39 |
+
* Import/Export error messages display
|
| 40 |
+
*/
|
| 41 |
+
$io_errors = Smartcrawl_Controller_IO::get()->get_errors();
|
| 42 |
+
?>
|
| 43 |
+
|
| 44 |
+
<?php if ( ! empty( $io_errors ) ): ?>
|
| 45 |
+
<?php foreach ( $io_errors as $io_type => $io_error ): ?>
|
| 46 |
+
<div class="wds-notice-floating wds-notice wds-notice-error <?php esc_attr( $io_type ); ?>">
|
| 47 |
+
<p><?php echo wp_kses( $io_error, array( 'br' => array() ) ); ?></p>
|
| 48 |
+
</div>
|
| 49 |
+
<?php endforeach; ?>
|
| 50 |
+
<?php elseif ( ! empty( $_GET['import'] ) && 'success' === $_GET['import'] ): ?>
|
| 51 |
+
<div class="wds-notice-floating wds-notice wds-notice-success">
|
| 52 |
+
<p><?php esc_html_e( 'Settings successfully imported', 'wds' ); ?></p>
|
| 53 |
+
</div>
|
| 54 |
+
<?php endif; ?>
|
| 55 |
+
|
includes/admin/templates/settings/settings-custom-meta-tag.php
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
<?php $value = empty( $value ) ? '' : $value; ?>
|
| 2 |
-
<div class="wds-custom-meta-tag">
|
| 3 |
-
<input type="text"
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
</div>
|
| 1 |
+
<?php $value = empty( $value ) ? '' : $value; ?>
|
| 2 |
+
<div class="wds-custom-meta-tag">
|
| 3 |
+
<input type="text"
|
| 4 |
+
value="<?php echo esc_attr( $value ); ?>"
|
| 5 |
+
placeholder="<?php esc_html_e( 'Paste your meta tag here', 'wds' ); ?>"
|
| 6 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[additional-metas][]"/>
|
| 7 |
+
</div>
|
includes/admin/templates/settings/settings-section-general.php
CHANGED
|
@@ -1,203 +1,202 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Settings general section template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
)
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
<
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
/>
|
| 68 |
-
<label class="toggle-label" for="
|
| 69 |
-
</span>
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
'
|
| 115 |
-
'
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
'
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
<div class="
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
<?php
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Settings general section template
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 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 |
+
?>
|
| 14 |
+
|
| 15 |
+
<?php
|
| 16 |
+
$this->_render( 'toggle-group', array(
|
| 17 |
+
'label' => __( 'Plugin Modules', 'wds' ),
|
| 18 |
+
'description' => __( 'Choose which modules you would like to activate.', 'wds' ),
|
| 19 |
+
'items' => $plugin_modules,
|
| 20 |
+
) );
|
| 21 |
+
?>
|
| 22 |
+
|
| 23 |
+
<?php if ( is_multisite() && is_network_admin() ) : ?>
|
| 24 |
+
<input type="hidden" name="<?php echo esc_attr( $_view['option_name'] ); ?>[save_blog_tabs]" value="1"/>
|
| 25 |
+
<div class="wds-table-fields wds-separator-top">
|
| 26 |
+
<div class="label">
|
| 27 |
+
<label class="wds-label"><?php esc_html_e( 'Site Owner Permissions', 'wds' ); ?></label>
|
| 28 |
+
<p class="wds-label-description">
|
| 29 |
+
<?php esc_html_e( 'Use this section to choose what sections of this plugin will be accessible to Site Admins on your Network.', 'wds' ); ?>
|
| 30 |
+
</p>
|
| 31 |
+
</div>
|
| 32 |
+
|
| 33 |
+
<div class="fields">
|
| 34 |
+
<div class="wds-toggle-table">
|
| 35 |
+
<span class="toggle wds-toggle">
|
| 36 |
+
<input type="checkbox"
|
| 37 |
+
class="toggle-checkbox"
|
| 38 |
+
value="yes"
|
| 39 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[wds_sitewide_mode]"
|
| 40 |
+
id="wds_sitewide_mode"
|
| 41 |
+
<?php echo isset( $wds_sitewide_mode ) ? checked( $wds_sitewide_mode, true, false ) : ''; ?>
|
| 42 |
+
/>
|
| 43 |
+
<label class="toggle-label" for="wds_sitewide_mode"></label>
|
| 44 |
+
</span>
|
| 45 |
+
|
| 46 |
+
<div class="wds-toggle-description">
|
| 47 |
+
<label
|
| 48 |
+
class="wds-label"
|
| 49 |
+
for="wds_sitewide_mode"><?php esc_html_e( 'Sitewide mode (network level changes only)', 'wds' ); ?>
|
| 50 |
+
</label>
|
| 51 |
+
</div>
|
| 52 |
+
</div>
|
| 53 |
+
<?php
|
| 54 |
+
foreach ( $slugs as $item => $label ) {
|
| 55 |
+
$checked = ( ! empty( $blog_tabs[ $item ] ) ) ? 'checked' : '';
|
| 56 |
+
$presence_slug = preg_replace( '/^wds_/', '', $item );
|
| 57 |
+
?>
|
| 58 |
+
<div class="wds-toggle-table">
|
| 59 |
+
<span class="toggle wds-toggle">
|
| 60 |
+
<input type="checkbox"
|
| 61 |
+
class="toggle-checkbox"
|
| 62 |
+
value="yes"
|
| 63 |
+
data-prereq="<?php echo esc_attr( $presence_slug ); ?>"
|
| 64 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[wds_blog_tabs][<?php echo esc_attr( $item ); ?>]"
|
| 65 |
+
id="wds_blog_tabs-<?php echo esc_attr( $item ); ?>"
|
| 66 |
+
<?php echo esc_attr( $checked ); ?>
|
| 67 |
+
/>
|
| 68 |
+
<label class="toggle-label" for="wds_blog_tabs-<?php echo esc_attr( $item ); ?>"></label>
|
| 69 |
+
</span>
|
| 70 |
+
<div class="wds-toggle-description">
|
| 71 |
+
<label class="wds-label"
|
| 72 |
+
for="wds_blog_tabs-<?php echo esc_attr( $item ); ?>"><?php echo esc_html( $label ); ?></label>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
<?php
|
| 76 |
+
}
|
| 77 |
+
?>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
<?php endif; ?>
|
| 81 |
+
|
| 82 |
+
<?php
|
| 83 |
+
$this->_render( 'toggle-group', array(
|
| 84 |
+
'label' => esc_html__( 'Builtin modules', 'wds' ),
|
| 85 |
+
'description' => esc_html__( 'Choose which modules you would like to activate.', 'wds' ),
|
| 86 |
+
'separator' => true,
|
| 87 |
+
'items' => array(
|
| 88 |
+
'analysis-seo' => array(
|
| 89 |
+
'label' => esc_html__( 'Page Analysis', 'wds' ),
|
| 90 |
+
'description' => esc_html__( 'Analyses your content against recommend SEO practice and gives recommendations for improvement to make sure content is as optimized as possible.', 'wds' ),
|
| 91 |
+
),
|
| 92 |
+
'analysis-readability' => array(
|
| 93 |
+
'label' => esc_html__( 'Readability analysis', 'wds' ),
|
| 94 |
+
'description' => esc_html__( 'Benchmarks the readability of your content for the average visitor and gives recommendations for improvement.', 'wds' ),
|
| 95 |
+
),
|
| 96 |
+
'extras-admin_bar' => array(
|
| 97 |
+
'label' => esc_html__( 'Admin Bar', 'wds' ),
|
| 98 |
+
'description' => esc_html__( 'Adds a shortcut to SmartCrawl in the WP Admin bar at the top of your screen.', 'wds' ),
|
| 99 |
+
),
|
| 100 |
+
),
|
| 101 |
+
) );
|
| 102 |
+
?>
|
| 103 |
+
|
| 104 |
+
<?php
|
| 105 |
+
$this->_render( 'toggle-group', array(
|
| 106 |
+
'label' => __( 'Meta Tags', 'wds' ),
|
| 107 |
+
'description' => __( 'Choose what SmartCrawl modules you want available to use.', 'wds' ),
|
| 108 |
+
'separator' => true,
|
| 109 |
+
'items' => array(
|
| 110 |
+
'general-suppress-generator' => array(
|
| 111 |
+
'label' => __( 'Hide generator meta tag', 'wds' ),
|
| 112 |
+
'description' => __( 'It can be considered a security risk to have your WordPress version visible to the public, so we recommend you hide it.', 'wds' ),
|
| 113 |
+
),
|
| 114 |
+
'general-suppress-redundant_canonical' => array(
|
| 115 |
+
'label' => __( 'Hide redundant canonical link tags', 'wds' ),
|
| 116 |
+
'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' ),
|
| 117 |
+
),
|
| 118 |
+
'metabox-lax_enforcement' => array(
|
| 119 |
+
'label' => __( 'Enforce meta tag character limits', 'wds' ),
|
| 120 |
+
'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' ),
|
| 121 |
+
),
|
| 122 |
+
),
|
| 123 |
+
) );
|
| 124 |
+
?>
|
| 125 |
+
|
| 126 |
+
<div class="wds-table-fields wds-separator-top">
|
| 127 |
+
<div class="label">
|
| 128 |
+
<label class="wds-label"><?php esc_html_e( 'Search engines', 'wds' ); ?></label>
|
| 129 |
+
<p class="wds-label-description"><?php esc_html_e( 'This tool will add the meta tags required by search engines to verify your site with their SEO management tools to your websites <head> tag.', 'wds' ); ?></p>
|
| 130 |
+
</div>
|
| 131 |
+
<div class="fields">
|
| 132 |
+
<?php
|
| 133 |
+
$value = isset( $sitemap_options['verification-google-meta'] ) ? $sitemap_options['verification-google-meta'] : '';
|
| 134 |
+
?>
|
| 135 |
+
<label for="verification-google" class="wds-label"><?php esc_html_e( 'Google Verification', 'wds' ); ?></label>
|
| 136 |
+
<div class="wds-label-description">
|
| 137 |
+
<?php esc_html_e( 'Paste the full meta tag from Google. The value looks like this:', 'wds' ); ?>
|
| 138 |
+
<pre
|
| 139 |
+
class="wds-meta-tags-example"><?php echo esc_html( '<meta name="google-site-verification" content="+nxGUDJ4QpAZ5l9Bsjdi102tLVC21AIh5d1Nl23908vVuFHs34=" />' ); ?></pre>
|
| 140 |
+
</div>
|
| 141 |
+
<input
|
| 142 |
+
id='verification-google'
|
| 143 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[verification-google-meta]'
|
| 144 |
+
type='text'
|
| 145 |
+
class='wds-field'
|
| 146 |
+
value='<?php echo esc_attr( $value ); ?>'>
|
| 147 |
+
|
| 148 |
+
<?php
|
| 149 |
+
$value = isset( $sitemap_options['verification-bing-meta'] ) ? $sitemap_options['verification-bing-meta'] : '';
|
| 150 |
+
?>
|
| 151 |
+
<label for="verification-bing" class="wds-label"><?php esc_html_e( 'Bing Verification', 'wds' ); ?></label>
|
| 152 |
+
<div class="wds-label-description">
|
| 153 |
+
<?php esc_html_e( 'Paste the full meta tag from Bing. The value looks like this:', 'wds' ); ?>
|
| 154 |
+
<pre
|
| 155 |
+
class="wds-meta-tags-example"><?php echo esc_html( '<meta name="msvalidate.01" content="J3P85HC9105H840J1U8117603269HA13" />' ); ?></pre>
|
| 156 |
+
</div>
|
| 157 |
+
<input
|
| 158 |
+
id='verification-bing'
|
| 159 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[verification-bing-meta]'
|
| 160 |
+
type='text'
|
| 161 |
+
class='wds-field'
|
| 162 |
+
value='<?php echo esc_attr( $value ); ?>'>
|
| 163 |
+
|
| 164 |
+
<label for="verification-pages"
|
| 165 |
+
class="wds-label"><?php esc_html_e( 'Add verification code to', 'wds' ); ?></label>
|
| 166 |
+
<select id="verification-pages"
|
| 167 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[verification-pages]"
|
| 168 |
+
class="select-container"
|
| 169 |
+
style="width: 100%;">
|
| 170 |
+
<?php foreach ( $verification_pages as $item => $label ) : ?>
|
| 171 |
+
<?php
|
| 172 |
+
$selected = isset( $sitemap_options['verification-pages'] ) && $sitemap_options['verification-pages'] === $item ? 'selected' : '';
|
| 173 |
+
?>
|
| 174 |
+
<option
|
| 175 |
+
value="<?php echo esc_attr( $item ); ?>"
|
| 176 |
+
<?php echo esc_attr( $selected ); ?>>
|
| 177 |
+
<?php echo esc_html( $label ); ?>
|
| 178 |
+
</option>
|
| 179 |
+
<?php endforeach; ?>
|
| 180 |
+
</select>
|
| 181 |
+
|
| 182 |
+
<div class="wds-custom-meta-tags">
|
| 183 |
+
<label for="verification-google" class="wds-label"><?php esc_html_e( 'Custom meta tags', 'wds' ); ?></label>
|
| 184 |
+
<p class="wds-label-description"><?php esc_html_e( 'Have more meta tags you want to add? Add as many as you like.', 'wds' ); ?></p>
|
| 185 |
+
|
| 186 |
+
<?php if ( ! empty( $sitemap_options['additional-metas'] ) && is_array( $sitemap_options['additional-metas'] ) ) : ?>
|
| 187 |
+
<?php
|
| 188 |
+
foreach ( $sitemap_options['additional-metas'] as $custom_value ) {
|
| 189 |
+
$this->_render( 'settings/settings-custom-meta-tag', array(
|
| 190 |
+
'value' => $custom_value,
|
| 191 |
+
) );
|
| 192 |
+
}
|
| 193 |
+
?>
|
| 194 |
+
<?php endif; ?>
|
| 195 |
+
|
| 196 |
+
<?php $this->_render( 'settings/settings-custom-meta-tag' ); ?>
|
| 197 |
+
|
| 198 |
+
<button type="button"
|
| 199 |
+
class="button button-dark button-dark-o"><?php esc_html_e( 'Add Another', 'wds' ); ?></button>
|
| 200 |
+
</div>
|
| 201 |
+
</div>
|
| 202 |
+
</div>
|
|
|
includes/admin/templates/settings/settings-section-import-export.php
CHANGED
|
@@ -1,61 +1,66 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
<
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
<
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php wp_nonce_field( 'wds-io-nonce', '_wds_nonce' ); ?>
|
| 2 |
+
<div class="wds-io">
|
| 3 |
+
<div class="wds-table-fields">
|
| 4 |
+
<div class="label">
|
| 5 |
+
<label class="wds-label"><?php esc_html_e( 'Export', 'wds' ); ?></label>
|
| 6 |
+
<p class="wds-label-description"><?php esc_html_e( 'Export your full SmartCrawl configuration to use on another site.', 'wds' ); ?></p>
|
| 7 |
+
</div>
|
| 8 |
+
<div class="fields wds-io wds-export">
|
| 9 |
+
<button name="io-action" value="export"
|
| 10 |
+
class="button button-dark-o"><?php esc_html_e( 'Export', 'wds' ); ?></button>
|
| 11 |
+
</div>
|
| 12 |
+
</div>
|
| 13 |
+
|
| 14 |
+
<div class="wds-table-fields wds-separator-top">
|
| 15 |
+
<div class="label">
|
| 16 |
+
<label class="wds-label"><?php esc_html_e( 'Import', 'wds' ); ?></label>
|
| 17 |
+
<p class="wds-label-description"><?php esc_html_e( 'Use this tool to import your SmartCrawl settings from another site.', 'wds' ); ?></p>
|
| 18 |
+
</div>
|
| 19 |
+
<div class="fields wds-io wds-import">
|
| 20 |
+
<div>
|
| 21 |
+
<label class="wds-label"><?php esc_html_e( 'SmartCrawl', 'wds' ); ?></label>
|
| 22 |
+
<p class="wds-label-description">
|
| 23 |
+
<?php esc_html_e( 'Import your exported SmartCrawl XML settings file.', 'wds' ); ?>
|
| 24 |
+
</p>
|
| 25 |
+
|
| 26 |
+
<div class="wds-styleable-file-input">
|
| 27 |
+
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo esc_attr( wp_max_upload_size() ); ?>"/>
|
| 28 |
+
<input id="wds_import_json" type="file" name="wds_import_json"/>
|
| 29 |
+
<input type="text" readonly/>
|
| 30 |
+
<label for="wds_import_json"
|
| 31 |
+
class="button button-dark-o"><?php esc_html_e( 'Select File', 'wds' ); ?></label>
|
| 32 |
+
</div>
|
| 33 |
+
<button name="io-action" value="import"
|
| 34 |
+
class="button button-dark"><?php esc_html_e( 'Import', 'wds' ); ?></button>
|
| 35 |
+
</div>
|
| 36 |
+
<?php if ( is_main_site() ): ?>
|
| 37 |
+
<div class="wds-separator-top">
|
| 38 |
+
<label class="wds-label"><?php esc_html_e( 'Third Party', 'wds' ); ?></label>
|
| 39 |
+
<p class="wds-label-description">
|
| 40 |
+
<?php esc_html_e( 'Automatically import your SEO configuration from other SEO plugins.', 'wds' ); ?>
|
| 41 |
+
</p>
|
| 42 |
+
<div class="wds-third-party-plugins">
|
| 43 |
+
<div class="wds-yoast wds-third-party-plugin">
|
| 44 |
+
<div class="wds-third-party-plugin-name"><?php esc_html_e( 'Yoast SEO', 'wds' ); ?></div>
|
| 45 |
+
<div class="wds-third-party-plugin-button">
|
| 46 |
+
<button
|
| 47 |
+
class="button button-dark button-small"><?php esc_html_e( 'Import', 'wds' ); ?></button>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
<div class="wds-aioseop wds-third-party-plugin">
|
| 51 |
+
<div
|
| 52 |
+
class="wds-third-party-plugin-name"><?php esc_html_e( 'All In One SEO', 'wds' ); ?></div>
|
| 53 |
+
<div class="wds-third-party-plugin-button">
|
| 54 |
+
<button
|
| 55 |
+
class="button button-dark button-small"><?php esc_html_e( 'Import', 'wds' ); ?></button>
|
| 56 |
+
</div>
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
<p class="wds-label-description">
|
| 60 |
+
<?php esc_html_e( 'Automatically import your SEO configuration from other SEO plugins. Note: This will override all of your current settings. We recommend exporting your current settings first, just in case.', 'wds' ); ?>
|
| 61 |
+
</p>
|
| 62 |
+
</div>
|
| 63 |
+
<?php endif; ?>
|
| 64 |
+
</div>
|
| 65 |
+
</div>
|
| 66 |
+
</div>
|
includes/admin/templates/settings/settings-section-user-roles.php
CHANGED
|
@@ -1,82 +1,85 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
?>
|
| 7 |
-
<input type="hidden" name="<?php echo esc_attr( $option_name ); ?>[saving_user_roles]" value="1"
|
| 8 |
-
<div class="wds-table-fields">
|
| 9 |
-
<div class="label">
|
| 10 |
-
<label class="wds-label"><?php esc_html_e( 'Access', 'wds' ); ?></label>
|
| 11 |
-
</div>
|
| 12 |
-
<div class="fields">
|
| 13 |
-
<div>
|
| 14 |
-
<label for="seo_metabox_permission_level"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
<?php echo
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
<
|
| 39 |
-
|
| 40 |
-
<
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
<?php echo
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
</
|
|
|
|
|
|
|
|
|
| 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 |
+
<input type="hidden" name="<?php echo esc_attr( $option_name ); ?>[saving_user_roles]" value="1"/>
|
| 8 |
+
<div class="wds-table-fields">
|
| 9 |
+
<div class="label">
|
| 10 |
+
<label class="wds-label"><?php esc_html_e( 'Access', 'wds' ); ?></label>
|
| 11 |
+
</div>
|
| 12 |
+
<div class="fields">
|
| 13 |
+
<div>
|
| 14 |
+
<label for="seo_metabox_permission_level"
|
| 15 |
+
class="wds-label"><?php esc_html_e( 'In page SEO meta box', 'wds' ); ?></label>
|
| 16 |
+
<p class="wds-label-description"><?php esc_html_e( 'Choose what user level you want to be able to edit individual post and page meta tags.', 'wds' ); ?></p>
|
| 17 |
+
|
| 18 |
+
<select id="seo_metabox_permission_level"
|
| 19 |
+
name="<?php echo esc_attr( $option_name ); ?>[seo_metabox_permission_level][]"
|
| 20 |
+
class="select-container"
|
| 21 |
+
style="width: 100%;">
|
| 22 |
+
<?php foreach ( $seo_metabox_permission_level as $item => $label ) : ?>
|
| 23 |
+
<?php
|
| 24 |
+
$selected = ! empty( $_view['options']['seo_metabox_permission_level'] ) && is_array( $_view['options']['seo_metabox_permission_level'] )
|
| 25 |
+
? ( in_array( $item, $_view['options']['seo_metabox_permission_level'], true ) ? "selected" : '' ) // New
|
| 26 |
+
: ( $_view['options']['seo_metabox_permission_level'] === $item ? "selected" : '' );
|
| 27 |
+
?>
|
| 28 |
+
<option
|
| 29 |
+
<?php echo esc_attr( $selected ); ?>
|
| 30 |
+
value="<?php echo esc_attr( $item ); ?>">
|
| 31 |
+
<?php echo esc_html( $label ); ?>
|
| 32 |
+
</option>
|
| 33 |
+
<?php endforeach; ?>
|
| 34 |
+
</select>
|
| 35 |
+
</div>
|
| 36 |
+
|
| 37 |
+
<div class="wds-separator-top">
|
| 38 |
+
<label for="seo_metabox_301_permission_level"
|
| 39 |
+
class="wds-label"><?php esc_html_e( '301 Redirections', 'wds' ); ?></label>
|
| 40 |
+
<p class="wds-label-description"><?php esc_html_e( 'Choose what user level has the ability to add 301 redirects to individual posts and pages.', 'wds' ); ?></p>
|
| 41 |
+
|
| 42 |
+
<select id="seo_metabox_301_permission_level"
|
| 43 |
+
name="<?php echo esc_attr( $option_name ); ?>[seo_metabox_301_permission_level][]"
|
| 44 |
+
class="select-container"
|
| 45 |
+
style="width: 100%;">
|
| 46 |
+
<?php foreach ( $seo_metabox_301_permission_level as $item => $label ) { ?>
|
| 47 |
+
<?php
|
| 48 |
+
$selected = ! empty( $_view['options']['seo_metabox_301_permission_level'] ) && is_array( $_view['options']['seo_metabox_301_permission_level'] )
|
| 49 |
+
? ( in_array( $item, $_view['options']['seo_metabox_301_permission_level'], true ) ? "selected" : '' ) // New
|
| 50 |
+
: ( $_view['options']['seo_metabox_301_permission_level'] === $item ? "selected" : '' );
|
| 51 |
+
?>
|
| 52 |
+
<option
|
| 53 |
+
<?php echo esc_attr( $selected ); ?>
|
| 54 |
+
value="<?php echo esc_attr( $item ); ?>">
|
| 55 |
+
<?php echo esc_html( $label ); ?>
|
| 56 |
+
</option>
|
| 57 |
+
<?php } ?>
|
| 58 |
+
</select>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<div class="wds-separator-top">
|
| 62 |
+
<label for="urlmetrics_metabox_permission_level"
|
| 63 |
+
class="wds-label"><?php esc_html_e( 'Show Moz data to roles', 'wds' ); ?></label>
|
| 64 |
+
<p class="wds-label-description"><?php esc_html_e( 'Choose what user level gets to view the Moz data.', 'wds' ); ?></p>
|
| 65 |
+
|
| 66 |
+
<select id="urlmetrics_metabox_permission_level"
|
| 67 |
+
name="<?php echo esc_attr( $option_name ); ?>[urlmetrics_metabox_permission_level][]"
|
| 68 |
+
class="select-container"
|
| 69 |
+
style="width: 100%;">
|
| 70 |
+
<?php foreach ( $urlmetrics_metabox_permission_level as $item => $label ) : ?>
|
| 71 |
+
<?php
|
| 72 |
+
$selected = ! empty( $_view['options']['urlmetrics_metabox_permission_level'] ) && is_array( $_view['options']['urlmetrics_metabox_permission_level'] )
|
| 73 |
+
? ( in_array( $item, $_view['options']['urlmetrics_metabox_permission_level'], true ) ? "selected" : '' ) // New
|
| 74 |
+
: ( $_view['options']['urlmetrics_metabox_permission_level'] === $item ? "selected" : '' );
|
| 75 |
+
?>
|
| 76 |
+
<option
|
| 77 |
+
<?php echo esc_attr( $selected ); ?>
|
| 78 |
+
value="<?php echo esc_attr( $item ); ?>">
|
| 79 |
+
<?php echo esc_html( $label ); ?>
|
| 80 |
+
</option>
|
| 81 |
+
<?php endforeach; ?>
|
| 82 |
+
</select>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
</div>
|
includes/admin/templates/settings/settings.php
CHANGED
|
@@ -1,81 +1,75 @@
|
|
| 1 |
-
<div id="container" class="wrap wrap-wds wds-page wds-page-settings">
|
| 2 |
-
|
| 3 |
-
<section id="header">
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
<?php
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
<div class="vertical-tabs">
|
| 16 |
-
<?php
|
| 17 |
-
$this->_render('vertical-tab', array(
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
)
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
)
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
)
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
} else {
|
| 78 |
-
printf( __( "You've chosen not to set up '%s', please move onto next step.", 'wds' ), __( 'Settings' , 'wds' ) );
|
| 79 |
-
}
|
| 80 |
-
|
| 81 |
-
?>
|
| 1 |
+
<div id="container" class="wrap wrap-wds wds-page wds-page-settings">
|
| 2 |
+
|
| 3 |
+
<section id="header">
|
| 4 |
+
<div class="actions">
|
| 5 |
+
<a target="_blank" class="button button-small button-light actions-button"
|
| 6 |
+
href="https://premium.wpmudev.org/docs/wpmu-dev-plugins/smartcrawl/#chapter-6">
|
| 7 |
+
<i class="wds-icon-academy"></i>
|
| 8 |
+
<?php esc_html_e( 'View Documentation', 'wds' ); ?>
|
| 9 |
+
</a>
|
| 10 |
+
</div>
|
| 11 |
+
|
| 12 |
+
<?php $this->_render( 'settings-message-top' ); ?>
|
| 13 |
+
<h1><?php esc_html_e( 'SmartCrawl Settings', 'wds' ); ?></h1>
|
| 14 |
+
</section><!-- end header -->
|
| 15 |
+
<div class="vertical-tabs">
|
| 16 |
+
<?php
|
| 17 |
+
$this->_render( 'vertical-tab', array(
|
| 18 |
+
'tab_id' => 'tab_general_settings',
|
| 19 |
+
'tab_name' => __( 'General Settings', 'wds' ),
|
| 20 |
+
'is_active' => 'tab_general_settings' === $active_tab,
|
| 21 |
+
'before_output' => $this->_load( '_forms/settings' ),
|
| 22 |
+
'after_output' => '</form>',
|
| 23 |
+
'tab_sections' => array(
|
| 24 |
+
array(
|
| 25 |
+
'section_template' => 'settings/settings-section-general',
|
| 26 |
+
'section_args' => array(
|
| 27 |
+
'verification_pages' => $verification_pages,
|
| 28 |
+
'sitemap_option_name' => $sitemap_option_name,
|
| 29 |
+
'slugs' => $slugs,
|
| 30 |
+
'wds_sitewide_mode' => $wds_sitewide_mode,
|
| 31 |
+
'blog_tabs' => $blog_tabs,
|
| 32 |
+
'plugin_modules' => $plugin_modules,
|
| 33 |
+
),
|
| 34 |
+
),
|
| 35 |
+
),
|
| 36 |
+
) );
|
| 37 |
+
?>
|
| 38 |
+
|
| 39 |
+
<?php
|
| 40 |
+
$this->_render( 'vertical-tab', array(
|
| 41 |
+
'tab_id' => 'tab_user_roles',
|
| 42 |
+
'tab_name' => __( 'User Roles', 'wds' ),
|
| 43 |
+
'is_active' => 'tab_user_roles' === $active_tab,
|
| 44 |
+
'before_output' => $this->_load( '_forms/settings' ),
|
| 45 |
+
'after_output' => '</form>',
|
| 46 |
+
'tab_sections' => array(
|
| 47 |
+
array(
|
| 48 |
+
'section_template' => 'settings/settings-section-user-roles',
|
| 49 |
+
'section_args' => array(
|
| 50 |
+
'seo_metabox_permission_level' => $seo_metabox_permission_level,
|
| 51 |
+
'seo_metabox_301_permission_level' => $seo_metabox_301_permission_level,
|
| 52 |
+
'urlmetrics_metabox_permission_level' => $urlmetrics_metabox_permission_level,
|
| 53 |
+
),
|
| 54 |
+
),
|
| 55 |
+
),
|
| 56 |
+
) );
|
| 57 |
+
?>
|
| 58 |
+
|
| 59 |
+
<?php
|
| 60 |
+
$this->_render( 'vertical-tab', array(
|
| 61 |
+
'tab_id' => 'tab_import_export',
|
| 62 |
+
'tab_name' => __( 'Import / Export', 'wds' ),
|
| 63 |
+
'is_active' => 'tab_import_export' === $active_tab,
|
| 64 |
+
'button_text' => false,
|
| 65 |
+
'before_output' => $this->_load( '_forms/import-export' ),
|
| 66 |
+
'after_output' => '</form>',
|
| 67 |
+
'tab_sections' => array(
|
| 68 |
+
array(
|
| 69 |
+
'section_template' => 'settings/settings-section-import-export',
|
| 70 |
+
),
|
| 71 |
+
),
|
| 72 |
+
) );
|
| 73 |
+
?>
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/templates/sitemap/sitemap-buddypress-settings.php
CHANGED
|
@@ -1,53 +1,53 @@
|
|
| 1 |
-
<?php $groups_enabled = ! empty( $_view['options']['sitemap-buddypress-groups'] ); ?>
|
| 2 |
-
<div class="wds-sitemap-section wds-toggleable <?php echo $groups_enabled ? '' : 'inactive'; ?>">
|
| 3 |
-
<?php
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
?>
|
| 11 |
-
|
| 12 |
-
<div class="wds-sitemap-sub-section wds-toggleable-inside-box">
|
| 13 |
-
<?php if ( ! empty( $exclude_groups ) ) :
|
| 14 |
-
<?php foreach ( $exclude_groups as $exclude_bp_role => $exclude_bp_role_label ) :
|
| 15 |
-
<?php
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
?>
|
| 23 |
-
<?php endforeach; ?>
|
| 24 |
-
<?php endif; ?>
|
| 25 |
-
</div>
|
| 26 |
-
</div>
|
| 27 |
-
|
| 28 |
-
<?php $profiles_enabled = ! empty( $_view['options']['sitemap-buddypress-profiles'] ); ?>
|
| 29 |
-
<div class="wds-sitemap-section wds-toggleable <?php echo $profiles_enabled ? '' : 'inactive'; ?>">
|
| 30 |
-
<?php
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
?>
|
| 38 |
-
|
| 39 |
-
<div class="wds-sitemap-sub-section wds-toggleable-inside-box">
|
| 40 |
-
<?php if ( ! empty( $exclude_roles ) ) :
|
| 41 |
-
<?php foreach ( $exclude_roles as $exclude_bp_role => $exclude_bp_role_label ) :
|
| 42 |
-
<?php
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
?>
|
| 50 |
-
<?php endforeach; ?>
|
| 51 |
-
<?php endif; ?>
|
| 52 |
-
</div>
|
| 53 |
-
</div>
|
| 1 |
+
<?php $groups_enabled = ! empty( $_view['options']['sitemap-buddypress-groups'] ); ?>
|
| 2 |
+
<div class="wds-sitemap-section wds-toggleable <?php echo $groups_enabled ? '' : 'inactive'; ?>">
|
| 3 |
+
<?php
|
| 4 |
+
$this->_render( 'sitemap/sitemap-part', array(
|
| 5 |
+
'item' => 'sitemap-buddypress-groups',
|
| 6 |
+
'item_name' => '',
|
| 7 |
+
'item_label' => __( 'BuddyPress Groups', 'wds' ),
|
| 8 |
+
'option_name' => $_view['option_name'] . '[sitemap-buddypress-groups]',
|
| 9 |
+
) );
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<div class="wds-sitemap-sub-section wds-toggleable-inside-box">
|
| 13 |
+
<?php if ( ! empty( $exclude_groups ) ) : ?>
|
| 14 |
+
<?php foreach ( $exclude_groups as $exclude_bp_role => $exclude_bp_role_label ) : ?>
|
| 15 |
+
<?php
|
| 16 |
+
$this->_render( 'sitemap/sitemap-part', array(
|
| 17 |
+
'item' => 'sitemap-buddypress-' . $exclude_bp_role,
|
| 18 |
+
'item_name' => '',
|
| 19 |
+
'item_label' => $exclude_bp_role_label,
|
| 20 |
+
'option_name' => $_view['option_name'] . '[exclude_bp_groups][]',
|
| 21 |
+
) );
|
| 22 |
+
?>
|
| 23 |
+
<?php endforeach; ?>
|
| 24 |
+
<?php endif; ?>
|
| 25 |
+
</div>
|
| 26 |
+
</div>
|
| 27 |
+
|
| 28 |
+
<?php $profiles_enabled = ! empty( $_view['options']['sitemap-buddypress-profiles'] ); ?>
|
| 29 |
+
<div class="wds-sitemap-section wds-toggleable <?php echo $profiles_enabled ? '' : 'inactive'; ?>">
|
| 30 |
+
<?php
|
| 31 |
+
$this->_render( 'sitemap/sitemap-part', array(
|
| 32 |
+
'item' => 'sitemap-buddypress-profiles',
|
| 33 |
+
'item_name' => '',
|
| 34 |
+
'item_label' => __( 'BuddyPress Profiles', 'wds' ),
|
| 35 |
+
'option_name' => $_view['option_name'] . '[sitemap-buddypress-profiles]',
|
| 36 |
+
) );
|
| 37 |
+
?>
|
| 38 |
+
|
| 39 |
+
<div class="wds-sitemap-sub-section wds-toggleable-inside-box">
|
| 40 |
+
<?php if ( ! empty( $exclude_roles ) ) : ?>
|
| 41 |
+
<?php foreach ( $exclude_roles as $exclude_bp_role => $exclude_bp_role_label ) : ?>
|
| 42 |
+
<?php
|
| 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 |
+
'option_name' => $_view['option_name'] . '[exclude_bp_roles][]',
|
| 48 |
+
) );
|
| 49 |
+
?>
|
| 50 |
+
<?php endforeach; ?>
|
| 51 |
+
<?php endif; ?>
|
| 52 |
+
</div>
|
| 53 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-crawl-content.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* @var Smartcrawl_Seo_Service $service
|
| 4 |
+
*/
|
| 5 |
+
$open_type = empty( $open_type ) ? null : $open_type;
|
| 6 |
+
$this->_render( 'url-crawl-master', array(
|
| 7 |
+
'ready_template' => 'sitemap/sitemap-crawl-results',
|
| 8 |
+
'ready_args' => array(
|
| 9 |
+
'open_type' => $open_type,
|
| 10 |
+
),
|
| 11 |
+
'no_data_template' => 'sitemap/sitemap-no-crawler-data',
|
| 12 |
+
'no_data_args' => array(),
|
| 13 |
+
'progress_template' => 'sitemap/sitemap-progress-bar',
|
| 14 |
+
) );
|
includes/admin/templates/sitemap/sitemap-crawl-issue-generic.php
CHANGED
|
@@ -1,57 +1,58 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
if ( ! $report || ! $type || ! $issue_id ) {
|
| 7 |
-
return;
|
| 8 |
-
}
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
),
|
| 42 |
-
)
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
</
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$type = empty( $type ) ? '' : $type;
|
| 3 |
+
$report = empty( $report ) ? null : $report;
|
| 4 |
+
$issue_id = empty( $issue_id ) ? null : $issue_id;
|
| 5 |
+
|
| 6 |
+
if ( ! $report || ! $type || ! $issue_id ) {
|
| 7 |
+
return;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
$issue = $report->get_issue( $issue_id );
|
| 11 |
+
$url = ! empty( $issue['path'] ) ? $issue['path'] : '';
|
| 12 |
+
$path = preg_replace( '/' . preg_quote( home_url(), '/' ) . '/', '', $url );
|
| 13 |
+
$path = empty( $path ) ? $url : $path;
|
| 14 |
+
?>
|
| 15 |
+
|
| 16 |
+
<tr data-issue-id="<?php echo esc_attr( $issue_id ); ?>">
|
| 17 |
+
<td>
|
| 18 |
+
<a href="<?php echo esc_attr( $url ); ?>">
|
| 19 |
+
<?php echo esc_html( $path ); ?>
|
| 20 |
+
</a>
|
| 21 |
+
</td>
|
| 22 |
+
<td>
|
| 23 |
+
<?php
|
| 24 |
+
if ( isset( $issue['response'] ) && $issue['response'] ) {
|
| 25 |
+
echo esc_html( $issue['response'] );
|
| 26 |
+
}
|
| 27 |
+
?>
|
| 28 |
+
</td>
|
| 29 |
+
<td>
|
| 30 |
+
<span class="wds-issues wds-issues-warning">
|
| 31 |
+
<span><?php echo count( $issue['origin'] ); ?></span>
|
| 32 |
+
</span>
|
| 33 |
+
</td>
|
| 34 |
+
<td>
|
| 35 |
+
<?php
|
| 36 |
+
$this->_render( 'links-dropdown', array(
|
| 37 |
+
'label' => esc_html__( 'Options', 'wds' ),
|
| 38 |
+
'links' => array(
|
| 39 |
+
'#ignore' => esc_html__( 'Ignore', 'wds' ),
|
| 40 |
+
'#occurrences' => esc_html__( 'List Occurrences', 'wds' ),
|
| 41 |
+
'#redirect' => esc_html__( 'Redirect', 'wds' ),
|
| 42 |
+
),
|
| 43 |
+
) );
|
| 44 |
+
?>
|
| 45 |
+
<?php
|
| 46 |
+
$this->_render( 'sitemap/sitemap-occurrences-overlay', array(
|
| 47 |
+
'issue_id' => $issue_id,
|
| 48 |
+
'issue' => $issue,
|
| 49 |
+
) );
|
| 50 |
+
?>
|
| 51 |
+
<?php
|
| 52 |
+
$this->_render( 'sitemap/sitemap-redirect-overlay', array(
|
| 53 |
+
'issue_id' => $issue_id,
|
| 54 |
+
'issue' => $issue,
|
| 55 |
+
) );
|
| 56 |
+
?>
|
| 57 |
+
</td>
|
| 58 |
+
</tr>
|
includes/admin/templates/sitemap/sitemap-crawl-issue-ignored.php
CHANGED
|
@@ -1,24 +1,26 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
if ( ! $report || ! $type || ! $issue_id ) {
|
| 7 |
-
return;
|
| 8 |
-
}
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$type = empty( $type ) ? '' : $type;
|
| 3 |
+
$report = empty( $report ) ? null : $report;
|
| 4 |
+
$issue_id = empty( $issue_id ) ? null : $issue_id;
|
| 5 |
+
|
| 6 |
+
if ( ! $report || ! $type || ! $issue_id ) {
|
| 7 |
+
return;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
$issue = $report->get_issue( $issue_id );
|
| 11 |
+
$url = ! empty( $issue['path'] ) ? $issue['path'] : '';
|
| 12 |
+
$path = preg_replace( '/' . preg_quote( home_url(), '/' ) . '/', '', $url );
|
| 13 |
+
$path = empty( $path ) ? $url : $path;
|
| 14 |
+
?>
|
| 15 |
+
|
| 16 |
+
<tr data-issue-id="<?php echo esc_attr( $issue_id ); ?>">
|
| 17 |
+
<td>
|
| 18 |
+
<a href="<?php echo esc_attr( $url ); ?>">
|
| 19 |
+
<?php echo esc_html( $path ); ?>
|
| 20 |
+
</a>
|
| 21 |
+
</td>
|
| 22 |
+
<td>
|
| 23 |
+
<button
|
| 24 |
+
class="wds-unignore wds-button-with-loader wds-button-with-left-loader wds-disabled-during-request button button-small button-dark button-dark-o"><?php esc_html_e( 'Restore', 'wds' ); ?></button>
|
| 25 |
+
</td>
|
| 26 |
+
</tr>
|
includes/admin/templates/sitemap/sitemap-crawl-issue-sitemap.php
CHANGED
|
@@ -1,33 +1,34 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
if ( ! $report || ! $type || ! $issue_id ) {
|
| 8 |
-
return;
|
| 9 |
-
}
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
),
|
| 30 |
-
)
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
</
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$type = empty( $type ) ? '' : $type;
|
| 4 |
+
$report = empty( $report ) ? null : $report;
|
| 5 |
+
$issue_id = empty( $issue_id ) ? null : $issue_id;
|
| 6 |
+
|
| 7 |
+
if ( ! $report || ! $type || ! $issue_id ) {
|
| 8 |
+
return;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
$issue = $report->get_issue( $issue_id );
|
| 12 |
+
$url = ! empty( $issue['path'] ) ? $issue['path'] : '';
|
| 13 |
+
$path = preg_replace( '/' . preg_quote( home_url(), '/' ) . '/', '', $url );
|
| 14 |
+
$path = empty( $path ) ? $url : $path;
|
| 15 |
+
?>
|
| 16 |
+
|
| 17 |
+
<tr data-issue-id="<?php echo esc_attr( $issue_id ); ?>" data-path="<?php echo esc_url( $url ); ?>">
|
| 18 |
+
<td>
|
| 19 |
+
<a href="<?php echo esc_attr( $url ); ?>">
|
| 20 |
+
<?php echo esc_html( $path ); ?>
|
| 21 |
+
</a>
|
| 22 |
+
</td>
|
| 23 |
+
<td>
|
| 24 |
+
<?php
|
| 25 |
+
$this->_render( 'links-dropdown', array(
|
| 26 |
+
'label' => esc_html__( 'Options', 'wds' ),
|
| 27 |
+
'links' => array(
|
| 28 |
+
'#add-to-sitemap' => esc_html__( 'Add to Sitemap', 'wds' ),
|
| 29 |
+
'#ignore' => esc_html__( 'Ignore', 'wds' ),
|
| 30 |
+
),
|
| 31 |
+
) );
|
| 32 |
+
?>
|
| 33 |
+
</td>
|
| 34 |
+
</tr>
|
includes/admin/templates/sitemap/sitemap-crawl-issues-3xx.php
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$type = empty( $type ) ? '' : $type;
|
| 3 |
+
$report = empty( $report ) ? null : $report;
|
| 4 |
+
$open = empty( $open ) ? false : $open;
|
| 5 |
+
|
| 6 |
+
$this->_render( 'sitemap/sitemap-crawl-issues-group', array(
|
| 7 |
+
'type' => $type,
|
| 8 |
+
'report' => $report,
|
| 9 |
+
'open' => $open,
|
| 10 |
+
'title' => esc_html__( '%s URLs have multiple redirections', 'wds' ),
|
| 11 |
+
'description' => esc_html__( 'Some of your URLs have multiple redirections. In the options menu you can List occurrences to see where these links can be found, and also set up and 301 redirects to a newer version of these pages.', 'wds' ),
|
| 12 |
+
'header_items' => array(
|
| 13 |
+
sprintf( '<th>%s</th>', esc_html__( 'URLs resulting in errors', 'wds' ) ),
|
| 14 |
+
sprintf( '<th>%s</th>', esc_html__( 'Error Code', 'wds' ) ),
|
| 15 |
+
sprintf( '<th colspan="2">%s</th>', esc_html__( 'Occurrences', 'wds' ) ),
|
| 16 |
+
),
|
| 17 |
+
) );
|
| 18 |
+
|
includes/admin/templates/sitemap/sitemap-crawl-issues-4xx.php
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$type = empty( $type ) ? '' : $type;
|
| 3 |
+
$report = empty( $report ) ? null : $report;
|
| 4 |
+
$open = empty( $open ) ? false : $open;
|
| 5 |
+
|
| 6 |
+
$this->_render( 'sitemap/sitemap-crawl-issues-group', array(
|
| 7 |
+
'type' => $type,
|
| 8 |
+
'report' => $report,
|
| 9 |
+
'open' => $open,
|
| 10 |
+
'title' => esc_html__( '%s URLs are resulting in 4xx errors', 'wds' ),
|
| 11 |
+
'description' => esc_html__( 'Some of your URLs are resulting in 4xx errors. Either the page no longer exists or the URL has changed. In the options menu you can List occurrences to see where these links can be found, and also set up and 301 redirects to a newer version of these pages.', 'wds' ),
|
| 12 |
+
'header_items' => array(
|
| 13 |
+
sprintf( '<th>%s</th>', esc_html__( 'URLs resulting in errors', 'wds' ) ),
|
| 14 |
+
sprintf( '<th>%s</th>', esc_html__( 'Error Code', 'wds' ) ),
|
| 15 |
+
sprintf( '<th colspan="2">%s</th>', esc_html__( 'Occurrences', 'wds' ) ),
|
| 16 |
+
),
|
| 17 |
+
) );
|
| 18 |
+
|
includes/admin/templates/sitemap/sitemap-crawl-issues-5xx.php
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$type = empty( $type ) ? '' : $type;
|
| 3 |
+
$report = empty( $report ) ? null : $report;
|
| 4 |
+
$open = empty( $open ) ? false : $open;
|
| 5 |
+
|
| 6 |
+
$this->_render( 'sitemap/sitemap-crawl-issues-group', array(
|
| 7 |
+
'type' => $type,
|
| 8 |
+
'report' => $report,
|
| 9 |
+
'open' => $open,
|
| 10 |
+
'title' => esc_html__( '%s URLs are resulting in 5xx server errors', 'wds' ),
|
| 11 |
+
'description' => esc_html__( 'Some of your URLs are resulting in 5xx server errors. These errors are indicative of errors in your server-side code. In the options menu you can List occurrences to see where these links can be found, and also set up and 301 redirects to a newer version of these pages.', 'wds' ),
|
| 12 |
+
'header_items' => array(
|
| 13 |
+
sprintf( '<th>%s</th>', esc_html__( 'URLs resulting in errors', 'wds' ) ),
|
| 14 |
+
sprintf( '<th>%s</th>', esc_html__( 'Error Code', 'wds' ) ),
|
| 15 |
+
sprintf( '<th colspan="2">%s</th>', esc_html__( 'Occurrences', 'wds' ) ),
|
| 16 |
+
),
|
| 17 |
+
) );
|
| 18 |
+
|
includes/admin/templates/sitemap/sitemap-crawl-issues-generic-controls.php
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
-
<tr class="wds-controls-row">
|
| 2 |
-
<td colspan="4">
|
| 3 |
-
<button
|
| 4 |
-
|
| 5 |
-
</
|
|
|
| 1 |
+
<tr class="wds-controls-row">
|
| 2 |
+
<td colspan="4">
|
| 3 |
+
<button
|
| 4 |
+
class="wds-ignore-all wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request button button-small button-dark button-dark-o"><?php esc_html_e( 'Ignore All', 'wds' ); ?></button>
|
| 5 |
+
</td>
|
| 6 |
+
</tr>
|
includes/admin/templates/sitemap/sitemap-crawl-issues-group.php
CHANGED
|
@@ -1,95 +1,96 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
if ( ! $report || ! $type ) {
|
| 19 |
-
return;
|
| 20 |
-
}
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
foreach ( $all_issues as $issue_id ) {
|
| 26 |
-
if ( $report->is_ignored_issue( $issue_id ) ) {
|
| 27 |
-
$ignored_issues[] = $issue_id;
|
| 28 |
-
} else {
|
| 29 |
-
$active_issues[] = $issue_id;
|
| 30 |
-
}
|
| 31 |
-
}
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
?>
|
| 36 |
-
<div
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
<
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
<
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
</
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
'
|
| 63 |
-
'
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
<
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
</
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
'
|
| 86 |
-
'
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
| 1 |
+
<?php
|
| 2 |
+
// Required
|
| 3 |
+
$type = empty( $type ) ? '' : $type;
|
| 4 |
+
/**
|
| 5 |
+
* @var $report Smartcrawl_SeoReport
|
| 6 |
+
*/
|
| 7 |
+
$report = empty( $report ) ? null : $report;
|
| 8 |
+
// Optional
|
| 9 |
+
$title = empty( $title ) ? '' : $title;
|
| 10 |
+
$description = empty( $description ) ? '' : $description;
|
| 11 |
+
$header_items = empty( $header_items ) ? array() : $header_items;
|
| 12 |
+
$controls_template = empty( $controls_template ) ? 'sitemap/sitemap-crawl-issues-generic-controls' : $controls_template;
|
| 13 |
+
$issue_template = empty( $issue_template ) ? 'sitemap/sitemap-crawl-issue-generic' : $issue_template;
|
| 14 |
+
$success_class = empty( $success_class ) ? 'wds-check-success' : $success_class;
|
| 15 |
+
$warning_class = empty( $warning_class ) ? 'wds-check-warning' : $warning_class;
|
| 16 |
+
$open = empty( $open ) ? false : $open;
|
| 17 |
+
|
| 18 |
+
if ( ! $report || ! $type ) {
|
| 19 |
+
return;
|
| 20 |
+
}
|
| 21 |
+
$all_issues = $report->get_issues_by_type( $type, true );
|
| 22 |
+
$ignored_issues = array();
|
| 23 |
+
$active_issues = array();
|
| 24 |
+
|
| 25 |
+
foreach ( $all_issues as $issue_id ) {
|
| 26 |
+
if ( $report->is_ignored_issue( $issue_id ) ) {
|
| 27 |
+
$ignored_issues[] = $issue_id;
|
| 28 |
+
} else {
|
| 29 |
+
$active_issues[] = $issue_id;
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
$issue_count = count( $active_issues );
|
| 34 |
+
$class = $issue_count > 0 ? $warning_class : $success_class;
|
| 35 |
+
?>
|
| 36 |
+
<div
|
| 37 |
+
class="wds-issues-type-<?php echo esc_attr( $type ); ?> wds-accordion-section <?php echo esc_attr( $class ); ?> <?php echo $open ? 'open' : ''; ?> <?php echo $all_issues ? '' : 'disabled'; ?>"
|
| 38 |
+
data-type="<?php echo esc_attr( $type ); ?>">
|
| 39 |
+
|
| 40 |
+
<div class="wds-accordion-handle">
|
| 41 |
+
<?php printf( esc_html( $title ), $issue_count > 0 ? intval( $issue_count ) : esc_html__( 'No', 'wds' ) ); ?>
|
| 42 |
+
</div>
|
| 43 |
+
<?php if ( $all_issues ) : ?>
|
| 44 |
+
<div class="wds-accordion-content">
|
| 45 |
+
<div class="wds-small-text"><strong><?php esc_html_e( 'Overview', 'wds' ); ?></strong></div>
|
| 46 |
+
<p>
|
| 47 |
+
<?php echo esc_html( $description ); ?>
|
| 48 |
+
</p>
|
| 49 |
+
<?php if ( $active_issues ) : ?>
|
| 50 |
+
<table class="wds-list-table wds-crawl-issues-table">
|
| 51 |
+
<thead>
|
| 52 |
+
<tr>
|
| 53 |
+
<?php foreach ( $header_items as $header_item ) : ?>
|
| 54 |
+
<?php echo wp_kses_post( $header_item ); ?>
|
| 55 |
+
<?php endforeach; ?>
|
| 56 |
+
</tr>
|
| 57 |
+
</thead>
|
| 58 |
+
<tbody>
|
| 59 |
+
<?php
|
| 60 |
+
foreach ( $active_issues as $active_issue_id ) {
|
| 61 |
+
$this->_render( $issue_template, array(
|
| 62 |
+
'type' => $type,
|
| 63 |
+
'report' => $report,
|
| 64 |
+
'issue_id' => $active_issue_id,
|
| 65 |
+
) );
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
$this->_render( $controls_template );
|
| 69 |
+
?>
|
| 70 |
+
</tbody>
|
| 71 |
+
</table>
|
| 72 |
+
<?php endif; ?>
|
| 73 |
+
|
| 74 |
+
<?php if ( $ignored_issues ) : ?>
|
| 75 |
+
<table class="wds-list-table wds-ignored-items-table">
|
| 76 |
+
<thead>
|
| 77 |
+
<tr>
|
| 78 |
+
<th colspan="2"><?php esc_html_e( 'Ignored', 'wds' ); ?></th>
|
| 79 |
+
</tr>
|
| 80 |
+
</thead>
|
| 81 |
+
<tbody>
|
| 82 |
+
<?php
|
| 83 |
+
foreach ( $ignored_issues as $ignored_issue_id ) {
|
| 84 |
+
$this->_render( 'sitemap/sitemap-crawl-issue-ignored', array(
|
| 85 |
+
'type' => $type,
|
| 86 |
+
'report' => $report,
|
| 87 |
+
'issue_id' => $ignored_issue_id,
|
| 88 |
+
) );
|
| 89 |
+
}
|
| 90 |
+
?>
|
| 91 |
+
</tbody>
|
| 92 |
+
</table>
|
| 93 |
+
<?php endif; ?>
|
| 94 |
+
</div>
|
| 95 |
+
<?php endif; ?>
|
| 96 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-crawl-issues-inaccessible.php
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$type = empty( $type ) ? '' : $type;
|
| 3 |
+
$report = empty( $report ) ? null : $report;
|
| 4 |
+
$open = empty( $open ) ? false : $open;
|
| 5 |
+
|
| 6 |
+
$this->_render( 'sitemap/sitemap-crawl-issues-group', array(
|
| 7 |
+
'type' => $type,
|
| 8 |
+
'report' => $report,
|
| 9 |
+
'open' => $open,
|
| 10 |
+
'title' => esc_html__( '%s URLs could not be processed', 'wds' ),
|
| 11 |
+
'description' => esc_html__( 'Some of your URLs could not be processed by our crawlers. In the options menu you can List occurrences to see where these links can be found, and also set up and 301 redirects to a newer version of these pages.', 'wds' ),
|
| 12 |
+
'header_items' => array(
|
| 13 |
+
sprintf( '<th>%s</th>', esc_html__( "URLs that couldn't be processed", 'wds' ) ),
|
| 14 |
+
sprintf( '<th>%s</th>', esc_html__( 'Error Code', 'wds' ) ),
|
| 15 |
+
sprintf( '<th colspan="2">%s</th>', esc_html__( 'Occurrences', 'wds' ) ),
|
| 16 |
+
),
|
| 17 |
+
) );
|
| 18 |
+
|
includes/admin/templates/sitemap/sitemap-crawl-issues-sitemap-controls.php
CHANGED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
-
<tr class="wds-controls-row">
|
| 2 |
-
<td>
|
| 3 |
-
<button
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
| 1 |
+
<tr class="wds-controls-row">
|
| 2 |
+
<td>
|
| 3 |
+
<button
|
| 4 |
+
class="wds-ignore-all wds-button-with-loader wds-button-with-right-loader wds-disabled-during-request button button-small button-dark button-dark-o"><?php esc_html_e( 'Ignore All', 'wds' ); ?></button>
|
| 5 |
+
</td>
|
| 6 |
+
<td>
|
| 7 |
+
<button
|
| 8 |
+
class="wds-add-all-to-sitemap button wds-button-with-loader wds-button-with-left-loader wds-disabled-during-request button-small"><?php esc_html_e( 'Add All to Sitemap', 'wds' ); ?></button>
|
| 9 |
+
</td>
|
| 10 |
+
</tr>
|
includes/admin/templates/sitemap/sitemap-crawl-issues-sitemap.php
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$type = empty( $type ) ? '' : $type;
|
| 3 |
+
$report = empty( $report ) ? null : $report;
|
| 4 |
+
$open = empty( $open ) ? false : $open;
|
| 5 |
+
|
| 6 |
+
$this->_render( 'sitemap/sitemap-crawl-issues-group', array(
|
| 7 |
+
'type' => $type,
|
| 8 |
+
'report' => $report,
|
| 9 |
+
'open' => $open,
|
| 10 |
+
'title' => esc_html__( '%s URLs are missing from the sitemap', 'wds' ),
|
| 11 |
+
'description' => esc_html__( 'SmartCrawl couldn’t find these URLs in your Sitemap. You can choose to add them to your Sitemap, or ignore the warning if you don’t want them included.', 'wds' ),
|
| 12 |
+
'header_items' => array(
|
| 13 |
+
sprintf( '<th colspan="2">%s</th>', esc_html__( 'Missing URLs', 'wds' ) ),
|
| 14 |
+
),
|
| 15 |
+
'issue_template' => 'sitemap/sitemap-crawl-issue-sitemap',
|
| 16 |
+
'controls_template' => 'sitemap/sitemap-crawl-issues-sitemap-controls',
|
| 17 |
+
'warning_class' => 'wds-check-invalid',
|
| 18 |
+
) );
|
| 19 |
+
|
includes/admin/templates/sitemap/sitemap-crawl-results.php
CHANGED
|
@@ -1,60 +1,60 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* SEO Audit crawl results dispatching template
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
$report = empty( $report ) ? null : $report;
|
| 9 |
-
|
| 10 |
-
if (
|
| 11 |
-
return;
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
-
$active_issues = $report->get_issues_count();
|
| 15 |
-
$ignored_issues = $report->get_ignored_issues_count();
|
| 16 |
-
$open_type = empty( $open_type ) ? null : $open_type;
|
| 17 |
-
$default_issue_types = array( '3xx', '4xx', '5xx', 'inaccessible', 'sitemap' );
|
| 18 |
-
?>
|
| 19 |
-
<div class="wds-crawl-results-report wds-report"
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
<?php
|
| 24 |
-
if ( $report->has_state_messages() ) {
|
| 25 |
-
foreach ( $report->get_state_messages() as $state_message ) {
|
| 26 |
-
$this->_render('notice', array(
|
| 27 |
-
'message' => $state_message,
|
| 28 |
-
'class' => 'wds-notice-error',
|
| 29 |
-
));
|
| 30 |
-
}
|
| 31 |
-
}
|
| 32 |
-
?>
|
| 33 |
-
|
| 34 |
-
<?php
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
?>
|
| 40 |
-
|
| 41 |
-
<p><?php esc_html_e( 'Here are potential issues SmartCrawl has picked up. We recommend fixing them up to ensure you aren’t penalized by search engines - you can however ignore any of these warnings.', 'wds' ); ?></p>
|
| 42 |
-
|
| 43 |
-
<?php if ( ! Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member() ) { ?>
|
| 44 |
-
|
| 45 |
-
<?php } ?>
|
| 46 |
-
|
| 47 |
-
<div class="wds-accordion">
|
| 48 |
-
<?php
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
foreach ( $issue_types as $type ) {
|
| 52 |
-
$this->_render('sitemap/sitemap-crawl-issues-' . $type, array(
|
| 53 |
-
'type' => $type,
|
| 54 |
-
'report' => $report,
|
| 55 |
-
'open' => $open_type
|
| 56 |
-
));
|
| 57 |
-
}
|
| 58 |
-
?>
|
| 59 |
-
</div>
|
| 60 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* SEO Audit crawl results dispatching template
|
| 4 |
+
*
|
| 5 |
+
* @package wpmu-dev-seo
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
$report = empty( $report ) ? null : $report;
|
| 9 |
+
|
| 10 |
+
if ( ! $report ) {
|
| 11 |
+
return;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
$active_issues = $report->get_issues_count();
|
| 15 |
+
$ignored_issues = $report->get_ignored_issues_count();
|
| 16 |
+
$open_type = empty( $open_type ) ? null : $open_type;
|
| 17 |
+
$default_issue_types = array( '3xx', '4xx', '5xx', 'inaccessible', 'sitemap' );
|
| 18 |
+
?>
|
| 19 |
+
<div class="wds-crawl-results-report wds-report"
|
| 20 |
+
data-active-issues="<?php echo intval( $active_issues ); ?>"
|
| 21 |
+
data-ignored-issues="<?php echo intval( $ignored_issues ); ?>">
|
| 22 |
+
|
| 23 |
+
<?php
|
| 24 |
+
if ( $report->has_state_messages() ) {
|
| 25 |
+
foreach ( $report->get_state_messages() as $state_message ) {
|
| 26 |
+
$this->_render( 'notice', array(
|
| 27 |
+
'message' => $state_message,
|
| 28 |
+
'class' => 'wds-notice-error',
|
| 29 |
+
) );
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
?>
|
| 33 |
+
|
| 34 |
+
<?php
|
| 35 |
+
$this->_render( 'sitemap/sitemap-crawl-stats', array(
|
| 36 |
+
'active_issues' => $active_issues,
|
| 37 |
+
'report' => $report,
|
| 38 |
+
) );
|
| 39 |
+
?>
|
| 40 |
+
|
| 41 |
+
<p><?php esc_html_e( 'Here are potential issues SmartCrawl has picked up. We recommend fixing them up to ensure you aren’t penalized by search engines - you can however ignore any of these warnings.', 'wds' ); ?></p>
|
| 42 |
+
|
| 43 |
+
<?php if ( ! Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE )->is_member() ) { ?>
|
| 44 |
+
<div class="wds-obfuscate-section"></div>
|
| 45 |
+
<?php } ?>
|
| 46 |
+
|
| 47 |
+
<div class="wds-accordion">
|
| 48 |
+
<?php
|
| 49 |
+
$issue_types = array_unique( array_replace_recursive( $default_issue_types, $report->get_issue_types() ) );
|
| 50 |
+
|
| 51 |
+
foreach ( $issue_types as $type ) {
|
| 52 |
+
$this->_render( 'sitemap/sitemap-crawl-issues-' . $type, array(
|
| 53 |
+
'type' => $type,
|
| 54 |
+
'report' => $report,
|
| 55 |
+
'open' => $open_type === $type,
|
| 56 |
+
) );
|
| 57 |
+
}
|
| 58 |
+
?>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-crawl-stats.php
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
if ( ! $report ) {
|
| 6 |
-
return;
|
| 7 |
-
}
|
| 8 |
-
?>
|
| 9 |
-
|
| 10 |
-
<div class="wds-url-crawler-stats wds-report-stats">
|
| 11 |
-
<div class="wds-report-score">
|
| 12 |
-
<span class="wds-score <?php echo $active_issues > 0 ? 'wds-score-warning' : 'wds-score-success'; ?>">
|
| 13 |
-
<?php echo $active_issues; ?>
|
| 14 |
-
<span class="wds-total"></span>
|
| 15 |
-
</span>
|
| 16 |
-
<span class="wds-small-text"><?php esc_html_e( 'Sitemap Issues', 'wds' ); ?></span>
|
| 17 |
-
</div>
|
| 18 |
-
|
| 19 |
-
<div>
|
| 20 |
-
<div class="wds-stacked-stats">
|
| 21 |
-
<div>
|
| 22 |
-
<div class="wds-stat-name"><?php esc_html_e( 'Total URLs Discovered', 'wds' ); ?></div>
|
| 23 |
-
<div class="wds-stat-value"><?php echo $report->get_meta( 'total' ); ?></div>
|
| 24 |
-
</div>
|
| 25 |
-
<div>
|
| 26 |
-
<div class="wds-stat-name"><?php esc_html_e( 'Invisible URLs', 'wds' ); ?></div>
|
| 27 |
-
<div class="wds-stat-value"><?php echo $report->get_issues_count( 'sitemap' ); ?></div>
|
| 28 |
-
</div>
|
| 29 |
-
</div>
|
| 30 |
-
</div>
|
| 31 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$active_issues = empty( $active_issues ) ? 0 : $active_issues;
|
| 3 |
+
$report = empty( $report ) ? null : $report;
|
| 4 |
+
|
| 5 |
+
if ( ! $report ) {
|
| 6 |
+
return;
|
| 7 |
+
}
|
| 8 |
+
?>
|
| 9 |
+
|
| 10 |
+
<div class="wds-url-crawler-stats wds-report-stats">
|
| 11 |
+
<div class="wds-report-score">
|
| 12 |
+
<span class="wds-score <?php echo $active_issues > 0 ? 'wds-score-warning' : 'wds-score-success'; ?>">
|
| 13 |
+
<?php echo intval( $active_issues ); ?>
|
| 14 |
+
<span class="wds-total"></span>
|
| 15 |
+
</span>
|
| 16 |
+
<span class="wds-small-text"><?php esc_html_e( 'Sitemap Issues', 'wds' ); ?></span>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<div>
|
| 20 |
+
<div class="wds-stacked-stats">
|
| 21 |
+
<div>
|
| 22 |
+
<div class="wds-stat-name"><?php esc_html_e( 'Total URLs Discovered', 'wds' ); ?></div>
|
| 23 |
+
<div class="wds-stat-value"><?php echo intval( $report->get_meta( 'total' ) ); ?></div>
|
| 24 |
+
</div>
|
| 25 |
+
<div>
|
| 26 |
+
<div class="wds-stat-name"><?php esc_html_e( 'Invisible URLs', 'wds' ); ?></div>
|
| 27 |
+
<div class="wds-stat-value"><?php echo intval( $report->get_issues_count( 'sitemap' ) ); ?></div>
|
| 28 |
+
</div>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-no-crawler-data.php
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 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 |
+
__( 'Have SmartCrawl check for broken URLs, 404s, multiple redirections and other harmful', 'wds' ),
|
| 8 |
+
__( 'issues that can reduce your ability to rank in search engines.', 'wds' )
|
| 9 |
+
),
|
| 10 |
+
'image' => 'url-crawler-disabled.png',
|
| 11 |
+
'button_text' => __( 'Begin Crawl', 'wds' ),
|
| 12 |
+
'button_url' => $action_url,
|
| 13 |
+
'premium_feature' => true,
|
| 14 |
+
) );
|
| 15 |
+
|
includes/admin/templates/sitemap/sitemap-occurrences-overlay.php
CHANGED
|
@@ -1,41 +1,42 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
if ( ! $issue_id || ! $issue ) {
|
| 6 |
-
return;
|
| 7 |
-
}
|
| 8 |
-
?>
|
| 9 |
-
<dialog class="dev-overlay wds-modal wds-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
<div class="box-content">
|
| 14 |
-
<div class="wds-issue-
|
| 15 |
-
<p>
|
| 16 |
-
<?php
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
?>
|
| 22 |
-
</p>
|
| 23 |
-
<ul class="wds-listing wds-path-occurrences">
|
| 24 |
-
<?php if ( ! empty( $issue['origin'] ) ) :
|
| 25 |
-
<?php foreach ( $issue['origin'] as $origin ) :
|
| 26 |
-
<li>
|
| 27 |
-
<?php $origin = is_array( $origin ) && ! empty( $origin[0] ) ? $origin[0] : $origin; ?>
|
| 28 |
-
|
| 29 |
-
<a href="<?php echo is_string( $origin ) ? esc_url( $origin ) : esc_url( $origin[0] ); ?>">
|
| 30 |
-
<?php echo is_string( $origin ) ? esc_html( $origin ) : esc_html( $origin[0] ); ?>
|
| 31 |
-
</a>
|
| 32 |
-
</li>
|
| 33 |
-
<?php endforeach; ?>
|
| 34 |
-
<?php endif; ?>
|
| 35 |
-
</ul>
|
| 36 |
-
</div>
|
| 37 |
-
<div class="wds-box-footer">
|
| 38 |
-
<button type="button"
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
</
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$issue_id = empty( $issue_id ) ? null : $issue_id;
|
| 3 |
+
$issue = empty( $issue ) ? null : $issue;
|
| 4 |
+
|
| 5 |
+
if ( ! $issue_id || ! $issue ) {
|
| 6 |
+
return;
|
| 7 |
+
}
|
| 8 |
+
?>
|
| 9 |
+
<dialog class="dev-overlay wds-modal wds-occurrences"
|
| 10 |
+
id="wds-issue-occurrences-<?php echo esc_attr( $issue_id ); ?>"
|
| 11 |
+
title="<?php esc_attr_e( 'List Occurrences', 'wds' ); ?>">
|
| 12 |
+
|
| 13 |
+
<div class="box-content">
|
| 14 |
+
<div class="wds-issue-occurrences-list">
|
| 15 |
+
<p>
|
| 16 |
+
<?php
|
| 17 |
+
printf(
|
| 18 |
+
esc_html__( 'We found links to %s in these locations, you might want to remove these links or direct them somewhere else.', 'wds' ),
|
| 19 |
+
'<strong>' . esc_html( $issue['path'] ) . '</strong>'
|
| 20 |
+
);
|
| 21 |
+
?>
|
| 22 |
+
</p>
|
| 23 |
+
<ul class="wds-listing wds-path-occurrences">
|
| 24 |
+
<?php if ( ! empty( $issue['origin'] ) ) : ?>
|
| 25 |
+
<?php foreach ( $issue['origin'] as $origin ) : ?>
|
| 26 |
+
<li>
|
| 27 |
+
<?php $origin = is_array( $origin ) && ! empty( $origin[0] ) ? $origin[0] : $origin; ?>
|
| 28 |
+
|
| 29 |
+
<a href="<?php echo is_string( $origin ) ? esc_url( $origin ) : esc_url( $origin[0] ); ?>">
|
| 30 |
+
<?php echo is_string( $origin ) ? esc_html( $origin ) : esc_html( $origin[0] ); ?>
|
| 31 |
+
</a>
|
| 32 |
+
</li>
|
| 33 |
+
<?php endforeach; ?>
|
| 34 |
+
<?php endif; ?>
|
| 35 |
+
</ul>
|
| 36 |
+
</div>
|
| 37 |
+
<div class="wds-box-footer">
|
| 38 |
+
<button type="button"
|
| 39 |
+
class="wds-cancel-button button button-dark-o"><?php esc_attr_e( 'Cancel', 'wds' ); ?></button>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
</dialog>
|
includes/admin/templates/sitemap/sitemap-part.php
CHANGED
|
@@ -1,32 +1,32 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
?>
|
| 6 |
-
<div class="wds-sitemap-part">
|
| 7 |
-
<span class="wds-sitemap-part-label">
|
| 8 |
-
<label
|
| 9 |
-
class="wds-label wds-label-inline"
|
| 10 |
-
for="<?php echo esc_attr( $item ); ?>">
|
| 11 |
-
<?php echo $item_label; ?>
|
| 12 |
-
</label>
|
| 13 |
-
</span>
|
| 14 |
-
<?php if ( ! empty( $item_name ) ) :
|
| 15 |
-
<span class="wds-sitemap-part-name">
|
| 16 |
-
<?php echo $item_name; ?>
|
| 17 |
-
</span>
|
| 18 |
-
<?php endif; ?>
|
| 19 |
-
<span class="wds-sitemap-part-toggle">
|
| 20 |
-
<span class="toggle wds-toggle <?php echo $inverted ? 'wds-inverted-toggle' : ''; ?>">
|
| 21 |
-
<input
|
| 22 |
-
class="toggle-checkbox"
|
| 23 |
-
value='<?php echo esc_attr( $item ); ?>'
|
| 24 |
-
<?php echo $part_checked; ?>
|
| 25 |
-
id='<?php echo esc_attr( $item ); ?>'
|
| 26 |
-
name="<?php echo esc_attr( $option_name ); ?>"
|
| 27 |
-
type='checkbox'/>
|
| 28 |
-
|
| 29 |
-
<label class="toggle-label" for="<?php echo $item; ?>"></label>
|
| 30 |
-
</span>
|
| 31 |
-
</span>
|
| 32 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$part_excluded = ! empty( $_view['options'][ $item ] );
|
| 3 |
+
$part_checked = $part_excluded ? 'checked' : '';
|
| 4 |
+
$inverted = empty( $inverted ) ? false : $inverted;
|
| 5 |
+
?>
|
| 6 |
+
<div class="wds-sitemap-part">
|
| 7 |
+
<span class="wds-sitemap-part-label">
|
| 8 |
+
<label
|
| 9 |
+
class="wds-label wds-label-inline"
|
| 10 |
+
for="<?php echo esc_attr( $item ); ?>">
|
| 11 |
+
<?php echo esc_html( $item_label ); ?>
|
| 12 |
+
</label>
|
| 13 |
+
</span>
|
| 14 |
+
<?php if ( ! empty( $item_name ) ) : ?>
|
| 15 |
+
<span class="wds-sitemap-part-name">
|
| 16 |
+
<?php echo esc_html( $item_name ); ?>
|
| 17 |
+
</span>
|
| 18 |
+
<?php endif; ?>
|
| 19 |
+
<span class="wds-sitemap-part-toggle">
|
| 20 |
+
<span class="toggle wds-toggle <?php echo $inverted ? 'wds-inverted-toggle' : ''; ?>">
|
| 21 |
+
<input
|
| 22 |
+
class="toggle-checkbox"
|
| 23 |
+
value='<?php echo esc_attr( $item ); ?>'
|
| 24 |
+
<?php echo esc_attr( $part_checked ); ?>
|
| 25 |
+
id='<?php echo esc_attr( $item ); ?>'
|
| 26 |
+
name="<?php echo esc_attr( $option_name ); ?>"
|
| 27 |
+
type='checkbox'/>
|
| 28 |
+
|
| 29 |
+
<label class="toggle-label" for="<?php echo esc_attr( $item ); ?>"></label>
|
| 30 |
+
</span>
|
| 31 |
+
</span>
|
| 32 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-progress-bar.php
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
-
<?php $progress = empty( $progress ) ? 0 : $progress; ?>
|
| 2 |
-
|
| 3 |
-
<div class="wds-crawl-results-report wds-report">
|
| 4 |
-
<div class="wds-url-crawler-progress">
|
| 5 |
-
<?php
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
?>
|
| 10 |
-
<?php $this->_render( 'progress-notice' ); ?>
|
| 11 |
-
</div>
|
| 12 |
-
</div>
|
| 1 |
+
<?php $progress = empty( $progress ) ? 0 : $progress; ?>
|
| 2 |
+
|
| 3 |
+
<div class="wds-crawl-results-report wds-report">
|
| 4 |
+
<div class="wds-url-crawler-progress">
|
| 5 |
+
<?php
|
| 6 |
+
$this->_render( 'progress-bar', array(
|
| 7 |
+
'progress' => $progress,
|
| 8 |
+
) );
|
| 9 |
+
?>
|
| 10 |
+
<?php $this->_render( 'progress-notice' ); ?>
|
| 11 |
+
</div>
|
| 12 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-redirect-overlay.php
CHANGED
|
@@ -1,61 +1,64 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
if ( ! $issue_id || ! $issue || ! $issue_path ) {
|
| 7 |
-
return;
|
| 8 |
-
}
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
?>
|
| 14 |
-
<dialog class="dev-overlay wds-modal wds-redirect wds-report"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
<div class="box-content modal wds-form"
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
<p>
|
| 22 |
-
<?php
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
?>
|
| 28 |
-
</p>
|
| 29 |
-
<div class="wds-table-fields wds-table-fields-stacked">
|
| 30 |
-
<div class="label">
|
| 31 |
-
<label for="wds-redirect-target-<?php echo $issue_id; ?>"
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
)
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
<?php
|
| 57 |
-
|
| 58 |
-
<button type="button"
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$issue_id = empty( $issue_id ) ? null : $issue_id;
|
| 3 |
+
$issue = empty( $issue ) ? null : $issue;
|
| 4 |
+
$issue_path = smartcrawl_get_array_value( $issue, 'path' );
|
| 5 |
+
|
| 6 |
+
if ( ! $issue_id || ! $issue || ! $issue_path ) {
|
| 7 |
+
return;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
$rmodel = new Smartcrawl_Model_Redirection();
|
| 11 |
+
$redirections = $rmodel->get_all_redirections();
|
| 12 |
+
$redirection_target = ! empty( $redirections[ $issue_path ] ) ? esc_url( $redirections[ $issue_path ] ) : '';
|
| 13 |
+
?>
|
| 14 |
+
<dialog class="dev-overlay wds-modal wds-redirect wds-report"
|
| 15 |
+
id="wds-issue-redirect-<?php echo esc_attr( $issue_id ); ?>"
|
| 16 |
+
title="<?php esc_attr_e( 'Redirect URL', 'wds' ); ?>">
|
| 17 |
+
|
| 18 |
+
<div class="box-content modal wds-form"
|
| 19 |
+
data-issue-id="<?php echo esc_attr( $issue_id ); ?>">
|
| 20 |
+
|
| 21 |
+
<p>
|
| 22 |
+
<?php
|
| 23 |
+
printf(
|
| 24 |
+
esc_html__( 'Choose where to redirect %s', 'wds' ),
|
| 25 |
+
'<strong>' . esc_html( $issue_path ) . '</strong>'
|
| 26 |
+
);
|
| 27 |
+
?>
|
| 28 |
+
</p>
|
| 29 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 30 |
+
<div class="label">
|
| 31 |
+
<label for="wds-redirect-target-<?php echo esc_attr( $issue_id ); ?>"
|
| 32 |
+
class="wds-label"><?php esc_html_e( 'New URL', 'wds' ); ?></label>
|
| 33 |
+
</div>
|
| 34 |
+
<div class="fields">
|
| 35 |
+
<input id="wds-redirect-target-<?php echo esc_attr( $issue_id ); ?>"
|
| 36 |
+
type="url"
|
| 37 |
+
name="redirect"
|
| 38 |
+
value="<?php echo esc_attr( $redirection_target ); ?>"
|
| 39 |
+
class="wds-field"
|
| 40 |
+
placeholder="<?php esc_attr_e( 'Enter new URL', 'wds' ); ?>"/>
|
| 41 |
+
<p class="wds-field-legend">
|
| 42 |
+
<?php
|
| 43 |
+
$advanced_url = Smartcrawl_Settings_Admin::admin_url( Smartcrawl_Settings::TAB_AUTOLINKS );
|
| 44 |
+
printf(
|
| 45 |
+
esc_html__( 'Formats include relative (E.g. %1$s) or absolute URLs (E.g. %2$s or %3$s). This will set up a 301 (permanent) redirect from one URL to another, you can view all your redirections under %4$s.', 'wds' ),
|
| 46 |
+
sprintf( '<strong>%s</strong>', esc_html__( '/cats', 'wds' ) ),
|
| 47 |
+
sprintf( '<strong>%s</strong>', esc_html__( 'www.website.com/cats', 'wds' ) ),
|
| 48 |
+
sprintf( '<strong>%s</strong>', esc_html__( 'https://website.com/cats', 'wds' ) ),
|
| 49 |
+
sprintf( '<strong><a href="%s">%s</a></strong>', esc_url( $advanced_url ), esc_html__( 'Advanced Tools', 'wds' ) )
|
| 50 |
+
);
|
| 51 |
+
?>
|
| 52 |
+
</p>
|
| 53 |
+
</div>
|
| 54 |
+
</div>
|
| 55 |
+
<div class="wds-box-footer">
|
| 56 |
+
<input type="hidden" name="source" value="<?php echo esc_url( $issue_path ); ?>"/>
|
| 57 |
+
<?php wp_nonce_field( 'wds-redirect', 'wds-redirect' ); ?>
|
| 58 |
+
<button type="button"
|
| 59 |
+
class="button button-dark-o wds-cancel-button wds-disabled-during-request"><?php esc_html_e( 'Cancel', 'wds' ); ?></button>
|
| 60 |
+
<button type="button"
|
| 61 |
+
class="button wds-action-button wds-submit-redirect wds-button-with-loader wds-button-with-left-loader wds-disabled-during-request"><?php esc_html_e( 'Add Redirect', 'wds' ); ?></button>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
</dialog>
|
includes/admin/templates/sitemap/sitemap-section-advanced.php
CHANGED
|
@@ -1,58 +1,58 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
?>
|
| 4 |
-
|
| 5 |
-
<?php
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
?>
|
| 38 |
-
|
| 39 |
-
<?php $automatic_updates_disabled = ! empty( $_view['options']['sitemap-disable-automatic-regeneration'] ); ?>
|
| 40 |
-
<div class="wds-toggleable wds-disable-updates <?php echo $automatic_updates_disabled ? '' : 'inactive'; ?>">
|
| 41 |
-
<?php
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
?>
|
| 58 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$engines = empty( $engines ) ? array() : $engines;
|
| 3 |
+
?>
|
| 4 |
+
|
| 5 |
+
<?php
|
| 6 |
+
$this->_render( 'toggle-group', array(
|
| 7 |
+
'label' => __( 'Include images', 'wds' ),
|
| 8 |
+
'description' => __( 'If your posts contain imagery you would like others to be able to search, this setting will help Google Images index them correctly.', 'wds' ),
|
| 9 |
+
'items' => array(
|
| 10 |
+
'sitemap-images' => array(
|
| 11 |
+
'label' => __( 'Include image items with the sitemap', 'wds' ),
|
| 12 |
+
'description' => __( 'Note: When uploading attachments to posts, be sure to add titles and captions that clearly describe your images.', 'wds' ),
|
| 13 |
+
'value' => '1',
|
| 14 |
+
),
|
| 15 |
+
),
|
| 16 |
+
) );
|
| 17 |
+
|
| 18 |
+
$this->_render( 'toggle-group', array(
|
| 19 |
+
'label' => __( 'Auto-notify search engines', 'wds' ),
|
| 20 |
+
'description' => __( 'Instead of waiting for search engines to crawl your website you can automatically submit your sitemap whenever it changes.', 'wds' ),
|
| 21 |
+
'separator' => true,
|
| 22 |
+
'items' => $engines,
|
| 23 |
+
) );
|
| 24 |
+
|
| 25 |
+
$this->_render( 'toggle-group', array(
|
| 26 |
+
'label' => __( 'Style sitemap', 'wds' ),
|
| 27 |
+
'description' => __( 'Adds some nice styling to your sitemap.', 'wds' ),
|
| 28 |
+
'separator' => true,
|
| 29 |
+
'items' => array(
|
| 30 |
+
'sitemap-stylesheet' => array(
|
| 31 |
+
'label' => __( 'Include stylesheet with sitemap', 'wds' ),
|
| 32 |
+
'description' => __( 'Note: This doesn’t affect your SEO and is purely visual.', 'wds' ),
|
| 33 |
+
'value' => '1',
|
| 34 |
+
),
|
| 35 |
+
),
|
| 36 |
+
) );
|
| 37 |
+
?>
|
| 38 |
+
|
| 39 |
+
<?php $automatic_updates_disabled = ! empty( $_view['options']['sitemap-disable-automatic-regeneration'] ); ?>
|
| 40 |
+
<div class="wds-toggleable wds-disable-updates <?php echo $automatic_updates_disabled ? '' : 'inactive'; ?>">
|
| 41 |
+
<?php
|
| 42 |
+
$this->_render( 'toggle-group', array(
|
| 43 |
+
'label' => __( 'Automatic sitemap updates', 'wds' ),
|
| 44 |
+
'description' => __( 'Choose whether or not you want SmartCrawl to update your Sitemap automatically when you publish new pages, posts, post types or taxonomies.', 'wds' ),
|
| 45 |
+
'separator' => true,
|
| 46 |
+
'items' => array(
|
| 47 |
+
'sitemap-disable-automatic-regeneration' => array(
|
| 48 |
+
'label' => __( 'Automatically update my sitemap', 'wds' ),
|
| 49 |
+
'inverted' => true,
|
| 50 |
+
'html_description' => sprintf(
|
| 51 |
+
'<div class="wds-toggleable-inside wds-notice wds-notice-warning"><p>%s</p></div>',
|
| 52 |
+
__( 'Your sitemap isn’t being updated automatically. Click Save Settings below to regenerate your sitemap.', 'wds' )
|
| 53 |
+
),
|
| 54 |
+
),
|
| 55 |
+
),
|
| 56 |
+
) );
|
| 57 |
+
?>
|
| 58 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-section-reporting.php
CHANGED
|
@@ -1,100 +1,103 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
?>
|
| 11 |
-
|
| 12 |
-
<?php if ( ! $service->is_member() ) :
|
| 13 |
-
<div class="wds-obfuscate-section"></div>
|
| 14 |
-
<?php endif; ?>
|
| 15 |
-
|
| 16 |
-
<div class="wds-table-fields wds-toggleable">
|
| 17 |
-
<div class="label">
|
| 18 |
-
<label class="wds-label"
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
<?php esc_html_e( 'Schedule Crawl', 'wds' ); ?>
|
| 22 |
-
</label>
|
| 23 |
-
</div>
|
| 24 |
-
<div class="fields wds-toggleable <?php echo $crawler_cron_enabled ? '' : 'inactive'; ?>">
|
| 25 |
-
<?php
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
?>
|
| 33 |
-
<div class="wds-toggleable-inside wds-toggleable-inside-box">
|
| 34 |
-
<div class="wds-table-fields wds-table-fields-stacked">
|
| 35 |
-
<div class="label">
|
| 36 |
-
<label for="wds-crawler-frequency"
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
<div class="
|
| 82 |
-
<
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
</div>
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 3 |
+
$cron = Smartcrawl_Controller_Cron::get();
|
| 4 |
+
$option_name = $_view['option_name'];
|
| 5 |
+
|
| 6 |
+
// This does the actual rescheduling
|
| 7 |
+
$cron->set_up_schedule();
|
| 8 |
+
$crawler_cron_enabled = $_view['options']['crawler-cron-enable'];
|
| 9 |
+
$toggle_field_name = $option_name . '[crawler-cron-enable]';
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<?php if ( ! $service->is_member() ) : ?>
|
| 13 |
+
<div class="wds-obfuscate-section"></div>
|
| 14 |
+
<?php endif; ?>
|
| 15 |
+
|
| 16 |
+
<div class="wds-table-fields wds-toggleable">
|
| 17 |
+
<div class="label">
|
| 18 |
+
<label class="wds-label"
|
| 19 |
+
for="<?php echo esc_attr( $toggle_field_name ); ?>">
|
| 20 |
+
|
| 21 |
+
<?php esc_html_e( 'Schedule Crawl', 'wds' ); ?>
|
| 22 |
+
</label>
|
| 23 |
+
</div>
|
| 24 |
+
<div class="fields wds-toggleable <?php echo $crawler_cron_enabled ? '' : 'inactive'; ?>">
|
| 25 |
+
<?php
|
| 26 |
+
$this->_render( 'toggle-item', array(
|
| 27 |
+
'field_name' => $toggle_field_name,
|
| 28 |
+
'field_id' => $toggle_field_name,
|
| 29 |
+
'checked' => checked( $crawler_cron_enabled, true, false ),
|
| 30 |
+
'item_label' => esc_html__( 'Run regular URL crawls', 'wds' ),
|
| 31 |
+
) );
|
| 32 |
+
?>
|
| 33 |
+
<div class="wds-toggleable-inside wds-toggleable-inside-box">
|
| 34 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 35 |
+
<div class="label">
|
| 36 |
+
<label for="wds-crawler-frequency"
|
| 37 |
+
class="wds-label"><?php esc_html_e( 'Frequency', 'wds' ); ?></label>
|
| 38 |
+
</div>
|
| 39 |
+
<div class="fields">
|
| 40 |
+
<select class="select-container wds-conditional-parent"
|
| 41 |
+
id="wds-crawler-frequency"
|
| 42 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[crawler-frequency]"
|
| 43 |
+
style="width: 100%">
|
| 44 |
+
|
| 45 |
+
<?php foreach ( $cron->get_frequencies() as $key => $label ) : ?>
|
| 46 |
+
<option
|
| 47 |
+
value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $_view['options']['crawler-frequency'] ); ?>>
|
| 48 |
+
<?php echo esc_html( $label ); ?>
|
| 49 |
+
</option>
|
| 50 |
+
<?php endforeach; ?>
|
| 51 |
+
</select>
|
| 52 |
+
</div>
|
| 53 |
+
</div>
|
| 54 |
+
|
| 55 |
+
<div class="wds-table-fields wds-table-fields-stacked wds-conditional-child"
|
| 56 |
+
data-parent="wds-crawler-frequency"
|
| 57 |
+
data-parent-val="weekly,monthly">
|
| 58 |
+
|
| 59 |
+
<div class="label">
|
| 60 |
+
<label for="wds-crawler-dow"
|
| 61 |
+
class="wds-label"><?php esc_html_e( 'Day of the week', 'wds' ); ?></label>
|
| 62 |
+
</div>
|
| 63 |
+
<div class="fields">
|
| 64 |
+
<select class="select-container"
|
| 65 |
+
id="wds-crawler-dow"
|
| 66 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[crawler-dow]"
|
| 67 |
+
style="width: 100%">
|
| 68 |
+
|
| 69 |
+
<?php $monday = strtotime( 'this Monday' ); ?>
|
| 70 |
+
<?php foreach ( range( 0, 6 ) as $dow ) : ?>
|
| 71 |
+
<option value="<?php echo esc_attr( $dow ); ?>"
|
| 72 |
+
<?php selected( $dow, $_view['options']['crawler-dow'] ); ?>>
|
| 73 |
+
<?php echo esc_html( date_i18n( 'l', $monday + ( $dow * DAY_IN_SECONDS ) ) ); ?>
|
| 74 |
+
</option>
|
| 75 |
+
<?php endforeach; ?>
|
| 76 |
+
</select>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
|
| 80 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 81 |
+
<div class="label">
|
| 82 |
+
<label for="wds-crawler-tod" class="wds-label"><?php esc_html_e( 'Time of day', 'wds' ); ?></label>
|
| 83 |
+
</div>
|
| 84 |
+
<div class="fields">
|
| 85 |
+
<select class="select-container"
|
| 86 |
+
id="wds-crawler-tod"
|
| 87 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[crawler-tod]"
|
| 88 |
+
style="width: 100%">
|
| 89 |
+
|
| 90 |
+
<?php $midnight = strtotime( 'today' ); ?>
|
| 91 |
+
<?php foreach ( range( 0, 23 ) as $tod ) : ?>
|
| 92 |
+
<option value="<?php echo esc_attr( $tod ); ?>"
|
| 93 |
+
<?php selected( $tod, $_view['options']['crawler-tod'] ); ?>>
|
| 94 |
+
<?php echo esc_html( date_i18n( get_option( 'time_format' ), $midnight + ( $tod * HOUR_IN_SECONDS ) ) ); ?>
|
| 95 |
+
</option>
|
| 96 |
+
<?php endforeach; ?>
|
| 97 |
+
</select>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-section-settings.php
CHANGED
|
@@ -1,139 +1,144 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Sitemaps admin page, Sitemap vertical tab
|
| 4 |
-
*
|
| 5 |
-
* @package wpmu-dev-seo
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
?>
|
| 16 |
-
|
| 17 |
-
<?php if ( Smartcrawl_Xml_Sitemap::is_sitemap_path_writable() ) { ?>
|
| 18 |
-
<div class="wds-notice wds-notice-success">
|
| 19 |
-
<p>
|
| 20 |
-
<?php
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
?>
|
| 26 |
-
</p>
|
| 27 |
-
</div>
|
| 28 |
-
<?php } else { ?>
|
| 29 |
-
<div class="wds-notice wds-notice-error">
|
| 30 |
-
<p>
|
| 31 |
-
<?php
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
?>
|
| 37 |
-
</p>
|
| 38 |
-
</div>
|
| 39 |
-
<?php } ?>
|
| 40 |
-
|
| 41 |
-
<div class="wds-table-fields-group">
|
| 42 |
-
<div class="wds-table-fields wds-separator-top">
|
| 43 |
-
<div class="label">
|
| 44 |
-
<label class="wds-label"><?php
|
| 45 |
-
<span class="wds-label-description">
|
| 46 |
-
<?php
|
| 47 |
-
</span>
|
| 48 |
-
</div>
|
| 49 |
-
<div class="fields">
|
| 50 |
-
<div class="wds-sitemap-parts">
|
| 51 |
-
<?php foreach ( $post_types as $item => $post_type ) :
|
| 52 |
-
<?php
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
?>
|
| 61 |
-
<?php endforeach; ?>
|
| 62 |
-
|
| 63 |
-
<?php foreach ( $taxonomies as $item => $taxonomy ) :
|
| 64 |
-
<?php
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
?>
|
| 73 |
-
<?php endforeach; ?>
|
| 74 |
-
|
| 75 |
-
<?php
|
| 76 |
-
if ( $smartcrawl_buddypress ) {
|
| 77 |
-
$this->_render( 'sitemap/sitemap-buddypress-settings', $smartcrawl_buddypress );
|
| 78 |
-
}
|
| 79 |
-
?>
|
| 80 |
-
|
| 81 |
-
</div>
|
| 82 |
-
</div>
|
| 83 |
-
</div>
|
| 84 |
-
|
| 85 |
-
<div class="wds-table-fields wds-separator-top">
|
| 86 |
-
<div class="label">
|
| 87 |
-
<label for="
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
<
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
<
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
<
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
<
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Sitemaps admin page, Sitemap vertical tab
|
| 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 |
+
$option_name = empty( $_view['option_name'] ) ? '' : $_view['option_name'];
|
| 12 |
+
$extra_urls = empty( $extra_urls ) ? '' : $extra_urls;
|
| 13 |
+
$ignore_urls = empty( $ignore_urls ) ? '' : $ignore_urls;
|
| 14 |
+
$ignore_post_ids = empty( $ignore_post_ids ) ? '' : $ignore_post_ids;
|
| 15 |
+
?>
|
| 16 |
+
|
| 17 |
+
<?php if ( Smartcrawl_Xml_Sitemap::is_sitemap_path_writable() ) { ?>
|
| 18 |
+
<div class="wds-notice wds-notice-success">
|
| 19 |
+
<p>
|
| 20 |
+
<?php
|
| 21 |
+
printf(
|
| 22 |
+
esc_html__( 'Your sitemap is available at %s', 'wds' ),
|
| 23 |
+
sprintf( '<a target="_blank" href="%s">/sitemap.xml</a>', esc_attr( smartcrawl_get_sitemap_url() ) )
|
| 24 |
+
);
|
| 25 |
+
?>
|
| 26 |
+
</p>
|
| 27 |
+
</div>
|
| 28 |
+
<?php } else { ?>
|
| 29 |
+
<div class="wds-notice wds-notice-error">
|
| 30 |
+
<p>
|
| 31 |
+
<?php
|
| 32 |
+
printf(
|
| 33 |
+
esc_html__( 'Unable to write to sitemap file: <code>%s</code>', 'wds' ),
|
| 34 |
+
esc_html( smartcrawl_get_sitemap_path() )
|
| 35 |
+
);
|
| 36 |
+
?>
|
| 37 |
+
</p>
|
| 38 |
+
</div>
|
| 39 |
+
<?php } ?>
|
| 40 |
+
|
| 41 |
+
<div class="wds-table-fields-group">
|
| 42 |
+
<div class="wds-table-fields wds-separator-top">
|
| 43 |
+
<div class="label">
|
| 44 |
+
<label class="wds-label"><?php esc_html_e( 'Include', 'wds' ); ?></label>
|
| 45 |
+
<span class="wds-label-description">
|
| 46 |
+
<?php esc_html_e( 'Choose which post types, archives and taxonomies you wish to include in your sitemap.', 'wds' ); ?>
|
| 47 |
+
</span>
|
| 48 |
+
</div>
|
| 49 |
+
<div class="fields">
|
| 50 |
+
<div class="wds-sitemap-parts">
|
| 51 |
+
<?php foreach ( $post_types as $item => $post_type ) : ?>
|
| 52 |
+
<?php
|
| 53 |
+
$this->_render( 'sitemap/sitemap-part', array(
|
| 54 |
+
'item' => $item,
|
| 55 |
+
'item_name' => $post_type->name,
|
| 56 |
+
'item_label' => $post_type->label,
|
| 57 |
+
'inverted' => true,
|
| 58 |
+
'option_name' => $option_name . '[exclude_post_types][]',
|
| 59 |
+
) );
|
| 60 |
+
?>
|
| 61 |
+
<?php endforeach; ?>
|
| 62 |
+
|
| 63 |
+
<?php foreach ( $taxonomies as $item => $taxonomy ) : ?>
|
| 64 |
+
<?php
|
| 65 |
+
$this->_render( 'sitemap/sitemap-part', array(
|
| 66 |
+
'item' => $item,
|
| 67 |
+
'item_name' => $taxonomy->name,
|
| 68 |
+
'item_label' => $taxonomy->label,
|
| 69 |
+
'inverted' => true,
|
| 70 |
+
'option_name' => $option_name . '[exclude_taxonomies][]',
|
| 71 |
+
) );
|
| 72 |
+
?>
|
| 73 |
+
<?php endforeach; ?>
|
| 74 |
+
|
| 75 |
+
<?php
|
| 76 |
+
if ( $smartcrawl_buddypress ) {
|
| 77 |
+
$this->_render( 'sitemap/sitemap-buddypress-settings', $smartcrawl_buddypress );
|
| 78 |
+
}
|
| 79 |
+
?>
|
| 80 |
+
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<div class="wds-table-fields wds-separator-top">
|
| 86 |
+
<div class="label">
|
| 87 |
+
<label for="extra-sitemap-urls"
|
| 88 |
+
class="wds-label"><?php esc_html_e( 'Extra URLs', 'wds' ); ?></label>
|
| 89 |
+
<span class="wds-label-description">
|
| 90 |
+
<?php esc_html_e( "Enter any additional URLs that aren't part of your default pages, posts or custom post types.", 'wds' ); ?>
|
| 91 |
+
</span>
|
| 92 |
+
</div>
|
| 93 |
+
|
| 94 |
+
<div class="fields">
|
| 95 |
+
<textarea id="extra-sitemap-urls"
|
| 96 |
+
name="<?php echo esc_attr( $option_name ); ?>[extra_sitemap_urls]"><?php echo esc_textarea( $extra_urls ); ?></textarea>
|
| 97 |
+
<span class="wds-field-legend">
|
| 98 |
+
<?php esc_html_e( 'Enter one URL per line', 'wds' ); ?>
|
| 99 |
+
</span>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<div class="wds-table-fields wds-separator-top">
|
| 104 |
+
<div class="label">
|
| 105 |
+
<label for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
|
| 106 |
+
class="wds-label"><?php esc_html_e( 'Exclusions', 'wds' ); ?></label>
|
| 107 |
+
<span class="wds-label-description">
|
| 108 |
+
<?php esc_html_e( 'If you have custom URLs you want explicitly excluded from your Sitemap you can do this here.', 'wds' ); ?>
|
| 109 |
+
</span>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<div class="fields">
|
| 113 |
+
<div>
|
| 114 |
+
<label for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
|
| 115 |
+
class="wds-label"><?php esc_html_e( 'Posts', 'wds' ); ?></label>
|
| 116 |
+
<span class="wds-field-legend">
|
| 117 |
+
<?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' ); ?>
|
| 118 |
+
</span>
|
| 119 |
+
<input type="text" id="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
|
| 120 |
+
placeholder="<?php echo esc_attr__( 'e.g. 1,5,6,99', 'wds' ); ?>"
|
| 121 |
+
name="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_post_ids]"
|
| 122 |
+
value="<?php echo esc_attr( $ignore_post_ids ); ?>"/>
|
| 123 |
+
<span class="wds-field-legend">
|
| 124 |
+
<?php esc_html_e( 'Enter post IDs separated by commas.', 'wds' ); ?>
|
| 125 |
+
</span>
|
| 126 |
+
</div>
|
| 127 |
+
|
| 128 |
+
<div class="wds-separator-top">
|
| 129 |
+
<label for="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
|
| 130 |
+
class="wds-label"><?php esc_html_e( 'Custom URLs', 'wds' ); ?></label>
|
| 131 |
+
<span class="wds-field-legend">
|
| 132 |
+
<?php esc_html_e( 'Enter any custom URLs you want excluded permanently from the sitemap.', 'wds' ); ?>
|
| 133 |
+
</span>
|
| 134 |
+
<textarea id="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"
|
| 135 |
+
placeholder="<?php echo esc_attr__( 'e.g. /excluded-url', 'wds' ); ?>"
|
| 136 |
+
name="<?php echo esc_attr( $option_name ); ?>[sitemap_ignore_urls]"><?php echo esc_textarea( $ignore_urls ); ?></textarea>
|
| 137 |
+
<span class="wds-field-legend">
|
| 138 |
+
<?php esc_html_e( 'Enter one URL per line', 'wds' ); ?>
|
| 139 |
+
</span>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
</div>
|
| 143 |
+
|
| 144 |
+
</div>
|
includes/admin/templates/sitemap/sitemap-settings.php
CHANGED
|
@@ -1,195 +1,203 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
<div class="actions">
|
| 14 |
-
<?php
|
| 15 |
-
|
| 16 |
-
$
|
| 17 |
-
$end =
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
<?php
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
'
|
| 72 |
-
'
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
array(
|
| 100 |
-
'
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
'
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$sitemap_tab_id = 'tab_sitemap';
|
| 3 |
+
$sitemap_tab_name = __( 'Sitemap', 'wds' );
|
| 4 |
+
$url_crawler_tab_id = 'tab_url_crawler';
|
| 5 |
+
$url_crawler_tab_name = __( 'URL Crawler', 'wds' );
|
| 6 |
+
$crawl_url = Smartcrawl_Sitemap_Settings::crawl_url();
|
| 7 |
+
?>
|
| 8 |
+
|
| 9 |
+
<div id="container" class="wrap wrap-wds wds-page wds-sitemap-settings">
|
| 10 |
+
|
| 11 |
+
<section id="header">
|
| 12 |
+
<?php $this->_render( 'settings-message-top' ); ?>
|
| 13 |
+
<div class="actions">
|
| 14 |
+
<?php if ( Smartcrawl_Settings::get_setting( 'sitemap' ) ) { ?>
|
| 15 |
+
<?php
|
| 16 |
+
$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SEO );
|
| 17 |
+
$end = $service->get_last_run_timestamp();
|
| 18 |
+
$end = ! empty( $end ) && is_numeric( $end )
|
| 19 |
+
? date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $end )
|
| 20 |
+
: __( 'Never', 'wds' );
|
| 21 |
+
|
| 22 |
+
printf(
|
| 23 |
+
esc_html__( 'Last crawl: %s', 'wds' ),
|
| 24 |
+
esc_html( $end )
|
| 25 |
+
);
|
| 26 |
+
?>
|
| 27 |
+
<?php if ( ! $service->in_progress() ) { ?>
|
| 28 |
+
<a href="<?php echo esc_attr( $crawl_url ); ?>" class="button button-small">
|
| 29 |
+
<?php esc_html_e( 'New crawl', 'wds' ); ?>
|
| 30 |
+
</a>
|
| 31 |
+
<?php } ?>
|
| 32 |
+
<?php } ?>
|
| 33 |
+
<a target="_blank" class="button button-small button-light actions-button"
|
| 34 |
+
href="https://premium.wpmudev.org/docs/wpmu-dev-plugins/smartcrawl/#chapter-4">
|
| 35 |
+
<i class="wds-icon-academy"></i>
|
| 36 |
+
<?php esc_html_e( 'View Documentation', 'wds' ); ?>
|
| 37 |
+
</a>
|
| 38 |
+
</div>
|
| 39 |
+
<h1>
|
| 40 |
+
<?php esc_html_e( 'Sitemaps', 'wds' ); ?>
|
| 41 |
+
<span class="toggle wds-toggle wds-has-tooltip"
|
| 42 |
+
data-content="<?php echo Smartcrawl_Settings::get_setting( 'sitemap' ) ? esc_html__( 'Turn off automated sitemap' ) : esc_html__( 'Turn on automated sitemap' ); ?>"
|
| 43 |
+
data-position='{"my":"left center","at":"right center"}'>
|
| 44 |
+
<input class="toggle-checkbox sitemap-status-toggle"
|
| 45 |
+
value="1"
|
| 46 |
+
id="sitemap-status-toggle"
|
| 47 |
+
autocomplete="off"
|
| 48 |
+
type="checkbox" <?php checked( Smartcrawl_Settings::get_setting( 'sitemap' ) ); ?>>
|
| 49 |
+
<label class="toggle-label" for="sitemap-status-toggle"></label>
|
| 50 |
+
</span>
|
| 51 |
+
</h1>
|
| 52 |
+
</section><!-- end header -->
|
| 53 |
+
|
| 54 |
+
<div class="wds-url-crawler-stats-container"></div>
|
| 55 |
+
|
| 56 |
+
<?php
|
| 57 |
+
$smartcrawl_options = Smartcrawl_Settings::get_options();
|
| 58 |
+
if ( 'settings' === $_view['name'] || ( ! empty( $smartcrawl_options[ $_view['name'] ] ) ) ) {
|
| 59 |
+
|
| 60 |
+
?>
|
| 61 |
+
<form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
|
| 62 |
+
<?php settings_fields( $_view['option_name'] ); ?>
|
| 63 |
+
|
| 64 |
+
<input type="hidden"
|
| 65 |
+
name='<?php echo esc_attr( $_view['option_name'] ); ?>[<?php echo esc_attr( $_view['slug'] ); ?>-setup]'
|
| 66 |
+
value="1">
|
| 67 |
+
|
| 68 |
+
<div class="vertical-tabs" id="sitemap-settings-tabs">
|
| 69 |
+
<?php
|
| 70 |
+
$this->_render( 'vertical-tab', array(
|
| 71 |
+
'tab_id' => $sitemap_tab_id,
|
| 72 |
+
'tab_name' => $sitemap_tab_name,
|
| 73 |
+
'is_active' => $sitemap_tab_id === $active_tab,
|
| 74 |
+
'tab_sections' => array(
|
| 75 |
+
array(
|
| 76 |
+
'section_description' => __( 'Automatically generate a sitemap and regularly send updates to Google.', 'wds' ),
|
| 77 |
+
'section_template' => 'sitemap/sitemap-section-settings',
|
| 78 |
+
'section_args' => array(
|
| 79 |
+
'post_types' => $post_types,
|
| 80 |
+
'taxonomies' => $taxonomies,
|
| 81 |
+
'wds_buddypress' => $wds_buddypress,
|
| 82 |
+
'extra_urls' => ! empty( $extra_urls ) ? $extra_urls : '',
|
| 83 |
+
'ignore_urls' => ! empty( $ignore_urls ) ? $ignore_urls : '',
|
| 84 |
+
'ignore_post_ids' => ! empty( $ignore_post_ids ) ? $ignore_post_ids : '',
|
| 85 |
+
),
|
| 86 |
+
),
|
| 87 |
+
),
|
| 88 |
+
) );
|
| 89 |
+
?>
|
| 90 |
+
|
| 91 |
+
<?php
|
| 92 |
+
|
| 93 |
+
$is_member = $service->is_member();
|
| 94 |
+
?>
|
| 95 |
+
|
| 96 |
+
<?php
|
| 97 |
+
$this->_render(
|
| 98 |
+
$is_member ? 'vertical-tab' : 'report-vertical-tab',
|
| 99 |
+
array(
|
| 100 |
+
'tab_id' => $url_crawler_tab_id,
|
| 101 |
+
'tab_name' => $url_crawler_tab_name,
|
| 102 |
+
'is_active' => $url_crawler_tab_id === $active_tab,
|
| 103 |
+
'button_text' => false,
|
| 104 |
+
'title_button' => 'upgrade',
|
| 105 |
+
'tab_sections' => array(
|
| 106 |
+
array(
|
| 107 |
+
'section_template' => 'sitemap/sitemap-section-url-crawler',
|
| 108 |
+
),
|
| 109 |
+
),
|
| 110 |
+
)
|
| 111 |
+
);
|
| 112 |
+
?>
|
| 113 |
+
|
| 114 |
+
<?php
|
| 115 |
+
$this->_render(
|
| 116 |
+
$is_member ? 'vertical-tab' : 'report-vertical-tab',
|
| 117 |
+
array(
|
| 118 |
+
'tab_id' => 'tab_url_crawler_reporting',
|
| 119 |
+
'tab_name' => __( 'Reporting', 'wds' ),
|
| 120 |
+
'is_active' => 'tab_url_crawler_reporting' === $active_tab,
|
| 121 |
+
'title_button' => 'upgrade',
|
| 122 |
+
'tab_sections' => array(
|
| 123 |
+
array(
|
| 124 |
+
'section_description' => esc_html__( 'Set up SmartCrawl to automatically crawl your URLs daily, weekly or monthly and send an email report to as many recipients as you like.', 'wds' ),
|
| 125 |
+
'section_template' => 'sitemap/sitemap-section-reporting',
|
| 126 |
+
),
|
| 127 |
+
),
|
| 128 |
+
)
|
| 129 |
+
);
|
| 130 |
+
?>
|
| 131 |
+
|
| 132 |
+
<?php
|
| 133 |
+
$this->_render( 'vertical-tab', array(
|
| 134 |
+
'tab_id' => 'tab_advanced',
|
| 135 |
+
'tab_name' => __( 'Advanced', 'wds' ),
|
| 136 |
+
'is_active' => 'tab_advanced' === $active_tab,
|
| 137 |
+
'tab_sections' => array(
|
| 138 |
+
array(
|
| 139 |
+
'section_template' => 'sitemap/sitemap-section-advanced',
|
| 140 |
+
'section_args' => array(
|
| 141 |
+
'engines' => $engines,
|
| 142 |
+
),
|
| 143 |
+
),
|
| 144 |
+
),
|
| 145 |
+
) );
|
| 146 |
+
?>
|
| 147 |
+
</div>
|
| 148 |
+
</form>
|
| 149 |
+
<?php } else { ?>
|
| 150 |
+
<form method="post" class="wds-form">
|
| 151 |
+
<div class="vertical-tabs" id="sitemap-settings-tabs">
|
| 152 |
+
<?php
|
| 153 |
+
$this->_render( 'vertical-tab', array(
|
| 154 |
+
'tab_id' => $sitemap_tab_id,
|
| 155 |
+
'tab_name' => $sitemap_tab_name,
|
| 156 |
+
'is_active' => $active_tab === $sitemap_tab_id,
|
| 157 |
+
'button_text' => false,
|
| 158 |
+
'tab_sections' => array(
|
| 159 |
+
array(
|
| 160 |
+
'section_template' => 'disabled-component-inner',
|
| 161 |
+
'section_args' => array(
|
| 162 |
+
'content' => sprintf(
|
| 163 |
+
'%s<br/>%s',
|
| 164 |
+
__( 'Automatically generate a full sitemap, regularly send updates to search engines and set up', 'wds' ),
|
| 165 |
+
__( 'SmartCrawl to automatically check URLs are discoverable by search engines.', 'wds' )
|
| 166 |
+
),
|
| 167 |
+
'image' => 'sitemap-disabled.png',
|
| 168 |
+
'component' => 'sitemap',
|
| 169 |
+
'button_text' => __( 'Activate Sitemap', 'wds' ),
|
| 170 |
+
),
|
| 171 |
+
),
|
| 172 |
+
),
|
| 173 |
+
) );
|
| 174 |
+
|
| 175 |
+
$this->_render( 'vertical-tab', array(
|
| 176 |
+
'tab_id' => $url_crawler_tab_id,
|
| 177 |
+
'tab_name' => $url_crawler_tab_name,
|
| 178 |
+
'is_active' => $active_tab === $url_crawler_tab_id,
|
| 179 |
+
'button_text' => false,
|
| 180 |
+
'tab_sections' => array(
|
| 181 |
+
array(
|
| 182 |
+
'section_template' => 'disabled-component-inner',
|
| 183 |
+
'section_args' => array(
|
| 184 |
+
'content' => sprintf(
|
| 185 |
+
'%s<br/>%s',
|
| 186 |
+
__( 'Have SmartCrawl check for broken URLs, 404s, multiple redirections and other harmful', 'wds' ),
|
| 187 |
+
__( 'issues that can reduce your ability to rank in search engines.', 'wds' )
|
| 188 |
+
),
|
| 189 |
+
'image' => 'url-crawler-disabled.png',
|
| 190 |
+
'component' => 'sitemap',
|
| 191 |
+
'button_text' => __( 'Activate Sitemap', 'wds' ),
|
| 192 |
+
'notice' => esc_html__( 'You must activate the Sitemap feature to use the URL crawler.', 'wds' ),
|
| 193 |
+
),
|
| 194 |
+
),
|
| 195 |
+
),
|
| 196 |
+
) );
|
| 197 |
+
?>
|
| 198 |
+
</div>
|
| 199 |
+
</form>
|
| 200 |
+
<?php } ?>
|
| 201 |
+
<?php $this->_render( 'upsell-modal' ); ?>
|
| 202 |
+
|
| 203 |
+
</div><!-- end wds-sitemap-settings -->
|
includes/admin/templates/sitemaps-dashboard-widget.php
CHANGED
|
@@ -1,59 +1,71 @@
|
|
| 1 |
-
|
| 2 |
-
<div
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
<
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
$("#
|
| 47 |
-
var me = $(
|
| 48 |
-
me.html(
|
| 49 |
-
|
| 50 |
-
$.post(
|
| 51 |
-
me.html(
|
| 52 |
-
window.location.reload();
|
| 53 |
-
}
|
| 54 |
-
|
| 55 |
-
return false;
|
| 56 |
-
});
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div style='width:45%;float:left'>
|
| 2 |
+
<div>
|
| 3 |
+
<?php
|
| 4 |
+
printf(
|
| 5 |
+
esc_html__( 'Your sitemap contains %s.', 'wds' ),
|
| 6 |
+
sprintf(
|
| 7 |
+
'<a href="%1$s" target="_blank"><b>%2$d</b> %3$s</a>',
|
| 8 |
+
esc_url( $sitemap_url ),
|
| 9 |
+
(int) smartcrawl_get_array_value( $opts, 'items' ),
|
| 10 |
+
esc_html__( 'items' )
|
| 11 |
+
)
|
| 12 |
+
);
|
| 13 |
+
?>
|
| 14 |
+
</div>
|
| 15 |
+
<br/><?php echo esc_html( $datetime ); ?>
|
| 16 |
+
<p><a href='#update_sitemap' id='wds_update_now'><?php echo esc_html( $update_sitemap ); ?></a></p>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<div style='width:45%;float:right'>
|
| 20 |
+
<?php if ( $engines ) { ?>
|
| 21 |
+
<ul>
|
| 22 |
+
<?php
|
| 23 |
+
foreach ( $engines as $key => $engine ) {
|
| 24 |
+
$service = ucfirst( $key );
|
| 25 |
+
$edate = ! empty( $engine['time'] ) ? date( get_option( 'date_format' ), $engine['time'] ) : false;
|
| 26 |
+
$etime = ! empty( $engine['time'] ) ? date( get_option( 'time_format' ), $engine['time'] ) : false;
|
| 27 |
+
$edatetime = ( $edate && $etime ) ? sprintf( __( 'Last notified on %1$s, at %2$s.', 'wds' ), $date, $time ) : __( 'Not notified', 'wds' );
|
| 28 |
+
?>
|
| 29 |
+
<li><b><?php echo esc_html( $service ); ?>:</b> <?php echo esc_html( $edatetime ); ?></li>
|
| 30 |
+
<?php } ?>
|
| 31 |
+
|
| 32 |
+
</ul>
|
| 33 |
+
|
| 34 |
+
<?php } else { ?>
|
| 35 |
+
<div><?php esc_html_e( "Search engines haven't been recently updated.", 'wds' ); ?></div>
|
| 36 |
+
<?php } ?>
|
| 37 |
+
|
| 38 |
+
<p><a href='#update_search_engines' id='wds_update_engines'><?php echo esc_html( $update_engines ); ?></a></p>
|
| 39 |
+
</div>
|
| 40 |
+
<div style='clear:both'></div>
|
| 41 |
+
|
| 42 |
+
<script type="text/javascript">
|
| 43 |
+
;
|
| 44 |
+
(function ($) {
|
| 45 |
+
$(function () {
|
| 46 |
+
$("#wds_update_now").click(function () {
|
| 47 |
+
var me = $(this);
|
| 48 |
+
me.html("<?php echo esc_js( $working ); ?>");
|
| 49 |
+
|
| 50 |
+
$.post(ajaxurl, {"action": "wds_update_sitemap"}, function () {
|
| 51 |
+
me.html("<?php echo esc_js( $done_msg ); ?>");
|
| 52 |
+
window.location.reload();
|
| 53 |
+
});
|
| 54 |
+
|
| 55 |
+
return false;
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
$("#wds_update_engines").click(function () {
|
| 59 |
+
var me = $(this);
|
| 60 |
+
me.html("<?php echo esc_js( $working ); ?>");
|
| 61 |
+
|
| 62 |
+
$.post(ajaxurl, {"action": "wds_update_engines"}, function () {
|
| 63 |
+
me.html("<?php echo esc_js( $done_msg ); ?>");
|
| 64 |
+
window.location.reload();
|
| 65 |
+
});
|
| 66 |
+
|
| 67 |
+
return false;
|
| 68 |
+
});
|
| 69 |
+
});
|
| 70 |
+
})(jQuery);
|
| 71 |
+
</script>
|
includes/admin/templates/social/social-section-accounts.php
CHANGED
|
@@ -1,163 +1,168 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-table-fields wds-separator-top">
|
| 6 |
-
<div class="label">
|
| 7 |
-
<label class="wds-label" for="website_name"><?php esc_html_e( 'Website name', 'wds' ); ?></label>
|
| 8 |
-
</div>
|
| 9 |
-
<div class="fields">
|
| 10 |
-
<input type="text" id="website_name" name="<?php echo esc_attr( $_view['option_name'] ); ?>[sitename]"
|
| 11 |
-
|
| 12 |
-
</div>
|
| 13 |
-
</div>
|
| 14 |
-
|
| 15 |
-
<div class="wds-table-fields">
|
| 16 |
-
<div class="label">
|
| 17 |
-
<label class="wds-label" for="schema_type"><?php esc_html_e( 'Type', 'wds' ); ?></label>
|
| 18 |
-
</div>
|
| 19 |
-
<div class="fields">
|
| 20 |
-
<div class="wds-conditional">
|
| 21 |
-
<select id="schema_type"
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
<option
|
| 25 |
-
<?php selected( $options['schema_type'], Smartcrawl_Schema_Printer::PERSON ); ?>
|
| 26 |
-
value="<?php echo esc_attr( Smartcrawl_Schema_Printer::PERSON ); ?>">
|
| 27 |
-
<?php esc_html_e( 'Person', 'wds' ); ?>
|
| 28 |
-
</option>
|
| 29 |
-
|
| 30 |
-
<option
|
| 31 |
-
<?php selected( $options['schema_type'], Smartcrawl_Schema_Printer::ORGANIZATION ); ?>
|
| 32 |
-
value="<?php echo esc_attr( Smartcrawl_Schema_Printer::ORGANIZATION ); ?>">
|
| 33 |
-
<?php esc_html_e( 'Organization', 'wds' ); ?>
|
| 34 |
-
</option>
|
| 35 |
-
</select>
|
| 36 |
-
|
| 37 |
-
<div
|
| 38 |
-
data-conditional-val="<?php echo esc_attr( Smartcrawl_Schema_Printer::PERSON ); ?>"
|
| 39 |
-
class="wds-table-fields wds-table-fields-stacked wds-conditional-inside wds-conditional-inside-box">
|
| 40 |
-
|
| 41 |
-
<div class="label">
|
| 42 |
-
<label for="override_name" class="wds-label"><?php esc_html_e( 'Your name', 'wds' ); ?></label>
|
| 43 |
-
</div>
|
| 44 |
-
<div class="fields">
|
| 45 |
-
<input id="override_name" type="text"
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
<div class="
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
</div>
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
</div>
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
</div>
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
</div>
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
</div>
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
</div>
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
</div>
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
</div>
|
| 163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$options = empty( $options ) ? $_view['options'] : $options;
|
| 3 |
+
?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-table-fields wds-separator-top">
|
| 6 |
+
<div class="label">
|
| 7 |
+
<label class="wds-label" for="website_name"><?php esc_html_e( 'Website name', 'wds' ); ?></label>
|
| 8 |
+
</div>
|
| 9 |
+
<div class="fields">
|
| 10 |
+
<input type="text" id="website_name" name="<?php echo esc_attr( $_view['option_name'] ); ?>[sitename]"
|
| 11 |
+
value="<?php echo esc_attr( $options['sitename'] ); ?>"/>
|
| 12 |
+
</div>
|
| 13 |
+
</div>
|
| 14 |
+
|
| 15 |
+
<div class="wds-table-fields">
|
| 16 |
+
<div class="label">
|
| 17 |
+
<label class="wds-label" for="schema_type"><?php esc_html_e( 'Type', 'wds' ); ?></label>
|
| 18 |
+
</div>
|
| 19 |
+
<div class="fields">
|
| 20 |
+
<div class="wds-conditional">
|
| 21 |
+
<select id="schema_type"
|
| 22 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[schema_type]"
|
| 23 |
+
class="select-container" style="width: 100%">
|
| 24 |
+
<option
|
| 25 |
+
<?php selected( $options['schema_type'], Smartcrawl_Schema_Printer::PERSON ); ?>
|
| 26 |
+
value="<?php echo esc_attr( Smartcrawl_Schema_Printer::PERSON ); ?>">
|
| 27 |
+
<?php esc_html_e( 'Person', 'wds' ); ?>
|
| 28 |
+
</option>
|
| 29 |
+
|
| 30 |
+
<option
|
| 31 |
+
<?php selected( $options['schema_type'], Smartcrawl_Schema_Printer::ORGANIZATION ); ?>
|
| 32 |
+
value="<?php echo esc_attr( Smartcrawl_Schema_Printer::ORGANIZATION ); ?>">
|
| 33 |
+
<?php esc_html_e( 'Organization', 'wds' ); ?>
|
| 34 |
+
</option>
|
| 35 |
+
</select>
|
| 36 |
+
|
| 37 |
+
<div
|
| 38 |
+
data-conditional-val="<?php echo esc_attr( Smartcrawl_Schema_Printer::PERSON ); ?>"
|
| 39 |
+
class="wds-table-fields wds-table-fields-stacked wds-conditional-inside wds-conditional-inside-box">
|
| 40 |
+
|
| 41 |
+
<div class="label">
|
| 42 |
+
<label for="override_name" class="wds-label"><?php esc_html_e( 'Your name', 'wds' ); ?></label>
|
| 43 |
+
</div>
|
| 44 |
+
<div class="fields">
|
| 45 |
+
<input id="override_name" type="text"
|
| 46 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[override_name]"
|
| 47 |
+
value="<?php echo esc_attr( $options['override_name'] ); ?>"/>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
|
| 51 |
+
<div
|
| 52 |
+
data-conditional-val="<?php echo esc_attr( Smartcrawl_Schema_Printer::ORGANIZATION ); ?>"
|
| 53 |
+
class="wds-table-fields wds-table-fields-stacked wds-conditional-inside wds-conditional-inside-box">
|
| 54 |
+
|
| 55 |
+
<div class="label">
|
| 56 |
+
<label for="organization_name"
|
| 57 |
+
class="wds-label"><?php esc_html_e( 'Organization Name', 'wds' ); ?></label>
|
| 58 |
+
</div>
|
| 59 |
+
<div class="fields">
|
| 60 |
+
<input id="organization_name" type="text"
|
| 61 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[organization_name]"
|
| 62 |
+
value="<?php echo esc_attr( $options['organization_name'] ); ?>"/>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<div class="label">
|
| 66 |
+
<label for="organization_logo"
|
| 67 |
+
class="wds-label"><?php esc_html_e( 'Organization Logo', 'wds' ); ?></label>
|
| 68 |
+
</div>
|
| 69 |
+
<div class="fields">
|
| 70 |
+
<?php
|
| 71 |
+
$this->_render( 'media-url-field', array(
|
| 72 |
+
'item' => 'organization_logo',
|
| 73 |
+
) );
|
| 74 |
+
?>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
|
| 81 |
+
<?php
|
| 82 |
+
$this->_render( 'toggle-group', array(
|
| 83 |
+
'label' => __( 'Schema markup', 'wds' ),
|
| 84 |
+
'items' => array(
|
| 85 |
+
'disable-schema' => array(
|
| 86 |
+
'label' => __( 'Enable schema markup output', 'wds' ),
|
| 87 |
+
'inverted' => true,
|
| 88 |
+
'description' => __( 'By default, the plugin will render appropriate schema markup to all your pages. You can disable this kind of output here.', 'wds' ),
|
| 89 |
+
),
|
| 90 |
+
),
|
| 91 |
+
'separator' => true,
|
| 92 |
+
) );
|
| 93 |
+
?>
|
| 94 |
+
|
| 95 |
+
<div class="wds-table-fields wds-separator-top">
|
| 96 |
+
<div class="label">
|
| 97 |
+
<label for="twitter_username" class="wds-label"><?php esc_html_e( 'Twitter Username', 'wds' ); ?></label>
|
| 98 |
+
</div>
|
| 99 |
+
<div class="fields wds-twitter-username">
|
| 100 |
+
<input type="text" id="twitter_username"
|
| 101 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[twitter_username]"
|
| 102 |
+
value="<?php echo esc_attr( $options['twitter_username'] ); ?>"
|
| 103 |
+
placeholder="<?php esc_attr_e( 'username', 'wds' ); ?>"/>
|
| 104 |
+
</div>
|
| 105 |
+
|
| 106 |
+
<div class="label">
|
| 107 |
+
<label for="fb-app-id" class="wds-label"><?php esc_html_e( 'Facebook App ID', 'wds' ); ?></label>
|
| 108 |
+
</div>
|
| 109 |
+
<div class="fields wds-fb-app-id">
|
| 110 |
+
<input type="text" id="fb-app-id" name="<?php echo esc_attr( $_view['option_name'] ); ?>[fb-app-id]"
|
| 111 |
+
value="<?php echo esc_attr( $options['fb-app-id'] ); ?>"
|
| 112 |
+
placeholder="<?php esc_attr_e( 'App ID', 'wds' ); ?>"/>
|
| 113 |
+
</div>
|
| 114 |
+
|
| 115 |
+
<div class="label">
|
| 116 |
+
<label for="facebook_url" class="wds-label"><?php esc_html_e( 'Facebook Page Url', 'wds' ); ?></label>
|
| 117 |
+
</div>
|
| 118 |
+
<div class="fields">
|
| 119 |
+
<input type="text" id="facebook_url" name="<?php echo esc_attr( $_view['option_name'] ); ?>[facebook_url]"
|
| 120 |
+
value="<?php echo esc_attr( $options['facebook_url'] ); ?>"
|
| 121 |
+
placeholder="<?php esc_attr_e( 'https://facebook.com/pagename', 'wds' ); ?>"/>
|
| 122 |
+
</div>
|
| 123 |
+
|
| 124 |
+
<div class="label">
|
| 125 |
+
<label for="instagram_url" class="wds-label"><?php esc_html_e( 'Instagram URL', 'wds' ); ?></label>
|
| 126 |
+
</div>
|
| 127 |
+
<div class="fields">
|
| 128 |
+
<input type="text" id="instagram_url" name="<?php echo esc_attr( $_view['option_name'] ); ?>[instagram_url]"
|
| 129 |
+
value="<?php echo esc_attr( $options['instagram_url'] ); ?>"
|
| 130 |
+
placeholder="<?php esc_attr_e( 'https://instagram.com/username', 'wds' ); ?>"/>
|
| 131 |
+
</div>
|
| 132 |
+
|
| 133 |
+
<div class="label">
|
| 134 |
+
<label for="linkedin_url" class="wds-label"><?php esc_html_e( 'Linkedin URL', 'wds' ); ?></label>
|
| 135 |
+
</div>
|
| 136 |
+
<div class="fields">
|
| 137 |
+
<input type="text" id="linkedin_url" name="<?php echo esc_attr( $_view['option_name'] ); ?>[linkedin_url]"
|
| 138 |
+
value="<?php echo esc_attr( $options['linkedin_url'] ); ?>"
|
| 139 |
+
placeholder="<?php esc_attr_e( 'https://linkedin.com/username', 'wds' ); ?>"/>
|
| 140 |
+
</div>
|
| 141 |
+
|
| 142 |
+
<div class="label">
|
| 143 |
+
<label for="pinterest_url" class="wds-label"><?php esc_html_e( 'Pinterest URL', 'wds' ); ?></label>
|
| 144 |
+
</div>
|
| 145 |
+
<div class="fields">
|
| 146 |
+
<input type="text" id="pinterest_url" name="<?php echo esc_attr( $_view['option_name'] ); ?>[pinterest_url]"
|
| 147 |
+
value="<?php echo esc_attr( $options['pinterest_url'] ); ?>"
|
| 148 |
+
placeholder="<?php esc_attr_e( 'https://pinterest.com/username', 'wds' ); ?>"/>
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<div class="label">
|
| 152 |
+
<label for="gplus_url" class="wds-label"><?php esc_html_e( 'Google+ URL', 'wds' ); ?></label>
|
| 153 |
+
</div>
|
| 154 |
+
<div class="fields">
|
| 155 |
+
<input type="text" id="gplus_url" name="<?php echo esc_attr( $_view['option_name'] ); ?>[gplus_url]"
|
| 156 |
+
value="<?php echo esc_attr( $options['gplus_url'] ); ?>"
|
| 157 |
+
placeholder="<?php esc_attr_e( 'https://plus.google.com/u/1/123456789123456789123', 'wds' ); ?>"/>
|
| 158 |
+
</div>
|
| 159 |
+
|
| 160 |
+
<div class="label">
|
| 161 |
+
<label for="youtube_url" class="wds-label"><?php esc_html_e( 'Youtube URL', 'wds' ); ?></label>
|
| 162 |
+
</div>
|
| 163 |
+
<div class="fields">
|
| 164 |
+
<input type="text" id="youtube_url" name="<?php echo esc_attr( $_view['option_name'] ); ?>[youtube_url]"
|
| 165 |
+
value="<?php echo esc_attr( $options['youtube_url'] ); ?>"
|
| 166 |
+
placeholder="<?php esc_attr_e( 'https://www.youtube.com/user/username', 'wds' ); ?>"/>
|
| 167 |
+
</div>
|
| 168 |
+
</div>
|
includes/admin/templates/social/social-section-open-graph.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<div class="wds-separator-top">
|
| 2 |
-
<?php
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
?>
|
| 14 |
-
</div>
|
| 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>
|
includes/admin/templates/social/social-section-pinterest-verification.php
CHANGED
|
@@ -1,40 +1,40 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-table-fields">
|
| 6 |
-
<?php if ( isset( $options['pinterest-verification-status'] ) ) :
|
| 7 |
-
<?php if ( $options['pinterest-verification-status']
|
| 8 |
-
<div class="wds-notice wds-notice-error">
|
| 9 |
-
<p><?php esc_html_e( 'Verification failed', 'wds' ); ?></p>
|
| 10 |
-
</div>
|
| 11 |
-
<?php elseif ( $options['pinterest-verification-status']
|
| 12 |
-
<div class="wds-notice wds-notice-success">
|
| 13 |
-
<p><?php esc_html_e( 'Your domain verification tag has been added to the <head> of your website.', 'wds' ); ?></p>
|
| 14 |
-
</div>
|
| 15 |
-
<?php endif; ?>
|
| 16 |
-
<?php endif; ?>
|
| 17 |
-
<div class="label">
|
| 18 |
-
<label for="pinterest-verify" class="wds-label"><?php esc_html_e( 'Pinterest Meta Tag', 'wds' ); ?></label>
|
| 19 |
-
<p class="wds-label-description"><?php
|
| 20 |
-
</div>
|
| 21 |
-
|
| 22 |
-
<div class="fields">
|
| 23 |
-
<textarea
|
| 24 |
-
id="pinterest-verify"
|
| 25 |
-
name="<?php echo esc_attr( $_view['option_name'] ); ?>[pinterest-verify]"
|
| 26 |
-
placeholder="<?php
|
| 27 |
-
<div class="wds-field-legend">
|
| 28 |
-
<?php if ( empty( $options['pinterest-verify'] ) ) :
|
| 29 |
-
<?php
|
| 30 |
-
<ul>
|
| 31 |
-
<li><?php
|
| 32 |
-
<li><?php
|
| 33 |
-
<li><?php
|
| 34 |
-
</ul>
|
| 35 |
-
<?php else : ?>
|
| 36 |
-
<?php
|
| 37 |
-
<?php endif; ?>
|
| 38 |
-
</div>
|
| 39 |
-
</div>
|
| 40 |
-
</div>
|
| 1 |
+
<?php
|
| 2 |
+
$options = empty( $options ) ? $_view['options'] : $options;
|
| 3 |
+
?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-table-fields">
|
| 6 |
+
<?php if ( isset( $options['pinterest-verification-status'] ) ) : ?>
|
| 7 |
+
<?php if ( 'fail' === $options['pinterest-verification-status'] ) : ?>
|
| 8 |
+
<div class="wds-notice wds-notice-error">
|
| 9 |
+
<p><?php esc_html_e( 'Verification failed', 'wds' ); ?></p>
|
| 10 |
+
</div>
|
| 11 |
+
<?php elseif ( '' === $options['pinterest-verification-status'] ) : ?>
|
| 12 |
+
<div class="wds-notice wds-notice-success">
|
| 13 |
+
<p><?php esc_html_e( 'Your domain verification tag has been added to the <head> of your website.', 'wds' ); ?></p>
|
| 14 |
+
</div>
|
| 15 |
+
<?php endif; ?>
|
| 16 |
+
<?php endif; ?>
|
| 17 |
+
<div class="label">
|
| 18 |
+
<label for="pinterest-verify" class="wds-label"><?php esc_html_e( 'Pinterest Meta Tag', 'wds' ); ?></label>
|
| 19 |
+
<p class="wds-label-description"><?php esc_html_e( 'This setting will add the meta tag to verify your website with Pinterest.', 'wds' ); ?></p>
|
| 20 |
+
</div>
|
| 21 |
+
|
| 22 |
+
<div class="fields">
|
| 23 |
+
<textarea
|
| 24 |
+
id="pinterest-verify"
|
| 25 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[pinterest-verify]"
|
| 26 |
+
placeholder="<?php esc_attr_e( 'Enter your Pinterest meta tag here', 'wds' ); ?>"><?php echo esc_textarea( $options['pinterest-verify'] ); ?></textarea>
|
| 27 |
+
<div class="wds-field-legend">
|
| 28 |
+
<?php if ( empty( $options['pinterest-verify'] ) ) : ?>
|
| 29 |
+
<?php esc_html_e( 'Instructions:', 'wds' ); ?>
|
| 30 |
+
<ul>
|
| 31 |
+
<li><?php esc_html_e( '1. Go to your Account Settings area.', 'wds' ); ?></li>
|
| 32 |
+
<li><?php esc_html_e( '2. Scroll to the Website field, add your website and click Confirm website.', 'wds' ); ?></li>
|
| 33 |
+
<li><?php esc_html_e( '3. Copy the meta tag', 'wds' ); ?></li>
|
| 34 |
+
</ul>
|
| 35 |
+
<?php else : ?>
|
| 36 |
+
<?php esc_html_e( 'To remove verification simply remove this meta tag.', 'wds' ); ?>
|
| 37 |
+
<?php endif; ?>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
includes/admin/templates/social/social-section-twitter-cards.php
CHANGED
|
@@ -1,67 +1,71 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
?>
|
| 4 |
-
|
| 5 |
-
<div class="wds-table-fields wds-separator-top">
|
| 6 |
-
<div class="label">
|
| 7 |
-
<label class="wds-label"><?php
|
| 8 |
-
<p class="wds-label-description"><?php
|
| 9 |
-
</div>
|
| 10 |
-
|
| 11 |
-
<?php $twitter_card_enabled = $options['twitter-card-enable']; ?>
|
| 12 |
-
<div class="fields wds-toggleable <?php echo $twitter_card_enabled ? '' : 'inactive'; ?>">
|
| 13 |
-
<div class="wds-toggle-table">
|
| 14 |
-
<span class="toggle wds-toggle">
|
| 15 |
-
<input
|
| 16 |
-
class="toggle-checkbox"
|
| 17 |
-
value="1"
|
| 18 |
-
id="twitter-card-enable"
|
| 19 |
-
name="<?php echo esc_attr( $_view['option_name'] ); ?>[twitter-card-enable]"
|
| 20 |
-
autocomplete="off"
|
| 21 |
-
type="checkbox"
|
| 22 |
-
<?php checked( $twitter_card_enabled ); ?>/>
|
| 23 |
-
<label class="toggle-label" for="twitter-card-enable"></label>
|
| 24 |
-
</span>
|
| 25 |
-
|
| 26 |
-
<div class="wds-toggle-description">
|
| 27 |
-
<label for="twitter-card-enable"
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
<
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
<?php
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
<?php
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$options = empty( $options ) ? $_view['options'] : $options;
|
| 3 |
+
?>
|
| 4 |
+
|
| 5 |
+
<div class="wds-table-fields wds-separator-top">
|
| 6 |
+
<div class="label">
|
| 7 |
+
<label class="wds-label"><?php esc_html_e( 'Twitter Cards', 'wds' ); ?></label>
|
| 8 |
+
<p class="wds-label-description"><?php esc_html_e( 'With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping to drive traffic to your website.', 'wds' ); ?></p>
|
| 9 |
+
</div>
|
| 10 |
+
|
| 11 |
+
<?php $twitter_card_enabled = $options['twitter-card-enable']; ?>
|
| 12 |
+
<div class="fields wds-toggleable <?php echo $twitter_card_enabled ? '' : 'inactive'; ?>">
|
| 13 |
+
<div class="wds-toggle-table">
|
| 14 |
+
<span class="toggle wds-toggle">
|
| 15 |
+
<input
|
| 16 |
+
class="toggle-checkbox"
|
| 17 |
+
value="1"
|
| 18 |
+
id="twitter-card-enable"
|
| 19 |
+
name="<?php echo esc_attr( $_view['option_name'] ); ?>[twitter-card-enable]"
|
| 20 |
+
autocomplete="off"
|
| 21 |
+
type="checkbox"
|
| 22 |
+
<?php checked( $twitter_card_enabled ); ?>/>
|
| 23 |
+
<label class="toggle-label" for="twitter-card-enable"></label>
|
| 24 |
+
</span>
|
| 25 |
+
|
| 26 |
+
<div class="wds-toggle-description">
|
| 27 |
+
<label for="twitter-card-enable"
|
| 28 |
+
class="wds-label"><?php esc_html_e( 'Enable Twitter Cards', 'wds' ); ?></label>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
|
| 32 |
+
<div class="wds-toggleable-inside wds-conditional">
|
| 33 |
+
<p></p>
|
| 34 |
+
<select name="<?php echo esc_attr( $_view['option_name'] ); ?>[twitter-card-type]"
|
| 35 |
+
id="twitter-card-type"
|
| 36 |
+
class="select-container" style="width: 100%">
|
| 37 |
+
<option
|
| 38 |
+
<?php selected( $options['twitter-card-type'], Smartcrawl_Twitter_Printer::CARD_SUMMARY ); ?>
|
| 39 |
+
value="<?php echo esc_attr( Smartcrawl_Twitter_Printer::CARD_SUMMARY ); ?>">
|
| 40 |
+
<?php esc_html_e( 'Summary Card', 'wds' ); ?>
|
| 41 |
+
</option>
|
| 42 |
+
|
| 43 |
+
<option
|
| 44 |
+
<?php selected( $options['twitter-card-type'], Smartcrawl_Twitter_Printer::CARD_IMAGE ); ?>
|
| 45 |
+
value="<?php echo esc_attr( Smartcrawl_Twitter_Printer::CARD_IMAGE ); ?>">
|
| 46 |
+
<?php esc_html_e( 'Summary Card with Large Image', 'wds' ); ?>
|
| 47 |
+
</option>
|
| 48 |
+
</select>
|
| 49 |
+
|
| 50 |
+
<div class="wds-conditional-inside"
|
| 51 |
+
data-conditional-val="<?php echo esc_attr( Smartcrawl_Twitter_Printer::CARD_SUMMARY ); ?>">
|
| 52 |
+
<?php
|
| 53 |
+
$this->_render( 'social/social-twitter-embed', array(
|
| 54 |
+
'tweet_url' => 'https://twitter.com/_HassanAkhtar/status/875530001294270464',
|
| 55 |
+
) );
|
| 56 |
+
?>
|
| 57 |
+
</div>
|
| 58 |
+
<div class="wds-conditional-inside"
|
| 59 |
+
data-conditional-val="<?php echo esc_attr( Smartcrawl_Twitter_Printer::CARD_IMAGE ); ?>">
|
| 60 |
+
<?php
|
| 61 |
+
$this->_render( 'social/social-twitter-embed', array(
|
| 62 |
+
'tweet_url' => 'https://twitter.com/Twitter/status/593828669740584960',
|
| 63 |
+
'large' => true,
|
| 64 |
+
) );
|
| 65 |
+
?>
|
| 66 |
+
</div>
|
| 67 |
+
<p class="wds-field-legend"><?php esc_html_e( 'A preview of how your Homepage will appear as a Twitter Card.', 'wds' ); ?></p>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
includes/admin/templates/social/social-settings.php
CHANGED
|
@@ -1,81 +1,89 @@
|
|
| 1 |
-
<div id="container" class="wrap wrap-wds wds-page wds-page-autolinks">
|
| 2 |
-
|
| 3 |
-
<section id="header">
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div id="container" class="wrap wrap-wds wds-page wds-page-autolinks">
|
| 2 |
+
|
| 3 |
+
<section id="header">
|
| 4 |
+
<div class="actions">
|
| 5 |
+
<a target="_blank" class="button button-small button-light actions-button"
|
| 6 |
+
href="https://premium.wpmudev.org/docs/wpmu-dev-plugins/smartcrawl/#chapter-3">
|
| 7 |
+
<i class="wds-icon-academy"></i>
|
| 8 |
+
<?php esc_html_e( 'View Documentation', 'wds' ); ?>
|
| 9 |
+
</a>
|
| 10 |
+
</div>
|
| 11 |
+
|
| 12 |
+
<?php $this->_render( 'settings-message-top' ); ?>
|
| 13 |
+
<h1><?php esc_html_e( 'Social', 'wds' ); ?></h1>
|
| 14 |
+
</section><!-- end header -->
|
| 15 |
+
|
| 16 |
+
<form action='<?php echo esc_attr( $_view['action_url'] ); ?>' method='post' class="wds-form">
|
| 17 |
+
<?php settings_fields( $_view['option_name'] ); ?>
|
| 18 |
+
|
| 19 |
+
<div class="vertical-tabs">
|
| 20 |
+
<?php
|
| 21 |
+
$this->_render( 'vertical-tab', array(
|
| 22 |
+
'tab_id' => 'tab_accounts',
|
| 23 |
+
'tab_name' => __( 'Accounts', 'wds' ),
|
| 24 |
+
'is_active' => 'tab_accounts' === $active_tab,
|
| 25 |
+
'tab_sections' => array(
|
| 26 |
+
array(
|
| 27 |
+
'section_description' => __( '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' ),
|
| 28 |
+
'section_template' => 'social/social-section-accounts',
|
| 29 |
+
'section_args' => array(
|
| 30 |
+
'options' => $options,
|
| 31 |
+
),
|
| 32 |
+
),
|
| 33 |
+
),
|
| 34 |
+
) );
|
| 35 |
+
?>
|
| 36 |
+
|
| 37 |
+
<?php
|
| 38 |
+
$this->_render( 'vertical-tab', array(
|
| 39 |
+
'tab_id' => 'tab_open_graph',
|
| 40 |
+
'tab_name' => __( 'OpenGraph', 'wds' ),
|
| 41 |
+
'is_active' => 'tab_open_graph' === $active_tab,
|
| 42 |
+
'tab_sections' => array(
|
| 43 |
+
array(
|
| 44 |
+
'section_description' => __( 'Add meta data to your pages to make them look great when shared platforms such as Facebook and other popular social networks.', 'wds' ),
|
| 45 |
+
'section_template' => 'social/social-section-open-graph',
|
| 46 |
+
'section_args' => array(
|
| 47 |
+
'options' => $options,
|
| 48 |
+
),
|
| 49 |
+
),
|
| 50 |
+
),
|
| 51 |
+
) );
|
| 52 |
+
?>
|
| 53 |
+
|
| 54 |
+
<?php
|
| 55 |
+
$this->_render( 'vertical-tab', array(
|
| 56 |
+
'tab_id' => 'tab_twitter_cards',
|
| 57 |
+
'tab_name' => __( 'Twitter Cards', 'wds' ),
|
| 58 |
+
'is_active' => 'tab_twitter_cards' === $active_tab,
|
| 59 |
+
'tab_sections' => array(
|
| 60 |
+
array(
|
| 61 |
+
'section_description' => __( 'Add meta data to your pages to make them look great when shared on Twitter.', 'wds' ),
|
| 62 |
+
'section_template' => 'social/social-section-twitter-cards',
|
| 63 |
+
'section_args' => array(
|
| 64 |
+
'options' => $options,
|
| 65 |
+
),
|
| 66 |
+
),
|
| 67 |
+
),
|
| 68 |
+
) );
|
| 69 |
+
?>
|
| 70 |
+
|
| 71 |
+
<?php
|
| 72 |
+
$this->_render( 'vertical-tab', array(
|
| 73 |
+
'tab_id' => 'tab_pinterest_verification',
|
| 74 |
+
'tab_name' => __( 'Pinterest Verification', 'wds' ),
|
| 75 |
+
'is_active' => 'tab_pinterest_verification' === $active_tab,
|
| 76 |
+
'tab_sections' => array(
|
| 77 |
+
array(
|
| 78 |
+
'section_description' => __( 'Verify your website with Pinterest to attribute your website when your website content is pinned to the platform.', 'wds' ),
|
| 79 |
+
'section_template' => 'social/social-section-pinterest-verification',
|
| 80 |
+
'section_args' => array(
|
| 81 |
+
'options' => $options,
|
| 82 |
+
),
|
| 83 |
+
),
|
| 84 |
+
),
|
| 85 |
+
) );
|
| 86 |
+
?>
|
| 87 |
+
</div>
|
| 88 |
+
</form>
|
| 89 |
+
</div>
|
includes/admin/templates/social/social-twitter-embed.php
CHANGED
|
@@ -1,23 +1,27 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 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;
|
| 11 |
+
}
|
| 12 |
+
?>
|
| 13 |
+
<?php if ( $embed_query->have_posts() ) : ?>
|
| 14 |
+
<div class="wds-twitter-embed <?php echo $large ? 'wds-twitter-embed-large' : ''; ?>">
|
| 15 |
+
<?php while ( $embed_query->have_posts() ) : ?>
|
| 16 |
+
<?php
|
| 17 |
+
$embed_query->the_post();
|
| 18 |
+
global $wp_embed;
|
| 19 |
+
/**
|
| 20 |
+
* @var WP_Embed $wp_embed
|
| 21 |
+
*/
|
| 22 |
+
echo wp_kses_post( $wp_embed->autoembed( $tweet_url ) );
|
| 23 |
+
?>
|
| 24 |
+
<?php endwhile; ?>
|
| 25 |
+
<?php wp_reset_postdata(); ?>
|
| 26 |
+
</div>
|
| 27 |
+
<?php endif; ?>
|
includes/admin/templates/taxonomy-form-row.php
CHANGED
|
@@ -1,24 +1,30 @@
|
|
| 1 |
-
|
| 2 |
-
<
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<tr class="form-field">
|
| 2 |
+
<th scope="row" valign="top">
|
| 3 |
+
<label for="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $label ); ?>:</label>
|
| 4 |
+
</th>
|
| 5 |
+
<td>
|
| 6 |
+
<?php
|
| 7 |
+
|
| 8 |
+
if ( 'text' === $type ) {
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
<input name="<?php echo esc_attr( $id ); ?>"
|
| 12 |
+
id="<?php echo esc_attr( $id ); ?>" type="text"
|
| 13 |
+
value="<?php echo isset( $val ) ? esc_attr( $val ) : ''; ?>"
|
| 14 |
+
size="40"/>
|
| 15 |
+
<p class="description"><?php echo esc_html( $desc ); ?></p>
|
| 16 |
+
<?php
|
| 17 |
+
|
| 18 |
+
} elseif ( 'checkbox' === $type ) {
|
| 19 |
+
|
| 20 |
+
?>
|
| 21 |
+
<input name="<?php echo esc_attr( $id ); ?>"
|
| 22 |
+
id="<?php echo esc_attr( $id ); ?>"
|
| 23 |
+
type="checkbox" <?php checked( $val ); ?>
|
| 24 |
+
style="width:5%;"/>
|
| 25 |
+
<?php
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
?>
|
| 29 |
+
</td>
|
| 30 |
+
</tr>
|
includes/admin/templates/term-additions-form.php
CHANGED
|
@@ -1,206 +1,222 @@
|
|
| 1 |
-
|
| 2 |
-
<
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
$this->form_row( '
|
| 8 |
-
$this->form_row( '
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
if ( !
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
'
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
<
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
</a>
|
| 186 |
-
</div>
|
| 187 |
-
<?php if (!empty($twitter['images']) && is_array($twitter['images'])) : ?>
|
| 188 |
-
<?php foreach ($twitter['images'] as $twitter_image) : ?>
|
| 189 |
-
<input type="text" class="widefat"
|
| 190 |
-
name="wds-twitter[images][]"
|
| 191 |
-
value="<?php echo esc_attr($twitter_image); ?>"/>
|
| 192 |
-
<?php endforeach; ?>
|
| 193 |
-
<?php endif; ?>
|
| 194 |
-
</div>
|
| 195 |
-
</div>
|
| 196 |
-
|
| 197 |
-
<p class="wds-label-description"><?php esc_html_e( 'This image will be available to use as the featured image when the term page is shared.', 'wds' ); ?></p>
|
| 198 |
-
</div>
|
| 199 |
-
</div> <!-- fields -->
|
| 200 |
-
</div> <!-- wds-table-fields -->
|
| 201 |
-
</div>
|
| 202 |
-
</td>
|
| 203 |
-
</tr>
|
| 204 |
-
<?php } ?>
|
| 205 |
-
|
| 206 |
-
</table>
|
| 1 |
+
<h2><?php esc_html_e( 'SmartCrawl Settings ', 'wds' ); ?></h2>
|
| 2 |
+
<table class="form-table">
|
| 3 |
+
|
| 4 |
+
<?php
|
| 5 |
+
|
| 6 |
+
$this->form_row( 'wds_title', __( 'SEO Title', 'wds' ), __( 'The SEO title is used on the archive page for this term.', 'wds' ), $tax_meta );
|
| 7 |
+
$this->form_row( 'wds_desc', __( 'SEO Description', 'wds' ), __( 'The SEO description is used for the meta description on the archive page for this term.', 'wds' ), $tax_meta );
|
| 8 |
+
$this->form_row( 'wds_canonical', __( 'Canonical', 'wds' ), __( 'The canonical link is shown on the archive page for this term.', 'wds' ), $tax_meta );
|
| 9 |
+
|
| 10 |
+
if ( $global_noindex ) {
|
| 11 |
+
$this->form_row( 'wds_override_noindex', sprintf( __( 'Index this %s', 'wds' ), strtolower( $taxonomy_labels->singular_name ) ), '', $tax_meta, 'checkbox' );
|
| 12 |
+
} else {
|
| 13 |
+
$this->form_row( 'wds_noindex', sprintf( __( 'Noindex this %s', 'wds' ), strtolower( $taxonomy_labels->singular_name ) ), '', $tax_meta, 'checkbox' );
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
if ( $global_nofollow ) {
|
| 17 |
+
$this->form_row( 'wds_override_nofollow', sprintf( __( 'Follow this %s', 'wds' ), strtolower( $taxonomy_labels->singular_name ) ), '', $tax_meta, 'checkbox' );
|
| 18 |
+
} else {
|
| 19 |
+
$this->form_row( 'wds_nofollow', sprintf( __( 'Nofollow this %s', 'wds' ), strtolower( $taxonomy_labels->singular_name ) ), '', $tax_meta, 'checkbox' );
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
?>
|
| 23 |
+
|
| 24 |
+
<?php
|
| 25 |
+
$options = Smartcrawl_Settings::get_options();
|
| 26 |
+
?>
|
| 27 |
+
|
| 28 |
+
<?php if ( ! empty( $options['og-enable'] ) ) { ?>
|
| 29 |
+
<tr class="form-field">
|
| 30 |
+
<th scope="row" valign="top"><label for=""><?php esc_html_e( 'OpenGraph', 'wds' ); ?></label></th>
|
| 31 |
+
<td>
|
| 32 |
+
<div class="wpmud">
|
| 33 |
+
<?php
|
| 34 |
+
$og = ! empty( $tax_meta['opengraph'] ) ? $tax_meta['opengraph'] : false;
|
| 35 |
+
if ( ! is_array( $og ) ) {
|
| 36 |
+
$og = array();
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
$og = wp_parse_args( $og, array(
|
| 40 |
+
'title' => false,
|
| 41 |
+
'description' => false,
|
| 42 |
+
'images' => false,
|
| 43 |
+
'disabled' => false,
|
| 44 |
+
) );
|
| 45 |
+
|
| 46 |
+
$ogp = Smartcrawl_OpenGraph_Printer::get();
|
| 47 |
+
|
| 48 |
+
$default_title = $ogp->get_generic_og_tag_value( 'og-title', $taxonomy );
|
| 49 |
+
$default_title = ! empty( $default_title ) ? $default_title : $term->name;
|
| 50 |
+
|
| 51 |
+
$default_metadesc = $ogp->get_generic_og_tag_value( 'og-description', $taxonomy );
|
| 52 |
+
$default_metadesc = ! empty( $default_metadesc ) ? $default_metadesc : $term->name;
|
| 53 |
+
|
| 54 |
+
$og_meta_disabled = (bool) smartcrawl_get_array_value( $og, 'disabled' );
|
| 55 |
+
?>
|
| 56 |
+
<div class="wds-table-fields">
|
| 57 |
+
<div class="fields">
|
| 58 |
+
<div class="wds-toggleable inverted <?php echo $og_meta_disabled ? 'inactive' : ''; ?>">
|
| 59 |
+
<?php
|
| 60 |
+
$this->_render( 'toggle-item', array(
|
| 61 |
+
'inverted' => true,
|
| 62 |
+
'field_name' => 'wds-opengraph[disabled]',
|
| 63 |
+
'field_id' => 'wds-opengraph-disabled',
|
| 64 |
+
'checked' => checked( $og_meta_disabled, true, false ),
|
| 65 |
+
'item_label' => esc_html__( 'Enable OpenGraph for this term', 'wds' ),
|
| 66 |
+
) );
|
| 67 |
+
?>
|
| 68 |
+
<div
|
| 69 |
+
class="wds-toggleable-inside wds-toggleable-inside-box wds-table-fields-group wds-opengraph-meta">
|
| 70 |
+
|
| 71 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 72 |
+
<div class="label">
|
| 73 |
+
<label for="og-title"
|
| 74 |
+
class="wds-label"><?php esc_html_e( 'Title', 'wds' ); ?></label>
|
| 75 |
+
</div>
|
| 76 |
+
<div class="fields">
|
| 77 |
+
<input type="text"
|
| 78 |
+
id="og-title"
|
| 79 |
+
name="wds-opengraph[title]"
|
| 80 |
+
placeholder="<?php echo $og['title'] ? '' : esc_attr( smartcrawl_replace_vars( $default_title, (array) $term ) ); ?>"
|
| 81 |
+
value="<?php echo esc_attr( $og['title'] ); ?>"/>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 86 |
+
<div class="label">
|
| 87 |
+
<label for="og-description"
|
| 88 |
+
class="wds-label"><?php esc_html_e( 'Description', 'wds' ); ?></label>
|
| 89 |
+
</div>
|
| 90 |
+
<div class="fields">
|
| 91 |
+
<textarea name="wds-opengraph[description]"
|
| 92 |
+
placeholder="<?php echo $og['description'] ? '' : esc_attr( smartcrawl_replace_vars( $default_metadesc, (array) $term ) ); ?>"
|
| 93 |
+
id="og-description"><?php echo esc_textarea( $og['description'] ); ?></textarea>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
|
| 97 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 98 |
+
<div class="label">
|
| 99 |
+
<label for="og-images"
|
| 100 |
+
class="wds-label"><?php esc_html_e( 'Featured Images', 'wds' ); ?></label>
|
| 101 |
+
</div>
|
| 102 |
+
<div class="fields og-images"
|
| 103 |
+
data-name="wds-opengraph[images]">
|
| 104 |
+
<div class="add-action-wrapper item">
|
| 105 |
+
<a id="wds-opengraph-images" href="#add" title="<?php esc_attr_e( 'Add image', 'wds' ); ?>">
|
| 106 |
+
<i class="wds-icon-plus"></i>
|
| 107 |
+
</a>
|
| 108 |
+
</div>
|
| 109 |
+
<?php if ( ! empty( $og['images'] ) && is_array( $og['images'] ) ) : ?>
|
| 110 |
+
<?php foreach ( $og['images'] as $img ) : ?>
|
| 111 |
+
<input type="text" class="widefat"
|
| 112 |
+
name="wds-opengraph[images][]"
|
| 113 |
+
value="<?php echo esc_attr( $img ); ?>"/>
|
| 114 |
+
<?php endforeach; ?>
|
| 115 |
+
<?php endif; ?>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
|
| 119 |
+
<p class="wds-label-description"><?php esc_html_e( 'Each of these images will be available to use as the featured image when the term page is shared.', 'wds' ); ?></p>
|
| 120 |
+
</div>
|
| 121 |
+
</div>
|
| 122 |
+
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
</td>
|
| 127 |
+
<tr>
|
| 128 |
+
<?php } ?>
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
<?php if ( ! empty( $options['twitter-card-enable'] ) ) { ?>
|
| 132 |
+
<tr class="form-field">
|
| 133 |
+
<th scope="row" valign="top"><label for=""><?php esc_html_e( 'Twitter', 'wds' ); ?></label></th>
|
| 134 |
+
<td>
|
| 135 |
+
<div class="wpmud">
|
| 136 |
+
<?php
|
| 137 |
+
$twitter = ! empty( $tax_meta['twitter'] ) ? $tax_meta['twitter'] : false;
|
| 138 |
+
if ( ! is_array( $twitter ) ) {
|
| 139 |
+
$twitter = array();
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
$twitter = wp_parse_args( $twitter, array(
|
| 143 |
+
'title' => false,
|
| 144 |
+
'description' => false,
|
| 145 |
+
'disabled' => false,
|
| 146 |
+
) );
|
| 147 |
+
|
| 148 |
+
$twitter_meta_disabled = (bool) smartcrawl_get_array_value( $twitter, 'disabled' );
|
| 149 |
+
?>
|
| 150 |
+
<div class="wds-table-fields">
|
| 151 |
+
<div class="fields">
|
| 152 |
+
<div class="wds-toggleable inverted <?php echo $twitter_meta_disabled ? 'inactive' : ''; ?>">
|
| 153 |
+
<?php
|
| 154 |
+
$this->_render( 'toggle-item', array(
|
| 155 |
+
'inverted' => true,
|
| 156 |
+
'field_name' => 'wds-twitter[disabled]',
|
| 157 |
+
'field_id' => 'wds-twitter-disabled',
|
| 158 |
+
'checked' => checked( $twitter_meta_disabled, true, false ),
|
| 159 |
+
'item_label' => esc_html__( 'Enable Twitter Cards for this term', 'wds' ),
|
| 160 |
+
) );
|
| 161 |
+
?>
|
| 162 |
+
<div
|
| 163 |
+
class="wds-toggleable-inside wds-toggleable-inside-box wds-table-fields-group wds-twitter-meta">
|
| 164 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 165 |
+
<div class="label">
|
| 166 |
+
<label for="twitter-title"
|
| 167 |
+
class="wds-label"><?php esc_html_e( 'Title', 'wds' ); ?></label>
|
| 168 |
+
</div>
|
| 169 |
+
<div class="fields">
|
| 170 |
+
<input type="text"
|
| 171 |
+
id="twitter-title"
|
| 172 |
+
name="wds-twitter[title]"
|
| 173 |
+
placeholder="<?php echo $twitter['title'] ? '' : esc_attr( smartcrawl_replace_vars( $term->name ) ); ?>"
|
| 174 |
+
value="<?php echo esc_attr( $twitter['title'] ); ?>"/>
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<div class="wds-table-fields wds-table-fields-stacked">
|
| 179 |
+
<div class="label">
|
| 180 |
+
<label for="twitter-description"
|
| 181 |
+
class="wds-label"><?php esc_html_e( 'Description', 'wds' ); ?></label>
|
| 182 |
+
</div>
|
| 183 |
+
<div class="fields">
|
| 184 |
+
<textarea name="wds-twitter[descript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
