PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.7.1
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.7.1
2.7.1 2.7.2 2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 All 141 releases
← All changes | includes/class-metasync-settings-fields.php +59 -61 2.7.0 → 2.7.1 View file →
@@ -180,9 +180,8 @@
180 180 'fields' => array(
181 181 'permalink_structure',
182 182 'hide_dashboard_framework',
183 183 'show_admin_bar_status',
184 - 'enable_auto_updates',
185 184 'import_external_data'
186 185 )
187 186 )
188 187 );
@@ -304,9 +303,9 @@
304 303 $content_state = $is_open ? 'open' : 'closed';
305 304
306 305 echo '<div class="metasync-accordion-section" data-section="' . esc_attr($section_key) . '">';
307 306
308 - echo '<div class="metasync-accordion-header" role="button" tabindex="0" aria-expanded="' . $aria_expanded . '" aria-controls="' . $section_id . '">';
307 + echo '<div class="metasync-accordion-header" role="button" tabindex="0" aria-expanded="' . esc_attr($aria_expanded) . '" aria-controls="' . esc_attr($section_id) . '">';
309 308 echo '<div class="metasync-accordion-title">';
310 309 echo '<span class="metasync-accordion-icon"><span class="dashicons dashicons-' . esc_attr($section_data['icon']) . '"></span></span>';
311 310 echo '<div class="metasync-accordion-text">';
312 311 echo '<h3>' . esc_html($section_data['title']) . '</h3>';
@@ -317,9 +316,9 @@
317 316 echo '<span class="toggle-icon">▼</span>';
318 317 echo '</button>';
319 318 echo '</div>';
320 319
321 - echo '<div class="metasync-accordion-content" id="' . $section_id . '" data-state="' . $content_state . '">';
320 + echo '<div class="metasync-accordion-content" id="' . esc_attr($section_id) . '" data-state="' . esc_attr($content_state) . '">';
322 321
323 322 if (isset($section_data['render_callback']) && is_callable($section_data['render_callback'])) {
324 323 call_user_func($section_data['render_callback']);
325 324 }
@@ -413,9 +412,9 @@
413 412 if (!function_exists('google_index_direct')) {
414 413 if (file_exists(plugin_dir_path(dirname(__FILE__)) . 'google-index/google-index-init.php')) {
415 414 require_once plugin_dir_path(dirname(__FILE__)) . 'google-index/google-index-init.php';
416 415 } else {
417 - error_log('MetaSync Google Index: google-index-init.php not found at ' . plugin_dir_path(dirname(__FILE__)) . 'google-index/google-index-init.php');
416 + error_log('MetaSync Google Index: google-index-init.php not found at ' . plugin_dir_path(dirname(__FILE__)) . 'google-index/google-index-init.php'); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
418 417 return;
419 418 }
420 419 }
421 420
@@ -703,9 +702,9 @@
703 702 <p style="color: var(--dashboard-text-secondary); margin: 0 0 20px 0;">
704 703 Select which user roles can see and access this plugin's menu, settings, and options in the WordPress admin area.
705 704 </p>
706 705
707 - <form method="post" action="<?php echo admin_url('admin.php?page=' . Metasync_Admin::$page_slug . '&tab=advanced'); ?>" id="plugin-access-roles-form">
706 + <form method="post" action="<?php echo esc_url(admin_url('admin.php?page=' . Metasync_Admin::$page_slug . '&tab=advanced')); ?>" id="plugin-access-roles-form">
708 707 <?php wp_nonce_field('metasync_plugin_access_roles_nonce', 'plugin_access_roles_nonce'); ?>
709 708 <input type="hidden" name="save_plugin_access_roles" value="yes" />
710 709
711 710 <div class="metasync-role-selector-container" style="background: var(--dashboard-card-bg-alt, rgba(255,255,255,0.05)); border: 1px solid var(--dashboard-border); border-radius: 8px; padding: 16px; max-height: 300px; overflow-y: auto;">
@@ -823,9 +822,9 @@
823 822
824 823 public function can_change_memory_limit() {
825 824 $current_limit = ini_get('memory_limit');
826 825
827 - $test_result = @ini_set('memory_limit', $current_limit);
826 + $test_result = @ini_set('memory_limit', $current_limit); // phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged -- runtime PHP setting with no WordPress API
828 827
829 828 return $test_result !== false;
830 829 }
831 830
@@ -877,9 +876,9 @@
877 876 }
878 877
879 878 $memory_limit_mb = $this->get_execution_setting('max_memory_limit');
880 879
881 - $result = @ini_set('memory_limit', $memory_limit_mb . 'M');
880 + $result = @ini_set('memory_limit', $memory_limit_mb . 'M'); // phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged -- runtime PHP setting with no WordPress API
882 881
883 882 return $result !== false;
884 883 }
885 884
@@ -1152,9 +1151,8 @@
1152 1151 'content_genius_sync_roles' => 'Select which WordPress user roles should be synchronized with Content Genius. This determines which users will have their profiles and permissions synced for content collaboration.',
1153 1152 'permalink_structure' => sprintf('Displays your current WordPress permalink structure. %s works best with pretty permalinks (not "Plain"). If you see a warning, visit Settings > Permalinks to change your structure.', $plugin_name),
1154 1153 'hide_dashboard_framework' => sprintf('Hide the main %s dashboard from the WordPress admin menu. This is useful if you want to reduce menu clutter but still keep the plugin active.', $plugin_name),
1155 1154 'show_admin_bar_status' => sprintf('Display the %s status indicator in the WordPress admin bar at the top of your screen. This provides quick visibility of plugin status and key metrics.', $plugin_name),
1156 - 'enable_auto_updates' => sprintf('Allow WordPress to automatically update the %s plugin when new versions are released. Recommended for security patches, but you may prefer manual updates for major versions.', $plugin_name),
1157 1155 'import_external_data' => sprintf('Import your existing SEO settings and metadata from other popular SEO plugins like Yoast, Rank Math, or All in One SEO. This makes migration to %s seamless without losing your SEO data.', $plugin_name),
1158 1156 'import_seo_metadata' => sprintf('Migrate your existing SEO titles and meta descriptions from Yoast, Rank Math, or All in One SEO. This one-click import preserves your search rankings by copying your optimized meta data to %s, even if the source plugin is deactivated.', $plugin_name),
1159 1157 'default_page_builder' => 'Choose how Content Genius stores synced articles. "Gutenberg" works with all themes and page builders. Selecting a specific builder converts content to that builder\'s widget format, which inherits the builder\'s global typography and layout styles.',
1160 1158 'og_image_dimensions' => 'Adds your share image\'s width, height, and file type to the Open Graph tags so Facebook, LinkedIn, and others render your preview instantly at the right size instead of guessing. Leave on unless another plugin already outputs these.',
@@ -1200,9 +1198,9 @@
1200 1198 $content_state = $is_open ? 'open' : 'closed';
1201 1199
1202 1200 echo '<div class="metasync-accordion-section" data-section="' . esc_attr($section_key) . '">';
1203 1201
1204 - echo '<div class="metasync-accordion-header" role="button" tabindex="0" aria-expanded="' . $aria_expanded . '" aria-controls="' . $section_id . '">';
1202 + echo '<div class="metasync-accordion-header" role="button" tabindex="0" aria-expanded="' . esc_attr($aria_expanded) . '" aria-controls="' . esc_attr($section_id) . '">';
1205 1203 echo '<div class="metasync-accordion-title">';
1206 1204 echo '<span class="metasync-accordion-icon"><span class="dashicons dashicons-' . esc_attr($section_data['icon']) . '"></span></span>';
1207 1205 echo '<div class="metasync-accordion-text">';
1208 1206 echo '<h3>' . esc_html($section_data['title']) . '</h3>';
@@ -1213,9 +1211,9 @@
1213 1211 echo '<span class="toggle-icon">▼</span>';
1214 1212 echo '</button>';
1215 1213 echo '</div>';
1216 1214
1217 - echo '<div class="metasync-accordion-content" id="' . $section_id . '" data-state="' . $content_state . '">';
1215 + echo '<div class="metasync-accordion-content" id="' . esc_attr($section_id) . '" data-state="' . esc_attr($content_state) . '">';
1218 1216
1219 1217 if (isset($section_data['render_callback']) && is_callable($section_data['render_callback'])) {
1220 1218 call_user_func($section_data['render_callback']);
1221 1219 } elseif (isset($section_data['fields']) && is_array($section_data['fields'])) {
@@ -1230,9 +1228,9 @@
1230 1228 echo '<tr>';
1231 1229 echo '<th scope="row">';
1232 1230 if (!empty($field['title'])) {
1233 1231 echo '<div class="metasync-field-label-wrapper">';
1234 - echo '<label for="' . esc_attr($field['id']) . '">' . $field['title'] . '</label>';
1232 + echo '<label for="' . esc_attr($field['id']) . '">' . esc_html($field['title']) . '</label>';
1235 1233
1236 1234 if (isset($tooltips[$field_id])) {
1237 1235 echo '<button type="button" class="metasync-tooltip-trigger" data-tooltip-id="' . esc_attr($field_id) . '" aria-label="More information">';
1238 1236 echo '<svg class="metasync-info-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">';
@@ -1287,9 +1285,9 @@
1287 1285 echo '<tr>';
1288 1286 echo '<th scope="row">';
1289 1287 if (!empty($field['title'])) {
1290 1288 echo '<div class="metasync-field-label-wrapper">';
1291 - echo '<label for="' . esc_attr($field['id']) . '">' . $field['title'] . '</label>';
1289 + echo '<label for="' . esc_attr($field['id']) . '">' . esc_html($field['title']) . '</label>';
1292 1290 if (isset($llms_tooltips[$field['id']])) {
1293 1291 Metasync::render_tooltip_icon($field['id'], $llms_tooltips[$field['id']]);
1294 1292 }
1295 1293 echo '</div>';
@@ -1343,32 +1341,32 @@
1343 1341 $display_value = $current_token;
1344 1342 $status_message = 'Plugin Auth Token is active and ready for authentication.';
1345 1343 $refresh_help = 'Click refresh to generate a new token and update the heartbeat API.';
1346 1344 } else {
1347 - $display_value = 'Auto-generated when connecting to ' . esc_html(Metasync::get_effective_plugin_name());
1348 - $status_message = 'Plugin Auth Token will be automatically generated when you click "Connect to ' . esc_html(Metasync::get_effective_plugin_name()) . '".';
1345 + $display_value = 'Auto-generated when connecting to ' . Metasync::get_effective_plugin_name();
1346 + $status_message = 'Plugin Auth Token will be automatically generated when you click "Connect to ' . Metasync::get_effective_plugin_name() . '".';
1349 1347 $refresh_help = 'You can also manually generate a token by clicking refresh.';
1350 1348 }
1351 1349
1352 1350 printf('<div class="metasync-auth-token-row">');
1353 1351 printf(
1354 - '<input type="text" id="apikey" name="' . Metasync_Admin::option_key . '[general][apikey]" value="%s" size="40" class="regular-text" readonly="readonly" />',
1352 + '<input type="text" id="apikey" name="' . esc_attr(Metasync_Admin::option_key) . '[general][apikey]" value="%s" size="40" class="regular-text" readonly="readonly" />',
1355 1353 esc_attr($display_value)
1356 1354 );
1357 1355 printf('<button type="button" id="refresh-plugin-auth-token" class="button button-secondary metasync-refresh-token-btn"><span class="dashicons dashicons-controls-repeat"></span> Refresh Token</button>');
1358 1356 printf('</div>');
1359 - printf('<p class="description">%s %s</p>', $status_message, $refresh_help);
1357 + printf('<p class="description">%s %s</p>', esc_html($status_message), esc_html($refresh_help));
1360 1358 }
1361 1359
1362 1360 public function linkgraph_token_callback()
1363 1361 {
1364 1362 printf(
1365 - '<input type="text" id="linkgraph_token" name="' . Metasync_Admin::option_key . '[general][linkgraph_token]" value="%s" size="25" readonly="readonly" />',
1363 + '<input type="text" id="linkgraph_token" name="' . esc_attr(Metasync_Admin::option_key) . '[general][linkgraph_token]" value="%s" size="25" readonly="readonly" />',
1366 1364 isset(Metasync::get_option('general')['linkgraph_token']) ? esc_attr(Metasync::get_option('general')['linkgraph_token']) : ''
1367 1365 );
1368 1366
1369 1367 printf(
1370 - '<input type="text" id="linkgraph_customer_id" name="' . Metasync_Admin::option_key . '[general][linkgraph_customer_id]" value="%s" size="25" readonly="readonly" />',
1368 + '<input type="text" id="linkgraph_customer_id" name="' . esc_attr(Metasync_Admin::option_key) . '[general][linkgraph_customer_id]" value="%s" size="25" readonly="readonly" />',
1371 1369 isset(Metasync::get_option('general')['linkgraph_customer_id']) ? esc_attr(Metasync::get_option('general')['linkgraph_customer_id']) : ''
1372 1370 );
1373 1371
1374 1372 ?>
@@ -1493,9 +1491,9 @@
1493 1491 printf('• The authentication window will open in a popup - please allow popups<br/>');
1494 1492 printf('• The process typically takes 15-30 seconds to complete<br/>');
1495 1493 printf('• Your API key will be stored securely and shown masked below<br/>');
1496 1494 printf('• If you encounter issues, try disabling ad blockers temporarily<br/>');
1497 - printf('• Contact <a href="mailto:%s">%s</a> if you need assistance', Metasync::SUPPORT_EMAIL, Metasync::SUPPORT_EMAIL);
1495 + printf('• Contact <a href="mailto:%s">%s</a> if you need assistance', esc_attr(Metasync::SUPPORT_EMAIL), esc_html(Metasync::SUPPORT_EMAIL));
1498 1496 printf('</div>');
1499 1497 printf('</details>');
1500 1498 printf('</div>');
1501 1499
@@ -1547,9 +1545,9 @@
1547 1545 $timestamp = @Metasync::get_option('general')['send_auth_token_timestamp'];
1548 1546 printf(
1549 1547 '<p id="sendAuthTokenTimestamp" class="descriptionValue">%s (%s)</p>',
1550 1548 esc_attr($timestamp),
1551 - $this->time_elapsed_string($timestamp)
1549 + esc_html($this->time_elapsed_string($timestamp))
1552 1550 );
1553 1551
1554 1552
1555 1553 }
@@ -1557,9 +1555,9 @@
1557 1555
1558 1556 public function bing_site_verification_callback()
1559 1557 {
1560 1558 printf(
1561 - '<input type="text" id="bing_site_verification" name="' . Metasync_Admin::option_key . '[searchengines][bing_site_verification]" value="%s" size="50" />',
1559 + '<input type="text" id="bing_site_verification" name="' . esc_attr(Metasync_Admin::option_key) . '[searchengines][bing_site_verification]" value="%s" size="50" />',
1562 1560 isset(Metasync::get_option('searchengines')['bing_site_verification']) ? esc_attr(Metasync::get_option('searchengines')['bing_site_verification']) : ''
1563 1561 );
1564 1562
1565 1563 printf(' <br> <span class="description"> Enter Bing Webmaster Tools verification code: </span> ');
@@ -1568,9 +1566,9 @@
1568 1566
1569 1567 public function yandex_site_verification_callback()
1570 1568 {
1571 1569 printf(
1572 - '<input type="text" id="yandex_site_verification" name="' . Metasync_Admin::option_key . '[searchengines][yandex_site_verification]" value="%s" size="50" />',
1570 + '<input type="text" id="yandex_site_verification" name="' . esc_attr(Metasync_Admin::option_key) . '[searchengines][yandex_site_verification]" value="%s" size="50" />',
1573 1571 isset(Metasync::get_option('searchengines')['yandex_site_verification']) ? esc_attr(Metasync::get_option('searchengines')['yandex_site_verification']) : ''
1574 1572 );
1575 1573
1576 1574 printf(' <br> <span class="description"> Enter Yandex verification code: </span>');
@@ -1579,9 +1577,9 @@
1579 1577
1580 1578 public function google_site_verification_callback()
1581 1579 {
1582 1580 printf(
1583 - '<input type="text" id="google_site_verification" name="' . Metasync_Admin::option_key . '[searchengines][google_site_verification]" value="%s" size="50" />',
1581 + '<input type="text" id="google_site_verification" name="' . esc_attr(Metasync_Admin::option_key) . '[searchengines][google_site_verification]" value="%s" size="50" />',
1584 1582 isset(Metasync::get_option('searchengines')['google_site_verification']) ? esc_attr(Metasync::get_option('searchengines')['google_site_verification']) : ''
1585 1583 );
1586 1584
1587 1585 printf(' <br> <span class="description"> Enter Google Search Console verification code: </span>');
@@ -1590,9 +1588,9 @@
1590 1588
1591 1589 public function pinterest_site_verification_callback()
1592 1590 {
1593 1591 printf(
1594 - '<input type="text" id="pinterest_site_verification" name="' . Metasync_Admin::option_key . '[searchengines][pinterest_site_verification]" value="%s" size="50" />',
1592 + '<input type="text" id="pinterest_site_verification" name="' . esc_attr(Metasync_Admin::option_key) . '[searchengines][pinterest_site_verification]" value="%s" size="50" />',
1595 1593 isset(Metasync::get_option('searchengines')['pinterest_site_verification']) ? esc_attr(Metasync::get_option('searchengines')['pinterest_site_verification']) : ''
1596 1594 );
1597 1595
1598 1596 printf(' <br> <span class="description"> Enter Pinterest verification code: </span>');
@@ -1621,10 +1619,10 @@
1621 1619
1622 1620 public function local_seo_name_callback()
1623 1621 {
1624 1622 printf(
1625 - '<input type="text" id="local_seo_name" name="' . Metasync_Admin::option_key . '[localseo][local_seo_name]" value="%s" size="50" />',
1626 - isset(Metasync::get_option('localseo')['local_seo_name']) ? esc_attr(Metasync::get_option('localseo')['local_seo_name']) : get_bloginfo()
1623 + '<input type="text" id="local_seo_name" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][local_seo_name]" value="%s" size="50" />',
1624 + isset(Metasync::get_option('localseo')['local_seo_name']) ? esc_attr(Metasync::get_option('localseo')['local_seo_name']) : esc_attr(get_bloginfo())
1627 1625 );
1628 1626
1629 1627 printf(' <br> <span class="description"> Your name or company name </span>');
1630 1628 }
@@ -1640,9 +1638,9 @@
1640 1638 // would otherwise survive every subsequent Save Settings.
1641 1639 $local_seo_logo = metasync_repair_scheme_prefixed_media_id($local_seo_logo);
1642 1640
1643 1641 printf(
1644 - '<input type="hidden" id="local_seo_logo" name="' . Metasync_Admin::option_key . '[localseo][local_seo_logo]" value="%s" size="50" />',
1642 + '<input type="hidden" id="local_seo_logo" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][local_seo_logo]" value="%s" size="50" />',
1645 1643 esc_attr((string) $local_seo_logo)
1646 1644 );
1647 1645
1648 1646 printf(' <br> <input class="button-secondary no-loading" type="button" id="logo_upload_button" value="Add or Upload File">');
@@ -1664,9 +1662,9 @@
1664 1662 $logo_url ? '' : ' style="display:none"'
1665 1663 );
1666 1664
1667 1665 $button_type = $logo_url ? 'button' : 'hidden';
1668 - printf('<input type="%s" class="button-secondary no-loading metasync-logo-remove-btn" id="local_seo_logo_close_btn" value="X">', $button_type);
1666 + printf('<input type="%s" class="button-secondary no-loading metasync-logo-remove-btn" id="local_seo_logo_close_btn" value="X">', esc_attr($button_type));
1669 1667 printf('</span>');
1670 1668 }
1671 1669
1672 1670 /**
@@ -1704,10 +1702,10 @@
1704 1702
1705 1703 public function local_seo_url_callback()
1706 1704 {
1707 1705 printf(
1708 - '<input type="text" id="local_seo_url" name="' . Metasync_Admin::option_key . '[localseo][local_seo_url]" value="%s" size="50" />',
1709 - isset(Metasync::get_option('localseo')['local_seo_url']) ? esc_attr(Metasync::get_option('localseo')['local_seo_url']) : home_url()
1706 + '<input type="text" id="local_seo_url" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][local_seo_url]" value="%s" size="50" />',
1707 + isset(Metasync::get_option('localseo')['local_seo_url']) ? esc_attr(Metasync::get_option('localseo')['local_seo_url']) : esc_attr(home_url())
1710 1708 );
1711 1709
1712 1710 printf(' <br> <span class="description"> URL of the item. </span>');
1713 1711 }
@@ -1714,9 +1712,9 @@
1714 1712
1715 1713 public function local_seo_email_callback()
1716 1714 {
1717 1715 printf(
1718 - '<input type="text" id="local_seo_email" name="' . Metasync_Admin::option_key . '[localseo][local_seo_email]" value="%s" size="50" />',
1716 + '<input type="text" id="local_seo_email" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][local_seo_email]" value="%s" size="50" />',
1719 1717 isset(Metasync::get_option('localseo')['local_seo_email']) ? esc_attr(Metasync::get_option('localseo')['local_seo_email']) : ''
1720 1718 );
1721 1719
1722 1720 printf(' <br> <span class="description"> Search engines display your email address. </span>');
@@ -1724,9 +1722,9 @@
1724 1722
1725 1723 public function local_seo_phone_callback()
1726 1724 {
1727 1725 printf(
1728 - '<input type="text" id="local_seo_phone" name="' . Metasync_Admin::option_key . '[localseo][local_seo_phone]" value="%s" size="50" />',
1726 + '<input type="text" id="local_seo_phone" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][local_seo_phone]" value="%s" size="50" />',
1729 1727 isset(Metasync::get_option('localseo')['local_seo_phone']) ? esc_attr(Metasync::get_option('localseo')['local_seo_phone']) : ''
1730 1728 );
1731 1729
1732 1730 printf(' <br> <span class="description"> Search engines may prominently display your contact phone number for mobile users. </span>');
@@ -1734,29 +1732,29 @@
1734 1732
1735 1733 public function local_seo_address_callback()
1736 1734 {
1737 1735 printf(
1738 - '<input type="text" id="local_seo_address_street" name="' . Metasync_Admin::option_key . '[localseo][address][street]" value="%s" size="50" placeholder="Street Address"/> <br>',
1736 + '<input type="text" id="local_seo_address_street" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][address][street]" value="%s" size="50" placeholder="Street Address"/> <br>',
1739 1737 isset(Metasync::get_option('localseo')['address']['street']) ? esc_attr(Metasync::get_option('localseo')['address']['street']) : ''
1740 1738 );
1741 1739
1742 1740 printf(
1743 - '<input type="text" id="local_seo_address_locality" name="' . Metasync_Admin::option_key . '[localseo][address][locality]" value="%s" size="50" placeholder="Locality"/> <br>',
1741 + '<input type="text" id="local_seo_address_locality" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][address][locality]" value="%s" size="50" placeholder="Locality"/> <br>',
1744 1742 isset(Metasync::get_option('localseo')['address']['locality']) ? esc_attr(Metasync::get_option('localseo')['address']['locality']) : ''
1745 1743 );
1746 1744
1747 1745 printf(
1748 - '<input type="text" id="local_seo_address_region" name="' . Metasync_Admin::option_key . '[localseo][address][region]" value="%s" size="50" placeholder="Region"/> <br>',
1746 + '<input type="text" id="local_seo_address_region" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][address][region]" value="%s" size="50" placeholder="Region"/> <br>',
1749 1747 isset(Metasync::get_option('localseo')['address']['region']) ? esc_attr(Metasync::get_option('localseo')['address']['region']) : ''
1750 1748 );
1751 1749
1752 1750 printf(
1753 - '<input type="text" id="local_seo_address_postalcode" name="' . Metasync_Admin::option_key . '[localseo][address][postalcode]" value="%s" size="50" placeholder="Postal Code"/> <br>',
1751 + '<input type="text" id="local_seo_address_postalcode" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][address][postalcode]" value="%s" size="50" placeholder="Postal Code"/> <br>',
1754 1752 isset(Metasync::get_option('localseo')['address']['postalcode']) ? esc_attr(Metasync::get_option('localseo')['address']['postalcode']) : ''
1755 1753 );
1756 1754
1757 1755 printf(
1758 - '<input type="text" id="local_seo_address_country" name="' . Metasync_Admin::option_key . '[localseo][address][country]" value="%s" size="50" placeholder="Country"/> <br>',
1756 + '<input type="text" id="local_seo_address_country" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][address][country]" value="%s" size="50" placeholder="Country"/> <br>',
1759 1757 isset(Metasync::get_option('localseo')['address']['country']) ? esc_attr(Metasync::get_option('localseo')['address']['country']) : ''
1760 1758 );
1761 1759 }
1762 1760
@@ -1771,9 +1769,9 @@
1771 1769 <select name="<?php echo esc_attr(Metasync_Admin::option_key . '[localseo][local_seo_business_type]') ?>">
1772 1770 <option value='0'>Select Business Type</option>
1773 1771 <?php
1774 1772 foreach ($types as $type) {
1775 - printf('<option value="%s" %s >%s</option>', $type, selected($type, esc_attr($business_type)), $type);
1773 + printf('<option value="%s" %s >%s</option>', esc_attr($type), selected($type, $business_type, false), esc_html($type));
1776 1774 }
1777 1775 ?>
1778 1776 </select>
1779 1777 <?php
@@ -1797,9 +1795,9 @@
1797 1795 <li>
1798 1796 <select name="<?php echo esc_attr(Metasync_Admin::option_key . '[localseo][days][]') ?>">
1799 1797 <?php
1800 1798 foreach ($days_name as $name) {
1801 - printf('<option value="%s" %s >%s</option>', $name, selected(esc_attr($name), esc_attr($day_name)), esc_attr($name));
1799 + printf('<option value="%s" %s >%s</option>', esc_attr($name), selected($name, $day_name, false), esc_html($name));
1802 1800 }
1803 1801 ?>
1804 1802 </select>
1805 1803 <input type="text" name="<?php echo esc_attr(Metasync_Admin::option_key . '[localseo][times][]') ?>" value="<?php echo esc_attr($day_time) ?>">
@@ -1878,9 +1876,9 @@
1878 1876
1879 1877 public function local_seo_price_range_callback()
1880 1878 {
1881 1879 printf(
1882 - '<input type="text" id="local_seo_price_range" name="' . Metasync_Admin::option_key . '[localseo][local_seo_price_range]" value="%s" size="50" />',
1880 + '<input type="text" id="local_seo_price_range" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][local_seo_price_range]" value="%s" size="50" />',
1883 1881 isset(Metasync::get_option('localseo')['local_seo_price_range']) ? esc_attr(Metasync::get_option('localseo')['local_seo_price_range']) : ''
1884 1882 );
1885 1883 printf(' <br> <span class="description"> The price range of the business, for example $$$. </span>');
1886 1884 }
@@ -1893,9 +1891,9 @@
1893 1891 <?php
1894 1892 $about_page = Metasync::get_option('localseo')['local_seo_about_page'] ?? '';
1895 1893 $pages = get_pages();
1896 1894 foreach ($pages as $page) {
1897 - printf('<option value="%s" %s >%s</option>', $page->ID, selected($page->ID, esc_attr($about_page)), $page->post_title);
1895 + printf('<option value="%s" %s >%s</option>', absint($page->ID), selected($page->ID, $about_page, false), esc_html($page->post_title));
1898 1896 }
1899 1897 ?>
1900 1898 </select>
1901 1899 <?php
@@ -1910,9 +1908,9 @@
1910 1908 <?php
1911 1909 $contact_page = Metasync::get_option('localseo')['local_seo_contact_page'] ?? '';
1912 1910 $pages = get_pages();
1913 1911 foreach ($pages as $page) {
1914 - printf('<option value="%s" %s >%s</option>', $page->ID, selected($page->ID, esc_attr($contact_page)), $page->post_title);
1912 + printf('<option value="%s" %s >%s</option>', absint($page->ID), selected($page->ID, $contact_page, false), esc_html($page->post_title));
1915 1913 }
1916 1914 ?>
1917 1915 </select>
1918 1916 <?php
@@ -1921,9 +1919,9 @@
1921 1919
1922 1920 public function local_seo_map_key_callback()
1923 1921 {
1924 1922 printf(
1925 - '<input type="text" id="local_seo_map_key" name="' . Metasync_Admin::option_key . '[localseo][local_seo_map_key]" value="%s" size="50" />',
1923 + '<input type="text" id="local_seo_map_key" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][local_seo_map_key]" value="%s" size="50" />',
1926 1924 isset(Metasync::get_option('localseo')['local_seo_map_key']) ? esc_attr(Metasync::get_option('localseo')['local_seo_map_key']) : ''
1927 1925 );
1928 1926
1929 1927 printf(' <br> <span class="description"> An API Key is required to display embedded Google Maps on your site. </span>');
@@ -1931,9 +1929,9 @@
1931 1929
1932 1930 public function local_seo_geo_coordinates_callback()
1933 1931 {
1934 1932 printf(
1935 - '<input type="text" id="local_seo_geo_coordinates" name="' . Metasync_Admin::option_key . '[localseo][local_seo_geo_coordinates]" value="%s" size="50" />',
1933 + '<input type="text" id="local_seo_geo_coordinates" name="' . esc_attr(Metasync_Admin::option_key) . '[localseo][local_seo_geo_coordinates]" value="%s" size="50" />',
1936 1934 isset(Metasync::get_option('localseo')['local_seo_geo_coordinates']) ? esc_attr(Metasync::get_option('localseo')['local_seo_geo_coordinates']) : ''
1937 1935 );
1938 1936
1939 1937 printf(' <br> <span class="description"> Latitude and longitude values separated by comma. </span>');
@@ -1941,9 +1939,9 @@
1941 1939
1942 1940 public function header_snippets_callback()
1943 1941 {
1944 1942 printf(
1945 - '<textarea class="wide-text" id="header_snippets" rows="8" name="' . Metasync_Admin::option_key . '[codesnippets][header_snippet]" >%s</textarea>',
1943 + '<textarea class="wide-text" id="header_snippets" rows="8" name="' . esc_attr(Metasync_Admin::option_key) . '[codesnippets][header_snippet]" >%s</textarea>',
1946 1944 isset(Metasync::get_option('codesnippets')['header_snippet']) ? esc_attr(Metasync::get_option('codesnippets')['header_snippet']) : ''
1947 1945 );
1948 1946 }
1949 1947
@@ -1949,9 +1947,9 @@
1949 1947
1950 1948 public function footer_snippets_callback()
1951 1949 {
1952 1950 printf(
1953 - '<textarea class="wide-text" id="footer_snippets" rows="8" name="' . Metasync_Admin::option_key . '[codesnippets][footer_snippet]" >%s</textarea>',
1951 + '<textarea class="wide-text" id="footer_snippets" rows="8" name="' . esc_attr(Metasync_Admin::option_key) . '[codesnippets][footer_snippet]" >%s</textarea>',
1954 1952 isset(Metasync::get_option('codesnippets')['footer_snippet']) ? esc_attr(Metasync::get_option('codesnippets')['footer_snippet']) : ''
1955 1953 );
1956 1954 }
1957 1955
@@ -2088,9 +2086,9 @@
2088 2086
2089 2087 public function global_open_graph_meta_callback()
2090 2088 {
2091 2089 printf(
2092 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][open_graph_meta_tags]" value="true" %s />',
2090 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][open_graph_meta_tags]" value="true" %s />',
2093 2091 isset(Metasync::get_option('common_meta_settings')['open_graph_meta_tags']) && Metasync::get_option('common_meta_settings')['open_graph_meta_tags'] == 'true' ? 'checked' : ''
2094 2092 );
2095 2093 printf(' <br> <span class="description"> Automatically add the Open Graph meta tags in a page or post.</span>');
2096 2094 }
@@ -2097,9 +2095,9 @@
2097 2095
2098 2096 public function global_facebook_meta_callback()
2099 2097 {
2100 2098 printf(
2101 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][facebook_meta_tags]" value="true" %s />',
2099 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][facebook_meta_tags]" value="true" %s />',
2102 2100 isset(Metasync::get_option('common_meta_settings')['facebook_meta_tags']) && Metasync::get_option('common_meta_settings')['facebook_meta_tags'] == 'true' ? 'checked' : ''
2103 2101 );
2104 2102 printf(' <br> <span class="description"> Automatically add the Facebook meta tags in a page or post.</span>');
2105 2103 }
@@ -2106,9 +2104,9 @@
2106 2104
2107 2105 public function global_twitter_meta_callback()
2108 2106 {
2109 2107 printf(
2110 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][twitter_meta_tags]" value="true" %s />',
2108 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][twitter_meta_tags]" value="true" %s />',
2111 2109 isset(Metasync::get_option('common_meta_settings')['twitter_meta_tags']) && Metasync::get_option('common_meta_settings')['twitter_meta_tags'] == 'true' ? 'checked' : ''
2112 2110 );
2113 2111 printf(' <br> <span class="description"> Automatically add the Twitter meta tags in a page or post.</span>');
2114 2112 }
@@ -2116,9 +2114,9 @@
2116 2114 public function og_image_dimensions_callback()
2117 2115 {
2118 2116 $val = Metasync::get_option('common_meta_settings')['og_image_dimensions'] ?? 'true';
2119 2117 printf(
2120 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][og_image_dimensions]" value="true" %s />',
2118 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][og_image_dimensions]" value="true" %s />',
2121 2119 $val === 'true' ? 'checked' : ''
2122 2120 );
2123 2121 printf('<span class="description"> Output og:image:width, og:image:height, and og:image:type when OG image metadata is available.</span>');
2124 2122 }
@@ -2126,9 +2124,9 @@
2126 2124 public function article_timestamps_callback()
2127 2125 {
2128 2126 $val = Metasync::get_option('common_meta_settings')['article_timestamps'] ?? 'true';
2129 2127 printf(
2130 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][article_timestamps]" value="true" %s />',
2128 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][article_timestamps]" value="true" %s />',
2131 2129 $val === 'true' ? 'checked' : ''
2132 2130 );
2133 2131 printf('<span class="description"> Output article:published_time and article:modified_time from the post publish and modified dates (ISO 8601).</span>');
2134 2132 }
@@ -2136,9 +2134,9 @@
2136 2134 public function article_author_callback()
2137 2135 {
2138 2136 $val = Metasync::get_option('common_meta_settings')['article_author'] ?? 'true';
2139 2137 printf(
2140 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][article_author]" value="true" %s />',
2138 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][article_author]" value="true" %s />',
2141 2139 $val === 'true' ? 'checked' : ''
2142 2140 );
2143 2141 printf('<span class="description"> Output article:author using the post author website URL or archive URL (overridable per-post via _metasync_og_article_author meta).</span>');
2144 2142 }
@@ -2146,9 +2144,9 @@
2146 2144 public function article_section_callback()
2147 2145 {
2148 2146 $val = Metasync::get_option('common_meta_settings')['article_section'] ?? 'true';
2149 2147 printf(
2150 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][article_section]" value="true" %s />',
2148 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][article_section]" value="true" %s />',
2151 2149 $val === 'true' ? 'checked' : ''
2152 2150 );
2153 2151 printf('<span class="description"> Output article:section from the primary category (falls back to first category).</span>');
2154 2152 }
@@ -2156,9 +2154,9 @@
2156 2154 public function article_tags_callback()
2157 2155 {
2158 2156 $val = Metasync::get_option('common_meta_settings')['article_tags'] ?? 'true';
2159 2157 printf(
2160 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][article_tags]" value="true" %s />',
2158 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][article_tags]" value="true" %s />',
2161 2159 $val === 'true' ? 'checked' : ''
2162 2160 );
2163 2161 printf('<span class="description"> Output one article:tag meta tag per WordPress post tag.</span>');
2164 2162 }
@@ -2166,9 +2164,9 @@
2166 2164 public function twitter_image_alt_callback()
2167 2165 {
2168 2166 $val = Metasync::get_option('common_meta_settings')['twitter_image_alt'] ?? 'true';
2169 2167 printf(
2170 - '<input type="checkbox" name="' . Metasync_Admin::option_key . '[common_meta_settings][twitter_image_alt]" value="true" %s />',
2168 + '<input type="checkbox" name="' . esc_attr(Metasync_Admin::option_key) . '[common_meta_settings][twitter_image_alt]" value="true" %s />',
2171 2169 $val === 'true' ? 'checked' : ''
2172 2170 );
2173 2171 printf('<span class="description"> Output twitter:image:alt using the stored alt text or the OG image attachment alt attribute.</span>');
2174 2172 }
@@ -2175,9 +2173,9 @@
2175 2173
2176 2174 public function facebook_page_url_callback()
2177 2175 {
2178 2176 $facebook_page_url = Metasync::get_option('social_meta')['facebook_page_url'] ?? '';
2179 - printf('<input type="text" name="' . Metasync_Admin::option_key . '[social_meta][facebook_page_url]" value="%s" size="50" />', esc_attr($facebook_page_url));
2177 + printf('<input type="text" name="' . esc_attr(Metasync_Admin::option_key) . '[social_meta][facebook_page_url]" value="%s" size="50" />', esc_attr($facebook_page_url));
2180 2178 printf('<br><span class="description"> Enter your Facebook page URL. eg: <code>https://www.facebook.com/MetaSync/</code> </span>');
2181 2179 }
2182 2180
2183 2181 public function facebook_authorship_callback()
@@ -2182,9 +2180,9 @@
2182 2180
2183 2181 public function facebook_authorship_callback()
2184 2182 {
2185 2183 $facebook_authorship = Metasync::get_option('social_meta')['facebook_authorship'] ?? '';
2186 - printf('<input type="text" name="' . Metasync_Admin::option_key . '[social_meta][facebook_authorship]" value="%s" size="50" />', esc_attr($facebook_authorship));
2184 + printf('<input type="text" name="' . esc_attr(Metasync_Admin::option_key) . '[social_meta][facebook_authorship]" value="%s" size="50" />', esc_attr($facebook_authorship));
2187 2185 printf('<br><span class="description"> Enter Facebook profile URL to show Facebook Authorship when your articles are being shared on Facebook. eg: <code>https://www.facebook.com/shahrukh/</code> </span>');
2188 2186 }
2189 2187
2190 2188 public function facebook_admin_callback()
@@ -2189,9 +2187,9 @@
2189 2187
2190 2188 public function facebook_admin_callback()
2191 2189 {
2192 2190 $facebook_admin = Metasync::get_option('social_meta')['facebook_admin'] ?? '';
2193 - printf('<input type="text" name="' . Metasync_Admin::option_key . '[social_meta][facebook_admin]" value="%s" size="50" />', esc_attr($facebook_admin));
2191 + printf('<input type="text" name="' . esc_attr(Metasync_Admin::option_key) . '[social_meta][facebook_admin]" value="%s" size="50" />', esc_attr($facebook_admin));
2194 2192 printf(' <br> <span class="description"> Enter numeric user ID of Facebook. </span>');
2195 2193 }
2196 2194
2197 2195 public function facebook_app_callback()
@@ -2196,9 +2194,9 @@
2196 2194
2197 2195 public function facebook_app_callback()
2198 2196 {
2199 2197 $facebook_app = Metasync::get_option('social_meta')['facebook_app'] ?? '';
2200 - printf('<input type="text" name="' . Metasync_Admin::option_key . '[social_meta][facebook_app]" value="%s" size="50" />', esc_attr($facebook_app));
2198 + printf('<input type="text" name="' . esc_attr(Metasync_Admin::option_key) . '[social_meta][facebook_app]" value="%s" size="50" />', esc_attr($facebook_app));
2201 2199 printf(' <br> <span class="description"> Enter numeric app ID of Facebook </span>');
2202 2200 }
2203 2201
2204 2202 public function facebook_secret_callback()
@@ -2203,9 +2201,9 @@
2203 2201
2204 2202 public function facebook_secret_callback()
2205 2203 {
2206 2204 $facebook_secret = Metasync::get_option('social_meta')['facebook_secret'] ?? '';
2207 - printf('<input type="text" name="' . Metasync_Admin::option_key . '[social_meta][facebook_secret]" value="%s" size="50" />', esc_attr($facebook_secret));
2205 + printf('<input type="text" name="' . esc_attr(Metasync_Admin::option_key) . '[social_meta][facebook_secret]" value="%s" size="50" />', esc_attr($facebook_secret));
2208 2206 printf(' <br> <span class="description"> Enter alphanumeric access token from Facebook. </span>');
2209 2207 }
2210 2208
2211 2209 public function twitter_username_callback()
@@ -2210,9 +2208,9 @@
2210 2208
2211 2209 public function twitter_username_callback()
2212 2210 {
2213 2211 $twitter_username = Metasync::get_option('social_meta')['twitter_username'] ?? '';
2214 - printf('<input type="text" name="' . Metasync_Admin::option_key . '[social_meta][twitter_username]" value="%s" size="50" />', esc_attr($twitter_username));
2212 + printf('<input type="text" name="' . esc_attr(Metasync_Admin::option_key) . '[social_meta][twitter_username]" value="%s" size="50" />', esc_attr($twitter_username));
2215 2213 printf(' <br> <span class="description"> Twitter username of the author to add <code>twitter:creator</code> tag to post. eg: <code>MetaSync</code> </span>');
2216 2214 }
2217 2215
2218 2216 public static function get_business_types()